@openremote/manager 1.25.0-snapshot.20260618120211 → 1.25.0
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.
|
@@ -7018,7 +7018,7 @@ blockquote[dir='rtl'] {
|
|
|
7018
7018
|
<slot name="submenu"></slot>
|
|
7019
7019
|
|
|
7020
7020
|
<slot name="tooltip"></slot>
|
|
7021
|
-
`}ready(){super.ready(),this._tooltipController=new z.I(this),this._tooltipController.setManual(!0),this.addController(this._tooltipController)}}(0,o.X)(ee);var et=i(67949),en=i(38332);function ei(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function er(t,n,i){return n=ea(n),el(t,ed()?Reflect.construct(n,i||[],ea(t).constructor):n.apply(t,i))}function eo(t,n){if(!(t instanceof n))throw TypeError("Cannot call a class as a function")}function ea(t){return(ea=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function es(t,n){if("function"!=typeof n&&null!==n)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&ec(t,n)}function el(t,n){return n&&("object"===eu(n)||"function"==typeof n)?n:ei(t)}function ec(t,n){return(ec=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function eu(t){return t&&"u">typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}function ed(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ed=function(){return!!t})()}var eh=function(t,n,i,r){var o,a=arguments.length,s=a<3?n:null===r?r=Object.getOwnPropertyDescriptor(n,i):r;if(("u"<typeof Reflect?"undefined":eu(Reflect))==="object"&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,n,i,r);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(s=(a<3?o(s):a>3?o(n,i,s):o(n,i))||s);return a>3&&s&&Object.defineProperty(n,i,s),s};function ep(t){var n=document.createElement("vaadin-menu-bar-item");return(0,et.XX)(t,n),n}var ef=function(t){function n(){return eo(this,n),er(this,n,arguments)}return es(n,t),n}(ee);eh([(0,en.EM)("or-vaadin-menu-bar")],ef)},29773(t,n,i){"use strict";let r,o,a,s,l,c,u,d;i.d(n,{F0:()=>oI,Ay:()=>oR});var h={};function p(t,n){return function(){return t.apply(n,arguments)}}i.r(h),i.d(h,{hasBrowserEnv:()=>tr,hasStandardBrowserEnv:()=>ta,hasStandardBrowserWebWorkerEnv:()=>ts,navigator:()=>to,origin:()=>tl});let{toString:f}=Object.prototype,{getPrototypeOf:m}=Object,{iterator:g,toStringTag:v}=Symbol,b=(r=Object.create(null),t=>{let n=f.call(t);return r[n]||(r[n]=n.slice(8,-1).toLowerCase())}),y=t=>(t=t.toLowerCase(),n=>b(n)===t),_=t=>n=>typeof n===t,{isArray:x}=Array,w=_("undefined");function k(t){return null!==t&&!w(t)&&null!==t.constructor&&!w(t.constructor)&&S(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}let C=y("ArrayBuffer");function A(t){let n;return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&C(t.buffer)}let E=_("string"),S=_("function"),T=_("number"),O=t=>null!==t&&"object"==typeof t,F=t=>!0===t||!1===t,M=t=>{if("object"!==b(t))return!1;let n=m(t);return(null===n||n===Object.prototype||null===Object.getPrototypeOf(n))&&!(v in t)&&!(g in t)},I=t=>{if(!O(t)||k(t))return!1;try{return 0===Object.keys(t).length&&Object.getPrototypeOf(t)===Object.prototype}catch(t){return!1}},R=y("Date"),D=y("File"),P=t=>!!(t&&void 0!==t.uri),L=t=>t&&void 0!==t.getParts,N=y("Blob"),z=y("FileList"),j=t=>O(t)&&S(t.pipe),B=function(){return"u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{}}(),U=void 0!==B.FormData?B.FormData:void 0,V=t=>{if(!t)return!1;if(U&&t instanceof U)return!0;let n=m(t);if(!n||n===Object.prototype||!S(t.append))return!1;let i=b(t);return"formdata"===i||"object"===i&&S(t.toString)&&"[object FormData]"===t.toString()},H=y("URLSearchParams"),[q,W,G,Y]=["ReadableStream","Request","Response","Headers"].map(y),Z=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function X(t,n,{allOwnKeys:i=!1}={}){let r,o;if(null!=t)if("object"!=typeof t&&(t=[t]),x(t))for(r=0,o=t.length;r<o;r++)n.call(null,t[r],r,t);else{let o;if(k(t))return;let a=i?Object.getOwnPropertyNames(t):Object.keys(t),s=a.length;for(r=0;r<s;r++)o=a[r],n.call(null,t[o],o,t)}}function K(t,n){let i;if(k(t))return null;n=n.toLowerCase();let r=Object.keys(t),o=r.length;for(;o-- >0;)if(n===(i=r[o]).toLowerCase())return i;return null}let J="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,Q=t=>!w(t)&&t!==J;function ee(...t){let{caseless:n,skipUndefined:i}=Q(this)&&this||{},r={},o=(t,o)=>{if("__proto__"===o||"constructor"===o||"prototype"===o)return;let a=n&&K(r,o)||o,s=eh(r,a)?r[a]:void 0;M(s)&&M(t)?r[a]=ee(s,t):M(t)?r[a]=ee({},t):x(t)?r[a]=t.slice():i&&w(t)||(r[a]=t)};for(let n=0,i=t.length;n<i;n++)t[n]&&X(t[n],o);return r}let et=(t,n,i,{allOwnKeys:r}={})=>(X(n,(n,r)=>{i&&S(n)?Object.defineProperty(t,r,{__proto__:null,value:p(n,i),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,r,{__proto__:null,value:n,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),t),en=t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),ei=(t,n,i,r)=>{t.prototype=Object.create(n.prototype,r),Object.defineProperty(t.prototype,"constructor",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{__proto__:null,value:n.prototype}),i&&Object.assign(t.prototype,i)},er=(t,n,i,r)=>{let o,a,s,l={};if(n=n||{},null==t)return n;do{for(a=(o=Object.getOwnPropertyNames(t)).length;a-- >0;)s=o[a],(!r||r(s,t,n))&&!l[s]&&(n[s]=t[s],l[s]=!0);t=!1!==i&&m(t)}while(t&&(!i||i(t,n))&&t!==Object.prototype);return n},eo=(t,n,i)=>{t=String(t),(void 0===i||i>t.length)&&(i=t.length),i-=n.length;let r=t.indexOf(n,i);return -1!==r&&r===i},ea=t=>{if(!t)return null;if(x(t))return t;let n=t.length;if(!T(n))return null;let i=Array(n);for(;n-- >0;)i[n]=t[n];return i},es=(o="u">typeof Uint8Array&&m(Uint8Array),t=>o&&t instanceof o),el=(t,n)=>{let i,r=(t&&t[g]).call(t);for(;(i=r.next())&&!i.done;){let r=i.value;n.call(t,r[0],r[1])}},ec=(t,n)=>{let i,r=[];for(;null!==(i=t.exec(n));)r.push(i);return r},eu=y("HTMLFormElement"),ed=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,n,i){return n.toUpperCase()+i}),eh=(({hasOwnProperty:t})=>(n,i)=>t.call(n,i))(Object.prototype),ep=y("RegExp"),ef=(t,n)=>{let i=Object.getOwnPropertyDescriptors(t),r={};X(i,(i,o)=>{let a;!1!==(a=n(i,o,t))&&(r[o]=a||i)}),Object.defineProperties(t,r)},em=t=>{ef(t,(n,i)=>{if(S(t)&&["arguments","caller","callee"].includes(i))return!1;if(S(t[i])){if(n.enumerable=!1,"writable"in n){n.writable=!1;return}n.set||(n.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},eg=(t,n)=>{let i={};return(t=>{t.forEach(t=>{i[t]=!0})})(x(t)?t:String(t).split(n)),i},ev=()=>{},eb=(t,n)=>null!=t&&Number.isFinite(t*=1)?t:n;function ey(t){return!!(t&&S(t.append)&&"FormData"===t[v]&&t[g])}let e_=t=>{let n=new WeakSet,i=t=>{if(O(t)){if(n.has(t))return;if(k(t))return t;if(!("toJSON"in t)){n.add(t);let r=x(t)?[]:{};return X(t,(t,n)=>{let o=i(t);w(o)||(r[n]=o)}),n.delete(t),r}}return t};return i(t)},ex=y("AsyncFunction"),ew=t=>t&&(O(t)||S(t))&&S(t.then)&&S(t.catch),ek=(l="function"==typeof setImmediate,c=S(J.postMessage),l?setImmediate:c?(u=`axios@${Math.random()}`,d=[],J.addEventListener("message",({source:t,data:n})=>{t===J&&n===u&&d.length&&d.shift()()},!1),t=>{d.push(t),J.postMessage(u,"*")}):t=>setTimeout(t)),eC="u">typeof queueMicrotask?queueMicrotask.bind(J):"u">typeof process&&process.nextTick||ek,eA=t=>null!=t&&S(t[g]),eE={isArray:x,isArrayBuffer:C,isBuffer:k,isFormData:V,isArrayBufferView:A,isString:E,isNumber:T,isBoolean:F,isObject:O,isPlainObject:M,isEmptyObject:I,isReadableStream:q,isRequest:W,isResponse:G,isHeaders:Y,isUndefined:w,isDate:R,isFile:D,isReactNativeBlob:P,isReactNative:L,isBlob:N,isRegExp:ep,isFunction:S,isStream:j,isURLSearchParams:H,isTypedArray:es,isFileList:z,forEach:X,merge:ee,extend:et,trim:Z,stripBOM:en,inherits:ei,toFlatObject:er,kindOf:b,kindOfTest:y,endsWith:eo,toArray:ea,forEachEntry:el,matchAll:ec,isHTMLForm:eu,hasOwnProperty:eh,hasOwnProp:eh,reduceDescriptors:ef,freezeMethods:em,toObjectSet:eg,toCamelCase:ed,noop:ev,toFiniteNumber:eb,findKey:K,global:J,isContextDefined:Q,isSpecCompliantForm:ey,toJSONObject:e_,isAsyncFn:ex,isThenable:ew,setImmediate:ek,asap:eC,isIterable:eA},eS=eE.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"]),eT=t=>{let n,i,r,o={};return t&&t.split("\n").forEach(function(t){r=t.indexOf(":"),n=t.substring(0,r).trim().toLowerCase(),i=t.substring(r+1).trim(),!n||o[n]&&eS[n]||("set-cookie"===n?o[n]?o[n].push(i):o[n]=[i]:o[n]=o[n]?o[n]+", "+i:i)}),o};function eO(t){let n=0,i=t.length;for(;n<i;){let i=t.charCodeAt(n);if(9!==i&&32!==i)break;n+=1}for(;i>n;){let n=t.charCodeAt(i-1);if(9!==n&&32!==n)break;i-=1}return 0===n&&i===t.length?t:t.slice(n,i)}let eF=RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),eM=RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function eI(t,n){return eE.isArray(t)?t.map(t=>eI(t,n)):eO(String(t).replace(n,""))}let eR=t=>eI(t,eF),eD=t=>eI(t,eM);function eP(t){let n=Object.create(null);return eE.forEach(t.toJSON(),(t,i)=>{n[i]=eD(t)}),n}let eL=Symbol("internals");function eN(t){return t&&String(t).trim().toLowerCase()}function ez(t){return!1===t||null==t?t:eE.isArray(t)?t.map(ez):eR(String(t))}function ej(t){let n,i=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;n=r.exec(t);)i[n[1]]=n[2];return i}let eB=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function e$(t,n,i,r,o){if(eE.isFunction(r))return r.call(this,n,i);if(o&&(n=i),eE.isString(n)){if(eE.isString(r))return -1!==n.indexOf(r);if(eE.isRegExp(r))return r.test(n)}}function eU(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,i)=>n.toUpperCase()+i)}function eV(t,n){let i=eE.toCamelCase(" "+n);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+i,{__proto__:null,value:function(t,i,o){return this[r].call(this,n,t,i,o)},configurable:!0})})}class eH{constructor(t){t&&this.set(t)}set(t,n,i){let r=this;function o(t,n,i){let o=eN(n);if(!o)throw Error("header name must be a non-empty string");let a=eE.findKey(r,o);a&&void 0!==r[a]&&!0!==i&&(void 0!==i||!1===r[a])||(r[a||n]=ez(t))}let a=(t,n)=>eE.forEach(t,(t,i)=>o(t,i,n));if(eE.isPlainObject(t)||t instanceof this.constructor)a(t,n);else if(eE.isString(t)&&(t=t.trim())&&!eB(t))a(eT(t),n);else if(eE.isObject(t)&&eE.isIterable(t)){let i={},r,o;for(let n of t){if(!eE.isArray(n))throw TypeError("Object iterator must return a key-value pair");i[o=n[0]]=(r=i[o])?eE.isArray(r)?[...r,n[1]]:[r,n[1]]:n[1]}a(i,n)}else null!=t&&o(n,t,i);return this}get(t,n){if(t=eN(t)){let i=eE.findKey(this,t);if(i){let t=this[i];if(!n)return t;if(!0===n)return ej(t);if(eE.isFunction(n))return n.call(this,t,i);if(eE.isRegExp(n))return n.exec(t);throw TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=eN(t)){let i=eE.findKey(this,t);return!!(i&&void 0!==this[i]&&(!n||e$(this,this[i],i,n)))}return!1}delete(t,n){let i=this,r=!1;function o(t){if(t=eN(t)){let o=eE.findKey(i,t);o&&(!n||e$(i,i[o],o,n))&&(delete i[o],r=!0)}}return eE.isArray(t)?t.forEach(o):o(t),r}clear(t){let n=Object.keys(this),i=n.length,r=!1;for(;i--;){let o=n[i];(!t||e$(this,this[o],o,t,!0))&&(delete this[o],r=!0)}return r}normalize(t){let n=this,i={};return eE.forEach(this,(r,o)=>{let a=eE.findKey(i,o);if(a){n[a]=ez(r),delete n[o];return}let s=t?eU(o):String(o).trim();s!==o&&delete n[o],n[s]=ez(r),i[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let n=Object.create(null);return eE.forEach(this,(i,r)=>{null!=i&&!1!==i&&(n[r]=t&&eE.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){let i=new this(t);return n.forEach(t=>i.set(t)),i}static accessor(t){let n=(this[eL]=this[eL]={accessors:{}}).accessors,i=this.prototype;function r(t){let r=eN(t);n[r]||(eV(i,t),n[r]=!0)}return eE.isArray(t)?t.forEach(r):r(t),this}}eH.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),eE.reduceDescriptors(eH.prototype,({value:t},n)=>{let i=n[0].toUpperCase()+n.slice(1);return{get:()=>t,set(t){this[i]=t}}}),eE.freezeMethods(eH);let eq=eH,eW="[REDACTED ****]";function eG(t){if(eE.hasOwnProp(t,"toJSON"))return!0;let n=Object.getPrototypeOf(t);for(;n&&n!==Object.prototype;){if(eE.hasOwnProp(n,"toJSON"))return!0;n=Object.getPrototypeOf(n)}return!1}function eY(t,n){let i=new Set(n.map(t=>String(t).toLowerCase())),r=[],o=t=>{let n;if(null===t||"object"!=typeof t||eE.isBuffer(t))return t;if(-1===r.indexOf(t)){if(t instanceof eq&&(t=t.toJSON()),r.push(t),eE.isArray(t))n=[],t.forEach((t,i)=>{let r=o(t);eE.isUndefined(r)||(n[i]=r)});else{if(!eE.isPlainObject(t)&&eG(t))return r.pop(),t;for(let[r,a]of(n=Object.create(null),Object.entries(t))){let t=i.has(r.toLowerCase())?eW:o(a);eE.isUndefined(t)||(n[r]=t)}}return r.pop(),n}};return o(t)}class eZ extends Error{static from(t,n,i,r,o,a){let s=new eZ(t.message,n||t.code,i,r,o);return s.cause=t,s.name=t.name,null!=t.status&&null==s.status&&(s.status=t.status),a&&Object.assign(s,a),s}constructor(t,n,i,r,o){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),i&&(this.config=i),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){let t=this.config,n=t&&eE.hasOwnProp(t,"redact")?t.redact:void 0,i=eE.isArray(n)&&n.length>0?eY(t,n):eE.toJSONObject(t);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:i,code:this.code,status:this.status}}}eZ.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",eZ.ERR_BAD_OPTION="ERR_BAD_OPTION",eZ.ECONNABORTED="ECONNABORTED",eZ.ETIMEDOUT="ETIMEDOUT",eZ.ECONNREFUSED="ECONNREFUSED",eZ.ERR_NETWORK="ERR_NETWORK",eZ.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",eZ.ERR_DEPRECATED="ERR_DEPRECATED",eZ.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",eZ.ERR_BAD_REQUEST="ERR_BAD_REQUEST",eZ.ERR_CANCELED="ERR_CANCELED",eZ.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",eZ.ERR_INVALID_URL="ERR_INVALID_URL",eZ.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";let eX=eZ,eK=null;function eJ(t){return eE.isPlainObject(t)||eE.isArray(t)}function eQ(t){return eE.endsWith(t,"[]")?t.slice(0,-2):t}function e0(t,n,i){return t?t.concat(n).map(function(t,n){return t=eQ(t),!i&&n?"["+t+"]":t}).join(i?".":""):n}function e1(t){return eE.isArray(t)&&!t.some(eJ)}let e2=eE.toFlatObject(eE,{},null,function(t){return/^is[A-Z]/.test(t)}),e5=function(t,n,i){if(!eE.isObject(t))throw TypeError("target must be an object");n=n||new(eK||FormData);let r=(i=eE.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(t,n){return!eE.isUndefined(n[t])})).metaTokens,o=i.visitor||h,a=i.dots,s=i.indexes,l=i.Blob||"u">typeof Blob&&Blob,c=void 0===i.maxDepth?100:i.maxDepth,u=l&&eE.isSpecCompliantForm(n);if(!eE.isFunction(o))throw TypeError("visitor must be a function");function d(t){if(null===t)return"";if(eE.isDate(t))return t.toISOString();if(eE.isBoolean(t))return t.toString();if(!u&&eE.isBlob(t))throw new eX("Blob is not supported. Use a Buffer instead.");return eE.isArrayBuffer(t)||eE.isTypedArray(t)?u&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function h(t,i,o){let l=t;if(eE.isReactNative(n)&&eE.isReactNativeBlob(t))return n.append(e0(o,i,a),d(t)),!1;if(t&&!o&&"object"==typeof t){if(eE.endsWith(i,"{}"))i=r?i:i.slice(0,-2),t=JSON.stringify(t);else if(eE.isArray(t)&&e1(t)||(eE.isFileList(t)||eE.endsWith(i,"[]"))&&(l=eE.toArray(t)))return i=eQ(i),l.forEach(function(t,r){eE.isUndefined(t)||null===t||n.append(!0===s?e0([i],r,a):null===s?i:i+"[]",d(t))}),!1}return!!eJ(t)||(n.append(e0(o,i,a),d(t)),!1)}let p=[],f=Object.assign(e2,{defaultVisitor:h,convertValue:d,isVisitable:eJ});function m(t,i,r=0){if(!eE.isUndefined(t)){if(r>c)throw new eX("Object is too deeply nested ("+r+" levels). Max depth: "+c,eX.ERR_FORM_DATA_DEPTH_EXCEEDED);if(-1!==p.indexOf(t))throw Error("Circular reference detected in "+i.join("."));p.push(t),eE.forEach(t,function(t,a){!0===(!(eE.isUndefined(t)||null===t)&&o.call(n,t,eE.isString(a)?a.trim():a,i,f))&&m(t,i?i.concat(a):[a],r+1)}),p.pop()}}if(!eE.isObject(t))throw TypeError("data must be an object");return m(t),n};function e3(t){let n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(t).replace(/[!'()~]|%20/g,function(t){return n[t]})}function e4(t,n){this._pairs=[],t&&e5(t,this,n)}let e6=e4.prototype;e6.append=function(t,n){this._pairs.push([t,n])},e6.toString=function(t){let n=t?function(n){return t.call(this,n,e3)}:e3;return this._pairs.map(function(t){return n(t[0])+"="+n(t[1])},"").join("&")};let e8=e4;function e7(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function e9(t,n,i){let r;if(!n)return t;let o=i&&i.encode||e7,a=eE.isFunction(i)?{serialize:i}:i,s=a&&a.serialize;if(r=s?s(n,a):eE.isURLSearchParams(n)?n.toString():new e8(n,a).toString(o)){let n=t.indexOf("#");-1!==n&&(t=t.slice(0,n)),t+=(-1===t.indexOf("?")?"?":"&")+r}return t}class te{constructor(){this.handlers=[]}use(t,n,i){return this.handlers.push({fulfilled:t,rejected:n,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){eE.forEach(this.handlers,function(n){null!==n&&t(n)})}}let tt=te,tn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},ti={isBrowser:!0,classes:{URLSearchParams:"u">typeof URLSearchParams?URLSearchParams:e8,FormData:"u">typeof FormData?FormData:null,Blob:"u">typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},tr="u">typeof window&&"u">typeof document,to="object"==typeof navigator&&navigator||void 0,ta=tr&&(!to||0>["ReactNative","NativeScript","NS"].indexOf(to.product)),ts="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,tl=tr&&window.location.href||"http://localhost",tc={...h,...ti};function tu(t,n){return e5(t,new tc.classes.URLSearchParams,{visitor:function(t,n,i,r){return tc.isNode&&eE.isBuffer(t)?(this.append(n,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...n})}function td(t){return eE.matchAll(/\w+|\[(\w*)]/g,t).map(t=>"[]"===t[0]?"":t[1]||t[0])}function th(t){let n,i,r={},o=Object.keys(t),a=o.length;for(n=0;n<a;n++)r[i=o[n]]=t[i];return r}let tp=function(t){function n(t,i,r,o){let a=t[o++];if("__proto__"===a)return!0;let s=Number.isFinite(+a),l=o>=t.length;return(a=!a&&eE.isArray(r)?r.length:a,l)?eE.hasOwnProp(r,a)?r[a]=eE.isArray(r[a])?r[a].concat(i):[r[a],i]:r[a]=i:(eE.hasOwnProp(r,a)&&eE.isObject(r[a])||(r[a]=[]),n(t,i,r[a],o)&&eE.isArray(r[a])&&(r[a]=th(r[a]))),!s}if(eE.isFormData(t)&&eE.isFunction(t.entries)){let i={};return eE.forEachEntry(t,(t,r)=>{n(td(t),r,i,0)}),i}return null},tf=(t,n)=>null!=t&&eE.hasOwnProp(t,n)?t[n]:void 0;function tm(t,n,i){if(eE.isString(t))try{return(n||JSON.parse)(t),eE.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(i||JSON.stringify)(t)}let tg={transitional:tn,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){let i,r=n.getContentType()||"",o=r.indexOf("application/json")>-1,a=eE.isObject(t);if(a&&eE.isHTMLForm(t)&&(t=new FormData(t)),eE.isFormData(t))return o?JSON.stringify(tp(t)):t;if(eE.isArrayBuffer(t)||eE.isBuffer(t)||eE.isStream(t)||eE.isFile(t)||eE.isBlob(t)||eE.isReadableStream(t))return t;if(eE.isArrayBufferView(t))return t.buffer;if(eE.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();if(a){let n=tf(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return tu(t,n).toString();if((i=eE.isFileList(t))||r.indexOf("multipart/form-data")>-1){let r=tf(this,"env"),o=r&&r.FormData;return e5(i?{"files[]":t}:t,o&&new o,n)}}return a||o?(n.setContentType("application/json",!1),tm(t)):t}],transformResponse:[function(t){let n=tf(this,"transitional")||tg.transitional,i=n&&n.forcedJSONParsing,r=tf(this,"responseType"),o="json"===r;if(eE.isResponse(t)||eE.isReadableStream(t))return t;if(t&&eE.isString(t)&&(i&&!r||o)){let i=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t,tf(this,"parseReviver"))}catch(t){if(i){if("SyntaxError"===t.name)throw eX.from(t,eX.ERR_BAD_RESPONSE,this,null,tf(this,"response"));throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:tc.classes.FormData,Blob:tc.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};eE.forEach(["delete","get","head","post","put","patch","query"],t=>{tg.headers[t]={}});let tv=tg;function tb(t,n){let i=this||tv,r=n||i,o=eq.from(r.headers),a=r.data;return eE.forEach(t,function(t){a=t.call(i,a,o.normalize(),n?n.status:void 0)}),o.normalize(),a}function ty(t){return!!(t&&t.__CANCEL__)}class t_ extends eX{constructor(t,n,i){super(null==t?"canceled":t,eX.ERR_CANCELED,n,i),this.name="CanceledError",this.__CANCEL__=!0}}let tx=t_;function tw(t,n,i){let r=i.config.validateStatus;!i.status||!r||r(i.status)?t(i):n(new eX("Request failed with status code "+i.status,i.status>=400&&i.status<500?eX.ERR_BAD_REQUEST:eX.ERR_BAD_RESPONSE,i.config,i.request,i))}function tk(t){let n=/^([-+\w]{1,25}):(?:\/\/)?/.exec(t);return n&&n[1]||""}let tC=function(t,n){let i,r=Array(t=t||10),o=Array(t),a=0,s=0;return n=void 0!==n?n:1e3,function(l){let c=Date.now(),u=o[s];i||(i=c),r[a]=l,o[a]=c;let d=s,h=0;for(;d!==a;)h+=r[d++],d%=t;if((a=(a+1)%t)===s&&(s=(s+1)%t),c-i<n)return;let p=u&&c-u;return p?Math.round(1e3*h/p):void 0}},tA=function(t,n){let i,r,o=0,a=1e3/n,s=(n,a=Date.now())=>{o=a,i=null,r&&(clearTimeout(r),r=null),t(...n)};return[(...t)=>{let n=Date.now(),l=n-o;l>=a?s(t,n):(i=t,r||(r=setTimeout(()=>{r=null,s(i)},a-l)))},()=>i&&s(i)]},tE=(t,n,i=3)=>{let r=0,o=tC(50,250);return tA(i=>{if(!i||"number"!=typeof i.loaded)return;let a=i.loaded,s=i.lengthComputable?i.total:void 0,l=null!=s?Math.min(a,s):a,c=Math.max(0,l-r),u=o(c);r=Math.max(r,l),t({loaded:l,total:s,progress:s?l/s:void 0,bytes:c,rate:u||void 0,estimated:u&&s?(s-l)/u:void 0,event:i,lengthComputable:null!=s,[n?"download":"upload"]:!0})},i)},tS=(t,n)=>{let i=null!=t;return[r=>n[0]({lengthComputable:i,total:t,loaded:r}),n[1]]},tT=t=>(...n)=>eE.asap(()=>t(...n)),tO=tc.hasStandardBrowserEnv?(a=new URL(tc.origin),s=tc.navigator&&/(msie|trident)/i.test(tc.navigator.userAgent),t=>(t=new URL(t,tc.origin),a.protocol===t.protocol&&a.host===t.host&&(s||a.port===t.port))):()=>!0,tF=tc.hasStandardBrowserEnv?{write(t,n,i,r,o,a,s){if("u"<typeof document)return;let l=[`${t}=${encodeURIComponent(n)}`];eE.isNumber(i)&&l.push(`expires=${new Date(i).toUTCString()}`),eE.isString(r)&&l.push(`path=${r}`),eE.isString(o)&&l.push(`domain=${o}`),!0===a&&l.push("secure"),eE.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(t){if("u"<typeof document)return null;let n=document.cookie.split(";");for(let i=0;i<n.length;i++){let r=n[i].replace(/^\s+/,""),o=r.indexOf("=");if(-1!==o&&r.slice(0,o)===t)return decodeURIComponent(r.slice(o+1))}return null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function tM(t){return"string"==typeof t&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function tI(t,n){return n?t.replace(/\/?\/$/,"")+"/"+n.replace(/^\/+/,""):t}function tR(t,n,i){let r=!tM(n);return t&&(r||!1===i)?tI(t,n):n}let tD=t=>t instanceof eq?{...t}:t;function tP(t,n){n=n||{};let i=Object.create(null);function r(t,n,i,r){return eE.isPlainObject(t)&&eE.isPlainObject(n)?eE.merge.call({caseless:r},t,n):eE.isPlainObject(n)?eE.merge({},n):eE.isArray(n)?n.slice():n}function o(t,n,i,o){return eE.isUndefined(n)?eE.isUndefined(t)?void 0:r(void 0,t,i,o):r(t,n,i,o)}function a(t,n){if(!eE.isUndefined(n))return r(void 0,n)}function s(t,n){return eE.isUndefined(n)?eE.isUndefined(t)?void 0:r(void 0,t):r(void 0,n)}function l(i,o,a){return eE.hasOwnProp(n,a)?r(i,o):eE.hasOwnProp(t,a)?r(void 0,i):void 0}Object.defineProperty(i,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});let c={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,allowedSocketPaths:s,responseEncoding:s,validateStatus:l,headers:(t,n,i)=>o(tD(t),tD(n),i,!0)};return eE.forEach(Object.keys({...t,...n}),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;let a=eE.hasOwnProp(c,r)?c[r]:o,s=a(eE.hasOwnProp(t,r)?t[r]:void 0,eE.hasOwnProp(n,r)?n[r]:void 0,r);eE.isUndefined(s)&&a!==l||(i[r]=s)}),i}let tL=["content-type","content-length"];function tN(t,n,i){"content-only"!==i?t.set(n):Object.entries(n).forEach(([n,i])=>{tL.includes(n.toLowerCase())&&t.set(n,i)})}let tz=t=>encodeURIComponent(t).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16))),tj=t=>{let n=tP({},t),i=t=>eE.hasOwnProp(n,t)?n[t]:void 0,r=i("data"),o=i("withXSRFToken"),a=i("xsrfHeaderName"),s=i("xsrfCookieName"),l=i("headers"),c=i("auth"),u=i("baseURL"),d=i("allowAbsoluteUrls"),h=i("url");if(n.headers=l=eq.from(l),n.url=e9(tR(u,h,d),t.params,t.paramsSerializer),c&&l.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?tz(c.password):""))),eE.isFormData(r)&&(tc.hasStandardBrowserEnv||tc.hasStandardBrowserWebWorkerEnv?l.setContentType(void 0):eE.isFunction(r.getHeaders)&&tN(l,r.getHeaders(),i("formDataHeaderPolicy"))),tc.hasStandardBrowserEnv&&(eE.isFunction(o)&&(o=o(n)),!0===o||null==o&&tO(n.url))){let t=a&&s&&tF.read(s);t&&l.set(a,t)}return n},tB="u">typeof XMLHttpRequest&&function(t){return new Promise(function(n,i){let r,o,a,s,l,c=tj(t),u=c.data,d=eq.from(c.headers).normalize(),{responseType:h,onUploadProgress:p,onDownloadProgress:f}=c;function m(){s&&s(),l&&l(),c.cancelToken&&c.cancelToken.unsubscribe(r),c.signal&&c.signal.removeEventListener("abort",r)}let g=new XMLHttpRequest;function v(){if(!g)return;let r=eq.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());tw(function(t){n(t),m()},function(t){i(t),m()},{data:h&&"text"!==h&&"json"!==h?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:t,request:g}),g=null}g.open(c.method.toUpperCase(),c.url,!0),g.timeout=c.timeout,"onloadend"in g?g.onloadend=v:g.onreadystatechange=function(){!g||4!==g.readyState||(0!==g.status||g.responseURL&&g.responseURL.startsWith("file:"))&&setTimeout(v)},g.onabort=function(){g&&(i(new eX("Request aborted",eX.ECONNABORTED,t,g)),m(),g=null)},g.onerror=function(n){let r=new eX(n&&n.message?n.message:"Network Error",eX.ERR_NETWORK,t,g);r.event=n||null,i(r),m(),g=null},g.ontimeout=function(){let n=c.timeout?"timeout of "+c.timeout+"ms exceeded":"timeout exceeded",r=c.transitional||tn;c.timeoutErrorMessage&&(n=c.timeoutErrorMessage),i(new eX(n,r.clarifyTimeoutError?eX.ETIMEDOUT:eX.ECONNABORTED,t,g)),m(),g=null},void 0===u&&d.setContentType(null),"setRequestHeader"in g&&eE.forEach(eP(d),function(t,n){g.setRequestHeader(n,t)}),eE.isUndefined(c.withCredentials)||(g.withCredentials=!!c.withCredentials),h&&"json"!==h&&(g.responseType=c.responseType),f&&([a,l]=tE(f,!0),g.addEventListener("progress",a)),p&&g.upload&&([o,s]=tE(p),g.upload.addEventListener("progress",o),g.upload.addEventListener("loadend",s)),(c.cancelToken||c.signal)&&(r=n=>{g&&(i(!n||n.type?new tx(null,t,g):n),g.abort(),m(),g=null)},c.cancelToken&&c.cancelToken.subscribe(r),c.signal&&(c.signal.aborted?r():c.signal.addEventListener("abort",r)));let b=tk(c.url);b&&!tc.protocols.includes(b)?i(new eX("Unsupported protocol "+b+":",eX.ERR_BAD_REQUEST,t)):g.send(u||null)})},t$=(t,n)=>{if(t=t?t.filter(Boolean):[],!n&&!t.length)return;let i=new AbortController,r=!1,o=function(t){if(!r){r=!0,s();let n=t instanceof Error?t:this.reason;i.abort(n instanceof eX?n:new tx(n instanceof Error?n.message:n))}},a=n&&setTimeout(()=>{a=null,o(new eX(`timeout of ${n}ms exceeded`,eX.ETIMEDOUT))},n),s=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(t=>{t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)}),t=null)};t.forEach(t=>t.addEventListener("abort",o));let{signal:l}=i;return l.unsubscribe=()=>eE.asap(s),l},tU=function*(t,n){let i,r=t.byteLength;if(!n||r<n)return void(yield t);let o=0;for(;o<r;)i=o+n,yield t.slice(o,i),o=i},tV=async function*(t,n){for await(let i of tH(t))yield*tU(i,n)},tH=async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);let n=t.getReader();try{for(;;){let{done:t,value:i}=await n.read();if(t)break;yield i}}finally{await n.cancel()}},tq=(t,n,i,r)=>{let o,a=tV(t,n),s=0,l=t=>{!o&&(o=!0,r&&r(t))};return new ReadableStream({async pull(t){try{let{done:n,value:r}=await a.next();if(n){l(),t.close();return}let o=r.byteLength;if(i){let t=s+=o;i(t)}t.enqueue(new Uint8Array(r))}catch(t){throw l(t),t}},cancel:t=>(l(t),a.return())},{highWaterMark:2})};function tW(t){if(!t||"string"!=typeof t||!t.startsWith("data:"))return 0;let n=t.indexOf(",");if(n<0)return 0;let i=t.slice(5,n),r=t.slice(n+1);if(/;base64/i.test(i)){let t=r.length,n=r.length;for(let i=0;i<n;i++)if(37===r.charCodeAt(i)&&i+2<n){let n=r.charCodeAt(i+1),o=r.charCodeAt(i+2);(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102)&&(o>=48&&o<=57||o>=65&&o<=70||o>=97&&o<=102)&&(t-=2,i+=2)}let i=0,o=n-1,a=t=>t>=2&&37===r.charCodeAt(t-2)&&51===r.charCodeAt(t-1)&&(68===r.charCodeAt(t)||100===r.charCodeAt(t));o>=0&&(61===r.charCodeAt(o)?(i++,o--):a(o)&&(i++,o-=3)),1===i&&o>=0&&(61===r.charCodeAt(o)?i++:a(o)&&i++);let s=3*Math.floor(t/4)-(i||0);return s>0?s:0}if("u">typeof Buffer&&"function"==typeof Buffer.byteLength)return Buffer.byteLength(r,"utf8");let o=0;for(let t=0,n=r.length;t<n;t++){let i=r.charCodeAt(t);if(i<128)o+=1;else if(i<2048)o+=2;else if(i>=55296&&i<=56319&&t+1<n){let n=r.charCodeAt(t+1);n>=56320&&n<=57343?(o+=4,t++):o+=3}else o+=3}return o}let tG=65536,{isFunction:tY}=eE,tZ=(t,...n)=>{try{return!!t(...n)}catch(t){return!1}},tX=t=>{let n,i=void 0!==eE.global&&null!==eE.global?eE.global:globalThis,{ReadableStream:r,TextEncoder:o}=i,{fetch:a,Request:s,Response:l}=t=eE.merge.call({skipUndefined:!0},{Request:i.Request,Response:i.Response},t),c=a?tY(a):"function"==typeof fetch,u=tY(s),d=tY(l);if(!c)return!1;let h=c&&tY(r),p=c&&("function"==typeof o?(n=new o,t=>n.encode(t)):async t=>new Uint8Array(await new s(t).arrayBuffer())),f=u&&h&&tZ(()=>{let t=!1,n=new s(tc.origin,{body:new r,method:"POST",get duplex(){return t=!0,"half"}}),i=n.headers.has("Content-Type");return null!=n.body&&n.body.cancel(),t&&!i}),m=d&&h&&tZ(()=>eE.isReadableStream(new l("").body)),g={stream:m&&(t=>t.body)};c&&(()=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{g[t]||(g[t]=(n,i)=>{let r=n&&n[t];if(r)return r.call(n);throw new eX(`Response type '${t}' is not supported`,eX.ERR_NOT_SUPPORT,i)})})})();let v=async t=>{if(null==t)return 0;if(eE.isBlob(t))return t.size;if(eE.isSpecCompliantForm(t)){let n=new s(tc.origin,{method:"POST",body:t});return(await n.arrayBuffer()).byteLength}return eE.isArrayBufferView(t)||eE.isArrayBuffer(t)?t.byteLength:(eE.isURLSearchParams(t)&&(t+=""),eE.isString(t))?(await p(t)).byteLength:void 0},b=async(t,n)=>{let i=eE.toFiniteNumber(t.getContentLength());return null==i?v(n):i};return async t=>{let n,{url:i,method:r,data:c,signal:d,cancelToken:h,timeout:p,onDownloadProgress:v,onUploadProgress:y,responseType:_,headers:x,withCredentials:w="same-origin",fetchOptions:k,maxContentLength:C,maxBodyLength:A}=tj(t),E=eE.isNumber(C)&&C>-1,S=eE.isNumber(A)&&A>-1,T=a||fetch;_=_?(_+"").toLowerCase():"text";let O=t$([d,h&&h.toAbortSignal()],p),F=null,M=O&&O.unsubscribe&&(()=>{O.unsubscribe()});try{if(E&&"string"==typeof i&&i.startsWith("data:")&&tW(i)>C)throw new eX("maxContentLength size of "+C+" exceeded",eX.ERR_BAD_RESPONSE,t,F);if(S&&"get"!==r&&"head"!==r){let n=await b(x,c);if("number"==typeof n&&isFinite(n)&&n>A)throw new eX("Request body larger than maxBodyLength limit",eX.ERR_BAD_REQUEST,t,F)}if(y&&f&&"get"!==r&&"head"!==r&&0!==(n=await b(x,c))){let t,r=new s(i,{method:"POST",body:c,duplex:"half"});if(eE.isFormData(c)&&(t=r.headers.get("content-type"))&&x.setContentType(t),r.body){let[t,i]=tS(n,tE(tT(y)));c=tq(r.body,tG,t,i)}}eE.isString(w)||(w=w?"include":"omit");let a=u&&"credentials"in s.prototype;if(eE.isFormData(c)){let t=x.getContentType();t&&/^multipart\/form-data/i.test(t)&&!/boundary=/i.test(t)&&x.delete("content-type")}x.set("User-Agent","axios/1.16.1",!1);let d={...k,signal:O,method:r.toUpperCase(),headers:eP(x.normalize()),body:c,duplex:"half",credentials:a?w:void 0};F=u&&new s(i,d);let h=await (u?T(F,k):T(i,d));if(E){let n=eE.toFiniteNumber(h.headers.get("content-length"));if(null!=n&&n>C)throw new eX("maxContentLength size of "+C+" exceeded",eX.ERR_BAD_RESPONSE,t,F)}let p=m&&("stream"===_||"response"===_);if(m&&h.body&&(v||E||p&&M)){let n={};["status","statusText","headers"].forEach(t=>{n[t]=h[t]});let i=eE.toFiniteNumber(h.headers.get("content-length")),[r,o]=v&&tS(i,tE(tT(v),!0))||[],a=0,s=n=>{if(E&&(a=n)>C)throw new eX("maxContentLength size of "+C+" exceeded",eX.ERR_BAD_RESPONSE,t,F);r&&r(n)};h=new l(tq(h.body,tG,s,()=>{o&&o(),M&&M()}),n)}_=_||"text";let I=await g[eE.findKey(g,_)||"text"](h,t);if(E&&!m&&!p){let n;if(null!=I&&("number"==typeof I.byteLength?n=I.byteLength:"number"==typeof I.size?n=I.size:"string"==typeof I&&(n="function"==typeof o?new o().encode(I).byteLength:I.length)),"number"==typeof n&&n>C)throw new eX("maxContentLength size of "+C+" exceeded",eX.ERR_BAD_RESPONSE,t,F)}return!p&&M&&M(),await new Promise((n,i)=>{tw(n,i,{data:I,headers:eq.from(h.headers),status:h.status,statusText:h.statusText,config:t,request:F})})}catch(n){if(M&&M(),O&&O.aborted&&O.reason instanceof eX){let i=O.reason;throw i.config=t,F&&(i.request=F),n!==i&&(i.cause=n),i}if(n&&"TypeError"===n.name&&/Load failed|fetch/i.test(n.message))throw Object.assign(new eX("Network Error",eX.ERR_NETWORK,t,F,n&&n.response),{cause:n.cause||n});throw eX.from(n,n&&n.code,t,F,n&&n.response)}}},tK=new Map,tJ=t=>{let n=t&&t.env||{},{fetch:i,Request:r,Response:o}=n,a=[r,o,i],s=a.length,l,c,u=tK;for(;s--;)l=a[s],void 0===(c=u.get(l))&&u.set(l,c=s?new Map:tX(n)),u=c;return c};tJ();let tQ={http:eK,xhr:tB,fetch:{get:tJ}};eE.forEach(tQ,(t,n)=>{if(t){try{Object.defineProperty(t,"name",{__proto__:null,value:n})}catch(t){}Object.defineProperty(t,"adapterName",{__proto__:null,value:n})}});let t0=t=>`- ${t}`,t1=t=>eE.isFunction(t)||null===t||!1===t,t2=function(t,n){let i,r,{length:o}=t=eE.isArray(t)?t:[t],a={};for(let s=0;s<o;s++){let o;if(r=i=t[s],!t1(i)&&void 0===(r=tQ[(o=String(i)).toLowerCase()]))throw new eX(`Unknown adapter '${o}'`);if(r&&(eE.isFunction(r)||(r=r.get(n))))break;a[o||"#"+s]=r}if(!r){let t=Object.entries(a).map(([t,n])=>`adapter ${t} `+(!1===n?"is not supported by the environment":"is not available in the build"));throw new eX("There is no suitable adapter to dispatch the request "+(o?t.length>1?"since :\n"+t.map(t0).join("\n"):" "+t0(t[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function t5(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new tx(null,t)}function t3(t){return t5(t),t.headers=eq.from(t.headers),t.data=tb.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),t2(t.adapter||tv.adapter,t)(t).then(function(n){t5(t),t.response=n;try{n.data=tb.call(t,t.transformResponse,n)}finally{delete t.response}return n.headers=eq.from(n.headers),n},function(n){if(!ty(n)&&(t5(t),n&&n.response)){t.response=n.response;try{n.response.data=tb.call(t,t.transformResponse,n.response)}finally{delete t.response}n.response.headers=eq.from(n.response.headers)}return Promise.reject(n)})}let t4={};["object","boolean","number","function","string","symbol"].forEach((t,n)=>{t4[t]=function(i){return typeof i===t||"a"+(n<1?"n ":" ")+t}});let t6={};t4.transitional=function(t,n,i){function r(t,n){return"[Axios v1.16.1] Transitional option '"+t+"'"+n+(i?". "+i:"")}return(i,o,a)=>{if(!1===t)throw new eX(r(o," has been removed"+(n?" in "+n:"")),eX.ERR_DEPRECATED);return n&&!t6[o]&&(t6[o]=!0,console.warn(r(o," has been deprecated since v"+n+" and will be removed in the near future"))),!t||t(i,o,a)}},t4.spelling=function(t){return(n,i)=>(console.warn(`${i} is likely a misspelling of ${t}`),!0)};let t8=function(t,n,i){if("object"!=typeof t)throw new eX("options must be an object",eX.ERR_BAD_OPTION_VALUE);let r=Object.keys(t),o=r.length;for(;o-- >0;){let a=r[o],s=Object.prototype.hasOwnProperty.call(n,a)?n[a]:void 0;if(s){let n=t[a],i=void 0===n||s(n,a,t);if(!0!==i)throw new eX("option "+a+" must be "+i,eX.ERR_BAD_OPTION_VALUE);continue}if(!0!==i)throw new eX("Unknown option "+a,eX.ERR_BAD_OPTION)}},t7=t4;class t9{constructor(t){this.defaults=t||{},this.interceptors={request:new tt,response:new tt}}async request(t,n){try{return await this._request(t,n)}catch(t){if(t instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=Error();let i=(()=>{if(!n.stack)return"";let t=n.stack.indexOf("\n");return -1===t?"":n.stack.slice(t+1)})();try{if(t.stack){if(i){let n=i.indexOf("\n"),r=-1===n?-1:i.indexOf("\n",n+1),o=-1===r?"":i.slice(r+1);String(t.stack).endsWith(o)||(t.stack+="\n"+i)}}else t.stack=i}catch(t){}}throw t}}_request(t,n){let i,r;"string"==typeof t?(n=n||{}).url=t:n=t||{};let{transitional:o,paramsSerializer:a,headers:s}=n=tP(this.defaults,n);void 0!==o&&t8(o,{silentJSONParsing:t7.transitional(t7.boolean),forcedJSONParsing:t7.transitional(t7.boolean),clarifyTimeoutError:t7.transitional(t7.boolean),legacyInterceptorReqResOrdering:t7.transitional(t7.boolean)},!1),null!=a&&(eE.isFunction(a)?n.paramsSerializer={serialize:a}:t8(a,{encode:t7.function,serialize:t7.function},!0)),void 0!==n.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),t8(n,{baseUrl:t7.spelling("baseURL"),withXsrfToken:t7.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=s&&eE.merge(s.common,s[n.method]);s&&eE.forEach(["delete","get","head","post","put","patch","query","common"],t=>{delete s[t]}),n.headers=eq.concat(l,s);let c=[],u=!0;this.interceptors.request.forEach(function(t){if("function"==typeof t.runWhen&&!1===t.runWhen(n))return;u=u&&t.synchronous;let i=n.transitional||tn;i&&i.legacyInterceptorReqResOrdering?c.unshift(t.fulfilled,t.rejected):c.push(t.fulfilled,t.rejected)});let d=[];this.interceptors.response.forEach(function(t){d.push(t.fulfilled,t.rejected)});let h=0;if(!u){let t=[t3.bind(this),void 0];for(t.unshift(...c),t.push(...d),r=t.length,i=Promise.resolve(n);h<r;)i=i.then(t[h++],t[h++]);return i}r=c.length;let p=n;for(;h<r;){let t=c[h++],n=c[h++];try{p=t(p)}catch(t){n.call(this,t);break}}try{i=t3.call(this,p)}catch(t){return Promise.reject(t)}for(h=0,r=d.length;h<r;)i=i.then(d[h++],d[h++]);return i}getUri(t){return e9(tR((t=tP(this.defaults,t)).baseURL,t.url,t.allowAbsoluteUrls),t.params,t.paramsSerializer)}}eE.forEach(["delete","get","head","options"],function(t){t9.prototype[t]=function(n,i){return this.request(tP(i||{},{method:t,url:n,data:(i||{}).data}))}}),eE.forEach(["post","put","patch","query"],function(t){function n(n){return function(i,r,o){return this.request(tP(o||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:r}))}}t9.prototype[t]=n(),"query"!==t&&(t9.prototype[t+"Form"]=n(!0))});let ne=t9;class nt{constructor(t){let n;if("function"!=typeof t)throw TypeError("executor must be a function.");this.promise=new Promise(function(t){n=t});const i=this;this.promise.then(t=>{if(!i._listeners)return;let n=i._listeners.length;for(;n-- >0;)i._listeners[n](t);i._listeners=null}),this.promise.then=t=>{let n,r=new Promise(t=>{i.subscribe(t),n=t}).then(t);return r.cancel=function(){i.unsubscribe(n)},r},t(function(t,r,o){i.reason||(i.reason=new tx(t,r,o),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let n=this._listeners.indexOf(t);-1!==n&&this._listeners.splice(n,1)}toAbortSignal(){let t=new AbortController,n=n=>{t.abort(n)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new nt(function(n){t=n}),cancel:t}}}let nn=nt;function ni(t){return function(n){return t.apply(null,n)}}function nr(t){return eE.isObject(t)&&!0===t.isAxiosError}let no={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(no).forEach(([t,n])=>{no[n]=t});let na=no;function ns(t){let n=new ne(t),i=p(ne.prototype.request,n);return eE.extend(i,ne.prototype,n,{allOwnKeys:!0}),eE.extend(i,n,null,{allOwnKeys:!0}),i.create=function(n){return ns(tP(t,n))},i}let nl=ns(tv);nl.Axios=ne,nl.CanceledError=tx,nl.CancelToken=nn,nl.isCancel=ty,nl.VERSION="1.16.1",nl.toFormData=e5,nl.AxiosError=eX,nl.Cancel=nl.CanceledError,nl.all=function(t){return Promise.all(t)},nl.spread=ni,nl.isAxiosError=nr,nl.mergeConfig=tP,nl.AxiosHeaders=eq,nl.formToJSON=t=>tp(eE.isHTMLForm(t)?new FormData(t):t),nl.getAdapter=t2,nl.HttpStatusCode=na,nl.default=nl;let nc=nl;function nu(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function nd(t,n,i){return n=nm(n),nv(t,nx()?Reflect.construct(n,i||[],nm(t).constructor):n.apply(t,i))}function nh(t,n){if(!(t instanceof n))throw TypeError("Cannot call a class as a function")}function np(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function nf(t,n,i){return n&&np(t.prototype,n),i&&np(t,i),t}function nm(t){return(nm=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ng(t,n){if("function"!=typeof n&&null!==n)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&nb(t,n)}function nv(t,n){return n&&("object"===n_(n)||"function"==typeof n)?n:nu(t)}function nb(t,n){return(nb=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function ny(t,n){return n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}}))}function n_(t){return t&&"u">typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}function nx(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(nx=function(){return!!t})()}function nw(){var t=ny(["console/register"]);return nw=function(){return t},t}function nk(){var t=ny(["service"]);return nk=function(){return t},t}function nC(){var t=ny(["service"]);return nC=function(){return t},t}function nA(){var t=ny(["service/global"]);return nA=function(){return t},t}function nE(){var t=ny(["service/global"]);return nE=function(){return t},t}function nS(){var t=ny(["service/","/",""]);return nS=function(){return t},t}function nT(){var t=ny(["service/","/",""]);return nT=function(){return t},t}function nO(){var t=ny(["service/","/",""]);return nO=function(){return t},t}function nF(){var t=ny(["configuration/manager"]);return nF=function(){return t},t}function nM(){var t=ny(["configuration/manager"]);return nM=function(){return t},t}function nI(){var t=ny(["configuration/manager/file"]);return nI=function(){return t},t}function nR(){var t=ny(["configuration/manager/image/",""]);return nR=function(){return t},t}function nD(){var t=ny(["asset/predicted/","/",""]);return nD=function(){return t},t}function nP(){var t=ny(["asset/predicted/","/",""]);return nP=function(){return t},t}function nL(){var t=ny(["agent/assetDiscovery/",""]);return nL=function(){return t},t}function nN(){var t=ny(["agent/assetImport/",""]);return nN=function(){return t},t}function nz(){var t=ny(["agent/instanceDiscovery/",""]);return nz=function(){return t},t}function nj(){var t=ny(["asset/datapoint/export"]);return nj=function(){return t},t}function nB(){var t=ny(["asset/datapoint/periods"]);return nB=function(){return t},t}function n$(){var t=ny(["asset/datapoint/","/",""]);return n$=function(){return t},t}function nU(){var t=ny(["syslog/config"]);return nU=function(){return t},t}function nV(){var t=ny(["syslog/config"]);return nV=function(){return t},t}function nH(){var t=ny(["syslog/event"]);return nH=function(){return t},t}function nq(){var t=ny(["syslog/event"]);return nq=function(){return t},t}function nW(){var t=ny(["gateway/tunnel"]);return nW=function(){return t},t}function nG(){var t=ny(["gateway/tunnel"]);return nG=function(){return t},t}function nY(){var t=ny(["gateway/tunnel/",""]);return nY=function(){return t},t}function nZ(){var t=ny(["gateway/tunnel/","/",""]);return nZ=function(){return t},t}function nX(){var t=ny(["gateway/tunnel/","/","/","/",""]);return nX=function(){return t},t}function nK(){var t=ny(["apps"]);return nK=function(){return t},t}function nJ(){var t=ny(["apps/consoleConfig"]);return nJ=function(){return t},t}function nQ(){var t=ny(["apps/info"]);return nQ=function(){return t},t}function n0(){var t=ny(["model/assetDescriptors"]);return n0=function(){return t},t}function n1(){var t=ny(["model/assetInfo/",""]);return n1=function(){return t},t}function n2(){var t=ny(["model/assetInfos"]);return n2=function(){return t},t}function n5(){var t=ny(["model/getValueDescriptorSchema"]);return n5=function(){return t},t}function n3(){var t=ny(["model/metaItemDescriptors"]);return n3=function(){return t},t}function n4(){var t=ny(["model/valueDescriptors"]);return n4=function(){return t},t}function n6(){var t=ny(["health"]);return n6=function(){return t},t}function n8(){var t=ny(["info"]);return n8=function(){return t},t}function n7(){var t=ny(["gateway/connection"]);return n7=function(){return t},t}function n9(){var t=ny(["gateway/connection"]);return n9=function(){return t},t}function ie(){var t=ny(["gateway/connection/",""]);return ie=function(){return t},t}function it(){var t=ny(["gateway/connection/",""]);return it=function(){return t},t}function ii(){var t=ny(["gateway/connection/",""]);return ii=function(){return t},t}function ir(){var t=ny(["gateway/status/",""]);return ir=function(){return t},t}function io(){var t=ny(["realm"]);return io=function(){return t},t}function ia(){var t=ny(["realm"]);return ia=function(){return t},t}function is(){var t=ny(["realm/accessible"]);return is=function(){return t},t}function il(){var t=ny(["realm/",""]);return il=function(){return t},t}function ic(){var t=ny(["realm/",""]);return ic=function(){return t},t}function iu(){var t=ny(["realm/",""]);return iu=function(){return t},t}function id(){var t=ny(["provisioning"]);return id=function(){return t},t}function ih(){var t=ny(["provisioning"]);return ih=function(){return t},t}function ip(){var t=ny(["provisioning/",""]);return ip=function(){return t},t}function im(){var t=ny(["provisioning/",""]);return im=function(){return t},t}function ig(){var t=ny(["asset"]);return ig=function(){return t},t}function iv(){var t=ny(["asset"]);return iv=function(){return t},t}function ib(){var t=ny(["asset/attributes"]);return ib=function(){return t},t}function iy(){var t=ny(["asset/attributes/timestamp"]);return iy=function(){return t},t}function i_(){var t=ny(["asset/count"]);return i_=function(){return t},t}function ix(){var t=ny(["asset/parent"]);return ix=function(){return t},t}function iw(){var t=ny(["asset/partial/",""]);return iw=function(){return t},t}function ik(){var t=ny(["asset/query"]);return ik=function(){return t},t}function iC(){var t=ny(["asset/tree"]);return iC=function(){return t},t}function iA(){var t=ny(["asset/user/current"]);return iA=function(){return t},t}function iE(){var t=ny(["asset/user/link"]);return iE=function(){return t},t}function iS(){var t=ny(["asset/user/link"]);return iS=function(){return t},t}function iT(){var t=ny(["asset/user/link/delete"]);return iT=function(){return t},t}function iO(){var t=ny(["asset/user/link/","/",""]);return iO=function(){return t},t}function iF(){var t=ny(["asset/user/link/","/","/",""]);return iF=function(){return t},t}function iM(){var t=ny(["asset/",""]);return iM=function(){return t},t}function iI(){var t=ny(["asset/",""]);return iI=function(){return t},t}function iR(){var t=ny(["asset/","/attribute/",""]);return iR=function(){return t},t}function iD(){var t=ny(["asset/","/attribute/","/",""]);return iD=function(){return t},t}function iP(){var t=ny(["asset/","/child"]);return iP=function(){return t},t}function iL(){var t=ny(["dashboard"]);return iL=function(){return t},t}function iN(){var t=ny(["dashboard"]);return iN=function(){return t},t}function iz(){var t=ny(["dashboard/all/",""]);return iz=function(){return t},t}function ij(){var t=ny(["dashboard/query"]);return ij=function(){return t},t}function iB(){var t=ny(["dashboard/","/",""]);return iB=function(){return t},t}function i$(){var t=ny(["dashboard/","/",""]);return i$=function(){return t},t}function iU(){var t=ny(["user/locale"]);return iU=function(){return t},t}function iV(){var t=ny(["user/query"]);return iV=function(){return t},t}function iH(){var t=ny(["user/request-password-reset"]);return iH=function(){return t},t}function iq(){var t=ny(["user/reset-password"]);return iq=function(){return t},t}function iW(){var t=ny(["user/update"]);return iW=function(){return t},t}function iG(){var t=ny(["user/user"]);return iG=function(){return t},t}function iY(){var t=ny(["user/userRealmRoles"]);return iY=function(){return t},t}function iZ(){var t=ny(["user/userRoles/",""]);return iZ=function(){return t},t}function iX(){var t=ny(["user/","/disconnect/",""]);return iX=function(){return t},t}function iK(){var t=ny(["user/","/request-password-reset/",""]);return iK=function(){return t},t}function iJ(){var t=ny(["user/","/reset-password/",""]);return iJ=function(){return t},t}function iQ(){var t=ny(["user/","/reset-secret/",""]);return iQ=function(){return t},t}function i0(){var t=ny(["user/","/roles"]);return i0=function(){return t},t}function i1(){var t=ny(["user/","/userRealmRoles/",""]);return i1=function(){return t},t}function i2(){var t=ny(["user/","/userRealmRoles/",""]);return i2=function(){return t},t}function i5(){var t=ny(["user/","/userRoles/","/",""]);return i5=function(){return t},t}function i3(){var t=ny(["user/","/userRoles/","/",""]);return i3=function(){return t},t}function i4(){var t=ny(["user/","/userSessions/",""]);return i4=function(){return t},t}function i6(){var t=ny(["user/","/users"]);return i6=function(){return t},t}function i8(){var t=ny(["user/","/users"]);return i8=function(){return t},t}function i7(){var t=ny(["user/","/users/",""]);return i7=function(){return t},t}function i9(){var t=ny(["user/","/","/roles"]);return i9=function(){return t},t}function re(){var t=ny(["user/","/","/roles"]);return re=function(){return t},t}function rt(){var t=ny(["user/","/",""]);return rt=function(){return t},t}function rn(){var t=ny(["rules"]);return rn=function(){return t},t}function ri(){var t=ny(["rules"]);return ri=function(){return t},t}function rr(){var t=ny(["rules/asset"]);return rr=function(){return t},t}function ro(){var t=ny(["rules/asset/for/",""]);return ro=function(){return t},t}function ra(){var t=ny(["rules/asset/",""]);return ra=function(){return t},t}function rs(){var t=ny(["rules/asset/",""]);return rs=function(){return t},t}function rl(){var t=ny(["rules/asset/",""]);return rl=function(){return t},t}function rc(){var t=ny(["rules/geofences/",""]);return rc=function(){return t},t}function ru(){var t=ny(["rules/info/asset/",""]);return ru=function(){return t},t}function rd(){var t=ny(["rules/info/global"]);return rd=function(){return t},t}function rh(){var t=ny(["rules/info/realm/",""]);return rh=function(){return t},t}function rp(){var t=ny(["rules/realm"]);return rp=function(){return t},t}function rf(){var t=ny(["rules/realm/for/",""]);return rf=function(){return t},t}function rm(){var t=ny(["rules/realm/",""]);return rm=function(){return t},t}function rg(){var t=ny(["rules/realm/",""]);return rg=function(){return t},t}function rv(){var t=ny(["rules/realm/",""]);return rv=function(){return t},t}function rb(){var t=ny(["rules/",""]);return rb=function(){return t},t}function ry(){var t=ny(["rules/",""]);return ry=function(){return t},t}function r_(){var t=ny(["rules/",""]);return r_=function(){return t},t}function rx(){var t=ny(["notification"]);return rx=function(){return t},t}function rw(){var t=ny(["notification"]);return rw=function(){return t},t}function rk(){var t=ny(["notification/alert"]);return rk=function(){return t},t}function rC(){var t=ny(["notification/",""]);return rC=function(){return t},t}function rA(){var t=ny(["notification/","/acknowledged"]);return rA=function(){return t},t}function rE(){var t=ny(["notification/","/delivered"]);return rE=function(){return t},t}function rS(){var t=ny(["map"]);return rS=function(){return t},t}function rT(){var t=ny(["map"]);return rT=function(){return t},t}function rO(){var t=ny(["map/deleteMap"]);return rO=function(){return t},t}function rF(){var t=ny(["map/getCustomMapInfo"]);return rF=function(){return t},t}function rM(){var t=ny(["map/tile/","/","/",""]);return rM=function(){return t},t}function rI(){var t=ny(["map/upload"]);return rI=function(){return t},t}function rR(){var t=ny(["flow"]);return rR=function(){return t},t}function rD(){var t=ny(["flow/",""]);return rD=function(){return t},t}function rP(){var t=ny(["flow/",""]);return rP=function(){return t},t}function rL(){var t=ny(["alarm"]);return rL=function(){return t},t}function rN(){var t=ny(["alarm"]);return rN=function(){return t},t}function rz(){var t=ny(["alarm"]);return rz=function(){return t},t}function rj(){var t=ny(["alarm/assets"]);return rj=function(){return t},t}function rB(){var t=ny(["alarm/",""]);return rB=function(){return t},t}function r$(){var t=ny(["alarm/",""]);return r$=function(){return t},t}function rU(){var t=ny(["alarm/",""]);return rU=function(){return t},t}function rV(){var t=ny(["alarm/","/assets"]);return rV=function(){return t},t}var rH=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"register",value:function(t,n){return this.httpClient.request({method:"POST",url:on(nw()),data:t,options:n})}}]),t}(),rq=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"getServices",value:function(t,n){return this.httpClient.request({method:"GET",url:on(nk()),queryParams:t,options:n})}},{key:"registerService",value:function(t,n){return this.httpClient.request({method:"POST",url:on(nC()),data:t,options:n})}},{key:"getGlobalServices",value:function(t){return this.httpClient.request({method:"GET",url:on(nA()),options:t})}},{key:"registerGlobalService",value:function(t,n){return this.httpClient.request({method:"POST",url:on(nE()),data:t,options:n})}},{key:"deregisterService",value:function(t,n,i){return this.httpClient.request({method:"DELETE",url:on(nS(),t,n),options:i})}},{key:"getService",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(nT(),t,n),options:i})}},{key:"heartbeat",value:function(t,n,i){return this.httpClient.request({method:"PUT",url:on(nO(),t,n),options:i})}}]),t}(),rW=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"getManagerConfig",value:function(t){return this.httpClient.request({method:"GET",url:on(nF()),options:t})}},{key:"update",value:function(t,n){return this.httpClient.request({method:"PUT",url:on(nM()),data:t,options:n})}},{key:"fileUpload",value:function(t,n,i){return this.httpClient.request({method:"POST",url:on(nI()),queryParams:n,data:t,options:i})}},{key:"getManagerConfigImage",value:function(t,n){return this.httpClient.request({method:"GET",url:on(nR(),t),options:n})}}]),t}(),rG=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"getPredictedDatapoints",value:function(t,n,i,r){return this.httpClient.request({method:"POST",url:on(nD(),t,n),data:i,options:r})}},{key:"writePredictedDatapoints",value:function(t,n,i,r){return this.httpClient.request({method:"PUT",url:on(nP(),t,n),data:i,options:r})}}]),t}(),rY=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"doProtocolAssetDiscovery",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(nL(),t),queryParams:n,options:i})}},{key:"doProtocolAssetImport",value:function(t,n,i,r){return this.httpClient.request({method:"POST",url:on(nN(),t),queryParams:i,data:n,options:r})}},{key:"doProtocolInstanceDiscovery",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(nz(),t),queryParams:n,options:i})}}]),t}(),rZ=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"getDatapointExport",value:function(t,n){return this.httpClient.request({method:"GET",url:on(nj()),queryParams:t,options:n})}},{key:"getDatapointPeriod",value:function(t,n){return this.httpClient.request({method:"GET",url:on(nB()),queryParams:t,options:n})}},{key:"getDatapoints",value:function(t,n,i,r){return this.httpClient.request({method:"POST",url:on(n$(),t,n),data:i,options:r})}}]),t}(),rX=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"getConfig",value:function(t){return this.httpClient.request({method:"GET",url:on(nU()),options:t})}},{key:"updateConfig",value:function(t,n){return this.httpClient.request({method:"PUT",url:on(nV()),data:t,options:n})}},{key:"clearEvents",value:function(t){return this.httpClient.request({method:"DELETE",url:on(nH()),options:t})}},{key:"getEvents",value:function(t,n){return this.httpClient.request({method:"GET",url:on(nq()),queryParams:t,options:n})}}]),t}(),rK=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"startTunnel",value:function(t,n){return this.httpClient.request({method:"POST",url:on(nW()),data:t,options:n})}},{key:"stopTunnel",value:function(t,n){return this.httpClient.request({method:"DELETE",url:on(nG()),data:t,options:n})}},{key:"getAllActiveTunnelInfos",value:function(t,n){return this.httpClient.request({method:"GET",url:on(nY(),t),options:n})}},{key:"getGatewayActiveTunnelInfos",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(nZ(),t,n),options:i})}},{key:"getActiveTunnelInfo",value:function(t,n,i,r,o){return this.httpClient.request({method:"GET",url:on(nX(),t,n,i,r),options:o})}}]),t}(),rJ=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"getApps",value:function(t){return this.httpClient.request({method:"GET",url:on(nK()),options:t})}},{key:"getConsoleConfig",value:function(t){return this.httpClient.request({method:"GET",url:on(nJ()),options:t})}},{key:"getAppInfos",value:function(t){return this.httpClient.request({method:"GET",url:on(nQ()),options:t})}}]),t}(),rQ=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"getAssetDescriptors",value:function(t,n){return this.httpClient.request({method:"GET",url:on(n0()),queryParams:t,options:n})}},{key:"getAssetInfo",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(n1(),t),queryParams:n,options:i})}},{key:"getAssetInfos",value:function(t,n){return this.httpClient.request({method:"GET",url:on(n2()),queryParams:t,options:n})}},{key:"getValueDescriptorSchema",value:function(t,n){return this.httpClient.request({method:"GET",url:on(n5()),queryParams:t,options:n})}},{key:"getMetaItemDescriptors",value:function(t,n){return this.httpClient.request({method:"GET",url:on(n3()),queryParams:t,options:n})}},{key:"getValueDescriptors",value:function(t,n){return this.httpClient.request({method:"GET",url:on(n4()),queryParams:t,options:n})}}]),t}(),r0=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"getHealthStatus",value:function(t){return this.httpClient.request({method:"GET",url:on(n6()),options:t})}},{key:"getInfo",value:function(t){return this.httpClient.request({method:"GET",url:on(n8()),options:t})}}]),t}(),r1=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"deleteConnections",value:function(t,n){return this.httpClient.request({method:"DELETE",url:on(n7()),queryParams:t,options:n})}},{key:"getConnections",value:function(t){return this.httpClient.request({method:"GET",url:on(n9()),options:t})}},{key:"deleteConnection",value:function(t,n){return this.httpClient.request({method:"DELETE",url:on(ie(),t),options:n})}},{key:"getConnection",value:function(t,n){return this.httpClient.request({method:"GET",url:on(it(),t),options:n})}},{key:"setConnection",value:function(t,n,i){return this.httpClient.request({method:"PUT",url:on(ii(),t),data:n,options:i})}},{key:"getConnectionStatus",value:function(t,n){return this.httpClient.request({method:"GET",url:on(ir(),t),options:n})}}]),t}(),r2=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"create",value:function(t,n){return this.httpClient.request({method:"POST",url:on(io()),data:t,options:n})}},{key:"getAll",value:function(t){return this.httpClient.request({method:"GET",url:on(ia()),options:t})}},{key:"getAccessible",value:function(t){return this.httpClient.request({method:"GET",url:on(is()),options:t})}},{key:"delete",value:function(t,n){return this.httpClient.request({method:"DELETE",url:on(il(),t),options:n})}},{key:"get",value:function(t,n){return this.httpClient.request({method:"GET",url:on(ic(),t),options:n})}},{key:"update",value:function(t,n,i){return this.httpClient.request({method:"PUT",url:on(iu(),t),data:n,options:i})}}]),t}(),r5=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"createProvisioningConfig",value:function(t,n){return this.httpClient.request({method:"POST",url:on(id()),data:t,options:n})}},{key:"getProvisioningConfigs",value:function(t){return this.httpClient.request({method:"GET",url:on(ih()),options:t})}},{key:"deleteProvisioningConfig",value:function(t,n){return this.httpClient.request({method:"DELETE",url:on(ip(),t),options:n})}},{key:"updateProvisioningConfig",value:function(t,n,i){return this.httpClient.request({method:"PUT",url:on(im(),t),data:n,options:i})}}]),t}(),r3=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"create",value:function(t,n){return this.httpClient.request({method:"POST",url:on(ig()),data:t,options:n})}},{key:"delete",value:function(t,n){return this.httpClient.request({method:"DELETE",url:on(iv()),queryParams:t,options:n})}},{key:"writeAttributeValues",value:function(t,n){return this.httpClient.request({method:"PUT",url:on(ib()),data:t,options:n})}},{key:"writeAttributeEvents",value:function(t,n){return this.httpClient.request({method:"PUT",url:on(iy()),data:t,options:n})}},{key:"queryCount",value:function(t,n){return this.httpClient.request({method:"POST",url:on(i_()),data:t,options:n})}},{key:"updateNoneParent",value:function(t,n){return this.httpClient.request({method:"DELETE",url:on(ix()),queryParams:t,options:n})}},{key:"getPartial",value:function(t,n){return this.httpClient.request({method:"GET",url:on(iw(),t),options:n})}},{key:"queryAssets",value:function(t,n){return this.httpClient.request({method:"POST",url:on(ik()),data:t,options:n})}},{key:"queryAssetTree",value:function(t,n){return this.httpClient.request({method:"POST",url:on(iC()),data:t,options:n})}},{key:"getCurrentUserAssets",value:function(t){return this.httpClient.request({method:"GET",url:on(iA()),options:t})}},{key:"createUserAssetLinks",value:function(t,n){return this.httpClient.request({method:"POST",url:on(iE()),data:t,options:n})}},{key:"getUserAssetLinks",value:function(t,n){return this.httpClient.request({method:"GET",url:on(iS()),queryParams:t,options:n})}},{key:"deleteUserAssetLinks",value:function(t,n){return this.httpClient.request({method:"POST",url:on(iT()),data:t,options:n})}},{key:"deleteAllUserAssetLinks",value:function(t,n,i){return this.httpClient.request({method:"DELETE",url:on(iO(),t,n),options:i})}},{key:"deleteUserAssetLink",value:function(t,n,i,r){return this.httpClient.request({method:"DELETE",url:on(iF(),t,n,i),options:r})}},{key:"get",value:function(t,n){return this.httpClient.request({method:"GET",url:on(iM(),t),options:n})}},{key:"update",value:function(t,n,i){return this.httpClient.request({method:"PUT",url:on(iI(),t),data:n,options:i})}},{key:"writeAttributeValue$PUT$asset_assetId_attribute_attributeName",value:function(t,n,i,r){return this.httpClient.request({method:"PUT",url:on(iR(),t,n),data:i,options:r})}},{key:"writeAttributeValue$PUT$asset_assetId_attribute_attributeName_timestamp",value:function(t,n,i,r,o){return this.httpClient.request({method:"PUT",url:on(iD(),t,n,i),data:r,options:o})}},{key:"updateParent",value:function(t,n,i){return this.httpClient.request({method:"PUT",url:on(iP(),t),queryParams:n,options:i})}}]),t}(),r4=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"create",value:function(t,n){return this.httpClient.request({method:"POST",url:on(iL()),data:t,options:n})}},{key:"update",value:function(t,n){return this.httpClient.request({method:"PUT",url:on(iN()),data:t,options:n})}},{key:"getAllRealmDashboards",value:function(t,n){return this.httpClient.request({method:"GET",url:on(iz(),t),options:n})}},{key:"query",value:function(t,n){return this.httpClient.request({method:"POST",url:on(ij()),data:t,options:n})}},{key:"delete",value:function(t,n,i){return this.httpClient.request({method:"DELETE",url:on(iB(),t,n),options:i})}},{key:"get",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(i$(),t,n),options:i})}}]),t}(),r6=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"updateCurrentUserLocale",value:function(t,n){return this.httpClient.request({method:"PUT",url:on(iU()),data:t,options:n})}},{key:"query",value:function(t,n){return this.httpClient.request({method:"POST",url:on(iV()),data:t,options:n})}},{key:"requestPasswordResetCurrent",value:function(t){return this.httpClient.request({method:"PUT",url:on(iH()),options:t})}},{key:"updatePasswordCurrent",value:function(t,n){return this.httpClient.request({method:"PUT",url:on(iq()),data:t,options:n})}},{key:"updateCurrent",value:function(t,n){return this.httpClient.request({method:"PUT",url:on(iW()),data:t,options:n})}},{key:"getCurrent",value:function(t){return this.httpClient.request({method:"GET",url:on(iG()),options:t})}},{key:"getCurrentUserRealmRoles",value:function(t){return this.httpClient.request({method:"GET",url:on(iY()),options:t})}},{key:"getCurrentUserClientRoles",value:function(t,n){return this.httpClient.request({method:"GET",url:on(iZ(),t),options:n})}},{key:"disconnectUserSession",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(iX(),t,n),options:i})}},{key:"requestPasswordReset",value:function(t,n,i){return this.httpClient.request({method:"PUT",url:on(iK(),t,n),options:i})}},{key:"updatePassword",value:function(t,n,i,r){return this.httpClient.request({method:"PUT",url:on(iJ(),t,n),data:i,options:r})}},{key:"resetSecret",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(iQ(),t,n),options:i})}},{key:"updateRoles",value:function(t,n,i){return this.httpClient.request({method:"PUT",url:on(i0(),t),data:n,options:i})}},{key:"getUserRealmRoles",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(i1(),t,n),options:i})}},{key:"updateUserRealmRoles",value:function(t,n,i,r){return this.httpClient.request({method:"PUT",url:on(i2(),t,n),data:i,options:r})}},{key:"getUserClientRoles",value:function(t,n,i,r){return this.httpClient.request({method:"GET",url:on(i5(),t,n,i),options:r})}},{key:"updateUserClientRoles",value:function(t,n,i,r,o){return this.httpClient.request({method:"PUT",url:on(i3(),t,n,i),data:r,options:o})}},{key:"getUserSessions",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(i4(),t,n),options:i})}},{key:"create",value:function(t,n,i){return this.httpClient.request({method:"POST",url:on(i6(),t),data:n,options:i})}},{key:"update",value:function(t,n,i){return this.httpClient.request({method:"PUT",url:on(i8(),t),data:n,options:i})}},{key:"delete",value:function(t,n,i){return this.httpClient.request({method:"DELETE",url:on(i7(),t,n),options:i})}},{key:"getClientRoles",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(i9(),t,n),options:i})}},{key:"updateClientRoles",value:function(t,n,i,r){return this.httpClient.request({method:"PUT",url:on(re(),t,n),data:i,options:r})}},{key:"get",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(rt(),t,n),options:i})}}]),t}(),r8=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"createGlobalRuleset",value:function(t,n){return this.httpClient.request({method:"POST",url:on(rn()),data:t,options:n})}},{key:"getGlobalRulesets",value:function(t,n){return this.httpClient.request({method:"GET",url:on(ri()),queryParams:t,options:n})}},{key:"createAssetRuleset",value:function(t,n){return this.httpClient.request({method:"POST",url:on(rr()),data:t,options:n})}},{key:"getAssetRulesets",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(ro(),t),queryParams:n,options:i})}},{key:"deleteAssetRuleset",value:function(t,n){return this.httpClient.request({method:"DELETE",url:on(ra(),t),options:n})}},{key:"getAssetRuleset",value:function(t,n){return this.httpClient.request({method:"GET",url:on(rs(),t),options:n})}},{key:"updateAssetRuleset",value:function(t,n,i){return this.httpClient.request({method:"PUT",url:on(rl(),t),data:n,options:i})}},{key:"getAssetGeofences",value:function(t,n){return this.httpClient.request({method:"GET",url:on(rc(),t),options:n})}},{key:"getAssetEngineInfo",value:function(t,n){return this.httpClient.request({method:"GET",url:on(ru(),t),options:n})}},{key:"getGlobalEngineInfo",value:function(t){return this.httpClient.request({method:"GET",url:on(rd()),options:t})}},{key:"getRealmEngineInfo",value:function(t,n){return this.httpClient.request({method:"GET",url:on(rh(),t),options:n})}},{key:"createRealmRuleset",value:function(t,n){return this.httpClient.request({method:"POST",url:on(rp()),data:t,options:n})}},{key:"getRealmRulesets",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(rf(),t),queryParams:n,options:i})}},{key:"deleteRealmRuleset",value:function(t,n){return this.httpClient.request({method:"DELETE",url:on(rm(),t),options:n})}},{key:"getRealmRuleset",value:function(t,n){return this.httpClient.request({method:"GET",url:on(rg(),t),options:n})}},{key:"updateRealmRuleset",value:function(t,n,i){return this.httpClient.request({method:"PUT",url:on(rv(),t),data:n,options:i})}},{key:"deleteGlobalRuleset",value:function(t,n){return this.httpClient.request({method:"DELETE",url:on(rb(),t),options:n})}},{key:"getGlobalRuleset",value:function(t,n){return this.httpClient.request({method:"GET",url:on(ry(),t),options:n})}},{key:"updateGlobalRuleset",value:function(t,n,i){return this.httpClient.request({method:"PUT",url:on(r_(),t),data:n,options:i})}}]),t}(),r7=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"getNotifications",value:function(t,n){return this.httpClient.request({method:"GET",url:on(rx()),queryParams:t,options:n})}},{key:"removeNotifications",value:function(t,n){return this.httpClient.request({method:"DELETE",url:on(rw()),queryParams:t,options:n})}},{key:"sendNotification",value:function(t,n){return this.httpClient.request({method:"POST",url:on(rk()),data:t,options:n})}},{key:"removeNotification",value:function(t,n){return this.httpClient.request({method:"DELETE",url:on(rC(),t),options:n})}},{key:"notificationAcknowledged",value:function(t,n,i,r){return this.httpClient.request({method:"PUT",url:on(rA(),t),queryParams:i,data:n,options:r})}},{key:"notificationDelivered",value:function(t,n,i){return this.httpClient.request({method:"PUT",url:on(rE(),t),queryParams:n,options:i})}}]),t}(),r9=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"getSettings",value:function(t){return this.httpClient.request({method:"GET",url:on(rS()),options:t})}},{key:"saveSettings",value:function(t,n){return this.httpClient.request({method:"PUT",url:on(rT()),data:t,options:n})}},{key:"deleteMap",value:function(t){return this.httpClient.request({method:"DELETE",url:on(rO()),options:t})}},{key:"getCustomMapInfo",value:function(t){return this.httpClient.request({method:"GET",url:on(rF()),options:t})}},{key:"getTile",value:function(t,n,i,r){return this.httpClient.request({method:"GET",url:on(rM(),t,n,i),options:r})}},{key:"uploadMap",value:function(t,n){return this.httpClient.request({method:"POST",url:on(rI()),queryParams:t,options:n})}}]),t}(),oe=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"getAllNodeDefinitions",value:function(t){return this.httpClient.request({method:"GET",url:on(rR()),options:t})}},{key:"getNodeDefinition",value:function(t,n){return this.httpClient.request({method:"GET",url:on(rD(),t),options:n})}},{key:"getAllNodeDefinitionsByType",value:function(t,n){return this.httpClient.request({method:"GET",url:on(rP(),t),options:n})}}]),t}(),ot=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"createAlarm",value:function(t,n,i){return this.httpClient.request({method:"POST",url:on(rL()),queryParams:n,data:t,options:i})}},{key:"getAlarms",value:function(t,n){return this.httpClient.request({method:"GET",url:on(rN()),queryParams:t,options:n})}},{key:"removeAlarms",value:function(t,n){return this.httpClient.request({method:"DELETE",url:on(rz()),data:t,options:n})}},{key:"setAssetLinks",value:function(t,n){return this.httpClient.request({method:"PUT",url:on(rj()),data:t,options:n})}},{key:"getAlarm",value:function(t,n){return this.httpClient.request({method:"GET",url:on(rB(),t),options:n})}},{key:"removeAlarm",value:function(t,n){return this.httpClient.request({method:"DELETE",url:on(r$(),t),options:n})}},{key:"updateAlarm",value:function(t,n,i){return this.httpClient.request({method:"PUT",url:on(rU(),t),data:n,options:i})}},{key:"getAssetLinks",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(rV(),t),queryParams:n,options:i})}}]),t}();function on(t){for(var n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];for(var o="",a=0;a<i.length;a++)o+=t[a],o+=encodeURIComponent(i[a]);return o+t[t.length-1]}var oi=function(){function t(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();nh(this,t),this._consoleResource=new oo(n,i),this._externalServiceResource=new oa(n,i),this._configurationResource=new os(n,i),this._assetPredictedDatapointResource=new ol(n,i),this._agentResource=new oc(n,i),this._assetDatapointResource=new ou(n,i),this._syslogResource=new od(n,i),this._gatewayServiceResource=new oh(n,i),this._appResource=new op(n,i),this._assetModelResource=new of(n,i),this._statusResource=new om(n,i),this._gatewayClientResource=new og(n,i),this._realmResource=new ov(n,i),this._provisioningResource=new ob(n,i),this._assetResource=new oy(n,i),this._dashboardResource=new o_(n,i),this._userResource=new ox(n,i),this._rulesResource=new ow(n,i),this._notificationResource=new ok(n,i),this._mapResource=new oC(n,i),this._flowResource=new oA(n,i),this._alarmResource=new oE(n,i),this._assetResource=new oy(n,i)}return nf(t,[{key:"ConsoleResource",get:function(){return this._consoleResource}},{key:"ExternalServiceResource",get:function(){return this._externalServiceResource}},{key:"ConfigurationResource",get:function(){return this._configurationResource}},{key:"AssetPredictedDatapointResource",get:function(){return this._assetPredictedDatapointResource}},{key:"AgentResource",get:function(){return this._agentResource}},{key:"AssetDatapointResource",get:function(){return this._assetDatapointResource}},{key:"SyslogResource",get:function(){return this._syslogResource}},{key:"GatewayServiceResource",get:function(){return this._gatewayServiceResource}},{key:"AppResource",get:function(){return this._appResource}},{key:"AssetModelResource",get:function(){return this._assetModelResource}},{key:"StatusResource",get:function(){return this._statusResource}},{key:"GatewayClientResource",get:function(){return this._gatewayClientResource}},{key:"RealmResource",get:function(){return this._realmResource}},{key:"ProvisioningResource",get:function(){return this._provisioningResource}},{key:"AssetResource",get:function(){return this._assetResource}},{key:"DashboardResource",get:function(){return this._dashboardResource}},{key:"UserResource",get:function(){return this._userResource}},{key:"RulesResource",get:function(){return this._rulesResource}},{key:"NotificationResource",get:function(){return this._notificationResource}},{key:"MapResource",get:function(){return this._mapResource}},{key:"FlowResource",get:function(){return this._flowResource}},{key:"AlarmResource",get:function(){return this._alarmResource}}]),t}(),or=function(){function t(n){nh(this,t),this.axios=n}return nf(t,[{key:"request",value:function(t){function n(t,n){if(void 0!=n)for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i]);return t}var i={};i.method=t.method,i.url=t.url,i.params=t.queryParams,i.data=t.data,n(i,t.options);var r=t.copyFn;return this.axios.request(i).then(function(t){return r&&t.data&&(t.originalData=t.data,t.data=r(t.data)),t})}}]),t}(),oo=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(rH),oa=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(rq),os=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(rW),ol=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(rG),oc=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(rY),ou=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(rZ),od=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(rX),oh=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(rK),op=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(rJ),of=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(rQ),om=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(r0),og=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(r1),ov=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(r2),ob=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(r5),oy=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(r3),o_=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(r4),ox=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(r6),ow=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(r8),ok=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(r7),oC=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(r9),oA=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(oe),oE=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(ot),oS=i(88183),oT=i.n(oS);function oO(t,n){if(!(t instanceof n))throw TypeError("Cannot call a class as a function")}function oF(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function oM(t,n,i){return n&&oF(t.prototype,n),i&&oF(t,i),t}var oI=nc.isAxiosError;let oR=new(function(){function t(){oO(this,t),this._axiosInstance=nc.create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use(function(t){return t.paramsSerializer=function(t){return oT().stringify(t,{arrayFormat:"repeat"})},t})}return oM(t,[{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(t){this._axiosInstance.defaults.timeout=t}},{key:"addRequestInterceptor",value:function(t){this._axiosInstance.interceptors.request.use(t)}},{key:"initialise",value:function(t){this._baseUrl=t,this._client=new oi(t,this._axiosInstance)}}]),t}())},55610(){},47791(){},86958(){},54550(t,n,i){var r;if("function"==typeof fetch&&(r=void 0!==i.g&&i.g.fetch?i.g.fetch:"u">typeof window&&window.fetch?window.fetch:fetch),"u"<typeof window||void 0===window.document){var o=r||i(46911);o.default&&(o=o.default),n.default=o,t.exports=n.default}},97271(t){t.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(t,n,i){let r=i(97271),o={},a={},s=[],l=[],c=[];for(let t in r){let{name:n,nativeName:i}=r[t];o[t]=a[n.toLowerCase()]=a[i.toLowerCase()]={code:t,name:n,nativeName:i},s.push(t),l.push(n),c.push(i)}t.exports=class t{static getLanguages(n=[]){return n.map(n=>t.validate(n)?Object.assign({},o[n]):{code:n,name:"",nativeName:""})}static getName(n){return t.validate(n)?r[n].name:""}static getAllNames(){return l.slice()}static getNativeName(n){return t.validate(n)?r[n].nativeName:""}static getAllNativeNames(){return c.slice()}static getCode(t){return t=t.toLowerCase(),a.hasOwnProperty(t)?a[t].code:""}static getAllCodes(){return s.slice()}static validate(t){return r.hasOwnProperty(t)}}},57415(t){!function(n){t.exports=n()}(function(){"use strict";var t={},n={};function i(i,r,o){if(n[i]=o,"index"===i){var a="var sharedModule = {}; ("+n.shared+")(sharedModule); ("+n.worker+")(sharedModule);",s={};return n.shared(s),n.index(t,s),"u">typeof window&&t.setWorkerUrl(window.URL.createObjectURL(new Blob([a],{type:"text/javascript"}))),t}}return i("shared",["exports"],function(t){let n,i,r,o,a,s,l,c,u,d,h,p,f,m,g,v,b,y,_;function x(t,n,i,r){return new(i||(i=Promise))(function(o,a){function s(t){try{c(r.next(t))}catch(t){a(t)}}function l(t){try{c(r.throw(t))}catch(t){a(t)}}function c(t){var n;t.done?o(t.value):((n=t.value)instanceof i?n:new i(function(t){t(n)})).then(s,l)}c((r=r.apply(t,n||[])).next())})}function w(t,n){this.x=t,this.y=n}function k(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}"function"==typeof SuppressedError&&SuppressedError,w.prototype={clone(){return new w(this.x,this.y)},add(t){return this.clone()._add(t)},sub(t){return this.clone()._sub(t)},multByPoint(t){return this.clone()._multByPoint(t)},divByPoint(t){return this.clone()._divByPoint(t)},mult(t){return this.clone()._mult(t)},div(t){return this.clone()._div(t)},rotate(t){return this.clone()._rotate(t)},rotateAround(t,n){return this.clone()._rotateAround(t,n)},matMult(t){return this.clone()._matMult(t)},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(t){return this.x===t.x&&this.y===t.y},dist(t){return Math.sqrt(this.distSqr(t))},distSqr(t){let n=t.x-this.x,i=t.y-this.y;return n*n+i*i},angle(){return Math.atan2(this.y,this.x)},angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith(t){return this.angleWithSep(t.x,t.y)},angleWithSep(t,n){return Math.atan2(this.x*n-this.y*t,this.x*t+this.y*n)},_matMult(t){let n=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=n,this},_add(t){return this.x+=t.x,this.y+=t.y,this},_sub(t){return this.x-=t.x,this.y-=t.y,this},_mult(t){return this.x*=t,this.y*=t,this},_div(t){return this.x/=t,this.y/=t,this},_multByPoint(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint(t){return this.x/=t.x,this.y/=t.y,this},_unit(){return this._div(this.mag()),this},_perp(){let t=this.y;return this.y=this.x,this.x=-t,this},_rotate(t){let n=Math.cos(t),i=Math.sin(t),r=i*this.x+n*this.y;return this.x=n*this.x-i*this.y,this.y=r,this},_rotateAround(t,n){let i=Math.cos(t),r=Math.sin(t),o=n.y+r*(this.x-n.x)+i*(this.y-n.y);return this.x=n.x+i*(this.x-n.x)-r*(this.y-n.y),this.y=o,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:w},w.convert=function(t){if(t instanceof w)return t;if(Array.isArray(t))return new w(+t[0],+t[1]);if(void 0!==t.x&&void 0!==t.y)return new w(+t.x,+t.y);throw Error("Expected [x, y] or {x, y} point format")};var C,A,E,S,T,O,F,M,I,R,D,P,L,N=k(function(){if(J)return K;function t(t,n,i,r){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*n,this.by=3*(r-n)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=i,this.p2y=r}return J=1,K=t,t.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,n){if(void 0===n&&(n=1e-6),t<0)return 0;if(t>1)return 1;for(var i=t,r=0;r<8;r++){var o=this.sampleCurveX(i)-t;if(Math.abs(o)<n)return i;var a=this.sampleCurveDerivativeX(i);if(1e-6>Math.abs(a))break;i-=o/a}var s=0,l=1;for(i=t,r=0;r<20&&!(Math.abs((o=this.sampleCurveX(i))-t)<n);r++)t>o?s=i:l=i,i=.5*(l-s)+s;return i},solve:function(t,n){return this.sampleCurveY(this.solveCurveX(t,n))}},K}());function z(){return null==n&&(n="u">typeof OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),n}function j(){if(null==i&&(i=!1,z())){let t=5,n=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(n){for(let i=0;i<t*t;i++){let r=4*i;n.fillStyle=`rgb(${r},${r+1},${r+2})`,n.fillRect(i%t,Math.floor(i/t),1,1)}let r=n.getImageData(0,0,t,t).data;for(let n=0;n<t*t*4;n++)if(n%4!=3&&r[n]!==n){i=!0;break}}}return i||!1}var B=1e-6,U="u">typeof Float32Array?Float32Array:Array;function V(){var t=new U(9);return U!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function H(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function q(){var t=new U(3);return U!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function W(t){var n=t[0],i=t[1],r=t[2];return Math.sqrt(n*n+i*i+r*r)}function G(t,n,i){var r=new U(3);return r[0]=t,r[1]=n,r[2]=i,r}function Y(t,n,i){return t[0]=n[0]+i[0],t[1]=n[1]+i[1],t[2]=n[2]+i[2],t}function Z(t,n,i){return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t}function X(t,n,i){var r=n[0],o=n[1],a=n[2],s=i[0],l=i[1],c=i[2];return t[0]=o*c-a*l,t[1]=a*s-r*c,t[2]=r*l-o*s,t}var K,J,Q,ee=W;function et(t,n,i){var r=n[0],o=n[1],a=n[2],s=n[3];return t[0]=i[0]*r+i[4]*o+i[8]*a+i[12]*s,t[1]=i[1]*r+i[5]*o+i[9]*a+i[13]*s,t[2]=i[2]*r+i[6]*o+i[10]*a+i[14]*s,t[3]=i[3]*r+i[7]*o+i[11]*a+i[15]*s,t}function en(){var t=new U(4);return U!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function ei(t,n,i,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"zyx",a=Math.PI/360;n*=a,r*=a,i*=a;var s=Math.sin(n),l=Math.cos(n),c=Math.sin(i),u=Math.cos(i),d=Math.sin(r),h=Math.cos(r);switch(o){case"xyz":t[0]=s*u*h+l*c*d,t[1]=l*c*h-s*u*d,t[2]=l*u*d+s*c*h,t[3]=l*u*h-s*c*d;break;case"xzy":t[0]=s*u*h-l*c*d,t[1]=l*c*h-s*u*d,t[2]=l*u*d+s*c*h,t[3]=l*u*h+s*c*d;break;case"yxz":t[0]=s*u*h+l*c*d,t[1]=l*c*h-s*u*d,t[2]=l*u*d-s*c*h,t[3]=l*u*h+s*c*d;break;case"yzx":t[0]=s*u*h+l*c*d,t[1]=l*c*h+s*u*d,t[2]=l*u*d-s*c*h,t[3]=l*u*h-s*c*d;break;case"zxy":t[0]=s*u*h-l*c*d,t[1]=l*c*h+s*u*d,t[2]=l*u*d+s*c*h,t[3]=l*u*h-s*c*d;break;case"zyx":t[0]=s*u*h-l*c*d,t[1]=l*c*h+s*u*d,t[2]=l*u*d-s*c*h,t[3]=l*u*h+s*c*d;break;default:throw Error("Unknown angle order "+o)}return t}function er(){var t=new U(2);return U!=Float32Array&&(t[0]=0,t[1]=0),t}function eo(t,n){var i=new U(2);return i[0]=t,i[1]=n,i}q(),Q=new U(4),U!=Float32Array&&(Q[0]=0,Q[1]=0,Q[2]=0,Q[3]=0),q(),G(1,0,0),G(0,1,0),en(),en(),V(),er();let ea=8192;function es(t,n,i){return n*(ea/(t.tileSize*Math.pow(2,i-t.tileID.overscaledZ)))}function el(t,n){return(t%n+n)%n}function ec(t,n,i){return t*(1-i)+n*i}function eu(t){if(t<=0)return 0;if(t>=1)return 1;let n=t*t,i=n*t;return 4*(t<.5?i:3*(t-n)+i-.75)}function ed(t,n,i,r){let o=new N(t,n,i,r);return t=>o.solve(t)}let eh=ed(.25,.1,.25,1);function ep(t,n,i){return Math.min(i,Math.max(n,t))}function ef(t,n,i){let r=i-n,o=((t-n)%r+r)%r+n;return o===n?i:o}function em(t,...n){for(let i of n)for(let n in i)t[n]=i[n];return t}let eg=1;function ev(t,n,i){let r={};for(let i in t)r[i]=n.call(this,t[i],i,t);return r}function eb(t,n,i){let r={};for(let i in t)n.call(this,t[i],i,t)&&(r[i]=t[i]);return r}function ey(t){return Array.isArray(t)?t.map(ey):"object"==typeof t&&t?ev(t,ey):t}let e_={};function ex(t){e_[t]||("u">typeof console&&console.warn(t),e_[t]=!0)}function ew(t,n,i){return(i.y-t.y)*(n.x-t.x)>(n.y-t.y)*(i.x-t.x)}function ek(t){return"u">typeof WorkerGlobalScope&&void 0!==t&&t instanceof WorkerGlobalScope}let eC=null;function eA(t){return"u">typeof ImageBitmap&&t instanceof ImageBitmap}let eE="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function eS(t,n,i,r,o){return x(this,void 0,void 0,function*(){if("u"<typeof VideoFrame)throw Error("VideoFrame not supported");let a=new VideoFrame(t,{timestamp:0});try{let s=null==a?void 0:a.format;if(!s||!s.startsWith("BGR")&&!s.startsWith("RGB"))throw Error(`Unrecognized format ${s}`);let l=s.startsWith("BGR"),c=new Uint8ClampedArray(r*o*4);if(yield a.copyTo(c,function(t,n,i,r,o){let a=4*Math.max(-n,0),s=(Math.max(0,i)-i)*r*4+a,l=4*r,c=Math.max(0,n),u=Math.max(0,i);return{rect:{x:c,y:u,width:Math.min(t.width,n+r)-c,height:Math.min(t.height,i+o)-u},layout:[{offset:s,stride:l}]}}(t,n,i,r,o)),l)for(let t=0;t<c.length;t+=4){let n=c[t];c[t]=c[t+2],c[t+2]=n}return c}finally{a.close()}})}function eT(t,n,i,r){return t.addEventListener(n,i,r),{unsubscribe:()=>{t.removeEventListener(n,i,r)}}}function eO(t){return t*Math.PI/180}function eF(t){return t/Math.PI*180}let eM={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},eI={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},eR="AbortError";class eD extends Error{constructor(t=eR){super(t instanceof Error?t.message:t),this.name=eR,t instanceof Error&&t.stack&&(this.stack=t.stack)}}function eP(t){return t.name===eR}let eL={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function eN(t){return eL.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf("://"))]}let ez="global-dispatcher";class ej extends Error{constructor(t,n,i,r){super(`AJAXError: ${n} (${t}): ${i}`),this.status=t,this.statusText=n,this.url=i,this.body=r}}let eB=()=>ek(self)?self.worker&&self.worker.referrer:("blob:"===window.location.protocol?window.parent:window).location.href,e$=function(t,n){var i;if(/:\/\//.test(t.url)&&!/^https?:|^file:/.test(t.url)){let i=eN(t.url);if(i)return i(t,n);if(ek(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,targetMapId:ez},n)}if(!(/^file:/.test(i=t.url)||/^file:/.test(eB())&&!/^\w+:/.test(i))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(t,n){return x(this,void 0,void 0,function*(){let i,r,o=new Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:eB(),signal:n.signal});"json"!==t.type||o.headers.has("Accept")||o.headers.set("Accept","application/json");try{i=yield fetch(o)}catch(n){if(eP(n))throw n;throw new ej(0,n.message,t.url,new Blob)}if(!i.ok){let n=yield i.blob();throw new ej(i.status,i.statusText,t.url,n)}r="arrayBuffer"===t.type||"image"===t.type?i.arrayBuffer():"json"===t.type?i.json():i.text();let a=yield r;return n.signal.throwIfAborted(),{data:a,cacheControl:i.headers.get("Cache-Control"),expires:i.headers.get("Expires")}})}(t,n);if(ek(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,mustQueue:!0,targetMapId:ez},n)}return function(t,n){return new Promise((i,r)=>{var o;let a=new XMLHttpRequest;for(let n in a.open(t.method||"GET",t.url,!0),"arrayBuffer"!==t.type&&"image"!==t.type||(a.responseType="arraybuffer"),t.headers)a.setRequestHeader(n,t.headers[n]);"json"===t.type&&(a.responseType="text",(null==(o=t.headers)?void 0:o.Accept)||a.setRequestHeader("Accept","application/json")),a.withCredentials="include"===t.credentials,a.onerror=()=>{r(Error(a.statusText))},a.onload=()=>{if(!n.signal.aborted)if((a.status>=200&&a.status<300||0===a.status)&&null!==a.response){let n=a.response;if("json"===t.type)try{n=JSON.parse(a.response)}catch(t){return void r(t)}i({data:n,cacheControl:a.getResponseHeader("Cache-Control"),expires:a.getResponseHeader("Expires")})}else{let n=new Blob([a.response],{type:a.getResponseHeader("Content-Type")});r(new ej(a.status,a.statusText,t.url,n))}},n.signal.addEventListener("abort",()=>{a.abort(),r(new eD(n.signal.reason))}),a.send(t.body)})}(t,n)};function eU(t){if(!t||0>=t.indexOf("://")||0===t.indexOf("data:image/")||0===t.indexOf("blob:"))return!0;let n=new URL(t),i=window.location;return n.protocol===i.protocol&&n.host===i.host}function eV(t,n,i){i[t]&&-1!==i[t].indexOf(n)||(i[t]=i[t]||[],i[t].push(n))}function eH(t,n,i){if(i&&i[t]){let r=i[t].indexOf(n);-1!==r&&i[t].splice(r,1)}}class eq{constructor(t,n={}){em(this,n),this.type=t}}class eW extends eq{constructor(t,n={}){super("error",em({error:t},n))}}class eG{on(t,n){return this._listeners=this._listeners||{},eV(t,n,this._listeners),{unsubscribe:()=>{this.off(t,n)}}}off(t,n){return eH(t,n,this._listeners),eH(t,n,this._oneTimeListeners),this}once(t,n){return n?(this._oneTimeListeners=this._oneTimeListeners||{},eV(t,n,this._oneTimeListeners),this):new Promise(n=>this.once(t,n))}fire(t,n){"string"==typeof t&&(t=new eq(t,n||{}));let i=t.type;if(this.listens(i)){for(let n of(t.target=this,this._listeners&&this._listeners[i]?this._listeners[i].slice():[]))n.call(this,t);for(let n of this._oneTimeListeners&&this._oneTimeListeners[i]?this._oneTimeListeners[i].slice():[])eH(i,n,this._oneTimeListeners),n.call(this,t);let n=this._eventedParent;n&&(em(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),n.fire(t))}else t instanceof eW&&console.error(t.error);return this}listens(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)}setEventedParent(t,n){return this._eventedParent=t,this._eventedParentData=n,this}}var eY={$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 eZ=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function eX(t,n){let i={};for(let n in t)"ref"!==n&&(i[n]=t[n]);return eZ.forEach(t=>{t in n&&(i[t]=n[t])}),i}function eK(t,n){if(Array.isArray(t)){if(!Array.isArray(n)||t.length!==n.length)return!1;for(let i=0;i<t.length;i++)if(!eK(t[i],n[i]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==n){if("object"!=typeof n||Object.keys(t).length!==Object.keys(n).length)return!1;for(let i in t)if(!eK(t[i],n[i]))return!1;return!0}return t===n}function eJ(t,n){t.push(n)}function eQ(t,n,i){eJ(i,{command:"addSource",args:[t,n[t]]})}function e0(t,n,i){eJ(n,{command:"removeSource",args:[t]}),i[t]=!0}function e1(t,n,i,r){e0(t,i,r),eQ(t,n,i)}function e2(t,n,i){let r;for(r in t[i])if(Object.prototype.hasOwnProperty.call(t[i],r)&&"data"!==r&&!eK(t[i][r],n[i][r]))return!1;for(r in n[i])if(Object.prototype.hasOwnProperty.call(n[i],r)&&"data"!==r&&!eK(t[i][r],n[i][r]))return!1;return!0}function e5(t,n,i,r,o,a){for(let s in n=n||{},t=t||{})Object.prototype.hasOwnProperty.call(t,s)&&(eK(t[s],n[s])||i.push({command:a,args:[r,s,n[s],o]}));for(let s in n)Object.prototype.hasOwnProperty.call(n,s)&&!Object.prototype.hasOwnProperty.call(t,s)&&(eK(t[s],n[s])||i.push({command:a,args:[r,s,n[s],o]}))}function e3(t){return t.id}function e4(t,n){return t[n.id]=n,t}class e6{constructor(t,n,i,r){this.message=(t?`${t}: `:"")+i,r&&(this.identifier=r),null!=n&&n.__line__&&(this.line=n.__line__)}}function e8(t,...n){for(let i of n)for(let n in i)t[n]=i[n];return t}class e7 extends Error{constructor(t,n){super(n),this.message=n,this.key=t}}class e9{constructor(t,n=[]){for(const[i,r]of(this.parent=t,this.bindings={},n))this.bindings[i]=r}concat(t){return new e9(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}let te={kind:"null"},tt={kind:"number"},tn={kind:"string"},ti={kind:"boolean"},tr={kind:"color"},to={kind:"projectionDefinition"},ta={kind:"object"},ts={kind:"value"},tl={kind:"collator"},tc={kind:"formatted"},tu={kind:"padding"},td={kind:"colorArray"},th={kind:"numberArray"},tp={kind:"resolvedImage"},tf={kind:"variableAnchorOffsetCollection"};function tm(t,n){return{kind:"array",itemType:t,N:n}}function tg(t){if("array"===t.kind){let n=tg(t.itemType);return"number"==typeof t.N?`array<${n}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${n}>`}return t.kind}let tv=[te,tt,tn,ti,tr,to,tc,ta,tm(ts),tu,th,td,tp,tf];function tb(t,n){if("error"===n.kind)return null;if("array"===t.kind){if("array"===n.kind&&(0===n.N&&"value"===n.itemType.kind||!tb(t.itemType,n.itemType))&&("number"!=typeof t.N||t.N===n.N))return null}else{if(t.kind===n.kind)return null;if("value"===t.kind){for(let t of tv)if(!tb(t,n))return null}}return`Expected ${tg(t)} but found ${tg(n)} instead.`}function ty(t,n){return n.some(n=>n.kind===t.kind)}function t_(t,n){return n.some(n=>"null"===n?null===t:"array"===n?Array.isArray(t):"object"===n?t&&!Array.isArray(t)&&"object"==typeof t:n===typeof t)}function tx(t,n){return"array"===t.kind&&"array"===n.kind?t.itemType.kind===n.itemType.kind&&"number"==typeof t.N:t.kind===n.kind}let tw=.96422,tk=.82521,tC=4/29,tA=6/29,tE=6/29*3*(6/29),tS=6/29*(6/29)*(6/29),tT=Math.PI/180,tO=180/Math.PI;function tF(t){return(t%=360)<0&&(t+=360),t}function tM([t,n,i,r]){let o,a,s=tR((.2225045*(t=tI(t))+.7168786*(n=tI(n))+.0606169*(i=tI(i)))/1);t===n&&n===i?o=a=s:(o=tR((.4360747*t+.3850649*n+.1430804*i)/tw),a=tR((.0139322*t+.0971045*n+.7141733*i)/tk));let l=116*s-16;return[l<0?0:l,500*(o-s),200*(s-a),r]}function tI(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function tR(t){return t>tS?Math.pow(t,1/3):t/tE+tC}function tD([t,n,i,r]){let o=(t+16)/116,a=isNaN(n)?o:o+n/500,s=isNaN(i)?o:o-i/200;return o=+tL(o),[tP(3.1338561*(a=tw*tL(a))-1.6168667*o-.4906146*(s=tk*tL(s))),tP(-.9787684*a+1.9161415*o+.033454*s),tP(.0719453*a-.2289914*o+1.4052427*s),r]}function tP(t){return(t=t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055)<0?0:t>1?1:t}function tL(t){return t>tA?t*t*t:tE*(t-tC)}let tN=Object.hasOwn||function(t,n){return Object.prototype.hasOwnProperty.call(t,n)};function tz(t,n){return tN(t,n)?t[n]:void 0}function tj(t){return parseInt(t.padEnd(2,t),16)/255}function tB(t,n){return t$(n?t/100:t,0,1)}function t$(t,n,i){return Math.min(Math.max(n,t),i)}function tU(t){return!t.some(Number.isNaN)}let tV={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 tH(t,n,i){return t+i*(n-t)}function tq(t,n,i){return t.map((t,r)=>tH(t,n[r],i))}class tW{constructor(t,n,i,r=1,o=!0){this.r=t,this.g=n,this.b=i,this.a=r,o||(this.r*=r,this.g*=r,this.b*=r,r||this.overwriteGetter("rgb",[t,n,i,r]))}static parse(t){if(t instanceof tW)return t;if("string"!=typeof t)return;let n=function(t){if("transparent"===(t=t.toLowerCase().trim()))return[0,0,0,0];let n=tz(tV,t);if(n){let[t,i,r]=n;return[t/255,i/255,r/255,1]}if(t.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){let n=t.length<6?1:2,i=1;return[tj(t.slice(i,i+=n)),tj(t.slice(i,i+=n)),tj(t.slice(i,i+=n)),tj(t.slice(i,i+n)||"ff")]}if(t.startsWith("rgb")){let n=t.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(n){let[t,i,r,o,a,s,l,c,u,d,h,p]=n,f=[o||" ",l||" ",d].join("");if(" "===f||" /"===f||",,"===f||",,,"===f){let t=[r,s,u].join(""),n="%%%"===t?100:255*(""===t);if(n){let t=[t$(i/n,0,1),t$(a/n,0,1),t$(c/n,0,1),h?tB(+h,p):1];if(tU(t))return t}}return}}let i=t.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(i){let[t,n,r,o,a,s,l,c,u]=i,d=[r||" ",a||" ",l].join("");if(" "===d||" /"===d||",,"===d||",,,"===d){let t=[+n,t$(+o,0,100),t$(+s,0,100),c?tB(+c,u):1];if(tU(t))return function([t,n,i,r]){function o(r){let o=(r+t/30)%12,a=n*Math.min(i,1-i);return i-a*Math.max(-1,Math.min(o-3,9-o,1))}return t=tF(t),n/=100,i/=100,[o(0),o(8),o(4),r]}(t)}}}(t);return n?new tW(...n,!1):void 0}get rgb(){let{r:t,g:n,b:i,a:r}=this,o=r||1/0;return this.overwriteGetter("rgb",[t/o,n/o,i/o,r])}get hcl(){return this.overwriteGetter("hcl",function(t){let[n,i,r,o]=tM(t),a=Math.sqrt(i*i+r*r);return[Math.round(1e4*a)?tF(Math.atan2(r,i)*tO):NaN,a,n,o]}(this.rgb))}get lab(){return this.overwriteGetter("lab",tM(this.rgb))}overwriteGetter(t,n){return Object.defineProperty(this,t,{value:n}),n}toString(){let[t,n,i,r]=this.rgb;return`rgba(${[t,n,i].map(t=>Math.round(255*t)).join(",")},${r})`}static interpolate(t,n,i,r="rgb"){switch(r){case"rgb":{let[r,o,a,s]=tq(t.rgb,n.rgb,i);return new tW(r,o,a,s,!1)}case"hcl":{let r,o,[a,s,l,c]=t.hcl,[u,d,h,p]=n.hcl;if(isNaN(a)||isNaN(u))isNaN(a)?isNaN(u)?r=NaN:(r=u,1!==l&&0!==l||(o=d)):(r=a,1!==h&&0!==h||(o=s));else{let t=u-a;u>a&&t>180?t-=360:u<a&&a-u>180&&(t+=360),r=a+i*t}let[f,m,g,v]=function([t,n,i,r]){return tD([i,Math.cos(t=isNaN(t)?0:t*tT)*n,Math.sin(t)*n,r])}([r,null!=o?o:tH(s,d,i),tH(l,h,i),tH(c,p,i)]);return new tW(f,m,g,v,!1)}case"lab":{let[r,o,a,s]=tD(tq(t.lab,n.lab,i));return new tW(r,o,a,s,!1)}}}}tW.black=new tW(0,0,0,1),tW.white=new tW(1,1,1,1),tW.transparent=new tW(0,0,0,0),tW.red=new tW(1,0,0,1);class tG{constructor(t,n,i){this.sensitivity=t?n?"variant":"case":n?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,n){return this.collator.compare(t,n)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}let tY=["bottom","center","top"];class tZ{constructor(t,n,i,r,o,a){this.text=t,this.image=n,this.scale=i,this.fontStack=r,this.textColor=o,this.verticalAlign=a}}class tX{constructor(t){this.sections=t}static fromString(t){return new tX([new tZ(t,null,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(t=>0!==t.text.length||t.image&&0!==t.image.name.length)}static factory(t){return t instanceof tX?t:tX.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map(t=>t.text).join("")}}class tK{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof tK)return t;if("number"==typeof t)return new tK([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(let n of t)if("number"!=typeof n)return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new tK(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,n,i){return new tK(tq(t.values,n.values,i))}}class tJ{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof tJ)return t;if("number"==typeof t)return new tJ([t]);if(Array.isArray(t)){for(let n of t)if("number"!=typeof n)return;return new tJ(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,n,i){return new tJ(tq(t.values,n.values,i))}}class tQ{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof tQ)return t;if("string"==typeof t){let n=tW.parse(t);if(!n)return;return new tQ([n])}if(!Array.isArray(t))return;let n=[];for(let i of t){if("string"!=typeof i)return;let t=tW.parse(i);if(!t)return;n.push(t)}return new tQ(n)}toString(){return JSON.stringify(this.values)}static interpolate(t,n,i,r="rgb"){let o=[];if(t.values.length!=n.values.length)throw Error(`colorArray: Arrays have mismatched length (${t.values.length} vs. ${n.values.length}), cannot interpolate.`);for(let a=0;a<t.values.length;a++)o.push(tW.interpolate(t.values[a],n.values[a],i,r));return new tQ(o)}}class t0 extends Error{constructor(t){super(t),this.name="RuntimeError"}toJSON(){return this.message}}let t1=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class t2{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof t2)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let n=0;n<t.length;n+=2){let i=t[n],r=t[n+1];if("string"!=typeof i||!t1.has(i)||!Array.isArray(r)||2!==r.length||"number"!=typeof r[0]||"number"!=typeof r[1])return}return new t2(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,n,i){let r=t.values,o=n.values;if(r.length!==o.length)throw new t0(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${n.toString()}`);let a=[];for(let t=0;t<r.length;t+=2){if(r[t]!==o[t])throw new t0(`Cannot interpolate values containing mismatched anchors. from[${t}]: ${r[t]}, to[${t}]: ${o[t]}`);a.push(r[t]);let[n,s]=r[t+1],[l,c]=o[t+1];a.push([tH(n,l,i),tH(s,c,i)])}return new t2(a)}}class t5{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new t5({name:t,available:!1}):null}}class t3{constructor(t,n,i){this.from=t,this.to=n,this.transition=i}static interpolate(t,n,i){return new t3(t,n,i)}static parse(t){return t instanceof t3?t:Array.isArray(t)&&3===t.length&&"string"==typeof t[0]&&"string"==typeof t[1]&&"number"==typeof t[2]?new t3(t[0],t[1],t[2]):"object"==typeof t&&"string"==typeof t.from&&"string"==typeof t.to&&"number"==typeof t.transition?new t3(t.from,t.to,t.transition):"string"==typeof t?new t3(t,t,1):void 0}}function t4(t,n,i,r){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof n&&n>=0&&n<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:`Invalid rgba value [${[t,n,i,r].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof r?[t,n,i,r]:[t,n,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function t6(t){if(null===t||"string"==typeof t||"boolean"==typeof t||"number"==typeof t||t instanceof t3||t instanceof tW||t instanceof tG||t instanceof tX||t instanceof tK||t instanceof tJ||t instanceof tQ||t instanceof t2||t instanceof t5)return!0;if(Array.isArray(t)){for(let n of t)if(!t6(n))return!1;return!0}if("object"==typeof t){for(let n in t)if(!t6(t[n]))return!1;return!0}return!1}function t8(t){if(null===t)return te;if("string"==typeof t)return tn;if("boolean"==typeof t)return ti;if("number"==typeof t)return tt;if(t instanceof tW)return tr;if(t instanceof t3)return to;if(t instanceof tG)return tl;if(t instanceof tX)return tc;if(t instanceof tK)return tu;if(t instanceof tJ)return th;if(t instanceof tQ)return td;if(t instanceof t2)return tf;if(t instanceof t5)return tp;if(Array.isArray(t)){let n,i=t.length;for(let i of t){let t=t8(i);if(n){if(n===t)continue;n=ts;break}n=t}return tm(n||ts,i)}return ta}function t7(t){let n=typeof t;return null===t?"":"string"===n||"number"===n||"boolean"===n?String(t):t instanceof tW||t instanceof t3||t instanceof tX||t instanceof tK||t instanceof tJ||t instanceof tQ||t instanceof t2||t instanceof t5?t.toString():JSON.stringify(t)}class t9{constructor(t,n){this.type=t,this.value=n}static parse(t,n){if(2!==t.length)return n.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!t6(t[1]))return n.error("invalid value");let i=t[1],r=t8(i),o=n.expectedType;return"array"===r.kind&&0===r.N&&o&&"array"===o.kind&&("number"!=typeof o.N||0===o.N)&&(r=o),new t9(r,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}let ne={string:tn,number:tt,boolean:ti,object:ta};class nt{constructor(t,n){this.type=t,this.args=n}static parse(t,n){if(t.length<2)return n.error("Expected at least one argument.");let i,r=1,o=t[0];if("array"===o){let o,a;if(t.length>2){let i=t[1];if("string"!=typeof i||!(i in ne)||"object"===i)return n.error('The item type argument of "array" must be one of string, number, boolean',1);o=ne[i],r++}else o=ts;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return n.error('The length argument to "array" must be a positive integer literal',2);a=t[2],r++}i=tm(o,a)}else{if(!ne[o])throw Error(`Types doesn't contain name = ${o}`);i=ne[o]}let a=[];for(;r<t.length;r++){let i=n.parse(t[r],r,ts);if(!i)return null;a.push(i)}return new nt(i,a)}evaluate(t){for(let n=0;n<this.args.length;n++){let i=this.args[n].evaluate(t);if(!tb(this.type,t8(i)))return i;if(n===this.args.length-1)throw new t0(`Expected value to be of type ${tg(this.type)}, but found ${tg(t8(i))} instead.`)}throw Error()}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}let nn={"to-boolean":ti,"to-color":tr,"to-number":tt,"to-string":tn};class ni{constructor(t,n){this.type=t,this.args=n}static parse(t,n){if(t.length<2)return n.error("Expected at least one argument.");let i=t[0];if(!nn[i])throw Error(`Can't parse ${i} as it is not part of the known types`);if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return n.error("Expected one argument.");let r=nn[i],o=[];for(let i=1;i<t.length;i++){let r=n.parse(t[i],i,ts);if(!r)return null;o.push(r)}return new ni(r,o)}evaluate(t){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(t);case"color":{let n,i;for(let r of this.args){if(n=r.evaluate(t),i=null,n instanceof tW)return n;if("string"==typeof n){let i=t.parseColor(n);if(i)return i}else if(Array.isArray(n)&&!(i=n.length<3||n.length>4?`Invalid rgba value ${JSON.stringify(n)}: expected an array containing either three or four numeric values.`:t4(n[0],n[1],n[2],n[3])))return new tW(n[0]/255,n[1]/255,n[2]/255,n[3])}throw new t0(i||`Could not parse color from value '${"string"==typeof n?n:JSON.stringify(n)}'`)}case"padding":{let n;for(let i of this.args){n=i.evaluate(t);let r=tK.parse(n);if(r)return r}throw new t0(`Could not parse padding from value '${"string"==typeof n?n:JSON.stringify(n)}'`)}case"numberArray":{let n;for(let i of this.args){n=i.evaluate(t);let r=tJ.parse(n);if(r)return r}throw new t0(`Could not parse numberArray from value '${"string"==typeof n?n:JSON.stringify(n)}'`)}case"colorArray":{let n;for(let i of this.args){n=i.evaluate(t);let r=tQ.parse(n);if(r)return r}throw new t0(`Could not parse colorArray from value '${"string"==typeof n?n:JSON.stringify(n)}'`)}case"variableAnchorOffsetCollection":{let n;for(let i of this.args){n=i.evaluate(t);let r=t2.parse(n);if(r)return r}throw new t0(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof n?n:JSON.stringify(n)}'`)}case"number":{let n=null;for(let i of this.args){if(null===(n=i.evaluate(t)))return 0;let r=Number(n);if(!isNaN(r))return r}throw new t0(`Could not convert ${JSON.stringify(n)} to number.`)}case"formatted":return tX.fromString(t7(this.args[0].evaluate(t)));case"resolvedImage":return t5.fromString(t7(this.args[0].evaluate(t)));case"projectionDefinition":return this.args[0].evaluate(t);default:return t7(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}let nr=["Unknown","Point","LineString","Polygon"];class no{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?nr[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(t){let n=this._parseColorCache.get(t);return n||(n=tW.parse(t),this._parseColorCache.set(t,n)),n}}class na{constructor(t,n,i=[],r,o=new e9,a=[]){this.registry=t,this.path=i,this.key=i.map(t=>`[${t}]`).join(""),this.scope=o,this.errors=a,this.expectedType=r,this._isConstant=n}parse(t,n,i,r,o={}){return n?this.concat(n,i,r)._parse(t,o):this._parse(t,o)}_parse(t,n){function i(t,n,i){return"assert"===i?new nt(n,[t]):"coerce"===i?new ni(n,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let r=t[0];if("string"!=typeof r)return this.error(`Expression name must be a string, but found ${typeof r} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let o=this.registry[r];if(o){let r=o.parse(t,this);if(!r)return null;if(this.expectedType){let t=this.expectedType,o=r.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==o.kind){if("projectionDefinition"===t.kind&&["string","array"].includes(o.kind)||["color","formatted","resolvedImage"].includes(t.kind)&&["value","string"].includes(o.kind)||["padding","numberArray"].includes(t.kind)&&["value","number","array"].includes(o.kind)||"colorArray"===t.kind&&["value","string","array"].includes(o.kind)||"variableAnchorOffsetCollection"===t.kind&&["value","array"].includes(o.kind))r=i(r,t,n.typeAnnotation||"coerce");else if(this.checkSubtype(t,o))return null}else r=i(r,t,n.typeAnnotation||"assert")}if(!(r instanceof t9)&&"resolvedImage"!==r.type.kind&&this._isConstant(r)){let t=new no;try{r=new t9(r.type,r.evaluate(t))}catch(t){return this.error(t.message),null}}return r}return this.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,n,i){let r="number"==typeof t?this.path.concat(t):this.path,o=i?this.scope.concat(i):this.scope;return new na(this.registry,this._isConstant,r,n||null,o,this.errors)}error(t,...n){let i=`${this.key}${n.map(t=>`[${t}]`).join("")}`;this.errors.push(new e7(i,t))}checkSubtype(t,n){let i=tb(t,n);return i&&this.error(i),i}}class ns{constructor(t,n){this.type=n.type,this.bindings=[].concat(t),this.result=n}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(let n of this.bindings)t(n[1]);t(this.result)}static parse(t,n){if(t.length<4)return n.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);let i=[];for(let r=1;r<t.length-1;r+=2){let o=t[r];if("string"!=typeof o)return n.error(`Expected string, but found ${typeof o} instead.`,r);if(/[^a-zA-Z0-9_]/.test(o))return n.error("Variable names must contain only alphanumeric characters or '_'.",r);let a=n.parse(t[r+1],r+1);if(!a)return null;i.push([o,a])}let r=n.parse(t[t.length-1],t.length-1,n.expectedType,i);return r?new ns(i,r):null}outputDefined(){return this.result.outputDefined()}}class nl{constructor(t,n){this.type=n.type,this.name=t,this.boundExpression=n}static parse(t,n){if(2!==t.length||"string"!=typeof t[1])return n.error("'var' expression requires exactly one string literal argument.");let i=t[1];return n.scope.has(i)?new nl(i,n.scope.get(i)):n.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}}class nc{constructor(t,n,i){this.type=t,this.index=n,this.input=i}static parse(t,n){if(3!==t.length)return n.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let i=n.parse(t[1],1,tt),r=n.parse(t[2],2,tm(n.expectedType||ts));return i&&r?new nc(r.type.itemType,i,r):null}evaluate(t){let n=this.index.evaluate(t),i=this.input.evaluate(t);if(n<0)throw new t0(`Array index out of bounds: ${n} < 0.`);if(n>=i.length)throw new t0(`Array index out of bounds: ${n} > ${i.length-1}.`);if(n!==Math.floor(n))throw new t0(`Array index must be an integer, but found ${n} instead.`);return i[n]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}}class nu{constructor(t,n){this.type=ti,this.needle=t,this.haystack=n}static parse(t,n){if(3!==t.length)return n.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let i=n.parse(t[1],1,ts),r=n.parse(t[2],2,ts);return i&&r?ty(i.type,[ti,tn,tt,te,ts])?new nu(i,r):n.error(`Expected first argument to be of type boolean, string, number or null, but found ${tg(i.type)} instead`):null}evaluate(t){let n=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return!1;if(!t_(n,["boolean","string","number","null"]))throw new t0(`Expected first argument to be of type boolean, string, number or null, but found ${tg(t8(n))} instead.`);if(!t_(i,["string","array"]))throw new t0(`Expected second argument to be of type array or string, but found ${tg(t8(i))} instead.`);return i.indexOf(n)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class nd{constructor(t,n,i){this.type=tt,this.needle=t,this.haystack=n,this.fromIndex=i}static parse(t,n){if(t.length<=2||t.length>=5)return n.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);let i=n.parse(t[1],1,ts),r=n.parse(t[2],2,ts);if(!i||!r)return null;if(!ty(i.type,[ti,tn,tt,te,ts]))return n.error(`Expected first argument to be of type boolean, string, number or null, but found ${tg(i.type)} instead`);if(4===t.length){let o=n.parse(t[3],3,tt);return o?new nd(i,r,o):null}return new nd(i,r)}evaluate(t){let n,i=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!t_(i,["boolean","string","number","null"]))throw new t0(`Expected first argument to be of type boolean, string, number or null, but found ${tg(t8(i))} instead.`);if(this.fromIndex&&(n=this.fromIndex.evaluate(t)),t_(r,["string"])){let t=r.indexOf(i,n);return -1===t?-1:[...r.slice(0,t)].length}if(t_(r,["array"]))return r.indexOf(i,n);throw new t0(`Expected second argument to be of type array or string, but found ${tg(t8(r))} instead.`)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class nh{constructor(t,n,i,r,o,a){this.inputType=t,this.type=n,this.input=i,this.cases=r,this.outputs=o,this.otherwise=a}static parse(t,n){let i,r;if(t.length<5)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return n.error("Expected an even number of arguments.");n.expectedType&&"value"!==n.expectedType.kind&&(r=n.expectedType);let o={},a=[];for(let s=2;s<t.length-1;s+=2){let l=t[s],c=t[s+1];Array.isArray(l)||(l=[l]);let u=n.concat(s);if(0===l.length)return u.error("Expected at least one branch label.");for(let t of l){if("number"!=typeof t&&"string"!=typeof t)return u.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return u.error("Numeric branch labels must be integer values.");if(i){if(u.checkSubtype(i,t8(t)))return null}else i=t8(t);if(void 0!==o[String(t)])return u.error("Branch labels must be unique.");o[String(t)]=a.length}let d=n.parse(c,s,r);if(!d)return null;r=r||d.type,a.push(d)}let s=n.parse(t[1],1,ts);if(!s)return null;let l=n.parse(t[t.length-1],t.length-1,r);return l?"value"!==s.type.kind&&n.concat(1).checkSubtype(i,s.type)?null:new nh(i,r,s,o,a,l):null}evaluate(t){let n=this.input.evaluate(t);return(t8(n)===this.inputType&&this.outputs[this.cases[n]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}}class np{constructor(t,n,i){this.type=t,this.branches=n,this.otherwise=i}static parse(t,n){let i;if(t.length<4)return n.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return n.error("Expected an odd number of arguments.");n.expectedType&&"value"!==n.expectedType.kind&&(i=n.expectedType);let r=[];for(let o=1;o<t.length-1;o+=2){let a=n.parse(t[o],o,ti);if(!a)return null;let s=n.parse(t[o+1],o+1,i);if(!s)return null;r.push([a,s]),i=i||s.type}let o=n.parse(t[t.length-1],t.length-1,i);if(!o)return null;if(!i)throw Error("Can't infer output type");return new np(i,r,o)}evaluate(t){for(let[n,i]of this.branches)if(n.evaluate(t))return i.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(let[n,i]of this.branches)t(n),t(i);t(this.otherwise)}outputDefined(){return this.branches.every(([t,n])=>n.outputDefined())&&this.otherwise.outputDefined()}}class nf{constructor(t,n,i,r){this.type=t,this.input=n,this.beginIndex=i,this.endIndex=r}static parse(t,n){if(t.length<=2||t.length>=5)return n.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);let i=n.parse(t[1],1,ts),r=n.parse(t[2],2,tt);if(!i||!r)return null;if(!ty(i.type,[tm(ts),tn,ts]))return n.error(`Expected first argument to be of type array or string, but found ${tg(i.type)} instead`);if(4===t.length){let o=n.parse(t[3],3,tt);return o?new nf(i.type,i,r,o):null}return new nf(i.type,i,r)}evaluate(t){let n,i=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(this.endIndex&&(n=this.endIndex.evaluate(t)),t_(i,["string"]))return[...i].slice(r,n).join("");if(t_(i,["array"]))return i.slice(r,n);throw new t0(`Expected first argument to be of type array or string, but found ${tg(t8(i))} instead.`)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function nm(t,n){let i=t.length-1,r,o,a=0,s=i,l=0;for(;a<=s;)if(r=t[l=Math.floor((a+s)/2)],o=t[l+1],r<=n){if(l===i||n<o)return l;a=l+1}else{if(!(r>n))throw new t0("Input is not a number.");s=l-1}return 0}class ng{constructor(t,n,i){for(const[r,o]of(this.type=t,this.input=n,this.labels=[],this.outputs=[],i))this.labels.push(r),this.outputs.push(o)}static parse(t,n){if(t.length-1<4)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return n.error("Expected an even number of arguments.");let i=n.parse(t[1],1,tt);if(!i)return null;let r=[],o=null;n.expectedType&&"value"!==n.expectedType.kind&&(o=n.expectedType);for(let i=1;i<t.length;i+=2){let a=1===i?-1/0:t[i],s=t[i+1],l=i,c=i+1;if("number"!=typeof a)return n.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(r.length&&r[r.length-1][0]>=a)return n.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);let u=n.parse(s,c,o);if(!u)return null;o=o||u.type,r.push([a,u])}return new ng(o,i,r)}evaluate(t){let n=this.labels,i=this.outputs;if(1===n.length)return i[0].evaluate(t);let r=this.input.evaluate(t);if(r<=n[0])return i[0].evaluate(t);let o=n.length;return r>=n[o-1]?i[o-1].evaluate(t):i[nm(n,r)].evaluate(t)}eachChild(t){for(let n of(t(this.input),this.outputs))t(n)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}var nv,nb,ny=function(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}(function(){if(nb)return nv;function t(t,n,i,r){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*n,this.by=3*(r-n)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=i,this.p2y=r}return nb=1,nv=t,t.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,n){if(void 0===n&&(n=1e-6),t<0)return 0;if(t>1)return 1;for(var i=t,r=0;r<8;r++){var o=this.sampleCurveX(i)-t;if(Math.abs(o)<n)return i;var a=this.sampleCurveDerivativeX(i);if(1e-6>Math.abs(a))break;i-=o/a}var s=0,l=1;for(i=t,r=0;r<20&&!(Math.abs((o=this.sampleCurveX(i))-t)<n);r++)t>o?s=i:l=i,i=.5*(l-s)+s;return i},solve:function(t,n){return this.sampleCurveY(this.solveCurveX(t,n))}},nv}());class n_{constructor(t,n,i,r,o){for(const[a,s]of(this.type=t,this.operator=n,this.interpolation=i,this.input=r,this.labels=[],this.outputs=[],o))this.labels.push(a),this.outputs.push(s)}static interpolationFactor(t,n,i,r){let o=0;if("exponential"===t.name)o=nx(n,t.base,i,r);else if("linear"===t.name)o=nx(n,1,i,r);else if("cubic-bezier"===t.name){let a=t.controlPoints;o=new ny(a[0],a[1],a[2],a[3]).solve(nx(n,1,i,r))}return o}static parse(t,n){let[i,r,o,...a]=t;if(!Array.isArray(r)||0===r.length)return n.error("Expected an interpolation type expression.",1);if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){let t=r[1];if("number"!=typeof t)return n.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:t}}else{if("cubic-bezier"!==r[0])return n.error(`Unknown interpolation type ${String(r[0])}`,1,0);{let t=r.slice(1);if(4!==t.length||t.some(t=>"number"!=typeof t||t<0||t>1))return n.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return n.error("Expected an even number of arguments.");if(!(o=n.parse(o,2,tt)))return null;let s=[],l=null;"interpolate-hcl"!==i&&"interpolate-lab"!==i||n.expectedType==td?n.expectedType&&"value"!==n.expectedType.kind&&(l=n.expectedType):l=tr;for(let t=0;t<a.length;t+=2){let i=a[t],r=a[t+1],o=t+3,c=t+4;if("number"!=typeof i)return n.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',o);if(s.length&&s[s.length-1][0]>=i)return n.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',o);let u=n.parse(r,c,l);if(!u)return null;l=l||u.type,s.push([i,u])}return tx(l,tt)||tx(l,to)||tx(l,tr)||tx(l,tu)||tx(l,th)||tx(l,td)||tx(l,tf)||tx(l,tm(tt))?new n_(l,i,r,o,s):n.error(`Type ${tg(l)} is not interpolatable.`)}evaluate(t){let n=this.labels,i=this.outputs;if(1===n.length)return i[0].evaluate(t);let r=this.input.evaluate(t);if(r<=n[0])return i[0].evaluate(t);let o=n.length;if(r>=n[o-1])return i[o-1].evaluate(t);let a=nm(n,r),s=n_.interpolationFactor(this.interpolation,r,n[a],n[a+1]),l=i[a].evaluate(t),c=i[a+1].evaluate(t);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return tH(l,c,s);case"color":return tW.interpolate(l,c,s);case"padding":return tK.interpolate(l,c,s);case"colorArray":return tQ.interpolate(l,c,s);case"numberArray":return tJ.interpolate(l,c,s);case"variableAnchorOffsetCollection":return t2.interpolate(l,c,s);case"array":return tq(l,c,s);case"projectionDefinition":return t3.interpolate(l,c,s)}case"interpolate-hcl":switch(this.type.kind){case"color":return tW.interpolate(l,c,s,"hcl");case"colorArray":return tQ.interpolate(l,c,s,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return tW.interpolate(l,c,s,"lab");case"colorArray":return tQ.interpolate(l,c,s,"lab")}}}eachChild(t){for(let n of(t(this.input),this.outputs))t(n)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function nx(t,n,i,r){let o=r-i,a=t-i;return 0===o?0:1===n?a/o:(Math.pow(n,a)-1)/(Math.pow(n,o)-1)}let nw={color:tW.interpolate,number:tH,padding:tK.interpolate,numberArray:tJ.interpolate,colorArray:tQ.interpolate,variableAnchorOffsetCollection:t2.interpolate,array:tq};class nk{constructor(t,n){this.type=t,this.args=n}static parse(t,n){if(t.length<2)return n.error("Expected at least one argument.");let i=null,r=n.expectedType;r&&"value"!==r.kind&&(i=r);let o=[];for(let r of t.slice(1)){let t=n.parse(r,1+o.length,i,void 0,{typeAnnotation:"omit"});if(!t)return null;i=i||t.type,o.push(t)}if(!i)throw Error("No output type");return new nk(r&&o.some(t=>tb(r,t.type))?ts:i,o)}evaluate(t){let n,i=null,r=0;for(let o of this.args)if(r++,(i=o.evaluate(t))&&i instanceof t5&&!i.available&&(n||(n=i.name),i=null,r===this.args.length&&(i=n)),null!==i)break;return i}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}function nC(t,n){return"=="===t||"!="===t?"boolean"===n.kind||"string"===n.kind||"number"===n.kind||"null"===n.kind||"value"===n.kind:"string"===n.kind||"number"===n.kind||"value"===n.kind}function nA(t,n,i,r){return 0===r.compare(n,i)}function nE(t,n,i){let r="=="!==t&&"!="!==t;return class o{constructor(t,n,i){this.type=ti,this.lhs=t,this.rhs=n,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===n.type.kind}static parse(t,n){if(3!==t.length&&4!==t.length)return n.error("Expected two or three arguments.");let i=t[0],a=n.parse(t[1],1,ts);if(!a)return null;if(!nC(i,a.type))return n.concat(1).error(`"${i}" comparisons are not supported for type '${tg(a.type)}'.`);let s=n.parse(t[2],2,ts);if(!s)return null;if(!nC(i,s.type))return n.concat(2).error(`"${i}" comparisons are not supported for type '${tg(s.type)}'.`);if(a.type.kind!==s.type.kind&&"value"!==a.type.kind&&"value"!==s.type.kind)return n.error(`Cannot compare types '${tg(a.type)}' and '${tg(s.type)}'.`);r&&("value"===a.type.kind&&"value"!==s.type.kind?a=new nt(s.type,[a]):"value"!==a.type.kind&&"value"===s.type.kind&&(s=new nt(a.type,[s])));let l=null;if(4===t.length){if("string"!==a.type.kind&&"string"!==s.type.kind&&"value"!==a.type.kind&&"value"!==s.type.kind)return n.error("Cannot use collator to compare non-string types.");if(!(l=n.parse(t[3],3,tl)))return null}return new o(a,s,l)}evaluate(o){let a=this.lhs.evaluate(o),s=this.rhs.evaluate(o);if(r&&this.hasUntypedArgument){let n=t8(a),i=t8(s);if(n.kind!==i.kind||"string"!==n.kind&&"number"!==n.kind)throw new t0(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${n.kind}, ${i.kind}) instead.`)}if(this.collator&&!r&&this.hasUntypedArgument){let t=t8(a),i=t8(s);if("string"!==t.kind||"string"!==i.kind)return n(o,a,s)}return this.collator?i(o,a,s,this.collator.evaluate(o)):n(o,a,s)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}}}let nS=nE("==",function(t,n,i){return n===i},nA),nT=nE("!=",function(t,n,i){return n!==i},function(t,n,i,r){return!nA(0,n,i,r)}),nO=nE("<",function(t,n,i){return n<i},function(t,n,i,r){return 0>r.compare(n,i)}),nF=nE(">",function(t,n,i){return n>i},function(t,n,i,r){return r.compare(n,i)>0}),nM=nE("<=",function(t,n,i){return n<=i},function(t,n,i,r){return 0>=r.compare(n,i)}),nI=nE(">=",function(t,n,i){return n>=i},function(t,n,i,r){return r.compare(n,i)>=0});class nR{constructor(t,n,i){this.type=tl,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=n}static parse(t,n){if(2!==t.length)return n.error("Expected one argument.");let i=t[1];if("object"!=typeof i||Array.isArray(i))return n.error("Collator options argument must be an object.");let r=n.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,ti);if(!r)return null;let o=n.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,ti);if(!o)return null;let a=null;return!i.locale||(a=n.parse(i.locale,1,tn))?new nR(r,o,a):null}evaluate(t){return new tG(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}}class nD{constructor(t,n,i,r,o){this.type=tn,this.number=t,this.locale=n,this.currency=i,this.minFractionDigits=r,this.maxFractionDigits=o}static parse(t,n){if(3!==t.length)return n.error("Expected two arguments.");let i=n.parse(t[1],1,tt);if(!i)return null;let r=t[2];if("object"!=typeof r||Array.isArray(r))return n.error("NumberFormat options argument must be an object.");let o=null;if(r.locale&&!(o=n.parse(r.locale,1,tn)))return null;let a=null;if(r.currency&&!(a=n.parse(r.currency,1,tn)))return null;let s=null;if(r["min-fraction-digits"]&&!(s=n.parse(r["min-fraction-digits"],1,tt)))return null;let l=null;return!r["max-fraction-digits"]||(l=n.parse(r["max-fraction-digits"],1,tt))?new nD(i,o,a,s,l):null}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}}class nP{constructor(t){this.type=tc,this.sections=t}static parse(t,n){if(t.length<2)return n.error("Expected at least one argument.");let i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return n.error("First argument must be an image or text section.");let r=[],o=!1;for(let i=1;i<=t.length-1;++i){let a=t[i];if(o&&"object"==typeof a&&!Array.isArray(a)){o=!1;let t=null;if(a["font-scale"]&&!(t=n.parse(a["font-scale"],1,tt)))return null;let i=null;if(a["text-font"]&&!(i=n.parse(a["text-font"],1,tm(tn))))return null;let s=null;if(a["text-color"]&&!(s=n.parse(a["text-color"],1,tr)))return null;let l=null;if(a["vertical-align"]){if("string"==typeof a["vertical-align"]&&!tY.includes(a["vertical-align"]))return n.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${a["vertical-align"]}' instead.`);if(!(l=n.parse(a["vertical-align"],1,tn)))return null}let c=r[r.length-1];c.scale=t,c.font=i,c.textColor=s,c.verticalAlign=l}else{let a=n.parse(t[i],1,ts);if(!a)return null;let s=a.type.kind;if("string"!==s&&"value"!==s&&"null"!==s&&"resolvedImage"!==s)return n.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");o=!0,r.push({content:a,scale:null,font:null,textColor:null,verticalAlign:null})}}return new nP(r)}evaluate(t){return new tX(this.sections.map(n=>{let i=n.content.evaluate(t);return t8(i)===tp?new tZ("",i,null,null,null,n.verticalAlign?n.verticalAlign.evaluate(t):null):new tZ(t7(i),null,n.scale?n.scale.evaluate(t):null,n.font?n.font.evaluate(t).join(","):null,n.textColor?n.textColor.evaluate(t):null,n.verticalAlign?n.verticalAlign.evaluate(t):null)}))}eachChild(t){for(let n of this.sections)t(n.content),n.scale&&t(n.scale),n.font&&t(n.font),n.textColor&&t(n.textColor),n.verticalAlign&&t(n.verticalAlign)}outputDefined(){return!1}}class nL{constructor(t){this.type=tp,this.input=t}static parse(t,n){if(2!==t.length)return n.error("Expected two arguments.");let i=n.parse(t[1],1,tn);return i?new nL(i):n.error("No image name provided.")}evaluate(t){let n=this.input.evaluate(t),i=t5.fromString(n);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(n)>-1),i}eachChild(t){t(this.input)}outputDefined(){return!1}}class nN{constructor(t){this.type=tt,this.input=t}static parse(t,n){if(2!==t.length)return n.error(`Expected 1 argument, but found ${t.length-1} instead.`);let i=n.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?n.error(`Expected argument of type string or array, but found ${tg(i.type)} instead.`):new nN(i):null}evaluate(t){let n=this.input.evaluate(t);if("string"==typeof n)return[...n].length;if(Array.isArray(n))return n.length;throw new t0(`Expected value to be of type string or array, but found ${tg(t8(n))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}}let nz=8192;function nj(t,n){let i=(180+t[0])/360,r=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,o=Math.pow(2,n.z);return[Math.round(i*o*nz),Math.round(r*o*nz)]}function nB(t,n){let i=Math.pow(2,n.z);return[360*((t[0]/nz+n.x)/i)-180,360/Math.PI*Math.atan(Math.exp((180-360*((t[1]/nz+n.y)/i))*Math.PI/180))-90]}function n$(t,n){t[0]=Math.min(t[0],n[0]),t[1]=Math.min(t[1],n[1]),t[2]=Math.max(t[2],n[0]),t[3]=Math.max(t[3],n[1])}function nU(t,n){return!(t[0]<=n[0]||t[2]>=n[2]||t[1]<=n[1]||t[3]>=n[3])}function nV(t,n,i){let r=t[0]-n[0],o=t[1]-n[1],a=t[0]-i[0],s=t[1]-i[1];return r*s-a*o==0&&r*a<=0&&o*s<=0}function nH(t,n,i,r){var o,a;return 0!=(o=[r[0]-i[0],r[1]-i[1]])[0]*(a=[n[0]-t[0],n[1]-t[1]])[1]-o[1]*a[0]&&!(!nX(t,n,i,r)||!nX(i,r,t,n))}function nq(t,n,i){for(let r of i)for(let i=0;i<r.length-1;++i)if(nH(t,n,r[i],r[i+1]))return!0;return!1}function nW(t,n,i=!1){var r,o,a;let s=!1;for(let l of n)for(let n=0;n<l.length-1;n++){if(nV(t,l[n],l[n+1]))return i;(o=l[n])[1]>(r=t)[1]!=(a=l[n+1])[1]>r[1]&&r[0]<(a[0]-o[0])*(r[1]-o[1])/(a[1]-o[1])+o[0]&&(s=!s)}return s}function nG(t,n){for(let i of n)if(nW(t,i))return!0;return!1}function nY(t,n){for(let i of t)if(!nW(i,n))return!1;for(let i=0;i<t.length-1;++i)if(nq(t[i],t[i+1],n))return!1;return!0}function nZ(t,n){for(let i of n)if(nY(t,i))return!0;return!1}function nX(t,n,i,r){let o=r[0]-i[0],a=r[1]-i[1],s=(t[0]-i[0])*a-o*(t[1]-i[1]),l=(n[0]-i[0])*a-o*(n[1]-i[1]);return s>0&&l<0||s<0&&l>0}function nK(t,n,i){let r=[];for(let o=0;o<t.length;o++){let a=[];for(let r=0;r<t[o].length;r++){let s=nj(t[o][r],i);n$(n,s),a.push(s)}r.push(a)}return r}function nJ(t,n,i){let r=[];for(let o=0;o<t.length;o++){let a=nK(t[o],n,i);r.push(a)}return r}function nQ(t,n,i,r){if(t[0]<i[0]||t[0]>i[2]){let n=.5*r,o=t[0]-i[0]>n?-r:i[0]-t[0]>n?r:0;0===o&&(o=t[0]-i[2]>n?-r:i[2]-t[0]>n?r:0),t[0]+=o}n$(n,t)}function n0(t,n,i,r){let o=Math.pow(2,r.z)*nz,a=[r.x*nz,r.y*nz],s=[];for(let r of t)for(let t of r){let r=[t.x+a[0],t.y+a[1]];nQ(r,n,i,o),s.push(r)}return s}function n1(t,n,i,r){var o;let a=Math.pow(2,r.z)*nz,s=[r.x*nz,r.y*nz],l=[];for(let i of t){let t=[];for(let r of i){let i=[r.x+s[0],r.y+s[1]];n$(n,i),t.push(i)}l.push(t)}if(n[2]-n[0]<=a/2)for(let t of((o=n)[0]=o[1]=1/0,o[2]=o[3]=-1/0,l))for(let r of t)nQ(r,n,i,a);return l}class n2{constructor(t,n){this.type=ti,this.geojson=t,this.geometries=n}static parse(t,n){if(2!==t.length)return n.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(t6(t[1])){let n=t[1];if("FeatureCollection"===n.type){let t=[];for(let i of n.features){let{type:n,coordinates:r}=i.geometry;"Polygon"===n&&t.push(r),"MultiPolygon"===n&&t.push(...r)}if(t.length)return new n2(n,{type:"MultiPolygon",coordinates:t})}else if("Feature"===n.type){let t=n.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new n2(n,n.geometry)}else if("Polygon"===n.type||"MultiPolygon"===n.type)return new n2(n,n)}return n.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,n){let i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],o=t.canonicalID();if("Polygon"===n.type){let a=nK(n.coordinates,r,o),s=n0(t.geometry(),i,r,o);if(!nU(i,r))return!1;for(let t of s)if(!nW(t,a))return!1}if("MultiPolygon"===n.type){let a=nJ(n.coordinates,r,o),s=n0(t.geometry(),i,r,o);if(!nU(i,r))return!1;for(let t of s)if(!nG(t,a))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,n){let i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],o=t.canonicalID();if("Polygon"===n.type){let a=nK(n.coordinates,r,o),s=n1(t.geometry(),i,r,o);if(!nU(i,r))return!1;for(let t of s)if(!nY(t,a))return!1}if("MultiPolygon"===n.type){let a=nJ(n.coordinates,r,o),s=n1(t.geometry(),i,r,o);if(!nU(i,r))return!1;for(let t of s)if(!nZ(t,a))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let n5=class{constructor(t=[],n=(t,n)=>t<n?-1:+(t>n)){if(this.data=t,this.length=this.data.length,this.compare=n,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(0===this.length)return;let t=this.data[0],n=this.data.pop();return--this.length>0&&(this.data[0]=n,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:n,compare:i}=this,r=n[t];for(;t>0;){let o=t-1>>1,a=n[o];if(i(r,a)>=0)break;n[t]=a,t=o}n[t]=r}_down(t){let{data:n,compare:i}=this,r=this.length>>1,o=n[t];for(;t<r;){let r=1+(t<<1),a=r+1;if(a<this.length&&0>i(n[a],n[r])&&(r=a),i(n[r],o)>=0)break;n[t]=n[r],t=r}n[t]=o}};function n3(t,n,i=0,r=t.length-1,o=n6){for(;r>i;){if(r-i>600){let a=r-i+1,s=n-i+1,l=Math.log(a),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(a-c)/a)*(s-a/2<0?-1:1);n3(t,n,Math.max(i,Math.floor(n-s*c/a+u)),Math.min(r,Math.floor(n+(a-s)*c/a+u)),o)}let a=t[n],s=i,l=r;for(n4(t,i,n),o(t[r],a)>0&&n4(t,i,r);s<l;){for(n4(t,s,l),s++,l--;0>o(t[s],a);)s++;for(;o(t[l],a)>0;)l--}0===o(t[i],a)?n4(t,i,l):n4(t,++l,r),l<=n&&(i=l+1),n<=l&&(r=l-1)}}function n4(t,n,i){let r=t[n];t[n]=t[i],t[i]=r}function n6(t,n){return t<n?-1:+(t>n)}function n8(t,n){let i,r;if(t.length<=1)return[t];let o=[];for(let n of t){let t=n9(n);0!==t&&(n.area=Math.abs(t),void 0===r&&(r=t<0),r===t<0?(i&&o.push(i),i=[n]):i.push(n))}if(i&&o.push(i),n>1)for(let t=0;t<o.length;t++)o[t].length<=n||(n3(o[t],n,1,o[t].length-1,n7),o[t]=o[t].slice(0,n));return o}function n7(t,n){return n.area-t.area}function n9(t){let n=0;for(let i,r,o=0,a=t.length,s=a-1;o<a;s=o++)i=t[o],n+=((r=t[s]).x-i.x)*(i.y+r.y);return n}let ie=1/298.257223563*(2-1/298.257223563),it=Math.PI/180;class ii{constructor(t){const n=6378.137*it*1e3,i=Math.cos(t*it),r=1/(1-ie*(1-i*i)),o=Math.sqrt(r);this.kx=n*o*i,this.ky=n*o*r*(1-ie)}distance(t,n){let i=this.wrap(t[0]-n[0])*this.kx,r=(t[1]-n[1])*this.ky;return Math.sqrt(i*i+r*r)}pointOnLine(t,n){let i,r,o,a,s=1/0;for(let l=0;l<t.length-1;l++){let c=t[l][0],u=t[l][1],d=this.wrap(t[l+1][0]-c)*this.kx,h=(t[l+1][1]-u)*this.ky,p=0;0===d&&0===h||((p=(this.wrap(n[0]-c)*this.kx*d+(n[1]-u)*this.ky*h)/(d*d+h*h))>1?(c=t[l+1][0],u=t[l+1][1]):p>0&&(c+=d/this.kx*p,u+=h/this.ky*p));let f=(d=this.wrap(n[0]-c)*this.kx)*d+(h=(n[1]-u)*this.ky)*h;f<s&&(s=f,i=c,r=u,o=l,a=p)}return{point:[i,r],index:o,t:Math.max(0,Math.min(1,a))}}wrap(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}}function ir(t,n){return n[0]-t[0]}function io(t){return t[1]-t[0]+1}function ia(t,n){return t[1]>=t[0]&&t[1]<n}function is(t,n){if(t[0]>t[1])return[null,null];let i=io(t);if(n){if(2===i)return[t,null];let n=Math.floor(i/2);return[[t[0],t[0]+n],[t[0]+n,t[1]]]}if(1===i)return[t,null];let r=Math.floor(i/2)-1;return[[t[0],t[0]+r],[t[0]+r+1,t[1]]]}function il(t,n){if(!ia(n,t.length))return[1/0,1/0,-1/0,-1/0];let i=[1/0,1/0,-1/0,-1/0];for(let r=n[0];r<=n[1];++r)n$(i,t[r]);return i}function ic(t){let n=[1/0,1/0,-1/0,-1/0];for(let i of t)for(let t of i)n$(n,t);return n}function iu(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function id(t,n,i){if(!iu(t)||!iu(n))return NaN;let r=0,o=0;return t[2]<n[0]&&(r=n[0]-t[2]),t[0]>n[2]&&(r=t[0]-n[2]),t[1]>n[3]&&(o=t[1]-n[3]),t[3]<n[1]&&(o=n[1]-t[3]),i.distance([0,0],[r,o])}function ih(t,n,i){let r=i.pointOnLine(n,t);return i.distance(t,r.point)}function ip(t,n,i,r,o){return Math.min(Math.min(ih(t,[i,r],o),ih(n,[i,r],o)),Math.min(ih(i,[t,n],o),ih(r,[t,n],o)))}function im(t,n,i,r,o){if(!ia(n,t.length)||!ia(r,i.length))return 1/0;let a=1/0;for(let s=n[0];s<n[1];++s){let n=t[s],l=t[s+1];for(let t=r[0];t<r[1];++t){let r=i[t],s=i[t+1];if(nH(n,l,r,s))return 0;a=Math.min(a,ip(n,l,r,s,o))}}return a}function ig(t,n,i,r,o){if(!ia(n,t.length)||!ia(r,i.length))return NaN;let a=1/0;for(let s=n[0];s<=n[1];++s)for(let n=r[0];n<=r[1];++n)if(0===(a=Math.min(a,o.distance(t[s],i[n]))))return a;return a}function iv(t,n,i){if(nW(t,n,!0))return 0;let r=1/0;for(let o of n){let n=o[0],a=o[o.length-1];if(n!==a&&0===(r=Math.min(r,ih(t,[a,n],i))))break;let s=i.pointOnLine(o,t);if(0===(r=Math.min(r,i.distance(t,s.point))))break}return r}function ib(t,n,i,r){if(!ia(n,t.length))return NaN;for(let r=n[0];r<=n[1];++r)if(nW(t[r],i,!0))return 0;let o=1/0;for(let a=n[0];a<n[1];++a){let n=t[a],s=t[a+1];for(let t of i)for(let i=0,a=t.length,l=a-1;i<a;l=i++){let a=t[l],c=t[i];if(nH(n,s,a,c))return 0;o=Math.min(o,ip(n,s,a,c,r))}}return o}function iy(t,n){for(let i of t)for(let t of i)if(nW(t,n,!0))return!0;return!1}function i_(t,n,i,r=1/0){let o=ic(t),a=ic(n);if(r!==1/0&&id(o,a,i)>=r)return r;if(nU(o,a)){if(iy(t,n))return 0}else if(iy(n,t))return 0;let s=1/0;for(let r of t)for(let t=0,o=r.length,a=o-1;t<o;a=t++){let o=r[a],l=r[t];for(let t of n)for(let n=0,r=t.length,a=r-1;n<r;a=n++){let r=t[a],c=t[n];if(nH(o,l,r,c))return 0;s=Math.min(s,ip(o,l,r,c,i))}}return s}function ix(t,n,i,r,o,a){if(!a)return;let s=id(il(r,a),o,i);s<n&&t.push([s,a,[0,0]])}function iw(t,n,i,r,o,a,s){if(!a||!s)return;let l=id(il(r,a),il(o,s),i);l<n&&t.push([l,a,s])}function ik(t,n,i,r,o=1/0){let a=Math.min(r.distance(t[0],i[0][0]),o);if(0===a)return a;let s=new n5([[0,[0,t.length-1],[0,0]]],ir),l=ic(i);for(;s.length>0;){let o=s.pop();if(o[0]>=a)continue;let c=o[1],u=n?50:100;if(io(c)<=u){if(!ia(c,t.length))return NaN;if(n){let n=ib(t,c,i,r);if(isNaN(n)||0===n)return n;a=Math.min(a,n)}else for(let n=c[0];n<=c[1];++n)if(0===(a=Math.min(a,iv(t[n],i,r))))return 0}else{let i=is(c,n);ix(s,a,r,t,l,i[0]),ix(s,a,r,t,l,i[1])}}return a}function iC(t,n,i,r,o,a=1/0){let s=Math.min(a,o.distance(t[0],i[0]));if(0===s)return s;let l=new n5([[0,[0,t.length-1],[0,i.length-1]]],ir);for(;l.length>0;){let a=l.pop();if(a[0]>=s)continue;let c=a[1],u=a[2],d=n?50:100,h=r?50:100;if(io(c)<=d&&io(u)<=h){let a;if(!ia(c,t.length)&&ia(u,i.length))return NaN;if(n&&r)s=Math.min(s,a=im(t,c,i,u,o));else if(n&&!r){let n=t.slice(c[0],c[1]+1);for(let t=u[0];t<=u[1];++t)if(0===(s=Math.min(s,a=ih(i[t],n,o))))return s}else if(!n&&r){let n=i.slice(u[0],u[1]+1);for(let i=c[0];i<=c[1];++i)if(0===(s=Math.min(s,a=ih(t[i],n,o))))return s}else s=Math.min(s,a=ig(t,c,i,u,o))}else{let a=is(c,n),d=is(u,r);iw(l,s,o,t,i,a[0],d[0]),iw(l,s,o,t,i,a[0],d[1]),iw(l,s,o,t,i,a[1],d[0]),iw(l,s,o,t,i,a[1],d[1])}}return s}function iA(t){return"MultiPolygon"===t.type?t.coordinates.map(t=>({type:"Polygon",coordinates:t})):"MultiLineString"===t.type?t.coordinates.map(t=>({type:"LineString",coordinates:t})):"MultiPoint"===t.type?t.coordinates.map(t=>({type:"Point",coordinates:t})):[t]}class iE{constructor(t,n){this.type=tt,this.geojson=t,this.geometries=n}static parse(t,n){if(2!==t.length)return n.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(t6(t[1])){let n=t[1];if("FeatureCollection"===n.type)return new iE(n,n.features.map(t=>iA(t.geometry)).flat());if("Feature"===n.type)return new iE(n,iA(n.geometry));if("type"in n&&"coordinates"in n)return new iE(n,iA(n))}return n.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,n){let i=t.geometry(),r=i.flat().map(n=>nB([n.x,n.y],t.canonical));if(0===i.length)return NaN;let o=new ii(r[0][1]),a=1/0;for(let t of n){switch(t.type){case"Point":a=Math.min(a,iC(r,!1,[t.coordinates],!1,o,a));break;case"LineString":a=Math.min(a,iC(r,!1,t.coordinates,!0,o,a));break;case"Polygon":a=Math.min(a,ik(r,!1,t.coordinates,o,a))}if(0===a)break}return a}(t,this.geometries);if("LineString"===t.geometryType())return function(t,n){let i=t.geometry(),r=i.flat().map(n=>nB([n.x,n.y],t.canonical));if(0===i.length)return NaN;let o=new ii(r[0][1]),a=1/0;for(let t of n){switch(t.type){case"Point":a=Math.min(a,iC(r,!0,[t.coordinates],!1,o,a));break;case"LineString":a=Math.min(a,iC(r,!0,t.coordinates,!0,o,a));break;case"Polygon":a=Math.min(a,ik(r,!0,t.coordinates,o,a))}if(0===a)break}return a}(t,this.geometries);if("Polygon"===t.geometryType())return function(t,n){let i=t.geometry();if(0===i.length||0===i[0].length)return NaN;let r=n8(i,0).map(n=>n.map(n=>n.map(n=>nB([n.x,n.y],t.canonical)))),o=new ii(r[0][0][0][1]),a=1/0;for(let t of n)for(let n of r){switch(t.type){case"Point":a=Math.min(a,ik([t.coordinates],!1,n,o,a));break;case"LineString":a=Math.min(a,ik(t.coordinates,!0,n,o,a));break;case"Polygon":a=Math.min(a,i_(n,t.coordinates,o,a))}if(0===a)return a}return a}(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class iS{constructor(t){this.type=ts,this.key=t}static parse(t,n){if(2!==t.length)return n.error(`Expected 1 argument, but found ${t.length-1} instead.`);let i=t[1];return null==i?n.error("Global state property must be defined."):"string"!=typeof i?n.error(`Global state property must be string, but found ${typeof t[1]} instead.`):new iS(i)}evaluate(t){var n;let i=null==(n=t.globals)?void 0:n.globalState;return i&&0!==Object.keys(i).length?tz(i,this.key):null}eachChild(){}outputDefined(){return!1}}let iT={"==":nS,"!=":nT,">":nF,"<":nO,">=":nI,"<=":nM,array:nt,at:nc,boolean:nt,case:np,coalesce:nk,collator:nR,format:nP,image:nL,in:nu,"index-of":nd,interpolate:n_,"interpolate-hcl":n_,"interpolate-lab":n_,length:nN,let:ns,literal:t9,match:nh,number:nt,"number-format":nD,object:nt,slice:nf,step:ng,string:nt,"to-boolean":ni,"to-color":ni,"to-number":ni,"to-string":ni,var:nl,within:n2,distance:iE,"global-state":iS};class iO{constructor(t,n,i,r){this.name=t,this.type=n,this._evaluate=i,this.args=r}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,n){let i=t[0],r=iO.definitions[i];if(!r)return n.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);let o=Array.isArray(r)?r[0]:r.type,a=Array.isArray(r)?[[r[1],r[2]]]:r.overloads,s=a.filter(([n])=>!Array.isArray(n)||n.length===t.length-1),l=null;for(let[r,a]of s){l=new na(n.registry,iD,n.path,null,n.scope);let s=[],c=!1;for(let n=1;n<t.length;n++){let i=t[n],o=Array.isArray(r)?r[n-1]:r.type,a=l.parse(i,1+s.length,o);if(!a){c=!0;break}s.push(a)}if(!c)if(Array.isArray(r)&&r.length!==s.length)l.error(`Expected ${r.length} arguments, but found ${s.length} instead.`);else{for(let t=0;t<s.length;t++){let n=Array.isArray(r)?r[t]:r.type,i=s[t];l.concat(t+1).checkSubtype(n,i.type)}if(0===l.errors.length)return new iO(i,o,a,s)}}if(1===s.length)n.errors.push(...l.errors);else{let i=(s.length?s:a).map(([t])=>{var n;return Array.isArray(n=t)?`(${n.map(tg).join(", ")})`:`(${tg(n.type)}...)`}).join(" | "),r=[];for(let i=1;i<t.length;i++){let o=n.parse(t[i],1+r.length);if(!o)return null;r.push(tg(o.type))}n.error(`Expected arguments of type ${i}, but found (${r.join(", ")}) instead.`)}return null}static register(t,n){for(let i in iO.definitions=n,n)t[i]=iO}}function iF(t,[n,i,r,o]){n=n.evaluate(t),i=i.evaluate(t),r=r.evaluate(t);let a=o?o.evaluate(t):1,s=t4(n,i,r,a);if(s)throw new t0(s);return new tW(n/255,i/255,r/255,a,!1)}function iM(t,n){return t in n}function iI(t,n){let i=n[t];return void 0===i?null:i}function iR(t){return{type:t}}function iD(t){if(t instanceof nl)return iD(t.boundExpression);if(t instanceof iO&&"error"===t.name||t instanceof nR||t instanceof n2||t instanceof iE||t instanceof iS)return!1;let n=t instanceof ni||t instanceof nt,i=!0;return t.eachChild(t=>{i=n?i&&iD(t):i&&t instanceof t9}),!!i&&iP(t)&&iN(t,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"])}function iP(t){if(t instanceof iO&&("get"===t.name&&1===t.args.length||"feature-state"===t.name||"has"===t.name&&1===t.args.length||"properties"===t.name||"geometry-type"===t.name||"id"===t.name||/^filter-/.test(t.name))||t instanceof n2||t instanceof iE)return!1;let n=!0;return t.eachChild(t=>{n&&!iP(t)&&(n=!1)}),n}function iL(t){if(t instanceof iO&&"feature-state"===t.name)return!1;let n=!0;return t.eachChild(t=>{n&&!iL(t)&&(n=!1)}),n}function iN(t,n){if(t instanceof iO&&n.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild(t=>{i&&!iN(t,n)&&(i=!1)}),i}function iz(t){return{result:"success",value:t}}function ij(t){return{result:"error",value:t}}function iB(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function i$(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function iU(t){return!!t.expression&&t.expression.interpolated}function iV(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function iH(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)&&t8(t)===ta}function iq(t){return t}function iW(t,n){var i;let r,o,a=t.stops&&"object"==typeof t.stops[0][0],s=a||!(a||void 0!==t.property),l=t.type||(iU(n)?"exponential":"interval"),c=function(t){switch(t.type){case"color":return tW.parse;case"padding":return tK.parse;case"numberArray":return tJ.parse;case"colorArray":return tQ.parse;default:return null}}(n);if(c&&((t=e8({},t)).stops&&(t.stops=t.stops.map(t=>[t[0],c(t[1])])),t.default=c(t.default?t.default:n.default)),t.colorSpace&&"rgb"!==(i=t.colorSpace)&&"hcl"!==i&&"lab"!==i)throw Error(`Unknown color space: "${t.colorSpace}"`);let u=function(t){switch(t){case"exponential":return iX;case"interval":return iZ;case"categorical":return iY;case"identity":return iK;default:throw Error(`Unknown function type "${t}"`)}}(l);if("categorical"===l){for(let n of(r=Object.create(null),t.stops))r[n[0]]=n[1];o=typeof t.stops[0][0]}if(a){let i={},r=[];for(let n=0;n<t.stops.length;n++){let o=t.stops[n],a=o[0].zoom;void 0===i[a]&&(i[a]={zoom:a,type:t.type,property:t.property,default:t.default,stops:[]},r.push(a)),i[a].stops.push([o[0].value,o[1]])}let o=[];for(let t of r)o.push([i[t].zoom,iW(i[t],n)]);let a={name:"linear"};return{kind:"composite",interpolationType:a,interpolationFactor:n_.interpolationFactor.bind(void 0,a),zoomStops:o.map(t=>t[0]),evaluate:({zoom:i},r)=>iX({stops:o,base:t.base},n,i).evaluate(i,r)}}if(s){let i="exponential"===l?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return{kind:"camera",interpolationType:i,interpolationFactor:n_.interpolationFactor.bind(void 0,i),zoomStops:t.stops.map(t=>t[0]),evaluate:({zoom:i})=>u(t,n,i,r,o)}}return{kind:"source",evaluate(i,a){let s=a&&a.properties?a.properties[t.property]:void 0;return void 0===s?iG(t.default,n.default):u(t,n,s,r,o)}}}function iG(t,n,i){return void 0!==t?t:void 0!==n?n:void 0!==i?i:void 0}function iY(t,n,i,r,o){return iG(typeof i===o?r[i]:void 0,t.default,n.default)}function iZ(t,n,i){if("number"!==iV(i))return iG(t.default,n.default);let r=t.stops.length;if(1===r||i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[r-1][0])return t.stops[r-1][1];let o=nm(t.stops.map(t=>t[0]),i);return t.stops[o][1]}function iX(t,n,i){let r=void 0!==t.base?t.base:1;if("number"!==iV(i))return iG(t.default,n.default);let o=t.stops.length;if(1===o||i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[o-1][0])return t.stops[o-1][1];let a=nm(t.stops.map(t=>t[0]),i),s=function(t,n,i,r){let o=r-i,a=t-i;return 0===o?0:1===n?a/o:(Math.pow(n,a)-1)/(Math.pow(n,o)-1)}(i,r,t.stops[a][0],t.stops[a+1][0]),l=t.stops[a][1],c=t.stops[a+1][1],u=nw[n.type]||iq;return"function"==typeof l.evaluate?{evaluate(...n){let i=l.evaluate.apply(void 0,n),r=c.evaluate.apply(void 0,n);if(void 0!==i&&void 0!==r)return u(i,r,s,t.colorSpace)}}:u(l,c,s,t.colorSpace)}function iK(t,n,i){switch(n.type){case"color":i=tW.parse(i);break;case"formatted":i=tX.fromString(i.toString());break;case"resolvedImage":i=t5.fromString(i.toString());break;case"padding":i=tK.parse(i);break;case"colorArray":i=tQ.parse(i);break;case"numberArray":i=tJ.parse(i);break;default:iV(i)===n.type||"enum"===n.type&&n.values[i]||(i=void 0)}return iG(i,t.default,n.default)}iO.register(iT,{error:[{kind:"error"},[tn],(t,[n])=>{throw new t0(n.evaluate(t))}],typeof:[tn,[ts],(t,[n])=>tg(t8(n.evaluate(t)))],"to-rgba":[tm(tt,4),[tr],(t,[n])=>{let[i,r,o,a]=n.evaluate(t).rgb;return[255*i,255*r,255*o,a]}],rgb:[tr,[tt,tt,tt],iF],rgba:[tr,[tt,tt,tt,tt],iF],has:{type:ti,overloads:[[[tn],(t,[n])=>iM(n.evaluate(t),t.properties())],[[tn,ta],(t,[n,i])=>iM(n.evaluate(t),i.evaluate(t))]]},get:{type:ts,overloads:[[[tn],(t,[n])=>iI(n.evaluate(t),t.properties())],[[tn,ta],(t,[n,i])=>iI(n.evaluate(t),i.evaluate(t))]]},"feature-state":[ts,[tn],(t,[n])=>iI(n.evaluate(t),t.featureState||{})],properties:[ta,[],t=>t.properties()],"geometry-type":[tn,[],t=>t.geometryType()],id:[ts,[],t=>t.id()],zoom:[tt,[],t=>t.globals.zoom],"heatmap-density":[tt,[],t=>t.globals.heatmapDensity||0],elevation:[tt,[],t=>t.globals.elevation||0],"line-progress":[tt,[],t=>t.globals.lineProgress||0],accumulated:[ts,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[tt,iR(tt),(t,n)=>{let i=0;for(let r of n)i+=r.evaluate(t);return i}],"*":[tt,iR(tt),(t,n)=>{let i=1;for(let r of n)i*=r.evaluate(t);return i}],"-":{type:tt,overloads:[[[tt,tt],(t,[n,i])=>n.evaluate(t)-i.evaluate(t)],[[tt],(t,[n])=>-n.evaluate(t)]]},"/":[tt,[tt,tt],(t,[n,i])=>n.evaluate(t)/i.evaluate(t)],"%":[tt,[tt,tt],(t,[n,i])=>n.evaluate(t)%i.evaluate(t)],ln2:[tt,[],()=>Math.LN2],pi:[tt,[],()=>Math.PI],e:[tt,[],()=>Math.E],"^":[tt,[tt,tt],(t,[n,i])=>Math.pow(n.evaluate(t),i.evaluate(t))],sqrt:[tt,[tt],(t,[n])=>Math.sqrt(n.evaluate(t))],log10:[tt,[tt],(t,[n])=>Math.log(n.evaluate(t))/Math.LN10],ln:[tt,[tt],(t,[n])=>Math.log(n.evaluate(t))],log2:[tt,[tt],(t,[n])=>Math.log(n.evaluate(t))/Math.LN2],sin:[tt,[tt],(t,[n])=>Math.sin(n.evaluate(t))],cos:[tt,[tt],(t,[n])=>Math.cos(n.evaluate(t))],tan:[tt,[tt],(t,[n])=>Math.tan(n.evaluate(t))],asin:[tt,[tt],(t,[n])=>Math.asin(n.evaluate(t))],acos:[tt,[tt],(t,[n])=>Math.acos(n.evaluate(t))],atan:[tt,[tt],(t,[n])=>Math.atan(n.evaluate(t))],min:[tt,iR(tt),(t,n)=>Math.min(...n.map(n=>n.evaluate(t)))],max:[tt,iR(tt),(t,n)=>Math.max(...n.map(n=>n.evaluate(t)))],abs:[tt,[tt],(t,[n])=>Math.abs(n.evaluate(t))],round:[tt,[tt],(t,[n])=>{let i=n.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[tt,[tt],(t,[n])=>Math.floor(n.evaluate(t))],ceil:[tt,[tt],(t,[n])=>Math.ceil(n.evaluate(t))],"filter-==":[ti,[tn,ts],(t,[n,i])=>t.properties()[n.value]===i.value],"filter-id-==":[ti,[ts],(t,[n])=>t.id()===n.value],"filter-type-==":[ti,[tn],(t,[n])=>t.geometryType()===n.value],"filter-<":[ti,[tn,ts],(t,[n,i])=>{let r=t.properties()[n.value],o=i.value;return typeof r==typeof o&&r<o}],"filter-id-<":[ti,[ts],(t,[n])=>{let i=t.id(),r=n.value;return typeof i==typeof r&&i<r}],"filter->":[ti,[tn,ts],(t,[n,i])=>{let r=t.properties()[n.value],o=i.value;return typeof r==typeof o&&r>o}],"filter-id->":[ti,[ts],(t,[n])=>{let i=t.id(),r=n.value;return typeof i==typeof r&&i>r}],"filter-<=":[ti,[tn,ts],(t,[n,i])=>{let r=t.properties()[n.value],o=i.value;return typeof r==typeof o&&r<=o}],"filter-id-<=":[ti,[ts],(t,[n])=>{let i=t.id(),r=n.value;return typeof i==typeof r&&i<=r}],"filter->=":[ti,[tn,ts],(t,[n,i])=>{let r=t.properties()[n.value],o=i.value;return typeof r==typeof o&&r>=o}],"filter-id->=":[ti,[ts],(t,[n])=>{let i=t.id(),r=n.value;return typeof i==typeof r&&i>=r}],"filter-has":[ti,[ts],(t,[n])=>n.value in t.properties()],"filter-has-id":[ti,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[ti,[tm(tn)],(t,[n])=>n.value.indexOf(t.geometryType())>=0],"filter-id-in":[ti,[tm(ts)],(t,[n])=>n.value.indexOf(t.id())>=0],"filter-in-small":[ti,[tn,tm(ts)],(t,[n,i])=>i.value.indexOf(t.properties()[n.value])>=0],"filter-in-large":[ti,[tn,tm(ts)],(t,[n,i])=>(function(t,n,i,r){for(;i<=r;){let o=i+r>>1;if(n[o]===t)return!0;n[o]>t?r=o-1:i=o+1}return!1})(t.properties()[n.value],i.value,0,i.value.length-1)],all:{type:ti,overloads:[[[ti,ti],(t,[n,i])=>n.evaluate(t)&&i.evaluate(t)],[iR(ti),(t,n)=>{for(let i of n)if(!i.evaluate(t))return!1;return!0}]]},any:{type:ti,overloads:[[[ti,ti],(t,[n,i])=>n.evaluate(t)||i.evaluate(t)],[iR(ti),(t,n)=>{for(let i of n)if(i.evaluate(t))return!0;return!1}]]},"!":[ti,[ti],(t,[n])=>!n.evaluate(t)],"is-supported-script":[ti,[tn],(t,[n])=>{let i=t.globals&&t.globals.isSupportedScript;return!i||i(n.evaluate(t))}],upcase:[tn,[tn],(t,[n])=>n.evaluate(t).toUpperCase()],downcase:[tn,[tn],(t,[n])=>n.evaluate(t).toLowerCase()],concat:[tn,iR(ts),(t,n)=>n.map(n=>t7(n.evaluate(t))).join("")],"resolved-locale":[tn,[tl],(t,[n])=>n.evaluate(t).resolvedLocale()]});class iJ{constructor(t,n,i){this.expression=t,this._warningHistory={},this._evaluator=new no,this._defaultValue=n?function(t){if("color"===t.type&&iH(t.default))return new tW(0,0,0,0);switch(t.type){case"color":return tW.parse(t.default)||null;case"padding":return tK.parse(t.default)||null;case"numberArray":return tJ.parse(t.default)||null;case"colorArray":return tQ.parse(t.default)||null;case"variableAnchorOffsetCollection":return t2.parse(t.default)||null;case"projectionDefinition":return t3.parse(t.default)||null;default:return void 0===t.default?null:t.default}}(n):null,this._enumValues=n&&"enum"===n.type?n.values:null,this._globalState=i}evaluateWithoutErrorHandling(t,n,i,r,o,a){return this._globalState&&(t=i8(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=n,this._evaluator.featureState=i,this._evaluator.canonical=r,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(t,n,i,r,o,a){this._globalState&&(t=i8(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=n||null,this._evaluator.featureState=i||null,this._evaluator.canonical=r,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a||null;try{let t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new t0(`Expected value to be one of ${Object.keys(this._enumValues).map(t=>JSON.stringify(t)).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"u">typeof console&&console.warn(t.message)),this._defaultValue}}}function iQ(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in iT}function i0(t,n,i){let r=new na(iT,iD,[],n?function(t){let n={color:tr,string:tn,number:tt,enum:tn,boolean:ti,formatted:tc,padding:tu,numberArray:th,colorArray:td,projectionDefinition:to,resolvedImage:tp,variableAnchorOffsetCollection:tf};return"array"===t.type?tm(n[t.value]||ts,t.length):n[t.type]}(n):void 0),o=r.parse(t,void 0,void 0,void 0,n&&"string"===n.type?{typeAnnotation:"coerce"}:void 0);return o?iz(new iJ(o,n,i)):ij(r.errors)}class i1{constructor(t,n,i){this.kind=t,this._styleExpression=n,this.isStateDependent="constant"!==t&&!iL(n.expression),this.globalStateRefs=i6(n.expression),this._globalState=i}evaluateWithoutErrorHandling(t,n,i,r,o,a){return this._globalState&&(t=i8(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,n,i,r,o,a)}evaluate(t,n,i,r,o,a){return this._globalState&&(t=i8(t,this._globalState)),this._styleExpression.evaluate(t,n,i,r,o,a)}}class i2{constructor(t,n,i,r,o){this.kind=t,this.zoomStops=i,this._styleExpression=n,this.isStateDependent="camera"!==t&&!iL(n.expression),this.globalStateRefs=i6(n.expression),this.interpolationType=r,this._globalState=o}evaluateWithoutErrorHandling(t,n,i,r,o,a){return this._globalState&&(t=i8(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,n,i,r,o,a)}evaluate(t,n,i,r,o,a){return this._globalState&&(t=i8(t,this._globalState)),this._styleExpression.evaluate(t,n,i,r,o,a)}interpolationFactor(t,n,i){return this.interpolationType?n_.interpolationFactor(this.interpolationType,t,n,i):0}}function i5(t,n,i){let r=i0(t,n,i);if("error"===r.result)return r;let o=r.value.expression,a=iP(o);if(!a&&!iB(n))return ij([new e7("","data expressions not supported")]);let s=iN(o,["zoom"]);if(!s&&!i$(n))return ij([new e7("","zoom expressions not supported")]);let l=i4(o);return l||s?l instanceof e7?ij([l]):l instanceof n_&&!iU(n)?ij([new e7("",'"interpolate" expressions cannot be used with this property')]):iz(l?new i2(a?"camera":"composite",r.value,l.labels,l instanceof n_?l.interpolation:void 0,i):new i1(a?"constant":"source",r.value,i)):ij([new e7("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class i3{constructor(t,n){this._parameters=t,this._specification=n,e8(this,iW(this._parameters,this._specification))}static deserialize(t){return new i3(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function i4(t){let n=null;if(t instanceof ns)n=i4(t.result);else if(t instanceof nk){for(let i of t.args)if(n=i4(i))break}else(t instanceof ng||t instanceof n_)&&t.input instanceof iO&&"zoom"===t.input.name&&(n=t);return n instanceof e7||t.eachChild(t=>{let i=i4(t);i instanceof e7?n=i:!n&&i?n=new e7("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):n&&i&&n!==i&&(n=new e7("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),n}function i6(t,n=new Set){return t instanceof iS&&n.add(t.key),t.eachChild(t=>{i6(t,n)}),n}function i8(t,n){let{zoom:i,heatmapDensity:r,elevation:o,lineProgress:a,isSupportedScript:s,accumulated:l}=null!=t?t:{};return{zoom:i,heatmapDensity:r,elevation:o,lineProgress:a,isSupportedScript:s,accumulated:l,globalState:n}}function i7(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(let n of t.slice(1))if(!i7(n)&&"boolean"!=typeof n)return!1;return!0;default:return!0}}let i9={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function re(t,n){if(null==t)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};i7(t)||(t=ri(t));let i=i0(t,i9,n);if("error"===i.result)throw Error(i.value.map(t=>`${t.key}: ${t.message}`).join(", "));return{filter:(t,n,r)=>i.value.evaluate(t,n,{},r),needGeometry:rn(t),getGlobalStateRefs:()=>i6(i.value.expression)}}function rt(t,n){return t<n?-1:+(t>n)}function rn(t){if(!Array.isArray(t))return!1;if("within"===t[0]||"distance"===t[0])return!0;for(let n=1;n<t.length;n++)if(rn(t[n]))return!0;return!1}function ri(t){if(!t)return!0;let n=t[0];return t.length<=1?"any"!==n:"=="===n?rr(t[1],t[2],"=="):"!="===n?rs(rr(t[1],t[2],"==")):"<"===n||">"===n||"<="===n||">="===n?rr(t[1],t[2],n):"any"===n?["any"].concat(t.slice(1).map(ri)):"all"===n?["all"].concat(t.slice(1).map(ri)):"none"===n?["all"].concat(t.slice(1).map(ri).map(rs)):"in"===n?ro(t[1],t.slice(2)):"!in"===n?rs(ro(t[1],t.slice(2))):"has"===n?ra(t[1]):"!has"!==n||rs(ra(t[1]))}function rr(t,n,i){switch(t){case"$type":return[`filter-type-${i}`,n];case"$id":return[`filter-id-${i}`,n];default:return[`filter-${i}`,t,n]}}function ro(t,n){if(0===n.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",n]];case"$id":return["filter-id-in",["literal",n]];default:return n.length>200&&!n.some(t=>typeof t!=typeof n[0])?["filter-in-large",t,["literal",n.sort(rt)]]:["filter-in-small",t,["literal",n]]}}function ra(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function rs(t){return["!",t]}function rl(t){let n=typeof t;if("number"===n||"boolean"===n||"string"===n||null==t)return JSON.stringify(t);if(Array.isArray(t)){let n="[";for(let i of t)n+=`${rl(i)},`;return`${n}]`}let i=Object.keys(t).sort(),r="{";for(let n=0;n<i.length;n++)r+=`${JSON.stringify(i[n])}:${rl(t[i[n]])},`;return`${r}}`}function rc(t){let n="";for(let i of eZ)n+=`/${rl(t[i])}`;return n}function ru(t){let n=t.value;return n?[new e6(t.key,n,"constants have been deprecated as of v8")]:[]}function rd(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function rh(t){if(Array.isArray(t))return t.map(rh);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){let n={};for(let i in t)n[i]=rh(t[i]);return n}return rd(t)}function rp(t){let n=t.key,i=t.value,r=t.valueSpec||{},o=t.objectElementValidators||{},a=t.style,s=t.styleSpec,l=t.validateSpec,c=[],u=iV(i);if("object"!==u)return[new e6(n,i,`object expected, ${u} found`)];for(let t in i){let u,d=t.split(".")[0],h=tz(r,d)||r["*"];if(tz(o,d))u=o[d];else if(tz(r,d)){if(void 0===i[t])continue;u=l}else if(o["*"])u=o["*"];else{if(!r["*"]){c.push(new e6(n,i[t],`unknown property "${t}"`));continue}u=l}c=c.concat(u({key:(n?`${n}.`:n)+t,value:i[t],valueSpec:h,style:a,styleSpec:s,object:i,objectKey:t,validateSpec:l},i))}for(let t in r)o[t]||r[t].required&&void 0===r[t].default&&void 0===i[t]&&c.push(new e6(n,i,`missing required property "${t}"`));return c}function rf(t){let n=t.value,i=t.valueSpec,r=t.style,o=t.styleSpec,a=t.key,s=t.arrayElementValidator||t.validateSpec;if("array"!==iV(n))return[new e6(a,n,`array expected, ${iV(n)} found`)];if(i.length&&n.length!==i.length)return[new e6(a,n,`array length ${i.length} expected, length ${n.length} found`)];let l={type:i.value,values:i.values};o.$version<7&&(l.function=i.function),"object"===iV(i.value)&&(l=i.value);let c=[];for(let i=0;i<n.length;i++)c=c.concat(s({array:n,arrayIndex:i,value:n[i],valueSpec:l,validateSpec:t.validateSpec,style:r,styleSpec:o,key:`${a}[${i}]`}));return c}function rm(t){let n=t.key,i=t.value,r=t.valueSpec,o=iV(i);return"number"===o&&i!=i&&(o="NaN"),"number"!==o?[new e6(n,i,`number expected, ${o} found`)]:"minimum"in r&&i<r.minimum?[new e6(n,i,`${i} is less than the minimum value ${r.minimum}`)]:"maximum"in r&&i>r.maximum?[new e6(n,i,`${i} is greater than the maximum value ${r.maximum}`)]:[]}function rg(t){let n=t.valueSpec,i=rd(t.value.type),r,o,a,s={},l="categorical"!==i&&void 0===t.value.property,c=!l,u="array"===iV(t.value.stops)&&"array"===iV(t.value.stops[0])&&"object"===iV(t.value.stops[0][0]),d=rp({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===i)return[new e6(t.key,t.value,'identity function may not have a "stops" property')];let n=[],r=t.value;return n=n.concat(rf({key:t.key,value:r,valueSpec:t.valueSpec,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===iV(r)&&0===r.length&&n.push(new e6(t.key,r,"array must have at least one stop")),n},default:function(t){return t.validateSpec({key:t.key,value:t.value,valueSpec:n,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===i&&l&&d.push(new e6(t.key,t.value,'missing required property "property"')),"identity"===i||t.value.stops||d.push(new e6(t.key,t.value,'missing required property "stops"')),"exponential"===i&&t.valueSpec.expression&&!iU(t.valueSpec)&&d.push(new e6(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(c&&!iB(t.valueSpec)?d.push(new e6(t.key,t.value,"property functions not supported")):l&&!i$(t.valueSpec)&&d.push(new e6(t.key,t.value,"zoom functions not supported"))),("categorical"===i||u)&&void 0===t.value.property&&d.push(new e6(t.key,t.value,'"property" property is required')),d;function h(t){let i=[],r=t.value,l=t.key;if("array"!==iV(r))return[new e6(l,r,`array expected, ${iV(r)} found`)];if(2!==r.length)return[new e6(l,r,`array length 2 expected, length ${r.length} found`)];if(u){if("object"!==iV(r[0]))return[new e6(l,r,`object expected, ${iV(r[0])} found`)];if(void 0===r[0].zoom)return[new e6(l,r,"object stop key must have zoom")];if(void 0===r[0].value)return[new e6(l,r,"object stop key must have value")];if(a&&a>rd(r[0].zoom))return[new e6(l,r[0].zoom,"stop zoom values must appear in ascending order")];rd(r[0].zoom)!==a&&(a=rd(r[0].zoom),o=void 0,s={}),i=i.concat(rp({key:`${l}[0]`,value:r[0],valueSpec:{zoom:{}},validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:rm,value:p}}))}else i=i.concat(p({key:`${l}[0]`,value:r[0],validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec},r));return iQ(rh(r[1]))?i.concat([new e6(`${l}[1]`,r[1],"expressions are not allowed in function stops.")]):i.concat(t.validateSpec({key:`${l}[1]`,value:r[1],valueSpec:n,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec}))}function p(t,a){let l=iV(t.value),c=rd(t.value),u=null!==t.value?t.value:a;if(r){if(l!==r)return[new e6(t.key,u,`${l} stop domain type must match previous stop domain type ${r}`)]}else r=l;if("number"!==l&&"string"!==l&&"boolean"!==l)return[new e6(t.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==l&&"categorical"!==i){let r=`number expected, ${l} found`;return iB(n)&&void 0===i&&(r+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new e6(t.key,u,r)]}return"categorical"!==i||"number"!==l||isFinite(c)&&Math.floor(c)===c?"categorical"!==i&&"number"===l&&void 0!==o&&c<o?[new e6(t.key,u,"stop domain values must appear in ascending order")]:(o=c,"categorical"===i&&c in s?[new e6(t.key,u,"stop domain values must be unique")]:(s[c]=!0,[])):[new e6(t.key,u,`integer expected, found ${c}`)]}}function rv(t){let n=("property"===t.expressionContext?i5:i0)(rh(t.value),t.valueSpec);if("error"===n.result)return n.value.map(n=>new e6(`${t.key}${n.key}`,t.value,n.message));let i=n.value.expression||n.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!i.outputDefined())return[new e6(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===t.expressionContext&&"layout"===t.propertyType&&!iL(i))return[new e6(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!iL(i))return[new e6(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!iN(i,["zoom","feature-state"]))return[new e6(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!iP(i))return[new e6(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function rb(t){let n=t.key,i=t.value,r=iV(i);return"string"!==r?[new e6(n,i,`color expected, ${r} found`)]:tW.parse(String(i))?[]:[new e6(n,i,`color expected, "${i}" found`)]}function ry(t){let n=t.key,i=t.value,r=t.valueSpec,o=[];return Array.isArray(r.values)?-1===r.values.indexOf(rd(i))&&o.push(new e6(n,i,`expected one of [${r.values.join(", ")}], ${JSON.stringify(i)} found`)):-1===Object.keys(r.values).indexOf(rd(i))&&o.push(new e6(n,i,`expected one of [${Object.keys(r.values).join(", ")}], ${JSON.stringify(i)} found`)),o}function r_(t){return i7(rh(t.value))?rv(e8({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):rx(t)}function rx(t){let n=t.value,i=t.key;if("array"!==iV(n))return[new e6(i,n,`array expected, ${iV(n)} found`)];let r=t.styleSpec,o,a=[];if(n.length<1)return[new e6(i,n,"filter array must have at least 1 element")];switch(a=a.concat(ry({key:`${i}[0]`,value:n[0],valueSpec:r.filter_operator,style:t.style,styleSpec:t.styleSpec})),rd(n[0])){case"<":case"<=":case">":case">=":n.length>=2&&"$type"===rd(n[1])&&a.push(new e6(i,n,`"$type" cannot be use with operator "${n[0]}"`));case"==":case"!=":3!==n.length&&a.push(new e6(i,n,`filter array for operator "${n[0]}" must have 3 elements`));case"in":case"!in":n.length>=2&&"string"!==(o=iV(n[1]))&&a.push(new e6(`${i}[1]`,n[1],`string expected, ${o} found`));for(let s=2;s<n.length;s++)o=iV(n[s]),"$type"===rd(n[1])?a=a.concat(ry({key:`${i}[${s}]`,value:n[s],valueSpec:r.geometry_type,style:t.style,styleSpec:t.styleSpec})):"string"!==o&&"number"!==o&&"boolean"!==o&&a.push(new e6(`${i}[${s}]`,n[s],`string, number, or boolean expected, ${o} found`));break;case"any":case"all":case"none":for(let r=1;r<n.length;r++)a=a.concat(rx({key:`${i}[${r}]`,value:n[r],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":o=iV(n[1]),2!==n.length?a.push(new e6(i,n,`filter array for "${n[0]}" operator must have 2 elements`)):"string"!==o&&a.push(new e6(`${i}[1]`,n[1],`string expected, ${o} found`))}return a}function rw(t,n){let i,r=t.key,o=t.validateSpec,a=t.style,s=t.styleSpec,l=t.value,c=t.objectKey,u=s[`${n}_${t.layerType}`];if(!u)return[];let d=c.match(/^(.*)-transition$/);if("paint"===n&&d&&u[d[1]]&&u[d[1]].transition)return o({key:r,value:l,valueSpec:s.transition,style:a,styleSpec:s});let h=t.valueSpec||u[c];if(!h)return[new e6(r,l,`unknown property "${c}"`)];if("string"===iV(l)&&iB(h)&&!h.tokens&&(i=/^{([^}]+)}$/.exec(l)))return[new e6(r,l,`"${c}" does not support interpolation syntax
|
|
7021
|
+
`}ready(){super.ready(),this._tooltipController=new z.I(this),this._tooltipController.setManual(!0),this.addController(this._tooltipController)}}(0,o.X)(ee);var et=i(67949),en=i(38332);function ei(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function er(t,n,i){return n=ea(n),el(t,ed()?Reflect.construct(n,i||[],ea(t).constructor):n.apply(t,i))}function eo(t,n){if(!(t instanceof n))throw TypeError("Cannot call a class as a function")}function ea(t){return(ea=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function es(t,n){if("function"!=typeof n&&null!==n)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&ec(t,n)}function el(t,n){return n&&("object"===eu(n)||"function"==typeof n)?n:ei(t)}function ec(t,n){return(ec=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function eu(t){return t&&"u">typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}function ed(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ed=function(){return!!t})()}var eh=function(t,n,i,r){var o,a=arguments.length,s=a<3?n:null===r?r=Object.getOwnPropertyDescriptor(n,i):r;if(("u"<typeof Reflect?"undefined":eu(Reflect))==="object"&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,n,i,r);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(s=(a<3?o(s):a>3?o(n,i,s):o(n,i))||s);return a>3&&s&&Object.defineProperty(n,i,s),s};function ep(t){var n=document.createElement("vaadin-menu-bar-item");return(0,et.XX)(t,n),n}var ef=function(t){function n(){return eo(this,n),er(this,n,arguments)}return es(n,t),n}(ee);eh([(0,en.EM)("or-vaadin-menu-bar")],ef)},29773(t,n,i){"use strict";let r,o,a,s,l,c,u,d;i.d(n,{F0:()=>oI,Ay:()=>oR});var h={};function p(t,n){return function(){return t.apply(n,arguments)}}i.r(h),i.d(h,{hasBrowserEnv:()=>tr,hasStandardBrowserEnv:()=>ta,hasStandardBrowserWebWorkerEnv:()=>ts,navigator:()=>to,origin:()=>tl});let{toString:f}=Object.prototype,{getPrototypeOf:m}=Object,{iterator:g,toStringTag:v}=Symbol,b=(r=Object.create(null),t=>{let n=f.call(t);return r[n]||(r[n]=n.slice(8,-1).toLowerCase())}),y=t=>(t=t.toLowerCase(),n=>b(n)===t),_=t=>n=>typeof n===t,{isArray:x}=Array,w=_("undefined");function k(t){return null!==t&&!w(t)&&null!==t.constructor&&!w(t.constructor)&&S(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}let C=y("ArrayBuffer");function A(t){let n;return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&C(t.buffer)}let E=_("string"),S=_("function"),T=_("number"),O=t=>null!==t&&"object"==typeof t,F=t=>!0===t||!1===t,M=t=>{if("object"!==b(t))return!1;let n=m(t);return(null===n||n===Object.prototype||null===Object.getPrototypeOf(n))&&!(v in t)&&!(g in t)},I=t=>{if(!O(t)||k(t))return!1;try{return 0===Object.keys(t).length&&Object.getPrototypeOf(t)===Object.prototype}catch(t){return!1}},R=y("Date"),D=y("File"),P=t=>!!(t&&void 0!==t.uri),L=t=>t&&void 0!==t.getParts,N=y("Blob"),z=y("FileList"),j=t=>O(t)&&S(t.pipe),B=function(){return"u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{}}(),U=void 0!==B.FormData?B.FormData:void 0,V=t=>{if(!t)return!1;if(U&&t instanceof U)return!0;let n=m(t);if(!n||n===Object.prototype||!S(t.append))return!1;let i=b(t);return"formdata"===i||"object"===i&&S(t.toString)&&"[object FormData]"===t.toString()},H=y("URLSearchParams"),[q,W,G,Y]=["ReadableStream","Request","Response","Headers"].map(y),Z=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function X(t,n,{allOwnKeys:i=!1}={}){let r,o;if(null!=t)if("object"!=typeof t&&(t=[t]),x(t))for(r=0,o=t.length;r<o;r++)n.call(null,t[r],r,t);else{let o;if(k(t))return;let a=i?Object.getOwnPropertyNames(t):Object.keys(t),s=a.length;for(r=0;r<s;r++)o=a[r],n.call(null,t[o],o,t)}}function K(t,n){let i;if(k(t))return null;n=n.toLowerCase();let r=Object.keys(t),o=r.length;for(;o-- >0;)if(n===(i=r[o]).toLowerCase())return i;return null}let J="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,Q=t=>!w(t)&&t!==J;function ee(...t){let{caseless:n,skipUndefined:i}=Q(this)&&this||{},r={},o=(t,o)=>{if("__proto__"===o||"constructor"===o||"prototype"===o)return;let a=n&&K(r,o)||o,s=eh(r,a)?r[a]:void 0;M(s)&&M(t)?r[a]=ee(s,t):M(t)?r[a]=ee({},t):x(t)?r[a]=t.slice():i&&w(t)||(r[a]=t)};for(let n=0,i=t.length;n<i;n++)t[n]&&X(t[n],o);return r}let et=(t,n,i,{allOwnKeys:r}={})=>(X(n,(n,r)=>{i&&S(n)?Object.defineProperty(t,r,{__proto__:null,value:p(n,i),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,r,{__proto__:null,value:n,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),t),en=t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),ei=(t,n,i,r)=>{t.prototype=Object.create(n.prototype,r),Object.defineProperty(t.prototype,"constructor",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{__proto__:null,value:n.prototype}),i&&Object.assign(t.prototype,i)},er=(t,n,i,r)=>{let o,a,s,l={};if(n=n||{},null==t)return n;do{for(a=(o=Object.getOwnPropertyNames(t)).length;a-- >0;)s=o[a],(!r||r(s,t,n))&&!l[s]&&(n[s]=t[s],l[s]=!0);t=!1!==i&&m(t)}while(t&&(!i||i(t,n))&&t!==Object.prototype);return n},eo=(t,n,i)=>{t=String(t),(void 0===i||i>t.length)&&(i=t.length),i-=n.length;let r=t.indexOf(n,i);return -1!==r&&r===i},ea=t=>{if(!t)return null;if(x(t))return t;let n=t.length;if(!T(n))return null;let i=Array(n);for(;n-- >0;)i[n]=t[n];return i},es=(o="u">typeof Uint8Array&&m(Uint8Array),t=>o&&t instanceof o),el=(t,n)=>{let i,r=(t&&t[g]).call(t);for(;(i=r.next())&&!i.done;){let r=i.value;n.call(t,r[0],r[1])}},ec=(t,n)=>{let i,r=[];for(;null!==(i=t.exec(n));)r.push(i);return r},eu=y("HTMLFormElement"),ed=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,n,i){return n.toUpperCase()+i}),eh=(({hasOwnProperty:t})=>(n,i)=>t.call(n,i))(Object.prototype),ep=y("RegExp"),ef=(t,n)=>{let i=Object.getOwnPropertyDescriptors(t),r={};X(i,(i,o)=>{let a;!1!==(a=n(i,o,t))&&(r[o]=a||i)}),Object.defineProperties(t,r)},em=t=>{ef(t,(n,i)=>{if(S(t)&&["arguments","caller","callee"].includes(i))return!1;if(S(t[i])){if(n.enumerable=!1,"writable"in n){n.writable=!1;return}n.set||(n.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},eg=(t,n)=>{let i={};return(t=>{t.forEach(t=>{i[t]=!0})})(x(t)?t:String(t).split(n)),i},ev=()=>{},eb=(t,n)=>null!=t&&Number.isFinite(t*=1)?t:n;function ey(t){return!!(t&&S(t.append)&&"FormData"===t[v]&&t[g])}let e_=t=>{let n=new WeakSet,i=t=>{if(O(t)){if(n.has(t))return;if(k(t))return t;if(!("toJSON"in t)){n.add(t);let r=x(t)?[]:{};return X(t,(t,n)=>{let o=i(t);w(o)||(r[n]=o)}),n.delete(t),r}}return t};return i(t)},ex=y("AsyncFunction"),ew=t=>t&&(O(t)||S(t))&&S(t.then)&&S(t.catch),ek=(l="function"==typeof setImmediate,c=S(J.postMessage),l?setImmediate:c?(u=`axios@${Math.random()}`,d=[],J.addEventListener("message",({source:t,data:n})=>{t===J&&n===u&&d.length&&d.shift()()},!1),t=>{d.push(t),J.postMessage(u,"*")}):t=>setTimeout(t)),eC="u">typeof queueMicrotask?queueMicrotask.bind(J):"u">typeof process&&process.nextTick||ek,eA=t=>null!=t&&S(t[g]),eE={isArray:x,isArrayBuffer:C,isBuffer:k,isFormData:V,isArrayBufferView:A,isString:E,isNumber:T,isBoolean:F,isObject:O,isPlainObject:M,isEmptyObject:I,isReadableStream:q,isRequest:W,isResponse:G,isHeaders:Y,isUndefined:w,isDate:R,isFile:D,isReactNativeBlob:P,isReactNative:L,isBlob:N,isRegExp:ep,isFunction:S,isStream:j,isURLSearchParams:H,isTypedArray:es,isFileList:z,forEach:X,merge:ee,extend:et,trim:Z,stripBOM:en,inherits:ei,toFlatObject:er,kindOf:b,kindOfTest:y,endsWith:eo,toArray:ea,forEachEntry:el,matchAll:ec,isHTMLForm:eu,hasOwnProperty:eh,hasOwnProp:eh,reduceDescriptors:ef,freezeMethods:em,toObjectSet:eg,toCamelCase:ed,noop:ev,toFiniteNumber:eb,findKey:K,global:J,isContextDefined:Q,isSpecCompliantForm:ey,toJSONObject:e_,isAsyncFn:ex,isThenable:ew,setImmediate:ek,asap:eC,isIterable:eA},eS=eE.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"]),eT=t=>{let n,i,r,o={};return t&&t.split("\n").forEach(function(t){r=t.indexOf(":"),n=t.substring(0,r).trim().toLowerCase(),i=t.substring(r+1).trim(),!n||o[n]&&eS[n]||("set-cookie"===n?o[n]?o[n].push(i):o[n]=[i]:o[n]=o[n]?o[n]+", "+i:i)}),o};function eO(t){let n=0,i=t.length;for(;n<i;){let i=t.charCodeAt(n);if(9!==i&&32!==i)break;n+=1}for(;i>n;){let n=t.charCodeAt(i-1);if(9!==n&&32!==n)break;i-=1}return 0===n&&i===t.length?t:t.slice(n,i)}let eF=RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),eM=RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function eI(t,n){return eE.isArray(t)?t.map(t=>eI(t,n)):eO(String(t).replace(n,""))}let eR=t=>eI(t,eF),eD=t=>eI(t,eM);function eP(t){let n=Object.create(null);return eE.forEach(t.toJSON(),(t,i)=>{n[i]=eD(t)}),n}let eL=Symbol("internals");function eN(t){return t&&String(t).trim().toLowerCase()}function ez(t){return!1===t||null==t?t:eE.isArray(t)?t.map(ez):eR(String(t))}function ej(t){let n,i=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;n=r.exec(t);)i[n[1]]=n[2];return i}let eB=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function e$(t,n,i,r,o){if(eE.isFunction(r))return r.call(this,n,i);if(o&&(n=i),eE.isString(n)){if(eE.isString(r))return -1!==n.indexOf(r);if(eE.isRegExp(r))return r.test(n)}}function eU(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,i)=>n.toUpperCase()+i)}function eV(t,n){let i=eE.toCamelCase(" "+n);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+i,{__proto__:null,value:function(t,i,o){return this[r].call(this,n,t,i,o)},configurable:!0})})}class eH{constructor(t){t&&this.set(t)}set(t,n,i){let r=this;function o(t,n,i){let o=eN(n);if(!o)throw Error("header name must be a non-empty string");let a=eE.findKey(r,o);a&&void 0!==r[a]&&!0!==i&&(void 0!==i||!1===r[a])||(r[a||n]=ez(t))}let a=(t,n)=>eE.forEach(t,(t,i)=>o(t,i,n));if(eE.isPlainObject(t)||t instanceof this.constructor)a(t,n);else if(eE.isString(t)&&(t=t.trim())&&!eB(t))a(eT(t),n);else if(eE.isObject(t)&&eE.isIterable(t)){let i={},r,o;for(let n of t){if(!eE.isArray(n))throw TypeError("Object iterator must return a key-value pair");i[o=n[0]]=(r=i[o])?eE.isArray(r)?[...r,n[1]]:[r,n[1]]:n[1]}a(i,n)}else null!=t&&o(n,t,i);return this}get(t,n){if(t=eN(t)){let i=eE.findKey(this,t);if(i){let t=this[i];if(!n)return t;if(!0===n)return ej(t);if(eE.isFunction(n))return n.call(this,t,i);if(eE.isRegExp(n))return n.exec(t);throw TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=eN(t)){let i=eE.findKey(this,t);return!!(i&&void 0!==this[i]&&(!n||e$(this,this[i],i,n)))}return!1}delete(t,n){let i=this,r=!1;function o(t){if(t=eN(t)){let o=eE.findKey(i,t);o&&(!n||e$(i,i[o],o,n))&&(delete i[o],r=!0)}}return eE.isArray(t)?t.forEach(o):o(t),r}clear(t){let n=Object.keys(this),i=n.length,r=!1;for(;i--;){let o=n[i];(!t||e$(this,this[o],o,t,!0))&&(delete this[o],r=!0)}return r}normalize(t){let n=this,i={};return eE.forEach(this,(r,o)=>{let a=eE.findKey(i,o);if(a){n[a]=ez(r),delete n[o];return}let s=t?eU(o):String(o).trim();s!==o&&delete n[o],n[s]=ez(r),i[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let n=Object.create(null);return eE.forEach(this,(i,r)=>{null!=i&&!1!==i&&(n[r]=t&&eE.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){let i=new this(t);return n.forEach(t=>i.set(t)),i}static accessor(t){let n=(this[eL]=this[eL]={accessors:{}}).accessors,i=this.prototype;function r(t){let r=eN(t);n[r]||(eV(i,t),n[r]=!0)}return eE.isArray(t)?t.forEach(r):r(t),this}}eH.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),eE.reduceDescriptors(eH.prototype,({value:t},n)=>{let i=n[0].toUpperCase()+n.slice(1);return{get:()=>t,set(t){this[i]=t}}}),eE.freezeMethods(eH);let eq=eH,eW="[REDACTED ****]";function eG(t){if(eE.hasOwnProp(t,"toJSON"))return!0;let n=Object.getPrototypeOf(t);for(;n&&n!==Object.prototype;){if(eE.hasOwnProp(n,"toJSON"))return!0;n=Object.getPrototypeOf(n)}return!1}function eY(t,n){let i=new Set(n.map(t=>String(t).toLowerCase())),r=[],o=t=>{let n;if(null===t||"object"!=typeof t||eE.isBuffer(t))return t;if(-1===r.indexOf(t)){if(t instanceof eq&&(t=t.toJSON()),r.push(t),eE.isArray(t))n=[],t.forEach((t,i)=>{let r=o(t);eE.isUndefined(r)||(n[i]=r)});else{if(!eE.isPlainObject(t)&&eG(t))return r.pop(),t;for(let[r,a]of(n=Object.create(null),Object.entries(t))){let t=i.has(r.toLowerCase())?eW:o(a);eE.isUndefined(t)||(n[r]=t)}}return r.pop(),n}};return o(t)}class eZ extends Error{static from(t,n,i,r,o,a){let s=new eZ(t.message,n||t.code,i,r,o);return s.cause=t,s.name=t.name,null!=t.status&&null==s.status&&(s.status=t.status),a&&Object.assign(s,a),s}constructor(t,n,i,r,o){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),i&&(this.config=i),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){let t=this.config,n=t&&eE.hasOwnProp(t,"redact")?t.redact:void 0,i=eE.isArray(n)&&n.length>0?eY(t,n):eE.toJSONObject(t);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:i,code:this.code,status:this.status}}}eZ.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",eZ.ERR_BAD_OPTION="ERR_BAD_OPTION",eZ.ECONNABORTED="ECONNABORTED",eZ.ETIMEDOUT="ETIMEDOUT",eZ.ECONNREFUSED="ECONNREFUSED",eZ.ERR_NETWORK="ERR_NETWORK",eZ.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",eZ.ERR_DEPRECATED="ERR_DEPRECATED",eZ.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",eZ.ERR_BAD_REQUEST="ERR_BAD_REQUEST",eZ.ERR_CANCELED="ERR_CANCELED",eZ.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",eZ.ERR_INVALID_URL="ERR_INVALID_URL",eZ.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";let eX=eZ,eK=null;function eJ(t){return eE.isPlainObject(t)||eE.isArray(t)}function eQ(t){return eE.endsWith(t,"[]")?t.slice(0,-2):t}function e0(t,n,i){return t?t.concat(n).map(function(t,n){return t=eQ(t),!i&&n?"["+t+"]":t}).join(i?".":""):n}function e1(t){return eE.isArray(t)&&!t.some(eJ)}let e2=eE.toFlatObject(eE,{},null,function(t){return/^is[A-Z]/.test(t)}),e5=function(t,n,i){if(!eE.isObject(t))throw TypeError("target must be an object");n=n||new(eK||FormData);let r=(i=eE.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(t,n){return!eE.isUndefined(n[t])})).metaTokens,o=i.visitor||h,a=i.dots,s=i.indexes,l=i.Blob||"u">typeof Blob&&Blob,c=void 0===i.maxDepth?100:i.maxDepth,u=l&&eE.isSpecCompliantForm(n);if(!eE.isFunction(o))throw TypeError("visitor must be a function");function d(t){if(null===t)return"";if(eE.isDate(t))return t.toISOString();if(eE.isBoolean(t))return t.toString();if(!u&&eE.isBlob(t))throw new eX("Blob is not supported. Use a Buffer instead.");return eE.isArrayBuffer(t)||eE.isTypedArray(t)?u&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function h(t,i,o){let l=t;if(eE.isReactNative(n)&&eE.isReactNativeBlob(t))return n.append(e0(o,i,a),d(t)),!1;if(t&&!o&&"object"==typeof t){if(eE.endsWith(i,"{}"))i=r?i:i.slice(0,-2),t=JSON.stringify(t);else if(eE.isArray(t)&&e1(t)||(eE.isFileList(t)||eE.endsWith(i,"[]"))&&(l=eE.toArray(t)))return i=eQ(i),l.forEach(function(t,r){eE.isUndefined(t)||null===t||n.append(!0===s?e0([i],r,a):null===s?i:i+"[]",d(t))}),!1}return!!eJ(t)||(n.append(e0(o,i,a),d(t)),!1)}let p=[],f=Object.assign(e2,{defaultVisitor:h,convertValue:d,isVisitable:eJ});function m(t,i,r=0){if(!eE.isUndefined(t)){if(r>c)throw new eX("Object is too deeply nested ("+r+" levels). Max depth: "+c,eX.ERR_FORM_DATA_DEPTH_EXCEEDED);if(-1!==p.indexOf(t))throw Error("Circular reference detected in "+i.join("."));p.push(t),eE.forEach(t,function(t,a){!0===(!(eE.isUndefined(t)||null===t)&&o.call(n,t,eE.isString(a)?a.trim():a,i,f))&&m(t,i?i.concat(a):[a],r+1)}),p.pop()}}if(!eE.isObject(t))throw TypeError("data must be an object");return m(t),n};function e3(t){let n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(t).replace(/[!'()~]|%20/g,function(t){return n[t]})}function e4(t,n){this._pairs=[],t&&e5(t,this,n)}let e6=e4.prototype;e6.append=function(t,n){this._pairs.push([t,n])},e6.toString=function(t){let n=t?function(n){return t.call(this,n,e3)}:e3;return this._pairs.map(function(t){return n(t[0])+"="+n(t[1])},"").join("&")};let e8=e4;function e7(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function e9(t,n,i){let r;if(!n)return t;let o=i&&i.encode||e7,a=eE.isFunction(i)?{serialize:i}:i,s=a&&a.serialize;if(r=s?s(n,a):eE.isURLSearchParams(n)?n.toString():new e8(n,a).toString(o)){let n=t.indexOf("#");-1!==n&&(t=t.slice(0,n)),t+=(-1===t.indexOf("?")?"?":"&")+r}return t}class te{constructor(){this.handlers=[]}use(t,n,i){return this.handlers.push({fulfilled:t,rejected:n,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){eE.forEach(this.handlers,function(n){null!==n&&t(n)})}}let tt=te,tn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},ti={isBrowser:!0,classes:{URLSearchParams:"u">typeof URLSearchParams?URLSearchParams:e8,FormData:"u">typeof FormData?FormData:null,Blob:"u">typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},tr="u">typeof window&&"u">typeof document,to="object"==typeof navigator&&navigator||void 0,ta=tr&&(!to||0>["ReactNative","NativeScript","NS"].indexOf(to.product)),ts="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,tl=tr&&window.location.href||"http://localhost",tc={...h,...ti};function tu(t,n){return e5(t,new tc.classes.URLSearchParams,{visitor:function(t,n,i,r){return tc.isNode&&eE.isBuffer(t)?(this.append(n,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...n})}function td(t){return eE.matchAll(/\w+|\[(\w*)]/g,t).map(t=>"[]"===t[0]?"":t[1]||t[0])}function th(t){let n,i,r={},o=Object.keys(t),a=o.length;for(n=0;n<a;n++)r[i=o[n]]=t[i];return r}let tp=function(t){function n(t,i,r,o){let a=t[o++];if("__proto__"===a)return!0;let s=Number.isFinite(+a),l=o>=t.length;return(a=!a&&eE.isArray(r)?r.length:a,l)?eE.hasOwnProp(r,a)?r[a]=eE.isArray(r[a])?r[a].concat(i):[r[a],i]:r[a]=i:(eE.hasOwnProp(r,a)&&eE.isObject(r[a])||(r[a]=[]),n(t,i,r[a],o)&&eE.isArray(r[a])&&(r[a]=th(r[a]))),!s}if(eE.isFormData(t)&&eE.isFunction(t.entries)){let i={};return eE.forEachEntry(t,(t,r)=>{n(td(t),r,i,0)}),i}return null},tf=(t,n)=>null!=t&&eE.hasOwnProp(t,n)?t[n]:void 0;function tm(t,n,i){if(eE.isString(t))try{return(n||JSON.parse)(t),eE.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(i||JSON.stringify)(t)}let tg={transitional:tn,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){let i,r=n.getContentType()||"",o=r.indexOf("application/json")>-1,a=eE.isObject(t);if(a&&eE.isHTMLForm(t)&&(t=new FormData(t)),eE.isFormData(t))return o?JSON.stringify(tp(t)):t;if(eE.isArrayBuffer(t)||eE.isBuffer(t)||eE.isStream(t)||eE.isFile(t)||eE.isBlob(t)||eE.isReadableStream(t))return t;if(eE.isArrayBufferView(t))return t.buffer;if(eE.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();if(a){let n=tf(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return tu(t,n).toString();if((i=eE.isFileList(t))||r.indexOf("multipart/form-data")>-1){let r=tf(this,"env"),o=r&&r.FormData;return e5(i?{"files[]":t}:t,o&&new o,n)}}return a||o?(n.setContentType("application/json",!1),tm(t)):t}],transformResponse:[function(t){let n=tf(this,"transitional")||tg.transitional,i=n&&n.forcedJSONParsing,r=tf(this,"responseType"),o="json"===r;if(eE.isResponse(t)||eE.isReadableStream(t))return t;if(t&&eE.isString(t)&&(i&&!r||o)){let i=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t,tf(this,"parseReviver"))}catch(t){if(i){if("SyntaxError"===t.name)throw eX.from(t,eX.ERR_BAD_RESPONSE,this,null,tf(this,"response"));throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:tc.classes.FormData,Blob:tc.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};eE.forEach(["delete","get","head","post","put","patch","query"],t=>{tg.headers[t]={}});let tv=tg;function tb(t,n){let i=this||tv,r=n||i,o=eq.from(r.headers),a=r.data;return eE.forEach(t,function(t){a=t.call(i,a,o.normalize(),n?n.status:void 0)}),o.normalize(),a}function ty(t){return!!(t&&t.__CANCEL__)}class t_ extends eX{constructor(t,n,i){super(null==t?"canceled":t,eX.ERR_CANCELED,n,i),this.name="CanceledError",this.__CANCEL__=!0}}let tx=t_;function tw(t,n,i){let r=i.config.validateStatus;!i.status||!r||r(i.status)?t(i):n(new eX("Request failed with status code "+i.status,i.status>=400&&i.status<500?eX.ERR_BAD_REQUEST:eX.ERR_BAD_RESPONSE,i.config,i.request,i))}function tk(t){let n=/^([-+\w]{1,25}):(?:\/\/)?/.exec(t);return n&&n[1]||""}let tC=function(t,n){let i,r=Array(t=t||10),o=Array(t),a=0,s=0;return n=void 0!==n?n:1e3,function(l){let c=Date.now(),u=o[s];i||(i=c),r[a]=l,o[a]=c;let d=s,h=0;for(;d!==a;)h+=r[d++],d%=t;if((a=(a+1)%t)===s&&(s=(s+1)%t),c-i<n)return;let p=u&&c-u;return p?Math.round(1e3*h/p):void 0}},tA=function(t,n){let i,r,o=0,a=1e3/n,s=(n,a=Date.now())=>{o=a,i=null,r&&(clearTimeout(r),r=null),t(...n)};return[(...t)=>{let n=Date.now(),l=n-o;l>=a?s(t,n):(i=t,r||(r=setTimeout(()=>{r=null,s(i)},a-l)))},()=>i&&s(i)]},tE=(t,n,i=3)=>{let r=0,o=tC(50,250);return tA(i=>{if(!i||"number"!=typeof i.loaded)return;let a=i.loaded,s=i.lengthComputable?i.total:void 0,l=null!=s?Math.min(a,s):a,c=Math.max(0,l-r),u=o(c);r=Math.max(r,l),t({loaded:l,total:s,progress:s?l/s:void 0,bytes:c,rate:u||void 0,estimated:u&&s?(s-l)/u:void 0,event:i,lengthComputable:null!=s,[n?"download":"upload"]:!0})},i)},tS=(t,n)=>{let i=null!=t;return[r=>n[0]({lengthComputable:i,total:t,loaded:r}),n[1]]},tT=t=>(...n)=>eE.asap(()=>t(...n)),tO=tc.hasStandardBrowserEnv?(a=new URL(tc.origin),s=tc.navigator&&/(msie|trident)/i.test(tc.navigator.userAgent),t=>(t=new URL(t,tc.origin),a.protocol===t.protocol&&a.host===t.host&&(s||a.port===t.port))):()=>!0,tF=tc.hasStandardBrowserEnv?{write(t,n,i,r,o,a,s){if("u"<typeof document)return;let l=[`${t}=${encodeURIComponent(n)}`];eE.isNumber(i)&&l.push(`expires=${new Date(i).toUTCString()}`),eE.isString(r)&&l.push(`path=${r}`),eE.isString(o)&&l.push(`domain=${o}`),!0===a&&l.push("secure"),eE.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(t){if("u"<typeof document)return null;let n=document.cookie.split(";");for(let i=0;i<n.length;i++){let r=n[i].replace(/^\s+/,""),o=r.indexOf("=");if(-1!==o&&r.slice(0,o)===t)return decodeURIComponent(r.slice(o+1))}return null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function tM(t){return"string"==typeof t&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function tI(t,n){return n?t.replace(/\/?\/$/,"")+"/"+n.replace(/^\/+/,""):t}function tR(t,n,i){let r=!tM(n);return t&&(r||!1===i)?tI(t,n):n}let tD=t=>t instanceof eq?{...t}:t;function tP(t,n){n=n||{};let i=Object.create(null);function r(t,n,i,r){return eE.isPlainObject(t)&&eE.isPlainObject(n)?eE.merge.call({caseless:r},t,n):eE.isPlainObject(n)?eE.merge({},n):eE.isArray(n)?n.slice():n}function o(t,n,i,o){return eE.isUndefined(n)?eE.isUndefined(t)?void 0:r(void 0,t,i,o):r(t,n,i,o)}function a(t,n){if(!eE.isUndefined(n))return r(void 0,n)}function s(t,n){return eE.isUndefined(n)?eE.isUndefined(t)?void 0:r(void 0,t):r(void 0,n)}function l(i,o,a){return eE.hasOwnProp(n,a)?r(i,o):eE.hasOwnProp(t,a)?r(void 0,i):void 0}Object.defineProperty(i,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});let c={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,allowedSocketPaths:s,responseEncoding:s,validateStatus:l,headers:(t,n,i)=>o(tD(t),tD(n),i,!0)};return eE.forEach(Object.keys({...t,...n}),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;let a=eE.hasOwnProp(c,r)?c[r]:o,s=a(eE.hasOwnProp(t,r)?t[r]:void 0,eE.hasOwnProp(n,r)?n[r]:void 0,r);eE.isUndefined(s)&&a!==l||(i[r]=s)}),i}let tL=["content-type","content-length"];function tN(t,n,i){"content-only"!==i?t.set(n):Object.entries(n).forEach(([n,i])=>{tL.includes(n.toLowerCase())&&t.set(n,i)})}let tz=t=>encodeURIComponent(t).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16))),tj=t=>{let n=tP({},t),i=t=>eE.hasOwnProp(n,t)?n[t]:void 0,r=i("data"),o=i("withXSRFToken"),a=i("xsrfHeaderName"),s=i("xsrfCookieName"),l=i("headers"),c=i("auth"),u=i("baseURL"),d=i("allowAbsoluteUrls"),h=i("url");if(n.headers=l=eq.from(l),n.url=e9(tR(u,h,d),t.params,t.paramsSerializer),c&&l.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?tz(c.password):""))),eE.isFormData(r)&&(tc.hasStandardBrowserEnv||tc.hasStandardBrowserWebWorkerEnv?l.setContentType(void 0):eE.isFunction(r.getHeaders)&&tN(l,r.getHeaders(),i("formDataHeaderPolicy"))),tc.hasStandardBrowserEnv&&(eE.isFunction(o)&&(o=o(n)),!0===o||null==o&&tO(n.url))){let t=a&&s&&tF.read(s);t&&l.set(a,t)}return n},tB="u">typeof XMLHttpRequest&&function(t){return new Promise(function(n,i){let r,o,a,s,l,c=tj(t),u=c.data,d=eq.from(c.headers).normalize(),{responseType:h,onUploadProgress:p,onDownloadProgress:f}=c;function m(){s&&s(),l&&l(),c.cancelToken&&c.cancelToken.unsubscribe(r),c.signal&&c.signal.removeEventListener("abort",r)}let g=new XMLHttpRequest;function v(){if(!g)return;let r=eq.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());tw(function(t){n(t),m()},function(t){i(t),m()},{data:h&&"text"!==h&&"json"!==h?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:t,request:g}),g=null}g.open(c.method.toUpperCase(),c.url,!0),g.timeout=c.timeout,"onloadend"in g?g.onloadend=v:g.onreadystatechange=function(){!g||4!==g.readyState||(0!==g.status||g.responseURL&&g.responseURL.startsWith("file:"))&&setTimeout(v)},g.onabort=function(){g&&(i(new eX("Request aborted",eX.ECONNABORTED,t,g)),m(),g=null)},g.onerror=function(n){let r=new eX(n&&n.message?n.message:"Network Error",eX.ERR_NETWORK,t,g);r.event=n||null,i(r),m(),g=null},g.ontimeout=function(){let n=c.timeout?"timeout of "+c.timeout+"ms exceeded":"timeout exceeded",r=c.transitional||tn;c.timeoutErrorMessage&&(n=c.timeoutErrorMessage),i(new eX(n,r.clarifyTimeoutError?eX.ETIMEDOUT:eX.ECONNABORTED,t,g)),m(),g=null},void 0===u&&d.setContentType(null),"setRequestHeader"in g&&eE.forEach(eP(d),function(t,n){g.setRequestHeader(n,t)}),eE.isUndefined(c.withCredentials)||(g.withCredentials=!!c.withCredentials),h&&"json"!==h&&(g.responseType=c.responseType),f&&([a,l]=tE(f,!0),g.addEventListener("progress",a)),p&&g.upload&&([o,s]=tE(p),g.upload.addEventListener("progress",o),g.upload.addEventListener("loadend",s)),(c.cancelToken||c.signal)&&(r=n=>{g&&(i(!n||n.type?new tx(null,t,g):n),g.abort(),m(),g=null)},c.cancelToken&&c.cancelToken.subscribe(r),c.signal&&(c.signal.aborted?r():c.signal.addEventListener("abort",r)));let b=tk(c.url);b&&!tc.protocols.includes(b)?i(new eX("Unsupported protocol "+b+":",eX.ERR_BAD_REQUEST,t)):g.send(u||null)})},t$=(t,n)=>{if(t=t?t.filter(Boolean):[],!n&&!t.length)return;let i=new AbortController,r=!1,o=function(t){if(!r){r=!0,s();let n=t instanceof Error?t:this.reason;i.abort(n instanceof eX?n:new tx(n instanceof Error?n.message:n))}},a=n&&setTimeout(()=>{a=null,o(new eX(`timeout of ${n}ms exceeded`,eX.ETIMEDOUT))},n),s=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(t=>{t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)}),t=null)};t.forEach(t=>t.addEventListener("abort",o));let{signal:l}=i;return l.unsubscribe=()=>eE.asap(s),l},tU=function*(t,n){let i,r=t.byteLength;if(!n||r<n)return void(yield t);let o=0;for(;o<r;)i=o+n,yield t.slice(o,i),o=i},tV=async function*(t,n){for await(let i of tH(t))yield*tU(i,n)},tH=async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);let n=t.getReader();try{for(;;){let{done:t,value:i}=await n.read();if(t)break;yield i}}finally{await n.cancel()}},tq=(t,n,i,r)=>{let o,a=tV(t,n),s=0,l=t=>{!o&&(o=!0,r&&r(t))};return new ReadableStream({async pull(t){try{let{done:n,value:r}=await a.next();if(n){l(),t.close();return}let o=r.byteLength;if(i){let t=s+=o;i(t)}t.enqueue(new Uint8Array(r))}catch(t){throw l(t),t}},cancel:t=>(l(t),a.return())},{highWaterMark:2})};function tW(t){if(!t||"string"!=typeof t||!t.startsWith("data:"))return 0;let n=t.indexOf(",");if(n<0)return 0;let i=t.slice(5,n),r=t.slice(n+1);if(/;base64/i.test(i)){let t=r.length,n=r.length;for(let i=0;i<n;i++)if(37===r.charCodeAt(i)&&i+2<n){let n=r.charCodeAt(i+1),o=r.charCodeAt(i+2);(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102)&&(o>=48&&o<=57||o>=65&&o<=70||o>=97&&o<=102)&&(t-=2,i+=2)}let i=0,o=n-1,a=t=>t>=2&&37===r.charCodeAt(t-2)&&51===r.charCodeAt(t-1)&&(68===r.charCodeAt(t)||100===r.charCodeAt(t));o>=0&&(61===r.charCodeAt(o)?(i++,o--):a(o)&&(i++,o-=3)),1===i&&o>=0&&(61===r.charCodeAt(o)?i++:a(o)&&i++);let s=3*Math.floor(t/4)-(i||0);return s>0?s:0}if("u">typeof Buffer&&"function"==typeof Buffer.byteLength)return Buffer.byteLength(r,"utf8");let o=0;for(let t=0,n=r.length;t<n;t++){let i=r.charCodeAt(t);if(i<128)o+=1;else if(i<2048)o+=2;else if(i>=55296&&i<=56319&&t+1<n){let n=r.charCodeAt(t+1);n>=56320&&n<=57343?(o+=4,t++):o+=3}else o+=3}return o}let tG=65536,{isFunction:tY}=eE,tZ=(t,...n)=>{try{return!!t(...n)}catch(t){return!1}},tX=t=>{let n,i=void 0!==eE.global&&null!==eE.global?eE.global:globalThis,{ReadableStream:r,TextEncoder:o}=i,{fetch:a,Request:s,Response:l}=t=eE.merge.call({skipUndefined:!0},{Request:i.Request,Response:i.Response},t),c=a?tY(a):"function"==typeof fetch,u=tY(s),d=tY(l);if(!c)return!1;let h=c&&tY(r),p=c&&("function"==typeof o?(n=new o,t=>n.encode(t)):async t=>new Uint8Array(await new s(t).arrayBuffer())),f=u&&h&&tZ(()=>{let t=!1,n=new s(tc.origin,{body:new r,method:"POST",get duplex(){return t=!0,"half"}}),i=n.headers.has("Content-Type");return null!=n.body&&n.body.cancel(),t&&!i}),m=d&&h&&tZ(()=>eE.isReadableStream(new l("").body)),g={stream:m&&(t=>t.body)};c&&(()=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{g[t]||(g[t]=(n,i)=>{let r=n&&n[t];if(r)return r.call(n);throw new eX(`Response type '${t}' is not supported`,eX.ERR_NOT_SUPPORT,i)})})})();let v=async t=>{if(null==t)return 0;if(eE.isBlob(t))return t.size;if(eE.isSpecCompliantForm(t)){let n=new s(tc.origin,{method:"POST",body:t});return(await n.arrayBuffer()).byteLength}return eE.isArrayBufferView(t)||eE.isArrayBuffer(t)?t.byteLength:(eE.isURLSearchParams(t)&&(t+=""),eE.isString(t))?(await p(t)).byteLength:void 0},b=async(t,n)=>{let i=eE.toFiniteNumber(t.getContentLength());return null==i?v(n):i};return async t=>{let n,{url:i,method:r,data:c,signal:d,cancelToken:h,timeout:p,onDownloadProgress:v,onUploadProgress:y,responseType:_,headers:x,withCredentials:w="same-origin",fetchOptions:k,maxContentLength:C,maxBodyLength:A}=tj(t),E=eE.isNumber(C)&&C>-1,S=eE.isNumber(A)&&A>-1,T=a||fetch;_=_?(_+"").toLowerCase():"text";let O=t$([d,h&&h.toAbortSignal()],p),F=null,M=O&&O.unsubscribe&&(()=>{O.unsubscribe()});try{if(E&&"string"==typeof i&&i.startsWith("data:")&&tW(i)>C)throw new eX("maxContentLength size of "+C+" exceeded",eX.ERR_BAD_RESPONSE,t,F);if(S&&"get"!==r&&"head"!==r){let n=await b(x,c);if("number"==typeof n&&isFinite(n)&&n>A)throw new eX("Request body larger than maxBodyLength limit",eX.ERR_BAD_REQUEST,t,F)}if(y&&f&&"get"!==r&&"head"!==r&&0!==(n=await b(x,c))){let t,r=new s(i,{method:"POST",body:c,duplex:"half"});if(eE.isFormData(c)&&(t=r.headers.get("content-type"))&&x.setContentType(t),r.body){let[t,i]=tS(n,tE(tT(y)));c=tq(r.body,tG,t,i)}}eE.isString(w)||(w=w?"include":"omit");let a=u&&"credentials"in s.prototype;if(eE.isFormData(c)){let t=x.getContentType();t&&/^multipart\/form-data/i.test(t)&&!/boundary=/i.test(t)&&x.delete("content-type")}x.set("User-Agent","axios/1.16.1",!1);let d={...k,signal:O,method:r.toUpperCase(),headers:eP(x.normalize()),body:c,duplex:"half",credentials:a?w:void 0};F=u&&new s(i,d);let h=await (u?T(F,k):T(i,d));if(E){let n=eE.toFiniteNumber(h.headers.get("content-length"));if(null!=n&&n>C)throw new eX("maxContentLength size of "+C+" exceeded",eX.ERR_BAD_RESPONSE,t,F)}let p=m&&("stream"===_||"response"===_);if(m&&h.body&&(v||E||p&&M)){let n={};["status","statusText","headers"].forEach(t=>{n[t]=h[t]});let i=eE.toFiniteNumber(h.headers.get("content-length")),[r,o]=v&&tS(i,tE(tT(v),!0))||[],a=0,s=n=>{if(E&&(a=n)>C)throw new eX("maxContentLength size of "+C+" exceeded",eX.ERR_BAD_RESPONSE,t,F);r&&r(n)};h=new l(tq(h.body,tG,s,()=>{o&&o(),M&&M()}),n)}_=_||"text";let I=await g[eE.findKey(g,_)||"text"](h,t);if(E&&!m&&!p){let n;if(null!=I&&("number"==typeof I.byteLength?n=I.byteLength:"number"==typeof I.size?n=I.size:"string"==typeof I&&(n="function"==typeof o?new o().encode(I).byteLength:I.length)),"number"==typeof n&&n>C)throw new eX("maxContentLength size of "+C+" exceeded",eX.ERR_BAD_RESPONSE,t,F)}return!p&&M&&M(),await new Promise((n,i)=>{tw(n,i,{data:I,headers:eq.from(h.headers),status:h.status,statusText:h.statusText,config:t,request:F})})}catch(n){if(M&&M(),O&&O.aborted&&O.reason instanceof eX){let i=O.reason;throw i.config=t,F&&(i.request=F),n!==i&&(i.cause=n),i}if(n&&"TypeError"===n.name&&/Load failed|fetch/i.test(n.message))throw Object.assign(new eX("Network Error",eX.ERR_NETWORK,t,F,n&&n.response),{cause:n.cause||n});throw eX.from(n,n&&n.code,t,F,n&&n.response)}}},tK=new Map,tJ=t=>{let n=t&&t.env||{},{fetch:i,Request:r,Response:o}=n,a=[r,o,i],s=a.length,l,c,u=tK;for(;s--;)l=a[s],void 0===(c=u.get(l))&&u.set(l,c=s?new Map:tX(n)),u=c;return c};tJ();let tQ={http:eK,xhr:tB,fetch:{get:tJ}};eE.forEach(tQ,(t,n)=>{if(t){try{Object.defineProperty(t,"name",{__proto__:null,value:n})}catch(t){}Object.defineProperty(t,"adapterName",{__proto__:null,value:n})}});let t0=t=>`- ${t}`,t1=t=>eE.isFunction(t)||null===t||!1===t,t2=function(t,n){let i,r,{length:o}=t=eE.isArray(t)?t:[t],a={};for(let s=0;s<o;s++){let o;if(r=i=t[s],!t1(i)&&void 0===(r=tQ[(o=String(i)).toLowerCase()]))throw new eX(`Unknown adapter '${o}'`);if(r&&(eE.isFunction(r)||(r=r.get(n))))break;a[o||"#"+s]=r}if(!r){let t=Object.entries(a).map(([t,n])=>`adapter ${t} `+(!1===n?"is not supported by the environment":"is not available in the build"));throw new eX("There is no suitable adapter to dispatch the request "+(o?t.length>1?"since :\n"+t.map(t0).join("\n"):" "+t0(t[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function t5(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new tx(null,t)}function t3(t){return t5(t),t.headers=eq.from(t.headers),t.data=tb.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),t2(t.adapter||tv.adapter,t)(t).then(function(n){t5(t),t.response=n;try{n.data=tb.call(t,t.transformResponse,n)}finally{delete t.response}return n.headers=eq.from(n.headers),n},function(n){if(!ty(n)&&(t5(t),n&&n.response)){t.response=n.response;try{n.response.data=tb.call(t,t.transformResponse,n.response)}finally{delete t.response}n.response.headers=eq.from(n.response.headers)}return Promise.reject(n)})}let t4={};["object","boolean","number","function","string","symbol"].forEach((t,n)=>{t4[t]=function(i){return typeof i===t||"a"+(n<1?"n ":" ")+t}});let t6={};t4.transitional=function(t,n,i){function r(t,n){return"[Axios v1.16.1] Transitional option '"+t+"'"+n+(i?". "+i:"")}return(i,o,a)=>{if(!1===t)throw new eX(r(o," has been removed"+(n?" in "+n:"")),eX.ERR_DEPRECATED);return n&&!t6[o]&&(t6[o]=!0,console.warn(r(o," has been deprecated since v"+n+" and will be removed in the near future"))),!t||t(i,o,a)}},t4.spelling=function(t){return(n,i)=>(console.warn(`${i} is likely a misspelling of ${t}`),!0)};let t8=function(t,n,i){if("object"!=typeof t)throw new eX("options must be an object",eX.ERR_BAD_OPTION_VALUE);let r=Object.keys(t),o=r.length;for(;o-- >0;){let a=r[o],s=Object.prototype.hasOwnProperty.call(n,a)?n[a]:void 0;if(s){let n=t[a],i=void 0===n||s(n,a,t);if(!0!==i)throw new eX("option "+a+" must be "+i,eX.ERR_BAD_OPTION_VALUE);continue}if(!0!==i)throw new eX("Unknown option "+a,eX.ERR_BAD_OPTION)}},t7=t4;class t9{constructor(t){this.defaults=t||{},this.interceptors={request:new tt,response:new tt}}async request(t,n){try{return await this._request(t,n)}catch(t){if(t instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=Error();let i=(()=>{if(!n.stack)return"";let t=n.stack.indexOf("\n");return -1===t?"":n.stack.slice(t+1)})();try{if(t.stack){if(i){let n=i.indexOf("\n"),r=-1===n?-1:i.indexOf("\n",n+1),o=-1===r?"":i.slice(r+1);String(t.stack).endsWith(o)||(t.stack+="\n"+i)}}else t.stack=i}catch(t){}}throw t}}_request(t,n){let i,r;"string"==typeof t?(n=n||{}).url=t:n=t||{};let{transitional:o,paramsSerializer:a,headers:s}=n=tP(this.defaults,n);void 0!==o&&t8(o,{silentJSONParsing:t7.transitional(t7.boolean),forcedJSONParsing:t7.transitional(t7.boolean),clarifyTimeoutError:t7.transitional(t7.boolean),legacyInterceptorReqResOrdering:t7.transitional(t7.boolean)},!1),null!=a&&(eE.isFunction(a)?n.paramsSerializer={serialize:a}:t8(a,{encode:t7.function,serialize:t7.function},!0)),void 0!==n.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),t8(n,{baseUrl:t7.spelling("baseURL"),withXsrfToken:t7.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=s&&eE.merge(s.common,s[n.method]);s&&eE.forEach(["delete","get","head","post","put","patch","query","common"],t=>{delete s[t]}),n.headers=eq.concat(l,s);let c=[],u=!0;this.interceptors.request.forEach(function(t){if("function"==typeof t.runWhen&&!1===t.runWhen(n))return;u=u&&t.synchronous;let i=n.transitional||tn;i&&i.legacyInterceptorReqResOrdering?c.unshift(t.fulfilled,t.rejected):c.push(t.fulfilled,t.rejected)});let d=[];this.interceptors.response.forEach(function(t){d.push(t.fulfilled,t.rejected)});let h=0;if(!u){let t=[t3.bind(this),void 0];for(t.unshift(...c),t.push(...d),r=t.length,i=Promise.resolve(n);h<r;)i=i.then(t[h++],t[h++]);return i}r=c.length;let p=n;for(;h<r;){let t=c[h++],n=c[h++];try{p=t(p)}catch(t){n.call(this,t);break}}try{i=t3.call(this,p)}catch(t){return Promise.reject(t)}for(h=0,r=d.length;h<r;)i=i.then(d[h++],d[h++]);return i}getUri(t){return e9(tR((t=tP(this.defaults,t)).baseURL,t.url,t.allowAbsoluteUrls),t.params,t.paramsSerializer)}}eE.forEach(["delete","get","head","options"],function(t){t9.prototype[t]=function(n,i){return this.request(tP(i||{},{method:t,url:n,data:(i||{}).data}))}}),eE.forEach(["post","put","patch","query"],function(t){function n(n){return function(i,r,o){return this.request(tP(o||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:r}))}}t9.prototype[t]=n(),"query"!==t&&(t9.prototype[t+"Form"]=n(!0))});let ne=t9;class nt{constructor(t){let n;if("function"!=typeof t)throw TypeError("executor must be a function.");this.promise=new Promise(function(t){n=t});const i=this;this.promise.then(t=>{if(!i._listeners)return;let n=i._listeners.length;for(;n-- >0;)i._listeners[n](t);i._listeners=null}),this.promise.then=t=>{let n,r=new Promise(t=>{i.subscribe(t),n=t}).then(t);return r.cancel=function(){i.unsubscribe(n)},r},t(function(t,r,o){i.reason||(i.reason=new tx(t,r,o),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let n=this._listeners.indexOf(t);-1!==n&&this._listeners.splice(n,1)}toAbortSignal(){let t=new AbortController,n=n=>{t.abort(n)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new nt(function(n){t=n}),cancel:t}}}let nn=nt;function ni(t){return function(n){return t.apply(null,n)}}function nr(t){return eE.isObject(t)&&!0===t.isAxiosError}let no={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(no).forEach(([t,n])=>{no[n]=t});let na=no;function ns(t){let n=new ne(t),i=p(ne.prototype.request,n);return eE.extend(i,ne.prototype,n,{allOwnKeys:!0}),eE.extend(i,n,null,{allOwnKeys:!0}),i.create=function(n){return ns(tP(t,n))},i}let nl=ns(tv);nl.Axios=ne,nl.CanceledError=tx,nl.CancelToken=nn,nl.isCancel=ty,nl.VERSION="1.16.1",nl.toFormData=e5,nl.AxiosError=eX,nl.Cancel=nl.CanceledError,nl.all=function(t){return Promise.all(t)},nl.spread=ni,nl.isAxiosError=nr,nl.mergeConfig=tP,nl.AxiosHeaders=eq,nl.formToJSON=t=>tp(eE.isHTMLForm(t)?new FormData(t):t),nl.getAdapter=t2,nl.HttpStatusCode=na,nl.default=nl;let nc=nl;function nu(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function nd(t,n,i){return n=nm(n),nv(t,nx()?Reflect.construct(n,i||[],nm(t).constructor):n.apply(t,i))}function nh(t,n){if(!(t instanceof n))throw TypeError("Cannot call a class as a function")}function np(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function nf(t,n,i){return n&&np(t.prototype,n),i&&np(t,i),t}function nm(t){return(nm=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ng(t,n){if("function"!=typeof n&&null!==n)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&nb(t,n)}function nv(t,n){return n&&("object"===n_(n)||"function"==typeof n)?n:nu(t)}function nb(t,n){return(nb=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function ny(t,n){return n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}}))}function n_(t){return t&&"u">typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}function nx(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(nx=function(){return!!t})()}function nw(){var t=ny(["map"]);return nw=function(){return t},t}function nk(){var t=ny(["map"]);return nk=function(){return t},t}function nC(){var t=ny(["map/deleteMap"]);return nC=function(){return t},t}function nA(){var t=ny(["map/getCustomMapInfo"]);return nA=function(){return t},t}function nE(){var t=ny(["map/tile/","/","/",""]);return nE=function(){return t},t}function nS(){var t=ny(["map/upload"]);return nS=function(){return t},t}function nT(){var t=ny(["alarm"]);return nT=function(){return t},t}function nO(){var t=ny(["alarm"]);return nO=function(){return t},t}function nF(){var t=ny(["alarm"]);return nF=function(){return t},t}function nM(){var t=ny(["alarm/assets"]);return nM=function(){return t},t}function nI(){var t=ny(["alarm/",""]);return nI=function(){return t},t}function nR(){var t=ny(["alarm/",""]);return nR=function(){return t},t}function nD(){var t=ny(["alarm/",""]);return nD=function(){return t},t}function nP(){var t=ny(["alarm/","/assets"]);return nP=function(){return t},t}function nL(){var t=ny(["asset"]);return nL=function(){return t},t}function nN(){var t=ny(["asset"]);return nN=function(){return t},t}function nz(){var t=ny(["asset/attributes"]);return nz=function(){return t},t}function nj(){var t=ny(["asset/attributes/timestamp"]);return nj=function(){return t},t}function nB(){var t=ny(["asset/count"]);return nB=function(){return t},t}function n$(){var t=ny(["asset/parent"]);return n$=function(){return t},t}function nU(){var t=ny(["asset/partial/",""]);return nU=function(){return t},t}function nV(){var t=ny(["asset/query"]);return nV=function(){return t},t}function nH(){var t=ny(["asset/tree"]);return nH=function(){return t},t}function nq(){var t=ny(["asset/user/current"]);return nq=function(){return t},t}function nW(){var t=ny(["asset/user/link"]);return nW=function(){return t},t}function nG(){var t=ny(["asset/user/link"]);return nG=function(){return t},t}function nY(){var t=ny(["asset/user/link/delete"]);return nY=function(){return t},t}function nZ(){var t=ny(["asset/user/link/","/",""]);return nZ=function(){return t},t}function nX(){var t=ny(["asset/user/link/","/","/",""]);return nX=function(){return t},t}function nK(){var t=ny(["asset/",""]);return nK=function(){return t},t}function nJ(){var t=ny(["asset/",""]);return nJ=function(){return t},t}function nQ(){var t=ny(["asset/","/attribute/",""]);return nQ=function(){return t},t}function n0(){var t=ny(["asset/","/attribute/","/",""]);return n0=function(){return t},t}function n1(){var t=ny(["asset/","/child"]);return n1=function(){return t},t}function n2(){var t=ny(["provisioning"]);return n2=function(){return t},t}function n5(){var t=ny(["provisioning"]);return n5=function(){return t},t}function n3(){var t=ny(["provisioning/",""]);return n3=function(){return t},t}function n4(){var t=ny(["provisioning/",""]);return n4=function(){return t},t}function n6(){var t=ny(["gateway/tunnel"]);return n6=function(){return t},t}function n8(){var t=ny(["gateway/tunnel"]);return n8=function(){return t},t}function n7(){var t=ny(["gateway/tunnel/",""]);return n7=function(){return t},t}function n9(){var t=ny(["gateway/tunnel/","/",""]);return n9=function(){return t},t}function ie(){var t=ny(["gateway/tunnel/","/","/","/",""]);return ie=function(){return t},t}function it(){var t=ny(["console/register"]);return it=function(){return t},t}function ii(){var t=ny(["service"]);return ii=function(){return t},t}function ir(){var t=ny(["service"]);return ir=function(){return t},t}function io(){var t=ny(["service/global"]);return io=function(){return t},t}function ia(){var t=ny(["service/global"]);return ia=function(){return t},t}function is(){var t=ny(["service/","/",""]);return is=function(){return t},t}function il(){var t=ny(["service/","/",""]);return il=function(){return t},t}function ic(){var t=ny(["service/","/",""]);return ic=function(){return t},t}function iu(){var t=ny(["agent/assetDiscovery/",""]);return iu=function(){return t},t}function id(){var t=ny(["agent/assetImport/",""]);return id=function(){return t},t}function ih(){var t=ny(["agent/instanceDiscovery/",""]);return ih=function(){return t},t}function ip(){var t=ny(["user/locale"]);return ip=function(){return t},t}function im(){var t=ny(["user/query"]);return im=function(){return t},t}function ig(){var t=ny(["user/request-password-reset"]);return ig=function(){return t},t}function iv(){var t=ny(["user/reset-password"]);return iv=function(){return t},t}function ib(){var t=ny(["user/update"]);return ib=function(){return t},t}function iy(){var t=ny(["user/user"]);return iy=function(){return t},t}function i_(){var t=ny(["user/userRealmRoles"]);return i_=function(){return t},t}function ix(){var t=ny(["user/userRoles/",""]);return ix=function(){return t},t}function iw(){var t=ny(["user/","/disconnect/",""]);return iw=function(){return t},t}function ik(){var t=ny(["user/","/request-password-reset/",""]);return ik=function(){return t},t}function iC(){var t=ny(["user/","/reset-password/",""]);return iC=function(){return t},t}function iA(){var t=ny(["user/","/reset-secret/",""]);return iA=function(){return t},t}function iE(){var t=ny(["user/","/roles"]);return iE=function(){return t},t}function iS(){var t=ny(["user/","/userRealmRoles/",""]);return iS=function(){return t},t}function iT(){var t=ny(["user/","/userRealmRoles/",""]);return iT=function(){return t},t}function iO(){var t=ny(["user/","/userRoles/","/",""]);return iO=function(){return t},t}function iF(){var t=ny(["user/","/userRoles/","/",""]);return iF=function(){return t},t}function iM(){var t=ny(["user/","/userSessions/",""]);return iM=function(){return t},t}function iI(){var t=ny(["user/","/users"]);return iI=function(){return t},t}function iR(){var t=ny(["user/","/users"]);return iR=function(){return t},t}function iD(){var t=ny(["user/","/users/",""]);return iD=function(){return t},t}function iP(){var t=ny(["user/","/","/roles"]);return iP=function(){return t},t}function iL(){var t=ny(["user/","/","/roles"]);return iL=function(){return t},t}function iN(){var t=ny(["user/","/",""]);return iN=function(){return t},t}function iz(){var t=ny(["configuration/manager"]);return iz=function(){return t},t}function ij(){var t=ny(["configuration/manager"]);return ij=function(){return t},t}function iB(){var t=ny(["configuration/manager/file"]);return iB=function(){return t},t}function i$(){var t=ny(["configuration/manager/image/",""]);return i$=function(){return t},t}function iU(){var t=ny(["syslog/config"]);return iU=function(){return t},t}function iV(){var t=ny(["syslog/config"]);return iV=function(){return t},t}function iH(){var t=ny(["syslog/event"]);return iH=function(){return t},t}function iq(){var t=ny(["syslog/event"]);return iq=function(){return t},t}function iW(){var t=ny(["dashboard"]);return iW=function(){return t},t}function iG(){var t=ny(["dashboard"]);return iG=function(){return t},t}function iY(){var t=ny(["dashboard/all/",""]);return iY=function(){return t},t}function iZ(){var t=ny(["dashboard/query"]);return iZ=function(){return t},t}function iX(){var t=ny(["dashboard/","/",""]);return iX=function(){return t},t}function iK(){var t=ny(["dashboard/","/",""]);return iK=function(){return t},t}function iJ(){var t=ny(["gateway/connection"]);return iJ=function(){return t},t}function iQ(){var t=ny(["gateway/connection"]);return iQ=function(){return t},t}function i0(){var t=ny(["gateway/connection/",""]);return i0=function(){return t},t}function i1(){var t=ny(["gateway/connection/",""]);return i1=function(){return t},t}function i2(){var t=ny(["gateway/connection/",""]);return i2=function(){return t},t}function i5(){var t=ny(["gateway/status/",""]);return i5=function(){return t},t}function i3(){var t=ny(["model/assetDescriptors"]);return i3=function(){return t},t}function i4(){var t=ny(["model/assetInfo/",""]);return i4=function(){return t},t}function i6(){var t=ny(["model/assetInfos"]);return i6=function(){return t},t}function i8(){var t=ny(["model/getValueDescriptorSchema"]);return i8=function(){return t},t}function i7(){var t=ny(["model/metaItemDescriptors"]);return i7=function(){return t},t}function i9(){var t=ny(["model/valueDescriptors"]);return i9=function(){return t},t}function re(){var t=ny(["realm"]);return re=function(){return t},t}function rt(){var t=ny(["realm"]);return rt=function(){return t},t}function rn(){var t=ny(["realm/accessible"]);return rn=function(){return t},t}function ri(){var t=ny(["realm/",""]);return ri=function(){return t},t}function rr(){var t=ny(["realm/",""]);return rr=function(){return t},t}function ro(){var t=ny(["realm/",""]);return ro=function(){return t},t}function ra(){var t=ny(["rules"]);return ra=function(){return t},t}function rs(){var t=ny(["rules"]);return rs=function(){return t},t}function rl(){var t=ny(["rules/asset"]);return rl=function(){return t},t}function rc(){var t=ny(["rules/asset/for/",""]);return rc=function(){return t},t}function ru(){var t=ny(["rules/asset/",""]);return ru=function(){return t},t}function rd(){var t=ny(["rules/asset/",""]);return rd=function(){return t},t}function rh(){var t=ny(["rules/asset/",""]);return rh=function(){return t},t}function rp(){var t=ny(["rules/geofences/",""]);return rp=function(){return t},t}function rf(){var t=ny(["rules/info/asset/",""]);return rf=function(){return t},t}function rm(){var t=ny(["rules/info/global"]);return rm=function(){return t},t}function rg(){var t=ny(["rules/info/realm/",""]);return rg=function(){return t},t}function rv(){var t=ny(["rules/realm"]);return rv=function(){return t},t}function rb(){var t=ny(["rules/realm/for/",""]);return rb=function(){return t},t}function ry(){var t=ny(["rules/realm/",""]);return ry=function(){return t},t}function r_(){var t=ny(["rules/realm/",""]);return r_=function(){return t},t}function rx(){var t=ny(["rules/realm/",""]);return rx=function(){return t},t}function rw(){var t=ny(["rules/",""]);return rw=function(){return t},t}function rk(){var t=ny(["rules/",""]);return rk=function(){return t},t}function rC(){var t=ny(["rules/",""]);return rC=function(){return t},t}function rA(){var t=ny(["asset/predicted/","/",""]);return rA=function(){return t},t}function rE(){var t=ny(["asset/predicted/","/",""]);return rE=function(){return t},t}function rS(){var t=ny(["apps"]);return rS=function(){return t},t}function rT(){var t=ny(["apps/consoleConfig"]);return rT=function(){return t},t}function rO(){var t=ny(["apps/info"]);return rO=function(){return t},t}function rF(){var t=ny(["health"]);return rF=function(){return t},t}function rM(){var t=ny(["info"]);return rM=function(){return t},t}function rI(){var t=ny(["notification"]);return rI=function(){return t},t}function rR(){var t=ny(["notification"]);return rR=function(){return t},t}function rD(){var t=ny(["notification/alert"]);return rD=function(){return t},t}function rP(){var t=ny(["notification/",""]);return rP=function(){return t},t}function rL(){var t=ny(["notification/","/acknowledged"]);return rL=function(){return t},t}function rN(){var t=ny(["notification/","/delivered"]);return rN=function(){return t},t}function rz(){var t=ny(["asset/datapoint/export"]);return rz=function(){return t},t}function rj(){var t=ny(["asset/datapoint/periods"]);return rj=function(){return t},t}function rB(){var t=ny(["asset/datapoint/","/",""]);return rB=function(){return t},t}function r$(){var t=ny(["flow"]);return r$=function(){return t},t}function rU(){var t=ny(["flow/",""]);return rU=function(){return t},t}function rV(){var t=ny(["flow/",""]);return rV=function(){return t},t}var rH=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"getSettings",value:function(t){return this.httpClient.request({method:"GET",url:on(nw()),options:t})}},{key:"saveSettings",value:function(t,n){return this.httpClient.request({method:"PUT",url:on(nk()),data:t,options:n})}},{key:"deleteMap",value:function(t){return this.httpClient.request({method:"DELETE",url:on(nC()),options:t})}},{key:"getCustomMapInfo",value:function(t){return this.httpClient.request({method:"GET",url:on(nA()),options:t})}},{key:"getTile",value:function(t,n,i,r){return this.httpClient.request({method:"GET",url:on(nE(),t,n,i),options:r})}},{key:"uploadMap",value:function(t,n){return this.httpClient.request({method:"POST",url:on(nS()),queryParams:t,options:n})}}]),t}(),rq=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"createAlarm",value:function(t,n,i){return this.httpClient.request({method:"POST",url:on(nT()),queryParams:n,data:t,options:i})}},{key:"getAlarms",value:function(t,n){return this.httpClient.request({method:"GET",url:on(nO()),queryParams:t,options:n})}},{key:"removeAlarms",value:function(t,n){return this.httpClient.request({method:"DELETE",url:on(nF()),data:t,options:n})}},{key:"setAssetLinks",value:function(t,n){return this.httpClient.request({method:"PUT",url:on(nM()),data:t,options:n})}},{key:"getAlarm",value:function(t,n){return this.httpClient.request({method:"GET",url:on(nI(),t),options:n})}},{key:"removeAlarm",value:function(t,n){return this.httpClient.request({method:"DELETE",url:on(nR(),t),options:n})}},{key:"updateAlarm",value:function(t,n,i){return this.httpClient.request({method:"PUT",url:on(nD(),t),data:n,options:i})}},{key:"getAssetLinks",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(nP(),t),queryParams:n,options:i})}}]),t}(),rW=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"create",value:function(t,n){return this.httpClient.request({method:"POST",url:on(nL()),data:t,options:n})}},{key:"delete",value:function(t,n){return this.httpClient.request({method:"DELETE",url:on(nN()),queryParams:t,options:n})}},{key:"writeAttributeValues",value:function(t,n){return this.httpClient.request({method:"PUT",url:on(nz()),data:t,options:n})}},{key:"writeAttributeEvents",value:function(t,n){return this.httpClient.request({method:"PUT",url:on(nj()),data:t,options:n})}},{key:"queryCount",value:function(t,n){return this.httpClient.request({method:"POST",url:on(nB()),data:t,options:n})}},{key:"updateNoneParent",value:function(t,n){return this.httpClient.request({method:"DELETE",url:on(n$()),queryParams:t,options:n})}},{key:"getPartial",value:function(t,n){return this.httpClient.request({method:"GET",url:on(nU(),t),options:n})}},{key:"queryAssets",value:function(t,n){return this.httpClient.request({method:"POST",url:on(nV()),data:t,options:n})}},{key:"queryAssetTree",value:function(t,n){return this.httpClient.request({method:"POST",url:on(nH()),data:t,options:n})}},{key:"getCurrentUserAssets",value:function(t){return this.httpClient.request({method:"GET",url:on(nq()),options:t})}},{key:"createUserAssetLinks",value:function(t,n){return this.httpClient.request({method:"POST",url:on(nW()),data:t,options:n})}},{key:"getUserAssetLinks",value:function(t,n){return this.httpClient.request({method:"GET",url:on(nG()),queryParams:t,options:n})}},{key:"deleteUserAssetLinks",value:function(t,n){return this.httpClient.request({method:"POST",url:on(nY()),data:t,options:n})}},{key:"deleteAllUserAssetLinks",value:function(t,n,i){return this.httpClient.request({method:"DELETE",url:on(nZ(),t,n),options:i})}},{key:"deleteUserAssetLink",value:function(t,n,i,r){return this.httpClient.request({method:"DELETE",url:on(nX(),t,n,i),options:r})}},{key:"get",value:function(t,n){return this.httpClient.request({method:"GET",url:on(nK(),t),options:n})}},{key:"update",value:function(t,n,i){return this.httpClient.request({method:"PUT",url:on(nJ(),t),data:n,options:i})}},{key:"writeAttributeValue$PUT$asset_assetId_attribute_attributeName",value:function(t,n,i,r){return this.httpClient.request({method:"PUT",url:on(nQ(),t,n),data:i,options:r})}},{key:"writeAttributeValue$PUT$asset_assetId_attribute_attributeName_timestamp",value:function(t,n,i,r,o){return this.httpClient.request({method:"PUT",url:on(n0(),t,n,i),data:r,options:o})}},{key:"updateParent",value:function(t,n,i){return this.httpClient.request({method:"PUT",url:on(n1(),t),queryParams:n,options:i})}}]),t}(),rG=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"createProvisioningConfig",value:function(t,n){return this.httpClient.request({method:"POST",url:on(n2()),data:t,options:n})}},{key:"getProvisioningConfigs",value:function(t){return this.httpClient.request({method:"GET",url:on(n5()),options:t})}},{key:"deleteProvisioningConfig",value:function(t,n){return this.httpClient.request({method:"DELETE",url:on(n3(),t),options:n})}},{key:"updateProvisioningConfig",value:function(t,n,i){return this.httpClient.request({method:"PUT",url:on(n4(),t),data:n,options:i})}}]),t}(),rY=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"startTunnel",value:function(t,n){return this.httpClient.request({method:"POST",url:on(n6()),data:t,options:n})}},{key:"stopTunnel",value:function(t,n){return this.httpClient.request({method:"DELETE",url:on(n8()),data:t,options:n})}},{key:"getAllActiveTunnelInfos",value:function(t,n){return this.httpClient.request({method:"GET",url:on(n7(),t),options:n})}},{key:"getGatewayActiveTunnelInfos",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(n9(),t,n),options:i})}},{key:"getActiveTunnelInfo",value:function(t,n,i,r,o){return this.httpClient.request({method:"GET",url:on(ie(),t,n,i,r),options:o})}}]),t}(),rZ=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"register",value:function(t,n){return this.httpClient.request({method:"POST",url:on(it()),data:t,options:n})}}]),t}(),rX=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"getServices",value:function(t,n){return this.httpClient.request({method:"GET",url:on(ii()),queryParams:t,options:n})}},{key:"registerService",value:function(t,n){return this.httpClient.request({method:"POST",url:on(ir()),data:t,options:n})}},{key:"getGlobalServices",value:function(t){return this.httpClient.request({method:"GET",url:on(io()),options:t})}},{key:"registerGlobalService",value:function(t,n){return this.httpClient.request({method:"POST",url:on(ia()),data:t,options:n})}},{key:"deregisterService",value:function(t,n,i){return this.httpClient.request({method:"DELETE",url:on(is(),t,n),options:i})}},{key:"getService",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(il(),t,n),options:i})}},{key:"heartbeat",value:function(t,n,i){return this.httpClient.request({method:"PUT",url:on(ic(),t,n),options:i})}}]),t}(),rK=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"doProtocolAssetDiscovery",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(iu(),t),queryParams:n,options:i})}},{key:"doProtocolAssetImport",value:function(t,n,i,r){return this.httpClient.request({method:"POST",url:on(id(),t),queryParams:i,data:n,options:r})}},{key:"doProtocolInstanceDiscovery",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(ih(),t),queryParams:n,options:i})}}]),t}(),rJ=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"updateCurrentUserLocale",value:function(t,n){return this.httpClient.request({method:"PUT",url:on(ip()),data:t,options:n})}},{key:"query",value:function(t,n){return this.httpClient.request({method:"POST",url:on(im()),data:t,options:n})}},{key:"requestPasswordResetCurrent",value:function(t){return this.httpClient.request({method:"PUT",url:on(ig()),options:t})}},{key:"updatePasswordCurrent",value:function(t,n){return this.httpClient.request({method:"PUT",url:on(iv()),data:t,options:n})}},{key:"updateCurrent",value:function(t,n){return this.httpClient.request({method:"PUT",url:on(ib()),data:t,options:n})}},{key:"getCurrent",value:function(t){return this.httpClient.request({method:"GET",url:on(iy()),options:t})}},{key:"getCurrentUserRealmRoles",value:function(t){return this.httpClient.request({method:"GET",url:on(i_()),options:t})}},{key:"getCurrentUserClientRoles",value:function(t,n){return this.httpClient.request({method:"GET",url:on(ix(),t),options:n})}},{key:"disconnectUserSession",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(iw(),t,n),options:i})}},{key:"requestPasswordReset",value:function(t,n,i){return this.httpClient.request({method:"PUT",url:on(ik(),t,n),options:i})}},{key:"updatePassword",value:function(t,n,i,r){return this.httpClient.request({method:"PUT",url:on(iC(),t,n),data:i,options:r})}},{key:"resetSecret",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(iA(),t,n),options:i})}},{key:"updateRoles",value:function(t,n,i){return this.httpClient.request({method:"PUT",url:on(iE(),t),data:n,options:i})}},{key:"getUserRealmRoles",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(iS(),t,n),options:i})}},{key:"updateUserRealmRoles",value:function(t,n,i,r){return this.httpClient.request({method:"PUT",url:on(iT(),t,n),data:i,options:r})}},{key:"getUserClientRoles",value:function(t,n,i,r){return this.httpClient.request({method:"GET",url:on(iO(),t,n,i),options:r})}},{key:"updateUserClientRoles",value:function(t,n,i,r,o){return this.httpClient.request({method:"PUT",url:on(iF(),t,n,i),data:r,options:o})}},{key:"getUserSessions",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(iM(),t,n),options:i})}},{key:"create",value:function(t,n,i){return this.httpClient.request({method:"POST",url:on(iI(),t),data:n,options:i})}},{key:"update",value:function(t,n,i){return this.httpClient.request({method:"PUT",url:on(iR(),t),data:n,options:i})}},{key:"delete",value:function(t,n,i){return this.httpClient.request({method:"DELETE",url:on(iD(),t,n),options:i})}},{key:"getClientRoles",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(iP(),t,n),options:i})}},{key:"updateClientRoles",value:function(t,n,i,r){return this.httpClient.request({method:"PUT",url:on(iL(),t,n),data:i,options:r})}},{key:"get",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(iN(),t,n),options:i})}}]),t}(),rQ=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"getManagerConfig",value:function(t){return this.httpClient.request({method:"GET",url:on(iz()),options:t})}},{key:"update",value:function(t,n){return this.httpClient.request({method:"PUT",url:on(ij()),data:t,options:n})}},{key:"fileUpload",value:function(t,n,i){return this.httpClient.request({method:"POST",url:on(iB()),queryParams:n,data:t,options:i})}},{key:"getManagerConfigImage",value:function(t,n){return this.httpClient.request({method:"GET",url:on(i$(),t),options:n})}}]),t}(),r0=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"getConfig",value:function(t){return this.httpClient.request({method:"GET",url:on(iU()),options:t})}},{key:"updateConfig",value:function(t,n){return this.httpClient.request({method:"PUT",url:on(iV()),data:t,options:n})}},{key:"clearEvents",value:function(t){return this.httpClient.request({method:"DELETE",url:on(iH()),options:t})}},{key:"getEvents",value:function(t,n){return this.httpClient.request({method:"GET",url:on(iq()),queryParams:t,options:n})}}]),t}(),r1=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"create",value:function(t,n){return this.httpClient.request({method:"POST",url:on(iW()),data:t,options:n})}},{key:"update",value:function(t,n){return this.httpClient.request({method:"PUT",url:on(iG()),data:t,options:n})}},{key:"getAllRealmDashboards",value:function(t,n){return this.httpClient.request({method:"GET",url:on(iY(),t),options:n})}},{key:"query",value:function(t,n){return this.httpClient.request({method:"POST",url:on(iZ()),data:t,options:n})}},{key:"delete",value:function(t,n,i){return this.httpClient.request({method:"DELETE",url:on(iX(),t,n),options:i})}},{key:"get",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(iK(),t,n),options:i})}}]),t}(),r2=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"deleteConnections",value:function(t,n){return this.httpClient.request({method:"DELETE",url:on(iJ()),queryParams:t,options:n})}},{key:"getConnections",value:function(t){return this.httpClient.request({method:"GET",url:on(iQ()),options:t})}},{key:"deleteConnection",value:function(t,n){return this.httpClient.request({method:"DELETE",url:on(i0(),t),options:n})}},{key:"getConnection",value:function(t,n){return this.httpClient.request({method:"GET",url:on(i1(),t),options:n})}},{key:"setConnection",value:function(t,n,i){return this.httpClient.request({method:"PUT",url:on(i2(),t),data:n,options:i})}},{key:"getConnectionStatus",value:function(t,n){return this.httpClient.request({method:"GET",url:on(i5(),t),options:n})}}]),t}(),r5=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"getAssetDescriptors",value:function(t,n){return this.httpClient.request({method:"GET",url:on(i3()),queryParams:t,options:n})}},{key:"getAssetInfo",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(i4(),t),queryParams:n,options:i})}},{key:"getAssetInfos",value:function(t,n){return this.httpClient.request({method:"GET",url:on(i6()),queryParams:t,options:n})}},{key:"getValueDescriptorSchema",value:function(t,n){return this.httpClient.request({method:"GET",url:on(i8()),queryParams:t,options:n})}},{key:"getMetaItemDescriptors",value:function(t,n){return this.httpClient.request({method:"GET",url:on(i7()),queryParams:t,options:n})}},{key:"getValueDescriptors",value:function(t,n){return this.httpClient.request({method:"GET",url:on(i9()),queryParams:t,options:n})}}]),t}(),r3=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"create",value:function(t,n){return this.httpClient.request({method:"POST",url:on(re()),data:t,options:n})}},{key:"getAll",value:function(t){return this.httpClient.request({method:"GET",url:on(rt()),options:t})}},{key:"getAccessible",value:function(t){return this.httpClient.request({method:"GET",url:on(rn()),options:t})}},{key:"delete",value:function(t,n){return this.httpClient.request({method:"DELETE",url:on(ri(),t),options:n})}},{key:"get",value:function(t,n){return this.httpClient.request({method:"GET",url:on(rr(),t),options:n})}},{key:"update",value:function(t,n,i){return this.httpClient.request({method:"PUT",url:on(ro(),t),data:n,options:i})}}]),t}(),r4=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"createGlobalRuleset",value:function(t,n){return this.httpClient.request({method:"POST",url:on(ra()),data:t,options:n})}},{key:"getGlobalRulesets",value:function(t,n){return this.httpClient.request({method:"GET",url:on(rs()),queryParams:t,options:n})}},{key:"createAssetRuleset",value:function(t,n){return this.httpClient.request({method:"POST",url:on(rl()),data:t,options:n})}},{key:"getAssetRulesets",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(rc(),t),queryParams:n,options:i})}},{key:"deleteAssetRuleset",value:function(t,n){return this.httpClient.request({method:"DELETE",url:on(ru(),t),options:n})}},{key:"getAssetRuleset",value:function(t,n){return this.httpClient.request({method:"GET",url:on(rd(),t),options:n})}},{key:"updateAssetRuleset",value:function(t,n,i){return this.httpClient.request({method:"PUT",url:on(rh(),t),data:n,options:i})}},{key:"getAssetGeofences",value:function(t,n){return this.httpClient.request({method:"GET",url:on(rp(),t),options:n})}},{key:"getAssetEngineInfo",value:function(t,n){return this.httpClient.request({method:"GET",url:on(rf(),t),options:n})}},{key:"getGlobalEngineInfo",value:function(t){return this.httpClient.request({method:"GET",url:on(rm()),options:t})}},{key:"getRealmEngineInfo",value:function(t,n){return this.httpClient.request({method:"GET",url:on(rg(),t),options:n})}},{key:"createRealmRuleset",value:function(t,n){return this.httpClient.request({method:"POST",url:on(rv()),data:t,options:n})}},{key:"getRealmRulesets",value:function(t,n,i){return this.httpClient.request({method:"GET",url:on(rb(),t),queryParams:n,options:i})}},{key:"deleteRealmRuleset",value:function(t,n){return this.httpClient.request({method:"DELETE",url:on(ry(),t),options:n})}},{key:"getRealmRuleset",value:function(t,n){return this.httpClient.request({method:"GET",url:on(r_(),t),options:n})}},{key:"updateRealmRuleset",value:function(t,n,i){return this.httpClient.request({method:"PUT",url:on(rx(),t),data:n,options:i})}},{key:"deleteGlobalRuleset",value:function(t,n){return this.httpClient.request({method:"DELETE",url:on(rw(),t),options:n})}},{key:"getGlobalRuleset",value:function(t,n){return this.httpClient.request({method:"GET",url:on(rk(),t),options:n})}},{key:"updateGlobalRuleset",value:function(t,n,i){return this.httpClient.request({method:"PUT",url:on(rC(),t),data:n,options:i})}}]),t}(),r6=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"getPredictedDatapoints",value:function(t,n,i,r){return this.httpClient.request({method:"POST",url:on(rA(),t,n),data:i,options:r})}},{key:"writePredictedDatapoints",value:function(t,n,i,r){return this.httpClient.request({method:"PUT",url:on(rE(),t,n),data:i,options:r})}}]),t}(),r8=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"getApps",value:function(t){return this.httpClient.request({method:"GET",url:on(rS()),options:t})}},{key:"getConsoleConfig",value:function(t){return this.httpClient.request({method:"GET",url:on(rT()),options:t})}},{key:"getAppInfos",value:function(t){return this.httpClient.request({method:"GET",url:on(rO()),options:t})}}]),t}(),r7=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"getHealthStatus",value:function(t){return this.httpClient.request({method:"GET",url:on(rF()),options:t})}},{key:"getInfo",value:function(t){return this.httpClient.request({method:"GET",url:on(rM()),options:t})}}]),t}(),r9=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"getNotifications",value:function(t,n){return this.httpClient.request({method:"GET",url:on(rI()),queryParams:t,options:n})}},{key:"removeNotifications",value:function(t,n){return this.httpClient.request({method:"DELETE",url:on(rR()),queryParams:t,options:n})}},{key:"sendNotification",value:function(t,n){return this.httpClient.request({method:"POST",url:on(rD()),data:t,options:n})}},{key:"removeNotification",value:function(t,n){return this.httpClient.request({method:"DELETE",url:on(rP(),t),options:n})}},{key:"notificationAcknowledged",value:function(t,n,i,r){return this.httpClient.request({method:"PUT",url:on(rL(),t),queryParams:i,data:n,options:r})}},{key:"notificationDelivered",value:function(t,n,i){return this.httpClient.request({method:"PUT",url:on(rN(),t),queryParams:n,options:i})}}]),t}(),oe=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"getDatapointExport",value:function(t,n){return this.httpClient.request({method:"GET",url:on(rz()),queryParams:t,options:n})}},{key:"getDatapointPeriod",value:function(t,n){return this.httpClient.request({method:"GET",url:on(rj()),queryParams:t,options:n})}},{key:"getDatapoints",value:function(t,n,i,r){return this.httpClient.request({method:"POST",url:on(rB(),t,n),data:i,options:r})}}]),t}(),ot=function(){function t(n){nh(this,t),this.httpClient=n}return nf(t,[{key:"getAllNodeDefinitions",value:function(t){return this.httpClient.request({method:"GET",url:on(r$()),options:t})}},{key:"getNodeDefinition",value:function(t,n){return this.httpClient.request({method:"GET",url:on(rU(),t),options:n})}},{key:"getAllNodeDefinitionsByType",value:function(t,n){return this.httpClient.request({method:"GET",url:on(rV(),t),options:n})}}]),t}();function on(t){for(var n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];for(var o="",a=0;a<i.length;a++)o+=t[a],o+=encodeURIComponent(i[a]);return o+t[t.length-1]}var oi=function(){function t(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();nh(this,t),this._mapResource=new oo(n,i),this._alarmResource=new oa(n,i),this._assetResource=new os(n,i),this._provisioningResource=new ol(n,i),this._gatewayServiceResource=new oc(n,i),this._consoleResource=new ou(n,i),this._externalServiceResource=new od(n,i),this._agentResource=new oh(n,i),this._userResource=new op(n,i),this._configurationResource=new of(n,i),this._syslogResource=new om(n,i),this._dashboardResource=new og(n,i),this._gatewayClientResource=new ov(n,i),this._assetModelResource=new ob(n,i),this._realmResource=new oy(n,i),this._rulesResource=new o_(n,i),this._assetPredictedDatapointResource=new ox(n,i),this._appResource=new ow(n,i),this._statusResource=new ok(n,i),this._notificationResource=new oC(n,i),this._assetDatapointResource=new oA(n,i),this._flowResource=new oE(n,i),this._assetResource=new os(n,i)}return nf(t,[{key:"MapResource",get:function(){return this._mapResource}},{key:"AlarmResource",get:function(){return this._alarmResource}},{key:"AssetResource",get:function(){return this._assetResource}},{key:"ProvisioningResource",get:function(){return this._provisioningResource}},{key:"GatewayServiceResource",get:function(){return this._gatewayServiceResource}},{key:"ConsoleResource",get:function(){return this._consoleResource}},{key:"ExternalServiceResource",get:function(){return this._externalServiceResource}},{key:"AgentResource",get:function(){return this._agentResource}},{key:"UserResource",get:function(){return this._userResource}},{key:"ConfigurationResource",get:function(){return this._configurationResource}},{key:"SyslogResource",get:function(){return this._syslogResource}},{key:"DashboardResource",get:function(){return this._dashboardResource}},{key:"GatewayClientResource",get:function(){return this._gatewayClientResource}},{key:"AssetModelResource",get:function(){return this._assetModelResource}},{key:"RealmResource",get:function(){return this._realmResource}},{key:"RulesResource",get:function(){return this._rulesResource}},{key:"AssetPredictedDatapointResource",get:function(){return this._assetPredictedDatapointResource}},{key:"AppResource",get:function(){return this._appResource}},{key:"StatusResource",get:function(){return this._statusResource}},{key:"NotificationResource",get:function(){return this._notificationResource}},{key:"AssetDatapointResource",get:function(){return this._assetDatapointResource}},{key:"FlowResource",get:function(){return this._flowResource}}]),t}(),or=function(){function t(n){nh(this,t),this.axios=n}return nf(t,[{key:"request",value:function(t){function n(t,n){if(void 0!=n)for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i]);return t}var i={};i.method=t.method,i.url=t.url,i.params=t.queryParams,i.data=t.data,n(i,t.options);var r=t.copyFn;return this.axios.request(i).then(function(t){return r&&t.data&&(t.originalData=t.data,t.data=r(t.data)),t})}}]),t}(),oo=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(rH),oa=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(rq),os=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(rW),ol=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(rG),oc=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(rY),ou=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(rZ),od=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(rX),oh=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(rK),op=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(rJ),of=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(rQ),om=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(r0),og=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(r1),ov=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(r2),ob=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(r5),oy=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(r3),o_=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(r4),ox=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(r6),ow=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(r8),ok=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(r7),oC=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(r9),oA=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(oe),oE=function(t){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc.create();return nh(this,n),i.defaults.baseURL=t,nd(this,n,[new or(i)])}return ng(n,t),n}(ot),oS=i(88183),oT=i.n(oS);function oO(t,n){if(!(t instanceof n))throw TypeError("Cannot call a class as a function")}function oF(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function oM(t,n,i){return n&&oF(t.prototype,n),i&&oF(t,i),t}var oI=nc.isAxiosError;let oR=new(function(){function t(){oO(this,t),this._axiosInstance=nc.create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use(function(t){return t.paramsSerializer=function(t){return oT().stringify(t,{arrayFormat:"repeat"})},t})}return oM(t,[{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(t){this._axiosInstance.defaults.timeout=t}},{key:"addRequestInterceptor",value:function(t){this._axiosInstance.interceptors.request.use(t)}},{key:"initialise",value:function(t){this._baseUrl=t,this._client=new oi(t,this._axiosInstance)}}]),t}())},55610(){},47791(){},86958(){},54550(t,n,i){var r;if("function"==typeof fetch&&(r=void 0!==i.g&&i.g.fetch?i.g.fetch:"u">typeof window&&window.fetch?window.fetch:fetch),"u"<typeof window||void 0===window.document){var o=r||i(46911);o.default&&(o=o.default),n.default=o,t.exports=n.default}},97271(t){t.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(t,n,i){let r=i(97271),o={},a={},s=[],l=[],c=[];for(let t in r){let{name:n,nativeName:i}=r[t];o[t]=a[n.toLowerCase()]=a[i.toLowerCase()]={code:t,name:n,nativeName:i},s.push(t),l.push(n),c.push(i)}t.exports=class t{static getLanguages(n=[]){return n.map(n=>t.validate(n)?Object.assign({},o[n]):{code:n,name:"",nativeName:""})}static getName(n){return t.validate(n)?r[n].name:""}static getAllNames(){return l.slice()}static getNativeName(n){return t.validate(n)?r[n].nativeName:""}static getAllNativeNames(){return c.slice()}static getCode(t){return t=t.toLowerCase(),a.hasOwnProperty(t)?a[t].code:""}static getAllCodes(){return s.slice()}static validate(t){return r.hasOwnProperty(t)}}},57415(t){!function(n){t.exports=n()}(function(){"use strict";var t={},n={};function i(i,r,o){if(n[i]=o,"index"===i){var a="var sharedModule = {}; ("+n.shared+")(sharedModule); ("+n.worker+")(sharedModule);",s={};return n.shared(s),n.index(t,s),"u">typeof window&&t.setWorkerUrl(window.URL.createObjectURL(new Blob([a],{type:"text/javascript"}))),t}}return i("shared",["exports"],function(t){let n,i,r,o,a,s,l,c,u,d,h,p,f,m,g,v,b,y,_;function x(t,n,i,r){return new(i||(i=Promise))(function(o,a){function s(t){try{c(r.next(t))}catch(t){a(t)}}function l(t){try{c(r.throw(t))}catch(t){a(t)}}function c(t){var n;t.done?o(t.value):((n=t.value)instanceof i?n:new i(function(t){t(n)})).then(s,l)}c((r=r.apply(t,n||[])).next())})}function w(t,n){this.x=t,this.y=n}function k(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}"function"==typeof SuppressedError&&SuppressedError,w.prototype={clone(){return new w(this.x,this.y)},add(t){return this.clone()._add(t)},sub(t){return this.clone()._sub(t)},multByPoint(t){return this.clone()._multByPoint(t)},divByPoint(t){return this.clone()._divByPoint(t)},mult(t){return this.clone()._mult(t)},div(t){return this.clone()._div(t)},rotate(t){return this.clone()._rotate(t)},rotateAround(t,n){return this.clone()._rotateAround(t,n)},matMult(t){return this.clone()._matMult(t)},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(t){return this.x===t.x&&this.y===t.y},dist(t){return Math.sqrt(this.distSqr(t))},distSqr(t){let n=t.x-this.x,i=t.y-this.y;return n*n+i*i},angle(){return Math.atan2(this.y,this.x)},angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith(t){return this.angleWithSep(t.x,t.y)},angleWithSep(t,n){return Math.atan2(this.x*n-this.y*t,this.x*t+this.y*n)},_matMult(t){let n=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=n,this},_add(t){return this.x+=t.x,this.y+=t.y,this},_sub(t){return this.x-=t.x,this.y-=t.y,this},_mult(t){return this.x*=t,this.y*=t,this},_div(t){return this.x/=t,this.y/=t,this},_multByPoint(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint(t){return this.x/=t.x,this.y/=t.y,this},_unit(){return this._div(this.mag()),this},_perp(){let t=this.y;return this.y=this.x,this.x=-t,this},_rotate(t){let n=Math.cos(t),i=Math.sin(t),r=i*this.x+n*this.y;return this.x=n*this.x-i*this.y,this.y=r,this},_rotateAround(t,n){let i=Math.cos(t),r=Math.sin(t),o=n.y+r*(this.x-n.x)+i*(this.y-n.y);return this.x=n.x+i*(this.x-n.x)-r*(this.y-n.y),this.y=o,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:w},w.convert=function(t){if(t instanceof w)return t;if(Array.isArray(t))return new w(+t[0],+t[1]);if(void 0!==t.x&&void 0!==t.y)return new w(+t.x,+t.y);throw Error("Expected [x, y] or {x, y} point format")};var C,A,E,S,T,O,F,M,I,R,D,P,L,N=k(function(){if(J)return K;function t(t,n,i,r){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*n,this.by=3*(r-n)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=i,this.p2y=r}return J=1,K=t,t.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,n){if(void 0===n&&(n=1e-6),t<0)return 0;if(t>1)return 1;for(var i=t,r=0;r<8;r++){var o=this.sampleCurveX(i)-t;if(Math.abs(o)<n)return i;var a=this.sampleCurveDerivativeX(i);if(1e-6>Math.abs(a))break;i-=o/a}var s=0,l=1;for(i=t,r=0;r<20&&!(Math.abs((o=this.sampleCurveX(i))-t)<n);r++)t>o?s=i:l=i,i=.5*(l-s)+s;return i},solve:function(t,n){return this.sampleCurveY(this.solveCurveX(t,n))}},K}());function z(){return null==n&&(n="u">typeof OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),n}function j(){if(null==i&&(i=!1,z())){let t=5,n=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(n){for(let i=0;i<t*t;i++){let r=4*i;n.fillStyle=`rgb(${r},${r+1},${r+2})`,n.fillRect(i%t,Math.floor(i/t),1,1)}let r=n.getImageData(0,0,t,t).data;for(let n=0;n<t*t*4;n++)if(n%4!=3&&r[n]!==n){i=!0;break}}}return i||!1}var B=1e-6,U="u">typeof Float32Array?Float32Array:Array;function V(){var t=new U(9);return U!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function H(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function q(){var t=new U(3);return U!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function W(t){var n=t[0],i=t[1],r=t[2];return Math.sqrt(n*n+i*i+r*r)}function G(t,n,i){var r=new U(3);return r[0]=t,r[1]=n,r[2]=i,r}function Y(t,n,i){return t[0]=n[0]+i[0],t[1]=n[1]+i[1],t[2]=n[2]+i[2],t}function Z(t,n,i){return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t}function X(t,n,i){var r=n[0],o=n[1],a=n[2],s=i[0],l=i[1],c=i[2];return t[0]=o*c-a*l,t[1]=a*s-r*c,t[2]=r*l-o*s,t}var K,J,Q,ee=W;function et(t,n,i){var r=n[0],o=n[1],a=n[2],s=n[3];return t[0]=i[0]*r+i[4]*o+i[8]*a+i[12]*s,t[1]=i[1]*r+i[5]*o+i[9]*a+i[13]*s,t[2]=i[2]*r+i[6]*o+i[10]*a+i[14]*s,t[3]=i[3]*r+i[7]*o+i[11]*a+i[15]*s,t}function en(){var t=new U(4);return U!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function ei(t,n,i,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"zyx",a=Math.PI/360;n*=a,r*=a,i*=a;var s=Math.sin(n),l=Math.cos(n),c=Math.sin(i),u=Math.cos(i),d=Math.sin(r),h=Math.cos(r);switch(o){case"xyz":t[0]=s*u*h+l*c*d,t[1]=l*c*h-s*u*d,t[2]=l*u*d+s*c*h,t[3]=l*u*h-s*c*d;break;case"xzy":t[0]=s*u*h-l*c*d,t[1]=l*c*h-s*u*d,t[2]=l*u*d+s*c*h,t[3]=l*u*h+s*c*d;break;case"yxz":t[0]=s*u*h+l*c*d,t[1]=l*c*h-s*u*d,t[2]=l*u*d-s*c*h,t[3]=l*u*h+s*c*d;break;case"yzx":t[0]=s*u*h+l*c*d,t[1]=l*c*h+s*u*d,t[2]=l*u*d-s*c*h,t[3]=l*u*h-s*c*d;break;case"zxy":t[0]=s*u*h-l*c*d,t[1]=l*c*h+s*u*d,t[2]=l*u*d+s*c*h,t[3]=l*u*h-s*c*d;break;case"zyx":t[0]=s*u*h-l*c*d,t[1]=l*c*h+s*u*d,t[2]=l*u*d-s*c*h,t[3]=l*u*h+s*c*d;break;default:throw Error("Unknown angle order "+o)}return t}function er(){var t=new U(2);return U!=Float32Array&&(t[0]=0,t[1]=0),t}function eo(t,n){var i=new U(2);return i[0]=t,i[1]=n,i}q(),Q=new U(4),U!=Float32Array&&(Q[0]=0,Q[1]=0,Q[2]=0,Q[3]=0),q(),G(1,0,0),G(0,1,0),en(),en(),V(),er();let ea=8192;function es(t,n,i){return n*(ea/(t.tileSize*Math.pow(2,i-t.tileID.overscaledZ)))}function el(t,n){return(t%n+n)%n}function ec(t,n,i){return t*(1-i)+n*i}function eu(t){if(t<=0)return 0;if(t>=1)return 1;let n=t*t,i=n*t;return 4*(t<.5?i:3*(t-n)+i-.75)}function ed(t,n,i,r){let o=new N(t,n,i,r);return t=>o.solve(t)}let eh=ed(.25,.1,.25,1);function ep(t,n,i){return Math.min(i,Math.max(n,t))}function ef(t,n,i){let r=i-n,o=((t-n)%r+r)%r+n;return o===n?i:o}function em(t,...n){for(let i of n)for(let n in i)t[n]=i[n];return t}let eg=1;function ev(t,n,i){let r={};for(let i in t)r[i]=n.call(this,t[i],i,t);return r}function eb(t,n,i){let r={};for(let i in t)n.call(this,t[i],i,t)&&(r[i]=t[i]);return r}function ey(t){return Array.isArray(t)?t.map(ey):"object"==typeof t&&t?ev(t,ey):t}let e_={};function ex(t){e_[t]||("u">typeof console&&console.warn(t),e_[t]=!0)}function ew(t,n,i){return(i.y-t.y)*(n.x-t.x)>(n.y-t.y)*(i.x-t.x)}function ek(t){return"u">typeof WorkerGlobalScope&&void 0!==t&&t instanceof WorkerGlobalScope}let eC=null;function eA(t){return"u">typeof ImageBitmap&&t instanceof ImageBitmap}let eE="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function eS(t,n,i,r,o){return x(this,void 0,void 0,function*(){if("u"<typeof VideoFrame)throw Error("VideoFrame not supported");let a=new VideoFrame(t,{timestamp:0});try{let s=null==a?void 0:a.format;if(!s||!s.startsWith("BGR")&&!s.startsWith("RGB"))throw Error(`Unrecognized format ${s}`);let l=s.startsWith("BGR"),c=new Uint8ClampedArray(r*o*4);if(yield a.copyTo(c,function(t,n,i,r,o){let a=4*Math.max(-n,0),s=(Math.max(0,i)-i)*r*4+a,l=4*r,c=Math.max(0,n),u=Math.max(0,i);return{rect:{x:c,y:u,width:Math.min(t.width,n+r)-c,height:Math.min(t.height,i+o)-u},layout:[{offset:s,stride:l}]}}(t,n,i,r,o)),l)for(let t=0;t<c.length;t+=4){let n=c[t];c[t]=c[t+2],c[t+2]=n}return c}finally{a.close()}})}function eT(t,n,i,r){return t.addEventListener(n,i,r),{unsubscribe:()=>{t.removeEventListener(n,i,r)}}}function eO(t){return t*Math.PI/180}function eF(t){return t/Math.PI*180}let eM={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},eI={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},eR="AbortError";class eD extends Error{constructor(t=eR){super(t instanceof Error?t.message:t),this.name=eR,t instanceof Error&&t.stack&&(this.stack=t.stack)}}function eP(t){return t.name===eR}let eL={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function eN(t){return eL.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf("://"))]}let ez="global-dispatcher";class ej extends Error{constructor(t,n,i,r){super(`AJAXError: ${n} (${t}): ${i}`),this.status=t,this.statusText=n,this.url=i,this.body=r}}let eB=()=>ek(self)?self.worker&&self.worker.referrer:("blob:"===window.location.protocol?window.parent:window).location.href,e$=function(t,n){var i;if(/:\/\//.test(t.url)&&!/^https?:|^file:/.test(t.url)){let i=eN(t.url);if(i)return i(t,n);if(ek(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,targetMapId:ez},n)}if(!(/^file:/.test(i=t.url)||/^file:/.test(eB())&&!/^\w+:/.test(i))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(t,n){return x(this,void 0,void 0,function*(){let i,r,o=new Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:eB(),signal:n.signal});"json"!==t.type||o.headers.has("Accept")||o.headers.set("Accept","application/json");try{i=yield fetch(o)}catch(n){if(eP(n))throw n;throw new ej(0,n.message,t.url,new Blob)}if(!i.ok){let n=yield i.blob();throw new ej(i.status,i.statusText,t.url,n)}r="arrayBuffer"===t.type||"image"===t.type?i.arrayBuffer():"json"===t.type?i.json():i.text();let a=yield r;return n.signal.throwIfAborted(),{data:a,cacheControl:i.headers.get("Cache-Control"),expires:i.headers.get("Expires")}})}(t,n);if(ek(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,mustQueue:!0,targetMapId:ez},n)}return function(t,n){return new Promise((i,r)=>{var o;let a=new XMLHttpRequest;for(let n in a.open(t.method||"GET",t.url,!0),"arrayBuffer"!==t.type&&"image"!==t.type||(a.responseType="arraybuffer"),t.headers)a.setRequestHeader(n,t.headers[n]);"json"===t.type&&(a.responseType="text",(null==(o=t.headers)?void 0:o.Accept)||a.setRequestHeader("Accept","application/json")),a.withCredentials="include"===t.credentials,a.onerror=()=>{r(Error(a.statusText))},a.onload=()=>{if(!n.signal.aborted)if((a.status>=200&&a.status<300||0===a.status)&&null!==a.response){let n=a.response;if("json"===t.type)try{n=JSON.parse(a.response)}catch(t){return void r(t)}i({data:n,cacheControl:a.getResponseHeader("Cache-Control"),expires:a.getResponseHeader("Expires")})}else{let n=new Blob([a.response],{type:a.getResponseHeader("Content-Type")});r(new ej(a.status,a.statusText,t.url,n))}},n.signal.addEventListener("abort",()=>{a.abort(),r(new eD(n.signal.reason))}),a.send(t.body)})}(t,n)};function eU(t){if(!t||0>=t.indexOf("://")||0===t.indexOf("data:image/")||0===t.indexOf("blob:"))return!0;let n=new URL(t),i=window.location;return n.protocol===i.protocol&&n.host===i.host}function eV(t,n,i){i[t]&&-1!==i[t].indexOf(n)||(i[t]=i[t]||[],i[t].push(n))}function eH(t,n,i){if(i&&i[t]){let r=i[t].indexOf(n);-1!==r&&i[t].splice(r,1)}}class eq{constructor(t,n={}){em(this,n),this.type=t}}class eW extends eq{constructor(t,n={}){super("error",em({error:t},n))}}class eG{on(t,n){return this._listeners=this._listeners||{},eV(t,n,this._listeners),{unsubscribe:()=>{this.off(t,n)}}}off(t,n){return eH(t,n,this._listeners),eH(t,n,this._oneTimeListeners),this}once(t,n){return n?(this._oneTimeListeners=this._oneTimeListeners||{},eV(t,n,this._oneTimeListeners),this):new Promise(n=>this.once(t,n))}fire(t,n){"string"==typeof t&&(t=new eq(t,n||{}));let i=t.type;if(this.listens(i)){for(let n of(t.target=this,this._listeners&&this._listeners[i]?this._listeners[i].slice():[]))n.call(this,t);for(let n of this._oneTimeListeners&&this._oneTimeListeners[i]?this._oneTimeListeners[i].slice():[])eH(i,n,this._oneTimeListeners),n.call(this,t);let n=this._eventedParent;n&&(em(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),n.fire(t))}else t instanceof eW&&console.error(t.error);return this}listens(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)}setEventedParent(t,n){return this._eventedParent=t,this._eventedParentData=n,this}}var eY={$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 eZ=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function eX(t,n){let i={};for(let n in t)"ref"!==n&&(i[n]=t[n]);return eZ.forEach(t=>{t in n&&(i[t]=n[t])}),i}function eK(t,n){if(Array.isArray(t)){if(!Array.isArray(n)||t.length!==n.length)return!1;for(let i=0;i<t.length;i++)if(!eK(t[i],n[i]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==n){if("object"!=typeof n||Object.keys(t).length!==Object.keys(n).length)return!1;for(let i in t)if(!eK(t[i],n[i]))return!1;return!0}return t===n}function eJ(t,n){t.push(n)}function eQ(t,n,i){eJ(i,{command:"addSource",args:[t,n[t]]})}function e0(t,n,i){eJ(n,{command:"removeSource",args:[t]}),i[t]=!0}function e1(t,n,i,r){e0(t,i,r),eQ(t,n,i)}function e2(t,n,i){let r;for(r in t[i])if(Object.prototype.hasOwnProperty.call(t[i],r)&&"data"!==r&&!eK(t[i][r],n[i][r]))return!1;for(r in n[i])if(Object.prototype.hasOwnProperty.call(n[i],r)&&"data"!==r&&!eK(t[i][r],n[i][r]))return!1;return!0}function e5(t,n,i,r,o,a){for(let s in n=n||{},t=t||{})Object.prototype.hasOwnProperty.call(t,s)&&(eK(t[s],n[s])||i.push({command:a,args:[r,s,n[s],o]}));for(let s in n)Object.prototype.hasOwnProperty.call(n,s)&&!Object.prototype.hasOwnProperty.call(t,s)&&(eK(t[s],n[s])||i.push({command:a,args:[r,s,n[s],o]}))}function e3(t){return t.id}function e4(t,n){return t[n.id]=n,t}class e6{constructor(t,n,i,r){this.message=(t?`${t}: `:"")+i,r&&(this.identifier=r),null!=n&&n.__line__&&(this.line=n.__line__)}}function e8(t,...n){for(let i of n)for(let n in i)t[n]=i[n];return t}class e7 extends Error{constructor(t,n){super(n),this.message=n,this.key=t}}class e9{constructor(t,n=[]){for(const[i,r]of(this.parent=t,this.bindings={},n))this.bindings[i]=r}concat(t){return new e9(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}let te={kind:"null"},tt={kind:"number"},tn={kind:"string"},ti={kind:"boolean"},tr={kind:"color"},to={kind:"projectionDefinition"},ta={kind:"object"},ts={kind:"value"},tl={kind:"collator"},tc={kind:"formatted"},tu={kind:"padding"},td={kind:"colorArray"},th={kind:"numberArray"},tp={kind:"resolvedImage"},tf={kind:"variableAnchorOffsetCollection"};function tm(t,n){return{kind:"array",itemType:t,N:n}}function tg(t){if("array"===t.kind){let n=tg(t.itemType);return"number"==typeof t.N?`array<${n}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${n}>`}return t.kind}let tv=[te,tt,tn,ti,tr,to,tc,ta,tm(ts),tu,th,td,tp,tf];function tb(t,n){if("error"===n.kind)return null;if("array"===t.kind){if("array"===n.kind&&(0===n.N&&"value"===n.itemType.kind||!tb(t.itemType,n.itemType))&&("number"!=typeof t.N||t.N===n.N))return null}else{if(t.kind===n.kind)return null;if("value"===t.kind){for(let t of tv)if(!tb(t,n))return null}}return`Expected ${tg(t)} but found ${tg(n)} instead.`}function ty(t,n){return n.some(n=>n.kind===t.kind)}function t_(t,n){return n.some(n=>"null"===n?null===t:"array"===n?Array.isArray(t):"object"===n?t&&!Array.isArray(t)&&"object"==typeof t:n===typeof t)}function tx(t,n){return"array"===t.kind&&"array"===n.kind?t.itemType.kind===n.itemType.kind&&"number"==typeof t.N:t.kind===n.kind}let tw=.96422,tk=.82521,tC=4/29,tA=6/29,tE=6/29*3*(6/29),tS=6/29*(6/29)*(6/29),tT=Math.PI/180,tO=180/Math.PI;function tF(t){return(t%=360)<0&&(t+=360),t}function tM([t,n,i,r]){let o,a,s=tR((.2225045*(t=tI(t))+.7168786*(n=tI(n))+.0606169*(i=tI(i)))/1);t===n&&n===i?o=a=s:(o=tR((.4360747*t+.3850649*n+.1430804*i)/tw),a=tR((.0139322*t+.0971045*n+.7141733*i)/tk));let l=116*s-16;return[l<0?0:l,500*(o-s),200*(s-a),r]}function tI(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function tR(t){return t>tS?Math.pow(t,1/3):t/tE+tC}function tD([t,n,i,r]){let o=(t+16)/116,a=isNaN(n)?o:o+n/500,s=isNaN(i)?o:o-i/200;return o=+tL(o),[tP(3.1338561*(a=tw*tL(a))-1.6168667*o-.4906146*(s=tk*tL(s))),tP(-.9787684*a+1.9161415*o+.033454*s),tP(.0719453*a-.2289914*o+1.4052427*s),r]}function tP(t){return(t=t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055)<0?0:t>1?1:t}function tL(t){return t>tA?t*t*t:tE*(t-tC)}let tN=Object.hasOwn||function(t,n){return Object.prototype.hasOwnProperty.call(t,n)};function tz(t,n){return tN(t,n)?t[n]:void 0}function tj(t){return parseInt(t.padEnd(2,t),16)/255}function tB(t,n){return t$(n?t/100:t,0,1)}function t$(t,n,i){return Math.min(Math.max(n,t),i)}function tU(t){return!t.some(Number.isNaN)}let tV={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 tH(t,n,i){return t+i*(n-t)}function tq(t,n,i){return t.map((t,r)=>tH(t,n[r],i))}class tW{constructor(t,n,i,r=1,o=!0){this.r=t,this.g=n,this.b=i,this.a=r,o||(this.r*=r,this.g*=r,this.b*=r,r||this.overwriteGetter("rgb",[t,n,i,r]))}static parse(t){if(t instanceof tW)return t;if("string"!=typeof t)return;let n=function(t){if("transparent"===(t=t.toLowerCase().trim()))return[0,0,0,0];let n=tz(tV,t);if(n){let[t,i,r]=n;return[t/255,i/255,r/255,1]}if(t.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){let n=t.length<6?1:2,i=1;return[tj(t.slice(i,i+=n)),tj(t.slice(i,i+=n)),tj(t.slice(i,i+=n)),tj(t.slice(i,i+n)||"ff")]}if(t.startsWith("rgb")){let n=t.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(n){let[t,i,r,o,a,s,l,c,u,d,h,p]=n,f=[o||" ",l||" ",d].join("");if(" "===f||" /"===f||",,"===f||",,,"===f){let t=[r,s,u].join(""),n="%%%"===t?100:255*(""===t);if(n){let t=[t$(i/n,0,1),t$(a/n,0,1),t$(c/n,0,1),h?tB(+h,p):1];if(tU(t))return t}}return}}let i=t.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(i){let[t,n,r,o,a,s,l,c,u]=i,d=[r||" ",a||" ",l].join("");if(" "===d||" /"===d||",,"===d||",,,"===d){let t=[+n,t$(+o,0,100),t$(+s,0,100),c?tB(+c,u):1];if(tU(t))return function([t,n,i,r]){function o(r){let o=(r+t/30)%12,a=n*Math.min(i,1-i);return i-a*Math.max(-1,Math.min(o-3,9-o,1))}return t=tF(t),n/=100,i/=100,[o(0),o(8),o(4),r]}(t)}}}(t);return n?new tW(...n,!1):void 0}get rgb(){let{r:t,g:n,b:i,a:r}=this,o=r||1/0;return this.overwriteGetter("rgb",[t/o,n/o,i/o,r])}get hcl(){return this.overwriteGetter("hcl",function(t){let[n,i,r,o]=tM(t),a=Math.sqrt(i*i+r*r);return[Math.round(1e4*a)?tF(Math.atan2(r,i)*tO):NaN,a,n,o]}(this.rgb))}get lab(){return this.overwriteGetter("lab",tM(this.rgb))}overwriteGetter(t,n){return Object.defineProperty(this,t,{value:n}),n}toString(){let[t,n,i,r]=this.rgb;return`rgba(${[t,n,i].map(t=>Math.round(255*t)).join(",")},${r})`}static interpolate(t,n,i,r="rgb"){switch(r){case"rgb":{let[r,o,a,s]=tq(t.rgb,n.rgb,i);return new tW(r,o,a,s,!1)}case"hcl":{let r,o,[a,s,l,c]=t.hcl,[u,d,h,p]=n.hcl;if(isNaN(a)||isNaN(u))isNaN(a)?isNaN(u)?r=NaN:(r=u,1!==l&&0!==l||(o=d)):(r=a,1!==h&&0!==h||(o=s));else{let t=u-a;u>a&&t>180?t-=360:u<a&&a-u>180&&(t+=360),r=a+i*t}let[f,m,g,v]=function([t,n,i,r]){return tD([i,Math.cos(t=isNaN(t)?0:t*tT)*n,Math.sin(t)*n,r])}([r,null!=o?o:tH(s,d,i),tH(l,h,i),tH(c,p,i)]);return new tW(f,m,g,v,!1)}case"lab":{let[r,o,a,s]=tD(tq(t.lab,n.lab,i));return new tW(r,o,a,s,!1)}}}}tW.black=new tW(0,0,0,1),tW.white=new tW(1,1,1,1),tW.transparent=new tW(0,0,0,0),tW.red=new tW(1,0,0,1);class tG{constructor(t,n,i){this.sensitivity=t?n?"variant":"case":n?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,n){return this.collator.compare(t,n)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}let tY=["bottom","center","top"];class tZ{constructor(t,n,i,r,o,a){this.text=t,this.image=n,this.scale=i,this.fontStack=r,this.textColor=o,this.verticalAlign=a}}class tX{constructor(t){this.sections=t}static fromString(t){return new tX([new tZ(t,null,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(t=>0!==t.text.length||t.image&&0!==t.image.name.length)}static factory(t){return t instanceof tX?t:tX.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map(t=>t.text).join("")}}class tK{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof tK)return t;if("number"==typeof t)return new tK([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(let n of t)if("number"!=typeof n)return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new tK(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,n,i){return new tK(tq(t.values,n.values,i))}}class tJ{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof tJ)return t;if("number"==typeof t)return new tJ([t]);if(Array.isArray(t)){for(let n of t)if("number"!=typeof n)return;return new tJ(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,n,i){return new tJ(tq(t.values,n.values,i))}}class tQ{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof tQ)return t;if("string"==typeof t){let n=tW.parse(t);if(!n)return;return new tQ([n])}if(!Array.isArray(t))return;let n=[];for(let i of t){if("string"!=typeof i)return;let t=tW.parse(i);if(!t)return;n.push(t)}return new tQ(n)}toString(){return JSON.stringify(this.values)}static interpolate(t,n,i,r="rgb"){let o=[];if(t.values.length!=n.values.length)throw Error(`colorArray: Arrays have mismatched length (${t.values.length} vs. ${n.values.length}), cannot interpolate.`);for(let a=0;a<t.values.length;a++)o.push(tW.interpolate(t.values[a],n.values[a],i,r));return new tQ(o)}}class t0 extends Error{constructor(t){super(t),this.name="RuntimeError"}toJSON(){return this.message}}let t1=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class t2{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof t2)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let n=0;n<t.length;n+=2){let i=t[n],r=t[n+1];if("string"!=typeof i||!t1.has(i)||!Array.isArray(r)||2!==r.length||"number"!=typeof r[0]||"number"!=typeof r[1])return}return new t2(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,n,i){let r=t.values,o=n.values;if(r.length!==o.length)throw new t0(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${n.toString()}`);let a=[];for(let t=0;t<r.length;t+=2){if(r[t]!==o[t])throw new t0(`Cannot interpolate values containing mismatched anchors. from[${t}]: ${r[t]}, to[${t}]: ${o[t]}`);a.push(r[t]);let[n,s]=r[t+1],[l,c]=o[t+1];a.push([tH(n,l,i),tH(s,c,i)])}return new t2(a)}}class t5{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new t5({name:t,available:!1}):null}}class t3{constructor(t,n,i){this.from=t,this.to=n,this.transition=i}static interpolate(t,n,i){return new t3(t,n,i)}static parse(t){return t instanceof t3?t:Array.isArray(t)&&3===t.length&&"string"==typeof t[0]&&"string"==typeof t[1]&&"number"==typeof t[2]?new t3(t[0],t[1],t[2]):"object"==typeof t&&"string"==typeof t.from&&"string"==typeof t.to&&"number"==typeof t.transition?new t3(t.from,t.to,t.transition):"string"==typeof t?new t3(t,t,1):void 0}}function t4(t,n,i,r){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof n&&n>=0&&n<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:`Invalid rgba value [${[t,n,i,r].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof r?[t,n,i,r]:[t,n,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function t6(t){if(null===t||"string"==typeof t||"boolean"==typeof t||"number"==typeof t||t instanceof t3||t instanceof tW||t instanceof tG||t instanceof tX||t instanceof tK||t instanceof tJ||t instanceof tQ||t instanceof t2||t instanceof t5)return!0;if(Array.isArray(t)){for(let n of t)if(!t6(n))return!1;return!0}if("object"==typeof t){for(let n in t)if(!t6(t[n]))return!1;return!0}return!1}function t8(t){if(null===t)return te;if("string"==typeof t)return tn;if("boolean"==typeof t)return ti;if("number"==typeof t)return tt;if(t instanceof tW)return tr;if(t instanceof t3)return to;if(t instanceof tG)return tl;if(t instanceof tX)return tc;if(t instanceof tK)return tu;if(t instanceof tJ)return th;if(t instanceof tQ)return td;if(t instanceof t2)return tf;if(t instanceof t5)return tp;if(Array.isArray(t)){let n,i=t.length;for(let i of t){let t=t8(i);if(n){if(n===t)continue;n=ts;break}n=t}return tm(n||ts,i)}return ta}function t7(t){let n=typeof t;return null===t?"":"string"===n||"number"===n||"boolean"===n?String(t):t instanceof tW||t instanceof t3||t instanceof tX||t instanceof tK||t instanceof tJ||t instanceof tQ||t instanceof t2||t instanceof t5?t.toString():JSON.stringify(t)}class t9{constructor(t,n){this.type=t,this.value=n}static parse(t,n){if(2!==t.length)return n.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!t6(t[1]))return n.error("invalid value");let i=t[1],r=t8(i),o=n.expectedType;return"array"===r.kind&&0===r.N&&o&&"array"===o.kind&&("number"!=typeof o.N||0===o.N)&&(r=o),new t9(r,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}let ne={string:tn,number:tt,boolean:ti,object:ta};class nt{constructor(t,n){this.type=t,this.args=n}static parse(t,n){if(t.length<2)return n.error("Expected at least one argument.");let i,r=1,o=t[0];if("array"===o){let o,a;if(t.length>2){let i=t[1];if("string"!=typeof i||!(i in ne)||"object"===i)return n.error('The item type argument of "array" must be one of string, number, boolean',1);o=ne[i],r++}else o=ts;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return n.error('The length argument to "array" must be a positive integer literal',2);a=t[2],r++}i=tm(o,a)}else{if(!ne[o])throw Error(`Types doesn't contain name = ${o}`);i=ne[o]}let a=[];for(;r<t.length;r++){let i=n.parse(t[r],r,ts);if(!i)return null;a.push(i)}return new nt(i,a)}evaluate(t){for(let n=0;n<this.args.length;n++){let i=this.args[n].evaluate(t);if(!tb(this.type,t8(i)))return i;if(n===this.args.length-1)throw new t0(`Expected value to be of type ${tg(this.type)}, but found ${tg(t8(i))} instead.`)}throw Error()}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}let nn={"to-boolean":ti,"to-color":tr,"to-number":tt,"to-string":tn};class ni{constructor(t,n){this.type=t,this.args=n}static parse(t,n){if(t.length<2)return n.error("Expected at least one argument.");let i=t[0];if(!nn[i])throw Error(`Can't parse ${i} as it is not part of the known types`);if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return n.error("Expected one argument.");let r=nn[i],o=[];for(let i=1;i<t.length;i++){let r=n.parse(t[i],i,ts);if(!r)return null;o.push(r)}return new ni(r,o)}evaluate(t){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(t);case"color":{let n,i;for(let r of this.args){if(n=r.evaluate(t),i=null,n instanceof tW)return n;if("string"==typeof n){let i=t.parseColor(n);if(i)return i}else if(Array.isArray(n)&&!(i=n.length<3||n.length>4?`Invalid rgba value ${JSON.stringify(n)}: expected an array containing either three or four numeric values.`:t4(n[0],n[1],n[2],n[3])))return new tW(n[0]/255,n[1]/255,n[2]/255,n[3])}throw new t0(i||`Could not parse color from value '${"string"==typeof n?n:JSON.stringify(n)}'`)}case"padding":{let n;for(let i of this.args){n=i.evaluate(t);let r=tK.parse(n);if(r)return r}throw new t0(`Could not parse padding from value '${"string"==typeof n?n:JSON.stringify(n)}'`)}case"numberArray":{let n;for(let i of this.args){n=i.evaluate(t);let r=tJ.parse(n);if(r)return r}throw new t0(`Could not parse numberArray from value '${"string"==typeof n?n:JSON.stringify(n)}'`)}case"colorArray":{let n;for(let i of this.args){n=i.evaluate(t);let r=tQ.parse(n);if(r)return r}throw new t0(`Could not parse colorArray from value '${"string"==typeof n?n:JSON.stringify(n)}'`)}case"variableAnchorOffsetCollection":{let n;for(let i of this.args){n=i.evaluate(t);let r=t2.parse(n);if(r)return r}throw new t0(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof n?n:JSON.stringify(n)}'`)}case"number":{let n=null;for(let i of this.args){if(null===(n=i.evaluate(t)))return 0;let r=Number(n);if(!isNaN(r))return r}throw new t0(`Could not convert ${JSON.stringify(n)} to number.`)}case"formatted":return tX.fromString(t7(this.args[0].evaluate(t)));case"resolvedImage":return t5.fromString(t7(this.args[0].evaluate(t)));case"projectionDefinition":return this.args[0].evaluate(t);default:return t7(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}let nr=["Unknown","Point","LineString","Polygon"];class no{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?nr[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(t){let n=this._parseColorCache.get(t);return n||(n=tW.parse(t),this._parseColorCache.set(t,n)),n}}class na{constructor(t,n,i=[],r,o=new e9,a=[]){this.registry=t,this.path=i,this.key=i.map(t=>`[${t}]`).join(""),this.scope=o,this.errors=a,this.expectedType=r,this._isConstant=n}parse(t,n,i,r,o={}){return n?this.concat(n,i,r)._parse(t,o):this._parse(t,o)}_parse(t,n){function i(t,n,i){return"assert"===i?new nt(n,[t]):"coerce"===i?new ni(n,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let r=t[0];if("string"!=typeof r)return this.error(`Expression name must be a string, but found ${typeof r} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let o=this.registry[r];if(o){let r=o.parse(t,this);if(!r)return null;if(this.expectedType){let t=this.expectedType,o=r.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==o.kind){if("projectionDefinition"===t.kind&&["string","array"].includes(o.kind)||["color","formatted","resolvedImage"].includes(t.kind)&&["value","string"].includes(o.kind)||["padding","numberArray"].includes(t.kind)&&["value","number","array"].includes(o.kind)||"colorArray"===t.kind&&["value","string","array"].includes(o.kind)||"variableAnchorOffsetCollection"===t.kind&&["value","array"].includes(o.kind))r=i(r,t,n.typeAnnotation||"coerce");else if(this.checkSubtype(t,o))return null}else r=i(r,t,n.typeAnnotation||"assert")}if(!(r instanceof t9)&&"resolvedImage"!==r.type.kind&&this._isConstant(r)){let t=new no;try{r=new t9(r.type,r.evaluate(t))}catch(t){return this.error(t.message),null}}return r}return this.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,n,i){let r="number"==typeof t?this.path.concat(t):this.path,o=i?this.scope.concat(i):this.scope;return new na(this.registry,this._isConstant,r,n||null,o,this.errors)}error(t,...n){let i=`${this.key}${n.map(t=>`[${t}]`).join("")}`;this.errors.push(new e7(i,t))}checkSubtype(t,n){let i=tb(t,n);return i&&this.error(i),i}}class ns{constructor(t,n){this.type=n.type,this.bindings=[].concat(t),this.result=n}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(let n of this.bindings)t(n[1]);t(this.result)}static parse(t,n){if(t.length<4)return n.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);let i=[];for(let r=1;r<t.length-1;r+=2){let o=t[r];if("string"!=typeof o)return n.error(`Expected string, but found ${typeof o} instead.`,r);if(/[^a-zA-Z0-9_]/.test(o))return n.error("Variable names must contain only alphanumeric characters or '_'.",r);let a=n.parse(t[r+1],r+1);if(!a)return null;i.push([o,a])}let r=n.parse(t[t.length-1],t.length-1,n.expectedType,i);return r?new ns(i,r):null}outputDefined(){return this.result.outputDefined()}}class nl{constructor(t,n){this.type=n.type,this.name=t,this.boundExpression=n}static parse(t,n){if(2!==t.length||"string"!=typeof t[1])return n.error("'var' expression requires exactly one string literal argument.");let i=t[1];return n.scope.has(i)?new nl(i,n.scope.get(i)):n.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}}class nc{constructor(t,n,i){this.type=t,this.index=n,this.input=i}static parse(t,n){if(3!==t.length)return n.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let i=n.parse(t[1],1,tt),r=n.parse(t[2],2,tm(n.expectedType||ts));return i&&r?new nc(r.type.itemType,i,r):null}evaluate(t){let n=this.index.evaluate(t),i=this.input.evaluate(t);if(n<0)throw new t0(`Array index out of bounds: ${n} < 0.`);if(n>=i.length)throw new t0(`Array index out of bounds: ${n} > ${i.length-1}.`);if(n!==Math.floor(n))throw new t0(`Array index must be an integer, but found ${n} instead.`);return i[n]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}}class nu{constructor(t,n){this.type=ti,this.needle=t,this.haystack=n}static parse(t,n){if(3!==t.length)return n.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let i=n.parse(t[1],1,ts),r=n.parse(t[2],2,ts);return i&&r?ty(i.type,[ti,tn,tt,te,ts])?new nu(i,r):n.error(`Expected first argument to be of type boolean, string, number or null, but found ${tg(i.type)} instead`):null}evaluate(t){let n=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return!1;if(!t_(n,["boolean","string","number","null"]))throw new t0(`Expected first argument to be of type boolean, string, number or null, but found ${tg(t8(n))} instead.`);if(!t_(i,["string","array"]))throw new t0(`Expected second argument to be of type array or string, but found ${tg(t8(i))} instead.`);return i.indexOf(n)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class nd{constructor(t,n,i){this.type=tt,this.needle=t,this.haystack=n,this.fromIndex=i}static parse(t,n){if(t.length<=2||t.length>=5)return n.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);let i=n.parse(t[1],1,ts),r=n.parse(t[2],2,ts);if(!i||!r)return null;if(!ty(i.type,[ti,tn,tt,te,ts]))return n.error(`Expected first argument to be of type boolean, string, number or null, but found ${tg(i.type)} instead`);if(4===t.length){let o=n.parse(t[3],3,tt);return o?new nd(i,r,o):null}return new nd(i,r)}evaluate(t){let n,i=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!t_(i,["boolean","string","number","null"]))throw new t0(`Expected first argument to be of type boolean, string, number or null, but found ${tg(t8(i))} instead.`);if(this.fromIndex&&(n=this.fromIndex.evaluate(t)),t_(r,["string"])){let t=r.indexOf(i,n);return -1===t?-1:[...r.slice(0,t)].length}if(t_(r,["array"]))return r.indexOf(i,n);throw new t0(`Expected second argument to be of type array or string, but found ${tg(t8(r))} instead.`)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class nh{constructor(t,n,i,r,o,a){this.inputType=t,this.type=n,this.input=i,this.cases=r,this.outputs=o,this.otherwise=a}static parse(t,n){let i,r;if(t.length<5)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return n.error("Expected an even number of arguments.");n.expectedType&&"value"!==n.expectedType.kind&&(r=n.expectedType);let o={},a=[];for(let s=2;s<t.length-1;s+=2){let l=t[s],c=t[s+1];Array.isArray(l)||(l=[l]);let u=n.concat(s);if(0===l.length)return u.error("Expected at least one branch label.");for(let t of l){if("number"!=typeof t&&"string"!=typeof t)return u.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return u.error("Numeric branch labels must be integer values.");if(i){if(u.checkSubtype(i,t8(t)))return null}else i=t8(t);if(void 0!==o[String(t)])return u.error("Branch labels must be unique.");o[String(t)]=a.length}let d=n.parse(c,s,r);if(!d)return null;r=r||d.type,a.push(d)}let s=n.parse(t[1],1,ts);if(!s)return null;let l=n.parse(t[t.length-1],t.length-1,r);return l?"value"!==s.type.kind&&n.concat(1).checkSubtype(i,s.type)?null:new nh(i,r,s,o,a,l):null}evaluate(t){let n=this.input.evaluate(t);return(t8(n)===this.inputType&&this.outputs[this.cases[n]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}}class np{constructor(t,n,i){this.type=t,this.branches=n,this.otherwise=i}static parse(t,n){let i;if(t.length<4)return n.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return n.error("Expected an odd number of arguments.");n.expectedType&&"value"!==n.expectedType.kind&&(i=n.expectedType);let r=[];for(let o=1;o<t.length-1;o+=2){let a=n.parse(t[o],o,ti);if(!a)return null;let s=n.parse(t[o+1],o+1,i);if(!s)return null;r.push([a,s]),i=i||s.type}let o=n.parse(t[t.length-1],t.length-1,i);if(!o)return null;if(!i)throw Error("Can't infer output type");return new np(i,r,o)}evaluate(t){for(let[n,i]of this.branches)if(n.evaluate(t))return i.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(let[n,i]of this.branches)t(n),t(i);t(this.otherwise)}outputDefined(){return this.branches.every(([t,n])=>n.outputDefined())&&this.otherwise.outputDefined()}}class nf{constructor(t,n,i,r){this.type=t,this.input=n,this.beginIndex=i,this.endIndex=r}static parse(t,n){if(t.length<=2||t.length>=5)return n.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);let i=n.parse(t[1],1,ts),r=n.parse(t[2],2,tt);if(!i||!r)return null;if(!ty(i.type,[tm(ts),tn,ts]))return n.error(`Expected first argument to be of type array or string, but found ${tg(i.type)} instead`);if(4===t.length){let o=n.parse(t[3],3,tt);return o?new nf(i.type,i,r,o):null}return new nf(i.type,i,r)}evaluate(t){let n,i=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(this.endIndex&&(n=this.endIndex.evaluate(t)),t_(i,["string"]))return[...i].slice(r,n).join("");if(t_(i,["array"]))return i.slice(r,n);throw new t0(`Expected first argument to be of type array or string, but found ${tg(t8(i))} instead.`)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function nm(t,n){let i=t.length-1,r,o,a=0,s=i,l=0;for(;a<=s;)if(r=t[l=Math.floor((a+s)/2)],o=t[l+1],r<=n){if(l===i||n<o)return l;a=l+1}else{if(!(r>n))throw new t0("Input is not a number.");s=l-1}return 0}class ng{constructor(t,n,i){for(const[r,o]of(this.type=t,this.input=n,this.labels=[],this.outputs=[],i))this.labels.push(r),this.outputs.push(o)}static parse(t,n){if(t.length-1<4)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return n.error("Expected an even number of arguments.");let i=n.parse(t[1],1,tt);if(!i)return null;let r=[],o=null;n.expectedType&&"value"!==n.expectedType.kind&&(o=n.expectedType);for(let i=1;i<t.length;i+=2){let a=1===i?-1/0:t[i],s=t[i+1],l=i,c=i+1;if("number"!=typeof a)return n.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(r.length&&r[r.length-1][0]>=a)return n.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);let u=n.parse(s,c,o);if(!u)return null;o=o||u.type,r.push([a,u])}return new ng(o,i,r)}evaluate(t){let n=this.labels,i=this.outputs;if(1===n.length)return i[0].evaluate(t);let r=this.input.evaluate(t);if(r<=n[0])return i[0].evaluate(t);let o=n.length;return r>=n[o-1]?i[o-1].evaluate(t):i[nm(n,r)].evaluate(t)}eachChild(t){for(let n of(t(this.input),this.outputs))t(n)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}var nv,nb,ny=function(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}(function(){if(nb)return nv;function t(t,n,i,r){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*n,this.by=3*(r-n)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=i,this.p2y=r}return nb=1,nv=t,t.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,n){if(void 0===n&&(n=1e-6),t<0)return 0;if(t>1)return 1;for(var i=t,r=0;r<8;r++){var o=this.sampleCurveX(i)-t;if(Math.abs(o)<n)return i;var a=this.sampleCurveDerivativeX(i);if(1e-6>Math.abs(a))break;i-=o/a}var s=0,l=1;for(i=t,r=0;r<20&&!(Math.abs((o=this.sampleCurveX(i))-t)<n);r++)t>o?s=i:l=i,i=.5*(l-s)+s;return i},solve:function(t,n){return this.sampleCurveY(this.solveCurveX(t,n))}},nv}());class n_{constructor(t,n,i,r,o){for(const[a,s]of(this.type=t,this.operator=n,this.interpolation=i,this.input=r,this.labels=[],this.outputs=[],o))this.labels.push(a),this.outputs.push(s)}static interpolationFactor(t,n,i,r){let o=0;if("exponential"===t.name)o=nx(n,t.base,i,r);else if("linear"===t.name)o=nx(n,1,i,r);else if("cubic-bezier"===t.name){let a=t.controlPoints;o=new ny(a[0],a[1],a[2],a[3]).solve(nx(n,1,i,r))}return o}static parse(t,n){let[i,r,o,...a]=t;if(!Array.isArray(r)||0===r.length)return n.error("Expected an interpolation type expression.",1);if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){let t=r[1];if("number"!=typeof t)return n.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:t}}else{if("cubic-bezier"!==r[0])return n.error(`Unknown interpolation type ${String(r[0])}`,1,0);{let t=r.slice(1);if(4!==t.length||t.some(t=>"number"!=typeof t||t<0||t>1))return n.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return n.error("Expected an even number of arguments.");if(!(o=n.parse(o,2,tt)))return null;let s=[],l=null;"interpolate-hcl"!==i&&"interpolate-lab"!==i||n.expectedType==td?n.expectedType&&"value"!==n.expectedType.kind&&(l=n.expectedType):l=tr;for(let t=0;t<a.length;t+=2){let i=a[t],r=a[t+1],o=t+3,c=t+4;if("number"!=typeof i)return n.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',o);if(s.length&&s[s.length-1][0]>=i)return n.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',o);let u=n.parse(r,c,l);if(!u)return null;l=l||u.type,s.push([i,u])}return tx(l,tt)||tx(l,to)||tx(l,tr)||tx(l,tu)||tx(l,th)||tx(l,td)||tx(l,tf)||tx(l,tm(tt))?new n_(l,i,r,o,s):n.error(`Type ${tg(l)} is not interpolatable.`)}evaluate(t){let n=this.labels,i=this.outputs;if(1===n.length)return i[0].evaluate(t);let r=this.input.evaluate(t);if(r<=n[0])return i[0].evaluate(t);let o=n.length;if(r>=n[o-1])return i[o-1].evaluate(t);let a=nm(n,r),s=n_.interpolationFactor(this.interpolation,r,n[a],n[a+1]),l=i[a].evaluate(t),c=i[a+1].evaluate(t);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return tH(l,c,s);case"color":return tW.interpolate(l,c,s);case"padding":return tK.interpolate(l,c,s);case"colorArray":return tQ.interpolate(l,c,s);case"numberArray":return tJ.interpolate(l,c,s);case"variableAnchorOffsetCollection":return t2.interpolate(l,c,s);case"array":return tq(l,c,s);case"projectionDefinition":return t3.interpolate(l,c,s)}case"interpolate-hcl":switch(this.type.kind){case"color":return tW.interpolate(l,c,s,"hcl");case"colorArray":return tQ.interpolate(l,c,s,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return tW.interpolate(l,c,s,"lab");case"colorArray":return tQ.interpolate(l,c,s,"lab")}}}eachChild(t){for(let n of(t(this.input),this.outputs))t(n)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function nx(t,n,i,r){let o=r-i,a=t-i;return 0===o?0:1===n?a/o:(Math.pow(n,a)-1)/(Math.pow(n,o)-1)}let nw={color:tW.interpolate,number:tH,padding:tK.interpolate,numberArray:tJ.interpolate,colorArray:tQ.interpolate,variableAnchorOffsetCollection:t2.interpolate,array:tq};class nk{constructor(t,n){this.type=t,this.args=n}static parse(t,n){if(t.length<2)return n.error("Expected at least one argument.");let i=null,r=n.expectedType;r&&"value"!==r.kind&&(i=r);let o=[];for(let r of t.slice(1)){let t=n.parse(r,1+o.length,i,void 0,{typeAnnotation:"omit"});if(!t)return null;i=i||t.type,o.push(t)}if(!i)throw Error("No output type");return new nk(r&&o.some(t=>tb(r,t.type))?ts:i,o)}evaluate(t){let n,i=null,r=0;for(let o of this.args)if(r++,(i=o.evaluate(t))&&i instanceof t5&&!i.available&&(n||(n=i.name),i=null,r===this.args.length&&(i=n)),null!==i)break;return i}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}function nC(t,n){return"=="===t||"!="===t?"boolean"===n.kind||"string"===n.kind||"number"===n.kind||"null"===n.kind||"value"===n.kind:"string"===n.kind||"number"===n.kind||"value"===n.kind}function nA(t,n,i,r){return 0===r.compare(n,i)}function nE(t,n,i){let r="=="!==t&&"!="!==t;return class o{constructor(t,n,i){this.type=ti,this.lhs=t,this.rhs=n,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===n.type.kind}static parse(t,n){if(3!==t.length&&4!==t.length)return n.error("Expected two or three arguments.");let i=t[0],a=n.parse(t[1],1,ts);if(!a)return null;if(!nC(i,a.type))return n.concat(1).error(`"${i}" comparisons are not supported for type '${tg(a.type)}'.`);let s=n.parse(t[2],2,ts);if(!s)return null;if(!nC(i,s.type))return n.concat(2).error(`"${i}" comparisons are not supported for type '${tg(s.type)}'.`);if(a.type.kind!==s.type.kind&&"value"!==a.type.kind&&"value"!==s.type.kind)return n.error(`Cannot compare types '${tg(a.type)}' and '${tg(s.type)}'.`);r&&("value"===a.type.kind&&"value"!==s.type.kind?a=new nt(s.type,[a]):"value"!==a.type.kind&&"value"===s.type.kind&&(s=new nt(a.type,[s])));let l=null;if(4===t.length){if("string"!==a.type.kind&&"string"!==s.type.kind&&"value"!==a.type.kind&&"value"!==s.type.kind)return n.error("Cannot use collator to compare non-string types.");if(!(l=n.parse(t[3],3,tl)))return null}return new o(a,s,l)}evaluate(o){let a=this.lhs.evaluate(o),s=this.rhs.evaluate(o);if(r&&this.hasUntypedArgument){let n=t8(a),i=t8(s);if(n.kind!==i.kind||"string"!==n.kind&&"number"!==n.kind)throw new t0(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${n.kind}, ${i.kind}) instead.`)}if(this.collator&&!r&&this.hasUntypedArgument){let t=t8(a),i=t8(s);if("string"!==t.kind||"string"!==i.kind)return n(o,a,s)}return this.collator?i(o,a,s,this.collator.evaluate(o)):n(o,a,s)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}}}let nS=nE("==",function(t,n,i){return n===i},nA),nT=nE("!=",function(t,n,i){return n!==i},function(t,n,i,r){return!nA(0,n,i,r)}),nO=nE("<",function(t,n,i){return n<i},function(t,n,i,r){return 0>r.compare(n,i)}),nF=nE(">",function(t,n,i){return n>i},function(t,n,i,r){return r.compare(n,i)>0}),nM=nE("<=",function(t,n,i){return n<=i},function(t,n,i,r){return 0>=r.compare(n,i)}),nI=nE(">=",function(t,n,i){return n>=i},function(t,n,i,r){return r.compare(n,i)>=0});class nR{constructor(t,n,i){this.type=tl,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=n}static parse(t,n){if(2!==t.length)return n.error("Expected one argument.");let i=t[1];if("object"!=typeof i||Array.isArray(i))return n.error("Collator options argument must be an object.");let r=n.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,ti);if(!r)return null;let o=n.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,ti);if(!o)return null;let a=null;return!i.locale||(a=n.parse(i.locale,1,tn))?new nR(r,o,a):null}evaluate(t){return new tG(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}}class nD{constructor(t,n,i,r,o){this.type=tn,this.number=t,this.locale=n,this.currency=i,this.minFractionDigits=r,this.maxFractionDigits=o}static parse(t,n){if(3!==t.length)return n.error("Expected two arguments.");let i=n.parse(t[1],1,tt);if(!i)return null;let r=t[2];if("object"!=typeof r||Array.isArray(r))return n.error("NumberFormat options argument must be an object.");let o=null;if(r.locale&&!(o=n.parse(r.locale,1,tn)))return null;let a=null;if(r.currency&&!(a=n.parse(r.currency,1,tn)))return null;let s=null;if(r["min-fraction-digits"]&&!(s=n.parse(r["min-fraction-digits"],1,tt)))return null;let l=null;return!r["max-fraction-digits"]||(l=n.parse(r["max-fraction-digits"],1,tt))?new nD(i,o,a,s,l):null}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}}class nP{constructor(t){this.type=tc,this.sections=t}static parse(t,n){if(t.length<2)return n.error("Expected at least one argument.");let i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return n.error("First argument must be an image or text section.");let r=[],o=!1;for(let i=1;i<=t.length-1;++i){let a=t[i];if(o&&"object"==typeof a&&!Array.isArray(a)){o=!1;let t=null;if(a["font-scale"]&&!(t=n.parse(a["font-scale"],1,tt)))return null;let i=null;if(a["text-font"]&&!(i=n.parse(a["text-font"],1,tm(tn))))return null;let s=null;if(a["text-color"]&&!(s=n.parse(a["text-color"],1,tr)))return null;let l=null;if(a["vertical-align"]){if("string"==typeof a["vertical-align"]&&!tY.includes(a["vertical-align"]))return n.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${a["vertical-align"]}' instead.`);if(!(l=n.parse(a["vertical-align"],1,tn)))return null}let c=r[r.length-1];c.scale=t,c.font=i,c.textColor=s,c.verticalAlign=l}else{let a=n.parse(t[i],1,ts);if(!a)return null;let s=a.type.kind;if("string"!==s&&"value"!==s&&"null"!==s&&"resolvedImage"!==s)return n.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");o=!0,r.push({content:a,scale:null,font:null,textColor:null,verticalAlign:null})}}return new nP(r)}evaluate(t){return new tX(this.sections.map(n=>{let i=n.content.evaluate(t);return t8(i)===tp?new tZ("",i,null,null,null,n.verticalAlign?n.verticalAlign.evaluate(t):null):new tZ(t7(i),null,n.scale?n.scale.evaluate(t):null,n.font?n.font.evaluate(t).join(","):null,n.textColor?n.textColor.evaluate(t):null,n.verticalAlign?n.verticalAlign.evaluate(t):null)}))}eachChild(t){for(let n of this.sections)t(n.content),n.scale&&t(n.scale),n.font&&t(n.font),n.textColor&&t(n.textColor),n.verticalAlign&&t(n.verticalAlign)}outputDefined(){return!1}}class nL{constructor(t){this.type=tp,this.input=t}static parse(t,n){if(2!==t.length)return n.error("Expected two arguments.");let i=n.parse(t[1],1,tn);return i?new nL(i):n.error("No image name provided.")}evaluate(t){let n=this.input.evaluate(t),i=t5.fromString(n);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(n)>-1),i}eachChild(t){t(this.input)}outputDefined(){return!1}}class nN{constructor(t){this.type=tt,this.input=t}static parse(t,n){if(2!==t.length)return n.error(`Expected 1 argument, but found ${t.length-1} instead.`);let i=n.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?n.error(`Expected argument of type string or array, but found ${tg(i.type)} instead.`):new nN(i):null}evaluate(t){let n=this.input.evaluate(t);if("string"==typeof n)return[...n].length;if(Array.isArray(n))return n.length;throw new t0(`Expected value to be of type string or array, but found ${tg(t8(n))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}}let nz=8192;function nj(t,n){let i=(180+t[0])/360,r=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,o=Math.pow(2,n.z);return[Math.round(i*o*nz),Math.round(r*o*nz)]}function nB(t,n){let i=Math.pow(2,n.z);return[360*((t[0]/nz+n.x)/i)-180,360/Math.PI*Math.atan(Math.exp((180-360*((t[1]/nz+n.y)/i))*Math.PI/180))-90]}function n$(t,n){t[0]=Math.min(t[0],n[0]),t[1]=Math.min(t[1],n[1]),t[2]=Math.max(t[2],n[0]),t[3]=Math.max(t[3],n[1])}function nU(t,n){return!(t[0]<=n[0]||t[2]>=n[2]||t[1]<=n[1]||t[3]>=n[3])}function nV(t,n,i){let r=t[0]-n[0],o=t[1]-n[1],a=t[0]-i[0],s=t[1]-i[1];return r*s-a*o==0&&r*a<=0&&o*s<=0}function nH(t,n,i,r){var o,a;return 0!=(o=[r[0]-i[0],r[1]-i[1]])[0]*(a=[n[0]-t[0],n[1]-t[1]])[1]-o[1]*a[0]&&!(!nX(t,n,i,r)||!nX(i,r,t,n))}function nq(t,n,i){for(let r of i)for(let i=0;i<r.length-1;++i)if(nH(t,n,r[i],r[i+1]))return!0;return!1}function nW(t,n,i=!1){var r,o,a;let s=!1;for(let l of n)for(let n=0;n<l.length-1;n++){if(nV(t,l[n],l[n+1]))return i;(o=l[n])[1]>(r=t)[1]!=(a=l[n+1])[1]>r[1]&&r[0]<(a[0]-o[0])*(r[1]-o[1])/(a[1]-o[1])+o[0]&&(s=!s)}return s}function nG(t,n){for(let i of n)if(nW(t,i))return!0;return!1}function nY(t,n){for(let i of t)if(!nW(i,n))return!1;for(let i=0;i<t.length-1;++i)if(nq(t[i],t[i+1],n))return!1;return!0}function nZ(t,n){for(let i of n)if(nY(t,i))return!0;return!1}function nX(t,n,i,r){let o=r[0]-i[0],a=r[1]-i[1],s=(t[0]-i[0])*a-o*(t[1]-i[1]),l=(n[0]-i[0])*a-o*(n[1]-i[1]);return s>0&&l<0||s<0&&l>0}function nK(t,n,i){let r=[];for(let o=0;o<t.length;o++){let a=[];for(let r=0;r<t[o].length;r++){let s=nj(t[o][r],i);n$(n,s),a.push(s)}r.push(a)}return r}function nJ(t,n,i){let r=[];for(let o=0;o<t.length;o++){let a=nK(t[o],n,i);r.push(a)}return r}function nQ(t,n,i,r){if(t[0]<i[0]||t[0]>i[2]){let n=.5*r,o=t[0]-i[0]>n?-r:i[0]-t[0]>n?r:0;0===o&&(o=t[0]-i[2]>n?-r:i[2]-t[0]>n?r:0),t[0]+=o}n$(n,t)}function n0(t,n,i,r){let o=Math.pow(2,r.z)*nz,a=[r.x*nz,r.y*nz],s=[];for(let r of t)for(let t of r){let r=[t.x+a[0],t.y+a[1]];nQ(r,n,i,o),s.push(r)}return s}function n1(t,n,i,r){var o;let a=Math.pow(2,r.z)*nz,s=[r.x*nz,r.y*nz],l=[];for(let i of t){let t=[];for(let r of i){let i=[r.x+s[0],r.y+s[1]];n$(n,i),t.push(i)}l.push(t)}if(n[2]-n[0]<=a/2)for(let t of((o=n)[0]=o[1]=1/0,o[2]=o[3]=-1/0,l))for(let r of t)nQ(r,n,i,a);return l}class n2{constructor(t,n){this.type=ti,this.geojson=t,this.geometries=n}static parse(t,n){if(2!==t.length)return n.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(t6(t[1])){let n=t[1];if("FeatureCollection"===n.type){let t=[];for(let i of n.features){let{type:n,coordinates:r}=i.geometry;"Polygon"===n&&t.push(r),"MultiPolygon"===n&&t.push(...r)}if(t.length)return new n2(n,{type:"MultiPolygon",coordinates:t})}else if("Feature"===n.type){let t=n.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new n2(n,n.geometry)}else if("Polygon"===n.type||"MultiPolygon"===n.type)return new n2(n,n)}return n.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,n){let i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],o=t.canonicalID();if("Polygon"===n.type){let a=nK(n.coordinates,r,o),s=n0(t.geometry(),i,r,o);if(!nU(i,r))return!1;for(let t of s)if(!nW(t,a))return!1}if("MultiPolygon"===n.type){let a=nJ(n.coordinates,r,o),s=n0(t.geometry(),i,r,o);if(!nU(i,r))return!1;for(let t of s)if(!nG(t,a))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,n){let i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],o=t.canonicalID();if("Polygon"===n.type){let a=nK(n.coordinates,r,o),s=n1(t.geometry(),i,r,o);if(!nU(i,r))return!1;for(let t of s)if(!nY(t,a))return!1}if("MultiPolygon"===n.type){let a=nJ(n.coordinates,r,o),s=n1(t.geometry(),i,r,o);if(!nU(i,r))return!1;for(let t of s)if(!nZ(t,a))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let n5=class{constructor(t=[],n=(t,n)=>t<n?-1:+(t>n)){if(this.data=t,this.length=this.data.length,this.compare=n,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(0===this.length)return;let t=this.data[0],n=this.data.pop();return--this.length>0&&(this.data[0]=n,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:n,compare:i}=this,r=n[t];for(;t>0;){let o=t-1>>1,a=n[o];if(i(r,a)>=0)break;n[t]=a,t=o}n[t]=r}_down(t){let{data:n,compare:i}=this,r=this.length>>1,o=n[t];for(;t<r;){let r=1+(t<<1),a=r+1;if(a<this.length&&0>i(n[a],n[r])&&(r=a),i(n[r],o)>=0)break;n[t]=n[r],t=r}n[t]=o}};function n3(t,n,i=0,r=t.length-1,o=n6){for(;r>i;){if(r-i>600){let a=r-i+1,s=n-i+1,l=Math.log(a),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(a-c)/a)*(s-a/2<0?-1:1);n3(t,n,Math.max(i,Math.floor(n-s*c/a+u)),Math.min(r,Math.floor(n+(a-s)*c/a+u)),o)}let a=t[n],s=i,l=r;for(n4(t,i,n),o(t[r],a)>0&&n4(t,i,r);s<l;){for(n4(t,s,l),s++,l--;0>o(t[s],a);)s++;for(;o(t[l],a)>0;)l--}0===o(t[i],a)?n4(t,i,l):n4(t,++l,r),l<=n&&(i=l+1),n<=l&&(r=l-1)}}function n4(t,n,i){let r=t[n];t[n]=t[i],t[i]=r}function n6(t,n){return t<n?-1:+(t>n)}function n8(t,n){let i,r;if(t.length<=1)return[t];let o=[];for(let n of t){let t=n9(n);0!==t&&(n.area=Math.abs(t),void 0===r&&(r=t<0),r===t<0?(i&&o.push(i),i=[n]):i.push(n))}if(i&&o.push(i),n>1)for(let t=0;t<o.length;t++)o[t].length<=n||(n3(o[t],n,1,o[t].length-1,n7),o[t]=o[t].slice(0,n));return o}function n7(t,n){return n.area-t.area}function n9(t){let n=0;for(let i,r,o=0,a=t.length,s=a-1;o<a;s=o++)i=t[o],n+=((r=t[s]).x-i.x)*(i.y+r.y);return n}let ie=1/298.257223563*(2-1/298.257223563),it=Math.PI/180;class ii{constructor(t){const n=6378.137*it*1e3,i=Math.cos(t*it),r=1/(1-ie*(1-i*i)),o=Math.sqrt(r);this.kx=n*o*i,this.ky=n*o*r*(1-ie)}distance(t,n){let i=this.wrap(t[0]-n[0])*this.kx,r=(t[1]-n[1])*this.ky;return Math.sqrt(i*i+r*r)}pointOnLine(t,n){let i,r,o,a,s=1/0;for(let l=0;l<t.length-1;l++){let c=t[l][0],u=t[l][1],d=this.wrap(t[l+1][0]-c)*this.kx,h=(t[l+1][1]-u)*this.ky,p=0;0===d&&0===h||((p=(this.wrap(n[0]-c)*this.kx*d+(n[1]-u)*this.ky*h)/(d*d+h*h))>1?(c=t[l+1][0],u=t[l+1][1]):p>0&&(c+=d/this.kx*p,u+=h/this.ky*p));let f=(d=this.wrap(n[0]-c)*this.kx)*d+(h=(n[1]-u)*this.ky)*h;f<s&&(s=f,i=c,r=u,o=l,a=p)}return{point:[i,r],index:o,t:Math.max(0,Math.min(1,a))}}wrap(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}}function ir(t,n){return n[0]-t[0]}function io(t){return t[1]-t[0]+1}function ia(t,n){return t[1]>=t[0]&&t[1]<n}function is(t,n){if(t[0]>t[1])return[null,null];let i=io(t);if(n){if(2===i)return[t,null];let n=Math.floor(i/2);return[[t[0],t[0]+n],[t[0]+n,t[1]]]}if(1===i)return[t,null];let r=Math.floor(i/2)-1;return[[t[0],t[0]+r],[t[0]+r+1,t[1]]]}function il(t,n){if(!ia(n,t.length))return[1/0,1/0,-1/0,-1/0];let i=[1/0,1/0,-1/0,-1/0];for(let r=n[0];r<=n[1];++r)n$(i,t[r]);return i}function ic(t){let n=[1/0,1/0,-1/0,-1/0];for(let i of t)for(let t of i)n$(n,t);return n}function iu(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function id(t,n,i){if(!iu(t)||!iu(n))return NaN;let r=0,o=0;return t[2]<n[0]&&(r=n[0]-t[2]),t[0]>n[2]&&(r=t[0]-n[2]),t[1]>n[3]&&(o=t[1]-n[3]),t[3]<n[1]&&(o=n[1]-t[3]),i.distance([0,0],[r,o])}function ih(t,n,i){let r=i.pointOnLine(n,t);return i.distance(t,r.point)}function ip(t,n,i,r,o){return Math.min(Math.min(ih(t,[i,r],o),ih(n,[i,r],o)),Math.min(ih(i,[t,n],o),ih(r,[t,n],o)))}function im(t,n,i,r,o){if(!ia(n,t.length)||!ia(r,i.length))return 1/0;let a=1/0;for(let s=n[0];s<n[1];++s){let n=t[s],l=t[s+1];for(let t=r[0];t<r[1];++t){let r=i[t],s=i[t+1];if(nH(n,l,r,s))return 0;a=Math.min(a,ip(n,l,r,s,o))}}return a}function ig(t,n,i,r,o){if(!ia(n,t.length)||!ia(r,i.length))return NaN;let a=1/0;for(let s=n[0];s<=n[1];++s)for(let n=r[0];n<=r[1];++n)if(0===(a=Math.min(a,o.distance(t[s],i[n]))))return a;return a}function iv(t,n,i){if(nW(t,n,!0))return 0;let r=1/0;for(let o of n){let n=o[0],a=o[o.length-1];if(n!==a&&0===(r=Math.min(r,ih(t,[a,n],i))))break;let s=i.pointOnLine(o,t);if(0===(r=Math.min(r,i.distance(t,s.point))))break}return r}function ib(t,n,i,r){if(!ia(n,t.length))return NaN;for(let r=n[0];r<=n[1];++r)if(nW(t[r],i,!0))return 0;let o=1/0;for(let a=n[0];a<n[1];++a){let n=t[a],s=t[a+1];for(let t of i)for(let i=0,a=t.length,l=a-1;i<a;l=i++){let a=t[l],c=t[i];if(nH(n,s,a,c))return 0;o=Math.min(o,ip(n,s,a,c,r))}}return o}function iy(t,n){for(let i of t)for(let t of i)if(nW(t,n,!0))return!0;return!1}function i_(t,n,i,r=1/0){let o=ic(t),a=ic(n);if(r!==1/0&&id(o,a,i)>=r)return r;if(nU(o,a)){if(iy(t,n))return 0}else if(iy(n,t))return 0;let s=1/0;for(let r of t)for(let t=0,o=r.length,a=o-1;t<o;a=t++){let o=r[a],l=r[t];for(let t of n)for(let n=0,r=t.length,a=r-1;n<r;a=n++){let r=t[a],c=t[n];if(nH(o,l,r,c))return 0;s=Math.min(s,ip(o,l,r,c,i))}}return s}function ix(t,n,i,r,o,a){if(!a)return;let s=id(il(r,a),o,i);s<n&&t.push([s,a,[0,0]])}function iw(t,n,i,r,o,a,s){if(!a||!s)return;let l=id(il(r,a),il(o,s),i);l<n&&t.push([l,a,s])}function ik(t,n,i,r,o=1/0){let a=Math.min(r.distance(t[0],i[0][0]),o);if(0===a)return a;let s=new n5([[0,[0,t.length-1],[0,0]]],ir),l=ic(i);for(;s.length>0;){let o=s.pop();if(o[0]>=a)continue;let c=o[1],u=n?50:100;if(io(c)<=u){if(!ia(c,t.length))return NaN;if(n){let n=ib(t,c,i,r);if(isNaN(n)||0===n)return n;a=Math.min(a,n)}else for(let n=c[0];n<=c[1];++n)if(0===(a=Math.min(a,iv(t[n],i,r))))return 0}else{let i=is(c,n);ix(s,a,r,t,l,i[0]),ix(s,a,r,t,l,i[1])}}return a}function iC(t,n,i,r,o,a=1/0){let s=Math.min(a,o.distance(t[0],i[0]));if(0===s)return s;let l=new n5([[0,[0,t.length-1],[0,i.length-1]]],ir);for(;l.length>0;){let a=l.pop();if(a[0]>=s)continue;let c=a[1],u=a[2],d=n?50:100,h=r?50:100;if(io(c)<=d&&io(u)<=h){let a;if(!ia(c,t.length)&&ia(u,i.length))return NaN;if(n&&r)s=Math.min(s,a=im(t,c,i,u,o));else if(n&&!r){let n=t.slice(c[0],c[1]+1);for(let t=u[0];t<=u[1];++t)if(0===(s=Math.min(s,a=ih(i[t],n,o))))return s}else if(!n&&r){let n=i.slice(u[0],u[1]+1);for(let i=c[0];i<=c[1];++i)if(0===(s=Math.min(s,a=ih(t[i],n,o))))return s}else s=Math.min(s,a=ig(t,c,i,u,o))}else{let a=is(c,n),d=is(u,r);iw(l,s,o,t,i,a[0],d[0]),iw(l,s,o,t,i,a[0],d[1]),iw(l,s,o,t,i,a[1],d[0]),iw(l,s,o,t,i,a[1],d[1])}}return s}function iA(t){return"MultiPolygon"===t.type?t.coordinates.map(t=>({type:"Polygon",coordinates:t})):"MultiLineString"===t.type?t.coordinates.map(t=>({type:"LineString",coordinates:t})):"MultiPoint"===t.type?t.coordinates.map(t=>({type:"Point",coordinates:t})):[t]}class iE{constructor(t,n){this.type=tt,this.geojson=t,this.geometries=n}static parse(t,n){if(2!==t.length)return n.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(t6(t[1])){let n=t[1];if("FeatureCollection"===n.type)return new iE(n,n.features.map(t=>iA(t.geometry)).flat());if("Feature"===n.type)return new iE(n,iA(n.geometry));if("type"in n&&"coordinates"in n)return new iE(n,iA(n))}return n.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,n){let i=t.geometry(),r=i.flat().map(n=>nB([n.x,n.y],t.canonical));if(0===i.length)return NaN;let o=new ii(r[0][1]),a=1/0;for(let t of n){switch(t.type){case"Point":a=Math.min(a,iC(r,!1,[t.coordinates],!1,o,a));break;case"LineString":a=Math.min(a,iC(r,!1,t.coordinates,!0,o,a));break;case"Polygon":a=Math.min(a,ik(r,!1,t.coordinates,o,a))}if(0===a)break}return a}(t,this.geometries);if("LineString"===t.geometryType())return function(t,n){let i=t.geometry(),r=i.flat().map(n=>nB([n.x,n.y],t.canonical));if(0===i.length)return NaN;let o=new ii(r[0][1]),a=1/0;for(let t of n){switch(t.type){case"Point":a=Math.min(a,iC(r,!0,[t.coordinates],!1,o,a));break;case"LineString":a=Math.min(a,iC(r,!0,t.coordinates,!0,o,a));break;case"Polygon":a=Math.min(a,ik(r,!0,t.coordinates,o,a))}if(0===a)break}return a}(t,this.geometries);if("Polygon"===t.geometryType())return function(t,n){let i=t.geometry();if(0===i.length||0===i[0].length)return NaN;let r=n8(i,0).map(n=>n.map(n=>n.map(n=>nB([n.x,n.y],t.canonical)))),o=new ii(r[0][0][0][1]),a=1/0;for(let t of n)for(let n of r){switch(t.type){case"Point":a=Math.min(a,ik([t.coordinates],!1,n,o,a));break;case"LineString":a=Math.min(a,ik(t.coordinates,!0,n,o,a));break;case"Polygon":a=Math.min(a,i_(n,t.coordinates,o,a))}if(0===a)return a}return a}(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class iS{constructor(t){this.type=ts,this.key=t}static parse(t,n){if(2!==t.length)return n.error(`Expected 1 argument, but found ${t.length-1} instead.`);let i=t[1];return null==i?n.error("Global state property must be defined."):"string"!=typeof i?n.error(`Global state property must be string, but found ${typeof t[1]} instead.`):new iS(i)}evaluate(t){var n;let i=null==(n=t.globals)?void 0:n.globalState;return i&&0!==Object.keys(i).length?tz(i,this.key):null}eachChild(){}outputDefined(){return!1}}let iT={"==":nS,"!=":nT,">":nF,"<":nO,">=":nI,"<=":nM,array:nt,at:nc,boolean:nt,case:np,coalesce:nk,collator:nR,format:nP,image:nL,in:nu,"index-of":nd,interpolate:n_,"interpolate-hcl":n_,"interpolate-lab":n_,length:nN,let:ns,literal:t9,match:nh,number:nt,"number-format":nD,object:nt,slice:nf,step:ng,string:nt,"to-boolean":ni,"to-color":ni,"to-number":ni,"to-string":ni,var:nl,within:n2,distance:iE,"global-state":iS};class iO{constructor(t,n,i,r){this.name=t,this.type=n,this._evaluate=i,this.args=r}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,n){let i=t[0],r=iO.definitions[i];if(!r)return n.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);let o=Array.isArray(r)?r[0]:r.type,a=Array.isArray(r)?[[r[1],r[2]]]:r.overloads,s=a.filter(([n])=>!Array.isArray(n)||n.length===t.length-1),l=null;for(let[r,a]of s){l=new na(n.registry,iD,n.path,null,n.scope);let s=[],c=!1;for(let n=1;n<t.length;n++){let i=t[n],o=Array.isArray(r)?r[n-1]:r.type,a=l.parse(i,1+s.length,o);if(!a){c=!0;break}s.push(a)}if(!c)if(Array.isArray(r)&&r.length!==s.length)l.error(`Expected ${r.length} arguments, but found ${s.length} instead.`);else{for(let t=0;t<s.length;t++){let n=Array.isArray(r)?r[t]:r.type,i=s[t];l.concat(t+1).checkSubtype(n,i.type)}if(0===l.errors.length)return new iO(i,o,a,s)}}if(1===s.length)n.errors.push(...l.errors);else{let i=(s.length?s:a).map(([t])=>{var n;return Array.isArray(n=t)?`(${n.map(tg).join(", ")})`:`(${tg(n.type)}...)`}).join(" | "),r=[];for(let i=1;i<t.length;i++){let o=n.parse(t[i],1+r.length);if(!o)return null;r.push(tg(o.type))}n.error(`Expected arguments of type ${i}, but found (${r.join(", ")}) instead.`)}return null}static register(t,n){for(let i in iO.definitions=n,n)t[i]=iO}}function iF(t,[n,i,r,o]){n=n.evaluate(t),i=i.evaluate(t),r=r.evaluate(t);let a=o?o.evaluate(t):1,s=t4(n,i,r,a);if(s)throw new t0(s);return new tW(n/255,i/255,r/255,a,!1)}function iM(t,n){return t in n}function iI(t,n){let i=n[t];return void 0===i?null:i}function iR(t){return{type:t}}function iD(t){if(t instanceof nl)return iD(t.boundExpression);if(t instanceof iO&&"error"===t.name||t instanceof nR||t instanceof n2||t instanceof iE||t instanceof iS)return!1;let n=t instanceof ni||t instanceof nt,i=!0;return t.eachChild(t=>{i=n?i&&iD(t):i&&t instanceof t9}),!!i&&iP(t)&&iN(t,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"])}function iP(t){if(t instanceof iO&&("get"===t.name&&1===t.args.length||"feature-state"===t.name||"has"===t.name&&1===t.args.length||"properties"===t.name||"geometry-type"===t.name||"id"===t.name||/^filter-/.test(t.name))||t instanceof n2||t instanceof iE)return!1;let n=!0;return t.eachChild(t=>{n&&!iP(t)&&(n=!1)}),n}function iL(t){if(t instanceof iO&&"feature-state"===t.name)return!1;let n=!0;return t.eachChild(t=>{n&&!iL(t)&&(n=!1)}),n}function iN(t,n){if(t instanceof iO&&n.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild(t=>{i&&!iN(t,n)&&(i=!1)}),i}function iz(t){return{result:"success",value:t}}function ij(t){return{result:"error",value:t}}function iB(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function i$(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function iU(t){return!!t.expression&&t.expression.interpolated}function iV(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function iH(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)&&t8(t)===ta}function iq(t){return t}function iW(t,n){var i;let r,o,a=t.stops&&"object"==typeof t.stops[0][0],s=a||!(a||void 0!==t.property),l=t.type||(iU(n)?"exponential":"interval"),c=function(t){switch(t.type){case"color":return tW.parse;case"padding":return tK.parse;case"numberArray":return tJ.parse;case"colorArray":return tQ.parse;default:return null}}(n);if(c&&((t=e8({},t)).stops&&(t.stops=t.stops.map(t=>[t[0],c(t[1])])),t.default=c(t.default?t.default:n.default)),t.colorSpace&&"rgb"!==(i=t.colorSpace)&&"hcl"!==i&&"lab"!==i)throw Error(`Unknown color space: "${t.colorSpace}"`);let u=function(t){switch(t){case"exponential":return iX;case"interval":return iZ;case"categorical":return iY;case"identity":return iK;default:throw Error(`Unknown function type "${t}"`)}}(l);if("categorical"===l){for(let n of(r=Object.create(null),t.stops))r[n[0]]=n[1];o=typeof t.stops[0][0]}if(a){let i={},r=[];for(let n=0;n<t.stops.length;n++){let o=t.stops[n],a=o[0].zoom;void 0===i[a]&&(i[a]={zoom:a,type:t.type,property:t.property,default:t.default,stops:[]},r.push(a)),i[a].stops.push([o[0].value,o[1]])}let o=[];for(let t of r)o.push([i[t].zoom,iW(i[t],n)]);let a={name:"linear"};return{kind:"composite",interpolationType:a,interpolationFactor:n_.interpolationFactor.bind(void 0,a),zoomStops:o.map(t=>t[0]),evaluate:({zoom:i},r)=>iX({stops:o,base:t.base},n,i).evaluate(i,r)}}if(s){let i="exponential"===l?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return{kind:"camera",interpolationType:i,interpolationFactor:n_.interpolationFactor.bind(void 0,i),zoomStops:t.stops.map(t=>t[0]),evaluate:({zoom:i})=>u(t,n,i,r,o)}}return{kind:"source",evaluate(i,a){let s=a&&a.properties?a.properties[t.property]:void 0;return void 0===s?iG(t.default,n.default):u(t,n,s,r,o)}}}function iG(t,n,i){return void 0!==t?t:void 0!==n?n:void 0!==i?i:void 0}function iY(t,n,i,r,o){return iG(typeof i===o?r[i]:void 0,t.default,n.default)}function iZ(t,n,i){if("number"!==iV(i))return iG(t.default,n.default);let r=t.stops.length;if(1===r||i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[r-1][0])return t.stops[r-1][1];let o=nm(t.stops.map(t=>t[0]),i);return t.stops[o][1]}function iX(t,n,i){let r=void 0!==t.base?t.base:1;if("number"!==iV(i))return iG(t.default,n.default);let o=t.stops.length;if(1===o||i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[o-1][0])return t.stops[o-1][1];let a=nm(t.stops.map(t=>t[0]),i),s=function(t,n,i,r){let o=r-i,a=t-i;return 0===o?0:1===n?a/o:(Math.pow(n,a)-1)/(Math.pow(n,o)-1)}(i,r,t.stops[a][0],t.stops[a+1][0]),l=t.stops[a][1],c=t.stops[a+1][1],u=nw[n.type]||iq;return"function"==typeof l.evaluate?{evaluate(...n){let i=l.evaluate.apply(void 0,n),r=c.evaluate.apply(void 0,n);if(void 0!==i&&void 0!==r)return u(i,r,s,t.colorSpace)}}:u(l,c,s,t.colorSpace)}function iK(t,n,i){switch(n.type){case"color":i=tW.parse(i);break;case"formatted":i=tX.fromString(i.toString());break;case"resolvedImage":i=t5.fromString(i.toString());break;case"padding":i=tK.parse(i);break;case"colorArray":i=tQ.parse(i);break;case"numberArray":i=tJ.parse(i);break;default:iV(i)===n.type||"enum"===n.type&&n.values[i]||(i=void 0)}return iG(i,t.default,n.default)}iO.register(iT,{error:[{kind:"error"},[tn],(t,[n])=>{throw new t0(n.evaluate(t))}],typeof:[tn,[ts],(t,[n])=>tg(t8(n.evaluate(t)))],"to-rgba":[tm(tt,4),[tr],(t,[n])=>{let[i,r,o,a]=n.evaluate(t).rgb;return[255*i,255*r,255*o,a]}],rgb:[tr,[tt,tt,tt],iF],rgba:[tr,[tt,tt,tt,tt],iF],has:{type:ti,overloads:[[[tn],(t,[n])=>iM(n.evaluate(t),t.properties())],[[tn,ta],(t,[n,i])=>iM(n.evaluate(t),i.evaluate(t))]]},get:{type:ts,overloads:[[[tn],(t,[n])=>iI(n.evaluate(t),t.properties())],[[tn,ta],(t,[n,i])=>iI(n.evaluate(t),i.evaluate(t))]]},"feature-state":[ts,[tn],(t,[n])=>iI(n.evaluate(t),t.featureState||{})],properties:[ta,[],t=>t.properties()],"geometry-type":[tn,[],t=>t.geometryType()],id:[ts,[],t=>t.id()],zoom:[tt,[],t=>t.globals.zoom],"heatmap-density":[tt,[],t=>t.globals.heatmapDensity||0],elevation:[tt,[],t=>t.globals.elevation||0],"line-progress":[tt,[],t=>t.globals.lineProgress||0],accumulated:[ts,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[tt,iR(tt),(t,n)=>{let i=0;for(let r of n)i+=r.evaluate(t);return i}],"*":[tt,iR(tt),(t,n)=>{let i=1;for(let r of n)i*=r.evaluate(t);return i}],"-":{type:tt,overloads:[[[tt,tt],(t,[n,i])=>n.evaluate(t)-i.evaluate(t)],[[tt],(t,[n])=>-n.evaluate(t)]]},"/":[tt,[tt,tt],(t,[n,i])=>n.evaluate(t)/i.evaluate(t)],"%":[tt,[tt,tt],(t,[n,i])=>n.evaluate(t)%i.evaluate(t)],ln2:[tt,[],()=>Math.LN2],pi:[tt,[],()=>Math.PI],e:[tt,[],()=>Math.E],"^":[tt,[tt,tt],(t,[n,i])=>Math.pow(n.evaluate(t),i.evaluate(t))],sqrt:[tt,[tt],(t,[n])=>Math.sqrt(n.evaluate(t))],log10:[tt,[tt],(t,[n])=>Math.log(n.evaluate(t))/Math.LN10],ln:[tt,[tt],(t,[n])=>Math.log(n.evaluate(t))],log2:[tt,[tt],(t,[n])=>Math.log(n.evaluate(t))/Math.LN2],sin:[tt,[tt],(t,[n])=>Math.sin(n.evaluate(t))],cos:[tt,[tt],(t,[n])=>Math.cos(n.evaluate(t))],tan:[tt,[tt],(t,[n])=>Math.tan(n.evaluate(t))],asin:[tt,[tt],(t,[n])=>Math.asin(n.evaluate(t))],acos:[tt,[tt],(t,[n])=>Math.acos(n.evaluate(t))],atan:[tt,[tt],(t,[n])=>Math.atan(n.evaluate(t))],min:[tt,iR(tt),(t,n)=>Math.min(...n.map(n=>n.evaluate(t)))],max:[tt,iR(tt),(t,n)=>Math.max(...n.map(n=>n.evaluate(t)))],abs:[tt,[tt],(t,[n])=>Math.abs(n.evaluate(t))],round:[tt,[tt],(t,[n])=>{let i=n.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[tt,[tt],(t,[n])=>Math.floor(n.evaluate(t))],ceil:[tt,[tt],(t,[n])=>Math.ceil(n.evaluate(t))],"filter-==":[ti,[tn,ts],(t,[n,i])=>t.properties()[n.value]===i.value],"filter-id-==":[ti,[ts],(t,[n])=>t.id()===n.value],"filter-type-==":[ti,[tn],(t,[n])=>t.geometryType()===n.value],"filter-<":[ti,[tn,ts],(t,[n,i])=>{let r=t.properties()[n.value],o=i.value;return typeof r==typeof o&&r<o}],"filter-id-<":[ti,[ts],(t,[n])=>{let i=t.id(),r=n.value;return typeof i==typeof r&&i<r}],"filter->":[ti,[tn,ts],(t,[n,i])=>{let r=t.properties()[n.value],o=i.value;return typeof r==typeof o&&r>o}],"filter-id->":[ti,[ts],(t,[n])=>{let i=t.id(),r=n.value;return typeof i==typeof r&&i>r}],"filter-<=":[ti,[tn,ts],(t,[n,i])=>{let r=t.properties()[n.value],o=i.value;return typeof r==typeof o&&r<=o}],"filter-id-<=":[ti,[ts],(t,[n])=>{let i=t.id(),r=n.value;return typeof i==typeof r&&i<=r}],"filter->=":[ti,[tn,ts],(t,[n,i])=>{let r=t.properties()[n.value],o=i.value;return typeof r==typeof o&&r>=o}],"filter-id->=":[ti,[ts],(t,[n])=>{let i=t.id(),r=n.value;return typeof i==typeof r&&i>=r}],"filter-has":[ti,[ts],(t,[n])=>n.value in t.properties()],"filter-has-id":[ti,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[ti,[tm(tn)],(t,[n])=>n.value.indexOf(t.geometryType())>=0],"filter-id-in":[ti,[tm(ts)],(t,[n])=>n.value.indexOf(t.id())>=0],"filter-in-small":[ti,[tn,tm(ts)],(t,[n,i])=>i.value.indexOf(t.properties()[n.value])>=0],"filter-in-large":[ti,[tn,tm(ts)],(t,[n,i])=>(function(t,n,i,r){for(;i<=r;){let o=i+r>>1;if(n[o]===t)return!0;n[o]>t?r=o-1:i=o+1}return!1})(t.properties()[n.value],i.value,0,i.value.length-1)],all:{type:ti,overloads:[[[ti,ti],(t,[n,i])=>n.evaluate(t)&&i.evaluate(t)],[iR(ti),(t,n)=>{for(let i of n)if(!i.evaluate(t))return!1;return!0}]]},any:{type:ti,overloads:[[[ti,ti],(t,[n,i])=>n.evaluate(t)||i.evaluate(t)],[iR(ti),(t,n)=>{for(let i of n)if(i.evaluate(t))return!0;return!1}]]},"!":[ti,[ti],(t,[n])=>!n.evaluate(t)],"is-supported-script":[ti,[tn],(t,[n])=>{let i=t.globals&&t.globals.isSupportedScript;return!i||i(n.evaluate(t))}],upcase:[tn,[tn],(t,[n])=>n.evaluate(t).toUpperCase()],downcase:[tn,[tn],(t,[n])=>n.evaluate(t).toLowerCase()],concat:[tn,iR(ts),(t,n)=>n.map(n=>t7(n.evaluate(t))).join("")],"resolved-locale":[tn,[tl],(t,[n])=>n.evaluate(t).resolvedLocale()]});class iJ{constructor(t,n,i){this.expression=t,this._warningHistory={},this._evaluator=new no,this._defaultValue=n?function(t){if("color"===t.type&&iH(t.default))return new tW(0,0,0,0);switch(t.type){case"color":return tW.parse(t.default)||null;case"padding":return tK.parse(t.default)||null;case"numberArray":return tJ.parse(t.default)||null;case"colorArray":return tQ.parse(t.default)||null;case"variableAnchorOffsetCollection":return t2.parse(t.default)||null;case"projectionDefinition":return t3.parse(t.default)||null;default:return void 0===t.default?null:t.default}}(n):null,this._enumValues=n&&"enum"===n.type?n.values:null,this._globalState=i}evaluateWithoutErrorHandling(t,n,i,r,o,a){return this._globalState&&(t=i8(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=n,this._evaluator.featureState=i,this._evaluator.canonical=r,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(t,n,i,r,o,a){this._globalState&&(t=i8(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=n||null,this._evaluator.featureState=i||null,this._evaluator.canonical=r,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a||null;try{let t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new t0(`Expected value to be one of ${Object.keys(this._enumValues).map(t=>JSON.stringify(t)).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"u">typeof console&&console.warn(t.message)),this._defaultValue}}}function iQ(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in iT}function i0(t,n,i){let r=new na(iT,iD,[],n?function(t){let n={color:tr,string:tn,number:tt,enum:tn,boolean:ti,formatted:tc,padding:tu,numberArray:th,colorArray:td,projectionDefinition:to,resolvedImage:tp,variableAnchorOffsetCollection:tf};return"array"===t.type?tm(n[t.value]||ts,t.length):n[t.type]}(n):void 0),o=r.parse(t,void 0,void 0,void 0,n&&"string"===n.type?{typeAnnotation:"coerce"}:void 0);return o?iz(new iJ(o,n,i)):ij(r.errors)}class i1{constructor(t,n,i){this.kind=t,this._styleExpression=n,this.isStateDependent="constant"!==t&&!iL(n.expression),this.globalStateRefs=i6(n.expression),this._globalState=i}evaluateWithoutErrorHandling(t,n,i,r,o,a){return this._globalState&&(t=i8(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,n,i,r,o,a)}evaluate(t,n,i,r,o,a){return this._globalState&&(t=i8(t,this._globalState)),this._styleExpression.evaluate(t,n,i,r,o,a)}}class i2{constructor(t,n,i,r,o){this.kind=t,this.zoomStops=i,this._styleExpression=n,this.isStateDependent="camera"!==t&&!iL(n.expression),this.globalStateRefs=i6(n.expression),this.interpolationType=r,this._globalState=o}evaluateWithoutErrorHandling(t,n,i,r,o,a){return this._globalState&&(t=i8(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,n,i,r,o,a)}evaluate(t,n,i,r,o,a){return this._globalState&&(t=i8(t,this._globalState)),this._styleExpression.evaluate(t,n,i,r,o,a)}interpolationFactor(t,n,i){return this.interpolationType?n_.interpolationFactor(this.interpolationType,t,n,i):0}}function i5(t,n,i){let r=i0(t,n,i);if("error"===r.result)return r;let o=r.value.expression,a=iP(o);if(!a&&!iB(n))return ij([new e7("","data expressions not supported")]);let s=iN(o,["zoom"]);if(!s&&!i$(n))return ij([new e7("","zoom expressions not supported")]);let l=i4(o);return l||s?l instanceof e7?ij([l]):l instanceof n_&&!iU(n)?ij([new e7("",'"interpolate" expressions cannot be used with this property')]):iz(l?new i2(a?"camera":"composite",r.value,l.labels,l instanceof n_?l.interpolation:void 0,i):new i1(a?"constant":"source",r.value,i)):ij([new e7("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class i3{constructor(t,n){this._parameters=t,this._specification=n,e8(this,iW(this._parameters,this._specification))}static deserialize(t){return new i3(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function i4(t){let n=null;if(t instanceof ns)n=i4(t.result);else if(t instanceof nk){for(let i of t.args)if(n=i4(i))break}else(t instanceof ng||t instanceof n_)&&t.input instanceof iO&&"zoom"===t.input.name&&(n=t);return n instanceof e7||t.eachChild(t=>{let i=i4(t);i instanceof e7?n=i:!n&&i?n=new e7("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):n&&i&&n!==i&&(n=new e7("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),n}function i6(t,n=new Set){return t instanceof iS&&n.add(t.key),t.eachChild(t=>{i6(t,n)}),n}function i8(t,n){let{zoom:i,heatmapDensity:r,elevation:o,lineProgress:a,isSupportedScript:s,accumulated:l}=null!=t?t:{};return{zoom:i,heatmapDensity:r,elevation:o,lineProgress:a,isSupportedScript:s,accumulated:l,globalState:n}}function i7(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(let n of t.slice(1))if(!i7(n)&&"boolean"!=typeof n)return!1;return!0;default:return!0}}let i9={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function re(t,n){if(null==t)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};i7(t)||(t=ri(t));let i=i0(t,i9,n);if("error"===i.result)throw Error(i.value.map(t=>`${t.key}: ${t.message}`).join(", "));return{filter:(t,n,r)=>i.value.evaluate(t,n,{},r),needGeometry:rn(t),getGlobalStateRefs:()=>i6(i.value.expression)}}function rt(t,n){return t<n?-1:+(t>n)}function rn(t){if(!Array.isArray(t))return!1;if("within"===t[0]||"distance"===t[0])return!0;for(let n=1;n<t.length;n++)if(rn(t[n]))return!0;return!1}function ri(t){if(!t)return!0;let n=t[0];return t.length<=1?"any"!==n:"=="===n?rr(t[1],t[2],"=="):"!="===n?rs(rr(t[1],t[2],"==")):"<"===n||">"===n||"<="===n||">="===n?rr(t[1],t[2],n):"any"===n?["any"].concat(t.slice(1).map(ri)):"all"===n?["all"].concat(t.slice(1).map(ri)):"none"===n?["all"].concat(t.slice(1).map(ri).map(rs)):"in"===n?ro(t[1],t.slice(2)):"!in"===n?rs(ro(t[1],t.slice(2))):"has"===n?ra(t[1]):"!has"!==n||rs(ra(t[1]))}function rr(t,n,i){switch(t){case"$type":return[`filter-type-${i}`,n];case"$id":return[`filter-id-${i}`,n];default:return[`filter-${i}`,t,n]}}function ro(t,n){if(0===n.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",n]];case"$id":return["filter-id-in",["literal",n]];default:return n.length>200&&!n.some(t=>typeof t!=typeof n[0])?["filter-in-large",t,["literal",n.sort(rt)]]:["filter-in-small",t,["literal",n]]}}function ra(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function rs(t){return["!",t]}function rl(t){let n=typeof t;if("number"===n||"boolean"===n||"string"===n||null==t)return JSON.stringify(t);if(Array.isArray(t)){let n="[";for(let i of t)n+=`${rl(i)},`;return`${n}]`}let i=Object.keys(t).sort(),r="{";for(let n=0;n<i.length;n++)r+=`${JSON.stringify(i[n])}:${rl(t[i[n]])},`;return`${r}}`}function rc(t){let n="";for(let i of eZ)n+=`/${rl(t[i])}`;return n}function ru(t){let n=t.value;return n?[new e6(t.key,n,"constants have been deprecated as of v8")]:[]}function rd(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function rh(t){if(Array.isArray(t))return t.map(rh);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){let n={};for(let i in t)n[i]=rh(t[i]);return n}return rd(t)}function rp(t){let n=t.key,i=t.value,r=t.valueSpec||{},o=t.objectElementValidators||{},a=t.style,s=t.styleSpec,l=t.validateSpec,c=[],u=iV(i);if("object"!==u)return[new e6(n,i,`object expected, ${u} found`)];for(let t in i){let u,d=t.split(".")[0],h=tz(r,d)||r["*"];if(tz(o,d))u=o[d];else if(tz(r,d)){if(void 0===i[t])continue;u=l}else if(o["*"])u=o["*"];else{if(!r["*"]){c.push(new e6(n,i[t],`unknown property "${t}"`));continue}u=l}c=c.concat(u({key:(n?`${n}.`:n)+t,value:i[t],valueSpec:h,style:a,styleSpec:s,object:i,objectKey:t,validateSpec:l},i))}for(let t in r)o[t]||r[t].required&&void 0===r[t].default&&void 0===i[t]&&c.push(new e6(n,i,`missing required property "${t}"`));return c}function rf(t){let n=t.value,i=t.valueSpec,r=t.style,o=t.styleSpec,a=t.key,s=t.arrayElementValidator||t.validateSpec;if("array"!==iV(n))return[new e6(a,n,`array expected, ${iV(n)} found`)];if(i.length&&n.length!==i.length)return[new e6(a,n,`array length ${i.length} expected, length ${n.length} found`)];let l={type:i.value,values:i.values};o.$version<7&&(l.function=i.function),"object"===iV(i.value)&&(l=i.value);let c=[];for(let i=0;i<n.length;i++)c=c.concat(s({array:n,arrayIndex:i,value:n[i],valueSpec:l,validateSpec:t.validateSpec,style:r,styleSpec:o,key:`${a}[${i}]`}));return c}function rm(t){let n=t.key,i=t.value,r=t.valueSpec,o=iV(i);return"number"===o&&i!=i&&(o="NaN"),"number"!==o?[new e6(n,i,`number expected, ${o} found`)]:"minimum"in r&&i<r.minimum?[new e6(n,i,`${i} is less than the minimum value ${r.minimum}`)]:"maximum"in r&&i>r.maximum?[new e6(n,i,`${i} is greater than the maximum value ${r.maximum}`)]:[]}function rg(t){let n=t.valueSpec,i=rd(t.value.type),r,o,a,s={},l="categorical"!==i&&void 0===t.value.property,c=!l,u="array"===iV(t.value.stops)&&"array"===iV(t.value.stops[0])&&"object"===iV(t.value.stops[0][0]),d=rp({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===i)return[new e6(t.key,t.value,'identity function may not have a "stops" property')];let n=[],r=t.value;return n=n.concat(rf({key:t.key,value:r,valueSpec:t.valueSpec,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===iV(r)&&0===r.length&&n.push(new e6(t.key,r,"array must have at least one stop")),n},default:function(t){return t.validateSpec({key:t.key,value:t.value,valueSpec:n,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===i&&l&&d.push(new e6(t.key,t.value,'missing required property "property"')),"identity"===i||t.value.stops||d.push(new e6(t.key,t.value,'missing required property "stops"')),"exponential"===i&&t.valueSpec.expression&&!iU(t.valueSpec)&&d.push(new e6(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(c&&!iB(t.valueSpec)?d.push(new e6(t.key,t.value,"property functions not supported")):l&&!i$(t.valueSpec)&&d.push(new e6(t.key,t.value,"zoom functions not supported"))),("categorical"===i||u)&&void 0===t.value.property&&d.push(new e6(t.key,t.value,'"property" property is required')),d;function h(t){let i=[],r=t.value,l=t.key;if("array"!==iV(r))return[new e6(l,r,`array expected, ${iV(r)} found`)];if(2!==r.length)return[new e6(l,r,`array length 2 expected, length ${r.length} found`)];if(u){if("object"!==iV(r[0]))return[new e6(l,r,`object expected, ${iV(r[0])} found`)];if(void 0===r[0].zoom)return[new e6(l,r,"object stop key must have zoom")];if(void 0===r[0].value)return[new e6(l,r,"object stop key must have value")];if(a&&a>rd(r[0].zoom))return[new e6(l,r[0].zoom,"stop zoom values must appear in ascending order")];rd(r[0].zoom)!==a&&(a=rd(r[0].zoom),o=void 0,s={}),i=i.concat(rp({key:`${l}[0]`,value:r[0],valueSpec:{zoom:{}},validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:rm,value:p}}))}else i=i.concat(p({key:`${l}[0]`,value:r[0],validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec},r));return iQ(rh(r[1]))?i.concat([new e6(`${l}[1]`,r[1],"expressions are not allowed in function stops.")]):i.concat(t.validateSpec({key:`${l}[1]`,value:r[1],valueSpec:n,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec}))}function p(t,a){let l=iV(t.value),c=rd(t.value),u=null!==t.value?t.value:a;if(r){if(l!==r)return[new e6(t.key,u,`${l} stop domain type must match previous stop domain type ${r}`)]}else r=l;if("number"!==l&&"string"!==l&&"boolean"!==l)return[new e6(t.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==l&&"categorical"!==i){let r=`number expected, ${l} found`;return iB(n)&&void 0===i&&(r+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new e6(t.key,u,r)]}return"categorical"!==i||"number"!==l||isFinite(c)&&Math.floor(c)===c?"categorical"!==i&&"number"===l&&void 0!==o&&c<o?[new e6(t.key,u,"stop domain values must appear in ascending order")]:(o=c,"categorical"===i&&c in s?[new e6(t.key,u,"stop domain values must be unique")]:(s[c]=!0,[])):[new e6(t.key,u,`integer expected, found ${c}`)]}}function rv(t){let n=("property"===t.expressionContext?i5:i0)(rh(t.value),t.valueSpec);if("error"===n.result)return n.value.map(n=>new e6(`${t.key}${n.key}`,t.value,n.message));let i=n.value.expression||n.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!i.outputDefined())return[new e6(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===t.expressionContext&&"layout"===t.propertyType&&!iL(i))return[new e6(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!iL(i))return[new e6(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!iN(i,["zoom","feature-state"]))return[new e6(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!iP(i))return[new e6(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function rb(t){let n=t.key,i=t.value,r=iV(i);return"string"!==r?[new e6(n,i,`color expected, ${r} found`)]:tW.parse(String(i))?[]:[new e6(n,i,`color expected, "${i}" found`)]}function ry(t){let n=t.key,i=t.value,r=t.valueSpec,o=[];return Array.isArray(r.values)?-1===r.values.indexOf(rd(i))&&o.push(new e6(n,i,`expected one of [${r.values.join(", ")}], ${JSON.stringify(i)} found`)):-1===Object.keys(r.values).indexOf(rd(i))&&o.push(new e6(n,i,`expected one of [${Object.keys(r.values).join(", ")}], ${JSON.stringify(i)} found`)),o}function r_(t){return i7(rh(t.value))?rv(e8({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):rx(t)}function rx(t){let n=t.value,i=t.key;if("array"!==iV(n))return[new e6(i,n,`array expected, ${iV(n)} found`)];let r=t.styleSpec,o,a=[];if(n.length<1)return[new e6(i,n,"filter array must have at least 1 element")];switch(a=a.concat(ry({key:`${i}[0]`,value:n[0],valueSpec:r.filter_operator,style:t.style,styleSpec:t.styleSpec})),rd(n[0])){case"<":case"<=":case">":case">=":n.length>=2&&"$type"===rd(n[1])&&a.push(new e6(i,n,`"$type" cannot be use with operator "${n[0]}"`));case"==":case"!=":3!==n.length&&a.push(new e6(i,n,`filter array for operator "${n[0]}" must have 3 elements`));case"in":case"!in":n.length>=2&&"string"!==(o=iV(n[1]))&&a.push(new e6(`${i}[1]`,n[1],`string expected, ${o} found`));for(let s=2;s<n.length;s++)o=iV(n[s]),"$type"===rd(n[1])?a=a.concat(ry({key:`${i}[${s}]`,value:n[s],valueSpec:r.geometry_type,style:t.style,styleSpec:t.styleSpec})):"string"!==o&&"number"!==o&&"boolean"!==o&&a.push(new e6(`${i}[${s}]`,n[s],`string, number, or boolean expected, ${o} found`));break;case"any":case"all":case"none":for(let r=1;r<n.length;r++)a=a.concat(rx({key:`${i}[${r}]`,value:n[r],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":o=iV(n[1]),2!==n.length?a.push(new e6(i,n,`filter array for "${n[0]}" operator must have 2 elements`)):"string"!==o&&a.push(new e6(`${i}[1]`,n[1],`string expected, ${o} found`))}return a}function rw(t,n){let i,r=t.key,o=t.validateSpec,a=t.style,s=t.styleSpec,l=t.value,c=t.objectKey,u=s[`${n}_${t.layerType}`];if(!u)return[];let d=c.match(/^(.*)-transition$/);if("paint"===n&&d&&u[d[1]]&&u[d[1]].transition)return o({key:r,value:l,valueSpec:s.transition,style:a,styleSpec:s});let h=t.valueSpec||u[c];if(!h)return[new e6(r,l,`unknown property "${c}"`)];if("string"===iV(l)&&iB(h)&&!h.tokens&&(i=/^{([^}]+)}$/.exec(l)))return[new e6(r,l,`"${c}" does not support interpolation syntax
|
|
7022
7022
|
Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(i[1])} }\`.`)];let p=[];return"symbol"===t.layerType&&"text-font"===c&&iH(rh(l))&&"identity"===rd(l.type)&&p.push(new e6(r,l,'"text-font" does not support identity functions')),p.concat(o({key:t.key,value:l,valueSpec:h,style:a,styleSpec:s,expressionContext:"property",propertyType:n,propertyKey:c}))}function rk(t){return rw(t,"paint")}function rC(t){return rw(t,"layout")}function rA(t){let n=[],i=t.value,r=t.key,o=t.style,a=t.styleSpec;if("object"!==iV(i))return[new e6(r,i,`object expected, ${iV(i)} found`)];i.type||i.ref||n.push(new e6(r,i,'either "type" or "ref" is required'));let s=rd(i.type),l=rd(i.ref);if(i.id){let a=rd(i.id);for(let s=0;s<t.arrayIndex;s++){let t=o.layers[s];rd(t.id)===a&&n.push(new e6(r,i.id,`duplicate layer id "${i.id}", previously used at line ${t.id.__line__}`))}}if("ref"in i){let t;["type","source","source-layer","filter","layout"].forEach(t=>{t in i&&n.push(new e6(r,i[t],`"${t}" is prohibited for ref layers`))}),o.layers.forEach(n=>{rd(n.id)===l&&(t=n)}),t?t.ref?n.push(new e6(r,i.ref,"ref cannot reference another ref layer")):s=rd(t.type):n.push(new e6(r,i.ref,`ref layer "${l}" not found`))}else if("background"!==s)if(i.source){let t=o.sources&&o.sources[i.source],a=t&&rd(t.type);t?"vector"===a&&"raster"===s?n.push(new e6(r,i.source,`layer "${i.id}" requires a raster source`)):"raster-dem"!==a&&"hillshade"===s||"raster-dem"!==a&&"color-relief"===s?n.push(new e6(r,i.source,`layer "${i.id}" requires a raster-dem source`)):"raster"===a&&"raster"!==s?n.push(new e6(r,i.source,`layer "${i.id}" requires a vector source`)):"vector"!==a||i["source-layer"]?"raster-dem"===a&&"hillshade"!==s&&"color-relief"!==s?n.push(new e6(r,i.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):"line"===s&&i.paint&&i.paint["line-gradient"]&&("geojson"!==a||!t.lineMetrics)&&n.push(new e6(r,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):n.push(new e6(r,i,`layer "${i.id}" must specify a "source-layer"`)):n.push(new e6(r,i.source,`source "${i.source}" not found`))}else n.push(new e6(r,i,'missing required property "source"'));return n=n.concat(rp({key:r,value:i,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":()=>[],type:()=>t.validateSpec({key:`${r}.type`,value:i.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:i,objectKey:"type"}),filter:r_,layout:t=>rp({layer:i,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":t=>rC(e8({layerType:s},t))}}),paint:t=>rp({layer:i,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":t=>rk(e8({layerType:s},t))}})}}))}function rE(t){let n=t.value,i=t.key,r=iV(n);return"string"!==r?[new e6(i,n,`string expected, ${r} found`)]:[]}let rS={promoteId:function({key:t,value:n}){if("string"===iV(n))return rE({key:t,value:n});{let i=[];for(let r in n)i.push(...rE({key:`${t}.${r}`,value:n[r]}));return i}}};function rT(t){let n,i=t.value,r=t.key,o=t.styleSpec,a=t.style,s=t.validateSpec;if(!i.type)return[new e6(r,i,'"type" is required')];let l=rd(i.type);switch(l){case"vector":case"raster":return rp({key:r,value:i,valueSpec:o[`source_${l.replace("-","_")}`],style:t.style,styleSpec:o,objectElementValidators:rS,validateSpec:s});case"raster-dem":return function(t){var n;let i=null!=(n=t.sourceName)?n:"",r=t.value,o=t.styleSpec,a=o.source_raster_dem,s=t.style,l=[],c=iV(r);if(void 0===r)return l;if("object"!==c)return l.push(new e6("source_raster_dem",r,`object expected, ${c} found`)),l;let u="custom"===rd(r.encoding),d=["redFactor","greenFactor","blueFactor","baseShift"],h=t.value.encoding?`"${t.value.encoding}"`:"Default";for(let n in r)!u&&d.includes(n)?l.push(new e6(n,r[n],`In "${i}": "${n}" is only valid when "encoding" is set to "custom". ${h} encoding found`)):a[n]?l=l.concat(t.validateSpec({key:n,value:r[n],valueSpec:a[n],validateSpec:t.validateSpec,style:s,styleSpec:o})):l.push(new e6(n,r[n],`unknown property "${n}"`));return l}({sourceName:r,value:i,style:t.style,styleSpec:o,validateSpec:s});case"geojson":if(n=rp({key:r,value:i,valueSpec:o.source_geojson,style:a,styleSpec:o,validateSpec:s,objectElementValidators:rS}),i.cluster)for(let t in i.clusterProperties){let[o,a]=i.clusterProperties[t],s="string"==typeof o?[o,["accumulated"],["get",t]]:o;n.push(...rv({key:`${r}.${t}.map`,value:a,expressionContext:"cluster-map"})),n.push(...rv({key:`${r}.${t}.reduce`,value:s,expressionContext:"cluster-reduce"}))}return n;case"video":return rp({key:r,value:i,valueSpec:o.source_video,style:a,validateSpec:s,styleSpec:o});case"image":return rp({key:r,value:i,valueSpec:o.source_image,style:a,validateSpec:s,styleSpec:o});case"canvas":return[new e6(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return ry({key:`${r}.type`,value:i.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function rO(t){let n=t.value,i=t.styleSpec,r=i.light,o=t.style,a=[],s=iV(n);if(void 0===n)return a;if("object"!==s)return a.concat([new e6("light",n,`object expected, ${s} found`)]);for(let s in n){let l=s.match(/^(.*)-transition$/);a=a.concat(l&&r[l[1]]&&r[l[1]].transition?t.validateSpec({key:s,value:n[s],valueSpec:i.transition,validateSpec:t.validateSpec,style:o,styleSpec:i}):r[s]?t.validateSpec({key:s,value:n[s],valueSpec:r[s],validateSpec:t.validateSpec,style:o,styleSpec:i}):[new e6(s,n[s],`unknown property "${s}"`)])}return a}function rF(t){let n=t.value,i=t.styleSpec,r=i.sky,o=t.style,a=iV(n);if(void 0===n)return[];if("object"!==a)return[new e6("sky",n,`object expected, ${a} found`)];let s=[];for(let a in n)s=s.concat(r[a]?t.validateSpec({key:a,value:n[a],valueSpec:r[a],style:o,styleSpec:i}):[new e6(a,n[a],`unknown property "${a}"`)]);return s}function rM(t){let n=t.value,i=t.styleSpec,r=i.terrain,o=t.style,a=[],s=iV(n);if(void 0===n)return a;if("object"!==s)return a.concat([new e6("terrain",n,`object expected, ${s} found`)]);for(let s in n)a=a.concat(r[s]?t.validateSpec({key:s,value:n[s],valueSpec:r[s],validateSpec:t.validateSpec,style:o,styleSpec:i}):[new e6(s,n[s],`unknown property "${s}"`)]);return a}function rI(t){let n=[],i=t.value,r=t.key;if(Array.isArray(i)){let o=[],a=[];for(let s in i)i[s].id&&o.includes(i[s].id)&&n.push(new e6(r,i,`all the sprites' ids must be unique, but ${i[s].id} is duplicated`)),o.push(i[s].id),i[s].url&&a.includes(i[s].url)&&n.push(new e6(r,i,`all the sprites' URLs must be unique, but ${i[s].url} is duplicated`)),a.push(i[s].url),n=n.concat(rp({key:`${r}[${s}]`,value:i[s],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:t.validateSpec}));return n}return rE({key:r,value:i})}function rR(t){return!!t&&t.constructor===Object}function rD(t){return rR(t.value)?[]:[new e6(t.key,t.value,`object expected, ${iV(t.value)} found`)]}let rP={"*":()=>[],array:rf,boolean:function(t){let n=t.value,i=t.key,r=iV(n);return"boolean"!==r?[new e6(i,n,`boolean expected, ${r} found`)]:[]},number:rm,color:rb,constants:ru,enum:ry,filter:r_,function:rg,layer:rA,object:rp,source:rT,light:rO,sky:rF,terrain:rM,projection:function(t){let n=t.value,i=t.styleSpec,r=i.projection,o=t.style,a=iV(n);if(void 0===n)return[];if("object"!==a)return[new e6("projection",n,`object expected, ${a} found`)];let s=[];for(let a in n)s=s.concat(r[a]?t.validateSpec({key:a,value:n[a],valueSpec:r[a],style:o,styleSpec:i}):[new e6(a,n[a],`unknown property "${a}"`)]);return s},projectionDefinition:function(t){let n=t.key,i=t.value,r=iV(i=i instanceof String?i.valueOf():i);return"array"!==r||function(t){return Array.isArray(t)&&3===t.length&&"string"==typeof t[0]&&"string"==typeof t[1]&&"number"==typeof t[2]}(i)||function(t){return!!["interpolate","step","literal"].includes(t[0])}(i)?["array","string"].includes(r)?[]:[new e6(n,i,`projection expected, invalid type "${r}" found`)]:[new e6(n,i,`projection expected, invalid array ${JSON.stringify(i)} found`)]},string:rE,formatted:function(t){return 0===rE(t).length?[]:rv(t)},resolvedImage:function(t){return 0===rE(t).length?[]:rv(t)},padding:function(t){let n=t.key,i=t.value;if("array"===iV(i)){if(i.length<1||i.length>4)return[new e6(n,i,`padding requires 1 to 4 values; ${i.length} values found`)];let r={type:"number"},o=[];for(let a=0;a<i.length;a++)o=o.concat(t.validateSpec({key:`${n}[${a}]`,value:i[a],validateSpec:t.validateSpec,valueSpec:r}));return o}return rm({key:n,value:i,valueSpec:{}})},numberArray:function(t){let n=t.key,i=t.value;if("array"===iV(i)){let r={type:"number"};if(i.length<1)return[new e6(n,i,"array length at least 1 expected, length 0 found")];let o=[];for(let a=0;a<i.length;a++)o=o.concat(t.validateSpec({key:`${n}[${a}]`,value:i[a],validateSpec:t.validateSpec,valueSpec:r}));return o}return rm({key:n,value:i,valueSpec:{}})},colorArray:function(t){let n=t.key,i=t.value;if("array"===iV(i)){if(i.length<1)return[new e6(n,i,"array length at least 1 expected, length 0 found")];let t=[];for(let r=0;r<i.length;r++)t=t.concat(rb({key:`${n}[${r}]`,value:i[r]}));return t}return rb({key:n,value:i})},variableAnchorOffsetCollection:function(t){let n=t.key,i=t.value,r=iV(i),o=t.styleSpec;if("array"!==r||i.length<1||i.length%2!=0)return[new e6(n,i,"variableAnchorOffsetCollection requires a non-empty array of even length")];let a=[];for(let r=0;r<i.length;r+=2)a=(a=a.concat(ry({key:`${n}[${r}]`,value:i[r],valueSpec:o.layout_symbol["text-anchor"]}))).concat(rf({key:`${n}[${r+1}]`,value:i[r+1],valueSpec:{length:2,value:"number"},validateSpec:t.validateSpec,style:t.style,styleSpec:o}));return a},sprite:rI,state:rD,fontFaces:function(t){let n=t.key,i=t.value,r=t.validateSpec,o=t.styleSpec,a=t.style;if(!rR(i))return[new e6(n,i,`object expected, ${iV(i)} found`)];let s=[];for(let t in i){let l=i[t],c=iV(l);if("string"===c)s.push(...rE({key:`${n}.${t}`,value:l}));else if("array"===c){let i={url:{type:"string",required:!0},"unicode-range":{type:"array",value:"string"}};for(let[c,u]of l.entries())s.push(...rp({key:`${n}.${t}[${c}]`,value:u,valueSpec:i,styleSpec:o,style:a,validateSpec:r}))}else s.push(new e6(`${n}.${t}`,l,`string or array expected, ${c} found`))}return s}};function rL(t){let n=t.value,i=t.valueSpec,r=t.styleSpec;return t.validateSpec=rL,i.expression&&iH(rd(n))?rg(t):i.expression&&iQ(rh(n))?rv(t):i.type&&rP[i.type]?rP[i.type](t):rp(e8({},t,{valueSpec:i.type?r[i.type]:i}))}function rN(t){let n=t.value,i=t.key,r=rE(t);return r.length||(-1===n.indexOf("{fontstack}")&&r.push(new e6(i,n,'"glyphs" url must include a "{fontstack}" token')),-1===n.indexOf("{range}")&&r.push(new e6(i,n,'"glyphs" url must include a "{range}" token'))),r}function rz(t,n=eY){let i=[];return i=i.concat(rL({key:"",value:t,valueSpec:n.$root,styleSpec:n,style:t,validateSpec:rL,objectElementValidators:{glyphs:rN,"*":()=>[]}})),t.constants&&(i=i.concat(ru({key:"constants",value:t.constants}))),rB(i)}function rj(t){return function(n){return t(Object.assign({},n,{validateSpec:rL}))}}function rB(t){return[].concat(t).sort((t,n)=>t.line-n.line)}function r$(t){return function(...n){return rB(t.apply(this,n))}}rz.source=r$(rj(rT)),rz.sprite=r$(rj(rI)),rz.glyphs=r$(rj(rN)),rz.light=r$(rj(rO)),rz.sky=r$(rj(rF)),rz.terrain=r$(rj(rM)),rz.state=r$(rj(rD)),rz.layer=r$(rj(rA)),rz.filter=r$(rj(r_)),rz.paintProperty=r$(rj(rk)),rz.layoutProperty=r$(rj(rC));let rU={type:"enum","property-type":"data-constant",expression:{interpolated:!1,parameters:["global-state"]},values:{visible:{},none:{}},transition:!1,default:"visible"};class rV{constructor(t,n){this._globalState=n,this.setValue(t)}evaluate(){var t;return null!=(t=this._literalValue)?t:this._compiledValue.evaluate({})}setValue(t){if(null==t||"visible"===t||"none"===t)return this._literalValue="none"===t?"none":"visible",this._compiledValue=void 0,void(this._globalStateRefs=new Set);let n=i0(t,rU,this._globalState);if("error"===n.result)throw this._literalValue="visible",this._compiledValue=void 0,Error(n.value.map(t=>`${t.key}: ${t.message}`).join(", "));this._literalValue=void 0,this._compiledValue=n.value,this._globalStateRefs=i6(n.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}}let rH=eY,rq=rz,rW=rq.light,rG=rq.sky,rY=rq.paintProperty,rZ=rq.layoutProperty;function rX(t,n){let i=!1;if(n&&n.length)for(let r of n)t.fire(new eW(Error(r.message))),i=!0;return i}class rK{constructor(t,n,i){const r=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;const o=new Int32Array(this.arrayBuffer);t=o[0],this.d=(n=o[1])+2*(i=o[2]);for(let t=0;t<this.d*this.d;t++){const n=o[3+t],i=o[3+t+1];r.push(n===i?null:o.subarray(n,i))}const a=o[3+r.length+1];this.keys=o.subarray(o[3+r.length],a),this.bboxes=o.subarray(a),this.insert=this._insertReadonly}else{this.d=n+2*i;for(let t=0;t<this.d*this.d;t++)r.push([]);this.keys=[],this.bboxes=[]}this.n=n,this.extent=t,this.padding=i,this.scale=n/t,this.uid=0;const o=i/n*t;this.min=-o,this.max=t+o}insert(t,n,i,r,o){this._forEachCell(n,i,r,o,this._insertCell,this.uid++,void 0,void 0),this.keys.push(t),this.bboxes.push(n),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(o)}_insertReadonly(){throw Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(t,n,i,r,o,a){this.cells[o].push(a)}query(t,n,i,r,o){let a=this.min,s=this.max;if(t<=a&&n<=a&&s<=i&&s<=r&&!o)return Array.prototype.slice.call(this.keys);{let a=[];return this._forEachCell(t,n,i,r,this._queryCell,a,{},o),a}}_queryCell(t,n,i,r,o,a,s,l){let c=this.cells[o];if(null!==c){let o=this.keys,u=this.bboxes;for(let d=0;d<c.length;d++){let h=c[d];if(void 0===s[h]){let c=4*h;(l?l(u[c+0],u[c+1],u[c+2],u[c+3]):t<=u[c+2]&&n<=u[c+3]&&i>=u[c+0]&&r>=u[c+1])?(s[h]=!0,a.push(o[h])):s[h]=!1}}}}_forEachCell(t,n,i,r,o,a,s,l){let c=this._convertToCellCoord(t),u=this._convertToCellCoord(n),d=this._convertToCellCoord(i),h=this._convertToCellCoord(r);for(let p=c;p<=d;p++)for(let c=u;c<=h;c++){let u=this.d*c+p;if((!l||l(this._convertFromCellCoord(p),this._convertFromCellCoord(c),this._convertFromCellCoord(p+1),this._convertFromCellCoord(c+1)))&&o.call(this,t,n,i,r,u,a,s,l))return}}_convertFromCellCoord(t){return(t-this.padding)/this.scale}_convertToCellCoord(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let t=this.cells,n=3+this.cells.length+1+1,i=0;for(let t=0;t<this.cells.length;t++)i+=this.cells[t].length;let r=new Int32Array(n+i+this.keys.length+this.bboxes.length);r[0]=this.extent,r[1]=this.n,r[2]=this.padding;let o=n;for(let n=0;n<t.length;n++){let i=t[n];r[3+n]=o,r.set(i,o),o+=i.length}return r[3+t.length]=o,r.set(this.keys,o),o+=this.keys.length,r[3+t.length+1]=o,r.set(this.bboxes,o),o+=this.bboxes.length,r.buffer}static serialize(t,n){let i=t.toArrayBuffer();return n&&n.push(i),{buffer:i}}static deserialize(t){return new rK(t.buffer)}}let rJ={};function rQ(t,n,i={}){if(rJ[t])throw Error(`${t} is already registered.`);Object.defineProperty(n,"_classRegistryKey",{value:t,writeable:!1}),rJ[t]={klass:n,omit:i.omit||[],shallow:i.shallow||[]}}for(let t in rQ("Object",Object),rQ("Set",Set),rQ("TransferableGridIndex",rK),rQ("Color",tW),rQ("Error",Error),rQ("AJAXError",ej),rQ("ResolvedImage",t5),rQ("StylePropertyFunction",i3),rQ("StyleExpression",iJ,{omit:["_evaluator"]}),rQ("ZoomDependentExpression",i2),rQ("ZoomConstantExpression",i1),rQ("CompoundExpression",iO,{omit:["_evaluate"]}),iT)iT[t]._classRegistryKey||rQ(`Expression_${t}`,iT[t]);function r0(t){return t&&"u">typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function r1(t){return t.$name||t.constructor._classRegistryKey}function r2(t){return!function(t){if(null===t||"object"!=typeof t)return!1;let n=r1(t);return!(!n||"Object"===n)}(t)&&(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof Blob||t instanceof Error||r0(t)||eA(t)||ArrayBuffer.isView(t)||t instanceof ImageData)}function r5(t,n){if(r2(t))return(r0(t)||eA(t))&&n&&n.push(t),ArrayBuffer.isView(t)&&n&&n.push(t.buffer),t instanceof ImageData&&n&&n.push(t.data.buffer),t;if(Array.isArray(t)){let i=[];for(let r of t)i.push(r5(r,n));return i}if("object"!=typeof t)throw Error("can't serialize object of type "+typeof t);let i=r1(t);if(!i)throw Error(`can't serialize object of unregistered class ${t.constructor.name}`);if(!rJ[i])throw Error(`${i} is not registered.`);let{klass:r}=rJ[i],o=r.serialize?r.serialize(t,n):{};if(r.serialize){if(n&&o===n[n.length-1])throw Error("statically serialized object won't survive transfer of $name property")}else{for(let r in t){if(!t.hasOwnProperty(r)||rJ[i].omit.indexOf(r)>=0)continue;let a=t[r];o[r]=rJ[i].shallow.indexOf(r)>=0?a:r5(a,n)}t instanceof Error&&(o.message=t.message)}if(o.$name)throw Error("$name property is reserved for worker serialization logic.");return"Object"!==i&&(o.$name=i),o}function r3(t){if(r2(t))return t;if(Array.isArray(t))return t.map(r3);if("object"!=typeof t)throw Error("can't deserialize object of type "+typeof t);let n=r1(t)||"Object";if(!rJ[n])throw Error(`can't deserialize unregistered class ${n}`);let{klass:i}=rJ[n];if(!i)throw Error(`can't deserialize unregistered class ${n}`);if(i.deserialize)return i.deserialize(t);let r=Object.create(i.prototype);for(let i of Object.keys(t)){if("$name"===i)continue;let o=t[i];r[i]=rJ[n].shallow.indexOf(i)>=0?o:r3(o)}return r}class r4{constructor(){this.first=!0}update(t,n){let i=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=i,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=i,!0):(this.lastFloorZoom>i?(this.lastIntegerZoom=i+1,this.lastIntegerZoomTime=n):this.lastFloorZoom<i&&(this.lastIntegerZoom=i,this.lastIntegerZoomTime=n),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=i,!0))}}function r6(t){return/[\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(t))}function r8(t){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(t))}function r7(t){return/\s/u.test(String.fromCodePoint(t))}function r9(t){for(let n of t)if(r8(n.codePointAt(0)))return!0;return!1}function oe(t){for(let n of t)if(!oi(n.codePointAt(0)))return!1;return!0}function ot(t){return RegExp(t.map(t=>{try{return RegExp(`\\p{sc=${t}}`,"u").source}catch(t){return null}}).filter(t=>t).join("|"),"u")}let on=ot(["Arab","Dupl","Mong","Ougr","Syrc"]);function oi(t){return!on.test(String.fromCodePoint(t))}function or(t){var n;return!(r8(t)||(n=t,/[\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(n))))}let oo=ot(["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 oa(t){return oo.test(String.fromCodePoint(t))}function os(t,n){return!(!n&&oa(t)||/[\u0900-\u0DFF\u0F00-\u109F\u1780-\u17FF]/gim.test(String.fromCodePoint(t)))}function ol(t){for(let n of t)if(oa(n.codePointAt(0)))return!0;return!1}let oc=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(t){this.pluginStatus=t.pluginStatus,this.pluginURL=t.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(t){if(oc.isParsed())throw Error("RTL text plugin already registered.");this.applyArabicShaping=t.applyArabicShaping,this.processBidirectionalText=t.processBidirectionalText,this.processStyledBidirectionalText=t.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return null!=this.applyArabicShaping&&null!=this.processBidirectionalText&&null!=this.processStyledBidirectionalText}getRTLTextPluginStatus(){return this.pluginStatus}syncState(t,n){return x(this,void 0,void 0,function*(){if(this.isParsed())return this.getState();if("loading"!==t.pluginStatus)return this.setState(t),t;let i=t.pluginURL,r=new Promise(t=>{this.loadScriptResolve=t});n(i);let o=new Promise(t=>setTimeout(()=>t(),this.TIMEOUT));if(yield Promise.race([r,o]),this.isParsed()){let t={pluginStatus:"loaded",pluginURL:i};return this.setState(t),t}throw this.setState({pluginStatus:"error",pluginURL:""}),Error(`RTL Text Plugin failed to import scripts from ${i}`)})}};class ou{constructor(t,n){this.isSupportedScript=od,this.zoom=t,n?(this.now=n.now||0,this.fadeDuration=n.fadeDuration||0,this.zoomHistory=n.zoomHistory||new r4,this.transition=n.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new r4,this.transition={})}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let t=this.zoom,n=t-Math.floor(t),i=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:n+(1-n)*i}:{fromScale:.5,toScale:1,t:1-(1-i)*n}}}function od(t){return function(t,n){for(let i of t)if(!os(i.codePointAt(0),n))return!1;return!0}(t,"loaded"===oc.getRTLTextPluginStatus())}let oh="-transition";class op{constructor(t,n,i){this.property=t,this.value=n,this.expression=function(t,n,i){if(iH(t))return new i3(t,n);if(iQ(t)){let r=i5(t,n,i);if("error"===r.result)throw Error(r.value.map(t=>`${t.key}: ${t.message}`).join(", "));return r.value}{let i=t;return"color"===n.type&&"string"==typeof t?i=tW.parse(t):"padding"===n.type&&("number"==typeof t||Array.isArray(t))?i=tK.parse(t):"numberArray"===n.type&&("number"==typeof t||Array.isArray(t))?i=tJ.parse(t):"colorArray"===n.type&&("string"==typeof t||Array.isArray(t))?i=tQ.parse(t):"variableAnchorOffsetCollection"===n.type&&Array.isArray(t)?i=t2.parse(t):"projectionDefinition"===n.type&&"string"==typeof t&&(i=t3.parse(t)),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>i}}}(void 0===n?t.specification.default:n,t.specification,i)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(t,n,i){return this.property.possiblyEvaluate(this,t,n,i)}}class of{constructor(t,n){this.property=t,this.value=new op(t,void 0,n)}transitioned(t,n){return new og(this.property,this.value,n,em({},t.transition,this.transition),t.now)}untransitioned(){return new og(this.property,this.value,null,{},0)}}class om{constructor(t,n){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues),this._globalState=n}getValue(t){return ey(this._values[t].value.value)}setValue(t,n){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new of(this._values[t].property,this._globalState)),this._values[t].value=new op(this._values[t].property,null===n?void 0:ey(n),this._globalState)}getTransition(t){return ey(this._values[t].transition)}setTransition(t,n){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new of(this._values[t].property,this._globalState)),this._values[t].transition=ey(n)||void 0}serialize(){let t={};for(let n of Object.keys(this._values)){let i=this.getValue(n);void 0!==i&&(t[n]=i);let r=this.getTransition(n);void 0!==r&&(t[`${n}${oh}`]=r)}return t}transitioned(t,n){let i=new ov(this._properties);for(let r of Object.keys(this._values))i._values[r]=this._values[r].transitioned(t,n._values[r]);return i}untransitioned(){let t=new ov(this._properties);for(let n of Object.keys(this._values))t._values[n]=this._values[n].untransitioned();return t}}class og{constructor(t,n,i,r,o){this.property=t,this.value=n,this.begin=o+r.delay||0,this.end=this.begin+r.duration||0,t.specification.transition&&(r.delay||r.duration)&&(this.prior=i)}possiblyEvaluate(t,n,i){let r=t.now||0,o=this.value.possiblyEvaluate(t,n,i),a=this.prior;if(a){if(r>this.end||this.value.isDataDriven())return this.prior=null,o;if(r<this.begin)return a.possiblyEvaluate(t,n,i);{let s=(r-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(t,n,i),o,eu(s))}}return o}}class ov{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,n,i){let r=new o_(this._properties);for(let o of Object.keys(this._values))r._values[o]=this._values[o].possiblyEvaluate(t,n,i);return r}hasTransition(){for(let t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}}class ob{constructor(t,n){this._properties=t,this._values=Object.create(t.defaultPropertyValues),this._globalState=n}hasValue(t){return void 0!==this._values[t].value}getValue(t){return ey(this._values[t].value)}setValue(t,n){this._values[t]=new op(this._values[t].property,null===n?void 0:ey(n),this._globalState)}serialize(){let t={};for(let n of Object.keys(this._values)){let i=this.getValue(n);void 0!==i&&(t[n]=i)}return t}possiblyEvaluate(t,n,i){let r=new o_(this._properties);for(let o of Object.keys(this._values))r._values[o]=this._values[o].possiblyEvaluate(t,n,i);return r}}class oy{constructor(t,n,i){this.property=t,this.value=n,this.parameters=i}isConstant(){return"constant"===this.value.kind}constantOr(t){return"constant"===this.value.kind?this.value.value:t}evaluate(t,n,i,r){return this.property.evaluate(this.value,this.parameters,t,n,i,r)}}class o_{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}}class ox{constructor(t){this.specification=t}possiblyEvaluate(t,n){if(t.isDataDriven())throw Error("Value should not be data driven");return t.expression.evaluate(n)}interpolate(t,n,i){let r=nw[this.specification.type];return r?r(t,n,i):t}}class ow{constructor(t,n){this.specification=t,this.overrides=n}possiblyEvaluate(t,n,i,r){return new oy(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(n,null,{},i,r)}:t.expression,n)}interpolate(t,n,i){if("constant"!==t.value.kind||"constant"!==n.value.kind)return t;if(void 0===t.value.value||void 0===n.value.value)return new oy(this,{kind:"constant",value:void 0},t.parameters);let r=nw[this.specification.type];return r?new oy(this,{kind:"constant",value:r(t.value.value,n.value.value,i)},t.parameters):t}evaluate(t,n,i,r,o,a){return"constant"===t.kind?t.value:t.evaluate(n,i,r,o,a)}}class ok extends ow{possiblyEvaluate(t,n,i,r){if(void 0===t.value)return new oy(this,{kind:"constant",value:void 0},n);if("constant"===t.expression.kind){let o=t.expression.evaluate(n,null,{},i,r),a="resolvedImage"===t.property.specification.type&&"string"!=typeof o?o.name:o;return new oy(this,{kind:"constant",value:this._calculate(a,a,a,n)},n)}return"camera"===t.expression.kind?new oy(this,{kind:"constant",value:this._calculate(t.expression.evaluate({zoom:n.zoom-1}),t.expression.evaluate({zoom:n.zoom}),t.expression.evaluate({zoom:n.zoom+1}),n)},n):new oy(this,t.expression,n)}evaluate(t,n,i,r,o,a){if("source"===t.kind){let s=t.evaluate(n,i,r,o,a);return this._calculate(s,s,s,n)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(n.zoom)-1},i,r),t.evaluate({zoom:Math.floor(n.zoom)},i,r),t.evaluate({zoom:Math.floor(n.zoom)+1},i,r),n):t.value}_calculate(t,n,i,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:t,to:n}:{from:i,to:n}}interpolate(t){return t}}class oC{constructor(t){this.specification=t}possiblyEvaluate(t,n,i,r){if(void 0!==t.value){if("constant"===t.expression.kind){let o=t.expression.evaluate(n,null,{},i,r);return this._calculate(o,o,o,n)}return this._calculate(t.expression.evaluate(new ou(Math.floor(n.zoom-1),n)),t.expression.evaluate(new ou(Math.floor(n.zoom),n)),t.expression.evaluate(new ou(Math.floor(n.zoom+1),n)),n)}}_calculate(t,n,i,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:t,to:n}:{from:i,to:n}}interpolate(t){return t}}class oA{constructor(t){this.specification=t}possiblyEvaluate(t,n,i,r){return!!t.expression.evaluate(n,null,{},i,r)}interpolate(){return!1}}class oE{constructor(t){for(const n in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){const i=t[n];i.specification.overridable&&this.overridableProperties.push(n);const r=this.defaultPropertyValues[n]=new op(i,void 0,void 0),o=this.defaultTransitionablePropertyValues[n]=new of(i,void 0);this.defaultTransitioningPropertyValues[n]=o.untransitioned(),this.defaultPossiblyEvaluatedValues[n]=r.possiblyEvaluate({})}}}rQ("DataDrivenProperty",ow),rQ("DataConstantProperty",ox),rQ("CrossFadedDataDrivenProperty",ok),rQ("CrossFadedProperty",oC),rQ("ColorRampProperty",oA);class oS extends eG{constructor(t,n,i){if(super(),this.id=t.id,this.type=t.type,this._globalState=i,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=function(t,n){return new rV(t,n)}(this.visibility,i),"custom"!==t.type&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter,this._featureFilter=re(t.filter,i)),n.layout&&(this._unevaluatedLayout=new ob(n.layout,i)),n.paint)){for(const r in this._transitionablePaint=new om(n.paint,i),t.paint)this.setPaintProperty(r,t.paint[r],{validate:!1});for(const n in t.layout)this.setLayoutProperty(n,t.layout[n],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new o_(n.paint)}}setFilter(t){this.filter=t,this._featureFilter=re(t,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)}getLayoutAffectingGlobalStateRefs(){let t=new Set;for(let n of this._visibilityExpression.getGlobalStateRefs())t.add(n);if(this._unevaluatedLayout)for(let n in this._unevaluatedLayout._values)for(let i of this._unevaluatedLayout._values[n].getGlobalStateRefs())t.add(i);for(let n of this._featureFilter.getGlobalStateRefs())t.add(n);return t}getPaintAffectingGlobalStateRefs(){var t;let n=new globalThis.Map;if(this._transitionablePaint)for(let i in this._transitionablePaint._values){let r=this._transitionablePaint._values[i].value;for(let o of r.getGlobalStateRefs()){let a=null!=(t=n.get(o))?t:[];a.push({name:i,value:r.value}),n.set(o,a)}}return n}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(t,n,i={}){if(null==n||!this._validate(rZ,`layers.${this.id}.layout.${t}`,t,n,i))return"visibility"===t?(this.visibility=n,this._visibilityExpression.setValue(n),void this.recalculateVisibility()):void this._unevaluatedLayout.setValue(t,n)}getPaintProperty(t){return t.endsWith(oh)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,n,i={}){if(null!=n&&this._validate(rY,`layers.${this.id}.paint.${t}`,t,n,i))return!1;if(t.endsWith(oh))return this._transitionablePaint.setTransition(t.slice(0,-11),n||void 0),!1;{let i=this._transitionablePaint._values[t],r="cross-faded-data-driven"===i.property.specification["property-type"],o=i.value.isDataDriven(),a=i.value;this._transitionablePaint.setValue(t,n),this._handleSpecialPaintPropertyUpdate(t);let s=this._transitionablePaint._values[t].value;return s.isDataDriven()||o||r||this._handleOverridablePaintPropertyUpdate(t,a,s)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,n,i){return!1}isHidden(t=this.minzoom,n=!1){return!!(this.minzoom&&t<(n?Math.floor(this.minzoom):this.minzoom))||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this._evaluatedVisibility}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(t,n){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,n)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,n)}serialize(){let t={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&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),eb(t,(t,n)=>!(void 0===t||"layout"===n&&!Object.keys(t).length||"paint"===n&&!Object.keys(t).length))}_validate(t,n,i,r,o={}){return(!o||!1!==o.validate)&&rX(this,t.call(rq,{key:n,layerType:this.type,objectKey:i,value:r,styleSpec:eY,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let t in this.paint._values){let n=this.paint.get(t);if(n instanceof oy&&iB(n.property.specification)&&("source"===n.value.kind||"composite"===n.value.kind)&&n.value.isStateDependent)return!0}return!1}}var oT={get paint(){return a=a||new oE({"raster-opacity":new ox(eY.paint_raster["raster-opacity"]),"raster-hue-rotate":new ox(eY.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new ox(eY.paint_raster["raster-brightness-min"]),"raster-brightness-max":new ox(eY.paint_raster["raster-brightness-max"]),"raster-saturation":new ox(eY.paint_raster["raster-saturation"]),"raster-contrast":new ox(eY.paint_raster["raster-contrast"]),"raster-resampling":new ox(eY.paint_raster["raster-resampling"]),"raster-fade-duration":new ox(eY.paint_raster["raster-fade-duration"])})}};class oO extends oS{constructor(t,n){super(t,oT,n)}}let oF={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class oM{constructor(t,n){this._structArray=t,this._pos1=n*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class oI{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,n){return t._trim(),n&&(t.isTransferred=!0,n.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){let n=Object.create(this.prototype);return n.arrayBuffer=t.arrayBuffer,n.length=t.length,n.capacity=t.arrayBuffer.byteLength/n.bytesPerElement,n._refreshViews(),n}_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(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let n=this.uint8;this._refreshViews(),n&&this.uint8.set(n)}}_refreshViews(){throw Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function oR(t,n=1){let i=0,r=0;return{members:t.map(t=>{let o=oF[t.type].BYTES_PER_ELEMENT,a=i=oD(i,Math.max(n,o)),s=t.components||1;return r=Math.max(r,o),i+=o*s,{name:t.name,type:t.type,components:s,offset:a}}),size:oD(i,Math.max(r,n)),alignment:n}}function oD(t,n){return Math.ceil(t/n)*n}class oP extends oI{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,n){let i=this.length;return this.resize(i+1),this.emplace(i,t,n)}emplace(t,n,i){let r=2*t;return this.int16[r+0]=n,this.int16[r+1]=i,t}}oP.prototype.bytesPerElement=4,rQ("StructArrayLayout2i4",oP);class oL extends oI{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,n,i){let r=this.length;return this.resize(r+1),this.emplace(r,t,n,i)}emplace(t,n,i,r){let o=3*t;return this.int16[o+0]=n,this.int16[o+1]=i,this.int16[o+2]=r,t}}oL.prototype.bytesPerElement=6,rQ("StructArrayLayout3i6",oL);class oN extends oI{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,n,i,r){let o=this.length;return this.resize(o+1),this.emplace(o,t,n,i,r)}emplace(t,n,i,r,o){let a=4*t;return this.int16[a+0]=n,this.int16[a+1]=i,this.int16[a+2]=r,this.int16[a+3]=o,t}}oN.prototype.bytesPerElement=8,rQ("StructArrayLayout4i8",oN);class oz extends oI{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,n,i,r,o,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,n,i,r,o,a)}emplace(t,n,i,r,o,a,s){let l=6*t;return this.int16[l+0]=n,this.int16[l+1]=i,this.int16[l+2]=r,this.int16[l+3]=o,this.int16[l+4]=a,this.int16[l+5]=s,t}}oz.prototype.bytesPerElement=12,rQ("StructArrayLayout2i4i12",oz);class oj extends oI{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,n,i,r,o,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,n,i,r,o,a)}emplace(t,n,i,r,o,a,s){let l=4*t,c=8*t;return this.int16[l+0]=n,this.int16[l+1]=i,this.uint8[c+4]=r,this.uint8[c+5]=o,this.uint8[c+6]=a,this.uint8[c+7]=s,t}}oj.prototype.bytesPerElement=8,rQ("StructArrayLayout2i4ub8",oj);class oB extends oI{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,n){let i=this.length;return this.resize(i+1),this.emplace(i,t,n)}emplace(t,n,i){let r=2*t;return this.float32[r+0]=n,this.float32[r+1]=i,t}}oB.prototype.bytesPerElement=8,rQ("StructArrayLayout2f8",oB);class o$ extends oI{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,n,i,r,o,a,s,l,c,u){let d=this.length;return this.resize(d+1),this.emplace(d,t,n,i,r,o,a,s,l,c,u)}emplace(t,n,i,r,o,a,s,l,c,u,d){let h=10*t;return this.uint16[h+0]=n,this.uint16[h+1]=i,this.uint16[h+2]=r,this.uint16[h+3]=o,this.uint16[h+4]=a,this.uint16[h+5]=s,this.uint16[h+6]=l,this.uint16[h+7]=c,this.uint16[h+8]=u,this.uint16[h+9]=d,t}}o$.prototype.bytesPerElement=20,rQ("StructArrayLayout10ui20",o$);class oU extends oI{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,n,i,r,o,a,s,l){let c=this.length;return this.resize(c+1),this.emplace(c,t,n,i,r,o,a,s,l)}emplace(t,n,i,r,o,a,s,l,c){let u=8*t;return this.uint16[u+0]=n,this.uint16[u+1]=i,this.uint16[u+2]=r,this.uint16[u+3]=o,this.uint16[u+4]=a,this.uint16[u+5]=s,this.uint16[u+6]=l,this.uint16[u+7]=c,t}}oU.prototype.bytesPerElement=16,rQ("StructArrayLayout8ui16",oU);class oV extends oI{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,n,i,r,o,a,s,l,c,u,d,h){let p=this.length;return this.resize(p+1),this.emplace(p,t,n,i,r,o,a,s,l,c,u,d,h)}emplace(t,n,i,r,o,a,s,l,c,u,d,h,p){let f=12*t;return this.int16[f+0]=n,this.int16[f+1]=i,this.int16[f+2]=r,this.int16[f+3]=o,this.uint16[f+4]=a,this.uint16[f+5]=s,this.uint16[f+6]=l,this.uint16[f+7]=c,this.int16[f+8]=u,this.int16[f+9]=d,this.int16[f+10]=h,this.int16[f+11]=p,t}}oV.prototype.bytesPerElement=24,rQ("StructArrayLayout4i4ui4i24",oV);class oH extends oI{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,n,i){let r=this.length;return this.resize(r+1),this.emplace(r,t,n,i)}emplace(t,n,i,r){let o=3*t;return this.float32[o+0]=n,this.float32[o+1]=i,this.float32[o+2]=r,t}}oH.prototype.bytesPerElement=12,rQ("StructArrayLayout3f12",oH);class oq extends oI{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){let n=this.length;return this.resize(n+1),this.emplace(n,t)}emplace(t,n){return this.uint32[+t+0]=n,t}}oq.prototype.bytesPerElement=4,rQ("StructArrayLayout1ul4",oq);class oW extends oI{_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(t,n,i,r,o,a,s,l,c){let u=this.length;return this.resize(u+1),this.emplace(u,t,n,i,r,o,a,s,l,c)}emplace(t,n,i,r,o,a,s,l,c,u){let d=10*t,h=5*t;return this.int16[d+0]=n,this.int16[d+1]=i,this.int16[d+2]=r,this.int16[d+3]=o,this.int16[d+4]=a,this.int16[d+5]=s,this.uint32[h+3]=l,this.uint16[d+8]=c,this.uint16[d+9]=u,t}}oW.prototype.bytesPerElement=20,rQ("StructArrayLayout6i1ul2ui20",oW);class oG extends oI{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,n,i,r,o,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,n,i,r,o,a)}emplace(t,n,i,r,o,a,s){let l=6*t;return this.int16[l+0]=n,this.int16[l+1]=i,this.int16[l+2]=r,this.int16[l+3]=o,this.int16[l+4]=a,this.int16[l+5]=s,t}}oG.prototype.bytesPerElement=12,rQ("StructArrayLayout2i2i2i12",oG);class oY extends oI{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,n,i,r,o){let a=this.length;return this.resize(a+1),this.emplace(a,t,n,i,r,o)}emplace(t,n,i,r,o,a){let s=4*t,l=8*t;return this.float32[s+0]=n,this.float32[s+1]=i,this.float32[s+2]=r,this.int16[l+6]=o,this.int16[l+7]=a,t}}oY.prototype.bytesPerElement=16,rQ("StructArrayLayout2f1f2i16",oY);class oZ extends oI{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,n,i,r,o,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,n,i,r,o,a)}emplace(t,n,i,r,o,a,s){let l=16*t,c=4*t,u=8*t;return this.uint8[l+0]=n,this.uint8[l+1]=i,this.float32[c+1]=r,this.float32[c+2]=o,this.int16[u+6]=a,this.int16[u+7]=s,t}}oZ.prototype.bytesPerElement=16,rQ("StructArrayLayout2ub2f2i16",oZ);class oX extends oI{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,n,i){let r=this.length;return this.resize(r+1),this.emplace(r,t,n,i)}emplace(t,n,i,r){let o=3*t;return this.uint16[o+0]=n,this.uint16[o+1]=i,this.uint16[o+2]=r,t}}oX.prototype.bytesPerElement=6,rQ("StructArrayLayout3ui6",oX);class oK extends oI{_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(t,n,i,r,o,a,s,l,c,u,d,h,p,f,m,g,v){let b=this.length;return this.resize(b+1),this.emplace(b,t,n,i,r,o,a,s,l,c,u,d,h,p,f,m,g,v)}emplace(t,n,i,r,o,a,s,l,c,u,d,h,p,f,m,g,v,b){let y=24*t,_=12*t,x=48*t;return this.int16[y+0]=n,this.int16[y+1]=i,this.uint16[y+2]=r,this.uint16[y+3]=o,this.uint32[_+2]=a,this.uint32[_+3]=s,this.uint32[_+4]=l,this.uint16[y+10]=c,this.uint16[y+11]=u,this.uint16[y+12]=d,this.float32[_+7]=h,this.float32[_+8]=p,this.uint8[x+36]=f,this.uint8[x+37]=m,this.uint8[x+38]=g,this.uint32[_+10]=v,this.int16[y+22]=b,t}}oK.prototype.bytesPerElement=48,rQ("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",oK);class oJ extends oI{_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(t,n,i,r,o,a,s,l,c,u,d,h,p,f,m,g,v,b,y,_,x,w,k,C,A,E,S,T){let O=this.length;return this.resize(O+1),this.emplace(O,t,n,i,r,o,a,s,l,c,u,d,h,p,f,m,g,v,b,y,_,x,w,k,C,A,E,S,T)}emplace(t,n,i,r,o,a,s,l,c,u,d,h,p,f,m,g,v,b,y,_,x,w,k,C,A,E,S,T,O){let F=32*t,M=16*t;return this.int16[F+0]=n,this.int16[F+1]=i,this.int16[F+2]=r,this.int16[F+3]=o,this.int16[F+4]=a,this.int16[F+5]=s,this.int16[F+6]=l,this.int16[F+7]=c,this.uint16[F+8]=u,this.uint16[F+9]=d,this.uint16[F+10]=h,this.uint16[F+11]=p,this.uint16[F+12]=f,this.uint16[F+13]=m,this.uint16[F+14]=g,this.uint16[F+15]=v,this.uint16[F+16]=b,this.uint16[F+17]=y,this.uint16[F+18]=_,this.uint16[F+19]=x,this.uint16[F+20]=w,this.uint16[F+21]=k,this.uint16[F+22]=C,this.uint32[M+12]=A,this.float32[M+13]=E,this.float32[M+14]=S,this.uint16[F+30]=T,this.uint16[F+31]=O,t}}oJ.prototype.bytesPerElement=64,rQ("StructArrayLayout8i15ui1ul2f2ui64",oJ);class oQ extends oI{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){let n=this.length;return this.resize(n+1),this.emplace(n,t)}emplace(t,n){return this.float32[+t+0]=n,t}}oQ.prototype.bytesPerElement=4,rQ("StructArrayLayout1f4",oQ);class o0 extends oI{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,n,i){let r=this.length;return this.resize(r+1),this.emplace(r,t,n,i)}emplace(t,n,i,r){let o=3*t;return this.uint16[6*t+0]=n,this.float32[o+1]=i,this.float32[o+2]=r,t}}o0.prototype.bytesPerElement=12,rQ("StructArrayLayout1ui2f12",o0);class o1 extends oI{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,n,i){let r=this.length;return this.resize(r+1),this.emplace(r,t,n,i)}emplace(t,n,i,r){let o=4*t;return this.uint32[2*t+0]=n,this.uint16[o+2]=i,this.uint16[o+3]=r,t}}o1.prototype.bytesPerElement=8,rQ("StructArrayLayout1ul2ui8",o1);class o2 extends oI{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,n){let i=this.length;return this.resize(i+1),this.emplace(i,t,n)}emplace(t,n,i){let r=2*t;return this.uint16[r+0]=n,this.uint16[r+1]=i,t}}o2.prototype.bytesPerElement=4,rQ("StructArrayLayout2ui4",o2);class o5 extends oI{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){let n=this.length;return this.resize(n+1),this.emplace(n,t)}emplace(t,n){return this.uint16[+t+0]=n,t}}o5.prototype.bytesPerElement=2,rQ("StructArrayLayout1ui2",o5);class o3 extends oI{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,n,i,r){let o=this.length;return this.resize(o+1),this.emplace(o,t,n,i,r)}emplace(t,n,i,r,o){let a=4*t;return this.float32[a+0]=n,this.float32[a+1]=i,this.float32[a+2]=r,this.float32[a+3]=o,t}}o3.prototype.bytesPerElement=16,rQ("StructArrayLayout4f16",o3);class o4 extends oM{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 w(this.anchorPointX,this.anchorPointY)}}o4.prototype.size=20;class o6 extends oW{get(t){return new o4(this,t)}}rQ("CollisionBoxArray",o6);class o8 extends oM{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(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}o8.prototype.size=48;class o7 extends oK{get(t){return new o8(this,t)}}rQ("PlacedSymbolArray",o7);class o9 extends oM{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(t){this._structArray.uint32[this._pos4+12]=t}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]}}o9.prototype.size=64;class ae extends oJ{get(t){return new o9(this,t)}}rQ("SymbolInstanceArray",ae);class at extends oQ{getoffsetX(t){return this.float32[+t+0]}}rQ("GlyphOffsetArray",at);class an extends oL{getx(t){return this.int16[3*t+0]}gety(t){return this.int16[3*t+1]}gettileUnitDistanceFromAnchor(t){return this.int16[3*t+2]}}rQ("SymbolLineVertexArray",an);class ai extends oM{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]}}ai.prototype.size=12;class ar extends o0{get(t){return new ai(this,t)}}rQ("TextAnchorOffsetArray",ar);class ao extends oM{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]}}ao.prototype.size=8;class aa extends o1{get(t){return new ao(this,t)}}rQ("FeatureIndexArray",aa);class as extends oP{}class al extends oP{}class ac extends oP{}class au extends oz{}class ad extends oj{}class ah extends oB{}class ap extends o${}class af extends oU{}class am extends oV{}class ag extends oH{}class av extends oq{}class ab extends oG{}class ay extends oZ{}class a_ extends oX{}class ax extends o2{}let{members:aw}=oR([{name:"a_pos",components:2,type:"Int16"}],4);class ak{constructor(t=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=t}prepareSegment(t,n,i,r){let o=this.segments[this.segments.length-1];return t>ak.MAX_VERTEX_ARRAY_LENGTH&&ex(`Max vertices per segment is ${ak.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${ak.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!o||o.vertexLength+t>ak.MAX_VERTEX_ARRAY_LENGTH||o.sortKey!==r?this.createNewSegment(n,i,r):o}createNewSegment(t,n,i){let r={vertexOffset:t.length,primitiveOffset:n.length,vertexLength:0,primitiveLength:0,vaos:{}};return void 0!==i&&(r.sortKey=i),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(r),r}getOrCreateLatestSegment(t,n,i){return this.prepareSegment(0,t,n,i)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let t of this.segments)for(let n in t.vaos)t.vaos[n].destroy()}static simpleSegment(t,n,i,r){return new ak([{vertexOffset:t,primitiveOffset:n,vertexLength:i,primitiveLength:r,vaos:{},sortKey:0}])}}function aC(t,n){return 256*(t=ep(Math.floor(t),0,255))+ep(Math.floor(n),0,255)}ak.MAX_VERTEX_ARRAY_LENGTH=65535,rQ("SegmentVector",ak);let aA=oR([{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"}]),aE=oR([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]);var aS,aT,aO,aF={exports:{}},aM={exports:{}},aI={exports:{}},aR=k(function(){if(aO)return aF.exports;aO=1;var t=(aS||(aS=1,aM.exports=function(t,n){var i,r,o,a,s,l,c,u;for(r=t.length-(i=3&t.length),o=n,s=0xcc9e2d51,l=0x1b873593,u=0;u<r;)c=255&t.charCodeAt(u)|(255&t.charCodeAt(++u))<<8|(255&t.charCodeAt(++u))<<16|(255&t.charCodeAt(++u))<<24,++u,o=27492+(65535&(a=5*(65535&(o=(o^=c=(65535&(c=(c=(65535&c)*s+(((c>>>16)*s&65535)<<16)|0)<<15|c>>>17))*l+(((c>>>16)*l&65535)<<16)|0)<<13|o>>>19))+((5*(o>>>16)&65535)<<16)|0))+((58964+(a>>>16)&65535)<<16);switch(c=0,i){case 3:c^=(255&t.charCodeAt(u+2))<<16;case 2:c^=(255&t.charCodeAt(u+1))<<8;case 1:o^=c=(65535&(c=(c=(65535&(c^=255&t.charCodeAt(u)))*s+(((c>>>16)*s&65535)<<16)|0)<<15|c>>>17))*l+(((c>>>16)*l&65535)<<16)|0}return o^=t.length,o=0x85ebca6b*(65535&(o^=o>>>16))+((0x85ebca6b*(o>>>16)&65535)<<16)|0,o=0xc2b2ae35*(65535&(o^=o>>>13))+((0xc2b2ae35*(o>>>16)&65535)<<16)|0,(o^=o>>>16)>>>0}),aM.exports),n=(aT||(aT=1,aI.exports=function(t,n){for(var i,r=t.length,o=n^r,a=0;r>=4;)i=0x5bd1e995*(65535&(i=255&t.charCodeAt(a)|(255&t.charCodeAt(++a))<<8|(255&t.charCodeAt(++a))<<16|(255&t.charCodeAt(++a))<<24))+((0x5bd1e995*(i>>>16)&65535)<<16),o=0x5bd1e995*(65535&o)+((0x5bd1e995*(o>>>16)&65535)<<16)^(i=0x5bd1e995*(65535&(i^=i>>>24))+((0x5bd1e995*(i>>>16)&65535)<<16)),r-=4,++a;switch(r){case 3:o^=(255&t.charCodeAt(a+2))<<16;case 2:o^=(255&t.charCodeAt(a+1))<<8;case 1:o=0x5bd1e995*(65535&(o^=255&t.charCodeAt(a)))+((0x5bd1e995*(o>>>16)&65535)<<16)}return o=0x5bd1e995*(65535&(o^=o>>>13))+((0x5bd1e995*(o>>>16)&65535)<<16),(o^=o>>>15)>>>0}),aI.exports);return aF.exports=t,aF.exports.murmur3=t,aF.exports.murmur2=n,aF.exports}());class aD{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,n,i,r){this.ids.push(aP(t)),this.positions.push(n,i,r)}getPositions(t){if(!this.indexed)throw Error("Trying to get index, but feature positions are not indexed");let n=aP(t),i=0,r=this.ids.length-1;for(;i<r;){let t=i+r>>1;this.ids[t]>=n?r=t:i=t+1}let o=[];for(;this.ids[i]===n;)o.push({index:this.positions[3*i],start:this.positions[3*i+1],end:this.positions[3*i+2]}),i++;return o}static serialize(t,n){let i=new Float64Array(t.ids),r=new Uint32Array(t.positions);return aL(i,r,0,i.length-1),n&&n.push(i.buffer,r.buffer),{ids:i,positions:r}}static deserialize(t){let n=new aD;return n.ids=t.ids,n.positions=t.positions,n.indexed=!0,n}}function aP(t){let n=+t;return!isNaN(n)&&n<=Number.MAX_SAFE_INTEGER?n:aR(String(t))}function aL(t,n,i,r){for(;i<r;){let o=t[i+r>>1],a=i-1,s=r+1;for(;;){do a++;while(t[a]<o);do s--;while(t[s]>o);if(a>=s)break;aN(t,a,s),aN(n,3*a,3*s),aN(n,3*a+1,3*s+1),aN(n,3*a+2,3*s+2)}s-i<r-s?(aL(t,n,i,s),i=s+1):(aL(t,n,s+1,r),r=s)}}function aN(t,n,i){let r=t[n];t[n]=t[i],t[i]=r}rQ("FeaturePositionMap",aD);class az{constructor(t,n){this.gl=t.gl,this.location=n}}class aj extends az{constructor(t,n){super(t,n),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))}}class aB extends az{constructor(t,n){super(t,n),this.current=[0,0,0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))}}class a$ extends az{constructor(t,n){super(t,n),this.current=tW.transparent}set(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))}}let aU=new Float32Array(16);function aV(t){return[aC(255*t.r,255*t.g),aC(255*t.b,255*t.a)]}class aH{constructor(t,n,i){this.value=t,this.uniformNames=n.map(t=>`u_${t}`),this.type=i}setUniform(t,n,i){t.set(i.constantOr(this.value))}getBinding(t,n,i){return"color"===this.type?new a$(t,n):new aj(t,n)}}class aq{constructor(t,n){this.uniformNames=n.map(t=>`u_${t}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,n){this.pixelRatioFrom=n.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=n.tlbr,this.patternTo=t.tlbr}setConstantDashPositions(t,n){this.dashTo=[0,t.y,t.height,t.width],this.dashFrom=[0,n.y,n.height,n.width]}setUniform(t,n,i,r){let o=null;"u_pattern_to"===r?o=this.patternTo:"u_pattern_from"===r?o=this.patternFrom:"u_dasharray_to"===r?o=this.dashTo:"u_dasharray_from"===r?o=this.dashFrom:"u_pixel_ratio_to"===r?o=this.pixelRatioTo:"u_pixel_ratio_from"===r&&(o=this.pixelRatioFrom),null!==o&&t.set(o)}getBinding(t,n,i){return i.startsWith("u_pattern")||i.startsWith("u_dasharray_")?new aB(t,n):new aj(t,n)}}class aW{constructor(t,n,i,r){this.expression=t,this.type=i,this.maxValue=0,this.paintVertexAttributes=n.map(t=>({name:`a_${t}`,type:"Float32",components:"color"===i?2:1,offset:0})),this.paintVertexArray=new r}populatePaintArray(t,n,i){let r=this.paintVertexArray.length,o=this.expression.evaluate(new ou(0,i),n,{},i.canonical,[],i.formattedSection);this.paintVertexArray.resize(t),this._setPaintValue(r,t,o)}updatePaintArray(t,n,i,r,o){let a=this.expression.evaluate(new ou(0,o),i,r);this._setPaintValue(t,n,a)}_setPaintValue(t,n,i){if("color"===this.type){let r=aV(i);for(let i=t;i<n;i++)this.paintVertexArray.emplace(i,r[0],r[1])}else{for(let r=t;r<n;r++)this.paintVertexArray.emplace(r,i);this.maxValue=Math.max(this.maxValue,Math.abs(i))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class aG{constructor(t,n,i,r,o,a){this.expression=t,this.uniformNames=n.map(t=>`u_${t}_t`),this.type=i,this.useIntegerZoom=r,this.zoom=o,this.maxValue=0,this.paintVertexAttributes=n.map(t=>({name:`a_${t}`,type:"Float32",components:"color"===i?4:2,offset:0})),this.paintVertexArray=new a}populatePaintArray(t,n,i){let r=this.expression.evaluate(new ou(this.zoom,i),n,{},i.canonical,[],i.formattedSection),o=this.expression.evaluate(new ou(this.zoom+1,i),n,{},i.canonical,[],i.formattedSection),a=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(a,t,r,o)}updatePaintArray(t,n,i,r,o){let a=this.expression.evaluate(new ou(this.zoom,o),i,r),s=this.expression.evaluate(new ou(this.zoom+1,o),i,r);this._setPaintValue(t,n,a,s)}_setPaintValue(t,n,i,r){if("color"===this.type){let o=aV(i),a=aV(r);for(let i=t;i<n;i++)this.paintVertexArray.emplace(i,o[0],o[1],a[0],a[1])}else{for(let o=t;o<n;o++)this.paintVertexArray.emplace(o,i,r);this.maxValue=Math.max(this.maxValue,Math.abs(i),Math.abs(r))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(t,n){let i=this.useIntegerZoom?Math.floor(n.zoom):n.zoom,r=ep(this.expression.interpolationFactor(i,this.zoom,this.zoom+1),0,1);t.set(r)}getBinding(t,n,i){return new aj(t,n)}}class aY{constructor(t,n,i,r,o,a){this.expression=t,this.type=n,this.useIntegerZoom=i,this.zoom=r,this.layerId=a,this.zoomInPaintVertexArray=new o,this.zoomOutPaintVertexArray=new o}populatePaintArray(t,n,i){let r=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(r,t,this.getPositionIds(n),i)}updatePaintArray(t,n,i,r,o){this._setPaintValues(t,n,this.getPositionIds(i),o)}_setPaintValues(t,n,i,r){let o=this.getPositions(r);if(!o||!i)return;let a=o[i.min],s=o[i.mid],l=o[i.max];if(a&&s&&l)for(let i=t;i<n;i++)this.emplace(this.zoomInPaintVertexArray,i,s,a),this.emplace(this.zoomOutPaintVertexArray,i,s,l)}upload(t){if(this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer){let n=this.getVertexAttributes();this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,n,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,n,this.expression.isStateDependent)}}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class aZ extends aY{getPositions(t){return t.imagePositions}getPositionIds(t){return t.patterns&&t.patterns[this.layerId]}getVertexAttributes(){return aA.members}emplace(t,n,i,r){t.emplace(n,i.tlbr[0],i.tlbr[1],i.tlbr[2],i.tlbr[3],r.tlbr[0],r.tlbr[1],r.tlbr[2],r.tlbr[3],i.pixelRatio,r.pixelRatio)}}class aX extends aY{getPositions(t){return t.dashPositions}getPositionIds(t){return t.dashes&&t.dashes[this.layerId]}getVertexAttributes(){return aE.members}emplace(t,n,i,r){t.emplace(n,0,i.y,i.height,i.width,0,r.y,r.height,r.width)}}class aK{constructor(t,n,i){this.binders={},this._buffers=[];const r=[];for(const o in t.paint._values){if(!i(o))continue;const a=t.paint.get(o);if(!(a instanceof oy&&iB(a.property.specification)))continue;const s=aQ(o,t.type),l=a.value,c=a.property.specification.type,u=a.property.useIntegerZoom,d=a.property.specification["property-type"],h="cross-faded"===d||"cross-faded-data-driven"===d;if("constant"===l.kind)this.binders[o]=h?new aq(l.value,s):new aH(l.value,s,c),r.push(`/u_${o}`);else if("source"===l.kind||h){const i=a0(o,c,"source");this.binders[o]=h?"line-dasharray"===o?new aX(l,c,u,n,i,t.id):new aZ(l,c,u,n,i,t.id):new aW(l,s,c,i),r.push(`/a_${o}`)}else{const t=a0(o,c,"composite");this.binders[o]=new aG(l,s,c,u,n,t),r.push(`/z_${o}`)}}this.cacheKey=r.sort().join("")}getMaxValue(t){let n=this.binders[t];return n instanceof aW||n instanceof aG?n.maxValue:0}populatePaintArrays(t,n,i){for(let r in this.binders){let o=this.binders[r];(o instanceof aW||o instanceof aG||o instanceof aY)&&o.populatePaintArray(t,n,i)}}setConstantPatternPositions(t,n){for(let i in this.binders){let r=this.binders[i];r instanceof aq&&r.setConstantPatternPositions(t,n)}}setConstantDashPositions(t,n){for(let i in this.binders){let r=this.binders[i];r instanceof aq&&r.setConstantDashPositions(t,n)}}updatePaintArrays(t,n,i,r,o){let a=!1;for(let s in t)for(let l of n.getPositions(s)){let n=i.feature(l.index);for(let i in this.binders){let c=this.binders[i];(c instanceof aW||c instanceof aG||c instanceof aY)&&!0===c.expression.isStateDependent&&(c.expression=r.paint.get(i).value,c.updatePaintArray(l.start,l.end,n,t[s],o),a=!0)}}return a}defines(){let t=[];for(let n in this.binders){let i=this.binders[n];(i instanceof aH||i instanceof aq)&&t.push(...i.uniformNames.map(t=>`#define HAS_UNIFORM_${t}`))}return t}getBinderAttributes(){let t=[];for(let n in this.binders){let i=this.binders[n];if(i instanceof aW||i instanceof aG)for(let n=0;n<i.paintVertexAttributes.length;n++)t.push(i.paintVertexAttributes[n].name);else if(i instanceof aY)for(let n of i.getVertexAttributes())t.push(n.name)}return t}getBinderUniforms(){let t=[];for(let n in this.binders){let i=this.binders[n];if(i instanceof aH||i instanceof aq||i instanceof aG)for(let n of i.uniformNames)t.push(n)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,n){let i=[];for(let r in this.binders){let o=this.binders[r];if(o instanceof aH||o instanceof aq||o instanceof aG){for(let a of o.uniformNames)if(n[a]){let s=o.getBinding(t,n[a],a);i.push({name:a,property:r,binding:s})}}}return i}setUniforms(t,n,i,r){for(let{name:t,property:o,binding:a}of n)this.binders[o].setUniform(a,r,i.get(o),t)}updatePaintBuffers(t){for(let n in this._buffers=[],this.binders){let i=this.binders[n];if(t&&i instanceof aY){let n=2===t.fromScale?i.zoomInPaintVertexBuffer:i.zoomOutPaintVertexBuffer;n&&this._buffers.push(n)}else(i instanceof aW||i instanceof aG)&&i.paintVertexBuffer&&this._buffers.push(i.paintVertexBuffer)}}upload(t){for(let n in this.binders){let i=this.binders[n];(i instanceof aW||i instanceof aG||i instanceof aY)&&i.upload(t)}this.updatePaintBuffers()}destroy(){for(let t in this.binders){let n=this.binders[t];(n instanceof aW||n instanceof aG||n instanceof aY)&&n.destroy()}}}class aJ{constructor(t,n,i=()=>!0){for(const r of(this.programConfigurations={},t))this.programConfigurations[r.id]=new aK(r,n,i);this.needsUpload=!1,this._featureMap=new aD,this._bufferOffset=0}populatePaintArrays(t,n,i,r){for(let i in this.programConfigurations)this.programConfigurations[i].populatePaintArrays(t,n,r);void 0!==n.id&&this._featureMap.add(n.id,i,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,n,i,r){for(let o of i)this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(t,this._featureMap,n,o,r)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(let n in this.programConfigurations)this.programConfigurations[n].upload(t);this.needsUpload=!1}}destroy(){for(let t in this.programConfigurations)this.programConfigurations[t].destroy()}}function aQ(t,n){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"]})[t]||[t.replace(`${n}-`,"").replace(/-/g,"_")]}function a0(t,n,i){let r={color:{source:oB,composite:o3},number:{source:oQ,composite:oB}},o=function(t){return({"line-pattern":{source:ap,composite:ap},"fill-pattern":{source:ap,composite:ap},"fill-extrusion-pattern":{source:ap,composite:ap},"line-dasharray":{source:af,composite:af}})[t]}(t);return o&&o[i]||r[n][i]}rQ("ConstantBinder",aH),rQ("CrossFadedConstantBinder",aq),rQ("SourceExpressionBinder",aW),rQ("CrossFadedPatternBinder",aZ),rQ("CrossFadedDasharrayBinder",aX),rQ("CompositeExpressionBinder",aG),rQ("ProgramConfiguration",aK,{omit:["_buffers"]}),rQ("ProgramConfigurationSet",aJ);let a1=16383,a2=-16383-1;function a5(t){let n=ea/t.extent,i=t.loadGeometry();for(let t=0;t<i.length;t++){let r=i[t];for(let t=0;t<r.length;t++){let i=r[t],o=Math.round(i.x*n),a=Math.round(i.y*n);i.x=ep(o,a2,a1),i.y=ep(a,a2,a1),(o<i.x||o>i.x+1||a<i.y||a>i.y+1)&&ex("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return i}function a3(t,n){return{type:t.type,id:t.id,properties:t.properties,geometry:n?a5(t):[]}}let a4=-32768;function a6(t,n,i,r,o){t.emplaceBack(a4+8*n+r,a4+8*i+o)}class a8{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(t=>t.id),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new al,this.indexArray=new a_,this.segments=new ak,this.programConfigurations=new aJ(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(t,n,i){let r=this.layers[0],o=[],a=null,s=!1,l="heatmap"===r.type;if("circle"===r.type){let t=r;s=!(a=t.layout.get("circle-sort-key")).isConstant(),l=l||"map"===t.paint.get("circle-pitch-alignment")}let c=l?n.subdivisionGranularity.circle:1;for(let{feature:n,id:r,index:l,sourceLayerIndex:c}of t){let t=this.layers[0]._featureFilter.needGeometry,u=a3(n,t);if(!this.layers[0]._featureFilter.filter(new ou(this.zoom),u,i))continue;let d=s?a.evaluate(u,{},i):void 0,h={id:r,properties:n.properties,type:n.type,sourceLayerIndex:c,index:l,geometry:t?u.geometry:a5(n),patterns:{},sortKey:d};o.push(h)}for(let r of(s&&o.sort((t,n)=>t.sortKey-n.sortKey),o)){let{geometry:o,index:a,sourceLayerIndex:s}=r,l=t[a].feature;this.addFeature(r,o,a,i,c),n.featureIndex.insert(l,o,a,s,this.index)}}update(t,n,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,n,this.stateDependentLayers,{imagePositions:i})}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,aw),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,n,i,r,o=1){let a;switch(o){case 1:a=[0,7];break;case 3:a=[0,2,5,7];break;case 5:a=[0,1,3,4,6,7];break;case 7:a=[0,1,2,3,4,5,6,7];break;default:throw Error(`Invalid circle bucket granularity: ${o}; valid values are 1, 3, 5, 7.`)}let s=a.length;for(let i of n)for(let n of i){let i=n.x,r=n.y;if(i<0||i>=ea||r<0||r>=ea)continue;let o=this.segments.prepareSegment(s*s,this.layoutVertexArray,this.indexArray,t.sortKey),l=o.vertexLength;for(let t=0;t<s;t++)for(let n=0;n<s;n++)a6(this.layoutVertexArray,i,r,a[n],a[t]);for(let t=0;t<s-1;t++)for(let n=0;n<s-1;n++){let i=l+t*s+n,r=l+(t+1)*s+n;this.indexArray.emplaceBack(i,r+1,i+1),this.indexArray.emplaceBack(i,r,r+1)}o.vertexLength+=s*s,o.primitiveLength+=(s-1)*(s-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{imagePositions:{},canonical:r})}}function a7(t,n){for(let i=0;i<t.length;i++)if(ss(n,t[i]))return!0;for(let i=0;i<n.length;i++)if(ss(t,n[i]))return!0;return!!sn(t,n)}function a9(t,n,i){return!!ss(t,n)||!!sr(n,t,i)}function se(t,n){if(1===t.length)return sa(n,t[0]);for(let i=0;i<n.length;i++){let r=n[i];for(let n=0;n<r.length;n++)if(ss(t,r[n]))return!0}for(let i=0;i<t.length;i++)if(sa(n,t[i]))return!0;for(let i=0;i<n.length;i++)if(sn(t,n[i]))return!0;return!1}function st(t,n,i){if(t.length>1){if(sn(t,n))return!0;for(let r=0;r<n.length;r++)if(sr(n[r],t,i))return!0}for(let r=0;r<t.length;r++)if(sr(t[r],n,i))return!0;return!1}function sn(t,n){if(0===t.length||0===n.length)return!1;for(let i=0;i<t.length-1;i++){let r=t[i],o=t[i+1];for(let t=0;t<n.length-1;t++)if(si(r,o,n[t],n[t+1]))return!0}return!1}function si(t,n,i,r){return ew(t,i,r)!==ew(n,i,r)&&ew(t,n,i)!==ew(t,n,r)}function sr(t,n,i){let r=i*i;if(1===n.length)return t.distSqr(n[0])<r;for(let i=1;i<n.length;i++)if(so(t,n[i-1],n[i])<r)return!0;return!1}function so(t,n,i){let r=n.distSqr(i);if(0===r)return t.distSqr(n);let o=((t.x-n.x)*(i.x-n.x)+(t.y-n.y)*(i.y-n.y))/r;return t.distSqr(o<0?n:o>1?i:i.sub(n)._mult(o)._add(n))}function sa(t,n){let i,r,o,a=!1;for(let s=0;s<t.length;s++){i=t[s];for(let t=0,s=i.length-1;t<i.length;s=t++)r=i[t],o=i[s],r.y>n.y!=o.y>n.y&&n.x<(o.x-r.x)*(n.y-r.y)/(o.y-r.y)+r.x&&(a=!a)}return a}function ss(t,n){let i=!1;for(let r=0,o=t.length-1;r<t.length;o=r++){let a=t[r],s=t[o];a.y>n.y!=s.y>n.y&&n.x<(s.x-a.x)*(n.y-a.y)/(s.y-a.y)+a.x&&(i=!i)}return i}function sl(t,n,i){let r=i[0],o=i[2];if(t.x<r.x&&n.x<r.x||t.x>o.x&&n.x>o.x||t.y<r.y&&n.y<r.y||t.y>o.y&&n.y>o.y)return!1;let a=ew(t,n,i[0]);return a!==ew(t,n,i[1])||a!==ew(t,n,i[2])||a!==ew(t,n,i[3])}function sc(t,n,i){let r=n.paint.get(t).value;return"constant"===r.kind?r.value:i.programConfigurations.get(n.id).getMaxValue(t)}function su(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function sd(t,n,i,r,o){if(!n[0]&&!n[1])return t;let a=w.convert(n)._mult(o);"viewport"===i&&a._rotate(-r);let s=[];for(let n=0;n<t.length;n++)s.push(t[n].sub(a));return s}function sh(t){let n=[];for(let i=0;i<t.length;i++){let r=t[i],o=n.at(-1);(0===i||o&&!r.equals(o))&&n.push(r)}return n}function sp({queryGeometry:t,size:n},i){return a9(t,i,n)}function sf({queryGeometry:t,size:n,transform:i,unwrappedTileID:r,getElevation:o},a){return a9(t,a,n*(i.projectTileCoordinates(a.x,a.y,r,o).signedDistanceFromCamera/i.cameraToCenterDistance))}function sm({queryGeometry:t,size:n,transform:i,unwrappedTileID:r,getElevation:o},a){let s=i.projectTileCoordinates(a.x,a.y,r,o).signedDistanceFromCamera,l=n*(i.cameraToCenterDistance/s);return a9(t,sb(a,i,r,o),l)}function sg({queryGeometry:t,size:n,transform:i,unwrappedTileID:r,getElevation:o},a){return a9(t,sb(a,i,r,o),n)}function sv({queryGeometry:t,size:n,transform:i,unwrappedTileID:r,getElevation:o,pitchAlignment:a="map",pitchScale:s="map"},l){let c="map"===a?"map"===s?sp:sf:"map"===s?sm:sg,u={queryGeometry:t,size:n,transform:i,unwrappedTileID:r,getElevation:o};for(let t of l)for(let n of t)if(c(u,n))return!0;return!1}function sb(t,n,i,r){let o=n.projectTileCoordinates(t.x,t.y,i,r).point;return new w((.5*o.x+.5)*n.width,(-(.5*o.y)+.5)*n.height)}rQ("CircleBucket",a8,{omit:["layers"]});var sy={get paint(){return l=l||new oE({"circle-radius":new ow(eY.paint_circle["circle-radius"]),"circle-color":new ow(eY.paint_circle["circle-color"]),"circle-blur":new ow(eY.paint_circle["circle-blur"]),"circle-opacity":new ow(eY.paint_circle["circle-opacity"]),"circle-translate":new ox(eY.paint_circle["circle-translate"]),"circle-translate-anchor":new ox(eY.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new ox(eY.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new ox(eY.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new ow(eY.paint_circle["circle-stroke-width"]),"circle-stroke-color":new ow(eY.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new ow(eY.paint_circle["circle-stroke-opacity"])})},get layout(){return s=s||new oE({"circle-sort-key":new ow(eY.layout_circle["circle-sort-key"])})}};class s_ extends oS{constructor(t,n){super(t,sy,n)}createBucket(t){return new a8(t)}queryRadius(t){let n=t;return sc("circle-radius",this,n)+sc("circle-stroke-width",this,n)+su(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:t,feature:n,featureState:i,geometry:r,transform:o,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:l}){let c,u,d=sd(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-o.bearingInRadians,a),h=this.paint.get("circle-radius").evaluate(n,i)+this.paint.get("circle-stroke-width").evaluate(n,i),p=this.paint.get("circle-pitch-scale"),f=this.paint.get("circle-pitch-alignment");return"map"===f?(c=d,u=h*a):(c=function(t,n,i,r){return t.map(t=>sb(t,n,i,r))}(d,o,s,l),u=h),sv({queryGeometry:c,size:u,transform:o,unwrappedTileID:s,getElevation:l,pitchAlignment:f,pitchScale:p},r)}}class sx extends a8{}rQ("HeatmapBucket",sx,{omit:["layers"]});var sw={get paint(){return c=c||new oE({"heatmap-radius":new ow(eY.paint_heatmap["heatmap-radius"]),"heatmap-weight":new ow(eY.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new ox(eY.paint_heatmap["heatmap-intensity"]),"heatmap-color":new oA(eY.paint_heatmap["heatmap-color"]),"heatmap-opacity":new ox(eY.paint_heatmap["heatmap-opacity"])})}};function sk(t,{width:n,height:i},r,o){if(o){if(o instanceof Uint8ClampedArray)o=new Uint8Array(o.buffer);else if(o.length!==n*i*r)throw RangeError(`mismatched image size. expected: ${o.length} but got: ${n*i*r}`)}else o=new Uint8Array(n*i*r);return t.width=n,t.height=i,t.data=o,t}function sC(t,{width:n,height:i},r){if(n===t.width&&i===t.height)return;let o=sk({},{width:n,height:i},r);sA(t,o,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,i)},r),t.width=n,t.height=i,t.data=o.data}function sA(t,n,i,r,o,a){if(0===o.width||0===o.height)return n;if(o.width>t.width||o.height>t.height||i.x>t.width-o.width||i.y>t.height-o.height)throw RangeError("out of range source coordinates for image copy");if(o.width>n.width||o.height>n.height||r.x>n.width-o.width||r.y>n.height-o.height)throw RangeError("out of range destination coordinates for image copy");let s=t.data,l=n.data;if(s===l)throw Error("srcData equals dstData, so image is already copied");for(let c=0;c<o.height;c++){let u=((i.y+c)*t.width+i.x)*a,d=((r.y+c)*n.width+r.x)*a;for(let t=0;t<o.width*a;t++)l[d+t]=s[u+t]}return n}class sE{constructor(t,n){sk(this,t,1,n)}resize(t){sC(this,t,1)}clone(){return new sE({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,n,i,r,o){sA(t,n,i,r,o,1)}}class sS{constructor(t,n){sk(this,t,4,n)}resize(t){sC(this,t,4)}replace(t,n){n?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t}clone(){return new sS({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,n,i,r,o){sA(t,n,i,r,o,4)}setPixel(t,n,i){let r=4*(t*this.width+n);this.data[r+0]=Math.round(255*i.r/i.a),this.data[r+1]=Math.round(255*i.g/i.a),this.data[r+2]=Math.round(255*i.b/i.a),this.data[r+3]=Math.round(255*i.a)}}function sT(t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i+=4){let r=t[i+3];n[i+0]=Math.round(t[i+0]*r/255),n[i+1]=Math.round(t[i+1]*r/255),n[i+2]=Math.round(t[i+2]*r/255),n[i+3]=r}return n}function sO(t){let n={},i=t.resolution||256,r=t.clips?t.clips.length:1,o=t.image||new sS({width:i,height:r});if(Math.log(i)/Math.LN2%1!=0)throw Error(`width is not a power of 2 - ${i}`);let a=(r,a,s)=>{n[t.evaluationKey]=s;let l=t.expression.evaluate(n);o.setPixel(r/4/i,a/4,l)};if(t.clips)for(let n=0,o=0;n<r;++n,o+=4*i)for(let r=0,s=0;r<i;r++,s+=4){let l=r/(i-1),{start:c,end:u}=t.clips[n];a(o,s,c*(1-l)+u*l)}else for(let t=0,n=0;t<i;t++,n+=4)a(0,n,t/(i-1));return o}rQ("AlphaImage",sE),rQ("RGBAImage",sS);let sF="big-fb";class sM extends oS{createBucket(t){return new sx(t)}constructor(t,n){super(t,sw,n),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){"heatmap-color"===t&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=sO({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(sF)&&this.heatmapFbos.delete(sF)}queryRadius(t){return sc("heatmap-radius",this,t)}queryIntersectsFeature({queryGeometry:t,feature:n,featureState:i,geometry:r,transform:o,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:l}){return sv({queryGeometry:t,size:this.paint.get("heatmap-radius").evaluate(n,i)*a,transform:o,unwrappedTileID:s,getElevation:l},r)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&!this.isHidden()}}var sI={get paint(){return u=u||new oE({"hillshade-illumination-direction":new ox(eY.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-altitude":new ox(eY.paint_hillshade["hillshade-illumination-altitude"]),"hillshade-illumination-anchor":new ox(eY.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new ox(eY.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new ox(eY.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new ox(eY.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new ox(eY.paint_hillshade["hillshade-accent-color"]),"hillshade-method":new ox(eY.paint_hillshade["hillshade-method"])})}};class sR extends oS{constructor(t,n){super(t,sI,n),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let t=this.paint.get("hillshade-illumination-direction").values,n=this.paint.get("hillshade-illumination-altitude").values,i=this.paint.get("hillshade-highlight-color").values,r=this.paint.get("hillshade-shadow-color").values,o=Math.max(t.length,n.length,i.length,r.length);t=t.concat(Array(o-t.length).fill(t.at(-1))),n=n.concat(Array(o-n.length).fill(n.at(-1))),i=i.concat(Array(o-i.length).fill(i.at(-1))),r=r.concat(Array(o-r.length).fill(r.at(-1)));let a=n.map(eO);return{directionRadians:t.map(eO),altitudeRadians:a,shadowColor:r,highlightColor:i}}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&!this.isHidden()}}var sD={get paint(){return d=d||new oE({"color-relief-opacity":new ox(eY["paint_color-relief"]["color-relief-opacity"]),"color-relief-color":new oA(eY["paint_color-relief"]["color-relief-color"])})}};function sP(t){return"data"in t}class sL{constructor(t,n,i,r){this.context=t,this.format=i,this.texture=t.gl.createTexture(),this._ownedHandle=this.texture,this.update(n,r)}update(t,n,i){let{width:r,height:o}=t,a=!(this.size&&this.size[0]===r&&this.size[1]===o||i),{context:s}=this,{gl:l}=s;this.useMipmap=!!(n&&n.useMipmap),l.bindTexture(l.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1);let c=this.format===l.RGBA&&(!n||!1!==n.premultiply);if(a)this.size=[r,o],sP(t)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(t,c,r,o,l)):(s.pixelStoreUnpackPremultiplyAlpha.set(c),this._uploadDomImage(t,l));else{let{x:n,y:a}=i||{x:0,y:0};sP(t)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(t,c,n,a,r,o,l)):(s.pixelStoreUnpackPremultiplyAlpha.set(c),this._updateDomImage(t,n,a,l))}this.useMipmap&&this.isSizePowerOfTwo()&&l.generateMipmap(l.TEXTURE_2D),s.pixelStoreUnpackFlipY.setDefault(),s.pixelStoreUnpack.setDefault(),s.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(t,n){n.texImage2D(n.TEXTURE_2D,0,this.format,this.format,n.UNSIGNED_BYTE,t)}_uploadRawData(t,n,i,r,o){let{data:a}=t;n&&a&&(a=sT(a)),o.texImage2D(o.TEXTURE_2D,0,this.format,i,r,0,this.format,o.UNSIGNED_BYTE,a)}_updateDomImage(t,n,i,r){r.texSubImage2D(r.TEXTURE_2D,0,n,i,r.RGBA,r.UNSIGNED_BYTE,t)}_updateRawData(t,n,i,r,o,a,s){let{data:l}=t;n&&l&&(l=sT(l)),s.texSubImage2D(s.TEXTURE_2D,0,i,r,o,a,s.RGBA,s.UNSIGNED_BYTE,l)}bind(t,n,i){let{context:r}=this,{gl:o}=r;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),o.bindTexture(o.TEXTURE_2D,this.texture),i!==o.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(i=o.LINEAR),t!==this.filter&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,t),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,i||t),this.filter=t),n!==this.wrap&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,n),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,n),this.wrap=n)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}}class sN{constructor(t,n,i,r=1,o=1,a=1,s=0){if(this.uid=t,n.height!==n.width)throw RangeError("DEM tiles must be square");if(i&&!["mapbox","terrarium","custom"].includes(i))return void ex(`"${i}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=n.height;const l=this.dim=n.height-2;switch(this.data=new Uint32Array(n.data.buffer),i){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=r,this.greenFactor=o,this.blueFactor=a,this.baseShift=s;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let t=0;t<l;t++)this.data[this._idx(-1,t)]=this.data[this._idx(0,t)],this.data[this._idx(l,t)]=this.data[this._idx(l-1,t)],this.data[this._idx(t,-1)]=this.data[this._idx(t,0)],this.data[this._idx(t,l)]=this.data[this._idx(t,l-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(l,-1)]=this.data[this._idx(l-1,0)],this.data[this._idx(-1,l)]=this.data[this._idx(0,l-1)],this.data[this._idx(l,l)]=this.data[this._idx(l-1,l-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let t=0;t<l;t++)for(let n=0;n<l;n++){const i=this.get(t,n);i>this.max&&(this.max=i),i<this.min&&(this.min=i)}}get(t,n){let i=new Uint8Array(this.data.buffer),r=4*this._idx(t,n);return this.unpack(i[r],i[r+1],i[r+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(t,n){if(t<-1||t>=this.dim+1||n<-1||n>=this.dim+1)throw RangeError(`Out of range source coordinates for DEM data. x: ${t}, y: ${n}, dim: ${this.dim}`);return(n+1)*this.stride+(t+1)}unpack(t,n,i){return t*this.redFactor+n*this.greenFactor+i*this.blueFactor-this.baseShift}pack(t){return sz(t,this.getUnpackVector())}getPixels(){return new sS({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(t,n,i){if(this.dim!==t.dim)throw Error("dem dimension mismatch");let r=n*this.dim,o=n*this.dim+this.dim,a=i*this.dim,s=i*this.dim+this.dim;switch(n){case -1:r=o-1;break;case 1:o=r+1}switch(i){case -1:a=s-1;break;case 1:s=a+1}let l=-n*this.dim,c=-i*this.dim;for(let n=a;n<s;n++)for(let i=r;i<o;i++)this.data[this._idx(i,n)]=t.data[this._idx(i+l,n+c)]}}function sz(t,n){let i=n[0],r=n[1],o=n[2],a=n[3],s=Math.min(i,r,o),l=Math.round((t+a)/s);return{r:Math.floor(l*s/i)%256,g:Math.floor(l*s/r)%256,b:Math.floor(l*s/o)%256}}rQ("DEMData",sN);class sj extends oS{constructor(t,n){super(t,sD,n)}_createColorRamp(t){let n={elevationStops:[],colorStops:[]},i=this._transitionablePaint._values["color-relief-color"].value.expression;if(i instanceof i1&&i._styleExpression.expression instanceof n_){this.colorRampExpression=i;let t=i._styleExpression.expression;for(let i of(n.elevationStops=t.labels,n.colorStops=[],n.elevationStops))n.colorStops.push(t.evaluate({globals:{elevation:i}}))}if(n.elevationStops.length<1&&(n.elevationStops=[0],n.colorStops=[tW.transparent]),n.elevationStops.length<2&&(n.elevationStops.push(n.elevationStops[0]+1),n.colorStops.push(n.colorStops[0])),n.elevationStops.length<=t)return n;let r={elevationStops:[],colorStops:[]},o=(n.elevationStops.length-1)/(t-1);for(let t=0;t<n.elevationStops.length-.5;t+=o)r.elevationStops.push(n.elevationStops[Math.round(t)]),r.colorStops.push(n.colorStops[Math.round(t)]);return ex(`Too many colors in specification of ${this.id} color-relief layer, may not render properly. Max possible colors: ${t}, provided: ${n.elevationStops.length}`),r}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values["color-relief-color"].value.expression}getColorRampTextures(t,n,i){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;let r=this._createColorRamp(n),o=new sS({width:r.colorStops.length,height:1}),a=new sS({width:r.colorStops.length,height:1});for(let t=0;t<r.elevationStops.length;t++){let n=sz(r.elevationStops[t],i);a.setPixel(0,t,new tW(n.r/255,n.g/255,n.b/255,1)),o.setPixel(0,t,r.colorStops[t])}return this.colorRampTextures={elevationTexture:new sL(t,a,t.gl.RGBA),colorTexture:new sL(t,o,t.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return!this.isHidden()&&!!this.colorRampTextures}}let{members:sB}=oR([{name:"a_pos",components:2,type:"Int16"}],4);function s$(t,n,i){let r=i.patternDependencies,o=!1;for(let i of n){let n=i.paint.get(`${t}-pattern`);n.isConstant()||(o=!0);let a=n.constantOr(null);a&&(o=!0,r[a.to]=!0,r[a.from]=!0)}return o}function sU(t,n,i,r,o){let{zoom:a}=r,s=o.patternDependencies;for(let r of n){let n=r.paint.get(`${t}-pattern`).value;if("constant"!==n.kind){let t=n.evaluate({zoom:a-1},i,{},o.availableImages),l=n.evaluate({zoom:a},i,{},o.availableImages),c=n.evaluate({zoom:a+1},i,{},o.availableImages);t=t&&t.name?t.name:t,l=l&&l.name?l.name:l,c=c&&c.name?c.name:c,s[t]=!0,s[l]=!0,s[c]=!0,i.patterns[r.id]={min:t,mid:l,max:c}}}return i}function sV(t,n,i,r,o){let a;if(o===function(t,n,i,r){let o=0;for(let a=n,s=i-r;a<i;a+=r)o+=(t[s]-t[a])*(t[a+1]+t[s+1]),s=a;return o}(t,n,i,r)>0)for(let o=n;o<i;o+=r)a=lt(o/r|0,t[o],t[o+1],a);else for(let o=i-r;o>=n;o-=r)a=lt(o/r|0,t[o],t[o+1],a);return a&&s4(a,a.next)&&(ln(a),a=a.next),a}function sH(t,n){if(!t)return t;n||(n=t);let i,r=t;do if(i=!1,r.steiner||!s4(r,r.next)&&0!==s3(r.prev,r,r.next))r=r.next;else{if(ln(r),(r=n=r.prev)===r.next)break;i=!0}while(i||r!==n);return n}function sq(t,n,i,r,o,a,s){if(!t)return;!s&&a&&function(t,n,i,r){let o=t;do 0===o.z&&(o.z=sQ(o.x,o.y,n,i,r)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==t);o.prevZ.nextZ=null,o.prevZ=null,function(t){let n,i=1;do{let r,o=t;t=null;let a=null;for(n=0;o;){n++;let s=o,l=0;for(let t=0;t<i&&(l++,s=s.nextZ);t++);let c=i;for(;l>0||c>0&&s;)0!==l&&(0===c||!s||o.z<=s.z)?(r=o,o=o.nextZ,l--):(r=s,s=s.nextZ,c--),a?a.nextZ=r:t=r,r.prevZ=a,a=r;o=s}a.nextZ=null,i*=2}while(n>1)}(o)}(t,r,o,a);let l=t;for(;t.prev!==t.next;){let c=t.prev,u=t.next;if(a?sG(t,r,o,a):sW(t))n.push(c.i,t.i,u.i),ln(t),t=u.next,l=u.next;else if((t=u)===l){s?1===s?sq(t=sY(sH(t),n),n,i,r,o,a,2):2===s&&sZ(t,n,i,r,o,a):sq(sH(t),n,i,r,o,a,1);break}}}function sW(t){let n=t.prev,i=t,r=t.next;if(s3(n,i,r)>=0)return!1;let o=n.x,a=i.x,s=r.x,l=n.y,c=i.y,u=r.y,d=Math.min(o,a,s),h=Math.min(l,c,u),p=Math.max(o,a,s),f=Math.max(l,c,u),m=r.next;for(;m!==n;){if(m.x>=d&&m.x<=p&&m.y>=h&&m.y<=f&&s2(o,l,a,c,s,u,m.x,m.y)&&s3(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function sG(t,n,i,r){let o=t.prev,a=t,s=t.next;if(s3(o,a,s)>=0)return!1;let l=o.x,c=a.x,u=s.x,d=o.y,h=a.y,p=s.y,f=Math.min(l,c,u),m=Math.min(d,h,p),g=Math.max(l,c,u),v=Math.max(d,h,p),b=sQ(f,m,n,i,r),y=sQ(g,v,n,i,r),_=t.prevZ,x=t.nextZ;for(;_&&_.z>=b&&x&&x.z<=y;){if(_.x>=f&&_.x<=g&&_.y>=m&&_.y<=v&&_!==o&&_!==s&&s2(l,d,c,h,u,p,_.x,_.y)&&s3(_.prev,_,_.next)>=0||(_=_.prevZ,x.x>=f&&x.x<=g&&x.y>=m&&x.y<=v&&x!==o&&x!==s&&s2(l,d,c,h,u,p,x.x,x.y)&&s3(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;_&&_.z>=b;){if(_.x>=f&&_.x<=g&&_.y>=m&&_.y<=v&&_!==o&&_!==s&&s2(l,d,c,h,u,p,_.x,_.y)&&s3(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;x&&x.z<=y;){if(x.x>=f&&x.x<=g&&x.y>=m&&x.y<=v&&x!==o&&x!==s&&s2(l,d,c,h,u,p,x.x,x.y)&&s3(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function sY(t,n){let i=t;do{let r=i.prev,o=i.next.next;!s4(r,o)&&s6(r,i,i.next,o)&&s9(r,o)&&s9(o,r)&&(n.push(r.i,i.i,o.i),ln(i),ln(i.next),i=t=o),i=i.next}while(i!==t);return sH(i)}function sZ(t,n,i,r,o,a){let s=t;do{let t=s.next.next;for(;t!==s.prev;){if(s.i!==t.i&&s5(s,t)){let l=le(s,t);return s=sH(s,s.next),l=sH(l,l.next),sq(s,n,i,r,o,a,0),void sq(l,n,i,r,o,a,0)}t=t.next}s=s.next}while(s!==t)}function sX(t,n){let i=t.x-n.x;return 0===i&&0==(i=t.y-n.y)&&(i=(t.next.y-t.y)/(t.next.x-t.x)-(n.next.y-n.y)/(n.next.x-n.x)),i}function sK(t,n){let i=function(t,n){let i=n,r=t.x,o=t.y,a,s=-1/0;if(s4(t,i))return i;do{if(s4(t,i.next))return i.next;if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){let t=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=r&&t>s&&(s=t,a=i.x<i.next.x?i:i.next,t===r))return a}i=i.next}while(i!==n);if(!a)return null;let l=a,c=a.x,u=a.y,d=1/0;i=a;do{if(r>=i.x&&i.x>=c&&r!==i.x&&s1(o<u?r:s,o,c,u,o<u?s:r,o,i.x,i.y)){let n=Math.abs(o-i.y)/(r-i.x);s9(i,t)&&(n<d||n===d&&(i.x>a.x||i.x===a.x&&sJ(a,i)))&&(a=i,d=n)}i=i.next}while(i!==l);return a}(t,n);if(!i)return n;let r=le(i,t);return sH(r,r.next),sH(i,i.next)}function sJ(t,n){return 0>s3(t.prev,t,n.prev)&&0>s3(n.next,t,t.next)}function sQ(t,n,i,r,o){return(t=0x55555555&((t=0x33333333&((t=0xf0f0f0f&((t=0xff00ff&((t=(t-i)*o|0)|t<<8))|t<<4))|t<<2))|t<<1))|(n=0x55555555&((n=0x33333333&((n=0xf0f0f0f&((n=0xff00ff&((n=(n-r)*o|0)|n<<8))|n<<4))|n<<2))|n<<1))<<1}function s0(t){let n=t,i=t;do(n.x<i.x||n.x===i.x&&n.y<i.y)&&(i=n),n=n.next;while(n!==t);return i}function s1(t,n,i,r,o,a,s,l){return(o-s)*(n-l)>=(t-s)*(a-l)&&(t-s)*(r-l)>=(i-s)*(n-l)&&(i-s)*(a-l)>=(o-s)*(r-l)}function s2(t,n,i,r,o,a,s,l){return(t!==s||n!==l)&&s1(t,n,i,r,o,a,s,l)}function s5(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!function(t,n){let i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==n.i&&i.next.i!==n.i&&s6(i,i.next,t,n))return!0;i=i.next}while(i!==t);return!1}(t,n)&&(s9(t,n)&&s9(n,t)&&function(t,n){let i=t,r=!1,o=(t.x+n.x)/2,a=(t.y+n.y)/2;do i.y>a!=i.next.y>a&&i.next.y!==i.y&&o<(i.next.x-i.x)*(a-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next;while(i!==t);return r}(t,n)&&(s3(t.prev,t,n.prev)||s3(t,n.prev,n))||s4(t,n)&&s3(t.prev,t,t.next)>0&&s3(n.prev,n,n.next)>0)}function s3(t,n,i){return(n.y-t.y)*(i.x-n.x)-(n.x-t.x)*(i.y-n.y)}function s4(t,n){return t.x===n.x&&t.y===n.y}function s6(t,n,i,r){let o=s7(s3(t,n,i)),a=s7(s3(t,n,r)),s=s7(s3(i,r,t)),l=s7(s3(i,r,n));return o!==a&&s!==l||!(0!==o||!s8(t,i,n))||!(0!==a||!s8(t,r,n))||!(0!==s||!s8(i,t,r))||!(0!==l||!s8(i,n,r))}function s8(t,n,i){return n.x<=Math.max(t.x,i.x)&&n.x>=Math.min(t.x,i.x)&&n.y<=Math.max(t.y,i.y)&&n.y>=Math.min(t.y,i.y)}function s7(t){return t>0?1:t<0?-1:0}function s9(t,n){return 0>s3(t.prev,t,t.next)?s3(t,n,t.next)>=0&&s3(t,t.prev,n)>=0:0>s3(t,n,t.prev)||0>s3(t,t.next,n)}function le(t,n){let i=li(t.i,t.x,t.y),r=li(n.i,n.x,n.y),o=t.next,a=n.prev;return t.next=n,n.prev=t,i.next=o,o.prev=i,r.next=i,i.prev=r,a.next=r,r.prev=a,r}function lt(t,n,i,r){let o=li(t,n,i);return r?(o.next=r.next,o.prev=r,r.next.prev=o,r.next=o):(o.prev=o,o.next=o),o}function ln(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function li(t,n,i){return{i:t,x:n,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class lr{constructor(t,n){if(n>t)throw Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=t,this._minGranularity=n}getGranularityForZoomLevel(t){return Math.max(Math.floor(this._baseZoomGranularity/(1<<t)),this._minGranularity,1)}}class lo{constructor(t){this.fill=t.fill,this.line=t.line,this.tile=t.tile,this.stencil=t.stencil,this.circle=t.circle}}lo.noSubdivision=new lo({fill:new lr(0,0),line:new lr(0,0),tile:new lr(0,0),stencil:new lr(0,0),circle:1}),rQ("SubdivisionGranularityExpression",lr),rQ("SubdivisionGranularitySetting",lo);let la=-32768,ls=32767;class ll{constructor(t,n){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=t,this._granularityCellSize=ea/t,this._canonical=n}_getKey(t,n){return(t+=32768)<<16|n+32768}_vertexToIndex(t,n){if(t<-32768||n<-32768||t>32767||n>32767)throw Error("Vertex coordinates are out of signed 16 bit integer range.");let i=0|Math.round(t),r=0|Math.round(n),o=this._getKey(i,r);if(this._vertexDictionary.has(o))return this._vertexDictionary.get(o);let a=this._vertexBuffer.length/2;return this._vertexDictionary.set(o,a),this._vertexBuffer.push(i,r),a}_subdivideTrianglesScanline(t){if(this._granularity<2)return function(t,n){let i=[];for(let r=0;r<n.length;r+=3){let o=n[r],a=n[r+1],s=n[r+2],l=t[2*o],c=t[2*o+1];(t[2*a]-l)*(t[2*s+1]-c)-(t[2*a+1]-c)*(t[2*s]-l)>0?(i.push(o),i.push(s),i.push(a)):(i.push(o),i.push(a),i.push(s))}return i}(this._vertexBuffer,t);let n=[],i=t.length;for(let r=0;r<i;r+=3){let i=[t[r+0],t[r+1],t[r+2]],o=[this._vertexBuffer[2*t[r+0]+0],this._vertexBuffer[2*t[r+0]+1],this._vertexBuffer[2*t[r+1]+0],this._vertexBuffer[2*t[r+1]+1],this._vertexBuffer[2*t[r+2]+0],this._vertexBuffer[2*t[r+2]+1]],a=1/0,s=1/0,l=-1/0,c=-1/0;for(let t=0;t<3;t++){let n=o[2*t],i=o[2*t+1];a=Math.min(a,n),l=Math.max(l,n),s=Math.min(s,i),c=Math.max(c,i)}if(a===l||s===c)continue;let u=Math.floor(a/this._granularityCellSize),d=Math.ceil(l/this._granularityCellSize),h=Math.floor(s/this._granularityCellSize),p=Math.ceil(c/this._granularityCellSize);if(u!==d||h!==p)for(let t=h;t<p;t++){let r=this._scanlineGenerateVertexRingForCellRow(t,o,i);ld(this._vertexBuffer,r,n)}else n.push(...i)}return n}_scanlineGenerateVertexRingForCellRow(t,n,i){let r=t*this._granularityCellSize,o=r+this._granularityCellSize,a=[];for(let t=0;t<3;t++){let s=n[2*t],l=n[2*t+1],c=n[2*(t+1)%6],u=n[(2*(t+1)+1)%6],d=n[2*(t+2)%6],h=n[(2*(t+2)+1)%6],p=c-s,f=u-l,m=0===p,g=0===f,v=(r-l)/f,b=(o-l)/f,y=Math.min(v,b),_=Math.max(v,b);if(!g&&(y>=1||_<=0)||g&&(l<r||l>o)){u>=r&&u<=o&&a.push(i[(t+1)%3]);continue}!g&&y>0&&a.push(this._vertexToIndex(s+p*y,l+f*y));let x=s+p*Math.max(y,0),w=s+p*Math.min(_,1);m||this._generateIntraEdgeVertices(a,s,l,c,u,x,w),!g&&_<1&&a.push(this._vertexToIndex(s+p*_,l+f*_)),(g||u>=r&&u<=o)&&a.push(i[(t+1)%3]),!g&&(u<=r||u>=o)&&this._generateInterEdgeVertices(a,s,l,c,u,d,h,w,r,o)}return a}_generateIntraEdgeVertices(t,n,i,r,o,a,s){let l=r-n,c=o-i,u=0===c,d=u?Math.min(n,r):Math.min(a,s),h=u?Math.max(n,r):Math.max(a,s),p=Math.floor(d/this._granularityCellSize)+1,f=Math.ceil(h/this._granularityCellSize)-1;if(u?n<r:a<s)for(let r=p;r<=f;r++){let o=r*this._granularityCellSize;t.push(this._vertexToIndex(o,i+c*(o-n)/l))}else for(let r=f;r>=p;r--){let o=r*this._granularityCellSize;t.push(this._vertexToIndex(o,i+c*(o-n)/l))}}_generateInterEdgeVertices(t,n,i,r,o,a,s,l,c,u){let d=o-i,h=a-r,p=s-o,f=(c-o)/p,m=(u-o)/p,g=Math.min(f,m),v=Math.max(f,m),b=r+h*g,y=Math.floor(Math.min(b,l)/this._granularityCellSize)+1,_=Math.ceil(Math.max(b,l)/this._granularityCellSize)-1,x=l<b,w=0===p;if(w&&(s===c||s===u))return;if(w||g>=1||v<=0){let t=i-s,r=a+(n-a)*Math.min((c-s)/t,(u-s)/t);y=Math.floor(Math.min(r,l)/this._granularityCellSize)+1,_=Math.ceil(Math.max(r,l)/this._granularityCellSize)-1,x=l<r}let k=d>0?u:c;if(x)for(let n=y;n<=_;n++)t.push(this._vertexToIndex(n*this._granularityCellSize,k));else for(let n=_;n>=y;n--)t.push(this._vertexToIndex(n*this._granularityCellSize,k))}_generateOutline(t){let n=[];for(let i of t){let t=lu(i,this._granularity,!0),r=this._pointArrayToIndices(t),o=[];for(let t=1;t<r.length;t++)o.push(r[t-1]),o.push(r[t]);n.push(o)}return n}_handlePoles(t){let n=!1,i=!1;this._canonical&&(0===this._canonical.y&&(n=!0),this._canonical.y===(1<<this._canonical.z)-1&&(i=!0)),(n||i)&&this._fillPoles(t,n,i)}_ensureNoPoleVertices(){let t=this._vertexBuffer;for(let n=0;n<t.length;n+=2){let i=t[n+1];i===la&&(t[n+1]=-32767),i===ls&&(t[n+1]=32766)}}_generatePoleQuad(t,n,i,r,o,a){r>o!=(a===la)?(t.push(n),t.push(i),t.push(this._vertexToIndex(r,a)),t.push(i),t.push(this._vertexToIndex(o,a))):(t.push(i),t.push(n),t.push(this._vertexToIndex(r,a)),t.push(this._vertexToIndex(o,a)),t.push(i)),t.push(this._vertexToIndex(r,a))}_fillPoles(t,n,i){let r=this._vertexBuffer,o=ea,a=t.length;for(let s=2;s<a;s+=3){let a=t[s-2],l=t[s-1],c=t[s],u=r[2*a],d=r[2*a+1],h=r[2*l],p=r[2*l+1],f=r[2*c],m=r[2*c+1];n&&(0===d&&0===p&&this._generatePoleQuad(t,a,l,u,h,la),0===p&&0===m&&this._generatePoleQuad(t,l,c,h,f,la),0===m&&0===d&&this._generatePoleQuad(t,c,a,f,u,la)),i&&(d===o&&p===o&&this._generatePoleQuad(t,a,l,u,h,ls),p===o&&m===o&&this._generatePoleQuad(t,l,c,h,f,ls),m===o&&d===o&&this._generatePoleQuad(t,c,a,f,u,ls))}}_initializeVertices(t){for(let n=0;n<t.length;n+=2)this._vertexToIndex(t[n],t[n+1])}subdividePolygonInternal(t,n){let i;if(this._used)throw Error("Subdivision: multiple use not allowed.");this._used=!0;let{flattened:r,holeIndices:o}=function(t){let n=[],i=[];for(let r of t)if(0!==r.length){r!==t[0]&&n.push(i.length/2);for(let t=0;t<r.length;t++)i.push(r[t].x),i.push(r[t].y)}return{flattened:i,holeIndices:n}}(t);this._initializeVertices(r);try{let t=function(t,n,i=2){let r,o,a,s=n&&n.length,l=s?n[0]*i:t.length,c=sV(t,0,l,i,!0),u=[];if(!c||c.next===c.prev)return u;if(s&&(c=function(t,n,i,r){let o=[];for(let i=0,a=n.length;i<a;i++){let s=sV(t,n[i]*r,i<a-1?n[i+1]*r:t.length,r,!1);s===s.next&&(s.steiner=!0),o.push(s0(s))}o.sort(sX);for(let t=0;t<o.length;t++)i=sK(o[t],i);return i}(t,n,c,i)),t.length>80*i){r=t[0],o=t[1];let n=r,s=o;for(let a=i;a<l;a+=i){let i=t[a],l=t[a+1];i<r&&(r=i),l<o&&(o=l),i>n&&(n=i),l>s&&(s=l)}a=Math.max(n-r,s-o),a=0!==a?32767/a:0}return sq(c,u,i,r,o,a,0),u}(r,o),n=this._convertIndices(r,t);i=this._subdivideTrianglesScanline(n)}catch(t){console.error(t)}let a=[];return n&&(a=this._generateOutline(t)),this._ensureNoPoleVertices(),this._handlePoles(i),{verticesFlattened:this._vertexBuffer,indicesTriangles:i,indicesLineList:a}}_convertIndices(t,n){let i=[];for(let r=0;r<n.length;r++)i.push(this._vertexToIndex(t[2*n[r]],t[2*n[r]+1]));return i}_pointArrayToIndices(t){let n=[];for(let i=0;i<t.length;i++){let r=t[i];n.push(this._vertexToIndex(r.x,r.y))}return n}}function lc(t,n,i,r=!0){return new ll(i,n).subdividePolygonInternal(t,r)}function lu(t,n,i=!1){if(!t||t.length<1||t.length<2)return[];let r=t[0],o=t[t.length-1],a=i&&(r.x!==o.x||r.y!==o.y);if(n<2)return a?[...t,t[0]]:[...t];let s=Math.floor(ea/n),l=[];l.push(new w(t[0].x,t[0].y));let c=t.length,u=a?c:c-1;for(let n=0;n<u;n++){let i=t[n],r=n<c-1?t[n+1]:t[0],o=i.x,a=i.y,u=r.x,d=r.y,h=o!==u,p=a!==d;if(!h&&!p)continue;let f=u-o,m=d-a,g=Math.abs(f),v=Math.abs(m),b=o,y=a;for(;;){let t=f>0?(Math.floor(b/s)+1)*s:(Math.ceil(b/s)-1)*s,n=m>0?(Math.floor(y/s)+1)*s:(Math.ceil(y/s)-1)*s,i=Math.abs(b-t),r=Math.abs(y-n),o=Math.abs(y-d),a=h?i/g:1/0,c=p?r/v:1/0;if((Math.abs(b-u)<=i||!h)&&(o<=r||!p))break;if(a<c&&h||!p){let n=new w(b=t,Math.round(y+=m*a));l[l.length-1].x===n.x&&l[l.length-1].y===n.y||l.push(n)}else{let t=new w(Math.round(b+=f*c),y=n);l[l.length-1].x===t.x&&l[l.length-1].y===t.y||l.push(t)}}let _=new w(u,d);l[l.length-1].x===_.x&&l[l.length-1].y===_.y||l.push(_)}return l}function ld(t,n,i){if(0===n.length)throw Error("Subdivision vertex ring is empty.");let r=0,o=t[2*n[0]];for(let i=1;i<n.length;i++){let a=t[2*n[i]];a<o&&(o=a,r=i)}let a=n.length,s=r,l=(s+1)%a;for(;;){let r=s-1>=0?s-1:a-1,o=(l+1)%a,c=t[2*n[r]],u=t[2*n[o]],d=t[2*n[s]],h=t[2*n[s]+1],p=t[2*n[l]+1],f=!1;if(c<u)f=!0;else if(c>u)f=!1;else{let i=p-h,a=-(t[2*n[l]]-d),s=h<p?1:-1;((c-d)*i+(t[2*n[r]+1]-h)*a)*s>((u-d)*i+(t[2*n[o]+1]-h)*a)*s&&(f=!0)}if(f){let t=n[r],o=n[s],c=n[l];t!==o&&t!==c&&o!==c&&i.push(c,o,t),--s<0&&(s=a-1)}else{let t=n[o],r=n[s],c=n[l];t!==r&&t!==c&&r!==c&&i.push(c,r,t),++l>=a&&(l=0)}if(r===o)break}}function lh(t,n,i,r,o,a,s,l,c){let u=o.length/2,d=s&&l&&c;if(u<ak.MAX_VERTEX_ARRAY_LENGTH){let h,p,f=n.prepareSegment(u,i,r),m=f.vertexLength;for(let t=0;t<a.length;t+=3)r.emplaceBack(m+a[t],m+a[t+1],m+a[t+2]);f.vertexLength+=u,f.primitiveLength+=a.length/3,d&&(h=(p=s.prepareSegment(u,i,l)).vertexLength,p.vertexLength+=u);for(let n=0;n<o.length;n+=2)t(o[n],o[n+1]);if(d)for(let t=0;t<c.length;t++){let n=c[t];for(let t=1;t<n.length;t+=2)l.emplaceBack(h+n[t-1],h+n[t]);p.primitiveLength+=n.length/2}}else!function(t,n,i,r,o,a){let s=[];for(let t=0;t<r.length/2;t++)s.push(-1);let l={count:0},c=0,u=t.getOrCreateLatestSegment(n,i),d=u.vertexLength;for(let h=2;h<o.length;h+=3){let p=o[h-2],f=o[h-1],m=o[h],g=s[p]<c,v=s[f]<c,b=s[m]<c;u.vertexLength+(+!!g+ +!!v+ +!!b)>ak.MAX_VERTEX_ARRAY_LENGTH&&(u=t.createNewSegment(n,i),c=l.count,g=!0,v=!0,b=!0,d=0);let y=lp(s,r,a,l,p,g,u),_=lp(s,r,a,l,f,v,u),x=lp(s,r,a,l,m,b,u);i.emplaceBack(d+y-c,d+_-c,d+x-c),u.primitiveLength++}}(n,i,r,o,a,t),d&&function(t,n,i,r,o,a){let s=[];for(let t=0;t<r.length/2;t++)s.push(-1);let l={count:0},c=0,u=t.getOrCreateLatestSegment(n,i),d=u.vertexLength;for(let h=0;h<o.length;h++){let p=o[h];for(let f=1;f<o[h].length;f+=2){let o=p[f-1],h=p[f],m=s[o]<c,g=s[h]<c;u.vertexLength+(+!!m+ +!!g)>ak.MAX_VERTEX_ARRAY_LENGTH&&(u=t.createNewSegment(n,i),c=l.count,m=!0,g=!0,d=0);let v=lp(s,r,a,l,o,m,u),b=lp(s,r,a,l,h,g,u);i.emplaceBack(d+v-c,d+b-c),u.primitiveLength++}}}(s,i,l,o,c,t),n.forceNewSegmentOnNextPrepare(),null==s||s.forceNewSegmentOnNextPrepare()}function lp(t,n,i,r,o,a,s){if(a){let a=r.count;return i(n[2*o],n[2*o+1]),t[o]=r.count,r.count++,s.vertexLength++,a}return t[o]}class lf{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(t=>t.id),this.index=t.index,this.hasDependencies=!1,this.patternFeatures=[],this.layoutVertexArray=new ac,this.indexArray=new a_,this.indexArray2=new ax,this.programConfigurations=new aJ(t.layers,t.zoom),this.segments=new ak,this.segments2=new ak,this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(t,n,i){this.hasDependencies=s$("fill",this.layers,n);let r=this.layers[0].layout.get("fill-sort-key"),o=!r.isConstant(),a=[];for(let{feature:s,id:l,index:c,sourceLayerIndex:u}of t){let t=this.layers[0]._featureFilter.needGeometry,d=a3(s,t);if(!this.layers[0]._featureFilter.filter(new ou(this.zoom),d,i))continue;let h=o?r.evaluate(d,{},i,n.availableImages):void 0,p={id:l,properties:s.properties,type:s.type,sourceLayerIndex:u,index:c,geometry:t?d.geometry:a5(s),patterns:{},sortKey:h};a.push(p)}for(let r of(o&&a.sort((t,n)=>t.sortKey-n.sortKey),a)){let{geometry:o,index:a,sourceLayerIndex:s}=r;if(this.hasDependencies){let t=sU("fill",this.layers,r,{zoom:this.zoom},n);this.patternFeatures.push(t)}else this.addFeature(r,o,a,i,{},n.subdivisionGranularity);n.featureIndex.insert(t[a].feature,o,a,s,this.index)}}update(t,n,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,n,this.stateDependentLayers,{imagePositions:i})}addFeatures(t,n,i){for(let r of this.patternFeatures)this.addFeature(r,r.geometry,r.index,n,i,t.subdivisionGranularity)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,sB),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),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(t,n,i,r,o,a){for(let t of n8(n,500)){let n=lc(t,r,a.fill.getGranularityForZoomLevel(r.z)),i=this.layoutVertexArray;lh((t,n)=>{i.emplaceBack(t,n)},this.segments,this.layoutVertexArray,this.indexArray,n.verticesFlattened,n.indicesTriangles,this.segments2,this.indexArray2,n.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{imagePositions:o,canonical:r})}}rQ("FillBucket",lf,{omit:["layers","patternFeatures"]});var lm={get paint(){return p=p||new oE({"fill-antialias":new ox(eY.paint_fill["fill-antialias"]),"fill-opacity":new ow(eY.paint_fill["fill-opacity"]),"fill-color":new ow(eY.paint_fill["fill-color"]),"fill-outline-color":new ow(eY.paint_fill["fill-outline-color"]),"fill-translate":new ox(eY.paint_fill["fill-translate"]),"fill-translate-anchor":new ox(eY.paint_fill["fill-translate-anchor"]),"fill-pattern":new ok(eY.paint_fill["fill-pattern"])})},get layout(){return h=h||new oE({"fill-sort-key":new ow(eY.layout_fill["fill-sort-key"])})}};class lg extends oS{constructor(t,n){super(t,lm,n)}recalculate(t,n){super.recalculate(t,n);let i=this.paint._values["fill-outline-color"];"constant"===i.value.kind&&void 0===i.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new lf(t)}queryRadius(){return su(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:t,geometry:n,transform:i,pixelsToTileUnits:r}){return se(sd(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-i.bearingInRadians,r),n)}isTileClipped(){return!0}}let lv=oR([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),lb=oR([{name:"a_centroid",components:2,type:"Int16"}],4),{members:ly}=lv;class l_{constructor(t,n,i,r,o){this.properties={},this.extent=i,this.type=0,this.id=void 0,this._pbf=t,this._geometry=-1,this._keys=r,this._values=o,t.readFields(lx,this,n)}loadGeometry(){let t=this._pbf;t.pos=this._geometry;let n=t.readVarint()+t.pos,i=[],r,o=1,a=0,s=0,l=0;for(;t.pos<n;){if(a<=0){let n=t.readVarint();o=7&n,a=n>>3}if(a--,1===o||2===o)s+=t.readSVarint(),l+=t.readSVarint(),1===o&&(r&&i.push(r),r=[]),r&&r.push(new w(s,l));else{if(7!==o)throw Error(`unknown command ${o}`);r&&r.push(r[0].clone())}}return r&&i.push(r),i}bbox(){let t=this._pbf;t.pos=this._geometry;let n=t.readVarint()+t.pos,i=1,r=0,o=0,a=0,s=1/0,l=-1/0,c=1/0,u=-1/0;for(;t.pos<n;){if(r<=0){let n=t.readVarint();i=7&n,r=n>>3}if(r--,1===i||2===i)o+=t.readSVarint(),a+=t.readSVarint(),o<s&&(s=o),o>l&&(l=o),a<c&&(c=a),a>u&&(u=a);else if(7!==i)throw Error(`unknown command ${i}`)}return[s,c,l,u]}toGeoJSON(t,n,i){let r,o=this.extent*Math.pow(2,i),a=this.extent*t,s=this.extent*n,l=this.loadGeometry();function c(t){return[360*(t.x+a)/o-180,360/Math.PI*Math.atan(Math.exp((1-2*(t.y+s)/o)*Math.PI))-90]}function u(t){return t.map(c)}if(1===this.type){let t=[];for(let n of l)t.push(n[0]);let n=u(t);r=1===t.length?{type:"Point",coordinates:n[0]}:{type:"MultiPoint",coordinates:n}}else if(2===this.type){let t=l.map(u);r=1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}}else{if(3!==this.type)throw Error("unknown feature type");{let t=lw(l),n=[];for(let i of t)n.push(i.map(u));r=1===n.length?{type:"Polygon",coordinates:n[0]}:{type:"MultiPolygon",coordinates:n}}}let d={type:"Feature",geometry:r,properties:this.properties};return null!=this.id&&(d.id=this.id),d}}function lx(t,n,i){1===t?n.id=i.readVarint():2===t?function(t,n){let i=t.readVarint()+t.pos;for(;t.pos<i;){let i=n._keys[t.readVarint()],r=n._values[t.readVarint()];n.properties[i]=r}}(i,n):3===t?n.type=i.readVarint():4===t&&(n._geometry=i.pos)}function lw(t){let n,i,r=t.length;if(r<=1)return[t];let o=[];for(let a=0;a<r;a++){let r=lk(t[a]);0!==r&&(void 0===i&&(i=r<0),i===r<0?(n&&o.push(n),n=[t[a]]):n&&n.push(t[a]))}return n&&o.push(n),o}function lk(t){let n=0;for(let i,r,o=0,a=t.length,s=a-1;o<a;s=o++)i=t[o],n+=((r=t[s]).x-i.x)*(i.y+r.y);return n}l_.types=["Unknown","Point","LineString","Polygon"];class lC{constructor(t,n){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(lA,this,n),this.length=this._features.length}feature(t){if(t<0||t>=this._features.length)throw Error("feature index out of bounds");this._pbf.pos=this._features[t];let n=this._pbf.readVarint()+this._pbf.pos;return new l_(this._pbf,n,this.extent,this._keys,this._values)}}function lA(t,n,i){15===t?n.version=i.readVarint():1===t?n.name=i.readString():5===t?n.extent=i.readVarint():2===t?n._features.push(i.pos):3===t?n._keys.push(i.readString()):4===t&&n._values.push(function(t){let n=null,i=t.readVarint()+t.pos;for(;t.pos<i;){let i=t.readVarint()>>3;n=1===i?t.readString():2===i?t.readFloat():3===i?t.readDouble():4===i?t.readVarint64():5===i?t.readVarint():6===i?t.readSVarint():7===i?t.readBoolean():null}if(null==n)throw Error("unknown feature value");return n}(i))}class lE{constructor(t,n){this.layers=t.readFields(lS,{},n)}}function lS(t,n,i){if(3===t){let t=new lC(i,i.readVarint()+i.pos);t.length&&(n[t.name]=t)}}let lT=8192;function lO(t,n,i,r,o,a,s,l){t.emplaceBack(n,i,2*Math.floor(r*lT)+s,o*lT*2,a*lT*2,Math.round(l))}class lF{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(t=>t.id),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new au,this.centroidVertexArray=new as,this.indexArray=new a_,this.programConfigurations=new aJ(t.layers,t.zoom),this.segments=new ak,this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(t,n,i){for(let{feature:r,id:o,index:a,sourceLayerIndex:s}of(this.features=[],this.hasDependencies=s$("fill-extrusion",this.layers,n),t)){let t=this.layers[0]._featureFilter.needGeometry,l=a3(r,t);if(!this.layers[0]._featureFilter.filter(new ou(this.zoom),l,i))continue;let c={id:o,sourceLayerIndex:s,index:a,geometry:t?l.geometry:a5(r),properties:r.properties,type:r.type,patterns:{}};this.hasDependencies?this.features.push(sU("fill-extrusion",this.layers,c,{zoom:this.zoom},n)):this.addFeature(c,c.geometry,a,i,{},n.subdivisionGranularity),n.featureIndex.insert(r,c.geometry,a,s,this.index,!0)}}addFeatures(t,n,i){for(let r of this.features){let{geometry:o}=r;this.addFeature(r,o,r.index,n,i,t.subdivisionGranularity)}}update(t,n,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,n,this.stateDependentLayers,{imagePositions:i})}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ly),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,lb.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,n,i,r,o,a){for(let i of n8(n,500)){let n={x:0,y:0,sampleCount:0},o=this.layoutVertexArray.length;this.processPolygon(n,r,t,i,a);let s=this.layoutVertexArray.length-o,l=Math.floor(n.x/n.sampleCount),c=Math.floor(n.y/n.sampleCount);for(let t=0;t<s;t++)this.centroidVertexArray.emplaceBack(l,c)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{imagePositions:o,canonical:r})}processPolygon(t,n,i,r,o){if(r.length<1||lR(r[0]))return;for(let n of r)0!==n.length&&lM(t,n);let a={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},s=o.fill.getGranularityForZoomLevel(n.z),l="Polygon"===l_.types[i.type];for(let t of r){if(0===t.length||lR(t))continue;let n=lu(t,s,l);this._generateSideFaces(n,a)}if(!l)return;let c=lc(r,n,s,!1),u=this.layoutVertexArray;lh((t,n)=>{lO(u,t,n,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,c.verticesFlattened,c.indicesTriangles)}_generateSideFaces(t,n){let i=0;for(let r=1;r<t.length;r++){let o=t[r],a=t[r-1];if(lI(o,a))continue;n.segment.vertexLength+4>ak.MAX_VERTEX_ARRAY_LENGTH&&(n.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let s=o.sub(a)._perp()._unit(),l=a.dist(o);i+l>32768&&(i=0),lO(this.layoutVertexArray,o.x,o.y,s.x,s.y,0,0,i),lO(this.layoutVertexArray,o.x,o.y,s.x,s.y,0,1,i),i+=l,lO(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,0,i),lO(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,1,i);let c=n.segment.vertexLength;this.indexArray.emplaceBack(c,c+2,c+1),this.indexArray.emplaceBack(c+1,c+2,c+3),n.segment.vertexLength+=4,n.segment.primitiveLength+=2}}}function lM(t,n){for(let i=0;i<n.length;i++){let r=n[i];i===n.length-1&&n[0].x===r.x&&n[0].y===r.y||(t.x+=r.x,t.y+=r.y,t.sampleCount++)}}function lI(t,n){return t.x===n.x&&(t.x<0||t.x>ea)||t.y===n.y&&(t.y<0||t.y>ea)}function lR(t){return t.every(t=>t.x<0)||t.every(t=>t.x>ea)||t.every(t=>t.y<0)||t.every(t=>t.y>ea)}rQ("FillExtrusionBucket",lF,{omit:["layers","features"]});var lD={get paint(){return f=f||new oE({"fill-extrusion-opacity":new ox(eY["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new ow(eY["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new ox(eY["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new ox(eY["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ok(eY["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new ow(eY["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new ow(eY["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new ox(eY["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class lP extends oS{constructor(t,n){super(t,lD,n)}createBucket(t){return new lF(t)}queryRadius(){return su(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:t,feature:n,featureState:i,geometry:r,transform:o,pixelsToTileUnits:a,pixelPosMatrix:s}){let l=sd(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-o.bearingInRadians,a),c=this.paint.get("fill-extrusion-height").evaluate(n,i),u=this.paint.get("fill-extrusion-base").evaluate(n,i),d=function(t,n){let i=[];for(let r of t){let t=[r.x,r.y,0,1];et(t,t,n),i.push(new w(t[0]/t[3],t[1]/t[3]))}return i}(l,s),h=function(t,n,i,r){let o=[],a=[],s=r[8]*n,l=r[9]*n,c=r[10]*n,u=r[11]*n,d=r[8]*i,h=r[9]*i,p=r[10]*i,f=r[11]*i;for(let n of t){let t=[],i=[];for(let o of n){let n=o.x,a=o.y,m=r[0]*n+r[4]*a+r[12],g=r[1]*n+r[5]*a+r[13],v=r[2]*n+r[6]*a+r[14],b=r[3]*n+r[7]*a+r[15],y=v+c,_=b+u,x=m+d,k=g+h,C=v+p,A=b+f,E=new w((m+s)/_,(g+l)/_);E.z=y/_,t.push(E);let S=new w(x/A,k/A);S.z=C/A,i.push(S)}o.push(t),a.push(i)}return[o,a]}(r,u,c,s);return function(t,n,i){let r=1/0;se(i,n)&&(r=lN(i,n[0]));for(let o=0;o<n.length;o++){let a=n[o],s=t[o];for(let t=0;t<a.length-1;t++){let n=a[t],o=[n,a[t+1],s[t+1],s[t],n];a7(i,o)&&(r=Math.min(r,lN(i,o)))}}return r!==1/0&&r}(h[0],h[1],d)}}function lL(t,n){return t.x*n.x+t.y*n.y}function lN(t,n){if(1===t.length){let i,r=0,o=n[r++];for(;!i||o.equals(i);)if(!(i=n[r++]))return 1/0;for(;r<n.length;r++){let a=n[r],s=t[0],l=i.sub(o),c=a.sub(o),u=s.sub(o),d=lL(l,l),h=lL(l,c),p=lL(c,c),f=lL(u,l),m=lL(u,c),g=d*p-h*h,v=(p*f-h*m)/g,b=(d*m-h*f)/g,y=o.z*(1-v-b)+i.z*v+a.z*b;if(isFinite(y))return y}return 1/0}{let t=1/0;for(let i of n)t=Math.min(t,i.z);return t}}let{members:lz}=oR([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:lj}=oR([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),lB=Math.cos(Math.PI/180*37.5),l$=32768;class lU{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(t=>t.id),this.index=t.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(t=>{this.gradients[t.id]={}}),this.layoutVertexArray=new ad,this.layoutVertexArray2=new ah,this.indexArray=new a_,this.programConfigurations=new aJ(t.layers,t.zoom),this.segments=new ak,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(t,n,i){this.hasDependencies=s$("line",this.layers,n)||this.hasLineDasharray(this.layers);let r=this.layers[0].layout.get("line-sort-key"),o=!r.isConstant(),a=[];for(let{feature:n,id:s,index:l,sourceLayerIndex:c}of t){let t=this.layers[0]._featureFilter.needGeometry,u=a3(n,t);if(!this.layers[0]._featureFilter.filter(new ou(this.zoom),u,i))continue;let d=o?r.evaluate(u,{},i):void 0,h={id:s,properties:n.properties,type:n.type,sourceLayerIndex:c,index:l,geometry:t?u.geometry:a5(n),patterns:{},dashes:{},sortKey:d};a.push(h)}for(let r of(o&&a.sort((t,n)=>t.sortKey-n.sortKey),a)){let{geometry:o,index:a,sourceLayerIndex:s}=r;this.hasDependencies?(s$("line",this.layers,n)?sU("line",this.layers,r,{zoom:this.zoom},n):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,r,this.zoom,n),this.patternFeatures.push(r)):this.addFeature(r,o,a,i,{},{},n.subdivisionGranularity),n.featureIndex.insert(t[a].feature,o,a,s,this.index)}}update(t,n,i,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,n,this.stateDependentLayers,{imagePositions:i,dashPositions:r})}addFeatures(t,n,i,r){for(let o of this.patternFeatures)this.addFeature(o,o.geometry,o.index,n,i,r,t.subdivisionGranularity)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,lj)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,lz),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}addFeature(t,n,i,r,o,a,s){let l=this.layers[0].layout,c=l.get("line-join").evaluate(t,{}),u=l.get("line-cap"),d=l.get("line-miter-limit"),h=l.get("line-round-limit");for(let i of(this.lineClips=this.lineFeatureClips(t),n))this.addLine(i,t,c,u,d,h,r,s);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{imagePositions:o,dashPositions:a,canonical:r})}addLine(t,n,i,r,o,a,s,l){let c,u,d,h,p;if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,t=lu(t,s?l.line.getGranularityForZoomLevel(s.z):1),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let n=0;n<t.length-1;n++)this.totalDistance+=t[n].dist(t[n+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let f="Polygon"===l_.types[n.type],m=t.length;for(;m>=2&&t[m-1].equals(t[m-2]);)m--;let g=0;for(;g<m-1&&t[g].equals(t[g+1]);)g++;if(m<(f?3:2))return;"bevel"===i&&(o=1.05);let v=this.overscaling<=16?122880/(512*this.overscaling):0,b=this.segments.prepareSegment(10*m,this.layoutVertexArray,this.indexArray);this.e1=this.e2=-1,f&&(c=t[m-2],p=t[g].sub(c)._unit()._perp());for(let n=g;n<m;n++){if((d=n===m-1?f?t[g+1]:void 0:t[n+1])&&t[n].equals(d))continue;p&&(h=p),c&&(u=c),c=t[n],p=d?d.sub(c)._unit()._perp():h;let s=(h=h||p).add(p);0===s.x&&0===s.y||s._unit();let l=h.x*p.x+h.y*p.y,y=s.x*p.x+s.y*p.y,_=0!==y?1/y:1/0,x=2*Math.sqrt(2-2*y),w=y<lB&&u&&d,k=h.x*p.y-h.y*p.x>0;if(w&&n>g){let t=c.dist(u);if(t>2*v){let n=c.sub(c.sub(u)._mult(v/t)._round());this.updateDistance(u,n),this.addCurrentVertex(n,h,0,0,b),u=n}}let C=u&&d,A=C?i:f?"butt":r;if(C&&"round"===A&&(_<a?A="miter":_<=2&&(A="fakeround")),"miter"===A&&_>o&&(A="bevel"),"bevel"===A&&(_>2&&(A="flipbevel"),_<o&&(A="miter")),u&&this.updateDistance(u,c),"miter"===A)s._mult(_),this.addCurrentVertex(c,s,0,0,b);else if("flipbevel"===A){if(_>100)s=p.mult(-1);else{let t=_*h.add(p).mag()/h.sub(p).mag();s._perp()._mult(t*(k?-1:1))}this.addCurrentVertex(c,s,0,0,b),this.addCurrentVertex(c,s.mult(-1),0,0,b)}else if("bevel"===A||"fakeround"===A){let t=-Math.sqrt(_*_-1),n=k?t:0,i=k?0:t;if(u&&this.addCurrentVertex(c,h,n,i,b),"fakeround"===A){let t=Math.round(180*x/Math.PI/20);for(let n=1;n<t;n++){let i=n/t;if(.5!==i){let t=i-.5;i+=i*t*(i-1)*((1.0904+l*(l*(3.55645-1.43519*l)-3.2452))*t*t+(.848013+l*(.215638*l-1.06021)))}let r=p.sub(h)._mult(i)._add(h)._unit()._mult(k?-1:1);this.addHalfVertex(c,r.x,r.y,!1,k,0,b)}}d&&this.addCurrentVertex(c,p,-n,-i,b)}else if("butt"===A)this.addCurrentVertex(c,s,0,0,b);else if("square"===A){let t=u?1:-1;this.addCurrentVertex(c,s,t,t,b)}else"round"===A&&(u&&(this.addCurrentVertex(c,h,0,0,b),this.addCurrentVertex(c,h,1,1,b,!0)),d&&(this.addCurrentVertex(c,p,-1,-1,b,!0),this.addCurrentVertex(c,p,0,0,b)));if(w&&n<m-1){let t=c.dist(d);if(t>2*v){let n=c.add(d.sub(c)._mult(v/t)._round());this.updateDistance(c,n),this.addCurrentVertex(n,p,0,0,b),c=n}}}}addCurrentVertex(t,n,i,r,o,a=!1){let s=n.y*r-n.x,l=-n.y-n.x*r;this.addHalfVertex(t,n.x+n.y*i,n.y-n.x*i,a,!1,i,o),this.addHalfVertex(t,s,l,a,!0,-r,o),this.distance>l$/2&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,n,i,r,o,a))}addHalfVertex({x:t,y:n},i,r,o,a,s,l){let c=.5*(this.lineClips?this.scaledDistance*(l$-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t<<1)+ +!!o,(n<<1)+ +!!a,Math.round(63*i)+128,Math.round(63*r)+128,1+(0===s?0:s<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 u=l.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,u,this.e2),l.primitiveLength++),a?this.e2=u:this.e1=u}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,n){this.distance+=t.dist(n),this.updateScaledDistance()}hasLineDasharray(t){for(let n of t){let t=n.paint.get("line-dasharray");if(t&&!t.isConstant())return!0}return!1}addLineDashDependencies(t,n,i,r){for(let o of t){let t=o.paint.get("line-dasharray");if(!t||"constant"===t.value.kind)continue;let a="round"===o.layout.get("line-cap"),s={dasharray:t.value.evaluate({zoom:i-1},n,{}),round:a},l={dasharray:t.value.evaluate({zoom:i},n,{}),round:a},c={dasharray:t.value.evaluate({zoom:i+1},n,{}),round:a},u=`${s.dasharray.join(",")},${s.round}`,d=`${l.dasharray.join(",")},${l.round}`,h=`${c.dasharray.join(",")},${c.round}`;r.dashDependencies[u]=s,r.dashDependencies[d]=l,r.dashDependencies[h]=c,n.dashes[o.id]={min:u,mid:d,max:h}}}}rQ("LineBucket",lU,{omit:["layers","patternFeatures"]});var lV={get paint(){return g=g||new oE({"line-opacity":new ow(eY.paint_line["line-opacity"]),"line-color":new ow(eY.paint_line["line-color"]),"line-translate":new ox(eY.paint_line["line-translate"]),"line-translate-anchor":new ox(eY.paint_line["line-translate-anchor"]),"line-width":new ow(eY.paint_line["line-width"]),"line-gap-width":new ow(eY.paint_line["line-gap-width"]),"line-offset":new ow(eY.paint_line["line-offset"]),"line-blur":new ow(eY.paint_line["line-blur"]),"line-dasharray":new ok(eY.paint_line["line-dasharray"]),"line-pattern":new ok(eY.paint_line["line-pattern"]),"line-gradient":new oA(eY.paint_line["line-gradient"])})},get layout(){return m=m||new oE({"line-cap":new ox(eY.layout_line["line-cap"]),"line-join":new ow(eY.layout_line["line-join"]),"line-miter-limit":new ox(eY.layout_line["line-miter-limit"]),"line-round-limit":new ox(eY.layout_line["line-round-limit"]),"line-sort-key":new ow(eY.layout_line["line-sort-key"])})}};class lH extends ow{possiblyEvaluate(t,n){return n=new ou(Math.floor(n.zoom),{now:n.now,fadeDuration:n.fadeDuration,zoomHistory:n.zoomHistory,transition:n.transition}),super.possiblyEvaluate(t,n)}evaluate(t,n,i,r){return n=em({},n,{zoom:Math.floor(n.zoom)}),super.evaluate(t,n,i,r)}}class lq extends oS{constructor(t,n){super(t,lV,n),this.gradientVersion=0,v||((v=new lH(lV.paint.properties["line-width"].specification)).useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if("line-gradient"===t){let t=this.gradientExpression();this.stepInterpolant=!!function(t){return void 0!==t._styleExpression}(t)&&t._styleExpression.expression instanceof ng,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,n){super.recalculate(t,n),this.paint._values["line-floorwidth"]=v.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new lU(t)}queryRadius(t){let n=t;return lW(sc("line-width",this,n),sc("line-gap-width",this,n))/2+Math.abs(sc("line-offset",this,n))+su(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:t,feature:n,featureState:i,geometry:r,transform:o,pixelsToTileUnits:a}){let s=sd(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-o.bearingInRadians,a),l=a/2*lW(this.paint.get("line-width").evaluate(n,i),this.paint.get("line-gap-width").evaluate(n,i)),c=this.paint.get("line-offset").evaluate(n,i);return c&&(r=function(t,n){let i=[];for(let r=0;r<t.length;r++){let o=sh(t[r]),a=[];for(let t=0;t<o.length;t++){let i=o[t],r=o[t-1],s=o[t+1],l=0===t?new w(0,0):i.sub(r)._unit()._perp(),c=t===o.length-1?new w(0,0):s.sub(i)._unit()._perp(),u=l._add(c)._unit(),d=u.x*c.x+u.y*c.y;0!==d&&u._mult(1/d),a.push(u._mult(n)._add(i))}i.push(a)}return i}(r,c*a)),function(t,n,i){for(let r=0;r<n.length;r++){let o=n[r];if(t.length>=3){for(let n=0;n<o.length;n++)if(ss(t,o[n]))return!0}if(st(t,o,i))return!0}return!1}(s,r,l)}isTileClipped(){return!0}}function lW(t,n){return n>0?n+2*t:t}let lG=oR([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),lY=oR([{name:"a_projected_pos",components:3,type:"Float32"}],4);oR([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let lZ=oR([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);oR([{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 lX=oR([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),lK=oR([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function lJ(t,n,i){return t.sections.forEach(t=>{t.text=function(t,n,i){let r=n.layout.get("text-transform").evaluate(i,{});return"uppercase"===r?t=t.toLocaleUpperCase():"lowercase"===r&&(t=t.toLocaleLowerCase()),oc.applyArabicShaping&&(t=oc.applyArabicShaping(t)),t}(t.text,n,i)}),t}oR([{name:"triangle",components:3,type:"Uint16"}]),oR([{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"}]),oR([{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"}]),oR([{type:"Float32",name:"offsetX"}]),oR([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),oR([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);var lQ=24;let l0={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","\xa2":"¢","\xa3":"£","\xa5":"¥","\xa6":"¦","\xac":"¬","\xaf":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","⋯":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},l1={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},l2={40:!0};function l5(t,n,i,r,o,a){if("fontStack"in n){let r=i[n.fontStack],a=r&&r[t];return a?a.metrics.advance*n.scale+o:0}{let t=r[n.imageName];return t?t.displaySize[0]*n.scale*lQ/a+o:0}}function l3(t,n,i,r){let o=Math.pow(t-n,2);return r?t<n?o/2:2*o:o+Math.abs(i)*i}function l4(t,n,i){let r=0;return 10===t&&(r-=1e4),i&&(r+=150),40!==t&&65288!==t||(r+=50),41!==n&&65289!==n||(r+=50),r}function l6(t,n,i,r,o,a){let s=null,l=l3(n,i,o,a);for(let t of r){let r=l3(n-t.x,i,o,a)+t.badness;r<=l&&(s=t,l=r)}return{index:t,x:n,priorBreak:s,badness:l}}function l8(t){return t?l8(t.priorBreak).concat(t.index):[]}class l7{constructor(t="",n=[],i=[]){this.text=t,this.sections=n,this.sectionIndex=i,this.imageSectionID=null}static fromFeature(t,n){let i=new l7;for(let r=0;r<t.sections.length;r++){let o=t.sections[r];o.image?i.addImageSection(o):i.addTextSection(o,n)}return i}length(){return[...this.text].length}getSection(t){return this.sections[this.sectionIndex[t]]}getSectionIndex(t){return this.sectionIndex[t]}verticalizePunctuation(){this.text=function(t){let n="",i={premature:!0,value:void 0},r=t[Symbol.iterator](),o=r.next(),a=t[Symbol.iterator]();a.next();let s=a.next();for(;!o.done;)n+=!s.done&&or(s.value.codePointAt(0))&&!l0[s.value]||!i.premature&&or(i.value.codePointAt(0))&&!l0[i.value]||!l0[o.value]?o.value:l0[o.value],i={value:o.value,premature:!1},o=r.next(),s=a.next();return n}(this.text)}hasZeroWidthSpaces(){return this.text.includes("")}trim(){let t=this.text.match(/^\s*/),n=t?t[0].length:0,i=this.text.match(/\S\s*$/),r=i?i[0].length-1:0;this.text=this.text.substring(n,this.text.length-r),this.sectionIndex=this.sectionIndex.slice(n,this.sectionIndex.length-r)}substring(t,n){let i=[...this.text].slice(t,n).join(""),r=this.sectionIndex.slice(t,n);return new l7(i,this.sections,r)}toCodeUnitIndex(t){return[...this.text].slice(0,t).join("").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((t,n)=>Math.max(t,this.sections[n].scale),0)}getMaxImageSize(t){let n=0,i=0;for(let r=0;r<this.length();r++){let o=this.getSection(r);if("imageName"in o){let r=t[o.imageName];if(!r)continue;let a=r.displaySize;n=Math.max(n,a[0]),i=Math.max(i,a[1])}}return{maxImageWidth:n,maxImageHeight:i}}addTextSection(t,n){this.text+=t.text,this.sections.push({scale:t.scale||1,verticalAlign:t.verticalAlign||"bottom",fontStack:t.fontStack||n});let i=this.sections.length-1;this.sectionIndex.push(...[...t.text].map(()=>i))}addImageSection(t){let n=t.image?t.image.name:"";if(0===n.length)return void ex("Can't add FormattedSection with an empty image.");let i=this.getNextImageSectionCharCode();i?(this.text+=String.fromCharCode(i),this.sections.push({scale:1,verticalAlign:t.verticalAlign||"bottom",imageName:n}),this.sectionIndex.push(this.sections.length-1)):ex("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(t,n,i,r,o){let a=[],s=this.determineAverageLineWidth(t,n,i,r,o),l=this.hasZeroWidthSpaces(),c=0,u=0,d=this.text[Symbol.iterator](),h=d.next(),p=this.text[Symbol.iterator]();p.next();let f=p.next(),m=this.text[Symbol.iterator]();m.next(),m.next();let g=m.next();for(;!h.done;){let n=this.getSection(u),v=h.value.codePointAt(0);if(r7(v)||(c+=l5(v,n,i,r,t,o)),!f.done){let t=r6(v),i=f.value.codePointAt(0);(l1[v]||t||"imageName"in n||!g.done&&l2[i])&&a.push(l6(u+1,c,s,a,l4(v,i,t&&l),!1))}u++,h=d.next(),f=p.next(),g=m.next()}return l8(l6(this.length(),c,s,a,0,!0))}determineAverageLineWidth(t,n,i,r,o){let a=0,s=0;for(let n of this.text){let l=this.getSection(s);a+=l5(n.codePointAt(0),l,i,r,t,o),s++}return a/Math.max(1,Math.ceil(a/n))}}let l9=0x100000000,ce=23283064365386963e-26,ct="u"<typeof TextDecoder?null:new TextDecoder("utf-8");class cn{constructor(t=new Uint8Array(16)){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(t,n,i=this.length){for(;this.pos<i;){let i=this.readVarint(),r=i>>3,o=this.pos;this.type=7&i,t(r,n,this),this.pos===o&&this.skip(i)}return n}readMessage(t,n){return this.readFields(t,n,this.readVarint()+this.pos)}readFixed32(){let t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){let t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*l9;return this.pos+=8,t}readSFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*l9;return this.pos+=8,t}readFloat(){let t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){let t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){let n,i,r=this.buf;return n=127&(i=r[this.pos++]),i<128?n:(n|=(127&(i=r[this.pos++]))<<7,i<128?n:(n|=(127&(i=r[this.pos++]))<<14,i<128?n:(n|=(127&(i=r[this.pos++]))<<21,i<128?n:function(t,n,i){let r,o,a=i.buf;if(r=(112&(o=a[i.pos++]))>>4,o<128||(r|=(127&(o=a[i.pos++]))<<3,o<128)||(r|=(127&(o=a[i.pos++]))<<10,o<128)||(r|=(127&(o=a[i.pos++]))<<17,o<128)||(r|=(127&(o=a[i.pos++]))<<24,o<128)||(r|=(1&(o=a[i.pos++]))<<31,o<128))return ci(t,r,n);throw Error("Expected varint not more than 10 bytes")}(n|=(15&(i=r[this.pos]))<<28,t,this))))}readVarint64(){return this.readVarint(!0)}readSVarint(){let t=this.readVarint();return t%2==1?-((t+1)/2):t/2}readBoolean(){return!!this.readVarint()}readString(){let t=this.readVarint()+this.pos,n=this.pos;return this.pos=t,t-n>=12&&ct?ct.decode(this.buf.subarray(n,t)):function(t,n,i){let r="",o=n;for(;o<i;){let n=t[o],a,s,l,c=null,u=n>239?4:n>223?3:n>191?2:1;if(o+u>i)break;1===u?n<128&&(c=n):2===u?128==(192&(a=t[o+1]))&&(c=(31&n)<<6|63&a)<=127&&(c=null):3===u?(a=t[o+1],s=t[o+2],128==(192&a)&&128==(192&s)&&((c=(15&n)<<12|(63&a)<<6|63&s)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(a=t[o+1],s=t[o+2],l=t[o+3],128==(192&a)&&128==(192&s)&&128==(192&l)&&((c=(15&n)<<18|(63&a)<<12|(63&s)<<6|63&l)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,r+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),r+=String.fromCharCode(c),o+=u}return r}(this.buf,n,t)}readBytes(){let t=this.readVarint()+this.pos,n=this.buf.subarray(this.pos,t);return this.pos=t,n}readPackedVarint(t=[],n){let i=this.readPackedEnd();for(;this.pos<i;)t.push(this.readVarint(n));return t}readPackedSVarint(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readSVarint());return t}readPackedBoolean(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readBoolean());return t}readPackedFloat(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readFloat());return t}readPackedDouble(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readDouble());return t}readPackedFixed32(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readFixed32());return t}readPackedSFixed32(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readSFixed32());return t}readPackedFixed64(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readFixed64());return t}readPackedSFixed64(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readSFixed64());return t}readPackedEnd(){return 2===this.type?this.readVarint()+this.pos:this.pos+1}skip(t){let n=7&t;if(0===n)for(;this.buf[this.pos++]>127;);else if(2===n)this.pos=this.readVarint()+this.pos;else if(5===n)this.pos+=4;else{if(1!==n)throw Error(`Unimplemented type: ${n}`);this.pos+=8}}writeTag(t,n){this.writeVarint(t<<3|n)}realloc(t){let n=this.length||16;for(;n<this.pos+t;)n*=2;if(n!==this.length){let t=new Uint8Array(n);t.set(this.buf),this.buf=t,this.dataView=new DataView(t.buffer),this.length=n}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeSFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,-1&t,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*ce),!0),this.pos+=8}writeSFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,-1&t,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*ce),!0),this.pos+=8}writeVarint(t){(t=+t||0)>0xfffffff||t<0?function(t,n){let i,r;if(t>=0?(i=t%0x100000000|0,r=t/0x100000000|0):(i=~(-t%0x100000000),r=~(-t/0x100000000),0xffffffff^i?i=i+1|0:(i=0,r=r+1|0)),t>=0xffffffffffffffff||t<-0xffffffffffffffff)throw Error("Given varint doesn't fit into 10 bytes");n.realloc(10),function(t,n){n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,n.buf[n.pos]=127&(t>>>=7)}(i,n),function(t,n){let i=(7&t)<<4;n.buf[n.pos++]|=i|128*!!(t>>>=3),t&&(n.buf[n.pos++]=127&t|128*!!(t>>>=7),t&&(n.buf[n.pos++]=127&t|128*!!(t>>>=7),t&&(n.buf[n.pos++]=127&t|128*!!(t>>>=7),t&&(n.buf[n.pos++]=127&t|128*!!(t>>>=7),t&&(n.buf[n.pos++]=127&t)))))}(r,n)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|128*(t>127),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|128*(t>127),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|128*(t>127),t<=127||(this.buf[this.pos++]=t>>>7&127))))}writeSVarint(t){this.writeVarint(t<0?-(2*t)-1:2*t)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(4*t.length),this.pos++;let n=this.pos;this.pos=function(t,n,i){for(let r,o,a=0;a<n.length;a++){if((r=n.charCodeAt(a))>55295&&r<57344){if(!o){r>56319||a+1===n.length?(t[i++]=239,t[i++]=191,t[i++]=189):o=r;continue}if(r<56320){t[i++]=239,t[i++]=191,t[i++]=189,o=r;continue}r=o-55296<<10|r-56320|65536,o=null}else o&&(t[i++]=239,t[i++]=191,t[i++]=189,o=null);r<128?t[i++]=r:(r<2048?t[i++]=r>>6|192:(r<65536?t[i++]=r>>12|224:(t[i++]=r>>18|240,t[i++]=r>>12&63|128),t[i++]=r>>6&63|128),t[i++]=63&r|128)}return i}(this.buf,t,this.pos);let i=this.pos-n;i>=128&&cr(n,i,this),this.pos=n-1,this.writeVarint(i),this.pos+=i}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){let n=t.length;this.writeVarint(n),this.realloc(n);for(let i=0;i<n;i++)this.buf[this.pos++]=t[i]}writeRawMessage(t,n){this.pos++;let i=this.pos;t(n,this);let r=this.pos-i;r>=128&&cr(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r}writeMessage(t,n,i){this.writeTag(t,2),this.writeRawMessage(n,i)}writePackedVarint(t,n){n.length&&this.writeMessage(t,co,n)}writePackedSVarint(t,n){n.length&&this.writeMessage(t,ca,n)}writePackedBoolean(t,n){n.length&&this.writeMessage(t,cc,n)}writePackedFloat(t,n){n.length&&this.writeMessage(t,cs,n)}writePackedDouble(t,n){n.length&&this.writeMessage(t,cl,n)}writePackedFixed32(t,n){n.length&&this.writeMessage(t,cu,n)}writePackedSFixed32(t,n){n.length&&this.writeMessage(t,cd,n)}writePackedFixed64(t,n){n.length&&this.writeMessage(t,ch,n)}writePackedSFixed64(t,n){n.length&&this.writeMessage(t,cp,n)}writeBytesField(t,n){this.writeTag(t,2),this.writeBytes(n)}writeFixed32Field(t,n){this.writeTag(t,5),this.writeFixed32(n)}writeSFixed32Field(t,n){this.writeTag(t,5),this.writeSFixed32(n)}writeFixed64Field(t,n){this.writeTag(t,1),this.writeFixed64(n)}writeSFixed64Field(t,n){this.writeTag(t,1),this.writeSFixed64(n)}writeVarintField(t,n){this.writeTag(t,0),this.writeVarint(n)}writeSVarintField(t,n){this.writeTag(t,0),this.writeSVarint(n)}writeStringField(t,n){this.writeTag(t,2),this.writeString(n)}writeFloatField(t,n){this.writeTag(t,5),this.writeFloat(n)}writeDoubleField(t,n){this.writeTag(t,1),this.writeDouble(n)}writeBooleanField(t,n){this.writeVarintField(t,+n)}}function ci(t,n,i){return i?0x100000000*n+(t>>>0):0x100000000*(n>>>0)+(t>>>0)}function cr(t,n,i){let r=n<=16383?1:n<=2097151?2:n<=0xfffffff?3:Math.floor(Math.log(n)/(7*Math.LN2));i.realloc(r);for(let n=i.pos-1;n>=t;n--)i.buf[n+r]=i.buf[n]}function co(t,n){for(let i=0;i<t.length;i++)n.writeVarint(t[i])}function ca(t,n){for(let i=0;i<t.length;i++)n.writeSVarint(t[i])}function cs(t,n){for(let i=0;i<t.length;i++)n.writeFloat(t[i])}function cl(t,n){for(let i=0;i<t.length;i++)n.writeDouble(t[i])}function cc(t,n){for(let i=0;i<t.length;i++)n.writeBoolean(t[i])}function cu(t,n){for(let i=0;i<t.length;i++)n.writeFixed32(t[i])}function cd(t,n){for(let i=0;i<t.length;i++)n.writeSFixed32(t[i])}function ch(t,n){for(let i=0;i<t.length;i++)n.writeFixed64(t[i])}function cp(t,n){for(let i=0;i<t.length;i++)n.writeSFixed64(t[i])}function cf(t,n,i){1===t&&i.readMessage(cm,n)}function cm(t,n,i){if(3===t){let{id:t,bitmap:r,width:o,height:a,left:s,top:l,advance:c}=i.readMessage(cg,{});n.push({id:t,bitmap:new sE({width:o+6,height:a+6},r),metrics:{width:o,height:a,left:s,top:l,advance:c}})}}function cg(t,n,i){1===t?n.id=i.readVarint():2===t?n.bitmap=i.readBytes():3===t?n.width=i.readVarint():4===t?n.height=i.readVarint():5===t?n.left=i.readSVarint():6===t?n.top=i.readSVarint():7===t&&(n.advance=i.readVarint())}function cv(t){let n=0,i=0;for(let r of t)n+=r.w*r.h,i=Math.max(i,r.w);t.sort((t,n)=>n.h-t.h);let r=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(n/.95)),i),h:1/0}],o=0,a=0;for(let n of t)for(let t=r.length-1;t>=0;t--){let i=r[t];if(!(n.w>i.w||n.h>i.h)){if(n.x=i.x,n.y=i.y,a=Math.max(a,n.y+n.h),o=Math.max(o,n.x+n.w),n.w===i.w&&n.h===i.h){let n=r.pop();n&&t<r.length&&(r[t]=n)}else n.h===i.h?(i.x+=n.w,i.w-=n.w):(n.w===i.w||r.push({x:i.x+n.w,y:i.y,w:i.w-n.w,h:n.h}),i.y+=n.h,i.h-=n.h);break}}return{w:o,h:a,fill:n/(o*a)||0}}class cb{constructor(t,{pixelRatio:n,version:i,stretchX:r,stretchY:o,content:a,textFitWidth:s,textFitHeight:l}){this.paddedRect=t,this.pixelRatio=n,this.stretchX=r,this.stretchY=o,this.content=a,this.version=i,this.textFitWidth=s,this.textFitHeight=l}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 cy{constructor(t,n){const i={},r={};this.haveRenderCallbacks=[];const o=[];this.addImages(t,i,o),this.addImages(n,r,o);const{w:a,h:s}=cv(o),l=new sS({width:a||1,height:s||1});for(const n in t){const r=t[n],o=i[n].paddedRect;sS.copy(r.data,l,{x:0,y:0},{x:o.x+1,y:o.y+1},r.data)}for(const t in n){const i=n[t],o=r[t].paddedRect,a=o.x+1,s=o.y+1,c=i.data.width,u=i.data.height;sS.copy(i.data,l,{x:0,y:0},{x:a,y:s},i.data),sS.copy(i.data,l,{x:0,y:u-1},{x:a,y:s-1},{width:c,height:1}),sS.copy(i.data,l,{x:0,y:0},{x:a,y:s+u},{width:c,height:1}),sS.copy(i.data,l,{x:c-1,y:0},{x:a-1,y:s},{width:1,height:u}),sS.copy(i.data,l,{x:0,y:0},{x:a+c,y:s},{width:1,height:u})}this.image=l,this.iconPositions=i,this.patternPositions=r}addImages(t,n,i){for(let r in t){let o=t[r],a={x:0,y:0,w:o.data.width+2,h:o.data.height+2};i.push(a),n[r]=new cb(a,o),o.hasRenderCallback&&this.haveRenderCallbacks.push(r)}}patchUpdatedImages(t,n){for(let i in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[i],t.getImage(i),n),this.patchUpdatedImage(this.patternPositions[i],t.getImage(i),n)}patchUpdatedImage(t,n,i){if(!t||!n||t.version===n.version)return;t.version=n.version;let[r,o]=t.tl;i.update(n.data,void 0,{x:r,y:o})}}function c_(n,i,r,o,a,s,l,c,u,d,h,p,f,m,g){let v,b=l7.fromFeature(n,a);p===t.az.vertical&&b.verticalizePunctuation();let y=b.determineLineBreaks(d,s,i,o,m),{processBidirectionalText:_,processStyledBidirectionalText:x}=oc;if(_&&1===b.sections.length)for(let t of(v=[],y=y.map(t=>b.toCodeUnitIndex(t)),_(b.toString(),y))){let n=[...t].map(()=>0);v.push(new l7(t,b.sections,n))}else if(x){v=[],y=y.map(t=>b.toCodeUnitIndex(t));let t=0,n=[];for(let i of b.text)n.push(...Array(i.length).fill(b.sectionIndex[t])),t++;for(let t of x(b.text,n,y)){let n=[],i="";for(let r of t[0])n.push(t[1][i.length]),i+=r;v.push(new l7(t[0],b.sections,n))}}else v=function(t,n){let i=[],r=0;for(let o of n)i.push(t.substring(r,o)),r=o;return r<t.length()&&i.push(t.substring(r,t.length())),i}(b,y);let w=[],k={positionedLines:w,text:b.toString(),top:h[1],bottom:h[1],left:h[0],right:h[0],writingMode:p,iconsInText:!1,verticalizable:!1};return function(t,n,i,r,o,a,s,l,c,u,d,h){let p=0,f=0,m=0,g=0,v="right"===l?1:.5*("left"!==l),b=lQ/h,y=0;for(let s of o){s.trim();let o=s.getMaxScale(),l={positionedGlyphs:[],lineOffset:0};t.positionedLines[y]=l;let h=l.positionedGlyphs,_=0;if(!s.length()){f+=a,++y;continue}let x=cw(r,s,b),w=0;for(let a of s.text){let l,m=s.getSection(w),g=a.codePointAt(0),v=cC(c,d,g),y={glyph:g,imageName:null,x:p,y:f+-17,vertical:v,scale:1,fontStack:"",sectionIndex:s.getSectionIndex(w),metrics:null,rect:null};if("fontStack"in m){if(!(l=cA(m,g,v,x,n,i)))continue;y.fontStack=m.fontStack}else{if(t.iconsInText=!0,m.scale*=b,!(l=cE(m,v,o,x,r)))continue;_=Math.max(_,l.imageOffset),y.imageName=m.imageName}let{rect:k,metrics:C,baselineOffset:A}=l;y.y+=A,y.scale=m.scale,y.metrics=C,y.rect=k,h.push(y),v?(t.verticalizable=!0,p+=("imageName"in m?C.advance:lQ)*m.scale+u):p+=C.advance*m.scale+u,w++}0!==h.length&&(m=Math.max(p-u,m),cS(h,0,h.length-1,v)),p=0,l.lineOffset=Math.max(_,(o-1)*lQ);let k=a*o+_;f+=k,g=Math.max(k,g),++y}let{horizontalAlign:_,verticalAlign:x}=cx(s);(function(t,n,i,r,o,a,s,l,c){let u=(n-i)*o,d=0;for(let n of(d=a!==s?-l*r- -17:-r*c*s+.5*s,t))for(let t of n.positionedGlyphs)t.x+=u,t.y+=d})(t.positionedLines,v,_,x,m,g,a,f,o.length),t.top+=-x*f,t.bottom=t.top+f,t.left+=-_*m,t.right=t.left+m}(k,i,r,o,v,l,c,u,p,d,f,g),!function(t){for(let n of t)if(0!==n.positionedGlyphs.length)return!1;return!0}(w)&&k}function cx(t){let n=.5,i=.5;switch(t){case"right":case"top-right":case"bottom-right":n=1;break;case"left":case"top-left":case"bottom-left":n=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:n,verticalAlign:i}}function cw(t,n,i){let r=n.getMaxScale()*lQ,{maxImageWidth:o,maxImageHeight:a}=n.getMaxImageSize(t),s=Math.max(r,a*i);return{verticalLineContentWidth:Math.max(r,o*i),horizontalLineContentHeight:s}}function ck(t){switch(t){case"top":return 0;case"center":return .5;default:return 1}}function cC(n,i,r){var o;return!(n===t.az.horizontal||!i&&!r8(r)||i&&(r7(r)||(o=r,/\p{sc=Arab}/u.test(String.fromCodePoint(o)))))}function cA(t,n,i,r,o,a){let s,l=a[t.fontStack],c=function(t,n,i,r){if(t&&t.rect)return t;let o=n[i.fontStack],a=o&&o[r];return a?{rect:null,metrics:a.metrics}:null}(l&&l[n],o,t,n);if(null===c)return null;if(i)s=r.verticalLineContentWidth-t.scale*lQ;else{let n=ck(t.verticalAlign);s=(r.horizontalLineContentHeight-t.scale*lQ)*n}return{rect:c.rect,metrics:c.metrics,baselineOffset:s}}function cE(t,n,i,r,o){let a,s=o[t.imageName];if(!s)return null;let l=s.paddedRect,c=s.displaySize,u={width:c[0],height:c[1],left:1,top:-3,advance:n?c[1]:c[0]};if(n)a=r.verticalLineContentWidth-c[1]*t.scale;else{let n=ck(t.verticalAlign);a=(r.horizontalLineContentHeight-c[1]*t.scale)*n}return{rect:l,metrics:u,baselineOffset:a,imageOffset:(n?c[0]:c[1])*t.scale-lQ*i}}function cS(t,n,i,r){if(0===r)return;let o=t[i],a=(t[i].x+o.metrics.advance*o.scale)*r;for(let r=n;r<=i;r++)t[r].x-=a}function cT(t,n,i){let{horizontalAlign:r,verticalAlign:o}=cx(i),a=n[0]-t.displaySize[0]*r,s=n[1]-t.displaySize[1]*o;return{image:t,top:s,bottom:s+t.displaySize[1],left:a,right:a+t.displaySize[0]}}function cO(t){var n,i;let r=t.left,o=t.top,a=t.right-r,s=t.bottom-o,l=null!=(n=t.image.textFitWidth)?n:"stretchOrShrink",c=null!=(i=t.image.textFitHeight)?i:"stretchOrShrink",u=(t.image.content[2]-t.image.content[0])/(t.image.content[3]-t.image.content[1]);if("proportional"===c){if("stretchOnly"===l&&a/s<u||"proportional"===l){let t=Math.ceil(s*u);r*=t/a,a=t}}else if("proportional"===l&&"stretchOnly"===c&&0!==u&&a/s>u){let t=Math.ceil(a/u);o*=t/s,s=t}return{x1:r,y1:o,x2:r+a,y2:o+s}}function cF(t,n,i,r,o,a){let s,l,c,u,d,h=t.image;if(h.content){let t=h.content,n=h.pixelRatio||1;s=[t[0]/n,t[1]/n,h.displaySize[0]-t[2]/n,h.displaySize[1]-t[3]/n]}let p=n.left*a,f=n.right*a;"width"===i||"both"===i?(d=o[0]+p-r[3],c=o[0]+f+r[1]):c=(d=o[0]+(p+f-h.displaySize[0])/2)+h.displaySize[0];let m=n.top*a,g=n.bottom*a;return"height"===i||"both"===i?(l=o[1]+m-r[0],u=o[1]+g+r[2]):u=(l=o[1]+(m+g-h.displaySize[1])/2)+h.displaySize[1],{image:h,top:l,right:c,bottom:u,left:d,collisionPadding:s}}rQ("ImagePosition",cb),rQ("ImageAtlas",cy),t.az=void 0,(C=t.az||(t.az={}))[C.none=0]="none",C[C.horizontal=1]="horizontal",C[C.vertical=2]="vertical",C[C.horizontalOnly=3]="horizontalOnly";let cM=128,cI=32640;function cR(t,n){let{expression:i}=n;if("constant"===i.kind)return{kind:"constant",layoutSize:i.evaluate(new ou(t+1))};if("source"===i.kind)return{kind:"source"};{let{zoomStops:n,interpolationType:r}=i,o=0;for(;o<n.length&&n[o]<=t;)o++;let a=o=Math.max(0,o-1);for(;a<n.length&&n[a]<t+1;)a++;a=Math.min(n.length-1,a);let s=n[o],l=n[a];return"composite"===i.kind?{kind:"composite",minZoom:s,maxZoom:l,interpolationType:r}:{kind:"camera",minZoom:s,maxZoom:l,minSize:i.evaluate(new ou(s)),maxSize:i.evaluate(new ou(l)),interpolationType:r}}}function cD(t,n,i){let r="never",o=t.get(n);return o?r=o:t.get(i)&&(r="always"),r}let cP=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function cL(t,n,i,r,o,a,s,l,c,u,d,h,p){let f=l?Math.min(cI,Math.round(l[0])):0,m=l?Math.min(cI,Math.round(l[1])):0;t.emplaceBack(n,i,Math.round(32*r),Math.round(32*o),a,s,(f<<1)+ +!!c,m,16*u,16*d,256*h,256*p)}function cN(t,n,i){t.emplaceBack(n.x,n.y,i),t.emplaceBack(n.x,n.y,i),t.emplaceBack(n.x,n.y,i),t.emplaceBack(n.x,n.y,i)}function cz(t){for(let n of t.sections)if(ol(n.text))return!0;return!1}class cj{constructor(t){this.layoutVertexArray=new am,this.indexArray=new a_,this.programConfigurations=t,this.segments=new ak,this.dynamicLayoutVertexArray=new ag,this.opacityVertexArray=new av,this.hasVisibleVertices=!1,this.placedSymbolArray=new o7}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(t,n,i,r){this.isEmpty()||(i&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,lG.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,n),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,lY.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,cP,!0),this.opacityVertexBuffer.itemSize=1),(i||r)&&this.programConfigurations.upload(t))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}rQ("SymbolBuffers",cj);class cB{constructor(t,n,i){this.layoutVertexArray=new t,this.layoutAttributes=n,this.indexArray=new i,this.segments=new ak,this.collisionVertexArray=new ay}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,lZ.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}rQ("CollisionBuffers",cB);class c${constructor(n){this.collisionBoxArray=n.collisionBoxArray,this.zoom=n.zoom,this.overscaling=n.overscaling,this.layers=n.layers,this.layerIds=this.layers.map(t=>t.id),this.index=n.index,this.pixelRatio=n.pixelRatio,this.sourceLayerIndex=n.sourceLayerIndex,this.hasDependencies=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[];const i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=cR(this.zoom,i["text-size"]),this.iconSizeData=cR(this.zoom,i["icon-size"]);const r=this.layers[0].layout,o=r.get("symbol-sort-key"),a=r.get("symbol-z-order");this.canOverlap="never"!==cD(r,"text-overlap","text-allow-overlap")||"never"!==cD(r,"icon-overlap","icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==a&&!o.isConstant(),this.sortFeaturesByY=("viewport-y"===a||"auto"===a&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map(n=>t.az[n])),this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id),this.sourceID=n.sourceID}createArrays(){this.text=new cj(new aJ(this.layers,this.zoom,t=>/^text/.test(t))),this.icon=new cj(new aJ(this.layers,this.zoom,t=>/^icon/.test(t))),this.glyphOffsetArray=new at,this.lineVertexArray=new an,this.symbolInstances=new ae,this.textAnchorOffsets=new ar}calculateGlyphDependencies(t,n,i,r,o){for(let a of t)if(n[a.codePointAt(0)]=!0,(i||r)&&o){let t=l0[a];t&&(n[t.codePointAt(0)]=!0)}}populate(n,i,r){let o=this.layers[0],a=o.layout,s=a.get("text-font"),l=a.get("text-field"),c=a.get("icon-image"),u=("constant"!==l.value.kind||l.value.value instanceof tX&&!l.value.value.isEmpty()||l.value.value.toString().length>0)&&("constant"!==s.value.kind||s.value.value.length>0),d="constant"!==c.value.kind||!!c.value.value||Object.keys(c.parameters).length>0,h=a.get("symbol-sort-key");if(this.features=[],!u&&!d)return;let p=i.iconDependencies,f=i.glyphDependencies,m=i.availableImages,g=new ou(this.zoom);for(let{feature:i,id:l,index:c,sourceLayerIndex:v}of n){let n,b,y=o._featureFilter.needGeometry,_=a3(i,y);if(!o._featureFilter.filter(g,_,r))continue;if(y||(_.geometry=a5(i)),u){let t=o.getValueAndResolveTokens("text-field",_,r,m),i=tX.factory(t),a=this.hasRTLText=this.hasRTLText||cz(i);(!a||"unavailable"===oc.getRTLTextPluginStatus()||a&&oc.isParsed())&&(n=lJ(i,o,_))}if(d){let t=o.getValueAndResolveTokens("icon-image",_,r,m);b=t instanceof t5?t:t5.fromString(t)}if(!n&&!b)continue;let x=this.sortFeaturesByKey?h.evaluate(_,{},r):void 0;if(this.features.push({id:l,text:n,icon:b,index:c,sourceLayerIndex:v,geometry:_.geometry,properties:i.properties,type:l_.types[i.type],sortKey:x}),b&&(p[b.name]=!0),n){let i=s.evaluate(_,{},r).join(","),o="viewport"!==a.get("text-rotation-alignment")&&"point"!==a.get("symbol-placement");for(let r of(this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(t.az.vertical)>=0,n.sections))if(r.image)p[r.image.name]=!0;else{let t=r9(n.toString()),a=r.fontStack||i,s=f[a]=f[a]||{};this.calculateGlyphDependencies(r.text,s,o,this.allowVerticalPlacement,t)}}}"line"===a.get("symbol-placement")&&(this.features=function(t){let n={},i={},r=[],o=0;function a(n){r.push(t[n]),o++}function s(t,n,o){let a=i[t];return delete i[t],i[n]=a,r[a].geometry[0].pop(),r[a].geometry[0]=r[a].geometry[0].concat(o[0]),a}function l(t,i,o){let a=n[i];return delete n[i],n[t]=a,r[a].geometry[0].shift(),r[a].geometry[0]=o[0].concat(r[a].geometry[0]),a}function c(t,n,i){let r=i?n[0][n[0].length-1]:n[0][0];return`${t}:${r.x}:${r.y}`}for(let u=0;u<t.length;u++){let d=t[u],h=d.geometry,p=d.text?d.text.toString():null;if(!p){a(u);continue}let f=c(p,h),m=c(p,h,!0);if(f in i&&m in n&&i[f]!==n[m]){let t=l(f,m,h),o=s(f,m,r[t].geometry);delete n[f],delete i[m],i[c(p,r[o].geometry,!0)]=o,r[t].geometry=null}else f in i?s(f,m,h):m in n?l(f,m,h):(a(u),n[f]=o-1,i[m]=o-1)}return r.filter(t=>t.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((t,n)=>t.sortKey-n.sortKey)}update(t,n,i){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,n,this.layers,{imagePositions:i}),this.icon.programConfigurations.updatePaintArrays(t,n,this.layers,{imagePositions:i}))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,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(t,n){let i=this.lineVertexArray.length;if(void 0!==t.segment){let i=t.dist(n[t.segment+1]),r=t.dist(n[t.segment]),o={};for(let r=t.segment+1;r<n.length;r++)o[r]={x:n[r].x,y:n[r].y,tileUnitDistanceFromAnchor:i},r<n.length-1&&(i+=n[r+1].dist(n[r]));for(let i=t.segment||0;i>=0;i--)o[i]={x:n[i].x,y:n[i].y,tileUnitDistanceFromAnchor:r},i>0&&(r+=n[i-1].dist(n[i]));for(let t=0;t<n.length;t++){let n=o[t];this.lineVertexArray.emplaceBack(n.x,n.y,n.tileUnitDistanceFromAnchor)}}return{lineStartIndex:i,lineLength:this.lineVertexArray.length-i}}addSymbols(n,i,r,o,a,s,l,c,u,d,h,p){let f=n.indexArray,m=n.layoutVertexArray,g=n.segments.prepareSegment(4*i.length,m,f,this.canOverlap?s.sortKey:void 0),v=this.glyphOffsetArray.length,b=g.vertexLength,y=this.allowVerticalPlacement&&l===t.az.vertical?Math.PI/2:0,_=s.text&&s.text.sections;for(let t=0;t<i.length;t++){let{tl:o,tr:a,bl:l,br:u,tex:d,pixelOffsetTL:h,pixelOffsetBR:v,minFontScaleX:b,minFontScaleY:x,glyphOffset:w,isSDF:k,sectionIndex:C}=i[t],A=g.vertexLength,E=w[1];cL(m,c.x,c.y,o.x,E+o.y,d.x,d.y,r,k,h.x,h.y,b,x),cL(m,c.x,c.y,a.x,E+a.y,d.x+d.w,d.y,r,k,v.x,h.y,b,x),cL(m,c.x,c.y,l.x,E+l.y,d.x,d.y+d.h,r,k,h.x,v.y,b,x),cL(m,c.x,c.y,u.x,E+u.y,d.x+d.w,d.y+d.h,r,k,v.x,v.y,b,x),cN(n.dynamicLayoutVertexArray,c,y),f.emplaceBack(A,A+2,A+1),f.emplaceBack(A+1,A+2,A+3),g.vertexLength+=4,g.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(w[0]),t!==i.length-1&&C===i[t+1].sectionIndex||n.programConfigurations.populatePaintArrays(m.length,s,s.index,{imagePositions:{},canonical:p,formattedSection:_&&_[C]})}n.placedSymbolArray.emplaceBack(c.x,c.y,v,this.glyphOffsetArray.length-v,b,u,d,c.segment,r?r[0]:0,r?r[1]:0,o[0],o[1],l,0,!1,0,h)}_addCollisionDebugVertex(t,n,i,r,o,a){return n.emplaceBack(0,0),t.emplaceBack(i.x,i.y,r,o,Math.round(a.x),Math.round(a.y))}addCollisionDebugVertices(t,n,i,r,o,a,s){let l=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),c=l.vertexLength,u=o.layoutVertexArray,d=o.collisionVertexArray,h=s.anchorX,p=s.anchorY;this._addCollisionDebugVertex(u,d,a,h,p,new w(t,n)),this._addCollisionDebugVertex(u,d,a,h,p,new w(i,n)),this._addCollisionDebugVertex(u,d,a,h,p,new w(i,r)),this._addCollisionDebugVertex(u,d,a,h,p,new w(t,r)),l.vertexLength+=4;let f=o.indexArray;f.emplaceBack(c,c+1),f.emplaceBack(c+1,c+2),f.emplaceBack(c+2,c+3),f.emplaceBack(c+3,c),l.primitiveLength+=4}addDebugCollisionBoxes(t,n,i,r){for(let o=t;o<n;o++){let t=this.collisionBoxArray.get(o);this.addCollisionDebugVertices(t.x1,t.y1,t.x2,t.y2,r?this.textCollisionBox:this.iconCollisionBox,t.anchorPoint,i)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new cB(ab,lX.members,ax),this.iconCollisionBox=new cB(ab,lX.members,ax);for(let t=0;t<this.symbolInstances.length;t++){let n=this.symbolInstances.get(t);this.addDebugCollisionBoxes(n.textBoxStartIndex,n.textBoxEndIndex,n,!0),this.addDebugCollisionBoxes(n.verticalTextBoxStartIndex,n.verticalTextBoxEndIndex,n,!0),this.addDebugCollisionBoxes(n.iconBoxStartIndex,n.iconBoxEndIndex,n,!1),this.addDebugCollisionBoxes(n.verticalIconBoxStartIndex,n.verticalIconBoxEndIndex,n,!1)}}_deserializeCollisionBoxesForSymbol(t,n,i,r,o,a,s,l,c){let u={};for(let r=n;r<i;r++){let n=t.get(r);u.textBox={x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2,anchorPointX:n.anchorPointX,anchorPointY:n.anchorPointY},u.textFeatureIndex=n.featureIndex;break}for(let n=r;n<o;n++){let i=t.get(n);u.verticalTextBox={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2,anchorPointX:i.anchorPointX,anchorPointY:i.anchorPointY},u.verticalTextFeatureIndex=i.featureIndex;break}for(let n=a;n<s;n++){let i=t.get(n);u.iconBox={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2,anchorPointX:i.anchorPointX,anchorPointY:i.anchorPointY},u.iconFeatureIndex=i.featureIndex;break}for(let n=l;n<c;n++){let i=t.get(n);u.verticalIconBox={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2,anchorPointX:i.anchorPointX,anchorPointY:i.anchorPointY},u.verticalIconFeatureIndex=i.featureIndex;break}return u}deserializeCollisionBoxes(t){this.collisionArrays=[];for(let n=0;n<this.symbolInstances.length;n++){let i=this.symbolInstances.get(n);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,i.textBoxStartIndex,i.textBoxEndIndex,i.verticalTextBoxStartIndex,i.verticalTextBoxEndIndex,i.iconBoxStartIndex,i.iconBoxEndIndex,i.verticalIconBoxStartIndex,i.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(t,n){let i=t.placedSymbolArray.get(n),r=i.vertexStartIndex+4*i.numGlyphs;for(let n=i.vertexStartIndex;n<r;n+=4)t.indexArray.emplaceBack(n,n+2,n+1),t.indexArray.emplaceBack(n+1,n+2,n+3)}getSortedSymbolIndexes(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;let n=Math.sin(t),i=Math.cos(t),r=[],o=[],a=[];for(let t=0;t<this.symbolInstances.length;++t){a.push(t);let s=this.symbolInstances.get(t);r.push(0|Math.round(n*s.anchorX+i*s.anchorY)),o.push(s.featureIndex)}return a.sort((t,n)=>r[t]-r[n]||o[n]-o[t]),a}addToSortKeyRanges(t,n){let i=this.sortKeyRanges[this.sortKeyRanges.length-1];i&&i.sortKey===n?i.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:n,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){for(let n of(this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[],this.symbolInstanceIndexes)){let t=this.symbolInstances.get(n);this.featureSortOrder.push(t.featureIndex),[t.rightJustifiedTextSymbolIndex,t.centerJustifiedTextSymbolIndex,t.leftJustifiedTextSymbolIndex].forEach((t,n,i)=>{t>=0&&i.indexOf(t)===n&&this.addIndicesForPlacedSymbol(this.text,t)}),t.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,t.verticalPlacedTextSymbolIndex),t.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,t.placedIconSymbolIndex),t.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,t.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}rQ("SymbolBucket",c$,{omit:["layers","collisionBoxArray","features","compareText"]}),c$.MAX_GLYPHS=65535,c$.addDynamicAttributes=cN;var cU={get paint(){return y=y||new oE({"icon-opacity":new ow(eY.paint_symbol["icon-opacity"]),"icon-color":new ow(eY.paint_symbol["icon-color"]),"icon-halo-color":new ow(eY.paint_symbol["icon-halo-color"]),"icon-halo-width":new ow(eY.paint_symbol["icon-halo-width"]),"icon-halo-blur":new ow(eY.paint_symbol["icon-halo-blur"]),"icon-translate":new ox(eY.paint_symbol["icon-translate"]),"icon-translate-anchor":new ox(eY.paint_symbol["icon-translate-anchor"]),"text-opacity":new ow(eY.paint_symbol["text-opacity"]),"text-color":new ow(eY.paint_symbol["text-color"],{runtimeType:tr,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new ow(eY.paint_symbol["text-halo-color"]),"text-halo-width":new ow(eY.paint_symbol["text-halo-width"]),"text-halo-blur":new ow(eY.paint_symbol["text-halo-blur"]),"text-translate":new ox(eY.paint_symbol["text-translate"]),"text-translate-anchor":new ox(eY.paint_symbol["text-translate-anchor"])})},get layout(){return b=b||new oE({"symbol-placement":new ox(eY.layout_symbol["symbol-placement"]),"symbol-spacing":new ox(eY.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new ox(eY.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new ow(eY.layout_symbol["symbol-sort-key"]),"symbol-z-order":new ox(eY.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new ox(eY.layout_symbol["icon-allow-overlap"]),"icon-overlap":new ox(eY.layout_symbol["icon-overlap"]),"icon-ignore-placement":new ox(eY.layout_symbol["icon-ignore-placement"]),"icon-optional":new ox(eY.layout_symbol["icon-optional"]),"icon-rotation-alignment":new ox(eY.layout_symbol["icon-rotation-alignment"]),"icon-size":new ow(eY.layout_symbol["icon-size"]),"icon-text-fit":new ox(eY.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new ox(eY.layout_symbol["icon-text-fit-padding"]),"icon-image":new ow(eY.layout_symbol["icon-image"]),"icon-rotate":new ow(eY.layout_symbol["icon-rotate"]),"icon-padding":new ow(eY.layout_symbol["icon-padding"]),"icon-keep-upright":new ox(eY.layout_symbol["icon-keep-upright"]),"icon-offset":new ow(eY.layout_symbol["icon-offset"]),"icon-anchor":new ow(eY.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new ox(eY.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new ox(eY.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new ox(eY.layout_symbol["text-rotation-alignment"]),"text-field":new ow(eY.layout_symbol["text-field"]),"text-font":new ow(eY.layout_symbol["text-font"]),"text-size":new ow(eY.layout_symbol["text-size"]),"text-max-width":new ow(eY.layout_symbol["text-max-width"]),"text-line-height":new ox(eY.layout_symbol["text-line-height"]),"text-letter-spacing":new ow(eY.layout_symbol["text-letter-spacing"]),"text-justify":new ow(eY.layout_symbol["text-justify"]),"text-radial-offset":new ow(eY.layout_symbol["text-radial-offset"]),"text-variable-anchor":new ox(eY.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new ow(eY.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new ow(eY.layout_symbol["text-anchor"]),"text-max-angle":new ox(eY.layout_symbol["text-max-angle"]),"text-writing-mode":new ox(eY.layout_symbol["text-writing-mode"]),"text-rotate":new ow(eY.layout_symbol["text-rotate"]),"text-padding":new ox(eY.layout_symbol["text-padding"]),"text-keep-upright":new ox(eY.layout_symbol["text-keep-upright"]),"text-transform":new ow(eY.layout_symbol["text-transform"]),"text-offset":new ow(eY.layout_symbol["text-offset"]),"text-allow-overlap":new ox(eY.layout_symbol["text-allow-overlap"]),"text-overlap":new ox(eY.layout_symbol["text-overlap"]),"text-ignore-placement":new ox(eY.layout_symbol["text-ignore-placement"]),"text-optional":new ox(eY.layout_symbol["text-optional"])})}};class cV{constructor(t){if(void 0===t.property.overrides)throw Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:te,this.defaultValue=t}evaluate(t){if(t.formattedSection){let n=this.defaultValue.property.overrides;if(n&&n.hasOverride(t.formattedSection))return n.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}rQ("FormatSectionOverride",cV,{omit:["defaultValue"]});class cH extends oS{constructor(t,n){super(t,cU,n)}recalculate(t,n){if(super.recalculate(t,n),"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 t=this.layout.get("text-writing-mode");if(t){let n=[];for(let i of t)0>n.indexOf(i)&&n.push(i);this.layout._values["text-writing-mode"]=n}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(t,n,i,r){let o=this.layout.get(t).evaluate(n,{},i,r),a=this._unevaluatedLayout._values[t];return a.isDataDriven()||iQ(a.value)||!o?o:function(t,n){return n.replace(/{([^{}]+)}/g,(n,i)=>t&&i in t?String(t[i]):"")}(n.properties,o)}createBucket(t){return new c$(t)}queryRadius(){return 0}queryIntersectsFeature(){throw Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let t of cU.paint.overridableProperties){if(!cH.hasPaintOverride(this.layout,t))continue;let n=this.paint.get(t),i=new iJ(new cV(n),n.property.specification),r=null;r="constant"===n.value.kind||"source"===n.value.kind?new i1("source",i):new i2("composite",i,n.value.zoomStops),this.paint._values[t]=new oy(n.property,r,n.parameters)}}_handleOverridablePaintPropertyUpdate(t,n,i){return!(!this.layout||n.isDataDriven()||i.isDataDriven())&&cH.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,n){let i=t.get("text-field"),r=cU.paint.properties[n],o=!1,a=t=>{for(let n of t)if(r.overrides&&r.overrides.hasOverride(n))return void(o=!0)};if("constant"===i.value.kind&&i.value.value instanceof tX)a(i.value.value.sections);else if("source"===i.value.kind||"composite"===i.value.kind){let t=n=>{o||(n instanceof t9&&t8(n.value)===tc?a(n.value.sections):n instanceof nP?a(n.sections):n.eachChild(t))},n=i.value;n._styleExpression&&t(n._styleExpression.expression)}return o}}var cq={get paint(){return _=_||new oE({"background-color":new ox(eY.paint_background["background-color"]),"background-pattern":new oC(eY.paint_background["background-pattern"]),"background-opacity":new ox(eY.paint_background["background-opacity"])})}};class cW extends oS{constructor(t,n){super(t,cq,n)}}class cG extends oS{constructor(t,n){super(t,{},n),this.onAdd=t=>{this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},this.onRemove=t=>{this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},this.implementation=t}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 cY{constructor(t){this._methodToThrottle=t,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 cZ={once:!0},cX=6371008.8;class cK{constructor(t,n){if(isNaN(t)||isNaN(n))throw Error(`Invalid LngLat object: (${t}, ${n})`);if(this.lng=+t,this.lat=+n,this.lat>90||this.lat<-90)throw Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new cK(ef(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){let n=Math.PI/180,i=this.lat*n,r=t.lat*n;return cX*Math.acos(Math.min(Math.sin(i)*Math.sin(r)+Math.cos(i)*Math.cos(r)*Math.cos((t.lng-this.lng)*n),1))}static convert(t){if(t instanceof cK)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new cK(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new cK(Number("lng"in t?t.lng:t.lon),Number(t.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 cJ=2*Math.PI*cX;function cQ(t){return cJ*Math.cos(t*Math.PI/180)}function c0(t){return(180+t)/360}function c1(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function c2(t,n){return t/cQ(n)}function c5(t){return 360*t-180}function c3(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}function c4(t,n){return t*cQ(c3(n))}class c6{constructor(t,n,i=0){this.x=+t,this.y=+n,this.z=+i}static fromLngLat(t,n=0){let i=cK.convert(t);return new c6(c0(i.lng),c1(i.lat),c2(n,i.lat))}toLngLat(){return new cK(c5(this.x),c3(this.y))}toAltitude(){return c4(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/cJ*(1/Math.cos(c3(this.y)*Math.PI/180))}}function c8(t,n,i){var r=2*Math.PI*6378137/256/Math.pow(2,i);return[t*r-2*Math.PI*6378137/2,n*r-2*Math.PI*6378137/2]}class c7{constructor(t,n,i){if(!function(t,n,i){return!(t<0||t>25||i<0||i>=Math.pow(2,t)||n<0||n>=Math.pow(2,t))}(t,n,i))throw Error(`x=${n}, y=${i}, z=${t} outside of bounds. 0<=x<${Math.pow(2,t)}, 0<=y<${Math.pow(2,t)} 0<=z<=25 `);this.z=t,this.x=n,this.y=i,this.key=ut(0,t,t,n,i)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,n,i){var r,o,a,s,l;let c=(o=this.y,a=this.z,s=c8(256*(r=this.x),256*(o=Math.pow(2,a)-o-1),a),l=c8(256*(r+1),256*(o+1),a),s[0]+","+s[1]+","+l[0]+","+l[1]),u=function(t,n,i){let r,o="";for(let a=t;a>0;a--)o+=(n&(r=1<<a-1)?1:0)+(i&r?2:0);return o}(this.z,this.x,this.y);return t[(this.x+this.y)%t.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"===i?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,n>1?"@2x":"").replace(/{quadkey}/g,u).replace(/{bbox-epsg-3857}/g,c)}isChildOf(t){let n=this.z-t.z;return n>0&&t.x===this.x>>n&&t.y===this.y>>n}getTilePoint(t){let n=Math.pow(2,this.z);return new w((t.x*n-this.x)*ea,(t.y*n-this.y)*ea)}toString(){return`${this.z}/${this.x}/${this.y}`}}class c9{constructor(t,n){this.wrap=t,this.canonical=n,this.key=ut(t,n.z,n.z,n.x,n.y)}}class ue{constructor(t,n,i,r,o){if(this.terrainRttPosMatrix32f=null,t<i)throw Error(`overscaledZ should be >= z; overscaledZ = ${t}; z = ${i}`);this.overscaledZ=t,this.wrap=n,this.canonical=new c7(i,+r,+o),this.key=ut(n,t,i,r,o)}clone(){return new ue(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){if(t>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);let n=this.canonical.z-t;return t>this.canonical.z?new ue(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new ue(t,this.wrap,t,this.canonical.x>>n,this.canonical.y>>n)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(t,n){if(t>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);let i=this.canonical.z-t;return t>this.canonical.z?ut(this.wrap*n,t,this.canonical.z,this.canonical.x,this.canonical.y):ut(this.wrap*n,t,t,this.canonical.x>>i,this.canonical.y>>i)}isChildOf(t){if(t.wrap!==this.wrap||this.overscaledZ-t.overscaledZ<=0)return!1;if(0===t.overscaledZ)return this.overscaledZ>0;let n=this.canonical.z-t.canonical.z;return!(n<0)&&t.canonical.x===this.canonical.x>>n&&t.canonical.y===this.canonical.y>>n}children(t){if(this.overscaledZ>=t)return[new ue(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let n=this.canonical.z+1,i=2*this.canonical.x,r=2*this.canonical.y;return[new ue(n,this.wrap,n,i,r),new ue(n,this.wrap,n,i+1,r),new ue(n,this.wrap,n,i,r+1),new ue(n,this.wrap,n,i+1,r+1)]}isLessThan(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))}wrapped(){return new ue(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new ue(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new c9(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(t){return this.canonical.getTilePoint(new c6(t.x-this.wrap,t.y))}normalizeCoordinates(t,n,i=8192){if(t>=0&&t<i&&n>=0&&n<i)return{tileID:this,x:t,y:n};let r=Math.floor(t/i),o=Math.floor(n/i),a=t-r*i,s=n-o*i,l=this.canonical.z,c=1<<l,u=this.canonical.y+o;if(u<0||u>=c)return null;let d=this.canonical.x+r,h=this.wrap;return d<0?(h-=Math.ceil(-d/c),d=(d%c+c)%c):d>=c&&(h+=Math.floor(d/c),d%=c),{tileID:new ue(this.overscaledZ,h,l,d,u),x:a,y:s}}}function ut(t,n,i,r,o){(t*=2)<0&&(t=-1*t-1);let a=1<<i;return(a*a*t+a*o+r).toString(36)+i.toString(36)+n.toString(36)}function un(t,n){return n?t.properties[n]:t.id}function ui(t,n){let i={id:t.id};if(n.removeAllProperties&&(delete t.removeProperties,delete t.addOrUpdateProperties,delete n.removeProperties),n.removeProperties)for(let i of n.removeProperties){let n=t.addOrUpdateProperties.findIndex(t=>t.key===i);n>-1&&t.addOrUpdateProperties.splice(n,1)}return(t.removeAllProperties||n.removeAllProperties)&&(i.removeAllProperties=!0),(t.removeProperties||n.removeProperties)&&(i.removeProperties=[...t.removeProperties||[],...n.removeProperties||[]]),(t.addOrUpdateProperties||n.addOrUpdateProperties)&&(i.addOrUpdateProperties=[...t.addOrUpdateProperties||[],...n.addOrUpdateProperties||[]]),(t.newGeometry||n.newGeometry)&&(i.newGeometry=n.newGeometry||t.newGeometry),i}function ur(t){var n,i;if(!t)return{};let r={};return r.removeAll=t.removeAll,r.remove=new Set(t.remove||[]),r.add=new Map(null==(n=t.add)?void 0:n.map(t=>[t.id,t])),r.update=new Map(null==(i=t.update)?void 0:i.map(t=>[t.id,t])),r}rQ("CanonicalTileID",c7),rQ("OverscaledTileID",ue,{omit:["terrainRttPosMatrix32f"]});class uo{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(t){return this.minX=Math.min(this.minX,t.x),this.minY=Math.min(this.minY,t.y),this.maxX=Math.max(this.maxX,t.x),this.maxY=Math.max(this.maxY,t.y),this}expandBy(t){return this.minX-=t,this.minY-=t,this.maxX+=t,this.maxY+=t,(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(t){return this.expandBy(-t)}map(t){let n=new uo;return n.extend(t(new w(this.minX,this.minY))),n.extend(t(new w(this.maxX,this.minY))),n.extend(t(new w(this.minX,this.maxY))),n.extend(t(new w(this.maxX,this.maxY))),n}static fromPoints(t){let n=new uo;for(let i of t)n.extend(i);return n}contains(t){return t.x>=this.minX&&t.x<=this.maxX&&t.y>=this.minY&&t.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(t){return!this.empty()&&!t.empty()&&t.minX>=this.minX&&t.maxX<=this.maxX&&t.minY>=this.minY&&t.maxY<=this.maxY}intersects(t){return!this.empty()&&!t.empty()&&t.minX<=this.maxX&&t.maxX>=this.minX&&t.minY<=this.maxY&&t.maxY>=this.minY}}class ua{constructor(t){this._stringToNumber={},this._numberToString=[];for(let n=0;n<t.length;n++){const i=t[n];this._stringToNumber[i]=n,this._numberToString[n]=i}}encode(t){return this._stringToNumber[t]}decode(t){if(t>=this._numberToString.length)throw Error(`Out of bounds. Index requested n=${t} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}}class us{constructor(t,n,i,r,o){this.type="Feature",this._vectorTileFeature=t,this._x=i,this._y=r,this._z=n,this.properties=t.properties,this.id=o}projectPoint(t,n,i,r){return[360*(t.x+n)/r-180,360/Math.PI*Math.atan(Math.exp((1-2*(t.y+i)/r)*Math.PI))-90]}projectLine(t,n,i,r){return t.map(t=>this.projectPoint(t,n,i,r))}get geometry(){if(this._geometry)return this._geometry;let t=this._vectorTileFeature,n=t.extent*Math.pow(2,this._z),i=t.extent*this._x,r=t.extent*this._y,o=t.loadGeometry();switch(t.type){case 1:{let t=[];for(let n of o)t.push(n[0]);let a=this.projectLine(t,i,r,n);this._geometry=1===t.length?{type:"Point",coordinates:a[0]}:{type:"MultiPoint",coordinates:a};break}case 2:{let t=o.map(t=>this.projectLine(t,i,r,n));this._geometry=1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t};break}case 3:{let t=lw(o),a=[];for(let o of t)a.push(o.map(t=>this.projectLine(t,i,r,n)));this._geometry=1===a.length?{type:"Polygon",coordinates:a[0]}:{type:"MultiPolygon",coordinates:a};break}default:throw Error(`unknown feature type: ${t.type}`)}return this._geometry}set geometry(t){this._geometry=t}toJSON(){let t={geometry:this.geometry};for(let n in this)"_geometry"!==n&&"_vectorTileFeature"!==n&&"_x"!==n&&"_y"!==n&&"_z"!==n&&(t[n]=this[n]);return t}}class ul{_name;dataBuffer;nullabilityBuffer;_size;constructor(t,n,i){this._name=t,this.dataBuffer=n,"number"==typeof i?this._size=i:(this.nullabilityBuffer=i,this._size=i.size())}getValue(t){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(t)?null:this.getValueFromBuffer(t)}has(t){return this.nullabilityBuffer&&this.nullabilityBuffer.get(t)||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}}class uc extends ul{}class uu extends uc{getValueFromBuffer(t){return this.dataBuffer[t]}}class ud extends uc{getValueFromBuffer(t){return this.dataBuffer[t]}}class uh extends ul{delta;constructor(t,n,i,r){super(t,n,r),this.delta=i}}class up extends uh{constructor(t,n,i,r){super(t,Int32Array.of(n),i,r)}getValueFromBuffer(t){return this.dataBuffer[0]+t*this.delta}}class uf extends ul{constructor(t,n,i){super(t,Int32Array.of(n),i)}getValueFromBuffer(t){return this.dataBuffer[0]}}class um{_name;_geometryVector;_idVector;_propertyVectors;_extent;propertyVectorsMap;constructor(t,n,i,r,o=4096){this._name=t,this._geometryVector=n,this._idVector=i,this._propertyVectors=r,this._extent=o}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){return this._propertyVectors}getPropertyVector(t){return this.propertyVectorsMap||(this.propertyVectorsMap=new Map(this._propertyVectors.map(t=>[t.name,t]))),this.propertyVectorsMap.get(t)}*[Symbol.iterator](){let t=this.geometryVector[Symbol.iterator](),n=0;for(;n<this.numFeatures;){let i;this.idVector&&(i=this.containsMaxSaveIntegerValues(this.idVector)?Number(this.idVector.getValue(n)):this.idVector.getValue(n));let r=t?.next().value,o={};for(let t of this.propertyVectors){if(!t)continue;let i=t.name,r=t.getValue(n);null!==r&&(o[i]=r)}n++,yield{id:i,geometry:r,properties:o}}}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let t=[],n=this.geometryVector.getGeometries();for(let i=0;i<this.numFeatures;i++){let r;this.idVector&&(r=this.containsMaxSaveIntegerValues(this.idVector)?Number(this.idVector.getValue(i)):this.idVector.getValue(i));let o={coordinates:n[i],type:this.geometryVector.geometryType(i)},a={};for(let t of this.propertyVectors){if(!t)continue;let n=t.name,r=t.getValue(i);null!==r&&(a[n]=r)}t.push({id:r,geometry:o,properties:a})}return t}containsMaxSaveIntegerValues(t){return t instanceof uu||t instanceof uf&&t instanceof up||t instanceof ud}}class ug{value;constructor(t){this.value=t}get(){return this.value}set(t){this.value=t}increment(){return this.value++}add(t){this.value+=t}}function uv(t,n,i){let r=new Int32Array(i),o=0,a=n.get();for(let n=0;n<r.length;n++){let n=t[a++],i=127&n;n<128||(i|=(127&(n=t[a++]))<<7,n<128||(i|=(127&(n=t[a++]))<<14,n<128||(i|=(127&(n=t[a++]))<<21,n<128||(i|=(15&(n=t[a++]))<<28)))),r[o++]=i}return n.set(a),r}function ub(t,n,i){let r=new BigInt64Array(i);for(let i=0;i<r.length;i++)r[i]=uy(t,n);return r}function uy(t,n){let i=0n,r=0,o=n.get();for(;o<t.length;){let n=t[o++];if(i|=BigInt(127&n)<<BigInt(r),!(128&n))break;if((r+=7)>=64)throw Error("Varint too long")}return n.set(o),i}function u_(t,n){let i,r;return r=t[n.get()],n.increment(),i=127&r,r<128?i:(r=t[n.get()],n.increment(),i|=(127&r)<<7,r<128?i:(r=t[n.get()],n.increment(),i|=(127&r)<<14,r<128?i:(r=t[n.get()],n.increment(),i|=(127&r)<<21,r<128?i:function(t,n,i){let r,o;if(o=n[i.get()],i.increment(),r=(112&o)>>4,o<128||(o=n[i.get()],i.increment(),r|=(127&o)<<3,o<128)||(o=n[i.get()],i.increment(),r|=(127&o)<<10,o<128)||(o=n[i.get()],i.increment(),r|=(127&o)<<17,o<128)||(o=n[i.get()],i.increment(),r|=(127&o)<<24,o<128)||(o=n[i.get()],i.increment(),r|=(1&o)<<31,o<128))return 0x100000000*r+(t>>>0);throw Error("Expected varint not more than 10 bytes")}(i|=(15&(r=t[n.get()]))<<28,t,n))))}function ux(t){return t>>>1^-(1&t)}function uw(t){return t>>1n^-(1n&t)}function uk(t){return t%2==1?-((t+1)/2):t/2}function uC(t,n,i){if(void 0===i){i=0;for(let r=0;r<n;r++)i+=t[r]}let r=new Int32Array(i),o=0;for(let i=0;i<n;i++){let a=t[i];r.fill(t[i+n],o,o+a),o+=a}return r}function uA(t,n,i){if(void 0===i){i=0;for(let r=0;r<n;r++)i+=Number(t[r])}let r=new BigInt64Array(i),o=0;for(let i=0;i<n;i++){let a=Number(t[i]);r.fill(t[i+n],o,o+a),o+=a}return r}function uE(t,n,i){let r=new Float64Array(i),o=0;for(let i=0;i<n;i++){let a=t[i];r.fill(t[i+n],o,o+a),o+=a}return r}function uS(t){let n=t.length/4*4,i=1;if(n>=4)for(let r=t[0];i<n-4;i+=4)r=t[i]+=r,r=t[i+1]+=r,r=t[i+2]+=r,r=t[i+3]+=r;for(;i!=t.length;)t[i]+=t[i-1],++i}!function(t){t.NONE="NONE",t.DELTA="DELTA",t.COMPONENTWISE_DELTA="COMPONENTWISE_DELTA",t.RLE="RLE",t.MORTON="MORTON",t.PDE="PDE"}(A||(A={})),function(t){t.NONE="NONE",t.FAST_PFOR="FAST_PFOR",t.VARINT="VARINT",t.ALP="ALP"}(E||(E={})),function(t){t.PRESENT="PRESENT",t.DATA="DATA",t.OFFSET="OFFSET",t.LENGTH="LENGTH"}(S||(S={}));class uT{_dictionaryType;_offsetType;_lengthType;constructor(t,n,i){this._dictionaryType=t,this._offsetType=n,this._lengthType=i}get dictionaryType(){return this._dictionaryType}get offsetType(){return this._offsetType}get lengthType(){return this._lengthType}}function uO(t,n){let i=function(t,n){let i=t[n.get()],r=Object.values(S)[i>>4],o=null;switch(r){case S.DATA:o=new uT(Object.values(T)[15&i]);break;case S.OFFSET:o=new uT(null,Object.values(O)[15&i]);break;case S.LENGTH:o=new uT(null,null,Object.values(F)[15&i])}n.increment();let a=t[n.get()],s=Object.values(A)[a>>5],l=Object.values(A)[a>>2&7],c=Object.values(E)[3&a];n.increment();let u=uv(t,n,2),d=u[0];return{physicalStreamType:r,logicalStreamType:o,logicalLevelTechnique1:s,logicalLevelTechnique2:l,physicalLevelTechnique:c,numValues:d,byteLength:u[1],decompressedCount:d}}(t,n);return i.logicalLevelTechnique1===A.MORTON?function(t,n,i){let r=uv(n,i,2);return{physicalStreamType:t.physicalStreamType,logicalStreamType:t.logicalStreamType,logicalLevelTechnique1:t.logicalLevelTechnique1,logicalLevelTechnique2:t.logicalLevelTechnique2,physicalLevelTechnique:t.physicalLevelTechnique,numValues:t.numValues,byteLength:t.byteLength,decompressedCount:t.decompressedCount,numBits:r[0],coordinateShift:r[1]}}(i,t,n):A.RLE!==i.logicalLevelTechnique1&&A.RLE!==i.logicalLevelTechnique2||E.NONE===i.physicalLevelTechnique?i:function(t,n,i){let r=uv(n,i,2);return{physicalStreamType:t.physicalStreamType,logicalStreamType:t.logicalStreamType,logicalLevelTechnique1:t.logicalLevelTechnique1,logicalLevelTechnique2:t.logicalLevelTechnique2,physicalLevelTechnique:t.physicalLevelTechnique,numValues:t.numValues,byteLength:t.byteLength,decompressedCount:r[1],runs:r[0],numRleValues:r[1]}}(i,t,n)}!function(t){t.NONE="NONE",t.SINGLE="SINGLE",t.SHARED="SHARED",t.VERTEX="VERTEX",t.MORTON="MORTON",t.FSST="FSST"}(T||(T={})),function(t){t.VERTEX="VERTEX",t.INDEX="INDEX",t.STRING="STRING",t.KEY="KEY"}(O||(O={})),function(t){t.VAR_BINARY="VAR_BINARY",t.GEOMETRIES="GEOMETRIES",t.PARTS="PARTS",t.RINGS="RINGS",t.TRIANGLES="TRIANGLES",t.SYMBOL="SYMBOL",t.DICTIONARY="DICTIONARY"}(F||(F={})),function(t){t[t.FLAT=0]="FLAT",t[t.CONST=1]="CONST",t[t.SEQUENCE=2]="SEQUENCE",t[t.DICTIONARY=3]="DICTIONARY",t[t.FSST_DICTIONARY=4]="FSST_DICTIONARY"}(M||(M={}));class uF{values;_size;constructor(t,n){this.values=t,this._size=n}get(t){let n=Math.floor(t/8);return 1==(this.values[n]>>t%8&1)}set(t,n){let i=Math.floor(t/8);this.values[i]=this.values[i]|!!n<<t%8}getInt(t){let n=Math.floor(t/8);return this.values[n]>>t%8&1}size(){return this._size}getBuffer(){return this.values}}function uM(t,n,i){if(!n)return t;let r=n.size(),o=new(0,t.constructor)(r),a=0;for(let s=0;s<r;s++)o[s]=n.get(s)?t[a++]:i;return o}function uI(t,n,i,r,o,a){return function(t,n,i,r){switch(n.logicalLevelTechnique1){case A.DELTA:if(n.logicalLevelTechnique2===A.RLE){let i=n;if(!r)return function(t,n,i){let r=new Int32Array(i),o=0,a=0;for(let i=0;i<n;i++){let s=t[i],l=ux(t[i+n]);for(let t=0;t<s;t++)a+=l,r[o++]=a}return r}(t,i.runs,i.numRleValues);t=uC(t,i.runs,i.numRleValues)}!function(t){t[0]=ux(t[0]);let n=t.length/4*4,i=1;if(n>=4)for(;i<n-4;i+=4){let n=t[i+1],r=t[i+2],o=t[i+3];t[i]=ux(t[i])+t[i-1],t[i+1]=ux(n)+t[i],t[i+2]=ux(r)+t[i+1],t[i+3]=ux(o)+t[i+2]}for(;i!=t.length;++i)t[i]=ux(t[i])+t[i-1]}(t);break;case A.RLE:t=function(t,n,i){return i?function(t,n,i){if(void 0===i){i=0;for(let r=0;r<n;r++)i+=t[r]}let r=new Int32Array(i),o=0;for(let i=0;i<n;i++){let a=t[i],s=t[i+n];s=ux(s),r.fill(s,o,o+a),o+=a}return r}(t,n.runs,n.numRleValues):uC(t,n.runs,n.numRleValues)}(t,n,i);break;case A.MORTON:uS(t);break;case A.COMPONENTWISE_DELTA:!function(t){if(t.length<2)return;t[0]=ux(t[0]),t[1]=ux(t[1]);let n=t.length/4*4,i=2;if(n>=4)for(;i<n-4;i+=4){let n=t[i+1],r=t[i+2],o=t[i+3];t[i]=ux(t[i])+t[i-2],t[i+1]=ux(n)+t[i-1],t[i+2]=ux(r)+t[i],t[i+3]=ux(o)+t[i+1]}for(;i!=t.length;i+=2)t[i]=ux(t[i])+t[i-2],t[i+1]=ux(t[i+1])+t[i-1]}(t);break;case A.NONE:i&&function(t){for(let n=0;n<t.length;n++)t[n]=ux(t[n])}(t);break;default:throw Error(`The specified Logical level technique is not supported: ${n.logicalLevelTechnique1}`)}return r?uM(t,r,0):t}(uD(t,n,i),i,r,a)}function uR(t,n,i){return function(t,n){if(n.logicalLevelTechnique1===A.DELTA&&n.logicalLevelTechnique2===A.NONE)return function(t){let n=new Int32Array(t.length+1);n[0]=0,n[1]=ux(t[0]);let i=n[1];for(let r=2;r!=n.length;++r)i+=ux(t[r-1]),n[r]=n[r-1]+i;return new Uint32Array(n)}(t);if(n.logicalLevelTechnique1===A.RLE&&n.logicalLevelTechnique2===A.NONE)return function(t,n,i){let r=new Int32Array(i+1);r[0]=0;let o=1,a=r[0];for(let i=0;i<n;i++){let s=t[i],l=t[i+n];for(let t=o;t<o+s;t++)r[t]=l+a,a=r[t];o+=s}return new Uint32Array(r)}(t,n.runs,n.numRleValues);if(n.logicalLevelTechnique1===A.NONE&&n.logicalLevelTechnique2===A.NONE){!function(t){let n=0;for(let i=0;i<t.length;i++)t[i]+=n,n=t[i]}(t);let i=new Uint32Array(n.numValues+1);return i[0]=0,i.set(t,1),i}if(n.logicalLevelTechnique1===A.DELTA&&n.logicalLevelTechnique2===A.RLE){let i=function(t,n,i){let r=new Int32Array(i+1);r[0]=0;let o=1,a=r[0];for(let i=0;i<n;i++){let s=t[i],l=t[i+n];l=ux(l);for(let t=o;t<o+s;t++)r[t]=l+a,a=r[t];o+=s}return new Uint32Array(r)}(t,n.runs,n.numRleValues);return uS(i),i}throw Error("Only delta encoding is supported for transforming length to offset streams yet.")}(uD(t,n,i),i)}function uD(t,n,i){let r=i.physicalLevelTechnique;if(r===E.FAST_PFOR)return function(){throw Error("FastPFor is not implemented yet.")}();if(r===E.VARINT)return uv(t,n,i.numValues);if(r===E.NONE){let r=n.get();return n.add(i.byteLength),new Int32Array(t.subarray(r,n.get()))}throw Error("Specified physicalLevelTechnique is not supported (yet).")}function uP(t,n,i,r){let o=uD(t,n,i);if(1===o.length){let t=o[0];return r?ux(t):t}return r?function(t){return ux(t[1])}(o):function(t){return t[1]}(o)}function uL(t,n,i){return function(t){if(2==t.length){let n=ux(t[1]);return[n,n]}return[ux(t[2]),ux(t[3])]}(uD(t,n,i))}function uN(t,n,i){return function(t){if(2==t.length){let n=uw(t[1]);return[n,n]}return[uw(t[2]),uw(t[3])]}(ub(t,n,i.numValues))}function uz(t,n,i,r,o){return function(t,n,i,r){switch(n.logicalLevelTechnique1){case A.DELTA:if(n.logicalLevelTechnique2===A.RLE){let i=n;if(!r)return function(t,n,i){let r=new BigInt64Array(i),o=0,a=0n;for(let i=0;i<n;i++){let s=Number(t[i]),l=uw(t[i+n]);for(let t=0;t<s;t++)a+=l,r[o++]=a}return r}(t,i.runs,i.numRleValues);t=uA(t,i.runs,i.numRleValues)}!function(t){t[0]=uw(t[0]);let n=t.length/4*4,i=1;if(n>=4)for(;i<n-4;i+=4){let n=t[i+1],r=t[i+2],o=t[i+3];t[i]=uw(t[i])+t[i-1],t[i+1]=uw(n)+t[i],t[i+2]=uw(r)+t[i+1],t[i+3]=uw(o)+t[i+2]}for(;i!=t.length;++i)t[i]=uw(t[i])+t[i-1]}(t);break;case A.RLE:t=function(t,n,i){return i?function(t,n,i){if(void 0===i){i=0;for(let r=0;r<n;r++)i+=Number(t[r])}let r=new BigInt64Array(i),o=0;for(let i=0;i<n;i++){let a=Number(t[i]),s=t[i+n];s=uw(s),r.fill(s,o,o+a),o+=a}return r}(t,n.runs,n.numRleValues):uA(t,n.runs,n.numRleValues)}(t,n,i);break;case A.NONE:i&&function(t){for(let n=0;n<t.length;n++)t[n]=uw(t[n])}(t);break;default:throw Error(`The specified Logical level technique is not supported: ${n.logicalLevelTechnique1}`)}return r?uM(t,r,0n):t}(ub(t,n,i.numValues),i,r,o)}function uj(t,n,i,r){let o=ub(t,n,i.numValues);if(1===o.length){let t=o[0];return r?uw(t):t}return r?function(t){return uw(t[1])}(o):function(t){return t[1]}(o)}function uB(t,n,i,r){let o,a=t.logicalLevelTechnique1;if(a===A.RLE)return 1===t.runs?M.CONST:M.FLAT;if(a!==A.DELTA||t.logicalLevelTechnique2!==A.RLE)return 1===t.numValues?M.CONST:M.FLAT;let s=n instanceof uF?n.size():n;if(t.numRleValues!==s)return M.FLAT;if(1===t.runs)return M.SEQUENCE;if(2!==t.runs)return 1===t.numValues?M.CONST:M.FLAT;let l=r.get();if(t.physicalLevelTechnique===E.VARINT)o=uv(i,r,4);else{let t=r.get();o=new Int32Array(i.buffer,i.byteOffset+t,4)}return r.set(l),2===o[2]&&2===o[3]?M.SEQUENCE:1===t.numValues?M.CONST:M.FLAT}class u$ extends uc{getValueFromBuffer(t){return this.dataBuffer[t]}}class uU extends uh{constructor(t,n,i,r){super(t,BigInt64Array.of(n),i,r)}getValueFromBuffer(t){return this.dataBuffer[0]+BigInt(t)*this.delta}}class uV{_geometryOffsets;_partOffsets;_ringOffsets;constructor(t,n,i){this._geometryOffsets=t,this._partOffsets=n,this._ringOffsets=i}get geometryOffsets(){return this._geometryOffsets}get partOffsets(){return this._partOffsets}get ringOffsets(){return this._ringOffsets}}function uH(t,n,i){return{x:uq(t,n)-i,y:uq(t>>1,n)-i}}function uq(t,n){let i=0;for(let r=0;r<n;r++)i|=(t&1<<2*r)>>r;return i}!function(t){t[t.POINT=0]="POINT",t[t.LINESTRING=1]="LINESTRING",t[t.POLYGON=2]="POLYGON",t[t.MULTIPOINT=3]="MULTIPOINT",t[t.MULTILINESTRING=4]="MULTILINESTRING",t[t.MULTIPOLYGON=5]="MULTIPOLYGON"}(I||(I={})),function(t){t[t.POINT=0]="POINT",t[t.LINESTRING=1]="LINESTRING",t[t.POLYGON=2]="POLYGON"}(R||(R={})),function(t){t[t.MORTON=0]="MORTON",t[t.VEC_2=1]="VEC_2",t[t.VEC_3=2]="VEC_3"}(D||(D={}));class uW{createPoint(t){return[[t]]}createMultiPoint(t){return t.map(t=>[t])}createLineString(t){return[t]}createMultiLineString(t){return t}createPolygon(t,n){return[t].concat(n)}createMultiPolygon(t){return t.flat()}}function uG(t){let n=Array(t.numGeometries),i=1,r=1,o=1,a=0,s=new uW,l=0,c=0,u=t.mortonSettings,d=t.topologyVector,h=d.geometryOffsets,p=d.partOffsets,f=d.ringOffsets,m=t.vertexOffsets,g=t.containsPolygonGeometry(),v=t.vertexBuffer;for(let d=0;d<t.numGeometries;d++){let b=t.geometryType(d);if(b===I.POINT){if(m&&0!==m.length)if(t.vertexBufferType===D.VEC_2){let t=2*m[c++],i=new w(v[t],v[t+1]);n[a++]=s.createPoint(i)}else{let t=uH(v[m[c++]],u.numBits,u.coordinateShift),i=new w(t.x,t.y);n[a++]=s.createPoint(i)}else{let t=new w(v[l++],v[l++]);n[a++]=s.createPoint(t)}h&&o++,p&&i++,f&&r++}else if(b===I.MULTIPOINT){let t=h[o]-h[o-1];o++;let i=Array(t);if(m&&0!==m.length){for(let n=0;n<t;n++){let t=2*m[c++];i[n]=new w(v[t],v[t+1])}n[a++]=s.createMultiPoint(i)}else{for(let n=0;n<t;n++){let t=v[l++],r=v[l++];i[n]=new w(t,r)}n[a++]=s.createMultiPoint(i)}}else if(b===I.LINESTRING){let d,b=0;g?(b=f[r]-f[r-1],r++):b=p[i]-p[i-1],i++,m&&0!==m.length?(d=t.vertexBufferType===D.VEC_2?uJ(v,m,c,b,!1):uQ(v,m,c,b,!1,u),c+=b):(d=uK(v,l,b,!1),l+=2*b),n[a++]=s.createLineString(d),h&&o++}else if(b===I.POLYGON){let d=p[i]-p[i-1];i++;let g=Array(d-1),b=f[r]-f[r-1];if(r++,m&&0!==m.length){let i=t.vertexBufferType===D.VEC_2?uZ(v,m,c,b):uX(v,m,c,b,0,u);c+=b;for(let n=0;n<g.length;n++)b=f[r]-f[r-1],r++,g[n]=t.vertexBufferType===D.VEC_2?uZ(v,m,c,b):uX(v,m,c,b,0,u),c+=b;n[a++]=s.createPolygon(i,g)}else{let t=uY(v,l,b);l+=2*b;for(let t=0;t<g.length;t++)b=f[r]-f[r-1],r++,g[t]=uY(v,l,b),l+=2*b;n[a++]=s.createPolygon(t,g)}h&&o++}else if(b===I.MULTILINESTRING){let d=h[o]-h[o-1];o++;let b=Array(d);if(m&&0!==m.length){for(let n=0;n<d;n++){let o=0;g?(o=f[r]-f[r-1],r++):o=p[i]-p[i-1],i++;let a=t.vertexBufferType===D.VEC_2?uJ(v,m,c,o,!1):uQ(v,m,c,o,!1,u);b[n]=a,c+=o}n[a++]=s.createMultiLineString(b)}else{for(let t=0;t<d;t++){let n=0;g?(n=f[r]-f[r-1],r++):n=p[i]-p[i-1],i++,b[t]=uK(v,l,n,!1),l+=2*n}n[a++]=s.createMultiLineString(b)}}else{if(b!==I.MULTIPOLYGON)throw Error("The specified geometry type is currently not supported.");{let d=h[o]-h[o-1];o++;let g=Array(d),b=0;if(m&&0!==m.length){for(let n=0;n<d;n++){let o=p[i]-p[i-1];i++;let a=Array(o-1);b=f[r]-f[r-1],r++;let l=t.vertexBufferType===D.VEC_2?uZ(v,m,c,b):uX(v,m,c,b,0,u);c+=b;for(let n=0;n<a.length;n++)b=f[r]-f[r-1],r++,a[n]=t.vertexBufferType===D.VEC_2?uZ(v,m,c,b):uX(v,m,c,b,0,u),c+=b;g[n]=s.createPolygon(l,a)}n[a++]=s.createMultiPolygon(g)}else{for(let t=0;t<d;t++){let n=p[i]-p[i-1];i++;let o=Array(n-1);b=f[r]-f[r-1],r++;let a=uY(v,l,b);l+=2*b;for(let t=0;t<o.length;t++){let n=f[r]-f[r-1];r++,o[t]=uY(v,l,n),l+=2*n}g[t]=s.createPolygon(a,o)}n[a++]=s.createMultiPolygon(g)}}}}return n}function uY(t,n,i){return uK(t,n,i,!0)}function uZ(t,n,i,r){return uJ(t,n,i,r,!0)}function uX(t,n,i,r,o,a){return uQ(t,n,i,r,!0,a)}function uK(t,n,i,r){let o=Array(r?i+1:i);for(let r=0;r<2*i;r+=2)o[r/2]=new w(t[n+r],t[n+r+1]);return r&&(o[o.length-1]=o[0]),o}function uJ(t,n,i,r,o){let a=Array(o?r+1:r);for(let o=0;o<2*r;o+=2){let r=2*n[i+o/2];a[o/2]=new w(t[r],t[r+1])}return o&&(a[a.length-1]=a[0]),a}function uQ(t,n,i,r,o,a){let s=Array(o?r+1:r);for(let o=0;o<r;o++){let r=uH(t[n[i+o]],a.numBits,a.coordinateShift);s[o]=new w(r.x,r.y)}return o&&(s[s.length-1]=s[0]),s}class u0{_vertexBufferType;_topologyVector;_vertexOffsets;_vertexBuffer;_mortonSettings;constructor(t,n,i,r,o){this._vertexBufferType=t,this._topologyVector=n,this._vertexOffsets=i,this._vertexBuffer=r,this._mortonSettings=o}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}*[Symbol.iterator](){let t=uG(this),n=0;for(;n<this.numGeometries;)yield{coordinates:t[n],type:this.geometryType(n)},n++}getSimpleEncodedVertex(t){let n=this.vertexOffsets?2*this.vertexOffsets[t]:2*t;return[this.vertexBuffer[n],this.vertexBuffer[n+1]]}getVertex(t){if(this.vertexOffsets&&this.mortonSettings){let n=uH(this.vertexBuffer[this.vertexOffsets[t]],this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[n.x,n.y]}let n=this.vertexOffsets?2*this.vertexOffsets[t]:2*t;return[this.vertexBuffer[n],this.vertexBuffer[n+1]]}getGeometries(){return uG(this)}get mortonSettings(){return this._mortonSettings}}class u1 extends u0{_numGeometries;_geometryType;constructor(t,n,i,r,o,a,s){super(i,r,o,a,s),this._numGeometries=t,this._geometryType=n}geometryType(t){return this._geometryType}get numGeometries(){return this._numGeometries}containsPolygonGeometry(){return this._geometryType===I.POLYGON||this._geometryType===I.MULTIPOLYGON}containsSingleGeometryType(){return!0}}class u2 extends u0{_geometryTypes;constructor(t,n,i,r,o,a){super(t,i,r,o,a),this._geometryTypes=n}geometryType(t){return this._geometryTypes[t]}get numGeometries(){return this._geometryTypes.length}containsPolygonGeometry(){for(let t=0;t<this.numGeometries;t++)if(this.geometryType(t)===I.POLYGON||this.geometryType(t)===I.MULTIPOLYGON)return!0;return!1}containsSingleGeometryType(){return!1}}class u5{_triangleOffsets;_indexBuffer;_vertexBuffer;_topologyVector;constructor(t,n,i,r){this._triangleOffsets=t,this._indexBuffer=n,this._vertexBuffer=i,this._topologyVector=r}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 t=Array(this.numGeometries),n=this._topologyVector,i=n.partOffsets,r=n.ringOffsets,o=n.geometryOffsets,a=0,s=1,l=1,c=1;for(let n=0;n<this.numGeometries;n++)switch(this.geometryType(n)){case I.POLYGON:{let u=i[s]-i[s-1];s++;let d=[];for(let t=0;t<u;t++){let t=r[l]-r[l-1];l++;let n=[];for(let i=0;i<t;i++){let t=this._vertexBuffer[a++],i=this._vertexBuffer[a++];n.push(new w(t,i))}n.length>0&&n.push(n[0]),d.push(n)}t[n]=d,o&&c++}break;case I.MULTIPOLYGON:{let u=o[c]-o[c-1];c++;let d=[];for(let t=0;t<u;t++){let t=i[s]-i[s-1];s++;for(let n=0;n<t;n++){let t=r[l]-r[l-1];l++;let n=[];for(let i=0;i<t;i++){let t=this._vertexBuffer[a++],i=this._vertexBuffer[a++];n.push(new w(t,i))}n.length>0&&n.push(n[0]),d.push(n)}}t[n]=d}}return t}[Symbol.iterator](){return null}}function u3(t,n,i,r,o,a){return new u4(t,n,i,r,o,a)}class u4 extends u5{_numGeometries;_geometryType;constructor(t,n,i,r,o,a){super(i,r,o,a),this._numGeometries=t,this._geometryType=n}geometryType(t){return this._geometryType}get numGeometries(){return this._numGeometries}containsSingleGeometryType(){return!0}}function u6(t,n,i,r,o){return new u8(t,n,i,r,o)}class u8 extends u5{_geometryTypes;constructor(t,n,i,r,o){super(n,i,r,o),this._geometryTypes=t}geometryType(t){return this._geometryTypes[t]}get numGeometries(){return this._geometryTypes.length}containsSingleGeometryType(){return!1}}function u7(t,n,i,r,o){let a=uO(t,i),s=null,l=null,c=null,u=null;if(uB(a,r,t,i)===M.CONST){let o=uP(t,i,a,!1),d=null,h=null,p=null,f=null;for(let r=0;r<n-1;r++){let n=uO(t,i);switch(n.physicalStreamType){case S.LENGTH:switch(n.logicalStreamType.lengthType){case F.GEOMETRIES:d=uR(t,i,n);break;case F.PARTS:h=uR(t,i,n);break;case F.RINGS:p=uR(t,i,n);break;case F.TRIANGLES:f=uR(t,i,n)}break;case S.OFFSET:switch(n.logicalStreamType.offsetType){case O.VERTEX:s=uI(t,i,n,!1);break;case O.INDEX:u=uI(t,i,n,!1)}break;case S.DATA:T.VERTEX===n.logicalStreamType.dictionaryType?l=uI(t,i,n,!0):(c={numBits:n.numBits,coordinateShift:n.coordinateShift},l=uI(t,i,n,!1))}}return null!==u?null!=d||null!=h?u3(r,o,f,u,l,new uV(d,h,p)):u3(r,o,f,u,l):null===c?function(t,n,i,r,o){return new u1(t,n,D.VEC_2,i,r,o)}(r,o,new uV(d,h,p),s,l):function(t,n,i,r,o,a){return new u1(t,n,D.MORTON,i,r,o,a)}(r,o,new uV(d,h,p),s,l,c)}let d=uI(t,i,a,!1),h=null,p=null,f=null,m=null;for(let r=0;r<n-1;r++){let n=uO(t,i);switch(n.physicalStreamType){case S.LENGTH:switch(n.logicalStreamType.lengthType){case F.GEOMETRIES:h=uI(t,i,n,!1);break;case F.PARTS:p=uI(t,i,n,!1);break;case F.RINGS:f=uI(t,i,n,!1);break;case F.TRIANGLES:m=uR(t,i,n)}break;case S.OFFSET:switch(n.logicalStreamType.offsetType){case O.VERTEX:s=uI(t,i,n,!1);break;case O.INDEX:u=uI(t,i,n,!1)}break;case S.DATA:T.VERTEX===n.logicalStreamType.dictionaryType?l=uI(t,i,n,!0):(c={numBits:n.numBits,coordinateShift:n.coordinateShift},l=uI(t,i,n,!1))}}let g=null,v=null,b=null;return null!==h?(g=u9(d,h,2),null!==p&&null!==f?(v=de(d,g,p,!1),b=function(t,n,i,r){let o=new Uint32Array(i[i.length-1]+1),a=0;o[0]=a;let s=1,l=1,c=0;for(let u=0;u<t.length;u++){let d=t[u],h=n[u+1]-n[u];if(0!==d&&3!==d)for(let t=0;t<h;t++){let t=i[s]-i[s-1];s++;for(let n=0;n<t;n++)a=o[l++]=a+r[c++]}else for(let t=0;t<h;t++)o[l++]=++a,s++}return o}(d,g,v,f)):null!==p&&(v=function(t,n,i){let r=new Uint32Array(n[n.length-1]+1),o=0;r[0]=o;let a=1,s=0;for(let l=0;l<t.length;l++){let c=t[l],u=n[l+1]-n[l];if(4===c||1===c)for(let t=0;t<u;t++)o=r[a++]=o+i[s++];else for(let t=0;t<u;t++)r[a++]=++o}return r}(d,g,p))):null!==p&&null!==f?(v=u9(d,p,1),b=de(d,v,f,!0)):null!==p&&(v=u9(d,p,0)),null!==u&&null===v?u6(d,m,u,l):null!==u?u6(d,m,u,l,new uV(g,v,b)):null===c?function(t,n,i,r){return new u2(D.VEC_2,t,n,i,r)}(d,new uV(g,v,b),s,l):function(t,n,i,r,o){return new u2(D.MORTON,t,n,i,r,o)}(d,new uV(g,v,b),s,l,c)}function u9(t,n,i){let r=new Uint32Array(t.length+1),o=0;r[0]=o;let a=0;for(let s=0;s<t.length;s++)o=r[s+1]=o+(t[s]>i?n[a++]:1);return r}function de(t,n,i,r){let o=new Uint32Array(n[n.length-1]+1),a=0;o[0]=a;let s=1,l=0;for(let c=0;c<t.length;c++){let u=t[c],d=n[c+1]-n[c];if(5===u||2===u||r&&(4===u||1===u))for(let t=0;t<d;t++)a=o[s++]=a+i[l++];else for(let t=0;t<d;t++)o[s++]=++a}return o}class dt extends ul{dataVector;constructor(t,n,i){super(t,n.getBuffer(),i),this.dataVector=n}getValueFromBuffer(t){return this.dataVector.get(t)}}class dn extends uc{getValueFromBuffer(t){return this.dataBuffer[t]}}class di extends ul{constructor(t,n,i){super(t,BigInt64Array.of(n),i)}getValueFromBuffer(t){return this.dataBuffer[0]}}function dr(t,n,i,r,o){let a=function(t,n,i,r){let o=new Uint8Array(n),a=0,s=r.get()+i;for(;a<n&&!(r.get()>=s);){let i=t[r.increment()];if(i<=127){let s=i+3,l=t[r.increment()],c=Math.min(a+s,n);o.fill(l,a,c),a=c}else{let s=256-i;for(let i=0;i<s&&a<n;i++)o[a++]=t[r.increment()]}}return r.set(s),o}(t,Math.ceil(n/8),i,r);return o?function(t,n,i){if(!i)return t;let r=i.size(),o=new uF(t,n),a=new uF(new Uint8Array(Math.ceil(r/8)),r),s=0;for(let t=0;t<r;t++){let n=!!i.get(t)&&o.get(s++);a.set(t,n)}return a.getBuffer()}(a,n,o):a}let da=new TextDecoder;function ds(t,n,i){return i-n>=12?da.decode(t.subarray(n,i)):function(t,n,i){let r="",o=n;for(;o<i;){let n=t[o],a,s,l,c=null,u=n>239?4:n>223?3:n>191?2:1;if(o+u>i)break;1===u?n<128&&(c=n):2===u?128==(192&(a=t[o+1]))&&(c=(31&n)<<6|63&a)<=127&&(c=null):3===u?(a=t[o+1],s=t[o+2],128==(192&a)&&128==(192&s)&&((c=(15&n)<<12|(63&a)<<6|63&s)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(a=t[o+1],s=t[o+2],l=t[o+3],128==(192&a)&&128==(192&s)&&128==(192&l)&&((c=(15&n)<<18|(63&a)<<12|(63&s)<<6|63&l)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,r+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),r+=String.fromCharCode(c),o+=u}return r}(t,n,i)}class dl extends ul{offsetBuffer;constructor(t,n,i,r){super(t,i,r),this.offsetBuffer=n}}class dc extends dl{textEncoder;constructor(t,n,i,r){super(t,n,i,r??n.length-1),this.textEncoder=new TextEncoder}getValueFromBuffer(t){return ds(this.dataBuffer,this.offsetBuffer[t],this.offsetBuffer[t+1])}}class du extends dl{indexBuffer;textEncoder;constructor(t,n,i,r,o){super(t,i,r,o??n.length),this.indexBuffer=n,this.indexBuffer=n,this.textEncoder=new TextEncoder}getValueFromBuffer(t){let n=this.indexBuffer[t];return ds(this.dataBuffer,this.offsetBuffer[n],this.offsetBuffer[n+1])}}class dd extends dl{indexBuffer;symbolOffsetBuffer;symbolTableBuffer;textEncoder;symbolLengthBuffer;lengthBuffer;decodedDictionary;constructor(t,n,i,r,o,a,s){super(t,i,r,s),this.indexBuffer=n,this.symbolOffsetBuffer=o,this.symbolTableBuffer=a,this.textEncoder=new TextEncoder}getValueFromBuffer(t){null==this.decodedDictionary&&(null==this.symbolLengthBuffer&&(this.symbolLengthBuffer=this.offsetToLengthBuffer(this.symbolOffsetBuffer),this.lengthBuffer=this.offsetToLengthBuffer(this.offsetBuffer)),this.decodedDictionary=function(t,n,i){let r=[],o=Array(n.length).fill(0);for(let t=1;t<n.length;t++)o[t]=o[t-1]+n[t-1];for(let a=0;a<i.length;a++)if(255===i[a])r.push(i[++a]);else{let s=n[i[a]],l=o[i[a]];for(let n=0;n<s;n++)r.push(t[l+n])}return new Uint8Array(r)}(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer));let n=this.indexBuffer[t];return ds(this.decodedDictionary,this.offsetBuffer[n],this.offsetBuffer[n+1])}offsetToLengthBuffer(t){let n=new Uint32Array(t.length-1),i=t[0];for(let r=1;r<t.length;r++){let o=t[r];n[r-1]=o-i,i=o}return n}}function dh(t,n,i,r,o,a){return"scalarType"===i.type?function(t,n,i,r,o,a){let s=null,l=0;if(0===t)return null;if(a.nullable){let t=uO(n,i);l=t.numValues;let r=i.get(),o=dr(n,l,t.byteLength,i);i.set(r+t.byteLength),s=new uF(o,t.numValues)}let c=s??r;switch(o.physicalType){case 4:case 3:return function(t,n,i,r,o){let a=uO(t,n),s=uB(a,o,t,n),l=3===r.physicalType;if(s===M.FLAT){let r=uI(t,n,a,l,0,dp(o)?o:void 0);return new uu(i.name,r,o)}if(s===M.SEQUENCE){let r=uL(t,n,a);return new up(i.name,r[0],r[1],a.numRleValues)}{let r=uP(t,n,a,l);return new uf(i.name,r,o)}}(n,i,a,o,c);case 9:return function(t,n,i,r,o){let a=null,s=null,l=null,c=null,u=null,d=null,h=null,p=null;for(let t=0;t<r;t++){let t=uO(n,i);if(0!==t.byteLength)switch(t.physicalStreamType){case S.PRESENT:d=new uF(dr(n,t.numValues,t.byteLength,i),t.numValues);break;case S.OFFSET:s=uI(n,i,t,!1,0,null!=o||null!=d?o??d:void 0);break;case S.LENGTH:{let r=uR(n,i,t);F.DICTIONARY===t.logicalStreamType.lengthType?a=r:F.SYMBOL===t.logicalStreamType.lengthType?c=r:h=r;break}case S.DATA:{let r=n.subarray(i.get(),i.get()+t.byteLength);i.add(t.byteLength);let o=t.logicalStreamType.dictionaryType;T.FSST===o?u=r:T.SINGLE===o||T.SHARED===o?l=r:T.NONE===o&&(p=r)}}}return function(t,n,i,r,o,a,s){return n?new dd(t,i,r,o,a,n,s):null}(t,u,s,a,l,c,o??d)??function(t,n,i,r,o){return n?o?new du(t,i,r,n,o):new du(t,i,r,n):null}(t,l,s,a,o??d)??function(t,n,i,r,o){if(!n||!i)return null;if(r)return o?new du(t,r,n,i,o):new du(t,r,n,i);if(o&&o.size()!==n.length-1){let r=new Int32Array(o.size()),a=0;for(let t=0;t<o.size();t++)r[t]=o.get(t)?a++:0;return new du(t,r,n,i,o)}return o?new dc(t,n,i,o):new dc(t,n,i)}(t,h,p,s,o??d)}(a.name,n,i,a.nullable?t-1:t,s);case 0:return function(t,n,i,r){let o=uO(t,n),a=o.numValues,s=n.get(),l=dp(r)?r:void 0,c=dr(t,a,o.byteLength,n,l);n.set(s+o.byteLength);let u=new uF(c,a);return new dt(i.name,u,r)}(n,i,a,c);case 6:case 5:return function(t,n,i,r,o){let a=uO(t,n),s=uB(a,r,t,n),l=5===o.physicalType;if(s===M.FLAT){let o=uz(t,n,a,l,dp(r)?r:void 0);return new u$(i.name,o,r)}if(s===M.SEQUENCE){let r=uN(t,n,a);return new uU(i.name,r[0],r[1],a.numRleValues)}{let o=uj(t,n,a,l);return new di(i.name,o,r)}}(n,i,a,c,o);case 7:return function(t,n,i,r){let o=uO(t,n),a=dp(r)?r:void 0,s=function(t,n,i,r){let o=n.get(),a=o+i*Float32Array.BYTES_PER_ELEMENT,s=new Float32Array(new Uint8Array(t.subarray(o,a)).buffer);return n.set(a),r?uM(s,r,0):s}(t,n,o.numValues,a);return new dn(i.name,s,r)}(n,i,a,c);case 8:return function(t,n,i,r){let o=uO(t,n),a=dp(r)?r:void 0,s=function(t,n,i,r){let o=n.get(),a=o+i*Float64Array.BYTES_PER_ELEMENT,s=new Float64Array(new Uint8Array(t.subarray(o,a)).buffer);return n.set(a),r?uM(s,r,0):s}(t,n,o.numValues,a);return new ud(i.name,s,r)}(n,i,a,c);default:throw Error(`The specified data type for the field is currently not supported: ${o}`)}}(r,t,n,o,i.scalarType,i):0===r?null:function(t,n,i,r){let o=null,a=null,s=null,l=null,c=!1;for(;!c;){let i=uO(t,n);switch(i.physicalStreamType){case S.LENGTH:F.DICTIONARY===i.logicalStreamType.lengthType?o=uR(t,n,i):s=uR(t,n,i);break;case S.DATA:T.SINGLE===i.logicalStreamType.dictionaryType||T.SHARED===i.logicalStreamType.dictionaryType?(a=t.subarray(n.get(),n.get()+i.byteLength),c=!0):l=t.subarray(n.get(),n.get()+i.byteLength),n.add(i.byteLength)}}let u=i.complexType.children,d=[],h=0;for(let c of u){let u=uv(t,n,1)[0];if(0==u)continue;let p=c.name?`${i.name}${c.name}`:i.name;if(2!==u||"scalarField"!==c.type||9!==c.scalarField.physicalType)throw Error("Currently only optional string fields are implemented for a struct.");let f=uO(t,n),m=dr(t,f.numValues,f.byteLength,n),g=uO(t,n),v=uI(t,n,g,!1,0,g.decompressedCount!==r?new uF(m,f.numValues):void 0);d[h++]=l?new dd(p,v,o,a,s,l,new uF(m,f.numValues)):new du(p,v,o,a,new uF(m,f.numValues))}return d}(t,n,i,o)}function dp(t){return t instanceof uF}function df(t){switch(t){case 0:case 1:case 2:case 3:{let n={};n.nullable=!!(1&t),n.columnScope=0;let i={};return i.physicalType=t>1?6:4,i.type="physicalType",n.scalarType=i,n.type="scalarType",n}case 4:{let t={nullable:!1,columnScope:0},n={type:"physicalType",physicalType:0};return t.type="complexType",t.complexType=n,t}case 30:{let t={nullable:!1,columnScope:0},n={type:"physicalType",physicalType:1};return t.type="complexType",t.complexType=n,t}default:return function(t){let n=null;switch(t){case 10:case 11:n=0;break;case 12:case 13:n=1;break;case 14:case 15:n=2;break;case 16:case 17:n=3;break;case 18:case 19:n=4;break;case 20:case 21:n=5;break;case 22:case 23:n=6;break;case 24:case 25:n=7;break;case 26:case 27:n=8;break;case 28:case 29:n=9;break;default:return null}let i={};i.nullable=!!(1&t),i.columnScope=0;let r={type:"physicalType"};return r.physicalType=n,i.type="scalarType",i.scalarType=r,i}(t)}}function dm(t){return t>=10}function dg(t){return 30===t}function dv(t){if("id"===t.name)return!1;if("scalarType"===t.type){let n=t.scalarType;if("physicalType"===n.type)switch(n.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"===n.type)return!1}else if("complexType"===t.type){let n=t.complexType;if("physicalType"===n.type)switch(n.physicalType){case 0:case 1:return!0;default:return!1}}return console.warn("Unexpected column type in hasStreamCount",t),!1}let db=new TextDecoder;function dy(t,n){let i=uv(t,n,1)[0];if(0===i)return"";let r=n.get(),o=t.subarray(r,r+i);return n.add(i),db.decode(o)}function d_(t,n){let i=uv(t,n,1)[0]>>>0;if(i<10||i>30)throw Error(`Unsupported field type code ${i}. Supported: 10-29(scalars), 30(STRUCT)`);let r=df(i);if(dm(i)&&(r.name=dy(t,n)),dg(i)){let i=uv(t,n,1)[0]>>>0;r.complexType.children=Array(i);for(let o=0;o<i;o++)r.complexType.children[o]=d_(t,n)}return function(t){return{name:t.name,nullable:t.nullable,scalarField:t.scalarType,complexField:t.complexType,type:"scalarType"===t.type?"scalarField":"complexField"}}(r)}function dx(t,n){let i=uv(t,n,1)[0]>>>0,r=df(i);if(!r)throw Error(`Unsupported column type code ${i}. Supported: 0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT)`);if(dm(i)?r.name=dy(t,n):i>=0&&i<=3?r.name="id":4===i&&(r.name="geometry"),dg(i)){let i=uv(t,n,1)[0]>>>0,o=r.complexType;o.children=Array(i);for(let r=0;r<i;r++)o.children[r]=d_(t,n)}return r}function dw(t,n){let i={featureTables:[]},r={};r.name=dy(t,n);let o=uv(t,n,1)[0]>>>0,a=uv(t,n,1)[0]>>>0;r.columns=Array(a);for(let i=0;i<a;i++)r.columns[i]=dx(t,n);return i.featureTables.push(r),[i,o]}function dk(t,n,i,r,o,a,s=!1){let l=n.scalarType.physicalType,c=uB(o,a,t,i);if(4===l)switch(c){case M.FLAT:return new uu(r,uI(t,i,o,!1),a);case M.SEQUENCE:{let n=uL(t,i,o);return new up(r,n[0],n[1],o.numRleValues)}case M.CONST:return new uf(r,uP(t,i,o,!1),a)}else switch(c){case M.FLAT:if(s)return new ud(r,function(t,n,i){return function(t,n){switch(n.logicalLevelTechnique1){case A.DELTA:return n.logicalLevelTechnique2===A.RLE&&(t=uE(t,n.runs,n.numRleValues)),function(t){t[0]=uk(t[0]);let n=t.length/4*4,i=1;if(n>=4)for(;i<n-4;i+=4){let n=t[i+1],r=t[i+2],o=t[i+3];t[i]=uk(t[i])+t[i-1],t[i+1]=uk(n)+t[i],t[i+2]=uk(r)+t[i+1],t[i+3]=uk(o)+t[i+2]}for(;i!=t.length;++i)t[i]=uk(t[i])+t[i-1]}(t),t;case A.RLE:return function(t,n){return uE(t,n.runs,n.numRleValues)}(t,n);case A.NONE:return t;default:throw Error(`The specified Logical level technique is not supported: ${n.logicalLevelTechnique1}`)}}(function(t,n,i){let r=new Float64Array(i);for(let o=0;o<i;o++)r[o]=u_(t,n);return r}(t,n,i.numValues),i)}(t,i,o),a);return new u$(r,uz(t,i,o,!1),a);case M.SEQUENCE:{let n=uN(t,i,o);return new uU(r,n[0],n[1],o.numRleValues)}case M.CONST:return new di(r,uj(t,i,o,!1),a)}throw Error("Vector type not supported for id column.")}class dC{constructor(t,n){var i;switch(this._featureData=t,this.properties=this._featureData.properties||{},null==(i=this._featureData.geometry)?void 0:i.type){case I.POINT:case I.MULTIPOINT:this.type=1;break;case I.LINESTRING:case I.MULTILINESTRING:this.type=2;break;case I.POLYGON:case I.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=n,this.id=Number(this._featureData.id)}loadGeometry(){let t=[];for(let n of this._featureData.geometry.coordinates){let i=[];for(let t of n)i.push(new w(t.x,t.y));t.push(i)}return t}}class dA{constructor(t){this.features=[],this.featureTable=t,this.name=t.name,this.extent=t.extent,this.version=2,this.features=t.getFeatures(),this.length=this.features.length}feature(t){return new dC(this.features[t],this.extent)}}class dE{constructor(t){this.layers={};const n=function(t,n=!0){let i=new ug(0),r=[];for(;i.get()<t.length;){let o=uv(t,i,1)[0]>>>0,a=i.get()+o;if(a>t.length)throw Error(`Block overruns tile: ${a} > ${t.length}`);if(1!=uv(t,i,1)[0]>>>0){i.set(a);continue}let s=dw(t,i),l=s[1],c=s[0].featureTables[0],u=null,d=null,h=[],p=0;for(let r of c.columns){let o=r.name;if("id"===o){let a=null;if(r.nullable){let n=uO(t,i),r=i.get(),o=dr(t,n.numValues,n.byteLength,i);i.set(r+n.byteLength),a=new uF(o,n.numValues)}let s=uO(t,i);p=s.decompressedCount,u=dk(t,r,i,o,s,a??p,n)}else if("geometry"===o){let n=uv(t,i,1)[0];if(0===p){let n=i.get();p=uO(t,i).decompressedCount,i.set(n)}d=u7(t,n,i,p)}else{let n=dv(r)?uv(t,i,1)[0]:1;if(0===n)continue;let o=dh(t,i,r,n,p);if(o)if(Array.isArray(o))for(let t of o)h.push(t);else h.push(o)}}let f=new um(c.name,d,u,h,l);r.push(f),i.set(a)}return r}(new Uint8Array(t));this.layers=n.reduce((t,n)=>Object.assign(Object.assign({},t),{[n.name]:new dA(n)}),{})}}class dS{constructor(t,n){this.feature=t,this.type=t.type,this.properties=t.tags?t.tags:{},this.extent=n,"id"in t&&("string"==typeof t.id?this.id=parseInt(t.id,10):"number"!=typeof t.id||isNaN(t.id)||(this.id=t.id))}loadGeometry(){let t=[];for(let n of 1===this.feature.type?[this.feature.geometry]:this.feature.geometry){let i=[];for(let t of n)i.push(new w(t[0],t[1]));t.push(i)}return t}}let dT="_geojsonTileLayer";function dO(t,n){n.writeVarintField(15,t.version||1),n.writeStringField(1,t.name||""),n.writeVarintField(5,t.extent||4096);let i={keys:[],values:[],keycache:{},valuecache:{}};for(let r=0;r<t.length;r++)i.feature=t.feature(r),n.writeMessage(2,dF,i);for(let t of i.keys)n.writeStringField(3,t);for(let t of i.values)n.writeMessage(4,dP,t)}function dF(t,n){if(!t.feature)return;let i=t.feature;void 0!==i.id&&n.writeVarintField(1,i.id),n.writeMessage(2,dM,t),n.writeVarintField(3,i.type),n.writeMessage(4,dD,i)}function dM(t,n){for(let i in t.feature?.properties){let r=t.feature.properties[i],o=t.keycache[i];if(null==r)continue;void 0===o&&(t.keys.push(i),o=t.keys.length-1,t.keycache[i]=o),n.writeVarint(o),"string"!=typeof r&&"boolean"!=typeof r&&"number"!=typeof r&&(r=JSON.stringify(r));let a=typeof r+":"+r,s=t.valuecache[a];void 0===s&&(t.values.push(r),s=t.values.length-1,t.valuecache[a]=s),n.writeVarint(s)}}function dI(t,n){return(n<<3)+(7&t)}function dR(t){return t<<1^t>>31}function dD(t,n){let i=t.loadGeometry(),r=t.type,o=0,a=0;for(let s of i){let i=1;1===r&&(i=s.length),n.writeVarint(dI(1,i));let l=3===r?s.length-1:s.length;for(let t=0;t<l;t++){1===t&&1!==r&&n.writeVarint(dI(2,l-1));let i=s[t].x-o,c=s[t].y-a;n.writeVarint(dR(i)),n.writeVarint(dR(c)),o+=i,a+=c}3===t.type&&n.writeVarint(dI(7,1))}}function dP(t,n){let i=typeof t;"string"===i?n.writeStringField(1,t):"boolean"===i?n.writeBooleanField(7,t):"number"===i&&(t%1!=0?n.writeDoubleField(3,t):t<0?n.writeSVarintField(6,t):n.writeVarintField(5,t))}class dL{constructor(t,n){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new rK(ea,16,0),this.grid3D=new rK(ea,16,0),this.featureIndexArray=new aa,this.promoteId=n}insert(t,n,i,r,o,a){let s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(i,r,o);let l=a?this.grid3D:this.grid;for(let t=0;t<n.length;t++){let i=n[t],r=[1/0,1/0,-1/0,-1/0];for(let t=0;t<i.length;t++){let n=i[t];r[0]=Math.min(r[0],n.x),r[1]=Math.min(r[1],n.y),r[2]=Math.max(r[2],n.x),r[3]=Math.max(r[3],n.y)}r[0]<ea&&r[1]<ea&&r[2]>=0&&r[3]>=0&&l.insert(s,r[0],r[1],r[2],r[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers="mlt"!==this.encoding?new lE(new cn(this.rawTileData)).layers:new dE(this.rawTileData).layers,this.sourceLayerCoder=new ua(this.vtLayers?Object.keys(this.vtLayers).sort():[dT])),this.vtLayers}query(t,n,i,r){let o;this.loadVTLayers();let a=t.params,s=ea/t.tileSize/t.scale,l=re(a.filter,a.globalState),c=t.queryGeometry,u=t.queryPadding*s,d=uo.fromPoints(c),h=this.grid.query(d.minX-u,d.minY-u,d.maxX+u,d.maxY+u),p=uo.fromPoints(t.cameraQueryGeometry).expandBy(u);for(let n of this.grid3D.query(p.minX,p.minY,p.maxX,p.maxY,(n,i,r,o)=>(function(t,n,i,r,o){for(let a of t)if(n<=a.x&&i<=a.y&&r>=a.x&&o>=a.y)return!0;let a=[new w(n,i),new w(n,o),new w(r,o),new w(r,i)];if(t.length>2){for(let n of a)if(ss(t,n))return!0}for(let n=0;n<t.length-1;n++)if(sl(t[n],t[n+1],a))return!0;return!1})(t.cameraQueryGeometry,n-u,i-u,r+u,o+u)))h.push(n);h.sort(dz);let f={};for(let u=0;u<h.length;u++){let d=h[u];if(d===o)continue;o=d;let p=this.featureIndexArray.get(d),m=null;this.loadMatchingFeature(f,p.bucketIndex,p.sourceLayerIndex,p.featureIndex,l,a.layers,a.availableImages,n,i,r,(n,i,r)=>(m||(m=a5(n)),i.queryIntersectsFeature({queryGeometry:c,feature:n,featureState:r,geometry:m,zoom:this.z,transform:t.transform,pixelsToTileUnits:s,pixelPosMatrix:t.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:t.getElevation})))}return f}loadMatchingFeature(t,n,i,r,o,a,s,l,c,u,d){let h=this.bucketLayerIDs[n];if(a&&!h.some(t=>a.has(t)))return;let p=this.sourceLayerCoder.decode(i),f=this.vtLayers[p].feature(r);if(o.needGeometry){let t=a3(f,!0);if(!o.filter(new ou(this.tileID.overscaledZ),t,this.tileID.canonical))return}else if(!o.filter(new ou(this.tileID.overscaledZ),f))return;let m=this.getId(f,p);for(let n=0;n<h.length;n++){let i=h[n];if(a&&!a.has(i))continue;let o=l[i];if(!o)continue;let p={};m&&u&&(p=u.getState(o.sourceLayer||dT,m));let g=em({},c[i]);g.paint=dN(g.paint,o.paint,f,p,s),g.layout=dN(g.layout,o.layout,f,p,s);let v=!d||d(f,o,p);if(!v)continue;let b=new us(f,this.z,this.x,this.y,m);b.layer=g;let y=t[i];void 0===y&&(y=t[i]=[]),y.push({featureIndex:r,feature:b,intersectionZ:v})}}lookupSymbolFeatures(t,n,i,r,o,a,s,l){let c={};this.loadVTLayers();let u=re(o.filterSpec,o.globalState);for(let o of t)this.loadMatchingFeature(c,i,r,o,u,a,s,l,n);return c}hasLayer(t){for(let n of this.bucketLayerIDs)for(let i of n)if(t===i)return!0;return!1}getId(t,n){var i;let r=t.id;return this.promoteId&&("boolean"==typeof(r=t.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[n]])&&(r=Number(r)),void 0===r&&(null==(i=t.properties)?void 0:i.cluster)&&this.promoteId&&(r=Number(t.properties.cluster_id))),r}}function dN(t,n,i,r,o){return ev(t,(t,a)=>{let s=n instanceof o_?n.get(a):null;return s&&s.evaluate?s.evaluate(i,r,o):s})}function dz(t,n){return n-t}function dj(t,n,i,r,o){let a=[];for(let s=0;s<t.length;s++){let l,c=t[s];for(let t=0;t<c.length-1;t++){let s=c[t],u=c[t+1];s.x<n&&u.x<n||(s.x<n?s=new w(n,s.y+(n-s.x)/(u.x-s.x)*(u.y-s.y))._round():u.x<n&&(u=new w(n,s.y+(n-s.x)/(u.x-s.x)*(u.y-s.y))._round()),s.y<i&&u.y<i||(s.y<i?s=new w(s.x+(i-s.y)/(u.y-s.y)*(u.x-s.x),i)._round():u.y<i&&(u=new w(s.x+(i-s.y)/(u.y-s.y)*(u.x-s.x),i)._round()),s.x>=r&&u.x>=r||(s.x>=r?s=new w(r,s.y+(r-s.x)/(u.x-s.x)*(u.y-s.y))._round():u.x>=r&&(u=new w(r,s.y+(r-s.x)/(u.x-s.x)*(u.y-s.y))._round()),s.y>=o&&u.y>=o||(s.y>=o?s=new w(s.x+(o-s.y)/(u.y-s.y)*(u.x-s.x),o)._round():u.y>=o&&(u=new w(s.x+(o-s.y)/(u.y-s.y)*(u.x-s.x),o)._round()),l&&s.equals(l[l.length-1])||(l=[s],a.push(l)),l.push(u)))))}}return a}function dB(t,n,i,r,o){switch(n){case 1:return function(t,n,i,r){let o=[];for(let a of t)for(let t of a){let a=0===r?t.x:t.y;a>=n&&a<=i&&o.push([t])}return o}(t,i,r,o);case 2:return dU(t,i,r,o,!1);case 3:return dU(t,i,r,o,!0)}return[]}function d$(t,n,i,r,o){let a=0===r?dV:dH,s=[],l=[];for(let c=0;c<t.length-1;c++){let u=t[c],d=t[c+1],h=0===r?u.x:u.y,p=0===r?d.x:d.y,f=!1;h<n?p>n&&s.push(a(u,d,n)):h>i?p<i&&s.push(a(u,d,i)):s.push(u),p<n&&h>=n&&(s.push(a(u,d,n)),f=!0),p>i&&h<=i&&(s.push(a(u,d,i)),f=!0),!o&&f&&(l.push(s),s=[])}let c=t.length-1,u=0===r?t[c].x:t[c].y;return u>=n&&u<=i&&s.push(t[c]),o&&s.length>0&&!s[0].equals(s[s.length-1])&&s.push(new w(s[0].x,s[0].y)),s.length>0&&l.push(s),l}function dU(t,n,i,r,o){let a=[];for(let s of t){let t=d$(s,n,i,r,o);t.length>0&&a.push(...t)}return a}function dV(t,n,i){return new w(i,t.y+(i-t.x)/(n.x-t.x)*(n.y-t.y))}function dH(t,n,i){return new w(t.x+(i-t.y)/(n.y-t.y)*(n.x-t.x),i)}rQ("FeatureIndex",dL,{omit:["rawTileData","sourceLayerCoder"]});class dq extends w{constructor(t,n,i,r){super(t,n),this.angle=i,void 0!==r&&(this.segment=r)}clone(){return new dq(this.x,this.y,this.angle,this.segment)}}function dW(t,n,i,r,o){if(void 0===n.segment||0===i)return!0;let a=n,s=n.segment+1,l=0;for(;l>-i/2;){if(--s<0)return!1;l-=t[s].dist(a),a=t[s]}l+=t[s].dist(t[s+1]),s++;let c=[],u=0;for(;l<i/2;){let n=t[s],i=t[s+1];if(!i)return!1;let a=t[s-1].angleTo(n)-n.angleTo(i);for(a=Math.abs((a+3*Math.PI)%(2*Math.PI)-Math.PI),c.push({distance:l,angleDelta:a}),u+=a;l-c[0].distance>r;)u-=c.shift().angleDelta;if(u>o)return!1;s++,l+=n.dist(i)}return!0}function dG(t){let n=0;for(let i=0;i<t.length-1;i++)n+=t[i].dist(t[i+1]);return n}function dY(t,n,i){return t?.6*n*i:0}function dZ(t,n){return Math.max(t?t.right-t.left:0,n?n.right-n.left:0)}function dX(t,n,i,r,o,a){let s=dY(i,o,a),l=dZ(i,r)*a,c=0,u=dG(t)/2;for(let i=0;i<t.length-1;i++){let r=t[i],o=t[i+1],a=r.dist(o);if(c+a>u){let d=(u-c)/a,h=new dq(nw.number(r.x,o.x,d),nw.number(r.y,o.y,d),o.angleTo(r),i);return h._round(),!s||dW(t,h,l,s,n)?h:void 0}c+=a}}function dK(t,n,i,r,o,a,s,l,c){let u=dY(r,a,s),d=dZ(r,o),h=d*s,p=0===t[0].x||t[0].x===c||0===t[0].y||t[0].y===c;return n-h<n/4&&(n=h+n/4),dJ(t,p?n/2*l%n:(d/2+2*a)*s*l%n,n,u,i,h,p,!1,c)}function dJ(t,n,i,r,o,a,s,l,c){let u=a/2,d=dG(t),h=0,p=n-i,f=[];for(let n=0;n<t.length-1;n++){let s=t[n],l=t[n+1],m=s.dist(l),g=l.angleTo(s);for(;p+i<h+m;){let v=((p+=i)-h)/m,b=nw.number(s.x,l.x,v),y=nw.number(s.y,l.y,v);if(b>=0&&b<c&&y>=0&&y<c&&p-u>=0&&p+u<=d){let i=new dq(b,y,g,n);i._round(),r&&!dW(t,i,a,r,o)||f.push(i)}}h+=m}return l||f.length||s||(f=dJ(t,h/2,i,r,o,a,s,!0,c)),f}function dQ(t,n,i,r){let o=[],a=t.image,s=a.pixelRatio,l=a.paddedRect.w-2,c=a.paddedRect.h-2,u={x1:t.left,y1:t.top,x2:t.right,y2:t.bottom},d=a.stretchX||[[0,l]],h=a.stretchY||[[0,c]],p=(t,n)=>t+n[1]-n[0],f=d.reduce(p,0),m=h.reduce(p,0),g=l-f,v=c-m,b=0,y=f,_=0,x=m,k=0,C=g,A=0,E=v;if(a.content&&r){let n=a.content,i=n[2]-n[0],r=n[3]-n[1];(a.textFitWidth||a.textFitHeight)&&(u=cO(t)),b=d0(d,0,n[0]),_=d0(h,0,n[1]),y=d0(d,n[0],n[2]),x=d0(h,n[1],n[3]),k=n[0]-b,A=n[1]-_,C=i-y,E=r-x}let S=u.x1,T=u.y1,O=u.x2-S,F=u.y2-T,M=(t,r,o,l)=>{let c=d2(t.stretch-b,y,O,S),u=d5(t.fixed-k,C,t.stretch,f),d=d2(r.stretch-_,x,F,T),h=d5(r.fixed-A,E,r.stretch,m),p=d2(o.stretch-b,y,O,S),g=d5(o.fixed-k,C,o.stretch,f),v=d2(l.stretch-_,x,F,T),M=d5(l.fixed-A,E,l.stretch,m),I=new w(c,d),R=new w(p,d),D=new w(p,v),P=new w(c,v),L=new w(u/s,h/s),N=new w(g/s,M/s),z=n*Math.PI/180;if(z){let t=Math.sin(z),n=Math.cos(z),i=[n,-t,t,n];I._matMult(i),R._matMult(i),P._matMult(i),D._matMult(i)}let j=t.stretch+t.fixed,B=r.stretch+r.fixed;return{tl:I,tr:R,bl:P,br:D,tex:{x:a.paddedRect.x+1+j,y:a.paddedRect.y+1+B,w:o.stretch+o.fixed-j,h:l.stretch+l.fixed-B},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:L,pixelOffsetBR:N,minFontScaleX:C/s/O,minFontScaleY:E/s/F,isSDF:i}};if(r&&(a.stretchX||a.stretchY)){let t=d1(d,g,f),n=d1(h,v,m);for(let i=0;i<t.length-1;i++){let r=t[i],a=t[i+1];for(let t=0;t<n.length-1;t++)o.push(M(r,n[t],a,n[t+1]))}}else o.push(M({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:c+1}));return o}function d0(t,n,i){let r=0;for(let o of t)r+=Math.max(n,Math.min(i,o[1]))-Math.max(n,Math.min(i,o[0]));return r}function d1(t,n,i){let r=[{fixed:-1,stretch:0}];for(let[n,i]of t){let t=r[r.length-1];r.push({fixed:n-t.stretch,stretch:t.stretch}),r.push({fixed:n-t.stretch,stretch:t.stretch+(i-n)})}return r.push({fixed:n+1,stretch:i}),r}function d2(t,n,i,r){return t/n*i+r}function d5(t,n,i,r){return t-n*i/r}rQ("Anchor",dq);class d3{constructor(t,n,i,r,o,a,s,l,c,u){var d;if(this.boxStartIndex=t.length,c){let t=a.top,n=a.bottom;const i=a.collisionPadding;i&&(t-=i[1],n+=i[3]);let r=n-t;r>0&&(r=Math.max(10,r),this.circleDiameter=r)}else{const c=(null==(d=a.image)?void 0:d.content)&&(a.image.textFitWidth||a.image.textFitHeight)?cO(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};c.y1=c.y1*s-l[0],c.y2=c.y2*s+l[2],c.x1=c.x1*s-l[3],c.x2=c.x2*s+l[1];const h=a.collisionPadding;if(h&&(c.x1-=h[0]*s,c.y1-=h[1]*s,c.x2+=h[2]*s,c.y2+=h[3]*s),u){const t=new w(c.x1,c.y1),n=new w(c.x2,c.y1),i=new w(c.x1,c.y2),r=new w(c.x2,c.y2),o=u*Math.PI/180;t._rotate(o),n._rotate(o),i._rotate(o),r._rotate(o),c.x1=Math.min(t.x,n.x,i.x,r.x),c.x2=Math.max(t.x,n.x,i.x,r.x),c.y1=Math.min(t.y,n.y,i.y,r.y),c.y2=Math.max(t.y,n.y,i.y,r.y)}t.emplaceBack(n.x,n.y,c.x1,c.y1,c.x2,c.y2,i,r,o)}this.boxEndIndex=t.length}}class d4{constructor(t=[],n=(t,n)=>t<n?-1:+(t>n)){if(this.data=t,this.length=this.data.length,this.compare=n,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(0===this.length)return;let t=this.data[0],n=this.data.pop();return--this.length>0&&(this.data[0]=n,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:n,compare:i}=this,r=n[t];for(;t>0;){let o=t-1>>1,a=n[o];if(i(r,a)>=0)break;n[t]=a,t=o}n[t]=r}_down(t){let{data:n,compare:i}=this,r=this.length>>1,o=n[t];for(;t<r;){let r=1+(t<<1),a=r+1;if(a<this.length&&0>i(n[a],n[r])&&(r=a),i(n[r],o)>=0)break;n[t]=n[r],t=r}n[t]=o}}function d6(t,n=1,i=!1){let r=uo.fromPoints(t[0]),o=Math.min(r.width(),r.height()),a=o/2,s=new d4([],d8),{minX:l,minY:c,maxX:u,maxY:d}=r;if(0===o)return new w(l,c);for(let n=l;n<u;n+=o)for(let i=c;i<d;i+=o)s.push(new d7(n+a,i+a,a,t));let h=function(t){let n=0,i=0,r=0,o=t[0];for(let t=0,a=o.length,s=a-1;t<a;s=t++){let a=o[t],l=o[s],c=a.x*l.y-l.x*a.y;i+=(a.x+l.x)*c,r+=(a.y+l.y)*c,n+=3*c}return new d7(i/n,r/n,0,t)}(t),p=s.length;for(;s.length;){let r=s.pop();(r.d>h.d||!h.d)&&(h=r,i&&console.log("found best %d after %d probes",Math.round(1e4*r.d)/1e4,p)),r.max-h.d<=n||(a=r.h/2,s.push(new d7(r.p.x-a,r.p.y-a,a,t)),s.push(new d7(r.p.x+a,r.p.y-a,a,t)),s.push(new d7(r.p.x-a,r.p.y+a,a,t)),s.push(new d7(r.p.x+a,r.p.y+a,a,t)),p+=4)}return i&&(console.log(`num probes: ${p}`),console.log(`best distance: ${h.d}`)),h.p}function d8(t,n){return n.max-t.max}function d7(t,n,i,r){this.p=new w(t,n),this.h=i,this.d=function(t,n){let i=!1,r=1/0;for(let o=0;o<n.length;o++){let a=n[o];for(let n=0,o=a.length,s=o-1;n<o;s=n++){let o=a[n],l=a[s];o.y>t.y!=l.y>t.y&&t.x<(l.x-o.x)*(t.y-o.y)/(l.y-o.y)+o.x&&(i=!i),r=Math.min(r,so(t,o,l))}}return(i?1:-1)*Math.sqrt(r)}(this.p,r),this.max=this.d+this.h*Math.SQRT2}t.aP=void 0,(P=t.aP||(t.aP={}))[P.center=1]="center",P[P.left=2]="left",P[P.right=3]="right",P[P.top=4]="top",P[P.bottom=5]="bottom",P[P["top-left"]=6]="top-left",P[P["top-right"]=7]="top-right",P[P["bottom-left"]=8]="bottom-left",P[P["bottom-right"]=9]="bottom-right";let d9=1/0;function he(t,n){return n[1]!==d9?function(t,n,i){let r=0,o=0;switch(n=Math.abs(n),i=Math.abs(i),t){case"top-right":case"top-left":case"top":o=i-7;break;case"bottom-right":case"bottom-left":case"bottom":o=7-i}switch(t){case"top-right":case"bottom-right":case"right":r=-n;break;case"top-left":case"bottom-left":case"left":r=n}return[r,o]}(t,n[0],n[1]):function(t,n){let i=0,r=0;n<0&&(n=0);let o=n/Math.SQRT2;switch(t){case"top-right":case"top-left":r=o-7;break;case"bottom-right":case"bottom-left":r=7-o;break;case"bottom":r=7-n;break;case"top":r=n-7}switch(t){case"top-right":case"bottom-right":i=-o;break;case"top-left":case"bottom-left":i=o;break;case"left":i=n;break;case"right":i=-n}return[i,r]}(t,n[0])}function ht(t,n,i){var r;let o=t.layout,a=null==(r=o.get("text-variable-anchor-offset"))?void 0:r.evaluate(n,{},i);if(a){let t=a.values,n=[];for(let i=0;i<t.length;i+=2){let r=n[i]=t[i],o=t[i+1].map(t=>t*lQ);r.startsWith("top")?o[1]-=7:r.startsWith("bottom")&&(o[1]+=7),n[i+1]=o}return new t2(n)}let s=o.get("text-variable-anchor");if(s){let r;r=void 0!==t._unevaluatedLayout.getValue("text-radial-offset")?[o.get("text-radial-offset").evaluate(n,{},i)*lQ,d9]:o.get("text-offset").evaluate(n,{},i).map(t=>t*lQ);let a=[];for(let t of s)a.push(t,he(t,r));return new t2(a)}return null}function hn(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function hi(n,i,r,o,a,s,l,c,u,d,h,p){let f,m=s.textMaxSize.evaluate(i,{});void 0===m&&(m=l);let g=n.layers[0].layout,v=g.get("icon-offset").evaluate(i,{},h),b=ho(r.horizontal),y=l/24,_=n.tilePixelRatio*y,x=n.tilePixelRatio*m/24,w=n.tilePixelRatio*c,k=n.tilePixelRatio*g.get("symbol-spacing"),C=g.get("text-padding")*n.tilePixelRatio,A=function(t,n,i,r=1){let o=t.get("icon-padding").evaluate(n,{},i),a=o&&o.values;return[a[0]*r,a[1]*r,a[2]*r,a[3]*r]}(g,i,h,n.tilePixelRatio),E=g.get("text-max-angle")/180*Math.PI,S="viewport"!==g.get("text-rotation-alignment")&&"point"!==g.get("symbol-placement"),T="map"===g.get("icon-rotation-alignment")&&"point"!==g.get("symbol-placement"),O=g.get("symbol-placement"),F=k/2,M=g.get("icon-text-fit");o&&"none"!==M&&(n.allowVerticalPlacement&&r.vertical&&(f=cF(o,r.vertical,M,g.get("icon-text-fit-padding"),v,y)),b&&(o=cF(o,b,M,g.get("icon-text-fit-padding"),v,y)));let I=h?p.line.getGranularityForZoomLevel(h.z):1,R=(c,p)=>{p.x<0||p.x>=ea||p.y<0||p.y>=ea||function(n,i,r,o,a,s,l,c,u,d,h,p,f,m,g,v,b,y,_,x,w,k,C,A,E){let S=n.addToLineVertexArray(i,r),T,O,F,M,I=0,R=0,D=0,P=0,L=-1,N=-1,z={},j=aR("");if(n.allowVerticalPlacement&&o.vertical){let t=c.layout.get("text-rotate").evaluate(w,{},A)+90;F=new d3(u,i,d,h,p,o.vertical,f,m,g,t),l&&(M=new d3(u,i,d,h,p,l,b,y,g,t))}if(a){let r=c.layout.get("icon-rotate").evaluate(w,{}),o="none"!==c.layout.get("icon-text-fit"),s=dQ(a,r,C,o),f=l?dQ(l,r,C,o):void 0;O=new d3(u,i,d,h,p,a,b,y,!1,r),I=4*s.length;let m=n.iconSizeData,g=null;"source"===m.kind?(g=[cM*c.layout.get("icon-size").evaluate(w,{})])[0]>cI&&ex(`${n.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`):"composite"===m.kind&&((g=[cM*k.compositeIconSizes[0].evaluate(w,{},A),cM*k.compositeIconSizes[1].evaluate(w,{},A)])[0]>cI||g[1]>cI)&&ex(`${n.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`),n.addSymbols(n.icon,s,g,x,_,w,t.az.none,i,S.lineStartIndex,S.lineLength,-1,A),L=n.icon.placedSymbolArray.length-1,f&&(R=4*f.length,n.addSymbols(n.icon,f,g,x,_,w,t.az.vertical,i,S.lineStartIndex,S.lineLength,-1,A),N=n.icon.placedSymbolArray.length-1)}let B=Object.keys(o.horizontal);for(let r of B){let a=o.horizontal[r];if(!T){j=aR(a.text);T=new d3(u,i,d,h,p,a,f,m,g,c.layout.get("text-rotate").evaluate(w,{},A))}let l=1===a.positionedLines.length;if(D+=hr(n,i,a,s,c,g,w,v,S,o.vertical?t.az.horizontal:t.az.horizontalOnly,l?B:[r],z,L,k,A),l)break}o.vertical&&(P+=hr(n,i,o.vertical,s,c,g,w,v,S,t.az.vertical,["vertical"],z,N,k,A));let U=T?T.boxStartIndex:n.collisionBoxArray.length,V=T?T.boxEndIndex:n.collisionBoxArray.length,H=F?F.boxStartIndex:n.collisionBoxArray.length,q=F?F.boxEndIndex:n.collisionBoxArray.length,W=O?O.boxStartIndex:n.collisionBoxArray.length,G=O?O.boxEndIndex:n.collisionBoxArray.length,Y=M?M.boxStartIndex:n.collisionBoxArray.length,Z=M?M.boxEndIndex:n.collisionBoxArray.length,X=-1,K=(t,n)=>t&&t.circleDiameter?Math.max(t.circleDiameter,n):n;X=K(T,-1),X=K(F,X),X=K(O,X);let J=+((X=K(M,X))>-1);J&&(X*=E/lQ),n.glyphOffsetArray.length>=c$.MAX_GLYPHS&&ex("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==w.sortKey&&n.addToSortKeyRanges(n.symbolInstances.length,w.sortKey);let Q=ht(c,w,A),[ee,et]=function(n,i){let r=n.length,o=null==i?void 0:i.values;if((null==o?void 0:o.length)>0)for(let i=0;i<o.length;i+=2){let r=o[i+1];n.emplaceBack(t.aP[o[i]],r[0],r[1])}return[r,n.length]}(n.textAnchorOffsets,Q);n.symbolInstances.emplaceBack(i.x,i.y,z.right>=0?z.right:-1,z.center>=0?z.center:-1,z.left>=0?z.left:-1,z.vertical||-1,L,N,j,U,V,H,q,W,G,Y,Z,d,D,P,I,R,J,0,f,X,ee,et)}(n,p,c,r,o,a,f,n.layers[0],n.collisionBoxArray,i.index,i.sourceLayerIndex,n.index,_,[C,C,C,C],S,u,w,A,T,v,i,s,d,h,l)};if("line"===O)for(let t of dj(i.geometry,0,0,ea,ea)){let i=lu(t,I);for(let t of dK(i,k,E,r.vertical||b,o,24,x,n.overscaling,ea))b&&ha(n,b.text,F,t)||R(i,t)}else if("line-center"===O){for(let t of i.geometry)if(t.length>1){let n=lu(t,I),i=dX(n,E,r.vertical||b,o,24,x);i&&R(n,i)}}else if("Polygon"===i.type)for(let t of n8(i.geometry,0)){let n=d6(t,16);R(lu(t[0],I,!0),new dq(n.x,n.y,0))}else if("LineString"===i.type)for(let t of i.geometry){let n=lu(t,I);R(n,new dq(n[0].x,n[0].y,0))}else if("Point"===i.type)for(let t of i.geometry)for(let n of t)R([n],new dq(n.x,n.y,0))}function hr(t,n,i,r,o,a,s,l,c,u,d,h,p,f,m){let g=function(t,n,i,r,o,a,s){let l=i.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,c=[];for(let i of t.positionedLines)for(let o of i.positionedGlyphs){if(!o.rect)continue;let u=o.rect||{},d=4,h=!0,p=1,f=0,m=(r||s)&&o.vertical,g=o.metrics.advance*o.scale/2;if(s&&t.verticalizable&&(f=i.lineOffset/2-(o.imageName?-(lQ-o.metrics.width*o.scale)/2:(o.scale-1)*lQ)),o.imageName){let t=a[o.imageName];h=t.sdf,d=1/(p=t.pixelRatio)}let v=r?[o.x+g,o.y]:[0,0],b=r?[0,0]:[o.x+g+n[0],o.y+n[1]-f],y=[0,0];m&&(y=b,b=[0,0]);let _=o.metrics.isDoubleResolution?2:1,x=(o.metrics.left-d)*o.scale-g+b[0],k=(-o.metrics.top-d)*o.scale+b[1],C=x+u.w/_*o.scale/p,A=k+u.h/_*o.scale/p,E=new w(x,k),S=new w(C,k),T=new w(x,A),O=new w(C,A);if(m){let t=new w(-g,g- -17),n=-Math.PI/2,i=12-g,r=new w(22-i,-(o.imageName?i:0)),a=new w(...y);E._rotateAround(n,t)._add(r)._add(a),S._rotateAround(n,t)._add(r)._add(a),T._rotateAround(n,t)._add(r)._add(a),O._rotateAround(n,t)._add(r)._add(a)}if(l){let t=Math.sin(l),n=Math.cos(l),i=[n,-t,t,n];E._matMult(i),S._matMult(i),T._matMult(i),O._matMult(i)}let F=new w(0,0),M=new w(0,0);c.push({tl:E,tr:S,bl:T,br:O,tex:u,writingMode:t.writingMode,glyphOffset:v,sectionIndex:o.sectionIndex,isSDF:h,pixelOffsetTL:F,pixelOffsetBR:M,minFontScaleX:0,minFontScaleY:0})}return c}(i,l,o,a,s,r,t.allowVerticalPlacement),v=t.textSizeData,b=null;for(let i of("source"===v.kind?(b=[cM*o.layout.get("text-size").evaluate(s,{})])[0]>cI&&ex(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`):"composite"===v.kind&&((b=[cM*f.compositeTextSizes[0].evaluate(s,{},m),cM*f.compositeTextSizes[1].evaluate(s,{},m)])[0]>cI||b[1]>cI)&&ex(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`),t.addSymbols(t.text,g,b,l,a,s,u,n,c.lineStartIndex,c.lineLength,p,m),d))h[i]=t.text.placedSymbolArray.length-1;return 4*g.length}function ho(t){for(let n in t)return t[n];return null}function ha(t,n,i,r){let o=t.compareText;if(n in o){let t=o[n];for(let n=t.length-1;n>=0;n--)if(r.dist(t[n])<i)return!0}else o[n]=[];return o[n].push(r),!1}let hs=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class hl{static from(t){if(!(t instanceof ArrayBuffer))throw Error("Data must be an instance of ArrayBuffer.");let[n,i]=new Uint8Array(t,0,2);if(219!==n)throw Error("Data does not appear to be in a KDBush format.");let r=i>>4;if(1!==r)throw Error(`Got v${r} data when expected v1.`);let o=hs[15&i];if(!o)throw Error("Unrecognized array type.");let[a]=new Uint16Array(t,2,1),[s]=new Uint32Array(t,4,1);return new hl(s,a,o,t)}constructor(t,n=64,i=Float64Array,r){if(isNaN(t)||t<0)throw Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const o=hs.indexOf(this.ArrayType),a=2*t*this.ArrayType.BYTES_PER_ELEMENT,s=t*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-s%8)%8;if(o<0)throw Error(`Unexpected typed array class: ${i}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+s+l,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+a+s+l),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+s+l,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+o]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){let t=this._pos>>1;if(t!==this.numItems)throw Error(`Added ${t} items when expected ${this.numItems}.`);return hc(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,r){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:o,coords:a,nodeSize:s}=this,l=[0,o.length-1,0],c=[];for(;l.length;){let u=l.pop()||0,d=l.pop()||0,h=l.pop()||0;if(d-h<=s){for(let s=h;s<=d;s++){let l=a[2*s],u=a[2*s+1];l>=t&&l<=i&&u>=n&&u<=r&&c.push(o[s])}continue}let p=h+d>>1,f=a[2*p],m=a[2*p+1];f>=t&&f<=i&&m>=n&&m<=r&&c.push(o[p]),(0===u?t<=f:n<=m)&&(l.push(h),l.push(p-1),l.push(1-u)),(0===u?i>=f:r>=m)&&(l.push(p+1),l.push(d),l.push(1-u))}return c}within(t,n,i){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:r,coords:o,nodeSize:a}=this,s=[0,r.length-1,0],l=[],c=i*i;for(;s.length;){let u=s.pop()||0,d=s.pop()||0,h=s.pop()||0;if(d-h<=a){for(let i=h;i<=d;i++)hp(o[2*i],o[2*i+1],t,n)<=c&&l.push(r[i]);continue}let p=h+d>>1,f=o[2*p],m=o[2*p+1];hp(f,m,t,n)<=c&&l.push(r[p]),(0===u?t-i<=f:n-i<=m)&&(s.push(h),s.push(p-1),s.push(1-u)),(0===u?t+i>=f:n+i>=m)&&(s.push(p+1),s.push(d),s.push(1-u))}return l}}function hc(t,n,i,r,o,a){if(o-r<=i)return;let s=r+o>>1;hu(t,n,s,r,o,a),hc(t,n,i,r,s-1,1-a),hc(t,n,i,s+1,o,1-a)}function hu(t,n,i,r,o,a){for(;o>r;){if(o-r>600){let s=o-r+1,l=i-r+1,c=Math.log(s),u=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*u*(s-u)/s)*(l-s/2<0?-1:1);hu(t,n,i,Math.max(r,Math.floor(i-l*u/s+d)),Math.min(o,Math.floor(i+(s-l)*u/s+d)),a)}let s=n[2*i+a],l=r,c=o;for(hd(t,n,r,i),n[2*o+a]>s&&hd(t,n,r,o);l<c;){for(hd(t,n,l,c),l++,c--;n[2*l+a]<s;)l++;for(;n[2*c+a]>s;)c--}n[2*r+a]===s?hd(t,n,r,c):hd(t,n,++c,o),c<=i&&(r=c+1),i<=c&&(o=c-1)}}function hd(t,n,i,r){hh(t,i,r),hh(n,2*i,2*r),hh(n,2*i+1,2*r+1)}function hh(t,n,i){let r=t[n];t[n]=t[i],t[i]=r}function hp(t,n,i,r){let o=t-i,a=n-r;return o*o+a*a}t.cI=void 0,(L=t.cI||(t.cI={})).create="create",L.load="load",L.fullLoad="fullLoad";let hf=null,hm=[],hg=1e3/60,hv="loadTime",hb="fullLoadTime",hy={mark(t){performance.mark(t)},recordStartOfFrameAt(t){null!=hf&&hm.push(t-hf),hf=t},resetRuntimeMetrics(){hf=null,hm=[]},clearInitializationMetrics(){for(let n in performance.clearMeasures(hv),performance.clearMeasures(hb),t.cI)performance.clearMarks(t.cI[n])},remove(){this.resetRuntimeMetrics(),this.clearInitializationMetrics()},getPerformanceMetrics(){performance.measure(hv,t.cI.create,t.cI.load),performance.measure(hb,t.cI.create,t.cI.fullLoad);let n=performance.getEntriesByName(hv)[0].duration,i=performance.getEntriesByName(hb)[0].duration,r=hm.length;return{loadTimeMs:n,fullLoadTimeMs:i,averageFramesPerSecond:1/(hm.reduce((t,n)=>t+n,0)/r/1e3),virtualDroppedFramesCount:hm.filter(t=>t>hg).reduce((t,n)=>t+(n-hg)/hg,0),totalFramesCount:r}}};t.$=z,t.A=U,t.B=rX,t.C=rq,t.D=ox,t.E=eG,t.F=function([t,n,i]){return n+=90,{x:t*Math.cos(n*=Math.PI/180)*Math.sin(i*=Math.PI/180),y:t*Math.sin(n)*Math.sin(i),z:t*Math.cos(i)}},t.G=nw,t.H=ou,t.I=cb,t.J=rG,t.K=function(t){if(null==eC){let n=t.navigator?t.navigator.userAgent:null;eC=!!t.safari||!(!n||!(/\b(iPad|iPhone|iPod)\b/.test(n)||n.match("Safari")&&!n.match("Chrome")))}return eC},t.L=class{constructor(t,n){this.target=t,this.mapId=n,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new cY(()=>this.process()),this.subscription=eT(this.target,"message",t=>this.receive(t),!1),this.globalScope=ek(self)?t:window}registerMessageHandler(t,n){this.messageHandlers[t]=n}unregisterMessageHandler(t){delete this.messageHandlers[t]}sendAsync(t,n){return new Promise((i,r)=>{let o=Math.round(1e18*Math.random()).toString(36).substring(0,10),a=n?eT(n.signal,"abort",()=>{null==a||a.unsubscribe(),delete this.resolveRejects[o];let n={id:o,type:"<cancel>",origin:location.origin,targetMapId:t.targetMapId,sourceMapId:this.mapId};this.target.postMessage(n)},cZ):null;this.resolveRejects[o]={resolve:t=>{null==a||a.unsubscribe(),i(t)},reject:t=>{null==a||a.unsubscribe(),r(t)}};let s=[],l=Object.assign(Object.assign({},t),{id:o,sourceMapId:this.mapId,origin:location.origin,data:r5(t.data,s)});this.target.postMessage(l,{transfer:s})})}receive(t){let n=t.data,i=n.id;if(!("file://"!==n.origin&&"file://"!==location.origin&&"resource://android"!==n.origin&&"resource://android"!==location.origin&&n.origin!==location.origin||n.targetMapId&&this.mapId!==n.targetMapId)){if("<cancel>"===n.type){delete this.tasks[i];let t=this.abortControllers[i];return delete this.abortControllers[i],void(t&&t.abort())}if(ek(self)||n.mustQueue)return this.tasks[i]=n,this.taskQueue.push(i),void this.invoker.trigger();this.processTask(i,n)}}process(){if(0===this.taskQueue.length)return;let t=this.taskQueue.shift(),n=this.tasks[t];delete this.tasks[t],this.taskQueue.length>0&&this.invoker.trigger(),n&&this.processTask(t,n)}processTask(t,n){return x(this,void 0,void 0,function*(){if("<response>"===n.type){let i=this.resolveRejects[t];if(delete this.resolveRejects[t],!i)return;return void(n.error?i.reject(r3(n.error)):i.resolve(r3(n.data)))}if(!this.messageHandlers[n.type])return void this.completeTask(t,Error(`Could not find a registered handler for ${n.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));let i=r3(n.data),r=new AbortController;this.abortControllers[t]=r;try{let o=yield this.messageHandlers[n.type](n.sourceMapId,i,r);this.completeTask(t,null,o)}catch(n){this.completeTask(t,n)}})}completeTask(t,n,i){let r=[];delete this.abortControllers[t];let o={id:t,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:n?r5(n):null,data:r5(i,r)};this.target.postMessage(o,{transfer:r})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},t.M=ez,t.N=function(){var t=new U(16);return U!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.O=function(t,n,i){var r,o,a,s,l,c,u,d,h,p,f,m,g=i[0],v=i[1],b=i[2];return n===t?(t[12]=n[0]*g+n[4]*v+n[8]*b+n[12],t[13]=n[1]*g+n[5]*v+n[9]*b+n[13],t[14]=n[2]*g+n[6]*v+n[10]*b+n[14],t[15]=n[3]*g+n[7]*v+n[11]*b+n[15]):(o=n[1],a=n[2],s=n[3],l=n[4],c=n[5],u=n[6],d=n[7],h=n[8],p=n[9],f=n[10],m=n[11],t[0]=r=n[0],t[1]=o,t[2]=a,t[3]=s,t[4]=l,t[5]=c,t[6]=u,t[7]=d,t[8]=h,t[9]=p,t[10]=f,t[11]=m,t[12]=r*g+l*v+h*b+n[12],t[13]=o*g+c*v+p*b+n[13],t[14]=a*g+u*v+f*b+n[14],t[15]=s*g+d*v+m*b+n[15]),t},t.P=w,t.Q=function(t,n,i){var r=i[0],o=i[1],a=i[2];return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=n[3]*r,t[4]=n[4]*o,t[5]=n[5]*o,t[6]=n[6]*o,t[7]=n[7]*o,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=n[11]*a,t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t},t.R=sS,t.S=function(t,n,i){var r=n[0],o=n[1],a=n[2],s=n[3],l=n[4],c=n[5],u=n[6],d=n[7],h=n[8],p=n[9],f=n[10],m=n[11],g=n[12],v=n[13],b=n[14],y=n[15],_=i[0],x=i[1],w=i[2],k=i[3];return t[0]=_*r+x*l+w*h+k*g,t[1]=_*o+x*c+w*p+k*v,t[2]=_*a+x*u+w*f+k*b,t[3]=_*s+x*d+w*m+k*y,t[4]=(_=i[4])*r+(x=i[5])*l+(w=i[6])*h+(k=i[7])*g,t[5]=_*o+x*c+w*p+k*v,t[6]=_*a+x*u+w*f+k*b,t[7]=_*s+x*d+w*m+k*y,t[8]=(_=i[8])*r+(x=i[9])*l+(w=i[10])*h+(k=i[11])*g,t[9]=_*o+x*c+w*p+k*v,t[10]=_*a+x*u+w*f+k*b,t[11]=_*s+x*d+w*m+k*y,t[12]=(_=i[12])*r+(x=i[13])*l+(w=i[14])*h+(k=i[15])*g,t[13]=_*o+x*c+w*p+k*v,t[14]=_*a+x*u+w*f+k*b,t[15]=_*s+x*d+w*m+k*y,t},t.T=sL,t.U=function(t,n){let i={};for(let r=0;r<n.length;r++){let o=n[r];o in t&&(i[o]=t[o])}return i},t.V=cK,t.W=ef,t.X=c1,t.Y=c0,t.Z=eP,t._=x,t.a=eD,t.a$=Z,t.a0=j,t.a1=eS,t.a2=ue,t.a3=c5,t.a4=c3,t.a5=ea,t.a6=function(t,n,i){if(!t)return n||{};if(!n)return t||{};let r=ur(t),o=ur(n);!function(t,n){for(let i of(n.removeAll&&(t.add.clear(),t.update.clear(),t.remove.clear(),n.remove.clear()),n.remove))t.add.delete(i),t.update.delete(i);for(let[i,r]of n.update){let o=t.update.get(i);o&&(n.update.set(i,ui(o,r)),t.update.delete(i))}}(r,o);let a={};if((r.removeAll||o.removeAll)&&(a.removeAll=!0),a.remove=new Set([...r.remove,...o.remove]),a.add=new Map([...r.add,...o.add]),a.update=new Map([...r.update,...o.update]),a.remove.size&&a.add.size)for(let t of a.add.keys())a.remove.delete(t);return function(t){let n={};return t.removeAll&&(n.removeAll=t.removeAll),t.remove&&(n.remove=Array.from(t.remove)),t.add&&(n.add=Array.from(t.add.values())),t.update&&(n.update=Array.from(t.update.values())),n}(a)},t.a7=function(t,n){let i=new Map;if(null==t||null==t.type)return i;if("Feature"===t.type){let r=un(t,n);if(null==r)return;return i.set(r,t),i}if("FeatureCollection"===t.type){let r=new Set;for(let o of t.features){let t=un(o,n);if(null==t||r.has(t))return;r.add(t),i.set(t,o)}return i}},t.a8=function(t,n,i){var r,o;let a=[];if(n.removeAll)t.clear();else if(n.remove)for(let i of n.remove){let n=t.get(i);n&&(a.push(n.geometry),t.delete(i))}if(n.add)for(let r of n.add){let n=un(r,i);if(null==n)continue;let o=t.get(n);o&&a.push(o.geometry),a.push(r.geometry),t.set(n,r)}if(n.update)for(let i of n.update){let n=t.get(i.id);if(!n)continue;let s=!!i.newGeometry,l=i.removeAllProperties||(null==(r=i.removeProperties)?void 0:r.length)>0||(null==(o=i.addOrUpdateProperties)?void 0:o.length)>0;if(!s&&!l)continue;a.push(n.geometry);let c=Object.assign({},n);if(t.set(i.id,c),s&&(a.push(i.newGeometry),c.geometry=i.newGeometry),l){if(c.properties=i.removeAllProperties?{}:Object.assign({},c.properties||{}),i.removeProperties)for(let t of i.removeProperties)delete c.properties[t];if(i.addOrUpdateProperties)for(let{key:t,value:n}of i.addOrUpdateProperties)c.properties[t]=n}}return a},t.a9=c6,t.aA=function(t,{uSize:n,uSizeT:i},{lowerSize:r,upperSize:o}){return"source"===t.kind?r/cM:"composite"===t.kind?nw.number(r/cM,o/cM,i):n},t.aB=function(t,n){var i=n[0],r=n[1],o=n[2],a=n[3],s=n[4],l=n[5],c=n[6],u=n[7],d=n[8],h=n[9],p=n[10],f=n[11],m=n[12],g=n[13],v=n[14],b=n[15],y=i*l-r*s,_=i*c-o*s,x=i*u-a*s,w=r*c-o*l,k=r*u-a*l,C=o*u-a*c,A=d*g-h*m,E=d*v-p*m,S=d*b-f*m,T=h*v-p*g,O=h*b-f*g,F=p*b-f*v,M=y*F-_*O+x*T+w*S-k*E+C*A;return M?(t[0]=(l*F-c*O+u*T)*(M=1/M),t[1]=(o*O-r*F-a*T)*M,t[2]=(g*C-v*k+b*w)*M,t[3]=(p*k-h*C-f*w)*M,t[4]=(c*S-s*F-u*E)*M,t[5]=(i*F-o*S+a*E)*M,t[6]=(v*x-m*C-b*_)*M,t[7]=(d*C-p*x+f*_)*M,t[8]=(s*O-l*S+u*A)*M,t[9]=(r*S-i*O-a*A)*M,t[10]=(m*k-g*x+b*y)*M,t[11]=(h*x-d*k-f*y)*M,t[12]=(l*E-s*T-c*A)*M,t[13]=(i*T-r*E+o*A)*M,t[14]=(g*_-m*w-v*y)*M,t[15]=(d*w-h*_+p*y)*M,t):null},t.aC=er,t.aD=function(t){var n=t[0],i=t[1];return Math.sqrt(n*n+i*i)},t.aE=function(t){return t[0]=0,t[1]=0,t},t.aF=function(t,n,i){return t[0]=n[0]*i,t[1]=n[1]*i,t},t.aG=cN,t.aH=et,t.aI=function(t,n,i,r){let o=n.y-t.y,a=n.x-t.x,s=r.y-i.y,l=r.x-i.x,c=s*a-l*o;if(0===c)return null;let u=(l*(t.y-i.y)-s*(t.x-i.x))/c;return new w(t.x+u*a,t.y+u*o)},t.aJ=dj,t.aK=a7,t.aL=function(t){let n=1/0,i=1/0,r=-1/0,o=-1/0;for(let a of t)n=Math.min(n,a.x),i=Math.min(i,a.y),r=Math.max(r,a.x),o=Math.max(o,a.y);return[n,i,r,o]},t.aM=lQ,t.aN=es,t.aO=function(t,n,i,r,o=!1){if(!i[0]&&!i[1])return[0,0];let a=o?"map"===r?-t.bearingInRadians:0:"viewport"===r?t.bearingInRadians:0;if(a){let t=Math.sin(a),n=Math.cos(a);i=[i[0]*n-i[1]*t,i[0]*t+i[1]*n]}return[o?i[0]:es(n,i[0],t.zoom),o?i[1]:es(n,i[1],t.zoom)]},t.aQ=cD,t.aR=hn,t.aS=cx,t.aT=hl,t.aU=oR,t.aV=lo,t.aW=as,t.aX=ak,t.aY=a_,t.aZ=eF,t.a_=c4,t.aa=uo,t.ab=25,t.ac=c7,t.ad=t=>{let n=window.document.createElement("video");return n.muted=!0,new Promise(i=>{for(let r of(n.onloadstart=()=>{i(n)},t)){let t=window.document.createElement("source");eU(r)||(n.crossOrigin="Anonymous"),t.src=r,n.appendChild(t)}})},t.ae=e6,t.af=function(){return eg++},t.ag=o6,t.ah=c$,t.ai=dT,t.aj=re,t.ak=a3,t.al=us,t.am=function(t){let n={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(t,i,r,o)=>{let a=r||o;return n[i]=!a||a.toLowerCase(),""}),n["max-age"]){let t=parseInt(n["max-age"],10);isNaN(t)?delete n["max-age"]:n["max-age"]=t}return n},t.an=ep,t.ao=85.051129,t.ap=eO,t.aq=function(t){return Math.pow(2,t)},t.ar=H,t.as=c2,t.at=function(t){return Math.log(t)/Math.LN2},t.au=function(t){var n=t[0],i=t[1];return n*n+i*i},t.av=function(t){if(!t.length)return new Set;let n=Math.max(...t.map(t=>t.canonical.z)),i=1/0,r=-1/0,o=1/0,a=-1/0,s=[];for(let l of t){let{x:t,y:c,z:u}=l.canonical,d=Math.pow(2,n-u),h=t*d,p=c*d;s.push({id:l,x:h,y:p}),h<i&&(i=h),h>r&&(r=h),p<o&&(o=p),p>a&&(a=p)}let l=new Set;for(let t of s)t.x!==i&&t.x!==r&&t.y!==o&&t.y!==a||l.add(t.id);return l},t.aw=function(t,n){let i=Math.abs(2*t.wrap)-(t.wrap<0),r=Math.abs(2*n.wrap)-(n.wrap<0);return t.overscaledZ-n.overscaledZ||r-i||n.canonical.y-t.canonical.y||n.canonical.x-t.canonical.x},t.ax=class{constructor(t,n){this.max=t,this.onRemove=n,this.reset()}reset(){for(let t in this.data)for(let n of this.data[t])n.timeout&&clearTimeout(n.timeout),this.onRemove(n.value);return this.data={},this.order=[],this}add(t,n,i){let r=t.wrapped().key;void 0===this.data[r]&&(this.data[r]=[]);let o={value:n,timeout:void 0};if(void 0!==i&&(o.timeout=setTimeout(()=>{this.remove(t,o)},i)),this.data[r].push(o),this.order.push(r),this.order.length>this.max){let t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){let n=this.data[t].shift();return n.timeout&&clearTimeout(n.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),n.value}getByKey(t){let n=this.data[t];return n?n[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,n){if(!this.has(t))return this;let i=t.wrapped().key,r=void 0===n?0:this.data[i].indexOf(n),o=this.data[i][r];return this.data[i].splice(r,1),o.timeout&&clearTimeout(o.timeout),0===this.data[i].length&&delete this.data[i],this.onRemove(o.value),this.order.splice(this.order.indexOf(i),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){let t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}filter(t){let n=[];for(let i in this.data)for(let r of this.data[i])t(r.value)||n.push(r);for(let t of n)this.remove(t.value.tileID,t)}},t.ay=function(t,n){let i=0,r=0;if("constant"===t.kind)r=t.layoutSize;else if("source"!==t.kind){let{interpolationType:o,minZoom:a,maxZoom:s}=t,l=o?ep(n_.interpolationFactor(o,n,a,s),0,1):0;"camera"===t.kind?r=nw.number(t.minSize,t.maxSize,l):i=l}return{uSizeT:i,uSize:r}},t.b=eA,t.b$=a$,t.b0=Y,t.b1=function(t){var n=new U(3);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n},t.b2=function(t,n,i){return t[0]=n[0]-i[0],t[1]=n[1]-i[1],t[2]=n[2]-i[2],t},t.b3=function(t,n){var i=n[0],r=n[1],o=n[2],a=i*i+r*r+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t},t.b4=X,t.b5=function(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]},t.b6=function(t,n,i){return t[0]=n[0]*i[0],t[1]=n[1]*i[1],t[2]=n[2]*i[2],t[3]=n[3]*i[3],t},t.b7=W,t.b8=function(t,n,i){let r=n[0]*i[0]+n[1]*i[1]+n[2]*i[2];return 0===r?null:(-(t[0]*i[0]+t[1]*i[1]+t[2]*i[2])-i[3])/r},t.b9=ee,t.bA=function(){return new Float64Array(3)},t.bB=ei,t.bC=function(t,n,i){var r=i[0],o=i[1],a=i[2],s=i[3],l=n[0],c=n[1],u=n[2],d=o*u-a*c,h=a*l-r*u,p=r*c-o*l;return t[0]=l+s*(d+=d)+o*(p+=p)-a*(h+=h),t[1]=c+s*h+a*d-r*p,t[2]=u+s*p+r*h-o*d,t},t.bD=function(t,n,i){var r,o,a,s,l,c,u;let d=(r=[t[0],t[1],t[2],n[0],n[1],n[2],i[0],i[1],i[2]])[0]*((u=r[8])*(a=r[4])-(s=r[5])*(c=r[7]))+r[1]*(-u*(o=r[3])+s*(l=r[6]))+r[2]*(c*o-a*l);if(0===d)return null;let h=X([],[n[0],n[1],n[2]],[i[0],i[1],i[2]]),p=X([],[i[0],i[1],i[2]],[t[0],t[1],t[2]]),f=X([],[t[0],t[1],t[2]],[n[0],n[1],n[2]]),m=Z([],h,-t[3]);return Y(m,m,Z([],p,-n[3])),Y(m,m,Z([],f,-i[3])),Z(m,m,1/d),m},t.bE=cX,t.bF=function(){return new Float64Array(4)},t.bG=function(t,n,i,r){var o=[],a=[];return o[0]=n[0]-i[0],o[1]=n[1]-i[1],o[2]=n[2]-i[2],a[0]=o[0]*Math.cos(r)-o[1]*Math.sin(r),a[1]=o[0]*Math.sin(r)+o[1]*Math.cos(r),a[2]=o[2],t[0]=a[0]+i[0],t[1]=a[1]+i[1],t[2]=a[2]+i[2],t},t.bH=function(t,n,i,r){var o=[],a=[];return o[0]=n[0]-i[0],o[1]=n[1]-i[1],o[2]=n[2]-i[2],a[0]=o[0],a[1]=o[1]*Math.cos(r)-o[2]*Math.sin(r),a[2]=o[1]*Math.sin(r)+o[2]*Math.cos(r),t[0]=a[0]+i[0],t[1]=a[1]+i[1],t[2]=a[2]+i[2],t},t.bI=function(t,n,i,r){var o=[],a=[];return o[0]=n[0]-i[0],o[1]=n[1]-i[1],o[2]=n[2]-i[2],a[0]=o[2]*Math.sin(r)+o[0]*Math.cos(r),a[1]=o[1],a[2]=o[2]*Math.cos(r)-o[0]*Math.sin(r),t[0]=a[0]+i[0],t[1]=a[1]+i[1],t[2]=a[2]+i[2],t},t.bJ=function(t,n,i){var r=Math.sin(i),o=Math.cos(i),a=n[0],s=n[1],l=n[2],c=n[3],u=n[8],d=n[9],h=n[10],p=n[11];return n!==t&&(t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t[0]=a*o-u*r,t[1]=s*o-d*r,t[2]=l*o-h*r,t[3]=c*o-p*r,t[8]=a*r+u*o,t[9]=s*r+d*o,t[10]=l*r+h*o,t[11]=c*r+p*o,t},t.bK=function(t,n){let i=el(t,360),r=el(n,360),o=r-i,a=r>i?o-360:o+360;return Math.abs(o)<Math.abs(a)?o:a},t.bL=function(t){return t[0]=0,t[1]=0,t[2]=0,t},t.bM=function(t,n,i,r){let o=Math.sqrt(t*t+n*n),a=Math.sqrt(i*i+r*r);t/=o,n/=o;let s=Math.acos(t*(i/=a)+n*(r/=a));return-n*i+t*r>0?s:-s},t.bN=function(t,n){let i=el(t,2*Math.PI),r=el(n,2*Math.PI);return Math.min(Math.abs(i-r),Math.abs(i-r+2*Math.PI),Math.abs(i-r-2*Math.PI))},t.bO=function(){let t={},n=eY.$version;for(let i in eY.$root){let r=eY.$root[i];if(r.required){let o=null;null!=(o="version"===i?n:"array"===r.type?[]:{})&&(t[i]=o)}}return t},t.bP=eB,t.bQ=r4,t.bR=function t(n,i){if(Array.isArray(n)){if(!Array.isArray(i)||n.length!==i.length)return!1;for(let r=0;r<n.length;r++)if(!t(n[r],i[r]))return!1;return!0}if("object"==typeof n&&null!==n&&null!==i){if("object"!=typeof i||Object.keys(n).length!==Object.keys(i).length)return!1;for(let r in n)if(!t(n[r],i[r]))return!1;return!0}return n===i},t.bS=function(t){t=t.slice();let n=Object.create(null);for(let i=0;i<t.length;i++)n[t[i].id]=t[i];for(let i=0;i<t.length;i++)"ref"in t[i]&&(t[i]=eX(t[i],n[t[i].ref]));return t},t.bT=function(t,n){if("custom"===t.type)return new cG(t,n);switch(t.type){case"background":return new cW(t,n);case"circle":return new s_(t,n);case"color-relief":return new sj(t,n);case"fill":return new lg(t,n);case"fill-extrusion":return new lP(t,n);case"heatmap":return new sM(t,n);case"hillshade":return new sR(t,n);case"line":return new lq(t,n);case"raster":return new oO(t,n);case"symbol":return new cH(t,n)}},t.bU=t=>"raster"===t.type,t.bV=ey,t.bW=function(t,n){if(!t)return[{command:"setStyle",args:[n]}];let i=[];try{if(!eK(t.version,n.version))return[{command:"setStyle",args:[n]}];eK(t.center,n.center)||i.push({command:"setCenter",args:[n.center]}),eK(t.state,n.state)||i.push({command:"setGlobalState",args:[n.state]}),eK(t.centerAltitude,n.centerAltitude)||i.push({command:"setCenterAltitude",args:[n.centerAltitude]}),eK(t.zoom,n.zoom)||i.push({command:"setZoom",args:[n.zoom]}),eK(t.bearing,n.bearing)||i.push({command:"setBearing",args:[n.bearing]}),eK(t.pitch,n.pitch)||i.push({command:"setPitch",args:[n.pitch]}),eK(t.roll,n.roll)||i.push({command:"setRoll",args:[n.roll]}),eK(t.sprite,n.sprite)||i.push({command:"setSprite",args:[n.sprite]}),eK(t.glyphs,n.glyphs)||i.push({command:"setGlyphs",args:[n.glyphs]}),eK(t.transition,n.transition)||i.push({command:"setTransition",args:[n.transition]}),eK(t.light,n.light)||i.push({command:"setLight",args:[n.light]}),eK(t.terrain,n.terrain)||i.push({command:"setTerrain",args:[n.terrain]}),eK(t.sky,n.sky)||i.push({command:"setSky",args:[n.sky]}),eK(t.projection,n.projection)||i.push({command:"setProjection",args:[n.projection]});let r={},o=[];!function(t,n,i,r){let o;for(o in n=n||{},t=t||{})Object.prototype.hasOwnProperty.call(t,o)&&(Object.prototype.hasOwnProperty.call(n,o)||e0(o,i,r));for(o in n)Object.prototype.hasOwnProperty.call(n,o)&&(Object.prototype.hasOwnProperty.call(t,o)?eK(t[o],n[o])||("geojson"===t[o].type&&"geojson"===n[o].type&&e2(t,n,o)?eJ(i,{command:"setGeoJSONSourceData",args:[o,n[o].data]}):e1(o,n,i,r)):eQ(o,n,i))}(t.sources,n.sources,o,r);let a=[];t.layers&&t.layers.forEach(t=>{"source"in t&&r[t.source]?i.push({command:"removeLayer",args:[t.id]}):a.push(t)}),i=i.concat(o),function(t,n,i){let r,o,a,s,l;n=n||[];let c=(t=t||[]).map(e3),u=n.map(e3),d=t.reduce(e4,{}),h=n.reduce(e4,{}),p=c.slice(),f=Object.create(null);for(let t=0,n=0;t<c.length;t++)r=c[t],Object.prototype.hasOwnProperty.call(h,r)?n++:(eJ(i,{command:"removeLayer",args:[r]}),p.splice(p.indexOf(r,n),1));for(let t=0,n=0;t<u.length;t++)r=u[u.length-1-t],p[p.length-1-t]!==r&&(Object.prototype.hasOwnProperty.call(d,r)?(eJ(i,{command:"removeLayer",args:[r]}),p.splice(p.lastIndexOf(r,p.length-n),1)):n++,s=p[p.length-t],eJ(i,{command:"addLayer",args:[h[r],s]}),p.splice(p.length-t,0,r),f[r]=!0);for(let t=0;t<u.length;t++)if(o=d[r=u[t]],a=h[r],!f[r]&&!eK(o,a))if(eK(o.source,a.source)&&eK(o["source-layer"],a["source-layer"])&&eK(o.type,a.type)){for(l in e5(o.layout,a.layout,i,r,null,"setLayoutProperty"),e5(o.paint,a.paint,i,r,null,"setPaintProperty"),eK(o.filter,a.filter)||eJ(i,{command:"setFilter",args:[r,a.filter]}),eK(o.minzoom,a.minzoom)&&eK(o.maxzoom,a.maxzoom)||eJ(i,{command:"setLayerZoomRange",args:[r,a.minzoom,a.maxzoom]}),o)Object.prototype.hasOwnProperty.call(o,l)&&"layout"!==l&&"paint"!==l&&"filter"!==l&&"metadata"!==l&&"minzoom"!==l&&"maxzoom"!==l&&(0===l.indexOf("paint.")?e5(o[l],a[l],i,r,l.slice(6),"setPaintProperty"):eK(o[l],a[l])||eJ(i,{command:"setLayerProperty",args:[r,l,a[l]]}));for(l in a)Object.prototype.hasOwnProperty.call(a,l)&&!Object.prototype.hasOwnProperty.call(o,l)&&"layout"!==l&&"paint"!==l&&"filter"!==l&&"metadata"!==l&&"minzoom"!==l&&"maxzoom"!==l&&(0===l.indexOf("paint.")?e5(o[l],a[l],i,r,l.slice(6),"setPaintProperty"):eK(o[l],a[l])||eJ(i,{command:"setLayerProperty",args:[r,l,a[l]]}))}else eJ(i,{command:"removeLayer",args:[r]}),s=p[p.lastIndexOf(r)+1],eJ(i,{command:"addLayer",args:[a,s]})}(a,n.layers,i)}catch(t){console.warn("Unable to compute style diff:",t),i=[{command:"setStyle",args:[n]}]}return i},t.bX=function(t){let n=[],i=t.id;return void 0===i&&n.push({message:`layers.${i}: missing required property "id"`}),void 0===t.render&&n.push({message:`layers.${i}: missing required method "render"`}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&n.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),n},t.bY=ev,t.bZ=eb,t.b_=class extends az{constructor(t,n){super(t,n),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))}},t.ba=function(t,n,i){return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=n[3]*i,t},t.bb=function(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]},t.bc=c9,t.bd=ut,t.be=function(t,n,i,r,o){var a=1/Math.tan(n/2);if(t[0]=a/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=o&&o!==1/0){var s=1/(r-o);t[10]=(o+r)*s,t[14]=2*o*r*s}else t[10]=-1,t[14]=-2*r;return t},t.bf=function(t){var n=new U(16);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},t.bg=function(t,n,i){var r=Math.sin(i),o=Math.cos(i),a=n[0],s=n[1],l=n[2],c=n[3],u=n[4],d=n[5],h=n[6],p=n[7];return n!==t&&(t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t[0]=a*o+u*r,t[1]=s*o+d*r,t[2]=l*o+h*r,t[3]=c*o+p*r,t[4]=u*o-a*r,t[5]=d*o-s*r,t[6]=h*o-l*r,t[7]=p*o-c*r,t},t.bh=function(t,n,i){var r=Math.sin(i),o=Math.cos(i),a=n[4],s=n[5],l=n[6],c=n[7],u=n[8],d=n[9],h=n[10],p=n[11];return n!==t&&(t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t[4]=a*o+u*r,t[5]=s*o+d*r,t[6]=l*o+h*r,t[7]=c*o+p*r,t[8]=u*o-a*r,t[9]=d*o-s*r,t[10]=h*o-l*r,t[11]=p*o-c*r,t},t.bi=function(){let t=new Float32Array(16);return H(t),t},t.bj=function(){let t=new Float64Array(16);return H(t),t},t.bk=function(){return new Float64Array(16)},t.bl=function(t,n,i){let r=new Float64Array(4);return ei(r,t,n-90,i),r},t.bm=function(t,n,i,r){var o,a,s,l,c,u=n[0],d=n[1],h=n[2],p=n[3],f=i[0],m=i[1],g=i[2],v=i[3];return(a=u*f+d*m+h*g+p*v)<0&&(a=-a,f=-f,m=-m,g=-g,v=-v),1-a>B?(s=Math.sin(o=Math.acos(a)),l=Math.sin((1-r)*o)/s,c=Math.sin(r*o)/s):(l=1-r,c=r),t[0]=l*u+c*f,t[1]=l*d+c*m,t[2]=l*h+c*g,t[3]=l*p+c*v,t},t.bn=function(t){var n,i,r,o,a,s,l,c,u,d,h,p,f,m,g,v,b,y;let _,x,w=new Float64Array(9);d=(r=(i=t)[0])*(l=r+r),h=(o=i[1])*l,f=(a=i[2])*l,m=a*(c=o+o),v=(s=i[3])*l,b=s*c,y=s*(u=a+a),(n=w)[0]=1-(p=o*c)-(g=a*u),n[3]=h-y,n[6]=f+b,n[1]=h+y,n[4]=1-d-g,n[7]=m-v,n[2]=f-b,n[5]=m+v,n[8]=1-d-p;let k=eF(-Math.asin(ep(w[2],-1,1)));return .001>Math.hypot(w[5],w[8])?(_=0,x=-eF(Math.atan2(w[3],w[4]))):(_=eF(0===w[5]&&0===w[8]?0:Math.atan2(w[5],w[8])),x=eF(0===w[1]&&0===w[0]?0:Math.atan2(w[1],w[0]))),{roll:_,pitch:k+90,bearing:x}},t.bo=function(t,n){return t.roll==n.roll&&t.pitch==n.pitch&&t.bearing==n.bearing},t.bp=tW,t.bq=aj,t.br=la,t.bs=ls,t.bt=lr,t.bu=ec,t.bv=eu,t.bw=t3,t.bx=function(t,n,i,r,o){return ec(r,o,ep((t-n)/(i-n),0,1))},t.by=function(t,n,i,r){return t[0]=n[0]+i[0]*r,t[1]=n[1]+i[1]*r,t[2]=n[2]+i[2]*r,t},t.bz=el,t.c=eL,t.c$=class{constructor(t){this.start=`${t}#start`,this.end=`${t}#end`,this.measure=t,performance.mark(this.start)}finish(){performance.mark(this.end);let t=performance.getEntriesByName(this.measure);return 0===t.length&&(performance.measure(this.measure,this.start,this.end),t=performance.getEntriesByName(this.measure),performance.clearMarks(this.start),performance.clearMarks(this.end),performance.clearMeasures(this.measure)),t}},t.c0=class extends az{constructor(t,n){super(t,n),this.current=aU}set(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(let n=1;n<16;n++)if(t[n]!==this.current[n]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}}},t.c1=aB,t.c2=class extends az{constructor(t,n){super(t,n),this.current=[0,0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))}},t.c3=class extends az{constructor(t,n){super(t,n),this.current=[0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))}},t.c4=V,t.c5=function(t,n){var i=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=i,t[2]=0,t[3]=-i,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.c6=function(t,n,i){var r=n[0],o=n[1],a=n[2];return t[0]=r*i[0]+o*i[3]+a*i[6],t[1]=r*i[1]+o*i[4]+a*i[7],t[2]=r*i[2]+o*i[5]+a*i[8],t},t.c7=function(t,n,i,r,o,a,s){var l=1/(n-i),c=1/(r-o),u=1/(a-s);return t[0]=-2*l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(n+i)*l,t[13]=(o+r)*c,t[14]=(s+a)*u,t[15]=1,t},t.c8=class extends az{constructor(t,n){super(t,n),this.current=[]}set(t){if(t!=this.current){this.current=t;let n=new Float32Array(4*t.length);for(let i=0;i<t.length;i++)n[4*i]=t[i].r,n[4*i+1]=t[i].g,n[4*i+2]=t[i].b,n[4*i+3]=t[i].a;this.gl.uniform4fv(this.location,n)}}},t.c9=class extends az{constructor(t,n){super(t,n),this.current=[]}set(t){if(t!=this.current){this.current=t;let n=new Float32Array(t);this.gl.uniform1fv(this.location,n)}}},t.cA=function(t,n){var i;if(!eI[n])return!1;let r=null==t?void 0:t.target,o=(null==(i=null==r?void 0:r.ownerDocument)?void 0:i.defaultView)||window;return t instanceof o.MouseEvent||t instanceof o.WheelEvent},t.cB=function(t,n){return eM[n]&&"touches"in t},t.cC=function(t){return eM[t]||eI[t]},t.cD=function(t,n,i){var r=n[0],o=n[1];return t[0]=i[0]*r+i[4]*o+i[12],t[1]=i[1]*r+i[5]*o+i[13],t},t.cE=function(t,n){let{x:i,y:r}=c6.fromLngLat(n);return!(t<0||t>25||r<0||r>=1||i<0||i>=1)},t.cF=function(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=n[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.cG=class extends oL{},t.cH=hy,t.cJ=ej,t.cK=function(t,n){eL.REGISTERED_PROTOCOLS[t]=n},t.cL=function(t){delete eL.REGISTERED_PROTOCOLS[t]},t.cM=function(t,n){let i={};for(let r=0;r<t.length;r++){let o=n&&n[t[r].id]||rc(t[r]);n&&(n[t[r].id]=o);let a=i[o];a||(a=i[o]=[]),a.push(t[r])}let r=[];for(let t in i)r.push(i[t]);return r},t.cN=rQ,t.cO=ua,t.cP=dL,t.cQ=cy,t.cR=function(n){var i;n.bucket.createArrays(),n.bucket.tilePixelRatio=ea/(512*n.bucket.overscaling),n.bucket.compareText={},n.bucket.iconsNeedLinear=!1;let r=n.bucket.layers[0],o=r.layout,a=r._unevaluatedLayout._values,s={layoutIconSize:a["icon-size"].possiblyEvaluate(new ou(n.bucket.zoom+1),n.canonical),layoutTextSize:a["text-size"].possiblyEvaluate(new ou(n.bucket.zoom+1),n.canonical),textMaxSize:a["text-size"].possiblyEvaluate(new ou(18))};if("composite"===n.bucket.textSizeData.kind){let{minZoom:t,maxZoom:i}=n.bucket.textSizeData;s.compositeTextSizes=[a["text-size"].possiblyEvaluate(new ou(t),n.canonical),a["text-size"].possiblyEvaluate(new ou(i),n.canonical)]}if("composite"===n.bucket.iconSizeData.kind){let{minZoom:t,maxZoom:i}=n.bucket.iconSizeData;s.compositeIconSizes=[a["icon-size"].possiblyEvaluate(new ou(t),n.canonical),a["icon-size"].possiblyEvaluate(new ou(i),n.canonical)]}let l=o.get("text-line-height")*lQ,c="viewport"!==o.get("text-rotation-alignment")&&"point"!==o.get("symbol-placement"),u=o.get("text-keep-upright"),d=o.get("text-size");for(let a of n.bucket.features){let h=o.get("text-font").evaluate(a,{},n.canonical).join(","),p=d.evaluate(a,{},n.canonical),f=s.layoutTextSize.evaluate(a,{},n.canonical),m=s.layoutIconSize.evaluate(a,{},n.canonical),g={horizontal:{},vertical:void 0},v=a.text,b,y=[0,0];if(v){let i=v.toString(),s=o.get("text-letter-spacing").evaluate(a,{},n.canonical)*lQ,d=oe(i)?s:0,m=o.get("text-anchor").evaluate(a,{},n.canonical),b=ht(r,a,n.canonical);if(!b){let t=o.get("text-radial-offset").evaluate(a,{},n.canonical);y=t?he(m,[t*lQ,d9]):o.get("text-offset").evaluate(a,{},n.canonical).map(t=>t*lQ)}let _=c?"center":o.get("text-justify").evaluate(a,{},n.canonical),x="point"===o.get("symbol-placement")?o.get("text-max-width").evaluate(a,{},n.canonical)*lQ:1/0,w=()=>{n.bucket.allowVerticalPlacement&&r9(i)&&(g.vertical=c_(v,n.glyphMap,n.glyphPositions,n.imagePositions,h,x,l,m,"left",d,y,t.az.vertical,!0,f,p))};if(!c&&b){let i=new Set;if("auto"===_)for(let t=0;t<b.values.length;t+=2)i.add(hn(b.values[t]));else i.add(_);let r=!1;for(let o of i)if(!g.horizontal[o])if(r)g.horizontal[o]=g.horizontal[0];else{let i=c_(v,n.glyphMap,n.glyphPositions,n.imagePositions,h,x,l,"center",o,d,y,t.az.horizontal,!1,f,p);i&&(g.horizontal[o]=i,r=1===i.positionedLines.length)}w()}else{"auto"===_&&(_=hn(m));let r=c_(v,n.glyphMap,n.glyphPositions,n.imagePositions,h,x,l,m,_,d,y,t.az.horizontal,!1,f,p);r&&(g.horizontal[_]=r),w(),r9(i)&&c&&u&&(g.vertical=c_(v,n.glyphMap,n.glyphPositions,n.imagePositions,h,x,l,m,_,d,y,t.az.vertical,!1,f,p))}}let _=!1;if(a.icon&&a.icon.name){let t=n.imageMap[a.icon.name];t&&(b=cT(n.imagePositions[a.icon.name],o.get("icon-offset").evaluate(a,{},n.canonical),o.get("icon-anchor").evaluate(a,{},n.canonical)),_=!!t.sdf,void 0===n.bucket.sdfIcons?n.bucket.sdfIcons=_:n.bucket.sdfIcons!==_&&ex("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(t.pixelRatio!==n.bucket.pixelRatio||0!==o.get("icon-rotate").constantOr(1))&&(n.bucket.iconsNeedLinear=!0))}let x=ho(g.horizontal)||g.vertical;(i=n.bucket).iconsInText||(i.iconsInText=!!x&&x.iconsInText),(x||b)&&hi(n.bucket,a,g,b,n.imageMap,s,f,m,y,_,n.canonical,n.subdivisionGranularity)}n.showCollisionBoxes&&n.bucket.generateCollisionDebugBuffers()},t.cS=lf,t.cT=lF,t.cU=lU,t.cV=function(t){let n=new cn;return function(t,n){for(let i in t.layers)n.writeMessage(3,dO,t.layers[i])}(t,n),n.finish()},t.cW=function(t,n,i,r,o,a){let s=dB(t,n,i,o,0);return dB(s,n,r,a,1)},t.cX=class{constructor(t){this.maxEntries=t,this.map=new Map}get(t){let n=this.map.get(t);return void 0!==n&&(this.map.delete(t),this.map.set(t,n)),n}set(t,n){if(this.map.has(t))this.map.delete(t);else if(this.map.size>=this.maxEntries){let t=this.map.keys().next().value;this.map.delete(t)}this.map.set(t,n)}clear(){this.map.clear()}},t.cY=lE,t.cZ=cn,t.c_=dE,t.ca=class extends oY{},t.cb=lK,t.cc=class extends oX{},t.cd=sF,t.ce=function(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},t.cf=sO,t.cg=function(t,n,i){var r=n[0],o=n[1],a=n[2],s=i[3]*r+i[7]*o+i[11]*a+i[15];return t[0]=(i[0]*r+i[4]*o+i[8]*a+i[12])/(s=s||1),t[1]=(i[1]*r+i[5]*o+i[9]*a+i[13])/s,t[2]=(i[2]*r+i[6]*o+i[10]*a+i[14])/s,t},t.ch=class extends oN{},t.ci=class extends o5{},t.cj=function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]&&t[9]===n[9]&&t[10]===n[10]&&t[11]===n[11]&&t[12]===n[12]&&t[13]===n[13]&&t[14]===n[14]&&t[15]===n[15]},t.ck=function(t,n){var i=t[0],r=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=t[9],p=t[10],f=t[11],m=t[12],g=t[13],v=t[14],b=t[15],y=n[0],_=n[1],x=n[2],w=n[3],k=n[4],C=n[5],A=n[6],E=n[7],S=n[8],T=n[9],O=n[10],F=n[11],M=n[12],I=n[13],R=n[14],D=n[15];return Math.abs(i-y)<=B*Math.max(1,Math.abs(i),Math.abs(y))&&Math.abs(r-_)<=B*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(o-x)<=B*Math.max(1,Math.abs(o),Math.abs(x))&&Math.abs(a-w)<=B*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(s-k)<=B*Math.max(1,Math.abs(s),Math.abs(k))&&Math.abs(l-C)<=B*Math.max(1,Math.abs(l),Math.abs(C))&&Math.abs(c-A)<=B*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(u-E)<=B*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(d-S)<=B*Math.max(1,Math.abs(d),Math.abs(S))&&Math.abs(h-T)<=B*Math.max(1,Math.abs(h),Math.abs(T))&&Math.abs(p-O)<=B*Math.max(1,Math.abs(p),Math.abs(O))&&Math.abs(f-F)<=B*Math.max(1,Math.abs(f),Math.abs(F))&&Math.abs(m-M)<=B*Math.max(1,Math.abs(m),Math.abs(M))&&Math.abs(g-I)<=B*Math.max(1,Math.abs(g),Math.abs(I))&&Math.abs(v-R)<=B*Math.max(1,Math.abs(v),Math.abs(R))&&Math.abs(b-D)<=B*Math.max(1,Math.abs(b),Math.abs(D))},t.cl=function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t},t.cm=t=>"symbol"===t.type,t.cn=t=>"circle"===t.type,t.co=t=>"heatmap"===t.type,t.cp=t=>"line"===t.type,t.cq=t=>"fill"===t.type,t.cr=t=>"fill-extrusion"===t.type,t.cs=t=>"hillshade"===t.type,t.ct=t=>"color-relief"===t.type,t.cu=t=>"background"===t.type,t.cv=t=>"custom"===t.type,t.cw=ed,t.cx=function(t,n,i){if(n<=0)return t;let r=1/n;return void 0===i||1e-10>Math.abs(i)?Math.round(t*r)/r:(i>0?Math.ceil(t*r-1e-9):Math.floor(t*r+1e-10))/r},t.cy=function(t,n,i){var r,o;let a=eo(n.x-i.x,n.y-i.y),s=eo(t.x-i.x,t.y-i.y);return eF(Math.atan2(a[0]*s[1]-a[1]*s[0],(r=a)[0]*(o=s)[0]+r[1]*o[1]))},t.cz=eh,t.d=eU,t.d0=function(t,n,i,a,s){return x(this,void 0,void 0,function*(){if(j())try{return yield eS(t,n,i,a,s)}catch(t){}return function(t,n,i,a,s){let l=t.width,c=t.height;r&&o||(o=(r=new OffscreenCanvas(l,c)).getContext("2d",{willReadFrequently:!0})),r.width=l,r.height=c,o.drawImage(t,0,0,l,c);let u=o.getImageData(n,i,a,s);return o.clearRect(0,0,l,c),u.data}(t,n,i,a,s)})},t.d1=sN,t.d2=k,t.d3=class{constructor(t,n){this.layers={[dT]:this},this.name=dT,this.version=n?n.version:1,this.extent=n?n.extent:4096,this.length=t.length,this.features=t}feature(t){return new dS(this.features[t],this.extent)}},t.d4=i0,t.d5=oc,t.e=em,t.f=t=>x(void 0,void 0,void 0,function*(){if(0===t.byteLength)return createImageBitmap(new ImageData(1,1));let n=new Blob([new Uint8Array(t)],{type:"image/png"});try{return createImageBitmap(n)}catch(t){throw Error(`Could not load image because of ${t.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),t.g=eN,t.h=t=>new Promise((n,i)=>{let r=new Image;r.onload=()=>{n(r),URL.revokeObjectURL(r.src),r.onload=null,window.requestAnimationFrame(()=>{r.src=eE})},r.onerror=()=>i(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 o=new Blob([new Uint8Array(t)],{type:"image/png"});r.src=t.byteLength?URL.createObjectURL(o):eE}),t.i=ek,t.j=(t,n)=>e$(em(t,{type:"json"}),n),t.k=eW,t.l=eq,t.m=e$,t.n=(t,n)=>e$(em(t,{type:"arrayBuffer"}),n),t.o=function(t){return new cn(t).readFields(cf,[])},t.p=cv,t.q=function(t){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(t))},t.r=sE,t.s=eT,t.t=oE,t.u=eY,t.v=rH,t.w=ex,t.x=om,t.y=rW,t.z=oh}),i("worker",["./shared"],function(t){class n{constructor(t,n){this.keyCache={},t&&this.replace(t,n)}replace(t,n){this._layerConfigs={},this._layers={},this.update(t,[],n)}update(n,i,r){for(let i of n){this._layerConfigs[i.id]=i;let n=this._layers[i.id]=t.bT(i,r);n._featureFilter=t.aj(n.filter,r),this.keyCache[i.id]&&delete this.keyCache[i.id]}for(let t of i)delete this.keyCache[t],delete this._layerConfigs[t],delete this._layers[t];for(let n of(this.familiesBySource={},t.cM(Object.values(this._layerConfigs),this.keyCache))){let i=n.map(t=>this._layers[t.id]),r=i[0];if(r.isHidden())continue;let o=r.source||"",a=this.familiesBySource[o];a||(a=this.familiesBySource[o]={});let s=r.sourceLayer||t.ai,l=a[s];l||(l=a[s]=[]),l.push(i)}}}class i{constructor(n){const i={},r=[];for(const t in n){const o=n[t],a=i[t]={};for(const t in o){const n=o[+t];if(!n||0===n.bitmap.width||0===n.bitmap.height)continue;const i={x:0,y:0,w:n.bitmap.width+2,h:n.bitmap.height+2};r.push(i),a[t]={rect:i,metrics:n.metrics}}}const{w:o,h:a}=t.p(r),s=new t.r({width:o||1,height:a||1});for(const r in n){const o=n[r];for(const n in o){const a=o[+n];if(!a||0===a.bitmap.width||0===a.bitmap.height)continue;const l=i[r][n].rect;t.r.copy(a.bitmap,s,{x:0,y:0},{x:l.x+1,y:l.y+1},a.bitmap)}}this.image=s,this.positions=i}}t.cN("GlyphAtlas",i);class r{constructor(n){this.tileID=new t.a2(n.tileID.overscaledZ,n.tileID.wrap,n.tileID.canonical.z,n.tileID.canonical.x,n.tileID.canonical.y),this.uid=n.uid,this.zoom=n.zoom,this.pixelRatio=n.pixelRatio,this.tileSize=n.tileSize,this.source=n.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=n.showCollisionBoxes,this.collectResourceTiming=!!n.collectResourceTiming,this.returnDependencies=!!n.returnDependencies,this.promoteId=n.promoteId,this.inFlightDependencies=[]}parse(n,r,a,s,l){return t._(this,void 0,void 0,function*(){this.status="parsing",this.data=n,this.collisionBoxArray=new t.ag;let c=new t.cO(Object.keys(n.layers).sort()),u=new t.cP(this.tileID,this.promoteId);u.bucketLayerIDs=[];let d={},h={featureIndex:u,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:a,subdivisionGranularity:l},p=r.familiesBySource[this.source];for(let i in p){let r=n.layers[i];if(!r)continue;1===r.version&&t.w(`Vector tile source "${this.source}" layer "${i}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let s=c.encode(i),l=[];for(let t=0;t<r.length;t++){let n=r.feature(t),o=u.getId(n,i);l.push({feature:n,id:o,index:t,sourceLayerIndex:s})}for(let n of p[i]){let i=n[0];i.source!==this.source&&t.w(`layer.source = ${i.source} does not equal this.source = ${this.source}`),i.isHidden(this.zoom,!0)||(o(n,this.zoom,a),(d[i.id]=i.createBucket({index:u.bucketLayerIDs.length,layers:n,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:s,sourceID:this.source})).populate(l,h,this.tileID.canonical),u.bucketLayerIDs.push(n.map(t=>t.id)))}}let f=t.bY(h.glyphDependencies,t=>Object.keys(t).map(Number));this.inFlightDependencies.forEach(t=>null==t?void 0:t.abort()),this.inFlightDependencies=[];let m=Promise.resolve({});if(Object.keys(f).length){let t=new AbortController;this.inFlightDependencies.push(t),m=s.sendAsync({type:"GG",data:{stacks:f,source:this.source,tileID:this.tileID,type:"glyphs"}},t)}let g=Object.keys(h.iconDependencies),v=Promise.resolve({});if(g.length){let t=new AbortController;this.inFlightDependencies.push(t),v=s.sendAsync({type:"GI",data:{icons:g,source:this.source,tileID:this.tileID,type:"icons"}},t)}let b=Object.keys(h.patternDependencies),y=Promise.resolve({});if(b.length){let t=new AbortController;this.inFlightDependencies.push(t),y=s.sendAsync({type:"GI",data:{icons:b,source:this.source,tileID:this.tileID,type:"patterns"}},t)}let _=h.dashDependencies,x=Promise.resolve({});if(Object.keys(_).length){let t=new AbortController;this.inFlightDependencies.push(t),x=s.sendAsync({type:"GDA",data:{dashes:_}},t)}let[w,k,C,A]=yield Promise.all([m,v,y,x]),E=new i(w),S=new t.cQ(k,C);for(let n in d){let i=d[n];i instanceof t.ah?(o(i.layers,this.zoom,a),t.cR({bucket:i,glyphMap:w,glyphPositions:E.positions,imageMap:k,imagePositions:S.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical,subdivisionGranularity:h.subdivisionGranularity})):i.hasDependencies&&(i instanceof t.cS||i instanceof t.cT||i instanceof t.cU)&&(o(i.layers,this.zoom,a),i.addFeatures(h,this.tileID.canonical,S.patternPositions,A))}return this.status="done",{buckets:Object.values(d).filter(t=>!t.isEmpty()),featureIndex:u,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:E.image,imageAtlas:S,dashPositions:A,glyphMap:this.returnDependencies?w:null,iconMap:this.returnDependencies?k:null,glyphPositions:this.returnDependencies?E.positions:null}})}}function o(n,i,r){let o=new t.H(i);for(let t of n)t.recalculate(o,r)}class a{constructor(){this.loading={},this.loaded={},this.parsing={}}startLoading(t,n){this.loading[t]=n}finishLoading(t){delete this.loading[t]}abort(t){let n=this.loading[t];(null==n?void 0:n.abort)&&(n.abort.abort(),delete this.loading[t])}setParsing(t,n){this.parsing[t]=n}consumeParsing(t){let n=this.parsing[t];if(n)return delete this.parsing[t],n}clearParsing(t){delete this.parsing[t]}markLoaded(t,n){this.loaded[t]=n}getLoaded(t){let n=this.loaded[t];if(n)return n}removeLoaded(t){delete this.loaded[t]}clearLoaded(){this.loaded={}}}class s{constructor(t,n,i,r,o){this.type=t,this.properties=i||{},this.extent=o,this.pointsArray=n,this.id=r}loadGeometry(){return this.pointsArray.map(n=>n.map(n=>new t.P(n.x,n.y)))}}class l{constructor(t,n,i){this.version=2,this._myFeatures=t,this.name=n,this.length=t.length,this.extent=i}feature(t){return this._myFeatures[t]}}class c{constructor(){this.layers={}}addLayer(t){this.layers[t.name]=t}}function u(n){let i=t.cV(n);return 0===i.byteOffset&&i.byteLength===i.buffer.byteLength||(i=new Uint8Array(i)),{vectorTile:n,rawData:i.buffer}}function d(n,i,r){let{extent:o}=n,a=Math.pow(2,r.z-i.z),c=(r.x-i.x*a)*o,u=(r.y-i.y*a)*o,d=[];for(let i=0;i<n.length;i++){let r=n.feature(i),l=r.loadGeometry();for(let t of l)for(let n of t)n.x=n.x*a-c,n.y=n.y*a-u;let h=128;0!==(l=t.cW(l,r.type,-h,-h,o+h,o+h)).length&&d.push(new s(r.type,l,r.properties,r.id,o))}return new l(d,n.name,o)}class h{constructor(n,i,r){this.actor=n,this.layerIndex=i,this.availableImages=r,this.tileState=new a,this.overzoomedTileResultCache=new t.cX(1e3)}loadVectorTile(n,i){return t._(this,void 0,void 0,function*(){let r=yield t.n(n.request,i);try{return{vectorTile:"mlt"!==n.encoding?new t.cY(new t.cZ(r.data)):new t.c_(r.data),rawData:r.data,cacheControl:r.cacheControl,expires:r.expires}}catch(o){let t=new Uint8Array(r.data),i=`Unable to parse the tile at ${n.request.url}, `;throw Error(i+=31===t[0]&&139===t[1]?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${o.message}`)}})}loadTile(n){return t._(this,void 0,void 0,function*(){let{uid:t,overzoomParameters:i}=n;i&&(n.request=i.overzoomRequest);let o=this._startRequestTiming(n),a=new r(n);this.tileState.startLoading(t,a);let s=new AbortController;a.abort=s;try{let r=yield this.loadVectorTile(n,s);if(this.tileState.finishLoading(t),!r)return null;let{vectorTile:l,rawData:c}=r;i&&({vectorTile:l,rawData:c}=this._getOverzoomTile(n,r.vectorTile));let u=this._getExpiryData(r),d=this._finishRequestTiming(o);a.vectorTile=l,this.tileState.markLoaded(t,a);let h={rawData:c,cacheControl:u,resourceTiming:d};this.tileState.setParsing(t,h);try{return yield this._parseWorkerTile(a,n,h)}finally{this.tileState.clearParsing(t)}}catch(n){throw this.tileState.finishLoading(t),a.status="done",this.tileState.markLoaded(t,a),n}})}_parseWorkerTile(n,i,r){return t._(this,void 0,void 0,function*(){let o=yield n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor,i.subdivisionGranularity);if(r){let{rawData:n,cacheControl:a,resourceTiming:s}=r;o=t.e({rawTileData:n.slice(0),encoding:i.encoding},o,a,s)}return o})}_getExpiryData(t){let{expires:n,cacheControl:i}=t,r={};return n&&(r.expires=n),i&&(r.cacheControl=i),r}_startRequestTiming(n){var i;if(null==(i=n.request)?void 0:i.collectResourceTiming)return new t.c$(n.request.url)}_finishRequestTiming(t){let n=null==t?void 0:t.finish();return n?{resourceTiming:JSON.parse(JSON.stringify(n))}:{}}_getOverzoomTile(t,n){let{tileID:i,source:r,overzoomParameters:o}=t,{maxZoomTileID:a}=o,s=`${a.key}_${i.key}`,l=this.overzoomedTileResultCache.get(s);if(l)return l;let h=new c,p=this.layerIndex.familiesBySource[r];for(let t in p){let r=n.layers[t];if(!r)continue;let o=d(r,a,i.canonical);o.length>0&&h.addLayer(o)}let f=u(h);return this.overzoomedTileResultCache.set(s,f),f}reloadTile(n){return t._(this,void 0,void 0,function*(){let t=n.uid,i=this.tileState.getLoaded(t);if(!i)throw Error("Should not be trying to reload a tile that was never loaded or has been removed");if(i.showCollisionBoxes=n.showCollisionBoxes,"parsing"===i.status){let r=this.tileState.consumeParsing(t);return yield this._parseWorkerTile(i,n,r)}if("done"===i.status&&i.vectorTile)return yield this._parseWorkerTile(i,n)})}abortTile(n){return t._(this,void 0,void 0,function*(){this.tileState.abort(n.uid)})}removeTile(n){return t._(this,void 0,void 0,function*(){this.tileState.removeLoaded(n.uid)})}}class p{constructor(){this.loaded={}}loadTile(n){return t._(this,void 0,void 0,function*(){let{uid:i,encoding:r,rawImageData:o,redFactor:a,greenFactor:s,blueFactor:l,baseShift:c}=n,u=o.width+2,d=o.height+2,h=t.b(o)?new t.R({width:u,height:d},(yield t.d0(o,-1,-1,u,d))):o,p=new t.d1(i,h,r,a,s,l,c);return this.loaded=this.loaded||{},this.loaded[i]=p,p})}removeTile(t){let n=this.loaded,i=t.uid;n&&n[i]&&delete n[i]}}var f,m,g,v=function(){if(g)return m;function t(t,i){if(0!==t.length){n(t[0],i);for(var r=1;r<t.length;r++)n(t[r],!i)}}function n(t,n){for(var i=0,r=0,o=0,a=t.length,s=a-1;o<a;s=o++){var l=(t[o][0]-t[s][0])*(t[s][1]+t[o][1]),c=i+l;r+=Math.abs(i)>=Math.abs(l)?i-c+l:l-c+i,i=c}i+r>=0!=!!n&&t.reverse()}return g=1,m=function n(i,r){var o,a=i&&i.type;if("FeatureCollection"===a)for(o=0;o<i.features.length;o++)n(i.features[o],r);else if("GeometryCollection"===a)for(o=0;o<i.geometries.length;o++)n(i.geometries[o],r);else if("Feature"===a)n(i.geometry,r);else if("Polygon"===a)t(i.coordinates,r);else if("MultiPolygon"===a)for(o=0;o<i.coordinates.length;o++)t(i.coordinates[o],r);return i}}(),b=t.d2(v);let y={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},_=Math.fround||(f=new Float32Array(1),t=>(f[0]=+t,f[0]));class x{constructor(t){this.options=Object.assign(Object.create(y),t),this.trees=Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){let{log:n,minZoom:i,maxZoom:r}=this.options;n&&console.time("total time");let o=`prepare ${t.length} points`;n&&console.time(o),this.points=t;let a=[];for(let n=0;n<t.length;n++){let i=t[n];if(!i.geometry)continue;let[r,o]=i.geometry.coordinates,s=_(C(r)),l=_(A(o));a.push(s,l,1/0,n,-1,1),this.options.reduce&&a.push(0)}let s=this.trees[r+1]=this._createTree(a);n&&console.timeEnd(o);for(let t=r;t>=i;t--){let i=+Date.now();s=this.trees[t]=this._createTree(this._cluster(s,t)),n&&console.log("z%d: %d clusters in %dms",t,s.numItems,Date.now()-i)}return n&&console.timeEnd("total time"),this}getClusters(t,n){let i=((t[0]+180)%360+360)%360-180,r=Math.max(-90,Math.min(90,t[1])),o=180===t[2]?180:((t[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)i=-180,o=180;else if(i>o){let t=this.getClusters([i,r,180,a],n),s=this.getClusters([-180,r,o,a],n);return t.concat(s)}let s=this.trees[this._limitZoom(n)],l=s.range(C(i),A(a),C(o),A(r)),c=s.data,u=[];for(let t of l){let n=this.stride*t;u.push(c[n+5]>1?w(c,n,this.clusterProps):this.points[c[n+3]])}return u}getChildren(t){let n=this._getOriginId(t),i=this._getOriginZoom(t),r="No cluster with the specified id.",o=this.trees[i];if(!o)throw Error(r);let a=o.data;if(n*this.stride>=a.length)throw Error(r);let s=this.options.radius/(this.options.extent*Math.pow(2,i-1)),l=o.within(a[n*this.stride],a[n*this.stride+1],s),c=[];for(let n of l){let i=n*this.stride;a[i+4]===t&&c.push(a[i+5]>1?w(a,i,this.clusterProps):this.points[a[i+3]])}if(0===c.length)throw Error(r);return c}getLeaves(t,n,i){let r=[];return this._appendLeaves(r,t,n=n||10,i=i||0,0),r}getTile(t,n,i){let r=this.trees[this._limitZoom(t)],o=Math.pow(2,t),{extent:a,radius:s}=this.options,l=s/a,c=(i-l)/o,u=(i+1+l)/o,d={features:[]};return this._addTileFeatures(r.range((n-l)/o,c,(n+1+l)/o,u),r.data,n,i,o,d),0===n&&this._addTileFeatures(r.range(1-l/o,c,1,u),r.data,o,i,o,d),n===o-1&&this._addTileFeatures(r.range(0,c,l/o,u),r.data,-1,i,o,d),d.features.length?d:null}getClusterExpansionZoom(t){let n=this._getOriginZoom(t)-1;for(;n<=this.options.maxZoom;){let i=this.getChildren(t);if(n++,1!==i.length)break;t=i[0].properties.cluster_id}return n}_appendLeaves(t,n,i,r,o){for(let a of this.getChildren(n)){let n=a.properties;if(n&&n.cluster?o+n.point_count<=r?o+=n.point_count:o=this._appendLeaves(t,n.cluster_id,i,r,o):o<r?o++:t.push(a),t.length===i)break}return o}_createTree(n){let i=new t.aT(n.length/this.stride|0,this.options.nodeSize,Float32Array);for(let t=0;t<n.length;t+=this.stride)i.add(n[t],n[t+1]);return i.finish(),i.data=n,i}_addTileFeatures(t,n,i,r,o,a){for(let s of t){let t,l,c,u,d=s*this.stride,h=n[d+5]>1;if(h)t=k(n,d,this.clusterProps),l=n[d],c=n[d+1];else{let i=this.points[n[d+3]];t=i.properties;let[r,o]=i.geometry.coordinates;l=C(r),c=A(o)}let p={type:1,geometry:[[Math.round(this.options.extent*(l*o-i)),Math.round(this.options.extent*(c*o-r))]],tags:t};void 0!==(u=h||this.options.generateId?n[d+3]:this.points[n[d+3]].id)&&(p.id=u),a.features.push(p)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,n){let{radius:i,extent:r,reduce:o,minPoints:a}=this.options,s=i/(r*Math.pow(2,n)),l=t.data,c=[],u=this.stride;for(let i=0;i<l.length;i+=u){if(l[i+2]<=n)continue;l[i+2]=n;let r=l[i],d=l[i+1],h=t.within(l[i],l[i+1],s),p=l[i+5],f=p;for(let t of h){let i=t*u;l[i+2]>n&&(f+=l[i+5])}if(f>p&&f>=a){let t,a=r*p,s=d*p,m=-1,g=(i/u<<5)+(n+1)+this.points.length;for(let r of h){let c=r*u;if(l[c+2]<=n)continue;l[c+2]=n;let d=l[c+5];a+=l[c]*d,s+=l[c+1]*d,l[c+4]=g,o&&(t||(t=this._map(l,i,!0),m=this.clusterProps.length,this.clusterProps.push(t)),o(t,this._map(l,c)))}l[i+4]=g,c.push(a/f,s/f,1/0,g,-1,f),o&&c.push(m)}else{for(let t=0;t<u;t++)c.push(l[i+t]);if(f>1)for(let t of h){let i=t*u;if(!(l[i+2]<=n)){l[i+2]=n;for(let t=0;t<u;t++)c.push(l[i+t])}}}}return c}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,n,i){if(t[n+5]>1){let r=this.clusterProps[t[n+6]];return i?Object.assign({},r):r}let r=this.points[t[n+3]].properties,o=this.options.map(r);return i&&o===r?Object.assign({},o):o}}function w(t,n,i){return{type:"Feature",id:t[n+3],properties:k(t,n,i),geometry:{type:"Point",coordinates:[360*(t[n]-.5),E(t[n+1])]}}}function k(t,n,i){let r=t[n+5],o=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?Math.round(r/100)/10+"k":r,a=t[n+6];return Object.assign(-1===a?{}:Object.assign({},i[a]),{cluster:!0,cluster_id:t[n+3],point_count:r,point_count_abbreviated:o})}function C(t){return t/360+.5}function A(t){let n=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+n)/(1-n))/Math.PI;return i<0?0:i>1?1:i}function E(t){return 360*Math.atan(Math.exp((180-360*t)*Math.PI/180))/Math.PI-90}function S(t,n,i,r){let o=r,a=n+(i-n>>1),s,l=i-n,c=t[n],u=t[n+1],d=t[i],h=t[i+1];for(let r=n+3;r<i;r+=3){let n=T(t[r],t[r+1],c,u,d,h);if(n>o)s=r,o=n;else if(n===o){let t=Math.abs(r-a);t<l&&(s=r,l=t)}}o>r&&(s-n>3&&S(t,n,s,r),t[s+2]=o,i-s>3&&S(t,s,i,r))}function T(t,n,i,r,o,a){let s=o-i,l=a-r;if(0!==s||0!==l){let c=((t-i)*s+(n-r)*l)/(s*s+l*l);c>1?(i=o,r=a):c>0&&(i+=s*c,r+=l*c)}return(s=t-i)*s+(l=n-r)*l}function O(t,n,i,r){let o=n,a=i,s={id:null==t?null:t,type:o,geometry:a,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};switch(o){case"Point":case"MultiPoint":case"LineString":F(s,a);break;case"Polygon":F(s,a[0]);break;case"MultiLineString":for(let t of a)F(s,t);break;case"MultiPolygon":for(let t of a)F(s,t[0])}return s}function F(t,n){for(let i=0;i<n.length;i+=3)t.minX=Math.min(t.minX,n[i]),t.minY=Math.min(t.minY,n[i+1]),t.maxX=Math.max(t.maxX,n[i]),t.maxY=Math.max(t.maxY,n[i+1])}function M(t,n){let i=[];switch(t.type){case"FeatureCollection":for(let r=0;r<t.features.length;r++)I(i,t.features[r],n,r);break;case"Feature":I(i,t,n);break;default:I(i,{geometry:t,properties:void 0},n)}return i}function I(t,n,i,r){if(!n.geometry)return;if("GeometryCollection"===n.geometry.type){for(let o of n.geometry.geometries)I(t,{id:n.id,geometry:o,properties:n.properties},i,r);return}let o=n.geometry.coordinates;if(!o?.length)return;let a=Math.pow(i.tolerance/((1<<i.maxZoom)*i.extent),2),s=n.id;switch(i.promoteId?s=n.properties?.[i.promoteId]:i.generateId&&(s=r||0),n.geometry.type){case"Point":{let i=[];return R(n.geometry.coordinates,i),void t.push(O(s,n.geometry.type,i,n.properties))}case"MultiPoint":{let i=[];for(let t of n.geometry.coordinates)R(t,i);return void t.push(O(s,n.geometry.type,i,n.properties))}case"LineString":{let i=[];return D(n.geometry.coordinates,i,a,!1),void t.push(O(s,n.geometry.type,i,n.properties))}case"MultiLineString":{if(i.lineMetrics){for(let i of n.geometry.coordinates){let r=[];D(i,r,a,!1),t.push(O(s,"LineString",r,n.properties))}return}let r=[];return P(n.geometry.coordinates,r,a,!1),void t.push(O(s,n.geometry.type,r,n.properties))}case"Polygon":{let i=[];return P(n.geometry.coordinates,i,a,!0),void t.push(O(s,n.geometry.type,i,n.properties))}case"MultiPolygon":{let i=[];for(let t of n.geometry.coordinates){let n=[];P(t,n,a,!0),i.push(n)}return void t.push(O(s,n.geometry.type,i,n.properties))}default:throw Error("Input data is not a valid GeoJSON object.")}}function R(t,n){n.push(L(t[0]),N(t[1]),0)}function D(t,n,i,r){let o,a,s=0;for(let i=0;i<t.length;i++){let l=L(t[i][0]),c=N(t[i][1]);n.push(l,c,0),i>0&&(s+=r?(o*c-l*a)/2:Math.sqrt(Math.pow(l-o,2)+Math.pow(c-a,2))),o=l,a=c}let l=n.length-3;n[2]=1,i>0&&S(n,0,l,i),n[l+2]=1,n.size=Math.abs(s),n.start=0,n.end=n.size}function P(t,n,i,r){for(let o=0;o<t.length;o++){let a=[];D(t[o],a,i,r),n.push(a)}}function L(t){return t/360+.5}function N(t){let n=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+n)/(1-n))/Math.PI;return i<0?0:i>1?1:i}function z(t,n,i,r,o,a,s,l){if(r/=n,a>=(i/=n)&&s<r)return t;if(s<i||a>=r)return null;let c=[];for(let n of t){let t=0===o?n.minX:n.minY,a=0===o?n.maxX:n.maxY;if(t>=i&&a<r)c.push(n);else if(!(a<i||t>=r))switch(n.type){case"Point":case"MultiPoint":{let t=[];if(j(n.geometry,t,i,r,o),!t.length)continue;c.push(O(n.id,3===t.length?"Point":"MultiPoint",t,n.tags));continue}case"LineString":{let t=[];if(B(n.geometry,t,i,r,o,!1,l.lineMetrics),!t.length)continue;if(l.lineMetrics){for(let i of t)c.push(O(n.id,n.type,i,n.tags));continue}if(t.length>1){c.push(O(n.id,"MultiLineString",t,n.tags));continue}c.push(O(n.id,n.type,t[0],n.tags));continue}case"MultiLineString":{let t=[];if(V(n.geometry,t,i,r,o,!1),!t.length)continue;if(1===t.length){c.push(O(n.id,"LineString",t[0],n.tags));continue}c.push(O(n.id,n.type,t,n.tags));continue}case"Polygon":{let t=[];if(V(n.geometry,t,i,r,o,!0),!t.length)continue;c.push(O(n.id,n.type,t,n.tags));continue}case"MultiPolygon":{let t=[];for(let a of n.geometry){let n=[];V(a,n,i,r,o,!0),n.length&&t.push(n)}if(!t.length)continue;c.push(O(n.id,n.type,t,n.tags));continue}}}return c.length?c:null}function j(t,n,i,r,o){for(let a=0;a<t.length;a+=3){let s=t[a+o];s>=i&&s<=r&&H(n,t[a],t[a+1],t[a+2])}}function B(t,n,i,r,o,a,s){let l=U(t),c=0===o?q:W,u,d,h=t.start;for(let p=0;p<t.length-3;p+=3){let f=t[p],m=t[p+1],g=t[p+2],v=t[p+3],b=t[p+4],y=0===o?f:m,_=0===o?v:b,x=!1;s&&(u=Math.sqrt(Math.pow(f-v,2)+Math.pow(m-b,2))),y<i?_>i&&(d=c(l,f,m,v,b,i),s&&(l.start=h+u*d)):y>r?_<r&&(d=c(l,f,m,v,b,r),s&&(l.start=h+u*d)):H(l,f,m,g),_<i&&y>=i&&(d=c(l,f,m,v,b,i),x=!0),_>r&&y<=r&&(d=c(l,f,m,v,b,r),x=!0),!a&&x&&(s&&(l.end=h+u*d),n.push(l),l=U(t)),s&&(h+=u)}let p=t.length-3,f=t[p],m=t[p+1],g=0===o?f:m;g>=i&&g<=r&&H(l,f,m,t[p+2]),p=l.length-3,a&&p>=3&&(l[p]!==l[0]||l[p+1]!==l[1])&&H(l,l[0],l[1],l[2]),l.length&&n.push(l)}function U(t){let n=[];return n.size=t.size,n.start=t.start,n.end=t.end,n}function V(t,n,i,r,o,a){for(let s of t)B(s,n,i,r,o,a,!1)}function H(t,n,i,r){t.push(n,i,r)}function q(t,n,i,r,o,a){let s=(a-n)/(r-n);return H(t,a,i+(o-i)*s,1),s}function W(t,n,i,r,o,a){let s=(a-i)/(o-i);return H(t,n+(r-n)*s,a,1),s}function G(t,n){let i=n.buffer/n.extent,r=t,o=z(t,1,-1-i,i,0,-1,2,n),a=z(t,1,1-i,2+i,0,-1,2,n);return(o||a)&&(r=z(t,1,-i,1+i,0,-1,2,n)||[],o&&(r=Y(o,1).concat(r)),a&&(r=r.concat(Y(a,-1)))),r}function Y(t,n){let i=[];for(let r of t)switch(r.type){case"Point":case"MultiPoint":case"LineString":{let t=Z(r.geometry,n);i.push(O(r.id,r.type,t,r.tags));continue}case"MultiLineString":case"Polygon":{let t=[];for(let i of r.geometry)t.push(Z(i,n));i.push(O(r.id,r.type,t,r.tags));continue}case"MultiPolygon":{let t=[];for(let i of r.geometry){let r=[];for(let t of i)r.push(Z(t,n));t.push(r)}i.push(O(r.id,r.type,t,r.tags));continue}}return i}function Z(t,n){let i=[];i.size=t.size,void 0!==t.start&&(i.start=t.start,i.end=t.end);for(let r=0;r<t.length;r+=3)i.push(t[r]+n,t[r+1],t[r+2]);return i}function X(t,n){if(t.transformed)return t;let i=1<<t.z,r=t.x,o=t.y;for(let a of t.features){if(1===a.type){let t=[];for(let s=0;s<a.geometry.length;s+=2)t.push(K(a.geometry[s],a.geometry[s+1],n,i,r,o));a.geometry=t;continue}let t=[];for(let s of a.geometry){let a=[];for(let t=0;t<s.length;t+=2)a.push(K(s[t],s[t+1],n,i,r,o));t.push(a)}a.geometry=t}return t.transformed=!0,t}function K(t,n,i,r,o,a){return[Math.round(i*(t*r-o)),Math.round(i*(n*r-a))]}function J(t,n,i,r,o){let a=n===o.maxZoom?0:o.tolerance/((1<<n)*o.extent),s={features:[],numPoints:0,numSimplified:0,numFeatures:t.length,source:null,x:i,y:r,z:n,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(let n of t)Q(s,n,a,o);return s}function Q(t,n,i,r){t.minX=Math.min(t.minX,n.minX),t.minY=Math.min(t.minY,n.minY),t.maxX=Math.max(t.maxX,n.maxX),t.maxY=Math.max(t.maxY,n.maxY);let o,a=n.tags||null;switch(n.type){case"Point":case"MultiPoint":{let i=[];for(let r=0;r<n.geometry.length;r+=3)i.push(n.geometry[r],n.geometry[r+1]),t.numPoints++,t.numSimplified++;if(!i.length)return;o={type:1,tags:a,geometry:i};break}case"LineString":{let s=[];if(ee(s,n.geometry,t,i,!1,!1),!s.length)return;if(r.lineMetrics){for(let t in a={},n.tags)a[t]=n.tags[t];a.mapbox_clip_start=n.geometry.start/n.geometry.size,a.mapbox_clip_end=n.geometry.end/n.geometry.size}o={type:2,tags:a,geometry:s};break}case"MultiLineString":case"Polygon":{let r=[];for(let o=0;o<n.geometry.length;o++)ee(r,n.geometry[o],t,i,"Polygon"===n.type,0===o);if(!r.length)return;o={type:"Polygon"===n.type?3:2,tags:a,geometry:r};break}case"MultiPolygon":{let r=[];for(let o=0;o<n.geometry.length;o++){let a=n.geometry[o];for(let n=0;n<a.length;n++)ee(r,a[n],t,i,!0,0===n)}if(!r.length)return;o={type:3,tags:a,geometry:r}}}null!==n.id&&(o.id=n.id),t.features.push(o)}function ee(t,n,i,r,o,a){let s=r*r;if(r>0&&n.size<(o?s:r))return void(i.numPoints+=n.length/3);let l=[];for(let t=0;t<n.length;t+=3)(0===r||n[t+2]>s)&&(i.numSimplified++,l.push(n[t],n[t+1])),i.numPoints++;o&&function(t,n){let i=0;for(let n=0,r=t.length,o=r-2;n<r;o=n,n+=2)i+=(t[n]-t[o])*(t[n+1]+t[o+1]);if(i>0===n)for(let n=0,i=t.length;n<i/2;n+=2){let r=t[n],o=t[n+1];t[n]=t[i-2-n],t[n+1]=t[i-1-n],t[i-2-n]=r,t[i-1-n]=o}}(l,a),t.push(l)}function et(t,n,i){let r=!!n.newGeometry,o=n.removeAllProperties||n.removeProperties?.length>0||n.addOrUpdateProperties?.length>0;if(r){let r=M({type:"FeatureCollection",features:[{type:"Feature",id:t.id,geometry:n.newGeometry,properties:o?en(t.tags,n):t.tags}]},i);return(r=G(r,i))[0]}if(o){let i={...t};return i.tags=en(i.tags,n),i}return null}function en(t,n){if(n.removeAllProperties)return{};let i={...t||{}};if(n.removeProperties)for(let t of n.removeProperties)delete i[t];if(n.addOrUpdateProperties)for(let{key:t,value:r}of n.addOrUpdateProperties)i[t]=r;return i}let ei={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,updateable:!1,debug:0};class er{options;tiles;tileCoords;stats={};total=0;source;constructor(t,n){const i=(n=this.options=Object.assign({},ei,n)).debug;if(i&&console.time("preprocess data"),n.maxZoom<0||n.maxZoom>24)throw Error("maxZoom should be in the 0-24 range");if(n.promoteId&&n.generateId)throw Error("promoteId and generateId cannot be used together.");let r=M(t,n);this.tiles={},this.tileCoords=[],i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",n.indexMaxZoom,n.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(r=G(r,n)).length&&this.splitTile(r,0,0,0),n.updateable&&(this.source=r),i&&(r.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(t,n,i,r,o,a,s){let l=[t,n,i,r],c=this.options,u=c.debug;for(;l.length;){r=l.pop(),i=l.pop(),n=l.pop(),t=l.pop();let d=1<<n,h=eo(n,i,r),p=this.tiles[h];if(!p&&(u>1&&console.time("creation"),p=this.tiles[h]=J(t,n,i,r,c),this.tileCoords.push({z:n,x:i,y:r,id:h}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",n,i,r,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));let t=`z${n}`;this.stats[t]=(this.stats[t]||0)+1,this.total++}if(p.source=t,null==o){if(n===c.indexMaxZoom||p.numPoints<=c.indexMaxPoints)continue}else{if(n===c.maxZoom||n===o)continue;if(null!=o){let t=o-n;if(i!==a>>t||r!==s>>t)continue}}if(p.source=null,!t.length)continue;u>1&&console.time("clipping");let f=.5*c.buffer/c.extent,m=.5-f,g=.5+f,v=1+f,b=null,y=null,_=null,x=null,w=z(t,d,i-f,i+g,0,p.minX,p.maxX,c),k=z(t,d,i+m,i+v,0,p.minX,p.maxX,c);w&&(b=z(w,d,r-f,r+g,1,p.minY,p.maxY,c),y=z(w,d,r+m,r+v,1,p.minY,p.maxY,c)),k&&(_=z(k,d,r-f,r+g,1,p.minY,p.maxY,c),x=z(k,d,r+m,r+v,1,p.minY,p.maxY,c)),u>1&&console.timeEnd("clipping"),l.push(b||[],n+1,2*i,2*r),l.push(y||[],n+1,2*i,2*r+1),l.push(_||[],n+1,2*i+1,2*r),l.push(x||[],n+1,2*i+1,2*r+1)}}getTile(t,n,i){t*=1,n*=1,i*=1;let{extent:r,debug:o}=this.options;if(t<0||t>24)return null;let a=1<<t,s=eo(t,n=n+a&a-1,i);if(this.tiles[s])return X(this.tiles[s],r);o>1&&console.log("drilling down to z%d-%d-%d",t,n,i);let l,c=t,u=n,d=i;for(;!l&&c>0;)c--,u>>=1,d>>=1,l=this.tiles[eo(c,u,d)];return l?.source?(o>1&&(console.log("found parent tile z%d-%d-%d",c,u,d),console.time("drilling down")),this.splitTile(l.source,c,u,d,t,n,i),o>1&&console.timeEnd("drilling down"),this.tiles[s]?X(this.tiles[s],r):null):null}invalidateTiles(t){let n=this.options,{debug:i}=n,r=1/0,o=-1/0,a=1/0,s=-1/0;for(let n of t)r=Math.min(r,n.minX),o=Math.max(o,n.maxX),a=Math.min(a,n.minY),s=Math.max(s,n.maxY);let l=n.buffer/n.extent,c=new Set;for(let n in this.tiles){let u=this.tiles[n],d=1<<u.z,h=(u.x-l)/d,p=(u.x+1+l)/d,f=(u.y-l)/d,m=(u.y+1+l)/d;if(o<h||r>=p||s<f||a>=m)continue;let g=!1;for(let n of t)if(n.maxX>=h&&n.minX<p&&n.maxY>=f&&n.minY<m){g=!0;break}if(g){if(i){i>1&&console.log("invalidate tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",u.z,u.x,u.y,u.numFeatures,u.numPoints,u.numSimplified);let t=`z${u.z}`;this.stats[t]=(this.stats[t]||0)-1,this.total--}delete this.tiles[n],c.add(n)}}c.size&&(this.tileCoords=this.tileCoords.filter(t=>!c.has(t.id)))}updateData(t){let n=this.options,i=n.debug;if(!n.updateable)throw Error("to update tile geojson `updateable` option must be set to true");let{affected:r,source:o}=function(t,n,i){let r=function(t){return t?{removeAll:t.removeAll,remove:new Set(t.remove||[]),add:new Map(t.add?.map(t=>[t.id,t])),update:new Map(t.update?.map(t=>[t.id,t]))}:{remove:new Set,add:new Map,update:new Map}}(n),o=[];if(r.removeAll&&(o=t,t=[]),r.remove.size||r.add.size){let n=[];for(let i of t){let{id:t}=i;(r.remove.has(t)||r.add.has(t))&&n.push(i)}if(n.length){o.push(...n);let i=new Set(n.map(t=>t.id));t=t.filter(t=>!i.has(t.id))}if(r.add.size){let n=M({type:"FeatureCollection",features:Array.from(r.add.values())},i);n=G(n,i),o.push(...n),t.push(...n)}}if(r.update.size)for(let[n,a]of r.update){let r=t.findIndex(t=>t.id===n);if(-1===r)continue;let s=t[r],l=et(s,a,i);l&&(o.push(s,l),t[r]=l)}return{affected:o,source:t}}(this.source,t,n);if(!r.length)return;this.source=o,i>1&&(console.log("invalidating tiles"),console.time("invalidating")),this.invalidateTiles(r),i>1&&console.timeEnd("invalidating");let[a,s,l]=[0,0,0],c=J(this.source,a,s,l,this.options);c.source=this.source;let u=eo(a,s,l);if(this.tiles[u]=c,this.tileCoords.push({z:a,x:s,y:l,id:u}),i){let t=`z${a}`;this.stats[t]=(this.stats[t]||0)+1,this.total++}}}function eo(t,n,i){return 32*((1<<t)*i+n)+t}class ea{constructor(t,n,i,r=es){this._dataUpdateable=new Map,this.actor=t,this.layerIndex=n,this.availableImages=i,this.tileState=new a,this._createGeoJSONIndex=r}loadVectorTile(n){if(!this._geoJSONIndex)throw Error("Unable to parse the data into a cluster or geojson");let{z:i,x:r,y:o}=n.tileID.canonical,a=this._geoJSONIndex.getTile(i,r,o);return a?u(new t.d3(a.features,{version:2,extent:t.a5})):null}loadTile(n){return t._(this,void 0,void 0,function*(){let{uid:t}=n,i=new r(n);i.abort=new AbortController;try{let r=this.loadVectorTile(n);if(!r)return null;let{vectorTile:o,rawData:a}=r;i.vectorTile=o,this.tileState.markLoaded(t,i);let s={rawData:a};this.tileState.setParsing(t,s);try{return yield this._parseWorkerTile(i,n,s)}finally{this.tileState.clearParsing(t)}}catch(n){throw i.status="done",this.tileState.markLoaded(t,i),n}})}_reloadLoadedTile(n){return t._(this,void 0,void 0,function*(){let t=n.uid,i=this.tileState.getLoaded(t);if(!i)throw Error("Should not be trying to reload a tile that was never loaded or has been removed");if(i.showCollisionBoxes=n.showCollisionBoxes,"parsing"===i.status){let r=this.tileState.consumeParsing(t);return yield this._parseWorkerTile(i,n,r)}if("done"===i.status&&i.vectorTile)return yield this._parseWorkerTile(i,n)})}_parseWorkerTile(n,i,r){return t._(this,void 0,void 0,function*(){let o=yield n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor,i.subdivisionGranularity);if(r){let{rawData:n}=r;o=t.e({rawTileData:n.slice(0)},o)}return o})}abortTile(n){return t._(this,void 0,void 0,function*(){this.tileState.abort(n.uid)})}removeTile(n){return t._(this,void 0,void 0,function*(){this.tileState.removeLoaded(n.uid)})}loadData(n){return t._(this,void 0,void 0,function*(){var i;null==(i=this._pendingRequest)||i.abort();let r=this._startRequestTiming(n);this._pendingRequest=new AbortController;try{(!this._pendingData||n.request||n.data||n.dataDiff)&&(this._pendingData=this.loadAndProcessGeoJSON(n,this._pendingRequest));let t=yield this._pendingData;this._geoJSONIndex=this._createGeoJSONIndex(t,n),this.tileState.clearLoaded();let i={};return n.request&&(i.data=t),this._finishRequestTiming(r,n,i),i}catch(n){if(delete this._pendingRequest,t.Z(n))return{abandoned:!0};throw n}})}_startRequestTiming(n){var i;if(null==(i=n.request)?void 0:i.collectResourceTiming)return new t.c$(n.request.url)}_finishRequestTiming(t,n,i){let r=null==t?void 0:t.finish();r&&(i.resourceTiming={[n.source]:JSON.parse(JSON.stringify(r))})}getData(){return t._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(t){return this.tileState.getLoaded(t.uid)?this._reloadLoadedTile(t):this.loadTile(t)}loadAndProcessGeoJSON(n,i){return t._(this,void 0,void 0,function*(){let t;if(n.request?t=yield this.loadGeoJSONFromUrl(n.request,n.promoteId,i):n.data?t=this._loadGeoJSONFromObject(n.data,n.promoteId):n.dataDiff&&(t=this._loadGeoJSONFromDiff(n.dataDiff,n.promoteId,n.source)),delete this._pendingRequest,"object"!=typeof t)throw Error(`Input data given to '${n.source}' is not a valid GeoJSON object.`);return b(t,!0),n.filter&&(t=this._filterGeoJSON(t,n.filter)),t})}loadGeoJSONFromUrl(n,i,r){return t._(this,void 0,void 0,function*(){let o=yield t.j(n,r);return this._dataUpdateable=t.a7(o.data,i),o.data})}_loadGeoJSONFromObject(n,i){return this._dataUpdateable=t.a7(n,i),n}_loadGeoJSONFromDiff(n,i,r){if(!this._dataUpdateable)throw Error(`Cannot update existing geojson data in ${r}`);t.a8(this._dataUpdateable,n,i);let o=Array.from(this._dataUpdateable.values());return this._toFeatureCollection(o)}_filterGeoJSON(n,i){let r=t.d4(i,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===r.result)throw Error(r.value.map(t=>`${t.key}: ${t.message}`).join(", "));let o=n.features.filter(t=>r.value.evaluate({zoom:0},t));return this._toFeatureCollection(o)}_toFeatureCollection(t){return{type:"FeatureCollection",features:t}}removeSource(n){return t._(this,void 0,void 0,function*(){var t;null==(t=this._pendingRequest)||t.abort()})}getClusterExpansionZoom(t){return this._geoJSONIndex.getClusterExpansionZoom(t.clusterId)}getClusterChildren(t){return this._geoJSONIndex.getChildren(t.clusterId)}getClusterLeaves(t){return this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset)}}function es(n,i){return i.cluster?new x(function({superclusterOptions:n,clusterProperties:i}){if(!i||!n)return n;let r={},o={},a={accumulated:null,zoom:0},s={properties:null},l=Object.keys(i);for(let n of l){let[a,s]=i[n],l=t.d4(s),c=t.d4("string"==typeof a?[a,["accumulated"],["get",n]]:a);r[n]=l.value,o[n]=c.value}return n.map=t=>{s.properties=t;let n={};for(let t of l)n[t]=r[t].evaluate(a,s);return n},n.reduce=(t,n)=>{for(let i of(s.properties=n,l))a.accumulated=t[i],t[i]=o[i].evaluate(a,s)},n}(i)).load(n.features):function(t,n){return new er(t,n)}(n,i.geojsonVtOptions)}class el{constructor(n){this.self=n,this.actor=new t.L(n),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.globalStates=new Map,this.self.registerWorkerSource=(t,n)=>{if(this.externalWorkerSourceTypes[t])throw Error(`Worker source with name "${t}" already registered.`);this.externalWorkerSourceTypes[t]=n},this.self.addProtocol=t.cK,this.self.removeProtocol=t.cL,this.self.registerRTLTextPlugin=n=>{t.d5.setMethods(n)},this.actor.registerMessageHandler("LDT",(t,n)=>this._getDEMWorkerSource(t,n.source).loadTile(n)),this.actor.registerMessageHandler("RDT",(n,i)=>t._(this,void 0,void 0,function*(){this._getDEMWorkerSource(n,i.source).removeTile(i)})),this.actor.registerMessageHandler("GCEZ",(n,i)=>t._(this,void 0,void 0,function*(){return this._getWorkerSource(n,i.type,i.source).getClusterExpansionZoom(i)})),this.actor.registerMessageHandler("GCC",(n,i)=>t._(this,void 0,void 0,function*(){return this._getWorkerSource(n,i.type,i.source).getClusterChildren(i)})),this.actor.registerMessageHandler("GCL",(n,i)=>t._(this,void 0,void 0,function*(){return this._getWorkerSource(n,i.type,i.source).getClusterLeaves(i)})),this.actor.registerMessageHandler("LD",(t,n)=>this._getWorkerSource(t,n.type,n.source).loadData(n)),this.actor.registerMessageHandler("GD",(t,n)=>this._getWorkerSource(t,n.type,n.source).getData()),this.actor.registerMessageHandler("LT",(t,n)=>this._getWorkerSource(t,n.type,n.source).loadTile(n)),this.actor.registerMessageHandler("RT",(t,n)=>this._getWorkerSource(t,n.type,n.source).reloadTile(n)),this.actor.registerMessageHandler("AT",(t,n)=>this._getWorkerSource(t,n.type,n.source).abortTile(n)),this.actor.registerMessageHandler("RMT",(t,n)=>this._getWorkerSource(t,n.type,n.source).removeTile(n)),this.actor.registerMessageHandler("RS",(n,i)=>t._(this,void 0,void 0,function*(){if(!this.workerSources[n]||!this.workerSources[n][i.type]||!this.workerSources[n][i.type][i.source])return;let t=this.workerSources[n][i.type][i.source];delete this.workerSources[n][i.type][i.source],void 0!==t.removeSource&&t.removeSource(i)})),this.actor.registerMessageHandler("RM",n=>t._(this,void 0,void 0,function*(){delete this.layerIndexes[n],delete this.availableImages[n],delete this.workerSources[n],delete this.demWorkerSources[n],this.globalStates.delete(n)})),this.actor.registerMessageHandler("SR",(n,i)=>t._(this,void 0,void 0,function*(){this.referrer=i})),this.actor.registerMessageHandler("SRPS",(t,n)=>this._syncRTLPluginState(t,n)),this.actor.registerMessageHandler("IS",(n,i)=>t._(this,void 0,void 0,function*(){this.self.importScripts(i)})),this.actor.registerMessageHandler("SI",(t,n)=>this._setImages(t,n)),this.actor.registerMessageHandler("UL",(n,i)=>t._(this,void 0,void 0,function*(){this._getLayerIndex(n).update(i.layers,i.removedIds,this._getGlobalState(n))})),this.actor.registerMessageHandler("UGS",(n,i)=>t._(this,void 0,void 0,function*(){let t=this._getGlobalState(n);for(let n in i)t[n]=i[n]})),this.actor.registerMessageHandler("SL",(n,i)=>t._(this,void 0,void 0,function*(){this._getLayerIndex(n).replace(i,this._getGlobalState(n))}))}_getGlobalState(t){let n=this.globalStates.get(t);return n||(n={},this.globalStates.set(t,n)),n}_setImages(n,i){return t._(this,void 0,void 0,function*(){for(let t in this.availableImages[n]=i,this.workerSources[n]){let r=this.workerSources[n][t];for(let t in r)r[t].availableImages=i}})}_syncRTLPluginState(n,i){return t._(this,void 0,void 0,function*(){return yield t.d5.syncState(i,this.self.importScripts)})}_getAvailableImages(t){let n=this.availableImages[t];return n||(n=[]),n}_getLayerIndex(t){let i=this.layerIndexes[t];return i||(i=this.layerIndexes[t]=new n),i}_getWorkerSource(t,n,i){if(this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][n]||(this.workerSources[t][n]={}),!this.workerSources[t][n][i]){let r={sendAsync:(n,i)=>(n.targetMapId=t,this.actor.sendAsync(n,i))};switch(n){case"vector":this.workerSources[t][n][i]=new h(r,this._getLayerIndex(t),this._getAvailableImages(t));break;case"geojson":this.workerSources[t][n][i]=new ea(r,this._getLayerIndex(t),this._getAvailableImages(t));break;default:this.workerSources[t][n][i]=new this.externalWorkerSourceTypes[n](r,this._getLayerIndex(t),this._getAvailableImages(t))}}return this.workerSources[t][n][i]}_getDEMWorkerSource(t,n){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][n]||(this.demWorkerSources[t][n]=new p),this.demWorkerSources[t][n]}}return t.i(self)&&(self.worker=new el(self)),el}),i("index",["exports","./shared"],function(t,n){let i,r,o,a,s,l,c,u;var d,h,p,f="5.19.0";function m(){var t=new n.A(4);return n.A!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}let g={frame(t,i,r,o){let a=o||window,s=a.requestAnimationFrame(t=>{l(),i(t)}),{unsubscribe:l}=n.s(t.signal,"abort",()=>{l(),a.cancelAnimationFrame(s),r(new n.a(t.signal.reason))},!1)},frameAsync(t,n){return new Promise((i,r)=>{this.frame(t,i,r,n)})},getImageData(t,n=0){return this.getImageCanvasContext(t).getImageData(-n,-n,t.width+2*n,t.height+2*n)},getImageCanvasContext(t){let n=window.document.createElement("canvas"),i=n.getContext("2d",{willReadFrequently:!0});if(!i)throw Error("failed to create canvas 2d context");return n.width=t.width,n.height=t.height,i.drawImage(t,0,0,t.width,t.height),i},resolveURL:t=>(i||(i=document.createElement("a")),i.href=t,i.href),hardwareConcurrency:"u">typeof navigator&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return void 0!==o?o:!!matchMedia&&(null==r&&(r=matchMedia("(prefers-reduced-motion: reduce)")),r.matches)},set prefersReducedMotion(e){o=e}},v=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(t){this._frozenAt=t}restoreNow(){this._frozenAt=null}isFrozen(){return null!==this._frozenAt}};function b(){return v.getCurrentTime()}class y{static testProp(t){if(!y.docStyle)return t[0];for(let n=0;n<t.length;n++)if(t[n]in y.docStyle)return t[n];return t[0]}static create(t,n,i){let r=window.document.createElement(t);return void 0!==n&&(r.className=n),i&&i.appendChild(r),r}static createNS(t,n){return window.document.createElementNS(t,n)}static disableDrag(){y.docStyle&&y.selectProp&&(y.userSelect=y.docStyle[y.selectProp],y.docStyle[y.selectProp]="none")}static enableDrag(){y.docStyle&&y.selectProp&&(y.docStyle[y.selectProp]=y.userSelect)}static setTransform(t,n){t.style[y.transformProp]=n}static addEventListener(t,n,i,r={}){t.addEventListener(n,i,"passive"in r?r:r.capture)}static removeEventListener(t,n,i,r={}){t.removeEventListener(n,i,"passive"in r?r:r.capture)}static suppressClickInternal(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",y.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",y.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",y.suppressClickInternal,!0)},0)}static getScale(t){let n=t.getBoundingClientRect();return{x:n.width/t.offsetWidth||1,y:n.height/t.offsetHeight||1,boundingClientRect:n}}static getPoint(t,i,r){let o=i.boundingClientRect;return new n.P((r.clientX-o.left)/i.x-t.clientLeft,(r.clientY-o.top)/i.y-t.clientTop)}static mousePos(t,n){let i=y.getScale(t);return y.getPoint(t,i,n)}static touchPos(t,n){let i=[],r=y.getScale(t);for(let o=0;o<n.length;o++)i.push(y.getPoint(t,r,n[o]));return i}static mouseButton(t){return t.button}static remove(t){t.parentNode&&t.parentNode.removeChild(t)}static sanitize(t){let n=(new DOMParser).parseFromString(t,"text/html").body||document.createElement("body");for(let t of n.querySelectorAll("script"))t.remove();return y.clean(n),n.innerHTML}static isPossiblyDangerous(t,n){let i=n.replace(/\s+/g,"").toLowerCase();return!(!["src","href","xlink:href"].includes(t)||!i.includes("javascript:")&&!i.includes("data:"))||!!t.startsWith("on")||void 0}static clean(t){for(let n of t.children)y.removeAttributes(n),y.clean(n)}static removeAttributes(t){for(let{name:n,value:i}of t.attributes)y.isPossiblyDangerous(n,i)&&t.removeAttribute(n)}}y.docStyle="u">typeof window&&window.document&&window.document.documentElement.style,y.selectProp=y.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),y.transformProp=y.testProp(["transform","WebkitTransform"]);let _={supported:!1,testSupport:function(t){!k&&w&&(C?A(t):x=t)}},x,w,k=!1,C=!1;function A(t){let n=t.createTexture();t.bindTexture(t.TEXTURE_2D,n);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,w),t.isContextLost())return;_.supported=!0}catch(t){}t.deleteTexture(n),k=!0}"u">typeof document&&((w=document.createElement("img")).onload=()=>{x&&A(x),x=null,C=!0},w.onerror=()=>{k=!0,x=null},w.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(t){let i,r,o,a;t.resetRequestQueue=()=>{i=[],r=0,o=0,a={}},t.addThrottleControl=t=>{let n=o++;return a[n]=t,n},t.removeThrottleControl=t=>{delete a[t],l()},t.getImage=(t,r,o=!0)=>new Promise((a,s)=>{_.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),n.e(t,{type:"image"}),i.push({abortController:r,requestParameters:t,supportImageRefresh:o,state:"queued",onError:t=>{s(t)},onSuccess:t=>{a(t)}}),l()});let s=t=>n._(this,void 0,void 0,function*(){var i;t.state="running";let{requestParameters:o,supportImageRefresh:a,onError:s,onSuccess:u,abortController:d}=t,h=!1===a&&!n.i(self)&&!n.g(o.url)&&(!o.headers||Object.keys(o.headers).reduce((t,n)=>t&&"accept"===n,!0));r++;let p=h?c(o,d):n.m(o,d);try{let r=yield p;delete t.abortController,t.state="completed",r.data instanceof HTMLImageElement||n.b(r.data)?u(r):r.data&&u({data:yield(i=r.data,"function"==typeof createImageBitmap?n.f(i):n.h(i)),cacheControl:r.cacheControl,expires:r.expires})}catch(n){delete t.abortController,s(n)}finally{r--,l()}}),l=()=>{let t=(()=>{for(let t of Object.keys(a))if(a[t]())return!0;return!1})()?n.c.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:n.c.MAX_PARALLEL_IMAGE_REQUESTS;for(let n=r;n<t&&i.length>0;n++){let t=i.shift();t.abortController.signal.aborted?n--:s(t)}},c=(t,i)=>new Promise((r,o)=>{let a=new Image,s=t.url,l=t.credentials;l&&"include"===l?a.crossOrigin="use-credentials":(l&&"same-origin"===l||!n.d(s))&&(a.crossOrigin="anonymous"),i.signal.addEventListener("abort",()=>{a.src="",o(new n.a(i.signal.reason))}),a.fetchPriority="high",a.onload=()=>{a.onerror=a.onload=null,r({data:a})},a.onerror=()=>{a.onerror=a.onload=null,i.signal.aborted||o(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."))},a.src=s})}(d||(d={})),d.resetRequestQueue();class E{constructor(t){this._transformRequestFn=null!=t?t:null}transformRequest(t,n){return this._transformRequestFn&&this._transformRequestFn(t,n)||{url:t}}setTransformRequest(t){this._transformRequestFn=t}}function S(t){let n=[];if("string"==typeof t)n.push({id:"default",url:t});else if(t&&t.length>0){let i=[];for(let{id:r,url:o}of t){let t=`${r}${o}`;-1===i.indexOf(t)&&(i.push(t),n.push({id:r,url:o}))}}return n}function T(t,n,i){try{let r=new URL(t);return r.pathname+=`${n}${i}`,r.toString()}catch(n){throw Error(`Invalid sprite URL "${t}", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically`)}}function O(t){let{userImage:n}=t;return!!(n&&n.render&&n.render())&&(t.data.replace(new Uint8Array(n.data.buffer)),!0)}class F extends n.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new n.R({width:1,height:1}),this.dirty=!0}destroy(){for(let t of(this.atlasTexture&&(this.atlasTexture.destroy(),this.atlasTexture=null),Object.keys(this.images)))this.removeImage(t);this.patterns={},this.atlasImage=new n.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(let{ids:t,promiseResolve:n}of this.requestors)n(this._getImagesForIds(t));this.requestors=[]}}getImage(t){let i=this.images[t];if(i&&!i.data&&i.spriteData){let t=i.spriteData;i.data=new n.R({width:t.width,height:t.height},t.context.getImageData(t.x,t.y,t.width,t.height).data),i.spriteData=null}return i}addImage(t,n){if(this.images[t])throw Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,n)&&(this.images[t]=n)}_validate(t,i){let r=!0,o=i.data||i.spriteData;return this._validateStretch(i.stretchX,o&&o.width)||(this.fire(new n.k(Error(`Image "${t}" has invalid "stretchX" value`))),r=!1),this._validateStretch(i.stretchY,o&&o.height)||(this.fire(new n.k(Error(`Image "${t}" has invalid "stretchY" value`))),r=!1),this._validateContent(i.content,i)||(this.fire(new n.k(Error(`Image "${t}" has invalid "content" value`))),r=!1),r}_validateStretch(t,n){if(!t)return!0;let i=0;for(let r of t){if(r[0]<i||r[1]<r[0]||n<r[1])return!1;i=r[1]}return!0}_validateContent(t,n){if(!t)return!0;if(4!==t.length)return!1;let i=n.spriteData,r=i&&i.width||n.data.width,o=i&&i.height||n.data.height;return!(t[0]<0||r<t[0]||t[1]<0||o<t[1]||t[2]<0||r<t[2]||t[3]<0||o<t[3]||t[2]<t[0]||t[3]<t[1])}updateImage(t,n,i=!0){let r=this.getImage(t);if(i&&(r.data.width!==n.data.width||r.data.height!==n.data.height))throw Error(`size mismatch between old image (${r.data.width}x${r.data.height}) and new image (${n.data.width}x${n.data.height}).`);n.version=r.version+1,this.images[t]=n,this.updatedImages[t]=!0}removeImage(t){let n=this.images[t];delete this.images[t],delete this.patterns[t],n.userImage&&n.userImage.onRemove&&n.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(t){return new Promise((n,i)=>{let r=!0;if(!this.isLoaded())for(let n of t)this.images[n]||(r=!1);this.isLoaded()||r?n(this._getImagesForIds(t)):this.requestors.push({ids:t,promiseResolve:n})})}_getImagesForIds(t){let i={};for(let r of t){let t=this.getImage(r);t||(this.fire(new n.l("styleimagemissing",{id:r})),t=this.getImage(r)),t?i[r]={data:t.data.clone(),pixelRatio:t.pixelRatio,sdf:t.sdf,version:t.version,stretchX:t.stretchX,stretchY:t.stretchY,content:t.content,textFitWidth:t.textFitWidth,textFitHeight:t.textFitHeight,hasRenderCallback:!!(t.userImage&&t.userImage.render)}:n.w(`Image "${r}" 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 i}getPixelSize(){let{width:t,height:n}=this.atlasImage;return{width:t,height:n}}getPattern(t){let i=this.patterns[t],r=this.getImage(t);if(!r)return null;if(i&&i.position.version===r.version)return i.position;if(i)i.position.version=r.version;else{let i={w:r.data.width+2,h:r.data.height+2,x:0,y:0},o=new n.I(i,r);this.patterns[t]={bin:i,position:o}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){let i=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new n.T(t,this.atlasImage,i.RGBA),this.atlasTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)}_updatePatternAtlas(){let t=[];for(let n in this.patterns)t.push(this.patterns[n].bin);let{w:i,h:r}=n.p(t),o=this.atlasImage;for(let t in o.resize({width:i||1,height:r||1}),this.patterns){let{bin:i}=this.patterns[t],r=i.x+1,a=i.y+1,s=this.getImage(t).data,l=s.width,c=s.height;n.R.copy(s,o,{x:0,y:0},{x:r,y:a},{width:l,height:c}),n.R.copy(s,o,{x:0,y:c-1},{x:r,y:a-1},{width:l,height:1}),n.R.copy(s,o,{x:0,y:0},{x:r,y:a+c},{width:l,height:1}),n.R.copy(s,o,{x:l-1,y:0},{x:r-1,y:a},{width:1,height:c}),n.R.copy(s,o,{x:0,y:0},{x:r+l,y:a},{width:1,height:c})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(let i of t){if(this.callbackDispatchedThisFrame[i])continue;this.callbackDispatchedThisFrame[i]=!0;let t=this.getImage(i);t||n.w(`Image with ID: "${i}" was not found`),O(t)&&this.updateImage(i,t)}}cloneImages(){let t={};for(let n in this.images){let i=this.images[n];t[n]=Object.assign(Object.assign({},i),{data:i.data?i.data.clone():null})}return t}}let M=1e20;function I(t,n,i,r,o,a,s,l,c){for(let u=n;u<n+r;u++)R(t,i*a+u,a,o,s,l,c);for(let u=i;u<i+o;u++)R(t,u*a+n,1,r,s,l,c)}function R(t,n,i,r,o,a,s){a[0]=0,s[0]=-M,s[1]=M,o[0]=t[n];for(let l=1,c=0,u=0;l<r;l++){o[l]=t[n+l*i];let r=l*l;do{let t=a[c];u=(o[l]-o[t]+r-t*t)/(l-t)/2}while(u<=s[c]&&--c>-1);a[++c]=l,s[c]=u,s[c+1]=M}for(let l=0,c=0;l<r;l++){for(;s[c+1]<l;)c++;let r=a[c],u=l-r;t[n+l*i]=o[r]+u*u}}let D=n.v.layout_symbol["text-font"].default.join(",");class P{constructor(t,n,i){this.requestManager=t,this.localIdeographFontFamily=n,this.entries={},this.lang=i}setURL(t){this.url=t}getGlyphs(t){return n._(this,void 0,void 0,function*(){let n=[];for(let i in t)for(let r of t[i])n.push(this._getAndCacheGlyphsPromise(i,r));let i=yield Promise.all(n),r={};for(let{stack:t,id:n,glyph:o}of i)r[t]||(r[t]={}),r[t][n]=o&&{id:o.id,bitmap:o.bitmap.clone(),metrics:o.metrics};return r})}_getAndCacheGlyphsPromise(t,i){return n._(this,void 0,void 0,function*(){let n=this.entries[t];n||(n=this.entries[t]={glyphs:{},requests:{},ranges:{}});let r=n.glyphs[i];return void 0!==r?{stack:t,id:i,glyph:r}:!this.url||this._charUsesLocalIdeographFontFamily(i)?(r=n.glyphs[i]=this._drawGlyph(n,t,i),{stack:t,id:i,glyph:r}):yield this._downloadAndCacheRangePromise(t,i)})}_downloadAndCacheRangePromise(t,i){return n._(this,void 0,void 0,function*(){let n=this.entries[t],r=Math.floor(i/256);if(n.ranges[r])return{stack:t,id:i,glyph:null};if(!n.requests[r]){let i=P.loadGlyphRange(t,r,this.url,this.requestManager);n.requests[r]=i}try{let o=yield n.requests[r];for(let t in o)n.glyphs[+t]=o[+t];return n.ranges[r]=!0,{stack:t,id:i,glyph:o[i]||null}}catch(a){let o=n.glyphs[i]=this._drawGlyph(n,t,i);return this._warnOnMissingGlyphRange(o,r,i,a),{stack:t,id:i,glyph:o}}})}_warnOnMissingGlyphRange(t,i,r,o){let a=256*i,s=a+255,l=r.toString(16).padStart(4,"0").toUpperCase();n.w(`Unable to load glyph range ${i}, ${a}-${s}. Rendering codepoint U+${l} locally instead. ${o}`)}_charUsesLocalIdeographFontFamily(t){return!!this.localIdeographFontFamily&&n.q(t)}_drawGlyph(t,i,r){let o=i===D&&""!==this.localIdeographFontFamily&&this._charUsesLocalIdeographFontFamily(r),a=o?"ideographTinySDF":"tinySDF";t[a]||(t[a]=this._createTinySDF(o?this.localIdeographFontFamily:i));let s=t[a].draw(String.fromCodePoint(r)),l=/^\p{gc=Cf}+$/u.test(String.fromCodePoint(r));return{id:r,bitmap:new n.r({width:s.width||60,height:s.height||60},s.data),metrics:{width:l?0:s.glyphWidth/2||24,height:s.glyphHeight/2||24,left:s.glyphLeft/2+.5||0,top:s.glyphTop/2-27.5||-8,advance:l?0:s.glyphAdvance/2||24,isDoubleResolution:!0}}}_createTinySDF(t){let n=t?t.split(","):[];n.push("sans-serif");let i=n.map(t=>/[-\w]+/.test(t)?t:`'${CSS.escape(t)}'`).join(",");return new P.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:i,fontWeight:this._fontWeight(n[0]),fontStyle:this._fontStyle(n[0]),lang:this.lang})}_fontStyle(t){return/italic/i.test(t)?"italic":/oblique/i.test(t)?"oblique":"normal"}_fontWeight(t){let n;for(let[i,r]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${i}\\b`,"i").test(t)&&(n=`${r}`);return n}destroy(){for(let t in this.entries){let n=this.entries[t];n.tinySDF&&(n.tinySDF=null),n.ideographTinySDF&&(n.ideographTinySDF=null),n.glyphs={},n.requests={},n.ranges={}}this.entries={}}}P.loadGlyphRange=function(t,i,r,o){return n._(this,void 0,void 0,function*(){let a=256*i,s=a+255,l=o.transformRequest(r.replace("{fontstack}",t).replace("{range}",`${a}-${s}`),"Glyphs"),c=yield n.n(l,new AbortController);if(!c||!c.data)throw Error(`Could not load glyph range. range: ${i}, ${a}-${s}`);let u={};for(let t of n.o(c.data))u[t.id]=t;return u})},P.TinySDF=class{constructor({fontSize:t=24,buffer:n=3,radius:i=8,cutoff:r=.25,fontFamily:o="sans-serif",fontWeight:a="normal",fontStyle:s="normal",lang:l=null}={}){this.buffer=n,this.cutoff=r,this.radius=i,this.lang=l;const c=this.size=t+4*n,u=this._createCanvas(c),d=this.ctx=u.getContext("2d",{willReadFrequently:!0});d.font=`${s} ${a} ${t}px ${o}`,d.textBaseline="alphabetic",d.textAlign="left",d.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(t){let n=document.createElement("canvas");return n.width=n.height=t,n}draw(t){let{width:n,actualBoundingBoxAscent:i,actualBoundingBoxDescent:r,actualBoundingBoxLeft:o,actualBoundingBoxRight:a}=this.ctx.measureText(t),s=Math.ceil(i),l=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(a-o))),c=Math.min(this.size-this.buffer,s+Math.ceil(r)),u=l+2*this.buffer,d=c+2*this.buffer,h=Math.max(u*d,0),p=new Uint8ClampedArray(h),f={data:p,width:u,height:d,glyphWidth:l,glyphHeight:c,glyphTop:s,glyphLeft:0,glyphAdvance:n};if(0===l||0===c)return f;let{ctx:m,buffer:g,gridInner:v,gridOuter:b}=this;this.lang&&(m.lang=this.lang),m.clearRect(g,g,l,c),m.fillText(t,g,g+s);let y=m.getImageData(g,g,l,c);b.fill(M,0,h),v.fill(0,0,h);for(let t=0;t<c;t++)for(let n=0;n<l;n++){let i=y.data[4*(t*l+n)+3]/255;if(0===i)continue;let r=(t+g)*u+n+g;if(1===i)b[r]=0,v[r]=M;else{let t=.5-i;b[r]=t>0?t*t:0,v[r]=t<0?t*t:0}}I(b,0,0,u,d,u,this.f,this.v,this.z),I(v,g,g,l,c,u,this.f,this.v,this.z);for(let t=0;t<h;t++){let n=Math.sqrt(b[t])-Math.sqrt(v[t]);p[t]=Math.round(255-255*(n/this.radius+this.cutoff))}return f}};class L{constructor(){this.specification=n.u.light.position}possiblyEvaluate(t,i){return n.F(t.expression.evaluate(i))}interpolate(t,i,r){return{x:n.G.number(t.x,i.x,r),y:n.G.number(t.y,i.y,r),z:n.G.number(t.z,i.z,r)}}}class N extends n.E{constructor(t){super(),a=a||new n.t({anchor:new n.D(n.u.light.anchor),position:new L,color:new n.D(n.u.light.color),intensity:new n.D(n.u.light.intensity)}),this._transitionable=new n.x(a,void 0),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t,i={}){if(!this._validate(n.y,t,i))for(let i in t){let r=t[i];i.endsWith(n.z)?this._transitionable.setTransition(i.slice(0,-n.z.length),r):this._transitionable.setValue(i,r)}}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,i,r){return(!r||!1!==r.validate)&&n.B(this,t.call(n.C,{value:i,style:{glyphs:!0,sprite:!0},styleSpec:n.u}))}}let z=new n.t({"sky-color":new n.D(n.u.sky["sky-color"]),"horizon-color":new n.D(n.u.sky["horizon-color"]),"fog-color":new n.D(n.u.sky["fog-color"]),"fog-ground-blend":new n.D(n.u.sky["fog-ground-blend"]),"horizon-fog-blend":new n.D(n.u.sky["horizon-fog-blend"]),"sky-horizon-blend":new n.D(n.u.sky["sky-horizon-blend"]),"atmosphere-blend":new n.D(n.u.sky["atmosphere-blend"])});class j extends n.E{constructor(t){super(),this._transitionable=new n.x(z,void 0),this.setSky(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new n.H(0))}setSky(t,i={}){if(!this._validate(n.J,t,i))for(let i in t||(t={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0}),t){let r=t[i];i.endsWith(n.z)?this._transitionable.setTransition(i.slice(0,-n.z.length),r):this._transitionable.setValue(i,r)}}getSky(){return this._transitionable.serialize()}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,i,r={}){return!1!==(null==r?void 0:r.validate)&&n.B(this,t.call(n.C,n.e({value:i,style:{glyphs:!0,sprite:!0},styleSpec:n.u})))}calculateFogBlendOpacity(t){return t<60?0:t<70?(t-60)/10:1}}class B{constructor(t,n){this.width=t,this.height=n,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(t,n){let i=t.join(",")+String(n);return this.dashEntry[i]||(this.dashEntry[i]=this.addDash(t,n)),this.dashEntry[i]}getDashRanges(t,n,i){let r=[],o=t.length%2==1?-t[t.length-1]*i:0,a=t[0]*i,s=!0;r.push({left:o,right:a,isDash:s,zeroLength:0===t[0]});let l=t[0];for(let n=1;n<t.length;n++){s=!s;let c=t[n];o=l*i,l+=c,a=l*i,r.push({left:o,right:a,isDash:s,zeroLength:0===c})}return r}addRoundDash(t,n,i){let r=n/2;for(let n=-i;n<=i;n++){let o=this.width*(this.nextRow+i+n),a=0,s=t[0];for(let l=0;l<this.width;l++){let c;l/s.right>1&&(s=t[++a]);let u=Math.min(Math.abs(l-s.left),Math.abs(l-s.right)),d=n/i*(r+1);if(s.isDash){let t=r-Math.abs(d);c=Math.sqrt(u*u+t*t)}else c=r-Math.sqrt(u*u+d*d);this.data[o+l]=Math.max(0,Math.min(255,c+128))}}}addRegularDash(t){for(let n=t.length-1;n>=0;--n){let i=t[n],r=t[n+1];i.zeroLength?t.splice(n,1):r&&r.isDash===i.isDash&&(r.left=i.left,t.splice(n,1))}let n=t[0],i=t[t.length-1];n.isDash===i.isDash&&(n.left=i.left-this.width,i.right=n.right+this.width);let r=this.width*this.nextRow,o=0,a=t[0];for(let n=0;n<this.width;n++){n/a.right>1&&(a=t[++o]);let i=Math.min(Math.abs(n-a.left),Math.abs(n-a.right));this.data[r+n]=Math.max(0,Math.min(255,(a.isDash?i:-i)+128))}}addDash(t,i){let r=7*!!i,o=2*r+1;if(this.nextRow+o>this.height)return n.w("LineAtlas out of space"),null;let a=0;for(let n=0;n<t.length;n++)a+=t[n];if(0!==a){let n=this.width/a,o=this.getDashRanges(t,this.width,n);i?this.addRoundDash(o,n,r):this.addRegularDash(o)}let s={y:this.nextRow+r,height:2*r,width:a};return this.nextRow+=o,this.dirty=!0,s}bind(t){let n=t.gl;this.texture?(n.bindTexture(n.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,n.texSubImage2D(n.TEXTURE_2D,0,0,0,this.width,this.height,n.ALPHA,n.UNSIGNED_BYTE,this.data))):(this.texture=n.createTexture(),n.bindTexture(n.TEXTURE_2D,this.texture),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.REPEAT),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.REPEAT),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texImage2D(n.TEXTURE_2D,0,n.ALPHA,this.width,this.height,0,n.ALPHA,n.UNSIGNED_BYTE,this.data))}}let U="maplibre_preloaded_worker_pool";class V{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length<V.workerCount;)this.workers.push(new Worker(n.c.WORKER_URL));return this.active[t]=!0,this.workers.slice()}release(t){delete this.active[t],0===this.numActive()&&(this.workers.forEach(t=>{t.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[U]}numActive(){return Object.keys(this.active).length}}let H=Math.floor(g.hardwareConcurrency/2);function q(){return s||(s=new V),s}V.workerCount=n.K(globalThis)?Math.max(Math.min(H,3),1):1;class W{constructor(t,i){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=i;const r=this.workerPool.acquire(i);for(let t=0;t<r.length;t++){const o=new n.L(r[t],i);o.name=`Worker ${t}`,this.actors.push(o)}if(!this.actors.length)throw Error("No actors found")}broadcast(t,n){let i=[];for(let r of this.actors)i.push(r.sendAsync({type:t,data:n}));return Promise.all(i)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(t=!0){this.actors.forEach(t=>{t.remove()}),this.actors=[],t&&this.workerPool.release(this.id)}registerMessageHandler(t,n){for(let i of this.actors)i.registerMessageHandler(t,n)}unregisterMessageHandler(t){for(let n of this.actors)n.unregisterMessageHandler(t)}}function G(){return l||(l=new W(q(),n.M)).registerMessageHandler("GR",(t,i,r)=>n.m(i,r)),l}function Y(t,i){let r=n.N();return n.O(r,r,[1,1,0]),n.Q(r,r,[.5*t.width,.5*t.height,1]),t.calculatePosMatrix?n.S(r,r,t.calculatePosMatrix(i.toUnwrapped())):r}function Z(t,n,i,r,o,a,s){var l;let c=function(t,n,i){if(t)for(let r of t){let t=n[r];if(t&&t.source===i&&"fill-extrusion"===t.type)return!0}else for(let t in n){let r=n[t];if(r.source===i&&"fill-extrusion"===r.type)return!0}return!1}(null!=(l=null==o?void 0:o.layers)?l:null,n,t.id),u=a.maxPitchScaleFactor(),d=t.tilesIn(r,u,c);d.sort(X);let h=[];for(let r of d)h.push({wrappedTileID:r.tileID.wrapped().key,queryResults:r.tile.queryRenderedFeatures(n,i,t.getState(),r.queryGeometry,r.cameraQueryGeometry,r.scale,o,a,u,Y(a,r.tileID),s?(t,n)=>s(r.tileID,t,n):void 0)});return function(t,n){for(let i in t)for(let r of t[i])K(r,n);return t}(function(t){let n={},i={};for(let r of t){let t=r.queryResults,o=r.wrappedTileID,a=i[o]=i[o]||{};for(let i in t){let r=t[i],o=a[i]=a[i]||{},s=n[i]=n[i]||[];for(let t of r)o[t.featureIndex]||(o[t.featureIndex]=!0,s.push(t))}}return n}(h),t)}function X(t,n){let i=t.tileID,r=n.tileID;return i.overscaledZ-r.overscaledZ||i.canonical.y-r.canonical.y||i.wrap-r.wrap||i.canonical.x-r.canonical.x}function K(t,n){let i=t.feature,r=n.getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=r}function J(t,i,r,o){return n._(this,void 0,void 0,function*(){let a=t;if(t.url?a=(yield n.j(i.transformRequest(t.url,"Source"),r)).data:yield g.frameAsync(r,o),!a)return null;let s=n.U(n.e(a,t),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in a&&a.vector_layers&&(s.vectorLayerIds=a.vector_layers.map(t=>t.id)),s})}class Q{constructor(t,n){t&&(n?this.setSouthWest(t).setNorthEast(n):Array.isArray(t)&&(4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1])))}setNorthEast(t){return this._ne=t instanceof n.V?new n.V(t.lng,t.lat):n.V.convert(t),this}setSouthWest(t){return this._sw=t instanceof n.V?new n.V(t.lng,t.lat):n.V.convert(t),this}extend(t){let i,r,o=this._sw,a=this._ne;if(t instanceof n.V)i=t,r=t;else{if(!(t instanceof Q))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(Q.convert(t)):this.extend(n.V.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(n.V.convert(t)):this;if(i=t._sw,r=t._ne,!i||!r)return this}return o||a?(o.lng=Math.min(i.lng,o.lng),o.lat=Math.min(i.lat,o.lat),a.lng=Math.max(r.lng,a.lng),a.lat=Math.max(r.lat,a.lat)):(this._sw=new n.V(i.lng,i.lat),this._ne=new n.V(r.lng,r.lat)),this}getCenter(){return new n.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 n.V(this.getWest(),this.getNorth())}getSouthEast(){return new n.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(t){let{lng:i,lat:r}=n.V.convert(t),o=this._sw.lng<=i&&i<=this._ne.lng;return this._sw.lng>this._ne.lng&&(o=this._sw.lng>=i&&i>=this._ne.lng),this._sw.lat<=r&&r<=this._ne.lat&&o}intersects(t){if(!((t=Q.convert(t)).getNorth()>=this.getSouth()&&t.getSouth()<=this.getNorth()))return!1;let i=Math.abs(this.getEast()-this.getWest()),r=Math.abs(t.getEast()-t.getWest());if(i>=360||r>=360)return!0;let o=n.W(this.getWest(),-180,180),a=n.W(this.getEast(),-180,180),s=n.W(t.getWest(),-180,180),l=n.W(t.getEast(),-180,180),c=o>a,u=s>l;return!(!c||!u)||(c?l>=o||s<=a:u?a>=s||o<=l:s<=a&&l>=o)}static convert(t){return t instanceof Q?t:t?new Q(t):t}static fromLngLat(t,i=0){let r=360*i/0x2637f09,o=r/Math.cos(Math.PI/180*t.lat);return new Q(new n.V(t.lng-o,t.lat-r),new n.V(t.lng+o,t.lat+r))}adjustAntiMeridian(){let t=new n.V(this._sw.lng,this._sw.lat),i=new n.V(this._ne.lng,this._ne.lat);return new Q(t,t.lng>i.lng?new n.V(i.lng+360,i.lat):i)}}class ee{constructor(t,n,i){this.bounds=Q.convert(this.validateBounds(t)),this.minzoom=n||0,this.maxzoom=i||24}validateBounds(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){let i=Math.pow(2,t.z),r=Math.floor(n.Y(this.bounds.getWest())*i),o=Math.floor(n.X(this.bounds.getNorth())*i),a=Math.ceil(n.Y(this.bounds.getEast())*i),s=Math.ceil(n.X(this.bounds.getSouth())*i);return t.x>=r&&t.x<a&&t.y>=o&&t.y<s}}class et extends n.E{constructor(t,i,r,o){if(super(),this.id=t,this.dispatcher=r,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,n.e(this,n.U(i,["url","scheme","tileSize","promoteId","encoding"])),this._options=n.e({type:"vector"},i),this._collectResourceTiming=i.collectResourceTiming,512!==this.tileSize)throw Error("vector tile sources must have a tileSize of 512");this.setEventedParent(o)}load(){return n._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new n.l("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let t=yield J(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,this.map.style.tileManagers[this.id].clearTiles(),t&&(n.e(this,t),t.bounds&&(this.tileBounds=new ee(t.bounds,this.minzoom,this.maxzoom)),this.fire(new n.l("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new n.l("data",{dataType:"source",sourceDataType:"content"})))}catch(t){this._tileJSONRequest=null,this._loaded=!0,n.Z(t)||this.fire(new n.k(t))}})}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.abort(),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return n.e({},this._options)}loadTile(t){return n._(this,void 0,void 0,function*(){let n=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),i={request:this.map._requestManager.transformRequest(n,"Tile"),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.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(t)};i.request.collectResourceTiming=this._collectResourceTiming;let r="RT";if(t.actor&&"expired"!==t.state){if("loading"===t.state)return new Promise((n,i)=>{t.reloadPromise={resolve:n,reject:i}})}else t.actor=this.dispatcher.getActor(),r="LT";t.abortController=new AbortController;try{let n=yield t.actor.sendAsync({type:r,data:i},t.abortController);if(delete t.abortController,t.aborted)return;this._afterTileLoadWorkerResponse(t,n)}catch(n){if(delete t.abortController,t.aborted)return;if(n&&404!==n.status)throw n;this._afterTileLoadWorkerResponse(t,null)}})}_getOverzoomParameters(t){if(t.tileID.canonical.z<=this.maxzoom||void 0===this.map._zoomLevelsToOverscale)return;let n=t.tileID.scaledTo(this.maxzoom).canonical,i=n.url(this.tiles,this.map.getPixelRatio(),this.scheme);return{maxZoomTileID:n,overzoomRequest:this.map._requestManager.transformRequest(i,"Tile")}}_afterTileLoadWorkerResponse(t,n){if(n&&n.resourceTiming&&(t.resourceTiming=n.resourceTiming),n&&this.map._refreshExpiredTiles&&t.setExpiryData(n),t.loadVectorData(n,this.map.painter),t.reloadPromise){let n=t.reloadPromise;t.reloadPromise=null,this.loadTile(t).then(n.resolve).catch(n.reject)}}abortTile(t){return n._(this,void 0,void 0,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.actor&&(yield t.actor.sendAsync({type:"AT",data:{uid:t.uid,type:this.type,source:this.id}}))})}unloadTile(t){return n._(this,void 0,void 0,function*(){t.unloadVectorData(),t.actor&&(yield t.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class en extends n.E{constructor(t,i,r,o){super(),this.id=t,this.dispatcher=r,this.setEventedParent(o),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=n.e({type:"raster"},i),n.e(this,n.U(i,["url","scheme","tileSize"]))}load(){return n._(this,arguments,void 0,function*(t=!1){this._loaded=!1,this.fire(new n.l("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let i=yield J(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,i&&(n.e(this,i),i.bounds&&(this.tileBounds=new ee(i.bounds,this.minzoom,this.maxzoom)),this.fire(new n.l("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new n.l("data",{dataType:"source",sourceDataType:"content",sourceDataChanged:t})))}catch(t){this._tileJSONRequest=null,this._loaded=!0,n.Z(t)||this.fire(new n.k(t))}})}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(t){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),t(),this.load(!0)}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}serialize(){return n.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t){return n._(this,void 0,void 0,function*(){let i=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.abortController=new AbortController;try{let r=yield d.getImage(this.map._requestManager.transformRequest(i,"Tile"),t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(r&&r.data){this.map._refreshExpiredTiles&&(r.cacheControl||r.expires)&&t.setExpiryData({cacheControl:r.cacheControl,expires:r.expires});let i=this.map.painter.context,o=i.gl,a=r.data;t.texture=this.map.painter.getTileTexture(a.width),t.texture?t.texture.update(a,{useMipmap:!0}):(t.texture=new n.T(i,a,o.RGBA,{useMipmap:!0}),t.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST)),t.state="loaded"}}catch(n){if(delete t.abortController,t.aborted)t.state="unloaded";else if(n)throw t.state="errored",n}})}abortTile(t){return n._(this,void 0,void 0,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController)})}unloadTile(t){return n._(this,void 0,void 0,function*(){t.texture&&this.map.painter.saveTileTexture(t.texture)})}hasTransition(){return!1}}class ei extends en{constructor(t,i,r,o){super(t,i,r,o),this.type="raster-dem",this.maxzoom=22,this._options=n.e({type:"raster-dem"},i),this.encoding=i.encoding||"mapbox",this.redFactor=i.redFactor,this.greenFactor=i.greenFactor,this.blueFactor=i.blueFactor,this.baseShift=i.baseShift}loadTile(t){return n._(this,void 0,void 0,function*(){let i=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),r=this.map._requestManager.transformRequest(i,"Tile");t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.abortController=new AbortController;try{let i=yield d.getImage(r,t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(i&&i.data){let r=i.data;this.map._refreshExpiredTiles&&(i.cacheControl||i.expires)&&t.setExpiryData({cacheControl:i.cacheControl,expires:i.expires});let o=n.b(r)&&n.$()?r:yield this.readImageNow(r),a={type:this.type,uid:t.uid,source:this.id,rawImageData:o,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!t.actor||"expired"===t.state){t.actor=this.dispatcher.getActor();let n=yield t.actor.sendAsync({type:"LDT",data:a});t.dem=n,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded"}}}catch(n){if(delete t.abortController,t.aborted)t.state="unloaded";else if(n)throw t.state="errored",n}})}readImageNow(t){return n._(this,void 0,void 0,function*(){if("u">typeof VideoFrame&&n.a0()){let i=t.width+2,r=t.height+2;try{return new n.R({width:i,height:r},(yield n.a1(t,-1,-1,i,r)))}catch(t){}}return g.getImageData(t,1)})}_getNeighboringTiles(t){let i=t.canonical,r=Math.pow(2,i.z),o=(i.x-1+r)%r,a=0===i.x?t.wrap-1:t.wrap,s=(i.x+1+r)%r,l=i.x+1===r?t.wrap+1:t.wrap,c={};return c[new n.a2(t.overscaledZ,a,i.z,o,i.y).key]={backfilled:!1},c[new n.a2(t.overscaledZ,l,i.z,s,i.y).key]={backfilled:!1},i.y>0&&(c[new n.a2(t.overscaledZ,a,i.z,o,i.y-1).key]={backfilled:!1},c[new n.a2(t.overscaledZ,t.wrap,i.z,i.x,i.y-1).key]={backfilled:!1},c[new n.a2(t.overscaledZ,l,i.z,s,i.y-1).key]={backfilled:!1}),i.y+1<r&&(c[new n.a2(t.overscaledZ,a,i.z,o,i.y+1).key]={backfilled:!1},c[new n.a2(t.overscaledZ,t.wrap,i.z,i.x,i.y+1).key]={backfilled:!1},c[new n.a2(t.overscaledZ,l,i.z,s,i.y+1).key]={backfilled:!1}),c}unloadTile(t){return n._(this,void 0,void 0,function*(){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&(yield t.actor.sendAsync({type:"RDT",data:{type:this.type,uid:t.uid,source:this.id}}))})}}function er(t){return t&&0!==t.length?"number"==typeof t[0]?[t]:t.flatMap(t=>er(t)):[]}function eo(t){return"GeometryCollection"===t.type?t.geometries.flatMap(t=>eo(t)):er(t.coordinates)}function ea(t){let n,i=new Q;switch(t.type){case"FeatureCollection":n=t.features.flatMap(t=>eo(t.geometry));break;case"Feature":n=eo(t.geometry);break;default:n=eo(t)}if(0===n.length)return i;for(let t=0;t<n.length;t++){let[r,o]=n[t];i.extend([r,o])}return i}class es extends n.E{constructor(t,i,r,o){super(),this.id=t,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:i.data},this.actor=r.getActor(),this.setEventedParent(o),this._data="string"==typeof i.data?{url:i.data}:{geojson:i.data},this._options=n.e({},i),this._collectResourceTiming=i.collectResourceTiming,void 0!==i.maxzoom&&(this.maxzoom=i.maxzoom),i.type&&(this.type=i.type),i.attribution&&(this.attribution=i.attribution),this.promoteId=i.promoteId,void 0!==i.clusterMaxZoom&&this.maxzoom<=i.clusterMaxZoom&&n.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${i.clusterMaxZoom}".`),this.workerOptions=n.e({source:this.id,cluster:i.cluster||!1,geojsonVtOptions:{buffer:this._pixelsToTileUnits(void 0!==i.buffer?i.buffer:128),tolerance:this._pixelsToTileUnits(void 0!==i.tolerance?i.tolerance:.375),extent:n.a5,maxZoom:this.maxzoom,lineMetrics:i.lineMetrics||!1,generateId:i.generateId||!1},superclusterOptions:{maxZoom:this._getClusterMaxZoom(i.clusterMaxZoom),minPoints:Math.max(2,i.clusterMinPoints||2),extent:n.a5,radius:this._pixelsToTileUnits(i.clusterRadius||50),log:!1,generateId:i.generateId||!1},clusterProperties:i.clusterProperties,filter:i.filter},i.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(t){return t*(n.a5/this.tileSize)}_getClusterMaxZoom(t){let i=t?Math.round(t):this.maxzoom-1;return Number.isInteger(t)||void 0===t||n.w(`Integer expected for option 'clusterMaxZoom': provided value "${t}" rounded to "${i}"`),i}load(){return n._(this,void 0,void 0,function*(){yield this._updateWorkerData()})}onAdd(t){this.map=t,this.load()}setData(t,n){this._data="string"==typeof t?{url:t}:{geojson:t},this._pendingWorkerUpdate={data:t};let i=this._updateWorkerData();return n?i:this}updateData(t,i){this._pendingWorkerUpdate.diff=n.a6(this._pendingWorkerUpdate.diff,t);let r=this._updateWorkerData();return i?r:this}getData(){return n._(this,void 0,void 0,function*(){let t=n.e({type:this.type},this.workerOptions);return this.actor.sendAsync({type:"GD",data:t})})}getBounds(){return n._(this,void 0,void 0,function*(){return ea((yield this.getData()))})}setClusterOptions(t){return this.workerOptions.cluster=t.cluster,void 0!==t.clusterRadius&&(this.workerOptions.superclusterOptions.radius=this._pixelsToTileUnits(t.clusterRadius)),void 0!==t.clusterMaxZoom&&(this.workerOptions.superclusterOptions.maxZoom=this._getClusterMaxZoom(t.clusterMaxZoom)),this._pendingWorkerUpdate.optionsChanged=!0,this._updateWorkerData(),this}getClusterExpansionZoom(t){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:t,source:this.id}})}getClusterChildren(t){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:t,source:this.id}})}getClusterLeaves(t,n,i){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:t,limit:n,offset:i}})}_updateWorkerData(){return n._(this,void 0,void 0,function*(){if(this._isUpdatingWorker)return;if(!this._hasPendingWorkerUpdate())return void n.w(`No pending worker updates for GeoJSONSource ${this.id}.`);let{data:t,diff:i}=this._pendingWorkerUpdate,r=this._getLoadGeoJSONParameters(t,i);void 0!==t?this._pendingWorkerUpdate.data=void 0:i&&(this._pendingWorkerUpdate.diff=void 0),this._pendingWorkerUpdate.optionsChanged=void 0,yield this._dispatchWorkerUpdate(r)})}_getLoadGeoJSONParameters(t,i){let r=n.e({type:this.type},this.workerOptions);return"string"==typeof t?(r.request=this.map._requestManager.transformRequest(g.resolveURL(t),"Source"),r.request.collectResourceTiming=this._collectResourceTiming):void 0!==t?r.data=t:i&&(r.dataDiff=i),r}_dispatchWorkerUpdate(t){return n._(this,void 0,void 0,function*(){this._isUpdatingWorker=!0,this.fire(new n.l("dataloading",{dataType:"source"}));try{let i=yield this.actor.sendAsync({type:"LD",data:t});if(this._isUpdatingWorker=!1,this._removed||i.abandoned)return void this.fire(new n.l("dataabort",{dataType:"source"}));i.data&&(this._data={geojson:i.data});let r=this._applyDiffToSource(t.dataDiff),o=this._getShouldReloadTileOptions(r),a={dataType:"source"};this._applyResourceTiming(a,i),this.fire(new n.l("data",Object.assign(Object.assign({},a),{sourceDataType:"metadata"}))),this.fire(new n.l("data",Object.assign(Object.assign({},a),{sourceDataType:"content",shouldReloadTileOptions:o})))}catch(t){if(this._isUpdatingWorker=!1,this._removed)return void this.fire(new n.l("dataabort",{dataType:"source"}));this.fire(new n.k(t))}finally{this._hasPendingWorkerUpdate()&&this._updateWorkerData()}})}_applyResourceTiming(t,i){var r;if(!this._collectResourceTiming)return;let o=null==(r=i.resourceTiming)?void 0:r[this.id];if(!o)return;let a=o.slice(0);(null==a?void 0:a.length)&&n.e(t,{resourceTiming:a})}_applyDiffToSource(t){if(!t)return;let i="string"==typeof this.promoteId?this.promoteId:void 0;if(!this._data.url&&!this._data.updateable){let t=n.a7(this._data.geojson,i);if(!t)throw Error(`GeoJSONSource "${this.id}": GeoJSON data is not compatible with updateData`);this._data={updateable:t}}if(!this._data.updateable)return;let r=n.a8(this._data.updateable,t,i);return t.removeAll||this._options.cluster?void 0:r}_getShouldReloadTileOptions(t){if(t)return{affectedBounds:t.filter(Boolean).map(t=>ea(t))}}shouldReloadTile(t,{affectedBounds:i}){if("loading"===t.state)return!0;if("unloaded"===t.state)return!1;let{buffer:r,extent:o}=this.workerOptions.geojsonVtOptions,a=function({x:t,y:i,z:r},o=0){return new Q([n.a3((t-o)/Math.pow(2,r)),n.a4((i+1+o)/Math.pow(2,r))],[n.a3((t+1+o)/Math.pow(2,r)),n.a4((i-o)/Math.pow(2,r))])}(t.tileID.canonical,r/o);for(let t of i)if(a.intersects(t))return!0;return!1}loaded(){return!this._isUpdatingWorker&&!this._hasPendingWorkerUpdate()}loadTile(t){return n._(this,void 0,void 0,function*(){let n=t.actor?"RT":"LT";t.actor=this.actor;let i={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.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};t.abortController=new AbortController;let r=yield this.actor.sendAsync({type:n,data:i},t.abortController);delete t.abortController,t.unloadVectorData(),t.aborted||t.loadVectorData(r,this.map.painter,"RT"===n)})}abortTile(t){return n._(this,void 0,void 0,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.aborted=!0})}unloadTile(t){return n._(this,void 0,void 0,function*(){t.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:t.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 n.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 el extends n.E{constructor(t,n,i,r){super(),this.flippedWindingOrder=!1,this.id=t,this.dispatcher=i,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(r),this.options=n}load(t){return n._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new n.l("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{let n=yield d.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,n&&n.data&&(this.image=n.data,t&&(this.coordinates=t),this._finishLoading())}catch(t){this._request=null,this._loaded=!0,n.Z(t)||this.fire(new n.k(t))}})}loaded(){return this._loaded}updateImage(t){return t.url&&(this._request&&(this._request.abort(),this._request=null),this.options.url=t.url,this.load(t.coordinates).finally(()=>{this.texture=null})),this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new n.l("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(t){var i;this.coordinates=t;let r=t.map(n.a9.fromLngLat);return this.tileID=function(t){let i=n.aa.fromPoints(t),r=Math.max(0,Math.floor(-Math.log(Math.max(i.width(),i.height()))/Math.LN2)),o=Math.pow(2,r);return new n.ac(r,Math.floor((i.minX+i.maxX)/2*o),Math.floor((i.minY+i.maxY)/2*o))}(r),this.terrainTileRanges=this._getOverlappingTileRanges(r),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=r.map(t=>this.tileID.getTilePoint(t)._round()),this.flippedWindingOrder=((i=this.tileCoords)[1].x-i[0].x)*(i[2].y-i[0].y)-(i[1].y-i[0].y)*(i[2].x-i[0].x)<0,this.fire(new n.l("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;let t=this.map.painter.context,i=t.gl;this.texture||(this.texture=new n.T(t,this.image,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE));let r=!1;for(let t in this.tiles){let n=this.tiles[t];"loaded"!==n.state&&(n.state="loaded",n.texture=this.texture,r=!0)}r&&this.fire(new n.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(t){return n._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={}):t.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}_getOverlappingTileRanges(t){let{minX:i,minY:r,maxX:o,maxY:a}=n.aa.fromPoints(t),s={};for(let t=0;t<=n.ab;t++){let n=Math.pow(2,t),l=Math.floor(i*n),c=Math.floor(r*n),u=Math.floor(o*n),d=Math.floor(a*n),h=(l%n+n)%n,p=u%n,f=Math.floor(l/n),m=Math.floor(u/n);s[t]={minWrap:f,maxWrap:m,minTileXWrapped:h,maxTileXWrapped:p,minTileY:c,maxTileY:d}}return s}}class ec extends el{constructor(t,n,i,r){super(t,n,i,r),this.roundZoom=!0,this.type="video",this.options=n}load(){return n._(this,void 0,void 0,function*(){this._loaded=!1;let t=this.options;for(let n of(this.urls=[],t.urls))this.urls.push(this.map._requestManager.transformRequest(n,"Source").url);try{let t=yield n.ad(this.urls);if(this._loaded=!0,!t)return;this.video=t,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(t){this.fire(new n.k(t))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){let i=this.video.seekable;t<i.start(0)||t>i.end(0)?this.fire(new n.k(new n.ae(`sources.${this.id}`,null,`Playback for this video can be set only between the ${i.start(0)} and ${i.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,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 t=this.map.painter.context,i=t.gl;this.texture?this.video.paused||(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.video)):(this.texture=new n.T(t,this.video,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE));let r=!1;for(let t in this.tiles){let n=this.tiles[t];"loaded"!==n.state&&(n.state="loaded",n.texture=this.texture,r=!0)}r&&this.fire(new n.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 eu extends el{constructor(t,i,r,o){super(t,i,r,o),i.coordinates?Array.isArray(i.coordinates)&&4===i.coordinates.length&&!i.coordinates.some(t=>!Array.isArray(t)||2!==t.length||t.some(t=>"number"!=typeof t))||this.fire(new n.k(new n.ae(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new n.k(new n.ae(`sources.${t}`,null,'missing required property "coordinates"'))),i.animate&&"boolean"!=typeof i.animate&&this.fire(new n.k(new n.ae(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),i.canvas?"string"==typeof i.canvas||i.canvas instanceof HTMLCanvasElement||this.fire(new n.k(new n.ae(`sources.${t}`,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 n.k(new n.ae(`sources.${t}`,null,'missing required property "canvas"'))),this.options=i,this.animate=void 0===i.animate||i.animate}load(){return n._(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 n.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(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions()||0===Object.keys(this.tiles).length)return;let i=this.map.painter.context,r=i.gl;this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):(this.texture=new n.T(i,this.canvas,r.RGBA,{premultiply:!0}),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let o=!1;for(let t in this.tiles){let n=this.tiles[t];"loaded"!==n.state&&(n.state="loaded",n.texture=this.texture,o=!0)}o&&this.fire(new n.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 t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}let ed={},eh=t=>{switch(t){case"geojson":return es;case"image":return el;case"raster":return en;case"raster-dem":return ei;case"vector":return et;case"video":return ec;case"canvas":return eu}return ed[t]},ep="RTLPluginLoaded";class ef extends n.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=G()}_syncState(t){return this.status=t,this.dispatcher.broadcast("SRPS",{pluginStatus:t,pluginURL:this.url}).catch(t=>{throw this.status="error",t})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(t){return n._(this,arguments,void 0,function*(t,n=!1){if(this.url)throw Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=g.resolveURL(t),!this.url)throw Error(`requested url ${t} is invalid`);if("unavailable"===this.status){if(!n)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if("requested"===this.status)return this._requestImport()})}_requestImport(){return n._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new n.l(ep))})}lazyLoad(){"unavailable"===this.status?this.status="requested":"deferred"===this.status&&this._requestImport()}}let em=null;function eg(){return em||(em=new ef),em}!function(t){t[t.Base=0]="Base",t[t.Parent=1]="Parent"}(h||(h={})),function(t){t[t.Departing=0]="Departing",t[t.Incoming=1]="Incoming"}(p||(p={}));class ev{constructor(t,i){this.timeAdded=0,this.fadeEndTime=0,this.fadeOpacity=1,this.tileID=t,this.uid=n.af(),this.uses=0,this.tileSize=i,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(t){return this.hasData()&&(!this.fadeEndTime||this.fadeOpacity>0)&&(t||!this.holdingForSymbolFade())}setCrossFadeLogic({fadingRole:t,fadingDirection:n,fadingParentID:i,fadeEndTime:r}){this.resetFadeLogic(),this.fadingRole=t,this.fadingDirection=n,this.fadingParentID=i,this.fadeEndTime=r}setSelfFadeLogic(t){this.resetFadeLogic(),this.selfFading=!0,this.fadeEndTime=t}resetFadeLogic(){this.fadingRole=null,this.fadingDirection=null,this.fadingParentID=null,this.selfFading=!1,this.timeAdded=b(),this.fadeEndTime=0,this.fadeOpacity=1}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}clearTextures(t){this.demTexture&&t.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(t,i,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(let o in t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData,this.latestFeatureIndex.encoding=t.encoding):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData,this.latestFeatureIndex.encoding=this.latestEncoding)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,n){let i={};if(!n)return i;for(let r of t){let t=r.layerIds.map(t=>n.getLayer(t)).filter(Boolean);if(0!==t.length)for(let n of(r.layers=t,r.stateDependentLayerIds&&(r.stateDependentLayers=r.stateDependentLayerIds.map(n=>t.filter(t=>t.id===n)[0])),t))i[n.id]=r}return i}(t.buckets,null==i?void 0:i.style),this.hasSymbolBuckets=!1,this.buckets){let t=this.buckets[o];if(t instanceof n.ah){if(this.hasSymbolBuckets=!0,!r)break;t.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let t in this.buckets){let i=this.buckets[t];if(i instanceof n.ah&&i.hasRTLText){this.hasRTLText=!0,eg().lazyLoad();break}}for(let t in this.queryPadding=0,this.buckets){let n=this.buckets[t];this.queryPadding=Math.max(this.queryPadding,i.style.getLayer(t).queryRadius(n))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage),this.dashPositions=t.dashPositions}else this.collisionBoxArray=new n.ag}unloadVectorData(){for(let t in this.buckets)this.buckets[t].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(t){return this.buckets[t.id]}upload(t){for(let n in this.buckets){let i=this.buckets[n];i.uploadPending()&&i.upload(t)}let i=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new n.T(t,this.imageAtlas.image,i.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new n.T(t,this.glyphAtlasImage,i.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,n,i,r,o,a,s,l,c,u,d){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:r,cameraQueryGeometry:o,scale:a,tileSize:this.tileSize,pixelPosMatrix:u,transform:l,params:s,queryPadding:this.queryPadding*c,getElevation:d},t,n,i):{}}querySourceFeatures(t,i){let r=this.latestFeatureIndex;if(!r||!r.rawTileData)return;let o=r.loadVTLayers(),a=i&&i.sourceLayer?i.sourceLayer:"",s=o[n.ai]||o[a];if(!s)return;let l=n.aj(null==i?void 0:i.filter,null==i?void 0:i.globalState),{z:c,x:u,y:d}=this.tileID.canonical,h={z:c,x:u,y:d};for(let i=0;i<s.length;i++){let o=s.feature(i);if(l.needGeometry){let t=n.ak(o,!0);if(!l.filter(new n.H(this.tileID.overscaledZ),t,this.tileID.canonical))continue}else if(!l.filter(new n.H(this.tileID.overscaledZ),o))continue;let p=r.getId(o,a),f=new n.al(o,c,u,d,p);f.tile=h,t.push(f)}}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(t){let i=this.expirationTime;if(t.cacheControl){let i=n.am(t.cacheControl);i["max-age"]&&(this.expirationTime=Date.now()+1e3*i["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){let t=Date.now(),n=!1;if(this.expirationTime>t)n=!1;else if(i)if(this.expirationTime<i)n=!0;else{let r=this.expirationTime-i;r?this.expirationTime=t+Math.max(r,3e4):n=!0}else n=!0;n?(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(t,i){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||0===Object.keys(t).length)return;let r=this.latestFeatureIndex.loadVTLayers();for(let o in this.buckets){if(!i.style.hasLayer(o))continue;let a=this.buckets[o],s=a.layers[0].sourceLayer||n.ai,l=r[s],c=t[s];if(!l||!c||0===Object.keys(c).length)continue;a.update(c,l,this.imageAtlas&&this.imageAtlas.patternPositions||{},this.dashPositions||{});let u=i&&i.style&&i.style.getLayer(o);u&&(this.queryPadding=Math.max(this.queryPadding,u.queryRadius(a)))}}holdingForSymbolFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<b()}clearSymbolFadeHold(){this.symbolFadeHoldUntil=void 0}setSymbolHoldDuration(t){this.symbolFadeHoldUntil=b()+t}setDependencies(t,n){let i={};for(let t of n)i[t]=!0;this.dependencies[t]=i}hasDependency(t,n){for(let i of t){let t=this.dependencies[i];if(t){for(let i of n)if(t[i])return!0}}return!1}}class eb{constructor(){this.state={},this.stateChanges={},this.deletedStates={},this.revision=0}updateState(t,i,r){let o=String(i);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][o]=this.stateChanges[t][o]||{},n.e(this.stateChanges[t][o],r),null===this.deletedStates[t])for(let n in this.deletedStates[t]={},this.state[t])n!==o&&(this.deletedStates[t][n]=null);else if(this.deletedStates[t]&&null===this.deletedStates[t][o])for(let n in this.deletedStates[t][o]={},this.state[t][o])r[n]||(this.deletedStates[t][o][n]=null);else for(let n in r)this.deletedStates[t]&&this.deletedStates[t][o]&&null===this.deletedStates[t][o][n]&&delete this.deletedStates[t][o][n]}removeFeatureState(t,n,i){if(null===this.deletedStates[t])return;let r=String(n);if(this.deletedStates[t]=this.deletedStates[t]||{},i&&void 0!==n)null!==this.deletedStates[t][r]&&(this.deletedStates[t][r]=this.deletedStates[t][r]||{},this.deletedStates[t][r][i]=null);else if(void 0!==n)if(this.stateChanges[t]&&this.stateChanges[t][r])for(i in this.deletedStates[t][r]={},this.stateChanges[t][r])this.deletedStates[t][r][i]=null;else this.deletedStates[t][r]=null;else this.deletedStates[t]=null}getState(t,i){let r=String(i),o=n.e({},(this.state[t]||{})[r],(this.stateChanges[t]||{})[r]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){let n=this.deletedStates[t][i];if(null===n)return{};for(let t in n)delete o[t]}return o}initializeTileState(t,n){t.setFeatureState(this.state,n)}coalesceChanges(t,i){let r={};for(let t in this.stateChanges){this.state[t]=this.state[t]||{};let i={};for(let r in this.stateChanges[t])this.state[t][r]||(this.state[t][r]={}),n.e(this.state[t][r],this.stateChanges[t][r]),i[r]=this.state[t][r];r[t]=i}for(let t in this.deletedStates){this.state[t]=this.state[t]||{};let i={};if(null===this.deletedStates[t])for(let n in this.state[t])i[n]={},this.state[t][n]={};else for(let n in this.deletedStates[t]){if(null===this.deletedStates[t][n])this.state[t][n]={};else for(let i of Object.keys(this.deletedStates[t][n]))delete this.state[t][n][i];i[n]=this.state[t][n]}r[t]=r[t]||{},n.e(r[t],i)}this.stateChanges={},this.deletedStates={},0!==Object.keys(r).length&&(this.revision++,t.setFeatureState(r,i))}}let ey=89.25;function e_(t,i){let r=n.an(i.lat,-n.ao,n.ao);return new n.P(n.Y(i.lng)*t,n.X(r)*t)}function ex(t,i){return new n.a9(i.x/t,i.y/t).toLngLat()}function ew(t){return t.cameraToCenterDistance*Math.min(.85*Math.tan(n.ap(90-t.pitch)),Math.tan(n.ap(ey-t.pitch)))}function ek(t,i){let r=t.canonical,o=i/n.aq(r.z),a=r.x+Math.pow(2,r.z)*t.wrap,s=n.ar(new Float64Array(16));return n.O(s,s,[a*o,r.y*o,0]),n.Q(s,s,[o/n.a5,o/n.a5,1]),s}function eC(t,i,r,o,a){let s=n.a9.fromLngLat(t,i),l=a*n.as(1,t.lat),{x:c,y:u,z:d}=eA(r,o);return new n.a9(s.x+-(l*c),s.y+-(l*u),s.z+-(l*d))}function eA(t,i){let r=n.ap(t),o=n.ap(i),a=Math.cos(-r),s=Math.sin(r);return{x:s*Math.sin(o),y:-s*Math.cos(o),z:a}}function eE(t,n,i){let r=n.intersectsFrustum(t);if(!i||0===r)return r;let o=n.intersectsPlane(i);return 0===o?0:2===r&&2===o?2:1}function eS(t,n,i){let r=0,o=(i-n)/10;for(let a=0;a<10;a++)r+=o*Math.pow(Math.cos(n+(a+.5)/10*(i-n)),t);return r}function eT(t,i){return function(r,o,a,s,l){let c=2*((t-1)/n.at(Math.cos(n.ap(ey-l))/Math.cos(n.ap(ey)))-1),u=Math.acos(a/s),d=2*eS(c-1,0,n.ap(l/2)),h=Math.min(n.ap(ey),u+n.ap(l/2)),p=eS(c-1,Math.min(h,u-n.ap(l/2)),h),f=Math.atan(o/a),m=Math.hypot(o,a),g=r;return g+=n.at(s/m/Math.max(.5,Math.cos(n.ap(l/2)))),g+=c*n.at(Math.cos(f))/2,g-=n.at(Math.max(1,p/d/i))/2}}let eO=eT(9.314,3);function eF(t,i){return Math.max(0,(i.roundZoom?Math.round:Math.floor)(t.zoom+n.at(t.tileSize/i.tileSize)))}function eM(t,i){let r=t.getCameraFrustum(),o=t.getClippingPlane(),a=t.screenPointToMercatorCoordinate(t.getCameraPoint()),s=n.a9.fromLngLat(t.center,t.elevation);a.z=s.z+Math.cos(t.pitchInRadians)*t.cameraToCenterDistance/t.worldSize;let l=t.getCoveringTilesDetailsProvider(),c=l.allowVariableZoom(t,i),u=eF(t,i),d=i.minzoom||0,h=void 0!==i.maxzoom?i.maxzoom:t.maxZoom,p=Math.min(Math.max(0,u),h),f=Math.pow(2,p),m=[f*a.x,f*a.y,0],g=[f*s.x,f*s.y,0],v=Math.hypot(s.x-a.x,s.y-a.y),b=Math.abs(s.z-a.z),y=Math.hypot(v,b),_=t=>({zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}),x=[],w=[];if(t.renderWorldCopies&&l.allowWorldCopies())for(let t=1;t<=3;t++)x.push(_(-t)),x.push(_(t));for(x.push(_(0));x.length>0;){let f=x.pop(),v=f.x,_=f.y,k=f.fullyVisible,C={x:v,y:_,z:f.zoom},A=l.getTileBoundingVolume(C,f.wrap,t.elevation,i);if(!k){let t=eE(r,A,o);if(0===t)continue;k=2===t}let E=l.distanceToTile2d(a.x,a.y,C,A),S=u;c&&(S=(i.calculateTileZoom||eO)(t.zoom+n.at(t.tileSize/i.tileSize),E,b,y,t.fov));let T=Math.min(S=Math.max(0,S=(i.roundZoom?Math.round:Math.floor)(S)),h);if(f.wrap=l.getWrap(s,C,f.wrap),f.zoom>=T){if(f.zoom<d)continue;let t=p-f.zoom,r=m[0]-.5-(v<<t),o=m[1]-.5-(_<<t),a=i.reparseOverscaled?Math.max(f.zoom,S):f.zoom;w.push({tileID:new n.a2(f.zoom===h?a:f.zoom,f.wrap,f.zoom,v,_),distanceSq:n.au([g[0]-.5-v,g[1]-.5-_]),tileDistanceToCamera:Math.sqrt(r*r+o*o)})}else for(let t=0;t<4;t++)x.push({zoom:f.zoom+1,x:(v<<1)+t%2,y:(_<<1)+(t>>1),wrap:f.wrap,fullyVisible:k})}return w.sort((t,n)=>t.distanceSq-n.distanceSq).map(t=>t.tileID)}let eI=n.aa.fromPoints([new n.P(0,0),new n.P(n.a5,n.a5)]);function eR(t){return"raster"===t||"image"===t||"video"===t}function eD(t,n,i,r,o,a,s){if(!n.hasData())return!1;let{tileID:l,fadingRole:c,fadingDirection:u,fadingParentID:d}=n;if(c===h.Base&&u===p.Incoming&&d)return i[d.key]=d,!0;let f=Math.max(l.overscaledZ-o,a);for(let o=l.overscaledZ-1;o>=f;o--){let a=l.scaledTo(o),c=t.getLoadedTile(a);if(c)return n.setCrossFadeLogic({fadingRole:h.Base,fadingDirection:p.Incoming,fadingParentID:c.tileID,fadeEndTime:r+s}),c.setCrossFadeLogic({fadingRole:h.Parent,fadingDirection:p.Departing,fadeEndTime:r+s}),i[a.key]=a,!0}return!1}function eP(t,n,i,r,o,a){if(!n.hasData())return!1;let s=n.tileID.children(o),l=eL(t,n,s,i,r,o,a);if(l)return!0;for(let c of s)eL(t,n,c.children(o),i,r,o,a)&&(l=!0);return l}function eL(t,n,i,r,o,a,s){if(i[0].overscaledZ>=a)return!1;let l=!1;for(let a of i){let i=t.getLoadedTile(a);if(!i)continue;let{fadingRole:c,fadingDirection:u,fadingParentID:d}=i;c===h.Base&&u===p.Departing&&d||(i.setCrossFadeLogic({fadingRole:h.Base,fadingDirection:p.Departing,fadingParentID:n.tileID,fadeEndTime:o+s}),n.setCrossFadeLogic({fadingRole:h.Parent,fadingDirection:p.Incoming,fadeEndTime:o+s})),r[a.key]=a,l=!0}return l}function eN(t,n,i,r){let o=t.tileID;return!!t.selfFading||!t.hasData()&&!!n.has(o)&&(t.setSelfFadeLogic(i+r),!0)}function ez(t,n){var i;t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0;let r=n.tileID.canonical.x-t.tileID.canonical.x,o=n.tileID.canonical.y-t.tileID.canonical.y,a=Math.pow(2,t.tileID.canonical.z),s=n.tileID.key;0===r&&0===o||Math.abs(o)>1||(Math.abs(r)>1&&(1===Math.abs(r+a)?r+=a:1===Math.abs(r-a)&&(r-=a)),n.dem&&t.dem&&(t.dem.backfillBorder(n.dem,r,o),(null==(i=t.neighboringTiles)?void 0:i[s])&&(t.neighboringTiles[s].backfilled=!0)))}class ej{constructor(){this._tiles={}}handleWrapJump(t){let n={};for(let i in this._tiles){let r=this._tiles[i];r.tileID=r.tileID.unwrapTo(r.tileID.wrap+t),n[r.tileID.key]=r}this._tiles=n}setFeatureState(t,n){for(let i in this._tiles)this._tiles[i].setFeatureState(t,n)}getAllTiles(){return Object.values(this._tiles)}getAllIds(t=!1){return t?Object.values(this._tiles).map(t=>t.tileID).sort(n.aw).map(t=>t.key):Object.keys(this._tiles)}getTileById(t){return this._tiles[t]}setTile(t,n){this._tiles[t]=n}deleteTileById(t){delete this._tiles[t]}getLoadedTile(t){let n=this.getTileById(t.key);return(null==n?void 0:n.hasData())?n:null}isIdRenderable(t,n=!1){var i;return null==(i=this.getTileById(t))?void 0:i.isRenderable(n)}getRenderableIds(t=0,i){let r=[];for(let t of this.getAllIds())this.isIdRenderable(t,i)&&r.push(this.getTileById(t));return i?r.sort((i,r)=>{let o=i.tileID,a=r.tileID,s=new n.P(o.canonical.x,o.canonical.y)._rotate(-t),l=new n.P(a.canonical.x,a.canonical.y)._rotate(-t);return o.overscaledZ-a.overscaledZ||l.y-s.y||l.x-s.x}).map(t=>t.tileID.key):r.map(t=>t.tileID).sort(n.aw).map(t=>t.key)}}class eB extends n.E{constructor(t,i,r){super(),this.id=t,this.dispatcher=r,this.on("data",t=>this._dataHandler(t)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((t,n,i,r)=>{let o=new(eh(n.type))(t,n,i,r);if(o.id!==t)throw Error(`Expected Source id to be ${t} instead of ${o.id}`);return o})(t,i,r,this),this._inViewTiles=new ej,this._outOfViewCache=new n.ax(0,t=>this._unloadTile(t)),this._timers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._rasterFadeDuration=0,this._maxFadingAncestorLevels=5,this._state=new eb,this._didEmitContent=!1,this._updated=!1}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(t)}onRemove(t){for(let t of this._inViewTiles.getAllTiles())t.unloadVectorData();this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t),this._inViewTiles=new ej}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 t of this._inViewTiles.getAllTiles())if("loaded"!==t.state&&"errored"!==t.state)return!1;return!0}getSource(){return this._source}getState(){return this._state}pause(){this._paused=!0}resume(){if(!this._paused)return;let t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,i,r){return n._(this,void 0,void 0,function*(){try{yield this._source.loadTile(t),this._tileLoaded(t,i,r)}catch(i){t.state="errored",404!==i.status?this._source.fire(new n.k(i,{tile:t})):this.update(this.transform,this.terrain)}})}_unloadTile(t){this._source.unloadTile&&this._source.unloadTile(t)}_abortTile(t){this._source.abortTile&&this._source.abortTile(t),this._source.fire(new n.l("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(t){for(let n of(this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._inViewTiles,this.map?this.map.painter:null),this._inViewTiles.getAllTiles()))n.upload(t),n.prepare(this.map.style.imageManager)}getIds(){return this._inViewTiles.getAllIds(!0)}getRenderableIds(t){var n;return this._inViewTiles.getRenderableIds(null==(n=this.transform)?void 0:n.bearingInRadians,t)}hasRenderableParent(t){let n=t.overscaledZ-1;if(n>=this._source.minzoom){let i=this.getLoadedTile(t.scaledTo(n));if(i)return this._inViewTiles.isIdRenderable(i.tileID.key)}return!1}reload(t,n){if(this._paused)this._shouldReloadOnResume=!0;else for(let i of(this._outOfViewCache.reset(),this._inViewTiles.getAllIds())){let r=this._inViewTiles.getTileById(i);n&&!this._source.shouldReloadTile(r,n)||(t?this._reloadTile(i,"expired"):"errored"!==r.state&&this._reloadTile(i,"reloading"))}}_reloadTile(t,i){return n._(this,void 0,void 0,function*(){let n=this._inViewTiles.getTileById(t);n&&("loading"!==n.state&&(n.state=i),yield this._loadTile(n,t,i))})}_tileLoaded(t,i,r){t.timeAdded=b(),t.selfFading&&(t.fadeEndTime=t.timeAdded+this._rasterFadeDuration),"expired"===r&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(i,t),"raster-dem"===this.getSource().type&&t.dem&&function(t,n){var i,r;for(let o of n.getRenderableIds()){if(!t.neighboringTiles||!t.neighboringTiles[o])continue;let a=n.getTileById(o);t.neighboringTiles[o].backfilled||ez(t,a),(null==(r=null==(i=a.neighboringTiles)?void 0:i[t.tileID.key])?void 0:r.backfilled)||ez(a,t)}}(t,this._inViewTiles),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new n.l("data",{dataType:"source",tile:t,coord:t.tileID}))}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._inViewTiles.getTileById(t)}_retainLoadedChildren(t,n){let i=this._getLoadedDescendents(n),r=new Set;for(let o of n){let n=i[o.key];if(!(null==n?void 0:n.length)){r.add(o);continue}let a=o.overscaledZ+eB.maxOverzooming,s=n.filter(t=>t.tileID.overscaledZ<=a);if(!s.length){r.add(o);continue}let l=Math.min(...s.map(t=>t.tileID.overscaledZ)),c=s.filter(t=>t.tileID.overscaledZ===l).map(t=>t.tileID);for(let n of c)t[n.key]=n;this._areDescendentsComplete(c,l,o.overscaledZ)||r.add(o)}return r}_getLoadedDescendents(t){var n;let i={};for(let r of this._inViewTiles.getAllTiles().filter(t=>t.hasData()))for(let o of t)r.tileID.isChildOf(o)&&(i[n=o.key]||(i[n]=[])).push(r);return i}_areDescendentsComplete(t,n,i){return 1===t.length&&t[0].isOverscaled()?t[0].overscaledZ===n:Math.pow(4,n-i)===t.length}getLoadedTile(t){return this._inViewTiles.getLoadedTile(t)}updateCacheSize(t){let i=Math.floor((Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1)*(null===this._maxTileCacheZoomLevels?n.c.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),r="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,i):i;this._outOfViewCache.setMaxSize(r)}handleWrapJump(t){let n=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);this._prevLng=t,n&&(this._inViewTiles.handleWrapJump(n),this._resetTileReloadTimers())}update(t,i){let r;if(!this._sourceLoaded||this._paused)return;this.transform=t,this.terrain=i,this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this.used||this.usedForTerrain?this._source.tileID?r=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(t=>new n.a2(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y)):(r=eM(t,{tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:"vector"===this._source.type&&void 0!==this.map._zoomLevelsToOverscale?t.maxZoom-this.map._zoomLevelsToOverscale:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:i,calculateTileZoom:this._source.calculateTileZoom}),this._source.hasTile&&(r=r.filter(t=>this._source.hasTile(t)))):r=[],this.usedForTerrain&&(r=this._addTerrainIdealTiles(r));let o=0===r.length&&!this._updated&&this._didEmitContent;this._updated=!0,o&&this.fire(new n.l("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));let a=eF(t,this._source),s=this._updateRetainedTiles(r,a),l=eR(this._source.type);l&&this._rasterFadeDuration>0&&!i&&function(t,i,r,o,a,s,l){let c=b(),u=n.av(i);for(let n of i){let i=t.getTileById(n.key);i.fadingDirection!==p.Departing&&0!==i.fadeOpacity||i.resetFadeLogic(),eD(t,i,r,c,o,a,l)||eP(t,i,r,c,s,l)||eN(i,u,c,l)||i.resetFadeLogic()}}(this._inViewTiles,r,s,this._maxFadingAncestorLevels,this._source.minzoom,this._source.maxzoom,this._rasterFadeDuration),l?this._cleanUpRasterTiles(s):this._cleanUpVectorTiles(s)}_cleanUpRasterTiles(t){for(let n of this._inViewTiles.getAllIds())t[n]||this._removeTile(n)}_cleanUpVectorTiles(t){for(let n of this._inViewTiles.getAllIds()){let i=this._inViewTiles.getTileById(n);t[n]?i.clearSymbolFadeHold():i.hasSymbolBuckets?i.holdingForSymbolFade()?i.symbolFadeFinished()&&this._removeTile(n):i.setSymbolHoldDuration(this.map._fadeDuration):this._removeTile(n)}}_addTerrainIdealTiles(t){let n=[];for(let i of t)if(i.canonical.z>this._source.minzoom){let t=i.scaledTo(i.canonical.z-1);n.push(t);let r=i.scaledTo(Math.max(this._source.minzoom,Math.min(i.canonical.z,5)));n.push(r)}return t.concat(n)}releaseSymbolFadeTiles(){for(let t of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(t).holdingForSymbolFade()&&this._removeTile(t)}_updateRetainedTiles(t,n){var i;let r=new Set;for(let n of t)this._addTile(n).hasData()||r.add(n);let o=t.reduce((t,n)=>(t[n.key]=n,t),{}),a=this._retainLoadedChildren(o,r),s={},l=Math.max(n-eB.maxUnderzooming,this._source.minzoom);for(let t of a){let n=this._inViewTiles.getTileById(t.key),r=null==n?void 0:n.wasRequested();for(let a=t.overscaledZ-1;a>=l;--a){let l=t.scaledTo(a);if(s[l.key])break;if(s[l.key]=!0,(n=this.getTile(l))||!r||(n=this._addTile(l)),n){let t=n.hasData();if((t||!(null==(i=this.map)?void 0:i.cancelPendingTileRequestsWhileZooming)||r)&&(o[l.key]=l),r=n.wasRequested(),t)break}}}return o}_addTile(t){let i=this._inViewTiles.getTileById(t.key);if(i)return i;(i=this._outOfViewCache.getAndRemove(t))&&(i.resetFadeLogic(),this._setTileReloadTimer(t.key,i),i.tileID=t,this._state.initializeTileState(i,this.map?this.map.painter:null));let r=i;return i||(i=new ev(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(i,t.key,i.state)),i.uses++,this._inViewTiles.setTile(t.key,i),r||this._source.fire(new n.l("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i}_setTileReloadTimer(t,n){this._clearTileReloadTimer(t);let i=n.getExpiryTimeout();i&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},i))}_clearTileReloadTimer(t){let n=this._timers[t];n&&(clearTimeout(n),delete this._timers[t])}_resetTileReloadTimers(){for(let t in this._timers)clearTimeout(this._timers[t]),delete this._timers[t];for(let t of this._inViewTiles.getAllIds()){let n=this._inViewTiles.getTileById(t);this._setTileReloadTimer(t,n)}}refreshTiles(t){for(let n of this._inViewTiles.getAllIds()){let i=this._inViewTiles.getTileById(n);(this._inViewTiles.isIdRenderable(n)||"errored"==i.state)&&t.some(t=>t.equals(i.tileID.canonical))&&this._reloadTile(n,"expired")}}_removeTile(t){let n=this._inViewTiles.getTileById(t);n&&(n.uses--,this._inViewTiles.deleteTileById(t),this._clearTileReloadTimer(t),n.uses>0||(n.hasData()&&"reloading"!==n.state?this._outOfViewCache.add(n.tileID,n,n.getExpiryTimeout()):(n.aborted=!0,this._abortTile(n),this._unloadTile(n))))}_dataHandler(t){"source"===t.dataType&&("metadata"!==t.sourceDataType?"content"===t.sourceDataType&&this._sourceLoaded&&!this._paused&&(this.reload(t.sourceDataChanged,t.shouldReloadTileOptions),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0):this._sourceLoaded=!0)}clearTiles(){for(let t of(this._shouldReloadOnResume=!1,this._paused=!1,this._inViewTiles.getAllIds()))this._removeTile(t);this._outOfViewCache.reset()}tilesIn(t,i,r){let o=[],a=this.transform;if(!a)return o;let s=a.getCoveringTilesDetailsProvider().allowWorldCopies(),l=r?a.getCameraQueryGeometry(t):t,c=t=>a.screenPointToMercatorCoordinate(t,this.terrain),u=this.transformBbox(t,c,!s),d=this.transformBbox(l,c,!s),h=this.getIds(),p=n.aa.fromPoints(d);for(let t=0;t<h.length;t++){let r=this._inViewTiles.getTileById(h[t]);if(r.holdingForSymbolFade())continue;let l=s?[r.tileID]:[r.tileID.unwrapTo(-1),r.tileID.unwrapTo(0)],c=Math.pow(2,a.zoom-r.tileID.overscaledZ),f=i*r.queryPadding*n.a5/r.tileSize/c;for(let t of l){let i=p.map(i=>t.getTilePoint(new n.a9(i.x,i.y)));if(i.expandBy(f),i.intersects(eI)){let n=u.map(n=>t.getTilePoint(n)),i=d.map(n=>t.getTilePoint(n));o.push({tile:r,tileID:s?t:t.unwrapTo(0),queryGeometry:n,cameraQueryGeometry:i,scale:c})}}}return o}transformBbox(t,i,r){let o=t.map(i);if(r){let r=n.aa.fromPoints(t);r.shrinkBy(.001*Math.min(r.width(),r.height()));let a=r.map(i);n.aa.fromPoints(o).covers(a)||(o=o.map(t=>t.x>.5?new n.a9(t.x-1,t.y,t.z):t))}return o}getVisibleCoordinates(t){let n=this.getRenderableIds(t).map(t=>this._inViewTiles.getTileById(t).tileID);return this.transform&&this.transform.populateCache(n),n}hasTransition(){return!!this._source.hasTransition()||!(!eR(this._source.type)||!function(t,n){if(n<=0)return!1;let i=b();for(let n of t.getAllTiles())if(n.fadeEndTime>=i)return!0;return!1}(this._inViewTiles,this._rasterFadeDuration))}setRasterFadeDuration(t){this._rasterFadeDuration=t}setFeatureState(t,i,r){this._state.updateState(t=t||n.ai,i,r)}removeFeatureState(t,i,r){this._state.removeFeatureState(t=t||n.ai,i,r)}getFeatureState(t,i){return this._state.getState(t=t||n.ai,i)}setDependencies(t,n,i){let r=this._inViewTiles.getTileById(t);r&&r.setDependencies(n,i)}reloadTilesForDependencies(t,n){for(let i of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(i).hasDependency(t,n)&&this._reloadTile(i,"reloading");this._outOfViewCache.filter(i=>!i.hasDependency(t,n))}areTilesLoaded(){for(let t of this._inViewTiles.getAllTiles())if("loaded"!==t.state&&"errored"!==t.state)return!1;return!0}}eB.maxUnderzooming=10,eB.maxOverzooming=3;class e${constructor(t,n){this.reset(t,n)}reset(t,n){this.points=t||[],this._distances=[0];for(let t=1;t<this.points.length;t++)this._distances[t]=this._distances[t-1]+this.points[t].dist(this.points[t-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(n||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(1===this.points.length)return this.points[0];t=n.an(t,0,1);let i=1,r=this._distances[i],o=t*this.paddedLength+this.padding;for(;r<o&&i<this._distances.length;)r=this._distances[++i];let a=i-1,s=this._distances[a],l=r-s,c=l>0?(o-s)/l:0;return this.points[a].mult(1-c).add(this.points[i].mult(c))}}function eU(t,n){let i=!0;return"always"===t||"never"!==t&&"never"!==n||(i=!1),i}class eV{constructor(t,n,i){const r=this.boxCells=[],o=this.circleCells=[];this.xCellCount=Math.ceil(t/i),this.yCellCount=Math.ceil(n/i);for(let t=0;t<this.xCellCount*this.yCellCount;t++)r.push([]),o.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=n,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/n,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(t,n,i,r,o){this._forEachCell(n,i,r,o,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(n),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(o)}insertCircle(t,n,i,r){this._forEachCell(n-r,i-r,n+r,i+r,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(n),this.circles.push(i),this.circles.push(r)}_insertBoxCell(t,n,i,r,o,a){this.boxCells[o].push(a)}_insertCircleCell(t,n,i,r,o,a){this.circleCells[o].push(a)}_query(t,n,i,r,o,a,s){if(i<0||t>this.width||r<0||n>this.height)return[];let l=[];if(t<=0&&n<=0&&this.width<=i&&this.height<=r){if(o)return[{key:null,x1:t,y1:n,x2:i,y2:r}];for(let t=0;t<this.boxKeys.length;t++)l.push({key:this.boxKeys[t],x1:this.bboxes[4*t],y1:this.bboxes[4*t+1],x2:this.bboxes[4*t+2],y2:this.bboxes[4*t+3]});for(let t=0;t<this.circleKeys.length;t++){let n=this.circles[3*t],i=this.circles[3*t+1],r=this.circles[3*t+2];l.push({key:this.circleKeys[t],x1:n-r,y1:i-r,x2:n+r,y2:i+r})}}else this._forEachCell(t,n,i,r,this._queryCell,l,{hitTest:o,overlapMode:a,seenUids:{box:{},circle:{}}},s);return l}query(t,n,i,r){return this._query(t,n,i,r,!1,null)}hitTest(t,n,i,r,o,a){return this._query(t,n,i,r,!0,o,a).length>0}hitTestCircle(t,n,i,r,o){let a=t-i,s=t+i,l=n-i,c=n+i;if(s<0||a>this.width||c<0||l>this.height)return!1;let u=[];return this._forEachCell(a,l,s,c,this._queryCellCircle,u,{hitTest:!0,overlapMode:r,circle:{x:t,y:n,radius:i},seenUids:{box:{},circle:{}}},o),u.length>0}_queryCell(t,n,i,r,o,a,s,l){let{seenUids:c,hitTest:u,overlapMode:d}=s,h=this.boxCells[o];if(null!==h){let o=this.bboxes;for(let s of h)if(!c.box[s]){c.box[s]=!0;let h=4*s,p=this.boxKeys[s];if(t<=o[h+2]&&n<=o[h+3]&&i>=o[h+0]&&r>=o[h+1]&&(!l||l(p))&&(!u||!eU(d,p.overlapMode))&&(a.push({key:p,x1:o[h],y1:o[h+1],x2:o[h+2],y2:o[h+3]}),u))return!0}}let p=this.circleCells[o];if(null!==p){let o=this.circles;for(let s of p)if(!c.circle[s]){c.circle[s]=!0;let h=3*s,p=this.circleKeys[s];if(this._circleAndRectCollide(o[h],o[h+1],o[h+2],t,n,i,r)&&(!l||l(p))&&(!u||!eU(d,p.overlapMode))){let t=o[h],n=o[h+1],i=o[h+2];if(a.push({key:p,x1:t-i,y1:n-i,x2:t+i,y2:n+i}),u)return!0}}}return!1}_queryCellCircle(t,n,i,r,o,a,s,l){let{circle:c,seenUids:u,overlapMode:d}=s,h=this.boxCells[o];if(null!==h){let t=this.bboxes;for(let n of h)if(!u.box[n]){u.box[n]=!0;let i=4*n,r=this.boxKeys[n];if(this._circleAndRectCollide(c.x,c.y,c.radius,t[i+0],t[i+1],t[i+2],t[i+3])&&(!l||l(r))&&!eU(d,r.overlapMode))return a.push(!0),!0}}let p=this.circleCells[o];if(null!==p){let t=this.circles;for(let n of p)if(!u.circle[n]){u.circle[n]=!0;let i=3*n,r=this.circleKeys[n];if(this._circlesCollide(t[i],t[i+1],t[i+2],c.x,c.y,c.radius)&&(!l||l(r))&&!eU(d,r.overlapMode))return a.push(!0),!0}}}_forEachCell(t,n,i,r,o,a,s,l){let c=this._convertToXCellCoord(t),u=this._convertToYCellCoord(n),d=this._convertToXCellCoord(i),h=this._convertToYCellCoord(r);for(let p=c;p<=d;p++)for(let c=u;c<=h;c++)if(o.call(this,t,n,i,r,this.xCellCount*c+p,a,s,l))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,n,i,r,o,a){let s=r-t,l=o-n,c=i+a;return c*c>s*s+l*l}_circleAndRectCollide(t,n,i,r,o,a,s){let l=(a-r)/2,c=Math.abs(t-(r+l));if(c>l+i)return!1;let u=(s-o)/2,d=Math.abs(n-(o+u));if(d>u+i)return!1;if(c<=l||d<=u)return!0;let h=c-l,p=d-u;return h*h+p*p<=i*i}}function eH(t,i,r){var o,a,s,l,c,u,d;let h=n.N();if(!t){let{vecSouth:t,vecEast:n}=eW(i),r=m();r[0]=n[0],r[1]=n[1],r[2]=t[0],r[3]=t[1],o=r,(d=(s=(a=r)[0])*(u=a[3])-(c=a[2])*(l=a[1]))&&(o[0]=u*(d=1/d),o[1]=-l*d,o[2]=-c*d,o[3]=s*d),h[0]=r[0],h[1]=r[1],h[4]=r[2],h[5]=r[3]}return n.Q(h,h,[1/r,1/r,1]),h}function eq(t,i,r,o){if(t){let t=n.N();if(!i){let{vecSouth:n,vecEast:i}=eW(r);t[0]=i[0],t[1]=i[1],t[4]=n[0],t[5]=n[1]}return n.Q(t,t,[o,o,1]),t}return r.pixelsToClipSpaceMatrix}function eW(t){let i=Math.cos(t.rollInRadians),r=Math.sin(t.rollInRadians),o=Math.cos(t.pitchInRadians),a=Math.cos(t.bearingInRadians),s=Math.sin(t.bearingInRadians),l=n.aC();l[0]=-a*o*r-s*i,l[1]=-s*o*r+a*i;let c=n.aD(l);c<1e-9?n.aE(l):n.aF(l,l,1/c);let u=n.aC();u[0]=a*o*i-s*r,u[1]=s*o*i+a*r;let d=n.aD(u);return d<1e-9?n.aE(u):n.aF(u,u,1/d),{vecEast:u,vecSouth:l}}function eG(t,i,r,o){let a;o?(a=[t,i,o(t,i),1],n.aH(a,a,r)):te(a=[t,i,0,1],a,r);let s=a[3];return{point:new n.P(a[0]/s,a[1]/s),signedDistanceFromCamera:s,isOccluded:!1}}function eY(t,n){return .5+t/n*.5}function eZ(t,n){return t.x>=-n[0]&&t.x<=n[0]&&t.y>=-n[1]&&t.y<=n[1]}function eX(t,i,r,o,a,s,l,c,u,d,h,p,f){let m=r?t.textSizeData:t.iconSizeData,g=n.ay(m,i.transform.zoom),v=[256/i.width*2+1,256/i.height*2+1],b=r?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;b.clear();let y=t.lineVertexArray,_=r?t.text.placedSymbolArray:t.icon.placedSymbolArray,x=i.transform.width/i.transform.height,w=!1;for(let r=0;r<_.length;r++){let k=_.get(r);if(k.hidden||k.writingMode===n.az.vertical&&!w){e9(k.numGlyphs,b);continue}w=!1;let C=new n.P(k.anchorX,k.anchorY),A={getElevation:f,pitchedLabelPlaneMatrix:o,lineVertexArray:y,pitchWithMap:s,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:i.transform,tileAnchorPoint:C,unwrappedTileID:u,width:d,height:h,translation:p},E=e3(k.anchorX,k.anchorY,A);if(!eZ(E.point,v)){e9(k.numGlyphs,b);continue}let S=eY(i.transform.cameraToCenterDistance,E.signedDistanceFromCamera),T=n.aA(m,g,k),O=s?T*i.transform.getPitchedTextCorrection(k.anchorX,k.anchorY,u)/S:T*S,F=eQ({projectionContext:A,pitchedLabelPlaneMatrixInverse:a,symbol:k,fontSize:O,flip:!1,keepUpright:l,glyphOffsetArray:t.glyphOffsetArray,dynamicLayoutVertexArray:b,aspectRatio:x,rotateToLine:c});w=F.useVertical,(F.notEnoughRoom||w||F.needsFlipping&&eQ({projectionContext:A,pitchedLabelPlaneMatrixInverse:a,symbol:k,fontSize:O,flip:!0,keepUpright:l,glyphOffsetArray:t.glyphOffsetArray,dynamicLayoutVertexArray:b,aspectRatio:x,rotateToLine:c}).notEnoughRoom)&&e9(k.numGlyphs,b)}r?t.text.dynamicLayoutVertexBuffer.updateData(b):t.icon.dynamicLayoutVertexBuffer.updateData(b)}function eK(t,n,i,r,o,a,s,l){let c=a.glyphStartIndex+a.numGlyphs,u=a.lineStartIndex,d=a.lineStartIndex+a.lineLength,h=n.getoffsetX(a.glyphStartIndex),p=n.getoffsetX(c-1),f=e8(t*h,i,r,o,a.segment,u,d,l,s);if(!f)return null;let m=e8(t*p,i,r,o,a.segment,u,d,l,s);return m?l.projectionCache.anyProjectionOccluded?null:{first:f,last:m}:null}function eJ(t,i,r,o){return t===n.az.horizontal&&Math.abs(r.y-i.y)>Math.abs(r.x-i.x)*o?{useVertical:!0}:(t===n.az.vertical?i.y<r.y:i.x>r.x)?{needsFlipping:!0}:null}function eQ(t){let i,{projectionContext:r,pitchedLabelPlaneMatrixInverse:o,symbol:a,fontSize:s,flip:l,keepUpright:c,glyphOffsetArray:u,dynamicLayoutVertexArray:d,aspectRatio:h,rotateToLine:p}=t,f=s/24,m=a.lineOffsetX*f,g=a.lineOffsetY*f;if(a.numGlyphs>1){let t=a.glyphStartIndex+a.numGlyphs,n=a.lineStartIndex,s=a.lineStartIndex+a.lineLength,d=eK(f,u,m,g,l,a,p,r);if(!d)return{notEnoughRoom:!0};let v=e5(d.first.point.x,d.first.point.y,r,o),b=e5(d.last.point.x,d.last.point.y,r,o);if(c&&!l){let t=eJ(a.writingMode,v,b,h);if(t)return t}i=[d.first];for(let o=a.glyphStartIndex+1;o<t-1;o++){let t=e8(f*u.getoffsetX(o),m,g,l,a.segment,n,s,r,p);if(!t)return{notEnoughRoom:!0};i.push(t)}i.push(d.last)}else{if(c&&!l){let t=e2(r.tileAnchorPoint.x,r.tileAnchorPoint.y,r).point,i=a.lineStartIndex+a.segment+1,s=new n.P(r.lineVertexArray.getx(i),r.lineVertexArray.gety(i)),l=e2(s.x,s.y,r),c=l.signedDistanceFromCamera>0?l.point:e0(r.tileAnchorPoint,s,t,1,r),u=e5(t.x,t.y,r,o),d=e5(c.x,c.y,r,o),p=eJ(a.writingMode,u,d,h);if(p)return p}let t=e8(f*u.getoffsetX(a.glyphStartIndex),m,g,l,a.segment,a.lineStartIndex,a.lineStartIndex+a.lineLength,r,p);if(!t||r.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};i=[t]}for(let t of i)n.aG(d,t.point,t.angle);return{}}function e0(t,n,i,r,o){let a=t.add(t.sub(n)._unit()),s=e2(a.x,a.y,o).point,l=i.sub(s);return i.add(l._mult(r/l.mag()))}function e1(t,i,r){let o=i.projectionCache;if(o.projections[t])return o.projections[t];let a=new n.P(i.lineVertexArray.getx(t),i.lineVertexArray.gety(t)),s=e2(a.x,a.y,i);if(s.signedDistanceFromCamera>0)return o.projections[t]=s.point,o.anyProjectionOccluded=o.anyProjectionOccluded||s.isOccluded,s.point;let l=t-r.direction;return e0(0===r.distanceFromAnchor?i.tileAnchorPoint:new n.P(i.lineVertexArray.getx(l),i.lineVertexArray.gety(l)),a,r.previousVertex,r.absOffsetX-r.distanceFromAnchor+1,i)}function e2(t,n,i){let r,o=t+i.translation[0],a=n+i.translation[1];return i.pitchWithMap?(r=eG(o,a,i.pitchedLabelPlaneMatrix,i.getElevation)).isOccluded=!1:((r=i.transform.projectTileCoordinates(o,a,i.unwrappedTileID,i.getElevation)).point.x=(.5*r.point.x+.5)*i.width,r.point.y=(-(.5*r.point.y)+.5)*i.height),r}function e5(t,i,r,o){if(r.pitchWithMap){let a=[t,i,0,1];return n.aH(a,a,o),r.transform.projectTileCoordinates(a[0]/a[3],a[1]/a[3],r.unwrappedTileID,r.getElevation).point}return{x:t/r.width*2-1,y:1-i/r.height*2}}function e3(t,n,i){return i.transform.projectTileCoordinates(t,n,i.unwrappedTileID,i.getElevation)}function e4(t,n,i){return t._unit()._perp()._mult(n*i)}function e6(t,i,r,o,a,s,l,c,u){if(c.projectionCache.offsets[t])return c.projectionCache.offsets[t];let d=r.add(i);if(t+u.direction<o||t+u.direction>=a)return c.projectionCache.offsets[t]=d,d;let h=e1(t+u.direction,c,u),p=e4(h.sub(r),l,u.direction),f=r.add(p),m=h.add(p);return c.projectionCache.offsets[t]=n.aI(s,d,f,m)||d,c.projectionCache.offsets[t]}function e8(t,n,i,r,o,a,s,l,c){let u,d=r?t-n:t+n,h=d>0?1:-1,p=0;r&&(h*=-1,p=Math.PI),h<0&&(p+=Math.PI);let f,m=h>0?a+o:a+o+1;l.projectionCache.cachedAnchorPoint?f=l.projectionCache.cachedAnchorPoint:(f=e2(l.tileAnchorPoint.x,l.tileAnchorPoint.y,l).point,l.projectionCache.cachedAnchorPoint=f);let g,v,b=f,y=f,_=0,x=0,w=Math.abs(d),k=[];for(;_+x<=w;){if((m+=h)<a||m>=s)return null;_+=x,y=b,v=g;let t={absOffsetX:w,direction:h,distanceFromAnchor:_,previousVertex:y};if(b=e1(m,l,t),0===i)k.push(y),u=b.sub(y);else{let n,r=b.sub(y);n=0===r.mag()?e4(e1(m+h,l,t).sub(b),i,h):e4(r,i,h),v||(v=y.add(n)),g=e6(m,n,b,a,s,v,i,l,t),k.push(v),u=g.sub(v)}x=u.mag()}let C=u._mult((w-_)/x)._add(v||y),A=p+Math.atan2(b.y-y.y,b.x-y.x);return k.push(C),{point:C,angle:c?A:0,path:k}}let e7=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function e9(t,n){for(let i=0;i<t;i++){let t=n.length;n.resize(t+4),n.float32.set(e7,3*t)}}function te(t,n,i){let r=n[0],o=n[1];return t[0]=i[0]*r+i[4]*o+i[12],t[1]=i[1]*r+i[5]*o+i[13],t[3]=i[3]*r+i[7]*o+i[15],t}let tt=100;class tn{constructor(t,n=new eV(t.width+200,t.height+200,25),i=new eV(t.width+200,t.height+200,25)){this.transform=t,this.grid=n,this.ignoredGrid=i,this.pitchFactor=Math.cos(t.pitch*Math.PI/180)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+tt,this.screenBottomBoundary=t.height+tt,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(t,n,i,r,o,a,s,l,c,u,d,h){let p,f=this.projectAndGetPerspectiveRatio(t.anchorPointX+l[0],t.anchorPointY+l[1],o,u,h),m=i*f.perspectiveRatio;if(a||s)p=this._projectCollisionBox(t,m,r,o,a,s,l,f,u,d,h);else{let n=f.x+(d?d.x*m:0),i=f.y+(d?d.y*m:0);p={allPointsOccluded:!1,box:[n+t.x1*m,i+t.y1*m,n+t.x2*m,i+t.y2*m]}}let[g,v,b,y]=p.box,_=a?p.allPointsOccluded:f.isOccluded,x=_;return x||(x=f.perspectiveRatio<this.perspectiveRatioCutoff),x||(x=!this.isInsideGrid(g,v,b,y)),x||"always"!==n&&this.grid.hitTest(g,v,b,y,n,c)?{box:[g,v,b,y],placeable:!1,offscreen:!1,occluded:_}:{box:[g,v,b,y],placeable:!0,offscreen:this.isOffscreen(g,v,b,y),occluded:_}}placeCollisionCircles(t,i,r,o,a,s,l,c,u,d,h,p,f,m){let g=[],v=new n.P(i.anchorX,i.anchorY),b=this.getPerspectiveRatio(v.x,v.y,s,m),y=(u?a*this.transform.getPitchedTextCorrection(i.anchorX,i.anchorY,s)/b:a*b)/n.aM,_={getElevation:m,pitchedLabelPlaneMatrix:l,lineVertexArray:r,pitchWithMap:u,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:this.transform,tileAnchorPoint:v,unwrappedTileID:s,width:this.transform.width,height:this.transform.height,translation:f},x=eK(y,o,i.lineOffsetX*y,i.lineOffsetY*y,!1,i,!1,_),w=!1,k=!1,C=!0;if(x){let i=.5*h*b+p,r=new n.P(-100,-100),o=new n.P(this.screenRightBoundary,this.screenBottomBoundary),a=new e$,s=x.first,l=x.last,f=[];for(let t=s.path.length-1;t>=1;t--)f.push(s.path[t]);for(let t=1;t<l.path.length;t++)f.push(l.path[t]);let m=2.5*i;if(u){let t=this.projectPathToScreenSpace(f,_);f=t.some(t=>t.signedDistanceFromCamera<=0)?[]:t.map(t=>t.point)}let v=[];if(f.length>0){let t=f[0].clone(),i=f[0].clone();for(let n=1;n<f.length;n++)t.x=Math.min(t.x,f[n].x),t.y=Math.min(t.y,f[n].y),i.x=Math.max(i.x,f[n].x),i.y=Math.max(i.y,f[n].y);v=t.x>=r.x&&i.x<=o.x&&t.y>=r.y&&i.y<=o.y?[f]:i.x<r.x||t.x>o.x||i.y<r.y||t.y>o.y?[]:n.aJ([f],r.x,r.y,o.x,o.y)}for(let n of v){a.reset(n,.25*i);let r=0;r=a.length<=.5*i?1:Math.ceil(a.paddedLength/m)+1;for(let n=0;n<r;n++){let o=n/Math.max(r-1,1),s=a.lerp(o),l=s.x+tt,u=s.y+tt;g.push(l,u,i,0);let h=l-i,p=u-i,f=l+i,m=u+i;if(C=C&&this.isOffscreen(h,p,f,m),k=k||this.isInsideGrid(h,p,f,m),"always"!==t&&this.grid.hitTestCircle(l,u,i,t,d)&&(w=!0,!c))return{circles:[],offscreen:!1,collisionDetected:w}}}}return{circles:!c&&w||!k||b<this.perspectiveRatioCutoff?[]:g,offscreen:C,collisionDetected:w}}projectPathToScreenSpace(t,i){return function(t){let n=0,i=0,r=0,o=0;for(let a=0;a<t.length;a++)t[a].isOccluded?(r=a+1,o=0):++o>i&&(i=o,n=r);return t.slice(n,n+i)}(function(t,i){let r=n.N();return n.aB(r,i.pitchedLabelPlaneMatrix),t.map(t=>{let n=eG(t.x,t.y,r,i.getElevation),o=i.transform.projectTileCoordinates(n.point.x,n.point.y,i.unwrappedTileID,i.getElevation);return o.point.x=(.5*o.point.x+.5)*i.width,o.point.y=(-(.5*o.point.y)+.5)*i.height,o})}(t,i))}queryRenderedSymbols(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};let i=[],r=new n.aa;for(let o of t){let t=new n.P(o.x+tt,o.y+tt);r.extend(t),i.push(t)}let{minX:o,minY:a,maxX:s,maxY:l}=r,c=this.grid.query(o,a,s,l).concat(this.ignoredGrid.query(o,a,s,l)),u={},d={};for(let t of c){let r=t.key;if(void 0===u[r.bucketInstanceId]&&(u[r.bucketInstanceId]={}),u[r.bucketInstanceId][r.featureIndex])continue;let o=[new n.P(t.x1,t.y1),new n.P(t.x2,t.y1),new n.P(t.x2,t.y2),new n.P(t.x1,t.y2)];n.aK(i,o)&&(u[r.bucketInstanceId][r.featureIndex]=!0,void 0===d[r.bucketInstanceId]&&(d[r.bucketInstanceId]=[]),d[r.bucketInstanceId].push(r.featureIndex))}return d}insertCollisionBox(t,n,i,r,o,a){(i?this.ignoredGrid:this.grid).insert({bucketInstanceId:r,featureIndex:o,collisionGroupID:a,overlapMode:n},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,n,i,r,o,a){let s=i?this.ignoredGrid:this.grid,l={bucketInstanceId:r,featureIndex:o,collisionGroupID:a,overlapMode:n};for(let n=0;n<t.length;n+=4)s.insertCircle(l,t[n],t[n+1],t[n+2])}projectAndGetPerspectiveRatio(t,i,r,o,a){if(a){let r;o?(r=[t,i,o(t,i),1],n.aH(r,r,a)):te(r=[t,i,0,1],r,a);let s=r[3];return{x:(r[0]/s+1)/2*this.transform.width+tt,y:(-r[1]/s+1)/2*this.transform.height+tt,perspectiveRatio:.5+this.transform.cameraToCenterDistance/s*.5,isOccluded:!1,signedDistanceFromCamera:s}}{let n=this.transform.projectTileCoordinates(t,i,r,o);return{x:(n.point.x+1)/2*this.transform.width+tt,y:(1-n.point.y)/2*this.transform.height+tt,perspectiveRatio:.5+this.transform.cameraToCenterDistance/n.signedDistanceFromCamera*.5,isOccluded:n.isOccluded,signedDistanceFromCamera:n.signedDistanceFromCamera}}}getPerspectiveRatio(t,n,i,r){let o=this.transform.projectTileCoordinates(t,n,i,r);return .5+this.transform.cameraToCenterDistance/o.signedDistanceFromCamera*.5}isOffscreen(t,n,i,r){return i<tt||t>=this.screenRightBoundary||r<tt||n>this.screenBottomBoundary}isInsideGrid(t,n,i,r){return i>=0&&t<this.gridRightBoundary&&r>=0&&n<this.gridBottomBoundary}getViewportMatrix(){let t=n.ar([]);return n.O(t,t,[-100,-100,0]),t}_projectCollisionBox(t,i,r,o,a,s,l,c,u,d,h){let p=1,f=0,m=0,g=1,v=t.anchorPointX+l[0],b=t.anchorPointY+l[1];if(s&&!a){let t=this.projectAndGetPerspectiveRatio(v+1,b,o,u,h),n=t.x-c.x,i=Math.atan((t.y-c.y)/n)+(n<0?Math.PI:0),r=Math.sin(i),a=Math.cos(i);p=a,f=r,m=-r,g=a}else if(!s&&a){let t=eW(this.transform);p=t.vecEast[0],f=t.vecEast[1],m=t.vecSouth[0],g=t.vecSouth[1]}let y=c.x,_=c.y,x=i;a&&(y=v,_=b,x=Math.pow(2,-(this.transform.zoom-r.overscaledZ))*this.transform.getPitchedTextCorrection(v,b,o),d||(x*=n.an(.5+c.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))),d&&(y+=p*d.x*x+m*d.y*x,_+=f*d.x*x+g*d.y*x);let w=t.x1*x,k=t.x2*x,C=(w+k)/2,A=t.y1*x,E=t.y2*x,S=(A+E)/2,T=[];for(let{offsetX:t,offsetY:i}of[{offsetX:w,offsetY:A},{offsetX:C,offsetY:A},{offsetX:k,offsetY:A},{offsetX:k,offsetY:S},{offsetX:k,offsetY:E},{offsetX:C,offsetY:E},{offsetX:w,offsetY:E},{offsetX:w,offsetY:S}])T.push(new n.P(y+p*t+m*i,_+f*t+g*i));let O=!1;if(a){let t=T.map(t=>this.projectAndGetPerspectiveRatio(t.x,t.y,o,u,h));O=t.some(t=>!t.isOccluded),T=t.map(t=>new n.P(t.x,t.y))}else O=!0;return{box:n.aL(T),allPointsOccluded:!O}}}class ti{constructor(t,n,i,r){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?n:-n))):r&&i?1:0,this.placed=i}isHidden(){return 0===this.opacity&&!this.placed}}class tr{constructor(t,n,i,r,o){this.text=new ti(t?t.text:null,n,i,o),this.icon=new ti(t?t.icon:null,n,r,o)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class to{constructor(t,n,i){this.text=t,this.icon=n,this.skipFade=i}}class ta{constructor(t,n,i,r,o){this.bucketInstanceId=t,this.featureIndex=n,this.sourceLayerIndex=i,this.bucketIndex=r,this.tileID=o}}class ts{constructor(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}get(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){let n=++this.maxGroupID;this.collisionGroups[t]={ID:n,predicate:t=>t.collisionGroupID===n}}return this.collisionGroups[t]}}function tl(t,i,r,o,a){let{horizontalAlign:s,verticalAlign:l}=n.aS(t);return new n.P(-(s-.5)*i+o[0]*a,-(l-.5)*r+o[1]*a)}class tc{constructor(t,n,i,r,o){this.transform=t.clone(),this.terrain=n,this.collisionIndex=new tn(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=i,this.retainedQueryData={},this.collisionGroups=new ts(r),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=o,o&&(o.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(t){let n=this.terrain;return n?(i,r)=>n.getElevation(t,i,r):null}getBucketParts(t,i,r,o){let a=r.getBucket(i),s=r.latestFeatureIndex;if(!a||!s||i.id!==a.layerIds[0])return;let l=r.collisionBoxArray,c=a.layers[0].layout,u=a.layers[0].paint,d=Math.pow(2,this.transform.zoom-r.tileID.overscaledZ),h=r.tileSize/n.a5,p=r.tileID.toUnwrapped(),f="map"===c.get("text-rotation-alignment"),m=n.aN(r,1,this.transform.zoom),g=n.aO(this.collisionIndex.transform,r,u.get("text-translate"),u.get("text-translate-anchor")),v=n.aO(this.collisionIndex.transform,r,u.get("icon-translate"),u.get("icon-translate-anchor")),b=eH(f,this.transform,m);this.retainedQueryData[a.bucketInstanceId]=new ta(a.bucketInstanceId,s,a.sourceLayerIndex,a.index,r.tileID);let y={bucket:a,layout:c,translationText:g,translationIcon:v,unwrappedTileID:p,pitchedLabelPlaneMatrix:b,scale:d,textPixelRatio:h,holdingForFade:r.holdingForSymbolFade(),collisionBoxArray:l,partiallyEvaluatedTextSize:n.ay(a.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(a.sourceID)};if(o)for(let n of a.sortKeyRanges){let{sortKey:i,symbolInstanceStart:r,symbolInstanceEnd:o}=n;t.push({sortKey:i,symbolInstanceStart:r,symbolInstanceEnd:o,parameters:y})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:y})}attemptAnchorPlacement(t,i,r,o,a,s,l,c,u,d,h,p,f,m,g,v,b,y,_,x){let w=n.aP[t.textAnchor],k=[t.textOffset0,t.textOffset1],C=tl(w,r,o,k,a),A=this.collisionIndex.placeCollisionBox(i,p,c,u,d,l,s,v,h.predicate,_,C,x);if((!y||this.collisionIndex.placeCollisionBox(y,p,c,u,d,l,s,b,h.predicate,_,C,x).placeable)&&A.placeable){let t;if(this.prevPlacement&&this.prevPlacement.variableOffsets[f.crossTileID]&&this.prevPlacement.placements[f.crossTileID]&&this.prevPlacement.placements[f.crossTileID].text&&(t=this.prevPlacement.variableOffsets[f.crossTileID].anchor),0===f.crossTileID)throw Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[f.crossTileID]={textOffset:k,width:r,height:o,anchor:w,textBoxScale:a,prevAnchor:t},this.markUsedJustification(m,w,f,g),m.allowVerticalPlacement&&(this.markUsedOrientation(m,g,f),this.placedOrientations[f.crossTileID]=g),{shift:C,placedGlyphBoxes:A}}}placeLayerBucketPart(t,i,r){let{bucket:o,layout:a,translationText:s,translationIcon:l,unwrappedTileID:c,pitchedLabelPlaneMatrix:u,textPixelRatio:d,holdingForFade:h,collisionBoxArray:p,partiallyEvaluatedTextSize:f,collisionGroup:m}=t.parameters,g=a.get("text-optional"),v=a.get("icon-optional"),b=n.aQ(a,"text-overlap","text-allow-overlap"),y="always"===b,_=n.aQ(a,"icon-overlap","icon-allow-overlap"),x="always"===_,w="map"===a.get("text-rotation-alignment"),k="map"===a.get("text-pitch-alignment"),C="none"!==a.get("icon-text-fit"),A="viewport-y"===a.get("symbol-z-order"),E=y&&(x||!o.hasIconData()||v),S=x&&(y||!o.hasTextData()||g);!o.collisionArrays&&p&&o.deserializeCollisionBoxes(p);let T=this.retainedQueryData[o.bucketInstanceId].tileID,O=this._getTerrainElevationFunc(T),F=this.transform.getFastPathSimpleProjectionMatrix(T),M=(t,p,x)=>{var A,M;if(i[t.crossTileID])return;if(h)return void(this.placements[t.crossTileID]=new to(!1,!1,!1));let I=!1,R=!1,D=!0,P=null,L={box:null,placeable:!1,offscreen:null,occluded:!1},N={placeable:!1},z=null,j=null,B=null,U=0,V=0,H=0;p.textFeatureIndex?U=p.textFeatureIndex:t.useRuntimeCollisionCircles&&(U=t.featureIndex),p.verticalTextFeatureIndex&&(V=p.verticalTextFeatureIndex);let q=p.textBox;if(q){let i=i=>{let r=n.az.horizontal;if(o.allowVerticalPlacement&&!i&&this.prevPlacement){let n=this.prevPlacement.placedOrientations[t.crossTileID];n&&(this.placedOrientations[t.crossTileID]=n,r=n,this.markUsedOrientation(o,r,t))}return r},a=(i,r)=>{if(o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&p.verticalTextBox){for(let t of o.writingModes)if(t===n.az.vertical?N=L=r():L=i(),L&&L.placeable)break}else L=i()},u=t.textAnchorOffsetStartIndex,h=t.textAnchorOffsetEndIndex;if(h===u){let r=(n,i)=>{let r=this.collisionIndex.placeCollisionBox(n,b,d,T,c,k,w,s,m.predicate,O,void 0,F);return r&&r.placeable&&(this.markUsedOrientation(o,i,t),this.placedOrientations[t.crossTileID]=i),r};a(()=>r(q,n.az.horizontal),()=>{let i=p.verticalTextBox;return o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&i?r(i,n.az.vertical):{box:null,offscreen:null}}),i(L&&L.placeable)}else{let f=n.aP[null==(M=null==(A=this.prevPlacement)?void 0:A.variableOffsets[t.crossTileID])?void 0:M.anchor],g=(n,i,a)=>{let p=n.x2-n.x1,g=n.y2-n.y1,v=t.textBoxScale,y=C&&"never"===_?i:null,x=null,A="never"===b?1:2,E="never";f&&A++;for(let i=0;i<A;i++){for(let i=u;i<h;i++){let r=o.textAnchorOffsets.get(i);if(f&&r.textAnchor!==f)continue;let u=this.attemptAnchorPlacement(r,n,p,g,v,w,k,d,T,c,m,E,t,o,a,s,l,y,O);if(u&&(x=u.placedGlyphBoxes)&&x.placeable)return I=!0,P=u.shift,x}f?f=null:E=b}return r&&!x&&(x={box:this.collisionIndex.placeCollisionBox(q,"always",d,T,c,k,w,s,m.predicate,O,void 0,F).box,offscreen:!1,placeable:!1,occluded:!1}),x};a(()=>g(q,p.iconBox,n.az.horizontal),()=>{let i=p.verticalTextBox;return o.allowVerticalPlacement&&(!L||!L.placeable)&&t.numVerticalGlyphVertices>0&&i?g(i,p.verticalIconBox,n.az.vertical):{box:null,occluded:!0,offscreen:null}}),L&&(I=L.placeable,D=L.offscreen);let v=i(L&&L.placeable);if(!I&&this.prevPlacement){let n=this.prevPlacement.variableOffsets[t.crossTileID];n&&(this.variableOffsets[t.crossTileID]=n,this.markUsedJustification(o,n.anchor,t,v))}}}if(I=(z=L)&&z.placeable,D=z&&z.offscreen,t.useRuntimeCollisionCircles&&t.centerJustifiedTextSymbolIndex>=0){let i=o.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),l=n.aA(o.textSizeData,f,i),d=a.get("text-padding");(j=this.collisionIndex.placeCollisionCircles(b,i,o.lineVertexArray,o.glyphOffsetArray,l,c,u,r,k,m.predicate,t.collisionCircleDiameter,d,s,O)).circles.length&&j.collisionDetected&&!r&&n.w("Collisions detected, but collision boxes are not shown"),I=y||j.circles.length>0&&!j.collisionDetected,D=D&&j.offscreen}if(p.iconFeatureIndex&&(H=p.iconFeatureIndex),p.iconBox){let t=t=>this.collisionIndex.placeCollisionBox(t,_,d,T,c,k,w,l,m.predicate,O,C&&P?P:void 0,F);R=N&&N.placeable&&p.verticalIconBox?(B=t(p.verticalIconBox)).placeable:(B=t(p.iconBox)).placeable,D=D&&B.offscreen}let W=g||0===t.numHorizontalGlyphVertices&&0===t.numVerticalGlyphVertices,G=v||0===t.numIconVertices;W||G?G?W||(R=R&&I):I=R&&I:R=I=R&&I;let Y=R&&B.placeable;if(I&&z.placeable&&this.collisionIndex.insertCollisionBox(z.box,b,a.get("text-ignore-placement"),o.bucketInstanceId,N&&N.placeable&&V?V:U,m.ID),Y&&this.collisionIndex.insertCollisionBox(B.box,_,a.get("icon-ignore-placement"),o.bucketInstanceId,H,m.ID),j&&I&&this.collisionIndex.insertCollisionCircles(j.circles,b,a.get("text-ignore-placement"),o.bucketInstanceId,U,m.ID),r&&this.storeCollisionData(o.bucketInstanceId,x,p,z,B,j),0===t.crossTileID)throw Error("symbolInstance.crossTileID can't be 0");if(0===o.bucketInstanceId)throw Error("bucket.bucketInstanceId can't be 0");this.placements[t.crossTileID]=new to((I||E)&&!(null==z?void 0:z.occluded),(R||S)&&!(null==B?void 0:B.occluded),D||o.justReloaded),i[t.crossTileID]=!0};if(A){if(0!==t.symbolInstanceStart)throw Error("bucket.bucketInstanceId should be 0");let n=o.getSortedSymbolIndexes(-this.transform.bearingInRadians);for(let t=n.length-1;t>=0;--t){let i=n[t];M(o.symbolInstances.get(i),o.collisionArrays[i],i)}}else for(let n=t.symbolInstanceStart;n<t.symbolInstanceEnd;n++)M(o.symbolInstances.get(n),o.collisionArrays[n],n);o.justReloaded=!1}storeCollisionData(t,n,i,r,o,a){if(i.textBox||i.iconBox){let a,s;this.collisionBoxArrays.has(t)?a=this.collisionBoxArrays.get(t):(a=new Map,this.collisionBoxArrays.set(t,a)),a.has(n)?s=a.get(n):(s={text:null,icon:null},a.set(n,s)),i.textBox&&(s.text=r.box),i.iconBox&&(s.icon=o.box)}if(a){let n=this.collisionCircleArrays[t];void 0===n&&(n=this.collisionCircleArrays[t]=[]);for(let t=0;t<a.circles.length;t+=4)n.push(a.circles[t+0]-tt),n.push(a.circles[t+1]-tt),n.push(a.circles[t+2]),n.push(+!!a.collisionDetected)}}markUsedJustification(t,i,r,o){let a;for(let s of(a=o===n.az.vertical?r.verticalPlacedTextSymbolIndex:({left:r.leftJustifiedTextSymbolIndex,center:r.centerJustifiedTextSymbolIndex,right:r.rightJustifiedTextSymbolIndex})[n.aR(i)],[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex,r.verticalPlacedTextSymbolIndex]))s>=0&&(t.text.placedSymbolArray.get(s).crossTileID=a>=0&&s!==a?0:r.crossTileID)}markUsedOrientation(t,i,r){let o=i===n.az.horizontal||i===n.az.horizontalOnly?i:0,a=i===n.az.vertical?i:0;for(let n of[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex])t.text.placedSymbolArray.get(n).placedOrientation=o;r.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(r.verticalPlacedTextSymbolIndex).placedOrientation=a)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;let n=this.prevPlacement,i=!1;this.prevZoomAdjustment=n?n.zoomAdjustment(this.transform.zoom):0;let r=n?n.symbolFadeChange(t):1,o=n?n.opacities:{},a=n?n.variableOffsets:{},s=n?n.placedOrientations:{};for(let t in this.placements){let n=this.placements[t],a=o[t];a?(this.opacities[t]=new tr(a,r,n.text,n.icon),i=i||n.text!==a.text.placed||n.icon!==a.icon.placed):(this.opacities[t]=new tr(null,r,n.text,n.icon,n.skipFade),i=i||n.text||n.icon)}for(let t in o){let n=o[t];if(!this.opacities[t]){let o=new tr(n,r,!1,!1);o.isHidden()||(this.opacities[t]=o,i=i||n.text.placed||n.icon.placed)}}for(let t in a)this.variableOffsets[t]||!this.opacities[t]||this.opacities[t].isHidden()||(this.variableOffsets[t]=a[t]);for(let t in s)this.placedOrientations[t]||!this.opacities[t]||this.opacities[t].isHidden()||(this.placedOrientations[t]=s[t]);if(n&&void 0===n.lastPlacementChangeTime)throw Error("Last placement time for previous placement is not defined");i?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=n?n.lastPlacementChangeTime:t)}updateLayerOpacities(t,n){let i={};for(let r of n){let n=r.getBucket(t);n&&r.latestFeatureIndex&&t.id===n.layerIds[0]&&this.updateBucketOpacities(n,r.tileID,i,r.collisionBoxArray)}}updateBucketOpacities(t,i,r,o){t.hasTextData()&&(t.text.opacityVertexArray.clear(),t.text.hasVisibleVertices=!1),t.hasIconData()&&(t.icon.opacityVertexArray.clear(),t.icon.hasVisibleVertices=!1),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();let a=t.layers[0],s=a.layout,l=new tr(null,0,!1,!1,!0),c=s.get("text-allow-overlap"),u=s.get("icon-allow-overlap"),d=a._unevaluatedLayout.hasValue("text-variable-anchor")||a._unevaluatedLayout.hasValue("text-variable-anchor-offset"),h="map"===s.get("text-rotation-alignment"),p="map"===s.get("text-pitch-alignment"),f="none"!==s.get("icon-text-fit"),m=new tr(null,0,c&&(u||!t.hasIconData()||s.get("icon-optional")),u&&(c||!t.hasTextData()||s.get("text-optional")),!0);!t.collisionArrays&&o&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(o);let g=(t,n,i)=>{for(let r=0;r<n/4;r++)t.opacityVertexArray.emplaceBack(i);t.hasVisibleVertices=t.hasVisibleVertices||i!==ty},v=this.collisionBoxArrays.get(t.bucketInstanceId);for(let i=0;i<t.symbolInstances.length;i++){let o=t.symbolInstances.get(i),{numHorizontalGlyphVertices:a,numVerticalGlyphVertices:s,crossTileID:c}=o,u=this.opacities[c];r[c]?u=l:u||(u=m,this.opacities[c]=u),r[c]=!0;let b=o.numIconVertices>0,y=this.placedOrientations[o.crossTileID],_=y===n.az.vertical,x=y===n.az.horizontal||y===n.az.horizontalOnly;if(a>0||s>0){let n=tb(u.text);g(t.text,a,_?ty:n),g(t.text,s,x?ty:n);let i=u.text.isHidden();[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach(n=>{n>=0&&(t.text.placedSymbolArray.get(n).hidden=i||_?1:0)}),o.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).hidden=i||x?1:0);let r=this.variableOffsets[o.crossTileID];r&&this.markUsedJustification(t,r.anchor,o,y);let l=this.placedOrientations[o.crossTileID];l&&(this.markUsedJustification(t,"left",o,l),this.markUsedOrientation(t,l,o))}if(b){let n=tb(u.icon),i=!(f&&o.verticalPlacedIconSymbolIndex&&_);o.placedIconSymbolIndex>=0&&(g(t.icon,o.numIconVertices,i?n:ty),t.icon.placedSymbolArray.get(o.placedIconSymbolIndex).hidden=u.icon.isHidden()),o.verticalPlacedIconSymbolIndex>=0&&(g(t.icon,o.numVerticalIconVertices,i?ty:n),t.icon.placedSymbolArray.get(o.verticalPlacedIconSymbolIndex).hidden=u.icon.isHidden())}let w=v&&v.has(i)?v.get(i):{text:null,icon:null};if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){let r=t.collisionArrays[i];if(r){let i=new n.P(0,0);if(r.textBox||r.verticalTextBox){let n=!0;if(d){let t=this.variableOffsets[c];t?(i=tl(t.anchor,t.width,t.height,t.textOffset,t.textBoxScale),h&&i._rotate(p?-this.transform.bearingInRadians:this.transform.bearingInRadians)):n=!1}if(r.textBox||r.verticalTextBox){let o;r.textBox&&(o=_),r.verticalTextBox&&(o=x),tu(t.textCollisionBox.collisionVertexArray,u.text.placed,!n||o,w.text,i.x,i.y)}}if(r.iconBox||r.verticalIconBox){let n,o=!!(!x&&r.verticalIconBox);r.iconBox&&(n=o),r.verticalIconBox&&(n=!o),tu(t.iconCollisionBox.collisionVertexArray,u.icon.placed,n,w.icon,f?i.x:0,f?i.y:0)}}}}if(t.sortFeatures(-this.transform.bearingInRadians),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);t.bucketInstanceId in this.collisionCircleArrays&&(t.collisionCircleArray=this.collisionCircleArrays[t.bucketInstanceId],delete this.collisionCircleArrays[t.bucketInstanceId])}symbolFadeChange(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(t,n){let i=this.zoomAtLastRecencyCheck===n?1-this.zoomAdjustment(n):1;return this.zoomAtLastRecencyCheck=n,this.commitTime+this.fadeDuration*i>t}setStale(){this.stale=!0}}function tu(t,n,i,r,o,a){r&&0!==r.length||(r=[0,0,0,0]);let s=r[0]-tt,l=r[1]-tt,c=r[2]-tt,u=r[3]-tt;t.emplaceBack(+!!n,+!!i,o||0,a||0,s,l),t.emplaceBack(+!!n,+!!i,o||0,a||0,c,l),t.emplaceBack(+!!n,+!!i,o||0,a||0,c,u),t.emplaceBack(+!!n,+!!i,o||0,a||0,s,u)}let td=0x2000000,th=0x1000000,tp=131072,tf=65536,tm=512,tg=256,tv=2;function tb(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 0xffffffff;let n=+!!t.placed,i=Math.floor(127*t.opacity);return i*td+n*th+i*tp+n*tf+i*tm+n*tg+i*tv+n}let ty=0;class t_{constructor(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,n,i,r,o){let a=this._bucketParts;for(;this._currentTileIndex<t.length;)if(n.getBucketParts(a,r,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,o())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,a.sort((t,n)=>t.sortKey-n.sortKey));this._currentPartIndex<a.length;)if(n.placeLayerBucketPart(a[this._currentPartIndex],this._seenCrossTileIDs,i),this._currentPartIndex++,o())return!0;return!1}}class tx{constructor(t,n,i,r,o,a,s,l){this.placement=new tc(t,n,a,s,l),this._currentPlacementIndex=i.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=o,this._done=!1}isDone(){return this._done}continuePlacement(t,n,i){let r=b(),o=()=>!this._forceFullPlacement&&b()-r>2;for(;this._currentPlacementIndex>=0;){let r=n[t[this._currentPlacementIndex]],a=this.placement.collisionIndex.transform.zoom;if("symbol"===r.type&&(!r.minzoom||r.minzoom<=a)&&(!r.maxzoom||r.maxzoom>a)){if(this._inProgressLayer||(this._inProgressLayer=new t_(r)),this._inProgressLayer.continuePlacement(i[r.source],this.placement,this._showCollisionBoxes,r,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}let tw=512/n.a5/2;class tk{constructor(t,i,r){this.tileID=t,this.bucketInstanceId=r,this._symbolsByKey={};const o=new Map;for(let t=0;t<i.length;t++){const n=i.get(t),r=n.key,a=o.get(r);a?a.push(n):o.set(r,[n])}for(const[t,i]of o){const r={positions:i.map(t=>({x:Math.floor(t.anchorX*tw),y:Math.floor(t.anchorY*tw)})),crossTileIDs:i.map(t=>t.crossTileID)};if(r.positions.length>128){const t=new n.aT(r.positions.length,16,Uint16Array);for(const{x:n,y:i}of r.positions)t.add(n,i);t.finish(),delete r.positions,r.index=t}this._symbolsByKey[t]=r}}getScaledCoordinates(t,i){let{x:r,y:o,z:a}=this.tileID.canonical,{x:s,y:l,z:c}=i.canonical,u=tw/Math.pow(2,c-a),d=(l*n.a5+t.anchorY)*u,h=o*n.a5*tw;return{x:Math.floor((s*n.a5+t.anchorX)*u-r*n.a5*tw),y:Math.floor(d-h)}}findMatches(t,n,i){let r=this.tileID.canonical.z<n.canonical.z?1:Math.pow(2,this.tileID.canonical.z-n.canonical.z);for(let o=0;o<t.length;o++){let a=t.get(o);if(a.crossTileID)continue;let s=this._symbolsByKey[a.key];if(!s)continue;let l=this.getScaledCoordinates(a,n);if(s.index)for(let t of s.index.range(l.x-r,l.y-r,l.x+r,l.y+r).sort()){let n=s.crossTileIDs[t];if(!i[n]){i[n]=!0,a.crossTileID=n;break}}else if(s.positions)for(let t=0;t<s.positions.length;t++){let n=s.positions[t],o=s.crossTileIDs[t];if(Math.abs(n.x-l.x)<=r&&Math.abs(n.y-l.y)<=r&&!i[o]){i[o]=!0,a.crossTileID=o;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:t})=>t)}}class tC{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class tA{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){let n=Math.round((t-this.lng)/360);if(0!==n)for(let t in this.indexes){let i=this.indexes[t],r={};for(let t in i){let o=i[t];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+n),r[o.tileID.key]=o}this.indexes[t]=r}this.lng=t}addBucket(t,n,i){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===n.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let t=0;t<n.symbolInstances.length;t++)n.symbolInstances.get(t).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});let r=this.usedCrossTileIDs[t.overscaledZ];for(let i in this.indexes){let o=this.indexes[i];if(Number(i)>t.overscaledZ)for(let i in o){let a=o[i];a.tileID.isChildOf(t)&&a.findMatches(n.symbolInstances,t,r)}else{let a=o[t.scaledTo(Number(i)).key];a&&a.findMatches(n.symbolInstances,t,r)}}for(let t=0;t<n.symbolInstances.length;t++){let o=n.symbolInstances.get(t);o.crossTileID||(o.crossTileID=i.generate(),r[o.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new tk(t,n.symbolInstances,n.bucketInstanceId),!0}removeBucketCrossTileIDs(t,n){for(let i of n.getCrossTileIDsLists())for(let n of i)delete this.usedCrossTileIDs[t][n]}removeStaleBuckets(t){let n=!1;for(let i in this.indexes){let r=this.indexes[i];for(let o in r)t[r[o].bucketInstanceId]||(this.removeBucketCrossTileIDs(i,r[o]),delete r[o],n=!0)}return n}}class tE{constructor(){this.layerIndexes={},this.crossTileIDs=new tC,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(t,n,i){let r=this.layerIndexes[t.id];void 0===r&&(r=this.layerIndexes[t.id]=new tA);let o=!1,a={};for(let s of(r.handleWrapJump(i),n)){let n=s.getBucket(t);n&&t.id===n.layerIds[0]&&(n.bucketInstanceId||(n.bucketInstanceId=++this.maxBucketInstanceId),r.addBucket(s.tileID,n,this.crossTileIDs)&&(o=!0),a[n.bucketInstanceId]=!0)}return r.removeStaleBuckets(a)&&(o=!0),o}pruneUnusedLayers(t){let n={};for(let i in t.forEach(t=>{n[t]=!0}),this.layerIndexes)n[i]||delete this.layerIndexes[i]}}var tS="void main() {fragColor=vec4(1.0);}";let tT={prelude:tO("#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:tO("","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:tO("","#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:tO("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:tO("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:tO("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:tO(tS,"in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),heatmap:tO("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:tO("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:tO("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:tO("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:tO("#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:tO("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:tO(tS,"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:tO("#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:tO("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:tO("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:tO("#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:tO("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:tO("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:tO("#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:tO("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:tO("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:tO("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:tO("#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:tO("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:tO("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:tO("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:tO("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:tO("#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:tO("#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:tO("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:tO("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:tO("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:tO("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:tO("#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:tO("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 tO(t,n){let i=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r=n.match(/in ([\w]+) ([\w]+)/g),o=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=n.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),s=a?a.concat(o):o,l={};return{fragmentSource:t=t.replace(i,(t,n,i,r,o)=>(l[o]=!0,"define"===n?`
|
|
7023
7023
|
#ifndef HAS_UNIFORM_u_${o}
|
|
7024
7024
|
in ${i} ${r} ${o};
|
|
@@ -13302,7 +13302,7 @@ ${s.shaderPreludeCode.vertexSource}`,define:s.shaderDefine},defaultProjectionDat
|
|
|
13302
13302
|
`)}
|
|
13303
13303
|
</or-panel>
|
|
13304
13304
|
<div style="margin: 0px auto; font-size: smaller;">
|
|
13305
|
-
OpenRemote Manager v${"1.25.0
|
|
13305
|
+
OpenRemote Manager v${"1.25.0"}
|
|
13306
13306
|
</div>
|
|
13307
13307
|
</div>
|
|
13308
13308
|
`})}
|