@mappedin/mappedin-js 6.0.1-beta.49 → 6.0.1-beta.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/{GLTFExporter-ESCDGZUC.js → GLTFExporter-NSCWM6JS.js} +2 -2
- package/lib/esm/{GLTFLoader-KRE6VVI2.js → GLTFLoader-P7OIN6GY.js} +2 -2
- package/lib/esm/{browser-BKM6BTVQ.js → browser-6V77MKQS.js} +2 -2
- package/lib/esm/{chunk-TQZZUEDW.js → chunk-3JJZGEB7.js} +24 -24
- package/lib/esm/{chunk-TQZZUEDW.js.map → chunk-3JJZGEB7.js.map} +3 -3
- package/lib/esm/{chunk-EBEZBJTY.js → chunk-DSSOZXRM.js} +2 -2
- package/lib/esm/{chunk-BBNTGIFB.js → chunk-I5GOIM6Y.js} +2 -2
- package/lib/esm/{chunk-BBNTGIFB.js.map → chunk-I5GOIM6Y.js.map} +1 -1
- package/lib/esm/chunk-JEQGUEFF.js +2 -0
- package/lib/esm/{chunk-5N73RBNE.js.map → chunk-JEQGUEFF.js.map} +1 -1
- package/lib/esm/{chunk-QSDIHKLQ.js → chunk-SPVBFPOK.js} +2 -2
- package/lib/esm/{chunk-34JGYGBQ.js → chunk-YDKOKGLT.js} +2 -2
- package/lib/esm/index.d.ts +45 -16
- package/lib/esm/index.js +1 -1
- package/lib/esm/{inspector-UVCVD35T.js → inspector-GKTULNKY.js} +2 -2
- package/lib/esm/{internal-ZOHXUIA6.js → internal-CE37LADZ.js} +2 -2
- package/lib/esm/{outdoor-context-v4-B6ZFZFG7.js → outdoor-context-v4-OHJPVR4U.js} +2 -2
- package/lib/esm/{text3d-ACVNKUMC.js → text3d-QUUOTI5N.js} +2 -2
- package/lib/index-rn.js +1 -1
- package/package.json +2 -2
- package/lib/esm/chunk-5N73RBNE.js +0 -2
- /package/lib/esm/{GLTFExporter-ESCDGZUC.js.map → GLTFExporter-NSCWM6JS.js.map} +0 -0
- /package/lib/esm/{GLTFLoader-KRE6VVI2.js.map → GLTFLoader-P7OIN6GY.js.map} +0 -0
- /package/lib/esm/{browser-BKM6BTVQ.js.map → browser-6V77MKQS.js.map} +0 -0
- /package/lib/esm/{chunk-EBEZBJTY.js.map → chunk-DSSOZXRM.js.map} +0 -0
- /package/lib/esm/{chunk-QSDIHKLQ.js.map → chunk-SPVBFPOK.js.map} +0 -0
- /package/lib/esm/{chunk-34JGYGBQ.js.map → chunk-YDKOKGLT.js.map} +0 -0
- /package/lib/esm/{inspector-UVCVD35T.js.map → inspector-GKTULNKY.js.map} +0 -0
- /package/lib/esm/{internal-ZOHXUIA6.js.map → internal-CE37LADZ.js.map} +0 -0
- /package/lib/esm/{outdoor-context-v4-B6ZFZFG7.js.map → outdoor-context-v4-OHJPVR4U.js.map} +0 -0
- /package/lib/esm/{text3d-ACVNKUMC.js.map → text3d-QUUOTI5N.js.map} +0 -0
package/lib/index-rn.js
CHANGED
|
@@ -63,7 +63,7 @@ Behavioral notes:
|
|
|
63
63
|
}`}function xe(L,ue){let k=ee.language==="typescript"?`: ${ue}`:"";return`${L}${k}`}function Pe(L){return ee.language==="typescript"?`: ${L}`:""}function Zr(L,ue,k){let be=He("check",L,ue,"value"),pe=xe("value","any"),he=Pe("boolean"),Jt=[...ee.functions.values()],ui=[...ee.variables.values()],Us=wr(L.$id)?`return function check(${pe})${he} {
|
|
64
64
|
return ${je(L.$id)}(value)
|
|
65
65
|
}`:`return ${be}`;return[...ui,...Jt,Us].join(`
|
|
66
|
-
`)}function Tr(...L){let ue={language:"javascript"},[k,be,pe]=L.length===2&&rt(L[1])?[L[0],L[1],ue]:L.length===2&&!rt(L[1])?[L[0],[],L[1]]:L.length===3?[L[0],L[1],L[2]]:L.length===1?[L[0],[],ue]:[null,[],ue];if(ee.language=pe.language,ee.variables.clear(),ee.functions.clear(),ee.instances.clear(),!Sr(k))throw new C3(k);for(let he of be)if(!Sr(he))throw new C3(he);return Zr(k,be,pe)}t.Code=Tr;function nn(L,ue=[]){let k=Tr(L,ue,{language:"javascript"}),be=globalThis.Function("kind","format","hash",k),pe=new Map(ee.instances);function he(nl,Fl,zv){if(!Fo.Has(nl)||!pe.has(Fl))return!1;let SO=Fo.Get(nl),zP=pe.get(Fl);return SO(zP,zv)}function Jt(nl,Fl){return Fa.Has(nl)?Fa.Get(nl)(Fl):!1}function ui(nl){return am(nl)}let Us=be(he,Jt,ui);return new XN(L,ue,Us,k)}t.Compile=nn})(T3||(T3={}))});var lse=h(()=>{ase()});function zBe(t,e,r){return r||(r=e,e={}),typeof r!="function"&&Ki(7),Tse(t,e,[BBe],function(n){return N3(uB(n.data[0],n.data[1]))},0,r)}function uB(t,e){return Pse(t,e||{},0,0)}function VBe(t,e,r){return r||(r=e,e={}),typeof r!="function"&&Ki(7),Tse(t,e,[NBe],function(n){return N3(cB(n.data[0],Cse(n.data[1])))},1,r)}function cB(t,e){return wse(t,{i:2},e&&e.out,e&&e.dictionary)}function k3(t,e){if(e){for(var r=new Bn(t.length),n=0;n<t.length;++n)r[n]=t.charCodeAt(n);return r}if(pse)return pse.encode(t);for(var i=t.length,o=new Bn(t.length+(t.length>>1)),s=0,a=function(c){o[s++]=c},n=0;n<i;++n){if(s+5>o.length){var l=new Bn(s+8+(i-n<<1));l.set(o),o=l}var u=t.charCodeAt(n);u<128||e?a(u):u<2048?(a(192|u>>6),a(128|u&63)):u>55295&&u<57344?(u=65536+(u&1047552)|t.charCodeAt(++n)&1023,a(240|u>>18),a(128|u>>12&63),a(128|u>>6&63),a(128|u&63)):(a(224|u>>12),a(128|u>>6&63),a(128|u&63))}return xg(o,0,s)}function pB(t,e){if(e){for(var r="",n=0;n<t.length;n+=16384)r+=String.fromCharCode.apply(null,t.subarray(n,n+16384));return r}else{if(nB)return nB.decode(t);var i=GBe(t),o=i.s,r=i.r;return r.length&&Ki(8),o}}function Mse(t,e,r){r||(r=e,e={}),typeof r!="function"&&Ki(7);var n={};Ese(t,"",n,e);var i=Object.keys(n),o=i.length,s=0,a=0,l=o,u=new Array(o),c=[],p=function(){for(var g=0;g<c.length;++g)c[g]()},f=function(g,b){F3(function(){r(g,b)})};F3(function(){f=r});var d=function(){var g=new Bn(a+22),b=s,w=a-s;a=0;for(var S=0;S<l;++S){var I=u[S];try{var P=I.c.length;fse(g,a,I,I.f,I.u,P);var T=30+I.f.length+iB(I.extra),M=a+T;g.set(I.c,M),fse(g,s,I,I.f,I.u,P,a,I.m),s+=16+T+(I.m?I.m.length:0),a=M+P}catch(E){return f(E,null)}}HBe(g,s,u.length,w,b),f(null,g)};o||d();for(var m=function(g){var b=i[g],w=n[b],S=w[0],I=w[1],P=kBe(),T=S.length;P.p(S);var M=k3(b),E=M.length,D=I.comment,B=D&&k3(D),$=B&&B.length,U=iB(I.extra),Y=I.level==0?0:8,G=function(ne,le){if(ne)p(),f(ne,null);else{var se=le.length;u[g]=lB(I,{size:T,crc:P.d(),c:le,f:M,m:B,u:E!=b.length||B&&D.length!=$,compression:Y}),s+=30+E+U+se,a+=76+2*(E+U)+($||0)+se,--o||d()}};if(E>65535&&G(Ki(11,0,1),null),!Y)G(null,S);else if(T<16e4)try{G(null,uB(S,I))}catch(ne){G(ne,null)}else c.push(zBe(S,I,G))},y=0;y<l;++y)m(y);return p}function Ase(t,e,r){r||(r=e,e={}),typeof r!="function"&&Ki(7);var n=[],i=function(){for(var g=0;g<n.length;++g)n[g]()},o={},s=function(g,b){F3(function(){r(g,b)})};F3(function(){s=r});for(var a=t.length-22;Vc(t,a)!=101010256;--a)if(!a||t.length-a>65558)return s(Ki(13,0,1),null),i;var l=nf(t,a+8);if(l){var u=l,c=Vc(t,a+16),p=c==4294967295||u==65535;if(p){var f=Vc(t,a-12);p=Vc(t,f)==101075792,p&&(u=l=Vc(t,f+32),c=Vc(t,f+48))}for(var d=e&&e.filter,m=function(g){var b=$Be(t,c,p),w=b[0],S=b[1],I=b[2],P=b[3],T=b[4],M=b[5],E=jBe(t,M);c=T;var D=function($,U){$?(i(),s($,null)):(U&&(o[P]=U),--l||s(null,o))};if(!d||d({name:P,size:S,originalSize:I,compression:w}))if(!w)D(null,xg(t,E,E+S));else if(w==8){var B=t.subarray(E,E+S);if(I<524288||S>.8*I)try{D(null,cB(B,{out:new Bn(I)}))}catch($){D($,null)}else n.push(VBe(B,{size:I},D))}else D(Ki(14,"unknown compression type "+w,1),null);else D(null,null)},y=0;y<u;++y)m(y)}else s(null,{});return i}var use,DBe,Bn,sa,pI,b1,_1,uI,hse,dse,oB,D3,mse,yse,eB,cI,Sh,en,Mu,Ih,en,en,en,en,x1,en,gse,vse,xse,bse,M3,Eu,A3,fI,xg,R3,_se,Ki,wse,rf,g1,L3,O3,tB,v1,sB,rB,Sse,aB,Ise,OBe,kBe,Pse,lB,cse,E3,FBe,RBe,NBe,BBe,N3,Cse,Tse,nf,Vc,QN,as,Ese,pse,nB,UBe,GBe,jBe,$Be,qBe,iB,fse,HBe,F3,hI=h(()=>{use={},DBe=function(t,e,r,n,i){var o=new Worker(use[e]||(use[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return o.onmessage=function(s){var a=s.data,l=a.$e$;if(l){var u=new Error(l[0]);u.code=l[1],u.stack=l[2],i(u,null)}else i(null,a)},o.postMessage(r,n),o},Bn=Uint8Array,sa=Uint16Array,pI=Int32Array,b1=new Bn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),_1=new Bn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),uI=new Bn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),hse=function(t,e){for(var r=new sa(31),n=0;n<31;++n)r[n]=e+=1<<t[n-1];for(var i=new pI(r[30]),n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)i[o]=o-r[n]<<5|n;return{b:r,r:i}},dse=hse(b1,2),oB=dse.b,D3=dse.r;oB[28]=258,D3[258]=28;mse=hse(_1,0),yse=mse.b,eB=mse.r,cI=new sa(32768);for(en=0;en<32768;++en)Sh=(en&43690)>>1|(en&21845)<<1,Sh=(Sh&52428)>>2|(Sh&13107)<<2,Sh=(Sh&61680)>>4|(Sh&3855)<<4,cI[en]=((Sh&65280)>>8|(Sh&255)<<8)>>1;Mu=function(t,e,r){for(var n=t.length,i=0,o=new sa(e);i<n;++i)t[i]&&++o[t[i]-1];var s=new sa(e);for(i=1;i<e;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(r){a=new sa(1<<e);var l=15-e;for(i=0;i<n;++i)if(t[i])for(var u=i<<4|t[i],c=e-t[i],p=s[t[i]-1]++<<c,f=p|(1<<c)-1;p<=f;++p)a[cI[p]>>l]=u}else for(a=new sa(n),i=0;i<n;++i)t[i]&&(a[i]=cI[s[t[i]-1]++]>>15-t[i]);return a},Ih=new Bn(288);for(en=0;en<144;++en)Ih[en]=8;for(en=144;en<256;++en)Ih[en]=9;for(en=256;en<280;++en)Ih[en]=7;for(en=280;en<288;++en)Ih[en]=8;x1=new Bn(32);for(en=0;en<32;++en)x1[en]=5;gse=Mu(Ih,9,0),vse=Mu(Ih,9,1),xse=Mu(x1,5,0),bse=Mu(x1,5,1),M3=function(t){for(var e=t[0],r=1;r<t.length;++r)t[r]>e&&(e=t[r]);return e},Eu=function(t,e,r){var n=e/8|0;return(t[n]|t[n+1]<<8)>>(e&7)&r},A3=function(t,e){var r=e/8|0;return(t[r]|t[r+1]<<8|t[r+2]<<16)>>(e&7)},fI=function(t){return(t+7)/8|0},xg=function(t,e,r){return(e==null||e<0)&&(e=0),(r==null||r>t.length)&&(r=t.length),new Bn(t.subarray(e,r))},R3={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14},_se=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Ki=function(t,e,r){var n=new Error(e||_se[t]);if(n.code=t,Error.captureStackTrace&&Error.captureStackTrace(n,Ki),!r)throw n;return n},wse=function(t,e,r,n){var i=t.length,o=n?n.length:0;if(!i||e.f&&!e.l)return r||new Bn(0);var s=!r,a=s||e.i!=2,l=e.i;s&&(r=new Bn(i*3));var u=function(k){var be=r.length;if(k>be){var pe=new Bn(Math.max(be*2,k));pe.set(r),r=pe}},c=e.f||0,p=e.p||0,f=e.b||0,d=e.l,m=e.d,y=e.m,g=e.n,b=i*8;do{if(!d){c=Eu(t,p,1);var w=Eu(t,p+1,3);if(p+=3,w)if(w==1)d=vse,m=bse,y=9,g=5;else if(w==2){var T=Eu(t,p,31)+257,M=Eu(t,p+10,15)+4,E=T+Eu(t,p+5,31)+1;p+=14;for(var D=new Bn(E),B=new Bn(19),$=0;$<M;++$)B[uI[$]]=Eu(t,p+$*3,7);p+=M*3;for(var U=M3(B),Y=(1<<U)-1,G=Mu(B,U,1),$=0;$<E;){var ne=G[Eu(t,p,Y)];p+=ne&15;var S=ne>>4;if(S<16)D[$++]=S;else{var le=0,se=0;for(S==16?(se=3+Eu(t,p,3),p+=2,le=D[$-1]):S==17?(se=3+Eu(t,p,7),p+=3):S==18&&(se=11+Eu(t,p,127),p+=7);se--;)D[$++]=le}}var X=D.subarray(0,T),ee=D.subarray(T);y=M3(X),g=M3(ee),d=Mu(X,y,1),m=Mu(ee,g,1)}else Ki(1);else{var S=fI(p)+4,I=t[S-4]|t[S-3]<<8,P=S+I;if(P>i){l&&Ki(0);break}a&&u(f+I),r.set(t.subarray(S,P),f),e.b=f+=I,e.p=p=P*8,e.f=c;continue}if(p>b){l&&Ki(0);break}}a&&u(f+131072);for(var Ee=(1<<y)-1,je=(1<<g)-1,Le=p;;Le=p){var le=d[A3(t,p)&Ee],He=le>>4;if(p+=le&15,p>b){l&&Ki(0);break}if(le||Ki(2),He<256)r[f++]=He;else if(He==256){Le=p,d=null;break}else{var xe=He-254;if(He>264){var $=He-257,Pe=b1[$];xe=Eu(t,p,(1<<Pe)-1)+oB[$],p+=Pe}var Zr=m[A3(t,p)&je],Tr=Zr>>4;Zr||Ki(3),p+=Zr&15;var ee=yse[Tr];if(Tr>3){var Pe=_1[Tr];ee+=A3(t,p)&(1<<Pe)-1,p+=Pe}if(p>b){l&&Ki(0);break}a&&u(f+131072);var nn=f+xe;if(f<ee){var L=o-ee,ue=Math.min(ee,nn);for(L+f<0&&Ki(3);f<ue;++f)r[f]=n[L+f]}for(;f<nn;++f)r[f]=r[f-ee]}}e.l=d,e.p=Le,e.b=f,e.f=c,d&&(c=1,e.m=y,e.d=m,e.n=g)}while(!c);return f!=r.length&&s?xg(r,0,f):r.subarray(0,f)},rf=function(t,e,r){r<<=e&7;var n=e/8|0;t[n]|=r,t[n+1]|=r>>8},g1=function(t,e,r){r<<=e&7;var n=e/8|0;t[n]|=r,t[n+1]|=r>>8,t[n+2]|=r>>16},L3=function(t,e){for(var r=[],n=0;n<t.length;++n)t[n]&&r.push({s:n,f:t[n]});var i=r.length,o=r.slice();if(!i)return{t:aB,l:0};if(i==1){var s=new Bn(r[0].s+1);return s[r[0].s]=1,{t:s,l:1}}r.sort(function(P,T){return P.f-T.f}),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,c=1,p=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=i-1;)a=r[r[u].f<r[p].f?u++:p++],l=r[u!=c&&r[u].f<r[p].f?u++:p++],r[c++]={s:-1,f:a.f+l.f,l:a,r:l};for(var f=o[0].s,n=1;n<i;++n)o[n].s>f&&(f=o[n].s);var d=new sa(f+1),m=O3(r[c-1],d,0);if(m>e){var n=0,y=0,g=m-e,b=1<<g;for(o.sort(function(T,M){return d[M.s]-d[T.s]||T.f-M.f});n<i;++n){var w=o[n].s;if(d[w]>e)y+=b-(1<<m-d[w]),d[w]=e;else break}for(y>>=g;y>0;){var S=o[n].s;d[S]<e?y-=1<<e-d[S]++-1:++n}for(;n>=0&&y;--n){var I=o[n].s;d[I]==e&&(--d[I],++y)}m=e}return{t:new Bn(d),l:m}},O3=function(t,e,r){return t.s==-1?Math.max(O3(t.l,e,r+1),O3(t.r,e,r+1)):e[t.s]=r},tB=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new sa(++e),n=0,i=t[0],o=1,s=function(l){r[n++]=l},a=1;a<=e;++a)if(t[a]==i&&a!=e)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=t[a]}return{c:r.subarray(0,n),n:e}},v1=function(t,e){for(var r=0,n=0;n<e.length;++n)r+=t[n]*e[n];return r},sB=function(t,e,r){var n=r.length,i=fI(e+2);t[i]=n&255,t[i+1]=n>>8,t[i+2]=t[i]^255,t[i+3]=t[i+1]^255;for(var o=0;o<n;++o)t[i+o+4]=r[o];return(i+4+n)*8},rB=function(t,e,r,n,i,o,s,a,l,u,c){rf(e,c++,r),++i[256];for(var p=L3(i,15),f=p.t,d=p.l,m=L3(o,15),y=m.t,g=m.l,b=tB(f),w=b.c,S=b.n,I=tB(y),P=I.c,T=I.n,M=new sa(19),E=0;E<w.length;++E)++M[w[E]&31];for(var E=0;E<P.length;++E)++M[P[E]&31];for(var D=L3(M,7),B=D.t,$=D.l,U=19;U>4&&!B[uI[U-1]];--U);var Y=u+5<<3,G=v1(i,Ih)+v1(o,x1)+s,ne=v1(i,f)+v1(o,y)+s+14+3*U+v1(M,B)+2*M[16]+3*M[17]+7*M[18];if(l>=0&&Y<=G&&Y<=ne)return sB(e,c,t.subarray(l,l+u));var le,se,X,ee;if(rf(e,c,1+(ne<G)),c+=2,ne<G){le=Mu(f,d,0),se=f,X=Mu(y,g,0),ee=y;var Ee=Mu(B,$,0);rf(e,c,S-257),rf(e,c+5,T-1),rf(e,c+10,U-4),c+=14;for(var E=0;E<U;++E)rf(e,c+3*E,B[uI[E]]);c+=3*U;for(var je=[w,P],Le=0;Le<2;++Le)for(var He=je[Le],E=0;E<He.length;++E){var xe=He[E]&31;rf(e,c,Ee[xe]),c+=B[xe],xe>15&&(rf(e,c,He[E]>>5&127),c+=He[E]>>12)}}else le=gse,se=Ih,X=xse,ee=x1;for(var E=0;E<a;++E){var Pe=n[E];if(Pe>255){var xe=Pe>>18&31;g1(e,c,le[xe+257]),c+=se[xe+257],xe>7&&(rf(e,c,Pe>>23&31),c+=b1[xe]);var Zr=Pe&31;g1(e,c,X[Zr]),c+=ee[Zr],Zr>3&&(g1(e,c,Pe>>5&8191),c+=_1[Zr])}else g1(e,c,le[Pe]),c+=se[Pe]}return g1(e,c,le[256]),c+se[256]},Sse=new pI([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),aB=new Bn(0),Ise=function(t,e,r,n,i,o){var s=o.z||t.length,a=new Bn(n+s+5*(1+Math.ceil(s/7e3))+i),l=a.subarray(n,a.length-i),u=o.l,c=(o.r||0)&7;if(e){c&&(l[0]=o.r>>3);for(var p=Sse[e-1],f=p>>13,d=p&8191,m=(1<<r)-1,y=o.p||new sa(32768),g=o.h||new sa(m+1),b=Math.ceil(r/3),w=2*b,S=function(he){return(t[he]^t[he+1]<<b^t[he+2]<<w)&m},I=new pI(25e3),P=new sa(288),T=new sa(32),M=0,E=0,D=o.i||0,B=0,$=o.w||0,U=0;D+2<s;++D){var Y=S(D),G=D&32767,ne=g[Y];if(y[G]=ne,g[Y]=G,$<=D){var le=s-D;if((M>7e3||B>24576)&&(le>423||!u)){c=rB(t,l,0,I,P,T,E,B,U,D-U,c),B=M=E=0,U=D;for(var se=0;se<286;++se)P[se]=0;for(var se=0;se<30;++se)T[se]=0}var X=2,ee=0,Ee=d,je=G-ne&32767;if(le>2&&Y==S(D-je))for(var Le=Math.min(f,le)-1,He=Math.min(32767,D),xe=Math.min(258,le);je<=He&&--Ee&&G!=ne;){if(t[D+X]==t[D+X-je]){for(var Pe=0;Pe<xe&&t[D+Pe]==t[D+Pe-je];++Pe);if(Pe>X){if(X=Pe,ee=je,Pe>Le)break;for(var Zr=Math.min(je,Pe-2),Tr=0,se=0;se<Zr;++se){var nn=D-je+se&32767,L=y[nn],ue=nn-L&32767;ue>Tr&&(Tr=ue,ne=nn)}}}G=ne,ne=y[G],je+=G-ne&32767}if(ee){I[B++]=268435456|D3[X]<<18|eB[ee];var k=D3[X]&31,be=eB[ee]&31;E+=b1[k]+_1[be],++P[257+k],++T[be],$=D+X,++M}else I[B++]=t[D],++P[t[D]]}}for(D=Math.max(D,$);D<s;++D)I[B++]=t[D],++P[t[D]];c=rB(t,l,u,I,P,T,E,B,U,D-U,c),u||(o.r=c&7|l[c/8|0]<<3,c-=7,o.h=g,o.p=y,o.i=D,o.w=$)}else{for(var D=o.w||0;D<s+u;D+=65535){var pe=D+65535;pe>=s&&(l[c/8|0]=u,pe=s),c=sB(l,c+1,t.subarray(D,pe))}o.i=s}return xg(a,0,n+fI(c)+i)},OBe=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var r=e,n=9;--n;)r=(r&1&&-306674912)^r>>>1;t[e]=r}return t}(),kBe=function(){var t=-1;return{p:function(e){for(var r=t,n=0;n<e.length;++n)r=OBe[r&255^e[n]]^r>>>8;t=r},d:function(){return~t}}},Pse=function(t,e,r,n,i){if(!i&&(i={l:1},e.dictionary)){var o=e.dictionary.subarray(-32768),s=new Bn(o.length+t.length);s.set(o),s.set(t,o.length),t=s,i.w=o.length}return Ise(t,e.level==null?6:e.level,e.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,r,n,i)},lB=function(t,e){var r={};for(var n in t)r[n]=t[n];for(var n in e)r[n]=e[n];return r},cse=function(t,e,r){for(var n=t(),i=t.toString(),o=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),s=0;s<n.length;++s){var a=n[s],l=o[s];if(typeof a=="function"){e+=";"+l+"=";var u=a.toString();if(a.prototype)if(u.indexOf("[native code]")!=-1){var c=u.indexOf(" ",8)+1;e+=u.slice(c,u.indexOf("(",c))}else{e+=u;for(var p in a.prototype)e+=";"+l+".prototype."+p+"="+a.prototype[p].toString()}else e+=u}else r[l]=a}return e},E3=[],FBe=function(t){var e=[];for(var r in t)t[r].buffer&&e.push((t[r]=new t[r].constructor(t[r])).buffer);return e},RBe=function(t,e,r,n){if(!E3[r]){for(var i="",o={},s=t.length-1,a=0;a<s;++a)i=cse(t[a],i,o);E3[r]={c:cse(t[s],i,o),e:o}}var l=lB({},E3[r].e);return DBe(E3[r].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",r,l,FBe(l),n)},NBe=function(){return[Bn,sa,pI,b1,_1,uI,oB,yse,vse,bse,cI,_se,Mu,M3,Eu,A3,fI,xg,Ki,wse,cB,N3,Cse]},BBe=function(){return[Bn,sa,pI,b1,_1,uI,D3,eB,gse,Ih,xse,x1,cI,Sse,aB,Mu,rf,g1,L3,O3,tB,v1,sB,rB,fI,xg,Ise,Pse,uB,N3]},N3=function(t){return postMessage(t,[t.buffer])},Cse=function(t){return t&&{out:t.size&&new Bn(t.size),dictionary:t.dictionary}},Tse=function(t,e,r,n,i,o){var s=RBe(r,n,i,function(a,l){s.terminate(),o(a,l)});return s.postMessage([t,e],e.consume?[t.buffer]:[]),function(){s.terminate()}},nf=function(t,e){return t[e]|t[e+1]<<8},Vc=function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0},QN=function(t,e){return Vc(t,e)+Vc(t,e+4)*4294967296},as=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};Ese=function(t,e,r,n){for(var i in t){var o=t[i],s=e+i,a=n;Array.isArray(o)&&(a=lB(n,o[1]),o=o[0]),o instanceof Bn?r[s]=[o,a]:(r[s+="/"]=[new Bn(0),a],Ese(o,s,r,n))}},pse=typeof TextEncoder<"u"&&new TextEncoder,nB=typeof TextDecoder<"u"&&new TextDecoder,UBe=0;try{nB.decode(aB,{stream:!0}),UBe=1}catch{}GBe=function(t){for(var e="",r=0;;){var n=t[r++],i=(n>127)+(n>223)+(n>239);if(r+i>t.length)return{s:e,r:xg(t,r-1)};i?i==3?(n=((n&15)<<18|(t[r++]&63)<<12|(t[r++]&63)<<6|t[r++]&63)-65536,e+=String.fromCharCode(55296|n>>10,56320|n&1023)):i&1?e+=String.fromCharCode((n&31)<<6|t[r++]&63):e+=String.fromCharCode((n&15)<<12|(t[r++]&63)<<6|t[r++]&63):e+=String.fromCharCode(n)}};jBe=function(t,e){return e+30+nf(t,e+26)+nf(t,e+28)},$Be=function(t,e,r){var n=nf(t,e+28),i=pB(t.subarray(e+46,e+46+n),!(nf(t,e+8)&2048)),o=e+46+n,s=Vc(t,e+20),a=r&&s==4294967295?qBe(t,o):[s,Vc(t,e+24),Vc(t,e+42)],l=a[0],u=a[1],c=a[2];return[nf(t,e+10),l,u,i,o+nf(t,e+30)+nf(t,e+32),c]},qBe=function(t,e){for(;nf(t,e)!=1;e+=4+nf(t,e+2));return[QN(t,e+12),QN(t,e+4),QN(t,e+20)]},iB=function(t){var e=0;if(t)for(var r in t){var n=t[r].length;n>65535&&Ki(9),e+=n+4}return e},fse=function(t,e,r,n,i,o,s,a){var l=n.length,u=r.extra,c=a&&a.length,p=iB(u);as(t,e,s!=null?33639248:67324752),e+=4,s!=null&&(t[e++]=20,t[e++]=r.os),t[e]=20,e+=2,t[e++]=r.flag<<1|(o<0&&8),t[e++]=i&&8,t[e++]=r.compression&255,t[e++]=r.compression>>8;var f=new Date(r.mtime==null?Date.now():r.mtime),d=f.getFullYear()-1980;if((d<0||d>119)&&Ki(10),as(t,e,d<<25|f.getMonth()+1<<21|f.getDate()<<16|f.getHours()<<11|f.getMinutes()<<5|f.getSeconds()>>1),e+=4,o!=-1&&(as(t,e,r.crc),as(t,e+4,o<0?-o-2:o),as(t,e+8,r.size)),as(t,e+12,l),as(t,e+14,p),e+=16,s!=null&&(as(t,e,c),as(t,e+6,r.attrs),as(t,e+10,s),e+=14),t.set(n,e),e+=l,p)for(var m in u){var y=u[m],g=y.length;as(t,e,+m),as(t,e+2,g),t.set(y,e+4),e+=4+g}return c&&(t.set(a,e),e+=c),e},HBe=function(t,e,r,n,i){as(t,e,101010256),as(t,e+8,r),as(t,e+10,r),as(t,e+12,n),as(t,e+16,i)};F3=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(t){t()}});var WBe,ZBe,B3,XBe,z3,fB=h(()=>{ht();WBe=t=>{if(t!=null)return t.trim()===""?void 0:t},ZBe=t=>t!=null,B3=(t,e,r=0)=>{if(A.IsNull(t))return"null";if(A.IsUndefined(t))return"undefined";if(A.IsString(t))return"<string>";if(A.IsNumber(t))return"<number>";if(A.IsBoolean(t))return"<boolean>";if(A.IsLiteral(t))return typeof t.const=="string"?`'${t.const}'`:`${t.const}`;if(A.IsRef(t)){let n=e.find(i=>i.$id===t.$ref);return n==null?t.$ref:B3(n,e,r)}if(A.IsArray(t))return`${B3(t.items,e,r+1)}[]`;if(A.IsUnion(t)&&(!(t.anyOf.length>5)||t.$id==null)){let i=`${t.anyOf.map(o=>B3(o,e,r+1)).filter(ZBe).join(" | ")}`;return r>0?`(${i})`:i}return t.$id??""},XBe=(t,e,r)=>{let n=e.message;return A.IsUnion(e.schema)&&(n=`Expected one of: ${B3(e.schema,r)}`),`${`#/definitions/${t}${WBe(e.path)??""}`}: ${n}`},z3=(t,e,r)=>{let n=e.First();if(n!=null)return XBe(t,n,r)}});var w1,S1,YBe,KBe,JBe,QBe,e7e,hB,dB=h(()=>{lm();y1();hI();fB();(function(t){t.Archive="Archive",t.Validate="Validate",t.Encode="Encode",t.Unknown="Unknown"})(w1||(w1={}));S1=class extends Error{constructor(r,n){super(n);C(this,"name");C(this,"kind");this.name="CompressError",this.kind=r}},YBe=t=>new S1(w1.Archive,t.message),KBe=t=>{let e=Object.values(R3);return t instanceof Error&&"code"in t&&typeof t.code=="number"&&e.includes(t.code)},JBe=(t,e,r)=>new S1(w1.Validate,z3(t,e,r)??"Unknown validate error"),QBe=t=>new S1(w1.Encode,t.message),e7e=t=>new S1(w1.Unknown,t instanceof Error?t.message:String(t)),hB=(t,e,r)=>e instanceof mg?QBe(e):e instanceof Cu?JBe(t,e,r):KBe(e)?YBe(e):e7e(e)});var I1,P1,t7e,r7e,n7e,i7e,o7e,mB,yB=h(()=>{lm();y1();hI();fB();(function(t){t.Unarchive="Unarchive",t.Validate="Validate",t.Decode="Decode",t.Unknown="Unknown"})(I1||(I1={}));P1=class extends Error{constructor(r,n){super(n);C(this,"name");C(this,"kind");this.name="DecompressError",this.kind=r}},t7e=t=>new P1(I1.Unarchive,t.message),r7e=t=>{let e=Object.values(R3);return t instanceof Error&&"code"in t&&typeof t.code=="number"&&e.includes(t.code)},n7e=(t,e,r)=>new P1(I1.Validate,z3(t,e,r)??"Unknown validate error"),i7e=t=>new P1(I1.Decode,t.message),o7e=t=>new P1(I1.Unknown,t instanceof Error?t.message:String(t)),mB=(t,e,r)=>e instanceof dg?i7e(e):e instanceof Cu?n7e(t,e,r):r7e(e)?t7e(e):o7e(e)});var s7e,a7e,l7e,V3,gB=h(()=>{s7e=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,a7e=[0,31,28,31,30,31,30,31,31,30,31,30,31],l7e=t=>t%4===0&&(t%100!==0||t%400===0),V3=t=>{let e=s7e.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],i=+e[3];return n>=1&&n<=12&&i>=1&&i<=(n===2&&l7e(r)?29:a7e[n])}});var u7e,U3,vB=h(()=>{u7e=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i,U3=t=>{let e=u7e.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],i=+e[3],o=e[4],s=e[5]==="-"?-1:1,a=+(e[6]||0),l=+(e[7]||0);if(a>23||l>59||!o)return!1;if(r<=23&&n<=59&&i<60)return!0;let u=n-l*s,c=r-a*s-(u<0?1:0);return(c===23||c===-1)&&(u===59||u===-1)&&i<61}});var c7e,Lse,Dse=h(()=>{gB();vB();c7e=/t|\s/i,Lse=t=>{let e=t.split(c7e);return e.length===2&&V3(e[0])&&U3(e[1])}});var p7e,f7e,Ose,kse=h(()=>{p7e=/\/|:/,f7e=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,Ose=t=>p7e.test(t)&&f7e.test(t)});var h7e,Fse,Rse=h(()=>{hg();Dse();gB();vB();kse();h7e=[["date",V3],["time",U3],["date-time",Lse],["uri",Ose]],Fse=()=>{for(let[t,e]of h7e)try{s3.Format(t,e)}catch(r){if(r instanceof oI)continue;throw r}}});var Nse,Bse=h(()=>{Nse=t=>t instanceof Error?t:new Error(String(t))});var G3,xB=h(()=>{Kn();Bse();G3=t=>(...e)=>{try{return ge(t(...e))}catch(r){return Ie(Nse(r))}}});var d7e,bB,zse=h(()=>{Kn();xB();hI();d7e=G3((t,e)=>{let r={};for(let n of e)for(let i of n.intoBundle(t))r[i.path]=k3(JSON.stringify(i.contents));return r}),bB=async(t,e,r)=>d7e(t,e).andThenAsync(n=>new Promise(i=>{Mse(n,{...r,consume:!0},(o,s)=>{i(o?Ie(o):ge(s))})}))});function j3(t,e,r=[]){let n={...t};for(let[i,o]of Object.entries(e))if(o!==void 0)if(i in n){let s=i;if(Array.isArray(o)&&o.length>0){let a=m7e(o[0],r);if(a){let l=n[s];if(!Array.isArray(l))throw new Error(`Expected array at ${i}, got ${typeof l}`);let u=new Map(o.map(f=>[Vse(f,a),f])),p=l.map(f=>{let d=u.get(Vse(f,a));return d?j3(f,d,r):f});n[s]=p}else n[s]=o}else{let a=n[s];typeof a=="object"&&a!==null&&typeof o=="object"&&o!==null?Object.keys(o).length===0?n[s]=o:n[s]=j3(a,o,r):n[i]=o}}else n[i]=o;return n}function m7e(t,e){function r(n){if(typeof n!="object"||n===null)return null;for(let i of e)if(i in n&&typeof n[i]<"u")return[i];if(Array.isArray(n))return null;for(let[i,o]of Object.entries(n)){let s=r(o);if(s)return[i,...s]}return null}return r(t)}function Vse(t,e){return e.reduce((r,n)=>{if(r&&typeof r=="object")return r[n]},t)}var _B=h(()=>{});var y7e,g7e,v7e,x7e,wB,Use=h(()=>{Kn();xB();hI();_B();y7e=t=>t,g7e=t=>JSON.parse(pB(t)),v7e=(t,e)=>e.some(r=>r.fromBundle(t.name,new Uint8Array,y7e)!==void 0),x7e=G3((t,e)=>{let r={};for(let n of Object.keys(t)){let i=t[n];for(let o of e){let s=o.fromBundle(n,i,g7e);if(s){r=j3(r,s,[]);break}}}return r}),wB=async(t,e)=>new Promise(r=>Ase(t,{filter:n=>v7e(n,e)},(n,i)=>{r(n?Ie(n):ge(i))})).then(r=>r.andThen(n=>x7e(n,e)))});var b7e,_7e,$3,Gse=h(()=>{b7e=t=>typeof t=="object"&&t!=null&&"$ref"in t&&typeof t.$ref=="string",_7e=t=>{if(t.length<2)return!1;let e=t.filter(b7e);if(e.length!==t.length)return!1;let r=e[0].$ref;return e.slice(1).every(n=>n.$ref===r)},$3=t=>typeof t=="object"&&t!=null&&"allOf"in t&&Array.isArray(t.allOf)&&_7e(t.allOf)?t.allOf[0]:typeof t=="object"&&t!=null&&!Array.isArray(t)?Object.fromEntries(Object.entries(t).map(([e,r])=>[e,$3(r)])):Array.isArray(t)?t.map($3):t});var q3,jse=h(()=>{q3=t=>typeof t=="object"&&t!=null&&"$ref"in t?{...t,$ref:`#/definitions/${t.$ref}`}:typeof t=="object"&&t!=null&&!Array.isArray(t)?Object.fromEntries(Object.entries(t).map(([e,r])=>[e,q3(r)])):Array.isArray(t)?t.map(q3):t});var C1,w7e,S7e,Au,bg,Ph,Uc,SB,H3,IB=h(()=>{Kn();ise();sse();ht();lse();a1();om();dB();yB();Rse();aa();tI();tN();hN();zse();Use();Gse();jse();(function(t){t.InvalidTypeboxSchema="InvalidTypeboxSchema",t.MissingReferenceId="MissingReferenceId",t.DuplicateReferenceId="DuplicateReferenceId",t.TypeboxError="TypeboxError",t.UnknownError="UnknownError"})(C1||(C1={}));w7e=t=>({next(){for(let r of t){let n=r.next();if(!n.done)return n}return{done:!0,value:void 0}},[Symbol.iterator](){return this}}),S7e=(...t)=>{let e=new Map;for(let r of w7e(t)){if(!r.$id)continue;let n=e.get(r.$id);if(n!=null&&n!==r)return Ie({kind:C1.DuplicateReferenceId,message:"Failed to register a reference for a schema with an $id that has already been used",schema:r});e.set(r.$id,r)}return ge(e)},SB=class SB{constructor(e,r,n,i){O(this,Au);O(this,bg);O(this,Ph,[]);O(this,Uc);N(this,Au,e),N(this,bg,r),N(this,Ph,n),N(this,Uc,i),this.is=this.is.bind(this),this.parse=this.parse.bind(this),this.verify=this.verify.bind(this),this.jsonSchema=this.jsonSchema.bind(this),this.compress=this.compress.bind(this),this.decompress=this.decompress.bind(this)}static create(e,r="CoreMVF"){let n=_.Composite(e.extensions.map(o=>o.schema),{$id:r});if(!A.IsSchema(n))return Ie({kind:C1.InvalidTypeboxSchema,message:"Attempting to merge schemas produced an invalid schema",schema:n});let i=S7e(iN.values(),Y8.values(),J8.values(),eN.values(),rN.values(),fN.values(),e.extensions.flatMap(o=>o.references??[]).values());if(!i.isOk())return i;try{Fse();let o=T3.Compile(n,[...i.value.values()]);return ge(new SB(n,o,e.extensions,i.value))}catch(o){return o instanceof Ze?Ie({kind:C1.TypeboxError,message:o.message,original:o}):Ie({kind:C1.UnknownError,message:"An unknown error occurred while compiling the schema",original:o})}}is(e){return v(this,bg).Check(e)}parse(e){return v(this,bg).Check(e)?ge(e):Ie(v(this,bg).Errors(e))}decode(e){try{return ge(nse(v(this,Au),[...v(this,Uc).values()],e))}catch(r){return Ie(r)}}encode(e){try{return ge(ose(v(this,Au),[...v(this,Uc).values()],e))}catch(r){return Ie(r)}}verify(e){for(let r of v(this,Ph))if(r.integrityCheck){let n=r.integrityCheck(e);if(n.isErr())return Ie(n.error)}return ge(!0)}jsonSchema(){let e=JSON.parse(JSON.stringify([v(this,Au),...v(this,Uc).values()])),r=$3(q3({$id:`#/definitions/${v(this,Au).$id??"CoreMVF"}`,$schema:"http://json-schema.org/draft-07/schema#",references:e}));return JSON.stringify(r,null,2)}async compress(e){return this.encode(e).andThen(r=>this.parse(r)).andThenAsync(r=>bB(r,v(this,Ph))).then(r=>r.mapErr(n=>hB(v(this,Au).$id??"CoreMVF",n,[...v(this,Uc).values()])))}async compressUnsafe(e){return this.encode(e).andThenAsync(r=>bB(r,v(this,Ph))).then(r=>r.mapErr(n=>hB(v(this,Au).$id??"CoreMVF",n,[...v(this,Uc).values()])))}async decompress(e){return wB(e,v(this,Ph)).then(r=>r.andThen(n=>this.parse(n)).andThen(n=>this.decode(n)).mapErr(n=>mB(v(this,Au).$id??"CoreMVF",n,[...v(this,Uc).values()])))}async decompressUnsafe(e){return wB(e,v(this,Ph)).then(r=>r.andThen(n=>this.decode(n)).mapErr(n=>mB(v(this,Au).$id??"CoreMVF",n,[...v(this,Uc).values()])))}};Au=new WeakMap,bg=new WeakMap,Ph=new WeakMap,Uc=new WeakMap;H3=SB});var T1,W3,$se=h(()=>{ht();IB();W3=class{constructor(){O(this,T1,[]);this.extend=this.extend.bind(this)}extend(e){return v(this,T1).push(e),this}extendOptional(e){let r={...e,schema:_.Partial(e.schema)};return v(this,T1).push(r),this}build(){return H3.create(this)}get extensions(){return v(this,T1)}};T1=new WeakMap});var qse=h(()=>{rI();dB();yB()});var Hse,aa=h(()=>{Uie();Yie();roe();$se();pN();qse();Su();IB();_B();Hse=()=>new W3().extend(Vie).extend(Xie).extend(toe)});var _g,PB,Wse,Z3=h(()=>{aa();ia();ht();_g=si("lcat","LocationCategoryId"),PB=_.Intersect([_.Object({id:_.Ref(_g),parent:_.Optional(_.Ref(_g))}),cg(["name"]),Nc],{$id:"LocationCategory"}),Wse=[_g,PB]});var wg,Zse=h(()=>{(function(t){t.UnknownCategoryError="UnknownCategoryError",t.UnknownParentCategoryError="UnknownParentCategoryError",t.UnknownParentLocationError="UnknownParentLocationError"})(wg||(wg={}))});var Xse,Yse=h(()=>{Wp();Kn();Zse();Xse=t=>{if(t.locationCategories==null&&t.locations==null)return ge(!0);let e=new Set(t.locationCategories?.map(i=>i.id)??[]);for(let i of t.locationCategories??[])if(i.parent!=null&&!e.has(i.parent))return Ie({kind:wg.UnknownParentCategoryError,properties:{categoryId:i.id,parentCategoryId:i.parent}});let r=go(t);for(let i of t.locations??[]){for(let o of i.categories)if(!e.has(o))return Ie({kind:wg.UnknownCategoryError,properties:{locationId:i.id,categoryId:o}});for(let o of i.geometryAnchors){let s=r(o.floorId,o.geometryId);if(s.isErr())return s}}let n=new Set(t.locations?.map(i=>i.id)??[]);for(let i of t.locationInstances??[]){if(!n.has(i.parentId))return Ie({kind:wg.UnknownParentLocationError,properties:{locationInstanceId:i.id,parentLocationId:i.parentId}});for(let o of i.categories??[])if(!e.has(o))return Ie({kind:wg.UnknownCategoryError,properties:{locationId:i.id,categoryId:o}});for(let o of i.geometryAnchors??[]){let s=r(o.floorId,o.geometryId);if(s.isErr())return s}}return ge(!0)}});var Sg,X3,Kse,Jse,CB,TB,Qse,I7e,EB,Y3,K3,MB,J3,AB=h(()=>{aa();ia();ht();Z3();Sg=si("loc","LocationId"),X3=si("loci","LocationInstanceId"),Kse=_.Object({name:_.String(),url:_.String({format:"uri"})},{$id:"LocationSocial"}),Jse=_.Object({url:_.String({format:"uri"})},{$id:"LocationImage"}),CB=_.Object({label:_.String(),url:_.String({format:"uri"})},{$id:"LocationLink"}),TB=_.String({pattern:"^[0-2][0-9]:[0-6][0-9](:[0-6][0-9])?$",$id:"OpeningHoursTime"}),Qse=_.Union([_.Literal("Sunday"),_.Literal("Monday"),_.Literal("Tuesday"),_.Literal("Wednesday"),_.Literal("Thursday"),_.Literal("Friday"),_.Literal("Saturday")],{$id:"OpeningHoursDay"}),I7e="PublicHolidays",EB=_.Union([Qse,_.Literal(I7e)],{$id:"OpeningHoursDayOrPublicHoliday"}),Y3=_.Object({"@type":_.Optional(_.Literal("OpeningHoursSpecification",{description:"The type of opening hours"})),opens:_.Optional(_.Ref(TB,{description:"The time the opening hours start"})),closes:_.Optional(_.Ref(TB,{description:"The time the opening hours end"})),dayOfWeek:_.Optional(_.Union([_.Ref(EB),_.Array(_.Ref(EB))],{description:"The days of the week the opening hours apply to"})),validFrom:_.Optional(_.String({format:"date-time",description:"The date the opening hours start, in ISO 8601 format"})),validTo:_.Optional(_.String({format:"date-time",description:"The date the opening hours end, in ISO 8601 format"}))},{$id:"OpeningHoursSpecification"}),K3=_.Intersect([_.Object({id:_.Ref(Sg),categories:_.Array(_.Ref(_g)),logo:_.Optional(_.String({format:"uri"})),phone:_.Optional(_.String()),social:_.Array(_.Ref(Kse)),images:_.Array(_.Ref(Jse)),links:_.Array(_.Ref(CB)),website:_.Optional(_.Ref(CB)),openingHours:_.Optional(_.Array(_.Ref(Y3)))}),cg(["name"]),pg(),Nc],{$id:"Location"}),MB=_.Intersect([_.Object({id:_.Ref(X3),parentId:_.Ref(Sg)}),_.Partial(_.Omit(K3,["id","parentId"]))],{$id:"LocationInstance"}),J3=[Sg,X3,Kse,Jse,CB,TB,Qse,EB,Y3,K3,MB]});var P7e,eae,tae,rae,nae,cm=h(()=>{ht();Z3();Yse();AB();AB();Z3();P7e=_.Object({locations:_.Array(_.Ref(K3)),locationCategories:_.Array(_.Ref(PB)),locationInstances:_.Optional(_.Array(_.Ref(MB)))},{$id:"LocationsExtensionSchema"}),eae="locations.json",tae="location-categories.json",rae="location-instances.json",nae={name:"ext:locations",schema:P7e,intoBundle:function*(t){t.locations!=null&&(yield{path:eae,contents:t.locations}),t.locationCategories!=null&&(yield{path:tae,contents:t.locationCategories}),t.locationInstances!=null&&(yield{path:rae,contents:t.locationInstances})},fromBundle:(t,e,r)=>{if(t===eae)return{locations:r(e)};if(t===tae)return{locationCategories:r(e)};if(t===rae)return{locationInstances:r(e)}},references:[...Wse,...J3],integrityCheck:Xse}});var of,iae=h(()=>{(function(t){t.UnknownEnterpriseLocationError="UnknownEnterpriseLocationError",t.EnterpriseLocationWithUnknownLocationError="EnterpriseLocationWithUnknownLocationError",t.EnterpriseCategoryWithUnknownLocationCategoryError="EnterpriseCategoryWithUnknownLocationCategoryError",t.InstanceWithUnknownLocationInstanceError="InstanceWithUnknownLocationInstanceError",t.InstanceWithUnknownEnterpriseLocationError="InstanceWithUnknownEnterpriseLocationError",t.EnterpriseLocationWithUnknownSibling="EnterpriseLocationWithUnknownSibling",t.EnterpriseLocationInstanceWithUnknownSibling="EnterpriseLocationInstanceWithUnknownSibling"})(of||(of={}))});var oae,sae=h(()=>{aa();gi();Kn();iae();oae=t=>{if(t.enterprise==null)return ge(!0);let e=t.enterprise,r=new Set(t.locationCategories?.map(l=>l.id)??[]);for(let l of e.categories??[])if(!r.has(l.categoryId))return Ie({kind:of.EnterpriseCategoryWithUnknownLocationCategoryError,properties:{enterpriseCategoryId:l.id,locationCategoryId:l.categoryId}});let n=new Set(t.locations?.map(l=>l.id)??[]);for(let l of e.locations??[]){if(!n.has(l.locationId))return Ie({kind:of.EnterpriseLocationWithUnknownLocationError,properties:{enterpriseLocationId:l.id,locationId:l.locationId}});for(let u of l.siblingGroups??[])for(let c of u.siblings??[])if(!n.has(c))return Ie({kind:of.EnterpriseLocationWithUnknownSibling,properties:{enterpriseLocationId:l.id,siblingLocationId:c,label:u.label}})}let i=new Set(t.enterprise.locations?.map(l=>l.id)??[]);if(e.venue?.topLocations!=null){for(let l of e.venue.topLocations)if(!i.has(l))return Ie({kind:of.UnknownEnterpriseLocationError,properties:{enterpriseLocationId:l}})}let o=new Set(t.locationInstances?.map(l=>l.id)??[]);for(let l of e.locationInstances??[]){if(!i.has(l.parentId))return Ie({kind:of.InstanceWithUnknownEnterpriseLocationError,properties:{enterpriseLocationInstanceId:l.id,enterpriseLocationId:l.parentId}});if(!o.has(l.locationInstanceId))return Ie({kind:of.InstanceWithUnknownLocationInstanceError,properties:{enterpriseLocationInstanceId:l.id,locationInstanceId:l.locationInstanceId}});for(let u of l.siblingGroups??[])for(let c of u.siblings??[])if(!n.has(c))return Ie({kind:of.EnterpriseLocationInstanceWithUnknownSibling,properties:{enterpriseLocationInstanceId:l.id,siblingLocationId:c,label:u.label}})}let s=xh(t),a=go(t);for(let[l,u]of kr(e.floorText??{})){let c=s(l);if(c.isErr())return c;for(let p of u.features){if(!("geometryId"in p.properties))continue;let f=a(l,p.properties.geometryId);if(f.isErr())return f}}for(let[l,u]of kr(e.textures??{})){let c=s(l);if(c.isErr())return c;for(let p of u){let f=a(l,p.geometryId);if(f.isErr())return f}}for(let[l,u]of kr(e.layers??{})){let c=s(l);if(c.isErr())return c;for(let p of Pr(u??{})){let f=a(l,p);if(f.isErr())return f}}for(let[l,u]of kr(e.textAreas??{})){let c=s(l);if(c.isErr())return c;for(let p of u.features)if("geometryId"in p.properties){let f=a(l,p.properties.geometryId);if(f.isErr())return f}}return ge(!0)}});var Ig,LB,DB,OB,kB,aae,Pg=h(()=>{aa();Ig=si("el","EnterpriseLocationId"),LB=si("ec","EnterpriseCategoryId"),DB=si("eli","EnterpriseLocationInstanceId"),OB=si("ev","EnterpriseVenueId"),kB=si("eft","EnterpriseFloorTextId"),aae=[Ig,LB,DB,OB,kB]});var lae,FB,uae,cae=h(()=>{cm();ht();Pg();lae=_.Object({id:_.Ref(LB),categoryId:_.Ref(_g),color:_.Optional(_.String()),sortOrder:_.Number(),iconFromDefaultList:_.Optional(_.Union([_.String(),_.Null()])),picture:_.Optional(_.String({format:"uri",description:"The category's picture"}))},{$id:"EnterpriseCategory"}),FB=_.Object({categories:_.Optional(_.Array(_.Ref(lae)))},{$id:"EnterpriseCategoriesSchema"}),uae=[lae,FB]});var pae,C7e,Fqt,RB,NB,BB,fae,hae,T7e,E7e,dae,mae,zB,yae,gae=h(()=>{aa();aa();ht();Pg();pae=Ua(["left","center","right"]),C7e=pae.schema,Fqt=pae.values,RB=_.Object({id:_.Ref(kB),text:_.String(),visible:_.Boolean({default:!0}),fontSize:_.Number({default:12,minimum:1}),fontFamily:_.String({default:"Droid Sans"}),color:_.String({default:"black"}),rotation:_.Number({minimum:0,maximum:360}),align:C7e},{$id:"FloorTextCommonProperties"}),NB=_.Intersect([_.Ref(RB),wu],{$id:"AnchoredFloorTextProperties"}),BB=_.Intersect([_.Ref(RB),_.Object({verticalOffset:_.Number()})],{$id:"FloatingFloorTextProperties"}),fae=_.Union([_.Ref(NB),_.Ref(BB)],{$id:"FloorTextProperties"}),hae=is(Es,_.Ref(fae),{$id:"FloorTextFeature"}),T7e=is(Es,_.Ref(NB),{$id:"AnchoredFloorTextFeature"}),E7e=is(Es,_.Ref(BB),{$id:"FloatingFloorTextFeature"}),dae=oa(_.Ref(hae),{$id:"EnterpriseFloorTextFeatureCollection"}),mae=_.Record(Or,_.Ref(dae),{$id:"EnterpriseFloorTextCollectionsByFloor",additionalProperties:!1}),zB=_.Object({floorText:_.Optional(_.Ref(mae))},{$id:"EnterpriseFloorTextSchema"}),yae=[RB,NB,BB,fae,hae,T7e,E7e,dae,mae,zB]});var vae,xae,VB,bae,_ae=h(()=>{aa();ia();ht();vae=Ii(_.Record(Ts,_.String({minLength:1}),{additionalProperties:!1,$id:"EnterpriseLayers"})),xae=Ii(_.Record(Or,_.Ref(vae),{additionalProperties:!1,$id:"EnterpriseLayersByFloor"})),VB=_.Object({layers:_.Optional(_.Ref(xae))},{$id:"EnterpriseLayersSchema"}),bae=[vae,xae,VB]});var UB,M7e,$qt,qqt,GB,jB,Q3,wae,eA=h(()=>{aa();cm();ht();UB=Ua(["closed-temporarily","new","pop-up","coming-soon","relocated"]),M7e=UB.schema,$qt=UB.values,qqt=UB.record,GB=_.Object({type:M7e,start:_.Optional(_.String({format:"date",description:"The start date of the state"})),end:_.Optional(_.String({format:"date",description:"The end date of the state"}))},{$id:"LocationState",description:"The state of a location. Start and end dates are optional."}),jB=_.Object({label:_.String(),siblings:_.Array(_.Ref(Sg))},{$id:"SiblingGroup"}),Q3=_.Object({name:_.String(),code:_.String()},{$id:"Language"}),wae=[GB,jB,Q3]});var tA,$B,Sae,qB=h(()=>{cm();ht();Pg();eA();tA=_.Object({id:_.Ref(Ig),locationId:_.Ref(Sg),type:_.String(),sortOrder:_.Number(),tags:_.Optional(_.Array(_.String())),picture:_.Optional(_.String({format:"uri",description:"The picture of the location"})),states:_.Optional(_.Array(_.Ref(GB),{description:"The location's state. No more than one state should be active at a time, and all but at most one should have dates set"})),siblingGroups:_.Optional(_.Array(_.Ref(jB))),gallery:_.Optional(_.Array(_.Object({caption:_.Optional(_.String()),image:_.String({format:"uri"}),embeddedUrl:_.Optional(_.String({format:"uri",description:"The URL to link from the image"}))},{description:"The location's image gallery"}),{description:"The location's image gallery"})),showFloatingLabelWhenImagePresent:_.Optional(_.Boolean({description:"Whether to show the flat label when an image is present"})),amenity:_.Optional(_.String({description:"The location's amenity type. Only set if the location is an amenity"})),showLogo:_.Optional(_.Boolean({description:"Whether to show the logo of the location"}))},{$id:"EnterpriseLocation"}),$B=_.Object({locations:_.Optional(_.Array(_.Ref(tA)))},{$id:"EnterpriseLocationsSchema"}),Sae=[tA,$B]});var Iae,HB,Pae,Cae=h(()=>{cm();ht();qB();Pg();Iae=_.Intersect([_.Object({id:_.Ref(DB),parentId:_.Ref(Ig),locationInstanceId:_.Ref(X3)}),_.Partial(_.Omit(tA,["id","parentId","locationId"]))],{$id:"EnterpriseLocationInstance",description:"A locationInstance is a particular instance of an Enterprise Location that has some properties different from the parent."}),HB=_.Object({locationInstances:_.Optional(_.Array(_.Ref(Iae)))},{$id:"EnterpriseLocationInstancesSchema"}),Pae=[Iae,HB]});var WB,Tae,aHt,lHt,ZB,Eae,Mae,Aae,Lae,Dae,Oae,kae,Fae,Rae=h(()=>{nI();ia();Su();ht();WB=Ua(["near","center"],{$id:"EnterpriseTextAreaAlignment"}),Tae=WB.schema,aHt=WB.values,lHt=WB.record,ZB=_.Object({maxWidth:_.Number({exclusiveMinimum:0,description:"The maximum width of the label, in meters."}),maxHeight:_.Number({exclusiveMinimum:0,description:"The maximum height of the label, in meters."}),align:_.Ref(Tae),rotation:_.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"EnterpriseBaseTextAreaProperties"}),Eae=_.Intersect([_.Ref(ZB),wu],{$id:"EnterpriseAnchoredTextAreaProperties"}),Mae=_.Intersect([_.Ref(ZB),_.Object({verticalOffset:_.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"EnterpriseFloatingTextAreaProperties"}),Aae=_.Union([Eae,Mae],{$id:"EnterpriseTextAreaProperties"}),Lae=is(_.Ref(Es),Aae,{$id:"EnterpriseTextAreaFeature"}),Dae=oa(_.Ref(Lae),{$id:"EnterpriseTextAreaCollection"}),Oae=_.Record(Or,_.Ref(Dae),{$id:"EnterpriseTextAreasByFloor",additionalProperties:!1}),kae=_.Object({textAreas:_.Optional(_.Ref(Oae))},{$id:"EnterpriseTextAreasSchema"}),Fae=[Tae,ZB,Eae,Mae,Aae,Lae,Dae,Oae]});var XB,YB,Nae,fHt,hHt,KB,Bae,dHt,mHt,zae,Vae,Uae,Gae,JB,jae,$ae=h(()=>{aa();ht();XB=_.Object({u:_.Number(),v:_.Number()},{$id:"EnterpriseTextureUV"}),YB=Ua(["top","side"],{$id:"EnterpriseTextureFace"}),Nae=YB.schema,fHt=YB.values,hHt=YB.record,KB=Ua(["inside","outside","both"],{$id:"EnterpriseTextureSurface"}),Bae=KB.schema,dHt=KB.values,mHt=KB.record,zae=_.Tuple([n1,i1,n1,i1],{$id:"EnterpriseTextureBounds"}),Vae=_.Intersect([_.Object({repeat:_.Ref(XB),offset:_.Ref(XB),rotation:_.Number({minimum:0,maximum:360}),path:_.String({format:"uri"}),face:_.Ref(Nae),surface:_.Ref(Bae),bounds:_.Ref(zae)},{$id:"EnterpriseTextureProperties"}),wu],{$id:"EnterpriseTexture"}),Uae=_.Array(_.Ref(Vae),{$id:"EnterpriseTextures"}),Gae=_.Record(Or,_.Ref(Uae),{$id:"EnterpriseTexturesByFloor",additionalProperties:!1}),JB=_.Object({textures:_.Optional(_.Ref(Gae))},{$id:"EnterpriseTexturesSchema"}),jae=[Vae,Uae,JB,XB,Nae,Bae,zae,Gae]});var qae,QB,Hae,Wae=h(()=>{aa();cm();ht();Pg();eA();qae=_.Intersect([_.Object({id:_.Ref(OB),slug:_.String(),defaultLanguage:_.Ref(Q3),languages:_.Array(_.Ref(Q3)),countrycode:_.Optional(_.String()),logo:_.Optional(_.String({format:"uri"})),mappedinWebUrl:_.Optional(_.String({format:"uri"})),topLocations:_.Optional(_.Array(_.Ref(Ig))),operationHours:_.Optional(_.Array(_.Ref(Y3))),coverImage:_.Optional(_.String({format:"uri"}))}),cg(["name"]),Nc],{$id:"EnterpriseVenue"}),QB=_.Object({venue:_.Optional(_.Ref(qae))},{$id:"EnterpriseVenueSchema"}),Hae=[qae,QB]});var Xae,Zae,A7e,Yae,Kae=h(()=>{gi();cm();ht();sae();cae();gae();_ae();Cae();qB();Rae();$ae();Wae();Pg();eA();Xae=_.Intersect([QB,$B,HB,FB,JB,zB,VB,kae],{$id:"EnterpriseProperties"}),Zae=_.Object({enterprise:_.Optional(_.Ref(Xae))},{$id:"CMSExtensionSchema"}),A7e=/^enterprise\/(?:([^/]+)\/)?([^/]+)\.(?:json|geojson)$/,Yae={name:"ext:cms",schema:Zae,intoBundle:function*(t){if(t.enterprise==null)return;let e=t.enterprise;for(let r of Pr(e))switch(r){case"floorText":for(let n of Pr(e.floorText??{}))yield{path:`enterprise/floorText/${n}.geojson`,contents:(e.floorText??{})[n]};continue;case"textures":for(let n of Pr(e.textures??{}))yield{path:`enterprise/textures/${n}.json`,contents:(e.textures??{})[n]};continue;case"textAreas":for(let n of Pr(e.textAreas??{}))yield{path:`enterprise/textAreas/${n}.geojson`,contents:(e.textAreas??{})[n]};continue;default:yield{path:`enterprise/${r}.json`,contents:e[r]};continue}},fromBundle:(t,e,r)=>{let n=t.match(A7e);if(!n)return;let[,i,o]=n,s=r(e);switch(i){case"floorText":case"textures":case"textAreas":return{enterprise:{[i]:{[o]:s}}};default:return{enterprise:{[o]:s}}}},references:[Xae,Zae,...Hae,...Sae,...Pae,...uae,...jae,...bae,...yae,...Fae,...aae,...wae,...J3],integrityCheck:oae}});var Gc,e7=h(()=>{(function(t){t.NavigationFlagMissingDeclaration="NavigationFlagMissingDeclaration",t.NavigationFlagDuplicateBit="NavigationFlagDuplicateBit",t.NavigationFlagIncorrectFlagsLength="NavigationFlagIncorrectFlagsLength",t.NavigationFlagValueTooBig="NavigationFlagValueTooBig"})(Gc||(Gc={}))});var Jae,Qae=h(()=>{Kn();e7();Jae=t=>{let{navigationFlags:e}=t;if(!e||Object.keys(e).length===0)return ge(!0);let r=Object.entries(e).map(([o,s])=>({key:o,...s})).sort((o,s)=>o.index!==s.index?o.index-s.index:o.bit-s.bit),n=0,i=-1;for(let o of r){if(o.bit===i)return Ie({kind:Gc.NavigationFlagDuplicateBit,properties:{index:o.index,bit:o.bit,path:`navigationFlags.${o.key}`}});if(o.index!=n){if(i!=31)return Ie({kind:Gc.NavigationFlagMissingDeclaration,properties:{index:n,bit:i+1,path:"navigationFlags"}});if(o.index!=n+1||o.bit!=0)return Ie({kind:Gc.NavigationFlagMissingDeclaration,properties:{index:n+1,bit:0,path:"navigationFlags"}});n=o.index,i=0}else{if(o.bit!==i+1)return Ie({kind:Gc.NavigationFlagMissingDeclaration,properties:{index:o.index,bit:i+1,path:"navigationFlags"}});i=o.bit}}return ge(!0)}});function E1(t,e){return e&&(t.flags[e.index]&1<<e.bit)!==0}var ele=h(()=>{});var tle,dI,M1,rle=h(()=>{Kn();e7();tle=2**32-1,dI=t=>{let e=Object.keys(t.navigationFlags??{}).length;if(e===0)return{index:-1,flag:0};let r=Math.floor(e/32),n=e%32;return{index:r,flag:2**n-1}},M1=(t,e,r)=>{if(e.index==-1&&t.length===0)return ge(!0);let n=e.flag>0||e.index===-1?e.index+1:e.index;if(t.length!==n)return Ie({kind:Gc.NavigationFlagIncorrectFlagsLength,properties:{expected:n,actual:t.length,path:r}});for(let i=0;i<t.length;i++){let o=t[i];if(i<e.index){if(o>tle)return Ie({kind:Gc.NavigationFlagValueTooBig,properties:{index:i,flagValue:o,expectedMaxFlagValue:tle,path:r}});continue}else if(o>e.flag)return Ie({kind:Gc.NavigationFlagValueTooBig,properties:{index:i,flagValue:o,expectedMaxFlagValue:e.flag,path:r}})}return ge(!0)}});var L7e,nle,t7,ile,D7e,rA,r7,Cg,O7e,k7e,ole,Tg=h(()=>{aa();ht();Qae();ele();rle();L7e=_.Object({index:_.Integer({description:"The index of the flag in a flags array.",minimum:0}),bit:_.Integer({description:"The bit position of the flag in a flag's bitfield.",minimum:0,maximum:31})},{$id:"NavigationFlagDeclarationCore"}),nle=_.Intersect([L7e,Rc],{$id:"NavigationFlagDeclaration",description:'A NavigationFlagDeclaration describes the relationship between a "key" that a developer might use to wayfind using that flag, and the index and bit position in an object\'s `flags` array.'}),t7={accessible:"accessible",outdoors:"outdoors"},ile=_.Record(_.String(),nle,{$id:"NavigationFlagDeclarations",description:"Any well known and custom flags present in the MVF"}),D7e=_.Object({navigationFlags:_.Ref(ile)},{$id:"NavigationFlagsSchema"}),rA=_.Array(_.Integer({minimum:0,maximum:Math.pow(2,32)-1}),{$id:"Flags"}),r7=_.Object({flags:_.Ref(rA)},{$id:"WithFlags"}),Cg=_.Intersect([r1,r7],{$id:"FlaggedGeometryAnchor"}),O7e=_.Object({geometryAnchor:Cg},{$id:"WithFlaggedGeometryAnchor"}),k7e=_.Object({geometryAnchors:_.Array(Cg)},{$id:"WithFlaggedGeometryAnchors"}),ole={name:"ext:mvf-navigation-flags",schema:D7e,intoBundle:function*(t){t.navigationFlags!=null&&(yield{path:"navigationFlags.json",contents:t.navigationFlags})},fromBundle:(t,e,r)=>t!=="navigationFlags.json"?void 0:{navigationFlags:r(e)},references:[nle,ile,rA,Cg,O7e,k7e],integrityCheck:Jae}});var sle,ale=h(()=>{Wp();Tg();Kn();sle=t=>{if(t.connections==null)return ge(!0);let e=go(t),r=dI(t);for(let[n,i]of t.connections.entries()){for(let[o,s]of i.entrances.entries()){let a=e(s.floorId,s.geometryId);if(a.isErr())return a;let l=M1(s.flags,r,`connections[${n}].entrances[${o}]`);if(l.isErr())return l}for(let[o,s]of i.exits.entries()){let a=e(s.floorId,s.geometryId);if(a.isErr())return a;let l=M1(s.flags,r,`connections[${n}].exits[${o}]`);if(l.isErr())return l}}return ge(!0)}});var ule,F7e,aWt,R7e,cle,n7,ple,fle,N7e,lle,hle,i7=h(()=>{Su();aa();Tg();ht();ale();ule=si("c","ConnectionId"),{schema:F7e,values:aWt,record:R7e}=Ua(["elevator","escalator","travelator","stairs","door","ramp"],{$id:"ConnectionType"}),cle=F7e,n7=R7e,ple=_.Intersect([_.Object({id:_.Ref(ule,{description:"The unique identifier for the connection."}),entrances:_.Array(_.Ref(Cg)),exits:_.Array(_.Ref(Cg)),entryCost:_.Number({description:"The cost to enter the connection.",minimum:0}),floorCostMultiplier:_.Number({description:"The cost multiplier for each floor transitioned.",minimum:1}),type:_.Ref(cle,{description:"The type of connection."})}),Rc,Nc],{$id:"ConnectionsProperties"}),fle=_.Array(_.Ref(ple),{$id:"ConnectionsCollection"}),N7e=_.Object({connections:_.Ref(fle)},{$id:"ConnectionsExtensionSchema"}),lle="connections.json",hle={name:"ext:connections",schema:N7e,intoBundle:function*(t){t.connections!=null&&(yield{path:lle,contents:t.connections})},fromBundle:(t,e,r)=>{if(t===lle)return{connections:r(e)}},references:[ple,fle,cle,ule,Cg,rA],integrityCheck:sle}});var dle,mle=h(()=>{Wp();Kn();dle=t=>{if(t.defaultStyle==null)return ge(!0);let e=go(t);for(let r of Object.values(t.defaultStyle))if(r!=null)for(let n of r.geometryAnchors){let i=e(n.floorId,n.geometryId);if(i.isErr())return i}return ge(!0)}});var yle,gle,B7e,vle,xle=h(()=>{Su();ht();mle();yle=_.Intersect([pg(),Nc,_.Object({altitude:_.Number({description:"How far off the bottom of the floor the objects with this style should be drawn, in meters."}),color:_.String({pattern:"^#[0-9a-fA-F]{6}$",description:"Color should be represented with a hash (#), followed by 6 hexadecimal digits. ex: #RRGGBB"}),height:_.Number({minimum:0,description:"The height of the objects belonging to this layer, in meters."}),opacity:_.Number({minimum:0,maximum:1,description:"The opacity of the objects belonging to this layer, from 0 to 1."}),buffer:_.Number({description:"The buffer amount to apply to the geometry, in meters. This can be used to inflate line string geometry for walls, but might also be applicable as a way to grow or shrink polygon geometry for aesthetic purposes. Can be negative."}),hidden:_.Optional(_.Boolean({description:"Whether or not the objects with this style should be hidden."}))})],{$id:"DefaultStyle"}),gle=_.Record(_.String(),_.Ref(yle),{$id:"DefaultStyleCollection",additionalProperties:!1}),B7e=_.Object({defaultStyle:_.Ref(gle)},{$id:"DefaultStyleSchema"}),vle={name:"ext:mvf-default-style",schema:B7e,intoBundle:function*(t){t.defaultStyle!=null&&(yield{path:"default-style.json",contents:t.defaultStyle})},fromBundle:(t,e,r)=>{if(t==="default-style.json")return{defaultStyle:r(e)}},references:[yle,gle],integrityCheck:dle}});var nA,ble=h(()=>{(function(t){t.InvalidDefaultFloorError="InvalidDefaultFloorError"})(nA||(nA={}))});var _le,wle=h(()=>{n3();Kn();ble();_le=t=>{if(t.floorStacks==null)return ge(!0);let e=xh(t);for(let r of t.floorStacks){for(let n of r.floors){let i=e(n);if(i.isErr())return i}if(r.defaultFloor!=null&&!r.floors.includes(r.defaultFloor))return Ie({kind:nA.InvalidDefaultFloorError,properties:{floorStackId:r.id,floorId:r.defaultFloor}})}return ge(!0)}});var iA,Ile,Ple,z7e,Sle,Cle,o7=h(()=>{ia();Su();ht();wle();iA=si("fs","FloorStackId"),Ile=_.Intersect([_.Object({id:_.Ref(iA,{description:"The unique identifier for the floor stack."}),floors:_.Array(_.Ref(Or),{uniqueItems:!0,minItems:1,description:"The floors that are part of this floor stack."}),defaultFloor:_.Optional(_.Ref(Or,{description:"The default floor for the floor stack."}))}),Rc],{$id:"FloorStacksProperties"}),Ple=_.Array(_.Ref(Ile),{$id:"FloorStackCollection"}),z7e=_.Object({floorStacks:_.Ref(Ple)},{$id:"FloorStackExtensionSchema"}),Sle="floor-stacks.json",Cle={name:"ext:floor-stacks",schema:z7e,intoBundle:function*(t){t.floorStacks!=null&&(yield{path:Sle,contents:t.floorStacks})},fromBundle:(t,e,r)=>{if(t===Sle)return{floorStacks:r(e)}},references:[iA,Ile,Ple],integrityCheck:_le}});var mI,Tle=h(()=>{(function(t){t.MissingFloorStackError="MissingFloorStackError",t.UnknownFloorStackError="UnknownFloorStackError"})(mI||(mI={}))});var Ele,Mle=h(()=>{Wp();gi();Kn();Tle();Ele=t=>{if(t.facade==null)return ge(!0);if(t.floorStacks==null)return Ie({kind:mI.MissingFloorStackError,properties:null});let e=new Set(t.floorStacks.map(n=>n.id)),r=go(t);for(let[n,i]of kr(t.facade))if(i!=null){if(!e.has(n))return Ie({kind:mI.UnknownFloorStackError,properties:{floorStackId:n}});for(let o of i.geometryAnchors){let s=r(o.floorId,o.geometryId);if(s.isErr())return s}}return ge(!0)}});var Ale,Lle,V7e,U7e,Dle,Ole=h(()=>{ia();Su();gi();o7();ht();Mle();Ale=si("fc","FacadeId"),Lle=_.Intersect([_.Object({id:_.Ref(Ale)}),pg({minItems:1})],{$id:"FacadeProperties"}),V7e=_.Object({facade:Ii(_.Record(iA,_.Ref(Lle),{additionalProperties:!1}))},{$id:"FacadeExtensionSchema"}),U7e=/^facade\/(.*)\.json$/,Dle={name:"ext:facade",schema:V7e,intoBundle:function*(t){if(t.facade!=null)for(let e of Pr(t.facade))yield{path:`facade/${e}.json`,contents:t.facade[e]}},fromBundle:(t,e,r)=>{let n=t.match(U7e)?.[1];if(n)return{facade:{[n]:r(e)}}},references:[Ale,Lle],integrityCheck:Ele}});var kle,Fle=h(()=>{Wp();gi();Kn();kle=t=>{if(t.floorImages==null)return ge(!0);let e=go(t);for(let[r,n]of kr(t.floorImages))if(n!=null)for(let i of n.features){if(!("geometryId"in i.properties))continue;let o=i.properties.geometryId,s=e(r,o);if(s.isErr())return s}return ge(!0)}});var s7,Rle,Nle,Ble,zle,Vle,G7e,j7e,Ule,Gle=h(()=>{nI();ia();Su();gi();ht();Fle();s7=_.Object({path:_.String({format:"uri",description:"The path to the image. This will be a remote URL."}),width:_.Number({minimum:0,description:"The width of the image when represented on the map, in meters."}),height:_.Number({minimum:0,description:"The height of the image when represented on the map, in meters."}),rotation:_.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"BaseFloorImageProperties"}),Rle=_.Intersect([_.Ref(s7),wu],{$id:"AnchoredFloorImageProperties"}),Nle=_.Intersect([_.Ref(s7),_.Object({verticalOffset:_.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"FloatingFloorImageProperties"}),Ble=_.Union([Rle,Nle],{$id:"FloorImageProperties"}),zle=is(_.Ref(Es),Ble,{$id:"FloorImageFeature"}),Vle=oa(_.Ref(zle),{$id:"FloorImageCollection"}),G7e=_.Object({floorImages:Ii(_.Record(Or,_.Ref(Vle),{additionalProperties:!1}))},{$id:"FloorImagesExtensionSchema"}),j7e=/^floorImages\/(.*)\.geojson$/,Ule={name:"ext:floor-images",schema:G7e,intoBundle:function*(t){if(t.floorImages!=null)for(let e of Pr(t.floorImages))yield{path:`floorImages/${e}.geojson`,contents:t.floorImages[e]}},fromBundle:(t,e,r)=>{let n=t.match(j7e)?.[1];if(n)return{floorImages:{[n]:r(e)}}},references:[s7,Rle,Nle,Ble,zle,Vle],integrityCheck:kle}});var jle,$le=h(()=>{Wp();gi();Kn();jle=t=>{if(t.kinds==null)return ge(!0);let e=go(t);for(let[r,n]of kr(t.kinds))if(n!=null)for(let i of Pr(n)){let o=e(r,i);if(o.isErr())return o}return ge(!0)}});var oZt,$7e,sZt,qle,Hle,q7e,H7e,Wle,Zle=h(()=>{ia();Su();gi();ht();$le();({values:oZt,schema:$7e,record:sZt}=Ua(["room","hallway","wall","desk","poi","area","window"],{$id:"Kind"})),qle=$7e,Hle=Ii(_.Record(Ts,_.Ref(qle),{additionalProperties:!1,$id:"GeometryKinds"})),q7e=_.Object({kinds:Ii(_.Record(Or,_.Ref(Hle),{additionalProperties:!1}))},{$id:"KindsExtensionSchema"}),H7e=/^kinds\/(.*)\.json$/,Wle={name:"ext:kinds",schema:q7e,intoBundle:function*(t){if(t.kinds!=null)for(let e of Pr(t.kinds))yield{path:`kinds/${e}.json`,contents:t.kinds[e]}},fromBundle:(t,e,r)=>{let n=t.match(H7e)?.[1];if(n)return{kinds:{[n]:r(e)}}},references:[qle,Hle],integrityCheck:jle}});var oA,a7=h(()=>{(function(t){t.UnknownNeighbor="UnknownNeighbor"})(oA||(oA={}))});var Xle,Yle=h(()=>{Wp();gi();Tg();Kn();a7();Xle=t=>{if(t.nodes==null)return ge(!0);let e=go(t),r=dI(t);for(let[n,i]of kr(t.nodes)){if(i==null)continue;let o=new Set(i.features.map(s=>s.properties.id));for(let[s,a]of i.features.entries()){for(let l of a.properties.geometryIds){let u=e(n,l);if(u.isErr())return u}for(let[l,u]of a.properties.neighbors.entries()){if(!o.has(u.id))return Ie({kind:oA.UnknownNeighbor,properties:{floorId:n,nodeId:a.properties.id,neighborId:u.id}});let c=M1(u.flags,r,`nodes["${n}"].features[${s}].properties.neighbors[${l}]`);if(c.isErr())return c}}}return ge(!0)}});var l7,Kle,Jle,Qle,eue,W7e,Z7e,tue,rue=h(()=>{nI();ia();Su();gi();Tg();ht();Yle();a7();l7=si("n","NodeId"),Kle=_.Intersect([_.Object({id:_.Ref(l7,{description:"The unique identifier for the node."}),extraCost:_.Number({minimum:0,description:"The extra cost to traverse to the node, above the straight-line distance."})}),r7],{$id:"NodeNeighbor"}),Jle=_.Intersect([_.Object({id:_.Ref(l7,{description:"The unique identifier for the node."}),neighbors:_.Array(_.Ref(Kle),{description:"The neighbors of the node."})}),o3],{$id:"NodeProperties"}),Qle=is(_.Ref(Es),Jle,{$id:"NodeFeature"}),eue=oa(_.Ref(Qle),{$id:"NodeCollection"}),W7e=_.Object({nodes:Ii(_.Record(Or,_.Ref(eue),{additionalProperties:!1}))},{$id:"NodesExtensionSchema"}),Z7e=/^nodes\/(.*)\.json$/,tue={name:"ext:nodes",schema:W7e,intoBundle:function*(t){if(t.nodes!=null)for(let e of Pr(t.nodes))yield{path:`nodes/${e}.json`,contents:t.nodes[e]}},fromBundle:(t,e,r)=>{let n=t.match(Z7e)?.[1];if(n)return{nodes:{[n]:r(e)}}},references:[l7,Kle,Jle,Qle,eue],integrityCheck:Xle}});var sA,nue=h(()=>{(function(t){t.FloorInFloorStackError="FloorInFloorStackError"})(sA||(sA={}))});var iue,oue=h(()=>{n3();Kn();nue();iue=t=>{if(t.outdoors==null)return ge(!0);let e=xh(t);for(let r of t.outdoors.floors){let n=e(r);if(n.isErr())return n;if(t.floorStacks!=null){for(let i of t.floorStacks)if(i.floors.includes(r))return Ie({kind:sA.FloorInFloorStackError,properties:{floorId:r,floorStackId:i.id}})}}return ge(!0)}});var aue,X7e,sue,lue,uue=h(()=>{ia();ht();oue();aue=_.Object({floors:_.Array(_.Ref(Or),{uniqueItems:!0,description:"A list of floor IDs that should be considered to contain outdoor features."})},{$id:"Outdoors"}),X7e=_.Object({outdoors:_.Ref(aue)},{$id:"OutdoorsExtensionSchema"}),sue="outdoors.json",lue={name:"ext:outdoors",schema:X7e,intoBundle:function*(t){t.outdoors!=null&&(yield{path:sue,contents:t.outdoors})},fromBundle:(t,e,r)=>{if(t===sue)return{outdoors:r(e)}},references:[aue],integrityCheck:iue}});var aA,cue=h(()=>{(function(t){t.TilesetDuplicateKeyError="TilesetDuplicateKeyError"})(aA||(aA={}))});var pue,fue=h(()=>{Kn();cue();pue=t=>{if(t.tileset==null)return ge(!0);let e=new Set;if(e.add(t.tileset.default.key),t.tileset.others)for(let r of t.tileset.others){if(e.has(r.key))return Ie({kind:aA.TilesetDuplicateKeyError,properties:{key:r.key}});e.add(r.key)}return ge(!0)}});var u7,hue,Y7e,due,mue=h(()=>{ht();fue();u7=_.Object({key:_.String({minLength:1,description:"Unique identifier for the tileset style."}),name:_.String({minLength:1,description:"Display name of the tileset style."}),url:_.String({format:"uri",description:"URL of the tileset style."})},{$id:"TilesetStyle",description:"A tileset style definition."}),hue=_.Object({default:_.Ref(u7,{description:"The default tileset style, which should be used."}),others:_.Optional(_.Array(_.Ref(u7,{description:"Additional tileset styles that can be used."})))},{$id:"TilesetCollection"}),Y7e=_.Object({tileset:_.Ref(hue)},{$id:"TilesetExtensionSchema"}),due={name:"ext:mvf-tileset",schema:Y7e,intoBundle:function*(t){t.tileset!=null&&(yield{path:"tileset.json",contents:t.tileset})},fromBundle:(t,e,r)=>{if(t==="tileset.json")return{tileset:r(e)}},references:[u7,hue],integrityCheck:pue}});var yue,gue,vue,xue,K7e,J7e,Q7e,bue,_ue=h(()=>{ia();Su();gi();ht();yue=_.Object({},{$id:"WalkableProperties"}),gue=_.Object({},{$id:"NonWalkableProperties"}),vue=Ii(_.Record(Ts,_.Ref(yue),{$id:"WalkableGeometries",additionalProperties:!1})),xue=Ii(_.Record(Ts,_.Ref(gue),{$id:"NonWalkableGeometries",additionalProperties:!1})),K7e=_.Object({walkable:Ii(_.Record(Or,_.Ref(vue),{additionalProperties:!1})),nonwalkable:Ii(_.Record(Or,_.Ref(xue),{additionalProperties:!1}))},{$id:"TraversabilitySchema"}),J7e=/^walkable\/(.*)\.json$/,Q7e=/^nonwalkable\/(.*)\.json$/,bue={name:"ext:mvf-traversability",schema:K7e,intoBundle:function*(t){if(t.walkable!=null)for(let e of Pr(t.walkable))yield{path:`walkable/${e}.json`,contents:t.walkable[e]};if(t.nonwalkable!=null)for(let e of Pr(t.nonwalkable))yield{path:`nonwalkable/${e}.json`,contents:t.nonwalkable[e]}},fromBundle:(t,e,r)=>{let n=t.match(J7e)?.[1];if(n!=null)return{walkable:{[n]:r(e)}};let i=t.match(Q7e)?.[1];if(i!=null)return{nonwalkable:{[i]:r(e)}}},references:[yue,gue,vue,xue]}});function wue(t){return t.replace(/^g_/,"s_")}function e9e(t){return t.replace(/^g_/,"o_")}function t9e(t){return t.replace(/^g_/,"w_")}function r9e(t){return t.replace(/^g_/,"ar_")}function n9e(t,e,r){switch(t.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":{let n=[],i=0,o=t.geometry.type.replace("Multi","");for(let s of t.geometry.coordinates)n.push({...t,geometry:{type:o,coordinates:s},properties:{...t.properties,id:`${e}-${i++}`,kind:r}});return n}default:return[{...t,properties:{...t.properties,id:e,kind:r}}]}}function yI(t,e,r,n){let i=new Map;for(let{feature:o,floorId:s}of t){let a=o.properties.id,l=n.get(a);if(e.has(a)){let u=n9e(o,r(a),l),c=u.map(f=>f.properties.id),p=c.map(f=>({geometryId:f,floorId:s}));i.set(a,{ids:c,features:u,anchors:p})}}return i}function Sue(t){let e={space:new Map,obstruction:new Map,area:new Map,window:new Map};if(!t.geometry)return e;let r=new Map(Object.values(t.kinds??{}).filter(l=>l!==void 0).flatMap(kr)),n=kr(t.geometry).flatMap(([l,u])=>(u?.features??[]).map(c=>({feature:c,floorId:l}))).flat(),i=new Set(Object.values(t.walkable??{}).filter(l=>l!==void 0).flatMap(Pr)),o=new Set(Object.values(t.nonwalkable??{}).filter(l=>l!==void 0).flatMap(Pr)),s=new Set(Array.from(r.entries()).filter(([l,u])=>u==="area").map(([l])=>l)),a=new Set(Array.from(r.entries()).filter(([l,u])=>u==="window").map(([l])=>l));return i.size>0&&(e.space=yI(n,i,wue,r)),o.size>0&&(e.obstruction=yI(n,o,e9e,r)),s.size>0&&(e.area=yI(n,s,r9e,r)),a.size>0&&(e.window=yI(n,a,t9e,r)),i.size===0&&o.size===0&&s.size===0&&(e.space=yI(n,new Set(n.map(l=>l.feature.properties.id)),wue,r)),e}var Iue=h(()=>{gi()});function Pue(t){let e=i9e(t),r=Sue(t),n=o9e(t);return{geometryMaps:r,nodesByGeometryId:e,geometryFeatureById:n}}function i9e(t){let e=new Map;for(let r of Object.values(t.nodes??{}))for(let n of r?.features??[])if(n.properties.geometryIds.length>0)for(let i of n.properties.geometryIds){let o=e.get(i)??[];o.push(n.properties.id),e.set(i,o)}return e}function o9e(t){let e=new Map;for(let r of Object.values(t.geometry??{}))for(let n of r?.features??[])e.set(n.properties.id,n);return e}var Cue=h(()=>{Iue()});function Tue(t,e){if(!t.annotations||!t.annotationSymbols||!t.geometry)return{};let r={};for(let[n,i]of kr(t.annotations)){if(!i||i.length===0||!t.geometry[n]||t.geometry[n].features.length===0)continue;let o=new Map(t.geometry[n].features.map(a=>[a.properties.id,a])),s={type:"FeatureCollection",features:[]};for(let a of i){let l=o.get(a.geometryId);if(!l||l.geometry.type!=="Point")continue;let u={id:a.id,externalId:a.externalId,symbolId:a.symbolKey};s.features.push({type:"Feature",geometry:l.geometry,properties:u})}r[n]=s}return{annotation:r}}var Eue=h(()=>{gi()});function Mue(t,{nodesByGeometryId:e}){let r={"connection.json":[],entrance:{}},n=t.navigationFlags?.[t7.accessible],i=t.navigationFlags?.[t7.outdoors],o=new Map(Object.values(t.geometry??{}).flatMap(s=>s?.features??[]).map(s=>[s.properties.id,s]));for(let s of t.connections??[]){if(c7(s,o)){let c=s9e(s,o,e,i);for(let[p,f]of c)r.entrance[p]||(r.entrance[p]={type:"FeatureCollection",features:[]}),r.entrance[p].features.push(f);continue}let a=n!=null&&s.entrances.every(c=>E1(c,n))&&s.exits.every(c=>E1(c,n)),l=Array.from(new Set([...s.entrances.map(c=>e.get(c.geometryId)),...s.exits.map(c=>e.get(c.geometryId))].flat().filter(c=>c!=null))),u={id:s.id,externalId:s.details?.externalId??"",type:s.type,accessible:a,nodes:l};s.details?.name&&(u.details={name:s.details.name}),s.extra&&(u.extra=s.extra),r["connection.json"].push(u)}return r}function c7(t,e){return t.type==n7.door&&t.entrances.every(r=>e.get(r.geometryId)?.geometry.type==="LineString")}function s9e(t,e,r,n){if(t.type!==n7.door)return[];let i=[];for(let o of t.entrances){let s=e.get(o.geometryId);if(s?.geometry.type==="LineString"){let a={type:"Feature",geometry:s.geometry,properties:{id:t.id,externalId:t.details?.externalId??"",isExterior:a9e(t,n)}},l=t.details;l&&(a.properties.details={name:l.name,description:l.description},l.icon&&(a.properties.details.images=[{url:l.icon,altText:`${l.name} icon`}]));let u=r.get(o.geometryId);u&&u.length>0&&(a.properties.node=u[0]),i.push([o.floorId,a])}}return i}function a9e(t,e){return t.entrances.some(r=>E1(r,e))||t.exits.some(r=>E1(r,e))}var p7=h(()=>{i7();Tg()});function Lue(t,{geometryMaps:e,nodesByGeometryId:r}){if(!t.enterprise)return{};let n={categories:[],locations:[],locationInstances:[],layers:[],venue:{slug:"",name:"",externalId:"",defaultLanguage:{name:"",code:""},languages:[]}},i=t.manifest?.features[0];if(i&&(n.venue.defaultFloor=i.properties.defaultFloor,n.venue.tzid=i.properties.tzid,n.venue.name=i.properties.name),t.enterprise.venue){let w=t.enterprise.venue;n.venue={...n.venue,slug:w.slug,name:w.details.name??n.venue.name,externalId:w.details.externalId??"",defaultLanguage:w.defaultLanguage,languages:w.languages,countrycode:w.countrycode,coverImage:w.coverImage,logo:w.logo,icon:w.details.icon,extra:w.extra,mappedinWebUrl:w.mappedinWebUrl,operationHours:w.operationHours,topLocations:w.topLocations}}let o=new Map,s=new Map,a=t.locations,l=t.enterprise.locations;if(a&&l){let w=new Map(a.map(S=>[S.id,S]));for(let S of l){let I=w.get(S.locationId);if(I){let P=I.details,T={id:S.id,name:P.name,externalId:P.externalId??"",type:S.type,sortOrder:S.sortOrder,amenity:S.amenity,description:P.description,extra:I.extra,links:I.links,operationHours:I.openingHours,gallery:S.gallery,logo:I.logo,shortName:P.shortName,picture:S.picture,showFloatingLabelWhenImagePresent:S.showFloatingLabelWhenImagePresent,showLogo:S.showLogo,siblingGroups:S.siblingGroups,states:S.states,tags:S.tags,spaces:[],nodes:[],polygons:[]};I.phone&&(T.phone={number:I.phone});let M=Aue(I.social);I.website&&(M.website=I.website.url),T.social=M;for(let E of I.geometryAnchors){let D=e.space.get(E.geometryId);if(D){let $=new Set(D.features.filter(U=>U.geometry.type==="Polygon").map(U=>U.properties.id));for(let U of D.anchors)T.spaces.push({floor:U.floorId,id:U.geometryId}),$.has(U.geometryId)&&T.polygons.push({map:U.floorId,id:U.geometryId})}let B=r.get(E.geometryId);for(let $ of B??[])T.nodes.push({map:E.floorId,id:$})}n.locations.push(T);for(let E of I.categories)o.set(E,[...o.get(E)??[],S.id]);s.set(S.id,I.categories)}}}let u=t.enterprise.locationInstances,c=t.locationInstances;if(u&&c){let w=new Map(c.map(I=>[I.id,I])),S=[];for(let I of u){let P=w.get(I.locationInstanceId);if(P){let T={id:I.id,parent:I.parentId,name:P.details?.name,externalId:P.details?.externalId,type:I.type,sortOrder:I.sortOrder,amenity:I.amenity,description:P.details?.description,extra:P.extra,links:P.links,operationHours:P.openingHours,gallery:I.gallery,picture:I.picture,showFloatingLabelWhenImagePresent:I.showFloatingLabelWhenImagePresent,showLogo:I.showLogo,siblingGroups:I.siblingGroups,states:I.states,tags:I.tags,logo:P.logo,shortName:P.details?.shortName};P.phone&&(T.phone={number:P.phone});let M=Aue(P.social??[]);if(P.website&&(M.website=P.website.url),Object.keys(M).length>0&&(T.social=M),P.geometryAnchors?.length){let E=P.geometryAnchors.flatMap(D=>e.space.get(D.geometryId)?.anchors??[]);E.length>0&&(T.spaces=E.map(D=>({floor:D.floorId,id:D.geometryId})))}if(P.geometryAnchors){T.spaces=[],T.polygons=[],T.nodes=[];for(let E of P.geometryAnchors){let D=e.space.get(E.geometryId);if(D){let $=new Set(D.features.filter(U=>U.geometry.type==="Polygon").map(U=>U.properties.id));for(let U of D.anchors)T.spaces.push({floor:U.floorId,id:U.geometryId}),$.has(U.geometryId)&&T.polygons.push({map:U.floorId,id:U.geometryId})}let B=r.get(E.geometryId);for(let $ of B??[])T.nodes.push({map:E.floorId,id:$})}}S.push(T)}}S.length>0&&(n.locationInstances=S)}let p=t.locationCategories,f=t.enterprise.categories;if(p&&f){let w=[],S=new Map(p.map(M=>[M.id,M])),I=new Map(f.map(M=>[M.categoryId,M.id])),P=new Map;for(let M of p){let E=I.get(M.parent);if(E){let D=P.get(E)??[];D.push(M.id),P.set(E,D)}}for(let M of f){let E=S.get(M.categoryId);if(E){let B=(P.get(M.id)??[]).map(U=>I.get(U)).filter(U=>U!==void 0),$={id:M.id,name:E.details.name,externalId:E.details.externalId??"",sortOrder:M.sortOrder,children:B,locations:o.get(M.categoryId)??[],icon:E.details.icon,picture:M.picture,color:M.color,extra:E.extra,iconFromDefaultList:M.iconFromDefaultList};w.push($)}}n.categories=w;let T={};for(let[M,E]of s.entries())T[M]=E.map(D=>I.get(D)).filter(D=>D!==void 0);n.categoryPriorities=T}let d={};for(let[w,S]of Object.entries(t.defaultStyle??{}))if(S.buffer>0){let I=S.geometryAnchors.flatMap(P=>e.space.get(P.geometryId)?.anchors??[]);d[w]={edgeOffset:S.buffer,geometryAnchors:I}}Object.keys(d).length>0&&(n.enterpriseStyles=d);let m=new Map;for(let w of Object.values(t.enterprise.layers??{}))if(w)for(let[S,I]of kr(w)){if(typeof I!="string")continue;let P=m.get(I)??{name:I,id:`ely_${I}`,spaces:[]};P.spaces.push(...e.space.get(S)?.anchors.map(T=>({floorId:T.floorId,spaceId:T.geometryId}))??[]),m.set(I,P)}m.size>0&&(n.layers=Array.from(m.values()));let y=[];for(let w of Object.values(t.enterprise.textures??{}))for(let S of w){let I=e.space.get(S.geometryId)?.anchors;!I||I.length<1||S.face==="unknown"||S.surface==="unknown"||y.push({repeat:S.repeat,offset:S.offset,rotation:S.rotation,path:S.path,face:S.face,surface:S.surface,bounds:S.bounds,geometryAnchors:I})}y.length>0&&(n.textures=y);let g={};for(let[w,S]of Object.entries(t.enterprise.floorText??{})){let I={type:"FeatureCollection",features:[]};for(let P of S.features){if(P.properties.align==="unknown")continue;let T={align:P.properties.align,color:P.properties.color,fontFamily:P.properties.fontFamily,fontSize:P.properties.fontSize,rotation:P.properties.rotation,text:P.properties.text,visible:P.properties.visible};"geometryId"in P.properties?T.geometryId=P.properties.geometryId:T.verticalOffset=P.properties.verticalOffset,I.features.push({type:"Feature",geometry:P.geometry,properties:T})}I.features.length>0&&(g[w]=I)}Object.keys(g).length>0&&(n.floorText=g);let b={enterprise:n};if(t.enterprise.textAreas){let w={};for(let[S,I]of kr(t.enterprise.textAreas)){let P={type:"FeatureCollection",features:[]};for(let T of I.features){if(T.properties.align==="unknown")continue;let M={align:T.properties.align,maxWidth:T.properties.maxWidth,maxHeight:T.properties.maxHeight,rotation:T.properties.rotation};"geometryId"in T.properties?M.anchorId=T.properties.geometryId:M.verticalOffset=T.properties.verticalOffset;let E={type:"Feature",geometry:T.geometry,properties:M};P.features.push(E)}w[S]=P}b.textAreas=w}return b}function Aue(t){let e={};for(let{name:r,url:n}of t){let i=r.toLowerCase();l9e.includes(i)&&(e[i]=n)}return e}var l9e,Due=h(()=>{gi();l9e=["facebook","instagram","twitter"]});function Oue(t,{geometryMaps:e}){if(!t.facade)return{};let r={},n={};for(let[i,o]of kr(t.facade))o&&(n[i]={id:o.id,spaces:o.geometryAnchors.flatMap(({floorId:s,geometryId:a})=>e.space.get(a)?.ids.map(l=>({floorId:s,spaceId:l}))).filter(s=>s!==void 0)});return Object.keys(n).length>0&&(r.facade=n),r}var kue=h(()=>{gi()});function Fue(t,e={}){let r={type:"FeatureCollection",features:[]},n=[];for(let i of t.floors.features)n.push({id:i.properties.id.replace(/^f_/,"m_"),externalId:i.properties.details?.externalId??"",elevation:i.properties.elevation,name:i.properties.details?.name??"",shortName:i.properties.details?.shortName??"",subtitle:i.properties.subtitle}),r.features.push({type:"Feature",geometry:i.geometry,properties:{id:i.properties.id,externalId:i.properties.details?.externalId??"",elevation:i.properties.elevation,name:i.properties.details?.name??"",shortName:i.properties.details?.shortName??"",subtitle:i.properties.subtitle}});return{"floor.geojson":r,"map.geojson":n}}var Rue=h(()=>{});function Nue(t,{geometryMaps:e}){let r={},n={};for(let[i,o]of kr(t.floorImages??{})){let s={features:[],type:"FeatureCollection"};for(let a of o?.features??[])if("verticalOffset"in a.properties)s.features.push(a);else{let{geometryId:l,...u}=a.properties,c=e.space.get(l)?.ids[0]??e.obstruction.get(l)?.ids[0];if(!c)continue;let p={geometry:a.geometry,properties:{...u,anchorId:c},type:a.type};s.features.push(p)}n[i]=s}return Object.keys(n).length>0&&(r.floorImages=n),r}var Bue=h(()=>{gi()});function zue(t,e={}){let r=[];for(let i of t?.floorStacks??[]){let o={id:i.id,floors:i.floors,maps:i.floors,externalId:i.details?.externalId??"",name:i.details?.name??"",shortName:i.details?.shortName??"",type:"Building"};i.defaultFloor&&(o.defaultFloor=i.defaultFloor),r.push(o)}if(t.outdoors){let i={id:"outdoors",floors:t.outdoors.floors,maps:t.outdoors.floors,type:"Outdoor",name:"Outdoors",externalId:"outdoors"};r.push(i)}return{"floorstack.json":r,"mapstack.geojson":r}}var Vue=h(()=>{});var Gue=V((lXt,f7)=>{"use strict";var lA=(aC(),Fm(u4));lA.default&&(lA=lA.default);f7.exports=Uue;f7.exports.default=Uue;function Uue(t,e,r){e=e||1;for(var n,i,o,s,a=0;a<t[0].length;a++){var l=t[0][a];(!a||l[0]<n)&&(n=l[0]),(!a||l[1]<i)&&(i=l[1]),(!a||l[0]>o)&&(o=l[0]),(!a||l[1]>s)&&(s=l[1])}var u=o-n,c=s-i,p=Math.min(u,c),f=p/2;if(p===0){var d=[n,i];return d.distance=0,d}for(var m=new lA(void 0,u9e),y=n;y<o;y+=p)for(var g=i;g<s;g+=p)m.push(new pm(y+f,g+f,f,t));var b=p9e(t),w=new pm(n+u/2,i+c/2,0,t);w.d>b.d&&(b=w);for(var S=m.length;m.length;){var I=m.pop();I.d>b.d&&(b=I,r&&console.log("found best %d after %d probes",Math.round(1e4*I.d)/1e4,S)),!(I.max-b.d<=e)&&(f=I.h/2,m.push(new pm(I.x-f,I.y-f,f,t)),m.push(new pm(I.x+f,I.y-f,f,t)),m.push(new pm(I.x-f,I.y+f,f,t)),m.push(new pm(I.x+f,I.y+f,f,t)),S+=4)}r&&(console.log("num probes: "+S),console.log("best distance: "+b.d));var P=[b.x,b.y];return P.distance=b.d,P}function u9e(t,e){return e.max-t.max}function pm(t,e,r,n){this.x=t,this.y=e,this.h=r,this.d=c9e(t,e,n),this.max=this.d+this.h*Math.SQRT2}function c9e(t,e,r){for(var n=!1,i=1/0,o=0;o<r.length;o++)for(var s=r[o],a=0,l=s.length,u=l-1;a<l;u=a++){var c=s[a],p=s[u];c[1]>e!=p[1]>e&&t<(p[0]-c[0])*(e-c[1])/(p[1]-c[1])+c[0]&&(n=!n),i=Math.min(i,f9e(t,e,c,p))}return i===0?0:(n?1:-1)*Math.sqrt(i)}function p9e(t){for(var e=0,r=0,n=0,i=t[0],o=0,s=i.length,a=s-1;o<s;a=o++){var l=i[o],u=i[a],c=l[0]*u[1]-u[0]*l[1];r+=(l[0]+u[0])*c,n+=(l[1]+u[1])*c,e+=c*3}return e===0?new pm(i[0][0],i[0][1],0,t):new pm(r/e,n/e,0,t)}function f9e(t,e,r,n){var i=r[0],o=r[1],s=n[0]-i,a=n[1]-o;if(s!==0||a!==0){var l=((t-i)*s+(e-o)*a)/(s*s+a*a);l>1?(i=n[0],o=n[1]):l>0&&(i+=s*l,o+=a*l)}return s=t-i,a=e-o,s*s+a*a}});var jue,h9e,d9e,m9e,y9e,uA,$ue=h(()=>{Kn();jue=_e(Gue(),1),h9e=t=>{let e=t.geometry.coordinates[0],r=0;for(let n=0;n<e.length-1;n++)r+=e[n][0]*e[n+1][1]-e[n+1][0]*e[n][1];return Math.abs(r/2)},d9e=(t,e)=>{let[r,n]=t,i=e.geometry.coordinates[0],o=!1;for(let s=0,a=i.length-1;s<i.length;a=s++){let[l,u]=i[s],[c,p]=i[a];u>n!=p>n&&r<(c-l)*(n-u)/(p-u)+l&&(o=!o)}return o},m9e=t=>{let e=t.geometry.coordinates[0],r=0,n=0;for(let i=0;i<e.length-1;i++)r+=e[i][0],n+=e[i][1];return{geometry:{coordinates:[r/(e.length-1),n/(e.length-1)]}}},y9e=t=>{let e=h9e(t),r=Number.isFinite(e)?Math.max(e,1):1;return Math.sqrt(r)*1e-6},uA=t=>{try{let r=m9e(t).geometry.coordinates;if(!d9e(r,t)){let i=(0,jue.default)(t.geometry.coordinates,y9e(t));return ge([i[0],i[1]])}return ge(r)}catch{return Ie(new Error("Unable to calculate center of polygon"))}}});function h7(t){return t?.geometry?.type==="Polygon"}function que(t,{geometryMaps:e,nodesByGeometryId:r}){let n=_9e(t.defaultStyle),i={},o={},s={},a={};for(let u of Pr(t.geometry)){let c=t.geometry[u];if(!c)continue;let p=[],f=[],d=[],m=[];for(let y of c.features){let g=y.properties.id,b=n.has(g),w=r.get(g)??[];for(let S of e.space.get(g)?.features??[])p.push(g9e(S,w));for(let S of e.obstruction.get(g)?.features??[])f.push(v9e(S,b));for(let S of e.area.get(g)?.features??[])d.push(x9e(S,w));for(let S of e.window.get(g)?.features??[])m.push(b9e(S))}p.length>0&&(i[u]={type:"FeatureCollection",features:p.filter(y=>y!==null)}),f.length>0&&(o[u]={type:"FeatureCollection",features:f.filter(y=>y!==null)}),d.length>0&&(s[u]={type:"FeatureCollection",features:d.filter(y=>y!==null)}),m.length>0&&(a[u]={type:"FeatureCollection",features:m.filter(y=>y!==null)})}let l={space:i,obstruction:o};return Object.keys(s).length>0&&(l.area=s),Object.keys(a).length>0&&(l.window=a),l}function g9e(t,e){switch(t.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":return null}let r={type:"Feature",geometry:t.geometry,properties:{destinationNodes:e,id:t.properties.id,externalId:t.properties.details?.externalId??"",kind:t.properties.kind}};return t.properties.details&&(r.properties.details={name:t.properties.details.name,description:t.properties.details.description,images:t.properties.details.icon?[{url:t.properties.details.icon,altText:t.properties.details.name?`${t.properties.details.name} icon`:"icon"}]:void 0}),h7(r)&&(r.properties.center=uA(r).unwrapOr(void 0)),r}function v9e(t,e){switch(t.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"Point":return null}let r=t.properties,n={type:"Feature",geometry:t.geometry,properties:{id:r.id,externalId:r.details?.externalId??"",entrances:[],kind:r.kind,footprintComponent:e}};return h7(n)&&(n.properties.center=uA(n).unwrapOr(void 0)),r.details&&(n.properties.details={name:r.details.name,description:r.details.description,images:r.details.icon?[{url:r.details.icon,altText:r.details.name?`${r.details.name} icon`:"icon"}]:void 0}),n}function x9e(t,e){if(t.geometry.type!=="Polygon")return null;let r=t.properties,n={type:"Feature",geometry:t.geometry,properties:{id:r.id,externalId:r.details?.externalId??"",destinationNodes:e}};return h7(n)&&(n.properties.center=uA(n).unwrapOr(void 0)),r.details&&(n.properties.details={name:r.details.name,description:r.details.description,images:r.details.icon?[{url:r.details.icon,altText:r.details.name?`${r.details.name} icon`:"icon"}]:void 0}),n}function b9e(t){return t.geometry.type!=="LineString"?null:{type:"Feature",geometry:t.geometry,properties:{id:t.properties.id}}}function _9e(t){let e=[...t?.ExteriorWalls?.geometryAnchors??[],...t?.Walls?.geometryAnchors??[]];return new Set(e.map(n=>n.geometryId))}var Hue=h(()=>{gi();$ue()});function Wue(t,{geometryMaps:e,geometryFeatureById:r}){if(!t.locationCategories&&!t.locations)return{};let n={};if(t.locationCategories?.length){let i=[];for(let o of t.locationCategories){let s={id:o.id,name:o.details.name,icon:o.details.icon??""};o.parent&&(s.parent=o.parent),i.push(s)}n["category.json"]=i}if(t.locations?.length){let i=w9e(t,{geometryFeatureById:r}),o=[];for(let s of t.locations){let a={id:s.id,name:s.details.name,categories:s.categories,spaces:[],obstructions:[],areas:[],annotations:[],connections:[],entrances:[],links:s.links,openingHoursSpecification:s.openingHours??[],pictures:s.images,social:s.social,description:s.details.description,externalId:s.details.externalId,icon:s.details.icon,logo:s.logo,phone:s.phone,website:s.website};o.push(a);for(let{geometryId:l,floorId:u}of s.geometryAnchors)a.spaces.push(...e.space.get(l)?.ids.map(c=>({id:c,floor:u}))??[]),a.obstructions.push(...e.obstruction.get(l)?.ids.map(c=>({id:c,floor:u}))??[]),a.areas.push(...e.area.get(l)?.ids.map(c=>({id:c,floor:u}))??[]),a.entrances.push(...i.entrancesByGeometryId.get(l)??[]),a.connections.push(...i.connectionsByGeometryId.get(l)??[]),a.annotations.push(...i.annotationsByGeometryId.get(l)??[])}n["location.json"]=o}return n}function w9e(t,{geometryFeatureById:e}){let r={annotationsByGeometryId:new Map,connectionsByGeometryId:new Map,entrancesByGeometryId:new Map};if(t.annotations)for(let[n,i]of kr(t.annotations))for(let o of i??[]){let s=o.geometryId,a=o.id,l=r.annotationsByGeometryId.get(s)??[];l.push({floor:n,id:a}),r.annotationsByGeometryId.set(s,l)}if(t.connections)for(let n of t.connections){let i=c7(n,e),o=Array.from(new Map([...n.entrances,...n.exits].map(s=>[`${s.geometryId}_${s.floorId}`,s])).values());for(let s of o){let a=s.geometryId;if(i){let l=r.entrancesByGeometryId.get(a)??[];l.push({floor:s.floorId,id:n.id}),r.entrancesByGeometryId.set(a,l)}else{let l=r.connectionsByGeometryId.get(a)??[];l.push(n.id),r.connectionsByGeometryId.set(a,l)}}}return r}var Zue=h(()=>{gi();p7()});function Xue(t,e){let r={features:[],type:"FeatureCollection"},n={"manifest.geojson":r},i=t.manifest;if(i.features.length>0){let o=i.features[0],s=o.properties,a={type:"Feature",geometry:o.geometry,properties:{folder_struct:[],version:"2.0.0",time:s.time,name:s.name,naturalBearing:s.naturalBearing,tzid:s.tzid,map:s.mapId,org_id:s.orgId,language:s.language}};r.features.push(a)}return n}var Yue=h(()=>{});function Kue(t,{geometryMaps:e}){let r={"node.geojson":{type:"FeatureCollection",features:[]}},n=r["node.geojson"].features,i=new Map;for(let a of t.floors?.features??[])i.set(a.properties.id,a.properties.elevation);let o=new Map;for(let a of Object.values(t.nodes??{}))for(let l of a?.features??[])for(let u of l.properties.geometryIds)o.set(u,[...o.get(u)??[],l.properties.id]);let s=new Map;for(let a of t.connections??[]){let l=a.exits.map(u=>({...u,nodes:o.get(u.geometryId)??[]}));for(let u of a.entrances){let c=o.get(u.geometryId)??[];for(let p of c)for(let f of l){let d=Math.abs((i.get(u.floorId)??0)-(i.get(f.floorId)??0))*a.floorCostMultiplier,m=s.get(p)??[];m.push(...f.nodes.map(y=>({id:y,weight:d+a.entryCost}))),s.set(p,m)}}}for(let[a,l]of kr(t.nodes??{}))for(let u of l?.features??[]){let c=e.space.get(u.properties.geometryIds[0])?.features[0],p=c?.geometry.type==="Point"&&c?.properties.details?.externalId?c.properties.details.externalId:"",f={type:"Feature",geometry:u.geometry,properties:{id:u.properties.id,floor:a,space:u.properties.geometryIds.map(d=>e.space.get(d)?.ids).flat().filter(d=>d!==void 0),neighbors:[...u.properties.neighbors.map(d=>({id:d.id,weight:d.extraCost})),...s.get(u.properties.id)??[]],map:a,externalId:p}};n.push(f)}return r}var Jue=h(()=>{gi()});function S9e(t,e){let r={};for(let n of t){let i=e.get(n);i&&(r[i]??(r[i]=[]),r[i].push(n))}return r}function Que(t,{geometryMaps:e}){if(!t.defaultStyle)return{};let r={},n={};r["styles.json"]=n;let i=[...Array.from(e.space.values()).map(s=>s.features),...Array.from(e.obstruction.values()).map(s=>s.features)],o=new Map(i.flatMap(s=>s.map(a=>[a.properties.id,a.geometry.type])));for(let[s,a]of kr(t.defaultStyle)){let l=S9e(a.geometryAnchors.flatMap(u=>[...e.space.get(u.geometryId)?.ids??[],...e.obstruction.get(u.geometryId)?.ids??[]]),o);if(l.Point&&l.Point.length>0){let u={points:Array.from(l.Point.values()),showImage:a.extra?.showImage!==void 0?a.extra?.showImage===!0:a.opacity!==0};n[`${s}.Point`]=u}if(l.LineString&&l.LineString.length>0){let u={lineStrings:Array.from(l.LineString.values()),altitude:a.altitude,color:a.color,height:a.height,opacity:a.opacity,width:a.buffer};n[`${s}.LineString`]=u}if(l.Polygon&&l.Polygon.length>0){let u={polygons:Array.from(l.Polygon.values()),altitude:a.altitude,color:a.color,height:a.height,opacity:a.opacity};a.extra?.showImage!==void 0&&(u.showImage=a.extra.showImage===!0),n[`${s}.Polygon`]=u}}return r}var ece=h(()=>{gi()});function P9e(t){let e=Pue(t),r=Fue(t,e),n=que(t,e),i=Kue(t,e),o=Mue(t,e),s=Que(t,e),a=zue(t,e),l=Nue(t,e),u=Oue(t,e),c=Tue(t,e),p=Wue(t,e),f=Lue(t,e),d=Xue(t,e);return{...r,...n,...i,...o,...s,...a,"tileset.json":t.tileset,...l,...u,...c,...p,...f,...d}}async function d7(t){let e=await I9e.decompress(t);return e.isOk()?ge(P9e(e.value)):Ie(e.error)}var I9e,tce=h(()=>{moe();Kae();i7();aa();xle();Ole();Gle();o7();Zle();cm();Tg();rue();uue();mue();_ue();Kn();Cue();Eue();p7();Due();kue();Rue();Bue();Vue();Hue();Zue();Yue();Jue();ece();I9e=Hse().extendOptional(ole).extendOptional(tue).extendOptional(hle).extendOptional(Wle).extendOptional(bue).extendOptional(vle).extendOptional(Cle).extendOptional(lue).extendOptional(due).extendOptional(Ule).extendOptional(Dle).extendOptional(doe).extendOptional(nae).extendOptional(Yae).build().expect("Invalid parser, this should never happen. Likely a bug in the MVFv2 library, or one of the extensions.")});var rce=h(()=>{YK();qee();Hee();Wee();Zee();ate();RF();lte();tce()});function gI(t){return t.endsWith("/")?t:`${t}/`}var cA=h(()=>{"use strict"});var vI,nce,pA=h(()=>{"use strict";vI="https://app.mappedin.com/",nce="https://auth.mappedin.com/"});var C9e,fA,m7=h(()=>{"use strict";C9e=t=>{let e=Date.now();return t-e},fA=(t,e)=>C9e(t)<=e*60*1e3});async function hA(t,e=!1){let r=`${t.key}`,n=Rl.getInstance(),i=n?.loadSessionData(ice)||{},o=Math.floor(Date.now()/1e3);if(i[r]&&!fA(i[r].expiresTimestamp*1e3,oce))return i[r];let s=e?await T9e(t,o):await E9e(t,o),a={...i,[r]:s};return n?.saveSessionData(ice,a),s}async function T9e(t,e){let r=`${t.baseAuthUri??nce}oauth2/token`,n=await Eg()(r,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials",client_id:t.key,client_secret:t.secret})});if(!n.ok)throw new Error(`${n.status} ${n.statusText}: ${await n.text()}`);let i=await n.json();return{accessToken:i.access_token,expiresTimestamp:e+i.expires_in}}async function E9e(t,e){let r=`${t.baseAuthUri?gI(t.baseAuthUri):vI}api/api-key/token`,n=await Eg()(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:t.key,secret:t.secret})});if(!n.ok)throw new Error(`${n.status} ${n.statusText}: ${await n.text()}`);let i=await n.json();return{accessToken:i.access_token,expiresTimestamp:e+i.expires_in}}var oce,sce,ice,y7=h(()=>{"use strict";cA();$P();pA();Mg();m7();oce=60,sce=oce*60*1e3,ice="accessTokens"});async function g7(t,e){let r=`${e}__${t.mapId}`,n=Rl.getInstance(),i=n?.loadSessionData(ace)||{};if(i[r]&&!fA(i[r].expires,lce))return i[r];let o=await M9e(t,e),s={...i,[r]:{token:o.token,expires:new Date(o.expires).getTime()}};return n?.saveSessionData(ace,s),o}async function M9e(t,e){let r=`${t.baseUri?gI(t.baseUri):vI}api/v1/venue/${t.mapId}/sas-token`,n=await Eg()(r,{method:"GET",headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error(`${n.status} ${n.statusText}: ${await n.text()}`);let i=await n.json();return{token:i.token,expires:new Date(i.expires).getTime()}}var lce,uce,ace,v7=h(()=>{"use strict";cA();$P();pA();Mg();m7();lce=60,uce=lce*60*1e3,ace="miSasTokens"});var U7={};Go(U7,{AsyncCompress:()=>O9e,AsyncDecompress:()=>N9e,AsyncDeflate:()=>Dce,AsyncGunzip:()=>kce,AsyncGzip:()=>O9e,AsyncInflate:()=>R7,AsyncUnzipInflate:()=>Z9e,AsyncUnzlib:()=>Rce,AsyncZipDeflate:()=>j9e,AsyncZlib:()=>F9e,Compress:()=>S7,DecodeUTF8:()=>V9e,Decompress:()=>Bce,Deflate:()=>af,EncodeUTF8:()=>U9e,FlateErrorCode:()=>L9e,Gunzip:()=>_A,Gzip:()=>S7,Inflate:()=>Ga,Unzip:()=>X9e,UnzipInflate:()=>W9e,UnzipPassThrough:()=>qce,Unzlib:()=>SA,Zip:()=>$9e,ZipDeflate:()=>G9e,ZipPassThrough:()=>_I,Zlib:()=>P7,compress:()=>k9e,compressSync:()=>I7,decompress:()=>B9e,decompressSync:()=>z9e,deflate:()=>Oce,deflateSync:()=>PI,gunzip:()=>Fce,gunzipSync:()=>wA,gzip:()=>k9e,gzipSync:()=>I7,inflate:()=>N7,inflateSync:()=>G1,strFromU8:()=>z7,strToU8:()=>hm,unzip:()=>Y9e,unzipSync:()=>K9e,unzlib:()=>Nce,unzlibSync:()=>IA,zip:()=>q9e,zipSync:()=>H9e,zlib:()=>R9e,zlibSync:()=>C7});function F7(t,e){return!e&&typeof t=="function"&&(e=t,t={}),this.ondata=e,t}function Oce(t,e,r){return r||(r=e,e={}),typeof r!="function"&&Ge(7),V1(t,e,[z1],function(n){return dm(PI(n.data[0],n.data[1]))},0,r)}function PI(t,e){return Ag(t,e||{},0,0)}function N7(t,e,r){return r||(r=e,e={}),typeof r!="function"&&Ge(7),V1(t,e,[B1],function(n){return dm(G1(n.data[0],A7(n.data[1])))},1,r)}function G1(t,e){return SI(t,e)}function k9e(t,e,r){return r||(r=e,e={}),typeof r!="function"&&Ge(7),V1(t,e,[z1,Cce,function(){return[I7]}],function(n){return dm(I7(n.data[0],n.data[1]))},2,r)}function I7(t,e){e||(e={});var r=N1(),n=t.length;r.p(t);var i=Ag(t,e,O7(e),8),o=i.length;return L7(i,e),an(i,o-8,r.d()),an(i,o-4,n),i}function Fce(t,e,r){return r||(r=e,e={}),typeof r!="function"&&Ge(7),V1(t,e,[B1,Tce,function(){return[wA]}],function(n){return dm(wA(n.data[0]))},3,r)}function wA(t,e){return SI(t.subarray(D7(t),-8),e||new xr(Ace(t)))}function R9e(t,e,r){return r||(r=e,e={}),typeof r!="function"&&Ge(7),V1(t,e,[z1,Ece,function(){return[C7]}],function(n){return dm(C7(n.data[0],n.data[1]))},4,r)}function C7(t,e){e||(e={});var r=M7();r.p(t);var n=Ag(t,e,2,4);return k7(n,e),an(n,n.length-4,r.d()),n}function Nce(t,e,r){return r||(r=e,e={}),typeof r!="function"&&Ge(7),V1(t,e,[B1,Mce,function(){return[IA]}],function(n){return dm(IA(n.data[0],A7(n.data[1])))},5,r)}function IA(t,e){return SI((Lce(t),t.subarray(2,-4)),e)}function B9e(t,e,r){return r||(r=e,e={}),typeof r!="function"&&Ge(7),t[0]==31&&t[1]==139&&t[2]==8?Fce(t,e,r):(t[0]&15)!=8||t[0]>>4>7||(t[0]<<8|t[1])%31?N7(t,e,r):Nce(t,e,r)}function z9e(t,e){return t[0]==31&&t[1]==139&&t[2]==8?wA(t,e):(t[0]&15)!=8||t[0]>>4>7||(t[0]<<8|t[1])%31?G1(t,e):IA(t,e)}function hm(t,e){if(e){for(var r=new xr(t.length),n=0;n<t.length;++n)r[n]=t.charCodeAt(n);return r}if(fce)return fce.encode(t);for(var i=t.length,o=new xr(t.length+(t.length>>1)),s=0,a=function(c){o[s++]=c},n=0;n<i;++n){if(s+5>o.length){var l=new xr(s+8+(i-n<<1));l.set(o),o=l}var u=t.charCodeAt(n);u<128||e?a(u):u<2048?(a(192|u>>6),a(128|u&63)):u>55295&&u<57344?(u=65536+(u&1047552)|t.charCodeAt(++n)&1023,a(240|u>>18),a(128|u>>12&63),a(128|u>>6&63),a(128|u&63)):(a(224|u>>12),a(128|u>>6&63),a(128|u&63))}return Ou(o,0,s)}function z7(t,e){if(e){for(var r="",n=0;n<t.length;n+=16384)r+=String.fromCharCode.apply(null,t.subarray(n,n+16384));return r}else{if(T7)return T7.decode(t);var i=Vce(t),o=i[0],s=i[1];return s.length&&Ge(8),o}}function q9e(t,e,r){r||(r=e,e={}),typeof r!="function"&&Ge(7);var n={};B7(t,"",n,e);var i=Object.keys(n),o=i.length,s=0,a=0,l=o,u=new Array(o),c=[],p=function(){for(var g=0;g<c.length;++g)c[g]()},f=function(g,b){PA(function(){r(g,b)})};PA(function(){f=r});var d=function(){var g=new xr(a+22),b=s,w=a-s;a=0;for(var S=0;S<l;++S){var I=u[S];try{var P=I.c.length;O1(g,a,I,I.f,I.u,P);var T=30+I.f.length+fm(I.extra),M=a+T;g.set(I.c,M),O1(g,s,I,I.f,I.u,P,a,I.m),s+=16+T+(I.m?I.m.length:0),a=M+P}catch(E){return f(E,null)}}V7(g,s,u.length,w,b),f(null,g)};o||d();for(var m=function(g){var b=i[g],w=n[b],S=w[0],I=w[1],P=N1(),T=S.length;P.p(S);var M=hm(b),E=M.length,D=I.comment,B=D&&hm(D),$=B&&B.length,U=fm(I.extra),Y=I.level==0?0:8,G=function(ne,le){if(ne)p(),f(ne,null);else{var se=le.length;u[g]=II(I,{size:T,crc:P.d(),c:le,f:M,m:B,u:E!=b.length||B&&D.length!=$,compression:Y}),s+=30+E+U+se,a+=76+2*(E+U)+($||0)+se,--o||d()}};if(E>65535&&G(Ge(11,0,1),null),!Y)G(null,S);else if(T<16e4)try{G(null,PI(S,I))}catch(ne){G(ne,null)}else c.push(Oce(S,I,G))},y=0;y<l;++y)m(y);return p}function H9e(t,e){e||(e={});var r={},n=[];B7(t,"",r,e);var i=0,o=0;for(var s in r){var a=r[s],l=a[0],u=a[1],c=u.level==0?0:8,p=hm(s),f=p.length,d=u.comment,m=d&&hm(d),y=m&&m.length,g=fm(u.extra);f>65535&&Ge(11);var b=c?PI(l,u):l,w=b.length,S=N1();S.p(l),n.push(II(u,{size:l.length,crc:S.d(),c:b,f:p,m,u:f!=s.length||m&&d.length!=y,o:i,compression:c})),i+=30+f+g+w,o+=76+2*(f+g)+(y||0)+w}for(var I=new xr(o+22),P=i,T=o-i,M=0;M<n.length;++M){var p=n[M];O1(I,p.o,p,p.f,p.u,p.c.length);var E=30+p.f.length+fm(p.extra);I.set(p.c,p.o+E),O1(I,i,p,p.f,p.u,p.c.length,p.o,p.m),i+=16+E+(p.m?p.m.length:0)}return V7(I,i,n.length,T,P),I}function Y9e(t,e,r){r||(r=e,e={}),typeof r!="function"&&Ge(7);var n=[],i=function(){for(var g=0;g<n.length;++g)n[g]()},o={},s=function(g,b){PA(function(){r(g,b)})};PA(function(){s=r});for(var a=t.length-22;Fi(t,a)!=101010256;--a)if(!a||t.length-a>65558)return s(Ge(13,0,1),null),i;var l=la(t,a+8);if(l){var u=l,c=Fi(t,a+16),p=c==4294967295||u==65535;if(p){var f=Fi(t,a-12);p=Fi(t,f)==101075792,p&&(u=l=Fi(t,f+32),c=Fi(t,f+48))}for(var d=e&&e.filter,m=function(g){var b=jce(t,c,p),w=b[0],S=b[1],I=b[2],P=b[3],T=b[4],M=b[5],E=Gce(t,M);c=T;var D=function($,U){$?(i(),s($,null)):(U&&(o[P]=U),--l||s(null,o))};if(!d||d({name:P,size:S,originalSize:I,compression:w}))if(!w)D(null,Ou(t,E,E+S));else if(w==8){var B=t.subarray(E,E+S);if(S<32e4)try{D(null,G1(B,new xr(I)))}catch($){D($,null)}else n.push(N7(B,{size:I},D))}else D(Ge(14,"unknown compression type "+w,1),null);else D(null,null)},y=0;y<u;++y)m(y)}else s(null,{});return i}function K9e(t,e){for(var r={},n=t.length-22;Fi(t,n)!=101010256;--n)(!n||t.length-n>65558)&&Ge(13);var i=la(t,n+8);if(!i)return{};var o=Fi(t,n+16),s=o==4294967295||i==65535;if(s){var a=Fi(t,n-12);s=Fi(t,a)==101075792,s&&(i=Fi(t,a+32),o=Fi(t,a+48))}for(var l=e&&e.filter,u=0;u<i;++u){var c=jce(t,o,s),p=c[0],f=c[1],d=c[2],m=c[3],y=c[4],g=c[5],b=Gce(t,g);o=y,(!l||l({name:m,size:f,originalSize:d,compression:p}))&&(p?p==8?r[m]=G1(t.subarray(b,b+f),new xr(d)):Ge(14,"unknown compression type "+p):r[m]=Ou(t,b,b+f))}return r}var cce,A9e,xr,Ds,k1,F1,R1,xI,hce,dce,E7,vA,mce,yce,b7,bI,Ch,tn,Du,Eh,tn,tn,tn,tn,D1,tn,gce,vce,xce,bce,mA,Lu,yA,wI,Ou,L9e,_ce,Ge,SI,sf,A1,gA,xA,_7,L1,bA,w7,wce,Th,Sce,Ice,N1,M7,Ag,II,pce,dA,D9e,Pce,B1,z1,Cce,Tce,Ece,Mce,dm,A7,V1,ku,U1,la,Fi,x7,an,L7,D7,Ace,O7,k7,Lce,af,Dce,Ga,R7,S7,O9e,_A,kce,P7,F9e,SA,Rce,Bce,N9e,B7,fce,T7,zce,Vce,V9e,U9e,Uce,Gce,jce,$ce,fm,O1,V7,_I,G9e,j9e,$9e,qce,W9e,Z9e,X9e,PA,G7=h(()=>{cce={},A9e=function(t,e,r,n,i){var o=new Worker(cce[e]||(cce[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return o.onmessage=function(s){var a=s.data,l=a.$e$;if(l){var u=new Error(l[0]);u.code=l[1],u.stack=l[2],i(u,null)}else i(null,a)},o.postMessage(r,n),o},xr=Uint8Array,Ds=Uint16Array,k1=Uint32Array,F1=new xr([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),R1=new xr([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),xI=new xr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),hce=function(t,e){for(var r=new Ds(31),n=0;n<31;++n)r[n]=e+=1<<t[n-1];for(var i=new k1(r[30]),n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)i[o]=o-r[n]<<5|n;return[r,i]},dce=hce(F1,2),E7=dce[0],vA=dce[1];E7[28]=258,vA[258]=28;mce=hce(R1,0),yce=mce[0],b7=mce[1],bI=new Ds(32768);for(tn=0;tn<32768;++tn)Ch=(tn&43690)>>>1|(tn&21845)<<1,Ch=(Ch&52428)>>>2|(Ch&13107)<<2,Ch=(Ch&61680)>>>4|(Ch&3855)<<4,bI[tn]=((Ch&65280)>>>8|(Ch&255)<<8)>>>1;Du=function(t,e,r){for(var n=t.length,i=0,o=new Ds(e);i<n;++i)t[i]&&++o[t[i]-1];var s=new Ds(e);for(i=0;i<e;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(r){a=new Ds(1<<e);var l=15-e;for(i=0;i<n;++i)if(t[i])for(var u=i<<4|t[i],c=e-t[i],p=s[t[i]-1]++<<c,f=p|(1<<c)-1;p<=f;++p)a[bI[p]>>>l]=u}else for(a=new Ds(n),i=0;i<n;++i)t[i]&&(a[i]=bI[s[t[i]-1]++]>>>15-t[i]);return a},Eh=new xr(288);for(tn=0;tn<144;++tn)Eh[tn]=8;for(tn=144;tn<256;++tn)Eh[tn]=9;for(tn=256;tn<280;++tn)Eh[tn]=7;for(tn=280;tn<288;++tn)Eh[tn]=8;D1=new xr(32);for(tn=0;tn<32;++tn)D1[tn]=5;gce=Du(Eh,9,0),vce=Du(Eh,9,1),xce=Du(D1,5,0),bce=Du(D1,5,1),mA=function(t){for(var e=t[0],r=1;r<t.length;++r)t[r]>e&&(e=t[r]);return e},Lu=function(t,e,r){var n=e/8|0;return(t[n]|t[n+1]<<8)>>(e&7)&r},yA=function(t,e){var r=e/8|0;return(t[r]|t[r+1]<<8|t[r+2]<<16)>>(e&7)},wI=function(t){return(t+7)/8|0},Ou=function(t,e,r){(e==null||e<0)&&(e=0),(r==null||r>t.length)&&(r=t.length);var n=new(t.BYTES_PER_ELEMENT==2?Ds:t.BYTES_PER_ELEMENT==4?k1:xr)(r-e);return n.set(t.subarray(e,r)),n},L9e={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14},_ce=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Ge=function(t,e,r){var n=new Error(e||_ce[t]);if(n.code=t,Error.captureStackTrace&&Error.captureStackTrace(n,Ge),!r)throw n;return n},SI=function(t,e,r){var n=t.length;if(!n||r&&r.f&&!r.l)return e||new xr(0);var i=!e||r,o=!r||r.i;r||(r={}),e||(e=new xr(n*3));var s=function(Zr){var Tr=e.length;if(Zr>Tr){var nn=new xr(Math.max(Tr*2,Zr));nn.set(e),e=nn}},a=r.f||0,l=r.p||0,u=r.b||0,c=r.l,p=r.d,f=r.m,d=r.n,m=n*8;do{if(!c){a=Lu(t,l,1);var y=Lu(t,l+1,3);if(l+=3,y)if(y==1)c=vce,p=bce,f=9,d=5;else if(y==2){var S=Lu(t,l,31)+257,I=Lu(t,l+10,15)+4,P=S+Lu(t,l+5,31)+1;l+=14;for(var T=new xr(P),M=new xr(19),E=0;E<I;++E)M[xI[E]]=Lu(t,l+E*3,7);l+=I*3;for(var D=mA(M),B=(1<<D)-1,$=Du(M,D,1),E=0;E<P;){var U=$[Lu(t,l,B)];l+=U&15;var g=U>>>4;if(g<16)T[E++]=g;else{var Y=0,G=0;for(g==16?(G=3+Lu(t,l,3),l+=2,Y=T[E-1]):g==17?(G=3+Lu(t,l,7),l+=3):g==18&&(G=11+Lu(t,l,127),l+=7);G--;)T[E++]=Y}}var ne=T.subarray(0,S),le=T.subarray(S);f=mA(ne),d=mA(le),c=Du(ne,f,1),p=Du(le,d,1)}else Ge(1);else{var g=wI(l)+4,b=t[g-4]|t[g-3]<<8,w=g+b;if(w>n){o&&Ge(0);break}i&&s(u+b),e.set(t.subarray(g,w),u),r.b=u+=b,r.p=l=w*8,r.f=a;continue}if(l>m){o&&Ge(0);break}}i&&s(u+131072);for(var se=(1<<f)-1,X=(1<<d)-1,ee=l;;ee=l){var Y=c[yA(t,l)&se],Ee=Y>>>4;if(l+=Y&15,l>m){o&&Ge(0);break}if(Y||Ge(2),Ee<256)e[u++]=Ee;else if(Ee==256){ee=l,c=null;break}else{var je=Ee-254;if(Ee>264){var E=Ee-257,Le=F1[E];je=Lu(t,l,(1<<Le)-1)+E7[E],l+=Le}var He=p[yA(t,l)&X],xe=He>>>4;He||Ge(3),l+=He&15;var le=yce[xe];if(xe>3){var Le=R1[xe];le+=yA(t,l)&(1<<Le)-1,l+=Le}if(l>m){o&&Ge(0);break}i&&s(u+131072);for(var Pe=u+je;u<Pe;u+=4)e[u]=e[u-le],e[u+1]=e[u+1-le],e[u+2]=e[u+2-le],e[u+3]=e[u+3-le];u=Pe}}r.l=c,r.p=ee,r.b=u,r.f=a,c&&(a=1,r.m=f,r.d=p,r.n=d)}while(!a);return u==e.length?e:Ou(e,0,u)},sf=function(t,e,r){r<<=e&7;var n=e/8|0;t[n]|=r,t[n+1]|=r>>>8},A1=function(t,e,r){r<<=e&7;var n=e/8|0;t[n]|=r,t[n+1]|=r>>>8,t[n+2]|=r>>>16},gA=function(t,e){for(var r=[],n=0;n<t.length;++n)t[n]&&r.push({s:n,f:t[n]});var i=r.length,o=r.slice();if(!i)return[Th,0];if(i==1){var s=new xr(r[0].s+1);return s[r[0].s]=1,[s,1]}r.sort(function(P,T){return P.f-T.f}),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,c=1,p=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=i-1;)a=r[r[u].f<r[p].f?u++:p++],l=r[u!=c&&r[u].f<r[p].f?u++:p++],r[c++]={s:-1,f:a.f+l.f,l:a,r:l};for(var f=o[0].s,n=1;n<i;++n)o[n].s>f&&(f=o[n].s);var d=new Ds(f+1),m=xA(r[c-1],d,0);if(m>e){var n=0,y=0,g=m-e,b=1<<g;for(o.sort(function(T,M){return d[M.s]-d[T.s]||T.f-M.f});n<i;++n){var w=o[n].s;if(d[w]>e)y+=b-(1<<m-d[w]),d[w]=e;else break}for(y>>>=g;y>0;){var S=o[n].s;d[S]<e?y-=1<<e-d[S]++-1:++n}for(;n>=0&&y;--n){var I=o[n].s;d[I]==e&&(--d[I],++y)}m=e}return[new xr(d),m]},xA=function(t,e,r){return t.s==-1?Math.max(xA(t.l,e,r+1),xA(t.r,e,r+1)):e[t.s]=r},_7=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new Ds(++e),n=0,i=t[0],o=1,s=function(l){r[n++]=l},a=1;a<=e;++a)if(t[a]==i&&a!=e)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=t[a]}return[r.subarray(0,n),e]},L1=function(t,e){for(var r=0,n=0;n<e.length;++n)r+=t[n]*e[n];return r},bA=function(t,e,r){var n=r.length,i=wI(e+2);t[i]=n&255,t[i+1]=n>>>8,t[i+2]=t[i]^255,t[i+3]=t[i+1]^255;for(var o=0;o<n;++o)t[i+o+4]=r[o];return(i+4+n)*8},w7=function(t,e,r,n,i,o,s,a,l,u,c){sf(e,c++,r),++i[256];for(var p=gA(i,15),f=p[0],d=p[1],m=gA(o,15),y=m[0],g=m[1],b=_7(f),w=b[0],S=b[1],I=_7(y),P=I[0],T=I[1],M=new Ds(19),E=0;E<w.length;++E)M[w[E]&31]++;for(var E=0;E<P.length;++E)M[P[E]&31]++;for(var D=gA(M,7),B=D[0],$=D[1],U=19;U>4&&!B[xI[U-1]];--U);var Y=u+5<<3,G=L1(i,Eh)+L1(o,D1)+s,ne=L1(i,f)+L1(o,y)+s+14+3*U+L1(M,B)+(2*M[16]+3*M[17]+7*M[18]);if(Y<=G&&Y<=ne)return bA(e,c,t.subarray(l,l+u));var le,se,X,ee;if(sf(e,c,1+(ne<G)),c+=2,ne<G){le=Du(f,d,0),se=f,X=Du(y,g,0),ee=y;var Ee=Du(B,$,0);sf(e,c,S-257),sf(e,c+5,T-1),sf(e,c+10,U-4),c+=14;for(var E=0;E<U;++E)sf(e,c+3*E,B[xI[E]]);c+=3*U;for(var je=[w,P],Le=0;Le<2;++Le)for(var He=je[Le],E=0;E<He.length;++E){var xe=He[E]&31;sf(e,c,Ee[xe]),c+=B[xe],xe>15&&(sf(e,c,He[E]>>>5&127),c+=He[E]>>>12)}}else le=gce,se=Eh,X=xce,ee=D1;for(var E=0;E<a;++E)if(n[E]>255){var xe=n[E]>>>18&31;A1(e,c,le[xe+257]),c+=se[xe+257],xe>7&&(sf(e,c,n[E]>>>23&31),c+=F1[xe]);var Pe=n[E]&31;A1(e,c,X[Pe]),c+=ee[Pe],Pe>3&&(A1(e,c,n[E]>>>5&8191),c+=R1[Pe])}else A1(e,c,le[n[E]]),c+=se[n[E]];return A1(e,c,le[256]),c+se[256]},wce=new k1([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Th=new xr(0),Sce=function(t,e,r,n,i,o){var s=t.length,a=new xr(n+s+5*(1+Math.ceil(s/7e3))+i),l=a.subarray(n,a.length-i),u=0;if(!e||s<8)for(var c=0;c<=s;c+=65535){var p=c+65535;p>=s&&(l[u>>3]=o),u=bA(l,u+1,t.subarray(c,p))}else{for(var f=wce[e-1],d=f>>>13,m=f&8191,y=(1<<r)-1,g=new Ds(32768),b=new Ds(y+1),w=Math.ceil(r/3),S=2*w,I=function(he){return(t[he]^t[he+1]<<w^t[he+2]<<S)&y},P=new k1(25e3),T=new Ds(288),M=new Ds(32),E=0,D=0,c=0,B=0,$=0,U=0;c<s;++c){var Y=I(c),G=c&32767,ne=b[Y];if(g[G]=ne,b[Y]=G,$<=c){var le=s-c;if((E>7e3||B>24576)&&le>423){u=w7(t,l,0,P,T,M,D,B,U,c-U,u),B=E=D=0,U=c;for(var se=0;se<286;++se)T[se]=0;for(var se=0;se<30;++se)M[se]=0}var X=2,ee=0,Ee=m,je=G-ne&32767;if(le>2&&Y==I(c-je))for(var Le=Math.min(d,le)-1,He=Math.min(32767,c),xe=Math.min(258,le);je<=He&&--Ee&&G!=ne;){if(t[c+X]==t[c+X-je]){for(var Pe=0;Pe<xe&&t[c+Pe]==t[c+Pe-je];++Pe);if(Pe>X){if(X=Pe,ee=je,Pe>Le)break;for(var Zr=Math.min(je,Pe-2),Tr=0,se=0;se<Zr;++se){var nn=c-je+se+32768&32767,L=g[nn],ue=nn-L+32768&32767;ue>Tr&&(Tr=ue,ne=nn)}}}G=ne,ne=g[G],je+=G-ne+32768&32767}if(ee){P[B++]=268435456|vA[X]<<18|b7[ee];var k=vA[X]&31,be=b7[ee]&31;D+=F1[k]+R1[be],++T[257+k],++M[be],$=c+X,++E}else P[B++]=t[c],++T[t[c]]}}u=w7(t,l,o,P,T,M,D,B,U,c-U,u),!o&&u&7&&(u=bA(l,u+1,Th))}return Ou(a,0,n+wI(u)+i)},Ice=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var r=e,n=9;--n;)r=(r&1&&-306674912)^r>>>1;t[e]=r}return t}(),N1=function(){var t=-1;return{p:function(e){for(var r=t,n=0;n<e.length;++n)r=Ice[r&255^e[n]]^r>>>8;t=r},d:function(){return~t}}},M7=function(){var t=1,e=0;return{p:function(r){for(var n=t,i=e,o=r.length|0,s=0;s!=o;){for(var a=Math.min(s+2655,o);s<a;++s)i+=n+=r[s];n=(n&65535)+15*(n>>16),i=(i&65535)+15*(i>>16)}t=n,e=i},d:function(){return t%=65521,e%=65521,(t&255)<<24|t>>>8<<16|(e&255)<<8|e>>>8}}},Ag=function(t,e,r,n,i){return Sce(t,e.level==null?6:e.level,e.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):12+e.mem,r,n,!i)},II=function(t,e){var r={};for(var n in t)r[n]=t[n];for(var n in e)r[n]=e[n];return r},pce=function(t,e,r){for(var n=t(),i=t.toString(),o=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),s=0;s<n.length;++s){var a=n[s],l=o[s];if(typeof a=="function"){e+=";"+l+"=";var u=a.toString();if(a.prototype)if(u.indexOf("[native code]")!=-1){var c=u.indexOf(" ",8)+1;e+=u.slice(c,u.indexOf("(",c))}else{e+=u;for(var p in a.prototype)e+=";"+l+".prototype."+p+"="+a.prototype[p].toString()}else e+=u}else r[l]=a}return[e,r]},dA=[],D9e=function(t){var e=[];for(var r in t)t[r].buffer&&e.push((t[r]=new t[r].constructor(t[r])).buffer);return e},Pce=function(t,e,r,n){var i;if(!dA[r]){for(var o="",s={},a=t.length-1,l=0;l<a;++l)i=pce(t[l],o,s),o=i[0],s=i[1];dA[r]=pce(t[a],o,s)}var u=II({},dA[r][1]);return A9e(dA[r][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",r,u,D9e(u),n)},B1=function(){return[xr,Ds,k1,F1,R1,xI,E7,yce,vce,bce,bI,_ce,Du,mA,Lu,yA,wI,Ou,Ge,SI,G1,dm,A7]},z1=function(){return[xr,Ds,k1,F1,R1,xI,vA,b7,gce,Eh,xce,D1,bI,wce,Th,Du,sf,A1,gA,xA,_7,L1,bA,w7,wI,Ou,Sce,Ag,PI,dm]},Cce=function(){return[L7,O7,an,N1,Ice]},Tce=function(){return[D7,Ace]},Ece=function(){return[k7,an,M7]},Mce=function(){return[Lce]},dm=function(t){return postMessage(t,[t.buffer])},A7=function(t){return t&&t.size&&new xr(t.size)},V1=function(t,e,r,n,i,o){var s=Pce(r,n,i,function(a,l){s.terminate(),o(a,l)});return s.postMessage([t,e],e.consume?[t.buffer]:[]),function(){s.terminate()}},ku=function(t){return t.ondata=function(e,r){return postMessage([e,r],[e.buffer])},function(e){return t.push(e.data[0],e.data[1])}},U1=function(t,e,r,n,i){var o,s=Pce(t,n,i,function(a,l){a?(s.terminate(),e.ondata.call(e,a)):(l[1]&&s.terminate(),e.ondata.call(e,a,l[0],l[1]))});s.postMessage(r),e.push=function(a,l){e.ondata||Ge(5),o&&e.ondata(Ge(4,0,1),null,!!l),s.postMessage([a,o=l],[a.buffer])},e.terminate=function(){s.terminate()}},la=function(t,e){return t[e]|t[e+1]<<8},Fi=function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0},x7=function(t,e){return Fi(t,e)+Fi(t,e+4)*4294967296},an=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8},L7=function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:e.level==9?2:0,t[9]=3,e.mtime!=0&&an(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var n=0;n<=r.length;++n)t[n+10]=r.charCodeAt(n)}},D7=function(t){(t[0]!=31||t[1]!=139||t[2]!=8)&&Ge(6,"invalid gzip data");var e=t[3],r=10;e&4&&(r+=t[10]|(t[11]<<8)+2);for(var n=(e>>3&1)+(e>>4&1);n>0;n-=!t[r++]);return r+(e&2)},Ace=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},O7=function(t){return 10+(t.filename&&t.filename.length+1||0)},k7=function(t,e){var r=e.level,n=r==0?0:r<6?1:r==9?3:2;t[0]=120,t[1]=n<<6|(n?32-2*n:1)},Lce=function(t){((t[0]&15)!=8||t[0]>>>4>7||(t[0]<<8|t[1])%31)&&Ge(6,"invalid zlib data"),t[1]&32&&Ge(6,"invalid zlib data: preset dictionaries not supported")};af=function(){function t(e,r){!r&&typeof e=="function"&&(r=e,e={}),this.ondata=r,this.o=e||{}}return t.prototype.p=function(e,r){this.ondata(Ag(e,this.o,0,0,!r),r)},t.prototype.push=function(e,r){this.ondata||Ge(5),this.d&&Ge(4),this.d=r,this.p(e,r||!1)},t}(),Dce=function(){function t(e,r){U1([z1,function(){return[ku,af]}],this,F7.call(this,e,r),function(n){var i=new af(n.data);onmessage=ku(i)},6)}return t}();Ga=function(){function t(e){this.s={},this.p=new xr(0),this.ondata=e}return t.prototype.e=function(e){this.ondata||Ge(5),this.d&&Ge(4);var r=this.p.length,n=new xr(r+e.length);n.set(this.p),n.set(e,r),this.p=n},t.prototype.c=function(e){this.d=this.s.i=e||!1;var r=this.s.b,n=SI(this.p,this.o,this.s);this.ondata(Ou(n,r,this.s.b),this.d),this.o=Ou(n,this.s.b-32768),this.s.b=this.o.length,this.p=Ou(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(e,r){this.e(e),this.c(r)},t}(),R7=function(){function t(e){this.ondata=e,U1([B1,function(){return[ku,Ga]}],this,0,function(){var r=new Ga;onmessage=ku(r)},7)}return t}();S7=function(){function t(e,r){this.c=N1(),this.l=0,this.v=1,af.call(this,e,r)}return t.prototype.push=function(e,r){af.prototype.push.call(this,e,r)},t.prototype.p=function(e,r){this.c.p(e),this.l+=e.length;var n=Ag(e,this.o,this.v&&O7(this.o),r&&8,!r);this.v&&(L7(n,this.o),this.v=0),r&&(an(n,n.length-8,this.c.d()),an(n,n.length-4,this.l)),this.ondata(n,r)},t}(),O9e=function(){function t(e,r){U1([z1,Cce,function(){return[ku,af,S7]}],this,F7.call(this,e,r),function(n){var i=new S7(n.data);onmessage=ku(i)},8)}return t}();_A=function(){function t(e){this.v=1,Ga.call(this,e)}return t.prototype.push=function(e,r){if(Ga.prototype.e.call(this,e),this.v){var n=this.p.length>3?D7(this.p):4;if(n>=this.p.length&&!r)return;this.p=this.p.subarray(n),this.v=0}r&&(this.p.length<8&&Ge(6,"invalid gzip data"),this.p=this.p.subarray(0,-8)),Ga.prototype.c.call(this,r)},t}(),kce=function(){function t(e){this.ondata=e,U1([B1,Tce,function(){return[ku,Ga,_A]}],this,0,function(){var r=new _A;onmessage=ku(r)},9)}return t}();P7=function(){function t(e,r){this.c=M7(),this.v=1,af.call(this,e,r)}return t.prototype.push=function(e,r){af.prototype.push.call(this,e,r)},t.prototype.p=function(e,r){this.c.p(e);var n=Ag(e,this.o,this.v&&2,r&&4,!r);this.v&&(k7(n,this.o),this.v=0),r&&an(n,n.length-4,this.c.d()),this.ondata(n,r)},t}(),F9e=function(){function t(e,r){U1([z1,Ece,function(){return[ku,af,P7]}],this,F7.call(this,e,r),function(n){var i=new P7(n.data);onmessage=ku(i)},10)}return t}();SA=function(){function t(e){this.v=1,Ga.call(this,e)}return t.prototype.push=function(e,r){if(Ga.prototype.e.call(this,e),this.v){if(this.p.length<2&&!r)return;this.p=this.p.subarray(2),this.v=0}r&&(this.p.length<4&&Ge(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),Ga.prototype.c.call(this,r)},t}(),Rce=function(){function t(e){this.ondata=e,U1([B1,Mce,function(){return[ku,Ga,SA]}],this,0,function(){var r=new SA;onmessage=ku(r)},11)}return t}();Bce=function(){function t(e){this.G=_A,this.I=Ga,this.Z=SA,this.ondata=e}return t.prototype.push=function(e,r){if(this.ondata||Ge(5),this.s)this.s.push(e,r);else{if(this.p&&this.p.length){var n=new xr(this.p.length+e.length);n.set(this.p),n.set(e,this.p.length)}else this.p=e;if(this.p.length>2){var i=this,o=function(){i.ondata.apply(i,arguments)};this.s=this.p[0]==31&&this.p[1]==139&&this.p[2]==8?new this.G(o):(this.p[0]&15)!=8||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(o):new this.Z(o),this.s.push(this.p,r),this.p=null}}},t}(),N9e=function(){function t(e){this.G=kce,this.I=R7,this.Z=Rce,this.ondata=e}return t.prototype.push=function(e,r){Bce.prototype.push.call(this,e,r)},t}();B7=function(t,e,r,n){for(var i in t){var o=t[i],s=e+i,a=n;Array.isArray(o)&&(a=II(n,o[1]),o=o[0]),o instanceof xr?r[s]=[o,a]:(r[s+="/"]=[new xr(0),a],B7(o,s,r,n))}},fce=typeof TextEncoder<"u"&&new TextEncoder,T7=typeof TextDecoder<"u"&&new TextDecoder,zce=0;try{T7.decode(Th,{stream:!0}),zce=1}catch{}Vce=function(t){for(var e="",r=0;;){var n=t[r++],i=(n>127)+(n>223)+(n>239);if(r+i>t.length)return[e,Ou(t,r-1)];i?i==3?(n=((n&15)<<18|(t[r++]&63)<<12|(t[r++]&63)<<6|t[r++]&63)-65536,e+=String.fromCharCode(55296|n>>10,56320|n&1023)):i&1?e+=String.fromCharCode((n&31)<<6|t[r++]&63):e+=String.fromCharCode((n&15)<<12|(t[r++]&63)<<6|t[r++]&63):e+=String.fromCharCode(n)}},V9e=function(){function t(e){this.ondata=e,zce?this.t=new TextDecoder:this.p=Th}return t.prototype.push=function(e,r){if(this.ondata||Ge(5),r=!!r,this.t){this.ondata(this.t.decode(e,{stream:!0}),r),r&&(this.t.decode().length&&Ge(8),this.t=null);return}this.p||Ge(4);var n=new xr(this.p.length+e.length);n.set(this.p),n.set(e,this.p.length);var i=Vce(n),o=i[0],s=i[1];r?(s.length&&Ge(8),this.p=null):this.p=s,this.ondata(o,r)},t}(),U9e=function(){function t(e){this.ondata=e}return t.prototype.push=function(e,r){this.ondata||Ge(5),this.d&&Ge(4),this.ondata(hm(e),this.d=r||!1)},t}();Uce=function(t){return t==1?3:t<6?2:t==9?1:0},Gce=function(t,e){return e+30+la(t,e+26)+la(t,e+28)},jce=function(t,e,r){var n=la(t,e+28),i=z7(t.subarray(e+46,e+46+n),!(la(t,e+8)&2048)),o=e+46+n,s=Fi(t,e+20),a=r&&s==4294967295?$ce(t,o):[s,Fi(t,e+24),Fi(t,e+42)],l=a[0],u=a[1],c=a[2];return[la(t,e+10),l,u,i,o+la(t,e+30)+la(t,e+32),c]},$ce=function(t,e){for(;la(t,e)!=1;e+=4+la(t,e+2));return[x7(t,e+12),x7(t,e+4),x7(t,e+20)]},fm=function(t){var e=0;if(t)for(var r in t){var n=t[r].length;n>65535&&Ge(9),e+=n+4}return e},O1=function(t,e,r,n,i,o,s,a){var l=n.length,u=r.extra,c=a&&a.length,p=fm(u);an(t,e,s!=null?33639248:67324752),e+=4,s!=null&&(t[e++]=20,t[e++]=r.os),t[e]=20,e+=2,t[e++]=r.flag<<1|(o<0&&8),t[e++]=i&&8,t[e++]=r.compression&255,t[e++]=r.compression>>8;var f=new Date(r.mtime==null?Date.now():r.mtime),d=f.getFullYear()-1980;if((d<0||d>119)&&Ge(10),an(t,e,d<<25|f.getMonth()+1<<21|f.getDate()<<16|f.getHours()<<11|f.getMinutes()<<5|f.getSeconds()>>>1),e+=4,o!=-1&&(an(t,e,r.crc),an(t,e+4,o<0?-o-2:o),an(t,e+8,r.size)),an(t,e+12,l),an(t,e+14,p),e+=16,s!=null&&(an(t,e,c),an(t,e+6,r.attrs),an(t,e+10,s),e+=14),t.set(n,e),e+=l,p)for(var m in u){var y=u[m],g=y.length;an(t,e,+m),an(t,e+2,g),t.set(y,e+4),e+=4+g}return c&&(t.set(a,e),e+=c),e},V7=function(t,e,r,n,i){an(t,e,101010256),an(t,e+8,r),an(t,e+10,r),an(t,e+12,n),an(t,e+16,i)},_I=function(){function t(e){this.filename=e,this.c=N1(),this.size=0,this.compression=0}return t.prototype.process=function(e,r){this.ondata(null,e,r)},t.prototype.push=function(e,r){this.ondata||Ge(5),this.c.p(e),this.size+=e.length,r&&(this.crc=this.c.d()),this.process(e,r||!1)},t}(),G9e=function(){function t(e,r){var n=this;r||(r={}),_I.call(this,e),this.d=new af(r,function(i,o){n.ondata(null,i,o)}),this.compression=8,this.flag=Uce(r.level)}return t.prototype.process=function(e,r){try{this.d.push(e,r)}catch(n){this.ondata(n,null,r)}},t.prototype.push=function(e,r){_I.prototype.push.call(this,e,r)},t}(),j9e=function(){function t(e,r){var n=this;r||(r={}),_I.call(this,e),this.d=new Dce(r,function(i,o,s){n.ondata(i,o,s)}),this.compression=8,this.flag=Uce(r.level),this.terminate=this.d.terminate}return t.prototype.process=function(e,r){this.d.push(e,r)},t.prototype.push=function(e,r){_I.prototype.push.call(this,e,r)},t}(),$9e=function(){function t(e){this.ondata=e,this.u=[],this.d=1}return t.prototype.add=function(e){var r=this;if(this.ondata||Ge(5),this.d&2)this.ondata(Ge(4+(this.d&1)*8,0,1),null,!1);else{var n=hm(e.filename),i=n.length,o=e.comment,s=o&&hm(o),a=i!=e.filename.length||s&&o.length!=s.length,l=i+fm(e.extra)+30;i>65535&&this.ondata(Ge(11,0,1),null,!1);var u=new xr(l);O1(u,0,e,n,a,-1);var c=[u],p=function(){for(var g=0,b=c;g<b.length;g++){var w=b[g];r.ondata(null,w,!1)}c=[]},f=this.d;this.d=0;var d=this.u.length,m=II(e,{f:n,u:a,o:s,t:function(){e.terminate&&e.terminate()},r:function(){if(p(),f){var g=r.u[d+1];g?g.r():r.d=1}f=1}}),y=0;e.ondata=function(g,b,w){if(g)r.ondata(g,b,w),r.terminate();else if(y+=b.length,c.push(b),w){var S=new xr(16);an(S,0,134695760),an(S,4,e.crc),an(S,8,y),an(S,12,e.size),c.push(S),m.c=y,m.b=l+y+16,m.crc=e.crc,m.size=e.size,f&&m.r(),f=1}else f&&p()},this.u.push(m)}},t.prototype.end=function(){var e=this;if(this.d&2){this.ondata(Ge(4+(this.d&1)*8,0,1),null,!0);return}this.d?this.e():this.u.push({r:function(){e.d&1&&(e.u.splice(-1,1),e.e())},t:function(){}}),this.d=3},t.prototype.e=function(){for(var e=0,r=0,n=0,i=0,o=this.u;i<o.length;i++){var s=o[i];n+=46+s.f.length+fm(s.extra)+(s.o?s.o.length:0)}for(var a=new xr(n+22),l=0,u=this.u;l<u.length;l++){var s=u[l];O1(a,e,s,s.f,s.u,-s.c-2,r,s.o),e+=46+s.f.length+fm(s.extra)+(s.o?s.o.length:0),r+=s.b}V7(a,e,this.u.length,n,r),this.ondata(null,a,!0),this.d=2},t.prototype.terminate=function(){for(var e=0,r=this.u;e<r.length;e++){var n=r[e];n.t()}this.d=2},t}();qce=function(){function t(){}return t.prototype.push=function(e,r){this.ondata(null,e,r)},t.compression=0,t}(),W9e=function(){function t(){var e=this;this.i=new Ga(function(r,n){e.ondata(null,r,n)})}return t.prototype.push=function(e,r){try{this.i.push(e,r)}catch(n){this.ondata(n,null,r)}},t.compression=8,t}(),Z9e=function(){function t(e,r){var n=this;r<32e4?this.i=new Ga(function(i,o){n.ondata(null,i,o)}):(this.i=new R7(function(i,o,s){n.ondata(i,o,s)}),this.terminate=this.i.terminate)}return t.prototype.push=function(e,r){this.i.terminate&&(e=Ou(e,0)),this.i.push(e,r)},t.compression=8,t}(),X9e=function(){function t(e){this.onfile=e,this.k=[],this.o={0:qce},this.p=Th}return t.prototype.push=function(e,r){var n=this;if(this.onfile||Ge(5),this.p||Ge(4),this.c>0){var i=Math.min(this.c,e.length),o=e.subarray(0,i);if(this.c-=i,this.d?this.d.push(o,!this.c):this.k[0].push(o),e=e.subarray(i),e.length)return this.push(e,r)}else{var s=0,a=0,l=void 0,u=void 0;this.p.length?e.length?(u=new xr(this.p.length+e.length),u.set(this.p),u.set(e,this.p.length)):u=this.p:u=e;for(var c=u.length,p=this.c,f=p&&this.d,d=function(){var b,w=Fi(u,a);if(w==67324752){s=1,l=a,m.d=null,m.c=0;var S=la(u,a+6),I=la(u,a+8),P=S&2048,T=S&8,M=la(u,a+26),E=la(u,a+28);if(c>a+30+M+E){var D=[];m.k.unshift(D),s=2;var B=Fi(u,a+18),$=Fi(u,a+22),U=z7(u.subarray(a+30,a+=30+M),!P);B==4294967295?(b=T?[-2]:$ce(u,a),B=b[0],$=b[1]):T&&(B=-1),a+=E,m.c=B;var Y,G={name:U,compression:I,start:function(){if(G.ondata||Ge(5),!B)G.ondata(null,Th,!0);else{var ne=n.o[I];ne||G.ondata(Ge(14,"unknown compression type "+I,1),null,!1),Y=B<0?new ne(U):new ne(U,B,$),Y.ondata=function(ee,Ee,je){G.ondata(ee,Ee,je)};for(var le=0,se=D;le<se.length;le++){var X=se[le];Y.push(X,!1)}n.k[0]==D&&n.c?n.d=Y:Y.push(Th,!0)}},terminate:function(){Y&&Y.terminate&&Y.terminate()}};B>=0&&(G.size=B,G.originalSize=$),m.onfile(G)}return"break"}else if(p){if(w==134695760)return l=a+=12+(p==-2&&8),s=3,m.c=0,"break";if(w==33639248)return l=a-=4,s=3,m.c=0,"break"}},m=this;a<c-4;++a){var y=d();if(y==="break")break}if(this.p=Th,p<0){var g=s?u.subarray(0,l-12-(p==-2&&8)-(Fi(u,l-16)==134695760&&4)):u.subarray(0,a);f?f.push(g,!!s):this.k[+(s==2)].push(g)}if(s&2)return this.push(u.subarray(a),r);this.p=u.subarray(a)}r&&(this.c&&Ge(13),this.p=null)},t.prototype.register=function(e){this.o[e.compression]=e},t}(),PA=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(t){t()}});function Eg(){if(Hce==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return Hce}async function j7(t,{signal:e}){let r=await(await Eg()(t,{signal:e})).arrayBuffer();return new Uint8Array(r)}async function $1(t){let r=(await Promise.resolve().then(()=>(G7(),U7))).unzipSync(t),n={};if(r["enterprise/"]!=null){n.enterprise={};let i=r["enterprise/locations.json"];i&&(n.enterprise.locations=JSON.parse(j1().decode(i)));let o=r["enterprise/locationInstances.json"];o&&(n.enterprise.locationInstances=JSON.parse(j1().decode(o)));let s=r["enterprise/categories.json"];s&&(n.enterprise.categories=JSON.parse(j1().decode(s)))}return r["floorstack.json"]&&(n["floorstack.json"]=JSON.parse(j1().decode(r["floorstack.json"]))),r["floor.geojson"]&&(n["floor.geojson"]=JSON.parse(j1().decode(r["floor.geojson"]))),r["manifest.json"]&&(n["manifest.geojson"]=JSON.parse(j1().decode(r["manifest.json"]))),n}async function Xce(t,{signal:e}){try{let r=await(await Eg()(t,{signal:e})).arrayBuffer();if(e.aborted)return;let n=new Uint8Array(r);return await $1(n)}catch(r){let n=new Error("downloadLanguagePack failed");throw n.cause=r,n}}function $7(t){let e=new TextDecoder,r=e.decode.bind(e);try{let n={"connection.json":JSON.parse(r(t["connection.json"])),"manifest.geojson":JSON.parse(r(t["manifest.geojson"])),"map.geojson":t["map.geojson"]?JSON.parse(r(t["map.geojson"])):void 0,"mapstack.geojson":t["mapstack.geojson"]?JSON.parse(r(t["mapstack.geojson"])):void 0,"node.geojson":JSON.parse(r(t["node.geojson"])),obstruction:{},space:{},entrance:{},facade:{},"tileset.json":t["tileset.json"]?JSON.parse(r(t["tileset.json"])):void 0};if(t.enterprise!=null&&(n.enterprise={},t.enterprise?.["locations.json"]&&(n.enterprise.locations=JSON.parse(r(t.enterprise?.["locations.json"]))),t.enterprise?.["categories.json"]&&(n.enterprise.categories=JSON.parse(r(t.enterprise?.["categories.json"]))),t.enterprise?.["venue.json"]&&(n.enterprise.venue=JSON.parse(r(t.enterprise?.["venue.json"]))),t.enterprise?.["layers.json"]&&(n.enterprise.layers=JSON.parse(r(t.enterprise?.["layers.json"]))),t.enterprise?.["locationInstances.json"]&&(n.enterprise.locationInstances=JSON.parse(r(t.enterprise?.["locationInstances.json"]))),t.enterprise?.["enterpriseStyles.json"]&&(n.enterprise.enterpriseStyles=JSON.parse(r(t.enterprise?.["enterpriseStyles.json"]))),t.enterprise?.["textures.json"]&&(n.enterprise.textures=JSON.parse(r(t.enterprise?.["textures.json"]))),t.enterprise?.["floorText.json"]&&(n.enterprise.floorText=JSON.parse(r(t.enterprise?.["floorText.json"]))),t.enterprise?.["categoryPriorities.json"]&&(n.enterprise.categoryPriorities=JSON.parse(r(t.enterprise?.["categoryPriorities.json"])))),t["floorstack.json"]!=null?n["floorstack.json"]=JSON.parse(r(t["floorstack.json"])):t["mapstack.json"]!=null&&(n["mapstack.json"]=JSON.parse(r(t["mapstack.json"]))),n["floorstack.json"]==null&&n["mapstack.json"]==null&&n["mapstack.geojson"]==null)throw new Error("MVF is missing floorstack.json or mapstack.json/mapstack.geojson");if(t["floor.geojson"]&&(n["floor.geojson"]=JSON.parse(r(t["floor.geojson"]))),n["floor.geojson"]==null&&n["map.geojson"]==null)throw new Error("MVF is missing floor.geojson or map.geojson");if("styles.json"in t&&(n["styles.json"]=JSON.parse(r(t["styles.json"]))),"shapes.json"in t&&(n["shapes.json"]=JSON.parse(r(t["shapes.json"]))),"location.json"in t&&(n["location.json"]=JSON.parse(r(t["location.json"]))),"category.json"in t&&(n["category.json"]=JSON.parse(r(t["category.json"]))),t.annotation!=null){n.annotation={};let o=Object.keys(t.annotation);for(let s of o){let a=s.replace(/\.json|\.geojson/g,"");n.annotation[a]=JSON.parse(r(t.annotation[s]))}}let i=Object.keys(t.space);for(let o of i){let s=o.replace(/\.json|\.geojson/g,"");n.space[s]=JSON.parse(r(t.space[o]))}if(t.obstruction!=null){let o=Object.keys(t.obstruction);for(let s of o){let a=s.replace(/\.json|\.geojson/g,"");n.obstruction[a]=JSON.parse(r(t.obstruction[s]))}}else n.obstruction={};if(t.entrance!=null){let o=Object.keys(t.entrance);for(let s of o){let a=s.replace(/\.json|\.geojson/g,"");n.entrance[a]=JSON.parse(r(t.entrance[s]))}}else n.entrance={};if("floorImages"in t&&t.floorImages!=null){n.floorImages={};for(let o of Object.keys(t.floorImages)){let s=o.replace(/\.json|\.geojson/g,"");n.floorImages[s]=JSON.parse(r(t.floorImages[o]))}}if("textAreas"in t&&t.textAreas!=null){n.textAreas={};for(let o of Object.keys(t.textAreas)){let s=o.replace(/\.json|\.geojson/g,"");n.textAreas[s]=JSON.parse(r(t.textAreas[o]))}}if("facade"in t&&t.facade!=null){n.facade={};for(let o of Object.keys(t.facade)){let s=o.replace(/\.json|\.geojson/g,"");n.facade[s]=JSON.parse(r(t.facade[o]))}}if("area"in t&&t.area!=null){n.area={};for(let o of Object.keys(t.area)){let s=o.replace(/\.json|\.geojson/g,"");n.area[s]=JSON.parse(r(t.area[o]))}}return n}catch(n){throw we.error(n),new Error("MVF parsing failed! Probably encountered a bad file.")}}function J9e(t){if(t==null||typeof t!="object")return!1;let e=["connection.json","manifest.geojson","floor.geojson"in t?"floor.geojson":"map.geojson","node.geojson","floorstack.json"in t?"floorstack.json":"mapstack.json"in t?"mapstack.json":"mapstack.geojson"];"styles.json"in t&&e.push("styles.json"),"shapes.json"in t&&e.push("shapes.json");for(let r of e)if(t[r]==null||t[r][Symbol.toStringTag]!=="Uint8Array")return!1;return!0}async function q7(t){return new Promise(async(e,r)=>{try{if(t==null||typeof t!="object")throw new Error("Error parsing data! Unzipping failed.");if(t[Symbol.toStringTag]!=="Uint8Array")throw new Error("Unexpected file type! Unzipping failed.");let i=(await Promise.resolve().then(()=>(G7(),U7))).unzipSync(t);if(!J9e(i))throw new Error("MVF is missing some expect static files. Unzipping failed.");let o={},s=Object.keys(i);for(let a of s){if(i[a].length===0)continue;let l=a.split("/");if(l.length<0)throw new Error("Encounted a file with no name! Unzipping failed.");if(l.length>2)throw new Error("Encountered unexpected nesting in MVF! Unzipping failed.");if(l.length===1){o[l[0]]=i[a];continue}if(l[0]==="image"){we.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}else o[l[0]]==null&&(o[l[0]]={}),o[l[0]][l[1]]=i[a]}e(o)}catch(n){r(n)}})}function q1(){let t="us",e={};function r(){return rze(ize(t),e)}return{updateByUserOption(n){n.environment&&(t=n.environment),n.baseUri&&(e.baseUri=n.baseUri),n.baseAuthUri&&(e.baseAuthUri=n.baseAuthUri),n.analytics?.baseUri&&(e.analyticsBaseUri=n.analytics?.baseUri)},updateTileServerBaseUrl(n){e.tileServerUri=n},updateEnvironment(n){t=n},getBaseUri(n){return t==="us"&&n?Wce.baseUri:r().baseUri},getBaseAuthUri(n=!1){return t==="us"&&n?Wce.baseAuthUri:r().baseAuthUri},getAnalyticsBaseUri(){return r().analyticsBaseUri},getTileServerUri(){return r().tileServerUri},reset(){t="us",e={}},__getState:r}}function rze(t,e){return{...t,...e}}function ize(t){return nze[t]}async function W7(t,e="2.0.0"){switch(e){case"2.0.0":try{let r=await q7(t);return $7(r)}catch{return Zce(t)}case"3.0.0":return Zce(t);default:throw new Error(`Unsupported MVF version: ${e}`)}}var Hce,LYt,j1,Yce,Wce,Q9e,eze,tze,nze,H7,Zce,Mg=h(()=>{"use strict";rce();et();cA();pA();y7();v7();Hce=globalThis.fetch,LYt=process?.env?.npm_package_version;j1=function(){let t;return()=>(t||(t=new TextDecoder),t)}();Yce=Object.freeze({baseUri:"https://app.mappedin.com/",baseAuthUri:"https://app.mappedin.com/",analyticsBaseUri:"https://api-gateway.mappedin.com/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"}),Wce=Object.freeze({...Yce,baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"}),Q9e=Object.freeze({baseUri:"https://api-gateway.eu.mappedin.com/",baseAuthUri:"https://auth.eu.mappedin.com/",analyticsBaseUri:"https://api-gateway.eu.mappedin.com/track-analytics/a/",tileServerUri:"https://tiles-cdn.eu.mappedin.com/styles/mappedin/style.json"}),eze=Object.freeze({baseUri:"https://api-gateway-staging.mappedin.net/",baseAuthUri:"https://auth-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"}),tze=Object.freeze({baseUri:"https://app-staging.mappedin.net/",baseAuthUri:"https://app-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"});nze={eu:Q9e,us:Yce,"us-staging-enterprise":eze,"us-staging-self-serve":tze};H7=t=>{let e=Object.values(t["floorstack.json"]??t["mapstack.json"]??{});return e.length===1?[]:e.filter(r=>r.type!=="Outdoor").map(r=>r.id.replace("fs_","").replace("ms_",""))},Zce=async t=>{let e=performance.now(),r=await d7(t);return we.log(`Parsed MVFv3 in ${performance.now()-e}ms`),r.inspectErr(n=>{throw we.error(n),new Error("MVFv3 parsing failed!")}),r.unwrap()}});function Z7(t){let e=t.enterprise?.locations?.reduce((i,o)=>(i[o.id]=o,i),{})||{};for(let i of t.enterprise?.locationInstances||[])e[i.id]=i;let r={};for(let i of t["floorstack.json"]||[])r[i.id]=i;let n={};for(let i of t["floor.geojson"]?.features||[])i.properties&&i.properties.id&&(n[i.properties.id]=i.properties);return{type:"downloaded",data:t,optimized:{"enterprise-location":e,"enterprise-category":t.enterprise?.categories?.reduce((i,o)=>(i[o.id]=o,i),{})||{},"floor-stack":r,floor:n}}}function Kce(t){return/^https?:\/\/cdn\.mappedin\.com/.test(t)}function Jce(t){return!!t.split("?")[1]?.includes("sv=")}var Qce=h(()=>{"use strict"});var epe=h(()=>{"use strict"});var tpe=h(()=>{"use strict"});var X7=h(()=>{"use strict";p0();Km();MC();G4();c0()});var rpe=h(()=>{"use strict";epe();tpe();Mg();X7()});var npe=h(()=>{"use strict";(function(){typeof globalThis!="object"&&(Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})()});var ipe=h(()=>{"use strict";oo()});var CI=h(()=>{"use strict"});import{BatchedMesh as iKt,Color as oKt,Vector3 as sKt}from"three";var lf=h(()=>{"use strict";ipe();CI()});var Y7=h(()=>{"use strict"});import{Object3D as dKt}from"three";var jc=h(()=>{"use strict";lf();Y7()});import{Object3D as bKt,Vector3 as _Kt}from"three";var Fu=h(()=>{"use strict";Yu()});import{Object3D as CKt}from"three";var ja=h(()=>{"use strict";Yu();jc()});import{Object3D as DKt}from"three";var Ru=h(()=>{"use strict";jc();Fu();ja()});var J7=h(()=>{"use strict"});var Ah=h(()=>{"use strict"});import{Color as GKt,WebGLRenderer as jKt}from"three";var ape=h(()=>{"use strict";Af();J7();Ah()});var CA,Q7=h(()=>{CA={name:"@packages/outdoor-context-v4",version:"6.0.1-beta.49",private:!0,main:"dist/maplibre-gl.js",style:"dist/maplibre-gl.css",license:"BSD-3-Clause",homepage:"https://maplibre.org/",funding:"https://github.com/maplibre/maplibre-gl-js?sponsor=1",bugs:{url:"https://github.com/maplibre/maplibre-gl-js/issues/"},repository:{type:"git",url:"git://github.com/maplibre/maplibre-gl-js.git"},types:"dist/maplibre-gl.d.ts",type:"module",dependencies:{"@mapbox/geojson-rewind":"^0.5.2","@mapbox/jsonlint-lines-primitives":"^2.0.2","@mapbox/point-geometry":"^0.1.0","@mapbox/tiny-sdf":"^2.0.6","@mapbox/unitbezier":"^0.0.1","@mapbox/vector-tile":"^1.3.1","@mapbox/whoots-js":"^3.1.0","@maplibre/maplibre-gl-style-spec":"^20.1.1","@types/geojson":"^7946.0.14","@types/geojson-vt":"3.2.5","@types/junit-report-builder":"^3.0.2","@types/mapbox__point-geometry":"^0.1.4","@types/mapbox__vector-tile":"^1.3.4","@types/pbf":"^3.0.5","@types/supercluster":"^7.1.3",earcut:"^2.2.4","geojson-vt":"^3.2.1","gl-matrix":"^3.4.3","global-prefix":"^3.0.0",kdbush:"^4.0.2","murmurhash-js":"^1.0.0",pbf:"^3.2.1",potpack:"^2.0.0",quickselect:"^2.0.0",supercluster:"^8.0.1",tinyqueue:"^2.0.3","vt-pbf":"^3.1.3"},devDependencies:{"@mapbox/mapbox-gl-rtl-text":"^0.2.3","@mapbox/mvt-fixtures":"^3.10.0","@rollup/plugin-commonjs":"^25.0.7","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-replace":"^5.0.5","@rollup/plugin-strip":"^3.0.4","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-typescript":"^11.1.6","@types/benchmark":"^2.1.5","@types/cssnano":"^5.0.0","@types/d3":"^7.4.3","@types/diff":"^5.2.0","@types/earcut":"^2.1.4","@types/eslint":"^8.56.7","@types/gl":"^6.0.5","@types/glob":"^8.1.0","@types/jest":"^29.5.12","@types/jsdom":"^21.1.6","@types/minimist":"^1.2.5","@types/murmurhash-js":"^1.0.6","@types/nise":"^1.4.4","@types/node":"^20.12.7","@types/offscreencanvas":"^2019.7.3","@types/pixelmatch":"^5.2.6","@types/pngjs":"^6.0.4","@types/react":"^18.2.79","@types/react-dom":"^18.2.25","@types/request":"^2.48.12","@types/shuffle-seed":"^1.1.3","@types/window-or-global":"^1.0.6","@typescript-eslint/eslint-plugin":"^7.7.1","@typescript-eslint/parser":"^7.7.1",address:"^2.0.2",benchmark:"^2.1.4",canvas:"^2.11.2",cssnano:"^6.1.2",d3:"^7.9.0","d3-queue":"^3.0.7","devtools-protocol":"^0.0.1291694",diff:"^5.2.0","dts-bundle-generator":"^9.5.1",eslint:"^8.57.0","eslint-config-mourner":"^3.0.0","eslint-plugin-html":"^8.1.1","eslint-plugin-import":"^2.29.1","eslint-plugin-jest":"^28.2.0","eslint-plugin-react":"^7.34.1","eslint-plugin-tsdoc":"0.2.17",expect:"^29.7.0",glob:"^10.3.12","is-builtin-module":"^3.2.1",jest:"^29.7.0","jest-environment-jsdom":"^29.7.0","jest-junit":"^16.0.0","jest-monocart-coverage":"^1.1.0","jest-webgl-canvas-mock":"^2.5.3",jsdom:"^24.0.0","json-stringify-pretty-compact":"^4.0.0","junit-report-builder":"^3.2.1",minimist:"^1.2.8","mock-geolocation":"^1.0.11","monocart-coverage-reports":"^2.7.9",nise:"^5.1.9","npm-font-open-sans":"^1.1.0","npm-run-all":"^4.1.5","pdf-merger-js":"^5.1.1",pixelmatch:"^5.3.0",pngjs:"^7.0.0",postcss:"^8.4.38","postcss-cli":"^11.0.0","postcss-inline-svg":"^6.0.0","pretty-bytes":"^6.1.1",puppeteer:"^22.7.0",react:"^18.2.0","react-dom":"^18.2.0",rollup:"^4.16.4","rollup-plugin-sourcemaps":"^0.6.3",rw:"^1.3.3",semver:"^7.6.0","shuffle-seed":"^1.1.6","source-map-explorer":"^2.5.3",st:"^3.0.0",stylelint:"^16.4.0","stylelint-config-standard":"^36.0.0","ts-jest":"^29.1.2","ts-node":"^10.9.2",tslib:"^2.6.2",typedoc:"^0.25.13","typedoc-plugin-markdown":"^3.17.1","typedoc-plugin-missing-exports":"^2.2.0",typescript:"^5.4.5"},overrides:{"postcss-inline-svg":{"css-select":"^5.1.0","dom-serializer":"^2.0.0",htmlparser2:"^8.0.1","postcss-value-parser":"^4.2.0"}},scripts:{build:"tsc -b","generate-dist-package":"node --no-warnings --loader ts-node/esm build/generate-dist-package.js","generate-shaders":"node --no-warnings --loader ts-node/esm build/generate-shaders.ts","generate-struct-arrays":"node --no-warnings --loader ts-node/esm build/generate-struct-arrays.ts","generate-style-code":"node --no-warnings --loader ts-node/esm build/generate-style-code.ts","generate-typings":"dts-bundle-generator --export-referenced-types --umd-module-name=maplibregl -o ./dist/maplibre-gl.d.ts ./src/index.ts","generate-docs":"typedoc && node --no-warnings --loader ts-node/esm build/generate-docs.ts","generate-images":"node --no-warnings --loader ts-node/esm build/generate-doc-images.ts","build-dist":"npm run build-css && npm run generate-typings && npm run build-dev && npm run build-csp-dev && npm run build-prod && npm run build-csp","build-dev":"rollup --configPlugin @rollup/plugin-typescript -c --environment BUILD:dev","watch-dev":"rollup --configPlugin @rollup/plugin-typescript -c --environment BUILD:dev --watch","build-prod":"rollup --configPlugin @rollup/plugin-typescript -c --environment BUILD:production","build-csp":"rollup --configPlugin @rollup/plugin-typescript -c rollup.config.csp.ts","build-csp-dev":"rollup --configPlugin @rollup/plugin-typescript -c rollup.config.csp.ts --environment BUILD:dev","build-css":"postcss -o dist/maplibre-gl.css src/css/maplibre-gl.css","watch-css":"postcss --watch -o dist/maplibre-gl.css src/css/maplibre-gl.css","build-benchmarks":"npm run build-dev && rollup --configPlugin @rollup/plugin-typescript -c test/bench/rollup_config_benchmarks.ts","watch-benchmarks":"rollup --configPlugin @rollup/plugin-typescript -c test/bench/rollup_config_benchmarks.ts --watch","start-server":"st --no-cache -H 0.0.0.0 --port 9966 .","start-docs":"docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material",start:"run-p watch-css watch-dev start-server","start-bench":"run-p watch-css watch-benchmarks start-server",lint:"eslint --cache --ext .ts,.tsx,.js,.html --ignore-path .gitignore .","lint-css":"stylelint src/css/maplibre-gl.css",test:"run-p lint lint-css test-render jest",jest:"jest","test-build":"jest --selectProjects=build --reporters=default","test-build-ci":"jest --selectProjects=build","test-integration":"jest --selectProjects=integration --reporters=default","test-integration-ci":"jest --selectProjects=integration","test-render":"node --no-warnings --loader ts-node/esm test/integration/render/run_render_tests.ts","test-unit":"jest --selectProjects=unit --reporters=default","test-unit-ci":"jest --coverage --selectProjects unit","test-watch-roots":"jest --watch",codegen:"run-p --print-label generate-dist-package generate-style-code generate-struct-arrays generate-shaders && npm run generate-typings",benchmark:"node --no-warnings --loader ts-node/esm test/bench/run-benchmarks.ts","gl-stats":"node --no-warnings --loader ts-node/esm test/bench/gl-stats.ts","prepare:backup":"npm run codegen",typecheck:"tsc --noEmit && tsc --project tsconfig.dist.json",tsnode:"node --experimental-loader=ts-node/esm --no-warnings"},files:["build/","dist/*","src/"],engines:{npm:">=8.1.0",node:">=16.14.0"}}});var Br=V((YKt,lpe)=>{"use strict";lpe.exports=H1;function H1(t,e){this.x=t,this.y=e}H1.prototype={clone:function(){return new H1(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},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(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.x+r*(this.x-e.x)-n*(this.y-e.y),o=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=i,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}};H1.convert=function(t){return t instanceof H1?t:Array.isArray(t)?new H1(t[0],t[1]):t}});var ppe=V((KKt,cpe)=>{"use strict";cpe.exports=upe;function upe(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=r,this.p2y=n}upe.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(e===void 0&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var r=t,n=0;n<8;n++){var i=this.sampleCurveX(r)-t;if(Math.abs(i)<e)return r;var o=this.sampleCurveDerivativeX(r);if(Math.abs(o)<1e-6)break;r=r-i/o}var s=0,a=1;for(r=t,n=0;n<20&&(i=this.sampleCurveX(r),!(Math.abs(i-t)<e));n++)t>i?s=r:a=r,r=(a-s)*.5+s;return r},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}}});function TA(){return e9==null&&(e9=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),e9}var e9,t9=h(()=>{});function r9(){if(EA==null&&(EA=!1,TA())){let r=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(r){for(let i=0;i<5*5;i++){let o=i*4;r.fillStyle=`rgb(${o},${o+1},${o+2})`,r.fillRect(i%5,Math.floor(i/5),1,1)}let n=r.getImageData(0,0,5,5).data;for(let i=0;i<5*5*4;i++)if(i%4!==3&&n[i]!==i){EA=!0;break}}}return EA||!1}var EA,n9=h(()=>{t9()});function MA(t,e,r,n){let i=new dpe.default(t,e,r,n);return function(o){return i.solve(o)}}function Os(t,e,r){return Math.min(r,Math.max(e,t))}function AA(t,e,r){let n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function ype(t,e){let r=[];for(let n in t)n in e||r.push(n);return r}function Ue(t,...e){for(let r of e)for(let n in r)t[n]=r[n];return t}function Lg(t,e){let r={};for(let n=0;n<e.length;n++){let i=e[n];i in t&&(r[i]=t[i])}return r}function o9(){return fze++}function s9(t,e,r){let n={};for(let i in t)n[i]=e.call(r||this,t[i],i,t);return n}function gpe(t,e){for(let r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return!0;return!1}function ks(t){fpe[t]||(typeof console<"u"&&console.warn(t),fpe[t]=!0)}function TI(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function vpe(t){let e=0;for(let r=0,n=t.length,i=n-1,o,s;r<n;i=r++)o=t[r],s=t[i],e+=(s.x-o.x)*(o.y+s.y);return e}function Lh(t){return typeof WorkerGlobalScope<"u"&&typeof t<"u"&&t instanceof WorkerGlobalScope}function xpe(t){let e=/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,r={};if(t.replace(e,(n,i,o,s)=>{let a=o||s;return r[i]=a?a.toLowerCase():!0,""}),r["max-age"]){let n=parseInt(r["max-age"],10);isNaN(n)?delete r["max-age"]:r["max-age"]=n}return r}function bpe(t){if(i9==null){let e=t.navigator?t.navigator.userAgent:null;i9=!!t.safari||!!(e&&(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return i9}function $c(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap}function hze(t,e,r,n,i){let o=Math.max(-e,0)*4,l=(Math.max(0,r)-r)*n*4+o,u=n*4,c=Math.max(0,e),p=Math.max(0,r),f=Math.min(t.width,e+n),d=Math.min(t.height,r+i);return{rect:{x:c,y:p,width:f-c,height:d-p},layout:[{offset:l,stride:u}]}}async function Spe(t,e,r,n,i){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");let o=new VideoFrame(t,{timestamp:0});try{let s=o?.format;if(!s||!(s.startsWith("BGR")||s.startsWith("RGB")))throw new Error(`Unrecognized format ${s}`);let a=s.startsWith("BGR"),l=new Uint8ClampedArray(n*i*4);if(await o.copyTo(l,hze(t,e,r,n,i)),a)for(let u=0;u<l.length;u+=4){let c=l[u];l[u]=l[u+2],l[u+2]=c}return l}finally{o.close()}}function Ipe(t,e,r,n){return t.addEventListener(e,r,n),{unsubscribe:()=>{t.removeEventListener(e,r,n)}}}var pze,dpe,mpe,fze,fpe,i9,_pe,hpe,wpe,Oe=h(()=>{pze=_e(Br(),1),dpe=_e(ppe(),1);n9();mpe=MA(.25,.1,.25,1);fze=1;fpe={};i9=null;_pe=async t=>{if(t.byteLength===0)return createImageBitmap(new ImageData(1,1));let e=new Blob([new Uint8Array(t)],{type:"image/png"});try{return createImageBitmap(e)}catch(r){throw new Error(`Could not load image because of ${r.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}},hpe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=",wpe=t=>new Promise((e,r)=>{let n=new Image;n.onload=()=>{e(n),URL.revokeObjectURL(n.src),n.onload=null,window.requestAnimationFrame(()=>{n.src=hpe})},n.onerror=()=>r(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."));let i=new Blob([new Uint8Array(t)],{type:"image/png"});n.src=t.byteLength?URL.createObjectURL(i):hpe})});function Dg(){return new Error(dze)}var dze,LA=h(()=>{dze="AbortError"});var mze,DA,a9,Sn,vo=h(()=>{LA();mze=typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),Sn={now:mze,frameAsync(t){return new Promise((e,r)=>{let n=requestAnimationFrame(e);t.signal.addEventListener("abort",()=>{cancelAnimationFrame(n),r(Dg())})})},getImageData(t,e=0){return this.getImageCanvasContext(t).getImageData(-e,-e,t.width+2*e,t.height+2*e)},getImageCanvasContext(t){let 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=t.width,e.height=t.height,r.drawImage(t,0,0,t.width,t.height),r},resolveURL(t){return DA||(DA=document.createElement("a")),DA.href=t,DA.href},hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return matchMedia?(a9==null&&(a9=matchMedia("(prefers-reduced-motion: reduce)")),a9.matches):!1}}});var Ppe,dn,Ri,Ji=h(()=>{Ppe=_e(Br(),1),dn=class dn{static testProp(e){if(!dn.docStyle)return e[0];for(let r=0;r<e.length;r++)if(e[r]in dn.docStyle)return e[r];return e[0]}static create(e,r,n){let i=window.document.createElement(e);return r!==void 0&&(i.className=r),n&&n.appendChild(i),i}static createNS(e,r){return window.document.createElementNS(e,r)}static disableDrag(){dn.docStyle&&dn.selectProp&&(dn.userSelect=dn.docStyle[dn.selectProp],dn.docStyle[dn.selectProp]="none")}static enableDrag(){dn.docStyle&&dn.selectProp&&(dn.docStyle[dn.selectProp]=dn.userSelect)}static setTransform(e,r){e.style[dn.transformProp]=r}static addEventListener(e,r,n,i={}){"passive"in i?e.addEventListener(r,n,i):e.addEventListener(r,n,i.capture)}static removeEventListener(e,r,n,i={}){"passive"in i?e.removeEventListener(r,n,i):e.removeEventListener(r,n,i.capture)}static suppressClickInternal(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",dn.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",dn.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",dn.suppressClickInternal,!0)},0)}static getScale(e){let r=e.getBoundingClientRect();return{x:r.width/e.offsetWidth||1,y:r.height/e.offsetHeight||1,boundingClientRect:r}}static getPoint(e,r,n){let i=r.boundingClientRect;return new Ppe.default((n.clientX-i.left)/r.x-e.clientLeft,(n.clientY-i.top)/r.y-e.clientTop)}static mousePos(e,r){let n=dn.getScale(e);return dn.getPoint(e,n,r)}static touchPos(e,r){let n=[],i=dn.getScale(e);for(let o=0;o<r.length;o++)n.push(dn.getPoint(e,i,r[o]));return n}static mouseButton(e){return e.button}static remove(e){e.parentNode&&e.parentNode.removeChild(e)}};dn.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,dn.selectProp=dn.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),dn.transformProp=dn.testProp(["transform","WebkitTransform"]);Ri=dn});var Cl,Og=h(()=>{Cl={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""}});function OA(t){return Cl.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf("://"))]}var kA=h(()=>{Og()});var Dh=h(()=>{});async function gze(t,e){let r=new Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:l9(),signal:e.signal});t.type==="json"&&r.headers.set("Accept","application/json");let n=await fetch(r);if(!n.ok){let s=await n.blob();throw new kg(n.status,n.statusText,t.url,s)}let i;t.type==="arrayBuffer"||t.type==="image"?i=n.arrayBuffer():t.type==="json"?i=n.json():i=n.text();let o=await i;if(e.signal.aborted)throw Dg();return{data:o,cacheControl:n.headers.get("Cache-Control"),expires:n.headers.get("Expires")}}function vze(t,e){return new Promise((r,n)=>{let i=new XMLHttpRequest;i.open(t.method||"GET",t.url,!0),(t.type==="arrayBuffer"||t.type==="image")&&(i.responseType="arraybuffer");for(let o in t.headers)i.setRequestHeader(o,t.headers[o]);t.type==="json"&&(i.responseType="text",i.setRequestHeader("Accept","application/json")),i.withCredentials=t.credentials==="include",i.onerror=()=>{n(new Error(i.statusText))},i.onload=()=>{if(!e.signal.aborted)if((i.status>=200&&i.status<300||i.status===0)&&i.response!==null){let o=i.response;if(t.type==="json")try{o=JSON.parse(i.response)}catch(s){n(s);return}r({data:o,cacheControl:i.getResponseHeader("Cache-Control"),expires:i.getResponseHeader("Expires")})}else{let o=new Blob([i.response],{type:i.getResponseHeader("Content-Type")});n(new kg(i.status,i.statusText,t.url,o))}},e.signal.addEventListener("abort",()=>{i.abort(),n(Dg())}),i.send(t.body)})}function u9(t){if(!t||t.indexOf("://")<=0||t.indexOf("data:image/")===0||t.indexOf("blob:")===0)return!0;let e=new URL(t),r=window.location;return e.protocol===r.protocol&&e.host===r.host}var FA,kg,l9,yze,W1,EI,Cpe,Tpe,qc=h(()=>{Oe();LA();kA();Dh();FA="global-dispatcher",kg=class extends Error{constructor(e,r,n,i){super(`AJAXError: ${r} (${e}): ${n}`),this.status=e,this.statusText=r,this.url=n,this.body=i}},l9=()=>Lh(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,yze=t=>/^file:/.test(t)||/^file:/.test(l9())&&!/^\w+:/.test(t);W1=function(t,e){if(/:\/\//.test(t.url)&&!/^https?:|^file:/.test(t.url)){let r=OA(t.url);if(r)return r(t,e);if(Lh(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,targetMapId:FA},e)}if(!yze(t.url)){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return gze(t,e);if(Lh(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,mustQueue:!0,targetMapId:FA},e)}return vze(t,e)},EI=(t,e)=>W1(Ue(t,{type:"json"}),e),Cpe=(t,e)=>W1(Ue(t,{type:"arrayBuffer"}),e);Tpe=t=>{let e=window.document.createElement("video");return e.muted=!0,new Promise(r=>{e.onloadstart=()=>{r(e)};for(let n of t){let i=window.document.createElement("source");u9(n)||(e.crossOrigin="Anonymous"),i.src=n,e.appendChild(i)}})}});function xze(t){c9||!Z1||(Epe?Mpe(t):MI=t)}function Mpe(t){let e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,Z1),t.isContextLost())return;RA.supported=!0}catch{}t.deleteTexture(e),c9=!0}var RA,MI,c9,Z1,Epe,p9=h(()=>{RA={supported:!1,testSupport:xze},c9=!1,Epe=!1;typeof document<"u"&&(Z1=document.createElement("img"),Z1.onload=function(){MI&&Mpe(MI),MI=null,Epe=!0},Z1.onerror=function(){c9=!0,MI=null},Z1.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=")});var Hc,X1=h(()=>{qc();Oe();p9();Og();LA();kA();(d=>{let t,e,r,n;d.resetRequestQueue=()=>{t=[],e=0,r=0,n={}},d.addThrottleControl=m=>{let y=r++;return n[y]=m,y},d.removeThrottleControl=m=>{delete n[m],p()};let a=()=>{for(let m of Object.keys(n))if(n[m]())return!0;return!1};d.getImage=(m,y,g=!0)=>new Promise((b,w)=>{RA.supported&&(m.headers||(m.headers={}),m.headers.accept="image/webp,*/*"),Ue(m,{type:"image"});let S={abortController:y,requestParameters:m,supportImageRefresh:g,state:"queued",onError:I=>{w(I)},onSuccess:I=>{b(I)}};t.push(S),p()});let u=m=>typeof createImageBitmap=="function"?_pe(m):wpe(m),c=async m=>{m.state="running";let{requestParameters:y,supportImageRefresh:g,onError:b,onSuccess:w,abortController:S}=m,I=g===!1&&!Lh(self)&&!OA(y.url)&&(!y.headers||Object.keys(y.headers).reduce((T,M)=>T&&M==="accept",!0));e++;let P=I?f(y,S):W1(y,S);try{let T=await P;if(delete m.abortController,m.state="completed",T.data instanceof HTMLImageElement||$c(T.data))w(T);else if(T.data){let M=await u(T.data);w({data:M,cacheControl:T.cacheControl,expires:T.expires})}}catch(T){delete m.abortController,b(T)}finally{e--,p()}},p=()=>{let m=a()?Cl.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:Cl.MAX_PARALLEL_IMAGE_REQUESTS;for(let y=e;y<m&&t.length>0;y++){let g=t.shift();if(g.abortController.signal.aborted){y--;continue}c(g)}},f=(m,y)=>new Promise((g,b)=>{let w=new Image,S=m.url,I=m.credentials;I&&I==="include"?w.crossOrigin="use-credentials":(I&&I==="same-origin"||!u9(S))&&(w.crossOrigin="anonymous"),y.signal.addEventListener("abort",()=>{w.src="",b(Dg())}),w.fetchPriority="high",w.onload=()=>{w.onerror=w.onload=null,g({data:w})},w.onerror=()=>{w.onerror=w.onload=null,!y.signal.aborted&&b(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.src=S})})(Hc||(Hc={}));Hc.resetRequestQueue()});var Nu=h(()=>{});function Ape(t,e,r){r[t]&&r[t].indexOf(e)!==-1||(r[t]=r[t]||[],r[t].push(e))}function f9(t,e,r){if(r&&r[t]){let n=r[t].indexOf(e);n!==-1&&r[t].splice(n,1)}}var nt,Ln,Jn,Qn=h(()=>{Oe();nt=class{constructor(e,r={}){Ue(this,r),this.type=e}},Ln=class extends nt{constructor(e,r={}){super("error",Ue({error:e},r))}},Jn=class{on(e,r){return this._listeners=this._listeners||{},Ape(e,r,this._listeners),this}off(e,r){return f9(e,r,this._listeners),f9(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},Ape(e,r,this._oneTimeListeners),this):new Promise(n=>this.once(e,n))}fire(e,r){typeof e=="string"&&(e=new nt(e,r||{}));let n=e.type;if(this.listens(n)){e.target=this;let i=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];for(let a of i)a.call(this,e);let o=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];for(let a of o)f9(n,a,this._oneTimeListeners),a.call(this,e);let s=this._eventedParent;s&&(Ue(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),s.fire(e))}else e instanceof Ln&&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}}});function eb(t,...e){for(let r of e)for(let n in r)t[n]=r[n];return t}function Tl(t,e){return{kind:"array",itemType:t,N:e}}function ai(t){if(t.kind==="array"){let e=ai(t.itemType);return typeof t.N=="number"?`array<${e}, ${t.N}>`:t.itemType.kind==="value"?"array":`array<${e}>`}else return t.kind}function FI(t,e){if(e.kind==="error")return null;if(t.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!FI(t.itemType,e.itemType))&&(typeof t.N!="number"||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if(t.kind==="value"){for(let r of aVe)if(!FI(r,e))return null}}return`Expected ${ai(t)} but found ${ai(e)} instead.`}function z9(t,e){return e.some(r=>r.kind===t.kind)}function Bg(t,e){return e.some(r=>r==="null"?t===null:r==="array"?Array.isArray(t):r==="object"?t&&!Array.isArray(t)&&typeof t=="object":r===typeof t)}function AI(t,e){return t.kind==="array"&&e.kind==="array"?t.itemType.kind===e.itemType.kind&&typeof t.N=="number":t.kind===e.kind}function nfe(t){return t=t%360,t<0&&(t+=360),t}function ife([t,e,r,n]){t=h9(t),e=h9(e),r=h9(r);let i,o,s=d9((.2225045*t+.7168786*e+.0606169*r)/Qpe);t===e&&e===r?i=o=s:(i=d9((.4360747*t+.3850649*e+.1430804*r)/Jpe),o=d9((.0139322*t+.0971045*e+.7141733*r)/efe));let a=116*s-16;return[a<0?0:a,500*(i-s),200*(s-o),n]}function h9(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function d9(t){return t>lVe?Math.pow(t,1/3):t/rfe+tfe}function ofe([t,e,r,n]){let i=(t+16)/116,o=isNaN(e)?i:i+e/500,s=isNaN(r)?i:i-r/200;return i=Qpe*y9(i),o=Jpe*y9(o),s=efe*y9(s),[m9(3.1338561*o-1.6168667*i-.4906146*s),m9(-.9787684*o+1.9161415*i+.033454*s),m9(.0719453*o-.2289914*i+1.4052427*s),n]}function m9(t){return t=t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055,t<0?0:t>1?1:t}function y9(t){return t>Q1?t*t*t:rfe*(t-tfe)}function pVe(t){let[e,r,n,i]=ife(t),o=Math.sqrt(r*r+n*n);return[Math.round(o*1e4)?nfe(Math.atan2(n,r)*cVe):NaN,o,e,i]}function fVe([t,e,r,n]){return t=isNaN(t)?0:t*uVe,ofe([r,Math.cos(t)*e,Math.sin(t)*e,n])}function hVe([t,e,r,n]){t=nfe(t),e/=100,r/=100;function i(o){let s=(o+t/30)%12,a=e*Math.min(r,1-r);return r-a*Math.max(-1,Math.min(s-3,9-s,1))}return[i(0),i(8),i(4),n]}function dVe(t){if(t=t.toLowerCase().trim(),t==="transparent")return[0,0,0,0];let e=mVe[t];if(e){let[i,o,s]=e;return[i/255,o/255,s/255,1]}if(t.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){let o=t.length<6?1:2,s=1;return[NA(t.slice(s,s+=o)),NA(t.slice(s,s+=o)),NA(t.slice(s,s+=o)),NA(t.slice(s,s+o)||"ff")]}if(t.startsWith("rgb")){let i=/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,o=t.match(i);if(o){let[s,a,l,u,c,p,f,d,m,y,g,b]=o,w=[u||" ",f||" ",y].join("");if(w===" "||w===" /"||w===",,"||w===",,,"){let S=[l,p,m].join(""),I=S==="%%%"?100:S===""?255:0;if(I){let P=[Y1(+a/I,0,1),Y1(+c/I,0,1),Y1(+d/I,0,1),g?Lpe(+g,b):1];if(Dpe(P))return P}}return}}let r=/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,n=t.match(r);if(n){let[i,o,s,a,l,u,c,p,f]=n,d=[s||" ",l||" ",c].join("");if(d===" "||d===" /"||d===",,"||d===",,,"){let m=[+o,Y1(+a,0,100),Y1(+u,0,100),p?Lpe(+p,f):1];if(Dpe(m))return hVe(m)}}}function NA(t){return parseInt(t.padEnd(2,t),16)/255}function Lpe(t,e){return Y1(e?t/100:t,0,1)}function Y1(t,e,r){return Math.min(Math.max(e,t),r)}function Dpe(t){return!t.some(Number.isNaN)}function sfe(t,e,r,n){return typeof t=="number"&&t>=0&&t<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?typeof n>"u"||typeof n=="number"&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof n=="number"?[t,e,r,n]:[t,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function BI(t){if(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||t instanceof wt||t instanceof RI||t instanceof Xc||t instanceof ff||t instanceof ym||t instanceof $a)return!0;if(Array.isArray(t)){for(let e of t)if(!BI(e))return!1;return!0}else if(typeof t=="object"){for(let e in t)if(!BI(t[e]))return!1;return!0}else return!1}function xo(t){if(t===null)return sb;if(typeof t=="string")return _t;if(typeof t=="boolean")return lt;if(typeof t=="number")return ce;if(t instanceof wt)return cf;if(t instanceof RI)return nL;if(t instanceof Xc)return iL;if(t instanceof ff)return oL;if(t instanceof ym)return sL;if(t instanceof $a)return HI;if(Array.isArray(t)){let e=t.length,r;for(let n of t){let i=xo(n);if(!r)r=i;else{if(r===i)continue;r=ut;break}}return Tl(r||ut,e)}else return J1}function OI(t){let e=typeof t;return t===null?"":e==="string"||e==="number"||e==="boolean"?String(t):t instanceof wt||t instanceof Xc||t instanceof ff||t instanceof ym||t instanceof $a?t.toString():JSON.stringify(t)}function aL(t,e){let r=t.length-1,n=0,i=r,o=0,s,a;for(;n<=i;)if(o=Math.floor((n+i)/2),s=t[o],a=t[o+1],s<=e){if(o===r||e<a)return o;n=o+1}else if(s>e)i=o-1;else throw new bi("Input is not a number.");return 0}function vVe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function xVe(){if(kpe)return g9;kpe=1,g9=t;function t(e,r,n,i){this.cx=3*e,this.bx=3*(n-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(i-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=r,this.p2x=n,this.p2y=i}return t.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,r){if(r===void 0&&(r=1e-6),e<0)return 0;if(e>1)return 1;for(var n=e,i=0;i<8;i++){var o=this.sampleCurveX(n)-e;if(Math.abs(o)<r)return n;var s=this.sampleCurveDerivativeX(n);if(Math.abs(s)<1e-6)break;n=n-o/s}var a=0,l=1;for(n=e,i=0;i<20&&(o=this.sampleCurveX(n),!(Math.abs(o-e)<r));i++)e>o?a=n:l=n,n=(l-a)*.5+a;return n},solve:function(e,r){return this.sampleCurveY(this.solveCurveX(e,r))}},g9}function wVe(t){return t==="rgb"||t==="hcl"||t==="lab"}function zg(t,e,r){return t+r*(e-t)}function SVe(t,e,r,n="rgb"){switch(n){case"rgb":{let[i,o,s,a]=WA(t.rgb,e.rgb,r);return new wt(i,o,s,a,!1)}case"hcl":{let[i,o,s,a]=t.hcl,[l,u,c,p]=e.hcl,f,d;if(!isNaN(i)&&!isNaN(l)){let w=l-i;l>i&&w>180?w-=360:l<i&&i-l>180&&(w+=360),f=i+r*w}else isNaN(i)?isNaN(l)?f=NaN:(f=l,(s===1||s===0)&&(d=u)):(f=i,(c===1||c===0)&&(d=o));let[m,y,g,b]=fVe([f,d??zg(o,u,r),zg(s,c,r),zg(a,p,r)]);return new wt(m,y,g,b,!1)}case"lab":{let[i,o,s,a]=ofe(WA(t.lab,e.lab,r));return new wt(i,o,s,a,!1)}}}function WA(t,e,r){return t.map((n,i)=>zg(n,e[i],r))}function IVe(t,e,r){return new ff(WA(t.values,e.values,r))}function PVe(t,e,r){let n=t.values,i=e.values;if(n.length!==i.length)throw new bi(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${e.toString()}`);let o=[];for(let s=0;s<n.length;s+=2){if(n[s]!==i[s])throw new bi(`Cannot interpolate values containing mismatched anchors. from[${s}]: ${n[s]}, to[${s}]: ${i[s]}`);o.push(n[s]);let[a,l]=n[s+1],[u,c]=i[s+1];o.push([zg(a,u,r),zg(l,c,r)])}return new ym(o)}function v9(t,e,r,n){let i=n-r,o=t-r;return i===0?0:e===1?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}function Fpe(t,e){return t==="=="||t==="!="?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 CVe(t,e,r){return e===r}function TVe(t,e,r){return e!==r}function EVe(t,e,r){return e<r}function MVe(t,e,r){return e>r}function AVe(t,e,r){return e<=r}function LVe(t,e,r){return e>=r}function afe(t,e,r,n){return n.compare(e,r)===0}function DVe(t,e,r,n){return!afe(t,e,r,n)}function OVe(t,e,r,n){return n.compare(e,r)<0}function kVe(t,e,r,n){return n.compare(e,r)>0}function FVe(t,e,r,n){return n.compare(e,r)<=0}function RVe(t,e,r,n){return n.compare(e,r)>=0}function ab(t,e,r){let n=t!=="=="&&t!=="!=";return class lfe{constructor(o,s,a){this.type=lt,this.lhs=o,this.rhs=s,this.collator=a,this.hasUntypedArgument=o.type.kind==="value"||s.type.kind==="value"}static parse(o,s){if(o.length!==3&&o.length!==4)return s.error("Expected two or three arguments.");let a=o[0],l=s.parse(o[1],1,ut);if(!l)return null;if(!Fpe(a,l.type))return s.concat(1).error(`"${a}" comparisons are not supported for type '${ai(l.type)}'.`);let u=s.parse(o[2],2,ut);if(!u)return null;if(!Fpe(a,u.type))return s.concat(2).error(`"${a}" comparisons are not supported for type '${ai(u.type)}'.`);if(l.type.kind!==u.type.kind&&l.type.kind!=="value"&&u.type.kind!=="value")return s.error(`Cannot compare types '${ai(l.type)}' and '${ai(u.type)}'.`);n&&(l.type.kind==="value"&&u.type.kind!=="value"?l=new Wc(u.type,[l]):l.type.kind!=="value"&&u.type.kind==="value"&&(u=new Wc(l.type,[u])));let c=null;if(o.length===4){if(l.type.kind!=="string"&&u.type.kind!=="string"&&l.type.kind!=="value"&&u.type.kind!=="value")return s.error("Cannot use collator to compare non-string types.");if(c=s.parse(o[3],3,nL),!c)return null}return new lfe(l,u,c)}evaluate(o){let s=this.lhs.evaluate(o),a=this.rhs.evaluate(o);if(n&&this.hasUntypedArgument){let l=xo(s),u=xo(a);if(l.kind!==u.kind||!(l.kind==="string"||l.kind==="number"))throw new bi(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${l.kind}, ${u.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){let l=xo(s),u=xo(a);if(l.kind!=="string"||u.kind!=="string")return e(o,s,a)}return this.collator?r(o,s,a,this.collator.evaluate(o)):e(o,s,a)}eachChild(o){o(this.lhs),o(this.rhs),this.collator&&o(this.collator)}outputDefined(){return!0}}}function jVe(t,e){let r=$Ve(t[0]),n=HVe(t[1]),i=Math.pow(2,e.z);return[Math.round(r*i*pf),Math.round(n*i*pf)]}function V9(t,e){let r=Math.pow(2,e.z),n=(t[0]/pf+e.x)/r,i=(t[1]/pf+e.y)/r;return[qVe(n),WVe(i)]}function $Ve(t){return(180+t)/360}function qVe(t){return t*360-180}function HVe(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function WVe(t){return 360/Math.PI*Math.atan(Math.exp((180-t*360)*Math.PI/180))-90}function WI(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function zI(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function ZVe(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function XVe(t,e,r){let n=t[0]-e[0],i=t[1]-e[1],o=t[0]-r[0],s=t[1]-r[1];return n*s-o*i===0&&n*o<=0&&i*s<=0}function lL(t,e,r,n){let i=[e[0]-t[0],e[1]-t[1]],o=[n[0]-r[0],n[1]-r[1]];return QVe(o,i)===0?!1:!!(Rpe(t,e,r,n)&&Rpe(r,n,t,e))}function YVe(t,e,r){for(let n of r)for(let i=0;i<n.length-1;++i)if(lL(t,e,n[i],n[i+1]))return!0;return!1}function lb(t,e,r=!1){let n=!1;for(let i of e)for(let o=0;o<i.length-1;o++){if(XVe(t,i[o],i[o+1]))return r;ZVe(t,i[o],i[o+1])&&(n=!n)}return n}function KVe(t,e){for(let r of e)if(lb(t,r))return!0;return!1}function ufe(t,e){for(let r of t)if(!lb(r,e))return!1;for(let r=0;r<t.length-1;++r)if(YVe(t[r],t[r+1],e))return!1;return!0}function JVe(t,e){for(let r of e)if(ufe(t,r))return!0;return!1}function QVe(t,e){return t[0]*e[1]-t[1]*e[0]}function Rpe(t,e,r,n){let i=t[0]-r[0],o=t[1]-r[1],s=e[0]-r[0],a=e[1]-r[1],l=n[0]-r[0],u=n[1]-r[1],c=i*u-l*o,p=s*u-l*a;return c>0&&p<0||c<0&&p>0}function U9(t,e,r){let n=[];for(let i=0;i<t.length;i++){let o=[];for(let s=0;s<t[i].length;s++){let a=jVe(t[i][s],r);WI(e,a),o.push(a)}n.push(o)}return n}function cfe(t,e,r){let n=[];for(let i=0;i<t.length;i++){let o=U9(t[i],e,r);n.push(o)}return n}function pfe(t,e,r,n){if(t[0]<r[0]||t[0]>r[2]){let i=n*.5,o=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;o===0&&(o=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=o}WI(e,t)}function eUe(t){t[0]=t[1]=1/0,t[2]=t[3]=-1/0}function Npe(t,e,r,n){let i=Math.pow(2,n.z)*pf,o=[n.x*pf,n.y*pf],s=[];for(let a of t)for(let l of a){let u=[l.x+o[0],l.y+o[1]];pfe(u,e,r,i),s.push(u)}return s}function Bpe(t,e,r,n){let i=Math.pow(2,n.z)*pf,o=[n.x*pf,n.y*pf],s=[];for(let a of t){let l=[];for(let u of a){let c=[u.x+o[0],u.y+o[1]];WI(e,c),l.push(c)}s.push(l)}if(e[2]-e[0]<=i/2){eUe(e);for(let a of s)for(let l of a)pfe(l,e,r,i)}return s}function tUe(t,e){let r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(e.type==="Polygon"){let o=U9(e.coordinates,n,i),s=Npe(t.geometry(),r,n,i);if(!zI(r,n))return!1;for(let a of s)if(!lb(a,o))return!1}if(e.type==="MultiPolygon"){let o=cfe(e.coordinates,n,i),s=Npe(t.geometry(),r,n,i);if(!zI(r,n))return!1;for(let a of s)if(!KVe(a,o))return!1}return!0}function rUe(t,e){let r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(e.type==="Polygon"){let o=U9(e.coordinates,n,i),s=Bpe(t.geometry(),r,n,i);if(!zI(r,n))return!1;for(let a of s)if(!ufe(a,o))return!1}if(e.type==="MultiPolygon"){let o=cfe(e.coordinates,n,i),s=Bpe(t.geometry(),r,n,i);if(!zI(r,n))return!1;for(let a of s)if(!JVe(a,o))return!1}return!0}function nUe(t,e,r,n,i){ffe(t,e,r,n||t.length-1,i||iUe)}function ffe(t,e,r,n,i){for(;n>r;){if(n-r>600){var o=n-r+1,s=e-r+1,a=Math.log(o),l=.5*Math.exp(2*a/3),u=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1),c=Math.max(r,Math.floor(e-s*l/o+u)),p=Math.min(n,Math.floor(e+(o-s)*l/o+u));ffe(t,e,c,p,i)}var f=t[e],d=r,m=n;for(LI(t,r,e),i(t[n],f)>0&&LI(t,r,n);d<m;){for(LI(t,d,m),d++,m--;i(t[d],f)<0;)d++;for(;i(t[m],f)>0;)m--}i(t[r],f)===0?LI(t,r,m):(m++,LI(t,m,n)),m<=e&&(r=m+1),e<=m&&(n=m-1)}}function LI(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function iUe(t,e){return t<e?-1:t>e?1:0}function oUe(t,e){if(t.length<=1)return[t];let n=[],i,o;for(let s of t){let a=aUe(s);a!==0&&(s.area=Math.abs(a),o===void 0&&(o=a<0),o===a<0?(i&&n.push(i),i=[s]):i.push(s))}if(i&&n.push(i),e>1)for(let s=0;s<n.length;s++)n[s].length<=e||(nUe(n[s],e,1,n[s].length-1,sUe),n[s]=n[s].slice(0,e));return n}function sUe(t,e){return e.area-t.area}function aUe(t){let e=0;for(let r=0,n=t.length,i=n-1,o,s;r<n;i=r++)o=t[r],s=t[i],e+=(s.x-o.x)*(o.y+s.y);return e}function hfe(t,e){return e[0]-t[0]}function KA(t){return t[1]-t[0]+1}function Oh(t,e){return t[1]>=t[0]&&t[1]<e}function F9(t,e){if(t[0]>t[1])return[null,null];let r=KA(t);if(e){if(r===2)return[t,null];let i=Math.floor(r/2);return[[t[0],t[0]+i],[t[0]+i,t[1]]]}if(r===1)return[t,null];let n=Math.floor(r/2)-1;return[[t[0],t[0]+n],[t[0]+n+1,t[1]]]}function R9(t,e){if(!Oh(e,t.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let n=e[0];n<=e[1];++n)WI(r,t[n]);return r}function N9(t){let e=[1/0,1/0,-1/0,-1/0];for(let r of t)for(let n of r)WI(e,n);return e}function Gpe(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function G9(t,e,r){if(!Gpe(t)||!Gpe(e))return NaN;let n=0,i=0;return t[2]<e[0]&&(n=e[0]-t[2]),t[0]>e[2]&&(n=t[0]-e[2]),t[1]>e[3]&&(i=t[1]-e[3]),t[3]<e[1]&&(i=e[1]-t[3]),r.distance([0,0],[n,i])}function Ng(t,e,r){let n=r.pointOnLine(e,t);return r.distance(t,n.point)}function j9(t,e,r,n,i){let o=Math.min(Ng(t,[r,n],i),Ng(e,[r,n],i)),s=Math.min(Ng(r,[t,e],i),Ng(n,[t,e],i));return Math.min(o,s)}function uUe(t,e,r,n,i){if(!(Oh(e,t.length)&&Oh(n,r.length)))return 1/0;let s=1/0;for(let a=e[0];a<e[1];++a){let l=t[a],u=t[a+1];for(let c=n[0];c<n[1];++c){let p=r[c],f=r[c+1];if(lL(l,u,p,f))return 0;s=Math.min(s,j9(l,u,p,f,i))}}return s}function cUe(t,e,r,n,i){if(!(Oh(e,t.length)&&Oh(n,r.length)))return NaN;let s=1/0;for(let a=e[0];a<=e[1];++a)for(let l=n[0];l<=n[1];++l)if(s=Math.min(s,i.distance(t[a],r[l])),s===0)return s;return s}function pUe(t,e,r){if(lb(t,e,!0))return 0;let n=1/0;for(let i of e){let o=i[0],s=i[i.length-1];if(o!==s&&(n=Math.min(n,Ng(t,[s,o],r)),n===0))return n;let a=r.pointOnLine(i,t);if(n=Math.min(n,r.distance(t,a.point)),n===0)return n}return n}function fUe(t,e,r,n){if(!Oh(e,t.length))return NaN;for(let o=e[0];o<=e[1];++o)if(lb(t[o],r,!0))return 0;let i=1/0;for(let o=e[0];o<e[1];++o){let s=t[o],a=t[o+1];for(let l of r)for(let u=0,c=l.length,p=c-1;u<c;p=u++){let f=l[p],d=l[u];if(lL(s,a,f,d))return 0;i=Math.min(i,j9(s,a,f,d,n))}}return i}function jpe(t,e){for(let r of t)for(let n of r)if(lb(n,e,!0))return!0;return!1}function hUe(t,e,r,n=1/0){let i=N9(t),o=N9(e);if(n!==1/0&&G9(i,o,r)>=n)return n;if(zI(i,o)){if(jpe(t,e))return 0}else if(jpe(e,t))return 0;let s=1/0;for(let a of t)for(let l=0,u=a.length,c=u-1;l<u;c=l++){let p=a[c],f=a[l];for(let d of e)for(let m=0,y=d.length,g=y-1;m<y;g=m++){let b=d[g],w=d[m];if(lL(p,f,b,w))return 0;s=Math.min(s,j9(p,f,b,w,r))}}return s}function $pe(t,e,r,n,i,o){if(!o)return;let s=G9(R9(n,o),i,r);s<e&&t.push([s,o,[0,0]])}function zA(t,e,r,n,i,o,s){if(!o||!s)return;let a=G9(R9(n,o),R9(i,s),r);a<e&&t.push([a,o,s])}function JA(t,e,r,n,i=1/0){let o=Math.min(n.distance(t[0],r[0][0]),i);if(o===0)return o;let s=new YA([[0,[0,t.length-1],[0,0]]],hfe),a=N9(r);for(;s.length>0;){let l=s.pop();if(l[0]>=o)continue;let u=l[1],c=e?k9:O9;if(KA(u)<=c){if(!Oh(u,t.length))return NaN;if(e){let p=fUe(t,u,r,n);if(isNaN(p)||p===0)return p;o=Math.min(o,p)}else for(let p=u[0];p<=u[1];++p){let f=pUe(t[p],r,n);if(o=Math.min(o,f),o===0)return 0}}else{let p=F9(u,e);$pe(s,o,n,t,a,p[0]),$pe(s,o,n,t,a,p[1])}}return o}function QA(t,e,r,n,i,o=1/0){let s=Math.min(o,i.distance(t[0],r[0]));if(s===0)return s;let a=new YA([[0,[0,t.length-1],[0,r.length-1]]],hfe);for(;a.length>0;){let l=a.pop();if(l[0]>=s)continue;let u=l[1],c=l[2],p=e?k9:O9,f=n?k9:O9;if(KA(u)<=p&&KA(c)<=f){if(!Oh(u,t.length)&&Oh(c,r.length))return NaN;let d;if(e&&n)d=uUe(t,u,r,c,i),s=Math.min(s,d);else if(e&&!n){let m=t.slice(u[0],u[1]+1);for(let y=c[0];y<=c[1];++y)if(d=Ng(r[y],m,i),s=Math.min(s,d),s===0)return s}else if(!e&&n){let m=r.slice(c[0],c[1]+1);for(let y=u[0];y<=u[1];++y)if(d=Ng(t[y],m,i),s=Math.min(s,d),s===0)return s}else d=cUe(t,u,r,c,i),s=Math.min(s,d)}else{let d=F9(u,e),m=F9(c,n);zA(a,s,i,t,r,d[0],m[0]),zA(a,s,i,t,r,d[0],m[1]),zA(a,s,i,t,r,d[1],m[0]),zA(a,s,i,t,r,d[1],m[1])}}return s}function dUe(t,e){let r=t.geometry(),n=r.flat().map(s=>V9([s.x,s.y],t.canonical));if(r.length===0)return NaN;let i=new UI(n[0][1]),o=1/0;for(let s of e){switch(s.type){case"Point":o=Math.min(o,QA(n,!1,[s.coordinates],!1,i,o));break;case"LineString":o=Math.min(o,QA(n,!1,s.coordinates,!0,i,o));break;case"Polygon":o=Math.min(o,JA(n,!1,s.coordinates,i,o));break}if(o===0)return o}return o}function mUe(t,e){let r=t.geometry(),n=r.flat().map(s=>V9([s.x,s.y],t.canonical));if(r.length===0)return NaN;let i=new UI(n[0][1]),o=1/0;for(let s of e){switch(s.type){case"Point":o=Math.min(o,QA(n,!0,[s.coordinates],!1,i,o));break;case"LineString":o=Math.min(o,QA(n,!0,s.coordinates,!0,i,o));break;case"Polygon":o=Math.min(o,JA(n,!0,s.coordinates,i,o));break}if(o===0)return o}return o}function yUe(t,e){let r=t.geometry();if(r.length===0||r[0].length===0)return NaN;let n=oUe(r,0).map(s=>s.map(a=>a.map(l=>V9([l.x,l.y],t.canonical)))),i=new UI(n[0][0][0][1]),o=1/0;for(let s of e)for(let a of n){switch(s.type){case"Point":o=Math.min(o,JA([s.coordinates],!1,a,i,o));break;case"LineString":o=Math.min(o,JA(s.coordinates,!0,a,i,o));break;case"Polygon":o=Math.min(o,hUe(a,s.coordinates,i,o));break}if(o===0)return o}return o}function x9(t){return t.type==="MultiPolygon"?t.coordinates.map(e=>({type:"Polygon",coordinates:e})):t.type==="MultiLineString"?t.coordinates.map(e=>({type:"LineString",coordinates:e})):t.type==="MultiPoint"?t.coordinates.map(e=>({type:"Point",coordinates:e})):[t]}function qpe(t,[e,r,n,i]){e=e.evaluate(t),r=r.evaluate(t),n=n.evaluate(t);let o=i?i.evaluate(t):1,s=sfe(e,r,n,o);if(s)throw new bi(s);return new wt(e/255,r/255,n/255,o,!1)}function Hpe(t,e){return t in e}function b9(t,e){let r=e[t];return typeof r>"u"?null:r}function gUe(t,e,r,n){for(;r<=n;){let i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}function Rg(t){return{type:t}}function vUe(t){return Array.isArray(t)?`(${t.map(ai).join(", ")})`:`(${ai(t.type)}...)`}function eL(t){if(t instanceof qA)return eL(t.boundExpression);if(t instanceof hf&&t.name==="error")return!1;if(t instanceof XA)return!1;if(t instanceof VI)return!1;if(t instanceof GI)return!1;let e=t instanceof mm||t instanceof Wc,r=!0;return t.eachChild(n=>{e?r=r&&eL(n):r=r&&n instanceof tb}),r?uL(t)&&cL(t,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function uL(t){if(t instanceof hf){if(t.name==="get"&&t.args.length===1)return!1;if(t.name==="feature-state")return!1;if(t.name==="has"&&t.args.length===1)return!1;if(t.name==="properties"||t.name==="geometry-type"||t.name==="id")return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof VI||t instanceof GI)return!1;let e=!0;return t.eachChild(r=>{e&&!uL(r)&&(e=!1)}),e}function jI(t){if(t instanceof hf&&t.name==="feature-state")return!1;let e=!0;return t.eachChild(r=>{e&&!jI(r)&&(e=!1)}),e}function cL(t,e){if(t instanceof hf&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild(n=>{r&&!cL(n,e)&&(r=!1)}),r}function B9(t){return{result:"success",value:t}}function K1(t){return{result:"error",value:t}}function rb(t){return t["property-type"]==="data-driven"||t["property-type"]==="cross-faded-data-driven"}function dfe(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function $9(t){return!!t.expression&&t.expression.interpolated}function zr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":t===null?"null":typeof t}function q9(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function xUe(t){return t}function mfe(t,e){let r=e.type==="color",n=t.stops&&typeof t.stops[0][0]=="object",i=n||t.property!==void 0,o=n||!i,s=t.type||($9(e)?"exponential":"interval");if(r||e.type==="padding"){let c=r?wt.parse:ff.parse;t=eb({},t),t.stops&&(t.stops=t.stops.map(p=>[p[0],c(p[1])])),t.default?t.default=c(t.default):t.default=c(e.default)}if(t.colorSpace&&!wVe(t.colorSpace))throw new Error(`Unknown color space: "${t.colorSpace}"`);let a,l,u;if(s==="exponential")a=Wpe;else if(s==="interval")a=_Ue;else if(s==="categorical"){a=bUe,l=Object.create(null);for(let c of t.stops)l[c[0]]=c[1];u=typeof t.stops[0][0]}else if(s==="identity")a=wUe;else throw new Error(`Unknown function type "${s}"`);if(n){let c={},p=[];for(let m=0;m<t.stops.length;m++){let y=t.stops[m],g=y[0].zoom;c[g]===void 0&&(c[g]={zoom:g,type:t.type,property:t.property,default:t.default,stops:[]},p.push(g)),c[g].stops.push([y[0].value,y[1]])}let f=[];for(let m of p)f.push([c[m].zoom,mfe(c[m],e)]);let d={name:"linear"};return{kind:"composite",interpolationType:d,interpolationFactor:Zc.interpolationFactor.bind(void 0,d),zoomStops:f.map(m=>m[0]),evaluate({zoom:m},y){return Wpe({stops:f,base:t.base},e,m).evaluate(m,y)}}}else if(o){let c=s==="exponential"?{name:"exponential",base:t.base!==void 0?t.base:1}:null;return{kind:"camera",interpolationType:c,interpolationFactor:Zc.interpolationFactor.bind(void 0,c),zoomStops:t.stops.map(p=>p[0]),evaluate:({zoom:p})=>a(t,e,p,l,u)}}else return{kind:"source",evaluate(c,p){let f=p&&p.properties?p.properties[t.property]:void 0;return f===void 0?ZI(t.default,e.default):a(t,e,f,l,u)}}}function ZI(t,e,r){if(t!==void 0)return t;if(e!==void 0)return e;if(r!==void 0)return r}function bUe(t,e,r,n,i){let o=typeof r===i?n[r]:void 0;return ZI(o,t.default,e.default)}function _Ue(t,e,r){if(zr(r)!=="number")return ZI(t.default,e.default);let n=t.stops.length;if(n===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];let i=aL(t.stops.map(o=>o[0]),r);return t.stops[i][1]}function Wpe(t,e,r){let n=t.base!==void 0?t.base:1;if(zr(r)!=="number")return ZI(t.default,e.default);let i=t.stops.length;if(i===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];let o=aL(t.stops.map(c=>c[0]),r),s=SUe(r,n,t.stops[o][0],t.stops[o+1][0]),a=t.stops[o][1],l=t.stops[o+1][1],u=Vg[e.type]||xUe;return typeof a.evaluate=="function"?{evaluate(...c){let p=a.evaluate.apply(void 0,c),f=l.evaluate.apply(void 0,c);if(!(p===void 0||f===void 0))return u(p,f,s,t.colorSpace)}}:u(a,l,s,t.colorSpace)}function wUe(t,e,r){switch(e.type){case"color":r=wt.parse(r);break;case"formatted":r=Xc.fromString(r.toString());break;case"resolvedImage":r=$a.fromString(r.toString());break;case"padding":r=ff.parse(r);break;default:zr(r)!==e.type&&(e.type!=="enum"||!e.values[r])&&(r=void 0)}return ZI(r,t.default,e.default)}function SUe(t,e,r,n){let i=n-r,o=t-r;return i===0?0:e===1?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}function yfe(t){return Array.isArray(t)&&t.length>0&&typeof t[0]=="string"&&t[0]in jg}function H9(t,e){let r=new jA(jg,eL,[],e?PUe(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return n?B9(new $I(n,e)):K1(r.errors)}function IUe(t,e){let r=H9(t,e);if(r.result==="error")return r;let n=r.value.expression,i=uL(n);if(!i&&!rb(e))return K1([new Bu("","data expressions not supported")]);let o=cL(n,["zoom"]);if(!o&&!dfe(e))return K1([new Bu("","zoom expressions not supported")]);let s=UA(n);if(!s&&!o)return K1([new Bu("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(s instanceof Bu)return K1([s]);if(s instanceof Zc&&!$9(e))return K1([new Bu("",'"interpolate" expressions cannot be used with this property')]);if(!s)return B9(i?new nb("constant",r.value):new nb("source",r.value));let a=s instanceof Zc?s.interpolation:void 0;return B9(i?new ib("camera",r.value,s.labels,a):new ib("composite",r.value,s.labels,a))}function UA(t){let e=null;if(t instanceof $A)e=UA(t.result);else if(t instanceof ZA){for(let r of t.args)if(e=UA(r),e)break}else(t instanceof HA||t instanceof Zc)&&t.input instanceof hf&&t.input.name==="zoom"&&(e=t);return e instanceof Bu||t.eachChild(r=>{let n=UA(r);n instanceof Bu?e=n:!e&&n?e=new Bu("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&n&&e!==n&&(e=new Bu("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function PUe(t){let e={color:cf,string:_t,number:ce,enum:_t,boolean:lt,formatted:iL,padding:oL,resolvedImage:HI,variableAnchorOffsetCollection:sL};return t.type==="array"?Tl(e[t.value]||ut,t.length):e[t.type]}function CUe(t){return t.type==="color"&&q9(t.default)?new wt(0,0,0,0):t.type==="color"?wt.parse(t.default)||null:t.type==="padding"?ff.parse(t.default)||null:t.type==="variableAnchorOffsetCollection"?ym.parse(t.default)||null:t.default===void 0?null:t.default}function W9(t){if(t===!0||t===!1)return!0;if(!Array.isArray(t)||t.length===0)return!1;switch(t[0]){case"has":return t.length>=2&&t[1]!=="$id"&&t[1]!=="$type";case"in":return t.length>=3&&(typeof t[1]!="string"||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return t.length!==3||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(let e of t.slice(1))if(!W9(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}function XI(t){if(t==null)return{filter:()=>!0,needGeometry:!1};W9(t)||(t=rL(t));let e=H9(t,TUe);if(e.result==="error")throw new Error(e.value.map(r=>`${r.key}: ${r.message}`).join(", "));{let r=gfe(t);return{filter:(n,i,o)=>e.value.evaluate(n,i,{},o),needGeometry:r}}}function EUe(t,e){return t<e?-1:t>e?1:0}function gfe(t){if(!Array.isArray(t))return!1;if(t[0]==="within"||t[0]==="distance")return!0;for(let e=1;e<t.length;e++)if(gfe(t[e]))return!0;return!1}function rL(t){if(!t)return!0;let e=t[0];return t.length<=1?e!=="any":e==="=="?_9(t[1],t[2],"=="):e==="!="?VA(_9(t[1],t[2],"==")):e==="<"||e===">"||e==="<="||e===">="?_9(t[1],t[2],e):e==="any"?MUe(t.slice(1)):e==="all"?["all"].concat(t.slice(1).map(rL)):e==="none"?["all"].concat(t.slice(1).map(rL).map(VA)):e==="in"?Zpe(t[1],t.slice(2)):e==="!in"?VA(Zpe(t[1],t.slice(2))):e==="has"?Xpe(t[1]):e==="!has"?VA(Xpe(t[1])):!0}function _9(t,e,r){switch(t){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,t,e]}}function MUe(t){return["any"].concat(t.map(rL))}function Zpe(t,e){if(e.length===0)return!1;switch(t){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",t,["literal",e.sort(EUe)]]:["filter-in-small",t,["literal",e]]}}function Xpe(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function VA(t){return["!",t]}function vfe(){let t={},e=DI.$version;for(let r in DI.$root){let n=DI.$root[r];if(n.required){let i=null;r==="version"?i=e:n.type==="array"?i=[]:i={},i!=null&&(t[r]=i)}}return t}function xfe(t){let e=t.key,r=t.value;return r?[new te(e,r,"constants have been deprecated as of v8")]:[]}function Pi(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Ug(t){if(Array.isArray(t))return t.map(Ug);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){let e={};for(let r in t)e[r]=Ug(t[r]);return e}return Pi(t)}function zu(t){let e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},o=t.style,s=t.styleSpec,a=t.validateSpec,l=[],u=zr(r);if(u!=="object")return[new te(e,r,`object expected, ${u} found`)];for(let c in r){let p=c.split(".")[0],f=n[p]||n["*"],d;if(i[p])d=i[p];else if(n[p])d=a;else if(i["*"])d=i["*"];else if(n["*"])d=a;else{l.push(new te(e,r[c],`unknown property "${c}"`));continue}l=l.concat(d({key:(e&&`${e}.`)+c,value:r[c],valueSpec:f,style:o,styleSpec:s,object:r,objectKey:c,validateSpec:a},r))}for(let c in n)i[c]||n[c].required&&n[c].default===void 0&&r[c]===void 0&&l.push(new te(e,r,`missing required property "${c}"`));return l}function Z9(t){let e=t.value,r=t.valueSpec,n=t.validateSpec,i=t.style,o=t.styleSpec,s=t.key,a=t.arrayElementValidator||n;if(zr(e)!=="array")return[new te(s,e,`array expected, ${zr(e)} found`)];if(r.length&&e.length!==r.length)return[new te(s,e,`array length ${r.length} expected, length ${e.length} found`)];if(r["min-length"]&&e.length<r["min-length"])return[new te(s,e,`array length at least ${r["min-length"]} expected, length ${e.length} found`)];let l={type:r.value,values:r.values};o.$version<7&&(l.function=r.function),zr(r.value)==="object"&&(l=r.value);let u=[];for(let c=0;c<e.length;c++)u=u.concat(a({array:e,arrayIndex:c,value:e[c],valueSpec:l,validateSpec:t.validateSpec,style:i,styleSpec:o,key:`${s}[${c}]`}));return u}function X9(t){let e=t.key,r=t.value,n=t.valueSpec,i=zr(r);return i==="number"&&r!==r&&(i="NaN"),i!=="number"?[new te(e,r,`number expected, ${i} found`)]:"minimum"in n&&r<n.minimum?[new te(e,r,`${r} is less than the minimum value ${n.minimum}`)]:"maximum"in n&&r>n.maximum?[new te(e,r,`${r} is greater than the maximum value ${n.maximum}`)]:[]}function bfe(t){let e=t.valueSpec,r=Pi(t.value.type),n,i={},o,s,a=r!=="categorical"&&t.value.property===void 0,l=!a,u=zr(t.value.stops)==="array"&&zr(t.value.stops[0])==="array"&&zr(t.value.stops[0][0])==="object",c=zu({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:p,default:m}});return r==="identity"&&a&&c.push(new te(t.key,t.value,'missing required property "property"')),r!=="identity"&&!t.value.stops&&c.push(new te(t.key,t.value,'missing required property "stops"')),r==="exponential"&&t.valueSpec.expression&&!$9(t.valueSpec)&&c.push(new te(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!rb(t.valueSpec)?c.push(new te(t.key,t.value,"property functions not supported")):a&&!dfe(t.valueSpec)&&c.push(new te(t.key,t.value,"zoom functions not supported"))),(r==="categorical"||u)&&t.value.property===void 0&&c.push(new te(t.key,t.value,'"property" property is required')),c;function p(y){if(r==="identity")return[new te(y.key,y.value,'identity function may not have a "stops" property')];let g=[],b=y.value;return g=g.concat(Z9({key:y.key,value:b,valueSpec:y.valueSpec,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec,arrayElementValidator:f})),zr(b)==="array"&&b.length===0&&g.push(new te(y.key,b,"array must have at least one stop")),g}function f(y){let g=[],b=y.value,w=y.key;if(zr(b)!=="array")return[new te(w,b,`array expected, ${zr(b)} found`)];if(b.length!==2)return[new te(w,b,`array length 2 expected, length ${b.length} found`)];if(u){if(zr(b[0])!=="object")return[new te(w,b,`object expected, ${zr(b[0])} found`)];if(b[0].zoom===void 0)return[new te(w,b,"object stop key must have zoom")];if(b[0].value===void 0)return[new te(w,b,"object stop key must have value")];if(s&&s>Pi(b[0].zoom))return[new te(w,b[0].zoom,"stop zoom values must appear in ascending order")];Pi(b[0].zoom)!==s&&(s=Pi(b[0].zoom),o=void 0,i={}),g=g.concat(zu({key:`${w}[0]`,value:b[0],valueSpec:{zoom:{}},validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec,objectElementValidators:{zoom:X9,value:d}}))}else g=g.concat(d({key:`${w}[0]`,value:b[0],valueSpec:{},validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec},b));return yfe(Ug(b[1]))?g.concat([new te(`${w}[1]`,b[1],"expressions are not allowed in function stops.")]):g.concat(y.validateSpec({key:`${w}[1]`,value:b[1],valueSpec:e,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec}))}function d(y,g){let b=zr(y.value),w=Pi(y.value),S=y.value!==null?y.value:g;if(!n)n=b;else if(b!==n)return[new te(y.key,S,`${b} stop domain type must match previous stop domain type ${n}`)];if(b!=="number"&&b!=="string"&&b!=="boolean")return[new te(y.key,S,"stop domain value must be a number, string, or boolean")];if(b!=="number"&&r!=="categorical"){let I=`number expected, ${b} found`;return rb(e)&&r===void 0&&(I+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new te(y.key,S,I)]}return r==="categorical"&&b==="number"&&(!isFinite(w)||Math.floor(w)!==w)?[new te(y.key,S,`integer expected, found ${w}`)]:r!=="categorical"&&b==="number"&&o!==void 0&&w<o?[new te(y.key,S,"stop domain values must appear in ascending order")]:(o=w,r==="categorical"&&w in i?[new te(y.key,S,"stop domain values must be unique")]:(i[w]=!0,[]))}function m(y){return y.validateSpec({key:y.key,value:y.value,valueSpec:e,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec})}}function ob(t){let e=(t.expressionContext==="property"?IUe:H9)(Ug(t.value),t.valueSpec);if(e.result==="error")return e.value.map(n=>new te(`${t.key}${n.key}`,t.value,n.message));let r=e.value.expression||e.value._styleExpression.expression;if(t.expressionContext==="property"&&t.propertyKey==="text-font"&&!r.outputDefined())return[new te(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if(t.expressionContext==="property"&&t.propertyType==="layout"&&!jI(r))return[new te(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if(t.expressionContext==="filter"&&!jI(r))return[new te(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&t.expressionContext.indexOf("cluster")===0){if(!cL(r,["zoom","feature-state"]))return[new te(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(t.expressionContext==="cluster-initial"&&!uL(r))return[new te(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function AUe(t){let e=t.value,r=t.key,n=zr(e);return n!=="boolean"?[new te(r,e,`boolean expected, ${n} found`)]:[]}function LUe(t){let e=t.key,r=t.value,n=zr(r);return n!=="string"?[new te(e,r,`color expected, ${n} found`)]:wt.parse(String(r))?[]:[new te(e,r,`color expected, "${r}" found`)]}function qI(t){let e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?n.values.indexOf(Pi(r))===-1&&i.push(new te(e,r,`expected one of [${n.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(n.values).indexOf(Pi(r))===-1&&i.push(new te(e,r,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(r)} found`)),i}function Y9(t){return W9(Ug(t.value))?ob(eb({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):_fe(t)}function _fe(t){let e=t.value,r=t.key;if(zr(e)!=="array")return[new te(r,e,`array expected, ${zr(e)} found`)];let n=t.styleSpec,i,o=[];if(e.length<1)return[new te(r,e,"filter array must have at least 1 element")];switch(o=o.concat(qI({key:`${r}[0]`,value:e[0],valueSpec:n.filter_operator,style:t.style,styleSpec:t.styleSpec})),Pi(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&Pi(e[1])==="$type"&&o.push(new te(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&o.push(new te(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(i=zr(e[1]),i!=="string"&&o.push(new te(`${r}[1]`,e[1],`string expected, ${i} found`)));for(let s=2;s<e.length;s++)i=zr(e[s]),Pi(e[1])==="$type"?o=o.concat(qI({key:`${r}[${s}]`,value:e[s],valueSpec:n.geometry_type,style:t.style,styleSpec:t.styleSpec})):i!=="string"&&i!=="number"&&i!=="boolean"&&o.push(new te(`${r}[${s}]`,e[s],`string, number, or boolean expected, ${i} found`));break;case"any":case"all":case"none":for(let s=1;s<e.length;s++)o=o.concat(_fe({key:`${r}[${s}]`,value:e[s],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":i=zr(e[1]),e.length!==2?o.push(new te(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):i!=="string"&&o.push(new te(`${r}[1]`,e[1],`string expected, ${i} found`));break}return o}function wfe(t,e){let r=t.key,n=t.validateSpec,i=t.style,o=t.styleSpec,s=t.value,a=t.objectKey,l=o[`${e}_${t.layerType}`];if(!l)return[];let u=a.match(/^(.*)-transition$/);if(e==="paint"&&u&&l[u[1]]&&l[u[1]].transition)return n({key:r,value:s,valueSpec:o.transition,style:i,styleSpec:o});let c=t.valueSpec||l[a];if(!c)return[new te(r,s,`unknown property "${a}"`)];let p;if(zr(s)==="string"&&rb(c)&&!c.tokens&&(p=/^{([^}]+)}$/.exec(s)))return[new te(r,s,`"${a}" does not support interpolation syntax
|
|
66
|
+
`)}function Tr(...L){let ue={language:"javascript"},[k,be,pe]=L.length===2&&rt(L[1])?[L[0],L[1],ue]:L.length===2&&!rt(L[1])?[L[0],[],L[1]]:L.length===3?[L[0],L[1],L[2]]:L.length===1?[L[0],[],ue]:[null,[],ue];if(ee.language=pe.language,ee.variables.clear(),ee.functions.clear(),ee.instances.clear(),!Sr(k))throw new C3(k);for(let he of be)if(!Sr(he))throw new C3(he);return Zr(k,be,pe)}t.Code=Tr;function nn(L,ue=[]){let k=Tr(L,ue,{language:"javascript"}),be=globalThis.Function("kind","format","hash",k),pe=new Map(ee.instances);function he(nl,Fl,zv){if(!Fo.Has(nl)||!pe.has(Fl))return!1;let SO=Fo.Get(nl),zP=pe.get(Fl);return SO(zP,zv)}function Jt(nl,Fl){return Fa.Has(nl)?Fa.Get(nl)(Fl):!1}function ui(nl){return am(nl)}let Us=be(he,Jt,ui);return new XN(L,ue,Us,k)}t.Compile=nn})(T3||(T3={}))});var lse=h(()=>{ase()});function zBe(t,e,r){return r||(r=e,e={}),typeof r!="function"&&Ki(7),Tse(t,e,[BBe],function(n){return N3(uB(n.data[0],n.data[1]))},0,r)}function uB(t,e){return Pse(t,e||{},0,0)}function VBe(t,e,r){return r||(r=e,e={}),typeof r!="function"&&Ki(7),Tse(t,e,[NBe],function(n){return N3(cB(n.data[0],Cse(n.data[1])))},1,r)}function cB(t,e){return wse(t,{i:2},e&&e.out,e&&e.dictionary)}function k3(t,e){if(e){for(var r=new Bn(t.length),n=0;n<t.length;++n)r[n]=t.charCodeAt(n);return r}if(pse)return pse.encode(t);for(var i=t.length,o=new Bn(t.length+(t.length>>1)),s=0,a=function(c){o[s++]=c},n=0;n<i;++n){if(s+5>o.length){var l=new Bn(s+8+(i-n<<1));l.set(o),o=l}var u=t.charCodeAt(n);u<128||e?a(u):u<2048?(a(192|u>>6),a(128|u&63)):u>55295&&u<57344?(u=65536+(u&1047552)|t.charCodeAt(++n)&1023,a(240|u>>18),a(128|u>>12&63),a(128|u>>6&63),a(128|u&63)):(a(224|u>>12),a(128|u>>6&63),a(128|u&63))}return xg(o,0,s)}function pB(t,e){if(e){for(var r="",n=0;n<t.length;n+=16384)r+=String.fromCharCode.apply(null,t.subarray(n,n+16384));return r}else{if(nB)return nB.decode(t);var i=GBe(t),o=i.s,r=i.r;return r.length&&Ki(8),o}}function Mse(t,e,r){r||(r=e,e={}),typeof r!="function"&&Ki(7);var n={};Ese(t,"",n,e);var i=Object.keys(n),o=i.length,s=0,a=0,l=o,u=new Array(o),c=[],p=function(){for(var g=0;g<c.length;++g)c[g]()},f=function(g,b){F3(function(){r(g,b)})};F3(function(){f=r});var d=function(){var g=new Bn(a+22),b=s,w=a-s;a=0;for(var S=0;S<l;++S){var I=u[S];try{var P=I.c.length;fse(g,a,I,I.f,I.u,P);var T=30+I.f.length+iB(I.extra),M=a+T;g.set(I.c,M),fse(g,s,I,I.f,I.u,P,a,I.m),s+=16+T+(I.m?I.m.length:0),a=M+P}catch(E){return f(E,null)}}HBe(g,s,u.length,w,b),f(null,g)};o||d();for(var m=function(g){var b=i[g],w=n[b],S=w[0],I=w[1],P=kBe(),T=S.length;P.p(S);var M=k3(b),E=M.length,D=I.comment,B=D&&k3(D),$=B&&B.length,U=iB(I.extra),Y=I.level==0?0:8,G=function(ne,le){if(ne)p(),f(ne,null);else{var se=le.length;u[g]=lB(I,{size:T,crc:P.d(),c:le,f:M,m:B,u:E!=b.length||B&&D.length!=$,compression:Y}),s+=30+E+U+se,a+=76+2*(E+U)+($||0)+se,--o||d()}};if(E>65535&&G(Ki(11,0,1),null),!Y)G(null,S);else if(T<16e4)try{G(null,uB(S,I))}catch(ne){G(ne,null)}else c.push(zBe(S,I,G))},y=0;y<l;++y)m(y);return p}function Ase(t,e,r){r||(r=e,e={}),typeof r!="function"&&Ki(7);var n=[],i=function(){for(var g=0;g<n.length;++g)n[g]()},o={},s=function(g,b){F3(function(){r(g,b)})};F3(function(){s=r});for(var a=t.length-22;Vc(t,a)!=101010256;--a)if(!a||t.length-a>65558)return s(Ki(13,0,1),null),i;var l=nf(t,a+8);if(l){var u=l,c=Vc(t,a+16),p=c==4294967295||u==65535;if(p){var f=Vc(t,a-12);p=Vc(t,f)==101075792,p&&(u=l=Vc(t,f+32),c=Vc(t,f+48))}for(var d=e&&e.filter,m=function(g){var b=$Be(t,c,p),w=b[0],S=b[1],I=b[2],P=b[3],T=b[4],M=b[5],E=jBe(t,M);c=T;var D=function($,U){$?(i(),s($,null)):(U&&(o[P]=U),--l||s(null,o))};if(!d||d({name:P,size:S,originalSize:I,compression:w}))if(!w)D(null,xg(t,E,E+S));else if(w==8){var B=t.subarray(E,E+S);if(I<524288||S>.8*I)try{D(null,cB(B,{out:new Bn(I)}))}catch($){D($,null)}else n.push(VBe(B,{size:I},D))}else D(Ki(14,"unknown compression type "+w,1),null);else D(null,null)},y=0;y<u;++y)m(y)}else s(null,{});return i}var use,DBe,Bn,sa,pI,b1,_1,uI,hse,dse,oB,D3,mse,yse,eB,cI,Sh,en,Mu,Ih,en,en,en,en,x1,en,gse,vse,xse,bse,M3,Eu,A3,fI,xg,R3,_se,Ki,wse,rf,g1,L3,O3,tB,v1,sB,rB,Sse,aB,Ise,OBe,kBe,Pse,lB,cse,E3,FBe,RBe,NBe,BBe,N3,Cse,Tse,nf,Vc,QN,as,Ese,pse,nB,UBe,GBe,jBe,$Be,qBe,iB,fse,HBe,F3,hI=h(()=>{use={},DBe=function(t,e,r,n,i){var o=new Worker(use[e]||(use[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return o.onmessage=function(s){var a=s.data,l=a.$e$;if(l){var u=new Error(l[0]);u.code=l[1],u.stack=l[2],i(u,null)}else i(null,a)},o.postMessage(r,n),o},Bn=Uint8Array,sa=Uint16Array,pI=Int32Array,b1=new Bn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),_1=new Bn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),uI=new Bn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),hse=function(t,e){for(var r=new sa(31),n=0;n<31;++n)r[n]=e+=1<<t[n-1];for(var i=new pI(r[30]),n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)i[o]=o-r[n]<<5|n;return{b:r,r:i}},dse=hse(b1,2),oB=dse.b,D3=dse.r;oB[28]=258,D3[258]=28;mse=hse(_1,0),yse=mse.b,eB=mse.r,cI=new sa(32768);for(en=0;en<32768;++en)Sh=(en&43690)>>1|(en&21845)<<1,Sh=(Sh&52428)>>2|(Sh&13107)<<2,Sh=(Sh&61680)>>4|(Sh&3855)<<4,cI[en]=((Sh&65280)>>8|(Sh&255)<<8)>>1;Mu=function(t,e,r){for(var n=t.length,i=0,o=new sa(e);i<n;++i)t[i]&&++o[t[i]-1];var s=new sa(e);for(i=1;i<e;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(r){a=new sa(1<<e);var l=15-e;for(i=0;i<n;++i)if(t[i])for(var u=i<<4|t[i],c=e-t[i],p=s[t[i]-1]++<<c,f=p|(1<<c)-1;p<=f;++p)a[cI[p]>>l]=u}else for(a=new sa(n),i=0;i<n;++i)t[i]&&(a[i]=cI[s[t[i]-1]++]>>15-t[i]);return a},Ih=new Bn(288);for(en=0;en<144;++en)Ih[en]=8;for(en=144;en<256;++en)Ih[en]=9;for(en=256;en<280;++en)Ih[en]=7;for(en=280;en<288;++en)Ih[en]=8;x1=new Bn(32);for(en=0;en<32;++en)x1[en]=5;gse=Mu(Ih,9,0),vse=Mu(Ih,9,1),xse=Mu(x1,5,0),bse=Mu(x1,5,1),M3=function(t){for(var e=t[0],r=1;r<t.length;++r)t[r]>e&&(e=t[r]);return e},Eu=function(t,e,r){var n=e/8|0;return(t[n]|t[n+1]<<8)>>(e&7)&r},A3=function(t,e){var r=e/8|0;return(t[r]|t[r+1]<<8|t[r+2]<<16)>>(e&7)},fI=function(t){return(t+7)/8|0},xg=function(t,e,r){return(e==null||e<0)&&(e=0),(r==null||r>t.length)&&(r=t.length),new Bn(t.subarray(e,r))},R3={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14},_se=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Ki=function(t,e,r){var n=new Error(e||_se[t]);if(n.code=t,Error.captureStackTrace&&Error.captureStackTrace(n,Ki),!r)throw n;return n},wse=function(t,e,r,n){var i=t.length,o=n?n.length:0;if(!i||e.f&&!e.l)return r||new Bn(0);var s=!r,a=s||e.i!=2,l=e.i;s&&(r=new Bn(i*3));var u=function(k){var be=r.length;if(k>be){var pe=new Bn(Math.max(be*2,k));pe.set(r),r=pe}},c=e.f||0,p=e.p||0,f=e.b||0,d=e.l,m=e.d,y=e.m,g=e.n,b=i*8;do{if(!d){c=Eu(t,p,1);var w=Eu(t,p+1,3);if(p+=3,w)if(w==1)d=vse,m=bse,y=9,g=5;else if(w==2){var T=Eu(t,p,31)+257,M=Eu(t,p+10,15)+4,E=T+Eu(t,p+5,31)+1;p+=14;for(var D=new Bn(E),B=new Bn(19),$=0;$<M;++$)B[uI[$]]=Eu(t,p+$*3,7);p+=M*3;for(var U=M3(B),Y=(1<<U)-1,G=Mu(B,U,1),$=0;$<E;){var ne=G[Eu(t,p,Y)];p+=ne&15;var S=ne>>4;if(S<16)D[$++]=S;else{var le=0,se=0;for(S==16?(se=3+Eu(t,p,3),p+=2,le=D[$-1]):S==17?(se=3+Eu(t,p,7),p+=3):S==18&&(se=11+Eu(t,p,127),p+=7);se--;)D[$++]=le}}var X=D.subarray(0,T),ee=D.subarray(T);y=M3(X),g=M3(ee),d=Mu(X,y,1),m=Mu(ee,g,1)}else Ki(1);else{var S=fI(p)+4,I=t[S-4]|t[S-3]<<8,P=S+I;if(P>i){l&&Ki(0);break}a&&u(f+I),r.set(t.subarray(S,P),f),e.b=f+=I,e.p=p=P*8,e.f=c;continue}if(p>b){l&&Ki(0);break}}a&&u(f+131072);for(var Ee=(1<<y)-1,je=(1<<g)-1,Le=p;;Le=p){var le=d[A3(t,p)&Ee],He=le>>4;if(p+=le&15,p>b){l&&Ki(0);break}if(le||Ki(2),He<256)r[f++]=He;else if(He==256){Le=p,d=null;break}else{var xe=He-254;if(He>264){var $=He-257,Pe=b1[$];xe=Eu(t,p,(1<<Pe)-1)+oB[$],p+=Pe}var Zr=m[A3(t,p)&je],Tr=Zr>>4;Zr||Ki(3),p+=Zr&15;var ee=yse[Tr];if(Tr>3){var Pe=_1[Tr];ee+=A3(t,p)&(1<<Pe)-1,p+=Pe}if(p>b){l&&Ki(0);break}a&&u(f+131072);var nn=f+xe;if(f<ee){var L=o-ee,ue=Math.min(ee,nn);for(L+f<0&&Ki(3);f<ue;++f)r[f]=n[L+f]}for(;f<nn;++f)r[f]=r[f-ee]}}e.l=d,e.p=Le,e.b=f,e.f=c,d&&(c=1,e.m=y,e.d=m,e.n=g)}while(!c);return f!=r.length&&s?xg(r,0,f):r.subarray(0,f)},rf=function(t,e,r){r<<=e&7;var n=e/8|0;t[n]|=r,t[n+1]|=r>>8},g1=function(t,e,r){r<<=e&7;var n=e/8|0;t[n]|=r,t[n+1]|=r>>8,t[n+2]|=r>>16},L3=function(t,e){for(var r=[],n=0;n<t.length;++n)t[n]&&r.push({s:n,f:t[n]});var i=r.length,o=r.slice();if(!i)return{t:aB,l:0};if(i==1){var s=new Bn(r[0].s+1);return s[r[0].s]=1,{t:s,l:1}}r.sort(function(P,T){return P.f-T.f}),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,c=1,p=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=i-1;)a=r[r[u].f<r[p].f?u++:p++],l=r[u!=c&&r[u].f<r[p].f?u++:p++],r[c++]={s:-1,f:a.f+l.f,l:a,r:l};for(var f=o[0].s,n=1;n<i;++n)o[n].s>f&&(f=o[n].s);var d=new sa(f+1),m=O3(r[c-1],d,0);if(m>e){var n=0,y=0,g=m-e,b=1<<g;for(o.sort(function(T,M){return d[M.s]-d[T.s]||T.f-M.f});n<i;++n){var w=o[n].s;if(d[w]>e)y+=b-(1<<m-d[w]),d[w]=e;else break}for(y>>=g;y>0;){var S=o[n].s;d[S]<e?y-=1<<e-d[S]++-1:++n}for(;n>=0&&y;--n){var I=o[n].s;d[I]==e&&(--d[I],++y)}m=e}return{t:new Bn(d),l:m}},O3=function(t,e,r){return t.s==-1?Math.max(O3(t.l,e,r+1),O3(t.r,e,r+1)):e[t.s]=r},tB=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new sa(++e),n=0,i=t[0],o=1,s=function(l){r[n++]=l},a=1;a<=e;++a)if(t[a]==i&&a!=e)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=t[a]}return{c:r.subarray(0,n),n:e}},v1=function(t,e){for(var r=0,n=0;n<e.length;++n)r+=t[n]*e[n];return r},sB=function(t,e,r){var n=r.length,i=fI(e+2);t[i]=n&255,t[i+1]=n>>8,t[i+2]=t[i]^255,t[i+3]=t[i+1]^255;for(var o=0;o<n;++o)t[i+o+4]=r[o];return(i+4+n)*8},rB=function(t,e,r,n,i,o,s,a,l,u,c){rf(e,c++,r),++i[256];for(var p=L3(i,15),f=p.t,d=p.l,m=L3(o,15),y=m.t,g=m.l,b=tB(f),w=b.c,S=b.n,I=tB(y),P=I.c,T=I.n,M=new sa(19),E=0;E<w.length;++E)++M[w[E]&31];for(var E=0;E<P.length;++E)++M[P[E]&31];for(var D=L3(M,7),B=D.t,$=D.l,U=19;U>4&&!B[uI[U-1]];--U);var Y=u+5<<3,G=v1(i,Ih)+v1(o,x1)+s,ne=v1(i,f)+v1(o,y)+s+14+3*U+v1(M,B)+2*M[16]+3*M[17]+7*M[18];if(l>=0&&Y<=G&&Y<=ne)return sB(e,c,t.subarray(l,l+u));var le,se,X,ee;if(rf(e,c,1+(ne<G)),c+=2,ne<G){le=Mu(f,d,0),se=f,X=Mu(y,g,0),ee=y;var Ee=Mu(B,$,0);rf(e,c,S-257),rf(e,c+5,T-1),rf(e,c+10,U-4),c+=14;for(var E=0;E<U;++E)rf(e,c+3*E,B[uI[E]]);c+=3*U;for(var je=[w,P],Le=0;Le<2;++Le)for(var He=je[Le],E=0;E<He.length;++E){var xe=He[E]&31;rf(e,c,Ee[xe]),c+=B[xe],xe>15&&(rf(e,c,He[E]>>5&127),c+=He[E]>>12)}}else le=gse,se=Ih,X=xse,ee=x1;for(var E=0;E<a;++E){var Pe=n[E];if(Pe>255){var xe=Pe>>18&31;g1(e,c,le[xe+257]),c+=se[xe+257],xe>7&&(rf(e,c,Pe>>23&31),c+=b1[xe]);var Zr=Pe&31;g1(e,c,X[Zr]),c+=ee[Zr],Zr>3&&(g1(e,c,Pe>>5&8191),c+=_1[Zr])}else g1(e,c,le[Pe]),c+=se[Pe]}return g1(e,c,le[256]),c+se[256]},Sse=new pI([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),aB=new Bn(0),Ise=function(t,e,r,n,i,o){var s=o.z||t.length,a=new Bn(n+s+5*(1+Math.ceil(s/7e3))+i),l=a.subarray(n,a.length-i),u=o.l,c=(o.r||0)&7;if(e){c&&(l[0]=o.r>>3);for(var p=Sse[e-1],f=p>>13,d=p&8191,m=(1<<r)-1,y=o.p||new sa(32768),g=o.h||new sa(m+1),b=Math.ceil(r/3),w=2*b,S=function(he){return(t[he]^t[he+1]<<b^t[he+2]<<w)&m},I=new pI(25e3),P=new sa(288),T=new sa(32),M=0,E=0,D=o.i||0,B=0,$=o.w||0,U=0;D+2<s;++D){var Y=S(D),G=D&32767,ne=g[Y];if(y[G]=ne,g[Y]=G,$<=D){var le=s-D;if((M>7e3||B>24576)&&(le>423||!u)){c=rB(t,l,0,I,P,T,E,B,U,D-U,c),B=M=E=0,U=D;for(var se=0;se<286;++se)P[se]=0;for(var se=0;se<30;++se)T[se]=0}var X=2,ee=0,Ee=d,je=G-ne&32767;if(le>2&&Y==S(D-je))for(var Le=Math.min(f,le)-1,He=Math.min(32767,D),xe=Math.min(258,le);je<=He&&--Ee&&G!=ne;){if(t[D+X]==t[D+X-je]){for(var Pe=0;Pe<xe&&t[D+Pe]==t[D+Pe-je];++Pe);if(Pe>X){if(X=Pe,ee=je,Pe>Le)break;for(var Zr=Math.min(je,Pe-2),Tr=0,se=0;se<Zr;++se){var nn=D-je+se&32767,L=y[nn],ue=nn-L&32767;ue>Tr&&(Tr=ue,ne=nn)}}}G=ne,ne=y[G],je+=G-ne&32767}if(ee){I[B++]=268435456|D3[X]<<18|eB[ee];var k=D3[X]&31,be=eB[ee]&31;E+=b1[k]+_1[be],++P[257+k],++T[be],$=D+X,++M}else I[B++]=t[D],++P[t[D]]}}for(D=Math.max(D,$);D<s;++D)I[B++]=t[D],++P[t[D]];c=rB(t,l,u,I,P,T,E,B,U,D-U,c),u||(o.r=c&7|l[c/8|0]<<3,c-=7,o.h=g,o.p=y,o.i=D,o.w=$)}else{for(var D=o.w||0;D<s+u;D+=65535){var pe=D+65535;pe>=s&&(l[c/8|0]=u,pe=s),c=sB(l,c+1,t.subarray(D,pe))}o.i=s}return xg(a,0,n+fI(c)+i)},OBe=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var r=e,n=9;--n;)r=(r&1&&-306674912)^r>>>1;t[e]=r}return t}(),kBe=function(){var t=-1;return{p:function(e){for(var r=t,n=0;n<e.length;++n)r=OBe[r&255^e[n]]^r>>>8;t=r},d:function(){return~t}}},Pse=function(t,e,r,n,i){if(!i&&(i={l:1},e.dictionary)){var o=e.dictionary.subarray(-32768),s=new Bn(o.length+t.length);s.set(o),s.set(t,o.length),t=s,i.w=o.length}return Ise(t,e.level==null?6:e.level,e.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,r,n,i)},lB=function(t,e){var r={};for(var n in t)r[n]=t[n];for(var n in e)r[n]=e[n];return r},cse=function(t,e,r){for(var n=t(),i=t.toString(),o=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),s=0;s<n.length;++s){var a=n[s],l=o[s];if(typeof a=="function"){e+=";"+l+"=";var u=a.toString();if(a.prototype)if(u.indexOf("[native code]")!=-1){var c=u.indexOf(" ",8)+1;e+=u.slice(c,u.indexOf("(",c))}else{e+=u;for(var p in a.prototype)e+=";"+l+".prototype."+p+"="+a.prototype[p].toString()}else e+=u}else r[l]=a}return e},E3=[],FBe=function(t){var e=[];for(var r in t)t[r].buffer&&e.push((t[r]=new t[r].constructor(t[r])).buffer);return e},RBe=function(t,e,r,n){if(!E3[r]){for(var i="",o={},s=t.length-1,a=0;a<s;++a)i=cse(t[a],i,o);E3[r]={c:cse(t[s],i,o),e:o}}var l=lB({},E3[r].e);return DBe(E3[r].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",r,l,FBe(l),n)},NBe=function(){return[Bn,sa,pI,b1,_1,uI,oB,yse,vse,bse,cI,_se,Mu,M3,Eu,A3,fI,xg,Ki,wse,cB,N3,Cse]},BBe=function(){return[Bn,sa,pI,b1,_1,uI,D3,eB,gse,Ih,xse,x1,cI,Sse,aB,Mu,rf,g1,L3,O3,tB,v1,sB,rB,fI,xg,Ise,Pse,uB,N3]},N3=function(t){return postMessage(t,[t.buffer])},Cse=function(t){return t&&{out:t.size&&new Bn(t.size),dictionary:t.dictionary}},Tse=function(t,e,r,n,i,o){var s=RBe(r,n,i,function(a,l){s.terminate(),o(a,l)});return s.postMessage([t,e],e.consume?[t.buffer]:[]),function(){s.terminate()}},nf=function(t,e){return t[e]|t[e+1]<<8},Vc=function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0},QN=function(t,e){return Vc(t,e)+Vc(t,e+4)*4294967296},as=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};Ese=function(t,e,r,n){for(var i in t){var o=t[i],s=e+i,a=n;Array.isArray(o)&&(a=lB(n,o[1]),o=o[0]),o instanceof Bn?r[s]=[o,a]:(r[s+="/"]=[new Bn(0),a],Ese(o,s,r,n))}},pse=typeof TextEncoder<"u"&&new TextEncoder,nB=typeof TextDecoder<"u"&&new TextDecoder,UBe=0;try{nB.decode(aB,{stream:!0}),UBe=1}catch{}GBe=function(t){for(var e="",r=0;;){var n=t[r++],i=(n>127)+(n>223)+(n>239);if(r+i>t.length)return{s:e,r:xg(t,r-1)};i?i==3?(n=((n&15)<<18|(t[r++]&63)<<12|(t[r++]&63)<<6|t[r++]&63)-65536,e+=String.fromCharCode(55296|n>>10,56320|n&1023)):i&1?e+=String.fromCharCode((n&31)<<6|t[r++]&63):e+=String.fromCharCode((n&15)<<12|(t[r++]&63)<<6|t[r++]&63):e+=String.fromCharCode(n)}};jBe=function(t,e){return e+30+nf(t,e+26)+nf(t,e+28)},$Be=function(t,e,r){var n=nf(t,e+28),i=pB(t.subarray(e+46,e+46+n),!(nf(t,e+8)&2048)),o=e+46+n,s=Vc(t,e+20),a=r&&s==4294967295?qBe(t,o):[s,Vc(t,e+24),Vc(t,e+42)],l=a[0],u=a[1],c=a[2];return[nf(t,e+10),l,u,i,o+nf(t,e+30)+nf(t,e+32),c]},qBe=function(t,e){for(;nf(t,e)!=1;e+=4+nf(t,e+2));return[QN(t,e+12),QN(t,e+4),QN(t,e+20)]},iB=function(t){var e=0;if(t)for(var r in t){var n=t[r].length;n>65535&&Ki(9),e+=n+4}return e},fse=function(t,e,r,n,i,o,s,a){var l=n.length,u=r.extra,c=a&&a.length,p=iB(u);as(t,e,s!=null?33639248:67324752),e+=4,s!=null&&(t[e++]=20,t[e++]=r.os),t[e]=20,e+=2,t[e++]=r.flag<<1|(o<0&&8),t[e++]=i&&8,t[e++]=r.compression&255,t[e++]=r.compression>>8;var f=new Date(r.mtime==null?Date.now():r.mtime),d=f.getFullYear()-1980;if((d<0||d>119)&&Ki(10),as(t,e,d<<25|f.getMonth()+1<<21|f.getDate()<<16|f.getHours()<<11|f.getMinutes()<<5|f.getSeconds()>>1),e+=4,o!=-1&&(as(t,e,r.crc),as(t,e+4,o<0?-o-2:o),as(t,e+8,r.size)),as(t,e+12,l),as(t,e+14,p),e+=16,s!=null&&(as(t,e,c),as(t,e+6,r.attrs),as(t,e+10,s),e+=14),t.set(n,e),e+=l,p)for(var m in u){var y=u[m],g=y.length;as(t,e,+m),as(t,e+2,g),t.set(y,e+4),e+=4+g}return c&&(t.set(a,e),e+=c),e},HBe=function(t,e,r,n,i){as(t,e,101010256),as(t,e+8,r),as(t,e+10,r),as(t,e+12,n),as(t,e+16,i)};F3=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(t){t()}});var WBe,ZBe,B3,XBe,z3,fB=h(()=>{ht();WBe=t=>{if(t!=null)return t.trim()===""?void 0:t},ZBe=t=>t!=null,B3=(t,e,r=0)=>{if(A.IsNull(t))return"null";if(A.IsUndefined(t))return"undefined";if(A.IsString(t))return"<string>";if(A.IsNumber(t))return"<number>";if(A.IsBoolean(t))return"<boolean>";if(A.IsLiteral(t))return typeof t.const=="string"?`'${t.const}'`:`${t.const}`;if(A.IsRef(t)){let n=e.find(i=>i.$id===t.$ref);return n==null?t.$ref:B3(n,e,r)}if(A.IsArray(t))return`${B3(t.items,e,r+1)}[]`;if(A.IsUnion(t)&&(!(t.anyOf.length>5)||t.$id==null)){let i=`${t.anyOf.map(o=>B3(o,e,r+1)).filter(ZBe).join(" | ")}`;return r>0?`(${i})`:i}return t.$id??""},XBe=(t,e,r)=>{let n=e.message;return A.IsUnion(e.schema)&&(n=`Expected one of: ${B3(e.schema,r)}`),`${`#/definitions/${t}${WBe(e.path)??""}`}: ${n}`},z3=(t,e,r)=>{let n=e.First();if(n!=null)return XBe(t,n,r)}});var w1,S1,YBe,KBe,JBe,QBe,e7e,hB,dB=h(()=>{lm();y1();hI();fB();(function(t){t.Archive="Archive",t.Validate="Validate",t.Encode="Encode",t.Unknown="Unknown"})(w1||(w1={}));S1=class extends Error{constructor(r,n){super(n);C(this,"name");C(this,"kind");this.name="CompressError",this.kind=r}},YBe=t=>new S1(w1.Archive,t.message),KBe=t=>{let e=Object.values(R3);return t instanceof Error&&"code"in t&&typeof t.code=="number"&&e.includes(t.code)},JBe=(t,e,r)=>new S1(w1.Validate,z3(t,e,r)??"Unknown validate error"),QBe=t=>new S1(w1.Encode,t.message),e7e=t=>new S1(w1.Unknown,t instanceof Error?t.message:String(t)),hB=(t,e,r)=>e instanceof mg?QBe(e):e instanceof Cu?JBe(t,e,r):KBe(e)?YBe(e):e7e(e)});var I1,P1,t7e,r7e,n7e,i7e,o7e,mB,yB=h(()=>{lm();y1();hI();fB();(function(t){t.Unarchive="Unarchive",t.Validate="Validate",t.Decode="Decode",t.Unknown="Unknown"})(I1||(I1={}));P1=class extends Error{constructor(r,n){super(n);C(this,"name");C(this,"kind");this.name="DecompressError",this.kind=r}},t7e=t=>new P1(I1.Unarchive,t.message),r7e=t=>{let e=Object.values(R3);return t instanceof Error&&"code"in t&&typeof t.code=="number"&&e.includes(t.code)},n7e=(t,e,r)=>new P1(I1.Validate,z3(t,e,r)??"Unknown validate error"),i7e=t=>new P1(I1.Decode,t.message),o7e=t=>new P1(I1.Unknown,t instanceof Error?t.message:String(t)),mB=(t,e,r)=>e instanceof dg?i7e(e):e instanceof Cu?n7e(t,e,r):r7e(e)?t7e(e):o7e(e)});var s7e,a7e,l7e,V3,gB=h(()=>{s7e=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,a7e=[0,31,28,31,30,31,30,31,31,30,31,30,31],l7e=t=>t%4===0&&(t%100!==0||t%400===0),V3=t=>{let e=s7e.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],i=+e[3];return n>=1&&n<=12&&i>=1&&i<=(n===2&&l7e(r)?29:a7e[n])}});var u7e,U3,vB=h(()=>{u7e=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i,U3=t=>{let e=u7e.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],i=+e[3],o=e[4],s=e[5]==="-"?-1:1,a=+(e[6]||0),l=+(e[7]||0);if(a>23||l>59||!o)return!1;if(r<=23&&n<=59&&i<60)return!0;let u=n-l*s,c=r-a*s-(u<0?1:0);return(c===23||c===-1)&&(u===59||u===-1)&&i<61}});var c7e,Lse,Dse=h(()=>{gB();vB();c7e=/t|\s/i,Lse=t=>{let e=t.split(c7e);return e.length===2&&V3(e[0])&&U3(e[1])}});var p7e,f7e,Ose,kse=h(()=>{p7e=/\/|:/,f7e=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,Ose=t=>p7e.test(t)&&f7e.test(t)});var h7e,Fse,Rse=h(()=>{hg();Dse();gB();vB();kse();h7e=[["date",V3],["time",U3],["date-time",Lse],["uri",Ose]],Fse=()=>{for(let[t,e]of h7e)try{s3.Format(t,e)}catch(r){if(r instanceof oI)continue;throw r}}});var Nse,Bse=h(()=>{Nse=t=>t instanceof Error?t:new Error(String(t))});var G3,xB=h(()=>{Kn();Bse();G3=t=>(...e)=>{try{return ge(t(...e))}catch(r){return Ie(Nse(r))}}});var d7e,bB,zse=h(()=>{Kn();xB();hI();d7e=G3((t,e)=>{let r={};for(let n of e)for(let i of n.intoBundle(t))r[i.path]=k3(JSON.stringify(i.contents));return r}),bB=async(t,e,r)=>d7e(t,e).andThenAsync(n=>new Promise(i=>{Mse(n,{...r,consume:!0},(o,s)=>{i(o?Ie(o):ge(s))})}))});function j3(t,e,r=[]){let n={...t};for(let[i,o]of Object.entries(e))if(o!==void 0)if(i in n){let s=i;if(Array.isArray(o)&&o.length>0){let a=m7e(o[0],r);if(a){let l=n[s];if(!Array.isArray(l))throw new Error(`Expected array at ${i}, got ${typeof l}`);let u=new Map(o.map(f=>[Vse(f,a),f])),p=l.map(f=>{let d=u.get(Vse(f,a));return d?j3(f,d,r):f});n[s]=p}else n[s]=o}else{let a=n[s];typeof a=="object"&&a!==null&&typeof o=="object"&&o!==null?Object.keys(o).length===0?n[s]=o:n[s]=j3(a,o,r):n[i]=o}}else n[i]=o;return n}function m7e(t,e){function r(n){if(typeof n!="object"||n===null)return null;for(let i of e)if(i in n&&typeof n[i]<"u")return[i];if(Array.isArray(n))return null;for(let[i,o]of Object.entries(n)){let s=r(o);if(s)return[i,...s]}return null}return r(t)}function Vse(t,e){return e.reduce((r,n)=>{if(r&&typeof r=="object")return r[n]},t)}var _B=h(()=>{});var y7e,g7e,v7e,x7e,wB,Use=h(()=>{Kn();xB();hI();_B();y7e=t=>t,g7e=t=>JSON.parse(pB(t)),v7e=(t,e)=>e.some(r=>r.fromBundle(t.name,new Uint8Array,y7e)!==void 0),x7e=G3((t,e)=>{let r={};for(let n of Object.keys(t)){let i=t[n];for(let o of e){let s=o.fromBundle(n,i,g7e);if(s){r=j3(r,s,[]);break}}}return r}),wB=async(t,e)=>new Promise(r=>Ase(t,{filter:n=>v7e(n,e)},(n,i)=>{r(n?Ie(n):ge(i))})).then(r=>r.andThen(n=>x7e(n,e)))});var b7e,_7e,$3,Gse=h(()=>{b7e=t=>typeof t=="object"&&t!=null&&"$ref"in t&&typeof t.$ref=="string",_7e=t=>{if(t.length<2)return!1;let e=t.filter(b7e);if(e.length!==t.length)return!1;let r=e[0].$ref;return e.slice(1).every(n=>n.$ref===r)},$3=t=>typeof t=="object"&&t!=null&&"allOf"in t&&Array.isArray(t.allOf)&&_7e(t.allOf)?t.allOf[0]:typeof t=="object"&&t!=null&&!Array.isArray(t)?Object.fromEntries(Object.entries(t).map(([e,r])=>[e,$3(r)])):Array.isArray(t)?t.map($3):t});var q3,jse=h(()=>{q3=t=>typeof t=="object"&&t!=null&&"$ref"in t?{...t,$ref:`#/definitions/${t.$ref}`}:typeof t=="object"&&t!=null&&!Array.isArray(t)?Object.fromEntries(Object.entries(t).map(([e,r])=>[e,q3(r)])):Array.isArray(t)?t.map(q3):t});var C1,w7e,S7e,Au,bg,Ph,Uc,SB,H3,IB=h(()=>{Kn();ise();sse();ht();lse();a1();om();dB();yB();Rse();aa();tI();tN();hN();zse();Use();Gse();jse();(function(t){t.InvalidTypeboxSchema="InvalidTypeboxSchema",t.MissingReferenceId="MissingReferenceId",t.DuplicateReferenceId="DuplicateReferenceId",t.TypeboxError="TypeboxError",t.UnknownError="UnknownError"})(C1||(C1={}));w7e=t=>({next(){for(let r of t){let n=r.next();if(!n.done)return n}return{done:!0,value:void 0}},[Symbol.iterator](){return this}}),S7e=(...t)=>{let e=new Map;for(let r of w7e(t)){if(!r.$id)continue;let n=e.get(r.$id);if(n!=null&&n!==r)return Ie({kind:C1.DuplicateReferenceId,message:"Failed to register a reference for a schema with an $id that has already been used",schema:r});e.set(r.$id,r)}return ge(e)},SB=class SB{constructor(e,r,n,i){O(this,Au);O(this,bg);O(this,Ph,[]);O(this,Uc);N(this,Au,e),N(this,bg,r),N(this,Ph,n),N(this,Uc,i),this.is=this.is.bind(this),this.parse=this.parse.bind(this),this.verify=this.verify.bind(this),this.jsonSchema=this.jsonSchema.bind(this),this.compress=this.compress.bind(this),this.decompress=this.decompress.bind(this)}static create(e,r="CoreMVF"){let n=_.Composite(e.extensions.map(o=>o.schema),{$id:r});if(!A.IsSchema(n))return Ie({kind:C1.InvalidTypeboxSchema,message:"Attempting to merge schemas produced an invalid schema",schema:n});let i=S7e(iN.values(),Y8.values(),J8.values(),eN.values(),rN.values(),fN.values(),e.extensions.flatMap(o=>o.references??[]).values());if(!i.isOk())return i;try{Fse();let o=T3.Compile(n,[...i.value.values()]);return ge(new SB(n,o,e.extensions,i.value))}catch(o){return o instanceof Ze?Ie({kind:C1.TypeboxError,message:o.message,original:o}):Ie({kind:C1.UnknownError,message:"An unknown error occurred while compiling the schema",original:o})}}is(e){return v(this,bg).Check(e)}parse(e){return v(this,bg).Check(e)?ge(e):Ie(v(this,bg).Errors(e))}decode(e){try{return ge(nse(v(this,Au),[...v(this,Uc).values()],e))}catch(r){return Ie(r)}}encode(e){try{return ge(ose(v(this,Au),[...v(this,Uc).values()],e))}catch(r){return Ie(r)}}verify(e){for(let r of v(this,Ph))if(r.integrityCheck){let n=r.integrityCheck(e);if(n.isErr())return Ie(n.error)}return ge(!0)}jsonSchema(){let e=JSON.parse(JSON.stringify([v(this,Au),...v(this,Uc).values()])),r=$3(q3({$id:`#/definitions/${v(this,Au).$id??"CoreMVF"}`,$schema:"http://json-schema.org/draft-07/schema#",references:e}));return JSON.stringify(r,null,2)}async compress(e){return this.encode(e).andThen(r=>this.parse(r)).andThenAsync(r=>bB(r,v(this,Ph))).then(r=>r.mapErr(n=>hB(v(this,Au).$id??"CoreMVF",n,[...v(this,Uc).values()])))}async compressUnsafe(e){return this.encode(e).andThenAsync(r=>bB(r,v(this,Ph))).then(r=>r.mapErr(n=>hB(v(this,Au).$id??"CoreMVF",n,[...v(this,Uc).values()])))}async decompress(e){return wB(e,v(this,Ph)).then(r=>r.andThen(n=>this.parse(n)).andThen(n=>this.decode(n)).mapErr(n=>mB(v(this,Au).$id??"CoreMVF",n,[...v(this,Uc).values()])))}async decompressUnsafe(e){return wB(e,v(this,Ph)).then(r=>r.andThen(n=>this.decode(n)).mapErr(n=>mB(v(this,Au).$id??"CoreMVF",n,[...v(this,Uc).values()])))}};Au=new WeakMap,bg=new WeakMap,Ph=new WeakMap,Uc=new WeakMap;H3=SB});var T1,W3,$se=h(()=>{ht();IB();W3=class{constructor(){O(this,T1,[]);this.extend=this.extend.bind(this)}extend(e){return v(this,T1).push(e),this}extendOptional(e){let r={...e,schema:_.Partial(e.schema)};return v(this,T1).push(r),this}build(){return H3.create(this)}get extensions(){return v(this,T1)}};T1=new WeakMap});var qse=h(()=>{rI();dB();yB()});var Hse,aa=h(()=>{Uie();Yie();roe();$se();pN();qse();Su();IB();_B();Hse=()=>new W3().extend(Vie).extend(Xie).extend(toe)});var _g,PB,Wse,Z3=h(()=>{aa();ia();ht();_g=si("lcat","LocationCategoryId"),PB=_.Intersect([_.Object({id:_.Ref(_g),parent:_.Optional(_.Ref(_g))}),cg(["name"]),Nc],{$id:"LocationCategory"}),Wse=[_g,PB]});var wg,Zse=h(()=>{(function(t){t.UnknownCategoryError="UnknownCategoryError",t.UnknownParentCategoryError="UnknownParentCategoryError",t.UnknownParentLocationError="UnknownParentLocationError"})(wg||(wg={}))});var Xse,Yse=h(()=>{Wp();Kn();Zse();Xse=t=>{if(t.locationCategories==null&&t.locations==null)return ge(!0);let e=new Set(t.locationCategories?.map(i=>i.id)??[]);for(let i of t.locationCategories??[])if(i.parent!=null&&!e.has(i.parent))return Ie({kind:wg.UnknownParentCategoryError,properties:{categoryId:i.id,parentCategoryId:i.parent}});let r=go(t);for(let i of t.locations??[]){for(let o of i.categories)if(!e.has(o))return Ie({kind:wg.UnknownCategoryError,properties:{locationId:i.id,categoryId:o}});for(let o of i.geometryAnchors){let s=r(o.floorId,o.geometryId);if(s.isErr())return s}}let n=new Set(t.locations?.map(i=>i.id)??[]);for(let i of t.locationInstances??[]){if(!n.has(i.parentId))return Ie({kind:wg.UnknownParentLocationError,properties:{locationInstanceId:i.id,parentLocationId:i.parentId}});for(let o of i.categories??[])if(!e.has(o))return Ie({kind:wg.UnknownCategoryError,properties:{locationId:i.id,categoryId:o}});for(let o of i.geometryAnchors??[]){let s=r(o.floorId,o.geometryId);if(s.isErr())return s}}return ge(!0)}});var Sg,X3,Kse,Jse,CB,TB,Qse,I7e,EB,Y3,K3,MB,J3,AB=h(()=>{aa();ia();ht();Z3();Sg=si("loc","LocationId"),X3=si("loci","LocationInstanceId"),Kse=_.Object({name:_.String(),url:_.String({format:"uri"})},{$id:"LocationSocial"}),Jse=_.Object({url:_.String({format:"uri"})},{$id:"LocationImage"}),CB=_.Object({label:_.String(),url:_.String({format:"uri"})},{$id:"LocationLink"}),TB=_.String({pattern:"^[0-2][0-9]:[0-6][0-9](:[0-6][0-9])?$",$id:"OpeningHoursTime"}),Qse=_.Union([_.Literal("Sunday"),_.Literal("Monday"),_.Literal("Tuesday"),_.Literal("Wednesday"),_.Literal("Thursday"),_.Literal("Friday"),_.Literal("Saturday")],{$id:"OpeningHoursDay"}),I7e="PublicHolidays",EB=_.Union([Qse,_.Literal(I7e)],{$id:"OpeningHoursDayOrPublicHoliday"}),Y3=_.Object({"@type":_.Optional(_.Literal("OpeningHoursSpecification",{description:"The type of opening hours"})),opens:_.Optional(_.Ref(TB,{description:"The time the opening hours start"})),closes:_.Optional(_.Ref(TB,{description:"The time the opening hours end"})),dayOfWeek:_.Optional(_.Union([_.Ref(EB),_.Array(_.Ref(EB))],{description:"The days of the week the opening hours apply to"})),validFrom:_.Optional(_.String({format:"date-time",description:"The date the opening hours start, in ISO 8601 format"})),validTo:_.Optional(_.String({format:"date-time",description:"The date the opening hours end, in ISO 8601 format"}))},{$id:"OpeningHoursSpecification"}),K3=_.Intersect([_.Object({id:_.Ref(Sg),categories:_.Array(_.Ref(_g)),logo:_.Optional(_.String({format:"uri"})),phone:_.Optional(_.String()),social:_.Array(_.Ref(Kse)),images:_.Array(_.Ref(Jse)),links:_.Array(_.Ref(CB)),website:_.Optional(_.Ref(CB)),openingHours:_.Optional(_.Array(_.Ref(Y3)))}),cg(["name"]),pg(),Nc],{$id:"Location"}),MB=_.Intersect([_.Object({id:_.Ref(X3),parentId:_.Ref(Sg)}),_.Partial(_.Omit(K3,["id","parentId"]))],{$id:"LocationInstance"}),J3=[Sg,X3,Kse,Jse,CB,TB,Qse,EB,Y3,K3,MB]});var P7e,eae,tae,rae,nae,cm=h(()=>{ht();Z3();Yse();AB();AB();Z3();P7e=_.Object({locations:_.Array(_.Ref(K3)),locationCategories:_.Array(_.Ref(PB)),locationInstances:_.Optional(_.Array(_.Ref(MB)))},{$id:"LocationsExtensionSchema"}),eae="locations.json",tae="location-categories.json",rae="location-instances.json",nae={name:"ext:locations",schema:P7e,intoBundle:function*(t){t.locations!=null&&(yield{path:eae,contents:t.locations}),t.locationCategories!=null&&(yield{path:tae,contents:t.locationCategories}),t.locationInstances!=null&&(yield{path:rae,contents:t.locationInstances})},fromBundle:(t,e,r)=>{if(t===eae)return{locations:r(e)};if(t===tae)return{locationCategories:r(e)};if(t===rae)return{locationInstances:r(e)}},references:[...Wse,...J3],integrityCheck:Xse}});var of,iae=h(()=>{(function(t){t.UnknownEnterpriseLocationError="UnknownEnterpriseLocationError",t.EnterpriseLocationWithUnknownLocationError="EnterpriseLocationWithUnknownLocationError",t.EnterpriseCategoryWithUnknownLocationCategoryError="EnterpriseCategoryWithUnknownLocationCategoryError",t.InstanceWithUnknownLocationInstanceError="InstanceWithUnknownLocationInstanceError",t.InstanceWithUnknownEnterpriseLocationError="InstanceWithUnknownEnterpriseLocationError",t.EnterpriseLocationWithUnknownSibling="EnterpriseLocationWithUnknownSibling",t.EnterpriseLocationInstanceWithUnknownSibling="EnterpriseLocationInstanceWithUnknownSibling"})(of||(of={}))});var oae,sae=h(()=>{aa();gi();Kn();iae();oae=t=>{if(t.enterprise==null)return ge(!0);let e=t.enterprise,r=new Set(t.locationCategories?.map(l=>l.id)??[]);for(let l of e.categories??[])if(!r.has(l.categoryId))return Ie({kind:of.EnterpriseCategoryWithUnknownLocationCategoryError,properties:{enterpriseCategoryId:l.id,locationCategoryId:l.categoryId}});let n=new Set(t.locations?.map(l=>l.id)??[]);for(let l of e.locations??[]){if(!n.has(l.locationId))return Ie({kind:of.EnterpriseLocationWithUnknownLocationError,properties:{enterpriseLocationId:l.id,locationId:l.locationId}});for(let u of l.siblingGroups??[])for(let c of u.siblings??[])if(!n.has(c))return Ie({kind:of.EnterpriseLocationWithUnknownSibling,properties:{enterpriseLocationId:l.id,siblingLocationId:c,label:u.label}})}let i=new Set(t.enterprise.locations?.map(l=>l.id)??[]);if(e.venue?.topLocations!=null){for(let l of e.venue.topLocations)if(!i.has(l))return Ie({kind:of.UnknownEnterpriseLocationError,properties:{enterpriseLocationId:l}})}let o=new Set(t.locationInstances?.map(l=>l.id)??[]);for(let l of e.locationInstances??[]){if(!i.has(l.parentId))return Ie({kind:of.InstanceWithUnknownEnterpriseLocationError,properties:{enterpriseLocationInstanceId:l.id,enterpriseLocationId:l.parentId}});if(!o.has(l.locationInstanceId))return Ie({kind:of.InstanceWithUnknownLocationInstanceError,properties:{enterpriseLocationInstanceId:l.id,locationInstanceId:l.locationInstanceId}});for(let u of l.siblingGroups??[])for(let c of u.siblings??[])if(!n.has(c))return Ie({kind:of.EnterpriseLocationInstanceWithUnknownSibling,properties:{enterpriseLocationInstanceId:l.id,siblingLocationId:c,label:u.label}})}let s=xh(t),a=go(t);for(let[l,u]of kr(e.floorText??{})){let c=s(l);if(c.isErr())return c;for(let p of u.features){if(!("geometryId"in p.properties))continue;let f=a(l,p.properties.geometryId);if(f.isErr())return f}}for(let[l,u]of kr(e.textures??{})){let c=s(l);if(c.isErr())return c;for(let p of u){let f=a(l,p.geometryId);if(f.isErr())return f}}for(let[l,u]of kr(e.layers??{})){let c=s(l);if(c.isErr())return c;for(let p of Pr(u??{})){let f=a(l,p);if(f.isErr())return f}}for(let[l,u]of kr(e.textAreas??{})){let c=s(l);if(c.isErr())return c;for(let p of u.features)if("geometryId"in p.properties){let f=a(l,p.properties.geometryId);if(f.isErr())return f}}return ge(!0)}});var Ig,LB,DB,OB,kB,aae,Pg=h(()=>{aa();Ig=si("el","EnterpriseLocationId"),LB=si("ec","EnterpriseCategoryId"),DB=si("eli","EnterpriseLocationInstanceId"),OB=si("ev","EnterpriseVenueId"),kB=si("eft","EnterpriseFloorTextId"),aae=[Ig,LB,DB,OB,kB]});var lae,FB,uae,cae=h(()=>{cm();ht();Pg();lae=_.Object({id:_.Ref(LB),categoryId:_.Ref(_g),color:_.Optional(_.String()),sortOrder:_.Number(),iconFromDefaultList:_.Optional(_.Union([_.String(),_.Null()])),picture:_.Optional(_.String({format:"uri",description:"The category's picture"}))},{$id:"EnterpriseCategory"}),FB=_.Object({categories:_.Optional(_.Array(_.Ref(lae)))},{$id:"EnterpriseCategoriesSchema"}),uae=[lae,FB]});var pae,C7e,Fqt,RB,NB,BB,fae,hae,T7e,E7e,dae,mae,zB,yae,gae=h(()=>{aa();aa();ht();Pg();pae=Ua(["left","center","right"]),C7e=pae.schema,Fqt=pae.values,RB=_.Object({id:_.Ref(kB),text:_.String(),visible:_.Boolean({default:!0}),fontSize:_.Number({default:12,minimum:1}),fontFamily:_.String({default:"Droid Sans"}),color:_.String({default:"black"}),rotation:_.Number({minimum:0,maximum:360}),align:C7e},{$id:"FloorTextCommonProperties"}),NB=_.Intersect([_.Ref(RB),wu],{$id:"AnchoredFloorTextProperties"}),BB=_.Intersect([_.Ref(RB),_.Object({verticalOffset:_.Number()})],{$id:"FloatingFloorTextProperties"}),fae=_.Union([_.Ref(NB),_.Ref(BB)],{$id:"FloorTextProperties"}),hae=is(Es,_.Ref(fae),{$id:"FloorTextFeature"}),T7e=is(Es,_.Ref(NB),{$id:"AnchoredFloorTextFeature"}),E7e=is(Es,_.Ref(BB),{$id:"FloatingFloorTextFeature"}),dae=oa(_.Ref(hae),{$id:"EnterpriseFloorTextFeatureCollection"}),mae=_.Record(Or,_.Ref(dae),{$id:"EnterpriseFloorTextCollectionsByFloor",additionalProperties:!1}),zB=_.Object({floorText:_.Optional(_.Ref(mae))},{$id:"EnterpriseFloorTextSchema"}),yae=[RB,NB,BB,fae,hae,T7e,E7e,dae,mae,zB]});var vae,xae,VB,bae,_ae=h(()=>{aa();ia();ht();vae=Ii(_.Record(Ts,_.String({minLength:1}),{additionalProperties:!1,$id:"EnterpriseLayers"})),xae=Ii(_.Record(Or,_.Ref(vae),{additionalProperties:!1,$id:"EnterpriseLayersByFloor"})),VB=_.Object({layers:_.Optional(_.Ref(xae))},{$id:"EnterpriseLayersSchema"}),bae=[vae,xae,VB]});var UB,M7e,$qt,qqt,GB,jB,Q3,wae,eA=h(()=>{aa();cm();ht();UB=Ua(["closed-temporarily","new","pop-up","coming-soon","relocated"]),M7e=UB.schema,$qt=UB.values,qqt=UB.record,GB=_.Object({type:M7e,start:_.Optional(_.String({format:"date",description:"The start date of the state"})),end:_.Optional(_.String({format:"date",description:"The end date of the state"}))},{$id:"LocationState",description:"The state of a location. Start and end dates are optional."}),jB=_.Object({label:_.String(),siblings:_.Array(_.Ref(Sg))},{$id:"SiblingGroup"}),Q3=_.Object({name:_.String(),code:_.String()},{$id:"Language"}),wae=[GB,jB,Q3]});var tA,$B,Sae,qB=h(()=>{cm();ht();Pg();eA();tA=_.Object({id:_.Ref(Ig),locationId:_.Ref(Sg),type:_.String(),sortOrder:_.Number(),tags:_.Optional(_.Array(_.String())),picture:_.Optional(_.String({format:"uri",description:"The picture of the location"})),states:_.Optional(_.Array(_.Ref(GB),{description:"The location's state. No more than one state should be active at a time, and all but at most one should have dates set"})),siblingGroups:_.Optional(_.Array(_.Ref(jB))),gallery:_.Optional(_.Array(_.Object({caption:_.Optional(_.String()),image:_.String({format:"uri"}),embeddedUrl:_.Optional(_.String({format:"uri",description:"The URL to link from the image"}))},{description:"The location's image gallery"}),{description:"The location's image gallery"})),showFloatingLabelWhenImagePresent:_.Optional(_.Boolean({description:"Whether to show the flat label when an image is present"})),amenity:_.Optional(_.String({description:"The location's amenity type. Only set if the location is an amenity"})),showLogo:_.Optional(_.Boolean({description:"Whether to show the logo of the location"}))},{$id:"EnterpriseLocation"}),$B=_.Object({locations:_.Optional(_.Array(_.Ref(tA)))},{$id:"EnterpriseLocationsSchema"}),Sae=[tA,$B]});var Iae,HB,Pae,Cae=h(()=>{cm();ht();qB();Pg();Iae=_.Intersect([_.Object({id:_.Ref(DB),parentId:_.Ref(Ig),locationInstanceId:_.Ref(X3)}),_.Partial(_.Omit(tA,["id","parentId","locationId"]))],{$id:"EnterpriseLocationInstance",description:"A locationInstance is a particular instance of an Enterprise Location that has some properties different from the parent."}),HB=_.Object({locationInstances:_.Optional(_.Array(_.Ref(Iae)))},{$id:"EnterpriseLocationInstancesSchema"}),Pae=[Iae,HB]});var WB,Tae,aHt,lHt,ZB,Eae,Mae,Aae,Lae,Dae,Oae,kae,Fae,Rae=h(()=>{nI();ia();Su();ht();WB=Ua(["near","center"],{$id:"EnterpriseTextAreaAlignment"}),Tae=WB.schema,aHt=WB.values,lHt=WB.record,ZB=_.Object({maxWidth:_.Number({exclusiveMinimum:0,description:"The maximum width of the label, in meters."}),maxHeight:_.Number({exclusiveMinimum:0,description:"The maximum height of the label, in meters."}),align:_.Ref(Tae),rotation:_.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"EnterpriseBaseTextAreaProperties"}),Eae=_.Intersect([_.Ref(ZB),wu],{$id:"EnterpriseAnchoredTextAreaProperties"}),Mae=_.Intersect([_.Ref(ZB),_.Object({verticalOffset:_.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"EnterpriseFloatingTextAreaProperties"}),Aae=_.Union([Eae,Mae],{$id:"EnterpriseTextAreaProperties"}),Lae=is(_.Ref(Es),Aae,{$id:"EnterpriseTextAreaFeature"}),Dae=oa(_.Ref(Lae),{$id:"EnterpriseTextAreaCollection"}),Oae=_.Record(Or,_.Ref(Dae),{$id:"EnterpriseTextAreasByFloor",additionalProperties:!1}),kae=_.Object({textAreas:_.Optional(_.Ref(Oae))},{$id:"EnterpriseTextAreasSchema"}),Fae=[Tae,ZB,Eae,Mae,Aae,Lae,Dae,Oae]});var XB,YB,Nae,fHt,hHt,KB,Bae,dHt,mHt,zae,Vae,Uae,Gae,JB,jae,$ae=h(()=>{aa();ht();XB=_.Object({u:_.Number(),v:_.Number()},{$id:"EnterpriseTextureUV"}),YB=Ua(["top","side"],{$id:"EnterpriseTextureFace"}),Nae=YB.schema,fHt=YB.values,hHt=YB.record,KB=Ua(["inside","outside","both"],{$id:"EnterpriseTextureSurface"}),Bae=KB.schema,dHt=KB.values,mHt=KB.record,zae=_.Tuple([n1,i1,n1,i1],{$id:"EnterpriseTextureBounds"}),Vae=_.Intersect([_.Object({repeat:_.Ref(XB),offset:_.Ref(XB),rotation:_.Number({minimum:0,maximum:360}),path:_.String({format:"uri"}),face:_.Ref(Nae),surface:_.Ref(Bae),bounds:_.Ref(zae)},{$id:"EnterpriseTextureProperties"}),wu],{$id:"EnterpriseTexture"}),Uae=_.Array(_.Ref(Vae),{$id:"EnterpriseTextures"}),Gae=_.Record(Or,_.Ref(Uae),{$id:"EnterpriseTexturesByFloor",additionalProperties:!1}),JB=_.Object({textures:_.Optional(_.Ref(Gae))},{$id:"EnterpriseTexturesSchema"}),jae=[Vae,Uae,JB,XB,Nae,Bae,zae,Gae]});var qae,QB,Hae,Wae=h(()=>{aa();cm();ht();Pg();eA();qae=_.Intersect([_.Object({id:_.Ref(OB),slug:_.String(),defaultLanguage:_.Ref(Q3),languages:_.Array(_.Ref(Q3)),countrycode:_.Optional(_.String()),logo:_.Optional(_.String({format:"uri"})),mappedinWebUrl:_.Optional(_.String({format:"uri"})),topLocations:_.Optional(_.Array(_.Ref(Ig))),operationHours:_.Optional(_.Array(_.Ref(Y3))),coverImage:_.Optional(_.String({format:"uri"}))}),cg(["name"]),Nc],{$id:"EnterpriseVenue"}),QB=_.Object({venue:_.Optional(_.Ref(qae))},{$id:"EnterpriseVenueSchema"}),Hae=[qae,QB]});var Xae,Zae,A7e,Yae,Kae=h(()=>{gi();cm();ht();sae();cae();gae();_ae();Cae();qB();Rae();$ae();Wae();Pg();eA();Xae=_.Intersect([QB,$B,HB,FB,JB,zB,VB,kae],{$id:"EnterpriseProperties"}),Zae=_.Object({enterprise:_.Optional(_.Ref(Xae))},{$id:"CMSExtensionSchema"}),A7e=/^enterprise\/(?:([^/]+)\/)?([^/]+)\.(?:json|geojson)$/,Yae={name:"ext:cms",schema:Zae,intoBundle:function*(t){if(t.enterprise==null)return;let e=t.enterprise;for(let r of Pr(e))switch(r){case"floorText":for(let n of Pr(e.floorText??{}))yield{path:`enterprise/floorText/${n}.geojson`,contents:(e.floorText??{})[n]};continue;case"textures":for(let n of Pr(e.textures??{}))yield{path:`enterprise/textures/${n}.json`,contents:(e.textures??{})[n]};continue;case"textAreas":for(let n of Pr(e.textAreas??{}))yield{path:`enterprise/textAreas/${n}.geojson`,contents:(e.textAreas??{})[n]};continue;default:yield{path:`enterprise/${r}.json`,contents:e[r]};continue}},fromBundle:(t,e,r)=>{let n=t.match(A7e);if(!n)return;let[,i,o]=n,s=r(e);switch(i){case"floorText":case"textures":case"textAreas":return{enterprise:{[i]:{[o]:s}}};default:return{enterprise:{[o]:s}}}},references:[Xae,Zae,...Hae,...Sae,...Pae,...uae,...jae,...bae,...yae,...Fae,...aae,...wae,...J3],integrityCheck:oae}});var Gc,e7=h(()=>{(function(t){t.NavigationFlagMissingDeclaration="NavigationFlagMissingDeclaration",t.NavigationFlagDuplicateBit="NavigationFlagDuplicateBit",t.NavigationFlagIncorrectFlagsLength="NavigationFlagIncorrectFlagsLength",t.NavigationFlagValueTooBig="NavigationFlagValueTooBig"})(Gc||(Gc={}))});var Jae,Qae=h(()=>{Kn();e7();Jae=t=>{let{navigationFlags:e}=t;if(!e||Object.keys(e).length===0)return ge(!0);let r=Object.entries(e).map(([o,s])=>({key:o,...s})).sort((o,s)=>o.index!==s.index?o.index-s.index:o.bit-s.bit),n=0,i=-1;for(let o of r){if(o.bit===i)return Ie({kind:Gc.NavigationFlagDuplicateBit,properties:{index:o.index,bit:o.bit,path:`navigationFlags.${o.key}`}});if(o.index!=n){if(i!=31)return Ie({kind:Gc.NavigationFlagMissingDeclaration,properties:{index:n,bit:i+1,path:"navigationFlags"}});if(o.index!=n+1||o.bit!=0)return Ie({kind:Gc.NavigationFlagMissingDeclaration,properties:{index:n+1,bit:0,path:"navigationFlags"}});n=o.index,i=0}else{if(o.bit!==i+1)return Ie({kind:Gc.NavigationFlagMissingDeclaration,properties:{index:o.index,bit:i+1,path:"navigationFlags"}});i=o.bit}}return ge(!0)}});function E1(t,e){return e&&(t.flags[e.index]&1<<e.bit)!==0}var ele=h(()=>{});var tle,dI,M1,rle=h(()=>{Kn();e7();tle=2**32-1,dI=t=>{let e=Object.keys(t.navigationFlags??{}).length;if(e===0)return{index:-1,flag:0};let r=Math.floor(e/32),n=e%32;return{index:r,flag:2**n-1}},M1=(t,e,r)=>{if(e.index==-1&&t.length===0)return ge(!0);let n=e.flag>0||e.index===-1?e.index+1:e.index;if(t.length!==n)return Ie({kind:Gc.NavigationFlagIncorrectFlagsLength,properties:{expected:n,actual:t.length,path:r}});for(let i=0;i<t.length;i++){let o=t[i];if(i<e.index){if(o>tle)return Ie({kind:Gc.NavigationFlagValueTooBig,properties:{index:i,flagValue:o,expectedMaxFlagValue:tle,path:r}});continue}else if(o>e.flag)return Ie({kind:Gc.NavigationFlagValueTooBig,properties:{index:i,flagValue:o,expectedMaxFlagValue:e.flag,path:r}})}return ge(!0)}});var L7e,nle,t7,ile,D7e,rA,r7,Cg,O7e,k7e,ole,Tg=h(()=>{aa();ht();Qae();ele();rle();L7e=_.Object({index:_.Integer({description:"The index of the flag in a flags array.",minimum:0}),bit:_.Integer({description:"The bit position of the flag in a flag's bitfield.",minimum:0,maximum:31})},{$id:"NavigationFlagDeclarationCore"}),nle=_.Intersect([L7e,Rc],{$id:"NavigationFlagDeclaration",description:'A NavigationFlagDeclaration describes the relationship between a "key" that a developer might use to wayfind using that flag, and the index and bit position in an object\'s `flags` array.'}),t7={accessible:"accessible",outdoors:"outdoors"},ile=_.Record(_.String(),nle,{$id:"NavigationFlagDeclarations",description:"Any well known and custom flags present in the MVF"}),D7e=_.Object({navigationFlags:_.Ref(ile)},{$id:"NavigationFlagsSchema"}),rA=_.Array(_.Integer({minimum:0,maximum:Math.pow(2,32)-1}),{$id:"Flags"}),r7=_.Object({flags:_.Ref(rA)},{$id:"WithFlags"}),Cg=_.Intersect([r1,r7],{$id:"FlaggedGeometryAnchor"}),O7e=_.Object({geometryAnchor:Cg},{$id:"WithFlaggedGeometryAnchor"}),k7e=_.Object({geometryAnchors:_.Array(Cg)},{$id:"WithFlaggedGeometryAnchors"}),ole={name:"ext:mvf-navigation-flags",schema:D7e,intoBundle:function*(t){t.navigationFlags!=null&&(yield{path:"navigationFlags.json",contents:t.navigationFlags})},fromBundle:(t,e,r)=>t!=="navigationFlags.json"?void 0:{navigationFlags:r(e)},references:[nle,ile,rA,Cg,O7e,k7e],integrityCheck:Jae}});var sle,ale=h(()=>{Wp();Tg();Kn();sle=t=>{if(t.connections==null)return ge(!0);let e=go(t),r=dI(t);for(let[n,i]of t.connections.entries()){for(let[o,s]of i.entrances.entries()){let a=e(s.floorId,s.geometryId);if(a.isErr())return a;let l=M1(s.flags,r,`connections[${n}].entrances[${o}]`);if(l.isErr())return l}for(let[o,s]of i.exits.entries()){let a=e(s.floorId,s.geometryId);if(a.isErr())return a;let l=M1(s.flags,r,`connections[${n}].exits[${o}]`);if(l.isErr())return l}}return ge(!0)}});var ule,F7e,aWt,R7e,cle,n7,ple,fle,N7e,lle,hle,i7=h(()=>{Su();aa();Tg();ht();ale();ule=si("c","ConnectionId"),{schema:F7e,values:aWt,record:R7e}=Ua(["elevator","escalator","travelator","stairs","door","ramp"],{$id:"ConnectionType"}),cle=F7e,n7=R7e,ple=_.Intersect([_.Object({id:_.Ref(ule,{description:"The unique identifier for the connection."}),entrances:_.Array(_.Ref(Cg)),exits:_.Array(_.Ref(Cg)),entryCost:_.Number({description:"The cost to enter the connection.",minimum:0}),floorCostMultiplier:_.Number({description:"The cost multiplier for each floor transitioned.",minimum:1}),type:_.Ref(cle,{description:"The type of connection."})}),Rc,Nc],{$id:"ConnectionsProperties"}),fle=_.Array(_.Ref(ple),{$id:"ConnectionsCollection"}),N7e=_.Object({connections:_.Ref(fle)},{$id:"ConnectionsExtensionSchema"}),lle="connections.json",hle={name:"ext:connections",schema:N7e,intoBundle:function*(t){t.connections!=null&&(yield{path:lle,contents:t.connections})},fromBundle:(t,e,r)=>{if(t===lle)return{connections:r(e)}},references:[ple,fle,cle,ule,Cg,rA],integrityCheck:sle}});var dle,mle=h(()=>{Wp();Kn();dle=t=>{if(t.defaultStyle==null)return ge(!0);let e=go(t);for(let r of Object.values(t.defaultStyle))if(r!=null)for(let n of r.geometryAnchors){let i=e(n.floorId,n.geometryId);if(i.isErr())return i}return ge(!0)}});var yle,gle,B7e,vle,xle=h(()=>{Su();ht();mle();yle=_.Intersect([pg(),Nc,_.Object({altitude:_.Number({description:"How far off the bottom of the floor the objects with this style should be drawn, in meters."}),color:_.String({pattern:"^#[0-9a-fA-F]{6}$",description:"Color should be represented with a hash (#), followed by 6 hexadecimal digits. ex: #RRGGBB"}),height:_.Number({minimum:0,description:"The height of the objects belonging to this layer, in meters."}),opacity:_.Number({minimum:0,maximum:1,description:"The opacity of the objects belonging to this layer, from 0 to 1."}),buffer:_.Number({description:"The buffer amount to apply to the geometry, in meters. This can be used to inflate line string geometry for walls, but might also be applicable as a way to grow or shrink polygon geometry for aesthetic purposes. Can be negative."}),hidden:_.Optional(_.Boolean({description:"Whether or not the objects with this style should be hidden."}))})],{$id:"DefaultStyle"}),gle=_.Record(_.String(),_.Ref(yle),{$id:"DefaultStyleCollection",additionalProperties:!1}),B7e=_.Object({defaultStyle:_.Ref(gle)},{$id:"DefaultStyleSchema"}),vle={name:"ext:mvf-default-style",schema:B7e,intoBundle:function*(t){t.defaultStyle!=null&&(yield{path:"default-style.json",contents:t.defaultStyle})},fromBundle:(t,e,r)=>{if(t==="default-style.json")return{defaultStyle:r(e)}},references:[yle,gle],integrityCheck:dle}});var nA,ble=h(()=>{(function(t){t.InvalidDefaultFloorError="InvalidDefaultFloorError"})(nA||(nA={}))});var _le,wle=h(()=>{n3();Kn();ble();_le=t=>{if(t.floorStacks==null)return ge(!0);let e=xh(t);for(let r of t.floorStacks){for(let n of r.floors){let i=e(n);if(i.isErr())return i}if(r.defaultFloor!=null&&!r.floors.includes(r.defaultFloor))return Ie({kind:nA.InvalidDefaultFloorError,properties:{floorStackId:r.id,floorId:r.defaultFloor}})}return ge(!0)}});var iA,Ile,Ple,z7e,Sle,Cle,o7=h(()=>{ia();Su();ht();wle();iA=si("fs","FloorStackId"),Ile=_.Intersect([_.Object({id:_.Ref(iA,{description:"The unique identifier for the floor stack."}),floors:_.Array(_.Ref(Or),{uniqueItems:!0,minItems:1,description:"The floors that are part of this floor stack."}),defaultFloor:_.Optional(_.Ref(Or,{description:"The default floor for the floor stack."}))}),Rc],{$id:"FloorStacksProperties"}),Ple=_.Array(_.Ref(Ile),{$id:"FloorStackCollection"}),z7e=_.Object({floorStacks:_.Ref(Ple)},{$id:"FloorStackExtensionSchema"}),Sle="floor-stacks.json",Cle={name:"ext:floor-stacks",schema:z7e,intoBundle:function*(t){t.floorStacks!=null&&(yield{path:Sle,contents:t.floorStacks})},fromBundle:(t,e,r)=>{if(t===Sle)return{floorStacks:r(e)}},references:[iA,Ile,Ple],integrityCheck:_le}});var mI,Tle=h(()=>{(function(t){t.MissingFloorStackError="MissingFloorStackError",t.UnknownFloorStackError="UnknownFloorStackError"})(mI||(mI={}))});var Ele,Mle=h(()=>{Wp();gi();Kn();Tle();Ele=t=>{if(t.facade==null)return ge(!0);if(t.floorStacks==null)return Ie({kind:mI.MissingFloorStackError,properties:null});let e=new Set(t.floorStacks.map(n=>n.id)),r=go(t);for(let[n,i]of kr(t.facade))if(i!=null){if(!e.has(n))return Ie({kind:mI.UnknownFloorStackError,properties:{floorStackId:n}});for(let o of i.geometryAnchors){let s=r(o.floorId,o.geometryId);if(s.isErr())return s}}return ge(!0)}});var Ale,Lle,V7e,U7e,Dle,Ole=h(()=>{ia();Su();gi();o7();ht();Mle();Ale=si("fc","FacadeId"),Lle=_.Intersect([_.Object({id:_.Ref(Ale)}),pg({minItems:1})],{$id:"FacadeProperties"}),V7e=_.Object({facade:Ii(_.Record(iA,_.Ref(Lle),{additionalProperties:!1}))},{$id:"FacadeExtensionSchema"}),U7e=/^facade\/(.*)\.json$/,Dle={name:"ext:facade",schema:V7e,intoBundle:function*(t){if(t.facade!=null)for(let e of Pr(t.facade))yield{path:`facade/${e}.json`,contents:t.facade[e]}},fromBundle:(t,e,r)=>{let n=t.match(U7e)?.[1];if(n)return{facade:{[n]:r(e)}}},references:[Ale,Lle],integrityCheck:Ele}});var kle,Fle=h(()=>{Wp();gi();Kn();kle=t=>{if(t.floorImages==null)return ge(!0);let e=go(t);for(let[r,n]of kr(t.floorImages))if(n!=null)for(let i of n.features){if(!("geometryId"in i.properties))continue;let o=i.properties.geometryId,s=e(r,o);if(s.isErr())return s}return ge(!0)}});var s7,Rle,Nle,Ble,zle,Vle,G7e,j7e,Ule,Gle=h(()=>{nI();ia();Su();gi();ht();Fle();s7=_.Object({path:_.String({format:"uri",description:"The path to the image. This will be a remote URL."}),width:_.Number({minimum:0,description:"The width of the image when represented on the map, in meters."}),height:_.Number({minimum:0,description:"The height of the image when represented on the map, in meters."}),rotation:_.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"BaseFloorImageProperties"}),Rle=_.Intersect([_.Ref(s7),wu],{$id:"AnchoredFloorImageProperties"}),Nle=_.Intersect([_.Ref(s7),_.Object({verticalOffset:_.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"FloatingFloorImageProperties"}),Ble=_.Union([Rle,Nle],{$id:"FloorImageProperties"}),zle=is(_.Ref(Es),Ble,{$id:"FloorImageFeature"}),Vle=oa(_.Ref(zle),{$id:"FloorImageCollection"}),G7e=_.Object({floorImages:Ii(_.Record(Or,_.Ref(Vle),{additionalProperties:!1}))},{$id:"FloorImagesExtensionSchema"}),j7e=/^floorImages\/(.*)\.geojson$/,Ule={name:"ext:floor-images",schema:G7e,intoBundle:function*(t){if(t.floorImages!=null)for(let e of Pr(t.floorImages))yield{path:`floorImages/${e}.geojson`,contents:t.floorImages[e]}},fromBundle:(t,e,r)=>{let n=t.match(j7e)?.[1];if(n)return{floorImages:{[n]:r(e)}}},references:[s7,Rle,Nle,Ble,zle,Vle],integrityCheck:kle}});var jle,$le=h(()=>{Wp();gi();Kn();jle=t=>{if(t.kinds==null)return ge(!0);let e=go(t);for(let[r,n]of kr(t.kinds))if(n!=null)for(let i of Pr(n)){let o=e(r,i);if(o.isErr())return o}return ge(!0)}});var oZt,$7e,sZt,qle,Hle,q7e,H7e,Wle,Zle=h(()=>{ia();Su();gi();ht();$le();({values:oZt,schema:$7e,record:sZt}=Ua(["room","hallway","wall","desk","poi","area","window"],{$id:"Kind"})),qle=$7e,Hle=Ii(_.Record(Ts,_.Ref(qle),{additionalProperties:!1,$id:"GeometryKinds"})),q7e=_.Object({kinds:Ii(_.Record(Or,_.Ref(Hle),{additionalProperties:!1}))},{$id:"KindsExtensionSchema"}),H7e=/^kinds\/(.*)\.json$/,Wle={name:"ext:kinds",schema:q7e,intoBundle:function*(t){if(t.kinds!=null)for(let e of Pr(t.kinds))yield{path:`kinds/${e}.json`,contents:t.kinds[e]}},fromBundle:(t,e,r)=>{let n=t.match(H7e)?.[1];if(n)return{kinds:{[n]:r(e)}}},references:[qle,Hle],integrityCheck:jle}});var oA,a7=h(()=>{(function(t){t.UnknownNeighbor="UnknownNeighbor"})(oA||(oA={}))});var Xle,Yle=h(()=>{Wp();gi();Tg();Kn();a7();Xle=t=>{if(t.nodes==null)return ge(!0);let e=go(t),r=dI(t);for(let[n,i]of kr(t.nodes)){if(i==null)continue;let o=new Set(i.features.map(s=>s.properties.id));for(let[s,a]of i.features.entries()){for(let l of a.properties.geometryIds){let u=e(n,l);if(u.isErr())return u}for(let[l,u]of a.properties.neighbors.entries()){if(!o.has(u.id))return Ie({kind:oA.UnknownNeighbor,properties:{floorId:n,nodeId:a.properties.id,neighborId:u.id}});let c=M1(u.flags,r,`nodes["${n}"].features[${s}].properties.neighbors[${l}]`);if(c.isErr())return c}}}return ge(!0)}});var l7,Kle,Jle,Qle,eue,W7e,Z7e,tue,rue=h(()=>{nI();ia();Su();gi();Tg();ht();Yle();a7();l7=si("n","NodeId"),Kle=_.Intersect([_.Object({id:_.Ref(l7,{description:"The unique identifier for the node."}),extraCost:_.Number({minimum:0,description:"The extra cost to traverse to the node, above the straight-line distance."})}),r7],{$id:"NodeNeighbor"}),Jle=_.Intersect([_.Object({id:_.Ref(l7,{description:"The unique identifier for the node."}),neighbors:_.Array(_.Ref(Kle),{description:"The neighbors of the node."})}),o3],{$id:"NodeProperties"}),Qle=is(_.Ref(Es),Jle,{$id:"NodeFeature"}),eue=oa(_.Ref(Qle),{$id:"NodeCollection"}),W7e=_.Object({nodes:Ii(_.Record(Or,_.Ref(eue),{additionalProperties:!1}))},{$id:"NodesExtensionSchema"}),Z7e=/^nodes\/(.*)\.json$/,tue={name:"ext:nodes",schema:W7e,intoBundle:function*(t){if(t.nodes!=null)for(let e of Pr(t.nodes))yield{path:`nodes/${e}.json`,contents:t.nodes[e]}},fromBundle:(t,e,r)=>{let n=t.match(Z7e)?.[1];if(n)return{nodes:{[n]:r(e)}}},references:[l7,Kle,Jle,Qle,eue],integrityCheck:Xle}});var sA,nue=h(()=>{(function(t){t.FloorInFloorStackError="FloorInFloorStackError"})(sA||(sA={}))});var iue,oue=h(()=>{n3();Kn();nue();iue=t=>{if(t.outdoors==null)return ge(!0);let e=xh(t);for(let r of t.outdoors.floors){let n=e(r);if(n.isErr())return n;if(t.floorStacks!=null){for(let i of t.floorStacks)if(i.floors.includes(r))return Ie({kind:sA.FloorInFloorStackError,properties:{floorId:r,floorStackId:i.id}})}}return ge(!0)}});var aue,X7e,sue,lue,uue=h(()=>{ia();ht();oue();aue=_.Object({floors:_.Array(_.Ref(Or),{uniqueItems:!0,description:"A list of floor IDs that should be considered to contain outdoor features."})},{$id:"Outdoors"}),X7e=_.Object({outdoors:_.Ref(aue)},{$id:"OutdoorsExtensionSchema"}),sue="outdoors.json",lue={name:"ext:outdoors",schema:X7e,intoBundle:function*(t){t.outdoors!=null&&(yield{path:sue,contents:t.outdoors})},fromBundle:(t,e,r)=>{if(t===sue)return{outdoors:r(e)}},references:[aue],integrityCheck:iue}});var aA,cue=h(()=>{(function(t){t.TilesetDuplicateKeyError="TilesetDuplicateKeyError"})(aA||(aA={}))});var pue,fue=h(()=>{Kn();cue();pue=t=>{if(t.tileset==null)return ge(!0);let e=new Set;if(e.add(t.tileset.default.key),t.tileset.others)for(let r of t.tileset.others){if(e.has(r.key))return Ie({kind:aA.TilesetDuplicateKeyError,properties:{key:r.key}});e.add(r.key)}return ge(!0)}});var u7,hue,Y7e,due,mue=h(()=>{ht();fue();u7=_.Object({key:_.String({minLength:1,description:"Unique identifier for the tileset style."}),name:_.String({minLength:1,description:"Display name of the tileset style."}),url:_.String({format:"uri",description:"URL of the tileset style."})},{$id:"TilesetStyle",description:"A tileset style definition."}),hue=_.Object({default:_.Ref(u7,{description:"The default tileset style, which should be used."}),others:_.Optional(_.Array(_.Ref(u7,{description:"Additional tileset styles that can be used."})))},{$id:"TilesetCollection"}),Y7e=_.Object({tileset:_.Ref(hue)},{$id:"TilesetExtensionSchema"}),due={name:"ext:mvf-tileset",schema:Y7e,intoBundle:function*(t){t.tileset!=null&&(yield{path:"tileset.json",contents:t.tileset})},fromBundle:(t,e,r)=>{if(t==="tileset.json")return{tileset:r(e)}},references:[u7,hue],integrityCheck:pue}});var yue,gue,vue,xue,K7e,J7e,Q7e,bue,_ue=h(()=>{ia();Su();gi();ht();yue=_.Object({},{$id:"WalkableProperties"}),gue=_.Object({},{$id:"NonWalkableProperties"}),vue=Ii(_.Record(Ts,_.Ref(yue),{$id:"WalkableGeometries",additionalProperties:!1})),xue=Ii(_.Record(Ts,_.Ref(gue),{$id:"NonWalkableGeometries",additionalProperties:!1})),K7e=_.Object({walkable:Ii(_.Record(Or,_.Ref(vue),{additionalProperties:!1})),nonwalkable:Ii(_.Record(Or,_.Ref(xue),{additionalProperties:!1}))},{$id:"TraversabilitySchema"}),J7e=/^walkable\/(.*)\.json$/,Q7e=/^nonwalkable\/(.*)\.json$/,bue={name:"ext:mvf-traversability",schema:K7e,intoBundle:function*(t){if(t.walkable!=null)for(let e of Pr(t.walkable))yield{path:`walkable/${e}.json`,contents:t.walkable[e]};if(t.nonwalkable!=null)for(let e of Pr(t.nonwalkable))yield{path:`nonwalkable/${e}.json`,contents:t.nonwalkable[e]}},fromBundle:(t,e,r)=>{let n=t.match(J7e)?.[1];if(n!=null)return{walkable:{[n]:r(e)}};let i=t.match(Q7e)?.[1];if(i!=null)return{nonwalkable:{[i]:r(e)}}},references:[yue,gue,vue,xue]}});function wue(t){return t.replace(/^g_/,"s_")}function e9e(t){return t.replace(/^g_/,"o_")}function t9e(t){return t.replace(/^g_/,"w_")}function r9e(t){return t.replace(/^g_/,"ar_")}function n9e(t,e,r){switch(t.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":{let n=[],i=0,o=t.geometry.type.replace("Multi","");for(let s of t.geometry.coordinates)n.push({...t,geometry:{type:o,coordinates:s},properties:{...t.properties,id:`${e}-${i++}`,kind:r}});return n}default:return[{...t,properties:{...t.properties,id:e,kind:r}}]}}function yI(t,e,r,n){let i=new Map;for(let{feature:o,floorId:s}of t){let a=o.properties.id,l=n.get(a);if(e.has(a)){let u=n9e(o,r(a),l),c=u.map(f=>f.properties.id),p=c.map(f=>({geometryId:f,floorId:s}));i.set(a,{ids:c,features:u,anchors:p})}}return i}function Sue(t){let e={space:new Map,obstruction:new Map,area:new Map,window:new Map};if(!t.geometry)return e;let r=new Map(Object.values(t.kinds??{}).filter(l=>l!==void 0).flatMap(kr)),n=kr(t.geometry).flatMap(([l,u])=>(u?.features??[]).map(c=>({feature:c,floorId:l}))).flat(),i=new Set(Object.values(t.walkable??{}).filter(l=>l!==void 0).flatMap(Pr)),o=new Set(Object.values(t.nonwalkable??{}).filter(l=>l!==void 0).flatMap(Pr)),s=new Set(Array.from(r.entries()).filter(([l,u])=>u==="area").map(([l])=>l)),a=new Set(Array.from(r.entries()).filter(([l,u])=>u==="window").map(([l])=>l));return i.size>0&&(e.space=yI(n,i,wue,r)),o.size>0&&(e.obstruction=yI(n,o,e9e,r)),s.size>0&&(e.area=yI(n,s,r9e,r)),a.size>0&&(e.window=yI(n,a,t9e,r)),i.size===0&&o.size===0&&s.size===0&&(e.space=yI(n,new Set(n.map(l=>l.feature.properties.id)),wue,r)),e}var Iue=h(()=>{gi()});function Pue(t){let e=i9e(t),r=Sue(t),n=o9e(t);return{geometryMaps:r,nodesByGeometryId:e,geometryFeatureById:n}}function i9e(t){let e=new Map;for(let r of Object.values(t.nodes??{}))for(let n of r?.features??[])if(n.properties.geometryIds.length>0)for(let i of n.properties.geometryIds){let o=e.get(i)??[];o.push(n.properties.id),e.set(i,o)}return e}function o9e(t){let e=new Map;for(let r of Object.values(t.geometry??{}))for(let n of r?.features??[])e.set(n.properties.id,n);return e}var Cue=h(()=>{Iue()});function Tue(t,e){if(!t.annotations||!t.annotationSymbols||!t.geometry)return{};let r={};for(let[n,i]of kr(t.annotations)){if(!i||i.length===0||!t.geometry[n]||t.geometry[n].features.length===0)continue;let o=new Map(t.geometry[n].features.map(a=>[a.properties.id,a])),s={type:"FeatureCollection",features:[]};for(let a of i){let l=o.get(a.geometryId);if(!l||l.geometry.type!=="Point")continue;let u={id:a.id,externalId:a.externalId,symbolId:a.symbolKey};s.features.push({type:"Feature",geometry:l.geometry,properties:u})}r[n]=s}return{annotation:r}}var Eue=h(()=>{gi()});function Mue(t,{nodesByGeometryId:e}){let r={"connection.json":[],entrance:{}},n=t.navigationFlags?.[t7.accessible],i=t.navigationFlags?.[t7.outdoors],o=new Map(Object.values(t.geometry??{}).flatMap(s=>s?.features??[]).map(s=>[s.properties.id,s]));for(let s of t.connections??[]){if(c7(s,o)){let c=s9e(s,o,e,i);for(let[p,f]of c)r.entrance[p]||(r.entrance[p]={type:"FeatureCollection",features:[]}),r.entrance[p].features.push(f);continue}let a=n!=null&&s.entrances.every(c=>E1(c,n))&&s.exits.every(c=>E1(c,n)),l=Array.from(new Set([...s.entrances.map(c=>e.get(c.geometryId)),...s.exits.map(c=>e.get(c.geometryId))].flat().filter(c=>c!=null))),u={id:s.id,externalId:s.details?.externalId??"",type:s.type,accessible:a,nodes:l};s.details?.name&&(u.details={name:s.details.name}),s.extra&&(u.extra=s.extra),r["connection.json"].push(u)}return r}function c7(t,e){return t.type==n7.door&&t.entrances.every(r=>e.get(r.geometryId)?.geometry.type==="LineString")}function s9e(t,e,r,n){if(t.type!==n7.door)return[];let i=[];for(let o of t.entrances){let s=e.get(o.geometryId);if(s?.geometry.type==="LineString"){let a={type:"Feature",geometry:s.geometry,properties:{id:t.id,externalId:t.details?.externalId??"",isExterior:a9e(t,n)}},l=t.details;l&&(a.properties.details={name:l.name,description:l.description},l.icon&&(a.properties.details.images=[{url:l.icon,altText:`${l.name} icon`}]));let u=r.get(o.geometryId);u&&u.length>0&&(a.properties.node=u[0]),i.push([o.floorId,a])}}return i}function a9e(t,e){return t.entrances.some(r=>E1(r,e))||t.exits.some(r=>E1(r,e))}var p7=h(()=>{i7();Tg()});function Lue(t,{geometryMaps:e,nodesByGeometryId:r}){if(!t.enterprise)return{};let n={categories:[],locations:[],locationInstances:[],layers:[],venue:{slug:"",name:"",externalId:"",defaultLanguage:{name:"",code:""},languages:[]}},i=t.manifest?.features[0];if(i&&(n.venue.defaultFloor=i.properties.defaultFloor,n.venue.tzid=i.properties.tzid,n.venue.name=i.properties.name),t.enterprise.venue){let w=t.enterprise.venue;n.venue={...n.venue,slug:w.slug,name:w.details.name??n.venue.name,externalId:w.details.externalId??"",defaultLanguage:w.defaultLanguage,languages:w.languages,countrycode:w.countrycode,coverImage:w.coverImage,logo:w.logo,icon:w.details.icon,extra:w.extra,mappedinWebUrl:w.mappedinWebUrl,operationHours:w.operationHours,topLocations:w.topLocations}}let o=new Map,s=new Map,a=t.locations,l=t.enterprise.locations;if(a&&l){let w=new Map(a.map(S=>[S.id,S]));for(let S of l){let I=w.get(S.locationId);if(I){let P=I.details,T={id:S.id,name:P.name,externalId:P.externalId??"",type:S.type,sortOrder:S.sortOrder,amenity:S.amenity,description:P.description,extra:I.extra,links:I.links,operationHours:I.openingHours,gallery:S.gallery,logo:I.logo,shortName:P.shortName,picture:S.picture,showFloatingLabelWhenImagePresent:S.showFloatingLabelWhenImagePresent,showLogo:S.showLogo,siblingGroups:S.siblingGroups,states:S.states,tags:S.tags,spaces:[],nodes:[],polygons:[]};I.phone&&(T.phone={number:I.phone});let M=Aue(I.social);I.website&&(M.website=I.website.url),T.social=M;for(let E of I.geometryAnchors){let D=e.space.get(E.geometryId);if(D){let $=new Set(D.features.filter(U=>U.geometry.type==="Polygon").map(U=>U.properties.id));for(let U of D.anchors)T.spaces.push({floor:U.floorId,id:U.geometryId}),$.has(U.geometryId)&&T.polygons.push({map:U.floorId,id:U.geometryId})}let B=r.get(E.geometryId);for(let $ of B??[])T.nodes.push({map:E.floorId,id:$})}n.locations.push(T);for(let E of I.categories)o.set(E,[...o.get(E)??[],S.id]);s.set(S.id,I.categories)}}}let u=t.enterprise.locationInstances,c=t.locationInstances;if(u&&c){let w=new Map(c.map(I=>[I.id,I])),S=[];for(let I of u){let P=w.get(I.locationInstanceId);if(P){let T={id:I.id,parent:I.parentId,name:P.details?.name,externalId:P.details?.externalId,type:I.type,sortOrder:I.sortOrder,amenity:I.amenity,description:P.details?.description,extra:P.extra,links:P.links,operationHours:P.openingHours,gallery:I.gallery,picture:I.picture,showFloatingLabelWhenImagePresent:I.showFloatingLabelWhenImagePresent,showLogo:I.showLogo,siblingGroups:I.siblingGroups,states:I.states,tags:I.tags,logo:P.logo,shortName:P.details?.shortName};P.phone&&(T.phone={number:P.phone});let M=Aue(P.social??[]);if(P.website&&(M.website=P.website.url),Object.keys(M).length>0&&(T.social=M),P.geometryAnchors?.length){let E=P.geometryAnchors.flatMap(D=>e.space.get(D.geometryId)?.anchors??[]);E.length>0&&(T.spaces=E.map(D=>({floor:D.floorId,id:D.geometryId})))}if(P.geometryAnchors){T.spaces=[],T.polygons=[],T.nodes=[];for(let E of P.geometryAnchors){let D=e.space.get(E.geometryId);if(D){let $=new Set(D.features.filter(U=>U.geometry.type==="Polygon").map(U=>U.properties.id));for(let U of D.anchors)T.spaces.push({floor:U.floorId,id:U.geometryId}),$.has(U.geometryId)&&T.polygons.push({map:U.floorId,id:U.geometryId})}let B=r.get(E.geometryId);for(let $ of B??[])T.nodes.push({map:E.floorId,id:$})}}S.push(T)}}S.length>0&&(n.locationInstances=S)}let p=t.locationCategories,f=t.enterprise.categories;if(p&&f){let w=[],S=new Map(p.map(M=>[M.id,M])),I=new Map(f.map(M=>[M.categoryId,M.id])),P=new Map;for(let M of p){let E=I.get(M.parent);if(E){let D=P.get(E)??[];D.push(M.id),P.set(E,D)}}for(let M of f){let E=S.get(M.categoryId);if(E){let B=(P.get(M.id)??[]).map(U=>I.get(U)).filter(U=>U!==void 0),$={id:M.id,name:E.details.name,externalId:E.details.externalId??"",sortOrder:M.sortOrder,children:B,locations:o.get(M.categoryId)??[],icon:E.details.icon,picture:M.picture,color:M.color,extra:E.extra,iconFromDefaultList:M.iconFromDefaultList};w.push($)}}n.categories=w;let T={};for(let[M,E]of s.entries())T[M]=E.map(D=>I.get(D)).filter(D=>D!==void 0);n.categoryPriorities=T}let d={};for(let[w,S]of Object.entries(t.defaultStyle??{}))if(S.buffer>0){let I=S.geometryAnchors.flatMap(P=>e.space.get(P.geometryId)?.anchors??[]);d[w]={edgeOffset:S.buffer,geometryAnchors:I}}Object.keys(d).length>0&&(n.enterpriseStyles=d);let m=new Map;for(let w of Object.values(t.enterprise.layers??{}))if(w)for(let[S,I]of kr(w)){if(typeof I!="string")continue;let P=m.get(I)??{name:I,id:`ely_${I}`,spaces:[]};P.spaces.push(...e.space.get(S)?.anchors.map(T=>({floorId:T.floorId,spaceId:T.geometryId}))??[]),m.set(I,P)}m.size>0&&(n.layers=Array.from(m.values()));let y=[];for(let w of Object.values(t.enterprise.textures??{}))for(let S of w){let I=e.space.get(S.geometryId)?.anchors;!I||I.length<1||S.face==="unknown"||S.surface==="unknown"||y.push({repeat:S.repeat,offset:S.offset,rotation:S.rotation,path:S.path,face:S.face,surface:S.surface,bounds:S.bounds,geometryAnchors:I})}y.length>0&&(n.textures=y);let g={};for(let[w,S]of Object.entries(t.enterprise.floorText??{})){let I={type:"FeatureCollection",features:[]};for(let P of S.features){if(P.properties.align==="unknown")continue;let T={align:P.properties.align,color:P.properties.color,fontFamily:P.properties.fontFamily,fontSize:P.properties.fontSize,rotation:P.properties.rotation,text:P.properties.text,visible:P.properties.visible};"geometryId"in P.properties?T.geometryId=P.properties.geometryId:T.verticalOffset=P.properties.verticalOffset,I.features.push({type:"Feature",geometry:P.geometry,properties:T})}I.features.length>0&&(g[w]=I)}Object.keys(g).length>0&&(n.floorText=g);let b={enterprise:n};if(t.enterprise.textAreas){let w={};for(let[S,I]of kr(t.enterprise.textAreas)){let P={type:"FeatureCollection",features:[]};for(let T of I.features){if(T.properties.align==="unknown")continue;let M={align:T.properties.align,maxWidth:T.properties.maxWidth,maxHeight:T.properties.maxHeight,rotation:T.properties.rotation};"geometryId"in T.properties?M.anchorId=T.properties.geometryId:M.verticalOffset=T.properties.verticalOffset;let E={type:"Feature",geometry:T.geometry,properties:M};P.features.push(E)}w[S]=P}b.textAreas=w}return b}function Aue(t){let e={};for(let{name:r,url:n}of t){let i=r.toLowerCase();l9e.includes(i)&&(e[i]=n)}return e}var l9e,Due=h(()=>{gi();l9e=["facebook","instagram","twitter"]});function Oue(t,{geometryMaps:e}){if(!t.facade)return{};let r={},n={};for(let[i,o]of kr(t.facade))o&&(n[i]={id:o.id,spaces:o.geometryAnchors.flatMap(({floorId:s,geometryId:a})=>e.space.get(a)?.ids.map(l=>({floorId:s,spaceId:l}))).filter(s=>s!==void 0)});return Object.keys(n).length>0&&(r.facade=n),r}var kue=h(()=>{gi()});function Fue(t,e={}){let r={type:"FeatureCollection",features:[]},n=[];for(let i of t.floors.features)n.push({id:i.properties.id.replace(/^f_/,"m_"),externalId:i.properties.details?.externalId??"",elevation:i.properties.elevation,name:i.properties.details?.name??"",shortName:i.properties.details?.shortName??"",subtitle:i.properties.subtitle}),r.features.push({type:"Feature",geometry:i.geometry,properties:{id:i.properties.id,externalId:i.properties.details?.externalId??"",elevation:i.properties.elevation,name:i.properties.details?.name??"",shortName:i.properties.details?.shortName??"",subtitle:i.properties.subtitle}});return{"floor.geojson":r,"map.geojson":n}}var Rue=h(()=>{});function Nue(t,{geometryMaps:e}){let r={},n={};for(let[i,o]of kr(t.floorImages??{})){let s={features:[],type:"FeatureCollection"};for(let a of o?.features??[])if("verticalOffset"in a.properties)s.features.push(a);else{let{geometryId:l,...u}=a.properties,c=e.space.get(l)?.ids[0]??e.obstruction.get(l)?.ids[0];if(!c)continue;let p={geometry:a.geometry,properties:{...u,anchorId:c},type:a.type};s.features.push(p)}n[i]=s}return Object.keys(n).length>0&&(r.floorImages=n),r}var Bue=h(()=>{gi()});function zue(t,e={}){let r=[];for(let i of t?.floorStacks??[]){let o={id:i.id,floors:i.floors,maps:i.floors,externalId:i.details?.externalId??"",name:i.details?.name??"",shortName:i.details?.shortName??"",type:"Building"};i.defaultFloor&&(o.defaultFloor=i.defaultFloor),r.push(o)}if(t.outdoors){let i={id:"outdoors",floors:t.outdoors.floors,maps:t.outdoors.floors,type:"Outdoor",name:"Outdoors",externalId:"outdoors"};r.push(i)}return{"floorstack.json":r,"mapstack.geojson":r}}var Vue=h(()=>{});var Gue=V((lXt,f7)=>{"use strict";var lA=(aC(),Fm(u4));lA.default&&(lA=lA.default);f7.exports=Uue;f7.exports.default=Uue;function Uue(t,e,r){e=e||1;for(var n,i,o,s,a=0;a<t[0].length;a++){var l=t[0][a];(!a||l[0]<n)&&(n=l[0]),(!a||l[1]<i)&&(i=l[1]),(!a||l[0]>o)&&(o=l[0]),(!a||l[1]>s)&&(s=l[1])}var u=o-n,c=s-i,p=Math.min(u,c),f=p/2;if(p===0){var d=[n,i];return d.distance=0,d}for(var m=new lA(void 0,u9e),y=n;y<o;y+=p)for(var g=i;g<s;g+=p)m.push(new pm(y+f,g+f,f,t));var b=p9e(t),w=new pm(n+u/2,i+c/2,0,t);w.d>b.d&&(b=w);for(var S=m.length;m.length;){var I=m.pop();I.d>b.d&&(b=I,r&&console.log("found best %d after %d probes",Math.round(1e4*I.d)/1e4,S)),!(I.max-b.d<=e)&&(f=I.h/2,m.push(new pm(I.x-f,I.y-f,f,t)),m.push(new pm(I.x+f,I.y-f,f,t)),m.push(new pm(I.x-f,I.y+f,f,t)),m.push(new pm(I.x+f,I.y+f,f,t)),S+=4)}r&&(console.log("num probes: "+S),console.log("best distance: "+b.d));var P=[b.x,b.y];return P.distance=b.d,P}function u9e(t,e){return e.max-t.max}function pm(t,e,r,n){this.x=t,this.y=e,this.h=r,this.d=c9e(t,e,n),this.max=this.d+this.h*Math.SQRT2}function c9e(t,e,r){for(var n=!1,i=1/0,o=0;o<r.length;o++)for(var s=r[o],a=0,l=s.length,u=l-1;a<l;u=a++){var c=s[a],p=s[u];c[1]>e!=p[1]>e&&t<(p[0]-c[0])*(e-c[1])/(p[1]-c[1])+c[0]&&(n=!n),i=Math.min(i,f9e(t,e,c,p))}return i===0?0:(n?1:-1)*Math.sqrt(i)}function p9e(t){for(var e=0,r=0,n=0,i=t[0],o=0,s=i.length,a=s-1;o<s;a=o++){var l=i[o],u=i[a],c=l[0]*u[1]-u[0]*l[1];r+=(l[0]+u[0])*c,n+=(l[1]+u[1])*c,e+=c*3}return e===0?new pm(i[0][0],i[0][1],0,t):new pm(r/e,n/e,0,t)}function f9e(t,e,r,n){var i=r[0],o=r[1],s=n[0]-i,a=n[1]-o;if(s!==0||a!==0){var l=((t-i)*s+(e-o)*a)/(s*s+a*a);l>1?(i=n[0],o=n[1]):l>0&&(i+=s*l,o+=a*l)}return s=t-i,a=e-o,s*s+a*a}});var jue,h9e,d9e,m9e,y9e,uA,$ue=h(()=>{Kn();jue=_e(Gue(),1),h9e=t=>{let e=t.geometry.coordinates[0],r=0;for(let n=0;n<e.length-1;n++)r+=e[n][0]*e[n+1][1]-e[n+1][0]*e[n][1];return Math.abs(r/2)},d9e=(t,e)=>{let[r,n]=t,i=e.geometry.coordinates[0],o=!1;for(let s=0,a=i.length-1;s<i.length;a=s++){let[l,u]=i[s],[c,p]=i[a];u>n!=p>n&&r<(c-l)*(n-u)/(p-u)+l&&(o=!o)}return o},m9e=t=>{let e=t.geometry.coordinates[0],r=0,n=0;for(let i=0;i<e.length-1;i++)r+=e[i][0],n+=e[i][1];return{geometry:{coordinates:[r/(e.length-1),n/(e.length-1)]}}},y9e=t=>{let e=h9e(t),r=Number.isFinite(e)?Math.max(e,1):1;return Math.sqrt(r)*1e-6},uA=t=>{try{let r=m9e(t).geometry.coordinates;if(!d9e(r,t)){let i=(0,jue.default)(t.geometry.coordinates,y9e(t));return ge([i[0],i[1]])}return ge(r)}catch{return Ie(new Error("Unable to calculate center of polygon"))}}});function h7(t){return t?.geometry?.type==="Polygon"}function que(t,{geometryMaps:e,nodesByGeometryId:r}){let n=_9e(t.defaultStyle),i={},o={},s={},a={};for(let u of Pr(t.geometry)){let c=t.geometry[u];if(!c)continue;let p=[],f=[],d=[],m=[];for(let y of c.features){let g=y.properties.id,b=n.has(g),w=r.get(g)??[];for(let S of e.space.get(g)?.features??[])p.push(g9e(S,w));for(let S of e.obstruction.get(g)?.features??[])f.push(v9e(S,b));for(let S of e.area.get(g)?.features??[])d.push(x9e(S,w));for(let S of e.window.get(g)?.features??[])m.push(b9e(S))}p.length>0&&(i[u]={type:"FeatureCollection",features:p.filter(y=>y!==null)}),f.length>0&&(o[u]={type:"FeatureCollection",features:f.filter(y=>y!==null)}),d.length>0&&(s[u]={type:"FeatureCollection",features:d.filter(y=>y!==null)}),m.length>0&&(a[u]={type:"FeatureCollection",features:m.filter(y=>y!==null)})}let l={space:i,obstruction:o};return Object.keys(s).length>0&&(l.area=s),Object.keys(a).length>0&&(l.window=a),l}function g9e(t,e){switch(t.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":return null}let r={type:"Feature",geometry:t.geometry,properties:{destinationNodes:e,id:t.properties.id,externalId:t.properties.details?.externalId??"",kind:t.properties.kind}};return t.properties.details&&(r.properties.details={name:t.properties.details.name,description:t.properties.details.description,images:t.properties.details.icon?[{url:t.properties.details.icon,altText:t.properties.details.name?`${t.properties.details.name} icon`:"icon"}]:void 0}),h7(r)&&(r.properties.center=uA(r).unwrapOr(void 0)),r}function v9e(t,e){switch(t.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"Point":return null}let r=t.properties,n={type:"Feature",geometry:t.geometry,properties:{id:r.id,externalId:r.details?.externalId??"",entrances:[],kind:r.kind,footprintComponent:e}};return h7(n)&&(n.properties.center=uA(n).unwrapOr(void 0)),r.details&&(n.properties.details={name:r.details.name,description:r.details.description,images:r.details.icon?[{url:r.details.icon,altText:r.details.name?`${r.details.name} icon`:"icon"}]:void 0}),n}function x9e(t,e){if(t.geometry.type!=="Polygon")return null;let r=t.properties,n={type:"Feature",geometry:t.geometry,properties:{id:r.id,externalId:r.details?.externalId??"",destinationNodes:e}};return h7(n)&&(n.properties.center=uA(n).unwrapOr(void 0)),r.details&&(n.properties.details={name:r.details.name,description:r.details.description,images:r.details.icon?[{url:r.details.icon,altText:r.details.name?`${r.details.name} icon`:"icon"}]:void 0}),n}function b9e(t){return t.geometry.type!=="LineString"?null:{type:"Feature",geometry:t.geometry,properties:{id:t.properties.id}}}function _9e(t){let e=[...t?.ExteriorWalls?.geometryAnchors??[],...t?.Walls?.geometryAnchors??[]];return new Set(e.map(n=>n.geometryId))}var Hue=h(()=>{gi();$ue()});function Wue(t,{geometryMaps:e,geometryFeatureById:r}){if(!t.locationCategories&&!t.locations)return{};let n={};if(t.locationCategories?.length){let i=[];for(let o of t.locationCategories){let s={id:o.id,name:o.details.name,icon:o.details.icon??""};o.parent&&(s.parent=o.parent),i.push(s)}n["category.json"]=i}if(t.locations?.length){let i=w9e(t,{geometryFeatureById:r}),o=[];for(let s of t.locations){let a={id:s.id,name:s.details.name,categories:s.categories,spaces:[],obstructions:[],areas:[],annotations:[],connections:[],entrances:[],links:s.links,openingHoursSpecification:s.openingHours??[],pictures:s.images,social:s.social,description:s.details.description,externalId:s.details.externalId,icon:s.details.icon,logo:s.logo,phone:s.phone,website:s.website};o.push(a);for(let{geometryId:l,floorId:u}of s.geometryAnchors)a.spaces.push(...e.space.get(l)?.ids.map(c=>({id:c,floor:u}))??[]),a.obstructions.push(...e.obstruction.get(l)?.ids.map(c=>({id:c,floor:u}))??[]),a.areas.push(...e.area.get(l)?.ids.map(c=>({id:c,floor:u}))??[]),a.entrances.push(...i.entrancesByGeometryId.get(l)??[]),a.connections.push(...i.connectionsByGeometryId.get(l)??[]),a.annotations.push(...i.annotationsByGeometryId.get(l)??[])}n["location.json"]=o}return n}function w9e(t,{geometryFeatureById:e}){let r={annotationsByGeometryId:new Map,connectionsByGeometryId:new Map,entrancesByGeometryId:new Map};if(t.annotations)for(let[n,i]of kr(t.annotations))for(let o of i??[]){let s=o.geometryId,a=o.id,l=r.annotationsByGeometryId.get(s)??[];l.push({floor:n,id:a}),r.annotationsByGeometryId.set(s,l)}if(t.connections)for(let n of t.connections){let i=c7(n,e),o=Array.from(new Map([...n.entrances,...n.exits].map(s=>[`${s.geometryId}_${s.floorId}`,s])).values());for(let s of o){let a=s.geometryId;if(i){let l=r.entrancesByGeometryId.get(a)??[];l.push({floor:s.floorId,id:n.id}),r.entrancesByGeometryId.set(a,l)}else{let l=r.connectionsByGeometryId.get(a)??[];l.push(n.id),r.connectionsByGeometryId.set(a,l)}}}return r}var Zue=h(()=>{gi();p7()});function Xue(t,e){let r={features:[],type:"FeatureCollection"},n={"manifest.geojson":r},i=t.manifest;if(i.features.length>0){let o=i.features[0],s=o.properties,a={type:"Feature",geometry:o.geometry,properties:{folder_struct:[],version:"2.0.0",time:s.time,name:s.name,naturalBearing:s.naturalBearing,tzid:s.tzid,map:s.mapId,org_id:s.orgId,language:s.language}};r.features.push(a)}return n}var Yue=h(()=>{});function Kue(t,{geometryMaps:e}){let r={"node.geojson":{type:"FeatureCollection",features:[]}},n=r["node.geojson"].features,i=new Map;for(let a of t.floors?.features??[])i.set(a.properties.id,a.properties.elevation);let o=new Map;for(let a of Object.values(t.nodes??{}))for(let l of a?.features??[])for(let u of l.properties.geometryIds)o.set(u,[...o.get(u)??[],l.properties.id]);let s=new Map;for(let a of t.connections??[]){let l=a.exits.map(u=>({...u,nodes:o.get(u.geometryId)??[]}));for(let u of a.entrances){let c=o.get(u.geometryId)??[];for(let p of c)for(let f of l){let d=Math.abs((i.get(u.floorId)??0)-(i.get(f.floorId)??0))*a.floorCostMultiplier,m=s.get(p)??[];m.push(...f.nodes.map(y=>({id:y,weight:d+a.entryCost}))),s.set(p,m)}}}for(let[a,l]of kr(t.nodes??{}))for(let u of l?.features??[]){let c=e.space.get(u.properties.geometryIds[0])?.features[0],p=c?.geometry.type==="Point"&&c?.properties.details?.externalId?c.properties.details.externalId:"",f={type:"Feature",geometry:u.geometry,properties:{id:u.properties.id,floor:a,space:u.properties.geometryIds.map(d=>e.space.get(d)?.ids).flat().filter(d=>d!==void 0),neighbors:[...u.properties.neighbors.map(d=>({id:d.id,weight:d.extraCost})),...s.get(u.properties.id)??[]],map:a,externalId:p}};n.push(f)}return r}var Jue=h(()=>{gi()});function S9e(t,e){let r={};for(let n of t){let i=e.get(n);i&&(r[i]??(r[i]=[]),r[i].push(n))}return r}function Que(t,{geometryMaps:e}){if(!t.defaultStyle)return{};let r={},n={};r["styles.json"]=n;let i=[...Array.from(e.space.values()).map(s=>s.features),...Array.from(e.obstruction.values()).map(s=>s.features)],o=new Map(i.flatMap(s=>s.map(a=>[a.properties.id,a.geometry.type])));for(let[s,a]of kr(t.defaultStyle)){let l=S9e(a.geometryAnchors.flatMap(u=>[...e.space.get(u.geometryId)?.ids??[],...e.obstruction.get(u.geometryId)?.ids??[]]),o);if(l.Point&&l.Point.length>0){let u={points:Array.from(l.Point.values()),showImage:a.extra?.showImage!==void 0?a.extra?.showImage===!0:a.opacity!==0};n[`${s}.Point`]=u}if(l.LineString&&l.LineString.length>0){let u={lineStrings:Array.from(l.LineString.values()),altitude:a.altitude,color:a.color,height:a.height,opacity:a.opacity,width:a.buffer};n[`${s}.LineString`]=u}if(l.Polygon&&l.Polygon.length>0){let u={polygons:Array.from(l.Polygon.values()),altitude:a.altitude,color:a.color,height:a.height,opacity:a.opacity};a.extra?.showImage!==void 0&&(u.showImage=a.extra.showImage===!0),n[`${s}.Polygon`]=u}}return r}var ece=h(()=>{gi()});function P9e(t){let e=Pue(t),r=Fue(t,e),n=que(t,e),i=Kue(t,e),o=Mue(t,e),s=Que(t,e),a=zue(t,e),l=Nue(t,e),u=Oue(t,e),c=Tue(t,e),p=Wue(t,e),f=Lue(t,e),d=Xue(t,e);return{...r,...n,...i,...o,...s,...a,"tileset.json":t.tileset,...l,...u,...c,...p,...f,...d}}async function d7(t){let e=await I9e.decompress(t);return e.isOk()?ge(P9e(e.value)):Ie(e.error)}var I9e,tce=h(()=>{moe();Kae();i7();aa();xle();Ole();Gle();o7();Zle();cm();Tg();rue();uue();mue();_ue();Kn();Cue();Eue();p7();Due();kue();Rue();Bue();Vue();Hue();Zue();Yue();Jue();ece();I9e=Hse().extendOptional(ole).extendOptional(tue).extendOptional(hle).extendOptional(Wle).extendOptional(bue).extendOptional(vle).extendOptional(Cle).extendOptional(lue).extendOptional(due).extendOptional(Ule).extendOptional(Dle).extendOptional(doe).extendOptional(nae).extendOptional(Yae).build().expect("Invalid parser, this should never happen. Likely a bug in the MVFv2 library, or one of the extensions.")});var rce=h(()=>{YK();qee();Hee();Wee();Zee();ate();RF();lte();tce()});function gI(t){return t.endsWith("/")?t:`${t}/`}var cA=h(()=>{"use strict"});var vI,nce,pA=h(()=>{"use strict";vI="https://app.mappedin.com/",nce="https://auth.mappedin.com/"});var C9e,fA,m7=h(()=>{"use strict";C9e=t=>{let e=Date.now();return t-e},fA=(t,e)=>C9e(t)<=e*60*1e3});async function hA(t,e=!1){let r=`${t.key}`,n=Rl.getInstance(),i=n?.loadSessionData(ice)||{},o=Math.floor(Date.now()/1e3);if(i[r]&&!fA(i[r].expiresTimestamp*1e3,oce))return i[r];let s=e?await T9e(t,o):await E9e(t,o),a={...i,[r]:s};return n?.saveSessionData(ice,a),s}async function T9e(t,e){let r=`${t.baseAuthUri??nce}oauth2/token`,n=await Eg()(r,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials",client_id:t.key,client_secret:t.secret})});if(!n.ok)throw new Error(`${n.status} ${n.statusText}: ${await n.text()}`);let i=await n.json();return{accessToken:i.access_token,expiresTimestamp:e+i.expires_in}}async function E9e(t,e){let r=`${t.baseAuthUri?gI(t.baseAuthUri):vI}api/api-key/token`,n=await Eg()(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:t.key,secret:t.secret})});if(!n.ok)throw new Error(`${n.status} ${n.statusText}: ${await n.text()}`);let i=await n.json();return{accessToken:i.access_token,expiresTimestamp:e+i.expires_in}}var oce,sce,ice,y7=h(()=>{"use strict";cA();$P();pA();Mg();m7();oce=60,sce=oce*60*1e3,ice="accessTokens"});async function g7(t,e){let r=`${e}__${t.mapId}`,n=Rl.getInstance(),i=n?.loadSessionData(ace)||{};if(i[r]&&!fA(i[r].expires,lce))return i[r];let o=await M9e(t,e),s={...i,[r]:{token:o.token,expires:new Date(o.expires).getTime()}};return n?.saveSessionData(ace,s),o}async function M9e(t,e){let r=`${t.baseUri?gI(t.baseUri):vI}api/v1/venue/${t.mapId}/sas-token`,n=await Eg()(r,{method:"GET",headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error(`${n.status} ${n.statusText}: ${await n.text()}`);let i=await n.json();return{token:i.token,expires:new Date(i.expires).getTime()}}var lce,uce,ace,v7=h(()=>{"use strict";cA();$P();pA();Mg();m7();lce=60,uce=lce*60*1e3,ace="miSasTokens"});var U7={};Go(U7,{AsyncCompress:()=>O9e,AsyncDecompress:()=>N9e,AsyncDeflate:()=>Dce,AsyncGunzip:()=>kce,AsyncGzip:()=>O9e,AsyncInflate:()=>R7,AsyncUnzipInflate:()=>Z9e,AsyncUnzlib:()=>Rce,AsyncZipDeflate:()=>j9e,AsyncZlib:()=>F9e,Compress:()=>S7,DecodeUTF8:()=>V9e,Decompress:()=>Bce,Deflate:()=>af,EncodeUTF8:()=>U9e,FlateErrorCode:()=>L9e,Gunzip:()=>_A,Gzip:()=>S7,Inflate:()=>Ga,Unzip:()=>X9e,UnzipInflate:()=>W9e,UnzipPassThrough:()=>qce,Unzlib:()=>SA,Zip:()=>$9e,ZipDeflate:()=>G9e,ZipPassThrough:()=>_I,Zlib:()=>P7,compress:()=>k9e,compressSync:()=>I7,decompress:()=>B9e,decompressSync:()=>z9e,deflate:()=>Oce,deflateSync:()=>PI,gunzip:()=>Fce,gunzipSync:()=>wA,gzip:()=>k9e,gzipSync:()=>I7,inflate:()=>N7,inflateSync:()=>G1,strFromU8:()=>z7,strToU8:()=>hm,unzip:()=>Y9e,unzipSync:()=>K9e,unzlib:()=>Nce,unzlibSync:()=>IA,zip:()=>q9e,zipSync:()=>H9e,zlib:()=>R9e,zlibSync:()=>C7});function F7(t,e){return!e&&typeof t=="function"&&(e=t,t={}),this.ondata=e,t}function Oce(t,e,r){return r||(r=e,e={}),typeof r!="function"&&Ge(7),V1(t,e,[z1],function(n){return dm(PI(n.data[0],n.data[1]))},0,r)}function PI(t,e){return Ag(t,e||{},0,0)}function N7(t,e,r){return r||(r=e,e={}),typeof r!="function"&&Ge(7),V1(t,e,[B1],function(n){return dm(G1(n.data[0],A7(n.data[1])))},1,r)}function G1(t,e){return SI(t,e)}function k9e(t,e,r){return r||(r=e,e={}),typeof r!="function"&&Ge(7),V1(t,e,[z1,Cce,function(){return[I7]}],function(n){return dm(I7(n.data[0],n.data[1]))},2,r)}function I7(t,e){e||(e={});var r=N1(),n=t.length;r.p(t);var i=Ag(t,e,O7(e),8),o=i.length;return L7(i,e),an(i,o-8,r.d()),an(i,o-4,n),i}function Fce(t,e,r){return r||(r=e,e={}),typeof r!="function"&&Ge(7),V1(t,e,[B1,Tce,function(){return[wA]}],function(n){return dm(wA(n.data[0]))},3,r)}function wA(t,e){return SI(t.subarray(D7(t),-8),e||new xr(Ace(t)))}function R9e(t,e,r){return r||(r=e,e={}),typeof r!="function"&&Ge(7),V1(t,e,[z1,Ece,function(){return[C7]}],function(n){return dm(C7(n.data[0],n.data[1]))},4,r)}function C7(t,e){e||(e={});var r=M7();r.p(t);var n=Ag(t,e,2,4);return k7(n,e),an(n,n.length-4,r.d()),n}function Nce(t,e,r){return r||(r=e,e={}),typeof r!="function"&&Ge(7),V1(t,e,[B1,Mce,function(){return[IA]}],function(n){return dm(IA(n.data[0],A7(n.data[1])))},5,r)}function IA(t,e){return SI((Lce(t),t.subarray(2,-4)),e)}function B9e(t,e,r){return r||(r=e,e={}),typeof r!="function"&&Ge(7),t[0]==31&&t[1]==139&&t[2]==8?Fce(t,e,r):(t[0]&15)!=8||t[0]>>4>7||(t[0]<<8|t[1])%31?N7(t,e,r):Nce(t,e,r)}function z9e(t,e){return t[0]==31&&t[1]==139&&t[2]==8?wA(t,e):(t[0]&15)!=8||t[0]>>4>7||(t[0]<<8|t[1])%31?G1(t,e):IA(t,e)}function hm(t,e){if(e){for(var r=new xr(t.length),n=0;n<t.length;++n)r[n]=t.charCodeAt(n);return r}if(fce)return fce.encode(t);for(var i=t.length,o=new xr(t.length+(t.length>>1)),s=0,a=function(c){o[s++]=c},n=0;n<i;++n){if(s+5>o.length){var l=new xr(s+8+(i-n<<1));l.set(o),o=l}var u=t.charCodeAt(n);u<128||e?a(u):u<2048?(a(192|u>>6),a(128|u&63)):u>55295&&u<57344?(u=65536+(u&1047552)|t.charCodeAt(++n)&1023,a(240|u>>18),a(128|u>>12&63),a(128|u>>6&63),a(128|u&63)):(a(224|u>>12),a(128|u>>6&63),a(128|u&63))}return Ou(o,0,s)}function z7(t,e){if(e){for(var r="",n=0;n<t.length;n+=16384)r+=String.fromCharCode.apply(null,t.subarray(n,n+16384));return r}else{if(T7)return T7.decode(t);var i=Vce(t),o=i[0],s=i[1];return s.length&&Ge(8),o}}function q9e(t,e,r){r||(r=e,e={}),typeof r!="function"&&Ge(7);var n={};B7(t,"",n,e);var i=Object.keys(n),o=i.length,s=0,a=0,l=o,u=new Array(o),c=[],p=function(){for(var g=0;g<c.length;++g)c[g]()},f=function(g,b){PA(function(){r(g,b)})};PA(function(){f=r});var d=function(){var g=new xr(a+22),b=s,w=a-s;a=0;for(var S=0;S<l;++S){var I=u[S];try{var P=I.c.length;O1(g,a,I,I.f,I.u,P);var T=30+I.f.length+fm(I.extra),M=a+T;g.set(I.c,M),O1(g,s,I,I.f,I.u,P,a,I.m),s+=16+T+(I.m?I.m.length:0),a=M+P}catch(E){return f(E,null)}}V7(g,s,u.length,w,b),f(null,g)};o||d();for(var m=function(g){var b=i[g],w=n[b],S=w[0],I=w[1],P=N1(),T=S.length;P.p(S);var M=hm(b),E=M.length,D=I.comment,B=D&&hm(D),$=B&&B.length,U=fm(I.extra),Y=I.level==0?0:8,G=function(ne,le){if(ne)p(),f(ne,null);else{var se=le.length;u[g]=II(I,{size:T,crc:P.d(),c:le,f:M,m:B,u:E!=b.length||B&&D.length!=$,compression:Y}),s+=30+E+U+se,a+=76+2*(E+U)+($||0)+se,--o||d()}};if(E>65535&&G(Ge(11,0,1),null),!Y)G(null,S);else if(T<16e4)try{G(null,PI(S,I))}catch(ne){G(ne,null)}else c.push(Oce(S,I,G))},y=0;y<l;++y)m(y);return p}function H9e(t,e){e||(e={});var r={},n=[];B7(t,"",r,e);var i=0,o=0;for(var s in r){var a=r[s],l=a[0],u=a[1],c=u.level==0?0:8,p=hm(s),f=p.length,d=u.comment,m=d&&hm(d),y=m&&m.length,g=fm(u.extra);f>65535&&Ge(11);var b=c?PI(l,u):l,w=b.length,S=N1();S.p(l),n.push(II(u,{size:l.length,crc:S.d(),c:b,f:p,m,u:f!=s.length||m&&d.length!=y,o:i,compression:c})),i+=30+f+g+w,o+=76+2*(f+g)+(y||0)+w}for(var I=new xr(o+22),P=i,T=o-i,M=0;M<n.length;++M){var p=n[M];O1(I,p.o,p,p.f,p.u,p.c.length);var E=30+p.f.length+fm(p.extra);I.set(p.c,p.o+E),O1(I,i,p,p.f,p.u,p.c.length,p.o,p.m),i+=16+E+(p.m?p.m.length:0)}return V7(I,i,n.length,T,P),I}function Y9e(t,e,r){r||(r=e,e={}),typeof r!="function"&&Ge(7);var n=[],i=function(){for(var g=0;g<n.length;++g)n[g]()},o={},s=function(g,b){PA(function(){r(g,b)})};PA(function(){s=r});for(var a=t.length-22;Fi(t,a)!=101010256;--a)if(!a||t.length-a>65558)return s(Ge(13,0,1),null),i;var l=la(t,a+8);if(l){var u=l,c=Fi(t,a+16),p=c==4294967295||u==65535;if(p){var f=Fi(t,a-12);p=Fi(t,f)==101075792,p&&(u=l=Fi(t,f+32),c=Fi(t,f+48))}for(var d=e&&e.filter,m=function(g){var b=jce(t,c,p),w=b[0],S=b[1],I=b[2],P=b[3],T=b[4],M=b[5],E=Gce(t,M);c=T;var D=function($,U){$?(i(),s($,null)):(U&&(o[P]=U),--l||s(null,o))};if(!d||d({name:P,size:S,originalSize:I,compression:w}))if(!w)D(null,Ou(t,E,E+S));else if(w==8){var B=t.subarray(E,E+S);if(S<32e4)try{D(null,G1(B,new xr(I)))}catch($){D($,null)}else n.push(N7(B,{size:I},D))}else D(Ge(14,"unknown compression type "+w,1),null);else D(null,null)},y=0;y<u;++y)m(y)}else s(null,{});return i}function K9e(t,e){for(var r={},n=t.length-22;Fi(t,n)!=101010256;--n)(!n||t.length-n>65558)&&Ge(13);var i=la(t,n+8);if(!i)return{};var o=Fi(t,n+16),s=o==4294967295||i==65535;if(s){var a=Fi(t,n-12);s=Fi(t,a)==101075792,s&&(i=Fi(t,a+32),o=Fi(t,a+48))}for(var l=e&&e.filter,u=0;u<i;++u){var c=jce(t,o,s),p=c[0],f=c[1],d=c[2],m=c[3],y=c[4],g=c[5],b=Gce(t,g);o=y,(!l||l({name:m,size:f,originalSize:d,compression:p}))&&(p?p==8?r[m]=G1(t.subarray(b,b+f),new xr(d)):Ge(14,"unknown compression type "+p):r[m]=Ou(t,b,b+f))}return r}var cce,A9e,xr,Ds,k1,F1,R1,xI,hce,dce,E7,vA,mce,yce,b7,bI,Ch,tn,Du,Eh,tn,tn,tn,tn,D1,tn,gce,vce,xce,bce,mA,Lu,yA,wI,Ou,L9e,_ce,Ge,SI,sf,A1,gA,xA,_7,L1,bA,w7,wce,Th,Sce,Ice,N1,M7,Ag,II,pce,dA,D9e,Pce,B1,z1,Cce,Tce,Ece,Mce,dm,A7,V1,ku,U1,la,Fi,x7,an,L7,D7,Ace,O7,k7,Lce,af,Dce,Ga,R7,S7,O9e,_A,kce,P7,F9e,SA,Rce,Bce,N9e,B7,fce,T7,zce,Vce,V9e,U9e,Uce,Gce,jce,$ce,fm,O1,V7,_I,G9e,j9e,$9e,qce,W9e,Z9e,X9e,PA,G7=h(()=>{cce={},A9e=function(t,e,r,n,i){var o=new Worker(cce[e]||(cce[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return o.onmessage=function(s){var a=s.data,l=a.$e$;if(l){var u=new Error(l[0]);u.code=l[1],u.stack=l[2],i(u,null)}else i(null,a)},o.postMessage(r,n),o},xr=Uint8Array,Ds=Uint16Array,k1=Uint32Array,F1=new xr([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),R1=new xr([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),xI=new xr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),hce=function(t,e){for(var r=new Ds(31),n=0;n<31;++n)r[n]=e+=1<<t[n-1];for(var i=new k1(r[30]),n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)i[o]=o-r[n]<<5|n;return[r,i]},dce=hce(F1,2),E7=dce[0],vA=dce[1];E7[28]=258,vA[258]=28;mce=hce(R1,0),yce=mce[0],b7=mce[1],bI=new Ds(32768);for(tn=0;tn<32768;++tn)Ch=(tn&43690)>>>1|(tn&21845)<<1,Ch=(Ch&52428)>>>2|(Ch&13107)<<2,Ch=(Ch&61680)>>>4|(Ch&3855)<<4,bI[tn]=((Ch&65280)>>>8|(Ch&255)<<8)>>>1;Du=function(t,e,r){for(var n=t.length,i=0,o=new Ds(e);i<n;++i)t[i]&&++o[t[i]-1];var s=new Ds(e);for(i=0;i<e;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(r){a=new Ds(1<<e);var l=15-e;for(i=0;i<n;++i)if(t[i])for(var u=i<<4|t[i],c=e-t[i],p=s[t[i]-1]++<<c,f=p|(1<<c)-1;p<=f;++p)a[bI[p]>>>l]=u}else for(a=new Ds(n),i=0;i<n;++i)t[i]&&(a[i]=bI[s[t[i]-1]++]>>>15-t[i]);return a},Eh=new xr(288);for(tn=0;tn<144;++tn)Eh[tn]=8;for(tn=144;tn<256;++tn)Eh[tn]=9;for(tn=256;tn<280;++tn)Eh[tn]=7;for(tn=280;tn<288;++tn)Eh[tn]=8;D1=new xr(32);for(tn=0;tn<32;++tn)D1[tn]=5;gce=Du(Eh,9,0),vce=Du(Eh,9,1),xce=Du(D1,5,0),bce=Du(D1,5,1),mA=function(t){for(var e=t[0],r=1;r<t.length;++r)t[r]>e&&(e=t[r]);return e},Lu=function(t,e,r){var n=e/8|0;return(t[n]|t[n+1]<<8)>>(e&7)&r},yA=function(t,e){var r=e/8|0;return(t[r]|t[r+1]<<8|t[r+2]<<16)>>(e&7)},wI=function(t){return(t+7)/8|0},Ou=function(t,e,r){(e==null||e<0)&&(e=0),(r==null||r>t.length)&&(r=t.length);var n=new(t.BYTES_PER_ELEMENT==2?Ds:t.BYTES_PER_ELEMENT==4?k1:xr)(r-e);return n.set(t.subarray(e,r)),n},L9e={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14},_ce=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Ge=function(t,e,r){var n=new Error(e||_ce[t]);if(n.code=t,Error.captureStackTrace&&Error.captureStackTrace(n,Ge),!r)throw n;return n},SI=function(t,e,r){var n=t.length;if(!n||r&&r.f&&!r.l)return e||new xr(0);var i=!e||r,o=!r||r.i;r||(r={}),e||(e=new xr(n*3));var s=function(Zr){var Tr=e.length;if(Zr>Tr){var nn=new xr(Math.max(Tr*2,Zr));nn.set(e),e=nn}},a=r.f||0,l=r.p||0,u=r.b||0,c=r.l,p=r.d,f=r.m,d=r.n,m=n*8;do{if(!c){a=Lu(t,l,1);var y=Lu(t,l+1,3);if(l+=3,y)if(y==1)c=vce,p=bce,f=9,d=5;else if(y==2){var S=Lu(t,l,31)+257,I=Lu(t,l+10,15)+4,P=S+Lu(t,l+5,31)+1;l+=14;for(var T=new xr(P),M=new xr(19),E=0;E<I;++E)M[xI[E]]=Lu(t,l+E*3,7);l+=I*3;for(var D=mA(M),B=(1<<D)-1,$=Du(M,D,1),E=0;E<P;){var U=$[Lu(t,l,B)];l+=U&15;var g=U>>>4;if(g<16)T[E++]=g;else{var Y=0,G=0;for(g==16?(G=3+Lu(t,l,3),l+=2,Y=T[E-1]):g==17?(G=3+Lu(t,l,7),l+=3):g==18&&(G=11+Lu(t,l,127),l+=7);G--;)T[E++]=Y}}var ne=T.subarray(0,S),le=T.subarray(S);f=mA(ne),d=mA(le),c=Du(ne,f,1),p=Du(le,d,1)}else Ge(1);else{var g=wI(l)+4,b=t[g-4]|t[g-3]<<8,w=g+b;if(w>n){o&&Ge(0);break}i&&s(u+b),e.set(t.subarray(g,w),u),r.b=u+=b,r.p=l=w*8,r.f=a;continue}if(l>m){o&&Ge(0);break}}i&&s(u+131072);for(var se=(1<<f)-1,X=(1<<d)-1,ee=l;;ee=l){var Y=c[yA(t,l)&se],Ee=Y>>>4;if(l+=Y&15,l>m){o&&Ge(0);break}if(Y||Ge(2),Ee<256)e[u++]=Ee;else if(Ee==256){ee=l,c=null;break}else{var je=Ee-254;if(Ee>264){var E=Ee-257,Le=F1[E];je=Lu(t,l,(1<<Le)-1)+E7[E],l+=Le}var He=p[yA(t,l)&X],xe=He>>>4;He||Ge(3),l+=He&15;var le=yce[xe];if(xe>3){var Le=R1[xe];le+=yA(t,l)&(1<<Le)-1,l+=Le}if(l>m){o&&Ge(0);break}i&&s(u+131072);for(var Pe=u+je;u<Pe;u+=4)e[u]=e[u-le],e[u+1]=e[u+1-le],e[u+2]=e[u+2-le],e[u+3]=e[u+3-le];u=Pe}}r.l=c,r.p=ee,r.b=u,r.f=a,c&&(a=1,r.m=f,r.d=p,r.n=d)}while(!a);return u==e.length?e:Ou(e,0,u)},sf=function(t,e,r){r<<=e&7;var n=e/8|0;t[n]|=r,t[n+1]|=r>>>8},A1=function(t,e,r){r<<=e&7;var n=e/8|0;t[n]|=r,t[n+1]|=r>>>8,t[n+2]|=r>>>16},gA=function(t,e){for(var r=[],n=0;n<t.length;++n)t[n]&&r.push({s:n,f:t[n]});var i=r.length,o=r.slice();if(!i)return[Th,0];if(i==1){var s=new xr(r[0].s+1);return s[r[0].s]=1,[s,1]}r.sort(function(P,T){return P.f-T.f}),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,c=1,p=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=i-1;)a=r[r[u].f<r[p].f?u++:p++],l=r[u!=c&&r[u].f<r[p].f?u++:p++],r[c++]={s:-1,f:a.f+l.f,l:a,r:l};for(var f=o[0].s,n=1;n<i;++n)o[n].s>f&&(f=o[n].s);var d=new Ds(f+1),m=xA(r[c-1],d,0);if(m>e){var n=0,y=0,g=m-e,b=1<<g;for(o.sort(function(T,M){return d[M.s]-d[T.s]||T.f-M.f});n<i;++n){var w=o[n].s;if(d[w]>e)y+=b-(1<<m-d[w]),d[w]=e;else break}for(y>>>=g;y>0;){var S=o[n].s;d[S]<e?y-=1<<e-d[S]++-1:++n}for(;n>=0&&y;--n){var I=o[n].s;d[I]==e&&(--d[I],++y)}m=e}return[new xr(d),m]},xA=function(t,e,r){return t.s==-1?Math.max(xA(t.l,e,r+1),xA(t.r,e,r+1)):e[t.s]=r},_7=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new Ds(++e),n=0,i=t[0],o=1,s=function(l){r[n++]=l},a=1;a<=e;++a)if(t[a]==i&&a!=e)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=t[a]}return[r.subarray(0,n),e]},L1=function(t,e){for(var r=0,n=0;n<e.length;++n)r+=t[n]*e[n];return r},bA=function(t,e,r){var n=r.length,i=wI(e+2);t[i]=n&255,t[i+1]=n>>>8,t[i+2]=t[i]^255,t[i+3]=t[i+1]^255;for(var o=0;o<n;++o)t[i+o+4]=r[o];return(i+4+n)*8},w7=function(t,e,r,n,i,o,s,a,l,u,c){sf(e,c++,r),++i[256];for(var p=gA(i,15),f=p[0],d=p[1],m=gA(o,15),y=m[0],g=m[1],b=_7(f),w=b[0],S=b[1],I=_7(y),P=I[0],T=I[1],M=new Ds(19),E=0;E<w.length;++E)M[w[E]&31]++;for(var E=0;E<P.length;++E)M[P[E]&31]++;for(var D=gA(M,7),B=D[0],$=D[1],U=19;U>4&&!B[xI[U-1]];--U);var Y=u+5<<3,G=L1(i,Eh)+L1(o,D1)+s,ne=L1(i,f)+L1(o,y)+s+14+3*U+L1(M,B)+(2*M[16]+3*M[17]+7*M[18]);if(Y<=G&&Y<=ne)return bA(e,c,t.subarray(l,l+u));var le,se,X,ee;if(sf(e,c,1+(ne<G)),c+=2,ne<G){le=Du(f,d,0),se=f,X=Du(y,g,0),ee=y;var Ee=Du(B,$,0);sf(e,c,S-257),sf(e,c+5,T-1),sf(e,c+10,U-4),c+=14;for(var E=0;E<U;++E)sf(e,c+3*E,B[xI[E]]);c+=3*U;for(var je=[w,P],Le=0;Le<2;++Le)for(var He=je[Le],E=0;E<He.length;++E){var xe=He[E]&31;sf(e,c,Ee[xe]),c+=B[xe],xe>15&&(sf(e,c,He[E]>>>5&127),c+=He[E]>>>12)}}else le=gce,se=Eh,X=xce,ee=D1;for(var E=0;E<a;++E)if(n[E]>255){var xe=n[E]>>>18&31;A1(e,c,le[xe+257]),c+=se[xe+257],xe>7&&(sf(e,c,n[E]>>>23&31),c+=F1[xe]);var Pe=n[E]&31;A1(e,c,X[Pe]),c+=ee[Pe],Pe>3&&(A1(e,c,n[E]>>>5&8191),c+=R1[Pe])}else A1(e,c,le[n[E]]),c+=se[n[E]];return A1(e,c,le[256]),c+se[256]},wce=new k1([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Th=new xr(0),Sce=function(t,e,r,n,i,o){var s=t.length,a=new xr(n+s+5*(1+Math.ceil(s/7e3))+i),l=a.subarray(n,a.length-i),u=0;if(!e||s<8)for(var c=0;c<=s;c+=65535){var p=c+65535;p>=s&&(l[u>>3]=o),u=bA(l,u+1,t.subarray(c,p))}else{for(var f=wce[e-1],d=f>>>13,m=f&8191,y=(1<<r)-1,g=new Ds(32768),b=new Ds(y+1),w=Math.ceil(r/3),S=2*w,I=function(he){return(t[he]^t[he+1]<<w^t[he+2]<<S)&y},P=new k1(25e3),T=new Ds(288),M=new Ds(32),E=0,D=0,c=0,B=0,$=0,U=0;c<s;++c){var Y=I(c),G=c&32767,ne=b[Y];if(g[G]=ne,b[Y]=G,$<=c){var le=s-c;if((E>7e3||B>24576)&&le>423){u=w7(t,l,0,P,T,M,D,B,U,c-U,u),B=E=D=0,U=c;for(var se=0;se<286;++se)T[se]=0;for(var se=0;se<30;++se)M[se]=0}var X=2,ee=0,Ee=m,je=G-ne&32767;if(le>2&&Y==I(c-je))for(var Le=Math.min(d,le)-1,He=Math.min(32767,c),xe=Math.min(258,le);je<=He&&--Ee&&G!=ne;){if(t[c+X]==t[c+X-je]){for(var Pe=0;Pe<xe&&t[c+Pe]==t[c+Pe-je];++Pe);if(Pe>X){if(X=Pe,ee=je,Pe>Le)break;for(var Zr=Math.min(je,Pe-2),Tr=0,se=0;se<Zr;++se){var nn=c-je+se+32768&32767,L=g[nn],ue=nn-L+32768&32767;ue>Tr&&(Tr=ue,ne=nn)}}}G=ne,ne=g[G],je+=G-ne+32768&32767}if(ee){P[B++]=268435456|vA[X]<<18|b7[ee];var k=vA[X]&31,be=b7[ee]&31;D+=F1[k]+R1[be],++T[257+k],++M[be],$=c+X,++E}else P[B++]=t[c],++T[t[c]]}}u=w7(t,l,o,P,T,M,D,B,U,c-U,u),!o&&u&7&&(u=bA(l,u+1,Th))}return Ou(a,0,n+wI(u)+i)},Ice=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var r=e,n=9;--n;)r=(r&1&&-306674912)^r>>>1;t[e]=r}return t}(),N1=function(){var t=-1;return{p:function(e){for(var r=t,n=0;n<e.length;++n)r=Ice[r&255^e[n]]^r>>>8;t=r},d:function(){return~t}}},M7=function(){var t=1,e=0;return{p:function(r){for(var n=t,i=e,o=r.length|0,s=0;s!=o;){for(var a=Math.min(s+2655,o);s<a;++s)i+=n+=r[s];n=(n&65535)+15*(n>>16),i=(i&65535)+15*(i>>16)}t=n,e=i},d:function(){return t%=65521,e%=65521,(t&255)<<24|t>>>8<<16|(e&255)<<8|e>>>8}}},Ag=function(t,e,r,n,i){return Sce(t,e.level==null?6:e.level,e.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):12+e.mem,r,n,!i)},II=function(t,e){var r={};for(var n in t)r[n]=t[n];for(var n in e)r[n]=e[n];return r},pce=function(t,e,r){for(var n=t(),i=t.toString(),o=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),s=0;s<n.length;++s){var a=n[s],l=o[s];if(typeof a=="function"){e+=";"+l+"=";var u=a.toString();if(a.prototype)if(u.indexOf("[native code]")!=-1){var c=u.indexOf(" ",8)+1;e+=u.slice(c,u.indexOf("(",c))}else{e+=u;for(var p in a.prototype)e+=";"+l+".prototype."+p+"="+a.prototype[p].toString()}else e+=u}else r[l]=a}return[e,r]},dA=[],D9e=function(t){var e=[];for(var r in t)t[r].buffer&&e.push((t[r]=new t[r].constructor(t[r])).buffer);return e},Pce=function(t,e,r,n){var i;if(!dA[r]){for(var o="",s={},a=t.length-1,l=0;l<a;++l)i=pce(t[l],o,s),o=i[0],s=i[1];dA[r]=pce(t[a],o,s)}var u=II({},dA[r][1]);return A9e(dA[r][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",r,u,D9e(u),n)},B1=function(){return[xr,Ds,k1,F1,R1,xI,E7,yce,vce,bce,bI,_ce,Du,mA,Lu,yA,wI,Ou,Ge,SI,G1,dm,A7]},z1=function(){return[xr,Ds,k1,F1,R1,xI,vA,b7,gce,Eh,xce,D1,bI,wce,Th,Du,sf,A1,gA,xA,_7,L1,bA,w7,wI,Ou,Sce,Ag,PI,dm]},Cce=function(){return[L7,O7,an,N1,Ice]},Tce=function(){return[D7,Ace]},Ece=function(){return[k7,an,M7]},Mce=function(){return[Lce]},dm=function(t){return postMessage(t,[t.buffer])},A7=function(t){return t&&t.size&&new xr(t.size)},V1=function(t,e,r,n,i,o){var s=Pce(r,n,i,function(a,l){s.terminate(),o(a,l)});return s.postMessage([t,e],e.consume?[t.buffer]:[]),function(){s.terminate()}},ku=function(t){return t.ondata=function(e,r){return postMessage([e,r],[e.buffer])},function(e){return t.push(e.data[0],e.data[1])}},U1=function(t,e,r,n,i){var o,s=Pce(t,n,i,function(a,l){a?(s.terminate(),e.ondata.call(e,a)):(l[1]&&s.terminate(),e.ondata.call(e,a,l[0],l[1]))});s.postMessage(r),e.push=function(a,l){e.ondata||Ge(5),o&&e.ondata(Ge(4,0,1),null,!!l),s.postMessage([a,o=l],[a.buffer])},e.terminate=function(){s.terminate()}},la=function(t,e){return t[e]|t[e+1]<<8},Fi=function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0},x7=function(t,e){return Fi(t,e)+Fi(t,e+4)*4294967296},an=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8},L7=function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:e.level==9?2:0,t[9]=3,e.mtime!=0&&an(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var n=0;n<=r.length;++n)t[n+10]=r.charCodeAt(n)}},D7=function(t){(t[0]!=31||t[1]!=139||t[2]!=8)&&Ge(6,"invalid gzip data");var e=t[3],r=10;e&4&&(r+=t[10]|(t[11]<<8)+2);for(var n=(e>>3&1)+(e>>4&1);n>0;n-=!t[r++]);return r+(e&2)},Ace=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},O7=function(t){return 10+(t.filename&&t.filename.length+1||0)},k7=function(t,e){var r=e.level,n=r==0?0:r<6?1:r==9?3:2;t[0]=120,t[1]=n<<6|(n?32-2*n:1)},Lce=function(t){((t[0]&15)!=8||t[0]>>>4>7||(t[0]<<8|t[1])%31)&&Ge(6,"invalid zlib data"),t[1]&32&&Ge(6,"invalid zlib data: preset dictionaries not supported")};af=function(){function t(e,r){!r&&typeof e=="function"&&(r=e,e={}),this.ondata=r,this.o=e||{}}return t.prototype.p=function(e,r){this.ondata(Ag(e,this.o,0,0,!r),r)},t.prototype.push=function(e,r){this.ondata||Ge(5),this.d&&Ge(4),this.d=r,this.p(e,r||!1)},t}(),Dce=function(){function t(e,r){U1([z1,function(){return[ku,af]}],this,F7.call(this,e,r),function(n){var i=new af(n.data);onmessage=ku(i)},6)}return t}();Ga=function(){function t(e){this.s={},this.p=new xr(0),this.ondata=e}return t.prototype.e=function(e){this.ondata||Ge(5),this.d&&Ge(4);var r=this.p.length,n=new xr(r+e.length);n.set(this.p),n.set(e,r),this.p=n},t.prototype.c=function(e){this.d=this.s.i=e||!1;var r=this.s.b,n=SI(this.p,this.o,this.s);this.ondata(Ou(n,r,this.s.b),this.d),this.o=Ou(n,this.s.b-32768),this.s.b=this.o.length,this.p=Ou(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(e,r){this.e(e),this.c(r)},t}(),R7=function(){function t(e){this.ondata=e,U1([B1,function(){return[ku,Ga]}],this,0,function(){var r=new Ga;onmessage=ku(r)},7)}return t}();S7=function(){function t(e,r){this.c=N1(),this.l=0,this.v=1,af.call(this,e,r)}return t.prototype.push=function(e,r){af.prototype.push.call(this,e,r)},t.prototype.p=function(e,r){this.c.p(e),this.l+=e.length;var n=Ag(e,this.o,this.v&&O7(this.o),r&&8,!r);this.v&&(L7(n,this.o),this.v=0),r&&(an(n,n.length-8,this.c.d()),an(n,n.length-4,this.l)),this.ondata(n,r)},t}(),O9e=function(){function t(e,r){U1([z1,Cce,function(){return[ku,af,S7]}],this,F7.call(this,e,r),function(n){var i=new S7(n.data);onmessage=ku(i)},8)}return t}();_A=function(){function t(e){this.v=1,Ga.call(this,e)}return t.prototype.push=function(e,r){if(Ga.prototype.e.call(this,e),this.v){var n=this.p.length>3?D7(this.p):4;if(n>=this.p.length&&!r)return;this.p=this.p.subarray(n),this.v=0}r&&(this.p.length<8&&Ge(6,"invalid gzip data"),this.p=this.p.subarray(0,-8)),Ga.prototype.c.call(this,r)},t}(),kce=function(){function t(e){this.ondata=e,U1([B1,Tce,function(){return[ku,Ga,_A]}],this,0,function(){var r=new _A;onmessage=ku(r)},9)}return t}();P7=function(){function t(e,r){this.c=M7(),this.v=1,af.call(this,e,r)}return t.prototype.push=function(e,r){af.prototype.push.call(this,e,r)},t.prototype.p=function(e,r){this.c.p(e);var n=Ag(e,this.o,this.v&&2,r&&4,!r);this.v&&(k7(n,this.o),this.v=0),r&&an(n,n.length-4,this.c.d()),this.ondata(n,r)},t}(),F9e=function(){function t(e,r){U1([z1,Ece,function(){return[ku,af,P7]}],this,F7.call(this,e,r),function(n){var i=new P7(n.data);onmessage=ku(i)},10)}return t}();SA=function(){function t(e){this.v=1,Ga.call(this,e)}return t.prototype.push=function(e,r){if(Ga.prototype.e.call(this,e),this.v){if(this.p.length<2&&!r)return;this.p=this.p.subarray(2),this.v=0}r&&(this.p.length<4&&Ge(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),Ga.prototype.c.call(this,r)},t}(),Rce=function(){function t(e){this.ondata=e,U1([B1,Mce,function(){return[ku,Ga,SA]}],this,0,function(){var r=new SA;onmessage=ku(r)},11)}return t}();Bce=function(){function t(e){this.G=_A,this.I=Ga,this.Z=SA,this.ondata=e}return t.prototype.push=function(e,r){if(this.ondata||Ge(5),this.s)this.s.push(e,r);else{if(this.p&&this.p.length){var n=new xr(this.p.length+e.length);n.set(this.p),n.set(e,this.p.length)}else this.p=e;if(this.p.length>2){var i=this,o=function(){i.ondata.apply(i,arguments)};this.s=this.p[0]==31&&this.p[1]==139&&this.p[2]==8?new this.G(o):(this.p[0]&15)!=8||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(o):new this.Z(o),this.s.push(this.p,r),this.p=null}}},t}(),N9e=function(){function t(e){this.G=kce,this.I=R7,this.Z=Rce,this.ondata=e}return t.prototype.push=function(e,r){Bce.prototype.push.call(this,e,r)},t}();B7=function(t,e,r,n){for(var i in t){var o=t[i],s=e+i,a=n;Array.isArray(o)&&(a=II(n,o[1]),o=o[0]),o instanceof xr?r[s]=[o,a]:(r[s+="/"]=[new xr(0),a],B7(o,s,r,n))}},fce=typeof TextEncoder<"u"&&new TextEncoder,T7=typeof TextDecoder<"u"&&new TextDecoder,zce=0;try{T7.decode(Th,{stream:!0}),zce=1}catch{}Vce=function(t){for(var e="",r=0;;){var n=t[r++],i=(n>127)+(n>223)+(n>239);if(r+i>t.length)return[e,Ou(t,r-1)];i?i==3?(n=((n&15)<<18|(t[r++]&63)<<12|(t[r++]&63)<<6|t[r++]&63)-65536,e+=String.fromCharCode(55296|n>>10,56320|n&1023)):i&1?e+=String.fromCharCode((n&31)<<6|t[r++]&63):e+=String.fromCharCode((n&15)<<12|(t[r++]&63)<<6|t[r++]&63):e+=String.fromCharCode(n)}},V9e=function(){function t(e){this.ondata=e,zce?this.t=new TextDecoder:this.p=Th}return t.prototype.push=function(e,r){if(this.ondata||Ge(5),r=!!r,this.t){this.ondata(this.t.decode(e,{stream:!0}),r),r&&(this.t.decode().length&&Ge(8),this.t=null);return}this.p||Ge(4);var n=new xr(this.p.length+e.length);n.set(this.p),n.set(e,this.p.length);var i=Vce(n),o=i[0],s=i[1];r?(s.length&&Ge(8),this.p=null):this.p=s,this.ondata(o,r)},t}(),U9e=function(){function t(e){this.ondata=e}return t.prototype.push=function(e,r){this.ondata||Ge(5),this.d&&Ge(4),this.ondata(hm(e),this.d=r||!1)},t}();Uce=function(t){return t==1?3:t<6?2:t==9?1:0},Gce=function(t,e){return e+30+la(t,e+26)+la(t,e+28)},jce=function(t,e,r){var n=la(t,e+28),i=z7(t.subarray(e+46,e+46+n),!(la(t,e+8)&2048)),o=e+46+n,s=Fi(t,e+20),a=r&&s==4294967295?$ce(t,o):[s,Fi(t,e+24),Fi(t,e+42)],l=a[0],u=a[1],c=a[2];return[la(t,e+10),l,u,i,o+la(t,e+30)+la(t,e+32),c]},$ce=function(t,e){for(;la(t,e)!=1;e+=4+la(t,e+2));return[x7(t,e+12),x7(t,e+4),x7(t,e+20)]},fm=function(t){var e=0;if(t)for(var r in t){var n=t[r].length;n>65535&&Ge(9),e+=n+4}return e},O1=function(t,e,r,n,i,o,s,a){var l=n.length,u=r.extra,c=a&&a.length,p=fm(u);an(t,e,s!=null?33639248:67324752),e+=4,s!=null&&(t[e++]=20,t[e++]=r.os),t[e]=20,e+=2,t[e++]=r.flag<<1|(o<0&&8),t[e++]=i&&8,t[e++]=r.compression&255,t[e++]=r.compression>>8;var f=new Date(r.mtime==null?Date.now():r.mtime),d=f.getFullYear()-1980;if((d<0||d>119)&&Ge(10),an(t,e,d<<25|f.getMonth()+1<<21|f.getDate()<<16|f.getHours()<<11|f.getMinutes()<<5|f.getSeconds()>>>1),e+=4,o!=-1&&(an(t,e,r.crc),an(t,e+4,o<0?-o-2:o),an(t,e+8,r.size)),an(t,e+12,l),an(t,e+14,p),e+=16,s!=null&&(an(t,e,c),an(t,e+6,r.attrs),an(t,e+10,s),e+=14),t.set(n,e),e+=l,p)for(var m in u){var y=u[m],g=y.length;an(t,e,+m),an(t,e+2,g),t.set(y,e+4),e+=4+g}return c&&(t.set(a,e),e+=c),e},V7=function(t,e,r,n,i){an(t,e,101010256),an(t,e+8,r),an(t,e+10,r),an(t,e+12,n),an(t,e+16,i)},_I=function(){function t(e){this.filename=e,this.c=N1(),this.size=0,this.compression=0}return t.prototype.process=function(e,r){this.ondata(null,e,r)},t.prototype.push=function(e,r){this.ondata||Ge(5),this.c.p(e),this.size+=e.length,r&&(this.crc=this.c.d()),this.process(e,r||!1)},t}(),G9e=function(){function t(e,r){var n=this;r||(r={}),_I.call(this,e),this.d=new af(r,function(i,o){n.ondata(null,i,o)}),this.compression=8,this.flag=Uce(r.level)}return t.prototype.process=function(e,r){try{this.d.push(e,r)}catch(n){this.ondata(n,null,r)}},t.prototype.push=function(e,r){_I.prototype.push.call(this,e,r)},t}(),j9e=function(){function t(e,r){var n=this;r||(r={}),_I.call(this,e),this.d=new Dce(r,function(i,o,s){n.ondata(i,o,s)}),this.compression=8,this.flag=Uce(r.level),this.terminate=this.d.terminate}return t.prototype.process=function(e,r){this.d.push(e,r)},t.prototype.push=function(e,r){_I.prototype.push.call(this,e,r)},t}(),$9e=function(){function t(e){this.ondata=e,this.u=[],this.d=1}return t.prototype.add=function(e){var r=this;if(this.ondata||Ge(5),this.d&2)this.ondata(Ge(4+(this.d&1)*8,0,1),null,!1);else{var n=hm(e.filename),i=n.length,o=e.comment,s=o&&hm(o),a=i!=e.filename.length||s&&o.length!=s.length,l=i+fm(e.extra)+30;i>65535&&this.ondata(Ge(11,0,1),null,!1);var u=new xr(l);O1(u,0,e,n,a,-1);var c=[u],p=function(){for(var g=0,b=c;g<b.length;g++){var w=b[g];r.ondata(null,w,!1)}c=[]},f=this.d;this.d=0;var d=this.u.length,m=II(e,{f:n,u:a,o:s,t:function(){e.terminate&&e.terminate()},r:function(){if(p(),f){var g=r.u[d+1];g?g.r():r.d=1}f=1}}),y=0;e.ondata=function(g,b,w){if(g)r.ondata(g,b,w),r.terminate();else if(y+=b.length,c.push(b),w){var S=new xr(16);an(S,0,134695760),an(S,4,e.crc),an(S,8,y),an(S,12,e.size),c.push(S),m.c=y,m.b=l+y+16,m.crc=e.crc,m.size=e.size,f&&m.r(),f=1}else f&&p()},this.u.push(m)}},t.prototype.end=function(){var e=this;if(this.d&2){this.ondata(Ge(4+(this.d&1)*8,0,1),null,!0);return}this.d?this.e():this.u.push({r:function(){e.d&1&&(e.u.splice(-1,1),e.e())},t:function(){}}),this.d=3},t.prototype.e=function(){for(var e=0,r=0,n=0,i=0,o=this.u;i<o.length;i++){var s=o[i];n+=46+s.f.length+fm(s.extra)+(s.o?s.o.length:0)}for(var a=new xr(n+22),l=0,u=this.u;l<u.length;l++){var s=u[l];O1(a,e,s,s.f,s.u,-s.c-2,r,s.o),e+=46+s.f.length+fm(s.extra)+(s.o?s.o.length:0),r+=s.b}V7(a,e,this.u.length,n,r),this.ondata(null,a,!0),this.d=2},t.prototype.terminate=function(){for(var e=0,r=this.u;e<r.length;e++){var n=r[e];n.t()}this.d=2},t}();qce=function(){function t(){}return t.prototype.push=function(e,r){this.ondata(null,e,r)},t.compression=0,t}(),W9e=function(){function t(){var e=this;this.i=new Ga(function(r,n){e.ondata(null,r,n)})}return t.prototype.push=function(e,r){try{this.i.push(e,r)}catch(n){this.ondata(n,null,r)}},t.compression=8,t}(),Z9e=function(){function t(e,r){var n=this;r<32e4?this.i=new Ga(function(i,o){n.ondata(null,i,o)}):(this.i=new R7(function(i,o,s){n.ondata(i,o,s)}),this.terminate=this.i.terminate)}return t.prototype.push=function(e,r){this.i.terminate&&(e=Ou(e,0)),this.i.push(e,r)},t.compression=8,t}(),X9e=function(){function t(e){this.onfile=e,this.k=[],this.o={0:qce},this.p=Th}return t.prototype.push=function(e,r){var n=this;if(this.onfile||Ge(5),this.p||Ge(4),this.c>0){var i=Math.min(this.c,e.length),o=e.subarray(0,i);if(this.c-=i,this.d?this.d.push(o,!this.c):this.k[0].push(o),e=e.subarray(i),e.length)return this.push(e,r)}else{var s=0,a=0,l=void 0,u=void 0;this.p.length?e.length?(u=new xr(this.p.length+e.length),u.set(this.p),u.set(e,this.p.length)):u=this.p:u=e;for(var c=u.length,p=this.c,f=p&&this.d,d=function(){var b,w=Fi(u,a);if(w==67324752){s=1,l=a,m.d=null,m.c=0;var S=la(u,a+6),I=la(u,a+8),P=S&2048,T=S&8,M=la(u,a+26),E=la(u,a+28);if(c>a+30+M+E){var D=[];m.k.unshift(D),s=2;var B=Fi(u,a+18),$=Fi(u,a+22),U=z7(u.subarray(a+30,a+=30+M),!P);B==4294967295?(b=T?[-2]:$ce(u,a),B=b[0],$=b[1]):T&&(B=-1),a+=E,m.c=B;var Y,G={name:U,compression:I,start:function(){if(G.ondata||Ge(5),!B)G.ondata(null,Th,!0);else{var ne=n.o[I];ne||G.ondata(Ge(14,"unknown compression type "+I,1),null,!1),Y=B<0?new ne(U):new ne(U,B,$),Y.ondata=function(ee,Ee,je){G.ondata(ee,Ee,je)};for(var le=0,se=D;le<se.length;le++){var X=se[le];Y.push(X,!1)}n.k[0]==D&&n.c?n.d=Y:Y.push(Th,!0)}},terminate:function(){Y&&Y.terminate&&Y.terminate()}};B>=0&&(G.size=B,G.originalSize=$),m.onfile(G)}return"break"}else if(p){if(w==134695760)return l=a+=12+(p==-2&&8),s=3,m.c=0,"break";if(w==33639248)return l=a-=4,s=3,m.c=0,"break"}},m=this;a<c-4;++a){var y=d();if(y==="break")break}if(this.p=Th,p<0){var g=s?u.subarray(0,l-12-(p==-2&&8)-(Fi(u,l-16)==134695760&&4)):u.subarray(0,a);f?f.push(g,!!s):this.k[+(s==2)].push(g)}if(s&2)return this.push(u.subarray(a),r);this.p=u.subarray(a)}r&&(this.c&&Ge(13),this.p=null)},t.prototype.register=function(e){this.o[e.compression]=e},t}(),PA=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(t){t()}});function Eg(){if(Hce==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return Hce}async function j7(t,{signal:e}){let r=await(await Eg()(t,{signal:e})).arrayBuffer();return new Uint8Array(r)}async function $1(t){let r=(await Promise.resolve().then(()=>(G7(),U7))).unzipSync(t),n={};if(r["enterprise/"]!=null){n.enterprise={};let i=r["enterprise/locations.json"];i&&(n.enterprise.locations=JSON.parse(j1().decode(i)));let o=r["enterprise/locationInstances.json"];o&&(n.enterprise.locationInstances=JSON.parse(j1().decode(o)));let s=r["enterprise/categories.json"];s&&(n.enterprise.categories=JSON.parse(j1().decode(s)))}return r["floorstack.json"]&&(n["floorstack.json"]=JSON.parse(j1().decode(r["floorstack.json"]))),r["floor.geojson"]&&(n["floor.geojson"]=JSON.parse(j1().decode(r["floor.geojson"]))),r["manifest.json"]&&(n["manifest.geojson"]=JSON.parse(j1().decode(r["manifest.json"]))),n}async function Xce(t,{signal:e}){try{let r=await(await Eg()(t,{signal:e})).arrayBuffer();if(e.aborted)return;let n=new Uint8Array(r);return await $1(n)}catch(r){let n=new Error("downloadLanguagePack failed");throw n.cause=r,n}}function $7(t){let e=new TextDecoder,r=e.decode.bind(e);try{let n={"connection.json":JSON.parse(r(t["connection.json"])),"manifest.geojson":JSON.parse(r(t["manifest.geojson"])),"map.geojson":t["map.geojson"]?JSON.parse(r(t["map.geojson"])):void 0,"mapstack.geojson":t["mapstack.geojson"]?JSON.parse(r(t["mapstack.geojson"])):void 0,"node.geojson":JSON.parse(r(t["node.geojson"])),obstruction:{},space:{},entrance:{},facade:{},"tileset.json":t["tileset.json"]?JSON.parse(r(t["tileset.json"])):void 0};if(t.enterprise!=null&&(n.enterprise={},t.enterprise?.["locations.json"]&&(n.enterprise.locations=JSON.parse(r(t.enterprise?.["locations.json"]))),t.enterprise?.["categories.json"]&&(n.enterprise.categories=JSON.parse(r(t.enterprise?.["categories.json"]))),t.enterprise?.["venue.json"]&&(n.enterprise.venue=JSON.parse(r(t.enterprise?.["venue.json"]))),t.enterprise?.["layers.json"]&&(n.enterprise.layers=JSON.parse(r(t.enterprise?.["layers.json"]))),t.enterprise?.["locationInstances.json"]&&(n.enterprise.locationInstances=JSON.parse(r(t.enterprise?.["locationInstances.json"]))),t.enterprise?.["enterpriseStyles.json"]&&(n.enterprise.enterpriseStyles=JSON.parse(r(t.enterprise?.["enterpriseStyles.json"]))),t.enterprise?.["textures.json"]&&(n.enterprise.textures=JSON.parse(r(t.enterprise?.["textures.json"]))),t.enterprise?.["floorText.json"]&&(n.enterprise.floorText=JSON.parse(r(t.enterprise?.["floorText.json"]))),t.enterprise?.["categoryPriorities.json"]&&(n.enterprise.categoryPriorities=JSON.parse(r(t.enterprise?.["categoryPriorities.json"])))),t["floorstack.json"]!=null?n["floorstack.json"]=JSON.parse(r(t["floorstack.json"])):t["mapstack.json"]!=null&&(n["mapstack.json"]=JSON.parse(r(t["mapstack.json"]))),n["floorstack.json"]==null&&n["mapstack.json"]==null&&n["mapstack.geojson"]==null)throw new Error("MVF is missing floorstack.json or mapstack.json/mapstack.geojson");if(t["floor.geojson"]&&(n["floor.geojson"]=JSON.parse(r(t["floor.geojson"]))),n["floor.geojson"]==null&&n["map.geojson"]==null)throw new Error("MVF is missing floor.geojson or map.geojson");if("styles.json"in t&&(n["styles.json"]=JSON.parse(r(t["styles.json"]))),"shapes.json"in t&&(n["shapes.json"]=JSON.parse(r(t["shapes.json"]))),"location.json"in t&&(n["location.json"]=JSON.parse(r(t["location.json"]))),"category.json"in t&&(n["category.json"]=JSON.parse(r(t["category.json"]))),t.annotation!=null){n.annotation={};let o=Object.keys(t.annotation);for(let s of o){let a=s.replace(/\.json|\.geojson/g,"");n.annotation[a]=JSON.parse(r(t.annotation[s]))}}let i=Object.keys(t.space);for(let o of i){let s=o.replace(/\.json|\.geojson/g,"");n.space[s]=JSON.parse(r(t.space[o]))}if(t.obstruction!=null){let o=Object.keys(t.obstruction);for(let s of o){let a=s.replace(/\.json|\.geojson/g,"");n.obstruction[a]=JSON.parse(r(t.obstruction[s]))}}else n.obstruction={};if(t.entrance!=null){let o=Object.keys(t.entrance);for(let s of o){let a=s.replace(/\.json|\.geojson/g,"");n.entrance[a]=JSON.parse(r(t.entrance[s]))}}else n.entrance={};if("floorImages"in t&&t.floorImages!=null){n.floorImages={};for(let o of Object.keys(t.floorImages)){let s=o.replace(/\.json|\.geojson/g,"");n.floorImages[s]=JSON.parse(r(t.floorImages[o]))}}if("textAreas"in t&&t.textAreas!=null){n.textAreas={};for(let o of Object.keys(t.textAreas)){let s=o.replace(/\.json|\.geojson/g,"");n.textAreas[s]=JSON.parse(r(t.textAreas[o]))}}if("facade"in t&&t.facade!=null){n.facade={};for(let o of Object.keys(t.facade)){let s=o.replace(/\.json|\.geojson/g,"");n.facade[s]=JSON.parse(r(t.facade[o]))}}if("area"in t&&t.area!=null){n.area={};for(let o of Object.keys(t.area)){let s=o.replace(/\.json|\.geojson/g,"");n.area[s]=JSON.parse(r(t.area[o]))}}return n}catch(n){throw we.error(n),new Error("MVF parsing failed! Probably encountered a bad file.")}}function J9e(t){if(t==null||typeof t!="object")return!1;let e=["connection.json","manifest.geojson","floor.geojson"in t?"floor.geojson":"map.geojson","node.geojson","floorstack.json"in t?"floorstack.json":"mapstack.json"in t?"mapstack.json":"mapstack.geojson"];"styles.json"in t&&e.push("styles.json"),"shapes.json"in t&&e.push("shapes.json");for(let r of e)if(t[r]==null||t[r][Symbol.toStringTag]!=="Uint8Array")return!1;return!0}async function q7(t){return new Promise(async(e,r)=>{try{if(t==null||typeof t!="object")throw new Error("Error parsing data! Unzipping failed.");if(t[Symbol.toStringTag]!=="Uint8Array")throw new Error("Unexpected file type! Unzipping failed.");let i=(await Promise.resolve().then(()=>(G7(),U7))).unzipSync(t);if(!J9e(i))throw new Error("MVF is missing some expect static files. Unzipping failed.");let o={},s=Object.keys(i);for(let a of s){if(i[a].length===0)continue;let l=a.split("/");if(l.length<0)throw new Error("Encounted a file with no name! Unzipping failed.");if(l.length>2)throw new Error("Encountered unexpected nesting in MVF! Unzipping failed.");if(l.length===1){o[l[0]]=i[a];continue}if(l[0]==="image"){we.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}else o[l[0]]==null&&(o[l[0]]={}),o[l[0]][l[1]]=i[a]}e(o)}catch(n){r(n)}})}function q1(){let t="us",e={};function r(){return rze(ize(t),e)}return{updateByUserOption(n){n.environment&&(t=n.environment),n.baseUri&&(e.baseUri=n.baseUri),n.baseAuthUri&&(e.baseAuthUri=n.baseAuthUri),n.analytics?.baseUri&&(e.analyticsBaseUri=n.analytics?.baseUri)},updateTileServerBaseUrl(n){e.tileServerUri=n},updateEnvironment(n){t=n},getBaseUri(n){return t==="us"&&n?Wce.baseUri:r().baseUri},getBaseAuthUri(n=!1){return t==="us"&&n?Wce.baseAuthUri:r().baseAuthUri},getAnalyticsBaseUri(){return r().analyticsBaseUri},getTileServerUri(){return r().tileServerUri},reset(){t="us",e={}},__getState:r}}function rze(t,e){return{...t,...e}}function ize(t){return nze[t]}async function W7(t,e="2.0.0"){switch(e){case"2.0.0":try{let r=await q7(t);return $7(r)}catch{return Zce(t)}case"3.0.0":return Zce(t);default:throw new Error(`Unsupported MVF version: ${e}`)}}var Hce,LYt,j1,Yce,Wce,Q9e,eze,tze,nze,H7,Zce,Mg=h(()=>{"use strict";rce();et();cA();pA();y7();v7();Hce=globalThis.fetch,LYt=process?.env?.npm_package_version;j1=function(){let t;return()=>(t||(t=new TextDecoder),t)}();Yce=Object.freeze({baseUri:"https://app.mappedin.com/",baseAuthUri:"https://app.mappedin.com/",analyticsBaseUri:"https://api-gateway.mappedin.com/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"}),Wce=Object.freeze({...Yce,baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"}),Q9e=Object.freeze({baseUri:"https://api-gateway.eu.mappedin.com/",baseAuthUri:"https://auth.eu.mappedin.com/",analyticsBaseUri:"https://api-gateway.eu.mappedin.com/track-analytics/a/",tileServerUri:"https://tiles-cdn.eu.mappedin.com/styles/mappedin/style.json"}),eze=Object.freeze({baseUri:"https://api-gateway-staging.mappedin.net/",baseAuthUri:"https://auth-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"}),tze=Object.freeze({baseUri:"https://app-staging.mappedin.net/",baseAuthUri:"https://app-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"});nze={eu:Q9e,us:Yce,"us-staging-enterprise":eze,"us-staging-self-serve":tze};H7=t=>{let e=Object.values(t["floorstack.json"]??t["mapstack.json"]??{});return e.length===1?[]:e.filter(r=>r.type!=="Outdoor").map(r=>r.id.replace("fs_","").replace("ms_",""))},Zce=async t=>{let e=performance.now(),r=await d7(t);return we.log(`Parsed MVFv3 in ${performance.now()-e}ms`),r.inspectErr(n=>{throw we.error(n),new Error("MVFv3 parsing failed!")}),r.unwrap()}});function Z7(t){let e=t.enterprise?.locations?.reduce((i,o)=>(i[o.id]=o,i),{})||{};for(let i of t.enterprise?.locationInstances||[])e[i.id]=i;let r={};for(let i of t["floorstack.json"]||[])r[i.id]=i;let n={};for(let i of t["floor.geojson"]?.features||[])i.properties&&i.properties.id&&(n[i.properties.id]=i.properties);return{type:"downloaded",data:t,optimized:{"enterprise-location":e,"enterprise-category":t.enterprise?.categories?.reduce((i,o)=>(i[o.id]=o,i),{})||{},"floor-stack":r,floor:n}}}function Kce(t){return/^https?:\/\/cdn\.mappedin\.com/.test(t)}function Jce(t){return!!t.split("?")[1]?.includes("sv=")}var Qce=h(()=>{"use strict"});var epe=h(()=>{"use strict"});var tpe=h(()=>{"use strict"});var X7=h(()=>{"use strict";p0();Km();MC();G4();c0()});var rpe=h(()=>{"use strict";epe();tpe();Mg();X7()});var npe=h(()=>{"use strict";(function(){typeof globalThis!="object"&&(Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})()});var ipe=h(()=>{"use strict";oo()});var CI=h(()=>{"use strict"});import{BatchedMesh as iKt,Color as oKt,Vector3 as sKt}from"three";var lf=h(()=>{"use strict";ipe();CI()});var Y7=h(()=>{"use strict"});import{Object3D as dKt}from"three";var jc=h(()=>{"use strict";lf();Y7()});import{Object3D as bKt,Vector3 as _Kt}from"three";var Fu=h(()=>{"use strict";Yu()});import{Object3D as CKt}from"three";var ja=h(()=>{"use strict";Yu();jc()});import{Object3D as DKt}from"three";var Ru=h(()=>{"use strict";jc();Fu();ja()});var J7=h(()=>{"use strict"});var Ah=h(()=>{"use strict"});import{Color as GKt,WebGLRenderer as jKt}from"three";var ape=h(()=>{"use strict";Af();J7();Ah()});var CA,Q7=h(()=>{CA={name:"@packages/outdoor-context-v4",version:"6.0.1-beta.50",private:!0,main:"dist/maplibre-gl.js",style:"dist/maplibre-gl.css",license:"BSD-3-Clause",homepage:"https://maplibre.org/",funding:"https://github.com/maplibre/maplibre-gl-js?sponsor=1",bugs:{url:"https://github.com/maplibre/maplibre-gl-js/issues/"},repository:{type:"git",url:"git://github.com/maplibre/maplibre-gl-js.git"},types:"dist/maplibre-gl.d.ts",type:"module",dependencies:{"@mapbox/geojson-rewind":"^0.5.2","@mapbox/jsonlint-lines-primitives":"^2.0.2","@mapbox/point-geometry":"^0.1.0","@mapbox/tiny-sdf":"^2.0.6","@mapbox/unitbezier":"^0.0.1","@mapbox/vector-tile":"^1.3.1","@mapbox/whoots-js":"^3.1.0","@maplibre/maplibre-gl-style-spec":"^20.1.1","@types/geojson":"^7946.0.14","@types/geojson-vt":"3.2.5","@types/junit-report-builder":"^3.0.2","@types/mapbox__point-geometry":"^0.1.4","@types/mapbox__vector-tile":"^1.3.4","@types/pbf":"^3.0.5","@types/supercluster":"^7.1.3",earcut:"^2.2.4","geojson-vt":"^3.2.1","gl-matrix":"^3.4.3","global-prefix":"^3.0.0",kdbush:"^4.0.2","murmurhash-js":"^1.0.0",pbf:"^3.2.1",potpack:"^2.0.0",quickselect:"^2.0.0",supercluster:"^8.0.1",tinyqueue:"^2.0.3","vt-pbf":"^3.1.3"},devDependencies:{"@mapbox/mapbox-gl-rtl-text":"^0.2.3","@mapbox/mvt-fixtures":"^3.10.0","@rollup/plugin-commonjs":"^25.0.7","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-replace":"^5.0.5","@rollup/plugin-strip":"^3.0.4","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-typescript":"^11.1.6","@types/benchmark":"^2.1.5","@types/cssnano":"^5.0.0","@types/d3":"^7.4.3","@types/diff":"^5.2.0","@types/earcut":"^2.1.4","@types/eslint":"^8.56.7","@types/gl":"^6.0.5","@types/glob":"^8.1.0","@types/jest":"^29.5.12","@types/jsdom":"^21.1.6","@types/minimist":"^1.2.5","@types/murmurhash-js":"^1.0.6","@types/nise":"^1.4.4","@types/node":"^20.12.7","@types/offscreencanvas":"^2019.7.3","@types/pixelmatch":"^5.2.6","@types/pngjs":"^6.0.4","@types/react":"^18.2.79","@types/react-dom":"^18.2.25","@types/request":"^2.48.12","@types/shuffle-seed":"^1.1.3","@types/window-or-global":"^1.0.6","@typescript-eslint/eslint-plugin":"^7.7.1","@typescript-eslint/parser":"^7.7.1",address:"^2.0.2",benchmark:"^2.1.4",canvas:"^2.11.2",cssnano:"^6.1.2",d3:"^7.9.0","d3-queue":"^3.0.7","devtools-protocol":"^0.0.1291694",diff:"^5.2.0","dts-bundle-generator":"^9.5.1",eslint:"^8.57.0","eslint-config-mourner":"^3.0.0","eslint-plugin-html":"^8.1.1","eslint-plugin-import":"^2.29.1","eslint-plugin-jest":"^28.2.0","eslint-plugin-react":"^7.34.1","eslint-plugin-tsdoc":"0.2.17",expect:"^29.7.0",glob:"^10.3.12","is-builtin-module":"^3.2.1",jest:"^29.7.0","jest-environment-jsdom":"^29.7.0","jest-junit":"^16.0.0","jest-monocart-coverage":"^1.1.0","jest-webgl-canvas-mock":"^2.5.3",jsdom:"^24.0.0","json-stringify-pretty-compact":"^4.0.0","junit-report-builder":"^3.2.1",minimist:"^1.2.8","mock-geolocation":"^1.0.11","monocart-coverage-reports":"^2.7.9",nise:"^5.1.9","npm-font-open-sans":"^1.1.0","npm-run-all":"^4.1.5","pdf-merger-js":"^5.1.1",pixelmatch:"^5.3.0",pngjs:"^7.0.0",postcss:"^8.4.38","postcss-cli":"^11.0.0","postcss-inline-svg":"^6.0.0","pretty-bytes":"^6.1.1",puppeteer:"^22.7.0",react:"^18.2.0","react-dom":"^18.2.0",rollup:"^4.16.4","rollup-plugin-sourcemaps":"^0.6.3",rw:"^1.3.3",semver:"^7.6.0","shuffle-seed":"^1.1.6","source-map-explorer":"^2.5.3",st:"^3.0.0",stylelint:"^16.4.0","stylelint-config-standard":"^36.0.0","ts-jest":"^29.1.2","ts-node":"^10.9.2",tslib:"^2.6.2",typedoc:"^0.25.13","typedoc-plugin-markdown":"^3.17.1","typedoc-plugin-missing-exports":"^2.2.0",typescript:"^5.4.5"},overrides:{"postcss-inline-svg":{"css-select":"^5.1.0","dom-serializer":"^2.0.0",htmlparser2:"^8.0.1","postcss-value-parser":"^4.2.0"}},scripts:{build:"tsc -b","generate-dist-package":"node --no-warnings --loader ts-node/esm build/generate-dist-package.js","generate-shaders":"node --no-warnings --loader ts-node/esm build/generate-shaders.ts","generate-struct-arrays":"node --no-warnings --loader ts-node/esm build/generate-struct-arrays.ts","generate-style-code":"node --no-warnings --loader ts-node/esm build/generate-style-code.ts","generate-typings":"dts-bundle-generator --export-referenced-types --umd-module-name=maplibregl -o ./dist/maplibre-gl.d.ts ./src/index.ts","generate-docs":"typedoc && node --no-warnings --loader ts-node/esm build/generate-docs.ts","generate-images":"node --no-warnings --loader ts-node/esm build/generate-doc-images.ts","build-dist":"npm run build-css && npm run generate-typings && npm run build-dev && npm run build-csp-dev && npm run build-prod && npm run build-csp","build-dev":"rollup --configPlugin @rollup/plugin-typescript -c --environment BUILD:dev","watch-dev":"rollup --configPlugin @rollup/plugin-typescript -c --environment BUILD:dev --watch","build-prod":"rollup --configPlugin @rollup/plugin-typescript -c --environment BUILD:production","build-csp":"rollup --configPlugin @rollup/plugin-typescript -c rollup.config.csp.ts","build-csp-dev":"rollup --configPlugin @rollup/plugin-typescript -c rollup.config.csp.ts --environment BUILD:dev","build-css":"postcss -o dist/maplibre-gl.css src/css/maplibre-gl.css","watch-css":"postcss --watch -o dist/maplibre-gl.css src/css/maplibre-gl.css","build-benchmarks":"npm run build-dev && rollup --configPlugin @rollup/plugin-typescript -c test/bench/rollup_config_benchmarks.ts","watch-benchmarks":"rollup --configPlugin @rollup/plugin-typescript -c test/bench/rollup_config_benchmarks.ts --watch","start-server":"st --no-cache -H 0.0.0.0 --port 9966 .","start-docs":"docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material",start:"run-p watch-css watch-dev start-server","start-bench":"run-p watch-css watch-benchmarks start-server",lint:"eslint --cache --ext .ts,.tsx,.js,.html --ignore-path .gitignore .","lint-css":"stylelint src/css/maplibre-gl.css",test:"run-p lint lint-css test-render jest",jest:"jest","test-build":"jest --selectProjects=build --reporters=default","test-build-ci":"jest --selectProjects=build","test-integration":"jest --selectProjects=integration --reporters=default","test-integration-ci":"jest --selectProjects=integration","test-render":"node --no-warnings --loader ts-node/esm test/integration/render/run_render_tests.ts","test-unit":"jest --selectProjects=unit --reporters=default","test-unit-ci":"jest --coverage --selectProjects unit","test-watch-roots":"jest --watch",codegen:"run-p --print-label generate-dist-package generate-style-code generate-struct-arrays generate-shaders && npm run generate-typings",benchmark:"node --no-warnings --loader ts-node/esm test/bench/run-benchmarks.ts","gl-stats":"node --no-warnings --loader ts-node/esm test/bench/gl-stats.ts","prepare:backup":"npm run codegen",typecheck:"tsc --noEmit && tsc --project tsconfig.dist.json",tsnode:"node --experimental-loader=ts-node/esm --no-warnings"},files:["build/","dist/*","src/"],engines:{npm:">=8.1.0",node:">=16.14.0"}}});var Br=V((YKt,lpe)=>{"use strict";lpe.exports=H1;function H1(t,e){this.x=t,this.y=e}H1.prototype={clone:function(){return new H1(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},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(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.x+r*(this.x-e.x)-n*(this.y-e.y),o=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=i,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}};H1.convert=function(t){return t instanceof H1?t:Array.isArray(t)?new H1(t[0],t[1]):t}});var ppe=V((KKt,cpe)=>{"use strict";cpe.exports=upe;function upe(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=r,this.p2y=n}upe.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(e===void 0&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var r=t,n=0;n<8;n++){var i=this.sampleCurveX(r)-t;if(Math.abs(i)<e)return r;var o=this.sampleCurveDerivativeX(r);if(Math.abs(o)<1e-6)break;r=r-i/o}var s=0,a=1;for(r=t,n=0;n<20&&(i=this.sampleCurveX(r),!(Math.abs(i-t)<e));n++)t>i?s=r:a=r,r=(a-s)*.5+s;return r},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}}});function TA(){return e9==null&&(e9=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),e9}var e9,t9=h(()=>{});function r9(){if(EA==null&&(EA=!1,TA())){let r=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(r){for(let i=0;i<5*5;i++){let o=i*4;r.fillStyle=`rgb(${o},${o+1},${o+2})`,r.fillRect(i%5,Math.floor(i/5),1,1)}let n=r.getImageData(0,0,5,5).data;for(let i=0;i<5*5*4;i++)if(i%4!==3&&n[i]!==i){EA=!0;break}}}return EA||!1}var EA,n9=h(()=>{t9()});function MA(t,e,r,n){let i=new dpe.default(t,e,r,n);return function(o){return i.solve(o)}}function Os(t,e,r){return Math.min(r,Math.max(e,t))}function AA(t,e,r){let n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function ype(t,e){let r=[];for(let n in t)n in e||r.push(n);return r}function Ue(t,...e){for(let r of e)for(let n in r)t[n]=r[n];return t}function Lg(t,e){let r={};for(let n=0;n<e.length;n++){let i=e[n];i in t&&(r[i]=t[i])}return r}function o9(){return fze++}function s9(t,e,r){let n={};for(let i in t)n[i]=e.call(r||this,t[i],i,t);return n}function gpe(t,e){for(let r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return!0;return!1}function ks(t){fpe[t]||(typeof console<"u"&&console.warn(t),fpe[t]=!0)}function TI(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function vpe(t){let e=0;for(let r=0,n=t.length,i=n-1,o,s;r<n;i=r++)o=t[r],s=t[i],e+=(s.x-o.x)*(o.y+s.y);return e}function Lh(t){return typeof WorkerGlobalScope<"u"&&typeof t<"u"&&t instanceof WorkerGlobalScope}function xpe(t){let e=/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,r={};if(t.replace(e,(n,i,o,s)=>{let a=o||s;return r[i]=a?a.toLowerCase():!0,""}),r["max-age"]){let n=parseInt(r["max-age"],10);isNaN(n)?delete r["max-age"]:r["max-age"]=n}return r}function bpe(t){if(i9==null){let e=t.navigator?t.navigator.userAgent:null;i9=!!t.safari||!!(e&&(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return i9}function $c(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap}function hze(t,e,r,n,i){let o=Math.max(-e,0)*4,l=(Math.max(0,r)-r)*n*4+o,u=n*4,c=Math.max(0,e),p=Math.max(0,r),f=Math.min(t.width,e+n),d=Math.min(t.height,r+i);return{rect:{x:c,y:p,width:f-c,height:d-p},layout:[{offset:l,stride:u}]}}async function Spe(t,e,r,n,i){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");let o=new VideoFrame(t,{timestamp:0});try{let s=o?.format;if(!s||!(s.startsWith("BGR")||s.startsWith("RGB")))throw new Error(`Unrecognized format ${s}`);let a=s.startsWith("BGR"),l=new Uint8ClampedArray(n*i*4);if(await o.copyTo(l,hze(t,e,r,n,i)),a)for(let u=0;u<l.length;u+=4){let c=l[u];l[u]=l[u+2],l[u+2]=c}return l}finally{o.close()}}function Ipe(t,e,r,n){return t.addEventListener(e,r,n),{unsubscribe:()=>{t.removeEventListener(e,r,n)}}}var pze,dpe,mpe,fze,fpe,i9,_pe,hpe,wpe,Oe=h(()=>{pze=_e(Br(),1),dpe=_e(ppe(),1);n9();mpe=MA(.25,.1,.25,1);fze=1;fpe={};i9=null;_pe=async t=>{if(t.byteLength===0)return createImageBitmap(new ImageData(1,1));let e=new Blob([new Uint8Array(t)],{type:"image/png"});try{return createImageBitmap(e)}catch(r){throw new Error(`Could not load image because of ${r.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}},hpe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=",wpe=t=>new Promise((e,r)=>{let n=new Image;n.onload=()=>{e(n),URL.revokeObjectURL(n.src),n.onload=null,window.requestAnimationFrame(()=>{n.src=hpe})},n.onerror=()=>r(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."));let i=new Blob([new Uint8Array(t)],{type:"image/png"});n.src=t.byteLength?URL.createObjectURL(i):hpe})});function Dg(){return new Error(dze)}var dze,LA=h(()=>{dze="AbortError"});var mze,DA,a9,Sn,vo=h(()=>{LA();mze=typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),Sn={now:mze,frameAsync(t){return new Promise((e,r)=>{let n=requestAnimationFrame(e);t.signal.addEventListener("abort",()=>{cancelAnimationFrame(n),r(Dg())})})},getImageData(t,e=0){return this.getImageCanvasContext(t).getImageData(-e,-e,t.width+2*e,t.height+2*e)},getImageCanvasContext(t){let 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=t.width,e.height=t.height,r.drawImage(t,0,0,t.width,t.height),r},resolveURL(t){return DA||(DA=document.createElement("a")),DA.href=t,DA.href},hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return matchMedia?(a9==null&&(a9=matchMedia("(prefers-reduced-motion: reduce)")),a9.matches):!1}}});var Ppe,dn,Ri,Ji=h(()=>{Ppe=_e(Br(),1),dn=class dn{static testProp(e){if(!dn.docStyle)return e[0];for(let r=0;r<e.length;r++)if(e[r]in dn.docStyle)return e[r];return e[0]}static create(e,r,n){let i=window.document.createElement(e);return r!==void 0&&(i.className=r),n&&n.appendChild(i),i}static createNS(e,r){return window.document.createElementNS(e,r)}static disableDrag(){dn.docStyle&&dn.selectProp&&(dn.userSelect=dn.docStyle[dn.selectProp],dn.docStyle[dn.selectProp]="none")}static enableDrag(){dn.docStyle&&dn.selectProp&&(dn.docStyle[dn.selectProp]=dn.userSelect)}static setTransform(e,r){e.style[dn.transformProp]=r}static addEventListener(e,r,n,i={}){"passive"in i?e.addEventListener(r,n,i):e.addEventListener(r,n,i.capture)}static removeEventListener(e,r,n,i={}){"passive"in i?e.removeEventListener(r,n,i):e.removeEventListener(r,n,i.capture)}static suppressClickInternal(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",dn.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",dn.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",dn.suppressClickInternal,!0)},0)}static getScale(e){let r=e.getBoundingClientRect();return{x:r.width/e.offsetWidth||1,y:r.height/e.offsetHeight||1,boundingClientRect:r}}static getPoint(e,r,n){let i=r.boundingClientRect;return new Ppe.default((n.clientX-i.left)/r.x-e.clientLeft,(n.clientY-i.top)/r.y-e.clientTop)}static mousePos(e,r){let n=dn.getScale(e);return dn.getPoint(e,n,r)}static touchPos(e,r){let n=[],i=dn.getScale(e);for(let o=0;o<r.length;o++)n.push(dn.getPoint(e,i,r[o]));return n}static mouseButton(e){return e.button}static remove(e){e.parentNode&&e.parentNode.removeChild(e)}};dn.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,dn.selectProp=dn.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),dn.transformProp=dn.testProp(["transform","WebkitTransform"]);Ri=dn});var Cl,Og=h(()=>{Cl={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""}});function OA(t){return Cl.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf("://"))]}var kA=h(()=>{Og()});var Dh=h(()=>{});async function gze(t,e){let r=new Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:l9(),signal:e.signal});t.type==="json"&&r.headers.set("Accept","application/json");let n=await fetch(r);if(!n.ok){let s=await n.blob();throw new kg(n.status,n.statusText,t.url,s)}let i;t.type==="arrayBuffer"||t.type==="image"?i=n.arrayBuffer():t.type==="json"?i=n.json():i=n.text();let o=await i;if(e.signal.aborted)throw Dg();return{data:o,cacheControl:n.headers.get("Cache-Control"),expires:n.headers.get("Expires")}}function vze(t,e){return new Promise((r,n)=>{let i=new XMLHttpRequest;i.open(t.method||"GET",t.url,!0),(t.type==="arrayBuffer"||t.type==="image")&&(i.responseType="arraybuffer");for(let o in t.headers)i.setRequestHeader(o,t.headers[o]);t.type==="json"&&(i.responseType="text",i.setRequestHeader("Accept","application/json")),i.withCredentials=t.credentials==="include",i.onerror=()=>{n(new Error(i.statusText))},i.onload=()=>{if(!e.signal.aborted)if((i.status>=200&&i.status<300||i.status===0)&&i.response!==null){let o=i.response;if(t.type==="json")try{o=JSON.parse(i.response)}catch(s){n(s);return}r({data:o,cacheControl:i.getResponseHeader("Cache-Control"),expires:i.getResponseHeader("Expires")})}else{let o=new Blob([i.response],{type:i.getResponseHeader("Content-Type")});n(new kg(i.status,i.statusText,t.url,o))}},e.signal.addEventListener("abort",()=>{i.abort(),n(Dg())}),i.send(t.body)})}function u9(t){if(!t||t.indexOf("://")<=0||t.indexOf("data:image/")===0||t.indexOf("blob:")===0)return!0;let e=new URL(t),r=window.location;return e.protocol===r.protocol&&e.host===r.host}var FA,kg,l9,yze,W1,EI,Cpe,Tpe,qc=h(()=>{Oe();LA();kA();Dh();FA="global-dispatcher",kg=class extends Error{constructor(e,r,n,i){super(`AJAXError: ${r} (${e}): ${n}`),this.status=e,this.statusText=r,this.url=n,this.body=i}},l9=()=>Lh(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,yze=t=>/^file:/.test(t)||/^file:/.test(l9())&&!/^\w+:/.test(t);W1=function(t,e){if(/:\/\//.test(t.url)&&!/^https?:|^file:/.test(t.url)){let r=OA(t.url);if(r)return r(t,e);if(Lh(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,targetMapId:FA},e)}if(!yze(t.url)){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return gze(t,e);if(Lh(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,mustQueue:!0,targetMapId:FA},e)}return vze(t,e)},EI=(t,e)=>W1(Ue(t,{type:"json"}),e),Cpe=(t,e)=>W1(Ue(t,{type:"arrayBuffer"}),e);Tpe=t=>{let e=window.document.createElement("video");return e.muted=!0,new Promise(r=>{e.onloadstart=()=>{r(e)};for(let n of t){let i=window.document.createElement("source");u9(n)||(e.crossOrigin="Anonymous"),i.src=n,e.appendChild(i)}})}});function xze(t){c9||!Z1||(Epe?Mpe(t):MI=t)}function Mpe(t){let e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,Z1),t.isContextLost())return;RA.supported=!0}catch{}t.deleteTexture(e),c9=!0}var RA,MI,c9,Z1,Epe,p9=h(()=>{RA={supported:!1,testSupport:xze},c9=!1,Epe=!1;typeof document<"u"&&(Z1=document.createElement("img"),Z1.onload=function(){MI&&Mpe(MI),MI=null,Epe=!0},Z1.onerror=function(){c9=!0,MI=null},Z1.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=")});var Hc,X1=h(()=>{qc();Oe();p9();Og();LA();kA();(d=>{let t,e,r,n;d.resetRequestQueue=()=>{t=[],e=0,r=0,n={}},d.addThrottleControl=m=>{let y=r++;return n[y]=m,y},d.removeThrottleControl=m=>{delete n[m],p()};let a=()=>{for(let m of Object.keys(n))if(n[m]())return!0;return!1};d.getImage=(m,y,g=!0)=>new Promise((b,w)=>{RA.supported&&(m.headers||(m.headers={}),m.headers.accept="image/webp,*/*"),Ue(m,{type:"image"});let S={abortController:y,requestParameters:m,supportImageRefresh:g,state:"queued",onError:I=>{w(I)},onSuccess:I=>{b(I)}};t.push(S),p()});let u=m=>typeof createImageBitmap=="function"?_pe(m):wpe(m),c=async m=>{m.state="running";let{requestParameters:y,supportImageRefresh:g,onError:b,onSuccess:w,abortController:S}=m,I=g===!1&&!Lh(self)&&!OA(y.url)&&(!y.headers||Object.keys(y.headers).reduce((T,M)=>T&&M==="accept",!0));e++;let P=I?f(y,S):W1(y,S);try{let T=await P;if(delete m.abortController,m.state="completed",T.data instanceof HTMLImageElement||$c(T.data))w(T);else if(T.data){let M=await u(T.data);w({data:M,cacheControl:T.cacheControl,expires:T.expires})}}catch(T){delete m.abortController,b(T)}finally{e--,p()}},p=()=>{let m=a()?Cl.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:Cl.MAX_PARALLEL_IMAGE_REQUESTS;for(let y=e;y<m&&t.length>0;y++){let g=t.shift();if(g.abortController.signal.aborted){y--;continue}c(g)}},f=(m,y)=>new Promise((g,b)=>{let w=new Image,S=m.url,I=m.credentials;I&&I==="include"?w.crossOrigin="use-credentials":(I&&I==="same-origin"||!u9(S))&&(w.crossOrigin="anonymous"),y.signal.addEventListener("abort",()=>{w.src="",b(Dg())}),w.fetchPriority="high",w.onload=()=>{w.onerror=w.onload=null,g({data:w})},w.onerror=()=>{w.onerror=w.onload=null,!y.signal.aborted&&b(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.src=S})})(Hc||(Hc={}));Hc.resetRequestQueue()});var Nu=h(()=>{});function Ape(t,e,r){r[t]&&r[t].indexOf(e)!==-1||(r[t]=r[t]||[],r[t].push(e))}function f9(t,e,r){if(r&&r[t]){let n=r[t].indexOf(e);n!==-1&&r[t].splice(n,1)}}var nt,Ln,Jn,Qn=h(()=>{Oe();nt=class{constructor(e,r={}){Ue(this,r),this.type=e}},Ln=class extends nt{constructor(e,r={}){super("error",Ue({error:e},r))}},Jn=class{on(e,r){return this._listeners=this._listeners||{},Ape(e,r,this._listeners),this}off(e,r){return f9(e,r,this._listeners),f9(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},Ape(e,r,this._oneTimeListeners),this):new Promise(n=>this.once(e,n))}fire(e,r){typeof e=="string"&&(e=new nt(e,r||{}));let n=e.type;if(this.listens(n)){e.target=this;let i=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];for(let a of i)a.call(this,e);let o=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];for(let a of o)f9(n,a,this._oneTimeListeners),a.call(this,e);let s=this._eventedParent;s&&(Ue(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),s.fire(e))}else e instanceof Ln&&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}}});function eb(t,...e){for(let r of e)for(let n in r)t[n]=r[n];return t}function Tl(t,e){return{kind:"array",itemType:t,N:e}}function ai(t){if(t.kind==="array"){let e=ai(t.itemType);return typeof t.N=="number"?`array<${e}, ${t.N}>`:t.itemType.kind==="value"?"array":`array<${e}>`}else return t.kind}function FI(t,e){if(e.kind==="error")return null;if(t.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!FI(t.itemType,e.itemType))&&(typeof t.N!="number"||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if(t.kind==="value"){for(let r of aVe)if(!FI(r,e))return null}}return`Expected ${ai(t)} but found ${ai(e)} instead.`}function z9(t,e){return e.some(r=>r.kind===t.kind)}function Bg(t,e){return e.some(r=>r==="null"?t===null:r==="array"?Array.isArray(t):r==="object"?t&&!Array.isArray(t)&&typeof t=="object":r===typeof t)}function AI(t,e){return t.kind==="array"&&e.kind==="array"?t.itemType.kind===e.itemType.kind&&typeof t.N=="number":t.kind===e.kind}function nfe(t){return t=t%360,t<0&&(t+=360),t}function ife([t,e,r,n]){t=h9(t),e=h9(e),r=h9(r);let i,o,s=d9((.2225045*t+.7168786*e+.0606169*r)/Qpe);t===e&&e===r?i=o=s:(i=d9((.4360747*t+.3850649*e+.1430804*r)/Jpe),o=d9((.0139322*t+.0971045*e+.7141733*r)/efe));let a=116*s-16;return[a<0?0:a,500*(i-s),200*(s-o),n]}function h9(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function d9(t){return t>lVe?Math.pow(t,1/3):t/rfe+tfe}function ofe([t,e,r,n]){let i=(t+16)/116,o=isNaN(e)?i:i+e/500,s=isNaN(r)?i:i-r/200;return i=Qpe*y9(i),o=Jpe*y9(o),s=efe*y9(s),[m9(3.1338561*o-1.6168667*i-.4906146*s),m9(-.9787684*o+1.9161415*i+.033454*s),m9(.0719453*o-.2289914*i+1.4052427*s),n]}function m9(t){return t=t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055,t<0?0:t>1?1:t}function y9(t){return t>Q1?t*t*t:rfe*(t-tfe)}function pVe(t){let[e,r,n,i]=ife(t),o=Math.sqrt(r*r+n*n);return[Math.round(o*1e4)?nfe(Math.atan2(n,r)*cVe):NaN,o,e,i]}function fVe([t,e,r,n]){return t=isNaN(t)?0:t*uVe,ofe([r,Math.cos(t)*e,Math.sin(t)*e,n])}function hVe([t,e,r,n]){t=nfe(t),e/=100,r/=100;function i(o){let s=(o+t/30)%12,a=e*Math.min(r,1-r);return r-a*Math.max(-1,Math.min(s-3,9-s,1))}return[i(0),i(8),i(4),n]}function dVe(t){if(t=t.toLowerCase().trim(),t==="transparent")return[0,0,0,0];let e=mVe[t];if(e){let[i,o,s]=e;return[i/255,o/255,s/255,1]}if(t.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){let o=t.length<6?1:2,s=1;return[NA(t.slice(s,s+=o)),NA(t.slice(s,s+=o)),NA(t.slice(s,s+=o)),NA(t.slice(s,s+o)||"ff")]}if(t.startsWith("rgb")){let i=/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,o=t.match(i);if(o){let[s,a,l,u,c,p,f,d,m,y,g,b]=o,w=[u||" ",f||" ",y].join("");if(w===" "||w===" /"||w===",,"||w===",,,"){let S=[l,p,m].join(""),I=S==="%%%"?100:S===""?255:0;if(I){let P=[Y1(+a/I,0,1),Y1(+c/I,0,1),Y1(+d/I,0,1),g?Lpe(+g,b):1];if(Dpe(P))return P}}return}}let r=/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,n=t.match(r);if(n){let[i,o,s,a,l,u,c,p,f]=n,d=[s||" ",l||" ",c].join("");if(d===" "||d===" /"||d===",,"||d===",,,"){let m=[+o,Y1(+a,0,100),Y1(+u,0,100),p?Lpe(+p,f):1];if(Dpe(m))return hVe(m)}}}function NA(t){return parseInt(t.padEnd(2,t),16)/255}function Lpe(t,e){return Y1(e?t/100:t,0,1)}function Y1(t,e,r){return Math.min(Math.max(e,t),r)}function Dpe(t){return!t.some(Number.isNaN)}function sfe(t,e,r,n){return typeof t=="number"&&t>=0&&t<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?typeof n>"u"||typeof n=="number"&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof n=="number"?[t,e,r,n]:[t,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function BI(t){if(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||t instanceof wt||t instanceof RI||t instanceof Xc||t instanceof ff||t instanceof ym||t instanceof $a)return!0;if(Array.isArray(t)){for(let e of t)if(!BI(e))return!1;return!0}else if(typeof t=="object"){for(let e in t)if(!BI(t[e]))return!1;return!0}else return!1}function xo(t){if(t===null)return sb;if(typeof t=="string")return _t;if(typeof t=="boolean")return lt;if(typeof t=="number")return ce;if(t instanceof wt)return cf;if(t instanceof RI)return nL;if(t instanceof Xc)return iL;if(t instanceof ff)return oL;if(t instanceof ym)return sL;if(t instanceof $a)return HI;if(Array.isArray(t)){let e=t.length,r;for(let n of t){let i=xo(n);if(!r)r=i;else{if(r===i)continue;r=ut;break}}return Tl(r||ut,e)}else return J1}function OI(t){let e=typeof t;return t===null?"":e==="string"||e==="number"||e==="boolean"?String(t):t instanceof wt||t instanceof Xc||t instanceof ff||t instanceof ym||t instanceof $a?t.toString():JSON.stringify(t)}function aL(t,e){let r=t.length-1,n=0,i=r,o=0,s,a;for(;n<=i;)if(o=Math.floor((n+i)/2),s=t[o],a=t[o+1],s<=e){if(o===r||e<a)return o;n=o+1}else if(s>e)i=o-1;else throw new bi("Input is not a number.");return 0}function vVe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function xVe(){if(kpe)return g9;kpe=1,g9=t;function t(e,r,n,i){this.cx=3*e,this.bx=3*(n-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(i-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=r,this.p2x=n,this.p2y=i}return t.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,r){if(r===void 0&&(r=1e-6),e<0)return 0;if(e>1)return 1;for(var n=e,i=0;i<8;i++){var o=this.sampleCurveX(n)-e;if(Math.abs(o)<r)return n;var s=this.sampleCurveDerivativeX(n);if(Math.abs(s)<1e-6)break;n=n-o/s}var a=0,l=1;for(n=e,i=0;i<20&&(o=this.sampleCurveX(n),!(Math.abs(o-e)<r));i++)e>o?a=n:l=n,n=(l-a)*.5+a;return n},solve:function(e,r){return this.sampleCurveY(this.solveCurveX(e,r))}},g9}function wVe(t){return t==="rgb"||t==="hcl"||t==="lab"}function zg(t,e,r){return t+r*(e-t)}function SVe(t,e,r,n="rgb"){switch(n){case"rgb":{let[i,o,s,a]=WA(t.rgb,e.rgb,r);return new wt(i,o,s,a,!1)}case"hcl":{let[i,o,s,a]=t.hcl,[l,u,c,p]=e.hcl,f,d;if(!isNaN(i)&&!isNaN(l)){let w=l-i;l>i&&w>180?w-=360:l<i&&i-l>180&&(w+=360),f=i+r*w}else isNaN(i)?isNaN(l)?f=NaN:(f=l,(s===1||s===0)&&(d=u)):(f=i,(c===1||c===0)&&(d=o));let[m,y,g,b]=fVe([f,d??zg(o,u,r),zg(s,c,r),zg(a,p,r)]);return new wt(m,y,g,b,!1)}case"lab":{let[i,o,s,a]=ofe(WA(t.lab,e.lab,r));return new wt(i,o,s,a,!1)}}}function WA(t,e,r){return t.map((n,i)=>zg(n,e[i],r))}function IVe(t,e,r){return new ff(WA(t.values,e.values,r))}function PVe(t,e,r){let n=t.values,i=e.values;if(n.length!==i.length)throw new bi(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${e.toString()}`);let o=[];for(let s=0;s<n.length;s+=2){if(n[s]!==i[s])throw new bi(`Cannot interpolate values containing mismatched anchors. from[${s}]: ${n[s]}, to[${s}]: ${i[s]}`);o.push(n[s]);let[a,l]=n[s+1],[u,c]=i[s+1];o.push([zg(a,u,r),zg(l,c,r)])}return new ym(o)}function v9(t,e,r,n){let i=n-r,o=t-r;return i===0?0:e===1?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}function Fpe(t,e){return t==="=="||t==="!="?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 CVe(t,e,r){return e===r}function TVe(t,e,r){return e!==r}function EVe(t,e,r){return e<r}function MVe(t,e,r){return e>r}function AVe(t,e,r){return e<=r}function LVe(t,e,r){return e>=r}function afe(t,e,r,n){return n.compare(e,r)===0}function DVe(t,e,r,n){return!afe(t,e,r,n)}function OVe(t,e,r,n){return n.compare(e,r)<0}function kVe(t,e,r,n){return n.compare(e,r)>0}function FVe(t,e,r,n){return n.compare(e,r)<=0}function RVe(t,e,r,n){return n.compare(e,r)>=0}function ab(t,e,r){let n=t!=="=="&&t!=="!=";return class lfe{constructor(o,s,a){this.type=lt,this.lhs=o,this.rhs=s,this.collator=a,this.hasUntypedArgument=o.type.kind==="value"||s.type.kind==="value"}static parse(o,s){if(o.length!==3&&o.length!==4)return s.error("Expected two or three arguments.");let a=o[0],l=s.parse(o[1],1,ut);if(!l)return null;if(!Fpe(a,l.type))return s.concat(1).error(`"${a}" comparisons are not supported for type '${ai(l.type)}'.`);let u=s.parse(o[2],2,ut);if(!u)return null;if(!Fpe(a,u.type))return s.concat(2).error(`"${a}" comparisons are not supported for type '${ai(u.type)}'.`);if(l.type.kind!==u.type.kind&&l.type.kind!=="value"&&u.type.kind!=="value")return s.error(`Cannot compare types '${ai(l.type)}' and '${ai(u.type)}'.`);n&&(l.type.kind==="value"&&u.type.kind!=="value"?l=new Wc(u.type,[l]):l.type.kind!=="value"&&u.type.kind==="value"&&(u=new Wc(l.type,[u])));let c=null;if(o.length===4){if(l.type.kind!=="string"&&u.type.kind!=="string"&&l.type.kind!=="value"&&u.type.kind!=="value")return s.error("Cannot use collator to compare non-string types.");if(c=s.parse(o[3],3,nL),!c)return null}return new lfe(l,u,c)}evaluate(o){let s=this.lhs.evaluate(o),a=this.rhs.evaluate(o);if(n&&this.hasUntypedArgument){let l=xo(s),u=xo(a);if(l.kind!==u.kind||!(l.kind==="string"||l.kind==="number"))throw new bi(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${l.kind}, ${u.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){let l=xo(s),u=xo(a);if(l.kind!=="string"||u.kind!=="string")return e(o,s,a)}return this.collator?r(o,s,a,this.collator.evaluate(o)):e(o,s,a)}eachChild(o){o(this.lhs),o(this.rhs),this.collator&&o(this.collator)}outputDefined(){return!0}}}function jVe(t,e){let r=$Ve(t[0]),n=HVe(t[1]),i=Math.pow(2,e.z);return[Math.round(r*i*pf),Math.round(n*i*pf)]}function V9(t,e){let r=Math.pow(2,e.z),n=(t[0]/pf+e.x)/r,i=(t[1]/pf+e.y)/r;return[qVe(n),WVe(i)]}function $Ve(t){return(180+t)/360}function qVe(t){return t*360-180}function HVe(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function WVe(t){return 360/Math.PI*Math.atan(Math.exp((180-t*360)*Math.PI/180))-90}function WI(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function zI(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function ZVe(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function XVe(t,e,r){let n=t[0]-e[0],i=t[1]-e[1],o=t[0]-r[0],s=t[1]-r[1];return n*s-o*i===0&&n*o<=0&&i*s<=0}function lL(t,e,r,n){let i=[e[0]-t[0],e[1]-t[1]],o=[n[0]-r[0],n[1]-r[1]];return QVe(o,i)===0?!1:!!(Rpe(t,e,r,n)&&Rpe(r,n,t,e))}function YVe(t,e,r){for(let n of r)for(let i=0;i<n.length-1;++i)if(lL(t,e,n[i],n[i+1]))return!0;return!1}function lb(t,e,r=!1){let n=!1;for(let i of e)for(let o=0;o<i.length-1;o++){if(XVe(t,i[o],i[o+1]))return r;ZVe(t,i[o],i[o+1])&&(n=!n)}return n}function KVe(t,e){for(let r of e)if(lb(t,r))return!0;return!1}function ufe(t,e){for(let r of t)if(!lb(r,e))return!1;for(let r=0;r<t.length-1;++r)if(YVe(t[r],t[r+1],e))return!1;return!0}function JVe(t,e){for(let r of e)if(ufe(t,r))return!0;return!1}function QVe(t,e){return t[0]*e[1]-t[1]*e[0]}function Rpe(t,e,r,n){let i=t[0]-r[0],o=t[1]-r[1],s=e[0]-r[0],a=e[1]-r[1],l=n[0]-r[0],u=n[1]-r[1],c=i*u-l*o,p=s*u-l*a;return c>0&&p<0||c<0&&p>0}function U9(t,e,r){let n=[];for(let i=0;i<t.length;i++){let o=[];for(let s=0;s<t[i].length;s++){let a=jVe(t[i][s],r);WI(e,a),o.push(a)}n.push(o)}return n}function cfe(t,e,r){let n=[];for(let i=0;i<t.length;i++){let o=U9(t[i],e,r);n.push(o)}return n}function pfe(t,e,r,n){if(t[0]<r[0]||t[0]>r[2]){let i=n*.5,o=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;o===0&&(o=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=o}WI(e,t)}function eUe(t){t[0]=t[1]=1/0,t[2]=t[3]=-1/0}function Npe(t,e,r,n){let i=Math.pow(2,n.z)*pf,o=[n.x*pf,n.y*pf],s=[];for(let a of t)for(let l of a){let u=[l.x+o[0],l.y+o[1]];pfe(u,e,r,i),s.push(u)}return s}function Bpe(t,e,r,n){let i=Math.pow(2,n.z)*pf,o=[n.x*pf,n.y*pf],s=[];for(let a of t){let l=[];for(let u of a){let c=[u.x+o[0],u.y+o[1]];WI(e,c),l.push(c)}s.push(l)}if(e[2]-e[0]<=i/2){eUe(e);for(let a of s)for(let l of a)pfe(l,e,r,i)}return s}function tUe(t,e){let r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(e.type==="Polygon"){let o=U9(e.coordinates,n,i),s=Npe(t.geometry(),r,n,i);if(!zI(r,n))return!1;for(let a of s)if(!lb(a,o))return!1}if(e.type==="MultiPolygon"){let o=cfe(e.coordinates,n,i),s=Npe(t.geometry(),r,n,i);if(!zI(r,n))return!1;for(let a of s)if(!KVe(a,o))return!1}return!0}function rUe(t,e){let r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(e.type==="Polygon"){let o=U9(e.coordinates,n,i),s=Bpe(t.geometry(),r,n,i);if(!zI(r,n))return!1;for(let a of s)if(!ufe(a,o))return!1}if(e.type==="MultiPolygon"){let o=cfe(e.coordinates,n,i),s=Bpe(t.geometry(),r,n,i);if(!zI(r,n))return!1;for(let a of s)if(!JVe(a,o))return!1}return!0}function nUe(t,e,r,n,i){ffe(t,e,r,n||t.length-1,i||iUe)}function ffe(t,e,r,n,i){for(;n>r;){if(n-r>600){var o=n-r+1,s=e-r+1,a=Math.log(o),l=.5*Math.exp(2*a/3),u=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1),c=Math.max(r,Math.floor(e-s*l/o+u)),p=Math.min(n,Math.floor(e+(o-s)*l/o+u));ffe(t,e,c,p,i)}var f=t[e],d=r,m=n;for(LI(t,r,e),i(t[n],f)>0&&LI(t,r,n);d<m;){for(LI(t,d,m),d++,m--;i(t[d],f)<0;)d++;for(;i(t[m],f)>0;)m--}i(t[r],f)===0?LI(t,r,m):(m++,LI(t,m,n)),m<=e&&(r=m+1),e<=m&&(n=m-1)}}function LI(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function iUe(t,e){return t<e?-1:t>e?1:0}function oUe(t,e){if(t.length<=1)return[t];let n=[],i,o;for(let s of t){let a=aUe(s);a!==0&&(s.area=Math.abs(a),o===void 0&&(o=a<0),o===a<0?(i&&n.push(i),i=[s]):i.push(s))}if(i&&n.push(i),e>1)for(let s=0;s<n.length;s++)n[s].length<=e||(nUe(n[s],e,1,n[s].length-1,sUe),n[s]=n[s].slice(0,e));return n}function sUe(t,e){return e.area-t.area}function aUe(t){let e=0;for(let r=0,n=t.length,i=n-1,o,s;r<n;i=r++)o=t[r],s=t[i],e+=(s.x-o.x)*(o.y+s.y);return e}function hfe(t,e){return e[0]-t[0]}function KA(t){return t[1]-t[0]+1}function Oh(t,e){return t[1]>=t[0]&&t[1]<e}function F9(t,e){if(t[0]>t[1])return[null,null];let r=KA(t);if(e){if(r===2)return[t,null];let i=Math.floor(r/2);return[[t[0],t[0]+i],[t[0]+i,t[1]]]}if(r===1)return[t,null];let n=Math.floor(r/2)-1;return[[t[0],t[0]+n],[t[0]+n+1,t[1]]]}function R9(t,e){if(!Oh(e,t.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let n=e[0];n<=e[1];++n)WI(r,t[n]);return r}function N9(t){let e=[1/0,1/0,-1/0,-1/0];for(let r of t)for(let n of r)WI(e,n);return e}function Gpe(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function G9(t,e,r){if(!Gpe(t)||!Gpe(e))return NaN;let n=0,i=0;return t[2]<e[0]&&(n=e[0]-t[2]),t[0]>e[2]&&(n=t[0]-e[2]),t[1]>e[3]&&(i=t[1]-e[3]),t[3]<e[1]&&(i=e[1]-t[3]),r.distance([0,0],[n,i])}function Ng(t,e,r){let n=r.pointOnLine(e,t);return r.distance(t,n.point)}function j9(t,e,r,n,i){let o=Math.min(Ng(t,[r,n],i),Ng(e,[r,n],i)),s=Math.min(Ng(r,[t,e],i),Ng(n,[t,e],i));return Math.min(o,s)}function uUe(t,e,r,n,i){if(!(Oh(e,t.length)&&Oh(n,r.length)))return 1/0;let s=1/0;for(let a=e[0];a<e[1];++a){let l=t[a],u=t[a+1];for(let c=n[0];c<n[1];++c){let p=r[c],f=r[c+1];if(lL(l,u,p,f))return 0;s=Math.min(s,j9(l,u,p,f,i))}}return s}function cUe(t,e,r,n,i){if(!(Oh(e,t.length)&&Oh(n,r.length)))return NaN;let s=1/0;for(let a=e[0];a<=e[1];++a)for(let l=n[0];l<=n[1];++l)if(s=Math.min(s,i.distance(t[a],r[l])),s===0)return s;return s}function pUe(t,e,r){if(lb(t,e,!0))return 0;let n=1/0;for(let i of e){let o=i[0],s=i[i.length-1];if(o!==s&&(n=Math.min(n,Ng(t,[s,o],r)),n===0))return n;let a=r.pointOnLine(i,t);if(n=Math.min(n,r.distance(t,a.point)),n===0)return n}return n}function fUe(t,e,r,n){if(!Oh(e,t.length))return NaN;for(let o=e[0];o<=e[1];++o)if(lb(t[o],r,!0))return 0;let i=1/0;for(let o=e[0];o<e[1];++o){let s=t[o],a=t[o+1];for(let l of r)for(let u=0,c=l.length,p=c-1;u<c;p=u++){let f=l[p],d=l[u];if(lL(s,a,f,d))return 0;i=Math.min(i,j9(s,a,f,d,n))}}return i}function jpe(t,e){for(let r of t)for(let n of r)if(lb(n,e,!0))return!0;return!1}function hUe(t,e,r,n=1/0){let i=N9(t),o=N9(e);if(n!==1/0&&G9(i,o,r)>=n)return n;if(zI(i,o)){if(jpe(t,e))return 0}else if(jpe(e,t))return 0;let s=1/0;for(let a of t)for(let l=0,u=a.length,c=u-1;l<u;c=l++){let p=a[c],f=a[l];for(let d of e)for(let m=0,y=d.length,g=y-1;m<y;g=m++){let b=d[g],w=d[m];if(lL(p,f,b,w))return 0;s=Math.min(s,j9(p,f,b,w,r))}}return s}function $pe(t,e,r,n,i,o){if(!o)return;let s=G9(R9(n,o),i,r);s<e&&t.push([s,o,[0,0]])}function zA(t,e,r,n,i,o,s){if(!o||!s)return;let a=G9(R9(n,o),R9(i,s),r);a<e&&t.push([a,o,s])}function JA(t,e,r,n,i=1/0){let o=Math.min(n.distance(t[0],r[0][0]),i);if(o===0)return o;let s=new YA([[0,[0,t.length-1],[0,0]]],hfe),a=N9(r);for(;s.length>0;){let l=s.pop();if(l[0]>=o)continue;let u=l[1],c=e?k9:O9;if(KA(u)<=c){if(!Oh(u,t.length))return NaN;if(e){let p=fUe(t,u,r,n);if(isNaN(p)||p===0)return p;o=Math.min(o,p)}else for(let p=u[0];p<=u[1];++p){let f=pUe(t[p],r,n);if(o=Math.min(o,f),o===0)return 0}}else{let p=F9(u,e);$pe(s,o,n,t,a,p[0]),$pe(s,o,n,t,a,p[1])}}return o}function QA(t,e,r,n,i,o=1/0){let s=Math.min(o,i.distance(t[0],r[0]));if(s===0)return s;let a=new YA([[0,[0,t.length-1],[0,r.length-1]]],hfe);for(;a.length>0;){let l=a.pop();if(l[0]>=s)continue;let u=l[1],c=l[2],p=e?k9:O9,f=n?k9:O9;if(KA(u)<=p&&KA(c)<=f){if(!Oh(u,t.length)&&Oh(c,r.length))return NaN;let d;if(e&&n)d=uUe(t,u,r,c,i),s=Math.min(s,d);else if(e&&!n){let m=t.slice(u[0],u[1]+1);for(let y=c[0];y<=c[1];++y)if(d=Ng(r[y],m,i),s=Math.min(s,d),s===0)return s}else if(!e&&n){let m=r.slice(c[0],c[1]+1);for(let y=u[0];y<=u[1];++y)if(d=Ng(t[y],m,i),s=Math.min(s,d),s===0)return s}else d=cUe(t,u,r,c,i),s=Math.min(s,d)}else{let d=F9(u,e),m=F9(c,n);zA(a,s,i,t,r,d[0],m[0]),zA(a,s,i,t,r,d[0],m[1]),zA(a,s,i,t,r,d[1],m[0]),zA(a,s,i,t,r,d[1],m[1])}}return s}function dUe(t,e){let r=t.geometry(),n=r.flat().map(s=>V9([s.x,s.y],t.canonical));if(r.length===0)return NaN;let i=new UI(n[0][1]),o=1/0;for(let s of e){switch(s.type){case"Point":o=Math.min(o,QA(n,!1,[s.coordinates],!1,i,o));break;case"LineString":o=Math.min(o,QA(n,!1,s.coordinates,!0,i,o));break;case"Polygon":o=Math.min(o,JA(n,!1,s.coordinates,i,o));break}if(o===0)return o}return o}function mUe(t,e){let r=t.geometry(),n=r.flat().map(s=>V9([s.x,s.y],t.canonical));if(r.length===0)return NaN;let i=new UI(n[0][1]),o=1/0;for(let s of e){switch(s.type){case"Point":o=Math.min(o,QA(n,!0,[s.coordinates],!1,i,o));break;case"LineString":o=Math.min(o,QA(n,!0,s.coordinates,!0,i,o));break;case"Polygon":o=Math.min(o,JA(n,!0,s.coordinates,i,o));break}if(o===0)return o}return o}function yUe(t,e){let r=t.geometry();if(r.length===0||r[0].length===0)return NaN;let n=oUe(r,0).map(s=>s.map(a=>a.map(l=>V9([l.x,l.y],t.canonical)))),i=new UI(n[0][0][0][1]),o=1/0;for(let s of e)for(let a of n){switch(s.type){case"Point":o=Math.min(o,JA([s.coordinates],!1,a,i,o));break;case"LineString":o=Math.min(o,JA(s.coordinates,!0,a,i,o));break;case"Polygon":o=Math.min(o,hUe(a,s.coordinates,i,o));break}if(o===0)return o}return o}function x9(t){return t.type==="MultiPolygon"?t.coordinates.map(e=>({type:"Polygon",coordinates:e})):t.type==="MultiLineString"?t.coordinates.map(e=>({type:"LineString",coordinates:e})):t.type==="MultiPoint"?t.coordinates.map(e=>({type:"Point",coordinates:e})):[t]}function qpe(t,[e,r,n,i]){e=e.evaluate(t),r=r.evaluate(t),n=n.evaluate(t);let o=i?i.evaluate(t):1,s=sfe(e,r,n,o);if(s)throw new bi(s);return new wt(e/255,r/255,n/255,o,!1)}function Hpe(t,e){return t in e}function b9(t,e){let r=e[t];return typeof r>"u"?null:r}function gUe(t,e,r,n){for(;r<=n;){let i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}function Rg(t){return{type:t}}function vUe(t){return Array.isArray(t)?`(${t.map(ai).join(", ")})`:`(${ai(t.type)}...)`}function eL(t){if(t instanceof qA)return eL(t.boundExpression);if(t instanceof hf&&t.name==="error")return!1;if(t instanceof XA)return!1;if(t instanceof VI)return!1;if(t instanceof GI)return!1;let e=t instanceof mm||t instanceof Wc,r=!0;return t.eachChild(n=>{e?r=r&&eL(n):r=r&&n instanceof tb}),r?uL(t)&&cL(t,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function uL(t){if(t instanceof hf){if(t.name==="get"&&t.args.length===1)return!1;if(t.name==="feature-state")return!1;if(t.name==="has"&&t.args.length===1)return!1;if(t.name==="properties"||t.name==="geometry-type"||t.name==="id")return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof VI||t instanceof GI)return!1;let e=!0;return t.eachChild(r=>{e&&!uL(r)&&(e=!1)}),e}function jI(t){if(t instanceof hf&&t.name==="feature-state")return!1;let e=!0;return t.eachChild(r=>{e&&!jI(r)&&(e=!1)}),e}function cL(t,e){if(t instanceof hf&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild(n=>{r&&!cL(n,e)&&(r=!1)}),r}function B9(t){return{result:"success",value:t}}function K1(t){return{result:"error",value:t}}function rb(t){return t["property-type"]==="data-driven"||t["property-type"]==="cross-faded-data-driven"}function dfe(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function $9(t){return!!t.expression&&t.expression.interpolated}function zr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":t===null?"null":typeof t}function q9(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function xUe(t){return t}function mfe(t,e){let r=e.type==="color",n=t.stops&&typeof t.stops[0][0]=="object",i=n||t.property!==void 0,o=n||!i,s=t.type||($9(e)?"exponential":"interval");if(r||e.type==="padding"){let c=r?wt.parse:ff.parse;t=eb({},t),t.stops&&(t.stops=t.stops.map(p=>[p[0],c(p[1])])),t.default?t.default=c(t.default):t.default=c(e.default)}if(t.colorSpace&&!wVe(t.colorSpace))throw new Error(`Unknown color space: "${t.colorSpace}"`);let a,l,u;if(s==="exponential")a=Wpe;else if(s==="interval")a=_Ue;else if(s==="categorical"){a=bUe,l=Object.create(null);for(let c of t.stops)l[c[0]]=c[1];u=typeof t.stops[0][0]}else if(s==="identity")a=wUe;else throw new Error(`Unknown function type "${s}"`);if(n){let c={},p=[];for(let m=0;m<t.stops.length;m++){let y=t.stops[m],g=y[0].zoom;c[g]===void 0&&(c[g]={zoom:g,type:t.type,property:t.property,default:t.default,stops:[]},p.push(g)),c[g].stops.push([y[0].value,y[1]])}let f=[];for(let m of p)f.push([c[m].zoom,mfe(c[m],e)]);let d={name:"linear"};return{kind:"composite",interpolationType:d,interpolationFactor:Zc.interpolationFactor.bind(void 0,d),zoomStops:f.map(m=>m[0]),evaluate({zoom:m},y){return Wpe({stops:f,base:t.base},e,m).evaluate(m,y)}}}else if(o){let c=s==="exponential"?{name:"exponential",base:t.base!==void 0?t.base:1}:null;return{kind:"camera",interpolationType:c,interpolationFactor:Zc.interpolationFactor.bind(void 0,c),zoomStops:t.stops.map(p=>p[0]),evaluate:({zoom:p})=>a(t,e,p,l,u)}}else return{kind:"source",evaluate(c,p){let f=p&&p.properties?p.properties[t.property]:void 0;return f===void 0?ZI(t.default,e.default):a(t,e,f,l,u)}}}function ZI(t,e,r){if(t!==void 0)return t;if(e!==void 0)return e;if(r!==void 0)return r}function bUe(t,e,r,n,i){let o=typeof r===i?n[r]:void 0;return ZI(o,t.default,e.default)}function _Ue(t,e,r){if(zr(r)!=="number")return ZI(t.default,e.default);let n=t.stops.length;if(n===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];let i=aL(t.stops.map(o=>o[0]),r);return t.stops[i][1]}function Wpe(t,e,r){let n=t.base!==void 0?t.base:1;if(zr(r)!=="number")return ZI(t.default,e.default);let i=t.stops.length;if(i===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];let o=aL(t.stops.map(c=>c[0]),r),s=SUe(r,n,t.stops[o][0],t.stops[o+1][0]),a=t.stops[o][1],l=t.stops[o+1][1],u=Vg[e.type]||xUe;return typeof a.evaluate=="function"?{evaluate(...c){let p=a.evaluate.apply(void 0,c),f=l.evaluate.apply(void 0,c);if(!(p===void 0||f===void 0))return u(p,f,s,t.colorSpace)}}:u(a,l,s,t.colorSpace)}function wUe(t,e,r){switch(e.type){case"color":r=wt.parse(r);break;case"formatted":r=Xc.fromString(r.toString());break;case"resolvedImage":r=$a.fromString(r.toString());break;case"padding":r=ff.parse(r);break;default:zr(r)!==e.type&&(e.type!=="enum"||!e.values[r])&&(r=void 0)}return ZI(r,t.default,e.default)}function SUe(t,e,r,n){let i=n-r,o=t-r;return i===0?0:e===1?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}function yfe(t){return Array.isArray(t)&&t.length>0&&typeof t[0]=="string"&&t[0]in jg}function H9(t,e){let r=new jA(jg,eL,[],e?PUe(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return n?B9(new $I(n,e)):K1(r.errors)}function IUe(t,e){let r=H9(t,e);if(r.result==="error")return r;let n=r.value.expression,i=uL(n);if(!i&&!rb(e))return K1([new Bu("","data expressions not supported")]);let o=cL(n,["zoom"]);if(!o&&!dfe(e))return K1([new Bu("","zoom expressions not supported")]);let s=UA(n);if(!s&&!o)return K1([new Bu("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(s instanceof Bu)return K1([s]);if(s instanceof Zc&&!$9(e))return K1([new Bu("",'"interpolate" expressions cannot be used with this property')]);if(!s)return B9(i?new nb("constant",r.value):new nb("source",r.value));let a=s instanceof Zc?s.interpolation:void 0;return B9(i?new ib("camera",r.value,s.labels,a):new ib("composite",r.value,s.labels,a))}function UA(t){let e=null;if(t instanceof $A)e=UA(t.result);else if(t instanceof ZA){for(let r of t.args)if(e=UA(r),e)break}else(t instanceof HA||t instanceof Zc)&&t.input instanceof hf&&t.input.name==="zoom"&&(e=t);return e instanceof Bu||t.eachChild(r=>{let n=UA(r);n instanceof Bu?e=n:!e&&n?e=new Bu("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&n&&e!==n&&(e=new Bu("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function PUe(t){let e={color:cf,string:_t,number:ce,enum:_t,boolean:lt,formatted:iL,padding:oL,resolvedImage:HI,variableAnchorOffsetCollection:sL};return t.type==="array"?Tl(e[t.value]||ut,t.length):e[t.type]}function CUe(t){return t.type==="color"&&q9(t.default)?new wt(0,0,0,0):t.type==="color"?wt.parse(t.default)||null:t.type==="padding"?ff.parse(t.default)||null:t.type==="variableAnchorOffsetCollection"?ym.parse(t.default)||null:t.default===void 0?null:t.default}function W9(t){if(t===!0||t===!1)return!0;if(!Array.isArray(t)||t.length===0)return!1;switch(t[0]){case"has":return t.length>=2&&t[1]!=="$id"&&t[1]!=="$type";case"in":return t.length>=3&&(typeof t[1]!="string"||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return t.length!==3||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(let e of t.slice(1))if(!W9(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}function XI(t){if(t==null)return{filter:()=>!0,needGeometry:!1};W9(t)||(t=rL(t));let e=H9(t,TUe);if(e.result==="error")throw new Error(e.value.map(r=>`${r.key}: ${r.message}`).join(", "));{let r=gfe(t);return{filter:(n,i,o)=>e.value.evaluate(n,i,{},o),needGeometry:r}}}function EUe(t,e){return t<e?-1:t>e?1:0}function gfe(t){if(!Array.isArray(t))return!1;if(t[0]==="within"||t[0]==="distance")return!0;for(let e=1;e<t.length;e++)if(gfe(t[e]))return!0;return!1}function rL(t){if(!t)return!0;let e=t[0];return t.length<=1?e!=="any":e==="=="?_9(t[1],t[2],"=="):e==="!="?VA(_9(t[1],t[2],"==")):e==="<"||e===">"||e==="<="||e===">="?_9(t[1],t[2],e):e==="any"?MUe(t.slice(1)):e==="all"?["all"].concat(t.slice(1).map(rL)):e==="none"?["all"].concat(t.slice(1).map(rL).map(VA)):e==="in"?Zpe(t[1],t.slice(2)):e==="!in"?VA(Zpe(t[1],t.slice(2))):e==="has"?Xpe(t[1]):e==="!has"?VA(Xpe(t[1])):!0}function _9(t,e,r){switch(t){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,t,e]}}function MUe(t){return["any"].concat(t.map(rL))}function Zpe(t,e){if(e.length===0)return!1;switch(t){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",t,["literal",e.sort(EUe)]]:["filter-in-small",t,["literal",e]]}}function Xpe(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function VA(t){return["!",t]}function vfe(){let t={},e=DI.$version;for(let r in DI.$root){let n=DI.$root[r];if(n.required){let i=null;r==="version"?i=e:n.type==="array"?i=[]:i={},i!=null&&(t[r]=i)}}return t}function xfe(t){let e=t.key,r=t.value;return r?[new te(e,r,"constants have been deprecated as of v8")]:[]}function Pi(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Ug(t){if(Array.isArray(t))return t.map(Ug);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){let e={};for(let r in t)e[r]=Ug(t[r]);return e}return Pi(t)}function zu(t){let e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},o=t.style,s=t.styleSpec,a=t.validateSpec,l=[],u=zr(r);if(u!=="object")return[new te(e,r,`object expected, ${u} found`)];for(let c in r){let p=c.split(".")[0],f=n[p]||n["*"],d;if(i[p])d=i[p];else if(n[p])d=a;else if(i["*"])d=i["*"];else if(n["*"])d=a;else{l.push(new te(e,r[c],`unknown property "${c}"`));continue}l=l.concat(d({key:(e&&`${e}.`)+c,value:r[c],valueSpec:f,style:o,styleSpec:s,object:r,objectKey:c,validateSpec:a},r))}for(let c in n)i[c]||n[c].required&&n[c].default===void 0&&r[c]===void 0&&l.push(new te(e,r,`missing required property "${c}"`));return l}function Z9(t){let e=t.value,r=t.valueSpec,n=t.validateSpec,i=t.style,o=t.styleSpec,s=t.key,a=t.arrayElementValidator||n;if(zr(e)!=="array")return[new te(s,e,`array expected, ${zr(e)} found`)];if(r.length&&e.length!==r.length)return[new te(s,e,`array length ${r.length} expected, length ${e.length} found`)];if(r["min-length"]&&e.length<r["min-length"])return[new te(s,e,`array length at least ${r["min-length"]} expected, length ${e.length} found`)];let l={type:r.value,values:r.values};o.$version<7&&(l.function=r.function),zr(r.value)==="object"&&(l=r.value);let u=[];for(let c=0;c<e.length;c++)u=u.concat(a({array:e,arrayIndex:c,value:e[c],valueSpec:l,validateSpec:t.validateSpec,style:i,styleSpec:o,key:`${s}[${c}]`}));return u}function X9(t){let e=t.key,r=t.value,n=t.valueSpec,i=zr(r);return i==="number"&&r!==r&&(i="NaN"),i!=="number"?[new te(e,r,`number expected, ${i} found`)]:"minimum"in n&&r<n.minimum?[new te(e,r,`${r} is less than the minimum value ${n.minimum}`)]:"maximum"in n&&r>n.maximum?[new te(e,r,`${r} is greater than the maximum value ${n.maximum}`)]:[]}function bfe(t){let e=t.valueSpec,r=Pi(t.value.type),n,i={},o,s,a=r!=="categorical"&&t.value.property===void 0,l=!a,u=zr(t.value.stops)==="array"&&zr(t.value.stops[0])==="array"&&zr(t.value.stops[0][0])==="object",c=zu({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:p,default:m}});return r==="identity"&&a&&c.push(new te(t.key,t.value,'missing required property "property"')),r!=="identity"&&!t.value.stops&&c.push(new te(t.key,t.value,'missing required property "stops"')),r==="exponential"&&t.valueSpec.expression&&!$9(t.valueSpec)&&c.push(new te(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!rb(t.valueSpec)?c.push(new te(t.key,t.value,"property functions not supported")):a&&!dfe(t.valueSpec)&&c.push(new te(t.key,t.value,"zoom functions not supported"))),(r==="categorical"||u)&&t.value.property===void 0&&c.push(new te(t.key,t.value,'"property" property is required')),c;function p(y){if(r==="identity")return[new te(y.key,y.value,'identity function may not have a "stops" property')];let g=[],b=y.value;return g=g.concat(Z9({key:y.key,value:b,valueSpec:y.valueSpec,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec,arrayElementValidator:f})),zr(b)==="array"&&b.length===0&&g.push(new te(y.key,b,"array must have at least one stop")),g}function f(y){let g=[],b=y.value,w=y.key;if(zr(b)!=="array")return[new te(w,b,`array expected, ${zr(b)} found`)];if(b.length!==2)return[new te(w,b,`array length 2 expected, length ${b.length} found`)];if(u){if(zr(b[0])!=="object")return[new te(w,b,`object expected, ${zr(b[0])} found`)];if(b[0].zoom===void 0)return[new te(w,b,"object stop key must have zoom")];if(b[0].value===void 0)return[new te(w,b,"object stop key must have value")];if(s&&s>Pi(b[0].zoom))return[new te(w,b[0].zoom,"stop zoom values must appear in ascending order")];Pi(b[0].zoom)!==s&&(s=Pi(b[0].zoom),o=void 0,i={}),g=g.concat(zu({key:`${w}[0]`,value:b[0],valueSpec:{zoom:{}},validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec,objectElementValidators:{zoom:X9,value:d}}))}else g=g.concat(d({key:`${w}[0]`,value:b[0],valueSpec:{},validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec},b));return yfe(Ug(b[1]))?g.concat([new te(`${w}[1]`,b[1],"expressions are not allowed in function stops.")]):g.concat(y.validateSpec({key:`${w}[1]`,value:b[1],valueSpec:e,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec}))}function d(y,g){let b=zr(y.value),w=Pi(y.value),S=y.value!==null?y.value:g;if(!n)n=b;else if(b!==n)return[new te(y.key,S,`${b} stop domain type must match previous stop domain type ${n}`)];if(b!=="number"&&b!=="string"&&b!=="boolean")return[new te(y.key,S,"stop domain value must be a number, string, or boolean")];if(b!=="number"&&r!=="categorical"){let I=`number expected, ${b} found`;return rb(e)&&r===void 0&&(I+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new te(y.key,S,I)]}return r==="categorical"&&b==="number"&&(!isFinite(w)||Math.floor(w)!==w)?[new te(y.key,S,`integer expected, found ${w}`)]:r!=="categorical"&&b==="number"&&o!==void 0&&w<o?[new te(y.key,S,"stop domain values must appear in ascending order")]:(o=w,r==="categorical"&&w in i?[new te(y.key,S,"stop domain values must be unique")]:(i[w]=!0,[]))}function m(y){return y.validateSpec({key:y.key,value:y.value,valueSpec:e,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec})}}function ob(t){let e=(t.expressionContext==="property"?IUe:H9)(Ug(t.value),t.valueSpec);if(e.result==="error")return e.value.map(n=>new te(`${t.key}${n.key}`,t.value,n.message));let r=e.value.expression||e.value._styleExpression.expression;if(t.expressionContext==="property"&&t.propertyKey==="text-font"&&!r.outputDefined())return[new te(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if(t.expressionContext==="property"&&t.propertyType==="layout"&&!jI(r))return[new te(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if(t.expressionContext==="filter"&&!jI(r))return[new te(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&t.expressionContext.indexOf("cluster")===0){if(!cL(r,["zoom","feature-state"]))return[new te(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(t.expressionContext==="cluster-initial"&&!uL(r))return[new te(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function AUe(t){let e=t.value,r=t.key,n=zr(e);return n!=="boolean"?[new te(r,e,`boolean expected, ${n} found`)]:[]}function LUe(t){let e=t.key,r=t.value,n=zr(r);return n!=="string"?[new te(e,r,`color expected, ${n} found`)]:wt.parse(String(r))?[]:[new te(e,r,`color expected, "${r}" found`)]}function qI(t){let e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?n.values.indexOf(Pi(r))===-1&&i.push(new te(e,r,`expected one of [${n.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(n.values).indexOf(Pi(r))===-1&&i.push(new te(e,r,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(r)} found`)),i}function Y9(t){return W9(Ug(t.value))?ob(eb({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):_fe(t)}function _fe(t){let e=t.value,r=t.key;if(zr(e)!=="array")return[new te(r,e,`array expected, ${zr(e)} found`)];let n=t.styleSpec,i,o=[];if(e.length<1)return[new te(r,e,"filter array must have at least 1 element")];switch(o=o.concat(qI({key:`${r}[0]`,value:e[0],valueSpec:n.filter_operator,style:t.style,styleSpec:t.styleSpec})),Pi(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&Pi(e[1])==="$type"&&o.push(new te(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&o.push(new te(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(i=zr(e[1]),i!=="string"&&o.push(new te(`${r}[1]`,e[1],`string expected, ${i} found`)));for(let s=2;s<e.length;s++)i=zr(e[s]),Pi(e[1])==="$type"?o=o.concat(qI({key:`${r}[${s}]`,value:e[s],valueSpec:n.geometry_type,style:t.style,styleSpec:t.styleSpec})):i!=="string"&&i!=="number"&&i!=="boolean"&&o.push(new te(`${r}[${s}]`,e[s],`string, number, or boolean expected, ${i} found`));break;case"any":case"all":case"none":for(let s=1;s<e.length;s++)o=o.concat(_fe({key:`${r}[${s}]`,value:e[s],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":i=zr(e[1]),e.length!==2?o.push(new te(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):i!=="string"&&o.push(new te(`${r}[1]`,e[1],`string expected, ${i} found`));break}return o}function wfe(t,e){let r=t.key,n=t.validateSpec,i=t.style,o=t.styleSpec,s=t.value,a=t.objectKey,l=o[`${e}_${t.layerType}`];if(!l)return[];let u=a.match(/^(.*)-transition$/);if(e==="paint"&&u&&l[u[1]]&&l[u[1]].transition)return n({key:r,value:s,valueSpec:o.transition,style:i,styleSpec:o});let c=t.valueSpec||l[a];if(!c)return[new te(r,s,`unknown property "${a}"`)];let p;if(zr(s)==="string"&&rb(c)&&!c.tokens&&(p=/^{([^}]+)}$/.exec(s)))return[new te(r,s,`"${a}" does not support interpolation syntax
|
|
67
67
|
Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(p[1])} }\`.`)];let f=[];return t.layerType==="symbol"&&(a==="text-field"&&i&&!i.glyphs&&f.push(new te(r,s,'use of "text-field" requires a style "glyphs" property')),a==="text-font"&&q9(Ug(s))&&Pi(s.type)==="identity"&&f.push(new te(r,s,'"text-font" does not support identity functions'))),f.concat(n({key:t.key,value:s,valueSpec:c,style:i,styleSpec:o,expressionContext:"property",propertyType:e,propertyKey:a}))}function Sfe(t){return wfe(t,"paint")}function Ife(t){return wfe(t,"layout")}function Pfe(t){let e=[],r=t.value,n=t.key,i=t.style,o=t.styleSpec;!r.type&&!r.ref&&e.push(new te(n,r,'either "type" or "ref" is required'));let s=Pi(r.type),a=Pi(r.ref);if(r.id){let l=Pi(r.id);for(let u=0;u<t.arrayIndex;u++){let c=i.layers[u];Pi(c.id)===l&&e.push(new te(n,r.id,`duplicate layer id "${r.id}", previously used at line ${c.id.__line__}`))}}if("ref"in r){["type","source","source-layer","filter","layout"].forEach(u=>{u in r&&e.push(new te(n,r[u],`"${u}" is prohibited for ref layers`))});let l;i.layers.forEach(u=>{Pi(u.id)===a&&(l=u)}),l?l.ref?e.push(new te(n,r.ref,"ref cannot reference another ref layer")):s=Pi(l.type):e.push(new te(n,r.ref,`ref layer "${a}" not found`))}else if(s!=="background")if(!r.source)e.push(new te(n,r,'missing required property "source"'));else{let l=i.sources&&i.sources[r.source],u=l&&Pi(l.type);l?u==="vector"&&s==="raster"?e.push(new te(n,r.source,`layer "${r.id}" requires a raster source`)):u!=="raster-dem"&&s==="hillshade"?e.push(new te(n,r.source,`layer "${r.id}" requires a raster-dem source`)):u==="raster"&&s!=="raster"?e.push(new te(n,r.source,`layer "${r.id}" requires a vector source`)):u==="vector"&&!r["source-layer"]?e.push(new te(n,r,`layer "${r.id}" must specify a "source-layer"`)):u==="raster-dem"&&s!=="hillshade"?e.push(new te(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):s==="line"&&r.paint&&r.paint["line-gradient"]&&(u!=="geojson"||!l.lineMetrics)&&e.push(new te(n,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new te(n,r.source,`source "${r.source}" not found`))}return e=e.concat(zu({key:n,value:r,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*"(){return[]},type(){return t.validateSpec({key:`${n}.type`,value:r.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:r,objectKey:"type"})},filter:Y9,layout(l){return zu({layer:r,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*"(u){return Ife(eb({layerType:s},u))}}})},paint(l){return zu({layer:r,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*"(u){return Sfe(eb({layerType:s},u))}}})}}})),e}function Gg(t){let e=t.value,r=t.key,n=zr(e);return n!=="string"?[new te(r,e,`string expected, ${n} found`)]:[]}function DUe(t){var e;let r=(e=t.sourceName)!==null&&e!==void 0?e:"",n=t.value,i=t.styleSpec,o=i.source_raster_dem,s=t.style,a=[],l=zr(n);if(n===void 0)return a;if(l!=="object")return a.push(new te("source_raster_dem",n,`object expected, ${l} found`)),a;let c=Pi(n.encoding)==="custom",p=["redFactor","greenFactor","blueFactor","baseShift"],f=t.value.encoding?`"${t.value.encoding}"`:"Default";for(let d in n)!c&&p.includes(d)?a.push(new te(d,n[d],`In "${r}": "${d}" is only valid when "encoding" is set to "custom". ${f} encoding found`)):o[d]?a=a.concat(t.validateSpec({key:d,value:n[d],valueSpec:o[d],validateSpec:t.validateSpec,style:s,styleSpec:i})):a.push(new te(d,n[d],`unknown property "${d}"`));return a}function Cfe(t){let e=t.value,r=t.key,n=t.styleSpec,i=t.style,o=t.validateSpec;if(!e.type)return[new te(r,e,'"type" is required')];let s=Pi(e.type),a;switch(s){case"vector":case"raster":return a=zu({key:r,value:e,valueSpec:n[`source_${s.replace("-","_")}`],style:t.style,styleSpec:n,objectElementValidators:Ype,validateSpec:o}),a;case"raster-dem":return a=DUe({sourceName:r,value:e,style:t.style,styleSpec:n,validateSpec:o}),a;case"geojson":if(a=zu({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n,validateSpec:o,objectElementValidators:Ype}),e.cluster)for(let l in e.clusterProperties){let[u,c]=e.clusterProperties[l],p=typeof u=="string"?[u,["accumulated"],["get",l]]:u;a.push(...ob({key:`${r}.${l}.map`,value:c,validateSpec:o,expressionContext:"cluster-map"})),a.push(...ob({key:`${r}.${l}.reduce`,value:p,validateSpec:o,expressionContext:"cluster-reduce"}))}return a;case"video":return zu({key:r,value:e,valueSpec:n.source_video,style:i,validateSpec:o,styleSpec:n});case"image":return zu({key:r,value:e,valueSpec:n.source_image,style:i,validateSpec:o,styleSpec:n});case"canvas":return[new te(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return qI({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,validateSpec:o,styleSpec:n})}}function OUe({key:t,value:e}){if(zr(e)==="string")return Gg({key:t,value:e});{let r=[];for(let n in e)r.push(...Gg({key:`${t}.${n}`,value:e[n]}));return r}}function Tfe(t){let e=t.value,r=t.styleSpec,n=r.light,i=t.style,o=[],s=zr(e);if(e===void 0)return o;if(s!=="object")return o=o.concat([new te("light",e,`object expected, ${s} found`)]),o;for(let a in e){let l=a.match(/^(.*)-transition$/);l&&n[l[1]]&&n[l[1]].transition?o=o.concat(t.validateSpec({key:a,value:e[a],valueSpec:r.transition,validateSpec:t.validateSpec,style:i,styleSpec:r})):n[a]?o=o.concat(t.validateSpec({key:a,value:e[a],valueSpec:n[a],validateSpec:t.validateSpec,style:i,styleSpec:r})):o=o.concat([new te(a,e[a],`unknown property "${a}"`)])}return o}function Efe(t){let e=t.value,r=t.styleSpec,n=r.sky,i=t.style,o=zr(e);if(e===void 0)return[];if(o!=="object")return[new te("sky",e,`object expected, ${o} found`)];let s=[];for(let a in e)n[a]?s=s.concat(t.validateSpec({key:a,value:e[a],valueSpec:n[a],style:i,styleSpec:r})):s=s.concat([new te(a,e[a],`unknown property "${a}"`)]);return s}function Mfe(t){let e=t.value,r=t.styleSpec,n=r.terrain,i=t.style,o=[],s=zr(e);if(e===void 0)return o;if(s!=="object")return o=o.concat([new te("terrain",e,`object expected, ${s} found`)]),o;for(let a in e)n[a]?o=o.concat(t.validateSpec({key:a,value:e[a],valueSpec:n[a],validateSpec:t.validateSpec,style:i,styleSpec:r})):o=o.concat([new te(a,e[a],`unknown property "${a}"`)]);return o}function kUe(t){return Gg(t).length===0?[]:ob(t)}function FUe(t){return Gg(t).length===0?[]:ob(t)}function RUe(t){let e=t.key,r=t.value;if(zr(r)==="array"){if(r.length<1||r.length>4)return[new te(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];let i={type:"number"},o=[];for(let s=0;s<r.length;s++)o=o.concat(t.validateSpec({key:`${e}[${s}]`,value:r[s],validateSpec:t.validateSpec,valueSpec:i}));return o}else return X9({key:e,value:r,valueSpec:{}})}function NUe(t){let e=t.key,r=t.value,n=zr(r),i=t.styleSpec;if(n!=="array"||r.length<1||r.length%2!==0)return[new te(e,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let o=[];for(let s=0;s<r.length;s+=2)o=o.concat(qI({key:`${e}[${s}]`,value:r[s],valueSpec:i.layout_symbol["text-anchor"]})),o=o.concat(Z9({key:`${e}[${s+1}]`,value:r[s+1],valueSpec:{length:2,value:"number"},validateSpec:t.validateSpec,style:t.style,styleSpec:i}));return o}function Afe(t){let e=[],r=t.value,n=t.key;if(Array.isArray(r)){let i=[],o=[];for(let s in r){r[s].id&&i.includes(r[s].id)&&e.push(new te(n,r,`all the sprites' ids must be unique, but ${r[s].id} is duplicated`)),i.push(r[s].id),r[s].url&&o.includes(r[s].url)&&e.push(new te(n,r,`all the sprites' URLs must be unique, but ${r[s].url} is duplicated`)),o.push(r[s].url);let a={id:{type:"string",required:!0},url:{type:"string",required:!0}};e=e.concat(zu({key:`${n}[${s}]`,value:r[s],valueSpec:a,validateSpec:t.validateSpec}))}return e}else return Gg({key:n,value:r})}function BUe(t){let e=t.value,r=t.styleSpec,n=r.projection,i=t.style,o=zr(e);if(e===void 0)return[];if(o!=="object")return[new te("projection",e,`object expected, ${o} found`)];let s=[];for(let a in e)n[a]?s=s.concat(t.validateSpec({key:a,value:e[a],valueSpec:n[a],style:i,styleSpec:r})):s=s.concat([new te(a,e[a],`unknown property "${a}"`)]);return s}function kI(t){let e=t.value,r=t.valueSpec,n=t.styleSpec;return t.validateSpec=kI,r.expression&&q9(Pi(e))?bfe(t):r.expression&&yfe(Ug(e))?ob(t):r.type&&Kpe[r.type]?Kpe[r.type](t):zu(eb({},t,{valueSpec:r.type?n[r.type]:r}))}function Lfe(t){let e=t.value,r=t.key,n=Gg(t);return n.length||(e.indexOf("{fontstack}")===-1&&n.push(new te(r,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&n.push(new te(r,e,'"glyphs" url must include a "{range}" token'))),n}function Vu(t,e=DI){let r=[];return r=r.concat(kI({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,validateSpec:kI,objectElementValidators:{glyphs:Lfe,"*"(){return[]}}})),t.constants&&(r=r.concat(xfe({key:"constants",value:t.constants,style:t,styleSpec:e,validateSpec:kI}))),Dfe(r)}function df(t){return function(e){return t({...e,validateSpec:kI})}}function Dfe(t){return[].concat(t).sort((e,r)=>e.line-r.line)}function mf(t){return function(...e){return Dfe(t.apply(this,e))}}var bze,_ze,wze,Sze,Ize,Pze,Cze,Tze,Eze,Mze,Aze,Lze,Dze,Oze,kze,Fze,Rze,Nze,Bze,zze,Vze,Uze,Gze,jze,$ze,qze,Hze,Wze,Zze,Xze,Yze,Kze,Jze,Qze,eVe,tVe,rVe,nVe,iVe,oVe,DI,te,Bu,w9,sb,ce,_t,lt,cf,J1,ut,sVe,nL,iL,oL,HI,sL,aVe,Jpe,Qpe,efe,tfe,Q1,rfe,lVe,uVe,cVe,mVe,wt,RI,NI,Xc,ff,yVe,ym,$a,tb,bi,BA,Wc,Ope,mm,gVe,GA,jA,$A,qA,S9,I9,P9,C9,T9,E9,HA,g9,kpe,bVe,_Ve,Vg,Zc,ZA,NVe,BVe,zVe,VVe,UVe,GVe,XA,M9,A9,L9,D9,pf,VI,YA,lUe,zpe,Vpe,Upe,UI,O9,k9,GI,jg,hf,$I,nb,ib,tL,TUe,Ype,Kpe,ua=h(()=>{bze=8,_ze={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"},roll:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},wze={"*":{type:"source"}},Sze=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],Ize={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:"*"}},Pze={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:"*"}},Cze={type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Tze={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"}},Eze={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"}}},Mze={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"}}},Aze={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"}},Lze=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],Dze={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Oze={"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"}},kze={"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"}},Fze={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Rze={"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"}},Nze={"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Bze={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},zze={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Vze={type:"array",value:"*"},Uze={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},Gze={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},jze={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},$ze={type:"array",value:"*",minimum:1},qze={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}},Hze={"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},Wze={source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},Zze={type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},Xze=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],Yze={"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"}},Kze={"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"}},Jze={"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"}},Qze={"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"}},eVe={"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"}},tVe={"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"}},rVe={"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"}},nVe={"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"}},iVe={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},oVe={"*":{type:"string"}},DI={$version:bze,$root:_ze,sources:wze,source:Sze,source_vector:Ize,source_raster:Pze,source_raster_dem:Cze,source_geojson:Tze,source_video:Eze,source_image:Mze,layer:Aze,layout:Lze,layout_background:Dze,layout_fill:Oze,layout_circle:kze,layout_heatmap:Fze,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:Rze,layout_symbol:Nze,layout_raster:Bze,layout_hillshade:zze,filter:Vze,filter_operator:Uze,geometry_type:Gze,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:jze,expression:$ze,light:qze,sky:Hze,terrain:Wze,projection:Zze,paint:Xze,paint_fill:Yze,"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:Kze,paint_circle:Jze,paint_heatmap:Qze,paint_symbol:eVe,paint_raster:tVe,paint_hillshade:rVe,paint_background:nVe,transition:iVe,"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:oVe},te=class{constructor(e,r,n,i){this.message=(e?`${e}: `:"")+n,i&&(this.identifier=i),r!=null&&r.__line__&&(this.line=r.__line__)}};Bu=class extends Error{constructor(e,r){super(r),this.message=r,this.key=e}},w9=class t{constructor(e,r=[]){this.parent=e,this.bindings={};for(let[n,i]of r)this.bindings[n]=i}concat(e){return new t(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return this.bindings[e]?!0:this.parent?this.parent.has(e):!1}},sb={kind:"null"},ce={kind:"number"},_t={kind:"string"},lt={kind:"boolean"},cf={kind:"color"},J1={kind:"object"},ut={kind:"value"},sVe={kind:"error"},nL={kind:"collator"},iL={kind:"formatted"},oL={kind:"padding"},HI={kind:"resolvedImage"},sL={kind:"variableAnchorOffsetCollection"};aVe=[sb,ce,_t,lt,cf,iL,J1,Tl(ut),oL,HI,sL];Jpe=.96422,Qpe=1,efe=.82521,tfe=4/29,Q1=6/29,rfe=3*Q1*Q1,lVe=Q1*Q1*Q1,uVe=Math.PI/180,cVe=180/Math.PI;mVe={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]},wt=class t{constructor(e,r,n,i=1,o=!0){this.r=e,this.g=r,this.b=n,this.a=i,o||(this.r*=i,this.g*=i,this.b*=i,i||this.overwriteGetter("rgb",[e,r,n,i]))}static parse(e){if(e instanceof t)return e;if(typeof e!="string")return;let r=dVe(e);if(r)return new t(...r,!1)}get rgb(){let{r:e,g:r,b:n,a:i}=this,o=i||1/0;return this.overwriteGetter("rgb",[e/o,r/o,n/o,i])}get hcl(){return this.overwriteGetter("hcl",pVe(this.rgb))}get lab(){return this.overwriteGetter("lab",ife(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){let[e,r,n,i]=this.rgb;return`rgba(${[e,r,n].map(o=>Math.round(o*255)).join(",")},${i})`}};wt.black=new wt(0,0,0,1);wt.white=new wt(1,1,1,1);wt.transparent=new wt(0,0,0,0);wt.red=new wt(1,0,0,1);RI=class{constructor(e,r,n){e?this.sensitivity=r?"variant":"case":this.sensitivity=r?"accent":"base",this.locale=n,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}},NI=class{constructor(e,r,n,i,o){this.text=e,this.image=r,this.scale=n,this.fontStack=i,this.textColor=o}},Xc=class t{constructor(e){this.sections=e}static fromString(e){return new t([new NI(e,null,null,null,null)])}isEmpty(){return this.sections.length===0?!0:!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof t?e:t.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}},ff=class t{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof t)return e;if(typeof e=="number")return new t([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(let 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]];break}return new t(e)}}toString(){return JSON.stringify(this.values)}},yVe=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]),ym=class t{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof t)return e;if(!(!Array.isArray(e)||e.length<1||e.length%2!==0)){for(let r=0;r<e.length;r+=2){let n=e[r],i=e[r+1];if(typeof n!="string"||!yVe.has(n)||!Array.isArray(i)||i.length!==2||typeof i[0]!="number"||typeof i[1]!="number")return}return new t(e)}}toString(){return JSON.stringify(this.values)}},$a=class t{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new t({name:e,available:!1}):null}};tb=class t{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(!BI(e[1]))return r.error("invalid value");let n=e[1],i=xo(n),o=r.expectedType;return i.kind==="array"&&i.N===0&&o&&o.kind==="array"&&(typeof o.N!="number"||o.N===0)&&(i=o),new t(i,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}},bi=class{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}},BA={string:_t,number:ce,boolean:lt,object:J1},Wc=class t{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 n=1,i,o=e[0];if(o==="array"){let a;if(e.length>2){let u=e[1];if(typeof u!="string"||!(u in BA)||u==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);a=BA[u],n++}else a=ut;let l;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);l=e[2],n++}i=Tl(a,l)}else{if(!BA[o])throw new Error(`Types doesn't contain name = ${o}`);i=BA[o]}let s=[];for(;n<e.length;n++){let a=r.parse(e[n],n,ut);if(!a)return null;s.push(a)}return new t(i,s)}evaluate(e){for(let r=0;r<this.args.length;r++){let n=this.args[r].evaluate(e);if(FI(this.type,xo(n))){if(r===this.args.length-1)throw new bi(`Expected value to be of type ${ai(this.type)}, but found ${ai(xo(n))} instead.`)}else return n}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},Ope={"to-boolean":lt,"to-color":cf,"to-number":ce,"to-string":_t},mm=class t{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 n=e[0];if(!Ope[n])throw new Error(`Can't parse ${n} as it is not part of the known types`);if((n==="to-boolean"||n==="to-string")&&e.length!==2)return r.error("Expected one argument.");let i=Ope[n],o=[];for(let s=1;s<e.length;s++){let a=r.parse(e[s],s,ut);if(!a)return null;o.push(a)}return new t(i,o)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let r,n;for(let i of this.args){if(r=i.evaluate(e),n=null,r instanceof wt)return r;if(typeof r=="string"){let o=e.parseColor(r);if(o)return o}else if(Array.isArray(r)&&(r.length<3||r.length>4?n=`Invalid rgba value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:n=sfe(r[0],r[1],r[2],r[3]),!n))return new wt(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new bi(n||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"padding":{let r;for(let n of this.args){r=n.evaluate(e);let i=ff.parse(r);if(i)return i}throw new bi(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"variableAnchorOffsetCollection":{let r;for(let n of this.args){r=n.evaluate(e);let i=ym.parse(r);if(i)return i}throw new bi(`Could not parse variableAnchorOffsetCollection from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"number":{let r=null;for(let n of this.args){if(r=n.evaluate(e),r===null)return 0;let i=Number(r);if(!isNaN(i))return i}throw new bi(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return Xc.fromString(OI(this.args[0].evaluate(e)));case"resolvedImage":return $a.fromString(OI(this.args[0].evaluate(e)));default:return OI(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},gVe=["Unknown","Point","LineString","Polygon"],GA=class{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"?gVe[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]=wt.parse(e)),r}},jA=class t{constructor(e,r,n=[],i,o=new w9,s=[]){this.registry=e,this.path=n,this.key=n.map(a=>`[${a}]`).join(""),this.scope=o,this.errors=s,this.expectedType=i,this._isConstant=r}parse(e,r,n,i,o={}){return r?this.concat(r,n,i)._parse(e,o):this._parse(e,o)}_parse(e,r){(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number")&&(e=["literal",e]);function n(i,o,s){return s==="assert"?new Wc(o,[i]):s==="coerce"?new mm(o,[i]):i}if(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", []].');let i=e[0];if(typeof i!="string")return this.error(`Expression name must be a string, but found ${typeof i} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let o=this.registry[i];if(o){let s=o.parse(e,this);if(!s)return null;if(this.expectedType){let a=this.expectedType,l=s.type;if((a.kind==="string"||a.kind==="number"||a.kind==="boolean"||a.kind==="object"||a.kind==="array")&&l.kind==="value")s=n(s,a,r.typeAnnotation||"assert");else if((a.kind==="color"||a.kind==="formatted"||a.kind==="resolvedImage")&&(l.kind==="value"||l.kind==="string"))s=n(s,a,r.typeAnnotation||"coerce");else if(a.kind==="padding"&&(l.kind==="value"||l.kind==="number"||l.kind==="array"))s=n(s,a,r.typeAnnotation||"coerce");else if(a.kind==="variableAnchorOffsetCollection"&&(l.kind==="value"||l.kind==="array"))s=n(s,a,r.typeAnnotation||"coerce");else if(this.checkSubtype(a,l))return null}if(!(s instanceof tb)&&s.type.kind!=="resolvedImage"&&this._isConstant(s)){let a=new GA;try{s=new tb(s.type,s.evaluate(a))}catch(l){return this.error(l.message),null}}return s}return this.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0)}else return typeof e>"u"?this.error("'undefined' value invalid. Use null instead."):typeof e=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,r,n){let i=typeof e=="number"?this.path.concat(e):this.path,o=n?this.scope.concat(n):this.scope;return new t(this.registry,this._isConstant,i,r||null,o,this.errors)}error(e,...r){let n=`${this.key}${r.map(i=>`[${i}]`).join("")}`;this.errors.push(new Bu(n,e))}checkSubtype(e,r){let n=FI(e,r);return n&&this.error(n),n}},$A=class t{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let 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.`);let n=[];for(let o=1;o<e.length-1;o+=2){let s=e[o];if(typeof s!="string")return r.error(`Expected string, but found ${typeof s} instead.`,o);if(/[^a-zA-Z0-9_]/.test(s))return r.error("Variable names must contain only alphanumeric characters or '_'.",o);let a=r.parse(e[o+1],o+1);if(!a)return null;n.push([s,a])}let i=r.parse(e[e.length-1],e.length-1,r.expectedType,n);return i?new t(n,i):null}outputDefined(){return this.result.outputDefined()}},qA=class t{constructor(e,r){this.type=r.type,this.name=e,this.boundExpression=r}static parse(e,r){if(e.length!==2||typeof e[1]!="string")return r.error("'var' expression requires exactly one string literal argument.");let n=e[1];return r.scope.has(n)?new t(n,r.scope.get(n)):r.error(`Unknown variable "${n}". Make sure "${n}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}},S9=class t{constructor(e,r,n){this.type=e,this.index=r,this.input=n}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let n=r.parse(e[1],1,ce),i=r.parse(e[2],2,Tl(r.expectedType||ut));if(!n||!i)return null;let o=i.type;return new t(o.itemType,n,i)}evaluate(e){let r=this.index.evaluate(e),n=this.input.evaluate(e);if(r<0)throw new bi(`Array index out of bounds: ${r} < 0.`);if(r>=n.length)throw new bi(`Array index out of bounds: ${r} > ${n.length-1}.`);if(r!==Math.floor(r))throw new bi(`Array index must be an integer, but found ${r} instead.`);return n[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},I9=class t{constructor(e,r){this.type=lt,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.`);let n=r.parse(e[1],1,ut),i=r.parse(e[2],2,ut);return!n||!i?null:z9(n.type,[lt,_t,ce,sb,ut])?new t(n,i):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${ai(n.type)} instead`)}evaluate(e){let r=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!n)return!1;if(!Bg(r,["boolean","string","number","null"]))throw new bi(`Expected first argument to be of type boolean, string, number or null, but found ${ai(xo(r))} instead.`);if(!Bg(n,["string","array"]))throw new bi(`Expected second argument to be of type array or string, but found ${ai(xo(n))} instead.`);return n.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}},P9=class t{constructor(e,r,n){this.type=ce,this.needle=e,this.haystack=r,this.fromIndex=n}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.`);let n=r.parse(e[1],1,ut),i=r.parse(e[2],2,ut);if(!n||!i)return null;if(!z9(n.type,[lt,_t,ce,sb,ut]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${ai(n.type)} instead`);if(e.length===4){let o=r.parse(e[3],3,ce);return o?new t(n,i,o):null}else return new t(n,i)}evaluate(e){let r=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!Bg(r,["boolean","string","number","null"]))throw new bi(`Expected first argument to be of type boolean, string, number or null, but found ${ai(xo(r))} instead.`);let i;if(this.fromIndex&&(i=this.fromIndex.evaluate(e)),Bg(n,["string"])){let o=n.indexOf(r,i);return o===-1?-1:[...n.slice(0,o)].length}else{if(Bg(n,["array"]))return n.indexOf(r,i);throw new bi(`Expected second argument to be of type array or string, but found ${ai(xo(n))} instead.`)}}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},C9=class t{constructor(e,r,n,i,o,s){this.inputType=e,this.type=r,this.input=n,this.cases=i,this.outputs=o,this.otherwise=s}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 n,i;r.expectedType&&r.expectedType.kind!=="value"&&(i=r.expectedType);let o={},s=[];for(let u=2;u<e.length-1;u+=2){let c=e[u],p=e[u+1];Array.isArray(c)||(c=[c]);let f=r.concat(u);if(c.length===0)return f.error("Expected at least one branch label.");for(let m of c){if(typeof m!="number"&&typeof m!="string")return f.error("Branch labels must be numbers or strings.");if(typeof m=="number"&&Math.abs(m)>Number.MAX_SAFE_INTEGER)return f.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof m=="number"&&Math.floor(m)!==m)return f.error("Numeric branch labels must be integer values.");if(!n)n=xo(m);else if(f.checkSubtype(n,xo(m)))return null;if(typeof o[String(m)]<"u")return f.error("Branch labels must be unique.");o[String(m)]=s.length}let d=r.parse(p,u,i);if(!d)return null;i=i||d.type,s.push(d)}let a=r.parse(e[1],1,ut);if(!a)return null;let l=r.parse(e[e.length-1],e.length-1,i);return!l||a.type.kind!=="value"&&r.concat(1).checkSubtype(n,a.type)?null:new t(n,i,a,o,s,l)}evaluate(e){let r=this.input.evaluate(e);return(xo(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()}},T9=class t{constructor(e,r,n){this.type=e,this.branches=r,this.otherwise=n}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 n;r.expectedType&&r.expectedType.kind!=="value"&&(n=r.expectedType);let i=[];for(let s=1;s<e.length-1;s+=2){let a=r.parse(e[s],s,lt);if(!a)return null;let l=r.parse(e[s+1],s+1,n);if(!l)return null;i.push([a,l]),n=n||l.type}let o=r.parse(e[e.length-1],e.length-1,n);if(!o)return null;if(!n)throw new Error("Can't infer output type");return new t(n,i,o)}evaluate(e){for(let[r,n]of this.branches)if(r.evaluate(e))return n.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[r,n]of this.branches)e(r),e(n);e(this.otherwise)}outputDefined(){return this.branches.every(([e,r])=>r.outputDefined())&&this.otherwise.outputDefined()}},E9=class t{constructor(e,r,n,i){this.type=e,this.input=r,this.beginIndex=n,this.endIndex=i}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.`);let n=r.parse(e[1],1,ut),i=r.parse(e[2],2,ce);if(!n||!i)return null;if(!z9(n.type,[Tl(ut),_t,ut]))return r.error(`Expected first argument to be of type array or string, but found ${ai(n.type)} instead`);if(e.length===4){let o=r.parse(e[3],3,ce);return o?new t(n.type,n,i,o):null}else return new t(n.type,n,i)}evaluate(e){let r=this.input.evaluate(e),n=this.beginIndex.evaluate(e),i;if(this.endIndex&&(i=this.endIndex.evaluate(e)),Bg(r,["string"]))return[...r].slice(n,i).join("");if(Bg(r,["array"]))return r.slice(n,i);throw new bi(`Expected first argument to be of type array or string, but found ${ai(xo(r))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}};HA=class t{constructor(e,r,n){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(let[i,o]of n)this.labels.push(i),this.outputs.push(o)}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.");let n=r.parse(e[1],1,ce);if(!n)return null;let i=[],o=null;r.expectedType&&r.expectedType.kind!=="value"&&(o=r.expectedType);for(let s=1;s<e.length;s+=2){let a=s===1?-1/0:e[s],l=e[s+1],u=s,c=s+1;if(typeof a!="number")return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',u);if(i.length&&i[i.length-1][0]>=a)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);let p=r.parse(l,c,o);if(!p)return null;o=o||p.type,i.push([a,p])}return new t(o,n,i)}evaluate(e){let r=this.labels,n=this.outputs;if(r.length===1)return n[0].evaluate(e);let i=this.input.evaluate(e);if(i<=r[0])return n[0].evaluate(e);let o=r.length;if(i>=r[o-1])return n[o-1].evaluate(e);let s=aL(r,i);return n[s].evaluate(e)}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};bVe=xVe(),_Ve=vVe(bVe);Vg={number:zg,color:SVe,array:WA,padding:IVe,variableAnchorOffsetCollection:PVe},Zc=class t{constructor(e,r,n,i,o){this.type=e,this.operator=r,this.interpolation=n,this.input=i,this.labels=[],this.outputs=[];for(let[s,a]of o)this.labels.push(s),this.outputs.push(a)}static interpolationFactor(e,r,n,i){let o=0;if(e.name==="exponential")o=v9(r,e.base,n,i);else if(e.name==="linear")o=v9(r,1,n,i);else if(e.name==="cubic-bezier"){let s=e.controlPoints;o=new _Ve(s[0],s[1],s[2],s[3]).solve(v9(r,1,n,i))}return o}static parse(e,r){let[n,i,o,...s]=e;if(!Array.isArray(i)||i.length===0)return r.error("Expected an interpolation type expression.",1);if(i[0]==="linear")i={name:"linear"};else if(i[0]==="exponential"){let u=i[1];if(typeof u!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:u}}else if(i[0]==="cubic-bezier"){let u=i.slice(1);if(u.length!==4||u.some(c=>typeof c!="number"||c<0||c>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:u}}else return r.error(`Unknown interpolation type ${String(i[0])}`,1,0);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(o=r.parse(o,2,ce),!o)return null;let a=[],l=null;n==="interpolate-hcl"||n==="interpolate-lab"?l=cf:r.expectedType&&r.expectedType.kind!=="value"&&(l=r.expectedType);for(let u=0;u<s.length;u+=2){let c=s[u],p=s[u+1],f=u+3,d=u+4;if(typeof c!="number")return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',f);if(a.length&&a[a.length-1][0]>=c)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);let m=r.parse(p,d,l);if(!m)return null;l=l||m.type,a.push([c,m])}return!AI(l,ce)&&!AI(l,cf)&&!AI(l,oL)&&!AI(l,sL)&&!AI(l,Tl(ce))?r.error(`Type ${ai(l)} is not interpolatable.`):new t(l,n,i,o,a)}evaluate(e){let r=this.labels,n=this.outputs;if(r.length===1)return n[0].evaluate(e);let i=this.input.evaluate(e);if(i<=r[0])return n[0].evaluate(e);let o=r.length;if(i>=r[o-1])return n[o-1].evaluate(e);let s=aL(r,i),a=r[s],l=r[s+1],u=t.interpolationFactor(this.interpolation,i,a,l),c=n[s].evaluate(e),p=n[s+1].evaluate(e);switch(this.operator){case"interpolate":return Vg[this.type.kind](c,p,u);case"interpolate-hcl":return Vg.color(c,p,u,"hcl");case"interpolate-lab":return Vg.color(c,p,u,"lab")}}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};ZA=class t{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 n=null,i=r.expectedType;i&&i.kind!=="value"&&(n=i);let o=[];for(let a of e.slice(1)){let l=r.parse(a,1+o.length,n,void 0,{typeAnnotation:"omit"});if(!l)return null;n=n||l.type,o.push(l)}if(!n)throw new Error("No output type");return i&&o.some(a=>FI(i,a.type))?new t(ut,o):new t(n,o)}evaluate(e){let r=null,n=0,i;for(let o of this.args)if(n++,r=o.evaluate(e),r&&r instanceof $a&&!r.available&&(i||(i=r.name),r=null,n===this.args.length&&(r=i)),r!==null)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};NVe=ab("==",CVe,afe),BVe=ab("!=",TVe,DVe),zVe=ab("<",EVe,OVe),VVe=ab(">",MVe,kVe),UVe=ab("<=",AVe,FVe),GVe=ab(">=",LVe,RVe),XA=class t{constructor(e,r,n){this.type=nL,this.locale=n,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");let n=e[1];if(typeof n!="object"||Array.isArray(n))return r.error("Collator options argument must be an object.");let i=r.parse(n["case-sensitive"]===void 0?!1:n["case-sensitive"],1,lt);if(!i)return null;let o=r.parse(n["diacritic-sensitive"]===void 0?!1:n["diacritic-sensitive"],1,lt);if(!o)return null;let s=null;return n.locale&&(s=r.parse(n.locale,1,_t),!s)?null:new t(i,o,s)}evaluate(e){return new RI(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}},M9=class t{constructor(e,r,n,i,o){this.type=_t,this.number=e,this.locale=r,this.currency=n,this.minFractionDigits=i,this.maxFractionDigits=o}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");let n=r.parse(e[1],1,ce);if(!n)return null;let i=e[2];if(typeof i!="object"||Array.isArray(i))return r.error("NumberFormat options argument must be an object.");let o=null;if(i.locale&&(o=r.parse(i.locale,1,_t),!o))return null;let s=null;if(i.currency&&(s=r.parse(i.currency,1,_t),!s))return null;let a=null;if(i["min-fraction-digits"]&&(a=r.parse(i["min-fraction-digits"],1,ce),!a))return null;let l=null;return i["max-fraction-digits"]&&(l=r.parse(i["max-fraction-digits"],1,ce),!l)?null:new t(n,o,s,a,l)}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}},A9=class t{constructor(e){this.type=iL,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let n=e[1];if(!Array.isArray(n)&&typeof n=="object")return r.error("First argument must be an image or text section.");let i=[],o=!1;for(let s=1;s<=e.length-1;++s){let a=e[s];if(o&&typeof a=="object"&&!Array.isArray(a)){o=!1;let l=null;if(a["font-scale"]&&(l=r.parse(a["font-scale"],1,ce),!l))return null;let u=null;if(a["text-font"]&&(u=r.parse(a["text-font"],1,Tl(_t)),!u))return null;let c=null;if(a["text-color"]&&(c=r.parse(a["text-color"],1,cf),!c))return null;let p=i[i.length-1];p.scale=l,p.font=u,p.textColor=c}else{let l=r.parse(e[s],1,ut);if(!l)return null;let u=l.type.kind;if(u!=="string"&&u!=="value"&&u!=="null"&&u!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");o=!0,i.push({content:l,scale:null,font:null,textColor:null})}}return new t(i)}evaluate(e){let r=n=>{let i=n.content.evaluate(e);return xo(i)===HI?new NI("",i,null,null,null):new NI(OI(i),null,n.scale?n.scale.evaluate(e):null,n.font?n.font.evaluate(e).join(","):null,n.textColor?n.textColor.evaluate(e):null)};return new Xc(this.sections.map(r))}eachChild(e){for(let 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}},L9=class t{constructor(e){this.type=HI,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");let n=r.parse(e[1],1,_t);return n?new t(n):r.error("No image name provided.")}evaluate(e){let r=this.input.evaluate(e),n=$a.fromString(r);return n&&e.availableImages&&(n.available=e.availableImages.indexOf(r)>-1),n}eachChild(e){e(this.input)}outputDefined(){return!1}},D9=class t{constructor(e){this.type=ce,this.input=e}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let n=r.parse(e[1],1);return n?n.type.kind!=="array"&&n.type.kind!=="string"&&n.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${ai(n.type)} instead.`):new t(n):null}evaluate(e){let r=this.input.evaluate(e);if(typeof r=="string")return[...r].length;if(Array.isArray(r))return r.length;throw new bi(`Expected value to be of type string or array, but found ${ai(xo(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}},pf=8192;VI=class t{constructor(e,r){this.type=lt,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(BI(e[1])){let n=e[1];if(n.type==="FeatureCollection"){let i=[];for(let o of n.features){let{type:s,coordinates:a}=o.geometry;s==="Polygon"&&i.push(a),s==="MultiPolygon"&&i.push(...a)}if(i.length){let o={type:"MultiPolygon",coordinates:i};return new t(n,o)}}else if(n.type==="Feature"){let i=n.geometry.type;if(i==="Polygon"||i==="MultiPolygon")return new t(n,n.geometry)}else if(n.type==="Polygon"||n.type==="MultiPolygon")return new t(n,n)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return tUe(e,this.geometries);if(e.geometryType()==="LineString")return rUe(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},YA=class{constructor(e=[],r=(n,i)=>n<i?-1:n>i?1:0){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],r=this.data.pop();return--this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:r,compare:n}=this,i=r[e];for(;e>0;){let o=e-1>>1,s=r[o];if(n(i,s)>=0)break;r[e]=s,e=o}r[e]=i}_down(e){let{data:r,compare:n}=this,i=this.length>>1,o=r[e];for(;e<i;){let s=(e<<1)+1,a=s+1;if(a<this.length&&n(r[a],r[s])<0&&(s=a),n(r[s],o)>=0)break;r[e]=r[s],e=s}r[e]=o}};lUe=6378.137,zpe=1/298.257223563,Vpe=zpe*(2-zpe),Upe=Math.PI/180,UI=class{constructor(e){let r=Upe*lUe*1e3,n=Math.cos(e*Upe),i=1/(1-Vpe*(1-n*n)),o=Math.sqrt(i);this.kx=r*o*n,this.ky=r*o*i*(1-Vpe)}distance(e,r){let n=this.wrap(e[0]-r[0])*this.kx,i=(e[1]-r[1])*this.ky;return Math.sqrt(n*n+i*i)}pointOnLine(e,r){let n=1/0,i,o,s,a;for(let l=0;l<e.length-1;l++){let u=e[l][0],c=e[l][1],p=this.wrap(e[l+1][0]-u)*this.kx,f=(e[l+1][1]-c)*this.ky,d=0;(p!==0||f!==0)&&(d=(this.wrap(r[0]-u)*this.kx*p+(r[1]-c)*this.ky*f)/(p*p+f*f),d>1?(u=e[l+1][0],c=e[l+1][1]):d>0&&(u+=p/this.kx*d,c+=f/this.ky*d)),p=this.wrap(r[0]-u)*this.kx,f=(r[1]-c)*this.ky;let m=p*p+f*f;m<n&&(n=m,i=u,o=c,s=l,a=d)}return{point:[i,o],index:s,t:Math.max(0,Math.min(1,a))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}},O9=100,k9=50;GI=class t{constructor(e,r){this.type=ce,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(BI(e[1])){let n=e[1];if(n.type==="FeatureCollection")return new t(n,n.features.map(i=>x9(i.geometry)).flat());if(n.type==="Feature")return new t(n,x9(n.geometry));if("type"in n&&"coordinates"in n)return new t(n,x9(n))}return r.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return dUe(e,this.geometries);if(e.geometryType()==="LineString")return mUe(e,this.geometries);if(e.geometryType()==="Polygon")return yUe(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},jg={"==":NVe,"!=":BVe,">":VVe,"<":zVe,">=":GVe,"<=":UVe,array:Wc,at:S9,boolean:Wc,case:T9,coalesce:ZA,collator:XA,format:A9,image:L9,in:I9,"index-of":P9,interpolate:Zc,"interpolate-hcl":Zc,"interpolate-lab":Zc,length:D9,let:$A,literal:tb,match:C9,number:Wc,"number-format":M9,object:Wc,slice:E9,step:HA,string:Wc,"to-boolean":mm,"to-color":mm,"to-number":mm,"to-string":mm,var:qA,within:VI,distance:GI},hf=class t{constructor(e,r,n,i){this.name=e,this.type=r,this._evaluate=n,this.args=i}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,r){let n=e[0],i=t.definitions[n];if(!i)return r.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0);let o=Array.isArray(i)?i[0]:i.type,s=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,a=s.filter(([u])=>!Array.isArray(u)||u.length===e.length-1),l=null;for(let[u,c]of a){l=new jA(r.registry,eL,r.path,null,r.scope);let p=[],f=!1;for(let d=1;d<e.length;d++){let m=e[d],y=Array.isArray(u)?u[d-1]:u.type,g=l.parse(m,1+p.length,y);if(!g){f=!0;break}p.push(g)}if(!f){if(Array.isArray(u)&&u.length!==p.length){l.error(`Expected ${u.length} arguments, but found ${p.length} instead.`);continue}for(let d=0;d<p.length;d++){let m=Array.isArray(u)?u[d]:u.type,y=p[d];l.concat(d+1).checkSubtype(m,y.type)}if(l.errors.length===0)return new t(n,o,c,p)}}if(a.length===1)r.errors.push(...l.errors);else{let c=(a.length?a:s).map(([f])=>vUe(f)).join(" | "),p=[];for(let f=1;f<e.length;f++){let d=r.parse(e[f],1+p.length);if(!d)return null;p.push(ai(d.type))}r.error(`Expected arguments of type ${c}, but found (${p.join(", ")}) instead.`)}return null}static register(e,r){t.definitions=r;for(let n in r)e[n]=t}};hf.register(jg,{error:[sVe,[_t],(t,[e])=>{throw new bi(e.evaluate(t))}],typeof:[_t,[ut],(t,[e])=>ai(xo(e.evaluate(t)))],"to-rgba":[Tl(ce,4),[cf],(t,[e])=>{let[r,n,i,o]=e.evaluate(t).rgb;return[r*255,n*255,i*255,o]}],rgb:[cf,[ce,ce,ce],qpe],rgba:[cf,[ce,ce,ce,ce],qpe],has:{type:lt,overloads:[[[_t],(t,[e])=>Hpe(e.evaluate(t),t.properties())],[[_t,J1],(t,[e,r])=>Hpe(e.evaluate(t),r.evaluate(t))]]},get:{type:ut,overloads:[[[_t],(t,[e])=>b9(e.evaluate(t),t.properties())],[[_t,J1],(t,[e,r])=>b9(e.evaluate(t),r.evaluate(t))]]},"feature-state":[ut,[_t],(t,[e])=>b9(e.evaluate(t),t.featureState||{})],properties:[J1,[],t=>t.properties()],"geometry-type":[_t,[],t=>t.geometryType()],id:[ut,[],t=>t.id()],zoom:[ce,[],t=>t.globals.zoom],"heatmap-density":[ce,[],t=>t.globals.heatmapDensity||0],"line-progress":[ce,[],t=>t.globals.lineProgress||0],accumulated:[ut,[],t=>t.globals.accumulated===void 0?null:t.globals.accumulated],"+":[ce,Rg(ce),(t,e)=>{let r=0;for(let n of e)r+=n.evaluate(t);return r}],"*":[ce,Rg(ce),(t,e)=>{let r=1;for(let n of e)r*=n.evaluate(t);return r}],"-":{type:ce,overloads:[[[ce,ce],(t,[e,r])=>e.evaluate(t)-r.evaluate(t)],[[ce],(t,[e])=>-e.evaluate(t)]]},"/":[ce,[ce,ce],(t,[e,r])=>e.evaluate(t)/r.evaluate(t)],"%":[ce,[ce,ce],(t,[e,r])=>e.evaluate(t)%r.evaluate(t)],ln2:[ce,[],()=>Math.LN2],pi:[ce,[],()=>Math.PI],e:[ce,[],()=>Math.E],"^":[ce,[ce,ce],(t,[e,r])=>Math.pow(e.evaluate(t),r.evaluate(t))],sqrt:[ce,[ce],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[ce,[ce],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[ce,[ce],(t,[e])=>Math.log(e.evaluate(t))],log2:[ce,[ce],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[ce,[ce],(t,[e])=>Math.sin(e.evaluate(t))],cos:[ce,[ce],(t,[e])=>Math.cos(e.evaluate(t))],tan:[ce,[ce],(t,[e])=>Math.tan(e.evaluate(t))],asin:[ce,[ce],(t,[e])=>Math.asin(e.evaluate(t))],acos:[ce,[ce],(t,[e])=>Math.acos(e.evaluate(t))],atan:[ce,[ce],(t,[e])=>Math.atan(e.evaluate(t))],min:[ce,Rg(ce),(t,e)=>Math.min(...e.map(r=>r.evaluate(t)))],max:[ce,Rg(ce),(t,e)=>Math.max(...e.map(r=>r.evaluate(t)))],abs:[ce,[ce],(t,[e])=>Math.abs(e.evaluate(t))],round:[ce,[ce],(t,[e])=>{let r=e.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[ce,[ce],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[ce,[ce],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[lt,[_t,ut],(t,[e,r])=>t.properties()[e.value]===r.value],"filter-id-==":[lt,[ut],(t,[e])=>t.id()===e.value],"filter-type-==":[lt,[_t],(t,[e])=>t.geometryType()===e.value],"filter-<":[lt,[_t,ut],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n<i}],"filter-id-<":[lt,[ut],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r<n}],"filter->":[lt,[_t,ut],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n>i}],"filter-id->":[lt,[ut],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r>n}],"filter-<=":[lt,[_t,ut],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n<=i}],"filter-id-<=":[lt,[ut],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r<=n}],"filter->=":[lt,[_t,ut],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n>=i}],"filter-id->=":[lt,[ut],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r>=n}],"filter-has":[lt,[ut],(t,[e])=>e.value in t.properties()],"filter-has-id":[lt,[],t=>t.id()!==null&&t.id()!==void 0],"filter-type-in":[lt,[Tl(_t)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[lt,[Tl(ut)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[lt,[_t,Tl(ut)],(t,[e,r])=>r.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[lt,[_t,Tl(ut)],(t,[e,r])=>gUe(t.properties()[e.value],r.value,0,r.value.length-1)],all:{type:lt,overloads:[[[lt,lt],(t,[e,r])=>e.evaluate(t)&&r.evaluate(t)],[Rg(lt),(t,e)=>{for(let r of e)if(!r.evaluate(t))return!1;return!0}]]},any:{type:lt,overloads:[[[lt,lt],(t,[e,r])=>e.evaluate(t)||r.evaluate(t)],[Rg(lt),(t,e)=>{for(let r of e)if(r.evaluate(t))return!0;return!1}]]},"!":[lt,[lt],(t,[e])=>!e.evaluate(t)],"is-supported-script":[lt,[_t],(t,[e])=>{let r=t.globals&&t.globals.isSupportedScript;return r?r(e.evaluate(t)):!0}],upcase:[_t,[_t],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[_t,[_t],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[_t,Rg(ut),(t,e)=>e.map(r=>OI(r.evaluate(t))).join("")],"resolved-locale":[_t,[nL],(t,[e])=>e.evaluate(t).resolvedLocale()]});$I=class{constructor(e,r){this.expression=e,this._warningHistory={},this._evaluator=new GA,this._defaultValue=r?CUe(r):null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(e,r,n,i,o,s){return this._evaluator.globals=e,this._evaluator.feature=r,this._evaluator.featureState=n,this._evaluator.canonical=i,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=s,this.expression.evaluate(this._evaluator)}evaluate(e,r,n,i,o,s){this._evaluator.globals=e,this._evaluator.feature=r||null,this._evaluator.featureState=n||null,this._evaluator.canonical=i,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=s||null;try{let a=this.expression.evaluate(this._evaluator);if(a==null||typeof a=="number"&&a!==a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new bi(`Expected value to be one of ${Object.keys(this._enumValues).map(l=>JSON.stringify(l)).join(", ")}, but found ${JSON.stringify(a)} instead.`);return a}catch(a){return this._warningHistory[a.message]||(this._warningHistory[a.message]=!0,typeof console<"u"&&console.warn(a.message)),this._defaultValue}}};nb=class{constructor(e,r){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!jI(r.expression)}evaluateWithoutErrorHandling(e,r,n,i,o,s){return this._styleExpression.evaluateWithoutErrorHandling(e,r,n,i,o,s)}evaluate(e,r,n,i,o,s){return this._styleExpression.evaluate(e,r,n,i,o,s)}},ib=class{constructor(e,r,n,i){this.kind=e,this.zoomStops=n,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!jI(r.expression),this.interpolationType=i}evaluateWithoutErrorHandling(e,r,n,i,o,s){return this._styleExpression.evaluateWithoutErrorHandling(e,r,n,i,o,s)}evaluate(e,r,n,i,o,s){return this._styleExpression.evaluate(e,r,n,i,o,s)}interpolationFactor(e,r,n){return this.interpolationType?Zc.interpolationFactor(this.interpolationType,e,r,n):0}};tL=class t{constructor(e,r){this._parameters=e,this._specification=r,eb(this,mfe(this._parameters,this._specification))}static deserialize(e){return new t(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}};TUe={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};Ype={promoteId:OUe};Kpe={"*"(){return[]},array:Z9,boolean:AUe,number:X9,color:LUe,constants:xfe,enum:qI,filter:Y9,function:bfe,layer:Pfe,object:zu,source:Cfe,light:Tfe,sky:Efe,terrain:Mfe,projection:BUe,string:Gg,formatted:kUe,resolvedImage:FUe,padding:RUe,variableAnchorOffsetCollection:NUe,sprite:Afe};Vu.source=mf(df(Cfe));Vu.sprite=mf(df(Afe));Vu.glyphs=mf(df(Lfe));Vu.light=mf(df(Tfe));Vu.sky=mf(df(Efe));Vu.terrain=mf(df(Mfe));Vu.layer=mf(df(Pfe));Vu.filter=mf(df(Y9));Vu.paintProperty=mf(df(Sfe));Vu.layoutProperty=mf(df(Ife))});var kh,OJt,zUe,kJt,FJt,VUe,UUe,pL=h(()=>{ua();Qn();kh=Vu,OJt=kh.source,zUe=kh.light,kJt=kh.terrain,FJt=kh.filter,VUe=kh.paintProperty,UUe=kh.layoutProperty});var $g,K9=h(()=>{$g=class t{constructor(e,r,n){let i=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let s=new Int32Array(this.arrayBuffer);e=s[0],r=s[1],n=s[2],this.d=r+2*n;for(let u=0;u<this.d*this.d;u++){let c=s[3+u],p=s[3+u+1];i.push(c===p?null:s.subarray(c,p))}let a=s[3+i.length],l=s[3+i.length+1];this.keys=s.subarray(a,l),this.bboxes=s.subarray(l),this.insert=this._insertReadonly}else{this.d=r+2*n;for(let s=0;s<this.d*this.d;s++)i.push([]);this.keys=[],this.bboxes=[]}this.n=r,this.extent=e,this.padding=n,this.scale=r/e,this.uid=0;let o=n/r*e;this.min=-o,this.max=e+o}insert(e,r,n,i,o){this._forEachCell(r,n,i,o,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i),this.bboxes.push(o)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,r,n,i,o,s){this.cells[o].push(s)}query(e,r,n,i,o){let s=this.min,a=this.max;if(e<=s&&r<=s&&a<=n&&a<=i&&!o)return Array.prototype.slice.call(this.keys);{let l=[],u={};return this._forEachCell(e,r,n,i,this._queryCell,l,u,o),l}}_queryCell(e,r,n,i,o,s,a,l){let u=this.cells[o];if(u!==null){let c=this.keys,p=this.bboxes;for(let f=0;f<u.length;f++){let d=u[f];if(a[d]===void 0){let m=d*4;(l?l(p[m+0],p[m+1],p[m+2],p[m+3]):e<=p[m+2]&&r<=p[m+3]&&n>=p[m+0]&&i>=p[m+1])?(a[d]=!0,s.push(c[d])):a[d]=!1}}}}_forEachCell(e,r,n,i,o,s,a,l){let u=this._convertToCellCoord(e),c=this._convertToCellCoord(r),p=this._convertToCellCoord(n),f=this._convertToCellCoord(i);for(let d=u;d<=p;d++)for(let m=c;m<=f;m++){let y=this.d*m+d;if(!(l&&!l(this._convertFromCellCoord(d),this._convertFromCellCoord(m),this._convertFromCellCoord(d+1),this._convertFromCellCoord(m+1)))&&o.call(this,e,r,n,i,y,s,a,l))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;let e=this.cells,r=3+this.cells.length+1+1,n=0;for(let s=0;s<this.cells.length;s++)n+=this.cells[s].length;let i=new Int32Array(r+n+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;let o=r;for(let s=0;s<e.length;s++){let a=e[s];i[3+s]=o,i.set(a,o),o+=a.length}return i[3+e.length]=o,i.set(this.keys,o),o+=this.keys.length,i[3+e.length+1]=o,i.set(this.bboxes,o),o+=this.bboxes.length,i.buffer}static serialize(e,r){let n=e.toArrayBuffer();return r&&r.push(n),{buffer:n}}static deserialize(e){return new t(e.buffer)}}});function oe(t,e,r={}){if(gm[t])throw new Error(`${t} is already registered.`);Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),gm[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}function Ofe(t){return t&&typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||t.constructor&&t.constructor.name==="ArrayBuffer")}function ub(t,e){if(t==null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof Blob||t instanceof Error)return t;if(Ofe(t)||$c(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){let r=t;return e&&e.push(r.buffer),r}if(t instanceof ImageData)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){let r=[];for(let n of t)r.push(ub(n,e));return r}if(typeof t=="object"){let r=t.constructor,n=r._classRegistryKey;if(!n)throw new Error(`can't serialize object of unregistered class ${r.name}`);if(!gm[n])throw new Error(`${n} is not registered.`);let i=r.serialize?r.serialize(t,e):{};if(r.serialize){if(e&&i===e[e.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(let o in t){if(!t.hasOwnProperty(o)||gm[n].omit.indexOf(o)>=0)continue;let s=t[o];i[o]=gm[n].shallow.indexOf(o)>=0?s:ub(s,e)}t instanceof Error&&(i.message=t.message)}if(i.$name)throw new Error("$name property is reserved for worker serialization logic.");return n!=="Object"&&(i.$name=n),i}throw new Error(`can't serialize object of type ${typeof t}`)}function cb(t){if(t==null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof Blob||t instanceof Error||Ofe(t)||$c(t)||ArrayBuffer.isView(t)||t instanceof ImageData)return t;if(Array.isArray(t))return t.map(cb);if(typeof t=="object"){let e=t.$name||"Object";if(!gm[e])throw new Error(`can't deserialize unregistered class ${e}`);let{klass:r}=gm[e];if(!r)throw new Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(t);let n=Object.create(r.prototype);for(let i of Object.keys(t)){if(i==="$name")continue;let o=t[i];n[i]=gm[e].shallow.indexOf(i)>=0?o:cb(o)}return n}throw new Error(`can't deserialize object of type ${typeof t}`)}var gm,Qi=h(()=>{K9();ua();qc();Oe();gm={};oe("Object",Object);oe("TransferableGridIndex",$g);oe("Color",wt);oe("Error",Error);oe("AJAXError",kg);oe("ResolvedImage",$a);oe("StylePropertyFunction",tL);oe("StyleExpression",$I,{omit:["_evaluator"]});oe("ZoomDependentExpression",ib);oe("ZoomConstantExpression",nb);oe("CompoundExpression",hf,{omit:["_evaluate"]});for(let t in jg)jg[t]._classRegistryKey||oe(`Expression_${t}`,jg[t])});var YI,J9=h(()=>{YI=class{constructor(){this.first=!0}update(e,r){let n=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=n,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=n,!0):(this.lastFloorZoom>n?(this.lastIntegerZoom=n+1,this.lastIntegerZoomTime=r):this.lastFloorZoom<n&&(this.lastIntegerZoom=n,this.lastIntegerZoomTime=r),e!==this.lastZoom?(this.lastZoom=e,this.lastFloorZoom=n,!0):!1)}}});var St,Q9=h(()=>{St={"Latin-1 Supplement":t=>t>=128&&t<=255,Arabic:t=>t>=1536&&t<=1791,"Arabic Supplement":t=>t>=1872&&t<=1919,"Arabic Extended-A":t=>t>=2208&&t<=2303,"Hangul Jamo":t=>t>=4352&&t<=4607,"Unified Canadian Aboriginal Syllabics":t=>t>=5120&&t<=5759,Khmer:t=>t>=6016&&t<=6143,"Unified Canadian Aboriginal Syllabics Extended":t=>t>=6320&&t<=6399,"General Punctuation":t=>t>=8192&&t<=8303,"Letterlike Symbols":t=>t>=8448&&t<=8527,"Number Forms":t=>t>=8528&&t<=8591,"Miscellaneous Technical":t=>t>=8960&&t<=9215,"Control Pictures":t=>t>=9216&&t<=9279,"Optical Character Recognition":t=>t>=9280&&t<=9311,"Enclosed Alphanumerics":t=>t>=9312&&t<=9471,"Geometric Shapes":t=>t>=9632&&t<=9727,"Miscellaneous Symbols":t=>t>=9728&&t<=9983,"Miscellaneous Symbols and Arrows":t=>t>=11008&&t<=11263,"CJK Radicals Supplement":t=>t>=11904&&t<=12031,"Kangxi Radicals":t=>t>=12032&&t<=12255,"Ideographic Description Characters":t=>t>=12272&&t<=12287,"CJK Symbols and Punctuation":t=>t>=12288&&t<=12351,Hiragana:t=>t>=12352&&t<=12447,Katakana:t=>t>=12448&&t<=12543,Bopomofo:t=>t>=12544&&t<=12591,"Hangul Compatibility Jamo":t=>t>=12592&&t<=12687,Kanbun:t=>t>=12688&&t<=12703,"Bopomofo Extended":t=>t>=12704&&t<=12735,"CJK Strokes":t=>t>=12736&&t<=12783,"Katakana Phonetic Extensions":t=>t>=12784&&t<=12799,"Enclosed CJK Letters and Months":t=>t>=12800&&t<=13055,"CJK Compatibility":t=>t>=13056&&t<=13311,"CJK Unified Ideographs Extension A":t=>t>=13312&&t<=19903,"Yijing Hexagram Symbols":t=>t>=19904&&t<=19967,"CJK Unified Ideographs":t=>t>=19968&&t<=40959,"Yi Syllables":t=>t>=40960&&t<=42127,"Yi Radicals":t=>t>=42128&&t<=42191,"Hangul Jamo Extended-A":t=>t>=43360&&t<=43391,"Hangul Syllables":t=>t>=44032&&t<=55215,"Hangul Jamo Extended-B":t=>t>=55216&&t<=55295,"Private Use Area":t=>t>=57344&&t<=63743,"CJK Compatibility Ideographs":t=>t>=63744&&t<=64255,"Arabic Presentation Forms-A":t=>t>=64336&&t<=65023,"Vertical Forms":t=>t>=65040&&t<=65055,"CJK Compatibility Forms":t=>t>=65072&&t<=65103,"Small Form Variants":t=>t>=65104&&t<=65135,"Arabic Presentation Forms-B":t=>t>=65136&&t<=65279,"Halfwidth and Fullwidth Forms":t=>t>=65280&&t<=65519}});function ez(t){for(let e of t)if(kfe(e.charCodeAt(0)))return!0;return!1}function kfe(t){return t===746||t===747?!0:t<4352?!1:!!(St["Bopomofo Extended"](t)||St.Bopomofo(t)||St["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||St["CJK Compatibility Ideographs"](t)||St["CJK Compatibility"](t)||St["CJK Radicals Supplement"](t)||St["CJK Strokes"](t)||St["CJK Symbols and Punctuation"](t)&&!(t>=12296&&t<=12305)&&!(t>=12308&&t<=12319)&&t!==12336||St["CJK Unified Ideographs Extension A"](t)||St["CJK Unified Ideographs"](t)||St["Enclosed CJK Letters and Months"](t)||St["Hangul Compatibility Jamo"](t)||St["Hangul Jamo Extended-A"](t)||St["Hangul Jamo Extended-B"](t)||St["Hangul Jamo"](t)||St["Hangul Syllables"](t)||St.Hiragana(t)||St["Ideographic Description Characters"](t)||St.Kanbun(t)||St["Kangxi Radicals"](t)||St["Katakana Phonetic Extensions"](t)||St.Katakana(t)&&t!==12540||St["Halfwidth and Fullwidth Forms"](t)&&t!==65288&&t!==65289&&t!==65293&&!(t>=65306&&t<=65310)&&t!==65339&&t!==65341&&t!==65343&&!(t>=65371&&t<=65503)&&t!==65507&&!(t>=65512&&t<=65519)||St["Small Form Variants"](t)&&!(t>=65112&&t<=65118)&&!(t>=65123&&t<=65126)||St["Unified Canadian Aboriginal Syllabics"](t)||St["Unified Canadian Aboriginal Syllabics Extended"](t)||St["Vertical Forms"](t)||St["Yijing Hexagram Symbols"](t)||St["Yi Syllables"](t)||St["Yi Radicals"](t))}function Ffe(t){return t>=1424&&t<=2303||St["Arabic Presentation Forms-A"](t)||St["Arabic Presentation Forms-B"](t)}function GUe(t,e){return!(!e&&Ffe(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||St.Khmer(t))}function Rfe(t){for(let e of t)if(Ffe(e.charCodeAt(0)))return!0;return!1}function Nfe(t,e){for(let r of t)if(!GUe(r.charCodeAt(0),e))return!1;return!0}var pb=h(()=>{Q9()});var tz,Fh,KI=h(()=>{tz=class{constructor(){this.applyArabicShaping=null;this.processBidirectionalText=null;this.processStyledBidirectionalText=null;this.pluginStatus="unavailable";this.pluginURL=null}setState(e){this.pluginStatus=e.pluginStatus,this.pluginURL=e.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(e){this.applyArabicShaping=e.applyArabicShaping,this.processBidirectionalText=e.processBidirectionalText,this.processStyledBidirectionalText=e.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}},Fh=new tz});var qr,qa=h(()=>{J9();pb();KI();qr=class{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 YI,this.transition={})}isSupportedScript(e){return Nfe(e,Fh.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let e=this.zoom,r=e-Math.floor(e),n=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*n}:{fromScale:.5,toScale:1,t:1-(1-n)*r}}}});var Ha,JI,El,Yc,fb,QI,e2,Fs=h(()=>{Oe();ua();Qi();qa();Ha=class{constructor(e,r,n){this.property=e,this.value=r,this.parameters=n}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,r,n,i){return this.property.evaluate(this.value,this.parameters,e,r,n,i)}},JI=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}},El=class{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,n){let i=this.specification.type,o=Vg[i];return o?o(e,r,n):e}},Yc=class{constructor(e,r){this.specification=e,this.overrides=r}possiblyEvaluate(e,r,n,i){return e.expression.kind==="constant"||e.expression.kind==="camera"?new Ha(this,{kind:"constant",value:e.expression.evaluate(r,null,{},n,i)},r):new Ha(this,e.expression,r)}interpolate(e,r,n){if(e.value.kind!=="constant"||r.value.kind!=="constant")return e;if(e.value.value===void 0||r.value.value===void 0)return new Ha(this,{kind:"constant",value:void 0},e.parameters);let i=this.specification.type,o=Vg[i];if(o){let s=o(e.value.value,r.value.value,n);return new Ha(this,{kind:"constant",value:s},e.parameters)}else return e}evaluate(e,r,n,i,o,s){return e.kind==="constant"?e.value:e.evaluate(r,n,i,o,s)}},fb=class extends Yc{possiblyEvaluate(e,r,n,i){if(e.value===void 0)return new Ha(this,{kind:"constant",value:void 0},r);if(e.expression.kind==="constant"){let o=e.expression.evaluate(r,null,{},n,i),a=e.property.specification.type==="resolvedImage"&&typeof o!="string"?o.name:o,l=this._calculate(a,a,a,r);return new Ha(this,{kind:"constant",value:l},r)}else if(e.expression.kind==="camera"){let o=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 Ha(this,{kind:"constant",value:o},r)}else return new Ha(this,e.expression,r)}evaluate(e,r,n,i,o,s){if(e.kind==="source"){let a=e.evaluate(r,n,i,o,s);return this._calculate(a,a,a,r)}else return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(r.zoom)-1},n,i),e.evaluate({zoom:Math.floor(r.zoom)},n,i),e.evaluate({zoom:Math.floor(r.zoom)+1},n,i),r):e.value}_calculate(e,r,n,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:n,to:r}}interpolate(e){return e}},QI=class{constructor(e){this.specification=e}possiblyEvaluate(e,r,n,i){if(e.value!==void 0)if(e.expression.kind==="constant"){let o=e.expression.evaluate(r,null,{},n,i);return this._calculate(o,o,o,r)}else return this._calculate(e.expression.evaluate(new qr(Math.floor(r.zoom-1),r)),e.expression.evaluate(new qr(Math.floor(r.zoom),r)),e.expression.evaluate(new qr(Math.floor(r.zoom+1),r)),r)}_calculate(e,r,n,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:n,to:r}}interpolate(e){return e}},e2=class{constructor(e){this.specification=e}possiblyEvaluate(e,r,n,i){return!!e.expression.evaluate(r,null,{},n,i)}interpolate(){return!1}};oe("DataDrivenProperty",Yc);oe("DataConstantProperty",El);oe("CrossFadedDataDrivenProperty",fb);oe("CrossFadedProperty",QI);oe("ColorRampProperty",e2)});var Kc=h(()=>{Oe();pL();Qn();Fs()});function Hr(t,e=1){let r=0,n=0,i=t.map(s=>{let a=XUe(s.type),l=r=zfe(r,Math.max(e,a)),u=s.components||1;return n=Math.max(n,a),r+=a*u,{name:s.name,type:s.type,components:u,offset:l}}),o=zfe(r,Math.max(n,e));return{members:i,size:o,alignment:e}}function XUe(t){return HUe[t].BYTES_PER_ELEMENT}function zfe(t,e){return Math.ceil(t/e)*e}var HUe,vm,WUe,ZUe,zn,Uu=h(()=>{HUe={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},vm=class{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}},WUe=128,ZUe=5,zn=class{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){let 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(this.capacity*ZUe),WUe),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}});var Vfe,qg,t2,r2,n2,i2,xm,o2,s2,a2,l2,u2,c2,fL,p2,f2,h2,d2,Hg,m2,y2,g2,hL,hb,dL,v2,mL,x2,yL,b2,_2,w2,gL,S2,vL,I2,P2,C2,xL,bL,_L,wL,SL,Rh,IL,PL,CL,T2,TL,ca,bm,Wa=h(()=>{Uu();Qi();Vfe=_e(Br(),1),qg=class extends zn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r){let n=this.length;return this.resize(n+1),this.emplace(n,e,r)}emplace(e,r,n){let i=e*2;return this.int16[i+0]=r,this.int16[i+1]=n,e}};qg.prototype.bytesPerElement=4;oe("StructArrayLayout2i4",qg);t2=class extends zn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,n)}emplace(e,r,n,i){let o=e*3;return this.int16[o+0]=r,this.int16[o+1]=n,this.int16[o+2]=i,e}};t2.prototype.bytesPerElement=6;oe("StructArrayLayout3i6",t2);r2=class extends zn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n,i){let o=this.length;return this.resize(o+1),this.emplace(o,e,r,n,i)}emplace(e,r,n,i,o){let s=e*4;return this.int16[s+0]=r,this.int16[s+1]=n,this.int16[s+2]=i,this.int16[s+3]=o,e}};r2.prototype.bytesPerElement=8;oe("StructArrayLayout4i8",r2);n2=class extends zn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,s){let a=this.length;return this.resize(a+1),this.emplace(a,e,r,n,i,o,s)}emplace(e,r,n,i,o,s,a){let l=e*6;return this.int16[l+0]=r,this.int16[l+1]=n,this.int16[l+2]=i,this.int16[l+3]=o,this.int16[l+4]=s,this.int16[l+5]=a,e}};n2.prototype.bytesPerElement=12;oe("StructArrayLayout2i4i12",n2);i2=class extends zn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,s){let a=this.length;return this.resize(a+1),this.emplace(a,e,r,n,i,o,s)}emplace(e,r,n,i,o,s,a){let l=e*4,u=e*8;return this.int16[l+0]=r,this.int16[l+1]=n,this.uint8[u+4]=i,this.uint8[u+5]=o,this.uint8[u+6]=s,this.uint8[u+7]=a,e}};i2.prototype.bytesPerElement=8;oe("StructArrayLayout2i4ub8",i2);xm=class extends zn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r){let n=this.length;return this.resize(n+1),this.emplace(n,e,r)}emplace(e,r,n){let i=e*2;return this.float32[i+0]=r,this.float32[i+1]=n,e}};xm.prototype.bytesPerElement=8;oe("StructArrayLayout2f8",xm);o2=class extends zn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,s,a,l,u,c){let p=this.length;return this.resize(p+1),this.emplace(p,e,r,n,i,o,s,a,l,u,c)}emplace(e,r,n,i,o,s,a,l,u,c,p){let f=e*10;return this.uint16[f+0]=r,this.uint16[f+1]=n,this.uint16[f+2]=i,this.uint16[f+3]=o,this.uint16[f+4]=s,this.uint16[f+5]=a,this.uint16[f+6]=l,this.uint16[f+7]=u,this.uint16[f+8]=c,this.uint16[f+9]=p,e}};o2.prototype.bytesPerElement=20;oe("StructArrayLayout10ui20",o2);s2=class extends zn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,s,a,l,u,c,p,f){let d=this.length;return this.resize(d+1),this.emplace(d,e,r,n,i,o,s,a,l,u,c,p,f)}emplace(e,r,n,i,o,s,a,l,u,c,p,f,d){let m=e*12;return this.int16[m+0]=r,this.int16[m+1]=n,this.int16[m+2]=i,this.int16[m+3]=o,this.uint16[m+4]=s,this.uint16[m+5]=a,this.uint16[m+6]=l,this.uint16[m+7]=u,this.int16[m+8]=c,this.int16[m+9]=p,this.int16[m+10]=f,this.int16[m+11]=d,e}};s2.prototype.bytesPerElement=24;oe("StructArrayLayout4i4ui4i24",s2);a2=class extends zn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,n)}emplace(e,r,n,i){let o=e*3;return this.float32[o+0]=r,this.float32[o+1]=n,this.float32[o+2]=i,e}};a2.prototype.bytesPerElement=12;oe("StructArrayLayout3f12",a2);l2=class extends zn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){let n=e*1;return this.uint32[n+0]=r,e}};l2.prototype.bytesPerElement=4;oe("StructArrayLayout1ul4",l2);u2=class extends zn{_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,n,i,o,s,a,l,u){let c=this.length;return this.resize(c+1),this.emplace(c,e,r,n,i,o,s,a,l,u)}emplace(e,r,n,i,o,s,a,l,u,c){let p=e*10,f=e*5;return this.int16[p+0]=r,this.int16[p+1]=n,this.int16[p+2]=i,this.int16[p+3]=o,this.int16[p+4]=s,this.int16[p+5]=a,this.uint32[f+3]=l,this.uint16[p+8]=u,this.uint16[p+9]=c,e}};u2.prototype.bytesPerElement=20;oe("StructArrayLayout6i1ul2ui20",u2);c2=class extends zn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,s){let a=this.length;return this.resize(a+1),this.emplace(a,e,r,n,i,o,s)}emplace(e,r,n,i,o,s,a){let l=e*6;return this.int16[l+0]=r,this.int16[l+1]=n,this.int16[l+2]=i,this.int16[l+3]=o,this.int16[l+4]=s,this.int16[l+5]=a,e}};c2.prototype.bytesPerElement=12;oe("StructArrayLayout2i2i2i12",c2);fL=class extends zn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o){let s=this.length;return this.resize(s+1),this.emplace(s,e,r,n,i,o)}emplace(e,r,n,i,o,s){let a=e*4,l=e*8;return this.float32[a+0]=r,this.float32[a+1]=n,this.float32[a+2]=i,this.int16[l+6]=o,this.int16[l+7]=s,e}};fL.prototype.bytesPerElement=16;oe("StructArrayLayout2f1f2i16",fL);p2=class extends zn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,n,i){let o=this.length;return this.resize(o+1),this.emplace(o,e,r,n,i)}emplace(e,r,n,i,o){let s=e*12,a=e*3;return this.uint8[s+0]=r,this.uint8[s+1]=n,this.float32[a+1]=i,this.float32[a+2]=o,e}};p2.prototype.bytesPerElement=12;oe("StructArrayLayout2ub2f12",p2);f2=class extends zn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,n)}emplace(e,r,n,i){let o=e*3;return this.uint16[o+0]=r,this.uint16[o+1]=n,this.uint16[o+2]=i,e}};f2.prototype.bytesPerElement=6;oe("StructArrayLayout3ui6",f2);h2=class extends zn{_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,n,i,o,s,a,l,u,c,p,f,d,m,y,g,b){let w=this.length;return this.resize(w+1),this.emplace(w,e,r,n,i,o,s,a,l,u,c,p,f,d,m,y,g,b)}emplace(e,r,n,i,o,s,a,l,u,c,p,f,d,m,y,g,b,w){let S=e*24,I=e*12,P=e*48;return this.int16[S+0]=r,this.int16[S+1]=n,this.uint16[S+2]=i,this.uint16[S+3]=o,this.uint32[I+2]=s,this.uint32[I+3]=a,this.uint32[I+4]=l,this.uint16[S+10]=u,this.uint16[S+11]=c,this.uint16[S+12]=p,this.float32[I+7]=f,this.float32[I+8]=d,this.uint8[P+36]=m,this.uint8[P+37]=y,this.uint8[P+38]=g,this.uint32[I+10]=b,this.int16[S+22]=w,e}};h2.prototype.bytesPerElement=48;oe("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",h2);d2=class extends zn{_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,n,i,o,s,a,l,u,c,p,f,d,m,y,g,b,w,S,I,P,T,M,E,D,B,$,U){let Y=this.length;return this.resize(Y+1),this.emplace(Y,e,r,n,i,o,s,a,l,u,c,p,f,d,m,y,g,b,w,S,I,P,T,M,E,D,B,$,U)}emplace(e,r,n,i,o,s,a,l,u,c,p,f,d,m,y,g,b,w,S,I,P,T,M,E,D,B,$,U,Y){let G=e*32,ne=e*16;return this.int16[G+0]=r,this.int16[G+1]=n,this.int16[G+2]=i,this.int16[G+3]=o,this.int16[G+4]=s,this.int16[G+5]=a,this.int16[G+6]=l,this.int16[G+7]=u,this.uint16[G+8]=c,this.uint16[G+9]=p,this.uint16[G+10]=f,this.uint16[G+11]=d,this.uint16[G+12]=m,this.uint16[G+13]=y,this.uint16[G+14]=g,this.uint16[G+15]=b,this.uint16[G+16]=w,this.uint16[G+17]=S,this.uint16[G+18]=I,this.uint16[G+19]=P,this.uint16[G+20]=T,this.uint16[G+21]=M,this.uint16[G+22]=E,this.uint32[ne+12]=D,this.float32[ne+13]=B,this.float32[ne+14]=$,this.uint16[G+30]=U,this.uint16[G+31]=Y,e}};d2.prototype.bytesPerElement=64;oe("StructArrayLayout8i15ui1ul2f2ui64",d2);Hg=class extends zn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){let n=e*1;return this.float32[n+0]=r,e}};Hg.prototype.bytesPerElement=4;oe("StructArrayLayout1f4",Hg);m2=class extends zn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,n)}emplace(e,r,n,i){let o=e*6,s=e*3;return this.uint16[o+0]=r,this.float32[s+1]=n,this.float32[s+2]=i,e}};m2.prototype.bytesPerElement=12;oe("StructArrayLayout1ui2f12",m2);y2=class extends zn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,n)}emplace(e,r,n,i){let o=e*2,s=e*4;return this.uint32[o+0]=r,this.uint16[s+2]=n,this.uint16[s+3]=i,e}};y2.prototype.bytesPerElement=8;oe("StructArrayLayout1ul2ui8",y2);g2=class extends zn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r){let n=this.length;return this.resize(n+1),this.emplace(n,e,r)}emplace(e,r,n){let i=e*2;return this.uint16[i+0]=r,this.uint16[i+1]=n,e}};g2.prototype.bytesPerElement=4;oe("StructArrayLayout2ui4",g2);hL=class extends zn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){let n=e*1;return this.uint16[n+0]=r,e}};hL.prototype.bytesPerElement=2;oe("StructArrayLayout1ui2",hL);hb=class extends zn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,n,i){let o=this.length;return this.resize(o+1),this.emplace(o,e,r,n,i)}emplace(e,r,n,i,o){let s=e*4;return this.float32[s+0]=r,this.float32[s+1]=n,this.float32[s+2]=i,this.float32[s+3]=o,e}};hb.prototype.bytesPerElement=16;oe("StructArrayLayout4f16",hb);dL=class extends vm{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 Vfe.default(this.anchorPointX,this.anchorPointY)}};dL.prototype.size=20;v2=class extends u2{get(e){return new dL(this,e)}};oe("CollisionBoxArray",v2);mL=class extends vm{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]}};mL.prototype.size=48;x2=class extends h2{get(e){return new mL(this,e)}};oe("PlacedSymbolArray",x2);yL=class extends vm{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 collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}};yL.prototype.size=64;b2=class extends d2{get(e){return new yL(this,e)}};oe("SymbolInstanceArray",b2);_2=class extends Hg{getoffsetX(e){return this.float32[e*1+0]}};oe("GlyphOffsetArray",_2);w2=class extends t2{getx(e){return this.int16[e*3+0]}gety(e){return this.int16[e*3+1]}gettileUnitDistanceFromAnchor(e){return this.int16[e*3+2]}};oe("SymbolLineVertexArray",w2);gL=class extends vm{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}};gL.prototype.size=12;S2=class extends m2{get(e){return new gL(this,e)}};oe("TextAnchorOffsetArray",S2);vL=class extends vm{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]}};vL.prototype.size=8;I2=class extends y2{get(e){return new vL(this,e)}};oe("FeatureIndexArray",I2);P2=class extends qg{},C2=class extends r2{},xL=class extends qg{},bL=class extends qg{},_L=class extends n2{},wL=class extends i2{},SL=class extends xm{},Rh=class extends o2{},IL=class extends s2{},PL=class extends a2{},CL=class extends l2{},T2=class extends c2{},TL=class extends p2{},ca=class extends f2{},bm=class extends g2{}});var YUe,Ufe,TQt,EQt,Gfe=h(()=>{Uu();YUe=Hr([{name:"a_pos",components:2,type:"Int16"}],4),{members:Ufe,size:TQt,alignment:EQt}=YUe});var mn,Za=h(()=>{Oe();Qi();mn=class t{constructor(e=[]){this.segments=e}prepareSegment(e,r,n,i){let o=this.segments[this.segments.length-1];return e>t.MAX_VERTEX_ARRAY_LENGTH&&ks(`Max vertices per segment is ${t.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!o||o.vertexLength+e>t.MAX_VERTEX_ARRAY_LENGTH||o.sortKey!==i)&&(o={vertexOffset:r.length,primitiveOffset:n.length,vertexLength:0,primitiveLength:0},i!==void 0&&(o.sortKey=i),this.segments.push(o)),o}get(){return this.segments}destroy(){for(let e of this.segments)for(let r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,n,i){return new t([{vertexOffset:e,primitiveOffset:r,vertexLength:n,primitiveLength:i,vaos:{},sortKey:0}])}};mn.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1;oe("SegmentVector",mn)});function rz(t,e){return t=Os(Math.floor(t),0,255),e=Os(Math.floor(e),0,255),256*t+e}var jfe=h(()=>{Oe()});var E2,$fe=h(()=>{Uu();E2=Hr([{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 qfe=V((NQt,nz)=>{function KUe(t,e){var r,n,i,o,s,a,l,u,c,p;for(r=t.length&3,n=t.length-r,i=e,s=3432918353,l=461845907,p=0;p<n;)c=t.charCodeAt(p)&255|(t.charCodeAt(++p)&255)<<8|(t.charCodeAt(++p)&255)<<16|(t.charCodeAt(++p)&255)<<24,++p,c=(c&65535)*s+(((c>>>16)*s&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(c&65535)*l+(((c>>>16)*l&65535)<<16)&4294967295,i^=c,i=i<<13|i>>>19,o=(i&65535)*5+(((i>>>16)*5&65535)<<16)&4294967295,i=(o&65535)+27492+(((o>>>16)+58964&65535)<<16);switch(c=0,r){case 3:c^=(t.charCodeAt(p+2)&255)<<16;case 2:c^=(t.charCodeAt(p+1)&255)<<8;case 1:c^=t.charCodeAt(p)&255,c=(c&65535)*s+(((c>>>16)*s&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(c&65535)*l+(((c>>>16)*l&65535)<<16)&4294967295,i^=c}return i^=t.length,i^=i>>>16,i=(i&65535)*2246822507+(((i>>>16)*2246822507&65535)<<16)&4294967295,i^=i>>>13,i=(i&65535)*3266489909+(((i>>>16)*3266489909&65535)<<16)&4294967295,i^=i>>>16,i>>>0}typeof nz<"u"&&(nz.exports=KUe)});var Hfe=V((BQt,iz)=>{function JUe(t,e){for(var r=t.length,n=e^r,i=0,o;r>=4;)o=t.charCodeAt(i)&255|(t.charCodeAt(++i)&255)<<8|(t.charCodeAt(++i)&255)<<16|(t.charCodeAt(++i)&255)<<24,o=(o&65535)*1540483477+(((o>>>16)*1540483477&65535)<<16),o^=o>>>24,o=(o&65535)*1540483477+(((o>>>16)*1540483477&65535)<<16),n=(n&65535)*1540483477+(((n>>>16)*1540483477&65535)<<16)^o,r-=4,++i;switch(r){case 3:n^=(t.charCodeAt(i+2)&255)<<16;case 2:n^=(t.charCodeAt(i+1)&255)<<8;case 1:n^=t.charCodeAt(i)&255,n=(n&65535)*1540483477+(((n>>>16)*1540483477&65535)<<16)}return n^=n>>>13,n=(n&65535)*1540483477+(((n>>>16)*1540483477&65535)<<16),n^=n>>>15,n>>>0}typeof iz!==void 0&&(iz.exports=JUe)});var oz=V((zQt,EL)=>{var Wfe=qfe(),QUe=Hfe();EL.exports=Wfe;EL.exports.murmur3=Wfe;EL.exports.murmur2=QUe});function Zfe(t){let e=+t;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:(0,Xfe.default)(String(t))}function sz(t,e,r,n){for(;r<n;){let i=t[r+n>>1],o=r-1,s=n+1;for(;;){do o++;while(t[o]<i);do s--;while(t[s]>i);if(o>=s)break;ML(t,o,s),ML(e,3*o,3*s),ML(e,3*o+1,3*s+1),ML(e,3*o+2,3*s+2)}s-r<n-s?(sz(t,e,r,s),r=s+1):(sz(t,e,s+1,n),n=s)}}function ML(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}var Xfe,M2,Yfe=h(()=>{Xfe=_e(oz(),1);Qi();M2=class t{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,n,i){this.ids.push(Zfe(e)),this.positions.push(r,n,i)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let r=Zfe(e),n=0,i=this.ids.length-1;for(;n<i;){let s=n+i>>1;this.ids[s]>=r?i=s:n=s+1}let o=[];for(;this.ids[n]===r;){let s=this.positions[3*n],a=this.positions[3*n+1],l=this.positions[3*n+2];o.push({index:s,start:a,end:l}),n++}return o}static serialize(e,r){let n=new Float64Array(e.ids),i=new Uint32Array(e.positions);return sz(n,i,0,n.length-1),r&&r.push(n.buffer,i.buffer),{ids:n,positions:i}}static deserialize(e){let r=new t;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}};oe("FeaturePositionMap",M2)});var A2,Bo,db,Wg,jQt,pa=h(()=>{ua();A2=class{constructor(e,r){this.gl=e.gl,this.location=r}},Bo=class extends A2{constructor(e,r){super(e,r),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}},db=class extends A2{constructor(e,r){super(e,r),this.current=[0,0,0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1]||e[2]!==this.current[2]||e[3]!==this.current[3])&&(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}},Wg=class extends A2{constructor(e,r){super(e,r),this.current=wt.transparent}set(e){(e.r!==this.current.r||e.g!==this.current.g||e.b!==this.current.b||e.a!==this.current.a)&&(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}},jQt=new Float32Array(16)});function az(t){return[rz(255*t.r,255*t.g),rz(255*t.b,255*t.a)]}function eGe(t,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"]}[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}function tGe(t){return{"line-pattern":{source:Rh,composite:Rh},"fill-pattern":{source:Rh,composite:Rh},"fill-extrusion-pattern":{source:Rh,composite:Rh}}[t]}function Kfe(t,e,r){let n={color:{source:xm,composite:hb},number:{source:Hg,composite:xm}},i=tGe(t);return i&&i[r]||n[e][r]}var Zg,_m,Jc,Ml,yf,AL,Xa,mb=h(()=>{jfe();ua();Qi();Fs();Wa();Oe();$fe();qa();Yfe();pa();Zg=class{constructor(e,r,n){this.value=e,this.uniformNames=r.map(i=>`u_${i}`),this.type=n}setUniform(e,r,n){e.set(n.constantOr(this.value))}getBinding(e,r,n){return this.type==="color"?new Wg(e,r):new Bo(e,r)}},_m=class{constructor(e,r){this.uniformNames=r.map(n=>`u_${n}`),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,n,i){let o=i==="u_pattern_to"?this.patternTo:i==="u_pattern_from"?this.patternFrom:i==="u_pixel_ratio_to"?this.pixelRatioTo:i==="u_pixel_ratio_from"?this.pixelRatioFrom:null;o&&e.set(o)}getBinding(e,r,n){return n.substr(0,9)==="u_pattern"?new db(e,r):new Bo(e,r)}},Jc=class{constructor(e,r,n,i){this.expression=e,this.type=n,this.maxValue=0,this.paintVertexAttributes=r.map(o=>({name:`a_${o}`,type:"Float32",components:n==="color"?2:1,offset:0})),this.paintVertexArray=new i}populatePaintArray(e,r,n,i,o){let s=this.paintVertexArray.length,a=this.expression.evaluate(new qr(0),r,{},i,[],o);this.paintVertexArray.resize(e),this._setPaintValue(s,e,a)}updatePaintArray(e,r,n,i){let o=this.expression.evaluate({zoom:0},n,i);this._setPaintValue(e,r,o)}_setPaintValue(e,r,n){if(this.type==="color"){let i=az(n);for(let o=e;o<r;o++)this.paintVertexArray.emplace(o,i[0],i[1])}else{for(let i=e;i<r;i++)this.paintVertexArray.emplace(i,n);this.maxValue=Math.max(this.maxValue,Math.abs(n))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}},Ml=class{constructor(e,r,n,i,o,s){this.expression=e,this.uniformNames=r.map(a=>`u_${a}_t`),this.type=n,this.useIntegerZoom=i,this.zoom=o,this.maxValue=0,this.paintVertexAttributes=r.map(a=>({name:`a_${a}`,type:"Float32",components:n==="color"?4:2,offset:0})),this.paintVertexArray=new s}populatePaintArray(e,r,n,i,o){let s=this.expression.evaluate(new qr(this.zoom),r,{},i,[],o),a=this.expression.evaluate(new qr(this.zoom+1),r,{},i,[],o),l=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(l,e,s,a)}updatePaintArray(e,r,n,i){let o=this.expression.evaluate({zoom:this.zoom},n,i),s=this.expression.evaluate({zoom:this.zoom+1},n,i);this._setPaintValue(e,r,o,s)}_setPaintValue(e,r,n,i){if(this.type==="color"){let o=az(n),s=az(i);for(let a=e;a<r;a++)this.paintVertexArray.emplace(a,o[0],o[1],s[0],s[1])}else{for(let o=e;o<r;o++)this.paintVertexArray.emplace(o,n,i);this.maxValue=Math.max(this.maxValue,Math.abs(n),Math.abs(i))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,r){let n=this.useIntegerZoom?Math.floor(r.zoom):r.zoom,i=Os(this.expression.interpolationFactor(n,this.zoom,this.zoom+1),0,1);e.set(i)}getBinding(e,r,n){return new Bo(e,r)}},yf=class{constructor(e,r,n,i,o,s){this.expression=e,this.type=r,this.useIntegerZoom=n,this.zoom=i,this.layerId=s,this.zoomInPaintVertexArray=new o,this.zoomOutPaintVertexArray=new o}populatePaintArray(e,r,n){let i=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(i,e,r.patterns&&r.patterns[this.layerId],n)}updatePaintArray(e,r,n,i,o){this._setPaintValues(e,r,n.patterns&&n.patterns[this.layerId],o)}_setPaintValues(e,r,n,i){if(!i||!n)return;let{min:o,mid:s,max:a}=n,l=i[o],u=i[s],c=i[a];if(!(!l||!u||!c))for(let p=e;p<r;p++)this.zoomInPaintVertexArray.emplace(p,u.tl[0],u.tl[1],u.br[0],u.br[1],l.tl[0],l.tl[1],l.br[0],l.br[1],u.pixelRatio,l.pixelRatio),this.zoomOutPaintVertexArray.emplace(p,u.tl[0],u.tl[1],u.br[0],u.br[1],c.tl[0],c.tl[1],c.br[0],c.br[1],u.pixelRatio,c.pixelRatio)}upload(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,E2.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,E2.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}},AL=class{constructor(e,r,n){this.binders={},this._buffers=[];let i=[];for(let o in e.paint._values){if(!n(o))continue;let s=e.paint.get(o);if(!(s instanceof Ha)||!rb(s.property.specification))continue;let a=eGe(o,e.type),l=s.value,u=s.property.specification.type,c=s.property.useIntegerZoom,p=s.property.specification["property-type"],f=p==="cross-faded"||p==="cross-faded-data-driven";if(l.kind==="constant")this.binders[o]=f?new _m(l.value,a):new Zg(l.value,a,u),i.push(`/u_${o}`);else if(l.kind==="source"||f){let d=Kfe(o,u,"source");this.binders[o]=f?new yf(l,u,c,r,d,e.id):new Jc(l,a,u,d),i.push(`/a_${o}`)}else{let d=Kfe(o,u,"composite");this.binders[o]=new Ml(l,a,u,c,r,d),i.push(`/z_${o}`)}}this.cacheKey=i.sort().join("")}getMaxValue(e){let r=this.binders[e];return r instanceof Jc||r instanceof Ml?r.maxValue:0}populatePaintArrays(e,r,n,i,o){for(let s in this.binders){let a=this.binders[s];(a instanceof Jc||a instanceof Ml||a instanceof yf)&&a.populatePaintArray(e,r,n,i,o)}}setConstantPatternPositions(e,r){for(let n in this.binders){let i=this.binders[n];i instanceof _m&&i.setConstantPatternPositions(e,r)}}updatePaintArrays(e,r,n,i,o){let s=!1;for(let a in e){let l=r.getPositions(a);for(let u of l){let c=n.feature(u.index);for(let p in this.binders){let f=this.binders[p];if((f instanceof Jc||f instanceof Ml||f instanceof yf)&&f.expression.isStateDependent===!0){let d=i.paint.get(p);f.expression=d.value,f.updatePaintArray(u.start,u.end,c,e[a],o),s=!0}}}}return s}defines(){let e=[];for(let r in this.binders){let n=this.binders[r];(n instanceof Zg||n instanceof _m)&&e.push(...n.uniformNames.map(i=>`#define HAS_UNIFORM_${i}`))}return e}getBinderAttributes(){let e=[];for(let r in this.binders){let n=this.binders[r];if(n instanceof Jc||n instanceof Ml)for(let i=0;i<n.paintVertexAttributes.length;i++)e.push(n.paintVertexAttributes[i].name);else if(n instanceof yf)for(let i=0;i<E2.members.length;i++)e.push(E2.members[i].name)}return e}getBinderUniforms(){let e=[];for(let r in this.binders){let n=this.binders[r];if(n instanceof Zg||n instanceof _m||n instanceof Ml)for(let i of n.uniformNames)e.push(i)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,r){let n=[];for(let i in this.binders){let o=this.binders[i];if(o instanceof Zg||o instanceof _m||o instanceof Ml){for(let s of o.uniformNames)if(r[s]){let a=o.getBinding(e,r[s],s);n.push({name:s,property:i,binding:a})}}}return n}setUniforms(e,r,n,i){for(let{name:o,property:s,binding:a}of r)this.binders[s].setUniform(a,i,n.get(s),o)}updatePaintBuffers(e){this._buffers=[];for(let r in this.binders){let n=this.binders[r];if(e&&n instanceof yf){let i=e.fromScale===2?n.zoomInPaintVertexBuffer:n.zoomOutPaintVertexBuffer;i&&this._buffers.push(i)}else(n instanceof Jc||n instanceof Ml)&&n.paintVertexBuffer&&this._buffers.push(n.paintVertexBuffer)}}upload(e){for(let r in this.binders){let n=this.binders[r];(n instanceof Jc||n instanceof Ml||n instanceof yf)&&n.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let r=this.binders[e];(r instanceof Jc||r instanceof Ml||r instanceof yf)&&r.destroy()}}},Xa=class{constructor(e,r,n=()=>!0){this.programConfigurations={};for(let i of e)this.programConfigurations[i.id]=new AL(i,r,n);this.needsUpload=!1,this._featureMap=new M2,this._bufferOffset=0}populatePaintArrays(e,r,n,i,o,s){for(let a in this.programConfigurations)this.programConfigurations[a].populatePaintArrays(e,r,i,o,s);r.id!==void 0&&this._featureMap.add(r.id,n,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,r,n,i){for(let o of n)this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(e,this._featureMap,r,o,i)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(let r in this.programConfigurations)this.programConfigurations[r].upload(e);this.needsUpload=!1}}destroy(){for(let e in this.programConfigurations)this.programConfigurations[e].destroy()}};oe("ConstantBinder",Zg);oe("CrossFadedConstantBinder",_m);oe("SourceExpressionBinder",Jc);oe("CrossFadedCompositeBinder",yf);oe("CompositeExpressionBinder",Ml);oe("ProgramConfiguration",AL,{omit:["_buffers"]});oe("ProgramConfigurationSet",Xa)});var yb=h(()=>{Wa()});var eo=h(()=>{});function Ya(t){let e=8192/t.extent,r=t.loadGeometry();for(let n=0;n<r.length;n++){let i=r[n];for(let o=0;o<i.length;o++){let s=i[o],a=Math.round(s.x*e),l=Math.round(s.y*e);s.x=Os(a,Jfe,lz),s.y=Os(l,Jfe,lz),(a<s.x||a>s.x+1||l<s.y||l>s.y+1)&&ks("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}var nGe,lz,Jfe,wm=h(()=>{Oe();eo();nGe=15,lz=Math.pow(2,nGe-1)-1,Jfe=-lz-1});function Ka(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Ya(t):[]}}var Sm=h(()=>{wm()});function LL(t,e,r,n,i){t.emplaceBack(e*2+(n+1)/2,r*2+(i+1)/2)}var gb,uz=h(()=>{Wa();Gfe();Za();mb();yb();wm();Sm();eo();Qi();qa();gb=class{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 xL,this.indexArray=new ca,this.segments=new mn,this.programConfigurations=new Xa(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,n){let i=this.layers[0],o=[],s=null,a=!1;i.type==="circle"&&(s=i.layout.get("circle-sort-key"),a=!s.isConstant());for(let{feature:l,id:u,index:c,sourceLayerIndex:p}of e){let f=this.layers[0]._featureFilter.needGeometry,d=Ka(l,f);if(!this.layers[0]._featureFilter.filter(new qr(this.zoom),d,n))continue;let m=a?s.evaluate(d,{},n):void 0,y={id:u,properties:l.properties,type:l.type,sourceLayerIndex:p,index:c,geometry:f?d.geometry:Ya(l),patterns:{},sortKey:m};o.push(y)}a&&o.sort((l,u)=>l.sortKey-u.sortKey);for(let l of o){let{geometry:u,index:c,sourceLayerIndex:p}=l,f=e[c].feature;this.addFeature(l,u,c,n),r.featureIndex.insert(f,u,c,p,this.index)}}update(e,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,n)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Ufe),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,n,i){for(let o of r)for(let s of o){let a=s.x,l=s.y;if(a<0||a>=8192||l<0||l>=8192)continue;let u=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),c=u.vertexLength;LL(this.layoutVertexArray,a,l,-1,-1),LL(this.layoutVertexArray,a,l,1,-1),LL(this.layoutVertexArray,a,l,1,1),LL(this.layoutVertexArray,a,l,-1,1),this.indexArray.emplaceBack(c,c+1,c+2),this.indexArray.emplaceBack(c,c+3,c+2),u.vertexLength+=4,u.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{},i)}};oe("CircleBucket",gb,{omit:["layers"]})});function iGe(t,e){let r=!1;for(let n=0,i=t.length-1;n<t.length;i=n++){let o=t[n],s=t[i];o.y>e.y!=s.y>e.y&&e.x<(s.x-o.x)*(e.y-o.y)/(s.y-o.y)+o.x&&(r=!r)}return r}function Qfe(t,e,r,n,i){for(let s of t)if(e<=s.x&&r<=s.y&&n>=s.x&&i>=s.y)return!0;let o=[new L2.default(e,r),new L2.default(e,i),new L2.default(n,i),new L2.default(n,r)];if(t.length>2){for(let s of o)if(iGe(t,s))return!0}for(let s=0;s<t.length-1;s++){let a=t[s],l=t[s+1];if(oGe(a,l,o))return!0}return!1}function oGe(t,e,r){let n=r[0],i=r[2];if(t.x<n.x&&e.x<n.x||t.x>i.x&&e.x>i.x||t.y<n.y&&e.y<n.y||t.y>i.y&&e.y>i.y)return!1;let o=TI(t,e,r[0]);return o!==TI(t,e,r[1])||o!==TI(t,e,r[2])||o!==TI(t,e,r[3])}var L2,Im=h(()=>{Oe();L2=_e(Br(),1)});var aGe,D2=h(()=>{aGe=_e(Br(),1)});var ehe=h(()=>{Fs()});var Ci,Xg,Der,the=h(()=>{Ci=1e-6,Xg=typeof Float32Array<"u"?Float32Array:Array,Der=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)})});var Yg={};Go(Yg,{add:()=>HGe,adjoint:()=>yGe,clone:()=>cGe,copy:()=>pGe,create:()=>uGe,determinant:()=>gGe,equals:()=>YGe,exactEquals:()=>XGe,frob:()=>qGe,fromQuat:()=>FGe,fromQuat2:()=>AGe,fromRotation:()=>CGe,fromRotationTranslation:()=>ihe,fromRotationTranslationScale:()=>OGe,fromRotationTranslationScaleOrigin:()=>kGe,fromScaling:()=>PGe,fromTranslation:()=>IGe,fromValues:()=>fGe,fromXRotation:()=>TGe,fromYRotation:()=>EGe,fromZRotation:()=>MGe,frustum:()=>RGe,getRotation:()=>DGe,getScaling:()=>ohe,getTranslation:()=>LGe,identity:()=>rhe,invert:()=>mGe,lookAt:()=>GGe,mul:()=>KGe,multiply:()=>nhe,multiplyScalar:()=>WGe,multiplyScalarAndAdd:()=>ZGe,ortho:()=>VGe,orthoNO:()=>ahe,orthoZO:()=>UGe,perspective:()=>NGe,perspectiveFromFieldOfView:()=>zGe,perspectiveNO:()=>she,perspectiveZO:()=>BGe,rotate:()=>bGe,rotateX:()=>_Ge,rotateY:()=>wGe,rotateZ:()=>SGe,scale:()=>xGe,set:()=>hGe,str:()=>$Ge,sub:()=>JGe,subtract:()=>lhe,targetTo:()=>jGe,translate:()=>vGe,transpose:()=>dGe});function uGe(){var t=new Xg(16);return Xg!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function cGe(t){var e=new Xg(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function pGe(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function fGe(t,e,r,n,i,o,s,a,l,u,c,p,f,d,m,y){var g=new Xg(16);return g[0]=t,g[1]=e,g[2]=r,g[3]=n,g[4]=i,g[5]=o,g[6]=s,g[7]=a,g[8]=l,g[9]=u,g[10]=c,g[11]=p,g[12]=f,g[13]=d,g[14]=m,g[15]=y,g}function hGe(t,e,r,n,i,o,s,a,l,u,c,p,f,d,m,y,g){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=s,t[6]=a,t[7]=l,t[8]=u,t[9]=c,t[10]=p,t[11]=f,t[12]=d,t[13]=m,t[14]=y,t[15]=g,t}function rhe(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function dGe(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],o=e[6],s=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=o,t[11]=e[14],t[12]=i,t[13]=s,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function mGe(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],c=e[8],p=e[9],f=e[10],d=e[11],m=e[12],y=e[13],g=e[14],b=e[15],w=r*a-n*s,S=r*l-i*s,I=r*u-o*s,P=n*l-i*a,T=n*u-o*a,M=i*u-o*l,E=c*y-p*m,D=c*g-f*m,B=c*b-d*m,$=p*g-f*y,U=p*b-d*y,Y=f*b-d*g,G=w*Y-S*U+I*$+P*B-T*D+M*E;return G?(G=1/G,t[0]=(a*Y-l*U+u*$)*G,t[1]=(i*U-n*Y-o*$)*G,t[2]=(y*M-g*T+b*P)*G,t[3]=(f*T-p*M-d*P)*G,t[4]=(l*B-s*Y-u*D)*G,t[5]=(r*Y-i*B+o*D)*G,t[6]=(g*I-m*M-b*S)*G,t[7]=(c*M-f*I+d*S)*G,t[8]=(s*U-a*B+u*E)*G,t[9]=(n*B-r*U-o*E)*G,t[10]=(m*T-y*I+b*w)*G,t[11]=(p*I-c*T-d*w)*G,t[12]=(a*D-s*$-l*E)*G,t[13]=(r*$-n*D+i*E)*G,t[14]=(y*S-m*P-g*w)*G,t[15]=(c*P-p*S+f*w)*G,t):null}function yGe(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],c=e[8],p=e[9],f=e[10],d=e[11],m=e[12],y=e[13],g=e[14],b=e[15];return t[0]=a*(f*b-d*g)-p*(l*b-u*g)+y*(l*d-u*f),t[1]=-(n*(f*b-d*g)-p*(i*b-o*g)+y*(i*d-o*f)),t[2]=n*(l*b-u*g)-a*(i*b-o*g)+y*(i*u-o*l),t[3]=-(n*(l*d-u*f)-a*(i*d-o*f)+p*(i*u-o*l)),t[4]=-(s*(f*b-d*g)-c*(l*b-u*g)+m*(l*d-u*f)),t[5]=r*(f*b-d*g)-c*(i*b-o*g)+m*(i*d-o*f),t[6]=-(r*(l*b-u*g)-s*(i*b-o*g)+m*(i*u-o*l)),t[7]=r*(l*d-u*f)-s*(i*d-o*f)+c*(i*u-o*l),t[8]=s*(p*b-d*y)-c*(a*b-u*y)+m*(a*d-u*p),t[9]=-(r*(p*b-d*y)-c*(n*b-o*y)+m*(n*d-o*p)),t[10]=r*(a*b-u*y)-s*(n*b-o*y)+m*(n*u-o*a),t[11]=-(r*(a*d-u*p)-s*(n*d-o*p)+c*(n*u-o*a)),t[12]=-(s*(p*g-f*y)-c*(a*g-l*y)+m*(a*f-l*p)),t[13]=r*(p*g-f*y)-c*(n*g-i*y)+m*(n*f-i*p),t[14]=-(r*(a*g-l*y)-s*(n*g-i*y)+m*(n*l-i*a)),t[15]=r*(a*f-l*p)-s*(n*f-i*p)+c*(n*l-i*a),t}function gGe(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],s=t[5],a=t[6],l=t[7],u=t[8],c=t[9],p=t[10],f=t[11],d=t[12],m=t[13],y=t[14],g=t[15],b=e*s-r*o,w=e*a-n*o,S=e*l-i*o,I=r*a-n*s,P=r*l-i*s,T=n*l-i*a,M=u*m-c*d,E=u*y-p*d,D=u*g-f*d,B=c*y-p*m,$=c*g-f*m,U=p*g-f*y;return b*U-w*$+S*B+I*D-P*E+T*M}function nhe(t,e,r){var n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],l=e[5],u=e[6],c=e[7],p=e[8],f=e[9],d=e[10],m=e[11],y=e[12],g=e[13],b=e[14],w=e[15],S=r[0],I=r[1],P=r[2],T=r[3];return t[0]=S*n+I*a+P*p+T*y,t[1]=S*i+I*l+P*f+T*g,t[2]=S*o+I*u+P*d+T*b,t[3]=S*s+I*c+P*m+T*w,S=r[4],I=r[5],P=r[6],T=r[7],t[4]=S*n+I*a+P*p+T*y,t[5]=S*i+I*l+P*f+T*g,t[6]=S*o+I*u+P*d+T*b,t[7]=S*s+I*c+P*m+T*w,S=r[8],I=r[9],P=r[10],T=r[11],t[8]=S*n+I*a+P*p+T*y,t[9]=S*i+I*l+P*f+T*g,t[10]=S*o+I*u+P*d+T*b,t[11]=S*s+I*c+P*m+T*w,S=r[12],I=r[13],P=r[14],T=r[15],t[12]=S*n+I*a+P*p+T*y,t[13]=S*i+I*l+P*f+T*g,t[14]=S*o+I*u+P*d+T*b,t[15]=S*s+I*c+P*m+T*w,t}function vGe(t,e,r){var n=r[0],i=r[1],o=r[2],s,a,l,u,c,p,f,d,m,y,g,b;return e===t?(t[12]=e[0]*n+e[4]*i+e[8]*o+e[12],t[13]=e[1]*n+e[5]*i+e[9]*o+e[13],t[14]=e[2]*n+e[6]*i+e[10]*o+e[14],t[15]=e[3]*n+e[7]*i+e[11]*o+e[15]):(s=e[0],a=e[1],l=e[2],u=e[3],c=e[4],p=e[5],f=e[6],d=e[7],m=e[8],y=e[9],g=e[10],b=e[11],t[0]=s,t[1]=a,t[2]=l,t[3]=u,t[4]=c,t[5]=p,t[6]=f,t[7]=d,t[8]=m,t[9]=y,t[10]=g,t[11]=b,t[12]=s*n+c*i+m*o+e[12],t[13]=a*n+p*i+y*o+e[13],t[14]=l*n+f*i+g*o+e[14],t[15]=u*n+d*i+b*o+e[15]),t}function xGe(t,e,r){var n=r[0],i=r[1],o=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function bGe(t,e,r,n){var i=n[0],o=n[1],s=n[2],a=Math.hypot(i,o,s),l,u,c,p,f,d,m,y,g,b,w,S,I,P,T,M,E,D,B,$,U,Y,G,ne;return a<Ci?null:(a=1/a,i*=a,o*=a,s*=a,l=Math.sin(r),u=Math.cos(r),c=1-u,p=e[0],f=e[1],d=e[2],m=e[3],y=e[4],g=e[5],b=e[6],w=e[7],S=e[8],I=e[9],P=e[10],T=e[11],M=i*i*c+u,E=o*i*c+s*l,D=s*i*c-o*l,B=i*o*c-s*l,$=o*o*c+u,U=s*o*c+i*l,Y=i*s*c+o*l,G=o*s*c-i*l,ne=s*s*c+u,t[0]=p*M+y*E+S*D,t[1]=f*M+g*E+I*D,t[2]=d*M+b*E+P*D,t[3]=m*M+w*E+T*D,t[4]=p*B+y*$+S*U,t[5]=f*B+g*$+I*U,t[6]=d*B+b*$+P*U,t[7]=m*B+w*$+T*U,t[8]=p*Y+y*G+S*ne,t[9]=f*Y+g*G+I*ne,t[10]=d*Y+b*G+P*ne,t[11]=m*Y+w*G+T*ne,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function _Ge(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[4],s=e[5],a=e[6],l=e[7],u=e[8],c=e[9],p=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+u*n,t[5]=s*i+c*n,t[6]=a*i+p*n,t[7]=l*i+f*n,t[8]=u*i-o*n,t[9]=c*i-s*n,t[10]=p*i-a*n,t[11]=f*i-l*n,t}function wGe(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[0],s=e[1],a=e[2],l=e[3],u=e[8],c=e[9],p=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-u*n,t[1]=s*i-c*n,t[2]=a*i-p*n,t[3]=l*i-f*n,t[8]=o*n+u*i,t[9]=s*n+c*i,t[10]=a*n+p*i,t[11]=l*n+f*i,t}function SGe(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[0],s=e[1],a=e[2],l=e[3],u=e[4],c=e[5],p=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+u*n,t[1]=s*i+c*n,t[2]=a*i+p*n,t[3]=l*i+f*n,t[4]=u*i-o*n,t[5]=c*i-s*n,t[6]=p*i-a*n,t[7]=f*i-l*n,t}function IGe(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function PGe(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function CGe(t,e,r){var n=r[0],i=r[1],o=r[2],s=Math.hypot(n,i,o),a,l,u;return s<Ci?null:(s=1/s,n*=s,i*=s,o*=s,a=Math.sin(e),l=Math.cos(e),u=1-l,t[0]=n*n*u+l,t[1]=i*n*u+o*a,t[2]=o*n*u-i*a,t[3]=0,t[4]=n*i*u-o*a,t[5]=i*i*u+l,t[6]=o*i*u+n*a,t[7]=0,t[8]=n*o*u+i*a,t[9]=i*o*u-n*a,t[10]=o*o*u+l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function TGe(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function EGe(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function MGe(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ihe(t,e,r){var n=e[0],i=e[1],o=e[2],s=e[3],a=n+n,l=i+i,u=o+o,c=n*a,p=n*l,f=n*u,d=i*l,m=i*u,y=o*u,g=s*a,b=s*l,w=s*u;return t[0]=1-(d+y),t[1]=p+w,t[2]=f-b,t[3]=0,t[4]=p-w,t[5]=1-(c+y),t[6]=m+g,t[7]=0,t[8]=f+b,t[9]=m-g,t[10]=1-(c+d),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function AGe(t,e){var r=new Xg(3),n=-e[0],i=-e[1],o=-e[2],s=e[3],a=e[4],l=e[5],u=e[6],c=e[7],p=n*n+i*i+o*o+s*s;return p>0?(r[0]=(a*s+c*n+l*o-u*i)*2/p,r[1]=(l*s+c*i+u*n-a*o)*2/p,r[2]=(u*s+c*o+a*i-l*n)*2/p):(r[0]=(a*s+c*n+l*o-u*i)*2,r[1]=(l*s+c*i+u*n-a*o)*2,r[2]=(u*s+c*o+a*i-l*n)*2),ihe(t,e,r),t}function LGe(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function ohe(t,e){var r=e[0],n=e[1],i=e[2],o=e[4],s=e[5],a=e[6],l=e[8],u=e[9],c=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(o,s,a),t[2]=Math.hypot(l,u,c),t}function DGe(t,e){var r=new Xg(3);ohe(r,e);var n=1/r[0],i=1/r[1],o=1/r[2],s=e[0]*n,a=e[1]*i,l=e[2]*o,u=e[4]*n,c=e[5]*i,p=e[6]*o,f=e[8]*n,d=e[9]*i,m=e[10]*o,y=s+c+m,g=0;return y>0?(g=Math.sqrt(y+1)*2,t[3]=.25*g,t[0]=(p-d)/g,t[1]=(f-l)/g,t[2]=(a-u)/g):s>c&&s>m?(g=Math.sqrt(1+s-c-m)*2,t[3]=(p-d)/g,t[0]=.25*g,t[1]=(a+u)/g,t[2]=(f+l)/g):c>m?(g=Math.sqrt(1+c-s-m)*2,t[3]=(f-l)/g,t[0]=(a+u)/g,t[1]=.25*g,t[2]=(p+d)/g):(g=Math.sqrt(1+m-s-c)*2,t[3]=(a-u)/g,t[0]=(f+l)/g,t[1]=(p+d)/g,t[2]=.25*g),t}function OGe(t,e,r,n){var i=e[0],o=e[1],s=e[2],a=e[3],l=i+i,u=o+o,c=s+s,p=i*l,f=i*u,d=i*c,m=o*u,y=o*c,g=s*c,b=a*l,w=a*u,S=a*c,I=n[0],P=n[1],T=n[2];return t[0]=(1-(m+g))*I,t[1]=(f+S)*I,t[2]=(d-w)*I,t[3]=0,t[4]=(f-S)*P,t[5]=(1-(p+g))*P,t[6]=(y+b)*P,t[7]=0,t[8]=(d+w)*T,t[9]=(y-b)*T,t[10]=(1-(p+m))*T,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function kGe(t,e,r,n,i){var o=e[0],s=e[1],a=e[2],l=e[3],u=o+o,c=s+s,p=a+a,f=o*u,d=o*c,m=o*p,y=s*c,g=s*p,b=a*p,w=l*u,S=l*c,I=l*p,P=n[0],T=n[1],M=n[2],E=i[0],D=i[1],B=i[2],$=(1-(y+b))*P,U=(d+I)*P,Y=(m-S)*P,G=(d-I)*T,ne=(1-(f+b))*T,le=(g+w)*T,se=(m+S)*M,X=(g-w)*M,ee=(1-(f+y))*M;return t[0]=$,t[1]=U,t[2]=Y,t[3]=0,t[4]=G,t[5]=ne,t[6]=le,t[7]=0,t[8]=se,t[9]=X,t[10]=ee,t[11]=0,t[12]=r[0]+E-($*E+G*D+se*B),t[13]=r[1]+D-(U*E+ne*D+X*B),t[14]=r[2]+B-(Y*E+le*D+ee*B),t[15]=1,t}function FGe(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],s=r+r,a=n+n,l=i+i,u=r*s,c=n*s,p=n*a,f=i*s,d=i*a,m=i*l,y=o*s,g=o*a,b=o*l;return t[0]=1-p-m,t[1]=c+b,t[2]=f-g,t[3]=0,t[4]=c-b,t[5]=1-u-m,t[6]=d+y,t[7]=0,t[8]=f+g,t[9]=d-y,t[10]=1-u-p,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function RGe(t,e,r,n,i,o,s){var a=1/(r-e),l=1/(i-n),u=1/(o-s);return t[0]=o*2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o*2*l,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(i+n)*l,t[10]=(s+o)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=s*o*2*u,t[15]=0,t}function she(t,e,r,n,i){var o=1/Math.tan(e/2),s;return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,i!=null&&i!==1/0?(s=1/(n-i),t[10]=(i+n)*s,t[14]=2*i*n*s):(t[10]=-1,t[14]=-2*n),t}function BGe(t,e,r,n,i){var o=1/Math.tan(e/2),s;return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,i!=null&&i!==1/0?(s=1/(n-i),t[10]=i*s,t[14]=i*n*s):(t[10]=-1,t[14]=-n),t}function zGe(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),s=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),l=2/(s+a),u=2/(i+o);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-((s-a)*l*.5),t[9]=(i-o)*u*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function ahe(t,e,r,n,i,o,s){var a=1/(e-r),l=1/(n-i),u=1/(o-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*a,t[13]=(i+n)*l,t[14]=(s+o)*u,t[15]=1,t}function UGe(t,e,r,n,i,o,s){var a=1/(e-r),l=1/(n-i),u=1/(o-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=u,t[11]=0,t[12]=(e+r)*a,t[13]=(i+n)*l,t[14]=o*u,t[15]=1,t}function GGe(t,e,r,n){var i,o,s,a,l,u,c,p,f,d,m=e[0],y=e[1],g=e[2],b=n[0],w=n[1],S=n[2],I=r[0],P=r[1],T=r[2];return Math.abs(m-I)<Ci&&Math.abs(y-P)<Ci&&Math.abs(g-T)<Ci?rhe(t):(c=m-I,p=y-P,f=g-T,d=1/Math.hypot(c,p,f),c*=d,p*=d,f*=d,i=w*f-S*p,o=S*c-b*f,s=b*p-w*c,d=Math.hypot(i,o,s),d?(d=1/d,i*=d,o*=d,s*=d):(i=0,o=0,s=0),a=p*s-f*o,l=f*i-c*s,u=c*o-p*i,d=Math.hypot(a,l,u),d?(d=1/d,a*=d,l*=d,u*=d):(a=0,l=0,u=0),t[0]=i,t[1]=a,t[2]=c,t[3]=0,t[4]=o,t[5]=l,t[6]=p,t[7]=0,t[8]=s,t[9]=u,t[10]=f,t[11]=0,t[12]=-(i*m+o*y+s*g),t[13]=-(a*m+l*y+u*g),t[14]=-(c*m+p*y+f*g),t[15]=1,t)}function jGe(t,e,r,n){var i=e[0],o=e[1],s=e[2],a=n[0],l=n[1],u=n[2],c=i-r[0],p=o-r[1],f=s-r[2],d=c*c+p*p+f*f;d>0&&(d=1/Math.sqrt(d),c*=d,p*=d,f*=d);var m=l*f-u*p,y=u*c-a*f,g=a*p-l*c;return d=m*m+y*y+g*g,d>0&&(d=1/Math.sqrt(d),m*=d,y*=d,g*=d),t[0]=m,t[1]=y,t[2]=g,t[3]=0,t[4]=p*g-f*y,t[5]=f*m-c*g,t[6]=c*y-p*m,t[7]=0,t[8]=c,t[9]=p,t[10]=f,t[11]=0,t[12]=i,t[13]=o,t[14]=s,t[15]=1,t}function $Ge(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function qGe(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function HGe(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function lhe(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function WGe(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function ZGe(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function XGe(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function YGe(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=t[6],u=t[7],c=t[8],p=t[9],f=t[10],d=t[11],m=t[12],y=t[13],g=t[14],b=t[15],w=e[0],S=e[1],I=e[2],P=e[3],T=e[4],M=e[5],E=e[6],D=e[7],B=e[8],$=e[9],U=e[10],Y=e[11],G=e[12],ne=e[13],le=e[14],se=e[15];return Math.abs(r-w)<=Ci*Math.max(1,Math.abs(r),Math.abs(w))&&Math.abs(n-S)<=Ci*Math.max(1,Math.abs(n),Math.abs(S))&&Math.abs(i-I)<=Ci*Math.max(1,Math.abs(i),Math.abs(I))&&Math.abs(o-P)<=Ci*Math.max(1,Math.abs(o),Math.abs(P))&&Math.abs(s-T)<=Ci*Math.max(1,Math.abs(s),Math.abs(T))&&Math.abs(a-M)<=Ci*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(l-E)<=Ci*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(u-D)<=Ci*Math.max(1,Math.abs(u),Math.abs(D))&&Math.abs(c-B)<=Ci*Math.max(1,Math.abs(c),Math.abs(B))&&Math.abs(p-$)<=Ci*Math.max(1,Math.abs(p),Math.abs($))&&Math.abs(f-U)<=Ci*Math.max(1,Math.abs(f),Math.abs(U))&&Math.abs(d-Y)<=Ci*Math.max(1,Math.abs(d),Math.abs(Y))&&Math.abs(m-G)<=Ci*Math.max(1,Math.abs(m),Math.abs(G))&&Math.abs(y-ne)<=Ci*Math.max(1,Math.abs(y),Math.abs(ne))&&Math.abs(g-le)<=Ci*Math.max(1,Math.abs(g),Math.abs(le))&&Math.abs(b-se)<=Ci*Math.max(1,Math.abs(b),Math.abs(se))}var NGe,VGe,KGe,JGe,uhe=h(()=>{the();NGe=she;VGe=ahe;KGe=nhe,JGe=lhe});var cz=h(()=>{uhe()});var eje,che=h(()=>{Kc();uz();Im();D2();ehe();eje=_e(Br(),1)});var DL,phe=h(()=>{uz();Qi();DL=class extends gb{};oe("HeatmapBucket",DL,{omit:["layers"]})});var fhe=h(()=>{Fs()});function hz(t,{width:e,height:r},n,i){if(!i)i=new Uint8Array(e*r*n);else if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==e*r*n)throw new RangeError(`mismatched image size. expected: ${i.length} but got: ${e*r*n}`);return t.width=e,t.height=r,t.data=i,t}function hhe(t,{width:e,height:r},n){if(e===t.width&&r===t.height)return;let i=hz({},{width:e,height:r},n);dz(t,i,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,r)},n),t.width=e,t.height=r,t.data=i.data}function dz(t,e,r,n,i,o){if(i.width===0||i.height===0)return e;if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");let s=t.data,a=e.data;if(s===a)throw new Error("srcData equals dstData, so image is already copied");for(let l=0;l<i.height;l++){let u=((r.y+l)*t.width+r.x)*o,c=((n.y+l)*e.width+n.x)*o;for(let p=0;p<i.width*o;p++)a[c+p]=s[u+p]}return e}var Kg,bo,gf=h(()=>{Qi();Kg=class t{constructor(e,r){hz(this,e,1,r)}resize(e){hhe(this,e,1)}clone(){return new t({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,n,i,o){dz(e,r,n,i,o,1)}},bo=class t{constructor(e,r){hz(this,e,4,r)}resize(e){hhe(this,e,4)}replace(e,r){r?this.data.set(e):e instanceof Uint8ClampedArray?this.data=new Uint8Array(e.buffer):this.data=e}clone(){return new t({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,n,i,o){dz(e,r,n,i,o,4)}};oe("AlphaImage",Kg);oe("RGBAImage",bo)});var mz=h(()=>{gf();Oe()});var dhe=h(()=>{Kc();phe();fhe();mz()});var mhe=h(()=>{Fs()});var yhe=h(()=>{Kc();mhe()});var rje,ghe,Ctr,Ttr,vhe=h(()=>{Uu();rje=Hr([{name:"a_pos",components:2,type:"Int16"}],4),{members:ghe,size:Ctr,alignment:Ttr}=rje});function O2(t,e){let r=t.length;if(r<=1)return[t];let n=[],i,o;for(let s=0;s<r;s++){let a=vpe(t[s]);a!==0&&(t[s].area=Math.abs(a),o===void 0&&(o=a<0),o===a<0?(i&&n.push(i),i=[t[s]]):i.push(t[s]))}if(i&&n.push(i),e>1)for(let s=0;s<n.length;s++)n[s].length<=e||(T_(n[s],e,1,n[s].length-1,nje),n[s]=n[s].slice(0,e));return n}function nje(t,e){return e.area-t.area}var OL=h(()=>{i4();Oe()});function vb(t,e,r){let n=r.patternDependencies,i=!1;for(let o of e){let s=o.paint.get(`${t}-pattern`);s.isConstant()||(i=!0);let a=s.constantOr(null);a&&(i=!0,n[a.to]=!0,n[a.from]=!0)}return i}function xb(t,e,r,n,i){let o=i.patternDependencies;for(let s of e){let l=s.paint.get(`${t}-pattern`).value;if(l.kind!=="constant"){let u=l.evaluate({zoom:n-1},r,{},i.availableImages),c=l.evaluate({zoom:n},r,{},i.availableImages),p=l.evaluate({zoom:n+1},r,{},i.availableImages);u=u&&u.name?u.name:u,c=c&&c.name?c.name:c,p=p&&p.name?p.name:p,o[u]=!0,o[c]=!0,o[p]=!0,r.patterns[s.id]={min:u,mid:c,max:p}}}return r}var kL=h(()=>{});var xhe,ije,FL,bhe=h(()=>{Wa();vhe();Za();mb();yb();xhe=_e(IC(),1);OL();Qi();kL();wm();Sm();qa();ije=500,FL=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new bL,this.indexArray=new ca,this.indexArray2=new bm,this.programConfigurations=new Xa(e.layers,e.zoom),this.segments=new mn,this.segments2=new mn,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,n){this.hasPattern=vb("fill",this.layers,r);let i=this.layers[0].layout.get("fill-sort-key"),o=!i.isConstant(),s=[];for(let{feature:a,id:l,index:u,sourceLayerIndex:c}of e){let p=this.layers[0]._featureFilter.needGeometry,f=Ka(a,p);if(!this.layers[0]._featureFilter.filter(new qr(this.zoom),f,n))continue;let d=o?i.evaluate(f,{},n,r.availableImages):void 0,m={id:l,properties:a.properties,type:a.type,sourceLayerIndex:c,index:u,geometry:p?f.geometry:Ya(a),patterns:{},sortKey:d};s.push(m)}o&&s.sort((a,l)=>a.sortKey-l.sortKey);for(let a of s){let{geometry:l,index:u,sourceLayerIndex:c}=a;if(this.hasPattern){let f=xb("fill",this.layers,a,this.zoom,r);this.patternFeatures.push(f)}else this.addFeature(a,l,u,n,{});let p=e[u].feature;r.featureIndex.insert(p,l,u,c,this.index)}}update(e,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,n)}addFeatures(e,r,n){for(let i of this.patternFeatures)this.addFeature(i,i.geometry,i.index,r,n)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,ghe),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,n,i,o){for(let s of O2(r,ije)){let a=0;for(let d of s)a+=d.length;let l=this.segments.prepareSegment(a,this.layoutVertexArray,this.indexArray),u=l.vertexLength,c=[],p=[];for(let d of s){if(d.length===0)continue;d!==s[0]&&p.push(c.length/2);let m=this.segments2.prepareSegment(d.length,this.layoutVertexArray,this.indexArray2),y=m.vertexLength;this.layoutVertexArray.emplaceBack(d[0].x,d[0].y),this.indexArray2.emplaceBack(y+d.length-1,y),c.push(d[0].x),c.push(d[0].y);for(let g=1;g<d.length;g++)this.layoutVertexArray.emplaceBack(d[g].x,d[g].y),this.indexArray2.emplaceBack(y+g-1,y+g),c.push(d[g].x),c.push(d[g].y);m.vertexLength+=d.length,m.primitiveLength+=d.length}let f=(0,xhe.default)(c,p);for(let d=0;d<f.length;d+=3)this.indexArray.emplaceBack(u+f[d],u+f[d+1],u+f[d+2]);l.vertexLength+=a,l.primitiveLength+=f.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,o,i)}};oe("FillBucket",FL,{omit:["layers","patternFeatures"]})});var _he=h(()=>{Fs()});var whe=h(()=>{Kc();bhe();Im();D2();_he()});var sje,She,Ihe,arr,lrr,Phe=h(()=>{Uu();sje=Hr([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),She=Hr([{name:"a_centroid",components:2,type:"Int16"}],4),{members:Ihe,size:arr,alignment:lrr}=sje});var yz=V((crr,Che)=>{"use strict";var aje=Br();Che.exports=bb;function bb(t,e,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=i,t.readFields(lje,this,e)}function lje(t,e,r){t==1?e.id=r.readVarint():t==2?uje(r,e):t==3?e.type=r.readVarint():t==4&&(e._geometry=r.pos)}function uje(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}bb.types=["Unknown","Point","LineString","Polygon"];bb.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,s=[],a;t.pos<e;){if(n<=0){var l=t.readVarint();r=l&7,n=l>>3}if(n--,r===1||r===2)i+=t.readSVarint(),o+=t.readSVarint(),r===1&&(a&&s.push(a),a=[]),a.push(new aje(i,o));else if(r===7)a&&a.push(a[0].clone());else throw new Error("unknown command "+r)}return a&&s.push(a),s};bb.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,s=1/0,a=-1/0,l=1/0,u=-1/0;t.pos<e;){if(n<=0){var c=t.readVarint();r=c&7,n=c>>3}if(n--,r===1||r===2)i+=t.readSVarint(),o+=t.readSVarint(),i<s&&(s=i),i>a&&(a=i),o<l&&(l=o),o>u&&(u=o);else if(r!==7)throw new Error("unknown command "+r)}return[s,l,a,u]};bb.prototype.toGeoJSON=function(t,e,r){var n=this.extent*Math.pow(2,r),i=this.extent*t,o=this.extent*e,s=this.loadGeometry(),a=bb.types[this.type],l,u;function c(d){for(var m=0;m<d.length;m++){var y=d[m],g=180-(y.y+o)*360/n;d[m]=[(y.x+i)*360/n-180,360/Math.PI*Math.atan(Math.exp(g*Math.PI/180))-90]}}switch(this.type){case 1:var p=[];for(l=0;l<s.length;l++)p[l]=s[l][0];s=p,c(s);break;case 2:for(l=0;l<s.length;l++)c(s[l]);break;case 3:for(s=cje(s),l=0;l<s.length;l++)for(u=0;u<s[l].length;u++)c(s[l][u]);break}s.length===1?s=s[0]:a="Multi"+a;var f={type:"Feature",geometry:{type:a,coordinates:s},properties:this.properties};return"id"in this&&(f.id=this.id),f};function cje(t){var e=t.length;if(e<=1)return[t];for(var r=[],n,i,o=0;o<e;o++){var s=pje(t[o]);s!==0&&(i===void 0&&(i=s<0),i===s<0?(n&&r.push(n),n=[t[o]]):n.push(t[o]))}return n&&r.push(n),r}function pje(t){for(var e=0,r=0,n=t.length,i=n-1,o,s;r<n;i=r++)o=t[r],s=t[i],e+=(s.x-o.x)*(o.y+s.y);return e}});var gz=V((prr,Ehe)=>{"use strict";var fje=yz();Ehe.exports=The;function The(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(hje,this,e),this.length=this._features.length}function hje(t,e,r){t===15?e.version=r.readVarint():t===1?e.name=r.readString():t===5?e.extent=r.readVarint():t===2?e._features.push(r.pos):t===3?e._keys.push(r.readString()):t===4&&e._values.push(dje(r))}function dje(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var n=t.readVarint()>>3;e=n===1?t.readString():n===2?t.readFloat():n===3?t.readDouble():n===4?t.readVarint64():n===5?t.readVarint():n===6?t.readSVarint():n===7?t.readBoolean():null}return e}The.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new fje(this._pbf,e,this.extent,this._keys,this._values)}});var Ahe=V((frr,Mhe)=>{"use strict";var mje=gz();Mhe.exports=yje;function yje(t,e){this.layers=t.readFields(gje,{},e)}function gje(t,e,r){if(t===3){var n=new mje(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}});var k2=V((hrr,RL)=>{RL.exports.VectorTile=Ahe();RL.exports.VectorTileFeature=yz();RL.exports.VectorTileLayer=gz()});function F2(t,e,r,n,i,o,s,a){t.emplaceBack(e,r,Math.floor(n*vz)*2+s,i*vz*2,o*vz*2,Math.round(a))}function bje(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}function _je(t){return t.every(e=>e.x<0)||t.every(e=>e.x>8192)||t.every(e=>e.y<0)||t.every(e=>e.y>8192)}var Lhe,Dhe,vje,xje,vz,NL,Ohe=h(()=>{Wa();Phe();Za();mb();yb();eo();Lhe=_e(IC(),1),Dhe=_e(k2(),1);OL();Qi();kL();wm();Sm();qa();vje=Dhe.default.VectorTileFeature.types,xje=500,vz=Math.pow(2,13);NL=class{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 _L,this.centroidVertexArray=new P2,this.indexArray=new ca,this.programConfigurations=new Xa(e.layers,e.zoom),this.segments=new mn,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,n){this.features=[],this.hasPattern=vb("fill-extrusion",this.layers,r);for(let{feature:i,id:o,index:s,sourceLayerIndex:a}of e){let l=this.layers[0]._featureFilter.needGeometry,u=Ka(i,l);if(!this.layers[0]._featureFilter.filter(new qr(this.zoom),u,n))continue;let c={id:o,sourceLayerIndex:a,index:s,geometry:l?u.geometry:Ya(i),properties:i.properties,type:i.type,patterns:{}};this.hasPattern?this.features.push(xb("fill-extrusion",this.layers,c,this.zoom,r)):this.addFeature(c,c.geometry,s,n,{}),r.featureIndex.insert(i,c.geometry,s,a,this.index,!0)}}addFeatures(e,r,n){for(let i of this.features){let{geometry:o}=i;this.addFeature(i,o,i.index,r,n)}}update(e,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,n)}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,Ihe),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,She.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,n,i,o){let s={x:0,y:0,vertexCount:0};for(let a of O2(r,xje)){let l=0;for(let m of a)l+=m.length;let u=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let m of a){if(m.length===0||_je(m))continue;let y=0;for(let g=0;g<m.length;g++){let b=m[g];if(g>=1){let w=m[g-1];if(!bje(b,w)){u.vertexLength+4>mn.MAX_VERTEX_ARRAY_LENGTH&&(u=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let S=b.sub(w)._perp()._unit(),I=w.dist(b);y+I>32768&&(y=0),F2(this.layoutVertexArray,b.x,b.y,S.x,S.y,0,0,y),F2(this.layoutVertexArray,b.x,b.y,S.x,S.y,0,1,y),s.x+=2*b.x,s.y+=2*b.y,s.vertexCount+=2,y+=I,F2(this.layoutVertexArray,w.x,w.y,S.x,S.y,0,0,y),F2(this.layoutVertexArray,w.x,w.y,S.x,S.y,0,1,y),s.x+=2*w.x,s.y+=2*w.y,s.vertexCount+=2;let P=u.vertexLength;this.indexArray.emplaceBack(P,P+2,P+1),this.indexArray.emplaceBack(P+1,P+2,P+3),u.vertexLength+=4,u.primitiveLength+=2}}}}if(u.vertexLength+l>mn.MAX_VERTEX_ARRAY_LENGTH&&(u=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),vje[e.type]!=="Polygon")continue;let c=[],p=[],f=u.vertexLength;for(let m of a)if(m.length!==0){m!==a[0]&&p.push(c.length/2);for(let y=0;y<m.length;y++){let g=m[y];F2(this.layoutVertexArray,g.x,g.y,0,0,1,1,0),s.x+=g.x,s.y+=g.y,s.vertexCount+=1,c.push(g.x),c.push(g.y)}}let d=(0,Lhe.default)(c,p);for(let m=0;m<d.length;m+=3)this.indexArray.emplaceBack(f+d[m],f+d[m+2],f+d[m+1]);u.primitiveLength+=d.length/3,u.vertexLength+=l}for(let a=0;a<s.vertexCount;a++)this.centroidVertexArray.emplaceBack(Math.floor(s.x/s.vertexCount),Math.floor(s.y/s.vertexCount));this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,o,i)}};oe("FillExtrusionBucket",NL,{omit:["layers","features"]})});var khe=h(()=>{Fs()});var Sje,Fhe=h(()=>{Kc();Ohe();Im();D2();khe();Sje=_e(Br(),1)});var Ije,Rhe,Grr,jrr,Nhe=h(()=>{Uu();Ije=Hr([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:Rhe,size:Grr,alignment:jrr}=Ije});var Pje,Bhe,Hrr,Wrr,zhe=h(()=>{Uu();Pje=Hr([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:Bhe,size:Hrr,alignment:Wrr}=Pje});var Ghe,Cje,Vhe,Tje,Eje,Mje,Aje,jhe,Uhe,BL,$he=h(()=>{Wa();Nhe();zhe();Za();mb();yb();eo();Ghe=_e(k2(),1);Qi();kL();wm();Sm();qa();Cje=Ghe.default.VectorTileFeature.types,Vhe=63,Tje=Math.cos(75/2*(Math.PI/180)),Eje=15,Mje=20,Aje=15,jhe=1/2,Uhe=Math.pow(2,Aje-1)/jhe,BL=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(r=>{this.gradients[r.id]={}}),this.layoutVertexArray=new wL,this.layoutVertexArray2=new SL,this.indexArray=new ca,this.programConfigurations=new Xa(e.layers,e.zoom),this.segments=new mn,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,n){this.hasPattern=vb("line",this.layers,r);let i=this.layers[0].layout.get("line-sort-key"),o=!i.isConstant(),s=[];for(let{feature:a,id:l,index:u,sourceLayerIndex:c}of e){let p=this.layers[0]._featureFilter.needGeometry,f=Ka(a,p);if(!this.layers[0]._featureFilter.filter(new qr(this.zoom),f,n))continue;let d=o?i.evaluate(f,{},n):void 0,m={id:l,properties:a.properties,type:a.type,sourceLayerIndex:c,index:u,geometry:p?f.geometry:Ya(a),patterns:{},sortKey:d};s.push(m)}o&&s.sort((a,l)=>a.sortKey-l.sortKey);for(let a of s){let{geometry:l,index:u,sourceLayerIndex:c}=a;if(this.hasPattern){let f=xb("line",this.layers,a,this.zoom,r);this.patternFeatures.push(f)}else this.addFeature(a,l,u,n,{});let p=e[u].feature;r.featureIndex.insert(p,l,u,c,this.index)}}update(e,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,n)}addFeatures(e,r,n){for(let i of this.patternFeatures)this.addFeature(i,i.geometry,i.index,r,n)}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,Bhe)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Rhe),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")){let r=+e.properties.mapbox_clip_start,n=+e.properties.mapbox_clip_end;return{start:r,end:n}}}addFeature(e,r,n,i,o){let s=this.layers[0].layout,a=s.get("line-join").evaluate(e,{}),l=s.get("line-cap"),u=s.get("line-miter-limit"),c=s.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(let p of r)this.addLine(p,e,a,l,u,c);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,o,i)}addLine(e,r,n,i,o,s){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let b=0;b<e.length-1;b++)this.totalDistance+=e[b].dist(e[b+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let a=Cje[r.type]==="Polygon",l=e.length;for(;l>=2&&e[l-1].equals(e[l-2]);)l--;let u=0;for(;u<l-1&&e[u].equals(e[u+1]);)u++;if(l<(a?3:2))return;n==="bevel"&&(o=1.05);let c=this.overscaling<=16?Eje*8192/(512*this.overscaling):0,p=this.segments.prepareSegment(l*10,this.layoutVertexArray,this.indexArray),f,d,m,y,g;this.e1=this.e2=-1,a&&(f=e[l-2],g=e[u].sub(f)._unit()._perp());for(let b=u;b<l;b++){if(m=b===l-1?a?e[u+1]:void 0:e[b+1],m&&e[b].equals(m))continue;g&&(y=g),f&&(d=f),f=e[b],g=m?m.sub(f)._unit()._perp():y,y=y||g;let w=y.add(g);(w.x!==0||w.y!==0)&&w._unit();let S=y.x*g.x+y.y*g.y,I=w.x*g.x+w.y*g.y,P=I!==0?1/I:1/0,T=2*Math.sqrt(2-2*I),M=I<Tje&&d&&m,E=y.x*g.y-y.y*g.x>0;if(M&&b>u){let $=f.dist(d);if($>2*c){let U=f.sub(f.sub(d)._mult(c/$)._round());this.updateDistance(d,U),this.addCurrentVertex(U,y,0,0,p),d=U}}let D=d&&m,B=D?n:a?"butt":i;if(D&&B==="round"&&(P<s?B="miter":P<=2&&(B="fakeround")),B==="miter"&&P>o&&(B="bevel"),B==="bevel"&&(P>2&&(B="flipbevel"),P<o&&(B="miter")),d&&this.updateDistance(d,f),B==="miter")w._mult(P),this.addCurrentVertex(f,w,0,0,p);else if(B==="flipbevel"){if(P>100)w=g.mult(-1);else{let $=P*y.add(g).mag()/y.sub(g).mag();w._perp()._mult($*(E?-1:1))}this.addCurrentVertex(f,w,0,0,p),this.addCurrentVertex(f,w.mult(-1),0,0,p)}else if(B==="bevel"||B==="fakeround"){let $=-Math.sqrt(P*P-1),U=E?$:0,Y=E?0:$;if(d&&this.addCurrentVertex(f,y,U,Y,p),B==="fakeround"){let G=Math.round(T*180/Math.PI/Mje);for(let ne=1;ne<G;ne++){let le=ne/G;if(le!==.5){let X=le-.5,ee=1.0904+S*(-3.2452+S*(3.55645-S*1.43519)),Ee=.848013+S*(-1.06021+S*.215638);le=le+le*X*(le-1)*(ee*X*X+Ee)}let se=g.sub(y)._mult(le)._add(y)._unit()._mult(E?-1:1);this.addHalfVertex(f,se.x,se.y,!1,E,0,p)}}m&&this.addCurrentVertex(f,g,-U,-Y,p)}else if(B==="butt")this.addCurrentVertex(f,w,0,0,p);else if(B==="square"){let $=d?1:-1;this.addCurrentVertex(f,w,$,$,p)}else B==="round"&&(d&&(this.addCurrentVertex(f,y,0,0,p),this.addCurrentVertex(f,y,1,1,p,!0)),m&&(this.addCurrentVertex(f,g,-1,-1,p,!0),this.addCurrentVertex(f,g,0,0,p)));if(M&&b<l-1){let $=f.dist(m);if($>2*c){let U=f.add(m.sub(f)._mult(c/$)._round());this.updateDistance(f,U),this.addCurrentVertex(U,g,0,0,p),f=U}}}}addCurrentVertex(e,r,n,i,o,s=!1){let a=r.x+r.y*n,l=r.y-r.x*n,u=-r.x+r.y*i,c=-r.y-r.x*i;this.addHalfVertex(e,a,l,s,!1,n,o),this.addHalfVertex(e,u,c,s,!0,-i,o),this.distance>Uhe/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,r,n,i,o,s))}addHalfVertex({x:e,y:r},n,i,o,s,a,l){let c=(this.lineClips?this.scaledDistance*(Uhe-1):this.scaledDistance)*jhe;if(this.layoutVertexArray.emplaceBack((e<<1)+(o?1:0),(r<<1)+(s?1:0),Math.round(Vhe*n)+128,Math.round(Vhe*i)+128,(a===0?0:a<0?-1:1)+1|(c&63)<<2,c>>6),this.lineClips){let f=this.scaledDistance-this.lineClips.start,d=this.lineClips.end-this.lineClips.start,m=f/d;this.layoutVertexArray2.emplaceBack(m,this.lineClipsArray.length)}let p=l.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,p),l.primitiveLength++),s?this.e2=p:this.e1=p}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()}};oe("LineBucket",BL,{omit:["layers","patternFeatures"]})});var qhe=h(()=>{Fs()});var Hhe=h(()=>{Kc();$he();Im();D2();qhe();Oe();qa();Fs()});var Whe,Zhe,Lnr,Xhe,Dnr,xz,Lje,Onr,knr,Fnr,Rnr,Nnr,Bnr,bz=h(()=>{Uu();Whe=Hr([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Zhe=Hr([{name:"a_projected_pos",components:3,type:"Float32"}],4),Lnr=Hr([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Xhe=Hr([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),Dnr=Hr([{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"}]),xz=Hr([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Lje=Hr([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),Onr=Hr([{name:"triangle",components:3,type:"Uint16"}]),knr=Hr([{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"}]),Fnr=Hr([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),Rnr=Hr([{type:"Float32",name:"offsetX"}]),Nnr=Hr([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Bnr=Hr([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}])});function Dje(t,e,r){let n=e.layout.get("text-transform").evaluate(r,{});return n==="uppercase"?t=t.toLocaleUpperCase():n==="lowercase"&&(t=t.toLocaleLowerCase()),Fh.applyArabicShaping&&(t=Fh.applyArabicShaping(t)),t}function Yhe(t,e,r){return t.sections.forEach(n=>{n.text=Dje(n.text,e,r)}),t}var Khe=h(()=>{KI()});function Jhe(t){let e={},r={},n=[],i=0;function o(u){n.push(t[u]),i++}function s(u,c,p){let f=r[u];return delete r[u],r[c]=f,n[f].geometry[0].pop(),n[f].geometry[0]=n[f].geometry[0].concat(p[0]),f}function a(u,c,p){let f=e[c];return delete e[c],e[u]=f,n[f].geometry[0].shift(),n[f].geometry[0]=p[0].concat(n[f].geometry[0]),f}function l(u,c,p){let f=p?c[0][c[0].length-1]:c[0][0];return`${u}:${f.x}:${f.y}`}for(let u=0;u<t.length;u++){let c=t[u],p=c.geometry,f=c.text?c.text.toString():null;if(!f){o(u);continue}let d=l(f,p),m=l(f,p,!0);if(d in r&&m in e&&r[d]!==e[m]){let y=a(d,m,p),g=s(d,m,n[y].geometry);delete e[d],delete r[m],r[l(f,n[g].geometry,!0)]=g,n[y].geometry=null}else d in r?s(d,m,p):m in e?a(d,m,p):(o(u),e[d]=i-1,r[m]=i-1)}return n.filter(u=>u.geometry)}var Qhe=h(()=>{});var ede,_z=h(()=>{pb();ede={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"}});var Jg=h(()=>{});var tde=V(wz=>{wz.read=function(t,e,r,n,i){var o,s,a=i*8-n-1,l=(1<<a)-1,u=l>>1,c=-7,p=r?i-1:0,f=r?-1:1,d=t[e+p];for(p+=f,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=o*256+t[e+p],p+=f,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=s*256+t[e+p],p+=f,c-=8);if(o===0)o=1-u;else{if(o===l)return s?NaN:(d?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-u}return(d?-1:1)*s*Math.pow(2,o-n)};wz.write=function(t,e,r,n,i,o){var s,a,l,u=o*8-i-1,c=(1<<u)-1,p=c>>1,f=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,m=n?1:-1,y=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+p>=1?e+=f/l:e+=f*Math.pow(2,1-p),e*l>=2&&(s++,l/=2),s+p>=c?(a=0,s=c):s+p>=1?(a=(e*l-1)*Math.pow(2,i),s=s+p):(a=e*Math.pow(2,p-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=a&255,d+=m,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;t[r+d]=s&255,d+=m,s/=256,u-=8);t[r+d-m]|=y*128}});var Iz=V((Znr,sde)=>{"use strict";sde.exports=rn;var zL=tde();function rn(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}rn.Varint=0;rn.Fixed64=1;rn.Bytes=2;rn.Fixed32=5;var Sz=65536*65536,rde=1/Sz,Oje=12,ode=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");rn.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=n&7,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=VL(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=ide(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=VL(this.buf,this.pos)+VL(this.buf,this.pos+4)*Sz;return this.pos+=8,t},readSFixed64:function(){var t=VL(this.buf,this.pos)+ide(this.buf,this.pos+4)*Sz;return this.pos+=8,t},readFloat:function(){var t=zL.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=zL.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e=this.buf,r,n;return n=e[this.pos++],r=n&127,n<128||(n=e[this.pos++],r|=(n&127)<<7,n<128)||(n=e[this.pos++],r|=(n&127)<<14,n<128)||(n=e[this.pos++],r|=(n&127)<<21,n<128)?r:(n=e[this.pos],r|=(n&15)<<28,kje(r,t,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2===1?(t+1)/-2:t/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=Oje&&ode?Zje(this.buf,e,t):Wje(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==rn.Bytes)return t.push(this.readVarint(e));var r=zh(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==rn.Bytes)return t.push(this.readSVarint());var e=zh(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==rn.Bytes)return t.push(this.readBoolean());var e=zh(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==rn.Bytes)return t.push(this.readFloat());var e=zh(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==rn.Bytes)return t.push(this.readDouble());var e=zh(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==rn.Bytes)return t.push(this.readFixed32());var e=zh(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==rn.Bytes)return t.push(this.readSFixed32());var e=zh(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==rn.Bytes)return t.push(this.readFixed64());var e=zh(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==rn.Bytes)return t.push(this.readSFixed64());var e=zh(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=t&7;if(e===rn.Varint)for(;this.buf[this.pos++]>127;);else if(e===rn.Bytes)this.pos=this.readVarint()+this.pos;else if(e===rn.Fixed32)this.pos+=4;else if(e===rn.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+e)},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),wb(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),wb(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),wb(this.buf,t&-1,this.pos),wb(this.buf,Math.floor(t*rde),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),wb(this.buf,t&-1,this.pos),wb(this.buf,Math.floor(t*rde),this.pos+4),this.pos+=8},writeVarint:function(t){if(t=+t||0,t>268435455||t<0){Fje(t,this);return}this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127)))},writeSVarint:function(t){this.writeVarint(t<0?-t*2-1:t*2)},writeBoolean:function(t){this.writeVarint(!!t)},writeString:function(t){t=String(t),this.realloc(t.length*4),this.pos++;var e=this.pos;this.pos=Xje(this.buf,t,this.pos);var r=this.pos-e;r>=128&&nde(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),zL.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),zL.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&nde(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,rn.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Bje,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,zje,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Gje,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Vje,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Uje,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,jje,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,$je,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,qje,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Hje,e)},writeBytesField:function(t,e){this.writeTag(t,rn.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,rn.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,rn.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,rn.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,rn.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,rn.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,rn.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,rn.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,rn.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,rn.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,!!e)}};function kje(t,e,r){var n=r.buf,i,o;if(o=n[r.pos++],i=(o&112)>>4,o<128||(o=n[r.pos++],i|=(o&127)<<3,o<128)||(o=n[r.pos++],i|=(o&127)<<10,o<128)||(o=n[r.pos++],i|=(o&127)<<17,o<128)||(o=n[r.pos++],i|=(o&127)<<24,o<128)||(o=n[r.pos++],i|=(o&1)<<31,o<128))return _b(t,i,e);throw new Error("Expected varint not more than 10 bytes")}function zh(t){return t.type===rn.Bytes?t.readVarint()+t.pos:t.pos+1}function _b(t,e,r){return r?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function Fje(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(r=~(-t%4294967296),n=~(-t/4294967296),r^4294967295?r=r+1|0:(r=0,n=n+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),Rje(r,n,e),Nje(n,e)}function Rje(t,e,r){r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos]=t&127}function Nje(t,e){var r=(t&7)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}function nde(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function Bje(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function zje(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function Vje(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function Uje(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function Gje(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function jje(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function $je(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function qje(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function Hje(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function VL(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+t[e+3]*16777216}function wb(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function ide(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function Wje(t,e,r){for(var n="",i=e;i<r;){var o=t[i],s=null,a=o>239?4:o>223?3:o>191?2:1;if(i+a>r)break;var l,u,c;a===1?o<128&&(s=o):a===2?(l=t[i+1],(l&192)===128&&(s=(o&31)<<6|l&63,s<=127&&(s=null))):a===3?(l=t[i+1],u=t[i+2],(l&192)===128&&(u&192)===128&&(s=(o&15)<<12|(l&63)<<6|u&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):a===4&&(l=t[i+1],u=t[i+2],c=t[i+3],(l&192)===128&&(u&192)===128&&(c&192)===128&&(s=(o&15)<<18|(l&63)<<12|(u&63)<<6|c&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,a=1):s>65535&&(s-=65536,n+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),n+=String.fromCharCode(s),i+=a}return n}function Zje(t,e,r){return ode.decode(t.subarray(e,r))}function Xje(t,e,r){for(var n=0,i,o;n<e.length;n++){if(i=e.charCodeAt(n),i>55295&&i<57344)if(o)if(i<56320){t[r++]=239,t[r++]=191,t[r++]=189,o=i;continue}else i=o-55296<<10|i-56320|65536,o=null;else{i>56319||n+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):o=i;continue}else o&&(t[r++]=239,t[r++]=191,t[r++]=189,o=null);i<128?t[r++]=i:(i<2048?t[r++]=i>>6|192:(i<65536?t[r++]=i>>12|224:(t[r++]=i>>18|240,t[r++]=i>>12&63|128),t[r++]=i>>6&63|128),t[r++]=i&63|128)}return r}});function Yje(t,e,r){t===1&&r.readMessage(Kje,e)}function Kje(t,e,r){if(t===3){let{id:n,bitmap:i,width:o,height:s,left:a,top:l,advance:u}=r.readMessage(Jje,{});e.push({id:n,bitmap:new Kg({width:o+2*ade,height:s+2*ade},i),metrics:{width:o,height:s,left:a,top:l,advance:u}})}}function Jje(t,e,r){t===1?e.id=r.readVarint():t===2?e.bitmap=r.readBytes():t===3?e.width=r.readVarint():t===4?e.height=r.readVarint():t===5?e.left=r.readSVarint():t===6?e.top=r.readSVarint():t===7&&(e.advance=r.readVarint())}function ude(t){return new lde.default(t).readFields(Yje,[])}var lde,ade,UL=h(()=>{gf();lde=_e(Iz(),1),ade=3});function GL(t){let e=0,r=0;for(let a of t)e+=a.w*a.h,r=Math.max(r,a.w);t.sort((a,l)=>l.h-a.h);let i=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],o=0,s=0;for(let a of t)for(let l=i.length-1;l>=0;l--){let u=i[l];if(!(a.w>u.w||a.h>u.h)){if(a.x=u.x,a.y=u.y,s=Math.max(s,a.y+a.h),o=Math.max(o,a.x+a.w),a.w===u.w&&a.h===u.h){let c=i.pop();l<i.length&&(i[l]=c)}else a.h===u.h?(u.x+=a.w,u.w-=a.w):a.w===u.w?(u.y+=a.h,u.h-=a.h):(i.push({x:u.x+a.w,y:u.y,w:u.w-a.w,h:a.h}),u.y+=a.h,u.h-=a.h);break}}return{w:o,h:s,fill:e/(o*s)||0}}var Pz=h(()=>{});var Ja,R2,Cz,jL=h(()=>{gf();Qi();Pz();Ja=1,R2=class{constructor(e,{pixelRatio:r,version:n,stretchX:i,stretchY:o,content:s}){this.paddedRect=e,this.pixelRatio=r,this.stretchX=i,this.stretchY=o,this.content=s,this.version=n}get tl(){return[this.paddedRect.x+Ja,this.paddedRect.y+Ja]}get br(){return[this.paddedRect.x+this.paddedRect.w-Ja,this.paddedRect.y+this.paddedRect.h-Ja]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-Ja*2)/this.pixelRatio,(this.paddedRect.h-Ja*2)/this.pixelRatio]}},Cz=class{constructor(e,r){let n={},i={};this.haveRenderCallbacks=[];let o=[];this.addImages(e,n,o),this.addImages(r,i,o);let{w:s,h:a}=GL(o),l=new bo({width:s||1,height:a||1});for(let u in e){let c=e[u],p=n[u].paddedRect;bo.copy(c.data,l,{x:0,y:0},{x:p.x+Ja,y:p.y+Ja},c.data)}for(let u in r){let c=r[u],p=i[u].paddedRect,f=p.x+Ja,d=p.y+Ja,m=c.data.width,y=c.data.height;bo.copy(c.data,l,{x:0,y:0},{x:f,y:d},c.data),bo.copy(c.data,l,{x:0,y:y-1},{x:f,y:d-1},{width:m,height:1}),bo.copy(c.data,l,{x:0,y:0},{x:f,y:d+y},{width:m,height:1}),bo.copy(c.data,l,{x:m-1,y:0},{x:f-1,y:d},{width:1,height:y}),bo.copy(c.data,l,{x:0,y:0},{x:f+m,y:d},{width:1,height:y})}this.image=l,this.iconPositions=n,this.patternPositions=i}addImages(e,r,n){for(let i in e){let o=e[i],s={x:0,y:0,w:o.data.width+2*Ja,h:o.data.height+2*Ja};n.push(s),r[i]=new R2(s,o),o.hasRenderCallback&&this.haveRenderCallbacks.push(i)}}patchUpdatedImages(e,r){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let n in e.updatedImages)this.patchUpdatedImage(this.iconPositions[n],e.getImage(n),r),this.patchUpdatedImage(this.patternPositions[n],e.getImage(n),r)}patchUpdatedImage(e,r,n){if(!e||!r||e.version===r.version)return;e.version=r.version;let[i,o]=e.tl;n.update(r.data,void 0,{x:i,y:o})}};oe("ImagePosition",R2);oe("ImageAtlas",Cz)});var Qg,ev=h(()=>{pb();_z();KI();Jg();Oe();UL();jL();Qg=(i=>(i[i.none=0]="none",i[i.horizontal=1]="horizontal",i[i.vertical=2]="vertical",i[i.horizontalOnly=3]="horizontalOnly",i))(Qg||{})});function Tz(t,e){let{expression:r}=e;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new qr(t+1))};if(r.kind==="source")return{kind:"source"};{let{zoomStops:n,interpolationType:i}=r,o=0;for(;o<n.length&&n[o]<=t;)o++;o=Math.max(0,o-1);let s=o;for(;s<n.length&&n[s]<t+1;)s++;s=Math.min(n.length-1,s);let a=n[o],l=n[s];if(r.kind==="composite")return{kind:"composite",minZoom:a,maxZoom:l,interpolationType:i};let u=r.evaluate(new qr(a)),c=r.evaluate(new qr(l));return{kind:"camera",minZoom:a,maxZoom:l,minSize:u,maxSize:c,interpolationType:i}}}var cde,pde,$L,Sb=h(()=>{Oe();qa();cde=255,pde=128,$L=cde*pde});function qL(t,e,r){let n="never",i=t.get(e);return i?n=i:t.get(r)&&(n="always"),n}var Ez=h(()=>{});function HL(t,e,r,n,i,o,s,a,l,u,c,p,f){let d=a?Math.min($L,Math.round(a[0])):0,m=a?Math.min($L,Math.round(a[1])):0;t.emplaceBack(e,r,Math.round(n*32),Math.round(i*32),o,s,(d<<1)+(l?1:0),m,u*16,c*16,p*256,f*256)}function WL(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r)}function r$e(t){for(let e of t.sections)if(Rfe(e.text))return!0;return!1}var B2,hde,e$e,t$e,z2,V2,vf,Ib=h(()=>{bz();Wa();B2=_e(Br(),1);Za();mb();yb();Khe();Qhe();pb();ev();wm();Sm();hde=_e(k2(),1);_z();Sb();Qi();qa();ua();KI();cz();Ez();e$e=hde.default.VectorTileFeature.types,t$e=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];z2=class{constructor(e){this.layoutVertexArray=new IL,this.indexArray=new ca,this.programConfigurations=e,this.segments=new mn,this.dynamicLayoutVertexArray=new PL,this.opacityVertexArray=new CL,this.hasVisibleVertices=!1,this.placedSymbolArray=new x2}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,r,n,i){this.isEmpty()||(n&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Whe.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,r),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Zhe.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,t$e,!0),this.opacityVertexBuffer.itemSize=1),(n||i)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}};oe("SymbolBuffers",z2);V2=class{constructor(e,r,n){this.layoutVertexArray=new e,this.layoutAttributes=r,this.indexArray=new n,this.segments=new mn,this.collisionVertexArray=new TL}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,Xhe.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}};oe("CollisionBuffers",V2);vf=class{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(l=>l.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=Yg.identity([]),this.placementViewportMatrix=Yg.identity([]);let n=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Tz(this.zoom,n["text-size"]),this.iconSizeData=Tz(this.zoom,n["icon-size"]);let i=this.layers[0].layout,o=i.get("symbol-sort-key"),s=i.get("symbol-z-order");this.canOverlap=qL(i,"text-overlap","text-allow-overlap")!=="never"||qL(i,"icon-overlap","icon-allow-overlap")!=="never"||i.get("text-ignore-placement")||i.get("icon-ignore-placement"),this.sortFeaturesByKey=s!=="viewport-y"&&!o.isConstant();let a=s==="viewport-y"||s==="auto"&&!this.sortFeaturesByKey;this.sortFeaturesByY=a&&this.canOverlap,i.get("symbol-placement")==="point"&&(this.writingModes=i.get("text-writing-mode").map(l=>Qg[l])),this.stateDependentLayerIds=this.layers.filter(l=>l.isStateDependent()).map(l=>l.id),this.sourceID=e.sourceID}createArrays(){this.text=new z2(new Xa(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new z2(new Xa(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new _2,this.lineVertexArray=new w2,this.symbolInstances=new b2,this.textAnchorOffsets=new S2}calculateGlyphDependencies(e,r,n,i,o){for(let s=0;s<e.length;s++)if(r[e.charCodeAt(s)]=!0,(n||i)&&o){let a=ede[e.charAt(s)];a&&(r[a.charCodeAt(0)]=!0)}}populate(e,r,n){let i=this.layers[0],o=i.layout,s=o.get("text-font"),a=o.get("text-field"),l=o.get("icon-image"),u=(a.value.kind!=="constant"||a.value.value instanceof Xc&&!a.value.value.isEmpty()||a.value.value.toString().length>0)&&(s.value.kind!=="constant"||s.value.value.length>0),c=l.value.kind!=="constant"||!!l.value.value||Object.keys(l.parameters).length>0,p=o.get("symbol-sort-key");if(this.features=[],!u&&!c)return;let f=r.iconDependencies,d=r.glyphDependencies,m=r.availableImages,y=new qr(this.zoom);for(let{feature:g,id:b,index:w,sourceLayerIndex:S}of e){let I=i._featureFilter.needGeometry,P=Ka(g,I);if(!i._featureFilter.filter(y,P,n))continue;I||(P.geometry=Ya(g));let T;if(u){let B=i.getValueAndResolveTokens("text-field",P,n,m),$=Xc.factory(B),U=this.hasRTLText=this.hasRTLText||r$e($);(!U||Fh.getRTLTextPluginStatus()==="unavailable"||U&&Fh.isParsed())&&(T=Yhe($,i,P))}let M;if(c){let B=i.getValueAndResolveTokens("icon-image",P,n,m);B instanceof $a?M=B:M=$a.fromString(B)}if(!T&&!M)continue;let E=this.sortFeaturesByKey?p.evaluate(P,{},n):void 0,D={id:b,text:T,icon:M,index:w,sourceLayerIndex:S,geometry:P.geometry,properties:g.properties,type:e$e[g.type],sortKey:E};if(this.features.push(D),M&&(f[M.name]=!0),T){let B=s.evaluate(P,{},n).join(","),$=o.get("text-rotation-alignment")!=="viewport"&&o.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(2)>=0;for(let U of T.sections)if(U.image)f[U.image.name]=!0;else{let Y=ez(T.toString()),G=U.fontStack||B,ne=d[G]=d[G]||{};this.calculateGlyphDependencies(U.text,ne,$,this.allowVerticalPlacement,Y)}}}o.get("symbol-placement")==="line"&&(this.features=Jhe(this.features)),this.sortFeaturesByKey&&this.features.sort((g,b)=>g.sortKey-b.sortKey)}update(e,r,n){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,r,this.layers,n),this.icon.programConfigurations.updatePaintArrays(e,r,this.layers,n))}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){let n=this.lineVertexArray.length;if(e.segment!==void 0){let i=e.dist(r[e.segment+1]),o=e.dist(r[e.segment]),s={};for(let a=e.segment+1;a<r.length;a++)s[a]={x:r[a].x,y:r[a].y,tileUnitDistanceFromAnchor:i},a<r.length-1&&(i+=r[a+1].dist(r[a]));for(let a=e.segment||0;a>=0;a--)s[a]={x:r[a].x,y:r[a].y,tileUnitDistanceFromAnchor:o},a>0&&(o+=r[a-1].dist(r[a]));for(let a=0;a<r.length;a++){let l=s[a];this.lineVertexArray.emplaceBack(l.x,l.y,l.tileUnitDistanceFromAnchor)}}return{lineStartIndex:n,lineLength:this.lineVertexArray.length-n}}addSymbols(e,r,n,i,o,s,a,l,u,c,p,f){let d=e.indexArray,m=e.layoutVertexArray,y=e.segments.prepareSegment(4*r.length,m,d,this.canOverlap?s.sortKey:void 0),g=this.glyphOffsetArray.length,b=y.vertexLength,w=this.allowVerticalPlacement&&a===2?Math.PI/2:0,S=s.text&&s.text.sections;for(let I=0;I<r.length;I++){let{tl:P,tr:T,bl:M,br:E,tex:D,pixelOffsetTL:B,pixelOffsetBR:$,minFontScaleX:U,minFontScaleY:Y,glyphOffset:G,isSDF:ne,sectionIndex:le}=r[I],se=y.vertexLength,X=G[1];HL(m,l.x,l.y,P.x,X+P.y,D.x,D.y,n,ne,B.x,B.y,U,Y),HL(m,l.x,l.y,T.x,X+T.y,D.x+D.w,D.y,n,ne,$.x,B.y,U,Y),HL(m,l.x,l.y,M.x,X+M.y,D.x,D.y+D.h,n,ne,B.x,$.y,U,Y),HL(m,l.x,l.y,E.x,X+E.y,D.x+D.w,D.y+D.h,n,ne,$.x,$.y,U,Y),WL(e.dynamicLayoutVertexArray,l,w),d.emplaceBack(se,se+1,se+2),d.emplaceBack(se+1,se+2,se+3),y.vertexLength+=4,y.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(G[0]),(I===r.length-1||le!==r[I+1].sectionIndex)&&e.programConfigurations.populatePaintArrays(m.length,s,s.index,{},f,S&&S[le])}e.placedSymbolArray.emplaceBack(l.x,l.y,g,this.glyphOffsetArray.length-g,b,u,c,l.segment,n?n[0]:0,n?n[1]:0,i[0],i[1],a,0,!1,0,p)}_addCollisionDebugVertex(e,r,n,i,o,s){return r.emplaceBack(0,0),e.emplaceBack(n.x,n.y,i,o,Math.round(s.x),Math.round(s.y))}addCollisionDebugVertices(e,r,n,i,o,s,a){let l=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),u=l.vertexLength,c=o.layoutVertexArray,p=o.collisionVertexArray,f=a.anchorX,d=a.anchorY;this._addCollisionDebugVertex(c,p,s,f,d,new B2.default(e,r)),this._addCollisionDebugVertex(c,p,s,f,d,new B2.default(n,r)),this._addCollisionDebugVertex(c,p,s,f,d,new B2.default(n,i)),this._addCollisionDebugVertex(c,p,s,f,d,new B2.default(e,i)),l.vertexLength+=4;let m=o.indexArray;m.emplaceBack(u,u+1),m.emplaceBack(u+1,u+2),m.emplaceBack(u+2,u+3),m.emplaceBack(u+3,u),l.primitiveLength+=4}addDebugCollisionBoxes(e,r,n,i){for(let o=e;o<r;o++){let s=this.collisionBoxArray.get(o),a=s.x1,l=s.y1,u=s.x2,c=s.y2;this.addCollisionDebugVertices(a,l,u,c,i?this.textCollisionBox:this.iconCollisionBox,s.anchorPoint,n)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new V2(T2,xz.members,bm),this.iconCollisionBox=new V2(T2,xz.members,bm);for(let e=0;e<this.symbolInstances.length;e++){let r=this.symbolInstances.get(e);this.addDebugCollisionBoxes(r.textBoxStartIndex,r.textBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.iconBoxStartIndex,r.iconBoxEndIndex,r,!1),this.addDebugCollisionBoxes(r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex,r,!1)}}_deserializeCollisionBoxesForSymbol(e,r,n,i,o,s,a,l,u){let c={};for(let p=r;p<n;p++){let f=e.get(p);c.textBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},c.textFeatureIndex=f.featureIndex;break}for(let p=i;p<o;p++){let f=e.get(p);c.verticalTextBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},c.verticalTextFeatureIndex=f.featureIndex;break}for(let p=s;p<a;p++){let f=e.get(p);c.iconBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},c.iconFeatureIndex=f.featureIndex;break}for(let p=l;p<u;p++){let f=e.get(p);c.verticalIconBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},c.verticalIconFeatureIndex=f.featureIndex;break}return c}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let r=0;r<this.symbolInstances.length;r++){let n=this.symbolInstances.get(r);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,n.textBoxStartIndex,n.textBoxEndIndex,n.verticalTextBoxStartIndex,n.verticalTextBoxEndIndex,n.iconBoxStartIndex,n.iconBoxEndIndex,n.verticalIconBoxStartIndex,n.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,r){let n=e.placedSymbolArray.get(r),i=n.vertexStartIndex+n.numGlyphs*4;for(let o=n.vertexStartIndex;o<i;o+=4)e.indexArray.emplaceBack(o,o+1,o+2),e.indexArray.emplaceBack(o+1,o+2,o+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let r=Math.sin(e),n=Math.cos(e),i=[],o=[],s=[];for(let a=0;a<this.symbolInstances.length;++a){s.push(a);let l=this.symbolInstances.get(a);i.push(Math.round(r*l.anchorX+n*l.anchorY)|0),o.push(l.featureIndex)}return s.sort((a,l)=>i[a]-i[l]||o[l]-o[a]),s}addToSortKeyRanges(e,r){let n=this.sortKeyRanges[this.sortKeyRanges.length-1];n&&n.sortKey===r?n.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(let r of this.symbolInstanceIndexes){let n=this.symbolInstances.get(r);this.featureSortOrder.push(n.featureIndex),[n.rightJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.leftJustifiedTextSymbolIndex].forEach((i,o,s)=>{i>=0&&s.indexOf(i)===o&&this.addIndicesForPlacedSymbol(this.text,i)}),n.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,n.verticalPlacedTextSymbolIndex),n.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,n.placedIconSymbolIndex),n.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,n.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}};oe("SymbolBucket",vf,{omit:["layers","collisionBoxArray","features","compareText"]});vf.MAX_GLYPHS=65535;vf.addDynamicAttributes=WL});var dde=h(()=>{});var mde=h(()=>{Fs()});var ZL,yde=h(()=>{ua();Qi();ZL=class{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:sb,this.defaultValue=e}evaluate(e){if(e.formattedSection){let 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){if(!this.defaultValue.isConstant()){let r=this.defaultValue.value;e(r._styleExpression.expression)}}outputDefined(){return!1}serialize(){return null}};oe("FormatSectionOverride",ZL,{omit:["defaultValue"]})});var Mz=h(()=>{Kc();Ib();dde();mde();Fs();yde()});var gde=h(()=>{Fs()});var vde=h(()=>{Kc();gde()});var xde=h(()=>{Fs()});var bde=h(()=>{Kc();xde()});var Az=h(()=>{Kc()});var _de=h(()=>{che();dhe();yhe();whe();Fhe();Hhe();Mz();vde();bde();Az()});var Lz=h(()=>{});var wde=h(()=>{qc();X1();Nu();vo();Lz()});var to,Al=h(()=>{Oe();to=class{constructor(e,r,n,i){this.context=e,this.format=n,this.texture=e.gl.createTexture(),this.update(r,i)}update(e,r,n){let{width:i,height:o}=e,s=(!this.size||this.size[0]!==i||this.size[1]!==o)&&!n,{context:a}=this,{gl:l}=a;if(this.useMipmap=!!(r&&r.useMipmap),l.bindTexture(l.TEXTURE_2D,this.texture),a.pixelStoreUnpackFlipY.set(!1),a.pixelStoreUnpack.set(1),a.pixelStoreUnpackPremultiplyAlpha.set(this.format===l.RGBA&&(!r||r.premultiply!==!1)),s)this.size=[i,o],e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||$c(e)?l.texImage2D(l.TEXTURE_2D,0,this.format,this.format,l.UNSIGNED_BYTE,e):l.texImage2D(l.TEXTURE_2D,0,this.format,i,o,0,this.format,l.UNSIGNED_BYTE,e.data);else{let{x:u,y:c}=n||{x:0,y:0};e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||$c(e)?l.texSubImage2D(l.TEXTURE_2D,0,u,c,l.RGBA,l.UNSIGNED_BYTE,e):l.texSubImage2D(l.TEXTURE_2D,0,u,c,i,o,l.RGBA,l.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&l.generateMipmap(l.TEXTURE_2D)}bind(e,r,n){let{context:i}=this,{gl:o}=i;o.bindTexture(o.TEXTURE_2D,this.texture),n===o.LINEAR_MIPMAP_NEAREST&&!this.isSizePowerOfTwo()&&(n=o.LINEAR),e!==this.filter&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,e),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,n||e),this.filter=e),r!==this.wrap&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,r),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,r),this.wrap=r)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1===0}destroy(){let{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}});var Sde=h(()=>{});var Ide=h(()=>{Pz();Qn();gf();jL();Al();Sde();Oe()});async function Pde(t,e,r,n){let i=e*256,o=i+255,s=n.transformRequest(r.replace("{fontstack}",t).replace("{range}",`${i}-${o}`),"Glyphs"),a=await Cpe(s,new AbortController);if(!a||!a.data)throw new Error(`Could not load glyph range. range: ${e}, ${i}-${o}`);let l={};for(let u of ude(a.data))l[u.id]=u;return l}var Cde=h(()=>{qc();Nu();UL()});function Tde(t,e,r,n,i,o,s,a,l){for(let u=e;u<e+n;u++)Ede(t,r*o+u,o,i,s,a,l);for(let u=r;u<r+i;u++)Ede(t,u*o+e,1,n,s,a,l)}function Ede(t,e,r,n,i,o,s){o[0]=0,s[0]=-1e20,s[1]=1e20,i[0]=t[e];for(let a=1,l=0,u=0;a<n;a++){i[a]=t[e+a*r];let c=a*a;do{let p=o[l];u=(i[a]-i[p]+c-p*p)/(a-p)/2}while(u<=s[l]&&--l>-1);l++,o[l]=a,s[l]=u,s[l+1]=1e20}for(let a=0,l=0;a<n;a++){for(;s[l+1]<a;)l++;let u=o[l],c=a-u;t[e+a*r]=i[u]+c*c}}var U2,Mde=h(()=>{U2=class{constructor({fontSize:e=24,buffer:r=3,radius:n=8,cutoff:i=.25,fontFamily:o="sans-serif",fontWeight:s="normal",fontStyle:a="normal"}={}){this.buffer=r,this.cutoff=i,this.radius=n;let l=this.size=e+r*4,u=this._createCanvas(l),c=this.ctx=u.getContext("2d",{willReadFrequently:!0});c.font=`${a} ${s} ${e}px ${o}`,c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",this.gridOuter=new Float64Array(l*l),this.gridInner=new Float64Array(l*l),this.f=new Float64Array(l),this.z=new Float64Array(l+1),this.v=new Uint16Array(l)}_createCanvas(e){let r=document.createElement("canvas");return r.width=r.height=e,r}draw(e){let{width:r,actualBoundingBoxAscent:n,actualBoundingBoxDescent:i,actualBoundingBoxLeft:o,actualBoundingBoxRight:s}=this.ctx.measureText(e),a=Math.ceil(n),l=0,u=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(s-o))),c=Math.min(this.size-this.buffer,a+Math.ceil(i)),p=u+2*this.buffer,f=c+2*this.buffer,d=Math.max(p*f,0),m=new Uint8ClampedArray(d),y={data:m,width:p,height:f,glyphWidth:u,glyphHeight:c,glyphTop:a,glyphLeft:l,glyphAdvance:r};if(u===0||c===0)return y;let{ctx:g,buffer:b,gridInner:w,gridOuter:S}=this;g.clearRect(b,b,u,c),g.fillText(e,b,b+a);let I=g.getImageData(b,b,u,c);S.fill(1e20,0,d),w.fill(0,0,d);for(let P=0;P<c;P++)for(let T=0;T<u;T++){let M=I.data[4*(P*u+T)+3]/255;if(M===0)continue;let E=(P+b)*p+T+b;if(M===1)S[E]=0,w[E]=1e20;else{let D=.5-M;S[E]=D>0?D*D:0,w[E]=D<0?D*D:0}}Tde(S,0,0,p,f,p,this.f,this.v,this.z),Tde(w,b,b,u,c,p,this.f,this.v,this.z);for(let P=0;P<d;P++){let T=Math.sqrt(S[P])-Math.sqrt(w[P]);m[P]=Math.round(255-255*(T/this.radius+this.cutoff))}return y}}});var Pb,Dz,Ade=h(()=>{Cde();Mde();Q9();gf();Pb=class Pb{constructor(e,r){this.requestManager=e,this.localIdeographFontFamily=r,this.entries={}}setURL(e){this.url=e}async getGlyphs(e){let r=[];for(let o in e)for(let s of e[o])r.push(this._getAndCacheGlyphsPromise(o,s));let n=await Promise.all(r),i={};for(let{stack:o,id:s,glyph:a}of n)i[o]||(i[o]={}),i[o][s]=a&&{id:a.id,bitmap:a.bitmap.clone(),metrics:a.metrics};return i}async _getAndCacheGlyphsPromise(e,r){let n=this.entries[e];n||(n=this.entries[e]={glyphs:{},requests:{},ranges:{}});let i=n.glyphs[r];if(i!==void 0)return{stack:e,id:r,glyph:i};if(i=this._tinySDF(n,e,r),i)return n.glyphs[r]=i,{stack:e,id:r,glyph:i};let o=Math.floor(r/256);if(o*256>65535)throw new Error("glyphs > 65535 not supported");if(n.ranges[o])return{stack:e,id:r,glyph:i};if(!this.url)throw new Error("glyphsUrl is not set");if(!n.requests[o]){let a=Pb.loadGlyphRange(e,o,this.url,this.requestManager);n.requests[o]=a}let s=await n.requests[o];for(let a in s)this._doesCharSupportLocalGlyph(+a)||(n.glyphs[+a]=s[+a]);return n.ranges[o]=!0,{stack:e,id:r,glyph:s[r]||null}}_doesCharSupportLocalGlyph(e){return!!this.localIdeographFontFamily&&(St["CJK Unified Ideographs"](e)||St["Hangul Syllables"](e)||St.Hiragana(e)||St.Katakana(e))}_tinySDF(e,r,n){let i=this.localIdeographFontFamily;if(!i||!this._doesCharSupportLocalGlyph(n))return;let o=2,s=e.tinySDF;if(!s){let c="400";/bold/i.test(r)?c="900":/medium/i.test(r)?c="500":/light/i.test(r)&&(c="200"),s=e.tinySDF=new Pb.TinySDF({fontSize:24*o,buffer:3*o,radius:8*o,cutoff:.25,fontFamily:i,fontWeight:c})}let a=s.draw(String.fromCharCode(n));return{id:n,bitmap:new Kg({width:a.width||30*o,height:a.height||30*o},a.data),metrics:{width:a.glyphWidth/o||24,height:a.glyphHeight/o||24,left:a.glyphLeft/o+.5||0,top:a.glyphTop/o-27.5||-8,advance:a.glyphAdvance/o||24,isDoubleResolution:!0}}}};Pb.loadGlyphRange=Pde,Pb.TinySDF=U2;Dz=Pb});var Lde=h(()=>{Oe();Qn();pL();Fs()});var Dde=h(()=>{Oe()});var XL,Ode=h(()=>{XL=class{constructor(e){this._methodToThrottle=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}});var YL,kde=h(()=>{Oe();Qi();Ode();YL=class{constructor(e,r){this.target=e,this.mapId=r,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new XL(()=>this.process()),this.subscription=Ipe(this.target,"message",n=>this.receive(n),!1),this.globalScope=Lh(self)?e:window}registerMessageHandler(e,r){this.messageHandlers[e]=r}sendAsync(e,r){return new Promise((n,i)=>{let o=Math.round(Math.random()*1e18).toString(36).substring(0,10);this.resolveRejects[o]={resolve:n,reject:i},r&&r.signal.addEventListener("abort",()=>{delete this.resolveRejects[o];let l={id:o,type:"<cancel>",origin:location.origin,targetMapId:e.targetMapId,sourceMapId:this.mapId};this.target.postMessage(l)},{once:!0});let s=[],a={...e,id:o,sourceMapId:this.mapId,origin:location.origin,data:ub(e.data,s)};this.target.postMessage(a,{transfer:s})})}receive(e){let r=e.data,n=r.id;if(!(r.origin!=="file://"&&location.origin!=="file://"&&r.origin!==location.origin)&&!(r.targetMapId&&this.mapId!==r.targetMapId)){if(r.type==="<cancel>"){delete this.tasks[n];let i=this.abortControllers[n];delete this.abortControllers[n],i&&i.abort();return}if(Lh(self)||r.mustQueue){this.tasks[n]=r,this.taskQueue.push(n),this.invoker.trigger();return}this.processTask(n,r)}}process(){if(this.taskQueue.length===0)return;let e=this.taskQueue.shift(),r=this.tasks[e];delete this.tasks[e],this.taskQueue.length>0&&this.invoker.trigger(),r&&this.processTask(e,r)}async processTask(e,r){if(r.type==="<response>"){let o=this.resolveRejects[e];if(delete this.resolveRejects[e],!o)return;r.error?o.reject(cb(r.error)):o.resolve(cb(r.data));return}if(!this.messageHandlers[r.type]){this.completeTask(e,new Error(`Could not find a registered handler for ${r.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));return}let n=cb(r.data),i=new AbortController;this.abortControllers[e]=i;try{let o=await this.messageHandlers[r.type](r.sourceMapId,n,i);this.completeTask(e,null,o)}catch(o){this.completeTask(e,o)}}completeTask(e,r,n){let i=[];delete this.abortControllers[e];let o={id:e,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:r?ub(r):null,data:ub(n,i)};this.target.postMessage(o,{transfer:i})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}}});var Fde,Rde=h(()=>{Fde='(()=>{var vy=Object.create;var Ba=Object.defineProperty;var Py=Object.getOwnPropertyDescriptor;var Sy=Object.getOwnPropertyNames;var wy=Object.getPrototypeOf,Ay=Object.prototype.hasOwnProperty;var Ae=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Dl=(t,e)=>{for(var r in e)Ba(t,r,{get:e[r],enumerable:!0})},_y=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Sy(e))!Ay.call(t,i)&&i!==r&&Ba(t,i,{get:()=>e[i],enumerable:!(n=Py(e,i))||n.enumerable});return t};var Z=(t,e,r)=>(r=t!=null?vy(wy(t)):{},_y(e||!t||!t.__esModule?Ba(r,"default",{value:t,enumerable:!0}):r,t));var he=Ae((u0,Vl)=>{"use strict";Vl.exports=ar;function ar(t,e){this.x=t,this.y=e}ar.prototype={clone:function(){return new ar(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},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(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.x+r*(this.x-e.x)-n*(this.y-e.y),o=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=i,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}};ar.convert=function(t){return t instanceof ar?t:Array.isArray(t)?new ar(t[0],t[1]):t}});var Rl=Ae((c0,zl)=>{"use strict";zl.exports=Bl;function Bl(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=r,this.p2y=n}Bl.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(e===void 0&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var r=t,n=0;n<8;n++){var i=this.sampleCurveX(r)-t;if(Math.abs(i)<e)return r;var o=this.sampleCurveDerivativeX(r);if(Math.abs(o)<1e-6)break;r=r-i/o}var a=0,s=1;for(r=t,n=0;n<20&&(i=this.sampleCurveX(r),!(Math.abs(i-t)<e));n++)t>i?a=r:s=r,r=(s-a)*.5+a;return r},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}}});var _c=Ae((Gv,_s)=>{function ld(t,e){var r,n,i,o,a,s,l,u,c,p;for(r=t.length&3,n=t.length-r,i=e,a=3432918353,l=461845907,p=0;p<n;)c=t.charCodeAt(p)&255|(t.charCodeAt(++p)&255)<<8|(t.charCodeAt(++p)&255)<<16|(t.charCodeAt(++p)&255)<<24,++p,c=(c&65535)*a+(((c>>>16)*a&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(c&65535)*l+(((c>>>16)*l&65535)<<16)&4294967295,i^=c,i=i<<13|i>>>19,o=(i&65535)*5+(((i>>>16)*5&65535)<<16)&4294967295,i=(o&65535)+27492+(((o>>>16)+58964&65535)<<16);switch(c=0,r){case 3:c^=(t.charCodeAt(p+2)&255)<<16;case 2:c^=(t.charCodeAt(p+1)&255)<<8;case 1:c^=t.charCodeAt(p)&255,c=(c&65535)*a+(((c>>>16)*a&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(c&65535)*l+(((c>>>16)*l&65535)<<16)&4294967295,i^=c}return i^=t.length,i^=i>>>16,i=(i&65535)*2246822507+(((i>>>16)*2246822507&65535)<<16)&4294967295,i^=i>>>13,i=(i&65535)*3266489909+(((i>>>16)*3266489909&65535)<<16)&4294967295,i^=i>>>16,i>>>0}typeof _s<"u"&&(_s.exports=ld)});var Ic=Ae((qv,Is)=>{function ud(t,e){for(var r=t.length,n=e^r,i=0,o;r>=4;)o=t.charCodeAt(i)&255|(t.charCodeAt(++i)&255)<<8|(t.charCodeAt(++i)&255)<<16|(t.charCodeAt(++i)&255)<<24,o=(o&65535)*1540483477+(((o>>>16)*1540483477&65535)<<16),o^=o>>>24,o=(o&65535)*1540483477+(((o>>>16)*1540483477&65535)<<16),n=(n&65535)*1540483477+(((n>>>16)*1540483477&65535)<<16)^o,r-=4,++i;switch(r){case 3:n^=(t.charCodeAt(i+2)&255)<<16;case 2:n^=(t.charCodeAt(i+1)&255)<<8;case 1:n^=t.charCodeAt(i)&255,n=(n&65535)*1540483477+(((n>>>16)*1540483477&65535)<<16)}return n^=n>>>13,n=(n&65535)*1540483477+(((n>>>16)*1540483477&65535)<<16),n^=n>>>15,n>>>0}typeof Is!==void 0&&(Is.exports=ud)});var Ts=Ae((jv,Mo)=>{var Tc=_c(),cd=Ic();Mo.exports=Tc;Mo.exports.murmur3=Tc;Mo.exports.murmur2=cd});var Ns=Ae((zP,Os)=>{"use strict";Os.exports=Go;Os.exports.default=Go;function Go(t,e,r){r=r||2;var n=e&&e.length,i=n?e[0]*r:t.length,o=yp(t,0,i,r,!0),a=[];if(!o||o.next===o.prev)return a;var s,l,u,c,p,f,y;if(n&&(o=Xg(t,e,o,r)),t.length>80*r){s=u=t[0],l=c=t[1];for(var m=r;m<i;m+=r)p=t[m],f=t[m+1],p<s&&(s=p),f<l&&(l=f),p>u&&(u=p),f>c&&(c=f);y=Math.max(u-s,c-l),y=y!==0?32767/y:0}return Zn(o,a,r,s,l,y,0),a}function yp(t,e,r,n,i){var o,a;if(i===Rs(t,e,r,n)>0)for(o=e;o<r;o+=n)a=fp(o,t[o],t[o+1],a);else for(o=r-n;o>=e;o-=n)a=fp(o,t[o],t[o+1],a);return a&&qo(a,a.next)&&(Hn(a),a=a.next),a}function er(t,e){if(!t)return t;e||(e=t);var r=t,n;do if(n=!1,!r.steiner&&(qo(r,r.next)||oe(r.prev,r,r.next)===0)){if(Hn(r),r=e=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==e);return e}function Zn(t,e,r,n,i,o,a){if(t){!a&&o&&tx(t,n,i,o);for(var s=t,l,u;t.prev!==t.next;){if(l=t.prev,u=t.next,o?Zg(t,n,i,o):Jg(t)){e.push(l.i/r|0),e.push(t.i/r|0),e.push(u.i/r|0),Hn(t),t=u.next,s=u.next;continue}if(t=u,t===s){a?a===1?(t=Wg(er(t),e,r),Zn(t,e,r,n,i,o,2)):a===2&&Hg(t,e,r,n,i,o):Zn(er(t),e,r,n,i,o,1);break}}}}function Jg(t){var e=t.prev,r=t,n=t.next;if(oe(e,r,n)>=0)return!1;for(var i=e.x,o=r.x,a=n.x,s=e.y,l=r.y,u=n.y,c=i<o?i<a?i:a:o<a?o:a,p=s<l?s<u?s:u:l<u?l:u,f=i>o?i>a?i:a:o>a?o:a,y=s>l?s>u?s:u:l>u?l:u,m=n.next;m!==e;){if(m.x>=c&&m.x<=f&&m.y>=p&&m.y<=y&&_r(i,s,o,l,a,u,m.x,m.y)&&oe(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function Zg(t,e,r,n){var i=t.prev,o=t,a=t.next;if(oe(i,o,a)>=0)return!1;for(var s=i.x,l=o.x,u=a.x,c=i.y,p=o.y,f=a.y,y=s<l?s<u?s:u:l<u?l:u,m=c<p?c<f?c:f:p<f?p:f,h=s>l?s>u?s:u:l>u?l:u,d=c>p?c>f?c:f:p>f?p:f,g=Bs(y,m,e,r,n),b=Bs(h,d,e,r,n),x=t.prevZ,v=t.nextZ;x&&x.z>=g&&v&&v.z<=b;){if(x.x>=y&&x.x<=h&&x.y>=m&&x.y<=d&&x!==i&&x!==a&&_r(s,c,l,p,u,f,x.x,x.y)&&oe(x.prev,x,x.next)>=0||(x=x.prevZ,v.x>=y&&v.x<=h&&v.y>=m&&v.y<=d&&v!==i&&v!==a&&_r(s,c,l,p,u,f,v.x,v.y)&&oe(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;x&&x.z>=g;){if(x.x>=y&&x.x<=h&&x.y>=m&&x.y<=d&&x!==i&&x!==a&&_r(s,c,l,p,u,f,x.x,x.y)&&oe(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;v&&v.z<=b;){if(v.x>=y&&v.x<=h&&v.y>=m&&v.y<=d&&v!==i&&v!==a&&_r(s,c,l,p,u,f,v.x,v.y)&&oe(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function Wg(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!qo(i,o)&&mp(i,n,n.next,o)&&Wn(i,o)&&Wn(o,i)&&(e.push(i.i/r|0),e.push(n.i/r|0),e.push(o.i/r|0),Hn(n),Hn(n.next),n=t=o),n=n.next}while(n!==t);return er(n)}function Hg(t,e,r,n,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&ix(a,s)){var l=hp(a,s);a=er(a,a.next),l=er(l,l.next),Zn(a,e,r,n,i,o,0),Zn(l,e,r,n,i,o,0);return}s=s.next}a=a.next}while(a!==t)}function Xg(t,e,r,n){var i=[],o,a,s,l,u;for(o=0,a=e.length;o<a;o++)s=e[o]*n,l=o<a-1?e[o+1]*n:t.length,u=yp(t,s,l,n,!1),u===u.next&&(u.steiner=!0),i.push(nx(u));for(i.sort(Kg),o=0;o<i.length;o++)r=Yg(i[o],r);return r}function Kg(t,e){return t.x-e.x}function Yg(t,e){var r=Qg(t,e);if(!r)return e;var n=hp(r,t);return er(n,n.next),er(r,r.next)}function Qg(t,e){var r=e,n=t.x,i=t.y,o=-1/0,a;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var s=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=n&&s>o&&(o=s,a=r.x<r.next.x?r:r.next,s===n))return a}r=r.next}while(r!==e);if(!a)return null;var l=a,u=a.x,c=a.y,p=1/0,f;r=a;do n>=r.x&&r.x>=u&&n!==r.x&&_r(i<c?n:o,i,u,c,i<c?o:n,i,r.x,r.y)&&(f=Math.abs(i-r.y)/(n-r.x),Wn(r,t)&&(f<p||f===p&&(r.x>a.x||r.x===a.x&&ex(a,r)))&&(a=r,p=f)),r=r.next;while(r!==l);return a}function ex(t,e){return oe(t.prev,t,e.prev)<0&&oe(e.next,t,t.next)<0}function tx(t,e,r,n){var i=t;do i.z===0&&(i.z=Bs(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,rx(i)}function rx(t){var e,r,n,i,o,a,s,l,u=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,n=r,s=0,e=0;e<u&&(s++,n=n.nextZ,!!n);e++);for(l=u;s>0||l>0&&n;)s!==0&&(l===0||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,u*=2}while(a>1);return t}function Bs(t,e,r,n,i){return t=(t-r)*i|0,e=(e-n)*i|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function nx(t){var e=t,r=t;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==t);return r}function _r(t,e,r,n,i,o,a,s){return(i-a)*(e-s)>=(t-a)*(o-s)&&(t-a)*(n-s)>=(r-a)*(e-s)&&(r-a)*(o-s)>=(i-a)*(n-s)}function ix(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!ox(t,e)&&(Wn(t,e)&&Wn(e,t)&&ax(t,e)&&(oe(t.prev,t,e.prev)||oe(t,e.prev,e))||qo(t,e)&&oe(t.prev,t,t.next)>0&&oe(e.prev,e,e.next)>0)}function oe(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function qo(t,e){return t.x===e.x&&t.y===e.y}function mp(t,e,r,n){var i=$o(oe(t,e,r)),o=$o(oe(t,e,n)),a=$o(oe(r,n,t)),s=$o(oe(r,n,e));return!!(i!==o&&a!==s||i===0&&Uo(t,r,e)||o===0&&Uo(t,n,e)||a===0&&Uo(r,t,n)||s===0&&Uo(r,e,n))}function Uo(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function $o(t){return t>0?1:t<0?-1:0}function ox(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&mp(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function Wn(t,e){return oe(t.prev,t,t.next)<0?oe(t,e,t.next)>=0&&oe(t,t.prev,e)>=0:oe(t,e,t.prev)<0||oe(t,t.next,e)<0}function ax(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==t);return n}function hp(t,e){var r=new zs(t.i,t.x,t.y),n=new zs(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function fp(t,e,r,n){var i=new zs(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Hn(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function zs(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Go.deviation=function(t,e,r,n){var i=e&&e.length,o=i?e[0]*r:t.length,a=Math.abs(Rs(t,0,o,r));if(i)for(var s=0,l=e.length;s<l;s++){var u=e[s]*r,c=s<l-1?e[s+1]*r:t.length;a-=Math.abs(Rs(t,u,c,r))}var p=0;for(s=0;s<n.length;s+=3){var f=n[s]*r,y=n[s+1]*r,m=n[s+2]*r;p+=Math.abs((t[f]-t[m])*(t[y+1]-t[f+1])-(t[f]-t[y])*(t[m+1]-t[f+1]))}return a===0&&p===0?0:Math.abs((p-a)/a)};function Rs(t,e,r,n){for(var i=0,o=e,a=r-n;o<r;o+=n)i+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return i}Go.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var a=0;a<e;a++)r.vertices.push(t[i][o][a]);i>0&&(n+=t[i-1].length,r.holes.push(n))}return r}});var $s=Ae((vS,wp)=>{"use strict";var yx=he();wp.exports=kr;function kr(t,e,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=i,t.readFields(mx,this,e)}function mx(t,e,r){t==1?e.id=r.readVarint():t==2?hx(r,e):t==3?e.type=r.readVarint():t==4&&(e._geometry=r.pos)}function hx(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}kr.types=["Unknown","Point","LineString","Polygon"];kr.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,a=[],s;t.pos<e;){if(n<=0){var l=t.readVarint();r=l&7,n=l>>3}if(n--,r===1||r===2)i+=t.readSVarint(),o+=t.readSVarint(),r===1&&(s&&a.push(s),s=[]),s.push(new yx(i,o));else if(r===7)s&&s.push(s[0].clone());else throw new Error("unknown command "+r)}return s&&a.push(s),a};kr.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,a=1/0,s=-1/0,l=1/0,u=-1/0;t.pos<e;){if(n<=0){var c=t.readVarint();r=c&7,n=c>>3}if(n--,r===1||r===2)i+=t.readSVarint(),o+=t.readSVarint(),i<a&&(a=i),i>s&&(s=i),o<l&&(l=o),o>u&&(u=o);else if(r!==7)throw new Error("unknown command "+r)}return[a,l,s,u]};kr.prototype.toGeoJSON=function(t,e,r){var n=this.extent*Math.pow(2,r),i=this.extent*t,o=this.extent*e,a=this.loadGeometry(),s=kr.types[this.type],l,u;function c(y){for(var m=0;m<y.length;m++){var h=y[m],d=180-(h.y+o)*360/n;y[m]=[(h.x+i)*360/n-180,360/Math.PI*Math.atan(Math.exp(d*Math.PI/180))-90]}}switch(this.type){case 1:var p=[];for(l=0;l<a.length;l++)p[l]=a[l][0];a=p,c(a);break;case 2:for(l=0;l<a.length;l++)c(a[l]);break;case 3:for(a=dx(a),l=0;l<a.length;l++)for(u=0;u<a[l].length;u++)c(a[l][u]);break}a.length===1?a=a[0]:s="Multi"+s;var f={type:"Feature",geometry:{type:s,coordinates:a},properties:this.properties};return"id"in this&&(f.id=this.id),f};function dx(t){var e=t.length;if(e<=1)return[t];for(var r=[],n,i,o=0;o<e;o++){var a=gx(t[o]);a!==0&&(i===void 0&&(i=a<0),i===a<0?(n&&r.push(n),n=[t[o]]):n.push(t[o]))}return n&&r.push(n),r}function gx(t){for(var e=0,r=0,n=t.length,i=n-1,o,a;r<n;i=r++)o=t[r],a=t[i],e+=(a.x-o.x)*(o.y+a.y);return e}});var Gs=Ae((PS,_p)=>{"use strict";var xx=$s();_p.exports=Ap;function Ap(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(bx,this,e),this.length=this._features.length}function bx(t,e,r){t===15?e.version=r.readVarint():t===1?e.name=r.readString():t===5?e.extent=r.readVarint():t===2?e._features.push(r.pos):t===3?e._keys.push(r.readString()):t===4&&e._values.push(vx(r))}function vx(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var n=t.readVarint()>>3;e=n===1?t.readString():n===2?t.readFloat():n===3?t.readDouble():n===4?t.readVarint64():n===5?t.readVarint():n===6?t.readSVarint():n===7?t.readBoolean():null}return e}Ap.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new xx(this._pbf,e,this.extent,this._keys,this._values)}});var Tp=Ae((SS,Ip)=>{"use strict";var Px=Gs();Ip.exports=Sx;function Sx(t,e){this.layers=t.readFields(wx,{},e)}function wx(t,e,r){if(t===3){var n=new Px(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}});var Tt=Ae((wS,Jo)=>{Jo.exports.VectorTile=Tp();Jo.exports.VectorTileFeature=$s();Jo.exports.VectorTileLayer=Gs()});var Wp=Ae(Ws=>{Ws.read=function(t,e,r,n,i){var o,a,s=i*8-n-1,l=(1<<s)-1,u=l>>1,c=-7,p=r?i-1:0,f=r?-1:1,y=t[e+p];for(p+=f,o=y&(1<<-c)-1,y>>=-c,c+=s;c>0;o=o*256+t[e+p],p+=f,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=a*256+t[e+p],p+=f,c-=8);if(o===0)o=1-u;else{if(o===l)return a?NaN:(y?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-u}return(y?-1:1)*a*Math.pow(2,o-n)};Ws.write=function(t,e,r,n,i,o){var a,s,l,u=o*8-i-1,c=(1<<u)-1,p=c>>1,f=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:o-1,m=n?1:-1,h=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+p>=1?e+=f/l:e+=f*Math.pow(2,1-p),e*l>=2&&(a++,l/=2),a+p>=c?(s=0,a=c):a+p>=1?(s=(e*l-1)*Math.pow(2,i),a=a+p):(s=e*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;t[r+y]=s&255,y+=m,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;t[r+y]=a&255,y+=m,a/=256,u-=8);t[r+y-m]|=h*128}});var Qn=Ae((o2,Qp)=>{"use strict";Qp.exports=J;var Ko=Wp();function J(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}J.Varint=0;J.Fixed64=1;J.Bytes=2;J.Fixed32=5;var Hs=65536*65536,Hp=1/Hs,$x=12,Yp=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");J.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=n&7,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Yo(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Kp(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Yo(this.buf,this.pos)+Yo(this.buf,this.pos+4)*Hs;return this.pos+=8,t},readSFixed64:function(){var t=Yo(this.buf,this.pos)+Kp(this.buf,this.pos+4)*Hs;return this.pos+=8,t},readFloat:function(){var t=Ko.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Ko.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e=this.buf,r,n;return n=e[this.pos++],r=n&127,n<128||(n=e[this.pos++],r|=(n&127)<<7,n<128)||(n=e[this.pos++],r|=(n&127)<<14,n<128)||(n=e[this.pos++],r|=(n&127)<<21,n<128)?r:(n=e[this.pos],r|=(n&15)<<28,Gx(r,t,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2===1?(t+1)/-2:t/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=$x&&Yp?nb(this.buf,e,t):rb(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==J.Bytes)return t.push(this.readVarint(e));var r=ct(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==J.Bytes)return t.push(this.readSVarint());var e=ct(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==J.Bytes)return t.push(this.readBoolean());var e=ct(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==J.Bytes)return t.push(this.readFloat());var e=ct(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==J.Bytes)return t.push(this.readDouble());var e=ct(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==J.Bytes)return t.push(this.readFixed32());var e=ct(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==J.Bytes)return t.push(this.readSFixed32());var e=ct(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==J.Bytes)return t.push(this.readFixed64());var e=ct(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==J.Bytes)return t.push(this.readSFixed64());var e=ct(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=t&7;if(e===J.Varint)for(;this.buf[this.pos++]>127;);else if(e===J.Bytes)this.pos=this.readVarint()+this.pos;else if(e===J.Fixed32)this.pos+=4;else if(e===J.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+e)},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),Fr(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Fr(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Fr(this.buf,t&-1,this.pos),Fr(this.buf,Math.floor(t*Hp),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Fr(this.buf,t&-1,this.pos),Fr(this.buf,Math.floor(t*Hp),this.pos+4),this.pos+=8},writeVarint:function(t){if(t=+t||0,t>268435455||t<0){qx(t,this);return}this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127)))},writeSVarint:function(t){this.writeVarint(t<0?-t*2-1:t*2)},writeBoolean:function(t){this.writeVarint(!!t)},writeString:function(t){t=String(t),this.realloc(t.length*4),this.pos++;var e=this.pos;this.pos=ib(this.buf,t,this.pos);var r=this.pos-e;r>=128&&Xp(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Ko.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Ko.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&Xp(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,J.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Zx,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Wx,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Kx,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Hx,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Xx,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Yx,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Qx,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,eb,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,tb,e)},writeBytesField:function(t,e){this.writeTag(t,J.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,J.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,J.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,J.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,J.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,J.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,J.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,J.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,J.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,J.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,!!e)}};function Gx(t,e,r){var n=r.buf,i,o;if(o=n[r.pos++],i=(o&112)>>4,o<128||(o=n[r.pos++],i|=(o&127)<<3,o<128)||(o=n[r.pos++],i|=(o&127)<<10,o<128)||(o=n[r.pos++],i|=(o&127)<<17,o<128)||(o=n[r.pos++],i|=(o&127)<<24,o<128)||(o=n[r.pos++],i|=(o&1)<<31,o<128))return Er(t,i,e);throw new Error("Expected varint not more than 10 bytes")}function ct(t){return t.type===J.Bytes?t.readVarint()+t.pos:t.pos+1}function Er(t,e,r){return r?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function qx(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(r=~(-t%4294967296),n=~(-t/4294967296),r^4294967295?r=r+1|0:(r=0,n=n+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn\'t fit into 10 bytes");e.realloc(10),jx(r,n,e),Jx(n,e)}function jx(t,e,r){r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos]=t&127}function Jx(t,e){var r=(t&7)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}function Xp(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function Zx(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function Wx(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function Hx(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function Xx(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function Kx(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function Yx(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function Qx(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function eb(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function tb(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function Yo(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+t[e+3]*16777216}function Fr(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function Kp(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function rb(t,e,r){for(var n="",i=e;i<r;){var o=t[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s>r)break;var l,u,c;s===1?o<128&&(a=o):s===2?(l=t[i+1],(l&192)===128&&(a=(o&31)<<6|l&63,a<=127&&(a=null))):s===3?(l=t[i+1],u=t[i+2],(l&192)===128&&(u&192)===128&&(a=(o&15)<<12|(l&63)<<6|u&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):s===4&&(l=t[i+1],u=t[i+2],c=t[i+3],(l&192)===128&&(u&192)===128&&(c&192)===128&&(a=(o&15)<<18|(l&63)<<12|(u&63)<<6|c&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,s=1):a>65535&&(a-=65536,n+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),n+=String.fromCharCode(a),i+=s}return n}function nb(t,e,r){return Yp.decode(t.subarray(e,r))}function ib(t,e,r){for(var n=0,i,o;n<e.length;n++){if(i=e.charCodeAt(n),i>55295&&i<57344)if(o)if(i<56320){t[r++]=239,t[r++]=191,t[r++]=189,o=i;continue}else i=o-55296<<10|i-56320|65536,o=null;else{i>56319||n+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):o=i;continue}else o&&(t[r++]=239,t[r++]=191,t[r++]=189,o=null);i<128?t[r++]=i:(i<2048?t[r++]=i>>6|192:(i<65536?t[r++]=i>>12|224:(t[r++]=i>>18|240,t[r++]=i>>12&63|128),t[r++]=i>>6&63|128),t[r++]=i&63|128)}return r}});var Hf=Ae((rT,Wf)=>{Wf.exports=Pa;function Pa(t,e){var r=t&&t.type,n;if(r==="FeatureCollection")for(n=0;n<t.features.length;n++)Pa(t.features[n],e);else if(r==="GeometryCollection")for(n=0;n<t.geometries.length;n++)Pa(t.geometries[n],e);else if(r==="Feature")Pa(t.geometry,e);else if(r==="Polygon")Jf(t.coordinates,e);else if(r==="MultiPolygon")for(n=0;n<t.coordinates.length;n++)Jf(t.coordinates[n],e);return t}function Jf(t,e){if(t.length!==0){Zf(t[0],e);for(var r=1;r<t.length;r++)Zf(t[r],!e)}}function Zf(t,e){for(var r=0,n=0,i=0,o=t.length,a=o-1;i<o;a=i++){var s=(t[i][0]-t[a][0])*(t[a][1]+t[i][1]),l=r+s;n+=Math.abs(r)>=Math.abs(s)?r-l+s:s-l+r,r=l}r+n>=0!=!!e&&t.reverse()}});var Qf=Ae((oT,Yf)=>{"use strict";var Nb=he(),Ub=Tt().VectorTileFeature;Yf.exports=Kf;function Kf(t,e){this.options=e||{},this.features=t,this.length=t.length}Kf.prototype.feature=function(t){return new wa(this.features[t],this.options.extent)};function wa(t,e){this.id=typeof t.id=="number"?t.id:void 0,this.type=t.type,this.rawGeometry=t.type===1?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}wa.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var r=t[e],n=[],i=0;i<r.length;i++)n.push(new Nb(r[i][0],r[i][1]));this.geometry.push(n)}return this.geometry};wa.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-1/0,n=1/0,i=-1/0,o=0;o<t.length;o++)for(var a=t[o],s=0;s<a.length;s++){var l=a[s];e=Math.min(e,l.x),r=Math.max(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.y)}return[e,n,r,i]};wa.prototype.toGeoJSON=Ub.prototype.toGeoJSON});var ry=Ae((aT,di)=>{var $b=Qn(),ty=Qf();di.exports=ml;di.exports.fromVectorTileJs=ml;di.exports.fromGeojsonVt=Gb;di.exports.GeoJSONWrapper=ty;function ml(t){var e=new $b;return qb(t,e),e.finish()}function Gb(t,e){e=e||{};var r={};for(var n in t)r[n]=new ty(t[n].features,e),r[n].name=n,r[n].version=e.version,r[n].extent=e.extent;return ml({layers:r})}function qb(t,e){for(var r in t.layers)e.writeMessage(3,jb,t.layers[r])}function jb(t,e){e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var r,n={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<t.length;r++)n.feature=t.feature(r),e.writeMessage(2,Jb,n);var i=n.keys;for(r=0;r<i.length;r++)e.writeStringField(3,i[r]);var o=n.values;for(r=0;r<o.length;r++)e.writeMessage(4,Hb,o[r])}function Jb(t,e){var r=t.feature;r.id!==void 0&&e.writeVarintField(1,r.id),e.writeMessage(2,Zb,t),e.writeVarintField(3,r.type),e.writeMessage(4,Wb,r)}function Zb(t,e){var r=t.feature,n=t.keys,i=t.values,o=t.keycache,a=t.valuecache;for(var s in r.properties){var l=r.properties[s],u=o[s];if(l!==null){typeof u>"u"&&(n.push(s),u=n.length-1,o[s]=u),e.writeVarint(u);var c=typeof l;c!=="string"&&c!=="boolean"&&c!=="number"&&(l=JSON.stringify(l));var p=c+":"+l,f=a[p];typeof f>"u"&&(i.push(l),f=i.length-1,a[p]=f),e.writeVarint(f)}}}function yl(t,e){return(e<<3)+(t&7)}function ey(t){return t<<1^t>>31}function Wb(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,o=0,a=r.length,s=0;s<a;s++){var l=r[s],u=1;n===1&&(u=l.length),e.writeVarint(yl(1,u));for(var c=n===3?l.length-1:l.length,p=0;p<c;p++){p===1&&n!==1&&e.writeVarint(yl(2,c-1));var f=l[p].x-i,y=l[p].y-o;e.writeVarint(ey(f)),e.writeVarint(ey(y)),i+=f,o+=y}n===3&&e.writeVarint(yl(7,1))}}function Hb(t,e){var r=typeof t;r==="string"?e.writeStringField(1,t):r==="boolean"?e.writeBooleanField(7,t):r==="number"&&(t%1!==0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}});var Iy=Z(he(),1),$l=Z(Rl(),1);var za;function Ol(){return za==null&&(za=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),za}var Ii;function Nl(){if(Ii==null&&(Ii=!1,Ol())){let r=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(r){for(let i=0;i<5*5;i++){let o=i*4;r.fillStyle=`rgb(${o},${o+1},${o+2})`,r.fillRect(i%5,Math.floor(i/5),1,1)}let n=r.getImageData(0,0,5,5).data;for(let i=0;i<5*5*4;i++)if(i%4!==3&&n[i]!==i){Ii=!0;break}}}return Ii||!1}function Gl(t){if(t<=0)return 0;if(t>=1)return 1;let e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function Ty(t,e,r,n){let i=new $l.default(t,e,r,n);return function(o){return i.solve(o)}}var h0=Ty(.25,.1,.25,1);function it(t,e,r){return Math.min(r,Math.max(e,t))}function ql(t,e,r){let n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function Pe(t,...e){for(let r of e)for(let n in r)t[n]=r[n];return t}function jl(t){return Math.log(t)/Math.LN2%1===0}function qr(t,e,r){let n={};for(let i in t)n[i]=e.call(r||this,t[i],i,t);return n}function Jl(t,e,r){let n={};for(let i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}function nt(t){return Array.isArray(t)?t.map(nt):typeof t=="object"&&t?qr(t,nt):t}function Zl(t,e){for(let r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return!0;return!1}var Ul={};function fe(t){Ul[t]||(typeof console<"u"&&console.warn(t),Ul[t]=!0)}function ot(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function Wl(t){let e=0;for(let r=0,n=t.length,i=n-1,o,a;r<n;i=r++)o=t[r],a=t[i],e+=(a.x-o.x)*(o.y+a.y);return e}function at(t){return typeof WorkerGlobalScope<"u"&&typeof t<"u"&&t instanceof WorkerGlobalScope}function jr(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap}function Cy(t,e,r,n,i){let o=Math.max(-e,0)*4,l=(Math.max(0,r)-r)*n*4+o,u=n*4,c=Math.max(0,e),p=Math.max(0,r),f=Math.min(t.width,e+n),y=Math.min(t.height,r+i);return{rect:{x:c,y:p,width:f-c,height:y-p},layout:[{offset:l,stride:u}]}}async function ky(t,e,r,n,i){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");let o=new VideoFrame(t,{timestamp:0});try{let a=o?.format;if(!a||!(a.startsWith("BGR")||a.startsWith("RGB")))throw new Error(`Unrecognized format ${a}`);let s=a.startsWith("BGR"),l=new Uint8ClampedArray(n*i*4);if(await o.copyTo(l,Cy(t,e,r,n,i)),s)for(let u=0;u<l.length;u+=4){let c=l[u];l[u]=l[u+2],l[u+2]=c}return l}finally{o.close()}}var $r,Gr;function My(t,e,r,n,i){let o=t.width,a=t.height;(!$r||!Gr)&&($r=new OffscreenCanvas(o,a),Gr=$r.getContext("2d",{willReadFrequently:!0})),$r.width=o,$r.height=a,Gr.drawImage(t,0,0,o,a);let s=Gr.getImageData(e,r,n,i);return Gr.clearRect(0,0,o,a),s.data}async function Hl(t,e,r,n,i){if(Nl())try{return await ky(t,e,r,n,i)}catch{}return My(t,e,r,n,i)}function Xl(t,e,r,n){return t.addEventListener(e,r,n),{unsubscribe:()=>{t.removeEventListener(e,r,n)}}}var Dt=class t{constructor(e,r,n){let i=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let a=new Int32Array(this.arrayBuffer);e=a[0],r=a[1],n=a[2],this.d=r+2*n;for(let u=0;u<this.d*this.d;u++){let c=a[3+u],p=a[3+u+1];i.push(c===p?null:a.subarray(c,p))}let s=a[3+i.length],l=a[3+i.length+1];this.keys=a.subarray(s,l),this.bboxes=a.subarray(l),this.insert=this._insertReadonly}else{this.d=r+2*n;for(let a=0;a<this.d*this.d;a++)i.push([]);this.keys=[],this.bboxes=[]}this.n=r,this.extent=e,this.padding=n,this.scale=r/e,this.uid=0;let o=n/r*e;this.min=-o,this.max=e+o}insert(e,r,n,i,o){this._forEachCell(r,n,i,o,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i),this.bboxes.push(o)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,r,n,i,o,a){this.cells[o].push(a)}query(e,r,n,i,o){let a=this.min,s=this.max;if(e<=a&&r<=a&&s<=n&&s<=i&&!o)return Array.prototype.slice.call(this.keys);{let l=[],u={};return this._forEachCell(e,r,n,i,this._queryCell,l,u,o),l}}_queryCell(e,r,n,i,o,a,s,l){let u=this.cells[o];if(u!==null){let c=this.keys,p=this.bboxes;for(let f=0;f<u.length;f++){let y=u[f];if(s[y]===void 0){let m=y*4;(l?l(p[m+0],p[m+1],p[m+2],p[m+3]):e<=p[m+2]&&r<=p[m+3]&&n>=p[m+0]&&i>=p[m+1])?(s[y]=!0,a.push(c[y])):s[y]=!1}}}}_forEachCell(e,r,n,i,o,a,s,l){let u=this._convertToCellCoord(e),c=this._convertToCellCoord(r),p=this._convertToCellCoord(n),f=this._convertToCellCoord(i);for(let y=u;y<=p;y++)for(let m=c;m<=f;m++){let h=this.d*m+y;if(!(l&&!l(this._convertFromCellCoord(y),this._convertFromCellCoord(m),this._convertFromCellCoord(y+1),this._convertFromCellCoord(m+1)))&&o.call(this,e,r,n,i,h,a,s,l))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;let e=this.cells,r=3+this.cells.length+1+1,n=0;for(let a=0;a<this.cells.length;a++)n+=this.cells[a].length;let i=new Int32Array(r+n+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;let o=r;for(let a=0;a<e.length;a++){let s=e[a];i[3+a]=o,i.set(s,o),o+=s.length}return i[3+e.length]=o,i.set(this.keys,o),o+=this.keys.length,i[3+e.length+1]=o,i.set(this.bboxes,o),o+=this.bboxes.length,i.buffer}static serialize(e,r){let n=e.toArrayBuffer();return r&&r.push(n),{buffer:n}}static deserialize(e){return new t(e.buffer)}};var Ey=8,Fy={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"},roll:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},Ly={"*":{type:"source"}},Dy=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],Vy={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:"*"}},By={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:"*"}},zy={type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Ry={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"}},Oy={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"}}},Ny={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"}}},Uy={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"}},$y=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],Gy={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},qy={"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"}},jy={"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"}},Jy={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Zy={"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"}},Wy={"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Hy={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Xy={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ky={type:"array",value:"*"},Yy={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},Qy={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},em={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},tm={type:"array",value:"*",minimum:1},rm={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}},nm={"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},im={source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},om={type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},am=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],sm={"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"}},lm={"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"}},um={"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"}},cm={"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"}},pm={"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"}},fm={"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"}},ym={"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"}},mm={"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"}},hm={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},dm={"*":{type:"string"}},S={$version:Ey,$root:Fy,sources:Ly,source:Dy,source_vector:Vy,source_raster:By,source_raster_dem:zy,source_geojson:Ry,source_video:Oy,source_image:Ny,layer:Uy,layout:$y,layout_background:Gy,layout_fill:qy,layout_circle:jy,layout_heatmap:Jy,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:Zy,layout_symbol:Wy,layout_raster:Hy,layout_hillshade:Xy,filter:Ky,filter_operator:Yy,geometry_type:Qy,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:em,expression:tm,light:rm,sky:nm,terrain:im,projection:om,paint:am,paint_fill:sm,"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:lm,paint_circle:um,paint_heatmap:cm,paint_symbol:pm,paint_raster:fm,paint_hillshade:ym,paint_background:mm,transition:hm,"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:dm},gm=["type","source","source-layer","minzoom","maxzoom","filter","layout"];var M=class{constructor(e,r,n,i){this.message=(e?`${e}: `:"")+n,i&&(this.identifier=i),r!=null&&r.__line__&&(this.line=r.__line__)}};function pr(t,...e){for(let r of e)for(let n in r)t[n]=r[n];return t}var Be=class extends Error{constructor(e,r){super(r),this.message=r,this.key=e}},Za=class t{constructor(e,r=[]){this.parent=e,this.bindings={};for(let[n,i]of r)this.bindings[n]=i}concat(e){return new t(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return this.bindings[e]?!0:this.parent?this.parent.has(e):!1}},mr={kind:"null"},L={kind:"number"},G={kind:"string"},U={kind:"boolean"},Re={kind:"color"},ur={kind:"object"},$={kind:"value"},xm={kind:"error"},ji={kind:"collator"},hr={kind:"formatted"},Ji={kind:"padding"},un={kind:"resolvedImage"},Zi={kind:"variableAnchorOffsetCollection"};function Ee(t,e){return{kind:"array",itemType:t,N:e}}function te(t){if(t.kind==="array"){let e=te(t.itemType);return typeof t.N=="number"?`array<${e}, ${t.N}>`:t.itemType.kind==="value"?"array":`array<${e}>`}else return t.kind}var bm=[mr,L,G,U,Re,hr,ur,Ee($),Ji,un,Zi];function Xr(t,e){if(e.kind==="error")return null;if(t.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!Xr(t.itemType,e.itemType))&&(typeof t.N!="number"||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if(t.kind==="value"){for(let r of bm)if(!Xr(r,e))return null}}return`Expected ${te(t)} but found ${te(e)} instead.`}function cs(t,e){return e.some(r=>r.kind===t.kind)}function zt(t,e){return e.some(r=>r==="null"?t===null:r==="array"?Array.isArray(t):r==="object"?t&&!Array.isArray(t)&&typeof t=="object":r===typeof t)}function Jr(t,e){return t.kind==="array"&&e.kind==="array"?t.itemType.kind===e.itemType.kind&&typeof t.N=="number":t.kind===e.kind}var xu=.96422,bu=1,vu=.82521,Pu=4/29,cr=6/29,Su=3*cr*cr,vm=cr*cr*cr,Pm=Math.PI/180,Sm=180/Math.PI;function wu(t){return t=t%360,t<0&&(t+=360),t}function Au([t,e,r,n]){t=Ra(t),e=Ra(e),r=Ra(r);let i,o,a=Oa((.2225045*t+.7168786*e+.0606169*r)/bu);t===e&&e===r?i=o=a:(i=Oa((.4360747*t+.3850649*e+.1430804*r)/xu),o=Oa((.0139322*t+.0971045*e+.7141733*r)/vu));let s=116*a-16;return[s<0?0:s,500*(i-a),200*(a-o),n]}function Ra(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Oa(t){return t>vm?Math.pow(t,1/3):t/Su+Pu}function _u([t,e,r,n]){let i=(t+16)/116,o=isNaN(e)?i:i+e/500,a=isNaN(r)?i:i-r/200;return i=bu*Ua(i),o=xu*Ua(o),a=vu*Ua(a),[Na(3.1338561*o-1.6168667*i-.4906146*a),Na(-.9787684*o+1.9161415*i+.033454*a),Na(.0719453*o-.2289914*i+1.4052427*a),n]}function Na(t){return t=t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055,t<0?0:t>1?1:t}function Ua(t){return t>cr?t*t*t:Su*(t-Pu)}function wm(t){let[e,r,n,i]=Au(t),o=Math.sqrt(r*r+n*n);return[Math.round(o*1e4)?wu(Math.atan2(n,r)*Sm):NaN,o,e,i]}function Am([t,e,r,n]){return t=isNaN(t)?0:t*Pm,_u([r,Math.cos(t)*e,Math.sin(t)*e,n])}function _m([t,e,r,n]){t=wu(t),e/=100,r/=100;function i(o){let a=(o+t/30)%12,s=e*Math.min(r,1-r);return r-s*Math.max(-1,Math.min(a-3,9-a,1))}return[i(0),i(8),i(4),n]}function Im(t){if(t=t.toLowerCase().trim(),t==="transparent")return[0,0,0,0];let e=Tm[t];if(e){let[i,o,a]=e;return[i/255,o/255,a/255,1]}if(t.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){let o=t.length<6?1:2,a=1;return[Ti(t.slice(a,a+=o)),Ti(t.slice(a,a+=o)),Ti(t.slice(a,a+=o)),Ti(t.slice(a,a+o)||"ff")]}if(t.startsWith("rgb")){let i=/^rgba?\\(\\s*([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/,o=t.match(i);if(o){let[a,s,l,u,c,p,f,y,m,h,d,g]=o,b=[u||" ",f||" ",h].join("");if(b===" "||b===" /"||b===",,"||b===",,,"){let x=[l,p,m].join(""),v=x==="%%%"?100:x===""?255:0;if(v){let P=[sr(+s/v,0,1),sr(+c/v,0,1),sr(+y/v,0,1),d?Kl(+d,g):1];if(Yl(P))return P}}return}}let r=/^hsla?\\(\\s*([\\de.+-]+)(?:deg)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/,n=t.match(r);if(n){let[i,o,a,s,l,u,c,p,f]=n,y=[a||" ",l||" ",c].join("");if(y===" "||y===" /"||y===",,"||y===",,,"){let m=[+o,sr(+s,0,100),sr(+u,0,100),p?Kl(+p,f):1];if(Yl(m))return _m(m)}}}function Ti(t){return parseInt(t.padEnd(2,t),16)/255}function Kl(t,e){return sr(e?t/100:t,0,1)}function sr(t,e,r){return Math.min(Math.max(e,t),r)}function Yl(t){return!t.some(Number.isNaN)}var Tm={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]},W=class t{constructor(e,r,n,i=1,o=!0){this.r=e,this.g=r,this.b=n,this.a=i,o||(this.r*=i,this.g*=i,this.b*=i,i||this.overwriteGetter("rgb",[e,r,n,i]))}static parse(e){if(e instanceof t)return e;if(typeof e!="string")return;let r=Im(e);if(r)return new t(...r,!1)}get rgb(){let{r:e,g:r,b:n,a:i}=this,o=i||1/0;return this.overwriteGetter("rgb",[e/o,r/o,n/o,i])}get hcl(){return this.overwriteGetter("hcl",wm(this.rgb))}get lab(){return this.overwriteGetter("lab",Au(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){let[e,r,n,i]=this.rgb;return`rgba(${[e,r,n].map(o=>Math.round(o*255)).join(",")},${i})`}};W.black=new W(0,0,0,1);W.white=new W(1,1,1,1);W.transparent=new W(0,0,0,0);W.red=new W(1,0,0,1);var Kr=class{constructor(e,r,n){e?this.sensitivity=r?"variant":"case":this.sensitivity=r?"accent":"base",this.locale=n,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}},Yr=class{constructor(e,r,n,i,o){this.text=e,this.image=r,this.scale=n,this.fontStack=i,this.textColor=o}},Fe=class t{constructor(e){this.sections=e}static fromString(e){return new t([new Yr(e,null,null,null,null)])}isEmpty(){return this.sections.length===0?!0:!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof t?e:t.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}},Ze=class t{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof t)return e;if(typeof e=="number")return new t([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(let 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]];break}return new t(e)}}toString(){return JSON.stringify(this.values)}},Cm=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]),Ne=class t{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof t)return e;if(!(!Array.isArray(e)||e.length<1||e.length%2!==0)){for(let r=0;r<e.length;r+=2){let n=e[r],i=e[r+1];if(typeof n!="string"||!Cm.has(n)||!Array.isArray(i)||i.length!==2||typeof i[0]!="number"||typeof i[1]!="number")return}return new t(e)}}toString(){return JSON.stringify(this.values)}},Te=class t{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new t({name:e,available:!1}):null}};function Iu(t,e,r,n){return typeof t=="number"&&t>=0&&t<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?typeof n>"u"||typeof n=="number"&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,r,n].join(", ")}]: \'a\' must be between 0 and 1.`:`Invalid rgba value [${(typeof n=="number"?[t,e,r,n]:[t,e,r]).join(", ")}]: \'r\', \'g\', and \'b\' must be between 0 and 255.`}function Qr(t){if(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||t instanceof W||t instanceof Kr||t instanceof Fe||t instanceof Ze||t instanceof Ne||t instanceof Te)return!0;if(Array.isArray(t)){for(let e of t)if(!Qr(e))return!1;return!0}else if(typeof t=="object"){for(let e in t)if(!Qr(t[e]))return!1;return!0}else return!1}function ue(t){if(t===null)return mr;if(typeof t=="string")return G;if(typeof t=="boolean")return U;if(typeof t=="number")return L;if(t instanceof W)return Re;if(t instanceof Kr)return ji;if(t instanceof Fe)return hr;if(t instanceof Ze)return Ji;if(t instanceof Ne)return Zi;if(t instanceof Te)return un;if(Array.isArray(t)){let e=t.length,r;for(let n of t){let i=ue(n);if(!r)r=i;else{if(r===i)continue;r=$;break}}return Ee(r||$,e)}else return ur}function Wr(t){let e=typeof t;return t===null?"":e==="string"||e==="number"||e==="boolean"?String(t):t instanceof W||t instanceof Fe||t instanceof Ze||t instanceof Ne||t instanceof Te?t.toString():JSON.stringify(t)}var mt=class t{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(!Qr(e[1]))return r.error("invalid value");let n=e[1],i=ue(n),o=r.expectedType;return i.kind==="array"&&i.N===0&&o&&o.kind==="array"&&(typeof o.N!="number"||o.N===0)&&(i=o),new t(i,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}},ie=class{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}},Ci={string:G,number:L,boolean:U,object:ur},je=class t{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 n=1,i,o=e[0];if(o==="array"){let s;if(e.length>2){let u=e[1];if(typeof u!="string"||!(u in Ci)||u==="object")return r.error(\'The item type argument of "array" must be one of string, number, boolean\',1);s=Ci[u],n++}else s=$;let l;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);l=e[2],n++}i=Ee(s,l)}else{if(!Ci[o])throw new Error(`Types doesn\'t contain name = ${o}`);i=Ci[o]}let a=[];for(;n<e.length;n++){let s=r.parse(e[n],n,$);if(!s)return null;a.push(s)}return new t(i,a)}evaluate(e){for(let r=0;r<this.args.length;r++){let n=this.args[r].evaluate(e);if(Xr(this.type,ue(n))){if(r===this.args.length-1)throw new ie(`Expected value to be of type ${te(this.type)}, but found ${te(ue(n))} instead.`)}else return n}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},Ql={"to-boolean":U,"to-color":Re,"to-number":L,"to-string":G},yt=class t{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 n=e[0];if(!Ql[n])throw new Error(`Can\'t parse ${n} as it is not part of the known types`);if((n==="to-boolean"||n==="to-string")&&e.length!==2)return r.error("Expected one argument.");let i=Ql[n],o=[];for(let a=1;a<e.length;a++){let s=r.parse(e[a],a,$);if(!s)return null;o.push(s)}return new t(i,o)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let r,n;for(let i of this.args){if(r=i.evaluate(e),n=null,r instanceof W)return r;if(typeof r=="string"){let o=e.parseColor(r);if(o)return o}else if(Array.isArray(r)&&(r.length<3||r.length>4?n=`Invalid rgba value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:n=Iu(r[0],r[1],r[2],r[3]),!n))return new W(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new ie(n||`Could not parse color from value \'${typeof r=="string"?r:JSON.stringify(r)}\'`)}case"padding":{let r;for(let n of this.args){r=n.evaluate(e);let i=Ze.parse(r);if(i)return i}throw new ie(`Could not parse padding from value \'${typeof r=="string"?r:JSON.stringify(r)}\'`)}case"variableAnchorOffsetCollection":{let r;for(let n of this.args){r=n.evaluate(e);let i=Ne.parse(r);if(i)return i}throw new ie(`Could not parse variableAnchorOffsetCollection from value \'${typeof r=="string"?r:JSON.stringify(r)}\'`)}case"number":{let r=null;for(let n of this.args){if(r=n.evaluate(e),r===null)return 0;let i=Number(r);if(!isNaN(i))return i}throw new ie(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return Fe.fromString(Wr(this.args[0].evaluate(e)));case"resolvedImage":return Te.fromString(Wr(this.args[0].evaluate(e)));default:return Wr(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},km=["Unknown","Point","LineString","Polygon"],Fi=class{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"?km[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]=W.parse(e)),r}},Li=class t{constructor(e,r,n=[],i,o=new Za,a=[]){this.registry=e,this.path=n,this.key=n.map(s=>`[${s}]`).join(""),this.scope=o,this.errors=a,this.expectedType=i,this._isConstant=r}parse(e,r,n,i,o={}){return r?this.concat(r,n,i)._parse(e,o):this._parse(e,o)}_parse(e,r){(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number")&&(e=["literal",e]);function n(i,o,a){return a==="assert"?new je(o,[i]):a==="coerce"?new yt(o,[i]):i}if(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", []].\');let i=e[0];if(typeof i!="string")return this.error(`Expression name must be a string, but found ${typeof i} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let o=this.registry[i];if(o){let a=o.parse(e,this);if(!a)return null;if(this.expectedType){let s=this.expectedType,l=a.type;if((s.kind==="string"||s.kind==="number"||s.kind==="boolean"||s.kind==="object"||s.kind==="array")&&l.kind==="value")a=n(a,s,r.typeAnnotation||"assert");else if((s.kind==="color"||s.kind==="formatted"||s.kind==="resolvedImage")&&(l.kind==="value"||l.kind==="string"))a=n(a,s,r.typeAnnotation||"coerce");else if(s.kind==="padding"&&(l.kind==="value"||l.kind==="number"||l.kind==="array"))a=n(a,s,r.typeAnnotation||"coerce");else if(s.kind==="variableAnchorOffsetCollection"&&(l.kind==="value"||l.kind==="array"))a=n(a,s,r.typeAnnotation||"coerce");else if(this.checkSubtype(s,l))return null}if(!(a instanceof mt)&&a.type.kind!=="resolvedImage"&&this._isConstant(a)){let s=new Fi;try{a=new mt(a.type,a.evaluate(s))}catch(l){return this.error(l.message),null}}return a}return this.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0)}else return typeof e>"u"?this.error("\'undefined\' value invalid. Use null instead."):typeof e=="object"?this.error(\'Bare objects invalid. Use ["literal", {...}] instead.\'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,r,n){let i=typeof e=="number"?this.path.concat(e):this.path,o=n?this.scope.concat(n):this.scope;return new t(this.registry,this._isConstant,i,r||null,o,this.errors)}error(e,...r){let n=`${this.key}${r.map(i=>`[${i}]`).join("")}`;this.errors.push(new Be(n,e))}checkSubtype(e,r){let n=Xr(e,r);return n&&this.error(n),n}},Di=class t{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let 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.`);let n=[];for(let o=1;o<e.length-1;o+=2){let a=e[o];if(typeof a!="string")return r.error(`Expected string, but found ${typeof a} instead.`,o);if(/[^a-zA-Z0-9_]/.test(a))return r.error("Variable names must contain only alphanumeric characters or \'_\'.",o);let s=r.parse(e[o+1],o+1);if(!s)return null;n.push([a,s])}let i=r.parse(e[e.length-1],e.length-1,r.expectedType,n);return i?new t(n,i):null}outputDefined(){return this.result.outputDefined()}},Vi=class t{constructor(e,r){this.type=r.type,this.name=e,this.boundExpression=r}static parse(e,r){if(e.length!==2||typeof e[1]!="string")return r.error("\'var\' expression requires exactly one string literal argument.");let n=e[1];return r.scope.has(n)?new t(n,r.scope.get(n)):r.error(`Unknown variable "${n}". Make sure "${n}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}},Wa=class t{constructor(e,r,n){this.type=e,this.index=r,this.input=n}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let n=r.parse(e[1],1,L),i=r.parse(e[2],2,Ee(r.expectedType||$));if(!n||!i)return null;let o=i.type;return new t(o.itemType,n,i)}evaluate(e){let r=this.index.evaluate(e),n=this.input.evaluate(e);if(r<0)throw new ie(`Array index out of bounds: ${r} < 0.`);if(r>=n.length)throw new ie(`Array index out of bounds: ${r} > ${n.length-1}.`);if(r!==Math.floor(r))throw new ie(`Array index must be an integer, but found ${r} instead.`);return n[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},Ha=class t{constructor(e,r){this.type=U,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.`);let n=r.parse(e[1],1,$),i=r.parse(e[2],2,$);return!n||!i?null:cs(n.type,[U,G,L,mr,$])?new t(n,i):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${te(n.type)} instead`)}evaluate(e){let r=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!n)return!1;if(!zt(r,["boolean","string","number","null"]))throw new ie(`Expected first argument to be of type boolean, string, number or null, but found ${te(ue(r))} instead.`);if(!zt(n,["string","array"]))throw new ie(`Expected second argument to be of type array or string, but found ${te(ue(n))} instead.`);return n.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}},Xa=class t{constructor(e,r,n){this.type=L,this.needle=e,this.haystack=r,this.fromIndex=n}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.`);let n=r.parse(e[1],1,$),i=r.parse(e[2],2,$);if(!n||!i)return null;if(!cs(n.type,[U,G,L,mr,$]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${te(n.type)} instead`);if(e.length===4){let o=r.parse(e[3],3,L);return o?new t(n,i,o):null}else return new t(n,i)}evaluate(e){let r=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!zt(r,["boolean","string","number","null"]))throw new ie(`Expected first argument to be of type boolean, string, number or null, but found ${te(ue(r))} instead.`);let i;if(this.fromIndex&&(i=this.fromIndex.evaluate(e)),zt(n,["string"])){let o=n.indexOf(r,i);return o===-1?-1:[...n.slice(0,o)].length}else{if(zt(n,["array"]))return n.indexOf(r,i);throw new ie(`Expected second argument to be of type array or string, but found ${te(ue(n))} instead.`)}}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},Ka=class t{constructor(e,r,n,i,o,a){this.inputType=e,this.type=r,this.input=n,this.cases=i,this.outputs=o,this.otherwise=a}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 n,i;r.expectedType&&r.expectedType.kind!=="value"&&(i=r.expectedType);let o={},a=[];for(let u=2;u<e.length-1;u+=2){let c=e[u],p=e[u+1];Array.isArray(c)||(c=[c]);let f=r.concat(u);if(c.length===0)return f.error("Expected at least one branch label.");for(let m of c){if(typeof m!="number"&&typeof m!="string")return f.error("Branch labels must be numbers or strings.");if(typeof m=="number"&&Math.abs(m)>Number.MAX_SAFE_INTEGER)return f.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof m=="number"&&Math.floor(m)!==m)return f.error("Numeric branch labels must be integer values.");if(!n)n=ue(m);else if(f.checkSubtype(n,ue(m)))return null;if(typeof o[String(m)]<"u")return f.error("Branch labels must be unique.");o[String(m)]=a.length}let y=r.parse(p,u,i);if(!y)return null;i=i||y.type,a.push(y)}let s=r.parse(e[1],1,$);if(!s)return null;let l=r.parse(e[e.length-1],e.length-1,i);return!l||s.type.kind!=="value"&&r.concat(1).checkSubtype(n,s.type)?null:new t(n,i,s,o,a,l)}evaluate(e){let r=this.input.evaluate(e);return(ue(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()}},Ya=class t{constructor(e,r,n){this.type=e,this.branches=r,this.otherwise=n}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 n;r.expectedType&&r.expectedType.kind!=="value"&&(n=r.expectedType);let i=[];for(let a=1;a<e.length-1;a+=2){let s=r.parse(e[a],a,U);if(!s)return null;let l=r.parse(e[a+1],a+1,n);if(!l)return null;i.push([s,l]),n=n||l.type}let o=r.parse(e[e.length-1],e.length-1,n);if(!o)return null;if(!n)throw new Error("Can\'t infer output type");return new t(n,i,o)}evaluate(e){for(let[r,n]of this.branches)if(r.evaluate(e))return n.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[r,n]of this.branches)e(r),e(n);e(this.otherwise)}outputDefined(){return this.branches.every(([e,r])=>r.outputDefined())&&this.otherwise.outputDefined()}},Qa=class t{constructor(e,r,n,i){this.type=e,this.input=r,this.beginIndex=n,this.endIndex=i}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.`);let n=r.parse(e[1],1,$),i=r.parse(e[2],2,L);if(!n||!i)return null;if(!cs(n.type,[Ee($),G,$]))return r.error(`Expected first argument to be of type array or string, but found ${te(n.type)} instead`);if(e.length===4){let o=r.parse(e[3],3,L);return o?new t(n.type,n,i,o):null}else return new t(n.type,n,i)}evaluate(e){let r=this.input.evaluate(e),n=this.beginIndex.evaluate(e),i;if(this.endIndex&&(i=this.endIndex.evaluate(e)),zt(r,["string"]))return[...r].slice(n,i).join("");if(zt(r,["array"]))return r.slice(n,i);throw new ie(`Expected first argument to be of type array or string, but found ${te(ue(r))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}};function Wi(t,e){let r=t.length-1,n=0,i=r,o=0,a,s;for(;n<=i;)if(o=Math.floor((n+i)/2),a=t[o],s=t[o+1],a<=e){if(o===r||e<s)return o;n=o+1}else if(a>e)i=o-1;else throw new ie("Input is not a number.");return 0}var fr=class t{constructor(e,r,n){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(let[i,o]of n)this.labels.push(i),this.outputs.push(o)}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.");let n=r.parse(e[1],1,L);if(!n)return null;let i=[],o=null;r.expectedType&&r.expectedType.kind!=="value"&&(o=r.expectedType);for(let a=1;a<e.length;a+=2){let s=a===1?-1/0:e[a],l=e[a+1],u=a,c=a+1;if(typeof s!="number")return r.error(\'Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.\',u);if(i.length&&i[i.length-1][0]>=s)return r.error(\'Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.\',u);let p=r.parse(l,c,o);if(!p)return null;o=o||p.type,i.push([s,p])}return new t(o,n,i)}evaluate(e){let r=this.labels,n=this.outputs;if(r.length===1)return n[0].evaluate(e);let i=this.input.evaluate(e);if(i<=r[0])return n[0].evaluate(e);let o=r.length;if(i>=r[o-1])return n[o-1].evaluate(e);let a=Wi(r,i);return n[a].evaluate(e)}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function Mm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var $a,eu;function Em(){if(eu)return $a;eu=1,$a=t;function t(e,r,n,i){this.cx=3*e,this.bx=3*(n-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(i-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=r,this.p2x=n,this.p2y=i}return t.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,r){if(r===void 0&&(r=1e-6),e<0)return 0;if(e>1)return 1;for(var n=e,i=0;i<8;i++){var o=this.sampleCurveX(n)-e;if(Math.abs(o)<r)return n;var a=this.sampleCurveDerivativeX(n);if(Math.abs(a)<1e-6)break;n=n-o/a}var s=0,l=1;for(n=e,i=0;i<20&&(o=this.sampleCurveX(n),!(Math.abs(o-e)<r));i++)e>o?s=n:l=n,n=(l-s)*.5+s;return n},solve:function(e,r){return this.sampleCurveY(this.solveCurveX(e,r))}},$a}var Fm=Em(),Lm=Mm(Fm);function Dm(t){return t==="rgb"||t==="hcl"||t==="lab"}function Rt(t,e,r){return t+r*(e-t)}function Vm(t,e,r,n="rgb"){switch(n){case"rgb":{let[i,o,a,s]=Bi(t.rgb,e.rgb,r);return new W(i,o,a,s,!1)}case"hcl":{let[i,o,a,s]=t.hcl,[l,u,c,p]=e.hcl,f,y;if(!isNaN(i)&&!isNaN(l)){let b=l-i;l>i&&b>180?b-=360:l<i&&i-l>180&&(b+=360),f=i+r*b}else isNaN(i)?isNaN(l)?f=NaN:(f=l,(a===1||a===0)&&(y=u)):(f=i,(c===1||c===0)&&(y=o));let[m,h,d,g]=Am([f,y??Rt(o,u,r),Rt(a,c,r),Rt(s,p,r)]);return new W(m,h,d,g,!1)}case"lab":{let[i,o,a,s]=_u(Bi(t.lab,e.lab,r));return new W(i,o,a,s,!1)}}}function Bi(t,e,r){return t.map((n,i)=>Rt(n,e[i],r))}function Bm(t,e,r){return new Ze(Bi(t.values,e.values,r))}function zm(t,e,r){let n=t.values,i=e.values;if(n.length!==i.length)throw new ie(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${e.toString()}`);let o=[];for(let a=0;a<n.length;a+=2){if(n[a]!==i[a])throw new ie(`Cannot interpolate values containing mismatched anchors. from[${a}]: ${n[a]}, to[${a}]: ${i[a]}`);o.push(n[a]);let[s,l]=n[a+1],[u,c]=i[a+1];o.push([Rt(s,u,r),Rt(l,c,r)])}return new Ne(o)}var Oe={number:Rt,color:Vm,array:Bi,padding:Bm,variableAnchorOffsetCollection:zm},Je=class t{constructor(e,r,n,i,o){this.type=e,this.operator=r,this.interpolation=n,this.input=i,this.labels=[],this.outputs=[];for(let[a,s]of o)this.labels.push(a),this.outputs.push(s)}static interpolationFactor(e,r,n,i){let o=0;if(e.name==="exponential")o=Ga(r,e.base,n,i);else if(e.name==="linear")o=Ga(r,1,n,i);else if(e.name==="cubic-bezier"){let a=e.controlPoints;o=new Lm(a[0],a[1],a[2],a[3]).solve(Ga(r,1,n,i))}return o}static parse(e,r){let[n,i,o,...a]=e;if(!Array.isArray(i)||i.length===0)return r.error("Expected an interpolation type expression.",1);if(i[0]==="linear")i={name:"linear"};else if(i[0]==="exponential"){let u=i[1];if(typeof u!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:u}}else if(i[0]==="cubic-bezier"){let u=i.slice(1);if(u.length!==4||u.some(c=>typeof c!="number"||c<0||c>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:u}}else return r.error(`Unknown interpolation type ${String(i[0])}`,1,0);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(o=r.parse(o,2,L),!o)return null;let s=[],l=null;n==="interpolate-hcl"||n==="interpolate-lab"?l=Re:r.expectedType&&r.expectedType.kind!=="value"&&(l=r.expectedType);for(let u=0;u<a.length;u+=2){let c=a[u],p=a[u+1],f=u+3,y=u+4;if(typeof c!="number")return r.error(\'Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.\',f);if(s.length&&s[s.length-1][0]>=c)return r.error(\'Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.\',f);let m=r.parse(p,y,l);if(!m)return null;l=l||m.type,s.push([c,m])}return!Jr(l,L)&&!Jr(l,Re)&&!Jr(l,Ji)&&!Jr(l,Zi)&&!Jr(l,Ee(L))?r.error(`Type ${te(l)} is not interpolatable.`):new t(l,n,i,o,s)}evaluate(e){let r=this.labels,n=this.outputs;if(r.length===1)return n[0].evaluate(e);let i=this.input.evaluate(e);if(i<=r[0])return n[0].evaluate(e);let o=r.length;if(i>=r[o-1])return n[o-1].evaluate(e);let a=Wi(r,i),s=r[a],l=r[a+1],u=t.interpolationFactor(this.interpolation,i,s,l),c=n[a].evaluate(e),p=n[a+1].evaluate(e);switch(this.operator){case"interpolate":return Oe[this.type.kind](c,p,u);case"interpolate-hcl":return Oe.color(c,p,u,"hcl");case"interpolate-lab":return Oe.color(c,p,u,"lab")}}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function Ga(t,e,r,n){let i=n-r,o=t-r;return i===0?0:e===1?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}var zi=class t{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 n=null,i=r.expectedType;i&&i.kind!=="value"&&(n=i);let o=[];for(let s of e.slice(1)){let l=r.parse(s,1+o.length,n,void 0,{typeAnnotation:"omit"});if(!l)return null;n=n||l.type,o.push(l)}if(!n)throw new Error("No output type");return i&&o.some(s=>Xr(i,s.type))?new t($,o):new t(n,o)}evaluate(e){let r=null,n=0,i;for(let o of this.args)if(n++,r=o.evaluate(e),r&&r instanceof Te&&!r.available&&(i||(i=r.name),r=null,n===this.args.length&&(r=i)),r!==null)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};function tu(t,e){return t==="=="||t==="!="?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 Rm(t,e,r){return e===r}function Om(t,e,r){return e!==r}function Nm(t,e,r){return e<r}function Um(t,e,r){return e>r}function $m(t,e,r){return e<=r}function Gm(t,e,r){return e>=r}function Tu(t,e,r,n){return n.compare(e,r)===0}function qm(t,e,r,n){return!Tu(t,e,r,n)}function jm(t,e,r,n){return n.compare(e,r)<0}function Jm(t,e,r,n){return n.compare(e,r)>0}function Zm(t,e,r,n){return n.compare(e,r)<=0}function Wm(t,e,r,n){return n.compare(e,r)>=0}function dr(t,e,r){let n=t!=="=="&&t!=="!=";return class Cu{constructor(o,a,s){this.type=U,this.lhs=o,this.rhs=a,this.collator=s,this.hasUntypedArgument=o.type.kind==="value"||a.type.kind==="value"}static parse(o,a){if(o.length!==3&&o.length!==4)return a.error("Expected two or three arguments.");let s=o[0],l=a.parse(o[1],1,$);if(!l)return null;if(!tu(s,l.type))return a.concat(1).error(`"${s}" comparisons are not supported for type \'${te(l.type)}\'.`);let u=a.parse(o[2],2,$);if(!u)return null;if(!tu(s,u.type))return a.concat(2).error(`"${s}" comparisons are not supported for type \'${te(u.type)}\'.`);if(l.type.kind!==u.type.kind&&l.type.kind!=="value"&&u.type.kind!=="value")return a.error(`Cannot compare types \'${te(l.type)}\' and \'${te(u.type)}\'.`);n&&(l.type.kind==="value"&&u.type.kind!=="value"?l=new je(u.type,[l]):l.type.kind!=="value"&&u.type.kind==="value"&&(u=new je(l.type,[u])));let c=null;if(o.length===4){if(l.type.kind!=="string"&&u.type.kind!=="string"&&l.type.kind!=="value"&&u.type.kind!=="value")return a.error("Cannot use collator to compare non-string types.");if(c=a.parse(o[3],3,ji),!c)return null}return new Cu(l,u,c)}evaluate(o){let a=this.lhs.evaluate(o),s=this.rhs.evaluate(o);if(n&&this.hasUntypedArgument){let l=ue(a),u=ue(s);if(l.kind!==u.kind||!(l.kind==="string"||l.kind==="number"))throw new ie(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${l.kind}, ${u.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){let l=ue(a),u=ue(s);if(l.kind!=="string"||u.kind!=="string")return e(o,a,s)}return this.collator?r(o,a,s,this.collator.evaluate(o)):e(o,a,s)}eachChild(o){o(this.lhs),o(this.rhs),this.collator&&o(this.collator)}outputDefined(){return!0}}}var Hm=dr("==",Rm,Tu),Xm=dr("!=",Om,qm),Km=dr("<",Nm,jm),Ym=dr(">",Um,Jm),Qm=dr("<=",$m,Zm),eh=dr(">=",Gm,Wm),Ri=class t{constructor(e,r,n){this.type=ji,this.locale=n,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");let n=e[1];if(typeof n!="object"||Array.isArray(n))return r.error("Collator options argument must be an object.");let i=r.parse(n["case-sensitive"]===void 0?!1:n["case-sensitive"],1,U);if(!i)return null;let o=r.parse(n["diacritic-sensitive"]===void 0?!1:n["diacritic-sensitive"],1,U);if(!o)return null;let a=null;return n.locale&&(a=r.parse(n.locale,1,G),!a)?null:new t(i,o,a)}evaluate(e){return new Kr(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}},es=class t{constructor(e,r,n,i,o){this.type=G,this.number=e,this.locale=r,this.currency=n,this.minFractionDigits=i,this.maxFractionDigits=o}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");let n=r.parse(e[1],1,L);if(!n)return null;let i=e[2];if(typeof i!="object"||Array.isArray(i))return r.error("NumberFormat options argument must be an object.");let o=null;if(i.locale&&(o=r.parse(i.locale,1,G),!o))return null;let a=null;if(i.currency&&(a=r.parse(i.currency,1,G),!a))return null;let s=null;if(i["min-fraction-digits"]&&(s=r.parse(i["min-fraction-digits"],1,L),!s))return null;let l=null;return i["max-fraction-digits"]&&(l=r.parse(i["max-fraction-digits"],1,L),!l)?null:new t(n,o,a,s,l)}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}},en=class t{constructor(e){this.type=hr,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let n=e[1];if(!Array.isArray(n)&&typeof n=="object")return r.error("First argument must be an image or text section.");let i=[],o=!1;for(let a=1;a<=e.length-1;++a){let s=e[a];if(o&&typeof s=="object"&&!Array.isArray(s)){o=!1;let l=null;if(s["font-scale"]&&(l=r.parse(s["font-scale"],1,L),!l))return null;let u=null;if(s["text-font"]&&(u=r.parse(s["text-font"],1,Ee(G)),!u))return null;let c=null;if(s["text-color"]&&(c=r.parse(s["text-color"],1,Re),!c))return null;let p=i[i.length-1];p.scale=l,p.font=u,p.textColor=c}else{let l=r.parse(e[a],1,$);if(!l)return null;let u=l.type.kind;if(u!=="string"&&u!=="value"&&u!=="null"&&u!=="resolvedImage")return r.error("Formatted text type must be \'string\', \'value\', \'image\' or \'null\'.");o=!0,i.push({content:l,scale:null,font:null,textColor:null})}}return new t(i)}evaluate(e){let r=n=>{let i=n.content.evaluate(e);return ue(i)===un?new Yr("",i,null,null,null):new Yr(Wr(i),null,n.scale?n.scale.evaluate(e):null,n.font?n.font.evaluate(e).join(","):null,n.textColor?n.textColor.evaluate(e):null)};return new Fe(this.sections.map(r))}eachChild(e){for(let 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}},ts=class t{constructor(e){this.type=un,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");let n=r.parse(e[1],1,G);return n?new t(n):r.error("No image name provided.")}evaluate(e){let r=this.input.evaluate(e),n=Te.fromString(r);return n&&e.availableImages&&(n.available=e.availableImages.indexOf(r)>-1),n}eachChild(e){e(this.input)}outputDefined(){return!1}},rs=class t{constructor(e){this.type=L,this.input=e}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let n=r.parse(e[1],1);return n?n.type.kind!=="array"&&n.type.kind!=="string"&&n.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${te(n.type)} instead.`):new t(n):null}evaluate(e){let r=this.input.evaluate(e);if(typeof r=="string")return[...r].length;if(Array.isArray(r))return r.length;throw new ie(`Expected value to be of type string or array, but found ${te(ue(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}},Xe=8192;function th(t,e){let r=rh(t[0]),n=ih(t[1]),i=Math.pow(2,e.z);return[Math.round(r*i*Xe),Math.round(n*i*Xe)]}function ps(t,e){let r=Math.pow(2,e.z),n=(t[0]/Xe+e.x)/r,i=(t[1]/Xe+e.y)/r;return[nh(n),oh(i)]}function rh(t){return(180+t)/360}function nh(t){return t*360-180}function ih(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function oh(t){return 360/Math.PI*Math.atan(Math.exp((180-t*360)*Math.PI/180))-90}function cn(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function tn(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function ah(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function sh(t,e,r){let n=t[0]-e[0],i=t[1]-e[1],o=t[0]-r[0],a=t[1]-r[1];return n*a-o*i===0&&n*o<=0&&i*a<=0}function Hi(t,e,r,n){let i=[e[0]-t[0],e[1]-t[1]],o=[n[0]-r[0],n[1]-r[1]];return ph(o,i)===0?!1:!!(ru(t,e,r,n)&&ru(r,n,t,e))}function lh(t,e,r){for(let n of r)for(let i=0;i<n.length-1;++i)if(Hi(t,e,n[i],n[i+1]))return!0;return!1}function gr(t,e,r=!1){let n=!1;for(let i of e)for(let o=0;o<i.length-1;o++){if(sh(t,i[o],i[o+1]))return r;ah(t,i[o],i[o+1])&&(n=!n)}return n}function uh(t,e){for(let r of e)if(gr(t,r))return!0;return!1}function ku(t,e){for(let r of t)if(!gr(r,e))return!1;for(let r=0;r<t.length-1;++r)if(lh(t[r],t[r+1],e))return!1;return!0}function ch(t,e){for(let r of e)if(ku(t,r))return!0;return!1}function ph(t,e){return t[0]*e[1]-t[1]*e[0]}function ru(t,e,r,n){let i=t[0]-r[0],o=t[1]-r[1],a=e[0]-r[0],s=e[1]-r[1],l=n[0]-r[0],u=n[1]-r[1],c=i*u-l*o,p=a*u-l*s;return c>0&&p<0||c<0&&p>0}function fs(t,e,r){let n=[];for(let i=0;i<t.length;i++){let o=[];for(let a=0;a<t[i].length;a++){let s=th(t[i][a],r);cn(e,s),o.push(s)}n.push(o)}return n}function Mu(t,e,r){let n=[];for(let i=0;i<t.length;i++){let o=fs(t[i],e,r);n.push(o)}return n}function Eu(t,e,r,n){if(t[0]<r[0]||t[0]>r[2]){let i=n*.5,o=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;o===0&&(o=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=o}cn(e,t)}function fh(t){t[0]=t[1]=1/0,t[2]=t[3]=-1/0}function nu(t,e,r,n){let i=Math.pow(2,n.z)*Xe,o=[n.x*Xe,n.y*Xe],a=[];for(let s of t)for(let l of s){let u=[l.x+o[0],l.y+o[1]];Eu(u,e,r,i),a.push(u)}return a}function iu(t,e,r,n){let i=Math.pow(2,n.z)*Xe,o=[n.x*Xe,n.y*Xe],a=[];for(let s of t){let l=[];for(let u of s){let c=[u.x+o[0],u.y+o[1]];cn(e,c),l.push(c)}a.push(l)}if(e[2]-e[0]<=i/2){fh(e);for(let s of a)for(let l of s)Eu(l,e,r,i)}return a}function yh(t,e){let r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(e.type==="Polygon"){let o=fs(e.coordinates,n,i),a=nu(t.geometry(),r,n,i);if(!tn(r,n))return!1;for(let s of a)if(!gr(s,o))return!1}if(e.type==="MultiPolygon"){let o=Mu(e.coordinates,n,i),a=nu(t.geometry(),r,n,i);if(!tn(r,n))return!1;for(let s of a)if(!uh(s,o))return!1}return!0}function mh(t,e){let r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(e.type==="Polygon"){let o=fs(e.coordinates,n,i),a=iu(t.geometry(),r,n,i);if(!tn(r,n))return!1;for(let s of a)if(!ku(s,o))return!1}if(e.type==="MultiPolygon"){let o=Mu(e.coordinates,n,i),a=iu(t.geometry(),r,n,i);if(!tn(r,n))return!1;for(let s of a)if(!ch(s,o))return!1}return!0}var rn=class t{constructor(e,r){this.type=U,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(Qr(e[1])){let n=e[1];if(n.type==="FeatureCollection"){let i=[];for(let o of n.features){let{type:a,coordinates:s}=o.geometry;a==="Polygon"&&i.push(s),a==="MultiPolygon"&&i.push(...s)}if(i.length){let o={type:"MultiPolygon",coordinates:i};return new t(n,o)}}else if(n.type==="Feature"){let i=n.geometry.type;if(i==="Polygon"||i==="MultiPolygon")return new t(n,n.geometry)}else if(n.type==="Polygon"||n.type==="MultiPolygon")return new t(n,n)}return r.error("\'within\' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return yh(e,this.geometries);if(e.geometryType()==="LineString")return mh(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},Oi=class{constructor(e=[],r=(n,i)=>n<i?-1:n>i?1:0){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],r=this.data.pop();return--this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:r,compare:n}=this,i=r[e];for(;e>0;){let o=e-1>>1,a=r[o];if(n(i,a)>=0)break;r[e]=a,e=o}r[e]=i}_down(e){let{data:r,compare:n}=this,i=this.length>>1,o=r[e];for(;e<i;){let a=(e<<1)+1,s=a+1;if(s<this.length&&n(r[s],r[a])<0&&(a=s),n(r[a],o)>=0)break;r[e]=r[a],e=a}r[e]=o}};function hh(t,e,r,n,i){Fu(t,e,r,n||t.length-1,i||dh)}function Fu(t,e,r,n,i){for(;n>r;){if(n-r>600){var o=n-r+1,a=e-r+1,s=Math.log(o),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1),c=Math.max(r,Math.floor(e-a*l/o+u)),p=Math.min(n,Math.floor(e+(o-a)*l/o+u));Fu(t,e,c,p,i)}var f=t[e],y=r,m=n;for(Zr(t,r,e),i(t[n],f)>0&&Zr(t,r,n);y<m;){for(Zr(t,y,m),y++,m--;i(t[y],f)<0;)y++;for(;i(t[m],f)>0;)m--}i(t[r],f)===0?Zr(t,r,m):(m++,Zr(t,m,n)),m<=e&&(r=m+1),e<=m&&(n=m-1)}}function Zr(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function dh(t,e){return t<e?-1:t>e?1:0}function gh(t,e){if(t.length<=1)return[t];let n=[],i,o;for(let a of t){let s=bh(a);s!==0&&(a.area=Math.abs(s),o===void 0&&(o=s<0),o===s<0?(i&&n.push(i),i=[a]):i.push(a))}if(i&&n.push(i),e>1)for(let a=0;a<n.length;a++)n[a].length<=e||(hh(n[a],e,1,n[a].length-1,xh),n[a]=n[a].slice(0,e));return n}function xh(t,e){return e.area-t.area}function bh(t){let e=0;for(let r=0,n=t.length,i=n-1,o,a;r<n;i=r++)o=t[r],a=t[i],e+=(a.x-o.x)*(o.y+a.y);return e}var vh=6378.137,ou=1/298.257223563,au=ou*(2-ou),su=Math.PI/180,nn=class{constructor(e){let r=su*vh*1e3,n=Math.cos(e*su),i=1/(1-au*(1-n*n)),o=Math.sqrt(i);this.kx=r*o*n,this.ky=r*o*i*(1-au)}distance(e,r){let n=this.wrap(e[0]-r[0])*this.kx,i=(e[1]-r[1])*this.ky;return Math.sqrt(n*n+i*i)}pointOnLine(e,r){let n=1/0,i,o,a,s;for(let l=0;l<e.length-1;l++){let u=e[l][0],c=e[l][1],p=this.wrap(e[l+1][0]-u)*this.kx,f=(e[l+1][1]-c)*this.ky,y=0;(p!==0||f!==0)&&(y=(this.wrap(r[0]-u)*this.kx*p+(r[1]-c)*this.ky*f)/(p*p+f*f),y>1?(u=e[l+1][0],c=e[l+1][1]):y>0&&(u+=p/this.kx*y,c+=f/this.ky*y)),p=this.wrap(r[0]-u)*this.kx,f=(r[1]-c)*this.ky;let m=p*p+f*f;m<n&&(n=m,i=u,o=c,a=l,s=y)}return{point:[i,o],index:a,t:Math.max(0,Math.min(1,s))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}},ns=100,is=50;function Lu(t,e){return e[0]-t[0]}function Ni(t){return t[1]-t[0]+1}function st(t,e){return t[1]>=t[0]&&t[1]<e}function os(t,e){if(t[0]>t[1])return[null,null];let r=Ni(t);if(e){if(r===2)return[t,null];let i=Math.floor(r/2);return[[t[0],t[0]+i],[t[0]+i,t[1]]]}if(r===1)return[t,null];let n=Math.floor(r/2)-1;return[[t[0],t[0]+n],[t[0]+n+1,t[1]]]}function as(t,e){if(!st(e,t.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let n=e[0];n<=e[1];++n)cn(r,t[n]);return r}function ss(t){let e=[1/0,1/0,-1/0,-1/0];for(let r of t)for(let n of r)cn(e,n);return e}function lu(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function ys(t,e,r){if(!lu(t)||!lu(e))return NaN;let n=0,i=0;return t[2]<e[0]&&(n=e[0]-t[2]),t[0]>e[2]&&(n=t[0]-e[2]),t[1]>e[3]&&(i=t[1]-e[3]),t[3]<e[1]&&(i=e[1]-t[3]),r.distance([0,0],[n,i])}function Bt(t,e,r){let n=r.pointOnLine(e,t);return r.distance(t,n.point)}function ms(t,e,r,n,i){let o=Math.min(Bt(t,[r,n],i),Bt(e,[r,n],i)),a=Math.min(Bt(r,[t,e],i),Bt(n,[t,e],i));return Math.min(o,a)}function Ph(t,e,r,n,i){if(!(st(e,t.length)&&st(n,r.length)))return 1/0;let a=1/0;for(let s=e[0];s<e[1];++s){let l=t[s],u=t[s+1];for(let c=n[0];c<n[1];++c){let p=r[c],f=r[c+1];if(Hi(l,u,p,f))return 0;a=Math.min(a,ms(l,u,p,f,i))}}return a}function Sh(t,e,r,n,i){if(!(st(e,t.length)&&st(n,r.length)))return NaN;let a=1/0;for(let s=e[0];s<=e[1];++s)for(let l=n[0];l<=n[1];++l)if(a=Math.min(a,i.distance(t[s],r[l])),a===0)return a;return a}function wh(t,e,r){if(gr(t,e,!0))return 0;let n=1/0;for(let i of e){let o=i[0],a=i[i.length-1];if(o!==a&&(n=Math.min(n,Bt(t,[a,o],r)),n===0))return n;let s=r.pointOnLine(i,t);if(n=Math.min(n,r.distance(t,s.point)),n===0)return n}return n}function Ah(t,e,r,n){if(!st(e,t.length))return NaN;for(let o=e[0];o<=e[1];++o)if(gr(t[o],r,!0))return 0;let i=1/0;for(let o=e[0];o<e[1];++o){let a=t[o],s=t[o+1];for(let l of r)for(let u=0,c=l.length,p=c-1;u<c;p=u++){let f=l[p],y=l[u];if(Hi(a,s,f,y))return 0;i=Math.min(i,ms(a,s,f,y,n))}}return i}function uu(t,e){for(let r of t)for(let n of r)if(gr(n,e,!0))return!0;return!1}function _h(t,e,r,n=1/0){let i=ss(t),o=ss(e);if(n!==1/0&&ys(i,o,r)>=n)return n;if(tn(i,o)){if(uu(t,e))return 0}else if(uu(e,t))return 0;let a=1/0;for(let s of t)for(let l=0,u=s.length,c=u-1;l<u;c=l++){let p=s[c],f=s[l];for(let y of e)for(let m=0,h=y.length,d=h-1;m<h;d=m++){let g=y[d],b=y[m];if(Hi(p,f,g,b))return 0;a=Math.min(a,ms(p,f,g,b,r))}}return a}function cu(t,e,r,n,i,o){if(!o)return;let a=ys(as(n,o),i,r);a<e&&t.push([a,o,[0,0]])}function ki(t,e,r,n,i,o,a){if(!o||!a)return;let s=ys(as(n,o),as(i,a),r);s<e&&t.push([s,o,a])}function Ui(t,e,r,n,i=1/0){let o=Math.min(n.distance(t[0],r[0][0]),i);if(o===0)return o;let a=new Oi([[0,[0,t.length-1],[0,0]]],Lu),s=ss(r);for(;a.length>0;){let l=a.pop();if(l[0]>=o)continue;let u=l[1],c=e?is:ns;if(Ni(u)<=c){if(!st(u,t.length))return NaN;if(e){let p=Ah(t,u,r,n);if(isNaN(p)||p===0)return p;o=Math.min(o,p)}else for(let p=u[0];p<=u[1];++p){let f=wh(t[p],r,n);if(o=Math.min(o,f),o===0)return 0}}else{let p=os(u,e);cu(a,o,n,t,s,p[0]),cu(a,o,n,t,s,p[1])}}return o}function $i(t,e,r,n,i,o=1/0){let a=Math.min(o,i.distance(t[0],r[0]));if(a===0)return a;let s=new Oi([[0,[0,t.length-1],[0,r.length-1]]],Lu);for(;s.length>0;){let l=s.pop();if(l[0]>=a)continue;let u=l[1],c=l[2],p=e?is:ns,f=n?is:ns;if(Ni(u)<=p&&Ni(c)<=f){if(!st(u,t.length)&&st(c,r.length))return NaN;let y;if(e&&n)y=Ph(t,u,r,c,i),a=Math.min(a,y);else if(e&&!n){let m=t.slice(u[0],u[1]+1);for(let h=c[0];h<=c[1];++h)if(y=Bt(r[h],m,i),a=Math.min(a,y),a===0)return a}else if(!e&&n){let m=r.slice(c[0],c[1]+1);for(let h=u[0];h<=u[1];++h)if(y=Bt(t[h],m,i),a=Math.min(a,y),a===0)return a}else y=Sh(t,u,r,c,i),a=Math.min(a,y)}else{let y=os(u,e),m=os(c,n);ki(s,a,i,t,r,y[0],m[0]),ki(s,a,i,t,r,y[0],m[1]),ki(s,a,i,t,r,y[1],m[0]),ki(s,a,i,t,r,y[1],m[1])}}return a}function Ih(t,e){let r=t.geometry(),n=r.flat().map(a=>ps([a.x,a.y],t.canonical));if(r.length===0)return NaN;let i=new nn(n[0][1]),o=1/0;for(let a of e){switch(a.type){case"Point":o=Math.min(o,$i(n,!1,[a.coordinates],!1,i,o));break;case"LineString":o=Math.min(o,$i(n,!1,a.coordinates,!0,i,o));break;case"Polygon":o=Math.min(o,Ui(n,!1,a.coordinates,i,o));break}if(o===0)return o}return o}function Th(t,e){let r=t.geometry(),n=r.flat().map(a=>ps([a.x,a.y],t.canonical));if(r.length===0)return NaN;let i=new nn(n[0][1]),o=1/0;for(let a of e){switch(a.type){case"Point":o=Math.min(o,$i(n,!0,[a.coordinates],!1,i,o));break;case"LineString":o=Math.min(o,$i(n,!0,a.coordinates,!0,i,o));break;case"Polygon":o=Math.min(o,Ui(n,!0,a.coordinates,i,o));break}if(o===0)return o}return o}function Ch(t,e){let r=t.geometry();if(r.length===0||r[0].length===0)return NaN;let n=gh(r,0).map(a=>a.map(s=>s.map(l=>ps([l.x,l.y],t.canonical)))),i=new nn(n[0][0][0][1]),o=1/0;for(let a of e)for(let s of n){switch(a.type){case"Point":o=Math.min(o,Ui([a.coordinates],!1,s,i,o));break;case"LineString":o=Math.min(o,Ui(a.coordinates,!0,s,i,o));break;case"Polygon":o=Math.min(o,_h(s,a.coordinates,i,o));break}if(o===0)return o}return o}function qa(t){return t.type==="MultiPolygon"?t.coordinates.map(e=>({type:"Polygon",coordinates:e})):t.type==="MultiLineString"?t.coordinates.map(e=>({type:"LineString",coordinates:e})):t.type==="MultiPoint"?t.coordinates.map(e=>({type:"Point",coordinates:e})):[t]}var on=class t{constructor(e,r){this.type=L,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`\'distance\' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Qr(e[1])){let n=e[1];if(n.type==="FeatureCollection")return new t(n,n.features.map(i=>qa(i.geometry)).flat());if(n.type==="Feature")return new t(n,qa(n.geometry));if("type"in n&&"coordinates"in n)return new t(n,qa(n))}return r.error("\'distance\' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return Ih(e,this.geometries);if(e.geometryType()==="LineString")return Th(e,this.geometries);if(e.geometryType()==="Polygon")return Ch(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},$t={"==":Hm,"!=":Xm,">":Ym,"<":Km,">=":eh,"<=":Qm,array:je,at:Wa,boolean:je,case:Ya,coalesce:zi,collator:Ri,format:en,image:ts,in:Ha,"index-of":Xa,interpolate:Je,"interpolate-hcl":Je,"interpolate-lab":Je,length:rs,let:Di,literal:mt,match:Ka,number:je,"number-format":es,object:je,slice:Qa,step:fr,string:je,"to-boolean":yt,"to-color":yt,"to-number":yt,"to-string":yt,var:Vi,within:rn,distance:on},Ke=class t{constructor(e,r,n,i){this.name=e,this.type=r,this._evaluate=n,this.args=i}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,r){let n=e[0],i=t.definitions[n];if(!i)return r.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0);let o=Array.isArray(i)?i[0]:i.type,a=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=a.filter(([u])=>!Array.isArray(u)||u.length===e.length-1),l=null;for(let[u,c]of s){l=new Li(r.registry,Gi,r.path,null,r.scope);let p=[],f=!1;for(let y=1;y<e.length;y++){let m=e[y],h=Array.isArray(u)?u[y-1]:u.type,d=l.parse(m,1+p.length,h);if(!d){f=!0;break}p.push(d)}if(!f){if(Array.isArray(u)&&u.length!==p.length){l.error(`Expected ${u.length} arguments, but found ${p.length} instead.`);continue}for(let y=0;y<p.length;y++){let m=Array.isArray(u)?u[y]:u.type,h=p[y];l.concat(y+1).checkSubtype(m,h.type)}if(l.errors.length===0)return new t(n,o,c,p)}}if(s.length===1)r.errors.push(...l.errors);else{let c=(s.length?s:a).map(([f])=>Mh(f)).join(" | "),p=[];for(let f=1;f<e.length;f++){let y=r.parse(e[f],1+p.length);if(!y)return null;p.push(te(y.type))}r.error(`Expected arguments of type ${c}, but found (${p.join(", ")}) instead.`)}return null}static register(e,r){t.definitions=r;for(let n in r)e[n]=t}};function pu(t,[e,r,n,i]){e=e.evaluate(t),r=r.evaluate(t),n=n.evaluate(t);let o=i?i.evaluate(t):1,a=Iu(e,r,n,o);if(a)throw new ie(a);return new W(e/255,r/255,n/255,o,!1)}function fu(t,e){return t in e}function ja(t,e){let r=e[t];return typeof r>"u"?null:r}function kh(t,e,r,n){for(;r<=n;){let i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}function Vt(t){return{type:t}}Ke.register($t,{error:[xm,[G],(t,[e])=>{throw new ie(e.evaluate(t))}],typeof:[G,[$],(t,[e])=>te(ue(e.evaluate(t)))],"to-rgba":[Ee(L,4),[Re],(t,[e])=>{let[r,n,i,o]=e.evaluate(t).rgb;return[r*255,n*255,i*255,o]}],rgb:[Re,[L,L,L],pu],rgba:[Re,[L,L,L,L],pu],has:{type:U,overloads:[[[G],(t,[e])=>fu(e.evaluate(t),t.properties())],[[G,ur],(t,[e,r])=>fu(e.evaluate(t),r.evaluate(t))]]},get:{type:$,overloads:[[[G],(t,[e])=>ja(e.evaluate(t),t.properties())],[[G,ur],(t,[e,r])=>ja(e.evaluate(t),r.evaluate(t))]]},"feature-state":[$,[G],(t,[e])=>ja(e.evaluate(t),t.featureState||{})],properties:[ur,[],t=>t.properties()],"geometry-type":[G,[],t=>t.geometryType()],id:[$,[],t=>t.id()],zoom:[L,[],t=>t.globals.zoom],"heatmap-density":[L,[],t=>t.globals.heatmapDensity||0],"line-progress":[L,[],t=>t.globals.lineProgress||0],accumulated:[$,[],t=>t.globals.accumulated===void 0?null:t.globals.accumulated],"+":[L,Vt(L),(t,e)=>{let r=0;for(let n of e)r+=n.evaluate(t);return r}],"*":[L,Vt(L),(t,e)=>{let r=1;for(let n of e)r*=n.evaluate(t);return r}],"-":{type:L,overloads:[[[L,L],(t,[e,r])=>e.evaluate(t)-r.evaluate(t)],[[L],(t,[e])=>-e.evaluate(t)]]},"/":[L,[L,L],(t,[e,r])=>e.evaluate(t)/r.evaluate(t)],"%":[L,[L,L],(t,[e,r])=>e.evaluate(t)%r.evaluate(t)],ln2:[L,[],()=>Math.LN2],pi:[L,[],()=>Math.PI],e:[L,[],()=>Math.E],"^":[L,[L,L],(t,[e,r])=>Math.pow(e.evaluate(t),r.evaluate(t))],sqrt:[L,[L],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[L,[L],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[L,[L],(t,[e])=>Math.log(e.evaluate(t))],log2:[L,[L],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[L,[L],(t,[e])=>Math.sin(e.evaluate(t))],cos:[L,[L],(t,[e])=>Math.cos(e.evaluate(t))],tan:[L,[L],(t,[e])=>Math.tan(e.evaluate(t))],asin:[L,[L],(t,[e])=>Math.asin(e.evaluate(t))],acos:[L,[L],(t,[e])=>Math.acos(e.evaluate(t))],atan:[L,[L],(t,[e])=>Math.atan(e.evaluate(t))],min:[L,Vt(L),(t,e)=>Math.min(...e.map(r=>r.evaluate(t)))],max:[L,Vt(L),(t,e)=>Math.max(...e.map(r=>r.evaluate(t)))],abs:[L,[L],(t,[e])=>Math.abs(e.evaluate(t))],round:[L,[L],(t,[e])=>{let r=e.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[L,[L],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[L,[L],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[U,[G,$],(t,[e,r])=>t.properties()[e.value]===r.value],"filter-id-==":[U,[$],(t,[e])=>t.id()===e.value],"filter-type-==":[U,[G],(t,[e])=>t.geometryType()===e.value],"filter-<":[U,[G,$],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n<i}],"filter-id-<":[U,[$],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r<n}],"filter->":[U,[G,$],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n>i}],"filter-id->":[U,[$],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r>n}],"filter-<=":[U,[G,$],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n<=i}],"filter-id-<=":[U,[$],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r<=n}],"filter->=":[U,[G,$],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n>=i}],"filter-id->=":[U,[$],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r>=n}],"filter-has":[U,[$],(t,[e])=>e.value in t.properties()],"filter-has-id":[U,[],t=>t.id()!==null&&t.id()!==void 0],"filter-type-in":[U,[Ee(G)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[U,[Ee($)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[U,[G,Ee($)],(t,[e,r])=>r.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[U,[G,Ee($)],(t,[e,r])=>kh(t.properties()[e.value],r.value,0,r.value.length-1)],all:{type:U,overloads:[[[U,U],(t,[e,r])=>e.evaluate(t)&&r.evaluate(t)],[Vt(U),(t,e)=>{for(let r of e)if(!r.evaluate(t))return!1;return!0}]]},any:{type:U,overloads:[[[U,U],(t,[e,r])=>e.evaluate(t)||r.evaluate(t)],[Vt(U),(t,e)=>{for(let r of e)if(r.evaluate(t))return!0;return!1}]]},"!":[U,[U],(t,[e])=>!e.evaluate(t)],"is-supported-script":[U,[G],(t,[e])=>{let r=t.globals&&t.globals.isSupportedScript;return r?r(e.evaluate(t)):!0}],upcase:[G,[G],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[G,[G],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[G,Vt($),(t,e)=>e.map(r=>Wr(r.evaluate(t))).join("")],"resolved-locale":[G,[ji],(t,[e])=>e.evaluate(t).resolvedLocale()]});function Mh(t){return Array.isArray(t)?`(${t.map(te).join(", ")})`:`(${te(t.type)}...)`}function Gi(t){if(t instanceof Vi)return Gi(t.boundExpression);if(t instanceof Ke&&t.name==="error")return!1;if(t instanceof Ri)return!1;if(t instanceof rn)return!1;if(t instanceof on)return!1;let e=t instanceof yt||t instanceof je,r=!0;return t.eachChild(n=>{e?r=r&&Gi(n):r=r&&n instanceof mt}),r?Xi(t)&&Ki(t,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function Xi(t){if(t instanceof Ke){if(t.name==="get"&&t.args.length===1)return!1;if(t.name==="feature-state")return!1;if(t.name==="has"&&t.args.length===1)return!1;if(t.name==="properties"||t.name==="geometry-type"||t.name==="id")return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof rn||t instanceof on)return!1;let e=!0;return t.eachChild(r=>{e&&!Xi(r)&&(e=!1)}),e}function an(t){if(t instanceof Ke&&t.name==="feature-state")return!1;let e=!0;return t.eachChild(r=>{e&&!an(r)&&(e=!1)}),e}function Ki(t,e){if(t instanceof Ke&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild(n=>{r&&!Ki(n,e)&&(r=!1)}),r}function ls(t){return{result:"success",value:t}}function lr(t){return{result:"error",value:t}}function ht(t){return t["property-type"]==="data-driven"||t["property-type"]==="cross-faded-data-driven"}function Du(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function hs(t){return!!t.expression&&t.expression.interpolated}function j(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":t===null?"null":typeof t}function Yi(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Eh(t){return t}function Vu(t,e){let r=e.type==="color",n=t.stops&&typeof t.stops[0][0]=="object",i=n||t.property!==void 0,o=n||!i,a=t.type||(hs(e)?"exponential":"interval");if(r||e.type==="padding"){let c=r?W.parse:Ze.parse;t=pr({},t),t.stops&&(t.stops=t.stops.map(p=>[p[0],c(p[1])])),t.default?t.default=c(t.default):t.default=c(e.default)}if(t.colorSpace&&!Dm(t.colorSpace))throw new Error(`Unknown color space: "${t.colorSpace}"`);let s,l,u;if(a==="exponential")s=yu;else if(a==="interval")s=Lh;else if(a==="categorical"){s=Fh,l=Object.create(null);for(let c of t.stops)l[c[0]]=c[1];u=typeof t.stops[0][0]}else if(a==="identity")s=Dh;else throw new Error(`Unknown function type "${a}"`);if(n){let c={},p=[];for(let m=0;m<t.stops.length;m++){let h=t.stops[m],d=h[0].zoom;c[d]===void 0&&(c[d]={zoom:d,type:t.type,property:t.property,default:t.default,stops:[]},p.push(d)),c[d].stops.push([h[0].value,h[1]])}let f=[];for(let m of p)f.push([c[m].zoom,Vu(c[m],e)]);let y={name:"linear"};return{kind:"composite",interpolationType:y,interpolationFactor:Je.interpolationFactor.bind(void 0,y),zoomStops:f.map(m=>m[0]),evaluate({zoom:m},h){return yu({stops:f,base:t.base},e,m).evaluate(m,h)}}}else if(o){let c=a==="exponential"?{name:"exponential",base:t.base!==void 0?t.base:1}:null;return{kind:"camera",interpolationType:c,interpolationFactor:Je.interpolationFactor.bind(void 0,c),zoomStops:t.stops.map(p=>p[0]),evaluate:({zoom:p})=>s(t,e,p,l,u)}}else return{kind:"source",evaluate(c,p){let f=p&&p.properties?p.properties[t.property]:void 0;return f===void 0?pn(t.default,e.default):s(t,e,f,l,u)}}}function pn(t,e,r){if(t!==void 0)return t;if(e!==void 0)return e;if(r!==void 0)return r}function Fh(t,e,r,n,i){let o=typeof r===i?n[r]:void 0;return pn(o,t.default,e.default)}function Lh(t,e,r){if(j(r)!=="number")return pn(t.default,e.default);let n=t.stops.length;if(n===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];let i=Wi(t.stops.map(o=>o[0]),r);return t.stops[i][1]}function yu(t,e,r){let n=t.base!==void 0?t.base:1;if(j(r)!=="number")return pn(t.default,e.default);let i=t.stops.length;if(i===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];let o=Wi(t.stops.map(c=>c[0]),r),a=Vh(r,n,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],l=t.stops[o+1][1],u=Oe[e.type]||Eh;return typeof s.evaluate=="function"?{evaluate(...c){let p=s.evaluate.apply(void 0,c),f=l.evaluate.apply(void 0,c);if(!(p===void 0||f===void 0))return u(p,f,a,t.colorSpace)}}:u(s,l,a,t.colorSpace)}function Dh(t,e,r){switch(e.type){case"color":r=W.parse(r);break;case"formatted":r=Fe.fromString(r.toString());break;case"resolvedImage":r=Te.fromString(r.toString());break;case"padding":r=Ze.parse(r);break;default:j(r)!==e.type&&(e.type!=="enum"||!e.values[r])&&(r=void 0)}return pn(r,t.default,e.default)}function Vh(t,e,r,n){let i=n-r,o=t-r;return i===0?0:e===1?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}var Ot=class{constructor(e,r){this.expression=e,this._warningHistory={},this._evaluator=new Fi,this._defaultValue=r?zh(r):null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(e,r,n,i,o,a){return this._evaluator.globals=e,this._evaluator.feature=r,this._evaluator.featureState=n,this._evaluator.canonical=i,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,r,n,i,o,a){this._evaluator.globals=e,this._evaluator.feature=r||null,this._evaluator.featureState=n||null,this._evaluator.canonical=i,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a||null;try{let s=this.expression.evaluate(this._evaluator);if(s==null||typeof s=="number"&&s!==s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new ie(`Expected value to be one of ${Object.keys(this._enumValues).map(l=>JSON.stringify(l)).join(", ")}, but found ${JSON.stringify(s)} instead.`);return s}catch(s){return this._warningHistory[s.message]||(this._warningHistory[s.message]=!0,typeof console<"u"&&console.warn(s.message)),this._defaultValue}}};function Gt(t){return Array.isArray(t)&&t.length>0&&typeof t[0]=="string"&&t[0]in $t}function qt(t,e){let r=new Li($t,Gi,[],e?Bh(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return n?ls(new Ot(n,e)):lr(r.errors)}var dt=class{constructor(e,r){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!an(r.expression)}evaluateWithoutErrorHandling(e,r,n,i,o,a){return this._styleExpression.evaluateWithoutErrorHandling(e,r,n,i,o,a)}evaluate(e,r,n,i,o,a){return this._styleExpression.evaluate(e,r,n,i,o,a)}},gt=class{constructor(e,r,n,i){this.kind=e,this.zoomStops=n,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!an(r.expression),this.interpolationType=i}evaluateWithoutErrorHandling(e,r,n,i,o,a){return this._styleExpression.evaluateWithoutErrorHandling(e,r,n,i,o,a)}evaluate(e,r,n,i,o,a){return this._styleExpression.evaluate(e,r,n,i,o,a)}interpolationFactor(e,r,n){return this.interpolationType?Je.interpolationFactor(this.interpolationType,e,r,n):0}};function Bu(t,e){let r=qt(t,e);if(r.result==="error")return r;let n=r.value.expression,i=Xi(n);if(!i&&!ht(e))return lr([new Be("","data expressions not supported")]);let o=Ki(n,["zoom"]);if(!o&&!Du(e))return lr([new Be("","zoom expressions not supported")]);let a=Ei(n);if(!a&&!o)return lr([new Be("",\'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.\')]);if(a instanceof Be)return lr([a]);if(a instanceof Je&&!hs(e))return lr([new Be("",\'"interpolate" expressions cannot be used with this property\')]);if(!a)return ls(i?new dt("constant",r.value):new dt("source",r.value));let s=a instanceof Je?a.interpolation:void 0;return ls(i?new gt("camera",r.value,a.labels,s):new gt("composite",r.value,a.labels,s))}var sn=class t{constructor(e,r){this._parameters=e,this._specification=r,pr(this,Vu(this._parameters,this._specification))}static deserialize(e){return new t(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}};function zu(t,e){if(Yi(t))return new sn(t,e);if(Gt(t)){let r=Bu(t,e);if(r.result==="error")throw new Error(r.value.map(n=>`${n.key}: ${n.message}`).join(", "));return r.value}else{let r=t;return e.type==="color"&&typeof t=="string"?r=W.parse(t):e.type==="padding"&&(typeof t=="number"||Array.isArray(t))?r=Ze.parse(t):e.type==="variableAnchorOffsetCollection"&&Array.isArray(t)&&(r=Ne.parse(t)),{kind:"constant",evaluate:()=>r}}}function Ei(t){let e=null;if(t instanceof Di)e=Ei(t.result);else if(t instanceof zi){for(let r of t.args)if(e=Ei(r),e)break}else(t instanceof fr||t instanceof Je)&&t.input instanceof Ke&&t.input.name==="zoom"&&(e=t);return e instanceof Be||t.eachChild(r=>{let n=Ei(r);n instanceof Be?e=n:!e&&n?e=new Be("",\'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.\'):e&&n&&e!==n&&(e=new Be("",\'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.\'))}),e}function Bh(t){let e={color:Re,string:G,number:L,enum:G,boolean:U,formatted:hr,padding:Ji,resolvedImage:un,variableAnchorOffsetCollection:Zi};return t.type==="array"?Ee(e[t.value]||$,t.length):e[t.type]}function zh(t){return t.type==="color"&&Yi(t.default)?new W(0,0,0,0):t.type==="color"?W.parse(t.default)||null:t.type==="padding"?Ze.parse(t.default)||null:t.type==="variableAnchorOffsetCollection"?Ne.parse(t.default)||null:t.default===void 0?null:t.default}function ds(t){if(t===!0||t===!1)return!0;if(!Array.isArray(t)||t.length===0)return!1;switch(t[0]){case"has":return t.length>=2&&t[1]!=="$id"&&t[1]!=="$type";case"in":return t.length>=3&&(typeof t[1]!="string"||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return t.length!==3||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(let e of t.slice(1))if(!ds(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}var Rh={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function fn(t){if(t==null)return{filter:()=>!0,needGeometry:!1};ds(t)||(t=qi(t));let e=qt(t,Rh);if(e.result==="error")throw new Error(e.value.map(r=>`${r.key}: ${r.message}`).join(", "));{let r=Ru(t);return{filter:(n,i,o)=>e.value.evaluate(n,i,{},o),needGeometry:r}}}function Oh(t,e){return t<e?-1:t>e?1:0}function Ru(t){if(!Array.isArray(t))return!1;if(t[0]==="within"||t[0]==="distance")return!0;for(let e=1;e<t.length;e++)if(Ru(t[e]))return!0;return!1}function qi(t){if(!t)return!0;let e=t[0];return t.length<=1?e!=="any":e==="=="?Ja(t[1],t[2],"=="):e==="!="?Mi(Ja(t[1],t[2],"==")):e==="<"||e===">"||e==="<="||e===">="?Ja(t[1],t[2],e):e==="any"?Nh(t.slice(1)):e==="all"?["all"].concat(t.slice(1).map(qi)):e==="none"?["all"].concat(t.slice(1).map(qi).map(Mi)):e==="in"?mu(t[1],t.slice(2)):e==="!in"?Mi(mu(t[1],t.slice(2))):e==="has"?hu(t[1]):e==="!has"?Mi(hu(t[1])):!0}function Ja(t,e,r){switch(t){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,t,e]}}function Nh(t){return["any"].concat(t.map(qi))}function mu(t,e){if(e.length===0)return!1;switch(t){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",t,["literal",e.sort(Oh)]]:["filter-in-small",t,["literal",e]]}}function hu(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Mi(t){return["!",t]}function us(t){let e=typeof t;if(e==="number"||e==="boolean"||e==="string"||t===void 0||t===null)return JSON.stringify(t);if(Array.isArray(t)){let i="[";for(let o of t)i+=`${us(o)},`;return`${i}]`}let r=Object.keys(t).sort(),n="{";for(let i=0;i<r.length;i++)n+=`${JSON.stringify(r[i])}:${us(t[r[i]])},`;return`${n}}`}function Uh(t){let e="";for(let r of gm)e+=`/${us(t[r])}`;return e}function Ou(t,e){let r={};for(let i=0;i<t.length;i++){let o=e&&e[t[i].id]||Uh(t[i]);e&&(e[t[i].id]=o);let a=r[o];a||(a=r[o]=[]),a.push(t[i])}let n=[];for(let i in r)n.push(r[i]);return n}function Nu(t){let e=t.key,r=t.value;return r?[new M(e,r,"constants have been deprecated as of v8")]:[]}function ae(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Nt(t){if(Array.isArray(t))return t.map(Nt);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){let e={};for(let r in t)e[r]=Nt(t[r]);return e}return ae(t)}function ze(t){let e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},o=t.style,a=t.styleSpec,s=t.validateSpec,l=[],u=j(r);if(u!=="object")return[new M(e,r,`object expected, ${u} found`)];for(let c in r){let p=c.split(".")[0],f=n[p]||n["*"],y;if(i[p])y=i[p];else if(n[p])y=s;else if(i["*"])y=i["*"];else if(n["*"])y=s;else{l.push(new M(e,r[c],`unknown property "${c}"`));continue}l=l.concat(y({key:(e&&`${e}.`)+c,value:r[c],valueSpec:f,style:o,styleSpec:a,object:r,objectKey:c,validateSpec:s},r))}for(let c in n)i[c]||n[c].required&&n[c].default===void 0&&r[c]===void 0&&l.push(new M(e,r,`missing required property "${c}"`));return l}function gs(t){let e=t.value,r=t.valueSpec,n=t.validateSpec,i=t.style,o=t.styleSpec,a=t.key,s=t.arrayElementValidator||n;if(j(e)!=="array")return[new M(a,e,`array expected, ${j(e)} found`)];if(r.length&&e.length!==r.length)return[new M(a,e,`array length ${r.length} expected, length ${e.length} found`)];if(r["min-length"]&&e.length<r["min-length"])return[new M(a,e,`array length at least ${r["min-length"]} expected, length ${e.length} found`)];let l={type:r.value,values:r.values};o.$version<7&&(l.function=r.function),j(r.value)==="object"&&(l=r.value);let u=[];for(let c=0;c<e.length;c++)u=u.concat(s({array:e,arrayIndex:c,value:e[c],valueSpec:l,validateSpec:t.validateSpec,style:i,styleSpec:o,key:`${a}[${c}]`}));return u}function xs(t){let e=t.key,r=t.value,n=t.valueSpec,i=j(r);return i==="number"&&r!==r&&(i="NaN"),i!=="number"?[new M(e,r,`number expected, ${i} found`)]:"minimum"in n&&r<n.minimum?[new M(e,r,`${r} is less than the minimum value ${n.minimum}`)]:"maximum"in n&&r>n.maximum?[new M(e,r,`${r} is greater than the maximum value ${n.maximum}`)]:[]}function Uu(t){let e=t.valueSpec,r=ae(t.value.type),n,i={},o,a,s=r!=="categorical"&&t.value.property===void 0,l=!s,u=j(t.value.stops)==="array"&&j(t.value.stops[0])==="array"&&j(t.value.stops[0][0])==="object",c=ze({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:p,default:m}});return r==="identity"&&s&&c.push(new M(t.key,t.value,\'missing required property "property"\')),r!=="identity"&&!t.value.stops&&c.push(new M(t.key,t.value,\'missing required property "stops"\')),r==="exponential"&&t.valueSpec.expression&&!hs(t.valueSpec)&&c.push(new M(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!ht(t.valueSpec)?c.push(new M(t.key,t.value,"property functions not supported")):s&&!Du(t.valueSpec)&&c.push(new M(t.key,t.value,"zoom functions not supported"))),(r==="categorical"||u)&&t.value.property===void 0&&c.push(new M(t.key,t.value,\'"property" property is required\')),c;function p(h){if(r==="identity")return[new M(h.key,h.value,\'identity function may not have a "stops" property\')];let d=[],g=h.value;return d=d.concat(gs({key:h.key,value:g,valueSpec:h.valueSpec,validateSpec:h.validateSpec,style:h.style,styleSpec:h.styleSpec,arrayElementValidator:f})),j(g)==="array"&&g.length===0&&d.push(new M(h.key,g,"array must have at least one stop")),d}function f(h){let d=[],g=h.value,b=h.key;if(j(g)!=="array")return[new M(b,g,`array expected, ${j(g)} found`)];if(g.length!==2)return[new M(b,g,`array length 2 expected, length ${g.length} found`)];if(u){if(j(g[0])!=="object")return[new M(b,g,`object expected, ${j(g[0])} found`)];if(g[0].zoom===void 0)return[new M(b,g,"object stop key must have zoom")];if(g[0].value===void 0)return[new M(b,g,"object stop key must have value")];if(a&&a>ae(g[0].zoom))return[new M(b,g[0].zoom,"stop zoom values must appear in ascending order")];ae(g[0].zoom)!==a&&(a=ae(g[0].zoom),o=void 0,i={}),d=d.concat(ze({key:`${b}[0]`,value:g[0],valueSpec:{zoom:{}},validateSpec:h.validateSpec,style:h.style,styleSpec:h.styleSpec,objectElementValidators:{zoom:xs,value:y}}))}else d=d.concat(y({key:`${b}[0]`,value:g[0],valueSpec:{},validateSpec:h.validateSpec,style:h.style,styleSpec:h.styleSpec},g));return Gt(Nt(g[1]))?d.concat([new M(`${b}[1]`,g[1],"expressions are not allowed in function stops.")]):d.concat(h.validateSpec({key:`${b}[1]`,value:g[1],valueSpec:e,validateSpec:h.validateSpec,style:h.style,styleSpec:h.styleSpec}))}function y(h,d){let g=j(h.value),b=ae(h.value),x=h.value!==null?h.value:d;if(!n)n=g;else if(g!==n)return[new M(h.key,x,`${g} stop domain type must match previous stop domain type ${n}`)];if(g!=="number"&&g!=="string"&&g!=="boolean")return[new M(h.key,x,"stop domain value must be a number, string, or boolean")];if(g!=="number"&&r!=="categorical"){let v=`number expected, ${g} found`;return ht(e)&&r===void 0&&(v+=\'\\nIf you intended to use a categorical function, specify `"type": "categorical"`.\'),[new M(h.key,x,v)]}return r==="categorical"&&g==="number"&&(!isFinite(b)||Math.floor(b)!==b)?[new M(h.key,x,`integer expected, found ${b}`)]:r!=="categorical"&&g==="number"&&o!==void 0&&b<o?[new M(h.key,x,"stop domain values must appear in ascending order")]:(o=b,r==="categorical"&&b in i?[new M(h.key,x,"stop domain values must be unique")]:(i[b]=!0,[]))}function m(h){return h.validateSpec({key:h.key,value:h.value,valueSpec:e,validateSpec:h.validateSpec,style:h.style,styleSpec:h.styleSpec})}}function yr(t){let e=(t.expressionContext==="property"?Bu:qt)(Nt(t.value),t.valueSpec);if(e.result==="error")return e.value.map(n=>new M(`${t.key}${n.key}`,t.value,n.message));let r=e.value.expression||e.value._styleExpression.expression;if(t.expressionContext==="property"&&t.propertyKey==="text-font"&&!r.outputDefined())return[new M(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if(t.expressionContext==="property"&&t.propertyType==="layout"&&!an(r))return[new M(t.key,t.value,\'"feature-state" data expressions are not supported with layout properties.\')];if(t.expressionContext==="filter"&&!an(r))return[new M(t.key,t.value,\'"feature-state" data expressions are not supported with filters.\')];if(t.expressionContext&&t.expressionContext.indexOf("cluster")===0){if(!Ki(r,["zoom","feature-state"]))return[new M(t.key,t.value,\'"zoom" and "feature-state" expressions are not supported with cluster properties.\')];if(t.expressionContext==="cluster-initial"&&!Xi(r))return[new M(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function $h(t){let e=t.value,r=t.key,n=j(e);return n!=="boolean"?[new M(r,e,`boolean expected, ${n} found`)]:[]}function Gh(t){let e=t.key,r=t.value,n=j(r);return n!=="string"?[new M(e,r,`color expected, ${n} found`)]:W.parse(String(r))?[]:[new M(e,r,`color expected, "${r}" found`)]}function ln(t){let e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?n.values.indexOf(ae(r))===-1&&i.push(new M(e,r,`expected one of [${n.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(n.values).indexOf(ae(r))===-1&&i.push(new M(e,r,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(r)} found`)),i}function bs(t){return ds(Nt(t.value))?yr(pr({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):$u(t)}function $u(t){let e=t.value,r=t.key;if(j(e)!=="array")return[new M(r,e,`array expected, ${j(e)} found`)];let n=t.styleSpec,i,o=[];if(e.length<1)return[new M(r,e,"filter array must have at least 1 element")];switch(o=o.concat(ln({key:`${r}[0]`,value:e[0],valueSpec:n.filter_operator,style:t.style,styleSpec:t.styleSpec})),ae(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&ae(e[1])==="$type"&&o.push(new M(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&o.push(new M(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(i=j(e[1]),i!=="string"&&o.push(new M(`${r}[1]`,e[1],`string expected, ${i} found`)));for(let a=2;a<e.length;a++)i=j(e[a]),ae(e[1])==="$type"?o=o.concat(ln({key:`${r}[${a}]`,value:e[a],valueSpec:n.geometry_type,style:t.style,styleSpec:t.styleSpec})):i!=="string"&&i!=="number"&&i!=="boolean"&&o.push(new M(`${r}[${a}]`,e[a],`string, number, or boolean expected, ${i} found`));break;case"any":case"all":case"none":for(let a=1;a<e.length;a++)o=o.concat($u({key:`${r}[${a}]`,value:e[a],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":i=j(e[1]),e.length!==2?o.push(new M(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):i!=="string"&&o.push(new M(`${r}[1]`,e[1],`string expected, ${i} found`));break}return o}function Gu(t,e){let r=t.key,n=t.validateSpec,i=t.style,o=t.styleSpec,a=t.value,s=t.objectKey,l=o[`${e}_${t.layerType}`];if(!l)return[];let u=s.match(/^(.*)-transition$/);if(e==="paint"&&u&&l[u[1]]&&l[u[1]].transition)return n({key:r,value:a,valueSpec:o.transition,style:i,styleSpec:o});let c=t.valueSpec||l[s];if(!c)return[new M(r,a,`unknown property "${s}"`)];let p;if(j(a)==="string"&&ht(c)&&!c.tokens&&(p=/^{([^}]+)}$/.exec(a)))return[new M(r,a,`"${s}" does not support interpolation syntax\nUse an identity property function instead: \\`{ "type": "identity", "property": ${JSON.stringify(p[1])} }\\`.`)];let f=[];return t.layerType==="symbol"&&(s==="text-field"&&i&&!i.glyphs&&f.push(new M(r,a,\'use of "text-field" requires a style "glyphs" property\')),s==="text-font"&&Yi(Nt(a))&&ae(a.type)==="identity"&&f.push(new M(r,a,\'"text-font" does not support identity functions\'))),f.concat(n({key:t.key,value:a,valueSpec:c,style:i,styleSpec:o,expressionContext:"property",propertyType:e,propertyKey:s}))}function qu(t){return Gu(t,"paint")}function ju(t){return Gu(t,"layout")}function Ju(t){let e=[],r=t.value,n=t.key,i=t.style,o=t.styleSpec;!r.type&&!r.ref&&e.push(new M(n,r,\'either "type" or "ref" is required\'));let a=ae(r.type),s=ae(r.ref);if(r.id){let l=ae(r.id);for(let u=0;u<t.arrayIndex;u++){let c=i.layers[u];ae(c.id)===l&&e.push(new M(n,r.id,`duplicate layer id "${r.id}", previously used at line ${c.id.__line__}`))}}if("ref"in r){["type","source","source-layer","filter","layout"].forEach(u=>{u in r&&e.push(new M(n,r[u],`"${u}" is prohibited for ref layers`))});let l;i.layers.forEach(u=>{ae(u.id)===s&&(l=u)}),l?l.ref?e.push(new M(n,r.ref,"ref cannot reference another ref layer")):a=ae(l.type):e.push(new M(n,r.ref,`ref layer "${s}" not found`))}else if(a!=="background")if(!r.source)e.push(new M(n,r,\'missing required property "source"\'));else{let l=i.sources&&i.sources[r.source],u=l&&ae(l.type);l?u==="vector"&&a==="raster"?e.push(new M(n,r.source,`layer "${r.id}" requires a raster source`)):u!=="raster-dem"&&a==="hillshade"?e.push(new M(n,r.source,`layer "${r.id}" requires a raster-dem source`)):u==="raster"&&a!=="raster"?e.push(new M(n,r.source,`layer "${r.id}" requires a vector source`)):u==="vector"&&!r["source-layer"]?e.push(new M(n,r,`layer "${r.id}" must specify a "source-layer"`)):u==="raster-dem"&&a!=="hillshade"?e.push(new M(n,r.source,"raster-dem source can only be used with layer type \'hillshade\'.")):a==="line"&&r.paint&&r.paint["line-gradient"]&&(u!=="geojson"||!l.lineMetrics)&&e.push(new M(n,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \\`lineMetrics\\` enabled.`)):e.push(new M(n,r.source,`source "${r.source}" not found`))}return e=e.concat(ze({key:n,value:r,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*"(){return[]},type(){return t.validateSpec({key:`${n}.type`,value:r.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:r,objectKey:"type"})},filter:bs,layout(l){return ze({layer:r,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*"(u){return ju(pr({layerType:a},u))}}})},paint(l){return ze({layer:r,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*"(u){return qu(pr({layerType:a},u))}}})}}})),e}function Ut(t){let e=t.value,r=t.key,n=j(e);return n!=="string"?[new M(r,e,`string expected, ${n} found`)]:[]}function qh(t){var e;let r=(e=t.sourceName)!==null&&e!==void 0?e:"",n=t.value,i=t.styleSpec,o=i.source_raster_dem,a=t.style,s=[],l=j(n);if(n===void 0)return s;if(l!=="object")return s.push(new M("source_raster_dem",n,`object expected, ${l} found`)),s;let c=ae(n.encoding)==="custom",p=["redFactor","greenFactor","blueFactor","baseShift"],f=t.value.encoding?`"${t.value.encoding}"`:"Default";for(let y in n)!c&&p.includes(y)?s.push(new M(y,n[y],`In "${r}": "${y}" is only valid when "encoding" is set to "custom". ${f} encoding found`)):o[y]?s=s.concat(t.validateSpec({key:y,value:n[y],valueSpec:o[y],validateSpec:t.validateSpec,style:a,styleSpec:i})):s.push(new M(y,n[y],`unknown property "${y}"`));return s}var du={promoteId:jh};function Zu(t){let e=t.value,r=t.key,n=t.styleSpec,i=t.style,o=t.validateSpec;if(!e.type)return[new M(r,e,\'"type" is required\')];let a=ae(e.type),s;switch(a){case"vector":case"raster":return s=ze({key:r,value:e,valueSpec:n[`source_${a.replace("-","_")}`],style:t.style,styleSpec:n,objectElementValidators:du,validateSpec:o}),s;case"raster-dem":return s=qh({sourceName:r,value:e,style:t.style,styleSpec:n,validateSpec:o}),s;case"geojson":if(s=ze({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n,validateSpec:o,objectElementValidators:du}),e.cluster)for(let l in e.clusterProperties){let[u,c]=e.clusterProperties[l],p=typeof u=="string"?[u,["accumulated"],["get",l]]:u;s.push(...yr({key:`${r}.${l}.map`,value:c,validateSpec:o,expressionContext:"cluster-map"})),s.push(...yr({key:`${r}.${l}.reduce`,value:p,validateSpec:o,expressionContext:"cluster-reduce"}))}return s;case"video":return ze({key:r,value:e,valueSpec:n.source_video,style:i,validateSpec:o,styleSpec:n});case"image":return ze({key:r,value:e,valueSpec:n.source_image,style:i,validateSpec:o,styleSpec:n});case"canvas":return[new M(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return ln({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,validateSpec:o,styleSpec:n})}}function jh({key:t,value:e}){if(j(e)==="string")return Ut({key:t,value:e});{let r=[];for(let n in e)r.push(...Ut({key:`${t}.${n}`,value:e[n]}));return r}}function Wu(t){let e=t.value,r=t.styleSpec,n=r.light,i=t.style,o=[],a=j(e);if(e===void 0)return o;if(a!=="object")return o=o.concat([new M("light",e,`object expected, ${a} found`)]),o;for(let s in e){let l=s.match(/^(.*)-transition$/);l&&n[l[1]]&&n[l[1]].transition?o=o.concat(t.validateSpec({key:s,value:e[s],valueSpec:r.transition,validateSpec:t.validateSpec,style:i,styleSpec:r})):n[s]?o=o.concat(t.validateSpec({key:s,value:e[s],valueSpec:n[s],validateSpec:t.validateSpec,style:i,styleSpec:r})):o=o.concat([new M(s,e[s],`unknown property "${s}"`)])}return o}function Hu(t){let e=t.value,r=t.styleSpec,n=r.sky,i=t.style,o=j(e);if(e===void 0)return[];if(o!=="object")return[new M("sky",e,`object expected, ${o} found`)];let a=[];for(let s in e)n[s]?a=a.concat(t.validateSpec({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:r})):a=a.concat([new M(s,e[s],`unknown property "${s}"`)]);return a}function Xu(t){let e=t.value,r=t.styleSpec,n=r.terrain,i=t.style,o=[],a=j(e);if(e===void 0)return o;if(a!=="object")return o=o.concat([new M("terrain",e,`object expected, ${a} found`)]),o;for(let s in e)n[s]?o=o.concat(t.validateSpec({key:s,value:e[s],valueSpec:n[s],validateSpec:t.validateSpec,style:i,styleSpec:r})):o=o.concat([new M(s,e[s],`unknown property "${s}"`)]);return o}function Jh(t){return Ut(t).length===0?[]:yr(t)}function Zh(t){return Ut(t).length===0?[]:yr(t)}function Wh(t){let e=t.key,r=t.value;if(j(r)==="array"){if(r.length<1||r.length>4)return[new M(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];let i={type:"number"},o=[];for(let a=0;a<r.length;a++)o=o.concat(t.validateSpec({key:`${e}[${a}]`,value:r[a],validateSpec:t.validateSpec,valueSpec:i}));return o}else return xs({key:e,value:r,valueSpec:{}})}function Hh(t){let e=t.key,r=t.value,n=j(r),i=t.styleSpec;if(n!=="array"||r.length<1||r.length%2!==0)return[new M(e,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let o=[];for(let a=0;a<r.length;a+=2)o=o.concat(ln({key:`${e}[${a}]`,value:r[a],valueSpec:i.layout_symbol["text-anchor"]})),o=o.concat(gs({key:`${e}[${a+1}]`,value:r[a+1],valueSpec:{length:2,value:"number"},validateSpec:t.validateSpec,style:t.style,styleSpec:i}));return o}function Ku(t){let e=[],r=t.value,n=t.key;if(Array.isArray(r)){let i=[],o=[];for(let a in r){r[a].id&&i.includes(r[a].id)&&e.push(new M(n,r,`all the sprites\' ids must be unique, but ${r[a].id} is duplicated`)),i.push(r[a].id),r[a].url&&o.includes(r[a].url)&&e.push(new M(n,r,`all the sprites\' URLs must be unique, but ${r[a].url} is duplicated`)),o.push(r[a].url);let s={id:{type:"string",required:!0},url:{type:"string",required:!0}};e=e.concat(ze({key:`${n}[${a}]`,value:r[a],valueSpec:s,validateSpec:t.validateSpec}))}return e}else return Ut({key:n,value:r})}function Xh(t){let e=t.value,r=t.styleSpec,n=r.projection,i=t.style,o=j(e);if(e===void 0)return[];if(o!=="object")return[new M("projection",e,`object expected, ${o} found`)];let a=[];for(let s in e)n[s]?a=a.concat(t.validateSpec({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:r})):a=a.concat([new M(s,e[s],`unknown property "${s}"`)]);return a}var gu={"*"(){return[]},array:gs,boolean:$h,number:xs,color:Gh,constants:Nu,enum:ln,filter:bs,function:Uu,layer:Ju,object:ze,source:Zu,light:Wu,sky:Hu,terrain:Xu,projection:Xh,string:Ut,formatted:Jh,resolvedImage:Zh,padding:Wh,variableAnchorOffsetCollection:Hh,sprite:Ku};function Hr(t){let e=t.value,r=t.valueSpec,n=t.styleSpec;return t.validateSpec=Hr,r.expression&&Yi(ae(e))?Uu(t):r.expression&&Gt(Nt(e))?yr(t):r.type&&gu[r.type]?gu[r.type](t):ze(pr({},t,{valueSpec:r.type?n[r.type]:r}))}function Yu(t){let e=t.value,r=t.key,n=Ut(t);return n.length||(e.indexOf("{fontstack}")===-1&&n.push(new M(r,e,\'"glyphs" url must include a "{fontstack}" token\')),e.indexOf("{range}")===-1&&n.push(new M(r,e,\'"glyphs" url must include a "{range}" token\'))),n}function Ue(t,e=S){let r=[];return r=r.concat(Hr({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,validateSpec:Hr,objectElementValidators:{glyphs:Yu,"*"(){return[]}}})),t.constants&&(r=r.concat(Nu({key:"constants",value:t.constants,style:t,styleSpec:e,validateSpec:Hr}))),Qu(r)}Ue.source=Qe(Ye(Zu));Ue.sprite=Qe(Ye(Ku));Ue.glyphs=Qe(Ye(Yu));Ue.light=Qe(Ye(Wu));Ue.sky=Qe(Ye(Hu));Ue.terrain=Qe(Ye(Xu));Ue.layer=Qe(Ye(Ju));Ue.filter=Qe(Ye(bs));Ue.paintProperty=Qe(Ye(qu));Ue.layoutProperty=Qe(Ye(ju));function Ye(t){return function(e){return t({...e,validateSpec:Hr})}}function Qu(t){return[].concat(t).sort((e,r)=>e.line-r.line)}function Qe(t){return function(...e){return Qu(t.apply(this,e))}}var ec="AbortError";function tc(t){return t.message===ec}function vs(){return new Error(ec)}var Qi={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function rc(t){return Qi.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf("://"))]}function nc(t,e){Qi.REGISTERED_PROTOCOLS[t]=e}function ic(t){delete Qi.REGISTERED_PROTOCOLS[t]}var oc="global-dispatcher",xr=class extends Error{constructor(e,r,n,i){super(`AJAXError: ${r} (${e}): ${n}`),this.status=e,this.statusText=r,this.url=n,this.body=i}},sc=()=>at(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,Kh=t=>/^file:/.test(t)||/^file:/.test(sc())&&!/^\\w+:/.test(t);async function Yh(t,e){let r=new Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:sc(),signal:e.signal});t.type==="json"&&r.headers.set("Accept","application/json");let n=await fetch(r);if(!n.ok){let a=await n.blob();throw new xr(n.status,n.statusText,t.url,a)}let i;t.type==="arrayBuffer"||t.type==="image"?i=n.arrayBuffer():t.type==="json"?i=n.json():i=n.text();let o=await i;if(e.signal.aborted)throw vs();return{data:o,cacheControl:n.headers.get("Cache-Control"),expires:n.headers.get("Expires")}}function Qh(t,e){return new Promise((r,n)=>{let i=new XMLHttpRequest;i.open(t.method||"GET",t.url,!0),(t.type==="arrayBuffer"||t.type==="image")&&(i.responseType="arraybuffer");for(let o in t.headers)i.setRequestHeader(o,t.headers[o]);t.type==="json"&&(i.responseType="text",i.setRequestHeader("Accept","application/json")),i.withCredentials=t.credentials==="include",i.onerror=()=>{n(new Error(i.statusText))},i.onload=()=>{if(!e.signal.aborted)if((i.status>=200&&i.status<300||i.status===0)&&i.response!==null){let o=i.response;if(t.type==="json")try{o=JSON.parse(i.response)}catch(a){n(a);return}r({data:o,cacheControl:i.getResponseHeader("Cache-Control"),expires:i.getResponseHeader("Expires")})}else{let o=new Blob([i.response],{type:i.getResponseHeader("Content-Type")});n(new xr(i.status,i.statusText,t.url,o))}},e.signal.addEventListener("abort",()=>{i.abort(),n(vs())}),i.send(t.body)})}var lc=function(t,e){if(/:\\/\\//.test(t.url)&&!/^https?:|^file:/.test(t.url)){let r=rc(t.url);if(r)return r(t,e);if(at(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,targetMapId:oc},e)}if(!Kh(t.url)){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return Yh(t,e);if(at(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,mustQueue:!0,targetMapId:oc},e)}return Qh(t,e)},uc=(t,e)=>lc(Pe(t,{type:"json"}),e),cc=(t,e)=>lc(Pe(t,{type:"arrayBuffer"}),e);var xt={};function C(t,e,r={}){if(xt[t])throw new Error(`${t} is already registered.`);Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),xt[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}C("Object",Object);C("TransferableGridIndex",Dt);C("Color",W);C("Error",Error);C("AJAXError",xr);C("ResolvedImage",Te);C("StylePropertyFunction",sn);C("StyleExpression",Ot,{omit:["_evaluator"]});C("ZoomDependentExpression",gt);C("ZoomConstantExpression",dt);C("CompoundExpression",Ke,{omit:["_evaluate"]});for(let t in $t)$t[t]._classRegistryKey||C(`Expression_${t}`,$t[t]);function pc(t){return t&&typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||t.constructor&&t.constructor.name==="ArrayBuffer")}function br(t,e){if(t==null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof Blob||t instanceof Error)return t;if(pc(t)||jr(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){let r=t;return e&&e.push(r.buffer),r}if(t instanceof ImageData)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){let r=[];for(let n of t)r.push(br(n,e));return r}if(typeof t=="object"){let r=t.constructor,n=r._classRegistryKey;if(!n)throw new Error(`can\'t serialize object of unregistered class ${r.name}`);if(!xt[n])throw new Error(`${n} is not registered.`);let i=r.serialize?r.serialize(t,e):{};if(r.serialize){if(e&&i===e[e.length-1])throw new Error("statically serialized object won\'t survive transfer of $name property")}else{for(let o in t){if(!t.hasOwnProperty(o)||xt[n].omit.indexOf(o)>=0)continue;let a=t[o];i[o]=xt[n].shallow.indexOf(o)>=0?a:br(a,e)}t instanceof Error&&(i.message=t.message)}if(i.$name)throw new Error("$name property is reserved for worker serialization logic.");return n!=="Object"&&(i.$name=n),i}throw new Error(`can\'t serialize object of type ${typeof t}`)}function vr(t){if(t==null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof Blob||t instanceof Error||pc(t)||jr(t)||ArrayBuffer.isView(t)||t instanceof ImageData)return t;if(Array.isArray(t))return t.map(vr);if(typeof t=="object"){let e=t.$name||"Object";if(!xt[e])throw new Error(`can\'t deserialize unregistered class ${e}`);let{klass:r}=xt[e];if(!r)throw new Error(`can\'t deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(t);let n=Object.create(r.prototype);for(let i of Object.keys(t)){if(i==="$name")continue;let o=t[i];n[i]=xt[e].shallow.indexOf(i)>=0?o:vr(o)}return n}throw new Error(`can\'t deserialize object of type ${typeof t}`)}var eo=class{constructor(e){this._methodToThrottle=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}};var to=class{constructor(e,r){this.target=e,this.mapId=r,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new eo(()=>this.process()),this.subscription=Xl(this.target,"message",n=>this.receive(n),!1),this.globalScope=at(self)?e:window}registerMessageHandler(e,r){this.messageHandlers[e]=r}sendAsync(e,r){return new Promise((n,i)=>{let o=Math.round(Math.random()*1e18).toString(36).substring(0,10);this.resolveRejects[o]={resolve:n,reject:i},r&&r.signal.addEventListener("abort",()=>{delete this.resolveRejects[o];let l={id:o,type:"<cancel>",origin:location.origin,targetMapId:e.targetMapId,sourceMapId:this.mapId};this.target.postMessage(l)},{once:!0});let a=[],s={...e,id:o,sourceMapId:this.mapId,origin:location.origin,data:br(e.data,a)};this.target.postMessage(s,{transfer:a})})}receive(e){let r=e.data,n=r.id;if(!(r.origin!=="file://"&&location.origin!=="file://"&&r.origin!==location.origin)&&!(r.targetMapId&&this.mapId!==r.targetMapId)){if(r.type==="<cancel>"){delete this.tasks[n];let i=this.abortControllers[n];delete this.abortControllers[n],i&&i.abort();return}if(at(self)||r.mustQueue){this.tasks[n]=r,this.taskQueue.push(n),this.invoker.trigger();return}this.processTask(n,r)}}process(){if(this.taskQueue.length===0)return;let e=this.taskQueue.shift(),r=this.tasks[e];delete this.tasks[e],this.taskQueue.length>0&&this.invoker.trigger(),r&&this.processTask(e,r)}async processTask(e,r){if(r.type==="<response>"){let o=this.resolveRejects[e];if(delete this.resolveRejects[e],!o)return;r.error?o.reject(vr(r.error)):o.resolve(vr(r.data));return}if(!this.messageHandlers[r.type]){this.completeTask(e,new Error(`Could not find a registered handler for ${r.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));return}let n=vr(r.data),i=new AbortController;this.abortControllers[e]=i;try{let o=await this.messageHandlers[r.type](r.sourceMapId,n,i);this.completeTask(e,null,o)}catch(o){this.completeTask(e,o)}}completeTask(e,r,n){let i=[];delete this.abortControllers[e];let o={id:e,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:r?br(r):null,data:br(n,i)};this.target.postMessage(o,{transfer:i})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}};function fc(t,e,r){r[t]&&r[t].indexOf(e)!==-1||(r[t]=r[t]||[],r[t].push(e))}function Ps(t,e,r){if(r&&r[t]){let n=r[t].indexOf(e);n!==-1&&r[t].splice(n,1)}}var ro=class{constructor(e,r={}){Pe(this,r),this.type=e}},yn=class extends ro{constructor(e,r={}){super("error",Pe({error:e},r))}},no=class{on(e,r){return this._listeners=this._listeners||{},fc(e,r,this._listeners),this}off(e,r){return Ps(e,r,this._listeners),Ps(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},fc(e,r,this._oneTimeListeners),this):new Promise(n=>this.once(e,n))}fire(e,r){typeof e=="string"&&(e=new ro(e,r||{}));let n=e.type;if(this.listens(n)){e.target=this;let i=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];for(let s of i)s.call(this,e);let o=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];for(let s of o)Ps(n,s,this._oneTimeListeners),s.call(this,e);let a=this._eventedParent;a&&(Pe(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),a.fire(e))}else e instanceof yn&&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 bt=Ue,J0=bt.source,Z0=bt.light,W0=bt.terrain,H0=bt.filter,yc=bt.paintProperty,mc=bt.layoutProperty;function hc(t,e){let r=!1;if(e&&e.length)for(let n of e)t.fire(new yn(new Error(n.message))),r=!0;return r}var io=class{constructor(){this.first=!0}update(e,r){let n=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=n,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=n,!0):(this.lastFloorZoom>n?(this.lastIntegerZoom=n+1,this.lastIntegerZoomTime=r):this.lastFloorZoom<n&&(this.lastIntegerZoom=n,this.lastIntegerZoomTime=r),e!==this.lastZoom?(this.lastZoom=e,this.lastFloorZoom=n,!0):!1)}};var D={"Latin-1 Supplement":t=>t>=128&&t<=255,Arabic:t=>t>=1536&&t<=1791,"Arabic Supplement":t=>t>=1872&&t<=1919,"Arabic Extended-A":t=>t>=2208&&t<=2303,"Hangul Jamo":t=>t>=4352&&t<=4607,"Unified Canadian Aboriginal Syllabics":t=>t>=5120&&t<=5759,Khmer:t=>t>=6016&&t<=6143,"Unified Canadian Aboriginal Syllabics Extended":t=>t>=6320&&t<=6399,"General Punctuation":t=>t>=8192&&t<=8303,"Letterlike Symbols":t=>t>=8448&&t<=8527,"Number Forms":t=>t>=8528&&t<=8591,"Miscellaneous Technical":t=>t>=8960&&t<=9215,"Control Pictures":t=>t>=9216&&t<=9279,"Optical Character Recognition":t=>t>=9280&&t<=9311,"Enclosed Alphanumerics":t=>t>=9312&&t<=9471,"Geometric Shapes":t=>t>=9632&&t<=9727,"Miscellaneous Symbols":t=>t>=9728&&t<=9983,"Miscellaneous Symbols and Arrows":t=>t>=11008&&t<=11263,"CJK Radicals Supplement":t=>t>=11904&&t<=12031,"Kangxi Radicals":t=>t>=12032&&t<=12255,"Ideographic Description Characters":t=>t>=12272&&t<=12287,"CJK Symbols and Punctuation":t=>t>=12288&&t<=12351,Hiragana:t=>t>=12352&&t<=12447,Katakana:t=>t>=12448&&t<=12543,Bopomofo:t=>t>=12544&&t<=12591,"Hangul Compatibility Jamo":t=>t>=12592&&t<=12687,Kanbun:t=>t>=12688&&t<=12703,"Bopomofo Extended":t=>t>=12704&&t<=12735,"CJK Strokes":t=>t>=12736&&t<=12783,"Katakana Phonetic Extensions":t=>t>=12784&&t<=12799,"Enclosed CJK Letters and Months":t=>t>=12800&&t<=13055,"CJK Compatibility":t=>t>=13056&&t<=13311,"CJK Unified Ideographs Extension A":t=>t>=13312&&t<=19903,"Yijing Hexagram Symbols":t=>t>=19904&&t<=19967,"CJK Unified Ideographs":t=>t>=19968&&t<=40959,"Yi Syllables":t=>t>=40960&&t<=42127,"Yi Radicals":t=>t>=42128&&t<=42191,"Hangul Jamo Extended-A":t=>t>=43360&&t<=43391,"Hangul Syllables":t=>t>=44032&&t<=55215,"Hangul Jamo Extended-B":t=>t>=55216&&t<=55295,"Private Use Area":t=>t>=57344&&t<=63743,"CJK Compatibility Ideographs":t=>t>=63744&&t<=64255,"Arabic Presentation Forms-A":t=>t>=64336&&t<=65023,"Vertical Forms":t=>t>=65040&&t<=65055,"CJK Compatibility Forms":t=>t>=65072&&t<=65103,"Small Form Variants":t=>t>=65104&&t<=65135,"Arabic Presentation Forms-B":t=>t>=65136&&t<=65279,"Halfwidth and Fullwidth Forms":t=>t>=65280&&t<=65519};function mn(t){for(let e of t)if(oo(e.charCodeAt(0)))return!0;return!1}function dc(t){for(let e of t)if(!ed(e.charCodeAt(0)))return!1;return!0}function ed(t){return!(D.Arabic(t)||D["Arabic Supplement"](t)||D["Arabic Extended-A"](t)||D["Arabic Presentation Forms-A"](t)||D["Arabic Presentation Forms-B"](t))}function gc(t){return t<11904?!1:!!(D["Bopomofo Extended"](t)||D.Bopomofo(t)||D["CJK Compatibility Forms"](t)||D["CJK Compatibility Ideographs"](t)||D["CJK Compatibility"](t)||D["CJK Radicals Supplement"](t)||D["CJK Strokes"](t)||D["CJK Symbols and Punctuation"](t)||D["CJK Unified Ideographs Extension A"](t)||D["CJK Unified Ideographs"](t)||D["Enclosed CJK Letters and Months"](t)||D["Halfwidth and Fullwidth Forms"](t)||D.Hiragana(t)||D["Ideographic Description Characters"](t)||D["Kangxi Radicals"](t)||D["Katakana Phonetic Extensions"](t)||D.Katakana(t)||D["Vertical Forms"](t)||D["Yi Radicals"](t)||D["Yi Syllables"](t))}function oo(t){return t===746||t===747?!0:t<4352?!1:!!(D["Bopomofo Extended"](t)||D.Bopomofo(t)||D["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||D["CJK Compatibility Ideographs"](t)||D["CJK Compatibility"](t)||D["CJK Radicals Supplement"](t)||D["CJK Strokes"](t)||D["CJK Symbols and Punctuation"](t)&&!(t>=12296&&t<=12305)&&!(t>=12308&&t<=12319)&&t!==12336||D["CJK Unified Ideographs Extension A"](t)||D["CJK Unified Ideographs"](t)||D["Enclosed CJK Letters and Months"](t)||D["Hangul Compatibility Jamo"](t)||D["Hangul Jamo Extended-A"](t)||D["Hangul Jamo Extended-B"](t)||D["Hangul Jamo"](t)||D["Hangul Syllables"](t)||D.Hiragana(t)||D["Ideographic Description Characters"](t)||D.Kanbun(t)||D["Kangxi Radicals"](t)||D["Katakana Phonetic Extensions"](t)||D.Katakana(t)&&t!==12540||D["Halfwidth and Fullwidth Forms"](t)&&t!==65288&&t!==65289&&t!==65293&&!(t>=65306&&t<=65310)&&t!==65339&&t!==65341&&t!==65343&&!(t>=65371&&t<=65503)&&t!==65507&&!(t>=65512&&t<=65519)||D["Small Form Variants"](t)&&!(t>=65112&&t<=65118)&&!(t>=65123&&t<=65126)||D["Unified Canadian Aboriginal Syllabics"](t)||D["Unified Canadian Aboriginal Syllabics Extended"](t)||D["Vertical Forms"](t)||D["Yijing Hexagram Symbols"](t)||D["Yi Syllables"](t)||D["Yi Radicals"](t))}function td(t){return!!(D["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||D["General Punctuation"](t)&&(t===8214||t===8224||t===8225||t===8240||t===8241||t===8251||t===8252||t===8258||t===8263||t===8264||t===8265||t===8273)||D["Letterlike Symbols"](t)||D["Number Forms"](t)||D["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||t===9003||t>=9085&&t<=9114||t>=9150&&t<=9165||t===9167||t>=9169&&t<=9179||t>=9186&&t<=9215)||D["Control Pictures"](t)&&t!==9251||D["Optical Character Recognition"](t)||D["Enclosed Alphanumerics"](t)||D["Geometric Shapes"](t)||D["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||D["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||D["CJK Symbols and Punctuation"](t)||D.Katakana(t)||D["Private Use Area"](t)||D["CJK Compatibility Forms"](t)||D["Small Form Variants"](t)||D["Halfwidth and Fullwidth Forms"](t)||t===8734||t===8756||t===8757||t>=9984&&t<=10087||t>=10102&&t<=10131||t===65532||t===65533)}function Ss(t){return!(oo(t)||td(t))}function xc(t){return D.Arabic(t)||D["Arabic Supplement"](t)||D["Arabic Extended-A"](t)||D["Arabic Presentation Forms-A"](t)||D["Arabic Presentation Forms-B"](t)}function bc(t){return t>=1424&&t<=2303||D["Arabic Presentation Forms-A"](t)||D["Arabic Presentation Forms-B"](t)}function rd(t,e){return!(!e&&bc(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||D.Khmer(t))}function vc(t){for(let e of t)if(bc(e.charCodeAt(0)))return!0;return!1}function Pc(t,e){for(let r of t)if(!rd(r.charCodeAt(0),e))return!1;return!0}var ws=class{constructor(){this.applyArabicShaping=null;this.processBidirectionalText=null;this.processStyledBidirectionalText=null;this.pluginStatus="unavailable";this.pluginURL=null}setState(e){this.pluginStatus=e.pluginStatus,this.pluginURL=e.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(e){this.applyArabicShaping=e.applyArabicShaping,this.processBidirectionalText=e.processBidirectionalText,this.processStyledBidirectionalText=e.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}},ye=new ws;var q=class{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 io,this.transition={})}isSupportedScript(e){return Pc(e,ye.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let e=this.zoom,r=e-Math.floor(e),n=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*n}:{fromScale:.5,toScale:1,t:1-(1-n)*r}}};var Pr=class{constructor(e,r){this.property=e,this.value=r,this.expression=zu(r===void 0?e.specification.default:r,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,r,n){return this.property.possiblyEvaluate(this,e,r,n)}},hn=class{constructor(e){this.property=e,this.value=new Pr(e,void 0)}transitioned(e,r){return new so(this.property,this.value,r,Pe({},e.transition,this.transition),e.now)}untransitioned(){return new so(this.property,this.value,null,{},0)}},ao=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return nt(this._values[e].value.value)}setValue(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new hn(this._values[e].property)),this._values[e].value=new Pr(this._values[e].property,r===null?void 0:nt(r))}getTransition(e){return nt(this._values[e].transition)}setTransition(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new hn(this._values[e].property)),this._values[e].transition=nt(r)||void 0}serialize(){let e={};for(let r of Object.keys(this._values)){let n=this.getValue(r);n!==void 0&&(e[r]=n);let i=this.getTransition(r);i!==void 0&&(e[`${r}-transition`]=i)}return e}transitioned(e,r){let n=new lo(this._properties);for(let i of Object.keys(this._values))n._values[i]=this._values[i].transitioned(e,r._values[i]);return n}untransitioned(){let e=new lo(this._properties);for(let r of Object.keys(this._values))e._values[r]=this._values[r].untransitioned();return e}},so=class{constructor(e,r,n,i,o){this.property=e,this.value=r,this.begin=o+i.delay||0,this.end=this.begin+i.duration||0,e.specification.transition&&(i.delay||i.duration)&&(this.prior=n)}possiblyEvaluate(e,r,n){let i=e.now||0,o=this.value.possiblyEvaluate(e,r,n),a=this.prior;if(a){if(i>this.end)return this.prior=null,o;if(this.value.isDataDriven())return this.prior=null,o;if(i<this.begin)return a.possiblyEvaluate(e,r,n);{let s=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(e,r,n),o,Gl(s))}}else return o}},lo=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,r,n){let i=new vt(this._properties);for(let o of Object.keys(this._values))i._values[o]=this._values[o].possiblyEvaluate(e,r,n);return i}hasTransition(){for(let e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}},uo=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}hasValue(e){return this._values[e].value!==void 0}getValue(e){return nt(this._values[e].value)}setValue(e,r){this._values[e]=new Pr(this._values[e].property,r===null?void 0:nt(r))}serialize(){let e={};for(let r of Object.keys(this._values)){let n=this.getValue(r);n!==void 0&&(e[r]=n)}return e}possiblyEvaluate(e,r,n){let i=new vt(this._properties);for(let o of Object.keys(this._values))i._values[o]=this._values[o].possiblyEvaluate(e,r,n);return i}},Se=class{constructor(e,r,n){this.property=e,this.value=r,this.parameters=n}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,r,n,i){return this.property.evaluate(this.value,this.parameters,e,r,n,i)}},vt=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}},B=class{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,n){let i=this.specification.type,o=Oe[i];return o?o(e,r,n):e}},R=class{constructor(e,r){this.specification=e,this.overrides=r}possiblyEvaluate(e,r,n,i){return e.expression.kind==="constant"||e.expression.kind==="camera"?new Se(this,{kind:"constant",value:e.expression.evaluate(r,null,{},n,i)},r):new Se(this,e.expression,r)}interpolate(e,r,n){if(e.value.kind!=="constant"||r.value.kind!=="constant")return e;if(e.value.value===void 0||r.value.value===void 0)return new Se(this,{kind:"constant",value:void 0},e.parameters);let i=this.specification.type,o=Oe[i];if(o){let a=o(e.value.value,r.value.value,n);return new Se(this,{kind:"constant",value:a},e.parameters)}else return e}evaluate(e,r,n,i,o,a){return e.kind==="constant"?e.value:e.evaluate(r,n,i,o,a)}},lt=class extends R{possiblyEvaluate(e,r,n,i){if(e.value===void 0)return new Se(this,{kind:"constant",value:void 0},r);if(e.expression.kind==="constant"){let o=e.expression.evaluate(r,null,{},n,i),s=e.property.specification.type==="resolvedImage"&&typeof o!="string"?o.name:o,l=this._calculate(s,s,s,r);return new Se(this,{kind:"constant",value:l},r)}else if(e.expression.kind==="camera"){let o=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 Se(this,{kind:"constant",value:o},r)}else return new Se(this,e.expression,r)}evaluate(e,r,n,i,o,a){if(e.kind==="source"){let s=e.evaluate(r,n,i,o,a);return this._calculate(s,s,s,r)}else return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(r.zoom)-1},n,i),e.evaluate({zoom:Math.floor(r.zoom)},n,i),e.evaluate({zoom:Math.floor(r.zoom)+1},n,i),r):e.value}_calculate(e,r,n,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:n,to:r}}interpolate(e){return e}},jt=class{constructor(e){this.specification=e}possiblyEvaluate(e,r,n,i){if(e.value!==void 0)if(e.expression.kind==="constant"){let o=e.expression.evaluate(r,null,{},n,i);return this._calculate(o,o,o,r)}else return this._calculate(e.expression.evaluate(new q(Math.floor(r.zoom-1),r)),e.expression.evaluate(new q(Math.floor(r.zoom),r)),e.expression.evaluate(new q(Math.floor(r.zoom+1),r)),r)}_calculate(e,r,n,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:n,to:r}}interpolate(e){return e}},Jt=class{constructor(e){this.specification=e}possiblyEvaluate(e,r,n,i){return!!e.expression.evaluate(r,null,{},n,i)}interpolate(){return!1}},re=class{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let r in e){let n=e[r];n.specification.overridable&&this.overridableProperties.push(r);let i=this.defaultPropertyValues[r]=new Pr(n,void 0),o=this.defaultTransitionablePropertyValues[r]=new hn(n);this.defaultTransitioningPropertyValues[r]=o.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=i.possiblyEvaluate({})}}};C("DataDrivenProperty",R);C("DataConstantProperty",B);C("CrossFadedDataDrivenProperty",lt);C("CrossFadedProperty",jt);C("ColorRampProperty",Jt);var co="-transition",se=class extends no{constructor(e,r){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1},e.type!=="custom"&&(e=e,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 uo(r.layout)),r.paint)){this._transitionablePaint=new ao(r.paint);for(let n in e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(let n in e.layout)this.setLayoutProperty(n,e.layout[n],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new vt(r.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,r,n={}){if(r!=null){let i=`layers.${this.id}.layout.${e}`;if(this._validate(mc,i,e,r,n))return}if(e==="visibility"){this.visibility=r;return}this._unevaluatedLayout.setValue(e,r)}getPaintProperty(e){return e.endsWith(co)?this._transitionablePaint.getTransition(e.slice(0,-co.length)):this._transitionablePaint.getValue(e)}setPaintProperty(e,r,n={}){if(r!=null){let i=`layers.${this.id}.paint.${e}`;if(this._validate(yc,i,e,r,n))return!1}if(e.endsWith(co))return this._transitionablePaint.setTransition(e.slice(0,-co.length),r||void 0),!1;{let i=this._transitionablePaint._values[e],o=i.property.specification["property-type"]==="cross-faded-data-driven",a=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(e,r),this._handleSpecialPaintPropertyUpdate(e);let l=this._transitionablePaint._values[e].value;return l.isDataDriven()||a||o||this._handleOverridablePaintPropertyUpdate(e,s,l)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,r,n){return!1}isHidden(e){return this.minzoom&&e<this.minzoom||this.maxzoom&&e>=this.maxzoom?!0: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(){let 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),Jl(e,(r,n)=>r!==void 0&&!(n==="layout"&&!Object.keys(r).length)&&!(n==="paint"&&!Object.keys(r).length))}_validate(e,r,n,i,o={}){return o&&o.validate===!1?!1:hc(this,e.call(bt,{key:r,layerType:this.type,objectKey:n,value:i,styleSpec:S,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let e in this.paint._values){let r=this.paint.get(e);if(!(!(r instanceof Se)||!ht(r.property.specification))&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}};var nd={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Pt=class{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}},id=128,od=5,ee=class{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){let 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(this.capacity*od),id),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}};function Y(t,e=1){let r=0,n=0,i=t.map(a=>{let s=ad(a.type),l=r=Sc(r,Math.max(e,s)),u=a.components||1;return n=Math.max(n,s),r+=s*u,{name:a.name,type:a.type,components:u,offset:l}}),o=Sc(r,Math.max(n,e));return{members:i,size:o,alignment:e}}function ad(t){return nd[t].BYTES_PER_ELEMENT}function Sc(t,e){return Math.ceil(t/e)*e}var wc=Z(he(),1),Zt=class extends ee{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r){let n=this.length;return this.resize(n+1),this.emplace(n,e,r)}emplace(e,r,n){let i=e*2;return this.int16[i+0]=r,this.int16[i+1]=n,e}};Zt.prototype.bytesPerElement=4;C("StructArrayLayout2i4",Zt);var dn=class extends ee{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,n)}emplace(e,r,n,i){let o=e*3;return this.int16[o+0]=r,this.int16[o+1]=n,this.int16[o+2]=i,e}};dn.prototype.bytesPerElement=6;C("StructArrayLayout3i6",dn);var po=class extends ee{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n,i){let o=this.length;return this.resize(o+1),this.emplace(o,e,r,n,i)}emplace(e,r,n,i,o){let a=e*4;return this.int16[a+0]=r,this.int16[a+1]=n,this.int16[a+2]=i,this.int16[a+3]=o,e}};po.prototype.bytesPerElement=8;C("StructArrayLayout4i8",po);var gn=class extends ee{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,r,n,i,o,a)}emplace(e,r,n,i,o,a,s){let l=e*6;return this.int16[l+0]=r,this.int16[l+1]=n,this.int16[l+2]=i,this.int16[l+3]=o,this.int16[l+4]=a,this.int16[l+5]=s,e}};gn.prototype.bytesPerElement=12;C("StructArrayLayout2i4i12",gn);var xn=class extends ee{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,r,n,i,o,a)}emplace(e,r,n,i,o,a,s){let l=e*4,u=e*8;return this.int16[l+0]=r,this.int16[l+1]=n,this.uint8[u+4]=i,this.uint8[u+5]=o,this.uint8[u+6]=a,this.uint8[u+7]=s,e}};xn.prototype.bytesPerElement=8;C("StructArrayLayout2i4ub8",xn);var St=class extends ee{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r){let n=this.length;return this.resize(n+1),this.emplace(n,e,r)}emplace(e,r,n){let i=e*2;return this.float32[i+0]=r,this.float32[i+1]=n,e}};St.prototype.bytesPerElement=8;C("StructArrayLayout2f8",St);var bn=class extends ee{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,a,s,l,u,c){let p=this.length;return this.resize(p+1),this.emplace(p,e,r,n,i,o,a,s,l,u,c)}emplace(e,r,n,i,o,a,s,l,u,c,p){let f=e*10;return this.uint16[f+0]=r,this.uint16[f+1]=n,this.uint16[f+2]=i,this.uint16[f+3]=o,this.uint16[f+4]=a,this.uint16[f+5]=s,this.uint16[f+6]=l,this.uint16[f+7]=u,this.uint16[f+8]=c,this.uint16[f+9]=p,e}};bn.prototype.bytesPerElement=20;C("StructArrayLayout10ui20",bn);var vn=class extends ee{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,a,s,l,u,c,p,f){let y=this.length;return this.resize(y+1),this.emplace(y,e,r,n,i,o,a,s,l,u,c,p,f)}emplace(e,r,n,i,o,a,s,l,u,c,p,f,y){let m=e*12;return this.int16[m+0]=r,this.int16[m+1]=n,this.int16[m+2]=i,this.int16[m+3]=o,this.uint16[m+4]=a,this.uint16[m+5]=s,this.uint16[m+6]=l,this.uint16[m+7]=u,this.int16[m+8]=c,this.int16[m+9]=p,this.int16[m+10]=f,this.int16[m+11]=y,e}};vn.prototype.bytesPerElement=24;C("StructArrayLayout4i4ui4i24",vn);var Pn=class extends ee{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,n)}emplace(e,r,n,i){let o=e*3;return this.float32[o+0]=r,this.float32[o+1]=n,this.float32[o+2]=i,e}};Pn.prototype.bytesPerElement=12;C("StructArrayLayout3f12",Pn);var Sn=class extends ee{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){let n=e*1;return this.uint32[n+0]=r,e}};Sn.prototype.bytesPerElement=4;C("StructArrayLayout1ul4",Sn);var wn=class extends ee{_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,n,i,o,a,s,l,u){let c=this.length;return this.resize(c+1),this.emplace(c,e,r,n,i,o,a,s,l,u)}emplace(e,r,n,i,o,a,s,l,u,c){let p=e*10,f=e*5;return this.int16[p+0]=r,this.int16[p+1]=n,this.int16[p+2]=i,this.int16[p+3]=o,this.int16[p+4]=a,this.int16[p+5]=s,this.uint32[f+3]=l,this.uint16[p+8]=u,this.uint16[p+9]=c,e}};wn.prototype.bytesPerElement=20;C("StructArrayLayout6i1ul2ui20",wn);var An=class extends ee{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,r,n,i,o,a)}emplace(e,r,n,i,o,a,s){let l=e*6;return this.int16[l+0]=r,this.int16[l+1]=n,this.int16[l+2]=i,this.int16[l+3]=o,this.int16[l+4]=a,this.int16[l+5]=s,e}};An.prototype.bytesPerElement=12;C("StructArrayLayout2i2i2i12",An);var fo=class extends ee{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o){let a=this.length;return this.resize(a+1),this.emplace(a,e,r,n,i,o)}emplace(e,r,n,i,o,a){let s=e*4,l=e*8;return this.float32[s+0]=r,this.float32[s+1]=n,this.float32[s+2]=i,this.int16[l+6]=o,this.int16[l+7]=a,e}};fo.prototype.bytesPerElement=16;C("StructArrayLayout2f1f2i16",fo);var _n=class extends ee{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,n,i){let o=this.length;return this.resize(o+1),this.emplace(o,e,r,n,i)}emplace(e,r,n,i,o){let a=e*12,s=e*3;return this.uint8[a+0]=r,this.uint8[a+1]=n,this.float32[s+1]=i,this.float32[s+2]=o,e}};_n.prototype.bytesPerElement=12;C("StructArrayLayout2ub2f12",_n);var In=class extends ee{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,n)}emplace(e,r,n,i){let o=e*3;return this.uint16[o+0]=r,this.uint16[o+1]=n,this.uint16[o+2]=i,e}};In.prototype.bytesPerElement=6;C("StructArrayLayout3ui6",In);var Tn=class extends ee{_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,n,i,o,a,s,l,u,c,p,f,y,m,h,d,g){let b=this.length;return this.resize(b+1),this.emplace(b,e,r,n,i,o,a,s,l,u,c,p,f,y,m,h,d,g)}emplace(e,r,n,i,o,a,s,l,u,c,p,f,y,m,h,d,g,b){let x=e*24,v=e*12,P=e*48;return this.int16[x+0]=r,this.int16[x+1]=n,this.uint16[x+2]=i,this.uint16[x+3]=o,this.uint32[v+2]=a,this.uint32[v+3]=s,this.uint32[v+4]=l,this.uint16[x+10]=u,this.uint16[x+11]=c,this.uint16[x+12]=p,this.float32[v+7]=f,this.float32[v+8]=y,this.uint8[P+36]=m,this.uint8[P+37]=h,this.uint8[P+38]=d,this.uint32[v+10]=g,this.int16[x+22]=b,e}};Tn.prototype.bytesPerElement=48;C("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Tn);var Cn=class extends ee{_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,n,i,o,a,s,l,u,c,p,f,y,m,h,d,g,b,x,v,P,w,T,F,E,_,I,k){let V=this.length;return this.resize(V+1),this.emplace(V,e,r,n,i,o,a,s,l,u,c,p,f,y,m,h,d,g,b,x,v,P,w,T,F,E,_,I,k)}emplace(e,r,n,i,o,a,s,l,u,c,p,f,y,m,h,d,g,b,x,v,P,w,T,F,E,_,I,k,V){let A=e*32,z=e*16;return this.int16[A+0]=r,this.int16[A+1]=n,this.int16[A+2]=i,this.int16[A+3]=o,this.int16[A+4]=a,this.int16[A+5]=s,this.int16[A+6]=l,this.int16[A+7]=u,this.uint16[A+8]=c,this.uint16[A+9]=p,this.uint16[A+10]=f,this.uint16[A+11]=y,this.uint16[A+12]=m,this.uint16[A+13]=h,this.uint16[A+14]=d,this.uint16[A+15]=g,this.uint16[A+16]=b,this.uint16[A+17]=x,this.uint16[A+18]=v,this.uint16[A+19]=P,this.uint16[A+20]=w,this.uint16[A+21]=T,this.uint16[A+22]=F,this.uint32[z+12]=E,this.float32[z+13]=_,this.float32[z+14]=I,this.uint16[A+30]=k,this.uint16[A+31]=V,e}};Cn.prototype.bytesPerElement=64;C("StructArrayLayout8i15ui1ul2f2ui64",Cn);var Wt=class extends ee{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){let n=e*1;return this.float32[n+0]=r,e}};Wt.prototype.bytesPerElement=4;C("StructArrayLayout1f4",Wt);var kn=class extends ee{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,n)}emplace(e,r,n,i){let o=e*6,a=e*3;return this.uint16[o+0]=r,this.float32[a+1]=n,this.float32[a+2]=i,e}};kn.prototype.bytesPerElement=12;C("StructArrayLayout1ui2f12",kn);var Mn=class extends ee{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,n)}emplace(e,r,n,i){let o=e*2,a=e*4;return this.uint32[o+0]=r,this.uint16[a+2]=n,this.uint16[a+3]=i,e}};Mn.prototype.bytesPerElement=8;C("StructArrayLayout1ul2ui8",Mn);var En=class extends ee{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r){let n=this.length;return this.resize(n+1),this.emplace(n,e,r)}emplace(e,r,n){let i=e*2;return this.uint16[i+0]=r,this.uint16[i+1]=n,e}};En.prototype.bytesPerElement=4;C("StructArrayLayout2ui4",En);var yo=class extends ee{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){let n=e*1;return this.uint16[n+0]=r,e}};yo.prototype.bytesPerElement=2;C("StructArrayLayout1ui2",yo);var Sr=class extends ee{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,n,i){let o=this.length;return this.resize(o+1),this.emplace(o,e,r,n,i)}emplace(e,r,n,i,o){let a=e*4;return this.float32[a+0]=r,this.float32[a+1]=n,this.float32[a+2]=i,this.float32[a+3]=o,e}};Sr.prototype.bytesPerElement=16;C("StructArrayLayout4f16",Sr);var mo=class extends Pt{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 wc.default(this.anchorPointX,this.anchorPointY)}};mo.prototype.size=20;var Fn=class extends wn{get(e){return new mo(this,e)}};C("CollisionBoxArray",Fn);var ho=class extends Pt{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]}};ho.prototype.size=48;var Ln=class extends Tn{get(e){return new ho(this,e)}};C("PlacedSymbolArray",Ln);var go=class extends Pt{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 collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}};go.prototype.size=64;var Dn=class extends Cn{get(e){return new go(this,e)}};C("SymbolInstanceArray",Dn);var Vn=class extends Wt{getoffsetX(e){return this.float32[e*1+0]}};C("GlyphOffsetArray",Vn);var Bn=class extends dn{getx(e){return this.int16[e*3+0]}gety(e){return this.int16[e*3+1]}gettileUnitDistanceFromAnchor(e){return this.int16[e*3+2]}};C("SymbolLineVertexArray",Bn);var xo=class extends Pt{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}};xo.prototype.size=12;var zn=class extends kn{get(e){return new xo(this,e)}};C("TextAnchorOffsetArray",zn);var bo=class extends Pt{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]}};bo.prototype.size=8;var Rn=class extends Mn{get(e){return new bo(this,e)}};C("FeatureIndexArray",Rn);var vo=class extends Zt{};var Po=class extends Zt{},So=class extends Zt{},wo=class extends gn{};var Ao=class extends xn{},_o=class extends St{},ut=class extends bn{},Io=class extends vn{},To=class extends Pn{},Co=class extends Sn{},On=class extends An{};var ko=class extends _n{};var Le=class extends In{},wt=class extends En{};var sd=Y([{name:"a_pos",components:2,type:"Int16"}],4);var{members:Ac,size:Lv,alignment:Dv}=sd;var me=class t{constructor(e=[]){this.segments=e}prepareSegment(e,r,n,i){let o=this.segments[this.segments.length-1];return e>t.MAX_VERTEX_ARRAY_LENGTH&&fe(`Max vertices per segment is ${t.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!o||o.vertexLength+e>t.MAX_VERTEX_ARRAY_LENGTH||o.sortKey!==i)&&(o={vertexOffset:r.length,primitiveOffset:n.length,vertexLength:0,primitiveLength:0},i!==void 0&&(o.sortKey=i),this.segments.push(o)),o}get(){return this.segments}destroy(){for(let e of this.segments)for(let r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,n,i){return new t([{vertexOffset:e,primitiveOffset:r,vertexLength:n,primitiveLength:i,vaos:{},sortKey:0}])}};me.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1;C("SegmentVector",me);function As(t,e){return t=it(Math.floor(t),0,255),e=it(Math.floor(e),0,255),256*t+e}var Nn=Y([{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 kc=Z(Ts(),1);var Un=class t{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,n,i){this.ids.push(Cc(e)),this.positions.push(r,n,i)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let r=Cc(e),n=0,i=this.ids.length-1;for(;n<i;){let a=n+i>>1;this.ids[a]>=r?i=a:n=a+1}let o=[];for(;this.ids[n]===r;){let a=this.positions[3*n],s=this.positions[3*n+1],l=this.positions[3*n+2];o.push({index:a,start:s,end:l}),n++}return o}static serialize(e,r){let n=new Float64Array(e.ids),i=new Uint32Array(e.positions);return Cs(n,i,0,n.length-1),r&&r.push(n.buffer,i.buffer),{ids:n,positions:i}}static deserialize(e){let r=new t;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}};function Cc(t){let e=+t;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:(0,kc.default)(String(t))}function Cs(t,e,r,n){for(;r<n;){let i=t[r+n>>1],o=r-1,a=n+1;for(;;){do o++;while(t[o]<i);do a--;while(t[a]>i);if(o>=a)break;Eo(t,o,a),Eo(e,3*o,3*a),Eo(e,3*o+1,3*a+1),Eo(e,3*o+2,3*a+2)}a-r<n-a?(Cs(t,e,r,a),r=a+1):(Cs(t,e,a+1,n),n=a)}}function Eo(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}C("FeaturePositionMap",Un);var $n=class{constructor(e,r){this.gl=e.gl,this.location=r}};var wr=class extends $n{constructor(e,r){super(e,r),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}};var Fo=class extends $n{constructor(e,r){super(e,r),this.current=[0,0,0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1]||e[2]!==this.current[2]||e[3]!==this.current[3])&&(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}},Lo=class extends $n{constructor(e,r){super(e,r),this.current=W.transparent}set(e){(e.r!==this.current.r||e.g!==this.current.g||e.b!==this.current.b||e.a!==this.current.a)&&(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}},Hv=new Float32Array(16);function ks(t){return[As(255*t.r,255*t.g),As(255*t.b,255*t.a)]}var Ht=class{constructor(e,r,n){this.value=e,this.uniformNames=r.map(i=>`u_${i}`),this.type=n}setUniform(e,r,n){e.set(n.constantOr(this.value))}getBinding(e,r,n){return this.type==="color"?new Lo(e,r):new wr(e,r)}},At=class{constructor(e,r){this.uniformNames=r.map(n=>`u_${n}`),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,n,i){let o=i==="u_pattern_to"?this.patternTo:i==="u_pattern_from"?this.patternFrom:i==="u_pixel_ratio_to"?this.pixelRatioTo:i==="u_pixel_ratio_from"?this.pixelRatioFrom:null;o&&e.set(o)}getBinding(e,r,n){return n.substr(0,9)==="u_pattern"?new Fo(e,r):new wr(e,r)}},We=class{constructor(e,r,n,i){this.expression=e,this.type=n,this.maxValue=0,this.paintVertexAttributes=r.map(o=>({name:`a_${o}`,type:"Float32",components:n==="color"?2:1,offset:0})),this.paintVertexArray=new i}populatePaintArray(e,r,n,i,o){let a=this.paintVertexArray.length,s=this.expression.evaluate(new q(0),r,{},i,[],o);this.paintVertexArray.resize(e),this._setPaintValue(a,e,s)}updatePaintArray(e,r,n,i){let o=this.expression.evaluate({zoom:0},n,i);this._setPaintValue(e,r,o)}_setPaintValue(e,r,n){if(this.type==="color"){let i=ks(n);for(let o=e;o<r;o++)this.paintVertexArray.emplace(o,i[0],i[1])}else{for(let i=e;i<r;i++)this.paintVertexArray.emplace(i,n);this.maxValue=Math.max(this.maxValue,Math.abs(n))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}},De=class{constructor(e,r,n,i,o,a){this.expression=e,this.uniformNames=r.map(s=>`u_${s}_t`),this.type=n,this.useIntegerZoom=i,this.zoom=o,this.maxValue=0,this.paintVertexAttributes=r.map(s=>({name:`a_${s}`,type:"Float32",components:n==="color"?4:2,offset:0})),this.paintVertexArray=new a}populatePaintArray(e,r,n,i,o){let a=this.expression.evaluate(new q(this.zoom),r,{},i,[],o),s=this.expression.evaluate(new q(this.zoom+1),r,{},i,[],o),l=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(l,e,a,s)}updatePaintArray(e,r,n,i){let o=this.expression.evaluate({zoom:this.zoom},n,i),a=this.expression.evaluate({zoom:this.zoom+1},n,i);this._setPaintValue(e,r,o,a)}_setPaintValue(e,r,n,i){if(this.type==="color"){let o=ks(n),a=ks(i);for(let s=e;s<r;s++)this.paintVertexArray.emplace(s,o[0],o[1],a[0],a[1])}else{for(let o=e;o<r;o++)this.paintVertexArray.emplace(o,n,i);this.maxValue=Math.max(this.maxValue,Math.abs(n),Math.abs(i))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,r){let n=this.useIntegerZoom?Math.floor(r.zoom):r.zoom,i=it(this.expression.interpolationFactor(n,this.zoom,this.zoom+1),0,1);e.set(i)}getBinding(e,r,n){return new wr(e,r)}},et=class{constructor(e,r,n,i,o,a){this.expression=e,this.type=r,this.useIntegerZoom=n,this.zoom=i,this.layerId=a,this.zoomInPaintVertexArray=new o,this.zoomOutPaintVertexArray=new o}populatePaintArray(e,r,n){let i=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(i,e,r.patterns&&r.patterns[this.layerId],n)}updatePaintArray(e,r,n,i,o){this._setPaintValues(e,r,n.patterns&&n.patterns[this.layerId],o)}_setPaintValues(e,r,n,i){if(!i||!n)return;let{min:o,mid:a,max:s}=n,l=i[o],u=i[a],c=i[s];if(!(!l||!u||!c))for(let p=e;p<r;p++)this.zoomInPaintVertexArray.emplace(p,u.tl[0],u.tl[1],u.br[0],u.br[1],l.tl[0],l.tl[1],l.br[0],l.br[1],u.pixelRatio,l.pixelRatio),this.zoomOutPaintVertexArray.emplace(p,u.tl[0],u.tl[1],u.br[0],u.br[1],c.tl[0],c.tl[1],c.br[0],c.br[1],u.pixelRatio,c.pixelRatio)}upload(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,Nn.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,Nn.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}},Do=class{constructor(e,r,n){this.binders={},this._buffers=[];let i=[];for(let o in e.paint._values){if(!n(o))continue;let a=e.paint.get(o);if(!(a instanceof Se)||!ht(a.property.specification))continue;let s=pd(o,e.type),l=a.value,u=a.property.specification.type,c=a.property.useIntegerZoom,p=a.property.specification["property-type"],f=p==="cross-faded"||p==="cross-faded-data-driven";if(l.kind==="constant")this.binders[o]=f?new At(l.value,s):new Ht(l.value,s,u),i.push(`/u_${o}`);else if(l.kind==="source"||f){let y=Mc(o,u,"source");this.binders[o]=f?new et(l,u,c,r,y,e.id):new We(l,s,u,y),i.push(`/a_${o}`)}else{let y=Mc(o,u,"composite");this.binders[o]=new De(l,s,u,c,r,y),i.push(`/z_${o}`)}}this.cacheKey=i.sort().join("")}getMaxValue(e){let r=this.binders[e];return r instanceof We||r instanceof De?r.maxValue:0}populatePaintArrays(e,r,n,i,o){for(let a in this.binders){let s=this.binders[a];(s instanceof We||s instanceof De||s instanceof et)&&s.populatePaintArray(e,r,n,i,o)}}setConstantPatternPositions(e,r){for(let n in this.binders){let i=this.binders[n];i instanceof At&&i.setConstantPatternPositions(e,r)}}updatePaintArrays(e,r,n,i,o){let a=!1;for(let s in e){let l=r.getPositions(s);for(let u of l){let c=n.feature(u.index);for(let p in this.binders){let f=this.binders[p];if((f instanceof We||f instanceof De||f instanceof et)&&f.expression.isStateDependent===!0){let y=i.paint.get(p);f.expression=y.value,f.updatePaintArray(u.start,u.end,c,e[s],o),a=!0}}}}return a}defines(){let e=[];for(let r in this.binders){let n=this.binders[r];(n instanceof Ht||n instanceof At)&&e.push(...n.uniformNames.map(i=>`#define HAS_UNIFORM_${i}`))}return e}getBinderAttributes(){let e=[];for(let r in this.binders){let n=this.binders[r];if(n instanceof We||n instanceof De)for(let i=0;i<n.paintVertexAttributes.length;i++)e.push(n.paintVertexAttributes[i].name);else if(n instanceof et)for(let i=0;i<Nn.members.length;i++)e.push(Nn.members[i].name)}return e}getBinderUniforms(){let e=[];for(let r in this.binders){let n=this.binders[r];if(n instanceof Ht||n instanceof At||n instanceof De)for(let i of n.uniformNames)e.push(i)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,r){let n=[];for(let i in this.binders){let o=this.binders[i];if(o instanceof Ht||o instanceof At||o instanceof De){for(let a of o.uniformNames)if(r[a]){let s=o.getBinding(e,r[a],a);n.push({name:a,property:i,binding:s})}}}return n}setUniforms(e,r,n,i){for(let{name:o,property:a,binding:s}of r)this.binders[a].setUniform(s,i,n.get(a),o)}updatePaintBuffers(e){this._buffers=[];for(let r in this.binders){let n=this.binders[r];if(e&&n instanceof et){let i=e.fromScale===2?n.zoomInPaintVertexBuffer:n.zoomOutPaintVertexBuffer;i&&this._buffers.push(i)}else(n instanceof We||n instanceof De)&&n.paintVertexBuffer&&this._buffers.push(n.paintVertexBuffer)}}upload(e){for(let r in this.binders){let n=this.binders[r];(n instanceof We||n instanceof De||n instanceof et)&&n.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let r=this.binders[e];(r instanceof We||r instanceof De||r instanceof et)&&r.destroy()}}},Ce=class{constructor(e,r,n=()=>!0){this.programConfigurations={};for(let i of e)this.programConfigurations[i.id]=new Do(i,r,n);this.needsUpload=!1,this._featureMap=new Un,this._bufferOffset=0}populatePaintArrays(e,r,n,i,o,a){for(let s in this.programConfigurations)this.programConfigurations[s].populatePaintArrays(e,r,i,o,a);r.id!==void 0&&this._featureMap.add(r.id,n,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,r,n,i){for(let o of n)this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(e,this._featureMap,r,o,i)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(let r in this.programConfigurations)this.programConfigurations[r].upload(e);this.needsUpload=!1}}destroy(){for(let e in this.programConfigurations)this.programConfigurations[e].destroy()}};function pd(t,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"]}[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}function fd(t){return{"line-pattern":{source:ut,composite:ut},"fill-pattern":{source:ut,composite:ut},"fill-extrusion-pattern":{source:ut,composite:ut}}[t]}function Mc(t,e,r){let n={color:{source:St,composite:Sr},number:{source:Wt,composite:St}},i=fd(t);return i&&i[r]||n[e][r]}C("ConstantBinder",Ht);C("CrossFadedConstantBinder",At);C("SourceExpressionBinder",We);C("CrossFadedCompositeBinder",et);C("CompositeExpressionBinder",De);C("ProgramConfiguration",Do,{omit:["_buffers"]});C("ProgramConfigurationSet",Ce);var yd=15,Ms=Math.pow(2,yd-1)-1,Ec=-Ms-1;function ke(t){let e=8192/t.extent,r=t.loadGeometry();for(let n=0;n<r.length;n++){let i=r[n];for(let o=0;o<i.length;o++){let a=i[o],s=Math.round(a.x*e),l=Math.round(a.y*e);a.x=it(s,Ec,Ms),a.y=it(l,Ec,Ms),(s<a.x||s>a.x+1||l<a.y||l>a.y+1)&&fe("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function $e(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?ke(t):[]}}function Vo(t,e,r,n,i){t.emplaceBack(e*2+(n+1)/2,r*2+(i+1)/2)}var Xt=class{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 Po,this.indexArray=new Le,this.segments=new me,this.programConfigurations=new Ce(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,n){let i=this.layers[0],o=[],a=null,s=!1;i.type==="circle"&&(a=i.layout.get("circle-sort-key"),s=!a.isConstant());for(let{feature:l,id:u,index:c,sourceLayerIndex:p}of e){let f=this.layers[0]._featureFilter.needGeometry,y=$e(l,f);if(!this.layers[0]._featureFilter.filter(new q(this.zoom),y,n))continue;let m=s?a.evaluate(y,{},n):void 0,h={id:u,properties:l.properties,type:l.type,sourceLayerIndex:p,index:c,geometry:f?y.geometry:ke(l),patterns:{},sortKey:m};o.push(h)}s&&o.sort((l,u)=>l.sortKey-u.sortKey);for(let l of o){let{geometry:u,index:c,sourceLayerIndex:p}=l,f=e[c].feature;this.addFeature(l,u,c,n),r.featureIndex.insert(f,u,c,p,this.index)}}update(e,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,n)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Ac),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,n,i){for(let o of r)for(let a of o){let s=a.x,l=a.y;if(s<0||s>=8192||l<0||l>=8192)continue;let u=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),c=u.vertexLength;Vo(this.layoutVertexArray,s,l,-1,-1),Vo(this.layoutVertexArray,s,l,1,-1),Vo(this.layoutVertexArray,s,l,1,1),Vo(this.layoutVertexArray,s,l,-1,1),this.indexArray.emplaceBack(c,c+1,c+2),this.indexArray.emplaceBack(c,c+3,c+2),u.vertexLength+=4,u.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{},i)}};C("CircleBucket",Xt,{omit:["layers"]});var Gn=Z(he(),1);function Lc(t,e){for(let r=0;r<t.length;r++)if(Ar(e,t[r]))return!0;for(let r=0;r<e.length;r++)if(Ar(t,e[r]))return!0;return!!Fs(t,e)}function Dc(t,e,r){return!!(Ar(t,e)||Es(e,t,r))}function Bo(t,e){if(t.length===1)return Fc(e,t[0]);for(let r=0;r<e.length;r++){let n=e[r];for(let i=0;i<n.length;i++)if(Ar(t,n[i]))return!0}for(let r=0;r<t.length;r++)if(Fc(e,t[r]))return!0;for(let r=0;r<e.length;r++)if(Fs(t,e[r]))return!0;return!1}function Vc(t,e,r){for(let n=0;n<e.length;n++){let i=e[n];if(t.length>=3){for(let o=0;o<i.length;o++)if(Ar(t,i[o]))return!0}if(md(t,i,r))return!0}return!1}function md(t,e,r){if(t.length>1){if(Fs(t,e))return!0;for(let n=0;n<e.length;n++)if(Es(e[n],t,r))return!0}for(let n=0;n<t.length;n++)if(Es(t[n],e,r))return!0;return!1}function Fs(t,e){if(t.length===0||e.length===0)return!1;for(let r=0;r<t.length-1;r++){let n=t[r],i=t[r+1];for(let o=0;o<e.length-1;o++){let a=e[o],s=e[o+1];if(hd(n,i,a,s))return!0}}return!1}function hd(t,e,r,n){return ot(t,r,n)!==ot(e,r,n)&&ot(t,e,r)!==ot(t,e,n)}function Es(t,e,r){let n=r*r;if(e.length===1)return t.distSqr(e[0])<n;for(let i=1;i<e.length;i++){let o=e[i-1],a=e[i];if(Ls(t,o,a)<n)return!0}return!1}function Ls(t,e,r){let n=e.distSqr(r);if(n===0)return t.distSqr(e);let i=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return i<0?t.distSqr(e):i>1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function Fc(t,e){let r=!1,n,i,o;for(let a=0;a<t.length;a++){n=t[a];for(let s=0,l=n.length-1;s<n.length;l=s++)i=n[s],o=n[l],i.y>e.y!=o.y>e.y&&e.x<(o.x-i.x)*(e.y-i.y)/(o.y-i.y)+i.x&&(r=!r)}return r}function Ar(t,e){let r=!1;for(let n=0,i=t.length-1;n<t.length;i=n++){let o=t[n],a=t[i];o.y>e.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}function Bc(t,e,r,n,i){for(let a of t)if(e<=a.x&&r<=a.y&&n>=a.x&&i>=a.y)return!0;let o=[new Gn.default(e,r),new Gn.default(e,i),new Gn.default(n,i),new Gn.default(n,r)];if(t.length>2){for(let a of o)if(Ar(t,a))return!0}for(let a=0;a<t.length-1;a++){let s=t[a],l=t[a+1];if(dd(s,l,o))return!0}return!1}function dd(t,e,r){let n=r[0],i=r[2];if(t.x<n.x&&e.x<n.x||t.x>i.x&&e.x>i.x||t.y<n.y&&e.y<n.y||t.y>i.y&&e.y>i.y)return!1;let o=ot(t,e,r[0]);return o!==ot(t,e,r[1])||o!==ot(t,e,r[2])||o!==ot(t,e,r[3])}var zo=Z(he(),1);function Kt(t,e,r){let n=e.paint.get(t).value;return n.kind==="constant"?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function _t(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function It(t,e,r,n,i){if(!e[0]&&!e[1])return t;let o=zo.default.convert(e)._mult(i);r==="viewport"&&o._rotate(-n);let a=[];for(let s=0;s<t.length;s++){let l=t[s];a.push(l.sub(o))}return a}function zc(t,e){let r=[];for(let n=0;n<t.length;n++){let i=t[n],o=[];for(let a=0;a<i.length;a++){let s=i[a-1],l=i[a],u=i[a+1],c=a===0?new zo.default(0,0):l.sub(s)._unit()._perp(),p=a===i.length-1?new zo.default(0,0):u.sub(l)._unit()._perp(),f=c._add(p)._unit(),y=f.x*p.x+f.y*p.y;y!==0&&f._mult(1/y),o.push(f._mult(e)._add(l))}r.push(o)}return r}var Rc,gd=()=>Rc=Rc||new re({"circle-sort-key":new R(S.layout_circle["circle-sort-key"])}),Oc,xd=()=>Oc=Oc||new re({"circle-radius":new R(S.paint_circle["circle-radius"]),"circle-color":new R(S.paint_circle["circle-color"]),"circle-blur":new R(S.paint_circle["circle-blur"]),"circle-opacity":new R(S.paint_circle["circle-opacity"]),"circle-translate":new B(S.paint_circle["circle-translate"]),"circle-translate-anchor":new B(S.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new B(S.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new B(S.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new R(S.paint_circle["circle-stroke-width"]),"circle-stroke-color":new R(S.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new R(S.paint_circle["circle-stroke-opacity"])}),Nc={get paint(){return xd()},get layout(){return gd()}};var Q=1e-6,Ge=typeof Float32Array<"u"?Float32Array:Array,qn=Math.random;var U1=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var jn={};Dl(jn,{add:()=>rg,adjoint:()=>Id,clone:()=>vd,copy:()=>Pd,create:()=>bd,determinant:()=>Td,equals:()=>ag,exactEquals:()=>og,frob:()=>tg,fromQuat:()=>jd,fromQuat2:()=>Nd,fromRotation:()=>Bd,fromRotationTranslation:()=>qc,fromRotationTranslationScale:()=>Gd,fromRotationTranslationScaleOrigin:()=>qd,fromScaling:()=>Vd,fromTranslation:()=>Dd,fromValues:()=>Sd,fromXRotation:()=>zd,fromYRotation:()=>Rd,fromZRotation:()=>Od,frustum:()=>Jd,getRotation:()=>$d,getScaling:()=>jc,getTranslation:()=>Ud,identity:()=>$c,invert:()=>_d,lookAt:()=>Yd,mul:()=>sg,multiply:()=>Gc,multiplyScalar:()=>ng,multiplyScalarAndAdd:()=>ig,ortho:()=>Xd,orthoNO:()=>Zc,orthoZO:()=>Kd,perspective:()=>Zd,perspectiveFromFieldOfView:()=>Hd,perspectiveNO:()=>Jc,perspectiveZO:()=>Wd,rotate:()=>Md,rotateX:()=>Ed,rotateY:()=>Fd,rotateZ:()=>Ld,scale:()=>kd,set:()=>wd,str:()=>eg,sub:()=>lg,subtract:()=>Wc,targetTo:()=>Qd,translate:()=>Cd,transpose:()=>Ad});function bd(){var t=new Ge(16);return Ge!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function vd(t){var e=new Ge(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Pd(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Sd(t,e,r,n,i,o,a,s,l,u,c,p,f,y,m,h){var d=new Ge(16);return d[0]=t,d[1]=e,d[2]=r,d[3]=n,d[4]=i,d[5]=o,d[6]=a,d[7]=s,d[8]=l,d[9]=u,d[10]=c,d[11]=p,d[12]=f,d[13]=y,d[14]=m,d[15]=h,d}function wd(t,e,r,n,i,o,a,s,l,u,c,p,f,y,m,h,d){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=l,t[8]=u,t[9]=c,t[10]=p,t[11]=f,t[12]=y,t[13]=m,t[14]=h,t[15]=d,t}function $c(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ad(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function _d(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7],c=e[8],p=e[9],f=e[10],y=e[11],m=e[12],h=e[13],d=e[14],g=e[15],b=r*s-n*a,x=r*l-i*a,v=r*u-o*a,P=n*l-i*s,w=n*u-o*s,T=i*u-o*l,F=c*h-p*m,E=c*d-f*m,_=c*g-y*m,I=p*d-f*h,k=p*g-y*h,V=f*g-y*d,A=b*V-x*k+v*I+P*_-w*E+T*F;return A?(A=1/A,t[0]=(s*V-l*k+u*I)*A,t[1]=(i*k-n*V-o*I)*A,t[2]=(h*T-d*w+g*P)*A,t[3]=(f*w-p*T-y*P)*A,t[4]=(l*_-a*V-u*E)*A,t[5]=(r*V-i*_+o*E)*A,t[6]=(d*v-m*T-g*x)*A,t[7]=(c*T-f*v+y*x)*A,t[8]=(a*k-s*_+u*F)*A,t[9]=(n*_-r*k-o*F)*A,t[10]=(m*w-h*v+g*b)*A,t[11]=(p*v-c*w-y*b)*A,t[12]=(s*E-a*I-l*F)*A,t[13]=(r*I-n*E+i*F)*A,t[14]=(h*x-m*P-d*b)*A,t[15]=(c*P-p*x+f*b)*A,t):null}function Id(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7],c=e[8],p=e[9],f=e[10],y=e[11],m=e[12],h=e[13],d=e[14],g=e[15];return t[0]=s*(f*g-y*d)-p*(l*g-u*d)+h*(l*y-u*f),t[1]=-(n*(f*g-y*d)-p*(i*g-o*d)+h*(i*y-o*f)),t[2]=n*(l*g-u*d)-s*(i*g-o*d)+h*(i*u-o*l),t[3]=-(n*(l*y-u*f)-s*(i*y-o*f)+p*(i*u-o*l)),t[4]=-(a*(f*g-y*d)-c*(l*g-u*d)+m*(l*y-u*f)),t[5]=r*(f*g-y*d)-c*(i*g-o*d)+m*(i*y-o*f),t[6]=-(r*(l*g-u*d)-a*(i*g-o*d)+m*(i*u-o*l)),t[7]=r*(l*y-u*f)-a*(i*y-o*f)+c*(i*u-o*l),t[8]=a*(p*g-y*h)-c*(s*g-u*h)+m*(s*y-u*p),t[9]=-(r*(p*g-y*h)-c*(n*g-o*h)+m*(n*y-o*p)),t[10]=r*(s*g-u*h)-a*(n*g-o*h)+m*(n*u-o*s),t[11]=-(r*(s*y-u*p)-a*(n*y-o*p)+c*(n*u-o*s)),t[12]=-(a*(p*d-f*h)-c*(s*d-l*h)+m*(s*f-l*p)),t[13]=r*(p*d-f*h)-c*(n*d-i*h)+m*(n*f-i*p),t[14]=-(r*(s*d-l*h)-a*(n*d-i*h)+m*(n*l-i*s)),t[15]=r*(s*f-l*p)-a*(n*f-i*p)+c*(n*l-i*s),t}function Td(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],l=t[7],u=t[8],c=t[9],p=t[10],f=t[11],y=t[12],m=t[13],h=t[14],d=t[15],g=e*a-r*o,b=e*s-n*o,x=e*l-i*o,v=r*s-n*a,P=r*l-i*a,w=n*l-i*s,T=u*m-c*y,F=u*h-p*y,E=u*d-f*y,_=c*h-p*m,I=c*d-f*m,k=p*d-f*h;return g*k-b*I+x*_+v*E-P*F+w*T}function Gc(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],p=e[8],f=e[9],y=e[10],m=e[11],h=e[12],d=e[13],g=e[14],b=e[15],x=r[0],v=r[1],P=r[2],w=r[3];return t[0]=x*n+v*s+P*p+w*h,t[1]=x*i+v*l+P*f+w*d,t[2]=x*o+v*u+P*y+w*g,t[3]=x*a+v*c+P*m+w*b,x=r[4],v=r[5],P=r[6],w=r[7],t[4]=x*n+v*s+P*p+w*h,t[5]=x*i+v*l+P*f+w*d,t[6]=x*o+v*u+P*y+w*g,t[7]=x*a+v*c+P*m+w*b,x=r[8],v=r[9],P=r[10],w=r[11],t[8]=x*n+v*s+P*p+w*h,t[9]=x*i+v*l+P*f+w*d,t[10]=x*o+v*u+P*y+w*g,t[11]=x*a+v*c+P*m+w*b,x=r[12],v=r[13],P=r[14],w=r[15],t[12]=x*n+v*s+P*p+w*h,t[13]=x*i+v*l+P*f+w*d,t[14]=x*o+v*u+P*y+w*g,t[15]=x*a+v*c+P*m+w*b,t}function Cd(t,e,r){var n=r[0],i=r[1],o=r[2],a,s,l,u,c,p,f,y,m,h,d,g;return e===t?(t[12]=e[0]*n+e[4]*i+e[8]*o+e[12],t[13]=e[1]*n+e[5]*i+e[9]*o+e[13],t[14]=e[2]*n+e[6]*i+e[10]*o+e[14],t[15]=e[3]*n+e[7]*i+e[11]*o+e[15]):(a=e[0],s=e[1],l=e[2],u=e[3],c=e[4],p=e[5],f=e[6],y=e[7],m=e[8],h=e[9],d=e[10],g=e[11],t[0]=a,t[1]=s,t[2]=l,t[3]=u,t[4]=c,t[5]=p,t[6]=f,t[7]=y,t[8]=m,t[9]=h,t[10]=d,t[11]=g,t[12]=a*n+c*i+m*o+e[12],t[13]=s*n+p*i+h*o+e[13],t[14]=l*n+f*i+d*o+e[14],t[15]=u*n+y*i+g*o+e[15]),t}function kd(t,e,r){var n=r[0],i=r[1],o=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Md(t,e,r,n){var i=n[0],o=n[1],a=n[2],s=Math.hypot(i,o,a),l,u,c,p,f,y,m,h,d,g,b,x,v,P,w,T,F,E,_,I,k,V,A,z;return s<Q?null:(s=1/s,i*=s,o*=s,a*=s,l=Math.sin(r),u=Math.cos(r),c=1-u,p=e[0],f=e[1],y=e[2],m=e[3],h=e[4],d=e[5],g=e[6],b=e[7],x=e[8],v=e[9],P=e[10],w=e[11],T=i*i*c+u,F=o*i*c+a*l,E=a*i*c-o*l,_=i*o*c-a*l,I=o*o*c+u,k=a*o*c+i*l,V=i*a*c+o*l,A=o*a*c-i*l,z=a*a*c+u,t[0]=p*T+h*F+x*E,t[1]=f*T+d*F+v*E,t[2]=y*T+g*F+P*E,t[3]=m*T+b*F+w*E,t[4]=p*_+h*I+x*k,t[5]=f*_+d*I+v*k,t[6]=y*_+g*I+P*k,t[7]=m*_+b*I+w*k,t[8]=p*V+h*A+x*z,t[9]=f*V+d*A+v*z,t[10]=y*V+g*A+P*z,t[11]=m*V+b*A+w*z,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function Ed(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[4],a=e[5],s=e[6],l=e[7],u=e[8],c=e[9],p=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+u*n,t[5]=a*i+c*n,t[6]=s*i+p*n,t[7]=l*i+f*n,t[8]=u*i-o*n,t[9]=c*i-a*n,t[10]=p*i-s*n,t[11]=f*i-l*n,t}function Fd(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[0],a=e[1],s=e[2],l=e[3],u=e[8],c=e[9],p=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-u*n,t[1]=a*i-c*n,t[2]=s*i-p*n,t[3]=l*i-f*n,t[8]=o*n+u*i,t[9]=a*n+c*i,t[10]=s*n+p*i,t[11]=l*n+f*i,t}function Ld(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[0],a=e[1],s=e[2],l=e[3],u=e[4],c=e[5],p=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+u*n,t[1]=a*i+c*n,t[2]=s*i+p*n,t[3]=l*i+f*n,t[4]=u*i-o*n,t[5]=c*i-a*n,t[6]=p*i-s*n,t[7]=f*i-l*n,t}function Dd(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function Vd(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Bd(t,e,r){var n=r[0],i=r[1],o=r[2],a=Math.hypot(n,i,o),s,l,u;return a<Q?null:(a=1/a,n*=a,i*=a,o*=a,s=Math.sin(e),l=Math.cos(e),u=1-l,t[0]=n*n*u+l,t[1]=i*n*u+o*s,t[2]=o*n*u-i*s,t[3]=0,t[4]=n*i*u-o*s,t[5]=i*i*u+l,t[6]=o*i*u+n*s,t[7]=0,t[8]=n*o*u+i*s,t[9]=i*o*u-n*s,t[10]=o*o*u+l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function zd(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Rd(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Od(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function qc(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=n+n,l=i+i,u=o+o,c=n*s,p=n*l,f=n*u,y=i*l,m=i*u,h=o*u,d=a*s,g=a*l,b=a*u;return t[0]=1-(y+h),t[1]=p+b,t[2]=f-g,t[3]=0,t[4]=p-b,t[5]=1-(c+h),t[6]=m+d,t[7]=0,t[8]=f+g,t[9]=m-d,t[10]=1-(c+y),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function Nd(t,e){var r=new Ge(3),n=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],p=n*n+i*i+o*o+a*a;return p>0?(r[0]=(s*a+c*n+l*o-u*i)*2/p,r[1]=(l*a+c*i+u*n-s*o)*2/p,r[2]=(u*a+c*o+s*i-l*n)*2/p):(r[0]=(s*a+c*n+l*o-u*i)*2,r[1]=(l*a+c*i+u*n-s*o)*2,r[2]=(u*a+c*o+s*i-l*n)*2),qc(t,e,r),t}function Ud(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function jc(t,e){var r=e[0],n=e[1],i=e[2],o=e[4],a=e[5],s=e[6],l=e[8],u=e[9],c=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(l,u,c),t}function $d(t,e){var r=new Ge(3);jc(r,e);var n=1/r[0],i=1/r[1],o=1/r[2],a=e[0]*n,s=e[1]*i,l=e[2]*o,u=e[4]*n,c=e[5]*i,p=e[6]*o,f=e[8]*n,y=e[9]*i,m=e[10]*o,h=a+c+m,d=0;return h>0?(d=Math.sqrt(h+1)*2,t[3]=.25*d,t[0]=(p-y)/d,t[1]=(f-l)/d,t[2]=(s-u)/d):a>c&&a>m?(d=Math.sqrt(1+a-c-m)*2,t[3]=(p-y)/d,t[0]=.25*d,t[1]=(s+u)/d,t[2]=(f+l)/d):c>m?(d=Math.sqrt(1+c-a-m)*2,t[3]=(f-l)/d,t[0]=(s+u)/d,t[1]=.25*d,t[2]=(p+y)/d):(d=Math.sqrt(1+m-a-c)*2,t[3]=(s-u)/d,t[0]=(f+l)/d,t[1]=(p+y)/d,t[2]=.25*d),t}function Gd(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=e[3],l=i+i,u=o+o,c=a+a,p=i*l,f=i*u,y=i*c,m=o*u,h=o*c,d=a*c,g=s*l,b=s*u,x=s*c,v=n[0],P=n[1],w=n[2];return t[0]=(1-(m+d))*v,t[1]=(f+x)*v,t[2]=(y-b)*v,t[3]=0,t[4]=(f-x)*P,t[5]=(1-(p+d))*P,t[6]=(h+g)*P,t[7]=0,t[8]=(y+b)*w,t[9]=(h-g)*w,t[10]=(1-(p+m))*w,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function qd(t,e,r,n,i){var o=e[0],a=e[1],s=e[2],l=e[3],u=o+o,c=a+a,p=s+s,f=o*u,y=o*c,m=o*p,h=a*c,d=a*p,g=s*p,b=l*u,x=l*c,v=l*p,P=n[0],w=n[1],T=n[2],F=i[0],E=i[1],_=i[2],I=(1-(h+g))*P,k=(y+v)*P,V=(m-x)*P,A=(y-v)*w,z=(1-(f+g))*w,O=(d+b)*w,N=(m+x)*T,K=(d-b)*T,xe=(1-(f+h))*T;return t[0]=I,t[1]=k,t[2]=V,t[3]=0,t[4]=A,t[5]=z,t[6]=O,t[7]=0,t[8]=N,t[9]=K,t[10]=xe,t[11]=0,t[12]=r[0]+F-(I*F+A*E+N*_),t[13]=r[1]+E-(k*F+z*E+K*_),t[14]=r[2]+_-(V*F+O*E+xe*_),t[15]=1,t}function jd(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,l=i+i,u=r*a,c=n*a,p=n*s,f=i*a,y=i*s,m=i*l,h=o*a,d=o*s,g=o*l;return t[0]=1-p-m,t[1]=c+g,t[2]=f-d,t[3]=0,t[4]=c-g,t[5]=1-u-m,t[6]=y+h,t[7]=0,t[8]=f+d,t[9]=y-h,t[10]=1-u-p,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Jd(t,e,r,n,i,o,a){var s=1/(r-e),l=1/(i-n),u=1/(o-a);return t[0]=o*2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o*2*l,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*l,t[10]=(a+o)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*u,t[15]=0,t}function Jc(t,e,r,n,i){var o=1/Math.tan(e/2),a;return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,i!=null&&i!==1/0?(a=1/(n-i),t[10]=(i+n)*a,t[14]=2*i*n*a):(t[10]=-1,t[14]=-2*n),t}var Zd=Jc;function Wd(t,e,r,n,i){var o=1/Math.tan(e/2),a;return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,i!=null&&i!==1/0?(a=1/(n-i),t[10]=i*a,t[14]=i*n*a):(t[10]=-1,t[14]=-n),t}function Hd(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(a+s),u=2/(i+o);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-((a-s)*l*.5),t[9]=(i-o)*u*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function Zc(t,e,r,n,i,o,a){var s=1/(e-r),l=1/(n-i),u=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(a+o)*u,t[15]=1,t}var Xd=Zc;function Kd(t,e,r,n,i,o,a){var s=1/(e-r),l=1/(n-i),u=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=u,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=o*u,t[15]=1,t}function Yd(t,e,r,n){var i,o,a,s,l,u,c,p,f,y,m=e[0],h=e[1],d=e[2],g=n[0],b=n[1],x=n[2],v=r[0],P=r[1],w=r[2];return Math.abs(m-v)<Q&&Math.abs(h-P)<Q&&Math.abs(d-w)<Q?$c(t):(c=m-v,p=h-P,f=d-w,y=1/Math.hypot(c,p,f),c*=y,p*=y,f*=y,i=b*f-x*p,o=x*c-g*f,a=g*p-b*c,y=Math.hypot(i,o,a),y?(y=1/y,i*=y,o*=y,a*=y):(i=0,o=0,a=0),s=p*a-f*o,l=f*i-c*a,u=c*o-p*i,y=Math.hypot(s,l,u),y?(y=1/y,s*=y,l*=y,u*=y):(s=0,l=0,u=0),t[0]=i,t[1]=s,t[2]=c,t[3]=0,t[4]=o,t[5]=l,t[6]=p,t[7]=0,t[8]=a,t[9]=u,t[10]=f,t[11]=0,t[12]=-(i*m+o*h+a*d),t[13]=-(s*m+l*h+u*d),t[14]=-(c*m+p*h+f*d),t[15]=1,t)}function Qd(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=n[0],l=n[1],u=n[2],c=i-r[0],p=o-r[1],f=a-r[2],y=c*c+p*p+f*f;y>0&&(y=1/Math.sqrt(y),c*=y,p*=y,f*=y);var m=l*f-u*p,h=u*c-s*f,d=s*p-l*c;return y=m*m+h*h+d*d,y>0&&(y=1/Math.sqrt(y),m*=y,h*=y,d*=y),t[0]=m,t[1]=h,t[2]=d,t[3]=0,t[4]=p*d-f*h,t[5]=f*m-c*d,t[6]=c*h-p*m,t[7]=0,t[8]=c,t[9]=p,t[10]=f,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t}function eg(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function tg(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function rg(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function Wc(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function ng(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function ig(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function og(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function ag(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8],p=t[9],f=t[10],y=t[11],m=t[12],h=t[13],d=t[14],g=t[15],b=e[0],x=e[1],v=e[2],P=e[3],w=e[4],T=e[5],F=e[6],E=e[7],_=e[8],I=e[9],k=e[10],V=e[11],A=e[12],z=e[13],O=e[14],N=e[15];return Math.abs(r-b)<=Q*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(n-x)<=Q*Math.max(1,Math.abs(n),Math.abs(x))&&Math.abs(i-v)<=Q*Math.max(1,Math.abs(i),Math.abs(v))&&Math.abs(o-P)<=Q*Math.max(1,Math.abs(o),Math.abs(P))&&Math.abs(a-w)<=Q*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(s-T)<=Q*Math.max(1,Math.abs(s),Math.abs(T))&&Math.abs(l-F)<=Q*Math.max(1,Math.abs(l),Math.abs(F))&&Math.abs(u-E)<=Q*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(c-_)<=Q*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(p-I)<=Q*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(f-k)<=Q*Math.max(1,Math.abs(f),Math.abs(k))&&Math.abs(y-V)<=Q*Math.max(1,Math.abs(y),Math.abs(V))&&Math.abs(m-A)<=Q*Math.max(1,Math.abs(m),Math.abs(A))&&Math.abs(h-z)<=Q*Math.max(1,Math.abs(h),Math.abs(z))&&Math.abs(d-O)<=Q*Math.max(1,Math.abs(d),Math.abs(O))&&Math.abs(g-N)<=Q*Math.max(1,Math.abs(g),Math.abs(N))}var sg=Gc,lg=Wc;var Yt={};Dl(Yt,{add:()=>yg,ceil:()=>mg,clone:()=>ug,copy:()=>pg,create:()=>Hc,cross:()=>_g,dist:()=>zg,distance:()=>Qc,div:()=>Bg,divide:()=>Yc,dot:()=>Ag,equals:()=>Lg,exactEquals:()=>Fg,floor:()=>hg,forEach:()=>Ug,fromValues:()=>cg,inverse:()=>Sg,len:()=>Og,length:()=>tp,lerp:()=>Ig,max:()=>gg,min:()=>dg,mul:()=>Vg,multiply:()=>Kc,negate:()=>Pg,normalize:()=>wg,random:()=>Tg,round:()=>xg,scale:()=>bg,scaleAndAdd:()=>vg,set:()=>fg,sqrDist:()=>Rg,sqrLen:()=>Ng,squaredDistance:()=>ep,squaredLength:()=>rp,str:()=>Eg,sub:()=>Dg,subtract:()=>Xc,transformMat4:()=>Cg,transformQuat:()=>kg,zero:()=>Mg});function Hc(){var t=new Ge(4);return Ge!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function ug(t){var e=new Ge(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function cg(t,e,r,n){var i=new Ge(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}function pg(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function fg(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function yg(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function Xc(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function Kc(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}function Yc(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}function mg(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t}function hg(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t}function dg(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}function gg(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}function xg(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}function bg(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function vg(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}function Qc(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return Math.hypot(r,n,i,o)}function ep(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return r*r+n*n+i*i+o*o}function tp(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.hypot(e,r,n,i)}function rp(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}function Pg(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}function Sg(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}function wg(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*r+n*n+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=o*a,t}function Ag(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function _g(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],o=r[0]*n[2]-r[2]*n[0],a=r[0]*n[3]-r[3]*n[0],s=r[1]*n[2]-r[2]*n[1],l=r[1]*n[3]-r[3]*n[1],u=r[2]*n[3]-r[3]*n[2],c=e[0],p=e[1],f=e[2],y=e[3];return t[0]=p*u-f*l+y*s,t[1]=-(c*u)+f*a-y*o,t[2]=c*l-p*a+y*i,t[3]=-(c*s)+p*o-f*i,t}function Ig(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=a+n*(r[2]-a),t[3]=s+n*(r[3]-s),t}function Tg(t,e){e=e||1;var r,n,i,o,a,s;do r=qn()*2-1,n=qn()*2-1,a=r*r+n*n;while(a>=1);do i=qn()*2-1,o=qn()*2-1,s=i*i+o*o;while(s>=1);var l=Math.sqrt((1-a)/s);return t[0]=e*r,t[1]=e*n,t[2]=e*i*l,t[3]=e*o*l,t}function Cg(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}function kg(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*o-l*i,p=u*i+l*n-a*o,f=u*o+a*i-s*n,y=-a*n-s*i-l*o;return t[0]=c*u+y*-a+p*-l-f*-s,t[1]=p*u+y*-s+f*-a-c*-l,t[2]=f*u+y*-l+c*-s-p*-a,t[3]=e[3],t}function Mg(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function Eg(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function Fg(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function Lg(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=e[0],s=e[1],l=e[2],u=e[3];return Math.abs(r-a)<=Q*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-s)<=Q*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-l)<=Q*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(o-u)<=Q*Math.max(1,Math.abs(o),Math.abs(u))}var Dg=Xc,Vg=Kc,Bg=Yc,zg=Qc,Rg=ep,Og=tp,Ng=rp,Ug=function(){var t=Hc();return function(e,r,n,i,o,a){var s,l;for(r||(r=4),n||(n=0),i?l=Math.min(i*r+n,e.length):l=e.length,s=n;s<l;s+=r)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],t[3]=e[s+3],o(t,t,a),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2],e[s+3]=t[3];return e}}();var np=Z(he(),1),Ro=class extends se{constructor(e){super(e,Nc)}createBucket(e){return new Xt(e)}queryRadius(e){let r=e;return Kt("circle-radius",this,r)+Kt("circle-stroke-width",this,r)+_t(this.paint.get("circle-translate"))}queryIntersectsFeature(e,r,n,i,o,a,s,l){let u=It(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,s),c=this.paint.get("circle-radius").evaluate(r,n),p=this.paint.get("circle-stroke-width").evaluate(r,n),f=c+p,y=this.paint.get("circle-pitch-alignment")==="map",m=y?u:$g(u,l),h=y?f*s:f;for(let d of i)for(let g of d){let b=y?g:ip(g,l),x=h,v=Yt.transformMat4([],[g.x,g.y,0,1],l);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?x*=v[3]/a.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(x*=a.cameraToCenterDistance/v[3]),Dc(m,b,x))return!0}return!1}};function ip(t,e){let r=Yt.transformMat4([],[t.x,t.y,0,1],e);return new np.default(r[0]/r[3],r[1]/r[3])}function $g(t,e){return t.map(r=>ip(r,e))}var Jn=class extends Xt{};C("HeatmapBucket",Jn,{omit:["layers"]});var op,Gg=()=>op=op||new re({"heatmap-radius":new R(S.paint_heatmap["heatmap-radius"]),"heatmap-weight":new R(S.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new B(S.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Jt(S.paint_heatmap["heatmap-color"]),"heatmap-opacity":new B(S.paint_heatmap["heatmap-opacity"])}),ap={get paint(){return Gg()}};function Ds(t,{width:e,height:r},n,i){if(!i)i=new Uint8Array(e*r*n);else if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==e*r*n)throw new RangeError(`mismatched image size. expected: ${i.length} but got: ${e*r*n}`);return t.width=e,t.height=r,t.data=i,t}function sp(t,{width:e,height:r},n){if(e===t.width&&r===t.height)return;let i=Ds({},{width:e,height:r},n);Vs(t,i,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,r)},n),t.width=e,t.height=r,t.data=i.data}function Vs(t,e,r,n,i,o){if(i.width===0||i.height===0)return e;if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");let a=t.data,s=e.data;if(a===s)throw new Error("srcData equals dstData, so image is already copied");for(let l=0;l<i.height;l++){let u=((r.y+l)*t.width+r.x)*o,c=((n.y+l)*e.width+n.x)*o;for(let p=0;p<i.width*o;p++)s[c+p]=a[u+p]}return e}var Qt=class t{constructor(e,r){Ds(this,e,1,r)}resize(e){sp(this,e,1)}clone(){return new t({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,n,i,o){Vs(e,r,n,i,o,1)}},de=class t{constructor(e,r){Ds(this,e,4,r)}resize(e){sp(this,e,4)}replace(e,r){r?this.data.set(e):e instanceof Uint8ClampedArray?this.data=new Uint8Array(e.buffer):this.data=e}clone(){return new t({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,n,i,o){Vs(e,r,n,i,o,4)}};C("AlphaImage",Qt);C("RGBAImage",de);function lp(t){let e={},r=t.resolution||256,n=t.clips?t.clips.length:1,i=t.image||new de({width:r,height:n});if(!jl(r))throw new Error(`width is not a power of 2 - ${r}`);let o=(a,s,l)=>{e[t.evaluationKey]=l;let u=t.expression.evaluate(e);i.data[a+s+0]=Math.floor(u.r*255/u.a),i.data[a+s+1]=Math.floor(u.g*255/u.a),i.data[a+s+2]=Math.floor(u.b*255/u.a),i.data[a+s+3]=Math.floor(u.a*255)};if(t.clips)for(let a=0,s=0;a<n;++a,s+=r*4)for(let l=0,u=0;l<r;l++,u+=4){let c=l/(r-1),{start:p,end:f}=t.clips[a],y=p*(1-c)+f*c;o(s,u,y)}else for(let a=0,s=0;a<r;a++,s+=4){let l=a/(r-1);o(0,s,l)}return i}var Oo=class extends se{createBucket(e){return new Jn(e)}constructor(e){super(e,ap),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){e==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){let e=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=lp({expression:e,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"}};var up,qg=()=>up=up||new re({"hillshade-illumination-direction":new B(S.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new B(S.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new B(S.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new B(S.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new B(S.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new B(S.paint_hillshade["hillshade-accent-color"])}),cp={get paint(){return qg()}};var No=class extends se{constructor(e){super(e,cp)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}};var jg=Y([{name:"a_pos",components:2,type:"Int16"}],4);var{members:pp,size:DP,alignment:VP}=jg;var gp=Z(Ns(),1);function Us(t,e,r,n,i){dp(t,e,r||0,n||t.length-1,i||sx)}function dp(t,e,r,n,i){for(;n>r;){if(n-r>600){var o=n-r+1,a=e-r+1,s=Math.log(o),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1),c=Math.max(r,Math.floor(e-a*l/o+u)),p=Math.min(n,Math.floor(e+(o-a)*l/o+u));dp(t,e,c,p,i)}var f=t[e],y=r,m=n;for(Xn(t,r,e),i(t[n],f)>0&&Xn(t,r,n);y<m;){for(Xn(t,y,m),y++,m--;i(t[y],f)<0;)y++;for(;i(t[m],f)>0;)m--}i(t[r],f)===0?Xn(t,r,m):(m++,Xn(t,m,n)),m<=e&&(r=m+1),e<=m&&(n=m-1)}}function Xn(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function sx(t,e){return t<e?-1:t>e?1:0}function Ir(t,e){let r=t.length;if(r<=1)return[t];let n=[],i,o;for(let a=0;a<r;a++){let s=Wl(t[a]);s!==0&&(t[a].area=Math.abs(s),o===void 0&&(o=s<0),o===s<0?(i&&n.push(i),i=[t[a]]):i.push(t[a]))}if(i&&n.push(i),e>1)for(let a=0;a<n.length;a++)n[a].length<=e||(Us(n[a],e,1,n[a].length-1,lx),n[a]=n[a].slice(0,e));return n}function lx(t,e){return e.area-t.area}function Tr(t,e,r){let n=r.patternDependencies,i=!1;for(let o of e){let a=o.paint.get(`${t}-pattern`);a.isConstant()||(i=!0);let s=a.constantOr(null);s&&(i=!0,n[s.to]=!0,n[s.from]=!0)}return i}function Cr(t,e,r,n,i){let o=i.patternDependencies;for(let a of e){let l=a.paint.get(`${t}-pattern`).value;if(l.kind!=="constant"){let u=l.evaluate({zoom:n-1},r,{},i.availableImages),c=l.evaluate({zoom:n},r,{},i.availableImages),p=l.evaluate({zoom:n+1},r,{},i.availableImages);u=u&&u.name?u.name:u,c=c&&c.name?c.name:c,p=p&&p.name?p.name:p,o[u]=!0,o[c]=!0,o[p]=!0,r.patterns[a.id]={min:u,mid:c,max:p}}}return r}var ux=500,tr=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new So,this.indexArray=new Le,this.indexArray2=new wt,this.programConfigurations=new Ce(e.layers,e.zoom),this.segments=new me,this.segments2=new me,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,n){this.hasPattern=Tr("fill",this.layers,r);let i=this.layers[0].layout.get("fill-sort-key"),o=!i.isConstant(),a=[];for(let{feature:s,id:l,index:u,sourceLayerIndex:c}of e){let p=this.layers[0]._featureFilter.needGeometry,f=$e(s,p);if(!this.layers[0]._featureFilter.filter(new q(this.zoom),f,n))continue;let y=o?i.evaluate(f,{},n,r.availableImages):void 0,m={id:l,properties:s.properties,type:s.type,sourceLayerIndex:c,index:u,geometry:p?f.geometry:ke(s),patterns:{},sortKey:y};a.push(m)}o&&a.sort((s,l)=>s.sortKey-l.sortKey);for(let s of a){let{geometry:l,index:u,sourceLayerIndex:c}=s;if(this.hasPattern){let f=Cr("fill",this.layers,s,this.zoom,r);this.patternFeatures.push(f)}else this.addFeature(s,l,u,n,{});let p=e[u].feature;r.featureIndex.insert(p,l,u,c,this.index)}}update(e,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,n)}addFeatures(e,r,n){for(let i of this.patternFeatures)this.addFeature(i,i.geometry,i.index,r,n)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,pp),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,n,i,o){for(let a of Ir(r,ux)){let s=0;for(let y of a)s+=y.length;let l=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray),u=l.vertexLength,c=[],p=[];for(let y of a){if(y.length===0)continue;y!==a[0]&&p.push(c.length/2);let m=this.segments2.prepareSegment(y.length,this.layoutVertexArray,this.indexArray2),h=m.vertexLength;this.layoutVertexArray.emplaceBack(y[0].x,y[0].y),this.indexArray2.emplaceBack(h+y.length-1,h),c.push(y[0].x),c.push(y[0].y);for(let d=1;d<y.length;d++)this.layoutVertexArray.emplaceBack(y[d].x,y[d].y),this.indexArray2.emplaceBack(h+d-1,h+d),c.push(y[d].x),c.push(y[d].y);m.vertexLength+=y.length,m.primitiveLength+=y.length}let f=(0,gp.default)(c,p);for(let y=0;y<f.length;y+=3)this.indexArray.emplaceBack(u+f[y],u+f[y+1],u+f[y+2]);l.vertexLength+=s,l.primitiveLength+=f.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,o,i)}};C("FillBucket",tr,{omit:["layers","patternFeatures"]});var xp,cx=()=>xp=xp||new re({"fill-sort-key":new R(S.layout_fill["fill-sort-key"])}),bp,px=()=>bp=bp||new re({"fill-antialias":new B(S.paint_fill["fill-antialias"]),"fill-opacity":new R(S.paint_fill["fill-opacity"]),"fill-color":new R(S.paint_fill["fill-color"]),"fill-outline-color":new R(S.paint_fill["fill-outline-color"]),"fill-translate":new B(S.paint_fill["fill-translate"]),"fill-translate-anchor":new B(S.paint_fill["fill-translate-anchor"]),"fill-pattern":new lt(S.paint_fill["fill-pattern"])}),vp={get paint(){return px()},get layout(){return cx()}};var jo=class extends se{constructor(e){super(e,vp)}recalculate(e,r){super.recalculate(e,r);let n=this.paint._values["fill-outline-color"];n.value.kind==="constant"&&n.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new tr(e)}queryRadius(){return _t(this.paint.get("fill-translate"))}queryIntersectsFeature(e,r,n,i,o,a,s){let l=It(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),a.angle,s);return Bo(l,i)}isTileClipped(){return!0}};var fx=Y([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Pp=Y([{name:"a_centroid",components:2,type:"Int16"}],4);var{members:Sp,size:gS,alignment:xS}=fx;var Cp=Z(Ns(),1),kp=Z(Tt(),1);var Ax=kp.default.VectorTileFeature.types,_x=500,qs=Math.pow(2,13);function Kn(t,e,r,n,i,o,a,s){t.emplaceBack(e,r,Math.floor(n*qs)*2+a,i*qs*2,o*qs*2,Math.round(s))}var rr=class{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 wo,this.centroidVertexArray=new vo,this.indexArray=new Le,this.programConfigurations=new Ce(e.layers,e.zoom),this.segments=new me,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,n){this.features=[],this.hasPattern=Tr("fill-extrusion",this.layers,r);for(let{feature:i,id:o,index:a,sourceLayerIndex:s}of e){let l=this.layers[0]._featureFilter.needGeometry,u=$e(i,l);if(!this.layers[0]._featureFilter.filter(new q(this.zoom),u,n))continue;let c={id:o,sourceLayerIndex:s,index:a,geometry:l?u.geometry:ke(i),properties:i.properties,type:i.type,patterns:{}};this.hasPattern?this.features.push(Cr("fill-extrusion",this.layers,c,this.zoom,r)):this.addFeature(c,c.geometry,a,n,{}),r.featureIndex.insert(i,c.geometry,a,s,this.index,!0)}}addFeatures(e,r,n){for(let i of this.features){let{geometry:o}=i;this.addFeature(i,o,i.index,r,n)}}update(e,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,n)}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,Sp),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Pp.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,n,i,o){let a={x:0,y:0,vertexCount:0};for(let s of Ir(r,_x)){let l=0;for(let m of s)l+=m.length;let u=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let m of s){if(m.length===0||Tx(m))continue;let h=0;for(let d=0;d<m.length;d++){let g=m[d];if(d>=1){let b=m[d-1];if(!Ix(g,b)){u.vertexLength+4>me.MAX_VERTEX_ARRAY_LENGTH&&(u=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let x=g.sub(b)._perp()._unit(),v=b.dist(g);h+v>32768&&(h=0),Kn(this.layoutVertexArray,g.x,g.y,x.x,x.y,0,0,h),Kn(this.layoutVertexArray,g.x,g.y,x.x,x.y,0,1,h),a.x+=2*g.x,a.y+=2*g.y,a.vertexCount+=2,h+=v,Kn(this.layoutVertexArray,b.x,b.y,x.x,x.y,0,0,h),Kn(this.layoutVertexArray,b.x,b.y,x.x,x.y,0,1,h),a.x+=2*b.x,a.y+=2*b.y,a.vertexCount+=2;let P=u.vertexLength;this.indexArray.emplaceBack(P,P+2,P+1),this.indexArray.emplaceBack(P+1,P+2,P+3),u.vertexLength+=4,u.primitiveLength+=2}}}}if(u.vertexLength+l>me.MAX_VERTEX_ARRAY_LENGTH&&(u=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),Ax[e.type]!=="Polygon")continue;let c=[],p=[],f=u.vertexLength;for(let m of s)if(m.length!==0){m!==s[0]&&p.push(c.length/2);for(let h=0;h<m.length;h++){let d=m[h];Kn(this.layoutVertexArray,d.x,d.y,0,0,1,1,0),a.x+=d.x,a.y+=d.y,a.vertexCount+=1,c.push(d.x),c.push(d.y)}}let y=(0,Cp.default)(c,p);for(let m=0;m<y.length;m+=3)this.indexArray.emplaceBack(f+y[m],f+y[m+2],f+y[m+1]);u.primitiveLength+=y.length/3,u.vertexLength+=l}for(let s=0;s<a.vertexCount;s++)this.centroidVertexArray.emplaceBack(Math.floor(a.x/a.vertexCount),Math.floor(a.y/a.vertexCount));this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,o,i)}};C("FillExtrusionBucket",rr,{omit:["layers","features"]});function Ix(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}function Tx(t){return t.every(e=>e.x<0)||t.every(e=>e.x>8192)||t.every(e=>e.y<0)||t.every(e=>e.y>8192)}var Mp,Cx=()=>Mp=Mp||new re({"fill-extrusion-opacity":new B(S["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new R(S["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new B(S["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new B(S["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new lt(S["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new R(S["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new R(S["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new B(S["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),Ep={get paint(){return Cx()}};var Zo=Z(he(),1);var Wo=class extends se{constructor(e){super(e,Ep)}createBucket(e){return new rr(e)}queryRadius(){return _t(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(e,r,n,i,o,a,s,l){let u=It(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,s),c=this.paint.get("fill-extrusion-height").evaluate(r,n),p=this.paint.get("fill-extrusion-base").evaluate(r,n),f=Ex(u,l,a,0),y=Mx(i,p,c,l),m=y[0],h=y[1];return kx(m,h,f)}};function Yn(t,e){return t.x*e.x+t.y*e.y}function Fp(t,e){if(t.length===1){let r=0,n=e[r++],i;for(;!i||n.equals(i);)if(i=e[r++],!i)return 1/0;for(;r<e.length;r++){let o=e[r],a=t[0],s=i.sub(n),l=o.sub(n),u=a.sub(n),c=Yn(s,s),p=Yn(s,l),f=Yn(l,l),y=Yn(u,s),m=Yn(u,l),h=c*f-p*p,d=(f*y-p*m)/h,g=(c*m-p*y)/h,b=1-d-g,x=n.z*b+i.z*d+o.z*g;if(isFinite(x))return x}return 1/0}else{let r=1/0;for(let n of e)r=Math.min(r,n.z);return r}}function kx(t,e,r){let n=1/0;Bo(r,e)&&(n=Fp(r,e[0]));for(let i=0;i<e.length;i++){let o=e[i],a=t[i];for(let s=0;s<o.length-1;s++){let l=o[s],u=o[s+1],c=a[s],p=a[s+1],f=[l,u,p,c,l];Lc(r,f)&&(n=Math.min(n,Fp(r,f)))}}return n===1/0?!1:n}function Mx(t,e,r,n){let i=[],o=[],a=n[8]*e,s=n[9]*e,l=n[10]*e,u=n[11]*e,c=n[8]*r,p=n[9]*r,f=n[10]*r,y=n[11]*r;for(let m of t){let h=[],d=[];for(let g of m){let b=g.x,x=g.y,v=n[0]*b+n[4]*x+n[12],P=n[1]*b+n[5]*x+n[13],w=n[2]*b+n[6]*x+n[14],T=n[3]*b+n[7]*x+n[15],F=v+a,E=P+s,_=w+l,I=T+u,k=v+c,V=P+p,A=w+f,z=T+y,O=new Zo.default(F/I,E/I);O.z=_/I,h.push(O);let N=new Zo.default(k/z,V/z);N.z=A/z,d.push(N)}i.push(h),o.push(d)}return[i,o]}function Ex(t,e,r,n){let i=[];for(let o of t){let a=[o.x,o.y,n,1];Yt.transformMat4(a,a,e),i.push(new Zo.default(a[0]/a[3],a[1]/a[3]))}return i}var Fx=Y([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:Lp,size:ew,alignment:tw}=Fx;var Lx=Y([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:Dp,size:iw,alignment:ow}=Lx;var zp=Z(Tt(),1);var Dx=zp.default.VectorTileFeature.types,Vp=63,Vx=Math.cos(75/2*(Math.PI/180)),Bx=15,zx=20,Rx=15,Rp=1/2,Bp=Math.pow(2,Rx-1)/Rp,nr=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(r=>{this.gradients[r.id]={}}),this.layoutVertexArray=new Ao,this.layoutVertexArray2=new _o,this.indexArray=new Le,this.programConfigurations=new Ce(e.layers,e.zoom),this.segments=new me,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,n){this.hasPattern=Tr("line",this.layers,r);let i=this.layers[0].layout.get("line-sort-key"),o=!i.isConstant(),a=[];for(let{feature:s,id:l,index:u,sourceLayerIndex:c}of e){let p=this.layers[0]._featureFilter.needGeometry,f=$e(s,p);if(!this.layers[0]._featureFilter.filter(new q(this.zoom),f,n))continue;let y=o?i.evaluate(f,{},n):void 0,m={id:l,properties:s.properties,type:s.type,sourceLayerIndex:c,index:u,geometry:p?f.geometry:ke(s),patterns:{},sortKey:y};a.push(m)}o&&a.sort((s,l)=>s.sortKey-l.sortKey);for(let s of a){let{geometry:l,index:u,sourceLayerIndex:c}=s;if(this.hasPattern){let f=Cr("line",this.layers,s,this.zoom,r);this.patternFeatures.push(f)}else this.addFeature(s,l,u,n,{});let p=e[u].feature;r.featureIndex.insert(p,l,u,c,this.index)}}update(e,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,n)}addFeatures(e,r,n){for(let i of this.patternFeatures)this.addFeature(i,i.geometry,i.index,r,n)}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,Dp)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Lp),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")){let r=+e.properties.mapbox_clip_start,n=+e.properties.mapbox_clip_end;return{start:r,end:n}}}addFeature(e,r,n,i,o){let a=this.layers[0].layout,s=a.get("line-join").evaluate(e,{}),l=a.get("line-cap"),u=a.get("line-miter-limit"),c=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(let p of r)this.addLine(p,e,s,l,u,c);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,o,i)}addLine(e,r,n,i,o,a){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let g=0;g<e.length-1;g++)this.totalDistance+=e[g].dist(e[g+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let s=Dx[r.type]==="Polygon",l=e.length;for(;l>=2&&e[l-1].equals(e[l-2]);)l--;let u=0;for(;u<l-1&&e[u].equals(e[u+1]);)u++;if(l<(s?3:2))return;n==="bevel"&&(o=1.05);let c=this.overscaling<=16?Bx*8192/(512*this.overscaling):0,p=this.segments.prepareSegment(l*10,this.layoutVertexArray,this.indexArray),f,y,m,h,d;this.e1=this.e2=-1,s&&(f=e[l-2],d=e[u].sub(f)._unit()._perp());for(let g=u;g<l;g++){if(m=g===l-1?s?e[u+1]:void 0:e[g+1],m&&e[g].equals(m))continue;d&&(h=d),f&&(y=f),f=e[g],d=m?m.sub(f)._unit()._perp():h,h=h||d;let b=h.add(d);(b.x!==0||b.y!==0)&&b._unit();let x=h.x*d.x+h.y*d.y,v=b.x*d.x+b.y*d.y,P=v!==0?1/v:1/0,w=2*Math.sqrt(2-2*v),T=v<Vx&&y&&m,F=h.x*d.y-h.y*d.x>0;if(T&&g>u){let I=f.dist(y);if(I>2*c){let k=f.sub(f.sub(y)._mult(c/I)._round());this.updateDistance(y,k),this.addCurrentVertex(k,h,0,0,p),y=k}}let E=y&&m,_=E?n:s?"butt":i;if(E&&_==="round"&&(P<a?_="miter":P<=2&&(_="fakeround")),_==="miter"&&P>o&&(_="bevel"),_==="bevel"&&(P>2&&(_="flipbevel"),P<o&&(_="miter")),y&&this.updateDistance(y,f),_==="miter")b._mult(P),this.addCurrentVertex(f,b,0,0,p);else if(_==="flipbevel"){if(P>100)b=d.mult(-1);else{let I=P*h.add(d).mag()/h.sub(d).mag();b._perp()._mult(I*(F?-1:1))}this.addCurrentVertex(f,b,0,0,p),this.addCurrentVertex(f,b.mult(-1),0,0,p)}else if(_==="bevel"||_==="fakeround"){let I=-Math.sqrt(P*P-1),k=F?I:0,V=F?0:I;if(y&&this.addCurrentVertex(f,h,k,V,p),_==="fakeround"){let A=Math.round(w*180/Math.PI/zx);for(let z=1;z<A;z++){let O=z/A;if(O!==.5){let K=O-.5,xe=1.0904+x*(-3.2452+x*(3.55645-x*1.43519)),X=.848013+x*(-1.06021+x*.215638);O=O+O*K*(O-1)*(xe*K*K+X)}let N=d.sub(h)._mult(O)._add(h)._unit()._mult(F?-1:1);this.addHalfVertex(f,N.x,N.y,!1,F,0,p)}}m&&this.addCurrentVertex(f,d,-k,-V,p)}else if(_==="butt")this.addCurrentVertex(f,b,0,0,p);else if(_==="square"){let I=y?1:-1;this.addCurrentVertex(f,b,I,I,p)}else _==="round"&&(y&&(this.addCurrentVertex(f,h,0,0,p),this.addCurrentVertex(f,h,1,1,p,!0)),m&&(this.addCurrentVertex(f,d,-1,-1,p,!0),this.addCurrentVertex(f,d,0,0,p)));if(T&&g<l-1){let I=f.dist(m);if(I>2*c){let k=f.add(m.sub(f)._mult(c/I)._round());this.updateDistance(f,k),this.addCurrentVertex(k,d,0,0,p),f=k}}}}addCurrentVertex(e,r,n,i,o,a=!1){let s=r.x+r.y*n,l=r.y-r.x*n,u=-r.x+r.y*i,c=-r.y-r.x*i;this.addHalfVertex(e,s,l,a,!1,n,o),this.addHalfVertex(e,u,c,a,!0,-i,o),this.distance>Bp/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,r,n,i,o,a))}addHalfVertex({x:e,y:r},n,i,o,a,s,l){let c=(this.lineClips?this.scaledDistance*(Bp-1):this.scaledDistance)*Rp;if(this.layoutVertexArray.emplaceBack((e<<1)+(o?1:0),(r<<1)+(a?1:0),Math.round(Vp*n)+128,Math.round(Vp*i)+128,(s===0?0:s<0?-1:1)+1|(c&63)<<2,c>>6),this.lineClips){let f=this.scaledDistance-this.lineClips.start,y=this.lineClips.end-this.lineClips.start,m=f/y;this.layoutVertexArray2.emplaceBack(m,this.lineClipsArray.length)}let p=l.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,p),l.primitiveLength++),a?this.e2=p:this.e1=p}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()}};C("LineBucket",nr,{omit:["layers","patternFeatures"]});var Op,Ox=()=>Op=Op||new re({"line-cap":new B(S.layout_line["line-cap"]),"line-join":new R(S.layout_line["line-join"]),"line-miter-limit":new B(S.layout_line["line-miter-limit"]),"line-round-limit":new B(S.layout_line["line-round-limit"]),"line-sort-key":new R(S.layout_line["line-sort-key"])}),Np,Nx=()=>Np=Np||new re({"line-opacity":new R(S.paint_line["line-opacity"]),"line-color":new R(S.paint_line["line-color"]),"line-translate":new B(S.paint_line["line-translate"]),"line-translate-anchor":new B(S.paint_line["line-translate-anchor"]),"line-width":new R(S.paint_line["line-width"]),"line-gap-width":new R(S.paint_line["line-gap-width"]),"line-offset":new R(S.paint_line["line-offset"]),"line-blur":new R(S.paint_line["line-blur"]),"line-dasharray":new jt(S.paint_line["line-dasharray"]),"line-pattern":new lt(S.paint_line["line-pattern"]),"line-gradient":new Jt(S.paint_line["line-gradient"])}),js={get paint(){return Nx()},get layout(){return Ox()}};var Js=class extends R{possiblyEvaluate(e,r){return r=new q(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),super.possiblyEvaluate(e,r)}evaluate(e,r,n,i){return r=Pe({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(e,r,n,i)}},Ho,Xo=class extends se{constructor(e){super(e,js),this.gradientVersion=0,Ho||(Ho=new Js(js.paint.properties["line-width"].specification),Ho.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){let r=this.gradientExpression();Gt(r)?this.stepInterpolant=r._styleExpression.expression instanceof fr:this.stepInterpolant=!1,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,r){super.recalculate(e,r),this.paint._values["line-floorwidth"]=Ho.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new nr(e)}queryRadius(e){let r=e,n=Up(Kt("line-width",this,r),Kt("line-gap-width",this,r)),i=Kt("line-offset",this,r);return n/2+Math.abs(i)+_t(this.paint.get("line-translate"))}queryIntersectsFeature(e,r,n,i,o,a,s){let l=It(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),u=s/2*Up(this.paint.get("line-width").evaluate(r,n),this.paint.get("line-gap-width").evaluate(r,n)),c=this.paint.get("line-offset").evaluate(r,n);return c&&(i=zc(i,c*s)),Vc(l,i,u)}isTileClipped(){return!0}};function Up(t,e){return e>0?e+2*t:t}var $p=Y([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Gp=Y([{name:"a_projected_pos",components:3,type:"Float32"}],4),$w=Y([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),qp=Y([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),Gw=Y([{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"}]),Zs=Y([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),qw=Y([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),jw=Y([{name:"triangle",components:3,type:"Uint16"}]),Jw=Y([{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"}]),Zw=Y([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),Ww=Y([{type:"Float32",name:"offsetX"}]),Hw=Y([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Xw=Y([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);var ii=Z(he(),1);function Ux(t,e,r){let n=e.layout.get("text-transform").evaluate(r,{});return n==="uppercase"?t=t.toLocaleUpperCase():n==="lowercase"&&(t=t.toLocaleLowerCase()),ye.applyArabicShaping&&(t=ye.applyArabicShaping(t)),t}function jp(t,e,r){return t.sections.forEach(n=>{n.text=Ux(n.text,e,r)}),t}function Jp(t){let e={},r={},n=[],i=0;function o(u){n.push(t[u]),i++}function a(u,c,p){let f=r[u];return delete r[u],r[c]=f,n[f].geometry[0].pop(),n[f].geometry[0]=n[f].geometry[0].concat(p[0]),f}function s(u,c,p){let f=e[c];return delete e[c],e[u]=f,n[f].geometry[0].shift(),n[f].geometry[0]=p[0].concat(n[f].geometry[0]),f}function l(u,c,p){let f=p?c[0][c[0].length-1]:c[0][0];return`${u}:${f.x}:${f.y}`}for(let u=0;u<t.length;u++){let c=t[u],p=c.geometry,f=c.text?c.text.toString():null;if(!f){o(u);continue}let y=l(f,p),m=l(f,p,!0);if(y in r&&m in e&&r[y]!==e[m]){let h=s(y,m,p),d=a(y,m,n[h].geometry);delete e[y],delete r[m],r[l(f,n[d].geometry,!0)]=d,n[h].geometry=null}else y in r?a(y,m,p):m in e?s(y,m,p):(o(u),e[y]=i-1,r[m]=i-1)}return n.filter(u=>u.geometry)}var Mr={"!":"\\uFE15","#":"\\uFF03",$:"\\uFF04","%":"\\uFF05","&":"\\uFF06","(":"\\uFE35",")":"\\uFE36","*":"\\uFF0A","+":"\\uFF0B",",":"\\uFE10","-":"\\uFE32",".":"\\u30FB","/":"\\uFF0F",":":"\\uFE13",";":"\\uFE14","<":"\\uFE3F","=":"\\uFF1D",">":"\\uFE40","?":"\\uFE16","@":"\\uFF20","[":"\\uFE47","\\\\":"\\uFF3C","]":"\\uFE48","^":"\\uFF3E",_:"\\uFE33","`":"\\uFF40","{":"\\uFE37","|":"\\u2015","}":"\\uFE38","~":"\\uFF5E","\\xA2":"\\uFFE0","\\xA3":"\\uFFE1","\\xA5":"\\uFFE5","\\xA6":"\\uFFE4","\\xAC":"\\uFFE2","\\xAF":"\\uFFE3","\\u2013":"\\uFE32","\\u2014":"\\uFE31","\\u2018":"\\uFE43","\\u2019":"\\uFE44","\\u201C":"\\uFE41","\\u201D":"\\uFE42","\\u2026":"\\uFE19","\\u2027":"\\u30FB","\\u20A9":"\\uFFE6","\\u3001":"\\uFE11","\\u3002":"\\uFE12","\\u3008":"\\uFE3F","\\u3009":"\\uFE40","\\u300A":"\\uFE3D","\\u300B":"\\uFE3E","\\u300C":"\\uFE41","\\u300D":"\\uFE42","\\u300E":"\\uFE43","\\u300F":"\\uFE44","\\u3010":"\\uFE3B","\\u3011":"\\uFE3C","\\u3014":"\\uFE39","\\u3015":"\\uFE3A","\\u3016":"\\uFE17","\\u3017":"\\uFE18","\\uFF01":"\\uFE15","\\uFF08":"\\uFE35","\\uFF09":"\\uFE36","\\uFF0C":"\\uFE10","\\uFF0D":"\\uFE32","\\uFF0E":"\\u30FB","\\uFF1A":"\\uFE13","\\uFF1B":"\\uFE14","\\uFF1C":"\\uFE3F","\\uFF1E":"\\uFE40","\\uFF1F":"\\uFE16","\\uFF3B":"\\uFE47","\\uFF3D":"\\uFE48","\\uFF3F":"\\uFE33","\\uFF5B":"\\uFE37","\\uFF5C":"\\u2015","\\uFF5D":"\\uFE38","\\uFF5F":"\\uFE35","\\uFF60":"\\uFE36","\\uFF61":"\\uFE12","\\uFF62":"\\uFE41","\\uFF63":"\\uFE42"};function Zp(t){let e="";for(let r=0;r<t.length;r++){let n=t.charCodeAt(r+1)||null,i=t.charCodeAt(r-1)||null;(!n||!Ss(n)||Mr[t[r+1]])&&(!i||!Ss(i)||Mr[t[r-1]])&&Mr[t[r]]?e+=Mr[t[r]]:e+=t[r]}return e}var ne=24;var ob=Z(Qn(),1),ab=3;var Qo=ab;function ei(t){let e=0,r=0;for(let s of t)e+=s.w*s.h,r=Math.max(r,s.w);t.sort((s,l)=>l.h-s.h);let i=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],o=0,a=0;for(let s of t)for(let l=i.length-1;l>=0;l--){let u=i[l];if(!(s.w>u.w||s.h>u.h)){if(s.x=u.x,s.y=u.y,a=Math.max(a,s.y+s.h),o=Math.max(o,s.x+s.w),s.w===u.w&&s.h===u.h){let c=i.pop();l<i.length&&(i[l]=c)}else s.h===u.h?(u.x+=s.w,u.w-=s.w):s.w===u.w?(u.y+=s.h,u.h-=s.h):(i.push({x:u.x+s.w,y:u.y,w:u.w-s.w,h:s.h}),u.y+=s.h,u.h-=s.h);break}}return{w:o,h:a,fill:e/(o*a)||0}}var ge=1;var ea=class{constructor(e,{pixelRatio:r,version:n,stretchX:i,stretchY:o,content:a}){this.paddedRect=e,this.pixelRatio=r,this.stretchX=i,this.stretchY=o,this.content=a,this.version=n}get tl(){return[this.paddedRect.x+ge,this.paddedRect.y+ge]}get br(){return[this.paddedRect.x+this.paddedRect.w-ge,this.paddedRect.y+this.paddedRect.h-ge]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-ge*2)/this.pixelRatio,(this.paddedRect.h-ge*2)/this.pixelRatio]}},ti=class{constructor(e,r){let n={},i={};this.haveRenderCallbacks=[];let o=[];this.addImages(e,n,o),this.addImages(r,i,o);let{w:a,h:s}=ei(o),l=new de({width:a||1,height:s||1});for(let u in e){let c=e[u],p=n[u].paddedRect;de.copy(c.data,l,{x:0,y:0},{x:p.x+ge,y:p.y+ge},c.data)}for(let u in r){let c=r[u],p=i[u].paddedRect,f=p.x+ge,y=p.y+ge,m=c.data.width,h=c.data.height;de.copy(c.data,l,{x:0,y:0},{x:f,y},c.data),de.copy(c.data,l,{x:0,y:h-1},{x:f,y:y-1},{width:m,height:1}),de.copy(c.data,l,{x:0,y:0},{x:f,y:y+h},{width:m,height:1}),de.copy(c.data,l,{x:m-1,y:0},{x:f-1,y},{width:1,height:h}),de.copy(c.data,l,{x:0,y:0},{x:f+m,y},{width:1,height:h})}this.image=l,this.iconPositions=n,this.patternPositions=i}addImages(e,r,n){for(let i in e){let o=e[i],a={x:0,y:0,w:o.data.width+2*ge,h:o.data.height+2*ge};n.push(a),r[i]=new ea(a,o),o.hasRenderCallback&&this.haveRenderCallbacks.push(i)}}patchUpdatedImages(e,r){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let n in e.updatedImages)this.patchUpdatedImage(this.iconPositions[n],e.getImage(n),r),this.patchUpdatedImage(this.patternPositions[n],e.getImage(n),r)}patchUpdatedImage(e,r,n){if(!e||!r||e.version===r.version)return;e.version=r.version;let[i,o]=e.tl;n.update(r.data,void 0,{x:i,y:o})}};C("ImagePosition",ea);C("ImageAtlas",ti);var na=(i=>(i[i.none=0]="none",i[i.horizontal=1]="horizontal",i[i.vertical=2]="vertical",i[i.horizontalOnly=3]="horizontalOnly",i))(na||{}),Lr=-17;function sb(t){for(let e of t)if(e.positionedGlyphs.length!==0)return!1;return!0}var ef=57344,tf=63743,ta=class t{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,r){let n=new t;return n.scale=e||1,n.fontStack=r,n}static forImage(e){let r=new t;return r.imageName=e,r}},ri=class t{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,r){let n=new t;for(let i=0;i<e.sections.length;i++){let o=e.sections[i];o.image?n.addImageSection(o):n.addTextSection(o,r)}return n}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}getCharCode(e){return this.text.charCodeAt(e)}verticalizePunctuation(){this.text=Zp(this.text)}trim(){let e=0;for(let n=0;n<this.text.length&&ra[this.text.charCodeAt(n)];n++)e++;let r=this.text.length;for(let n=this.text.length-1;n>=0&&n>=e&&ra[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)}substring(e,r){let n=new t;return n.text=this.text.substring(e,r),n.sectionIndex=this.sectionIndex.slice(e,r),n.sections=this.sections,n}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(ta.forText(e.scale,e.fontStack||r));let n=this.sections.length-1;for(let i=0;i<e.text.length;++i)this.sectionIndex.push(n)}addImageSection(e){let r=e.image?e.image.name:"";if(r.length===0){fe("Can\'t add FormattedSection with an empty image.");return}let n=this.getNextImageSectionCharCode();if(!n){fe(`Reached maximum number of images ${tf-ef+2}`);return}this.text+=String.fromCharCode(n),this.sections.push(ta.forImage(r)),this.sectionIndex.push(this.sections.length-1)}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=tf?null:++this.imageSectionID:(this.imageSectionID=ef,this.imageSectionID)}};function lb(t,e){let r=[],n=t.text,i=0;for(let o of e)r.push(t.substring(i,o)),i=o;return i<n.length&&r.push(t.substring(i,n.length)),r}function ni(t,e,r,n,i,o,a,s,l,u,c,p,f,y,m,h){let d=ri.fromFeature(t,i);p===2&&d.verticalizePunctuation();let g,{processBidirectionalText:b,processStyledBidirectionalText:x}=ye;if(b&&d.sections.length===1){g=[];let w=b(d.toString(),Xs(d,u,o,e,n,y,m));for(let T of w){let F=new ri;F.text=T,F.sections=d.sections;for(let E=0;E<T.length;E++)F.sectionIndex.push(0);g.push(F)}}else if(x){g=[];let w=x(d.text,d.sectionIndex,Xs(d,u,o,e,n,y,m));for(let T of w){let F=new ri;F.text=T[0],F.sectionIndex=T[1],F.sections=d.sections,g.push(F)}}else g=lb(d,Xs(d,u,o,e,n,y,m));let v=[],P={positionedLines:v,text:d.toString(),top:c[1],bottom:c[1],left:c[0],right:c[0],writingMode:p,iconsInText:!1,verticalizable:!1};return fb(P,e,r,n,g,a,s,l,p,u,f,h),sb(v)?!1:P}var ra={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},ub={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 of(t,e,r,n,i,o){if(e.imageName){let a=n[e.imageName];return a?a.displaySize[0]*e.scale*ne/o+i:0}else{let a=r[e.fontStack],s=a&&a[t];return s?s.metrics.advance*e.scale+i:0}}function cb(t,e,r,n,i,o){let a=0;for(let l=0;l<t.length();l++){let u=t.getSection(l);a+=of(t.getCharCode(l),u,n,i,e,o)}let s=Math.max(1,Math.ceil(a/r));return a/s}function rf(t,e,r,n){let i=Math.pow(t-e,2);return n?t<e?i/2:i*2:i+Math.abs(r)*r}function pb(t,e,r){let n=0;return t===10&&(n-=1e4),r&&(n+=150),(t===40||t===65288)&&(n+=50),(e===41||e===65289)&&(n+=50),n}function nf(t,e,r,n,i,o){let a=null,s=rf(e,r,i,o);for(let l of n){let u=e-l.x,c=rf(u,r,i,o)+l.badness;c<=s&&(a=l,s=c)}return{index:t,x:e,priorBreak:a,badness:s}}function af(t){return t?af(t.priorBreak).concat(t.index):[]}function Xs(t,e,r,n,i,o,a){if(o!=="point")return[];if(!t)return[];let s=[],l=cb(t,e,r,n,i,a),u=t.text.indexOf("\\u200B")>=0,c=0;for(let p=0;p<t.length();p++){let f=t.getSection(p),y=t.getCharCode(p);if(ra[y]||(c+=of(y,f,n,i,e,a)),p<t.length()-1){let m=gc(y);(ub[y]||m||f.imageName)&&s.push(nf(p+1,c,l,s,pb(y,t.getCharCode(p+1),m&&u),!1))}}return af(nf(t.length(),c,l,s,0,!0))}function sf(t){let e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0;break}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0;break}return{horizontalAlign:e,verticalAlign:r}}function fb(t,e,r,n,i,o,a,s,l,u,c,p){let f=0,y=Lr,m=0,h=0,d=s==="right"?1:s==="left"?0:.5,g=0;for(let P of i){P.trim();let w=P.getMaxScale(),T=(w-1)*ne,F={positionedGlyphs:[],lineOffset:0};t.positionedLines[g]=F;let E=F.positionedGlyphs,_=0;if(!P.length()){y+=o,++g;continue}for(let k=0;k<P.length();k++){let V=P.getSection(k),A=P.getSectionIndex(k),z=P.getCharCode(k),O=0,N=null,K=null,xe=null,X=ne,le=!(l===1||!c&&!oo(z)||c&&(ra[z]||xc(z)));if(V.imageName){let ce=n[V.imageName];if(!ce)continue;xe=V.imageName,t.iconsInText=t.iconsInText||!0,K=ce.paddedRect;let pe=ce.displaySize;V.scale=V.scale*ne/p,N={width:pe[0],height:pe[1],left:ge,top:-Qo,advance:le?pe[1]:pe[0]};let _e=ne-pe[1]*V.scale;O=T+_e,X=N.advance;let be=le?pe[0]*V.scale-ne*w:pe[1]*V.scale-ne*w;be>0&&be>_&&(_=be)}else{let ce=r[V.fontStack],pe=ce&&ce[z];if(pe&&pe.rect)K=pe.rect,N=pe.metrics;else{let _e=e[V.fontStack],be=_e&&_e[z];if(!be)continue;N=be.metrics}O=(w-V.scale)*ne}le?(t.verticalizable=!0,E.push({glyph:z,imageName:xe,x:f,y:y+O,vertical:le,scale:V.scale,fontStack:V.fontStack,sectionIndex:A,metrics:N,rect:K}),f+=X*V.scale+u):(E.push({glyph:z,imageName:xe,x:f,y:y+O,vertical:le,scale:V.scale,fontStack:V.fontStack,sectionIndex:A,metrics:N,rect:K}),f+=N.advance*V.scale+u)}if(E.length!==0){let k=f-u;m=Math.max(k,m),yb(E,0,E.length-1,d,_)}f=0;let I=o*w+_;F.lineOffset=Math.max(_,T),y+=I,h=Math.max(I,h),++g}let b=y-Lr,{horizontalAlign:x,verticalAlign:v}=sf(a);mb(t.positionedLines,d,x,v,m,h,o,b,i.length),t.top+=-v*b,t.bottom=t.top+b,t.left+=-x*m,t.right=t.left+m}function yb(t,e,r,n,i){if(!n&&!i)return;let o=t[r],a=o.metrics.advance*o.scale,s=(t[r].x+a)*n;for(let l=e;l<=r;l++)t[l].x-=s,t[l].y+=i}function mb(t,e,r,n,i,o,a,s,l){let u=(e-r)*i,c=0;o!==a?c=-s*n-Lr:c=(-n*l+.5)*a;for(let p of t)for(let f of p.positionedGlyphs)f.x+=u,f.y+=c}function lf(t,e,r){let{horizontalAlign:n,verticalAlign:i}=sf(r),o=e[0],a=e[1],s=o-t.displaySize[0]*n,l=s+t.displaySize[0],u=a-t.displaySize[1]*i,c=u+t.displaySize[1];return{image:t,top:u,bottom:c,left:s,right:l}}function Ks(t,e,r,n,i,o){let a=t.image,s;if(a.content){let d=a.content,g=a.pixelRatio||1;s=[d[0]/g,d[1]/g,a.displaySize[0]-d[2]/g,a.displaySize[1]-d[3]/g]}let l=e.left*o,u=e.right*o,c,p,f,y;r==="width"||r==="both"?(y=i[0]+l-n[3],p=i[0]+u+n[1]):(y=i[0]+(l+u-a.displaySize[0])/2,p=y+a.displaySize[0]);let m=e.top*o,h=e.bottom*o;return r==="height"||r==="both"?(c=i[1]+m-n[0],f=i[1]+h+n[2]):(c=i[1]+(m+h-a.displaySize[1])/2,f=c+a.displaySize[1]),{image:a,top:c,right:p,bottom:f,left:y,collisionPadding:s}}var uf=Z(Tt(),1);var Dr=255,Ct=128,tt=Dr*Ct;function Ys(t,e){let{expression:r}=e;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new q(t+1))};if(r.kind==="source")return{kind:"source"};{let{zoomStops:n,interpolationType:i}=r,o=0;for(;o<n.length&&n[o]<=t;)o++;o=Math.max(0,o-1);let a=o;for(;a<n.length&&n[a]<t+1;)a++;a=Math.min(n.length-1,a);let s=n[o],l=n[a];if(r.kind==="composite")return{kind:"composite",minZoom:s,maxZoom:l,interpolationType:i};let u=r.evaluate(new q(s)),c=r.evaluate(new q(l));return{kind:"camera",minZoom:s,maxZoom:l,minSize:u,maxSize:c,interpolationType:i}}}function Qs(t,e,r){let n="never",i=t.get(e);return i?n=i:t.get(r)&&(n="always"),n}var hb=uf.default.VectorTileFeature.types,db=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function ia(t,e,r,n,i,o,a,s,l,u,c,p,f){let y=s?Math.min(tt,Math.round(s[0])):0,m=s?Math.min(tt,Math.round(s[1])):0;t.emplaceBack(e,r,Math.round(n*32),Math.round(i*32),o,a,(y<<1)+(l?1:0),m,u*16,c*16,p*256,f*256)}function cf(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r)}function gb(t){for(let e of t.sections)if(vc(e.text))return!0;return!1}var oi=class{constructor(e){this.layoutVertexArray=new Io,this.indexArray=new Le,this.programConfigurations=e,this.segments=new me,this.dynamicLayoutVertexArray=new To,this.opacityVertexArray=new Co,this.hasVisibleVertices=!1,this.placedSymbolArray=new Ln}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,r,n,i){this.isEmpty()||(n&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,$p.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,r),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Gp.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,db,!0),this.opacityVertexBuffer.itemSize=1),(n||i)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}};C("SymbolBuffers",oi);var ai=class{constructor(e,r,n){this.layoutVertexArray=new e,this.layoutAttributes=r,this.indexArray=new n,this.segments=new me,this.collisionVertexArray=new ko}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,qp.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}};C("CollisionBuffers",ai);var He=class{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(l=>l.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=jn.identity([]),this.placementViewportMatrix=jn.identity([]);let n=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Ys(this.zoom,n["text-size"]),this.iconSizeData=Ys(this.zoom,n["icon-size"]);let i=this.layers[0].layout,o=i.get("symbol-sort-key"),a=i.get("symbol-z-order");this.canOverlap=Qs(i,"text-overlap","text-allow-overlap")!=="never"||Qs(i,"icon-overlap","icon-allow-overlap")!=="never"||i.get("text-ignore-placement")||i.get("icon-ignore-placement"),this.sortFeaturesByKey=a!=="viewport-y"&&!o.isConstant();let s=a==="viewport-y"||a==="auto"&&!this.sortFeaturesByKey;this.sortFeaturesByY=s&&this.canOverlap,i.get("symbol-placement")==="point"&&(this.writingModes=i.get("text-writing-mode").map(l=>na[l])),this.stateDependentLayerIds=this.layers.filter(l=>l.isStateDependent()).map(l=>l.id),this.sourceID=e.sourceID}createArrays(){this.text=new oi(new Ce(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new oi(new Ce(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new Vn,this.lineVertexArray=new Bn,this.symbolInstances=new Dn,this.textAnchorOffsets=new zn}calculateGlyphDependencies(e,r,n,i,o){for(let a=0;a<e.length;a++)if(r[e.charCodeAt(a)]=!0,(n||i)&&o){let s=Mr[e.charAt(a)];s&&(r[s.charCodeAt(0)]=!0)}}populate(e,r,n){let i=this.layers[0],o=i.layout,a=o.get("text-font"),s=o.get("text-field"),l=o.get("icon-image"),u=(s.value.kind!=="constant"||s.value.value instanceof Fe&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&(a.value.kind!=="constant"||a.value.value.length>0),c=l.value.kind!=="constant"||!!l.value.value||Object.keys(l.parameters).length>0,p=o.get("symbol-sort-key");if(this.features=[],!u&&!c)return;let f=r.iconDependencies,y=r.glyphDependencies,m=r.availableImages,h=new q(this.zoom);for(let{feature:d,id:g,index:b,sourceLayerIndex:x}of e){let v=i._featureFilter.needGeometry,P=$e(d,v);if(!i._featureFilter.filter(h,P,n))continue;v||(P.geometry=ke(d));let w;if(u){let _=i.getValueAndResolveTokens("text-field",P,n,m),I=Fe.factory(_),k=this.hasRTLText=this.hasRTLText||gb(I);(!k||ye.getRTLTextPluginStatus()==="unavailable"||k&&ye.isParsed())&&(w=jp(I,i,P))}let T;if(c){let _=i.getValueAndResolveTokens("icon-image",P,n,m);_ instanceof Te?T=_:T=Te.fromString(_)}if(!w&&!T)continue;let F=this.sortFeaturesByKey?p.evaluate(P,{},n):void 0,E={id:g,text:w,icon:T,index:b,sourceLayerIndex:x,geometry:P.geometry,properties:d.properties,type:hb[d.type],sortKey:F};if(this.features.push(E),T&&(f[T.name]=!0),w){let _=a.evaluate(P,{},n).join(","),I=o.get("text-rotation-alignment")!=="viewport"&&o.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(2)>=0;for(let k of w.sections)if(k.image)f[k.image.name]=!0;else{let V=mn(w.toString()),A=k.fontStack||_,z=y[A]=y[A]||{};this.calculateGlyphDependencies(k.text,z,I,this.allowVerticalPlacement,V)}}}o.get("symbol-placement")==="line"&&(this.features=Jp(this.features)),this.sortFeaturesByKey&&this.features.sort((d,g)=>d.sortKey-g.sortKey)}update(e,r,n){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,r,this.layers,n),this.icon.programConfigurations.updatePaintArrays(e,r,this.layers,n))}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){let n=this.lineVertexArray.length;if(e.segment!==void 0){let i=e.dist(r[e.segment+1]),o=e.dist(r[e.segment]),a={};for(let s=e.segment+1;s<r.length;s++)a[s]={x:r[s].x,y:r[s].y,tileUnitDistanceFromAnchor:i},s<r.length-1&&(i+=r[s+1].dist(r[s]));for(let s=e.segment||0;s>=0;s--)a[s]={x:r[s].x,y:r[s].y,tileUnitDistanceFromAnchor:o},s>0&&(o+=r[s-1].dist(r[s]));for(let s=0;s<r.length;s++){let l=a[s];this.lineVertexArray.emplaceBack(l.x,l.y,l.tileUnitDistanceFromAnchor)}}return{lineStartIndex:n,lineLength:this.lineVertexArray.length-n}}addSymbols(e,r,n,i,o,a,s,l,u,c,p,f){let y=e.indexArray,m=e.layoutVertexArray,h=e.segments.prepareSegment(4*r.length,m,y,this.canOverlap?a.sortKey:void 0),d=this.glyphOffsetArray.length,g=h.vertexLength,b=this.allowVerticalPlacement&&s===2?Math.PI/2:0,x=a.text&&a.text.sections;for(let v=0;v<r.length;v++){let{tl:P,tr:w,bl:T,br:F,tex:E,pixelOffsetTL:_,pixelOffsetBR:I,minFontScaleX:k,minFontScaleY:V,glyphOffset:A,isSDF:z,sectionIndex:O}=r[v],N=h.vertexLength,K=A[1];ia(m,l.x,l.y,P.x,K+P.y,E.x,E.y,n,z,_.x,_.y,k,V),ia(m,l.x,l.y,w.x,K+w.y,E.x+E.w,E.y,n,z,I.x,_.y,k,V),ia(m,l.x,l.y,T.x,K+T.y,E.x,E.y+E.h,n,z,_.x,I.y,k,V),ia(m,l.x,l.y,F.x,K+F.y,E.x+E.w,E.y+E.h,n,z,I.x,I.y,k,V),cf(e.dynamicLayoutVertexArray,l,b),y.emplaceBack(N,N+1,N+2),y.emplaceBack(N+1,N+2,N+3),h.vertexLength+=4,h.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(A[0]),(v===r.length-1||O!==r[v+1].sectionIndex)&&e.programConfigurations.populatePaintArrays(m.length,a,a.index,{},f,x&&x[O])}e.placedSymbolArray.emplaceBack(l.x,l.y,d,this.glyphOffsetArray.length-d,g,u,c,l.segment,n?n[0]:0,n?n[1]:0,i[0],i[1],s,0,!1,0,p)}_addCollisionDebugVertex(e,r,n,i,o,a){return r.emplaceBack(0,0),e.emplaceBack(n.x,n.y,i,o,Math.round(a.x),Math.round(a.y))}addCollisionDebugVertices(e,r,n,i,o,a,s){let l=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),u=l.vertexLength,c=o.layoutVertexArray,p=o.collisionVertexArray,f=s.anchorX,y=s.anchorY;this._addCollisionDebugVertex(c,p,a,f,y,new ii.default(e,r)),this._addCollisionDebugVertex(c,p,a,f,y,new ii.default(n,r)),this._addCollisionDebugVertex(c,p,a,f,y,new ii.default(n,i)),this._addCollisionDebugVertex(c,p,a,f,y,new ii.default(e,i)),l.vertexLength+=4;let m=o.indexArray;m.emplaceBack(u,u+1),m.emplaceBack(u+1,u+2),m.emplaceBack(u+2,u+3),m.emplaceBack(u+3,u),l.primitiveLength+=4}addDebugCollisionBoxes(e,r,n,i){for(let o=e;o<r;o++){let a=this.collisionBoxArray.get(o),s=a.x1,l=a.y1,u=a.x2,c=a.y2;this.addCollisionDebugVertices(s,l,u,c,i?this.textCollisionBox:this.iconCollisionBox,a.anchorPoint,n)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new ai(On,Zs.members,wt),this.iconCollisionBox=new ai(On,Zs.members,wt);for(let e=0;e<this.symbolInstances.length;e++){let r=this.symbolInstances.get(e);this.addDebugCollisionBoxes(r.textBoxStartIndex,r.textBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.iconBoxStartIndex,r.iconBoxEndIndex,r,!1),this.addDebugCollisionBoxes(r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex,r,!1)}}_deserializeCollisionBoxesForSymbol(e,r,n,i,o,a,s,l,u){let c={};for(let p=r;p<n;p++){let f=e.get(p);c.textBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},c.textFeatureIndex=f.featureIndex;break}for(let p=i;p<o;p++){let f=e.get(p);c.verticalTextBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},c.verticalTextFeatureIndex=f.featureIndex;break}for(let p=a;p<s;p++){let f=e.get(p);c.iconBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},c.iconFeatureIndex=f.featureIndex;break}for(let p=l;p<u;p++){let f=e.get(p);c.verticalIconBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},c.verticalIconFeatureIndex=f.featureIndex;break}return c}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let r=0;r<this.symbolInstances.length;r++){let n=this.symbolInstances.get(r);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,n.textBoxStartIndex,n.textBoxEndIndex,n.verticalTextBoxStartIndex,n.verticalTextBoxEndIndex,n.iconBoxStartIndex,n.iconBoxEndIndex,n.verticalIconBoxStartIndex,n.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,r){let n=e.placedSymbolArray.get(r),i=n.vertexStartIndex+n.numGlyphs*4;for(let o=n.vertexStartIndex;o<i;o+=4)e.indexArray.emplaceBack(o,o+1,o+2),e.indexArray.emplaceBack(o+1,o+2,o+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let r=Math.sin(e),n=Math.cos(e),i=[],o=[],a=[];for(let s=0;s<this.symbolInstances.length;++s){a.push(s);let l=this.symbolInstances.get(s);i.push(Math.round(r*l.anchorX+n*l.anchorY)|0),o.push(l.featureIndex)}return a.sort((s,l)=>i[s]-i[l]||o[l]-o[s]),a}addToSortKeyRanges(e,r){let n=this.sortKeyRanges[this.sortKeyRanges.length-1];n&&n.sortKey===r?n.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(let r of this.symbolInstanceIndexes){let n=this.symbolInstances.get(r);this.featureSortOrder.push(n.featureIndex),[n.rightJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.leftJustifiedTextSymbolIndex].forEach((i,o,a)=>{i>=0&&a.indexOf(i)===o&&this.addIndicesForPlacedSymbol(this.text,i)}),n.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,n.verticalPlacedTextSymbolIndex),n.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,n.placedIconSymbolIndex),n.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,n.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}};C("SymbolBucket",He,{omit:["layers","collisionBoxArray","features","compareText"]});He.MAX_GLYPHS=65535;He.addDynamicAttributes=cf;function pf(t,e){return e.replace(/{([^{}]+)}/g,(r,n)=>t&&n in t?String(t[n]):"")}var ff,xb=()=>ff=ff||new re({"symbol-placement":new B(S.layout_symbol["symbol-placement"]),"symbol-spacing":new B(S.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new B(S.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new R(S.layout_symbol["symbol-sort-key"]),"symbol-z-order":new B(S.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new B(S.layout_symbol["icon-allow-overlap"]),"icon-overlap":new B(S.layout_symbol["icon-overlap"]),"icon-ignore-placement":new B(S.layout_symbol["icon-ignore-placement"]),"icon-optional":new B(S.layout_symbol["icon-optional"]),"icon-rotation-alignment":new B(S.layout_symbol["icon-rotation-alignment"]),"icon-size":new R(S.layout_symbol["icon-size"]),"icon-text-fit":new B(S.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new B(S.layout_symbol["icon-text-fit-padding"]),"icon-image":new R(S.layout_symbol["icon-image"]),"icon-rotate":new R(S.layout_symbol["icon-rotate"]),"icon-padding":new R(S.layout_symbol["icon-padding"]),"icon-keep-upright":new B(S.layout_symbol["icon-keep-upright"]),"icon-offset":new R(S.layout_symbol["icon-offset"]),"icon-anchor":new R(S.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new B(S.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new B(S.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new B(S.layout_symbol["text-rotation-alignment"]),"text-field":new R(S.layout_symbol["text-field"]),"text-font":new R(S.layout_symbol["text-font"]),"text-size":new R(S.layout_symbol["text-size"]),"text-max-width":new R(S.layout_symbol["text-max-width"]),"text-line-height":new B(S.layout_symbol["text-line-height"]),"text-letter-spacing":new R(S.layout_symbol["text-letter-spacing"]),"text-justify":new R(S.layout_symbol["text-justify"]),"text-radial-offset":new R(S.layout_symbol["text-radial-offset"]),"text-variable-anchor":new B(S.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new R(S.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new R(S.layout_symbol["text-anchor"]),"text-max-angle":new B(S.layout_symbol["text-max-angle"]),"text-writing-mode":new B(S.layout_symbol["text-writing-mode"]),"text-rotate":new R(S.layout_symbol["text-rotate"]),"text-padding":new B(S.layout_symbol["text-padding"]),"text-keep-upright":new B(S.layout_symbol["text-keep-upright"]),"text-transform":new R(S.layout_symbol["text-transform"]),"text-offset":new R(S.layout_symbol["text-offset"]),"text-allow-overlap":new B(S.layout_symbol["text-allow-overlap"]),"text-overlap":new B(S.layout_symbol["text-overlap"]),"text-ignore-placement":new B(S.layout_symbol["text-ignore-placement"]),"text-optional":new B(S.layout_symbol["text-optional"])}),yf,bb=()=>yf=yf||new re({"icon-opacity":new R(S.paint_symbol["icon-opacity"]),"icon-color":new R(S.paint_symbol["icon-color"]),"icon-halo-color":new R(S.paint_symbol["icon-halo-color"]),"icon-halo-width":new R(S.paint_symbol["icon-halo-width"]),"icon-halo-blur":new R(S.paint_symbol["icon-halo-blur"]),"icon-translate":new B(S.paint_symbol["icon-translate"]),"icon-translate-anchor":new B(S.paint_symbol["icon-translate-anchor"]),"text-opacity":new R(S.paint_symbol["text-opacity"]),"text-color":new R(S.paint_symbol["text-color"],{runtimeType:Re,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new R(S.paint_symbol["text-halo-color"]),"text-halo-width":new R(S.paint_symbol["text-halo-width"]),"text-halo-blur":new R(S.paint_symbol["text-halo-blur"]),"text-translate":new B(S.paint_symbol["text-translate"]),"text-translate-anchor":new B(S.paint_symbol["text-translate-anchor"])}),oa={get paint(){return bb()},get layout(){return xb()}};var si=class{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:mr,this.defaultValue=e}evaluate(e){if(e.formattedSection){let 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){if(!this.defaultValue.isConstant()){let r=this.defaultValue.value;e(r._styleExpression.expression)}}outputDefined(){return!1}serialize(){return null}};C("FormatSectionOverride",si,{omit:["defaultValue"]});var aa=class t extends se{constructor(e){super(e,oa)}recalculate(e,r){if(super.recalculate(e,r),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="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"){let n=this.layout.get("text-writing-mode");if(n){let i=[];for(let o of n)i.indexOf(o)<0&&i.push(o);this.layout._values["text-writing-mode"]=i}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,r,n,i){let o=this.layout.get(e).evaluate(r,{},n,i),a=this._unevaluatedLayout._values[e];return!a.isDataDriven()&&!Gt(a.value)&&o?pf(r.properties,o):o}createBucket(e){return new He(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let e of oa.paint.overridableProperties){if(!t.hasPaintOverride(this.layout,e))continue;let r=this.paint.get(e),n=new si(r),i=new Ot(n,r.property.specification),o=null;r.value.kind==="constant"||r.value.kind==="source"?o=new dt("source",i):o=new gt("composite",i,r.value.zoomStops),this.paint._values[e]=new Se(r.property,o,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,n){return!this.layout||r.isDataDriven()||n.isDataDriven()?!1:t.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){let n=e.get("text-field"),i=oa.paint.properties[r],o=!1,a=s=>{for(let l of s)if(i.overrides&&i.overrides.hasOverride(l)){o=!0;return}};if(n.value.kind==="constant"&&n.value.value instanceof Fe)a(n.value.value.sections);else if(n.value.kind==="source"){let s=u=>{if(!o)if(u instanceof mt&&ue(u.value)===hr){let c=u.value;a(c.sections)}else u instanceof en?a(u.sections):u.eachChild(s)},l=n.value;l._styleExpression&&s(l._styleExpression.expression)}return o}};function mf(t,e,r,n=1){let i=t.get("icon-padding").evaluate(e,{},r),o=i&&i.values;return[o[0]*n,o[1]*n,o[2]*n,o[3]*n]}var hf,vb=()=>hf=hf||new re({"background-color":new B(S.paint_background["background-color"]),"background-pattern":new jt(S.paint_background["background-pattern"]),"background-opacity":new B(S.paint_background["background-opacity"])}),df={get paint(){return vb()}};var sa=class extends se{constructor(e){super(e,df)}};var gf,Pb=()=>gf=gf||new re({"raster-opacity":new B(S.paint_raster["raster-opacity"]),"raster-hue-rotate":new B(S.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new B(S.paint_raster["raster-brightness-min"]),"raster-brightness-max":new B(S.paint_raster["raster-brightness-max"]),"raster-saturation":new B(S.paint_raster["raster-saturation"]),"raster-contrast":new B(S.paint_raster["raster-contrast"]),"raster-resampling":new B(S.paint_raster["raster-resampling"]),"raster-fade-duration":new B(S.paint_raster["raster-fade-duration"])}),xf={get paint(){return Pb()}};var la=class extends se{constructor(e){super(e,xf)}};var ua=class extends se{constructor(r){super(r,{});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=r}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}};function bf(t){if(t.type==="custom")return new ua(t);switch(t.type){case"background":return new sa(t);case"circle":return new Ro(t);case"fill":return new jo(t);case"fill-extrusion":return new Wo(t);case"heatmap":return new Oo(t);case"hillshade":return new No(t);case"line":return new Xo(t);case"raster":return new la(t);case"symbol":return new aa(t)}}var ca=class{constructor(e){this.keyCache={},e&&this.replace(e)}replace(e){this._layerConfigs={},this._layers={},this.update(e,[])}update(e,r){for(let i of e){this._layerConfigs[i.id]=i;let o=this._layers[i.id]=bf(i);o._featureFilter=fn(o.filter),this.keyCache[i.id]&&delete this.keyCache[i.id]}for(let i of r)delete this.keyCache[i],delete this._layerConfigs[i],delete this._layers[i];this.familiesBySource={};let n=Ou(Object.values(this._layerConfigs),this.keyCache);for(let i of n){let o=i.map(p=>this._layers[p.id]),a=o[0];if(a.visibility==="none")continue;let s=a.source||"",l=this.familiesBySource[s];l||(l=this.familiesBySource[s]={});let u=a.sourceLayer||"_geojsonTileLayer",c=l[u];c||(c=l[u]=[]),c.push(o)}}};var qf=Z(Tt(),1),jf=Z(Qn(),1);var Vr=class{constructor(e){this._stringToNumber={},this._numberToString=[];for(let r=0;r<e.length;r++){let n=e[r];this._stringToNumber[n]=r,this._numberToString[r]=n}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can\'t be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}};var Sf=Z(Tt(),1),wf=Z(Qn(),1);var pa=class{constructor(e,r,n,i,o){this.type="Feature",this._vectorTileFeature=e,e._z=r,e._x=n,e._y=i,this.properties=e.properties,this.id=o}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(){let e={geometry:this.geometry};for(let r in this)r==="_geometry"||r==="_vectorTileFeature"||(e[r]=this[r]);return e}};var li=class{constructor(e,r){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Dt(8192,16,0),this.grid3D=new Dt(8192,16,0),this.featureIndexArray=new Rn,this.promoteId=r}insert(e,r,n,i,o,a){let s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(n,i,o);let l=a?this.grid3D:this.grid;for(let u=0;u<r.length;u++){let c=r[u],p=[1/0,1/0,-1/0,-1/0];for(let f=0;f<c.length;f++){let y=c[f];p[0]=Math.min(p[0],y.x),p[1]=Math.min(p[1],y.y),p[2]=Math.max(p[2],y.x),p[3]=Math.max(p[3],y.y)}p[0]<8192&&p[1]<8192&&p[2]>=0&&p[3]>=0&&l.insert(s,p[0],p[1],p[2],p[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Sf.default.VectorTile(new wf.default(this.rawTileData)).layers,this.sourceLayerCoder=new Vr(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,r,n,i){this.loadVTLayers();let o=e.params||{},a=8192/e.tileSize/e.scale,s=fn(o.filter),l=e.queryGeometry,u=e.queryPadding*a,c=Pf(l),p=this.grid.query(c.minX-u,c.minY-u,c.maxX+u,c.maxY+u),f=Pf(e.cameraQueryGeometry),y=this.grid3D.query(f.minX-u,f.minY-u,f.maxX+u,f.maxY+u,(d,g,b,x)=>Bc(e.cameraQueryGeometry,d-u,g-u,b+u,x+u));for(let d of y)p.push(d);p.sort(Sb);let m={},h;for(let d=0;d<p.length;d++){let g=p[d];if(g===h)continue;h=g;let b=this.featureIndexArray.get(g),x=null;this.loadMatchingFeature(m,b.bucketIndex,b.sourceLayerIndex,b.featureIndex,s,o.layers,o.availableImages,r,n,i,(v,P,w)=>(x||(x=ke(v)),P.queryIntersectsFeature(l,v,w,x,this.z,e.transform,a,e.pixelPosMatrix)))}return m}loadMatchingFeature(e,r,n,i,o,a,s,l,u,c,p){let f=this.bucketLayerIDs[r];if(a&&!Zl(a,f))return;let y=this.sourceLayerCoder.decode(n),h=this.vtLayers[y].feature(i);if(o.needGeometry){let g=$e(h,!0);if(!o.filter(new q(this.tileID.overscaledZ),g,this.tileID.canonical))return}else if(!o.filter(new q(this.tileID.overscaledZ),h))return;let d=this.getId(h,y);for(let g=0;g<f.length;g++){let b=f[g];if(a&&a.indexOf(b)<0)continue;let x=l[b];if(!x)continue;let v={};d&&c&&(v=c.getState(x.sourceLayer||"_geojsonTileLayer",d));let P=Pe({},u[b]);P.paint=vf(P.paint,x.paint,h,v,s),P.layout=vf(P.layout,x.layout,h,v,s);let w=!p||p(h,x,v);if(!w)continue;let T=new pa(h,this.z,this.x,this.y,d);T.layer=P;let F=e[b];F===void 0&&(F=e[b]=[]),F.push({featureIndex:i,feature:T,intersectionZ:w})}}lookupSymbolFeatures(e,r,n,i,o,a,s,l){let u={};this.loadVTLayers();let c=fn(o);for(let p of e)this.loadMatchingFeature(u,n,i,p,c,a,s,l,r);return u}hasLayer(e){for(let r of this.bucketLayerIDs)for(let n of r)if(e===n)return!0;return!1}getId(e,r){let n=e.id;if(this.promoteId){let i=typeof this.promoteId=="string"?this.promoteId:this.promoteId[r];n=e.properties[i],typeof n=="boolean"&&(n=Number(n))}return n}};C("FeatureIndex",li,{omit:["rawTileData","sourceLayerCoder"]});function vf(t,e,r,n,i){return qr(t,(o,a)=>{let s=e instanceof vt?e.get(a):null;return s&&s.evaluate?s.evaluate(r,n,i):s})}function Pf(t){let e=1/0,r=1/0,n=-1/0,i=-1/0;for(let o of t)e=Math.min(e,o.x),r=Math.min(r,o.y),n=Math.max(n,o.x),i=Math.max(i,o.y);return{minX:e,minY:r,maxX:n,maxY:i}}function Sb(t,e){return e-t}var Af=Z(he(),1);var rt=class t extends Af.default{constructor(e,r,n,i){super(e,r),this.angle=n,i!==void 0&&(this.segment=i)}clone(){return new t(this.x,this.y,this.angle,this.segment)}};C("Anchor",rt);function el(t,e,r,n,i){if(e.segment===void 0||r===0)return!0;let o=e,a=e.segment+1,s=0;for(;s>-r/2;){if(a--,a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;let l=[],u=0;for(;s<r/2;){let c=t[a-1],p=t[a],f=t[a+1];if(!f)return!1;let y=c.angleTo(p)-p.angleTo(f);for(y=Math.abs((y+3*Math.PI)%(Math.PI*2)-Math.PI),l.push({distance:s,angleDelta:y}),u+=y;s-l[0].distance>n;)u-=l.shift().angleDelta;if(u>i)return!1;a++,s+=p.dist(f)}return!0}function _f(t){let e=0;for(let r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function If(t,e,r){return t?3/5*e*r:0}function Tf(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Cf(t,e,r,n,i,o){let a=If(r,i,o),s=Tf(r,n)*o,l=0,u=_f(t)/2;for(let c=0;c<t.length-1;c++){let p=t[c],f=t[c+1],y=p.dist(f);if(l+y>u){let m=(u-l)/y,h=Oe.number(p.x,f.x,m),d=Oe.number(p.y,f.y,m),g=new rt(h,d,f.angleTo(p),c);return g._round(),!a||el(t,g,s,a,e)?g:void 0}l+=y}}function kf(t,e,r,n,i,o,a,s,l){let u=If(n,o,a),c=Tf(n,i),p=c*a,f=t[0].x===0||t[0].x===l||t[0].y===0||t[0].y===l;e-p<e/4&&(e=p+e/4);let y=o*2,m=f?e/2*s%e:(c/2+y)*a*s%e;return Mf(t,m,e,u,r,p,f,!1,l)}function Mf(t,e,r,n,i,o,a,s,l){let u=o/2,c=_f(t),p=0,f=e-r,y=[];for(let m=0;m<t.length-1;m++){let h=t[m],d=t[m+1],g=h.dist(d),b=d.angleTo(h);for(;f+r<p+g;){f+=r;let x=(f-p)/g,v=Oe.number(h.x,d.x,x),P=Oe.number(h.y,d.y,x);if(v>=0&&v<l&&P>=0&&P<l&&f-u>=0&&f+u<=c){let w=new rt(v,P,b,m);w._round(),(!n||el(t,w,o,n,i))&&y.push(w)}}p+=g}return!s&&!y.length&&!a&&(y=Mf(t,p/2,r,n,i,o,a,!0,l)),y}var pt=Z(he(),1);function Ef(t,e,r,n,i){let o=[];for(let a=0;a<t.length;a++){let s=t[a],l;for(let u=0;u<s.length-1;u++){let c=s[u],p=s[u+1];c.x<e&&p.x<e||(c.x<e?c=new pt.default(e,c.y+(p.y-c.y)*((e-c.x)/(p.x-c.x)))._round():p.x<e&&(p=new pt.default(e,c.y+(p.y-c.y)*((e-c.x)/(p.x-c.x)))._round()),!(c.y<r&&p.y<r)&&(c.y<r?c=new pt.default(c.x+(p.x-c.x)*((r-c.y)/(p.y-c.y)),r)._round():p.y<r&&(p=new pt.default(c.x+(p.x-c.x)*((r-c.y)/(p.y-c.y)),r)._round()),!(c.x>=n&&p.x>=n)&&(c.x>=n?c=new pt.default(n,c.y+(p.y-c.y)*((n-c.x)/(p.x-c.x)))._round():p.x>=n&&(p=new pt.default(n,c.y+(p.y-c.y)*((n-c.x)/(p.x-c.x)))._round()),!(c.y>=i&&p.y>=i)&&(c.y>=i?c=new pt.default(c.x+(p.x-c.x)*((i-c.y)/(p.y-c.y)),i)._round():p.y>=i&&(p=new pt.default(c.x+(p.x-c.x)*((i-c.y)/(p.y-c.y)),i)._round()),(!l||!c.equals(l[l.length-1]))&&(l=[c],o.push(l)),l.push(p)))))}}return o}var we=Z(he(),1);var Br=ge;function tl(t,e,r,n){let i=[],o=t.image,a=o.pixelRatio,s=o.paddedRect.w-2*Br,l=o.paddedRect.h-2*Br,u=t.right-t.left,c=t.bottom-t.top,p=o.stretchX||[[0,s]],f=o.stretchY||[[0,l]],y=(I,k)=>I+k[1]-k[0],m=p.reduce(y,0),h=f.reduce(y,0),d=s-m,g=l-h,b=0,x=m,v=0,P=h,w=0,T=d,F=0,E=g;if(o.content&&n){let I=o.content;b=fa(p,0,I[0]),v=fa(f,0,I[1]),x=fa(p,I[0],I[2]),P=fa(f,I[1],I[3]),w=I[0]-b,F=I[1]-v,T=I[2]-I[0]-x,E=I[3]-I[1]-P}let _=(I,k,V,A)=>{let z=ya(I.stretch-b,x,u,t.left),O=ma(I.fixed-w,T,I.stretch,m),N=ya(k.stretch-v,P,c,t.top),K=ma(k.fixed-F,E,k.stretch,h),xe=ya(V.stretch-b,x,u,t.left),X=ma(V.fixed-w,T,V.stretch,m),le=ya(A.stretch-v,P,c,t.top),ce=ma(A.fixed-F,E,A.stretch,h),pe=new we.default(z,N),_e=new we.default(xe,N),be=new we.default(xe,le),wi=new we.default(z,le),Ea=new we.default(O/a,K/a),Fa=new we.default(X/a,ce/a),Nr=e*Math.PI/180;if(Nr){let Ie=Math.sin(Nr),ve=Math.cos(Nr),Ve=[ve,-Ie,Ie,ve];pe._matMult(Ve),_e._matMult(Ve),wi._matMult(Ve),be._matMult(Ve)}let Ai=I.stretch+I.fixed,Me=V.stretch+V.fixed,Ft=k.stretch+k.fixed,_i=A.stretch+A.fixed,La={x:o.paddedRect.x+Br+Ai,y:o.paddedRect.y+Br+Ft,w:Me-Ai,h:_i-Ft},Da=T/a/u,Va=E/a/c;return{tl:pe,tr:_e,bl:wi,br:be,tex:La,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Ea,pixelOffsetBR:Fa,minFontScaleX:Da,minFontScaleY:Va,isSDF:r}};if(!n||!o.stretchX&&!o.stretchY)i.push(_({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:s+1},{fixed:0,stretch:l+1}));else{let I=Ff(p,d,m),k=Ff(f,g,h);for(let V=0;V<I.length-1;V++){let A=I[V],z=I[V+1];for(let O=0;O<k.length-1;O++){let N=k[O],K=k[O+1];i.push(_(A,N,z,K))}}}return i}function fa(t,e,r){let n=0;for(let i of t)n+=Math.max(e,Math.min(r,i[1]))-Math.max(e,Math.min(r,i[0]));return n}function Ff(t,e,r){let n=[{fixed:-Br,stretch:0}];for(let[i,o]of t){let a=n[n.length-1];n.push({fixed:i-a.stretch,stretch:a.stretch}),n.push({fixed:i-a.stretch,stretch:a.stretch+(o-i)})}return n.push({fixed:e+Br,stretch:r}),n}function ya(t,e,r,n){return t/e*r+n}function ma(t,e,r,n){return t-e*r/n}function Lf(t,e,r,n,i,o,a,s){let l=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=[];for(let c of e.positionedLines)for(let p of c.positionedGlyphs){if(!p.rect)continue;let f=p.rect||{},m=Qo+1,h=!0,d=1,g=0,b=(i||s)&&p.vertical,x=p.metrics.advance*p.scale/2;if(s&&e.verticalizable){let X=(p.scale-1)*ne,le=(ne-p.metrics.width*p.scale)/2;g=c.lineOffset/2-(p.imageName?-le:X)}if(p.imageName){let X=a[p.imageName];h=X.sdf,d=X.pixelRatio,m=ge/d}let v=i?[p.x+x,p.y]:[0,0],P=i?[0,0]:[p.x+x+r[0],p.y+r[1]-g],w=[0,0];b&&(w=P,P=[0,0]);let T=p.metrics.isDoubleResolution?2:1,F=(p.metrics.left-m)*p.scale-x+P[0],E=(-p.metrics.top-m)*p.scale+P[1],_=F+f.w/T*p.scale/d,I=E+f.h/T*p.scale/d,k=new we.default(F,E),V=new we.default(_,E),A=new we.default(F,I),z=new we.default(_,I);if(b){let X=new we.default(-x,x-Lr),le=-Math.PI/2,ce=ne/2-x,pe=p.imageName?ce:0,_e=new we.default(5-Lr-ce,-pe),be=new we.default(...w);k._rotateAround(le,X)._add(_e)._add(be),V._rotateAround(le,X)._add(_e)._add(be),A._rotateAround(le,X)._add(_e)._add(be),z._rotateAround(le,X)._add(_e)._add(be)}if(l){let X=Math.sin(l),le=Math.cos(l),ce=[le,-X,X,le];k._matMult(ce),V._matMult(ce),A._matMult(ce),z._matMult(ce)}let O=new we.default(0,0),N=new we.default(0,0);u.push({tl:k,tr:V,bl:A,br:z,tex:f,writingMode:e.writingMode,glyphOffset:v,sectionIndex:p.sectionIndex,isSDF:h,pixelOffsetTL:O,pixelOffsetBR:N,minFontScaleX:0,minFontScaleY:0})}return u}var ui=Z(he(),1),ir=class{constructor(e,r,n,i,o,a,s,l,u,c){if(this.boxStartIndex=e.length,u){let p=a.top,f=a.bottom,y=a.collisionPadding;y&&(p-=y[1],f+=y[3]);let m=f-p;m>0&&(m=Math.max(10,m),this.circleDiameter=m)}else{let p=a.top*s-l[0],f=a.bottom*s+l[2],y=a.left*s-l[3],m=a.right*s+l[1],h=a.collisionPadding;if(h&&(y-=h[0]*s,p-=h[1]*s,m+=h[2]*s,f+=h[3]*s),c){let d=new ui.default(y,p),g=new ui.default(m,p),b=new ui.default(y,f),x=new ui.default(m,f),v=c*Math.PI/180;d._rotate(v),g._rotate(v),b._rotate(v),x._rotate(v),y=Math.min(d.x,g.x,b.x,x.x),m=Math.max(d.x,g.x,b.x,x.x),p=Math.min(d.y,g.y,b.y,x.y),f=Math.max(d.y,g.y,b.y,x.y)}e.emplaceBack(r.x,r.y,y,p,m,f,n,i,o)}this.boxEndIndex=e.length}};var ci=class{constructor(e=[],r=wb){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;let 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){let{data:r,compare:n}=this,i=r[e];for(;e>0;){let o=e-1>>1,a=r[o];if(n(i,a)>=0)break;r[e]=a,e=o}r[e]=i}_down(e){let{data:r,compare:n}=this,i=this.length>>1,o=r[e];for(;e<i;){let a=(e<<1)+1,s=r[a],l=a+1;if(l<this.length&&n(r[l],s)<0&&(a=l,s=r[l]),n(s,o)>=0)break;r[e]=s,e=a}r[e]=o}};function wb(t,e){return t<e?-1:t>e?1:0}var rl=Z(he(),1);function Df(t,e=1,r=!1){let n=1/0,i=1/0,o=-1/0,a=-1/0,s=t[0];for(let h=0;h<s.length;h++){let d=s[h];(!h||d.x<n)&&(n=d.x),(!h||d.y<i)&&(i=d.y),(!h||d.x>o)&&(o=d.x),(!h||d.y>a)&&(a=d.y)}let l=o-n,u=a-i,c=Math.min(l,u),p=c/2,f=new ci([],Ab);if(c===0)return new rl.default(n,i);for(let h=n;h<o;h+=c)for(let d=i;d<a;d+=c)f.push(new zr(h+p,d+p,p,t));let y=Ib(t),m=f.length;for(;f.length;){let h=f.pop();(h.d>y.d||!y.d)&&(y=h,r&&console.log("found best %d after %d probes",Math.round(1e4*h.d)/1e4,m)),!(h.max-y.d<=e)&&(p=h.h/2,f.push(new zr(h.p.x-p,h.p.y-p,p,t)),f.push(new zr(h.p.x+p,h.p.y-p,p,t)),f.push(new zr(h.p.x-p,h.p.y+p,p,t)),f.push(new zr(h.p.x+p,h.p.y+p,p,t)),m+=4)}return r&&(console.log(`num probes: ${m}`),console.log(`best distance: ${y.d}`)),y.p}function Ab(t,e){return e.max-t.max}function zr(t,e,r,n){this.p=new rl.default(t,e),this.h=r,this.d=_b(this.p,n),this.max=this.d+this.h*Math.SQRT2}function _b(t,e){let r=!1,n=1/0;for(let i=0;i<e.length;i++){let o=e[i];for(let a=0,s=o.length,l=s-1;a<s;l=a++){let u=o[a],c=o[l];u.y>t.y!=c.y>t.y&&t.x<(c.x-u.x)*(t.y-u.y)/(c.y-u.y)+u.x&&(r=!r),n=Math.min(n,Ls(t,u,c))}}return(r?1:-1)*Math.sqrt(n)}function Ib(t){let e=0,r=0,n=0,i=t[0];for(let o=0,a=i.length,s=a-1;o<a;s=o++){let l=i[o],u=i[s],c=l.x*u.y-u.x*l.y;r+=(l.x+u.x)*c,n+=(l.y+u.y)*c,e+=c*3}return new zr(r/e,n/e,0,t)}var al=Z(Ts(),1);var nl=(o=>(o[o.center=1]="center",o[o.left=2]="left",o[o.right=3]="right",o[o.top=4]="top",o[o.bottom=5]="bottom",o[o["top-left"]=6]="top-left",o[o["top-right"]=7]="top-right",o[o["bottom-left"]=8]="bottom-left",o[o["bottom-right"]=9]="bottom-right",o))(nl||{}),kt=7,ha=Number.POSITIVE_INFINITY;function il(t,e){function r(i,o){let a=0,s=0;o<0&&(o=0);let l=o/Math.SQRT2;switch(i){case"top-right":case"top-left":s=l-kt;break;case"bottom-right":case"bottom-left":s=-l+kt;break;case"bottom":s=-o+kt;break;case"top":s=o-kt;break}switch(i){case"top-right":case"bottom-right":a=-l;break;case"top-left":case"bottom-left":a=l;break;case"left":a=o;break;case"right":a=-o;break}return[a,s]}function n(i,o,a){let s=0,l=0;switch(o=Math.abs(o),a=Math.abs(a),i){case"top-right":case"top-left":case"top":l=a-kt;break;case"bottom-right":case"bottom-left":case"bottom":l=-a+kt;break}switch(i){case"top-right":case"bottom-right":case"right":s=-o;break;case"top-left":case"bottom-left":case"left":s=o;break}return[s,l]}return e[1]!==ha?n(t,e[0],e[1]):r(t,e[0])}function ol(t,e,r){let n=t.layout,i=n.get("text-variable-anchor-offset")?.evaluate(e,{},r);if(i){let a=i.values,s=[];for(let l=0;l<a.length;l+=2){let u=s[l]=a[l],c=a[l+1].map(p=>p*ne);u.startsWith("top")?c[1]-=kt:u.startsWith("bottom")&&(c[1]+=kt),s[l+1]=c}return new Ne(s)}let o=n.get("text-variable-anchor");if(o){let a;t._unevaluatedLayout.getValue("text-radial-offset")!==void 0?a=[n.get("text-radial-offset").evaluate(e,{},r)*ne,ha]:a=n.get("text-offset").evaluate(e,{},r).map(u=>u*ne);let l=[];for(let u of o)l.push(u,il(u,a));return new Ne(l)}return null}function zf(t){t.bucket.createArrays();let e=512*t.bucket.overscaling;t.bucket.tilePixelRatio=8192/e,t.bucket.compareText={},t.bucket.iconsNeedLinear=!1;let r=t.bucket.layers[0],n=r.layout,i=r._unevaluatedLayout._values,o={layoutIconSize:i["icon-size"].possiblyEvaluate(new q(t.bucket.zoom+1),t.canonical),layoutTextSize:i["text-size"].possiblyEvaluate(new q(t.bucket.zoom+1),t.canonical),textMaxSize:i["text-size"].possiblyEvaluate(new q(18))};if(t.bucket.textSizeData.kind==="composite"){let{minZoom:c,maxZoom:p}=t.bucket.textSizeData;o.compositeTextSizes=[i["text-size"].possiblyEvaluate(new q(c),t.canonical),i["text-size"].possiblyEvaluate(new q(p),t.canonical)]}if(t.bucket.iconSizeData.kind==="composite"){let{minZoom:c,maxZoom:p}=t.bucket.iconSizeData;o.compositeIconSizes=[i["icon-size"].possiblyEvaluate(new q(c),t.canonical),i["icon-size"].possiblyEvaluate(new q(p),t.canonical)]}let a=n.get("text-line-height")*ne,s=n.get("text-rotation-alignment")!=="viewport"&&n.get("symbol-placement")!=="point",l=n.get("text-keep-upright"),u=n.get("text-size");for(let c of t.bucket.features){let p=n.get("text-font").evaluate(c,{},t.canonical).join(","),f=u.evaluate(c,{},t.canonical),y=o.layoutTextSize.evaluate(c,{},t.canonical),m=o.layoutIconSize.evaluate(c,{},t.canonical),h={horizontal:{},vertical:void 0},d=c.text,g=[0,0];if(d){let P=d.toString(),w=n.get("text-letter-spacing").evaluate(c,{},t.canonical)*ne,T=dc(P)?w:0,F=n.get("text-anchor").evaluate(c,{},t.canonical),E=ol(r,c,t.canonical);if(!E){let A=n.get("text-radial-offset").evaluate(c,{},t.canonical);A?g=il(F,[A*ne,ha]):g=n.get("text-offset").evaluate(c,{},t.canonical).map(z=>z*ne)}let _=s?"center":n.get("text-justify").evaluate(c,{},t.canonical),I=n.get("symbol-placement"),k=I==="point"?n.get("text-max-width").evaluate(c,{},t.canonical)*ne:0,V=()=>{t.bucket.allowVerticalPlacement&&mn(P)&&(h.vertical=ni(d,t.glyphMap,t.glyphPositions,t.imagePositions,p,k,a,F,"left",T,g,2,!0,I,y,f))};if(!s&&E){let A=new Set;if(_==="auto")for(let O=0;O<E.values.length;O+=2)A.add(Vf(E.values[O]));else A.add(_);let z=!1;for(let O of A)if(!h.horizontal[O])if(z)h.horizontal[O]=h.horizontal[0];else{let N=ni(d,t.glyphMap,t.glyphPositions,t.imagePositions,p,k,a,"center",O,T,g,1,!1,I,y,f);N&&(h.horizontal[O]=N,z=N.positionedLines.length===1)}V()}else{_==="auto"&&(_=Vf(F));let A=ni(d,t.glyphMap,t.glyphPositions,t.imagePositions,p,k,a,F,_,T,g,1,!1,I,y,f);A&&(h.horizontal[_]=A),V(),mn(P)&&s&&l&&(h.vertical=ni(d,t.glyphMap,t.glyphPositions,t.imagePositions,p,k,a,F,_,T,g,2,!1,I,y,f))}}let b,x=!1;if(c.icon&&c.icon.name){let P=t.imageMap[c.icon.name];P&&(b=lf(t.imagePositions[c.icon.name],n.get("icon-offset").evaluate(c,{},t.canonical),n.get("icon-anchor").evaluate(c,{},t.canonical)),x=!!P.sdf,t.bucket.sdfIcons===void 0?t.bucket.sdfIcons=x:t.bucket.sdfIcons!==x&&fe("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(P.pixelRatio!==t.bucket.pixelRatio||n.get("icon-rotate").constantOr(1)!==0)&&(t.bucket.iconsNeedLinear=!0))}let v=Rf(h.horizontal)||h.vertical;t.bucket.iconsInText=v?v.iconsInText:!1,(v||b)&&Tb(t.bucket,c,h,b,t.imageMap,o,y,m,g,x,t.canonical)}t.showCollisionBoxes&&t.bucket.generateCollisionDebugBuffers()}function Vf(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Tb(t,e,r,n,i,o,a,s,l,u,c){let p=o.textMaxSize.evaluate(e,{});p===void 0&&(p=a);let f=t.layers[0].layout,y=f.get("icon-offset").evaluate(e,{},c),m=Rf(r.horizontal),h=24,d=a/h,g=t.tilePixelRatio*d,b=t.tilePixelRatio*p/h,x=t.tilePixelRatio*s,v=t.tilePixelRatio*f.get("symbol-spacing"),P=f.get("text-padding")*t.tilePixelRatio,w=mf(f,e,c,t.tilePixelRatio),T=f.get("text-max-angle")/180*Math.PI,F=f.get("text-rotation-alignment")!=="viewport"&&f.get("symbol-placement")!=="point",E=f.get("icon-rotation-alignment")==="map"&&f.get("symbol-placement")!=="point",_=f.get("symbol-placement"),I=v/2,k=f.get("icon-text-fit"),V;n&&k!=="none"&&(t.allowVerticalPlacement&&r.vertical&&(V=Ks(n,r.vertical,k,f.get("icon-text-fit-padding"),y,d)),m&&(n=Ks(n,m,k,f.get("icon-text-fit-padding"),y,d)));let A=(z,O)=>{O.x<0||O.x>=8192||O.y<0||O.y>=8192||kb(t,O,z,r,n,i,V,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,g,[P,P,P,P],F,l,x,w,E,y,e,o,u,c,a)};if(_==="line")for(let z of Ef(e.geometry,0,0,8192,8192)){let O=kf(z,v,T,r.vertical||m,n,h,b,t.overscaling,8192);for(let N of O){let K=m;(!K||!Mb(t,K.text,I,N))&&A(z,N)}}else if(_==="line-center"){for(let z of e.geometry)if(z.length>1){let O=Cf(z,T,r.vertical||m,n,h,b);O&&A(z,O)}}else if(e.type==="Polygon")for(let z of Ir(e.geometry,0)){let O=Df(z,16);A(z[0],new rt(O.x,O.y,0))}else if(e.type==="LineString")for(let z of e.geometry)A(z,new rt(z[0].x,z[0].y,0));else if(e.type==="Point")for(let z of e.geometry)for(let O of z)A([O],new rt(O.x,O.y,0))}function Cb(t,e){let r=t.length,n=e?.values;if(n?.length>0)for(let i=0;i<n.length;i+=2){let o=nl[n[i]],a=n[i+1];t.emplaceBack(o,a[0],a[1])}return[r,t.length]}function Bf(t,e,r,n,i,o,a,s,l,u,c,p,f,y,m){let h=Lf(e,r,s,i,o,a,n,t.allowVerticalPlacement),d=t.textSizeData,g=null;d.kind==="source"?(g=[Ct*i.layout.get("text-size").evaluate(a,{})],g[0]>tt&&fe(`${t.layerIds[0]}: Value for "text-size" is >= ${Dr}. Reduce your "text-size".`)):d.kind==="composite"&&(g=[Ct*y.compositeTextSizes[0].evaluate(a,{},m),Ct*y.compositeTextSizes[1].evaluate(a,{},m)],(g[0]>tt||g[1]>tt)&&fe(`${t.layerIds[0]}: Value for "text-size" is >= ${Dr}. Reduce your "text-size".`)),t.addSymbols(t.text,h,g,s,o,a,u,e,l.lineStartIndex,l.lineLength,f,m);for(let b of c)p[b]=t.text.placedSymbolArray.length-1;return h.length*4}function Rf(t){for(let e in t)return t[e];return null}function kb(t,e,r,n,i,o,a,s,l,u,c,p,f,y,m,h,d,g,b,x,v,P,w,T,F){let E=t.addToLineVertexArray(e,r),_,I,k,V,A=0,z=0,O=0,N=0,K=-1,xe=-1,X={},le=(0,al.default)("");if(t.allowVerticalPlacement&&n.vertical){let ve=s.layout.get("text-rotate").evaluate(v,{},T)+90,Ve=n.vertical;k=new ir(l,e,u,c,p,Ve,f,y,m,ve),a&&(V=new ir(l,e,u,c,p,a,d,g,m,ve))}if(i){let Ie=s.layout.get("icon-rotate").evaluate(v,{}),ve=s.layout.get("icon-text-fit")!=="none",Ve=tl(i,Ie,w,ve),Ur=a?tl(a,Ie,w,ve):void 0;I=new ir(l,e,u,c,p,i,d,g,!1,Ie),A=Ve.length*4;let Ll=t.iconSizeData,Lt=null;Ll.kind==="source"?(Lt=[Ct*s.layout.get("icon-size").evaluate(v,{})],Lt[0]>tt&&fe(`${t.layerIds[0]}: Value for "icon-size" is >= ${Dr}. Reduce your "icon-size".`)):Ll.kind==="composite"&&(Lt=[Ct*P.compositeIconSizes[0].evaluate(v,{},T),Ct*P.compositeIconSizes[1].evaluate(v,{},T)],(Lt[0]>tt||Lt[1]>tt)&&fe(`${t.layerIds[0]}: Value for "icon-size" is >= ${Dr}. Reduce your "icon-size".`)),t.addSymbols(t.icon,Ve,Lt,x,b,v,0,e,E.lineStartIndex,E.lineLength,-1,T),K=t.icon.placedSymbolArray.length-1,Ur&&(z=Ur.length*4,t.addSymbols(t.icon,Ur,Lt,x,b,v,2,e,E.lineStartIndex,E.lineLength,-1,T),xe=t.icon.placedSymbolArray.length-1)}let ce=Object.keys(n.horizontal);for(let Ie of ce){let ve=n.horizontal[Ie];if(!_){le=(0,al.default)(ve.text);let Ur=s.layout.get("text-rotate").evaluate(v,{},T);_=new ir(l,e,u,c,p,ve,f,y,m,Ur)}let Ve=ve.positionedLines.length===1;if(O+=Bf(t,e,ve,o,s,m,v,h,E,n.vertical?1:3,Ve?ce:[Ie],X,K,P,T),Ve)break}n.vertical&&(N+=Bf(t,e,n.vertical,o,s,m,v,h,E,2,["vertical"],X,xe,P,T));let pe=_?_.boxStartIndex:t.collisionBoxArray.length,_e=_?_.boxEndIndex:t.collisionBoxArray.length,be=k?k.boxStartIndex:t.collisionBoxArray.length,wi=k?k.boxEndIndex:t.collisionBoxArray.length,Ea=I?I.boxStartIndex:t.collisionBoxArray.length,Fa=I?I.boxEndIndex:t.collisionBoxArray.length,Nr=V?V.boxStartIndex:t.collisionBoxArray.length,Ai=V?V.boxEndIndex:t.collisionBoxArray.length,Me=-1,Ft=(Ie,ve)=>Ie&&Ie.circleDiameter?Math.max(Ie.circleDiameter,ve):ve;Me=Ft(_,Me),Me=Ft(k,Me),Me=Ft(I,Me),Me=Ft(V,Me);let _i=Me>-1?1:0;_i&&(Me*=F/ne),t.glyphOffsetArray.length>=He.MAX_GLYPHS&&fe("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),v.sortKey!==void 0&&t.addToSortKeyRanges(t.symbolInstances.length,v.sortKey);let La=ol(s,v,T),[Da,Va]=Cb(t.textAnchorOffsets,La);t.symbolInstances.emplaceBack(e.x,e.y,X.right>=0?X.right:-1,X.center>=0?X.center:-1,X.left>=0?X.left:-1,X.vertical||-1,K,xe,le,pe,_e,be,wi,Ea,Fa,Nr,Ai,u,O,N,A,z,_i,0,f,Me,Da,Va)}function Mb(t,e,r,n){let i=t.compareText;if(!(e in i))i[e]=[];else{let o=i[e];for(let a=o.length-1;a>=0;a--)if(n.dist(o[a])<r)return!0}return i[e].push(n),!1}var da=1,pi=class{constructor(e){let r={},n=[];for(let s in e){let l=e[s],u=r[s]={};for(let c in l){let p=l[+c];if(!p||p.bitmap.width===0||p.bitmap.height===0)continue;let f={x:0,y:0,w:p.bitmap.width+2*da,h:p.bitmap.height+2*da};n.push(f),u[c]={rect:f,metrics:p.metrics}}}let{w:i,h:o}=ei(n),a=new Qt({width:i||1,height:o||1});for(let s in e){let l=e[s];for(let u in l){let c=l[+u];if(!c||c.bitmap.width===0||c.bitmap.height===0)continue;let p=r[s][u].rect;Qt.copy(c.bitmap,a,{x:0,y:0},{x:p.x+da,y:p.y+da},c.bitmap)}}this.image=a,this.positions=r}};C("GlyphAtlas",pi);function Nf(t,e,r){e=Math.pow(2,r)-e-1;var n=Of(t*256,e*256,r),i=Of((t+1)*256,(e+1)*256,r);return n[0]+","+n[1]+","+i[0]+","+i[1]}function Of(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r),i=t*n-2*Math.PI*6378137/2,o=e*n-2*Math.PI*6378137/2;return[i,o]}var Gf=Z(he(),1);var sl=63710088e-1,fi=class t{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 t(ql(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let r=Math.PI/180,n=this.lat*r,i=e.lat*r,o=Math.sin(n)*Math.sin(i)+Math.cos(n)*Math.cos(i)*Math.cos((e.lng-this.lng)*r);return sl*Math.acos(Math.min(o,1))}static convert(e){if(e instanceof t)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new t(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new t(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}};var Uf=2*Math.PI*sl;function $f(t){return Uf*Math.cos(t*Math.PI/180)}function Eb(t){return(180+t)/360}function Fb(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Lb(t,e){return t/$f(e)}function Db(t){return t*360-180}function ll(t){let e=180-t*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function Vb(t,e){return t*$f(ll(e))}function Bb(t){return 1/Math.cos(t*Math.PI/180)}var ga=class t{constructor(e,r,n=0){this.x=+e,this.y=+r,this.z=+n}static fromLngLat(e,r=0){let n=fi.convert(e);return new t(Eb(n.lng),Fb(n.lat),Lb(r,n.lat))}toLngLat(){return new fi(Db(this.x),ll(this.y))}toAltitude(){return Vb(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Uf*Bb(ll(this.y))}};var xa=class{constructor(e,r,n){if(e<0||e>25||n<0||n>=Math.pow(2,e)||r<0||r>=Math.pow(2,e))throw new Error(`x=${r}, y=${n}, 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=n,this.key=yi(0,e,e,r,n)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,r,n){let i=Nf(this.x,this.y,this.z),o=zb(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(n==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,r>1?"@2x":"").replace(/{quadkey}/g,o).replace(/{bbox-epsg-3857}/g,i)}isChildOf(e){let r=this.z-e.z;return r>0&&e.x===this.x>>r&&e.y===this.y>>r}getTilePoint(e){let r=Math.pow(2,this.z);return new Gf.default((e.x*r-this.x)*8192,(e.y*r-this.y)*8192)}toString(){return`${this.z}/${this.x}/${this.y}`}},ul=class{constructor(e,r){this.wrap=e,this.canonical=r,this.key=yi(e,r.z,r.z,r.x,r.y)}},mi=class t{constructor(e,r,n,i,o){if(e<n)throw new Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${n}`);this.overscaledZ=e,this.wrap=r,this.canonical=new xa(n,+i,+o),this.key=yi(r,e,n,i,o)}clone(){return new t(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}`);let r=this.canonical.z-e;return e>this.canonical.z?new t(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new t(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}`);let n=this.canonical.z-e;return e>this.canonical.z?yi(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):yi(this.wrap*+r,e,e,this.canonical.x>>n,this.canonical.y>>n)}isChildOf(e){if(e.wrap!==this.wrap)return!1;let r=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new t(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let r=this.canonical.z+1,n=this.canonical.x*2,i=this.canonical.y*2;return[new t(r,this.wrap,r,n,i),new t(r,this.wrap,r,n+1,i),new t(r,this.wrap,r,n,i+1),new t(r,this.wrap,r,n+1,i+1)]}isLessThan(e){return this.wrap<e.wrap?!0:this.wrap>e.wrap?!1:this.overscaledZ<e.overscaledZ?!0:this.overscaledZ>e.overscaledZ?!1:this.canonical.x<e.canonical.x?!0:this.canonical.x>e.canonical.x?!1:this.canonical.y<e.canonical.y}wrapped(){return new t(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new t(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new ul(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new ga(e.x-this.wrap,e.y))}};function yi(t,e,r,n,i){t*=2,t<0&&(t=t*-1-1);let o=1<<r;return(o*o*t+o*i+n).toString(36)+r.toString(36)+e.toString(36)}function zb(t,e,r){let n="",i;for(let o=t;o>0;o--)i=1<<o-1,n+=(e&i?1:0)+(r&i?2:0);return n}C("CanonicalTileID",xa);C("OverscaledTileID",mi,{omit:["posMatrix"]});var ba=class{constructor(e){this.tileID=new mi(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId,this.inFlightDependencies=[]}async parse(e,r,n,i){this.status="parsing",this.data=e,this.collisionBoxArray=new Fn;let o=new Vr(Object.keys(e.layers).sort()),a=new li(this.tileID,this.promoteId);a.bucketLayerIDs=[];let s={},l={featureIndex:a,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:n},u=r.familiesBySource[this.source];for(let P in u){let w=e.layers[P];if(!w)continue;w.version===1&&fe(`Vector tile source "${this.source}" layer "${P}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let T=o.encode(P),F=[];for(let E=0;E<w.length;E++){let _=w.feature(E),I=a.getId(_,P);F.push({feature:_,id:I,index:E,sourceLayerIndex:T})}for(let E of u[P]){let _=E[0];if(_.source!==this.source&&fe(`layer.source = ${_.source} does not equal this.source = ${this.source}`),_.minzoom&&this.zoom<Math.floor(_.minzoom)||_.maxzoom&&this.zoom>=_.maxzoom||_.visibility==="none")continue;cl(E,this.zoom,n),(s[_.id]=_.createBucket({index:a.bucketLayerIDs.length,layers:E,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:T,sourceID:this.source})).populate(F,l,this.tileID.canonical),a.bucketLayerIDs.push(E.map(k=>k.id))}}let c=qr(l.glyphDependencies,P=>Object.keys(P).map(Number));this.inFlightDependencies.forEach(P=>P?.abort()),this.inFlightDependencies=[];let p=Promise.resolve({});if(Object.keys(c).length){let P=new AbortController;this.inFlightDependencies.push(P),p=i.sendAsync({type:"GG",data:{stacks:c,source:this.source,tileID:this.tileID,type:"glyphs"}},P)}let f=Object.keys(l.iconDependencies),y=Promise.resolve({});if(f.length){let P=new AbortController;this.inFlightDependencies.push(P),y=i.sendAsync({type:"GI",data:{icons:f,source:this.source,tileID:this.tileID,type:"icons"}},P)}let m=Object.keys(l.patternDependencies),h=Promise.resolve({});if(m.length){let P=new AbortController;this.inFlightDependencies.push(P),h=i.sendAsync({type:"GI",data:{icons:m,source:this.source,tileID:this.tileID,type:"patterns"}},P)}let[d,g,b]=await Promise.all([p,y,h]),x=new pi(d),v=new ti(g,b);for(let P in s){let w=s[P];w instanceof He?(cl(w.layers,this.zoom,n),zf({bucket:w,glyphMap:d,glyphPositions:x.positions,imageMap:g,imagePositions:v.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):w.hasPattern&&(w instanceof nr||w instanceof tr||w instanceof rr)&&(cl(w.layers,this.zoom,n),w.addFeatures(l,this.tileID.canonical,v.patternPositions))}return this.status="done",{buckets:Object.values(s).filter(P=>!P.isEmpty()),featureIndex:a,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:x.image,imageAtlas:v,glyphMap:this.returnDependencies?d:null,iconMap:this.returnDependencies?g:null,glyphPositions:this.returnDependencies?x.positions:null}}};function cl(t,e,r){let n=new q(e);for(let i of t)i.recalculate(n,r)}var Rb=60,NI=1e3/Rb;var Rr=class{constructor(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let e=performance.getEntriesByName(this._marks.measure);return e.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),e=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),e}};var Or=class{constructor(e,r,n){this.actor=e,this.layerIndex=r,this.availableImages=n,this.fetching={},this.loading={},this.loaded={}}async loadVectorTile(e,r){let n=await cc(e.request,r);try{return{vectorTile:new qf.default.VectorTile(new jf.default(n.data)),rawData:n.data,cacheControl:n.cacheControl,expires:n.expires}}catch(i){let o=new Uint8Array(n.data),a=o[0]===31&&o[1]===139,s=`Unable to parse the tile at ${e.request.url}, `;throw a?s+="please make sure the data is not gzipped and that you have configured the relevant header in the server":s+=`got error: ${i.messge}`,new Error(s)}}async loadTile(e){let r=e.uid,n=e&&e.request&&e.request.collectResourceTiming?new Rr(e.request):!1,i=new ba(e);this.loading[r]=i;let o=new AbortController;i.abort=o;try{let a=await this.loadVectorTile(e,o);if(delete this.loading[r],!a)return null;let s=a.rawData,l={};a.expires&&(l.expires=a.expires),a.cacheControl&&(l.cacheControl=a.cacheControl);let u={};if(n){let p=n.finish();p&&(u.resourceTiming=JSON.parse(JSON.stringify(p)))}i.vectorTile=a.vectorTile;let c=i.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[r]=i,this.fetching[r]={rawTileData:s,cacheControl:l,resourceTiming:u};try{let p=await c;return Pe({rawTileData:s.slice(0)},p,l,u)}finally{delete this.fetching[r]}}catch(a){throw delete this.loading[r],i.status="done",this.loaded[r]=i,a}}async reloadTile(e){let r=e.uid;if(!this.loaded||!this.loaded[r])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");let n=this.loaded[r];if(n.showCollisionBoxes=e.showCollisionBoxes,n.status==="parsing"){let i=await n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor),o;if(this.fetching[r]){let{rawTileData:a,cacheControl:s,resourceTiming:l}=this.fetching[r];delete this.fetching[r],o=Pe({rawTileData:a.slice(0)},i,s,l)}else o=i;return o}if(n.status==="done"&&n.vectorTile)return n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor)}async abortTile(e){let r=this.loading,n=e.uid;r&&r[n]&&r[n].abort&&(r[n].abort.abort(),delete r[n])}async removeTile(e){this.loaded&&this.loaded[e.uid]&&delete this.loaded[e.uid]}};var hi=class{constructor(e,r,n,i=1,o=1,a=1,s=0){if(this.uid=e,r.height!==r.width)throw new RangeError("DEM tiles must be square");if(n&&!["mapbox","terrarium","custom"].includes(n)){fe(`"${n}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);return}this.stride=r.height;let l=this.dim=r.height-2;switch(this.data=new Uint32Array(r.data.buffer),n){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=i,this.greenFactor=o,this.blueFactor=a,this.baseShift=s;break;case"mapbox":default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4;break}for(let u=0;u<l;u++)this.data[this._idx(-1,u)]=this.data[this._idx(0,u)],this.data[this._idx(l,u)]=this.data[this._idx(l-1,u)],this.data[this._idx(u,-1)]=this.data[this._idx(u,0)],this.data[this._idx(u,l)]=this.data[this._idx(u,l-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(l,-1)]=this.data[this._idx(l-1,0)],this.data[this._idx(-1,l)]=this.data[this._idx(0,l-1)],this.data[this._idx(l,l)]=this.data[this._idx(l-1,l-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let u=0;u<l;u++)for(let c=0;c<l;c++){let p=this.get(u,c);p>this.max&&(this.max=p),p<this.min&&(this.min=p)}}get(e,r){let n=new Uint8Array(this.data.buffer),i=this._idx(e,r)*4;return this.unpack(n[i],n[i+1],n[i+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,r){if(e<-1||e>=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(e+1)}unpack(e,r,n){return e*this.redFactor+r*this.greenFactor+n*this.blueFactor-this.baseShift}getPixels(){return new de({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,r,n){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let i=r*this.dim,o=r*this.dim+this.dim,a=n*this.dim,s=n*this.dim+this.dim;switch(r){case-1:i=o-1;break;case 1:o=i+1;break}switch(n){case-1:a=s-1;break;case 1:s=a+1;break}let l=-r*this.dim,u=-n*this.dim;for(let c=a;c<s;c++)for(let p=i;p<o;p++)this.data[this._idx(p,c)]=e.data[this._idx(p+l,c+u)]}};C("DEMData",hi);var va=class{constructor(){this.loaded={}}async loadTile(e){let{uid:r,encoding:n,rawImageData:i,redFactor:o,greenFactor:a,blueFactor:s,baseShift:l}=e,u=i.width+2,c=i.height+2,p=jr(i)?new de({width:u,height:c},await Hl(i,-1,-1,u,c)):i,f=new hi(r,p,n,o,a,s,l);return this.loaded=this.loaded||{},this.loaded[r]=f,f}removeTile(e){let r=this.loaded,n=e.uid;r&&r[n]&&delete r[n]}};var xy=Z(Hf(),1);var pl=Z(he(),1),Xf=Z(Tt(),1);var Ob=Xf.default.VectorTileFeature.prototype.toGeoJSON,fl=class{constructor(e){this._feature=e,this.extent=8192,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))}loadGeometry(){if(this._feature.type===1){let e=[];for(let r of this._feature.geometry)e.push([new pl.default(r[0],r[1])]);return e}else{let e=[];for(let r of this._feature.geometry){let n=[];for(let i of r)n.push(new pl.default(i[0],i[1]));e.push(n)}return e}}toGeoJSON(e,r,n){return Ob.call(this,e,r,n)}},Sa=class{constructor(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=8192,this.length=e.length,this._features=e}feature(e){return new fl(this._features[e])}};var by=Z(ry(),1);var ny=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],hl=1,gi=8,bi=class t{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[r,n]=new Uint8Array(e,0,2);if(r!==219)throw new Error("Data does not appear to be in a KDBush format.");let i=n>>4;if(i!==hl)throw new Error(`Got v${i} data when expected v${hl}.`);let o=ny[n&15];if(!o)throw new Error("Unrecognized array type.");let[a]=new Uint16Array(e,2,1),[s]=new Uint32Array(e,4,1);return new t(s,a,o,e)}constructor(e,r=64,n=Float64Array,i){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=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let o=ny.indexOf(this.ArrayType),a=e*2*this.ArrayType.BYTES_PER_ELEMENT,s=e*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-s%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${n}.`);i&&i instanceof ArrayBuffer?(this.data=i,this.ids=new this.IndexArrayType(this.data,gi,e),this.coords=new this.ArrayType(this.data,gi+s+l,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(gi+a+s+l),this.ids=new this.IndexArrayType(this.data,gi,e),this.coords=new this.ArrayType(this.data,gi+s+l,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(hl<<4)+o]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=e)}add(e,r){let n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=r,n}finish(){let e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return gl(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:a,nodeSize:s}=this,l=[0,o.length-1,0],u=[];for(;l.length;){let c=l.pop()||0,p=l.pop()||0,f=l.pop()||0;if(p-f<=s){for(let d=f;d<=p;d++){let g=a[2*d],b=a[2*d+1];g>=e&&g<=n&&b>=r&&b<=i&&u.push(o[d])}continue}let y=f+p>>1,m=a[2*y],h=a[2*y+1];m>=e&&m<=n&&h>=r&&h<=i&&u.push(o[y]),(c===0?e<=m:r<=h)&&(l.push(f),l.push(y-1),l.push(1-c)),(c===0?n>=m:i>=h)&&(l.push(y+1),l.push(p),l.push(1-c))}return u}within(e,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:i,coords:o,nodeSize:a}=this,s=[0,i.length-1,0],l=[],u=n*n;for(;s.length;){let c=s.pop()||0,p=s.pop()||0,f=s.pop()||0;if(p-f<=a){for(let d=f;d<=p;d++)iy(o[2*d],o[2*d+1],e,r)<=u&&l.push(i[d]);continue}let y=f+p>>1,m=o[2*y],h=o[2*y+1];iy(m,h,e,r)<=u&&l.push(i[y]),(c===0?e-n<=m:r-n<=h)&&(s.push(f),s.push(y-1),s.push(1-c)),(c===0?e+n>=m:r+n>=h)&&(s.push(y+1),s.push(p),s.push(1-c))}return l}};function gl(t,e,r,n,i,o){if(i-n<=r)return;let a=n+i>>1;oy(t,e,a,n,i,o),gl(t,e,r,n,a-1,1-o),gl(t,e,r,a+1,i,1-o)}function oy(t,e,r,n,i,o){for(;i>n;){if(i-n>600){let u=i-n+1,c=r-n+1,p=Math.log(u),f=.5*Math.exp(2*p/3),y=.5*Math.sqrt(p*f*(u-f)/u)*(c-u/2<0?-1:1),m=Math.max(n,Math.floor(r-c*f/u+y)),h=Math.min(i,Math.floor(r+(u-c)*f/u+y));oy(t,e,r,m,h,o)}let a=e[2*r+o],s=n,l=i;for(xi(t,e,n,r),e[2*i+o]>a&&xi(t,e,n,i);s<l;){for(xi(t,e,s,l),s++,l--;e[2*s+o]<a;)s++;for(;e[2*l+o]>a;)l--}e[2*n+o]===a?xi(t,e,n,l):(l++,xi(t,e,l,i)),l<=r&&(n=l+1),r<=l&&(i=l-1)}}function xi(t,e,r,n){dl(t,r,n),dl(e,2*r,2*n),dl(e,2*r+1,2*n+1)}function dl(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}function iy(t,e,r,n){let i=t-r,o=e-n;return i*i+o*o}var Xb={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},ay=Math.fround||(t=>e=>(t[0]=+e,t[0]))(new Float32Array(1)),or=2,Et=3,xl=4,Mt=5,ly=6,vi=class{constructor(e){this.options=Object.assign(Object.create(Xb),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){let{log:r,minZoom:n,maxZoom:i}=this.options;r&&console.time("total time");let o=`prepare ${e.length} points`;r&&console.time(o),this.points=e;let a=[];for(let l=0;l<e.length;l++){let u=e[l];if(!u.geometry)continue;let[c,p]=u.geometry.coordinates,f=ay(Aa(c)),y=ay(_a(p));a.push(f,y,1/0,l,-1,1),this.options.reduce&&a.push(0)}let s=this.trees[i+1]=this._createTree(a);r&&console.timeEnd(o);for(let l=i;l>=n;l--){let u=+Date.now();s=this.trees[l]=this._createTree(this._cluster(s,l)),r&&console.log("z%d: %d clusters in %dms",l,s.numItems,+Date.now()-u)}return r&&console.timeEnd("total time"),this}getClusters(e,r){let n=((e[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,e[1])),o=e[2]===180?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,o=180;else if(n>o){let p=this.getClusters([n,i,180,a],r),f=this.getClusters([-180,i,o,a],r);return p.concat(f)}let s=this.trees[this._limitZoom(r)],l=s.range(Aa(n),_a(a),Aa(o),_a(i)),u=s.data,c=[];for(let p of l){let f=this.stride*p;c.push(u[f+Mt]>1?sy(u,f,this.clusterProps):this.points[u[f+Et]])}return c}getChildren(e){let r=this._getOriginId(e),n=this._getOriginZoom(e),i="No cluster with the specified id.",o=this.trees[n];if(!o)throw new Error(i);let a=o.data;if(r*this.stride>=a.length)throw new Error(i);let s=this.options.radius/(this.options.extent*Math.pow(2,n-1)),l=a[r*this.stride],u=a[r*this.stride+1],c=o.within(l,u,s),p=[];for(let f of c){let y=f*this.stride;a[y+xl]===e&&p.push(a[y+Mt]>1?sy(a,y,this.clusterProps):this.points[a[y+Et]])}if(p.length===0)throw new Error(i);return p}getLeaves(e,r,n){r=r||10,n=n||0;let i=[];return this._appendLeaves(i,e,r,n,0),i}getTile(e,r,n){let i=this.trees[this._limitZoom(e)],o=Math.pow(2,e),{extent:a,radius:s}=this.options,l=s/a,u=(n-l)/o,c=(n+1+l)/o,p={features:[]};return this._addTileFeatures(i.range((r-l)/o,u,(r+1+l)/o,c),i.data,r,n,o,p),r===0&&this._addTileFeatures(i.range(1-l/o,u,1,c),i.data,o,n,o,p),r===o-1&&this._addTileFeatures(i.range(0,u,l/o,c),i.data,-1,n,o,p),p.features.length?p:null}getClusterExpansionZoom(e){let r=this._getOriginZoom(e)-1;for(;r<=this.options.maxZoom;){let n=this.getChildren(e);if(r++,n.length!==1)break;e=n[0].properties.cluster_id}return r}_appendLeaves(e,r,n,i,o){let a=this.getChildren(r);for(let s of a){let l=s.properties;if(l&&l.cluster?o+l.point_count<=i?o+=l.point_count:o=this._appendLeaves(e,l.cluster_id,n,i,o):o<i?o++:e.push(s),e.length===n)break}return o}_createTree(e){let r=new bi(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let n=0;n<e.length;n+=this.stride)r.add(e[n],e[n+1]);return r.finish(),r.data=e,r}_addTileFeatures(e,r,n,i,o,a){for(let s of e){let l=s*this.stride,u=r[l+Mt]>1,c,p,f;if(u)c=uy(r,l,this.clusterProps),p=r[l],f=r[l+1];else{let h=this.points[r[l+Et]];c=h.properties;let[d,g]=h.geometry.coordinates;p=Aa(d),f=_a(g)}let y={type:1,geometry:[[Math.round(this.options.extent*(p*o-n)),Math.round(this.options.extent*(f*o-i))]],tags:c},m;u||this.options.generateId?m=r[l+Et]:m=this.points[r[l+Et]].id,m!==void 0&&(y.id=m),a.features.push(y)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,r){let{radius:n,extent:i,reduce:o,minPoints:a}=this.options,s=n/(i*Math.pow(2,r)),l=e.data,u=[],c=this.stride;for(let p=0;p<l.length;p+=c){if(l[p+or]<=r)continue;l[p+or]=r;let f=l[p],y=l[p+1],m=e.within(l[p],l[p+1],s),h=l[p+Mt],d=h;for(let g of m){let b=g*c;l[b+or]>r&&(d+=l[b+Mt])}if(d>h&&d>=a){let g=f*h,b=y*h,x,v=-1,P=((p/c|0)<<5)+(r+1)+this.points.length;for(let w of m){let T=w*c;if(l[T+or]<=r)continue;l[T+or]=r;let F=l[T+Mt];g+=l[T]*F,b+=l[T+1]*F,l[T+xl]=P,o&&(x||(x=this._map(l,p,!0),v=this.clusterProps.length,this.clusterProps.push(x)),o(x,this._map(l,T)))}l[p+xl]=P,u.push(g/d,b/d,1/0,P,-1,d),o&&u.push(v)}else{for(let g=0;g<c;g++)u.push(l[p+g]);if(d>1)for(let g of m){let b=g*c;if(!(l[b+or]<=r)){l[b+or]=r;for(let x=0;x<c;x++)u.push(l[b+x])}}}}return u}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,r,n){if(e[r+Mt]>1){let a=this.clusterProps[e[r+ly]];return n?Object.assign({},a):a}let i=this.points[e[r+Et]].properties,o=this.options.map(i);return n&&o===i?Object.assign({},o):o}};function sy(t,e,r){return{type:"Feature",id:t[e+Et],properties:uy(t,e,r),geometry:{type:"Point",coordinates:[Kb(t[e]),Yb(t[e+1])]}}}function uy(t,e,r){let n=t[e+Mt],i=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?`${Math.round(n/100)/10}k`:n,o=t[e+ly],a=o===-1?{}:Object.assign({},r[o]);return Object.assign(a,{cluster:!0,cluster_id:t[e+Et],point_count:n,point_count_abbreviated:i})}function Aa(t){return t/360+.5}function _a(t){let e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function Kb(t){return(t-.5)*360}function Yb(t){let e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function Pi(t,e,r,n){for(var i=n,o=r-e>>1,a=r-e,s,l=t[e],u=t[e+1],c=t[r],p=t[r+1],f=e+3;f<r;f+=3){var y=Qb(t[f],t[f+1],l,u,c,p);if(y>i)s=f,i=y;else if(y===i){var m=Math.abs(f-o);m<a&&(s=f,a=m)}}i>n&&(s-e>3&&Pi(t,e,s,n),t[s+2]=i,r-s>3&&Pi(t,s,r,n))}function Qb(t,e,r,n,i,o){var a=i-r,s=o-n;if(a!==0||s!==0){var l=((t-r)*a+(e-n)*s)/(a*a+s*s);l>1?(r=i,n=o):l>0&&(r+=a*l,n+=s*l)}return a=t-r,s=e-n,a*a+s*s}function ft(t,e,r,n){var i={id:typeof t>"u"?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return e0(i),i}function e0(t){var e=t.geometry,r=t.type;if(r==="Point"||r==="MultiPoint"||r==="LineString")bl(t,e);else if(r==="Polygon"||r==="MultiLineString")for(var n=0;n<e.length;n++)bl(t,e[n]);else if(r==="MultiPolygon")for(n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++)bl(t,e[n][i])}function bl(t,e){for(var r=0;r<e.length;r+=3)t.minX=Math.min(t.minX,e[r]),t.minY=Math.min(t.minY,e[r+1]),t.maxX=Math.max(t.maxX,e[r]),t.maxY=Math.max(t.maxY,e[r+1])}function Sl(t,e){var r=[];if(t.type==="FeatureCollection")for(var n=0;n<t.features.length;n++)Ia(r,t.features[n],e,n);else t.type==="Feature"?Ia(r,t,e):Ia(r,{geometry:t},e);return r}function Ia(t,e,r,n){if(e.geometry){var i=e.geometry.coordinates,o=e.geometry.type,a=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],l=e.id;if(r.promoteId?l=e.properties[r.promoteId]:r.generateId&&(l=n||0),o==="Point")cy(i,s);else if(o==="MultiPoint")for(var u=0;u<i.length;u++)cy(i[u],s);else if(o==="LineString")Pl(i,s,a,!1);else if(o==="MultiLineString")if(r.lineMetrics){for(u=0;u<i.length;u++)s=[],Pl(i[u],s,a,!1),t.push(ft(l,"LineString",s,e.properties));return}else vl(i,s,a,!1);else if(o==="Polygon")vl(i,s,a,!0);else if(o==="MultiPolygon")for(u=0;u<i.length;u++){var c=[];vl(i[u],c,a,!0),s.push(c)}else if(o==="GeometryCollection"){for(u=0;u<e.geometry.geometries.length;u++)Ia(t,{id:l,geometry:e.geometry.geometries[u],properties:e.properties},r,n);return}else throw new Error("Input data is not a valid GeoJSON object.");t.push(ft(l,o,s,e.properties))}}function cy(t,e){e.push(py(t[0])),e.push(fy(t[1])),e.push(0)}function Pl(t,e,r,n){for(var i,o,a=0,s=0;s<t.length;s++){var l=py(t[s][0]),u=fy(t[s][1]);e.push(l),e.push(u),e.push(0),s>0&&(n?a+=(i*u-l*o)/2:a+=Math.sqrt(Math.pow(l-i,2)+Math.pow(u-o,2))),i=l,o=u}var c=e.length-3;e[2]=1,Pi(e,0,c,r),e[c+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function vl(t,e,r,n){for(var i=0;i<t.length;i++){var o=[];Pl(t[i],o,r,n),e.push(o)}}function py(t){return t/360+.5}function fy(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function qe(t,e,r,n,i,o,a,s){if(r/=e,n/=e,o>=r&&a<n)return t;if(a<r||o>=n)return null;for(var l=[],u=0;u<t.length;u++){var c=t[u],p=c.geometry,f=c.type,y=i===0?c.minX:c.minY,m=i===0?c.maxX:c.maxY;if(y>=r&&m<n){l.push(c);continue}else if(m<r||y>=n)continue;var h=[];if(f==="Point"||f==="MultiPoint")t0(p,h,r,n,i);else if(f==="LineString")my(p,h,r,n,i,!1,s.lineMetrics);else if(f==="MultiLineString")wl(p,h,r,n,i,!1);else if(f==="Polygon")wl(p,h,r,n,i,!0);else if(f==="MultiPolygon")for(var d=0;d<p.length;d++){var g=[];wl(p[d],g,r,n,i,!0),g.length&&h.push(g)}if(h.length){if(s.lineMetrics&&f==="LineString"){for(d=0;d<h.length;d++)l.push(ft(c.id,f,h[d],c.tags));continue}(f==="LineString"||f==="MultiLineString")&&(h.length===1?(f="LineString",h=h[0]):f="MultiLineString"),(f==="Point"||f==="MultiPoint")&&(f=h.length===3?"Point":"MultiPoint"),l.push(ft(c.id,f,h,c.tags))}}return l.length?l:null}function t0(t,e,r,n,i){for(var o=0;o<t.length;o+=3){var a=t[o+i];a>=r&&a<=n&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function my(t,e,r,n,i,o,a){for(var s=yy(t),l=i===0?r0:n0,u=t.start,c,p,f=0;f<t.length-3;f+=3){var y=t[f],m=t[f+1],h=t[f+2],d=t[f+3],g=t[f+4],b=i===0?y:m,x=i===0?d:g,v=!1;a&&(c=Math.sqrt(Math.pow(y-d,2)+Math.pow(m-g,2))),b<r?x>r&&(p=l(s,y,m,d,g,r),a&&(s.start=u+c*p)):b>n?x<n&&(p=l(s,y,m,d,g,n),a&&(s.start=u+c*p)):Al(s,y,m,h),x<r&&b>=r&&(p=l(s,y,m,d,g,r),v=!0),x>n&&b<=n&&(p=l(s,y,m,d,g,n),v=!0),!o&&v&&(a&&(s.end=u+c*p),e.push(s),s=yy(t)),a&&(u+=c)}var P=t.length-3;y=t[P],m=t[P+1],h=t[P+2],b=i===0?y:m,b>=r&&b<=n&&Al(s,y,m,h),P=s.length-3,o&&P>=3&&(s[P]!==s[0]||s[P+1]!==s[1])&&Al(s,s[0],s[1],s[2]),s.length&&e.push(s)}function yy(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function wl(t,e,r,n,i,o){for(var a=0;a<t.length;a++)my(t[a],e,r,n,i,o,!1)}function Al(t,e,r,n){t.push(e),t.push(r),t.push(n)}function r0(t,e,r,n,i,o){var a=(o-e)/(n-e);return t.push(o),t.push(r+(i-r)*a),t.push(1),a}function n0(t,e,r,n,i,o){var a=(o-r)/(i-r);return t.push(e+(n-e)*a),t.push(o),t.push(1),a}function Il(t,e){var r=e.buffer/e.extent,n=t,i=qe(t,1,-1-r,r,0,-1,2,e),o=qe(t,1,1-r,2+r,0,-1,2,e);return(i||o)&&(n=qe(t,1,-r,1+r,0,-1,2,e)||[],i&&(n=hy(i,1).concat(n)),o&&(n=n.concat(hy(o,-1)))),n}function hy(t,e){for(var r=[],n=0;n<t.length;n++){var i=t[n],o=i.type,a;if(o==="Point"||o==="MultiPoint"||o==="LineString")a=_l(i.geometry,e);else if(o==="MultiLineString"||o==="Polygon"){a=[];for(var s=0;s<i.geometry.length;s++)a.push(_l(i.geometry[s],e))}else if(o==="MultiPolygon")for(a=[],s=0;s<i.geometry.length;s++){for(var l=[],u=0;u<i.geometry[s].length;u++)l.push(_l(i.geometry[s][u],e));a.push(l)}r.push(ft(i.id,o,a,i.tags))}return r}function _l(t,e){var r=[];r.size=t.size,t.start!==void 0&&(r.start=t.start,r.end=t.end);for(var n=0;n<t.length;n+=3)r.push(t[n]+e,t[n+1],t[n+2]);return r}function Ta(t,e){if(t.transformed)return t;var r=1<<t.z,n=t.x,i=t.y,o,a,s;for(o=0;o<t.features.length;o++){var l=t.features[o],u=l.geometry,c=l.type;if(l.geometry=[],c===1)for(a=0;a<u.length;a+=2)l.geometry.push(dy(u[a],u[a+1],e,r,n,i));else for(a=0;a<u.length;a++){var p=[];for(s=0;s<u[a].length;s+=2)p.push(dy(u[a][s],u[a][s+1],e,r,n,i));l.geometry.push(p)}}return t.transformed=!0,t}function dy(t,e,r,n,i,o){return[Math.round(r*(t*n-i)),Math.round(r*(e*n-o))]}function Cl(t,e,r,n,i){for(var o=e===i.maxZoom?0:i.tolerance/((1<<e)*i.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<t.length;s++){a.numFeatures++,i0(a,t[s],o,i);var l=t[s].minX,u=t[s].minY,c=t[s].maxX,p=t[s].maxY;l<a.minX&&(a.minX=l),u<a.minY&&(a.minY=u),c>a.maxX&&(a.maxX=c),p>a.maxY&&(a.maxY=p)}return a}function i0(t,e,r,n){var i=e.geometry,o=e.type,a=[];if(o==="Point"||o==="MultiPoint")for(var s=0;s<i.length;s+=3)a.push(i[s]),a.push(i[s+1]),t.numPoints++,t.numSimplified++;else if(o==="LineString")Tl(a,i,t,r,!1,!1);else if(o==="MultiLineString"||o==="Polygon")for(s=0;s<i.length;s++)Tl(a,i[s],t,r,o==="Polygon",s===0);else if(o==="MultiPolygon")for(var l=0;l<i.length;l++){var u=i[l];for(s=0;s<u.length;s++)Tl(a,u[s],t,r,!0,s===0)}if(a.length){var c=e.tags||null;if(o==="LineString"&&n.lineMetrics){c={};for(var p in e.tags)c[p]=e.tags[p];c.mapbox_clip_start=i.start/i.size,c.mapbox_clip_end=i.end/i.size}var f={geometry:a,type:o==="Polygon"||o==="MultiPolygon"?3:o==="LineString"||o==="MultiLineString"?2:1,tags:c};e.id!==null&&(f.id=e.id),t.features.push(f)}}function Tl(t,e,r,n,i,o){var a=n*n;if(n>0&&e.size<(i?a:n)){r.numPoints+=e.length/3;return}for(var s=[],l=0;l<e.length;l+=3)(n===0||e[l+2]>a)&&(r.numSimplified++,s.push(e[l]),s.push(e[l+1])),r.numPoints++;i&&o0(s,o),t.push(s)}function o0(t,e){for(var r=0,n=0,i=t.length,o=i-2;n<i;o=n,n+=2)r+=(t[n]-t[o])*(t[n+1]+t[o+1]);if(r>0===e)for(n=0,i=t.length;n<i/2;n+=2){var a=t[n],s=t[n+1];t[n]=t[i-2-n],t[n+1]=t[i-1-n],t[i-2-n]=a,t[i-1-n]=s}}function Ml(t,e){return new Ca(t,e)}function Ca(t,e){e=this.options=a0(Object.create(this.options),e);var r=e.debug;if(r&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=Sl(t,e);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),n=Il(n,e),n.length&&this.splitTile(n,0,0,0),r&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}Ca.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};Ca.prototype.splitTile=function(t,e,r,n,i,o,a){for(var s=[t,e,r,n],l=this.options,u=l.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var c=1<<e,p=kl(e,r,n),f=this.tiles[p];if(!f&&(u>1&&console.time("creation"),f=this.tiles[p]=Cl(t,e,r,n,l),this.tileCoords.push({z:e,x:r,y:n}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd("creation"));var y="z"+e;this.stats[y]=(this.stats[y]||0)+1,this.total++}if(f.source=t,i){if(e===l.maxZoom||e===i)continue;var m=1<<i-e;if(r!==Math.floor(o/m)||n!==Math.floor(a/m))continue}else if(e===l.indexMaxZoom||f.numPoints<=l.indexMaxPoints)continue;if(f.source=null,t.length!==0){u>1&&console.time("clipping");var h=.5*l.buffer/l.extent,d=.5-h,g=.5+h,b=1+h,x,v,P,w,T,F;x=v=P=w=null,T=qe(t,c,r-h,r+g,0,f.minX,f.maxX,l),F=qe(t,c,r+d,r+b,0,f.minX,f.maxX,l),t=null,T&&(x=qe(T,c,n-h,n+g,1,f.minY,f.maxY,l),v=qe(T,c,n+d,n+b,1,f.minY,f.maxY,l),T=null),F&&(P=qe(F,c,n-h,n+g,1,f.minY,f.maxY,l),w=qe(F,c,n+d,n+b,1,f.minY,f.maxY,l),F=null),u>1&&console.timeEnd("clipping"),s.push(x||[],e+1,r*2,n*2),s.push(v||[],e+1,r*2,n*2+1),s.push(P||[],e+1,r*2+1,n*2),s.push(w||[],e+1,r*2+1,n*2+1)}}};Ca.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,o=n.debug;if(t<0||t>24)return null;var a=1<<t;e=(e%a+a)%a;var s=kl(t,e,r);if(this.tiles[s])return Ta(this.tiles[s],i);o>1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var l=t,u=e,c=r,p;!p&&l>0;)l--,u=Math.floor(u/2),c=Math.floor(c/2),p=this.tiles[kl(l,u,c)];return!p||!p.source?null:(o>1&&console.log("found parent tile z%d-%d-%d",l,u,c),o>1&&console.time("drilling down"),this.splitTile(p.source,l,u,c,t,e,r),o>1&&console.timeEnd("drilling down"),this.tiles[s]?Ta(this.tiles[s],i):null)};function kl(t,e,r){return((1<<t)*r+e)*32+t}function a0(t,e){for(var r in e)t[r]=e[r];return t}function Si(t,e){return e?t.properties[e]:t.id}function El(t,e){if(t==null)return!0;if(t.type==="Feature")return Si(t,e)!=null;if(t.type==="FeatureCollection"){let r=new Set;for(let n of t.features){let i=Si(n,e);if(i==null||r.has(i))return!1;r.add(i)}return!0}return!1}function Fl(t,e){let r=new Map;if(t!=null)if(t.type==="Feature")r.set(Si(t,e),t);else for(let n of t.features)r.set(Si(n,e),n);return r}function gy(t,e,r){if(e.removeAll&&t.clear(),e.remove)for(let n of e.remove)t.delete(n);if(e.add)for(let n of e.add){let i=Si(n,r);i!=null&&t.set(i,n)}if(e.update)for(let n of e.update){let i=t.get(n.id);if(i==null)continue;let o=n.newGeometry||n.removeAllProperties,a=!n.removeAllProperties&&(n.removeProperties?.length>0||n.addOrUpdateProperties?.length>0);if((o||a)&&(i={...i},t.set(n.id,i),a&&(i.properties={...i.properties})),n.newGeometry&&(i.geometry=n.newGeometry),n.removeAllProperties)i.properties={};else if(n.removeProperties?.length>0)for(let s of n.removeProperties)Object.prototype.hasOwnProperty.call(i.properties,s)&&delete i.properties[s];if(n.addOrUpdateProperties?.length>0)for(let{key:s,value:l}of n.addOrUpdateProperties)i.properties[s]=l}}var ka=class extends Or{constructor(){super(...arguments);this._dataUpdateable=new Map}async loadVectorTile(r,n){let i=r.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");let o=this._geoJSONIndex.getTile(i.z,i.x,i.y);if(!o)return null;let a=new Sa(o.features),s=(0,by.default)(a);return(s.byteOffset!==0||s.byteLength!==s.buffer.byteLength)&&(s=new Uint8Array(s)),{vectorTile:a,rawData:s.buffer}}async loadData(r){this._pendingRequest?.abort();let n=r&&r.request&&r.request.collectResourceTiming?new Rr(r.request):!1;this._pendingRequest=new AbortController;try{let i=await this.loadGeoJSON(r,this._pendingRequest);if(delete this._pendingRequest,typeof i!="object")throw new Error(`Input data given to \'${r.source}\' is not a valid GeoJSON object.`);if((0,xy.default)(i,!0),r.filter){let a=qt(r.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(a.result==="error")throw new Error(a.value.map(l=>`${l.key}: ${l.message}`).join(", "));i={type:"FeatureCollection",features:i.features.filter(l=>a.value.evaluate({zoom:0},l))}}this._geoJSONIndex=r.cluster?new vi(s0(r)).load(i.features):Ml(i,r.geojsonVtOptions),this.loaded={};let o={};if(n){let a=n.finish();a&&(o.resourceTiming={},o.resourceTiming[r.source]=JSON.parse(JSON.stringify(a)))}return o}catch(i){if(delete this._pendingRequest,tc(i))return{abandoned:!0};throw i}}reloadTile(r){let n=this.loaded,i=r.uid;return n&&n[i]?super.reloadTile(r):this.loadTile(r)}async loadGeoJSON(r,n){let{promoteId:i}=r;if(r.request){let o=await uc(r.request,n);return this._dataUpdateable=El(o.data,i)?Fl(o.data,i):void 0,o.data}if(typeof r.data=="string")try{let o=JSON.parse(r.data);return this._dataUpdateable=El(o,i)?Fl(o,i):void 0,o}catch{throw new Error(`Input data given to \'${r.source}\' is not a valid GeoJSON object.`)}if(!r.dataDiff)throw new Error(`Input data given to \'${r.source}\' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${r.source}`);return gy(this._dataUpdateable,r.dataDiff,i),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}}async removeSource(r){this._pendingRequest&&this._pendingRequest.abort()}getClusterExpansionZoom(r){return this._geoJSONIndex.getClusterExpansionZoom(r.clusterId)}getClusterChildren(r){return this._geoJSONIndex.getChildren(r.clusterId)}getClusterLeaves(r){return this._geoJSONIndex.getLeaves(r.clusterId,r.limit,r.offset)}};function s0({superclusterOptions:t,clusterProperties:e}){if(!e||!t)return t;let r={},n={},i={accumulated:null,zoom:0},o={properties:null},a=Object.keys(e);for(let s of a){let[l,u]=e[s],c=qt(u),p=qt(typeof l=="string"?[l,["accumulated"],["get",s]]:l);r[s]=c.value,n[s]=p.value}return t.map=s=>{o.properties=s;let l={};for(let u of a)l[u]=r[u].evaluate(i,o);return l},t.reduce=(s,l)=>{o.properties=l;for(let u of a)i.accumulated=s[u],s[u]=n[u].evaluate(i,o)},t}var Ma=class{constructor(e){this.self=e,this.actor=new to(e),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(r,n)=>{if(this.externalWorkerSourceTypes[r])throw new Error(`Worker source with name "${r}" already registered.`);this.externalWorkerSourceTypes[r]=n},this.self.addProtocol=nc,this.self.removeProtocol=ic,this.self.registerRTLTextPlugin=r=>{if(ye.isParsed())throw new Error("RTL text plugin already registered.");ye.setMethods(r)},this.actor.registerMessageHandler("LDT",(r,n)=>this._getDEMWorkerSource(r,n.source).loadTile(n)),this.actor.registerMessageHandler("RDT",async(r,n)=>{this._getDEMWorkerSource(r,n.source).removeTile(n)}),this.actor.registerMessageHandler("GCEZ",async(r,n)=>this._getWorkerSource(r,n.type,n.source).getClusterExpansionZoom(n)),this.actor.registerMessageHandler("GCC",async(r,n)=>this._getWorkerSource(r,n.type,n.source).getClusterChildren(n)),this.actor.registerMessageHandler("GCL",async(r,n)=>this._getWorkerSource(r,n.type,n.source).getClusterLeaves(n)),this.actor.registerMessageHandler("LD",(r,n)=>this._getWorkerSource(r,n.type,n.source).loadData(n)),this.actor.registerMessageHandler("LT",(r,n)=>this._getWorkerSource(r,n.type,n.source).loadTile(n)),this.actor.registerMessageHandler("RT",(r,n)=>this._getWorkerSource(r,n.type,n.source).reloadTile(n)),this.actor.registerMessageHandler("AT",(r,n)=>this._getWorkerSource(r,n.type,n.source).abortTile(n)),this.actor.registerMessageHandler("RMT",(r,n)=>this._getWorkerSource(r,n.type,n.source).removeTile(n)),this.actor.registerMessageHandler("RS",async(r,n)=>{if(!this.workerSources[r]||!this.workerSources[r][n.type]||!this.workerSources[r][n.type][n.source])return;let i=this.workerSources[r][n.type][n.source];delete this.workerSources[r][n.type][n.source],i.removeSource!==void 0&&i.removeSource(n)}),this.actor.registerMessageHandler("RM",async r=>{delete this.layerIndexes[r],delete this.availableImages[r],delete this.workerSources[r],delete this.demWorkerSources[r]}),this.actor.registerMessageHandler("SR",async(r,n)=>{this.referrer=n}),this.actor.registerMessageHandler("SRPS",(r,n)=>this._syncRTLPluginState(r,n)),this.actor.registerMessageHandler("IS",async(r,n)=>{this.self.importScripts(n)}),this.actor.registerMessageHandler("SI",(r,n)=>this._setImages(r,n)),this.actor.registerMessageHandler("UL",async(r,n)=>{this._getLayerIndex(r).update(n.layers,n.removedIds)}),this.actor.registerMessageHandler("SL",async(r,n)=>{this._getLayerIndex(r).replace(n)})}async _setImages(e,r){this.availableImages[e]=r;for(let n in this.workerSources[e]){let i=this.workerSources[e][n];for(let o in i)i[o].availableImages=r}}async _syncRTLPluginState(e,r){if(ye.isParsed())return ye.getState();if(r.pluginStatus!=="loading")return ye.setState(r),r;let n=r.pluginURL;if(this.self.importScripts(n),ye.isParsed()){let o={pluginStatus:"loaded",pluginURL:n};return ye.setState(o),o}throw ye.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${n}`)}_getAvailableImages(e){let r=this.availableImages[e];return r||(r=[]),r}_getLayerIndex(e){let r=this.layerIndexes[e];return r||(r=this.layerIndexes[e]=new ca),r}_getWorkerSource(e,r,n){if(this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][r]||(this.workerSources[e][r]={}),!this.workerSources[e][r][n]){let i={sendAsync:(o,a)=>(o.targetMapId=e,this.actor.sendAsync(o,a))};switch(r){case"vector":this.workerSources[e][r][n]=new Or(i,this._getLayerIndex(e),this._getAvailableImages(e));break;case"geojson":this.workerSources[e][r][n]=new ka(i,this._getLayerIndex(e),this._getAvailableImages(e));break;default:this.workerSources[e][r][n]=new this.externalWorkerSourceTypes[r](i,this._getLayerIndex(e),this._getAvailableImages(e));break}}return this.workerSources[e][r][n]}_getDEMWorkerSource(e,r){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][r]||(this.demWorkerSources[e][r]=new va),this.demWorkerSources[e][r]}};at(self)&&(self.worker=new Ma(self));})();\n/*! Bundled license information:\n\nieee754/index.js:\n (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)\n*/\n'});function Nde(){return new Worker(i$e())}var i$e,Bde=h(()=>{Og();Rde();i$e=()=>Cl.WORKER_URL?Cl.WORKER_URL:URL.createObjectURL(new Blob([Fde],{type:"text/javascript"}))});var zde,Cb,o$e,Oz=h(()=>{Bde();vo();Oe();zde="maplibre_preloaded_worker_pool",Cb=class t{constructor(){this.active={}}acquire(e){if(!this.workers)for(this.workers=[];this.workers.length<t.workerCount;)this.workers.push(Nde());return this.active[e]=!0,this.workers.slice()}release(e){delete this.active[e],this.numActive()===0&&(this.workers.forEach(r=>{r.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[zde]}numActive(){return Object.keys(this.active).length}},o$e=Math.floor(Sn.hardwareConcurrency/2);Cb.workerCount=bpe(globalThis)?Math.max(Math.min(o$e,3),1):1});function Fz(){return kz||(kz=new Cb),kz}var kz,KL=h(()=>{Oz()});function Rz(){return JL||(JL=new QL(Fz(),FA),JL.registerMessageHandler("GR",(t,e,r)=>W1(e,r))),JL}var QL,JL,eD=h(()=>{kde();KL();qc();Dh();QL=class{constructor(e,r){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=r;let n=this.workerPool.acquire(r);for(let i=0;i<n.length;i++){let o=n[i],s=new YL(o,r);s.name=`Worker ${i}`,this.actors.push(s)}if(!this.actors.length)throw new Error("No actors found")}broadcast(e,r){let n=[];for(let i of this.actors)n.push(i.sendAsync({type:e,data:r}));return Promise.all(n)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(e=!0){this.actors.forEach(r=>{r.remove()}),this.actors=[],e&&this.workerPool.release(this.id)}registerMessageHandler(e,r){for(let n of this.actors)n.registerMessageHandler(e,r)}}});var Vde=h(()=>{});async function tD(t,e,r){let n=t;if(t.url?n=(await EI(e.transformRequest(t.url,"Source"),r)).data:await Sn.frameAsync(r),!n)return null;let i=Lg(Ue(n,t),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in n&&n.vector_layers&&(i.vectorLayerIds=n.vector_layers.map(o=>o.id)),i}var Nz=h(()=>{Oe();qc();Nu();vo()});var rD,Wr,Ll=h(()=>{Oe();rD=63710088e-1,Wr=class t{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 t(AA(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let r=Math.PI/180,n=this.lat*r,i=e.lat*r,o=Math.sin(n)*Math.sin(i)+Math.cos(n)*Math.cos(i)*Math.cos((e.lng-this.lng)*r);return rD*Math.acos(Math.min(o,1))}static convert(e){if(e instanceof t)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new t(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new t(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}});var bf,tv=h(()=>{Ll();bf=class t{constructor(e,r){e&&(r?this.setSouthWest(e).setNorthEast(r):Array.isArray(e)&&(e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}setNorthEast(e){return this._ne=e instanceof Wr?new Wr(e.lng,e.lat):Wr.convert(e),this}setSouthWest(e){return this._sw=e instanceof Wr?new Wr(e.lng,e.lat):Wr.convert(e),this}extend(e){let r=this._sw,n=this._ne,i,o;if(e instanceof Wr)i=e,o=e;else if(e instanceof t){if(i=e._sw,o=e._ne,!i||!o)return this}else{if(Array.isArray(e))if(e.length===4||e.every(Array.isArray)){let s=e;return this.extend(t.convert(s))}else{let s=e;return this.extend(Wr.convert(s))}else if(e&&("lng"in e||"lon"in e)&&"lat"in e)return this.extend(Wr.convert(e));return this}return!r&&!n?(this._sw=new Wr(i.lng,i.lat),this._ne=new Wr(o.lng,o.lat)):(r.lng=Math.min(i.lng,r.lng),r.lat=Math.min(i.lat,r.lat),n.lng=Math.max(o.lng,n.lng),n.lat=Math.max(o.lat,n.lat)),this}getCenter(){return new Wr((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 Wr(this.getWest(),this.getNorth())}getSouthEast(){return new Wr(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){let{lng:r,lat:n}=Wr.convert(e),i=this._sw.lat<=n&&n<=this._ne.lat,o=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(o=this._sw.lng>=r&&r>=this._ne.lng),i&&o}static convert(e){return e instanceof t||!e?e:new t(e)}static fromLngLat(e,r=0){let i=360*r/40075017,o=i/Math.cos(Math.PI/180*e.lat);return new t(new Wr(e.lng-o,e.lat-i),new Wr(e.lng+o,e.lat+i))}}});function Gde(t){return Ude*Math.cos(t*Math.PI/180)}function G2(t){return(180+t)/360}function j2(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function jde(t,e){return t/Gde(e)}function s$e(t){return t*360-180}function Bz(t){let e=180-t*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function a$e(t,e){return t*Gde(Bz(e))}function l$e(t){return 1/Math.cos(t*Math.PI/180)}var Ude,Rs,_f=h(()=>{Ll();Ude=2*Math.PI*rD;Rs=class t{constructor(e,r,n=0){this.x=+e,this.y=+r,this.z=+n}static fromLngLat(e,r=0){let n=Wr.convert(e);return new t(G2(n.lng),j2(n.lat),jde(r,n.lat))}toLngLat(){return new Wr(s$e(this.x),Bz(this.y))}toAltitude(){return a$e(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Ude*l$e(Bz(this.y))}}});var Tb,zz=h(()=>{tv();_f();Tb=class{constructor(e,r,n){this.bounds=bf.convert(this.validateBounds(e)),this.minzoom=r||0,this.maxzoom=n||24}validateBounds(e){return!Array.isArray(e)||e.length!==4?[-180,-90,180,90]:[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]}contains(e){let r=Math.pow(2,e.z),n={minX:Math.floor(G2(this.bounds.getWest())*r),minY:Math.floor(j2(this.bounds.getNorth())*r),maxX:Math.ceil(G2(this.bounds.getEast())*r),maxY:Math.ceil(j2(this.bounds.getSouth())*r)};return e.x>=n.minX&&e.x<n.maxX&&e.y>=n.minY&&e.y<n.maxY}}});var $2,Vz=h(()=>{Qn();Oe();Nz();zz();Nu();Dh();$2=class extends Jn{constructor(e,r,n,i){if(super(),this.id=e,this.dispatcher=n,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,Ue(this,Lg(r,["url","scheme","tileSize","promoteId"])),this._options=Ue({type:"vector"},r),this._collectResourceTiming=r.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(i)}async load(){this._loaded=!1,this.fire(new nt("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let e=await tD(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),e&&(Ue(this,e),e.bounds&&(this.tileBounds=new Tb(e.bounds,this.minzoom,this.maxzoom)),this.fire(new nt("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new nt("data",{dataType:"source",sourceDataType:"content"})))}catch(e){this._tileJSONRequest=null,this.fire(new Ln(e))}}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}setSourceProperty(e){this._tileJSONRequest&&this._tileJSONRequest.abort(),e(),this.load()}setTiles(e){return this.setSourceProperty(()=>{this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return Ue({},this._options)}async loadTile(e){let r=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),n={request:this.map._requestManager.transformRequest(r,"Tile"),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};n.request.collectResourceTiming=this._collectResourceTiming;let i="RT";if(!e.actor||e.state==="expired")e.actor=this.dispatcher.getActor(),i="LT";else if(e.state==="loading")return new Promise((o,s)=>{e.reloadPromise={resolve:o,reject:s}});e.abortController=new AbortController;try{let o=await e.actor.sendAsync({type:i,data:n},e.abortController);if(delete e.abortController,e.aborted)return;this._afterTileLoadWorkerResponse(e,o)}catch(o){if(delete e.abortController,e.aborted)return;if(o&&o.status!==404)throw o;this._afterTileLoadWorkerResponse(e,null)}}_afterTileLoadWorkerResponse(e,r){if(r&&r.resourceTiming&&(e.resourceTiming=r.resourceTiming),r&&this.map._refreshExpiredTiles&&e.setExpiryData(r),e.loadVectorData(r,this.map.painter),e.reloadPromise){let n=e.reloadPromise;e.reloadPromise=null,this.loadTile(e).then(n.resolve).catch(n.reject)}}async abortTile(e){e.abortController&&(e.abortController.abort(),delete e.abortController),e.actor&&await e.actor.sendAsync({type:"AT",data:{uid:e.uid,type:this.type,source:this.id}})}async unloadTile(e){e.unloadVectorData(),e.actor&&await e.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}})}hasTransition(){return!1}}});var rv,nD=h(()=>{Oe();X1();Nu();Qn();Nz();zz();Al();rv=class extends Jn{constructor(e,r,n,i){super(),this.id=e,this.dispatcher=n,this.setEventedParent(i),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=Ue({type:"raster"},r),Ue(this,Lg(r,["url","scheme","tileSize"]))}async load(){this._loaded=!1,this.fire(new nt("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let e=await tD(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,e&&(Ue(this,e),e.bounds&&(this.tileBounds=new Tb(e.bounds,this.minzoom,this.maxzoom)),this.fire(new nt("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new nt("data",{dataType:"source",sourceDataType:"content"})))}catch(e){this._tileJSONRequest=null,this.fire(new Ln(e))}}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(e){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),e(),this.load()}setTiles(e){return this.setSourceProperty(()=>{this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}serialize(){return Ue({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}async loadTile(e){let r=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);e.abortController=new AbortController;try{let n=await Hc.getImage(this.map._requestManager.transformRequest(r,"Tile"),e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted){e.state="unloaded";return}if(n&&n.data){this.map._refreshExpiredTiles&&n.cacheControl&&n.expires&&e.setExpiryData({cacheControl:n.cacheControl,expires:n.expires});let i=this.map.painter.context,o=i.gl,s=n.data;e.texture=this.map.painter.getTileTexture(s.width),e.texture?e.texture.update(s,{useMipmap:!0}):(e.texture=new to(i,s,o.RGBA,{useMipmap:!0}),e.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),i.extTextureFilterAnisotropic&&o.texParameterf(o.TEXTURE_2D,i.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,i.extTextureFilterAnisotropicMax)),e.state="loaded"}}catch(n){if(delete e.abortController,e.aborted)e.state="unloaded";else if(n)throw e.state="errored",n}}async abortTile(e){e.abortController&&(e.abortController.abort(),delete e.abortController)}async unloadTile(e){e.texture&&this.map.painter.saveTileTexture(e.texture)}hasTransition(){return!1}}});function qde(t,e,r){e=Math.pow(2,r)-e-1;var n=$de(t*256,e*256,r),i=$de((t+1)*256,(e+1)*256,r);return n[0]+","+n[1]+","+i[0]+","+i[1]}function $de(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r),i=t*n-2*Math.PI*6378137/2,o=e*n-2*Math.PI*6378137/2;return[i,o]}var Hde=h(()=>{});function q2(t,e,r,n,i){t*=2,t<0&&(t=t*-1-1);let o=1<<r;return(o*o*t+o*i+n).toString(36)+r.toString(36)+e.toString(36)}function u$e(t,e,r){let n="",i;for(let o=t;o>0;o--)i=1<<o-1,n+=(e&i?1:0)+(r&i?2:0);return n}var Wde,Eb,iD,Ns,Mb=h(()=>{Hde();eo();Wde=_e(Br(),1);_f();Qi();Eb=class{constructor(e,r,n){if(e<0||e>25||n<0||n>=Math.pow(2,e)||r<0||r>=Math.pow(2,e))throw new Error(`x=${r}, y=${n}, 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=n,this.key=q2(0,e,e,r,n)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,r,n){let i=qde(this.x,this.y,this.z),o=u$e(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(n==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,r>1?"@2x":"").replace(/{quadkey}/g,o).replace(/{bbox-epsg-3857}/g,i)}isChildOf(e){let r=this.z-e.z;return r>0&&e.x===this.x>>r&&e.y===this.y>>r}getTilePoint(e){let r=Math.pow(2,this.z);return new Wde.default((e.x*r-this.x)*8192,(e.y*r-this.y)*8192)}toString(){return`${this.z}/${this.x}/${this.y}`}},iD=class{constructor(e,r){this.wrap=e,this.canonical=r,this.key=q2(e,r.z,r.z,r.x,r.y)}},Ns=class t{constructor(e,r,n,i,o){if(e<n)throw new Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${n}`);this.overscaledZ=e,this.wrap=r,this.canonical=new Eb(n,+i,+o),this.key=q2(r,e,n,i,o)}clone(){return new t(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}`);let r=this.canonical.z-e;return e>this.canonical.z?new t(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new t(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}`);let n=this.canonical.z-e;return e>this.canonical.z?q2(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):q2(this.wrap*+r,e,e,this.canonical.x>>n,this.canonical.y>>n)}isChildOf(e){if(e.wrap!==this.wrap)return!1;let r=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new t(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let r=this.canonical.z+1,n=this.canonical.x*2,i=this.canonical.y*2;return[new t(r,this.wrap,r,n,i),new t(r,this.wrap,r,n+1,i),new t(r,this.wrap,r,n,i+1),new t(r,this.wrap,r,n+1,i+1)]}isLessThan(e){return this.wrap<e.wrap?!0:this.wrap>e.wrap?!1:this.overscaledZ<e.overscaledZ?!0:this.overscaledZ>e.overscaledZ?!1:this.canonical.x<e.canonical.x?!0:this.canonical.x>e.canonical.x?!1:this.canonical.y<e.canonical.y}wrapped(){return new t(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new t(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new iD(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new Rs(e.x-this.wrap,e.y))}};oe("CanonicalTileID",Eb);oe("OverscaledTileID",Ns,{omit:["posMatrix"]})});var Uz,Zde=h(()=>{gf();Oe();Qi();Uz=class{constructor(e,r,n,i=1,o=1,s=1,a=0){if(this.uid=e,r.height!==r.width)throw new RangeError("DEM tiles must be square");if(n&&!["mapbox","terrarium","custom"].includes(n)){ks(`"${n}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);return}this.stride=r.height;let l=this.dim=r.height-2;switch(this.data=new Uint32Array(r.data.buffer),n){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=i,this.greenFactor=o,this.blueFactor=s,this.baseShift=a;break;case"mapbox":default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4;break}for(let u=0;u<l;u++)this.data[this._idx(-1,u)]=this.data[this._idx(0,u)],this.data[this._idx(l,u)]=this.data[this._idx(l-1,u)],this.data[this._idx(u,-1)]=this.data[this._idx(u,0)],this.data[this._idx(u,l)]=this.data[this._idx(u,l-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(l,-1)]=this.data[this._idx(l-1,0)],this.data[this._idx(-1,l)]=this.data[this._idx(0,l-1)],this.data[this._idx(l,l)]=this.data[this._idx(l-1,l-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let u=0;u<l;u++)for(let c=0;c<l;c++){let p=this.get(u,c);p>this.max&&(this.max=p),p<this.min&&(this.min=p)}}get(e,r){let n=new Uint8Array(this.data.buffer),i=this._idx(e,r)*4;return this.unpack(n[i],n[i+1],n[i+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,r){if(e<-1||e>=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(e+1)}unpack(e,r,n){return e*this.redFactor+r*this.greenFactor+n*this.blueFactor-this.baseShift}getPixels(){return new bo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,r,n){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let i=r*this.dim,o=r*this.dim+this.dim,s=n*this.dim,a=n*this.dim+this.dim;switch(r){case-1:i=o-1;break;case 1:o=i+1;break}switch(n){case-1:s=a-1;break;case 1:a=s+1;break}let l=-r*this.dim,u=-n*this.dim;for(let c=s;c<a;c++)for(let p=i;p<o;p++)this.data[this._idx(p,c)]=e.data[this._idx(p+l,c+u)]}};oe("DEMData",Uz)});var H2,Gz=h(()=>{X1();Nu();Oe();vo();t9();Mb();nD();Zde();n9();gf();Dh();H2=class extends rv{constructor(e,r,n,i){super(e,r,n,i),this.type="raster-dem",this.maxzoom=22,this._options=Ue({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox",this.redFactor=r.redFactor,this.greenFactor=r.greenFactor,this.blueFactor=r.blueFactor,this.baseShift=r.baseShift}async loadTile(e){let r=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),n=this.map._requestManager.transformRequest(r,"Tile");e.neighboringTiles=this._getNeighboringTiles(e.tileID),e.abortController=new AbortController;try{let i=await Hc.getImage(n,e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted){e.state="unloaded";return}if(i&&i.data){let o=i.data;this.map._refreshExpiredTiles&&i.cacheControl&&i.expires&&e.setExpiryData({cacheControl:i.cacheControl,expires:i.expires});let a=$c(o)&&TA()?o:await this.readImageNow(o),l={type:this.type,uid:e.uid,source:this.id,rawImageData:a,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!e.actor||e.state==="expired"){e.actor=this.dispatcher.getActor();let u=await e.actor.sendAsync({type:"LDT",data:l});e.dem=u,e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.state="loaded"}}}catch(i){if(delete e.abortController,e.aborted)e.state="unloaded";else if(i)throw e.state="errored",i}}async readImageNow(e){if(typeof VideoFrame<"u"&&r9()){let r=e.width+2,n=e.height+2;try{return new bo({width:r,height:n},await Spe(e,-1,-1,r,n))}catch{}}return Sn.getImageData(e,1)}_getNeighboringTiles(e){let r=e.canonical,n=Math.pow(2,r.z),i=(r.x-1+n)%n,o=r.x===0?e.wrap-1:e.wrap,s=(r.x+1+n)%n,a=r.x+1===n?e.wrap+1:e.wrap,l={};return l[new Ns(e.overscaledZ,o,r.z,i,r.y).key]={backfilled:!1},l[new Ns(e.overscaledZ,a,r.z,s,r.y).key]={backfilled:!1},r.y>0&&(l[new Ns(e.overscaledZ,o,r.z,i,r.y-1).key]={backfilled:!1},l[new Ns(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new Ns(e.overscaledZ,a,r.z,s,r.y-1).key]={backfilled:!1}),r.y+1<n&&(l[new Ns(e.overscaledZ,o,r.z,i,r.y+1).key]={backfilled:!1},l[new Ns(e.overscaledZ,e.wrap,r.z,r.x,r.y+1).key]={backfilled:!1},l[new Ns(e.overscaledZ,a,r.z,s,r.y+1).key]={backfilled:!1}),l}async unloadTile(e){e.demTexture&&this.map.painter.saveTileTexture(e.demTexture),e.fbo&&(e.fbo.destroy(),delete e.fbo),e.dem&&delete e.dem,delete e.neighboringTiles,e.state="unloaded",e.actor&&await e.actor.sendAsync({type:"RDT",data:{type:this.type,uid:e.uid,source:this.id}})}}});var W2,jz=h(()=>{Qn();Oe();eo();Nu();vo();Dh();W2=class extends Jn{constructor(e,r,n,i){super(),this.id=e,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=n.getActor(),this.setEventedParent(i),this._data=r.data,this._options=Ue({},r),this._collectResourceTiming=r.collectResourceTiming,r.maxzoom!==void 0&&(this.maxzoom=r.maxzoom),r.type&&(this.type=r.type),r.attribution&&(this.attribution=r.attribution),this.promoteId=r.promoteId;let o=8192/this.tileSize;this.workerOptions=Ue({source:this.id,cluster:r.cluster||!1,geojsonVtOptions:{buffer:(r.buffer!==void 0?r.buffer:128)*o,tolerance:(r.tolerance!==void 0?r.tolerance:.375)*o,extent:8192,maxZoom:this.maxzoom,lineMetrics:r.lineMetrics||!1,generateId:r.generateId||!1},superclusterOptions:{maxZoom:r.clusterMaxZoom!==void 0?r.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,r.clusterMinPoints||2),extent:8192,radius:(r.clusterRadius||50)*o,log:!1,generateId:r.generateId||!1},clusterProperties:r.clusterProperties,filter:r.filter},r.workerOptions),typeof this.promoteId=="string"&&(this.workerOptions.promoteId=this.promoteId)}async load(){await this._updateWorkerData()}onAdd(e){this.map=e,this.load()}setData(e){return this._data=e,this._updateWorkerData(),this}updateData(e){return this._updateWorkerData(e),this}setClusterOptions(e){return this.workerOptions.cluster=e.cluster,e&&(e.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=e.clusterRadius),e.clusterMaxZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=e.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(e){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:e,source:this.id}})}getClusterChildren(e){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:e,source:this.id}})}getClusterLeaves(e,r,n){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:e,limit:r,offset:n}})}async _updateWorkerData(e){let r=Ue({type:this.type},this.workerOptions);e?r.dataDiff=e:typeof this._data=="string"?(r.request=this.map._requestManager.transformRequest(Sn.resolveURL(this._data),"Source"),r.request.collectResourceTiming=this._collectResourceTiming):r.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new nt("dataloading",{dataType:"source"}));try{let n=await this.actor.sendAsync({type:"LD",data:r});if(this._pendingLoads--,this._removed||n.abandoned){this.fire(new nt("dataabort",{dataType:"source"}));return}let i=null;n.resourceTiming&&n.resourceTiming[this.id]&&(i=n.resourceTiming[this.id].slice(0));let o={dataType:"source"};this._collectResourceTiming&&i&&i.length>0&&Ue(o,{resourceTiming:i}),this.fire(new nt("data",{...o,sourceDataType:"metadata"})),this.fire(new nt("data",{...o,sourceDataType:"content"}))}catch(n){if(this._pendingLoads--,this._removed){this.fire(new nt("dataabort",{dataType:"source"}));return}this.fire(new Ln(n))}}loaded(){return this._pendingLoads===0}async loadTile(e){let r=e.actor?"RT":"LT";e.actor=this.actor;let n={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};e.abortController=new AbortController;let i=await this.actor.sendAsync({type:r,data:n},e.abortController);delete e.abortController,e.unloadVectorData(),e.aborted||e.loadVectorData(i,this.map.painter,r==="RT")}async abortTile(e){e.abortController&&(e.abortController.abort(),delete e.abortController),e.aborted=!0}async unloadTile(e){e.unloadVectorData(),await this.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return Ue({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}});var nv,Z2=h(()=>{Uu();nv=Hr([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}])});function c$e(t){let e=1/0,r=1/0,n=-1/0,i=-1/0;for(let c of t)e=Math.min(e,c.x),r=Math.min(r,c.y),n=Math.max(n,c.x),i=Math.max(i,c.y);let o=n-e,s=i-r,a=Math.max(o,s),l=Math.max(0,Math.floor(-Math.log(a)/Math.LN2)),u=Math.pow(2,l);return new Eb(l,Math.floor((e+n)/2*u),Math.floor((r+i)/2*u))}var wf,Ab=h(()=>{Mb();Qn();X1();Nu();eo();Wa();Z2();Za();Al();_f();wf=class extends Jn{constructor(e,r,n,i){super(),this.id=e,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}async load(e){this._loaded=!1,this.fire(new nt("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{let r=await Hc.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,r&&r.data&&(this.image=r.data,e&&(this.coordinates=e),this._finishLoading())}catch(r){this._request=null,this._loaded=!0,this.fire(new Ln(r))}}loaded(){return this._loaded}updateImage(e){return e.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=e.url,this.load(e.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new nt("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(e){this.coordinates=e;let r=e.map(Rs.fromLngLat);this.tileID=c$e(r),this.minzoom=this.maxzoom=this.tileID.z;let n=r.map(i=>this.tileID.getTilePoint(i)._round());return this._boundsArray=new C2,this._boundsArray.emplaceBack(n[0].x,n[0].y,0,0),this._boundsArray.emplaceBack(n[1].x,n[1].y,8192,0),this._boundsArray.emplaceBack(n[3].x,n[3].y,0,8192),this._boundsArray.emplaceBack(n[2].x,n[2].y,8192,8192),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new nt("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let e=this.map.painter.context,r=e.gl;this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,nv.members)),this.boundsSegments||(this.boundsSegments=mn.simpleSegment(0,0,4,2)),this.texture||(this.texture=new to(e,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let n=!1;for(let i in this.tiles){let o=this.tiles[i];o.state!=="loaded"&&(o.state="loaded",o.texture=this.texture,n=!0)}n&&this.fire(new nt("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}async loadTile(e){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={}):e.state="errored"}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}});var X2,$z=h(()=>{qc();Nu();Ab();Z2();Za();Al();Qn();ua();X2=class extends wf{constructor(e,r,n,i){super(e,r,n,i),this.roundZoom=!0,this.type="video",this.options=r}async load(){this._loaded=!1;let e=this.options;this.urls=[];for(let r of e.urls)this.urls.push(this.map._requestManager.transformRequest(r,"Source").url);try{let r=await Tpe(this.urls);if(this._loaded=!0,!r)return;this.video=r,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(r){this.fire(new Ln(r))}}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(e){if(this.video){let r=this.video.seekable;e<r.start(0)||e>r.end(0)?this.fire(new Ln(new te(`sources.${this.id}`,null,`Playback for this video can be set only between the ${r.start(0)} and ${r.end(0)}-second mark.`))):this.video.currentTime=e}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let e=this.map.painter.context,r=e.gl;this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,nv.members)),this.boundsSegments||(this.boundsSegments=mn.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new to(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let n=!1;for(let i in this.tiles){let o=this.tiles[i];o.state!=="loaded"&&(o.state="loaded",o.texture=this.texture,n=!0)}n&&this.fire(new nt("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}}});var Y2,qz=h(()=>{Ab();Z2();Za();Al();Qn();ua();Y2=class extends wf{constructor(e,r,n,i){super(e,r,n,i),r.coordinates?(!Array.isArray(r.coordinates)||r.coordinates.length!==4||r.coordinates.some(o=>!Array.isArray(o)||o.length!==2||o.some(s=>typeof s!="number")))&&this.fire(new Ln(new te(`sources.${e}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new Ln(new te(`sources.${e}`,null,'missing required property "coordinates"'))),r.animate&&typeof r.animate!="boolean"&&this.fire(new Ln(new te(`sources.${e}`,null,'optional "animate" property must be a boolean value'))),r.canvas?typeof r.canvas!="string"&&!(r.canvas instanceof HTMLCanvasElement)&&this.fire(new Ln(new te(`sources.${e}`,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 Ln(new te(`sources.${e}`,null,'missing required property "canvas"'))),this.options=r,this.animate=r.animate!==void 0?r.animate:!0}async load(){if(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 Ln(new Error("Canvas dimensions cannot be less than or equal to zero.")));return}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(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let r=this.map.painter.context,n=r.gl;this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,nv.members)),this.boundsSegments||(this.boundsSegments=mn.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new to(r,this.canvas,n.RGBA,{premultiply:!0});let i=!1;for(let o in this.tiles){let s=this.tiles[o];s.state!=="loaded"&&(s.state="loaded",s.texture=this.texture,i=!0)}i&&this.fire(new nt("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}}});var p$e,Xde,f$e,Hz=h(()=>{Vz();nD();Gz();jz();$z();Ab();qz();p$e={},Xde=(t,e,r,n)=>{let i=f$e(e.type),o=new i(t,e,r,n);if(o.id!==t)throw new Error(`Expected Source id to be ${t} instead of ${o.id}`);return o},f$e=t=>{switch(t){case"geojson":return W2;case"image":return wf;case"raster":return rv;case"raster-dem":return H2;case"vector":return $2;case"video":return X2;case"canvas":return Y2}return p$e[t]}});function Yde(t,e){let r={};if(!e)return r;for(let n of t){let i=n.layerIds.map(o=>e.getLayer(o)).filter(Boolean);if(i.length!==0){n.layers=i,n.stateDependentLayerIds&&(n.stateDependentLayers=n.stateDependentLayerIds.map(o=>i.filter(s=>s.id===o)[0]));for(let o of i)r[o.id]=n}}return r}var Kde=h(()=>{});var oD,Jde=h(()=>{oD=class{constructor(e){this._stringToNumber={},this._numberToString=[];for(let r=0;r<e.length;r++){let n=e[r];this._stringToNumber[n]=r,this._numberToString[r]=n}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}});var Lb,Wz=h(()=>{Lb=class{constructor(e,r,n,i,o){this.type="Feature",this._vectorTileFeature=e,e._z=r,e._x=n,e._y=i,this.properties=e.properties,this.id=o}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(){let e={geometry:this.geometry};for(let r in this)r==="_geometry"||r==="_vectorTileFeature"||(e[r]=this[r]);return e}}});function Qde(t,e,r,n,i){return s9(t,(o,s)=>{let a=e instanceof JI?e.get(s):null;return a&&a.evaluate?a.evaluate(r,n,i):a})}function eme(t){let e=1/0,r=1/0,n=-1/0,i=-1/0;for(let o of t)e=Math.min(e,o.x),r=Math.min(r,o.y),n=Math.max(n,o.x),i=Math.max(i,o.y);return{minX:e,minY:r,maxX:n,maxY:i}}function h$e(t,e){return e-t}var tme,rme,Zz,nme=h(()=>{wm();Sm();eo();ua();K9();Jde();tme=_e(k2(),1),rme=_e(Iz(),1);Wz();Oe();Qi();qa();Im();Fs();Wa();Zz=class{constructor(e,r){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new $g(8192,16,0),this.grid3D=new $g(8192,16,0),this.featureIndexArray=new I2,this.promoteId=r}insert(e,r,n,i,o,s){let a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(n,i,o);let l=s?this.grid3D:this.grid;for(let u=0;u<r.length;u++){let c=r[u],p=[1/0,1/0,-1/0,-1/0];for(let f=0;f<c.length;f++){let d=c[f];p[0]=Math.min(p[0],d.x),p[1]=Math.min(p[1],d.y),p[2]=Math.max(p[2],d.x),p[3]=Math.max(p[3],d.y)}p[0]<8192&&p[1]<8192&&p[2]>=0&&p[3]>=0&&l.insert(a,p[0],p[1],p[2],p[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new tme.default.VectorTile(new rme.default(this.rawTileData)).layers,this.sourceLayerCoder=new oD(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,r,n,i){this.loadVTLayers();let o=e.params||{},s=8192/e.tileSize/e.scale,a=XI(o.filter),l=e.queryGeometry,u=e.queryPadding*s,c=eme(l),p=this.grid.query(c.minX-u,c.minY-u,c.maxX+u,c.maxY+u),f=eme(e.cameraQueryGeometry),d=this.grid3D.query(f.minX-u,f.minY-u,f.maxX+u,f.maxY+u,(g,b,w,S)=>Qfe(e.cameraQueryGeometry,g-u,b-u,w+u,S+u));for(let g of d)p.push(g);p.sort(h$e);let m={},y;for(let g=0;g<p.length;g++){let b=p[g];if(b===y)continue;y=b;let w=this.featureIndexArray.get(b),S=null;this.loadMatchingFeature(m,w.bucketIndex,w.sourceLayerIndex,w.featureIndex,a,o.layers,o.availableImages,r,n,i,(I,P,T)=>(S||(S=Ya(I)),P.queryIntersectsFeature(l,I,T,S,this.z,e.transform,s,e.pixelPosMatrix)))}return m}loadMatchingFeature(e,r,n,i,o,s,a,l,u,c,p){let f=this.bucketLayerIDs[r];if(s&&!gpe(s,f))return;let d=this.sourceLayerCoder.decode(n),y=this.vtLayers[d].feature(i);if(o.needGeometry){let b=Ka(y,!0);if(!o.filter(new qr(this.tileID.overscaledZ),b,this.tileID.canonical))return}else if(!o.filter(new qr(this.tileID.overscaledZ),y))return;let g=this.getId(y,d);for(let b=0;b<f.length;b++){let w=f[b];if(s&&s.indexOf(w)<0)continue;let S=l[w];if(!S)continue;let I={};g&&c&&(I=c.getState(S.sourceLayer||"_geojsonTileLayer",g));let P=Ue({},u[w]);P.paint=Qde(P.paint,S.paint,y,I,a),P.layout=Qde(P.layout,S.layout,y,I,a);let T=!p||p(y,S,I);if(!T)continue;let M=new Lb(y,this.z,this.x,this.y,g);M.layer=P;let E=e[w];E===void 0&&(E=e[w]=[]),E.push({featureIndex:i,feature:M,intersectionZ:T})}}lookupSymbolFeatures(e,r,n,i,o,s,a,l){let u={};this.loadVTLayers();let c=XI(o);for(let p of e)this.loadMatchingFeature(u,n,i,p,c,s,a,l,r);return u}hasLayer(e){for(let r of this.bucketLayerIDs)for(let n of r)if(e===n)return!0;return!1}getId(e,r){let n=e.id;if(this.promoteId){let i=typeof this.promoteId=="string"?this.promoteId:this.promoteId[r];n=e.properties[i],typeof n=="boolean"&&(n=Number(n))}return n}};oe("FeatureIndex",Zz,{omit:["rawTileData","sourceLayerCoder"]})});var Xz,Yz=h(()=>{Xz="RTLPluginLoaded"});function sD(){return Kz||(Kz=new Jz),Kz}var Jz,Kz,aD=h(()=>{vo();Qn();Yz();eD();Dh();Jz=class extends Jn{constructor(){super(...arguments);this.status="unavailable";this.url=null;this.dispatcher=Rz()}_syncState(r){return this.status=r,this.dispatcher.broadcast("SRPS",{pluginStatus:r,pluginURL:this.url}).catch(n=>{throw this.status="error",n})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}async setRTLTextPlugin(r,n=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=Sn.resolveURL(r),!this.url)throw new Error(`requested url ${r} is invalid`);if(this.status==="unavailable")if(n)this.status="deferred",this._syncState(this.status);else return this._requestImport();else if(this.status==="requested")return this._requestImport()}async _requestImport(){await this._syncState("loading"),this.status="loaded",this.fire(new nt(Xz))}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}},Kz=null});var d$e,K2,Qz=h(()=>{Oe();Kde();nme();Wz();ua();Ib();Wa();Al();vo();Sm();qa();aD();d$e=3e4,K2=class{constructor(e,r){this.timeAdded=0;this.fadeEndTime=0;this.tileID=e,this.uid=o9(),this.uses=0,this.tileSize=r,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(e){let r=e+this.timeAdded;r<this.fadeEndTime||(this.fadeEndTime=r)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(e){this.demTexture&&e.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(e,r,n){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",!e){this.collisionBoxArray=new v2;return}e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=Yde(e.buckets,r.style),this.hasSymbolBuckets=!1;for(let i in this.buckets){let o=this.buckets[i];if(o instanceof vf)if(this.hasSymbolBuckets=!0,n)o.justReloaded=!0;else break}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let i in this.buckets){let o=this.buckets[i];if(o instanceof vf&&o.hasRTLText){this.hasRTLText=!0,sD().lazyLoad();break}}this.queryPadding=0;for(let i in this.buckets){let o=this.buckets[i];this.queryPadding=Math.max(this.queryPadding,r.style.getLayer(i).queryRadius(o))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)}unloadVectorData(){for(let e in this.buckets)this.buckets[e].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(e){return this.buckets[e.id]}upload(e){for(let n in this.buckets){let i=this.buckets[n];i.uploadPending()&&i.upload(e)}let r=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new to(e,this.imageAtlas.image,r.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new to(e,this.glyphAtlasImage,r.ALPHA),this.glyphAtlasImage=null)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,r,n,i,o,s,a,l,u,c){return!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData?{}:this.latestFeatureIndex.query({queryGeometry:i,cameraQueryGeometry:o,scale:s,tileSize:this.tileSize,pixelPosMatrix:c,transform:l,params:a,queryPadding:this.queryPadding*u},e,r,n)}querySourceFeatures(e,r){let n=this.latestFeatureIndex;if(!n||!n.rawTileData)return;let i=n.loadVTLayers(),o=r&&r.sourceLayer?r.sourceLayer:"",s=i._geojsonTileLayer||i[o];if(!s)return;let a=XI(r&&r.filter),{z:l,x:u,y:c}=this.tileID.canonical,p={z:l,x:u,y:c};for(let f=0;f<s.length;f++){let d=s.feature(f);if(a.needGeometry){let g=Ka(d,!0);if(!a.filter(new qr(this.tileID.overscaledZ),g,this.tileID.canonical))continue}else if(!a.filter(new qr(this.tileID.overscaledZ),d))continue;let m=n.getId(d,o),y=new Lb(d,l,u,c,m);y.tile=p,e.push(y)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){let r=this.expirationTime;if(e.cacheControl){let n=xpe(e.cacheControl);n["max-age"]&&(this.expirationTime=Date.now()+n["max-age"]*1e3)}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){let n=Date.now(),i=!1;if(this.expirationTime>n)i=!1;else if(!r)i=!0;else if(this.expirationTime<r)i=!0;else{let o=this.expirationTime-r;o?this.expirationTime=n+Math.max(o,d$e):i=!0}i?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)}setFeatureState(e,r){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(e).length===0)return;let n=this.latestFeatureIndex.loadVTLayers();for(let i in this.buckets){if(!r.style.hasLayer(i))continue;let o=this.buckets[i],s=o.layers[0].sourceLayer||"_geojsonTileLayer",a=n[s],l=e[s];if(!a||!l||Object.keys(l).length===0)continue;o.update(l,a,this.imageAtlas&&this.imageAtlas.patternPositions||{});let u=r&&r.style&&r.style.getLayer(i);u&&(this.queryPadding=Math.max(this.queryPadding,u.queryRadius(o)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<Sn.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(e){this.symbolFadeHoldUntil=Sn.now()+e}setDependencies(e,r){let n={};for(let i of r)n[i]=!0;this.dependencies[e]=n}hasDependency(e,r){for(let n of e){let i=this.dependencies[n];if(i){for(let o of r)if(i[o])return!0}}return!1}}});var lD,ime=h(()=>{lD=class{constructor(e,r){this.max=e,this.onRemove=r,this.reset()}reset(){for(let e in this.data)for(let r of this.data[e])r.timeout&&clearTimeout(r.timeout),this.onRemove(r.value);return this.data={},this.order=[],this}add(e,r,n){let i=e.wrapped().key;this.data[i]===void 0&&(this.data[i]=[]);let o={value:r,timeout:void 0};if(n!==void 0&&(o.timeout=setTimeout(()=>{this.remove(e,o)},n)),this.data[i].push(o),this.order.push(i),this.order.length>this.max){let s=this._getAndRemoveByKey(this.order[0]);s&&this.onRemove(s)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){let r=this.data[e].shift();return r.timeout&&clearTimeout(r.timeout),this.data[e].length===0&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),r.value}getByKey(e){let r=this.data[e];return r?r[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,r){if(!this.has(e))return this;let n=e.wrapped().key,i=r===void 0?0:this.data[n].indexOf(r),o=this.data[n][i];return this.data[n].splice(i,1),o.timeout&&clearTimeout(o.timeout),this.data[n].length===0&&delete this.data[n],this.onRemove(o.value),this.order.splice(this.order.indexOf(n),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){let r=this._getAndRemoveByKey(this.order[0]);r&&this.onRemove(r)}return this}filter(e){let r=[];for(let n in this.data)for(let i of this.data[n])e(i.value)||r.push(i);for(let n of r)this.remove(n.value.tileID,n)}}});var uD,ome=h(()=>{Oe();uD=class{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,r,n){let i=String(r);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][i]=this.stateChanges[e][i]||{},Ue(this.stateChanges[e][i],n),this.deletedStates[e]===null){this.deletedStates[e]={};for(let o in this.state[e])o!==i&&(this.deletedStates[e][o]=null)}else if(this.deletedStates[e]&&this.deletedStates[e][i]===null){this.deletedStates[e][i]={};for(let s in this.state[e][i])n[s]||(this.deletedStates[e][i][s]=null)}else for(let s in n)this.deletedStates[e]&&this.deletedStates[e][i]&&this.deletedStates[e][i][s]===null&&delete this.deletedStates[e][i][s]}removeFeatureState(e,r,n){if(this.deletedStates[e]===null)return;let o=String(r);if(this.deletedStates[e]=this.deletedStates[e]||{},n&&r!==void 0)this.deletedStates[e][o]!==null&&(this.deletedStates[e][o]=this.deletedStates[e][o]||{},this.deletedStates[e][o][n]=null);else if(r!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][o]){this.deletedStates[e][o]={};for(n in this.stateChanges[e][o])this.deletedStates[e][o][n]=null}else this.deletedStates[e][o]=null;else this.deletedStates[e]=null}getState(e,r){let n=String(r),i=this.state[e]||{},o=this.stateChanges[e]||{},s=Ue({},i[n],o[n]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){let a=this.deletedStates[e][r];if(a===null)return{};for(let l in a)delete s[l]}return s}initializeTileState(e,r){e.setFeatureState(this.state,r)}coalesceChanges(e,r){let n={};for(let i in this.stateChanges){this.state[i]=this.state[i]||{};let o={};for(let s in this.stateChanges[i])this.state[i][s]||(this.state[i][s]={}),Ue(this.state[i][s],this.stateChanges[i][s]),o[s]=this.state[i][s];n[i]=o}for(let i in this.deletedStates){this.state[i]=this.state[i]||{};let o={};if(this.deletedStates[i]===null)for(let s in this.state[i])o[s]={},this.state[i][s]={};else for(let s in this.deletedStates[i]){if(this.deletedStates[i][s]===null)this.state[i][s]={};else for(let l of Object.keys(this.deletedStates[i][s]))delete this.state[i][s][l];o[s]=this.state[i][s]}n[i]=n[i]||{},Ue(n[i],o)}if(this.stateChanges={},this.deletedStates={},Object.keys(n).length!==0)for(let i in e)e[i].setFeatureState(n,r)}}});function sme(t,e){let r=Math.abs(t.wrap*2)-+(t.wrap<0),n=Math.abs(e.wrap*2)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function ame(t){return t==="raster"||t==="image"||t==="video"}var eV,Db,tV=h(()=>{Hz();Qz();Qn();ime();_f();Oe();eo();eV=_e(Br(),1);vo();Mb();ome();Og();Db=class t extends Jn{constructor(e,r,n){super(),this.id=e,this.dispatcher=n,this.on("data",i=>this._dataHandler(i)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=Xde(e,r,n,this),this._tiles={},this._cache=new lD(0,i=>this._unloadTile(i)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new uD,this._didEmitContent=!1,this._updated=!1}onAdd(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._maxTileCacheZoomLevels=e?e._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(e)}onRemove(e){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(e)}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(let e in this._tiles){let r=this._tiles[e];if(r.state!=="loaded"&&r.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;let e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}async _loadTile(e,r,n){try{await this._source.loadTile(e),this._tileLoaded(e,r,n)}catch(i){e.state="errored",i.status!==404?this._source.fire(new Ln(i,{tile:e})):this.update(this.transform,this.terrain)}}_unloadTile(e){this._source.unloadTile&&this._source.unloadTile(e)}_abortTile(e){this._source.abortTile&&this._source.abortTile(e),this._source.fire(new nt("dataabort",{tile:e,coord:e.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(let r in this._tiles){let n=this._tiles[r];n.upload(e),n.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(e=>e.tileID).sort(sme).map(e=>e.key)}getRenderableIds(e){let r=[];for(let n in this._tiles)this._isIdRenderable(n,e)&&r.push(this._tiles[n]);return e?r.sort((n,i)=>{let o=n.tileID,s=i.tileID,a=new eV.default(o.canonical.x,o.canonical.y)._rotate(this.transform.angle),l=new eV.default(s.canonical.x,s.canonical.y)._rotate(this.transform.angle);return o.overscaledZ-s.overscaledZ||l.y-a.y||l.x-a.x}).map(n=>n.tileID.key):r.map(n=>n.tileID).sort(sme).map(n=>n.key)}hasRenderableParent(e){let r=this.findLoadedParent(e,0);return r?this._isIdRenderable(r.tileID.key):!1}_isIdRenderable(e,r){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(r||!this._tiles[e].holdingForFade())}reload(){if(this._paused){this._shouldReloadOnResume=!0;return}this._cache.reset();for(let e in this._tiles)this._tiles[e].state!=="errored"&&this._reloadTile(e,"reloading")}async _reloadTile(e,r){let n=this._tiles[e];n&&(n.state!=="loading"&&(n.state=r),await this._loadTile(n,e,r))}_tileLoaded(e,r,n){e.timeAdded=Sn.now(),n==="expired"&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(r,e),this.getSource().type==="raster-dem"&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),e.aborted||this._source.fire(new nt("data",{dataType:"source",tile:e,coord:e.tileID}))}_backfillDEM(e){let r=this.getRenderableIds();for(let i=0;i<r.length;i++){let o=r[i];if(e.neighboringTiles&&e.neighboringTiles[o]){let s=this.getTileByID(o);n(e,s),n(s,e)}}function n(i,o){i.needsHillshadePrepare=!0,i.needsTerrainPrepare=!0;let s=o.tileID.canonical.x-i.tileID.canonical.x,a=o.tileID.canonical.y-i.tileID.canonical.y,l=Math.pow(2,i.tileID.canonical.z),u=o.tileID.key;s===0&&a===0||Math.abs(a)>1||(Math.abs(s)>1&&(Math.abs(s+l)===1?s+=l:Math.abs(s-l)===1&&(s-=l)),!(!o.dem||!i.dem)&&(i.dem.backfillBorder(o.dem,s,a),i.neighboringTiles&&i.neighboringTiles[u]&&(i.neighboringTiles[u].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,r,n,i){for(let o in this._tiles){let s=this._tiles[o];if(i[o]||!s.hasData()||s.tileID.overscaledZ<=r||s.tileID.overscaledZ>n)continue;let a=s.tileID;for(;s&&s.tileID.overscaledZ>r+1;){let u=s.tileID.scaledTo(s.tileID.overscaledZ-1);s=this._tiles[u.key],s&&s.hasData()&&(a=u)}let l=a;for(;l.overscaledZ>r;)if(l=l.scaledTo(l.overscaledZ-1),e[l.key]){i[a.key]=a;break}}}findLoadedParent(e,r){if(e.key in this._loadedParentTiles){let n=this._loadedParentTiles[e.key];return n&&n.tileID.overscaledZ>=r?n:null}for(let n=e.overscaledZ-1;n>=r;n--){let i=e.scaledTo(n),o=this._getLoadedTile(i);if(o)return o}}_getLoadedTile(e){let r=this._tiles[e.key];return r&&r.hasData()?r:this._cache.getByKey(e.wrapped().key)}updateCacheSize(e){let r=Math.ceil(e.width/this._source.tileSize)+1,n=Math.ceil(e.height/this._source.tileSize)+1,i=r*n,o=this._maxTileCacheZoomLevels===null?Cl.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels,s=Math.floor(i*o),a=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,s):s;this._cache.setMaxSize(a)}handleWrapJump(e){let r=this._prevLng===void 0?e:this._prevLng,i=(e-r)/360,o=Math.round(i);if(this._prevLng=e,o){let s={};for(let a in this._tiles){let l=this._tiles[a];l.tileID=l.tileID.unwrapTo(l.tileID.wrap+o),s[l.tileID.key]=l}this._tiles=s;for(let a in this._timers)clearTimeout(this._timers[a]),delete this._timers[a];for(let a in this._tiles){let l=this._tiles[a];this._setTileReloadTimer(a,l)}}}update(e,r){if(!this._sourceLoaded||this._paused)return;this.transform=e,this.terrain=r,this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={};let n;!this.used&&!this.usedForTerrain?n=[]:this._source.tileID?n=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(c=>new Ns(c.canonical.z,c.wrap,c.canonical.z,c.canonical.x,c.canonical.y)):(n=e.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this.usedForTerrain?!1:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:r}),this._source.hasTile&&(n=n.filter(c=>this._source.hasTile(c))));let i=e.coveringZoomLevel(this._source),o=Math.max(i-t.maxOverzooming,this._source.minzoom),s=Math.max(i+t.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){let c={};for(let p of n)if(p.canonical.z>this._source.minzoom){let f=p.scaledTo(p.canonical.z-1);c[f.key]=f;let d=p.scaledTo(Math.max(this._source.minzoom,Math.min(p.canonical.z,5)));c[d.key]=d}n=n.concat(Object.values(c))}let a=n.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,a&&this.fire(new nt("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));let l=this._updateRetainedTiles(n,i);if(ame(this._source.type)){let c={},p={},f=Object.keys(l),d=Sn.now();for(let m of f){let y=l[m],g=this._tiles[m];if(!g||g.fadeEndTime!==0&&g.fadeEndTime<=d)continue;let b=this.findLoadedParent(y,o);b&&(this._addTile(b.tileID),c[b.tileID.key]=b.tileID),p[m]=y}this._retainLoadedChildren(p,i,s,l);for(let m in c)l[m]||(this._coveredTiles[m]=!0,l[m]=c[m]);if(r){let m={},y={};for(let g of n)this._tiles[g.key].hasData()?m[g.key]=g:y[g.key]=g;for(let g in y){let b=y[g].children(this._source.maxzoom);this._tiles[b[0].key]&&this._tiles[b[1].key]&&this._tiles[b[2].key]&&this._tiles[b[3].key]&&(m[b[0].key]=l[b[0].key]=b[0],m[b[1].key]=l[b[1].key]=b[1],m[b[2].key]=l[b[2].key]=b[2],m[b[3].key]=l[b[3].key]=b[3],delete y[g])}for(let g in y){let b=this.findLoadedParent(y[g],this._source.minzoom);if(b){m[b.tileID.key]=l[b.tileID.key]=b.tileID;for(let w in m)m[w].isChildOf(b.tileID)&&delete m[w]}}for(let g in this._tiles)m[g]||(this._coveredTiles[g]=!0)}}for(let c in l)this._tiles[c].clearFadeHold();let u=ype(this._tiles,l);for(let c of u){let p=this._tiles[c];p.hasSymbolBuckets&&!p.holdingForFade()?p.setHoldDuration(this.map._fadeDuration):(!p.hasSymbolBuckets||p.symbolFadeFinished())&&this._removeTile(c)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(let e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(e)}_updateRetainedTiles(e,r){let n={},i={},o=Math.max(r-t.maxOverzooming,this._source.minzoom),s=Math.max(r+t.maxUnderzooming,this._source.minzoom),a={};for(let l of e){let u=this._addTile(l);n[l.key]=l,!u.hasData()&&r<this._source.maxzoom&&(a[l.key]=l)}this._retainLoadedChildren(a,r,s,n);for(let l of e){let u=this._tiles[l.key];if(u.hasData())continue;if(r+1>this._source.maxzoom){let p=l.children(this._source.maxzoom)[0],f=this.getTile(p);if(f&&f.hasData()){n[p.key]=p;continue}}else{let p=l.children(this._source.maxzoom);if(n[p[0].key]&&n[p[1].key]&&n[p[2].key]&&n[p[3].key])continue}let c=u.wasRequested();for(let p=l.overscaledZ-1;p>=o;--p){let f=l.scaledTo(p);if(i[f.key])break;if(i[f.key]=!0,u=this.getTile(f),!u&&c&&(u=this._addTile(f)),u){let d=u.hasData();if((c||d)&&(n[f.key]=f),c=u.wasRequested(),d)break}}}return n}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(let e in this._tiles){let r=[],n,i=this._tiles[e].tileID;for(;i.overscaledZ>0;){if(i.key in this._loadedParentTiles){n=this._loadedParentTiles[i.key];break}r.push(i.key);let o=i.scaledTo(i.overscaledZ-1);if(n=this._getLoadedTile(o),n)break;i=o}for(let o of r)this._loadedParentTiles[o]=n}}_addTile(e){let r=this._tiles[e.key];if(r)return r;r=this._cache.getAndRemove(e),r&&(this._setTileReloadTimer(e.key,r),r.tileID=e,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,r)));let n=r;return r||(r=new K2(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(r,e.key,r.state)),r.uses++,this._tiles[e.key]=r,n||this._source.fire(new nt("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r}_setTileReloadTimer(e,r){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);let n=r.getExpiryTimeout();n&&(this._timers[e]=setTimeout(()=>{this._reloadTile(e,"expired"),delete this._timers[e]},n))}_removeTile(e){let r=this._tiles[e];r&&(r.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),!(r.uses>0)&&(r.hasData()&&r.state!=="reloading"?this._cache.add(r.tileID,r,r.getExpiryTimeout()):(r.aborted=!0,this._abortTile(r),this._unloadTile(r))))}_dataHandler(e){let r=e.sourceDataType;e.dataType==="source"&&r==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&e.dataType==="source"&&r==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let e in this._tiles)this._removeTile(e);this._cache.reset()}tilesIn(e,r,n){let i=[],o=this.transform;if(!o)return i;let s=n?o.getCameraQueryGeometry(e):e,a=e.map(m=>o.pointCoordinate(m,this.terrain)),l=s.map(m=>o.pointCoordinate(m,this.terrain)),u=this.getIds(),c=1/0,p=1/0,f=-1/0,d=-1/0;for(let m of l)c=Math.min(c,m.x),p=Math.min(p,m.y),f=Math.max(f,m.x),d=Math.max(d,m.y);for(let m=0;m<u.length;m++){let y=this._tiles[u[m]];if(y.holdingForFade())continue;let g=y.tileID,b=Math.pow(2,o.zoom-y.tileID.overscaledZ),w=r*y.queryPadding*8192/y.tileSize/b,S=[g.getTilePoint(new Rs(c,p)),g.getTilePoint(new Rs(f,d))];if(S[0].x-w<8192&&S[0].y-w<8192&&S[1].x+w>=0&&S[1].y+w>=0){let I=a.map(T=>g.getTilePoint(T)),P=l.map(T=>g.getTilePoint(T));i.push({tile:y,tileID:g,queryGeometry:I,cameraQueryGeometry:P,scale:b})}}return i}getVisibleCoordinates(e){let r=this.getRenderableIds(e).map(n=>this._tiles[n].tileID);for(let n of r)n.posMatrix=this.transform.calculatePosMatrix(n.toUnwrapped());return r}hasTransition(){if(this._source.hasTransition())return!0;if(ame(this._source.type)){let e=Sn.now();for(let r in this._tiles)if(this._tiles[r].fadeEndTime>=e)return!0}return!1}setFeatureState(e,r,n){e=e||"_geojsonTileLayer",this._state.updateState(e,r,n)}removeFeatureState(e,r,n){e=e||"_geojsonTileLayer",this._state.removeFeatureState(e,r,n)}getFeatureState(e,r){return e=e||"_geojsonTileLayer",this._state.getState(e,r)}setDependencies(e,r,n){let i=this._tiles[e];i&&i.setDependencies(r,n)}reloadTilesForDependencies(e,r){for(let n in this._tiles)this._tiles[n].hasDependency(e,r)&&this._reloadTile(n,"reloading");this._cache.filter(n=>!n.hasDependency(e,r))}};Db.maxOverzooming=10;Db.maxUnderzooming=3});var m$e,rV=h(()=>{m$e=_e(Br(),1)});var lme=h(()=>{Oe()});var ume=h(()=>{});var y$e,dcr,cD=h(()=>{y$e=_e(Br(),1);Sb();Ib();ev();Oe();dcr=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0])});var b$e,fme=h(()=>{b$e=_e(Br(),1);rV();lme();Im();ume();Jg();cD()});var hme,J2,iV=h(()=>{hme=_e(Br(),1);Qi();J2=class t extends hme.default{constructor(e,r,n,i){super(e,r),this.angle=n,i!==void 0&&(this.segment=i)}clone(){return new t(this.x,this.y,this.angle,this.segment)}};oe("Anchor",J2)});var dme=h(()=>{});var mme=h(()=>{iV();dme()});var _$e,yme=h(()=>{_$e=_e(Br(),1);UL();ev();jL();Jg()});var w$e,gme=h(()=>{w$e=_e(Br(),1)});var S$e,vme=h(()=>{aC();S$e=_e(Br(),1);Im()});var I$e,oV=h(()=>{Jg();I$e=Number.POSITIVE_INFINITY});var C$e,xme=h(()=>{iV();mme();rV();ev();yme();gme();Oe();pb();vme();OL();eo();Ib();qa();Sb();Jg();C$e=_e(oz(),1);Mz();oV()});var Vh=h(()=>{eo()});var A$e,Npr,Bpr,zpr,Vpr,Upr,Gpr,jpr,bme=h(()=>{fme();eo();Sb();cD();xme();ev();Vh();A$e=_e(Br(),1);Ez();Oe();oV();Npr=Math.pow(2,25),Bpr=Math.pow(2,24),zpr=Math.pow(2,17),Vpr=Math.pow(2,16),Upr=Math.pow(2,9),Gpr=Math.pow(2,8),jpr=Math.pow(2,1)});var _me=h(()=>{vo();bme()});var Ypr,sV=h(()=>{eo();Ypr=512/8192/2});var Bfr,aV=h(()=>{Qn();_de();wde();Ide();Ade();Lde();Dde();Oe();Lz();qc();Nu();vo();eD();pL();Vde();tV();ua();KL();aD();Yz();_me();J9();sV();Az();Dh();Bfr=vfe()});var O$e,wme=h(()=>{Uu();O$e=Hr([{name:"a_pos",type:"Int16",components:2}])});var Sme,Ime=h(()=>{Sme=`#ifdef GL_ES
|
|
68
68
|
precision mediump float;
|
|
69
69
|
#else
|