mapbox-gl
Version:
A WebGL interactive maps library
1 lines • 771 kB
JavaScript
var e=1e-6,t="undefined"!=typeof Float32Array?Float32Array:Array;function r(){var e=new t(4);return t!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e}function n(e,t){var r=t[0],n=t[1],i=t[2],s=t[3],a=r*s-i*n;return a?(e[0]=s*(a=1/a),e[1]=-n*a,e[2]=-i*a,e[3]=r*a,e):null}function i(e,t,r){var n=t[0],i=t[1],s=t[2],a=t[3],o=Math.sin(r),l=Math.cos(r);return e[0]=n*l+s*o,e[1]=i*l+a*o,e[2]=n*-o+s*l,e[3]=i*-o+a*l,e}function s(){var e=new t(9);return t!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function a(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function o(e,t){var r=t[0],n=t[1],i=t[2],s=t[3],a=t[4],o=t[5],l=t[6],u=t[7],c=t[8],h=c*a-o*u,d=-c*s+o*l,p=u*s-a*l,f=r*h+n*d+i*p;return f?(e[0]=h*(f=1/f),e[1]=(-c*n+i*u)*f,e[2]=(o*n-i*a)*f,e[3]=d*f,e[4]=(c*r-i*l)*f,e[5]=(-o*r+i*s)*f,e[6]=p*f,e[7]=(-u*r+n*l)*f,e[8]=(a*r-n*s)*f,e):null}function l(e,t){var r=t[0],n=t[1],i=t[2],s=t[3],a=t[4],o=t[5],l=t[6],u=t[7],c=t[8];return e[0]=a*c-o*u,e[1]=i*u-n*c,e[2]=n*o-i*a,e[3]=o*l-s*c,e[4]=r*c-i*l,e[5]=i*s-r*o,e[6]=s*u-a*l,e[7]=n*l-r*u,e[8]=r*a-n*s,e}function u(e,t,r){var n=t[0],i=t[1],s=t[2],a=t[3],o=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=r[0],p=r[1],f=r[2],m=r[3],y=r[4],g=r[5],x=r[6],v=r[7],b=r[8];return e[0]=d*n+p*a+f*u,e[1]=d*i+p*o+f*c,e[2]=d*s+p*l+f*h,e[3]=m*n+y*a+g*u,e[4]=m*i+y*o+g*c,e[5]=m*s+y*l+g*h,e[6]=x*n+v*a+b*u,e[7]=x*i+v*o+b*c,e[8]=x*s+v*l+b*h,e}function c(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=-r,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function h(){var e=new t(16);return t!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function d(e){var r=new t(16);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r}function p(e,r,n,i,s,a,o,l,u,c,h,d,p,f,m,y){var g=new t(16);return g[0]=e,g[1]=r,g[2]=n,g[3]=i,g[4]=s,g[5]=a,g[6]=o,g[7]=l,g[8]=u,g[9]=c,g[10]=h,g[11]=d,g[12]=p,g[13]=f,g[14]=m,g[15]=y,g}function f(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function m(e,t){if(e===t){var r=t[1],n=t[2],i=t[3],s=t[6],a=t[7],o=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=s,e[11]=t[14],e[12]=i,e[13]=a,e[14]=o}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function y(e,t){var r=t[0],n=t[1],i=t[2],s=t[3],a=t[4],o=t[5],l=t[6],u=t[7],c=t[8],h=t[9],d=t[10],p=t[11],f=t[12],m=t[13],y=t[14],g=t[15],x=r*o-n*a,v=r*l-i*a,b=r*u-s*a,w=n*l-i*o,_=n*u-s*o,A=i*u-s*l,I=c*m-h*f,M=c*y-d*f,S=c*g-p*f,B=h*y-d*m,P=h*g-p*m,T=d*g-p*y,z=x*T-v*P+b*B+w*S-_*M+A*I;return z?(e[0]=(o*T-l*P+u*B)*(z=1/z),e[1]=(i*P-n*T-s*B)*z,e[2]=(m*A-y*_+g*w)*z,e[3]=(d*_-h*A-p*w)*z,e[4]=(l*S-a*T-u*M)*z,e[5]=(r*T-i*S+s*M)*z,e[6]=(y*b-f*A-g*v)*z,e[7]=(c*A-d*b+p*v)*z,e[8]=(a*P-o*S+u*I)*z,e[9]=(n*S-r*P-s*I)*z,e[10]=(f*_-m*b+g*x)*z,e[11]=(h*b-c*_-p*x)*z,e[12]=(o*M-a*B-l*I)*z,e[13]=(r*B-n*M+i*I)*z,e[14]=(m*v-f*w-y*x)*z,e[15]=(c*w-h*v+d*x)*z,e):null}function g(e,t,r){var n=t[0],i=t[1],s=t[2],a=t[3],o=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=t[9],p=t[10],f=t[11],m=t[12],y=t[13],g=t[14],x=t[15],v=r[0],b=r[1],w=r[2],_=r[3];return e[0]=v*n+b*o+w*h+_*m,e[1]=v*i+b*l+w*d+_*y,e[2]=v*s+b*u+w*p+_*g,e[3]=v*a+b*c+w*f+_*x,e[4]=(v=r[4])*n+(b=r[5])*o+(w=r[6])*h+(_=r[7])*m,e[5]=v*i+b*l+w*d+_*y,e[6]=v*s+b*u+w*p+_*g,e[7]=v*a+b*c+w*f+_*x,e[8]=(v=r[8])*n+(b=r[9])*o+(w=r[10])*h+(_=r[11])*m,e[9]=v*i+b*l+w*d+_*y,e[10]=v*s+b*u+w*p+_*g,e[11]=v*a+b*c+w*f+_*x,e[12]=(v=r[12])*n+(b=r[13])*o+(w=r[14])*h+(_=r[15])*m,e[13]=v*i+b*l+w*d+_*y,e[14]=v*s+b*u+w*p+_*g,e[15]=v*a+b*c+w*f+_*x,e}function x(e,t,r){var n,i,s,a,o,l,u,c,h,d,p,f,m=r[0],y=r[1],g=r[2];return t===e?(e[12]=t[0]*m+t[4]*y+t[8]*g+t[12],e[13]=t[1]*m+t[5]*y+t[9]*g+t[13],e[14]=t[2]*m+t[6]*y+t[10]*g+t[14],e[15]=t[3]*m+t[7]*y+t[11]*g+t[15]):(i=t[1],s=t[2],a=t[3],o=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=t[9],p=t[10],f=t[11],e[0]=n=t[0],e[1]=i,e[2]=s,e[3]=a,e[4]=o,e[5]=l,e[6]=u,e[7]=c,e[8]=h,e[9]=d,e[10]=p,e[11]=f,e[12]=n*m+o*y+h*g+t[12],e[13]=i*m+l*y+d*g+t[13],e[14]=s*m+u*y+p*g+t[14],e[15]=a*m+c*y+f*g+t[15]),e}function v(e,t,r){var n=r[0],i=r[1],s=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*s,e[9]=t[9]*s,e[10]=t[10]*s,e[11]=t[11]*s,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function b(e,t,r){var n=Math.sin(r),i=Math.cos(r),s=t[4],a=t[5],o=t[6],l=t[7],u=t[8],c=t[9],h=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=s*i+u*n,e[5]=a*i+c*n,e[6]=o*i+h*n,e[7]=l*i+d*n,e[8]=u*i-s*n,e[9]=c*i-a*n,e[10]=h*i-o*n,e[11]=d*i-l*n,e}function w(e,t,r){var n=Math.sin(r),i=Math.cos(r),s=t[0],a=t[1],o=t[2],l=t[3],u=t[8],c=t[9],h=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=s*i-u*n,e[1]=a*i-c*n,e[2]=o*i-h*n,e[3]=l*i-d*n,e[8]=s*n+u*i,e[9]=a*n+c*i,e[10]=o*n+h*i,e[11]=l*n+d*i,e}function _(e,t,r){var n=Math.sin(r),i=Math.cos(r),s=t[0],a=t[1],o=t[2],l=t[3],u=t[4],c=t[5],h=t[6],d=t[7];return t!==e&&(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[0]=s*i+u*n,e[1]=a*i+c*n,e[2]=o*i+h*n,e[3]=l*i+d*n,e[4]=u*i-s*n,e[5]=c*i-a*n,e[6]=h*i-o*n,e[7]=d*i-l*n,e}function A(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function I(t,r,n){var i,s,a,o=n[0],l=n[1],u=n[2],c=Math.sqrt(o*o+l*l+u*u);return c<e?null:(o*=c=1/c,l*=c,u*=c,i=Math.sin(r),s=Math.cos(r),t[0]=o*o*(a=1-s)+s,t[1]=l*o*a+u*i,t[2]=u*o*a-l*i,t[3]=0,t[4]=o*l*a-u*i,t[5]=l*l*a+s,t[6]=u*l*a+o*i,t[7]=0,t[8]=o*u*a+l*i,t[9]=l*u*a-o*i,t[10]=u*u*a+s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function M(e,t){var r=t[0],n=t[1],i=t[2],s=t[4],a=t[5],o=t[6],l=t[8],u=t[9],c=t[10];return e[0]=Math.sqrt(r*r+n*n+i*i),e[1]=Math.sqrt(s*s+a*a+o*o),e[2]=Math.sqrt(l*l+u*u+c*c),e}function S(e,r){var n=new t(3);M(n,r);var i=1/n[0],s=1/n[1],a=1/n[2],o=r[0]*i,l=r[1]*s,u=r[2]*a,c=r[4]*i,h=r[5]*s,d=r[6]*a,p=r[8]*i,f=r[9]*s,m=r[10]*a,y=o+h+m,g=0;return y>0?(g=2*Math.sqrt(y+1),e[3]=.25*g,e[0]=(d-f)/g,e[1]=(p-u)/g,e[2]=(l-c)/g):o>h&&o>m?(g=2*Math.sqrt(1+o-h-m),e[3]=(d-f)/g,e[0]=.25*g,e[1]=(l+c)/g,e[2]=(p+u)/g):h>m?(g=2*Math.sqrt(1+h-o-m),e[3]=(p-u)/g,e[0]=(l+c)/g,e[1]=.25*g,e[2]=(d+f)/g):(g=2*Math.sqrt(1+m-o-h),e[3]=(l-c)/g,e[0]=(p+u)/g,e[1]=(d+f)/g,e[2]=.25*g),e}function B(e,t){var r=t[0],n=t[1],i=t[2],s=t[3],a=r+r,o=n+n,l=i+i,u=r*a,c=n*a,h=n*o,d=i*a,p=i*o,f=i*l,m=s*a,y=s*o,g=s*l;return e[0]=1-h-f,e[1]=c+g,e[2]=d-y,e[3]=0,e[4]=c-g,e[5]=1-u-f,e[6]=p+m,e[7]=0,e[8]=d+y,e[9]=p-m,e[10]=1-u-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}var P=function(e,t,r,n,i){var s=1/Math.tan(t/2);if(e[0]=s/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0){var a=1/(n-i);e[10]=(i+n)*a,e[14]=2*i*n*a}else e[10]=-1,e[14]=-2*n;return e},T=function(e,t,r,n,i,s,a){var o=1/(t-r),l=1/(n-i),u=1/(s-a);return e[0]=-2*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+r)*o,e[13]=(i+n)*l,e[14]=(a+s)*u,e[15]=1,e},z=g;function k(){var e=new t(3);return t!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function F(e){var r=new t(3);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}function V(e){var t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)}function D(e,r,n){var i=new t(3);return i[0]=e,i[1]=r,i[2]=n,i}function E(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}function C(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function R(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function L(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function O(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e}function U(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e}function N(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function j(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e}function G(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return Math.sqrt(r*r+n*n+i*i)}function $(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return r*r+n*n+i*i}function q(e){var t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}function H(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function X(e,t){var r=t[0],n=t[1],i=t[2],s=r*r+n*n+i*i;return s>0&&(s=1/Math.sqrt(s)),e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e}function Z(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function W(e,t,r){var n=t[0],i=t[1],s=t[2],a=r[0],o=r[1],l=r[2];return e[0]=i*l-s*o,e[1]=s*a-n*l,e[2]=n*o-i*a,e}function Y(e,t,r,n){var i=t[0],s=t[1],a=t[2];return e[0]=i+n*(r[0]-i),e[1]=s+n*(r[1]-s),e[2]=a+n*(r[2]-a),e}function J(e,t,r){var n=t[0],i=t[1],s=t[2],a=r[3]*n+r[7]*i+r[11]*s+r[15];return e[0]=(r[0]*n+r[4]*i+r[8]*s+r[12])/(a=a||1),e[1]=(r[1]*n+r[5]*i+r[9]*s+r[13])/a,e[2]=(r[2]*n+r[6]*i+r[10]*s+r[14])/a,e}function K(e,t,r){var n=t[0],i=t[1],s=t[2];return e[0]=n*r[0]+i*r[3]+s*r[6],e[1]=n*r[1]+i*r[4]+s*r[7],e[2]=n*r[2]+i*r[5]+s*r[8],e}function Q(e,t,r){var n=r[0],i=r[1],s=r[2],a=r[3],o=t[0],l=t[1],u=t[2],c=i*u-s*l,h=s*o-n*u,d=n*l-i*o;return e[0]=o+a*(c+=c)+i*(d+=d)-s*(h+=h),e[1]=l+a*h+s*c-n*d,e[2]=u+a*d+n*h-i*c,e}function ee(e){return e[0]=0,e[1]=0,e[2]=0,e}function te(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}var re=R,ne=L,ie=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e},se=V;function ae(){var e=new t(4);return t!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function oe(e,r,n,i){var s=new t(4);return s[0]=e,s[1]=r,s[2]=n,s[3]=i,s}function le(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e}function ue(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e}function ce(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function he(e,t){var r=t[0],n=t[1],i=t[2],s=t[3],a=r*r+n*n+i*i+s*s;return a>0&&(a=1/Math.sqrt(a)),e[0]=r*a,e[1]=n*a,e[2]=i*a,e[3]=s*a,e}function de(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function pe(e,t,r,n){var i=t[0],s=t[1],a=t[2],o=t[3];return e[0]=i+n*(r[0]-i),e[1]=s+n*(r[1]-s),e[2]=a+n*(r[2]-a),e[3]=o+n*(r[3]-o),e}function fe(e,t,r){var n=t[0],i=t[1],s=t[2],a=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*s+r[12]*a,e[1]=r[1]*n+r[5]*i+r[9]*s+r[13]*a,e[2]=r[2]*n+r[6]*i+r[10]*s+r[14]*a,e[3]=r[3]*n+r[7]*i+r[11]*s+r[15]*a,e}function me(){var e=new t(4);return t!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function ye(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function ge(t,r){var n=2*Math.acos(r[3]),i=Math.sin(n/2);return i>e?(t[0]=r[0]/i,t[1]=r[1]/i,t[2]=r[2]/i):(t[0]=1,t[1]=0,t[2]=0),n}function xe(e,t,r){r*=.5;var n=t[0],i=t[1],s=t[2],a=t[3],o=Math.sin(r),l=Math.cos(r);return e[0]=n*l+a*o,e[1]=i*l+s*o,e[2]=s*l-i*o,e[3]=a*l-n*o,e}function ve(e,t,r){r*=.5;var n=t[0],i=t[1],s=t[2],a=t[3],o=Math.sin(r),l=Math.cos(r);return e[0]=n*l-s*o,e[1]=i*l+a*o,e[2]=s*l+n*o,e[3]=a*l-i*o,e}function be(e,t,r){r*=.5;var n=t[0],i=t[1],s=t[2],a=t[3],o=Math.sin(r),l=Math.cos(r);return e[0]=n*l+i*o,e[1]=i*l-n*o,e[2]=s*l+a*o,e[3]=a*l-s*o,e}function we(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}k(),ae();var _e,Ae,Ie,Me=function(e){var t=e[0],r=e[1],n=e[2],i=e[3];return Math.sqrt(t*t+r*r+n*n+i*i)},Se=he,Be=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},Pe=(_e=k(),Ae=D(1,0,0),Ie=D(0,1,0),function(e,t,r){var n=Z(t,r);return n<-.999999?(W(_e,Ae,t),se(_e)<1e-6&&W(_e,Ie,t),X(_e,_e),function(e,t,r){r*=.5;var n=Math.sin(r);e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r)}(e,_e,Math.PI),e):n>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(W(_e,t,r),e[0]=_e[0],e[1]=_e[1],e[2]=_e[2],e[3]=1+n,Se(e,e))});function Te(){var e=new t(2);return t!=Float32Array&&(e[0]=0,e[1]=0),e}function ze(e,r){var n=new t(2);return n[0]=e,n[1]=r,n}function ke(e,t,r){return e[0]=t,e[1]=r,e}function Fe(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e}function Ve(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e}function De(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e}function Ee(e){var t=e[0],r=e[1];return Math.sqrt(t*t+r*r)}function Ce(e,t){var r=t[0],n=t[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),e[0]=t[0]*i,e[1]=t[1]*i,e}function Re(e,t){return e[0]*t[0]+e[1]*t[1]}me(),me(),s();var Le,Oe,Ue=Ve;function Ne(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}Te();var je=function(){if(Oe)return Le;function e(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=n}return Oe=1,Le=e,e.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,n=0;n<8;n++){var i=this.sampleCurveX(r)-e;if(Math.abs(i)<t)return r;var s=this.sampleCurveDerivativeX(r);if(Math.abs(s)<1e-6)break;r-=i/s}var a=0,o=1;for(r=e,n=0;n<20&&(i=this.sampleCurveX(r),!(Math.abs(i-e)<t));n++)e>i?a=r:o=r,r=.5*(o-a)+a;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}},Le}();const Ge=Ne(je);function $e(e,t){this.x=e,this.y=t}function qe(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!qe(e[r],t[r]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==t){if("object"!=typeof t)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(!qe(e[r],t[r]))return!1;return!0}return e===t}$e.prototype={clone(){return new $e(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,t){return this.clone()._rotateAround(e,t)},matMult(e){return this.clone()._matMult(e)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){const t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult(e){const t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add(e){return this.x+=e.x,this.y+=e.y,this},_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){const e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){const t=Math.cos(e),r=Math.sin(e),n=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=n,this},_rotateAround(e,t){const r=Math.cos(e),n=Math.sin(e),i=t.y+n*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-n*(this.y-t.y),this.y=i,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:$e},$e.convert=function(e){if(e instanceof $e)return e;if(Array.isArray(e))return new $e(+e[0],+e[1]);if(void 0!==e.x&&void 0!==e.y)return new $e(+e.x,+e.y);throw new Error("Expected [x, y] or {x, y} point format")};const He=Math.PI/180,Xe=180/Math.PI;function Ze(e){return e*He}function We(e){return e*Xe}const Ye=[[0,0],[1,0],[1,1],[0,1]];function Je(e){const t=Math.round((e+45+360)%360/90)%4;return Ye[t]}function Ke(e){if(e<=0)return 0;if(e>=1)return 1;const t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function Qe(e){let t=1/0,r=1/0,n=-1/0,i=-1/0;for(const s of e)t=Math.min(t,s.x),r=Math.min(r,s.y),n=Math.max(n,s.x),i=Math.max(i,s.y);return{min:new $e(t,r),max:new $e(n,i)}}function et(e,t,r){let n=0;for(let r=0;r<2;++r){const i=0;e[r]>i&&(n+=(e[r]-i)*(e[r]-i)),t[r]<i&&(n+=(i-t[r])*(i-t[r]))}return n}function tt(e,t,r=0,n=!0){const i=new $e(r,r),s=e.sub(i),a=t.add(i),o=[s,new $e(a.x,s.y),a,new $e(s.x,a.y)];return n&&o.push(s.clone()),o}function rt(e,t){const r=[];for(let n=0;n<e.length;n++){const i=ot(n-1,-1,e.length-1),s=ot(n+1,-1,e.length-1),a=e[n],o=e[s],l=e[i].sub(a).unit(),u=o.sub(a).unit(),c=u.angleWithSep(l.x,l.y),h=l.add(u).unit().mult(-1*t/Math.sin(c/2));r.push(a.add(h))}return r}function nt(e,t,r,n){const i=new Ge(e,t,r,n);return function(e){return i.solve(e)}}const it=nt(.25,.1,.25,1);function st(e,t,r){return Math.min(r,Math.max(t,e))}function at(e,t,r){return(r=st((r-e)/(t-e),0,1))*r*(3-2*r)}function ot(e,t,r){const n=r-t,i=((e-t)%n+n)%n+t;return i===t?r:i}function lt(e,t,r){if(!e.length)return r(null,[]);let n=e.length;const i=new Array(e.length);let s=null;e.forEach((e,a)=>{t(e,(e,t)=>{e&&(s=e),i[a]=t,0===--n&&r(s,i)})})}function ut(e,t){const r=[];for(const n in e)n in t||r.push(n);return r}function ct(e,t){const r={};for(let n=0;n<t.length;n++){const i=t[n];i in e&&(r[i]=e[i])}return r}let ht=1;function dt(){return ht++}function pt(){return function e(t){return t?(t^Math.random()*(16>>t/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}()}function ft(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log2(e)))}function mt(e){return e<=1?1:Math.pow(2,Math.floor(Math.log2(e)))}function yt(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function gt(e,t){e.forEach(e=>{t[e]&&(t[e]=t[e].bind(t))})}function xt(e,t,r){const n={};for(const r in e)n[r]=t.call(this,e[r],r,e);return n}function vt(e,t,r){const n={};for(const r in e)t.call(this,e[r],r,e)&&(n[r]=e[r]);return n}function bt(e){return Array.isArray(e)?e.map(bt):"object"==typeof e&&e?xt(e,bt):e}function wt(e,t,r,n,i){return st((e-t)/(r-t)*(i-n)+n,n,i)}function _t(e,t){for(let r=0;r<e.length;r++)if(t.indexOf(e[r])>=0)return!0;return!1}const At={};function It(e){At[e]||("undefined"!=typeof console&&console.warn(e),At[e]=!0)}function Mt(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function St(e){let t=0;for(let r,n,i=0,s=e.length,a=s-1;i<s;a=i++)r=e[i],n=e[a],t+=(n.x-r.x)*(r.y+n.y);return t}function Bt([e,t,r]){const n=Ze(t+90),i=Ze(r);return{x:e*Math.cos(n)*Math.sin(i),y:e*Math.sin(n)*Math.sin(i),z:e*Math.cos(i),azimuthal:t,polar:r}}function Pt(e,t,r){const n=Math.sqrt(e*e+t*t+r*r),i=n>0?Math.acos(r/n)*Xe:0;let s=0!==e||0!==t?Math.atan2(-t,-e)*Xe+90:0;return s<0&&(s+=360),[n,s,i]}function Tt(e){return("undefined"!=typeof self||void 0!==e)&&"undefined"!=typeof WorkerGlobalScope&&(void 0!==e?e:self)instanceof WorkerGlobalScope}function zt(e){const t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(e,r,n,i)=>{const s=n||i;return t[r]=!s||s.toLowerCase(),""}),t["max-age"]){const e=parseInt(t["max-age"],10);isNaN(e)?delete t["max-age"]:t["max-age"]=e}return t}function kt(e){return e?{cacheControl:e.get("cache-control"),expires:e.get("expires")}:{cacheControl:void 0,expires:void 0}}let Ft,Vt=null;function Dt(e){const t=e.navigator?e.navigator.userAgent:null;return!!function(e){if(null==Vt){const t=e.navigator?e.navigator.userAgent:null;Vt=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return Vt}(e)&&!(!t||!(t.match("Version/15.4")||t.match("Version/15.5")||t.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/)))}function Et(){return!!document.fullscreenElement||!!document.webkitFullscreenElement}function Ct(e){try{const t=self[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch(e){return!1}}function Rt(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(Number("0x"+t))))}function Lt(e){return decodeURIComponent(atob(e).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join(""))}function Ot(e,t){return[e[4*t],e[4*t+1],e[4*t+2],e[4*t+3]]}function Ut(e,t,r){e[4*t+0]=r[0],e[4*t+1]=r[1],e[4*t+2]=r[2],e[4*t+3]=r[3]}function Nt(e,t){return[Math.pow(e[0],2.2)*t,Math.pow(e[1],2.2)*t,Math.pow(e[2],2.2)*t]}function jt(e){return[Math.pow(e[0],1/2.2),Math.pow(e[1],1/2.2),Math.pow(e[2],1/2.2)]}function Gt(e,t,r,n){for(;t<r;){const i=t+r>>1;e[i]<n?t=i+1:r=i}return t}function $t(e,t,r,n){for(;t<r;){const i=t+r>>1;e[i]<=n?t=i+1:r=i}return t}function qt(e){return e>0?1/(1.001-e):1+e}function Ht(e){return e>0?1-1/(1.001-e):-e}function Xt(e,t,r){return(e-t.min)*(r.max-r.min)/(t.max-t.min)+r.min}function Zt(e){return e*e*e*e*e}function Wt(e){return e>>>=0,e=Math.imul(2747636419^e,2654435769)>>>0,e=Math.imul(e^e>>>16,2654435769)>>>0,(e=Math.imul(e^e>>>16,2654435769)>>>0)/4294967296}const Yt={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!Yt.API_URL)return null;try{const e=new URL(Yt.API_URL);return"api.mapbox.cn"===e.hostname?"https://events.mapbox.cn/events/v2":"api.mapbox.com"===e.hostname?"https://events.mapbox.com/events/v2":null}catch(e){return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",RASTERARRAYS_URL_PREFIX:"rasterarrays/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,DEFAULT_STYLE:"mapbox://styles/mapbox/standard",MAX_PARALLEL_IMAGE_REQUESTS:16,DRACO_URL:"/mapbox-gl-js/draco_decoder_gltf_v1.5.6.wasm",MESHOPT_URL:"/mapbox-gl-js/meshopt_base_v0.20.wasm",MESHOPT_SIMD_URL:"/mapbox-gl-js/meshopt_simd_v0.20.wasm",BUILDING_GEN_URL:"/mapbox-gl-js/building-gen/building_gen_v1.2.4.wasm",GLYPHS_URL:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf",TILES3D_URL_PREFIX:"3dtiles/v1",TILE_PROVIDER_URLS:Object.assign(Object.create(null),{pmtiles:"/mapbox-gl-js/mapbox-gl-pmtiles-provider-v0.0.1.js"})};function Jt(){return{API_URL:Yt.API_URL,DRACO_URL:Yt.DRACO_URL,MESHOPT_URL:Yt.MESHOPT_URL,MESHOPT_SIMD_URL:Yt.MESHOPT_SIMD_URL,BUILDING_GEN_URL:Yt.BUILDING_GEN_URL}}function Kt(){return new URL(Yt.DRACO_URL,Yt.API_URL).href}function Qt(){if("object"!=typeof WebAssembly)throw new Error("WebAssembly not supported, cannot instantiate meshoptimizer");return new URL(function(){if(void 0===Ft){if("object"!=typeof WebAssembly)return!1;const e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]);Ft=WebAssembly.validate(e)}return Ft}()?Yt.MESHOPT_SIMD_URL:Yt.MESHOPT_URL,Yt.API_URL).href}function er(){return new URL(Yt.BUILDING_GEN_URL,Yt.API_URL).href}function tr(e){return Yt.API_URL_REGEX.test(e)}function rr(e){return 0===e.indexOf("mapbox:")}function nr(e){return Yt.API_CDN_URL_REGEX.test(e)}function ir(e){return Yt.API_SPRITE_REGEX.test(e)}function sr(e){return Yt.API_STYLE_REGEX.test(e)&&!ir(e)}function ar(e){return Yt.API_TILEJSON_REGEX.test(e)}function or(e){return Yt.API_FONTS_REGEX.test(e)}let lr,ur,cr,hr,dr,pr;function fr(){return null==lr&&(lr=self.OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),lr}const mr={now:()=>void 0!==hr?hr:performance.now(),setNow(e){hr=e},restoreNow(){hr=void 0},frame(e){const t=requestAnimationFrame(e);return{cancel:()=>cancelAnimationFrame(t)}},getImageData(e,t=0){const{width:r,height:n}=e;dr||(dr=document.createElement("canvas"));const i=dr.getContext("2d",{willReadFrequently:!0});if(!i)throw new Error("failed to create canvas 2d context");return(r>dr.width||n>dr.height)&&(dr.width=r,dr.height=n),i.clearRect(-t,-t,r+2*t,n+2*t),i.drawImage(e,0,0,r,n),i.getImageData(-t,-t,r+2*t,n+2*t)},resolveURL:e=>(ur||(ur=document.createElement("a")),ur.href=e,ur.href),get devicePixelRatio(){return window.devicePixelRatio},get prefersReducedMotion(){return!!window.matchMedia&&(null==cr&&(cr=window.matchMedia("(prefers-reduced-motion: reduce)")),cr.matches)},hasCanvasFingerprintNoise(){if(void 0!==pr)return pr;if(!fr())return pr=!1,!1;const e=new OffscreenCanvas(85,1),t=e.getContext("2d",{willReadFrequently:!0});let r=0;for(let n=0;n<e.width;++n)t.fillStyle=`rgba(${r++},${r++},${r++}, 255)`,t.fillRect(n,0,1,1);const n=t.getImageData(0,0,e.width,e.height);r=0;for(let e=0;e<n.data.length;++e)if(e%4!=3&&r++!==n.data[e])return pr=!0,!0;return pr=!1,!1}};function yr(e){try{const t=new URL(e).pathname.split("/").pop()||"",r=t.lastIndexOf(".");return r>=0?t.slice(r+1):""}catch{return""}}function gr(e,t){const r=e.indexOf("?");if(r<0)return`${e}?${new URLSearchParams(t).toString()}`;const n=new URLSearchParams(e.slice(r));for(const e in t)n.set(e,t[e]);return`${e.slice(0,r)}?${n.toString()}`}function xr(e,t={persistentParams:[]}){const r=e.indexOf("?");if(r<0)return e;const n=new URLSearchParams,i=new URLSearchParams(e.slice(r));for(const e of t.persistentParams){const t=i.get(e);t&&n.set(e,t)}const s=n.toString();return`${e.slice(0,r)}${s.length>0?`?${s}`:""}`}const vr="mapbox-tiles";let br=500,wr=50;const _r=["language","worldview","jobid"];let Ar;function Ir(){try{return caches}catch(e){}}function Mr(){const e=Ir();e&&null==Ar&&(Ar=e.open(vr))}let Sr=1/0;function Br(e){Sr++,Sr>wr&&(e.getActor().send("enforceCacheSizeLimit",br),Sr=0)}function Pr(e){Mr(),null!=Ar&&Ar.then(t=>{t.keys().then(r=>{for(let n=0;n<r.length-e;n++)t.delete(r[n]).catch(e=>It(e.message))}).catch(e=>It(e.message))}).catch(e=>It(e.message))}function Tr(e){const t=Ir();if(!t)return;const r=t.delete(vr);e&&r.then(()=>e()).catch(e)}function zr(e,t){br=e,wr=t}const kr={supported:!1,testSupport:function(e){!Dr&&Vr&&(Er?Rr(e):Fr=e)}};let Fr,Vr,Dr=!1,Er=!1;const Cr="undefined"!=typeof self?self:{};function Rr(e){const t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,Vr),e.isContextLost())return;kr.supported=!0}catch(e){}e.deleteTexture(t),Dr=!0}Cr.document&&(Vr=Cr.document.createElement("img"),Vr.onload=function(){Fr&&Rr(Fr),Fr=null,Er=!0},Vr.onerror=function(){Dr=!0,Fr=null},Vr.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const Lr={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Iconset:"Iconset",Image:"Image",Model:"Model"};Object.freeze(Lr);class Or extends Error{constructor(e,t,r){401===t&&tr(r)&&(e+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(e),this.status=t,this.url=r}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}function Ur(e){return"object"==typeof e&&null!==e&&"status"in e&&404===e.status}const Nr=Tt()?()=>self.worker.referrer:()=>("blob:"===location.protocol?parent:self).location.href;const jr=function(e,t){return/^file:/.test(r=e.url)||/^file:/.test(Nr())&&!/^\w+:/.test(r)?function(e,t){const r=new XMLHttpRequest;r.open(e.method||"GET",e.url,!0),"arrayBuffer"===e.type&&(r.responseType="arraybuffer");for(const t in e.headers)r.setRequestHeader(t,e.headers[t]);return"json"===e.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===e.credentials,r.onerror=()=>{t(new Error(r.statusText))},r.onload=()=>{if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){let n=r.response;if("json"===e.type)try{n=JSON.parse(r.response)}catch(e){return t(e)}const i=new Headers;r.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(e=>{const t=e.split(": "),r=t.shift(),n=t.join(": ");i.append(r,n)}),t(null,n,i)}else t(new Or(r.statusText,r.status,e.url))},r.send(e.body),{cancel:()=>r.abort()}}(e,t):function(e,t){const r=new AbortController,n=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,referrer:Nr(),referrerPolicy:e.referrerPolicy,signal:r.signal});let i=!1,s=!1;const a=(o=n.url).indexOf("sku=")>0&&tr(o);var o;"json"===e.type&&n.headers.set("Accept","application/json");const l=(r,i,o)=>{if(s)return;if(r&&"SecurityError"!==r.message&&It(r.toString()),i&&o)return u(i);const l=Date.now();fetch(n).then(r=>{if(r.ok){const e=a?r.clone():null;return u(r,e,l)}return t(new Or(r.statusText,r.status,e.url))}).catch(r=>{"AbortError"!==r.name&&t(new Error(`${r.message} ${e.url}`))})},u=(r,a,o)=>{("arrayBuffer"===e.type?r.arrayBuffer():"json"===e.type?r.json():r.text()).then(e=>{s||(a&&o&&function(e,t,r){if(Mr(),null==Ar)return;const n=zt(t.headers.get("cache-control")||"");if(n["no-store"])return;const i={status:t.status,statusText:t.statusText,headers:new Headers};t.headers.forEach((e,t)=>i.headers.set(t,e)),n["max-age"]&&i.headers.set("Expires",new Date(r+1e3*n["max-age"]).toUTCString());const s=i.headers.get("expires");if(!s)return;if(new Date(s).getTime()-r<42e4)return;let a=xr(e.url,{persistentParams:_r});if(206===t.status){const t=e.headers.get("Range");if(!t)return;i.status=200,a=gr(a,{range:t})}const o=new Response(200!==(l=t.status)&&404!==l&&[101,103,204,205,304].includes(l)?null:t.body,i);var l;Mr(),null!=Ar&&Ar.then(e=>e.put(a,o)).catch(e=>It(e.message))}(n,a,o),i=!0,t(null,e,r.headers))}).catch(e=>{s||t(new Error(e.message))})};return a?function(e,t){if(Mr(),null==Ar)return t(null);Ar.then(r=>{let n=xr(e.url,{persistentParams:_r});const i=e.headers.get("Range");i&&(n=gr(n,{range:i})),r.match(n).then(e=>{const i=function(e){if(!e)return!1;const t=new Date(e.headers.get("expires")||0),r=zt(e.headers.get("cache-control")||"");return Number(t)>Date.now()&&!r["no-cache"]}(e);r.delete(n).catch(t),i&&r.put(n,e.clone()).catch(t),t(null,e,i)}).catch(t)}).catch(t)}(n,l):l(null,null),{cancel:()=>{s=!0,i||r.abort()}}}(e,t);var r},Gr=function(e,t){return jr(Object.assign(e,{type:"json"}),t)},$r=function(e,t){return jr(Object.assign(e,{type:"arrayBuffer"}),t)},qr=function(e,t){return jr(Object.assign(e,{method:"POST"}),t)},Hr=function(e,t){return jr(Object.assign(e,{method:"GET"}),t)};function Xr(e){const t=document.createElement("a");return t.href=e,t.protocol===location.protocol&&t.host===location.host}let Zr,Wr;Zr=[],Wr=0;const Yr=function(e,t){if(kr.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),Wr>=Yt.MAX_PARALLEL_IMAGE_REQUESTS){const r={requestParameters:e,callback:t,cancelled:!1,cancel(){this.cancelled=!0}};return Zr.push(r),r}Wr++;let r=!1;const n=()=>{if(!r)for(r=!0,Wr--;Zr.length&&Wr<Yt.MAX_PARALLEL_IMAGE_REQUESTS;){const e=Zr.shift(),{requestParameters:t,callback:r,cancelled:n}=e;n||(e.cancel=Yr(t,r).cancel)}},i=$r(e,(e,r,i)=>{n(),e?t(e):r&&function(e,t){const r=new Blob([new Uint8Array(e)],{type:"image/png"});createImageBitmap(r).then(e=>{t(null,e)}).catch(e=>{t(new Error(`Could not load image because of ${e.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(r,(e,r)=>t(e,r,i))});return{cancel:()=>{i.cancel(),n()}}},Jr=function(e,t){const r=document.createElement("video");r.muted=!0,r.onloadstart=function(){t(null,r)};for(let t=0;t<e.length;t++){const n=document.createElement("source");Xr(e[t])||(r.crossOrigin="Anonymous"),n.src=e[t],r.appendChild(n)}return{cancel:()=>{}}};var Kr,Qr,en,tn={exports:{}},rn={exports:{}},nn={exports:{}},sn=function(){if(en)return tn.exports;en=1;var e=(Kr||(Kr=1,rn.exports=function(e,t){var r,n,i,s,a,o,l,u;for(n=e.length-(r=3&e.length),i=t,a=3432918353,o=461845907,u=0;u<n;)l=255&e.charCodeAt(u)|(255&e.charCodeAt(++u))<<8|(255&e.charCodeAt(++u))<<16|(255&e.charCodeAt(++u))<<24,++u,i=27492+(65535&(s=5*(65535&(i=(i^=l=(65535&(l=(l=(65535&l)*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+(((s>>>16)+58964&65535)<<16);switch(l=0,r){case 3:l^=(255&e.charCodeAt(u+2))<<16;case 2:l^=(255&e.charCodeAt(u+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(u)))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*o+(((l>>>16)*o&65535)<<16)&4294967295}return i^=e.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}),rn.exports),t=(Qr||(Qr=1,nn.exports=function(e,t){for(var r,n=e.length,i=t^n,s=0;n>=4;)r=1540483477*(65535&(r=255&e.charCodeAt(s)|(255&e.charCodeAt(++s))<<8|(255&e.charCodeAt(++s))<<16|(255&e.charCodeAt(++s))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++s;switch(n){case 3:i^=(255&e.charCodeAt(s+2))<<16;case 2:i^=(255&e.charCodeAt(s+1))<<8;case 1:i=1540483477*(65535&(i^=255&e.charCodeAt(s)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}),nn.exports);return tn.exports=e,tn.exports.murmur3=e,tn.exports.murmur2=t,tn.exports}();const an=Ne(sn);class on{constructor(e,...t){Object.assign(this,t[0]||{}),this.type=e}}class ln extends on{constructor(e,t={}){super("error",Object.assign({error:e},t))}}function un(e,t,r){r[e]&&-1!==r[e].indexOf(t)||(r[e]=r[e]||[],r[e].push(t))}function cn(e,t,r){if(r&&r[e]){const n=r[e].indexOf(t);-1!==n&&r[e].splice(n,1)}}class hn{on(e,t){return this._listeners=this._listeners||{},un(e,t,this._listeners),this}off(e,t){return cn(e,t,this._listeners),cn(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners=this._oneTimeListeners||{},un(e,t,this._oneTimeListeners),this):new Promise(t=>{this.once(e,t)})}fire(e,t){const r="string"==typeof e?new on(e,t):e,n=r.type;if(this.listens(n)){r.target=this;const e=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];for(const t of e)t.call(this,r);const t=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];for(const e of t)cn(n,e,this._oneTimeListeners),e.call(this,r);const i=this._eventedParent;if(i){const e="function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData;Object.assign(r,e),i.fire(r)}}else r instanceof ln&&console.error(r.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,t){return this._eventedParent=e,this._eventedParentData=t,this}}class dn{constructor(e){"string"==typeof e?this.name=e:(this.name=e.name,this.iconsetId=e.iconsetId)}static from(e){return new dn(e)}static toString(e){return e.iconsetId?`${e.name}${e.iconsetId}`:e.name}static parse(e){const[t,r]=e.split("");return new dn({name:t,iconsetId:r})}static isEqual(e,t){return e.name===t.name&&e.iconsetId===t.iconsetId}toString(){return dn.toString(this)}serialize(){return{name:this.name,iconsetId:this.iconsetId}}}var pn,fn={},mn=function(){if(pn)return fn;pn=1;var e={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function t(e){return(e=Math.round(e))<0?0:e>255?255:e}function r(e){return t("%"===e[e.length-1]?parseFloat(e)/100*255:parseInt(e))}function n(e){return(t="%"===e[e.length-1]?parseFloat(e)/100:parseFloat(e))<0?0:t>1?1:t;var t}function i(e,t,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?e+(t-e)*r*6:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}try{fn.parseCSSColor=function(s){var a,o=s.replace(/ /g,"").toLowerCase();if(o in e)return e[o].slice();if("#"===o[0])return 4===o.length?(a=parseInt(o.substr(1),16))>=0&&a<=4095?[(3840&a)>>4|(3840&a)>>8,240&a|(240&a)>>4,15&a|(15&a)<<4,1]:null:7===o.length&&(a=parseInt(o.substr(1),16))>=0&&a<=16777215?[(16711680&a)>>16,(65280&a)>>8,255&a,1]:null;var l=o.indexOf("("),u=o.indexOf(")");if(-1!==l&&u+1===o.length){var c=o.substr(0,l),h=o.substr(l+1,u-(l+1)).split(","),d=1;switch(c){case"rgba":if(4!==h.length)return null;d=n(h.pop());case"rgb":return 3!==h.length?null:[r(h[0]),r(h[1]),r(h[2]),d];case"hsla":if(4!==h.length)return null;d=n(h.pop());case"hsl":if(3!==h.length)return null;var p=(parseFloat(h[0])%360+360)%360/360,f=n(h[1]),m=n(h[2]),y=m<=.5?m*(f+1):m+f-m*f,g=2*m-y;return[t(255*i(g,y,p+1/3)),t(255*i(g,y,p)),t(255*i(g,y,p-1/3)),d];default:return null}}return null}}catch(e){}return fn}();class yn{constructor(e,t,r,n=1){this.r=e,this.g=t,this.b=r,this.a=n}static parse(e){if(!e)return;if(e instanceof yn)return e;if("string"!=typeof e)return;const t=mn.parseCSSColor(e);return t?new yn(t[0]/255,t[1]/255,t[2]/255,t[3]):void 0}toString(){const[e,t,r,n]=[this.r,this.g,this.b,this.a];return`rgba(${Math.round(255*e)},${Math.round(255*t)},${Math.round(255*r)},${n})`}toNonPremultipliedRenderColor(e){const{r:t,g:r,b:n,a:i}=this;return new xn(e,t,r,n,i)}toPremultipliedRenderColor(e){const{r:t,g:r,b:n,a:i}=this;return new vn(e,t*i,r*i,n*i,i)}clone(){return new yn(this.r,this.g,this.b,this.a)}}class gn{constructor(e,t,r,n,i,s=!1){if(this.premultiplied=!1,this.premultiplied=s,e){const s=e.image.height,a=s*s;this.premultiplied?(t=0===i?0:t/i*(s-1),r=0===i?0:r/i*(s-1),n=0===i?0:n/i*(s-1)):(t*=s-1,r*=s-1,n*=s-1),t=Math.max(0,Math.min(s-1,t)),r=Math.max(0,Math.min(s-1,r)),n=Math.max(0,Math.min(s-1,n));const o=Math.floor(t),l=Math.floor(r),u=Math.floor(n),c=Math.ceil(t),h=Math.ceil(r),d=Math.ceil(n),p=t-o,f=r-l,m=n-u,y=e.image.data,g=4*(o+l*a+u*s),x=4*(o+l*a+d*s),v=4*(o+h*a+u*s),b=4*(o+h*a+d*s),w=4*(c+l*a+u*s),_=4*(c+l*a+d*s),A=4*(c+h*a+u*s),I=4*(c+h*a+d*s);this.r=bn(bn(bn(y[g],y[x],m),bn(y[v],y[b],m),f),bn(bn(y[w],y[_],m),bn(y[A],y[I],m),f),p)/255*(this.premultiplied?i:1),this.g=bn(bn(bn(y[g+1],y[x+1],m),bn(y[v+1],y[b+1],m),f),bn(bn(y[w+1],y[_+1],m),bn(y[A+1],y[I+1],m),f),p)/255*(this.premultiplied?i:1),this.b=bn(bn(bn(y[g+2],y[x+2],m),bn(y[v+2],y[b+2],m),f),bn(bn(y[w+2],y[_+2],m),bn(y[A+2],y[I+2],m),f),p)/255*(this.premultiplied?i:1),this.a=i}else this.r=t,this.g=r,this.b=n,this.a=i}toArray(){const{r:e,g:t,b:r,a:n}=this;return[255*e,255*t,255*r,n]}toHslaArray(){let{r:e,g:t,b:r,a:n}=this;if(this.premultiplied){if(0===n)return[0,0,0,0];const i=1/n;e*=i,t*=i,r*=i}const i=Math.min(Math.max(e,0),1),s=Math.min(Math.max(t,0),1),a=Math.min(Math.max(r,0),1),o=Math.min(i,s,a),l=Math.max(i,s,a),u=l-o,c=.5*(o+l);if(0===u)return[0,0,100*c,n];const h=c>.5?u/(2-l-o):u/(l+o);let d;switch(l){case i:d=60*((s-a)/u+(s<a?6:0));break;case s:d=60*((a-i)/u+2);break;default:d=60*((i-s)/u+4)}return[d,100*h,100*c,n]}toArray01(){const{r:e,g:t,b:r,a:n}=this;return[e,t,r,n]}toArray01Scaled(e){const{r:t,g:r,b:n}=this;return[t*e,r*e,n*e]}toArray01Linear(){const{r:e,g:t,b:r,a:n}=this;return[Math.pow(e,2.2),Math.pow(t,2.2),Math.pow(r,2.2),n]}}class xn extends gn{constructor(e,t,r,n,i){super(e,t,r,n,i,!1)}}class vn extends gn{constructor(e,t,r,n,i){super(e,t,r,n,i,!0)}}function bn(e,t,r){return e*(1-r)+t*r}function wn(e,t,r){return e.map((e,n)=>bn(e,t[n],r))}yn.black=new yn(0,0,0,1),yn.white=new yn(1,1,1,1),yn.transparent=new yn(0,0,0,0),yn.red=new yn(1,0,0,1),yn.blue=new yn(0,0,1,1);const _n=Object.freeze(Object.defineProperty({__proto__:null,array:wn,color:function(e,t,r){return new yn(bn(e.r,t.r,r),bn(e.g,t.g,r),bn(e.b,t.b,r),bn(e.a,t.a,r))},number:bn},Symbol.toStringTag,{value:"Module"}));class An extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class In{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[e,r]of t)this.bindings[e]=r}concat(e){return new In(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const Mn={kind:"null"},Sn={kind:"number"},Bn={kind:"string"},Pn={kind:"boolean"},Tn={kind:"color"},zn={kind:"object"},kn={kind:"value"},Fn={kind:"collator"},Vn={kind:"formatted"},Dn={kind:"resolvedImage"};function En(e,t){return{kind:"array",itemType:e,N:t}}function Cn(e){if("array"===e.kind){const t=Cn(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const Rn=[Mn,Sn,Bn,Pn,Tn,Vn,zn,En(kn),Dn];function Ln(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!Ln(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(const e of Rn)if(!Ln(e,t))return null}return`Expected ${Cn(e)} but found ${Cn(t)} instead.`}function On(e,t){return t.some(t=>t.kind===e.kind)}function Un(e,t){return t.some(t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e)}function Nn(e,t){return"array"===e.kind&&"array"===t.kind?e.N===t.N&&Nn(e.itemType,t.itemType):e.kind===t.kind}class jn{constructor(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Gn{constructor(e,t,r,n,i){this.text=e.normalize?e.normalize():e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=i}}class $n{constructor(e){this.sections=e}static fromString(e){return new $n([new Gn(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(e=>0!==e.text.length||!!e.image&&e.image.hasPrimary())}static factory(e){return e instanceof $n?e:$n.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map(e=>e.text).join("")}serialize(){const e=["format"];for(const t of this.sections){if(t.image){const r=t.image.getPrimary().id.toString();e.push(["image",r]);continue}e.push(t.text);const r={};t.fontStack&&(r["text-font"]=["literal",t.fontStack.split(",")]),t.scale&&(r["font-scale"]=t.scale),t.textColor&&(r["text-color"]=["rgba"].concat(t.textColor.toNonPremultipliedRenderColor(null).toArray())),e.push(r)}return e}}class qn{constructor(e,t={}){this.id=dn.from(e),this.params=t.params,this.sx=t.sx||1,this.sy=t.sy||1}toString(){return JSON.stringify(this)}static parse(e){let t,r,n,i;try{({id:t,params:r,sx:n,sy:i}=JSON.parse(e)||{})}catch(e){return null}return t?new qn(t,{params:r,sx:n,sy:i}):null}scaleSelf(e,t=e){return this.sx*=e,this.sy*=t,this}}class Hn{constructor(e,t,r,n,i=!1){this.primaryId=dn.from(e),this.primaryOptions=t,r&&(this.secondaryId=dn.from(r)),this.secondaryOptions=n,this.available=i}toString(){return this.primaryId&&this.secondaryId?`[${this.primaryId.name},${this.secondaryId.name}]`:this.primaryId.name}hasPrimary(){return!!this.primaryId}getPrimary(){return new qn(this.primaryId,this.primaryOptions)}hasSecondary(){return!!this.secondaryId}getSecondary(){return this.secondaryId?new qn(this.secondaryId,this.secondaryOptions):null}static from(e){return"string"==typeof e?Hn.build({name:e}):e}static build(e,t,r,n){return!e||"object"==typeof e&&!("name"in e)?null:new Hn(e,r,t,n)}}function Xn(e,t,r,n){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[e,t,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Zn(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof yn)return!0;if(e instanceof jn)return!0;if(e instanceof $n)return!0;if(e instanceof Hn)return!0;if(Array.isArray(e)){for(const t of e)if(!Zn(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!Zn(e[t]))return!1;return!0}return!1}function Wn(e){if(null===e)return Mn;if("string"==typeof e)return Bn;if("boolean"==typeof e)return Pn;if("number"==typeof e)return Sn;if(e instanceof yn)return Tn;if(e instanceof jn)return Fn;if(e instanceof $n)return Vn;if(e instanceof Hn)return Dn;if(Array.isArray(e)){const t=e.length;let r;for(const t of e){const e=Wn(t);if(r){if(r===e)continue;r=kn;break}r=e}return En(r||kn,t)}return zn}function Yn(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof $n||e instanceof Hn||e instanceof yn?e.toString():JSON.stringify(e)}class Jn{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Zn(e[1]))return t.error("invalid value");const r=e[1];let n=Wn(r);const i=t.expectedType;return"array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new Jn(n,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof yn?["rgba"].concat(this.value.toNonPremultipliedRenderColor(null).toArray()):this.value instanceof $n?this.value.serialize():this.value}}class Kn{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const Qn={string:Bn,number:Sn,boolean:Pn,object:zn};class ei{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at l