mapbox-gl
Version:
A WebGL interactive maps library
31 lines (26 loc) • 1.56 MB
JavaScript
/* Mapbox GL JS is Copyright © 2020 Mapbox and subject to the Mapbox Terms of Service ((https://www.mapbox.com/legal/tos/). */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.mapboxgl = factory());
})(this, (function () { 'use strict';
/* eslint-disable */
var shared, worker, mapboxgl;
// define gets called three times: one for each chunk. we rely on the order
// they're imported to know which is which
function define(_, chunk) {
if (!shared) {
shared = chunk;
} else if (!worker) {
worker = chunk;
} else {
var workerBundleString = "self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; (" + shared + ")(sharedChunk); (" + worker + ")(sharedChunk); self.onerror = null;"
var sharedChunk = {};
shared(sharedChunk);
mapboxgl = chunk(sharedChunk);
if (typeof window !== 'undefined' && window && window.URL && window.URL.createObjectURL) {
mapboxgl.workerUrl = window.URL.createObjectURL(new Blob([workerBundleString], { type: 'text/javascript' }));
}
}
}
define(["exports"],(function(t){var e=1e-6,r="undefined"!=typeof Float32Array?Float32Array:Array;function n(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*s-i*n;return o?(t[0]=s*(o=1/o),t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null}function i(){var t=new r(9);return r!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function s(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],c=e[8];return t[0]=o*c-a*u,t[1]=i*u-n*c,t[2]=n*a-i*o,t[3]=a*l-s*c,t[4]=r*c-i*l,t[5]=i*s-r*a,t[6]=s*u-o*l,t[7]=n*l-r*u,t[8]=r*o-n*s,t}function o(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=r[0],f=r[1],d=r[2],m=r[3],y=r[4],g=r[5],x=r[6],v=r[7],b=r[8];return t[0]=p*n+f*o+d*u,t[1]=p*i+f*a+d*c,t[2]=p*s+f*l+d*h,t[3]=m*n+y*o+g*u,t[4]=m*i+y*a+g*c,t[5]=m*s+y*l+g*h,t[6]=x*n+v*o+b*u,t[7]=x*i+v*a+b*c,t[8]=x*s+v*l+b*h,t}function a(){var t=new r(16);return r!=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 l(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 u(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],c=e[8],h=e[9],p=e[10],f=e[11],d=e[12],m=e[13],y=e[14],g=e[15],x=r*a-n*o,v=r*l-i*o,b=r*u-s*o,w=n*l-i*a,_=n*u-s*a,A=i*u-s*l,M=c*m-h*d,I=c*y-p*d,S=c*g-f*d,z=h*y-p*m,k=h*g-f*m,P=p*g-f*y,E=x*P-v*k+b*z+w*S-_*I+A*M;return E?(t[0]=(a*P-l*k+u*z)*(E=1/E),t[1]=(i*k-n*P-s*z)*E,t[2]=(m*A-y*_+g*w)*E,t[3]=(p*_-h*A-f*w)*E,t[4]=(l*S-o*P-u*I)*E,t[5]=(r*P-i*S+s*I)*E,t[6]=(y*b-d*A-g*v)*E,t[7]=(c*A-p*b+f*v)*E,t[8]=(o*k-a*S+u*M)*E,t[9]=(n*S-r*k-s*M)*E,t[10]=(d*_-m*b+g*x)*E,t[11]=(h*b-c*_-f*x)*E,t[12]=(a*I-o*z-l*M)*E,t[13]=(r*z-n*I+i*M)*E,t[14]=(m*v-d*w-y*x)*E,t[15]=(c*w-h*v+p*x)*E,t):null}function c(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],m=e[12],y=e[13],g=e[14],x=e[15],v=r[0],b=r[1],w=r[2],_=r[3];return t[0]=v*n+b*a+w*h+_*m,t[1]=v*i+b*l+w*p+_*y,t[2]=v*s+b*u+w*f+_*g,t[3]=v*o+b*c+w*d+_*x,t[4]=(v=r[4])*n+(b=r[5])*a+(w=r[6])*h+(_=r[7])*m,t[5]=v*i+b*l+w*p+_*y,t[6]=v*s+b*u+w*f+_*g,t[7]=v*o+b*c+w*d+_*x,t[8]=(v=r[8])*n+(b=r[9])*a+(w=r[10])*h+(_=r[11])*m,t[9]=v*i+b*l+w*p+_*y,t[10]=v*s+b*u+w*f+_*g,t[11]=v*o+b*c+w*d+_*x,t[12]=(v=r[12])*n+(b=r[13])*a+(w=r[14])*h+(_=r[15])*m,t[13]=v*i+b*l+w*p+_*y,t[14]=v*s+b*u+w*f+_*g,t[15]=v*o+b*c+w*d+_*x,t}function h(t,e,r){var n,i,s,o,a,l,u,c,h,p,f,d,m=r[0],y=r[1],g=r[2];return e===t?(t[12]=e[0]*m+e[4]*y+e[8]*g+e[12],t[13]=e[1]*m+e[5]*y+e[9]*g+e[13],t[14]=e[2]*m+e[6]*y+e[10]*g+e[14],t[15]=e[3]*m+e[7]*y+e[11]*g+e[15]):(i=e[1],s=e[2],o=e[3],a=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],t[0]=n=e[0],t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=l,t[6]=u,t[7]=c,t[8]=h,t[9]=p,t[10]=f,t[11]=d,t[12]=n*m+a*y+h*g+e[12],t[13]=i*m+l*y+p*g+e[13],t[14]=s*m+u*y+f*g+e[14],t[15]=o*m+c*y+d*g+e[15]),t}function p(t,e,r){var n=r[0],i=r[1],s=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]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function f(t,e,r){var n=Math.sin(r),i=Math.cos(r),s=e[4],o=e[5],a=e[6],l=e[7],u=e[8],c=e[9],h=e[10],p=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]=s*i+u*n,t[5]=o*i+c*n,t[6]=a*i+h*n,t[7]=l*i+p*n,t[8]=u*i-s*n,t[9]=c*i-o*n,t[10]=h*i-a*n,t[11]=p*i-l*n,t}function d(t,e,r){var n=Math.sin(r),i=Math.cos(r),s=e[0],o=e[1],a=e[2],l=e[3],u=e[8],c=e[9],h=e[10],p=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]=s*i-u*n,t[1]=o*i-c*n,t[2]=a*i-h*n,t[3]=l*i-p*n,t[8]=s*n+u*i,t[9]=o*n+c*i,t[10]=a*n+h*i,t[11]=l*n+p*i,t}function m(t,e,r){var n=Math.sin(r),i=Math.cos(r),s=e[0],o=e[1],a=e[2],l=e[3],u=e[4],c=e[5],h=e[6],p=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]=s*i+u*n,t[1]=o*i+c*n,t[2]=a*i+h*n,t[3]=l*i+p*n,t[4]=u*i-s*n,t[5]=c*i-o*n,t[6]=h*i-a*n,t[7]=p*i-l*n,t}function y(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 g(t,r,n){var i,s,o,a=n[0],l=n[1],u=n[2],c=Math.hypot(a,l,u);return c<e?null:(a*=c=1/c,l*=c,u*=c,i=Math.sin(r),s=Math.cos(r),t[0]=a*a*(o=1-s)+s,t[1]=l*a*o+u*i,t[2]=u*a*o-l*i,t[3]=0,t[4]=a*l*o-u*i,t[5]=l*l*o+s,t[6]=u*l*o+a*i,t[7]=0,t[8]=a*u*o+l*i,t[9]=l*u*o-a*i,t[10]=u*u*o+s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function x(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,l=i+i,u=r*o,c=n*o,h=n*a,p=i*o,f=i*a,d=i*l,m=s*o,y=s*a,g=s*l;return t[0]=1-h-d,t[1]=c+g,t[2]=p-y,t[3]=0,t[4]=c-g,t[5]=1-u-d,t[6]=f+m,t[7]=0,t[8]=p+y,t[9]=f-m,t[10]=1-u-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var v=c;function b(){var t=new r(3);return r!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function w(t){var e=new r(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function _(t){return Math.hypot(t[0],t[1],t[2])}function A(t,e,n){var i=new r(3);return i[0]=t,i[1]=e,i[2]=n,i}function M(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function I(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function S(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function z(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}function k(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}function P(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function E(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}function T(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function B(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function V(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function C(t,e){var r=e[0],n=e[1],i=e[2],s=r*r+n*n+i*i;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function F(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function D(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],l=r[2];return t[0]=i*l-s*a,t[1]=s*o-n*l,t[2]=n*a-i*o,t}function L(t,e,r,n){var i=e[0],s=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t}function R(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[3]*n+r[7]*i+r[11]*s+r[15];return t[0]=(r[0]*n+r[4]*i+r[8]*s+r[12])/(o=o||1),t[1]=(r[1]*n+r[5]*i+r[9]*s+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*s+r[14])/o,t}function O(t,e,r){var n=e[0],i=e[1],s=e[2];return t[0]=n*r[0]+i*r[3]+s*r[6],t[1]=n*r[1]+i*r[4]+s*r[7],t[2]=n*r[2]+i*r[5]+s*r[8],t}function U(t,e,r){var n=r[0],i=r[1],s=r[2],o=e[0],a=e[1],l=e[2],u=i*l-s*a,c=s*o-n*l,h=n*a-i*o,p=i*h-s*c,f=s*u-n*h,d=n*c-i*u,m=2*r[3];return c*=m,h*=m,f*=2,d*=2,t[0]=o+(u*=m)+(p*=2),t[1]=a+c+f,t[2]=l+h+d,t}function N(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}var j=I,$=S,G=_;function q(){var t=new r(4);return r!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function H(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 X(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*r+n*n+i*i+s*s;return o>0&&(o=1/Math.sqrt(o)),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=s*o,t}function Z(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*s+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*s+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*s+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*s+r[15]*o,t}function W(){var t=new r(4);return r!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Y(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function K(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),l=Math.cos(r);return t[0]=n*l+o*a,t[1]=i*l+s*a,t[2]=s*l-i*a,t[3]=o*l-n*a,t}function J(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),l=Math.cos(r);return t[0]=n*l-s*a,t[1]=i*l+o*a,t[2]=s*l+n*a,t[3]=o*l-i*a,t}b(),q();var Q,tt,et,rt,nt,it=X,st=(Q=b(),tt=A(1,0,0),et=A(0,1,0),function(t,e,r){var n=F(e,r);return n<-.999999?(D(Q,tt,e),G(Q)<1e-6&&D(Q,et,e),C(Q,Q),function(t,e,r){r*=.5;var n=Math.sin(r);t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r);}(t,Q,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(D(Q,e,r),t[0]=Q[0],t[1]=Q[1],t[2]=Q[2],t[3]=1+n,it(t,t))});function ot(){var t=new r(2);return r!=Float32Array&&(t[0]=0,t[1]=0),t}function at(t,e){var n=new r(2);return n[0]=t,n[1]=e,n}function lt(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function ut(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function ct(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function ht(t){return Math.hypot(t[0],t[1])}function pt(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function ft(t,e){return t[0]*e[0]+t[1]*e[1]}function dt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}W(),W(),i(),ot();var mt,yt,gt=function(){if(nt)return rt;function t(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;}return nt=1,rt=t,t.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(void 0===e&&(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 s=this.sampleCurveDerivativeX(r);if(Math.abs(s)<1e-6)break;r-=i/s;}var o=0,a=1;for(r=t,n=0;n<20&&(i=this.sampleCurveX(r),!(Math.abs(i-t)<e));n++)t>i?o=r:a=r,r=.5*(a-o)+o;return r},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},rt}(),xt=dt(gt);function vt(){if(yt)return mt;function t(t,e){this.x=t,this.y=e;}return yt=1,mt=t,t.prototype={clone:function(){return new t(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[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,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=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=n,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-n*(this.y-e.y),this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},t.convert=function(e){return e instanceof t?e:Array.isArray(e)?new t(e[0],e[1]):e},mt}var bt=dt(vt());function wt(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return !1;for(let r=0;r<t.length;r++)if(!wt(t[r],e[r]))return !1;return !0}if("object"==typeof t&&null!==t&&null!==e){if("object"!=typeof e)return !1;if(Object.keys(t).length!==Object.keys(e).length)return !1;for(const r in t)if(!wt(t[r],e[r]))return !1;return !0}return t===e}const _t=Math.PI/180,At=180/Math.PI;function Mt(t){return t*_t}function It(t){return t*At}const St=[[0,0],[1,0],[1,1],[0,1]];function zt(t){if(t<=0)return 0;if(t>=1)return 1;const e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function kt(t,e,r,n){const i=new xt(t,e,r,n);return function(t){return i.solve(t)}}const Pt=kt(.25,.1,.25,1);function Et(t,e,r){return Math.min(r,Math.max(e,t))}function Tt(t,e,r){return (r=Et((r-t)/(e-t),0,1))*r*(3-2*r)}function Bt(t,e,r){const n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function Vt(t,e,r){if(!t.length)return r(null,[]);let n=t.length;const i=new Array(t.length);let s=null;t.forEach(((t,o)=>{e(t,((t,e)=>{t&&(s=t),i[o]=e,0==--n&&r(s,i);}));}));}function Ct(t,...e){for(const r of e)for(const e in r)t[e]=r[e];return t}let Ft=1;function Dt(){return Ft++}function Lt(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function Rt(t,e){t.forEach((t=>{e[t]&&(e[t]=e[t].bind(e));}));}function Ot(t,e,r){const n={};for(const r in t)n[r]=e.call(this,t[r],r,t);return n}function Ut(t,e,r){const n={};for(const r in t)e.call(this,t[r],r,t)&&(n[r]=t[r]);return n}function Nt(t){return Array.isArray(t)?t.map(Nt):"object"==typeof t&&t?Ot(t,Nt):t}function jt(t,e){for(let r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return !0;return !1}const $t={};function Gt(t){$t[t]||("undefined"!=typeof console&&console.warn(t),$t[t]=!0);}function qt(t,e,r){return (r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function Ht(t){let e=0;for(let r,n,i=0,s=t.length,o=s-1;i<s;o=i++)r=t[i],n=t[o],e+=(n.x-r.x)*(r.y+n.y);return e}function Xt([t,e,r]){const n=Mt(e+90),i=Mt(r);return {x:t*Math.cos(n)*Math.sin(i),y:t*Math.sin(n)*Math.sin(i),z:t*Math.cos(i),azimuthal:e,polar:r}}function Zt(t){return ("undefined"!=typeof self||void 0!==t)&&"undefined"!=typeof WorkerGlobalScope&&(void 0!==t?t:self)instanceof WorkerGlobalScope}function Wt(t){const e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((t,r,n,i)=>{const s=n||i;return e[r]=!s||s.toLowerCase(),""})),e["max-age"]){const t=parseInt(e["max-age"],10);isNaN(t)?delete e["max-age"]:e["max-age"]=t;}return e}let Yt=null;function Kt(t,e){return [t[4*e],t[4*e+1],t[4*e+2],t[4*e+3]]}function Jt(t,e,r,n){for(;e<r;){const i=e+r>>1;t[i]<n?e=i+1:r=i;}return e}function Qt(t,e,r,n){for(;e<r;){const i=e+r>>1;t[i]<=n?e=i+1:r=i;}return e}function te(t){return t>0?1/(1.001-t):1+t}function ee(t){return t>0?1-1/(1.001-t):-t}function re(t,e,r){return (t-e.min)*(r.max-r.min)/(e.max-e.min)+r.min}const ne={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(!ne.API_URL)return null;try{const t=new URL(ne.API_URL);return "api.mapbox.cn"===t.hostname?"https://events.mapbox.cn/events/v2":"api.mapbox.com"===t.hostname?"https://events.mapbox.com/events/v2":null}catch(t){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:"https://api.mapbox.com/mapbox-gl-js/draco_decoder_gltf_v1.5.6.wasm",MESHOPT_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_base_v0.20.wasm",MESHOPT_SIMD_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_simd_v0.20.wasm",BUILDING_GEN_URL:"https://api.mapbox.com/mapbox-gl-js/building-gen/building_gen_v0.3.0.wasm",GLYPHS_URL:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf",TILES3D_URL_PREFIX:"3dtiles/v1"};function ie(t){return ne.API_URL_REGEX.test(t)}function se(t){return ne.API_SPRITE_REGEX.test(t)}let oe,ae,le,ue,ce,he;function pe(){return null==oe&&(oe=self.OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),oe}const fe={now:()=>void 0!==ue?ue:performance.now(),setNow(t){ue=t;},restoreNow(){ue=void 0;},frame(t){const e=requestAnimationFrame(t);return {cancel:()=>cancelAnimationFrame(e)}},getImageData(t,e=0){const{width:r,height:n}=t;ce||(ce=document.createElement("canvas"));const i=ce.getContext("2d",{willReadFrequently:!0});if(!i)throw new Error("failed to create canvas 2d context");return (r>ce.width||n>ce.height)&&(ce.width=r,ce.height=n),i.clearRect(-e,-e,r+2*e,n+2*e),i.drawImage(t,0,0,r,n),i.getImageData(-e,-e,r+2*e,n+2*e)},resolveURL:t=>(ae||(ae=document.createElement("a")),ae.href=t,ae.href),get devicePixelRatio(){return window.devicePixelRatio},get prefersReducedMotion(){return !!window.matchMedia&&(null==le&&(le=window.matchMedia("(prefers-reduced-motion: reduce)")),le.matches)},hasCanvasFingerprintNoise(){if(void 0!==he)return he;if(!pe())return he=!1,!1;const t=new OffscreenCanvas(85,1),e=t.getContext("2d",{willReadFrequently:!0});let r=0;for(let n=0;n<t.width;++n)e.fillStyle=`rgba(${r++},${r++},${r++}, 255)`,e.fillRect(n,0,1,1);const n=e.getImageData(0,0,t.width,t.height);r=0;for(let t=0;t<n.data.length;++t)if(t%4!=3&&r++!==n.data[t])return he=!0,!0;return he=!1,!1}};function de(t,e){const r=t.indexOf("?");if(r<0)return `${t}?${new URLSearchParams(e).toString()}`;const n=new URLSearchParams(t.slice(r));for(const t in e)n.set(t,e[t]);return `${t.slice(0,r)}?${n.toString()}`}function me(t,e={persistentParams:[]}){const r=t.indexOf("?");if(r<0)return t;const n=new URLSearchParams,i=new URLSearchParams(t.slice(r));for(const t of e.persistentParams){const e=i.get(t);e&&n.set(t,e);}const s=n.toString();return `${t.slice(0,r)}${s.length>0?`?${s}`:""}`}const ye="mapbox-tiles";let ge=500,xe=50;const ve=["language","worldview","jobid"];let be,we;function _e(){try{return caches}catch(t){}}function Ae(){const t=_e();t&&null==be&&(be=t.open(ye));}let Me=1/0;const Ie={supported:!1,testSupport:function(t){!ke&&ze&&(Pe?Te(t):Se=t);}};let Se,ze,ke=!1,Pe=!1;const Ee="undefined"!=typeof self?self:{};function Te(t){const e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,ze),t.isContextLost())return;Ie.supported=!0;}catch(t){}t.deleteTexture(e),ke=!0;}Ee.document&&(ze=Ee.document.createElement("img"),ze.onload=function(){Se&&Te(Se),Se=null,Pe=!0;},ze.onerror=function(){ke=!0,Se=null;},ze.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const Be={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Iconset:"Iconset",Image:"Image",Model:"Model"};"function"==typeof Object.freeze&&Object.freeze(Be);class Ve extends Error{constructor(t,e,r){401===e&&ie(r)&&(t+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(t),this.status=e,this.url=r;}toString(){return `${this.name}: ${this.message} (${this.status}): ${this.url}`}}const Ce=Zt()?()=>self.worker.referrer:()=>("blob:"===location.protocol?parent:self).location.href;const Fe=function(t,e){if(!(/^file:/.test(r=t.url)||/^file:/.test(Ce())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&Request.prototype.hasOwnProperty("signal"))return function(t,e){const r=new AbortController,n=new Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:Ce(),referrerPolicy:t.referrerPolicy,signal:r.signal});let i=!1,s=!1;const o=(a=n.url).indexOf("sku=")>0&&ie(a);var a;"json"===t.type&&n.headers.set("Accept","application/json");const l=(r,i,a)=>{if(s)return;if(r&&"SecurityError"!==r.message&&Gt(r.toString()),i&&a)return u(i);const l=Date.now();fetch(n).then((r=>{if(r.ok){const t=o?r.clone():null;return u(r,t,l)}return e(new Ve(r.statusText,r.status,t.url))})).catch((r=>{"AbortError"!==r.name&&e(new Error(`${r.message} ${t.url}`));}));},u=(r,o,a)=>{("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((t=>{s||(o&&a&&function(t,e,r){if(Ae(),null==be)return;const n=Wt(e.headers.get("Cache-Control")||"");if(n["no-store"])return;const i={status:e.status,statusText:e.statusText,headers:new Headers};e.headers.forEach(((t,e)=>i.headers.set(e,t))),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 o=me(t.url,{persistentParams:ve});if(206===e.status){const e=t.headers.get("Range");if(!e)return;i.status=200,o=de(o,{range:e});}!function(t,e){if(void 0===we)try{new Response(new ReadableStream),we=!0;}catch(t){we=!1;}we?e(t.body):t.blob().then(e).catch((t=>Gt(t.message)));}(e,(t=>{const r=new Response(200!==(n=e.status)&&404!==n&&[101,103,204,205,304].includes(n)?null:t,i);var n;Ae(),null!=be&&be.then((t=>t.put(o,r))).catch((t=>Gt(t.message)));}));}(n,o,a),i=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")));})).catch((t=>{s||e(new Error(t.message));}));};return o?function(t,e){if(Ae(),null==be)return e(null);be.then((r=>{let n=me(t.url,{persistentParams:ve});const i=t.headers.get("Range");i&&(n=de(n,{range:i})),r.match(n).then((t=>{const i=function(t){if(!t)return !1;const e=new Date(t.headers.get("Expires")||0),r=Wt(t.headers.get("Cache-Control")||"");return Number(e)>Date.now()&&!r["no-cache"]}(t);r.delete(n).catch(e),i&&r.put(n,t.clone()).catch(e),e(null,t,i);})).catch(e);})).catch(e);}(n,l):l(null,null),{cancel:()=>{s=!0,i||r.abort();}}}(t,e);if(Zt(self)&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var r;return function(t,e){const r=new XMLHttpRequest;r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer");for(const e in t.headers)r.setRequestHeader(e,t.headers[e]);return "json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=()=>{e(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"===t.type)try{n=JSON.parse(r.response);}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"));}else e(new Ve(r.statusText,r.status,t.url));},r.send(t.body),{cancel:()=>r.abort()}}(t,e)},De=function(t,e){return Fe(Ct(t,{type:"arrayBuffer"}),e)};function Le(t){const e=document.createElement("a");return e.href=t,e.protocol===location.protocol&&e.host===location.host}const Re="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let Oe,Ue;Oe=[],Ue=0;const Ne=function(t,e){if(Ie.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),Ue>=ne.MAX_PARALLEL_IMAGE_REQUESTS){const r={requestParameters:t,callback:e,cancelled:!1,cancel(){this.cancelled=!0;}};return Oe.push(r),r}Ue++;let r=!1;const n=()=>{if(!r)for(r=!0,Ue--;Oe.length&&Ue<ne.MAX_PARALLEL_IMAGE_REQUESTS;){const t=Oe.shift(),{requestParameters:e,callback:r,cancelled:n}=t;n||(t.cancel=Ne(e,r).cancel);}},i=De(t,((t,r,i,s)=>{n(),t?e(t):r&&(self.createImageBitmap?function(t,e){const r=new Blob([new Uint8Array(t)],{type:"image/png"});createImageBitmap(r).then((t=>{e(null,t);})).catch((t=>{e(new Error(`Could not load image because of ${t.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`));}));}(r,((t,r)=>e(t,r,i,s))):function(t,e){const r=new Image;r.onload=()=>{e(null,r),URL.revokeObjectURL(r.src),r.onload=null,requestAnimationFrame((()=>{r.src=Re;}));},r.onerror=()=>e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const n=new Blob([new Uint8Array(t)],{type:"image/png"});r.src=t.byteLength?URL.createObjectURL(n):Re;}(r,((t,r)=>e(t,r,i,s))));}));return {cancel:()=>{i.cancel(),n();}}};var je,$e,Ge,qe={exports:{}},He={exports:{}},Xe={exports:{}},Ze=function(){if(Ge)return qe.exports;Ge=1;var t=(je||(je=1,He.exports=function(t,e){var r,n,i,s,o,a,l,u;for(n=t.length-(r=3&t.length),i=e,o=3432918353,a=461845907,u=0;u<n;)l=255&t.charCodeAt(u)|(255&t.charCodeAt(++u))<<8|(255&t.charCodeAt(++u))<<16|(255&t.charCodeAt(++u))<<24,++u,i=27492+(65535&(s=5*(65535&(i=(i^=l=(65535&(l=(l=(65535&l)*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(s>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&t.charCodeAt(u+2))<<16;case 2:l^=(255&t.charCodeAt(u+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(u)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295;}return i^=t.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}),He.exports),e=($e||($e=1,Xe.exports=function(t,e){for(var r,n=t.length,i=e^n,s=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(s)|(255&t.charCodeAt(++s))<<8|(255&t.charCodeAt(++s))<<16|(255&t.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&t.charCodeAt(s+2))<<16;case 2:i^=(255&t.charCodeAt(s+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(s)))+((1540483477*(i>>>16)&65535)<<16);}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}),Xe.exports);return qe.exports=t,qe.exports.murmur3=t,qe.exports.murmur2=e,qe.exports}(),We=dt(Ze);class Ye{constructor(t,...e){Ct(this,e[0]||{}),this.type=t;}}class Ke extends Ye{constructor(t,e={}){super("error",Ct({error:t},e));}}function Je(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e));}function Qe(t,e,r){if(r&&r[t]){const n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1);}}class tr{on(t,e){return this._listeners=this._listeners||{},Je(t,e,this._listeners),this}off(t,e){return Qe(t,e,this._listeners),Qe(t,e,this._oneTimeListeners),this}once(t,e){return e?(this._oneTimeListeners=this._oneTimeListeners||{},Je(t,e,this._oneTimeListeners),this):new Promise((e=>{this.once(t,e);}))}fire(t,e){const r="string"==typeof t?new Ye(t,e):t,n=r.type;if(this.listens(n)){r.target=this;const t=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];for(const e of t)e.call(this,r);const e=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];for(const t of e)Qe(n,t,this._oneTimeListeners),t.call(this,r);const i=this._eventedParent;i&&(Ct(r,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),i.fire(r));}else r instanceof Ke&&console.error(r.error);return this}listens(t){return !!(this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t))}setEventedParent(t,e){return this._eventedParent=t,this._eventedParentData=e,this}}class er{constructor(t){"string"==typeof t?this.name=t:(this.name=t.name,this.iconsetId=t.iconsetId);}static from(t){return new er(t)}static toString(t){return t.iconsetId?`${t.name}${t.iconsetId}`:t.name}static parse(t){const[e,r]=t.split("");return new er({name:e,iconsetId:r})}static isEqual(t,e){return t.name===e.name&&t.iconsetId===e.iconsetId}toString(){return er.toString(this)}serialize(){return {name:this.name,iconsetId:this.iconsetId}}}var rr,nr={},ir=function(){if(rr)return nr;rr=1;var t={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 e(t){return (t=Math.round(t))<0?0:t>255?255:t}function r(t){return e("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function n(t){return (e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e;}function i(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{nr.parseCSSColor=function(s){var o,a=s.replace(/ /g,"").toLowerCase();if(a in t)return t[a].slice();if("#"===a[0])return 4===a.length?(o=parseInt(a.substr(1),16))>=0&&o<=4095?[(3840&o)>>4|(3840&o)>>8,240&o|(240&o)>>4,15&o|(15&o)<<4,1]:null:7===a.length&&(o=parseInt(a.substr(1),16))>=0&&o<=16777215?[(16711680&o)>>16,(65280&o)>>8,255&o,1]:null;var l=a.indexOf("("),u=a.indexOf(")");if(-1!==l&&u+1===a.length){var c=a.substr(0,l),h=a.substr(l+1,u-(l+1)).split(","),p=1;switch(c){case "rgba":if(4!==h.length)return null;p=n(h.pop());case "rgb":return 3!==h.length?null:[r(h[0]),r(h[1]),r(h[2]),p];case "hsla":if(4!==h.length)return null;p=n(h.pop());case "hsl":if(3!==h.length)return null;var f=(parseFloat(h[0])%360+360)%360/360,d=n(h[1]),m=n(h[2]),y=m<=.5?m*(d+1):m+d-m*d,g=2*m-y;return [e(255*i(g,y,f+1/3)),e(255*i(g,y,f)),e(255*i(g,y,f-1/3)),p];default:return null}}return null};}catch(t){}return nr}();class sr{constructor(t,e,r,n=1){this.r=t,this.g=e,this.b=r,this.a=n;}static parse(t){if(!t)return;if(t instanceof sr)return t;if("string"!=typeof t)return;const e=ir.parseCSSColor(t);return e?new sr(e[0]/255,e[1]/255,e[2]/255,e[3]):void 0}toString(){const[t,e,r,n]=[this.r,this.g,this.b,this.a];return `rgba(${Math.round(255*t)},${Math.round(255*e)},${Math.round(255*r)},${n})`}toNonPremultipliedRenderColor(t){const{r:e,g:r,b:n,a:i}=this;return new ar(t,e,r,n,i)}toPremultipliedRenderColor(t){const{r:e,g:r,b:n,a:i}=this;return new lr(t,e*i,r*i,n*i,i)}clone(){return new sr(this.r,this.g,this.b,this.a)}}class or{constructor(t,e,r,n,i,s=!1){if(this.premultiplied=!1,this.premultiplied=s,t){const s=t.image.height,o=s*s;this.premultiplied?(e=0===i?0:e/i*(s-1),r=0===i?0:r/i*(s-1),n=0===i?0:n/i*(s-1)):(e*=s-1,r*=s-1,n*=s-1);const a=Math.floor(e),l=Math.floor(r),u=Math.floor(n),c=Math.ceil(e),h=Math.ceil(r),p=Math.ceil(n),f=e-a,d=r-l,m=n-u,y=t.image.data,g=4*(a+l*o+u*s),x=4*(a+l*o+p*s),v=4*(a+h*o+u*s),b=4*(a+h*o+p*s),w=4*(c+l*o+u*s),_=4*(c+l*o+p*s),A=4*(c+h*o+u*s),M=4*(c+h*o+p*s);if(g<0||M>=y.length)throw new Error("out of range");this.r=ur(ur(ur(y[g],y[x],m),ur(y[v],y[b],m),d),ur(ur(y[w],y[_],m),ur(y[A],y[M],m),d),f)/255*(this.premultiplied?i:1),this.g=ur(ur(ur(y[g+1],y[x+1],m),ur(y[v+1],y[b+1],m),d),ur(ur(y[w+1],y[_+1],m),ur(y[A+1],y[M+1],m),d),f)/255*(this.premultiplied?i:1),this.b=ur(ur(ur(y[g+2],y[x+2],m),ur(y[v+2],y[b+2],m),d),ur(ur(y[w+2],y[_+2],m),ur(y[A+2],y[M+2],m),d),f)/255*(this.premultiplied?i:1),this.a=i;}else this.r=e,this.g=r,this.b=n,this.a=i;}toArray(){const{r:t,g:e,b:r,a:n}=this;return [255*t,255*e,255*r,n]}toHslaArray(){let{r:t,g:e,b:r,a:n}=this;if(this.premultiplied){if(0===n)return [0,0,0,0];t/=n,e/=n,r/=n;}const i=Math.min(Math.max(t,0),1),s=Math.min(Math.max(e,0),1),o=Math.min(Math.max(r,0),1),a=Math.min(i,s,o),l=Math.max(i,s,o),u=(a+l)/2;if(a===l)return [0,0,100*u,n];const c=l-a,h=u>.5?c/(2-l-a):c/(l+a);let p=0;return l===i?p=(s-o)/c+(s<o?6:0):l===s?p=(o-i)/c+2:l===o&&(p=(i-s)/c+4),p*=60,[Math.min(Math.max(p,0),360),Math.min(Math.max(100*h,0),100),Math.min(Math.max(100*u,0),100),n]}toArray01(){const{r:t,g:e,b:r,a:n}=this;return [t,e,r,n]}toArray01Scaled(t){const{r:e,g:r,b:n}=this;return [e*t,r*t,n*t]}toArray01Linear(){const{r:t,g:e,b:r,a:n}=this;return [Math.pow(t,2.2),Math.pow(e,2.2),Math.pow(r,2.2),n]}}class ar extends or{constructor(t,e,r,n,i){super(t,e,r,n,i,!1);}}class lr extends or{constructor(t,e,r,n,i){super(t,e,r,n,i,!0);}}function ur(t,e,r){return t*(1-r)+e*r}function cr(t,e,r){return t.map(((t,n)=>ur(t,e[n],r)))}sr.black=new sr(0,0,0,1),sr.white=new sr(1,1,1,1),sr.transparent=new sr(0,0,0,0),sr.red=new sr(1,0,0,1),sr.blue=new sr(0,0,1,1);var hr=Object.freeze({__proto__:null,array:cr,color:function(t,e,r){return new sr(ur(t.r,e.r,r),ur(t.g,e.g,r),ur(t.b,e.b,r),ur(t.a,e.a,r))},number:ur});function pr(t,...e){for(const r of e)for(const e in r)t[e]=r[e];return t}class fr extends Error{constructor(t,e){super(e),this.message=e,this.key=t;}}class dr{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[t,r]of e)this.bindings[t]=r;}concat(t){return new dr(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return !!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const mr={kind:"null"},yr={kind:"number"},gr={kind:"string"},xr={kind:"boolean"},vr={kind:"color"},br={kind:"object"},wr={kind:"value"},_r={kind:"collator"},Ar={kind:"formatted"},Mr={kind:"resolvedImage"};function Ir(t,e){return {kind:"array",itemType:t,N:e}}function Sr(t){if("array"===t.kind){const e=Sr(t.itemType);return "number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const zr=[mr,yr,gr,xr,vr,Ar,br,Ir(wr),Mr];function kr(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!kr(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else {if(t.kind===e.kind)return null;if("value"===t.kind)for(const t of zr)if(!kr(t,e))return null}return `Expected ${Sr(t)} but found ${Sr(e)} instead.`}function Pr(t,e){return e.some((e=>e.kind===t.kind))}function Er(t,e){return e.some((e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t))}function Tr(t,e){return "array"===t.kind&&"array"===e.kind?t.N===e.N&&Tr(t.itemType,e.itemType):t.kind===e.kind}class Br{constructor(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"});}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Vr{constructor(t,e,r,n,i){this.text=t.normalize?t.normalize():t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i;}}class Cr{constructor(t){this.sections=t;}static fromString(t){return new Cr([new Vr(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((t=>0!==t.text.length||!!t.image&&t.image.hasPrimary()))}static factory(t){return t instanceof Cr?t:Cr.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map((t=>t.text)).join("")}serialize(){const t=["format"];for(const e of this.sections){if(e.image){const r=e.image.getPrimary().id.toString();t.push(["image",r]);continue}t.push(e.text);const r={};e.fontStack&&(r["text-font"]=["literal",e.fontStack.split(",")]),e.scale&&(r["font-scale"]=e.scale),e.textColor&&(r["text-color"]=["rgba"].concat(e.textColor.toNonPremultipliedRenderColor(null).toArray())),t.push(r);}return t}}class Fr{constructor(t,e={}){if(this.id=er.from(t),this.options=Object.assign({},e),e.transform){const{a:t,b:r,c:n,d:i,e:s,f:o}=e.transform;this.options.transform=new DOMMatrix([t,r,n,i,s,o]);}else this.options.transform=new DOMMatrix([1,0,0,1,0,0]);}toString(){const{a:t,b:e,c:r,d:n,e:i,f:s}=this.options.transform;return JSON.stringify({name:this.id.name,iconsetId:this.id.iconsetId,params:this.options.params,transform:{a:t,b:e,c:r,d:n,e:i,f:s}})}static parse(t){let e,r,n,i;try{({name:e,iconsetId:r,params:n,transform:i}=JSON.parse(t)||{});}catch(t){return null}if(!e)return null;const{a:s,b:o,c:a,d:l,e:u,f:c}=i||{};return new Fr({name:e,iconsetId:r},{params:n,transform:new DOMMatrix([s,o,a,l,u,c])})}scaleSelf(t,e){return this.options.transform.scaleSelf(t,e),this}}class Dr{constructor(t,e,r,n,i=!1){this.primaryId=er.from(t),this.primaryOptions=e,r&&(this.secondaryId=er.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 Fr(this.primaryId,this.primaryOptions)}hasSecondary(){return !!this.secondaryId}getSecondary(){return this.secondaryId?new Fr(this.secondaryId,this.secondaryOptions):null}static from(t){return "string"==typeof t?Dr.build({name:t}):t}static build(t,e,r,n){return !t||"object"==typeof t&&!("name"in t)?null:new Dr(t,r,e,n)}}function Lr(t,e,r,n){return "number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Rr(t){if(null===t)return !0;if("string"==typeof t)return !0;if("boolean"==typeof t)return !0;if("number"==typeof t)return !0;if(t instanceof sr)return !0;if(t instanceof Br)return !0;if(t instanceof Cr)return !0;if(t instanceof Dr)return !0;if(Array.isArray(t)){for(const e of t)if(!Rr(e))return !1;return !0}if("object"==typeof t){for(const e in t)if(!Rr(t[e]))return !1;return !0}return !1}function Or(t){if(null===t)return mr;if("string"==typeof t)return gr;if("boolean"==typeof t)return xr;if("number"==typeof t)return yr;if(t instanceof sr)return vr;if(t instanceof Br)return _r;if(t instanceof Cr)return Ar;if(t instanceof Dr)return Mr;if(Array.isArray(t)){const e=t.length;let r;for(const e of t){const t=Or(e);if(r){if(r===t)continue;r=wr;break}r=t;}return Ir(r||wr,e)}return br}function Ur(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Cr||t instanceof Dr||t instanceof sr?t.toString():JSON.stringify(t)}class Nr{constructor(t,e){this.type=t,this.value=e;}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Rr(t[1]))return e.error("invalid value");const r=t[1];let n=Or(r);const i=e.expectedType;return "array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new Nr(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 sr?["rgba"].concat(this.value.toNonPremultipliedRenderColor(null).toArray()):this.value instanceof Cr?this.value.serialize():this.value}}class jr{constructor(t){this.name="ExpressionEvaluationError",this.message=t;}toJSON(){return this.message}}const $r={string:gr,number:yr,boolean:xr,object:br};class Gr{constructor(t,e){this.type=t,this.args=e;}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let r,n=1;const i=t[0];if("array"===i){let i,s;if(t.length>2){const r=t[1];if("string"!=typeof r||!(r in $r)||"object"===r)return e.error('The item type argument of "array" must be one of string, number, boolean',1);i=$r[r],n++;}else i=wr;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);s=t[2],n++;}r=Ir(i,s);}else r=$r[i];const s=[];for(;n<t.length;n++){const r=e.parse(t[n],n,wr);if(!r)return null;s.push(r);}return new Gr(r,s)}evaluate(t){for(let e=0;e<this.args.length;e++){const r=this.args[e].evaluate(t);if(!kr(this.type,Or(r)))return r;if(e===this.args.length-1)throw new jr(`The expression ${JSON.stringify(this.args[e].serialize())} evaluated to ${Sr(Or(r))} but was expected to be of type ${Sr(this.type)}.`)}return null}eachChild(t){this.args.forEach(t);}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=this.type,e=[t.kind];if("array"===t.kind){const r=t.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){e.push(r.kind);const n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n);}}return e.concat(this.args.map((t=>t.serialize())))}}class qr{constructor(t){this.type=Ar,this.sections=t;}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");const n=[];let i=!1;for(let r=1;r<=t.length-1;++r){const s=t[r];if(i&&"object"==typeof s&&!Array.isArray(s)){i=!1;let t=null;if(s["font-scale"]&&(t=e.parseObjectValue(s["font-scale"],r,"font-scale",yr),!t))return null;let o=null;if(s["text-font"]&&(o=e.parseObjectValue(s["text-font"],r,"text-font",Ir(gr)),!o))return null;let a=null;if(s["text-color"]&&(a=e.parseObjectValue(s["text-color"],r,"text-color",vr),!a))return null;const l=n[n.length-1];l.scale=t,l.font=o,l.textColor=a;}else {const s=e.parse(t[r],r,wr);if(!s)return null;const o=s.type.kind;if("string"!==o&&"value"!==o&&"null"!==o&&"resolvedImage"!==o)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:s,scale:null,font:null,textColor:null});}}return new qr(n)}evaluate(t){return new Cr(this.sections.map((e=>{const r=e.content.evaluate(t);return Tr(Or(r),Mr)?new Vr("",r,null,null,null):new Vr(Ur(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))}eachChild(t){for(const e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor);}outputDefined(){return !1}serialize(){const t=["format"];for(const e of this.sections){t.push(e.content.serialize());const r={};e.scale&&(r["font-scale"]=e.scale.serialize()),e.font&&(r["text-font"]=e.font.serialize()),e.textColor&&(r["text-color"]=e.textColor.serialize()),t.push(r);}return t}}class Hr{constructor(t,e,r,n){this._imageWarnHistory={},this.type=Mr,this.namePrimary=t,this.nameSecondary=e,r&&(this.paramsPrimary=r.params,this.iconsetIdPrimary=r.iconset?r.iconset.id:void 0),n&&(this.paramsSecondary=n.params,this.iconsetIdSecondary=n.iconset?n.iconset.id:void 0);}static parse(t,e){if(t.length<2)return e.error("Expected two or more arguments.");let r=1;const n=[];function i(){if(r<t.length){const i=e.parse(t[r],r++,gr);return i?(n.push({image:i,options:{}}),!0):(e.error(n.length?"Secondary image variant is not a string.":"No image name provided."),!1)}return !0}function s(){if(r<t.length){const s=t[r];if(null===(i=s)||"object"!=typeof i||Array.isArray(i))return !0;const o=s.params,a=s.iconset,l=e.concat(r);if(!o&&!a)return r++,!0;if(o){if("object"!=typeof o||o.constructor!==Object)return l.error('Image options "params" should be an object'),!1;const t={},e=l.concat(void 0,"params");for(const r in o){if(!r)return e.error("Image parameter name should be non-empty"),!1;const n=e.concat(void 0,r).parse(o[r],void 0,vr,void 0,{typeAnnotation:"coerce"});if(!n)return !1;t[r]=n;}n[n.length-1].options.params=t;}if(a){if("object"!=typeof a||a.constructor!==Object)return l.error('Image options "iconset" should be an object'),!1;if(!a.id)return l.error('Image options "iconset" should have an "id" property'),!1;n[n.length-1].options.iconset=a;}return r++,!0}var i;return !0}for(let t=0;t<2;t++)if(!i()||!s())return;return new Hr(n[0].image,n[1]?n[1].image:void 0,n[0].options,n[1]?n[1].options:void 0)}evaluateParams(t,e){const r={};if(e){for(const n in e)if(e[n])try{r[n]=e[n].evaluate(t);}catch(t){continue}if(0!==Object.keys(r).length)return {params:r}}}evaluate(t){const e={name:this.namePrimary.evaluate(t),iconsetId:this.iconsetIdPrimary},r=this.nameSecondary?{name:this.nameSecondary.evaluate(t),iconsetId:this.iconsetIdSecondary}:void 0,n=Dr.build(e,r,this.paramsPrimary?this.evaluateParams(t,this.paramsPrimary):void 0,this.paramsSecondary?this.evaluateParams(t,this.paramsSecondary):void 0);if(n&&t.availableImages){const e=n.getPrimary().id;if(n.available=t.availableImages.some((t=>er.isEqual(t,e))),n.available){const e=n.getSecondary()?n.getSecondary().id:null;e&&(n.available=t.availableImages.some((t=>er.isEqual(t,e))));}}return n}eachChild(t){if(t(this.namePrimary),this.paramsPrimary)for(const e in this.paramsPrimary)this.paramsPrimary[e]&&t(this.paramsPrimary[e]);if(this.nameSecondary&&(t(this.nameSecondary),this.paramsSecondary))for(const e in this.paramsSecondary)this.paramsSecondary[e]&&t(this.paramsSecondary[e]);}outputDefined()