mapbox-gl
Version:
A WebGL interactive maps library
11 lines (8 loc) • 1.77 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';
let shared,worker,mapboxgl;function define(o,e){if(!shared)shared=e;else if(!worker)worker=e;else{const r={};shared(r),mapboxgl=e(r);const n="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+")(undefined, sharedChunk); self.onerror = null;";typeof window<"u"&&window&&window.URL&&window.URL.createObjectURL&&(mapboxgl.workerUrl=window.URL.createObjectURL(new Blob([n],{type:"text/javascript"})))}}
define(["exports"],function(e){var t=1e-6,r="undefined"!=typeof Float32Array?Float32Array:Array;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(){var e=new r(9);return r!=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 s(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 a(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 o(){var e=new r(16);return r!=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 l(e){var t=new r(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function u(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 c(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 h(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 d(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 p(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 f(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 m(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 y(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 g(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 x(e,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<t?null:(o*=c=1/c,l*=c,u*=c,i=Math.sin(r),s=Math.cos(r),e[0]=o*o*(a=1-s)+s,e[1]=l*o*a+u*i,e[2]=u*o*a-l*i,e[3]=0,e[4]=o*l*a-u*i,e[5]=l*l*a+s,e[6]=u*l*a+o*i,e[7]=0,e[8]=o*u*a+l*i,e[9]=l*u*a-o*i,e[10]=u*u*a+s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function v(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 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 w=h;function _(){var e=new r(3);return r!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function A(e){var t=new r(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function I(e){var t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)}function M(e,t,n){var i=new r(3);return i[0]=e,i[1]=t,i[2]=n,i}function S(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}function B(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function P(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function T(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function z(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 k(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 F(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function V(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 D(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(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 C(e){var t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}function R(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function L(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 O(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function U(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 N(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 G(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 $(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 q(e){return e[0]=0,e[1]=0,e[2]=0,e}function H(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}var X=P,Z=T,W=I;function Y(){var e=new r(4);return r!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function J(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 K(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 Q(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function ee(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 te(){var e=new r(4);return r!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function re(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function ne(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 ie(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}_(),Y();var se,ae,oe,le=K,ue=(se=_(),ae=M(1,0,0),oe=M(0,1,0),function(e,t,r){var n=O(t,r);return n<-.999999?(U(se,ae,t),W(se)<1e-6&&U(se,oe,t),L(se,se),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,se,Math.PI),e):n>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(U(se,t,r),e[0]=se[0],e[1]=se[1],e[2]=se[2],e[3]=1+n,le(e,e))});function ce(){var e=new r(2);return r!=Float32Array&&(e[0]=0,e[1]=0),e}function he(e,t){var n=new r(2);return n[0]=e,n[1]=t,n}function de(e,t,r){return e[0]=t,e[1]=r,e}function pe(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e}function fe(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e}function me(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e}function ye(e){var t=e[0],r=e[1];return Math.sqrt(t*t+r*r)}function ge(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 xe(e,t){return e[0]*t[0]+e[1]*t[1]}te(),te(),i();var ve,be,we=fe;function _e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}ce();var Ae=function(){if(be)return ve;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 be=1,ve=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))}},ve}(),Ie=_e(Ae);function Me(e,t){this.x=e,this.y=t;}function Se(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(!Se(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(!Se(e[r],t[r]))return !1;return !0}return e===t}Me.prototype={clone(){return new Me(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:Me},Me.convert=function(e){if(e instanceof Me)return e;if(Array.isArray(e))return new Me(+e[0],+e[1]);if(void 0!==e.x&&void 0!==e.y)return new Me(+e.x,+e.y);throw new Error("Expected [x, y] or {x, y} point format")};const Be=Math.PI/180,Pe=180/Math.PI;function Te(e){return e*Be}function ze(e){return e*Pe}const ke=[[0,0],[1,0],[1,1],[0,1]];function Fe(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 Ve(e,t,r,n){const i=new Ie(e,t,r,n);return function(e){return i.solve(e)}}const De=Ve(.25,.1,.25,1);function Ee(e,t,r){return Math.min(r,Math.max(t,e))}function Ce(e,t,r){return (r=Ee((r-e)/(t-e),0,1))*r*(3-2*r)}function Re(e,t,r){const n=r-t,i=((e-t)%n+n)%n+t;return i===t?r:i}function Le(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);});});}let Oe=1;function Ue(){return Oe++}function Ne(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log2(e)))}function je(e,t){e.forEach(e=>{t[e]&&(t[e]=t[e].bind(t));});}function Ge(e,t,r){const n={};for(const r in e)n[r]=t.call(this,e[r],r,e);return n}function $e(e,t,r){const n={};for(const r in e)t.call(this,e[r],r,e)&&(n[r]=e[r]);return n}function qe(e){return Array.isArray(e)?e.map(qe):"object"==typeof e&&e?Ge(e,qe):e}function He(e,t){for(let r=0;r<e.length;r++)if(t.indexOf(e[r])>=0)return !0;return !1}const Xe={};function Ze(e){Xe[e]||("undefined"!=typeof console&&console.warn(e),Xe[e]=!0);}function We(e,t,r){return (r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function Ye(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 Je([e,t,r]){const n=Te(t+90),i=Te(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 Ke(e){return ("undefined"!=typeof self||void 0!==e)&&"undefined"!=typeof WorkerGlobalScope&&(void 0!==e?e:self)instanceof WorkerGlobalScope}function Qe(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}let et,tt=null;function rt(e,t){return [e[4*t],e[4*t+1],e[4*t+2],e[4*t+3]]}function nt(e,t,r,n){for(;t<r;){const i=t+r>>1;e[i]<n?t=i+1:r=i;}return t}function it(e,t,r,n){for(;t<r;){const i=t+r>>1;e[i]<=n?t=i+1:r=i;}return t}function st(e){return e>0?1/(1.001-e):1+e}function at(e){return e>0?1-1/(1.001-e):-e}function ot(e,t,r){return (e-t.min)*(r.max-r.min)/(t.max-t.min)+r.min}const lt={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(!lt.API_URL)return null;try{const e=new URL(lt.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 ut(){return new URL(lt.DRACO_URL,lt.API_URL).href}function ct(){if("object"!=typeof WebAssembly)throw new Error("WebAssembly not supported, cannot instantiate meshoptimizer");return new URL(function(){if(void 0===et){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]);et=WebAssembly.validate(e);}return et}()?lt.MESHOPT_SIMD_URL:lt.MESHOPT_URL,lt.API_URL).href}function ht(){return new URL(lt.BUILDING_GEN_URL,lt.API_URL).href}function dt(e){return lt.API_URL_REGEX.test(e)}function pt(e){return lt.API_SPRITE_REGEX.test(e)}let ft,mt,yt,gt,xt,vt;function bt(){return null==ft&&(ft=self.OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),ft}const wt={now:()=>void 0!==gt?gt:performance.now(),setNow(e){gt=e;},restoreNow(){gt=void 0;},frame(e){const t=requestAnimationFrame(e);return {cancel:()=>cancelAnimationFrame(t)}},getImageData(e,t=0){const{width:r,height:n}=e;xt||(xt=document.createElement("canvas"));const i=xt.getContext("2d",{willReadFrequently:!0});if(!i)throw new Error("failed to create canvas 2d context");return (r>xt.width||n>xt.height)&&(xt.width=r,xt.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=>(mt||(mt=document.createElement("a")),mt.href=e,mt.href),get devicePixelRatio(){return window.devicePixelRatio},get prefersReducedMotion(){return !!window.matchMedia&&(null==yt&&(yt=window.matchMedia("(prefers-reduced-motion: reduce)")),yt.matches)},hasCanvasFingerprintNoise(){if(void 0!==vt)return vt;if(!bt())return vt=!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 vt=!0,!0;return vt=!1,!1}};function _t(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 At(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 It="mapbox-tiles";let Mt=500,St=50;const Bt=["language","worldview","jobid"];let Pt;function Tt(){try{return caches}catch(e){}}function zt(){const e=Tt();e&&null==Pt&&(Pt=e.open(It));}let kt=1/0;const Ft={supported:!1,testSupport:function(e){!Et&&Dt&&(Ct?Lt(e):Vt=e);}};let Vt,Dt,Et=!1,Ct=!1;const Rt="undefined"!=typeof self?self:{};function Lt(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,Dt),e.isContextLost())return;Ft.supported=!0;}catch(e){}e.deleteTexture(t),Et=!0;}Rt.document&&(Dt=Rt.document.createElement("img"),Dt.onload=function(){Vt&&Lt(Vt),Vt=null,Ct=!0;},Dt.onerror=function(){Et=!0,Vt=null;},Dt.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const Ot={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Iconset:"Iconset",Image:"Image",Model:"Model"};Object.freeze(Ot);class Ut extends Error{constructor(e,t,r){401===t&&dt(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 Nt(e){return "object"==typeof e&&null!==e&&"status"in e&&404===e.status}const jt=Ke()?()=>self.worker.referrer:()=>("blob:"===location.protocol?parent:self).location.href;const Gt=function(e,t){return /^file:/.test(r=e.url)||/^file:/.test(jt())&&!/^\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 Ut(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:jt(),referrerPolicy:e.referrerPolicy,signal:r.signal});let i=!1,s=!1;const a=(o=n.url).indexOf("sku=")>0&&dt(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&&Ze(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 Ut(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(zt(),null==Pt)return;const n=Qe(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=At(e.url,{persistentParams:Bt});if(206===t.status){const t=e.headers.get("Range");if(!t)return;i.status=200,a=_t(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;zt(),null!=Pt&&Pt.then(e=>e.put(a,o)).catch(e=>Ze(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(zt(),null==Pt)return t(null);Pt.then(r=>{let n=At(e.url,{persistentParams:Bt});const i=e.headers.get("Range");i&&(n=_t(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=Qe(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;},$t=function(e,t){return Gt(Object.assign(e,{type:"arrayBuffer"}),t)};function qt(e){const t=document.createElement("a");return t.href=e,t.protocol===location.protocol&&t.host===location.host}let Ht,Xt;Ht=[],Xt=0;const Zt=function(e,t){if(Ft.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),Xt>=lt.MAX_PARALLEL_IMAGE_REQUESTS){const r={requestParameters:e,callback:t,cancelled:!1,cancel(){this.cancelled=!0;}};return Ht.push(r),r}Xt++;let r=!1;const n=()=>{if(!r)for(r=!0,Xt--;Ht.length&&Xt<lt.MAX_PARALLEL_IMAGE_REQUESTS;){const e=Ht.shift(),{requestParameters:t,callback:r,cancelled:n}=e;n||(e.cancel=Zt(t,r).cancel);}},i=$t(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();}}};var Wt,Yt,Jt,Kt={exports:{}},Qt={exports:{}},er={exports:{}},tr=function(){if(Jt)return Kt.exports;Jt=1;var e=(Wt||(Wt=1,Qt.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}),Qt.exports),t=(Yt||(Yt=1,er.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}),er.exports);return Kt.exports=e,Kt.exports.murmur3=e,Kt.exports.murmur2=t,Kt.exports}(),rr=_e(tr);class nr{constructor(e,...t){Object.assign(this,t[0]||{}),this.type=e;}}class ir extends nr{constructor(e,t={}){super("error",Object.assign({error:e},t));}}function sr(e,t,r){r[e]&&-1!==r[e].indexOf(t)||(r[e]=r[e]||[],r[e].push(t));}function ar(e,t,r){if(r&&r[e]){const n=r[e].indexOf(t);-1!==n&&r[e].splice(n,1);}}class or{on(e,t){return this._listeners=this._listeners||{},sr(e,t,this._listeners),this}off(e,t){return ar(e,t,this._listeners),ar(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners=this._oneTimeListeners||{},sr(e,t,this._oneTimeListeners),this):new Promise(t=>{this.once(e,t);})}fire(e,t){const r="string"==typeof e?new nr(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)ar(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 ir&&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 lr{constructor(e){"string"==typeof e?this.name=e:(this.name=e.name,this.iconsetId=e.iconsetId);}static from(e){return new lr(e)}static toString(e){return e.iconsetId?`${e.name}${e.iconsetId}`:e.name}static parse(e){const[t,r]=e.split("");return new lr({name:t,iconsetId:r})}static isEqual(e,t){return e.name===t.name&&e.iconsetId===t.iconsetId}toString(){return lr.toString(this)}serialize(){return {name:this.name,iconsetId:this.iconsetId}}}var ur,cr={},hr=function(){if(ur)return cr;ur=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{cr.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 cr}();class dr{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 dr)return e;if("string"!=typeof e)return;const t=hr.parseCSSColor(e);return t?new dr(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 fr(e,t,r,n,i)}toPremultipliedRenderColor(e){const{r:t,g:r,b:n,a:i}=this;return new mr(e,t*i,r*i,n*i,i)}clone(){return new dr(this.r,this.g,this.b,this.a)}}class pr{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=yr(yr(yr(y[g],y[x],m),yr(y[v],y[b],m),f),yr(yr(y[w],y[_],m),yr(y[A],y[I],m),f),p)/255*(this.premultiplied?i:1),this.g=yr(yr(yr(y[g+1],y[x+1],m),yr(y[v+1],y[b+1],m),f),yr(yr(y[w+1],y[_+1],m),yr(y[A+1],y[I+1],m),f),p)/255*(this.premultiplied?i:1),this.b=yr(yr(yr(y[g+2],y[x+2],m),yr(y[v+2],y[b+2],m),f),yr(yr(y[w+2],y[_+2],m),yr(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 fr extends pr{constructor(e,t,r,n,i){super(e,t,r,n,i,!1);}}class mr extends pr{constructor(e,t,r,n,i){super(e,t,r,n,i,!0);}}function yr(e,t,r){return e*(1-r)+t*r}function gr(e,t,r){return e.map((e,n)=>yr(e,t[n],r))}dr.black=new dr(0,0,0,1),dr.white=new dr(1,1,1,1),dr.transparent=new dr(0,0,0,0),dr.red=new dr(1,0,0,1),dr.blue=new dr(0,0,1,1);var xr=Object.freeze({__proto__:null,array:gr,color:function(e,t,r){return new dr(yr(e.r,t.r,r),yr(e.g,t.g,r),yr(e.b,t.b,r),yr(e.a,t.a,r))},number:yr});class vr extends Error{constructor(e,t){super(t),this.message=t,this.key=e;}}class br{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[e,r]of t)this.bindings[e]=r;}concat(e){return new br(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 wr={kind:"null"},_r={kind:"number"},Ar={kind:"string"},Ir={kind:"boolean"},Mr={kind:"color"},Sr={kind:"object"},Br={kind:"value"},Pr={kind:"collator"},Tr={kind:"formatted"},zr={kind:"resolvedImage"};function kr(e,t){return {kind:"array",itemType:e,N:t}}function Fr(e){if("array"===e.kind){const t=Fr(e.itemType);return "number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const Vr=[wr,_r,Ar,Ir,Mr,Tr,Sr,kr(Br),zr];function Dr(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!Dr(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 Vr)if(!Dr(e,t))return null}return `Expected ${Fr(e)} but found ${Fr(t)} instead.`}function Er(e,t){return t.some(t=>t.kind===e.kind)}function Cr(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 Rr(e,t){return "array"===e.kind&&"array"===t.kind?e.N===t.N&&Rr(e.itemType,t.itemType):e.kind===t.kind}class Lr{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 Or{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 Ur{constructor(e){this.sections=e;}static fromString(e){return new Ur([new Or(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 Ur?e:Ur.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 Nr{constructor(e,t={}){this.id=lr.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 Nr(t,{params:r,sx:n,sy:i}):null}scaleSelf(e,t=e){return this.sx*=e,this.sy*=t,this}}class jr{constructor(e,t,r,n,i=!1){this.primaryId=lr.from(e),this.primaryOptions=t,r&&(this.secondaryId=lr.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 Nr(this.primaryId,this.primaryOptions)}hasSecondary(){return !!this.secondaryId}getSecondary(){return this.secondaryId?new Nr(this.secondaryId,this.secondaryOptions):null}static from(e){return "string"==typeof e?jr.build({name:e}):e}static build(e,t,r,n){return !e||"object"==typeof e&&!("name"in e)?null:new jr(e,r,t,n)}}function Gr(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 $r(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 dr)return !0;if(e instanceof Lr)return !0;if(e instanceof Ur)return !0;if(e instanceof jr)return !0;if(Array.isArray(e)){for(const t of e)if(!$r(t))return !1;return !0}if("object"==typeof e){for(const t in e)if(!$r(e[t]))return !1;return !0}return !1}function qr(e){if(null===e)return wr;if("string"==typeof e)return Ar;if("boolean"==typeof e)return Ir;if("number"==typeof e)return _r;if(e instanceof dr)return Mr;if(e instanceof Lr)return Pr;if(e instanceof Ur)return Tr;if(e instanceof jr)return zr;if(Array.isArray(e)){const t=e.length;let r;for(const t of e){const e=qr(t);if(r){if(r===e)continue;r=Br;break}r=e;}return kr(r||Br,t)}return Sr}function Hr(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof Ur||e instanceof jr||e instanceof dr?e.toString():JSON.stringify(e)}class Xr{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(!$r(e[1]))return t.error("invalid value");const r=e[1];let n=qr(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 Xr(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 dr?["rgba"].concat(this.value.toNonPremultipliedRenderColor(null).toArray()):this.value instanceof Ur?this.value.serialize():this.value}}class Zr{constructor(e){this.name="ExpressionEvaluationError",this.message=e;}toJSON(){return this.message}}const Wr={string:Ar,number:_r,boolean:Ir,object:Sr};class Yr{constructor(e,t){this.type=e,this.args=t;}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r,n=1;const i=e[0];if("array"===i){let i,s;if(e.length>2){const r=e[1];if("string"!=typeof r||!(r in Wr)||"object"===r)return t.error('The item type argument of "array" must be one of string, number, boolean',1);i=Wr[r],n++;}else i=Br;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);s=e[2],n++;}r=kr(i,s);}else r=Wr[i];const s=[];for(;n<e.length;n++){const r=t.parse(e[n],n,Br);if(!r)return null;s.push(r);}return new Yr(r,s)}evaluate(e){for(let t=0;t<this.args.length;t++){const r=this.args[t].evaluate(e);if(!Dr(this.type,qr(r)))return r;if(t===this.args.length-1)throw new Zr(`The expression ${JSON.stringify(this.args[t].serialize())} evaluated to ${Fr(qr(r))} but was expected to be of type ${Fr(this.type)}.`)}return null}eachChild(e){this.args.forEach(e);}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=this.type,t=[e.kind];if("array"===e.kind){const r=e.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){t.push(r.kind);const n=e.N;("number"==typeof n||this.args.length>1)&&t.push(n);}}return t.concat(this.args.map(e=>e.serialize()))}}class Jr{constructor(e){this.type=Tr,this.sections=e;}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[1];if(!Array.isArray(r)&&"object"==typeof r)return t.error("First argument must be an image or text section.");const n=[];let i=!1;for(let r=1;r<=e.length-1;++r){const s=e[r];if(i&&"object"==typeof s&&!Array.isArray(s)){i=!1;let e=null;if(s["font-scale"]&&(e=t.parseObjectValue(s["font-scale"],r,"font-scale",_r),!e))return null;let a=null;if(s["text-font"]&&(a=t.parseObjectValue(s["text-font"],r,"text-font",kr(Ar)),!a))return null;let o=null;if(s["text-color"]&&(o=t.parseObjectValue(s["text-color"],r,"text-color",Mr),!o))return null;const l=n[n.length-1];l.scale=e,l.font=a,l.textColor=o;}else {const s=t.parse(e[r],r,Br);if(!s)return null;const a=s.type.kind;if("string"!==a&&"value"!==a&&"null"!==a&&"resolvedImage"!==a)return t.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 Jr(n)}evaluate(e){return new Ur(this.sections.map(t=>{const r=t.content.evaluate(e);return Rr(qr(r),zr)?new Or("",r,null,null,null):new Or(Hr(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)}))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor);}outputDefined(){return !1}serialize(){const e=["format"];for(const t of this.sections){e.push(t.content.serialize());const r={};t.scale&&(r["font-scale"]=t.scale.serialize()),t.font&&(r["text-font"]=t.font.serialize()),t.textColor&&(r["text-color"]=t.textColor.serialize()),e.push(r);}return e}}class Kr{constructor(e,t,r,n){this._imageWarnHistory={},this.type=zr,this.namePrimary=e,this.nameSecondary=t,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(e,t){if(e.length<2)return t.error("Expected two or more arguments.");let r=1;const n=[];function i(){if(r<e.length){const i=t.parse(e[r],r++,Ar);return i?(n.push({image:i,options:{}}),!0):(t.error(n.length?"Secondary image variant is not a string.":"No image name provided."),!1)}return !0}function s(){if(r<e.length){const s=e[r];if(null===(i=s)||"object"!=typeof i||Array.isArray(i))return !0;const a=s.params,o=s.iconset,l=t.concat(r);if(!a&&!o)return r++,!0;if(a){if("object"!=typeof a||a.constructor!==Object)return l.error('Image options "params" should be an object'),!1;const e={},t=l.concat(void 0,"params");for(const r in a){if(!r)return t.error("Image parameter name should be non-empty"),!1;const n=t.concat(void 0,r).parse(a[r],void 0,Mr,void 0,{typeAnnotation:"coerce"});if(!n)return !1;e[r]=n;}n[n.length-1].options.params=e;}if(o){if("object"!=typeof o||o.constructor!==Object)return l.error('Image options "iconset" should be an object'),!1;if(!o.id)return l.error('Image options "iconset" should have an "id" property'),!1;n[n.length-1].options.iconset=o;}return r++,!0}var i;return !0}for(let e=0;e<2;e++)if(!i()||!s())return;return new Kr(n[0].image,n[1]?n[1].image:void 0,n[0].options,n[1]?n[1].options:void 0)}evaluateParams(e,t){const r={};if(t){for(const n in t)if(t[n])try{r[n]=t[n].evaluate(e);}catch(e){continue}if(0!==Object.keys(r).length)return {params:r}}}evaluate(e){const t={name:this.namePrimary.evaluate(e),iconsetId:this.iconsetIdPrimary},r=this.nameSecondary?{name:this.nameSecondary.evaluate(e),iconsetId:this.iconsetIdSecondary}:void 0,n=jr.build(t,r,this.paramsPrimary?this.evaluateParams(e,this.paramsPrimary):void 0,this.paramsSecondary?this.evaluateParams(e,this.paramsSecondary):void 0);if(n&&e.availableImages){const t=n.getPrimary().id;if(n.available=e.availableImages.some(e=>lr.isEqual(e,t)),n.available){const t=n.getSecondary()?n.getSecondary().id:null;t&&(n.available=e.availableImages.some(e=>lr.isEqual(e,t)));}}return n}eachChild(e){if(e(this.namePrimary),this.paramsPrimary)for(const t in this.paramsPrimary)this.paramsPrimary[t]&&e(this.paramsPrimary[t]);if(this.nameSecondary&&(e(this.nameSecondary),this.paramsSecondary))for(const t in this.paramsSecondary)this.paramsSecondary[t]&&e(this.paramsSecondary[t]);}outputDefined(){return !1}serializeOptions(e,t){const r={};if(t&&(r.iconset={id:t}),e){r.params={};for(const t in e)e[t]&&(r.params[t]=e[t].serialize());}return Object.keys(r).length>0?r:void 0}serialize(){const e=["image",this.namePrimary.serialize()];if(this.paramsPrimary||this.iconsetIdPrimary){const t=this.serializeOptions(this.paramsPrimary,this.iconsetIdPrimary);t&&e.push(t);}if(this.nameSecondary&&(e.push(this.nameSecondary.serialize()),this.paramsSecondary||this.iconsetIdSecondary)){const t=this.serializeOptions(this.paramsSecondary,this.iconsetIdSecondary);t&&e.push(t);}return e}}function Qr(e){return tn(e)?"string":rn(e)?"number":nn(e)?"boolean":Array.isArray(e)?"array":null===e?"null":en(e)?"object":typeof e}function en(e){return null!=e&&!Array.isArray