@openremote/manager 1.30.0 → 1.31.0-snapshot.20260902153911
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6905,7 +6905,7 @@ or-vaadin-toggle-group::part(group-field) {
|
|
|
6905
6905
|
<slot name="submenu"></slot>
|
|
6906
6906
|
|
|
6907
6907
|
<slot name="tooltip"></slot>
|
|
6908
|
-
`}}(0,x.X)(ev);var eb=y(7027);function ey(v){return(ey=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)})(v)}function e_(){try{var v=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(v){}return(e_=function(){return!!v})()}function ex(v,b){return(ex=Object.setPrototypeOf||function(v,b){return v.__proto__=b,v})(v,b)}function ew(v){return v&&"u">typeof Symbol&&v.constructor===Symbol?"symbol":typeof v}function ek(v){var b=document.createElement("vaadin-menu-bar-item");return(0,_.XX)(v,b),b}var eA=function(v){if("function"!=typeof v&&null!==v)throw TypeError("Super expression must either be null or a function");function b(){var v,y;if(!(this instanceof b))throw TypeError("Cannot call a class as a function");return v=b,y=arguments,v=ey(v),function(v,b){if(b&&("object"===ew(b)||"function"==typeof b))return b;if(void 0===v)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return v}(this,e_()?Reflect.construct(v,y||[],ey(this).constructor):v.apply(this,y))}return b.prototype=Object.create(v&&v.prototype,{constructor:{value:b,writable:!0,configurable:!0}}),v&&ex(b,v),b}(ev);!function(v,b,y,_){var x,w=arguments.length,k=w<3?b:null===_?_=Object.getOwnPropertyDescriptor(b,y):_;if(("u"<typeof Reflect?"undefined":ew(Reflect))==="object"&&"function"==typeof Reflect.decorate)k=Reflect.decorate(v,b,y,_);else for(var A=v.length-1;A>=0;A--)(x=v[A])&&(k=(w<3?x(k):w>3?x(b,y,k):x(b,y))||k);w>3&&k&&Object.defineProperty(b,y,k)}([(0,eb.EM)("or-vaadin-menu-bar")],eA)},85746(v,b,y){"use strict";let _,x,w,k;y.d(b,{Ay:()=>r2,F0:()=>r1});var A,C,E,S,T={};function O(v,b){return function(){return v.apply(b,arguments)}}y.r(T),y.d(T,{hasBrowserEnv:()=>eG,hasStandardBrowserEnv:()=>eZ,hasStandardBrowserWebWorkerEnv:()=>eX,navigator:()=>eY,origin:()=>eK});let{toString:F}=Object.prototype,{getPrototypeOf:I}=Object,{iterator:M,toStringTag:R}=Symbol,D=(({hasOwnProperty:v})=>(b,y)=>v.call(b,y))(Object.prototype),P=(v,b)=>{let y=v,_=[];for(;null!=y&&y!==Object.prototype&&-1===_.indexOf(y);){if(_.push(y),D(y,b))return!0;y=I(y)}return!1},L=(_=Object.create(null),v=>{let b=F.call(v);return _[b]||(_[b]=b.slice(8,-1).toLowerCase())}),N=v=>(v=v.toLowerCase(),b=>L(b)===v),z=v=>b=>typeof b===v,{isArray:j}=Array,B=z("undefined");function U(v){return null!==v&&!B(v)&&null!==v.constructor&&!B(v.constructor)&&H(v.constructor.isBuffer)&&v.constructor.isBuffer(v)}let V=N("ArrayBuffer"),q=z("string"),H=z("function"),W=z("number"),G=v=>null!==v&&"object"==typeof v,Y=v=>{if(!G(v))return!1;let b=I(v);return(null===b||b===Object.prototype||null===I(b))&&!P(v,R)&&!P(v,M)},Z=N("Date"),X=N("File"),K=N("Blob"),J=N("FileList"),Q="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},ee=void 0!==Q.FormData?Q.FormData:void 0,et=N("URLSearchParams"),[en,ei,er,eo]=["ReadableStream","Request","Response","Headers"].map(N);function ea(v,b,{allOwnKeys:y=!1}={}){let _,x;if(null!=v)if("object"!=typeof v&&(v=[v]),j(v))for(_=0,x=v.length;_<x;_++)b.call(null,v[_],_,v);else{let x;if(U(v))return;let w=y?Object.getOwnPropertyNames(v):Object.keys(v),k=w.length;for(_=0;_<k;_++)x=w[_],b.call(null,v[x],x,v)}}function es(v,b){let y;if(U(v))return null;b=b.toLowerCase();let _=Object.keys(v),x=_.length;for(;x-- >0;)if(b===(y=_[x]).toLowerCase())return y;return null}let el="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,ec=v=>!B(v)&&v!==el,eu=(x="u">typeof Uint8Array&&I(Uint8Array),v=>x&&v instanceof x),ed=N("HTMLFormElement"),{propertyIsEnumerable:eh}=Object.prototype,ep=N("RegExp"),ef=(v,b)=>{let y=Object.getOwnPropertyDescriptors(v),_={};ea(y,(y,x)=>{let w;!1!==(w=b(y,x,v))&&(_[x]=w||y)}),Object.defineProperties(v,_)},em=N("AsyncFunction"),eg=(A="function"==typeof setImmediate,C=H(el.postMessage),A?setImmediate:C?(E=`axios@${Math.random()}`,S=[],el.addEventListener("message",({source:v,data:b})=>{v===el&&b===E&&S.length&&S.shift()()},!1),v=>{S.push(v),el.postMessage(E,"*")}):v=>setTimeout(v)),ev="u">typeof queueMicrotask?queueMicrotask.bind(el):"u">typeof process&&process.nextTick||eg,eb=v=>null!=v&&H(v[M]),ey={isArray:j,isArrayBuffer:V,isBuffer:U,isFormData:v=>{if(!v)return!1;if(ee&&v instanceof ee)return!0;let b=I(v);if(!b||b===Object.prototype||!H(v.append))return!1;let y=L(v);return"formdata"===y||"object"===y&&H(v.toString)&&"[object FormData]"===v.toString()},isArrayBufferView:function(v){let b;return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(v):v&&v.buffer&&V(v.buffer)},isString:q,isNumber:W,isBoolean:v=>!0===v||!1===v,isObject:G,isPlainObject:Y,isEmptyObject:v=>{if(!G(v)||U(v))return!1;try{return 0===Object.keys(v).length&&Object.getPrototypeOf(v)===Object.prototype}catch(v){return!1}},isReadableStream:en,isRequest:ei,isResponse:er,isHeaders:eo,isUndefined:B,isDate:Z,isFile:X,isReactNativeBlob:v=>!!(v&&void 0!==v.uri),isReactNative:v=>v&&void 0!==v.getParts,isBlob:K,isRegExp:ep,isFunction:H,isStream:v=>G(v)&&H(v.pipe),isURLSearchParams:et,isTypedArray:eu,isFileList:J,forEach:ea,merge:function v(...b){let{caseless:y,skipUndefined:_}=ec(this)&&this||{},x={},w=(b,w)=>{if("__proto__"===w||"constructor"===w||"prototype"===w)return;let k=y&&"string"==typeof w&&es(x,w)||w,A=D(x,k)?x[k]:void 0;Y(A)&&Y(b)?x[k]=v(A,b):Y(b)?x[k]=v({},b):j(b)?x[k]=b.slice():_&&B(b)||(x[k]=b)};for(let v=0,y=b.length;v<y;v++){let y=b[v];if(!y||U(y)||(ea(y,w),"object"!=typeof y||j(y)))continue;let _=Object.getOwnPropertySymbols(y);for(let v=0;v<_.length;v++){let b=_[v];eh.call(y,b)&&w(y[b],b)}}return x},extend:(v,b,y,{allOwnKeys:_}={})=>(ea(b,(b,_)=>{y&&H(b)?Object.defineProperty(v,_,{__proto__:null,value:O(b,y),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(v,_,{__proto__:null,value:b,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:_}),v),trim:v=>v.trim?v.trim():v.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:v=>(65279===v.charCodeAt(0)&&(v=v.slice(1)),v),inherits:(v,b,y,_)=>{v.prototype=Object.create(b.prototype,_),Object.defineProperty(v.prototype,"constructor",{__proto__:null,value:v,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(v,"super",{__proto__:null,value:b.prototype}),y&&Object.assign(v.prototype,y)},toFlatObject:(v,b,y,_)=>{let x,w,k,A={};if(b=b||{},null==v)return b;do{for(w=(x=Object.getOwnPropertyNames(v)).length;w-- >0;)k=x[w],(!_||_(k,v,b))&&!A[k]&&(b[k]=v[k],A[k]=!0);v=!1!==y&&I(v)}while(v&&(!y||y(v,b))&&v!==Object.prototype);return b},kindOf:L,kindOfTest:N,endsWith:(v,b,y)=>{v=String(v),(void 0===y||y>v.length)&&(y=v.length),y-=b.length;let _=v.indexOf(b,y);return -1!==_&&_===y},toArray:v=>{if(!v)return null;if(j(v))return v;let b=v.length;if(!W(b))return null;let y=Array(b);for(;b-- >0;)y[b]=v[b];return y},forEachEntry:(v,b)=>{let y,_=(v&&v[M]).call(v);for(;(y=_.next())&&!y.done;){let _=y.value;b.call(v,_[0],_[1])}},matchAll:(v,b)=>{let y,_=[];for(;null!==(y=v.exec(b));)_.push(y);return _},isHTMLForm:ed,hasOwnProperty:D,hasOwnProp:D,hasOwnInPrototypeChain:P,getSafeProp:(v,b)=>null!=v&&P(v,b)?v[b]:void 0,reduceDescriptors:ef,freezeMethods:v=>{ef(v,(b,y)=>{if(H(v)&&["arguments","caller","callee"].includes(y))return!1;if(H(v[y])){if(b.enumerable=!1,"writable"in b){b.writable=!1;return}b.set||(b.set=()=>{throw Error("Can not rewrite read-only method '"+y+"'")})}})},toObjectSet:(v,b)=>{let y={};return(j(v)?v:String(v).split(b)).forEach(v=>{y[v]=!0}),y},toCamelCase:v=>v.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(v,b,y){return b.toUpperCase()+y}),noop:()=>{},toFiniteNumber:(v,b)=>null!=v&&Number.isFinite(v*=1)?v:b,findKey:es,global:el,isContextDefined:ec,isSpecCompliantForm:function(v){return!!(v&&H(v.append)&&"FormData"===v[R]&&v[M])},toJSONObject:v=>{let b=new WeakSet,y=v=>{if(G(v)){if(b.has(v))return;if(U(v))return v;if(!("toJSON"in v)){b.add(v);let _=j(v)?[]:{};return ea(v,(v,b)=>{let x=y(v);B(x)||(_[b]=x)}),b.delete(v),_}}return v};return y(v)},isAsyncFn:em,isThenable:v=>v&&(G(v)||H(v))&&H(v.then)&&H(v.catch),setImmediate:eg,asap:ev,isIterable:eb,isSafeIterable:v=>null!=v&&P(v,M)&&eb(v)},e_=ey.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ex=RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),ew=RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function ek(v,b){return ey.isArray(v)?v.map(v=>ek(v,b)):function(v){let b=0,y=v.length;for(;b<y;){let y=v.charCodeAt(b);if(9!==y&&32!==y)break;b+=1}for(;y>b;){let b=v.charCodeAt(y-1);if(9!==b&&32!==b)break;y-=1}return 0===b&&y===v.length?v:v.slice(b,y)}(String(v).replace(b,""))}function eA(v){let b=Object.create(null);return ey.forEach(v.toJSON(),(v,y)=>{b[y]=ek(v,ew)}),b}let eC=Symbol("internals");function eE(v){return v&&String(v).trim().toLowerCase()}function eS(v){return!1===v||null==v?v:ey.isArray(v)?v.map(eS):ek(String(v),ex)}function eT(v,b,y,_,x){if(ey.isFunction(_))return _.call(this,b,y);if(x&&(b=y),ey.isString(b)){if(ey.isString(_))return -1!==b.indexOf(_);if(ey.isRegExp(_))return _.test(b)}}class eO{constructor(v){v&&this.set(v)}set(v,b,y){let _=this;function x(v,b,y){let x=eE(b);if(!x)return;let w=ey.findKey(_,x);w&&void 0!==_[w]&&!0!==y&&(void 0!==y||!1===_[w])||(_[w||b]=eS(v))}let w=(v,b)=>ey.forEach(v,(v,y)=>x(v,y,b));if(ey.isPlainObject(v)||v instanceof this.constructor)w(v,b);else{let _;if(ey.isString(v)&&(v=v.trim())&&(_=v,!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(_.trim()))){var k;let y,_,x,A;w((A={},(k=v)&&k.split("\n").forEach(function(v){x=v.indexOf(":"),y=v.substring(0,x).trim().toLowerCase(),_=v.substring(x+1).trim(),!y||A[y]&&e_[y]||("set-cookie"===y?A[y]?A[y].push(_):A[y]=[_]:A[y]=A[y]?A[y]+", "+_:_)}),A),b)}else if(ey.isObject(v)&&ey.isSafeIterable(v)){let y=Object.create(null),_,x;for(let b of v){if(!ey.isArray(b))throw TypeError("Object iterator must return a key-value pair");x=b[0],ey.hasOwnProp(y,x)?(_=y[x],y[x]=ey.isArray(_)?[..._,b[1]]:[_,b[1]]):y[x]=b[1]}w(y,b)}else null!=v&&x(b,v,y)}return this}get(v,b){if(v=eE(v)){let y=ey.findKey(this,v);if(y){let v=this[y];if(!b)return v;if(!0===b){let b,y=Object.create(null),_=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;b=_.exec(v);)y[b[1]]=b[2];return y}if(ey.isFunction(b))return b.call(this,v,y);if(ey.isRegExp(b))return b.exec(v);throw TypeError("parser must be boolean|regexp|function")}}}has(v,b){if(v=eE(v)){let y=ey.findKey(this,v);return!!(y&&void 0!==this[y]&&(!b||eT(this,this[y],y,b)))}return!1}delete(v,b){let y=this,_=!1;function x(v){if(v=eE(v)){let x=ey.findKey(y,v);x&&(!b||eT(y,y[x],x,b))&&(delete y[x],_=!0)}}return ey.isArray(v)?v.forEach(x):x(v),_}clear(v){let b=Object.keys(this),y=b.length,_=!1;for(;y--;){let x=b[y];(!v||eT(this,this[x],x,v,!0))&&(delete this[x],_=!0)}return _}normalize(v){let b=this,y={};return ey.forEach(this,(_,x)=>{let w=ey.findKey(y,x);if(w){b[w]=eS(_),delete b[x];return}let k=v?x.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(v,b,y)=>b.toUpperCase()+y):String(x).trim();k!==x&&delete b[x],b[k]=eS(_),y[k]=!0}),this}concat(...v){return this.constructor.concat(this,...v)}toJSON(v){let b=Object.create(null);return ey.forEach(this,(y,_)=>{null!=y&&!1!==y&&(b[_]=v&&ey.isArray(y)?y.join(", "):y)}),b}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([v,b])=>v+": "+b).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(v){return v instanceof this?v:new this(v)}static concat(v,...b){let y=new this(v);return b.forEach(v=>y.set(v)),y}static accessor(v){let b=(this[eC]=this[eC]={accessors:{}}).accessors,y=this.prototype;function _(v){let _=eE(v);if(!b[_]){let x;x=ey.toCamelCase(" "+v),["get","set","has"].forEach(b=>{Object.defineProperty(y,b+x,{__proto__:null,value:function(y,_,x){return this[b].call(this,v,y,_,x)},configurable:!0})}),b[_]=!0}}return ey.isArray(v)?v.forEach(_):_(v),this}}eO.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ey.reduceDescriptors(eO.prototype,({value:v},b)=>{let y=b[0].toUpperCase()+b.slice(1);return{get:()=>v,set(v){this[y]=v}}}),ey.freezeMethods(eO);class eF extends Error{static from(v,b,y,_,x,w){let k=new eF(v.message,b||v.code,y,_,x);return Object.defineProperty(k,"cause",{__proto__:null,value:v,writable:!0,enumerable:!1,configurable:!0}),k.name=v.name,null!=v.status&&null==k.status&&(k.status=v.status),w&&Object.assign(k,w),k}constructor(v,b,y,_,x){super(v),Object.defineProperty(this,"message",{__proto__:null,value:v,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,b&&(this.code=b),y&&(this.config=y),_&&(this.request=_),x&&(this.response=x,this.status=x.status)}toJSON(){let v,b,y,_=this.config,x=_&&ey.hasOwnProp(_,"redact")?_.redact:void 0,w=ey.isArray(x)&&x.length>0?(v=new Set(x.map(v=>String(v).toLowerCase())),b=[],(y=_=>{let x;if(null===_||"object"!=typeof _||ey.isBuffer(_))return _;if(-1===b.indexOf(_)){if(_ instanceof eO&&(_=_.toJSON()),b.push(_),ey.isArray(_))x=[],_.forEach((v,b)=>{let _=y(v);ey.isUndefined(_)||(x[b]=_)});else{if(!ey.isPlainObject(_)&&function(v){if(ey.hasOwnProp(v,"toJSON"))return!0;let b=Object.getPrototypeOf(v);for(;b&&b!==Object.prototype;){if(ey.hasOwnProp(b,"toJSON"))return!0;b=Object.getPrototypeOf(b)}return!1}(_))return b.pop(),_;for(let[b,w]of(x=Object.create(null),Object.entries(_))){let _=v.has(b.toLowerCase())?"[REDACTED ****]":y(w);ey.isUndefined(_)||(x[b]=_)}}return b.pop(),x}})(_)):ey.toJSONObject(_);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:w,code:this.code,status:this.status}}}eF.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",eF.ERR_BAD_OPTION="ERR_BAD_OPTION",eF.ECONNABORTED="ECONNABORTED",eF.ETIMEDOUT="ETIMEDOUT",eF.ECONNREFUSED="ECONNREFUSED",eF.ERR_NETWORK="ERR_NETWORK",eF.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",eF.ERR_DEPRECATED="ERR_DEPRECATED",eF.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",eF.ERR_BAD_REQUEST="ERR_BAD_REQUEST",eF.ERR_CANCELED="ERR_CANCELED",eF.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",eF.ERR_INVALID_URL="ERR_INVALID_URL",eF.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";let eI=eF;function eM(v){return ey.isPlainObject(v)||ey.isArray(v)}function eR(v){return ey.endsWith(v,"[]")?v.slice(0,-2):v}function eD(v,b,y){return v?v.concat(b).map(function(v,b){return v=eR(v),!y&&b?"["+v+"]":v}).join(y?".":""):b}let eP=ey.toFlatObject(ey,{},null,function(v){return/^is[A-Z]/.test(v)}),eL=function(v,b,y){if(!ey.isObject(v))throw TypeError("target must be an object");b=b||new FormData;let _=(y=ey.toFlatObject(y,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,b){return!ey.isUndefined(b[v])})).metaTokens,x=y.visitor||F,w=y.dots,k=y.indexes,A=y.Blob||"u">typeof Blob&&Blob,C=void 0===y.maxDepth?100:y.maxDepth,E=A&&ey.isSpecCompliantForm(b),S=[];if(!ey.isFunction(x))throw TypeError("visitor must be a function");function T(v){if(null===v)return"";if(ey.isDate(v))return v.toISOString();if(ey.isBoolean(v))return v.toString();if(!E&&ey.isBlob(v))throw new eI("Blob is not supported. Use a Buffer instead.");if(ey.isArrayBuffer(v)||ey.isTypedArray(v)){if(E&&"function"==typeof A)return new A([v]);if("u">typeof Buffer)return Buffer.from(v);throw new eI("Blob is not supported. Use a Buffer instead.",eI.ERR_NOT_SUPPORT)}return v}function O(v){if(v>C)throw new eI("Object is too deeply nested ("+v+" levels). Max depth: "+C,eI.ERR_FORM_DATA_DEPTH_EXCEEDED)}function F(v,y,x){let A=v;if(ey.isReactNative(b)&&ey.isReactNativeBlob(v))return b.append(eD(x,y,w),T(v)),!1;if(v&&!x&&"object"==typeof v)if(ey.endsWith(y,"{}"))y=_?y:y.slice(0,-2),v=function(v){if(1/0===C)return JSON.stringify(v);let b=[];return JSON.stringify(v,function(v,y){if(!ey.isObject(y))return y;for(;b.length&&b[b.length-1]!==this;)b.pop();return b.push(y),O(1+b.length-1),y})}(v);else{var E;if(ey.isArray(v)&&(E=v,ey.isArray(E)&&!E.some(eM))||(ey.isFileList(v)||ey.endsWith(y,"[]"))&&(A=ey.toArray(v)))return y=eR(y),A.forEach(function(v,_){ey.isUndefined(v)||null===v||b.append(!0===k?eD([y],_,w):null===k?y:y+"[]",T(v))}),!1}return!!eM(v)||(b.append(eD(x,y,w),T(v)),!1)}let I=Object.assign(eP,{defaultVisitor:F,convertValue:T,isVisitable:eM});if(!ey.isObject(v))throw TypeError("data must be an object");return!function v(y,_,w=0){if(!ey.isUndefined(y)){if(O(w),-1!==S.indexOf(y))throw Error("Circular reference detected in "+_.join("."));S.push(y),ey.forEach(y,function(y,k){!0===(!(ey.isUndefined(y)||null===y)&&x.call(b,y,ey.isString(k)?k.trim():k,_,I))&&v(y,_?_.concat(k):[k],w+1)}),S.pop()}}(v),b};function eN(v){let b={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(v).replace(/[!'()~]|%20/g,function(v){return b[v]})}function ez(v,b){this._pairs=[],v&&eL(v,this,b)}let ej=ez.prototype;function eB(v){return encodeURIComponent(v).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function e$(v,b,y){let _;if(!b)return v;v=v||"";let x=ey.isFunction(y)?{serialize:y}:y,w=ey.getSafeProp(x,"encode")||eB,k=ey.getSafeProp(x,"serialize");if(_=k?k(b,x):ey.isURLSearchParams(b)?b.toString():new ez(b,x).toString(w)){let b=v.indexOf("#");-1!==b&&(v=v.slice(0,b)),v+=(-1===v.indexOf("?")?"?":"&")+_}return v}ej.append=function(v,b){this._pairs.push([v,b])},ej.toString=function(v){let b=v?b=>v.call(this,b,eN):eN;return this._pairs.map(function(v){return b(v[0])+"="+b(v[1])},"").join("&")};let eU=class{constructor(){this.handlers=[]}use(v,b,y){return this.handlers.push({fulfilled:v,rejected:b,synchronous:!!y&&y.synchronous,runWhen:y?y.runWhen:null}),this.handlers.length-1}eject(v){this.handlers[v]&&(this.handlers[v]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(v){ey.forEach(this.handlers,function(b){null!==b&&v(b)})}},eV={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},eq="u">typeof URLSearchParams?URLSearchParams:ez,eH="u">typeof FormData?FormData:null,eW="u">typeof Blob?Blob:null,eG="u">typeof window&&"u">typeof document,eY="object"==typeof navigator&&navigator||void 0,eZ=eG&&(!eY||0>["ReactNative","NativeScript","NS"].indexOf(eY.product)),eX="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,eK=eG&&window.location.href||"http://localhost",eJ={...T,isBrowser:!0,classes:{URLSearchParams:eq,FormData:eH,Blob:eW},protocols:["http","https","file","blob","url","data"]};function eQ(v){if(v>100)throw new eI("FormData field is too deeply nested ("+v+" levels). Max depth: 100",eI.ERR_FORM_DATA_DEPTH_EXCEEDED)}let e0=function(v){if(ey.isFormData(v)&&ey.isFunction(v.entries)){let b={};return ey.forEachEntry(v,(v,y)=>{!function v(b,y,_,x){eQ(x);let w=b[x++];if("__proto__"===w)return!0;let k=Number.isFinite(+w),A=x>=b.length;return(w=!w&&ey.isArray(_)?_.length:w,A)?ey.hasOwnProp(_,w)?_[w]=ey.isArray(_[w])?_[w].concat(y):[_[w],y]:_[w]=y:(ey.hasOwnProp(_,w)&&ey.isObject(_[w])||(_[w]=[]),v(b,y,_[w],x)&&ey.isArray(_[w])&&(_[w]=function(v){let b,y,_={},x=Object.keys(v),w=x.length;for(b=0;b<w;b++)_[y=x[b]]=v[y];return _}(_[w]))),!k}(function(v){let b,y=[],_=/\w+|\[(\w*)]/g;for(;null!==(b=_.exec(v));)eQ(y.length),y.push("[]"===b[0]?"":b[1]||b[0]);return y}(v),y,b,0)}),b}return null},e1=(v,b)=>null!=v&&ey.hasOwnProp(v,b)?v[b]:void 0,e2={transitional:eV,adapter:["xhr","http","fetch"],transformRequest:[function(v,b){let y,_=b.getContentType()||"",x=_.indexOf("application/json")>-1,w=ey.isObject(v);if(w&&ey.isHTMLForm(v)&&(v=new FormData(v)),ey.isFormData(v))return x?JSON.stringify(e0(v)):v;if(ey.isArrayBuffer(v)||ey.isBuffer(v)||ey.isStream(v)||ey.isFile(v)||ey.isBlob(v)||ey.isReadableStream(v))return v;if(ey.isArrayBufferView(v))return v.buffer;if(ey.isURLSearchParams(v))return b.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),v.toString();if(w){let b=e1(this,"formSerializer");if(_.indexOf("application/x-www-form-urlencoded")>-1)return eL(v,new eJ.classes.URLSearchParams,{visitor:function(v,b,y,_){return eJ.isNode&&ey.isBuffer(v)?(this.append(b,v.toString("base64")),!1):_.defaultVisitor.apply(this,arguments)},...b}).toString();if((y=ey.isFileList(v))||_.indexOf("multipart/form-data")>-1){let _=e1(this,"env"),x=_&&_.FormData;return eL(y?{"files[]":v}:v,x&&new x,b)}}if(w||x){b.setContentType("application/json",!1);var k=v;if(ey.isString(k))try{return(0,JSON.parse)(k),ey.trim(k)}catch(v){if("SyntaxError"!==v.name)throw v}return(0,JSON.stringify)(k)}return v}],transformResponse:[function(v){let b=e1(this,"transitional")||e2.transitional,y=b&&b.forcedJSONParsing,_=e1(this,"responseType"),x="json"===_;if(ey.isResponse(v)||ey.isReadableStream(v))return v;if(v&&ey.isString(v)&&(y&&!_||x)){let y=b&&b.silentJSONParsing;try{return JSON.parse(v,e1(this,"parseReviver"))}catch(v){if(!y&&x){if("SyntaxError"===v.name)throw eI.from(v,eI.ERR_BAD_RESPONSE,this,null,e1(this,"response"));throw v}}}return v}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:eJ.classes.FormData,Blob:eJ.classes.Blob},validateStatus:function(v){return v>=200&&v<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function e5(v,b){let y=this||e2,_=b||y,x=eO.from(_.headers),w=_.data;return ey.forEach(v,function(v){w=v.call(y,w,x.normalize(),b?b.status:void 0)}),x.normalize(),w}function e3(v){return!!(v&&v.__CANCEL__)}ey.forEach(["delete","get","head","post","put","patch","query"],v=>{e2.headers[v]={}});let e4=class extends eI{constructor(v,b,y){super(null==v?"canceled":v,eI.ERR_CANCELED,b,y),this.name="CanceledError",this.__CANCEL__=!0}};function e6(v,b,y){let _=y.config.validateStatus;!y.status||!_||_(y.status)?v(y):b(new eI("Request failed with status code "+y.status,y.status>=400&&y.status<500?eI.ERR_BAD_REQUEST:eI.ERR_BAD_RESPONSE,y.config,y.request,y))}let e8=function(v,b){let y,_=Array(v=v||10),x=Array(v),w=0,k=0;return b=void 0!==b?b:1e3,function(A){let C=Date.now(),E=x[k];y||(y=C),_[w]=A,x[w]=C;let S=k,T=0;for(;S!==w;)T+=_[S++],S%=v;if((w=(w+1)%v)===k&&(k=(k+1)%v),C-y<b)return;let O=E&&C-E;return O?Math.round(1e3*T/O):void 0}},e7=function(v,b){let y,_,x=0,w=1e3/b,k=(b,w=Date.now())=>{x=w,y=null,_&&(clearTimeout(_),_=null),v(...b)};return[(...v)=>{let b=Date.now(),A=b-x;A>=w?k(v,b):(y=v,_||(_=setTimeout(()=>{_=null,k(y)},w-A)))},()=>y&&k(y)]},e9=(v,b,y=3)=>{let _=0,x=e8(50,250);return e7(y=>{if(!y||"number"!=typeof y.loaded)return;let w=y.loaded,k=y.lengthComputable?y.total:void 0,A=null!=k?Math.min(w,k):w,C=Math.max(0,A-_),E=x(C);_=Math.max(_,A),v({loaded:A,total:k,progress:k?A/k:void 0,bytes:C,rate:E||void 0,estimated:E&&k?(k-A)/E:void 0,event:y,lengthComputable:null!=k,[b?"download":"upload"]:!0})},y)},te=(v,b)=>{let y=null!=v;return[_=>b[0]({lengthComputable:y,total:v,loaded:_}),b[1]]},tt=v=>(...b)=>ey.asap(()=>v(...b)),tn=eJ.hasStandardBrowserEnv?(w=new URL(eJ.origin),k=eJ.navigator&&/(msie|trident)/i.test(eJ.navigator.userAgent),v=>(v=new URL(v,eJ.origin),w.protocol===v.protocol&&w.host===v.host&&(k||w.port===v.port))):()=>!0,ti=eJ.hasStandardBrowserEnv?{write(v,b,y,_,x,w,k){if("u"<typeof document)return;let A=[`${v}=${encodeURIComponent(b)}`];ey.isNumber(y)&&A.push(`expires=${new Date(y).toUTCString()}`),ey.isString(_)&&A.push(`path=${_}`),ey.isString(x)&&A.push(`domain=${x}`),!0===w&&A.push("secure"),ey.isString(k)&&A.push(`SameSite=${k}`),document.cookie=A.join("; ")},read(v){if("u"<typeof document)return null;let b=document.cookie.split(";");for(let y=0;y<b.length;y++){let _=b[y].replace(/^\s+/,""),x=_.indexOf("=");if(-1!==x&&_.slice(0,x)===v)try{return decodeURIComponent(_.slice(x+1))}catch(v){return _.slice(x+1)}}return null},remove(v){this.write(v,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}},tr=/^https?:(?!\/\/)/i,to=/[\t\n\r]/g;function ta(v,b){if("string"==typeof v&&tr.test((function(v){let b=0;for(;b<v.length&&32>=v.charCodeAt(b);)b++;return v.slice(b)})(v).replace(to,"")))throw new eI('Invalid URL: missing "//" after protocol',eI.ERR_INVALID_URL,b)}function ts(v,b,y,_){ta(b,_);let x=!("string"==typeof b&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(b));return v&&(x||!1===y)?(ta(v,_),b?v.replace(/\/?\/$/,"")+"/"+b.replace(/^\/+/,""):v):b}let tl=v=>v instanceof eO?{...v}:v;function tc(v,b){v=v||{},b=b||{};let y=Object.create(null);function _(v,b,y,_){return ey.isPlainObject(v)&&ey.isPlainObject(b)?ey.merge.call({caseless:_},v,b):ey.isPlainObject(b)?ey.merge({},b):ey.isArray(b)?b.slice():b}function x(v,b,y,x){return ey.isUndefined(b)?ey.isUndefined(v)?void 0:_(void 0,v,y,x):_(v,b,y,x)}function w(v,b){if(!ey.isUndefined(b))return _(void 0,b)}function k(v,b){return ey.isUndefined(b)?ey.isUndefined(v)?void 0:_(void 0,v):_(void 0,b)}function A(y,x,w){return ey.hasOwnProp(b,w)?_(y,x):ey.hasOwnProp(v,w)?_(void 0,y):void 0}Object.defineProperty(y,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});let C={url:w,method:w,data:w,baseURL:k,transformRequest:k,transformResponse:k,paramsSerializer:k,timeout:k,timeoutMessage:k,withCredentials:k,withXSRFToken:k,adapter:k,responseType:k,xsrfCookieName:k,xsrfHeaderName:k,onUploadProgress:k,onDownloadProgress:k,decompress:k,maxContentLength:k,maxBodyLength:k,beforeRedirect:k,transport:k,httpAgent:k,httpsAgent:k,cancelToken:k,socketPath:k,allowedSocketPaths:k,responseEncoding:k,validateStatus:A,headers:(v,b,y)=>x(tl(v),tl(b),y,!0)};return ey.forEach(Object.keys({...v,...b}),function(_){if("__proto__"===_||"constructor"===_||"prototype"===_)return;let w=ey.hasOwnProp(C,_)?C[_]:x,k=w(ey.hasOwnProp(v,_)?v[_]:void 0,ey.hasOwnProp(b,_)?b[_]:void 0,_);ey.isUndefined(k)&&w!==A||(y[_]=k)}),ey.hasOwnProp(b,"validateStatus")&&ey.isUndefined(b.validateStatus)&&!1===function(y){let _=ey.hasOwnProp(b,"transitional")?b.transitional:void 0;if(!ey.isUndefined(_)){if(!ey.isPlainObject(_))return;else if(ey.hasOwnProp(_,y))return _[y]}let x=ey.hasOwnProp(v,"transitional")?v.transitional:void 0;if(ey.isPlainObject(x)&&ey.hasOwnProp(x,y))return x[y]}("validateStatusUndefinedResolves")&&(ey.hasOwnProp(v,"validateStatus")?y.validateStatus=_(void 0,v.validateStatus):delete y.validateStatus),y}let tu=["content-type","content-length"],td=function(v){let b=tc({},v),y=v=>ey.hasOwnProp(b,v)?b[v]:void 0,_=y("data"),x=y("withXSRFToken"),w=y("xsrfHeaderName"),k=y("xsrfCookieName"),A=y("headers"),C=y("auth"),E=y("baseURL"),S=y("allowAbsoluteUrls"),T=y("url");if(b.headers=A=eO.from(A),b.url=e$(ts(E,T,S,b),y("params"),y("paramsSerializer")),C){let b=ey.getSafeProp(C,"username")||"",y=ey.getSafeProp(C,"password")||"";try{A.set("Authorization","Basic "+btoa(b+":"+(y?encodeURIComponent(y).replace(/%([0-9A-F]{2})/gi,(v,b)=>String.fromCharCode(parseInt(b,16))):"")))}catch(b){throw eI.from(b,eI.ERR_BAD_OPTION_VALUE,v)}}if(ey.isFormData(_))if(eJ.hasStandardBrowserEnv||eJ.hasStandardBrowserWebWorkerEnv||ey.isReactNative(_))A.setContentType(void 0);else{var O,F;ey.isFunction(_.getHeaders)&&(O=A,F=_.getHeaders(),"content-only"!==y("formDataHeaderPolicy")?O.set(F):Object.entries(F||{}).forEach(([v,b])=>{tu.includes(v.toLowerCase())&&O.set(v,b)}))}if(eJ.hasStandardBrowserEnv&&(ey.isFunction(x)&&(x=x(b)),!0===x||null==x&&tn(b.url))){let v=w&&k&&ti.read(k);v&&A.set(w,v)}return b},th="u">typeof XMLHttpRequest&&function(v){return new Promise(function(b,y){var _;let x,w,k,A,C,E,S=td(v),T=S.data,O=eO.from(S.headers).normalize(),{responseType:F,onUploadProgress:I,onDownloadProgress:M}=S;function R(){A&&A(),C&&C(),S.cancelToken&&S.cancelToken.unsubscribe(x),S.signal&&S.signal.removeEventListener("abort",x)}let D=new XMLHttpRequest;function P(){if(!D)return;let _=eO.from("getAllResponseHeaders"in D&&D.getAllResponseHeaders());e6(function(v){b(v),R()},function(v){y(v),R()},{data:F&&"text"!==F&&"json"!==F?D.response:D.responseText,status:D.status,statusText:D.statusText,headers:_,config:v,request:D}),D=null}D.open(S.method.toUpperCase(),S.url,!0),D.timeout=S.timeout,"onloadend"in D?D.onloadend=P:D.onreadystatechange=function(){!D||4!==D.readyState||(0!==D.status||D.responseURL&&D.responseURL.startsWith("file:"))&&setTimeout(P)},D.onabort=function(){D&&(y(new eI("Request aborted",eI.ECONNABORTED,v,D)),R(),D=null)},D.onerror=function(b){let _=new eI(b&&b.message?b.message:"Network Error",eI.ERR_NETWORK,v,D);_.event=b||null,y(_),R(),D=null},D.ontimeout=function(){let b=S.timeout?"timeout of "+S.timeout+"ms exceeded":"timeout exceeded",_=S.transitional||eV;S.timeoutErrorMessage&&(b=S.timeoutErrorMessage),y(new eI(b,_.clarifyTimeoutError?eI.ETIMEDOUT:eI.ECONNABORTED,v,D)),R(),D=null},void 0===T&&O.setContentType(null),"setRequestHeader"in D&&ey.forEach(eA(O),function(v,b){D.setRequestHeader(b,v)}),ey.isUndefined(S.withCredentials)||(D.withCredentials=!!S.withCredentials),F&&"json"!==F&&(D.responseType=S.responseType),M&&([k,C]=e9(M,!0),D.addEventListener("progress",k)),I&&D.upload&&([w,A]=e9(I),D.upload.addEventListener("progress",w),D.upload.addEventListener("loadend",A)),(S.cancelToken||S.signal)&&(x=b=>{D&&(y(!b||b.type?new e4(null,v,D):b),D.abort(),R(),D=null)},S.cancelToken&&S.cancelToken.subscribe(x),S.signal&&(S.signal.aborted?x():S.signal.addEventListener("abort",x)));let L=(_=S.url,(E=/^([-+\w]{1,25}):(?:\/\/)?/.exec(_))&&E[1]||"");if(L&&!eJ.protocols.includes(L)){y(new eI("Unsupported protocol "+L+":",eI.ERR_BAD_REQUEST,v)),R();return}D.send(T||null)})},tp=function*(v,b){let y,_=v.byteLength;if(!b||_<b)return void(yield v);let x=0;for(;x<_;)y=x+b,yield v.slice(x,y),x=y},tf=async function*(v,b){for await(let y of tm(v))yield*tp(y,b)},tm=async function*(v){if(v[Symbol.asyncIterator])return void(yield*v);let b=v.getReader();try{for(;;){let{done:v,value:y}=await b.read();if(v)break;yield y}}finally{await b.cancel()}},tg=(v,b,y,_)=>{let x,w=tf(v,b),k=0,A=v=>{!x&&(x=!0,_&&_(v))};return new ReadableStream({async pull(v){try{let{done:b,value:_}=await w.next();if(b){A(),v.close();return}let x=_.byteLength;if(y){let v=k+=x;y(v)}v.enqueue(new Uint8Array(_))}catch(v){throw A(v),v}},cancel:v=>(A(v),w.return())},{highWaterMark:2})},tv=v=>v>=48&&v<=57||v>=65&&v<=70||v>=97&&v<=102,tb=(v,b,y)=>b+2<y&&tv(v.charCodeAt(b+1))&&tv(v.charCodeAt(b+2)),{isFunction:ty}=ey,t_=v=>{if(!ey.isString(v))return v;try{return decodeURIComponent(v)}catch(b){return v}},tx=(v,...b)=>{try{return!!v(...b)}catch(v){return!1}},tw=v=>{let b,y=void 0!==ey.global&&null!==ey.global?ey.global:globalThis,{ReadableStream:_,TextEncoder:x}=y,{fetch:w,Request:k,Response:A}=v=ey.merge.call({skipUndefined:!0},{Request:y.Request,Response:y.Response},v),C=w?ty(w):"function"==typeof fetch,E=ty(k),S=ty(A);if(!C)return!1;let T=C&&ty(_),O=C&&("function"==typeof x?(b=new x,v=>b.encode(v)):async v=>new Uint8Array(await new k(v).arrayBuffer())),F=E&&T&&tx(()=>{let v=!1,b=new k(eJ.origin,{body:new _,method:"POST",get duplex(){return v=!0,"half"}}),y=b.headers.has("Content-Type");return null!=b.body&&b.body.cancel(),v&&!y}),I=S&&T&&tx(()=>ey.isReadableStream(new A("").body)),M={stream:I&&(v=>v.body)};C&&["text","arrayBuffer","blob","formData","stream"].forEach(v=>{M[v]||(M[v]=(b,y)=>{let _=b&&b[v];if(_)return _.call(b);throw new eI(`Response type '${v}' is not supported`,eI.ERR_NOT_SUPPORT,y)})});let R=async v=>{if(null==v)return 0;if(ey.isBlob(v))return v.size;if(ey.isSpecCompliantForm(v)){let b=new k(eJ.origin,{method:"POST",body:v});return(await b.arrayBuffer()).byteLength}return ey.isArrayBufferView(v)||ey.isArrayBuffer(v)?v.byteLength:(ey.isURLSearchParams(v)&&(v+=""),ey.isString(v))?(await O(v)).byteLength:void 0},D=async(v,b)=>{let y=ey.toFiniteNumber(v.getContentLength());return null==y?R(b):y};return async v=>{let b,{url:y,method:_,data:C,signal:S,cancelToken:O,timeout:P,onDownloadProgress:L,onUploadProgress:N,responseType:z,headers:j,withCredentials:B="same-origin",fetchOptions:U,maxContentLength:V,maxBodyLength:q}=td(v),H=ey.isNumber(V)&&V>-1,W=ey.isNumber(q)&&q>-1,G=w||fetch;z=z?(z+"").toLowerCase():"text";let Y=((v,b)=>{if(v=v?v.filter(Boolean):[],!b&&!v.length)return;let y=new AbortController,_=!1,x=function(v){if(!_){_=!0,k();let b=v instanceof Error?v:this.reason;y.abort(b instanceof eI?b:new e4(b instanceof Error?b.message:b))}},w=b&&setTimeout(()=>{w=null,x(new eI(`timeout of ${b}ms exceeded`,eI.ETIMEDOUT))},b),k=()=>{v&&(w&&clearTimeout(w),w=null,v.forEach(v=>{v.unsubscribe?v.unsubscribe(x):v.removeEventListener("abort",x)}),v=null)};v.forEach(v=>v.addEventListener("abort",x,{once:!0}));let{signal:A}=y;return A.unsubscribe=()=>ey.asap(k),A})([S,O&&O.toAbortSignal()],P),Z=null,X=Y&&Y.unsubscribe&&(()=>{Y.unsubscribe()}),K=null,J=()=>new eI("Request body larger than maxBodyLength limit",eI.ERR_BAD_REQUEST,v,Z);try{var Q;let w,S,O,P,ee=(S="auth",ey.hasOwnProp(v,S)?v[S]:void 0);if(ee){let v=ey.getSafeProp(ee,"username")||"",b=ey.getSafeProp(ee,"password")||"";w={username:v,password:b}}if(O=(Q=y).indexOf("://"),P=Q,-1!==O&&(P=P.slice(O+3)),P.includes("@")||P.includes(":")){let v=new URL(y,eJ.origin);if(!w&&(v.username||v.password)){let b=t_(v.username),y=t_(v.password);w={username:b,password:y}}(v.username||v.password)&&(v.username="",v.password="",y=v.href)}if(w){let v;j.delete("authorization"),j.set("Authorization","Basic "+btoa((v=(w.username||"")+":"+(w.password||""),encodeURIComponent(v).replace(/%([0-9A-F]{2})/gi,(v,b)=>String.fromCharCode(parseInt(b,16))))))}if(H&&"string"==typeof y&&y.startsWith("data:")&&function(v){if(!v||"string"!=typeof v||!v.startsWith("data:"))return 0;let b=v.indexOf(",");if(b<0)return 0;let y=v.slice(5,b),_=v.slice(b+1);if(/;base64/i.test(y)){let v=_.length,b=_.length;for(let y=0;y<b;y++)if(37===_.charCodeAt(y)&&y+2<b){let b=_.charCodeAt(y+1),x=_.charCodeAt(y+2);tv(b)&&tv(x)&&(v-=2,y+=2)}let y=0,x=b-1,w=v=>v>=2&&37===_.charCodeAt(v-2)&&51===_.charCodeAt(v-1)&&(68===_.charCodeAt(v)||100===_.charCodeAt(v));x>=0&&(61===_.charCodeAt(x)?(y++,x--):w(x)&&(y++,x-=3)),1===y&&x>=0&&(61===_.charCodeAt(x)?y++:w(x)&&y++);let k=3*Math.floor(v/4)-(y||0);return k>0?k:0}let x=0;for(let v=0,b=_.length;v<b;v++){let y=_.charCodeAt(v);if(37===y&&tb(_,v,b))x+=1,v+=2;else if(y<128)x+=1;else if(y<2048)x+=2;else if(y>=55296&&y<=56319&&v+1<b){let b=_.charCodeAt(v+1);b>=56320&&b<=57343?(x+=4,v++):x+=3}else x+=3}return x}(y)>V)throw new eI("maxContentLength size of "+V+" exceeded",eI.ERR_BAD_RESPONSE,v,Z);if(W&&"get"!==_&&"head"!==_){let v=await R(C);if("number"==typeof v&&isFinite(v)&&(b=v,v>q))throw J()}let et=W&&(ey.isReadableStream(C)||ey.isStream(C)),en=(v,b,y)=>tg(v,65536,v=>{if(W&&v>q)throw K=J();b&&b(v)},y);if(F&&"get"!==_&&"head"!==_&&(N||et)){if(b=null==b?await D(j,C):b,0!==b||et){let v,_=new k(y,{method:"POST",body:C,duplex:"half"});if(ey.isFormData(C)&&(v=_.headers.get("content-type"))&&j.setContentType(v),_.body){let[v,y]=N&&te(b,e9(tt(N)))||[];C=en(_.body,v,y)}}}else if(et&&!E&&T&&"get"!==_&&"head"!==_)C=en(C);else if(et&&E&&!F&&"get"!==_&&"head"!==_)throw new eI("Stream request bodies are not supported by the current fetch implementation",eI.ERR_NOT_SUPPORT,v,Z);ey.isString(B)||(B=B?"include":"omit");let ei=E&&"credentials"in k.prototype;if(ey.isFormData(C)){let v=j.getContentType();v&&/^multipart\/form-data/i.test(v)&&!/boundary=/i.test(v)&&j.delete("content-type")}j.set("User-Agent","axios/1.18.1",!1);let er={...U,signal:Y,method:_.toUpperCase(),headers:eA(j.normalize()),body:C,duplex:"half",credentials:ei?B:void 0};Z=E&&new k(y,er);let eo=await (E?G(Z,U):G(y,er)),ea=eO.from(eo.headers);if(H){let b=ey.toFiniteNumber(ea.getContentLength());if(null!=b&&b>V)throw new eI("maxContentLength size of "+V+" exceeded",eI.ERR_BAD_RESPONSE,v,Z)}let es=I&&("stream"===z||"response"===z);if(I&&eo.body&&(L||H||es&&X)){let b={};["status","statusText","headers"].forEach(v=>{b[v]=eo[v]});let y=ey.toFiniteNumber(ea.getContentLength()),[_,x]=L&&te(y,e9(tt(L),!0))||[],w=0;eo=new A(tg(eo.body,65536,b=>{if(H&&b>V)throw new eI("maxContentLength size of "+V+" exceeded",eI.ERR_BAD_RESPONSE,v,Z);_&&_(b)},()=>{x&&x(),X&&X()}),b)}z=z||"text";let el=await M[ey.findKey(M,z)||"text"](eo,v);if(H&&!I&&!es){let b;if(null!=el&&("number"==typeof el.byteLength?b=el.byteLength:"number"==typeof el.size?b=el.size:"string"==typeof el&&(b="function"==typeof x?new x().encode(el).byteLength:el.length)),"number"==typeof b&&b>V)throw new eI("maxContentLength size of "+V+" exceeded",eI.ERR_BAD_RESPONSE,v,Z)}return!es&&X&&X(),await new Promise((b,y)=>{e6(b,y,{data:el,headers:eO.from(eo.headers),status:eo.status,statusText:eo.statusText,config:v,request:Z})})}catch(b){if(X&&X(),Y&&Y.aborted&&Y.reason instanceof eI){let y=Y.reason;throw y.config=v,Z&&(y.request=Z),b!==y&&Object.defineProperty(y,"cause",{__proto__:null,value:b,writable:!0,enumerable:!1,configurable:!0}),y}if(K)throw Z&&!K.request&&(K.request=Z),K;if(b instanceof eI)throw Z&&!b.request&&(b.request=Z),b;if(b&&"TypeError"===b.name&&/Load failed|fetch/i.test(b.message)){let y=new eI("Network Error",eI.ERR_NETWORK,v,Z,b&&b.response);throw Object.defineProperty(y,"cause",{__proto__:null,value:b.cause||b,writable:!0,enumerable:!1,configurable:!0}),y}throw eI.from(b,b&&b.code,v,Z,b&&b.response)}}},tk=new Map,tA=v=>{let b=v&&v.env||{},{fetch:y,Request:_,Response:x}=b,w=[_,x,y],k=w.length,A,C,E=tk;for(;k--;)A=w[k],void 0===(C=E.get(A))&&E.set(A,C=k?new Map:tw(b)),E=C;return C};tA();let tC={http:null,xhr:th,fetch:{get:tA}};ey.forEach(tC,(v,b)=>{if(v){try{Object.defineProperty(v,"name",{__proto__:null,value:b})}catch(v){}Object.defineProperty(v,"adapterName",{__proto__:null,value:b})}});let tE=v=>`- ${v}`,tS=v=>ey.isFunction(v)||null===v||!1===v,tT=function(v,b){let y,_,{length:x}=v=ey.isArray(v)?v:[v],w={};for(let k=0;k<x;k++){let x;if(_=y=v[k],!tS(y)&&void 0===(_=tC[(x=String(y)).toLowerCase()]))throw new eI(`Unknown adapter '${x}'`);if(_&&(ey.isFunction(_)||(_=_.get(b))))break;w[x||"#"+k]=_}if(!_){let v=Object.entries(w).map(([v,b])=>`adapter ${v} `+(!1===b?"is not supported by the environment":"is not available in the build"));throw new eI("There is no suitable adapter to dispatch the request "+(x?v.length>1?"since :\n"+v.map(tE).join("\n"):" "+tE(v[0]):"as no adapter specified"),eI.ERR_NOT_SUPPORT)}return _};function tO(v){if(v.cancelToken&&v.cancelToken.throwIfRequested(),v.signal&&v.signal.aborted)throw new e4(null,v)}function tF(v){return tO(v),v.headers=eO.from(v.headers),v.data=e5.call(v,v.transformRequest),-1!==["post","put","patch"].indexOf(v.method)&&v.headers.setContentType("application/x-www-form-urlencoded",!1),tT(v.adapter||e2.adapter,v)(v).then(function(b){tO(v),v.response=b;try{b.data=e5.call(v,v.transformResponse,b)}finally{delete v.response}return b.headers=eO.from(b.headers),b},function(b){if(!e3(b)&&(tO(v),b&&b.response)){v.response=b.response;try{b.response.data=e5.call(v,v.transformResponse,b.response)}finally{delete v.response}b.response.headers=eO.from(b.response.headers)}return Promise.reject(b)})}let tI={};["object","boolean","number","function","string","symbol"].forEach((v,b)=>{tI[v]=function(y){return typeof y===v||"a"+(b<1?"n ":" ")+v}});let tM={};tI.transitional=function(v,b,y){function _(v,b){return"[Axios v1.18.1] Transitional option '"+v+"'"+b+(y?". "+y:"")}return(y,x,w)=>{if(!1===v)throw new eI(_(x," has been removed"+(b?" in "+b:"")),eI.ERR_DEPRECATED);return b&&!tM[x]&&(tM[x]=!0,console.warn(_(x," has been deprecated since v"+b+" and will be removed in the near future"))),!v||v(y,x,w)}},tI.spelling=function(v){return(b,y)=>(console.warn(`${y} is likely a misspelling of ${v}`),!0)};let tR=function(v,b,y){if("object"!=typeof v||null===v)throw new eI("options must be an object",eI.ERR_BAD_OPTION_VALUE);let _=Object.keys(v),x=_.length;for(;x-- >0;){let w=_[x],k=Object.prototype.hasOwnProperty.call(b,w)?b[w]:void 0;if(k){let b=v[w],y=void 0===b||k(b,w,v);if(!0!==y)throw new eI("option "+w+" must be "+y,eI.ERR_BAD_OPTION_VALUE);continue}if(!0!==y)throw new eI("Unknown option "+w,eI.ERR_BAD_OPTION)}};class tD{constructor(v){this.defaults=v||{},this.interceptors={request:new eU,response:new eU}}async request(v,b){try{return await this._request(v,b)}catch(v){if(v instanceof Error){let b={};Error.captureStackTrace?Error.captureStackTrace(b):b=Error();let y=(()=>{if(!b.stack)return"";let v=b.stack.indexOf("\n");return -1===v?"":b.stack.slice(v+1)})();try{if(v.stack){if(y){let b=y.indexOf("\n"),_=-1===b?-1:y.indexOf("\n",b+1),x=-1===_?"":y.slice(_+1);String(v.stack).endsWith(x)||(v.stack+="\n"+y)}}else v.stack=y}catch(v){}}throw v}}_request(v,b){let y,_;"string"==typeof v?(b=b||{}).url=v:b=v||{};let{transitional:x,paramsSerializer:w,headers:k}=b=tc(this.defaults,b);void 0!==x&&tR(x,{silentJSONParsing:tI.transitional(tI.boolean),forcedJSONParsing:tI.transitional(tI.boolean),clarifyTimeoutError:tI.transitional(tI.boolean),legacyInterceptorReqResOrdering:tI.transitional(tI.boolean),advertiseZstdAcceptEncoding:tI.transitional(tI.boolean),validateStatusUndefinedResolves:tI.transitional(tI.boolean)},!1),null!=w&&(ey.isFunction(w)?b.paramsSerializer={serialize:w}:tR(w,{encode:tI.function,serialize:tI.function},!0)),void 0!==b.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?b.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:b.allowAbsoluteUrls=!0),tR(b,{baseUrl:tI.spelling("baseURL"),withXsrfToken:tI.spelling("withXSRFToken")},!0),b.method=(b.method||this.defaults.method||"get").toLowerCase();let A=k&&ey.merge(k.common,k[b.method]);k&&ey.forEach(["delete","get","head","post","put","patch","query","common"],v=>{delete k[v]}),b.headers=eO.concat(A,k);let C=[],E=!0;this.interceptors.request.forEach(function(v){if("function"==typeof v.runWhen&&!1===v.runWhen(b))return;E=E&&v.synchronous;let y=b.transitional||eV;y&&y.legacyInterceptorReqResOrdering?C.unshift(v.fulfilled,v.rejected):C.push(v.fulfilled,v.rejected)});let S=[];this.interceptors.response.forEach(function(v){S.push(v.fulfilled,v.rejected)});let T=0;if(!E){let v=[tF.bind(this),void 0];for(v.unshift(...C),v.push(...S),_=v.length,y=Promise.resolve(b);T<_;)y=y.then(v[T++],v[T++]);return y}_=C.length;let O=b;for(;T<_;){let v=C[T++],b=C[T++];try{O=v(O)}catch(v){b.call(this,v);break}}try{y=tF.call(this,O)}catch(v){return Promise.reject(v)}for(T=0,_=S.length;T<_;)y=y.then(S[T++],S[T++]);return y}getUri(v){return e$(ts((v=tc(this.defaults,v)).baseURL,v.url,v.allowAbsoluteUrls,v),v.params,v.paramsSerializer)}}ey.forEach(["delete","get","head","options"],function(v){tD.prototype[v]=function(b,y){return this.request(tc(y||{},{method:v,url:b,data:y&&ey.hasOwnProp(y,"data")?y.data:void 0}))}}),ey.forEach(["post","put","patch","query"],function(v){function b(b){return function(y,_,x){return this.request(tc(x||{},{method:v,headers:b?{"Content-Type":"multipart/form-data"}:{},url:y,data:_}))}}tD.prototype[v]=b(),"query"!==v&&(tD.prototype[v+"Form"]=b(!0))});let tP=class v{constructor(v){let b;if("function"!=typeof v)throw TypeError("executor must be a function.");this.promise=new Promise(function(v){b=v});const y=this;this.promise.then(v=>{if(!y._listeners)return;let b=y._listeners.length;for(;b-- >0;)y._listeners[b](v);y._listeners=null}),this.promise.then=v=>{let b,_=new Promise(v=>{y.subscribe(v),b=v}).then(v);return _.cancel=function(){y.unsubscribe(b)},_},v(function(v,_,x){y.reason||(y.reason=new e4(v,_,x),b(y.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(v){this.reason?v(this.reason):this._listeners?this._listeners.push(v):this._listeners=[v]}unsubscribe(v){if(!this._listeners)return;let b=this._listeners.indexOf(v);-1!==b&&this._listeners.splice(b,1)}toAbortSignal(){let v=new AbortController,b=b=>{v.abort(b)};return this.subscribe(b),v.signal.unsubscribe=()=>this.unsubscribe(b),v.signal}static source(){let b;return{token:new v(function(v){b=v}),cancel:b}}},tL={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(tL).forEach(([v,b])=>{tL[b]=v});let tN=function v(b){let y=new tD(b),_=O(tD.prototype.request,y);return ey.extend(_,tD.prototype,y,{allOwnKeys:!0}),ey.extend(_,y,null,{allOwnKeys:!0}),_.create=function(y){return v(tc(b,y))},_}(e2);function tz(v,b,y){return b=tU(b),function(v,b){var y;if(b&&("object"==((y=b)&&"u">typeof Symbol&&y.constructor===Symbol?"symbol":typeof y)||"function"==typeof b))return b;if(void 0===v)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return v}(v,tq()?Reflect.construct(b,y||[],tU(v).constructor):b.apply(v,y))}function tj(v,b){if(!(v instanceof b))throw TypeError("Cannot call a class as a function")}function tB(v,b){for(var y=0;y<b.length;y++){var _=b[y];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(v,_.key,_)}}function t$(v,b,y){return b&&tB(v.prototype,b),y&&tB(v,y),v}function tU(v){return(tU=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)})(v)}function tV(v,b){if("function"!=typeof b&&null!==b)throw TypeError("Super expression must either be null or a function");v.prototype=Object.create(b&&b.prototype,{constructor:{value:v,writable:!0,configurable:!0}}),b&&tH(v,b)}function tq(){try{var v=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(v){}return(tq=function(){return!!v})()}function tH(v,b){return(tH=Object.setPrototypeOf||function(v,b){return v.__proto__=b,v})(v,b)}function tW(v,b){return b||(b=v.slice(0)),Object.freeze(Object.defineProperties(v,{raw:{value:Object.freeze(b)}}))}function tG(){var v=tW(["alarm"]);return tG=function(){return v},v}function tY(){var v=tW(["alarm"]);return tY=function(){return v},v}function tZ(){var v=tW(["alarm"]);return tZ=function(){return v},v}function tX(){var v=tW(["alarm/assets"]);return tX=function(){return v},v}function tK(){var v=tW(["alarm/",""]);return tK=function(){return v},v}function tJ(){var v=tW(["alarm/",""]);return tJ=function(){return v},v}function tQ(){var v=tW(["alarm/",""]);return tQ=function(){return v},v}function t0(){var v=tW(["alarm/","/assets"]);return t0=function(){return v},v}function t1(){var v=tW(["apps"]);return t1=function(){return v},v}function t2(){var v=tW(["apps/consoleConfig"]);return t2=function(){return v},v}function t5(){var v=tW(["apps/info"]);return t5=function(){return v},v}function t3(){var v=tW(["dashboard"]);return t3=function(){return v},v}function t4(){var v=tW(["dashboard"]);return t4=function(){return v},v}function t6(){var v=tW(["dashboard/all/",""]);return t6=function(){return v},v}function t8(){var v=tW(["dashboard/query"]);return t8=function(){return v},v}function t7(){var v=tW(["dashboard/","/",""]);return t7=function(){return v},v}function t9(){var v=tW(["dashboard/","/",""]);return t9=function(){return v},v}function ne(){var v=tW(["syslog/config"]);return ne=function(){return v},v}function nt(){var v=tW(["syslog/config"]);return nt=function(){return v},v}function nn(){var v=tW(["syslog/event"]);return nn=function(){return v},v}function ni(){var v=tW(["syslog/event"]);return ni=function(){return v},v}function nr(){var v=tW(["gateway/connection"]);return nr=function(){return v},v}function no(){var v=tW(["gateway/connection"]);return no=function(){return v},v}function na(){var v=tW(["gateway/connection/",""]);return na=function(){return v},v}function ns(){var v=tW(["gateway/connection/",""]);return ns=function(){return v},v}function nl(){var v=tW(["gateway/connection/",""]);return nl=function(){return v},v}function nc(){var v=tW(["gateway/status/",""]);return nc=function(){return v},v}function nu(){var v=tW(["user/locale"]);return nu=function(){return v},v}function nd(){var v=tW(["user/query"]);return nd=function(){return v},v}function nh(){var v=tW(["user/request-password-reset"]);return nh=function(){return v},v}function np(){var v=tW(["user/reset-password"]);return np=function(){return v},v}function nf(){var v=tW(["user/update"]);return nf=function(){return v},v}function nm(){var v=tW(["user/user"]);return nm=function(){return v},v}function ng(){var v=tW(["user/userRealmRoles"]);return ng=function(){return v},v}function nv(){var v=tW(["user/userRoles/",""]);return nv=function(){return v},v}function nb(){var v=tW(["user/","/disconnect/",""]);return nb=function(){return v},v}function ny(){var v=tW(["user/","/request-password-reset/",""]);return ny=function(){return v},v}function n_(){var v=tW(["user/","/reset-password/",""]);return n_=function(){return v},v}function nx(){var v=tW(["user/","/reset-secret/",""]);return nx=function(){return v},v}function nw(){var v=tW(["user/","/roles"]);return nw=function(){return v},v}function nk(){var v=tW(["user/","/userRealmRoles/",""]);return nk=function(){return v},v}function nA(){var v=tW(["user/","/userRealmRoles/",""]);return nA=function(){return v},v}function nC(){var v=tW(["user/","/userRoles/","/",""]);return nC=function(){return v},v}function nE(){var v=tW(["user/","/userRoles/","/",""]);return nE=function(){return v},v}function nS(){var v=tW(["user/","/userSessions/",""]);return nS=function(){return v},v}function nT(){var v=tW(["user/","/users"]);return nT=function(){return v},v}function nO(){var v=tW(["user/","/users"]);return nO=function(){return v},v}function nF(){var v=tW(["user/","/users/",""]);return nF=function(){return v},v}function nI(){var v=tW(["user/","/","/roles"]);return nI=function(){return v},v}function nM(){var v=tW(["user/","/","/roles"]);return nM=function(){return v},v}function nR(){var v=tW(["user/","/",""]);return nR=function(){return v},v}function nD(){var v=tW(["agent/assetDiscovery/",""]);return nD=function(){return v},v}function nP(){var v=tW(["agent/assetImport/",""]);return nP=function(){return v},v}function nL(){var v=tW(["agent/instanceDiscovery/",""]);return nL=function(){return v},v}function nN(){var v=tW(["health"]);return nN=function(){return v},v}function nz(){var v=tW(["info"]);return nz=function(){return v},v}function nj(){var v=tW(["realm"]);return nj=function(){return v},v}function nB(){var v=tW(["realm"]);return nB=function(){return v},v}function n$(){var v=tW(["realm/accessible"]);return n$=function(){return v},v}function nU(){var v=tW(["realm/",""]);return nU=function(){return v},v}function nV(){var v=tW(["realm/",""]);return nV=function(){return v},v}function nq(){var v=tW(["realm/",""]);return nq=function(){return v},v}function nH(){var v=tW(["flow"]);return nH=function(){return v},v}function nW(){var v=tW(["flow/",""]);return nW=function(){return v},v}function nG(){var v=tW(["flow/",""]);return nG=function(){return v},v}function nY(){var v=tW(["rules"]);return nY=function(){return v},v}function nZ(){var v=tW(["rules"]);return nZ=function(){return v},v}function nX(){var v=tW(["rules/asset"]);return nX=function(){return v},v}function nK(){var v=tW(["rules/asset/for/",""]);return nK=function(){return v},v}function nJ(){var v=tW(["rules/asset/",""]);return nJ=function(){return v},v}function nQ(){var v=tW(["rules/asset/",""]);return nQ=function(){return v},v}function n0(){var v=tW(["rules/asset/",""]);return n0=function(){return v},v}function n1(){var v=tW(["rules/geofences/",""]);return n1=function(){return v},v}function n2(){var v=tW(["rules/info/asset/",""]);return n2=function(){return v},v}function n5(){var v=tW(["rules/info/global"]);return n5=function(){return v},v}function n3(){var v=tW(["rules/info/realm/",""]);return n3=function(){return v},v}function n4(){var v=tW(["rules/realm"]);return n4=function(){return v},v}function n6(){var v=tW(["rules/realm/for/",""]);return n6=function(){return v},v}function n8(){var v=tW(["rules/realm/",""]);return n8=function(){return v},v}function n7(){var v=tW(["rules/realm/",""]);return n7=function(){return v},v}function n9(){var v=tW(["rules/realm/",""]);return n9=function(){return v},v}function ie(){var v=tW(["rules/",""]);return ie=function(){return v},v}function it(){var v=tW(["rules/",""]);return it=function(){return v},v}function ii(){var v=tW(["rules/",""]);return ii=function(){return v},v}function ir(){var v=tW(["console/register"]);return ir=function(){return v},v}function io(){var v=tW(["provisioning"]);return io=function(){return v},v}function ia(){var v=tW(["provisioning"]);return ia=function(){return v},v}function is(){var v=tW(["provisioning/",""]);return is=function(){return v},v}function il(){var v=tW(["provisioning/",""]);return il=function(){return v},v}function ic(){var v=tW(["map"]);return ic=function(){return v},v}function iu(){var v=tW(["map"]);return iu=function(){return v},v}function id(){var v=tW(["map/deleteMap"]);return id=function(){return v},v}function ih(){var v=tW(["map/getCustomMapInfo"]);return ih=function(){return v},v}function ip(){var v=tW(["map/tile/","/","/",""]);return ip=function(){return v},v}function im(){var v=tW(["map/upload"]);return im=function(){return v},v}function ig(){var v=tW(["asset/predicted/","/",""]);return ig=function(){return v},v}function iv(){var v=tW(["asset/predicted/","/",""]);return iv=function(){return v},v}function ib(){var v=tW(["configuration/manager"]);return ib=function(){return v},v}function iy(){var v=tW(["configuration/manager"]);return iy=function(){return v},v}function i_(){var v=tW(["configuration/manager/file"]);return i_=function(){return v},v}function ix(){var v=tW(["configuration/manager/image/",""]);return ix=function(){return v},v}function iw(){var v=tW(["asset/datapoint/export"]);return iw=function(){return v},v}function ik(){var v=tW(["asset/datapoint/periods"]);return ik=function(){return v},v}function iA(){var v=tW(["asset/datapoint/","/",""]);return iA=function(){return v},v}function iC(){var v=tW(["notification"]);return iC=function(){return v},v}function iE(){var v=tW(["notification"]);return iE=function(){return v},v}function iS(){var v=tW(["notification/alert"]);return iS=function(){return v},v}function iT(){var v=tW(["notification/count"]);return iT=function(){return v},v}function iO(){var v=tW(["notification/",""]);return iO=function(){return v},v}function iF(){var v=tW(["notification/","/acknowledged"]);return iF=function(){return v},v}function iI(){var v=tW(["notification/","/delivered"]);return iI=function(){return v},v}function iM(){var v=tW(["asset"]);return iM=function(){return v},v}function iR(){var v=tW(["asset"]);return iR=function(){return v},v}function iD(){var v=tW(["asset/attributes"]);return iD=function(){return v},v}function iP(){var v=tW(["asset/attributes/timestamp"]);return iP=function(){return v},v}function iL(){var v=tW(["asset/count"]);return iL=function(){return v},v}function iN(){var v=tW(["asset/parent"]);return iN=function(){return v},v}function iz(){var v=tW(["asset/partial/",""]);return iz=function(){return v},v}function ij(){var v=tW(["asset/query"]);return ij=function(){return v},v}function iB(){var v=tW(["asset/tree"]);return iB=function(){return v},v}function i$(){var v=tW(["asset/user/current"]);return i$=function(){return v},v}function iU(){var v=tW(["asset/user/link"]);return iU=function(){return v},v}function iV(){var v=tW(["asset/user/link"]);return iV=function(){return v},v}function iq(){var v=tW(["asset/user/link/delete"]);return iq=function(){return v},v}function iH(){var v=tW(["asset/user/link/","/",""]);return iH=function(){return v},v}function iW(){var v=tW(["asset/user/link/","/","/",""]);return iW=function(){return v},v}function iG(){var v=tW(["asset/",""]);return iG=function(){return v},v}function iY(){var v=tW(["asset/",""]);return iY=function(){return v},v}function iZ(){var v=tW(["asset/","/attribute/",""]);return iZ=function(){return v},v}function iX(){var v=tW(["asset/","/attribute/","/",""]);return iX=function(){return v},v}function iK(){var v=tW(["asset/","/child"]);return iK=function(){return v},v}function iJ(){var v=tW(["service"]);return iJ=function(){return v},v}function iQ(){var v=tW(["service"]);return iQ=function(){return v},v}function i0(){var v=tW(["service/global"]);return i0=function(){return v},v}function i1(){var v=tW(["service/global"]);return i1=function(){return v},v}function i2(){var v=tW(["service/","/",""]);return i2=function(){return v},v}function i5(){var v=tW(["service/","/",""]);return i5=function(){return v},v}function i3(){var v=tW(["service/","/",""]);return i3=function(){return v},v}function i4(){var v=tW(["gateway/tunnel"]);return i4=function(){return v},v}function i6(){var v=tW(["gateway/tunnel"]);return i6=function(){return v},v}function i8(){var v=tW(["gateway/tunnel/",""]);return i8=function(){return v},v}function i7(){var v=tW(["gateway/tunnel/","/",""]);return i7=function(){return v},v}function i9(){var v=tW(["gateway/tunnel/","/","/","/",""]);return i9=function(){return v},v}function re(){var v=tW(["model/assetDescriptors"]);return re=function(){return v},v}function rt(){var v=tW(["model/assetInfo/",""]);return rt=function(){return v},v}function rn(){var v=tW(["model/assetInfos"]);return rn=function(){return v},v}function ri(){var v=tW(["model/getValueDescriptorSchema"]);return ri=function(){return v},v}function rr(){var v=tW(["model/metaItemDescriptors"]);return rr=function(){return v},v}function ro(){var v=tW(["model/valueDescriptors"]);return ro=function(){return v},v}tN.Axios=tD,tN.CanceledError=e4,tN.CancelToken=tP,tN.isCancel=e3,tN.VERSION="1.18.1",tN.toFormData=eL,tN.AxiosError=eI,tN.Cancel=tN.CanceledError,tN.all=function(v){return Promise.all(v)},tN.spread=function(v){return function(b){return v.apply(null,b)}},tN.isAxiosError=function(v){return ey.isObject(v)&&!0===v.isAxiosError},tN.mergeConfig=tc,tN.AxiosHeaders=eO,tN.formToJSON=v=>e0(ey.isHTMLForm(v)?new FormData(v):v),tN.getAdapter=tT,tN.HttpStatusCode=tL,tN.default=tN;var ra=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"createAlarm",value:function(v,b,y){return this.httpClient.request({method:"POST",url:rT(tG()),queryParams:b,data:v,options:y})}},{key:"getAlarms",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(tY()),queryParams:v,options:b})}},{key:"removeAlarms",value:function(v,b){return this.httpClient.request({method:"DELETE",url:rT(tZ()),data:v,options:b})}},{key:"setAssetLinks",value:function(v,b){return this.httpClient.request({method:"PUT",url:rT(tX()),data:v,options:b})}},{key:"getAlarm",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(tK(),v),options:b})}},{key:"removeAlarm",value:function(v,b){return this.httpClient.request({method:"DELETE",url:rT(tJ(),v),options:b})}},{key:"updateAlarm",value:function(v,b,y){return this.httpClient.request({method:"PUT",url:rT(tQ(),v),data:b,options:y})}},{key:"getAssetLinks",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(t0(),v),queryParams:b,options:y})}}]),v}(),rs=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"getApps",value:function(v){return this.httpClient.request({method:"GET",url:rT(t1()),options:v})}},{key:"getConsoleConfig",value:function(v){return this.httpClient.request({method:"GET",url:rT(t2()),options:v})}},{key:"getAppInfos",value:function(v){return this.httpClient.request({method:"GET",url:rT(t5()),options:v})}}]),v}(),rl=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"create",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(t3()),data:v,options:b})}},{key:"update",value:function(v,b){return this.httpClient.request({method:"PUT",url:rT(t4()),data:v,options:b})}},{key:"getAllRealmDashboards",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(t6(),v),options:b})}},{key:"query",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(t8()),data:v,options:b})}},{key:"delete",value:function(v,b,y){return this.httpClient.request({method:"DELETE",url:rT(t7(),v,b),options:y})}},{key:"get",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(t9(),v,b),options:y})}}]),v}(),rc=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"getConfig",value:function(v){return this.httpClient.request({method:"GET",url:rT(ne()),options:v})}},{key:"updateConfig",value:function(v,b){return this.httpClient.request({method:"PUT",url:rT(nt()),data:v,options:b})}},{key:"clearEvents",value:function(v){return this.httpClient.request({method:"DELETE",url:rT(nn()),options:v})}},{key:"getEvents",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(ni()),queryParams:v,options:b})}}]),v}(),ru=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"deleteConnections",value:function(v,b){return this.httpClient.request({method:"DELETE",url:rT(nr()),queryParams:v,options:b})}},{key:"getConnections",value:function(v){return this.httpClient.request({method:"GET",url:rT(no()),options:v})}},{key:"deleteConnection",value:function(v,b){return this.httpClient.request({method:"DELETE",url:rT(na(),v),options:b})}},{key:"getConnection",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(ns(),v),options:b})}},{key:"setConnection",value:function(v,b,y){return this.httpClient.request({method:"PUT",url:rT(nl(),v),data:b,options:y})}},{key:"getConnectionStatus",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(nc(),v),options:b})}}]),v}(),rd=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"updateCurrentUserLocale",value:function(v,b){return this.httpClient.request({method:"PUT",url:rT(nu()),data:v,options:b})}},{key:"query",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(nd()),data:v,options:b})}},{key:"requestPasswordResetCurrent",value:function(v){return this.httpClient.request({method:"PUT",url:rT(nh()),options:v})}},{key:"updatePasswordCurrent",value:function(v,b){return this.httpClient.request({method:"PUT",url:rT(np()),data:v,options:b})}},{key:"updateCurrent",value:function(v,b){return this.httpClient.request({method:"PUT",url:rT(nf()),data:v,options:b})}},{key:"getCurrent",value:function(v){return this.httpClient.request({method:"GET",url:rT(nm()),options:v})}},{key:"getCurrentUserRealmRoles",value:function(v){return this.httpClient.request({method:"GET",url:rT(ng()),options:v})}},{key:"getCurrentUserClientRoles",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(nv(),v),options:b})}},{key:"disconnectUserSession",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(nb(),v,b),options:y})}},{key:"requestPasswordReset",value:function(v,b,y){return this.httpClient.request({method:"PUT",url:rT(ny(),v,b),options:y})}},{key:"updatePassword",value:function(v,b,y,_){return this.httpClient.request({method:"PUT",url:rT(n_(),v,b),data:y,options:_})}},{key:"resetSecret",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(nx(),v,b),options:y})}},{key:"updateRoles",value:function(v,b,y){return this.httpClient.request({method:"PUT",url:rT(nw(),v),data:b,options:y})}},{key:"getUserRealmRoles",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(nk(),v,b),options:y})}},{key:"updateUserRealmRoles",value:function(v,b,y,_){return this.httpClient.request({method:"PUT",url:rT(nA(),v,b),data:y,options:_})}},{key:"getUserClientRoles",value:function(v,b,y,_){return this.httpClient.request({method:"GET",url:rT(nC(),v,b,y),options:_})}},{key:"updateUserClientRoles",value:function(v,b,y,_,x){return this.httpClient.request({method:"PUT",url:rT(nE(),v,b,y),data:_,options:x})}},{key:"getUserSessions",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(nS(),v,b),options:y})}},{key:"create",value:function(v,b,y){return this.httpClient.request({method:"POST",url:rT(nT(),v),data:b,options:y})}},{key:"update",value:function(v,b,y){return this.httpClient.request({method:"PUT",url:rT(nO(),v),data:b,options:y})}},{key:"delete",value:function(v,b,y){return this.httpClient.request({method:"DELETE",url:rT(nF(),v,b),options:y})}},{key:"getClientRoles",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(nI(),v,b),options:y})}},{key:"updateClientRoles",value:function(v,b,y,_){return this.httpClient.request({method:"PUT",url:rT(nM(),v,b),data:y,options:_})}},{key:"get",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(nR(),v,b),options:y})}}]),v}(),rh=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"doProtocolAssetDiscovery",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(nD(),v),queryParams:b,options:y})}},{key:"doProtocolAssetImport",value:function(v,b,y,_){return this.httpClient.request({method:"POST",url:rT(nP(),v),queryParams:y,data:b,options:_})}},{key:"doProtocolInstanceDiscovery",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(nL(),v),queryParams:b,options:y})}}]),v}(),rp=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"getHealthStatus",value:function(v){return this.httpClient.request({method:"GET",url:rT(nN()),options:v})}},{key:"getInfo",value:function(v){return this.httpClient.request({method:"GET",url:rT(nz()),options:v})}}]),v}(),rf=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"create",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(nj()),data:v,options:b})}},{key:"getAll",value:function(v){return this.httpClient.request({method:"GET",url:rT(nB()),options:v})}},{key:"getAccessible",value:function(v){return this.httpClient.request({method:"GET",url:rT(n$()),options:v})}},{key:"delete",value:function(v,b){return this.httpClient.request({method:"DELETE",url:rT(nU(),v),options:b})}},{key:"get",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(nV(),v),options:b})}},{key:"update",value:function(v,b,y){return this.httpClient.request({method:"PUT",url:rT(nq(),v),data:b,options:y})}}]),v}(),rm=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"getAllNodeDefinitions",value:function(v){return this.httpClient.request({method:"GET",url:rT(nH()),options:v})}},{key:"getNodeDefinition",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(nW(),v),options:b})}},{key:"getAllNodeDefinitionsByType",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(nG(),v),options:b})}}]),v}(),rg=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"createGlobalRuleset",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(nY()),data:v,options:b})}},{key:"getGlobalRulesets",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(nZ()),queryParams:v,options:b})}},{key:"createAssetRuleset",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(nX()),data:v,options:b})}},{key:"getAssetRulesets",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(nK(),v),queryParams:b,options:y})}},{key:"deleteAssetRuleset",value:function(v,b){return this.httpClient.request({method:"DELETE",url:rT(nJ(),v),options:b})}},{key:"getAssetRuleset",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(nQ(),v),options:b})}},{key:"updateAssetRuleset",value:function(v,b,y){return this.httpClient.request({method:"PUT",url:rT(n0(),v),data:b,options:y})}},{key:"getAssetGeofences",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(n1(),v),options:b})}},{key:"getAssetEngineInfo",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(n2(),v),options:b})}},{key:"getGlobalEngineInfo",value:function(v){return this.httpClient.request({method:"GET",url:rT(n5()),options:v})}},{key:"getRealmEngineInfo",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(n3(),v),options:b})}},{key:"createRealmRuleset",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(n4()),data:v,options:b})}},{key:"getRealmRulesets",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(n6(),v),queryParams:b,options:y})}},{key:"deleteRealmRuleset",value:function(v,b){return this.httpClient.request({method:"DELETE",url:rT(n8(),v),options:b})}},{key:"getRealmRuleset",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(n7(),v),options:b})}},{key:"updateRealmRuleset",value:function(v,b,y){return this.httpClient.request({method:"PUT",url:rT(n9(),v),data:b,options:y})}},{key:"deleteGlobalRuleset",value:function(v,b){return this.httpClient.request({method:"DELETE",url:rT(ie(),v),options:b})}},{key:"getGlobalRuleset",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(it(),v),options:b})}},{key:"updateGlobalRuleset",value:function(v,b,y){return this.httpClient.request({method:"PUT",url:rT(ii(),v),data:b,options:y})}}]),v}(),rv=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"register",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(ir()),data:v,options:b})}}]),v}(),rb=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"createProvisioningConfig",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(io()),data:v,options:b})}},{key:"getProvisioningConfigs",value:function(v){return this.httpClient.request({method:"GET",url:rT(ia()),options:v})}},{key:"deleteProvisioningConfig",value:function(v,b){return this.httpClient.request({method:"DELETE",url:rT(is(),v),options:b})}},{key:"updateProvisioningConfig",value:function(v,b,y){return this.httpClient.request({method:"PUT",url:rT(il(),v),data:b,options:y})}}]),v}(),ry=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"getSettings",value:function(v){return this.httpClient.request({method:"GET",url:rT(ic()),options:v})}},{key:"saveSettings",value:function(v,b){return this.httpClient.request({method:"PUT",url:rT(iu()),data:v,options:b})}},{key:"deleteMap",value:function(v){return this.httpClient.request({method:"DELETE",url:rT(id()),options:v})}},{key:"getCustomMapInfo",value:function(v){return this.httpClient.request({method:"GET",url:rT(ih()),options:v})}},{key:"getTile",value:function(v,b,y,_){return this.httpClient.request({method:"GET",url:rT(ip(),v,b,y),options:_})}},{key:"uploadMap",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(im()),queryParams:v,options:b})}}]),v}(),r_=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"getPredictedDatapoints",value:function(v,b,y,_){return this.httpClient.request({method:"POST",url:rT(ig(),v,b),data:y,options:_})}},{key:"writePredictedDatapoints",value:function(v,b,y,_){return this.httpClient.request({method:"PUT",url:rT(iv(),v,b),data:y,options:_})}}]),v}(),rx=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"getManagerConfig",value:function(v){return this.httpClient.request({method:"GET",url:rT(ib()),options:v})}},{key:"update",value:function(v,b){return this.httpClient.request({method:"PUT",url:rT(iy()),data:v,options:b})}},{key:"fileUpload",value:function(v,b,y){return this.httpClient.request({method:"POST",url:rT(i_()),queryParams:b,data:v,options:y})}},{key:"getManagerConfigImage",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(ix(),v),options:b})}}]),v}(),rw=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"getDatapointExport",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(iw()),queryParams:v,options:b})}},{key:"getDatapointPeriod",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(ik()),queryParams:v,options:b})}},{key:"getDatapoints",value:function(v,b,y,_){return this.httpClient.request({method:"POST",url:rT(iA(),v,b),data:y,options:_})}}]),v}(),rk=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"getNotifications",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(iC()),queryParams:v,options:b})}},{key:"removeNotifications",value:function(v,b){return this.httpClient.request({method:"DELETE",url:rT(iE()),queryParams:v,options:b})}},{key:"sendNotification",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(iS()),data:v,options:b})}},{key:"getNotificationsCount",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(iT()),queryParams:v,options:b})}},{key:"removeNotification",value:function(v,b){return this.httpClient.request({method:"DELETE",url:rT(iO(),v),options:b})}},{key:"notificationAcknowledged",value:function(v,b,y,_){return this.httpClient.request({method:"PUT",url:rT(iF(),v),queryParams:y,data:b,options:_})}},{key:"notificationDelivered",value:function(v,b,y){return this.httpClient.request({method:"PUT",url:rT(iI(),v),queryParams:b,options:y})}}]),v}(),rA=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"create",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(iM()),data:v,options:b})}},{key:"delete",value:function(v,b){return this.httpClient.request({method:"DELETE",url:rT(iR()),queryParams:v,options:b})}},{key:"writeAttributeValues",value:function(v,b){return this.httpClient.request({method:"PUT",url:rT(iD()),data:v,options:b})}},{key:"writeAttributeEvents",value:function(v,b){return this.httpClient.request({method:"PUT",url:rT(iP()),data:v,options:b})}},{key:"queryCount",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(iL()),data:v,options:b})}},{key:"updateNoneParent",value:function(v,b){return this.httpClient.request({method:"DELETE",url:rT(iN()),queryParams:v,options:b})}},{key:"getPartial",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(iz(),v),options:b})}},{key:"queryAssets",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(ij()),data:v,options:b})}},{key:"queryAssetTree",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(iB()),data:v,options:b})}},{key:"getCurrentUserAssets",value:function(v){return this.httpClient.request({method:"GET",url:rT(i$()),options:v})}},{key:"createUserAssetLinks",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(iU()),data:v,options:b})}},{key:"getUserAssetLinks",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(iV()),queryParams:v,options:b})}},{key:"deleteUserAssetLinks",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(iq()),data:v,options:b})}},{key:"deleteAllUserAssetLinks",value:function(v,b,y){return this.httpClient.request({method:"DELETE",url:rT(iH(),v,b),options:y})}},{key:"deleteUserAssetLink",value:function(v,b,y,_){return this.httpClient.request({method:"DELETE",url:rT(iW(),v,b,y),options:_})}},{key:"get",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(iG(),v),options:b})}},{key:"update",value:function(v,b,y){return this.httpClient.request({method:"PUT",url:rT(iY(),v),data:b,options:y})}},{key:"writeAttributeValue$PUT$asset_assetId_attribute_attributeName",value:function(v,b,y,_){return this.httpClient.request({method:"PUT",url:rT(iZ(),v,b),data:y,options:_})}},{key:"writeAttributeValue$PUT$asset_assetId_attribute_attributeName_timestamp",value:function(v,b,y,_,x){return this.httpClient.request({method:"PUT",url:rT(iX(),v,b,y),data:_,options:x})}},{key:"updateParent",value:function(v,b,y){return this.httpClient.request({method:"PUT",url:rT(iK(),v),queryParams:b,options:y})}}]),v}(),rC=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"getServices",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(iJ()),queryParams:v,options:b})}},{key:"registerService",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(iQ()),data:v,options:b})}},{key:"getGlobalServices",value:function(v){return this.httpClient.request({method:"GET",url:rT(i0()),options:v})}},{key:"registerGlobalService",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(i1()),data:v,options:b})}},{key:"deregisterService",value:function(v,b,y){return this.httpClient.request({method:"DELETE",url:rT(i2(),v,b),options:y})}},{key:"getService",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(i5(),v,b),options:y})}},{key:"heartbeat",value:function(v,b,y){return this.httpClient.request({method:"PUT",url:rT(i3(),v,b),options:y})}}]),v}(),rE=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"startTunnel",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(i4()),data:v,options:b})}},{key:"stopTunnel",value:function(v,b){return this.httpClient.request({method:"DELETE",url:rT(i6()),data:v,options:b})}},{key:"getAllActiveTunnelInfos",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(i8(),v),options:b})}},{key:"getGatewayActiveTunnelInfos",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(i7(),v,b),options:y})}},{key:"getActiveTunnelInfo",value:function(v,b,y,_,x){return this.httpClient.request({method:"GET",url:rT(i9(),v,b,y,_),options:x})}}]),v}(),rS=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"getAssetDescriptors",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(re()),queryParams:v,options:b})}},{key:"getAssetInfo",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(rt(),v),queryParams:b,options:y})}},{key:"getAssetInfos",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(rn()),queryParams:v,options:b})}},{key:"getValueDescriptorSchema",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(ri()),queryParams:v,options:b})}},{key:"getMetaItemDescriptors",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(rr()),queryParams:v,options:b})}},{key:"getValueDescriptors",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(ro()),queryParams:v,options:b})}}]),v}();function rT(v){for(var b=arguments.length,y=Array(b>1?b-1:0),_=1;_<b;_++)y[_-1]=arguments[_];for(var x="",w=0;w<y.length;w++)x+=v[w],x+=encodeURIComponent(y[w]);return x+v[v.length-1]}var rO=function(){function v(b){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();tj(this,v),this._alarmResource=new rI(b,y),this._appResource=new rM(b,y),this._dashboardResource=new rR(b,y),this._syslogResource=new rD(b,y),this._gatewayClientResource=new rP(b,y),this._userResource=new rL(b,y),this._agentResource=new rN(b,y),this._statusResource=new rz(b,y),this._realmResource=new rj(b,y),this._flowResource=new rB(b,y),this._rulesResource=new r$(b,y),this._consoleResource=new rU(b,y),this._provisioningResource=new rV(b,y),this._mapResource=new rq(b,y),this._assetPredictedDatapointResource=new rH(b,y),this._configurationResource=new rW(b,y),this._assetDatapointResource=new rG(b,y),this._notificationResource=new rY(b,y),this._assetResource=new rZ(b,y),this._externalServiceResource=new rX(b,y),this._gatewayServiceResource=new rK(b,y),this._assetModelResource=new rJ(b,y),this._assetResource=new rZ(b,y)}return t$(v,[{key:"AlarmResource",get:function(){return this._alarmResource}},{key:"AppResource",get:function(){return this._appResource}},{key:"DashboardResource",get:function(){return this._dashboardResource}},{key:"SyslogResource",get:function(){return this._syslogResource}},{key:"GatewayClientResource",get:function(){return this._gatewayClientResource}},{key:"UserResource",get:function(){return this._userResource}},{key:"AgentResource",get:function(){return this._agentResource}},{key:"StatusResource",get:function(){return this._statusResource}},{key:"RealmResource",get:function(){return this._realmResource}},{key:"FlowResource",get:function(){return this._flowResource}},{key:"RulesResource",get:function(){return this._rulesResource}},{key:"ConsoleResource",get:function(){return this._consoleResource}},{key:"ProvisioningResource",get:function(){return this._provisioningResource}},{key:"MapResource",get:function(){return this._mapResource}},{key:"AssetPredictedDatapointResource",get:function(){return this._assetPredictedDatapointResource}},{key:"ConfigurationResource",get:function(){return this._configurationResource}},{key:"AssetDatapointResource",get:function(){return this._assetDatapointResource}},{key:"NotificationResource",get:function(){return this._notificationResource}},{key:"AssetResource",get:function(){return this._assetResource}},{key:"ExternalServiceResource",get:function(){return this._externalServiceResource}},{key:"GatewayServiceResource",get:function(){return this._gatewayServiceResource}},{key:"AssetModelResource",get:function(){return this._assetModelResource}}]),v}(),rF=function(){function v(b){tj(this,v),this.axios=b}return t$(v,[{key:"request",value:function(v){var b={};b.method=v.method,b.url=v.url,b.params=v.queryParams,b.data=v.data,function(v,b){if(void 0!=b)for(var y in b)b.hasOwnProperty(y)&&(v[y]=b[y])}(b,v.options);var y=v.copyFn;return this.axios.request(b).then(function(v){return y&&v.data&&(v.originalData=v.data,v.data=y(v.data)),v})}}]),v}(),rI=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(ra),rM=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rs),rR=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rl),rD=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rc),rP=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(ru),rL=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rd),rN=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rh),rz=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rp),rj=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rf),rB=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rm),r$=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rg),rU=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rv),rV=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rb),rq=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(ry),rH=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(r_),rW=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rx),rG=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rw),rY=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rk),rZ=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rA),rX=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rC),rK=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rE),rJ=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rS),rQ=y(88183),r0=y.n(rQ),r1=tN.isAxiosError;let r2=new(function(){var v;function b(){if(!(this instanceof b))throw TypeError("Cannot call a class as a function");this._axiosInstance=tN.create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use(function(v){return v.paramsSerializer=function(v){return r0().stringify(v,{arrayFormat:"repeat"})},v})}return v=[{key:"api",get:function(){return this._client}},{key:"axiosInstance",get:function(){return this._axiosInstance}},{key:"baseUrl",get:function(){return this._baseUrl}},{key:"setTimeout",value:function(v){this._axiosInstance.defaults.timeout=v}},{key:"addRequestInterceptor",value:function(v){this._axiosInstance.interceptors.request.use(v)}},{key:"initialise",value:function(v){this._baseUrl=v,this._client=new rO(v,this._axiosInstance)}}],function(v,b){for(var y=0;y<b.length;y++){var _=b[y];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(v,_.key,_)}}(b.prototype,v),b}())},55610(){},47791(){},86550(){},85299(v,b,y){"use strict";let{normalizeIPv6:_,removeDotSegments:x,recomposeAuthority:w,normalizePercentEncoding:k,normalizePathEncoding:A,escapePreservingEscapes:C,reescapeHostDelimiters:E,isIPv4:S,nonSimpleDomain:T}=y(38670),{SCHEMES:O,getSchemeHandler:F}=y(7971);function I(v,b,y,_){let w={};return _||(v=N(M(v,y),y),b=N(M(b,y),y)),!(y=y||{}).tolerant&&b.scheme?(w.scheme=b.scheme,w.userinfo=b.userinfo,w.host=b.host,w.port=b.port,w.path=x(b.path||""),w.query=b.query):(void 0!==b.userinfo||void 0!==b.host||void 0!==b.port?(w.userinfo=b.userinfo,w.host=b.host,w.port=b.port,w.path=x(b.path||""),w.query=b.query):(b.path?("/"===b.path[0]?w.path=x(b.path):(void 0===v.userinfo&&void 0===v.host&&void 0===v.port||v.path?v.path?w.path=v.path.slice(0,v.path.lastIndexOf("/")+1)+b.path:w.path=b.path:w.path="/"+b.path,w.path=x(w.path)),w.query=b.query):(w.path=v.path,void 0!==b.query?w.query=b.query:w.query=v.query),w.userinfo=v.userinfo,w.host=v.host,w.port=v.port),w.scheme=v.scheme),w.fragment=b.fragment,w}function M(v,b){let y={host:v.host,scheme:v.scheme,userinfo:v.userinfo,port:v.port,path:v.path,query:v.query,nid:v.nid,nss:v.nss,uuid:v.uuid,fragment:v.fragment,reference:v.reference,resourceName:v.resourceName,secure:v.secure,error:""},_=Object.assign({},b),A=[],E=F(_.scheme||y.scheme);E&&E.serialize&&E.serialize(y,_),void 0!==y.path&&(_.skipEscape?y.path=k(y.path):(y.path=C(y.path),void 0!==y.scheme&&(y.path=y.path.split("%3A").join(":")))),"suffix"!==_.reference&&y.scheme&&A.push(y.scheme,":");let S=w(y);if(void 0!==S&&("suffix"!==_.reference&&A.push("//"),A.push(S),y.path&&"/"!==y.path[0]&&A.push("/")),void 0!==y.path){let v=y.path;_.absolutePath||E&&E.absolutePath||(v=x(v)),void 0===S&&"/"===v[0]&&"/"===v[1]&&(v="/%2F"+v.slice(2)),A.push(v)}return void 0!==y.query&&A.push("?",y.query),void 0!==y.fragment&&A.push("#",y.fragment),A.join("")}let R=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,D=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,P=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function L(v,b){let y=Object.assign({},b),x={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},w=!1,k=!1;"suffix"===y.reference&&(v=y.scheme?y.scheme+":"+v:"//"+v);let C=v.match(D);null!==C&&-1!==C[1].indexOf("\\")&&(x.error="URI authority must not contain a literal backslash.",w=!0);let O=v.match(P);if(null!==O){let v=O[1],b=v.replace(/[\t\n\r]/g,"");b.length>=2&&("//"!==b.slice(0,2)?(x.error=x.error||"URI authority must not contain a literal backslash.",w=!0):v.length!==b.length&&(x.error=x.error||"URI authority introducer must not contain whitespace.",w=!0))}let I=v.match(R);if(I){x.scheme=I[1],x.userinfo=I[3],x.host=I[4],x.port=parseInt(I[5],10),x.path=I[6]||"",x.query=I[7],x.fragment=I[8],isNaN(x.port)&&(x.port=I[5]);let b=void 0!==I[2]&&x.path&&"/"!==x.path[0]?'URI path must start with "/" when authority is present.':"number"==typeof x.port&&(x.port<0||x.port>65535)?"URI port is malformed.":void 0;if(void 0!==b&&(x.error=x.error||b,w=!0),x.host)if(!1===S(x.host)){let v=_(x.host);x.host=v.host.toLowerCase(),k=v.isIPV6}else k=!0;void 0!==x.scheme||void 0!==x.userinfo||void 0!==x.host||void 0!==x.port||void 0!==x.query||x.path?void 0===x.scheme?x.reference="relative":void 0===x.fragment?x.reference="absolute":x.reference="uri":x.reference="same-document",y.reference&&"suffix"!==y.reference&&y.reference!==x.reference&&(x.error=x.error||"URI is not a "+y.reference+" reference.");let C=F(y.scheme||x.scheme);if(!y.unicodeSupport&&(!C||!C.unicodeSupport)&&x.host&&(y.domainHost||C&&C.domainHost)&&!1===k&&T(x.host))try{x.host=new URL("http://"+x.host).hostname}catch(v){x.error=x.error||"Host's domain name can not be converted to ASCII: "+v}if((!C||C&&!C.skipNormalize)&&(-1!==v.indexOf("%")&&(void 0!==x.scheme&&(x.scheme=unescape(x.scheme)),void 0!==x.host&&(x.host=E(unescape(x.host),k))),x.path&&(x.path=A(x.path)),x.fragment))try{x.fragment=encodeURI(decodeURIComponent(x.fragment))}catch{x.error=x.error||"URI malformed"}C&&C.parse&&C.parse(x,y)}else x.error=x.error||"URI can not be parsed.";return{parsed:x,malformedAuthorityOrPort:w}}function N(v,b){return L(v,b).parsed}function z(v,b){let{parsed:y,malformedAuthorityOrPort:_}=L(v,b);return{normalized:_?v:M(y,b),malformedAuthorityOrPort:_}}function j(v,b){if("string"==typeof v){let{normalized:y,malformedAuthorityOrPort:_}=z(v,b);return _?void 0:y}if("object"==typeof v)return M(v,b)}let B={SCHEMES:O,normalize:function(v,b){return"string"==typeof v?v=z(v,b).normalized:"object"==typeof v&&(v=N(M(v,b),b)),v},resolve:function(v,b,y){let _=y?Object.assign({scheme:"null"},y):{scheme:"null"},{parsed:x,malformedAuthorityOrPort:w}=L(v,_),{parsed:k,malformedAuthorityOrPort:A}=L(b,_);if(w||A)throw Error(x.error||k.error||"URI is malformed.");let C=I(x,k,_,!0);return _.skipEscape=!0,M(C,_)},resolveComponent:I,equal:function(v,b,y){let _=j(v,y),x=j(b,y);return void 0!==_&&void 0!==x&&_.toLowerCase()===x.toLowerCase()},serialize:M,parse:N};v.exports=B,v.exports.default=B,v.exports.fastUri=B},7971(v,b,y){"use strict";let{isUUID:_}=y(38670),x=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,w=["http","https","ws","wss","urn","urn:uuid"];function k(v){return!0===v.secure||!1!==v.secure&&!!v.scheme&&3===v.scheme.length&&("w"===v.scheme[0]||"W"===v.scheme[0])&&("s"===v.scheme[1]||"S"===v.scheme[1])&&("s"===v.scheme[2]||"S"===v.scheme[2])}function A(v){return v.host||(v.error=v.error||"HTTP URIs must have a host."),v}function C(v){let b="https"===String(v.scheme).toLowerCase();return(v.port===(b?443:80)||""===v.port)&&(v.port=void 0),v.path||(v.path="/"),v}let E={scheme:"http",domainHost:!0,parse:A,serialize:C},S={scheme:"https",domainHost:E.domainHost,parse:A,serialize:C},T={scheme:"ws",domainHost:!0,parse:function(v){return v.secure=k(v),v.resourceName=(v.path||"/")+(v.query?"?"+v.query:""),v.path=void 0,v.query=void 0,v},serialize:function(v){if((v.port===(k(v)?443:80)||""===v.port)&&(v.port=void 0),"boolean"==typeof v.secure&&(v.scheme=v.secure?"wss":"ws",v.secure=void 0),v.resourceName){let[b,y]=v.resourceName.split("?");v.path=b&&"/"!==b?b:void 0,v.query=y,v.resourceName=void 0}return v.fragment=void 0,v}},O={scheme:"wss",domainHost:T.domainHost,parse:T.parse,serialize:T.serialize},F={http:E,https:S,ws:T,wss:O,urn:{scheme:"urn",parse:function(v,b){if(!v.path)return v.error="URN can not be parsed",v;let y=v.path.match(x);if(y){let _=b.scheme||v.scheme||"urn";v.nid=y[1].toLowerCase(),v.nss=y[2];let x=I(`${_}:${b.nid||v.nid}`);v.path=void 0,x&&(v=x.parse(v,b))}else v.error=v.error||"URN can not be parsed.";return v},serialize:function(v,b){if(void 0===v.nid)throw Error("URN without nid cannot be serialized");let y=b.scheme||v.scheme||"urn",_=v.nid.toLowerCase(),x=I(`${y}:${b.nid||_}`);x&&(v=x.serialize(v,b));let w=v,k=v.nss;return w.path=`${_||b.nid}:${k}`,b.skipEscape=!0,w},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(v,b){return v.uuid=v.nss,v.nss=void 0,b.tolerant||v.uuid&&_(v.uuid)||(v.error=v.error||"UUID is not valid."),v},serialize:function(v){return v.nss=(v.uuid||"").toLowerCase(),v},skipNormalize:!0}};function I(v){return v&&(F[v]||F[v.toLowerCase()])||void 0}Object.setPrototypeOf(F,null),v.exports={wsIsSecure:k,SCHEMES:F,isValidSchemeName:function(v){return -1!==w.indexOf(v)},getSchemeHandler:I}},38670(v){"use strict";let b=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),y=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),_=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),x=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),w=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function k(v){let b="",y=0,_=0;for(_=0;_<v.length;_++)if(48!==(y=v[_].charCodeAt(0))){if(!(y>=48&&y<=57||y>=65&&y<=70||y>=97&&y<=102))return"";b+=v[_];break}for(_+=1;_<v.length;_++){if(!((y=v[_].charCodeAt(0))>=48&&y<=57||y>=65&&y<=70||y>=97&&y<=102))return"";b+=v[_]}return b}let A=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function C(v){return v.length=0,!0}function E(v,b,y){if(v.length){let _=k(v);if(""===_)return y.error=!0,!1;b.push(_),v.length=0}return!0}function S(v){if(2>function(v){let b=0;for(let y=0;y<v.length;y++)":"===v[y]&&b++;return b}(v))return{host:v,isIPV6:!1};let b=function(v){let b=0,y={error:!1,address:"",zone:""},_=[],x=[],w=!1,A=!1,S=E;for(let k=0;k<v.length;k++){let E=v[k];if("["!==E&&"]"!==E)if(":"===E){if(!0===w&&(A=!0),!S(x,_,y))break;if(++b>7){y.error=!0;break}k>0&&":"===v[k-1]&&(w=!0),_.push(":");continue}else if("%"===E){if(!S(x,_,y))break;S=C}else{x.push(E);continue}}return x.length&&(S===C?y.zone=x.join(""):A?_.push(x.join("")):_.push(k(x))),y.address=_.join(""),y}(v);if(b.error)return{host:v,isIPV6:!1};{let v=b.address,y=b.address;return b.zone&&(v+="%"+b.zone,y+="%25"+b.zone),{host:v,isIPV6:!0,escapedHost:y}}}let T={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},O=/[@/?#:]/g,F=/[@/?#]/g;function I(v,b){let y=b?F:O;return y.lastIndex=0,v.replace(y,v=>T[v])}v.exports={nonSimpleDomain:A,recomposeAuthority:function(v){let b=[];if(void 0!==v.userinfo&&(b.push(v.userinfo),b.push("@")),void 0!==v.host){let _=unescape(v.host);if(!y(_)){let v=S(_);_=!0===v.isIPV6?`[${v.escapedHost}]`:I(_,!1)}b.push(_)}return("number"==typeof v.port||"string"==typeof v.port)&&(b.push(":"),b.push(String(v.port))),b.length?b.join(""):void 0},reescapeHostDelimiters:I,normalizePercentEncoding:function(v,b=!1){if(-1===v.indexOf("%"))return v;let y="";for(let w=0;w<v.length;w++){if("%"===v[w]&&w+2<v.length){let k=v.slice(w+1,w+3);if(_(k)){let v=k.toUpperCase(),_=String.fromCharCode(parseInt(v,16));b&&x(_)?y+=_:y+="%"+v,w+=2;continue}}y+=v[w]}return y},normalizePathEncoding:function(v){let b="";for(let y=0;y<v.length;y++){if("%"===v[y]&&y+2<v.length){let w=v.slice(y+1,y+3);if(_(w)){let v=w.toUpperCase(),_=String.fromCharCode(parseInt(v,16));"."!==_&&x(_)?b+=_:b+="%"+v,y+=2;continue}}w(v[y])?b+=v[y]:b+=escape(v[y])}return b},escapePreservingEscapes:function(v){let b="";for(let y=0;y<v.length;y++){if("%"===v[y]&&y+2<v.length){let x=v.slice(y+1,y+3);if(_(x)){b+="%"+x.toUpperCase(),y+=2;continue}}b+=escape(v[y])}return b},removeDotSegments:function(v){let b=v,y=[],_=-1,x=0;for(;x=b.length;){if(1===x)if("."===b)break;else if("/"===b){y.push("/");break}else{y.push(b);break}if(2===x){if("."===b[0]){if("."===b[1])break;else if("/"===b[1]){b=b.slice(2);continue}}else if("/"===b[0]&&("."===b[1]||"/"===b[1])){y.push("/");break}}else if(3===x&&"/.."===b){0!==y.length&&y.pop(),y.push("/");break}if("."===b[0]){if("."===b[1]){if("/"===b[2]){b=b.slice(3);continue}}else if("/"===b[1]){b=b.slice(2);continue}}else if("/"===b[0]&&"."===b[1]){if("/"===b[2]){b=b.slice(2);continue}else if("."===b[2]&&"/"===b[3]){b=b.slice(3),0!==y.length&&y.pop();continue}}if(-1===(_=b.indexOf("/",1))){y.push(b);break}y.push(b.slice(0,_)),b=b.slice(_)}return y.join("")},isIPv4:y,isUUID:b,normalizeIPv6:S,stringArrayToHexStripped:k}},97271(v){v.exports={aa:{name:"Afar",nativeName:"Afaraf"},ab:{name:"Abkhaz",nativeName:"аҧсуа бызшәа"},ae:{name:"Avestan",nativeName:"avesta"},af:{name:"Afrikaans",nativeName:"Afrikaans"},ak:{name:"Akan",nativeName:"Akan"},am:{name:"Amharic",nativeName:"አማርኛ"},an:{name:"Aragonese",nativeName:"aragon\xe9s"},ar:{name:"Arabic",nativeName:"العربية"},as:{name:"Assamese",nativeName:"অসমীয়া"},av:{name:"Avaric",nativeName:"авар мацӀ"},ay:{name:"Aymara",nativeName:"aymar aru"},az:{name:"Azerbaijani",nativeName:"azərbaycan dili"},ba:{name:"Bashkir",nativeName:"башҡорт теле"},be:{name:"Belarusian",nativeName:"беларуская мова"},bg:{name:"Bulgarian",nativeName:"български език"},bi:{name:"Bislama",nativeName:"Bislama"},bm:{name:"Bambara",nativeName:"bamanankan"},bn:{name:"Bengali",nativeName:"বাংলা"},bo:{name:"Tibetan",nativeName:"བོད་ཡིག"},br:{name:"Breton",nativeName:"brezhoneg"},bs:{name:"Bosnian",nativeName:"bosanski jezik"},ca:{name:"Catalan",nativeName:"Catal\xe0"},ce:{name:"Chechen",nativeName:"нохчийн мотт"},ch:{name:"Chamorro",nativeName:"Chamoru"},co:{name:"Corsican",nativeName:"corsu"},cr:{name:"Cree",nativeName:"ᓀᐦᐃᔭᐍᐏᐣ"},cs:{name:"Czech",nativeName:"čeština"},cu:{name:"Old Church Slavonic",nativeName:"ѩзыкъ словѣньскъ"},cv:{name:"Chuvash",nativeName:"чӑваш чӗлхи"},cy:{name:"Welsh",nativeName:"Cymraeg"},da:{name:"Danish",nativeName:"Dansk"},de:{name:"German",nativeName:"Deutsch"},dv:{name:"Divehi",nativeName:"ދިވެހި"},dz:{name:"Dzongkha",nativeName:"རྫོང་ཁ"},ee:{name:"Ewe",nativeName:"Eʋegbe"},el:{name:"Greek",nativeName:"Ελληνικά"},en:{name:"English",nativeName:"English"},eo:{name:"Esperanto",nativeName:"Esperanto"},es:{name:"Spanish",nativeName:"Espa\xf1ol"},et:{name:"Estonian",nativeName:"eesti"},eu:{name:"Basque",nativeName:"euskara"},fa:{name:"Persian",nativeName:"فارسی"},ff:{name:"Fula",nativeName:"Fulfulde"},fi:{name:"Finnish",nativeName:"suomi"},fj:{name:"Fijian",nativeName:"vosa Vakaviti"},fo:{name:"Faroese",nativeName:"F\xf8royskt"},fr:{name:"French",nativeName:"Fran\xe7ais"},fy:{name:"Western Frisian",nativeName:"Frysk"},ga:{name:"Irish",nativeName:"Gaeilge"},gd:{name:"Scottish Gaelic",nativeName:"G\xe0idhlig"},gl:{name:"Galician",nativeName:"galego"},gn:{name:"Guaran\xed",nativeName:"Ava\xf1e'ẽ"},gu:{name:"Gujarati",nativeName:"ગુજરાતી"},gv:{name:"Manx",nativeName:"Gaelg"},ha:{name:"Hausa",nativeName:"هَوُسَ"},he:{name:"Hebrew",nativeName:"עברית"},hi:{name:"Hindi",nativeName:"हिन्दी"},ho:{name:"Hiri Motu",nativeName:"Hiri Motu"},hr:{name:"Croatian",nativeName:"Hrvatski"},ht:{name:"Haitian",nativeName:"Krey\xf2l ayisyen"},hu:{name:"Hungarian",nativeName:"magyar"},hy:{name:"Armenian",nativeName:"Հայերեն"},hz:{name:"Herero",nativeName:"Otjiherero"},ia:{name:"Interlingua",nativeName:"Interlingua"},id:{name:"Indonesian",nativeName:"Bahasa Indonesia"},ie:{name:"Interlingue",nativeName:"Interlingue"},ig:{name:"Igbo",nativeName:"Asụsụ Igbo"},ii:{name:"Nuosu",nativeName:"ꆈꌠ꒿ Nuosuhxop"},ik:{name:"Inupiaq",nativeName:"I\xf1upiaq"},io:{name:"Ido",nativeName:"Ido"},is:{name:"Icelandic",nativeName:"\xcdslenska"},it:{name:"Italian",nativeName:"Italiano"},iu:{name:"Inuktitut",nativeName:"ᐃᓄᒃᑎᑐᑦ"},ja:{name:"Japanese",nativeName:"日本語"},jv:{name:"Javanese",nativeName:"basa Jawa"},ka:{name:"Georgian",nativeName:"ქართული"},kg:{name:"Kongo",nativeName:"Kikongo"},ki:{name:"Kikuyu",nativeName:"Gĩkũyũ"},kj:{name:"Kwanyama",nativeName:"Kuanyama"},kk:{name:"Kazakh",nativeName:"қазақ тілі"},kl:{name:"Kalaallisut",nativeName:"kalaallisut"},km:{name:"Khmer",nativeName:"ខេមរភាសា"},kn:{name:"Kannada",nativeName:"ಕನ್ನಡ"},ko:{name:"Korean",nativeName:"한국어"},kr:{name:"Kanuri",nativeName:"Kanuri"},ks:{name:"Kashmiri",nativeName:"कश्मीरी"},ku:{name:"Kurdish",nativeName:"Kurd\xee"},kv:{name:"Komi",nativeName:"коми кыв"},kw:{name:"Cornish",nativeName:"Kernewek"},ky:{name:"Kyrgyz",nativeName:"Кыргызча"},la:{name:"Latin",nativeName:"latine"},lb:{name:"Luxembourgish",nativeName:"L\xebtzebuergesch"},lg:{name:"Ganda",nativeName:"Luganda"},li:{name:"Limburgish",nativeName:"Limburgs"},ln:{name:"Lingala",nativeName:"Ling\xe1la"},lo:{name:"Lao",nativeName:"ພາສາລາວ"},lt:{name:"Lithuanian",nativeName:"lietuvių kalba"},lu:{name:"Luba-Katanga",nativeName:"Kiluba"},lv:{name:"Latvian",nativeName:"latviešu valoda"},mg:{name:"Malagasy",nativeName:"fiteny malagasy"},mh:{name:"Marshallese",nativeName:"Kajin M̧ajeļ"},mi:{name:"Māori",nativeName:"te reo Māori"},mk:{name:"Macedonian",nativeName:"македонски јазик"},ml:{name:"Malayalam",nativeName:"മലയാളം"},mn:{name:"Mongolian",nativeName:"Монгол хэл"},mr:{name:"Marathi",nativeName:"मराठी"},ms:{name:"Malay",nativeName:"Bahasa Melayu"},mt:{name:"Maltese",nativeName:"Malti"},my:{name:"Burmese",nativeName:"ဗမာစာ"},na:{name:"Nauru",nativeName:"Dorerin Naoero"},nb:{name:"Norwegian Bokm\xe5l",nativeName:"Norsk bokm\xe5l"},nd:{name:"Northern Ndebele",nativeName:"isiNdebele"},ne:{name:"Nepali",nativeName:"नेपाली"},ng:{name:"Ndonga",nativeName:"Owambo"},nl:{name:"Dutch",nativeName:"Nederlands"},nn:{name:"Norwegian Nynorsk",nativeName:"Norsk nynorsk"},no:{name:"Norwegian",nativeName:"Norsk"},nr:{name:"Southern Ndebele",nativeName:"isiNdebele"},nv:{name:"Navajo",nativeName:"Din\xe9 bizaad"},ny:{name:"Chichewa",nativeName:"chiCheŵa"},oc:{name:"Occitan",nativeName:"occitan"},oj:{name:"Ojibwe",nativeName:"ᐊᓂᔑᓈᐯᒧᐎᓐ"},om:{name:"Oromo",nativeName:"Afaan Oromoo"},or:{name:"Oriya",nativeName:"ଓଡ଼ିଆ"},os:{name:"Ossetian",nativeName:"ирон \xe6взаг"},pa:{name:"Panjabi",nativeName:"ਪੰਜਾਬੀ"},pi:{name:"Pāli",nativeName:"पाऴि"},pl:{name:"Polish",nativeName:"Polski"},ps:{name:"Pashto",nativeName:"پښتو"},pt:{name:"Portuguese",nativeName:"Portugu\xeas"},qu:{name:"Quechua",nativeName:"Runa Simi"},rm:{name:"Romansh",nativeName:"rumantsch grischun"},rn:{name:"Kirundi",nativeName:"Ikirundi"},ro:{name:"Romanian",nativeName:"Rom\xe2nă"},ru:{name:"Russian",nativeName:"Русский"},rw:{name:"Kinyarwanda",nativeName:"Ikinyarwanda"},sa:{name:"Sanskrit",nativeName:"संस्कृतम्"},sc:{name:"Sardinian",nativeName:"sardu"},sd:{name:"Sindhi",nativeName:"सिन्धी"},se:{name:"Northern Sami",nativeName:"Davvis\xe1megiella"},sg:{name:"Sango",nativeName:"y\xe2ng\xe2 t\xee s\xe4ng\xf6"},si:{name:"Sinhala",nativeName:"සිංහල"},sk:{name:"Slovak",nativeName:"slovenčina"},sl:{name:"Slovenian",nativeName:"slovenščina"},sm:{name:"Samoan",nativeName:"gagana fa'a Samoa"},sn:{name:"Shona",nativeName:"chiShona"},so:{name:"Somali",nativeName:"Soomaaliga"},sq:{name:"Albanian",nativeName:"Shqip"},sr:{name:"Serbian",nativeName:"српски језик"},ss:{name:"Swati",nativeName:"SiSwati"},st:{name:"Southern Sotho",nativeName:"Sesotho"},su:{name:"Sundanese",nativeName:"Basa Sunda"},sv:{name:"Swedish",nativeName:"Svenska"},sw:{name:"Swahili",nativeName:"Kiswahili"},ta:{name:"Tamil",nativeName:"தமிழ்"},te:{name:"Telugu",nativeName:"తెలుగు"},tg:{name:"Tajik",nativeName:"тоҷикӣ"},th:{name:"Thai",nativeName:"ไทย"},ti:{name:"Tigrinya",nativeName:"ትግርኛ"},tk:{name:"Turkmen",nativeName:"T\xfcrkmen\xe7e"},tl:{name:"Tagalog",nativeName:"Wikang Tagalog"},tn:{name:"Tswana",nativeName:"Setswana"},to:{name:"Tonga",nativeName:"faka Tonga"},tr:{name:"Turkish",nativeName:"T\xfcrk\xe7e"},ts:{name:"Tsonga",nativeName:"Xitsonga"},tt:{name:"Tatar",nativeName:"татар теле"},tw:{name:"Twi",nativeName:"Twi"},ty:{name:"Tahitian",nativeName:"Reo Tahiti"},ug:{name:"Uyghur",nativeName:"ئۇيغۇرچە"},uk:{name:"Ukrainian",nativeName:"Українська"},ur:{name:"Urdu",nativeName:"اردو"},uz:{name:"Uzbek",nativeName:"Ўзбек"},ve:{name:"Venda",nativeName:"Tshivenḓa"},vi:{name:"Vietnamese",nativeName:"Tiếng Việt"},vo:{name:"Volap\xfck",nativeName:"Volap\xfck"},wa:{name:"Walloon",nativeName:"walon"},wo:{name:"Wolof",nativeName:"Wollof"},xh:{name:"Xhosa",nativeName:"isiXhosa"},yi:{name:"Yiddish",nativeName:"ייִדיש"},yo:{name:"Yoruba",nativeName:"Yor\xf9b\xe1"},za:{name:"Zhuang",nativeName:"Saɯ cueŋƅ"},zh:{name:"Chinese",nativeName:"中文"},zu:{name:"Zulu",nativeName:"isiZulu"}}},44147(v,b,y){let _=y(97271),x={},w={},k=[],A=[],C=[];for(let v in _){let{name:b,nativeName:y}=_[v];x[v]=w[b.toLowerCase()]=w[y.toLowerCase()]={code:v,name:b,nativeName:y},k.push(v),A.push(b),C.push(y)}v.exports=class v{static getLanguages(b=[]){return b.map(b=>v.validate(b)?Object.assign({},x[b]):{code:b,name:"",nativeName:""})}static getName(b){return v.validate(b)?_[b].name:""}static getAllNames(){return A.slice()}static getNativeName(b){return v.validate(b)?_[b].nativeName:""}static getAllNativeNames(){return C.slice()}static getCode(v){return v=v.toLowerCase(),w.hasOwnProperty(v)?w[v].code:""}static getAllCodes(){return k.slice()}static validate(v){return _.hasOwnProperty(v)}}},57415(v){v.exports=function(){"use strict";var v={},b={};function y(y,_,x){if(b[y]=x,"index"===y){var w="var sharedModule = {}; ("+b.shared+")(sharedModule); ("+b.worker+")(sharedModule);",k={};return b.shared(k),b.index(v,k),"u">typeof window&&v.setWorkerUrl(window.URL.createObjectURL(new Blob([w],{type:"text/javascript"}))),v}}return y("shared",["exports"],function(v){let b,y,_,x,w,k,A,C,E,S,T,O,F,I,M,R,D,P,L;function N(v,b,y,_){return new(y||(y=Promise))(function(x,w){function k(v){try{C(_.next(v))}catch(v){w(v)}}function A(v){try{C(_.throw(v))}catch(v){w(v)}}function C(v){var b;v.done?x(v.value):((b=v.value)instanceof y?b:new y(function(v){v(b)})).then(k,A)}C((_=_.apply(v,b||[])).next())})}function z(v,b){this.x=v,this.y=b}function j(v){return v&&v.__esModule&&Object.prototype.hasOwnProperty.call(v,"default")?v.default:v}"function"==typeof SuppressedError&&SuppressedError,z.prototype={clone(){return new z(this.x,this.y)},add(v){return this.clone()._add(v)},sub(v){return this.clone()._sub(v)},multByPoint(v){return this.clone()._multByPoint(v)},divByPoint(v){return this.clone()._divByPoint(v)},mult(v){return this.clone()._mult(v)},div(v){return this.clone()._div(v)},rotate(v){return this.clone()._rotate(v)},rotateAround(v,b){return this.clone()._rotateAround(v,b)},matMult(v){return this.clone()._matMult(v)},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(v){return this.x===v.x&&this.y===v.y},dist(v){return Math.sqrt(this.distSqr(v))},distSqr(v){let b=v.x-this.x,y=v.y-this.y;return b*b+y*y},angle(){return Math.atan2(this.y,this.x)},angleTo(v){return Math.atan2(this.y-v.y,this.x-v.x)},angleWith(v){return this.angleWithSep(v.x,v.y)},angleWithSep(v,b){return Math.atan2(this.x*b-this.y*v,this.x*v+this.y*b)},_matMult(v){let b=v[2]*this.x+v[3]*this.y;return this.x=v[0]*this.x+v[1]*this.y,this.y=b,this},_add(v){return this.x+=v.x,this.y+=v.y,this},_sub(v){return this.x-=v.x,this.y-=v.y,this},_mult(v){return this.x*=v,this.y*=v,this},_div(v){return this.x/=v,this.y/=v,this},_multByPoint(v){return this.x*=v.x,this.y*=v.y,this},_divByPoint(v){return this.x/=v.x,this.y/=v.y,this},_unit(){return this._div(this.mag()),this},_perp(){let v=this.y;return this.y=this.x,this.x=-v,this},_rotate(v){let b=Math.cos(v),y=Math.sin(v),_=y*this.x+b*this.y;return this.x=b*this.x-y*this.y,this.y=_,this},_rotateAround(v,b){let y=Math.cos(v),_=Math.sin(v),x=b.y+_*(this.x-b.x)+y*(this.y-b.y);return this.x=b.x+y*(this.x-b.x)-_*(this.y-b.y),this.y=x,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:z},z.convert=function(v){if(v instanceof z)return v;if(Array.isArray(v))return new z(+v[0],+v[1]);if(void 0!==v.x&&void 0!==v.y)return new z(+v.x,+v.y);throw Error("Expected [x, y] or {x, y} point format")};var B,U,V,q,H,W,G,Y,Z,X,K,J,Q,ee,et,en,ei,er,eo,ea,es,el,ec,eu=j(function(){if(nE)return nC;function v(v,b,y,_){this.cx=3*v,this.bx=3*(y-v)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*b,this.by=3*(_-b)-this.cy,this.ay=1-this.cy-this.by,this.p1x=v,this.p1y=b,this.p2x=y,this.p2y=_}return nE=1,nC=v,v.prototype={sampleCurveX:function(v){return((this.ax*v+this.bx)*v+this.cx)*v},sampleCurveY:function(v){return((this.ay*v+this.by)*v+this.cy)*v},sampleCurveDerivativeX:function(v){return(3*this.ax*v+2*this.bx)*v+this.cx},solveCurveX:function(v,b){if(void 0===b&&(b=1e-6),v<0)return 0;if(v>1)return 1;for(var y=v,_=0;_<8;_++){var x=this.sampleCurveX(y)-v;if(Math.abs(x)<b)return y;var w=this.sampleCurveDerivativeX(y);if(1e-6>Math.abs(w))break;y-=x/w}var k=0,A=1;for(y=v,_=0;_<20&&!(Math.abs((x=this.sampleCurveX(y))-v)<b);_++)v>x?k=y:A=y,y=.5*(A-k)+k;return y},solve:function(v,b){return this.sampleCurveY(this.solveCurveX(v,b))}},nC}());function ed(){return null==b&&(b="u">typeof OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),b}function eh(){if(null==y&&(y=!1,ed())){let v=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(v){for(let b=0;b<25;b++){let y=4*b;v.fillStyle=`rgb(${y},${y+1},${y+2})`,v.fillRect(b%5,Math.floor(b/5),1,1)}let b=v.getImageData(0,0,5,5).data;for(let v=0;v<100;v++)if(v%4!=3&&b[v]!==v){y=!0;break}}}return y||!1}var ep="u">typeof Float32Array?Float32Array:Array;function ef(){var v=new ep(9);return ep!=Float32Array&&(v[1]=0,v[2]=0,v[3]=0,v[5]=0,v[6]=0,v[7]=0),v[0]=1,v[4]=1,v[8]=1,v}function em(v){return v[0]=1,v[1]=0,v[2]=0,v[3]=0,v[4]=0,v[5]=1,v[6]=0,v[7]=0,v[8]=0,v[9]=0,v[10]=1,v[11]=0,v[12]=0,v[13]=0,v[14]=0,v[15]=1,v}function eg(){var v=new ep(3);return ep!=Float32Array&&(v[0]=0,v[1]=0,v[2]=0),v}function ev(v){var b=v[0],y=v[1],_=v[2];return Math.sqrt(b*b+y*y+_*_)}function eb(v,b,y){var _=new ep(3);return _[0]=v,_[1]=b,_[2]=y,_}function ey(v,b,y){return v[0]=b[0]+y[0],v[1]=b[1]+y[1],v[2]=b[2]+y[2],v}function e_(v,b,y){return v[0]=b[0]*y,v[1]=b[1]*y,v[2]=b[2]*y,v}function ex(v,b,y){var _=b[0],x=b[1],w=b[2],k=y[0],A=y[1],C=y[2];return v[0]=x*C-w*A,v[1]=w*k-_*C,v[2]=_*A-x*k,v}function ew(v,b,y){var _=b[0],x=b[1],w=b[2],k=b[3];return v[0]=y[0]*_+y[4]*x+y[8]*w+y[12]*k,v[1]=y[1]*_+y[5]*x+y[9]*w+y[13]*k,v[2]=y[2]*_+y[6]*x+y[10]*w+y[14]*k,v[3]=y[3]*_+y[7]*x+y[11]*w+y[15]*k,v}function ek(){var v=new ep(4);return ep!=Float32Array&&(v[0]=0,v[1]=0,v[2]=0),v[3]=1,v}function eA(v,b,y,_){var x=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"zyx",w=Math.PI/360;b*=w,_*=w,y*=w;var k=Math.sin(b),A=Math.cos(b),C=Math.sin(y),E=Math.cos(y),S=Math.sin(_),T=Math.cos(_);switch(x){case"xyz":v[0]=k*E*T+A*C*S,v[1]=A*C*T-k*E*S,v[2]=A*E*S+k*C*T,v[3]=A*E*T-k*C*S;break;case"xzy":v[0]=k*E*T-A*C*S,v[1]=A*C*T-k*E*S,v[2]=A*E*S+k*C*T,v[3]=A*E*T+k*C*S;break;case"yxz":v[0]=k*E*T+A*C*S,v[1]=A*C*T-k*E*S,v[2]=A*E*S-k*C*T,v[3]=A*E*T+k*C*S;break;case"yzx":v[0]=k*E*T+A*C*S,v[1]=A*C*T+k*E*S,v[2]=A*E*S-k*C*T,v[3]=A*E*T-k*C*S;break;case"zxy":v[0]=k*E*T-A*C*S,v[1]=A*C*T+k*E*S,v[2]=A*E*S+k*C*T,v[3]=A*E*T-k*C*S;break;case"zyx":v[0]=k*E*T-A*C*S,v[1]=A*C*T+k*E*S,v[2]=A*E*S-k*C*T,v[3]=A*E*T+k*C*S;break;default:throw Error("Unknown angle order "+x)}return v}function eC(){var v=new ep(2);return ep!=Float32Array&&(v[0]=0,v[1]=0),v}function eE(v,b){var y=new ep(2);return y[0]=v,y[1]=b,y}function eS(v,b,y){return b*(8192/(v.tileSize*Math.pow(2,y-v.tileID.overscaledZ)))}function eT(v,b){return(v%b+b)%b}function eO(v,b,y){return v*(1-y)+b*y}function eF(v){if(v<=0)return 0;if(v>=1)return 1;let b=v*v,y=b*v;return 4*(v<.5?y:3*(v-b)+y-.75)}function eI(v,b,y,_){let x=new eu(v,b,y,_);return v=>x.solve(v)}eg(),nS=new ep(4),ep!=Float32Array&&(nS[0]=0,nS[1]=0,nS[2]=0,nS[3]=0),eg(),eb(1,0,0),eb(0,1,0),ek(),ek(),ef(),eC();let eM=eI(.25,.1,.25,1);function eR(v,b,y){return Math.min(y,Math.max(b,v))}function eD(v,b,y){let _=y-b,x=((v-b)%_+_)%_+b;return x===b?y:x}function eP(v,...b){for(let y of b)for(let b in y)v[b]=y[b];return v}let eL=1;function eN(v,b,y){let _={};for(let y in v)_[y]=b.call(this,v[y],y,v);return _}function ez(v,b,y){let _={};for(let y in v)b.call(this,v[y],y,v)&&(_[y]=v[y]);return _}function ej(v){return Array.isArray(v)?v.map(ej):"object"==typeof v&&v?eN(v,ej):v}let eB={};function e$(v){eB[v]||("u">typeof console&&console.warn(v),eB[v]=!0)}function eU(v,b,y){return(y.y-v.y)*(b.x-v.x)>(b.y-v.y)*(y.x-v.x)}function eV(v){return"u">typeof WorkerGlobalScope&&void 0!==v&&v instanceof WorkerGlobalScope}let eq=null;function eH(v){return"u">typeof ImageBitmap&&v instanceof ImageBitmap}let eW="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function eG(v,b,y,_,x){return N(this,void 0,void 0,function*(){if("u"<typeof VideoFrame)throw Error("VideoFrame not supported");let w=new VideoFrame(v,{timestamp:0});try{let k,A,C,E,S=null==w?void 0:w.format;if(!S||!S.startsWith("BGR")&&!S.startsWith("RGB"))throw Error(`Unrecognized format ${S}`);let T=S.startsWith("BGR"),O=new Uint8ClampedArray(_*x*4);if(yield w.copyTo(O,(k=4*Math.max(-b,0),A=(Math.max(0,y)-y)*_*4+k,C=Math.max(0,b),E=Math.max(0,y),{rect:{x:C,y:E,width:Math.min(v.width,b+_)-C,height:Math.min(v.height,y+x)-E},layout:[{offset:A,stride:4*_}]})),T)for(let v=0;v<O.length;v+=4){let b=O[v];O[v]=O[v+2],O[v+2]=b}return O}finally{w.close()}})}function eY(v,b,y,_){return v.addEventListener(b,y,_),{unsubscribe:()=>{v.removeEventListener(b,y,_)}}}function eZ(v){return v*Math.PI/180}function eX(v){return v/Math.PI*180}let eK={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},eJ={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},eQ="AbortError";class e0 extends Error{constructor(v=eQ){super(v instanceof Error?v.message:v),this.name=eQ,v instanceof Error&&v.stack&&(this.stack=v.stack)}}function e1(v){return v.name===eQ}let e2={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function e5(v){return e2.REGISTERED_PROTOCOLS[v.substring(0,v.indexOf("://"))]}let e3="global-dispatcher";class e4 extends Error{constructor(v,b,y,_){super(`AJAXError: ${b} (${v}): ${y}`),this.status=v,this.statusText=b,this.url=y,this.body=_}}let e6=()=>eV(self)?self.worker&&self.worker.referrer:("blob:"===window.location.protocol?window.parent:window).location.href,e8=function(v,b){var y;if(/:\/\//.test(v.url)&&!/^https?:|^file:/.test(v.url)){let y=e5(v.url);if(y)return y(v,b);if(eV(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:v,targetMapId:e3},b)}if(!(/^file:/.test(y=v.url)||/^file:/.test(e6())&&!/^\w+:/.test(y))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(v,b){return N(this,void 0,void 0,function*(){let y,_,x=new Request(v.url,{method:v.method||"GET",body:v.body,credentials:v.credentials,headers:v.headers,cache:v.cache,referrer:e6(),signal:b.signal});"json"!==v.type||x.headers.has("Accept")||x.headers.set("Accept","application/json");try{y=yield fetch(x)}catch(b){if(e1(b))throw b;throw new e4(0,b.message,v.url,new Blob)}if(!y.ok){let b=yield y.blob();throw new e4(y.status,y.statusText,v.url,b)}_="arrayBuffer"===v.type||"image"===v.type?y.arrayBuffer():"json"===v.type?y.json():y.text();let w=yield _;return b.signal.throwIfAborted(),{data:w,cacheControl:y.headers.get("Cache-Control"),expires:y.headers.get("Expires")}})}(v,b);if(eV(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:v,mustQueue:!0,targetMapId:e3},b)}return new Promise((y,_)=>{var x;let w=new XMLHttpRequest;for(let b in w.open(v.method||"GET",v.url,!0),"arrayBuffer"!==v.type&&"image"!==v.type||(w.responseType="arraybuffer"),v.headers)w.setRequestHeader(b,v.headers[b]);"json"===v.type&&(w.responseType="text",(null==(x=v.headers)?void 0:x.Accept)||w.setRequestHeader("Accept","application/json")),w.withCredentials="include"===v.credentials,w.onerror=()=>{_(Error(w.statusText))},w.onload=()=>{if(!b.signal.aborted)if((w.status>=200&&w.status<300||0===w.status)&&null!==w.response){let b=w.response;if("json"===v.type)try{b=JSON.parse(w.response)}catch(v){return void _(v)}y({data:b,cacheControl:w.getResponseHeader("Cache-Control"),expires:w.getResponseHeader("Expires")})}else{let b=new Blob([w.response],{type:w.getResponseHeader("Content-Type")});_(new e4(w.status,w.statusText,v.url,b))}},b.signal.addEventListener("abort",()=>{w.abort(),_(new e0(b.signal.reason))}),w.send(v.body)})};function e7(v){if(!v||0>=v.indexOf("://")||0===v.indexOf("data:image/")||0===v.indexOf("blob:"))return!0;let b=new URL(v),y=window.location;return b.protocol===y.protocol&&b.host===y.host}function e9(v,b,y){y[v]&&-1!==y[v].indexOf(b)||(y[v]=y[v]||[],y[v].push(b))}function te(v,b,y){if(y&&y[v]){let _=y[v].indexOf(b);-1!==_&&y[v].splice(_,1)}}class tt{constructor(v,b={}){eP(this,b),this.type=v}}class tn extends tt{constructor(v,b={}){super("error",eP({error:v},b))}}class ti{on(v,b){return this._listeners=this._listeners||{},e9(v,b,this._listeners),{unsubscribe:()=>{this.off(v,b)}}}off(v,b){return te(v,b,this._listeners),te(v,b,this._oneTimeListeners),this}once(v,b){return b?(this._oneTimeListeners=this._oneTimeListeners||{},e9(v,b,this._oneTimeListeners),this):new Promise(b=>this.once(v,b))}fire(v,b){"string"==typeof v&&(v=new tt(v,b||{}));let y=v.type;if(this.listens(y)){for(let b of(v.target=this,this._listeners&&this._listeners[y]?this._listeners[y].slice():[]))b.call(this,v);for(let b of this._oneTimeListeners&&this._oneTimeListeners[y]?this._oneTimeListeners[y].slice():[])te(y,b,this._oneTimeListeners),b.call(this,v);let b=this._eventedParent;b&&(eP(v,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),b.fire(v))}else v instanceof tn&&console.error(v.error);return this}listens(v){return this._listeners&&this._listeners[v]&&this._listeners[v].length>0||this._oneTimeListeners&&this._oneTimeListeners[v]&&this._oneTimeListeners[v].length>0||this._eventedParent&&this._eventedParent.listens(v)}setEventedParent(v,b){return this._eventedParent=v,this._eventedParentData=b,this}}var tr={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}};let to=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function ta(v,b){if(Array.isArray(v)){if(!Array.isArray(b)||v.length!==b.length)return!1;for(let y=0;y<v.length;y++)if(!ta(v[y],b[y]))return!1;return!0}if("object"==typeof v&&null!==v&&null!==b){if("object"!=typeof b||Object.keys(v).length!==Object.keys(b).length)return!1;for(let y in v)if(!ta(v[y],b[y]))return!1;return!0}return v===b}function ts(v,b){v.push(b)}function tl(v,b,y){ts(y,{command:"addSource",args:[v,b[v]]})}function tc(v,b,y){ts(b,{command:"removeSource",args:[v]}),y[v]=!0}function tu(v,b,y,_,x,w){for(let k in b=b||{},v=v||{})Object.prototype.hasOwnProperty.call(v,k)&&(ta(v[k],b[k])||y.push({command:w,args:[_,k,b[k],x]}));for(let k in b)Object.prototype.hasOwnProperty.call(b,k)&&!Object.prototype.hasOwnProperty.call(v,k)&&(ta(v[k],b[k])||y.push({command:w,args:[_,k,b[k],x]}))}function td(v){return v.id}function th(v,b){return v[b.id]=b,v}class tp{constructor(v,b,y,_){this.message=(v?`${v}: `:"")+y,_&&(this.identifier=_),null!=b&&b.__line__&&(this.line=b.__line__)}}function tf(v,...b){for(let y of b)for(let b in y)v[b]=y[b];return v}class tm extends Error{constructor(v,b){super(b),this.message=b,this.key=v}}class tg{constructor(v,b=[]){for(const[y,_]of(this.parent=v,this.bindings={},b))this.bindings[y]=_}concat(v){return new tg(this,v)}get(v){if(this.bindings[v])return this.bindings[v];if(this.parent)return this.parent.get(v);throw Error(`${v} not found in scope.`)}has(v){return!!this.bindings[v]||!!this.parent&&this.parent.has(v)}}let tv={kind:"null"},tb={kind:"number"},ty={kind:"string"},t_={kind:"boolean"},tx={kind:"color"},tw={kind:"projectionDefinition"},tk={kind:"object"},tA={kind:"value"},tC={kind:"collator"},tE={kind:"formatted"},tS={kind:"padding"},tT={kind:"colorArray"},tO={kind:"numberArray"},tF={kind:"resolvedImage"},tI={kind:"variableAnchorOffsetCollection"};function tM(v,b){return{kind:"array",itemType:v,N:b}}function tR(v){if("array"===v.kind){let b=tR(v.itemType);return"number"==typeof v.N?`array<${b}, ${v.N}>`:"value"===v.itemType.kind?"array":`array<${b}>`}return v.kind}let tD=[tv,tb,ty,t_,tx,tw,tE,tk,tM(tA),tS,tO,tT,tF,tI];function tP(v,b){if("error"===b.kind)return null;if("array"===v.kind){if("array"===b.kind&&(0===b.N&&"value"===b.itemType.kind||!tP(v.itemType,b.itemType))&&("number"!=typeof v.N||v.N===b.N))return null}else{if(v.kind===b.kind)return null;if("value"===v.kind){for(let v of tD)if(!tP(v,b))return null}}return`Expected ${tR(v)} but found ${tR(b)} instead.`}function tL(v,b){return b.some(b=>b.kind===v.kind)}function tN(v,b){return b.some(b=>"null"===b?null===v:"array"===b?Array.isArray(v):"object"===b?v&&!Array.isArray(v)&&"object"==typeof v:b===typeof v)}function tz(v,b){return"array"===v.kind&&"array"===b.kind?v.itemType.kind===b.itemType.kind&&"number"==typeof v.N:v.kind===b.kind}let tj=4/29,tB=6/29,t$=6/29*3*(6/29),tU=6/29*(6/29)*(6/29),tV=Math.PI/180,tq=180/Math.PI;function tH(v){return(v%=360)<0&&(v+=360),v}function tW([v,b,y,_]){let x,w,k=tY((.2225045*(v=tG(v))+.7168786*(b=tG(b))+.0606169*(y=tG(y)))/1);v===b&&b===y?x=w=k:(x=tY((.4360747*v+.3850649*b+.1430804*y)/.96422),w=tY((.0139322*v+.0971045*b+.7141733*y)/.82521));let A=116*k-16;return[A<0?0:A,500*(x-k),200*(k-w),_]}function tG(v){return v<=.04045?v/12.92:Math.pow((v+.055)/1.055,2.4)}function tY(v){return v>tU?Math.pow(v,1/3):v/t$+tj}function tZ([v,b,y,_]){let x=(v+16)/116,w=isNaN(b)?x:x+b/500,k=isNaN(y)?x:x-y/200;return x=+tK(x),[tX(3.1338561*(w=.96422*tK(w))-1.6168667*x-.4906146*(k=.82521*tK(k))),tX(-.9787684*w+1.9161415*x+.033454*k),tX(.0719453*w-.2289914*x+1.4052427*k),_]}function tX(v){return(v=v<=.00304?12.92*v:1.055*Math.pow(v,1/2.4)-.055)<0?0:v>1?1:v}function tK(v){return v>tB?v*v*v:t$*(v-tj)}let tJ=Object.hasOwn||function(v,b){return Object.prototype.hasOwnProperty.call(v,b)};function tQ(v,b){return tJ(v,b)?v[b]:void 0}function t0(v){return parseInt(v.padEnd(2,v),16)/255}function t1(v,b){return t2(b?v/100:v,0,1)}function t2(v,b,y){return Math.min(Math.max(b,v),y)}function t5(v){return!v.some(Number.isNaN)}let t3={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function t4(v,b,y){return v.map((v,_)=>v+y*(b[_]-v))}class t6{constructor(v,b,y,_=1,x=!0){this.r=v,this.g=b,this.b=y,this.a=_,x||(this.r*=_,this.g*=_,this.b*=_,_||this.overwriteGetter("rgb",[v,b,y,_]))}static parse(v){if(v instanceof t6)return v;if("string"!=typeof v)return;let b=function(v){if("transparent"===(v=v.toLowerCase().trim()))return[0,0,0,0];let b=tQ(t3,v);if(b){let[v,y,_]=b;return[v/255,y/255,_/255,1]}if(v.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(v)){let b=v.length<6?1:2,y=1;return[t0(v.slice(y,y+=b)),t0(v.slice(y,y+=b)),t0(v.slice(y,y+=b)),t0(v.slice(y,y+b)||"ff")]}if(v.startsWith("rgb")){let b=v.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(b){let[v,y,_,x,w,k,A,C,E,S,T,O]=b,F=[x||" ",A||" ",S].join("");if(" "===F||" /"===F||",,"===F||",,,"===F){let v=[_,k,E].join(""),b="%%%"===v?100:255*(""===v);if(b){let v=[t2(y/b,0,1),t2(w/b,0,1),t2(C/b,0,1),T?t1(+T,O):1];if(t5(v))return v}}return}}let y=v.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(y){let[v,b,_,x,w,k,A,C,E]=y,S=[_||" ",w||" ",A].join("");if(" "===S||" /"===S||",,"===S||",,,"===S){let v=[+b,t2(+x,0,100),t2(+k,0,100),C?t1(+C,E):1];if(t5(v))return function([v,b,y,_]){function x(_){let x=(_+v/30)%12,w=b*Math.min(y,1-y);return y-w*Math.max(-1,Math.min(x-3,9-x,1))}return v=tH(v),b/=100,y/=100,[x(0),x(8),x(4),_]}(v)}}}(v);return b?new t6(...b,!1):void 0}get rgb(){let{r:v,g:b,b:y,a:_}=this,x=_||1/0;return this.overwriteGetter("rgb",[v/x,b/x,y/x,_])}get hcl(){return this.overwriteGetter("hcl",function(v){let[b,y,_,x]=tW(v),w=Math.sqrt(y*y+_*_);return[Math.round(1e4*w)?tH(Math.atan2(_,y)*tq):0/0,w,b,x]}(this.rgb))}get lab(){return this.overwriteGetter("lab",tW(this.rgb))}overwriteGetter(v,b){return Object.defineProperty(this,v,{value:b}),b}toString(){let[v,b,y,_]=this.rgb;return`rgba(${[v,b,y].map(v=>Math.round(255*v)).join(",")},${_})`}static interpolate(v,b,y,_="rgb"){switch(_){case"rgb":{let[_,x,w,k]=t4(v.rgb,b.rgb,y);return new t6(_,x,w,k,!1)}case"hcl":{let _,x,[w,k,A,C]=v.hcl,[E,S,T,O]=b.hcl;if(isNaN(w)||isNaN(E))isNaN(w)?isNaN(E)?_=0/0:(_=E,1!==A&&0!==A||(x=S)):(_=w,1!==T&&0!==T||(x=k));else{let v=E-w;E>w&&v>180?v-=360:E<w&&w-E>180&&(v+=360),_=w+y*v}let[F,I,M,R]=function([v,b,y,_]){return tZ([y,Math.cos(v=isNaN(v)?0:v*tV)*b,Math.sin(v)*b,_])}([_,null!=x?x:k+y*(S-k),A+y*(T-A),C+y*(O-C)]);return new t6(F,I,M,R,!1)}case"lab":{let[_,x,w,k]=tZ(t4(v.lab,b.lab,y));return new t6(_,x,w,k,!1)}}}}t6.black=new t6(0,0,0,1),t6.white=new t6(1,1,1,1),t6.transparent=new t6(0,0,0,0),t6.red=new t6(1,0,0,1);class t8{constructor(v,b,y){this.sensitivity=v?b?"variant":"case":b?"accent":"base",this.locale=y,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(v,b){return this.collator.compare(v,b)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}let t7=["bottom","center","top"];class t9{constructor(v,b,y,_,x,w){this.text=v,this.image=b,this.scale=y,this.fontStack=_,this.textColor=x,this.verticalAlign=w}}class ne{constructor(v){this.sections=v}static fromString(v){return new ne([new t9(v,null,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(v=>0!==v.text.length||v.image&&0!==v.image.name.length)}static factory(v){return v instanceof ne?v:ne.fromString(v)}toString(){return 0===this.sections.length?"":this.sections.map(v=>v.text).join("")}}class nt{constructor(v){this.values=v.slice()}static parse(v){if(v instanceof nt)return v;if("number"==typeof v)return new nt([v,v,v,v]);if(Array.isArray(v)&&!(v.length<1||v.length>4)){for(let b of v)if("number"!=typeof b)return;switch(v.length){case 1:v=[v[0],v[0],v[0],v[0]];break;case 2:v=[v[0],v[1],v[0],v[1]];break;case 3:v=[v[0],v[1],v[2],v[1]]}return new nt(v)}}toString(){return JSON.stringify(this.values)}static interpolate(v,b,y){return new nt(t4(v.values,b.values,y))}}class nn{constructor(v){this.values=v.slice()}static parse(v){if(v instanceof nn)return v;if("number"==typeof v)return new nn([v]);if(Array.isArray(v)){for(let b of v)if("number"!=typeof b)return;return new nn(v)}}toString(){return JSON.stringify(this.values)}static interpolate(v,b,y){return new nn(t4(v.values,b.values,y))}}class ni{constructor(v){this.values=v.slice()}static parse(v){if(v instanceof ni)return v;if("string"==typeof v){let b=t6.parse(v);if(!b)return;return new ni([b])}if(!Array.isArray(v))return;let b=[];for(let y of v){if("string"!=typeof y)return;let v=t6.parse(y);if(!v)return;b.push(v)}return new ni(b)}toString(){return JSON.stringify(this.values)}static interpolate(v,b,y,_="rgb"){let x=[];if(v.values.length!=b.values.length)throw Error(`colorArray: Arrays have mismatched length (${v.values.length} vs. ${b.values.length}), cannot interpolate.`);for(let w=0;w<v.values.length;w++)x.push(t6.interpolate(v.values[w],b.values[w],y,_));return new ni(x)}}class nr extends Error{constructor(v){super(v),this.name="RuntimeError"}toJSON(){return this.message}}let no=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class na{constructor(v){this.values=v.slice()}static parse(v){if(v instanceof na)return v;if(Array.isArray(v)&&!(v.length<1)&&v.length%2==0){for(let b=0;b<v.length;b+=2){let y=v[b],_=v[b+1];if("string"!=typeof y||!no.has(y)||!Array.isArray(_)||2!==_.length||"number"!=typeof _[0]||"number"!=typeof _[1])return}return new na(v)}}toString(){return JSON.stringify(this.values)}static interpolate(v,b,y){let _=v.values,x=b.values;if(_.length!==x.length)throw new nr(`Cannot interpolate values of different length. from: ${v.toString()}, to: ${b.toString()}`);let w=[];for(let v=0;v<_.length;v+=2){if(_[v]!==x[v])throw new nr(`Cannot interpolate values containing mismatched anchors. from[${v}]: ${_[v]}, to[${v}]: ${x[v]}`);w.push(_[v]);let[b,k]=_[v+1],[A,C]=x[v+1];w.push([b+y*(A-b),k+y*(C-k)])}return new na(w)}}class ns{constructor(v){this.name=v.name,this.available=v.available}toString(){return this.name}static fromString(v){return v?new ns({name:v,available:!1}):null}}class nl{constructor(v,b,y){this.from=v,this.to=b,this.transition=y}static interpolate(v,b,y){return new nl(v,b,y)}static parse(v){return v instanceof nl?v:Array.isArray(v)&&3===v.length&&"string"==typeof v[0]&&"string"==typeof v[1]&&"number"==typeof v[2]?new nl(v[0],v[1],v[2]):"object"==typeof v&&"string"==typeof v.from&&"string"==typeof v.to&&"number"==typeof v.transition?new nl(v.from,v.to,v.transition):"string"==typeof v?new nl(v,v,1):void 0}}function nc(v,b,y,_){return"number"==typeof v&&v>=0&&v<=255&&"number"==typeof b&&b>=0&&b<=255&&"number"==typeof y&&y>=0&&y<=255?void 0===_||"number"==typeof _&&_>=0&&_<=1?null:`Invalid rgba value [${[v,b,y,_].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof _?[v,b,y,_]:[v,b,y]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function nu(v){if(null===v||"string"==typeof v||"boolean"==typeof v||"number"==typeof v||v instanceof nl||v instanceof t6||v instanceof t8||v instanceof ne||v instanceof nt||v instanceof nn||v instanceof ni||v instanceof na||v instanceof ns)return!0;if(Array.isArray(v)){for(let b of v)if(!nu(b))return!1;return!0}if("object"==typeof v){for(let b in v)if(!nu(v[b]))return!1;return!0}return!1}function nd(v){if(null===v)return tv;if("string"==typeof v)return ty;if("boolean"==typeof v)return t_;if("number"==typeof v)return tb;if(v instanceof t6)return tx;if(v instanceof nl)return tw;if(v instanceof t8)return tC;if(v instanceof ne)return tE;if(v instanceof nt)return tS;if(v instanceof nn)return tO;if(v instanceof ni)return tT;if(v instanceof na)return tI;if(v instanceof ns)return tF;if(Array.isArray(v)){let b,y=v.length;for(let y of v){let v=nd(y);if(b){if(b===v)continue;b=tA;break}b=v}return tM(b||tA,y)}return tk}function nh(v){let b=typeof v;return null===v?"":"string"===b||"number"===b||"boolean"===b?String(v):v instanceof t6||v instanceof nl||v instanceof ne||v instanceof nt||v instanceof nn||v instanceof ni||v instanceof na||v instanceof ns?v.toString():JSON.stringify(v)}class np{constructor(v,b){this.type=v,this.value=b}static parse(v,b){if(2!==v.length)return b.error(`'literal' expression requires exactly one argument, but found ${v.length-1} instead.`);if(!nu(v[1]))return b.error("invalid value");let y=v[1],_=nd(y),x=b.expectedType;return"array"===_.kind&&0===_.N&&x&&"array"===x.kind&&("number"!=typeof x.N||0===x.N)&&(_=x),new np(_,y)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}let nf={string:ty,number:tb,boolean:t_,object:tk};class nm{constructor(v,b){this.type=v,this.args=b}static parse(v,b){if(v.length<2)return b.error("Expected at least one argument.");let y,_=1,x=v[0];if("array"===x){let x,w;if(v.length>2){let y=v[1];if("string"!=typeof y||!(y in nf)||"object"===y)return b.error('The item type argument of "array" must be one of string, number, boolean',1);x=nf[y],_++}else x=tA;if(v.length>3){if(null!==v[2]&&("number"!=typeof v[2]||v[2]<0||v[2]!==Math.floor(v[2])))return b.error('The length argument to "array" must be a positive integer literal',2);w=v[2],_++}y=tM(x,w)}else{if(!nf[x])throw Error(`Types doesn't contain name = ${x}`);y=nf[x]}let w=[];for(;_<v.length;_++){let y=b.parse(v[_],_,tA);if(!y)return null;w.push(y)}return new nm(y,w)}evaluate(v){for(let b=0;b<this.args.length;b++){let y=this.args[b].evaluate(v);if(!tP(this.type,nd(y)))return y;if(b===this.args.length-1)throw new nr(`Expected value to be of type ${tR(this.type)}, but found ${tR(nd(y))} instead.`)}throw Error()}eachChild(v){this.args.forEach(v)}outputDefined(){return this.args.every(v=>v.outputDefined())}}let ng={"to-boolean":t_,"to-color":tx,"to-number":tb,"to-string":ty};class nv{constructor(v,b){this.type=v,this.args=b}static parse(v,b){if(v.length<2)return b.error("Expected at least one argument.");let y=v[0];if(!ng[y])throw Error(`Can't parse ${y} as it is not part of the known types`);if(("to-boolean"===y||"to-string"===y)&&2!==v.length)return b.error("Expected one argument.");let _=ng[y],x=[];for(let y=1;y<v.length;y++){let _=b.parse(v[y],y,tA);if(!_)return null;x.push(_)}return new nv(_,x)}evaluate(v){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(v);case"color":{let b,y;for(let _ of this.args){if(b=_.evaluate(v),y=null,b instanceof t6)return b;if("string"==typeof b){let y=v.parseColor(b);if(y)return y}else if(Array.isArray(b)&&!(y=b.length<3||b.length>4?`Invalid rgba value ${JSON.stringify(b)}: expected an array containing either three or four numeric values.`:nc(b[0],b[1],b[2],b[3])))return new t6(b[0]/255,b[1]/255,b[2]/255,b[3])}throw new nr(y||`Could not parse color from value '${"string"==typeof b?b:JSON.stringify(b)}'`)}case"padding":{let b;for(let y of this.args){b=y.evaluate(v);let _=nt.parse(b);if(_)return _}throw new nr(`Could not parse padding from value '${"string"==typeof b?b:JSON.stringify(b)}'`)}case"numberArray":{let b;for(let y of this.args){b=y.evaluate(v);let _=nn.parse(b);if(_)return _}throw new nr(`Could not parse numberArray from value '${"string"==typeof b?b:JSON.stringify(b)}'`)}case"colorArray":{let b;for(let y of this.args){b=y.evaluate(v);let _=ni.parse(b);if(_)return _}throw new nr(`Could not parse colorArray from value '${"string"==typeof b?b:JSON.stringify(b)}'`)}case"variableAnchorOffsetCollection":{let b;for(let y of this.args){b=y.evaluate(v);let _=na.parse(b);if(_)return _}throw new nr(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof b?b:JSON.stringify(b)}'`)}case"number":{let b=null;for(let y of this.args){if(null===(b=y.evaluate(v)))return 0;let _=Number(b);if(!isNaN(_))return _}throw new nr(`Could not convert ${JSON.stringify(b)} to number.`)}case"formatted":return ne.fromString(nh(this.args[0].evaluate(v)));case"resolvedImage":return ns.fromString(nh(this.args[0].evaluate(v)));case"projectionDefinition":return this.args[0].evaluate(v);default:return nh(this.args[0].evaluate(v))}}eachChild(v){this.args.forEach(v)}outputDefined(){return this.args.every(v=>v.outputDefined())}}let nb=["Unknown","Point","LineString","Polygon"];class ny{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?nb[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(v){let b=this._parseColorCache.get(v);return b||(b=t6.parse(v),this._parseColorCache.set(v,b)),b}}class n_{constructor(v,b,y=[],_,x=new tg,w=[]){this.registry=v,this.path=y,this.key=y.map(v=>`[${v}]`).join(""),this.scope=x,this.errors=w,this.expectedType=_,this._isConstant=b}parse(v,b,y,_,x={}){return b?this.concat(b,y,_)._parse(v,x):this._parse(v,x)}_parse(v,b){function y(v,b,y){return"assert"===y?new nm(b,[v]):"coerce"===y?new nv(b,[v]):v}if(null!==v&&"string"!=typeof v&&"boolean"!=typeof v&&"number"!=typeof v||(v=["literal",v]),Array.isArray(v)){if(0===v.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let _=v[0];if("string"!=typeof _)return this.error(`Expression name must be a string, but found ${typeof _} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let x=this.registry[_];if(x){let _=x.parse(v,this);if(!_)return null;if(this.expectedType){let v=this.expectedType,x=_.type;if("string"!==v.kind&&"number"!==v.kind&&"boolean"!==v.kind&&"object"!==v.kind&&"array"!==v.kind||"value"!==x.kind){if("projectionDefinition"===v.kind&&["string","array"].includes(x.kind)||["color","formatted","resolvedImage"].includes(v.kind)&&["value","string"].includes(x.kind)||["padding","numberArray"].includes(v.kind)&&["value","number","array"].includes(x.kind)||"colorArray"===v.kind&&["value","string","array"].includes(x.kind)||"variableAnchorOffsetCollection"===v.kind&&["value","array"].includes(x.kind))_=y(_,v,b.typeAnnotation||"coerce");else if(this.checkSubtype(v,x))return null}else _=y(_,v,b.typeAnnotation||"assert")}if(!(_ instanceof np)&&"resolvedImage"!==_.type.kind&&this._isConstant(_)){let v=new ny;try{_=new np(_.type,_.evaluate(v))}catch(v){return this.error(v.message),null}}return _}return this.error(`Unknown expression "${_}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===v?"'undefined' value invalid. Use null instead.":"object"==typeof v?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof v} instead.`)}concat(v,b,y){let _="number"==typeof v?this.path.concat(v):this.path,x=y?this.scope.concat(y):this.scope;return new n_(this.registry,this._isConstant,_,b||null,x,this.errors)}error(v,...b){let y=`${this.key}${b.map(v=>`[${v}]`).join("")}`;this.errors.push(new tm(y,v))}checkSubtype(v,b){let y=tP(v,b);return y&&this.error(y),y}}class nx{constructor(v,b){this.type=b.type,this.bindings=[].concat(v),this.result=b}evaluate(v){return this.result.evaluate(v)}eachChild(v){for(let b of this.bindings)v(b[1]);v(this.result)}static parse(v,b){if(v.length<4)return b.error(`Expected at least 3 arguments, but found ${v.length-1} instead.`);let y=[];for(let _=1;_<v.length-1;_+=2){let x=v[_];if("string"!=typeof x)return b.error(`Expected string, but found ${typeof x} instead.`,_);if(/[^a-zA-Z0-9_]/.test(x))return b.error("Variable names must contain only alphanumeric characters or '_'.",_);let w=b.parse(v[_+1],_+1);if(!w)return null;y.push([x,w])}let _=b.parse(v[v.length-1],v.length-1,b.expectedType,y);return _?new nx(y,_):null}outputDefined(){return this.result.outputDefined()}}class nw{constructor(v,b){this.type=b.type,this.name=v,this.boundExpression=b}static parse(v,b){if(2!==v.length||"string"!=typeof v[1])return b.error("'var' expression requires exactly one string literal argument.");let y=v[1];return b.scope.has(y)?new nw(y,b.scope.get(y)):b.error(`Unknown variable "${y}". Make sure "${y}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(v){return this.boundExpression.evaluate(v)}eachChild(){}outputDefined(){return!1}}function nk(v,b){let y=v.length-1,_,x,w=0,k=y,A=0;for(;w<=k;)if(_=v[A=Math.floor((w+k)/2)],x=v[A+1],_<=b){if(A===y||b<x)return A;w=A+1}else{if(!(_>b))throw new nr("Input is not a number.");k=A-1}return 0}class nA{constructor(v,b,y){for(const[_,x]of(this.type=v,this.input=b,this.labels=[],this.outputs=[],y))this.labels.push(_),this.outputs.push(x)}static parse(v,b){if(v.length-1<4)return b.error(`Expected at least 4 arguments, but found only ${v.length-1}.`);if((v.length-1)%2!=0)return b.error("Expected an even number of arguments.");let y=b.parse(v[1],1,tb);if(!y)return null;let _=[],x=null;b.expectedType&&"value"!==b.expectedType.kind&&(x=b.expectedType);for(let y=1;y<v.length;y+=2){let w=1===y?-1/0:v[y],k=v[y+1],A=y,C=y+1;if("number"!=typeof w)return b.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',A);if(_.length&&_[_.length-1][0]>=w)return b.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',A);let E=b.parse(k,C,x);if(!E)return null;x=x||E.type,_.push([w,E])}return new nA(x,y,_)}evaluate(v){let b=this.labels,y=this.outputs;if(1===b.length)return y[0].evaluate(v);let _=this.input.evaluate(v);if(_<=b[0])return y[0].evaluate(v);let x=b.length;return _>=b[x-1]?y[x-1].evaluate(v):y[nk(b,_)].evaluate(v)}eachChild(v){for(let b of(v(this.input),this.outputs))v(b)}outputDefined(){return this.outputs.every(v=>v.outputDefined())}}var nC,nE,nS,nT,nO,nF,nI=(nT=function(){if(nF)return nO;function v(v,b,y,_){this.cx=3*v,this.bx=3*(y-v)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*b,this.by=3*(_-b)-this.cy,this.ay=1-this.cy-this.by,this.p1x=v,this.p1y=b,this.p2x=y,this.p2y=_}return nF=1,nO=v,v.prototype={sampleCurveX:function(v){return((this.ax*v+this.bx)*v+this.cx)*v},sampleCurveY:function(v){return((this.ay*v+this.by)*v+this.cy)*v},sampleCurveDerivativeX:function(v){return(3*this.ax*v+2*this.bx)*v+this.cx},solveCurveX:function(v,b){if(void 0===b&&(b=1e-6),v<0)return 0;if(v>1)return 1;for(var y=v,_=0;_<8;_++){var x=this.sampleCurveX(y)-v;if(Math.abs(x)<b)return y;var w=this.sampleCurveDerivativeX(y);if(1e-6>Math.abs(w))break;y-=x/w}var k=0,A=1;for(y=v,_=0;_<20&&!(Math.abs((x=this.sampleCurveX(y))-v)<b);_++)v>x?k=y:A=y,y=.5*(A-k)+k;return y},solve:function(v,b){return this.sampleCurveY(this.solveCurveX(v,b))}},nO}())&&nT.__esModule&&Object.prototype.hasOwnProperty.call(nT,"default")?nT.default:nT;class nM{constructor(v,b,y,_,x){for(const[w,k]of(this.type=v,this.operator=b,this.interpolation=y,this.input=_,this.labels=[],this.outputs=[],x))this.labels.push(w),this.outputs.push(k)}static interpolationFactor(v,b,y,_){let x=0;if("exponential"===v.name)x=nR(b,v.base,y,_);else if("linear"===v.name)x=nR(b,1,y,_);else if("cubic-bezier"===v.name){let w=v.controlPoints;x=new nI(w[0],w[1],w[2],w[3]).solve(nR(b,1,y,_))}return x}static parse(v,b){let[y,_,x,...w]=v;if(!Array.isArray(_)||0===_.length)return b.error("Expected an interpolation type expression.",1);if("linear"===_[0])_={name:"linear"};else if("exponential"===_[0]){let v=_[1];if("number"!=typeof v)return b.error("Exponential interpolation requires a numeric base.",1,1);_={name:"exponential",base:v}}else{if("cubic-bezier"!==_[0])return b.error(`Unknown interpolation type ${String(_[0])}`,1,0);{let v=_.slice(1);if(4!==v.length||v.some(v=>"number"!=typeof v||v<0||v>1))return b.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);_={name:"cubic-bezier",controlPoints:v}}}if(v.length-1<4)return b.error(`Expected at least 4 arguments, but found only ${v.length-1}.`);if((v.length-1)%2!=0)return b.error("Expected an even number of arguments.");if(!(x=b.parse(x,2,tb)))return null;let k=[],A=null;"interpolate-hcl"!==y&&"interpolate-lab"!==y||b.expectedType==tT?b.expectedType&&"value"!==b.expectedType.kind&&(A=b.expectedType):A=tx;for(let v=0;v<w.length;v+=2){let y=w[v],_=w[v+1],x=v+3,C=v+4;if("number"!=typeof y)return b.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',x);if(k.length&&k[k.length-1][0]>=y)return b.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',x);let E=b.parse(_,C,A);if(!E)return null;A=A||E.type,k.push([y,E])}return tz(A,tb)||tz(A,tw)||tz(A,tx)||tz(A,tS)||tz(A,tO)||tz(A,tT)||tz(A,tI)||tz(A,tM(tb))?new nM(A,y,_,x,k):b.error(`Type ${tR(A)} is not interpolatable.`)}evaluate(v){let b=this.labels,y=this.outputs;if(1===b.length)return y[0].evaluate(v);let _=this.input.evaluate(v);if(_<=b[0])return y[0].evaluate(v);let x=b.length;if(_>=b[x-1])return y[x-1].evaluate(v);let w=nk(b,_),k=nM.interpolationFactor(this.interpolation,_,b[w],b[w+1]),A=y[w].evaluate(v),C=y[w+1].evaluate(v);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return A+k*(C-A);case"color":return t6.interpolate(A,C,k);case"padding":return nt.interpolate(A,C,k);case"colorArray":return ni.interpolate(A,C,k);case"numberArray":return nn.interpolate(A,C,k);case"variableAnchorOffsetCollection":return na.interpolate(A,C,k);case"array":return t4(A,C,k);case"projectionDefinition":return nl.interpolate(A,C,k)}case"interpolate-hcl":switch(this.type.kind){case"color":return t6.interpolate(A,C,k,"hcl");case"colorArray":return ni.interpolate(A,C,k,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return t6.interpolate(A,C,k,"lab");case"colorArray":return ni.interpolate(A,C,k,"lab")}}}eachChild(v){for(let b of(v(this.input),this.outputs))v(b)}outputDefined(){return this.outputs.every(v=>v.outputDefined())}}function nR(v,b,y,_){let x=_-y,w=v-y;return 0===x?0:1===b?w/x:(Math.pow(b,w)-1)/(Math.pow(b,x)-1)}let nD={color:t6.interpolate,number:function(v,b,y){return v+y*(b-v)},padding:nt.interpolate,numberArray:nn.interpolate,colorArray:ni.interpolate,variableAnchorOffsetCollection:na.interpolate,array:t4};class nP{constructor(v,b){this.type=v,this.args=b}static parse(v,b){if(v.length<2)return b.error("Expected at least one argument.");let y=null,_=b.expectedType;_&&"value"!==_.kind&&(y=_);let x=[];for(let _ of v.slice(1)){let v=b.parse(_,1+x.length,y,void 0,{typeAnnotation:"omit"});if(!v)return null;y=y||v.type,x.push(v)}if(!y)throw Error("No output type");return new nP(_&&x.some(v=>tP(_,v.type))?tA:y,x)}evaluate(v){let b,y=null,_=0;for(let x of this.args)if(_++,(y=x.evaluate(v))&&y instanceof ns&&!y.available&&(b||(b=y.name),y=null,_===this.args.length&&(y=b)),null!==y)break;return y}eachChild(v){this.args.forEach(v)}outputDefined(){return this.args.every(v=>v.outputDefined())}}function nL(v,b){return"=="===v||"!="===v?"boolean"===b.kind||"string"===b.kind||"number"===b.kind||"null"===b.kind||"value"===b.kind:"string"===b.kind||"number"===b.kind||"value"===b.kind}function nN(v,b,y,_){return 0===_.compare(b,y)}function nz(v,b,y){let _="=="!==v&&"!="!==v;return class x{constructor(v,b,y){this.type=t_,this.lhs=v,this.rhs=b,this.collator=y,this.hasUntypedArgument="value"===v.type.kind||"value"===b.type.kind}static parse(v,b){if(3!==v.length&&4!==v.length)return b.error("Expected two or three arguments.");let y=v[0],w=b.parse(v[1],1,tA);if(!w)return null;if(!nL(y,w.type))return b.concat(1).error(`"${y}" comparisons are not supported for type '${tR(w.type)}'.`);let k=b.parse(v[2],2,tA);if(!k)return null;if(!nL(y,k.type))return b.concat(2).error(`"${y}" comparisons are not supported for type '${tR(k.type)}'.`);if(w.type.kind!==k.type.kind&&"value"!==w.type.kind&&"value"!==k.type.kind)return b.error(`Cannot compare types '${tR(w.type)}' and '${tR(k.type)}'.`);_&&("value"===w.type.kind&&"value"!==k.type.kind?w=new nm(k.type,[w]):"value"!==w.type.kind&&"value"===k.type.kind&&(k=new nm(w.type,[k])));let A=null;if(4===v.length){if("string"!==w.type.kind&&"string"!==k.type.kind&&"value"!==w.type.kind&&"value"!==k.type.kind)return b.error("Cannot use collator to compare non-string types.");if(!(A=b.parse(v[3],3,tC)))return null}return new x(w,k,A)}evaluate(x){let w=this.lhs.evaluate(x),k=this.rhs.evaluate(x);if(_&&this.hasUntypedArgument){let b=nd(w),y=nd(k);if(b.kind!==y.kind||"string"!==b.kind&&"number"!==b.kind)throw new nr(`Expected arguments for "${v}" to be (string, string) or (number, number), but found (${b.kind}, ${y.kind}) instead.`)}if(this.collator&&!_&&this.hasUntypedArgument){let v=nd(w),y=nd(k);if("string"!==v.kind||"string"!==y.kind)return b(x,w,k)}return this.collator?y(x,w,k,this.collator.evaluate(x)):b(x,w,k)}eachChild(v){v(this.lhs),v(this.rhs),this.collator&&v(this.collator)}outputDefined(){return!0}}}let nj=nz("==",function(v,b,y){return b===y},nN),nB=nz("!=",function(v,b,y){return b!==y},function(v,b,y,_){return!nN(0,b,y,_)}),n$=nz("<",function(v,b,y){return b<y},function(v,b,y,_){return 0>_.compare(b,y)}),nU=nz(">",function(v,b,y){return b>y},function(v,b,y,_){return _.compare(b,y)>0}),nV=nz("<=",function(v,b,y){return b<=y},function(v,b,y,_){return 0>=_.compare(b,y)}),nq=nz(">=",function(v,b,y){return b>=y},function(v,b,y,_){return _.compare(b,y)>=0});class nH{constructor(v,b,y){this.type=tC,this.locale=y,this.caseSensitive=v,this.diacriticSensitive=b}static parse(v,b){if(2!==v.length)return b.error("Expected one argument.");let y=v[1];if("object"!=typeof y||Array.isArray(y))return b.error("Collator options argument must be an object.");let _=b.parse(void 0!==y["case-sensitive"]&&y["case-sensitive"],1,t_);if(!_)return null;let x=b.parse(void 0!==y["diacritic-sensitive"]&&y["diacritic-sensitive"],1,t_);if(!x)return null;let w=null;return!y.locale||(w=b.parse(y.locale,1,ty))?new nH(_,x,w):null}evaluate(v){return new t8(this.caseSensitive.evaluate(v),this.diacriticSensitive.evaluate(v),this.locale?this.locale.evaluate(v):null)}eachChild(v){v(this.caseSensitive),v(this.diacriticSensitive),this.locale&&v(this.locale)}outputDefined(){return!1}}class nW{constructor(v){this.type=tE,this.sections=v}static parse(v,b){if(v.length<2)return b.error("Expected at least one argument.");let y=v[1];if(!Array.isArray(y)&&"object"==typeof y)return b.error("First argument must be an image or text section.");let _=[],x=!1;for(let y=1;y<=v.length-1;++y){let w=v[y];if(x&&"object"==typeof w&&!Array.isArray(w)){x=!1;let v=null;if(w["font-scale"]&&!(v=b.parse(w["font-scale"],1,tb)))return null;let y=null;if(w["text-font"]&&!(y=b.parse(w["text-font"],1,tM(ty))))return null;let k=null;if(w["text-color"]&&!(k=b.parse(w["text-color"],1,tx)))return null;let A=null;if(w["vertical-align"]){if("string"==typeof w["vertical-align"]&&!t7.includes(w["vertical-align"]))return b.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${w["vertical-align"]}' instead.`);if(!(A=b.parse(w["vertical-align"],1,ty)))return null}let C=_[_.length-1];C.scale=v,C.font=y,C.textColor=k,C.verticalAlign=A}else{let w=b.parse(v[y],1,tA);if(!w)return null;let k=w.type.kind;if("string"!==k&&"value"!==k&&"null"!==k&&"resolvedImage"!==k)return b.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");x=!0,_.push({content:w,scale:null,font:null,textColor:null,verticalAlign:null})}}return new nW(_)}evaluate(v){return new ne(this.sections.map(b=>{let y=b.content.evaluate(v);return nd(y)===tF?new t9("",y,null,null,null,b.verticalAlign?b.verticalAlign.evaluate(v):null):new t9(nh(y),null,b.scale?b.scale.evaluate(v):null,b.font?b.font.evaluate(v).join(","):null,b.textColor?b.textColor.evaluate(v):null,b.verticalAlign?b.verticalAlign.evaluate(v):null)}))}eachChild(v){for(let b of this.sections)v(b.content),b.scale&&v(b.scale),b.font&&v(b.font),b.textColor&&v(b.textColor),b.verticalAlign&&v(b.verticalAlign)}outputDefined(){return!1}}function nG(v,b){let y=Math.pow(2,b.z);return[360*((v[0]/8192+b.x)/y)-180,360/Math.PI*Math.atan(Math.exp((180-360*((v[1]/8192+b.y)/y))*Math.PI/180))-90]}function nY(v,b){v[0]=Math.min(v[0],b[0]),v[1]=Math.min(v[1],b[1]),v[2]=Math.max(v[2],b[0]),v[3]=Math.max(v[3],b[1])}function nZ(v,b){return!(v[0]<=b[0]||v[2]>=b[2]||v[1]<=b[1]||v[3]>=b[3])}function nX(v,b,y,_){var x,w;return 0!=(x=[_[0]-y[0],_[1]-y[1]])[0]*(w=[b[0]-v[0],b[1]-v[1]])[1]-x[1]*w[0]&&!(!nQ(v,b,y,_)||!nQ(y,_,v,b))}function nK(v,b,y=!1){var _,x;let w=!1;for(let k of b)for(let b=0;b<k.length-1;b++){if(function(v,b,y){let _=v[0]-b[0],x=v[1]-b[1],w=v[0]-y[0],k=v[1]-y[1];return _*k-w*x==0&&_*w<=0&&x*k<=0}(v,k[b],k[b+1]))return y;(_=k[b])[1]>v[1]!=(x=k[b+1])[1]>v[1]&&v[0]<(x[0]-_[0])*(v[1]-_[1])/(x[1]-_[1])+_[0]&&(w=!w)}return w}function nJ(v,b){for(let y of v)if(!nK(y,b))return!1;for(let y=0;y<v.length-1;++y)if(function(v,b,y){for(let _ of y)for(let y=0;y<_.length-1;++y)if(nX(v,b,_[y],_[y+1]))return!0;return!1}(v[y],v[y+1],b))return!1;return!0}function nQ(v,b,y,_){let x=_[0]-y[0],w=_[1]-y[1],k=(v[0]-y[0])*w-x*(v[1]-y[1]),A=(b[0]-y[0])*w-x*(b[1]-y[1]);return k>0&&A<0||k<0&&A>0}function n0(v,b,y){let _=[];for(let x=0;x<v.length;x++){let w=[];for(let _=0;_<v[x].length;_++){let k=function(v,b){let y=(180+v[0])/360,_=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+v[1]*Math.PI/360)))/360,x=Math.pow(2,b.z);return[Math.round(y*x*8192),Math.round(_*x*8192)]}(v[x][_],y);nY(b,k),w.push(k)}_.push(w)}return _}function n1(v,b,y){let _=[];for(let x=0;x<v.length;x++){let w=n0(v[x],b,y);_.push(w)}return _}function n2(v,b,y,_){if(v[0]<y[0]||v[0]>y[2]){let b=.5*_,x=v[0]-y[0]>b?-_:y[0]-v[0]>b?_:0;0===x&&(x=v[0]-y[2]>b?-_:y[2]-v[0]>b?_:0),v[0]+=x}nY(b,v)}function n5(v,b,y,_){let x=8192*Math.pow(2,_.z),w=[8192*_.x,8192*_.y],k=[];for(let _ of v)for(let v of _){let _=[v.x+w[0],v.y+w[1]];n2(_,b,y,x),k.push(_)}return k}function n3(v,b,y,_){let x=8192*Math.pow(2,_.z),w=[8192*_.x,8192*_.y],k=[];for(let y of v){let v=[];for(let _ of y){let y=[_.x+w[0],_.y+w[1]];nY(b,y),v.push(y)}k.push(v)}if(b[2]-b[0]<=x/2)for(let v of(b[0]=b[1]=1/0,b[2]=b[3]=-1/0,k))for(let _ of v)n2(_,b,y,x);return k}class n4{constructor(v,b){this.type=t_,this.geojson=v,this.geometries=b}static parse(v,b){if(2!==v.length)return b.error(`'within' expression requires exactly one argument, but found ${v.length-1} instead.`);if(nu(v[1])){let b=v[1];if("FeatureCollection"===b.type){let v=[];for(let y of b.features){let{type:b,coordinates:_}=y.geometry;"Polygon"===b&&v.push(_),"MultiPolygon"===b&&v.push(..._)}if(v.length)return new n4(b,{type:"MultiPolygon",coordinates:v})}else if("Feature"===b.type){let v=b.geometry.type;if("Polygon"===v||"MultiPolygon"===v)return new n4(b,b.geometry)}else if("Polygon"===b.type||"MultiPolygon"===b.type)return new n4(b,b)}return b.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(v){if(null!=v.geometry()&&null!=v.canonicalID()){if("Point"===v.geometryType())return function(v,b){let y=[1/0,1/0,-1/0,-1/0],_=[1/0,1/0,-1/0,-1/0],x=v.canonicalID();if("Polygon"===b.type){let w=n0(b.coordinates,_,x),k=n5(v.geometry(),y,_,x);if(!nZ(y,_))return!1;for(let v of k)if(!nK(v,w))return!1}if("MultiPolygon"===b.type){let w=n1(b.coordinates,_,x),k=n5(v.geometry(),y,_,x);if(!nZ(y,_))return!1;for(let v of k)if(!function(v,b){for(let y of b)if(nK(v,y))return!0;return!1}(v,w))return!1}return!0}(v,this.geometries);if("LineString"===v.geometryType())return function(v,b){let y=[1/0,1/0,-1/0,-1/0],_=[1/0,1/0,-1/0,-1/0],x=v.canonicalID();if("Polygon"===b.type){let w=n0(b.coordinates,_,x),k=n3(v.geometry(),y,_,x);if(!nZ(y,_))return!1;for(let v of k)if(!nJ(v,w))return!1}if("MultiPolygon"===b.type){let w=n1(b.coordinates,_,x),k=n3(v.geometry(),y,_,x);if(!nZ(y,_))return!1;for(let v of k)if(!function(v,b){for(let y of b)if(nJ(v,y))return!0;return!1}(v,w))return!1}return!0}(v,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let n6=class{constructor(v=[],b=(v,b)=>v<b?-1:+(v>b)){if(this.data=v,this.length=this.data.length,this.compare=b,this.length>0)for(let v=(this.length>>1)-1;v>=0;v--)this._down(v)}push(v){this.data.push(v),this._up(this.length++)}pop(){if(0===this.length)return;let v=this.data[0],b=this.data.pop();return--this.length>0&&(this.data[0]=b,this._down(0)),v}peek(){return this.data[0]}_up(v){let{data:b,compare:y}=this,_=b[v];for(;v>0;){let x=v-1>>1,w=b[x];if(y(_,w)>=0)break;b[v]=w,v=x}b[v]=_}_down(v){let{data:b,compare:y}=this,_=this.length>>1,x=b[v];for(;v<_;){let _=1+(v<<1),w=_+1;if(w<this.length&&0>y(b[w],b[_])&&(_=w),y(b[_],x)>=0)break;b[v]=b[_],v=_}b[v]=x}};function n8(v,b,y){let _=v[b];v[b]=v[y],v[y]=_}function n7(v,b){let y,_;if(v.length<=1)return[v];let x=[];for(let b of v){let v=function(v){let b=0;for(let y,_,x=0,w=v.length,k=w-1;x<w;k=x++)y=v[x],b+=((_=v[k]).x-y.x)*(y.y+_.y);return b}(b);0!==v&&(b.area=Math.abs(v),void 0===_&&(_=v<0),_===v<0?(y&&x.push(y),y=[b]):y.push(b))}if(y&&x.push(y),b>1)for(let v=0;v<x.length;v++)x[v].length<=b||(function v(b,y,_=0,x=b.length-1,w=function(v,b){return v<b?-1:+(v>b)}){for(;x>_;){if(x-_>600){let k=x-_+1,A=y-_+1,C=Math.log(k),E=.5*Math.exp(2*C/3),S=.5*Math.sqrt(C*E*(k-E)/k)*(A-k/2<0?-1:1);v(b,y,Math.max(_,Math.floor(y-A*E/k+S)),Math.min(x,Math.floor(y+(k-A)*E/k+S)),w)}let k=b[y],A=_,C=x;for(n8(b,_,y),w(b[x],k)>0&&n8(b,_,x);A<C;){for(n8(b,A,C),A++,C--;0>w(b[A],k);)A++;for(;w(b[C],k)>0;)C--}0===w(b[_],k)?n8(b,_,C):n8(b,++C,x),C<=y&&(_=C+1),y<=C&&(x=C-1)}}(x[v],b,1,x[v].length-1,n9),x[v]=x[v].slice(0,b));return x}function n9(v,b){return b.area-v.area}let ie=1/298.257223563*(2-1/298.257223563),it=Math.PI/180;class ii{constructor(v){const b=6378.137*it*1e3,y=Math.cos(v*it),_=1/(1-ie*(1-y*y)),x=Math.sqrt(_);this.kx=b*x*y,this.ky=b*x*_*(1-ie)}distance(v,b){let y=this.wrap(v[0]-b[0])*this.kx,_=(v[1]-b[1])*this.ky;return Math.sqrt(y*y+_*_)}pointOnLine(v,b){let y,_,x,w,k=1/0;for(let A=0;A<v.length-1;A++){let C=v[A][0],E=v[A][1],S=this.wrap(v[A+1][0]-C)*this.kx,T=(v[A+1][1]-E)*this.ky,O=0;0===S&&0===T||((O=(this.wrap(b[0]-C)*this.kx*S+(b[1]-E)*this.ky*T)/(S*S+T*T))>1?(C=v[A+1][0],E=v[A+1][1]):O>0&&(C+=S/this.kx*O,E+=T/this.ky*O));let F=(S=this.wrap(b[0]-C)*this.kx)*S+(T=(b[1]-E)*this.ky)*T;F<k&&(k=F,y=C,_=E,x=A,w=O)}return{point:[y,_],index:x,t:Math.max(0,Math.min(1,w))}}wrap(v){for(;v<-180;)v+=360;for(;v>180;)v-=360;return v}}function ir(v,b){return b[0]-v[0]}function io(v){return v[1]-v[0]+1}function ia(v,b){return v[1]>=v[0]&&v[1]<b}function is(v,b){if(v[0]>v[1])return[null,null];let y=io(v);if(b){if(2===y)return[v,null];let b=Math.floor(y/2);return[[v[0],v[0]+b],[v[0]+b,v[1]]]}if(1===y)return[v,null];let _=Math.floor(y/2)-1;return[[v[0],v[0]+_],[v[0]+_+1,v[1]]]}function il(v,b){if(!ia(b,v.length))return[1/0,1/0,-1/0,-1/0];let y=[1/0,1/0,-1/0,-1/0];for(let _=b[0];_<=b[1];++_)nY(y,v[_]);return y}function ic(v){let b=[1/0,1/0,-1/0,-1/0];for(let y of v)for(let v of y)nY(b,v);return b}function iu(v){return -1/0!==v[0]&&-1/0!==v[1]&&1/0!==v[2]&&1/0!==v[3]}function id(v,b,y){if(!iu(v)||!iu(b))return 0/0;let _=0,x=0;return v[2]<b[0]&&(_=b[0]-v[2]),v[0]>b[2]&&(_=v[0]-b[2]),v[1]>b[3]&&(x=v[1]-b[3]),v[3]<b[1]&&(x=b[1]-v[3]),y.distance([0,0],[_,x])}function ih(v,b,y){let _=y.pointOnLine(b,v);return y.distance(v,_.point)}function ip(v,b,y,_,x){return Math.min(Math.min(ih(v,[y,_],x),ih(b,[y,_],x)),Math.min(ih(y,[v,b],x),ih(_,[v,b],x)))}function im(v,b){for(let y of v)for(let v of y)if(nK(v,b,!0))return!0;return!1}function ig(v,b,y,_,x,w){if(!w)return;let k=id(il(_,w),x,y);k<b&&v.push([k,w,[0,0]])}function iv(v,b,y,_,x,w,k){if(!w||!k)return;let A=id(il(_,w),il(x,k),y);A<b&&v.push([A,w,k])}function ib(v,b,y,_,x=1/0){let w=Math.min(_.distance(v[0],y[0][0]),x);if(0===w)return w;let k=new n6([[0,[0,v.length-1],[0,0]]],ir),A=ic(y);for(;k.length>0;){let x=k.pop();if(x[0]>=w)continue;let C=x[1],E=b?50:100;if(io(C)<=E){if(!ia(C,v.length))return 0/0;if(b){let b=function(v,b,y,_){if(!ia(b,v.length))return 0/0;for(let _=b[0];_<=b[1];++_)if(nK(v[_],y,!0))return 0;let x=1/0;for(let w=b[0];w<b[1];++w){let b=v[w],k=v[w+1];for(let v of y)for(let y=0,w=v.length,A=w-1;y<w;A=y++){let w=v[A],C=v[y];if(nX(b,k,w,C))return 0;x=Math.min(x,ip(b,k,w,C,_))}}return x}(v,C,y,_);if(isNaN(b)||0===b)return b;w=Math.min(w,b)}else for(let b=C[0];b<=C[1];++b)if(0===(w=Math.min(w,function(v,b,y){if(nK(v,b,!0))return 0;let _=1/0;for(let x of b){let b=x[0],w=x[x.length-1];if(b!==w&&0===(_=Math.min(_,ih(v,[w,b],y))))break;let k=y.pointOnLine(x,v);if(0===(_=Math.min(_,y.distance(v,k.point))))break}return _}(v[b],y,_))))return 0}else{let y=is(C,b);ig(k,w,_,v,A,y[0]),ig(k,w,_,v,A,y[1])}}return w}function iy(v,b,y,_,x,w=1/0){let k=Math.min(w,x.distance(v[0],y[0]));if(0===k)return k;let A=new n6([[0,[0,v.length-1],[0,y.length-1]]],ir);for(;A.length>0;){let w=A.pop();if(w[0]>=k)continue;let C=w[1],E=w[2],S=b?50:100,T=_?50:100;if(io(C)<=S&&io(E)<=T){let w;if(!ia(C,v.length)&&ia(E,y.length))return 0/0;if(b&&_)k=Math.min(k,function(v,b,y,_,x){if(!ia(b,v.length)||!ia(_,y.length))return 1/0;let w=1/0;for(let k=b[0];k<b[1];++k){let b=v[k],A=v[k+1];for(let v=_[0];v<_[1];++v){let _=y[v],k=y[v+1];if(nX(b,A,_,k))return 0;w=Math.min(w,ip(b,A,_,k,x))}}return w}(v,C,y,E,x));else if(b&&!_){let b=v.slice(C[0],C[1]+1);for(let v=E[0];v<=E[1];++v)if(0===(k=Math.min(k,ih(y[v],b,x))))return k}else if(!b&&_){let b=y.slice(E[0],E[1]+1);for(let y=C[0];y<=C[1];++y)if(0===(k=Math.min(k,ih(v[y],b,x))))return k}else k=Math.min(k,function(v,b,y,_,x){if(!ia(b,v.length)||!ia(_,y.length))return 0/0;let w=1/0;for(let k=b[0];k<=b[1];++k)for(let b=_[0];b<=_[1];++b)if(0===(w=Math.min(w,x.distance(v[k],y[b]))))return w;return w}(v,C,y,E,x))}else{let w=is(C,b),S=is(E,_);iv(A,k,x,v,y,w[0],S[0]),iv(A,k,x,v,y,w[0],S[1]),iv(A,k,x,v,y,w[1],S[0]),iv(A,k,x,v,y,w[1],S[1])}}return k}function i_(v){return"MultiPolygon"===v.type?v.coordinates.map(v=>({type:"Polygon",coordinates:v})):"MultiLineString"===v.type?v.coordinates.map(v=>({type:"LineString",coordinates:v})):"MultiPoint"===v.type?v.coordinates.map(v=>({type:"Point",coordinates:v})):[v]}class ix{constructor(v,b){this.type=tb,this.geojson=v,this.geometries=b}static parse(v,b){if(2!==v.length)return b.error(`'distance' expression requires exactly one argument, but found ${v.length-1} instead.`);if(nu(v[1])){let b=v[1];if("FeatureCollection"===b.type)return new ix(b,b.features.map(v=>i_(v.geometry)).flat());if("Feature"===b.type)return new ix(b,i_(b.geometry));if("type"in b&&"coordinates"in b)return new ix(b,i_(b))}return b.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(v){if(null!=v.geometry()&&null!=v.canonicalID()){if("Point"===v.geometryType())return function(v,b){let y=v.geometry(),_=y.flat().map(b=>nG([b.x,b.y],v.canonical));if(0===y.length)return 0/0;let x=new ii(_[0][1]),w=1/0;for(let v of b){switch(v.type){case"Point":w=Math.min(w,iy(_,!1,[v.coordinates],!1,x,w));break;case"LineString":w=Math.min(w,iy(_,!1,v.coordinates,!0,x,w));break;case"Polygon":w=Math.min(w,ib(_,!1,v.coordinates,x,w))}if(0===w)break}return w}(v,this.geometries);if("LineString"===v.geometryType())return function(v,b){let y=v.geometry(),_=y.flat().map(b=>nG([b.x,b.y],v.canonical));if(0===y.length)return 0/0;let x=new ii(_[0][1]),w=1/0;for(let v of b){switch(v.type){case"Point":w=Math.min(w,iy(_,!0,[v.coordinates],!1,x,w));break;case"LineString":w=Math.min(w,iy(_,!0,v.coordinates,!0,x,w));break;case"Polygon":w=Math.min(w,ib(_,!0,v.coordinates,x,w))}if(0===w)break}return w}(v,this.geometries);if("Polygon"===v.geometryType())return function(v,b){let y=v.geometry();if(0===y.length||0===y[0].length)return 0/0;let _=n7(y,0).map(b=>b.map(b=>b.map(b=>nG([b.x,b.y],v.canonical)))),x=new ii(_[0][0][0][1]),w=1/0;for(let v of b)for(let b of _){switch(v.type){case"Point":w=Math.min(w,ib([v.coordinates],!1,b,x,w));break;case"LineString":w=Math.min(w,ib(v.coordinates,!0,b,x,w));break;case"Polygon":w=Math.min(w,function(v,b,y,_=1/0){let x=ic(v),w=ic(b);if(1/0!==_&&id(x,w,y)>=_)return _;if(nZ(x,w)){if(im(v,b))return 0}else if(im(b,v))return 0;let k=1/0;for(let _ of v)for(let v=0,x=_.length,w=x-1;v<x;w=v++){let x=_[w],A=_[v];for(let v of b)for(let b=0,_=v.length,w=_-1;b<_;w=b++){let _=v[w],C=v[b];if(nX(x,A,_,C))return 0;k=Math.min(k,ip(x,A,_,C,y))}}return k}(b,v.coordinates,x,w))}if(0===w)return w}return w}(v,this.geometries)}return 0/0}eachChild(){}outputDefined(){return!0}}class iw{constructor(v){this.type=tA,this.key=v}static parse(v,b){if(2!==v.length)return b.error(`Expected 1 argument, but found ${v.length-1} instead.`);let y=v[1];return null==y?b.error("Global state property must be defined."):"string"!=typeof y?b.error(`Global state property must be string, but found ${typeof v[1]} instead.`):new iw(y)}evaluate(v){var b;let y=null==(b=v.globals)?void 0:b.globalState;return y&&0!==Object.keys(y).length?tQ(y,this.key):null}eachChild(){}outputDefined(){return!1}}let ik={"==":nj,"!=":nB,">":nU,"<":n$,">=":nq,"<=":nV,array:nm,at:class v{constructor(v,b,y){this.type=v,this.index=b,this.input=y}static parse(b,y){if(3!==b.length)return y.error(`Expected 2 arguments, but found ${b.length-1} instead.`);let _=y.parse(b[1],1,tb),x=y.parse(b[2],2,tM(y.expectedType||tA));return _&&x?new v(x.type.itemType,_,x):null}evaluate(v){let b=this.index.evaluate(v),y=this.input.evaluate(v);if(b<0)throw new nr(`Array index out of bounds: ${b} < 0.`);if(b>=y.length)throw new nr(`Array index out of bounds: ${b} > ${y.length-1}.`);if(b!==Math.floor(b))throw new nr(`Array index must be an integer, but found ${b} instead.`);return y[b]}eachChild(v){v(this.index),v(this.input)}outputDefined(){return!1}},boolean:nm,case:class v{constructor(v,b,y){this.type=v,this.branches=b,this.otherwise=y}static parse(b,y){let _;if(b.length<4)return y.error(`Expected at least 3 arguments, but found only ${b.length-1}.`);if(b.length%2!=0)return y.error("Expected an odd number of arguments.");y.expectedType&&"value"!==y.expectedType.kind&&(_=y.expectedType);let x=[];for(let v=1;v<b.length-1;v+=2){let w=y.parse(b[v],v,t_);if(!w)return null;let k=y.parse(b[v+1],v+1,_);if(!k)return null;x.push([w,k]),_=_||k.type}let w=y.parse(b[b.length-1],b.length-1,_);if(!w)return null;if(!_)throw Error("Can't infer output type");return new v(_,x,w)}evaluate(v){for(let[b,y]of this.branches)if(b.evaluate(v))return y.evaluate(v);return this.otherwise.evaluate(v)}eachChild(v){for(let[b,y]of this.branches)v(b),v(y);v(this.otherwise)}outputDefined(){return this.branches.every(([v,b])=>b.outputDefined())&&this.otherwise.outputDefined()}},coalesce:nP,collator:nH,format:nW,image:class v{constructor(v){this.type=tF,this.input=v}static parse(b,y){if(2!==b.length)return y.error("Expected two arguments.");let _=y.parse(b[1],1,ty);return _?new v(_):y.error("No image name provided.")}evaluate(v){let b=this.input.evaluate(v),y=ns.fromString(b);return y&&v.availableImages&&(y.available=v.availableImages.indexOf(b)>-1),y}eachChild(v){v(this.input)}outputDefined(){return!1}},in:class v{constructor(v,b){this.type=t_,this.needle=v,this.haystack=b}static parse(b,y){if(3!==b.length)return y.error(`Expected 2 arguments, but found ${b.length-1} instead.`);let _=y.parse(b[1],1,tA),x=y.parse(b[2],2,tA);return _&&x?tL(_.type,[t_,ty,tb,tv,tA])?new v(_,x):y.error(`Expected first argument to be of type boolean, string, number or null, but found ${tR(_.type)} instead`):null}evaluate(v){let b=this.needle.evaluate(v),y=this.haystack.evaluate(v);if(!y)return!1;if(!tN(b,["boolean","string","number","null"]))throw new nr(`Expected first argument to be of type boolean, string, number or null, but found ${tR(nd(b))} instead.`);if(!tN(y,["string","array"]))throw new nr(`Expected second argument to be of type array or string, but found ${tR(nd(y))} instead.`);return y.indexOf(b)>=0}eachChild(v){v(this.needle),v(this.haystack)}outputDefined(){return!0}},"index-of":class v{constructor(v,b,y){this.type=tb,this.needle=v,this.haystack=b,this.fromIndex=y}static parse(b,y){if(b.length<=2||b.length>=5)return y.error(`Expected 2 or 3 arguments, but found ${b.length-1} instead.`);let _=y.parse(b[1],1,tA),x=y.parse(b[2],2,tA);if(!_||!x)return null;if(!tL(_.type,[t_,ty,tb,tv,tA]))return y.error(`Expected first argument to be of type boolean, string, number or null, but found ${tR(_.type)} instead`);if(4===b.length){let w=y.parse(b[3],3,tb);return w?new v(_,x,w):null}return new v(_,x)}evaluate(v){let b,y=this.needle.evaluate(v),_=this.haystack.evaluate(v);if(!tN(y,["boolean","string","number","null"]))throw new nr(`Expected first argument to be of type boolean, string, number or null, but found ${tR(nd(y))} instead.`);if(this.fromIndex&&(b=this.fromIndex.evaluate(v)),tN(_,["string"])){let v=_.indexOf(y,b);return -1===v?-1:[..._.slice(0,v)].length}if(tN(_,["array"]))return _.indexOf(y,b);throw new nr(`Expected second argument to be of type array or string, but found ${tR(nd(_))} instead.`)}eachChild(v){v(this.needle),v(this.haystack),this.fromIndex&&v(this.fromIndex)}outputDefined(){return!1}},interpolate:nM,"interpolate-hcl":nM,"interpolate-lab":nM,length:class v{constructor(v){this.type=tb,this.input=v}static parse(b,y){if(2!==b.length)return y.error(`Expected 1 argument, but found ${b.length-1} instead.`);let _=y.parse(b[1],1);return _?"array"!==_.type.kind&&"string"!==_.type.kind&&"value"!==_.type.kind?y.error(`Expected argument of type string or array, but found ${tR(_.type)} instead.`):new v(_):null}evaluate(v){let b=this.input.evaluate(v);if("string"==typeof b)return[...b].length;if(Array.isArray(b))return b.length;throw new nr(`Expected value to be of type string or array, but found ${tR(nd(b))} instead.`)}eachChild(v){v(this.input)}outputDefined(){return!1}},let:nx,literal:np,match:class v{constructor(v,b,y,_,x,w){this.inputType=v,this.type=b,this.input=y,this.cases=_,this.outputs=x,this.otherwise=w}static parse(b,y){let _,x;if(b.length<5)return y.error(`Expected at least 4 arguments, but found only ${b.length-1}.`);if(b.length%2!=1)return y.error("Expected an even number of arguments.");y.expectedType&&"value"!==y.expectedType.kind&&(x=y.expectedType);let w={},k=[];for(let v=2;v<b.length-1;v+=2){let A=b[v],C=b[v+1];Array.isArray(A)||(A=[A]);let E=y.concat(v);if(0===A.length)return E.error("Expected at least one branch label.");for(let v of A){if("number"!=typeof v&&"string"!=typeof v)return E.error("Branch labels must be numbers or strings.");if("number"==typeof v&&Math.abs(v)>Number.MAX_SAFE_INTEGER)return E.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof v&&Math.floor(v)!==v)return E.error("Numeric branch labels must be integer values.");if(_){if(E.checkSubtype(_,nd(v)))return null}else _=nd(v);if(void 0!==w[String(v)])return E.error("Branch labels must be unique.");w[String(v)]=k.length}let S=y.parse(C,v,x);if(!S)return null;x=x||S.type,k.push(S)}let A=y.parse(b[1],1,tA);if(!A)return null;let C=y.parse(b[b.length-1],b.length-1,x);return C?"value"!==A.type.kind&&y.concat(1).checkSubtype(_,A.type)?null:new v(_,x,A,w,k,C):null}evaluate(v){let b=this.input.evaluate(v);return(nd(b)===this.inputType&&this.outputs[this.cases[b]]||this.otherwise).evaluate(v)}eachChild(v){v(this.input),this.outputs.forEach(v),v(this.otherwise)}outputDefined(){return this.outputs.every(v=>v.outputDefined())&&this.otherwise.outputDefined()}},number:nm,"number-format":class v{constructor(v,b,y,_,x){this.type=ty,this.number=v,this.locale=b,this.currency=y,this.minFractionDigits=_,this.maxFractionDigits=x}static parse(b,y){if(3!==b.length)return y.error("Expected two arguments.");let _=y.parse(b[1],1,tb);if(!_)return null;let x=b[2];if("object"!=typeof x||Array.isArray(x))return y.error("NumberFormat options argument must be an object.");let w=null;if(x.locale&&!(w=y.parse(x.locale,1,ty)))return null;let k=null;if(x.currency&&!(k=y.parse(x.currency,1,ty)))return null;let A=null;if(x["min-fraction-digits"]&&!(A=y.parse(x["min-fraction-digits"],1,tb)))return null;let C=null;return!x["max-fraction-digits"]||(C=y.parse(x["max-fraction-digits"],1,tb))?new v(_,w,k,A,C):null}evaluate(v){return new Intl.NumberFormat(this.locale?this.locale.evaluate(v):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(v):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(v):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(v):void 0}).format(this.number.evaluate(v))}eachChild(v){v(this.number),this.locale&&v(this.locale),this.currency&&v(this.currency),this.minFractionDigits&&v(this.minFractionDigits),this.maxFractionDigits&&v(this.maxFractionDigits)}outputDefined(){return!1}},object:nm,slice:class v{constructor(v,b,y,_){this.type=v,this.input=b,this.beginIndex=y,this.endIndex=_}static parse(b,y){if(b.length<=2||b.length>=5)return y.error(`Expected 2 or 3 arguments, but found ${b.length-1} instead.`);let _=y.parse(b[1],1,tA),x=y.parse(b[2],2,tb);if(!_||!x)return null;if(!tL(_.type,[tM(tA),ty,tA]))return y.error(`Expected first argument to be of type array or string, but found ${tR(_.type)} instead`);if(4===b.length){let w=y.parse(b[3],3,tb);return w?new v(_.type,_,x,w):null}return new v(_.type,_,x)}evaluate(v){let b,y=this.input.evaluate(v),_=this.beginIndex.evaluate(v);if(this.endIndex&&(b=this.endIndex.evaluate(v)),tN(y,["string"]))return[...y].slice(_,b).join("");if(tN(y,["array"]))return y.slice(_,b);throw new nr(`Expected first argument to be of type array or string, but found ${tR(nd(y))} instead.`)}eachChild(v){v(this.input),v(this.beginIndex),this.endIndex&&v(this.endIndex)}outputDefined(){return!1}},step:nA,string:nm,"to-boolean":nv,"to-color":nv,"to-number":nv,"to-string":nv,var:nw,within:n4,distance:ix,"global-state":iw};class iA{constructor(v,b,y,_){this.name=v,this.type=b,this._evaluate=y,this.args=_}evaluate(v){return this._evaluate(v,this.args)}eachChild(v){this.args.forEach(v)}outputDefined(){return!1}static parse(v,b){let y=v[0],_=iA.definitions[y];if(!_)return b.error(`Unknown expression "${y}". If you wanted a literal array, use ["literal", [...]].`,0);let x=Array.isArray(_)?_[0]:_.type,w=Array.isArray(_)?[[_[1],_[2]]]:_.overloads,k=w.filter(([b])=>!Array.isArray(b)||b.length===v.length-1),A=null;for(let[_,w]of k){A=new n_(b.registry,iT,b.path,null,b.scope);let k=[],C=!1;for(let b=1;b<v.length;b++){let y=v[b],x=Array.isArray(_)?_[b-1]:_.type,w=A.parse(y,1+k.length,x);if(!w){C=!0;break}k.push(w)}if(!C)if(Array.isArray(_)&&_.length!==k.length)A.error(`Expected ${_.length} arguments, but found ${k.length} instead.`);else{for(let v=0;v<k.length;v++){let b=Array.isArray(_)?_[v]:_.type,y=k[v];A.concat(v+1).checkSubtype(b,y.type)}if(0===A.errors.length)return new iA(y,x,w,k)}}if(1===k.length)b.errors.push(...A.errors);else{let y=(k.length?k:w).map(([v])=>Array.isArray(v)?`(${v.map(tR).join(", ")})`:`(${tR(v.type)}...)`).join(" | "),_=[];for(let y=1;y<v.length;y++){let x=b.parse(v[y],1+_.length);if(!x)return null;_.push(tR(x.type))}b.error(`Expected arguments of type ${y}, but found (${_.join(", ")}) instead.`)}return null}static register(v,b){for(let y in iA.definitions=b,b)v[y]=iA}}function iC(v,[b,y,_,x]){b=b.evaluate(v),y=y.evaluate(v),_=_.evaluate(v);let w=x?x.evaluate(v):1,k=nc(b,y,_,w);if(k)throw new nr(k);return new t6(b/255,y/255,_/255,w,!1)}function iE(v,b){let y=b[v];return void 0===y?null:y}function iS(v){return{type:v}}function iT(v){if(v instanceof nw)return iT(v.boundExpression);if(v instanceof iA&&"error"===v.name||v instanceof nH||v instanceof n4||v instanceof ix||v instanceof iw)return!1;let b=v instanceof nv||v instanceof nm,y=!0;return v.eachChild(v=>{y=b?y&&iT(v):y&&v instanceof np}),!!y&&iO(v)&&iI(v,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"])}function iO(v){if(v instanceof iA&&("get"===v.name&&1===v.args.length||"feature-state"===v.name||"has"===v.name&&1===v.args.length||"properties"===v.name||"geometry-type"===v.name||"id"===v.name||/^filter-/.test(v.name))||v instanceof n4||v instanceof ix)return!1;let b=!0;return v.eachChild(v=>{b&&!iO(v)&&(b=!1)}),b}function iF(v){if(v instanceof iA&&"feature-state"===v.name)return!1;let b=!0;return v.eachChild(v=>{b&&!iF(v)&&(b=!1)}),b}function iI(v,b){if(v instanceof iA&&b.indexOf(v.name)>=0)return!1;let y=!0;return v.eachChild(v=>{y&&!iI(v,b)&&(y=!1)}),y}function iM(v){return{result:"success",value:v}}function iR(v){return{result:"error",value:v}}function iD(v){return"data-driven"===v["property-type"]||"cross-faded-data-driven"===v["property-type"]}function iP(v){return!!v.expression&&v.expression.parameters.indexOf("zoom")>-1}function iL(v){return!!v.expression&&v.expression.interpolated}function iN(v){return v instanceof Number?"number":v instanceof String?"string":v instanceof Boolean?"boolean":Array.isArray(v)?"array":null===v?"null":typeof v}function iz(v){return"object"==typeof v&&null!==v&&!Array.isArray(v)&&nd(v)===tk}function ij(v){return v}function iB(v,b,y){return void 0!==v?v:void 0!==b?b:void 0!==y?y:void 0}function i$(v,b,y,_,x){return iB(typeof y===x?_[y]:void 0,v.default,b.default)}function iU(v,b,y){if("number"!==iN(y))return iB(v.default,b.default);let _=v.stops.length;if(1===_||y<=v.stops[0][0])return v.stops[0][1];if(y>=v.stops[_-1][0])return v.stops[_-1][1];let x=nk(v.stops.map(v=>v[0]),y);return v.stops[x][1]}function iV(v,b,y){var _;let x,w,k=void 0!==v.base?v.base:1;if("number"!==iN(y))return iB(v.default,b.default);let A=v.stops.length;if(1===A||y<=v.stops[0][0])return v.stops[0][1];if(y>=v.stops[A-1][0])return v.stops[A-1][1];let C=nk(v.stops.map(v=>v[0]),y),E=(_=v.stops[C][0],x=v.stops[C+1][0]-_,w=y-_,0===x?0:1===k?w/x:(Math.pow(k,w)-1)/(Math.pow(k,x)-1)),S=v.stops[C][1],T=v.stops[C+1][1],O=nD[b.type]||ij;return"function"==typeof S.evaluate?{evaluate(...b){let y=S.evaluate.apply(void 0,b),_=T.evaluate.apply(void 0,b);if(void 0!==y&&void 0!==_)return O(y,_,E,v.colorSpace)}}:O(S,T,E,v.colorSpace)}function iq(v,b,y){switch(b.type){case"color":y=t6.parse(y);break;case"formatted":y=ne.fromString(y.toString());break;case"resolvedImage":y=ns.fromString(y.toString());break;case"padding":y=nt.parse(y);break;case"colorArray":y=ni.parse(y);break;case"numberArray":y=nn.parse(y);break;default:iN(y)===b.type||"enum"===b.type&&b.values[y]||(y=void 0)}return iB(y,v.default,b.default)}iA.register(ik,{error:[{kind:"error"},[ty],(v,[b])=>{throw new nr(b.evaluate(v))}],typeof:[ty,[tA],(v,[b])=>tR(nd(b.evaluate(v)))],"to-rgba":[tM(tb,4),[tx],(v,[b])=>{let[y,_,x,w]=b.evaluate(v).rgb;return[255*y,255*_,255*x,w]}],rgb:[tx,[tb,tb,tb],iC],rgba:[tx,[tb,tb,tb,tb],iC],has:{type:t_,overloads:[[[ty],(v,[b])=>b.evaluate(v)in v.properties()],[[ty,tk],(v,[b,y])=>b.evaluate(v)in y.evaluate(v)]]},get:{type:tA,overloads:[[[ty],(v,[b])=>iE(b.evaluate(v),v.properties())],[[ty,tk],(v,[b,y])=>iE(b.evaluate(v),y.evaluate(v))]]},"feature-state":[tA,[ty],(v,[b])=>iE(b.evaluate(v),v.featureState||{})],properties:[tk,[],v=>v.properties()],"geometry-type":[ty,[],v=>v.geometryType()],id:[tA,[],v=>v.id()],zoom:[tb,[],v=>v.globals.zoom],"heatmap-density":[tb,[],v=>v.globals.heatmapDensity||0],elevation:[tb,[],v=>v.globals.elevation||0],"line-progress":[tb,[],v=>v.globals.lineProgress||0],accumulated:[tA,[],v=>void 0===v.globals.accumulated?null:v.globals.accumulated],"+":[tb,iS(tb),(v,b)=>{let y=0;for(let _ of b)y+=_.evaluate(v);return y}],"*":[tb,iS(tb),(v,b)=>{let y=1;for(let _ of b)y*=_.evaluate(v);return y}],"-":{type:tb,overloads:[[[tb,tb],(v,[b,y])=>b.evaluate(v)-y.evaluate(v)],[[tb],(v,[b])=>-b.evaluate(v)]]},"/":[tb,[tb,tb],(v,[b,y])=>b.evaluate(v)/y.evaluate(v)],"%":[tb,[tb,tb],(v,[b,y])=>b.evaluate(v)%y.evaluate(v)],ln2:[tb,[],()=>Math.LN2],pi:[tb,[],()=>Math.PI],e:[tb,[],()=>Math.E],"^":[tb,[tb,tb],(v,[b,y])=>Math.pow(b.evaluate(v),y.evaluate(v))],sqrt:[tb,[tb],(v,[b])=>Math.sqrt(b.evaluate(v))],log10:[tb,[tb],(v,[b])=>Math.log(b.evaluate(v))/Math.LN10],ln:[tb,[tb],(v,[b])=>Math.log(b.evaluate(v))],log2:[tb,[tb],(v,[b])=>Math.log(b.evaluate(v))/Math.LN2],sin:[tb,[tb],(v,[b])=>Math.sin(b.evaluate(v))],cos:[tb,[tb],(v,[b])=>Math.cos(b.evaluate(v))],tan:[tb,[tb],(v,[b])=>Math.tan(b.evaluate(v))],asin:[tb,[tb],(v,[b])=>Math.asin(b.evaluate(v))],acos:[tb,[tb],(v,[b])=>Math.acos(b.evaluate(v))],atan:[tb,[tb],(v,[b])=>Math.atan(b.evaluate(v))],min:[tb,iS(tb),(v,b)=>Math.min(...b.map(b=>b.evaluate(v)))],max:[tb,iS(tb),(v,b)=>Math.max(...b.map(b=>b.evaluate(v)))],abs:[tb,[tb],(v,[b])=>Math.abs(b.evaluate(v))],round:[tb,[tb],(v,[b])=>{let y=b.evaluate(v);return y<0?-Math.round(-y):Math.round(y)}],floor:[tb,[tb],(v,[b])=>Math.floor(b.evaluate(v))],ceil:[tb,[tb],(v,[b])=>Math.ceil(b.evaluate(v))],"filter-==":[t_,[ty,tA],(v,[b,y])=>v.properties()[b.value]===y.value],"filter-id-==":[t_,[tA],(v,[b])=>v.id()===b.value],"filter-type-==":[t_,[ty],(v,[b])=>v.geometryType()===b.value],"filter-<":[t_,[ty,tA],(v,[b,y])=>{let _=v.properties()[b.value],x=y.value;return typeof _==typeof x&&_<x}],"filter-id-<":[t_,[tA],(v,[b])=>{let y=v.id(),_=b.value;return typeof y==typeof _&&y<_}],"filter->":[t_,[ty,tA],(v,[b,y])=>{let _=v.properties()[b.value],x=y.value;return typeof _==typeof x&&_>x}],"filter-id->":[t_,[tA],(v,[b])=>{let y=v.id(),_=b.value;return typeof y==typeof _&&y>_}],"filter-<=":[t_,[ty,tA],(v,[b,y])=>{let _=v.properties()[b.value],x=y.value;return typeof _==typeof x&&_<=x}],"filter-id-<=":[t_,[tA],(v,[b])=>{let y=v.id(),_=b.value;return typeof y==typeof _&&y<=_}],"filter->=":[t_,[ty,tA],(v,[b,y])=>{let _=v.properties()[b.value],x=y.value;return typeof _==typeof x&&_>=x}],"filter-id->=":[t_,[tA],(v,[b])=>{let y=v.id(),_=b.value;return typeof y==typeof _&&y>=_}],"filter-has":[t_,[tA],(v,[b])=>b.value in v.properties()],"filter-has-id":[t_,[],v=>null!==v.id()&&void 0!==v.id()],"filter-type-in":[t_,[tM(ty)],(v,[b])=>b.value.indexOf(v.geometryType())>=0],"filter-id-in":[t_,[tM(tA)],(v,[b])=>b.value.indexOf(v.id())>=0],"filter-in-small":[t_,[ty,tM(tA)],(v,[b,y])=>y.value.indexOf(v.properties()[b.value])>=0],"filter-in-large":[t_,[ty,tM(tA)],(v,[b,y])=>(function(v,b,y,_){for(;y<=_;){let x=y+_>>1;if(b[x]===v)return!0;b[x]>v?_=x-1:y=x+1}return!1})(v.properties()[b.value],y.value,0,y.value.length-1)],all:{type:t_,overloads:[[[t_,t_],(v,[b,y])=>b.evaluate(v)&&y.evaluate(v)],[iS(t_),(v,b)=>{for(let y of b)if(!y.evaluate(v))return!1;return!0}]]},any:{type:t_,overloads:[[[t_,t_],(v,[b,y])=>b.evaluate(v)||y.evaluate(v)],[iS(t_),(v,b)=>{for(let y of b)if(y.evaluate(v))return!0;return!1}]]},"!":[t_,[t_],(v,[b])=>!b.evaluate(v)],"is-supported-script":[t_,[ty],(v,[b])=>{let y=v.globals&&v.globals.isSupportedScript;return!y||y(b.evaluate(v))}],upcase:[ty,[ty],(v,[b])=>b.evaluate(v).toUpperCase()],downcase:[ty,[ty],(v,[b])=>b.evaluate(v).toLowerCase()],concat:[ty,iS(tA),(v,b)=>b.map(b=>nh(b.evaluate(v))).join("")],"resolved-locale":[ty,[tC],(v,[b])=>b.evaluate(v).resolvedLocale()]});class iH{constructor(v,b,y){this.expression=v,this._warningHistory={},this._evaluator=new ny,this._defaultValue=b?function(v){if("color"===v.type&&iz(v.default))return new t6(0,0,0,0);switch(v.type){case"color":return t6.parse(v.default)||null;case"padding":return nt.parse(v.default)||null;case"numberArray":return nn.parse(v.default)||null;case"colorArray":return ni.parse(v.default)||null;case"variableAnchorOffsetCollection":return na.parse(v.default)||null;case"projectionDefinition":return nl.parse(v.default)||null;default:return void 0===v.default?null:v.default}}(b):null,this._enumValues=b&&"enum"===b.type?b.values:null,this._globalState=y}evaluateWithoutErrorHandling(v,b,y,_,x,w){return this._globalState&&(v=iQ(v,this._globalState)),this._evaluator.globals=v,this._evaluator.feature=b,this._evaluator.featureState=y,this._evaluator.canonical=_,this._evaluator.availableImages=x||null,this._evaluator.formattedSection=w,this.expression.evaluate(this._evaluator)}evaluate(v,b,y,_,x,w){this._globalState&&(v=iQ(v,this._globalState)),this._evaluator.globals=v,this._evaluator.feature=b||null,this._evaluator.featureState=y||null,this._evaluator.canonical=_,this._evaluator.availableImages=x||null,this._evaluator.formattedSection=w||null;try{let v=this.expression.evaluate(this._evaluator);if(null==v||"number"==typeof v&&v!=v)return this._defaultValue;if(this._enumValues&&!(v in this._enumValues))throw new nr(`Expected value to be one of ${Object.keys(this._enumValues).map(v=>JSON.stringify(v)).join(", ")}, but found ${JSON.stringify(v)} instead.`);return v}catch(v){return this._warningHistory[v.message]||(this._warningHistory[v.message]=!0,"u">typeof console&&console.warn(v.message)),this._defaultValue}}}function iW(v){return Array.isArray(v)&&v.length>0&&"string"==typeof v[0]&&v[0]in ik}function iG(v,b,y){let _,x=new n_(ik,iT,[],b?(_={color:tx,string:ty,number:tb,enum:ty,boolean:t_,formatted:tE,padding:tS,numberArray:tO,colorArray:tT,projectionDefinition:tw,resolvedImage:tF,variableAnchorOffsetCollection:tI},"array"===b.type?tM(_[b.value]||tA,b.length):_[b.type]):void 0),w=x.parse(v,void 0,void 0,void 0,b&&"string"===b.type?{typeAnnotation:"coerce"}:void 0);return w?iM(new iH(w,b,y)):iR(x.errors)}class iY{constructor(v,b,y){this.kind=v,this._styleExpression=b,this.isStateDependent="constant"!==v&&!iF(b.expression),this.globalStateRefs=iJ(b.expression),this._globalState=y}evaluateWithoutErrorHandling(v,b,y,_,x,w){return this._globalState&&(v=iQ(v,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(v,b,y,_,x,w)}evaluate(v,b,y,_,x,w){return this._globalState&&(v=iQ(v,this._globalState)),this._styleExpression.evaluate(v,b,y,_,x,w)}}class iZ{constructor(v,b,y,_,x){this.kind=v,this.zoomStops=y,this._styleExpression=b,this.isStateDependent="camera"!==v&&!iF(b.expression),this.globalStateRefs=iJ(b.expression),this.interpolationType=_,this._globalState=x}evaluateWithoutErrorHandling(v,b,y,_,x,w){return this._globalState&&(v=iQ(v,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(v,b,y,_,x,w)}evaluate(v,b,y,_,x,w){return this._globalState&&(v=iQ(v,this._globalState)),this._styleExpression.evaluate(v,b,y,_,x,w)}interpolationFactor(v,b,y){return this.interpolationType?nM.interpolationFactor(this.interpolationType,v,b,y):0}}function iX(v,b,y){let _=iG(v,b,y);if("error"===_.result)return _;let x=_.value.expression,w=iO(x);if(!w&&!iD(b))return iR([new tm("","data expressions not supported")]);let k=iI(x,["zoom"]);if(!k&&!iP(b))return iR([new tm("","zoom expressions not supported")]);let A=function v(b){let y=null;if(b instanceof nx)y=v(b.result);else if(b instanceof nP){for(let _ of b.args)if(y=v(_))break}else(b instanceof nA||b instanceof nM)&&b.input instanceof iA&&"zoom"===b.input.name&&(y=b);return y instanceof tm||b.eachChild(b=>{let _=v(b);_ instanceof tm?y=_:!y&&_?y=new tm("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):y&&_&&y!==_&&(y=new tm("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),y}(x);return A||k?A instanceof tm?iR([A]):A instanceof nM&&!iL(b)?iR([new tm("",'"interpolate" expressions cannot be used with this property')]):iM(A?new iZ(w?"camera":"composite",_.value,A.labels,A instanceof nM?A.interpolation:void 0,y):new iY(w?"constant":"source",_.value,y)):iR([new tm("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class iK{constructor(v,b){this._parameters=v,this._specification=b,tf(this,function v(b,y){var _;let x,w,k=b.stops&&"object"==typeof b.stops[0][0],A=k||!(k||void 0!==b.property),C=b.type||(iL(y)?"exponential":"interval"),E=function(v){switch(v.type){case"color":return t6.parse;case"padding":return nt.parse;case"numberArray":return nn.parse;case"colorArray":return ni.parse;default:return null}}(y);if(E&&((b=tf({},b)).stops&&(b.stops=b.stops.map(v=>[v[0],E(v[1])])),b.default=E(b.default?b.default:y.default)),b.colorSpace&&"rgb"!==(_=b.colorSpace)&&"hcl"!==_&&"lab"!==_)throw Error(`Unknown color space: "${b.colorSpace}"`);let S=function(v){switch(v){case"exponential":return iV;case"interval":return iU;case"categorical":return i$;case"identity":return iq;default:throw Error(`Unknown function type "${v}"`)}}(C);if("categorical"===C){for(let v of(x=Object.create(null),b.stops))x[v[0]]=v[1];w=typeof b.stops[0][0]}if(k){let _={},x=[];for(let v=0;v<b.stops.length;v++){let y=b.stops[v],w=y[0].zoom;void 0===_[w]&&(_[w]={zoom:w,type:b.type,property:b.property,default:b.default,stops:[]},x.push(w)),_[w].stops.push([y[0].value,y[1]])}let w=[];for(let b of x)w.push([_[b].zoom,v(_[b],y)]);let k={name:"linear"};return{kind:"composite",interpolationType:k,interpolationFactor:nM.interpolationFactor.bind(void 0,k),zoomStops:w.map(v=>v[0]),evaluate:({zoom:v},_)=>iV({stops:w,base:b.base},y,v).evaluate(v,_)}}if(A){let v="exponential"===C?{name:"exponential",base:void 0!==b.base?b.base:1}:null;return{kind:"camera",interpolationType:v,interpolationFactor:nM.interpolationFactor.bind(void 0,v),zoomStops:b.stops.map(v=>v[0]),evaluate:({zoom:v})=>S(b,y,v,x,w)}}return{kind:"source",evaluate(v,_){let k=_&&_.properties?_.properties[b.property]:void 0;return void 0===k?iB(b.default,y.default):S(b,y,k,x,w)}}}(this._parameters,this._specification))}static deserialize(v){return new iK(v._parameters,v._specification)}static serialize(v){return{_parameters:v._parameters,_specification:v._specification}}}function iJ(v,b=new Set){return v instanceof iw&&b.add(v.key),v.eachChild(v=>{iJ(v,b)}),b}function iQ(v,b){let{zoom:y,heatmapDensity:_,elevation:x,lineProgress:w,isSupportedScript:k,accumulated:A}=null!=v?v:{};return{zoom:y,heatmapDensity:_,elevation:x,lineProgress:w,isSupportedScript:k,accumulated:A,globalState:b}}function i0(v){if(!0===v||!1===v)return!0;if(!Array.isArray(v)||0===v.length)return!1;switch(v[0]){case"has":return v.length>=2&&"$id"!==v[1]&&"$type"!==v[1];case"in":return v.length>=3&&("string"!=typeof v[1]||Array.isArray(v[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==v.length||Array.isArray(v[1])||Array.isArray(v[2]);case"any":case"all":for(let b of v.slice(1))if(!i0(b)&&"boolean"!=typeof b)return!1;return!0;default:return!0}}let i1={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function i2(v,b){if(null==v)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};i0(v)||(v=function v(b){if(!b)return!0;let y=b[0];return b.length<=1?"any"!==y:"=="===y?i3(b[1],b[2],"=="):"!="===y?i8(i3(b[1],b[2],"==")):"<"===y||">"===y||"<="===y||">="===y?i3(b[1],b[2],y):"any"===y?["any"].concat(b.slice(1).map(v)):"all"===y?["all"].concat(b.slice(1).map(v)):"none"===y?["all"].concat(b.slice(1).map(v).map(i8)):"in"===y?i4(b[1],b.slice(2)):"!in"===y?i8(i4(b[1],b.slice(2))):"has"===y?i6(b[1]):"!has"!==y||i8(i6(b[1]))}(v));let y=iG(v,i1,b);if("error"===y.result)throw Error(y.value.map(v=>`${v.key}: ${v.message}`).join(", "));return{filter:(v,b,_)=>y.value.evaluate(v,b,{},_),needGeometry:function v(b){if(!Array.isArray(b))return!1;if("within"===b[0]||"distance"===b[0])return!0;for(let y=1;y<b.length;y++)if(v(b[y]))return!0;return!1}(v),getGlobalStateRefs:()=>iJ(y.value.expression)}}function i5(v,b){return v<b?-1:+(v>b)}function i3(v,b,y){switch(v){case"$type":return[`filter-type-${y}`,b];case"$id":return[`filter-id-${y}`,b];default:return[`filter-${y}`,v,b]}}function i4(v,b){if(0===b.length)return!1;switch(v){case"$type":return["filter-type-in",["literal",b]];case"$id":return["filter-id-in",["literal",b]];default:return b.length>200&&!b.some(v=>typeof v!=typeof b[0])?["filter-in-large",v,["literal",b.sort(i5)]]:["filter-in-small",v,["literal",b]]}}function i6(v){switch(v){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",v]}}function i8(v){return["!",v]}function i7(v){let b=v.value;return b?[new tp(v.key,b,"constants have been deprecated as of v8")]:[]}function i9(v){return v instanceof Number||v instanceof String||v instanceof Boolean?v.valueOf():v}function re(v){if(Array.isArray(v))return v.map(re);if(v instanceof Object&&!(v instanceof Number||v instanceof String||v instanceof Boolean)){let b={};for(let y in v)b[y]=re(v[y]);return b}return i9(v)}function rt(v){let b=v.key,y=v.value,_=v.valueSpec||{},x=v.objectElementValidators||{},w=v.style,k=v.styleSpec,A=v.validateSpec,C=[],E=iN(y);if("object"!==E)return[new tp(b,y,`object expected, ${E} found`)];for(let v in y){let E,S=v.split(".")[0],T=tQ(_,S)||_["*"];if(tQ(x,S))E=x[S];else if(tQ(_,S)){if(void 0===y[v])continue;E=A}else if(x["*"])E=x["*"];else{if(!_["*"]){C.push(new tp(b,y[v],`unknown property "${v}"`));continue}E=A}C=C.concat(E({key:(b?`${b}.`:b)+v,value:y[v],valueSpec:T,style:w,styleSpec:k,object:y,objectKey:v,validateSpec:A},y))}for(let v in _)x[v]||_[v].required&&void 0===_[v].default&&void 0===y[v]&&C.push(new tp(b,y,`missing required property "${v}"`));return C}function rn(v){let b=v.value,y=v.valueSpec,_=v.style,x=v.styleSpec,w=v.key,k=v.arrayElementValidator||v.validateSpec;if("array"!==iN(b))return[new tp(w,b,`array expected, ${iN(b)} found`)];if(y.length&&b.length!==y.length)return[new tp(w,b,`array length ${y.length} expected, length ${b.length} found`)];let A={type:y.value,values:y.values};x.$version<7&&(A.function=y.function),"object"===iN(y.value)&&(A=y.value);let C=[];for(let y=0;y<b.length;y++)C=C.concat(k({array:b,arrayIndex:y,value:b[y],valueSpec:A,validateSpec:v.validateSpec,style:_,styleSpec:x,key:`${w}[${y}]`}));return C}function ri(v){let b=v.key,y=v.value,_=v.valueSpec,x=iN(y);return"number"===x&&y!=y&&(x="NaN"),"number"!==x?[new tp(b,y,`number expected, ${x} found`)]:"minimum"in _&&y<_.minimum?[new tp(b,y,`${y} is less than the minimum value ${_.minimum}`)]:"maximum"in _&&y>_.maximum?[new tp(b,y,`${y} is greater than the maximum value ${_.maximum}`)]:[]}function rr(v){let b=v.valueSpec,y=i9(v.value.type),_,x,w,k={},A="categorical"!==y&&void 0===v.value.property,C="array"===iN(v.value.stops)&&"array"===iN(v.value.stops[0])&&"object"===iN(v.value.stops[0][0]),E=rt({key:v.key,value:v.value,valueSpec:v.styleSpec.function,validateSpec:v.validateSpec,style:v.style,styleSpec:v.styleSpec,objectElementValidators:{stops:function(v){if("identity"===y)return[new tp(v.key,v.value,'identity function may not have a "stops" property')];let b=[],_=v.value;return b=b.concat(rn({key:v.key,value:_,valueSpec:v.valueSpec,validateSpec:v.validateSpec,style:v.style,styleSpec:v.styleSpec,arrayElementValidator:S})),"array"===iN(_)&&0===_.length&&b.push(new tp(v.key,_,"array must have at least one stop")),b},default:function(v){return v.validateSpec({key:v.key,value:v.value,valueSpec:b,validateSpec:v.validateSpec,style:v.style,styleSpec:v.styleSpec})}}});return"identity"===y&&A&&E.push(new tp(v.key,v.value,'missing required property "property"')),"identity"===y||v.value.stops||E.push(new tp(v.key,v.value,'missing required property "stops"')),"exponential"===y&&v.valueSpec.expression&&!iL(v.valueSpec)&&E.push(new tp(v.key,v.value,"exponential functions not supported")),v.styleSpec.$version>=8&&(A||iD(v.valueSpec)?A&&!iP(v.valueSpec)&&E.push(new tp(v.key,v.value,"zoom functions not supported")):E.push(new tp(v.key,v.value,"property functions not supported"))),("categorical"===y||C)&&void 0===v.value.property&&E.push(new tp(v.key,v.value,'"property" property is required')),E;function S(v){let y=[],_=v.value,A=v.key;if("array"!==iN(_))return[new tp(A,_,`array expected, ${iN(_)} found`)];if(2!==_.length)return[new tp(A,_,`array length 2 expected, length ${_.length} found`)];if(C){if("object"!==iN(_[0]))return[new tp(A,_,`object expected, ${iN(_[0])} found`)];if(void 0===_[0].zoom)return[new tp(A,_,"object stop key must have zoom")];if(void 0===_[0].value)return[new tp(A,_,"object stop key must have value")];if(w&&w>i9(_[0].zoom))return[new tp(A,_[0].zoom,"stop zoom values must appear in ascending order")];i9(_[0].zoom)!==w&&(w=i9(_[0].zoom),x=void 0,k={}),y=y.concat(rt({key:`${A}[0]`,value:_[0],valueSpec:{zoom:{}},validateSpec:v.validateSpec,style:v.style,styleSpec:v.styleSpec,objectElementValidators:{zoom:ri,value:T}}))}else y=y.concat(T({key:`${A}[0]`,value:_[0],validateSpec:v.validateSpec,style:v.style,styleSpec:v.styleSpec},_));return iW(re(_[1]))?y.concat([new tp(`${A}[1]`,_[1],"expressions are not allowed in function stops.")]):y.concat(v.validateSpec({key:`${A}[1]`,value:_[1],valueSpec:b,validateSpec:v.validateSpec,style:v.style,styleSpec:v.styleSpec}))}function T(v,w){let A=iN(v.value),C=i9(v.value),E=null!==v.value?v.value:w;if(_){if(A!==_)return[new tp(v.key,E,`${A} stop domain type must match previous stop domain type ${_}`)]}else _=A;if("number"!==A&&"string"!==A&&"boolean"!==A)return[new tp(v.key,E,"stop domain value must be a number, string, or boolean")];if("number"!==A&&"categorical"!==y){let _=`number expected, ${A} found`;return iD(b)&&void 0===y&&(_+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new tp(v.key,E,_)]}return"categorical"!==y||"number"!==A||isFinite(C)&&Math.floor(C)===C?"categorical"!==y&&"number"===A&&void 0!==x&&C<x?[new tp(v.key,E,"stop domain values must appear in ascending order")]:(x=C,"categorical"===y&&C in k?[new tp(v.key,E,"stop domain values must be unique")]:(k[C]=!0,[])):[new tp(v.key,E,`integer expected, found ${C}`)]}}function ro(v){let b=("property"===v.expressionContext?iX:iG)(re(v.value),v.valueSpec);if("error"===b.result)return b.value.map(b=>new tp(`${v.key}${b.key}`,v.value,b.message));let y=b.value.expression||b.value._styleExpression.expression;if("property"===v.expressionContext&&"text-font"===v.propertyKey&&!y.outputDefined())return[new tp(v.key,v.value,`Invalid data expression for "${v.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===v.expressionContext&&"layout"===v.propertyType&&!iF(y))return[new tp(v.key,v.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===v.expressionContext&&!iF(y))return[new tp(v.key,v.value,'"feature-state" data expressions are not supported with filters.')];if(v.expressionContext&&0===v.expressionContext.indexOf("cluster")){if(!iI(y,["zoom","feature-state"]))return[new tp(v.key,v.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===v.expressionContext&&!iO(y))return[new tp(v.key,v.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function ra(v){let b=v.key,y=v.value,_=iN(y);return"string"!==_?[new tp(b,y,`color expected, ${_} found`)]:t6.parse(String(y))?[]:[new tp(b,y,`color expected, "${y}" found`)]}function rs(v){let b=v.key,y=v.value,_=v.valueSpec,x=[];return Array.isArray(_.values)?-1===_.values.indexOf(i9(y))&&x.push(new tp(b,y,`expected one of [${_.values.join(", ")}], ${JSON.stringify(y)} found`)):-1===Object.keys(_.values).indexOf(i9(y))&&x.push(new tp(b,y,`expected one of [${Object.keys(_.values).join(", ")}], ${JSON.stringify(y)} found`)),x}function rl(v){return i0(re(v.value))?ro(tf({},v,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function v(b){let y=b.value,_=b.key;if("array"!==iN(y))return[new tp(_,y,`array expected, ${iN(y)} found`)];let x=b.styleSpec,w,k=[];if(y.length<1)return[new tp(_,y,"filter array must have at least 1 element")];switch(k=k.concat(rs({key:`${_}[0]`,value:y[0],valueSpec:x.filter_operator,style:b.style,styleSpec:b.styleSpec})),i9(y[0])){case"<":case"<=":case">":case">=":y.length>=2&&"$type"===i9(y[1])&&k.push(new tp(_,y,`"$type" cannot be use with operator "${y[0]}"`));case"==":case"!=":3!==y.length&&k.push(new tp(_,y,`filter array for operator "${y[0]}" must have 3 elements`));case"in":case"!in":y.length>=2&&"string"!==(w=iN(y[1]))&&k.push(new tp(`${_}[1]`,y[1],`string expected, ${w} found`));for(let v=2;v<y.length;v++)w=iN(y[v]),"$type"===i9(y[1])?k=k.concat(rs({key:`${_}[${v}]`,value:y[v],valueSpec:x.geometry_type,style:b.style,styleSpec:b.styleSpec})):"string"!==w&&"number"!==w&&"boolean"!==w&&k.push(new tp(`${_}[${v}]`,y[v],`string, number, or boolean expected, ${w} found`));break;case"any":case"all":case"none":for(let x=1;x<y.length;x++)k=k.concat(v({key:`${_}[${x}]`,value:y[x],style:b.style,styleSpec:b.styleSpec}));break;case"has":case"!has":w=iN(y[1]),2!==y.length?k.push(new tp(_,y,`filter array for "${y[0]}" operator must have 2 elements`)):"string"!==w&&k.push(new tp(`${_}[1]`,y[1],`string expected, ${w} found`))}return k}(v)}function rc(v,b){let y,_=v.key,x=v.validateSpec,w=v.style,k=v.styleSpec,A=v.value,C=v.objectKey,E=k[`${b}_${v.layerType}`];if(!E)return[];let S=C.match(/^(.*)-transition$/);if("paint"===b&&S&&E[S[1]]&&E[S[1]].transition)return x({key:_,value:A,valueSpec:k.transition,style:w,styleSpec:k});let T=v.valueSpec||E[C];if(!T)return[new tp(_,A,`unknown property "${C}"`)];if("string"===iN(A)&&iD(T)&&!T.tokens&&(y=/^{([^}]+)}$/.exec(A)))return[new tp(_,A,`"${C}" does not support interpolation syntax
|
|
6908
|
+
`}}(0,x.X)(ev);var eb=y(7027);function ey(v){return(ey=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)})(v)}function e_(){try{var v=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(v){}return(e_=function(){return!!v})()}function ex(v,b){return(ex=Object.setPrototypeOf||function(v,b){return v.__proto__=b,v})(v,b)}function ew(v){return v&&"u">typeof Symbol&&v.constructor===Symbol?"symbol":typeof v}function ek(v){var b=document.createElement("vaadin-menu-bar-item");return(0,_.XX)(v,b),b}var eA=function(v){if("function"!=typeof v&&null!==v)throw TypeError("Super expression must either be null or a function");function b(){var v,y;if(!(this instanceof b))throw TypeError("Cannot call a class as a function");return v=b,y=arguments,v=ey(v),function(v,b){if(b&&("object"===ew(b)||"function"==typeof b))return b;if(void 0===v)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return v}(this,e_()?Reflect.construct(v,y||[],ey(this).constructor):v.apply(this,y))}return b.prototype=Object.create(v&&v.prototype,{constructor:{value:b,writable:!0,configurable:!0}}),v&&ex(b,v),b}(ev);!function(v,b,y,_){var x,w=arguments.length,k=w<3?b:null===_?_=Object.getOwnPropertyDescriptor(b,y):_;if(("u"<typeof Reflect?"undefined":ew(Reflect))==="object"&&"function"==typeof Reflect.decorate)k=Reflect.decorate(v,b,y,_);else for(var A=v.length-1;A>=0;A--)(x=v[A])&&(k=(w<3?x(k):w>3?x(b,y,k):x(b,y))||k);w>3&&k&&Object.defineProperty(b,y,k)}([(0,eb.EM)("or-vaadin-menu-bar")],eA)},85746(v,b,y){"use strict";let _,x,w,k;y.d(b,{Ay:()=>r2,F0:()=>r1});var A,C,E,S,T={};function O(v,b){return function(){return v.apply(b,arguments)}}y.r(T),y.d(T,{hasBrowserEnv:()=>eG,hasStandardBrowserEnv:()=>eZ,hasStandardBrowserWebWorkerEnv:()=>eX,navigator:()=>eY,origin:()=>eK});let{toString:F}=Object.prototype,{getPrototypeOf:I}=Object,{iterator:M,toStringTag:R}=Symbol,D=(({hasOwnProperty:v})=>(b,y)=>v.call(b,y))(Object.prototype),P=(v,b)=>{let y=v,_=[];for(;null!=y&&y!==Object.prototype&&-1===_.indexOf(y);){if(_.push(y),D(y,b))return!0;y=I(y)}return!1},L=(_=Object.create(null),v=>{let b=F.call(v);return _[b]||(_[b]=b.slice(8,-1).toLowerCase())}),N=v=>(v=v.toLowerCase(),b=>L(b)===v),z=v=>b=>typeof b===v,{isArray:j}=Array,B=z("undefined");function U(v){return null!==v&&!B(v)&&null!==v.constructor&&!B(v.constructor)&&H(v.constructor.isBuffer)&&v.constructor.isBuffer(v)}let V=N("ArrayBuffer"),q=z("string"),H=z("function"),W=z("number"),G=v=>null!==v&&"object"==typeof v,Y=v=>{if(!G(v))return!1;let b=I(v);return(null===b||b===Object.prototype||null===I(b))&&!P(v,R)&&!P(v,M)},Z=N("Date"),X=N("File"),K=N("Blob"),J=N("FileList"),Q="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},ee=void 0!==Q.FormData?Q.FormData:void 0,et=N("URLSearchParams"),[en,ei,er,eo]=["ReadableStream","Request","Response","Headers"].map(N);function ea(v,b,{allOwnKeys:y=!1}={}){let _,x;if(null!=v)if("object"!=typeof v&&(v=[v]),j(v))for(_=0,x=v.length;_<x;_++)b.call(null,v[_],_,v);else{let x;if(U(v))return;let w=y?Object.getOwnPropertyNames(v):Object.keys(v),k=w.length;for(_=0;_<k;_++)x=w[_],b.call(null,v[x],x,v)}}function es(v,b){let y;if(U(v))return null;b=b.toLowerCase();let _=Object.keys(v),x=_.length;for(;x-- >0;)if(b===(y=_[x]).toLowerCase())return y;return null}let el="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,ec=v=>!B(v)&&v!==el,eu=(x="u">typeof Uint8Array&&I(Uint8Array),v=>x&&v instanceof x),ed=N("HTMLFormElement"),{propertyIsEnumerable:eh}=Object.prototype,ep=N("RegExp"),ef=(v,b)=>{let y=Object.getOwnPropertyDescriptors(v),_={};ea(y,(y,x)=>{let w;!1!==(w=b(y,x,v))&&(_[x]=w||y)}),Object.defineProperties(v,_)},em=N("AsyncFunction"),eg=(A="function"==typeof setImmediate,C=H(el.postMessage),A?setImmediate:C?(E=`axios@${Math.random()}`,S=[],el.addEventListener("message",({source:v,data:b})=>{v===el&&b===E&&S.length&&S.shift()()},!1),v=>{S.push(v),el.postMessage(E,"*")}):v=>setTimeout(v)),ev="u">typeof queueMicrotask?queueMicrotask.bind(el):"u">typeof process&&process.nextTick||eg,eb=v=>null!=v&&H(v[M]),ey={isArray:j,isArrayBuffer:V,isBuffer:U,isFormData:v=>{if(!v)return!1;if(ee&&v instanceof ee)return!0;let b=I(v);if(!b||b===Object.prototype||!H(v.append))return!1;let y=L(v);return"formdata"===y||"object"===y&&H(v.toString)&&"[object FormData]"===v.toString()},isArrayBufferView:function(v){let b;return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(v):v&&v.buffer&&V(v.buffer)},isString:q,isNumber:W,isBoolean:v=>!0===v||!1===v,isObject:G,isPlainObject:Y,isEmptyObject:v=>{if(!G(v)||U(v))return!1;try{return 0===Object.keys(v).length&&Object.getPrototypeOf(v)===Object.prototype}catch(v){return!1}},isReadableStream:en,isRequest:ei,isResponse:er,isHeaders:eo,isUndefined:B,isDate:Z,isFile:X,isReactNativeBlob:v=>!!(v&&void 0!==v.uri),isReactNative:v=>v&&void 0!==v.getParts,isBlob:K,isRegExp:ep,isFunction:H,isStream:v=>G(v)&&H(v.pipe),isURLSearchParams:et,isTypedArray:eu,isFileList:J,forEach:ea,merge:function v(...b){let{caseless:y,skipUndefined:_}=ec(this)&&this||{},x={},w=(b,w)=>{if("__proto__"===w||"constructor"===w||"prototype"===w)return;let k=y&&"string"==typeof w&&es(x,w)||w,A=D(x,k)?x[k]:void 0;Y(A)&&Y(b)?x[k]=v(A,b):Y(b)?x[k]=v({},b):j(b)?x[k]=b.slice():_&&B(b)||(x[k]=b)};for(let v=0,y=b.length;v<y;v++){let y=b[v];if(!y||U(y)||(ea(y,w),"object"!=typeof y||j(y)))continue;let _=Object.getOwnPropertySymbols(y);for(let v=0;v<_.length;v++){let b=_[v];eh.call(y,b)&&w(y[b],b)}}return x},extend:(v,b,y,{allOwnKeys:_}={})=>(ea(b,(b,_)=>{y&&H(b)?Object.defineProperty(v,_,{__proto__:null,value:O(b,y),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(v,_,{__proto__:null,value:b,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:_}),v),trim:v=>v.trim?v.trim():v.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:v=>(65279===v.charCodeAt(0)&&(v=v.slice(1)),v),inherits:(v,b,y,_)=>{v.prototype=Object.create(b.prototype,_),Object.defineProperty(v.prototype,"constructor",{__proto__:null,value:v,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(v,"super",{__proto__:null,value:b.prototype}),y&&Object.assign(v.prototype,y)},toFlatObject:(v,b,y,_)=>{let x,w,k,A={};if(b=b||{},null==v)return b;do{for(w=(x=Object.getOwnPropertyNames(v)).length;w-- >0;)k=x[w],(!_||_(k,v,b))&&!A[k]&&(b[k]=v[k],A[k]=!0);v=!1!==y&&I(v)}while(v&&(!y||y(v,b))&&v!==Object.prototype);return b},kindOf:L,kindOfTest:N,endsWith:(v,b,y)=>{v=String(v),(void 0===y||y>v.length)&&(y=v.length),y-=b.length;let _=v.indexOf(b,y);return -1!==_&&_===y},toArray:v=>{if(!v)return null;if(j(v))return v;let b=v.length;if(!W(b))return null;let y=Array(b);for(;b-- >0;)y[b]=v[b];return y},forEachEntry:(v,b)=>{let y,_=(v&&v[M]).call(v);for(;(y=_.next())&&!y.done;){let _=y.value;b.call(v,_[0],_[1])}},matchAll:(v,b)=>{let y,_=[];for(;null!==(y=v.exec(b));)_.push(y);return _},isHTMLForm:ed,hasOwnProperty:D,hasOwnProp:D,hasOwnInPrototypeChain:P,getSafeProp:(v,b)=>null!=v&&P(v,b)?v[b]:void 0,reduceDescriptors:ef,freezeMethods:v=>{ef(v,(b,y)=>{if(H(v)&&["arguments","caller","callee"].includes(y))return!1;if(H(v[y])){if(b.enumerable=!1,"writable"in b){b.writable=!1;return}b.set||(b.set=()=>{throw Error("Can not rewrite read-only method '"+y+"'")})}})},toObjectSet:(v,b)=>{let y={};return(j(v)?v:String(v).split(b)).forEach(v=>{y[v]=!0}),y},toCamelCase:v=>v.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(v,b,y){return b.toUpperCase()+y}),noop:()=>{},toFiniteNumber:(v,b)=>null!=v&&Number.isFinite(v*=1)?v:b,findKey:es,global:el,isContextDefined:ec,isSpecCompliantForm:function(v){return!!(v&&H(v.append)&&"FormData"===v[R]&&v[M])},toJSONObject:v=>{let b=new WeakSet,y=v=>{if(G(v)){if(b.has(v))return;if(U(v))return v;if(!("toJSON"in v)){b.add(v);let _=j(v)?[]:{};return ea(v,(v,b)=>{let x=y(v);B(x)||(_[b]=x)}),b.delete(v),_}}return v};return y(v)},isAsyncFn:em,isThenable:v=>v&&(G(v)||H(v))&&H(v.then)&&H(v.catch),setImmediate:eg,asap:ev,isIterable:eb,isSafeIterable:v=>null!=v&&P(v,M)&&eb(v)},e_=ey.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ex=RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),ew=RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function ek(v,b){return ey.isArray(v)?v.map(v=>ek(v,b)):function(v){let b=0,y=v.length;for(;b<y;){let y=v.charCodeAt(b);if(9!==y&&32!==y)break;b+=1}for(;y>b;){let b=v.charCodeAt(y-1);if(9!==b&&32!==b)break;y-=1}return 0===b&&y===v.length?v:v.slice(b,y)}(String(v).replace(b,""))}function eA(v){let b=Object.create(null);return ey.forEach(v.toJSON(),(v,y)=>{b[y]=ek(v,ew)}),b}let eC=Symbol("internals");function eE(v){return v&&String(v).trim().toLowerCase()}function eS(v){return!1===v||null==v?v:ey.isArray(v)?v.map(eS):ek(String(v),ex)}function eT(v,b,y,_,x){if(ey.isFunction(_))return _.call(this,b,y);if(x&&(b=y),ey.isString(b)){if(ey.isString(_))return -1!==b.indexOf(_);if(ey.isRegExp(_))return _.test(b)}}class eO{constructor(v){v&&this.set(v)}set(v,b,y){let _=this;function x(v,b,y){let x=eE(b);if(!x)return;let w=ey.findKey(_,x);w&&void 0!==_[w]&&!0!==y&&(void 0!==y||!1===_[w])||(_[w||b]=eS(v))}let w=(v,b)=>ey.forEach(v,(v,y)=>x(v,y,b));if(ey.isPlainObject(v)||v instanceof this.constructor)w(v,b);else{let _;if(ey.isString(v)&&(v=v.trim())&&(_=v,!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(_.trim()))){var k;let y,_,x,A;w((A={},(k=v)&&k.split("\n").forEach(function(v){x=v.indexOf(":"),y=v.substring(0,x).trim().toLowerCase(),_=v.substring(x+1).trim(),!y||A[y]&&e_[y]||("set-cookie"===y?A[y]?A[y].push(_):A[y]=[_]:A[y]=A[y]?A[y]+", "+_:_)}),A),b)}else if(ey.isObject(v)&&ey.isSafeIterable(v)){let y=Object.create(null),_,x;for(let b of v){if(!ey.isArray(b))throw TypeError("Object iterator must return a key-value pair");x=b[0],ey.hasOwnProp(y,x)?(_=y[x],y[x]=ey.isArray(_)?[..._,b[1]]:[_,b[1]]):y[x]=b[1]}w(y,b)}else null!=v&&x(b,v,y)}return this}get(v,b){if(v=eE(v)){let y=ey.findKey(this,v);if(y){let v=this[y];if(!b)return v;if(!0===b){let b,y=Object.create(null),_=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;b=_.exec(v);)y[b[1]]=b[2];return y}if(ey.isFunction(b))return b.call(this,v,y);if(ey.isRegExp(b))return b.exec(v);throw TypeError("parser must be boolean|regexp|function")}}}has(v,b){if(v=eE(v)){let y=ey.findKey(this,v);return!!(y&&void 0!==this[y]&&(!b||eT(this,this[y],y,b)))}return!1}delete(v,b){let y=this,_=!1;function x(v){if(v=eE(v)){let x=ey.findKey(y,v);x&&(!b||eT(y,y[x],x,b))&&(delete y[x],_=!0)}}return ey.isArray(v)?v.forEach(x):x(v),_}clear(v){let b=Object.keys(this),y=b.length,_=!1;for(;y--;){let x=b[y];(!v||eT(this,this[x],x,v,!0))&&(delete this[x],_=!0)}return _}normalize(v){let b=this,y={};return ey.forEach(this,(_,x)=>{let w=ey.findKey(y,x);if(w){b[w]=eS(_),delete b[x];return}let k=v?x.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(v,b,y)=>b.toUpperCase()+y):String(x).trim();k!==x&&delete b[x],b[k]=eS(_),y[k]=!0}),this}concat(...v){return this.constructor.concat(this,...v)}toJSON(v){let b=Object.create(null);return ey.forEach(this,(y,_)=>{null!=y&&!1!==y&&(b[_]=v&&ey.isArray(y)?y.join(", "):y)}),b}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([v,b])=>v+": "+b).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(v){return v instanceof this?v:new this(v)}static concat(v,...b){let y=new this(v);return b.forEach(v=>y.set(v)),y}static accessor(v){let b=(this[eC]=this[eC]={accessors:{}}).accessors,y=this.prototype;function _(v){let _=eE(v);if(!b[_]){let x;x=ey.toCamelCase(" "+v),["get","set","has"].forEach(b=>{Object.defineProperty(y,b+x,{__proto__:null,value:function(y,_,x){return this[b].call(this,v,y,_,x)},configurable:!0})}),b[_]=!0}}return ey.isArray(v)?v.forEach(_):_(v),this}}eO.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ey.reduceDescriptors(eO.prototype,({value:v},b)=>{let y=b[0].toUpperCase()+b.slice(1);return{get:()=>v,set(v){this[y]=v}}}),ey.freezeMethods(eO);class eF extends Error{static from(v,b,y,_,x,w){let k=new eF(v.message,b||v.code,y,_,x);return Object.defineProperty(k,"cause",{__proto__:null,value:v,writable:!0,enumerable:!1,configurable:!0}),k.name=v.name,null!=v.status&&null==k.status&&(k.status=v.status),w&&Object.assign(k,w),k}constructor(v,b,y,_,x){super(v),Object.defineProperty(this,"message",{__proto__:null,value:v,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,b&&(this.code=b),y&&(this.config=y),_&&(this.request=_),x&&(this.response=x,this.status=x.status)}toJSON(){let v,b,y,_=this.config,x=_&&ey.hasOwnProp(_,"redact")?_.redact:void 0,w=ey.isArray(x)&&x.length>0?(v=new Set(x.map(v=>String(v).toLowerCase())),b=[],(y=_=>{let x;if(null===_||"object"!=typeof _||ey.isBuffer(_))return _;if(-1===b.indexOf(_)){if(_ instanceof eO&&(_=_.toJSON()),b.push(_),ey.isArray(_))x=[],_.forEach((v,b)=>{let _=y(v);ey.isUndefined(_)||(x[b]=_)});else{if(!ey.isPlainObject(_)&&function(v){if(ey.hasOwnProp(v,"toJSON"))return!0;let b=Object.getPrototypeOf(v);for(;b&&b!==Object.prototype;){if(ey.hasOwnProp(b,"toJSON"))return!0;b=Object.getPrototypeOf(b)}return!1}(_))return b.pop(),_;for(let[b,w]of(x=Object.create(null),Object.entries(_))){let _=v.has(b.toLowerCase())?"[REDACTED ****]":y(w);ey.isUndefined(_)||(x[b]=_)}}return b.pop(),x}})(_)):ey.toJSONObject(_);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:w,code:this.code,status:this.status}}}eF.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",eF.ERR_BAD_OPTION="ERR_BAD_OPTION",eF.ECONNABORTED="ECONNABORTED",eF.ETIMEDOUT="ETIMEDOUT",eF.ECONNREFUSED="ECONNREFUSED",eF.ERR_NETWORK="ERR_NETWORK",eF.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",eF.ERR_DEPRECATED="ERR_DEPRECATED",eF.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",eF.ERR_BAD_REQUEST="ERR_BAD_REQUEST",eF.ERR_CANCELED="ERR_CANCELED",eF.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",eF.ERR_INVALID_URL="ERR_INVALID_URL",eF.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";let eI=eF;function eM(v){return ey.isPlainObject(v)||ey.isArray(v)}function eR(v){return ey.endsWith(v,"[]")?v.slice(0,-2):v}function eD(v,b,y){return v?v.concat(b).map(function(v,b){return v=eR(v),!y&&b?"["+v+"]":v}).join(y?".":""):b}let eP=ey.toFlatObject(ey,{},null,function(v){return/^is[A-Z]/.test(v)}),eL=function(v,b,y){if(!ey.isObject(v))throw TypeError("target must be an object");b=b||new FormData;let _=(y=ey.toFlatObject(y,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,b){return!ey.isUndefined(b[v])})).metaTokens,x=y.visitor||F,w=y.dots,k=y.indexes,A=y.Blob||"u">typeof Blob&&Blob,C=void 0===y.maxDepth?100:y.maxDepth,E=A&&ey.isSpecCompliantForm(b),S=[];if(!ey.isFunction(x))throw TypeError("visitor must be a function");function T(v){if(null===v)return"";if(ey.isDate(v))return v.toISOString();if(ey.isBoolean(v))return v.toString();if(!E&&ey.isBlob(v))throw new eI("Blob is not supported. Use a Buffer instead.");if(ey.isArrayBuffer(v)||ey.isTypedArray(v)){if(E&&"function"==typeof A)return new A([v]);if("u">typeof Buffer)return Buffer.from(v);throw new eI("Blob is not supported. Use a Buffer instead.",eI.ERR_NOT_SUPPORT)}return v}function O(v){if(v>C)throw new eI("Object is too deeply nested ("+v+" levels). Max depth: "+C,eI.ERR_FORM_DATA_DEPTH_EXCEEDED)}function F(v,y,x){let A=v;if(ey.isReactNative(b)&&ey.isReactNativeBlob(v))return b.append(eD(x,y,w),T(v)),!1;if(v&&!x&&"object"==typeof v)if(ey.endsWith(y,"{}"))y=_?y:y.slice(0,-2),v=function(v){if(1/0===C)return JSON.stringify(v);let b=[];return JSON.stringify(v,function(v,y){if(!ey.isObject(y))return y;for(;b.length&&b[b.length-1]!==this;)b.pop();return b.push(y),O(1+b.length-1),y})}(v);else{var E;if(ey.isArray(v)&&(E=v,ey.isArray(E)&&!E.some(eM))||(ey.isFileList(v)||ey.endsWith(y,"[]"))&&(A=ey.toArray(v)))return y=eR(y),A.forEach(function(v,_){ey.isUndefined(v)||null===v||b.append(!0===k?eD([y],_,w):null===k?y:y+"[]",T(v))}),!1}return!!eM(v)||(b.append(eD(x,y,w),T(v)),!1)}let I=Object.assign(eP,{defaultVisitor:F,convertValue:T,isVisitable:eM});if(!ey.isObject(v))throw TypeError("data must be an object");return!function v(y,_,w=0){if(!ey.isUndefined(y)){if(O(w),-1!==S.indexOf(y))throw Error("Circular reference detected in "+_.join("."));S.push(y),ey.forEach(y,function(y,k){!0===(!(ey.isUndefined(y)||null===y)&&x.call(b,y,ey.isString(k)?k.trim():k,_,I))&&v(y,_?_.concat(k):[k],w+1)}),S.pop()}}(v),b};function eN(v){let b={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(v).replace(/[!'()~]|%20/g,function(v){return b[v]})}function ez(v,b){this._pairs=[],v&&eL(v,this,b)}let ej=ez.prototype;function eB(v){return encodeURIComponent(v).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function e$(v,b,y){let _;if(!b)return v;v=v||"";let x=ey.isFunction(y)?{serialize:y}:y,w=ey.getSafeProp(x,"encode")||eB,k=ey.getSafeProp(x,"serialize");if(_=k?k(b,x):ey.isURLSearchParams(b)?b.toString():new ez(b,x).toString(w)){let b=v.indexOf("#");-1!==b&&(v=v.slice(0,b)),v+=(-1===v.indexOf("?")?"?":"&")+_}return v}ej.append=function(v,b){this._pairs.push([v,b])},ej.toString=function(v){let b=v?b=>v.call(this,b,eN):eN;return this._pairs.map(function(v){return b(v[0])+"="+b(v[1])},"").join("&")};let eU=class{constructor(){this.handlers=[]}use(v,b,y){return this.handlers.push({fulfilled:v,rejected:b,synchronous:!!y&&y.synchronous,runWhen:y?y.runWhen:null}),this.handlers.length-1}eject(v){this.handlers[v]&&(this.handlers[v]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(v){ey.forEach(this.handlers,function(b){null!==b&&v(b)})}},eV={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},eq="u">typeof URLSearchParams?URLSearchParams:ez,eH="u">typeof FormData?FormData:null,eW="u">typeof Blob?Blob:null,eG="u">typeof window&&"u">typeof document,eY="object"==typeof navigator&&navigator||void 0,eZ=eG&&(!eY||0>["ReactNative","NativeScript","NS"].indexOf(eY.product)),eX="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,eK=eG&&window.location.href||"http://localhost",eJ={...T,isBrowser:!0,classes:{URLSearchParams:eq,FormData:eH,Blob:eW},protocols:["http","https","file","blob","url","data"]};function eQ(v){if(v>100)throw new eI("FormData field is too deeply nested ("+v+" levels). Max depth: 100",eI.ERR_FORM_DATA_DEPTH_EXCEEDED)}let e0=function(v){if(ey.isFormData(v)&&ey.isFunction(v.entries)){let b={};return ey.forEachEntry(v,(v,y)=>{!function v(b,y,_,x){eQ(x);let w=b[x++];if("__proto__"===w)return!0;let k=Number.isFinite(+w),A=x>=b.length;return(w=!w&&ey.isArray(_)?_.length:w,A)?ey.hasOwnProp(_,w)?_[w]=ey.isArray(_[w])?_[w].concat(y):[_[w],y]:_[w]=y:(ey.hasOwnProp(_,w)&&ey.isObject(_[w])||(_[w]=[]),v(b,y,_[w],x)&&ey.isArray(_[w])&&(_[w]=function(v){let b,y,_={},x=Object.keys(v),w=x.length;for(b=0;b<w;b++)_[y=x[b]]=v[y];return _}(_[w]))),!k}(function(v){let b,y=[],_=/\w+|\[(\w*)]/g;for(;null!==(b=_.exec(v));)eQ(y.length),y.push("[]"===b[0]?"":b[1]||b[0]);return y}(v),y,b,0)}),b}return null},e1=(v,b)=>null!=v&&ey.hasOwnProp(v,b)?v[b]:void 0,e2={transitional:eV,adapter:["xhr","http","fetch"],transformRequest:[function(v,b){let y,_=b.getContentType()||"",x=_.indexOf("application/json")>-1,w=ey.isObject(v);if(w&&ey.isHTMLForm(v)&&(v=new FormData(v)),ey.isFormData(v))return x?JSON.stringify(e0(v)):v;if(ey.isArrayBuffer(v)||ey.isBuffer(v)||ey.isStream(v)||ey.isFile(v)||ey.isBlob(v)||ey.isReadableStream(v))return v;if(ey.isArrayBufferView(v))return v.buffer;if(ey.isURLSearchParams(v))return b.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),v.toString();if(w){let b=e1(this,"formSerializer");if(_.indexOf("application/x-www-form-urlencoded")>-1)return eL(v,new eJ.classes.URLSearchParams,{visitor:function(v,b,y,_){return eJ.isNode&&ey.isBuffer(v)?(this.append(b,v.toString("base64")),!1):_.defaultVisitor.apply(this,arguments)},...b}).toString();if((y=ey.isFileList(v))||_.indexOf("multipart/form-data")>-1){let _=e1(this,"env"),x=_&&_.FormData;return eL(y?{"files[]":v}:v,x&&new x,b)}}if(w||x){b.setContentType("application/json",!1);var k=v;if(ey.isString(k))try{return(0,JSON.parse)(k),ey.trim(k)}catch(v){if("SyntaxError"!==v.name)throw v}return(0,JSON.stringify)(k)}return v}],transformResponse:[function(v){let b=e1(this,"transitional")||e2.transitional,y=b&&b.forcedJSONParsing,_=e1(this,"responseType"),x="json"===_;if(ey.isResponse(v)||ey.isReadableStream(v))return v;if(v&&ey.isString(v)&&(y&&!_||x)){let y=b&&b.silentJSONParsing;try{return JSON.parse(v,e1(this,"parseReviver"))}catch(v){if(!y&&x){if("SyntaxError"===v.name)throw eI.from(v,eI.ERR_BAD_RESPONSE,this,null,e1(this,"response"));throw v}}}return v}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:eJ.classes.FormData,Blob:eJ.classes.Blob},validateStatus:function(v){return v>=200&&v<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function e5(v,b){let y=this||e2,_=b||y,x=eO.from(_.headers),w=_.data;return ey.forEach(v,function(v){w=v.call(y,w,x.normalize(),b?b.status:void 0)}),x.normalize(),w}function e3(v){return!!(v&&v.__CANCEL__)}ey.forEach(["delete","get","head","post","put","patch","query"],v=>{e2.headers[v]={}});let e4=class extends eI{constructor(v,b,y){super(null==v?"canceled":v,eI.ERR_CANCELED,b,y),this.name="CanceledError",this.__CANCEL__=!0}};function e6(v,b,y){let _=y.config.validateStatus;!y.status||!_||_(y.status)?v(y):b(new eI("Request failed with status code "+y.status,y.status>=400&&y.status<500?eI.ERR_BAD_REQUEST:eI.ERR_BAD_RESPONSE,y.config,y.request,y))}let e8=function(v,b){let y,_=Array(v=v||10),x=Array(v),w=0,k=0;return b=void 0!==b?b:1e3,function(A){let C=Date.now(),E=x[k];y||(y=C),_[w]=A,x[w]=C;let S=k,T=0;for(;S!==w;)T+=_[S++],S%=v;if((w=(w+1)%v)===k&&(k=(k+1)%v),C-y<b)return;let O=E&&C-E;return O?Math.round(1e3*T/O):void 0}},e7=function(v,b){let y,_,x=0,w=1e3/b,k=(b,w=Date.now())=>{x=w,y=null,_&&(clearTimeout(_),_=null),v(...b)};return[(...v)=>{let b=Date.now(),A=b-x;A>=w?k(v,b):(y=v,_||(_=setTimeout(()=>{_=null,k(y)},w-A)))},()=>y&&k(y)]},e9=(v,b,y=3)=>{let _=0,x=e8(50,250);return e7(y=>{if(!y||"number"!=typeof y.loaded)return;let w=y.loaded,k=y.lengthComputable?y.total:void 0,A=null!=k?Math.min(w,k):w,C=Math.max(0,A-_),E=x(C);_=Math.max(_,A),v({loaded:A,total:k,progress:k?A/k:void 0,bytes:C,rate:E||void 0,estimated:E&&k?(k-A)/E:void 0,event:y,lengthComputable:null!=k,[b?"download":"upload"]:!0})},y)},te=(v,b)=>{let y=null!=v;return[_=>b[0]({lengthComputable:y,total:v,loaded:_}),b[1]]},tt=v=>(...b)=>ey.asap(()=>v(...b)),tn=eJ.hasStandardBrowserEnv?(w=new URL(eJ.origin),k=eJ.navigator&&/(msie|trident)/i.test(eJ.navigator.userAgent),v=>(v=new URL(v,eJ.origin),w.protocol===v.protocol&&w.host===v.host&&(k||w.port===v.port))):()=>!0,ti=eJ.hasStandardBrowserEnv?{write(v,b,y,_,x,w,k){if("u"<typeof document)return;let A=[`${v}=${encodeURIComponent(b)}`];ey.isNumber(y)&&A.push(`expires=${new Date(y).toUTCString()}`),ey.isString(_)&&A.push(`path=${_}`),ey.isString(x)&&A.push(`domain=${x}`),!0===w&&A.push("secure"),ey.isString(k)&&A.push(`SameSite=${k}`),document.cookie=A.join("; ")},read(v){if("u"<typeof document)return null;let b=document.cookie.split(";");for(let y=0;y<b.length;y++){let _=b[y].replace(/^\s+/,""),x=_.indexOf("=");if(-1!==x&&_.slice(0,x)===v)try{return decodeURIComponent(_.slice(x+1))}catch(v){return _.slice(x+1)}}return null},remove(v){this.write(v,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}},tr=/^https?:(?!\/\/)/i,to=/[\t\n\r]/g;function ta(v,b){if("string"==typeof v&&tr.test((function(v){let b=0;for(;b<v.length&&32>=v.charCodeAt(b);)b++;return v.slice(b)})(v).replace(to,"")))throw new eI('Invalid URL: missing "//" after protocol',eI.ERR_INVALID_URL,b)}function ts(v,b,y,_){ta(b,_);let x=!("string"==typeof b&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(b));return v&&(x||!1===y)?(ta(v,_),b?v.replace(/\/?\/$/,"")+"/"+b.replace(/^\/+/,""):v):b}let tl=v=>v instanceof eO?{...v}:v;function tc(v,b){v=v||{},b=b||{};let y=Object.create(null);function _(v,b,y,_){return ey.isPlainObject(v)&&ey.isPlainObject(b)?ey.merge.call({caseless:_},v,b):ey.isPlainObject(b)?ey.merge({},b):ey.isArray(b)?b.slice():b}function x(v,b,y,x){return ey.isUndefined(b)?ey.isUndefined(v)?void 0:_(void 0,v,y,x):_(v,b,y,x)}function w(v,b){if(!ey.isUndefined(b))return _(void 0,b)}function k(v,b){return ey.isUndefined(b)?ey.isUndefined(v)?void 0:_(void 0,v):_(void 0,b)}function A(y,x,w){return ey.hasOwnProp(b,w)?_(y,x):ey.hasOwnProp(v,w)?_(void 0,y):void 0}Object.defineProperty(y,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});let C={url:w,method:w,data:w,baseURL:k,transformRequest:k,transformResponse:k,paramsSerializer:k,timeout:k,timeoutMessage:k,withCredentials:k,withXSRFToken:k,adapter:k,responseType:k,xsrfCookieName:k,xsrfHeaderName:k,onUploadProgress:k,onDownloadProgress:k,decompress:k,maxContentLength:k,maxBodyLength:k,beforeRedirect:k,transport:k,httpAgent:k,httpsAgent:k,cancelToken:k,socketPath:k,allowedSocketPaths:k,responseEncoding:k,validateStatus:A,headers:(v,b,y)=>x(tl(v),tl(b),y,!0)};return ey.forEach(Object.keys({...v,...b}),function(_){if("__proto__"===_||"constructor"===_||"prototype"===_)return;let w=ey.hasOwnProp(C,_)?C[_]:x,k=w(ey.hasOwnProp(v,_)?v[_]:void 0,ey.hasOwnProp(b,_)?b[_]:void 0,_);ey.isUndefined(k)&&w!==A||(y[_]=k)}),ey.hasOwnProp(b,"validateStatus")&&ey.isUndefined(b.validateStatus)&&!1===function(y){let _=ey.hasOwnProp(b,"transitional")?b.transitional:void 0;if(!ey.isUndefined(_)){if(!ey.isPlainObject(_))return;else if(ey.hasOwnProp(_,y))return _[y]}let x=ey.hasOwnProp(v,"transitional")?v.transitional:void 0;if(ey.isPlainObject(x)&&ey.hasOwnProp(x,y))return x[y]}("validateStatusUndefinedResolves")&&(ey.hasOwnProp(v,"validateStatus")?y.validateStatus=_(void 0,v.validateStatus):delete y.validateStatus),y}let tu=["content-type","content-length"],td=function(v){let b=tc({},v),y=v=>ey.hasOwnProp(b,v)?b[v]:void 0,_=y("data"),x=y("withXSRFToken"),w=y("xsrfHeaderName"),k=y("xsrfCookieName"),A=y("headers"),C=y("auth"),E=y("baseURL"),S=y("allowAbsoluteUrls"),T=y("url");if(b.headers=A=eO.from(A),b.url=e$(ts(E,T,S,b),y("params"),y("paramsSerializer")),C){let b=ey.getSafeProp(C,"username")||"",y=ey.getSafeProp(C,"password")||"";try{A.set("Authorization","Basic "+btoa(b+":"+(y?encodeURIComponent(y).replace(/%([0-9A-F]{2})/gi,(v,b)=>String.fromCharCode(parseInt(b,16))):"")))}catch(b){throw eI.from(b,eI.ERR_BAD_OPTION_VALUE,v)}}if(ey.isFormData(_))if(eJ.hasStandardBrowserEnv||eJ.hasStandardBrowserWebWorkerEnv||ey.isReactNative(_))A.setContentType(void 0);else{var O,F;ey.isFunction(_.getHeaders)&&(O=A,F=_.getHeaders(),"content-only"!==y("formDataHeaderPolicy")?O.set(F):Object.entries(F||{}).forEach(([v,b])=>{tu.includes(v.toLowerCase())&&O.set(v,b)}))}if(eJ.hasStandardBrowserEnv&&(ey.isFunction(x)&&(x=x(b)),!0===x||null==x&&tn(b.url))){let v=w&&k&&ti.read(k);v&&A.set(w,v)}return b},th="u">typeof XMLHttpRequest&&function(v){return new Promise(function(b,y){var _;let x,w,k,A,C,E,S=td(v),T=S.data,O=eO.from(S.headers).normalize(),{responseType:F,onUploadProgress:I,onDownloadProgress:M}=S;function R(){A&&A(),C&&C(),S.cancelToken&&S.cancelToken.unsubscribe(x),S.signal&&S.signal.removeEventListener("abort",x)}let D=new XMLHttpRequest;function P(){if(!D)return;let _=eO.from("getAllResponseHeaders"in D&&D.getAllResponseHeaders());e6(function(v){b(v),R()},function(v){y(v),R()},{data:F&&"text"!==F&&"json"!==F?D.response:D.responseText,status:D.status,statusText:D.statusText,headers:_,config:v,request:D}),D=null}D.open(S.method.toUpperCase(),S.url,!0),D.timeout=S.timeout,"onloadend"in D?D.onloadend=P:D.onreadystatechange=function(){!D||4!==D.readyState||(0!==D.status||D.responseURL&&D.responseURL.startsWith("file:"))&&setTimeout(P)},D.onabort=function(){D&&(y(new eI("Request aborted",eI.ECONNABORTED,v,D)),R(),D=null)},D.onerror=function(b){let _=new eI(b&&b.message?b.message:"Network Error",eI.ERR_NETWORK,v,D);_.event=b||null,y(_),R(),D=null},D.ontimeout=function(){let b=S.timeout?"timeout of "+S.timeout+"ms exceeded":"timeout exceeded",_=S.transitional||eV;S.timeoutErrorMessage&&(b=S.timeoutErrorMessage),y(new eI(b,_.clarifyTimeoutError?eI.ETIMEDOUT:eI.ECONNABORTED,v,D)),R(),D=null},void 0===T&&O.setContentType(null),"setRequestHeader"in D&&ey.forEach(eA(O),function(v,b){D.setRequestHeader(b,v)}),ey.isUndefined(S.withCredentials)||(D.withCredentials=!!S.withCredentials),F&&"json"!==F&&(D.responseType=S.responseType),M&&([k,C]=e9(M,!0),D.addEventListener("progress",k)),I&&D.upload&&([w,A]=e9(I),D.upload.addEventListener("progress",w),D.upload.addEventListener("loadend",A)),(S.cancelToken||S.signal)&&(x=b=>{D&&(y(!b||b.type?new e4(null,v,D):b),D.abort(),R(),D=null)},S.cancelToken&&S.cancelToken.subscribe(x),S.signal&&(S.signal.aborted?x():S.signal.addEventListener("abort",x)));let L=(_=S.url,(E=/^([-+\w]{1,25}):(?:\/\/)?/.exec(_))&&E[1]||"");if(L&&!eJ.protocols.includes(L)){y(new eI("Unsupported protocol "+L+":",eI.ERR_BAD_REQUEST,v)),R();return}D.send(T||null)})},tp=function*(v,b){let y,_=v.byteLength;if(!b||_<b)return void(yield v);let x=0;for(;x<_;)y=x+b,yield v.slice(x,y),x=y},tf=async function*(v,b){for await(let y of tm(v))yield*tp(y,b)},tm=async function*(v){if(v[Symbol.asyncIterator])return void(yield*v);let b=v.getReader();try{for(;;){let{done:v,value:y}=await b.read();if(v)break;yield y}}finally{await b.cancel()}},tg=(v,b,y,_)=>{let x,w=tf(v,b),k=0,A=v=>{!x&&(x=!0,_&&_(v))};return new ReadableStream({async pull(v){try{let{done:b,value:_}=await w.next();if(b){A(),v.close();return}let x=_.byteLength;if(y){let v=k+=x;y(v)}v.enqueue(new Uint8Array(_))}catch(v){throw A(v),v}},cancel:v=>(A(v),w.return())},{highWaterMark:2})},tv=v=>v>=48&&v<=57||v>=65&&v<=70||v>=97&&v<=102,tb=(v,b,y)=>b+2<y&&tv(v.charCodeAt(b+1))&&tv(v.charCodeAt(b+2)),{isFunction:ty}=ey,t_=v=>{if(!ey.isString(v))return v;try{return decodeURIComponent(v)}catch(b){return v}},tx=(v,...b)=>{try{return!!v(...b)}catch(v){return!1}},tw=v=>{let b,y=void 0!==ey.global&&null!==ey.global?ey.global:globalThis,{ReadableStream:_,TextEncoder:x}=y,{fetch:w,Request:k,Response:A}=v=ey.merge.call({skipUndefined:!0},{Request:y.Request,Response:y.Response},v),C=w?ty(w):"function"==typeof fetch,E=ty(k),S=ty(A);if(!C)return!1;let T=C&&ty(_),O=C&&("function"==typeof x?(b=new x,v=>b.encode(v)):async v=>new Uint8Array(await new k(v).arrayBuffer())),F=E&&T&&tx(()=>{let v=!1,b=new k(eJ.origin,{body:new _,method:"POST",get duplex(){return v=!0,"half"}}),y=b.headers.has("Content-Type");return null!=b.body&&b.body.cancel(),v&&!y}),I=S&&T&&tx(()=>ey.isReadableStream(new A("").body)),M={stream:I&&(v=>v.body)};C&&["text","arrayBuffer","blob","formData","stream"].forEach(v=>{M[v]||(M[v]=(b,y)=>{let _=b&&b[v];if(_)return _.call(b);throw new eI(`Response type '${v}' is not supported`,eI.ERR_NOT_SUPPORT,y)})});let R=async v=>{if(null==v)return 0;if(ey.isBlob(v))return v.size;if(ey.isSpecCompliantForm(v)){let b=new k(eJ.origin,{method:"POST",body:v});return(await b.arrayBuffer()).byteLength}return ey.isArrayBufferView(v)||ey.isArrayBuffer(v)?v.byteLength:(ey.isURLSearchParams(v)&&(v+=""),ey.isString(v))?(await O(v)).byteLength:void 0},D=async(v,b)=>{let y=ey.toFiniteNumber(v.getContentLength());return null==y?R(b):y};return async v=>{let b,{url:y,method:_,data:C,signal:S,cancelToken:O,timeout:P,onDownloadProgress:L,onUploadProgress:N,responseType:z,headers:j,withCredentials:B="same-origin",fetchOptions:U,maxContentLength:V,maxBodyLength:q}=td(v),H=ey.isNumber(V)&&V>-1,W=ey.isNumber(q)&&q>-1,G=w||fetch;z=z?(z+"").toLowerCase():"text";let Y=((v,b)=>{if(v=v?v.filter(Boolean):[],!b&&!v.length)return;let y=new AbortController,_=!1,x=function(v){if(!_){_=!0,k();let b=v instanceof Error?v:this.reason;y.abort(b instanceof eI?b:new e4(b instanceof Error?b.message:b))}},w=b&&setTimeout(()=>{w=null,x(new eI(`timeout of ${b}ms exceeded`,eI.ETIMEDOUT))},b),k=()=>{v&&(w&&clearTimeout(w),w=null,v.forEach(v=>{v.unsubscribe?v.unsubscribe(x):v.removeEventListener("abort",x)}),v=null)};v.forEach(v=>v.addEventListener("abort",x,{once:!0}));let{signal:A}=y;return A.unsubscribe=()=>ey.asap(k),A})([S,O&&O.toAbortSignal()],P),Z=null,X=Y&&Y.unsubscribe&&(()=>{Y.unsubscribe()}),K=null,J=()=>new eI("Request body larger than maxBodyLength limit",eI.ERR_BAD_REQUEST,v,Z);try{var Q;let w,S,O,P,ee=(S="auth",ey.hasOwnProp(v,S)?v[S]:void 0);if(ee){let v=ey.getSafeProp(ee,"username")||"",b=ey.getSafeProp(ee,"password")||"";w={username:v,password:b}}if(O=(Q=y).indexOf("://"),P=Q,-1!==O&&(P=P.slice(O+3)),P.includes("@")||P.includes(":")){let v=new URL(y,eJ.origin);if(!w&&(v.username||v.password)){let b=t_(v.username),y=t_(v.password);w={username:b,password:y}}(v.username||v.password)&&(v.username="",v.password="",y=v.href)}if(w){let v;j.delete("authorization"),j.set("Authorization","Basic "+btoa((v=(w.username||"")+":"+(w.password||""),encodeURIComponent(v).replace(/%([0-9A-F]{2})/gi,(v,b)=>String.fromCharCode(parseInt(b,16))))))}if(H&&"string"==typeof y&&y.startsWith("data:")&&function(v){if(!v||"string"!=typeof v||!v.startsWith("data:"))return 0;let b=v.indexOf(",");if(b<0)return 0;let y=v.slice(5,b),_=v.slice(b+1);if(/;base64/i.test(y)){let v=_.length,b=_.length;for(let y=0;y<b;y++)if(37===_.charCodeAt(y)&&y+2<b){let b=_.charCodeAt(y+1),x=_.charCodeAt(y+2);tv(b)&&tv(x)&&(v-=2,y+=2)}let y=0,x=b-1,w=v=>v>=2&&37===_.charCodeAt(v-2)&&51===_.charCodeAt(v-1)&&(68===_.charCodeAt(v)||100===_.charCodeAt(v));x>=0&&(61===_.charCodeAt(x)?(y++,x--):w(x)&&(y++,x-=3)),1===y&&x>=0&&(61===_.charCodeAt(x)?y++:w(x)&&y++);let k=3*Math.floor(v/4)-(y||0);return k>0?k:0}let x=0;for(let v=0,b=_.length;v<b;v++){let y=_.charCodeAt(v);if(37===y&&tb(_,v,b))x+=1,v+=2;else if(y<128)x+=1;else if(y<2048)x+=2;else if(y>=55296&&y<=56319&&v+1<b){let b=_.charCodeAt(v+1);b>=56320&&b<=57343?(x+=4,v++):x+=3}else x+=3}return x}(y)>V)throw new eI("maxContentLength size of "+V+" exceeded",eI.ERR_BAD_RESPONSE,v,Z);if(W&&"get"!==_&&"head"!==_){let v=await R(C);if("number"==typeof v&&isFinite(v)&&(b=v,v>q))throw J()}let et=W&&(ey.isReadableStream(C)||ey.isStream(C)),en=(v,b,y)=>tg(v,65536,v=>{if(W&&v>q)throw K=J();b&&b(v)},y);if(F&&"get"!==_&&"head"!==_&&(N||et)){if(b=null==b?await D(j,C):b,0!==b||et){let v,_=new k(y,{method:"POST",body:C,duplex:"half"});if(ey.isFormData(C)&&(v=_.headers.get("content-type"))&&j.setContentType(v),_.body){let[v,y]=N&&te(b,e9(tt(N)))||[];C=en(_.body,v,y)}}}else if(et&&!E&&T&&"get"!==_&&"head"!==_)C=en(C);else if(et&&E&&!F&&"get"!==_&&"head"!==_)throw new eI("Stream request bodies are not supported by the current fetch implementation",eI.ERR_NOT_SUPPORT,v,Z);ey.isString(B)||(B=B?"include":"omit");let ei=E&&"credentials"in k.prototype;if(ey.isFormData(C)){let v=j.getContentType();v&&/^multipart\/form-data/i.test(v)&&!/boundary=/i.test(v)&&j.delete("content-type")}j.set("User-Agent","axios/1.18.1",!1);let er={...U,signal:Y,method:_.toUpperCase(),headers:eA(j.normalize()),body:C,duplex:"half",credentials:ei?B:void 0};Z=E&&new k(y,er);let eo=await (E?G(Z,U):G(y,er)),ea=eO.from(eo.headers);if(H){let b=ey.toFiniteNumber(ea.getContentLength());if(null!=b&&b>V)throw new eI("maxContentLength size of "+V+" exceeded",eI.ERR_BAD_RESPONSE,v,Z)}let es=I&&("stream"===z||"response"===z);if(I&&eo.body&&(L||H||es&&X)){let b={};["status","statusText","headers"].forEach(v=>{b[v]=eo[v]});let y=ey.toFiniteNumber(ea.getContentLength()),[_,x]=L&&te(y,e9(tt(L),!0))||[],w=0;eo=new A(tg(eo.body,65536,b=>{if(H&&b>V)throw new eI("maxContentLength size of "+V+" exceeded",eI.ERR_BAD_RESPONSE,v,Z);_&&_(b)},()=>{x&&x(),X&&X()}),b)}z=z||"text";let el=await M[ey.findKey(M,z)||"text"](eo,v);if(H&&!I&&!es){let b;if(null!=el&&("number"==typeof el.byteLength?b=el.byteLength:"number"==typeof el.size?b=el.size:"string"==typeof el&&(b="function"==typeof x?new x().encode(el).byteLength:el.length)),"number"==typeof b&&b>V)throw new eI("maxContentLength size of "+V+" exceeded",eI.ERR_BAD_RESPONSE,v,Z)}return!es&&X&&X(),await new Promise((b,y)=>{e6(b,y,{data:el,headers:eO.from(eo.headers),status:eo.status,statusText:eo.statusText,config:v,request:Z})})}catch(b){if(X&&X(),Y&&Y.aborted&&Y.reason instanceof eI){let y=Y.reason;throw y.config=v,Z&&(y.request=Z),b!==y&&Object.defineProperty(y,"cause",{__proto__:null,value:b,writable:!0,enumerable:!1,configurable:!0}),y}if(K)throw Z&&!K.request&&(K.request=Z),K;if(b instanceof eI)throw Z&&!b.request&&(b.request=Z),b;if(b&&"TypeError"===b.name&&/Load failed|fetch/i.test(b.message)){let y=new eI("Network Error",eI.ERR_NETWORK,v,Z,b&&b.response);throw Object.defineProperty(y,"cause",{__proto__:null,value:b.cause||b,writable:!0,enumerable:!1,configurable:!0}),y}throw eI.from(b,b&&b.code,v,Z,b&&b.response)}}},tk=new Map,tA=v=>{let b=v&&v.env||{},{fetch:y,Request:_,Response:x}=b,w=[_,x,y],k=w.length,A,C,E=tk;for(;k--;)A=w[k],void 0===(C=E.get(A))&&E.set(A,C=k?new Map:tw(b)),E=C;return C};tA();let tC={http:null,xhr:th,fetch:{get:tA}};ey.forEach(tC,(v,b)=>{if(v){try{Object.defineProperty(v,"name",{__proto__:null,value:b})}catch(v){}Object.defineProperty(v,"adapterName",{__proto__:null,value:b})}});let tE=v=>`- ${v}`,tS=v=>ey.isFunction(v)||null===v||!1===v,tT=function(v,b){let y,_,{length:x}=v=ey.isArray(v)?v:[v],w={};for(let k=0;k<x;k++){let x;if(_=y=v[k],!tS(y)&&void 0===(_=tC[(x=String(y)).toLowerCase()]))throw new eI(`Unknown adapter '${x}'`);if(_&&(ey.isFunction(_)||(_=_.get(b))))break;w[x||"#"+k]=_}if(!_){let v=Object.entries(w).map(([v,b])=>`adapter ${v} `+(!1===b?"is not supported by the environment":"is not available in the build"));throw new eI("There is no suitable adapter to dispatch the request "+(x?v.length>1?"since :\n"+v.map(tE).join("\n"):" "+tE(v[0]):"as no adapter specified"),eI.ERR_NOT_SUPPORT)}return _};function tO(v){if(v.cancelToken&&v.cancelToken.throwIfRequested(),v.signal&&v.signal.aborted)throw new e4(null,v)}function tF(v){return tO(v),v.headers=eO.from(v.headers),v.data=e5.call(v,v.transformRequest),-1!==["post","put","patch"].indexOf(v.method)&&v.headers.setContentType("application/x-www-form-urlencoded",!1),tT(v.adapter||e2.adapter,v)(v).then(function(b){tO(v),v.response=b;try{b.data=e5.call(v,v.transformResponse,b)}finally{delete v.response}return b.headers=eO.from(b.headers),b},function(b){if(!e3(b)&&(tO(v),b&&b.response)){v.response=b.response;try{b.response.data=e5.call(v,v.transformResponse,b.response)}finally{delete v.response}b.response.headers=eO.from(b.response.headers)}return Promise.reject(b)})}let tI={};["object","boolean","number","function","string","symbol"].forEach((v,b)=>{tI[v]=function(y){return typeof y===v||"a"+(b<1?"n ":" ")+v}});let tM={};tI.transitional=function(v,b,y){function _(v,b){return"[Axios v1.18.1] Transitional option '"+v+"'"+b+(y?". "+y:"")}return(y,x,w)=>{if(!1===v)throw new eI(_(x," has been removed"+(b?" in "+b:"")),eI.ERR_DEPRECATED);return b&&!tM[x]&&(tM[x]=!0,console.warn(_(x," has been deprecated since v"+b+" and will be removed in the near future"))),!v||v(y,x,w)}},tI.spelling=function(v){return(b,y)=>(console.warn(`${y} is likely a misspelling of ${v}`),!0)};let tR=function(v,b,y){if("object"!=typeof v||null===v)throw new eI("options must be an object",eI.ERR_BAD_OPTION_VALUE);let _=Object.keys(v),x=_.length;for(;x-- >0;){let w=_[x],k=Object.prototype.hasOwnProperty.call(b,w)?b[w]:void 0;if(k){let b=v[w],y=void 0===b||k(b,w,v);if(!0!==y)throw new eI("option "+w+" must be "+y,eI.ERR_BAD_OPTION_VALUE);continue}if(!0!==y)throw new eI("Unknown option "+w,eI.ERR_BAD_OPTION)}};class tD{constructor(v){this.defaults=v||{},this.interceptors={request:new eU,response:new eU}}async request(v,b){try{return await this._request(v,b)}catch(v){if(v instanceof Error){let b={};Error.captureStackTrace?Error.captureStackTrace(b):b=Error();let y=(()=>{if(!b.stack)return"";let v=b.stack.indexOf("\n");return -1===v?"":b.stack.slice(v+1)})();try{if(v.stack){if(y){let b=y.indexOf("\n"),_=-1===b?-1:y.indexOf("\n",b+1),x=-1===_?"":y.slice(_+1);String(v.stack).endsWith(x)||(v.stack+="\n"+y)}}else v.stack=y}catch(v){}}throw v}}_request(v,b){let y,_;"string"==typeof v?(b=b||{}).url=v:b=v||{};let{transitional:x,paramsSerializer:w,headers:k}=b=tc(this.defaults,b);void 0!==x&&tR(x,{silentJSONParsing:tI.transitional(tI.boolean),forcedJSONParsing:tI.transitional(tI.boolean),clarifyTimeoutError:tI.transitional(tI.boolean),legacyInterceptorReqResOrdering:tI.transitional(tI.boolean),advertiseZstdAcceptEncoding:tI.transitional(tI.boolean),validateStatusUndefinedResolves:tI.transitional(tI.boolean)},!1),null!=w&&(ey.isFunction(w)?b.paramsSerializer={serialize:w}:tR(w,{encode:tI.function,serialize:tI.function},!0)),void 0!==b.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?b.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:b.allowAbsoluteUrls=!0),tR(b,{baseUrl:tI.spelling("baseURL"),withXsrfToken:tI.spelling("withXSRFToken")},!0),b.method=(b.method||this.defaults.method||"get").toLowerCase();let A=k&&ey.merge(k.common,k[b.method]);k&&ey.forEach(["delete","get","head","post","put","patch","query","common"],v=>{delete k[v]}),b.headers=eO.concat(A,k);let C=[],E=!0;this.interceptors.request.forEach(function(v){if("function"==typeof v.runWhen&&!1===v.runWhen(b))return;E=E&&v.synchronous;let y=b.transitional||eV;y&&y.legacyInterceptorReqResOrdering?C.unshift(v.fulfilled,v.rejected):C.push(v.fulfilled,v.rejected)});let S=[];this.interceptors.response.forEach(function(v){S.push(v.fulfilled,v.rejected)});let T=0;if(!E){let v=[tF.bind(this),void 0];for(v.unshift(...C),v.push(...S),_=v.length,y=Promise.resolve(b);T<_;)y=y.then(v[T++],v[T++]);return y}_=C.length;let O=b;for(;T<_;){let v=C[T++],b=C[T++];try{O=v(O)}catch(v){b.call(this,v);break}}try{y=tF.call(this,O)}catch(v){return Promise.reject(v)}for(T=0,_=S.length;T<_;)y=y.then(S[T++],S[T++]);return y}getUri(v){return e$(ts((v=tc(this.defaults,v)).baseURL,v.url,v.allowAbsoluteUrls,v),v.params,v.paramsSerializer)}}ey.forEach(["delete","get","head","options"],function(v){tD.prototype[v]=function(b,y){return this.request(tc(y||{},{method:v,url:b,data:y&&ey.hasOwnProp(y,"data")?y.data:void 0}))}}),ey.forEach(["post","put","patch","query"],function(v){function b(b){return function(y,_,x){return this.request(tc(x||{},{method:v,headers:b?{"Content-Type":"multipart/form-data"}:{},url:y,data:_}))}}tD.prototype[v]=b(),"query"!==v&&(tD.prototype[v+"Form"]=b(!0))});let tP=class v{constructor(v){let b;if("function"!=typeof v)throw TypeError("executor must be a function.");this.promise=new Promise(function(v){b=v});const y=this;this.promise.then(v=>{if(!y._listeners)return;let b=y._listeners.length;for(;b-- >0;)y._listeners[b](v);y._listeners=null}),this.promise.then=v=>{let b,_=new Promise(v=>{y.subscribe(v),b=v}).then(v);return _.cancel=function(){y.unsubscribe(b)},_},v(function(v,_,x){y.reason||(y.reason=new e4(v,_,x),b(y.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(v){this.reason?v(this.reason):this._listeners?this._listeners.push(v):this._listeners=[v]}unsubscribe(v){if(!this._listeners)return;let b=this._listeners.indexOf(v);-1!==b&&this._listeners.splice(b,1)}toAbortSignal(){let v=new AbortController,b=b=>{v.abort(b)};return this.subscribe(b),v.signal.unsubscribe=()=>this.unsubscribe(b),v.signal}static source(){let b;return{token:new v(function(v){b=v}),cancel:b}}},tL={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(tL).forEach(([v,b])=>{tL[b]=v});let tN=function v(b){let y=new tD(b),_=O(tD.prototype.request,y);return ey.extend(_,tD.prototype,y,{allOwnKeys:!0}),ey.extend(_,y,null,{allOwnKeys:!0}),_.create=function(y){return v(tc(b,y))},_}(e2);function tz(v,b,y){return b=tU(b),function(v,b){var y;if(b&&("object"==((y=b)&&"u">typeof Symbol&&y.constructor===Symbol?"symbol":typeof y)||"function"==typeof b))return b;if(void 0===v)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return v}(v,tq()?Reflect.construct(b,y||[],tU(v).constructor):b.apply(v,y))}function tj(v,b){if(!(v instanceof b))throw TypeError("Cannot call a class as a function")}function tB(v,b){for(var y=0;y<b.length;y++){var _=b[y];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(v,_.key,_)}}function t$(v,b,y){return b&&tB(v.prototype,b),y&&tB(v,y),v}function tU(v){return(tU=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)})(v)}function tV(v,b){if("function"!=typeof b&&null!==b)throw TypeError("Super expression must either be null or a function");v.prototype=Object.create(b&&b.prototype,{constructor:{value:v,writable:!0,configurable:!0}}),b&&tH(v,b)}function tq(){try{var v=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(v){}return(tq=function(){return!!v})()}function tH(v,b){return(tH=Object.setPrototypeOf||function(v,b){return v.__proto__=b,v})(v,b)}function tW(v,b){return b||(b=v.slice(0)),Object.freeze(Object.defineProperties(v,{raw:{value:Object.freeze(b)}}))}function tG(){var v=tW(["dashboard"]);return tG=function(){return v},v}function tY(){var v=tW(["dashboard"]);return tY=function(){return v},v}function tZ(){var v=tW(["dashboard/all/",""]);return tZ=function(){return v},v}function tX(){var v=tW(["dashboard/query"]);return tX=function(){return v},v}function tK(){var v=tW(["dashboard/","/",""]);return tK=function(){return v},v}function tJ(){var v=tW(["dashboard/","/",""]);return tJ=function(){return v},v}function tQ(){var v=tW(["agent/assetDiscovery/",""]);return tQ=function(){return v},v}function t0(){var v=tW(["agent/assetImport/",""]);return t0=function(){return v},v}function t1(){var v=tW(["agent/instanceDiscovery/",""]);return t1=function(){return v},v}function t2(){var v=tW(["apps"]);return t2=function(){return v},v}function t5(){var v=tW(["apps/consoleConfig"]);return t5=function(){return v},v}function t3(){var v=tW(["apps/info"]);return t3=function(){return v},v}function t4(){var v=tW(["syslog/config"]);return t4=function(){return v},v}function t6(){var v=tW(["syslog/config"]);return t6=function(){return v},v}function t8(){var v=tW(["syslog/event"]);return t8=function(){return v},v}function t7(){var v=tW(["syslog/event"]);return t7=function(){return v},v}function t9(){var v=tW(["alarm"]);return t9=function(){return v},v}function ne(){var v=tW(["alarm"]);return ne=function(){return v},v}function nt(){var v=tW(["alarm"]);return nt=function(){return v},v}function nn(){var v=tW(["alarm/assets"]);return nn=function(){return v},v}function ni(){var v=tW(["alarm/",""]);return ni=function(){return v},v}function nr(){var v=tW(["alarm/",""]);return nr=function(){return v},v}function no(){var v=tW(["alarm/",""]);return no=function(){return v},v}function na(){var v=tW(["alarm/","/assets"]);return na=function(){return v},v}function ns(){var v=tW(["notification"]);return ns=function(){return v},v}function nl(){var v=tW(["notification"]);return nl=function(){return v},v}function nc(){var v=tW(["notification/alert"]);return nc=function(){return v},v}function nu(){var v=tW(["notification/count"]);return nu=function(){return v},v}function nd(){var v=tW(["notification/",""]);return nd=function(){return v},v}function nh(){var v=tW(["notification/","/acknowledged"]);return nh=function(){return v},v}function np(){var v=tW(["notification/","/delivered"]);return np=function(){return v},v}function nf(){var v=tW(["gateway/tunnel"]);return nf=function(){return v},v}function nm(){var v=tW(["gateway/tunnel"]);return nm=function(){return v},v}function ng(){var v=tW(["gateway/tunnel/",""]);return ng=function(){return v},v}function nv(){var v=tW(["gateway/tunnel/","/",""]);return nv=function(){return v},v}function nb(){var v=tW(["gateway/tunnel/","/","/","/",""]);return nb=function(){return v},v}function ny(){var v=tW(["rules"]);return ny=function(){return v},v}function n_(){var v=tW(["rules"]);return n_=function(){return v},v}function nx(){var v=tW(["rules/asset"]);return nx=function(){return v},v}function nw(){var v=tW(["rules/asset/for/",""]);return nw=function(){return v},v}function nk(){var v=tW(["rules/asset/",""]);return nk=function(){return v},v}function nA(){var v=tW(["rules/asset/",""]);return nA=function(){return v},v}function nC(){var v=tW(["rules/asset/",""]);return nC=function(){return v},v}function nE(){var v=tW(["rules/geofences/",""]);return nE=function(){return v},v}function nS(){var v=tW(["rules/info/asset/",""]);return nS=function(){return v},v}function nT(){var v=tW(["rules/info/global"]);return nT=function(){return v},v}function nO(){var v=tW(["rules/info/realm/",""]);return nO=function(){return v},v}function nF(){var v=tW(["rules/realm"]);return nF=function(){return v},v}function nI(){var v=tW(["rules/realm/for/",""]);return nI=function(){return v},v}function nM(){var v=tW(["rules/realm/",""]);return nM=function(){return v},v}function nR(){var v=tW(["rules/realm/",""]);return nR=function(){return v},v}function nD(){var v=tW(["rules/realm/",""]);return nD=function(){return v},v}function nP(){var v=tW(["rules/",""]);return nP=function(){return v},v}function nL(){var v=tW(["rules/",""]);return nL=function(){return v},v}function nN(){var v=tW(["rules/",""]);return nN=function(){return v},v}function nz(){var v=tW(["realm"]);return nz=function(){return v},v}function nj(){var v=tW(["realm"]);return nj=function(){return v},v}function nB(){var v=tW(["realm/accessible"]);return nB=function(){return v},v}function n$(){var v=tW(["realm/",""]);return n$=function(){return v},v}function nU(){var v=tW(["realm/",""]);return nU=function(){return v},v}function nV(){var v=tW(["realm/",""]);return nV=function(){return v},v}function nq(){var v=tW(["configuration/manager"]);return nq=function(){return v},v}function nH(){var v=tW(["configuration/manager"]);return nH=function(){return v},v}function nW(){var v=tW(["configuration/manager/file"]);return nW=function(){return v},v}function nG(){var v=tW(["configuration/manager/image/",""]);return nG=function(){return v},v}function nY(){var v=tW(["service"]);return nY=function(){return v},v}function nZ(){var v=tW(["service"]);return nZ=function(){return v},v}function nX(){var v=tW(["service/global"]);return nX=function(){return v},v}function nK(){var v=tW(["service/global"]);return nK=function(){return v},v}function nJ(){var v=tW(["service/","/",""]);return nJ=function(){return v},v}function nQ(){var v=tW(["service/","/",""]);return nQ=function(){return v},v}function n0(){var v=tW(["service/","/",""]);return n0=function(){return v},v}function n1(){var v=tW(["user/locale"]);return n1=function(){return v},v}function n2(){var v=tW(["user/query"]);return n2=function(){return v},v}function n5(){var v=tW(["user/request-password-reset"]);return n5=function(){return v},v}function n3(){var v=tW(["user/reset-password"]);return n3=function(){return v},v}function n4(){var v=tW(["user/update"]);return n4=function(){return v},v}function n6(){var v=tW(["user/user"]);return n6=function(){return v},v}function n8(){var v=tW(["user/userRealmRoles"]);return n8=function(){return v},v}function n7(){var v=tW(["user/userRoles/",""]);return n7=function(){return v},v}function n9(){var v=tW(["user/","/disconnect/",""]);return n9=function(){return v},v}function ie(){var v=tW(["user/","/request-password-reset/",""]);return ie=function(){return v},v}function it(){var v=tW(["user/","/reset-password/",""]);return it=function(){return v},v}function ii(){var v=tW(["user/","/reset-secret/",""]);return ii=function(){return v},v}function ir(){var v=tW(["user/","/roles"]);return ir=function(){return v},v}function io(){var v=tW(["user/","/userRealmRoles/",""]);return io=function(){return v},v}function ia(){var v=tW(["user/","/userRealmRoles/",""]);return ia=function(){return v},v}function is(){var v=tW(["user/","/userRoles/","/",""]);return is=function(){return v},v}function il(){var v=tW(["user/","/userRoles/","/",""]);return il=function(){return v},v}function ic(){var v=tW(["user/","/userSessions/",""]);return ic=function(){return v},v}function iu(){var v=tW(["user/","/users"]);return iu=function(){return v},v}function id(){var v=tW(["user/","/users"]);return id=function(){return v},v}function ih(){var v=tW(["user/","/users/",""]);return ih=function(){return v},v}function ip(){var v=tW(["user/","/","/roles"]);return ip=function(){return v},v}function im(){var v=tW(["user/","/","/roles"]);return im=function(){return v},v}function ig(){var v=tW(["user/","/",""]);return ig=function(){return v},v}function iv(){var v=tW(["asset/predicted/","/",""]);return iv=function(){return v},v}function ib(){var v=tW(["asset/predicted/","/",""]);return ib=function(){return v},v}function iy(){var v=tW(["flow"]);return iy=function(){return v},v}function i_(){var v=tW(["flow/",""]);return i_=function(){return v},v}function ix(){var v=tW(["flow/",""]);return ix=function(){return v},v}function iw(){var v=tW(["gateway/connection"]);return iw=function(){return v},v}function ik(){var v=tW(["gateway/connection"]);return ik=function(){return v},v}function iA(){var v=tW(["gateway/connection/",""]);return iA=function(){return v},v}function iC(){var v=tW(["gateway/connection/",""]);return iC=function(){return v},v}function iE(){var v=tW(["gateway/connection/",""]);return iE=function(){return v},v}function iS(){var v=tW(["gateway/status/",""]);return iS=function(){return v},v}function iT(){var v=tW(["console/register"]);return iT=function(){return v},v}function iO(){var v=tW(["model/assetDescriptors"]);return iO=function(){return v},v}function iF(){var v=tW(["model/assetInfo/",""]);return iF=function(){return v},v}function iI(){var v=tW(["model/assetInfos"]);return iI=function(){return v},v}function iM(){var v=tW(["model/getValueDescriptorSchema"]);return iM=function(){return v},v}function iR(){var v=tW(["model/metaItemDescriptors"]);return iR=function(){return v},v}function iD(){var v=tW(["model/valueDescriptors"]);return iD=function(){return v},v}function iP(){var v=tW(["health"]);return iP=function(){return v},v}function iL(){var v=tW(["info"]);return iL=function(){return v},v}function iN(){var v=tW(["asset"]);return iN=function(){return v},v}function iz(){var v=tW(["asset"]);return iz=function(){return v},v}function ij(){var v=tW(["asset/attributes"]);return ij=function(){return v},v}function iB(){var v=tW(["asset/attributes/timestamp"]);return iB=function(){return v},v}function i$(){var v=tW(["asset/count"]);return i$=function(){return v},v}function iU(){var v=tW(["asset/parent"]);return iU=function(){return v},v}function iV(){var v=tW(["asset/partial/",""]);return iV=function(){return v},v}function iq(){var v=tW(["asset/query"]);return iq=function(){return v},v}function iH(){var v=tW(["asset/tree"]);return iH=function(){return v},v}function iW(){var v=tW(["asset/user/current"]);return iW=function(){return v},v}function iG(){var v=tW(["asset/user/link"]);return iG=function(){return v},v}function iY(){var v=tW(["asset/user/link"]);return iY=function(){return v},v}function iZ(){var v=tW(["asset/user/link/delete"]);return iZ=function(){return v},v}function iX(){var v=tW(["asset/user/link/","/",""]);return iX=function(){return v},v}function iK(){var v=tW(["asset/user/link/","/","/",""]);return iK=function(){return v},v}function iJ(){var v=tW(["asset/",""]);return iJ=function(){return v},v}function iQ(){var v=tW(["asset/",""]);return iQ=function(){return v},v}function i0(){var v=tW(["asset/","/attribute/",""]);return i0=function(){return v},v}function i1(){var v=tW(["asset/","/attribute/","/",""]);return i1=function(){return v},v}function i2(){var v=tW(["asset/","/child"]);return i2=function(){return v},v}function i5(){var v=tW(["provisioning"]);return i5=function(){return v},v}function i3(){var v=tW(["provisioning"]);return i3=function(){return v},v}function i4(){var v=tW(["provisioning/",""]);return i4=function(){return v},v}function i6(){var v=tW(["provisioning/",""]);return i6=function(){return v},v}function i8(){var v=tW(["asset/datapoint/export"]);return i8=function(){return v},v}function i7(){var v=tW(["asset/datapoint/periods"]);return i7=function(){return v},v}function i9(){var v=tW(["asset/datapoint/","/",""]);return i9=function(){return v},v}function re(){var v=tW(["map"]);return re=function(){return v},v}function rt(){var v=tW(["map"]);return rt=function(){return v},v}function rn(){var v=tW(["map/deleteMap"]);return rn=function(){return v},v}function ri(){var v=tW(["map/getCustomMapInfo"]);return ri=function(){return v},v}function rr(){var v=tW(["map/tile/","/","/",""]);return rr=function(){return v},v}function ro(){var v=tW(["map/upload"]);return ro=function(){return v},v}tN.Axios=tD,tN.CanceledError=e4,tN.CancelToken=tP,tN.isCancel=e3,tN.VERSION="1.18.1",tN.toFormData=eL,tN.AxiosError=eI,tN.Cancel=tN.CanceledError,tN.all=function(v){return Promise.all(v)},tN.spread=function(v){return function(b){return v.apply(null,b)}},tN.isAxiosError=function(v){return ey.isObject(v)&&!0===v.isAxiosError},tN.mergeConfig=tc,tN.AxiosHeaders=eO,tN.formToJSON=v=>e0(ey.isHTMLForm(v)?new FormData(v):v),tN.getAdapter=tT,tN.HttpStatusCode=tL,tN.default=tN;var ra=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"create",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(tG()),data:v,options:b})}},{key:"update",value:function(v,b){return this.httpClient.request({method:"PUT",url:rT(tY()),data:v,options:b})}},{key:"getAllRealmDashboards",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(tZ(),v),options:b})}},{key:"query",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(tX()),data:v,options:b})}},{key:"delete",value:function(v,b,y){return this.httpClient.request({method:"DELETE",url:rT(tK(),v,b),options:y})}},{key:"get",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(tJ(),v,b),options:y})}}]),v}(),rs=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"doProtocolAssetDiscovery",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(tQ(),v),queryParams:b,options:y})}},{key:"doProtocolAssetImport",value:function(v,b,y,_){return this.httpClient.request({method:"POST",url:rT(t0(),v),queryParams:y,data:b,options:_})}},{key:"doProtocolInstanceDiscovery",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(t1(),v),queryParams:b,options:y})}}]),v}(),rl=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"getApps",value:function(v){return this.httpClient.request({method:"GET",url:rT(t2()),options:v})}},{key:"getConsoleConfig",value:function(v){return this.httpClient.request({method:"GET",url:rT(t5()),options:v})}},{key:"getAppInfos",value:function(v){return this.httpClient.request({method:"GET",url:rT(t3()),options:v})}}]),v}(),rc=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"getConfig",value:function(v){return this.httpClient.request({method:"GET",url:rT(t4()),options:v})}},{key:"updateConfig",value:function(v,b){return this.httpClient.request({method:"PUT",url:rT(t6()),data:v,options:b})}},{key:"clearEvents",value:function(v){return this.httpClient.request({method:"DELETE",url:rT(t8()),options:v})}},{key:"getEvents",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(t7()),queryParams:v,options:b})}}]),v}(),ru=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"createAlarm",value:function(v,b,y){return this.httpClient.request({method:"POST",url:rT(t9()),queryParams:b,data:v,options:y})}},{key:"getAlarms",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(ne()),queryParams:v,options:b})}},{key:"removeAlarms",value:function(v,b){return this.httpClient.request({method:"DELETE",url:rT(nt()),data:v,options:b})}},{key:"setAssetLinks",value:function(v,b){return this.httpClient.request({method:"PUT",url:rT(nn()),data:v,options:b})}},{key:"getAlarm",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(ni(),v),options:b})}},{key:"removeAlarm",value:function(v,b){return this.httpClient.request({method:"DELETE",url:rT(nr(),v),options:b})}},{key:"updateAlarm",value:function(v,b,y){return this.httpClient.request({method:"PUT",url:rT(no(),v),data:b,options:y})}},{key:"getAssetLinks",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(na(),v),queryParams:b,options:y})}}]),v}(),rd=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"getNotifications",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(ns()),queryParams:v,options:b})}},{key:"removeNotifications",value:function(v,b){return this.httpClient.request({method:"DELETE",url:rT(nl()),queryParams:v,options:b})}},{key:"sendNotification",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(nc()),data:v,options:b})}},{key:"getNotificationsCount",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(nu()),queryParams:v,options:b})}},{key:"removeNotification",value:function(v,b){return this.httpClient.request({method:"DELETE",url:rT(nd(),v),options:b})}},{key:"notificationAcknowledged",value:function(v,b,y,_){return this.httpClient.request({method:"PUT",url:rT(nh(),v),queryParams:y,data:b,options:_})}},{key:"notificationDelivered",value:function(v,b,y){return this.httpClient.request({method:"PUT",url:rT(np(),v),queryParams:b,options:y})}}]),v}(),rh=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"startTunnel",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(nf()),data:v,options:b})}},{key:"stopTunnel",value:function(v,b){return this.httpClient.request({method:"DELETE",url:rT(nm()),data:v,options:b})}},{key:"getAllActiveTunnelInfos",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(ng(),v),options:b})}},{key:"getGatewayActiveTunnelInfos",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(nv(),v,b),options:y})}},{key:"getActiveTunnelInfo",value:function(v,b,y,_,x){return this.httpClient.request({method:"GET",url:rT(nb(),v,b,y,_),options:x})}}]),v}(),rp=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"createGlobalRuleset",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(ny()),data:v,options:b})}},{key:"getGlobalRulesets",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(n_()),queryParams:v,options:b})}},{key:"createAssetRuleset",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(nx()),data:v,options:b})}},{key:"getAssetRulesets",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(nw(),v),queryParams:b,options:y})}},{key:"deleteAssetRuleset",value:function(v,b){return this.httpClient.request({method:"DELETE",url:rT(nk(),v),options:b})}},{key:"getAssetRuleset",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(nA(),v),options:b})}},{key:"updateAssetRuleset",value:function(v,b,y){return this.httpClient.request({method:"PUT",url:rT(nC(),v),data:b,options:y})}},{key:"getAssetGeofences",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(nE(),v),options:b})}},{key:"getAssetEngineInfo",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(nS(),v),options:b})}},{key:"getGlobalEngineInfo",value:function(v){return this.httpClient.request({method:"GET",url:rT(nT()),options:v})}},{key:"getRealmEngineInfo",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(nO(),v),options:b})}},{key:"createRealmRuleset",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(nF()),data:v,options:b})}},{key:"getRealmRulesets",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(nI(),v),queryParams:b,options:y})}},{key:"deleteRealmRuleset",value:function(v,b){return this.httpClient.request({method:"DELETE",url:rT(nM(),v),options:b})}},{key:"getRealmRuleset",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(nR(),v),options:b})}},{key:"updateRealmRuleset",value:function(v,b,y){return this.httpClient.request({method:"PUT",url:rT(nD(),v),data:b,options:y})}},{key:"deleteGlobalRuleset",value:function(v,b){return this.httpClient.request({method:"DELETE",url:rT(nP(),v),options:b})}},{key:"getGlobalRuleset",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(nL(),v),options:b})}},{key:"updateGlobalRuleset",value:function(v,b,y){return this.httpClient.request({method:"PUT",url:rT(nN(),v),data:b,options:y})}}]),v}(),rf=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"create",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(nz()),data:v,options:b})}},{key:"getAll",value:function(v){return this.httpClient.request({method:"GET",url:rT(nj()),options:v})}},{key:"getAccessible",value:function(v){return this.httpClient.request({method:"GET",url:rT(nB()),options:v})}},{key:"delete",value:function(v,b){return this.httpClient.request({method:"DELETE",url:rT(n$(),v),options:b})}},{key:"get",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(nU(),v),options:b})}},{key:"update",value:function(v,b,y){return this.httpClient.request({method:"PUT",url:rT(nV(),v),data:b,options:y})}}]),v}(),rm=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"getManagerConfig",value:function(v){return this.httpClient.request({method:"GET",url:rT(nq()),options:v})}},{key:"update",value:function(v,b){return this.httpClient.request({method:"PUT",url:rT(nH()),data:v,options:b})}},{key:"fileUpload",value:function(v,b,y){return this.httpClient.request({method:"POST",url:rT(nW()),queryParams:b,data:v,options:y})}},{key:"getManagerConfigImage",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(nG(),v),options:b})}}]),v}(),rg=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"getServices",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(nY()),queryParams:v,options:b})}},{key:"registerService",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(nZ()),data:v,options:b})}},{key:"getGlobalServices",value:function(v){return this.httpClient.request({method:"GET",url:rT(nX()),options:v})}},{key:"registerGlobalService",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(nK()),data:v,options:b})}},{key:"deregisterService",value:function(v,b,y){return this.httpClient.request({method:"DELETE",url:rT(nJ(),v,b),options:y})}},{key:"getService",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(nQ(),v,b),options:y})}},{key:"heartbeat",value:function(v,b,y){return this.httpClient.request({method:"PUT",url:rT(n0(),v,b),options:y})}}]),v}(),rv=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"updateCurrentUserLocale",value:function(v,b){return this.httpClient.request({method:"PUT",url:rT(n1()),data:v,options:b})}},{key:"query",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(n2()),data:v,options:b})}},{key:"requestPasswordResetCurrent",value:function(v){return this.httpClient.request({method:"PUT",url:rT(n5()),options:v})}},{key:"updatePasswordCurrent",value:function(v,b){return this.httpClient.request({method:"PUT",url:rT(n3()),data:v,options:b})}},{key:"updateCurrent",value:function(v,b){return this.httpClient.request({method:"PUT",url:rT(n4()),data:v,options:b})}},{key:"getCurrent",value:function(v){return this.httpClient.request({method:"GET",url:rT(n6()),options:v})}},{key:"getCurrentUserRealmRoles",value:function(v){return this.httpClient.request({method:"GET",url:rT(n8()),options:v})}},{key:"getCurrentUserClientRoles",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(n7(),v),options:b})}},{key:"disconnectUserSession",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(n9(),v,b),options:y})}},{key:"requestPasswordReset",value:function(v,b,y){return this.httpClient.request({method:"PUT",url:rT(ie(),v,b),options:y})}},{key:"updatePassword",value:function(v,b,y,_){return this.httpClient.request({method:"PUT",url:rT(it(),v,b),data:y,options:_})}},{key:"resetSecret",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(ii(),v,b),options:y})}},{key:"updateRoles",value:function(v,b,y){return this.httpClient.request({method:"PUT",url:rT(ir(),v),data:b,options:y})}},{key:"getUserRealmRoles",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(io(),v,b),options:y})}},{key:"updateUserRealmRoles",value:function(v,b,y,_){return this.httpClient.request({method:"PUT",url:rT(ia(),v,b),data:y,options:_})}},{key:"getUserClientRoles",value:function(v,b,y,_){return this.httpClient.request({method:"GET",url:rT(is(),v,b,y),options:_})}},{key:"updateUserClientRoles",value:function(v,b,y,_,x){return this.httpClient.request({method:"PUT",url:rT(il(),v,b,y),data:_,options:x})}},{key:"getUserSessions",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(ic(),v,b),options:y})}},{key:"create",value:function(v,b,y){return this.httpClient.request({method:"POST",url:rT(iu(),v),data:b,options:y})}},{key:"update",value:function(v,b,y){return this.httpClient.request({method:"PUT",url:rT(id(),v),data:b,options:y})}},{key:"delete",value:function(v,b,y){return this.httpClient.request({method:"DELETE",url:rT(ih(),v,b),options:y})}},{key:"getClientRoles",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(ip(),v,b),options:y})}},{key:"updateClientRoles",value:function(v,b,y,_){return this.httpClient.request({method:"PUT",url:rT(im(),v,b),data:y,options:_})}},{key:"get",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(ig(),v,b),options:y})}}]),v}(),rb=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"getPredictedDatapoints",value:function(v,b,y,_){return this.httpClient.request({method:"POST",url:rT(iv(),v,b),data:y,options:_})}},{key:"writePredictedDatapoints",value:function(v,b,y,_){return this.httpClient.request({method:"PUT",url:rT(ib(),v,b),data:y,options:_})}}]),v}(),ry=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"getAllNodeDefinitions",value:function(v){return this.httpClient.request({method:"GET",url:rT(iy()),options:v})}},{key:"getNodeDefinition",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(i_(),v),options:b})}},{key:"getAllNodeDefinitionsByType",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(ix(),v),options:b})}}]),v}(),r_=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"deleteConnections",value:function(v,b){return this.httpClient.request({method:"DELETE",url:rT(iw()),queryParams:v,options:b})}},{key:"getConnections",value:function(v){return this.httpClient.request({method:"GET",url:rT(ik()),options:v})}},{key:"deleteConnection",value:function(v,b){return this.httpClient.request({method:"DELETE",url:rT(iA(),v),options:b})}},{key:"getConnection",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(iC(),v),options:b})}},{key:"setConnection",value:function(v,b,y){return this.httpClient.request({method:"PUT",url:rT(iE(),v),data:b,options:y})}},{key:"getConnectionStatus",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(iS(),v),options:b})}}]),v}(),rx=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"register",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(iT()),data:v,options:b})}}]),v}(),rw=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"getAssetDescriptors",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(iO()),queryParams:v,options:b})}},{key:"getAssetInfo",value:function(v,b,y){return this.httpClient.request({method:"GET",url:rT(iF(),v),queryParams:b,options:y})}},{key:"getAssetInfos",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(iI()),queryParams:v,options:b})}},{key:"getValueDescriptorSchema",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(iM()),queryParams:v,options:b})}},{key:"getMetaItemDescriptors",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(iR()),queryParams:v,options:b})}},{key:"getValueDescriptors",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(iD()),queryParams:v,options:b})}}]),v}(),rk=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"getHealthStatus",value:function(v){return this.httpClient.request({method:"GET",url:rT(iP()),options:v})}},{key:"getInfo",value:function(v){return this.httpClient.request({method:"GET",url:rT(iL()),options:v})}}]),v}(),rA=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"create",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(iN()),data:v,options:b})}},{key:"delete",value:function(v,b){return this.httpClient.request({method:"DELETE",url:rT(iz()),queryParams:v,options:b})}},{key:"writeAttributeValues",value:function(v,b){return this.httpClient.request({method:"PUT",url:rT(ij()),data:v,options:b})}},{key:"writeAttributeEvents",value:function(v,b){return this.httpClient.request({method:"PUT",url:rT(iB()),data:v,options:b})}},{key:"queryCount",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(i$()),data:v,options:b})}},{key:"updateNoneParent",value:function(v,b){return this.httpClient.request({method:"DELETE",url:rT(iU()),queryParams:v,options:b})}},{key:"getPartial",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(iV(),v),options:b})}},{key:"queryAssets",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(iq()),data:v,options:b})}},{key:"queryAssetTree",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(iH()),data:v,options:b})}},{key:"getCurrentUserAssets",value:function(v){return this.httpClient.request({method:"GET",url:rT(iW()),options:v})}},{key:"createUserAssetLinks",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(iG()),data:v,options:b})}},{key:"getUserAssetLinks",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(iY()),queryParams:v,options:b})}},{key:"deleteUserAssetLinks",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(iZ()),data:v,options:b})}},{key:"deleteAllUserAssetLinks",value:function(v,b,y){return this.httpClient.request({method:"DELETE",url:rT(iX(),v,b),options:y})}},{key:"deleteUserAssetLink",value:function(v,b,y,_){return this.httpClient.request({method:"DELETE",url:rT(iK(),v,b,y),options:_})}},{key:"get",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(iJ(),v),options:b})}},{key:"update",value:function(v,b,y){return this.httpClient.request({method:"PUT",url:rT(iQ(),v),data:b,options:y})}},{key:"writeAttributeValue$PUT$asset_assetId_attribute_attributeName",value:function(v,b,y,_){return this.httpClient.request({method:"PUT",url:rT(i0(),v,b),data:y,options:_})}},{key:"writeAttributeValue$PUT$asset_assetId_attribute_attributeName_timestamp",value:function(v,b,y,_,x){return this.httpClient.request({method:"PUT",url:rT(i1(),v,b,y),data:_,options:x})}},{key:"updateParent",value:function(v,b,y){return this.httpClient.request({method:"PUT",url:rT(i2(),v),queryParams:b,options:y})}}]),v}(),rC=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"createProvisioningConfig",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(i5()),data:v,options:b})}},{key:"getProvisioningConfigs",value:function(v){return this.httpClient.request({method:"GET",url:rT(i3()),options:v})}},{key:"deleteProvisioningConfig",value:function(v,b){return this.httpClient.request({method:"DELETE",url:rT(i4(),v),options:b})}},{key:"updateProvisioningConfig",value:function(v,b,y){return this.httpClient.request({method:"PUT",url:rT(i6(),v),data:b,options:y})}}]),v}(),rE=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"getDatapointExport",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(i8()),queryParams:v,options:b})}},{key:"getDatapointPeriod",value:function(v,b){return this.httpClient.request({method:"GET",url:rT(i7()),queryParams:v,options:b})}},{key:"getDatapoints",value:function(v,b,y,_){return this.httpClient.request({method:"POST",url:rT(i9(),v,b),data:y,options:_})}}]),v}(),rS=function(){function v(b){tj(this,v),this.httpClient=b}return t$(v,[{key:"getSettings",value:function(v){return this.httpClient.request({method:"GET",url:rT(re()),options:v})}},{key:"saveSettings",value:function(v,b){return this.httpClient.request({method:"PUT",url:rT(rt()),data:v,options:b})}},{key:"deleteMap",value:function(v){return this.httpClient.request({method:"DELETE",url:rT(rn()),options:v})}},{key:"getCustomMapInfo",value:function(v){return this.httpClient.request({method:"GET",url:rT(ri()),options:v})}},{key:"getTile",value:function(v,b,y,_){return this.httpClient.request({method:"GET",url:rT(rr(),v,b,y),options:_})}},{key:"uploadMap",value:function(v,b){return this.httpClient.request({method:"POST",url:rT(ro()),queryParams:v,options:b})}}]),v}();function rT(v){for(var b=arguments.length,y=Array(b>1?b-1:0),_=1;_<b;_++)y[_-1]=arguments[_];for(var x="",w=0;w<y.length;w++)x+=v[w],x+=encodeURIComponent(y[w]);return x+v[v.length-1]}var rO=function(){function v(b){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();tj(this,v),this._dashboardResource=new rI(b,y),this._agentResource=new rM(b,y),this._appResource=new rR(b,y),this._syslogResource=new rD(b,y),this._alarmResource=new rP(b,y),this._notificationResource=new rL(b,y),this._gatewayServiceResource=new rN(b,y),this._rulesResource=new rz(b,y),this._realmResource=new rj(b,y),this._configurationResource=new rB(b,y),this._externalServiceResource=new r$(b,y),this._userResource=new rU(b,y),this._assetPredictedDatapointResource=new rV(b,y),this._flowResource=new rq(b,y),this._gatewayClientResource=new rH(b,y),this._consoleResource=new rW(b,y),this._assetModelResource=new rG(b,y),this._statusResource=new rY(b,y),this._assetResource=new rZ(b,y),this._provisioningResource=new rX(b,y),this._assetDatapointResource=new rK(b,y),this._mapResource=new rJ(b,y),this._assetResource=new rZ(b,y)}return t$(v,[{key:"DashboardResource",get:function(){return this._dashboardResource}},{key:"AgentResource",get:function(){return this._agentResource}},{key:"AppResource",get:function(){return this._appResource}},{key:"SyslogResource",get:function(){return this._syslogResource}},{key:"AlarmResource",get:function(){return this._alarmResource}},{key:"NotificationResource",get:function(){return this._notificationResource}},{key:"GatewayServiceResource",get:function(){return this._gatewayServiceResource}},{key:"RulesResource",get:function(){return this._rulesResource}},{key:"RealmResource",get:function(){return this._realmResource}},{key:"ConfigurationResource",get:function(){return this._configurationResource}},{key:"ExternalServiceResource",get:function(){return this._externalServiceResource}},{key:"UserResource",get:function(){return this._userResource}},{key:"AssetPredictedDatapointResource",get:function(){return this._assetPredictedDatapointResource}},{key:"FlowResource",get:function(){return this._flowResource}},{key:"GatewayClientResource",get:function(){return this._gatewayClientResource}},{key:"ConsoleResource",get:function(){return this._consoleResource}},{key:"AssetModelResource",get:function(){return this._assetModelResource}},{key:"StatusResource",get:function(){return this._statusResource}},{key:"AssetResource",get:function(){return this._assetResource}},{key:"ProvisioningResource",get:function(){return this._provisioningResource}},{key:"AssetDatapointResource",get:function(){return this._assetDatapointResource}},{key:"MapResource",get:function(){return this._mapResource}}]),v}(),rF=function(){function v(b){tj(this,v),this.axios=b}return t$(v,[{key:"request",value:function(v){var b={};b.method=v.method,b.url=v.url,b.params=v.queryParams,b.data=v.data,function(v,b){if(void 0!=b)for(var y in b)b.hasOwnProperty(y)&&(v[y]=b[y])}(b,v.options);var y=v.copyFn;return this.axios.request(b).then(function(v){return y&&v.data&&(v.originalData=v.data,v.data=y(v.data)),v})}}]),v}(),rI=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(ra),rM=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rs),rR=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rl),rD=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rc),rP=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(ru),rL=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rd),rN=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rh),rz=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rp),rj=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rf),rB=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rm),r$=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rg),rU=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rv),rV=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rb),rq=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(ry),rH=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(r_),rW=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rx),rG=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rw),rY=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rk),rZ=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rA),rX=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rC),rK=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rE),rJ=function(v){function b(v){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tN.create();return tj(this,b),y.defaults.baseURL=v,tz(this,b,[new rF(y)])}return tV(b,v),b}(rS),rQ=y(88183),r0=y.n(rQ),r1=tN.isAxiosError;let r2=new(function(){var v;function b(){if(!(this instanceof b))throw TypeError("Cannot call a class as a function");this._axiosInstance=tN.create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use(function(v){return v.paramsSerializer=function(v){return r0().stringify(v,{arrayFormat:"repeat"})},v})}return v=[{key:"api",get:function(){return this._client}},{key:"axiosInstance",get:function(){return this._axiosInstance}},{key:"baseUrl",get:function(){return this._baseUrl}},{key:"setTimeout",value:function(v){this._axiosInstance.defaults.timeout=v}},{key:"addRequestInterceptor",value:function(v){this._axiosInstance.interceptors.request.use(v)}},{key:"initialise",value:function(v){this._baseUrl=v,this._client=new rO(v,this._axiosInstance)}}],function(v,b){for(var y=0;y<b.length;y++){var _=b[y];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(v,_.key,_)}}(b.prototype,v),b}())},55610(){},47791(){},86550(){},85299(v,b,y){"use strict";let{normalizeIPv6:_,removeDotSegments:x,recomposeAuthority:w,normalizePercentEncoding:k,normalizePathEncoding:A,escapePreservingEscapes:C,reescapeHostDelimiters:E,isIPv4:S,nonSimpleDomain:T}=y(38670),{SCHEMES:O,getSchemeHandler:F}=y(7971);function I(v,b,y,_){let w={};return _||(v=N(M(v,y),y),b=N(M(b,y),y)),!(y=y||{}).tolerant&&b.scheme?(w.scheme=b.scheme,w.userinfo=b.userinfo,w.host=b.host,w.port=b.port,w.path=x(b.path||""),w.query=b.query):(void 0!==b.userinfo||void 0!==b.host||void 0!==b.port?(w.userinfo=b.userinfo,w.host=b.host,w.port=b.port,w.path=x(b.path||""),w.query=b.query):(b.path?("/"===b.path[0]?w.path=x(b.path):(void 0===v.userinfo&&void 0===v.host&&void 0===v.port||v.path?v.path?w.path=v.path.slice(0,v.path.lastIndexOf("/")+1)+b.path:w.path=b.path:w.path="/"+b.path,w.path=x(w.path)),w.query=b.query):(w.path=v.path,void 0!==b.query?w.query=b.query:w.query=v.query),w.userinfo=v.userinfo,w.host=v.host,w.port=v.port),w.scheme=v.scheme),w.fragment=b.fragment,w}function M(v,b){let y={host:v.host,scheme:v.scheme,userinfo:v.userinfo,port:v.port,path:v.path,query:v.query,nid:v.nid,nss:v.nss,uuid:v.uuid,fragment:v.fragment,reference:v.reference,resourceName:v.resourceName,secure:v.secure,error:""},_=Object.assign({},b),A=[],E=F(_.scheme||y.scheme);E&&E.serialize&&E.serialize(y,_),void 0!==y.path&&(_.skipEscape?y.path=k(y.path):(y.path=C(y.path),void 0!==y.scheme&&(y.path=y.path.split("%3A").join(":")))),"suffix"!==_.reference&&y.scheme&&A.push(y.scheme,":");let S=w(y);if(void 0!==S&&("suffix"!==_.reference&&A.push("//"),A.push(S),y.path&&"/"!==y.path[0]&&A.push("/")),void 0!==y.path){let v=y.path;_.absolutePath||E&&E.absolutePath||(v=x(v)),void 0===S&&"/"===v[0]&&"/"===v[1]&&(v="/%2F"+v.slice(2)),A.push(v)}return void 0!==y.query&&A.push("?",y.query),void 0!==y.fragment&&A.push("#",y.fragment),A.join("")}let R=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,D=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,P=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function L(v,b){let y=Object.assign({},b),x={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},w=!1,k=!1;"suffix"===y.reference&&(v=y.scheme?y.scheme+":"+v:"//"+v);let C=v.match(D);null!==C&&-1!==C[1].indexOf("\\")&&(x.error="URI authority must not contain a literal backslash.",w=!0);let O=v.match(P);if(null!==O){let v=O[1],b=v.replace(/[\t\n\r]/g,"");b.length>=2&&("//"!==b.slice(0,2)?(x.error=x.error||"URI authority must not contain a literal backslash.",w=!0):v.length!==b.length&&(x.error=x.error||"URI authority introducer must not contain whitespace.",w=!0))}let I=v.match(R);if(I){x.scheme=I[1],x.userinfo=I[3],x.host=I[4],x.port=parseInt(I[5],10),x.path=I[6]||"",x.query=I[7],x.fragment=I[8],isNaN(x.port)&&(x.port=I[5]);let b=void 0!==I[2]&&x.path&&"/"!==x.path[0]?'URI path must start with "/" when authority is present.':"number"==typeof x.port&&(x.port<0||x.port>65535)?"URI port is malformed.":void 0;if(void 0!==b&&(x.error=x.error||b,w=!0),x.host)if(!1===S(x.host)){let v=_(x.host);x.host=v.host.toLowerCase(),k=v.isIPV6}else k=!0;void 0!==x.scheme||void 0!==x.userinfo||void 0!==x.host||void 0!==x.port||void 0!==x.query||x.path?void 0===x.scheme?x.reference="relative":void 0===x.fragment?x.reference="absolute":x.reference="uri":x.reference="same-document",y.reference&&"suffix"!==y.reference&&y.reference!==x.reference&&(x.error=x.error||"URI is not a "+y.reference+" reference.");let C=F(y.scheme||x.scheme);if(!y.unicodeSupport&&(!C||!C.unicodeSupport)&&x.host&&(y.domainHost||C&&C.domainHost)&&!1===k&&T(x.host))try{x.host=new URL("http://"+x.host).hostname}catch(v){x.error=x.error||"Host's domain name can not be converted to ASCII: "+v}if((!C||C&&!C.skipNormalize)&&(-1!==v.indexOf("%")&&(void 0!==x.scheme&&(x.scheme=unescape(x.scheme)),void 0!==x.host&&(x.host=E(unescape(x.host),k))),x.path&&(x.path=A(x.path)),x.fragment))try{x.fragment=encodeURI(decodeURIComponent(x.fragment))}catch{x.error=x.error||"URI malformed"}C&&C.parse&&C.parse(x,y)}else x.error=x.error||"URI can not be parsed.";return{parsed:x,malformedAuthorityOrPort:w}}function N(v,b){return L(v,b).parsed}function z(v,b){let{parsed:y,malformedAuthorityOrPort:_}=L(v,b);return{normalized:_?v:M(y,b),malformedAuthorityOrPort:_}}function j(v,b){if("string"==typeof v){let{normalized:y,malformedAuthorityOrPort:_}=z(v,b);return _?void 0:y}if("object"==typeof v)return M(v,b)}let B={SCHEMES:O,normalize:function(v,b){return"string"==typeof v?v=z(v,b).normalized:"object"==typeof v&&(v=N(M(v,b),b)),v},resolve:function(v,b,y){let _=y?Object.assign({scheme:"null"},y):{scheme:"null"},{parsed:x,malformedAuthorityOrPort:w}=L(v,_),{parsed:k,malformedAuthorityOrPort:A}=L(b,_);if(w||A)throw Error(x.error||k.error||"URI is malformed.");let C=I(x,k,_,!0);return _.skipEscape=!0,M(C,_)},resolveComponent:I,equal:function(v,b,y){let _=j(v,y),x=j(b,y);return void 0!==_&&void 0!==x&&_.toLowerCase()===x.toLowerCase()},serialize:M,parse:N};v.exports=B,v.exports.default=B,v.exports.fastUri=B},7971(v,b,y){"use strict";let{isUUID:_}=y(38670),x=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,w=["http","https","ws","wss","urn","urn:uuid"];function k(v){return!0===v.secure||!1!==v.secure&&!!v.scheme&&3===v.scheme.length&&("w"===v.scheme[0]||"W"===v.scheme[0])&&("s"===v.scheme[1]||"S"===v.scheme[1])&&("s"===v.scheme[2]||"S"===v.scheme[2])}function A(v){return v.host||(v.error=v.error||"HTTP URIs must have a host."),v}function C(v){let b="https"===String(v.scheme).toLowerCase();return(v.port===(b?443:80)||""===v.port)&&(v.port=void 0),v.path||(v.path="/"),v}let E={scheme:"http",domainHost:!0,parse:A,serialize:C},S={scheme:"https",domainHost:E.domainHost,parse:A,serialize:C},T={scheme:"ws",domainHost:!0,parse:function(v){return v.secure=k(v),v.resourceName=(v.path||"/")+(v.query?"?"+v.query:""),v.path=void 0,v.query=void 0,v},serialize:function(v){if((v.port===(k(v)?443:80)||""===v.port)&&(v.port=void 0),"boolean"==typeof v.secure&&(v.scheme=v.secure?"wss":"ws",v.secure=void 0),v.resourceName){let[b,y]=v.resourceName.split("?");v.path=b&&"/"!==b?b:void 0,v.query=y,v.resourceName=void 0}return v.fragment=void 0,v}},O={scheme:"wss",domainHost:T.domainHost,parse:T.parse,serialize:T.serialize},F={http:E,https:S,ws:T,wss:O,urn:{scheme:"urn",parse:function(v,b){if(!v.path)return v.error="URN can not be parsed",v;let y=v.path.match(x);if(y){let _=b.scheme||v.scheme||"urn";v.nid=y[1].toLowerCase(),v.nss=y[2];let x=I(`${_}:${b.nid||v.nid}`);v.path=void 0,x&&(v=x.parse(v,b))}else v.error=v.error||"URN can not be parsed.";return v},serialize:function(v,b){if(void 0===v.nid)throw Error("URN without nid cannot be serialized");let y=b.scheme||v.scheme||"urn",_=v.nid.toLowerCase(),x=I(`${y}:${b.nid||_}`);x&&(v=x.serialize(v,b));let w=v,k=v.nss;return w.path=`${_||b.nid}:${k}`,b.skipEscape=!0,w},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(v,b){return v.uuid=v.nss,v.nss=void 0,b.tolerant||v.uuid&&_(v.uuid)||(v.error=v.error||"UUID is not valid."),v},serialize:function(v){return v.nss=(v.uuid||"").toLowerCase(),v},skipNormalize:!0}};function I(v){return v&&(F[v]||F[v.toLowerCase()])||void 0}Object.setPrototypeOf(F,null),v.exports={wsIsSecure:k,SCHEMES:F,isValidSchemeName:function(v){return -1!==w.indexOf(v)},getSchemeHandler:I}},38670(v){"use strict";let b=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),y=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),_=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),x=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),w=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function k(v){let b="",y=0,_=0;for(_=0;_<v.length;_++)if(48!==(y=v[_].charCodeAt(0))){if(!(y>=48&&y<=57||y>=65&&y<=70||y>=97&&y<=102))return"";b+=v[_];break}for(_+=1;_<v.length;_++){if(!((y=v[_].charCodeAt(0))>=48&&y<=57||y>=65&&y<=70||y>=97&&y<=102))return"";b+=v[_]}return b}let A=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function C(v){return v.length=0,!0}function E(v,b,y){if(v.length){let _=k(v);if(""===_)return y.error=!0,!1;b.push(_),v.length=0}return!0}function S(v){if(2>function(v){let b=0;for(let y=0;y<v.length;y++)":"===v[y]&&b++;return b}(v))return{host:v,isIPV6:!1};let b=function(v){let b=0,y={error:!1,address:"",zone:""},_=[],x=[],w=!1,A=!1,S=E;for(let k=0;k<v.length;k++){let E=v[k];if("["!==E&&"]"!==E)if(":"===E){if(!0===w&&(A=!0),!S(x,_,y))break;if(++b>7){y.error=!0;break}k>0&&":"===v[k-1]&&(w=!0),_.push(":");continue}else if("%"===E){if(!S(x,_,y))break;S=C}else{x.push(E);continue}}return x.length&&(S===C?y.zone=x.join(""):A?_.push(x.join("")):_.push(k(x))),y.address=_.join(""),y}(v);if(b.error)return{host:v,isIPV6:!1};{let v=b.address,y=b.address;return b.zone&&(v+="%"+b.zone,y+="%25"+b.zone),{host:v,isIPV6:!0,escapedHost:y}}}let T={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},O=/[@/?#:]/g,F=/[@/?#]/g;function I(v,b){let y=b?F:O;return y.lastIndex=0,v.replace(y,v=>T[v])}v.exports={nonSimpleDomain:A,recomposeAuthority:function(v){let b=[];if(void 0!==v.userinfo&&(b.push(v.userinfo),b.push("@")),void 0!==v.host){let _=unescape(v.host);if(!y(_)){let v=S(_);_=!0===v.isIPV6?`[${v.escapedHost}]`:I(_,!1)}b.push(_)}return("number"==typeof v.port||"string"==typeof v.port)&&(b.push(":"),b.push(String(v.port))),b.length?b.join(""):void 0},reescapeHostDelimiters:I,normalizePercentEncoding:function(v,b=!1){if(-1===v.indexOf("%"))return v;let y="";for(let w=0;w<v.length;w++){if("%"===v[w]&&w+2<v.length){let k=v.slice(w+1,w+3);if(_(k)){let v=k.toUpperCase(),_=String.fromCharCode(parseInt(v,16));b&&x(_)?y+=_:y+="%"+v,w+=2;continue}}y+=v[w]}return y},normalizePathEncoding:function(v){let b="";for(let y=0;y<v.length;y++){if("%"===v[y]&&y+2<v.length){let w=v.slice(y+1,y+3);if(_(w)){let v=w.toUpperCase(),_=String.fromCharCode(parseInt(v,16));"."!==_&&x(_)?b+=_:b+="%"+v,y+=2;continue}}w(v[y])?b+=v[y]:b+=escape(v[y])}return b},escapePreservingEscapes:function(v){let b="";for(let y=0;y<v.length;y++){if("%"===v[y]&&y+2<v.length){let x=v.slice(y+1,y+3);if(_(x)){b+="%"+x.toUpperCase(),y+=2;continue}}b+=escape(v[y])}return b},removeDotSegments:function(v){let b=v,y=[],_=-1,x=0;for(;x=b.length;){if(1===x)if("."===b)break;else if("/"===b){y.push("/");break}else{y.push(b);break}if(2===x){if("."===b[0]){if("."===b[1])break;else if("/"===b[1]){b=b.slice(2);continue}}else if("/"===b[0]&&("."===b[1]||"/"===b[1])){y.push("/");break}}else if(3===x&&"/.."===b){0!==y.length&&y.pop(),y.push("/");break}if("."===b[0]){if("."===b[1]){if("/"===b[2]){b=b.slice(3);continue}}else if("/"===b[1]){b=b.slice(2);continue}}else if("/"===b[0]&&"."===b[1]){if("/"===b[2]){b=b.slice(2);continue}else if("."===b[2]&&"/"===b[3]){b=b.slice(3),0!==y.length&&y.pop();continue}}if(-1===(_=b.indexOf("/",1))){y.push(b);break}y.push(b.slice(0,_)),b=b.slice(_)}return y.join("")},isIPv4:y,isUUID:b,normalizeIPv6:S,stringArrayToHexStripped:k}},97271(v){v.exports={aa:{name:"Afar",nativeName:"Afaraf"},ab:{name:"Abkhaz",nativeName:"аҧсуа бызшәа"},ae:{name:"Avestan",nativeName:"avesta"},af:{name:"Afrikaans",nativeName:"Afrikaans"},ak:{name:"Akan",nativeName:"Akan"},am:{name:"Amharic",nativeName:"አማርኛ"},an:{name:"Aragonese",nativeName:"aragon\xe9s"},ar:{name:"Arabic",nativeName:"العربية"},as:{name:"Assamese",nativeName:"অসমীয়া"},av:{name:"Avaric",nativeName:"авар мацӀ"},ay:{name:"Aymara",nativeName:"aymar aru"},az:{name:"Azerbaijani",nativeName:"azərbaycan dili"},ba:{name:"Bashkir",nativeName:"башҡорт теле"},be:{name:"Belarusian",nativeName:"беларуская мова"},bg:{name:"Bulgarian",nativeName:"български език"},bi:{name:"Bislama",nativeName:"Bislama"},bm:{name:"Bambara",nativeName:"bamanankan"},bn:{name:"Bengali",nativeName:"বাংলা"},bo:{name:"Tibetan",nativeName:"བོད་ཡིག"},br:{name:"Breton",nativeName:"brezhoneg"},bs:{name:"Bosnian",nativeName:"bosanski jezik"},ca:{name:"Catalan",nativeName:"Catal\xe0"},ce:{name:"Chechen",nativeName:"нохчийн мотт"},ch:{name:"Chamorro",nativeName:"Chamoru"},co:{name:"Corsican",nativeName:"corsu"},cr:{name:"Cree",nativeName:"ᓀᐦᐃᔭᐍᐏᐣ"},cs:{name:"Czech",nativeName:"čeština"},cu:{name:"Old Church Slavonic",nativeName:"ѩзыкъ словѣньскъ"},cv:{name:"Chuvash",nativeName:"чӑваш чӗлхи"},cy:{name:"Welsh",nativeName:"Cymraeg"},da:{name:"Danish",nativeName:"Dansk"},de:{name:"German",nativeName:"Deutsch"},dv:{name:"Divehi",nativeName:"ދިވެހި"},dz:{name:"Dzongkha",nativeName:"རྫོང་ཁ"},ee:{name:"Ewe",nativeName:"Eʋegbe"},el:{name:"Greek",nativeName:"Ελληνικά"},en:{name:"English",nativeName:"English"},eo:{name:"Esperanto",nativeName:"Esperanto"},es:{name:"Spanish",nativeName:"Espa\xf1ol"},et:{name:"Estonian",nativeName:"eesti"},eu:{name:"Basque",nativeName:"euskara"},fa:{name:"Persian",nativeName:"فارسی"},ff:{name:"Fula",nativeName:"Fulfulde"},fi:{name:"Finnish",nativeName:"suomi"},fj:{name:"Fijian",nativeName:"vosa Vakaviti"},fo:{name:"Faroese",nativeName:"F\xf8royskt"},fr:{name:"French",nativeName:"Fran\xe7ais"},fy:{name:"Western Frisian",nativeName:"Frysk"},ga:{name:"Irish",nativeName:"Gaeilge"},gd:{name:"Scottish Gaelic",nativeName:"G\xe0idhlig"},gl:{name:"Galician",nativeName:"galego"},gn:{name:"Guaran\xed",nativeName:"Ava\xf1e'ẽ"},gu:{name:"Gujarati",nativeName:"ગુજરાતી"},gv:{name:"Manx",nativeName:"Gaelg"},ha:{name:"Hausa",nativeName:"هَوُسَ"},he:{name:"Hebrew",nativeName:"עברית"},hi:{name:"Hindi",nativeName:"हिन्दी"},ho:{name:"Hiri Motu",nativeName:"Hiri Motu"},hr:{name:"Croatian",nativeName:"Hrvatski"},ht:{name:"Haitian",nativeName:"Krey\xf2l ayisyen"},hu:{name:"Hungarian",nativeName:"magyar"},hy:{name:"Armenian",nativeName:"Հայերեն"},hz:{name:"Herero",nativeName:"Otjiherero"},ia:{name:"Interlingua",nativeName:"Interlingua"},id:{name:"Indonesian",nativeName:"Bahasa Indonesia"},ie:{name:"Interlingue",nativeName:"Interlingue"},ig:{name:"Igbo",nativeName:"Asụsụ Igbo"},ii:{name:"Nuosu",nativeName:"ꆈꌠ꒿ Nuosuhxop"},ik:{name:"Inupiaq",nativeName:"I\xf1upiaq"},io:{name:"Ido",nativeName:"Ido"},is:{name:"Icelandic",nativeName:"\xcdslenska"},it:{name:"Italian",nativeName:"Italiano"},iu:{name:"Inuktitut",nativeName:"ᐃᓄᒃᑎᑐᑦ"},ja:{name:"Japanese",nativeName:"日本語"},jv:{name:"Javanese",nativeName:"basa Jawa"},ka:{name:"Georgian",nativeName:"ქართული"},kg:{name:"Kongo",nativeName:"Kikongo"},ki:{name:"Kikuyu",nativeName:"Gĩkũyũ"},kj:{name:"Kwanyama",nativeName:"Kuanyama"},kk:{name:"Kazakh",nativeName:"қазақ тілі"},kl:{name:"Kalaallisut",nativeName:"kalaallisut"},km:{name:"Khmer",nativeName:"ខេមរភាសា"},kn:{name:"Kannada",nativeName:"ಕನ್ನಡ"},ko:{name:"Korean",nativeName:"한국어"},kr:{name:"Kanuri",nativeName:"Kanuri"},ks:{name:"Kashmiri",nativeName:"कश्मीरी"},ku:{name:"Kurdish",nativeName:"Kurd\xee"},kv:{name:"Komi",nativeName:"коми кыв"},kw:{name:"Cornish",nativeName:"Kernewek"},ky:{name:"Kyrgyz",nativeName:"Кыргызча"},la:{name:"Latin",nativeName:"latine"},lb:{name:"Luxembourgish",nativeName:"L\xebtzebuergesch"},lg:{name:"Ganda",nativeName:"Luganda"},li:{name:"Limburgish",nativeName:"Limburgs"},ln:{name:"Lingala",nativeName:"Ling\xe1la"},lo:{name:"Lao",nativeName:"ພາສາລາວ"},lt:{name:"Lithuanian",nativeName:"lietuvių kalba"},lu:{name:"Luba-Katanga",nativeName:"Kiluba"},lv:{name:"Latvian",nativeName:"latviešu valoda"},mg:{name:"Malagasy",nativeName:"fiteny malagasy"},mh:{name:"Marshallese",nativeName:"Kajin M̧ajeļ"},mi:{name:"Māori",nativeName:"te reo Māori"},mk:{name:"Macedonian",nativeName:"македонски јазик"},ml:{name:"Malayalam",nativeName:"മലയാളം"},mn:{name:"Mongolian",nativeName:"Монгол хэл"},mr:{name:"Marathi",nativeName:"मराठी"},ms:{name:"Malay",nativeName:"Bahasa Melayu"},mt:{name:"Maltese",nativeName:"Malti"},my:{name:"Burmese",nativeName:"ဗမာစာ"},na:{name:"Nauru",nativeName:"Dorerin Naoero"},nb:{name:"Norwegian Bokm\xe5l",nativeName:"Norsk bokm\xe5l"},nd:{name:"Northern Ndebele",nativeName:"isiNdebele"},ne:{name:"Nepali",nativeName:"नेपाली"},ng:{name:"Ndonga",nativeName:"Owambo"},nl:{name:"Dutch",nativeName:"Nederlands"},nn:{name:"Norwegian Nynorsk",nativeName:"Norsk nynorsk"},no:{name:"Norwegian",nativeName:"Norsk"},nr:{name:"Southern Ndebele",nativeName:"isiNdebele"},nv:{name:"Navajo",nativeName:"Din\xe9 bizaad"},ny:{name:"Chichewa",nativeName:"chiCheŵa"},oc:{name:"Occitan",nativeName:"occitan"},oj:{name:"Ojibwe",nativeName:"ᐊᓂᔑᓈᐯᒧᐎᓐ"},om:{name:"Oromo",nativeName:"Afaan Oromoo"},or:{name:"Oriya",nativeName:"ଓଡ଼ିଆ"},os:{name:"Ossetian",nativeName:"ирон \xe6взаг"},pa:{name:"Panjabi",nativeName:"ਪੰਜਾਬੀ"},pi:{name:"Pāli",nativeName:"पाऴि"},pl:{name:"Polish",nativeName:"Polski"},ps:{name:"Pashto",nativeName:"پښتو"},pt:{name:"Portuguese",nativeName:"Portugu\xeas"},qu:{name:"Quechua",nativeName:"Runa Simi"},rm:{name:"Romansh",nativeName:"rumantsch grischun"},rn:{name:"Kirundi",nativeName:"Ikirundi"},ro:{name:"Romanian",nativeName:"Rom\xe2nă"},ru:{name:"Russian",nativeName:"Русский"},rw:{name:"Kinyarwanda",nativeName:"Ikinyarwanda"},sa:{name:"Sanskrit",nativeName:"संस्कृतम्"},sc:{name:"Sardinian",nativeName:"sardu"},sd:{name:"Sindhi",nativeName:"सिन्धी"},se:{name:"Northern Sami",nativeName:"Davvis\xe1megiella"},sg:{name:"Sango",nativeName:"y\xe2ng\xe2 t\xee s\xe4ng\xf6"},si:{name:"Sinhala",nativeName:"සිංහල"},sk:{name:"Slovak",nativeName:"slovenčina"},sl:{name:"Slovenian",nativeName:"slovenščina"},sm:{name:"Samoan",nativeName:"gagana fa'a Samoa"},sn:{name:"Shona",nativeName:"chiShona"},so:{name:"Somali",nativeName:"Soomaaliga"},sq:{name:"Albanian",nativeName:"Shqip"},sr:{name:"Serbian",nativeName:"српски језик"},ss:{name:"Swati",nativeName:"SiSwati"},st:{name:"Southern Sotho",nativeName:"Sesotho"},su:{name:"Sundanese",nativeName:"Basa Sunda"},sv:{name:"Swedish",nativeName:"Svenska"},sw:{name:"Swahili",nativeName:"Kiswahili"},ta:{name:"Tamil",nativeName:"தமிழ்"},te:{name:"Telugu",nativeName:"తెలుగు"},tg:{name:"Tajik",nativeName:"тоҷикӣ"},th:{name:"Thai",nativeName:"ไทย"},ti:{name:"Tigrinya",nativeName:"ትግርኛ"},tk:{name:"Turkmen",nativeName:"T\xfcrkmen\xe7e"},tl:{name:"Tagalog",nativeName:"Wikang Tagalog"},tn:{name:"Tswana",nativeName:"Setswana"},to:{name:"Tonga",nativeName:"faka Tonga"},tr:{name:"Turkish",nativeName:"T\xfcrk\xe7e"},ts:{name:"Tsonga",nativeName:"Xitsonga"},tt:{name:"Tatar",nativeName:"татар теле"},tw:{name:"Twi",nativeName:"Twi"},ty:{name:"Tahitian",nativeName:"Reo Tahiti"},ug:{name:"Uyghur",nativeName:"ئۇيغۇرچە"},uk:{name:"Ukrainian",nativeName:"Українська"},ur:{name:"Urdu",nativeName:"اردو"},uz:{name:"Uzbek",nativeName:"Ўзбек"},ve:{name:"Venda",nativeName:"Tshivenḓa"},vi:{name:"Vietnamese",nativeName:"Tiếng Việt"},vo:{name:"Volap\xfck",nativeName:"Volap\xfck"},wa:{name:"Walloon",nativeName:"walon"},wo:{name:"Wolof",nativeName:"Wollof"},xh:{name:"Xhosa",nativeName:"isiXhosa"},yi:{name:"Yiddish",nativeName:"ייִדיש"},yo:{name:"Yoruba",nativeName:"Yor\xf9b\xe1"},za:{name:"Zhuang",nativeName:"Saɯ cueŋƅ"},zh:{name:"Chinese",nativeName:"中文"},zu:{name:"Zulu",nativeName:"isiZulu"}}},44147(v,b,y){let _=y(97271),x={},w={},k=[],A=[],C=[];for(let v in _){let{name:b,nativeName:y}=_[v];x[v]=w[b.toLowerCase()]=w[y.toLowerCase()]={code:v,name:b,nativeName:y},k.push(v),A.push(b),C.push(y)}v.exports=class v{static getLanguages(b=[]){return b.map(b=>v.validate(b)?Object.assign({},x[b]):{code:b,name:"",nativeName:""})}static getName(b){return v.validate(b)?_[b].name:""}static getAllNames(){return A.slice()}static getNativeName(b){return v.validate(b)?_[b].nativeName:""}static getAllNativeNames(){return C.slice()}static getCode(v){return v=v.toLowerCase(),w.hasOwnProperty(v)?w[v].code:""}static getAllCodes(){return k.slice()}static validate(v){return _.hasOwnProperty(v)}}},57415(v){v.exports=function(){"use strict";var v={},b={};function y(y,_,x){if(b[y]=x,"index"===y){var w="var sharedModule = {}; ("+b.shared+")(sharedModule); ("+b.worker+")(sharedModule);",k={};return b.shared(k),b.index(v,k),"u">typeof window&&v.setWorkerUrl(window.URL.createObjectURL(new Blob([w],{type:"text/javascript"}))),v}}return y("shared",["exports"],function(v){let b,y,_,x,w,k,A,C,E,S,T,O,F,I,M,R,D,P,L;function N(v,b,y,_){return new(y||(y=Promise))(function(x,w){function k(v){try{C(_.next(v))}catch(v){w(v)}}function A(v){try{C(_.throw(v))}catch(v){w(v)}}function C(v){var b;v.done?x(v.value):((b=v.value)instanceof y?b:new y(function(v){v(b)})).then(k,A)}C((_=_.apply(v,b||[])).next())})}function z(v,b){this.x=v,this.y=b}function j(v){return v&&v.__esModule&&Object.prototype.hasOwnProperty.call(v,"default")?v.default:v}"function"==typeof SuppressedError&&SuppressedError,z.prototype={clone(){return new z(this.x,this.y)},add(v){return this.clone()._add(v)},sub(v){return this.clone()._sub(v)},multByPoint(v){return this.clone()._multByPoint(v)},divByPoint(v){return this.clone()._divByPoint(v)},mult(v){return this.clone()._mult(v)},div(v){return this.clone()._div(v)},rotate(v){return this.clone()._rotate(v)},rotateAround(v,b){return this.clone()._rotateAround(v,b)},matMult(v){return this.clone()._matMult(v)},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(v){return this.x===v.x&&this.y===v.y},dist(v){return Math.sqrt(this.distSqr(v))},distSqr(v){let b=v.x-this.x,y=v.y-this.y;return b*b+y*y},angle(){return Math.atan2(this.y,this.x)},angleTo(v){return Math.atan2(this.y-v.y,this.x-v.x)},angleWith(v){return this.angleWithSep(v.x,v.y)},angleWithSep(v,b){return Math.atan2(this.x*b-this.y*v,this.x*v+this.y*b)},_matMult(v){let b=v[2]*this.x+v[3]*this.y;return this.x=v[0]*this.x+v[1]*this.y,this.y=b,this},_add(v){return this.x+=v.x,this.y+=v.y,this},_sub(v){return this.x-=v.x,this.y-=v.y,this},_mult(v){return this.x*=v,this.y*=v,this},_div(v){return this.x/=v,this.y/=v,this},_multByPoint(v){return this.x*=v.x,this.y*=v.y,this},_divByPoint(v){return this.x/=v.x,this.y/=v.y,this},_unit(){return this._div(this.mag()),this},_perp(){let v=this.y;return this.y=this.x,this.x=-v,this},_rotate(v){let b=Math.cos(v),y=Math.sin(v),_=y*this.x+b*this.y;return this.x=b*this.x-y*this.y,this.y=_,this},_rotateAround(v,b){let y=Math.cos(v),_=Math.sin(v),x=b.y+_*(this.x-b.x)+y*(this.y-b.y);return this.x=b.x+y*(this.x-b.x)-_*(this.y-b.y),this.y=x,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:z},z.convert=function(v){if(v instanceof z)return v;if(Array.isArray(v))return new z(+v[0],+v[1]);if(void 0!==v.x&&void 0!==v.y)return new z(+v.x,+v.y);throw Error("Expected [x, y] or {x, y} point format")};var B,U,V,q,H,W,G,Y,Z,X,K,J,Q,ee,et,en,ei,er,eo,ea,es,el,ec,eu=j(function(){if(nE)return nC;function v(v,b,y,_){this.cx=3*v,this.bx=3*(y-v)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*b,this.by=3*(_-b)-this.cy,this.ay=1-this.cy-this.by,this.p1x=v,this.p1y=b,this.p2x=y,this.p2y=_}return nE=1,nC=v,v.prototype={sampleCurveX:function(v){return((this.ax*v+this.bx)*v+this.cx)*v},sampleCurveY:function(v){return((this.ay*v+this.by)*v+this.cy)*v},sampleCurveDerivativeX:function(v){return(3*this.ax*v+2*this.bx)*v+this.cx},solveCurveX:function(v,b){if(void 0===b&&(b=1e-6),v<0)return 0;if(v>1)return 1;for(var y=v,_=0;_<8;_++){var x=this.sampleCurveX(y)-v;if(Math.abs(x)<b)return y;var w=this.sampleCurveDerivativeX(y);if(1e-6>Math.abs(w))break;y-=x/w}var k=0,A=1;for(y=v,_=0;_<20&&!(Math.abs((x=this.sampleCurveX(y))-v)<b);_++)v>x?k=y:A=y,y=.5*(A-k)+k;return y},solve:function(v,b){return this.sampleCurveY(this.solveCurveX(v,b))}},nC}());function ed(){return null==b&&(b="u">typeof OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),b}function eh(){if(null==y&&(y=!1,ed())){let v=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(v){for(let b=0;b<25;b++){let y=4*b;v.fillStyle=`rgb(${y},${y+1},${y+2})`,v.fillRect(b%5,Math.floor(b/5),1,1)}let b=v.getImageData(0,0,5,5).data;for(let v=0;v<100;v++)if(v%4!=3&&b[v]!==v){y=!0;break}}}return y||!1}var ep="u">typeof Float32Array?Float32Array:Array;function ef(){var v=new ep(9);return ep!=Float32Array&&(v[1]=0,v[2]=0,v[3]=0,v[5]=0,v[6]=0,v[7]=0),v[0]=1,v[4]=1,v[8]=1,v}function em(v){return v[0]=1,v[1]=0,v[2]=0,v[3]=0,v[4]=0,v[5]=1,v[6]=0,v[7]=0,v[8]=0,v[9]=0,v[10]=1,v[11]=0,v[12]=0,v[13]=0,v[14]=0,v[15]=1,v}function eg(){var v=new ep(3);return ep!=Float32Array&&(v[0]=0,v[1]=0,v[2]=0),v}function ev(v){var b=v[0],y=v[1],_=v[2];return Math.sqrt(b*b+y*y+_*_)}function eb(v,b,y){var _=new ep(3);return _[0]=v,_[1]=b,_[2]=y,_}function ey(v,b,y){return v[0]=b[0]+y[0],v[1]=b[1]+y[1],v[2]=b[2]+y[2],v}function e_(v,b,y){return v[0]=b[0]*y,v[1]=b[1]*y,v[2]=b[2]*y,v}function ex(v,b,y){var _=b[0],x=b[1],w=b[2],k=y[0],A=y[1],C=y[2];return v[0]=x*C-w*A,v[1]=w*k-_*C,v[2]=_*A-x*k,v}function ew(v,b,y){var _=b[0],x=b[1],w=b[2],k=b[3];return v[0]=y[0]*_+y[4]*x+y[8]*w+y[12]*k,v[1]=y[1]*_+y[5]*x+y[9]*w+y[13]*k,v[2]=y[2]*_+y[6]*x+y[10]*w+y[14]*k,v[3]=y[3]*_+y[7]*x+y[11]*w+y[15]*k,v}function ek(){var v=new ep(4);return ep!=Float32Array&&(v[0]=0,v[1]=0,v[2]=0),v[3]=1,v}function eA(v,b,y,_){var x=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"zyx",w=Math.PI/360;b*=w,_*=w,y*=w;var k=Math.sin(b),A=Math.cos(b),C=Math.sin(y),E=Math.cos(y),S=Math.sin(_),T=Math.cos(_);switch(x){case"xyz":v[0]=k*E*T+A*C*S,v[1]=A*C*T-k*E*S,v[2]=A*E*S+k*C*T,v[3]=A*E*T-k*C*S;break;case"xzy":v[0]=k*E*T-A*C*S,v[1]=A*C*T-k*E*S,v[2]=A*E*S+k*C*T,v[3]=A*E*T+k*C*S;break;case"yxz":v[0]=k*E*T+A*C*S,v[1]=A*C*T-k*E*S,v[2]=A*E*S-k*C*T,v[3]=A*E*T+k*C*S;break;case"yzx":v[0]=k*E*T+A*C*S,v[1]=A*C*T+k*E*S,v[2]=A*E*S-k*C*T,v[3]=A*E*T-k*C*S;break;case"zxy":v[0]=k*E*T-A*C*S,v[1]=A*C*T+k*E*S,v[2]=A*E*S+k*C*T,v[3]=A*E*T-k*C*S;break;case"zyx":v[0]=k*E*T-A*C*S,v[1]=A*C*T+k*E*S,v[2]=A*E*S-k*C*T,v[3]=A*E*T+k*C*S;break;default:throw Error("Unknown angle order "+x)}return v}function eC(){var v=new ep(2);return ep!=Float32Array&&(v[0]=0,v[1]=0),v}function eE(v,b){var y=new ep(2);return y[0]=v,y[1]=b,y}function eS(v,b,y){return b*(8192/(v.tileSize*Math.pow(2,y-v.tileID.overscaledZ)))}function eT(v,b){return(v%b+b)%b}function eO(v,b,y){return v*(1-y)+b*y}function eF(v){if(v<=0)return 0;if(v>=1)return 1;let b=v*v,y=b*v;return 4*(v<.5?y:3*(v-b)+y-.75)}function eI(v,b,y,_){let x=new eu(v,b,y,_);return v=>x.solve(v)}eg(),nS=new ep(4),ep!=Float32Array&&(nS[0]=0,nS[1]=0,nS[2]=0,nS[3]=0),eg(),eb(1,0,0),eb(0,1,0),ek(),ek(),ef(),eC();let eM=eI(.25,.1,.25,1);function eR(v,b,y){return Math.min(y,Math.max(b,v))}function eD(v,b,y){let _=y-b,x=((v-b)%_+_)%_+b;return x===b?y:x}function eP(v,...b){for(let y of b)for(let b in y)v[b]=y[b];return v}let eL=1;function eN(v,b,y){let _={};for(let y in v)_[y]=b.call(this,v[y],y,v);return _}function ez(v,b,y){let _={};for(let y in v)b.call(this,v[y],y,v)&&(_[y]=v[y]);return _}function ej(v){return Array.isArray(v)?v.map(ej):"object"==typeof v&&v?eN(v,ej):v}let eB={};function e$(v){eB[v]||("u">typeof console&&console.warn(v),eB[v]=!0)}function eU(v,b,y){return(y.y-v.y)*(b.x-v.x)>(b.y-v.y)*(y.x-v.x)}function eV(v){return"u">typeof WorkerGlobalScope&&void 0!==v&&v instanceof WorkerGlobalScope}let eq=null;function eH(v){return"u">typeof ImageBitmap&&v instanceof ImageBitmap}let eW="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function eG(v,b,y,_,x){return N(this,void 0,void 0,function*(){if("u"<typeof VideoFrame)throw Error("VideoFrame not supported");let w=new VideoFrame(v,{timestamp:0});try{let k,A,C,E,S=null==w?void 0:w.format;if(!S||!S.startsWith("BGR")&&!S.startsWith("RGB"))throw Error(`Unrecognized format ${S}`);let T=S.startsWith("BGR"),O=new Uint8ClampedArray(_*x*4);if(yield w.copyTo(O,(k=4*Math.max(-b,0),A=(Math.max(0,y)-y)*_*4+k,C=Math.max(0,b),E=Math.max(0,y),{rect:{x:C,y:E,width:Math.min(v.width,b+_)-C,height:Math.min(v.height,y+x)-E},layout:[{offset:A,stride:4*_}]})),T)for(let v=0;v<O.length;v+=4){let b=O[v];O[v]=O[v+2],O[v+2]=b}return O}finally{w.close()}})}function eY(v,b,y,_){return v.addEventListener(b,y,_),{unsubscribe:()=>{v.removeEventListener(b,y,_)}}}function eZ(v){return v*Math.PI/180}function eX(v){return v/Math.PI*180}let eK={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},eJ={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},eQ="AbortError";class e0 extends Error{constructor(v=eQ){super(v instanceof Error?v.message:v),this.name=eQ,v instanceof Error&&v.stack&&(this.stack=v.stack)}}function e1(v){return v.name===eQ}let e2={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function e5(v){return e2.REGISTERED_PROTOCOLS[v.substring(0,v.indexOf("://"))]}let e3="global-dispatcher";class e4 extends Error{constructor(v,b,y,_){super(`AJAXError: ${b} (${v}): ${y}`),this.status=v,this.statusText=b,this.url=y,this.body=_}}let e6=()=>eV(self)?self.worker&&self.worker.referrer:("blob:"===window.location.protocol?window.parent:window).location.href,e8=function(v,b){var y;if(/:\/\//.test(v.url)&&!/^https?:|^file:/.test(v.url)){let y=e5(v.url);if(y)return y(v,b);if(eV(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:v,targetMapId:e3},b)}if(!(/^file:/.test(y=v.url)||/^file:/.test(e6())&&!/^\w+:/.test(y))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(v,b){return N(this,void 0,void 0,function*(){let y,_,x=new Request(v.url,{method:v.method||"GET",body:v.body,credentials:v.credentials,headers:v.headers,cache:v.cache,referrer:e6(),signal:b.signal});"json"!==v.type||x.headers.has("Accept")||x.headers.set("Accept","application/json");try{y=yield fetch(x)}catch(b){if(e1(b))throw b;throw new e4(0,b.message,v.url,new Blob)}if(!y.ok){let b=yield y.blob();throw new e4(y.status,y.statusText,v.url,b)}_="arrayBuffer"===v.type||"image"===v.type?y.arrayBuffer():"json"===v.type?y.json():y.text();let w=yield _;return b.signal.throwIfAborted(),{data:w,cacheControl:y.headers.get("Cache-Control"),expires:y.headers.get("Expires")}})}(v,b);if(eV(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:v,mustQueue:!0,targetMapId:e3},b)}return new Promise((y,_)=>{var x;let w=new XMLHttpRequest;for(let b in w.open(v.method||"GET",v.url,!0),"arrayBuffer"!==v.type&&"image"!==v.type||(w.responseType="arraybuffer"),v.headers)w.setRequestHeader(b,v.headers[b]);"json"===v.type&&(w.responseType="text",(null==(x=v.headers)?void 0:x.Accept)||w.setRequestHeader("Accept","application/json")),w.withCredentials="include"===v.credentials,w.onerror=()=>{_(Error(w.statusText))},w.onload=()=>{if(!b.signal.aborted)if((w.status>=200&&w.status<300||0===w.status)&&null!==w.response){let b=w.response;if("json"===v.type)try{b=JSON.parse(w.response)}catch(v){return void _(v)}y({data:b,cacheControl:w.getResponseHeader("Cache-Control"),expires:w.getResponseHeader("Expires")})}else{let b=new Blob([w.response],{type:w.getResponseHeader("Content-Type")});_(new e4(w.status,w.statusText,v.url,b))}},b.signal.addEventListener("abort",()=>{w.abort(),_(new e0(b.signal.reason))}),w.send(v.body)})};function e7(v){if(!v||0>=v.indexOf("://")||0===v.indexOf("data:image/")||0===v.indexOf("blob:"))return!0;let b=new URL(v),y=window.location;return b.protocol===y.protocol&&b.host===y.host}function e9(v,b,y){y[v]&&-1!==y[v].indexOf(b)||(y[v]=y[v]||[],y[v].push(b))}function te(v,b,y){if(y&&y[v]){let _=y[v].indexOf(b);-1!==_&&y[v].splice(_,1)}}class tt{constructor(v,b={}){eP(this,b),this.type=v}}class tn extends tt{constructor(v,b={}){super("error",eP({error:v},b))}}class ti{on(v,b){return this._listeners=this._listeners||{},e9(v,b,this._listeners),{unsubscribe:()=>{this.off(v,b)}}}off(v,b){return te(v,b,this._listeners),te(v,b,this._oneTimeListeners),this}once(v,b){return b?(this._oneTimeListeners=this._oneTimeListeners||{},e9(v,b,this._oneTimeListeners),this):new Promise(b=>this.once(v,b))}fire(v,b){"string"==typeof v&&(v=new tt(v,b||{}));let y=v.type;if(this.listens(y)){for(let b of(v.target=this,this._listeners&&this._listeners[y]?this._listeners[y].slice():[]))b.call(this,v);for(let b of this._oneTimeListeners&&this._oneTimeListeners[y]?this._oneTimeListeners[y].slice():[])te(y,b,this._oneTimeListeners),b.call(this,v);let b=this._eventedParent;b&&(eP(v,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),b.fire(v))}else v instanceof tn&&console.error(v.error);return this}listens(v){return this._listeners&&this._listeners[v]&&this._listeners[v].length>0||this._oneTimeListeners&&this._oneTimeListeners[v]&&this._oneTimeListeners[v].length>0||this._eventedParent&&this._eventedParent.listens(v)}setEventedParent(v,b){return this._eventedParent=v,this._eventedParentData=b,this}}var tr={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}};let to=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function ta(v,b){if(Array.isArray(v)){if(!Array.isArray(b)||v.length!==b.length)return!1;for(let y=0;y<v.length;y++)if(!ta(v[y],b[y]))return!1;return!0}if("object"==typeof v&&null!==v&&null!==b){if("object"!=typeof b||Object.keys(v).length!==Object.keys(b).length)return!1;for(let y in v)if(!ta(v[y],b[y]))return!1;return!0}return v===b}function ts(v,b){v.push(b)}function tl(v,b,y){ts(y,{command:"addSource",args:[v,b[v]]})}function tc(v,b,y){ts(b,{command:"removeSource",args:[v]}),y[v]=!0}function tu(v,b,y,_,x,w){for(let k in b=b||{},v=v||{})Object.prototype.hasOwnProperty.call(v,k)&&(ta(v[k],b[k])||y.push({command:w,args:[_,k,b[k],x]}));for(let k in b)Object.prototype.hasOwnProperty.call(b,k)&&!Object.prototype.hasOwnProperty.call(v,k)&&(ta(v[k],b[k])||y.push({command:w,args:[_,k,b[k],x]}))}function td(v){return v.id}function th(v,b){return v[b.id]=b,v}class tp{constructor(v,b,y,_){this.message=(v?`${v}: `:"")+y,_&&(this.identifier=_),null!=b&&b.__line__&&(this.line=b.__line__)}}function tf(v,...b){for(let y of b)for(let b in y)v[b]=y[b];return v}class tm extends Error{constructor(v,b){super(b),this.message=b,this.key=v}}class tg{constructor(v,b=[]){for(const[y,_]of(this.parent=v,this.bindings={},b))this.bindings[y]=_}concat(v){return new tg(this,v)}get(v){if(this.bindings[v])return this.bindings[v];if(this.parent)return this.parent.get(v);throw Error(`${v} not found in scope.`)}has(v){return!!this.bindings[v]||!!this.parent&&this.parent.has(v)}}let tv={kind:"null"},tb={kind:"number"},ty={kind:"string"},t_={kind:"boolean"},tx={kind:"color"},tw={kind:"projectionDefinition"},tk={kind:"object"},tA={kind:"value"},tC={kind:"collator"},tE={kind:"formatted"},tS={kind:"padding"},tT={kind:"colorArray"},tO={kind:"numberArray"},tF={kind:"resolvedImage"},tI={kind:"variableAnchorOffsetCollection"};function tM(v,b){return{kind:"array",itemType:v,N:b}}function tR(v){if("array"===v.kind){let b=tR(v.itemType);return"number"==typeof v.N?`array<${b}, ${v.N}>`:"value"===v.itemType.kind?"array":`array<${b}>`}return v.kind}let tD=[tv,tb,ty,t_,tx,tw,tE,tk,tM(tA),tS,tO,tT,tF,tI];function tP(v,b){if("error"===b.kind)return null;if("array"===v.kind){if("array"===b.kind&&(0===b.N&&"value"===b.itemType.kind||!tP(v.itemType,b.itemType))&&("number"!=typeof v.N||v.N===b.N))return null}else{if(v.kind===b.kind)return null;if("value"===v.kind){for(let v of tD)if(!tP(v,b))return null}}return`Expected ${tR(v)} but found ${tR(b)} instead.`}function tL(v,b){return b.some(b=>b.kind===v.kind)}function tN(v,b){return b.some(b=>"null"===b?null===v:"array"===b?Array.isArray(v):"object"===b?v&&!Array.isArray(v)&&"object"==typeof v:b===typeof v)}function tz(v,b){return"array"===v.kind&&"array"===b.kind?v.itemType.kind===b.itemType.kind&&"number"==typeof v.N:v.kind===b.kind}let tj=4/29,tB=6/29,t$=6/29*3*(6/29),tU=6/29*(6/29)*(6/29),tV=Math.PI/180,tq=180/Math.PI;function tH(v){return(v%=360)<0&&(v+=360),v}function tW([v,b,y,_]){let x,w,k=tY((.2225045*(v=tG(v))+.7168786*(b=tG(b))+.0606169*(y=tG(y)))/1);v===b&&b===y?x=w=k:(x=tY((.4360747*v+.3850649*b+.1430804*y)/.96422),w=tY((.0139322*v+.0971045*b+.7141733*y)/.82521));let A=116*k-16;return[A<0?0:A,500*(x-k),200*(k-w),_]}function tG(v){return v<=.04045?v/12.92:Math.pow((v+.055)/1.055,2.4)}function tY(v){return v>tU?Math.pow(v,1/3):v/t$+tj}function tZ([v,b,y,_]){let x=(v+16)/116,w=isNaN(b)?x:x+b/500,k=isNaN(y)?x:x-y/200;return x=+tK(x),[tX(3.1338561*(w=.96422*tK(w))-1.6168667*x-.4906146*(k=.82521*tK(k))),tX(-.9787684*w+1.9161415*x+.033454*k),tX(.0719453*w-.2289914*x+1.4052427*k),_]}function tX(v){return(v=v<=.00304?12.92*v:1.055*Math.pow(v,1/2.4)-.055)<0?0:v>1?1:v}function tK(v){return v>tB?v*v*v:t$*(v-tj)}let tJ=Object.hasOwn||function(v,b){return Object.prototype.hasOwnProperty.call(v,b)};function tQ(v,b){return tJ(v,b)?v[b]:void 0}function t0(v){return parseInt(v.padEnd(2,v),16)/255}function t1(v,b){return t2(b?v/100:v,0,1)}function t2(v,b,y){return Math.min(Math.max(b,v),y)}function t5(v){return!v.some(Number.isNaN)}let t3={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function t4(v,b,y){return v.map((v,_)=>v+y*(b[_]-v))}class t6{constructor(v,b,y,_=1,x=!0){this.r=v,this.g=b,this.b=y,this.a=_,x||(this.r*=_,this.g*=_,this.b*=_,_||this.overwriteGetter("rgb",[v,b,y,_]))}static parse(v){if(v instanceof t6)return v;if("string"!=typeof v)return;let b=function(v){if("transparent"===(v=v.toLowerCase().trim()))return[0,0,0,0];let b=tQ(t3,v);if(b){let[v,y,_]=b;return[v/255,y/255,_/255,1]}if(v.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(v)){let b=v.length<6?1:2,y=1;return[t0(v.slice(y,y+=b)),t0(v.slice(y,y+=b)),t0(v.slice(y,y+=b)),t0(v.slice(y,y+b)||"ff")]}if(v.startsWith("rgb")){let b=v.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(b){let[v,y,_,x,w,k,A,C,E,S,T,O]=b,F=[x||" ",A||" ",S].join("");if(" "===F||" /"===F||",,"===F||",,,"===F){let v=[_,k,E].join(""),b="%%%"===v?100:255*(""===v);if(b){let v=[t2(y/b,0,1),t2(w/b,0,1),t2(C/b,0,1),T?t1(+T,O):1];if(t5(v))return v}}return}}let y=v.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(y){let[v,b,_,x,w,k,A,C,E]=y,S=[_||" ",w||" ",A].join("");if(" "===S||" /"===S||",,"===S||",,,"===S){let v=[+b,t2(+x,0,100),t2(+k,0,100),C?t1(+C,E):1];if(t5(v))return function([v,b,y,_]){function x(_){let x=(_+v/30)%12,w=b*Math.min(y,1-y);return y-w*Math.max(-1,Math.min(x-3,9-x,1))}return v=tH(v),b/=100,y/=100,[x(0),x(8),x(4),_]}(v)}}}(v);return b?new t6(...b,!1):void 0}get rgb(){let{r:v,g:b,b:y,a:_}=this,x=_||1/0;return this.overwriteGetter("rgb",[v/x,b/x,y/x,_])}get hcl(){return this.overwriteGetter("hcl",function(v){let[b,y,_,x]=tW(v),w=Math.sqrt(y*y+_*_);return[Math.round(1e4*w)?tH(Math.atan2(_,y)*tq):0/0,w,b,x]}(this.rgb))}get lab(){return this.overwriteGetter("lab",tW(this.rgb))}overwriteGetter(v,b){return Object.defineProperty(this,v,{value:b}),b}toString(){let[v,b,y,_]=this.rgb;return`rgba(${[v,b,y].map(v=>Math.round(255*v)).join(",")},${_})`}static interpolate(v,b,y,_="rgb"){switch(_){case"rgb":{let[_,x,w,k]=t4(v.rgb,b.rgb,y);return new t6(_,x,w,k,!1)}case"hcl":{let _,x,[w,k,A,C]=v.hcl,[E,S,T,O]=b.hcl;if(isNaN(w)||isNaN(E))isNaN(w)?isNaN(E)?_=0/0:(_=E,1!==A&&0!==A||(x=S)):(_=w,1!==T&&0!==T||(x=k));else{let v=E-w;E>w&&v>180?v-=360:E<w&&w-E>180&&(v+=360),_=w+y*v}let[F,I,M,R]=function([v,b,y,_]){return tZ([y,Math.cos(v=isNaN(v)?0:v*tV)*b,Math.sin(v)*b,_])}([_,null!=x?x:k+y*(S-k),A+y*(T-A),C+y*(O-C)]);return new t6(F,I,M,R,!1)}case"lab":{let[_,x,w,k]=tZ(t4(v.lab,b.lab,y));return new t6(_,x,w,k,!1)}}}}t6.black=new t6(0,0,0,1),t6.white=new t6(1,1,1,1),t6.transparent=new t6(0,0,0,0),t6.red=new t6(1,0,0,1);class t8{constructor(v,b,y){this.sensitivity=v?b?"variant":"case":b?"accent":"base",this.locale=y,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(v,b){return this.collator.compare(v,b)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}let t7=["bottom","center","top"];class t9{constructor(v,b,y,_,x,w){this.text=v,this.image=b,this.scale=y,this.fontStack=_,this.textColor=x,this.verticalAlign=w}}class ne{constructor(v){this.sections=v}static fromString(v){return new ne([new t9(v,null,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(v=>0!==v.text.length||v.image&&0!==v.image.name.length)}static factory(v){return v instanceof ne?v:ne.fromString(v)}toString(){return 0===this.sections.length?"":this.sections.map(v=>v.text).join("")}}class nt{constructor(v){this.values=v.slice()}static parse(v){if(v instanceof nt)return v;if("number"==typeof v)return new nt([v,v,v,v]);if(Array.isArray(v)&&!(v.length<1||v.length>4)){for(let b of v)if("number"!=typeof b)return;switch(v.length){case 1:v=[v[0],v[0],v[0],v[0]];break;case 2:v=[v[0],v[1],v[0],v[1]];break;case 3:v=[v[0],v[1],v[2],v[1]]}return new nt(v)}}toString(){return JSON.stringify(this.values)}static interpolate(v,b,y){return new nt(t4(v.values,b.values,y))}}class nn{constructor(v){this.values=v.slice()}static parse(v){if(v instanceof nn)return v;if("number"==typeof v)return new nn([v]);if(Array.isArray(v)){for(let b of v)if("number"!=typeof b)return;return new nn(v)}}toString(){return JSON.stringify(this.values)}static interpolate(v,b,y){return new nn(t4(v.values,b.values,y))}}class ni{constructor(v){this.values=v.slice()}static parse(v){if(v instanceof ni)return v;if("string"==typeof v){let b=t6.parse(v);if(!b)return;return new ni([b])}if(!Array.isArray(v))return;let b=[];for(let y of v){if("string"!=typeof y)return;let v=t6.parse(y);if(!v)return;b.push(v)}return new ni(b)}toString(){return JSON.stringify(this.values)}static interpolate(v,b,y,_="rgb"){let x=[];if(v.values.length!=b.values.length)throw Error(`colorArray: Arrays have mismatched length (${v.values.length} vs. ${b.values.length}), cannot interpolate.`);for(let w=0;w<v.values.length;w++)x.push(t6.interpolate(v.values[w],b.values[w],y,_));return new ni(x)}}class nr extends Error{constructor(v){super(v),this.name="RuntimeError"}toJSON(){return this.message}}let no=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class na{constructor(v){this.values=v.slice()}static parse(v){if(v instanceof na)return v;if(Array.isArray(v)&&!(v.length<1)&&v.length%2==0){for(let b=0;b<v.length;b+=2){let y=v[b],_=v[b+1];if("string"!=typeof y||!no.has(y)||!Array.isArray(_)||2!==_.length||"number"!=typeof _[0]||"number"!=typeof _[1])return}return new na(v)}}toString(){return JSON.stringify(this.values)}static interpolate(v,b,y){let _=v.values,x=b.values;if(_.length!==x.length)throw new nr(`Cannot interpolate values of different length. from: ${v.toString()}, to: ${b.toString()}`);let w=[];for(let v=0;v<_.length;v+=2){if(_[v]!==x[v])throw new nr(`Cannot interpolate values containing mismatched anchors. from[${v}]: ${_[v]}, to[${v}]: ${x[v]}`);w.push(_[v]);let[b,k]=_[v+1],[A,C]=x[v+1];w.push([b+y*(A-b),k+y*(C-k)])}return new na(w)}}class ns{constructor(v){this.name=v.name,this.available=v.available}toString(){return this.name}static fromString(v){return v?new ns({name:v,available:!1}):null}}class nl{constructor(v,b,y){this.from=v,this.to=b,this.transition=y}static interpolate(v,b,y){return new nl(v,b,y)}static parse(v){return v instanceof nl?v:Array.isArray(v)&&3===v.length&&"string"==typeof v[0]&&"string"==typeof v[1]&&"number"==typeof v[2]?new nl(v[0],v[1],v[2]):"object"==typeof v&&"string"==typeof v.from&&"string"==typeof v.to&&"number"==typeof v.transition?new nl(v.from,v.to,v.transition):"string"==typeof v?new nl(v,v,1):void 0}}function nc(v,b,y,_){return"number"==typeof v&&v>=0&&v<=255&&"number"==typeof b&&b>=0&&b<=255&&"number"==typeof y&&y>=0&&y<=255?void 0===_||"number"==typeof _&&_>=0&&_<=1?null:`Invalid rgba value [${[v,b,y,_].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof _?[v,b,y,_]:[v,b,y]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function nu(v){if(null===v||"string"==typeof v||"boolean"==typeof v||"number"==typeof v||v instanceof nl||v instanceof t6||v instanceof t8||v instanceof ne||v instanceof nt||v instanceof nn||v instanceof ni||v instanceof na||v instanceof ns)return!0;if(Array.isArray(v)){for(let b of v)if(!nu(b))return!1;return!0}if("object"==typeof v){for(let b in v)if(!nu(v[b]))return!1;return!0}return!1}function nd(v){if(null===v)return tv;if("string"==typeof v)return ty;if("boolean"==typeof v)return t_;if("number"==typeof v)return tb;if(v instanceof t6)return tx;if(v instanceof nl)return tw;if(v instanceof t8)return tC;if(v instanceof ne)return tE;if(v instanceof nt)return tS;if(v instanceof nn)return tO;if(v instanceof ni)return tT;if(v instanceof na)return tI;if(v instanceof ns)return tF;if(Array.isArray(v)){let b,y=v.length;for(let y of v){let v=nd(y);if(b){if(b===v)continue;b=tA;break}b=v}return tM(b||tA,y)}return tk}function nh(v){let b=typeof v;return null===v?"":"string"===b||"number"===b||"boolean"===b?String(v):v instanceof t6||v instanceof nl||v instanceof ne||v instanceof nt||v instanceof nn||v instanceof ni||v instanceof na||v instanceof ns?v.toString():JSON.stringify(v)}class np{constructor(v,b){this.type=v,this.value=b}static parse(v,b){if(2!==v.length)return b.error(`'literal' expression requires exactly one argument, but found ${v.length-1} instead.`);if(!nu(v[1]))return b.error("invalid value");let y=v[1],_=nd(y),x=b.expectedType;return"array"===_.kind&&0===_.N&&x&&"array"===x.kind&&("number"!=typeof x.N||0===x.N)&&(_=x),new np(_,y)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}let nf={string:ty,number:tb,boolean:t_,object:tk};class nm{constructor(v,b){this.type=v,this.args=b}static parse(v,b){if(v.length<2)return b.error("Expected at least one argument.");let y,_=1,x=v[0];if("array"===x){let x,w;if(v.length>2){let y=v[1];if("string"!=typeof y||!(y in nf)||"object"===y)return b.error('The item type argument of "array" must be one of string, number, boolean',1);x=nf[y],_++}else x=tA;if(v.length>3){if(null!==v[2]&&("number"!=typeof v[2]||v[2]<0||v[2]!==Math.floor(v[2])))return b.error('The length argument to "array" must be a positive integer literal',2);w=v[2],_++}y=tM(x,w)}else{if(!nf[x])throw Error(`Types doesn't contain name = ${x}`);y=nf[x]}let w=[];for(;_<v.length;_++){let y=b.parse(v[_],_,tA);if(!y)return null;w.push(y)}return new nm(y,w)}evaluate(v){for(let b=0;b<this.args.length;b++){let y=this.args[b].evaluate(v);if(!tP(this.type,nd(y)))return y;if(b===this.args.length-1)throw new nr(`Expected value to be of type ${tR(this.type)}, but found ${tR(nd(y))} instead.`)}throw Error()}eachChild(v){this.args.forEach(v)}outputDefined(){return this.args.every(v=>v.outputDefined())}}let ng={"to-boolean":t_,"to-color":tx,"to-number":tb,"to-string":ty};class nv{constructor(v,b){this.type=v,this.args=b}static parse(v,b){if(v.length<2)return b.error("Expected at least one argument.");let y=v[0];if(!ng[y])throw Error(`Can't parse ${y} as it is not part of the known types`);if(("to-boolean"===y||"to-string"===y)&&2!==v.length)return b.error("Expected one argument.");let _=ng[y],x=[];for(let y=1;y<v.length;y++){let _=b.parse(v[y],y,tA);if(!_)return null;x.push(_)}return new nv(_,x)}evaluate(v){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(v);case"color":{let b,y;for(let _ of this.args){if(b=_.evaluate(v),y=null,b instanceof t6)return b;if("string"==typeof b){let y=v.parseColor(b);if(y)return y}else if(Array.isArray(b)&&!(y=b.length<3||b.length>4?`Invalid rgba value ${JSON.stringify(b)}: expected an array containing either three or four numeric values.`:nc(b[0],b[1],b[2],b[3])))return new t6(b[0]/255,b[1]/255,b[2]/255,b[3])}throw new nr(y||`Could not parse color from value '${"string"==typeof b?b:JSON.stringify(b)}'`)}case"padding":{let b;for(let y of this.args){b=y.evaluate(v);let _=nt.parse(b);if(_)return _}throw new nr(`Could not parse padding from value '${"string"==typeof b?b:JSON.stringify(b)}'`)}case"numberArray":{let b;for(let y of this.args){b=y.evaluate(v);let _=nn.parse(b);if(_)return _}throw new nr(`Could not parse numberArray from value '${"string"==typeof b?b:JSON.stringify(b)}'`)}case"colorArray":{let b;for(let y of this.args){b=y.evaluate(v);let _=ni.parse(b);if(_)return _}throw new nr(`Could not parse colorArray from value '${"string"==typeof b?b:JSON.stringify(b)}'`)}case"variableAnchorOffsetCollection":{let b;for(let y of this.args){b=y.evaluate(v);let _=na.parse(b);if(_)return _}throw new nr(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof b?b:JSON.stringify(b)}'`)}case"number":{let b=null;for(let y of this.args){if(null===(b=y.evaluate(v)))return 0;let _=Number(b);if(!isNaN(_))return _}throw new nr(`Could not convert ${JSON.stringify(b)} to number.`)}case"formatted":return ne.fromString(nh(this.args[0].evaluate(v)));case"resolvedImage":return ns.fromString(nh(this.args[0].evaluate(v)));case"projectionDefinition":return this.args[0].evaluate(v);default:return nh(this.args[0].evaluate(v))}}eachChild(v){this.args.forEach(v)}outputDefined(){return this.args.every(v=>v.outputDefined())}}let nb=["Unknown","Point","LineString","Polygon"];class ny{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?nb[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(v){let b=this._parseColorCache.get(v);return b||(b=t6.parse(v),this._parseColorCache.set(v,b)),b}}class n_{constructor(v,b,y=[],_,x=new tg,w=[]){this.registry=v,this.path=y,this.key=y.map(v=>`[${v}]`).join(""),this.scope=x,this.errors=w,this.expectedType=_,this._isConstant=b}parse(v,b,y,_,x={}){return b?this.concat(b,y,_)._parse(v,x):this._parse(v,x)}_parse(v,b){function y(v,b,y){return"assert"===y?new nm(b,[v]):"coerce"===y?new nv(b,[v]):v}if(null!==v&&"string"!=typeof v&&"boolean"!=typeof v&&"number"!=typeof v||(v=["literal",v]),Array.isArray(v)){if(0===v.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let _=v[0];if("string"!=typeof _)return this.error(`Expression name must be a string, but found ${typeof _} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let x=this.registry[_];if(x){let _=x.parse(v,this);if(!_)return null;if(this.expectedType){let v=this.expectedType,x=_.type;if("string"!==v.kind&&"number"!==v.kind&&"boolean"!==v.kind&&"object"!==v.kind&&"array"!==v.kind||"value"!==x.kind){if("projectionDefinition"===v.kind&&["string","array"].includes(x.kind)||["color","formatted","resolvedImage"].includes(v.kind)&&["value","string"].includes(x.kind)||["padding","numberArray"].includes(v.kind)&&["value","number","array"].includes(x.kind)||"colorArray"===v.kind&&["value","string","array"].includes(x.kind)||"variableAnchorOffsetCollection"===v.kind&&["value","array"].includes(x.kind))_=y(_,v,b.typeAnnotation||"coerce");else if(this.checkSubtype(v,x))return null}else _=y(_,v,b.typeAnnotation||"assert")}if(!(_ instanceof np)&&"resolvedImage"!==_.type.kind&&this._isConstant(_)){let v=new ny;try{_=new np(_.type,_.evaluate(v))}catch(v){return this.error(v.message),null}}return _}return this.error(`Unknown expression "${_}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===v?"'undefined' value invalid. Use null instead.":"object"==typeof v?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof v} instead.`)}concat(v,b,y){let _="number"==typeof v?this.path.concat(v):this.path,x=y?this.scope.concat(y):this.scope;return new n_(this.registry,this._isConstant,_,b||null,x,this.errors)}error(v,...b){let y=`${this.key}${b.map(v=>`[${v}]`).join("")}`;this.errors.push(new tm(y,v))}checkSubtype(v,b){let y=tP(v,b);return y&&this.error(y),y}}class nx{constructor(v,b){this.type=b.type,this.bindings=[].concat(v),this.result=b}evaluate(v){return this.result.evaluate(v)}eachChild(v){for(let b of this.bindings)v(b[1]);v(this.result)}static parse(v,b){if(v.length<4)return b.error(`Expected at least 3 arguments, but found ${v.length-1} instead.`);let y=[];for(let _=1;_<v.length-1;_+=2){let x=v[_];if("string"!=typeof x)return b.error(`Expected string, but found ${typeof x} instead.`,_);if(/[^a-zA-Z0-9_]/.test(x))return b.error("Variable names must contain only alphanumeric characters or '_'.",_);let w=b.parse(v[_+1],_+1);if(!w)return null;y.push([x,w])}let _=b.parse(v[v.length-1],v.length-1,b.expectedType,y);return _?new nx(y,_):null}outputDefined(){return this.result.outputDefined()}}class nw{constructor(v,b){this.type=b.type,this.name=v,this.boundExpression=b}static parse(v,b){if(2!==v.length||"string"!=typeof v[1])return b.error("'var' expression requires exactly one string literal argument.");let y=v[1];return b.scope.has(y)?new nw(y,b.scope.get(y)):b.error(`Unknown variable "${y}". Make sure "${y}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(v){return this.boundExpression.evaluate(v)}eachChild(){}outputDefined(){return!1}}function nk(v,b){let y=v.length-1,_,x,w=0,k=y,A=0;for(;w<=k;)if(_=v[A=Math.floor((w+k)/2)],x=v[A+1],_<=b){if(A===y||b<x)return A;w=A+1}else{if(!(_>b))throw new nr("Input is not a number.");k=A-1}return 0}class nA{constructor(v,b,y){for(const[_,x]of(this.type=v,this.input=b,this.labels=[],this.outputs=[],y))this.labels.push(_),this.outputs.push(x)}static parse(v,b){if(v.length-1<4)return b.error(`Expected at least 4 arguments, but found only ${v.length-1}.`);if((v.length-1)%2!=0)return b.error("Expected an even number of arguments.");let y=b.parse(v[1],1,tb);if(!y)return null;let _=[],x=null;b.expectedType&&"value"!==b.expectedType.kind&&(x=b.expectedType);for(let y=1;y<v.length;y+=2){let w=1===y?-1/0:v[y],k=v[y+1],A=y,C=y+1;if("number"!=typeof w)return b.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',A);if(_.length&&_[_.length-1][0]>=w)return b.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',A);let E=b.parse(k,C,x);if(!E)return null;x=x||E.type,_.push([w,E])}return new nA(x,y,_)}evaluate(v){let b=this.labels,y=this.outputs;if(1===b.length)return y[0].evaluate(v);let _=this.input.evaluate(v);if(_<=b[0])return y[0].evaluate(v);let x=b.length;return _>=b[x-1]?y[x-1].evaluate(v):y[nk(b,_)].evaluate(v)}eachChild(v){for(let b of(v(this.input),this.outputs))v(b)}outputDefined(){return this.outputs.every(v=>v.outputDefined())}}var nC,nE,nS,nT,nO,nF,nI=(nT=function(){if(nF)return nO;function v(v,b,y,_){this.cx=3*v,this.bx=3*(y-v)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*b,this.by=3*(_-b)-this.cy,this.ay=1-this.cy-this.by,this.p1x=v,this.p1y=b,this.p2x=y,this.p2y=_}return nF=1,nO=v,v.prototype={sampleCurveX:function(v){return((this.ax*v+this.bx)*v+this.cx)*v},sampleCurveY:function(v){return((this.ay*v+this.by)*v+this.cy)*v},sampleCurveDerivativeX:function(v){return(3*this.ax*v+2*this.bx)*v+this.cx},solveCurveX:function(v,b){if(void 0===b&&(b=1e-6),v<0)return 0;if(v>1)return 1;for(var y=v,_=0;_<8;_++){var x=this.sampleCurveX(y)-v;if(Math.abs(x)<b)return y;var w=this.sampleCurveDerivativeX(y);if(1e-6>Math.abs(w))break;y-=x/w}var k=0,A=1;for(y=v,_=0;_<20&&!(Math.abs((x=this.sampleCurveX(y))-v)<b);_++)v>x?k=y:A=y,y=.5*(A-k)+k;return y},solve:function(v,b){return this.sampleCurveY(this.solveCurveX(v,b))}},nO}())&&nT.__esModule&&Object.prototype.hasOwnProperty.call(nT,"default")?nT.default:nT;class nM{constructor(v,b,y,_,x){for(const[w,k]of(this.type=v,this.operator=b,this.interpolation=y,this.input=_,this.labels=[],this.outputs=[],x))this.labels.push(w),this.outputs.push(k)}static interpolationFactor(v,b,y,_){let x=0;if("exponential"===v.name)x=nR(b,v.base,y,_);else if("linear"===v.name)x=nR(b,1,y,_);else if("cubic-bezier"===v.name){let w=v.controlPoints;x=new nI(w[0],w[1],w[2],w[3]).solve(nR(b,1,y,_))}return x}static parse(v,b){let[y,_,x,...w]=v;if(!Array.isArray(_)||0===_.length)return b.error("Expected an interpolation type expression.",1);if("linear"===_[0])_={name:"linear"};else if("exponential"===_[0]){let v=_[1];if("number"!=typeof v)return b.error("Exponential interpolation requires a numeric base.",1,1);_={name:"exponential",base:v}}else{if("cubic-bezier"!==_[0])return b.error(`Unknown interpolation type ${String(_[0])}`,1,0);{let v=_.slice(1);if(4!==v.length||v.some(v=>"number"!=typeof v||v<0||v>1))return b.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);_={name:"cubic-bezier",controlPoints:v}}}if(v.length-1<4)return b.error(`Expected at least 4 arguments, but found only ${v.length-1}.`);if((v.length-1)%2!=0)return b.error("Expected an even number of arguments.");if(!(x=b.parse(x,2,tb)))return null;let k=[],A=null;"interpolate-hcl"!==y&&"interpolate-lab"!==y||b.expectedType==tT?b.expectedType&&"value"!==b.expectedType.kind&&(A=b.expectedType):A=tx;for(let v=0;v<w.length;v+=2){let y=w[v],_=w[v+1],x=v+3,C=v+4;if("number"!=typeof y)return b.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',x);if(k.length&&k[k.length-1][0]>=y)return b.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',x);let E=b.parse(_,C,A);if(!E)return null;A=A||E.type,k.push([y,E])}return tz(A,tb)||tz(A,tw)||tz(A,tx)||tz(A,tS)||tz(A,tO)||tz(A,tT)||tz(A,tI)||tz(A,tM(tb))?new nM(A,y,_,x,k):b.error(`Type ${tR(A)} is not interpolatable.`)}evaluate(v){let b=this.labels,y=this.outputs;if(1===b.length)return y[0].evaluate(v);let _=this.input.evaluate(v);if(_<=b[0])return y[0].evaluate(v);let x=b.length;if(_>=b[x-1])return y[x-1].evaluate(v);let w=nk(b,_),k=nM.interpolationFactor(this.interpolation,_,b[w],b[w+1]),A=y[w].evaluate(v),C=y[w+1].evaluate(v);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return A+k*(C-A);case"color":return t6.interpolate(A,C,k);case"padding":return nt.interpolate(A,C,k);case"colorArray":return ni.interpolate(A,C,k);case"numberArray":return nn.interpolate(A,C,k);case"variableAnchorOffsetCollection":return na.interpolate(A,C,k);case"array":return t4(A,C,k);case"projectionDefinition":return nl.interpolate(A,C,k)}case"interpolate-hcl":switch(this.type.kind){case"color":return t6.interpolate(A,C,k,"hcl");case"colorArray":return ni.interpolate(A,C,k,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return t6.interpolate(A,C,k,"lab");case"colorArray":return ni.interpolate(A,C,k,"lab")}}}eachChild(v){for(let b of(v(this.input),this.outputs))v(b)}outputDefined(){return this.outputs.every(v=>v.outputDefined())}}function nR(v,b,y,_){let x=_-y,w=v-y;return 0===x?0:1===b?w/x:(Math.pow(b,w)-1)/(Math.pow(b,x)-1)}let nD={color:t6.interpolate,number:function(v,b,y){return v+y*(b-v)},padding:nt.interpolate,numberArray:nn.interpolate,colorArray:ni.interpolate,variableAnchorOffsetCollection:na.interpolate,array:t4};class nP{constructor(v,b){this.type=v,this.args=b}static parse(v,b){if(v.length<2)return b.error("Expected at least one argument.");let y=null,_=b.expectedType;_&&"value"!==_.kind&&(y=_);let x=[];for(let _ of v.slice(1)){let v=b.parse(_,1+x.length,y,void 0,{typeAnnotation:"omit"});if(!v)return null;y=y||v.type,x.push(v)}if(!y)throw Error("No output type");return new nP(_&&x.some(v=>tP(_,v.type))?tA:y,x)}evaluate(v){let b,y=null,_=0;for(let x of this.args)if(_++,(y=x.evaluate(v))&&y instanceof ns&&!y.available&&(b||(b=y.name),y=null,_===this.args.length&&(y=b)),null!==y)break;return y}eachChild(v){this.args.forEach(v)}outputDefined(){return this.args.every(v=>v.outputDefined())}}function nL(v,b){return"=="===v||"!="===v?"boolean"===b.kind||"string"===b.kind||"number"===b.kind||"null"===b.kind||"value"===b.kind:"string"===b.kind||"number"===b.kind||"value"===b.kind}function nN(v,b,y,_){return 0===_.compare(b,y)}function nz(v,b,y){let _="=="!==v&&"!="!==v;return class x{constructor(v,b,y){this.type=t_,this.lhs=v,this.rhs=b,this.collator=y,this.hasUntypedArgument="value"===v.type.kind||"value"===b.type.kind}static parse(v,b){if(3!==v.length&&4!==v.length)return b.error("Expected two or three arguments.");let y=v[0],w=b.parse(v[1],1,tA);if(!w)return null;if(!nL(y,w.type))return b.concat(1).error(`"${y}" comparisons are not supported for type '${tR(w.type)}'.`);let k=b.parse(v[2],2,tA);if(!k)return null;if(!nL(y,k.type))return b.concat(2).error(`"${y}" comparisons are not supported for type '${tR(k.type)}'.`);if(w.type.kind!==k.type.kind&&"value"!==w.type.kind&&"value"!==k.type.kind)return b.error(`Cannot compare types '${tR(w.type)}' and '${tR(k.type)}'.`);_&&("value"===w.type.kind&&"value"!==k.type.kind?w=new nm(k.type,[w]):"value"!==w.type.kind&&"value"===k.type.kind&&(k=new nm(w.type,[k])));let A=null;if(4===v.length){if("string"!==w.type.kind&&"string"!==k.type.kind&&"value"!==w.type.kind&&"value"!==k.type.kind)return b.error("Cannot use collator to compare non-string types.");if(!(A=b.parse(v[3],3,tC)))return null}return new x(w,k,A)}evaluate(x){let w=this.lhs.evaluate(x),k=this.rhs.evaluate(x);if(_&&this.hasUntypedArgument){let b=nd(w),y=nd(k);if(b.kind!==y.kind||"string"!==b.kind&&"number"!==b.kind)throw new nr(`Expected arguments for "${v}" to be (string, string) or (number, number), but found (${b.kind}, ${y.kind}) instead.`)}if(this.collator&&!_&&this.hasUntypedArgument){let v=nd(w),y=nd(k);if("string"!==v.kind||"string"!==y.kind)return b(x,w,k)}return this.collator?y(x,w,k,this.collator.evaluate(x)):b(x,w,k)}eachChild(v){v(this.lhs),v(this.rhs),this.collator&&v(this.collator)}outputDefined(){return!0}}}let nj=nz("==",function(v,b,y){return b===y},nN),nB=nz("!=",function(v,b,y){return b!==y},function(v,b,y,_){return!nN(0,b,y,_)}),n$=nz("<",function(v,b,y){return b<y},function(v,b,y,_){return 0>_.compare(b,y)}),nU=nz(">",function(v,b,y){return b>y},function(v,b,y,_){return _.compare(b,y)>0}),nV=nz("<=",function(v,b,y){return b<=y},function(v,b,y,_){return 0>=_.compare(b,y)}),nq=nz(">=",function(v,b,y){return b>=y},function(v,b,y,_){return _.compare(b,y)>=0});class nH{constructor(v,b,y){this.type=tC,this.locale=y,this.caseSensitive=v,this.diacriticSensitive=b}static parse(v,b){if(2!==v.length)return b.error("Expected one argument.");let y=v[1];if("object"!=typeof y||Array.isArray(y))return b.error("Collator options argument must be an object.");let _=b.parse(void 0!==y["case-sensitive"]&&y["case-sensitive"],1,t_);if(!_)return null;let x=b.parse(void 0!==y["diacritic-sensitive"]&&y["diacritic-sensitive"],1,t_);if(!x)return null;let w=null;return!y.locale||(w=b.parse(y.locale,1,ty))?new nH(_,x,w):null}evaluate(v){return new t8(this.caseSensitive.evaluate(v),this.diacriticSensitive.evaluate(v),this.locale?this.locale.evaluate(v):null)}eachChild(v){v(this.caseSensitive),v(this.diacriticSensitive),this.locale&&v(this.locale)}outputDefined(){return!1}}class nW{constructor(v){this.type=tE,this.sections=v}static parse(v,b){if(v.length<2)return b.error("Expected at least one argument.");let y=v[1];if(!Array.isArray(y)&&"object"==typeof y)return b.error("First argument must be an image or text section.");let _=[],x=!1;for(let y=1;y<=v.length-1;++y){let w=v[y];if(x&&"object"==typeof w&&!Array.isArray(w)){x=!1;let v=null;if(w["font-scale"]&&!(v=b.parse(w["font-scale"],1,tb)))return null;let y=null;if(w["text-font"]&&!(y=b.parse(w["text-font"],1,tM(ty))))return null;let k=null;if(w["text-color"]&&!(k=b.parse(w["text-color"],1,tx)))return null;let A=null;if(w["vertical-align"]){if("string"==typeof w["vertical-align"]&&!t7.includes(w["vertical-align"]))return b.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${w["vertical-align"]}' instead.`);if(!(A=b.parse(w["vertical-align"],1,ty)))return null}let C=_[_.length-1];C.scale=v,C.font=y,C.textColor=k,C.verticalAlign=A}else{let w=b.parse(v[y],1,tA);if(!w)return null;let k=w.type.kind;if("string"!==k&&"value"!==k&&"null"!==k&&"resolvedImage"!==k)return b.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");x=!0,_.push({content:w,scale:null,font:null,textColor:null,verticalAlign:null})}}return new nW(_)}evaluate(v){return new ne(this.sections.map(b=>{let y=b.content.evaluate(v);return nd(y)===tF?new t9("",y,null,null,null,b.verticalAlign?b.verticalAlign.evaluate(v):null):new t9(nh(y),null,b.scale?b.scale.evaluate(v):null,b.font?b.font.evaluate(v).join(","):null,b.textColor?b.textColor.evaluate(v):null,b.verticalAlign?b.verticalAlign.evaluate(v):null)}))}eachChild(v){for(let b of this.sections)v(b.content),b.scale&&v(b.scale),b.font&&v(b.font),b.textColor&&v(b.textColor),b.verticalAlign&&v(b.verticalAlign)}outputDefined(){return!1}}function nG(v,b){let y=Math.pow(2,b.z);return[360*((v[0]/8192+b.x)/y)-180,360/Math.PI*Math.atan(Math.exp((180-360*((v[1]/8192+b.y)/y))*Math.PI/180))-90]}function nY(v,b){v[0]=Math.min(v[0],b[0]),v[1]=Math.min(v[1],b[1]),v[2]=Math.max(v[2],b[0]),v[3]=Math.max(v[3],b[1])}function nZ(v,b){return!(v[0]<=b[0]||v[2]>=b[2]||v[1]<=b[1]||v[3]>=b[3])}function nX(v,b,y,_){var x,w;return 0!=(x=[_[0]-y[0],_[1]-y[1]])[0]*(w=[b[0]-v[0],b[1]-v[1]])[1]-x[1]*w[0]&&!(!nQ(v,b,y,_)||!nQ(y,_,v,b))}function nK(v,b,y=!1){var _,x;let w=!1;for(let k of b)for(let b=0;b<k.length-1;b++){if(function(v,b,y){let _=v[0]-b[0],x=v[1]-b[1],w=v[0]-y[0],k=v[1]-y[1];return _*k-w*x==0&&_*w<=0&&x*k<=0}(v,k[b],k[b+1]))return y;(_=k[b])[1]>v[1]!=(x=k[b+1])[1]>v[1]&&v[0]<(x[0]-_[0])*(v[1]-_[1])/(x[1]-_[1])+_[0]&&(w=!w)}return w}function nJ(v,b){for(let y of v)if(!nK(y,b))return!1;for(let y=0;y<v.length-1;++y)if(function(v,b,y){for(let _ of y)for(let y=0;y<_.length-1;++y)if(nX(v,b,_[y],_[y+1]))return!0;return!1}(v[y],v[y+1],b))return!1;return!0}function nQ(v,b,y,_){let x=_[0]-y[0],w=_[1]-y[1],k=(v[0]-y[0])*w-x*(v[1]-y[1]),A=(b[0]-y[0])*w-x*(b[1]-y[1]);return k>0&&A<0||k<0&&A>0}function n0(v,b,y){let _=[];for(let x=0;x<v.length;x++){let w=[];for(let _=0;_<v[x].length;_++){let k=function(v,b){let y=(180+v[0])/360,_=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+v[1]*Math.PI/360)))/360,x=Math.pow(2,b.z);return[Math.round(y*x*8192),Math.round(_*x*8192)]}(v[x][_],y);nY(b,k),w.push(k)}_.push(w)}return _}function n1(v,b,y){let _=[];for(let x=0;x<v.length;x++){let w=n0(v[x],b,y);_.push(w)}return _}function n2(v,b,y,_){if(v[0]<y[0]||v[0]>y[2]){let b=.5*_,x=v[0]-y[0]>b?-_:y[0]-v[0]>b?_:0;0===x&&(x=v[0]-y[2]>b?-_:y[2]-v[0]>b?_:0),v[0]+=x}nY(b,v)}function n5(v,b,y,_){let x=8192*Math.pow(2,_.z),w=[8192*_.x,8192*_.y],k=[];for(let _ of v)for(let v of _){let _=[v.x+w[0],v.y+w[1]];n2(_,b,y,x),k.push(_)}return k}function n3(v,b,y,_){let x=8192*Math.pow(2,_.z),w=[8192*_.x,8192*_.y],k=[];for(let y of v){let v=[];for(let _ of y){let y=[_.x+w[0],_.y+w[1]];nY(b,y),v.push(y)}k.push(v)}if(b[2]-b[0]<=x/2)for(let v of(b[0]=b[1]=1/0,b[2]=b[3]=-1/0,k))for(let _ of v)n2(_,b,y,x);return k}class n4{constructor(v,b){this.type=t_,this.geojson=v,this.geometries=b}static parse(v,b){if(2!==v.length)return b.error(`'within' expression requires exactly one argument, but found ${v.length-1} instead.`);if(nu(v[1])){let b=v[1];if("FeatureCollection"===b.type){let v=[];for(let y of b.features){let{type:b,coordinates:_}=y.geometry;"Polygon"===b&&v.push(_),"MultiPolygon"===b&&v.push(..._)}if(v.length)return new n4(b,{type:"MultiPolygon",coordinates:v})}else if("Feature"===b.type){let v=b.geometry.type;if("Polygon"===v||"MultiPolygon"===v)return new n4(b,b.geometry)}else if("Polygon"===b.type||"MultiPolygon"===b.type)return new n4(b,b)}return b.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(v){if(null!=v.geometry()&&null!=v.canonicalID()){if("Point"===v.geometryType())return function(v,b){let y=[1/0,1/0,-1/0,-1/0],_=[1/0,1/0,-1/0,-1/0],x=v.canonicalID();if("Polygon"===b.type){let w=n0(b.coordinates,_,x),k=n5(v.geometry(),y,_,x);if(!nZ(y,_))return!1;for(let v of k)if(!nK(v,w))return!1}if("MultiPolygon"===b.type){let w=n1(b.coordinates,_,x),k=n5(v.geometry(),y,_,x);if(!nZ(y,_))return!1;for(let v of k)if(!function(v,b){for(let y of b)if(nK(v,y))return!0;return!1}(v,w))return!1}return!0}(v,this.geometries);if("LineString"===v.geometryType())return function(v,b){let y=[1/0,1/0,-1/0,-1/0],_=[1/0,1/0,-1/0,-1/0],x=v.canonicalID();if("Polygon"===b.type){let w=n0(b.coordinates,_,x),k=n3(v.geometry(),y,_,x);if(!nZ(y,_))return!1;for(let v of k)if(!nJ(v,w))return!1}if("MultiPolygon"===b.type){let w=n1(b.coordinates,_,x),k=n3(v.geometry(),y,_,x);if(!nZ(y,_))return!1;for(let v of k)if(!function(v,b){for(let y of b)if(nJ(v,y))return!0;return!1}(v,w))return!1}return!0}(v,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let n6=class{constructor(v=[],b=(v,b)=>v<b?-1:+(v>b)){if(this.data=v,this.length=this.data.length,this.compare=b,this.length>0)for(let v=(this.length>>1)-1;v>=0;v--)this._down(v)}push(v){this.data.push(v),this._up(this.length++)}pop(){if(0===this.length)return;let v=this.data[0],b=this.data.pop();return--this.length>0&&(this.data[0]=b,this._down(0)),v}peek(){return this.data[0]}_up(v){let{data:b,compare:y}=this,_=b[v];for(;v>0;){let x=v-1>>1,w=b[x];if(y(_,w)>=0)break;b[v]=w,v=x}b[v]=_}_down(v){let{data:b,compare:y}=this,_=this.length>>1,x=b[v];for(;v<_;){let _=1+(v<<1),w=_+1;if(w<this.length&&0>y(b[w],b[_])&&(_=w),y(b[_],x)>=0)break;b[v]=b[_],v=_}b[v]=x}};function n8(v,b,y){let _=v[b];v[b]=v[y],v[y]=_}function n7(v,b){let y,_;if(v.length<=1)return[v];let x=[];for(let b of v){let v=function(v){let b=0;for(let y,_,x=0,w=v.length,k=w-1;x<w;k=x++)y=v[x],b+=((_=v[k]).x-y.x)*(y.y+_.y);return b}(b);0!==v&&(b.area=Math.abs(v),void 0===_&&(_=v<0),_===v<0?(y&&x.push(y),y=[b]):y.push(b))}if(y&&x.push(y),b>1)for(let v=0;v<x.length;v++)x[v].length<=b||(function v(b,y,_=0,x=b.length-1,w=function(v,b){return v<b?-1:+(v>b)}){for(;x>_;){if(x-_>600){let k=x-_+1,A=y-_+1,C=Math.log(k),E=.5*Math.exp(2*C/3),S=.5*Math.sqrt(C*E*(k-E)/k)*(A-k/2<0?-1:1);v(b,y,Math.max(_,Math.floor(y-A*E/k+S)),Math.min(x,Math.floor(y+(k-A)*E/k+S)),w)}let k=b[y],A=_,C=x;for(n8(b,_,y),w(b[x],k)>0&&n8(b,_,x);A<C;){for(n8(b,A,C),A++,C--;0>w(b[A],k);)A++;for(;w(b[C],k)>0;)C--}0===w(b[_],k)?n8(b,_,C):n8(b,++C,x),C<=y&&(_=C+1),y<=C&&(x=C-1)}}(x[v],b,1,x[v].length-1,n9),x[v]=x[v].slice(0,b));return x}function n9(v,b){return b.area-v.area}let ie=1/298.257223563*(2-1/298.257223563),it=Math.PI/180;class ii{constructor(v){const b=6378.137*it*1e3,y=Math.cos(v*it),_=1/(1-ie*(1-y*y)),x=Math.sqrt(_);this.kx=b*x*y,this.ky=b*x*_*(1-ie)}distance(v,b){let y=this.wrap(v[0]-b[0])*this.kx,_=(v[1]-b[1])*this.ky;return Math.sqrt(y*y+_*_)}pointOnLine(v,b){let y,_,x,w,k=1/0;for(let A=0;A<v.length-1;A++){let C=v[A][0],E=v[A][1],S=this.wrap(v[A+1][0]-C)*this.kx,T=(v[A+1][1]-E)*this.ky,O=0;0===S&&0===T||((O=(this.wrap(b[0]-C)*this.kx*S+(b[1]-E)*this.ky*T)/(S*S+T*T))>1?(C=v[A+1][0],E=v[A+1][1]):O>0&&(C+=S/this.kx*O,E+=T/this.ky*O));let F=(S=this.wrap(b[0]-C)*this.kx)*S+(T=(b[1]-E)*this.ky)*T;F<k&&(k=F,y=C,_=E,x=A,w=O)}return{point:[y,_],index:x,t:Math.max(0,Math.min(1,w))}}wrap(v){for(;v<-180;)v+=360;for(;v>180;)v-=360;return v}}function ir(v,b){return b[0]-v[0]}function io(v){return v[1]-v[0]+1}function ia(v,b){return v[1]>=v[0]&&v[1]<b}function is(v,b){if(v[0]>v[1])return[null,null];let y=io(v);if(b){if(2===y)return[v,null];let b=Math.floor(y/2);return[[v[0],v[0]+b],[v[0]+b,v[1]]]}if(1===y)return[v,null];let _=Math.floor(y/2)-1;return[[v[0],v[0]+_],[v[0]+_+1,v[1]]]}function il(v,b){if(!ia(b,v.length))return[1/0,1/0,-1/0,-1/0];let y=[1/0,1/0,-1/0,-1/0];for(let _=b[0];_<=b[1];++_)nY(y,v[_]);return y}function ic(v){let b=[1/0,1/0,-1/0,-1/0];for(let y of v)for(let v of y)nY(b,v);return b}function iu(v){return -1/0!==v[0]&&-1/0!==v[1]&&1/0!==v[2]&&1/0!==v[3]}function id(v,b,y){if(!iu(v)||!iu(b))return 0/0;let _=0,x=0;return v[2]<b[0]&&(_=b[0]-v[2]),v[0]>b[2]&&(_=v[0]-b[2]),v[1]>b[3]&&(x=v[1]-b[3]),v[3]<b[1]&&(x=b[1]-v[3]),y.distance([0,0],[_,x])}function ih(v,b,y){let _=y.pointOnLine(b,v);return y.distance(v,_.point)}function ip(v,b,y,_,x){return Math.min(Math.min(ih(v,[y,_],x),ih(b,[y,_],x)),Math.min(ih(y,[v,b],x),ih(_,[v,b],x)))}function im(v,b){for(let y of v)for(let v of y)if(nK(v,b,!0))return!0;return!1}function ig(v,b,y,_,x,w){if(!w)return;let k=id(il(_,w),x,y);k<b&&v.push([k,w,[0,0]])}function iv(v,b,y,_,x,w,k){if(!w||!k)return;let A=id(il(_,w),il(x,k),y);A<b&&v.push([A,w,k])}function ib(v,b,y,_,x=1/0){let w=Math.min(_.distance(v[0],y[0][0]),x);if(0===w)return w;let k=new n6([[0,[0,v.length-1],[0,0]]],ir),A=ic(y);for(;k.length>0;){let x=k.pop();if(x[0]>=w)continue;let C=x[1],E=b?50:100;if(io(C)<=E){if(!ia(C,v.length))return 0/0;if(b){let b=function(v,b,y,_){if(!ia(b,v.length))return 0/0;for(let _=b[0];_<=b[1];++_)if(nK(v[_],y,!0))return 0;let x=1/0;for(let w=b[0];w<b[1];++w){let b=v[w],k=v[w+1];for(let v of y)for(let y=0,w=v.length,A=w-1;y<w;A=y++){let w=v[A],C=v[y];if(nX(b,k,w,C))return 0;x=Math.min(x,ip(b,k,w,C,_))}}return x}(v,C,y,_);if(isNaN(b)||0===b)return b;w=Math.min(w,b)}else for(let b=C[0];b<=C[1];++b)if(0===(w=Math.min(w,function(v,b,y){if(nK(v,b,!0))return 0;let _=1/0;for(let x of b){let b=x[0],w=x[x.length-1];if(b!==w&&0===(_=Math.min(_,ih(v,[w,b],y))))break;let k=y.pointOnLine(x,v);if(0===(_=Math.min(_,y.distance(v,k.point))))break}return _}(v[b],y,_))))return 0}else{let y=is(C,b);ig(k,w,_,v,A,y[0]),ig(k,w,_,v,A,y[1])}}return w}function iy(v,b,y,_,x,w=1/0){let k=Math.min(w,x.distance(v[0],y[0]));if(0===k)return k;let A=new n6([[0,[0,v.length-1],[0,y.length-1]]],ir);for(;A.length>0;){let w=A.pop();if(w[0]>=k)continue;let C=w[1],E=w[2],S=b?50:100,T=_?50:100;if(io(C)<=S&&io(E)<=T){let w;if(!ia(C,v.length)&&ia(E,y.length))return 0/0;if(b&&_)k=Math.min(k,function(v,b,y,_,x){if(!ia(b,v.length)||!ia(_,y.length))return 1/0;let w=1/0;for(let k=b[0];k<b[1];++k){let b=v[k],A=v[k+1];for(let v=_[0];v<_[1];++v){let _=y[v],k=y[v+1];if(nX(b,A,_,k))return 0;w=Math.min(w,ip(b,A,_,k,x))}}return w}(v,C,y,E,x));else if(b&&!_){let b=v.slice(C[0],C[1]+1);for(let v=E[0];v<=E[1];++v)if(0===(k=Math.min(k,ih(y[v],b,x))))return k}else if(!b&&_){let b=y.slice(E[0],E[1]+1);for(let y=C[0];y<=C[1];++y)if(0===(k=Math.min(k,ih(v[y],b,x))))return k}else k=Math.min(k,function(v,b,y,_,x){if(!ia(b,v.length)||!ia(_,y.length))return 0/0;let w=1/0;for(let k=b[0];k<=b[1];++k)for(let b=_[0];b<=_[1];++b)if(0===(w=Math.min(w,x.distance(v[k],y[b]))))return w;return w}(v,C,y,E,x))}else{let w=is(C,b),S=is(E,_);iv(A,k,x,v,y,w[0],S[0]),iv(A,k,x,v,y,w[0],S[1]),iv(A,k,x,v,y,w[1],S[0]),iv(A,k,x,v,y,w[1],S[1])}}return k}function i_(v){return"MultiPolygon"===v.type?v.coordinates.map(v=>({type:"Polygon",coordinates:v})):"MultiLineString"===v.type?v.coordinates.map(v=>({type:"LineString",coordinates:v})):"MultiPoint"===v.type?v.coordinates.map(v=>({type:"Point",coordinates:v})):[v]}class ix{constructor(v,b){this.type=tb,this.geojson=v,this.geometries=b}static parse(v,b){if(2!==v.length)return b.error(`'distance' expression requires exactly one argument, but found ${v.length-1} instead.`);if(nu(v[1])){let b=v[1];if("FeatureCollection"===b.type)return new ix(b,b.features.map(v=>i_(v.geometry)).flat());if("Feature"===b.type)return new ix(b,i_(b.geometry));if("type"in b&&"coordinates"in b)return new ix(b,i_(b))}return b.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(v){if(null!=v.geometry()&&null!=v.canonicalID()){if("Point"===v.geometryType())return function(v,b){let y=v.geometry(),_=y.flat().map(b=>nG([b.x,b.y],v.canonical));if(0===y.length)return 0/0;let x=new ii(_[0][1]),w=1/0;for(let v of b){switch(v.type){case"Point":w=Math.min(w,iy(_,!1,[v.coordinates],!1,x,w));break;case"LineString":w=Math.min(w,iy(_,!1,v.coordinates,!0,x,w));break;case"Polygon":w=Math.min(w,ib(_,!1,v.coordinates,x,w))}if(0===w)break}return w}(v,this.geometries);if("LineString"===v.geometryType())return function(v,b){let y=v.geometry(),_=y.flat().map(b=>nG([b.x,b.y],v.canonical));if(0===y.length)return 0/0;let x=new ii(_[0][1]),w=1/0;for(let v of b){switch(v.type){case"Point":w=Math.min(w,iy(_,!0,[v.coordinates],!1,x,w));break;case"LineString":w=Math.min(w,iy(_,!0,v.coordinates,!0,x,w));break;case"Polygon":w=Math.min(w,ib(_,!0,v.coordinates,x,w))}if(0===w)break}return w}(v,this.geometries);if("Polygon"===v.geometryType())return function(v,b){let y=v.geometry();if(0===y.length||0===y[0].length)return 0/0;let _=n7(y,0).map(b=>b.map(b=>b.map(b=>nG([b.x,b.y],v.canonical)))),x=new ii(_[0][0][0][1]),w=1/0;for(let v of b)for(let b of _){switch(v.type){case"Point":w=Math.min(w,ib([v.coordinates],!1,b,x,w));break;case"LineString":w=Math.min(w,ib(v.coordinates,!0,b,x,w));break;case"Polygon":w=Math.min(w,function(v,b,y,_=1/0){let x=ic(v),w=ic(b);if(1/0!==_&&id(x,w,y)>=_)return _;if(nZ(x,w)){if(im(v,b))return 0}else if(im(b,v))return 0;let k=1/0;for(let _ of v)for(let v=0,x=_.length,w=x-1;v<x;w=v++){let x=_[w],A=_[v];for(let v of b)for(let b=0,_=v.length,w=_-1;b<_;w=b++){let _=v[w],C=v[b];if(nX(x,A,_,C))return 0;k=Math.min(k,ip(x,A,_,C,y))}}return k}(b,v.coordinates,x,w))}if(0===w)return w}return w}(v,this.geometries)}return 0/0}eachChild(){}outputDefined(){return!0}}class iw{constructor(v){this.type=tA,this.key=v}static parse(v,b){if(2!==v.length)return b.error(`Expected 1 argument, but found ${v.length-1} instead.`);let y=v[1];return null==y?b.error("Global state property must be defined."):"string"!=typeof y?b.error(`Global state property must be string, but found ${typeof v[1]} instead.`):new iw(y)}evaluate(v){var b;let y=null==(b=v.globals)?void 0:b.globalState;return y&&0!==Object.keys(y).length?tQ(y,this.key):null}eachChild(){}outputDefined(){return!1}}let ik={"==":nj,"!=":nB,">":nU,"<":n$,">=":nq,"<=":nV,array:nm,at:class v{constructor(v,b,y){this.type=v,this.index=b,this.input=y}static parse(b,y){if(3!==b.length)return y.error(`Expected 2 arguments, but found ${b.length-1} instead.`);let _=y.parse(b[1],1,tb),x=y.parse(b[2],2,tM(y.expectedType||tA));return _&&x?new v(x.type.itemType,_,x):null}evaluate(v){let b=this.index.evaluate(v),y=this.input.evaluate(v);if(b<0)throw new nr(`Array index out of bounds: ${b} < 0.`);if(b>=y.length)throw new nr(`Array index out of bounds: ${b} > ${y.length-1}.`);if(b!==Math.floor(b))throw new nr(`Array index must be an integer, but found ${b} instead.`);return y[b]}eachChild(v){v(this.index),v(this.input)}outputDefined(){return!1}},boolean:nm,case:class v{constructor(v,b,y){this.type=v,this.branches=b,this.otherwise=y}static parse(b,y){let _;if(b.length<4)return y.error(`Expected at least 3 arguments, but found only ${b.length-1}.`);if(b.length%2!=0)return y.error("Expected an odd number of arguments.");y.expectedType&&"value"!==y.expectedType.kind&&(_=y.expectedType);let x=[];for(let v=1;v<b.length-1;v+=2){let w=y.parse(b[v],v,t_);if(!w)return null;let k=y.parse(b[v+1],v+1,_);if(!k)return null;x.push([w,k]),_=_||k.type}let w=y.parse(b[b.length-1],b.length-1,_);if(!w)return null;if(!_)throw Error("Can't infer output type");return new v(_,x,w)}evaluate(v){for(let[b,y]of this.branches)if(b.evaluate(v))return y.evaluate(v);return this.otherwise.evaluate(v)}eachChild(v){for(let[b,y]of this.branches)v(b),v(y);v(this.otherwise)}outputDefined(){return this.branches.every(([v,b])=>b.outputDefined())&&this.otherwise.outputDefined()}},coalesce:nP,collator:nH,format:nW,image:class v{constructor(v){this.type=tF,this.input=v}static parse(b,y){if(2!==b.length)return y.error("Expected two arguments.");let _=y.parse(b[1],1,ty);return _?new v(_):y.error("No image name provided.")}evaluate(v){let b=this.input.evaluate(v),y=ns.fromString(b);return y&&v.availableImages&&(y.available=v.availableImages.indexOf(b)>-1),y}eachChild(v){v(this.input)}outputDefined(){return!1}},in:class v{constructor(v,b){this.type=t_,this.needle=v,this.haystack=b}static parse(b,y){if(3!==b.length)return y.error(`Expected 2 arguments, but found ${b.length-1} instead.`);let _=y.parse(b[1],1,tA),x=y.parse(b[2],2,tA);return _&&x?tL(_.type,[t_,ty,tb,tv,tA])?new v(_,x):y.error(`Expected first argument to be of type boolean, string, number or null, but found ${tR(_.type)} instead`):null}evaluate(v){let b=this.needle.evaluate(v),y=this.haystack.evaluate(v);if(!y)return!1;if(!tN(b,["boolean","string","number","null"]))throw new nr(`Expected first argument to be of type boolean, string, number or null, but found ${tR(nd(b))} instead.`);if(!tN(y,["string","array"]))throw new nr(`Expected second argument to be of type array or string, but found ${tR(nd(y))} instead.`);return y.indexOf(b)>=0}eachChild(v){v(this.needle),v(this.haystack)}outputDefined(){return!0}},"index-of":class v{constructor(v,b,y){this.type=tb,this.needle=v,this.haystack=b,this.fromIndex=y}static parse(b,y){if(b.length<=2||b.length>=5)return y.error(`Expected 2 or 3 arguments, but found ${b.length-1} instead.`);let _=y.parse(b[1],1,tA),x=y.parse(b[2],2,tA);if(!_||!x)return null;if(!tL(_.type,[t_,ty,tb,tv,tA]))return y.error(`Expected first argument to be of type boolean, string, number or null, but found ${tR(_.type)} instead`);if(4===b.length){let w=y.parse(b[3],3,tb);return w?new v(_,x,w):null}return new v(_,x)}evaluate(v){let b,y=this.needle.evaluate(v),_=this.haystack.evaluate(v);if(!tN(y,["boolean","string","number","null"]))throw new nr(`Expected first argument to be of type boolean, string, number or null, but found ${tR(nd(y))} instead.`);if(this.fromIndex&&(b=this.fromIndex.evaluate(v)),tN(_,["string"])){let v=_.indexOf(y,b);return -1===v?-1:[..._.slice(0,v)].length}if(tN(_,["array"]))return _.indexOf(y,b);throw new nr(`Expected second argument to be of type array or string, but found ${tR(nd(_))} instead.`)}eachChild(v){v(this.needle),v(this.haystack),this.fromIndex&&v(this.fromIndex)}outputDefined(){return!1}},interpolate:nM,"interpolate-hcl":nM,"interpolate-lab":nM,length:class v{constructor(v){this.type=tb,this.input=v}static parse(b,y){if(2!==b.length)return y.error(`Expected 1 argument, but found ${b.length-1} instead.`);let _=y.parse(b[1],1);return _?"array"!==_.type.kind&&"string"!==_.type.kind&&"value"!==_.type.kind?y.error(`Expected argument of type string or array, but found ${tR(_.type)} instead.`):new v(_):null}evaluate(v){let b=this.input.evaluate(v);if("string"==typeof b)return[...b].length;if(Array.isArray(b))return b.length;throw new nr(`Expected value to be of type string or array, but found ${tR(nd(b))} instead.`)}eachChild(v){v(this.input)}outputDefined(){return!1}},let:nx,literal:np,match:class v{constructor(v,b,y,_,x,w){this.inputType=v,this.type=b,this.input=y,this.cases=_,this.outputs=x,this.otherwise=w}static parse(b,y){let _,x;if(b.length<5)return y.error(`Expected at least 4 arguments, but found only ${b.length-1}.`);if(b.length%2!=1)return y.error("Expected an even number of arguments.");y.expectedType&&"value"!==y.expectedType.kind&&(x=y.expectedType);let w={},k=[];for(let v=2;v<b.length-1;v+=2){let A=b[v],C=b[v+1];Array.isArray(A)||(A=[A]);let E=y.concat(v);if(0===A.length)return E.error("Expected at least one branch label.");for(let v of A){if("number"!=typeof v&&"string"!=typeof v)return E.error("Branch labels must be numbers or strings.");if("number"==typeof v&&Math.abs(v)>Number.MAX_SAFE_INTEGER)return E.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof v&&Math.floor(v)!==v)return E.error("Numeric branch labels must be integer values.");if(_){if(E.checkSubtype(_,nd(v)))return null}else _=nd(v);if(void 0!==w[String(v)])return E.error("Branch labels must be unique.");w[String(v)]=k.length}let S=y.parse(C,v,x);if(!S)return null;x=x||S.type,k.push(S)}let A=y.parse(b[1],1,tA);if(!A)return null;let C=y.parse(b[b.length-1],b.length-1,x);return C?"value"!==A.type.kind&&y.concat(1).checkSubtype(_,A.type)?null:new v(_,x,A,w,k,C):null}evaluate(v){let b=this.input.evaluate(v);return(nd(b)===this.inputType&&this.outputs[this.cases[b]]||this.otherwise).evaluate(v)}eachChild(v){v(this.input),this.outputs.forEach(v),v(this.otherwise)}outputDefined(){return this.outputs.every(v=>v.outputDefined())&&this.otherwise.outputDefined()}},number:nm,"number-format":class v{constructor(v,b,y,_,x){this.type=ty,this.number=v,this.locale=b,this.currency=y,this.minFractionDigits=_,this.maxFractionDigits=x}static parse(b,y){if(3!==b.length)return y.error("Expected two arguments.");let _=y.parse(b[1],1,tb);if(!_)return null;let x=b[2];if("object"!=typeof x||Array.isArray(x))return y.error("NumberFormat options argument must be an object.");let w=null;if(x.locale&&!(w=y.parse(x.locale,1,ty)))return null;let k=null;if(x.currency&&!(k=y.parse(x.currency,1,ty)))return null;let A=null;if(x["min-fraction-digits"]&&!(A=y.parse(x["min-fraction-digits"],1,tb)))return null;let C=null;return!x["max-fraction-digits"]||(C=y.parse(x["max-fraction-digits"],1,tb))?new v(_,w,k,A,C):null}evaluate(v){return new Intl.NumberFormat(this.locale?this.locale.evaluate(v):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(v):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(v):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(v):void 0}).format(this.number.evaluate(v))}eachChild(v){v(this.number),this.locale&&v(this.locale),this.currency&&v(this.currency),this.minFractionDigits&&v(this.minFractionDigits),this.maxFractionDigits&&v(this.maxFractionDigits)}outputDefined(){return!1}},object:nm,slice:class v{constructor(v,b,y,_){this.type=v,this.input=b,this.beginIndex=y,this.endIndex=_}static parse(b,y){if(b.length<=2||b.length>=5)return y.error(`Expected 2 or 3 arguments, but found ${b.length-1} instead.`);let _=y.parse(b[1],1,tA),x=y.parse(b[2],2,tb);if(!_||!x)return null;if(!tL(_.type,[tM(tA),ty,tA]))return y.error(`Expected first argument to be of type array or string, but found ${tR(_.type)} instead`);if(4===b.length){let w=y.parse(b[3],3,tb);return w?new v(_.type,_,x,w):null}return new v(_.type,_,x)}evaluate(v){let b,y=this.input.evaluate(v),_=this.beginIndex.evaluate(v);if(this.endIndex&&(b=this.endIndex.evaluate(v)),tN(y,["string"]))return[...y].slice(_,b).join("");if(tN(y,["array"]))return y.slice(_,b);throw new nr(`Expected first argument to be of type array or string, but found ${tR(nd(y))} instead.`)}eachChild(v){v(this.input),v(this.beginIndex),this.endIndex&&v(this.endIndex)}outputDefined(){return!1}},step:nA,string:nm,"to-boolean":nv,"to-color":nv,"to-number":nv,"to-string":nv,var:nw,within:n4,distance:ix,"global-state":iw};class iA{constructor(v,b,y,_){this.name=v,this.type=b,this._evaluate=y,this.args=_}evaluate(v){return this._evaluate(v,this.args)}eachChild(v){this.args.forEach(v)}outputDefined(){return!1}static parse(v,b){let y=v[0],_=iA.definitions[y];if(!_)return b.error(`Unknown expression "${y}". If you wanted a literal array, use ["literal", [...]].`,0);let x=Array.isArray(_)?_[0]:_.type,w=Array.isArray(_)?[[_[1],_[2]]]:_.overloads,k=w.filter(([b])=>!Array.isArray(b)||b.length===v.length-1),A=null;for(let[_,w]of k){A=new n_(b.registry,iT,b.path,null,b.scope);let k=[],C=!1;for(let b=1;b<v.length;b++){let y=v[b],x=Array.isArray(_)?_[b-1]:_.type,w=A.parse(y,1+k.length,x);if(!w){C=!0;break}k.push(w)}if(!C)if(Array.isArray(_)&&_.length!==k.length)A.error(`Expected ${_.length} arguments, but found ${k.length} instead.`);else{for(let v=0;v<k.length;v++){let b=Array.isArray(_)?_[v]:_.type,y=k[v];A.concat(v+1).checkSubtype(b,y.type)}if(0===A.errors.length)return new iA(y,x,w,k)}}if(1===k.length)b.errors.push(...A.errors);else{let y=(k.length?k:w).map(([v])=>Array.isArray(v)?`(${v.map(tR).join(", ")})`:`(${tR(v.type)}...)`).join(" | "),_=[];for(let y=1;y<v.length;y++){let x=b.parse(v[y],1+_.length);if(!x)return null;_.push(tR(x.type))}b.error(`Expected arguments of type ${y}, but found (${_.join(", ")}) instead.`)}return null}static register(v,b){for(let y in iA.definitions=b,b)v[y]=iA}}function iC(v,[b,y,_,x]){b=b.evaluate(v),y=y.evaluate(v),_=_.evaluate(v);let w=x?x.evaluate(v):1,k=nc(b,y,_,w);if(k)throw new nr(k);return new t6(b/255,y/255,_/255,w,!1)}function iE(v,b){let y=b[v];return void 0===y?null:y}function iS(v){return{type:v}}function iT(v){if(v instanceof nw)return iT(v.boundExpression);if(v instanceof iA&&"error"===v.name||v instanceof nH||v instanceof n4||v instanceof ix||v instanceof iw)return!1;let b=v instanceof nv||v instanceof nm,y=!0;return v.eachChild(v=>{y=b?y&&iT(v):y&&v instanceof np}),!!y&&iO(v)&&iI(v,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"])}function iO(v){if(v instanceof iA&&("get"===v.name&&1===v.args.length||"feature-state"===v.name||"has"===v.name&&1===v.args.length||"properties"===v.name||"geometry-type"===v.name||"id"===v.name||/^filter-/.test(v.name))||v instanceof n4||v instanceof ix)return!1;let b=!0;return v.eachChild(v=>{b&&!iO(v)&&(b=!1)}),b}function iF(v){if(v instanceof iA&&"feature-state"===v.name)return!1;let b=!0;return v.eachChild(v=>{b&&!iF(v)&&(b=!1)}),b}function iI(v,b){if(v instanceof iA&&b.indexOf(v.name)>=0)return!1;let y=!0;return v.eachChild(v=>{y&&!iI(v,b)&&(y=!1)}),y}function iM(v){return{result:"success",value:v}}function iR(v){return{result:"error",value:v}}function iD(v){return"data-driven"===v["property-type"]||"cross-faded-data-driven"===v["property-type"]}function iP(v){return!!v.expression&&v.expression.parameters.indexOf("zoom")>-1}function iL(v){return!!v.expression&&v.expression.interpolated}function iN(v){return v instanceof Number?"number":v instanceof String?"string":v instanceof Boolean?"boolean":Array.isArray(v)?"array":null===v?"null":typeof v}function iz(v){return"object"==typeof v&&null!==v&&!Array.isArray(v)&&nd(v)===tk}function ij(v){return v}function iB(v,b,y){return void 0!==v?v:void 0!==b?b:void 0!==y?y:void 0}function i$(v,b,y,_,x){return iB(typeof y===x?_[y]:void 0,v.default,b.default)}function iU(v,b,y){if("number"!==iN(y))return iB(v.default,b.default);let _=v.stops.length;if(1===_||y<=v.stops[0][0])return v.stops[0][1];if(y>=v.stops[_-1][0])return v.stops[_-1][1];let x=nk(v.stops.map(v=>v[0]),y);return v.stops[x][1]}function iV(v,b,y){var _;let x,w,k=void 0!==v.base?v.base:1;if("number"!==iN(y))return iB(v.default,b.default);let A=v.stops.length;if(1===A||y<=v.stops[0][0])return v.stops[0][1];if(y>=v.stops[A-1][0])return v.stops[A-1][1];let C=nk(v.stops.map(v=>v[0]),y),E=(_=v.stops[C][0],x=v.stops[C+1][0]-_,w=y-_,0===x?0:1===k?w/x:(Math.pow(k,w)-1)/(Math.pow(k,x)-1)),S=v.stops[C][1],T=v.stops[C+1][1],O=nD[b.type]||ij;return"function"==typeof S.evaluate?{evaluate(...b){let y=S.evaluate.apply(void 0,b),_=T.evaluate.apply(void 0,b);if(void 0!==y&&void 0!==_)return O(y,_,E,v.colorSpace)}}:O(S,T,E,v.colorSpace)}function iq(v,b,y){switch(b.type){case"color":y=t6.parse(y);break;case"formatted":y=ne.fromString(y.toString());break;case"resolvedImage":y=ns.fromString(y.toString());break;case"padding":y=nt.parse(y);break;case"colorArray":y=ni.parse(y);break;case"numberArray":y=nn.parse(y);break;default:iN(y)===b.type||"enum"===b.type&&b.values[y]||(y=void 0)}return iB(y,v.default,b.default)}iA.register(ik,{error:[{kind:"error"},[ty],(v,[b])=>{throw new nr(b.evaluate(v))}],typeof:[ty,[tA],(v,[b])=>tR(nd(b.evaluate(v)))],"to-rgba":[tM(tb,4),[tx],(v,[b])=>{let[y,_,x,w]=b.evaluate(v).rgb;return[255*y,255*_,255*x,w]}],rgb:[tx,[tb,tb,tb],iC],rgba:[tx,[tb,tb,tb,tb],iC],has:{type:t_,overloads:[[[ty],(v,[b])=>b.evaluate(v)in v.properties()],[[ty,tk],(v,[b,y])=>b.evaluate(v)in y.evaluate(v)]]},get:{type:tA,overloads:[[[ty],(v,[b])=>iE(b.evaluate(v),v.properties())],[[ty,tk],(v,[b,y])=>iE(b.evaluate(v),y.evaluate(v))]]},"feature-state":[tA,[ty],(v,[b])=>iE(b.evaluate(v),v.featureState||{})],properties:[tk,[],v=>v.properties()],"geometry-type":[ty,[],v=>v.geometryType()],id:[tA,[],v=>v.id()],zoom:[tb,[],v=>v.globals.zoom],"heatmap-density":[tb,[],v=>v.globals.heatmapDensity||0],elevation:[tb,[],v=>v.globals.elevation||0],"line-progress":[tb,[],v=>v.globals.lineProgress||0],accumulated:[tA,[],v=>void 0===v.globals.accumulated?null:v.globals.accumulated],"+":[tb,iS(tb),(v,b)=>{let y=0;for(let _ of b)y+=_.evaluate(v);return y}],"*":[tb,iS(tb),(v,b)=>{let y=1;for(let _ of b)y*=_.evaluate(v);return y}],"-":{type:tb,overloads:[[[tb,tb],(v,[b,y])=>b.evaluate(v)-y.evaluate(v)],[[tb],(v,[b])=>-b.evaluate(v)]]},"/":[tb,[tb,tb],(v,[b,y])=>b.evaluate(v)/y.evaluate(v)],"%":[tb,[tb,tb],(v,[b,y])=>b.evaluate(v)%y.evaluate(v)],ln2:[tb,[],()=>Math.LN2],pi:[tb,[],()=>Math.PI],e:[tb,[],()=>Math.E],"^":[tb,[tb,tb],(v,[b,y])=>Math.pow(b.evaluate(v),y.evaluate(v))],sqrt:[tb,[tb],(v,[b])=>Math.sqrt(b.evaluate(v))],log10:[tb,[tb],(v,[b])=>Math.log(b.evaluate(v))/Math.LN10],ln:[tb,[tb],(v,[b])=>Math.log(b.evaluate(v))],log2:[tb,[tb],(v,[b])=>Math.log(b.evaluate(v))/Math.LN2],sin:[tb,[tb],(v,[b])=>Math.sin(b.evaluate(v))],cos:[tb,[tb],(v,[b])=>Math.cos(b.evaluate(v))],tan:[tb,[tb],(v,[b])=>Math.tan(b.evaluate(v))],asin:[tb,[tb],(v,[b])=>Math.asin(b.evaluate(v))],acos:[tb,[tb],(v,[b])=>Math.acos(b.evaluate(v))],atan:[tb,[tb],(v,[b])=>Math.atan(b.evaluate(v))],min:[tb,iS(tb),(v,b)=>Math.min(...b.map(b=>b.evaluate(v)))],max:[tb,iS(tb),(v,b)=>Math.max(...b.map(b=>b.evaluate(v)))],abs:[tb,[tb],(v,[b])=>Math.abs(b.evaluate(v))],round:[tb,[tb],(v,[b])=>{let y=b.evaluate(v);return y<0?-Math.round(-y):Math.round(y)}],floor:[tb,[tb],(v,[b])=>Math.floor(b.evaluate(v))],ceil:[tb,[tb],(v,[b])=>Math.ceil(b.evaluate(v))],"filter-==":[t_,[ty,tA],(v,[b,y])=>v.properties()[b.value]===y.value],"filter-id-==":[t_,[tA],(v,[b])=>v.id()===b.value],"filter-type-==":[t_,[ty],(v,[b])=>v.geometryType()===b.value],"filter-<":[t_,[ty,tA],(v,[b,y])=>{let _=v.properties()[b.value],x=y.value;return typeof _==typeof x&&_<x}],"filter-id-<":[t_,[tA],(v,[b])=>{let y=v.id(),_=b.value;return typeof y==typeof _&&y<_}],"filter->":[t_,[ty,tA],(v,[b,y])=>{let _=v.properties()[b.value],x=y.value;return typeof _==typeof x&&_>x}],"filter-id->":[t_,[tA],(v,[b])=>{let y=v.id(),_=b.value;return typeof y==typeof _&&y>_}],"filter-<=":[t_,[ty,tA],(v,[b,y])=>{let _=v.properties()[b.value],x=y.value;return typeof _==typeof x&&_<=x}],"filter-id-<=":[t_,[tA],(v,[b])=>{let y=v.id(),_=b.value;return typeof y==typeof _&&y<=_}],"filter->=":[t_,[ty,tA],(v,[b,y])=>{let _=v.properties()[b.value],x=y.value;return typeof _==typeof x&&_>=x}],"filter-id->=":[t_,[tA],(v,[b])=>{let y=v.id(),_=b.value;return typeof y==typeof _&&y>=_}],"filter-has":[t_,[tA],(v,[b])=>b.value in v.properties()],"filter-has-id":[t_,[],v=>null!==v.id()&&void 0!==v.id()],"filter-type-in":[t_,[tM(ty)],(v,[b])=>b.value.indexOf(v.geometryType())>=0],"filter-id-in":[t_,[tM(tA)],(v,[b])=>b.value.indexOf(v.id())>=0],"filter-in-small":[t_,[ty,tM(tA)],(v,[b,y])=>y.value.indexOf(v.properties()[b.value])>=0],"filter-in-large":[t_,[ty,tM(tA)],(v,[b,y])=>(function(v,b,y,_){for(;y<=_;){let x=y+_>>1;if(b[x]===v)return!0;b[x]>v?_=x-1:y=x+1}return!1})(v.properties()[b.value],y.value,0,y.value.length-1)],all:{type:t_,overloads:[[[t_,t_],(v,[b,y])=>b.evaluate(v)&&y.evaluate(v)],[iS(t_),(v,b)=>{for(let y of b)if(!y.evaluate(v))return!1;return!0}]]},any:{type:t_,overloads:[[[t_,t_],(v,[b,y])=>b.evaluate(v)||y.evaluate(v)],[iS(t_),(v,b)=>{for(let y of b)if(y.evaluate(v))return!0;return!1}]]},"!":[t_,[t_],(v,[b])=>!b.evaluate(v)],"is-supported-script":[t_,[ty],(v,[b])=>{let y=v.globals&&v.globals.isSupportedScript;return!y||y(b.evaluate(v))}],upcase:[ty,[ty],(v,[b])=>b.evaluate(v).toUpperCase()],downcase:[ty,[ty],(v,[b])=>b.evaluate(v).toLowerCase()],concat:[ty,iS(tA),(v,b)=>b.map(b=>nh(b.evaluate(v))).join("")],"resolved-locale":[ty,[tC],(v,[b])=>b.evaluate(v).resolvedLocale()]});class iH{constructor(v,b,y){this.expression=v,this._warningHistory={},this._evaluator=new ny,this._defaultValue=b?function(v){if("color"===v.type&&iz(v.default))return new t6(0,0,0,0);switch(v.type){case"color":return t6.parse(v.default)||null;case"padding":return nt.parse(v.default)||null;case"numberArray":return nn.parse(v.default)||null;case"colorArray":return ni.parse(v.default)||null;case"variableAnchorOffsetCollection":return na.parse(v.default)||null;case"projectionDefinition":return nl.parse(v.default)||null;default:return void 0===v.default?null:v.default}}(b):null,this._enumValues=b&&"enum"===b.type?b.values:null,this._globalState=y}evaluateWithoutErrorHandling(v,b,y,_,x,w){return this._globalState&&(v=iQ(v,this._globalState)),this._evaluator.globals=v,this._evaluator.feature=b,this._evaluator.featureState=y,this._evaluator.canonical=_,this._evaluator.availableImages=x||null,this._evaluator.formattedSection=w,this.expression.evaluate(this._evaluator)}evaluate(v,b,y,_,x,w){this._globalState&&(v=iQ(v,this._globalState)),this._evaluator.globals=v,this._evaluator.feature=b||null,this._evaluator.featureState=y||null,this._evaluator.canonical=_,this._evaluator.availableImages=x||null,this._evaluator.formattedSection=w||null;try{let v=this.expression.evaluate(this._evaluator);if(null==v||"number"==typeof v&&v!=v)return this._defaultValue;if(this._enumValues&&!(v in this._enumValues))throw new nr(`Expected value to be one of ${Object.keys(this._enumValues).map(v=>JSON.stringify(v)).join(", ")}, but found ${JSON.stringify(v)} instead.`);return v}catch(v){return this._warningHistory[v.message]||(this._warningHistory[v.message]=!0,"u">typeof console&&console.warn(v.message)),this._defaultValue}}}function iW(v){return Array.isArray(v)&&v.length>0&&"string"==typeof v[0]&&v[0]in ik}function iG(v,b,y){let _,x=new n_(ik,iT,[],b?(_={color:tx,string:ty,number:tb,enum:ty,boolean:t_,formatted:tE,padding:tS,numberArray:tO,colorArray:tT,projectionDefinition:tw,resolvedImage:tF,variableAnchorOffsetCollection:tI},"array"===b.type?tM(_[b.value]||tA,b.length):_[b.type]):void 0),w=x.parse(v,void 0,void 0,void 0,b&&"string"===b.type?{typeAnnotation:"coerce"}:void 0);return w?iM(new iH(w,b,y)):iR(x.errors)}class iY{constructor(v,b,y){this.kind=v,this._styleExpression=b,this.isStateDependent="constant"!==v&&!iF(b.expression),this.globalStateRefs=iJ(b.expression),this._globalState=y}evaluateWithoutErrorHandling(v,b,y,_,x,w){return this._globalState&&(v=iQ(v,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(v,b,y,_,x,w)}evaluate(v,b,y,_,x,w){return this._globalState&&(v=iQ(v,this._globalState)),this._styleExpression.evaluate(v,b,y,_,x,w)}}class iZ{constructor(v,b,y,_,x){this.kind=v,this.zoomStops=y,this._styleExpression=b,this.isStateDependent="camera"!==v&&!iF(b.expression),this.globalStateRefs=iJ(b.expression),this.interpolationType=_,this._globalState=x}evaluateWithoutErrorHandling(v,b,y,_,x,w){return this._globalState&&(v=iQ(v,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(v,b,y,_,x,w)}evaluate(v,b,y,_,x,w){return this._globalState&&(v=iQ(v,this._globalState)),this._styleExpression.evaluate(v,b,y,_,x,w)}interpolationFactor(v,b,y){return this.interpolationType?nM.interpolationFactor(this.interpolationType,v,b,y):0}}function iX(v,b,y){let _=iG(v,b,y);if("error"===_.result)return _;let x=_.value.expression,w=iO(x);if(!w&&!iD(b))return iR([new tm("","data expressions not supported")]);let k=iI(x,["zoom"]);if(!k&&!iP(b))return iR([new tm("","zoom expressions not supported")]);let A=function v(b){let y=null;if(b instanceof nx)y=v(b.result);else if(b instanceof nP){for(let _ of b.args)if(y=v(_))break}else(b instanceof nA||b instanceof nM)&&b.input instanceof iA&&"zoom"===b.input.name&&(y=b);return y instanceof tm||b.eachChild(b=>{let _=v(b);_ instanceof tm?y=_:!y&&_?y=new tm("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):y&&_&&y!==_&&(y=new tm("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),y}(x);return A||k?A instanceof tm?iR([A]):A instanceof nM&&!iL(b)?iR([new tm("",'"interpolate" expressions cannot be used with this property')]):iM(A?new iZ(w?"camera":"composite",_.value,A.labels,A instanceof nM?A.interpolation:void 0,y):new iY(w?"constant":"source",_.value,y)):iR([new tm("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class iK{constructor(v,b){this._parameters=v,this._specification=b,tf(this,function v(b,y){var _;let x,w,k=b.stops&&"object"==typeof b.stops[0][0],A=k||!(k||void 0!==b.property),C=b.type||(iL(y)?"exponential":"interval"),E=function(v){switch(v.type){case"color":return t6.parse;case"padding":return nt.parse;case"numberArray":return nn.parse;case"colorArray":return ni.parse;default:return null}}(y);if(E&&((b=tf({},b)).stops&&(b.stops=b.stops.map(v=>[v[0],E(v[1])])),b.default=E(b.default?b.default:y.default)),b.colorSpace&&"rgb"!==(_=b.colorSpace)&&"hcl"!==_&&"lab"!==_)throw Error(`Unknown color space: "${b.colorSpace}"`);let S=function(v){switch(v){case"exponential":return iV;case"interval":return iU;case"categorical":return i$;case"identity":return iq;default:throw Error(`Unknown function type "${v}"`)}}(C);if("categorical"===C){for(let v of(x=Object.create(null),b.stops))x[v[0]]=v[1];w=typeof b.stops[0][0]}if(k){let _={},x=[];for(let v=0;v<b.stops.length;v++){let y=b.stops[v],w=y[0].zoom;void 0===_[w]&&(_[w]={zoom:w,type:b.type,property:b.property,default:b.default,stops:[]},x.push(w)),_[w].stops.push([y[0].value,y[1]])}let w=[];for(let b of x)w.push([_[b].zoom,v(_[b],y)]);let k={name:"linear"};return{kind:"composite",interpolationType:k,interpolationFactor:nM.interpolationFactor.bind(void 0,k),zoomStops:w.map(v=>v[0]),evaluate:({zoom:v},_)=>iV({stops:w,base:b.base},y,v).evaluate(v,_)}}if(A){let v="exponential"===C?{name:"exponential",base:void 0!==b.base?b.base:1}:null;return{kind:"camera",interpolationType:v,interpolationFactor:nM.interpolationFactor.bind(void 0,v),zoomStops:b.stops.map(v=>v[0]),evaluate:({zoom:v})=>S(b,y,v,x,w)}}return{kind:"source",evaluate(v,_){let k=_&&_.properties?_.properties[b.property]:void 0;return void 0===k?iB(b.default,y.default):S(b,y,k,x,w)}}}(this._parameters,this._specification))}static deserialize(v){return new iK(v._parameters,v._specification)}static serialize(v){return{_parameters:v._parameters,_specification:v._specification}}}function iJ(v,b=new Set){return v instanceof iw&&b.add(v.key),v.eachChild(v=>{iJ(v,b)}),b}function iQ(v,b){let{zoom:y,heatmapDensity:_,elevation:x,lineProgress:w,isSupportedScript:k,accumulated:A}=null!=v?v:{};return{zoom:y,heatmapDensity:_,elevation:x,lineProgress:w,isSupportedScript:k,accumulated:A,globalState:b}}function i0(v){if(!0===v||!1===v)return!0;if(!Array.isArray(v)||0===v.length)return!1;switch(v[0]){case"has":return v.length>=2&&"$id"!==v[1]&&"$type"!==v[1];case"in":return v.length>=3&&("string"!=typeof v[1]||Array.isArray(v[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==v.length||Array.isArray(v[1])||Array.isArray(v[2]);case"any":case"all":for(let b of v.slice(1))if(!i0(b)&&"boolean"!=typeof b)return!1;return!0;default:return!0}}let i1={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function i2(v,b){if(null==v)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};i0(v)||(v=function v(b){if(!b)return!0;let y=b[0];return b.length<=1?"any"!==y:"=="===y?i3(b[1],b[2],"=="):"!="===y?i8(i3(b[1],b[2],"==")):"<"===y||">"===y||"<="===y||">="===y?i3(b[1],b[2],y):"any"===y?["any"].concat(b.slice(1).map(v)):"all"===y?["all"].concat(b.slice(1).map(v)):"none"===y?["all"].concat(b.slice(1).map(v).map(i8)):"in"===y?i4(b[1],b.slice(2)):"!in"===y?i8(i4(b[1],b.slice(2))):"has"===y?i6(b[1]):"!has"!==y||i8(i6(b[1]))}(v));let y=iG(v,i1,b);if("error"===y.result)throw Error(y.value.map(v=>`${v.key}: ${v.message}`).join(", "));return{filter:(v,b,_)=>y.value.evaluate(v,b,{},_),needGeometry:function v(b){if(!Array.isArray(b))return!1;if("within"===b[0]||"distance"===b[0])return!0;for(let y=1;y<b.length;y++)if(v(b[y]))return!0;return!1}(v),getGlobalStateRefs:()=>iJ(y.value.expression)}}function i5(v,b){return v<b?-1:+(v>b)}function i3(v,b,y){switch(v){case"$type":return[`filter-type-${y}`,b];case"$id":return[`filter-id-${y}`,b];default:return[`filter-${y}`,v,b]}}function i4(v,b){if(0===b.length)return!1;switch(v){case"$type":return["filter-type-in",["literal",b]];case"$id":return["filter-id-in",["literal",b]];default:return b.length>200&&!b.some(v=>typeof v!=typeof b[0])?["filter-in-large",v,["literal",b.sort(i5)]]:["filter-in-small",v,["literal",b]]}}function i6(v){switch(v){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",v]}}function i8(v){return["!",v]}function i7(v){let b=v.value;return b?[new tp(v.key,b,"constants have been deprecated as of v8")]:[]}function i9(v){return v instanceof Number||v instanceof String||v instanceof Boolean?v.valueOf():v}function re(v){if(Array.isArray(v))return v.map(re);if(v instanceof Object&&!(v instanceof Number||v instanceof String||v instanceof Boolean)){let b={};for(let y in v)b[y]=re(v[y]);return b}return i9(v)}function rt(v){let b=v.key,y=v.value,_=v.valueSpec||{},x=v.objectElementValidators||{},w=v.style,k=v.styleSpec,A=v.validateSpec,C=[],E=iN(y);if("object"!==E)return[new tp(b,y,`object expected, ${E} found`)];for(let v in y){let E,S=v.split(".")[0],T=tQ(_,S)||_["*"];if(tQ(x,S))E=x[S];else if(tQ(_,S)){if(void 0===y[v])continue;E=A}else if(x["*"])E=x["*"];else{if(!_["*"]){C.push(new tp(b,y[v],`unknown property "${v}"`));continue}E=A}C=C.concat(E({key:(b?`${b}.`:b)+v,value:y[v],valueSpec:T,style:w,styleSpec:k,object:y,objectKey:v,validateSpec:A},y))}for(let v in _)x[v]||_[v].required&&void 0===_[v].default&&void 0===y[v]&&C.push(new tp(b,y,`missing required property "${v}"`));return C}function rn(v){let b=v.value,y=v.valueSpec,_=v.style,x=v.styleSpec,w=v.key,k=v.arrayElementValidator||v.validateSpec;if("array"!==iN(b))return[new tp(w,b,`array expected, ${iN(b)} found`)];if(y.length&&b.length!==y.length)return[new tp(w,b,`array length ${y.length} expected, length ${b.length} found`)];let A={type:y.value,values:y.values};x.$version<7&&(A.function=y.function),"object"===iN(y.value)&&(A=y.value);let C=[];for(let y=0;y<b.length;y++)C=C.concat(k({array:b,arrayIndex:y,value:b[y],valueSpec:A,validateSpec:v.validateSpec,style:_,styleSpec:x,key:`${w}[${y}]`}));return C}function ri(v){let b=v.key,y=v.value,_=v.valueSpec,x=iN(y);return"number"===x&&y!=y&&(x="NaN"),"number"!==x?[new tp(b,y,`number expected, ${x} found`)]:"minimum"in _&&y<_.minimum?[new tp(b,y,`${y} is less than the minimum value ${_.minimum}`)]:"maximum"in _&&y>_.maximum?[new tp(b,y,`${y} is greater than the maximum value ${_.maximum}`)]:[]}function rr(v){let b=v.valueSpec,y=i9(v.value.type),_,x,w,k={},A="categorical"!==y&&void 0===v.value.property,C="array"===iN(v.value.stops)&&"array"===iN(v.value.stops[0])&&"object"===iN(v.value.stops[0][0]),E=rt({key:v.key,value:v.value,valueSpec:v.styleSpec.function,validateSpec:v.validateSpec,style:v.style,styleSpec:v.styleSpec,objectElementValidators:{stops:function(v){if("identity"===y)return[new tp(v.key,v.value,'identity function may not have a "stops" property')];let b=[],_=v.value;return b=b.concat(rn({key:v.key,value:_,valueSpec:v.valueSpec,validateSpec:v.validateSpec,style:v.style,styleSpec:v.styleSpec,arrayElementValidator:S})),"array"===iN(_)&&0===_.length&&b.push(new tp(v.key,_,"array must have at least one stop")),b},default:function(v){return v.validateSpec({key:v.key,value:v.value,valueSpec:b,validateSpec:v.validateSpec,style:v.style,styleSpec:v.styleSpec})}}});return"identity"===y&&A&&E.push(new tp(v.key,v.value,'missing required property "property"')),"identity"===y||v.value.stops||E.push(new tp(v.key,v.value,'missing required property "stops"')),"exponential"===y&&v.valueSpec.expression&&!iL(v.valueSpec)&&E.push(new tp(v.key,v.value,"exponential functions not supported")),v.styleSpec.$version>=8&&(A||iD(v.valueSpec)?A&&!iP(v.valueSpec)&&E.push(new tp(v.key,v.value,"zoom functions not supported")):E.push(new tp(v.key,v.value,"property functions not supported"))),("categorical"===y||C)&&void 0===v.value.property&&E.push(new tp(v.key,v.value,'"property" property is required')),E;function S(v){let y=[],_=v.value,A=v.key;if("array"!==iN(_))return[new tp(A,_,`array expected, ${iN(_)} found`)];if(2!==_.length)return[new tp(A,_,`array length 2 expected, length ${_.length} found`)];if(C){if("object"!==iN(_[0]))return[new tp(A,_,`object expected, ${iN(_[0])} found`)];if(void 0===_[0].zoom)return[new tp(A,_,"object stop key must have zoom")];if(void 0===_[0].value)return[new tp(A,_,"object stop key must have value")];if(w&&w>i9(_[0].zoom))return[new tp(A,_[0].zoom,"stop zoom values must appear in ascending order")];i9(_[0].zoom)!==w&&(w=i9(_[0].zoom),x=void 0,k={}),y=y.concat(rt({key:`${A}[0]`,value:_[0],valueSpec:{zoom:{}},validateSpec:v.validateSpec,style:v.style,styleSpec:v.styleSpec,objectElementValidators:{zoom:ri,value:T}}))}else y=y.concat(T({key:`${A}[0]`,value:_[0],validateSpec:v.validateSpec,style:v.style,styleSpec:v.styleSpec},_));return iW(re(_[1]))?y.concat([new tp(`${A}[1]`,_[1],"expressions are not allowed in function stops.")]):y.concat(v.validateSpec({key:`${A}[1]`,value:_[1],valueSpec:b,validateSpec:v.validateSpec,style:v.style,styleSpec:v.styleSpec}))}function T(v,w){let A=iN(v.value),C=i9(v.value),E=null!==v.value?v.value:w;if(_){if(A!==_)return[new tp(v.key,E,`${A} stop domain type must match previous stop domain type ${_}`)]}else _=A;if("number"!==A&&"string"!==A&&"boolean"!==A)return[new tp(v.key,E,"stop domain value must be a number, string, or boolean")];if("number"!==A&&"categorical"!==y){let _=`number expected, ${A} found`;return iD(b)&&void 0===y&&(_+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new tp(v.key,E,_)]}return"categorical"!==y||"number"!==A||isFinite(C)&&Math.floor(C)===C?"categorical"!==y&&"number"===A&&void 0!==x&&C<x?[new tp(v.key,E,"stop domain values must appear in ascending order")]:(x=C,"categorical"===y&&C in k?[new tp(v.key,E,"stop domain values must be unique")]:(k[C]=!0,[])):[new tp(v.key,E,`integer expected, found ${C}`)]}}function ro(v){let b=("property"===v.expressionContext?iX:iG)(re(v.value),v.valueSpec);if("error"===b.result)return b.value.map(b=>new tp(`${v.key}${b.key}`,v.value,b.message));let y=b.value.expression||b.value._styleExpression.expression;if("property"===v.expressionContext&&"text-font"===v.propertyKey&&!y.outputDefined())return[new tp(v.key,v.value,`Invalid data expression for "${v.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===v.expressionContext&&"layout"===v.propertyType&&!iF(y))return[new tp(v.key,v.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===v.expressionContext&&!iF(y))return[new tp(v.key,v.value,'"feature-state" data expressions are not supported with filters.')];if(v.expressionContext&&0===v.expressionContext.indexOf("cluster")){if(!iI(y,["zoom","feature-state"]))return[new tp(v.key,v.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===v.expressionContext&&!iO(y))return[new tp(v.key,v.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function ra(v){let b=v.key,y=v.value,_=iN(y);return"string"!==_?[new tp(b,y,`color expected, ${_} found`)]:t6.parse(String(y))?[]:[new tp(b,y,`color expected, "${y}" found`)]}function rs(v){let b=v.key,y=v.value,_=v.valueSpec,x=[];return Array.isArray(_.values)?-1===_.values.indexOf(i9(y))&&x.push(new tp(b,y,`expected one of [${_.values.join(", ")}], ${JSON.stringify(y)} found`)):-1===Object.keys(_.values).indexOf(i9(y))&&x.push(new tp(b,y,`expected one of [${Object.keys(_.values).join(", ")}], ${JSON.stringify(y)} found`)),x}function rl(v){return i0(re(v.value))?ro(tf({},v,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function v(b){let y=b.value,_=b.key;if("array"!==iN(y))return[new tp(_,y,`array expected, ${iN(y)} found`)];let x=b.styleSpec,w,k=[];if(y.length<1)return[new tp(_,y,"filter array must have at least 1 element")];switch(k=k.concat(rs({key:`${_}[0]`,value:y[0],valueSpec:x.filter_operator,style:b.style,styleSpec:b.styleSpec})),i9(y[0])){case"<":case"<=":case">":case">=":y.length>=2&&"$type"===i9(y[1])&&k.push(new tp(_,y,`"$type" cannot be use with operator "${y[0]}"`));case"==":case"!=":3!==y.length&&k.push(new tp(_,y,`filter array for operator "${y[0]}" must have 3 elements`));case"in":case"!in":y.length>=2&&"string"!==(w=iN(y[1]))&&k.push(new tp(`${_}[1]`,y[1],`string expected, ${w} found`));for(let v=2;v<y.length;v++)w=iN(y[v]),"$type"===i9(y[1])?k=k.concat(rs({key:`${_}[${v}]`,value:y[v],valueSpec:x.geometry_type,style:b.style,styleSpec:b.styleSpec})):"string"!==w&&"number"!==w&&"boolean"!==w&&k.push(new tp(`${_}[${v}]`,y[v],`string, number, or boolean expected, ${w} found`));break;case"any":case"all":case"none":for(let x=1;x<y.length;x++)k=k.concat(v({key:`${_}[${x}]`,value:y[x],style:b.style,styleSpec:b.styleSpec}));break;case"has":case"!has":w=iN(y[1]),2!==y.length?k.push(new tp(_,y,`filter array for "${y[0]}" operator must have 2 elements`)):"string"!==w&&k.push(new tp(`${_}[1]`,y[1],`string expected, ${w} found`))}return k}(v)}function rc(v,b){let y,_=v.key,x=v.validateSpec,w=v.style,k=v.styleSpec,A=v.value,C=v.objectKey,E=k[`${b}_${v.layerType}`];if(!E)return[];let S=C.match(/^(.*)-transition$/);if("paint"===b&&S&&E[S[1]]&&E[S[1]].transition)return x({key:_,value:A,valueSpec:k.transition,style:w,styleSpec:k});let T=v.valueSpec||E[C];if(!T)return[new tp(_,A,`unknown property "${C}"`)];if("string"===iN(A)&&iD(T)&&!T.tokens&&(y=/^{([^}]+)}$/.exec(A)))return[new tp(_,A,`"${C}" does not support interpolation syntax
|
|
6909
6909
|
Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(y[1])} }\`.`)];let O=[];return"symbol"===v.layerType&&"text-font"===C&&iz(re(A))&&"identity"===i9(A.type)&&O.push(new tp(_,A,'"text-font" does not support identity functions')),O.concat(x({key:v.key,value:A,valueSpec:T,style:w,styleSpec:k,expressionContext:"property",propertyType:b,propertyKey:C}))}function ru(v){return rc(v,"paint")}function rd(v){return rc(v,"layout")}function rh(v){let b=[],y=v.value,_=v.key,x=v.style,w=v.styleSpec;if("object"!==iN(y))return[new tp(_,y,`object expected, ${iN(y)} found`)];y.type||y.ref||b.push(new tp(_,y,'either "type" or "ref" is required'));let k=i9(y.type),A=i9(y.ref);if(y.id){let w=i9(y.id);for(let k=0;k<v.arrayIndex;k++){let v=x.layers[k];i9(v.id)===w&&b.push(new tp(_,y.id,`duplicate layer id "${y.id}", previously used at line ${v.id.__line__}`))}}if("ref"in y){let v;["type","source","source-layer","filter","layout"].forEach(v=>{v in y&&b.push(new tp(_,y[v],`"${v}" is prohibited for ref layers`))}),x.layers.forEach(b=>{i9(b.id)===A&&(v=b)}),v?v.ref?b.push(new tp(_,y.ref,"ref cannot reference another ref layer")):k=i9(v.type):b.push(new tp(_,y.ref,`ref layer "${A}" not found`))}else if("background"!==k)if(y.source){let v=x.sources&&x.sources[y.source],w=v&&i9(v.type);v?"vector"===w&&"raster"===k?b.push(new tp(_,y.source,`layer "${y.id}" requires a raster source`)):"raster-dem"!==w&&"hillshade"===k||"raster-dem"!==w&&"color-relief"===k?b.push(new tp(_,y.source,`layer "${y.id}" requires a raster-dem source`)):"raster"===w&&"raster"!==k?b.push(new tp(_,y.source,`layer "${y.id}" requires a vector source`)):"vector"!==w||y["source-layer"]?"raster-dem"===w&&"hillshade"!==k&&"color-relief"!==k?b.push(new tp(_,y.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):"line"===k&&y.paint&&y.paint["line-gradient"]&&("geojson"!==w||!v.lineMetrics)&&b.push(new tp(_,y,`layer "${y.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):b.push(new tp(_,y,`layer "${y.id}" must specify a "source-layer"`)):b.push(new tp(_,y.source,`source "${y.source}" not found`))}else b.push(new tp(_,y,'missing required property "source"'));return b=b.concat(rt({key:_,value:y,valueSpec:w.layer,style:v.style,styleSpec:v.styleSpec,validateSpec:v.validateSpec,objectElementValidators:{"*":()=>[],type:()=>v.validateSpec({key:`${_}.type`,value:y.type,valueSpec:w.layer.type,style:v.style,styleSpec:v.styleSpec,validateSpec:v.validateSpec,object:y,objectKey:"type"}),filter:rl,layout:v=>rt({layer:y,key:v.key,value:v.value,style:v.style,styleSpec:v.styleSpec,validateSpec:v.validateSpec,objectElementValidators:{"*":v=>rd(tf({layerType:k},v))}}),paint:v=>rt({layer:y,key:v.key,value:v.value,style:v.style,styleSpec:v.styleSpec,validateSpec:v.validateSpec,objectElementValidators:{"*":v=>ru(tf({layerType:k},v))}})}}))}function rp(v){let b=v.value,y=v.key,_=iN(b);return"string"!==_?[new tp(y,b,`string expected, ${_} found`)]:[]}let rf={promoteId:function({key:v,value:b}){if("string"===iN(b))return rp({key:v,value:b});{let y=[];for(let _ in b)y.push(...rp({key:`${v}.${_}`,value:b[_]}));return y}}};function rm(v){let b,y=v.value,_=v.key,x=v.styleSpec,w=v.style,k=v.validateSpec;if(!y.type)return[new tp(_,y,'"type" is required')];let A=i9(y.type);switch(A){case"vector":case"raster":return rt({key:_,value:y,valueSpec:x[`source_${A.replace("-","_")}`],style:v.style,styleSpec:x,objectElementValidators:rf,validateSpec:k});case"raster-dem":return function(v){var b;let y=null!=(b=v.sourceName)?b:"",_=v.value,x=v.styleSpec,w=x.source_raster_dem,k=v.style,A=[],C=iN(_);if(void 0===_)return A;if("object"!==C)return A.push(new tp("source_raster_dem",_,`object expected, ${C} found`)),A;let E="custom"===i9(_.encoding),S=["redFactor","greenFactor","blueFactor","baseShift"],T=v.value.encoding?`"${v.value.encoding}"`:"Default";for(let b in _)!E&&S.includes(b)?A.push(new tp(b,_[b],`In "${y}": "${b}" is only valid when "encoding" is set to "custom". ${T} encoding found`)):w[b]?A=A.concat(v.validateSpec({key:b,value:_[b],valueSpec:w[b],validateSpec:v.validateSpec,style:k,styleSpec:x})):A.push(new tp(b,_[b],`unknown property "${b}"`));return A}({sourceName:_,value:y,style:v.style,styleSpec:x,validateSpec:k});case"geojson":if(b=rt({key:_,value:y,valueSpec:x.source_geojson,style:w,styleSpec:x,validateSpec:k,objectElementValidators:rf}),y.cluster)for(let v in y.clusterProperties){let[x,w]=y.clusterProperties[v],k="string"==typeof x?[x,["accumulated"],["get",v]]:x;b.push(...ro({key:`${_}.${v}.map`,value:w,expressionContext:"cluster-map"})),b.push(...ro({key:`${_}.${v}.reduce`,value:k,expressionContext:"cluster-reduce"}))}return b;case"video":return rt({key:_,value:y,valueSpec:x.source_video,style:w,validateSpec:k,styleSpec:x});case"image":return rt({key:_,value:y,valueSpec:x.source_image,style:w,validateSpec:k,styleSpec:x});case"canvas":return[new tp(_,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return rs({key:`${_}.type`,value:y.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function rg(v){let b=v.value,y=v.styleSpec,_=y.light,x=v.style,w=[],k=iN(b);if(void 0===b)return w;if("object"!==k)return w.concat([new tp("light",b,`object expected, ${k} found`)]);for(let k in b){let A=k.match(/^(.*)-transition$/);w=w.concat(A&&_[A[1]]&&_[A[1]].transition?v.validateSpec({key:k,value:b[k],valueSpec:y.transition,validateSpec:v.validateSpec,style:x,styleSpec:y}):_[k]?v.validateSpec({key:k,value:b[k],valueSpec:_[k],validateSpec:v.validateSpec,style:x,styleSpec:y}):[new tp(k,b[k],`unknown property "${k}"`)])}return w}function rv(v){let b=v.value,y=v.styleSpec,_=y.sky,x=v.style,w=iN(b);if(void 0===b)return[];if("object"!==w)return[new tp("sky",b,`object expected, ${w} found`)];let k=[];for(let w in b)k=k.concat(_[w]?v.validateSpec({key:w,value:b[w],valueSpec:_[w],style:x,styleSpec:y}):[new tp(w,b[w],`unknown property "${w}"`)]);return k}function rb(v){let b=v.value,y=v.styleSpec,_=y.terrain,x=v.style,w=[],k=iN(b);if(void 0===b)return w;if("object"!==k)return w.concat([new tp("terrain",b,`object expected, ${k} found`)]);for(let k in b)w=w.concat(_[k]?v.validateSpec({key:k,value:b[k],valueSpec:_[k],validateSpec:v.validateSpec,style:x,styleSpec:y}):[new tp(k,b[k],`unknown property "${k}"`)]);return w}function ry(v){let b=[],y=v.value,_=v.key;if(Array.isArray(y)){let x=[],w=[];for(let k in y)y[k].id&&x.includes(y[k].id)&&b.push(new tp(_,y,`all the sprites' ids must be unique, but ${y[k].id} is duplicated`)),x.push(y[k].id),y[k].url&&w.includes(y[k].url)&&b.push(new tp(_,y,`all the sprites' URLs must be unique, but ${y[k].url} is duplicated`)),w.push(y[k].url),b=b.concat(rt({key:`${_}[${k}]`,value:y[k],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:v.validateSpec}));return b}return rp({key:_,value:y})}function r_(v){return!!v&&v.constructor===Object}function rx(v){return r_(v.value)?[]:[new tp(v.key,v.value,`object expected, ${iN(v.value)} found`)]}let rw={"*":()=>[],array:rn,boolean:function(v){let b=v.value,y=v.key,_=iN(b);return"boolean"!==_?[new tp(y,b,`boolean expected, ${_} found`)]:[]},number:ri,color:ra,constants:i7,enum:rs,filter:rl,function:rr,layer:rh,object:rt,source:rm,light:rg,sky:rv,terrain:rb,projection:function(v){let b=v.value,y=v.styleSpec,_=y.projection,x=v.style,w=iN(b);if(void 0===b)return[];if("object"!==w)return[new tp("projection",b,`object expected, ${w} found`)];let k=[];for(let w in b)k=k.concat(_[w]?v.validateSpec({key:w,value:b[w],valueSpec:_[w],style:x,styleSpec:y}):[new tp(w,b[w],`unknown property "${w}"`)]);return k},projectionDefinition:function(v){var b;let y=v.key,_=v.value,x=iN(_=_ instanceof String?_.valueOf():_);return"array"!==x||Array.isArray(b=_)&&3===b.length&&"string"==typeof b[0]&&"string"==typeof b[1]&&"number"==typeof b[2]||["interpolate","step","literal"].includes(_[0])?["array","string"].includes(x)?[]:[new tp(y,_,`projection expected, invalid type "${x}" found`)]:[new tp(y,_,`projection expected, invalid array ${JSON.stringify(_)} found`)]},string:rp,formatted:function(v){return 0===rp(v).length?[]:ro(v)},resolvedImage:function(v){return 0===rp(v).length?[]:ro(v)},padding:function(v){let b=v.key,y=v.value;if("array"===iN(y)){if(y.length<1||y.length>4)return[new tp(b,y,`padding requires 1 to 4 values; ${y.length} values found`)];let _={type:"number"},x=[];for(let w=0;w<y.length;w++)x=x.concat(v.validateSpec({key:`${b}[${w}]`,value:y[w],validateSpec:v.validateSpec,valueSpec:_}));return x}return ri({key:b,value:y,valueSpec:{}})},numberArray:function(v){let b=v.key,y=v.value;if("array"===iN(y)){let _={type:"number"};if(y.length<1)return[new tp(b,y,"array length at least 1 expected, length 0 found")];let x=[];for(let w=0;w<y.length;w++)x=x.concat(v.validateSpec({key:`${b}[${w}]`,value:y[w],validateSpec:v.validateSpec,valueSpec:_}));return x}return ri({key:b,value:y,valueSpec:{}})},colorArray:function(v){let b=v.key,y=v.value;if("array"===iN(y)){if(y.length<1)return[new tp(b,y,"array length at least 1 expected, length 0 found")];let v=[];for(let _=0;_<y.length;_++)v=v.concat(ra({key:`${b}[${_}]`,value:y[_]}));return v}return ra({key:b,value:y})},variableAnchorOffsetCollection:function(v){let b=v.key,y=v.value,_=iN(y),x=v.styleSpec;if("array"!==_||y.length<1||y.length%2!=0)return[new tp(b,y,"variableAnchorOffsetCollection requires a non-empty array of even length")];let w=[];for(let _=0;_<y.length;_+=2)w=(w=w.concat(rs({key:`${b}[${_}]`,value:y[_],valueSpec:x.layout_symbol["text-anchor"]}))).concat(rn({key:`${b}[${_+1}]`,value:y[_+1],valueSpec:{length:2,value:"number"},validateSpec:v.validateSpec,style:v.style,styleSpec:x}));return w},sprite:ry,state:rx,fontFaces:function(v){let b=v.key,y=v.value,_=v.validateSpec,x=v.styleSpec,w=v.style;if(!r_(y))return[new tp(b,y,`object expected, ${iN(y)} found`)];let k=[];for(let v in y){let A=y[v],C=iN(A);if("string"===C)k.push(...rp({key:`${b}.${v}`,value:A}));else if("array"===C){let y={url:{type:"string",required:!0},"unicode-range":{type:"array",value:"string"}};for(let[C,E]of A.entries())k.push(...rt({key:`${b}.${v}[${C}]`,value:E,valueSpec:y,styleSpec:x,style:w,validateSpec:_}))}else k.push(new tp(`${b}.${v}`,A,`string or array expected, ${C} found`))}return k}};function rk(v){let b=v.value,y=v.valueSpec,_=v.styleSpec;return v.validateSpec=rk,y.expression&&iz(i9(b))?rr(v):y.expression&&iW(re(b))?ro(v):y.type&&rw[y.type]?rw[y.type](v):rt(tf({},v,{valueSpec:y.type?_[y.type]:y}))}function rA(v){let b=v.value,y=v.key,_=rp(v);return _.length||(-1===b.indexOf("{fontstack}")&&_.push(new tp(y,b,'"glyphs" url must include a "{fontstack}" token')),-1===b.indexOf("{range}")&&_.push(new tp(y,b,'"glyphs" url must include a "{range}" token'))),_}function rC(v,b=tr){let y=[];return y=y.concat(rk({key:"",value:v,valueSpec:b.$root,styleSpec:b,style:v,validateSpec:rk,objectElementValidators:{glyphs:rA,"*":()=>[]}})),v.constants&&(y=y.concat(i7({key:"constants",value:v.constants}))),rS(y)}function rE(v){return function(b){return v(Object.assign({},b,{validateSpec:rk}))}}function rS(v){return[].concat(v).sort((v,b)=>v.line-b.line)}function rT(v){return function(...b){return rS(v.apply(this,b))}}rC.source=rT(rE(rm)),rC.sprite=rT(rE(ry)),rC.glyphs=rT(rE(rA)),rC.light=rT(rE(rg)),rC.sky=rT(rE(rv)),rC.terrain=rT(rE(rb)),rC.state=rT(rE(rx)),rC.layer=rT(rE(rh)),rC.filter=rT(rE(rl)),rC.paintProperty=rT(rE(ru)),rC.layoutProperty=rT(rE(rd));let rO={type:"enum","property-type":"data-constant",expression:{interpolated:!1,parameters:["global-state"]},values:{visible:{},none:{}},transition:!1,default:"visible"};class rF{constructor(v,b){this._globalState=b,this.setValue(v)}evaluate(){var v;return null!=(v=this._literalValue)?v:this._compiledValue.evaluate({})}setValue(v){if(null==v||"visible"===v||"none"===v)return this._literalValue="none"===v?"none":"visible",this._compiledValue=void 0,void(this._globalStateRefs=new Set);let b=iG(v,rO,this._globalState);if("error"===b.result)throw this._literalValue="visible",this._compiledValue=void 0,Error(b.value.map(v=>`${v.key}: ${v.message}`).join(", "));this._literalValue=void 0,this._compiledValue=b.value,this._globalStateRefs=iJ(b.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}}let rI=rC.light,rM=rC.sky,rR=rC.paintProperty,rD=rC.layoutProperty;function rP(v,b){let y=!1;if(b&&b.length)for(let _ of b)v.fire(new tn(Error(_.message))),y=!0;return y}class rL{constructor(v,b,y){const _=this.cells=[];if(v instanceof ArrayBuffer){this.arrayBuffer=v;const x=new Int32Array(this.arrayBuffer);v=x[0],this.d=(b=x[1])+2*(y=x[2]);for(let v=0;v<this.d*this.d;v++){const b=x[3+v],y=x[3+v+1];_.push(b===y?null:x.subarray(b,y))}const w=x[3+_.length+1];this.keys=x.subarray(x[3+_.length],w),this.bboxes=x.subarray(w),this.insert=this._insertReadonly}else{this.d=b+2*y;for(let v=0;v<this.d*this.d;v++)_.push([]);this.keys=[],this.bboxes=[]}this.n=b,this.extent=v,this.padding=y,this.scale=b/v,this.uid=0;const x=y/b*v;this.min=-x,this.max=v+x}insert(v,b,y,_,x){this._forEachCell(b,y,_,x,this._insertCell,this.uid++,void 0,void 0),this.keys.push(v),this.bboxes.push(b),this.bboxes.push(y),this.bboxes.push(_),this.bboxes.push(x)}_insertReadonly(){throw Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(v,b,y,_,x,w){this.cells[x].push(w)}query(v,b,y,_,x){let w=this.min,k=this.max;if(v<=w&&b<=w&&k<=y&&k<=_&&!x)return Array.prototype.slice.call(this.keys);{let w=[];return this._forEachCell(v,b,y,_,this._queryCell,w,{},x),w}}_queryCell(v,b,y,_,x,w,k,A){let C=this.cells[x];if(null!==C){let x=this.keys,E=this.bboxes;for(let S=0;S<C.length;S++){let T=C[S];if(void 0===k[T]){let C=4*T;(A?A(E[C+0],E[C+1],E[C+2],E[C+3]):v<=E[C+2]&&b<=E[C+3]&&y>=E[C+0]&&_>=E[C+1])?(k[T]=!0,w.push(x[T])):k[T]=!1}}}}_forEachCell(v,b,y,_,x,w,k,A){let C=this._convertToCellCoord(v),E=this._convertToCellCoord(b),S=this._convertToCellCoord(y),T=this._convertToCellCoord(_);for(let O=C;O<=S;O++)for(let C=E;C<=T;C++){let E=this.d*C+O;if((!A||A(this._convertFromCellCoord(O),this._convertFromCellCoord(C),this._convertFromCellCoord(O+1),this._convertFromCellCoord(C+1)))&&x.call(this,v,b,y,_,E,w,k,A))return}}_convertFromCellCoord(v){return(v-this.padding)/this.scale}_convertToCellCoord(v){return Math.max(0,Math.min(this.d-1,Math.floor(v*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let v=this.cells,b=3+this.cells.length+1+1,y=0;for(let v=0;v<this.cells.length;v++)y+=this.cells[v].length;let _=new Int32Array(b+y+this.keys.length+this.bboxes.length);_[0]=this.extent,_[1]=this.n,_[2]=this.padding;let x=b;for(let b=0;b<v.length;b++){let y=v[b];_[3+b]=x,_.set(y,x),x+=y.length}return _[3+v.length]=x,_.set(this.keys,x),x+=this.keys.length,_[3+v.length+1]=x,_.set(this.bboxes,x),x+=this.bboxes.length,_.buffer}static serialize(v,b){let y=v.toArrayBuffer();return b&&b.push(y),{buffer:y}}static deserialize(v){return new rL(v.buffer)}}let rN={};function rz(v,b,y={}){if(rN[v])throw Error(`${v} is already registered.`);Object.defineProperty(b,"_classRegistryKey",{value:v,writeable:!1}),rN[v]={klass:b,omit:y.omit||[],shallow:y.shallow||[]}}for(let v in rz("Object",Object),rz("Set",Set),rz("TransferableGridIndex",rL),rz("Color",t6),rz("Error",Error),rz("AJAXError",e4),rz("ResolvedImage",ns),rz("StylePropertyFunction",iK),rz("StyleExpression",iH,{omit:["_evaluator"]}),rz("ZoomDependentExpression",iZ),rz("ZoomConstantExpression",iY),rz("CompoundExpression",iA,{omit:["_evaluate"]}),ik)ik[v]._classRegistryKey||rz(`Expression_${v}`,ik[v]);function rj(v){return v&&"u">typeof ArrayBuffer&&(v instanceof ArrayBuffer||v.constructor&&"ArrayBuffer"===v.constructor.name)}function rB(v){return v.$name||v.constructor._classRegistryKey}function r$(v){return!function(v){if(null===v||"object"!=typeof v)return!1;let b=rB(v);return!(!b||"Object"===b)}(v)&&(null==v||"boolean"==typeof v||"number"==typeof v||"string"==typeof v||v instanceof Boolean||v instanceof Number||v instanceof String||v instanceof Date||v instanceof RegExp||v instanceof Blob||v instanceof Error||rj(v)||eH(v)||ArrayBuffer.isView(v)||v instanceof ImageData)}function rU(v,b){if(r$(v))return(rj(v)||eH(v))&&b&&b.push(v),ArrayBuffer.isView(v)&&b&&b.push(v.buffer),v instanceof ImageData&&b&&b.push(v.data.buffer),v;if(Array.isArray(v)){let y=[];for(let _ of v)y.push(rU(_,b));return y}if("object"!=typeof v)throw Error("can't serialize object of type "+typeof v);let y=rB(v);if(!y)throw Error(`can't serialize object of unregistered class ${v.constructor.name}`);if(!rN[y])throw Error(`${y} is not registered.`);let{klass:_}=rN[y],x=_.serialize?_.serialize(v,b):{};if(_.serialize){if(b&&x===b[b.length-1])throw Error("statically serialized object won't survive transfer of $name property")}else{for(let _ in v){if(!v.hasOwnProperty(_)||rN[y].omit.indexOf(_)>=0)continue;let w=v[_];x[_]=rN[y].shallow.indexOf(_)>=0?w:rU(w,b)}v instanceof Error&&(x.message=v.message)}if(x.$name)throw Error("$name property is reserved for worker serialization logic.");return"Object"!==y&&(x.$name=y),x}function rV(v){if(r$(v))return v;if(Array.isArray(v))return v.map(rV);if("object"!=typeof v)throw Error("can't deserialize object of type "+typeof v);let b=rB(v)||"Object";if(!rN[b])throw Error(`can't deserialize unregistered class ${b}`);let{klass:y}=rN[b];if(!y)throw Error(`can't deserialize unregistered class ${b}`);if(y.deserialize)return y.deserialize(v);let _=Object.create(y.prototype);for(let y of Object.keys(v)){if("$name"===y)continue;let x=v[y];_[y]=rN[b].shallow.indexOf(y)>=0?x:rV(x)}return _}class rq{constructor(){this.first=!0}update(v,b){let y=Math.floor(v);return this.first?(this.first=!1,this.lastIntegerZoom=y,this.lastIntegerZoomTime=0,this.lastZoom=v,this.lastFloorZoom=y,!0):(this.lastFloorZoom>y?(this.lastIntegerZoom=y+1,this.lastIntegerZoomTime=b):this.lastFloorZoom<y&&(this.lastIntegerZoom=y,this.lastIntegerZoomTime=b),v!==this.lastZoom&&(this.lastZoom=v,this.lastFloorZoom=y,!0))}}function rH(v){return/[\u02EA\u02EB\u1100-\u11FF\u1400-\u167F\u18B0-\u18F5\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u3007\u3012\u3013\u3020-\u302F\u3031-\u303F\u3041-\u3096\u309D-\u30FB\u30FD-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE48\uFE50-\uFE57\uFE5F-\uFE62\uFE67-\uFE6F\uFF00-\uFF07\uFF0A-\uFF0C\uFF0E-\uFF19\uFF1F-\uFF3A\uFF3C\uFF3E\uFF40-\uFF5A\uFFE0-\uFFE2\uFFE4-\uFFE7]|\uD802[\uDD80-\uDD9F]|\uD805[\uDD80-\uDDFF]|\uD806[\uDE00-\uDEBF]|\uD811[\uDC00-\uDE7F]|\uD81B[\uDFE0-\uDFE4\uDFF0-\uDFF6]|[\uD81C-\uD822\uD83D\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD30-\uDEFB]|\uD833[\uDEC0-\uDFCF]|\uD834[\uDC00-\uDDFF\uDEE0-\uDF7F]|\uD836[\uDC00-\uDEAF]|\uD83C[\uDC00-\uDE00\uDF00-\uDFFF]|\uD83E[\uDD00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(v))}function rW(v){return/\s/u.test(String.fromCodePoint(v))}function rG(v){for(let b of v)if(rH(b.codePointAt(0)))return!0;return!1}function rY(v){return RegExp(v.map(v=>{try{return RegExp(`\\p{sc=${v}}`,"u").source}catch(v){return null}}).filter(v=>v).join("|"),"u")}let rZ=rY(["Arab","Dupl","Mong","Ougr","Syrc"]);function rX(v){return!(rH(v)||/[\xA7\xA9\xAE\xB1\xBC-\xBE\xD7\xF7\u2016\u2020\u2021\u2030\u2031\u203B\u203C\u2042\u2047-\u2049\u2051\u2100-\u218F\u221E\u2234\u2235\u2300-\u2307\u230C-\u231F\u2324-\u2328\u232B\u237D-\u239A\u23BE-\u23CD\u23CF\u23D1-\u23DB\u23E2-\u2422\u2424-\u24FF\u25A0-\u2619\u2620-\u2767\u2776-\u2793\u2B12-\u2B2F\u2B50-\u2B59\u2BB8-\u2BEB\u3000-\u303F\u30A0-\u30FF\uE000-\uF8FF\uFE30-\uFE6F\uFF00-\uFFEF\uFFFC\uFFFD]|[\uDB80-\uDBFF][\uDC00-\uDFFF]/gim.test(String.fromCodePoint(v)))}let rK=rY(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function rJ(v){return rK.test(String.fromCodePoint(v))}let rQ=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(v){this.pluginStatus=v.pluginStatus,this.pluginURL=v.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(v){if(rQ.isParsed())throw Error("RTL text plugin already registered.");this.applyArabicShaping=v.applyArabicShaping,this.processBidirectionalText=v.processBidirectionalText,this.processStyledBidirectionalText=v.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return null!=this.applyArabicShaping&&null!=this.processBidirectionalText&&null!=this.processStyledBidirectionalText}getRTLTextPluginStatus(){return this.pluginStatus}syncState(v,b){return N(this,void 0,void 0,function*(){if(this.isParsed())return this.getState();if("loading"!==v.pluginStatus)return this.setState(v),v;let y=v.pluginURL,_=new Promise(v=>{this.loadScriptResolve=v});b(y);let x=new Promise(v=>setTimeout(()=>v(),this.TIMEOUT));if(yield Promise.race([_,x]),this.isParsed()){let v={pluginStatus:"loaded",pluginURL:y};return this.setState(v),v}throw this.setState({pluginStatus:"error",pluginURL:""}),Error(`RTL Text Plugin failed to import scripts from ${y}`)})}};class r0{constructor(v,b){this.isSupportedScript=r1,this.zoom=v,b?(this.now=b.now||0,this.fadeDuration=b.fadeDuration||0,this.zoomHistory=b.zoomHistory||new rq,this.transition=b.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new rq,this.transition={})}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let v=this.zoom,b=v-Math.floor(v),y=this.crossFadingFactor();return v>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:b+(1-b)*y}:{fromScale:.5,toScale:1,t:1-(1-y)*b}}}function r1(v){var b,y="loaded"===rQ.getRTLTextPluginStatus();for(let _ of v)if(b=_.codePointAt(0),!y&&rJ(b)||/[\u0900-\u0DFF\u0F00-\u109F\u1780-\u17FF]/gim.test(String.fromCodePoint(b)))return!1;return!0}let r2="-transition";class r5{constructor(v,b,y){this.property=v,this.value=b,this.expression=function(v,b,y){if(iz(v))return new iK(v,b);if(iW(v)){let _=iX(v,b,y);if("error"===_.result)throw Error(_.value.map(v=>`${v.key}: ${v.message}`).join(", "));return _.value}{let y=v;return"color"===b.type&&"string"==typeof v?y=t6.parse(v):"padding"===b.type&&("number"==typeof v||Array.isArray(v))?y=nt.parse(v):"numberArray"===b.type&&("number"==typeof v||Array.isArray(v))?y=nn.parse(v):"colorArray"===b.type&&("string"==typeof v||Array.isArray(v))?y=ni.parse(v):"variableAnchorOffsetCollection"===b.type&&Array.isArray(v)?y=na.parse(v):"projectionDefinition"===b.type&&"string"==typeof v&&(y=nl.parse(v)),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>y}}}(void 0===b?v.specification.default:b,v.specification,y)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(v,b,y){return this.property.possiblyEvaluate(this,v,b,y)}}class r3{constructor(v,b){this.property=v,this.value=new r5(v,void 0,b)}transitioned(v,b){return new r6(this.property,this.value,b,eP({},v.transition,this.transition),v.now)}untransitioned(){return new r6(this.property,this.value,null,{},0)}}class r4{constructor(v,b){this._properties=v,this._values=Object.create(v.defaultTransitionablePropertyValues),this._globalState=b}getValue(v){return ej(this._values[v].value.value)}setValue(v,b){Object.prototype.hasOwnProperty.call(this._values,v)||(this._values[v]=new r3(this._values[v].property,this._globalState)),this._values[v].value=new r5(this._values[v].property,null===b?void 0:ej(b),this._globalState)}getTransition(v){return ej(this._values[v].transition)}setTransition(v,b){Object.prototype.hasOwnProperty.call(this._values,v)||(this._values[v]=new r3(this._values[v].property,this._globalState)),this._values[v].transition=ej(b)||void 0}serialize(){let v={};for(let b of Object.keys(this._values)){let y=this.getValue(b);void 0!==y&&(v[b]=y);let _=this.getTransition(b);void 0!==_&&(v[`${b}${r2}`]=_)}return v}transitioned(v,b){let y=new r8(this._properties);for(let _ of Object.keys(this._values))y._values[_]=this._values[_].transitioned(v,b._values[_]);return y}untransitioned(){let v=new r8(this._properties);for(let b of Object.keys(this._values))v._values[b]=this._values[b].untransitioned();return v}}class r6{constructor(v,b,y,_,x){this.property=v,this.value=b,this.begin=x+_.delay||0,this.end=this.begin+_.duration||0,v.specification.transition&&(_.delay||_.duration)&&(this.prior=y)}possiblyEvaluate(v,b,y){let _=v.now||0,x=this.value.possiblyEvaluate(v,b,y),w=this.prior;if(w){if(_>this.end||this.value.isDataDriven())return this.prior=null,x;if(_<this.begin)return w.possiblyEvaluate(v,b,y);{let k=(_-this.begin)/(this.end-this.begin);return this.property.interpolate(w.possiblyEvaluate(v,b,y),x,eF(k))}}return x}}class r8{constructor(v){this._properties=v,this._values=Object.create(v.defaultTransitioningPropertyValues)}possiblyEvaluate(v,b,y){let _=new oe(this._properties);for(let x of Object.keys(this._values))_._values[x]=this._values[x].possiblyEvaluate(v,b,y);return _}hasTransition(){for(let v of Object.keys(this._values))if(this._values[v].prior)return!0;return!1}}class r7{constructor(v,b){this._properties=v,this._values=Object.create(v.defaultPropertyValues),this._globalState=b}hasValue(v){return void 0!==this._values[v].value}getValue(v){return ej(this._values[v].value)}setValue(v,b){this._values[v]=new r5(this._values[v].property,null===b?void 0:ej(b),this._globalState)}serialize(){let v={};for(let b of Object.keys(this._values)){let y=this.getValue(b);void 0!==y&&(v[b]=y)}return v}possiblyEvaluate(v,b,y){let _=new oe(this._properties);for(let x of Object.keys(this._values))_._values[x]=this._values[x].possiblyEvaluate(v,b,y);return _}}class r9{constructor(v,b,y){this.property=v,this.value=b,this.parameters=y}isConstant(){return"constant"===this.value.kind}constantOr(v){return"constant"===this.value.kind?this.value.value:v}evaluate(v,b,y,_){return this.property.evaluate(this.value,this.parameters,v,b,y,_)}}class oe{constructor(v){this._properties=v,this._values=Object.create(v.defaultPossiblyEvaluatedValues)}get(v){return this._values[v]}}class ot{constructor(v){this.specification=v}possiblyEvaluate(v,b){if(v.isDataDriven())throw Error("Value should not be data driven");return v.expression.evaluate(b)}interpolate(v,b,y){let _=nD[this.specification.type];return _?_(v,b,y):v}}class on{constructor(v,b){this.specification=v,this.overrides=b}possiblyEvaluate(v,b,y,_){return new r9(this,"constant"===v.expression.kind||"camera"===v.expression.kind?{kind:"constant",value:v.expression.evaluate(b,null,{},y,_)}:v.expression,b)}interpolate(v,b,y){if("constant"!==v.value.kind||"constant"!==b.value.kind)return v;if(void 0===v.value.value||void 0===b.value.value)return new r9(this,{kind:"constant",value:void 0},v.parameters);let _=nD[this.specification.type];return _?new r9(this,{kind:"constant",value:_(v.value.value,b.value.value,y)},v.parameters):v}evaluate(v,b,y,_,x,w){return"constant"===v.kind?v.value:v.evaluate(b,y,_,x,w)}}class oi extends on{possiblyEvaluate(v,b,y,_){if(void 0===v.value)return new r9(this,{kind:"constant",value:void 0},b);if("constant"===v.expression.kind){let x=v.expression.evaluate(b,null,{},y,_),w="resolvedImage"===v.property.specification.type&&"string"!=typeof x?x.name:x;return new r9(this,{kind:"constant",value:this._calculate(w,w,w,b)},b)}return"camera"===v.expression.kind?new r9(this,{kind:"constant",value:this._calculate(v.expression.evaluate({zoom:b.zoom-1}),v.expression.evaluate({zoom:b.zoom}),v.expression.evaluate({zoom:b.zoom+1}),b)},b):new r9(this,v.expression,b)}evaluate(v,b,y,_,x,w){if("source"===v.kind){let k=v.evaluate(b,y,_,x,w);return this._calculate(k,k,k,b)}return"composite"===v.kind?this._calculate(v.evaluate({zoom:Math.floor(b.zoom)-1},y,_),v.evaluate({zoom:Math.floor(b.zoom)},y,_),v.evaluate({zoom:Math.floor(b.zoom)+1},y,_),b):v.value}_calculate(v,b,y,_){return _.zoom>_.zoomHistory.lastIntegerZoom?{from:v,to:b}:{from:y,to:b}}interpolate(v){return v}}class or{constructor(v){this.specification=v}possiblyEvaluate(v,b,y,_){if(void 0!==v.value){if("constant"===v.expression.kind){let x=v.expression.evaluate(b,null,{},y,_);return this._calculate(x,x,x,b)}return this._calculate(v.expression.evaluate(new r0(Math.floor(b.zoom-1),b)),v.expression.evaluate(new r0(Math.floor(b.zoom),b)),v.expression.evaluate(new r0(Math.floor(b.zoom+1),b)),b)}}_calculate(v,b,y,_){return _.zoom>_.zoomHistory.lastIntegerZoom?{from:v,to:b}:{from:y,to:b}}interpolate(v){return v}}class oo{constructor(v){this.specification=v}possiblyEvaluate(v,b,y,_){return!!v.expression.evaluate(b,null,{},y,_)}interpolate(){return!1}}class oa{constructor(v){for(const b in this.properties=v,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],v){const y=v[b];y.specification.overridable&&this.overridableProperties.push(b);const _=this.defaultPropertyValues[b]=new r5(y,void 0,void 0),x=this.defaultTransitionablePropertyValues[b]=new r3(y,void 0);this.defaultTransitioningPropertyValues[b]=x.untransitioned(),this.defaultPossiblyEvaluatedValues[b]=_.possiblyEvaluate({})}}}rz("DataDrivenProperty",on),rz("DataConstantProperty",ot),rz("CrossFadedDataDrivenProperty",oi),rz("CrossFadedProperty",or),rz("ColorRampProperty",oo);class os extends ti{constructor(v,b,y){if(super(),this.id=v.id,this.type=v.type,this._globalState=y,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=function(v,b){return new rF(v,b)}(this.visibility,y),"custom"!==v.type&&(this.metadata=v.metadata,this.minzoom=v.minzoom,this.maxzoom=v.maxzoom,"background"!==v.type&&(this.source=v.source,this.sourceLayer=v["source-layer"],this.filter=v.filter,this._featureFilter=i2(v.filter,y)),b.layout&&(this._unevaluatedLayout=new r7(b.layout,y)),b.paint)){for(const _ in this._transitionablePaint=new r4(b.paint,y),v.paint)this.setPaintProperty(_,v.paint[_],{validate:!1});for(const b in v.layout)this.setLayoutProperty(b,v.layout[b],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new oe(b.paint)}}setFilter(v){this.filter=v,this._featureFilter=i2(v,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(v){return"visibility"===v?this.visibility:this._unevaluatedLayout.getValue(v)}getLayoutAffectingGlobalStateRefs(){let v=new Set;for(let b of this._visibilityExpression.getGlobalStateRefs())v.add(b);if(this._unevaluatedLayout)for(let b in this._unevaluatedLayout._values)for(let y of this._unevaluatedLayout._values[b].getGlobalStateRefs())v.add(y);for(let b of this._featureFilter.getGlobalStateRefs())v.add(b);return v}getPaintAffectingGlobalStateRefs(){var v;let b=new globalThis.Map;if(this._transitionablePaint)for(let y in this._transitionablePaint._values){let _=this._transitionablePaint._values[y].value;for(let x of _.getGlobalStateRefs()){let w=null!=(v=b.get(x))?v:[];w.push({name:y,value:_.value}),b.set(x,w)}}return b}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(v,b,y={}){if(null==b||!this._validate(rD,`layers.${this.id}.layout.${v}`,v,b,y))return"visibility"===v?(this.visibility=b,this._visibilityExpression.setValue(b),void this.recalculateVisibility()):void this._unevaluatedLayout.setValue(v,b)}getPaintProperty(v){return v.endsWith(r2)?this._transitionablePaint.getTransition(v.slice(0,-11)):this._transitionablePaint.getValue(v)}setPaintProperty(v,b,y={}){if(null!=b&&this._validate(rR,`layers.${this.id}.paint.${v}`,v,b,y))return!1;if(v.endsWith(r2))return this._transitionablePaint.setTransition(v.slice(0,-11),b||void 0),!1;{let y=this._transitionablePaint._values[v],_="cross-faded-data-driven"===y.property.specification["property-type"],x=y.value.isDataDriven(),w=y.value;this._transitionablePaint.setValue(v,b),this._handleSpecialPaintPropertyUpdate(v);let k=this._transitionablePaint._values[v].value;return k.isDataDriven()||x||_||this._handleOverridablePaintPropertyUpdate(v,w,k)}}_handleSpecialPaintPropertyUpdate(v){}_handleOverridablePaintPropertyUpdate(v,b,y){return!1}isHidden(v=this.minzoom,b=!1){return!!(this.minzoom&&v<(b?Math.floor(this.minzoom):this.minzoom))||!!(this.maxzoom&&v>=this.maxzoom)||"none"===this._evaluatedVisibility}updateTransitions(v){this._transitioningPaint=this._transitionablePaint.transitioned(v,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(v,b){v.getCrossfadeParameters&&(this._crossfadeParameters=v.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(v,void 0,b)),this.paint=this._transitioningPaint.possiblyEvaluate(v,void 0,b)}serialize(){let v={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(v.layout=v.layout||{},v.layout.visibility=this.visibility),ez(v,(v,b)=>!(void 0===v||"layout"===b&&!Object.keys(v).length||"paint"===b&&!Object.keys(v).length))}_validate(v,b,y,_,x={}){return(!x||!1!==x.validate)&&rP(this,v.call(rC,{key:b,layerType:this.type,objectKey:y,value:_,styleSpec:tr,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let v in this.paint._values){let b=this.paint.get(v);if(b instanceof r9&&iD(b.property.specification)&&("source"===b.value.kind||"composite"===b.value.kind)&&b.value.isStateDependent)return!0}return!1}}var ol={get paint(){return w=w||new oa({"raster-opacity":new ot(tr.paint_raster["raster-opacity"]),"raster-hue-rotate":new ot(tr.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new ot(tr.paint_raster["raster-brightness-min"]),"raster-brightness-max":new ot(tr.paint_raster["raster-brightness-max"]),"raster-saturation":new ot(tr.paint_raster["raster-saturation"]),"raster-contrast":new ot(tr.paint_raster["raster-contrast"]),"raster-resampling":new ot(tr.paint_raster["raster-resampling"]),"raster-fade-duration":new ot(tr.paint_raster["raster-fade-duration"])})}};class oc extends os{constructor(v,b){super(v,ol,b)}}let ou={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class od{constructor(v,b){this._structArray=v,this._pos1=b*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class oh{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(v,b){return v._trim(),b&&(v.isTransferred=!0,b.push(v.arrayBuffer)),{length:v.length,arrayBuffer:v.arrayBuffer}}static deserialize(v){let b=Object.create(this.prototype);return b.arrayBuffer=v.arrayBuffer,b.length=v.length,b.capacity=v.arrayBuffer.byteLength/b.bytesPerElement,b._refreshViews(),b}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(v){this.reserve(v),this.length=v}reserve(v){if(v>this.capacity){this.capacity=Math.max(v,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let b=this.uint8;this._refreshViews(),b&&this.uint8.set(b)}}_refreshViews(){throw Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function op(v,b=1){let y=0,_=0;return{members:v.map(v=>{let x=ou[v.type].BYTES_PER_ELEMENT,w=y=of(y,Math.max(b,x)),k=v.components||1;return _=Math.max(_,x),y+=x*k,{name:v.name,type:v.type,components:k,offset:w}}),size:of(y,Math.max(_,b)),alignment:b}}function of(v,b){return Math.ceil(v/b)*b}class om extends oh{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(v,b){let y=this.length;return this.resize(y+1),this.emplace(y,v,b)}emplace(v,b,y){let _=2*v;return this.int16[_+0]=b,this.int16[_+1]=y,v}}om.prototype.bytesPerElement=4,rz("StructArrayLayout2i4",om);class og extends oh{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(v,b,y){let _=this.length;return this.resize(_+1),this.emplace(_,v,b,y)}emplace(v,b,y,_){let x=3*v;return this.int16[x+0]=b,this.int16[x+1]=y,this.int16[x+2]=_,v}}og.prototype.bytesPerElement=6,rz("StructArrayLayout3i6",og);class ov extends oh{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(v,b,y,_){let x=this.length;return this.resize(x+1),this.emplace(x,v,b,y,_)}emplace(v,b,y,_,x){let w=4*v;return this.int16[w+0]=b,this.int16[w+1]=y,this.int16[w+2]=_,this.int16[w+3]=x,v}}ov.prototype.bytesPerElement=8,rz("StructArrayLayout4i8",ov);class ob extends oh{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(v,b,y,_,x,w){let k=this.length;return this.resize(k+1),this.emplace(k,v,b,y,_,x,w)}emplace(v,b,y,_,x,w,k){let A=6*v;return this.int16[A+0]=b,this.int16[A+1]=y,this.int16[A+2]=_,this.int16[A+3]=x,this.int16[A+4]=w,this.int16[A+5]=k,v}}ob.prototype.bytesPerElement=12,rz("StructArrayLayout2i4i12",ob);class oy extends oh{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(v,b,y,_,x,w){let k=this.length;return this.resize(k+1),this.emplace(k,v,b,y,_,x,w)}emplace(v,b,y,_,x,w,k){let A=4*v,C=8*v;return this.int16[A+0]=b,this.int16[A+1]=y,this.uint8[C+4]=_,this.uint8[C+5]=x,this.uint8[C+6]=w,this.uint8[C+7]=k,v}}oy.prototype.bytesPerElement=8,rz("StructArrayLayout2i4ub8",oy);class o_ extends oh{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(v,b){let y=this.length;return this.resize(y+1),this.emplace(y,v,b)}emplace(v,b,y){let _=2*v;return this.float32[_+0]=b,this.float32[_+1]=y,v}}o_.prototype.bytesPerElement=8,rz("StructArrayLayout2f8",o_);class ox extends oh{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(v,b,y,_,x,w,k,A,C,E){let S=this.length;return this.resize(S+1),this.emplace(S,v,b,y,_,x,w,k,A,C,E)}emplace(v,b,y,_,x,w,k,A,C,E,S){let T=10*v;return this.uint16[T+0]=b,this.uint16[T+1]=y,this.uint16[T+2]=_,this.uint16[T+3]=x,this.uint16[T+4]=w,this.uint16[T+5]=k,this.uint16[T+6]=A,this.uint16[T+7]=C,this.uint16[T+8]=E,this.uint16[T+9]=S,v}}ox.prototype.bytesPerElement=20,rz("StructArrayLayout10ui20",ox);class ow extends oh{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(v,b,y,_,x,w,k,A){let C=this.length;return this.resize(C+1),this.emplace(C,v,b,y,_,x,w,k,A)}emplace(v,b,y,_,x,w,k,A,C){let E=8*v;return this.uint16[E+0]=b,this.uint16[E+1]=y,this.uint16[E+2]=_,this.uint16[E+3]=x,this.uint16[E+4]=w,this.uint16[E+5]=k,this.uint16[E+6]=A,this.uint16[E+7]=C,v}}ow.prototype.bytesPerElement=16,rz("StructArrayLayout8ui16",ow);class ok extends oh{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(v,b,y,_,x,w,k,A,C,E,S,T){let O=this.length;return this.resize(O+1),this.emplace(O,v,b,y,_,x,w,k,A,C,E,S,T)}emplace(v,b,y,_,x,w,k,A,C,E,S,T,O){let F=12*v;return this.int16[F+0]=b,this.int16[F+1]=y,this.int16[F+2]=_,this.int16[F+3]=x,this.uint16[F+4]=w,this.uint16[F+5]=k,this.uint16[F+6]=A,this.uint16[F+7]=C,this.int16[F+8]=E,this.int16[F+9]=S,this.int16[F+10]=T,this.int16[F+11]=O,v}}ok.prototype.bytesPerElement=24,rz("StructArrayLayout4i4ui4i24",ok);class oA extends oh{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(v,b,y){let _=this.length;return this.resize(_+1),this.emplace(_,v,b,y)}emplace(v,b,y,_){let x=3*v;return this.float32[x+0]=b,this.float32[x+1]=y,this.float32[x+2]=_,v}}oA.prototype.bytesPerElement=12,rz("StructArrayLayout3f12",oA);class oC extends oh{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(v){let b=this.length;return this.resize(b+1),this.emplace(b,v)}emplace(v,b){return this.uint32[+v+0]=b,v}}oC.prototype.bytesPerElement=4,rz("StructArrayLayout1ul4",oC);class oE extends oh{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(v,b,y,_,x,w,k,A,C){let E=this.length;return this.resize(E+1),this.emplace(E,v,b,y,_,x,w,k,A,C)}emplace(v,b,y,_,x,w,k,A,C,E){let S=10*v;return this.int16[S+0]=b,this.int16[S+1]=y,this.int16[S+2]=_,this.int16[S+3]=x,this.int16[S+4]=w,this.int16[S+5]=k,this.uint32[5*v+3]=A,this.uint16[S+8]=C,this.uint16[S+9]=E,v}}oE.prototype.bytesPerElement=20,rz("StructArrayLayout6i1ul2ui20",oE);class oS extends oh{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(v,b,y,_,x,w){let k=this.length;return this.resize(k+1),this.emplace(k,v,b,y,_,x,w)}emplace(v,b,y,_,x,w,k){let A=6*v;return this.int16[A+0]=b,this.int16[A+1]=y,this.int16[A+2]=_,this.int16[A+3]=x,this.int16[A+4]=w,this.int16[A+5]=k,v}}oS.prototype.bytesPerElement=12,rz("StructArrayLayout2i2i2i12",oS);class oT extends oh{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(v,b,y,_,x){let w=this.length;return this.resize(w+1),this.emplace(w,v,b,y,_,x)}emplace(v,b,y,_,x,w){let k=4*v,A=8*v;return this.float32[k+0]=b,this.float32[k+1]=y,this.float32[k+2]=_,this.int16[A+6]=x,this.int16[A+7]=w,v}}oT.prototype.bytesPerElement=16,rz("StructArrayLayout2f1f2i16",oT);class oO extends oh{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(v,b,y,_,x,w){let k=this.length;return this.resize(k+1),this.emplace(k,v,b,y,_,x,w)}emplace(v,b,y,_,x,w,k){let A=16*v,C=4*v,E=8*v;return this.uint8[A+0]=b,this.uint8[A+1]=y,this.float32[C+1]=_,this.float32[C+2]=x,this.int16[E+6]=w,this.int16[E+7]=k,v}}oO.prototype.bytesPerElement=16,rz("StructArrayLayout2ub2f2i16",oO);class oF extends oh{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(v,b,y){let _=this.length;return this.resize(_+1),this.emplace(_,v,b,y)}emplace(v,b,y,_){let x=3*v;return this.uint16[x+0]=b,this.uint16[x+1]=y,this.uint16[x+2]=_,v}}oF.prototype.bytesPerElement=6,rz("StructArrayLayout3ui6",oF);class oI extends oh{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(v,b,y,_,x,w,k,A,C,E,S,T,O,F,I,M,R){let D=this.length;return this.resize(D+1),this.emplace(D,v,b,y,_,x,w,k,A,C,E,S,T,O,F,I,M,R)}emplace(v,b,y,_,x,w,k,A,C,E,S,T,O,F,I,M,R,D){let P=24*v,L=12*v,N=48*v;return this.int16[P+0]=b,this.int16[P+1]=y,this.uint16[P+2]=_,this.uint16[P+3]=x,this.uint32[L+2]=w,this.uint32[L+3]=k,this.uint32[L+4]=A,this.uint16[P+10]=C,this.uint16[P+11]=E,this.uint16[P+12]=S,this.float32[L+7]=T,this.float32[L+8]=O,this.uint8[N+36]=F,this.uint8[N+37]=I,this.uint8[N+38]=M,this.uint32[L+10]=R,this.int16[P+22]=D,v}}oI.prototype.bytesPerElement=48,rz("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",oI);class oM extends oh{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(v,b,y,_,x,w,k,A,C,E,S,T,O,F,I,M,R,D,P,L,N,z,j,B,U,V,q,H){let W=this.length;return this.resize(W+1),this.emplace(W,v,b,y,_,x,w,k,A,C,E,S,T,O,F,I,M,R,D,P,L,N,z,j,B,U,V,q,H)}emplace(v,b,y,_,x,w,k,A,C,E,S,T,O,F,I,M,R,D,P,L,N,z,j,B,U,V,q,H,W){let G=32*v,Y=16*v;return this.int16[G+0]=b,this.int16[G+1]=y,this.int16[G+2]=_,this.int16[G+3]=x,this.int16[G+4]=w,this.int16[G+5]=k,this.int16[G+6]=A,this.int16[G+7]=C,this.uint16[G+8]=E,this.uint16[G+9]=S,this.uint16[G+10]=T,this.uint16[G+11]=O,this.uint16[G+12]=F,this.uint16[G+13]=I,this.uint16[G+14]=M,this.uint16[G+15]=R,this.uint16[G+16]=D,this.uint16[G+17]=P,this.uint16[G+18]=L,this.uint16[G+19]=N,this.uint16[G+20]=z,this.uint16[G+21]=j,this.uint16[G+22]=B,this.uint32[Y+12]=U,this.float32[Y+13]=V,this.float32[Y+14]=q,this.uint16[G+30]=H,this.uint16[G+31]=W,v}}oM.prototype.bytesPerElement=64,rz("StructArrayLayout8i15ui1ul2f2ui64",oM);class oR extends oh{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(v){let b=this.length;return this.resize(b+1),this.emplace(b,v)}emplace(v,b){return this.float32[+v+0]=b,v}}oR.prototype.bytesPerElement=4,rz("StructArrayLayout1f4",oR);class oD extends oh{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(v,b,y){let _=this.length;return this.resize(_+1),this.emplace(_,v,b,y)}emplace(v,b,y,_){let x=3*v;return this.uint16[6*v+0]=b,this.float32[x+1]=y,this.float32[x+2]=_,v}}oD.prototype.bytesPerElement=12,rz("StructArrayLayout1ui2f12",oD);class oP extends oh{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(v,b,y){let _=this.length;return this.resize(_+1),this.emplace(_,v,b,y)}emplace(v,b,y,_){let x=4*v;return this.uint32[2*v+0]=b,this.uint16[x+2]=y,this.uint16[x+3]=_,v}}oP.prototype.bytesPerElement=8,rz("StructArrayLayout1ul2ui8",oP);class oL extends oh{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(v,b){let y=this.length;return this.resize(y+1),this.emplace(y,v,b)}emplace(v,b,y){let _=2*v;return this.uint16[_+0]=b,this.uint16[_+1]=y,v}}oL.prototype.bytesPerElement=4,rz("StructArrayLayout2ui4",oL);class oN extends oh{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(v){let b=this.length;return this.resize(b+1),this.emplace(b,v)}emplace(v,b){return this.uint16[+v+0]=b,v}}oN.prototype.bytesPerElement=2,rz("StructArrayLayout1ui2",oN);class oz extends oh{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(v,b,y,_){let x=this.length;return this.resize(x+1),this.emplace(x,v,b,y,_)}emplace(v,b,y,_,x){let w=4*v;return this.float32[w+0]=b,this.float32[w+1]=y,this.float32[w+2]=_,this.float32[w+3]=x,v}}oz.prototype.bytesPerElement=16,rz("StructArrayLayout4f16",oz);class oj extends od{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new z(this.anchorPointX,this.anchorPointY)}}oj.prototype.size=20;class oB extends oE{get(v){return new oj(this,v)}}rz("CollisionBoxArray",oB);class o$ extends od{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(v){this._structArray.uint8[this._pos1+37]=v}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(v){this._structArray.uint8[this._pos1+38]=v}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(v){this._structArray.uint32[this._pos4+10]=v}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}o$.prototype.size=48;class oU extends oI{get(v){return new o$(this,v)}}rz("PlacedSymbolArray",oU);class oV extends od{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(v){this._structArray.uint32[this._pos4+12]=v}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}oV.prototype.size=64;class oq extends oM{get(v){return new oV(this,v)}}rz("SymbolInstanceArray",oq);class oH extends oR{getoffsetX(v){return this.float32[+v+0]}}rz("GlyphOffsetArray",oH);class oW extends og{getx(v){return this.int16[3*v+0]}gety(v){return this.int16[3*v+1]}gettileUnitDistanceFromAnchor(v){return this.int16[3*v+2]}}rz("SymbolLineVertexArray",oW);class oG extends od{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}oG.prototype.size=12;class oY extends oD{get(v){return new oG(this,v)}}rz("TextAnchorOffsetArray",oY);class oZ extends od{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}oZ.prototype.size=8;class oX extends oP{get(v){return new oZ(this,v)}}rz("FeatureIndexArray",oX);class oK extends om{}class oJ extends om{}class oQ extends om{}class o0 extends ob{}class o1 extends oy{}class o2 extends o_{}class o5 extends ox{}class o3 extends ow{}class o4 extends ok{}class o6 extends oA{}class o8 extends oC{}class o7 extends oS{}class o9 extends oO{}class ae extends oF{}class at extends oL{}let{members:an}=op([{name:"a_pos",components:2,type:"Int16"}],4);class ai{constructor(v=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=v}prepareSegment(v,b,y,_){let x=this.segments[this.segments.length-1];return v>ai.MAX_VERTEX_ARRAY_LENGTH&&e$(`Max vertices per segment is ${ai.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${v}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${ai.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!x||x.vertexLength+v>ai.MAX_VERTEX_ARRAY_LENGTH||x.sortKey!==_?this.createNewSegment(b,y,_):x}createNewSegment(v,b,y){let _={vertexOffset:v.length,primitiveOffset:b.length,vertexLength:0,primitiveLength:0,vaos:{}};return void 0!==y&&(_.sortKey=y),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(_),_}getOrCreateLatestSegment(v,b,y){return this.prepareSegment(0,v,b,y)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let v of this.segments)for(let b in v.vaos)v.vaos[b].destroy()}static simpleSegment(v,b,y,_){return new ai([{vertexOffset:v,primitiveOffset:b,vertexLength:y,primitiveLength:_,vaos:{},sortKey:0}])}}function ar(v,b){return 256*(v=eR(Math.floor(v),0,255))+eR(Math.floor(b),0,255)}ai.MAX_VERTEX_ARRAY_LENGTH=65535,rz("SegmentVector",ai);let ao=op([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),aa=op([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]);var as,al,ac,au={exports:{}},ad={exports:{}},ah={exports:{}},ap=j(function(){if(ac)return au.exports;ac=1;var v=(as||(as=1,ad.exports=function(v,b){var y,_,x,w,k,A;for(_=v.length-(y=3&v.length),x=b,A=0;A<_;)k=255&v.charCodeAt(A)|(255&v.charCodeAt(++A))<<8|(255&v.charCodeAt(++A))<<16|(255&v.charCodeAt(++A))<<24,++A,x=27492+(65535&(w=5*(65535&(x=(x^=k=(65535&(k=(k=(65535&k)*0xcc9e2d51+(((k>>>16)*0xcc9e2d51&65535)<<16)|0)<<15|k>>>17))*0x1b873593+(((k>>>16)*0x1b873593&65535)<<16)|0)<<13|x>>>19))+((5*(x>>>16)&65535)<<16)|0))+((58964+(w>>>16)&65535)<<16);switch(k=0,y){case 3:k^=(255&v.charCodeAt(A+2))<<16;case 2:k^=(255&v.charCodeAt(A+1))<<8;case 1:x^=k=(65535&(k=(k=(65535&(k^=255&v.charCodeAt(A)))*0xcc9e2d51+(((k>>>16)*0xcc9e2d51&65535)<<16)|0)<<15|k>>>17))*0x1b873593+(((k>>>16)*0x1b873593&65535)<<16)|0}return x^=v.length,x=0x85ebca6b*(65535&(x^=x>>>16))+((0x85ebca6b*(x>>>16)&65535)<<16)|0,x=0xc2b2ae35*(65535&(x^=x>>>13))+((0xc2b2ae35*(x>>>16)&65535)<<16)|0,(x^=x>>>16)>>>0}),ad.exports),b=(al||(al=1,ah.exports=function(v,b){for(var y,_=v.length,x=b^_,w=0;_>=4;)y=0x5bd1e995*(65535&(y=255&v.charCodeAt(w)|(255&v.charCodeAt(++w))<<8|(255&v.charCodeAt(++w))<<16|(255&v.charCodeAt(++w))<<24))+((0x5bd1e995*(y>>>16)&65535)<<16),x=0x5bd1e995*(65535&x)+((0x5bd1e995*(x>>>16)&65535)<<16)^(y=0x5bd1e995*(65535&(y^=y>>>24))+((0x5bd1e995*(y>>>16)&65535)<<16)),_-=4,++w;switch(_){case 3:x^=(255&v.charCodeAt(w+2))<<16;case 2:x^=(255&v.charCodeAt(w+1))<<8;case 1:x=0x5bd1e995*(65535&(x^=255&v.charCodeAt(w)))+((0x5bd1e995*(x>>>16)&65535)<<16)}return x=0x5bd1e995*(65535&(x^=x>>>13))+((0x5bd1e995*(x>>>16)&65535)<<16),(x^=x>>>15)>>>0}),ah.exports);return au.exports=v,au.exports.murmur3=v,au.exports.murmur2=b,au.exports}());class af{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(v,b,y,_){this.ids.push(am(v)),this.positions.push(b,y,_)}getPositions(v){if(!this.indexed)throw Error("Trying to get index, but feature positions are not indexed");let b=am(v),y=0,_=this.ids.length-1;for(;y<_;){let v=y+_>>1;this.ids[v]>=b?_=v:y=v+1}let x=[];for(;this.ids[y]===b;)x.push({index:this.positions[3*y],start:this.positions[3*y+1],end:this.positions[3*y+2]}),y++;return x}static serialize(v,b){let y=new Float64Array(v.ids),_=new Uint32Array(v.positions);return function v(b,y,_,x){for(;_<x;){let w=b[_+x>>1],k=_-1,A=x+1;for(;;){do k++;while(b[k]<w);do A--;while(b[A]>w);if(k>=A)break;ag(b,k,A),ag(y,3*k,3*A),ag(y,3*k+1,3*A+1),ag(y,3*k+2,3*A+2)}A-_<x-A?(v(b,y,_,A),_=A+1):(v(b,y,A+1,x),x=A)}}(y,_,0,y.length-1),b&&b.push(y.buffer,_.buffer),{ids:y,positions:_}}static deserialize(v){let b=new af;return b.ids=v.ids,b.positions=v.positions,b.indexed=!0,b}}function am(v){let b=+v;return!isNaN(b)&&b<=Number.MAX_SAFE_INTEGER?b:ap(String(v))}function ag(v,b,y){let _=v[b];v[b]=v[y],v[y]=_}rz("FeaturePositionMap",af);class av{constructor(v,b){this.gl=v.gl,this.location=b}}class ab extends av{constructor(v,b){super(v,b),this.current=0}set(v){this.current!==v&&(this.current=v,this.gl.uniform1f(this.location,v))}}class ay extends av{constructor(v,b){super(v,b),this.current=[0,0,0,0]}set(v){v[0]===this.current[0]&&v[1]===this.current[1]&&v[2]===this.current[2]&&v[3]===this.current[3]||(this.current=v,this.gl.uniform4f(this.location,v[0],v[1],v[2],v[3]))}}class a_ extends av{constructor(v,b){super(v,b),this.current=t6.transparent}set(v){v.r===this.current.r&&v.g===this.current.g&&v.b===this.current.b&&v.a===this.current.a||(this.current=v,this.gl.uniform4f(this.location,v.r,v.g,v.b,v.a))}}let ax=new Float32Array(16);function aw(v){return[ar(255*v.r,255*v.g),ar(255*v.b,255*v.a)]}class ak{constructor(v,b,y){this.value=v,this.uniformNames=b.map(v=>`u_${v}`),this.type=y}setUniform(v,b,y){v.set(y.constantOr(this.value))}getBinding(v,b,y){return"color"===this.type?new a_(v,b):new ab(v,b)}}class aA{constructor(v,b){this.uniformNames=b.map(v=>`u_${v}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(v,b){this.pixelRatioFrom=b.pixelRatio,this.pixelRatioTo=v.pixelRatio,this.patternFrom=b.tlbr,this.patternTo=v.tlbr}setConstantDashPositions(v,b){this.dashTo=[0,v.y,v.height,v.width],this.dashFrom=[0,b.y,b.height,b.width]}setUniform(v,b,y,_){let x=null;"u_pattern_to"===_?x=this.patternTo:"u_pattern_from"===_?x=this.patternFrom:"u_dasharray_to"===_?x=this.dashTo:"u_dasharray_from"===_?x=this.dashFrom:"u_pixel_ratio_to"===_?x=this.pixelRatioTo:"u_pixel_ratio_from"===_&&(x=this.pixelRatioFrom),null!==x&&v.set(x)}getBinding(v,b,y){return y.startsWith("u_pattern")||y.startsWith("u_dasharray_")?new ay(v,b):new ab(v,b)}}class aC{constructor(v,b,y,_){this.expression=v,this.type=y,this.maxValue=0,this.paintVertexAttributes=b.map(v=>({name:`a_${v}`,type:"Float32",components:"color"===y?2:1,offset:0})),this.paintVertexArray=new _}populatePaintArray(v,b,y){let _=this.paintVertexArray.length,x=this.expression.evaluate(new r0(0,y),b,{},y.canonical,[],y.formattedSection);this.paintVertexArray.resize(v),this._setPaintValue(_,v,x)}updatePaintArray(v,b,y,_,x){let w=this.expression.evaluate(new r0(0,x),y,_);this._setPaintValue(v,b,w)}_setPaintValue(v,b,y){if("color"===this.type){let _=aw(y);for(let y=v;y<b;y++)this.paintVertexArray.emplace(y,_[0],_[1])}else{for(let _=v;_<b;_++)this.paintVertexArray.emplace(_,y);this.maxValue=Math.max(this.maxValue,Math.abs(y))}}upload(v){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=v.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class aE{constructor(v,b,y,_,x,w){this.expression=v,this.uniformNames=b.map(v=>`u_${v}_t`),this.type=y,this.useIntegerZoom=_,this.zoom=x,this.maxValue=0,this.paintVertexAttributes=b.map(v=>({name:`a_${v}`,type:"Float32",components:"color"===y?4:2,offset:0})),this.paintVertexArray=new w}populatePaintArray(v,b,y){let _=this.expression.evaluate(new r0(this.zoom,y),b,{},y.canonical,[],y.formattedSection),x=this.expression.evaluate(new r0(this.zoom+1,y),b,{},y.canonical,[],y.formattedSection),w=this.paintVertexArray.length;this.paintVertexArray.resize(v),this._setPaintValue(w,v,_,x)}updatePaintArray(v,b,y,_,x){let w=this.expression.evaluate(new r0(this.zoom,x),y,_),k=this.expression.evaluate(new r0(this.zoom+1,x),y,_);this._setPaintValue(v,b,w,k)}_setPaintValue(v,b,y,_){if("color"===this.type){let x=aw(y),w=aw(_);for(let y=v;y<b;y++)this.paintVertexArray.emplace(y,x[0],x[1],w[0],w[1])}else{for(let x=v;x<b;x++)this.paintVertexArray.emplace(x,y,_);this.maxValue=Math.max(this.maxValue,Math.abs(y),Math.abs(_))}}upload(v){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=v.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(v,b){let y=this.useIntegerZoom?Math.floor(b.zoom):b.zoom,_=eR(this.expression.interpolationFactor(y,this.zoom,this.zoom+1),0,1);v.set(_)}getBinding(v,b,y){return new ab(v,b)}}class aS{constructor(v,b,y,_,x,w){this.expression=v,this.type=b,this.useIntegerZoom=y,this.zoom=_,this.layerId=w,this.zoomInPaintVertexArray=new x,this.zoomOutPaintVertexArray=new x}populatePaintArray(v,b,y){let _=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(v),this.zoomOutPaintVertexArray.resize(v),this._setPaintValues(_,v,this.getPositionIds(b),y)}updatePaintArray(v,b,y,_,x){this._setPaintValues(v,b,this.getPositionIds(y),x)}_setPaintValues(v,b,y,_){let x=this.getPositions(_);if(!x||!y)return;let w=x[y.min],k=x[y.mid],A=x[y.max];if(w&&k&&A)for(let y=v;y<b;y++)this.emplace(this.zoomInPaintVertexArray,y,k,w),this.emplace(this.zoomOutPaintVertexArray,y,k,A)}upload(v){if(this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer){let b=this.getVertexAttributes();this.zoomInPaintVertexBuffer=v.createVertexBuffer(this.zoomInPaintVertexArray,b,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=v.createVertexBuffer(this.zoomOutPaintVertexArray,b,this.expression.isStateDependent)}}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class aT extends aS{getPositions(v){return v.imagePositions}getPositionIds(v){return v.patterns&&v.patterns[this.layerId]}getVertexAttributes(){return ao.members}emplace(v,b,y,_){v.emplace(b,y.tlbr[0],y.tlbr[1],y.tlbr[2],y.tlbr[3],_.tlbr[0],_.tlbr[1],_.tlbr[2],_.tlbr[3],y.pixelRatio,_.pixelRatio)}}class aO extends aS{getPositions(v){return v.dashPositions}getPositionIds(v){return v.dashes&&v.dashes[this.layerId]}getVertexAttributes(){return aa.members}emplace(v,b,y,_){v.emplace(b,0,y.y,y.height,y.width,0,_.y,_.height,_.width)}}class aF{constructor(v,b,y){this.binders={},this._buffers=[];const _=[];for(const x in v.paint._values){if(!y(x))continue;const w=v.paint.get(x);if(!(w instanceof r9&&iD(w.property.specification)))continue;const k=function(v,b){return({"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-dasharray":["dasharray_to","dasharray_from"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]})[v]||[v.replace(`${b}-`,"").replace(/-/g,"_")]}(x,v.type),A=w.value,C=w.property.specification.type,E=w.property.useIntegerZoom,S=w.property.specification["property-type"],T="cross-faded"===S||"cross-faded-data-driven"===S;if("constant"===A.kind)this.binders[x]=T?new aA(A.value,k):new ak(A.value,k,C),_.push(`/u_${x}`);else if("source"===A.kind||T){const y=aM(x,C,"source");this.binders[x]=T?"line-dasharray"===x?new aO(A,C,E,b,y,v.id):new aT(A,C,E,b,y,v.id):new aC(A,k,C,y),_.push(`/a_${x}`)}else{const v=aM(x,C,"composite");this.binders[x]=new aE(A,k,C,E,b,v),_.push(`/z_${x}`)}}this.cacheKey=_.sort().join("")}getMaxValue(v){let b=this.binders[v];return b instanceof aC||b instanceof aE?b.maxValue:0}populatePaintArrays(v,b,y){for(let _ in this.binders){let x=this.binders[_];(x instanceof aC||x instanceof aE||x instanceof aS)&&x.populatePaintArray(v,b,y)}}setConstantPatternPositions(v,b){for(let y in this.binders){let _=this.binders[y];_ instanceof aA&&_.setConstantPatternPositions(v,b)}}setConstantDashPositions(v,b){for(let y in this.binders){let _=this.binders[y];_ instanceof aA&&_.setConstantDashPositions(v,b)}}updatePaintArrays(v,b,y,_,x){let w=!1;for(let k in v)for(let A of b.getPositions(k)){let b=y.feature(A.index);for(let y in this.binders){let C=this.binders[y];(C instanceof aC||C instanceof aE||C instanceof aS)&&!0===C.expression.isStateDependent&&(C.expression=_.paint.get(y).value,C.updatePaintArray(A.start,A.end,b,v[k],x),w=!0)}}return w}defines(){let v=[];for(let b in this.binders){let y=this.binders[b];(y instanceof ak||y instanceof aA)&&v.push(...y.uniformNames.map(v=>`#define HAS_UNIFORM_${v}`))}return v}getBinderAttributes(){let v=[];for(let b in this.binders){let y=this.binders[b];if(y instanceof aC||y instanceof aE)for(let b=0;b<y.paintVertexAttributes.length;b++)v.push(y.paintVertexAttributes[b].name);else if(y instanceof aS)for(let b of y.getVertexAttributes())v.push(b.name)}return v}getBinderUniforms(){let v=[];for(let b in this.binders){let y=this.binders[b];if(y instanceof ak||y instanceof aA||y instanceof aE)for(let b of y.uniformNames)v.push(b)}return v}getPaintVertexBuffers(){return this._buffers}getUniforms(v,b){let y=[];for(let _ in this.binders){let x=this.binders[_];if(x instanceof ak||x instanceof aA||x instanceof aE){for(let w of x.uniformNames)if(b[w]){let k=x.getBinding(v,b[w],w);y.push({name:w,property:_,binding:k})}}}return y}setUniforms(v,b,y,_){for(let{name:v,property:x,binding:w}of b)this.binders[x].setUniform(w,_,y.get(x),v)}updatePaintBuffers(v){for(let b in this._buffers=[],this.binders){let y=this.binders[b];if(v&&y instanceof aS){let b=2===v.fromScale?y.zoomInPaintVertexBuffer:y.zoomOutPaintVertexBuffer;b&&this._buffers.push(b)}else(y instanceof aC||y instanceof aE)&&y.paintVertexBuffer&&this._buffers.push(y.paintVertexBuffer)}}upload(v){for(let b in this.binders){let y=this.binders[b];(y instanceof aC||y instanceof aE||y instanceof aS)&&y.upload(v)}this.updatePaintBuffers()}destroy(){for(let v in this.binders){let b=this.binders[v];(b instanceof aC||b instanceof aE||b instanceof aS)&&b.destroy()}}}class aI{constructor(v,b,y=()=>!0){for(const _ of(this.programConfigurations={},v))this.programConfigurations[_.id]=new aF(_,b,y);this.needsUpload=!1,this._featureMap=new af,this._bufferOffset=0}populatePaintArrays(v,b,y,_){for(let y in this.programConfigurations)this.programConfigurations[y].populatePaintArrays(v,b,_);void 0!==b.id&&this._featureMap.add(b.id,y,this._bufferOffset,v),this._bufferOffset=v,this.needsUpload=!0}updatePaintArrays(v,b,y,_){for(let x of y)this.needsUpload=this.programConfigurations[x.id].updatePaintArrays(v,this._featureMap,b,x,_)||this.needsUpload}get(v){return this.programConfigurations[v]}upload(v){if(this.needsUpload){for(let b in this.programConfigurations)this.programConfigurations[b].upload(v);this.needsUpload=!1}}destroy(){for(let v in this.programConfigurations)this.programConfigurations[v].destroy()}}function aM(v,b,y){let _={"line-pattern":{source:o5,composite:o5},"fill-pattern":{source:o5,composite:o5},"fill-extrusion-pattern":{source:o5,composite:o5},"line-dasharray":{source:o3,composite:o3}}[v];return _&&_[y]||({color:{source:o_,composite:oz},number:{source:oR,composite:o_}})[b][y]}rz("ConstantBinder",ak),rz("CrossFadedConstantBinder",aA),rz("SourceExpressionBinder",aC),rz("CrossFadedPatternBinder",aT),rz("CrossFadedDasharrayBinder",aO),rz("CompositeExpressionBinder",aE),rz("ProgramConfiguration",aF,{omit:["_buffers"]}),rz("ProgramConfigurationSet",aI);function aR(v){let b=8192/v.extent,y=v.loadGeometry();for(let v=0;v<y.length;v++){let _=y[v];for(let v=0;v<_.length;v++){let y=_[v],x=Math.round(y.x*b),w=Math.round(y.y*b);y.x=eR(x,-16384,16383),y.y=eR(w,-16384,16383),(x<y.x||x>y.x+1||w<y.y||w>y.y+1)&&e$("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return y}function aD(v,b){return{type:v.type,id:v.id,properties:v.properties,geometry:b?aR(v):[]}}class aP{constructor(v){this.zoom=v.zoom,this.overscaling=v.overscaling,this.layers=v.layers,this.layerIds=this.layers.map(v=>v.id),this.index=v.index,this.hasDependencies=!1,this.layoutVertexArray=new oJ,this.indexArray=new ae,this.segments=new ai,this.programConfigurations=new aI(v.layers,v.zoom),this.stateDependentLayerIds=this.layers.filter(v=>v.isStateDependent()).map(v=>v.id)}populate(v,b,y){let _=this.layers[0],x=[],w=null,k=!1,A="heatmap"===_.type;"circle"===_.type&&(k=!(w=_.layout.get("circle-sort-key")).isConstant(),A=A||"map"===_.paint.get("circle-pitch-alignment"));let C=A?b.subdivisionGranularity.circle:1;for(let{feature:b,id:_,index:A,sourceLayerIndex:C}of v){let v=this.layers[0]._featureFilter.needGeometry,E=aD(b,v);if(!this.layers[0]._featureFilter.filter(new r0(this.zoom),E,y))continue;let S=k?w.evaluate(E,{},y):void 0,T={id:_,properties:b.properties,type:b.type,sourceLayerIndex:C,index:A,geometry:v?E.geometry:aR(b),patterns:{},sortKey:S};x.push(T)}for(let _ of(k&&x.sort((v,b)=>v.sortKey-b.sortKey),x)){let{geometry:x,index:w,sourceLayerIndex:k}=_,A=v[w].feature;this.addFeature(_,x,w,y,C),b.featureIndex.insert(A,x,w,k,this.index)}}update(v,b,y){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(v,b,this.stateDependentLayers,{imagePositions:y})}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(v){this.uploaded||(this.layoutVertexBuffer=v.createVertexBuffer(this.layoutVertexArray,an),this.indexBuffer=v.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(v),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(v,b,y,_,x=1){let w;switch(x){case 1:w=[0,7];break;case 3:w=[0,2,5,7];break;case 5:w=[0,1,3,4,6,7];break;case 7:w=[0,1,2,3,4,5,6,7];break;default:throw Error(`Invalid circle bucket granularity: ${x}; valid values are 1, 3, 5, 7.`)}let k=w.length;for(let y of b)for(let b of y){let y=b.x,_=b.y;if(y<0||y>=8192||_<0||_>=8192)continue;let x=this.segments.prepareSegment(k*k,this.layoutVertexArray,this.indexArray,v.sortKey),S=x.vertexLength;for(let v=0;v<k;v++)for(let b=0;b<k;b++){var A,C,E;A=this.layoutVertexArray,C=w[b],E=w[v],A.emplaceBack(-32768+8*y+C,-32768+8*_+E)}for(let v=0;v<k-1;v++)for(let b=0;b<k-1;b++){let y=S+v*k+b,_=S+(v+1)*k+b;this.indexArray.emplaceBack(y,_+1,y+1),this.indexArray.emplaceBack(y,_,_+1)}x.vertexLength+=k*k,x.primitiveLength+=(k-1)*(k-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,v,y,{imagePositions:{},canonical:_})}}function aL(v,b){for(let y=0;y<v.length;y++)if(aV(b,v[y]))return!0;for(let y=0;y<b.length;y++)if(aV(v,b[y]))return!0;return!!aj(v,b)}function aN(v,b,y){return!!aV(v,b)||!!aB(b,v,y)}function az(v,b){if(1===v.length)return aU(b,v[0]);for(let y=0;y<b.length;y++){let _=b[y];for(let b=0;b<_.length;b++)if(aV(v,_[b]))return!0}for(let y=0;y<v.length;y++)if(aU(b,v[y]))return!0;for(let y=0;y<b.length;y++)if(aj(v,b[y]))return!0;return!1}function aj(v,b){if(0===v.length||0===b.length)return!1;for(let k=0;k<v.length-1;k++){let A=v[k],C=v[k+1];for(let v=0;v<b.length-1;v++){var y,_,x,w;if(y=A,_=C,x=b[v],eU(y,x,w=b[v+1])!==eU(_,x,w)&&eU(y,_,x)!==eU(y,_,w))return!0}}return!1}function aB(v,b,y){let _=y*y;if(1===b.length)return v.distSqr(b[0])<_;for(let y=1;y<b.length;y++)if(a$(v,b[y-1],b[y])<_)return!0;return!1}function a$(v,b,y){let _=b.distSqr(y);if(0===_)return v.distSqr(b);let x=((v.x-b.x)*(y.x-b.x)+(v.y-b.y)*(y.y-b.y))/_;return v.distSqr(x<0?b:x>1?y:y.sub(b)._mult(x)._add(b))}function aU(v,b){let y,_,x,w=!1;for(let k=0;k<v.length;k++){y=v[k];for(let v=0,k=y.length-1;v<y.length;k=v++)_=y[v],x=y[k],_.y>b.y!=x.y>b.y&&b.x<(x.x-_.x)*(b.y-_.y)/(x.y-_.y)+_.x&&(w=!w)}return w}function aV(v,b){let y=!1;for(let _=0,x=v.length-1;_<v.length;x=_++){let w=v[_],k=v[x];w.y>b.y!=k.y>b.y&&b.x<(k.x-w.x)*(b.y-w.y)/(k.y-w.y)+w.x&&(y=!y)}return y}function aq(v,b,y){let _=b.paint.get(v).value;return"constant"===_.kind?_.value:y.programConfigurations.get(b.id).getMaxValue(v)}function aH(v){return Math.sqrt(v[0]*v[0]+v[1]*v[1])}function aW(v,b,y,_,x){if(!b[0]&&!b[1])return v;let w=z.convert(b)._mult(x);"viewport"===y&&w._rotate(-_);let k=[];for(let b=0;b<v.length;b++)k.push(v[b].sub(w));return k}function aG({queryGeometry:v,size:b},y){return aN(v,y,b)}function aY({queryGeometry:v,size:b,transform:y,unwrappedTileID:_,getElevation:x},w){return aN(v,w,b*(y.projectTileCoordinates(w.x,w.y,_,x).signedDistanceFromCamera/y.cameraToCenterDistance))}function aZ({queryGeometry:v,size:b,transform:y,unwrappedTileID:_,getElevation:x},w){let k=y.projectTileCoordinates(w.x,w.y,_,x).signedDistanceFromCamera,A=b*(y.cameraToCenterDistance/k);return aN(v,aJ(w,y,_,x),A)}function aX({queryGeometry:v,size:b,transform:y,unwrappedTileID:_,getElevation:x},w){return aN(v,aJ(w,y,_,x),b)}function aK({queryGeometry:v,size:b,transform:y,unwrappedTileID:_,getElevation:x,pitchAlignment:w="map",pitchScale:k="map"},A){let C="map"===w?"map"===k?aG:aY:"map"===k?aZ:aX,E={queryGeometry:v,size:b,transform:y,unwrappedTileID:_,getElevation:x};for(let v of A)for(let b of v)if(C(E,b))return!0;return!1}function aJ(v,b,y,_){let x=b.projectTileCoordinates(v.x,v.y,y,_).point;return new z((.5*x.x+.5)*b.width,(-(.5*x.y)+.5)*b.height)}rz("CircleBucket",aP,{omit:["layers"]});var aQ={get paint(){return A=A||new oa({"circle-radius":new on(tr.paint_circle["circle-radius"]),"circle-color":new on(tr.paint_circle["circle-color"]),"circle-blur":new on(tr.paint_circle["circle-blur"]),"circle-opacity":new on(tr.paint_circle["circle-opacity"]),"circle-translate":new ot(tr.paint_circle["circle-translate"]),"circle-translate-anchor":new ot(tr.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new ot(tr.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new ot(tr.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new on(tr.paint_circle["circle-stroke-width"]),"circle-stroke-color":new on(tr.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new on(tr.paint_circle["circle-stroke-opacity"])})},get layout(){return k=k||new oa({"circle-sort-key":new on(tr.layout_circle["circle-sort-key"])})}};class a0 extends os{constructor(v,b){super(v,aQ,b)}createBucket(v){return new aP(v)}queryRadius(v){return aq("circle-radius",this,v)+aq("circle-stroke-width",this,v)+aH(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:v,feature:b,featureState:y,geometry:_,transform:x,pixelsToTileUnits:w,unwrappedTileID:k,getElevation:A}){let C,E,S=aW(v,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-x.bearingInRadians,w),T=this.paint.get("circle-radius").evaluate(b,y)+this.paint.get("circle-stroke-width").evaluate(b,y),O=this.paint.get("circle-pitch-scale"),F=this.paint.get("circle-pitch-alignment");return"map"===F?(C=S,E=T*w):(C=S.map(v=>aJ(v,x,k,A)),E=T),aK({queryGeometry:C,size:E,transform:x,unwrappedTileID:k,getElevation:A,pitchAlignment:F,pitchScale:O},_)}}class a1 extends aP{}rz("HeatmapBucket",a1,{omit:["layers"]});var a2={get paint(){return C=C||new oa({"heatmap-radius":new on(tr.paint_heatmap["heatmap-radius"]),"heatmap-weight":new on(tr.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new ot(tr.paint_heatmap["heatmap-intensity"]),"heatmap-color":new oo(tr.paint_heatmap["heatmap-color"]),"heatmap-opacity":new ot(tr.paint_heatmap["heatmap-opacity"])})}};function a5(v,{width:b,height:y},_,x){if(x){if(x instanceof Uint8ClampedArray)x=new Uint8Array(x.buffer);else if(x.length!==b*y*_)throw RangeError(`mismatched image size. expected: ${x.length} but got: ${b*y*_}`)}else x=new Uint8Array(b*y*_);return v.width=b,v.height=y,v.data=x,v}function a3(v,{width:b,height:y},_){if(b===v.width&&y===v.height)return;let x=a5({},{width:b,height:y},_);a4(v,x,{x:0,y:0},{x:0,y:0},{width:Math.min(v.width,b),height:Math.min(v.height,y)},_),v.width=b,v.height=y,v.data=x.data}function a4(v,b,y,_,x,w){if(0===x.width||0===x.height)return b;if(x.width>v.width||x.height>v.height||y.x>v.width-x.width||y.y>v.height-x.height)throw RangeError("out of range source coordinates for image copy");if(x.width>b.width||x.height>b.height||_.x>b.width-x.width||_.y>b.height-x.height)throw RangeError("out of range destination coordinates for image copy");let k=v.data,A=b.data;if(k===A)throw Error("srcData equals dstData, so image is already copied");for(let C=0;C<x.height;C++){let E=((y.y+C)*v.width+y.x)*w,S=((_.y+C)*b.width+_.x)*w;for(let v=0;v<x.width*w;v++)A[S+v]=k[E+v]}return b}class a6{constructor(v,b){a5(this,v,1,b)}resize(v){a3(this,v,1)}clone(){return new a6({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(v,b,y,_,x){a4(v,b,y,_,x,1)}}class a8{constructor(v,b){a5(this,v,4,b)}resize(v){a3(this,v,4)}replace(v,b){b?this.data.set(v):this.data=v instanceof Uint8ClampedArray?new Uint8Array(v.buffer):v}clone(){return new a8({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(v,b,y,_,x){a4(v,b,y,_,x,4)}setPixel(v,b,y){let _=4*(v*this.width+b);this.data[_+0]=Math.round(255*y.r/y.a),this.data[_+1]=Math.round(255*y.g/y.a),this.data[_+2]=Math.round(255*y.b/y.a),this.data[_+3]=Math.round(255*y.a)}}function a7(v){let b=new Uint8Array(v.length);for(let y=0;y<v.length;y+=4){let _=v[y+3];b[y+0]=Math.round(v[y+0]*_/255),b[y+1]=Math.round(v[y+1]*_/255),b[y+2]=Math.round(v[y+2]*_/255),b[y+3]=_}return b}function a9(v){let b={},y=v.resolution||256,_=v.clips?v.clips.length:1,x=v.image||new a8({width:y,height:_});if(Math.log(y)/Math.LN2%1!=0)throw Error(`width is not a power of 2 - ${y}`);let w=(_,w,k)=>{b[v.evaluationKey]=k;let A=v.expression.evaluate(b);x.setPixel(_/4/y,w/4,A)};if(v.clips)for(let b=0,x=0;b<_;++b,x+=4*y)for(let _=0,k=0;_<y;_++,k+=4){let A=_/(y-1),{start:C,end:E}=v.clips[b];w(x,k,C*(1-A)+E*A)}else for(let v=0,b=0;v<y;v++,b+=4)w(0,b,v/(y-1));return x}rz("AlphaImage",a6),rz("RGBAImage",a8);let se="big-fb";class st extends os{createBucket(v){return new a1(v)}constructor(v,b){super(v,a2,b),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(v){"heatmap-color"===v&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=a9({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(se)&&this.heatmapFbos.delete(se)}queryRadius(v){return aq("heatmap-radius",this,v)}queryIntersectsFeature({queryGeometry:v,feature:b,featureState:y,geometry:_,transform:x,pixelsToTileUnits:w,unwrappedTileID:k,getElevation:A}){return aK({queryGeometry:v,size:this.paint.get("heatmap-radius").evaluate(b,y)*w,transform:x,unwrappedTileID:k,getElevation:A},_)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&!this.isHidden()}}var sn={get paint(){return E=E||new oa({"hillshade-illumination-direction":new ot(tr.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-altitude":new ot(tr.paint_hillshade["hillshade-illumination-altitude"]),"hillshade-illumination-anchor":new ot(tr.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new ot(tr.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new ot(tr.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new ot(tr.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new ot(tr.paint_hillshade["hillshade-accent-color"]),"hillshade-method":new ot(tr.paint_hillshade["hillshade-method"])})}};class si extends os{constructor(v,b){super(v,sn,b),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let v=this.paint.get("hillshade-illumination-direction").values,b=this.paint.get("hillshade-illumination-altitude").values,y=this.paint.get("hillshade-highlight-color").values,_=this.paint.get("hillshade-shadow-color").values,x=Math.max(v.length,b.length,y.length,_.length);v=v.concat(Array(x-v.length).fill(v.at(-1))),b=b.concat(Array(x-b.length).fill(b.at(-1))),y=y.concat(Array(x-y.length).fill(y.at(-1))),_=_.concat(Array(x-_.length).fill(_.at(-1)));let w=b.map(eZ);return{directionRadians:v.map(eZ),altitudeRadians:w,shadowColor:_,highlightColor:y}}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&!this.isHidden()}}var sr={get paint(){return S=S||new oa({"color-relief-opacity":new ot(tr["paint_color-relief"]["color-relief-opacity"]),"color-relief-color":new oo(tr["paint_color-relief"]["color-relief-color"])})}};class so{constructor(v,b,y,_){this.context=v,this.format=y,this.texture=v.gl.createTexture(),this._ownedHandle=this.texture,this.update(b,_)}update(v,b,y){let{width:_,height:x}=v,w=!(this.size&&this.size[0]===_&&this.size[1]===x||y),{context:k}=this,{gl:A}=k;this.useMipmap=!!(b&&b.useMipmap),A.bindTexture(A.TEXTURE_2D,this.texture),k.pixelStoreUnpackFlipY.set(!1),k.pixelStoreUnpack.set(1);let C=this.format===A.RGBA&&(!b||!1!==b.premultiply);if(w)this.size=[_,x],"data"in v?(k.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(v,C,_,x,A)):(k.pixelStoreUnpackPremultiplyAlpha.set(C),this._uploadDomImage(v,A));else{let{x:b,y:w}=y||{x:0,y:0};"data"in v?(k.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(v,C,b,w,_,x,A)):(k.pixelStoreUnpackPremultiplyAlpha.set(C),this._updateDomImage(v,b,w,A))}this.useMipmap&&this.isSizePowerOfTwo()&&A.generateMipmap(A.TEXTURE_2D),k.pixelStoreUnpackFlipY.setDefault(),k.pixelStoreUnpack.setDefault(),k.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(v,b){b.texImage2D(b.TEXTURE_2D,0,this.format,this.format,b.UNSIGNED_BYTE,v)}_uploadRawData(v,b,y,_,x){let{data:w}=v;b&&w&&(w=a7(w)),x.texImage2D(x.TEXTURE_2D,0,this.format,y,_,0,this.format,x.UNSIGNED_BYTE,w)}_updateDomImage(v,b,y,_){_.texSubImage2D(_.TEXTURE_2D,0,b,y,_.RGBA,_.UNSIGNED_BYTE,v)}_updateRawData(v,b,y,_,x,w,k){let{data:A}=v;b&&A&&(A=a7(A)),k.texSubImage2D(k.TEXTURE_2D,0,y,_,x,w,k.RGBA,k.UNSIGNED_BYTE,A)}bind(v,b,y){let{context:_}=this,{gl:x}=_;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),x.bindTexture(x.TEXTURE_2D,this.texture),y!==x.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(y=x.LINEAR),v!==this.filter&&(x.texParameteri(x.TEXTURE_2D,x.TEXTURE_MAG_FILTER,v),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_MIN_FILTER,y||v),this.filter=v),b!==this.wrap&&(x.texParameteri(x.TEXTURE_2D,x.TEXTURE_WRAP_S,b),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_WRAP_T,b),this.wrap=b)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:v}=this.context;v.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}}class sa{constructor(v,b,y,_=1,x=1,w=1,k=0){if(this.uid=v,b.height!==b.width)throw RangeError("DEM tiles must be square");if(y&&!["mapbox","terrarium","custom"].includes(y))return void e$(`"${y}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=b.height;const A=this.dim=b.height-2;switch(this.data=new Uint32Array(b.data.buffer),y){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=_,this.greenFactor=x,this.blueFactor=w,this.baseShift=k;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let v=0;v<A;v++)this.data[this._idx(-1,v)]=this.data[this._idx(0,v)],this.data[this._idx(A,v)]=this.data[this._idx(A-1,v)],this.data[this._idx(v,-1)]=this.data[this._idx(v,0)],this.data[this._idx(v,A)]=this.data[this._idx(v,A-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(A,-1)]=this.data[this._idx(A-1,0)],this.data[this._idx(-1,A)]=this.data[this._idx(0,A-1)],this.data[this._idx(A,A)]=this.data[this._idx(A-1,A-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let v=0;v<A;v++)for(let b=0;b<A;b++){const y=this.get(v,b);y>this.max&&(this.max=y),y<this.min&&(this.min=y)}}get(v,b){let y=new Uint8Array(this.data.buffer),_=4*this._idx(v,b);return this.unpack(y[_],y[_+1],y[_+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(v,b){if(v<-1||v>=this.dim+1||b<-1||b>=this.dim+1)throw RangeError(`Out of range source coordinates for DEM data. x: ${v}, y: ${b}, dim: ${this.dim}`);return(b+1)*this.stride+(v+1)}unpack(v,b,y){return v*this.redFactor+b*this.greenFactor+y*this.blueFactor-this.baseShift}pack(v){return ss(v,this.getUnpackVector())}getPixels(){return new a8({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(v,b,y){if(this.dim!==v.dim)throw Error("dem dimension mismatch");let _=b*this.dim,x=b*this.dim+this.dim,w=y*this.dim,k=y*this.dim+this.dim;switch(b){case -1:_=x-1;break;case 1:x=_+1}switch(y){case -1:w=k-1;break;case 1:k=w+1}let A=-b*this.dim,C=-y*this.dim;for(let b=w;b<k;b++)for(let y=_;y<x;y++)this.data[this._idx(y,b)]=v.data[this._idx(y+A,b+C)]}}function ss(v,b){let y=b[0],_=b[1],x=b[2],w=b[3],k=Math.min(y,_,x),A=Math.round((v+w)/k);return{r:Math.floor(A*k/y)%256,g:Math.floor(A*k/_)%256,b:Math.floor(A*k/x)%256}}rz("DEMData",sa);class sl extends os{constructor(v,b){super(v,sr,b)}_createColorRamp(v){let b={elevationStops:[],colorStops:[]},y=this._transitionablePaint._values["color-relief-color"].value.expression;if(y instanceof iY&&y._styleExpression.expression instanceof nM){this.colorRampExpression=y;let v=y._styleExpression.expression;for(let y of(b.elevationStops=v.labels,b.colorStops=[],b.elevationStops))b.colorStops.push(v.evaluate({globals:{elevation:y}}))}if(b.elevationStops.length<1&&(b.elevationStops=[0],b.colorStops=[t6.transparent]),b.elevationStops.length<2&&(b.elevationStops.push(b.elevationStops[0]+1),b.colorStops.push(b.colorStops[0])),b.elevationStops.length<=v)return b;let _={elevationStops:[],colorStops:[]},x=(b.elevationStops.length-1)/(v-1);for(let v=0;v<b.elevationStops.length-.5;v+=x)_.elevationStops.push(b.elevationStops[Math.round(v)]),_.colorStops.push(b.colorStops[Math.round(v)]);return e$(`Too many colors in specification of ${this.id} color-relief layer, may not render properly. Max possible colors: ${v}, provided: ${b.elevationStops.length}`),_}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values["color-relief-color"].value.expression}getColorRampTextures(v,b,y){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;let _=this._createColorRamp(b),x=new a8({width:_.colorStops.length,height:1}),w=new a8({width:_.colorStops.length,height:1});for(let v=0;v<_.elevationStops.length;v++){let b=ss(_.elevationStops[v],y);w.setPixel(0,v,new t6(b.r/255,b.g/255,b.b/255,1)),x.setPixel(0,v,_.colorStops[v])}return this.colorRampTextures={elevationTexture:new so(v,w,v.gl.RGBA),colorTexture:new so(v,x,v.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return!this.isHidden()&&!!this.colorRampTextures}}let{members:sc}=op([{name:"a_pos",components:2,type:"Int16"}],4);function su(v,b,y){let _=y.patternDependencies,x=!1;for(let y of b){let b=y.paint.get(`${v}-pattern`);b.isConstant()||(x=!0);let w=b.constantOr(null);w&&(x=!0,_[w.to]=!0,_[w.from]=!0)}return x}function sd(v,b,y,_,x){let{zoom:w}=_,k=x.patternDependencies;for(let _ of b){let b=_.paint.get(`${v}-pattern`).value;if("constant"!==b.kind){let v=b.evaluate({zoom:w-1},y,{},x.availableImages),A=b.evaluate({zoom:w},y,{},x.availableImages),C=b.evaluate({zoom:w+1},y,{},x.availableImages);v=v&&v.name?v.name:v,A=A&&A.name?A.name:A,C=C&&C.name?C.name:C,k[v]=!0,k[A]=!0,k[C]=!0,y.patterns[_.id]={min:v,mid:A,max:C}}}return y}function sh(v,b,y,_,x){let w;if(x===function(v,b,y,_){let x=0;for(let w=b,k=y-_;w<y;w+=_)x+=(v[k]-v[w])*(v[w+1]+v[k+1]),k=w;return x}(v,b,y,_)>0)for(let x=b;x<y;x+=_)w=sC(x/_|0,v[x],v[x+1],w);else for(let x=y-_;x>=b;x-=_)w=sC(x/_|0,v[x],v[x+1],w);return w&&sy(w,w.next)&&(sE(w),w=w.next),w}function sp(v,b){if(!v)return v;b||(b=v);let y,_=v;do if(y=!1,_.steiner||!sy(_,_.next)&&0!==sb(_.prev,_,_.next))_=_.next;else{if(sE(_),(_=b=_.prev)===_.next)break;y=!0}while(y||_!==b);return b}function sf(v,b){let y=v.x-b.x;return 0===y&&0==(y=v.y-b.y)&&(y=(v.next.y-v.y)/(v.next.x-v.x)-(b.next.y-b.y)/(b.next.x-b.x)),y}function sm(v,b,y,_,x){return(v=0x55555555&((v=0x33333333&((v=0xf0f0f0f&((v=0xff00ff&((v=(v-y)*x|0)|v<<8))|v<<4))|v<<2))|v<<1))|(b=0x55555555&((b=0x33333333&((b=0xf0f0f0f&((b=0xff00ff&((b=(b-_)*x|0)|b<<8))|b<<4))|b<<2))|b<<1))<<1}function sg(v,b,y,_,x,w,k,A){return(x-k)*(b-A)>=(v-k)*(w-A)&&(v-k)*(_-A)>=(y-k)*(b-A)&&(y-k)*(w-A)>=(x-k)*(_-A)}function sv(v,b,y,_,x,w,k,A){return(v!==k||b!==A)&&sg(v,b,y,_,x,w,k,A)}function sb(v,b,y){return(b.y-v.y)*(y.x-b.x)-(b.x-v.x)*(y.y-b.y)}function sy(v,b){return v.x===b.x&&v.y===b.y}function s_(v,b,y,_){let x=sw(sb(v,b,y)),w=sw(sb(v,b,_)),k=sw(sb(y,_,v)),A=sw(sb(y,_,b));return x!==w&&k!==A||!(0!==x||!sx(v,y,b))||!(0!==w||!sx(v,_,b))||!(0!==k||!sx(y,v,_))||!(0!==A||!sx(y,b,_))}function sx(v,b,y){return b.x<=Math.max(v.x,y.x)&&b.x>=Math.min(v.x,y.x)&&b.y<=Math.max(v.y,y.y)&&b.y>=Math.min(v.y,y.y)}function sw(v){return v>0?1:v<0?-1:0}function sk(v,b){return 0>sb(v.prev,v,v.next)?sb(v,b,v.next)>=0&&sb(v,v.prev,b)>=0:0>sb(v,b,v.prev)||0>sb(v,v.next,b)}function sA(v,b){let y=sS(v.i,v.x,v.y),_=sS(b.i,b.x,b.y),x=v.next,w=b.prev;return v.next=b,b.prev=v,y.next=x,x.prev=y,_.next=y,y.prev=_,w.next=_,_.prev=w,_}function sC(v,b,y,_){let x=sS(v,b,y);return _?(x.next=_.next,x.prev=_,_.next.prev=x,_.next=x):(x.prev=x,x.next=x),x}function sE(v){v.next.prev=v.prev,v.prev.next=v.next,v.prevZ&&(v.prevZ.nextZ=v.nextZ),v.nextZ&&(v.nextZ.prevZ=v.prevZ)}function sS(v,b,y){return{i:v,x:b,y:y,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class sT{constructor(v,b){if(b>v)throw Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=v,this._minGranularity=b}getGranularityForZoomLevel(v){return Math.max(Math.floor(this._baseZoomGranularity/(1<<v)),this._minGranularity,1)}}class sO{constructor(v){this.fill=v.fill,this.line=v.line,this.tile=v.tile,this.stencil=v.stencil,this.circle=v.circle}}sO.noSubdivision=new sO({fill:new sT(0,0),line:new sT(0,0),tile:new sT(0,0),stencil:new sT(0,0),circle:1}),rz("SubdivisionGranularityExpression",sT),rz("SubdivisionGranularitySetting",sO);class sF{constructor(v,b){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=v,this._granularityCellSize=8192/v,this._canonical=b}_getKey(v,b){return(v+=32768)<<16|b+32768}_vertexToIndex(v,b){if(v<-32768||b<-32768||v>32767||b>32767)throw Error("Vertex coordinates are out of signed 16 bit integer range.");let y=0|Math.round(v),_=0|Math.round(b),x=this._getKey(y,_);if(this._vertexDictionary.has(x))return this._vertexDictionary.get(x);let w=this._vertexBuffer.length/2;return this._vertexDictionary.set(x,w),this._vertexBuffer.push(y,_),w}_subdivideTrianglesScanline(v){if(this._granularity<2)return function(v,b){let y=[];for(let _=0;_<b.length;_+=3){let x=b[_],w=b[_+1],k=b[_+2],A=v[2*x],C=v[2*x+1];(v[2*w]-A)*(v[2*k+1]-C)-(v[2*w+1]-C)*(v[2*k]-A)>0?(y.push(x),y.push(k),y.push(w)):(y.push(x),y.push(w),y.push(k))}return y}(this._vertexBuffer,v);let b=[],y=v.length;for(let _=0;_<y;_+=3){let y=[v[_+0],v[_+1],v[_+2]],x=[this._vertexBuffer[2*v[_+0]+0],this._vertexBuffer[2*v[_+0]+1],this._vertexBuffer[2*v[_+1]+0],this._vertexBuffer[2*v[_+1]+1],this._vertexBuffer[2*v[_+2]+0],this._vertexBuffer[2*v[_+2]+1]],w=1/0,k=1/0,A=-1/0,C=-1/0;for(let v=0;v<3;v++){let b=x[2*v],y=x[2*v+1];w=Math.min(w,b),A=Math.max(A,b),k=Math.min(k,y),C=Math.max(C,y)}if(w===A||k===C)continue;let E=Math.floor(w/this._granularityCellSize),S=Math.ceil(A/this._granularityCellSize),T=Math.floor(k/this._granularityCellSize),O=Math.ceil(C/this._granularityCellSize);if(E!==S||T!==O)for(let v=T;v<O;v++){let _=this._scanlineGenerateVertexRingForCellRow(v,x,y);!function(v,b,y){if(0===b.length)throw Error("Subdivision vertex ring is empty.");let _=0,x=v[2*b[0]];for(let y=1;y<b.length;y++){let w=v[2*b[y]];w<x&&(x=w,_=y)}let w=b.length,k=_,A=(k+1)%w;for(;;){let _=k-1>=0?k-1:w-1,x=(A+1)%w,C=v[2*b[_]],E=v[2*b[x]],S=v[2*b[k]],T=v[2*b[k]+1],O=v[2*b[A]+1],F=!1;if(C<E)F=!0;else if(C>E)F=!1;else{let y=O-T,w=-(v[2*b[A]]-S),k=T<O?1:-1;((C-S)*y+(v[2*b[_]+1]-T)*w)*k>((E-S)*y+(v[2*b[x]+1]-T)*w)*k&&(F=!0)}if(F){let v=b[_],x=b[k],C=b[A];v!==x&&v!==C&&x!==C&&y.push(C,x,v),--k<0&&(k=w-1)}else{let v=b[x],_=b[k],C=b[A];v!==_&&v!==C&&_!==C&&y.push(C,_,v),++A>=w&&(A=0)}if(_===x)break}}(this._vertexBuffer,_,b)}else b.push(...y)}return b}_scanlineGenerateVertexRingForCellRow(v,b,y){let _=v*this._granularityCellSize,x=_+this._granularityCellSize,w=[];for(let v=0;v<3;v++){let k=b[2*v],A=b[2*v+1],C=b[2*(v+1)%6],E=b[(2*(v+1)+1)%6],S=b[2*(v+2)%6],T=b[(2*(v+2)+1)%6],O=C-k,F=E-A,I=0===O,M=0===F,R=(_-A)/F,D=(x-A)/F,P=Math.min(R,D),L=Math.max(R,D);if(!M&&(P>=1||L<=0)||M&&(A<_||A>x)){E>=_&&E<=x&&w.push(y[(v+1)%3]);continue}!M&&P>0&&w.push(this._vertexToIndex(k+O*P,A+F*P));let N=k+O*Math.max(P,0),z=k+O*Math.min(L,1);I||this._generateIntraEdgeVertices(w,k,A,C,E,N,z),!M&&L<1&&w.push(this._vertexToIndex(k+O*L,A+F*L)),(M||E>=_&&E<=x)&&w.push(y[(v+1)%3]),!M&&(E<=_||E>=x)&&this._generateInterEdgeVertices(w,k,A,C,E,S,T,z,_,x)}return w}_generateIntraEdgeVertices(v,b,y,_,x,w,k){let A=_-b,C=x-y,E=0===C,S=E?Math.min(b,_):Math.min(w,k),T=E?Math.max(b,_):Math.max(w,k),O=Math.floor(S/this._granularityCellSize)+1,F=Math.ceil(T/this._granularityCellSize)-1;if(E?b<_:w<k)for(let _=O;_<=F;_++){let x=_*this._granularityCellSize;v.push(this._vertexToIndex(x,y+C*(x-b)/A))}else for(let _=F;_>=O;_--){let x=_*this._granularityCellSize;v.push(this._vertexToIndex(x,y+C*(x-b)/A))}}_generateInterEdgeVertices(v,b,y,_,x,w,k,A,C,E){let S=k-x,T=(C-x)/S,O=(E-x)/S,F=Math.min(T,O),I=Math.max(T,O),M=_+(w-_)*F,R=Math.floor(Math.min(M,A)/this._granularityCellSize)+1,D=Math.ceil(Math.max(M,A)/this._granularityCellSize)-1,P=A<M,L=0===S;if(L&&(k===C||k===E))return;if(L||F>=1||I<=0){let v=y-k,_=w+(b-w)*Math.min((C-k)/v,(E-k)/v);R=Math.floor(Math.min(_,A)/this._granularityCellSize)+1,D=Math.ceil(Math.max(_,A)/this._granularityCellSize)-1,P=A<_}let N=x-y>0?E:C;if(P)for(let b=R;b<=D;b++)v.push(this._vertexToIndex(b*this._granularityCellSize,N));else for(let b=D;b>=R;b--)v.push(this._vertexToIndex(b*this._granularityCellSize,N))}_generateOutline(v){let b=[];for(let y of v){let v=sM(y,this._granularity,!0),_=this._pointArrayToIndices(v),x=[];for(let v=1;v<_.length;v++)x.push(_[v-1]),x.push(_[v]);b.push(x)}return b}_handlePoles(v){let b=!1,y=!1;this._canonical&&(0===this._canonical.y&&(b=!0),this._canonical.y===(1<<this._canonical.z)-1&&(y=!0)),(b||y)&&this._fillPoles(v,b,y)}_ensureNoPoleVertices(){let v=this._vertexBuffer;for(let b=0;b<v.length;b+=2){let y=v[b+1];-32768===y&&(v[b+1]=-32767),32767===y&&(v[b+1]=32766)}}_generatePoleQuad(v,b,y,_,x,w){_>x!=(-32768===w)?(v.push(b),v.push(y),v.push(this._vertexToIndex(_,w)),v.push(y),v.push(this._vertexToIndex(x,w))):(v.push(y),v.push(b),v.push(this._vertexToIndex(_,w)),v.push(this._vertexToIndex(x,w)),v.push(y)),v.push(this._vertexToIndex(_,w))}_fillPoles(v,b,y){let _=this._vertexBuffer,x=v.length;for(let w=2;w<x;w+=3){let x=v[w-2],k=v[w-1],A=v[w],C=_[2*x],E=_[2*x+1],S=_[2*k],T=_[2*k+1],O=_[2*A],F=_[2*A+1];b&&(0===E&&0===T&&this._generatePoleQuad(v,x,k,C,S,-32768),0===T&&0===F&&this._generatePoleQuad(v,k,A,S,O,-32768),0===F&&0===E&&this._generatePoleQuad(v,A,x,O,C,-32768)),y&&(8192===E&&8192===T&&this._generatePoleQuad(v,x,k,C,S,32767),8192===T&&8192===F&&this._generatePoleQuad(v,k,A,S,O,32767),8192===F&&8192===E&&this._generatePoleQuad(v,A,x,O,C,32767))}}_initializeVertices(v){for(let b=0;b<v.length;b+=2)this._vertexToIndex(v[b],v[b+1])}subdividePolygonInternal(v,b){let y;if(this._used)throw Error("Subdivision: multiple use not allowed.");this._used=!0;let{flattened:_,holeIndices:x}=function(v){let b=[],y=[];for(let _ of v)if(0!==_.length){_!==v[0]&&b.push(y.length/2);for(let v=0;v<_.length;v++)y.push(_[v].x),y.push(_[v].y)}return{flattened:y,holeIndices:b}}(v);this._initializeVertices(_);try{let v=function(v,b,y=2){let _,x,w,k=b&&b.length,A=k?b[0]*y:v.length,C=sh(v,0,A,y,!0),E=[];if(!C||C.next===C.prev)return E;if(k&&(C=function(v,b,y,_){let x=[];for(let y=0,w=b.length;y<w;y++){let k=sh(v,b[y]*_,y<w-1?b[y+1]*_:v.length,_,!1);k===k.next&&(k.steiner=!0),x.push(function(v){let b=v,y=v;do(b.x<y.x||b.x===y.x&&b.y<y.y)&&(y=b),b=b.next;while(b!==v);return y}(k))}x.sort(sf);for(let v=0;v<x.length;v++)y=function(v,b){let y=function(v,b){let y=b,_=v.x,x=v.y,w,k=-1/0;if(sy(v,y))return y;do{if(sy(v,y.next))return y.next;if(x<=y.y&&x>=y.next.y&&y.next.y!==y.y){let v=y.x+(x-y.y)*(y.next.x-y.x)/(y.next.y-y.y);if(v<=_&&v>k&&(k=v,w=y.x<y.next.x?y:y.next,v===_))return w}y=y.next}while(y!==b);if(!w)return null;let A=w,C=w.x,E=w.y,S=1/0;y=w;do{if(_>=y.x&&y.x>=C&&_!==y.x&&sg(x<E?_:k,x,C,E,x<E?k:_,x,y.x,y.y)){var T,O;let b=Math.abs(x-y.y)/(_-y.x);sk(y,v)&&(b<S||b===S&&(y.x>w.x||y.x===w.x&&(T=w,O=y,0>sb(T.prev,T,O.prev)&&0>sb(O.next,T,T.next))))&&(w=y,S=b)}y=y.next}while(y!==A);return w}(v,b);if(!y)return b;let _=sA(y,v);return sp(_,_.next),sp(y,y.next)}(x[v],y);return y}(v,b,C,y)),v.length>80*y){_=v[0],x=v[1];let b=_,k=x;for(let w=y;w<A;w+=y){let y=v[w],A=v[w+1];y<_&&(_=y),A<x&&(x=A),y>b&&(b=y),A>k&&(k=A)}w=Math.max(b-_,k-x),w=0!==w?32767/w:0}return function v(b,y,_,x,w,k,A){if(!b)return;!A&&k&&function(v,b,y,_){let x=v;do 0===x.z&&(x.z=sm(x.x,x.y,b,y,_)),x.prevZ=x.prev,x.nextZ=x.next,x=x.next;while(x!==v);x.prevZ.nextZ=null,x.prevZ=null,function(v){let b,y=1;do{let _,x=v;v=null;let w=null;for(b=0;x;){b++;let k=x,A=0;for(let v=0;v<y&&(A++,k=k.nextZ);v++);let C=y;for(;A>0||C>0&&k;)0!==A&&(0===C||!k||x.z<=k.z)?(_=x,x=x.nextZ,A--):(_=k,k=k.nextZ,C--),w?w.nextZ=_:v=_,_.prevZ=w,w=_;x=k}w.nextZ=null,y*=2}while(b>1)}(x)}(b,x,w,k);let C=b;for(;b.prev!==b.next;){let E=b.prev,S=b.next;if(k?function(v,b,y,_){let x=v.prev,w=v.next;if(sb(x,v,w)>=0)return!1;let k=x.x,A=v.x,C=w.x,E=x.y,S=v.y,T=w.y,O=Math.min(k,A,C),F=Math.min(E,S,T),I=Math.max(k,A,C),M=Math.max(E,S,T),R=sm(O,F,b,y,_),D=sm(I,M,b,y,_),P=v.prevZ,L=v.nextZ;for(;P&&P.z>=R&&L&&L.z<=D;){if(P.x>=O&&P.x<=I&&P.y>=F&&P.y<=M&&P!==x&&P!==w&&sv(k,E,A,S,C,T,P.x,P.y)&&sb(P.prev,P,P.next)>=0||(P=P.prevZ,L.x>=O&&L.x<=I&&L.y>=F&&L.y<=M&&L!==x&&L!==w&&sv(k,E,A,S,C,T,L.x,L.y)&&sb(L.prev,L,L.next)>=0))return!1;L=L.nextZ}for(;P&&P.z>=R;){if(P.x>=O&&P.x<=I&&P.y>=F&&P.y<=M&&P!==x&&P!==w&&sv(k,E,A,S,C,T,P.x,P.y)&&sb(P.prev,P,P.next)>=0)return!1;P=P.prevZ}for(;L&&L.z<=D;){if(L.x>=O&&L.x<=I&&L.y>=F&&L.y<=M&&L!==x&&L!==w&&sv(k,E,A,S,C,T,L.x,L.y)&&sb(L.prev,L,L.next)>=0)return!1;L=L.nextZ}return!0}(b,x,w,k):function(v){let b=v.prev,y=v.next;if(sb(b,v,y)>=0)return!1;let _=b.x,x=v.x,w=y.x,k=b.y,A=v.y,C=y.y,E=Math.min(_,x,w),S=Math.min(k,A,C),T=Math.max(_,x,w),O=Math.max(k,A,C),F=y.next;for(;F!==b;){if(F.x>=E&&F.x<=T&&F.y>=S&&F.y<=O&&sv(_,k,x,A,w,C,F.x,F.y)&&sb(F.prev,F,F.next)>=0)return!1;F=F.next}return!0}(b))y.push(E.i,b.i,S.i),sE(b),b=S.next,C=S.next;else if((b=S)===C){A?1===A?v(b=function(v,b){let y=v;do{let _=y.prev,x=y.next.next;!sy(_,x)&&s_(_,y,y.next,x)&&sk(_,x)&&sk(x,_)&&(b.push(_.i,y.i,x.i),sE(y),sE(y.next),y=v=x),y=y.next}while(y!==v);return sp(y)}(sp(b),y),y,_,x,w,k,2):2===A&&function(b,y,_,x,w,k){let A=b;do{let b=A.next.next;for(;b!==A.prev;){var C,E;if(A.i!==b.i&&(C=A,E=b,C.next.i!==E.i&&C.prev.i!==E.i&&!function(v,b){let y=v;do{if(y.i!==v.i&&y.next.i!==v.i&&y.i!==b.i&&y.next.i!==b.i&&s_(y,y.next,v,b))return!0;y=y.next}while(y!==v);return!1}(C,E)&&(sk(C,E)&&sk(E,C)&&function(v,b){let y=v,_=!1,x=(v.x+b.x)/2,w=(v.y+b.y)/2;do y.y>w!=y.next.y>w&&y.next.y!==y.y&&x<(y.next.x-y.x)*(w-y.y)/(y.next.y-y.y)+y.x&&(_=!_),y=y.next;while(y!==v);return _}(C,E)&&(sb(C.prev,C,E.prev)||sb(C,E.prev,E))||sy(C,E)&&sb(C.prev,C,C.next)>0&&sb(E.prev,E,E.next)>0))){let C=sA(A,b);return A=sp(A,A.next),C=sp(C,C.next),v(A,y,_,x,w,k,0),void v(C,y,_,x,w,k,0)}b=b.next}A=A.next}while(A!==b)}(b,y,_,x,w,k):v(sp(b),y,_,x,w,k,1);break}}}(C,E,y,_,x,w,0),E}(_,x),b=this._convertIndices(_,v);y=this._subdivideTrianglesScanline(b)}catch(v){console.error(v)}let w=[];return b&&(w=this._generateOutline(v)),this._ensureNoPoleVertices(),this._handlePoles(y),{verticesFlattened:this._vertexBuffer,indicesTriangles:y,indicesLineList:w}}_convertIndices(v,b){let y=[];for(let _=0;_<b.length;_++)y.push(this._vertexToIndex(v[2*b[_]],v[2*b[_]+1]));return y}_pointArrayToIndices(v){let b=[];for(let y=0;y<v.length;y++){let _=v[y];b.push(this._vertexToIndex(_.x,_.y))}return b}}function sI(v,b,y,_=!0){return new sF(y,b).subdividePolygonInternal(v,_)}function sM(v,b,y=!1){if(!v||v.length<1||v.length<2)return[];let _=v[0],x=v[v.length-1],w=y&&(_.x!==x.x||_.y!==x.y);if(b<2)return w?[...v,v[0]]:[...v];let k=Math.floor(8192/b),A=[];A.push(new z(v[0].x,v[0].y));let C=v.length,E=w?C:C-1;for(let b=0;b<E;b++){let y=v[b],_=b<C-1?v[b+1]:v[0],x=y.x,w=y.y,E=_.x,S=_.y,T=x!==E,O=w!==S;if(!T&&!O)continue;let F=E-x,I=S-w,M=Math.abs(F),R=Math.abs(I),D=x,P=w;for(;;){let v=F>0?(Math.floor(D/k)+1)*k:(Math.ceil(D/k)-1)*k,b=I>0?(Math.floor(P/k)+1)*k:(Math.ceil(P/k)-1)*k,y=Math.abs(D-v),_=Math.abs(P-b),x=Math.abs(P-S),w=T?y/M:1/0,C=O?_/R:1/0;if((Math.abs(D-E)<=y||!T)&&(x<=_||!O))break;if(w<C&&T||!O){let b=new z(D=v,Math.round(P+=I*w));A[A.length-1].x===b.x&&A[A.length-1].y===b.y||A.push(b)}else{let v=new z(Math.round(D+=F*C),P=b);A[A.length-1].x===v.x&&A[A.length-1].y===v.y||A.push(v)}}let L=new z(E,S);A[A.length-1].x===L.x&&A[A.length-1].y===L.y||A.push(L)}return A}function sR(v,b,y,_,x,w,k,A,C){let E=x.length/2,S=k&&A&&C;if(E<ai.MAX_VERTEX_ARRAY_LENGTH){let T,O,F=b.prepareSegment(E,y,_),I=F.vertexLength;for(let v=0;v<w.length;v+=3)_.emplaceBack(I+w[v],I+w[v+1],I+w[v+2]);F.vertexLength+=E,F.primitiveLength+=w.length/3,S&&(T=(O=k.prepareSegment(E,y,A)).vertexLength,O.vertexLength+=E);for(let b=0;b<x.length;b+=2)v(x[b],x[b+1]);if(S)for(let v=0;v<C.length;v++){let b=C[v];for(let v=1;v<b.length;v+=2)A.emplaceBack(T+b[v-1],T+b[v]);O.primitiveLength+=b.length/2}}else!function(v,b,y,_,x,w){let k=[];for(let v=0;v<_.length/2;v++)k.push(-1);let A={count:0},C=0,E=v.getOrCreateLatestSegment(b,y),S=E.vertexLength;for(let T=2;T<x.length;T+=3){let O=x[T-2],F=x[T-1],I=x[T],M=k[O]<C,R=k[F]<C,D=k[I]<C;E.vertexLength+(+!!M+ +!!R+ +!!D)>ai.MAX_VERTEX_ARRAY_LENGTH&&(E=v.createNewSegment(b,y),C=A.count,M=!0,R=!0,D=!0,S=0);let P=sD(k,_,w,A,O,M,E),L=sD(k,_,w,A,F,R,E),N=sD(k,_,w,A,I,D,E);y.emplaceBack(S+P-C,S+L-C,S+N-C),E.primitiveLength++}}(b,y,_,x,w,v),S&&function(v,b,y,_,x,w){let k=[];for(let v=0;v<_.length/2;v++)k.push(-1);let A={count:0},C=0,E=v.getOrCreateLatestSegment(b,y),S=E.vertexLength;for(let T=0;T<x.length;T++){let O=x[T];for(let F=1;F<x[T].length;F+=2){let x=O[F-1],T=O[F],I=k[x]<C,M=k[T]<C;E.vertexLength+(+!!I+ +!!M)>ai.MAX_VERTEX_ARRAY_LENGTH&&(E=v.createNewSegment(b,y),C=A.count,I=!0,M=!0,S=0);let R=sD(k,_,w,A,x,I,E),D=sD(k,_,w,A,T,M,E);y.emplaceBack(S+R-C,S+D-C),E.primitiveLength++}}}(k,y,A,x,C,v),b.forceNewSegmentOnNextPrepare(),null==k||k.forceNewSegmentOnNextPrepare()}function sD(v,b,y,_,x,w,k){if(w){let w=_.count;return y(b[2*x],b[2*x+1]),v[x]=_.count,_.count++,k.vertexLength++,w}return v[x]}class sP{constructor(v){this.zoom=v.zoom,this.overscaling=v.overscaling,this.layers=v.layers,this.layerIds=this.layers.map(v=>v.id),this.index=v.index,this.hasDependencies=!1,this.patternFeatures=[],this.layoutVertexArray=new oQ,this.indexArray=new ae,this.indexArray2=new at,this.programConfigurations=new aI(v.layers,v.zoom),this.segments=new ai,this.segments2=new ai,this.stateDependentLayerIds=this.layers.filter(v=>v.isStateDependent()).map(v=>v.id)}populate(v,b,y){this.hasDependencies=su("fill",this.layers,b);let _=this.layers[0].layout.get("fill-sort-key"),x=!_.isConstant(),w=[];for(let{feature:k,id:A,index:C,sourceLayerIndex:E}of v){let v=this.layers[0]._featureFilter.needGeometry,S=aD(k,v);if(!this.layers[0]._featureFilter.filter(new r0(this.zoom),S,y))continue;let T=x?_.evaluate(S,{},y,b.availableImages):void 0,O={id:A,properties:k.properties,type:k.type,sourceLayerIndex:E,index:C,geometry:v?S.geometry:aR(k),patterns:{},sortKey:T};w.push(O)}for(let _ of(x&&w.sort((v,b)=>v.sortKey-b.sortKey),w)){let{geometry:x,index:w,sourceLayerIndex:k}=_;if(this.hasDependencies){let v=sd("fill",this.layers,_,{zoom:this.zoom},b);this.patternFeatures.push(v)}else this.addFeature(_,x,w,y,{},b.subdivisionGranularity);b.featureIndex.insert(v[w].feature,x,w,k,this.index)}}update(v,b,y){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(v,b,this.stateDependentLayers,{imagePositions:y})}addFeatures(v,b,y){for(let _ of this.patternFeatures)this.addFeature(_,_.geometry,_.index,b,y,v.subdivisionGranularity)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(v){this.uploaded||(this.layoutVertexBuffer=v.createVertexBuffer(this.layoutVertexArray,sc),this.indexBuffer=v.createIndexBuffer(this.indexArray),this.indexBuffer2=v.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(v),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(v,b,y,_,x,w){for(let v of n7(b,500)){let b=sI(v,_,w.fill.getGranularityForZoomLevel(_.z)),y=this.layoutVertexArray;sR((v,b)=>{y.emplaceBack(v,b)},this.segments,this.layoutVertexArray,this.indexArray,b.verticesFlattened,b.indicesTriangles,this.segments2,this.indexArray2,b.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,v,y,{imagePositions:x,canonical:_})}}rz("FillBucket",sP,{omit:["layers","patternFeatures"]});var sL={get paint(){return O=O||new oa({"fill-antialias":new ot(tr.paint_fill["fill-antialias"]),"fill-opacity":new on(tr.paint_fill["fill-opacity"]),"fill-color":new on(tr.paint_fill["fill-color"]),"fill-outline-color":new on(tr.paint_fill["fill-outline-color"]),"fill-translate":new ot(tr.paint_fill["fill-translate"]),"fill-translate-anchor":new ot(tr.paint_fill["fill-translate-anchor"]),"fill-pattern":new oi(tr.paint_fill["fill-pattern"])})},get layout(){return T=T||new oa({"fill-sort-key":new on(tr.layout_fill["fill-sort-key"])})}};class sN extends os{constructor(v,b){super(v,sL,b)}recalculate(v,b){super.recalculate(v,b);let y=this.paint._values["fill-outline-color"];"constant"===y.value.kind&&void 0===y.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(v){return new sP(v)}queryRadius(){return aH(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:v,geometry:b,transform:y,pixelsToTileUnits:_}){return az(aW(v,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-y.bearingInRadians,_),b)}isTileClipped(){return!0}}let sz=op([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),sj=op([{name:"a_centroid",components:2,type:"Int16"}],4),{members:sB}=sz;class s${constructor(v,b,y,_,x){this.properties={},this.extent=y,this.type=0,this.id=void 0,this._pbf=v,this._geometry=-1,this._keys=_,this._values=x,v.readFields(sU,this,b)}loadGeometry(){let v=this._pbf;v.pos=this._geometry;let b=v.readVarint()+v.pos,y=[],_,x=1,w=0,k=0,A=0;for(;v.pos<b;){if(w<=0){let b=v.readVarint();x=7&b,w=b>>3}if(w--,1===x||2===x)k+=v.readSVarint(),A+=v.readSVarint(),1===x&&(_&&y.push(_),_=[]),_&&_.push(new z(k,A));else{if(7!==x)throw Error(`unknown command ${x}`);_&&_.push(_[0].clone())}}return _&&y.push(_),y}bbox(){let v=this._pbf;v.pos=this._geometry;let b=v.readVarint()+v.pos,y=1,_=0,x=0,w=0,k=1/0,A=-1/0,C=1/0,E=-1/0;for(;v.pos<b;){if(_<=0){let b=v.readVarint();y=7&b,_=b>>3}if(_--,1===y||2===y)x+=v.readSVarint(),w+=v.readSVarint(),x<k&&(k=x),x>A&&(A=x),w<C&&(C=w),w>E&&(E=w);else if(7!==y)throw Error(`unknown command ${y}`)}return[k,C,A,E]}toGeoJSON(v,b,y){let _,x=this.extent*Math.pow(2,y),w=this.extent*v,k=this.extent*b,A=this.loadGeometry();function C(v){return[360*(v.x+w)/x-180,360/Math.PI*Math.atan(Math.exp((1-2*(v.y+k)/x)*Math.PI))-90]}function E(v){return v.map(C)}if(1===this.type){let v=[];for(let b of A)v.push(b[0]);let b=E(v);_=1===v.length?{type:"Point",coordinates:b[0]}:{type:"MultiPoint",coordinates:b}}else if(2===this.type){let v=A.map(E);_=1===v.length?{type:"LineString",coordinates:v[0]}:{type:"MultiLineString",coordinates:v}}else{if(3!==this.type)throw Error("unknown feature type");{let v=sV(A),b=[];for(let y of v)b.push(y.map(E));_=1===b.length?{type:"Polygon",coordinates:b[0]}:{type:"MultiPolygon",coordinates:b}}}let S={type:"Feature",geometry:_,properties:this.properties};return null!=this.id&&(S.id=this.id),S}}function sU(v,b,y){1===v?b.id=y.readVarint():2===v?function(v,b){let y=v.readVarint()+v.pos;for(;v.pos<y;){let y=b._keys[v.readVarint()],_=b._values[v.readVarint()];b.properties[y]=_}}(y,b):3===v?b.type=y.readVarint():4===v&&(b._geometry=y.pos)}function sV(v){let b,y,_=v.length;if(_<=1)return[v];let x=[];for(let w=0;w<_;w++){let _=function(v){let b=0;for(let y,_,x=0,w=v.length,k=w-1;x<w;k=x++)y=v[x],b+=((_=v[k]).x-y.x)*(y.y+_.y);return b}(v[w]);0!==_&&(void 0===y&&(y=_<0),y===_<0?(b&&x.push(b),b=[v[w]]):b&&b.push(v[w]))}return b&&x.push(b),x}s$.types=["Unknown","Point","LineString","Polygon"];class sq{constructor(v,b){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=v,this._keys=[],this._values=[],this._features=[],v.readFields(sH,this,b),this.length=this._features.length}feature(v){if(v<0||v>=this._features.length)throw Error("feature index out of bounds");this._pbf.pos=this._features[v];let b=this._pbf.readVarint()+this._pbf.pos;return new s$(this._pbf,b,this.extent,this._keys,this._values)}}function sH(v,b,y){15===v?b.version=y.readVarint():1===v?b.name=y.readString():5===v?b.extent=y.readVarint():2===v?b._features.push(y.pos):3===v?b._keys.push(y.readString()):4===v&&b._values.push(function(v){let b=null,y=v.readVarint()+v.pos;for(;v.pos<y;){let y=v.readVarint()>>3;b=1===y?v.readString():2===y?v.readFloat():3===y?v.readDouble():4===y?v.readVarint64():5===y?v.readVarint():6===y?v.readSVarint():7===y?v.readBoolean():null}if(null==b)throw Error("unknown feature value");return b}(y))}class sW{constructor(v,b){this.layers=v.readFields(sG,{},b)}}function sG(v,b,y){if(3===v){let v=new sq(y,y.readVarint()+y.pos);v.length&&(b[v.name]=v)}}function sY(v,b,y,_,x,w,k,A){v.emplaceBack(b,y,2*Math.floor(8192*_)+k,8192*x*2,8192*w*2,Math.round(A))}class sZ{constructor(v){this.zoom=v.zoom,this.overscaling=v.overscaling,this.layers=v.layers,this.layerIds=this.layers.map(v=>v.id),this.index=v.index,this.hasDependencies=!1,this.layoutVertexArray=new o0,this.centroidVertexArray=new oK,this.indexArray=new ae,this.programConfigurations=new aI(v.layers,v.zoom),this.segments=new ai,this.stateDependentLayerIds=this.layers.filter(v=>v.isStateDependent()).map(v=>v.id)}populate(v,b,y){for(let{feature:_,id:x,index:w,sourceLayerIndex:k}of(this.features=[],this.hasDependencies=su("fill-extrusion",this.layers,b),v)){let v=this.layers[0]._featureFilter.needGeometry,A=aD(_,v);if(!this.layers[0]._featureFilter.filter(new r0(this.zoom),A,y))continue;let C={id:x,sourceLayerIndex:k,index:w,geometry:v?A.geometry:aR(_),properties:_.properties,type:_.type,patterns:{}};this.hasDependencies?this.features.push(sd("fill-extrusion",this.layers,C,{zoom:this.zoom},b)):this.addFeature(C,C.geometry,w,y,{},b.subdivisionGranularity),b.featureIndex.insert(_,C.geometry,w,k,this.index,!0)}}addFeatures(v,b,y){for(let _ of this.features){let{geometry:x}=_;this.addFeature(_,x,_.index,b,y,v.subdivisionGranularity)}}update(v,b,y){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(v,b,this.stateDependentLayers,{imagePositions:y})}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(v){this.uploaded||(this.layoutVertexBuffer=v.createVertexBuffer(this.layoutVertexArray,sB),this.centroidVertexBuffer=v.createVertexBuffer(this.centroidVertexArray,sj.members,!0),this.indexBuffer=v.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(v),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(v,b,y,_,x,w){for(let y of n7(b,500)){let b={x:0,y:0,sampleCount:0},x=this.layoutVertexArray.length;this.processPolygon(b,_,v,y,w);let k=this.layoutVertexArray.length-x,A=Math.floor(b.x/b.sampleCount),C=Math.floor(b.y/b.sampleCount);for(let v=0;v<k;v++)this.centroidVertexArray.emplaceBack(A,C)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,v,y,{imagePositions:x,canonical:_})}processPolygon(v,b,y,_,x){if(_.length<1||sX(_[0]))return;for(let b of _)0!==b.length&&function(v,b){for(let y=0;y<b.length;y++){let _=b[y];y===b.length-1&&b[0].x===_.x&&b[0].y===_.y||(v.x+=_.x,v.y+=_.y,v.sampleCount++)}}(v,b);let w={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},k=x.fill.getGranularityForZoomLevel(b.z),A="Polygon"===s$.types[y.type];for(let v of _){if(0===v.length||sX(v))continue;let b=sM(v,k,A);this._generateSideFaces(b,w)}if(!A)return;let C=sI(_,b,k,!1),E=this.layoutVertexArray;sR((v,b)=>{sY(E,v,b,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,C.verticesFlattened,C.indicesTriangles)}_generateSideFaces(v,b){let y=0;for(let w=1;w<v.length;w++){var _,x;let k=v[w],A=v[w-1];if(_=k,x=A,_.x===x.x&&(_.x<0||_.x>8192)||_.y===x.y&&(_.y<0||_.y>8192))continue;b.segment.vertexLength+4>ai.MAX_VERTEX_ARRAY_LENGTH&&(b.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let C=k.sub(A)._perp()._unit(),E=A.dist(k);y+E>32768&&(y=0),sY(this.layoutVertexArray,k.x,k.y,C.x,C.y,0,0,y),sY(this.layoutVertexArray,k.x,k.y,C.x,C.y,0,1,y),y+=E,sY(this.layoutVertexArray,A.x,A.y,C.x,C.y,0,0,y),sY(this.layoutVertexArray,A.x,A.y,C.x,C.y,0,1,y);let S=b.segment.vertexLength;this.indexArray.emplaceBack(S,S+2,S+1),this.indexArray.emplaceBack(S+1,S+2,S+3),b.segment.vertexLength+=4,b.segment.primitiveLength+=2}}}function sX(v){return v.every(v=>v.x<0)||v.every(v=>v.x>8192)||v.every(v=>v.y<0)||v.every(v=>v.y>8192)}rz("FillExtrusionBucket",sZ,{omit:["layers","features"]});var sK={get paint(){return F=F||new oa({"fill-extrusion-opacity":new ot(tr["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new on(tr["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new ot(tr["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new ot(tr["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new oi(tr["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new on(tr["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new on(tr["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new ot(tr["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class sJ extends os{constructor(v,b){super(v,sK,b)}createBucket(v){return new sZ(v)}queryRadius(){return aH(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:v,feature:b,featureState:y,geometry:_,transform:x,pixelsToTileUnits:w,pixelPosMatrix:k}){let A=aW(v,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-x.bearingInRadians,w),C=this.paint.get("fill-extrusion-height").evaluate(b,y),E=this.paint.get("fill-extrusion-base").evaluate(b,y),S=function(v,b){let y=[];for(let _ of v){let v=[_.x,_.y,0,1];ew(v,v,b),y.push(new z(v[0]/v[3],v[1]/v[3]))}return y}(A,k),T=function(v,b,y,_){let x=[],w=[],k=_[8]*b,A=_[9]*b,C=_[10]*b,E=_[11]*b,S=_[8]*y,T=_[9]*y,O=_[10]*y,F=_[11]*y;for(let b of v){let v=[],y=[];for(let x of b){let b=x.x,w=x.y,I=_[0]*b+_[4]*w+_[12],M=_[1]*b+_[5]*w+_[13],R=_[2]*b+_[6]*w+_[14],D=_[3]*b+_[7]*w+_[15],P=R+C,L=D+E,N=I+S,j=M+T,B=R+O,U=D+F,V=new z((I+k)/L,(M+A)/L);V.z=P/L,v.push(V);let q=new z(N/U,j/U);q.z=B/U,y.push(q)}x.push(v),w.push(y)}return[x,w]}(_,E,C,k);return function(v,b,y){let _=1/0;az(y,b)&&(_=s0(y,b[0]));for(let x=0;x<b.length;x++){let w=b[x],k=v[x];for(let v=0;v<w.length-1;v++){let b=w[v],x=[b,w[v+1],k[v+1],k[v],b];aL(y,x)&&(_=Math.min(_,s0(y,x)))}}return 1/0!==_&&_}(T[0],T[1],S)}}function sQ(v,b){return v.x*b.x+v.y*b.y}function s0(v,b){if(1===v.length){let y,_=0,x=b[_++];for(;!y||x.equals(y);)if(!(y=b[_++]))return 1/0;for(;_<b.length;_++){let w=b[_],k=v[0],A=y.sub(x),C=w.sub(x),E=k.sub(x),S=sQ(A,A),T=sQ(A,C),O=sQ(C,C),F=sQ(E,A),I=sQ(E,C),M=S*O-T*T,R=(O*F-T*I)/M,D=(S*I-T*F)/M,P=x.z*(1-R-D)+y.z*R+w.z*D;if(isFinite(P))return P}return 1/0}{let v=1/0;for(let y of b)v=Math.min(v,y.z);return v}}let{members:s1}=op([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:s2}=op([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),s5=Math.cos(Math.PI/180*37.5);class s3{constructor(v){this.zoom=v.zoom,this.overscaling=v.overscaling,this.layers=v.layers,this.layerIds=this.layers.map(v=>v.id),this.index=v.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(v=>{this.gradients[v.id]={}}),this.layoutVertexArray=new o1,this.layoutVertexArray2=new o2,this.indexArray=new ae,this.programConfigurations=new aI(v.layers,v.zoom),this.segments=new ai,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(v=>v.isStateDependent()).map(v=>v.id)}populate(v,b,y){this.hasDependencies=su("line",this.layers,b)||this.hasLineDasharray(this.layers);let _=this.layers[0].layout.get("line-sort-key"),x=!_.isConstant(),w=[];for(let{feature:b,id:k,index:A,sourceLayerIndex:C}of v){let v=this.layers[0]._featureFilter.needGeometry,E=aD(b,v);if(!this.layers[0]._featureFilter.filter(new r0(this.zoom),E,y))continue;let S=x?_.evaluate(E,{},y):void 0,T={id:k,properties:b.properties,type:b.type,sourceLayerIndex:C,index:A,geometry:v?E.geometry:aR(b),patterns:{},dashes:{},sortKey:S};w.push(T)}for(let _ of(x&&w.sort((v,b)=>v.sortKey-b.sortKey),w)){let{geometry:x,index:w,sourceLayerIndex:k}=_;this.hasDependencies?(su("line",this.layers,b)?sd("line",this.layers,_,{zoom:this.zoom},b):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,_,this.zoom,b),this.patternFeatures.push(_)):this.addFeature(_,x,w,y,{},{},b.subdivisionGranularity),b.featureIndex.insert(v[w].feature,x,w,k,this.index)}}update(v,b,y,_){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(v,b,this.stateDependentLayers,{imagePositions:y,dashPositions:_})}addFeatures(v,b,y,_){for(let x of this.patternFeatures)this.addFeature(x,x.geometry,x.index,b,y,_,v.subdivisionGranularity)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(v){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=v.createVertexBuffer(this.layoutVertexArray2,s2)),this.layoutVertexBuffer=v.createVertexBuffer(this.layoutVertexArray,s1),this.indexBuffer=v.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(v),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(v){if(v.properties&&Object.prototype.hasOwnProperty.call(v.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(v.properties,"mapbox_clip_end"))return{start:+v.properties.mapbox_clip_start,end:+v.properties.mapbox_clip_end}}addFeature(v,b,y,_,x,w,k){let A=this.layers[0].layout,C=A.get("line-join").evaluate(v,{}),E=A.get("line-cap"),S=A.get("line-miter-limit"),T=A.get("line-round-limit");for(let y of(this.lineClips=this.lineFeatureClips(v),b))this.addLine(y,v,C,E,S,T,_,k);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,v,y,{imagePositions:x,dashPositions:w,canonical:_})}addLine(v,b,y,_,x,w,k,A){let C,E,S,T,O;if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,v=sM(v,k?A.line.getGranularityForZoomLevel(k.z):1),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let b=0;b<v.length-1;b++)this.totalDistance+=v[b].dist(v[b+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let F="Polygon"===s$.types[b.type],I=v.length;for(;I>=2&&v[I-1].equals(v[I-2]);)I--;let M=0;for(;M<I-1&&v[M].equals(v[M+1]);)M++;if(I<(F?3:2))return;"bevel"===y&&(x=1.05);let R=this.overscaling<=16?122880/(512*this.overscaling):0,D=this.segments.prepareSegment(10*I,this.layoutVertexArray,this.indexArray);this.e1=this.e2=-1,F&&(C=v[I-2],O=v[M].sub(C)._unit()._perp());for(let b=M;b<I;b++){if((S=b===I-1?F?v[M+1]:void 0:v[b+1])&&v[b].equals(S))continue;O&&(T=O),C&&(E=C),C=v[b],O=S?S.sub(C)._unit()._perp():T;let k=(T=T||O).add(O);0===k.x&&0===k.y||k._unit();let A=T.x*O.x+T.y*O.y,P=k.x*O.x+k.y*O.y,L=0!==P?1/P:1/0,N=2*Math.sqrt(2-2*P),z=P<s5&&E&&S,j=T.x*O.y-T.y*O.x>0;if(z&&b>M){let v=C.dist(E);if(v>2*R){let b=C.sub(C.sub(E)._mult(R/v)._round());this.updateDistance(E,b),this.addCurrentVertex(b,T,0,0,D),E=b}}let B=E&&S,U=B?y:F?"butt":_;if(B&&"round"===U&&(L<w?U="miter":L<=2&&(U="fakeround")),"miter"===U&&L>x&&(U="bevel"),"bevel"===U&&(L>2&&(U="flipbevel"),L<x&&(U="miter")),E&&this.updateDistance(E,C),"miter"===U)k._mult(L),this.addCurrentVertex(C,k,0,0,D);else if("flipbevel"===U){if(L>100)k=O.mult(-1);else{let v=L*T.add(O).mag()/T.sub(O).mag();k._perp()._mult(v*(j?-1:1))}this.addCurrentVertex(C,k,0,0,D),this.addCurrentVertex(C,k.mult(-1),0,0,D)}else if("bevel"===U||"fakeround"===U){let v=-Math.sqrt(L*L-1),b=j?v:0,y=j?0:v;if(E&&this.addCurrentVertex(C,T,b,y,D),"fakeround"===U){let v=Math.round(180*N/Math.PI/20);for(let b=1;b<v;b++){let y=b/v;if(.5!==y){let v=y-.5;y+=y*v*(y-1)*((1.0904+A*(A*(3.55645-1.43519*A)-3.2452))*v*v+(.848013+A*(.215638*A-1.06021)))}let _=O.sub(T)._mult(y)._add(T)._unit()._mult(j?-1:1);this.addHalfVertex(C,_.x,_.y,!1,j,0,D)}}S&&this.addCurrentVertex(C,O,-b,-y,D)}else if("butt"===U)this.addCurrentVertex(C,k,0,0,D);else if("square"===U){let v=E?1:-1;this.addCurrentVertex(C,k,v,v,D)}else"round"===U&&(E&&(this.addCurrentVertex(C,T,0,0,D),this.addCurrentVertex(C,T,1,1,D,!0)),S&&(this.addCurrentVertex(C,O,-1,-1,D,!0),this.addCurrentVertex(C,O,0,0,D)));if(z&&b<I-1){let v=C.dist(S);if(v>2*R){let b=C.add(S.sub(C)._mult(R/v)._round());this.updateDistance(C,b),this.addCurrentVertex(b,O,0,0,D),C=b}}}}addCurrentVertex(v,b,y,_,x,w=!1){let k=b.y*_-b.x,A=-b.y-b.x*_;this.addHalfVertex(v,b.x+b.y*y,b.y-b.x*y,w,!1,y,x),this.addHalfVertex(v,k,A,w,!0,-_,x),this.distance>16384&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(v,b,y,_,x,w))}addHalfVertex({x:v,y:b},y,_,x,w,k,A){let C=.5*(this.lineClips?32767*this.scaledDistance:this.scaledDistance);this.layoutVertexArray.emplaceBack((v<<1)+ +!!x,(b<<1)+ +!!w,Math.round(63*y)+128,Math.round(63*_)+128,1+(0===k?0:k<0?-1:1)|(63&C)<<2,C>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let E=A.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,E,this.e2),A.primitiveLength++),w?this.e2=E:this.e1=E}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(v,b){this.distance+=v.dist(b),this.updateScaledDistance()}hasLineDasharray(v){for(let b of v){let v=b.paint.get("line-dasharray");if(v&&!v.isConstant())return!0}return!1}addLineDashDependencies(v,b,y,_){for(let x of v){let v=x.paint.get("line-dasharray");if(!v||"constant"===v.value.kind)continue;let w="round"===x.layout.get("line-cap"),k={dasharray:v.value.evaluate({zoom:y-1},b,{}),round:w},A={dasharray:v.value.evaluate({zoom:y},b,{}),round:w},C={dasharray:v.value.evaluate({zoom:y+1},b,{}),round:w},E=`${k.dasharray.join(",")},${k.round}`,S=`${A.dasharray.join(",")},${A.round}`,T=`${C.dasharray.join(",")},${C.round}`;_.dashDependencies[E]=k,_.dashDependencies[S]=A,_.dashDependencies[T]=C,b.dashes[x.id]={min:E,mid:S,max:T}}}}rz("LineBucket",s3,{omit:["layers","patternFeatures"]});var s4={get paint(){return M=M||new oa({"line-opacity":new on(tr.paint_line["line-opacity"]),"line-color":new on(tr.paint_line["line-color"]),"line-translate":new ot(tr.paint_line["line-translate"]),"line-translate-anchor":new ot(tr.paint_line["line-translate-anchor"]),"line-width":new on(tr.paint_line["line-width"]),"line-gap-width":new on(tr.paint_line["line-gap-width"]),"line-offset":new on(tr.paint_line["line-offset"]),"line-blur":new on(tr.paint_line["line-blur"]),"line-dasharray":new oi(tr.paint_line["line-dasharray"]),"line-pattern":new oi(tr.paint_line["line-pattern"]),"line-gradient":new oo(tr.paint_line["line-gradient"])})},get layout(){return I=I||new oa({"line-cap":new ot(tr.layout_line["line-cap"]),"line-join":new on(tr.layout_line["line-join"]),"line-miter-limit":new ot(tr.layout_line["line-miter-limit"]),"line-round-limit":new ot(tr.layout_line["line-round-limit"]),"line-sort-key":new on(tr.layout_line["line-sort-key"])})}};class s6 extends on{possiblyEvaluate(v,b){return b=new r0(Math.floor(b.zoom),{now:b.now,fadeDuration:b.fadeDuration,zoomHistory:b.zoomHistory,transition:b.transition}),super.possiblyEvaluate(v,b)}evaluate(v,b,y,_){return b=eP({},b,{zoom:Math.floor(b.zoom)}),super.evaluate(v,b,y,_)}}class s8 extends os{constructor(v,b){super(v,s4,b),this.gradientVersion=0,R||((R=new s6(s4.paint.properties["line-width"].specification)).useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(v){if("line-gradient"===v){let v=this.gradientExpression();this.stepInterpolant=void 0!==v._styleExpression&&v._styleExpression.expression instanceof nA,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(v,b){super.recalculate(v,b),this.paint._values["line-floorwidth"]=R.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,v)}createBucket(v){return new s3(v)}queryRadius(v){var b,y;return b=aq("line-width",this,v),((y=aq("line-gap-width",this,v))>0?y+2*b:b)/2+Math.abs(aq("line-offset",this,v))+aH(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:v,feature:b,featureState:y,geometry:_,transform:x,pixelsToTileUnits:w}){var k,A;let C=aW(v,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-x.bearingInRadians,w),E=w/2*(k=this.paint.get("line-width").evaluate(b,y),(A=this.paint.get("line-gap-width").evaluate(b,y))>0?A+2*k:k),S=this.paint.get("line-offset").evaluate(b,y);return S&&(_=function(v,b){let y=[];for(let _=0;_<v.length;_++){let x=function(v){let b=[];for(let y=0;y<v.length;y++){let _=v[y],x=b.at(-1);(0===y||x&&!_.equals(x))&&b.push(_)}return b}(v[_]),w=[];for(let v=0;v<x.length;v++){let y=x[v],_=x[v-1],k=x[v+1],A=0===v?new z(0,0):y.sub(_)._unit()._perp(),C=v===x.length-1?new z(0,0):k.sub(y)._unit()._perp(),E=A._add(C)._unit(),S=E.x*C.x+E.y*C.y;0!==S&&E._mult(1/S),w.push(E._mult(b)._add(y))}y.push(w)}return y}(_,S*w)),function(v,b,y){for(let _=0;_<b.length;_++){let x=b[_];if(v.length>=3){for(let b=0;b<x.length;b++)if(aV(v,x[b]))return!0}if(function(v,b,y){if(v.length>1){if(aj(v,b))return!0;for(let _=0;_<b.length;_++)if(aB(b[_],v,y))return!0}for(let _=0;_<v.length;_++)if(aB(v[_],b,y))return!0;return!1}(v,x,y))return!0}return!1}(C,_,E)}isTileClipped(){return!0}}let s7=op([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),s9=op([{name:"a_projected_pos",components:3,type:"Float32"}],4);op([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let le=op([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);op([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);let lt=op([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),ln=op([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);op([{name:"triangle",components:3,type:"Uint16"}]),op([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),op([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),op([{type:"Float32",name:"offsetX"}]),op([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),op([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);let li={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","\xa2":"¢","\xa3":"£","\xa5":"¥","\xa6":"¦","\xac":"¬","\xaf":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","⋯":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},lr={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},lo={40:!0};function la(v,b,y,_,x,w){if("fontStack"in b){let _=y[b.fontStack],w=_&&_[v];return w?w.metrics.advance*b.scale+x:0}{let v=_[b.imageName];return v?v.displaySize[0]*b.scale*24/w+x:0}}function ls(v,b,y,_){let x=Math.pow(v-b,2);return _?v<b?x/2:2*x:x+Math.abs(y)*y}function ll(v,b,y,_,x,w){let k=null,A=ls(b,y,x,w);for(let v of _){let _=ls(b-v.x,y,x,w)+v.badness;_<=A&&(k=v,A=_)}return{index:v,x:b,priorBreak:k,badness:A}}class lc{constructor(v="",b=[],y=[]){this.text=v,this.sections=b,this.sectionIndex=y,this.imageSectionID=null}static fromFeature(v,b){let y=new lc;for(let _=0;_<v.sections.length;_++){let x=v.sections[_];x.image?y.addImageSection(x):y.addTextSection(x,b)}return y}length(){return[...this.text].length}getSection(v){return this.sections[this.sectionIndex[v]]}getSectionIndex(v){return this.sectionIndex[v]}verticalizePunctuation(){this.text=function(v){let b="",y={premature:!0,value:void 0},_=v[Symbol.iterator](),x=_.next(),w=v[Symbol.iterator]();w.next();let k=w.next();for(;!x.done;)b+=!k.done&&rX(k.value.codePointAt(0))&&!li[k.value]||!y.premature&&rX(y.value.codePointAt(0))&&!li[y.value]||!li[x.value]?x.value:li[x.value],y={value:x.value,premature:!1},x=_.next(),k=w.next();return b}(this.text)}hasZeroWidthSpaces(){return this.text.includes("")}trim(){let v=this.text.match(/^\s*/),b=v?v[0].length:0,y=this.text.match(/\S\s*$/),_=y?y[0].length-1:0;this.text=this.text.substring(b,this.text.length-_),this.sectionIndex=this.sectionIndex.slice(b,this.sectionIndex.length-_)}substring(v,b){let y=[...this.text].slice(v,b).join(""),_=this.sectionIndex.slice(v,b);return new lc(y,this.sections,_)}toCodeUnitIndex(v){return[...this.text].slice(0,v).join("").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((v,b)=>Math.max(v,this.sections[b].scale),0)}getMaxImageSize(v){let b=0,y=0;for(let _=0;_<this.length();_++){let x=this.getSection(_);if("imageName"in x){let _=v[x.imageName];if(!_)continue;let w=_.displaySize;b=Math.max(b,w[0]),y=Math.max(y,w[1])}}return{maxImageWidth:b,maxImageHeight:y}}addTextSection(v,b){this.text+=v.text,this.sections.push({scale:v.scale||1,verticalAlign:v.verticalAlign||"bottom",fontStack:v.fontStack||b});let y=this.sections.length-1;this.sectionIndex.push(...[...v.text].map(()=>y))}addImageSection(v){let b=v.image?v.image.name:"";if(0===b.length)return void e$("Can't add FormattedSection with an empty image.");let y=this.getNextImageSectionCharCode();y?(this.text+=String.fromCharCode(y),this.sections.push({scale:1,verticalAlign:v.verticalAlign||"bottom",imageName:b}),this.sectionIndex.push(this.sections.length-1)):e$("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(v,b,y,_,x){let w=[],k=this.determineAverageLineWidth(v,b,y,_,x),A=this.hasZeroWidthSpaces(),C=0,E=0,S=this.text[Symbol.iterator](),T=S.next(),O=this.text[Symbol.iterator]();O.next();let F=O.next(),I=this.text[Symbol.iterator]();I.next(),I.next();let M=I.next();for(;!T.done;){let b=this.getSection(E),R=T.value.codePointAt(0);if(rW(R)||(C+=la(R,b,y,_,v,x)),!F.done){let v=/[\u02EA\u02EB\u2E80-\u2FDF\u2FF0-\u303F\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FD-\u30FF\u3105-\u312F\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(R)),y=F.value.codePointAt(0);(lr[R]||v||"imageName"in b||!M.done&&lo[y])&&w.push(ll(E+1,C,k,w,function(v,b,y){let _=0;return 10===v&&(_-=1e4),y&&(_+=150),40!==v&&65288!==v||(_+=50),41!==b&&65289!==b||(_+=50),_}(R,y,v&&A),!1))}E++,T=S.next(),F=O.next(),M=I.next()}return function v(b){return b?v(b.priorBreak).concat(b.index):[]}(ll(this.length(),C,k,w,0,!0))}determineAverageLineWidth(v,b,y,_,x){let w=0,k=0;for(let b of this.text){let A=this.getSection(k);w+=la(b.codePointAt(0),A,y,_,v,x),k++}return w/Math.max(1,Math.ceil(w/b))}}let lu=1/0x100000000,ld="u"<typeof TextDecoder?null:new TextDecoder("utf-8");class lh{constructor(v=new Uint8Array(16)){this.buf=ArrayBuffer.isView(v)?v:new Uint8Array(v),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(v,b,y=this.length){for(;this.pos<y;){let y=this.readVarint(),_=y>>3,x=this.pos;this.type=7&y,v(_,b,this),this.pos===x&&this.skip(y)}return b}readMessage(v,b){return this.readFields(v,b,this.readVarint()+this.pos)}readFixed32(){let v=this.dataView.getUint32(this.pos,!0);return this.pos+=4,v}readSFixed32(){let v=this.dataView.getInt32(this.pos,!0);return this.pos+=4,v}readFixed64(){let v=this.dataView.getUint32(this.pos,!0)+0x100000000*this.dataView.getUint32(this.pos+4,!0);return this.pos+=8,v}readSFixed64(){let v=this.dataView.getUint32(this.pos,!0)+0x100000000*this.dataView.getInt32(this.pos+4,!0);return this.pos+=8,v}readFloat(){let v=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,v}readDouble(){let v=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,v}readVarint(v){let b,y,_=this.buf;return b=127&(y=_[this.pos++]),y<128?b:(b|=(127&(y=_[this.pos++]))<<7,y<128?b:(b|=(127&(y=_[this.pos++]))<<14,y<128?b:(b|=(127&(y=_[this.pos++]))<<21,y<128?b:function(v,b,y){let _,x,w=y.buf;if(_=(112&(x=w[y.pos++]))>>4,x<128||(_|=(127&(x=w[y.pos++]))<<3,x<128)||(_|=(127&(x=w[y.pos++]))<<10,x<128)||(_|=(127&(x=w[y.pos++]))<<17,x<128)||(_|=(127&(x=w[y.pos++]))<<24,x<128)||(_|=(1&(x=w[y.pos++]))<<31,x<128))return function(v,b,y){return y?0x100000000*b+(v>>>0):0x100000000*(b>>>0)+(v>>>0)}(v,_,b);throw Error("Expected varint not more than 10 bytes")}(b|=(15&(y=_[this.pos]))<<28,v,this))))}readVarint64(){return this.readVarint(!0)}readSVarint(){let v=this.readVarint();return v%2==1?-((v+1)/2):v/2}readBoolean(){return!!this.readVarint()}readString(){let v=this.readVarint()+this.pos,b=this.pos;return this.pos=v,v-b>=12&&ld?ld.decode(this.buf.subarray(b,v)):function(v,b,y){let _="",x=b;for(;x<y;){let b=v[x],w,k,A,C=null,E=b>239?4:b>223?3:b>191?2:1;if(x+E>y)break;1===E?b<128&&(C=b):2===E?128==(192&(w=v[x+1]))&&(C=(31&b)<<6|63&w)<=127&&(C=null):3===E?(w=v[x+1],k=v[x+2],128==(192&w)&&128==(192&k)&&((C=(15&b)<<12|(63&w)<<6|63&k)<=2047||C>=55296&&C<=57343)&&(C=null)):4===E&&(w=v[x+1],k=v[x+2],A=v[x+3],128==(192&w)&&128==(192&k)&&128==(192&A)&&((C=(15&b)<<18|(63&w)<<12|(63&k)<<6|63&A)<=65535||C>=1114112)&&(C=null)),null===C?(C=65533,E=1):C>65535&&(C-=65536,_+=String.fromCharCode(C>>>10&1023|55296),C=56320|1023&C),_+=String.fromCharCode(C),x+=E}return _}(this.buf,b,v)}readBytes(){let v=this.readVarint()+this.pos,b=this.buf.subarray(this.pos,v);return this.pos=v,b}readPackedVarint(v=[],b){let y=this.readPackedEnd();for(;this.pos<y;)v.push(this.readVarint(b));return v}readPackedSVarint(v=[]){let b=this.readPackedEnd();for(;this.pos<b;)v.push(this.readSVarint());return v}readPackedBoolean(v=[]){let b=this.readPackedEnd();for(;this.pos<b;)v.push(this.readBoolean());return v}readPackedFloat(v=[]){let b=this.readPackedEnd();for(;this.pos<b;)v.push(this.readFloat());return v}readPackedDouble(v=[]){let b=this.readPackedEnd();for(;this.pos<b;)v.push(this.readDouble());return v}readPackedFixed32(v=[]){let b=this.readPackedEnd();for(;this.pos<b;)v.push(this.readFixed32());return v}readPackedSFixed32(v=[]){let b=this.readPackedEnd();for(;this.pos<b;)v.push(this.readSFixed32());return v}readPackedFixed64(v=[]){let b=this.readPackedEnd();for(;this.pos<b;)v.push(this.readFixed64());return v}readPackedSFixed64(v=[]){let b=this.readPackedEnd();for(;this.pos<b;)v.push(this.readSFixed64());return v}readPackedEnd(){return 2===this.type?this.readVarint()+this.pos:this.pos+1}skip(v){let b=7&v;if(0===b)for(;this.buf[this.pos++]>127;);else if(2===b)this.pos=this.readVarint()+this.pos;else if(5===b)this.pos+=4;else{if(1!==b)throw Error(`Unimplemented type: ${b}`);this.pos+=8}}writeTag(v,b){this.writeVarint(v<<3|b)}realloc(v){let b=this.length||16;for(;b<this.pos+v;)b*=2;if(b!==this.length){let v=new Uint8Array(b);v.set(this.buf),this.buf=v,this.dataView=new DataView(v.buffer),this.length=b}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(v){this.realloc(4),this.dataView.setInt32(this.pos,v,!0),this.pos+=4}writeSFixed32(v){this.realloc(4),this.dataView.setInt32(this.pos,v,!0),this.pos+=4}writeFixed64(v){this.realloc(8),this.dataView.setInt32(this.pos,-1&v,!0),this.dataView.setInt32(this.pos+4,Math.floor(v*lu),!0),this.pos+=8}writeSFixed64(v){this.realloc(8),this.dataView.setInt32(this.pos,-1&v,!0),this.dataView.setInt32(this.pos+4,Math.floor(v*lu),!0),this.pos+=8}writeVarint(v){(v=+v||0)>0xfffffff||v<0?function(v,b){var y,_;let x,w,k;if(v>=0?(x=v%0x100000000|0,w=v/0x100000000|0):(x=~(-v%0x100000000),w=~(-v/0x100000000),0xffffffff^x?x=x+1|0:(x=0,w=w+1|0)),v>=0xffffffffffffffff||v<-0xffffffffffffffff)throw Error("Given varint doesn't fit into 10 bytes");b.realloc(10),y=x,b.buf[b.pos++]=127&y|128,y>>>=7,b.buf[b.pos++]=127&y|128,y>>>=7,b.buf[b.pos++]=127&y|128,y>>>=7,b.buf[b.pos++]=127&y|128,b.buf[b.pos]=127&(y>>>=7),k=(7&(_=w))<<4,b.buf[b.pos++]|=k|128*!!(_>>>=3),_&&(b.buf[b.pos++]=127&_|128*!!(_>>>=7),_&&(b.buf[b.pos++]=127&_|128*!!(_>>>=7),_&&(b.buf[b.pos++]=127&_|128*!!(_>>>=7),_&&(b.buf[b.pos++]=127&_|128*!!(_>>>=7),_&&(b.buf[b.pos++]=127&_)))))}(v,this):(this.realloc(4),this.buf[this.pos++]=127&v|128*(v>127),v<=127||(this.buf[this.pos++]=127&(v>>>=7)|128*(v>127),v<=127||(this.buf[this.pos++]=127&(v>>>=7)|128*(v>127),v<=127||(this.buf[this.pos++]=v>>>7&127))))}writeSVarint(v){this.writeVarint(v<0?-(2*v)-1:2*v)}writeBoolean(v){this.writeVarint(+v)}writeString(v){v=String(v),this.realloc(4*v.length),this.pos++;let b=this.pos;this.pos=function(v,b,y){for(let _,x,w=0;w<b.length;w++){if((_=b.charCodeAt(w))>55295&&_<57344){if(!x){_>56319||w+1===b.length?(v[y++]=239,v[y++]=191,v[y++]=189):x=_;continue}if(_<56320){v[y++]=239,v[y++]=191,v[y++]=189,x=_;continue}_=x-55296<<10|_-56320|65536,x=null}else x&&(v[y++]=239,v[y++]=191,v[y++]=189,x=null);_<128?v[y++]=_:(_<2048?v[y++]=_>>6|192:(_<65536?v[y++]=_>>12|224:(v[y++]=_>>18|240,v[y++]=_>>12&63|128),v[y++]=_>>6&63|128),v[y++]=63&_|128)}return y}(this.buf,v,this.pos);let y=this.pos-b;y>=128&&lp(b,y,this),this.pos=b-1,this.writeVarint(y),this.pos+=y}writeFloat(v){this.realloc(4),this.dataView.setFloat32(this.pos,v,!0),this.pos+=4}writeDouble(v){this.realloc(8),this.dataView.setFloat64(this.pos,v,!0),this.pos+=8}writeBytes(v){let b=v.length;this.writeVarint(b),this.realloc(b);for(let y=0;y<b;y++)this.buf[this.pos++]=v[y]}writeRawMessage(v,b){this.pos++;let y=this.pos;v(b,this);let _=this.pos-y;_>=128&&lp(y,_,this),this.pos=y-1,this.writeVarint(_),this.pos+=_}writeMessage(v,b,y){this.writeTag(v,2),this.writeRawMessage(b,y)}writePackedVarint(v,b){b.length&&this.writeMessage(v,lf,b)}writePackedSVarint(v,b){b.length&&this.writeMessage(v,lm,b)}writePackedBoolean(v,b){b.length&&this.writeMessage(v,lb,b)}writePackedFloat(v,b){b.length&&this.writeMessage(v,lg,b)}writePackedDouble(v,b){b.length&&this.writeMessage(v,lv,b)}writePackedFixed32(v,b){b.length&&this.writeMessage(v,ly,b)}writePackedSFixed32(v,b){b.length&&this.writeMessage(v,l_,b)}writePackedFixed64(v,b){b.length&&this.writeMessage(v,lx,b)}writePackedSFixed64(v,b){b.length&&this.writeMessage(v,lw,b)}writeBytesField(v,b){this.writeTag(v,2),this.writeBytes(b)}writeFixed32Field(v,b){this.writeTag(v,5),this.writeFixed32(b)}writeSFixed32Field(v,b){this.writeTag(v,5),this.writeSFixed32(b)}writeFixed64Field(v,b){this.writeTag(v,1),this.writeFixed64(b)}writeSFixed64Field(v,b){this.writeTag(v,1),this.writeSFixed64(b)}writeVarintField(v,b){this.writeTag(v,0),this.writeVarint(b)}writeSVarintField(v,b){this.writeTag(v,0),this.writeSVarint(b)}writeStringField(v,b){this.writeTag(v,2),this.writeString(b)}writeFloatField(v,b){this.writeTag(v,5),this.writeFloat(b)}writeDoubleField(v,b){this.writeTag(v,1),this.writeDouble(b)}writeBooleanField(v,b){this.writeVarintField(v,+b)}}function lp(v,b,y){let _=b<=16383?1:b<=2097151?2:b<=0xfffffff?3:Math.floor(Math.log(b)/(7*Math.LN2));y.realloc(_);for(let b=y.pos-1;b>=v;b--)y.buf[b+_]=y.buf[b]}function lf(v,b){for(let y=0;y<v.length;y++)b.writeVarint(v[y])}function lm(v,b){for(let y=0;y<v.length;y++)b.writeSVarint(v[y])}function lg(v,b){for(let y=0;y<v.length;y++)b.writeFloat(v[y])}function lv(v,b){for(let y=0;y<v.length;y++)b.writeDouble(v[y])}function lb(v,b){for(let y=0;y<v.length;y++)b.writeBoolean(v[y])}function ly(v,b){for(let y=0;y<v.length;y++)b.writeFixed32(v[y])}function l_(v,b){for(let y=0;y<v.length;y++)b.writeSFixed32(v[y])}function lx(v,b){for(let y=0;y<v.length;y++)b.writeFixed64(v[y])}function lw(v,b){for(let y=0;y<v.length;y++)b.writeSFixed64(v[y])}function lk(v,b,y){1===v&&y.readMessage(lA,b)}function lA(v,b,y){if(3===v){let{id:v,bitmap:_,width:x,height:w,left:k,top:A,advance:C}=y.readMessage(lC,{});b.push({id:v,bitmap:new a6({width:x+6,height:w+6},_),metrics:{width:x,height:w,left:k,top:A,advance:C}})}}function lC(v,b,y){1===v?b.id=y.readVarint():2===v?b.bitmap=y.readBytes():3===v?b.width=y.readVarint():4===v?b.height=y.readVarint():5===v?b.left=y.readSVarint():6===v?b.top=y.readSVarint():7===v&&(b.advance=y.readVarint())}function lE(v){let b=0,y=0;for(let _ of v)b+=_.w*_.h,y=Math.max(y,_.w);v.sort((v,b)=>b.h-v.h);let _=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(b/.95)),y),h:1/0}],x=0,w=0;for(let b of v)for(let v=_.length-1;v>=0;v--){let y=_[v];if(!(b.w>y.w||b.h>y.h)){if(b.x=y.x,b.y=y.y,w=Math.max(w,b.y+b.h),x=Math.max(x,b.x+b.w),b.w===y.w&&b.h===y.h){let b=_.pop();b&&v<_.length&&(_[v]=b)}else b.h===y.h?(y.x+=b.w,y.w-=b.w):(b.w===y.w||_.push({x:y.x+b.w,y:y.y,w:y.w-b.w,h:b.h}),y.y+=b.h,y.h-=b.h);break}}return{w:x,h:w,fill:b/(x*w)||0}}class lS{constructor(v,{pixelRatio:b,version:y,stretchX:_,stretchY:x,content:w,textFitWidth:k,textFitHeight:A}){this.paddedRect=v,this.pixelRatio=b,this.stretchX=_,this.stretchY=x,this.content=w,this.version=y,this.textFitWidth=k,this.textFitHeight=A}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class lT{constructor(v,b){const y={},_={};this.haveRenderCallbacks=[];const x=[];this.addImages(v,y,x),this.addImages(b,_,x);const{w:w,h:k}=lE(x),A=new a8({width:w||1,height:k||1});for(const b in v){const _=v[b],x=y[b].paddedRect;a8.copy(_.data,A,{x:0,y:0},{x:x.x+1,y:x.y+1},_.data)}for(const v in b){const y=b[v],x=_[v].paddedRect,w=x.x+1,k=x.y+1,C=y.data.width,E=y.data.height;a8.copy(y.data,A,{x:0,y:0},{x:w,y:k},y.data),a8.copy(y.data,A,{x:0,y:E-1},{x:w,y:k-1},{width:C,height:1}),a8.copy(y.data,A,{x:0,y:0},{x:w,y:k+E},{width:C,height:1}),a8.copy(y.data,A,{x:C-1,y:0},{x:w-1,y:k},{width:1,height:E}),a8.copy(y.data,A,{x:0,y:0},{x:w+C,y:k},{width:1,height:E})}this.image=A,this.iconPositions=y,this.patternPositions=_}addImages(v,b,y){for(let _ in v){let x=v[_],w={x:0,y:0,w:x.data.width+2,h:x.data.height+2};y.push(w),b[_]=new lS(w,x),x.hasRenderCallback&&this.haveRenderCallbacks.push(_)}}patchUpdatedImages(v,b){for(let y in v.dispatchRenderCallbacks(this.haveRenderCallbacks),v.updatedImages)this.patchUpdatedImage(this.iconPositions[y],v.getImage(y),b),this.patchUpdatedImage(this.patternPositions[y],v.getImage(y),b)}patchUpdatedImage(v,b,y){if(!v||!b||v.version===b.version)return;v.version=b.version;let[_,x]=v.tl;y.update(b.data,void 0,{x:_,y:x})}}function lO(b,y,_,x,w,k,A,C,E,S,T,O,F,I,M){let R,D=lc.fromFeature(b,w);O===v.az.vertical&&D.verticalizePunctuation();let P=D.determineLineBreaks(S,k,y,x,I),{processBidirectionalText:L,processStyledBidirectionalText:N}=rQ;if(L&&1===D.sections.length)for(let v of(R=[],P=P.map(v=>D.toCodeUnitIndex(v)),L(D.toString(),P))){let b=[...v].map(()=>0);R.push(new lc(v,D.sections,b))}else if(N){R=[],P=P.map(v=>D.toCodeUnitIndex(v));let v=0,b=[];for(let y of D.text)b.push(...Array(y.length).fill(D.sectionIndex[v])),v++;for(let v of N(D.text,b,P)){let b=[],y="";for(let _ of v[0])b.push(v[1][y.length]),y+=_;R.push(new lc(v[0],D.sections,b))}}else R=function(v,b){let y=[],_=0;for(let x of b)y.push(v.substring(_,x)),_=x;return _<v.length()&&y.push(v.substring(_,v.length())),y}(D,P);let z=[],j={positionedLines:z,text:D.toString(),top:T[1],bottom:T[1],left:T[0],right:T[0],writingMode:O,iconsInText:!1,verticalizable:!1};return function(b,y,_,x,w,k,A,C,E,S,T,O){let F=0,I=0,M=0,R=0,D="right"===C?1:.5*("left"!==C),P=24/O,L=0;for(let A of w){A.trim();let w=A.getMaxScale(),C={positionedGlyphs:[],lineOffset:0};b.positionedLines[L]=C;let O=C.positionedGlyphs,B=0;if(!A.length()){I+=k,++L;continue}let U=function(v,b,y){let _=24*b.getMaxScale(),{maxImageWidth:x,maxImageHeight:w}=b.getMaxImageSize(v),k=Math.max(_,w*y);return{verticalLineContentWidth:Math.max(_,x*y),horizontalLineContentHeight:k}}(x,A,P),V=0;for(let k of A.text){var N,z,j;let C,M=A.getSection(V),R=k.codePointAt(0),D=(N=E,z=T,j=R,!(N===v.az.horizontal||!z&&!rH(j)||z&&(rW(j)||/\p{sc=Arab}/u.test(String.fromCodePoint(j))))),L={glyph:R,imageName:null,x:F,y:I+-17,vertical:D,scale:1,fontStack:"",sectionIndex:A.getSectionIndex(V),metrics:null,rect:null};if("fontStack"in M){if(!(C=function(v,b,y,_,x,w){let k,A=w[v.fontStack],C=function(v,b,y,_){if(v&&v.rect)return v;let x=b[y.fontStack],w=x&&x[_];return w?{rect:null,metrics:w.metrics}:null}(A&&A[b],x,v,b);if(null===C)return null;if(y)k=_.verticalLineContentWidth-24*v.scale;else{let b=lI(v.verticalAlign);k=(_.horizontalLineContentHeight-24*v.scale)*b}return{rect:C.rect,metrics:C.metrics,baselineOffset:k}}(M,R,D,U,y,_)))continue;L.fontStack=M.fontStack}else{if(b.iconsInText=!0,M.scale*=P,!(C=function(v,b,y,_,x){let w,k=x[v.imageName];if(!k)return null;let A=k.paddedRect,C=k.displaySize,E={width:C[0],height:C[1],left:1,top:-3,advance:b?C[1]:C[0]};if(b)w=_.verticalLineContentWidth-C[1]*v.scale;else{let b=lI(v.verticalAlign);w=(_.horizontalLineContentHeight-C[1]*v.scale)*b}return{rect:A,metrics:E,baselineOffset:w,imageOffset:(b?C[0]:C[1])*v.scale-24*y}}(M,D,w,U,x)))continue;B=Math.max(B,C.imageOffset),L.imageName=M.imageName}let{rect:q,metrics:H,baselineOffset:W}=C;L.y+=W,L.scale=M.scale,L.metrics=H,L.rect=q,O.push(L),D?(b.verticalizable=!0,F+=("imageName"in M?H.advance:24)*M.scale+S):F+=H.advance*M.scale+S,V++}0!==O.length&&(M=Math.max(F-S,M),function(v,b,y){if(0===y)return;let _=v[b],x=(v[b].x+_.metrics.advance*_.scale)*y;for(let y=0;y<=b;y++)v[y].x-=x}(O,O.length-1,D)),F=0,C.lineOffset=Math.max(B,(w-1)*24);let q=k*w+B;I+=q,R=Math.max(q,R),++L}let{horizontalAlign:B,verticalAlign:U}=lF(A);(function(v,b,y,_,x,w,k,A,C){let E=(b-y)*x,S=0;for(let b of(S=w!==k?-A*_- -17:-_*C*k+.5*k,v))for(let v of b.positionedGlyphs)v.x+=E,v.y+=S})(b.positionedLines,D,B,U,M,R,k,I,w.length),b.top+=-U*I,b.bottom=b.top+I,b.left+=-B*M,b.right=b.left+M}(j,y,_,x,R,A,C,E,O,S,F,M),!function(v){for(let b of v)if(0!==b.positionedGlyphs.length)return!1;return!0}(z)&&j}function lF(v){let b=.5,y=.5;switch(v){case"right":case"top-right":case"bottom-right":b=1;break;case"left":case"top-left":case"bottom-left":b=0}switch(v){case"bottom":case"bottom-right":case"bottom-left":y=1;break;case"top":case"top-right":case"top-left":y=0}return{horizontalAlign:b,verticalAlign:y}}function lI(v){switch(v){case"top":return 0;case"center":return .5;default:return 1}}function lM(v){var b,y;let _=v.left,x=v.top,w=v.right-_,k=v.bottom-x,A=null!=(b=v.image.textFitWidth)?b:"stretchOrShrink",C=null!=(y=v.image.textFitHeight)?y:"stretchOrShrink",E=(v.image.content[2]-v.image.content[0])/(v.image.content[3]-v.image.content[1]);if("proportional"===C){if("stretchOnly"===A&&w/k<E||"proportional"===A){let v=Math.ceil(k*E);_*=v/w,w=v}}else if("proportional"===A&&"stretchOnly"===C&&0!==E&&w/k>E){let v=Math.ceil(w/E);x*=v/k,k=v}return{x1:_,y1:x,x2:_+w,y2:x+k}}function lR(v,b,y,_,x,w){let k,A,C,E,S,T=v.image;if(T.content){let v=T.content,b=T.pixelRatio||1;k=[v[0]/b,v[1]/b,T.displaySize[0]-v[2]/b,T.displaySize[1]-v[3]/b]}let O=b.left*w,F=b.right*w;"width"===y||"both"===y?(S=x[0]+O-_[3],C=x[0]+F+_[1]):C=(S=x[0]+(O+F-T.displaySize[0])/2)+T.displaySize[0];let I=b.top*w,M=b.bottom*w;return"height"===y||"both"===y?(A=x[1]+I-_[0],E=x[1]+M+_[2]):E=(A=x[1]+(I+M-T.displaySize[1])/2)+T.displaySize[1],{image:T,top:A,right:C,bottom:E,left:S,collisionPadding:k}}function lD(v,b){let{expression:y}=b;if("constant"===y.kind)return{kind:"constant",layoutSize:y.evaluate(new r0(v+1))};if("source"===y.kind)return{kind:"source"};{let{zoomStops:b,interpolationType:_}=y,x=0;for(;x<b.length&&b[x]<=v;)x++;let w=x=Math.max(0,x-1);for(;w<b.length&&b[w]<v+1;)w++;w=Math.min(b.length-1,w);let k=b[x],A=b[w];return"composite"===y.kind?{kind:"composite",minZoom:k,maxZoom:A,interpolationType:_}:{kind:"camera",minZoom:k,maxZoom:A,minSize:y.evaluate(new r0(k)),maxSize:y.evaluate(new r0(A)),interpolationType:_}}}function lP(v,b,y){let _="never",x=v.get(b);return x?_=x:v.get(y)&&(_="always"),_}rz("ImagePosition",lS),rz("ImageAtlas",lT),v.az=void 0,(K=v.az||(v.az={}))[K.none=0]="none",K[K.horizontal=1]="horizontal",K[K.vertical=2]="vertical",K[K.horizontalOnly=3]="horizontalOnly";let lL=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function lN(v,b,y,_,x,w,k,A,C,E,S,T,O){let F=A?Math.min(32640,Math.round(A[0])):0,I=A?Math.min(32640,Math.round(A[1])):0;v.emplaceBack(b,y,Math.round(32*_),Math.round(32*x),w,k,(F<<1)+ +!!C,I,16*E,16*S,256*T,256*O)}function lz(v,b,y){v.emplaceBack(b.x,b.y,y),v.emplaceBack(b.x,b.y,y),v.emplaceBack(b.x,b.y,y),v.emplaceBack(b.x,b.y,y)}class lj{constructor(v){this.layoutVertexArray=new o4,this.indexArray=new ae,this.programConfigurations=v,this.segments=new ai,this.dynamicLayoutVertexArray=new o6,this.opacityVertexArray=new o8,this.hasVisibleVertices=!1,this.placedSymbolArray=new oU}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(v,b,y,_){this.isEmpty()||(y&&(this.layoutVertexBuffer=v.createVertexBuffer(this.layoutVertexArray,s7.members),this.indexBuffer=v.createIndexBuffer(this.indexArray,b),this.dynamicLayoutVertexBuffer=v.createVertexBuffer(this.dynamicLayoutVertexArray,s9.members,!0),this.opacityVertexBuffer=v.createVertexBuffer(this.opacityVertexArray,lL,!0),this.opacityVertexBuffer.itemSize=1),(y||_)&&this.programConfigurations.upload(v))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}rz("SymbolBuffers",lj);class lB{constructor(v,b,y){this.layoutVertexArray=new v,this.layoutAttributes=b,this.indexArray=new y,this.segments=new ai,this.collisionVertexArray=new o9}upload(v){this.layoutVertexBuffer=v.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=v.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=v.createVertexBuffer(this.collisionVertexArray,le.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}rz("CollisionBuffers",lB);class l${constructor(b){this.collisionBoxArray=b.collisionBoxArray,this.zoom=b.zoom,this.overscaling=b.overscaling,this.layers=b.layers,this.layerIds=this.layers.map(v=>v.id),this.index=b.index,this.pixelRatio=b.pixelRatio,this.sourceLayerIndex=b.sourceLayerIndex,this.hasDependencies=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[];const y=this.layers[0]._unevaluatedLayout._values;this.textSizeData=lD(this.zoom,y["text-size"]),this.iconSizeData=lD(this.zoom,y["icon-size"]);const _=this.layers[0].layout,x=_.get("symbol-sort-key"),w=_.get("symbol-z-order");this.canOverlap="never"!==lP(_,"text-overlap","text-allow-overlap")||"never"!==lP(_,"icon-overlap","icon-allow-overlap")||_.get("text-ignore-placement")||_.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==w&&!x.isConstant(),this.sortFeaturesByY=("viewport-y"===w||"auto"===w&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===_.get("symbol-placement")&&(this.writingModes=_.get("text-writing-mode").map(b=>v.az[b])),this.stateDependentLayerIds=this.layers.filter(v=>v.isStateDependent()).map(v=>v.id),this.sourceID=b.sourceID}createArrays(){this.text=new lj(new aI(this.layers,this.zoom,v=>/^text/.test(v))),this.icon=new lj(new aI(this.layers,this.zoom,v=>/^icon/.test(v))),this.glyphOffsetArray=new oH,this.lineVertexArray=new oW,this.symbolInstances=new oq,this.textAnchorOffsets=new oY}calculateGlyphDependencies(v,b,y,_,x){for(let w of v)if(b[w.codePointAt(0)]=!0,(y||_)&&x){let v=li[w];v&&(b[v.codePointAt(0)]=!0)}}populate(b,y,_){let x=this.layers[0],w=x.layout,k=w.get("text-font"),A=w.get("text-field"),C=w.get("icon-image"),E=("constant"!==A.value.kind||A.value.value instanceof ne&&!A.value.value.isEmpty()||A.value.value.toString().length>0)&&("constant"!==k.value.kind||k.value.value.length>0),S="constant"!==C.value.kind||!!C.value.value||Object.keys(C.parameters).length>0,T=w.get("symbol-sort-key");if(this.features=[],!E&&!S)return;let O=y.iconDependencies,F=y.glyphDependencies,I=y.availableImages,M=new r0(this.zoom);for(let{feature:y,id:A,index:C,sourceLayerIndex:R}of b){let b,D,P=x._featureFilter.needGeometry,L=aD(y,P);if(!x._featureFilter.filter(M,L,_))continue;if(P||(L.geometry=aR(y)),E){let v=x.getValueAndResolveTokens("text-field",L,_,I),y=ne.factory(v),w=this.hasRTLText=this.hasRTLText||function(v){for(let b of v.sections)if(function(v){for(let b of v)if(rJ(b.codePointAt(0)))return!0;return!1}(b.text))return!0;return!1}(y);(!w||"unavailable"===rQ.getRTLTextPluginStatus()||w&&rQ.isParsed())&&(b=function(v,b,y){return v.sections.forEach(v=>{var _;let x;_=v.text,"uppercase"===(x=b.layout.get("text-transform").evaluate(y,{}))?_=_.toLocaleUpperCase():"lowercase"===x&&(_=_.toLocaleLowerCase()),rQ.applyArabicShaping&&(_=rQ.applyArabicShaping(_)),v.text=_}),v}(y,x,L))}if(S){let v=x.getValueAndResolveTokens("icon-image",L,_,I);D=v instanceof ns?v:ns.fromString(v)}if(!b&&!D)continue;let N=this.sortFeaturesByKey?T.evaluate(L,{},_):void 0;if(this.features.push({id:A,text:b,icon:D,index:C,sourceLayerIndex:R,geometry:L.geometry,properties:y.properties,type:s$.types[y.type],sortKey:N}),D&&(O[D.name]=!0),b){let y=k.evaluate(L,{},_).join(","),x="viewport"!==w.get("text-rotation-alignment")&&"point"!==w.get("symbol-placement");for(let _ of(this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(v.az.vertical)>=0,b.sections))if(_.image)O[_.image.name]=!0;else{let v=rG(b.toString()),w=_.fontStack||y,k=F[w]=F[w]||{};this.calculateGlyphDependencies(_.text,k,x,this.allowVerticalPlacement,v)}}}"line"===w.get("symbol-placement")&&(this.features=function(v){let b={},y={},_=[],x=0;function w(b){_.push(v[b]),x++}function k(v,b,x){let w=y[v];return delete y[v],y[b]=w,_[w].geometry[0].pop(),_[w].geometry[0]=_[w].geometry[0].concat(x[0]),w}function A(v,y,x){let w=b[y];return delete b[y],b[v]=w,_[w].geometry[0].shift(),_[w].geometry[0]=x[0].concat(_[w].geometry[0]),w}function C(v,b,y){let _=y?b[0][b[0].length-1]:b[0][0];return`${v}:${_.x}:${_.y}`}for(let E=0;E<v.length;E++){let S=v[E],T=S.geometry,O=S.text?S.text.toString():null;if(!O){w(E);continue}let F=C(O,T),I=C(O,T,!0);if(F in y&&I in b&&y[F]!==b[I]){let v=A(F,I,T),x=k(F,I,_[v].geometry);delete b[F],delete y[I],y[C(O,_[x].geometry,!0)]=x,_[v].geometry=null}else F in y?k(F,I,T):I in b?A(F,I,T):(w(E),b[F]=x-1,y[I]=x-1)}return _.filter(v=>v.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((v,b)=>v.sortKey-b.sortKey)}update(v,b,y){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(v,b,this.layers,{imagePositions:y}),this.icon.programConfigurations.updatePaintArrays(v,b,this.layers,{imagePositions:y}))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(v){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(v),this.iconCollisionBox.upload(v)),this.text.upload(v,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(v,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(v,b){let y=this.lineVertexArray.length;if(void 0!==v.segment){let y=v.dist(b[v.segment+1]),_=v.dist(b[v.segment]),x={};for(let _=v.segment+1;_<b.length;_++)x[_]={x:b[_].x,y:b[_].y,tileUnitDistanceFromAnchor:y},_<b.length-1&&(y+=b[_+1].dist(b[_]));for(let y=v.segment||0;y>=0;y--)x[y]={x:b[y].x,y:b[y].y,tileUnitDistanceFromAnchor:_},y>0&&(_+=b[y-1].dist(b[y]));for(let v=0;v<b.length;v++){let b=x[v];this.lineVertexArray.emplaceBack(b.x,b.y,b.tileUnitDistanceFromAnchor)}}return{lineStartIndex:y,lineLength:this.lineVertexArray.length-y}}addSymbols(b,y,_,x,w,k,A,C,E,S,T,O){let F=b.indexArray,I=b.layoutVertexArray,M=b.segments.prepareSegment(4*y.length,I,F,this.canOverlap?k.sortKey:void 0),R=this.glyphOffsetArray.length,D=M.vertexLength,P=this.allowVerticalPlacement&&A===v.az.vertical?Math.PI/2:0,L=k.text&&k.text.sections;for(let v=0;v<y.length;v++){let{tl:x,tr:w,bl:A,br:E,tex:S,pixelOffsetTL:T,pixelOffsetBR:R,minFontScaleX:D,minFontScaleY:N,glyphOffset:z,isSDF:j,sectionIndex:B}=y[v],U=M.vertexLength,V=z[1];lN(I,C.x,C.y,x.x,V+x.y,S.x,S.y,_,j,T.x,T.y,D,N),lN(I,C.x,C.y,w.x,V+w.y,S.x+S.w,S.y,_,j,R.x,T.y,D,N),lN(I,C.x,C.y,A.x,V+A.y,S.x,S.y+S.h,_,j,T.x,R.y,D,N),lN(I,C.x,C.y,E.x,V+E.y,S.x+S.w,S.y+S.h,_,j,R.x,R.y,D,N),lz(b.dynamicLayoutVertexArray,C,P),F.emplaceBack(U,U+2,U+1),F.emplaceBack(U+1,U+2,U+3),M.vertexLength+=4,M.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(z[0]),v!==y.length-1&&B===y[v+1].sectionIndex||b.programConfigurations.populatePaintArrays(I.length,k,k.index,{imagePositions:{},canonical:O,formattedSection:L&&L[B]})}b.placedSymbolArray.emplaceBack(C.x,C.y,R,this.glyphOffsetArray.length-R,D,E,S,C.segment,_?_[0]:0,_?_[1]:0,x[0],x[1],A,0,!1,0,T)}_addCollisionDebugVertex(v,b,y,_,x,w){return b.emplaceBack(0,0),v.emplaceBack(y.x,y.y,_,x,Math.round(w.x),Math.round(w.y))}addCollisionDebugVertices(v,b,y,_,x,w,k){let A=x.segments.prepareSegment(4,x.layoutVertexArray,x.indexArray),C=A.vertexLength,E=x.layoutVertexArray,S=x.collisionVertexArray,T=k.anchorX,O=k.anchorY;this._addCollisionDebugVertex(E,S,w,T,O,new z(v,b)),this._addCollisionDebugVertex(E,S,w,T,O,new z(y,b)),this._addCollisionDebugVertex(E,S,w,T,O,new z(y,_)),this._addCollisionDebugVertex(E,S,w,T,O,new z(v,_)),A.vertexLength+=4;let F=x.indexArray;F.emplaceBack(C,C+1),F.emplaceBack(C+1,C+2),F.emplaceBack(C+2,C+3),F.emplaceBack(C+3,C),A.primitiveLength+=4}addDebugCollisionBoxes(v,b,y,_){for(let x=v;x<b;x++){let v=this.collisionBoxArray.get(x);this.addCollisionDebugVertices(v.x1,v.y1,v.x2,v.y2,_?this.textCollisionBox:this.iconCollisionBox,v.anchorPoint,y)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new lB(o7,lt.members,at),this.iconCollisionBox=new lB(o7,lt.members,at);for(let v=0;v<this.symbolInstances.length;v++){let b=this.symbolInstances.get(v);this.addDebugCollisionBoxes(b.textBoxStartIndex,b.textBoxEndIndex,b,!0),this.addDebugCollisionBoxes(b.verticalTextBoxStartIndex,b.verticalTextBoxEndIndex,b,!0),this.addDebugCollisionBoxes(b.iconBoxStartIndex,b.iconBoxEndIndex,b,!1),this.addDebugCollisionBoxes(b.verticalIconBoxStartIndex,b.verticalIconBoxEndIndex,b,!1)}}_deserializeCollisionBoxesForSymbol(v,b,y,_,x,w,k,A,C){let E={};for(let _=b;_<y;_++){let b=v.get(_);E.textBox={x1:b.x1,y1:b.y1,x2:b.x2,y2:b.y2,anchorPointX:b.anchorPointX,anchorPointY:b.anchorPointY},E.textFeatureIndex=b.featureIndex;break}for(let b=_;b<x;b++){let y=v.get(b);E.verticalTextBox={x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,anchorPointX:y.anchorPointX,anchorPointY:y.anchorPointY},E.verticalTextFeatureIndex=y.featureIndex;break}for(let b=w;b<k;b++){let y=v.get(b);E.iconBox={x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,anchorPointX:y.anchorPointX,anchorPointY:y.anchorPointY},E.iconFeatureIndex=y.featureIndex;break}for(let b=A;b<C;b++){let y=v.get(b);E.verticalIconBox={x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,anchorPointX:y.anchorPointX,anchorPointY:y.anchorPointY},E.verticalIconFeatureIndex=y.featureIndex;break}return E}deserializeCollisionBoxes(v){this.collisionArrays=[];for(let b=0;b<this.symbolInstances.length;b++){let y=this.symbolInstances.get(b);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(v,y.textBoxStartIndex,y.textBoxEndIndex,y.verticalTextBoxStartIndex,y.verticalTextBoxEndIndex,y.iconBoxStartIndex,y.iconBoxEndIndex,y.verticalIconBoxStartIndex,y.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(v,b){let y=v.placedSymbolArray.get(b),_=y.vertexStartIndex+4*y.numGlyphs;for(let b=y.vertexStartIndex;b<_;b+=4)v.indexArray.emplaceBack(b,b+2,b+1),v.indexArray.emplaceBack(b+1,b+2,b+3)}getSortedSymbolIndexes(v){if(this.sortedAngle===v&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;let b=Math.sin(v),y=Math.cos(v),_=[],x=[],w=[];for(let v=0;v<this.symbolInstances.length;++v){w.push(v);let k=this.symbolInstances.get(v);_.push(0|Math.round(b*k.anchorX+y*k.anchorY)),x.push(k.featureIndex)}return w.sort((v,b)=>_[v]-_[b]||x[b]-x[v]),w}addToSortKeyRanges(v,b){let y=this.sortKeyRanges[this.sortKeyRanges.length-1];y&&y.sortKey===b?y.symbolInstanceEnd=v+1:this.sortKeyRanges.push({sortKey:b,symbolInstanceStart:v,symbolInstanceEnd:v+1})}sortFeatures(v){if(this.sortFeaturesByY&&this.sortedAngle!==v&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){for(let b of(this.symbolInstanceIndexes=this.getSortedSymbolIndexes(v),this.sortedAngle=v,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[],this.symbolInstanceIndexes)){let v=this.symbolInstances.get(b);this.featureSortOrder.push(v.featureIndex),[v.rightJustifiedTextSymbolIndex,v.centerJustifiedTextSymbolIndex,v.leftJustifiedTextSymbolIndex].forEach((v,b,y)=>{v>=0&&y.indexOf(v)===b&&this.addIndicesForPlacedSymbol(this.text,v)}),v.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,v.verticalPlacedTextSymbolIndex),v.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,v.placedIconSymbolIndex),v.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,v.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}rz("SymbolBucket",l$,{omit:["layers","collisionBoxArray","features","compareText"]}),l$.MAX_GLYPHS=65535,l$.addDynamicAttributes=lz;var lU={get paint(){return P=P||new oa({"icon-opacity":new on(tr.paint_symbol["icon-opacity"]),"icon-color":new on(tr.paint_symbol["icon-color"]),"icon-halo-color":new on(tr.paint_symbol["icon-halo-color"]),"icon-halo-width":new on(tr.paint_symbol["icon-halo-width"]),"icon-halo-blur":new on(tr.paint_symbol["icon-halo-blur"]),"icon-translate":new ot(tr.paint_symbol["icon-translate"]),"icon-translate-anchor":new ot(tr.paint_symbol["icon-translate-anchor"]),"text-opacity":new on(tr.paint_symbol["text-opacity"]),"text-color":new on(tr.paint_symbol["text-color"],{runtimeType:tx,getOverride:v=>v.textColor,hasOverride:v=>!!v.textColor}),"text-halo-color":new on(tr.paint_symbol["text-halo-color"]),"text-halo-width":new on(tr.paint_symbol["text-halo-width"]),"text-halo-blur":new on(tr.paint_symbol["text-halo-blur"]),"text-translate":new ot(tr.paint_symbol["text-translate"]),"text-translate-anchor":new ot(tr.paint_symbol["text-translate-anchor"])})},get layout(){return D=D||new oa({"symbol-placement":new ot(tr.layout_symbol["symbol-placement"]),"symbol-spacing":new ot(tr.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new ot(tr.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new on(tr.layout_symbol["symbol-sort-key"]),"symbol-z-order":new ot(tr.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new ot(tr.layout_symbol["icon-allow-overlap"]),"icon-overlap":new ot(tr.layout_symbol["icon-overlap"]),"icon-ignore-placement":new ot(tr.layout_symbol["icon-ignore-placement"]),"icon-optional":new ot(tr.layout_symbol["icon-optional"]),"icon-rotation-alignment":new ot(tr.layout_symbol["icon-rotation-alignment"]),"icon-size":new on(tr.layout_symbol["icon-size"]),"icon-text-fit":new ot(tr.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new ot(tr.layout_symbol["icon-text-fit-padding"]),"icon-image":new on(tr.layout_symbol["icon-image"]),"icon-rotate":new on(tr.layout_symbol["icon-rotate"]),"icon-padding":new on(tr.layout_symbol["icon-padding"]),"icon-keep-upright":new ot(tr.layout_symbol["icon-keep-upright"]),"icon-offset":new on(tr.layout_symbol["icon-offset"]),"icon-anchor":new on(tr.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new ot(tr.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new ot(tr.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new ot(tr.layout_symbol["text-rotation-alignment"]),"text-field":new on(tr.layout_symbol["text-field"]),"text-font":new on(tr.layout_symbol["text-font"]),"text-size":new on(tr.layout_symbol["text-size"]),"text-max-width":new on(tr.layout_symbol["text-max-width"]),"text-line-height":new ot(tr.layout_symbol["text-line-height"]),"text-letter-spacing":new on(tr.layout_symbol["text-letter-spacing"]),"text-justify":new on(tr.layout_symbol["text-justify"]),"text-radial-offset":new on(tr.layout_symbol["text-radial-offset"]),"text-variable-anchor":new ot(tr.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new on(tr.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new on(tr.layout_symbol["text-anchor"]),"text-max-angle":new ot(tr.layout_symbol["text-max-angle"]),"text-writing-mode":new ot(tr.layout_symbol["text-writing-mode"]),"text-rotate":new on(tr.layout_symbol["text-rotate"]),"text-padding":new ot(tr.layout_symbol["text-padding"]),"text-keep-upright":new ot(tr.layout_symbol["text-keep-upright"]),"text-transform":new on(tr.layout_symbol["text-transform"]),"text-offset":new on(tr.layout_symbol["text-offset"]),"text-allow-overlap":new ot(tr.layout_symbol["text-allow-overlap"]),"text-overlap":new ot(tr.layout_symbol["text-overlap"]),"text-ignore-placement":new ot(tr.layout_symbol["text-ignore-placement"]),"text-optional":new ot(tr.layout_symbol["text-optional"])})}};class lV{constructor(v){if(void 0===v.property.overrides)throw Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=v.property.overrides?v.property.overrides.runtimeType:tv,this.defaultValue=v}evaluate(v){if(v.formattedSection){let b=this.defaultValue.property.overrides;if(b&&b.hasOverride(v.formattedSection))return b.getOverride(v.formattedSection)}return v.feature&&v.featureState?this.defaultValue.evaluate(v.feature,v.featureState):this.defaultValue.property.specification.default}eachChild(v){this.defaultValue.isConstant()||v(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}rz("FormatSectionOverride",lV,{omit:["defaultValue"]});class lq extends os{constructor(v,b){super(v,lU,b)}recalculate(v,b){if(super.recalculate(v,b),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){let v=this.layout.get("text-writing-mode");if(v){let b=[];for(let y of v)0>b.indexOf(y)&&b.push(y);this.layout._values["text-writing-mode"]=b}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(v,b,y,_){var x;let w=this.layout.get(v).evaluate(b,{},y,_),k=this._unevaluatedLayout._values[v];return k.isDataDriven()||iW(k.value)||!w?w:(x=b.properties,w.replace(/{([^{}]+)}/g,(v,b)=>x&&b in x?String(x[b]):""))}createBucket(v){return new l$(v)}queryRadius(){return 0}queryIntersectsFeature(){throw Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let v of lU.paint.overridableProperties){if(!lq.hasPaintOverride(this.layout,v))continue;let b=this.paint.get(v),y=new iH(new lV(b),b.property.specification),_=null;_="constant"===b.value.kind||"source"===b.value.kind?new iY("source",y):new iZ("composite",y,b.value.zoomStops),this.paint._values[v]=new r9(b.property,_,b.parameters)}}_handleOverridablePaintPropertyUpdate(v,b,y){return!(!this.layout||b.isDataDriven()||y.isDataDriven())&&lq.hasPaintOverride(this.layout,v)}static hasPaintOverride(v,b){let y=v.get("text-field"),_=lU.paint.properties[b],x=!1,w=v=>{for(let b of v)if(_.overrides&&_.overrides.hasOverride(b))return void(x=!0)};if("constant"===y.value.kind&&y.value.value instanceof ne)w(y.value.value.sections);else if("source"===y.value.kind||"composite"===y.value.kind){let v=b=>{x||(b instanceof np&&nd(b.value)===tE?w(b.value.sections):b instanceof nW?w(b.sections):b.eachChild(v))},b=y.value;b._styleExpression&&v(b._styleExpression.expression)}return x}}var lH={get paint(){return L=L||new oa({"background-color":new ot(tr.paint_background["background-color"]),"background-pattern":new or(tr.paint_background["background-pattern"]),"background-opacity":new ot(tr.paint_background["background-opacity"])})}};class lW extends os{constructor(v,b){super(v,lH,b)}}class lG extends os{constructor(v,b){super(v,{},b),this.onAdd=v=>{this.implementation.onAdd&&this.implementation.onAdd(v,v.painter.context.gl)},this.onRemove=v=>{this.implementation.onRemove&&this.implementation.onRemove(v,v.painter.context.gl)},this.implementation=v}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw Error("Custom layers cannot be serialized")}}class lY{constructor(v){this._methodToThrottle=v,this._triggered=!1,"u">typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}let lZ={once:!0};class lX{constructor(v,b){if(isNaN(v)||isNaN(b))throw Error(`Invalid LngLat object: (${v}, ${b})`);if(this.lng=+v,this.lat=+b,this.lat>90||this.lat<-90)throw Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new lX(eD(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(v){let b=Math.PI/180,y=this.lat*b,_=v.lat*b;return 6371008.8*Math.acos(Math.min(Math.sin(y)*Math.sin(_)+Math.cos(y)*Math.cos(_)*Math.cos((v.lng-this.lng)*b),1))}static convert(v){if(v instanceof lX)return v;if(Array.isArray(v)&&(2===v.length||3===v.length))return new lX(Number(v[0]),Number(v[1]));if(!Array.isArray(v)&&"object"==typeof v&&null!==v)return new lX(Number("lng"in v?v.lng:v.lon),Number(v.lat));throw Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}let lK=2*Math.PI*6371008.8;function lJ(v){return lK*Math.cos(v*Math.PI/180)}function lQ(v){return(180+v)/360}function l0(v){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+v*Math.PI/360)))/360}function l1(v){return 360*v-180}function l2(v){return 360/Math.PI*Math.atan(Math.exp((180-360*v)*Math.PI/180))-90}function l5(v,b){return v*lJ(l2(b))}class l3{constructor(v,b,y=0){this.x=+v,this.y=+b,this.z=+y}static fromLngLat(v,b=0){let y=lX.convert(v);return new l3(lQ(y.lng),l0(y.lat),b/lJ(y.lat))}toLngLat(){return new lX(l1(this.x),l2(this.y))}toAltitude(){return l5(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/lK*(1/Math.cos(l2(this.y)*Math.PI/180))}}function l4(v,b,y){var _=2*Math.PI*6378137/256/Math.pow(2,y);return[v*_-2*Math.PI*6378137/2,b*_-2*Math.PI*6378137/2]}class l6{constructor(v,b,y){if(!function(v,b,y){return!(v<0||v>25||y<0||y>=Math.pow(2,v)||b<0||b>=Math.pow(2,v))}(v,b,y))throw Error(`x=${b}, y=${y}, z=${v} outside of bounds. 0<=x<${Math.pow(2,v)}, 0<=y<${Math.pow(2,v)} 0<=z<=25 `);this.z=v,this.x=b,this.y=y,this.key=l9(0,v,v,b,y)}equals(v){return this.z===v.z&&this.x===v.x&&this.y===v.y}url(v,b,y){var _,x,w,k,A;let C=(x=this.y,w=this.z,k=l4(256*(_=this.x),256*(x=Math.pow(2,w)-x-1),w),A=l4(256*(_+1),256*(x+1),w),k[0]+","+k[1]+","+A[0]+","+A[1]),E=function(v,b,y){let _,x="";for(let w=v;w>0;w--)x+=(b&(_=1<<w-1)?1:0)+(y&_?2:0);return x}(this.z,this.x,this.y);return v[(this.x+this.y)%v.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===y?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,b>1?"@2x":"").replace(/{quadkey}/g,E).replace(/{bbox-epsg-3857}/g,C)}isChildOf(v){let b=this.z-v.z;return b>0&&v.x===this.x>>b&&v.y===this.y>>b}getTilePoint(v){let b=Math.pow(2,this.z);return new z((v.x*b-this.x)*8192,(v.y*b-this.y)*8192)}toString(){return`${this.z}/${this.x}/${this.y}`}}class l8{constructor(v,b){this.wrap=v,this.canonical=b,this.key=l9(v,b.z,b.z,b.x,b.y)}}class l7{constructor(v,b,y,_,x){if(this.terrainRttPosMatrix32f=null,v<y)throw Error(`overscaledZ should be >= z; overscaledZ = ${v}; z = ${y}`);this.overscaledZ=v,this.wrap=b,this.canonical=new l6(y,+_,+x),this.key=l9(b,v,y,_,x)}clone(){return new l7(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(v){return this.overscaledZ===v.overscaledZ&&this.wrap===v.wrap&&this.canonical.equals(v.canonical)}scaledTo(v){if(v>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${v}; overscaledZ = ${this.overscaledZ}`);let b=this.canonical.z-v;return v>this.canonical.z?new l7(v,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new l7(v,this.wrap,v,this.canonical.x>>b,this.canonical.y>>b)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(v,b){if(v>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${v}; overscaledZ = ${this.overscaledZ}`);let y=this.canonical.z-v;return v>this.canonical.z?l9(this.wrap*b,v,this.canonical.z,this.canonical.x,this.canonical.y):l9(this.wrap*b,v,v,this.canonical.x>>y,this.canonical.y>>y)}isChildOf(v){if(v.wrap!==this.wrap||this.overscaledZ-v.overscaledZ<=0)return!1;if(0===v.overscaledZ)return this.overscaledZ>0;let b=this.canonical.z-v.canonical.z;return!(b<0)&&v.canonical.x===this.canonical.x>>b&&v.canonical.y===this.canonical.y>>b}children(v){if(this.overscaledZ>=v)return[new l7(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let b=this.canonical.z+1,y=2*this.canonical.x,_=2*this.canonical.y;return[new l7(b,this.wrap,b,y,_),new l7(b,this.wrap,b,y+1,_),new l7(b,this.wrap,b,y,_+1),new l7(b,this.wrap,b,y+1,_+1)]}isLessThan(v){return this.wrap<v.wrap||!(this.wrap>v.wrap)&&(this.overscaledZ<v.overscaledZ||!(this.overscaledZ>v.overscaledZ)&&(this.canonical.x<v.canonical.x||!(this.canonical.x>v.canonical.x)&&this.canonical.y<v.canonical.y))}wrapped(){return new l7(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(v){return new l7(this.overscaledZ,v,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new l8(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(v){return this.canonical.getTilePoint(new l3(v.x-this.wrap,v.y))}normalizeCoordinates(v,b,y=8192){if(v>=0&&v<y&&b>=0&&b<y)return{tileID:this,x:v,y:b};let _=Math.floor(v/y),x=Math.floor(b/y),w=this.canonical.z,k=1<<w,A=this.canonical.y+x;if(A<0||A>=k)return null;let C=this.canonical.x+_,E=this.wrap;return C<0?(E-=Math.ceil(-C/k),C=(C%k+k)%k):C>=k&&(E+=Math.floor(C/k),C%=k),{tileID:new l7(this.overscaledZ,E,w,C,A),x:v-_*y,y:b-x*y}}}function l9(v,b,y,_,x){(v*=2)<0&&(v=-1*v-1);let w=1<<y;return(w*w*v+w*x+_).toString(36)+y.toString(36)+b.toString(36)}function ce(v,b){return b?v.properties[b]:v.id}function ct(v){var b,y;if(!v)return{};let _={};return _.removeAll=v.removeAll,_.remove=new Set(v.remove||[]),_.add=new Map(null==(b=v.add)?void 0:b.map(v=>[v.id,v])),_.update=new Map(null==(y=v.update)?void 0:y.map(v=>[v.id,v])),_}rz("CanonicalTileID",l6),rz("OverscaledTileID",l7,{omit:["terrainRttPosMatrix32f"]});class cn{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(v){return this.minX=Math.min(this.minX,v.x),this.minY=Math.min(this.minY,v.y),this.maxX=Math.max(this.maxX,v.x),this.maxY=Math.max(this.maxY,v.y),this}expandBy(v){return this.minX-=v,this.minY-=v,this.maxX+=v,this.maxY+=v,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(v){return this.expandBy(-v)}map(v){let b=new cn;return b.extend(v(new z(this.minX,this.minY))),b.extend(v(new z(this.maxX,this.minY))),b.extend(v(new z(this.minX,this.maxY))),b.extend(v(new z(this.maxX,this.maxY))),b}static fromPoints(v){let b=new cn;for(let y of v)b.extend(y);return b}contains(v){return v.x>=this.minX&&v.x<=this.maxX&&v.y>=this.minY&&v.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(v){return!this.empty()&&!v.empty()&&v.minX>=this.minX&&v.maxX<=this.maxX&&v.minY>=this.minY&&v.maxY<=this.maxY}intersects(v){return!this.empty()&&!v.empty()&&v.minX<=this.maxX&&v.maxX>=this.minX&&v.minY<=this.maxY&&v.maxY>=this.minY}}class ci{constructor(v){this._stringToNumber={},this._numberToString=[];for(let b=0;b<v.length;b++){const y=v[b];this._stringToNumber[y]=b,this._numberToString[b]=y}}encode(v){return this._stringToNumber[v]}decode(v){if(v>=this._numberToString.length)throw Error(`Out of bounds. Index requested n=${v} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[v]}}class cr{constructor(v,b,y,_,x){this.type="Feature",this._vectorTileFeature=v,this._x=y,this._y=_,this._z=b,this.properties=v.properties,this.id=x}projectPoint(v,b,y,_){return[360*(v.x+b)/_-180,360/Math.PI*Math.atan(Math.exp((1-2*(v.y+y)/_)*Math.PI))-90]}projectLine(v,b,y,_){return v.map(v=>this.projectPoint(v,b,y,_))}get geometry(){if(this._geometry)return this._geometry;let v=this._vectorTileFeature,b=v.extent*Math.pow(2,this._z),y=v.extent*this._x,_=v.extent*this._y,x=v.loadGeometry();switch(v.type){case 1:{let v=[];for(let b of x)v.push(b[0]);let w=this.projectLine(v,y,_,b);this._geometry=1===v.length?{type:"Point",coordinates:w[0]}:{type:"MultiPoint",coordinates:w};break}case 2:{let v=x.map(v=>this.projectLine(v,y,_,b));this._geometry=1===v.length?{type:"LineString",coordinates:v[0]}:{type:"MultiLineString",coordinates:v};break}case 3:{let v=sV(x),w=[];for(let x of v)w.push(x.map(v=>this.projectLine(v,y,_,b)));this._geometry=1===w.length?{type:"Polygon",coordinates:w[0]}:{type:"MultiPolygon",coordinates:w};break}default:throw Error(`unknown feature type: ${v.type}`)}return this._geometry}set geometry(v){this._geometry=v}toJSON(){let v={geometry:this.geometry};for(let b in this)"_geometry"!==b&&"_vectorTileFeature"!==b&&"_x"!==b&&"_y"!==b&&"_z"!==b&&(v[b]=this[b]);return v}}class co{_name;dataBuffer;nullabilityBuffer;_size;constructor(v,b,y){this._name=v,this.dataBuffer=b,"number"==typeof y?this._size=y:(this.nullabilityBuffer=y,this._size=y.size())}getValue(v){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(v)?null:this.getValueFromBuffer(v)}has(v){return this.nullabilityBuffer&&this.nullabilityBuffer.get(v)||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}}class ca extends co{}class cs extends ca{getValueFromBuffer(v){return this.dataBuffer[v]}}class cl extends ca{getValueFromBuffer(v){return this.dataBuffer[v]}}class cc extends co{delta;constructor(v,b,y,_){super(v,b,_),this.delta=y}}class cu extends cc{constructor(v,b,y,_){super(v,Int32Array.of(b),y,_)}getValueFromBuffer(v){return this.dataBuffer[0]+v*this.delta}}class cd extends co{constructor(v,b,y){super(v,Int32Array.of(b),y)}getValueFromBuffer(v){return this.dataBuffer[0]}}class ch{_name;_geometryVector;_idVector;_propertyVectors;_extent;propertyVectorsMap;constructor(v,b,y,_,x=4096){this._name=v,this._geometryVector=b,this._idVector=y,this._propertyVectors=_,this._extent=x}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){return this._propertyVectors}getPropertyVector(v){return this.propertyVectorsMap||(this.propertyVectorsMap=new Map(this._propertyVectors.map(v=>[v.name,v]))),this.propertyVectorsMap.get(v)}*[Symbol.iterator](){let v=this.geometryVector[Symbol.iterator](),b=0;for(;b<this.numFeatures;){let y;this.idVector&&(y=this.containsMaxSaveIntegerValues(this.idVector)?Number(this.idVector.getValue(b)):this.idVector.getValue(b));let _=v?.next().value,x={};for(let v of this.propertyVectors){if(!v)continue;let y=v.name,_=v.getValue(b);null!==_&&(x[y]=_)}b++,yield{id:y,geometry:_,properties:x}}}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let v=[],b=this.geometryVector.getGeometries();for(let y=0;y<this.numFeatures;y++){let _;this.idVector&&(_=this.containsMaxSaveIntegerValues(this.idVector)?Number(this.idVector.getValue(y)):this.idVector.getValue(y));let x={coordinates:b[y],type:this.geometryVector.geometryType(y)},w={};for(let v of this.propertyVectors){if(!v)continue;let b=v.name,_=v.getValue(y);null!==_&&(w[b]=_)}v.push({id:_,geometry:x,properties:w})}return v}containsMaxSaveIntegerValues(v){return v instanceof cs||v instanceof cd&&v instanceof cu||v instanceof cl}}class cp{value;constructor(v){this.value=v}get(){return this.value}set(v){this.value=v}increment(){return this.value++}add(v){this.value+=v}}function cf(v,b,y){let _=new Int32Array(y),x=0,w=b.get();for(let b=0;b<_.length;b++){let b=v[w++],y=127&b;b<128||(y|=(127&(b=v[w++]))<<7,b<128||(y|=(127&(b=v[w++]))<<14,b<128||(y|=(127&(b=v[w++]))<<21,b<128||(y|=(15&(b=v[w++]))<<28)))),_[x++]=y}return b.set(w),_}function cm(v,b,y){let _=new BigInt64Array(y);for(let y=0;y<_.length;y++)_[y]=function(v,b){let y=0n,_=0,x=b.get();for(;x<v.length;){let b=v[x++];if(y|=BigInt(127&b)<<BigInt(_),!(128&b))break;if((_+=7)>=64)throw Error("Varint too long")}return b.set(x),y}(v,b);return _}function cg(v){return v>>>1^-(1&v)}function cv(v){return v>>1n^-(1n&v)}function cb(v){return v%2==1?-((v+1)/2):v/2}function cy(v,b,y){if(void 0===y){y=0;for(let _=0;_<b;_++)y+=v[_]}let _=new Int32Array(y),x=0;for(let y=0;y<b;y++){let w=v[y];_.fill(v[y+b],x,x+w),x+=w}return _}function c_(v,b,y){if(void 0===y){y=0;for(let _=0;_<b;_++)y+=Number(v[_])}let _=new BigInt64Array(y),x=0;for(let y=0;y<b;y++){let w=Number(v[y]);_.fill(v[y+b],x,x+w),x+=w}return _}function cx(v,b,y){let _=new Float64Array(y),x=0;for(let y=0;y<b;y++){let w=v[y];_.fill(v[y+b],x,x+w),x+=w}return _}function cw(v){let b=v.length/4*4,y=1;if(b>=4)for(let _=v[0];y<b-4;y+=4)_=v[y]+=_,_=v[y+1]+=_,_=v[y+2]+=_,_=v[y+3]+=_;for(;y!=v.length;)v[y]+=v[y-1],++y}(B=J||(J={})).NONE="NONE",B.DELTA="DELTA",B.COMPONENTWISE_DELTA="COMPONENTWISE_DELTA",B.RLE="RLE",B.MORTON="MORTON",B.PDE="PDE",(U=Q||(Q={})).NONE="NONE",U.FAST_PFOR="FAST_PFOR",U.VARINT="VARINT",U.ALP="ALP",(V=ee||(ee={})).PRESENT="PRESENT",V.DATA="DATA",V.OFFSET="OFFSET",V.LENGTH="LENGTH";class ck{_dictionaryType;_offsetType;_lengthType;constructor(v,b,y){this._dictionaryType=v,this._offsetType=b,this._lengthType=y}get dictionaryType(){return this._dictionaryType}get offsetType(){return this._offsetType}get lengthType(){return this._lengthType}}function cA(v,b){let y,_,x=function(v,b){let y=v[b.get()],_=Object.values(ee)[y>>4],x=null;switch(_){case ee.DATA:x=new ck(Object.values(et)[15&y]);break;case ee.OFFSET:x=new ck(null,Object.values(en)[15&y]);break;case ee.LENGTH:x=new ck(null,null,Object.values(ei)[15&y])}b.increment();let w=v[b.get()],k=Object.values(J)[w>>5],A=Object.values(J)[w>>2&7],C=Object.values(Q)[3&w];b.increment();let E=cf(v,b,2),S=E[0];return{physicalStreamType:_,logicalStreamType:x,logicalLevelTechnique1:k,logicalLevelTechnique2:A,physicalLevelTechnique:C,numValues:S,byteLength:E[1],decompressedCount:S}}(v,b);return x.logicalLevelTechnique1===J.MORTON?(y=cf(v,b,2),{physicalStreamType:x.physicalStreamType,logicalStreamType:x.logicalStreamType,logicalLevelTechnique1:x.logicalLevelTechnique1,logicalLevelTechnique2:x.logicalLevelTechnique2,physicalLevelTechnique:x.physicalLevelTechnique,numValues:x.numValues,byteLength:x.byteLength,decompressedCount:x.decompressedCount,numBits:y[0],coordinateShift:y[1]}):J.RLE!==x.logicalLevelTechnique1&&J.RLE!==x.logicalLevelTechnique2||Q.NONE===x.physicalLevelTechnique?x:(_=cf(v,b,2),{physicalStreamType:x.physicalStreamType,logicalStreamType:x.logicalStreamType,logicalLevelTechnique1:x.logicalLevelTechnique1,logicalLevelTechnique2:x.logicalLevelTechnique2,physicalLevelTechnique:x.physicalLevelTechnique,numValues:x.numValues,byteLength:x.byteLength,decompressedCount:_[1],runs:_[0],numRleValues:_[1]})}(q=et||(et={})).NONE="NONE",q.SINGLE="SINGLE",q.SHARED="SHARED",q.VERTEX="VERTEX",q.MORTON="MORTON",q.FSST="FSST",(H=en||(en={})).VERTEX="VERTEX",H.INDEX="INDEX",H.STRING="STRING",H.KEY="KEY",(W=ei||(ei={})).VAR_BINARY="VAR_BINARY",W.GEOMETRIES="GEOMETRIES",W.PARTS="PARTS",W.RINGS="RINGS",W.TRIANGLES="TRIANGLES",W.SYMBOL="SYMBOL",W.DICTIONARY="DICTIONARY",(G=er||(er={}))[G.FLAT=0]="FLAT",G[G.CONST=1]="CONST",G[G.SEQUENCE=2]="SEQUENCE",G[G.DICTIONARY=3]="DICTIONARY",G[G.FSST_DICTIONARY=4]="FSST_DICTIONARY";class cC{values;_size;constructor(v,b){this.values=v,this._size=b}get(v){let b=Math.floor(v/8);return 1==(this.values[b]>>v%8&1)}set(v,b){let y=Math.floor(v/8);this.values[y]=this.values[y]|!!b<<v%8}getInt(v){let b=Math.floor(v/8);return this.values[b]>>v%8&1}size(){return this._size}getBuffer(){return this.values}}function cE(v,b,y){if(!b)return v;let _=b.size(),x=new(0,v.constructor)(_),w=0;for(let k=0;k<_;k++)x[k]=b.get(k)?v[w++]:y;return x}function cS(v,b,y,_,x,w){return function(v,b,y,_){switch(b.logicalLevelTechnique1){case J.DELTA:if(b.logicalLevelTechnique2===J.RLE){if(!_)return function(v,b,y){let _=new Int32Array(y),x=0,w=0;for(let y=0;y<b;y++){let k=v[y],A=cg(v[y+b]);for(let v=0;v<k;v++)w+=A,_[x++]=w}return _}(v,b.runs,b.numRleValues);v=cy(v,b.runs,b.numRleValues)}!function(v){v[0]=cg(v[0]);let b=v.length/4*4,y=1;if(b>=4)for(;y<b-4;y+=4){let b=v[y+1],_=v[y+2],x=v[y+3];v[y]=cg(v[y])+v[y-1],v[y+1]=cg(b)+v[y],v[y+2]=cg(_)+v[y+1],v[y+3]=cg(x)+v[y+2]}for(;y!=v.length;++y)v[y]=cg(v[y])+v[y-1]}(v);break;case J.RLE:var x;x=v,v=y?function(v,b,y){if(void 0===y){y=0;for(let _=0;_<b;_++)y+=v[_]}let _=new Int32Array(y),x=0;for(let y=0;y<b;y++){let w=v[y],k=v[y+b];k=cg(k),_.fill(k,x,x+w),x+=w}return _}(x,b.runs,b.numRleValues):cy(x,b.runs,b.numRleValues);break;case J.MORTON:cw(v);break;case J.COMPONENTWISE_DELTA:!function(v){if(v.length<2)return;v[0]=cg(v[0]),v[1]=cg(v[1]);let b=v.length/4*4,y=2;if(b>=4)for(;y<b-4;y+=4){let b=v[y+1],_=v[y+2],x=v[y+3];v[y]=cg(v[y])+v[y-2],v[y+1]=cg(b)+v[y-1],v[y+2]=cg(_)+v[y],v[y+3]=cg(x)+v[y+1]}for(;y!=v.length;y+=2)v[y]=cg(v[y])+v[y-2],v[y+1]=cg(v[y+1])+v[y-1]}(v);break;case J.NONE:y&&function(v){for(let b=0;b<v.length;b++)v[b]=cg(v[b])}(v);break;default:throw Error(`The specified Logical level technique is not supported: ${b.logicalLevelTechnique1}`)}return _?cE(v,_,0):v}(cO(v,b,y),y,_,w)}function cT(v,b,y){return function(v,b){if(b.logicalLevelTechnique1===J.DELTA&&b.logicalLevelTechnique2===J.NONE){let b=new Int32Array(v.length+1);b[0]=0,b[1]=cg(v[0]);let y=b[1];for(let _=2;_!=b.length;++_)y+=cg(v[_-1]),b[_]=b[_-1]+y;return new Uint32Array(b)}if(b.logicalLevelTechnique1===J.RLE&&b.logicalLevelTechnique2===J.NONE)return function(v,b,y){let _=new Int32Array(y+1);_[0]=0;let x=1,w=_[0];for(let y=0;y<b;y++){let k=v[y],A=v[y+b];for(let v=x;v<x+k;v++)_[v]=A+w,w=_[v];x+=k}return new Uint32Array(_)}(v,b.runs,b.numRleValues);if(b.logicalLevelTechnique1===J.NONE&&b.logicalLevelTechnique2===J.NONE){let y=0;for(let b=0;b<v.length;b++)v[b]+=y,y=v[b];let _=new Uint32Array(b.numValues+1);return _[0]=0,_.set(v,1),_}if(b.logicalLevelTechnique1===J.DELTA&&b.logicalLevelTechnique2===J.RLE){let y=function(v,b,y){let _=new Int32Array(y+1);_[0]=0;let x=1,w=_[0];for(let y=0;y<b;y++){let k=v[y],A=v[y+b];A=cg(A);for(let v=x;v<x+k;v++)_[v]=A+w,w=_[v];x+=k}return new Uint32Array(_)}(v,b.runs,b.numRleValues);return cw(y),y}throw Error("Only delta encoding is supported for transforming length to offset streams yet.")}(cO(v,b,y),y)}function cO(v,b,y){let _=y.physicalLevelTechnique;if(_===Q.FAST_PFOR)throw Error("FastPFor is not implemented yet.");if(_===Q.VARINT)return cf(v,b,y.numValues);if(_===Q.NONE){let _=b.get();return b.add(y.byteLength),new Int32Array(v.subarray(_,b.get()))}throw Error("Specified physicalLevelTechnique is not supported (yet).")}function cF(v,b,y,_){let x=cO(v,b,y);if(1===x.length){let v=x[0];return _?cg(v):v}return _?cg(x[1]):x[1]}function cI(v,b,y){var _=cO(v,b,y);if(2==_.length){let v=cg(_[1]);return[v,v]}return[cg(_[2]),cg(_[3])]}function cM(v,b,y){var _=cm(v,b,y.numValues);if(2==_.length){let v=cv(_[1]);return[v,v]}return[cv(_[2]),cv(_[3])]}function cR(v,b,y,_,x){return function(v,b,y,_){switch(b.logicalLevelTechnique1){case J.DELTA:if(b.logicalLevelTechnique2===J.RLE){if(!_)return function(v,b,y){let _=new BigInt64Array(y),x=0,w=0n;for(let y=0;y<b;y++){let k=Number(v[y]),A=cv(v[y+b]);for(let v=0;v<k;v++)w+=A,_[x++]=w}return _}(v,b.runs,b.numRleValues);v=c_(v,b.runs,b.numRleValues)}!function(v){v[0]=cv(v[0]);let b=v.length/4*4,y=1;if(b>=4)for(;y<b-4;y+=4){let b=v[y+1],_=v[y+2],x=v[y+3];v[y]=cv(v[y])+v[y-1],v[y+1]=cv(b)+v[y],v[y+2]=cv(_)+v[y+1],v[y+3]=cv(x)+v[y+2]}for(;y!=v.length;++y)v[y]=cv(v[y])+v[y-1]}(v);break;case J.RLE:var x;x=v,v=y?function(v,b,y){if(void 0===y){y=0;for(let _=0;_<b;_++)y+=Number(v[_])}let _=new BigInt64Array(y),x=0;for(let y=0;y<b;y++){let w=Number(v[y]),k=v[y+b];k=cv(k),_.fill(k,x,x+w),x+=w}return _}(x,b.runs,b.numRleValues):c_(x,b.runs,b.numRleValues);break;case J.NONE:y&&function(v){for(let b=0;b<v.length;b++)v[b]=cv(v[b])}(v);break;default:throw Error(`The specified Logical level technique is not supported: ${b.logicalLevelTechnique1}`)}return _?cE(v,_,0n):v}(cm(v,b,y.numValues),y,_,x)}function cD(v,b,y,_){let x=cm(v,b,y.numValues);if(1===x.length){let v=x[0];return _?cv(v):v}return _?cv(x[1]):x[1]}function cP(v,b,y,_){let x,w=v.logicalLevelTechnique1;if(w===J.RLE)return 1===v.runs?er.CONST:er.FLAT;if(w!==J.DELTA||v.logicalLevelTechnique2!==J.RLE)return 1===v.numValues?er.CONST:er.FLAT;let k=b instanceof cC?b.size():b;if(v.numRleValues!==k)return er.FLAT;if(1===v.runs)return er.SEQUENCE;if(2!==v.runs)return 1===v.numValues?er.CONST:er.FLAT;let A=_.get();if(v.physicalLevelTechnique===Q.VARINT)x=cf(y,_,4);else{let v=_.get();x=new Int32Array(y.buffer,y.byteOffset+v,4)}return _.set(A),2===x[2]&&2===x[3]?er.SEQUENCE:1===v.numValues?er.CONST:er.FLAT}class cL extends ca{getValueFromBuffer(v){return this.dataBuffer[v]}}class cN extends cc{constructor(v,b,y,_){super(v,BigInt64Array.of(b),y,_)}getValueFromBuffer(v){return this.dataBuffer[0]+BigInt(v)*this.delta}}class cz{_geometryOffsets;_partOffsets;_ringOffsets;constructor(v,b,y){this._geometryOffsets=v,this._partOffsets=b,this._ringOffsets=y}get geometryOffsets(){return this._geometryOffsets}get partOffsets(){return this._partOffsets}get ringOffsets(){return this._ringOffsets}}function cj(v,b,y){return{x:cB(v,b)-y,y:cB(v>>1,b)-y}}function cB(v,b){let y=0;for(let _=0;_<b;_++)y|=(v&1<<2*_)>>_;return y}(Y=eo||(eo={}))[Y.POINT=0]="POINT",Y[Y.LINESTRING=1]="LINESTRING",Y[Y.POLYGON=2]="POLYGON",Y[Y.MULTIPOINT=3]="MULTIPOINT",Y[Y.MULTILINESTRING=4]="MULTILINESTRING",Y[Y.MULTIPOLYGON=5]="MULTIPOLYGON",(Z=ea||(ea={}))[Z.POINT=0]="POINT",Z[Z.LINESTRING=1]="LINESTRING",Z[Z.POLYGON=2]="POLYGON",(X=es||(es={}))[X.MORTON=0]="MORTON",X[X.VEC_2=1]="VEC_2",X[X.VEC_3=2]="VEC_3";class c${createPoint(v){return[[v]]}createMultiPoint(v){return v.map(v=>[v])}createLineString(v){return[v]}createMultiLineString(v){return v}createPolygon(v,b){return[v].concat(b)}createMultiPolygon(v){return v.flat()}}function cU(v){let b=Array(v.numGeometries),y=1,_=1,x=1,w=0,k=new c$,A=0,C=0,E=v.mortonSettings,S=v.topologyVector,T=S.geometryOffsets,O=S.partOffsets,F=S.ringOffsets,I=v.vertexOffsets,M=v.containsPolygonGeometry(),R=v.vertexBuffer;for(let S=0;S<v.numGeometries;S++){let D=v.geometryType(S);if(D===eo.POINT){if(I&&0!==I.length)if(v.vertexBufferType===es.VEC_2){let v=2*I[C++],y=new z(R[v],R[v+1]);b[w++]=k.createPoint(y)}else{let v=cj(R[I[C++]],E.numBits,E.coordinateShift),y=new z(v.x,v.y);b[w++]=k.createPoint(y)}else{let v=new z(R[A++],R[A++]);b[w++]=k.createPoint(v)}T&&x++,O&&y++,F&&_++}else if(D===eo.MULTIPOINT){let v=T[x]-T[x-1];x++;let y=Array(v);if(I&&0!==I.length){for(let b=0;b<v;b++){let v=2*I[C++];y[b]=new z(R[v],R[v+1])}b[w++]=k.createMultiPoint(y)}else{for(let b=0;b<v;b++){let v=R[A++],_=R[A++];y[b]=new z(v,_)}b[w++]=k.createMultiPoint(y)}}else if(D===eo.LINESTRING){let S,D=0;M?(D=F[_]-F[_-1],_++):D=O[y]-O[y-1],y++,I&&0!==I.length?(S=v.vertexBufferType===es.VEC_2?cq(R,I,C,D,!1):cH(R,I,C,D,!1,E),C+=D):(S=cV(R,A,D,!1),A+=2*D),b[w++]=k.createLineString(S),T&&x++}else if(D===eo.POLYGON){let S=O[y]-O[y-1];y++;let M=Array(S-1),D=F[_]-F[_-1];if(_++,I&&0!==I.length){let y=v.vertexBufferType===es.VEC_2?cq(R,I,C,D,!0):cH(R,I,C,D,!0,E);C+=D;for(let b=0;b<M.length;b++)D=F[_]-F[_-1],_++,M[b]=v.vertexBufferType===es.VEC_2?cq(R,I,C,D,!0):cH(R,I,C,D,!0,E),C+=D;b[w++]=k.createPolygon(y,M)}else{let v=cV(R,A,D,!0);A+=2*D;for(let v=0;v<M.length;v++)D=F[_]-F[_-1],_++,M[v]=cV(R,A,D,!0),A+=2*D;b[w++]=k.createPolygon(v,M)}T&&x++}else if(D===eo.MULTILINESTRING){let S=T[x]-T[x-1];x++;let D=Array(S);if(I&&0!==I.length){for(let b=0;b<S;b++){let x=0;M?(x=F[_]-F[_-1],_++):x=O[y]-O[y-1],y++;let w=v.vertexBufferType===es.VEC_2?cq(R,I,C,x,!1):cH(R,I,C,x,!1,E);D[b]=w,C+=x}b[w++]=k.createMultiLineString(D)}else{for(let v=0;v<S;v++){let b=0;M?(b=F[_]-F[_-1],_++):b=O[y]-O[y-1],y++,D[v]=cV(R,A,b,!1),A+=2*b}b[w++]=k.createMultiLineString(D)}}else{if(D!==eo.MULTIPOLYGON)throw Error("The specified geometry type is currently not supported.");{let S=T[x]-T[x-1];x++;let M=Array(S),D=0;if(I&&0!==I.length){for(let b=0;b<S;b++){let x=O[y]-O[y-1];y++;let w=Array(x-1);D=F[_]-F[_-1],_++;let A=v.vertexBufferType===es.VEC_2?cq(R,I,C,D,!0):cH(R,I,C,D,!0,E);C+=D;for(let b=0;b<w.length;b++)D=F[_]-F[_-1],_++,w[b]=v.vertexBufferType===es.VEC_2?cq(R,I,C,D,!0):cH(R,I,C,D,!0,E),C+=D;M[b]=k.createPolygon(A,w)}b[w++]=k.createMultiPolygon(M)}else{for(let v=0;v<S;v++){let b=O[y]-O[y-1];y++;let x=Array(b-1);D=F[_]-F[_-1],_++;let w=cV(R,A,D,!0);A+=2*D;for(let v=0;v<x.length;v++){let b=F[_]-F[_-1];_++,x[v]=cV(R,A,b,!0),A+=2*b}M[v]=k.createPolygon(w,x)}b[w++]=k.createMultiPolygon(M)}}}}return b}function cV(v,b,y,_){let x=Array(_?y+1:y);for(let _=0;_<2*y;_+=2)x[_/2]=new z(v[b+_],v[b+_+1]);return _&&(x[x.length-1]=x[0]),x}function cq(v,b,y,_,x){let w=Array(x?_+1:_);for(let x=0;x<2*_;x+=2){let _=2*b[y+x/2];w[x/2]=new z(v[_],v[_+1])}return x&&(w[w.length-1]=w[0]),w}function cH(v,b,y,_,x,w){let k=Array(x?_+1:_);for(let x=0;x<_;x++){let _=cj(v[b[y+x]],w.numBits,w.coordinateShift);k[x]=new z(_.x,_.y)}return x&&(k[k.length-1]=k[0]),k}class cW{_vertexBufferType;_topologyVector;_vertexOffsets;_vertexBuffer;_mortonSettings;constructor(v,b,y,_,x){this._vertexBufferType=v,this._topologyVector=b,this._vertexOffsets=y,this._vertexBuffer=_,this._mortonSettings=x}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}*[Symbol.iterator](){let v=cU(this),b=0;for(;b<this.numGeometries;)yield{coordinates:v[b],type:this.geometryType(b)},b++}getSimpleEncodedVertex(v){let b=this.vertexOffsets?2*this.vertexOffsets[v]:2*v;return[this.vertexBuffer[b],this.vertexBuffer[b+1]]}getVertex(v){if(this.vertexOffsets&&this.mortonSettings){let b=cj(this.vertexBuffer[this.vertexOffsets[v]],this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[b.x,b.y]}let b=this.vertexOffsets?2*this.vertexOffsets[v]:2*v;return[this.vertexBuffer[b],this.vertexBuffer[b+1]]}getGeometries(){return cU(this)}get mortonSettings(){return this._mortonSettings}}class cG extends cW{_numGeometries;_geometryType;constructor(v,b,y,_,x,w,k){super(y,_,x,w,k),this._numGeometries=v,this._geometryType=b}geometryType(v){return this._geometryType}get numGeometries(){return this._numGeometries}containsPolygonGeometry(){return this._geometryType===eo.POLYGON||this._geometryType===eo.MULTIPOLYGON}containsSingleGeometryType(){return!0}}class cY extends cW{_geometryTypes;constructor(v,b,y,_,x,w){super(v,y,_,x,w),this._geometryTypes=b}geometryType(v){return this._geometryTypes[v]}get numGeometries(){return this._geometryTypes.length}containsPolygonGeometry(){for(let v=0;v<this.numGeometries;v++)if(this.geometryType(v)===eo.POLYGON||this.geometryType(v)===eo.MULTIPOLYGON)return!0;return!1}containsSingleGeometryType(){return!1}}class cZ{_triangleOffsets;_indexBuffer;_vertexBuffer;_topologyVector;constructor(v,b,y,_){this._triangleOffsets=v,this._indexBuffer=b,this._vertexBuffer=y,this._topologyVector=_}get triangleOffsets(){return this._triangleOffsets}get indexBuffer(){return this._indexBuffer}get vertexBuffer(){return this._vertexBuffer}get topologyVector(){return this._topologyVector}getGeometries(){if(!this._topologyVector)throw Error("Cannot convert GpuVector to coordinates without topology information");let v=Array(this.numGeometries),b=this._topologyVector,y=b.partOffsets,_=b.ringOffsets,x=b.geometryOffsets,w=0,k=1,A=1,C=1;for(let b=0;b<this.numGeometries;b++)switch(this.geometryType(b)){case eo.POLYGON:{let E=y[k]-y[k-1];k++;let S=[];for(let v=0;v<E;v++){let v=_[A]-_[A-1];A++;let b=[];for(let y=0;y<v;y++){let v=this._vertexBuffer[w++],y=this._vertexBuffer[w++];b.push(new z(v,y))}b.length>0&&b.push(b[0]),S.push(b)}v[b]=S,x&&C++}break;case eo.MULTIPOLYGON:{let E=x[C]-x[C-1];C++;let S=[];for(let v=0;v<E;v++){let v=y[k]-y[k-1];k++;for(let b=0;b<v;b++){let v=_[A]-_[A-1];A++;let b=[];for(let y=0;y<v;y++){let v=this._vertexBuffer[w++],y=this._vertexBuffer[w++];b.push(new z(v,y))}b.length>0&&b.push(b[0]),S.push(b)}}v[b]=S}}return v}[Symbol.iterator](){return null}}class cX extends cZ{_numGeometries;_geometryType;constructor(v,b,y,_,x,w){super(y,_,x,w),this._numGeometries=v,this._geometryType=b}geometryType(v){return this._geometryType}get numGeometries(){return this._numGeometries}containsSingleGeometryType(){return!0}}class cK extends cZ{_geometryTypes;constructor(v,b,y,_,x){super(b,y,_,x),this._geometryTypes=v}geometryType(v){return this._geometryTypes[v]}get numGeometries(){return this._geometryTypes.length}containsSingleGeometryType(){return!1}}function cJ(v,b,y){let _=new Uint32Array(v.length+1),x=0;_[0]=x;let w=0;for(let k=0;k<v.length;k++)x=_[k+1]=x+(v[k]>y?b[w++]:1);return _}function cQ(v,b,y,_){let x=new Uint32Array(b[b.length-1]+1),w=0;x[0]=w;let k=1,A=0;for(let C=0;C<v.length;C++){let E=v[C],S=b[C+1]-b[C];if(5===E||2===E||_&&(4===E||1===E))for(let v=0;v<S;v++)w=x[k++]=w+y[A++];else for(let v=0;v<S;v++)x[k++]=++w}return x}class c0 extends co{dataVector;constructor(v,b,y){super(v,b.getBuffer(),y),this.dataVector=b}getValueFromBuffer(v){return this.dataVector.get(v)}}class c1 extends ca{getValueFromBuffer(v){return this.dataBuffer[v]}}class c2 extends co{constructor(v,b,y){super(v,BigInt64Array.of(b),y)}getValueFromBuffer(v){return this.dataBuffer[0]}}function c5(v,b,y,_,x){let w=function(v,b,y,_){let x=new Uint8Array(b),w=0,k=_.get()+y;for(;w<b&&!(_.get()>=k);){let y=v[_.increment()];if(y<=127){let k=y+3,A=v[_.increment()],C=Math.min(w+k,b);x.fill(A,w,C),w=C}else{let k=256-y;for(let y=0;y<k&&w<b;y++)x[w++]=v[_.increment()]}}return _.set(k),x}(v,Math.ceil(b/8),y,_);return x?function(v,b,y){if(!y)return v;let _=y.size(),x=new cC(v,b),w=new cC(new Uint8Array(Math.ceil(_/8)),_),k=0;for(let v=0;v<_;v++){let b=!!y.get(v)&&x.get(k++);w.set(v,b)}return w.getBuffer()}(w,b,x):w}let c3=new TextDecoder;function c4(v,b,y){return y-b>=12?c3.decode(v.subarray(b,y)):function(v,b,y){let _="",x=b;for(;x<y;){let b=v[x],w,k,A,C=null,E=b>239?4:b>223?3:b>191?2:1;if(x+E>y)break;1===E?b<128&&(C=b):2===E?128==(192&(w=v[x+1]))&&(C=(31&b)<<6|63&w)<=127&&(C=null):3===E?(w=v[x+1],k=v[x+2],128==(192&w)&&128==(192&k)&&((C=(15&b)<<12|(63&w)<<6|63&k)<=2047||C>=55296&&C<=57343)&&(C=null)):4===E&&(w=v[x+1],k=v[x+2],A=v[x+3],128==(192&w)&&128==(192&k)&&128==(192&A)&&((C=(15&b)<<18|(63&w)<<12|(63&k)<<6|63&A)<=65535||C>=1114112)&&(C=null)),null===C?(C=65533,E=1):C>65535&&(C-=65536,_+=String.fromCharCode(C>>>10&1023|55296),C=56320|1023&C),_+=String.fromCharCode(C),x+=E}return _}(v,b,y)}class c6 extends co{offsetBuffer;constructor(v,b,y,_){super(v,y,_),this.offsetBuffer=b}}class c8 extends c6{textEncoder;constructor(v,b,y,_){super(v,b,y,_??b.length-1),this.textEncoder=new TextEncoder}getValueFromBuffer(v){return c4(this.dataBuffer,this.offsetBuffer[v],this.offsetBuffer[v+1])}}class c7 extends c6{indexBuffer;textEncoder;constructor(v,b,y,_,x){super(v,y,_,x??b.length),this.indexBuffer=b,this.indexBuffer=b,this.textEncoder=new TextEncoder}getValueFromBuffer(v){let b=this.indexBuffer[v];return c4(this.dataBuffer,this.offsetBuffer[b],this.offsetBuffer[b+1])}}class c9 extends c6{indexBuffer;symbolOffsetBuffer;symbolTableBuffer;textEncoder;symbolLengthBuffer;lengthBuffer;decodedDictionary;constructor(v,b,y,_,x,w,k){super(v,y,_,k),this.indexBuffer=b,this.symbolOffsetBuffer=x,this.symbolTableBuffer=w,this.textEncoder=new TextEncoder}getValueFromBuffer(v){null==this.decodedDictionary&&(null==this.symbolLengthBuffer&&(this.symbolLengthBuffer=this.offsetToLengthBuffer(this.symbolOffsetBuffer),this.lengthBuffer=this.offsetToLengthBuffer(this.offsetBuffer)),this.decodedDictionary=function(v,b,y){let _=[],x=Array(b.length).fill(0);for(let v=1;v<b.length;v++)x[v]=x[v-1]+b[v-1];for(let w=0;w<y.length;w++)if(255===y[w])_.push(y[++w]);else{let k=b[y[w]],A=x[y[w]];for(let b=0;b<k;b++)_.push(v[A+b])}return new Uint8Array(_)}(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer));let b=this.indexBuffer[v];return c4(this.decodedDictionary,this.offsetBuffer[b],this.offsetBuffer[b+1])}offsetToLengthBuffer(v){let b=new Uint32Array(v.length-1),y=v[0];for(let _=1;_<v.length;_++){let x=v[_];b[_-1]=x-y,y=x}return b}}function ue(v){return v instanceof cC}function ut(v){switch(v){case 0:case 1:case 2:case 3:{let b={};b.nullable=!!(1&v),b.columnScope=0;let y={};return y.physicalType=v>1?6:4,y.type="physicalType",b.scalarType=y,b.type="scalarType",b}case 4:{let v={nullable:!1,columnScope:0};return v.type="complexType",v.complexType={type:"physicalType",physicalType:0},v}case 30:{let v={nullable:!1,columnScope:0};return v.type="complexType",v.complexType={type:"physicalType",physicalType:1},v}default:let b=null;switch(v){case 10:case 11:b=0;break;case 12:case 13:b=1;break;case 14:case 15:b=2;break;case 16:case 17:b=3;break;case 18:case 19:b=4;break;case 20:case 21:b=5;break;case 22:case 23:b=6;break;case 24:case 25:b=7;break;case 26:case 27:b=8;break;case 28:case 29:b=9;break;default:return null}let y={};y.nullable=!!(1&v),y.columnScope=0;let _={type:"physicalType"};return _.physicalType=b,y.type="scalarType",y.scalarType=_,y}}let un=new TextDecoder;function ui(v,b){let y=cf(v,b,1)[0];if(0===y)return"";let _=b.get(),x=v.subarray(_,_+y);return b.add(y),un.decode(x)}class ur{constructor(v,b){var y;switch(this._featureData=v,this.properties=this._featureData.properties||{},null==(y=this._featureData.geometry)?void 0:y.type){case eo.POINT:case eo.MULTIPOINT:this.type=1;break;case eo.LINESTRING:case eo.MULTILINESTRING:this.type=2;break;case eo.POLYGON:case eo.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=b,this.id=Number(this._featureData.id)}loadGeometry(){let v=[];for(let b of this._featureData.geometry.coordinates){let y=[];for(let v of b)y.push(new z(v.x,v.y));v.push(y)}return v}}class uo{constructor(v){this.features=[],this.featureTable=v,this.name=v.name,this.extent=v.extent,this.version=2,this.features=v.getFeatures(),this.length=this.features.length}feature(v){return new ur(this.features[v],this.extent)}}class ua{constructor(v){this.layers={};const b=function(v,b=!0){let y=new cp(0),_=[];for(;y.get()<v.length;){let w=cf(v,y,1)[0]>>>0,k=y.get()+w;if(k>v.length)throw Error(`Block overruns tile: ${k} > ${v.length}`);if(1!=cf(v,y,1)[0]>>>0){y.set(k);continue}let A=function(v,b){let y={featureTables:[]},_={};_.name=ui(v,b);let x=cf(v,b,1)[0]>>>0,w=cf(v,b,1)[0]>>>0;_.columns=Array(w);for(let y=0;y<w;y++)_.columns[y]=function(v,b){let y=cf(v,b,1)[0]>>>0,_=ut(y);if(!_)throw Error(`Unsupported column type code ${y}. Supported: 0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT)`);if(y>=10?_.name=ui(v,b):y>=0&&y<=3?_.name="id":4===y&&(_.name="geometry"),30===y){let y=cf(v,b,1)[0]>>>0,x=_.complexType;x.children=Array(y);for(let _=0;_<y;_++)x.children[_]=function v(b,y){let _=cf(b,y,1)[0]>>>0;if(_<10||_>30)throw Error(`Unsupported field type code ${_}. Supported: 10-29(scalars), 30(STRUCT)`);let x=ut(_);if(_>=10&&(x.name=ui(b,y)),30===_){let _=cf(b,y,1)[0]>>>0;x.complexType.children=Array(_);for(let w=0;w<_;w++)x.complexType.children[w]=v(b,y)}return{name:x.name,nullable:x.nullable,scalarField:x.scalarType,complexField:x.complexType,type:"scalarType"===x.type?"scalarField":"complexField"}}(v,b)}return _}(v,b);return y.featureTables.push(_),[y,x]}(v,y),C=A[1],E=A[0].featureTables[0],S=null,T=null,O=[],F=0;for(let _ of E.columns){let w=_.name;if("id"===w){let x=null;if(_.nullable){let b=cA(v,y),_=y.get(),w=c5(v,b.numValues,b.byteLength,y);y.set(_+b.byteLength),x=new cC(w,b.numValues)}let k=cA(v,y);F=k.decompressedCount,S=function(v,b,y,_,x,w,k=!1){let A=b.scalarType.physicalType,C=cP(x,w,v,y);if(4===A)switch(C){case er.FLAT:return new cs(_,cS(v,y,x,!1),w);case er.SEQUENCE:{let b=cI(v,y,x);return new cu(_,b[0],b[1],x.numRleValues)}case er.CONST:return new cd(_,cF(v,y,x,!1),w)}else switch(C){case er.FLAT:if(k)return new cl(_,function(v,b,y){var _=function(v,b,y){let _=new Float64Array(y);for(let x=0;x<y;x++)_[x]=function(v,b){let y,_;return _=v[b.get()],b.increment(),y=127&_,_<128?y:(_=v[b.get()],b.increment(),y|=(127&_)<<7,_<128?y:(_=v[b.get()],b.increment(),y|=(127&_)<<14,_<128?y:(_=v[b.get()],b.increment(),y|=(127&_)<<21,_<128?y:function(v,b,y){let _,x;if(x=b[y.get()],y.increment(),_=(112&x)>>4,x<128||(x=b[y.get()],y.increment(),_|=(127&x)<<3,x<128)||(x=b[y.get()],y.increment(),_|=(127&x)<<10,x<128)||(x=b[y.get()],y.increment(),_|=(127&x)<<17,x<128)||(x=b[y.get()],y.increment(),_|=(127&x)<<24,x<128)||(x=b[y.get()],y.increment(),_|=(1&x)<<31,x<128))return 0x100000000*_+(v>>>0);throw Error("Expected varint not more than 10 bytes")}(y|=(15&(_=v[b.get()]))<<28,v,b))))}(v,b);return _}(v,b,y.numValues);switch(y.logicalLevelTechnique1){case J.DELTA:return y.logicalLevelTechnique2===J.RLE&&(_=cx(_,y.runs,y.numRleValues)),function(v){v[0]=cb(v[0]);let b=v.length/4*4,y=1;if(b>=4)for(;y<b-4;y+=4){let b=v[y+1],_=v[y+2],x=v[y+3];v[y]=cb(v[y])+v[y-1],v[y+1]=cb(b)+v[y],v[y+2]=cb(_)+v[y+1],v[y+3]=cb(x)+v[y+2]}for(;y!=v.length;++y)v[y]=cb(v[y])+v[y-1]}(_),_;case J.RLE:return cx(_,y.runs,y.numRleValues);case J.NONE:return _;default:throw Error(`The specified Logical level technique is not supported: ${y.logicalLevelTechnique1}`)}}(v,y,x),w);return new cL(_,cR(v,y,x,!1),w);case er.SEQUENCE:{let b=cM(v,y,x);return new cN(_,b[0],b[1],x.numRleValues)}case er.CONST:return new c2(_,cD(v,y,x,!1),w)}throw Error("Vector type not supported for id column.")}(v,_,y,w,k,x??F,b)}else if("geometry"===w){let b=cf(v,y,1)[0];if(0===F){let b=y.get();F=cA(v,y).decompressedCount,y.set(b)}T=function(v,b,y,_){var x,w,k,A,C,E,S,T,O,F,I,M,R,D;let P=cA(v,y),L=null,N=null,z=null,j=null;if(cP(P,_,v,y)===er.CONST){let T=cF(v,y,P,!1),O=null,F=null,I=null,M=null;for(let _=0;_<b-1;_++){let b=cA(v,y);switch(b.physicalStreamType){case ee.LENGTH:switch(b.logicalStreamType.lengthType){case ei.GEOMETRIES:O=cT(v,y,b);break;case ei.PARTS:F=cT(v,y,b);break;case ei.RINGS:I=cT(v,y,b);break;case ei.TRIANGLES:M=cT(v,y,b)}break;case ee.OFFSET:switch(b.logicalStreamType.offsetType){case en.VERTEX:L=cS(v,y,b,!1);break;case en.INDEX:j=cS(v,y,b,!1)}break;case ee.DATA:et.VERTEX===b.logicalStreamType.dictionaryType?N=cS(v,y,b,!0):(z={numBits:b.numBits,coordinateShift:b.coordinateShift},N=cS(v,y,b,!1))}}return null!==j?null!=O||null!=F?new cX(_,T,M,j,N,new cz(O,F,I)):new cX(_,T,M,j,N,void 0):null===z?(x=new cz(O,F,I),w=L,k=N,new cG(_,T,es.VEC_2,x,w,k)):(A=new cz(O,F,I),C=L,E=N,S=z,new cG(_,T,es.MORTON,A,C,E,S))}let B=cS(v,y,P,!1),U=null,V=null,q=null,H=null;for(let _=0;_<b-1;_++){let b=cA(v,y);switch(b.physicalStreamType){case ee.LENGTH:switch(b.logicalStreamType.lengthType){case ei.GEOMETRIES:U=cS(v,y,b,!1);break;case ei.PARTS:V=cS(v,y,b,!1);break;case ei.RINGS:q=cS(v,y,b,!1);break;case ei.TRIANGLES:H=cT(v,y,b)}break;case ee.OFFSET:switch(b.logicalStreamType.offsetType){case en.VERTEX:L=cS(v,y,b,!1);break;case en.INDEX:j=cS(v,y,b,!1)}break;case ee.DATA:et.VERTEX===b.logicalStreamType.dictionaryType?N=cS(v,y,b,!0):(z={numBits:b.numBits,coordinateShift:b.coordinateShift},N=cS(v,y,b,!1))}}let W=null,G=null,Y=null;return null!==U?(W=cJ(B,U,2),null!==V&&null!==q?(G=cQ(B,W,V,!1),Y=function(v,b,y,_){let x=new Uint32Array(y[y.length-1]+1),w=0;x[0]=w;let k=1,A=1,C=0;for(let E=0;E<v.length;E++){let S=v[E],T=b[E+1]-b[E];if(0!==S&&3!==S)for(let v=0;v<T;v++){let v=y[k]-y[k-1];k++;for(let b=0;b<v;b++)w=x[A++]=w+_[C++]}else for(let v=0;v<T;v++)x[A++]=++w,k++}return x}(B,W,G,q)):null!==V&&(G=function(v,b,y){let _=new Uint32Array(b[b.length-1]+1),x=0;_[0]=x;let w=1,k=0;for(let A=0;A<v.length;A++){let C=v[A],E=b[A+1]-b[A];if(4===C||1===C)for(let v=0;v<E;v++)x=_[w++]=x+y[k++];else for(let v=0;v<E;v++)_[w++]=++x}return _}(B,W,V))):null!==V&&null!==q?(G=cJ(B,V,1),Y=cQ(B,G,q,!0)):null!==V&&(G=cJ(B,V,0)),null!==j&&null===G?new cK(B,H,j,N,void 0):null!==j?new cK(B,H,j,N,new cz(W,G,Y)):null===z?(T=new cz(W,G,Y),O=L,F=N,new cY(es.VEC_2,B,T,O,F)):(I=new cz(W,G,Y),M=L,R=N,D=z,new cY(es.MORTON,B,I,M,R,D))}(v,b,y,F)}else{var x;let b=!function(v){if("id"===v.name)return!1;if("scalarType"===v.type){let b=v.scalarType;if("physicalType"===b.type)switch(b.physicalType){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:default:return!1;case 9:return!0}if("logicalType"===b.type)return!1}else if("complexType"===v.type){let b=v.complexType;if("physicalType"===b.type)switch(b.physicalType){case 0:case 1:return!0;default:return!1}}return console.warn("Unexpected column type in hasStreamCount",v),!1}(_)?1:cf(v,y,1)[0];if(0===b)continue;let w=(x=F,"scalarType"===_.type?function(v,b,y,_,x,w){var k,A;let C=null,E=0;if(0===v)return null;if(w.nullable){let v=cA(b,y);E=v.numValues;let _=y.get(),x=c5(b,E,v.byteLength,y);y.set(_+v.byteLength),C=new cC(x,v.numValues)}let S=C??_;switch(x.physicalType){case 4:case 3:return function(v,b,y,_,x){let w=cA(v,b),k=cP(w,x,v,b),A=3===_.physicalType;if(k===er.FLAT){let _=cS(v,b,w,A,0,ue(x)?x:void 0);return new cs(y.name,_,x)}if(k===er.SEQUENCE){let _=cI(v,b,w);return new cu(y.name,_[0],_[1],w.numRleValues)}{let _=cF(v,b,w,A);return new cd(y.name,_,x)}}(b,y,w,x,S);case 9:return function(v,b,y,_,x){var w,k,A,C,E,S,T,O,F,I;let M=null,R=null,D=null,P=null,L=null,N=null,z=null,j=null;for(let v=0;v<_;v++){let v=cA(b,y);if(0!==v.byteLength)switch(v.physicalStreamType){case ee.PRESENT:N=new cC(c5(b,v.numValues,v.byteLength,y),v.numValues);break;case ee.OFFSET:R=cS(b,y,v,!1,0,null!=x||null!=N?x??N:void 0);break;case ee.LENGTH:{let _=cT(b,y,v);ei.DICTIONARY===v.logicalStreamType.lengthType?M=_:ei.SYMBOL===v.logicalStreamType.lengthType?P=_:z=_;break}case ee.DATA:{let _=b.subarray(y.get(),y.get()+v.byteLength);y.add(v.byteLength);let x=v.logicalStreamType.dictionaryType;et.FSST===x?L=_:et.SINGLE===x||et.SHARED===x?D=_:et.NONE===x&&(j=_)}}}return w=L,k=R,A=M,C=D,E=P,S=x??N,(w?new c9(v,k,A,C,E,w,S):null)??(T=D,O=R,F=M,I=x??N,T?I?new c7(v,O,F,T,I):new c7(v,O,F,T):null)??function(v,b,y,_,x){if(!b||!y)return null;if(_)return x?new c7(v,_,b,y,x):new c7(v,_,b,y);if(x&&x.size()!==b.length-1){let _=new Int32Array(x.size()),w=0;for(let v=0;v<x.size();v++)_[v]=x.get(v)?w++:0;return new c7(v,_,b,y,x)}return x?new c8(v,b,y,x):new c8(v,b,y)}(v,z,j,R,x??N)}(w.name,b,y,w.nullable?v-1:v,C);case 0:let T,O,F,I,M,R;return O=(T=cA(b,y)).numValues,F=y.get(),I=ue(S)?S:void 0,M=c5(b,O,T.byteLength,y,I),y.set(F+T.byteLength),R=new cC(M,O),new c0(w.name,R,S);case 6:case 5:return function(v,b,y,_,x){let w=cA(v,b),k=cP(w,_,v,b),A=5===x.physicalType;if(k===er.FLAT){let x=cR(v,b,w,A,ue(_)?_:void 0);return new cL(y.name,x,_)}if(k===er.SEQUENCE){let _=cM(v,b,w);return new cN(y.name,_[0],_[1],w.numRleValues)}{let x=cD(v,b,w,A);return new c2(y.name,x,_)}}(b,y,w,S,x);case 7:let D,P,L,N,z,j;return N=cA(b,y),z=ue(S)?S:void 0,k=N.numValues,P=(D=y.get())+k*Float32Array.BYTES_PER_ELEMENT,L=new Float32Array(new Uint8Array(b.subarray(D,P)).buffer),y.set(P),j=z?cE(L,z,0):L,new c1(w.name,j,S);case 8:let B,U,V,q,H,W;return q=cA(b,y),H=ue(S)?S:void 0,A=q.numValues,U=(B=y.get())+A*Float64Array.BYTES_PER_ELEMENT,V=new Float64Array(new Uint8Array(b.subarray(B,U)).buffer),y.set(U),W=H?cE(V,H,0):V,new cl(w.name,W,S);default:throw Error(`The specified data type for the field is currently not supported: ${x}`)}}(b,v,y,x,_.scalarType,_):0===b?null:function(v,b,y,_){let x=null,w=null,k=null,A=null,C=!1;for(;!C;){let y=cA(v,b);switch(y.physicalStreamType){case ee.LENGTH:ei.DICTIONARY===y.logicalStreamType.lengthType?x=cT(v,b,y):k=cT(v,b,y);break;case ee.DATA:et.SINGLE===y.logicalStreamType.dictionaryType||et.SHARED===y.logicalStreamType.dictionaryType?(w=v.subarray(b.get(),b.get()+y.byteLength),C=!0):A=v.subarray(b.get(),b.get()+y.byteLength),b.add(y.byteLength)}}let E=y.complexType.children,S=[],T=0;for(let C of E){let E=cf(v,b,1)[0];if(0==E)continue;let O=C.name?`${y.name}${C.name}`:y.name;if(2!==E||"scalarField"!==C.type||9!==C.scalarField.physicalType)throw Error("Currently only optional string fields are implemented for a struct.");let F=cA(v,b),I=c5(v,F.numValues,F.byteLength,b),M=cA(v,b),R=cS(v,b,M,!1,0,M.decompressedCount!==_?new cC(I,F.numValues):void 0);S[T++]=A?new c9(O,R,x,w,k,A,new cC(I,F.numValues)):new c7(O,R,x,w,new cC(I,F.numValues))}return S}(v,y,_,x));if(w)if(Array.isArray(w))for(let v of w)O.push(v);else O.push(w)}}let I=new ch(E.name,T,S,O,C);_.push(I),y.set(k)}return _}(new Uint8Array(v));this.layers=b.reduce((v,b)=>Object.assign(Object.assign({},v),{[b.name]:new uo(b)}),{})}}class us{constructor(v,b){this.feature=v,this.type=v.type,this.properties=v.tags?v.tags:{},this.extent=b,"id"in v&&("string"==typeof v.id?this.id=parseInt(v.id,10):"number"!=typeof v.id||isNaN(v.id)||(this.id=v.id))}loadGeometry(){let v=[];for(let b of 1===this.feature.type?[this.feature.geometry]:this.feature.geometry){let y=[];for(let v of b)y.push(new z(v[0],v[1]));v.push(y)}return v}}let ul="_geojsonTileLayer";function uc(v,b){b.writeVarintField(15,v.version||1),b.writeStringField(1,v.name||""),b.writeVarintField(5,v.extent||4096);let y={keys:[],values:[],keycache:{},valuecache:{}};for(let _=0;_<v.length;_++)y.feature=v.feature(_),b.writeMessage(2,uu,y);for(let v of y.keys)b.writeStringField(3,v);for(let v of y.values)b.writeMessage(4,up,v)}function uu(v,b){if(!v.feature)return;let y=v.feature;void 0!==y.id&&b.writeVarintField(1,y.id),b.writeMessage(2,ud,v),b.writeVarintField(3,y.type),b.writeMessage(4,uh,y)}function ud(v,b){for(let y in v.feature?.properties){let _=v.feature.properties[y],x=v.keycache[y];if(null==_)continue;void 0===x&&(v.keys.push(y),x=v.keys.length-1,v.keycache[y]=x),b.writeVarint(x),"string"!=typeof _&&"boolean"!=typeof _&&"number"!=typeof _&&(_=JSON.stringify(_));let w=typeof _+":"+_,k=v.valuecache[w];void 0===k&&(v.values.push(_),k=v.values.length-1,v.valuecache[w]=k),b.writeVarint(k)}}function uh(v,b){let y=v.loadGeometry(),_=v.type,x=0,w=0;for(let k of y){let y=1;1===_&&(y=k.length),b.writeVarint((y<<3)+1);let A=3===_?k.length-1:k.length;for(let v=0;v<A;v++){1===v&&1!==_&&b.writeVarint((A-1<<3)+2);let y=k[v].x-x,C=k[v].y-w;b.writeVarint(y<<1^y>>31),b.writeVarint(C<<1^C>>31),x+=y,w+=C}3===v.type&&b.writeVarint(15)}}function up(v,b){let y=typeof v;"string"===y?b.writeStringField(1,v):"boolean"===y?b.writeBooleanField(7,v):"number"===y&&(v%1!=0?b.writeDoubleField(3,v):v<0?b.writeSVarintField(6,v):b.writeVarintField(5,v))}class uf{constructor(v,b){this.tileID=v,this.x=v.canonical.x,this.y=v.canonical.y,this.z=v.canonical.z,this.grid=new rL(8192,16,0),this.grid3D=new rL(8192,16,0),this.featureIndexArray=new oX,this.promoteId=b}insert(v,b,y,_,x,w){let k=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(y,_,x);let A=w?this.grid3D:this.grid;for(let v=0;v<b.length;v++){let y=b[v],_=[1/0,1/0,-1/0,-1/0];for(let v=0;v<y.length;v++){let b=y[v];_[0]=Math.min(_[0],b.x),_[1]=Math.min(_[1],b.y),_[2]=Math.max(_[2],b.x),_[3]=Math.max(_[3],b.y)}_[0]<8192&&_[1]<8192&&_[2]>=0&&_[3]>=0&&A.insert(k,_[0],_[1],_[2],_[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers="mlt"!==this.encoding?new sW(new lh(this.rawTileData)).layers:new ua(this.rawTileData).layers,this.sourceLayerCoder=new ci(this.vtLayers?Object.keys(this.vtLayers).sort():[ul])),this.vtLayers}query(v,b,y,_){let x;this.loadVTLayers();let w=v.params,k=8192/v.tileSize/v.scale,A=i2(w.filter,w.globalState),C=v.queryGeometry,E=v.queryPadding*k,S=cn.fromPoints(C),T=this.grid.query(S.minX-E,S.minY-E,S.maxX+E,S.maxY+E),O=cn.fromPoints(v.cameraQueryGeometry).expandBy(E);for(let b of this.grid3D.query(O.minX,O.minY,O.maxX,O.maxY,(b,y,_,x)=>(function(v,b,y,_,x){for(let w of v)if(b<=w.x&&y<=w.y&&_>=w.x&&x>=w.y)return!0;let w=[new z(b,y),new z(b,x),new z(_,x),new z(_,y)];if(v.length>2){for(let b of w)if(aV(v,b))return!0}for(let b=0;b<v.length-1;b++)if(function(v,b,y){let _=y[0],x=y[2];if(v.x<_.x&&b.x<_.x||v.x>x.x&&b.x>x.x||v.y<_.y&&b.y<_.y||v.y>x.y&&b.y>x.y)return!1;let w=eU(v,b,y[0]);return w!==eU(v,b,y[1])||w!==eU(v,b,y[2])||w!==eU(v,b,y[3])}(v[b],v[b+1],w))return!0;return!1})(v.cameraQueryGeometry,b-E,y-E,_+E,x+E)))T.push(b);T.sort(ug);let F={};for(let E=0;E<T.length;E++){let S=T[E];if(S===x)continue;x=S;let O=this.featureIndexArray.get(S),I=null;this.loadMatchingFeature(F,O.bucketIndex,O.sourceLayerIndex,O.featureIndex,A,w.layers,w.availableImages,b,y,_,(b,y,_)=>(I||(I=aR(b)),y.queryIntersectsFeature({queryGeometry:C,feature:b,featureState:_,geometry:I,zoom:this.z,transform:v.transform,pixelsToTileUnits:k,pixelPosMatrix:v.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:v.getElevation})))}return F}loadMatchingFeature(v,b,y,_,x,w,k,A,C,E,S){let T=this.bucketLayerIDs[b];if(w&&!T.some(v=>w.has(v)))return;let O=this.sourceLayerCoder.decode(y),F=this.vtLayers[O].feature(_);if(x.needGeometry){let v=aD(F,!0);if(!x.filter(new r0(this.tileID.overscaledZ),v,this.tileID.canonical))return}else if(!x.filter(new r0(this.tileID.overscaledZ),F))return;let I=this.getId(F,O);for(let b=0;b<T.length;b++){let y=T[b];if(w&&!w.has(y))continue;let x=A[y];if(!x)continue;let O={};I&&E&&(O=E.getState(x.sourceLayer||ul,I));let M=eP({},C[y]);M.paint=um(M.paint,x.paint,F,O,k),M.layout=um(M.layout,x.layout,F,O,k);let R=!S||S(F,x,O);if(!R)continue;let D=new cr(F,this.z,this.x,this.y,I);D.layer=M;let P=v[y];void 0===P&&(P=v[y]=[]),P.push({featureIndex:_,feature:D,intersectionZ:R})}}lookupSymbolFeatures(v,b,y,_,x,w,k,A){let C={};this.loadVTLayers();let E=i2(x.filterSpec,x.globalState);for(let x of v)this.loadMatchingFeature(C,y,_,x,E,w,k,A,b);return C}hasLayer(v){for(let b of this.bucketLayerIDs)for(let y of b)if(v===y)return!0;return!1}getId(v,b){var y;let _=v.id;return this.promoteId&&("boolean"==typeof(_=v.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[b]])&&(_=Number(_)),void 0===_&&(null==(y=v.properties)?void 0:y.cluster)&&this.promoteId&&(_=Number(v.properties.cluster_id))),_}}function um(v,b,y,_,x){return eN(v,(v,w)=>{let k=b instanceof oe?b.get(w):null;return k&&k.evaluate?k.evaluate(y,_,x):k})}function ug(v,b){return b-v}function uv(v,b,y,_,x){let w=[];for(let k=0;k<v.length;k++){let A,C=v[k];for(let v=0;v<C.length-1;v++){let k=C[v],E=C[v+1];k.x<b&&E.x<b||(k.x<b?k=new z(b,k.y+(b-k.x)/(E.x-k.x)*(E.y-k.y))._round():E.x<b&&(E=new z(b,k.y+(b-k.x)/(E.x-k.x)*(E.y-k.y))._round()),k.y<y&&E.y<y||(k.y<y?k=new z(k.x+(y-k.y)/(E.y-k.y)*(E.x-k.x),y)._round():E.y<y&&(E=new z(k.x+(y-k.y)/(E.y-k.y)*(E.x-k.x),y)._round()),k.x>=_&&E.x>=_||(k.x>=_?k=new z(_,k.y+(_-k.x)/(E.x-k.x)*(E.y-k.y))._round():E.x>=_&&(E=new z(_,k.y+(_-k.x)/(E.x-k.x)*(E.y-k.y))._round()),k.y>=x&&E.y>=x||(k.y>=x?k=new z(k.x+(x-k.y)/(E.y-k.y)*(E.x-k.x),x)._round():E.y>=x&&(E=new z(k.x+(x-k.y)/(E.y-k.y)*(E.x-k.x),x)._round()),A&&k.equals(A[A.length-1])||(A=[k],w.push(A)),A.push(E)))))}}return w}function ub(v,b,y,_,x){switch(b){case 1:let w=[];for(let b of v)for(let v of b){let b=0===x?v.x:v.y;b>=y&&b<=_&&w.push([v])}return w;case 2:return uy(v,y,_,x,!1);case 3:return uy(v,y,_,x,!0)}return[]}function uy(v,b,y,_,x){let w=[];for(let k of v){let v=function(v,b,y,_,x){let w=0===_?u_:ux,k=[],A=[];for(let C=0;C<v.length-1;C++){let E=v[C],S=v[C+1],T=0===_?E.x:E.y,O=0===_?S.x:S.y,F=!1;T<b?O>b&&k.push(w(E,S,b)):T>y?O<y&&k.push(w(E,S,y)):k.push(E),O<b&&T>=b&&(k.push(w(E,S,b)),F=!0),O>y&&T<=y&&(k.push(w(E,S,y)),F=!0),!x&&F&&(A.push(k),k=[])}let C=v.length-1,E=0===_?v[C].x:v[C].y;return E>=b&&E<=y&&k.push(v[C]),x&&k.length>0&&!k[0].equals(k[k.length-1])&&k.push(new z(k[0].x,k[0].y)),k.length>0&&A.push(k),A}(k,b,y,_,x);v.length>0&&w.push(...v)}return w}function u_(v,b,y){return new z(y,v.y+(y-v.x)/(b.x-v.x)*(b.y-v.y))}function ux(v,b,y){return new z(v.x+(y-v.y)/(b.y-v.y)*(b.x-v.x),y)}rz("FeatureIndex",uf,{omit:["rawTileData","sourceLayerCoder"]});class uw extends z{constructor(v,b,y,_){super(v,b),this.angle=y,void 0!==_&&(this.segment=_)}clone(){return new uw(this.x,this.y,this.angle,this.segment)}}function uk(v,b,y,_,x){if(void 0===b.segment||0===y)return!0;let w=b,k=b.segment+1,A=0;for(;A>-y/2;){if(--k<0)return!1;A-=v[k].dist(w),w=v[k]}A+=v[k].dist(v[k+1]),k++;let C=[],E=0;for(;A<y/2;){let b=v[k],y=v[k+1];if(!y)return!1;let w=v[k-1].angleTo(b)-b.angleTo(y);for(w=Math.abs((w+3*Math.PI)%(2*Math.PI)-Math.PI),C.push({distance:A,angleDelta:w}),E+=w;A-C[0].distance>_;)E-=C.shift().angleDelta;if(E>x)return!1;k++,A+=b.dist(y)}return!0}function uA(v){let b=0;for(let y=0;y<v.length-1;y++)b+=v[y].dist(v[y+1]);return b}function uC(v,b){return Math.max(v?v.right-v.left:0,b?b.right-b.left:0)}function uE(v,b,y,_){let x=[],w=v.image,k=w.pixelRatio,A=w.paddedRect.w-2,C=w.paddedRect.h-2,E={x1:v.left,y1:v.top,x2:v.right,y2:v.bottom},S=w.stretchX||[[0,A]],T=w.stretchY||[[0,C]],O=(v,b)=>v+b[1]-b[0],F=S.reduce(O,0),I=T.reduce(O,0),M=A-F,R=C-I,D=0,P=F,L=0,N=I,j=0,B=M,U=0,V=R;if(w.content&&_){let b=w.content,y=b[2]-b[0],_=b[3]-b[1];(w.textFitWidth||w.textFitHeight)&&(E=lM(v)),D=uS(S,0,b[0]),L=uS(T,0,b[1]),P=uS(S,b[0],b[2]),N=uS(T,b[1],b[3]),j=b[0]-D,U=b[1]-L,B=y-P,V=_-N}let q=E.x1,H=E.y1,W=E.x2-q,G=E.y2-H,Y=(v,_,x,A)=>{var C,E,S,T,O,M,R,Y,Z,X,K,J,Q,ee,et,en;let ei=(C=v.stretch-D,C/P*W+q),er=(E=v.fixed-j,S=B,T=v.stretch,E-S*T/F),eo=(O=_.stretch-L,O/N*G+H),ea=(M=_.fixed-U,R=V,Y=_.stretch,M-R*Y/I),es=(Z=x.stretch-D,Z/P*W+q),el=(X=x.fixed-j,K=B,J=x.stretch,X-K*J/F),ec=(Q=A.stretch-L,Q/N*G+H),eu=(ee=A.fixed-U,et=V,en=A.stretch,ee-et*en/I),ed=new z(ei,eo),eh=new z(es,eo),ep=new z(es,ec),ef=new z(ei,ec),em=new z(er/k,ea/k),eg=new z(el/k,eu/k),ev=b*Math.PI/180;if(ev){let v=Math.sin(ev),b=Math.cos(ev),y=[b,-v,v,b];ed._matMult(y),eh._matMult(y),ef._matMult(y),ep._matMult(y)}let eb=v.stretch+v.fixed,ey=_.stretch+_.fixed;return{tl:ed,tr:eh,bl:ef,br:ep,tex:{x:w.paddedRect.x+1+eb,y:w.paddedRect.y+1+ey,w:x.stretch+x.fixed-eb,h:A.stretch+A.fixed-ey},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:em,pixelOffsetBR:eg,minFontScaleX:B/k/W,minFontScaleY:V/k/G,isSDF:y}};if(_&&(w.stretchX||w.stretchY)){let v=uT(S,M,F),b=uT(T,R,I);for(let y=0;y<v.length-1;y++){let _=v[y],w=v[y+1];for(let v=0;v<b.length-1;v++)x.push(Y(_,b[v],w,b[v+1]))}}else x.push(Y({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:A+1},{fixed:0,stretch:C+1}));return x}function uS(v,b,y){let _=0;for(let x of v)_+=Math.max(b,Math.min(y,x[1]))-Math.max(b,Math.min(y,x[0]));return _}function uT(v,b,y){let _=[{fixed:-1,stretch:0}];for(let[b,y]of v){let v=_[_.length-1];_.push({fixed:b-v.stretch,stretch:v.stretch}),_.push({fixed:b-v.stretch,stretch:v.stretch+(y-b)})}return _.push({fixed:b+1,stretch:y}),_}rz("Anchor",uw);class uO{constructor(v,b,y,_,x,w,k,A,C,E){var S;if(this.boxStartIndex=v.length,C){let v=w.top,b=w.bottom;const y=w.collisionPadding;y&&(v-=y[1],b+=y[3]);let _=b-v;_>0&&(_=Math.max(10,_),this.circleDiameter=_)}else{const C=(null==(S=w.image)?void 0:S.content)&&(w.image.textFitWidth||w.image.textFitHeight)?lM(w):{x1:w.left,y1:w.top,x2:w.right,y2:w.bottom};C.y1=C.y1*k-A[0],C.y2=C.y2*k+A[2],C.x1=C.x1*k-A[3],C.x2=C.x2*k+A[1];const T=w.collisionPadding;if(T&&(C.x1-=T[0]*k,C.y1-=T[1]*k,C.x2+=T[2]*k,C.y2+=T[3]*k),E){const v=new z(C.x1,C.y1),b=new z(C.x2,C.y1),y=new z(C.x1,C.y2),_=new z(C.x2,C.y2),x=E*Math.PI/180;v._rotate(x),b._rotate(x),y._rotate(x),_._rotate(x),C.x1=Math.min(v.x,b.x,y.x,_.x),C.x2=Math.max(v.x,b.x,y.x,_.x),C.y1=Math.min(v.y,b.y,y.y,_.y),C.y2=Math.max(v.y,b.y,y.y,_.y)}v.emplaceBack(b.x,b.y,C.x1,C.y1,C.x2,C.y2,y,_,x)}this.boxEndIndex=v.length}}class uF{constructor(v=[],b=(v,b)=>v<b?-1:+(v>b)){if(this.data=v,this.length=this.data.length,this.compare=b,this.length>0)for(let v=(this.length>>1)-1;v>=0;v--)this._down(v)}push(v){this.data.push(v),this._up(this.length++)}pop(){if(0===this.length)return;let v=this.data[0],b=this.data.pop();return--this.length>0&&(this.data[0]=b,this._down(0)),v}peek(){return this.data[0]}_up(v){let{data:b,compare:y}=this,_=b[v];for(;v>0;){let x=v-1>>1,w=b[x];if(y(_,w)>=0)break;b[v]=w,v=x}b[v]=_}_down(v){let{data:b,compare:y}=this,_=this.length>>1,x=b[v];for(;v<_;){let _=1+(v<<1),w=_+1;if(w<this.length&&0>y(b[w],b[_])&&(_=w),y(b[_],x)>=0)break;b[v]=b[_],v=_}b[v]=x}}function uI(v,b){return b.max-v.max}function uM(v,b,y,_){this.p=new z(v,b),this.h=y,this.d=function(v,b){let y=!1,_=1/0;for(let x=0;x<b.length;x++){let w=b[x];for(let b=0,x=w.length,k=x-1;b<x;k=b++){let x=w[b],A=w[k];x.y>v.y!=A.y>v.y&&v.x<(A.x-x.x)*(v.y-x.y)/(A.y-x.y)+x.x&&(y=!y),_=Math.min(_,a$(v,x,A))}}return(y?1:-1)*Math.sqrt(_)}(this.p,_),this.max=this.d+this.h*Math.SQRT2}function uR(v,b){return 1/0!==b[1]?function(v,b,y){let _=0,x=0;switch(b=Math.abs(b),y=Math.abs(y),v){case"top-right":case"top-left":case"top":x=y-7;break;case"bottom-right":case"bottom-left":case"bottom":x=7-y}switch(v){case"top-right":case"bottom-right":case"right":_=-b;break;case"top-left":case"bottom-left":case"left":_=b}return[_,x]}(v,b[0],b[1]):function(v,b){let y=0,_=0;b<0&&(b=0);let x=b/Math.SQRT2;switch(v){case"top-right":case"top-left":_=x-7;break;case"bottom-right":case"bottom-left":_=7-x;break;case"bottom":_=7-b;break;case"top":_=b-7}switch(v){case"top-right":case"bottom-right":y=-x;break;case"top-left":case"bottom-left":y=x;break;case"left":y=b;break;case"right":y=-b}return[y,_]}(v,b[0])}function uD(v,b,y){var _;let x=v.layout,w=null==(_=x.get("text-variable-anchor-offset"))?void 0:_.evaluate(b,{},y);if(w){let v=w.values,b=[];for(let y=0;y<v.length;y+=2){let _=b[y]=v[y],x=v[y+1].map(v=>24*v);_.startsWith("top")?x[1]-=7:_.startsWith("bottom")&&(x[1]+=7),b[y+1]=x}return new na(b)}let k=x.get("text-variable-anchor");if(k){let _;_=void 0!==v._unevaluatedLayout.getValue("text-radial-offset")?[24*x.get("text-radial-offset").evaluate(b,{},y),1/0]:x.get("text-offset").evaluate(b,{},y).map(v=>24*v);let w=[];for(let v of k)w.push(v,uR(v,_));return new na(w)}return null}function uP(v){switch(v){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function uL(v,b,y,_,x,w,k,A,C,E,S,T,O,F,I){let M=function(v,b,y,_,x,w,k){let A=y.layout.get("text-rotate").evaluate(x,{})*Math.PI/180,C=[];for(let y of v.positionedLines)for(let x of y.positionedGlyphs){if(!x.rect)continue;let E=x.rect||{},S=4,T=!0,O=1,F=0,I=(_||k)&&x.vertical,M=x.metrics.advance*x.scale/2;if(k&&v.verticalizable&&(F=y.lineOffset/2-(x.imageName?-(24-x.metrics.width*x.scale)/2:(x.scale-1)*24)),x.imageName){let v=w[x.imageName];T=v.sdf,S=1/(O=v.pixelRatio)}let R=_?[x.x+M,x.y]:[0,0],D=_?[0,0]:[x.x+M+b[0],x.y+b[1]-F],P=[0,0];I&&(P=D,D=[0,0]);let L=x.metrics.isDoubleResolution?2:1,N=(x.metrics.left-S)*x.scale-M+D[0],j=(-x.metrics.top-S)*x.scale+D[1],B=N+E.w/L*x.scale/O,U=j+E.h/L*x.scale/O,V=new z(N,j),q=new z(B,j),H=new z(N,U),W=new z(B,U);if(I){let v=new z(-M,M- -17),b=-Math.PI/2,y=12-M,_=new z(22-y,-(x.imageName?y:0)),w=new z(...P);V._rotateAround(b,v)._add(_)._add(w),q._rotateAround(b,v)._add(_)._add(w),H._rotateAround(b,v)._add(_)._add(w),W._rotateAround(b,v)._add(_)._add(w)}if(A){let v=Math.sin(A),b=Math.cos(A),y=[b,-v,v,b];V._matMult(y),q._matMult(y),H._matMult(y),W._matMult(y)}let G=new z(0,0),Y=new z(0,0);C.push({tl:V,tr:q,bl:H,br:W,tex:E,writingMode:v.writingMode,glyphOffset:R,sectionIndex:x.sectionIndex,isSDF:T,pixelOffsetTL:G,pixelOffsetBR:Y,minFontScaleX:0,minFontScaleY:0})}return C}(y,A,x,w,k,_,v.allowVerticalPlacement),R=v.textSizeData,D=null;for(let y of("source"===R.kind?(D=[128*x.layout.get("text-size").evaluate(k,{})])[0]>32640&&e$(`${v.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`):"composite"===R.kind&&((D=[128*F.compositeTextSizes[0].evaluate(k,{},I),128*F.compositeTextSizes[1].evaluate(k,{},I)])[0]>32640||D[1]>32640)&&e$(`${v.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`),v.addSymbols(v.text,M,D,A,w,k,E,b,C.lineStartIndex,C.lineLength,O,I),S))T[y]=v.text.placedSymbolArray.length-1;return 4*M.length}function uN(v){for(let b in v)return v[b];return null}v.aP=void 0,(el=v.aP||(v.aP={}))[el.center=1]="center",el[el.left=2]="left",el[el.right=3]="right",el[el.top=4]="top",el[el.bottom=5]="bottom",el[el["top-left"]=6]="top-left",el[el["top-right"]=7]="top-right",el[el["bottom-left"]=8]="bottom-left",el[el["bottom-right"]=9]="bottom-right";let uz=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];function uj(v,b,y,_){uB(v,y,_),uB(b,2*y,2*_),uB(b,2*y+1,2*_+1)}function uB(v,b,y){let _=v[b];v[b]=v[y],v[y]=_}function u$(v,b,y,_){let x=v-y,w=b-_;return x*x+w*w}v.cI=void 0,(ec=v.cI||(v.cI={})).create="create",ec.load="load",ec.fullLoad="fullLoad";let uU=null,uV=[],uq=1e3/60,uH="loadTime",uW="fullLoadTime";v.$=ed,v.A=ep,v.B=rP,v.C=rC,v.D=ot,v.E=ti,v.F=function([v,b,y]){return b+=90,{x:v*Math.cos(b*=Math.PI/180)*Math.sin(y*=Math.PI/180),y:v*Math.sin(b)*Math.sin(y),z:v*Math.cos(y)}},v.G=nD,v.H=r0,v.I=lS,v.J=rM,v.K=function(v){if(null==eq){let b=v.navigator?v.navigator.userAgent:null;eq=!!v.safari||!(!b||!(/\b(iPad|iPhone|iPod)\b/.test(b)||b.match("Safari")&&!b.match("Chrome")))}return eq},v.L=class{constructor(v,b){this.target=v,this.mapId=b,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new lY(()=>this.process()),this.subscription=eY(this.target,"message",v=>this.receive(v),!1),this.globalScope=eV(self)?v:window}registerMessageHandler(v,b){this.messageHandlers[v]=b}unregisterMessageHandler(v){delete this.messageHandlers[v]}sendAsync(v,b){return new Promise((y,_)=>{let x=Math.round(1e18*Math.random()).toString(36).substring(0,10),w=b?eY(b.signal,"abort",()=>{null==w||w.unsubscribe(),delete this.resolveRejects[x];let b={id:x,type:"<cancel>",origin:location.origin,targetMapId:v.targetMapId,sourceMapId:this.mapId};this.target.postMessage(b)},lZ):null;this.resolveRejects[x]={resolve:v=>{null==w||w.unsubscribe(),y(v)},reject:v=>{null==w||w.unsubscribe(),_(v)}};let k=[],A=Object.assign(Object.assign({},v),{id:x,sourceMapId:this.mapId,origin:location.origin,data:rU(v.data,k)});this.target.postMessage(A,{transfer:k})})}receive(v){let b=v.data,y=b.id;if(!("file://"!==b.origin&&"file://"!==location.origin&&"resource://android"!==b.origin&&"resource://android"!==location.origin&&b.origin!==location.origin||b.targetMapId&&this.mapId!==b.targetMapId)){if("<cancel>"===b.type){delete this.tasks[y];let v=this.abortControllers[y];return delete this.abortControllers[y],void(v&&v.abort())}if(eV(self)||b.mustQueue)return this.tasks[y]=b,this.taskQueue.push(y),void this.invoker.trigger();this.processTask(y,b)}}process(){if(0===this.taskQueue.length)return;let v=this.taskQueue.shift(),b=this.tasks[v];delete this.tasks[v],this.taskQueue.length>0&&this.invoker.trigger(),b&&this.processTask(v,b)}processTask(v,b){return N(this,void 0,void 0,function*(){if("<response>"===b.type){let y=this.resolveRejects[v];if(delete this.resolveRejects[v],!y)return;return void(b.error?y.reject(rV(b.error)):y.resolve(rV(b.data)))}if(!this.messageHandlers[b.type])return void this.completeTask(v,Error(`Could not find a registered handler for ${b.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));let y=rV(b.data),_=new AbortController;this.abortControllers[v]=_;try{let x=yield this.messageHandlers[b.type](b.sourceMapId,y,_);this.completeTask(v,null,x)}catch(b){this.completeTask(v,b)}})}completeTask(v,b,y){let _=[];delete this.abortControllers[v];let x={id:v,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:b?rU(b):null,data:rU(y,_)};this.target.postMessage(x,{transfer:_})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},v.M=e3,v.N=function(){var v=new ep(16);return ep!=Float32Array&&(v[1]=0,v[2]=0,v[3]=0,v[4]=0,v[6]=0,v[7]=0,v[8]=0,v[9]=0,v[11]=0,v[12]=0,v[13]=0,v[14]=0),v[0]=1,v[5]=1,v[10]=1,v[15]=1,v},v.O=function(v,b,y){var _,x,w,k,A,C,E,S,T,O,F,I,M=y[0],R=y[1],D=y[2];return b===v?(v[12]=b[0]*M+b[4]*R+b[8]*D+b[12],v[13]=b[1]*M+b[5]*R+b[9]*D+b[13],v[14]=b[2]*M+b[6]*R+b[10]*D+b[14],v[15]=b[3]*M+b[7]*R+b[11]*D+b[15]):(x=b[1],w=b[2],k=b[3],A=b[4],C=b[5],E=b[6],S=b[7],T=b[8],O=b[9],F=b[10],I=b[11],v[0]=_=b[0],v[1]=x,v[2]=w,v[3]=k,v[4]=A,v[5]=C,v[6]=E,v[7]=S,v[8]=T,v[9]=O,v[10]=F,v[11]=I,v[12]=_*M+A*R+T*D+b[12],v[13]=x*M+C*R+O*D+b[13],v[14]=w*M+E*R+F*D+b[14],v[15]=k*M+S*R+I*D+b[15]),v},v.P=z,v.Q=function(v,b,y){var _=y[0],x=y[1],w=y[2];return v[0]=b[0]*_,v[1]=b[1]*_,v[2]=b[2]*_,v[3]=b[3]*_,v[4]=b[4]*x,v[5]=b[5]*x,v[6]=b[6]*x,v[7]=b[7]*x,v[8]=b[8]*w,v[9]=b[9]*w,v[10]=b[10]*w,v[11]=b[11]*w,v[12]=b[12],v[13]=b[13],v[14]=b[14],v[15]=b[15],v},v.R=a8,v.S=function(v,b,y){var _=b[0],x=b[1],w=b[2],k=b[3],A=b[4],C=b[5],E=b[6],S=b[7],T=b[8],O=b[9],F=b[10],I=b[11],M=b[12],R=b[13],D=b[14],P=b[15],L=y[0],N=y[1],z=y[2],j=y[3];return v[0]=L*_+N*A+z*T+j*M,v[1]=L*x+N*C+z*O+j*R,v[2]=L*w+N*E+z*F+j*D,v[3]=L*k+N*S+z*I+j*P,v[4]=(L=y[4])*_+(N=y[5])*A+(z=y[6])*T+(j=y[7])*M,v[5]=L*x+N*C+z*O+j*R,v[6]=L*w+N*E+z*F+j*D,v[7]=L*k+N*S+z*I+j*P,v[8]=(L=y[8])*_+(N=y[9])*A+(z=y[10])*T+(j=y[11])*M,v[9]=L*x+N*C+z*O+j*R,v[10]=L*w+N*E+z*F+j*D,v[11]=L*k+N*S+z*I+j*P,v[12]=(L=y[12])*_+(N=y[13])*A+(z=y[14])*T+(j=y[15])*M,v[13]=L*x+N*C+z*O+j*R,v[14]=L*w+N*E+z*F+j*D,v[15]=L*k+N*S+z*I+j*P,v},v.T=so,v.U=function(v,b){let y={};for(let _=0;_<b.length;_++){let x=b[_];x in v&&(y[x]=v[x])}return y},v.V=lX,v.W=eD,v.X=l0,v.Y=lQ,v.Z=e1,v._=N,v.a=e0,v.a$=e_,v.a0=eh,v.a1=eG,v.a2=l7,v.a3=l1,v.a4=l2,v.a5=8192,v.a6=function(v,b,y){let _;if(!v)return b||{};if(!b)return v||{};let x=ct(v),w=ct(b);for(let v of(w.removeAll&&(x.add.clear(),x.update.clear(),x.remove.clear(),w.remove.clear()),w.remove))x.add.delete(v),x.update.delete(v);for(let[v,b]of w.update){let y=x.update.get(v);y&&(w.update.set(v,function(v,b){let y={id:v.id};if(b.removeAllProperties&&(delete v.removeProperties,delete v.addOrUpdateProperties,delete b.removeProperties),b.removeProperties)for(let y of b.removeProperties){let b=v.addOrUpdateProperties.findIndex(v=>v.key===y);b>-1&&v.addOrUpdateProperties.splice(b,1)}return(v.removeAllProperties||b.removeAllProperties)&&(y.removeAllProperties=!0),(v.removeProperties||b.removeProperties)&&(y.removeProperties=[...v.removeProperties||[],...b.removeProperties||[]]),(v.addOrUpdateProperties||b.addOrUpdateProperties)&&(y.addOrUpdateProperties=[...v.addOrUpdateProperties||[],...b.addOrUpdateProperties||[]]),(v.newGeometry||b.newGeometry)&&(y.newGeometry=b.newGeometry||v.newGeometry),y}(y,b)),x.update.delete(v))}let k={};if((x.removeAll||w.removeAll)&&(k.removeAll=!0),k.remove=new Set([...x.remove,...w.remove]),k.add=new Map([...x.add,...w.add]),k.update=new Map([...x.update,...w.update]),k.remove.size&&k.add.size)for(let v of k.add.keys())k.remove.delete(v);return _={},k.removeAll&&(_.removeAll=k.removeAll),k.remove&&(_.remove=Array.from(k.remove)),k.add&&(_.add=Array.from(k.add.values())),k.update&&(_.update=Array.from(k.update.values())),_},v.a7=function(v,b){let y=new Map;if(null==v||null==v.type)return y;if("Feature"===v.type){let _=ce(v,b);if(null==_)return;return y.set(_,v),y}if("FeatureCollection"===v.type){let _=new Set;for(let x of v.features){let v=ce(x,b);if(null==v||_.has(v))return;_.add(v),y.set(v,x)}return y}},v.a8=function(v,b,y){var _,x;let w=[];if(b.removeAll)v.clear();else if(b.remove)for(let y of b.remove){let b=v.get(y);b&&(w.push(b.geometry),v.delete(y))}if(b.add)for(let _ of b.add){let b=ce(_,y);if(null==b)continue;let x=v.get(b);x&&w.push(x.geometry),w.push(_.geometry),v.set(b,_)}if(b.update)for(let y of b.update){let b=v.get(y.id);if(!b)continue;let k=!!y.newGeometry,A=y.removeAllProperties||(null==(_=y.removeProperties)?void 0:_.length)>0||(null==(x=y.addOrUpdateProperties)?void 0:x.length)>0;if(!k&&!A)continue;w.push(b.geometry);let C=Object.assign({},b);if(v.set(y.id,C),k&&(w.push(y.newGeometry),C.geometry=y.newGeometry),A){if(C.properties=y.removeAllProperties?{}:Object.assign({},C.properties||{}),y.removeProperties)for(let v of y.removeProperties)delete C.properties[v];if(y.addOrUpdateProperties)for(let{key:v,value:b}of y.addOrUpdateProperties)C.properties[v]=b}}return w},v.a9=l3,v.aA=function(v,{uSize:b,uSizeT:y},{lowerSize:_,upperSize:x}){return"source"===v.kind?_/128:"composite"===v.kind?nD.number(_/128,x/128,y):b},v.aB=function(v,b){var y=b[0],_=b[1],x=b[2],w=b[3],k=b[4],A=b[5],C=b[6],E=b[7],S=b[8],T=b[9],O=b[10],F=b[11],I=b[12],M=b[13],R=b[14],D=b[15],P=y*A-_*k,L=y*C-x*k,N=y*E-w*k,z=_*C-x*A,j=_*E-w*A,B=x*E-w*C,U=S*M-T*I,V=S*R-O*I,q=S*D-F*I,H=T*R-O*M,W=T*D-F*M,G=O*D-F*R,Y=P*G-L*W+N*H+z*q-j*V+B*U;return Y?(v[0]=(A*G-C*W+E*H)*(Y=1/Y),v[1]=(x*W-_*G-w*H)*Y,v[2]=(M*B-R*j+D*z)*Y,v[3]=(O*j-T*B-F*z)*Y,v[4]=(C*q-k*G-E*V)*Y,v[5]=(y*G-x*q+w*V)*Y,v[6]=(R*N-I*B-D*L)*Y,v[7]=(S*B-O*N+F*L)*Y,v[8]=(k*W-A*q+E*U)*Y,v[9]=(_*q-y*W-w*U)*Y,v[10]=(I*j-M*N+D*P)*Y,v[11]=(T*N-S*j-F*P)*Y,v[12]=(A*V-k*H-C*U)*Y,v[13]=(y*H-_*V+x*U)*Y,v[14]=(M*L-I*z-R*P)*Y,v[15]=(S*z-T*L+O*P)*Y,v):null},v.aC=eC,v.aD=function(v){var b=v[0],y=v[1];return Math.sqrt(b*b+y*y)},v.aE=function(v){return v[0]=0,v[1]=0,v},v.aF=function(v,b,y){return v[0]=b[0]*y,v[1]=b[1]*y,v},v.aG=lz,v.aH=ew,v.aI=function(v,b,y,_){let x=b.y-v.y,w=b.x-v.x,k=_.y-y.y,A=_.x-y.x,C=k*w-A*x;if(0===C)return null;let E=(A*(v.y-y.y)-k*(v.x-y.x))/C;return new z(v.x+E*w,v.y+E*x)},v.aJ=uv,v.aK=aL,v.aL=function(v){let b=1/0,y=1/0,_=-1/0,x=-1/0;for(let w of v)b=Math.min(b,w.x),y=Math.min(y,w.y),_=Math.max(_,w.x),x=Math.max(x,w.y);return[b,y,_,x]},v.aM=24,v.aN=eS,v.aO=function(v,b,y,_,x=!1){if(!y[0]&&!y[1])return[0,0];let w=x?"map"===_?-v.bearingInRadians:0:"viewport"===_?v.bearingInRadians:0;if(w){let v=Math.sin(w),b=Math.cos(w);y=[y[0]*b-y[1]*v,y[0]*v+y[1]*b]}return[x?y[0]:eS(b,y[0],v.zoom),x?y[1]:eS(b,y[1],v.zoom)]},v.aQ=lP,v.aR=uP,v.aS=lF,v.aT=class v{static from(b){if(!(b instanceof ArrayBuffer))throw Error("Data must be an instance of ArrayBuffer.");let[y,_]=new Uint8Array(b,0,2);if(219!==y)throw Error("Data does not appear to be in a KDBush format.");let x=_>>4;if(1!==x)throw Error(`Got v${x} data when expected v1.`);let w=uz[15&_];if(!w)throw Error("Unrecognized array type.");let[k]=new Uint16Array(b,2,1),[A]=new Uint32Array(b,4,1);return new v(A,k,w,b)}constructor(v,b=64,y=Float64Array,_){if(isNaN(v)||v<0)throw Error(`Unpexpected numItems value: ${v}.`);this.numItems=+v,this.nodeSize=Math.min(Math.max(+b,2),65535),this.ArrayType=y,this.IndexArrayType=v<65536?Uint16Array:Uint32Array;const x=uz.indexOf(this.ArrayType),w=2*v*this.ArrayType.BYTES_PER_ELEMENT,k=v*this.IndexArrayType.BYTES_PER_ELEMENT,A=(8-k%8)%8;if(x<0)throw Error(`Unexpected typed array class: ${y}.`);_&&_ instanceof ArrayBuffer?(this.data=_,this.ids=new this.IndexArrayType(this.data,8,v),this.coords=new this.ArrayType(this.data,8+k+A,2*v),this._pos=2*v,this._finished=!0):(this.data=new ArrayBuffer(8+w+k+A),this.ids=new this.IndexArrayType(this.data,8,v),this.coords=new this.ArrayType(this.data,8+k+A,2*v),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+x]),new Uint16Array(this.data,2,1)[0]=b,new Uint32Array(this.data,4,1)[0]=v)}add(v,b){let y=this._pos>>1;return this.ids[y]=y,this.coords[this._pos++]=v,this.coords[this._pos++]=b,y}finish(){let v=this._pos>>1;if(v!==this.numItems)throw Error(`Added ${v} items when expected ${this.numItems}.`);return function v(b,y,_,x,w,k){if(w-x<=_)return;let A=x+w>>1;(function v(b,y,_,x,w,k){for(;w>x;){if(w-x>600){let A=w-x+1,C=_-x+1,E=Math.log(A),S=.5*Math.exp(2*E/3),T=.5*Math.sqrt(E*S*(A-S)/A)*(C-A/2<0?-1:1);v(b,y,_,Math.max(x,Math.floor(_-C*S/A+T)),Math.min(w,Math.floor(_+(A-C)*S/A+T)),k)}let A=y[2*_+k],C=x,E=w;for(uj(b,y,x,_),y[2*w+k]>A&&uj(b,y,x,w);C<E;){for(uj(b,y,C,E),C++,E--;y[2*C+k]<A;)C++;for(;y[2*E+k]>A;)E--}y[2*x+k]===A?uj(b,y,x,E):uj(b,y,++E,w),E<=_&&(x=E+1),_<=E&&(w=E-1)}})(b,y,A,x,w,k),v(b,y,_,x,A-1,1-k),v(b,y,_,A+1,w,1-k)}(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(v,b,y,_){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:x,coords:w,nodeSize:k}=this,A=[0,x.length-1,0],C=[];for(;A.length;){let E=A.pop()||0,S=A.pop()||0,T=A.pop()||0;if(S-T<=k){for(let k=T;k<=S;k++){let A=w[2*k],E=w[2*k+1];A>=v&&A<=y&&E>=b&&E<=_&&C.push(x[k])}continue}let O=T+S>>1,F=w[2*O],I=w[2*O+1];F>=v&&F<=y&&I>=b&&I<=_&&C.push(x[O]),(0===E?v<=F:b<=I)&&(A.push(T),A.push(O-1),A.push(1-E)),(0===E?y>=F:_>=I)&&(A.push(O+1),A.push(S),A.push(1-E))}return C}within(v,b,y){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:_,coords:x,nodeSize:w}=this,k=[0,_.length-1,0],A=[],C=y*y;for(;k.length;){let E=k.pop()||0,S=k.pop()||0,T=k.pop()||0;if(S-T<=w){for(let y=T;y<=S;y++)u$(x[2*y],x[2*y+1],v,b)<=C&&A.push(_[y]);continue}let O=T+S>>1,F=x[2*O],I=x[2*O+1];u$(F,I,v,b)<=C&&A.push(_[O]),(0===E?v-y<=F:b-y<=I)&&(k.push(T),k.push(O-1),k.push(1-E)),(0===E?v+y>=F:b+y>=I)&&(k.push(O+1),k.push(S),k.push(1-E))}return A}},v.aU=op,v.aV=sO,v.aW=oK,v.aX=ai,v.aY=ae,v.aZ=eX,v.a_=l5,v.aa=cn,v.ab=25,v.ac=l6,v.ad=v=>{let b=window.document.createElement("video");return b.muted=!0,new Promise(y=>{for(let _ of(b.onloadstart=()=>{y(b)},v)){let v=window.document.createElement("source");e7(_)||(b.crossOrigin="Anonymous"),v.src=_,b.appendChild(v)}})},v.ae=tp,v.af=function(){return eL++},v.ag=oB,v.ah=l$,v.ai=ul,v.aj=i2,v.ak=aD,v.al=cr,v.am=function(v){let b={};if(v.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(v,y,_,x)=>{let w=_||x;return b[y]=!w||w.toLowerCase(),""}),b["max-age"]){let v=parseInt(b["max-age"],10);isNaN(v)?delete b["max-age"]:b["max-age"]=v}return b},v.an=eR,v.ao=85.051129,v.ap=eZ,v.aq=function(v){return Math.pow(2,v)},v.ar=em,v.as=function(v,b){return v/lJ(b)},v.at=function(v){return Math.log(v)/Math.LN2},v.au=function(v){var b=v[0],y=v[1];return b*b+y*y},v.av=function(v){if(!v.length)return new Set;let b=Math.max(...v.map(v=>v.canonical.z)),y=1/0,_=-1/0,x=1/0,w=-1/0,k=[];for(let A of v){let{x:v,y:C,z:E}=A.canonical,S=Math.pow(2,b-E),T=v*S,O=C*S;k.push({id:A,x:T,y:O}),T<y&&(y=T),T>_&&(_=T),O<x&&(x=O),O>w&&(w=O)}let A=new Set;for(let v of k)v.x!==y&&v.x!==_&&v.y!==x&&v.y!==w||A.add(v.id);return A},v.aw=function(v,b){let y=Math.abs(2*v.wrap)-(v.wrap<0),_=Math.abs(2*b.wrap)-(b.wrap<0);return v.overscaledZ-b.overscaledZ||_-y||b.canonical.y-v.canonical.y||b.canonical.x-v.canonical.x},v.ax=class{constructor(v,b){this.max=v,this.onRemove=b,this.reset()}reset(){for(let v in this.data)for(let b of this.data[v])b.timeout&&clearTimeout(b.timeout),this.onRemove(b.value);return this.data={},this.order=[],this}add(v,b,y){let _=v.wrapped().key;void 0===this.data[_]&&(this.data[_]=[]);let x={value:b,timeout:void 0};if(void 0!==y&&(x.timeout=setTimeout(()=>{this.remove(v,x)},y)),this.data[_].push(x),this.order.push(_),this.order.length>this.max){let v=this._getAndRemoveByKey(this.order[0]);v&&this.onRemove(v)}return this}has(v){return v.wrapped().key in this.data}getAndRemove(v){return this.has(v)?this._getAndRemoveByKey(v.wrapped().key):null}_getAndRemoveByKey(v){let b=this.data[v].shift();return b.timeout&&clearTimeout(b.timeout),0===this.data[v].length&&delete this.data[v],this.order.splice(this.order.indexOf(v),1),b.value}getByKey(v){let b=this.data[v];return b?b[0].value:null}get(v){return this.has(v)?this.data[v.wrapped().key][0].value:null}remove(v,b){if(!this.has(v))return this;let y=v.wrapped().key,_=void 0===b?0:this.data[y].indexOf(b),x=this.data[y][_];return this.data[y].splice(_,1),x.timeout&&clearTimeout(x.timeout),0===this.data[y].length&&delete this.data[y],this.onRemove(x.value),this.order.splice(this.order.indexOf(y),1),this}setMaxSize(v){for(this.max=v;this.order.length>this.max;){let v=this._getAndRemoveByKey(this.order[0]);v&&this.onRemove(v)}return this}filter(v){let b=[];for(let y in this.data)for(let _ of this.data[y])v(_.value)||b.push(_);for(let v of b)this.remove(v.value.tileID,v)}},v.ay=function(v,b){let y=0,_=0;if("constant"===v.kind)_=v.layoutSize;else if("source"!==v.kind){let{interpolationType:x,minZoom:w,maxZoom:k}=v,A=x?eR(nM.interpolationFactor(x,b,w,k),0,1):0;"camera"===v.kind?_=nD.number(v.minSize,v.maxSize,A):y=A}return{uSizeT:y,uSize:_}},v.b=eH,v.b$=a_,v.b0=ey,v.b1=function(v){var b=new ep(3);return b[0]=v[0],b[1]=v[1],b[2]=v[2],b},v.b2=function(v,b,y){return v[0]=b[0]-y[0],v[1]=b[1]-y[1],v[2]=b[2]-y[2],v},v.b3=function(v,b){var y=b[0],_=b[1],x=b[2],w=y*y+_*_+x*x;return w>0&&(w=1/Math.sqrt(w)),v[0]=b[0]*w,v[1]=b[1]*w,v[2]=b[2]*w,v},v.b4=ex,v.b5=function(v,b){return v[0]*b[0]+v[1]*b[1]+v[2]*b[2]},v.b6=function(v,b,y){return v[0]=b[0]*y[0],v[1]=b[1]*y[1],v[2]=b[2]*y[2],v[3]=b[3]*y[3],v},v.b7=ev,v.b8=function(v,b,y){let _=b[0]*y[0]+b[1]*y[1]+b[2]*y[2];return 0===_?null:(-(v[0]*y[0]+v[1]*y[1]+v[2]*y[2])-y[3])/_},v.b9=ev,v.bA=function(){return new Float64Array(3)},v.bB=eA,v.bC=function(v,b,y){var _=y[0],x=y[1],w=y[2],k=y[3],A=b[0],C=b[1],E=b[2],S=x*E-w*C,T=w*A-_*E,O=_*C-x*A;return v[0]=A+k*(S+=S)+x*(O+=O)-w*(T+=T),v[1]=C+k*T+w*S-_*O,v[2]=E+k*O+_*T-x*S,v},v.bD=function(v,b,y){var _,x,w,k,A,C,E;let S=(_=[v[0],v[1],v[2],b[0],b[1],b[2],y[0],y[1],y[2]])[0]*((E=_[8])*(w=_[4])-(k=_[5])*(C=_[7]))+_[1]*(-E*(x=_[3])+k*(A=_[6]))+_[2]*(C*x-w*A);if(0===S)return null;let T=ex([],[b[0],b[1],b[2]],[y[0],y[1],y[2]]),O=ex([],[y[0],y[1],y[2]],[v[0],v[1],v[2]]),F=ex([],[v[0],v[1],v[2]],[b[0],b[1],b[2]]),I=e_([],T,-v[3]);return ey(I,I,e_([],O,-b[3])),ey(I,I,e_([],F,-y[3])),e_(I,I,1/S),I},v.bE=6371008.8,v.bF=function(){return new Float64Array(4)},v.bG=function(v,b,y,_){var x=[],w=[];return x[0]=b[0]-y[0],x[1]=b[1]-y[1],x[2]=b[2]-y[2],w[0]=x[0]*Math.cos(_)-x[1]*Math.sin(_),w[1]=x[0]*Math.sin(_)+x[1]*Math.cos(_),w[2]=x[2],v[0]=w[0]+y[0],v[1]=w[1]+y[1],v[2]=w[2]+y[2],v},v.bH=function(v,b,y,_){var x=[],w=[];return x[0]=b[0]-y[0],x[1]=b[1]-y[1],x[2]=b[2]-y[2],w[0]=x[0],w[1]=x[1]*Math.cos(_)-x[2]*Math.sin(_),w[2]=x[1]*Math.sin(_)+x[2]*Math.cos(_),v[0]=w[0]+y[0],v[1]=w[1]+y[1],v[2]=w[2]+y[2],v},v.bI=function(v,b,y,_){var x=[],w=[];return x[0]=b[0]-y[0],x[1]=b[1]-y[1],x[2]=b[2]-y[2],w[0]=x[2]*Math.sin(_)+x[0]*Math.cos(_),w[1]=x[1],w[2]=x[2]*Math.cos(_)-x[0]*Math.sin(_),v[0]=w[0]+y[0],v[1]=w[1]+y[1],v[2]=w[2]+y[2],v},v.bJ=function(v,b,y){var _=Math.sin(y),x=Math.cos(y),w=b[0],k=b[1],A=b[2],C=b[3],E=b[8],S=b[9],T=b[10],O=b[11];return b!==v&&(v[4]=b[4],v[5]=b[5],v[6]=b[6],v[7]=b[7],v[12]=b[12],v[13]=b[13],v[14]=b[14],v[15]=b[15]),v[0]=w*x-E*_,v[1]=k*x-S*_,v[2]=A*x-T*_,v[3]=C*x-O*_,v[8]=w*_+E*x,v[9]=k*_+S*x,v[10]=A*_+T*x,v[11]=C*_+O*x,v},v.bK=function(v,b){let y=eT(v,360),_=eT(b,360),x=_-y,w=_>y?x-360:x+360;return Math.abs(x)<Math.abs(w)?x:w},v.bL=function(v){return v[0]=0,v[1]=0,v[2]=0,v},v.bM=function(v,b,y,_){let x=Math.sqrt(v*v+b*b),w=Math.sqrt(y*y+_*_);v/=x,b/=x;let k=Math.acos(v*(y/=w)+b*(_/=w));return-b*y+v*_>0?k:-k},v.bN=function(v,b){let y=eT(v,2*Math.PI),_=eT(b,2*Math.PI);return Math.min(Math.abs(y-_),Math.abs(y-_+2*Math.PI),Math.abs(y-_-2*Math.PI))},v.bO=function(){let v={},b=tr.$version;for(let y in tr.$root){let _=tr.$root[y];if(_.required){let x=null;null!=(x="version"===y?b:"array"===_.type?[]:{})&&(v[y]=x)}}return v},v.bP=e6,v.bQ=rq,v.bR=function v(b,y){if(Array.isArray(b)){if(!Array.isArray(y)||b.length!==y.length)return!1;for(let _=0;_<b.length;_++)if(!v(b[_],y[_]))return!1;return!0}if("object"==typeof b&&null!==b&&null!==y){if("object"!=typeof y||Object.keys(b).length!==Object.keys(y).length)return!1;for(let _ in b)if(!v(b[_],y[_]))return!1;return!0}return b===y},v.bS=function(v){v=v.slice();let b=Object.create(null);for(let y=0;y<v.length;y++)b[v[y].id]=v[y];for(let y=0;y<v.length;y++)"ref"in v[y]&&(v[y]=function(v,b){let y={};for(let b in v)"ref"!==b&&(y[b]=v[b]);return to.forEach(v=>{v in b&&(y[v]=b[v])}),y}(v[y],b[v[y].ref]));return v},v.bT=function(v,b){if("custom"===v.type)return new lG(v,b);switch(v.type){case"background":return new lW(v,b);case"circle":return new a0(v,b);case"color-relief":return new sl(v,b);case"fill":return new sN(v,b);case"fill-extrusion":return new sJ(v,b);case"heatmap":return new st(v,b);case"hillshade":return new si(v,b);case"line":return new s8(v,b);case"raster":return new oc(v,b);case"symbol":return new lq(v,b)}},v.bU=v=>"raster"===v.type,v.bV=ej,v.bW=function(v,b){if(!v)return[{command:"setStyle",args:[b]}];let y=[];try{if(!ta(v.version,b.version))return[{command:"setStyle",args:[b]}];ta(v.center,b.center)||y.push({command:"setCenter",args:[b.center]}),ta(v.state,b.state)||y.push({command:"setGlobalState",args:[b.state]}),ta(v.centerAltitude,b.centerAltitude)||y.push({command:"setCenterAltitude",args:[b.centerAltitude]}),ta(v.zoom,b.zoom)||y.push({command:"setZoom",args:[b.zoom]}),ta(v.bearing,b.bearing)||y.push({command:"setBearing",args:[b.bearing]}),ta(v.pitch,b.pitch)||y.push({command:"setPitch",args:[b.pitch]}),ta(v.roll,b.roll)||y.push({command:"setRoll",args:[b.roll]}),ta(v.sprite,b.sprite)||y.push({command:"setSprite",args:[b.sprite]}),ta(v.glyphs,b.glyphs)||y.push({command:"setGlyphs",args:[b.glyphs]}),ta(v.transition,b.transition)||y.push({command:"setTransition",args:[b.transition]}),ta(v.light,b.light)||y.push({command:"setLight",args:[b.light]}),ta(v.terrain,b.terrain)||y.push({command:"setTerrain",args:[b.terrain]}),ta(v.sky,b.sky)||y.push({command:"setSky",args:[b.sky]}),ta(v.projection,b.projection)||y.push({command:"setProjection",args:[b.projection]});let _={},x=[];!function(v,b,y,_){let x;for(x in b=b||{},v=v||{})Object.prototype.hasOwnProperty.call(v,x)&&(Object.prototype.hasOwnProperty.call(b,x)||tc(x,y,_));for(x in b){var w;Object.prototype.hasOwnProperty.call(b,x)&&(Object.prototype.hasOwnProperty.call(v,x)?ta(v[x],b[x])||("geojson"===v[x].type&&"geojson"===b[x].type&&function(v,b,y){let _;for(_ in v[y])if(Object.prototype.hasOwnProperty.call(v[y],_)&&"data"!==_&&!ta(v[y][_],b[y][_]))return!1;for(_ in b[y])if(Object.prototype.hasOwnProperty.call(b[y],_)&&"data"!==_&&!ta(v[y][_],b[y][_]))return!1;return!0}(v,b,x)?ts(y,{command:"setGeoJSONSourceData",args:[x,b[x].data]}):(w=b,tc(x,y,_),tl(x,w,y))):tl(x,b,y))}}(v.sources,b.sources,x,_);let w=[];v.layers&&v.layers.forEach(v=>{"source"in v&&_[v.source]?y.push({command:"removeLayer",args:[v.id]}):w.push(v)}),y=y.concat(x),function(v,b,y){let _,x,w,k,A;b=b||[];let C=(v=v||[]).map(td),E=b.map(td),S=v.reduce(th,{}),T=b.reduce(th,{}),O=C.slice(),F=Object.create(null);for(let v=0,b=0;v<C.length;v++)_=C[v],Object.prototype.hasOwnProperty.call(T,_)?b++:(ts(y,{command:"removeLayer",args:[_]}),O.splice(O.indexOf(_,b),1));for(let v=0,b=0;v<E.length;v++)_=E[E.length-1-v],O[O.length-1-v]!==_&&(Object.prototype.hasOwnProperty.call(S,_)?(ts(y,{command:"removeLayer",args:[_]}),O.splice(O.lastIndexOf(_,O.length-b),1)):b++,k=O[O.length-v],ts(y,{command:"addLayer",args:[T[_],k]}),O.splice(O.length-v,0,_),F[_]=!0);for(let v=0;v<E.length;v++)if(x=S[_=E[v]],w=T[_],!F[_]&&!ta(x,w))if(ta(x.source,w.source)&&ta(x["source-layer"],w["source-layer"])&&ta(x.type,w.type)){for(A in tu(x.layout,w.layout,y,_,null,"setLayoutProperty"),tu(x.paint,w.paint,y,_,null,"setPaintProperty"),ta(x.filter,w.filter)||ts(y,{command:"setFilter",args:[_,w.filter]}),ta(x.minzoom,w.minzoom)&&ta(x.maxzoom,w.maxzoom)||ts(y,{command:"setLayerZoomRange",args:[_,w.minzoom,w.maxzoom]}),x)Object.prototype.hasOwnProperty.call(x,A)&&"layout"!==A&&"paint"!==A&&"filter"!==A&&"metadata"!==A&&"minzoom"!==A&&"maxzoom"!==A&&(0===A.indexOf("paint.")?tu(x[A],w[A],y,_,A.slice(6),"setPaintProperty"):ta(x[A],w[A])||ts(y,{command:"setLayerProperty",args:[_,A,w[A]]}));for(A in w)Object.prototype.hasOwnProperty.call(w,A)&&!Object.prototype.hasOwnProperty.call(x,A)&&"layout"!==A&&"paint"!==A&&"filter"!==A&&"metadata"!==A&&"minzoom"!==A&&"maxzoom"!==A&&(0===A.indexOf("paint.")?tu(x[A],w[A],y,_,A.slice(6),"setPaintProperty"):ta(x[A],w[A])||ts(y,{command:"setLayerProperty",args:[_,A,w[A]]}))}else ts(y,{command:"removeLayer",args:[_]}),k=O[O.lastIndexOf(_)+1],ts(y,{command:"addLayer",args:[w,k]})}(w,b.layers,y)}catch(v){console.warn("Unable to compute style diff:",v),y=[{command:"setStyle",args:[b]}]}return y},v.bX=function(v){let b=[],y=v.id;return void 0===y&&b.push({message:`layers.${y}: missing required property "id"`}),void 0===v.render&&b.push({message:`layers.${y}: missing required method "render"`}),v.renderingMode&&"2d"!==v.renderingMode&&"3d"!==v.renderingMode&&b.push({message:`layers.${y}: property "renderingMode" must be either "2d" or "3d"`}),b},v.bY=eN,v.bZ=ez,v.b_=class extends av{constructor(v,b){super(v,b),this.current=0}set(v){this.current!==v&&(this.current=v,this.gl.uniform1i(this.location,v))}},v.ba=function(v,b,y){return v[0]=b[0]*y,v[1]=b[1]*y,v[2]=b[2]*y,v[3]=b[3]*y,v},v.bb=function(v,b){return v[0]*b[0]+v[1]*b[1]+v[2]*b[2]+v[3]},v.bc=l8,v.bd=l9,v.be=function(v,b,y,_,x){var w=1/Math.tan(b/2);if(v[0]=w/y,v[1]=0,v[2]=0,v[3]=0,v[4]=0,v[5]=w,v[6]=0,v[7]=0,v[8]=0,v[9]=0,v[11]=-1,v[12]=0,v[13]=0,v[15]=0,null!=x&&1/0!==x){var k=1/(_-x);v[10]=(x+_)*k,v[14]=2*x*_*k}else v[10]=-1,v[14]=-2*_;return v},v.bf=function(v){var b=new ep(16);return b[0]=v[0],b[1]=v[1],b[2]=v[2],b[3]=v[3],b[4]=v[4],b[5]=v[5],b[6]=v[6],b[7]=v[7],b[8]=v[8],b[9]=v[9],b[10]=v[10],b[11]=v[11],b[12]=v[12],b[13]=v[13],b[14]=v[14],b[15]=v[15],b},v.bg=function(v,b,y){var _=Math.sin(y),x=Math.cos(y),w=b[0],k=b[1],A=b[2],C=b[3],E=b[4],S=b[5],T=b[6],O=b[7];return b!==v&&(v[8]=b[8],v[9]=b[9],v[10]=b[10],v[11]=b[11],v[12]=b[12],v[13]=b[13],v[14]=b[14],v[15]=b[15]),v[0]=w*x+E*_,v[1]=k*x+S*_,v[2]=A*x+T*_,v[3]=C*x+O*_,v[4]=E*x-w*_,v[5]=S*x-k*_,v[6]=T*x-A*_,v[7]=O*x-C*_,v},v.bh=function(v,b,y){var _=Math.sin(y),x=Math.cos(y),w=b[4],k=b[5],A=b[6],C=b[7],E=b[8],S=b[9],T=b[10],O=b[11];return b!==v&&(v[0]=b[0],v[1]=b[1],v[2]=b[2],v[3]=b[3],v[12]=b[12],v[13]=b[13],v[14]=b[14],v[15]=b[15]),v[4]=w*x+E*_,v[5]=k*x+S*_,v[6]=A*x+T*_,v[7]=C*x+O*_,v[8]=E*x-w*_,v[9]=S*x-k*_,v[10]=T*x-A*_,v[11]=O*x-C*_,v},v.bi=function(){let v=new Float32Array(16);return em(v),v},v.bj=function(){let v=new Float64Array(16);return em(v),v},v.bk=function(){return new Float64Array(16)},v.bl=function(v,b,y){let _=new Float64Array(4);return eA(_,v,b-90,y),_},v.bm=function(v,b,y,_){var x,w,k,A,C,E=b[0],S=b[1],T=b[2],O=b[3],F=y[0],I=y[1],M=y[2],R=y[3];return(w=E*F+S*I+T*M+O*R)<0&&(w=-w,F=-F,I=-I,M=-M,R=-R),1-w>1e-6?(k=Math.sin(x=Math.acos(w)),A=Math.sin((1-_)*x)/k,C=Math.sin(_*x)/k):(A=1-_,C=_),v[0]=A*E+C*F,v[1]=A*S+C*I,v[2]=A*T+C*M,v[3]=A*O+C*R,v},v.bn=function(v){var b,y,_,x,w,k,A,C,E,S,T,O,F,I,M,R;let D,P,L=new Float64Array(9);C=(b=v[0])*(w=b+b),E=(y=v[1])*w,T=(_=v[2])*w,O=_*(k=y+y),I=(x=v[3])*w,M=x*k,R=x*(A=_+_),L[0]=1-(S=y*k)-(F=_*A),L[3]=E-R,L[6]=T+M,L[1]=E+R,L[4]=1-C-F,L[7]=O-I,L[2]=T-M,L[5]=O+I,L[8]=1-C-S;let N=eX(-Math.asin(eR(L[2],-1,1)));return .001>Math.hypot(L[5],L[8])?(D=0,P=-eX(Math.atan2(L[3],L[4]))):(D=eX(0===L[5]&&0===L[8]?0:Math.atan2(L[5],L[8])),P=eX(0===L[1]&&0===L[0]?0:Math.atan2(L[1],L[0]))),{roll:D,pitch:N+90,bearing:P}},v.bo=function(v,b){return v.roll==b.roll&&v.pitch==b.pitch&&v.bearing==b.bearing},v.bp=t6,v.bq=ab,v.br=-32768,v.bs=32767,v.bt=sT,v.bu=eO,v.bv=eF,v.bw=nl,v.bx=function(v,b,y,_,x){return eO(_,x,eR((v-b)/(y-b),0,1))},v.by=function(v,b,y,_){return v[0]=b[0]+y[0]*_,v[1]=b[1]+y[1]*_,v[2]=b[2]+y[2]*_,v},v.bz=eT,v.c=e2,v.c$=class{constructor(v){this.start=`${v}#start`,this.end=`${v}#end`,this.measure=v,performance.mark(this.start)}finish(){performance.mark(this.end);let v=performance.getEntriesByName(this.measure);return 0===v.length&&(performance.measure(this.measure,this.start,this.end),v=performance.getEntriesByName(this.measure),performance.clearMarks(this.start),performance.clearMarks(this.end),performance.clearMeasures(this.measure)),v}},v.c0=class extends av{constructor(v,b){super(v,b),this.current=ax}set(v){if(v[12]!==this.current[12]||v[0]!==this.current[0])return this.current=v,void this.gl.uniformMatrix4fv(this.location,!1,v);for(let b=1;b<16;b++)if(v[b]!==this.current[b]){this.current=v,this.gl.uniformMatrix4fv(this.location,!1,v);break}}},v.c1=ay,v.c2=class extends av{constructor(v,b){super(v,b),this.current=[0,0,0]}set(v){v[0]===this.current[0]&&v[1]===this.current[1]&&v[2]===this.current[2]||(this.current=v,this.gl.uniform3f(this.location,v[0],v[1],v[2]))}},v.c3=class extends av{constructor(v,b){super(v,b),this.current=[0,0]}set(v){v[0]===this.current[0]&&v[1]===this.current[1]||(this.current=v,this.gl.uniform2f(this.location,v[0],v[1]))}},v.c4=ef,v.c5=function(v,b){var y=Math.sin(b),_=Math.cos(b);return v[0]=_,v[1]=y,v[2]=0,v[3]=-y,v[4]=_,v[5]=0,v[6]=0,v[7]=0,v[8]=1,v},v.c6=function(v,b,y){var _=b[0],x=b[1],w=b[2];return v[0]=_*y[0]+x*y[3]+w*y[6],v[1]=_*y[1]+x*y[4]+w*y[7],v[2]=_*y[2]+x*y[5]+w*y[8],v},v.c7=function(v,b,y,_,x,w,k){var A=1/(b-y),C=1/(_-x),E=1/(w-k);return v[0]=-2*A,v[1]=0,v[2]=0,v[3]=0,v[4]=0,v[5]=-2*C,v[6]=0,v[7]=0,v[8]=0,v[9]=0,v[10]=2*E,v[11]=0,v[12]=(b+y)*A,v[13]=(x+_)*C,v[14]=(k+w)*E,v[15]=1,v},v.c8=class extends av{constructor(v,b){super(v,b),this.current=[]}set(v){if(v!=this.current){this.current=v;let b=new Float32Array(4*v.length);for(let y=0;y<v.length;y++)b[4*y]=v[y].r,b[4*y+1]=v[y].g,b[4*y+2]=v[y].b,b[4*y+3]=v[y].a;this.gl.uniform4fv(this.location,b)}}},v.c9=class extends av{constructor(v,b){super(v,b),this.current=[]}set(v){if(v!=this.current){this.current=v;let b=new Float32Array(v);this.gl.uniform1fv(this.location,b)}}},v.cA=function(v,b){var y;if(!eJ[b])return!1;let _=null==v?void 0:v.target,x=(null==(y=null==_?void 0:_.ownerDocument)?void 0:y.defaultView)||window;return v instanceof x.MouseEvent||v instanceof x.WheelEvent},v.cB=function(v,b){return eK[b]&&"touches"in v},v.cC=function(v){return eK[v]||eJ[v]},v.cD=function(v,b,y){var _=b[0],x=b[1];return v[0]=y[0]*_+y[4]*x+y[12],v[1]=y[1]*_+y[5]*x+y[13],v},v.cE=function(v,b){let{x:y,y:_}=l3.fromLngLat(b);return!(v<0||v>25||_<0||_>=1||y<0||y>=1)},v.cF=function(v,b){return v[0]=b[0],v[1]=0,v[2]=0,v[3]=0,v[4]=0,v[5]=b[1],v[6]=0,v[7]=0,v[8]=0,v[9]=0,v[10]=b[2],v[11]=0,v[12]=0,v[13]=0,v[14]=0,v[15]=1,v},v.cG=class extends og{},v.cH={mark(v){performance.mark(v)},recordStartOfFrameAt(v){null!=uU&&uV.push(v-uU),uU=v},resetRuntimeMetrics(){uU=null,uV=[]},clearInitializationMetrics(){for(let b in performance.clearMeasures(uH),performance.clearMeasures(uW),v.cI)performance.clearMarks(v.cI[b])},remove(){this.resetRuntimeMetrics(),this.clearInitializationMetrics()},getPerformanceMetrics(){performance.measure(uH,v.cI.create,v.cI.load),performance.measure(uW,v.cI.create,v.cI.fullLoad);let b=performance.getEntriesByName(uH)[0].duration,y=performance.getEntriesByName(uW)[0].duration,_=uV.length;return{loadTimeMs:b,fullLoadTimeMs:y,averageFramesPerSecond:1/(uV.reduce((v,b)=>v+b,0)/_/1e3),virtualDroppedFramesCount:uV.filter(v=>v>uq).reduce((v,b)=>v+(b-uq)/uq,0),totalFramesCount:_}}},v.cJ=e4,v.cK=function(v,b){e2.REGISTERED_PROTOCOLS[v]=b},v.cL=function(v){delete e2.REGISTERED_PROTOCOLS[v]},v.cM=function(v,b){let y={};for(let _=0;_<v.length;_++){let x=b&&b[v[_].id]||function(v){let b="";for(let y of to)b+=`/${function v(b){let y=typeof b;if("number"===y||"boolean"===y||"string"===y||null==b)return JSON.stringify(b);if(Array.isArray(b)){let y="[";for(let _ of b)y+=`${v(_)},`;return`${y}]`}let _=Object.keys(b).sort(),x="{";for(let y=0;y<_.length;y++)x+=`${JSON.stringify(_[y])}:${v(b[_[y]])},`;return`${x}}`}(v[y])}`;return b}(v[_]);b&&(b[v[_].id]=x);let w=y[x];w||(w=y[x]=[]),w.push(v[_])}let _=[];for(let v in y)_.push(y[v]);return _},v.cN=rz,v.cO=ci,v.cP=uf,v.cQ=lT,v.cR=function(b){var y;b.bucket.createArrays(),b.bucket.tilePixelRatio=8192/(512*b.bucket.overscaling),b.bucket.compareText={},b.bucket.iconsNeedLinear=!1;let _=b.bucket.layers[0],x=_.layout,w=_._unevaluatedLayout._values,k={layoutIconSize:w["icon-size"].possiblyEvaluate(new r0(b.bucket.zoom+1),b.canonical),layoutTextSize:w["text-size"].possiblyEvaluate(new r0(b.bucket.zoom+1),b.canonical),textMaxSize:w["text-size"].possiblyEvaluate(new r0(18))};if("composite"===b.bucket.textSizeData.kind){let{minZoom:v,maxZoom:y}=b.bucket.textSizeData;k.compositeTextSizes=[w["text-size"].possiblyEvaluate(new r0(v),b.canonical),w["text-size"].possiblyEvaluate(new r0(y),b.canonical)]}if("composite"===b.bucket.iconSizeData.kind){let{minZoom:v,maxZoom:y}=b.bucket.iconSizeData;k.compositeIconSizes=[w["icon-size"].possiblyEvaluate(new r0(v),b.canonical),w["icon-size"].possiblyEvaluate(new r0(y),b.canonical)]}let A=24*x.get("text-line-height"),C="viewport"!==x.get("text-rotation-alignment")&&"point"!==x.get("symbol-placement"),E=x.get("text-keep-upright"),S=x.get("text-size");for(let w of b.bucket.features){let T=x.get("text-font").evaluate(w,{},b.canonical).join(","),O=S.evaluate(w,{},b.canonical),F=k.layoutTextSize.evaluate(w,{},b.canonical),I=k.layoutIconSize.evaluate(w,{},b.canonical),M={horizontal:{},vertical:void 0},R=w.text,D,P=[0,0];if(R){let y=R.toString(),k=24*x.get("text-letter-spacing").evaluate(w,{},b.canonical),S=!function(v){for(let y of v){var b;if(b=y.codePointAt(0),rZ.test(String.fromCodePoint(b)))return!1}return!0}(y)?0:k,I=x.get("text-anchor").evaluate(w,{},b.canonical),D=uD(_,w,b.canonical);if(!D){let v=x.get("text-radial-offset").evaluate(w,{},b.canonical);P=v?uR(I,[24*v,1/0]):x.get("text-offset").evaluate(w,{},b.canonical).map(v=>24*v)}let L=C?"center":x.get("text-justify").evaluate(w,{},b.canonical),N="point"===x.get("symbol-placement")?24*x.get("text-max-width").evaluate(w,{},b.canonical):1/0,z=()=>{b.bucket.allowVerticalPlacement&&rG(y)&&(M.vertical=lO(R,b.glyphMap,b.glyphPositions,b.imagePositions,T,N,A,I,"left",S,P,v.az.vertical,!0,F,O))};if(!C&&D){let y=new Set;if("auto"===L)for(let v=0;v<D.values.length;v+=2)y.add(uP(D.values[v]));else y.add(L);let _=!1;for(let x of y)if(!M.horizontal[x])if(_)M.horizontal[x]=M.horizontal[0];else{let y=lO(R,b.glyphMap,b.glyphPositions,b.imagePositions,T,N,A,"center",x,S,P,v.az.horizontal,!1,F,O);y&&(M.horizontal[x]=y,_=1===y.positionedLines.length)}z()}else{"auto"===L&&(L=uP(I));let _=lO(R,b.glyphMap,b.glyphPositions,b.imagePositions,T,N,A,I,L,S,P,v.az.horizontal,!1,F,O);_&&(M.horizontal[L]=_),z(),rG(y)&&C&&E&&(M.vertical=lO(R,b.glyphMap,b.glyphPositions,b.imagePositions,T,N,A,I,L,S,P,v.az.vertical,!1,F,O))}}let L=!1;if(w.icon&&w.icon.name){let v=b.imageMap[w.icon.name];v&&(D=function(v,b,y){let{horizontalAlign:_,verticalAlign:x}=lF(y),w=b[0]-v.displaySize[0]*_,k=b[1]-v.displaySize[1]*x;return{image:v,top:k,bottom:k+v.displaySize[1],left:w,right:w+v.displaySize[0]}}(b.imagePositions[w.icon.name],x.get("icon-offset").evaluate(w,{},b.canonical),x.get("icon-anchor").evaluate(w,{},b.canonical)),L=!!v.sdf,void 0===b.bucket.sdfIcons?b.bucket.sdfIcons=L:b.bucket.sdfIcons!==L&&e$("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(v.pixelRatio!==b.bucket.pixelRatio||0!==x.get("icon-rotate").constantOr(1))&&(b.bucket.iconsNeedLinear=!0))}let N=uN(M.horizontal)||M.vertical;(y=b.bucket).iconsInText||(y.iconsInText=!!N&&N.iconsInText),(N||D)&&function(b,y,_,x,w,k,A,C,E,S,T,O){let F,I=k.textMaxSize.evaluate(y,{});void 0===I&&(I=A);let M=b.layers[0].layout,R=M.get("icon-offset").evaluate(y,{},T),D=uN(_.horizontal),P=A/24,L=b.tilePixelRatio*P,N=b.tilePixelRatio*I/24,j=b.tilePixelRatio*C,B=b.tilePixelRatio*M.get("symbol-spacing"),U=M.get("text-padding")*b.tilePixelRatio,V=function(v,b,y,_=1){let x=v.get("icon-padding").evaluate(b,{},y),w=x&&x.values;return[w[0]*_,w[1]*_,w[2]*_,w[3]*_]}(M,y,T,b.tilePixelRatio),q=M.get("text-max-angle")/180*Math.PI,H="viewport"!==M.get("text-rotation-alignment")&&"point"!==M.get("symbol-placement"),W="map"===M.get("icon-rotation-alignment")&&"point"!==M.get("symbol-placement"),G=M.get("symbol-placement"),Y=B/2,Z=M.get("icon-text-fit");x&&"none"!==Z&&(b.allowVerticalPlacement&&_.vertical&&(F=lR(x,_.vertical,Z,M.get("icon-text-fit-padding"),R,P)),D&&(x=lR(x,D,Z,M.get("icon-text-fit-padding"),R,P)));let X=T?O.line.getGranularityForZoomLevel(T.z):1,K=(C,O)=>{O.x<0||O.x>=8192||O.y<0||O.y>=8192||function(b,y,_,x,w,k,A,C,E,S,T,O,F,I,M,R,D,P,L,N,z,j,B,U,V){let q=b.addToLineVertexArray(y,_),H,W,G,Y,Z=0,X=0,K=0,J=0,Q=-1,ee=-1,et={},en=ap("");if(b.allowVerticalPlacement&&x.vertical){let v=C.layout.get("text-rotate").evaluate(z,{},U)+90;G=new uO(E,y,S,T,O,x.vertical,F,I,M,v),A&&(Y=new uO(E,y,S,T,O,A,D,P,M,v))}if(w){let _=C.layout.get("icon-rotate").evaluate(z,{}),x="none"!==C.layout.get("icon-text-fit"),k=uE(w,_,B,x),F=A?uE(A,_,B,x):void 0;W=new uO(E,y,S,T,O,w,D,P,!1,_),Z=4*k.length;let I=b.iconSizeData,M=null;"source"===I.kind?(M=[128*C.layout.get("icon-size").evaluate(z,{})])[0]>32640&&e$(`${b.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`):"composite"===I.kind&&((M=[128*j.compositeIconSizes[0].evaluate(z,{},U),128*j.compositeIconSizes[1].evaluate(z,{},U)])[0]>32640||M[1]>32640)&&e$(`${b.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`),b.addSymbols(b.icon,k,M,N,L,z,v.az.none,y,q.lineStartIndex,q.lineLength,-1,U),Q=b.icon.placedSymbolArray.length-1,F&&(X=4*F.length,b.addSymbols(b.icon,F,M,N,L,z,v.az.vertical,y,q.lineStartIndex,q.lineLength,-1,U),ee=b.icon.placedSymbolArray.length-1)}let ei=Object.keys(x.horizontal);for(let _ of ei){let w=x.horizontal[_];H||(en=ap(w.text),H=new uO(E,y,S,T,O,w,F,I,M,C.layout.get("text-rotate").evaluate(z,{},U)));let A=1===w.positionedLines.length;if(K+=uL(b,y,w,k,C,M,z,R,q,x.vertical?v.az.horizontal:v.az.horizontalOnly,A?ei:[_],et,Q,j,U),A)break}x.vertical&&(J+=uL(b,y,x.vertical,k,C,M,z,R,q,v.az.vertical,["vertical"],et,ee,j,U));let er=H?H.boxStartIndex:b.collisionBoxArray.length,eo=H?H.boxEndIndex:b.collisionBoxArray.length,ea=G?G.boxStartIndex:b.collisionBoxArray.length,es=G?G.boxEndIndex:b.collisionBoxArray.length,el=W?W.boxStartIndex:b.collisionBoxArray.length,ec=W?W.boxEndIndex:b.collisionBoxArray.length,eu=Y?Y.boxStartIndex:b.collisionBoxArray.length,ed=Y?Y.boxEndIndex:b.collisionBoxArray.length,eh=-1,ep=(v,b)=>v&&v.circleDiameter?Math.max(v.circleDiameter,b):b;eh=ep(H,-1),eh=ep(G,eh),eh=ep(W,eh);let ef=+((eh=ep(Y,eh))>-1);ef&&(eh*=V/24),b.glyphOffsetArray.length>=l$.MAX_GLYPHS&&e$("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==z.sortKey&&b.addToSortKeyRanges(b.symbolInstances.length,z.sortKey);let em=uD(C,z,U),[eg,ev]=function(b,y){let _=b.length,x=null==y?void 0:y.values;if((null==x?void 0:x.length)>0)for(let y=0;y<x.length;y+=2){let _=x[y+1];b.emplaceBack(v.aP[x[y]],_[0],_[1])}return[_,b.length]}(b.textAnchorOffsets,em);b.symbolInstances.emplaceBack(y.x,y.y,et.right>=0?et.right:-1,et.center>=0?et.center:-1,et.left>=0?et.left:-1,et.vertical||-1,Q,ee,en,er,eo,ea,es,el,ec,eu,ed,S,K,J,Z,X,ef,0,F,eh,eg,ev)}(b,O,C,_,x,w,F,b.layers[0],b.collisionBoxArray,y.index,y.sourceLayerIndex,b.index,L,[U,U,U,U],H,E,j,V,W,R,y,k,S,T,A)};if("line"===G)for(let v of uv(y.geometry,0,0,8192,8192)){let y=sM(v,X);for(let v of function(v,b,y,_,x,w,k){let A=_?.6*24*w:0,C=uC(_,x),E=C*w,S=0===v[0].x||8192===v[0].x||0===v[0].y||8192===v[0].y;return b-E<b/4&&(b=E+b/4),function v(b,y,_,x,w,k,A,C,E){let S=k/2,T=uA(b),O=0,F=y-_,I=[];for(let v=0;v<b.length-1;v++){let y=b[v],A=b[v+1],C=y.dist(A),M=A.angleTo(y);for(;F+_<O+C;){let R=((F+=_)-O)/C,D=nD.number(y.x,A.x,R),P=nD.number(y.y,A.y,R);if(D>=0&&D<E&&P>=0&&P<E&&F-S>=0&&F+S<=T){let y=new uw(D,P,M,v);y._round(),x&&!uk(b,y,k,x,w)||I.push(y)}}O+=C}return C||I.length||A||(I=v(b,O/2,_,x,w,k,A,!0,E)),I}(v,S?b/2*k%b:(C/2+48)*w*k%b,b,A,y,E,S,!1,8192)}(y,B,q,_.vertical||D,x,N,b.overscaling))D&&function(v,b,y,_){let x=v.compareText;if(b in x){let v=x[b];for(let b=v.length-1;b>=0;b--)if(_.dist(v[b])<y)return!0}else x[b]=[];return x[b].push(_),!1}(b,D.text,Y,v)||K(y,v)}else if("line-center"===G){for(let v of y.geometry)if(v.length>1){let b=sM(v,X),y=function(v,b,y,_,x){let w=y?.6*24*x:0,k=uC(y,_)*x,A=0,C=uA(v)/2;for(let y=0;y<v.length-1;y++){let _=v[y],x=v[y+1],E=_.dist(x);if(A+E>C){let S=(C-A)/E,T=new uw(nD.number(_.x,x.x,S),nD.number(_.y,x.y,S),x.angleTo(_),y);return T._round(),!w||uk(v,T,k,w,b)?T:void 0}A+=E}}(b,q,_.vertical||D,x,N);y&&K(b,y)}}else if("Polygon"===y.type)for(let v of n7(y.geometry,0)){let b=function(v,b=1,y=!1){let _=cn.fromPoints(v[0]),x=Math.min(_.width(),_.height()),w=x/2,k=new uF([],uI),{minX:A,minY:C,maxX:E,maxY:S}=_;if(0===x)return new z(A,C);for(let b=A;b<E;b+=x)for(let y=C;y<S;y+=x)k.push(new uM(b+w,y+w,w,v));let T=function(v){let b=0,y=0,_=0,x=v[0];for(let v=0,w=x.length,k=w-1;v<w;k=v++){let w=x[v],A=x[k],C=w.x*A.y-A.x*w.y;y+=(w.x+A.x)*C,_+=(w.y+A.y)*C,b+=3*C}return new uM(y/b,_/b,0,v)}(v),O=k.length;for(;k.length;){let _=k.pop();(_.d>T.d||!T.d)&&(T=_,y&&console.log("found best %d after %d probes",Math.round(1e4*_.d)/1e4,O)),_.max-T.d<=b||(w=_.h/2,k.push(new uM(_.p.x-w,_.p.y-w,w,v)),k.push(new uM(_.p.x+w,_.p.y-w,w,v)),k.push(new uM(_.p.x-w,_.p.y+w,w,v)),k.push(new uM(_.p.x+w,_.p.y+w,w,v)),O+=4)}return y&&(console.log(`num probes: ${O}`),console.log(`best distance: ${T.d}`)),T.p}(v,16);K(sM(v[0],X,!0),new uw(b.x,b.y,0))}else if("LineString"===y.type)for(let v of y.geometry){let b=sM(v,X);K(b,new uw(b[0].x,b[0].y,0))}else if("Point"===y.type)for(let v of y.geometry)for(let b of v)K([b],new uw(b.x,b.y,0))}(b.bucket,w,M,D,b.imageMap,k,F,I,P,L,b.canonical,b.subdivisionGranularity)}b.showCollisionBoxes&&b.bucket.generateCollisionDebugBuffers()},v.cS=sP,v.cT=sZ,v.cU=s3,v.cV=function(v){let b=new lh;return function(v,b){for(let y in v.layers)b.writeMessage(3,uc,v.layers[y])}(v,b),b.finish()},v.cW=function(v,b,y,_,x,w){let k=ub(v,b,y,x,0);return ub(k,b,_,w,1)},v.cX=class{constructor(v){this.maxEntries=v,this.map=new Map}get(v){let b=this.map.get(v);return void 0!==b&&(this.map.delete(v),this.map.set(v,b)),b}set(v,b){if(this.map.has(v))this.map.delete(v);else if(this.map.size>=this.maxEntries){let v=this.map.keys().next().value;this.map.delete(v)}this.map.set(v,b)}clear(){this.map.clear()}},v.cY=sW,v.cZ=lh,v.c_=ua,v.ca=class extends oT{},v.cb=ln,v.cc=class extends oF{},v.cd=se,v.ce=function(v){return v<=1?1:Math.pow(2,Math.ceil(Math.log(v)/Math.LN2))},v.cf=a9,v.cg=function(v,b,y){var _=b[0],x=b[1],w=b[2],k=y[3]*_+y[7]*x+y[11]*w+y[15];return v[0]=(y[0]*_+y[4]*x+y[8]*w+y[12])/(k=k||1),v[1]=(y[1]*_+y[5]*x+y[9]*w+y[13])/k,v[2]=(y[2]*_+y[6]*x+y[10]*w+y[14])/k,v},v.ch=class extends ov{},v.ci=class extends oN{},v.cj=function(v,b){return v[0]===b[0]&&v[1]===b[1]&&v[2]===b[2]&&v[3]===b[3]&&v[4]===b[4]&&v[5]===b[5]&&v[6]===b[6]&&v[7]===b[7]&&v[8]===b[8]&&v[9]===b[9]&&v[10]===b[10]&&v[11]===b[11]&&v[12]===b[12]&&v[13]===b[13]&&v[14]===b[14]&&v[15]===b[15]},v.ck=function(v,b){var y=v[0],_=v[1],x=v[2],w=v[3],k=v[4],A=v[5],C=v[6],E=v[7],S=v[8],T=v[9],O=v[10],F=v[11],I=v[12],M=v[13],R=v[14],D=v[15],P=b[0],L=b[1],N=b[2],z=b[3],j=b[4],B=b[5],U=b[6],V=b[7],q=b[8],H=b[9],W=b[10],G=b[11],Y=b[12],Z=b[13],X=b[14],K=b[15];return Math.abs(y-P)<=1e-6*Math.max(1,Math.abs(y),Math.abs(P))&&Math.abs(_-L)<=1e-6*Math.max(1,Math.abs(_),Math.abs(L))&&Math.abs(x-N)<=1e-6*Math.max(1,Math.abs(x),Math.abs(N))&&Math.abs(w-z)<=1e-6*Math.max(1,Math.abs(w),Math.abs(z))&&Math.abs(k-j)<=1e-6*Math.max(1,Math.abs(k),Math.abs(j))&&Math.abs(A-B)<=1e-6*Math.max(1,Math.abs(A),Math.abs(B))&&Math.abs(C-U)<=1e-6*Math.max(1,Math.abs(C),Math.abs(U))&&Math.abs(E-V)<=1e-6*Math.max(1,Math.abs(E),Math.abs(V))&&Math.abs(S-q)<=1e-6*Math.max(1,Math.abs(S),Math.abs(q))&&Math.abs(T-H)<=1e-6*Math.max(1,Math.abs(T),Math.abs(H))&&Math.abs(O-W)<=1e-6*Math.max(1,Math.abs(O),Math.abs(W))&&Math.abs(F-G)<=1e-6*Math.max(1,Math.abs(F),Math.abs(G))&&Math.abs(I-Y)<=1e-6*Math.max(1,Math.abs(I),Math.abs(Y))&&Math.abs(M-Z)<=1e-6*Math.max(1,Math.abs(M),Math.abs(Z))&&Math.abs(R-X)<=1e-6*Math.max(1,Math.abs(R),Math.abs(X))&&Math.abs(D-K)<=1e-6*Math.max(1,Math.abs(D),Math.abs(K))},v.cl=function(v,b){return v[0]=b[0],v[1]=b[1],v[2]=b[2],v[3]=b[3],v[4]=b[4],v[5]=b[5],v[6]=b[6],v[7]=b[7],v[8]=b[8],v[9]=b[9],v[10]=b[10],v[11]=b[11],v[12]=b[12],v[13]=b[13],v[14]=b[14],v[15]=b[15],v},v.cm=v=>"symbol"===v.type,v.cn=v=>"circle"===v.type,v.co=v=>"heatmap"===v.type,v.cp=v=>"line"===v.type,v.cq=v=>"fill"===v.type,v.cr=v=>"fill-extrusion"===v.type,v.cs=v=>"hillshade"===v.type,v.ct=v=>"color-relief"===v.type,v.cu=v=>"background"===v.type,v.cv=v=>"custom"===v.type,v.cw=eI,v.cx=function(v,b,y){if(b<=0)return v;let _=1/b;return void 0===y||1e-10>Math.abs(y)?Math.round(v*_)/_:(y>0?Math.ceil(v*_-1e-9):Math.floor(v*_+1e-10))/_},v.cy=function(v,b,y){let _=eE(b.x-y.x,b.y-y.y),x=eE(v.x-y.x,v.y-y.y);return eX(Math.atan2(_[0]*x[1]-_[1]*x[0],_[0]*x[0]+_[1]*x[1]))},v.cz=eM,v.d=e7,v.d0=function(v,b,y,w,k){return N(this,void 0,void 0,function*(){let A,C,E;if(eh())try{return yield eG(v,b,y,w,k)}catch(v){}return A=v.width,C=v.height,_&&x||(x=(_=new OffscreenCanvas(A,C)).getContext("2d",{willReadFrequently:!0})),_.width=A,_.height=C,x.drawImage(v,0,0,A,C),E=x.getImageData(b,y,w,k),x.clearRect(0,0,A,C),E.data})},v.d1=sa,v.d2=j,v.d3=class{constructor(v,b){this.layers={[ul]:this},this.name=ul,this.version=b?b.version:1,this.extent=b?b.extent:4096,this.length=v.length,this.features=v}feature(v){return new us(this.features[v],this.extent)}},v.d4=iG,v.d5=rQ,v.e=eP,v.f=v=>N(void 0,void 0,void 0,function*(){if(0===v.byteLength)return createImageBitmap(new ImageData(1,1));let b=new Blob([new Uint8Array(v)],{type:"image/png"});try{return createImageBitmap(b)}catch(v){throw Error(`Could not load image because of ${v.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),v.g=e5,v.h=v=>new Promise((b,y)=>{let _=new Image;_.onload=()=>{b(_),URL.revokeObjectURL(_.src),_.onload=null,window.requestAnimationFrame(()=>{_.src=eW})},_.onerror=()=>y(Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));let x=new Blob([new Uint8Array(v)],{type:"image/png"});_.src=v.byteLength?URL.createObjectURL(x):eW}),v.i=eV,v.j=(v,b)=>e8(eP(v,{type:"json"}),b),v.k=tn,v.l=tt,v.m=e8,v.n=(v,b)=>e8(eP(v,{type:"arrayBuffer"}),b),v.o=function(v){return new lh(v).readFields(lk,[])},v.p=lE,v.q=function(v){return/[\u02EA\u02EB\u1100-\u11FF\u2E80-\u2FDF\u3000-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(v))},v.r=a6,v.s=eY,v.t=oa,v.u=tr,v.v=tr,v.w=e$,v.x=r4,v.y=rI,v.z=r2}),y("worker",["./shared"],function(v){class b{constructor(v,b){this.keyCache={},v&&this.replace(v,b)}replace(v,b){this._layerConfigs={},this._layers={},this.update(v,[],b)}update(b,y,_){for(let y of b){this._layerConfigs[y.id]=y;let b=this._layers[y.id]=v.bT(y,_);b._featureFilter=v.aj(b.filter,_),this.keyCache[y.id]&&delete this.keyCache[y.id]}for(let v of y)delete this.keyCache[v],delete this._layerConfigs[v],delete this._layers[v];for(let b of(this.familiesBySource={},v.cM(Object.values(this._layerConfigs),this.keyCache))){let y=b.map(v=>this._layers[v.id]),_=y[0];if(_.isHidden())continue;let x=_.source||"",w=this.familiesBySource[x];w||(w=this.familiesBySource[x]={});let k=_.sourceLayer||v.ai,A=w[k];A||(A=w[k]=[]),A.push(y)}}}class y{constructor(b){const y={},_=[];for(const v in b){const x=b[v],w=y[v]={};for(const v in x){const b=x[+v];if(!b||0===b.bitmap.width||0===b.bitmap.height)continue;const y={x:0,y:0,w:b.bitmap.width+2,h:b.bitmap.height+2};_.push(y),w[v]={rect:y,metrics:b.metrics}}}const{w:x,h:w}=v.p(_),k=new v.r({width:x||1,height:w||1});for(const _ in b){const x=b[_];for(const b in x){const w=x[+b];if(!w||0===w.bitmap.width||0===w.bitmap.height)continue;const A=y[_][b].rect;v.r.copy(w.bitmap,k,{x:0,y:0},{x:A.x+1,y:A.y+1},w.bitmap)}}this.image=k,this.positions=y}}v.cN("GlyphAtlas",y);class _{constructor(b){this.tileID=new v.a2(b.tileID.overscaledZ,b.tileID.wrap,b.tileID.canonical.z,b.tileID.canonical.x,b.tileID.canonical.y),this.uid=b.uid,this.zoom=b.zoom,this.pixelRatio=b.pixelRatio,this.tileSize=b.tileSize,this.source=b.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=b.showCollisionBoxes,this.collectResourceTiming=!!b.collectResourceTiming,this.returnDependencies=!!b.returnDependencies,this.promoteId=b.promoteId,this.inFlightDependencies=[]}parse(b,_,w,k,A){return v._(this,void 0,void 0,function*(){this.status="parsing",this.data=b,this.collisionBoxArray=new v.ag;let C=new v.cO(Object.keys(b.layers).sort()),E=new v.cP(this.tileID,this.promoteId);E.bucketLayerIDs=[];let S={},T={featureIndex:E,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:w,subdivisionGranularity:A},O=_.familiesBySource[this.source];for(let y in O){let _=b.layers[y];if(!_)continue;1===_.version&&v.w(`Vector tile source "${this.source}" layer "${y}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let k=C.encode(y),A=[];for(let v=0;v<_.length;v++){let b=_.feature(v),x=E.getId(b,y);A.push({feature:b,id:x,index:v,sourceLayerIndex:k})}for(let b of O[y]){let y=b[0];y.source!==this.source&&v.w(`layer.source = ${y.source} does not equal this.source = ${this.source}`),y.isHidden(this.zoom,!0)||(x(b,this.zoom,w),(S[y.id]=y.createBucket({index:E.bucketLayerIDs.length,layers:b,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:k,sourceID:this.source})).populate(A,T,this.tileID.canonical),E.bucketLayerIDs.push(b.map(v=>v.id)))}}let F=v.bY(T.glyphDependencies,v=>Object.keys(v).map(Number));this.inFlightDependencies.forEach(v=>null==v?void 0:v.abort()),this.inFlightDependencies=[];let I=Promise.resolve({});if(Object.keys(F).length){let v=new AbortController;this.inFlightDependencies.push(v),I=k.sendAsync({type:"GG",data:{stacks:F,source:this.source,tileID:this.tileID,type:"glyphs"}},v)}let M=Object.keys(T.iconDependencies),R=Promise.resolve({});if(M.length){let v=new AbortController;this.inFlightDependencies.push(v),R=k.sendAsync({type:"GI",data:{icons:M,source:this.source,tileID:this.tileID,type:"icons"}},v)}let D=Object.keys(T.patternDependencies),P=Promise.resolve({});if(D.length){let v=new AbortController;this.inFlightDependencies.push(v),P=k.sendAsync({type:"GI",data:{icons:D,source:this.source,tileID:this.tileID,type:"patterns"}},v)}let L=T.dashDependencies,N=Promise.resolve({});if(Object.keys(L).length){let v=new AbortController;this.inFlightDependencies.push(v),N=k.sendAsync({type:"GDA",data:{dashes:L}},v)}let[z,j,B,U]=yield Promise.all([I,R,P,N]),V=new y(z),q=new v.cQ(j,B);for(let b in S){let y=S[b];y instanceof v.ah?(x(y.layers,this.zoom,w),v.cR({bucket:y,glyphMap:z,glyphPositions:V.positions,imageMap:j,imagePositions:q.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical,subdivisionGranularity:T.subdivisionGranularity})):y.hasDependencies&&(y instanceof v.cS||y instanceof v.cT||y instanceof v.cU)&&(x(y.layers,this.zoom,w),y.addFeatures(T,this.tileID.canonical,q.patternPositions,U))}return this.status="done",{buckets:Object.values(S).filter(v=>!v.isEmpty()),featureIndex:E,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:V.image,imageAtlas:q,dashPositions:U,glyphMap:this.returnDependencies?z:null,iconMap:this.returnDependencies?j:null,glyphPositions:this.returnDependencies?V.positions:null}})}}function x(b,y,_){let x=new v.H(y);for(let v of b)v.recalculate(x,_)}class w{constructor(){this.loading={},this.loaded={},this.parsing={}}startLoading(v,b){this.loading[v]=b}finishLoading(v){delete this.loading[v]}abort(v){let b=this.loading[v];(null==b?void 0:b.abort)&&(b.abort.abort(),delete this.loading[v])}setParsing(v,b){this.parsing[v]=b}consumeParsing(v){let b=this.parsing[v];if(b)return delete this.parsing[v],b}clearParsing(v){delete this.parsing[v]}markLoaded(v,b){this.loaded[v]=b}getLoaded(v){let b=this.loaded[v];if(b)return b}removeLoaded(v){delete this.loaded[v]}clearLoaded(){this.loaded={}}}class k{constructor(v,b,y,_,x){this.type=v,this.properties=y||{},this.extent=x,this.pointsArray=b,this.id=_}loadGeometry(){return this.pointsArray.map(b=>b.map(b=>new v.P(b.x,b.y)))}}class A{constructor(v,b,y){this.version=2,this._myFeatures=v,this.name=b,this.length=v.length,this.extent=y}feature(v){return this._myFeatures[v]}}class C{constructor(){this.layers={}}addLayer(v){this.layers[v.name]=v}}function E(b){let y=v.cV(b);return 0===y.byteOffset&&y.byteLength===y.buffer.byteLength||(y=new Uint8Array(y)),{vectorTile:b,rawData:y.buffer}}class S{constructor(b,y,_){this.actor=b,this.layerIndex=y,this.availableImages=_,this.tileState=new w,this.overzoomedTileResultCache=new v.cX(1e3)}loadVectorTile(b,y){return v._(this,void 0,void 0,function*(){let _=yield v.n(b.request,y);try{return{vectorTile:"mlt"!==b.encoding?new v.cY(new v.cZ(_.data)):new v.c_(_.data),rawData:_.data,cacheControl:_.cacheControl,expires:_.expires}}catch(x){let v=new Uint8Array(_.data),y=`Unable to parse the tile at ${b.request.url}, `;throw Error(y+=31===v[0]&&139===v[1]?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${x.message}`)}})}loadTile(b){return v._(this,void 0,void 0,function*(){let{uid:v,overzoomParameters:y}=b;y&&(b.request=y.overzoomRequest);let x=this._startRequestTiming(b),w=new _(b);this.tileState.startLoading(v,w);let k=new AbortController;w.abort=k;try{let _=yield this.loadVectorTile(b,k);if(this.tileState.finishLoading(v),!_)return null;let{vectorTile:A,rawData:C}=_;y&&({vectorTile:A,rawData:C}=this._getOverzoomTile(b,_.vectorTile));let E=this._getExpiryData(_),S=this._finishRequestTiming(x);w.vectorTile=A,this.tileState.markLoaded(v,w);let T={rawData:C,cacheControl:E,resourceTiming:S};this.tileState.setParsing(v,T);try{return yield this._parseWorkerTile(w,b,T)}finally{this.tileState.clearParsing(v)}}catch(b){throw this.tileState.finishLoading(v),w.status="done",this.tileState.markLoaded(v,w),b}})}_parseWorkerTile(b,y,_){return v._(this,void 0,void 0,function*(){let x=yield b.parse(b.vectorTile,this.layerIndex,this.availableImages,this.actor,y.subdivisionGranularity);if(_){let{rawData:b,cacheControl:w,resourceTiming:k}=_;x=v.e({rawTileData:b.slice(0),encoding:y.encoding},x,w,k)}return x})}_getExpiryData(v){let{expires:b,cacheControl:y}=v,_={};return b&&(_.expires=b),y&&(_.cacheControl=y),_}_startRequestTiming(b){var y;if(null==(y=b.request)?void 0:y.collectResourceTiming)return new v.c$(b.request.url)}_finishRequestTiming(v){let b=null==v?void 0:v.finish();return b?{resourceTiming:JSON.parse(JSON.stringify(b))}:{}}_getOverzoomTile(b,y){let{tileID:_,source:x,overzoomParameters:w}=b,{maxZoomTileID:S}=w,T=`${S.key}_${_.key}`,O=this.overzoomedTileResultCache.get(T);if(O)return O;let F=new C,I=this.layerIndex.familiesBySource[x];for(let b in I){let x=y.layers[b];if(!x)continue;let w=function(b,y,_){let{extent:x}=b,w=Math.pow(2,_.z-y.z),C=(_.x-y.x*w)*x,E=(_.y-y.y*w)*x,S=[];for(let y=0;y<b.length;y++){let _=b.feature(y),A=_.loadGeometry();for(let v of A)for(let b of v)b.x=b.x*w-C,b.y=b.y*w-E;0!==(A=v.cW(A,_.type,-128,-128,x+128,x+128)).length&&S.push(new k(_.type,A,_.properties,_.id,x))}return new A(S,b.name,x)}(x,S,_.canonical);w.length>0&&F.addLayer(w)}let M=E(F);return this.overzoomedTileResultCache.set(T,M),M}reloadTile(b){return v._(this,void 0,void 0,function*(){let v=b.uid,y=this.tileState.getLoaded(v);if(!y)throw Error("Should not be trying to reload a tile that was never loaded or has been removed");if(y.showCollisionBoxes=b.showCollisionBoxes,"parsing"===y.status){let _=this.tileState.consumeParsing(v);return yield this._parseWorkerTile(y,b,_)}if("done"===y.status&&y.vectorTile)return yield this._parseWorkerTile(y,b)})}abortTile(b){return v._(this,void 0,void 0,function*(){this.tileState.abort(b.uid)})}removeTile(b){return v._(this,void 0,void 0,function*(){this.tileState.removeLoaded(b.uid)})}}class T{constructor(){this.loaded={}}loadTile(b){return v._(this,void 0,void 0,function*(){let{uid:y,encoding:_,rawImageData:x,redFactor:w,greenFactor:k,blueFactor:A,baseShift:C}=b,E=x.width+2,S=x.height+2,T=v.b(x)?new v.R({width:E,height:S},(yield v.d0(x,-1,-1,E,S))):x,O=new v.d1(y,T,_,w,k,A,C);return this.loaded=this.loaded||{},this.loaded[y]=O,O})}removeTile(v){let b=this.loaded,y=v.uid;b&&b[y]&&delete b[y]}}var O,F,I,M=function(){if(I)return F;function v(v,y){if(0!==v.length){b(v[0],y);for(var _=1;_<v.length;_++)b(v[_],!y)}}function b(v,b){for(var y=0,_=0,x=0,w=v.length,k=w-1;x<w;k=x++){var A=(v[x][0]-v[k][0])*(v[k][1]+v[x][1]),C=y+A;_+=Math.abs(y)>=Math.abs(A)?y-C+A:A-C+y,y=C}y+_>=0!=!!b&&v.reverse()}return I=1,F=function b(y,_){var x,w=y&&y.type;if("FeatureCollection"===w)for(x=0;x<y.features.length;x++)b(y.features[x],_);else if("GeometryCollection"===w)for(x=0;x<y.geometries.length;x++)b(y.geometries[x],_);else if("Feature"===w)b(y.geometry,_);else if("Polygon"===w)v(y.coordinates,_);else if("MultiPolygon"===w)for(x=0;x<y.coordinates.length;x++)v(y.coordinates[x],_);return y}}(),R=v.d2(M);let D={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:v=>v},P=Math.fround||(O=new Float32Array(1),v=>(O[0]=+v,O[0]));class L{constructor(v){this.options=Object.assign(Object.create(D),v),this.trees=Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(v){let{log:b,minZoom:y,maxZoom:_}=this.options;b&&console.time("total time");let x=`prepare ${v.length} points`;b&&console.time(x),this.points=v;let w=[];for(let b=0;b<v.length;b++){let y=v[b];if(!y.geometry)continue;let[_,x]=y.geometry.coordinates,k=P(j(_)),A=P(B(x));w.push(k,A,1/0,b,-1,1),this.options.reduce&&w.push(0)}let k=this.trees[_+1]=this._createTree(w);b&&console.timeEnd(x);for(let v=_;v>=y;v--){let y=+Date.now();k=this.trees[v]=this._createTree(this._cluster(k,v)),b&&console.log("z%d: %d clusters in %dms",v,k.numItems,Date.now()-y)}return b&&console.timeEnd("total time"),this}getClusters(v,b){let y=((v[0]+180)%360+360)%360-180,_=Math.max(-90,Math.min(90,v[1])),x=180===v[2]?180:((v[2]+180)%360+360)%360-180,w=Math.max(-90,Math.min(90,v[3]));if(v[2]-v[0]>=360)y=-180,x=180;else if(y>x){let v=this.getClusters([y,_,180,w],b),k=this.getClusters([-180,_,x,w],b);return v.concat(k)}let k=this.trees[this._limitZoom(b)],A=k.range(j(y),B(w),j(x),B(_)),C=k.data,E=[];for(let v of A){let b=this.stride*v;E.push(C[b+5]>1?N(C,b,this.clusterProps):this.points[C[b+3]])}return E}getChildren(v){let b=this._getOriginId(v),y=this._getOriginZoom(v),_="No cluster with the specified id.",x=this.trees[y];if(!x)throw Error(_);let w=x.data;if(b*this.stride>=w.length)throw Error(_);let k=this.options.radius/(this.options.extent*Math.pow(2,y-1)),A=x.within(w[b*this.stride],w[b*this.stride+1],k),C=[];for(let b of A){let y=b*this.stride;w[y+4]===v&&C.push(w[y+5]>1?N(w,y,this.clusterProps):this.points[w[y+3]])}if(0===C.length)throw Error(_);return C}getLeaves(v,b,y){let _=[];return this._appendLeaves(_,v,b=b||10,y=y||0,0),_}getTile(v,b,y){let _=this.trees[this._limitZoom(v)],x=Math.pow(2,v),{extent:w,radius:k}=this.options,A=k/w,C=(y-A)/x,E=(y+1+A)/x,S={features:[]};return this._addTileFeatures(_.range((b-A)/x,C,(b+1+A)/x,E),_.data,b,y,x,S),0===b&&this._addTileFeatures(_.range(1-A/x,C,1,E),_.data,x,y,x,S),b===x-1&&this._addTileFeatures(_.range(0,C,A/x,E),_.data,-1,y,x,S),S.features.length?S:null}getClusterExpansionZoom(v){let b=this._getOriginZoom(v)-1;for(;b<=this.options.maxZoom;){let y=this.getChildren(v);if(b++,1!==y.length)break;v=y[0].properties.cluster_id}return b}_appendLeaves(v,b,y,_,x){for(let w of this.getChildren(b)){let b=w.properties;if(b&&b.cluster?x+b.point_count<=_?x+=b.point_count:x=this._appendLeaves(v,b.cluster_id,y,_,x):x<_?x++:v.push(w),v.length===y)break}return x}_createTree(b){let y=new v.aT(b.length/this.stride|0,this.options.nodeSize,Float32Array);for(let v=0;v<b.length;v+=this.stride)y.add(b[v],b[v+1]);return y.finish(),y.data=b,y}_addTileFeatures(v,b,y,_,x,w){for(let k of v){let v,A,C,E,S=k*this.stride,T=b[S+5]>1;if(T)v=z(b,S,this.clusterProps),A=b[S],C=b[S+1];else{let y=this.points[b[S+3]];v=y.properties;let[_,x]=y.geometry.coordinates;A=j(_),C=B(x)}let O={type:1,geometry:[[Math.round(this.options.extent*(A*x-y)),Math.round(this.options.extent*(C*x-_))]],tags:v};void 0!==(E=T||this.options.generateId?b[S+3]:this.points[b[S+3]].id)&&(O.id=E),w.features.push(O)}}_limitZoom(v){return Math.max(this.options.minZoom,Math.min(Math.floor(+v),this.options.maxZoom+1))}_cluster(v,b){let{radius:y,extent:_,reduce:x,minPoints:w}=this.options,k=y/(_*Math.pow(2,b)),A=v.data,C=[],E=this.stride;for(let y=0;y<A.length;y+=E){if(A[y+2]<=b)continue;A[y+2]=b;let _=A[y],S=A[y+1],T=v.within(A[y],A[y+1],k),O=A[y+5],F=O;for(let v of T){let y=v*E;A[y+2]>b&&(F+=A[y+5])}if(F>O&&F>=w){let v,w=_*O,k=S*O,I=-1,M=(y/E<<5)+(b+1)+this.points.length;for(let _ of T){let C=_*E;if(A[C+2]<=b)continue;A[C+2]=b;let S=A[C+5];w+=A[C]*S,k+=A[C+1]*S,A[C+4]=M,x&&(v||(v=this._map(A,y,!0),I=this.clusterProps.length,this.clusterProps.push(v)),x(v,this._map(A,C)))}A[y+4]=M,C.push(w/F,k/F,1/0,M,-1,F),x&&C.push(I)}else{for(let v=0;v<E;v++)C.push(A[y+v]);if(F>1)for(let v of T){let y=v*E;if(!(A[y+2]<=b)){A[y+2]=b;for(let v=0;v<E;v++)C.push(A[y+v])}}}}return C}_getOriginId(v){return v-this.points.length>>5}_getOriginZoom(v){return(v-this.points.length)%32}_map(v,b,y){if(v[b+5]>1){let _=this.clusterProps[v[b+6]];return y?Object.assign({},_):_}let _=this.points[v[b+3]].properties,x=this.options.map(_);return y&&x===_?Object.assign({},x):x}}function N(v,b,y){return{type:"Feature",id:v[b+3],properties:z(v,b,y),geometry:{type:"Point",coordinates:[360*(v[b]-.5),360*Math.atan(Math.exp((180-360*v[b+1])*Math.PI/180))/Math.PI-90]}}}function z(v,b,y){let _=v[b+5],x=_>=1e4?`${Math.round(_/1e3)}k`:_>=1e3?Math.round(_/100)/10+"k":_,w=v[b+6];return Object.assign(-1===w?{}:Object.assign({},y[w]),{cluster:!0,cluster_id:v[b+3],point_count:_,point_count_abbreviated:x})}function j(v){return v/360+.5}function B(v){let b=Math.sin(v*Math.PI/180),y=.5-.25*Math.log((1+b)/(1-b))/Math.PI;return y<0?0:y>1?1:y}function U(v,b,y,_){let x={id:null==v?null:v,type:b,geometry:y,tags:_,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};switch(b){case"Point":case"MultiPoint":case"LineString":V(x,y);break;case"Polygon":V(x,y[0]);break;case"MultiLineString":for(let v of y)V(x,v);break;case"MultiPolygon":for(let v of y)V(x,v[0])}return x}function V(v,b){for(let y=0;y<b.length;y+=3)v.minX=Math.min(v.minX,b[y]),v.minY=Math.min(v.minY,b[y+1]),v.maxX=Math.max(v.maxX,b[y]),v.maxY=Math.max(v.maxY,b[y+1])}function q(v,b){let y=[];switch(v.type){case"FeatureCollection":for(let _=0;_<v.features.length;_++)H(y,v.features[_],b,_);break;case"Feature":H(y,v,b);break;default:H(y,{geometry:v,properties:void 0},b)}return y}function H(v,b,y,_){if(!b.geometry)return;if("GeometryCollection"===b.geometry.type){for(let x of b.geometry.geometries)H(v,{id:b.id,geometry:x,properties:b.properties},y,_);return}let x=b.geometry.coordinates;if(!x?.length)return;let w=Math.pow(y.tolerance/((1<<y.maxZoom)*y.extent),2),k=b.id;switch(y.promoteId?k=b.properties?.[y.promoteId]:y.generateId&&(k=_||0),b.geometry.type){case"Point":{let y=[];return W(b.geometry.coordinates,y),void v.push(U(k,b.geometry.type,y,b.properties))}case"MultiPoint":{let y=[];for(let v of b.geometry.coordinates)W(v,y);return void v.push(U(k,b.geometry.type,y,b.properties))}case"LineString":{let y=[];return G(b.geometry.coordinates,y,w,!1),void v.push(U(k,b.geometry.type,y,b.properties))}case"MultiLineString":{if(y.lineMetrics){for(let y of b.geometry.coordinates){let _=[];G(y,_,w,!1),v.push(U(k,"LineString",_,b.properties))}return}let _=[];return Y(b.geometry.coordinates,_,w,!1),void v.push(U(k,b.geometry.type,_,b.properties))}case"Polygon":{let y=[];return Y(b.geometry.coordinates,y,w,!0),void v.push(U(k,b.geometry.type,y,b.properties))}case"MultiPolygon":{let y=[];for(let v of b.geometry.coordinates){let b=[];Y(v,b,w,!0),y.push(b)}return void v.push(U(k,b.geometry.type,y,b.properties))}default:throw Error("Input data is not a valid GeoJSON object.")}}function W(v,b){b.push(v[0]/360+.5,Z(v[1]),0)}function G(v,b,y,_){let x,w,k=0;for(let y=0;y<v.length;y++){let A=v[y][0]/360+.5,C=Z(v[y][1]);b.push(A,C,0),y>0&&(k+=_?(x*C-A*w)/2:Math.sqrt(Math.pow(A-x,2)+Math.pow(C-w,2))),x=A,w=C}let A=b.length-3;b[2]=1,y>0&&function v(b,y,_,x){let w=x,k=y+(_-y>>1),A,C=_-y,E=b[y],S=b[y+1],T=b[_],O=b[_+1];for(let v=y+3;v<_;v+=3){let y=function(v,b,y,_,x,w){let k=x-y,A=w-_;if(0!==k||0!==A){let C=((v-y)*k+(b-_)*A)/(k*k+A*A);C>1?(y=x,_=w):C>0&&(y+=k*C,_+=A*C)}return(k=v-y)*k+(A=b-_)*A}(b[v],b[v+1],E,S,T,O);if(y>w)A=v,w=y;else if(y===w){let b=Math.abs(v-k);b<C&&(A=v,C=b)}}w>x&&(A-y>3&&v(b,y,A,x),b[A+2]=w,_-A>3&&v(b,A,_,x))}(b,0,A,y),b[A+2]=1,b.size=Math.abs(k),b.start=0,b.end=b.size}function Y(v,b,y,_){for(let x=0;x<v.length;x++){let w=[];G(v[x],w,y,_),b.push(w)}}function Z(v){let b=Math.sin(v*Math.PI/180),y=.5-.25*Math.log((1+b)/(1-b))/Math.PI;return y<0?0:y>1?1:y}function X(v,b,y,_,x,w,k,A){if(_/=b,w>=(y/=b)&&k<_)return v;if(k<y||w>=_)return null;let C=[];for(let b of v){let v=0===x?b.minX:b.minY,w=0===x?b.maxX:b.maxY;if(v>=y&&w<_)C.push(b);else if(!(w<y||v>=_))switch(b.type){case"Point":case"MultiPoint":{let v=[];if(function(v,b,y,_,x){for(let w=0;w<v.length;w+=3){let k=v[w+x];k>=y&&k<=_&&ee(b,v[w],v[w+1],v[w+2])}}(b.geometry,v,y,_,x),!v.length)continue;C.push(U(b.id,3===v.length?"Point":"MultiPoint",v,b.tags));continue}case"LineString":{let v=[];if(K(b.geometry,v,y,_,x,!1,A.lineMetrics),!v.length)continue;if(A.lineMetrics){for(let y of v)C.push(U(b.id,b.type,y,b.tags));continue}if(v.length>1){C.push(U(b.id,"MultiLineString",v,b.tags));continue}C.push(U(b.id,b.type,v[0],b.tags));continue}case"MultiLineString":{let v=[];if(Q(b.geometry,v,y,_,x,!1),!v.length)continue;if(1===v.length){C.push(U(b.id,"LineString",v[0],b.tags));continue}C.push(U(b.id,b.type,v,b.tags));continue}case"Polygon":{let v=[];if(Q(b.geometry,v,y,_,x,!0),!v.length)continue;C.push(U(b.id,b.type,v,b.tags));continue}case"MultiPolygon":{let v=[];for(let w of b.geometry){let b=[];Q(w,b,y,_,x,!0),b.length&&v.push(b)}if(!v.length)continue;C.push(U(b.id,b.type,v,b.tags));continue}}}return C.length?C:null}function K(v,b,y,_,x,w,k){let A=J(v),C=0===x?et:en,E,S,T=v.start;for(let O=0;O<v.length-3;O+=3){let F=v[O],I=v[O+1],M=v[O+2],R=v[O+3],D=v[O+4],P=0===x?F:I,L=0===x?R:D,N=!1;k&&(E=Math.sqrt(Math.pow(F-R,2)+Math.pow(I-D,2))),P<y?L>y&&(S=C(A,F,I,R,D,y),k&&(A.start=T+E*S)):P>_?L<_&&(S=C(A,F,I,R,D,_),k&&(A.start=T+E*S)):ee(A,F,I,M),L<y&&P>=y&&(S=C(A,F,I,R,D,y),N=!0),L>_&&P<=_&&(S=C(A,F,I,R,D,_),N=!0),!w&&N&&(k&&(A.end=T+E*S),b.push(A),A=J(v)),k&&(T+=E)}let O=v.length-3,F=v[O],I=v[O+1],M=0===x?F:I;M>=y&&M<=_&&ee(A,F,I,v[O+2]),O=A.length-3,w&&O>=3&&(A[O]!==A[0]||A[O+1]!==A[1])&&ee(A,A[0],A[1],A[2]),A.length&&b.push(A)}function J(v){let b=[];return b.size=v.size,b.start=v.start,b.end=v.end,b}function Q(v,b,y,_,x,w){for(let k of v)K(k,b,y,_,x,w,!1)}function ee(v,b,y,_){v.push(b,y,_)}function et(v,b,y,_,x,w){let k=(w-b)/(_-b);return ee(v,w,y+(x-y)*k,1),k}function en(v,b,y,_,x,w){let k=(w-y)/(x-y);return ee(v,b+(_-b)*k,w,1),k}function ei(v,b){let y=b.buffer/b.extent,_=v,x=X(v,1,-1-y,y,0,-1,2,b),w=X(v,1,1-y,2+y,0,-1,2,b);return(x||w)&&(_=X(v,1,-y,1+y,0,-1,2,b)||[],x&&(_=er(x,1).concat(_)),w&&(_=_.concat(er(w,-1)))),_}function er(v,b){let y=[];for(let _ of v)switch(_.type){case"Point":case"MultiPoint":case"LineString":{let v=eo(_.geometry,b);y.push(U(_.id,_.type,v,_.tags));continue}case"MultiLineString":case"Polygon":{let v=[];for(let y of _.geometry)v.push(eo(y,b));y.push(U(_.id,_.type,v,_.tags));continue}case"MultiPolygon":{let v=[];for(let y of _.geometry){let _=[];for(let v of y)_.push(eo(v,b));v.push(_)}y.push(U(_.id,_.type,v,_.tags));continue}}return y}function eo(v,b){let y=[];y.size=v.size,void 0!==v.start&&(y.start=v.start,y.end=v.end);for(let _=0;_<v.length;_+=3)y.push(v[_]+b,v[_+1],v[_+2]);return y}function ea(v,b){if(v.transformed)return v;let y=1<<v.z,_=v.x,x=v.y;for(let w of v.features){if(1===w.type){let v=[];for(let k=0;k<w.geometry.length;k+=2)v.push(es(w.geometry[k],w.geometry[k+1],b,y,_,x));w.geometry=v;continue}let v=[];for(let k of w.geometry){let w=[];for(let v=0;v<k.length;v+=2)w.push(es(k[v],k[v+1],b,y,_,x));v.push(w)}w.geometry=v}return v.transformed=!0,v}function es(v,b,y,_,x,w){return[Math.round(y*(v*_-x)),Math.round(y*(b*_-w))]}function el(v,b,y,_,x){let w=b===x.maxZoom?0:x.tolerance/((1<<b)*x.extent),k={features:[],numPoints:0,numSimplified:0,numFeatures:v.length,source:null,x:y,y:_,z:b,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(let b of v)!function(v,b,y,_){v.minX=Math.min(v.minX,b.minX),v.minY=Math.min(v.minY,b.minY),v.maxX=Math.max(v.maxX,b.maxX),v.maxY=Math.max(v.maxY,b.maxY);let x,w=b.tags||null;switch(b.type){case"Point":case"MultiPoint":{let y=[];for(let _=0;_<b.geometry.length;_+=3)y.push(b.geometry[_],b.geometry[_+1]),v.numPoints++,v.numSimplified++;if(!y.length)return;x={type:1,tags:w,geometry:y};break}case"LineString":{let k=[];if(ec(k,b.geometry,v,y,!1,!1),!k.length)return;if(_.lineMetrics){for(let v in w={},b.tags)w[v]=b.tags[v];w.mapbox_clip_start=b.geometry.start/b.geometry.size,w.mapbox_clip_end=b.geometry.end/b.geometry.size}x={type:2,tags:w,geometry:k};break}case"MultiLineString":case"Polygon":{let _=[];for(let x=0;x<b.geometry.length;x++)ec(_,b.geometry[x],v,y,"Polygon"===b.type,0===x);if(!_.length)return;x={type:"Polygon"===b.type?3:2,tags:w,geometry:_};break}case"MultiPolygon":{let _=[];for(let x=0;x<b.geometry.length;x++){let w=b.geometry[x];for(let b=0;b<w.length;b++)ec(_,w[b],v,y,!0,0===b)}if(!_.length)return;x={type:3,tags:w,geometry:_}}}null!==b.id&&(x.id=b.id),v.features.push(x)}(k,b,w,x);return k}function ec(v,b,y,_,x,w){let k=_*_;if(_>0&&b.size<(x?k:_))return void(y.numPoints+=b.length/3);let A=[];for(let v=0;v<b.length;v+=3)(0===_||b[v+2]>k)&&(y.numSimplified++,A.push(b[v],b[v+1])),y.numPoints++;x&&function(v,b){let y=0;for(let b=0,_=v.length,x=_-2;b<_;x=b,b+=2)y+=(v[b]-v[x])*(v[b+1]+v[x+1]);if(y>0===b)for(let b=0,y=v.length;b<y/2;b+=2){let _=v[b],x=v[b+1];v[b]=v[y-2-b],v[b+1]=v[y-1-b],v[y-2-b]=_,v[y-1-b]=x}}(A,w),v.push(A)}function eu(v,b){if(b.removeAllProperties)return{};let y={...v||{}};if(b.removeProperties)for(let v of b.removeProperties)delete y[v];if(b.addOrUpdateProperties)for(let{key:v,value:_}of b.addOrUpdateProperties)y[v]=_;return y}let ed={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,updateable:!1,debug:0};class eh{options;tiles;tileCoords;stats={};total=0;source;constructor(v,b){const y=(b=this.options=Object.assign({},ed,b)).debug;if(y&&console.time("preprocess data"),b.maxZoom<0||b.maxZoom>24)throw Error("maxZoom should be in the 0-24 range");if(b.promoteId&&b.generateId)throw Error("promoteId and generateId cannot be used together.");let _=q(v,b);this.tiles={},this.tileCoords=[],y&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",b.indexMaxZoom,b.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(_=ei(_,b)).length&&this.splitTile(_,0,0,0),b.updateable&&(this.source=_),y&&(_.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(v,b,y,_,x,w,k){let A=[v,b,y,_],C=this.options,E=C.debug;for(;A.length;){_=A.pop(),y=A.pop(),b=A.pop(),v=A.pop();let S=1<<b,T=ep(b,y,_),O=this.tiles[T];if(!O&&(E>1&&console.time("creation"),O=this.tiles[T]=el(v,b,y,_,C),this.tileCoords.push({z:b,x:y,y:_,id:T}),E)){E>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",b,y,_,O.numFeatures,O.numPoints,O.numSimplified),console.timeEnd("creation"));let v=`z${b}`;this.stats[v]=(this.stats[v]||0)+1,this.total++}if(O.source=v,null==x){if(b===C.indexMaxZoom||O.numPoints<=C.indexMaxPoints)continue}else{if(b===C.maxZoom||b===x)continue;if(null!=x){let v=x-b;if(y!==w>>v||_!==k>>v)continue}}if(O.source=null,!v.length)continue;E>1&&console.time("clipping");let F=.5*C.buffer/C.extent,I=.5-F,M=.5+F,R=1+F,D=null,P=null,L=null,N=null,z=X(v,S,y-F,y+M,0,O.minX,O.maxX,C),j=X(v,S,y+I,y+R,0,O.minX,O.maxX,C);z&&(D=X(z,S,_-F,_+M,1,O.minY,O.maxY,C),P=X(z,S,_+I,_+R,1,O.minY,O.maxY,C)),j&&(L=X(j,S,_-F,_+M,1,O.minY,O.maxY,C),N=X(j,S,_+I,_+R,1,O.minY,O.maxY,C)),E>1&&console.timeEnd("clipping"),A.push(D||[],b+1,2*y,2*_),A.push(P||[],b+1,2*y,2*_+1),A.push(L||[],b+1,2*y+1,2*_),A.push(N||[],b+1,2*y+1,2*_+1)}}getTile(v,b,y){v*=1,b*=1,y*=1;let{extent:_,debug:x}=this.options;if(v<0||v>24)return null;let w=1<<v,k=ep(v,b=b+w&w-1,y);if(this.tiles[k])return ea(this.tiles[k],_);x>1&&console.log("drilling down to z%d-%d-%d",v,b,y);let A,C=v,E=b,S=y;for(;!A&&C>0;)C--,E>>=1,S>>=1,A=this.tiles[ep(C,E,S)];return A?.source?(x>1&&(console.log("found parent tile z%d-%d-%d",C,E,S),console.time("drilling down")),this.splitTile(A.source,C,E,S,v,b,y),x>1&&console.timeEnd("drilling down"),this.tiles[k]?ea(this.tiles[k],_):null):null}invalidateTiles(v){let b=this.options,{debug:y}=b,_=1/0,x=-1/0,w=1/0,k=-1/0;for(let b of v)_=Math.min(_,b.minX),x=Math.max(x,b.maxX),w=Math.min(w,b.minY),k=Math.max(k,b.maxY);let A=b.buffer/b.extent,C=new Set;for(let b in this.tiles){let E=this.tiles[b],S=1<<E.z,T=(E.x-A)/S,O=(E.x+1+A)/S,F=(E.y-A)/S,I=(E.y+1+A)/S;if(x<T||_>=O||k<F||w>=I)continue;let M=!1;for(let b of v)if(b.maxX>=T&&b.minX<O&&b.maxY>=F&&b.minY<I){M=!0;break}if(M){if(y){y>1&&console.log("invalidate tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",E.z,E.x,E.y,E.numFeatures,E.numPoints,E.numSimplified);let v=`z${E.z}`;this.stats[v]=(this.stats[v]||0)-1,this.total--}delete this.tiles[b],C.add(b)}}C.size&&(this.tileCoords=this.tileCoords.filter(v=>!C.has(v.id)))}updateData(v){let b=this.options,y=b.debug;if(!b.updateable)throw Error("to update tile geojson `updateable` option must be set to true");let{affected:_,source:x}=function(v,b,y){let _=b?{removeAll:b.removeAll,remove:new Set(b.remove||[]),add:new Map(b.add?.map(v=>[v.id,v])),update:new Map(b.update?.map(v=>[v.id,v]))}:{remove:new Set,add:new Map,update:new Map},x=[];if(_.removeAll&&(x=v,v=[]),_.remove.size||_.add.size){let b=[];for(let y of v){let{id:v}=y;(_.remove.has(v)||_.add.has(v))&&b.push(y)}if(b.length){x.push(...b);let y=new Set(b.map(v=>v.id));v=v.filter(v=>!y.has(v.id))}if(_.add.size){let b=q({type:"FeatureCollection",features:Array.from(_.add.values())},y);b=ei(b,y),x.push(...b),v.push(...b)}}if(_.update.size)for(let[b,w]of _.update){let _=v.findIndex(v=>v.id===b);if(-1===_)continue;let k=v[_],A=function(v,b,y){let _=!!b.newGeometry,x=b.removeAllProperties||b.removeProperties?.length>0||b.addOrUpdateProperties?.length>0;if(_){let _=q({type:"FeatureCollection",features:[{type:"Feature",id:v.id,geometry:b.newGeometry,properties:x?eu(v.tags,b):v.tags}]},y);return(_=ei(_,y))[0]}if(x){let y={...v};return y.tags=eu(y.tags,b),y}return null}(k,w,y);A&&(x.push(k,A),v[_]=A)}return{affected:x,source:v}}(this.source,v,b);if(!_.length)return;this.source=x,y>1&&(console.log("invalidating tiles"),console.time("invalidating")),this.invalidateTiles(_),y>1&&console.timeEnd("invalidating");let[w,k,A]=[0,0,0],C=el(this.source,w,k,A,this.options);C.source=this.source;let E=ep(w,k,A);if(this.tiles[E]=C,this.tileCoords.push({z:w,x:k,y:A,id:E}),y){let v=`z${w}`;this.stats[v]=(this.stats[v]||0)+1,this.total++}}}function ep(v,b,y){return 32*((1<<v)*y+b)+v}class ef{constructor(v,b,y,_=em){this._dataUpdateable=new Map,this.actor=v,this.layerIndex=b,this.availableImages=y,this.tileState=new w,this._createGeoJSONIndex=_}loadVectorTile(b){if(!this._geoJSONIndex)throw Error("Unable to parse the data into a cluster or geojson");let{z:y,x:_,y:x}=b.tileID.canonical,w=this._geoJSONIndex.getTile(y,_,x);return w?E(new v.d3(w.features,{version:2,extent:v.a5})):null}loadTile(b){return v._(this,void 0,void 0,function*(){let{uid:v}=b,y=new _(b);y.abort=new AbortController;try{let _=this.loadVectorTile(b);if(!_)return null;let{vectorTile:x,rawData:w}=_;y.vectorTile=x,this.tileState.markLoaded(v,y);let k={rawData:w};this.tileState.setParsing(v,k);try{return yield this._parseWorkerTile(y,b,k)}finally{this.tileState.clearParsing(v)}}catch(b){throw y.status="done",this.tileState.markLoaded(v,y),b}})}_reloadLoadedTile(b){return v._(this,void 0,void 0,function*(){let v=b.uid,y=this.tileState.getLoaded(v);if(!y)throw Error("Should not be trying to reload a tile that was never loaded or has been removed");if(y.showCollisionBoxes=b.showCollisionBoxes,"parsing"===y.status){let _=this.tileState.consumeParsing(v);return yield this._parseWorkerTile(y,b,_)}if("done"===y.status&&y.vectorTile)return yield this._parseWorkerTile(y,b)})}_parseWorkerTile(b,y,_){return v._(this,void 0,void 0,function*(){let x=yield b.parse(b.vectorTile,this.layerIndex,this.availableImages,this.actor,y.subdivisionGranularity);if(_){let{rawData:b}=_;x=v.e({rawTileData:b.slice(0)},x)}return x})}abortTile(b){return v._(this,void 0,void 0,function*(){this.tileState.abort(b.uid)})}removeTile(b){return v._(this,void 0,void 0,function*(){this.tileState.removeLoaded(b.uid)})}loadData(b){return v._(this,void 0,void 0,function*(){var y;null==(y=this._pendingRequest)||y.abort();let _=this._startRequestTiming(b);this._pendingRequest=new AbortController;try{(!this._pendingData||b.request||b.data||b.dataDiff)&&(this._pendingData=this.loadAndProcessGeoJSON(b,this._pendingRequest));let v=yield this._pendingData;this._geoJSONIndex=this._createGeoJSONIndex(v,b),this.tileState.clearLoaded();let y={};return b.request&&(y.data=v),this._finishRequestTiming(_,b,y),y}catch(b){if(delete this._pendingRequest,v.Z(b))return{abandoned:!0};throw b}})}_startRequestTiming(b){var y;if(null==(y=b.request)?void 0:y.collectResourceTiming)return new v.c$(b.request.url)}_finishRequestTiming(v,b,y){let _=null==v?void 0:v.finish();_&&(y.resourceTiming={[b.source]:JSON.parse(JSON.stringify(_))})}getData(){return v._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(v){return this.tileState.getLoaded(v.uid)?this._reloadLoadedTile(v):this.loadTile(v)}loadAndProcessGeoJSON(b,y){return v._(this,void 0,void 0,function*(){let v;if(b.request?v=yield this.loadGeoJSONFromUrl(b.request,b.promoteId,y):b.data?v=this._loadGeoJSONFromObject(b.data,b.promoteId):b.dataDiff&&(v=this._loadGeoJSONFromDiff(b.dataDiff,b.promoteId,b.source)),delete this._pendingRequest,"object"!=typeof v)throw Error(`Input data given to '${b.source}' is not a valid GeoJSON object.`);return R(v,!0),b.filter&&(v=this._filterGeoJSON(v,b.filter)),v})}loadGeoJSONFromUrl(b,y,_){return v._(this,void 0,void 0,function*(){let x=yield v.j(b,_);return this._dataUpdateable=v.a7(x.data,y),x.data})}_loadGeoJSONFromObject(b,y){return this._dataUpdateable=v.a7(b,y),b}_loadGeoJSONFromDiff(b,y,_){if(!this._dataUpdateable)throw Error(`Cannot update existing geojson data in ${_}`);v.a8(this._dataUpdateable,b,y);let x=Array.from(this._dataUpdateable.values());return this._toFeatureCollection(x)}_filterGeoJSON(b,y){let _=v.d4(y,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===_.result)throw Error(_.value.map(v=>`${v.key}: ${v.message}`).join(", "));let x=b.features.filter(v=>_.value.evaluate({zoom:0},v));return this._toFeatureCollection(x)}_toFeatureCollection(v){return{type:"FeatureCollection",features:v}}removeSource(b){return v._(this,void 0,void 0,function*(){var v;null==(v=this._pendingRequest)||v.abort()})}getClusterExpansionZoom(v){return this._geoJSONIndex.getClusterExpansionZoom(v.clusterId)}getClusterChildren(v){return this._geoJSONIndex.getChildren(v.clusterId)}getClusterLeaves(v){return this._geoJSONIndex.getLeaves(v.clusterId,v.limit,v.offset)}}function em(b,y){return y.cluster?new L(function({superclusterOptions:b,clusterProperties:y}){if(!y||!b)return b;let _={},x={},w={accumulated:null,zoom:0},k={properties:null},A=Object.keys(y);for(let b of A){let[w,k]=y[b],A=v.d4(k),C=v.d4("string"==typeof w?[w,["accumulated"],["get",b]]:w);_[b]=A.value,x[b]=C.value}return b.map=v=>{k.properties=v;let b={};for(let v of A)b[v]=_[v].evaluate(w,k);return b},b.reduce=(v,b)=>{for(let y of(k.properties=b,A))w.accumulated=v[y],v[y]=x[y].evaluate(w,k)},b}(y)).load(b.features):new eh(b,y.geojsonVtOptions)}class eg{constructor(b){this.self=b,this.actor=new v.L(b),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.globalStates=new Map,this.self.registerWorkerSource=(v,b)=>{if(this.externalWorkerSourceTypes[v])throw Error(`Worker source with name "${v}" already registered.`);this.externalWorkerSourceTypes[v]=b},this.self.addProtocol=v.cK,this.self.removeProtocol=v.cL,this.self.registerRTLTextPlugin=b=>{v.d5.setMethods(b)},this.actor.registerMessageHandler("LDT",(v,b)=>this._getDEMWorkerSource(v,b.source).loadTile(b)),this.actor.registerMessageHandler("RDT",(b,y)=>v._(this,void 0,void 0,function*(){this._getDEMWorkerSource(b,y.source).removeTile(y)})),this.actor.registerMessageHandler("GCEZ",(b,y)=>v._(this,void 0,void 0,function*(){return this._getWorkerSource(b,y.type,y.source).getClusterExpansionZoom(y)})),this.actor.registerMessageHandler("GCC",(b,y)=>v._(this,void 0,void 0,function*(){return this._getWorkerSource(b,y.type,y.source).getClusterChildren(y)})),this.actor.registerMessageHandler("GCL",(b,y)=>v._(this,void 0,void 0,function*(){return this._getWorkerSource(b,y.type,y.source).getClusterLeaves(y)})),this.actor.registerMessageHandler("LD",(v,b)=>this._getWorkerSource(v,b.type,b.source).loadData(b)),this.actor.registerMessageHandler("GD",(v,b)=>this._getWorkerSource(v,b.type,b.source).getData()),this.actor.registerMessageHandler("LT",(v,b)=>this._getWorkerSource(v,b.type,b.source).loadTile(b)),this.actor.registerMessageHandler("RT",(v,b)=>this._getWorkerSource(v,b.type,b.source).reloadTile(b)),this.actor.registerMessageHandler("AT",(v,b)=>this._getWorkerSource(v,b.type,b.source).abortTile(b)),this.actor.registerMessageHandler("RMT",(v,b)=>this._getWorkerSource(v,b.type,b.source).removeTile(b)),this.actor.registerMessageHandler("RS",(b,y)=>v._(this,void 0,void 0,function*(){if(!this.workerSources[b]||!this.workerSources[b][y.type]||!this.workerSources[b][y.type][y.source])return;let v=this.workerSources[b][y.type][y.source];delete this.workerSources[b][y.type][y.source],void 0!==v.removeSource&&v.removeSource(y)})),this.actor.registerMessageHandler("RM",b=>v._(this,void 0,void 0,function*(){delete this.layerIndexes[b],delete this.availableImages[b],delete this.workerSources[b],delete this.demWorkerSources[b],this.globalStates.delete(b)})),this.actor.registerMessageHandler("SR",(b,y)=>v._(this,void 0,void 0,function*(){this.referrer=y})),this.actor.registerMessageHandler("SRPS",(v,b)=>this._syncRTLPluginState(v,b)),this.actor.registerMessageHandler("IS",(b,y)=>v._(this,void 0,void 0,function*(){this.self.importScripts(y)})),this.actor.registerMessageHandler("SI",(v,b)=>this._setImages(v,b)),this.actor.registerMessageHandler("UL",(b,y)=>v._(this,void 0,void 0,function*(){this._getLayerIndex(b).update(y.layers,y.removedIds,this._getGlobalState(b))})),this.actor.registerMessageHandler("UGS",(b,y)=>v._(this,void 0,void 0,function*(){let v=this._getGlobalState(b);for(let b in y)v[b]=y[b]})),this.actor.registerMessageHandler("SL",(b,y)=>v._(this,void 0,void 0,function*(){this._getLayerIndex(b).replace(y,this._getGlobalState(b))}))}_getGlobalState(v){let b=this.globalStates.get(v);return b||(b={},this.globalStates.set(v,b)),b}_setImages(b,y){return v._(this,void 0,void 0,function*(){for(let v in this.availableImages[b]=y,this.workerSources[b]){let _=this.workerSources[b][v];for(let v in _)_[v].availableImages=y}})}_syncRTLPluginState(b,y){return v._(this,void 0,void 0,function*(){return yield v.d5.syncState(y,this.self.importScripts)})}_getAvailableImages(v){let b=this.availableImages[v];return b||(b=[]),b}_getLayerIndex(v){let y=this.layerIndexes[v];return y||(y=this.layerIndexes[v]=new b),y}_getWorkerSource(v,b,y){if(this.workerSources[v]||(this.workerSources[v]={}),this.workerSources[v][b]||(this.workerSources[v][b]={}),!this.workerSources[v][b][y]){let _={sendAsync:(b,y)=>(b.targetMapId=v,this.actor.sendAsync(b,y))};switch(b){case"vector":this.workerSources[v][b][y]=new S(_,this._getLayerIndex(v),this._getAvailableImages(v));break;case"geojson":this.workerSources[v][b][y]=new ef(_,this._getLayerIndex(v),this._getAvailableImages(v));break;default:this.workerSources[v][b][y]=new this.externalWorkerSourceTypes[b](_,this._getLayerIndex(v),this._getAvailableImages(v))}}return this.workerSources[v][b][y]}_getDEMWorkerSource(v,b){return this.demWorkerSources[v]||(this.demWorkerSources[v]={}),this.demWorkerSources[v][b]||(this.demWorkerSources[v][b]=new T),this.demWorkerSources[v][b]}}return v.i(self)&&(self.worker=new eg(self)),eg}),y("index",["exports","./shared"],function(v,b){let y,_,x,w,k,A,C,E;var S,T,O,F,I,M="5.19.0";function R(){var v=new b.A(4);return b.A!=Float32Array&&(v[1]=0,v[2]=0),v[0]=1,v[3]=1,v}let D={frame(v,y,_,x){let w=x||window,k=w.requestAnimationFrame(v=>{A(),y(v)}),{unsubscribe:A}=b.s(v.signal,"abort",()=>{A(),w.cancelAnimationFrame(k),_(new b.a(v.signal.reason))},!1)},frameAsync(v,b){return new Promise((y,_)=>{this.frame(v,y,_,b)})},getImageData(v,b=0){return this.getImageCanvasContext(v).getImageData(-b,-b,v.width+2*b,v.height+2*b)},getImageCanvasContext(v){let b=window.document.createElement("canvas"),y=b.getContext("2d",{willReadFrequently:!0});if(!y)throw Error("failed to create canvas 2d context");return b.width=v.width,b.height=v.height,y.drawImage(v,0,0,v.width,v.height),y},resolveURL:v=>(y||(y=document.createElement("a")),y.href=v,y.href),hardwareConcurrency:"u">typeof navigator&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return void 0!==x?x:!!matchMedia&&(null==_&&(_=matchMedia("(prefers-reduced-motion: reduce)")),_.matches)},set prefersReducedMotion(e){x=e}},P=new class{constructor(){this._realTime="u">typeof performance&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),this._frozenAt=null}getCurrentTime(){return null!==this._frozenAt?this._frozenAt:this._realTime()}setNow(v){this._frozenAt=v}restoreNow(){this._frozenAt=null}isFrozen(){return null!==this._frozenAt}};function L(){return P.getCurrentTime()}class N{static testProp(v){if(!N.docStyle)return v[0];for(let b=0;b<v.length;b++)if(v[b]in N.docStyle)return v[b];return v[0]}static create(v,b,y){let _=window.document.createElement(v);return void 0!==b&&(_.className=b),y&&y.appendChild(_),_}static createNS(v,b){return window.document.createElementNS(v,b)}static disableDrag(){N.docStyle&&N.selectProp&&(N.userSelect=N.docStyle[N.selectProp],N.docStyle[N.selectProp]="none")}static enableDrag(){N.docStyle&&N.selectProp&&(N.docStyle[N.selectProp]=N.userSelect)}static setTransform(v,b){v.style[N.transformProp]=b}static addEventListener(v,b,y,_={}){v.addEventListener(b,y,"passive"in _?_:_.capture)}static removeEventListener(v,b,y,_={}){v.removeEventListener(b,y,"passive"in _?_:_.capture)}static suppressClickInternal(v){v.preventDefault(),v.stopPropagation(),window.removeEventListener("click",N.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",N.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",N.suppressClickInternal,!0)},0)}static getScale(v){let b=v.getBoundingClientRect();return{x:b.width/v.offsetWidth||1,y:b.height/v.offsetHeight||1,boundingClientRect:b}}static getPoint(v,y,_){let x=y.boundingClientRect;return new b.P((_.clientX-x.left)/y.x-v.clientLeft,(_.clientY-x.top)/y.y-v.clientTop)}static mousePos(v,b){let y=N.getScale(v);return N.getPoint(v,y,b)}static touchPos(v,b){let y=[],_=N.getScale(v);for(let x=0;x<b.length;x++)y.push(N.getPoint(v,_,b[x]));return y}static mouseButton(v){return v.button}static remove(v){v.parentNode&&v.parentNode.removeChild(v)}static sanitize(v){let b=(new DOMParser).parseFromString(v,"text/html").body||document.createElement("body");for(let v of b.querySelectorAll("script"))v.remove();return N.clean(b),b.innerHTML}static isPossiblyDangerous(v,b){let y=b.replace(/\s+/g,"").toLowerCase();return!(!["src","href","xlink:href"].includes(v)||!y.includes("javascript:")&&!y.includes("data:"))||!!v.startsWith("on")||void 0}static clean(v){for(let b of v.children)N.removeAttributes(b),N.clean(b)}static removeAttributes(v){for(let{name:b,value:y}of v.attributes)N.isPossiblyDangerous(b,y)&&v.removeAttribute(b)}}N.docStyle="u">typeof window&&window.document&&window.document.documentElement.style,N.selectProp=N.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),N.transformProp=N.testProp(["transform","WebkitTransform"]);let z={supported:!1,testSupport:function(v){!U&&B&&(V?q(v):j=v)}},j,B,U=!1,V=!1;function q(v){let b=v.createTexture();v.bindTexture(v.TEXTURE_2D,b);try{if(v.texImage2D(v.TEXTURE_2D,0,v.RGBA,v.RGBA,v.UNSIGNED_BYTE,B),v.isContextLost())return;z.supported=!0}catch(v){}v.deleteTexture(b),U=!0}"u">typeof document&&((B=document.createElement("img")).onload=()=>{j&&q(j),j=null,V=!0},B.onerror=()=>{U=!0,j=null},B.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(v){let y,_,x,w;v.resetRequestQueue=()=>{y=[],_=0,x=0,w={}},v.addThrottleControl=v=>{let b=x++;return w[b]=v,b},v.removeThrottleControl=v=>{delete w[v],A()},v.getImage=(v,_,x=!0)=>new Promise((w,k)=>{z.supported&&(v.headers||(v.headers={}),v.headers.accept="image/webp,*/*"),b.e(v,{type:"image"}),y.push({abortController:_,requestParameters:v,supportImageRefresh:x,state:"queued",onError:v=>{k(v)},onSuccess:v=>{w(v)}}),A()});let k=v=>b._(this,void 0,void 0,function*(){var y;v.state="running";let{requestParameters:x,supportImageRefresh:w,onError:k,onSuccess:E,abortController:S}=v,T=!1===w&&!b.i(self)&&!b.g(x.url)&&(!x.headers||Object.keys(x.headers).reduce((v,b)=>v&&"accept"===b,!0));_++;let O=T?C(x,S):b.m(x,S);try{let _=yield O;delete v.abortController,v.state="completed",_.data instanceof HTMLImageElement||b.b(_.data)?E(_):_.data&&E({data:yield(y=_.data,"function"==typeof createImageBitmap?b.f(y):b.h(y)),cacheControl:_.cacheControl,expires:_.expires})}catch(b){delete v.abortController,k(b)}finally{_--,A()}}),A=()=>{let v=(()=>{for(let v of Object.keys(w))if(w[v]())return!0;return!1})()?b.c.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:b.c.MAX_PARALLEL_IMAGE_REQUESTS;for(let b=_;b<v&&y.length>0;b++){let v=y.shift();v.abortController.signal.aborted?b--:k(v)}},C=(v,y)=>new Promise((_,x)=>{let w=new Image,k=v.url,A=v.credentials;A&&"include"===A?w.crossOrigin="use-credentials":(A&&"same-origin"===A||!b.d(k))&&(w.crossOrigin="anonymous"),y.signal.addEventListener("abort",()=>{w.src="",x(new b.a(y.signal.reason))}),w.fetchPriority="high",w.onload=()=>{w.onerror=w.onload=null,_({data:w})},w.onerror=()=>{w.onerror=w.onload=null,y.signal.aborted||x(Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},w.src=k})}(O||(O={})),O.resetRequestQueue();class H{constructor(v){this._transformRequestFn=null!=v?v:null}transformRequest(v,b){return this._transformRequestFn&&this._transformRequestFn(v,b)||{url:v}}setTransformRequest(v){this._transformRequestFn=v}}function W(v){let b=[];if("string"==typeof v)b.push({id:"default",url:v});else if(v&&v.length>0){let y=[];for(let{id:_,url:x}of v){let v=`${_}${x}`;-1===y.indexOf(v)&&(y.push(v),b.push({id:_,url:x}))}}return b}function G(v,b,y){try{let _=new URL(v);return _.pathname+=`${b}${y}`,_.toString()}catch(b){throw Error(`Invalid sprite URL "${v}", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically`)}}class Y extends b.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new b.R({width:1,height:1}),this.dirty=!0}destroy(){for(let v of(this.atlasTexture&&(this.atlasTexture.destroy(),this.atlasTexture=null),Object.keys(this.images)))this.removeImage(v);this.patterns={},this.atlasImage=new b.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(v){if(this.loaded!==v&&(this.loaded=v,v)){for(let{ids:v,promiseResolve:b}of this.requestors)b(this._getImagesForIds(v));this.requestors=[]}}getImage(v){let y=this.images[v];if(y&&!y.data&&y.spriteData){let v=y.spriteData;y.data=new b.R({width:v.width,height:v.height},v.context.getImageData(v.x,v.y,v.width,v.height).data),y.spriteData=null}return y}addImage(v,b){if(this.images[v])throw Error(`Image id ${v} already exist, use updateImage instead`);this._validate(v,b)&&(this.images[v]=b)}_validate(v,y){let _=!0,x=y.data||y.spriteData;return this._validateStretch(y.stretchX,x&&x.width)||(this.fire(new b.k(Error(`Image "${v}" has invalid "stretchX" value`))),_=!1),this._validateStretch(y.stretchY,x&&x.height)||(this.fire(new b.k(Error(`Image "${v}" has invalid "stretchY" value`))),_=!1),this._validateContent(y.content,y)||(this.fire(new b.k(Error(`Image "${v}" has invalid "content" value`))),_=!1),_}_validateStretch(v,b){if(!v)return!0;let y=0;for(let _ of v){if(_[0]<y||_[1]<_[0]||b<_[1])return!1;y=_[1]}return!0}_validateContent(v,b){if(!v)return!0;if(4!==v.length)return!1;let y=b.spriteData,_=y&&y.width||b.data.width,x=y&&y.height||b.data.height;return!(v[0]<0||_<v[0]||v[1]<0||x<v[1]||v[2]<0||_<v[2]||v[3]<0||x<v[3]||v[2]<v[0]||v[3]<v[1])}updateImage(v,b,y=!0){let _=this.getImage(v);if(y&&(_.data.width!==b.data.width||_.data.height!==b.data.height))throw Error(`size mismatch between old image (${_.data.width}x${_.data.height}) and new image (${b.data.width}x${b.data.height}).`);b.version=_.version+1,this.images[v]=b,this.updatedImages[v]=!0}removeImage(v){let b=this.images[v];delete this.images[v],delete this.patterns[v],b.userImage&&b.userImage.onRemove&&b.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(v){return new Promise((b,y)=>{let _=!0;if(!this.isLoaded())for(let b of v)this.images[b]||(_=!1);this.isLoaded()||_?b(this._getImagesForIds(v)):this.requestors.push({ids:v,promiseResolve:b})})}_getImagesForIds(v){let y={};for(let _ of v){let v=this.getImage(_);v||(this.fire(new b.l("styleimagemissing",{id:_})),v=this.getImage(_)),v?y[_]={data:v.data.clone(),pixelRatio:v.pixelRatio,sdf:v.sdf,version:v.version,stretchX:v.stretchX,stretchY:v.stretchY,content:v.content,textFitWidth:v.textFitWidth,textFitHeight:v.textFitHeight,hasRenderCallback:!!(v.userImage&&v.userImage.render)}:b.w(`Image "${_}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return y}getPixelSize(){let{width:v,height:b}=this.atlasImage;return{width:v,height:b}}getPattern(v){let y=this.patterns[v],_=this.getImage(v);if(!_)return null;if(y&&y.position.version===_.version)return y.position;if(y)y.position.version=_.version;else{let y={w:_.data.width+2,h:_.data.height+2,x:0,y:0},x=new b.I(y,_);this.patterns[v]={bin:y,position:x}}return this._updatePatternAtlas(),this.patterns[v].position}bind(v){let y=v.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new b.T(v,this.atlasImage,y.RGBA),this.atlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE)}_updatePatternAtlas(){let v=[];for(let b in this.patterns)v.push(this.patterns[b].bin);let{w:y,h:_}=b.p(v),x=this.atlasImage;for(let v in x.resize({width:y||1,height:_||1}),this.patterns){let{bin:y}=this.patterns[v],_=y.x+1,w=y.y+1,k=this.getImage(v).data,A=k.width,C=k.height;b.R.copy(k,x,{x:0,y:0},{x:_,y:w},{width:A,height:C}),b.R.copy(k,x,{x:0,y:C-1},{x:_,y:w-1},{width:A,height:1}),b.R.copy(k,x,{x:0,y:0},{x:_,y:w+C},{width:A,height:1}),b.R.copy(k,x,{x:A-1,y:0},{x:_-1,y:w},{width:1,height:C}),b.R.copy(k,x,{x:0,y:0},{x:_+A,y:w},{width:1,height:C})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(v){for(let y of v){if(this.callbackDispatchedThisFrame[y])continue;this.callbackDispatchedThisFrame[y]=!0;let v=this.getImage(y);v||b.w(`Image with ID: "${y}" was not found`),function(v){let{userImage:b}=v;return!!(b&&b.render&&b.render())&&(v.data.replace(new Uint8Array(b.data.buffer)),!0)}(v)&&this.updateImage(y,v)}}cloneImages(){let v={};for(let b in this.images){let y=this.images[b];v[b]=Object.assign(Object.assign({},y),{data:y.data?y.data.clone():null})}return v}}function Z(v,b,y,_,x,w,k,A,C){for(let E=b;E<b+_;E++)X(v,y*w+E,w,x,k,A,C);for(let E=y;E<y+x;E++)X(v,E*w+b,1,_,k,A,C)}function X(v,b,y,_,x,w,k){w[0]=0,k[0]=-1e20,k[1]=1e20,x[0]=v[b];for(let A=1,C=0,E=0;A<_;A++){x[A]=v[b+A*y];let _=A*A;do{let v=w[C];E=(x[A]-x[v]+_-v*v)/(A-v)/2}while(E<=k[C]&&--C>-1);w[++C]=A,k[C]=E,k[C+1]=1e20}for(let A=0,C=0;A<_;A++){for(;k[C+1]<A;)C++;let _=w[C],E=A-_;v[b+A*y]=x[_]+E*E}}let K=b.v.layout_symbol["text-font"].default.join(",");class J{constructor(v,b,y){this.requestManager=v,this.localIdeographFontFamily=b,this.entries={},this.lang=y}setURL(v){this.url=v}getGlyphs(v){return b._(this,void 0,void 0,function*(){let b=[];for(let y in v)for(let _ of v[y])b.push(this._getAndCacheGlyphsPromise(y,_));let y=yield Promise.all(b),_={};for(let{stack:v,id:b,glyph:x}of y)_[v]||(_[v]={}),_[v][b]=x&&{id:x.id,bitmap:x.bitmap.clone(),metrics:x.metrics};return _})}_getAndCacheGlyphsPromise(v,y){return b._(this,void 0,void 0,function*(){let b=this.entries[v];b||(b=this.entries[v]={glyphs:{},requests:{},ranges:{}});let _=b.glyphs[y];return void 0!==_?{stack:v,id:y,glyph:_}:!this.url||this._charUsesLocalIdeographFontFamily(y)?(_=b.glyphs[y]=this._drawGlyph(b,v,y),{stack:v,id:y,glyph:_}):yield this._downloadAndCacheRangePromise(v,y)})}_downloadAndCacheRangePromise(v,y){return b._(this,void 0,void 0,function*(){let b=this.entries[v],_=Math.floor(y/256);if(b.ranges[_])return{stack:v,id:y,glyph:null};if(!b.requests[_]){let y=J.loadGlyphRange(v,_,this.url,this.requestManager);b.requests[_]=y}try{let x=yield b.requests[_];for(let v in x)b.glyphs[+v]=x[+v];return b.ranges[_]=!0,{stack:v,id:y,glyph:x[y]||null}}catch(w){let x=b.glyphs[y]=this._drawGlyph(b,v,y);return this._warnOnMissingGlyphRange(x,_,y,w),{stack:v,id:y,glyph:x}}})}_warnOnMissingGlyphRange(v,y,_,x){let w=256*y,k=_.toString(16).padStart(4,"0").toUpperCase();b.w(`Unable to load glyph range ${y}, ${w}-${w+255}. Rendering codepoint U+${k} locally instead. ${x}`)}_charUsesLocalIdeographFontFamily(v){return!!this.localIdeographFontFamily&&b.q(v)}_drawGlyph(v,y,_){let x=y===K&&""!==this.localIdeographFontFamily&&this._charUsesLocalIdeographFontFamily(_),w=x?"ideographTinySDF":"tinySDF";v[w]||(v[w]=this._createTinySDF(x?this.localIdeographFontFamily:y));let k=v[w].draw(String.fromCodePoint(_)),A=/^\p{gc=Cf}+$/u.test(String.fromCodePoint(_));return{id:_,bitmap:new b.r({width:k.width||60,height:k.height||60},k.data),metrics:{width:A?0:k.glyphWidth/2||24,height:k.glyphHeight/2||24,left:k.glyphLeft/2+.5||0,top:k.glyphTop/2-27.5||-8,advance:A?0:k.glyphAdvance/2||24,isDoubleResolution:!0}}}_createTinySDF(v){let b=v?v.split(","):[];b.push("sans-serif");let y=b.map(v=>/[-\w]+/.test(v)?v:`'${CSS.escape(v)}'`).join(",");return new J.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:y,fontWeight:this._fontWeight(b[0]),fontStyle:this._fontStyle(b[0]),lang:this.lang})}_fontStyle(v){return/italic/i.test(v)?"italic":/oblique/i.test(v)?"oblique":"normal"}_fontWeight(v){let b;for(let[y,_]of Object.entries({thin:100,hairline:100,"extra light":200,"ultra light":200,light:300,normal:400,regular:400,medium:500,semibold:600,demibold:600,bold:700,"extra bold":800,"ultra bold":800,black:900,heavy:900,"extra black":950,"ultra black":950}))RegExp(`\\b${y}\\b`,"i").test(v)&&(b=`${_}`);return b}destroy(){for(let v in this.entries){let b=this.entries[v];b.tinySDF&&(b.tinySDF=null),b.ideographTinySDF&&(b.ideographTinySDF=null),b.glyphs={},b.requests={},b.ranges={}}this.entries={}}}J.loadGlyphRange=function(v,y,_,x){return b._(this,void 0,void 0,function*(){let w=256*y,k=w+255,A=x.transformRequest(_.replace("{fontstack}",v).replace("{range}",`${w}-${k}`),"Glyphs"),C=yield b.n(A,new AbortController);if(!C||!C.data)throw Error(`Could not load glyph range. range: ${y}, ${w}-${k}`);let E={};for(let v of b.o(C.data))E[v.id]=v;return E})},J.TinySDF=class{constructor({fontSize:v=24,buffer:b=3,radius:y=8,cutoff:_=.25,fontFamily:x="sans-serif",fontWeight:w="normal",fontStyle:k="normal",lang:A=null}={}){this.buffer=b,this.cutoff=_,this.radius=y,this.lang=A;const C=this.size=v+4*b,E=this._createCanvas(C),S=this.ctx=E.getContext("2d",{willReadFrequently:!0});S.font=`${k} ${w} ${v}px ${x}`,S.textBaseline="alphabetic",S.textAlign="left",S.fillStyle="black",this.gridOuter=new Float64Array(C*C),this.gridInner=new Float64Array(C*C),this.f=new Float64Array(C),this.z=new Float64Array(C+1),this.v=new Uint16Array(C)}_createCanvas(v){let b=document.createElement("canvas");return b.width=b.height=v,b}draw(v){let{width:b,actualBoundingBoxAscent:y,actualBoundingBoxDescent:_,actualBoundingBoxLeft:x,actualBoundingBoxRight:w}=this.ctx.measureText(v),k=Math.ceil(y),A=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(w-x))),C=Math.min(this.size-this.buffer,k+Math.ceil(_)),E=A+2*this.buffer,S=C+2*this.buffer,T=Math.max(E*S,0),O=new Uint8ClampedArray(T),F={data:O,width:E,height:S,glyphWidth:A,glyphHeight:C,glyphTop:k,glyphLeft:0,glyphAdvance:b};if(0===A||0===C)return F;let{ctx:I,buffer:M,gridInner:R,gridOuter:D}=this;this.lang&&(I.lang=this.lang),I.clearRect(M,M,A,C),I.fillText(v,M,M+k);let P=I.getImageData(M,M,A,C);D.fill(1e20,0,T),R.fill(0,0,T);for(let v=0;v<C;v++)for(let b=0;b<A;b++){let y=P.data[4*(v*A+b)+3]/255;if(0===y)continue;let _=(v+M)*E+b+M;if(1===y)D[_]=0,R[_]=1e20;else{let v=.5-y;D[_]=v>0?v*v:0,R[_]=v<0?v*v:0}}Z(D,0,0,E,S,E,this.f,this.v,this.z),Z(R,M,M,A,C,E,this.f,this.v,this.z);for(let v=0;v<T;v++){let b=Math.sqrt(D[v])-Math.sqrt(R[v]);O[v]=Math.round(255-255*(b/this.radius+this.cutoff))}return F}};class Q{constructor(){this.specification=b.u.light.position}possiblyEvaluate(v,y){return b.F(v.expression.evaluate(y))}interpolate(v,y,_){return{x:b.G.number(v.x,y.x,_),y:b.G.number(v.y,y.y,_),z:b.G.number(v.z,y.z,_)}}}class ee extends b.E{constructor(v){super(),w=w||new b.t({anchor:new b.D(b.u.light.anchor),position:new Q,color:new b.D(b.u.light.color),intensity:new b.D(b.u.light.intensity)}),this._transitionable=new b.x(w,void 0),this.setLight(v),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(v,y={}){if(!this._validate(b.y,v,y))for(let y in v){let _=v[y];y.endsWith(b.z)?this._transitionable.setTransition(y.slice(0,-b.z.length),_):this._transitionable.setValue(y,_)}}updateTransitions(v){this._transitioning=this._transitionable.transitioned(v,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(v){this.properties=this._transitioning.possiblyEvaluate(v)}_validate(v,y,_){return(!_||!1!==_.validate)&&b.B(this,v.call(b.C,{value:y,style:{glyphs:!0,sprite:!0},styleSpec:b.u}))}}let et=new b.t({"sky-color":new b.D(b.u.sky["sky-color"]),"horizon-color":new b.D(b.u.sky["horizon-color"]),"fog-color":new b.D(b.u.sky["fog-color"]),"fog-ground-blend":new b.D(b.u.sky["fog-ground-blend"]),"horizon-fog-blend":new b.D(b.u.sky["horizon-fog-blend"]),"sky-horizon-blend":new b.D(b.u.sky["sky-horizon-blend"]),"atmosphere-blend":new b.D(b.u.sky["atmosphere-blend"])});class en extends b.E{constructor(v){super(),this._transitionable=new b.x(et,void 0),this.setSky(v),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new b.H(0))}setSky(v,y={}){if(!this._validate(b.J,v,y))for(let y in v||(v={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0}),v){let _=v[y];y.endsWith(b.z)?this._transitionable.setTransition(y.slice(0,-b.z.length),_):this._transitionable.setValue(y,_)}}getSky(){return this._transitionable.serialize()}updateTransitions(v){this._transitioning=this._transitionable.transitioned(v,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(v){this.properties=this._transitioning.possiblyEvaluate(v)}_validate(v,y,_={}){return!1!==(null==_?void 0:_.validate)&&b.B(this,v.call(b.C,b.e({value:y,style:{glyphs:!0,sprite:!0},styleSpec:b.u})))}calculateFogBlendOpacity(v){return v<60?0:v<70?(v-60)/10:1}}class ei{constructor(v,b){this.width=v,this.height=b,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(v,b){let y=v.join(",")+String(b);return this.dashEntry[y]||(this.dashEntry[y]=this.addDash(v,b)),this.dashEntry[y]}getDashRanges(v,b,y){let _=[],x=v.length%2==1?-v[v.length-1]*y:0,w=v[0]*y,k=!0;_.push({left:x,right:w,isDash:k,zeroLength:0===v[0]});let A=v[0];for(let b=1;b<v.length;b++){k=!k;let C=v[b];x=A*y,A+=C,w=A*y,_.push({left:x,right:w,isDash:k,zeroLength:0===C})}return _}addRoundDash(v,b,y){let _=b/2;for(let b=-y;b<=y;b++){let x=this.width*(this.nextRow+y+b),w=0,k=v[0];for(let A=0;A<this.width;A++){let C;A/k.right>1&&(k=v[++w]);let E=Math.min(Math.abs(A-k.left),Math.abs(A-k.right)),S=b/y*(_+1);if(k.isDash){let v=_-Math.abs(S);C=Math.sqrt(E*E+v*v)}else C=_-Math.sqrt(E*E+S*S);this.data[x+A]=Math.max(0,Math.min(255,C+128))}}}addRegularDash(v){for(let b=v.length-1;b>=0;--b){let y=v[b],_=v[b+1];y.zeroLength?v.splice(b,1):_&&_.isDash===y.isDash&&(_.left=y.left,v.splice(b,1))}let b=v[0],y=v[v.length-1];b.isDash===y.isDash&&(b.left=y.left-this.width,y.right=b.right+this.width);let _=this.width*this.nextRow,x=0,w=v[0];for(let b=0;b<this.width;b++){b/w.right>1&&(w=v[++x]);let y=Math.min(Math.abs(b-w.left),Math.abs(b-w.right));this.data[_+b]=Math.max(0,Math.min(255,(w.isDash?y:-y)+128))}}addDash(v,y){let _=7*!!y,x=2*_+1;if(this.nextRow+x>this.height)return b.w("LineAtlas out of space"),null;let w=0;for(let b=0;b<v.length;b++)w+=v[b];if(0!==w){let b=this.width/w,x=this.getDashRanges(v,this.width,b);y?this.addRoundDash(x,b,_):this.addRegularDash(x)}let k={y:this.nextRow+_,height:2*_,width:w};return this.nextRow+=x,this.dirty=!0,k}bind(v){let b=v.gl;this.texture?(b.bindTexture(b.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,b.texSubImage2D(b.TEXTURE_2D,0,0,0,this.width,this.height,b.ALPHA,b.UNSIGNED_BYTE,this.data))):(this.texture=b.createTexture(),b.bindTexture(b.TEXTURE_2D,this.texture),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.REPEAT),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.REPEAT),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.LINEAR),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.LINEAR),b.texImage2D(b.TEXTURE_2D,0,b.ALPHA,this.width,this.height,0,b.ALPHA,b.UNSIGNED_BYTE,this.data))}}let er="maplibre_preloaded_worker_pool";class eo{constructor(){this.active={}}acquire(v){if(!this.workers)for(this.workers=[];this.workers.length<eo.workerCount;)this.workers.push(new Worker(b.c.WORKER_URL));return this.active[v]=!0,this.workers.slice()}release(v){delete this.active[v],0===this.numActive()&&(this.workers.forEach(v=>{v.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[er]}numActive(){return Object.keys(this.active).length}}let ea=Math.floor(D.hardwareConcurrency/2);function es(){return k||(k=new eo),k}eo.workerCount=b.K(globalThis)?Math.max(Math.min(ea,3),1):1;class el{constructor(v,y){this.workerPool=v,this.actors=[],this.currentActor=0,this.id=y;const _=this.workerPool.acquire(y);for(let v=0;v<_.length;v++){const x=new b.L(_[v],y);x.name=`Worker ${v}`,this.actors.push(x)}if(!this.actors.length)throw Error("No actors found")}broadcast(v,b){let y=[];for(let _ of this.actors)y.push(_.sendAsync({type:v,data:b}));return Promise.all(y)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(v=!0){this.actors.forEach(v=>{v.remove()}),this.actors=[],v&&this.workerPool.release(this.id)}registerMessageHandler(v,b){for(let y of this.actors)y.registerMessageHandler(v,b)}unregisterMessageHandler(v){for(let b of this.actors)b.unregisterMessageHandler(v)}}function ec(){return A||(A=new el(es(),b.M)).registerMessageHandler("GR",(v,y,_)=>b.m(y,_)),A}function eu(v,b){let y=v.tileID,_=b.tileID;return y.overscaledZ-_.overscaledZ||y.canonical.y-_.canonical.y||y.wrap-_.wrap||y.canonical.x-_.canonical.x}function ed(v,b){let y=v.feature,_=b.getFeatureState(y.layer["source-layer"],y.id);y.source=y.layer.source,y.layer["source-layer"]&&(y.sourceLayer=y.layer["source-layer"]),y.state=_}function eh(v,y,_,x){return b._(this,void 0,void 0,function*(){let w=v;if(v.url?w=(yield b.j(y.transformRequest(v.url,"Source"),_)).data:yield D.frameAsync(_,x),!w)return null;let k=b.U(b.e(w,v),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in w&&w.vector_layers&&(k.vectorLayerIds=w.vector_layers.map(v=>v.id)),k})}class ep{constructor(v,b){v&&(b?this.setSouthWest(v).setNorthEast(b):Array.isArray(v)&&(4===v.length?this.setSouthWest([v[0],v[1]]).setNorthEast([v[2],v[3]]):this.setSouthWest(v[0]).setNorthEast(v[1])))}setNorthEast(v){return this._ne=v instanceof b.V?new b.V(v.lng,v.lat):b.V.convert(v),this}setSouthWest(v){return this._sw=v instanceof b.V?new b.V(v.lng,v.lat):b.V.convert(v),this}extend(v){let y,_,x=this._sw,w=this._ne;if(v instanceof b.V)y=v,_=v;else{if(!(v instanceof ep))return Array.isArray(v)?4===v.length||v.every(Array.isArray)?this.extend(ep.convert(v)):this.extend(b.V.convert(v)):v&&("lng"in v||"lon"in v)&&"lat"in v?this.extend(b.V.convert(v)):this;if(y=v._sw,_=v._ne,!y||!_)return this}return x||w?(x.lng=Math.min(y.lng,x.lng),x.lat=Math.min(y.lat,x.lat),w.lng=Math.max(_.lng,w.lng),w.lat=Math.max(_.lat,w.lat)):(this._sw=new b.V(y.lng,y.lat),this._ne=new b.V(_.lng,_.lat)),this}getCenter(){return new b.V((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new b.V(this.getWest(),this.getNorth())}getSouthEast(){return new b.V(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(v){let{lng:y,lat:_}=b.V.convert(v),x=this._sw.lng<=y&&y<=this._ne.lng;return this._sw.lng>this._ne.lng&&(x=this._sw.lng>=y&&y>=this._ne.lng),this._sw.lat<=_&&_<=this._ne.lat&&x}intersects(v){if(!((v=ep.convert(v)).getNorth()>=this.getSouth()&&v.getSouth()<=this.getNorth()))return!1;let y=Math.abs(this.getEast()-this.getWest()),_=Math.abs(v.getEast()-v.getWest());if(y>=360||_>=360)return!0;let x=b.W(this.getWest(),-180,180),w=b.W(this.getEast(),-180,180),k=b.W(v.getWest(),-180,180),A=b.W(v.getEast(),-180,180),C=x>w,E=k>A;return!(!C||!E)||(C?A>=x||k<=w:E?w>=k||x<=A:k<=w&&A>=x)}static convert(v){return v instanceof ep?v:v?new ep(v):v}static fromLngLat(v,y=0){let _=360*y/0x2637f09,x=_/Math.cos(Math.PI/180*v.lat);return new ep(new b.V(v.lng-x,v.lat-_),new b.V(v.lng+x,v.lat+_))}adjustAntiMeridian(){let v=new b.V(this._sw.lng,this._sw.lat),y=new b.V(this._ne.lng,this._ne.lat);return new ep(v,v.lng>y.lng?new b.V(y.lng+360,y.lat):y)}}class ef{constructor(v,b,y){this.bounds=ep.convert(this.validateBounds(v)),this.minzoom=b||0,this.maxzoom=y||24}validateBounds(v){return Array.isArray(v)&&4===v.length?[Math.max(-180,v[0]),Math.max(-90,v[1]),Math.min(180,v[2]),Math.min(90,v[3])]:[-180,-90,180,90]}contains(v){let y=Math.pow(2,v.z),_=Math.floor(b.Y(this.bounds.getWest())*y),x=Math.floor(b.X(this.bounds.getNorth())*y),w=Math.ceil(b.Y(this.bounds.getEast())*y),k=Math.ceil(b.X(this.bounds.getSouth())*y);return v.x>=_&&v.x<w&&v.y>=x&&v.y<k}}class em extends b.E{constructor(v,y,_,x){if(super(),this.id=v,this.dispatcher=_,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,b.e(this,b.U(y,["url","scheme","tileSize","promoteId","encoding"])),this._options=b.e({type:"vector"},y),this._collectResourceTiming=y.collectResourceTiming,512!==this.tileSize)throw Error("vector tile sources must have a tileSize of 512");this.setEventedParent(x)}load(){return b._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new b.l("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let v=yield eh(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,this.map.style.tileManagers[this.id].clearTiles(),v&&(b.e(this,v),v.bounds&&(this.tileBounds=new ef(v.bounds,this.minzoom,this.maxzoom)),this.fire(new b.l("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new b.l("data",{dataType:"source",sourceDataType:"content"})))}catch(v){this._tileJSONRequest=null,this._loaded=!0,b.Z(v)||this.fire(new b.k(v))}})}loaded(){return this._loaded}hasTile(v){return!this.tileBounds||this.tileBounds.contains(v.canonical)}onAdd(v){this.map=v,this.load()}setSourceProperty(v){this._tileJSONRequest&&this._tileJSONRequest.abort(),v(),this.load()}setTiles(v){return this.setSourceProperty(()=>{this._options.tiles=v}),this}setUrl(v){return this.setSourceProperty(()=>{this.url=v,this._options.url=v}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return b.e({},this._options)}loadTile(v){return b._(this,void 0,void 0,function*(){let b=v.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),y={request:this.map._requestManager.transformRequest(b,"Tile"),uid:v.uid,tileID:v.tileID,zoom:v.tileID.overscaledZ,tileSize:this.tileSize*v.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity,encoding:this.encoding,overzoomParameters:this._getOverzoomParameters(v)};y.request.collectResourceTiming=this._collectResourceTiming;let _="RT";if(v.actor&&"expired"!==v.state){if("loading"===v.state)return new Promise((b,y)=>{v.reloadPromise={resolve:b,reject:y}})}else v.actor=this.dispatcher.getActor(),_="LT";v.abortController=new AbortController;try{let b=yield v.actor.sendAsync({type:_,data:y},v.abortController);if(delete v.abortController,v.aborted)return;this._afterTileLoadWorkerResponse(v,b)}catch(b){if(delete v.abortController,v.aborted)return;if(b&&404!==b.status)throw b;this._afterTileLoadWorkerResponse(v,null)}})}_getOverzoomParameters(v){if(v.tileID.canonical.z<=this.maxzoom||void 0===this.map._zoomLevelsToOverscale)return;let b=v.tileID.scaledTo(this.maxzoom).canonical,y=b.url(this.tiles,this.map.getPixelRatio(),this.scheme);return{maxZoomTileID:b,overzoomRequest:this.map._requestManager.transformRequest(y,"Tile")}}_afterTileLoadWorkerResponse(v,b){if(b&&b.resourceTiming&&(v.resourceTiming=b.resourceTiming),b&&this.map._refreshExpiredTiles&&v.setExpiryData(b),v.loadVectorData(b,this.map.painter),v.reloadPromise){let b=v.reloadPromise;v.reloadPromise=null,this.loadTile(v).then(b.resolve).catch(b.reject)}}abortTile(v){return b._(this,void 0,void 0,function*(){v.abortController&&(v.abortController.abort(),delete v.abortController),v.actor&&(yield v.actor.sendAsync({type:"AT",data:{uid:v.uid,type:this.type,source:this.id}}))})}unloadTile(v){return b._(this,void 0,void 0,function*(){v.unloadVectorData(),v.actor&&(yield v.actor.sendAsync({type:"RMT",data:{uid:v.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class eg extends b.E{constructor(v,y,_,x){super(),this.id=v,this.dispatcher=_,this.setEventedParent(x),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=b.e({type:"raster"},y),b.e(this,b.U(y,["url","scheme","tileSize"]))}load(){return b._(this,arguments,void 0,function*(v=!1){this._loaded=!1,this.fire(new b.l("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let y=yield eh(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,y&&(b.e(this,y),y.bounds&&(this.tileBounds=new ef(y.bounds,this.minzoom,this.maxzoom)),this.fire(new b.l("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new b.l("data",{dataType:"source",sourceDataType:"content",sourceDataChanged:v})))}catch(v){this._tileJSONRequest=null,this._loaded=!0,b.Z(v)||this.fire(new b.k(v))}})}loaded(){return this._loaded}onAdd(v){this.map=v,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(v){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),v(),this.load(!0)}setTiles(v){return this.setSourceProperty(()=>{this._options.tiles=v}),this}setUrl(v){return this.setSourceProperty(()=>{this.url=v,this._options.url=v}),this}serialize(){return b.e({},this._options)}hasTile(v){return!this.tileBounds||this.tileBounds.contains(v.canonical)}loadTile(v){return b._(this,void 0,void 0,function*(){let y=v.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);v.abortController=new AbortController;try{let _=yield O.getImage(this.map._requestManager.transformRequest(y,"Tile"),v.abortController,this.map._refreshExpiredTiles);if(delete v.abortController,v.aborted)return void(v.state="unloaded");if(_&&_.data){this.map._refreshExpiredTiles&&(_.cacheControl||_.expires)&&v.setExpiryData({cacheControl:_.cacheControl,expires:_.expires});let y=this.map.painter.context,x=y.gl,w=_.data;v.texture=this.map.painter.getTileTexture(w.width),v.texture?v.texture.update(w,{useMipmap:!0}):(v.texture=new b.T(y,w,x.RGBA,{useMipmap:!0}),v.texture.bind(x.LINEAR,x.CLAMP_TO_EDGE,x.LINEAR_MIPMAP_NEAREST)),v.state="loaded"}}catch(b){if(delete v.abortController,v.aborted)v.state="unloaded";else if(b)throw v.state="errored",b}})}abortTile(v){return b._(this,void 0,void 0,function*(){v.abortController&&(v.abortController.abort(),delete v.abortController)})}unloadTile(v){return b._(this,void 0,void 0,function*(){v.texture&&this.map.painter.saveTileTexture(v.texture)})}hasTransition(){return!1}}class ev extends eg{constructor(v,y,_,x){super(v,y,_,x),this.type="raster-dem",this.maxzoom=22,this._options=b.e({type:"raster-dem"},y),this.encoding=y.encoding||"mapbox",this.redFactor=y.redFactor,this.greenFactor=y.greenFactor,this.blueFactor=y.blueFactor,this.baseShift=y.baseShift}loadTile(v){return b._(this,void 0,void 0,function*(){let y=v.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),_=this.map._requestManager.transformRequest(y,"Tile");v.neighboringTiles=this._getNeighboringTiles(v.tileID),v.abortController=new AbortController;try{let y=yield O.getImage(_,v.abortController,this.map._refreshExpiredTiles);if(delete v.abortController,v.aborted)return void(v.state="unloaded");if(y&&y.data){let _=y.data;this.map._refreshExpiredTiles&&(y.cacheControl||y.expires)&&v.setExpiryData({cacheControl:y.cacheControl,expires:y.expires});let x=b.b(_)&&b.$()?_:yield this.readImageNow(_),w={type:this.type,uid:v.uid,source:this.id,rawImageData:x,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!v.actor||"expired"===v.state){v.actor=this.dispatcher.getActor();let b=yield v.actor.sendAsync({type:"LDT",data:w});v.dem=b,v.needsHillshadePrepare=!0,v.needsTerrainPrepare=!0,v.state="loaded"}}}catch(b){if(delete v.abortController,v.aborted)v.state="unloaded";else if(b)throw v.state="errored",b}})}readImageNow(v){return b._(this,void 0,void 0,function*(){if("u">typeof VideoFrame&&b.a0()){let y=v.width+2,_=v.height+2;try{return new b.R({width:y,height:_},(yield b.a1(v,-1,-1,y,_)))}catch(v){}}return D.getImageData(v,1)})}_getNeighboringTiles(v){let y=v.canonical,_=Math.pow(2,y.z),x=(y.x-1+_)%_,w=0===y.x?v.wrap-1:v.wrap,k=(y.x+1+_)%_,A=y.x+1===_?v.wrap+1:v.wrap,C={};return C[new b.a2(v.overscaledZ,w,y.z,x,y.y).key]={backfilled:!1},C[new b.a2(v.overscaledZ,A,y.z,k,y.y).key]={backfilled:!1},y.y>0&&(C[new b.a2(v.overscaledZ,w,y.z,x,y.y-1).key]={backfilled:!1},C[new b.a2(v.overscaledZ,v.wrap,y.z,y.x,y.y-1).key]={backfilled:!1},C[new b.a2(v.overscaledZ,A,y.z,k,y.y-1).key]={backfilled:!1}),y.y+1<_&&(C[new b.a2(v.overscaledZ,w,y.z,x,y.y+1).key]={backfilled:!1},C[new b.a2(v.overscaledZ,v.wrap,y.z,y.x,y.y+1).key]={backfilled:!1},C[new b.a2(v.overscaledZ,A,y.z,k,y.y+1).key]={backfilled:!1}),C}unloadTile(v){return b._(this,void 0,void 0,function*(){v.demTexture&&this.map.painter.saveTileTexture(v.demTexture),v.fbo&&(v.fbo.destroy(),delete v.fbo),v.dem&&delete v.dem,delete v.neighboringTiles,v.state="unloaded",v.actor&&(yield v.actor.sendAsync({type:"RDT",data:{type:this.type,uid:v.uid,source:this.id}}))})}}function eb(v){return"GeometryCollection"===v.type?v.geometries.flatMap(v=>eb(v)):function v(b){return b&&0!==b.length?"number"==typeof b[0]?[b]:b.flatMap(b=>v(b)):[]}(v.coordinates)}function ey(v){let b,y=new ep;switch(v.type){case"FeatureCollection":b=v.features.flatMap(v=>eb(v.geometry));break;case"Feature":b=eb(v.geometry);break;default:b=eb(v)}if(0===b.length)return y;for(let v=0;v<b.length;v++){let[_,x]=b[v];y.extend([_,x])}return y}class e_ extends b.E{constructor(v,y,_,x){super(),this.id=v,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._isUpdatingWorker=!1,this._pendingWorkerUpdate={data:y.data},this.actor=_.getActor(),this.setEventedParent(x),this._data="string"==typeof y.data?{url:y.data}:{geojson:y.data},this._options=b.e({},y),this._collectResourceTiming=y.collectResourceTiming,void 0!==y.maxzoom&&(this.maxzoom=y.maxzoom),y.type&&(this.type=y.type),y.attribution&&(this.attribution=y.attribution),this.promoteId=y.promoteId,void 0!==y.clusterMaxZoom&&this.maxzoom<=y.clusterMaxZoom&&b.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${y.clusterMaxZoom}".`),this.workerOptions=b.e({source:this.id,cluster:y.cluster||!1,geojsonVtOptions:{buffer:this._pixelsToTileUnits(void 0!==y.buffer?y.buffer:128),tolerance:this._pixelsToTileUnits(void 0!==y.tolerance?y.tolerance:.375),extent:b.a5,maxZoom:this.maxzoom,lineMetrics:y.lineMetrics||!1,generateId:y.generateId||!1},superclusterOptions:{maxZoom:this._getClusterMaxZoom(y.clusterMaxZoom),minPoints:Math.max(2,y.clusterMinPoints||2),extent:b.a5,radius:this._pixelsToTileUnits(y.clusterRadius||50),log:!1,generateId:y.generateId||!1},clusterProperties:y.clusterProperties,filter:y.filter},y.workerOptions),"string"==typeof this.promoteId&&(this.workerOptions.promoteId=this.promoteId)}_hasPendingWorkerUpdate(){return void 0!==this._pendingWorkerUpdate.data||void 0!==this._pendingWorkerUpdate.diff||this._pendingWorkerUpdate.optionsChanged}_pixelsToTileUnits(v){return v*(b.a5/this.tileSize)}_getClusterMaxZoom(v){let y=v?Math.round(v):this.maxzoom-1;return Number.isInteger(v)||void 0===v||b.w(`Integer expected for option 'clusterMaxZoom': provided value "${v}" rounded to "${y}"`),y}load(){return b._(this,void 0,void 0,function*(){yield this._updateWorkerData()})}onAdd(v){this.map=v,this.load()}setData(v,b){this._data="string"==typeof v?{url:v}:{geojson:v},this._pendingWorkerUpdate={data:v};let y=this._updateWorkerData();return b?y:this}updateData(v,y){this._pendingWorkerUpdate.diff=b.a6(this._pendingWorkerUpdate.diff,v);let _=this._updateWorkerData();return y?_:this}getData(){return b._(this,void 0,void 0,function*(){let v=b.e({type:this.type},this.workerOptions);return this.actor.sendAsync({type:"GD",data:v})})}getBounds(){return b._(this,void 0,void 0,function*(){return ey((yield this.getData()))})}setClusterOptions(v){return this.workerOptions.cluster=v.cluster,void 0!==v.clusterRadius&&(this.workerOptions.superclusterOptions.radius=this._pixelsToTileUnits(v.clusterRadius)),void 0!==v.clusterMaxZoom&&(this.workerOptions.superclusterOptions.maxZoom=this._getClusterMaxZoom(v.clusterMaxZoom)),this._pendingWorkerUpdate.optionsChanged=!0,this._updateWorkerData(),this}getClusterExpansionZoom(v){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:v,source:this.id}})}getClusterChildren(v){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:v,source:this.id}})}getClusterLeaves(v,b,y){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:v,limit:b,offset:y}})}_updateWorkerData(){return b._(this,void 0,void 0,function*(){if(this._isUpdatingWorker)return;if(!this._hasPendingWorkerUpdate())return void b.w(`No pending worker updates for GeoJSONSource ${this.id}.`);let{data:v,diff:y}=this._pendingWorkerUpdate,_=this._getLoadGeoJSONParameters(v,y);void 0!==v?this._pendingWorkerUpdate.data=void 0:y&&(this._pendingWorkerUpdate.diff=void 0),this._pendingWorkerUpdate.optionsChanged=void 0,yield this._dispatchWorkerUpdate(_)})}_getLoadGeoJSONParameters(v,y){let _=b.e({type:this.type},this.workerOptions);return"string"==typeof v?(_.request=this.map._requestManager.transformRequest(D.resolveURL(v),"Source"),_.request.collectResourceTiming=this._collectResourceTiming):void 0!==v?_.data=v:y&&(_.dataDiff=y),_}_dispatchWorkerUpdate(v){return b._(this,void 0,void 0,function*(){this._isUpdatingWorker=!0,this.fire(new b.l("dataloading",{dataType:"source"}));try{let y=yield this.actor.sendAsync({type:"LD",data:v});if(this._isUpdatingWorker=!1,this._removed||y.abandoned)return void this.fire(new b.l("dataabort",{dataType:"source"}));y.data&&(this._data={geojson:y.data});let _=this._applyDiffToSource(v.dataDiff),x=this._getShouldReloadTileOptions(_),w={dataType:"source"};this._applyResourceTiming(w,y),this.fire(new b.l("data",Object.assign(Object.assign({},w),{sourceDataType:"metadata"}))),this.fire(new b.l("data",Object.assign(Object.assign({},w),{sourceDataType:"content",shouldReloadTileOptions:x})))}catch(v){if(this._isUpdatingWorker=!1,this._removed)return void this.fire(new b.l("dataabort",{dataType:"source"}));this.fire(new b.k(v))}finally{this._hasPendingWorkerUpdate()&&this._updateWorkerData()}})}_applyResourceTiming(v,y){var _;if(!this._collectResourceTiming)return;let x=null==(_=y.resourceTiming)?void 0:_[this.id];if(!x)return;let w=x.slice(0);(null==w?void 0:w.length)&&b.e(v,{resourceTiming:w})}_applyDiffToSource(v){if(!v)return;let y="string"==typeof this.promoteId?this.promoteId:void 0;if(!this._data.url&&!this._data.updateable){let v=b.a7(this._data.geojson,y);if(!v)throw Error(`GeoJSONSource "${this.id}": GeoJSON data is not compatible with updateData`);this._data={updateable:v}}if(!this._data.updateable)return;let _=b.a8(this._data.updateable,v,y);return v.removeAll||this._options.cluster?void 0:_}_getShouldReloadTileOptions(v){if(v)return{affectedBounds:v.filter(Boolean).map(v=>ey(v))}}shouldReloadTile(v,{affectedBounds:y}){if("loading"===v.state)return!0;if("unloaded"===v.state)return!1;let{buffer:_,extent:x}=this.workerOptions.geojsonVtOptions,w=function({x:v,y:y,z:_},x=0){return new ep([b.a3((v-x)/Math.pow(2,_)),b.a4((y+1+x)/Math.pow(2,_))],[b.a3((v+1+x)/Math.pow(2,_)),b.a4((y-x)/Math.pow(2,_))])}(v.tileID.canonical,_/x);for(let v of y)if(w.intersects(v))return!0;return!1}loaded(){return!this._isUpdatingWorker&&!this._hasPendingWorkerUpdate()}loadTile(v){return b._(this,void 0,void 0,function*(){let b=v.actor?"RT":"LT";v.actor=this.actor;let y={type:this.type,uid:v.uid,tileID:v.tileID,zoom:v.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity};v.abortController=new AbortController;let _=yield this.actor.sendAsync({type:b,data:y},v.abortController);delete v.abortController,v.unloadVectorData(),v.aborted||v.loadVectorData(_,this.map.painter,"RT"===b)})}abortTile(v){return b._(this,void 0,void 0,function*(){v.abortController&&(v.abortController.abort(),delete v.abortController),v.aborted=!0})}unloadTile(v){return b._(this,void 0,void 0,function*(){v.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:v.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return b.e({},this._options,{type:this.type,data:this._data.updateable?{type:"FeatureCollection",features:Array.from(this._data.updateable.values())}:this._data.url||this._data.geojson})}hasTransition(){return!1}}class ex extends b.E{constructor(v,b,y,_){super(),this.flippedWindingOrder=!1,this.id=v,this.dispatcher=y,this.coordinates=b.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(_),this.options=b}load(v){return b._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new b.l("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{let b=yield O.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,b&&b.data&&(this.image=b.data,v&&(this.coordinates=v),this._finishLoading())}catch(v){this._request=null,this._loaded=!0,b.Z(v)||this.fire(new b.k(v))}})}loaded(){return this._loaded}updateImage(v){return v.url&&(this._request&&(this._request.abort(),this._request=null),this.options.url=v.url,this.load(v.coordinates).finally(()=>{this.texture=null})),this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new b.l("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(v){this.map=v,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(v){var y;let _,x,w;this.coordinates=v;let k=v.map(b.a9.fromLngLat);return this.tileID=(w=Math.pow(2,x=Math.max(0,Math.floor(-Math.log(Math.max((_=b.aa.fromPoints(k)).width(),_.height()))/Math.LN2))),new b.ac(x,Math.floor((_.minX+_.maxX)/2*w),Math.floor((_.minY+_.maxY)/2*w))),this.terrainTileRanges=this._getOverlappingTileRanges(k),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=k.map(v=>this.tileID.getTilePoint(v)._round()),this.flippedWindingOrder=((y=this.tileCoords)[1].x-y[0].x)*(y[2].y-y[0].y)-(y[1].y-y[0].y)*(y[2].x-y[0].x)<0,this.fire(new b.l("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;let v=this.map.painter.context,y=v.gl;this.texture||(this.texture=new b.T(v,this.image,y.RGBA),this.texture.bind(y.LINEAR,y.CLAMP_TO_EDGE));let _=!1;for(let v in this.tiles){let b=this.tiles[v];"loaded"!==b.state&&(b.state="loaded",b.texture=this.texture,_=!0)}_&&this.fire(new b.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(v){return b._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(v.tileID.canonical)?(this.tiles[String(v.tileID.wrap)]=v,v.buckets={}):v.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}_getOverlappingTileRanges(v){let{minX:y,minY:_,maxX:x,maxY:w}=b.aa.fromPoints(v),k={};for(let v=0;v<=b.ab;v++){let b=Math.pow(2,v),A=Math.floor(y*b),C=Math.floor(_*b),E=Math.floor(x*b),S=Math.floor(w*b),T=(A%b+b)%b,O=E%b,F=Math.floor(A/b),I=Math.floor(E/b);k[v]={minWrap:F,maxWrap:I,minTileXWrapped:T,maxTileXWrapped:O,minTileY:C,maxTileY:S}}return k}}class ew extends ex{constructor(v,b,y,_){super(v,b,y,_),this.roundZoom=!0,this.type="video",this.options=b}load(){return b._(this,void 0,void 0,function*(){this._loaded=!1;let v=this.options;for(let b of(this.urls=[],v.urls))this.urls.push(this.map._requestManager.transformRequest(b,"Source").url);try{let v=yield b.ad(this.urls);if(this._loaded=!0,!v)return;this.video=v,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(v){this.fire(new b.k(v))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(v){if(this.video){let y=this.video.seekable;v<y.start(0)||v>y.end(0)?this.fire(new b.k(new b.ae(`sources.${this.id}`,null,`Playback for this video can be set only between the ${y.start(0)} and ${y.end(0)}-second mark.`))):this.video.currentTime=v}}getVideo(){return this.video}onAdd(v){this.map||(this.map=v,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;let v=this.map.painter.context,y=v.gl;this.texture?this.video.paused||(this.texture.bind(y.LINEAR,y.CLAMP_TO_EDGE),y.texSubImage2D(y.TEXTURE_2D,0,0,0,y.RGBA,y.UNSIGNED_BYTE,this.video)):(this.texture=new b.T(v,this.video,y.RGBA),this.texture.bind(y.LINEAR,y.CLAMP_TO_EDGE));let _=!1;for(let v in this.tiles){let b=this.tiles[v];"loaded"!==b.state&&(b.state="loaded",b.texture=this.texture,_=!0)}_&&this.fire(new b.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class ek extends ex{constructor(v,y,_,x){super(v,y,_,x),y.coordinates?Array.isArray(y.coordinates)&&4===y.coordinates.length&&!y.coordinates.some(v=>!Array.isArray(v)||2!==v.length||v.some(v=>"number"!=typeof v))||this.fire(new b.k(new b.ae(`sources.${v}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new b.k(new b.ae(`sources.${v}`,null,'missing required property "coordinates"'))),y.animate&&"boolean"!=typeof y.animate&&this.fire(new b.k(new b.ae(`sources.${v}`,null,'optional "animate" property must be a boolean value'))),y.canvas?"string"==typeof y.canvas||y.canvas instanceof HTMLCanvasElement||this.fire(new b.k(new b.ae(`sources.${v}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new b.k(new b.ae(`sources.${v}`,null,'missing required property "canvas"'))),this.options=y,this.animate=void 0===y.animate||y.animate}load(){return b._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new b.k(Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())})}getCanvas(){return this.canvas}onAdd(v){this.map=v,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let v=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,v=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,v=!0),this._hasInvalidDimensions()||0===Object.keys(this.tiles).length)return;let y=this.map.painter.context,_=y.gl;this.texture?(v||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):(this.texture=new b.T(y,this.canvas,_.RGBA,{premultiply:!0}),this.texture.bind(_.LINEAR,_.CLAMP_TO_EDGE));let x=!1;for(let v in this.tiles){let b=this.tiles[v];"loaded"!==b.state&&(b.state="loaded",b.texture=this.texture,x=!0)}x&&this.fire(new b.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",animate:this.animate,canvas:this.options.canvas,coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let v of[this.canvas.width,this.canvas.height])if(isNaN(v)||v<=0)return!0;return!1}}let eA={},eC=v=>{switch(v){case"geojson":return e_;case"image":return ex;case"raster":return eg;case"raster-dem":return ev;case"vector":return em;case"video":return ew;case"canvas":return ek}return eA[v]},eE="RTLPluginLoaded";class eS extends b.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=ec()}_syncState(v){return this.status=v,this.dispatcher.broadcast("SRPS",{pluginStatus:v,pluginURL:this.url}).catch(v=>{throw this.status="error",v})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(v){return b._(this,arguments,void 0,function*(v,b=!1){if(this.url)throw Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=D.resolveURL(v),!this.url)throw Error(`requested url ${v} is invalid`);if("unavailable"===this.status){if(!b)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if("requested"===this.status)return this._requestImport()})}_requestImport(){return b._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new b.l(eE))})}lazyLoad(){"unavailable"===this.status?this.status="requested":"deferred"===this.status&&this._requestImport()}}let eT=null;function eO(){return eT||(eT=new eS),eT}(S=F||(F={}))[S.Base=0]="Base",S[S.Parent=1]="Parent",(T=I||(I={}))[T.Departing=0]="Departing",T[T.Incoming=1]="Incoming";class eF{constructor(v,y){this.timeAdded=0,this.fadeEndTime=0,this.fadeOpacity=1,this.tileID=v,this.uid=b.af(),this.uses=0,this.tileSize=y,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttFingerprint={},this.expiredRequestCount=0,this.state="loading"}isRenderable(v){return this.hasData()&&(!this.fadeEndTime||this.fadeOpacity>0)&&(v||!this.holdingForSymbolFade())}setCrossFadeLogic({fadingRole:v,fadingDirection:b,fadingParentID:y,fadeEndTime:_}){this.resetFadeLogic(),this.fadingRole=v,this.fadingDirection=b,this.fadingParentID=y,this.fadeEndTime=_}setSelfFadeLogic(v){this.resetFadeLogic(),this.selfFading=!0,this.fadeEndTime=v}resetFadeLogic(){this.fadingRole=null,this.fadingDirection=null,this.fadingParentID=null,this.selfFading=!1,this.timeAdded=L(),this.fadeEndTime=0,this.fadeOpacity=1}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}clearTextures(v){this.demTexture&&v.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(v,y,_){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",v){for(let x in v.featureIndex&&(this.latestFeatureIndex=v.featureIndex,v.rawTileData?(this.latestRawTileData=v.rawTileData,this.latestFeatureIndex.rawTileData=v.rawTileData,this.latestFeatureIndex.encoding=v.encoding):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData,this.latestFeatureIndex.encoding=this.latestEncoding)),this.collisionBoxArray=v.collisionBoxArray,this.buckets=function(v,b){let y={};if(!b)return y;for(let _ of v){let v=_.layerIds.map(v=>b.getLayer(v)).filter(Boolean);if(0!==v.length)for(let b of(_.layers=v,_.stateDependentLayerIds&&(_.stateDependentLayers=_.stateDependentLayerIds.map(b=>v.filter(v=>v.id===b)[0])),v))y[b.id]=_}return y}(v.buckets,null==y?void 0:y.style),this.hasSymbolBuckets=!1,this.buckets){let v=this.buckets[x];if(v instanceof b.ah){if(this.hasSymbolBuckets=!0,!_)break;v.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let v in this.buckets){let y=this.buckets[v];if(y instanceof b.ah&&y.hasRTLText){this.hasRTLText=!0,eO().lazyLoad();break}}for(let v in this.queryPadding=0,this.buckets){let b=this.buckets[v];this.queryPadding=Math.max(this.queryPadding,y.style.getLayer(v).queryRadius(b))}v.imageAtlas&&(this.imageAtlas=v.imageAtlas),v.glyphAtlasImage&&(this.glyphAtlasImage=v.glyphAtlasImage),this.dashPositions=v.dashPositions}else this.collisionBoxArray=new b.ag}unloadVectorData(){for(let v in this.buckets)this.buckets[v].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.dashPositions&&(this.dashPositions=null),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(v){return this.buckets[v.id]}upload(v){for(let b in this.buckets){let y=this.buckets[b];y.uploadPending()&&y.upload(v)}let y=v.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new b.T(v,this.imageAtlas.image,y.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new b.T(v,this.glyphAtlasImage,y.ALPHA),this.glyphAtlasImage=null)}prepare(v){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(v,this.imageAtlasTexture)}queryRenderedFeatures(v,b,y,_,x,w,k,A,C,E,S){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:_,cameraQueryGeometry:x,scale:w,tileSize:this.tileSize,pixelPosMatrix:E,transform:A,params:k,queryPadding:this.queryPadding*C,getElevation:S},v,b,y):{}}querySourceFeatures(v,y){let _=this.latestFeatureIndex;if(!_||!_.rawTileData)return;let x=_.loadVTLayers(),w=y&&y.sourceLayer?y.sourceLayer:"",k=x[b.ai]||x[w];if(!k)return;let A=b.aj(null==y?void 0:y.filter,null==y?void 0:y.globalState),{z:C,x:E,y:S}=this.tileID.canonical,T={z:C,x:E,y:S};for(let y=0;y<k.length;y++){let x=k.feature(y);if(A.needGeometry){let v=b.ak(x,!0);if(!A.filter(new b.H(this.tileID.overscaledZ),v,this.tileID.canonical))continue}else if(!A.filter(new b.H(this.tileID.overscaledZ),x))continue;let O=_.getId(x,w),F=new b.al(x,C,E,S,O);F.tile=T,v.push(F)}}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(v){let y=this.expirationTime;if(v.cacheControl){let y=b.am(v.cacheControl);y["max-age"]&&(this.expirationTime=Date.now()+1e3*y["max-age"])}else v.expires&&(this.expirationTime=new Date(v.expires).getTime());if(this.expirationTime){let v=Date.now(),b=!1;if(this.expirationTime>v)b=!1;else if(y)if(this.expirationTime<y)b=!0;else{let _=this.expirationTime-y;_?this.expirationTime=v+Math.max(_,3e4):b=!0}else b=!0;b?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),0x7fffffff)}setFeatureState(v,y){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||0===Object.keys(v).length)return;let _=this.latestFeatureIndex.loadVTLayers();for(let x in this.buckets){if(!y.style.hasLayer(x))continue;let w=this.buckets[x],k=w.layers[0].sourceLayer||b.ai,A=_[k],C=v[k];if(!A||!C||0===Object.keys(C).length)continue;w.update(C,A,this.imageAtlas&&this.imageAtlas.patternPositions||{},this.dashPositions||{});let E=y&&y.style&&y.style.getLayer(x);E&&(this.queryPadding=Math.max(this.queryPadding,E.queryRadius(w)))}}holdingForSymbolFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<L()}clearSymbolFadeHold(){this.symbolFadeHoldUntil=void 0}setSymbolHoldDuration(v){this.symbolFadeHoldUntil=L()+v}setDependencies(v,b){let y={};for(let v of b)y[v]=!0;this.dependencies[v]=y}hasDependency(v,b){for(let y of v){let v=this.dependencies[y];if(v){for(let y of b)if(v[y])return!0}}return!1}}class eI{constructor(){this.state={},this.stateChanges={},this.deletedStates={},this.revision=0}updateState(v,y,_){let x=String(y);if(this.stateChanges[v]=this.stateChanges[v]||{},this.stateChanges[v][x]=this.stateChanges[v][x]||{},b.e(this.stateChanges[v][x],_),null===this.deletedStates[v])for(let b in this.deletedStates[v]={},this.state[v])b!==x&&(this.deletedStates[v][b]=null);else if(this.deletedStates[v]&&null===this.deletedStates[v][x])for(let b in this.deletedStates[v][x]={},this.state[v][x])_[b]||(this.deletedStates[v][x][b]=null);else for(let b in _)this.deletedStates[v]&&this.deletedStates[v][x]&&null===this.deletedStates[v][x][b]&&delete this.deletedStates[v][x][b]}removeFeatureState(v,b,y){if(null===this.deletedStates[v])return;let _=String(b);if(this.deletedStates[v]=this.deletedStates[v]||{},y&&void 0!==b)null!==this.deletedStates[v][_]&&(this.deletedStates[v][_]=this.deletedStates[v][_]||{},this.deletedStates[v][_][y]=null);else if(void 0!==b)if(this.stateChanges[v]&&this.stateChanges[v][_])for(y in this.deletedStates[v][_]={},this.stateChanges[v][_])this.deletedStates[v][_][y]=null;else this.deletedStates[v][_]=null;else this.deletedStates[v]=null}getState(v,y){let _=String(y),x=b.e({},(this.state[v]||{})[_],(this.stateChanges[v]||{})[_]);if(null===this.deletedStates[v])return{};if(this.deletedStates[v]){let b=this.deletedStates[v][y];if(null===b)return{};for(let v in b)delete x[v]}return x}initializeTileState(v,b){v.setFeatureState(this.state,b)}coalesceChanges(v,y){let _={};for(let v in this.stateChanges){this.state[v]=this.state[v]||{};let y={};for(let _ in this.stateChanges[v])this.state[v][_]||(this.state[v][_]={}),b.e(this.state[v][_],this.stateChanges[v][_]),y[_]=this.state[v][_];_[v]=y}for(let v in this.deletedStates){this.state[v]=this.state[v]||{};let y={};if(null===this.deletedStates[v])for(let b in this.state[v])y[b]={},this.state[v][b]={};else for(let b in this.deletedStates[v]){if(null===this.deletedStates[v][b])this.state[v][b]={};else for(let y of Object.keys(this.deletedStates[v][b]))delete this.state[v][b][y];y[b]=this.state[v][b]}_[v]=_[v]||{},b.e(_[v],y)}this.stateChanges={},this.deletedStates={},0!==Object.keys(_).length&&(this.revision++,v.setFeatureState(_,y))}}function eM(v,y){let _=b.an(y.lat,-b.ao,b.ao);return new b.P(b.Y(y.lng)*v,b.X(_)*v)}function eR(v,y){return new b.a9(y.x/v,y.y/v).toLngLat()}function eD(v){return v.cameraToCenterDistance*Math.min(.85*Math.tan(b.ap(90-v.pitch)),Math.tan(b.ap(89.25-v.pitch)))}function eP(v,y){let _=v.canonical,x=y/b.aq(_.z),w=_.x+Math.pow(2,_.z)*v.wrap,k=b.ar(new Float64Array(16));return b.O(k,k,[w*x,_.y*x,0]),b.Q(k,k,[x/b.a5,x/b.a5,1]),k}function eL(v,y,_,x,w){let k=b.a9.fromLngLat(v,y),A=w*b.as(1,v.lat),{x:C,y:E,z:S}=eN(_,x);return new b.a9(k.x+-(A*C),k.y+-(A*E),k.z+-(A*S))}function eN(v,y){let _=b.ap(v),x=b.ap(y),w=Math.cos(-_),k=Math.sin(_);return{x:k*Math.sin(x),y:-k*Math.cos(x),z:w}}function ez(v,b,y){let _=0,x=(y-b)/10;for(let w=0;w<10;w++)_+=x*Math.pow(Math.cos(b+(w+.5)/10*(y-b)),v);return _}function ej(v,y){return function(_,x,w,k,A){let C=2*((v-1)/b.at(Math.cos(b.ap(89.25-A))/Math.cos(b.ap(89.25)))-1),E=Math.acos(w/k),S=2*ez(C-1,0,b.ap(A/2)),T=Math.min(b.ap(89.25),E+b.ap(A/2)),O=ez(C-1,Math.min(T,E-b.ap(A/2)),T),F=Math.atan(x/w),I=Math.hypot(x,w),M=_;return M+=b.at(k/I/Math.max(.5,Math.cos(b.ap(A/2)))),M+=C*b.at(Math.cos(F))/2,M-=b.at(Math.max(1,O/S/y))/2}}let eB=ej(9.314,3);function e$(v,y){return Math.max(0,(y.roundZoom?Math.round:Math.floor)(v.zoom+b.at(v.tileSize/y.tileSize)))}function eU(v,y){let _=v.getCameraFrustum(),x=v.getClippingPlane(),w=v.screenPointToMercatorCoordinate(v.getCameraPoint()),k=b.a9.fromLngLat(v.center,v.elevation);w.z=k.z+Math.cos(v.pitchInRadians)*v.cameraToCenterDistance/v.worldSize;let A=v.getCoveringTilesDetailsProvider(),C=A.allowVariableZoom(v,y),E=e$(v,y),S=y.minzoom||0,T=void 0!==y.maxzoom?y.maxzoom:v.maxZoom,O=Math.min(Math.max(0,E),T),F=Math.pow(2,O),I=[F*w.x,F*w.y,0],M=[F*k.x,F*k.y,0],R=Math.hypot(k.x-w.x,k.y-w.y),D=Math.abs(k.z-w.z),P=Math.hypot(R,D),L=v=>({zoom:0,x:0,y:0,wrap:v,fullyVisible:!1}),N=[],z=[];if(v.renderWorldCopies&&A.allowWorldCopies())for(let v=1;v<=3;v++)N.push(L(-v)),N.push(L(v));for(N.push(L(0));N.length>0;){let F=N.pop(),R=F.x,L=F.y,j=F.fullyVisible,B={x:R,y:L,z:F.zoom},U=A.getTileBoundingVolume(B,F.wrap,v.elevation,y);if(!j){let v=function(v,b,y){let _=b.intersectsFrustum(v);if(!y||0===_)return _;let x=b.intersectsPlane(y);return 0===x?0:2===_&&2===x?2:1}(_,U,x);if(0===v)continue;j=2===v}let V=A.distanceToTile2d(w.x,w.y,B,U),q=E;C&&(q=(y.calculateTileZoom||eB)(v.zoom+b.at(v.tileSize/y.tileSize),V,D,P,v.fov));let H=Math.min(q=Math.max(0,q=(y.roundZoom?Math.round:Math.floor)(q)),T);if(F.wrap=A.getWrap(k,B,F.wrap),F.zoom>=H){if(F.zoom<S)continue;let v=O-F.zoom,_=I[0]-.5-(R<<v),x=I[1]-.5-(L<<v),w=y.reparseOverscaled?Math.max(F.zoom,q):F.zoom;z.push({tileID:new b.a2(F.zoom===T?w:F.zoom,F.wrap,F.zoom,R,L),distanceSq:b.au([M[0]-.5-R,M[1]-.5-L]),tileDistanceToCamera:Math.sqrt(_*_+x*x)})}else for(let v=0;v<4;v++)N.push({zoom:F.zoom+1,x:(R<<1)+v%2,y:(L<<1)+(v>>1),wrap:F.wrap,fullyVisible:j})}return z.sort((v,b)=>v.distanceSq-b.distanceSq).map(v=>v.tileID)}let eV=b.aa.fromPoints([new b.P(0,0),new b.P(b.a5,b.a5)]);function eq(v){return"raster"===v||"image"===v||"video"===v}function eH(v,b,y,_,x,w,k){if(y[0].overscaledZ>=w)return!1;let A=!1;for(let w of y){let y=v.getLoadedTile(w);if(!y)continue;let{fadingRole:C,fadingDirection:E,fadingParentID:S}=y;C===F.Base&&E===I.Departing&&S||(y.setCrossFadeLogic({fadingRole:F.Base,fadingDirection:I.Departing,fadingParentID:b.tileID,fadeEndTime:x+k}),b.setCrossFadeLogic({fadingRole:F.Parent,fadingDirection:I.Incoming,fadeEndTime:x+k})),_[w.key]=w,A=!0}return A}function eW(v,b){var y;v.needsHillshadePrepare=!0,v.needsTerrainPrepare=!0;let _=b.tileID.canonical.x-v.tileID.canonical.x,x=b.tileID.canonical.y-v.tileID.canonical.y,w=Math.pow(2,v.tileID.canonical.z),k=b.tileID.key;0===_&&0===x||Math.abs(x)>1||(Math.abs(_)>1&&(1===Math.abs(_+w)?_+=w:1===Math.abs(_-w)&&(_-=w)),b.dem&&v.dem&&(v.dem.backfillBorder(b.dem,_,x),(null==(y=v.neighboringTiles)?void 0:y[k])&&(v.neighboringTiles[k].backfilled=!0)))}class eG{constructor(){this._tiles={}}handleWrapJump(v){let b={};for(let y in this._tiles){let _=this._tiles[y];_.tileID=_.tileID.unwrapTo(_.tileID.wrap+v),b[_.tileID.key]=_}this._tiles=b}setFeatureState(v,b){for(let y in this._tiles)this._tiles[y].setFeatureState(v,b)}getAllTiles(){return Object.values(this._tiles)}getAllIds(v=!1){return v?Object.values(this._tiles).map(v=>v.tileID).sort(b.aw).map(v=>v.key):Object.keys(this._tiles)}getTileById(v){return this._tiles[v]}setTile(v,b){this._tiles[v]=b}deleteTileById(v){delete this._tiles[v]}getLoadedTile(v){let b=this.getTileById(v.key);return(null==b?void 0:b.hasData())?b:null}isIdRenderable(v,b=!1){var y;return null==(y=this.getTileById(v))?void 0:y.isRenderable(b)}getRenderableIds(v=0,y){let _=[];for(let v of this.getAllIds())this.isIdRenderable(v,y)&&_.push(this.getTileById(v));return y?_.sort((y,_)=>{let x=y.tileID,w=_.tileID,k=new b.P(x.canonical.x,x.canonical.y)._rotate(-v),A=new b.P(w.canonical.x,w.canonical.y)._rotate(-v);return x.overscaledZ-w.overscaledZ||A.y-k.y||A.x-k.x}).map(v=>v.tileID.key):_.map(v=>v.tileID).sort(b.aw).map(v=>v.key)}}class eY extends b.E{constructor(v,y,_){super(),this.id=v,this.dispatcher=_,this.on("data",v=>this._dataHandler(v)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((v,b,y,_)=>{let x=new(eC(b.type))(v,b,y,_);if(x.id!==v)throw Error(`Expected Source id to be ${v} instead of ${x.id}`);return x})(v,y,_,this),this._inViewTiles=new eG,this._outOfViewCache=new b.ax(0,v=>this._unloadTile(v)),this._timers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._rasterFadeDuration=0,this._maxFadingAncestorLevels=5,this._state=new eI,this._didEmitContent=!1,this._updated=!1}onAdd(v){this.map=v,this._maxTileCacheSize=v?v._maxTileCacheSize:null,this._maxTileCacheZoomLevels=v?v._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(v)}onRemove(v){for(let v of this._inViewTiles.getAllTiles())v.unloadVectorData();this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(v),this._inViewTiles=new eG}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(void 0===this.used&&void 0===this.usedForTerrain||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(let v of this._inViewTiles.getAllTiles())if("loaded"!==v.state&&"errored"!==v.state)return!1;return!0}getSource(){return this._source}getState(){return this._state}pause(){this._paused=!0}resume(){if(!this._paused)return;let v=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,v&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(v,y,_){return b._(this,void 0,void 0,function*(){try{yield this._source.loadTile(v),this._tileLoaded(v,y,_)}catch(y){v.state="errored",404!==y.status?this._source.fire(new b.k(y,{tile:v})):this.update(this.transform,this.terrain)}})}_unloadTile(v){this._source.unloadTile&&this._source.unloadTile(v)}_abortTile(v){this._source.abortTile&&this._source.abortTile(v),this._source.fire(new b.l("dataabort",{tile:v,coord:v.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(v){for(let b of(this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._inViewTiles,this.map?this.map.painter:null),this._inViewTiles.getAllTiles()))b.upload(v),b.prepare(this.map.style.imageManager)}getIds(){return this._inViewTiles.getAllIds(!0)}getRenderableIds(v){var b;return this._inViewTiles.getRenderableIds(null==(b=this.transform)?void 0:b.bearingInRadians,v)}hasRenderableParent(v){let b=v.overscaledZ-1;if(b>=this._source.minzoom){let y=this.getLoadedTile(v.scaledTo(b));if(y)return this._inViewTiles.isIdRenderable(y.tileID.key)}return!1}reload(v,b){if(this._paused)this._shouldReloadOnResume=!0;else for(let y of(this._outOfViewCache.reset(),this._inViewTiles.getAllIds())){let _=this._inViewTiles.getTileById(y);b&&!this._source.shouldReloadTile(_,b)||(v?this._reloadTile(y,"expired"):"errored"!==_.state&&this._reloadTile(y,"reloading"))}}_reloadTile(v,y){return b._(this,void 0,void 0,function*(){let b=this._inViewTiles.getTileById(v);b&&("loading"!==b.state&&(b.state=y),yield this._loadTile(b,v,y))})}_tileLoaded(v,y,_){v.timeAdded=L(),v.selfFading&&(v.fadeEndTime=v.timeAdded+this._rasterFadeDuration),"expired"===_&&(v.refreshedUponExpiration=!0),this._setTileReloadTimer(y,v),"raster-dem"===this.getSource().type&&v.dem&&function(v,b){var y,_;for(let x of b.getRenderableIds()){if(!v.neighboringTiles||!v.neighboringTiles[x])continue;let w=b.getTileById(x);v.neighboringTiles[x].backfilled||eW(v,w),(null==(_=null==(y=w.neighboringTiles)?void 0:y[v.tileID.key])?void 0:_.backfilled)||eW(w,v)}}(v,this._inViewTiles),this._state.initializeTileState(v,this.map?this.map.painter:null),v.aborted||this._source.fire(new b.l("data",{dataType:"source",tile:v,coord:v.tileID}))}getTile(v){return this.getTileByID(v.key)}getTileByID(v){return this._inViewTiles.getTileById(v)}_retainLoadedChildren(v,b){let y=this._getLoadedDescendents(b),_=new Set;for(let x of b){let b=y[x.key];if(!(null==b?void 0:b.length)){_.add(x);continue}let w=x.overscaledZ+eY.maxOverzooming,k=b.filter(v=>v.tileID.overscaledZ<=w);if(!k.length){_.add(x);continue}let A=Math.min(...k.map(v=>v.tileID.overscaledZ)),C=k.filter(v=>v.tileID.overscaledZ===A).map(v=>v.tileID);for(let b of C)v[b.key]=b;this._areDescendentsComplete(C,A,x.overscaledZ)||_.add(x)}return _}_getLoadedDescendents(v){var b;let y={};for(let _ of this._inViewTiles.getAllTiles().filter(v=>v.hasData()))for(let x of v)_.tileID.isChildOf(x)&&(y[b=x.key]||(y[b]=[])).push(_);return y}_areDescendentsComplete(v,b,y){return 1===v.length&&v[0].isOverscaled()?v[0].overscaledZ===b:Math.pow(4,b-y)===v.length}getLoadedTile(v){return this._inViewTiles.getLoadedTile(v)}updateCacheSize(v){let y=Math.floor((Math.ceil(v.width/this._source.tileSize)+1)*(Math.ceil(v.height/this._source.tileSize)+1)*(null===this._maxTileCacheZoomLevels?b.c.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),_="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,y):y;this._outOfViewCache.setMaxSize(_)}handleWrapJump(v){let b=Math.round((v-(void 0===this._prevLng?v:this._prevLng))/360);this._prevLng=v,b&&(this._inViewTiles.handleWrapJump(b),this._resetTileReloadTimers())}update(v,y){let _;if(!this._sourceLoaded||this._paused)return;this.transform=v,this.terrain=y,this.updateCacheSize(v),this.handleWrapJump(this.transform.center.lng),this.used||this.usedForTerrain?this._source.tileID?_=v.getVisibleUnwrappedCoordinates(this._source.tileID).map(v=>new b.a2(v.canonical.z,v.wrap,v.canonical.z,v.canonical.x,v.canonical.y)):(_=eU(v,{tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:"vector"===this._source.type&&void 0!==this.map._zoomLevelsToOverscale?v.maxZoom-this.map._zoomLevelsToOverscale:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:y,calculateTileZoom:this._source.calculateTileZoom}),this._source.hasTile&&(_=_.filter(v=>this._source.hasTile(v)))):_=[],this.usedForTerrain&&(_=this._addTerrainIdealTiles(_));let x=0===_.length&&!this._updated&&this._didEmitContent;this._updated=!0,x&&this.fire(new b.l("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));let w=e$(v,this._source),k=this._updateRetainedTiles(_,w),A=eq(this._source.type);A&&this._rasterFadeDuration>0&&!y&&function(v,y,_,x,w,k,A){let C=L(),E=b.av(y);for(let b of y){let y=v.getTileById(b.key);y.fadingDirection!==I.Departing&&0!==y.fadeOpacity||y.resetFadeLogic(),function(v,b,y,_,x,w,k){if(!b.hasData())return!1;let{tileID:A,fadingRole:C,fadingDirection:E,fadingParentID:S}=b;if(C===F.Base&&E===I.Incoming&&S)return y[S.key]=S,!0;let T=Math.max(A.overscaledZ-x,w);for(let x=A.overscaledZ-1;x>=T;x--){let w=A.scaledTo(x),C=v.getLoadedTile(w);if(C)return b.setCrossFadeLogic({fadingRole:F.Base,fadingDirection:I.Incoming,fadingParentID:C.tileID,fadeEndTime:_+k}),C.setCrossFadeLogic({fadingRole:F.Parent,fadingDirection:I.Departing,fadeEndTime:_+k}),y[w.key]=w,!0}return!1}(v,y,_,C,x,w,A)||function(v,b,y,_,x,w){if(!b.hasData())return!1;let k=b.tileID.children(x),A=eH(v,b,k,y,_,x,w);if(A)return!0;for(let C of k)eH(v,b,C.children(x),y,_,x,w)&&(A=!0);return A}(v,y,_,C,k,A)||function(v,b,y,_){let x=v.tileID;return!!v.selfFading||!v.hasData()&&!!b.has(x)&&(v.setSelfFadeLogic(y+_),!0)}(y,E,C,A)||y.resetFadeLogic()}}(this._inViewTiles,_,k,this._maxFadingAncestorLevels,this._source.minzoom,this._source.maxzoom,this._rasterFadeDuration),A?this._cleanUpRasterTiles(k):this._cleanUpVectorTiles(k)}_cleanUpRasterTiles(v){for(let b of this._inViewTiles.getAllIds())v[b]||this._removeTile(b)}_cleanUpVectorTiles(v){for(let b of this._inViewTiles.getAllIds()){let y=this._inViewTiles.getTileById(b);v[b]?y.clearSymbolFadeHold():y.hasSymbolBuckets?y.holdingForSymbolFade()?y.symbolFadeFinished()&&this._removeTile(b):y.setSymbolHoldDuration(this.map._fadeDuration):this._removeTile(b)}}_addTerrainIdealTiles(v){let b=[];for(let y of v)if(y.canonical.z>this._source.minzoom){let v=y.scaledTo(y.canonical.z-1);b.push(v);let _=y.scaledTo(Math.max(this._source.minzoom,Math.min(y.canonical.z,5)));b.push(_)}return v.concat(b)}releaseSymbolFadeTiles(){for(let v of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(v).holdingForSymbolFade()&&this._removeTile(v)}_updateRetainedTiles(v,b){var y;let _=new Set;for(let b of v)this._addTile(b).hasData()||_.add(b);let x=v.reduce((v,b)=>(v[b.key]=b,v),{}),w=this._retainLoadedChildren(x,_),k={},A=Math.max(b-eY.maxUnderzooming,this._source.minzoom);for(let v of w){let b=this._inViewTiles.getTileById(v.key),_=null==b?void 0:b.wasRequested();for(let w=v.overscaledZ-1;w>=A;--w){let A=v.scaledTo(w);if(k[A.key])break;if(k[A.key]=!0,(b=this.getTile(A))||!_||(b=this._addTile(A)),b){let v=b.hasData();if((v||!(null==(y=this.map)?void 0:y.cancelPendingTileRequestsWhileZooming)||_)&&(x[A.key]=A),_=b.wasRequested(),v)break}}}return x}_addTile(v){let y=this._inViewTiles.getTileById(v.key);if(y)return y;(y=this._outOfViewCache.getAndRemove(v))&&(y.resetFadeLogic(),this._setTileReloadTimer(v.key,y),y.tileID=v,this._state.initializeTileState(y,this.map?this.map.painter:null));let _=y;return y||(y=new eF(v,this._source.tileSize*v.overscaleFactor()),this._loadTile(y,v.key,y.state)),y.uses++,this._inViewTiles.setTile(v.key,y),_||this._source.fire(new b.l("dataloading",{tile:y,coord:y.tileID,dataType:"source"})),y}_setTileReloadTimer(v,b){this._clearTileReloadTimer(v);let y=b.getExpiryTimeout();y&&(this._timers[v]=setTimeout(()=>{this._reloadTile(v,"expired"),delete this._timers[v]},y))}_clearTileReloadTimer(v){let b=this._timers[v];b&&(clearTimeout(b),delete this._timers[v])}_resetTileReloadTimers(){for(let v in this._timers)clearTimeout(this._timers[v]),delete this._timers[v];for(let v of this._inViewTiles.getAllIds()){let b=this._inViewTiles.getTileById(v);this._setTileReloadTimer(v,b)}}refreshTiles(v){for(let b of this._inViewTiles.getAllIds()){let y=this._inViewTiles.getTileById(b);(this._inViewTiles.isIdRenderable(b)||"errored"==y.state)&&v.some(v=>v.equals(y.tileID.canonical))&&this._reloadTile(b,"expired")}}_removeTile(v){let b=this._inViewTiles.getTileById(v);b&&(b.uses--,this._inViewTiles.deleteTileById(v),this._clearTileReloadTimer(v),b.uses>0||(b.hasData()&&"reloading"!==b.state?this._outOfViewCache.add(b.tileID,b,b.getExpiryTimeout()):(b.aborted=!0,this._abortTile(b),this._unloadTile(b))))}_dataHandler(v){"source"===v.dataType&&("metadata"!==v.sourceDataType?"content"===v.sourceDataType&&this._sourceLoaded&&!this._paused&&(this.reload(v.sourceDataChanged,v.shouldReloadTileOptions),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0):this._sourceLoaded=!0)}clearTiles(){for(let v of(this._shouldReloadOnResume=!1,this._paused=!1,this._inViewTiles.getAllIds()))this._removeTile(v);this._outOfViewCache.reset()}tilesIn(v,y,_){let x=[],w=this.transform;if(!w)return x;let k=w.getCoveringTilesDetailsProvider().allowWorldCopies(),A=_?w.getCameraQueryGeometry(v):v,C=v=>w.screenPointToMercatorCoordinate(v,this.terrain),E=this.transformBbox(v,C,!k),S=this.transformBbox(A,C,!k),T=this.getIds(),O=b.aa.fromPoints(S);for(let v=0;v<T.length;v++){let _=this._inViewTiles.getTileById(T[v]);if(_.holdingForSymbolFade())continue;let A=k?[_.tileID]:[_.tileID.unwrapTo(-1),_.tileID.unwrapTo(0)],C=Math.pow(2,w.zoom-_.tileID.overscaledZ),F=y*_.queryPadding*b.a5/_.tileSize/C;for(let v of A){let y=O.map(y=>v.getTilePoint(new b.a9(y.x,y.y)));if(y.expandBy(F),y.intersects(eV)){let b=E.map(b=>v.getTilePoint(b)),y=S.map(b=>v.getTilePoint(b));x.push({tile:_,tileID:k?v:v.unwrapTo(0),queryGeometry:b,cameraQueryGeometry:y,scale:C})}}}return x}transformBbox(v,y,_){let x=v.map(y);if(_){let _=b.aa.fromPoints(v);_.shrinkBy(.001*Math.min(_.width(),_.height()));let w=_.map(y);b.aa.fromPoints(x).covers(w)||(x=x.map(v=>v.x>.5?new b.a9(v.x-1,v.y,v.z):v))}return x}getVisibleCoordinates(v){let b=this.getRenderableIds(v).map(v=>this._inViewTiles.getTileById(v).tileID);return this.transform&&this.transform.populateCache(b),b}hasTransition(){return!!this._source.hasTransition()||!(!eq(this._source.type)||!function(v,b){if(b<=0)return!1;let y=L();for(let b of v.getAllTiles())if(b.fadeEndTime>=y)return!0;return!1}(this._inViewTiles,this._rasterFadeDuration))}setRasterFadeDuration(v){this._rasterFadeDuration=v}setFeatureState(v,y,_){this._state.updateState(v=v||b.ai,y,_)}removeFeatureState(v,y,_){this._state.removeFeatureState(v=v||b.ai,y,_)}getFeatureState(v,y){return this._state.getState(v=v||b.ai,y)}setDependencies(v,b,y){let _=this._inViewTiles.getTileById(v);_&&_.setDependencies(b,y)}reloadTilesForDependencies(v,b){for(let y of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(y).hasDependency(v,b)&&this._reloadTile(y,"reloading");this._outOfViewCache.filter(y=>!y.hasDependency(v,b))}areTilesLoaded(){for(let v of this._inViewTiles.getAllTiles())if("loaded"!==v.state&&"errored"!==v.state)return!1;return!0}}eY.maxUnderzooming=10,eY.maxOverzooming=3;class eZ{constructor(v,b){this.reset(v,b)}reset(v,b){this.points=v||[],this._distances=[0];for(let v=1;v<this.points.length;v++)this._distances[v]=this._distances[v-1]+this.points[v].dist(this.points[v-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(b||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(v){if(1===this.points.length)return this.points[0];v=b.an(v,0,1);let y=1,_=this._distances[y],x=v*this.paddedLength+this.padding;for(;_<x&&y<this._distances.length;)_=this._distances[++y];let w=y-1,k=this._distances[w],A=_-k,C=A>0?(x-k)/A:0;return this.points[w].mult(1-C).add(this.points[y].mult(C))}}function eX(v,b){let y=!0;return"always"===v||"never"!==v&&"never"!==b||(y=!1),y}class eK{constructor(v,b,y){const _=this.boxCells=[],x=this.circleCells=[];this.xCellCount=Math.ceil(v/y),this.yCellCount=Math.ceil(b/y);for(let v=0;v<this.xCellCount*this.yCellCount;v++)_.push([]),x.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=v,this.height=b,this.xScale=this.xCellCount/v,this.yScale=this.yCellCount/b,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(v,b,y,_,x){this._forEachCell(b,y,_,x,this._insertBoxCell,this.boxUid++),this.boxKeys.push(v),this.bboxes.push(b),this.bboxes.push(y),this.bboxes.push(_),this.bboxes.push(x)}insertCircle(v,b,y,_){this._forEachCell(b-_,y-_,b+_,y+_,this._insertCircleCell,this.circleUid++),this.circleKeys.push(v),this.circles.push(b),this.circles.push(y),this.circles.push(_)}_insertBoxCell(v,b,y,_,x,w){this.boxCells[x].push(w)}_insertCircleCell(v,b,y,_,x,w){this.circleCells[x].push(w)}_query(v,b,y,_,x,w,k){if(y<0||v>this.width||_<0||b>this.height)return[];let A=[];if(v<=0&&b<=0&&this.width<=y&&this.height<=_){if(x)return[{key:null,x1:v,y1:b,x2:y,y2:_}];for(let v=0;v<this.boxKeys.length;v++)A.push({key:this.boxKeys[v],x1:this.bboxes[4*v],y1:this.bboxes[4*v+1],x2:this.bboxes[4*v+2],y2:this.bboxes[4*v+3]});for(let v=0;v<this.circleKeys.length;v++){let b=this.circles[3*v],y=this.circles[3*v+1],_=this.circles[3*v+2];A.push({key:this.circleKeys[v],x1:b-_,y1:y-_,x2:b+_,y2:y+_})}}else this._forEachCell(v,b,y,_,this._queryCell,A,{hitTest:x,overlapMode:w,seenUids:{box:{},circle:{}}},k);return A}query(v,b,y,_){return this._query(v,b,y,_,!1,null)}hitTest(v,b,y,_,x,w){return this._query(v,b,y,_,!0,x,w).length>0}hitTestCircle(v,b,y,_,x){let w=v-y,k=v+y,A=b-y,C=b+y;if(k<0||w>this.width||C<0||A>this.height)return!1;let E=[];return this._forEachCell(w,A,k,C,this._queryCellCircle,E,{hitTest:!0,overlapMode:_,circle:{x:v,y:b,radius:y},seenUids:{box:{},circle:{}}},x),E.length>0}_queryCell(v,b,y,_,x,w,k,A){let{seenUids:C,hitTest:E,overlapMode:S}=k,T=this.boxCells[x];if(null!==T){let x=this.bboxes;for(let k of T)if(!C.box[k]){C.box[k]=!0;let T=4*k,O=this.boxKeys[k];if(v<=x[T+2]&&b<=x[T+3]&&y>=x[T+0]&&_>=x[T+1]&&(!A||A(O))&&(!E||!eX(S,O.overlapMode))&&(w.push({key:O,x1:x[T],y1:x[T+1],x2:x[T+2],y2:x[T+3]}),E))return!0}}let O=this.circleCells[x];if(null!==O){let x=this.circles;for(let k of O)if(!C.circle[k]){C.circle[k]=!0;let T=3*k,O=this.circleKeys[k];if(this._circleAndRectCollide(x[T],x[T+1],x[T+2],v,b,y,_)&&(!A||A(O))&&(!E||!eX(S,O.overlapMode))){let v=x[T],b=x[T+1],y=x[T+2];if(w.push({key:O,x1:v-y,y1:b-y,x2:v+y,y2:b+y}),E)return!0}}}return!1}_queryCellCircle(v,b,y,_,x,w,k,A){let{circle:C,seenUids:E,overlapMode:S}=k,T=this.boxCells[x];if(null!==T){let v=this.bboxes;for(let b of T)if(!E.box[b]){E.box[b]=!0;let y=4*b,_=this.boxKeys[b];if(this._circleAndRectCollide(C.x,C.y,C.radius,v[y+0],v[y+1],v[y+2],v[y+3])&&(!A||A(_))&&!eX(S,_.overlapMode))return w.push(!0),!0}}let O=this.circleCells[x];if(null!==O){let v=this.circles;for(let b of O)if(!E.circle[b]){E.circle[b]=!0;let y=3*b,_=this.circleKeys[b];if(this._circlesCollide(v[y],v[y+1],v[y+2],C.x,C.y,C.radius)&&(!A||A(_))&&!eX(S,_.overlapMode))return w.push(!0),!0}}}_forEachCell(v,b,y,_,x,w,k,A){let C=this._convertToXCellCoord(v),E=this._convertToYCellCoord(b),S=this._convertToXCellCoord(y),T=this._convertToYCellCoord(_);for(let O=C;O<=S;O++)for(let C=E;C<=T;C++)if(x.call(this,v,b,y,_,this.xCellCount*C+O,w,k,A))return}_convertToXCellCoord(v){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(v*this.xScale)))}_convertToYCellCoord(v){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(v*this.yScale)))}_circlesCollide(v,b,y,_,x,w){let k=_-v,A=x-b,C=y+w;return C*C>k*k+A*A}_circleAndRectCollide(v,b,y,_,x,w,k){let A=(w-_)/2,C=Math.abs(v-(_+A));if(C>A+y)return!1;let E=(k-x)/2,S=Math.abs(b-(x+E));if(S>E+y)return!1;if(C<=A||S<=E)return!0;let T=C-A,O=S-E;return T*T+O*O<=y*y}}function eJ(v,y,_){var x,w,k,A,C;let E=b.N();if(!v){let{vecSouth:v,vecEast:b}=eQ(y),_=R();_[0]=b[0],_[1]=b[1],_[2]=v[0],_[3]=v[1],(C=(x=_[0])*(A=_[3])-(k=_[2])*(w=_[1]))&&(_[0]=A*(C=1/C),_[1]=-w*C,_[2]=-k*C,_[3]=x*C),E[0]=_[0],E[1]=_[1],E[4]=_[2],E[5]=_[3]}return b.Q(E,E,[1/_,1/_,1]),E}function eQ(v){let y=Math.cos(v.rollInRadians),_=Math.sin(v.rollInRadians),x=Math.cos(v.pitchInRadians),w=Math.cos(v.bearingInRadians),k=Math.sin(v.bearingInRadians),A=b.aC();A[0]=-w*x*_-k*y,A[1]=-k*x*_+w*y;let C=b.aD(A);C<1e-9?b.aE(A):b.aF(A,A,1/C);let E=b.aC();E[0]=w*x*y-k*_,E[1]=k*x*y+w*_;let S=b.aD(E);return S<1e-9?b.aE(E):b.aF(E,E,1/S),{vecEast:E,vecSouth:A}}function e0(v,y,_,x){let w;x?(w=[v,y,x(v,y),1],b.aH(w,w,_)):ti(w=[v,y,0,1],w,_);let k=w[3];return{point:new b.P(w[0]/k,w[1]/k),signedDistanceFromCamera:k,isOccluded:!1}}function e1(v,b,y,_,x,w,k,A){let C=w.glyphStartIndex+w.numGlyphs,E=w.lineStartIndex,S=w.lineStartIndex+w.lineLength,T=b.getoffsetX(w.glyphStartIndex),O=b.getoffsetX(C-1),F=te(v*T,y,_,x,w.segment,E,S,A,k);if(!F)return null;let I=te(v*O,y,_,x,w.segment,E,S,A,k);return I?A.projectionCache.anyProjectionOccluded?null:{first:F,last:I}:null}function e2(v,y,_,x){return v===b.az.horizontal&&Math.abs(_.y-y.y)>Math.abs(_.x-y.x)*x?{useVertical:!0}:(v===b.az.vertical?y.y<_.y:y.x>_.x)?{needsFlipping:!0}:null}function e5(v){let y,{projectionContext:_,pitchedLabelPlaneMatrixInverse:x,symbol:w,fontSize:k,flip:A,keepUpright:C,glyphOffsetArray:E,dynamicLayoutVertexArray:S,aspectRatio:T,rotateToLine:O}=v,F=k/24,I=w.lineOffsetX*F,M=w.lineOffsetY*F;if(w.numGlyphs>1){let v=w.glyphStartIndex+w.numGlyphs,b=w.lineStartIndex,k=w.lineStartIndex+w.lineLength,S=e1(F,E,I,M,A,w,O,_);if(!S)return{notEnoughRoom:!0};let R=e8(S.first.point.x,S.first.point.y,_,x),D=e8(S.last.point.x,S.last.point.y,_,x);if(C&&!A){let v=e2(w.writingMode,R,D,T);if(v)return v}y=[S.first];for(let x=w.glyphStartIndex+1;x<v-1;x++){let v=te(F*E.getoffsetX(x),I,M,A,w.segment,b,k,_,O);if(!v)return{notEnoughRoom:!0};y.push(v)}y.push(S.last)}else{if(C&&!A){let v=e6(_.tileAnchorPoint.x,_.tileAnchorPoint.y,_).point,y=w.lineStartIndex+w.segment+1,k=new b.P(_.lineVertexArray.getx(y),_.lineVertexArray.gety(y)),A=e6(k.x,k.y,_),C=A.signedDistanceFromCamera>0?A.point:e3(_.tileAnchorPoint,k,v,1,_),E=e8(v.x,v.y,_,x),S=e8(C.x,C.y,_,x),O=e2(w.writingMode,E,S,T);if(O)return O}let v=te(F*E.getoffsetX(w.glyphStartIndex),I,M,A,w.segment,w.lineStartIndex,w.lineStartIndex+w.lineLength,_,O);if(!v||_.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};y=[v]}for(let v of y)b.aG(S,v.point,v.angle);return{}}function e3(v,b,y,_,x){let w=v.add(v.sub(b)._unit()),k=e6(w.x,w.y,x).point,A=y.sub(k);return y.add(A._mult(_/A.mag()))}function e4(v,y,_){let x=y.projectionCache;if(x.projections[v])return x.projections[v];let w=new b.P(y.lineVertexArray.getx(v),y.lineVertexArray.gety(v)),k=e6(w.x,w.y,y);if(k.signedDistanceFromCamera>0)return x.projections[v]=k.point,x.anyProjectionOccluded=x.anyProjectionOccluded||k.isOccluded,k.point;let A=v-_.direction;return e3(0===_.distanceFromAnchor?y.tileAnchorPoint:new b.P(y.lineVertexArray.getx(A),y.lineVertexArray.gety(A)),w,_.previousVertex,_.absOffsetX-_.distanceFromAnchor+1,y)}function e6(v,b,y){let _,x=v+y.translation[0],w=b+y.translation[1];return y.pitchWithMap?(_=e0(x,w,y.pitchedLabelPlaneMatrix,y.getElevation)).isOccluded=!1:((_=y.transform.projectTileCoordinates(x,w,y.unwrappedTileID,y.getElevation)).point.x=(.5*_.point.x+.5)*y.width,_.point.y=(-(.5*_.point.y)+.5)*y.height),_}function e8(v,y,_,x){if(_.pitchWithMap){let w=[v,y,0,1];return b.aH(w,w,x),_.transform.projectTileCoordinates(w[0]/w[3],w[1]/w[3],_.unwrappedTileID,_.getElevation).point}return{x:v/_.width*2-1,y:1-y/_.height*2}}function e7(v,b,y){return y.transform.projectTileCoordinates(v,b,y.unwrappedTileID,y.getElevation)}function e9(v,b,y){return v._unit()._perp()._mult(b*y)}function te(v,y,_,x,w,k,A,C,E){let S,T=x?v-y:v+y,O=T>0?1:-1,F=0;x&&(O*=-1,F=Math.PI),O<0&&(F+=Math.PI);let I,M=O>0?k+w:k+w+1;C.projectionCache.cachedAnchorPoint?I=C.projectionCache.cachedAnchorPoint:(I=e6(C.tileAnchorPoint.x,C.tileAnchorPoint.y,C).point,C.projectionCache.cachedAnchorPoint=I);let R,D,P=I,L=I,N=0,z=0,j=Math.abs(T),B=[];for(;N+z<=j;){if((M+=O)<k||M>=A)return null;N+=z,L=P,D=R;let v={absOffsetX:j,direction:O,distanceFromAnchor:N,previousVertex:L};if(P=e4(M,C,v),0===_)B.push(L),S=P.sub(L);else{let y,x=P.sub(L);y=0===x.mag()?e9(e4(M+O,C,v).sub(P),_,O):e9(x,_,O),D||(D=L.add(y)),R=function(v,y,_,x,w,k,A,C,E){if(C.projectionCache.offsets[v])return C.projectionCache.offsets[v];let S=_.add(y);if(v+E.direction<x||v+E.direction>=w)return C.projectionCache.offsets[v]=S,S;let T=e4(v+E.direction,C,E),O=e9(T.sub(_),A,E.direction),F=_.add(O),I=T.add(O);return C.projectionCache.offsets[v]=b.aI(k,S,F,I)||S,C.projectionCache.offsets[v]}(M,y,P,k,A,D,_,C,v),B.push(D),S=R.sub(D)}z=S.mag()}let U=S._mult((j-N)/z)._add(D||L),V=F+Math.atan2(P.y-L.y,P.x-L.x);return B.push(U),{point:U,angle:E?V:0,path:B}}let tt=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function tn(v,b){for(let y=0;y<v;y++){let v=b.length;b.resize(v+4),b.float32.set(tt,3*v)}}function ti(v,b,y){let _=b[0],x=b[1];return v[0]=y[0]*_+y[4]*x+y[12],v[1]=y[1]*_+y[5]*x+y[13],v[3]=y[3]*_+y[7]*x+y[15],v}class tr{constructor(v,b=new eK(v.width+200,v.height+200,25),y=new eK(v.width+200,v.height+200,25)){this.transform=v,this.grid=b,this.ignoredGrid=y,this.pitchFactor=Math.cos(v.pitch*Math.PI/180)*v.cameraToCenterDistance,this.screenRightBoundary=v.width+100,this.screenBottomBoundary=v.height+100,this.gridRightBoundary=v.width+200,this.gridBottomBoundary=v.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(v,b,y,_,x,w,k,A,C,E,S,T){let O,F=this.projectAndGetPerspectiveRatio(v.anchorPointX+A[0],v.anchorPointY+A[1],x,E,T),I=y*F.perspectiveRatio;if(w||k)O=this._projectCollisionBox(v,I,_,x,w,k,A,F,E,S,T);else{let b=F.x+(S?S.x*I:0),y=F.y+(S?S.y*I:0);O={allPointsOccluded:!1,box:[b+v.x1*I,y+v.y1*I,b+v.x2*I,y+v.y2*I]}}let[M,R,D,P]=O.box,L=w?O.allPointsOccluded:F.isOccluded,N=L;return N||(N=F.perspectiveRatio<this.perspectiveRatioCutoff),N||(N=!this.isInsideGrid(M,R,D,P)),N||"always"!==b&&this.grid.hitTest(M,R,D,P,b,C)?{box:[M,R,D,P],placeable:!1,offscreen:!1,occluded:L}:{box:[M,R,D,P],placeable:!0,offscreen:this.isOffscreen(M,R,D,P),occluded:L}}placeCollisionCircles(v,y,_,x,w,k,A,C,E,S,T,O,F,I){let M=[],R=new b.P(y.anchorX,y.anchorY),D=this.getPerspectiveRatio(R.x,R.y,k,I),P=(E?w*this.transform.getPitchedTextCorrection(y.anchorX,y.anchorY,k)/D:w*D)/b.aM,L={getElevation:I,pitchedLabelPlaneMatrix:A,lineVertexArray:_,pitchWithMap:E,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:this.transform,tileAnchorPoint:R,unwrappedTileID:k,width:this.transform.width,height:this.transform.height,translation:F},N=e1(P,x,y.lineOffsetX*P,y.lineOffsetY*P,!1,y,!1,L),z=!1,j=!1,B=!0;if(N){let y=.5*T*D+O,_=new b.P(-100,-100),x=new b.P(this.screenRightBoundary,this.screenBottomBoundary),w=new eZ,k=N.first,A=N.last,F=[];for(let v=k.path.length-1;v>=1;v--)F.push(k.path[v]);for(let v=1;v<A.path.length;v++)F.push(A.path[v]);let I=2.5*y;if(E){let v=this.projectPathToScreenSpace(F,L);F=v.some(v=>v.signedDistanceFromCamera<=0)?[]:v.map(v=>v.point)}let R=[];if(F.length>0){let v=F[0].clone(),y=F[0].clone();for(let b=1;b<F.length;b++)v.x=Math.min(v.x,F[b].x),v.y=Math.min(v.y,F[b].y),y.x=Math.max(y.x,F[b].x),y.y=Math.max(y.y,F[b].y);R=v.x>=_.x&&y.x<=x.x&&v.y>=_.y&&y.y<=x.y?[F]:y.x<_.x||v.x>x.x||y.y<_.y||v.y>x.y?[]:b.aJ([F],_.x,_.y,x.x,x.y)}for(let b of R){w.reset(b,.25*y);let _=0;_=w.length<=.5*y?1:Math.ceil(w.paddedLength/I)+1;for(let b=0;b<_;b++){let x=b/Math.max(_-1,1),k=w.lerp(x),A=k.x+100,E=k.y+100;M.push(A,E,y,0);let T=A-y,O=E-y,F=A+y,I=E+y;if(B=B&&this.isOffscreen(T,O,F,I),j=j||this.isInsideGrid(T,O,F,I),"always"!==v&&this.grid.hitTestCircle(A,E,y,v,S)&&(z=!0,!C))return{circles:[],offscreen:!1,collisionDetected:z}}}}return{circles:!C&&z||!j||D<this.perspectiveRatioCutoff?[]:M,offscreen:B,collisionDetected:z}}projectPathToScreenSpace(v,y){let _;return function(v){let b=0,y=0,_=0,x=0;for(let w=0;w<v.length;w++)v[w].isOccluded?(_=w+1,x=0):++x>y&&(y=x,b=_);return v.slice(b,b+y)}((_=b.N(),b.aB(_,y.pitchedLabelPlaneMatrix),v.map(v=>{let b=e0(v.x,v.y,_,y.getElevation),x=y.transform.projectTileCoordinates(b.point.x,b.point.y,y.unwrappedTileID,y.getElevation);return x.point.x=(.5*x.point.x+.5)*y.width,x.point.y=(-(.5*x.point.y)+.5)*y.height,x})))}queryRenderedSymbols(v){if(0===v.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};let y=[],_=new b.aa;for(let x of v){let v=new b.P(x.x+100,x.y+100);_.extend(v),y.push(v)}let{minX:x,minY:w,maxX:k,maxY:A}=_,C=this.grid.query(x,w,k,A).concat(this.ignoredGrid.query(x,w,k,A)),E={},S={};for(let v of C){let _=v.key;if(void 0===E[_.bucketInstanceId]&&(E[_.bucketInstanceId]={}),E[_.bucketInstanceId][_.featureIndex])continue;let x=[new b.P(v.x1,v.y1),new b.P(v.x2,v.y1),new b.P(v.x2,v.y2),new b.P(v.x1,v.y2)];b.aK(y,x)&&(E[_.bucketInstanceId][_.featureIndex]=!0,void 0===S[_.bucketInstanceId]&&(S[_.bucketInstanceId]=[]),S[_.bucketInstanceId].push(_.featureIndex))}return S}insertCollisionBox(v,b,y,_,x,w){(y?this.ignoredGrid:this.grid).insert({bucketInstanceId:_,featureIndex:x,collisionGroupID:w,overlapMode:b},v[0],v[1],v[2],v[3])}insertCollisionCircles(v,b,y,_,x,w){let k=y?this.ignoredGrid:this.grid,A={bucketInstanceId:_,featureIndex:x,collisionGroupID:w,overlapMode:b};for(let b=0;b<v.length;b+=4)k.insertCircle(A,v[b],v[b+1],v[b+2])}projectAndGetPerspectiveRatio(v,y,_,x,w){if(w){let _;x?(_=[v,y,x(v,y),1],b.aH(_,_,w)):ti(_=[v,y,0,1],_,w);let k=_[3];return{x:(_[0]/k+1)/2*this.transform.width+100,y:(-_[1]/k+1)/2*this.transform.height+100,perspectiveRatio:.5+this.transform.cameraToCenterDistance/k*.5,isOccluded:!1,signedDistanceFromCamera:k}}{let b=this.transform.projectTileCoordinates(v,y,_,x);return{x:(b.point.x+1)/2*this.transform.width+100,y:(1-b.point.y)/2*this.transform.height+100,perspectiveRatio:.5+this.transform.cameraToCenterDistance/b.signedDistanceFromCamera*.5,isOccluded:b.isOccluded,signedDistanceFromCamera:b.signedDistanceFromCamera}}}getPerspectiveRatio(v,b,y,_){let x=this.transform.projectTileCoordinates(v,b,y,_);return .5+this.transform.cameraToCenterDistance/x.signedDistanceFromCamera*.5}isOffscreen(v,b,y,_){return y<100||v>=this.screenRightBoundary||_<100||b>this.screenBottomBoundary}isInsideGrid(v,b,y,_){return y>=0&&v<this.gridRightBoundary&&_>=0&&b<this.gridBottomBoundary}getViewportMatrix(){let v=b.ar([]);return b.O(v,v,[-100,-100,0]),v}_projectCollisionBox(v,y,_,x,w,k,A,C,E,S,T){let O=1,F=0,I=0,M=1,R=v.anchorPointX+A[0],D=v.anchorPointY+A[1];if(k&&!w){let v=this.projectAndGetPerspectiveRatio(R+1,D,x,E,T),b=v.x-C.x,y=Math.atan((v.y-C.y)/b)+(b<0?Math.PI:0),_=Math.sin(y),w=Math.cos(y);O=w,F=_,I=-_,M=w}else if(!k&&w){let v=eQ(this.transform);O=v.vecEast[0],F=v.vecEast[1],I=v.vecSouth[0],M=v.vecSouth[1]}let P=C.x,L=C.y,N=y;w&&(P=R,L=D,N=Math.pow(2,-(this.transform.zoom-_.overscaledZ))*this.transform.getPitchedTextCorrection(R,D,x),S||(N*=b.an(.5+C.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))),S&&(P+=O*S.x*N+I*S.y*N,L+=F*S.x*N+M*S.y*N);let z=v.x1*N,j=v.x2*N,B=(z+j)/2,U=v.y1*N,V=v.y2*N,q=(U+V)/2,H=[];for(let{offsetX:v,offsetY:y}of[{offsetX:z,offsetY:U},{offsetX:B,offsetY:U},{offsetX:j,offsetY:U},{offsetX:j,offsetY:q},{offsetX:j,offsetY:V},{offsetX:B,offsetY:V},{offsetX:z,offsetY:V},{offsetX:z,offsetY:q}])H.push(new b.P(P+O*v+I*y,L+F*v+M*y));let W=!1;if(w){let v=H.map(v=>this.projectAndGetPerspectiveRatio(v.x,v.y,x,E,T));W=v.some(v=>!v.isOccluded),H=v.map(v=>new b.P(v.x,v.y))}else W=!0;return{box:b.aL(H),allPointsOccluded:!W}}}class to{constructor(v,b,y,_){this.opacity=v?Math.max(0,Math.min(1,v.opacity+(v.placed?b:-b))):_&&y?1:0,this.placed=y}isHidden(){return 0===this.opacity&&!this.placed}}class ta{constructor(v,b,y,_,x){this.text=new to(v?v.text:null,b,y,x),this.icon=new to(v?v.icon:null,b,_,x)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class ts{constructor(v,b,y){this.text=v,this.icon=b,this.skipFade=y}}class tl{constructor(v,b,y,_,x){this.bucketInstanceId=v,this.featureIndex=b,this.sourceLayerIndex=y,this.bucketIndex=_,this.tileID=x}}class tc{constructor(v){this.crossSourceCollisions=v,this.maxGroupID=0,this.collisionGroups={}}get(v){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[v]){let b=++this.maxGroupID;this.collisionGroups[v]={ID:b,predicate:v=>v.collisionGroupID===b}}return this.collisionGroups[v]}}function tu(v,y,_,x,w){let{horizontalAlign:k,verticalAlign:A}=b.aS(v);return new b.P(-(k-.5)*y+x[0]*w,-(A-.5)*_+x[1]*w)}class td{constructor(v,b,y,_,x){this.transform=v.clone(),this.terrain=b,this.collisionIndex=new tr(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=y,this.retainedQueryData={},this.collisionGroups=new tc(_),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=x,x&&(x.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(v){let b=this.terrain;return b?(y,_)=>b.getElevation(v,y,_):null}getBucketParts(v,y,_,x){let w=_.getBucket(y),k=_.latestFeatureIndex;if(!w||!k||y.id!==w.layerIds[0])return;let A=_.collisionBoxArray,C=w.layers[0].layout,E=w.layers[0].paint,S=Math.pow(2,this.transform.zoom-_.tileID.overscaledZ),T=_.tileSize/b.a5,O=_.tileID.toUnwrapped(),F="map"===C.get("text-rotation-alignment"),I=b.aN(_,1,this.transform.zoom),M=b.aO(this.collisionIndex.transform,_,E.get("text-translate"),E.get("text-translate-anchor")),R=b.aO(this.collisionIndex.transform,_,E.get("icon-translate"),E.get("icon-translate-anchor")),D=eJ(F,this.transform,I);this.retainedQueryData[w.bucketInstanceId]=new tl(w.bucketInstanceId,k,w.sourceLayerIndex,w.index,_.tileID);let P={bucket:w,layout:C,translationText:M,translationIcon:R,unwrappedTileID:O,pitchedLabelPlaneMatrix:D,scale:S,textPixelRatio:T,holdingForFade:_.holdingForSymbolFade(),collisionBoxArray:A,partiallyEvaluatedTextSize:b.ay(w.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(w.sourceID)};if(x)for(let b of w.sortKeyRanges){let{sortKey:y,symbolInstanceStart:_,symbolInstanceEnd:x}=b;v.push({sortKey:y,symbolInstanceStart:_,symbolInstanceEnd:x,parameters:P})}else v.push({symbolInstanceStart:0,symbolInstanceEnd:w.symbolInstances.length,parameters:P})}attemptAnchorPlacement(v,y,_,x,w,k,A,C,E,S,T,O,F,I,M,R,D,P,L,N){let z=b.aP[v.textAnchor],j=[v.textOffset0,v.textOffset1],B=tu(z,_,x,j,w),U=this.collisionIndex.placeCollisionBox(y,O,C,E,S,A,k,R,T.predicate,L,B,N);if((!P||this.collisionIndex.placeCollisionBox(P,O,C,E,S,A,k,D,T.predicate,L,B,N).placeable)&&U.placeable){let v;if(this.prevPlacement&&this.prevPlacement.variableOffsets[F.crossTileID]&&this.prevPlacement.placements[F.crossTileID]&&this.prevPlacement.placements[F.crossTileID].text&&(v=this.prevPlacement.variableOffsets[F.crossTileID].anchor),0===F.crossTileID)throw Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[F.crossTileID]={textOffset:j,width:_,height:x,anchor:z,textBoxScale:w,prevAnchor:v},this.markUsedJustification(I,z,F,M),I.allowVerticalPlacement&&(this.markUsedOrientation(I,M,F),this.placedOrientations[F.crossTileID]=M),{shift:B,placedGlyphBoxes:U}}}placeLayerBucketPart(v,y,_){let{bucket:x,layout:w,translationText:k,translationIcon:A,unwrappedTileID:C,pitchedLabelPlaneMatrix:E,textPixelRatio:S,holdingForFade:T,collisionBoxArray:O,partiallyEvaluatedTextSize:F,collisionGroup:I}=v.parameters,M=w.get("text-optional"),R=w.get("icon-optional"),D=b.aQ(w,"text-overlap","text-allow-overlap"),P="always"===D,L=b.aQ(w,"icon-overlap","icon-allow-overlap"),N="always"===L,z="map"===w.get("text-rotation-alignment"),j="map"===w.get("text-pitch-alignment"),B="none"!==w.get("icon-text-fit"),U="viewport-y"===w.get("symbol-z-order"),V=P&&(N||!x.hasIconData()||R),q=N&&(P||!x.hasTextData()||M);!x.collisionArrays&&O&&x.deserializeCollisionBoxes(O);let H=this.retainedQueryData[x.bucketInstanceId].tileID,W=this._getTerrainElevationFunc(H),G=this.transform.getFastPathSimpleProjectionMatrix(H),Y=(v,O,N)=>{var U,Y;if(y[v.crossTileID])return;if(T)return void(this.placements[v.crossTileID]=new ts(!1,!1,!1));let Z=!1,X=!1,K=!0,J=null,Q={box:null,placeable:!1,offscreen:null,occluded:!1},ee={placeable:!1},et=null,en=null,ei=null,er=0,eo=0,ea=0;O.textFeatureIndex?er=O.textFeatureIndex:v.useRuntimeCollisionCircles&&(er=v.featureIndex),O.verticalTextFeatureIndex&&(eo=O.verticalTextFeatureIndex);let es=O.textBox;if(es){let y=y=>{let _=b.az.horizontal;if(x.allowVerticalPlacement&&!y&&this.prevPlacement){let b=this.prevPlacement.placedOrientations[v.crossTileID];b&&(this.placedOrientations[v.crossTileID]=b,_=b,this.markUsedOrientation(x,_,v))}return _},w=(y,_)=>{if(x.allowVerticalPlacement&&v.numVerticalGlyphVertices>0&&O.verticalTextBox){for(let v of x.writingModes)if(v===b.az.vertical?ee=Q=_():Q=y(),Q&&Q.placeable)break}else Q=y()},E=v.textAnchorOffsetStartIndex,T=v.textAnchorOffsetEndIndex;if(T===E){let _=(b,y)=>{let _=this.collisionIndex.placeCollisionBox(b,D,S,H,C,j,z,k,I.predicate,W,void 0,G);return _&&_.placeable&&(this.markUsedOrientation(x,y,v),this.placedOrientations[v.crossTileID]=y),_};w(()=>_(es,b.az.horizontal),()=>{let y=O.verticalTextBox;return x.allowVerticalPlacement&&v.numVerticalGlyphVertices>0&&y?_(y,b.az.vertical):{box:null,offscreen:null}}),y(Q&&Q.placeable)}else{let F=b.aP[null==(Y=null==(U=this.prevPlacement)?void 0:U.variableOffsets[v.crossTileID])?void 0:Y.anchor],M=(b,y,w)=>{let O=b.x2-b.x1,M=b.y2-b.y1,R=v.textBoxScale,P=B&&"never"===L?y:null,N=null,U="never"===D?1:2,V="never";F&&U++;for(let y=0;y<U;y++){for(let y=E;y<T;y++){let _=x.textAnchorOffsets.get(y);if(F&&_.textAnchor!==F)continue;let E=this.attemptAnchorPlacement(_,b,O,M,R,z,j,S,H,C,I,V,v,x,w,k,A,P,W);if(E&&(N=E.placedGlyphBoxes)&&N.placeable)return Z=!0,J=E.shift,N}F?F=null:V=D}return _&&!N&&(N={box:this.collisionIndex.placeCollisionBox(es,"always",S,H,C,j,z,k,I.predicate,W,void 0,G).box,offscreen:!1,placeable:!1,occluded:!1}),N};w(()=>M(es,O.iconBox,b.az.horizontal),()=>{let y=O.verticalTextBox;return x.allowVerticalPlacement&&(!Q||!Q.placeable)&&v.numVerticalGlyphVertices>0&&y?M(y,O.verticalIconBox,b.az.vertical):{box:null,occluded:!0,offscreen:null}}),Q&&(Z=Q.placeable,K=Q.offscreen);let R=y(Q&&Q.placeable);if(!Z&&this.prevPlacement){let b=this.prevPlacement.variableOffsets[v.crossTileID];b&&(this.variableOffsets[v.crossTileID]=b,this.markUsedJustification(x,b.anchor,v,R))}}}if(Z=(et=Q)&&et.placeable,K=et&&et.offscreen,v.useRuntimeCollisionCircles&&v.centerJustifiedTextSymbolIndex>=0){let y=x.text.placedSymbolArray.get(v.centerJustifiedTextSymbolIndex),A=b.aA(x.textSizeData,F,y),S=w.get("text-padding");(en=this.collisionIndex.placeCollisionCircles(D,y,x.lineVertexArray,x.glyphOffsetArray,A,C,E,_,j,I.predicate,v.collisionCircleDiameter,S,k,W)).circles.length&&en.collisionDetected&&!_&&b.w("Collisions detected, but collision boxes are not shown"),Z=P||en.circles.length>0&&!en.collisionDetected,K=K&&en.offscreen}if(O.iconFeatureIndex&&(ea=O.iconFeatureIndex),O.iconBox){let v=v=>this.collisionIndex.placeCollisionBox(v,L,S,H,C,j,z,A,I.predicate,W,B&&J?J:void 0,G);X=ee&&ee.placeable&&O.verticalIconBox?(ei=v(O.verticalIconBox)).placeable:(ei=v(O.iconBox)).placeable,K=K&&ei.offscreen}let el=M||0===v.numHorizontalGlyphVertices&&0===v.numVerticalGlyphVertices,ec=R||0===v.numIconVertices;el||ec?ec?el||(X=X&&Z):Z=X&&Z:X=Z=X&&Z;let eu=X&&ei.placeable;if(Z&&et.placeable&&this.collisionIndex.insertCollisionBox(et.box,D,w.get("text-ignore-placement"),x.bucketInstanceId,ee&&ee.placeable&&eo?eo:er,I.ID),eu&&this.collisionIndex.insertCollisionBox(ei.box,L,w.get("icon-ignore-placement"),x.bucketInstanceId,ea,I.ID),en&&Z&&this.collisionIndex.insertCollisionCircles(en.circles,D,w.get("text-ignore-placement"),x.bucketInstanceId,er,I.ID),_&&this.storeCollisionData(x.bucketInstanceId,N,O,et,ei,en),0===v.crossTileID)throw Error("symbolInstance.crossTileID can't be 0");if(0===x.bucketInstanceId)throw Error("bucket.bucketInstanceId can't be 0");this.placements[v.crossTileID]=new ts((Z||V)&&!(null==et?void 0:et.occluded),(X||q)&&!(null==ei?void 0:ei.occluded),K||x.justReloaded),y[v.crossTileID]=!0};if(U){if(0!==v.symbolInstanceStart)throw Error("bucket.bucketInstanceId should be 0");let b=x.getSortedSymbolIndexes(-this.transform.bearingInRadians);for(let v=b.length-1;v>=0;--v){let y=b[v];Y(x.symbolInstances.get(y),x.collisionArrays[y],y)}}else for(let b=v.symbolInstanceStart;b<v.symbolInstanceEnd;b++)Y(x.symbolInstances.get(b),x.collisionArrays[b],b);x.justReloaded=!1}storeCollisionData(v,b,y,_,x,w){if(y.textBox||y.iconBox){let w,k;this.collisionBoxArrays.has(v)?w=this.collisionBoxArrays.get(v):(w=new Map,this.collisionBoxArrays.set(v,w)),w.has(b)?k=w.get(b):(k={text:null,icon:null},w.set(b,k)),y.textBox&&(k.text=_.box),y.iconBox&&(k.icon=x.box)}if(w){let b=this.collisionCircleArrays[v];void 0===b&&(b=this.collisionCircleArrays[v]=[]);for(let v=0;v<w.circles.length;v+=4)b.push(w.circles[v+0]-100),b.push(w.circles[v+1]-100),b.push(w.circles[v+2]),b.push(+!!w.collisionDetected)}}markUsedJustification(v,y,_,x){let w;for(let k of(w=x===b.az.vertical?_.verticalPlacedTextSymbolIndex:({left:_.leftJustifiedTextSymbolIndex,center:_.centerJustifiedTextSymbolIndex,right:_.rightJustifiedTextSymbolIndex})[b.aR(y)],[_.leftJustifiedTextSymbolIndex,_.centerJustifiedTextSymbolIndex,_.rightJustifiedTextSymbolIndex,_.verticalPlacedTextSymbolIndex]))k>=0&&(v.text.placedSymbolArray.get(k).crossTileID=w>=0&&k!==w?0:_.crossTileID)}markUsedOrientation(v,y,_){let x=y===b.az.horizontal||y===b.az.horizontalOnly?y:0,w=y===b.az.vertical?y:0;for(let b of[_.leftJustifiedTextSymbolIndex,_.centerJustifiedTextSymbolIndex,_.rightJustifiedTextSymbolIndex])v.text.placedSymbolArray.get(b).placedOrientation=x;_.verticalPlacedTextSymbolIndex&&(v.text.placedSymbolArray.get(_.verticalPlacedTextSymbolIndex).placedOrientation=w)}commit(v){this.commitTime=v,this.zoomAtLastRecencyCheck=this.transform.zoom;let b=this.prevPlacement,y=!1;this.prevZoomAdjustment=b?b.zoomAdjustment(this.transform.zoom):0;let _=b?b.symbolFadeChange(v):1,x=b?b.opacities:{},w=b?b.variableOffsets:{},k=b?b.placedOrientations:{};for(let v in this.placements){let b=this.placements[v],w=x[v];w?(this.opacities[v]=new ta(w,_,b.text,b.icon),y=y||b.text!==w.text.placed||b.icon!==w.icon.placed):(this.opacities[v]=new ta(null,_,b.text,b.icon,b.skipFade),y=y||b.text||b.icon)}for(let v in x){let b=x[v];if(!this.opacities[v]){let x=new ta(b,_,!1,!1);x.isHidden()||(this.opacities[v]=x,y=y||b.text.placed||b.icon.placed)}}for(let v in w)this.variableOffsets[v]||!this.opacities[v]||this.opacities[v].isHidden()||(this.variableOffsets[v]=w[v]);for(let v in k)this.placedOrientations[v]||!this.opacities[v]||this.opacities[v].isHidden()||(this.placedOrientations[v]=k[v]);if(b&&void 0===b.lastPlacementChangeTime)throw Error("Last placement time for previous placement is not defined");y?this.lastPlacementChangeTime=v:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=b?b.lastPlacementChangeTime:v)}updateLayerOpacities(v,b){let y={};for(let _ of b){let b=_.getBucket(v);b&&_.latestFeatureIndex&&v.id===b.layerIds[0]&&this.updateBucketOpacities(b,_.tileID,y,_.collisionBoxArray)}}updateBucketOpacities(v,y,_,x){v.hasTextData()&&(v.text.opacityVertexArray.clear(),v.text.hasVisibleVertices=!1),v.hasIconData()&&(v.icon.opacityVertexArray.clear(),v.icon.hasVisibleVertices=!1),v.hasIconCollisionBoxData()&&v.iconCollisionBox.collisionVertexArray.clear(),v.hasTextCollisionBoxData()&&v.textCollisionBox.collisionVertexArray.clear();let w=v.layers[0],k=w.layout,A=new ta(null,0,!1,!1,!0),C=k.get("text-allow-overlap"),E=k.get("icon-allow-overlap"),S=w._unevaluatedLayout.hasValue("text-variable-anchor")||w._unevaluatedLayout.hasValue("text-variable-anchor-offset"),T="map"===k.get("text-rotation-alignment"),O="map"===k.get("text-pitch-alignment"),F="none"!==k.get("icon-text-fit"),I=new ta(null,0,C&&(E||!v.hasIconData()||k.get("icon-optional")),E&&(C||!v.hasTextData()||k.get("text-optional")),!0);!v.collisionArrays&&x&&(v.hasIconCollisionBoxData()||v.hasTextCollisionBoxData())&&v.deserializeCollisionBoxes(x);let M=(v,b,y)=>{for(let _=0;_<b/4;_++)v.opacityVertexArray.emplaceBack(y);v.hasVisibleVertices=v.hasVisibleVertices||y!==tf},R=this.collisionBoxArrays.get(v.bucketInstanceId);for(let y=0;y<v.symbolInstances.length;y++){let x=v.symbolInstances.get(y),{numHorizontalGlyphVertices:w,numVerticalGlyphVertices:k,crossTileID:C}=x,E=this.opacities[C];_[C]?E=A:E||(E=I,this.opacities[C]=E),_[C]=!0;let D=x.numIconVertices>0,P=this.placedOrientations[x.crossTileID],L=P===b.az.vertical,N=P===b.az.horizontal||P===b.az.horizontalOnly;if(w>0||k>0){let b=tp(E.text);M(v.text,w,L?tf:b),M(v.text,k,N?tf:b);let y=E.text.isHidden();[x.rightJustifiedTextSymbolIndex,x.centerJustifiedTextSymbolIndex,x.leftJustifiedTextSymbolIndex].forEach(b=>{b>=0&&(v.text.placedSymbolArray.get(b).hidden=y||L?1:0)}),x.verticalPlacedTextSymbolIndex>=0&&(v.text.placedSymbolArray.get(x.verticalPlacedTextSymbolIndex).hidden=y||N?1:0);let _=this.variableOffsets[x.crossTileID];_&&this.markUsedJustification(v,_.anchor,x,P);let A=this.placedOrientations[x.crossTileID];A&&(this.markUsedJustification(v,"left",x,A),this.markUsedOrientation(v,A,x))}if(D){let b=tp(E.icon),y=!(F&&x.verticalPlacedIconSymbolIndex&&L);x.placedIconSymbolIndex>=0&&(M(v.icon,x.numIconVertices,y?b:tf),v.icon.placedSymbolArray.get(x.placedIconSymbolIndex).hidden=E.icon.isHidden()),x.verticalPlacedIconSymbolIndex>=0&&(M(v.icon,x.numVerticalIconVertices,y?tf:b),v.icon.placedSymbolArray.get(x.verticalPlacedIconSymbolIndex).hidden=E.icon.isHidden())}let z=R&&R.has(y)?R.get(y):{text:null,icon:null};if(v.hasIconCollisionBoxData()||v.hasTextCollisionBoxData()){let _=v.collisionArrays[y];if(_){let y=new b.P(0,0);if(_.textBox||_.verticalTextBox){let b=!0;if(S){let v=this.variableOffsets[C];v?(y=tu(v.anchor,v.width,v.height,v.textOffset,v.textBoxScale),T&&y._rotate(O?-this.transform.bearingInRadians:this.transform.bearingInRadians)):b=!1}if(_.textBox||_.verticalTextBox){let x;_.textBox&&(x=L),_.verticalTextBox&&(x=N),th(v.textCollisionBox.collisionVertexArray,E.text.placed,!b||x,z.text,y.x,y.y)}}if(_.iconBox||_.verticalIconBox){let b,x=!!(!N&&_.verticalIconBox);_.iconBox&&(b=x),_.verticalIconBox&&(b=!x),th(v.iconCollisionBox.collisionVertexArray,E.icon.placed,b,z.icon,F?y.x:0,F?y.y:0)}}}}if(v.sortFeatures(-this.transform.bearingInRadians),this.retainedQueryData[v.bucketInstanceId]&&(this.retainedQueryData[v.bucketInstanceId].featureSortOrder=v.featureSortOrder),v.hasTextData()&&v.text.opacityVertexBuffer&&v.text.opacityVertexBuffer.updateData(v.text.opacityVertexArray),v.hasIconData()&&v.icon.opacityVertexBuffer&&v.icon.opacityVertexBuffer.updateData(v.icon.opacityVertexArray),v.hasIconCollisionBoxData()&&v.iconCollisionBox.collisionVertexBuffer&&v.iconCollisionBox.collisionVertexBuffer.updateData(v.iconCollisionBox.collisionVertexArray),v.hasTextCollisionBoxData()&&v.textCollisionBox.collisionVertexBuffer&&v.textCollisionBox.collisionVertexBuffer.updateData(v.textCollisionBox.collisionVertexArray),v.text.opacityVertexArray.length!==v.text.layoutVertexArray.length/4)throw Error(`bucket.text.opacityVertexArray.length (= ${v.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${v.text.layoutVertexArray.length}) / 4`);if(v.icon.opacityVertexArray.length!==v.icon.layoutVertexArray.length/4)throw Error(`bucket.icon.opacityVertexArray.length (= ${v.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${v.icon.layoutVertexArray.length}) / 4`);v.bucketInstanceId in this.collisionCircleArrays&&(v.collisionCircleArray=this.collisionCircleArrays[v.bucketInstanceId],delete this.collisionCircleArrays[v.bucketInstanceId])}symbolFadeChange(v){return 0===this.fadeDuration?1:(v-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(v){return Math.max(0,(this.transform.zoom-v)/1.5)}hasTransitions(v){return this.stale||v-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(v,b){let y=this.zoomAtLastRecencyCheck===b?1-this.zoomAdjustment(b):1;return this.zoomAtLastRecencyCheck=b,this.commitTime+this.fadeDuration*y>v}setStale(){this.stale=!0}}function th(v,b,y,_,x,w){_&&0!==_.length||(_=[0,0,0,0]);let k=_[0]-100,A=_[1]-100,C=_[2]-100,E=_[3]-100;v.emplaceBack(+!!b,+!!y,x||0,w||0,k,A),v.emplaceBack(+!!b,+!!y,x||0,w||0,C,A),v.emplaceBack(+!!b,+!!y,x||0,w||0,C,E),v.emplaceBack(+!!b,+!!y,x||0,w||0,k,E)}function tp(v){if(0===v.opacity&&!v.placed)return 0;if(1===v.opacity&&v.placed)return 0xffffffff;let b=+!!v.placed,y=Math.floor(127*v.opacity);return 0x2000000*y+0x1000000*b+131072*y+65536*b+512*y+256*b+2*y+b}let tf=0;class tm{constructor(v){this._sortAcrossTiles="viewport-y"!==v.layout.get("symbol-z-order")&&!v.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(v,b,y,_,x){let w=this._bucketParts;for(;this._currentTileIndex<v.length;)if(b.getBucketParts(w,_,v[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,x())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,w.sort((v,b)=>v.sortKey-b.sortKey));this._currentPartIndex<w.length;)if(b.placeLayerBucketPart(w[this._currentPartIndex],this._seenCrossTileIDs,y),this._currentPartIndex++,x())return!0;return!1}}class tg{constructor(v,b,y,_,x,w,k,A){this.placement=new td(v,b,w,k,A),this._currentPlacementIndex=y.length-1,this._forceFullPlacement=_,this._showCollisionBoxes=x,this._done=!1}isDone(){return this._done}continuePlacement(v,b,y){let _=L(),x=()=>!this._forceFullPlacement&&L()-_>2;for(;this._currentPlacementIndex>=0;){let _=b[v[this._currentPlacementIndex]],w=this.placement.collisionIndex.transform.zoom;if("symbol"===_.type&&(!_.minzoom||_.minzoom<=w)&&(!_.maxzoom||_.maxzoom>w)){if(this._inProgressLayer||(this._inProgressLayer=new tm(_)),this._inProgressLayer.continuePlacement(y[_.source],this.placement,this._showCollisionBoxes,_,x))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(v){return this.placement.commit(v),this.placement}}let tv=512/b.a5/2;class tb{constructor(v,y,_){this.tileID=v,this.bucketInstanceId=_,this._symbolsByKey={};const x=new Map;for(let v=0;v<y.length;v++){const b=y.get(v),_=b.key,w=x.get(_);w?w.push(b):x.set(_,[b])}for(const[v,y]of x){const _={positions:y.map(v=>({x:Math.floor(v.anchorX*tv),y:Math.floor(v.anchorY*tv)})),crossTileIDs:y.map(v=>v.crossTileID)};if(_.positions.length>128){const v=new b.aT(_.positions.length,16,Uint16Array);for(const{x:b,y:y}of _.positions)v.add(b,y);v.finish(),delete _.positions,_.index=v}this._symbolsByKey[v]=_}}getScaledCoordinates(v,y){let{x:_,y:x,z:w}=this.tileID.canonical,{x:k,y:A,z:C}=y.canonical,E=tv/Math.pow(2,C-w),S=(A*b.a5+v.anchorY)*E,T=x*b.a5*tv;return{x:Math.floor((k*b.a5+v.anchorX)*E-_*b.a5*tv),y:Math.floor(S-T)}}findMatches(v,b,y){let _=this.tileID.canonical.z<b.canonical.z?1:Math.pow(2,this.tileID.canonical.z-b.canonical.z);for(let x=0;x<v.length;x++){let w=v.get(x);if(w.crossTileID)continue;let k=this._symbolsByKey[w.key];if(!k)continue;let A=this.getScaledCoordinates(w,b);if(k.index)for(let v of k.index.range(A.x-_,A.y-_,A.x+_,A.y+_).sort()){let b=k.crossTileIDs[v];if(!y[b]){y[b]=!0,w.crossTileID=b;break}}else if(k.positions)for(let v=0;v<k.positions.length;v++){let b=k.positions[v],x=k.crossTileIDs[v];if(Math.abs(b.x-A.x)<=_&&Math.abs(b.y-A.y)<=_&&!y[x]){y[x]=!0,w.crossTileID=x;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:v})=>v)}}class ty{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class t_{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(v){let b=Math.round((v-this.lng)/360);if(0!==b)for(let v in this.indexes){let y=this.indexes[v],_={};for(let v in y){let x=y[v];x.tileID=x.tileID.unwrapTo(x.tileID.wrap+b),_[x.tileID.key]=x}this.indexes[v]=_}this.lng=v}addBucket(v,b,y){if(this.indexes[v.overscaledZ]&&this.indexes[v.overscaledZ][v.key]){if(this.indexes[v.overscaledZ][v.key].bucketInstanceId===b.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(v.overscaledZ,this.indexes[v.overscaledZ][v.key])}for(let v=0;v<b.symbolInstances.length;v++)b.symbolInstances.get(v).crossTileID=0;this.usedCrossTileIDs[v.overscaledZ]||(this.usedCrossTileIDs[v.overscaledZ]={});let _=this.usedCrossTileIDs[v.overscaledZ];for(let y in this.indexes){let x=this.indexes[y];if(Number(y)>v.overscaledZ)for(let y in x){let w=x[y];w.tileID.isChildOf(v)&&w.findMatches(b.symbolInstances,v,_)}else{let w=x[v.scaledTo(Number(y)).key];w&&w.findMatches(b.symbolInstances,v,_)}}for(let v=0;v<b.symbolInstances.length;v++){let x=b.symbolInstances.get(v);x.crossTileID||(x.crossTileID=y.generate(),_[x.crossTileID]=!0)}return void 0===this.indexes[v.overscaledZ]&&(this.indexes[v.overscaledZ]={}),this.indexes[v.overscaledZ][v.key]=new tb(v,b.symbolInstances,b.bucketInstanceId),!0}removeBucketCrossTileIDs(v,b){for(let y of b.getCrossTileIDsLists())for(let b of y)delete this.usedCrossTileIDs[v][b]}removeStaleBuckets(v){let b=!1;for(let y in this.indexes){let _=this.indexes[y];for(let x in _)v[_[x].bucketInstanceId]||(this.removeBucketCrossTileIDs(y,_[x]),delete _[x],b=!0)}return b}}class tx{constructor(){this.layerIndexes={},this.crossTileIDs=new ty,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(v,b,y){let _=this.layerIndexes[v.id];void 0===_&&(_=this.layerIndexes[v.id]=new t_);let x=!1,w={};for(let k of(_.handleWrapJump(y),b)){let b=k.getBucket(v);b&&v.id===b.layerIds[0]&&(b.bucketInstanceId||(b.bucketInstanceId=++this.maxBucketInstanceId),_.addBucket(k.tileID,b,this.crossTileIDs)&&(x=!0),w[b.bucketInstanceId]=!0)}return _.removeStaleBuckets(w)&&(x=!0),x}pruneUnusedLayers(v){let b={};for(let y in v.forEach(v=>{b[v]=!0}),this.layerIndexes)b[y]||delete this.layerIndexes[y]}}var tw="void main() {fragColor=vec4(1.0);}";let tk={prelude:tA("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nout highp vec4 fragColor;","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}mat3 rotationMatrixFromAxisAngle(vec3 u,float angle) {float c=cos(angle);float s=sin(angle);float c2=1.0-c;return mat3(u.x*u.x*c2+ c,u.x*u.y*c2-u.z*s,u.x*u.z*c2+u.y*s,u.y*u.x*c2+u.z*s,u.y*u.y*c2+ c,u.y*u.z*c2-u.x*s,u.z*u.x*c2-u.y*s,u.z*u.y*c2+u.x*s,u.z*u.z*c2+ c\n);}\n#ifdef TERRAIN3D\nuniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;\n#endif\nconst highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\n#ifdef GLOBE\nif ((pos.y <-32767.5) || (pos.y > 32766.5)) {return 0.0;}\n#endif\nvec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;\n#else\nreturn 0.0;\n#endif\n}const float PI=3.141592653589793;uniform mat4 u_projection_matrix;"),projectionMercator:tA("","float projectLineThickness(float tileY) {return 1.0;}float projectCircleRadius(float tileY) {return 1.0;}vec4 projectTile(vec2 p) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);return result;}vec4 projectTile(vec2 p,vec2 rawPos) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);if (rawPos.y <-32767.5 || rawPos.y > 32766.5) {result.z=-10000000.0;}return result;}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_projection_matrix*vec4(posInTile,elevation,1.0);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {return projectTileWithElevation(posInTile,elevation);}"),projectionGlobe:tA("","#define GLOBE_RADIUS 6371008.8\nuniform highp vec4 u_projection_tile_mercator_coords;uniform highp vec4 u_projection_clipping_plane;uniform highp float u_projection_transition;uniform mat4 u_projection_fallback_matrix;vec3 globeRotateVector(vec3 vec,vec2 angles) {vec3 axisRight=vec3(vec.z,0.0,-vec.x);vec3 axisUp=cross(axisRight,vec);axisRight=normalize(axisRight);axisUp=normalize(axisUp);vec2 t=tan(angles);return normalize(vec+axisRight*t.x+axisUp*t.y);}mat3 globeGetRotationMatrix(vec3 spherePos) {vec3 axisRight=vec3(spherePos.z,0.0,-spherePos.x);vec3 axisDown=cross(axisRight,spherePos);axisRight=normalize(axisRight);axisDown=normalize(axisDown);return mat3(axisRight,axisDown,spherePos\n);}float circumferenceRatioAtTileY(float tileY) {float mercator_pos_y=u_projection_tile_mercator_coords.y+u_projection_tile_mercator_coords.w*tileY;float spherical_y=2.0*atan(exp(PI-(mercator_pos_y*PI*2.0)))-PI*0.5;return cos(spherical_y);}float projectLineThickness(float tileY) {float thickness=1.0/circumferenceRatioAtTileY(tileY); \nif (u_projection_transition < 0.999) {return mix(1.0,thickness,u_projection_transition);} else {return thickness;}}vec3 projectToSphere(vec2 translatedPos,vec2 rawPos) {vec2 mercator_pos=u_projection_tile_mercator_coords.xy+u_projection_tile_mercator_coords.zw*translatedPos;vec2 spherical;spherical.x=mercator_pos.x*PI*2.0+PI;spherical.y=2.0*atan(exp(PI-(mercator_pos.y*PI*2.0)))-PI*0.5;float len=cos(spherical.y);vec3 pos=vec3(sin(spherical.x)*len,sin(spherical.y),cos(spherical.x)*len\n);if (rawPos.y <-32767.5) {pos=vec3(0.0,1.0,0.0);}if (rawPos.y > 32766.5) {pos=vec3(0.0,-1.0,0.0);}return pos;}vec3 projectToSphere(vec2 posInTile) {return projectToSphere(posInTile,vec2(0.0,0.0));}float globeComputeClippingZ(vec3 spherePos) {return (1.0-(dot(spherePos,u_projection_clipping_plane.xyz)+u_projection_clipping_plane.w));}vec4 interpolateProjection(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);globePosition.z=globeComputeClippingZ(elevatedPos)*globePosition.w;if (u_projection_transition > 0.999) {return globePosition;}vec4 flatPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);const float z_globeness_threshold=0.2;vec4 result=globePosition;result.z=mix(0.0,globePosition.z,clamp((u_projection_transition-z_globeness_threshold)/(1.0-z_globeness_threshold),0.0,1.0));result.xyw=mix(flatPosition.xyw,globePosition.xyw,u_projection_transition);if ((posInTile.y <-32767.5) || (posInTile.y > 32766.5)) {result=globePosition;const float poles_hidden_anim_percentage=0.02;result.z=mix(globePosition.z,100.0,pow(max((1.0-u_projection_transition)/poles_hidden_anim_percentage,0.0),8.0));}return result;}vec4 interpolateProjectionFor3D(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);if (u_projection_transition > 0.999) {return globePosition;}vec4 fallbackPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);return mix(fallbackPosition,globePosition,u_projection_transition);}vec4 projectTile(vec2 posInTile) {return interpolateProjection(posInTile,projectToSphere(posInTile),0.0);}vec4 projectTile(vec2 posInTile,vec2 rawPos) {return interpolateProjection(posInTile,projectToSphere(posInTile,rawPos),0.0);}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return interpolateProjection(posInTile,projectToSphere(posInTile),elevation);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {vec3 spherePos=projectToSphere(posInTile,posInTile);return interpolateProjectionFor3D(posInTile,spherePos,elevation);}"),background:tA("uniform vec4 u_color;uniform float u_opacity;void main() {fragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),backgroundPattern:tA("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);fragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;void main() {gl_Position=projectTile(a_pos);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:tA("in vec3 v_data;in float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));fragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);const float epsilon=0.5/255.0;if (fragColor.r < epsilon && fragColor.g < epsilon && fragColor.b < epsilon && fragColor.a < epsilon) {discard;}\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform highp float u_globe_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;uniform vec2 u_translate;in vec2 a_pos;out vec3 v_data;out float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 pos_raw=a_pos+32768.0;vec2 extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);vec2 circle_center=floor(pos_raw/8.0)+u_translate;float ele=get_elevation(circle_center);v_visibility=calculate_visibility(projectTileWithElevation(circle_center,ele));if (u_pitch_with_map) {\n#ifdef GLOBE\nvec3 center_vector=projectToSphere(circle_center);\n#endif\nfloat angle_scale=u_globe_extrude_scale;vec2 corner_position=circle_center;if (u_scale_with_map) {angle_scale*=(radius+stroke_width);corner_position+=extrude*u_extrude_scale*(radius+stroke_width);} else {\n#ifdef GLOBE\nvec4 projected_center=interpolateProjection(circle_center,center_vector,ele);\n#else\nvec4 projected_center=projectTileWithElevation(circle_center,ele);\n#endif\ncorner_position+=extrude*u_extrude_scale*(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);angle_scale*=(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);}\n#ifdef GLOBE\nvec2 angles=extrude*angle_scale;vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(corner_position,corner_vector,ele);\n#else\ngl_Position=projectTileWithElevation(corner_position,ele);\n#endif\n} else {gl_Position=projectTileWithElevation(circle_center,ele);if (gl_Position.z/gl_Position.w > 1.0) {gl_Position.xy=vec2(10000.0);}if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),clippingMask:tA(tw,"in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),heatmap:tA("uniform highp float u_intensity;in vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);fragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;uniform highp float u_globe_extrude_scale;in vec2 a_pos;out vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 pos_raw=a_pos+32768.0;vec2 unscaled_extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 circle_center=floor(pos_raw/8.0);\n#ifdef GLOBE\nvec2 angles=v_extrude*radius*u_globe_extrude_scale;vec3 center_vector=projectToSphere(circle_center);vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(circle_center+extrude,corner_vector,0.0);\n#else\ngl_Position=projectTileFor3D(circle_center+extrude,get_elevation(circle_center));\n#endif\n}"),heatmapTexture:tA("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));fragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:tA("in float v_placed;in float v_notUsed;void main() {float alpha=0.5;fragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {fragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {fragColor*=.1;}}","in vec2 a_anchor_pos;in vec2 a_placed;in vec2 a_box_real;uniform vec2 u_pixel_extrude_scale;out float v_placed;out float v_notUsed;void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:tA("in float v_radius;in vec2 v_extrude;in float v_collision;void main() {float alpha=0.5;float stroke_radius=0.9;float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);fragColor=color*alpha*opacity_t;}","in vec2 a_pos;in float a_radius;in vec2 a_flags;uniform vec2 u_viewport_size;out float v_radius;out vec2 v_extrude;out float v_collision;void main() {float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_collision=collision;gl_Position=vec4((a_pos/u_viewport_size*2.0-1.0)*vec2(1.0,-1.0),0.0,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),colorRelief:tA("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;uniform vec4 u_unpack;uniform sampler2D u_elevation_stops;uniform sampler2D u_color_stops;uniform int u_color_ramp_size;uniform float u_opacity;in vec2 v_pos;float getElevation(vec2 coord) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}float getElevationStop(int stop) {float x=(float(stop)+0.5)/float(u_color_ramp_size);vec4 data=texture(u_elevation_stops,vec2(x,0))*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {float el=getElevation(v_pos);int r=(u_color_ramp_size-1);int l=0;float el_l=getElevationStop(l);float el_r=getElevationStop(r);while(r-l > 1){int m=(r+l)/2;float el_m=getElevationStop(m);if(el < el_m){r=m;el_r=el_m;}else\n{l=m;el_l=el_m;}}float x=(float(l)+(el-el_l)/(el_r-el_l)+0.5)/float(u_color_ramp_size);fragColor=u_opacity*texture(u_color_stops,vec2(x,0));\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_dimension;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_pos/8192.0)*scale+epsilon;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),debug:tA("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);fragColor=mix(u_color,overlay_color,overlay_color.a);}","in vec2 a_pos;out vec2 v_uv;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=projectTileWithElevation(a_pos*u_overlay_scale,get_elevation(a_pos));}"),depth:tA(tw,"in vec2 a_pos;void main() {\n#ifdef GLOBE\ngl_Position=projectTileFor3D(a_pos,0.0);\n#else\ngl_Position=u_projection_matrix*vec4(a_pos,0.0,1.0);\n#endif\n}"),fill:tA("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\nfragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_fill_translate;in vec2 a_pos;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=projectTile(a_pos+u_fill_translate,a_pos);}"),fillOutline:tA("in vec2 v_pos;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=outline_color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_world;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n}"),fillOutlinePattern:tA("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;in vec2 v_pos_a;in vec2 v_pos_b;in vec2 v_pos;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;out vec2 v_pos;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n}"),fillPattern:tA("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);fragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),fillExtrusion:tA("in vec4 v_color;void main() {fragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;in vec2 a_pos;in vec4 a_normal_ed;\n#ifdef TERRAIN3D\nin vec2 a_centroid;\n#endif\nout vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;\n#ifdef GLOBE\nvec3 spherePos=projectToSphere(posInTile,a_pos);gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);\n#else\ngl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);\n#endif\nfloat colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;vec3 normalForLighting=normal/16384.0;float directional=clamp(dot(normalForLighting,u_lightpos),0.0,1.0);\n#ifdef GLOBE\nmat3 rotMatrix=globeGetRotationMatrix(spherePos);normalForLighting=rotMatrix*normalForLighting;directional=mix(directional,clamp(dot(normalForLighting,u_lightpos_globe),0.0,1.0),u_projection_transition);\n#endif\ndirectional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),fillExtrusionPattern:tA("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;in vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);fragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;in vec2 a_pos;in vec4 a_normal_ed;\n#ifdef TERRAIN3D\nin vec2 a_centroid;\n#endif\n#ifdef GLOBE\nout vec3 v_sphere_pos;\n#endif\nout vec2 v_pos_a;out vec2 v_pos_b;out vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;\n#ifdef GLOBE\nvec3 spherePos=projectToSphere(posInTile,a_pos);vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);v_sphere_pos=elevatedPos;gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);\n#else\ngl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);\n#endif\nvec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,elevation*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),hillshadePrepare:tA("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {vec2 epsilon=1.0/u_dimension;float tileSize=u_dimension.x-2.0;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))*tileSize/pow(2.0,exaggeration+(28.2562-u_zoom));fragColor=clamp(vec4(deriv.x/8.0+0.5,deriv.y/8.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:tA("uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform float u_exaggeration;uniform vec4 u_accent;uniform int u_method;uniform float u_altitudes[NUM_ILLUMINATION_SOURCES];uniform float u_azimuths[NUM_ILLUMINATION_SOURCES];uniform vec4 u_shadows[NUM_ILLUMINATION_SOURCES];uniform vec4 u_highlights[NUM_ILLUMINATION_SOURCES];\n#define PI 3.141592653589793\n#define STANDARD 0\n#define COMBINED 1\n#define IGOR 2\n#define MULTIDIRECTIONAL 3\n#define BASIC 4\nfloat get_aspect(vec2 deriv){return deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);}void igor_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float aspect=get_aspect(deriv);float azimuth=u_azimuths[0]+PI;float slope_stength=atan(length(deriv))*2.0/PI;float aspect_strength=1.0-abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);float shadow_strength=slope_stength*aspect_strength;float highlight_strength=slope_stength*(1.0-aspect_strength);fragColor=u_shadows[0]*shadow_strength+u_highlights[0]*highlight_strength;}void standard_hillshade(vec2 deriv){float azimuth=u_azimuths[0]+PI;float slope=atan(0.625*length(deriv));float aspect=get_aspect(deriv);float intensity=u_exaggeration;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadows[0],u_highlights[0],shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);fragColor=accent_color*(1.0-shade_color.a)+shade_color;}void basic_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor=u_highlights[0]*(2.0*shade-1.0);}else\n{fragColor=u_shadows[0]*(1.0-2.0*shade);}}void multidirectional_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;fragColor=vec4(0,0,0,0);for(int i=0; i < NUM_ILLUMINATION_SOURCES; i++){float cos_alt=cos(u_altitudes[i]);float sin_alt=sin(u_altitudes[i]);float cos_az=-cos(u_azimuths[i]);float sin_az=-sin(u_azimuths[i]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor+=u_highlights[i]*(2.0*shade-1.0)/float(NUM_ILLUMINATION_SOURCES);}else\n{fragColor+=u_shadows[i]*(1.0-2.0*shade)/float(NUM_ILLUMINATION_SOURCES);}}}void combined_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=acos((sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv)));cang=clamp(cang,0.0,PI/2.0);float shade=cang*atan(length(deriv))*4.0/PI/PI;float highlight=(PI/2.0-cang)*atan(length(deriv))*4.0/PI/PI;fragColor=u_shadows[0]*shade+u_highlights[0]*highlight;}void main() {vec4 pixel=texture(u_image,v_pos);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));vec2 deriv=((pixel.rg*8.0)-4.0)/scaleFactor;if (u_method==BASIC) {basic_hillshade(deriv);} else if (u_method==COMBINED) {combined_hillshade(deriv);} else if (u_method==IGOR) {igor_hillshade(deriv);} else if (u_method==MULTIDIRECTIONAL) {multidirectional_hillshade(deriv);} else if (u_method==STANDARD) {standard_hillshade(deriv);} else {standard_hillshade(deriv);}\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);v_pos=a_pos/8192.0;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),line:tA("uniform lowp float u_device_pixel_ratio;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);fragColor=color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp float v_linesofar;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),lineGradient:tA("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec2 v_uv;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);fragColor=color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;in float a_uv_x;in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),linePattern:tA("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;in vec2 v_normal;in vec2 v_width2;in float v_linesofar;in float v_gamma_scale;in float v_width;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture(u_image,pos_a),texture(u_image,pos_b),u_fade);fragColor=color*alpha*opacity;\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_linesofar;out float v_gamma_scale;out float v_width;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),lineSDF:tA("uniform lowp float u_device_pixel_ratio;uniform lowp float u_lineatlas_width;uniform sampler2D u_image;uniform float u_mix;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define mediump vec4 dasharray_from\n#pragma mapbox: define mediump vec4 dasharray_to\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 dasharray_from\n#pragma mapbox: initialize mediump vec4 dasharray_to\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture(u_image,v_tex_a).a;float sdfdist_b=texture(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);float sdfgamma=(u_lineatlas_width/256.0/u_device_pixel_ratio)/min(dasharray_from.w,dasharray_to.w);alpha*=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;out vec2 v_width2;out vec2 v_tex_a;out vec2 v_tex_b;out float v_gamma_scale;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define mediump vec4 dasharray_from\n#pragma mapbox: define mediump vec4 dasharray_to\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 dasharray_from\n#pragma mapbox: initialize mediump vec4 dasharray_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nfloat u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}"),lineGradientSDF:tA("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform sampler2D u_image_dash;uniform float u_mix;uniform lowp float u_lineatlas_width;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;in highp vec2 v_uv;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define mediump vec4 dasharray_from\n#pragma mapbox: define mediump vec4 dasharray_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 dasharray_from\n#pragma mapbox: initialize mediump vec4 dasharray_to\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);float sdfdist_a=texture(u_image_dash,v_tex_a).a;float sdfdist_b=texture(u_image_dash,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);float sdfgamma=(u_lineatlas_width/256.0)/min(dasharray_from.w,dasharray_to.w);float dash_alpha=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*dash_alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nin vec2 a_pos_normal;in vec4 a_data;in float a_uv_x;in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;out vec2 v_tex_a;out vec2 v_tex_b;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define mediump vec4 dasharray_from\n#pragma mapbox: define mediump vec4 dasharray_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 dasharray_from\n#pragma mapbox: initialize mediump vec4 dasharray_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;float texel_height=1.0/u_image_height;float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nfloat u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}"),raster:tA("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;in vec2 v_pos0;in vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture(u_image0,v_pos0);vec4 color1=texture(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);fragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;uniform vec4 u_coords_top;uniform vec4 u_coords_bottom;in vec2 a_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {vec2 fractionalPos=a_pos/8192.0;vec2 position=mix(mix(u_coords_top.xy,u_coords_top.zw,fractionalPos.x),mix(u_coords_bottom.xy,u_coords_bottom.zw,fractionalPos.x),fractionalPos.y);gl_Position=projectTile(position,position);v_pos0=((fractionalPos-0.5)/u_buffer_scale)+0.5;\n#ifdef GLOBE\nif (a_pos.y <-32767.5) {v_pos0.y=0.0;}if (a_pos.y > 32766.5) {v_pos0.y=1.0;}\n#endif\nv_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:tA("uniform sampler2D u_texture;in vec2 v_tex;in float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;fragColor=texture(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;out vec2 v_tex;out float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;\n#ifdef GLOBE\nif(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\n#endif\nvec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}"),symbolSDF:tA("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;in vec2 v_data0;in vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}fragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_translation;uniform float u_pitched_scale;out vec2 v_data0;out vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy/16.0;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;\n#ifdef GLOBE\nif(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\n#endif\nvec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),symbolTextAndIcon:tA("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;in vec4 v_data0;in vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;fragColor=texture(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);fragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","in vec4 a_pos_offset;in vec4 a_data;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;out vec4 v_data0;out vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;\n#ifdef GLOBE\nif(u_pitch_with_map && !u_is_along_line) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\n#endif\nvec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}"),terrain:tA("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;uniform bool u_is_globe_mode;in vec2 v_texture_pos;in float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture(u_texture,vec2(v_texture_pos.x,1.0-v_texture_pos.y));if (!u_is_globe_mode && v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);fragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {fragColor=surface_color;}}","in vec3 a_pos3d;uniform mat4 u_fog_matrix;uniform float u_ele_delta;out vec2 v_texture_pos;out float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:tA("in float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {fragColor=pack(v_depth);}","in vec3 a_pos3d;uniform float u_ele_delta;out float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:tA("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;in vec2 v_texture_pos;void main() {vec4 rgba=texture(u_texture,v_texture_pos);fragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","in vec3 a_pos3d;uniform float u_ele_delta;out vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);}"),projectionErrorMeasurement:tA("in vec4 v_output_error_encoded;void main() {fragColor=v_output_error_encoded;}","in vec2 a_pos;uniform highp float u_input;uniform highp float u_output_expected;out vec4 v_output_error_encoded;void main() {float real_output=2.0*atan(exp(PI-(u_input*PI*2.0)))-PI*0.5;float error=real_output-u_output_expected;float abs_error=abs(error)*128.0;v_output_error_encoded.x=min(floor(abs_error*256.0),255.0)/255.0;abs_error-=v_output_error_encoded.x;v_output_error_encoded.y=min(floor(abs_error*65536.0),255.0)/255.0;abs_error-=v_output_error_encoded.x/255.0;v_output_error_encoded.z=min(floor(abs_error*16777216.0),255.0)/255.0;v_output_error_encoded.w=error >=0.0 ? 1.0 : 0.0;gl_Position=vec4(a_pos,0.0,1.0);}"),atmosphere:tA("#ifdef GL_ES\nprecision highp float;\n#endif\nin vec3 view_direction;uniform vec3 u_sun_pos;uniform vec3 u_globe_position;uniform float u_globe_radius;uniform float u_atmosphere_blend;/**Shader use from https:*Made some change to adapt to MapLibre Globe geometry*/const float PI=3.141592653589793;const int iSteps=5;const int jSteps=3;/*radius of the planet*/const float EARTH_RADIUS=6371e3;/*radius of the atmosphere*/const float ATMOS_RADIUS=6471e3;vec2 rsi(vec3 r0,vec3 rd,float sr) {float a=dot(rd,rd);float b=2.0*dot(rd,r0);float c=dot(r0,r0)-(sr*sr);float d=(b*b)-4.0*a*c;if (d < 0.0) return vec2(1e5,-1e5);return vec2((-b-sqrt(d))/(2.0*a),(-b+sqrt(d))/(2.0*a));}vec4 atmosphere(vec3 r,vec3 r0,vec3 pSun,float iSun,float rPlanet,float rAtmos,vec3 kRlh,float kMie,float shRlh,float shMie,float g) {pSun=normalize(pSun);r=normalize(r);vec2 p=rsi(r0,r,rAtmos);if (p.x > p.y) {return vec4(0.0,0.0,0.0,1.0);}if (p.x < 0.0) {p.x=0.0;}vec3 pos=r0+r*p.x;vec2 p2=rsi(r0,r,rPlanet);if (p2.x <=p2.y && p2.x > 0.0) {p.y=min(p.y,p2.x);}float iStepSize=(p.y-p.x)/float(iSteps);float iTime=p.x+iStepSize*0.5;vec3 totalRlh=vec3(0,0,0);vec3 totalMie=vec3(0,0,0);float iOdRlh=0.0;float iOdMie=0.0;float mu=dot(r,pSun);float mumu=mu*mu;float gg=g*g;float pRlh=3.0/(16.0*PI)*(1.0+mumu);float pMie=3.0/(8.0*PI)*((1.0-gg)*(mumu+1.0))/(pow(1.0+gg-2.0*mu*g,1.5)*(2.0+gg));for (int i=0; i < iSteps; i++) {vec3 iPos=r0+r*iTime;float iHeight=length(iPos)-rPlanet;float odStepRlh=exp(-iHeight/shRlh)*iStepSize;float odStepMie=exp(-iHeight/shMie)*iStepSize;iOdRlh+=odStepRlh;iOdMie+=odStepMie;float jStepSize=rsi(iPos,pSun,rAtmos).y/float(jSteps);float jTime=jStepSize*0.5;float jOdRlh=0.0;float jOdMie=0.0;for (int j=0; j < jSteps; j++) {vec3 jPos=iPos+pSun*jTime;float jHeight=length(jPos)-rPlanet;jOdRlh+=exp(-jHeight/shRlh)*jStepSize;jOdMie+=exp(-jHeight/shMie)*jStepSize;jTime+=jStepSize;}vec3 attn=exp(-(kMie*(iOdMie+jOdMie)+kRlh*(iOdRlh+jOdRlh)));totalRlh+=odStepRlh*attn;totalMie+=odStepMie*attn;iTime+=iStepSize;}float opacity=exp(-(length(kRlh)*length(totalRlh)+kMie*length(totalMie)));vec3 color=iSun*(pRlh*kRlh*totalRlh+pMie*kMie*totalMie);return vec4(color,opacity);}void main() {vec3 scale_camera_pos=-u_globe_position*EARTH_RADIUS/u_globe_radius;vec4 color=atmosphere(normalize(view_direction),scale_camera_pos,u_sun_pos,22.0,EARTH_RADIUS,ATMOS_RADIUS,vec3(5.5e-6,13.0e-6,22.4e-6),21e-6,8e3,1.2e3,0.758\n);color.rgb=1.0-exp(-1.0*color.rgb);color=pow(color,vec4(1.0/2.2));fragColor=vec4(color.rgb,1.0-color.a)*u_atmosphere_blend;}","in vec2 a_pos;uniform mat4 u_inv_proj_matrix;out vec3 view_direction;void main() {view_direction=(u_inv_proj_matrix*vec4(a_pos,0.0,1.0)).xyz;gl_Position=vec4(a_pos,0.0,1.0);}"),sky:tA("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform vec2 u_horizon;uniform vec2 u_horizon_normal;uniform float u_sky_horizon_blend;uniform float u_sky_blend;void main() {float x=gl_FragCoord.x;float y=gl_FragCoord.y;float blend=(y-u_horizon.y)*u_horizon_normal.y+(x-u_horizon.x)*u_horizon_normal.x;if (blend > 0.0) {if (blend < u_sky_horizon_blend) {fragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {fragColor=u_sky_color;}}fragColor=mix(fragColor,vec4(vec3(0.0),0.0),u_sky_blend);}","in vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function tA(v,b){let y=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,_=b.match(/in ([\w]+) ([\w]+)/g),x=v.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),w=b.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),k=w?w.concat(x):x,A={};return{fragmentSource:v=v.replace(y,(v,b,y,_,x)=>(A[x]=!0,"define"===b?`
|
|
6910
6910
|
#ifndef HAS_UNIFORM_u_${x}
|
|
6911
6911
|
in ${y} ${_} ${x};
|
|
@@ -13811,7 +13811,7 @@ ${k.shaderPreludeCode.vertexSource}`,define:k.shaderDefine},defaultProjectionDat
|
|
|
13811
13811
|
</div>
|
|
13812
13812
|
`)}
|
|
13813
13813
|
</or-panel>
|
|
13814
|
-
<div style="margin: 0px auto; font-size: smaller;">OpenRemote Manager v${"1.
|
|
13814
|
+
<div style="margin: 0px auto; font-size: smaller;">OpenRemote Manager v${"1.31.0-snapshot.20260902153911"}</div>
|
|
13815
13815
|
</div>
|
|
13816
13816
|
`})}
|
|
13817
13817
|
`:(0,tk.qy)`<or-translate value="notAuthenticated"></or-translate>`}getManagerConfig(){return eOv(this,void 0,void 0,function*(){let v=yield tC.Ay.rest.api.ConfigurationResource.getManagerConfig();return 200===v.status?v.data:{realms:{default:{appTitle:eOJ.appTitle,headers:[...Object.keys(eOZ),...Object.keys(eOX)]}}}})}getMapConfig(){return eOv(this,void 0,void 0,function*(){let v=yield tC.Ay.rest.api.MapResource.getSettings();if(v.data){let{options:b,sources:y,layers:_,glyphs:x,override:w,sprite:k}=v.data;return{options:b,sources:y,layers:_,glyphs:x,override:w,sprite:k}}return null})}getAccessibleRealms(){return eOv(this,void 0,void 0,function*(){return(yield tC.Ay.rest.api.RealmResource.getAccessible()).data})}saveAllConfigs(v,b){let y;this.loading=!0;let _=[];if(void 0!==this.realmConfigPanel&&(this.realmConfigPanel.getCardElements().forEach((b,y)=>{Object.entries(null==b?void 0:b.getFiles()).forEach(y=>eOv(this,[y],void 0,function*([y,x]){_.push(tC.Ay.rest.api.ConfigurationResource.fileUpload(x,{path:x.path}).then(_=>{v.realms[b.name][y]=_.data}))}))}),this.managerConfiguration=v),this.mapConfigChanged&&(y=tC.Ay.rest.api.MapResource.saveSettings(b).then(()=>{this.mapConfig=b}).catch(v=>{console.error(v)})),this.tilesForUpload){(0,tK.td)(void 0,"configuration.global.uploadingMapTiles");let v=this.tilesForUpload.name;_.push(tC.Ay.rest.api.MapResource.uploadMap({filename:v},{headers:{"Content-Type":"application/octet-stream"},data:this.tilesForUpload}).then(({data:b})=>{this.customMapFilename=v,this.mapConfig=b}).catch(v=>{(0,tK.td)(void 0,"configuration.global.uploadingMapTilesError"),console.error(v)}).finally(()=>{this.tilesForUpload=null}))}Promise.all(_).then(b=>{Promise.all([this.managerConfigurationChanged?tC.Ay.rest.api.ConfigurationResource.update(v):null,this.mapConfigChanged?y:null]).finally(()=>{var v;this.tilesForDeletion&&!this.tilesForUpload&&tC.Ay.rest.api.MapResource.deleteMap().then(({data:v})=>{this.tilesForDeletion=!1,this.customMapFilename=void 0,this.mapConfig=v}).catch(v=>{console.error(v)}),this.requestUpdate(),this.loading=!1,this.managerConfigurationChanged=!1,this.mapConfigChanged=!1,fetch((null!=(v=tC.Ay.managerUrl)?v:"")+"/api/master/configuration/manager",{cache:"reload"}),window.location.reload()})})}};eOg([(0,tA.wk)()],eOb.prototype,"managerConfiguration",void 0),eOg([(0,tA.wk)()],eOb.prototype,"mapConfig",void 0),eOg([(0,tA.wk)()],eOb.prototype,"realms",void 0),eOg([(0,tA.wk)()],eOb.prototype,"loading",void 0),eOg([(0,tA.wk)()],eOb.prototype,"managerConfigurationChanged",void 0),eOg([(0,tA.wk)()],eOb.prototype,"mapConfigChanged",void 0),eOg([(0,tA.wk)()],eOb.prototype,"customMapFilename",void 0),eOg([(0,tA.wk)()],eOb.prototype,"customMapLimit",void 0),eOg([(0,tA.wk)()],eOb.prototype,"tilesForUpload",void 0),eOg([(0,tA.wk)()],eOb.prototype,"tilesForDeletion",void 0),eOg([(0,tA.P)("#managerConfig-panel")],eOb.prototype,"realmConfigPanel",void 0),eOb=eOg([(0,tA.EM)("page-configuration")],eOb);var eOy=function(v,b,y,_){var x,w=arguments.length,k=w<3?b:null===_?_=Object.getOwnPropertyDescriptor(b,y):_;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)k=Reflect.decorate(v,b,y,_);else for(var A=v.length-1;A>=0;A--)(x=v[A])&&(k=(w<3?x(k):w>3?x(b,y,k):x(b,y))||k);return w>3&&k&&Object.defineProperty(b,y,k),k};let eO_=(0,tk.AH)`
|