@opengis/gis 0.1.64 → 0.1.66

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.
@@ -1,869 +0,0 @@
1
- "use strict";var $_=Object.defineProperty;var e0=(u,f,_)=>f in u?$_(u,f,{enumerable:!0,configurable:!0,writable:!0,value:_}):u[f]=_;var dr=(u,f,_)=>e0(u,typeof f!="symbol"?f+"":f,_);const g=require("vue");function fg(u,f){return function(){return u.apply(f,arguments)}}const{toString:t0}=Object.prototype,{getPrototypeOf:rd}=Object,{iterator:oh,toStringTag:mg}=Symbol,ah=(u=>f=>{const _=t0.call(f);return u[_]||(u[_]=_.slice(8,-1).toLowerCase())})(Object.create(null)),wn=u=>(u=u.toLowerCase(),f=>ah(f)===u),lh=u=>f=>typeof f===u,{isArray:Va}=Array,rc=lh("undefined");function r0(u){return u!==null&&!rc(u)&&u.constructor!==null&&!rc(u.constructor)&&Hi(u.constructor.isBuffer)&&u.constructor.isBuffer(u)}const gg=wn("ArrayBuffer");function i0(u){let f;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?f=ArrayBuffer.isView(u):f=u&&u.buffer&&gg(u.buffer),f}const n0=lh("string"),Hi=lh("function"),yg=lh("number"),ch=u=>u!==null&&typeof u=="object",s0=u=>u===!0||u===!1,Gu=u=>{if(ah(u)!=="object")return!1;const f=rd(u);return(f===null||f===Object.prototype||Object.getPrototypeOf(f)===null)&&!(mg in u)&&!(oh in u)},o0=wn("Date"),a0=wn("File"),l0=wn("Blob"),c0=wn("FileList"),u0=u=>ch(u)&&Hi(u.pipe),h0=u=>{let f;return u&&(typeof FormData=="function"&&u instanceof FormData||Hi(u.append)&&((f=ah(u))==="formdata"||f==="object"&&Hi(u.toString)&&u.toString()==="[object FormData]"))},p0=wn("URLSearchParams"),[d0,f0,m0,g0]=["ReadableStream","Request","Response","Headers"].map(wn),y0=u=>u.trim?u.trim():u.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ic(u,f,{allOwnKeys:_=!1}={}){if(u===null||typeof u>"u")return;let b,k;if(typeof u!="object"&&(u=[u]),Va(u))for(b=0,k=u.length;b<k;b++)f.call(null,u[b],b,u);else{const T=_?Object.getOwnPropertyNames(u):Object.keys(u),x=T.length;let s;for(b=0;b<x;b++)s=T[b],f.call(null,u[s],s,u)}}function _g(u,f){f=f.toLowerCase();const _=Object.keys(u);let b=_.length,k;for(;b-- >0;)if(k=_[b],f===k.toLowerCase())return k;return null}const To=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,vg=u=>!rc(u)&&u!==To;function Hp(){const{caseless:u}=vg(this)&&this||{},f={},_=(b,k)=>{const T=u&&_g(f,k)||k;Gu(f[T])&&Gu(b)?f[T]=Hp(f[T],b):Gu(b)?f[T]=Hp({},b):Va(b)?f[T]=b.slice():f[T]=b};for(let b=0,k=arguments.length;b<k;b++)arguments[b]&&ic(arguments[b],_);return f}const _0=(u,f,_,{allOwnKeys:b}={})=>(ic(f,(k,T)=>{_&&Hi(k)?u[T]=fg(k,_):u[T]=k},{allOwnKeys:b}),u),v0=u=>(u.charCodeAt(0)===65279&&(u=u.slice(1)),u),x0=(u,f,_,b)=>{u.prototype=Object.create(f.prototype,b),u.prototype.constructor=u,Object.defineProperty(u,"super",{value:f.prototype}),_&&Object.assign(u.prototype,_)},b0=(u,f,_,b)=>{let k,T,x;const s={};if(f=f||{},u==null)return f;do{for(k=Object.getOwnPropertyNames(u),T=k.length;T-- >0;)x=k[T],(!b||b(x,u,f))&&!s[x]&&(f[x]=u[x],s[x]=!0);u=_!==!1&&rd(u)}while(u&&(!_||_(u,f))&&u!==Object.prototype);return f},w0=(u,f,_)=>{u=String(u),(_===void 0||_>u.length)&&(_=u.length),_-=f.length;const b=u.indexOf(f,_);return b!==-1&&b===_},S0=u=>{if(!u)return null;if(Va(u))return u;let f=u.length;if(!yg(f))return null;const _=new Array(f);for(;f-- >0;)_[f]=u[f];return _},k0=(u=>f=>u&&f instanceof u)(typeof Uint8Array<"u"&&rd(Uint8Array)),A0=(u,f)=>{const b=(u&&u[oh]).call(u);let k;for(;(k=b.next())&&!k.done;){const T=k.value;f.call(u,T[0],T[1])}},C0=(u,f)=>{let _;const b=[];for(;(_=u.exec(f))!==null;)b.push(_);return b},T0=wn("HTMLFormElement"),E0=u=>u.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(_,b,k){return b.toUpperCase()+k}),im=(({hasOwnProperty:u})=>(f,_)=>u.call(f,_))(Object.prototype),P0=wn("RegExp"),xg=(u,f)=>{const _=Object.getOwnPropertyDescriptors(u),b={};ic(_,(k,T)=>{let x;(x=f(k,T,u))!==!1&&(b[T]=x||k)}),Object.defineProperties(u,b)},I0=u=>{xg(u,(f,_)=>{if(Hi(u)&&["arguments","caller","callee"].indexOf(_)!==-1)return!1;const b=u[_];if(Hi(b)){if(f.enumerable=!1,"writable"in f){f.writable=!1;return}f.set||(f.set=()=>{throw Error("Can not rewrite read-only method '"+_+"'")})}})},M0=(u,f)=>{const _={},b=k=>{k.forEach(T=>{_[T]=!0})};return Va(u)?b(u):b(String(u).split(f)),_},L0=()=>{},R0=(u,f)=>u!=null&&Number.isFinite(u=+u)?u:f;function B0(u){return!!(u&&Hi(u.append)&&u[mg]==="FormData"&&u[oh])}const D0=u=>{const f=new Array(10),_=(b,k)=>{if(ch(b)){if(f.indexOf(b)>=0)return;if(!("toJSON"in b)){f[k]=b;const T=Va(b)?[]:{};return ic(b,(x,s)=>{const V=_(x,k+1);!rc(V)&&(T[s]=V)}),f[k]=void 0,T}}return b};return _(u,0)},V0=wn("AsyncFunction"),z0=u=>u&&(ch(u)||Hi(u))&&Hi(u.then)&&Hi(u.catch),bg=((u,f)=>u?setImmediate:f?((_,b)=>(To.addEventListener("message",({source:k,data:T})=>{k===To&&T===_&&b.length&&b.shift()()},!1),k=>{b.push(k),To.postMessage(_,"*")}))(`axios@${Math.random()}`,[]):_=>setTimeout(_))(typeof setImmediate=="function",Hi(To.postMessage)),F0=typeof queueMicrotask<"u"?queueMicrotask.bind(To):typeof process<"u"&&process.nextTick||bg,O0=u=>u!=null&&Hi(u[oh]),Ne={isArray:Va,isArrayBuffer:gg,isBuffer:r0,isFormData:h0,isArrayBufferView:i0,isString:n0,isNumber:yg,isBoolean:s0,isObject:ch,isPlainObject:Gu,isReadableStream:d0,isRequest:f0,isResponse:m0,isHeaders:g0,isUndefined:rc,isDate:o0,isFile:a0,isBlob:l0,isRegExp:P0,isFunction:Hi,isStream:u0,isURLSearchParams:p0,isTypedArray:k0,isFileList:c0,forEach:ic,merge:Hp,extend:_0,trim:y0,stripBOM:v0,inherits:x0,toFlatObject:b0,kindOf:ah,kindOfTest:wn,endsWith:w0,toArray:S0,forEachEntry:A0,matchAll:C0,isHTMLForm:T0,hasOwnProperty:im,hasOwnProp:im,reduceDescriptors:xg,freezeMethods:I0,toObjectSet:M0,toCamelCase:E0,noop:L0,toFiniteNumber:R0,findKey:_g,global:To,isContextDefined:vg,isSpecCompliantForm:B0,toJSONObject:D0,isAsyncFn:V0,isThenable:z0,setImmediate:bg,asap:F0,isIterable:O0};function Dt(u,f,_,b,k){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=u,this.name="AxiosError",f&&(this.code=f),_&&(this.config=_),b&&(this.request=b),k&&(this.response=k,this.status=k.status?k.status:null)}Ne.inherits(Dt,Error,{toJSON:function(){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:Ne.toJSONObject(this.config),code:this.code,status:this.status}}});const wg=Dt.prototype,Sg={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(u=>{Sg[u]={value:u}});Object.defineProperties(Dt,Sg);Object.defineProperty(wg,"isAxiosError",{value:!0});Dt.from=(u,f,_,b,k,T)=>{const x=Object.create(wg);return Ne.toFlatObject(u,x,function(V){return V!==Error.prototype},s=>s!=="isAxiosError"),Dt.call(x,u.message,f,_,b,k),x.cause=u,x.name=u.name,T&&Object.assign(x,T),x};const N0=null;function Zp(u){return Ne.isPlainObject(u)||Ne.isArray(u)}function kg(u){return Ne.endsWith(u,"[]")?u.slice(0,-2):u}function nm(u,f,_){return u?u.concat(f).map(function(k,T){return k=kg(k),!_&&T?"["+k+"]":k}).join(_?".":""):f}function q0(u){return Ne.isArray(u)&&!u.some(Zp)}const U0=Ne.toFlatObject(Ne,{},null,function(f){return/^is[A-Z]/.test(f)});function uh(u,f,_){if(!Ne.isObject(u))throw new TypeError("target must be an object");f=f||new FormData,_=Ne.toFlatObject(_,{metaTokens:!0,dots:!1,indexes:!1},!1,function(W,J){return!Ne.isUndefined(J[W])});const b=_.metaTokens,k=_.visitor||L,T=_.dots,x=_.indexes,V=(_.Blob||typeof Blob<"u"&&Blob)&&Ne.isSpecCompliantForm(f);if(!Ne.isFunction(k))throw new TypeError("visitor must be a function");function P(C){if(C===null)return"";if(Ne.isDate(C))return C.toISOString();if(!V&&Ne.isBlob(C))throw new Dt("Blob is not supported. Use a Buffer instead.");return Ne.isArrayBuffer(C)||Ne.isTypedArray(C)?V&&typeof Blob=="function"?new Blob([C]):Buffer.from(C):C}function L(C,W,J){let se=C;if(C&&!J&&typeof C=="object"){if(Ne.endsWith(W,"{}"))W=b?W:W.slice(0,-2),C=JSON.stringify(C);else if(Ne.isArray(C)&&q0(C)||(Ne.isFileList(C)||Ne.endsWith(W,"[]"))&&(se=Ne.toArray(C)))return W=kg(W),se.forEach(function(Se,$){!(Ne.isUndefined(Se)||Se===null)&&f.append(x===!0?nm([W],$,T):x===null?W:W+"[]",P(Se))}),!1}return Zp(C)?!0:(f.append(nm(J,W,T),P(C)),!1)}const F=[],M=Object.assign(U0,{defaultVisitor:L,convertValue:P,isVisitable:Zp});function E(C,W){if(!Ne.isUndefined(C)){if(F.indexOf(C)!==-1)throw Error("Circular reference detected in "+W.join("."));F.push(C),Ne.forEach(C,function(se,oe){(!(Ne.isUndefined(se)||se===null)&&k.call(f,se,Ne.isString(oe)?oe.trim():oe,W,M))===!0&&E(se,W?W.concat(oe):[oe])}),F.pop()}}if(!Ne.isObject(u))throw new TypeError("data must be an object");return E(u),f}function sm(u){const f={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(u).replace(/[!'()~]|%20|%00/g,function(b){return f[b]})}function id(u,f){this._pairs=[],u&&uh(u,this,f)}const Ag=id.prototype;Ag.append=function(f,_){this._pairs.push([f,_])};Ag.toString=function(f){const _=f?function(b){return f.call(this,b,sm)}:sm;return this._pairs.map(function(k){return _(k[0])+"="+_(k[1])},"").join("&")};function j0(u){return encodeURIComponent(u).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Cg(u,f,_){if(!f)return u;const b=_&&_.encode||j0;Ne.isFunction(_)&&(_={serialize:_});const k=_&&_.serialize;let T;if(k?T=k(f,_):T=Ne.isURLSearchParams(f)?f.toString():new id(f,_).toString(b),T){const x=u.indexOf("#");x!==-1&&(u=u.slice(0,x)),u+=(u.indexOf("?")===-1?"?":"&")+T}return u}class om{constructor(){this.handlers=[]}use(f,_,b){return this.handlers.push({fulfilled:f,rejected:_,synchronous:b?b.synchronous:!1,runWhen:b?b.runWhen:null}),this.handlers.length-1}eject(f){this.handlers[f]&&(this.handlers[f]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(f){Ne.forEach(this.handlers,function(b){b!==null&&f(b)})}}const Tg={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},W0=typeof URLSearchParams<"u"?URLSearchParams:id,H0=typeof FormData<"u"?FormData:null,Z0=typeof Blob<"u"?Blob:null,K0={isBrowser:!0,classes:{URLSearchParams:W0,FormData:H0,Blob:Z0},protocols:["http","https","file","blob","url","data"]},nd=typeof window<"u"&&typeof document<"u",Kp=typeof navigator=="object"&&navigator||void 0,G0=nd&&(!Kp||["ReactNative","NativeScript","NS"].indexOf(Kp.product)<0),J0=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",X0=nd&&window.location.href||"http://localhost",Q0=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:nd,hasStandardBrowserEnv:G0,hasStandardBrowserWebWorkerEnv:J0,navigator:Kp,origin:X0},Symbol.toStringTag,{value:"Module"})),Ti={...Q0,...K0};function Y0(u,f){return uh(u,new Ti.classes.URLSearchParams,Object.assign({visitor:function(_,b,k,T){return Ti.isNode&&Ne.isBuffer(_)?(this.append(b,_.toString("base64")),!1):T.defaultVisitor.apply(this,arguments)}},f))}function $0(u){return Ne.matchAll(/\w+|\[(\w*)]/g,u).map(f=>f[0]==="[]"?"":f[1]||f[0])}function ev(u){const f={},_=Object.keys(u);let b;const k=_.length;let T;for(b=0;b<k;b++)T=_[b],f[T]=u[T];return f}function Eg(u){function f(_,b,k,T){let x=_[T++];if(x==="__proto__")return!0;const s=Number.isFinite(+x),V=T>=_.length;return x=!x&&Ne.isArray(k)?k.length:x,V?(Ne.hasOwnProp(k,x)?k[x]=[k[x],b]:k[x]=b,!s):((!k[x]||!Ne.isObject(k[x]))&&(k[x]=[]),f(_,b,k[x],T)&&Ne.isArray(k[x])&&(k[x]=ev(k[x])),!s)}if(Ne.isFormData(u)&&Ne.isFunction(u.entries)){const _={};return Ne.forEachEntry(u,(b,k)=>{f($0(b),k,_,0)}),_}return null}function tv(u,f,_){if(Ne.isString(u))try{return(f||JSON.parse)(u),Ne.trim(u)}catch(b){if(b.name!=="SyntaxError")throw b}return(_||JSON.stringify)(u)}const nc={transitional:Tg,adapter:["xhr","http","fetch"],transformRequest:[function(f,_){const b=_.getContentType()||"",k=b.indexOf("application/json")>-1,T=Ne.isObject(f);if(T&&Ne.isHTMLForm(f)&&(f=new FormData(f)),Ne.isFormData(f))return k?JSON.stringify(Eg(f)):f;if(Ne.isArrayBuffer(f)||Ne.isBuffer(f)||Ne.isStream(f)||Ne.isFile(f)||Ne.isBlob(f)||Ne.isReadableStream(f))return f;if(Ne.isArrayBufferView(f))return f.buffer;if(Ne.isURLSearchParams(f))return _.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),f.toString();let s;if(T){if(b.indexOf("application/x-www-form-urlencoded")>-1)return Y0(f,this.formSerializer).toString();if((s=Ne.isFileList(f))||b.indexOf("multipart/form-data")>-1){const V=this.env&&this.env.FormData;return uh(s?{"files[]":f}:f,V&&new V,this.formSerializer)}}return T||k?(_.setContentType("application/json",!1),tv(f)):f}],transformResponse:[function(f){const _=this.transitional||nc.transitional,b=_&&_.forcedJSONParsing,k=this.responseType==="json";if(Ne.isResponse(f)||Ne.isReadableStream(f))return f;if(f&&Ne.isString(f)&&(b&&!this.responseType||k)){const x=!(_&&_.silentJSONParsing)&&k;try{return JSON.parse(f)}catch(s){if(x)throw s.name==="SyntaxError"?Dt.from(s,Dt.ERR_BAD_RESPONSE,this,null,this.response):s}}return f}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ti.classes.FormData,Blob:Ti.classes.Blob},validateStatus:function(f){return f>=200&&f<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ne.forEach(["delete","get","head","post","put","patch"],u=>{nc.headers[u]={}});const rv=Ne.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"]),iv=u=>{const f={};let _,b,k;return u&&u.split(`
2
- `).forEach(function(x){k=x.indexOf(":"),_=x.substring(0,k).trim().toLowerCase(),b=x.substring(k+1).trim(),!(!_||f[_]&&rv[_])&&(_==="set-cookie"?f[_]?f[_].push(b):f[_]=[b]:f[_]=f[_]?f[_]+", "+b:b)}),f},am=Symbol("internals");function Gl(u){return u&&String(u).trim().toLowerCase()}function Ju(u){return u===!1||u==null?u:Ne.isArray(u)?u.map(Ju):String(u)}function nv(u){const f=Object.create(null),_=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let b;for(;b=_.exec(u);)f[b[1]]=b[2];return f}const sv=u=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(u.trim());function Rp(u,f,_,b,k){if(Ne.isFunction(b))return b.call(this,f,_);if(k&&(f=_),!!Ne.isString(f)){if(Ne.isString(b))return f.indexOf(b)!==-1;if(Ne.isRegExp(b))return b.test(f)}}function ov(u){return u.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(f,_,b)=>_.toUpperCase()+b)}function av(u,f){const _=Ne.toCamelCase(" "+f);["get","set","has"].forEach(b=>{Object.defineProperty(u,b+_,{value:function(k,T,x){return this[b].call(this,f,k,T,x)},configurable:!0})})}let Zi=class{constructor(f){f&&this.set(f)}set(f,_,b){const k=this;function T(s,V,P){const L=Gl(V);if(!L)throw new Error("header name must be a non-empty string");const F=Ne.findKey(k,L);(!F||k[F]===void 0||P===!0||P===void 0&&k[F]!==!1)&&(k[F||V]=Ju(s))}const x=(s,V)=>Ne.forEach(s,(P,L)=>T(P,L,V));if(Ne.isPlainObject(f)||f instanceof this.constructor)x(f,_);else if(Ne.isString(f)&&(f=f.trim())&&!sv(f))x(iv(f),_);else if(Ne.isObject(f)&&Ne.isIterable(f)){let s={},V,P;for(const L of f){if(!Ne.isArray(L))throw TypeError("Object iterator must return a key-value pair");s[P=L[0]]=(V=s[P])?Ne.isArray(V)?[...V,L[1]]:[V,L[1]]:L[1]}x(s,_)}else f!=null&&T(_,f,b);return this}get(f,_){if(f=Gl(f),f){const b=Ne.findKey(this,f);if(b){const k=this[b];if(!_)return k;if(_===!0)return nv(k);if(Ne.isFunction(_))return _.call(this,k,b);if(Ne.isRegExp(_))return _.exec(k);throw new TypeError("parser must be boolean|regexp|function")}}}has(f,_){if(f=Gl(f),f){const b=Ne.findKey(this,f);return!!(b&&this[b]!==void 0&&(!_||Rp(this,this[b],b,_)))}return!1}delete(f,_){const b=this;let k=!1;function T(x){if(x=Gl(x),x){const s=Ne.findKey(b,x);s&&(!_||Rp(b,b[s],s,_))&&(delete b[s],k=!0)}}return Ne.isArray(f)?f.forEach(T):T(f),k}clear(f){const _=Object.keys(this);let b=_.length,k=!1;for(;b--;){const T=_[b];(!f||Rp(this,this[T],T,f,!0))&&(delete this[T],k=!0)}return k}normalize(f){const _=this,b={};return Ne.forEach(this,(k,T)=>{const x=Ne.findKey(b,T);if(x){_[x]=Ju(k),delete _[T];return}const s=f?ov(T):String(T).trim();s!==T&&delete _[T],_[s]=Ju(k),b[s]=!0}),this}concat(...f){return this.constructor.concat(this,...f)}toJSON(f){const _=Object.create(null);return Ne.forEach(this,(b,k)=>{b!=null&&b!==!1&&(_[k]=f&&Ne.isArray(b)?b.join(", "):b)}),_}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([f,_])=>f+": "+_).join(`
3
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(f){return f instanceof this?f:new this(f)}static concat(f,..._){const b=new this(f);return _.forEach(k=>b.set(k)),b}static accessor(f){const b=(this[am]=this[am]={accessors:{}}).accessors,k=this.prototype;function T(x){const s=Gl(x);b[s]||(av(k,x),b[s]=!0)}return Ne.isArray(f)?f.forEach(T):T(f),this}};Zi.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Ne.reduceDescriptors(Zi.prototype,({value:u},f)=>{let _=f[0].toUpperCase()+f.slice(1);return{get:()=>u,set(b){this[_]=b}}});Ne.freezeMethods(Zi);function Bp(u,f){const _=this||nc,b=f||_,k=Zi.from(b.headers);let T=b.data;return Ne.forEach(u,function(s){T=s.call(_,T,k.normalize(),f?f.status:void 0)}),k.normalize(),T}function Pg(u){return!!(u&&u.__CANCEL__)}function za(u,f,_){Dt.call(this,u??"canceled",Dt.ERR_CANCELED,f,_),this.name="CanceledError"}Ne.inherits(za,Dt,{__CANCEL__:!0});function Ig(u,f,_){const b=_.config.validateStatus;!_.status||!b||b(_.status)?u(_):f(new Dt("Request failed with status code "+_.status,[Dt.ERR_BAD_REQUEST,Dt.ERR_BAD_RESPONSE][Math.floor(_.status/100)-4],_.config,_.request,_))}function lv(u){const f=/^([-+\w]{1,25})(:?\/\/|:)/.exec(u);return f&&f[1]||""}function cv(u,f){u=u||10;const _=new Array(u),b=new Array(u);let k=0,T=0,x;return f=f!==void 0?f:1e3,function(V){const P=Date.now(),L=b[T];x||(x=P),_[k]=V,b[k]=P;let F=T,M=0;for(;F!==k;)M+=_[F++],F=F%u;if(k=(k+1)%u,k===T&&(T=(T+1)%u),P-x<f)return;const E=L&&P-L;return E?Math.round(M*1e3/E):void 0}}function uv(u,f){let _=0,b=1e3/f,k,T;const x=(P,L=Date.now())=>{_=L,k=null,T&&(clearTimeout(T),T=null),u.apply(null,P)};return[(...P)=>{const L=Date.now(),F=L-_;F>=b?x(P,L):(k=P,T||(T=setTimeout(()=>{T=null,x(k)},b-F)))},()=>k&&x(k)]}const $u=(u,f,_=3)=>{let b=0;const k=cv(50,250);return uv(T=>{const x=T.loaded,s=T.lengthComputable?T.total:void 0,V=x-b,P=k(V),L=x<=s;b=x;const F={loaded:x,total:s,progress:s?x/s:void 0,bytes:V,rate:P||void 0,estimated:P&&s&&L?(s-x)/P:void 0,event:T,lengthComputable:s!=null,[f?"download":"upload"]:!0};u(F)},_)},lm=(u,f)=>{const _=u!=null;return[b=>f[0]({lengthComputable:_,total:u,loaded:b}),f[1]]},cm=u=>(...f)=>Ne.asap(()=>u(...f)),hv=Ti.hasStandardBrowserEnv?((u,f)=>_=>(_=new URL(_,Ti.origin),u.protocol===_.protocol&&u.host===_.host&&(f||u.port===_.port)))(new URL(Ti.origin),Ti.navigator&&/(msie|trident)/i.test(Ti.navigator.userAgent)):()=>!0,pv=Ti.hasStandardBrowserEnv?{write(u,f,_,b,k,T){const x=[u+"="+encodeURIComponent(f)];Ne.isNumber(_)&&x.push("expires="+new Date(_).toGMTString()),Ne.isString(b)&&x.push("path="+b),Ne.isString(k)&&x.push("domain="+k),T===!0&&x.push("secure"),document.cookie=x.join("; ")},read(u){const f=document.cookie.match(new RegExp("(^|;\\s*)("+u+")=([^;]*)"));return f?decodeURIComponent(f[3]):null},remove(u){this.write(u,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function dv(u){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(u)}function fv(u,f){return f?u.replace(/\/?\/$/,"")+"/"+f.replace(/^\/+/,""):u}function Mg(u,f,_){let b=!dv(f);return u&&(b||_==!1)?fv(u,f):f}const um=u=>u instanceof Zi?{...u}:u;function Io(u,f){f=f||{};const _={};function b(P,L,F,M){return Ne.isPlainObject(P)&&Ne.isPlainObject(L)?Ne.merge.call({caseless:M},P,L):Ne.isPlainObject(L)?Ne.merge({},L):Ne.isArray(L)?L.slice():L}function k(P,L,F,M){if(Ne.isUndefined(L)){if(!Ne.isUndefined(P))return b(void 0,P,F,M)}else return b(P,L,F,M)}function T(P,L){if(!Ne.isUndefined(L))return b(void 0,L)}function x(P,L){if(Ne.isUndefined(L)){if(!Ne.isUndefined(P))return b(void 0,P)}else return b(void 0,L)}function s(P,L,F){if(F in f)return b(P,L);if(F in u)return b(void 0,P)}const V={url:T,method:T,data:T,baseURL:x,transformRequest:x,transformResponse:x,paramsSerializer:x,timeout:x,timeoutMessage:x,withCredentials:x,withXSRFToken:x,adapter:x,responseType:x,xsrfCookieName:x,xsrfHeaderName:x,onUploadProgress:x,onDownloadProgress:x,decompress:x,maxContentLength:x,maxBodyLength:x,beforeRedirect:x,transport:x,httpAgent:x,httpsAgent:x,cancelToken:x,socketPath:x,responseEncoding:x,validateStatus:s,headers:(P,L,F)=>k(um(P),um(L),F,!0)};return Ne.forEach(Object.keys(Object.assign({},u,f)),function(L){const F=V[L]||k,M=F(u[L],f[L],L);Ne.isUndefined(M)&&F!==s||(_[L]=M)}),_}const Lg=u=>{const f=Io({},u);let{data:_,withXSRFToken:b,xsrfHeaderName:k,xsrfCookieName:T,headers:x,auth:s}=f;f.headers=x=Zi.from(x),f.url=Cg(Mg(f.baseURL,f.url,f.allowAbsoluteUrls),u.params,u.paramsSerializer),s&&x.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):"")));let V;if(Ne.isFormData(_)){if(Ti.hasStandardBrowserEnv||Ti.hasStandardBrowserWebWorkerEnv)x.setContentType(void 0);else if((V=x.getContentType())!==!1){const[P,...L]=V?V.split(";").map(F=>F.trim()).filter(Boolean):[];x.setContentType([P||"multipart/form-data",...L].join("; "))}}if(Ti.hasStandardBrowserEnv&&(b&&Ne.isFunction(b)&&(b=b(f)),b||b!==!1&&hv(f.url))){const P=k&&T&&pv.read(T);P&&x.set(k,P)}return f},mv=typeof XMLHttpRequest<"u",gv=mv&&function(u){return new Promise(function(_,b){const k=Lg(u);let T=k.data;const x=Zi.from(k.headers).normalize();let{responseType:s,onUploadProgress:V,onDownloadProgress:P}=k,L,F,M,E,C;function W(){E&&E(),C&&C(),k.cancelToken&&k.cancelToken.unsubscribe(L),k.signal&&k.signal.removeEventListener("abort",L)}let J=new XMLHttpRequest;J.open(k.method.toUpperCase(),k.url,!0),J.timeout=k.timeout;function se(){if(!J)return;const Se=Zi.from("getAllResponseHeaders"in J&&J.getAllResponseHeaders()),de={data:!s||s==="text"||s==="json"?J.responseText:J.response,status:J.status,statusText:J.statusText,headers:Se,config:u,request:J};Ig(function(Re){_(Re),W()},function(Re){b(Re),W()},de),J=null}"onloadend"in J?J.onloadend=se:J.onreadystatechange=function(){!J||J.readyState!==4||J.status===0&&!(J.responseURL&&J.responseURL.indexOf("file:")===0)||setTimeout(se)},J.onabort=function(){J&&(b(new Dt("Request aborted",Dt.ECONNABORTED,u,J)),J=null)},J.onerror=function(){b(new Dt("Network Error",Dt.ERR_NETWORK,u,J)),J=null},J.ontimeout=function(){let $=k.timeout?"timeout of "+k.timeout+"ms exceeded":"timeout exceeded";const de=k.transitional||Tg;k.timeoutErrorMessage&&($=k.timeoutErrorMessage),b(new Dt($,de.clarifyTimeoutError?Dt.ETIMEDOUT:Dt.ECONNABORTED,u,J)),J=null},T===void 0&&x.setContentType(null),"setRequestHeader"in J&&Ne.forEach(x.toJSON(),function($,de){J.setRequestHeader(de,$)}),Ne.isUndefined(k.withCredentials)||(J.withCredentials=!!k.withCredentials),s&&s!=="json"&&(J.responseType=k.responseType),P&&([M,C]=$u(P,!0),J.addEventListener("progress",M)),V&&J.upload&&([F,E]=$u(V),J.upload.addEventListener("progress",F),J.upload.addEventListener("loadend",E)),(k.cancelToken||k.signal)&&(L=Se=>{J&&(b(!Se||Se.type?new za(null,u,J):Se),J.abort(),J=null)},k.cancelToken&&k.cancelToken.subscribe(L),k.signal&&(k.signal.aborted?L():k.signal.addEventListener("abort",L)));const oe=lv(k.url);if(oe&&Ti.protocols.indexOf(oe)===-1){b(new Dt("Unsupported protocol "+oe+":",Dt.ERR_BAD_REQUEST,u));return}J.send(T||null)})},yv=(u,f)=>{const{length:_}=u=u?u.filter(Boolean):[];if(f||_){let b=new AbortController,k;const T=function(P){if(!k){k=!0,s();const L=P instanceof Error?P:this.reason;b.abort(L instanceof Dt?L:new za(L instanceof Error?L.message:L))}};let x=f&&setTimeout(()=>{x=null,T(new Dt(`timeout ${f} of ms exceeded`,Dt.ETIMEDOUT))},f);const s=()=>{u&&(x&&clearTimeout(x),x=null,u.forEach(P=>{P.unsubscribe?P.unsubscribe(T):P.removeEventListener("abort",T)}),u=null)};u.forEach(P=>P.addEventListener("abort",T));const{signal:V}=b;return V.unsubscribe=()=>Ne.asap(s),V}},_v=function*(u,f){let _=u.byteLength;if(_<f){yield u;return}let b=0,k;for(;b<_;)k=b+f,yield u.slice(b,k),b=k},vv=async function*(u,f){for await(const _ of xv(u))yield*_v(_,f)},xv=async function*(u){if(u[Symbol.asyncIterator]){yield*u;return}const f=u.getReader();try{for(;;){const{done:_,value:b}=await f.read();if(_)break;yield b}}finally{await f.cancel()}},hm=(u,f,_,b)=>{const k=vv(u,f);let T=0,x,s=V=>{x||(x=!0,b&&b(V))};return new ReadableStream({async pull(V){try{const{done:P,value:L}=await k.next();if(P){s(),V.close();return}let F=L.byteLength;if(_){let M=T+=F;_(M)}V.enqueue(new Uint8Array(L))}catch(P){throw s(P),P}},cancel(V){return s(V),k.return()}},{highWaterMark:2})},hh=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Rg=hh&&typeof ReadableStream=="function",bv=hh&&(typeof TextEncoder=="function"?(u=>f=>u.encode(f))(new TextEncoder):async u=>new Uint8Array(await new Response(u).arrayBuffer())),Bg=(u,...f)=>{try{return!!u(...f)}catch{return!1}},wv=Rg&&Bg(()=>{let u=!1;const f=new Request(Ti.origin,{body:new ReadableStream,method:"POST",get duplex(){return u=!0,"half"}}).headers.has("Content-Type");return u&&!f}),pm=64*1024,Gp=Rg&&Bg(()=>Ne.isReadableStream(new Response("").body)),eh={stream:Gp&&(u=>u.body)};hh&&(u=>{["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!eh[f]&&(eh[f]=Ne.isFunction(u[f])?_=>_[f]():(_,b)=>{throw new Dt(`Response type '${f}' is not supported`,Dt.ERR_NOT_SUPPORT,b)})})})(new Response);const Sv=async u=>{if(u==null)return 0;if(Ne.isBlob(u))return u.size;if(Ne.isSpecCompliantForm(u))return(await new Request(Ti.origin,{method:"POST",body:u}).arrayBuffer()).byteLength;if(Ne.isArrayBufferView(u)||Ne.isArrayBuffer(u))return u.byteLength;if(Ne.isURLSearchParams(u)&&(u=u+""),Ne.isString(u))return(await bv(u)).byteLength},kv=async(u,f)=>{const _=Ne.toFiniteNumber(u.getContentLength());return _??Sv(f)},Av=hh&&(async u=>{let{url:f,method:_,data:b,signal:k,cancelToken:T,timeout:x,onDownloadProgress:s,onUploadProgress:V,responseType:P,headers:L,withCredentials:F="same-origin",fetchOptions:M}=Lg(u);P=P?(P+"").toLowerCase():"text";let E=yv([k,T&&T.toAbortSignal()],x),C;const W=E&&E.unsubscribe&&(()=>{E.unsubscribe()});let J;try{if(V&&wv&&_!=="get"&&_!=="head"&&(J=await kv(L,b))!==0){let de=new Request(f,{method:"POST",body:b,duplex:"half"}),Ce;if(Ne.isFormData(b)&&(Ce=de.headers.get("content-type"))&&L.setContentType(Ce),de.body){const[Re,Ze]=lm(J,$u(cm(V)));b=hm(de.body,pm,Re,Ze)}}Ne.isString(F)||(F=F?"include":"omit");const se="credentials"in Request.prototype;C=new Request(f,{...M,signal:E,method:_.toUpperCase(),headers:L.normalize().toJSON(),body:b,duplex:"half",credentials:se?F:void 0});let oe=await fetch(C);const Se=Gp&&(P==="stream"||P==="response");if(Gp&&(s||Se&&W)){const de={};["status","statusText","headers"].forEach(kt=>{de[kt]=oe[kt]});const Ce=Ne.toFiniteNumber(oe.headers.get("content-length")),[Re,Ze]=s&&lm(Ce,$u(cm(s),!0))||[];oe=new Response(hm(oe.body,pm,Re,()=>{Ze&&Ze(),W&&W()}),de)}P=P||"text";let $=await eh[Ne.findKey(eh,P)||"text"](oe,u);return!Se&&W&&W(),await new Promise((de,Ce)=>{Ig(de,Ce,{data:$,headers:Zi.from(oe.headers),status:oe.status,statusText:oe.statusText,config:u,request:C})})}catch(se){throw W&&W(),se&&se.name==="TypeError"&&/Load failed|fetch/i.test(se.message)?Object.assign(new Dt("Network Error",Dt.ERR_NETWORK,u,C),{cause:se.cause||se}):Dt.from(se,se&&se.code,u,C)}}),Jp={http:N0,xhr:gv,fetch:Av};Ne.forEach(Jp,(u,f)=>{if(u){try{Object.defineProperty(u,"name",{value:f})}catch{}Object.defineProperty(u,"adapterName",{value:f})}});const dm=u=>`- ${u}`,Cv=u=>Ne.isFunction(u)||u===null||u===!1,Dg={getAdapter:u=>{u=Ne.isArray(u)?u:[u];const{length:f}=u;let _,b;const k={};for(let T=0;T<f;T++){_=u[T];let x;if(b=_,!Cv(_)&&(b=Jp[(x=String(_)).toLowerCase()],b===void 0))throw new Dt(`Unknown adapter '${x}'`);if(b)break;k[x||"#"+T]=b}if(!b){const T=Object.entries(k).map(([s,V])=>`adapter ${s} `+(V===!1?"is not supported by the environment":"is not available in the build"));let x=f?T.length>1?`since :
4
- `+T.map(dm).join(`
5
- `):" "+dm(T[0]):"as no adapter specified";throw new Dt("There is no suitable adapter to dispatch the request "+x,"ERR_NOT_SUPPORT")}return b},adapters:Jp};function Dp(u){if(u.cancelToken&&u.cancelToken.throwIfRequested(),u.signal&&u.signal.aborted)throw new za(null,u)}function fm(u){return Dp(u),u.headers=Zi.from(u.headers),u.data=Bp.call(u,u.transformRequest),["post","put","patch"].indexOf(u.method)!==-1&&u.headers.setContentType("application/x-www-form-urlencoded",!1),Dg.getAdapter(u.adapter||nc.adapter)(u).then(function(b){return Dp(u),b.data=Bp.call(u,u.transformResponse,b),b.headers=Zi.from(b.headers),b},function(b){return Pg(b)||(Dp(u),b&&b.response&&(b.response.data=Bp.call(u,u.transformResponse,b.response),b.response.headers=Zi.from(b.response.headers))),Promise.reject(b)})}const Vg="1.9.0",ph={};["object","boolean","number","function","string","symbol"].forEach((u,f)=>{ph[u]=function(b){return typeof b===u||"a"+(f<1?"n ":" ")+u}});const mm={};ph.transitional=function(f,_,b){function k(T,x){return"[Axios v"+Vg+"] Transitional option '"+T+"'"+x+(b?". "+b:"")}return(T,x,s)=>{if(f===!1)throw new Dt(k(x," has been removed"+(_?" in "+_:"")),Dt.ERR_DEPRECATED);return _&&!mm[x]&&(mm[x]=!0,console.warn(k(x," has been deprecated since v"+_+" and will be removed in the near future"))),f?f(T,x,s):!0}};ph.spelling=function(f){return(_,b)=>(console.warn(`${b} is likely a misspelling of ${f}`),!0)};function Tv(u,f,_){if(typeof u!="object")throw new Dt("options must be an object",Dt.ERR_BAD_OPTION_VALUE);const b=Object.keys(u);let k=b.length;for(;k-- >0;){const T=b[k],x=f[T];if(x){const s=u[T],V=s===void 0||x(s,T,u);if(V!==!0)throw new Dt("option "+T+" must be "+V,Dt.ERR_BAD_OPTION_VALUE);continue}if(_!==!0)throw new Dt("Unknown option "+T,Dt.ERR_BAD_OPTION)}}const Xu={assertOptions:Tv,validators:ph},Vn=Xu.validators;let Eo=class{constructor(f){this.defaults=f||{},this.interceptors={request:new om,response:new om}}async request(f,_){try{return await this._request(f,_)}catch(b){if(b instanceof Error){let k={};Error.captureStackTrace?Error.captureStackTrace(k):k=new Error;const T=k.stack?k.stack.replace(/^.+\n/,""):"";try{b.stack?T&&!String(b.stack).endsWith(T.replace(/^.+\n.+\n/,""))&&(b.stack+=`
6
- `+T):b.stack=T}catch{}}throw b}}_request(f,_){typeof f=="string"?(_=_||{},_.url=f):_=f||{},_=Io(this.defaults,_);const{transitional:b,paramsSerializer:k,headers:T}=_;b!==void 0&&Xu.assertOptions(b,{silentJSONParsing:Vn.transitional(Vn.boolean),forcedJSONParsing:Vn.transitional(Vn.boolean),clarifyTimeoutError:Vn.transitional(Vn.boolean)},!1),k!=null&&(Ne.isFunction(k)?_.paramsSerializer={serialize:k}:Xu.assertOptions(k,{encode:Vn.function,serialize:Vn.function},!0)),_.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?_.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:_.allowAbsoluteUrls=!0),Xu.assertOptions(_,{baseUrl:Vn.spelling("baseURL"),withXsrfToken:Vn.spelling("withXSRFToken")},!0),_.method=(_.method||this.defaults.method||"get").toLowerCase();let x=T&&Ne.merge(T.common,T[_.method]);T&&Ne.forEach(["delete","get","head","post","put","patch","common"],C=>{delete T[C]}),_.headers=Zi.concat(x,T);const s=[];let V=!0;this.interceptors.request.forEach(function(W){typeof W.runWhen=="function"&&W.runWhen(_)===!1||(V=V&&W.synchronous,s.unshift(W.fulfilled,W.rejected))});const P=[];this.interceptors.response.forEach(function(W){P.push(W.fulfilled,W.rejected)});let L,F=0,M;if(!V){const C=[fm.bind(this),void 0];for(C.unshift.apply(C,s),C.push.apply(C,P),M=C.length,L=Promise.resolve(_);F<M;)L=L.then(C[F++],C[F++]);return L}M=s.length;let E=_;for(F=0;F<M;){const C=s[F++],W=s[F++];try{E=C(E)}catch(J){W.call(this,J);break}}try{L=fm.call(this,E)}catch(C){return Promise.reject(C)}for(F=0,M=P.length;F<M;)L=L.then(P[F++],P[F++]);return L}getUri(f){f=Io(this.defaults,f);const _=Mg(f.baseURL,f.url,f.allowAbsoluteUrls);return Cg(_,f.params,f.paramsSerializer)}};Ne.forEach(["delete","get","head","options"],function(f){Eo.prototype[f]=function(_,b){return this.request(Io(b||{},{method:f,url:_,data:(b||{}).data}))}});Ne.forEach(["post","put","patch"],function(f){function _(b){return function(T,x,s){return this.request(Io(s||{},{method:f,headers:b?{"Content-Type":"multipart/form-data"}:{},url:T,data:x}))}}Eo.prototype[f]=_(),Eo.prototype[f+"Form"]=_(!0)});let Ev=class zg{constructor(f){if(typeof f!="function")throw new TypeError("executor must be a function.");let _;this.promise=new Promise(function(T){_=T});const b=this;this.promise.then(k=>{if(!b._listeners)return;let T=b._listeners.length;for(;T-- >0;)b._listeners[T](k);b._listeners=null}),this.promise.then=k=>{let T;const x=new Promise(s=>{b.subscribe(s),T=s}).then(k);return x.cancel=function(){b.unsubscribe(T)},x},f(function(T,x,s){b.reason||(b.reason=new za(T,x,s),_(b.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(f){if(this.reason){f(this.reason);return}this._listeners?this._listeners.push(f):this._listeners=[f]}unsubscribe(f){if(!this._listeners)return;const _=this._listeners.indexOf(f);_!==-1&&this._listeners.splice(_,1)}toAbortSignal(){const f=new AbortController,_=b=>{f.abort(b)};return this.subscribe(_),f.signal.unsubscribe=()=>this.unsubscribe(_),f.signal}static source(){let f;return{token:new zg(function(k){f=k}),cancel:f}}};function Pv(u){return function(_){return u.apply(null,_)}}function Iv(u){return Ne.isObject(u)&&u.isAxiosError===!0}const Xp={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};Object.entries(Xp).forEach(([u,f])=>{Xp[f]=u});function Fg(u){const f=new Eo(u),_=fg(Eo.prototype.request,f);return Ne.extend(_,Eo.prototype,f,{allOwnKeys:!0}),Ne.extend(_,f,null,{allOwnKeys:!0}),_.create=function(k){return Fg(Io(u,k))},_}const kr=Fg(nc);kr.Axios=Eo;kr.CanceledError=za;kr.CancelToken=Ev;kr.isCancel=Pg;kr.VERSION=Vg;kr.toFormData=uh;kr.AxiosError=Dt;kr.Cancel=kr.CanceledError;kr.all=function(f){return Promise.all(f)};kr.spread=Pv;kr.isAxiosError=Iv;kr.mergeConfig=Io;kr.AxiosHeaders=Zi;kr.formToJSON=u=>Eg(Ne.isHTMLForm(u)?new FormData(u):u);kr.getAdapter=Dg.getAdapter;kr.HttpStatusCode=Xp;kr.default=kr;const{Axios:vC,AxiosError:xC,CanceledError:bC,isCancel:wC,CancelToken:SC,VERSION:kC,all:AC,Cancel:CC,isAxiosError:TC,spread:EC,toFormData:PC,AxiosHeaders:IC,HttpStatusCode:MC,formToJSON:LC,getAdapter:RC,mergeConfig:BC}=kr;function sd(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Lo=sd();function Og(u){Lo=u}var ec={exec:()=>null};function rr(u,f=""){let _=typeof u=="string"?u:u.source;const b={replace:(k,T)=>{let x=typeof T=="string"?T:T.source;return x=x.replace(zi.caret,"$1"),_=_.replace(k,x),b},getRegex:()=>new RegExp(_,f)};return b}var zi={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:u=>new RegExp(`^( {0,3}${u})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}#`),htmlBeginRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}<(?:[a-z].*>|!--)`,"i")},Mv=/^(?:[ \t]*(?:\n|$))+/,Lv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Rv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,sc=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Bv=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,od=/(?:[*+-]|\d{1,9}[.)])/,Ng=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,qg=rr(Ng).replace(/bull/g,od).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Dv=rr(Ng).replace(/bull/g,od).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ad=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Vv=/^[^\n]+/,ld=/(?!\s*\])(?:\\.|[^\[\]\\])+/,zv=rr(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ld).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Fv=rr(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,od).getRegex(),dh="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",cd=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ov=rr("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",cd).replace("tag",dh).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ug=rr(ad).replace("hr",sc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dh).getRegex(),Nv=rr(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ug).getRegex(),ud={blockquote:Nv,code:Lv,def:zv,fences:Rv,heading:Bv,hr:sc,html:Ov,lheading:qg,list:Fv,newline:Mv,paragraph:Ug,table:ec,text:Vv},gm=rr("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",sc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dh).getRegex(),qv={...ud,lheading:Dv,table:gm,paragraph:rr(ad).replace("hr",sc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",gm).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dh).getRegex()},Uv={...ud,html:rr(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",cd).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ec,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:rr(ad).replace("hr",sc).replace("heading",` *#{1,6} *[^
7
- ]`).replace("lheading",qg).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},jv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Wv=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,jg=/^( {2,}|\\)\n(?!\s*$)/,Hv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,fh=/[\p{P}\p{S}]/u,hd=/[\s\p{P}\p{S}]/u,Wg=/[^\s\p{P}\p{S}]/u,Zv=rr(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,hd).getRegex(),Hg=/(?!~)[\p{P}\p{S}]/u,Kv=/(?!~)[\s\p{P}\p{S}]/u,Gv=/(?:[^\s\p{P}\p{S}]|~)/u,Jv=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Zg=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Xv=rr(Zg,"u").replace(/punct/g,fh).getRegex(),Qv=rr(Zg,"u").replace(/punct/g,Hg).getRegex(),Kg="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Yv=rr(Kg,"gu").replace(/notPunctSpace/g,Wg).replace(/punctSpace/g,hd).replace(/punct/g,fh).getRegex(),$v=rr(Kg,"gu").replace(/notPunctSpace/g,Gv).replace(/punctSpace/g,Kv).replace(/punct/g,Hg).getRegex(),ex=rr("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Wg).replace(/punctSpace/g,hd).replace(/punct/g,fh).getRegex(),tx=rr(/\\(punct)/,"gu").replace(/punct/g,fh).getRegex(),rx=rr(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),ix=rr(cd).replace("(?:-->|$)","-->").getRegex(),nx=rr("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",ix).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),th=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,sx=rr(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",th).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Gg=rr(/^!?\[(label)\]\[(ref)\]/).replace("label",th).replace("ref",ld).getRegex(),Jg=rr(/^!?\[(ref)\](?:\[\])?/).replace("ref",ld).getRegex(),ox=rr("reflink|nolink(?!\\()","g").replace("reflink",Gg).replace("nolink",Jg).getRegex(),pd={_backpedal:ec,anyPunctuation:tx,autolink:rx,blockSkip:Jv,br:jg,code:Wv,del:ec,emStrongLDelim:Xv,emStrongRDelimAst:Yv,emStrongRDelimUnd:ex,escape:jv,link:sx,nolink:Jg,punctuation:Zv,reflink:Gg,reflinkSearch:ox,tag:nx,text:Hv,url:ec},ax={...pd,link:rr(/^!?\[(label)\]\((.*?)\)/).replace("label",th).getRegex(),reflink:rr(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",th).getRegex()},Qp={...pd,emStrongRDelimAst:$v,emStrongLDelim:Qv,url:rr(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},lx={...Qp,br:rr(jg).replace("{2,}","*").getRegex(),text:rr(Qp.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},vu={normal:ud,gfm:qv,pedantic:Uv},Jl={normal:pd,gfm:Qp,breaks:lx,pedantic:ax},cx={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ym=u=>cx[u];function zn(u,f){if(f){if(zi.escapeTest.test(u))return u.replace(zi.escapeReplace,ym)}else if(zi.escapeTestNoEncode.test(u))return u.replace(zi.escapeReplaceNoEncode,ym);return u}function _m(u){try{u=encodeURI(u).replace(zi.percentDecode,"%")}catch{return null}return u}function vm(u,f){var T;const _=u.replace(zi.findPipe,(x,s,V)=>{let P=!1,L=s;for(;--L>=0&&V[L]==="\\";)P=!P;return P?"|":" |"}),b=_.split(zi.splitPipe);let k=0;if(b[0].trim()||b.shift(),b.length>0&&!((T=b.at(-1))!=null&&T.trim())&&b.pop(),f)if(b.length>f)b.splice(f);else for(;b.length<f;)b.push("");for(;k<b.length;k++)b[k]=b[k].trim().replace(zi.slashPipe,"|");return b}function Xl(u,f,_){const b=u.length;if(b===0)return"";let k=0;for(;k<b&&u.charAt(b-k-1)===f;)k++;return u.slice(0,b-k)}function ux(u,f){if(u.indexOf(f[1])===-1)return-1;let _=0;for(let b=0;b<u.length;b++)if(u[b]==="\\")b++;else if(u[b]===f[0])_++;else if(u[b]===f[1]&&(_--,_<0))return b;return _>0?-2:-1}function xm(u,f,_,b,k){const T=f.href,x=f.title||null,s=u[1].replace(k.other.outputLinkReplace,"$1");b.state.inLink=!0;const V={type:u[0].charAt(0)==="!"?"image":"link",raw:_,href:T,title:x,text:s,tokens:b.inlineTokens(s)};return b.state.inLink=!1,V}function hx(u,f,_){const b=u.match(_.other.indentCodeCompensation);if(b===null)return f;const k=b[1];return f.split(`
8
- `).map(T=>{const x=T.match(_.other.beginningSpace);if(x===null)return T;const[s]=x;return s.length>=k.length?T.slice(k.length):T}).join(`
9
- `)}var rh=class{constructor(u){dr(this,"options");dr(this,"rules");dr(this,"lexer");this.options=u||Lo}space(u){const f=this.rules.block.newline.exec(u);if(f&&f[0].length>0)return{type:"space",raw:f[0]}}code(u){const f=this.rules.block.code.exec(u);if(f){const _=f[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:f[0],codeBlockStyle:"indented",text:this.options.pedantic?_:Xl(_,`
10
- `)}}}fences(u){const f=this.rules.block.fences.exec(u);if(f){const _=f[0],b=hx(_,f[3]||"",this.rules);return{type:"code",raw:_,lang:f[2]?f[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):f[2],text:b}}}heading(u){const f=this.rules.block.heading.exec(u);if(f){let _=f[2].trim();if(this.rules.other.endingHash.test(_)){const b=Xl(_,"#");(this.options.pedantic||!b||this.rules.other.endingSpaceChar.test(b))&&(_=b.trim())}return{type:"heading",raw:f[0],depth:f[1].length,text:_,tokens:this.lexer.inline(_)}}}hr(u){const f=this.rules.block.hr.exec(u);if(f)return{type:"hr",raw:Xl(f[0],`
11
- `)}}blockquote(u){const f=this.rules.block.blockquote.exec(u);if(f){let _=Xl(f[0],`
12
- `).split(`
13
- `),b="",k="";const T=[];for(;_.length>0;){let x=!1;const s=[];let V;for(V=0;V<_.length;V++)if(this.rules.other.blockquoteStart.test(_[V]))s.push(_[V]),x=!0;else if(!x)s.push(_[V]);else break;_=_.slice(V);const P=s.join(`
14
- `),L=P.replace(this.rules.other.blockquoteSetextReplace,`
15
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");b=b?`${b}
16
- ${P}`:P,k=k?`${k}
17
- ${L}`:L;const F=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(L,T,!0),this.lexer.state.top=F,_.length===0)break;const M=T.at(-1);if((M==null?void 0:M.type)==="code")break;if((M==null?void 0:M.type)==="blockquote"){const E=M,C=E.raw+`
18
- `+_.join(`
19
- `),W=this.blockquote(C);T[T.length-1]=W,b=b.substring(0,b.length-E.raw.length)+W.raw,k=k.substring(0,k.length-E.text.length)+W.text;break}else if((M==null?void 0:M.type)==="list"){const E=M,C=E.raw+`
20
- `+_.join(`
21
- `),W=this.list(C);T[T.length-1]=W,b=b.substring(0,b.length-M.raw.length)+W.raw,k=k.substring(0,k.length-E.raw.length)+W.raw,_=C.substring(T.at(-1).raw.length).split(`
22
- `);continue}}return{type:"blockquote",raw:b,tokens:T,text:k}}}list(u){let f=this.rules.block.list.exec(u);if(f){let _=f[1].trim();const b=_.length>1,k={type:"list",raw:"",ordered:b,start:b?+_.slice(0,-1):"",loose:!1,items:[]};_=b?`\\d{1,9}\\${_.slice(-1)}`:`\\${_}`,this.options.pedantic&&(_=b?_:"[*+-]");const T=this.rules.other.listItemRegex(_);let x=!1;for(;u;){let V=!1,P="",L="";if(!(f=T.exec(u))||this.rules.block.hr.test(u))break;P=f[0],u=u.substring(P.length);let F=f[2].split(`
23
- `,1)[0].replace(this.rules.other.listReplaceTabs,se=>" ".repeat(3*se.length)),M=u.split(`
24
- `,1)[0],E=!F.trim(),C=0;if(this.options.pedantic?(C=2,L=F.trimStart()):E?C=f[1].length+1:(C=f[2].search(this.rules.other.nonSpaceChar),C=C>4?1:C,L=F.slice(C),C+=f[1].length),E&&this.rules.other.blankLine.test(M)&&(P+=M+`
25
- `,u=u.substring(M.length+1),V=!0),!V){const se=this.rules.other.nextBulletRegex(C),oe=this.rules.other.hrRegex(C),Se=this.rules.other.fencesBeginRegex(C),$=this.rules.other.headingBeginRegex(C),de=this.rules.other.htmlBeginRegex(C);for(;u;){const Ce=u.split(`
26
- `,1)[0];let Re;if(M=Ce,this.options.pedantic?(M=M.replace(this.rules.other.listReplaceNesting," "),Re=M):Re=M.replace(this.rules.other.tabCharGlobal," "),Se.test(M)||$.test(M)||de.test(M)||se.test(M)||oe.test(M))break;if(Re.search(this.rules.other.nonSpaceChar)>=C||!M.trim())L+=`
27
- `+Re.slice(C);else{if(E||F.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||Se.test(F)||$.test(F)||oe.test(F))break;L+=`
28
- `+M}!E&&!M.trim()&&(E=!0),P+=Ce+`
29
- `,u=u.substring(Ce.length+1),F=Re.slice(C)}}k.loose||(x?k.loose=!0:this.rules.other.doubleBlankLine.test(P)&&(x=!0));let W=null,J;this.options.gfm&&(W=this.rules.other.listIsTask.exec(L),W&&(J=W[0]!=="[ ] ",L=L.replace(this.rules.other.listReplaceTask,""))),k.items.push({type:"list_item",raw:P,task:!!W,checked:J,loose:!1,text:L,tokens:[]}),k.raw+=P}const s=k.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;k.raw=k.raw.trimEnd();for(let V=0;V<k.items.length;V++)if(this.lexer.state.top=!1,k.items[V].tokens=this.lexer.blockTokens(k.items[V].text,[]),!k.loose){const P=k.items[V].tokens.filter(F=>F.type==="space"),L=P.length>0&&P.some(F=>this.rules.other.anyLine.test(F.raw));k.loose=L}if(k.loose)for(let V=0;V<k.items.length;V++)k.items[V].loose=!0;return k}}html(u){const f=this.rules.block.html.exec(u);if(f)return{type:"html",block:!0,raw:f[0],pre:f[1]==="pre"||f[1]==="script"||f[1]==="style",text:f[0]}}def(u){const f=this.rules.block.def.exec(u);if(f){const _=f[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),b=f[2]?f[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",k=f[3]?f[3].substring(1,f[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):f[3];return{type:"def",tag:_,raw:f[0],href:b,title:k}}}table(u){var x;const f=this.rules.block.table.exec(u);if(!f||!this.rules.other.tableDelimiter.test(f[2]))return;const _=vm(f[1]),b=f[2].replace(this.rules.other.tableAlignChars,"").split("|"),k=(x=f[3])!=null&&x.trim()?f[3].replace(this.rules.other.tableRowBlankLine,"").split(`
30
- `):[],T={type:"table",raw:f[0],header:[],align:[],rows:[]};if(_.length===b.length){for(const s of b)this.rules.other.tableAlignRight.test(s)?T.align.push("right"):this.rules.other.tableAlignCenter.test(s)?T.align.push("center"):this.rules.other.tableAlignLeft.test(s)?T.align.push("left"):T.align.push(null);for(let s=0;s<_.length;s++)T.header.push({text:_[s],tokens:this.lexer.inline(_[s]),header:!0,align:T.align[s]});for(const s of k)T.rows.push(vm(s,T.header.length).map((V,P)=>({text:V,tokens:this.lexer.inline(V),header:!1,align:T.align[P]})));return T}}lheading(u){const f=this.rules.block.lheading.exec(u);if(f)return{type:"heading",raw:f[0],depth:f[2].charAt(0)==="="?1:2,text:f[1],tokens:this.lexer.inline(f[1])}}paragraph(u){const f=this.rules.block.paragraph.exec(u);if(f){const _=f[1].charAt(f[1].length-1)===`
31
- `?f[1].slice(0,-1):f[1];return{type:"paragraph",raw:f[0],text:_,tokens:this.lexer.inline(_)}}}text(u){const f=this.rules.block.text.exec(u);if(f)return{type:"text",raw:f[0],text:f[0],tokens:this.lexer.inline(f[0])}}escape(u){const f=this.rules.inline.escape.exec(u);if(f)return{type:"escape",raw:f[0],text:f[1]}}tag(u){const f=this.rules.inline.tag.exec(u);if(f)return!this.lexer.state.inLink&&this.rules.other.startATag.test(f[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(f[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(f[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(f[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:f[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:f[0]}}link(u){const f=this.rules.inline.link.exec(u);if(f){const _=f[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(_)){if(!this.rules.other.endAngleBracket.test(_))return;const T=Xl(_.slice(0,-1),"\\");if((_.length-T.length)%2===0)return}else{const T=ux(f[2],"()");if(T===-2)return;if(T>-1){const s=(f[0].indexOf("!")===0?5:4)+f[1].length+T;f[2]=f[2].substring(0,T),f[0]=f[0].substring(0,s).trim(),f[3]=""}}let b=f[2],k="";if(this.options.pedantic){const T=this.rules.other.pedanticHrefTitle.exec(b);T&&(b=T[1],k=T[3])}else k=f[3]?f[3].slice(1,-1):"";return b=b.trim(),this.rules.other.startAngleBracket.test(b)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(_)?b=b.slice(1):b=b.slice(1,-1)),xm(f,{href:b&&b.replace(this.rules.inline.anyPunctuation,"$1"),title:k&&k.replace(this.rules.inline.anyPunctuation,"$1")},f[0],this.lexer,this.rules)}}reflink(u,f){let _;if((_=this.rules.inline.reflink.exec(u))||(_=this.rules.inline.nolink.exec(u))){const b=(_[2]||_[1]).replace(this.rules.other.multipleSpaceGlobal," "),k=f[b.toLowerCase()];if(!k){const T=_[0].charAt(0);return{type:"text",raw:T,text:T}}return xm(_,k,_[0],this.lexer,this.rules)}}emStrong(u,f,_=""){let b=this.rules.inline.emStrongLDelim.exec(u);if(!b||b[3]&&_.match(this.rules.other.unicodeAlphaNumeric))return;if(!(b[1]||b[2]||"")||!_||this.rules.inline.punctuation.exec(_)){const T=[...b[0]].length-1;let x,s,V=T,P=0;const L=b[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(L.lastIndex=0,f=f.slice(-1*u.length+T);(b=L.exec(f))!=null;){if(x=b[1]||b[2]||b[3]||b[4]||b[5]||b[6],!x)continue;if(s=[...x].length,b[3]||b[4]){V+=s;continue}else if((b[5]||b[6])&&T%3&&!((T+s)%3)){P+=s;continue}if(V-=s,V>0)continue;s=Math.min(s,s+V+P);const F=[...b[0]][0].length,M=u.slice(0,T+b.index+F+s);if(Math.min(T,s)%2){const C=M.slice(1,-1);return{type:"em",raw:M,text:C,tokens:this.lexer.inlineTokens(C)}}const E=M.slice(2,-2);return{type:"strong",raw:M,text:E,tokens:this.lexer.inlineTokens(E)}}}}codespan(u){const f=this.rules.inline.code.exec(u);if(f){let _=f[2].replace(this.rules.other.newLineCharGlobal," ");const b=this.rules.other.nonSpaceChar.test(_),k=this.rules.other.startingSpaceChar.test(_)&&this.rules.other.endingSpaceChar.test(_);return b&&k&&(_=_.substring(1,_.length-1)),{type:"codespan",raw:f[0],text:_}}}br(u){const f=this.rules.inline.br.exec(u);if(f)return{type:"br",raw:f[0]}}del(u){const f=this.rules.inline.del.exec(u);if(f)return{type:"del",raw:f[0],text:f[2],tokens:this.lexer.inlineTokens(f[2])}}autolink(u){const f=this.rules.inline.autolink.exec(u);if(f){let _,b;return f[2]==="@"?(_=f[1],b="mailto:"+_):(_=f[1],b=_),{type:"link",raw:f[0],text:_,href:b,tokens:[{type:"text",raw:_,text:_}]}}}url(u){var _;let f;if(f=this.rules.inline.url.exec(u)){let b,k;if(f[2]==="@")b=f[0],k="mailto:"+b;else{let T;do T=f[0],f[0]=((_=this.rules.inline._backpedal.exec(f[0]))==null?void 0:_[0])??"";while(T!==f[0]);b=f[0],f[1]==="www."?k="http://"+f[0]:k=f[0]}return{type:"link",raw:f[0],text:b,href:k,tokens:[{type:"text",raw:b,text:b}]}}}inlineText(u){const f=this.rules.inline.text.exec(u);if(f){const _=this.lexer.state.inRawBlock;return{type:"text",raw:f[0],text:f[0],escaped:_}}}},ns=class Yp{constructor(f){dr(this,"tokens");dr(this,"options");dr(this,"state");dr(this,"tokenizer");dr(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=f||Lo,this.options.tokenizer=this.options.tokenizer||new rh,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const _={other:zi,block:vu.normal,inline:Jl.normal};this.options.pedantic?(_.block=vu.pedantic,_.inline=Jl.pedantic):this.options.gfm&&(_.block=vu.gfm,this.options.breaks?_.inline=Jl.breaks:_.inline=Jl.gfm),this.tokenizer.rules=_}static get rules(){return{block:vu,inline:Jl}}static lex(f,_){return new Yp(_).lex(f)}static lexInline(f,_){return new Yp(_).inlineTokens(f)}lex(f){f=f.replace(zi.carriageReturn,`
32
- `),this.blockTokens(f,this.tokens);for(let _=0;_<this.inlineQueue.length;_++){const b=this.inlineQueue[_];this.inlineTokens(b.src,b.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(f,_=[],b=!1){var k,T,x;for(this.options.pedantic&&(f=f.replace(zi.tabCharGlobal," ").replace(zi.spaceLine,""));f;){let s;if((T=(k=this.options.extensions)==null?void 0:k.block)!=null&&T.some(P=>(s=P.call({lexer:this},f,_))?(f=f.substring(s.raw.length),_.push(s),!0):!1))continue;if(s=this.tokenizer.space(f)){f=f.substring(s.raw.length);const P=_.at(-1);s.raw.length===1&&P!==void 0?P.raw+=`
33
- `:_.push(s);continue}if(s=this.tokenizer.code(f)){f=f.substring(s.raw.length);const P=_.at(-1);(P==null?void 0:P.type)==="paragraph"||(P==null?void 0:P.type)==="text"?(P.raw+=`
34
- `+s.raw,P.text+=`
35
- `+s.text,this.inlineQueue.at(-1).src=P.text):_.push(s);continue}if(s=this.tokenizer.fences(f)){f=f.substring(s.raw.length),_.push(s);continue}if(s=this.tokenizer.heading(f)){f=f.substring(s.raw.length),_.push(s);continue}if(s=this.tokenizer.hr(f)){f=f.substring(s.raw.length),_.push(s);continue}if(s=this.tokenizer.blockquote(f)){f=f.substring(s.raw.length),_.push(s);continue}if(s=this.tokenizer.list(f)){f=f.substring(s.raw.length),_.push(s);continue}if(s=this.tokenizer.html(f)){f=f.substring(s.raw.length),_.push(s);continue}if(s=this.tokenizer.def(f)){f=f.substring(s.raw.length);const P=_.at(-1);(P==null?void 0:P.type)==="paragraph"||(P==null?void 0:P.type)==="text"?(P.raw+=`
36
- `+s.raw,P.text+=`
37
- `+s.raw,this.inlineQueue.at(-1).src=P.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title});continue}if(s=this.tokenizer.table(f)){f=f.substring(s.raw.length),_.push(s);continue}if(s=this.tokenizer.lheading(f)){f=f.substring(s.raw.length),_.push(s);continue}let V=f;if((x=this.options.extensions)!=null&&x.startBlock){let P=1/0;const L=f.slice(1);let F;this.options.extensions.startBlock.forEach(M=>{F=M.call({lexer:this},L),typeof F=="number"&&F>=0&&(P=Math.min(P,F))}),P<1/0&&P>=0&&(V=f.substring(0,P+1))}if(this.state.top&&(s=this.tokenizer.paragraph(V))){const P=_.at(-1);b&&(P==null?void 0:P.type)==="paragraph"?(P.raw+=`
38
- `+s.raw,P.text+=`
39
- `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=P.text):_.push(s),b=V.length!==f.length,f=f.substring(s.raw.length);continue}if(s=this.tokenizer.text(f)){f=f.substring(s.raw.length);const P=_.at(-1);(P==null?void 0:P.type)==="text"?(P.raw+=`
40
- `+s.raw,P.text+=`
41
- `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=P.text):_.push(s);continue}if(f){const P="Infinite loop on byte: "+f.charCodeAt(0);if(this.options.silent){console.error(P);break}else throw new Error(P)}}return this.state.top=!0,_}inline(f,_=[]){return this.inlineQueue.push({src:f,tokens:_}),_}inlineTokens(f,_=[]){var s,V,P;let b=f,k=null;if(this.tokens.links){const L=Object.keys(this.tokens.links);if(L.length>0)for(;(k=this.tokenizer.rules.inline.reflinkSearch.exec(b))!=null;)L.includes(k[0].slice(k[0].lastIndexOf("[")+1,-1))&&(b=b.slice(0,k.index)+"["+"a".repeat(k[0].length-2)+"]"+b.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(k=this.tokenizer.rules.inline.anyPunctuation.exec(b))!=null;)b=b.slice(0,k.index)+"++"+b.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(k=this.tokenizer.rules.inline.blockSkip.exec(b))!=null;)b=b.slice(0,k.index)+"["+"a".repeat(k[0].length-2)+"]"+b.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let T=!1,x="";for(;f;){T||(x=""),T=!1;let L;if((V=(s=this.options.extensions)==null?void 0:s.inline)!=null&&V.some(M=>(L=M.call({lexer:this},f,_))?(f=f.substring(L.raw.length),_.push(L),!0):!1))continue;if(L=this.tokenizer.escape(f)){f=f.substring(L.raw.length),_.push(L);continue}if(L=this.tokenizer.tag(f)){f=f.substring(L.raw.length),_.push(L);continue}if(L=this.tokenizer.link(f)){f=f.substring(L.raw.length),_.push(L);continue}if(L=this.tokenizer.reflink(f,this.tokens.links)){f=f.substring(L.raw.length);const M=_.at(-1);L.type==="text"&&(M==null?void 0:M.type)==="text"?(M.raw+=L.raw,M.text+=L.text):_.push(L);continue}if(L=this.tokenizer.emStrong(f,b,x)){f=f.substring(L.raw.length),_.push(L);continue}if(L=this.tokenizer.codespan(f)){f=f.substring(L.raw.length),_.push(L);continue}if(L=this.tokenizer.br(f)){f=f.substring(L.raw.length),_.push(L);continue}if(L=this.tokenizer.del(f)){f=f.substring(L.raw.length),_.push(L);continue}if(L=this.tokenizer.autolink(f)){f=f.substring(L.raw.length),_.push(L);continue}if(!this.state.inLink&&(L=this.tokenizer.url(f))){f=f.substring(L.raw.length),_.push(L);continue}let F=f;if((P=this.options.extensions)!=null&&P.startInline){let M=1/0;const E=f.slice(1);let C;this.options.extensions.startInline.forEach(W=>{C=W.call({lexer:this},E),typeof C=="number"&&C>=0&&(M=Math.min(M,C))}),M<1/0&&M>=0&&(F=f.substring(0,M+1))}if(L=this.tokenizer.inlineText(F)){f=f.substring(L.raw.length),L.raw.slice(-1)!=="_"&&(x=L.raw.slice(-1)),T=!0;const M=_.at(-1);(M==null?void 0:M.type)==="text"?(M.raw+=L.raw,M.text+=L.text):_.push(L);continue}if(f){const M="Infinite loop on byte: "+f.charCodeAt(0);if(this.options.silent){console.error(M);break}else throw new Error(M)}}return _}},ih=class{constructor(u){dr(this,"options");dr(this,"parser");this.options=u||Lo}space(u){return""}code({text:u,lang:f,escaped:_}){var T;const b=(T=(f||"").match(zi.notSpaceStart))==null?void 0:T[0],k=u.replace(zi.endingNewline,"")+`
42
- `;return b?'<pre><code class="language-'+zn(b)+'">'+(_?k:zn(k,!0))+`</code></pre>
43
- `:"<pre><code>"+(_?k:zn(k,!0))+`</code></pre>
44
- `}blockquote({tokens:u}){return`<blockquote>
45
- ${this.parser.parse(u)}</blockquote>
46
- `}html({text:u}){return u}heading({tokens:u,depth:f}){return`<h${f}>${this.parser.parseInline(u)}</h${f}>
47
- `}hr(u){return`<hr>
48
- `}list(u){const f=u.ordered,_=u.start;let b="";for(let x=0;x<u.items.length;x++){const s=u.items[x];b+=this.listitem(s)}const k=f?"ol":"ul",T=f&&_!==1?' start="'+_+'"':"";return"<"+k+T+`>
49
- `+b+"</"+k+`>
50
- `}listitem(u){var _;let f="";if(u.task){const b=this.checkbox({checked:!!u.checked});u.loose?((_=u.tokens[0])==null?void 0:_.type)==="paragraph"?(u.tokens[0].text=b+" "+u.tokens[0].text,u.tokens[0].tokens&&u.tokens[0].tokens.length>0&&u.tokens[0].tokens[0].type==="text"&&(u.tokens[0].tokens[0].text=b+" "+zn(u.tokens[0].tokens[0].text),u.tokens[0].tokens[0].escaped=!0)):u.tokens.unshift({type:"text",raw:b+" ",text:b+" ",escaped:!0}):f+=b+" "}return f+=this.parser.parse(u.tokens,!!u.loose),`<li>${f}</li>
51
- `}checkbox({checked:u}){return"<input "+(u?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:u}){return`<p>${this.parser.parseInline(u)}</p>
52
- `}table(u){let f="",_="";for(let k=0;k<u.header.length;k++)_+=this.tablecell(u.header[k]);f+=this.tablerow({text:_});let b="";for(let k=0;k<u.rows.length;k++){const T=u.rows[k];_="";for(let x=0;x<T.length;x++)_+=this.tablecell(T[x]);b+=this.tablerow({text:_})}return b&&(b=`<tbody>${b}</tbody>`),`<table>
53
- <thead>
54
- `+f+`</thead>
55
- `+b+`</table>
56
- `}tablerow({text:u}){return`<tr>
57
- ${u}</tr>
58
- `}tablecell(u){const f=this.parser.parseInline(u.tokens),_=u.header?"th":"td";return(u.align?`<${_} align="${u.align}">`:`<${_}>`)+f+`</${_}>
59
- `}strong({tokens:u}){return`<strong>${this.parser.parseInline(u)}</strong>`}em({tokens:u}){return`<em>${this.parser.parseInline(u)}</em>`}codespan({text:u}){return`<code>${zn(u,!0)}</code>`}br(u){return"<br>"}del({tokens:u}){return`<del>${this.parser.parseInline(u)}</del>`}link({href:u,title:f,tokens:_}){const b=this.parser.parseInline(_),k=_m(u);if(k===null)return b;u=k;let T='<a href="'+u+'"';return f&&(T+=' title="'+zn(f)+'"'),T+=">"+b+"</a>",T}image({href:u,title:f,text:_,tokens:b}){b&&(_=this.parser.parseInline(b,this.parser.textRenderer));const k=_m(u);if(k===null)return zn(_);u=k;let T=`<img src="${u}" alt="${_}"`;return f&&(T+=` title="${zn(f)}"`),T+=">",T}text(u){return"tokens"in u&&u.tokens?this.parser.parseInline(u.tokens):"escaped"in u&&u.escaped?u.text:zn(u.text)}},dd=class{strong({text:u}){return u}em({text:u}){return u}codespan({text:u}){return u}del({text:u}){return u}html({text:u}){return u}text({text:u}){return u}link({text:u}){return""+u}image({text:u}){return""+u}br(){return""}},ss=class $p{constructor(f){dr(this,"options");dr(this,"renderer");dr(this,"textRenderer");this.options=f||Lo,this.options.renderer=this.options.renderer||new ih,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new dd}static parse(f,_){return new $p(_).parse(f)}static parseInline(f,_){return new $p(_).parseInline(f)}parse(f,_=!0){var k,T;let b="";for(let x=0;x<f.length;x++){const s=f[x];if((T=(k=this.options.extensions)==null?void 0:k.renderers)!=null&&T[s.type]){const P=s,L=this.options.extensions.renderers[P.type].call({parser:this},P);if(L!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(P.type)){b+=L||"";continue}}const V=s;switch(V.type){case"space":{b+=this.renderer.space(V);continue}case"hr":{b+=this.renderer.hr(V);continue}case"heading":{b+=this.renderer.heading(V);continue}case"code":{b+=this.renderer.code(V);continue}case"table":{b+=this.renderer.table(V);continue}case"blockquote":{b+=this.renderer.blockquote(V);continue}case"list":{b+=this.renderer.list(V);continue}case"html":{b+=this.renderer.html(V);continue}case"paragraph":{b+=this.renderer.paragraph(V);continue}case"text":{let P=V,L=this.renderer.text(P);for(;x+1<f.length&&f[x+1].type==="text";)P=f[++x],L+=`
60
- `+this.renderer.text(P);_?b+=this.renderer.paragraph({type:"paragraph",raw:L,text:L,tokens:[{type:"text",raw:L,text:L,escaped:!0}]}):b+=L;continue}default:{const P='Token with "'+V.type+'" type was not found.';if(this.options.silent)return console.error(P),"";throw new Error(P)}}}return b}parseInline(f,_=this.renderer){var k,T;let b="";for(let x=0;x<f.length;x++){const s=f[x];if((T=(k=this.options.extensions)==null?void 0:k.renderers)!=null&&T[s.type]){const P=this.options.extensions.renderers[s.type].call({parser:this},s);if(P!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){b+=P||"";continue}}const V=s;switch(V.type){case"escape":{b+=_.text(V);break}case"html":{b+=_.html(V);break}case"link":{b+=_.link(V);break}case"image":{b+=_.image(V);break}case"strong":{b+=_.strong(V);break}case"em":{b+=_.em(V);break}case"codespan":{b+=_.codespan(V);break}case"br":{b+=_.br(V);break}case"del":{b+=_.del(V);break}case"text":{b+=_.text(V);break}default:{const P='Token with "'+V.type+'" type was not found.';if(this.options.silent)return console.error(P),"";throw new Error(P)}}}return b}},Wp,Qu=(Wp=class{constructor(u){dr(this,"options");dr(this,"block");this.options=u||Lo}preprocess(u){return u}postprocess(u){return u}processAllTokens(u){return u}provideLexer(){return this.block?ns.lex:ns.lexInline}provideParser(){return this.block?ss.parse:ss.parseInline}},dr(Wp,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Wp),px=class{constructor(...u){dr(this,"defaults",sd());dr(this,"options",this.setOptions);dr(this,"parse",this.parseMarkdown(!0));dr(this,"parseInline",this.parseMarkdown(!1));dr(this,"Parser",ss);dr(this,"Renderer",ih);dr(this,"TextRenderer",dd);dr(this,"Lexer",ns);dr(this,"Tokenizer",rh);dr(this,"Hooks",Qu);this.use(...u)}walkTokens(u,f){var b,k;let _=[];for(const T of u)switch(_=_.concat(f.call(this,T)),T.type){case"table":{const x=T;for(const s of x.header)_=_.concat(this.walkTokens(s.tokens,f));for(const s of x.rows)for(const V of s)_=_.concat(this.walkTokens(V.tokens,f));break}case"list":{const x=T;_=_.concat(this.walkTokens(x.items,f));break}default:{const x=T;(k=(b=this.defaults.extensions)==null?void 0:b.childTokens)!=null&&k[x.type]?this.defaults.extensions.childTokens[x.type].forEach(s=>{const V=x[s].flat(1/0);_=_.concat(this.walkTokens(V,f))}):x.tokens&&(_=_.concat(this.walkTokens(x.tokens,f)))}}return _}use(...u){const f=this.defaults.extensions||{renderers:{},childTokens:{}};return u.forEach(_=>{const b={..._};if(b.async=this.defaults.async||b.async||!1,_.extensions&&(_.extensions.forEach(k=>{if(!k.name)throw new Error("extension name required");if("renderer"in k){const T=f.renderers[k.name];T?f.renderers[k.name]=function(...x){let s=k.renderer.apply(this,x);return s===!1&&(s=T.apply(this,x)),s}:f.renderers[k.name]=k.renderer}if("tokenizer"in k){if(!k.level||k.level!=="block"&&k.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const T=f[k.level];T?T.unshift(k.tokenizer):f[k.level]=[k.tokenizer],k.start&&(k.level==="block"?f.startBlock?f.startBlock.push(k.start):f.startBlock=[k.start]:k.level==="inline"&&(f.startInline?f.startInline.push(k.start):f.startInline=[k.start]))}"childTokens"in k&&k.childTokens&&(f.childTokens[k.name]=k.childTokens)}),b.extensions=f),_.renderer){const k=this.defaults.renderer||new ih(this.defaults);for(const T in _.renderer){if(!(T in k))throw new Error(`renderer '${T}' does not exist`);if(["options","parser"].includes(T))continue;const x=T,s=_.renderer[x],V=k[x];k[x]=(...P)=>{let L=s.apply(k,P);return L===!1&&(L=V.apply(k,P)),L||""}}b.renderer=k}if(_.tokenizer){const k=this.defaults.tokenizer||new rh(this.defaults);for(const T in _.tokenizer){if(!(T in k))throw new Error(`tokenizer '${T}' does not exist`);if(["options","rules","lexer"].includes(T))continue;const x=T,s=_.tokenizer[x],V=k[x];k[x]=(...P)=>{let L=s.apply(k,P);return L===!1&&(L=V.apply(k,P)),L}}b.tokenizer=k}if(_.hooks){const k=this.defaults.hooks||new Qu;for(const T in _.hooks){if(!(T in k))throw new Error(`hook '${T}' does not exist`);if(["options","block"].includes(T))continue;const x=T,s=_.hooks[x],V=k[x];Qu.passThroughHooks.has(T)?k[x]=P=>{if(this.defaults.async)return Promise.resolve(s.call(k,P)).then(F=>V.call(k,F));const L=s.call(k,P);return V.call(k,L)}:k[x]=(...P)=>{let L=s.apply(k,P);return L===!1&&(L=V.apply(k,P)),L}}b.hooks=k}if(_.walkTokens){const k=this.defaults.walkTokens,T=_.walkTokens;b.walkTokens=function(x){let s=[];return s.push(T.call(this,x)),k&&(s=s.concat(k.call(this,x))),s}}this.defaults={...this.defaults,...b}}),this}setOptions(u){return this.defaults={...this.defaults,...u},this}lexer(u,f){return ns.lex(u,f??this.defaults)}parser(u,f){return ss.parse(u,f??this.defaults)}parseMarkdown(u){return(_,b)=>{const k={...b},T={...this.defaults,...k},x=this.onError(!!T.silent,!!T.async);if(this.defaults.async===!0&&k.async===!1)return x(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof _>"u"||_===null)return x(new Error("marked(): input parameter is undefined or null"));if(typeof _!="string")return x(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(_)+", string expected"));T.hooks&&(T.hooks.options=T,T.hooks.block=u);const s=T.hooks?T.hooks.provideLexer():u?ns.lex:ns.lexInline,V=T.hooks?T.hooks.provideParser():u?ss.parse:ss.parseInline;if(T.async)return Promise.resolve(T.hooks?T.hooks.preprocess(_):_).then(P=>s(P,T)).then(P=>T.hooks?T.hooks.processAllTokens(P):P).then(P=>T.walkTokens?Promise.all(this.walkTokens(P,T.walkTokens)).then(()=>P):P).then(P=>V(P,T)).then(P=>T.hooks?T.hooks.postprocess(P):P).catch(x);try{T.hooks&&(_=T.hooks.preprocess(_));let P=s(_,T);T.hooks&&(P=T.hooks.processAllTokens(P)),T.walkTokens&&this.walkTokens(P,T.walkTokens);let L=V(P,T);return T.hooks&&(L=T.hooks.postprocess(L)),L}catch(P){return x(P)}}}onError(u,f){return _=>{if(_.message+=`
61
- Please report this to https://github.com/markedjs/marked.`,u){const b="<p>An error occurred:</p><pre>"+zn(_.message+"",!0)+"</pre>";return f?Promise.resolve(b):b}if(f)return Promise.reject(_);throw _}}},Mo=new px;function or(u,f){return Mo.parse(u,f)}or.options=or.setOptions=function(u){return Mo.setOptions(u),or.defaults=Mo.defaults,Og(or.defaults),or};or.getDefaults=sd;or.defaults=Lo;or.use=function(...u){return Mo.use(...u),or.defaults=Mo.defaults,Og(or.defaults),or};or.walkTokens=function(u,f){return Mo.walkTokens(u,f)};or.parseInline=Mo.parseInline;or.Parser=ss;or.parser=ss.parse;or.Renderer=ih;or.TextRenderer=dd;or.Lexer=ns;or.lexer=ns.lex;or.Tokenizer=rh;or.Hooks=Qu;or.parse=or;or.options;or.setOptions;or.use;or.walkTokens;or.parseInline;ss.parse;ns.lex;function Xg(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var Yu={exports:{}};/**
62
- * MapLibre GL JS
63
- * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v5.5.0/LICENSE.txt
64
- */var dx=Yu.exports,bm;function fx(){return bm||(bm=1,function(u,f){(function(_,b){u.exports=b()})(dx,function(){var _={},b={};function k(x,s,V){if(b[x]=V,x==="index"){var P="var sharedModule = {}; ("+b.shared+")(sharedModule); ("+b.worker+")(sharedModule);",L={};return b.shared(L),b.index(_,L),typeof window<"u"&&_.setWorkerUrl(window.URL.createObjectURL(new Blob([P],{type:"text/javascript"}))),_}}k("shared",["exports"],function(x){function s(n,t,i,o){return new(i||(i=Promise))(function(c,d){function m(I){try{S(o.next(I))}catch(B){d(B)}}function v(I){try{S(o.throw(I))}catch(B){d(B)}}function S(I){var B;I.done?c(I.value):(B=I.value,B instanceof i?B:new i(function(z){z(B)})).then(m,v)}S((o=o.apply(n,t||[])).next())})}function V(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var P,L;function F(){if(L)return P;function n(t,i){this.x=t,this.y=i}return L=1,P=n,n.prototype={clone:function(){return new n(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,i){return this.clone()._rotateAround(t,i)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var i=t.x-this.x,o=t.y-this.y;return i*i+o*o},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,i){return Math.atan2(this.x*i-this.y*t,this.x*t+this.y*i)},_matMult:function(t){var i=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=i,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var i=Math.cos(t),o=Math.sin(t),c=o*this.x+i*this.y;return this.x=i*this.x-o*this.y,this.y=c,this},_rotateAround:function(t,i){var o=Math.cos(t),c=Math.sin(t),d=i.y+c*(this.x-i.x)+o*(this.y-i.y);return this.x=i.x+o*(this.x-i.x)-c*(this.y-i.y),this.y=d,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t},P}typeof SuppressedError=="function"&&SuppressedError;var M,E,C=V(F()),W=function(){if(E)return M;function n(t,i,o,c){this.cx=3*t,this.bx=3*(o-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*i,this.by=3*(c-i)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=i,this.p2x=o,this.p2y=c}return E=1,M=n,n.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,i){if(i===void 0&&(i=1e-6),t<0)return 0;if(t>1)return 1;for(var o=t,c=0;c<8;c++){var d=this.sampleCurveX(o)-t;if(Math.abs(d)<i)return o;var m=this.sampleCurveDerivativeX(o);if(Math.abs(m)<1e-6)break;o-=d/m}var v=0,S=1;for(o=t,c=0;c<20&&(d=this.sampleCurveX(o),!(Math.abs(d-t)<i));c++)t>d?v=o:S=o,o=.5*(S-v)+v;return o},solve:function(t,i){return this.sampleCurveY(this.solveCurveX(t,i))}},M}(),J=V(W);let se,oe;function Se(){return se==null&&(se=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),se}function $(){if(oe==null&&(oe=!1,Se())){const t=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(t){for(let o=0;o<5*5;o++){const c=4*o;t.fillStyle=`rgb(${c},${c+1},${c+2})`,t.fillRect(o%5,Math.floor(o/5),1,1)}const i=t.getImageData(0,0,5,5).data;for(let o=0;o<5*5*4;o++)if(o%4!=3&&i[o]!==o){oe=!0;break}}}return oe||!1}var de=1e-6,Ce=typeof Float32Array<"u"?Float32Array:Array;function Re(){var n=new Ce(9);return Ce!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[5]=0,n[6]=0,n[7]=0),n[0]=1,n[4]=1,n[8]=1,n}function Ze(n){return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function kt(){var n=new Ce(3);return Ce!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n}function tt(n){return Math.hypot(n[0],n[1],n[2])}function Ge(n,t,i){var o=new Ce(3);return o[0]=n,o[1]=t,o[2]=i,o}Math.hypot||(Math.hypot=function(){for(var n=0,t=arguments.length;t--;)n+=arguments[t]*arguments[t];return Math.sqrt(n)});var it,vt=tt;function Lt(n,t,i){var o=t[0],c=t[1],d=t[2],m=t[3];return n[0]=i[0]*o+i[4]*c+i[8]*d+i[12]*m,n[1]=i[1]*o+i[5]*c+i[9]*d+i[13]*m,n[2]=i[2]*o+i[6]*c+i[10]*d+i[14]*m,n[3]=i[3]*o+i[7]*c+i[11]*d+i[15]*m,n}function Ar(){var n=new Ce(4);return Ce!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function hr(){var n=new Ce(2);return Ce!=Float32Array&&(n[0]=0,n[1]=0),n}function xi(n,t){var i=new Ce(2);return i[0]=n,i[1]=t,i}kt(),it=new Ce(4),Ce!=Float32Array&&(it[0]=0,it[1]=0,it[2]=0,it[3]=0),kt(),Ge(1,0,0),Ge(0,1,0),Ar(),Ar(),Re(),hr();const Jt=8192;function nn(n,t,i){return t*(Jt/(n.tileSize*Math.pow(2,i-n.tileID.overscaledZ)))}function Ei(n,t){return(n%t+t)%t}function kn(n,t,i){return n*(1-i)+t*i}function Kr(n){if(n<=0)return 0;if(n>=1)return 1;const t=n*n,i=t*n;return 4*(n<.5?i:3*(n-t)+i-.75)}function as(n,t,i,o){const c=new J(n,t,i,o);return d=>c.solve(d)}const Pi=as(.25,.1,.25,1);function Lr(n,t,i){return Math.min(i,Math.max(t,n))}function et(n,t,i){const o=i-t,c=((n-t)%o+o)%o+t;return c===t?i:c}function Qe(n,...t){for(const i of t)for(const o in i)n[o]=i[o];return n}let ut=1;function xt(n,t,i){const o={};for(const c in n)o[c]=t.call(this,n[c],c,n);return o}function ot(n,t,i){const o={};for(const c in n)t.call(this,n[c],c,n)&&(o[c]=n[c]);return o}function ht(n){return Array.isArray(n)?n.map(ht):typeof n=="object"&&n?xt(n,ht):n}const Ct={};function _t(n){Ct[n]||(typeof console<"u"&&console.warn(n),Ct[n]=!0)}function dt(n,t,i){return(i.y-n.y)*(t.x-n.x)>(t.y-n.y)*(i.x-n.x)}function er(n){return typeof WorkerGlobalScope<"u"&&n!==void 0&&n instanceof WorkerGlobalScope}let bi=null;function Yt(n){return typeof ImageBitmap<"u"&&n instanceof ImageBitmap}const Fi="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Qt(n,t,i,o,c){return s(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const d=new VideoFrame(n,{timestamp:0});try{const m=d==null?void 0:d.format;if(!m||!m.startsWith("BGR")&&!m.startsWith("RGB"))throw new Error(`Unrecognized format ${m}`);const v=m.startsWith("BGR"),S=new Uint8ClampedArray(o*c*4);if(yield d.copyTo(S,function(I,B,z,q,j){const H=4*Math.max(1,0),G=(Math.max(0,z)-z)*q*4+H,ee=4*q,le=Math.max(0,B),ve=Math.max(0,z);return{rect:{x:le,y:ve,width:Math.min(I.width,B+q)-le,height:Math.min(I.height,z+j)-ve},layout:[{offset:G,stride:ee}]}}(n,t,i,o,c)),v)for(let I=0;I<S.length;I+=4){const B=S[I];S[I]=S[I+2],S[I+2]=B}return S}finally{d.close()}})}let Rr,ai;function ir(n,t,i,o){return n.addEventListener(t,i,o),{unsubscribe:()=>{n.removeEventListener(t,i,o)}}}function Xt(n){return n*Math.PI/180}function bt(n){return n/Math.PI*180}const Er={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},Br={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},Cr="AbortError";function zt(){return new Error(Cr)}const qr={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function li(n){return qr.REGISTERED_PROTOCOLS[n.substring(0,n.indexOf("://"))]}const wi="global-dispatcher";class Dr extends Error{constructor(t,i,o,c){super(`AJAXError: ${i} (${t}): ${o}`),this.status=t,this.statusText=i,this.url=o,this.body=c}}const nr=()=>er(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,Vr=function(n,t){if(/:\/\//.test(n.url)&&!/^https?:|^file:/.test(n.url)){const o=li(n.url);if(o)return o(n,t);if(er(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:n,targetMapId:wi},t)}if(!(/^file:/.test(i=n.url)||/^file:/.test(nr())&&!/^\w+:/.test(i))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(o,c){return s(this,void 0,void 0,function*(){const d=new Request(o.url,{method:o.method||"GET",body:o.body,credentials:o.credentials,headers:o.headers,cache:o.cache,referrer:nr(),signal:c.signal});let m,v;o.type!=="json"||d.headers.has("Accept")||d.headers.set("Accept","application/json");try{m=yield fetch(d)}catch(I){throw new Dr(0,I.message,o.url,new Blob)}if(!m.ok){const I=yield m.blob();throw new Dr(m.status,m.statusText,o.url,I)}v=o.type==="arrayBuffer"||o.type==="image"?m.arrayBuffer():o.type==="json"?m.json():m.text();const S=yield v;if(c.signal.aborted)throw zt();return{data:S,cacheControl:m.headers.get("Cache-Control"),expires:m.headers.get("Expires")}})}(n,t);if(er(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:n,mustQueue:!0,targetMapId:wi},t)}var i;return function(o,c){return new Promise((d,m)=>{var v;const S=new XMLHttpRequest;S.open(o.method||"GET",o.url,!0),o.type!=="arrayBuffer"&&o.type!=="image"||(S.responseType="arraybuffer");for(const I in o.headers)S.setRequestHeader(I,o.headers[I]);o.type==="json"&&(S.responseType="text",!((v=o.headers)===null||v===void 0)&&v.Accept||S.setRequestHeader("Accept","application/json")),S.withCredentials=o.credentials==="include",S.onerror=()=>{m(new Error(S.statusText))},S.onload=()=>{if(!c.signal.aborted)if((S.status>=200&&S.status<300||S.status===0)&&S.response!==null){let I=S.response;if(o.type==="json")try{I=JSON.parse(S.response)}catch(B){return void m(B)}d({data:I,cacheControl:S.getResponseHeader("Cache-Control"),expires:S.getResponseHeader("Expires")})}else{const I=new Blob([S.response],{type:S.getResponseHeader("Content-Type")});m(new Dr(S.status,S.statusText,o.url,I))}},c.signal.addEventListener("abort",()=>{S.abort(),m(zt())}),S.send(o.body)})}(n,t)};function we(n){if(!n||n.indexOf("://")<=0||n.indexOf("data:image/")===0||n.indexOf("blob:")===0)return!0;const t=new URL(n),i=window.location;return t.protocol===i.protocol&&t.host===i.host}function Q(n,t,i){i[n]&&i[n].indexOf(t)!==-1||(i[n]=i[n]||[],i[n].push(t))}function X(n,t,i){if(i&&i[n]){const o=i[n].indexOf(t);o!==-1&&i[n].splice(o,1)}}class re{constructor(t,i={}){Qe(this,i),this.type=t}}class ce extends re{constructor(t,i={}){super("error",Qe({error:t},i))}}class _e{on(t,i){return this._listeners=this._listeners||{},Q(t,i,this._listeners),{unsubscribe:()=>{this.off(t,i)}}}off(t,i){return X(t,i,this._listeners),X(t,i,this._oneTimeListeners),this}once(t,i){return i?(this._oneTimeListeners=this._oneTimeListeners||{},Q(t,i,this._oneTimeListeners),this):new Promise(o=>this.once(t,o))}fire(t,i){typeof t=="string"&&(t=new re(t,i||{}));const o=t.type;if(this.listens(o)){t.target=this;const c=this._listeners&&this._listeners[o]?this._listeners[o].slice():[];for(const v of c)v.call(this,t);const d=this._oneTimeListeners&&this._oneTimeListeners[o]?this._oneTimeListeners[o].slice():[];for(const v of d)X(o,v,this._oneTimeListeners),v.call(this,t);const m=this._eventedParent;m&&(Qe(t,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),m.fire(t))}else t instanceof ce&&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,i){return this._eventedParent=t,this._eventedParentData=i,this}}var te={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},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"},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},"*":{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:"*"},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:{},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_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"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","property-type":"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","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"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","property-type":"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","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},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:"*",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_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"]},"property-type":"cross-faded"},"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_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"}}};const Pe=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function be(n,t){const i={};for(const o in n)o!=="ref"&&(i[o]=n[o]);return Pe.forEach(o=>{o in t&&(i[o]=t[o])}),i}function Ae(n,t){if(Array.isArray(n)){if(!Array.isArray(t)||n.length!==t.length)return!1;for(let i=0;i<n.length;i++)if(!Ae(n[i],t[i]))return!1;return!0}if(typeof n=="object"&&n!==null&&t!==null){if(typeof t!="object"||Object.keys(n).length!==Object.keys(t).length)return!1;for(const i in n)if(!Ae(n[i],t[i]))return!1;return!0}return n===t}function Ie(n,t){n.push(t)}function ke(n,t,i){Ie(i,{command:"addSource",args:[n,t[n]]})}function Ue(n,t,i){Ie(t,{command:"removeSource",args:[n]}),i[n]=!0}function $e(n,t,i,o){Ue(n,i,o),ke(n,t,i)}function rt(n,t,i){let o;for(o in n[i])if(Object.prototype.hasOwnProperty.call(n[i],o)&&o!=="data"&&!Ae(n[i][o],t[i][o]))return!1;for(o in t[i])if(Object.prototype.hasOwnProperty.call(t[i],o)&&o!=="data"&&!Ae(n[i][o],t[i][o]))return!1;return!0}function ft(n,t,i,o,c,d){n=n||{},t=t||{};for(const m in n)Object.prototype.hasOwnProperty.call(n,m)&&(Ae(n[m],t[m])||i.push({command:d,args:[o,m,t[m],c]}));for(const m in t)Object.prototype.hasOwnProperty.call(t,m)&&!Object.prototype.hasOwnProperty.call(n,m)&&(Ae(n[m],t[m])||i.push({command:d,args:[o,m,t[m],c]}))}function Tt(n){return n.id}function St(n,t){return n[t.id]=t,n}class Ve{constructor(t,i,o,c){this.message=(t?`${t}: `:"")+o,c&&(this.identifier=c),i!=null&&i.__line__&&(this.line=i.__line__)}}function Kt(n,...t){for(const i of t)for(const o in i)n[o]=i[o];return n}class Ft extends Error{constructor(t,i){super(i),this.message=i,this.key=t}}class Wt{constructor(t,i=[]){this.parent=t,this.bindings={};for(const[o,c]of i)this.bindings[o]=c}concat(t){return new Wt(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const wt={kind:"null"},qe={kind:"number"},gt={kind:"string"},Et={kind:"boolean"},vr={kind:"color"},xr={kind:"projectionDefinition"},Si={kind:"object"},Pt={kind:"value"},ls={kind:"collator"},zs={kind:"formatted"},Fn={kind:"padding"},Fs={kind:"colorArray"},hn={kind:"numberArray"},On={kind:"resolvedImage"},Pr={kind:"variableAnchorOffsetCollection"};function Ii(n,t){return{kind:"array",itemType:n,N:t}}function pr(n){if(n.kind==="array"){const t=pr(n.itemType);return typeof n.N=="number"?`array<${t}, ${n.N}>`:n.itemType.kind==="value"?"array":`array<${t}>`}return n.kind}const Os=[wt,qe,gt,Et,vr,xr,zs,Si,Ii(Pt),Fn,hn,Fs,On,Pr];function cs(n,t){if(t.kind==="error")return null;if(n.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!cs(n.itemType,t.itemType))&&(typeof n.N!="number"||n.N===t.N))return null}else{if(n.kind===t.kind)return null;if(n.kind==="value"){for(const i of Os)if(!cs(i,t))return null}}return`Expected ${pr(n)} but found ${pr(t)} instead.`}function Fa(n,t){return t.some(i=>i.kind===n.kind)}function Nn(n,t){return t.some(i=>i==="null"?n===null:i==="array"?Array.isArray(n):i==="object"?n&&!Array.isArray(n)&&typeof n=="object":i===typeof n)}function pn(n,t){return n.kind==="array"&&t.kind==="array"?n.itemType.kind===t.itemType.kind&&typeof n.N=="number":n.kind===t.kind}const lc=.96422,Oa=.82521,cc=4/29,us=6/29,uc=3*us*us,mh=us*us*us,gh=Math.PI/180,yh=180/Math.PI;function hc(n){return(n%=360)<0&&(n+=360),n}function Na([n,t,i,o]){let c,d;const m=qa((.2225045*(n=qn(n))+.7168786*(t=qn(t))+.0606169*(i=qn(i)))/1);n===t&&t===i?c=d=m:(c=qa((.4360747*n+.3850649*t+.1430804*i)/lc),d=qa((.0139322*n+.0971045*t+.7141733*i)/Oa));const v=116*m-16;return[v<0?0:v,500*(c-m),200*(m-d),o]}function qn(n){return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function qa(n){return n>mh?Math.pow(n,1/3):n/uc+cc}function pc([n,t,i,o]){let c=(n+16)/116,d=isNaN(t)?c:c+t/500,m=isNaN(i)?c:c-i/200;return c=1*Ua(c),d=lc*Ua(d),m=Oa*Ua(m),[Un(3.1338561*d-1.6168667*c-.4906146*m),Un(-.9787684*d+1.9161415*c+.033454*m),Un(.0719453*d-.2289914*c+1.4052427*m),o]}function Un(n){return(n=n<=.00304?12.92*n:1.055*Math.pow(n,1/2.4)-.055)<0?0:n>1?1:n}function Ua(n){return n>us?n*n*n:uc*(n-cc)}const _h=Object.hasOwn||function(n,t){return Object.prototype.hasOwnProperty.call(n,t)};function Ns(n,t){return _h(n,t)?n[t]:void 0}function qs(n){return parseInt(n.padEnd(2,n),16)/255}function ja(n,t){return fi(t?n/100:n,0,1)}function fi(n,t,i){return Math.min(Math.max(t,n),i)}function Ut(n){return!n.some(Number.isNaN)}const hs={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 mi(n,t,i){return n+i*(t-n)}function jn(n,t,i){return n.map((o,c)=>mi(o,t[c],i))}class Ot{constructor(t,i,o,c=1,d=!0){this.r=t,this.g=i,this.b=o,this.a=c,d||(this.r*=c,this.g*=c,this.b*=c,c||this.overwriteGetter("rgb",[t,i,o,c]))}static parse(t){if(t instanceof Ot)return t;if(typeof t!="string")return;const i=function(o){if((o=o.toLowerCase().trim())==="transparent")return[0,0,0,0];const c=Ns(hs,o);if(c){const[m,v,S]=c;return[m/255,v/255,S/255,1]}if(o.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(o)){const m=o.length<6?1:2;let v=1;return[qs(o.slice(v,v+=m)),qs(o.slice(v,v+=m)),qs(o.slice(v,v+=m)),qs(o.slice(v,v+m)||"ff")]}if(o.startsWith("rgb")){const m=o.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(m){const[v,S,I,B,z,q,j,H,G,ee,le,ve]=m,he=[B||" ",j||" ",ee].join("");if(he===" "||he===" /"||he===",,"||he===",,,"){const U=[I,q,G].join(""),Y=U==="%%%"?100:U===""?255:0;if(Y){const pe=[fi(+S/Y,0,1),fi(+z/Y,0,1),fi(+H/Y,0,1),le?ja(+le,ve):1];if(Ut(pe))return pe}}return}}const d=o.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(d){const[m,v,S,I,B,z,q,j,H]=d,G=[S||" ",B||" ",q].join("");if(G===" "||G===" /"||G===",,"||G===",,,"){const ee=[+v,fi(+I,0,100),fi(+z,0,100),j?ja(+j,H):1];if(Ut(ee))return function([le,ve,he,U]){function Y(pe){const Ee=(pe+le/30)%12,je=ve*Math.min(he,1-he);return he-je*Math.max(-1,Math.min(Ee-3,9-Ee,1))}return le=hc(le),ve/=100,he/=100,[Y(0),Y(8),Y(4),U]}(ee)}}}(t);return i?new Ot(...i,!1):void 0}get rgb(){const{r:t,g:i,b:o,a:c}=this,d=c||1/0;return this.overwriteGetter("rgb",[t/d,i/d,o/d,c])}get hcl(){return this.overwriteGetter("hcl",function(t){const[i,o,c,d]=Na(t),m=Math.sqrt(o*o+c*c);return[Math.round(1e4*m)?hc(Math.atan2(c,o)*yh):NaN,m,i,d]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Na(this.rgb))}overwriteGetter(t,i){return Object.defineProperty(this,t,{value:i}),i}toString(){const[t,i,o,c]=this.rgb;return`rgba(${[t,i,o].map(d=>Math.round(255*d)).join(",")},${c})`}static interpolate(t,i,o,c="rgb"){switch(c){case"rgb":{const[d,m,v,S]=jn(t.rgb,i.rgb,o);return new Ot(d,m,v,S,!1)}case"hcl":{const[d,m,v,S]=t.hcl,[I,B,z,q]=i.hcl;let j,H;if(isNaN(d)||isNaN(I))isNaN(d)?isNaN(I)?j=NaN:(j=I,v!==1&&v!==0||(H=B)):(j=d,z!==1&&z!==0||(H=m));else{let he=I-d;I>d&&he>180?he-=360:I<d&&d-I>180&&(he+=360),j=d+o*he}const[G,ee,le,ve]=function([he,U,Y,pe]){return he=isNaN(he)?0:he*gh,pc([Y,Math.cos(he)*U,Math.sin(he)*U,pe])}([j,H??mi(m,B,o),mi(v,z,o),mi(S,q,o)]);return new Ot(G,ee,le,ve,!1)}case"lab":{const[d,m,v,S]=pc(jn(t.lab,i.lab,o));return new Ot(d,m,v,S,!1)}}}}Ot.black=new Ot(0,0,0,1),Ot.white=new Ot(1,1,1,1),Ot.transparent=new Ot(0,0,0,0),Ot.red=new Ot(1,0,0,1);class Us{constructor(t,i,o){this.sensitivity=t?i?"variant":"case":i?"accent":"base",this.locale=o,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,i){return this.collator.compare(t,i)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}const js=["bottom","center","top"];class ps{constructor(t,i,o,c,d,m){this.text=t,this.image=i,this.scale=o,this.fontStack=c,this.textColor=d,this.verticalAlign=m}}class ki{constructor(t){this.sections=t}static fromString(t){return new ki([new ps(t,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(t=>t.text.length!==0||t.image&&t.image.name.length!==0)}static factory(t){return t instanceof ki?t:ki.fromString(t)}toString(){return this.sections.length===0?"":this.sections.map(t=>t.text).join("")}}class ti{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof ti)return t;if(typeof t=="number")return new ti([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(const i of t)if(typeof i!="number")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 ti(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,i,o){return new ti(jn(t.values,i.values,o))}}class Ir{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Ir)return t;if(typeof t=="number")return new Ir([t]);if(Array.isArray(t)){for(const i of t)if(typeof i!="number")return;return new Ir(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,i,o){return new Ir(jn(t.values,i.values,o))}}class ri{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof ri)return t;if(typeof t=="string"){const o=Ot.parse(t);return o?new ri([o]):void 0}if(!Array.isArray(t))return;const i=[];for(const o of t){if(typeof o!="string")return;const c=Ot.parse(o);if(!c)return;i.push(c)}return new ri(i)}toString(){return JSON.stringify(this.values)}static interpolate(t,i,o,c="rgb"){const d=[];if(t.values.length!=i.values.length)throw new Error(`colorArray: Arrays have mismatched length (${t.values.length} vs. ${i.values.length}), cannot interpolate.`);for(let m=0;m<t.values.length;m++)d.push(Ot.interpolate(t.values[m],i.values[m],o,c));return new ri(d)}}class ar extends Error{constructor(t){super(t),this.name="RuntimeError"}toJSON(){return this.message}}const ds=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class gi{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof gi)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let i=0;i<t.length;i+=2){const o=t[i],c=t[i+1];if(typeof o!="string"||!ds.has(o)||!Array.isArray(c)||c.length!==2||typeof c[0]!="number"||typeof c[1]!="number")return}return new gi(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,i,o){const c=t.values,d=i.values;if(c.length!==d.length)throw new ar(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${i.toString()}`);const m=[];for(let v=0;v<c.length;v+=2){if(c[v]!==d[v])throw new ar(`Cannot interpolate values containing mismatched anchors. from[${v}]: ${c[v]}, to[${v}]: ${d[v]}`);m.push(c[v]);const[S,I]=c[v+1],[B,z]=d[v+1];m.push([mi(S,B,o),mi(I,z,o)])}return new gi(m)}}class Mi{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new Mi({name:t,available:!1}):null}}class Ai{constructor(t,i,o){this.from=t,this.to=i,this.transition=o}static interpolate(t,i,o){return new Ai(t,i,o)}static parse(t){return t instanceof Ai?t:Array.isArray(t)&&t.length===3&&typeof t[0]=="string"&&typeof t[1]=="string"&&typeof t[2]=="number"?new Ai(t[0],t[1],t[2]):typeof t=="object"&&typeof t.from=="string"&&typeof t.to=="string"&&typeof t.transition=="number"?new Ai(t.from,t.to,t.transition):typeof t=="string"?new Ai(t,t,1):void 0}}function Ws(n,t,i,o){return typeof n=="number"&&n>=0&&n<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof i=="number"&&i>=0&&i<=255?o===void 0||typeof o=="number"&&o>=0&&o<=1?null:`Invalid rgba value [${[n,t,i,o].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof o=="number"?[n,t,i,o]:[n,t,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function $t(n){if(n===null||typeof n=="string"||typeof n=="boolean"||typeof n=="number"||n instanceof Ai||n instanceof Ot||n instanceof Us||n instanceof ki||n instanceof ti||n instanceof Ir||n instanceof ri||n instanceof gi||n instanceof Mi)return!0;if(Array.isArray(n)){for(const t of n)if(!$t(t))return!1;return!0}if(typeof n=="object"){for(const t in n)if(!$t(n[t]))return!1;return!0}return!1}function br(n){if(n===null)return wt;if(typeof n=="string")return gt;if(typeof n=="boolean")return Et;if(typeof n=="number")return qe;if(n instanceof Ot)return vr;if(n instanceof Ai)return xr;if(n instanceof Us)return ls;if(n instanceof ki)return zs;if(n instanceof ti)return Fn;if(n instanceof Ir)return hn;if(n instanceof ri)return Fs;if(n instanceof gi)return Pr;if(n instanceof Mi)return On;if(Array.isArray(n)){const t=n.length;let i;for(const o of n){const c=br(o);if(i){if(i===c)continue;i=Pt;break}i=c}return Ii(i||Pt,t)}return Si}function Nt(n){const t=typeof n;return n===null?"":t==="string"||t==="number"||t==="boolean"?String(n):n instanceof Ot||n instanceof Ai||n instanceof ki||n instanceof ti||n instanceof Ir||n instanceof ri||n instanceof gi||n instanceof Mi?n.toString():JSON.stringify(n)}class At{constructor(t,i){this.type=t,this.value=i}static parse(t,i){if(t.length!==2)return i.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!$t(t[1]))return i.error("invalid value");const o=t[1];let c=br(o);const d=i.expectedType;return c.kind!=="array"||c.N!==0||!d||d.kind!=="array"||typeof d.N=="number"&&d.N!==0||(c=d),new At(c,o)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const fs={string:gt,number:qe,boolean:Et,object:Si};class It{constructor(t,i){this.type=t,this.args=i}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");let o,c=1;const d=t[0];if(d==="array"){let v,S;if(t.length>2){const I=t[1];if(typeof I!="string"||!(I in fs)||I==="object")return i.error('The item type argument of "array" must be one of string, number, boolean',1);v=fs[I],c++}else v=Pt;if(t.length>3){if(t[2]!==null&&(typeof t[2]!="number"||t[2]<0||t[2]!==Math.floor(t[2])))return i.error('The length argument to "array" must be a positive integer literal',2);S=t[2],c++}o=Ii(v,S)}else{if(!fs[d])throw new Error(`Types doesn't contain name = ${d}`);o=fs[d]}const m=[];for(;c<t.length;c++){const v=i.parse(t[c],c,Pt);if(!v)return null;m.push(v)}return new It(o,m)}evaluate(t){for(let i=0;i<this.args.length;i++){const o=this.args[i].evaluate(t);if(!cs(this.type,br(o)))return o;if(i===this.args.length-1)throw new ar(`Expected value to be of type ${pr(this.type)}, but found ${pr(br(o))} instead.`)}throw new Error}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}const Ro={"to-boolean":Et,"to-color":vr,"to-number":qe,"to-string":gt};class ci{constructor(t,i){this.type=t,this.args=i}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");const o=t[0];if(!Ro[o])throw new Error(`Can't parse ${o} as it is not part of the known types`);if((o==="to-boolean"||o==="to-string")&&t.length!==2)return i.error("Expected one argument.");const c=Ro[o],d=[];for(let m=1;m<t.length;m++){const v=i.parse(t[m],m,Pt);if(!v)return null;d.push(v)}return new ci(c,d)}evaluate(t){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(t);case"color":{let i,o;for(const c of this.args){if(i=c.evaluate(t),o=null,i instanceof Ot)return i;if(typeof i=="string"){const d=t.parseColor(i);if(d)return d}else if(Array.isArray(i)&&(o=i.length<3||i.length>4?`Invalid rgba value ${JSON.stringify(i)}: expected an array containing either three or four numeric values.`:Ws(i[0],i[1],i[2],i[3]),!o))return new Ot(i[0]/255,i[1]/255,i[2]/255,i[3])}throw new ar(o||`Could not parse color from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"padding":{let i;for(const o of this.args){i=o.evaluate(t);const c=ti.parse(i);if(c)return c}throw new ar(`Could not parse padding from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"numberArray":{let i;for(const o of this.args){i=o.evaluate(t);const c=Ir.parse(i);if(c)return c}throw new ar(`Could not parse numberArray from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"colorArray":{let i;for(const o of this.args){i=o.evaluate(t);const c=ri.parse(i);if(c)return c}throw new ar(`Could not parse colorArray from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"variableAnchorOffsetCollection":{let i;for(const o of this.args){i=o.evaluate(t);const c=gi.parse(i);if(c)return c}throw new ar(`Could not parse variableAnchorOffsetCollection from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"number":{let i=null;for(const o of this.args){if(i=o.evaluate(t),i===null)return 0;const c=Number(i);if(!isNaN(c))return c}throw new ar(`Could not convert ${JSON.stringify(i)} to number.`)}case"formatted":return ki.fromString(Nt(this.args[0].evaluate(t)));case"resolvedImage":return Mi.fromString(Nt(this.args[0].evaluate(t)));case"projectionDefinition":return this.args[0].evaluate(t);default:return Nt(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}const Wa=["Unknown","Point","LineString","Polygon"];class Ha{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?typeof this.feature.type=="number"?Wa[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 i=this._parseColorCache.get(t);return i||(i=Ot.parse(t),this._parseColorCache.set(t,i)),i}}class Hs{constructor(t,i,o=[],c,d=new Wt,m=[]){this.registry=t,this.path=o,this.key=o.map(v=>`[${v}]`).join(""),this.scope=d,this.errors=m,this.expectedType=c,this._isConstant=i}parse(t,i,o,c,d={}){return i?this.concat(i,o,c)._parse(t,d):this._parse(t,d)}_parse(t,i){function o(c,d,m){return m==="assert"?new It(d,[c]):m==="coerce"?new ci(d,[c]):c}if(t!==null&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"||(t=["literal",t]),Array.isArray(t)){if(t.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const c=t[0];if(typeof c!="string")return this.error(`Expression name must be a string, but found ${typeof c} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const d=this.registry[c];if(d){let m=d.parse(t,this);if(!m)return null;if(this.expectedType){const v=this.expectedType,S=m.type;if(v.kind!=="string"&&v.kind!=="number"&&v.kind!=="boolean"&&v.kind!=="object"&&v.kind!=="array"||S.kind!=="value"){if(v.kind==="projectionDefinition"&&["string","array"].includes(S.kind)||["color","formatted","resolvedImage"].includes(v.kind)&&["value","string"].includes(S.kind)||["padding","numberArray"].includes(v.kind)&&["value","number","array"].includes(S.kind)||v.kind==="colorArray"&&["value","string","array"].includes(S.kind)||v.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(S.kind))m=o(m,v,i.typeAnnotation||"coerce");else if(this.checkSubtype(v,S))return null}else m=o(m,v,i.typeAnnotation||"assert")}if(!(m instanceof At)&&m.type.kind!=="resolvedImage"&&this._isConstant(m)){const v=new Ha;try{m=new At(m.type,m.evaluate(v))}catch(S){return this.error(S.message),null}}return m}return this.error(`Unknown expression "${c}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(t===void 0?"'undefined' value invalid. Use null instead.":typeof t=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,i,o){const c=typeof t=="number"?this.path.concat(t):this.path,d=o?this.scope.concat(o):this.scope;return new Hs(this.registry,this._isConstant,c,i||null,d,this.errors)}error(t,...i){const o=`${this.key}${i.map(c=>`[${c}]`).join("")}`;this.errors.push(new Ft(o,t))}checkSubtype(t,i){const o=cs(t,i);return o&&this.error(o),o}}class ms{constructor(t,i){this.type=i.type,this.bindings=[].concat(t),this.result=i}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const i of this.bindings)t(i[1]);t(this.result)}static parse(t,i){if(t.length<4)return i.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const o=[];for(let d=1;d<t.length-1;d+=2){const m=t[d];if(typeof m!="string")return i.error(`Expected string, but found ${typeof m} instead.`,d);if(/[^a-zA-Z0-9_]/.test(m))return i.error("Variable names must contain only alphanumeric characters or '_'.",d);const v=i.parse(t[d+1],d+1);if(!v)return null;o.push([m,v])}const c=i.parse(t[t.length-1],t.length-1,i.expectedType,o);return c?new ms(o,c):null}outputDefined(){return this.result.outputDefined()}}class Zs{constructor(t,i){this.type=i.type,this.name=t,this.boundExpression=i}static parse(t,i){if(t.length!==2||typeof t[1]!="string")return i.error("'var' expression requires exactly one string literal argument.");const o=t[1];return i.scope.has(o)?new Zs(o,i.scope.get(o)):i.error(`Unknown variable "${o}". Make sure "${o}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}}class Za{constructor(t,i,o){this.type=t,this.index=i,this.input=o}static parse(t,i){if(t.length!==3)return i.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const o=i.parse(t[1],1,qe),c=i.parse(t[2],2,Ii(i.expectedType||Pt));return o&&c?new Za(c.type.itemType,o,c):null}evaluate(t){const i=this.index.evaluate(t),o=this.input.evaluate(t);if(i<0)throw new ar(`Array index out of bounds: ${i} < 0.`);if(i>=o.length)throw new ar(`Array index out of bounds: ${i} > ${o.length-1}.`);if(i!==Math.floor(i))throw new ar(`Array index must be an integer, but found ${i} instead.`);return o[i]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}}class Bo{constructor(t,i){this.type=Et,this.needle=t,this.haystack=i}static parse(t,i){if(t.length!==3)return i.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const o=i.parse(t[1],1,Pt),c=i.parse(t[2],2,Pt);return o&&c?Fa(o.type,[Et,gt,qe,wt,Pt])?new Bo(o,c):i.error(`Expected first argument to be of type boolean, string, number or null, but found ${pr(o.type)} instead`):null}evaluate(t){const i=this.needle.evaluate(t),o=this.haystack.evaluate(t);if(!o)return!1;if(!Nn(i,["boolean","string","number","null"]))throw new ar(`Expected first argument to be of type boolean, string, number or null, but found ${pr(br(i))} instead.`);if(!Nn(o,["string","array"]))throw new ar(`Expected second argument to be of type array or string, but found ${pr(br(o))} instead.`);return o.indexOf(i)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class Ks{constructor(t,i,o){this.type=qe,this.needle=t,this.haystack=i,this.fromIndex=o}static parse(t,i){if(t.length<=2||t.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const o=i.parse(t[1],1,Pt),c=i.parse(t[2],2,Pt);if(!o||!c)return null;if(!Fa(o.type,[Et,gt,qe,wt,Pt]))return i.error(`Expected first argument to be of type boolean, string, number or null, but found ${pr(o.type)} instead`);if(t.length===4){const d=i.parse(t[3],3,qe);return d?new Ks(o,c,d):null}return new Ks(o,c)}evaluate(t){const i=this.needle.evaluate(t),o=this.haystack.evaluate(t);if(!Nn(i,["boolean","string","number","null"]))throw new ar(`Expected first argument to be of type boolean, string, number or null, but found ${pr(br(i))} instead.`);let c;if(this.fromIndex&&(c=this.fromIndex.evaluate(t)),Nn(o,["string"])){const d=o.indexOf(i,c);return d===-1?-1:[...o.slice(0,d)].length}if(Nn(o,["array"]))return o.indexOf(i,c);throw new ar(`Expected second argument to be of type array or string, but found ${pr(br(o))} instead.`)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class Wn{constructor(t,i,o,c,d,m){this.inputType=t,this.type=i,this.input=o,this.cases=c,this.outputs=d,this.otherwise=m}static parse(t,i){if(t.length<5)return i.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return i.error("Expected an even number of arguments.");let o,c;i.expectedType&&i.expectedType.kind!=="value"&&(c=i.expectedType);const d={},m=[];for(let I=2;I<t.length-1;I+=2){let B=t[I];const z=t[I+1];Array.isArray(B)||(B=[B]);const q=i.concat(I);if(B.length===0)return q.error("Expected at least one branch label.");for(const H of B){if(typeof H!="number"&&typeof H!="string")return q.error("Branch labels must be numbers or strings.");if(typeof H=="number"&&Math.abs(H)>Number.MAX_SAFE_INTEGER)return q.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof H=="number"&&Math.floor(H)!==H)return q.error("Numeric branch labels must be integer values.");if(o){if(q.checkSubtype(o,br(H)))return null}else o=br(H);if(d[String(H)]!==void 0)return q.error("Branch labels must be unique.");d[String(H)]=m.length}const j=i.parse(z,I,c);if(!j)return null;c=c||j.type,m.push(j)}const v=i.parse(t[1],1,Pt);if(!v)return null;const S=i.parse(t[t.length-1],t.length-1,c);return S?v.type.kind!=="value"&&i.concat(1).checkSubtype(o,v.type)?null:new Wn(o,c,v,d,m,S):null}evaluate(t){const i=this.input.evaluate(t);return(br(i)===this.inputType&&this.outputs[this.cases[i]]||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 Gr{constructor(t,i,o){this.type=t,this.branches=i,this.otherwise=o}static parse(t,i){if(t.length<4)return i.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return i.error("Expected an odd number of arguments.");let o;i.expectedType&&i.expectedType.kind!=="value"&&(o=i.expectedType);const c=[];for(let m=1;m<t.length-1;m+=2){const v=i.parse(t[m],m,Et);if(!v)return null;const S=i.parse(t[m+1],m+1,o);if(!S)return null;c.push([v,S]),o=o||S.type}const d=i.parse(t[t.length-1],t.length-1,o);if(!d)return null;if(!o)throw new Error("Can't infer output type");return new Gr(o,c,d)}evaluate(t){for(const[i,o]of this.branches)if(i.evaluate(t))return o.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[i,o]of this.branches)t(i),t(o);t(this.otherwise)}outputDefined(){return this.branches.every(([t,i])=>i.outputDefined())&&this.otherwise.outputDefined()}}class Hn{constructor(t,i,o,c){this.type=t,this.input=i,this.beginIndex=o,this.endIndex=c}static parse(t,i){if(t.length<=2||t.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const o=i.parse(t[1],1,Pt),c=i.parse(t[2],2,qe);if(!o||!c)return null;if(!Fa(o.type,[Ii(Pt),gt,Pt]))return i.error(`Expected first argument to be of type array or string, but found ${pr(o.type)} instead`);if(t.length===4){const d=i.parse(t[3],3,qe);return d?new Hn(o.type,o,c,d):null}return new Hn(o.type,o,c)}evaluate(t){const i=this.input.evaluate(t),o=this.beginIndex.evaluate(t);let c;if(this.endIndex&&(c=this.endIndex.evaluate(t)),Nn(i,["string"]))return[...i].slice(o,c).join("");if(Nn(i,["array"]))return i.slice(o,c);throw new ar(`Expected first argument to be of type array or string, but found ${pr(br(i))} instead.`)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function Gs(n,t){const i=n.length-1;let o,c,d=0,m=i,v=0;for(;d<=m;)if(v=Math.floor((d+m)/2),o=n[v],c=n[v+1],o<=t){if(v===i||t<c)return v;d=v+1}else{if(!(o>t))throw new ar("Input is not a number.");m=v-1}return 0}class An{constructor(t,i,o){this.type=t,this.input=i,this.labels=[],this.outputs=[];for(const[c,d]of o)this.labels.push(c),this.outputs.push(d)}static parse(t,i){if(t.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return i.error("Expected an even number of arguments.");const o=i.parse(t[1],1,qe);if(!o)return null;const c=[];let d=null;i.expectedType&&i.expectedType.kind!=="value"&&(d=i.expectedType);for(let m=1;m<t.length;m+=2){const v=m===1?-1/0:t[m],S=t[m+1],I=m,B=m+1;if(typeof v!="number")return i.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',I);if(c.length&&c[c.length-1][0]>=v)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',I);const z=i.parse(S,B,d);if(!z)return null;d=d||z.type,c.push([v,z])}return new An(d,o,c)}evaluate(t){const i=this.labels,o=this.outputs;if(i.length===1)return o[0].evaluate(t);const c=this.input.evaluate(t);if(c<=i[0])return o[0].evaluate(t);const d=i.length;return c>=i[d-1]?o[d-1].evaluate(t):o[Gs(i,c)].evaluate(t)}eachChild(t){t(this.input);for(const i of this.outputs)t(i)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function Jr(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Do,Vo,dc=function(){if(Vo)return Do;function n(t,i,o,c){this.cx=3*t,this.bx=3*(o-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*i,this.by=3*(c-i)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=i,this.p2x=o,this.p2y=c}return Vo=1,Do=n,n.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,i){if(i===void 0&&(i=1e-6),t<0)return 0;if(t>1)return 1;for(var o=t,c=0;c<8;c++){var d=this.sampleCurveX(o)-t;if(Math.abs(d)<i)return o;var m=this.sampleCurveDerivativeX(o);if(Math.abs(m)<1e-6)break;o-=d/m}var v=0,S=1;for(o=t,c=0;c<20&&(d=this.sampleCurveX(o),!(Math.abs(d-t)<i));c++)t>d?v=o:S=o,o=.5*(S-v)+v;return o},solve:function(t,i){return this.sampleCurveY(this.solveCurveX(t,i))}},Do}(),vh=Jr(dc);class ui{constructor(t,i,o,c,d){this.type=t,this.operator=i,this.interpolation=o,this.input=c,this.labels=[],this.outputs=[];for(const[m,v]of d)this.labels.push(m),this.outputs.push(v)}static interpolationFactor(t,i,o,c){let d=0;if(t.name==="exponential")d=Js(i,t.base,o,c);else if(t.name==="linear")d=Js(i,1,o,c);else if(t.name==="cubic-bezier"){const m=t.controlPoints;d=new vh(m[0],m[1],m[2],m[3]).solve(Js(i,1,o,c))}return d}static parse(t,i){let[o,c,d,...m]=t;if(!Array.isArray(c)||c.length===0)return i.error("Expected an interpolation type expression.",1);if(c[0]==="linear")c={name:"linear"};else if(c[0]==="exponential"){const I=c[1];if(typeof I!="number")return i.error("Exponential interpolation requires a numeric base.",1,1);c={name:"exponential",base:I}}else{if(c[0]!=="cubic-bezier")return i.error(`Unknown interpolation type ${String(c[0])}`,1,0);{const I=c.slice(1);if(I.length!==4||I.some(B=>typeof B!="number"||B<0||B>1))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);c={name:"cubic-bezier",controlPoints:I}}}if(t.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return i.error("Expected an even number of arguments.");if(d=i.parse(d,2,qe),!d)return null;const v=[];let S=null;o!=="interpolate-hcl"&&o!=="interpolate-lab"||i.expectedType==Fs?i.expectedType&&i.expectedType.kind!=="value"&&(S=i.expectedType):S=vr;for(let I=0;I<m.length;I+=2){const B=m[I],z=m[I+1],q=I+3,j=I+4;if(typeof B!="number")return i.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',q);if(v.length&&v[v.length-1][0]>=B)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',q);const H=i.parse(z,j,S);if(!H)return null;S=S||H.type,v.push([B,H])}return pn(S,qe)||pn(S,xr)||pn(S,vr)||pn(S,Fn)||pn(S,hn)||pn(S,Fs)||pn(S,Pr)||pn(S,Ii(qe))?new ui(S,o,c,d,v):i.error(`Type ${pr(S)} is not interpolatable.`)}evaluate(t){const i=this.labels,o=this.outputs;if(i.length===1)return o[0].evaluate(t);const c=this.input.evaluate(t);if(c<=i[0])return o[0].evaluate(t);const d=i.length;if(c>=i[d-1])return o[d-1].evaluate(t);const m=Gs(i,c),v=ui.interpolationFactor(this.interpolation,c,i[m],i[m+1]),S=o[m].evaluate(t),I=o[m+1].evaluate(t);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return mi(S,I,v);case"color":return Ot.interpolate(S,I,v);case"padding":return ti.interpolate(S,I,v);case"colorArray":return ri.interpolate(S,I,v);case"numberArray":return Ir.interpolate(S,I,v);case"variableAnchorOffsetCollection":return gi.interpolate(S,I,v);case"array":return jn(S,I,v);case"projectionDefinition":return Ai.interpolate(S,I,v)}case"interpolate-hcl":switch(this.type.kind){case"color":return Ot.interpolate(S,I,v,"hcl");case"colorArray":return ri.interpolate(S,I,v,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return Ot.interpolate(S,I,v,"lab");case"colorArray":return ri.interpolate(S,I,v,"lab")}}}eachChild(t){t(this.input);for(const i of this.outputs)t(i)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function Js(n,t,i,o){const c=o-i,d=n-i;return c===0?0:t===1?d/c:(Math.pow(t,d)-1)/(Math.pow(t,c)-1)}const sn={color:Ot.interpolate,number:mi,padding:ti.interpolate,numberArray:Ir.interpolate,colorArray:ri.interpolate,variableAnchorOffsetCollection:gi.interpolate,array:jn};class Zn{constructor(t,i){this.type=t,this.args=i}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");let o=null;const c=i.expectedType;c&&c.kind!=="value"&&(o=c);const d=[];for(const v of t.slice(1)){const S=i.parse(v,1+d.length,o,void 0,{typeAnnotation:"omit"});if(!S)return null;o=o||S.type,d.push(S)}if(!o)throw new Error("No output type");const m=c&&d.some(v=>cs(c,v.type));return new Zn(m?Pt:o,d)}evaluate(t){let i,o=null,c=0;for(const d of this.args)if(c++,o=d.evaluate(t),o&&o instanceof Mi&&!o.available&&(i||(i=o.name),o=null,c===this.args.length&&(o=i)),o!==null)break;return o}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}function Xs(n,t){return n==="=="||n==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function Oi(n,t,i,o){return o.compare(t,i)===0}function Kn(n,t,i){const o=n!=="=="&&n!=="!=";return class Qg{constructor(d,m,v){this.type=Et,this.lhs=d,this.rhs=m,this.collator=v,this.hasUntypedArgument=d.type.kind==="value"||m.type.kind==="value"}static parse(d,m){if(d.length!==3&&d.length!==4)return m.error("Expected two or three arguments.");const v=d[0];let S=m.parse(d[1],1,Pt);if(!S)return null;if(!Xs(v,S.type))return m.concat(1).error(`"${v}" comparisons are not supported for type '${pr(S.type)}'.`);let I=m.parse(d[2],2,Pt);if(!I)return null;if(!Xs(v,I.type))return m.concat(2).error(`"${v}" comparisons are not supported for type '${pr(I.type)}'.`);if(S.type.kind!==I.type.kind&&S.type.kind!=="value"&&I.type.kind!=="value")return m.error(`Cannot compare types '${pr(S.type)}' and '${pr(I.type)}'.`);o&&(S.type.kind==="value"&&I.type.kind!=="value"?S=new It(I.type,[S]):S.type.kind!=="value"&&I.type.kind==="value"&&(I=new It(S.type,[I])));let B=null;if(d.length===4){if(S.type.kind!=="string"&&I.type.kind!=="string"&&S.type.kind!=="value"&&I.type.kind!=="value")return m.error("Cannot use collator to compare non-string types.");if(B=m.parse(d[3],3,ls),!B)return null}return new Qg(S,I,B)}evaluate(d){const m=this.lhs.evaluate(d),v=this.rhs.evaluate(d);if(o&&this.hasUntypedArgument){const S=br(m),I=br(v);if(S.kind!==I.kind||S.kind!=="string"&&S.kind!=="number")throw new ar(`Expected arguments for "${n}" to be (string, string) or (number, number), but found (${S.kind}, ${I.kind}) instead.`)}if(this.collator&&!o&&this.hasUntypedArgument){const S=br(m),I=br(v);if(S.kind!=="string"||I.kind!=="string")return t(d,m,v)}return this.collator?i(d,m,v,this.collator.evaluate(d)):t(d,m,v)}eachChild(d){d(this.lhs),d(this.rhs),this.collator&&d(this.collator)}outputDefined(){return!0}}}const zo=Kn("==",function(n,t,i){return t===i},Oi),xh=Kn("!=",function(n,t,i){return t!==i},function(n,t,i,o){return!Oi(0,t,i,o)}),Ka=Kn("<",function(n,t,i){return t<i},function(n,t,i,o){return o.compare(t,i)<0}),bh=Kn(">",function(n,t,i){return t>i},function(n,t,i,o){return o.compare(t,i)>0}),wh=Kn("<=",function(n,t,i){return t<=i},function(n,t,i,o){return o.compare(t,i)<=0}),Sh=Kn(">=",function(n,t,i){return t>=i},function(n,t,i,o){return o.compare(t,i)>=0});class Fo{constructor(t,i,o){this.type=ls,this.locale=o,this.caseSensitive=t,this.diacriticSensitive=i}static parse(t,i){if(t.length!==2)return i.error("Expected one argument.");const o=t[1];if(typeof o!="object"||Array.isArray(o))return i.error("Collator options argument must be an object.");const c=i.parse(o["case-sensitive"]!==void 0&&o["case-sensitive"],1,Et);if(!c)return null;const d=i.parse(o["diacritic-sensitive"]!==void 0&&o["diacritic-sensitive"],1,Et);if(!d)return null;let m=null;return o.locale&&(m=i.parse(o.locale,1,gt),!m)?null:new Fo(c,d,m)}evaluate(t){return new Us(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 gs{constructor(t,i,o,c,d){this.type=gt,this.number=t,this.locale=i,this.currency=o,this.minFractionDigits=c,this.maxFractionDigits=d}static parse(t,i){if(t.length!==3)return i.error("Expected two arguments.");const o=i.parse(t[1],1,qe);if(!o)return null;const c=t[2];if(typeof c!="object"||Array.isArray(c))return i.error("NumberFormat options argument must be an object.");let d=null;if(c.locale&&(d=i.parse(c.locale,1,gt),!d))return null;let m=null;if(c.currency&&(m=i.parse(c.currency,1,gt),!m))return null;let v=null;if(c["min-fraction-digits"]&&(v=i.parse(c["min-fraction-digits"],1,qe),!v))return null;let S=null;return c["max-fraction-digits"]&&(S=i.parse(c["max-fraction-digits"],1,qe),!S)?null:new gs(o,d,m,v,S)}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 Oo{constructor(t){this.type=zs,this.sections=t}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");const o=t[1];if(!Array.isArray(o)&&typeof o=="object")return i.error("First argument must be an image or text section.");const c=[];let d=!1;for(let m=1;m<=t.length-1;++m){const v=t[m];if(d&&typeof v=="object"&&!Array.isArray(v)){d=!1;let S=null;if(v["font-scale"]&&(S=i.parse(v["font-scale"],1,qe),!S))return null;let I=null;if(v["text-font"]&&(I=i.parse(v["text-font"],1,Ii(gt)),!I))return null;let B=null;if(v["text-color"]&&(B=i.parse(v["text-color"],1,vr),!B))return null;let z=null;if(v["vertical-align"]){if(typeof v["vertical-align"]=="string"&&!js.includes(v["vertical-align"]))return i.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${v["vertical-align"]}' instead.`);if(z=i.parse(v["vertical-align"],1,gt),!z)return null}const q=c[c.length-1];q.scale=S,q.font=I,q.textColor=B,q.verticalAlign=z}else{const S=i.parse(t[m],1,Pt);if(!S)return null;const I=S.type.kind;if(I!=="string"&&I!=="value"&&I!=="null"&&I!=="resolvedImage")return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");d=!0,c.push({content:S,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Oo(c)}evaluate(t){return new ki(this.sections.map(i=>{const o=i.content.evaluate(t);return br(o)===On?new ps("",o,null,null,null,i.verticalAlign?i.verticalAlign.evaluate(t):null):new ps(Nt(o),null,i.scale?i.scale.evaluate(t):null,i.font?i.font.evaluate(t).join(","):null,i.textColor?i.textColor.evaluate(t):null,i.verticalAlign?i.verticalAlign.evaluate(t):null)}))}eachChild(t){for(const i of this.sections)t(i.content),i.scale&&t(i.scale),i.font&&t(i.font),i.textColor&&t(i.textColor),i.verticalAlign&&t(i.verticalAlign)}outputDefined(){return!1}}class No{constructor(t){this.type=On,this.input=t}static parse(t,i){if(t.length!==2)return i.error("Expected two arguments.");const o=i.parse(t[1],1,gt);return o?new No(o):i.error("No image name provided.")}evaluate(t){const i=this.input.evaluate(t),o=Mi.fromString(i);return o&&t.availableImages&&(o.available=t.availableImages.indexOf(i)>-1),o}eachChild(t){t(this.input)}outputDefined(){return!1}}class qo{constructor(t){this.type=qe,this.input=t}static parse(t,i){if(t.length!==2)return i.error(`Expected 1 argument, but found ${t.length-1} instead.`);const o=i.parse(t[1],1);return o?o.type.kind!=="array"&&o.type.kind!=="string"&&o.type.kind!=="value"?i.error(`Expected argument of type string or array, but found ${pr(o.type)} instead.`):new qo(o):null}evaluate(t){const i=this.input.evaluate(t);if(typeof i=="string")return[...i].length;if(Array.isArray(i))return i.length;throw new ar(`Expected value to be of type string or array, but found ${pr(br(i))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}}const on=8192;function fc(n,t){const i=(180+n[0])/360,o=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n[1]*Math.PI/360)))/360,c=Math.pow(2,t.z);return[Math.round(i*c*on),Math.round(o*c*on)]}function Ga(n,t){const i=Math.pow(2,t.z);return[(c=(n[0]/on+t.x)/i,360*c-180),(o=(n[1]/on+t.y)/i,360/Math.PI*Math.atan(Math.exp((180-360*o)*Math.PI/180))-90)];var o,c}function Qs(n,t){n[0]=Math.min(n[0],t[0]),n[1]=Math.min(n[1],t[1]),n[2]=Math.max(n[2],t[0]),n[3]=Math.max(n[3],t[1])}function Ys(n,t){return!(n[0]<=t[0]||n[2]>=t[2]||n[1]<=t[1]||n[3]>=t[3])}function kh(n,t,i){const o=n[0]-t[0],c=n[1]-t[1],d=n[0]-i[0],m=n[1]-i[1];return o*m-d*c==0&&o*d<=0&&c*m<=0}function Uo(n,t,i,o){return(c=[o[0]-i[0],o[1]-i[1]])[0]*(d=[t[0]-n[0],t[1]-n[1]])[1]-c[1]*d[0]!=0&&!(!_c(n,t,i,o)||!_c(i,o,n,t));var c,d}function mc(n,t,i){for(const o of i)for(let c=0;c<o.length-1;++c)if(Uo(n,t,o[c],o[c+1]))return!0;return!1}function Gn(n,t,i=!1){let o=!1;for(const v of t)for(let S=0;S<v.length-1;S++){if(kh(n,v[S],v[S+1]))return i;(d=v[S])[1]>(c=n)[1]!=(m=v[S+1])[1]>c[1]&&c[0]<(m[0]-d[0])*(c[1]-d[1])/(m[1]-d[1])+d[0]&&(o=!o)}var c,d,m;return o}function gc(n,t){for(const i of t)if(Gn(n,i))return!0;return!1}function yc(n,t){for(const i of n)if(!Gn(i,t))return!1;for(let i=0;i<n.length-1;++i)if(mc(n[i],n[i+1],t))return!1;return!0}function Ah(n,t){for(const i of t)if(yc(n,i))return!0;return!1}function _c(n,t,i,o){const c=o[0]-i[0],d=o[1]-i[1],m=(n[0]-i[0])*d-c*(n[1]-i[1]),v=(t[0]-i[0])*d-c*(t[1]-i[1]);return m>0&&v<0||m<0&&v>0}function $s(n,t,i){const o=[];for(let c=0;c<n.length;c++){const d=[];for(let m=0;m<n[c].length;m++){const v=fc(n[c][m],i);Qs(t,v),d.push(v)}o.push(d)}return o}function vc(n,t,i){const o=[];for(let c=0;c<n.length;c++){const d=$s(n[c],t,i);o.push(d)}return o}function xc(n,t,i,o){if(n[0]<i[0]||n[0]>i[2]){const c=.5*o;let d=n[0]-i[0]>c?-o:i[0]-n[0]>c?o:0;d===0&&(d=n[0]-i[2]>c?-o:i[2]-n[0]>c?o:0),n[0]+=d}Qs(t,n)}function bc(n,t,i,o){const c=Math.pow(2,o.z)*on,d=[o.x*on,o.y*on],m=[];for(const v of n)for(const S of v){const I=[S.x+d[0],S.y+d[1]];xc(I,t,i,c),m.push(I)}return m}function Ja(n,t,i,o){const c=Math.pow(2,o.z)*on,d=[o.x*on,o.y*on],m=[];for(const S of n){const I=[];for(const B of S){const z=[B.x+d[0],B.y+d[1]];Qs(t,z),I.push(z)}m.push(I)}if(t[2]-t[0]<=c/2){(v=t)[0]=v[1]=1/0,v[2]=v[3]=-1/0;for(const S of m)for(const I of S)xc(I,t,i,c)}var v;return m}class Cn{constructor(t,i){this.type=Et,this.geojson=t,this.geometries=i}static parse(t,i){if(t.length!==2)return i.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if($t(t[1])){const o=t[1];if(o.type==="FeatureCollection"){const c=[];for(const d of o.features){const{type:m,coordinates:v}=d.geometry;m==="Polygon"&&c.push(v),m==="MultiPolygon"&&c.push(...v)}if(c.length)return new Cn(o,{type:"MultiPolygon",coordinates:c})}else if(o.type==="Feature"){const c=o.geometry.type;if(c==="Polygon"||c==="MultiPolygon")return new Cn(o,o.geometry)}else if(o.type==="Polygon"||o.type==="MultiPolygon")return new Cn(o,o)}return i.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return function(i,o){const c=[1/0,1/0,-1/0,-1/0],d=[1/0,1/0,-1/0,-1/0],m=i.canonicalID();if(o.type==="Polygon"){const v=$s(o.coordinates,d,m),S=bc(i.geometry(),c,d,m);if(!Ys(c,d))return!1;for(const I of S)if(!Gn(I,v))return!1}if(o.type==="MultiPolygon"){const v=vc(o.coordinates,d,m),S=bc(i.geometry(),c,d,m);if(!Ys(c,d))return!1;for(const I of S)if(!gc(I,v))return!1}return!0}(t,this.geometries);if(t.geometryType()==="LineString")return function(i,o){const c=[1/0,1/0,-1/0,-1/0],d=[1/0,1/0,-1/0,-1/0],m=i.canonicalID();if(o.type==="Polygon"){const v=$s(o.coordinates,d,m),S=Ja(i.geometry(),c,d,m);if(!Ys(c,d))return!1;for(const I of S)if(!yc(I,v))return!1}if(o.type==="MultiPolygon"){const v=vc(o.coordinates,d,m),S=Ja(i.geometry(),c,d,m);if(!Ys(c,d))return!1;for(const I of S)if(!Ah(I,v))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let wc=class{constructor(n=[],t=(i,o)=>i<o?-1:i>o?1:0){if(this.data=n,this.length=this.data.length,this.compare=t,this.length>0)for(let i=(this.length>>1)-1;i>=0;i--)this._down(i)}push(n){this.data.push(n),this._up(this.length++)}pop(){if(this.length===0)return;const n=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),n}peek(){return this.data[0]}_up(n){const{data:t,compare:i}=this,o=t[n];for(;n>0;){const c=n-1>>1,d=t[c];if(i(o,d)>=0)break;t[n]=d,n=c}t[n]=o}_down(n){const{data:t,compare:i}=this,o=this.length>>1,c=t[n];for(;n<o;){let d=1+(n<<1);const m=d+1;if(m<this.length&&i(t[m],t[d])<0&&(d=m),i(t[d],c)>=0)break;t[n]=t[d],n=d}t[n]=c}};function Sc(n,t,i=0,o=n.length-1,c=kc){for(;o>i;){if(o-i>600){const S=o-i+1,I=t-i+1,B=Math.log(S),z=.5*Math.exp(2*B/3),q=.5*Math.sqrt(B*z*(S-z)/S)*(I-S/2<0?-1:1);Sc(n,t,Math.max(i,Math.floor(t-I*z/S+q)),Math.min(o,Math.floor(t+(S-I)*z/S+q)),c)}const d=n[t];let m=i,v=o;for(ys(n,i,t),c(n[o],d)>0&&ys(n,i,o);m<v;){for(ys(n,m,v),m++,v--;c(n[m],d)<0;)m++;for(;c(n[v],d)>0;)v--}c(n[i],d)===0?ys(n,i,v):(v++,ys(n,v,o)),v<=t&&(i=v+1),t<=v&&(o=v-1)}}function ys(n,t,i){const o=n[t];n[t]=n[i],n[i]=o}function kc(n,t){return n<t?-1:n>t?1:0}function jo(n,t){if(n.length<=1)return[n];const i=[];let o,c;for(const d of n){const m=Th(d);m!==0&&(d.area=Math.abs(m),c===void 0&&(c=m<0),c===m<0?(o&&i.push(o),o=[d]):o.push(d))}if(o&&i.push(o),t>1)for(let d=0;d<i.length;d++)i[d].length<=t||(Sc(i[d],t,1,i[d].length-1,Ch),i[d]=i[d].slice(0,t));return i}function Ch(n,t){return t.area-n.area}function Th(n){let t=0;for(let i,o,c=0,d=n.length,m=d-1;c<d;m=c++)i=n[c],o=n[m],t+=(o.x-i.x)*(i.y+o.y);return t}const Xa=1/298.257223563,Ac=Xa*(2-Xa),Cc=Math.PI/180;class Qa{constructor(t){const i=6378.137*Cc*1e3,o=Math.cos(t*Cc),c=1/(1-Ac*(1-o*o)),d=Math.sqrt(c);this.kx=i*d*o,this.ky=i*d*c*(1-Ac)}distance(t,i){const o=this.wrap(t[0]-i[0])*this.kx,c=(t[1]-i[1])*this.ky;return Math.sqrt(o*o+c*c)}pointOnLine(t,i){let o,c,d,m,v=1/0;for(let S=0;S<t.length-1;S++){let I=t[S][0],B=t[S][1],z=this.wrap(t[S+1][0]-I)*this.kx,q=(t[S+1][1]-B)*this.ky,j=0;z===0&&q===0||(j=(this.wrap(i[0]-I)*this.kx*z+(i[1]-B)*this.ky*q)/(z*z+q*q),j>1?(I=t[S+1][0],B=t[S+1][1]):j>0&&(I+=z/this.kx*j,B+=q/this.ky*j)),z=this.wrap(i[0]-I)*this.kx,q=(i[1]-B)*this.ky;const H=z*z+q*q;H<v&&(v=H,o=I,c=B,d=S,m=j)}return{point:[o,c],index:d,t:Math.max(0,Math.min(1,m))}}wrap(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}}function Tc(n,t){return t[0]-n[0]}function jt(n){return n[1]-n[0]+1}function dn(n,t){return n[1]>=n[0]&&n[1]<t}function Ya(n,t){if(n[0]>n[1])return[null,null];const i=jt(n);if(t){if(i===2)return[n,null];const c=Math.floor(i/2);return[[n[0],n[0]+c],[n[0]+c,n[1]]]}if(i===1)return[n,null];const o=Math.floor(i/2)-1;return[[n[0],n[0]+o],[n[0]+o+1,n[1]]]}function $a(n,t){if(!dn(t,n.length))return[1/0,1/0,-1/0,-1/0];const i=[1/0,1/0,-1/0,-1/0];for(let o=t[0];o<=t[1];++o)Qs(i,n[o]);return i}function el(n){const t=[1/0,1/0,-1/0,-1/0];for(const i of n)for(const o of i)Qs(t,o);return t}function Ec(n){return n[0]!==-1/0&&n[1]!==-1/0&&n[2]!==1/0&&n[3]!==1/0}function tl(n,t,i){if(!Ec(n)||!Ec(t))return NaN;let o=0,c=0;return n[2]<t[0]&&(o=t[0]-n[2]),n[0]>t[2]&&(o=n[0]-t[2]),n[1]>t[3]&&(c=n[1]-t[3]),n[3]<t[1]&&(c=t[1]-n[3]),i.distance([0,0],[o,c])}function Jn(n,t,i){const o=i.pointOnLine(t,n);return i.distance(n,o.point)}function rl(n,t,i,o,c){const d=Math.min(Jn(n,[i,o],c),Jn(t,[i,o],c)),m=Math.min(Jn(i,[n,t],c),Jn(o,[n,t],c));return Math.min(d,m)}function Eh(n,t,i,o,c){if(!dn(t,n.length)||!dn(o,i.length))return 1/0;let d=1/0;for(let m=t[0];m<t[1];++m){const v=n[m],S=n[m+1];for(let I=o[0];I<o[1];++I){const B=i[I],z=i[I+1];if(Uo(v,S,B,z))return 0;d=Math.min(d,rl(v,S,B,z,c))}}return d}function Ph(n,t,i,o,c){if(!dn(t,n.length)||!dn(o,i.length))return NaN;let d=1/0;for(let m=t[0];m<=t[1];++m)for(let v=o[0];v<=o[1];++v)if(d=Math.min(d,c.distance(n[m],i[v])),d===0)return d;return d}function Ih(n,t,i){if(Gn(n,t,!0))return 0;let o=1/0;for(const c of t){const d=c[0],m=c[c.length-1];if(d!==m&&(o=Math.min(o,Jn(n,[m,d],i)),o===0))return o;const v=i.pointOnLine(c,n);if(o=Math.min(o,i.distance(n,v.point)),o===0)return o}return o}function Mh(n,t,i,o){if(!dn(t,n.length))return NaN;for(let d=t[0];d<=t[1];++d)if(Gn(n[d],i,!0))return 0;let c=1/0;for(let d=t[0];d<t[1];++d){const m=n[d],v=n[d+1];for(const S of i)for(let I=0,B=S.length,z=B-1;I<B;z=I++){const q=S[z],j=S[I];if(Uo(m,v,q,j))return 0;c=Math.min(c,rl(m,v,q,j,o))}}return c}function Pc(n,t){for(const i of n)for(const o of i)if(Gn(o,t,!0))return!0;return!1}function Lh(n,t,i,o=1/0){const c=el(n),d=el(t);if(o!==1/0&&tl(c,d,i)>=o)return o;if(Ys(c,d)){if(Pc(n,t))return 0}else if(Pc(t,n))return 0;let m=1/0;for(const v of n)for(let S=0,I=v.length,B=I-1;S<I;B=S++){const z=v[B],q=v[S];for(const j of t)for(let H=0,G=j.length,ee=G-1;H<G;ee=H++){const le=j[ee],ve=j[H];if(Uo(z,q,le,ve))return 0;m=Math.min(m,rl(z,q,le,ve,i))}}return m}function Ic(n,t,i,o,c,d){if(!d)return;const m=tl($a(o,d),c,i);m<t&&n.push([m,d,[0,0]])}function Wo(n,t,i,o,c,d,m){if(!d||!m)return;const v=tl($a(o,d),$a(c,m),i);v<t&&n.push([v,d,m])}function Ho(n,t,i,o,c=1/0){let d=Math.min(o.distance(n[0],i[0][0]),c);if(d===0)return d;const m=new wc([[0,[0,n.length-1],[0,0]]],Tc),v=el(i);for(;m.length>0;){const S=m.pop();if(S[0]>=d)continue;const I=S[1],B=t?50:100;if(jt(I)<=B){if(!dn(I,n.length))return NaN;if(t){const z=Mh(n,I,i,o);if(isNaN(z)||z===0)return z;d=Math.min(d,z)}else for(let z=I[0];z<=I[1];++z){const q=Ih(n[z],i,o);if(d=Math.min(d,q),d===0)return 0}}else{const z=Ya(I,t);Ic(m,d,o,n,v,z[0]),Ic(m,d,o,n,v,z[1])}}return d}function Zo(n,t,i,o,c,d=1/0){let m=Math.min(d,c.distance(n[0],i[0]));if(m===0)return m;const v=new wc([[0,[0,n.length-1],[0,i.length-1]]],Tc);for(;v.length>0;){const S=v.pop();if(S[0]>=m)continue;const I=S[1],B=S[2],z=t?50:100,q=o?50:100;if(jt(I)<=z&&jt(B)<=q){if(!dn(I,n.length)&&dn(B,i.length))return NaN;let j;if(t&&o)j=Eh(n,I,i,B,c),m=Math.min(m,j);else if(t&&!o){const H=n.slice(I[0],I[1]+1);for(let G=B[0];G<=B[1];++G)if(j=Jn(i[G],H,c),m=Math.min(m,j),m===0)return m}else if(!t&&o){const H=i.slice(B[0],B[1]+1);for(let G=I[0];G<=I[1];++G)if(j=Jn(n[G],H,c),m=Math.min(m,j),m===0)return m}else j=Ph(n,I,i,B,c),m=Math.min(m,j)}else{const j=Ya(I,t),H=Ya(B,o);Wo(v,m,c,n,i,j[0],H[0]),Wo(v,m,c,n,i,j[0],H[1]),Wo(v,m,c,n,i,j[1],H[0]),Wo(v,m,c,n,i,j[1],H[1])}}return m}function il(n){return n.type==="MultiPolygon"?n.coordinates.map(t=>({type:"Polygon",coordinates:t})):n.type==="MultiLineString"?n.coordinates.map(t=>({type:"LineString",coordinates:t})):n.type==="MultiPoint"?n.coordinates.map(t=>({type:"Point",coordinates:t})):[n]}class Xn{constructor(t,i){this.type=qe,this.geojson=t,this.geometries=i}static parse(t,i){if(t.length!==2)return i.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if($t(t[1])){const o=t[1];if(o.type==="FeatureCollection")return new Xn(o,o.features.map(c=>il(c.geometry)).flat());if(o.type==="Feature")return new Xn(o,il(o.geometry));if("type"in o&&"coordinates"in o)return new Xn(o,il(o))}return i.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return function(i,o){const c=i.geometry(),d=c.flat().map(S=>Ga([S.x,S.y],i.canonical));if(c.length===0)return NaN;const m=new Qa(d[0][1]);let v=1/0;for(const S of o){switch(S.type){case"Point":v=Math.min(v,Zo(d,!1,[S.coordinates],!1,m,v));break;case"LineString":v=Math.min(v,Zo(d,!1,S.coordinates,!0,m,v));break;case"Polygon":v=Math.min(v,Ho(d,!1,S.coordinates,m,v))}if(v===0)return v}return v}(t,this.geometries);if(t.geometryType()==="LineString")return function(i,o){const c=i.geometry(),d=c.flat().map(S=>Ga([S.x,S.y],i.canonical));if(c.length===0)return NaN;const m=new Qa(d[0][1]);let v=1/0;for(const S of o){switch(S.type){case"Point":v=Math.min(v,Zo(d,!0,[S.coordinates],!1,m,v));break;case"LineString":v=Math.min(v,Zo(d,!0,S.coordinates,!0,m,v));break;case"Polygon":v=Math.min(v,Ho(d,!0,S.coordinates,m,v))}if(v===0)return v}return v}(t,this.geometries);if(t.geometryType()==="Polygon")return function(i,o){const c=i.geometry();if(c.length===0||c[0].length===0)return NaN;const d=jo(c,0).map(S=>S.map(I=>I.map(B=>Ga([B.x,B.y],i.canonical)))),m=new Qa(d[0][0][0][1]);let v=1/0;for(const S of o)for(const I of d){switch(S.type){case"Point":v=Math.min(v,Ho([S.coordinates],!1,I,m,v));break;case"LineString":v=Math.min(v,Ho(S.coordinates,!0,I,m,v));break;case"Polygon":v=Math.min(v,Lh(I,S.coordinates,m,v))}if(v===0)return v}return v}(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class Ko{constructor(t){this.type=Pt,this.key=t}static parse(t,i){if(t.length!==2)return i.error(`Expected 1 argument, but found ${t.length-1} instead.`);const o=t[1];return o==null?i.error("Global state property must be defined."):typeof o!="string"?i.error(`Global state property must be string, but found ${typeof t[1]} instead.`):new Ko(o)}evaluate(t){var i;const o=(i=t.globals)===null||i===void 0?void 0:i.globalState;return o&&Object.keys(o).length!==0?Ns(o,this.key):null}eachChild(){}outputDefined(){return!1}}const _s={"==":zo,"!=":xh,">":bh,"<":Ka,">=":Sh,"<=":wh,array:It,at:Za,boolean:It,case:Gr,coalesce:Zn,collator:Fo,format:Oo,image:No,in:Bo,"index-of":Ks,interpolate:ui,"interpolate-hcl":ui,"interpolate-lab":ui,length:qo,let:ms,literal:At,match:Wn,number:It,"number-format":gs,object:It,slice:Hn,step:An,string:It,"to-boolean":ci,"to-color":ci,"to-number":ci,"to-string":ci,var:Zs,within:Cn,distance:Xn,"global-state":Ko};class Ni{constructor(t,i,o,c){this.name=t,this.type=i,this._evaluate=o,this.args=c}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,i){const o=t[0],c=Ni.definitions[o];if(!c)return i.error(`Unknown expression "${o}". If you wanted a literal array, use ["literal", [...]].`,0);const d=Array.isArray(c)?c[0]:c.type,m=Array.isArray(c)?[[c[1],c[2]]]:c.overloads,v=m.filter(([I])=>!Array.isArray(I)||I.length===t.length-1);let S=null;for(const[I,B]of v){S=new Hs(i.registry,Go,i.path,null,i.scope);const z=[];let q=!1;for(let j=1;j<t.length;j++){const H=t[j],G=Array.isArray(I)?I[j-1]:I.type,ee=S.parse(H,1+z.length,G);if(!ee){q=!0;break}z.push(ee)}if(!q)if(Array.isArray(I)&&I.length!==z.length)S.error(`Expected ${I.length} arguments, but found ${z.length} instead.`);else{for(let j=0;j<z.length;j++){const H=Array.isArray(I)?I[j]:I.type,G=z[j];S.concat(j+1).checkSubtype(H,G.type)}if(S.errors.length===0)return new Ni(o,d,B,z)}}if(v.length===1)i.errors.push(...S.errors);else{const I=(v.length?v:m).map(([z])=>{return q=z,Array.isArray(q)?`(${q.map(pr).join(", ")})`:`(${pr(q.type)}...)`;var q}).join(" | "),B=[];for(let z=1;z<t.length;z++){const q=i.parse(t[z],1+B.length);if(!q)return null;B.push(pr(q.type))}i.error(`Expected arguments of type ${I}, but found (${B.join(", ")}) instead.`)}return null}static register(t,i){Ni.definitions=i;for(const o in i)t[o]=Ni}}function Mc(n,[t,i,o,c]){t=t.evaluate(n),i=i.evaluate(n),o=o.evaluate(n);const d=c?c.evaluate(n):1,m=Ws(t,i,o,d);if(m)throw new ar(m);return new Ot(t/255,i/255,o/255,d,!1)}function Lc(n,t){return n in t}function nl(n,t){const i=t[n];return i===void 0?null:i}function Qn(n){return{type:n}}function Go(n){if(n instanceof Zs)return Go(n.boundExpression);if(n instanceof Ni&&n.name==="error"||n instanceof Fo||n instanceof Cn||n instanceof Xn||n instanceof Ko)return!1;const t=n instanceof ci||n instanceof It;let i=!0;return n.eachChild(o=>{i=t?i&&Go(o):i&&o instanceof At}),!!i&&Jo(n)&&Xo(n,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Jo(n){if(n instanceof Ni&&(n.name==="get"&&n.args.length===1||n.name==="feature-state"||n.name==="has"&&n.args.length===1||n.name==="properties"||n.name==="geometry-type"||n.name==="id"||/^filter-/.test(n.name))||n instanceof Cn||n instanceof Xn)return!1;let t=!0;return n.eachChild(i=>{t&&!Jo(i)&&(t=!1)}),t}function eo(n){if(n instanceof Ni&&n.name==="feature-state")return!1;let t=!0;return n.eachChild(i=>{t&&!eo(i)&&(t=!1)}),t}function Xo(n,t){if(n instanceof Ni&&t.indexOf(n.name)>=0)return!1;let i=!0;return n.eachChild(o=>{i&&!Xo(o,t)&&(i=!1)}),i}function Qo(n){return{result:"success",value:n}}function vs(n){return{result:"error",value:n}}function xs(n){return n["property-type"]==="data-driven"||n["property-type"]==="cross-faded-data-driven"}function Rc(n){return!!n.expression&&n.expression.parameters.indexOf("zoom")>-1}function Yo(n){return!!n.expression&&n.expression.interpolated}function Rt(n){return n instanceof Number?"number":n instanceof String?"string":n instanceof Boolean?"boolean":Array.isArray(n)?"array":n===null?"null":typeof n}function $o(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&br(n)===Si}function ea(n){return n}function sl(n,t){const i=n.stops&&typeof n.stops[0][0]=="object",o=i||!(i||n.property!==void 0),c=n.type||(Yo(t)?"exponential":"interval"),d=function(B){switch(B.type){case"color":return Ot.parse;case"padding":return ti.parse;case"numberArray":return Ir.parse;case"colorArray":return ri.parse;default:return null}}(t);if(d&&((n=Kt({},n)).stops&&(n.stops=n.stops.map(B=>[B[0],d(B[1])])),n.default=d(n.default?n.default:t.default)),n.colorSpace&&(m=n.colorSpace)!=="rgb"&&m!=="hcl"&&m!=="lab")throw new Error(`Unknown color space: "${n.colorSpace}"`);var m;const v=function(B){switch(B){case"exponential":return Bc;case"interval":return Bh;case"categorical":return Rh;case"identity":return Dh;default:throw new Error(`Unknown function type "${B}"`)}}(c);let S,I;if(c==="categorical"){S=Object.create(null);for(const B of n.stops)S[B[0]]=B[1];I=typeof n.stops[0][0]}if(i){const B={},z=[];for(let H=0;H<n.stops.length;H++){const G=n.stops[H],ee=G[0].zoom;B[ee]===void 0&&(B[ee]={zoom:ee,type:n.type,property:n.property,default:n.default,stops:[]},z.push(ee)),B[ee].stops.push([G[0].value,G[1]])}const q=[];for(const H of z)q.push([B[H].zoom,sl(B[H],t)]);const j={name:"linear"};return{kind:"composite",interpolationType:j,interpolationFactor:ui.interpolationFactor.bind(void 0,j),zoomStops:q.map(H=>H[0]),evaluate:({zoom:H},G)=>Bc({stops:q,base:n.base},t,H).evaluate(H,G)}}if(o){const B=c==="exponential"?{name:"exponential",base:n.base!==void 0?n.base:1}:null;return{kind:"camera",interpolationType:B,interpolationFactor:ui.interpolationFactor.bind(void 0,B),zoomStops:n.stops.map(z=>z[0]),evaluate:({zoom:z})=>v(n,t,z,S,I)}}return{kind:"source",evaluate(B,z){const q=z&&z.properties?z.properties[n.property]:void 0;return q===void 0?to(n.default,t.default):v(n,t,q,S,I)}}}function to(n,t,i){return n!==void 0?n:t!==void 0?t:i!==void 0?i:void 0}function Rh(n,t,i,o,c){return to(typeof i===c?o[i]:void 0,n.default,t.default)}function Bh(n,t,i){if(Rt(i)!=="number")return to(n.default,t.default);const o=n.stops.length;if(o===1||i<=n.stops[0][0])return n.stops[0][1];if(i>=n.stops[o-1][0])return n.stops[o-1][1];const c=Gs(n.stops.map(d=>d[0]),i);return n.stops[c][1]}function Bc(n,t,i){const o=n.base!==void 0?n.base:1;if(Rt(i)!=="number")return to(n.default,t.default);const c=n.stops.length;if(c===1||i<=n.stops[0][0])return n.stops[0][1];if(i>=n.stops[c-1][0])return n.stops[c-1][1];const d=Gs(n.stops.map(B=>B[0]),i),m=function(B,z,q,j){const H=j-q,G=B-q;return H===0?0:z===1?G/H:(Math.pow(z,G)-1)/(Math.pow(z,H)-1)}(i,o,n.stops[d][0],n.stops[d+1][0]),v=n.stops[d][1],S=n.stops[d+1][1],I=sn[t.type]||ea;return typeof v.evaluate=="function"?{evaluate(...B){const z=v.evaluate.apply(void 0,B),q=S.evaluate.apply(void 0,B);if(z!==void 0&&q!==void 0)return I(z,q,m,n.colorSpace)}}:I(v,S,m,n.colorSpace)}function Dh(n,t,i){switch(t.type){case"color":i=Ot.parse(i);break;case"formatted":i=ki.fromString(i.toString());break;case"resolvedImage":i=Mi.fromString(i.toString());break;case"padding":i=ti.parse(i);break;case"colorArray":i=ri.parse(i);break;case"numberArray":i=Ir.parse(i);break;default:Rt(i)===t.type||t.type==="enum"&&t.values[i]||(i=void 0)}return to(i,n.default,t.default)}Ni.register(_s,{error:[{kind:"error"},[gt],(n,[t])=>{throw new ar(t.evaluate(n))}],typeof:[gt,[Pt],(n,[t])=>pr(br(t.evaluate(n)))],"to-rgba":[Ii(qe,4),[vr],(n,[t])=>{const[i,o,c,d]=t.evaluate(n).rgb;return[255*i,255*o,255*c,d]}],rgb:[vr,[qe,qe,qe],Mc],rgba:[vr,[qe,qe,qe,qe],Mc],has:{type:Et,overloads:[[[gt],(n,[t])=>Lc(t.evaluate(n),n.properties())],[[gt,Si],(n,[t,i])=>Lc(t.evaluate(n),i.evaluate(n))]]},get:{type:Pt,overloads:[[[gt],(n,[t])=>nl(t.evaluate(n),n.properties())],[[gt,Si],(n,[t,i])=>nl(t.evaluate(n),i.evaluate(n))]]},"feature-state":[Pt,[gt],(n,[t])=>nl(t.evaluate(n),n.featureState||{})],properties:[Si,[],n=>n.properties()],"geometry-type":[gt,[],n=>n.geometryType()],id:[Pt,[],n=>n.id()],zoom:[qe,[],n=>n.globals.zoom],"heatmap-density":[qe,[],n=>n.globals.heatmapDensity||0],"line-progress":[qe,[],n=>n.globals.lineProgress||0],accumulated:[Pt,[],n=>n.globals.accumulated===void 0?null:n.globals.accumulated],"+":[qe,Qn(qe),(n,t)=>{let i=0;for(const o of t)i+=o.evaluate(n);return i}],"*":[qe,Qn(qe),(n,t)=>{let i=1;for(const o of t)i*=o.evaluate(n);return i}],"-":{type:qe,overloads:[[[qe,qe],(n,[t,i])=>t.evaluate(n)-i.evaluate(n)],[[qe],(n,[t])=>-t.evaluate(n)]]},"/":[qe,[qe,qe],(n,[t,i])=>t.evaluate(n)/i.evaluate(n)],"%":[qe,[qe,qe],(n,[t,i])=>t.evaluate(n)%i.evaluate(n)],ln2:[qe,[],()=>Math.LN2],pi:[qe,[],()=>Math.PI],e:[qe,[],()=>Math.E],"^":[qe,[qe,qe],(n,[t,i])=>Math.pow(t.evaluate(n),i.evaluate(n))],sqrt:[qe,[qe],(n,[t])=>Math.sqrt(t.evaluate(n))],log10:[qe,[qe],(n,[t])=>Math.log(t.evaluate(n))/Math.LN10],ln:[qe,[qe],(n,[t])=>Math.log(t.evaluate(n))],log2:[qe,[qe],(n,[t])=>Math.log(t.evaluate(n))/Math.LN2],sin:[qe,[qe],(n,[t])=>Math.sin(t.evaluate(n))],cos:[qe,[qe],(n,[t])=>Math.cos(t.evaluate(n))],tan:[qe,[qe],(n,[t])=>Math.tan(t.evaluate(n))],asin:[qe,[qe],(n,[t])=>Math.asin(t.evaluate(n))],acos:[qe,[qe],(n,[t])=>Math.acos(t.evaluate(n))],atan:[qe,[qe],(n,[t])=>Math.atan(t.evaluate(n))],min:[qe,Qn(qe),(n,t)=>Math.min(...t.map(i=>i.evaluate(n)))],max:[qe,Qn(qe),(n,t)=>Math.max(...t.map(i=>i.evaluate(n)))],abs:[qe,[qe],(n,[t])=>Math.abs(t.evaluate(n))],round:[qe,[qe],(n,[t])=>{const i=t.evaluate(n);return i<0?-Math.round(-i):Math.round(i)}],floor:[qe,[qe],(n,[t])=>Math.floor(t.evaluate(n))],ceil:[qe,[qe],(n,[t])=>Math.ceil(t.evaluate(n))],"filter-==":[Et,[gt,Pt],(n,[t,i])=>n.properties()[t.value]===i.value],"filter-id-==":[Et,[Pt],(n,[t])=>n.id()===t.value],"filter-type-==":[Et,[gt],(n,[t])=>n.geometryType()===t.value],"filter-<":[Et,[gt,Pt],(n,[t,i])=>{const o=n.properties()[t.value],c=i.value;return typeof o==typeof c&&o<c}],"filter-id-<":[Et,[Pt],(n,[t])=>{const i=n.id(),o=t.value;return typeof i==typeof o&&i<o}],"filter->":[Et,[gt,Pt],(n,[t,i])=>{const o=n.properties()[t.value],c=i.value;return typeof o==typeof c&&o>c}],"filter-id->":[Et,[Pt],(n,[t])=>{const i=n.id(),o=t.value;return typeof i==typeof o&&i>o}],"filter-<=":[Et,[gt,Pt],(n,[t,i])=>{const o=n.properties()[t.value],c=i.value;return typeof o==typeof c&&o<=c}],"filter-id-<=":[Et,[Pt],(n,[t])=>{const i=n.id(),o=t.value;return typeof i==typeof o&&i<=o}],"filter->=":[Et,[gt,Pt],(n,[t,i])=>{const o=n.properties()[t.value],c=i.value;return typeof o==typeof c&&o>=c}],"filter-id->=":[Et,[Pt],(n,[t])=>{const i=n.id(),o=t.value;return typeof i==typeof o&&i>=o}],"filter-has":[Et,[Pt],(n,[t])=>t.value in n.properties()],"filter-has-id":[Et,[],n=>n.id()!==null&&n.id()!==void 0],"filter-type-in":[Et,[Ii(gt)],(n,[t])=>t.value.indexOf(n.geometryType())>=0],"filter-id-in":[Et,[Ii(Pt)],(n,[t])=>t.value.indexOf(n.id())>=0],"filter-in-small":[Et,[gt,Ii(Pt)],(n,[t,i])=>i.value.indexOf(n.properties()[t.value])>=0],"filter-in-large":[Et,[gt,Ii(Pt)],(n,[t,i])=>function(o,c,d,m){for(;d<=m;){const v=d+m>>1;if(c[v]===o)return!0;c[v]>o?m=v-1:d=v+1}return!1}(n.properties()[t.value],i.value,0,i.value.length-1)],all:{type:Et,overloads:[[[Et,Et],(n,[t,i])=>t.evaluate(n)&&i.evaluate(n)],[Qn(Et),(n,t)=>{for(const i of t)if(!i.evaluate(n))return!1;return!0}]]},any:{type:Et,overloads:[[[Et,Et],(n,[t,i])=>t.evaluate(n)||i.evaluate(n)],[Qn(Et),(n,t)=>{for(const i of t)if(i.evaluate(n))return!0;return!1}]]},"!":[Et,[Et],(n,[t])=>!t.evaluate(n)],"is-supported-script":[Et,[gt],(n,[t])=>{const i=n.globals&&n.globals.isSupportedScript;return!i||i(t.evaluate(n))}],upcase:[gt,[gt],(n,[t])=>t.evaluate(n).toUpperCase()],downcase:[gt,[gt],(n,[t])=>t.evaluate(n).toLowerCase()],concat:[gt,Qn(Pt),(n,t)=>t.map(i=>Nt(i.evaluate(n))).join("")],"resolved-locale":[gt,[ls],(n,[t])=>t.evaluate(n).resolvedLocale()]});class ta{constructor(t,i){this.expression=t,this._warningHistory={},this._evaluator=new Ha,this._defaultValue=i?function(o){if(o.type==="color"&&$o(o.default))return new Ot(0,0,0,0);switch(o.type){case"color":return Ot.parse(o.default)||null;case"padding":return ti.parse(o.default)||null;case"numberArray":return Ir.parse(o.default)||null;case"colorArray":return ri.parse(o.default)||null;case"variableAnchorOffsetCollection":return gi.parse(o.default)||null;case"projectionDefinition":return Ai.parse(o.default)||null;default:return o.default===void 0?null:o.default}}(i):null,this._enumValues=i&&i.type==="enum"?i.values:null}evaluateWithoutErrorHandling(t,i,o,c,d,m){return this._evaluator.globals=t,this._evaluator.feature=i,this._evaluator.featureState=o,this._evaluator.canonical=c,this._evaluator.availableImages=d||null,this._evaluator.formattedSection=m,this.expression.evaluate(this._evaluator)}evaluate(t,i,o,c,d,m){this._evaluator.globals=t,this._evaluator.feature=i||null,this._evaluator.featureState=o||null,this._evaluator.canonical=c,this._evaluator.availableImages=d||null,this._evaluator.formattedSection=m||null;try{const v=this.expression.evaluate(this._evaluator);if(v==null||typeof v=="number"&&v!=v)return this._defaultValue;if(this._enumValues&&!(v in this._enumValues))throw new ar(`Expected value to be one of ${Object.keys(this._enumValues).map(S=>JSON.stringify(S)).join(", ")}, but found ${JSON.stringify(v)} instead.`);return v}catch(v){return this._warningHistory[v.message]||(this._warningHistory[v.message]=!0,typeof console<"u"&&console.warn(v.message)),this._defaultValue}}}function ro(n){return Array.isArray(n)&&n.length>0&&typeof n[0]=="string"&&n[0]in _s}function ra(n,t){const i=new Hs(_s,Go,[],t?function(c){const d={color:vr,string:gt,number:qe,enum:gt,boolean:Et,formatted:zs,padding:Fn,numberArray:hn,colorArray:Fs,projectionDefinition:xr,resolvedImage:On,variableAnchorOffsetCollection:Pr};return c.type==="array"?Ii(d[c.value]||Pt,c.length):d[c.type]}(t):void 0),o=i.parse(n,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return o?Qo(new ta(o,t)):vs(i.errors)}class ol{constructor(t,i){this.kind=t,this._styleExpression=i,this.isStateDependent=t!=="constant"&&!eo(i.expression)}evaluateWithoutErrorHandling(t,i,o,c,d,m){return this._styleExpression.evaluateWithoutErrorHandling(t,i,o,c,d,m)}evaluate(t,i,o,c,d,m){return this._styleExpression.evaluate(t,i,o,c,d,m)}}class ia{constructor(t,i,o,c){this.kind=t,this.zoomStops=o,this._styleExpression=i,this.isStateDependent=t!=="camera"&&!eo(i.expression),this.interpolationType=c}evaluateWithoutErrorHandling(t,i,o,c,d,m){return this._styleExpression.evaluateWithoutErrorHandling(t,i,o,c,d,m)}evaluate(t,i,o,c,d,m){return this._styleExpression.evaluate(t,i,o,c,d,m)}interpolationFactor(t,i,o){return this.interpolationType?ui.interpolationFactor(this.interpolationType,t,i,o):0}}function al(n,t){const i=ra(n,t);if(i.result==="error")return i;const o=i.value.expression,c=Jo(o);if(!c&&!xs(t))return vs([new Ft("","data expressions not supported")]);const d=Xo(o,["zoom"]);if(!d&&!Rc(t))return vs([new Ft("","zoom expressions not supported")]);const m=no(o);return m||d?m instanceof Ft?vs([m]):m instanceof ui&&!Yo(t)?vs([new Ft("",'"interpolate" expressions cannot be used with this property')]):Qo(m?new ia(c?"camera":"composite",i.value,m.labels,m instanceof ui?m.interpolation:void 0):new ol(c?"constant":"source",i.value)):vs([new Ft("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class io{constructor(t,i){this._parameters=t,this._specification=i,Kt(this,sl(this._parameters,this._specification))}static deserialize(t){return new io(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function no(n){let t=null;if(n instanceof ms)t=no(n.result);else if(n instanceof Zn){for(const i of n.args)if(t=no(i),t)break}else(n instanceof An||n instanceof ui)&&n.input instanceof Ni&&n.input.name==="zoom"&&(t=n);return t instanceof Ft||n.eachChild(i=>{const o=no(i);o instanceof Ft?t=o:!t&&o?t=new Ft("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&o&&t!==o&&(t=new Ft("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}function so(n){if(n===!0||n===!1)return!0;if(!Array.isArray(n)||n.length===0)return!1;switch(n[0]){case"has":return n.length>=2&&n[1]!=="$id"&&n[1]!=="$type";case"in":return n.length>=3&&(typeof n[1]!="string"||Array.isArray(n[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return n.length!==3||Array.isArray(n[1])||Array.isArray(n[2]);case"any":case"all":for(const t of n.slice(1))if(!so(t)&&typeof t!="boolean")return!1;return!0;default:return!0}}const ll={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function oo(n){if(n==null)return{filter:()=>!0,needGeometry:!1};so(n)||(n=sa(n));const t=ra(n,ll);if(t.result==="error")throw new Error(t.value.map(i=>`${i.key}: ${i.message}`).join(", "));return{filter:(i,o,c)=>t.value.evaluate(i,o,{},c),needGeometry:Dc(n)}}function na(n,t){return n<t?-1:n>t?1:0}function Dc(n){if(!Array.isArray(n))return!1;if(n[0]==="within"||n[0]==="distance")return!0;for(let t=1;t<n.length;t++)if(Dc(n[t]))return!0;return!1}function sa(n){if(!n)return!0;const t=n[0];return n.length<=1?t!=="any":t==="=="?cl(n[1],n[2],"=="):t==="!="?oa(cl(n[1],n[2],"==")):t==="<"||t===">"||t==="<="||t===">="?cl(n[1],n[2],t):t==="any"?(i=n.slice(1),["any"].concat(i.map(sa))):t==="all"?["all"].concat(n.slice(1).map(sa)):t==="none"?["all"].concat(n.slice(1).map(sa).map(oa)):t==="in"?Vc(n[1],n.slice(2)):t==="!in"?oa(Vc(n[1],n.slice(2))):t==="has"?zc(n[1]):t!=="!has"||oa(zc(n[1]));var i}function cl(n,t,i){switch(n){case"$type":return[`filter-type-${i}`,t];case"$id":return[`filter-id-${i}`,t];default:return[`filter-${i}`,n,t]}}function Vc(n,t){if(t.length===0)return!1;switch(n){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(i=>typeof i!=typeof t[0])?["filter-in-large",n,["literal",t.sort(na)]]:["filter-in-small",n,["literal",t]]}}function zc(n){switch(n){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",n]}}function oa(n){return["!",n]}function aa(n){const t=typeof n;if(t==="number"||t==="boolean"||t==="string"||n==null)return JSON.stringify(n);if(Array.isArray(n)){let c="[";for(const d of n)c+=`${aa(d)},`;return`${c}]`}const i=Object.keys(n).sort();let o="{";for(let c=0;c<i.length;c++)o+=`${JSON.stringify(i[c])}:${aa(n[i[c]])},`;return`${o}}`}function Fc(n){let t="";for(const i of Pe)t+=`/${aa(n[i])}`;return t}function ao(n){const t=n.value;return t?[new Ve(n.key,t,"constants have been deprecated as of v8")]:[]}function Tr(n){return n instanceof Number||n instanceof String||n instanceof Boolean?n.valueOf():n}function Tn(n){if(Array.isArray(n))return n.map(Tn);if(n instanceof Object&&!(n instanceof Number||n instanceof String||n instanceof Boolean)){const t={};for(const i in n)t[i]=Tn(n[i]);return t}return Tr(n)}function Li(n){const t=n.key,i=n.value,o=n.valueSpec||{},c=n.objectElementValidators||{},d=n.style,m=n.styleSpec,v=n.validateSpec;let S=[];const I=Rt(i);if(I!=="object")return[new Ve(t,i,`object expected, ${I} found`)];for(const B in i){const z=B.split(".")[0],q=Ns(o,z)||o["*"];let j;if(Ns(c,z))j=c[z];else if(Ns(o,z))j=v;else if(c["*"])j=c["*"];else{if(!o["*"]){S.push(new Ve(t,i[B],`unknown property "${B}"`));continue}j=v}S=S.concat(j({key:(t&&`${t}.`)+B,value:i[B],valueSpec:q,style:d,styleSpec:m,object:i,objectKey:B,validateSpec:v},i))}for(const B in o)c[B]||o[B].required&&o[B].default===void 0&&i[B]===void 0&&S.push(new Ve(t,i,`missing required property "${B}"`));return S}function ul(n){const t=n.value,i=n.valueSpec,o=n.style,c=n.styleSpec,d=n.key,m=n.arrayElementValidator||n.validateSpec;if(Rt(t)!=="array")return[new Ve(d,t,`array expected, ${Rt(t)} found`)];if(i.length&&t.length!==i.length)return[new Ve(d,t,`array length ${i.length} expected, length ${t.length} found`)];if(i["min-length"]&&t.length<i["min-length"])return[new Ve(d,t,`array length at least ${i["min-length"]} expected, length ${t.length} found`)];let v={type:i.value,values:i.values};c.$version<7&&(v.function=i.function),Rt(i.value)==="object"&&(v=i.value);let S=[];for(let I=0;I<t.length;I++)S=S.concat(m({array:t,arrayIndex:I,value:t[I],valueSpec:v,validateSpec:n.validateSpec,style:o,styleSpec:c,key:`${d}[${I}]`}));return S}function lo(n){const t=n.key,i=n.value,o=n.valueSpec;let c=Rt(i);return c==="number"&&i!=i&&(c="NaN"),c!=="number"?[new Ve(t,i,`number expected, ${c} found`)]:"minimum"in o&&i<o.minimum?[new Ve(t,i,`${i} is less than the minimum value ${o.minimum}`)]:"maximum"in o&&i>o.maximum?[new Ve(t,i,`${i} is greater than the maximum value ${o.maximum}`)]:[]}function hl(n){const t=n.valueSpec,i=Tr(n.value.type);let o,c,d,m={};const v=i!=="categorical"&&n.value.property===void 0,S=!v,I=Rt(n.value.stops)==="array"&&Rt(n.value.stops[0])==="array"&&Rt(n.value.stops[0][0])==="object",B=Li({key:n.key,value:n.value,valueSpec:n.styleSpec.function,validateSpec:n.validateSpec,style:n.style,styleSpec:n.styleSpec,objectElementValidators:{stops:function(j){if(i==="identity")return[new Ve(j.key,j.value,'identity function may not have a "stops" property')];let H=[];const G=j.value;return H=H.concat(ul({key:j.key,value:G,valueSpec:j.valueSpec,validateSpec:j.validateSpec,style:j.style,styleSpec:j.styleSpec,arrayElementValidator:z})),Rt(G)==="array"&&G.length===0&&H.push(new Ve(j.key,G,"array must have at least one stop")),H},default:function(j){return j.validateSpec({key:j.key,value:j.value,valueSpec:t,validateSpec:j.validateSpec,style:j.style,styleSpec:j.styleSpec})}}});return i==="identity"&&v&&B.push(new Ve(n.key,n.value,'missing required property "property"')),i==="identity"||n.value.stops||B.push(new Ve(n.key,n.value,'missing required property "stops"')),i==="exponential"&&n.valueSpec.expression&&!Yo(n.valueSpec)&&B.push(new Ve(n.key,n.value,"exponential functions not supported")),n.styleSpec.$version>=8&&(S&&!xs(n.valueSpec)?B.push(new Ve(n.key,n.value,"property functions not supported")):v&&!Rc(n.valueSpec)&&B.push(new Ve(n.key,n.value,"zoom functions not supported"))),i!=="categorical"&&!I||n.value.property!==void 0||B.push(new Ve(n.key,n.value,'"property" property is required')),B;function z(j){let H=[];const G=j.value,ee=j.key;if(Rt(G)!=="array")return[new Ve(ee,G,`array expected, ${Rt(G)} found`)];if(G.length!==2)return[new Ve(ee,G,`array length 2 expected, length ${G.length} found`)];if(I){if(Rt(G[0])!=="object")return[new Ve(ee,G,`object expected, ${Rt(G[0])} found`)];if(G[0].zoom===void 0)return[new Ve(ee,G,"object stop key must have zoom")];if(G[0].value===void 0)return[new Ve(ee,G,"object stop key must have value")];if(d&&d>Tr(G[0].zoom))return[new Ve(ee,G[0].zoom,"stop zoom values must appear in ascending order")];Tr(G[0].zoom)!==d&&(d=Tr(G[0].zoom),c=void 0,m={}),H=H.concat(Li({key:`${ee}[0]`,value:G[0],valueSpec:{zoom:{}},validateSpec:j.validateSpec,style:j.style,styleSpec:j.styleSpec,objectElementValidators:{zoom:lo,value:q}}))}else H=H.concat(q({key:`${ee}[0]`,value:G[0],validateSpec:j.validateSpec,style:j.style,styleSpec:j.styleSpec},G));return ro(Tn(G[1]))?H.concat([new Ve(`${ee}[1]`,G[1],"expressions are not allowed in function stops.")]):H.concat(j.validateSpec({key:`${ee}[1]`,value:G[1],valueSpec:t,validateSpec:j.validateSpec,style:j.style,styleSpec:j.styleSpec}))}function q(j,H){const G=Rt(j.value),ee=Tr(j.value),le=j.value!==null?j.value:H;if(o){if(G!==o)return[new Ve(j.key,le,`${G} stop domain type must match previous stop domain type ${o}`)]}else o=G;if(G!=="number"&&G!=="string"&&G!=="boolean")return[new Ve(j.key,le,"stop domain value must be a number, string, or boolean")];if(G!=="number"&&i!=="categorical"){let ve=`number expected, ${G} found`;return xs(t)&&i===void 0&&(ve+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ve(j.key,le,ve)]}return i!=="categorical"||G!=="number"||isFinite(ee)&&Math.floor(ee)===ee?i!=="categorical"&&G==="number"&&c!==void 0&&ee<c?[new Ve(j.key,le,"stop domain values must appear in ascending order")]:(c=ee,i==="categorical"&&ee in m?[new Ve(j.key,le,"stop domain values must be unique")]:(m[ee]=!0,[])):[new Ve(j.key,le,`integer expected, found ${ee}`)]}}function an(n){const t=(n.expressionContext==="property"?al:ra)(Tn(n.value),n.valueSpec);if(t.result==="error")return t.value.map(o=>new Ve(`${n.key}${o.key}`,n.value,o.message));const i=t.value.expression||t.value._styleExpression.expression;if(n.expressionContext==="property"&&n.propertyKey==="text-font"&&!i.outputDefined())return[new Ve(n.key,n.value,`Invalid data expression for "${n.propertyKey}". Output values must be contained as literals within the expression.`)];if(n.expressionContext==="property"&&n.propertyType==="layout"&&!eo(i))return[new Ve(n.key,n.value,'"feature-state" data expressions are not supported with layout properties.')];if(n.expressionContext==="filter"&&!eo(i))return[new Ve(n.key,n.value,'"feature-state" data expressions are not supported with filters.')];if(n.expressionContext&&n.expressionContext.indexOf("cluster")===0){if(!Xo(i,["zoom","feature-state"]))return[new Ve(n.key,n.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(n.expressionContext==="cluster-initial"&&!Jo(i))return[new Ve(n.key,n.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function pl(n){const t=n.key,i=n.value,o=Rt(i);return o!=="string"?[new Ve(t,i,`color expected, ${o} found`)]:Ot.parse(String(i))?[]:[new Ve(t,i,`color expected, "${i}" found`)]}function co(n){const t=n.key,i=n.value,o=n.valueSpec,c=[];return Array.isArray(o.values)?o.values.indexOf(Tr(i))===-1&&c.push(new Ve(t,i,`expected one of [${o.values.join(", ")}], ${JSON.stringify(i)} found`)):Object.keys(o.values).indexOf(Tr(i))===-1&&c.push(new Ve(t,i,`expected one of [${Object.keys(o.values).join(", ")}], ${JSON.stringify(i)} found`)),c}function dl(n){return so(Tn(n.value))?an(Kt({},n,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Oc(n)}function Oc(n){const t=n.value,i=n.key;if(Rt(t)!=="array")return[new Ve(i,t,`array expected, ${Rt(t)} found`)];const o=n.styleSpec;let c,d=[];if(t.length<1)return[new Ve(i,t,"filter array must have at least 1 element")];switch(d=d.concat(co({key:`${i}[0]`,value:t[0],valueSpec:o.filter_operator,style:n.style,styleSpec:n.styleSpec})),Tr(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&Tr(t[1])==="$type"&&d.push(new Ve(i,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":t.length!==3&&d.push(new Ve(i,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(c=Rt(t[1]),c!=="string"&&d.push(new Ve(`${i}[1]`,t[1],`string expected, ${c} found`)));for(let m=2;m<t.length;m++)c=Rt(t[m]),Tr(t[1])==="$type"?d=d.concat(co({key:`${i}[${m}]`,value:t[m],valueSpec:o.geometry_type,style:n.style,styleSpec:n.styleSpec})):c!=="string"&&c!=="number"&&c!=="boolean"&&d.push(new Ve(`${i}[${m}]`,t[m],`string, number, or boolean expected, ${c} found`));break;case"any":case"all":case"none":for(let m=1;m<t.length;m++)d=d.concat(Oc({key:`${i}[${m}]`,value:t[m],style:n.style,styleSpec:n.styleSpec}));break;case"has":case"!has":c=Rt(t[1]),t.length!==2?d.push(new Ve(i,t,`filter array for "${t[0]}" operator must have 2 elements`)):c!=="string"&&d.push(new Ve(`${i}[1]`,t[1],`string expected, ${c} found`))}return d}function Nc(n,t){const i=n.key,o=n.validateSpec,c=n.style,d=n.styleSpec,m=n.value,v=n.objectKey,S=d[`${t}_${n.layerType}`];if(!S)return[];const I=v.match(/^(.*)-transition$/);if(t==="paint"&&I&&S[I[1]]&&S[I[1]].transition)return o({key:i,value:m,valueSpec:d.transition,style:c,styleSpec:d});const B=n.valueSpec||S[v];if(!B)return[new Ve(i,m,`unknown property "${v}"`)];let z;if(Rt(m)==="string"&&xs(B)&&!B.tokens&&(z=/^{([^}]+)}$/.exec(m)))return[new Ve(i,m,`"${v}" does not support interpolation syntax
65
- Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(z[1])} }\`.`)];const q=[];return n.layerType==="symbol"&&(v==="text-field"&&c&&!c.glyphs&&q.push(new Ve(i,m,'use of "text-field" requires a style "glyphs" property')),v==="text-font"&&$o(Tn(m))&&Tr(m.type)==="identity"&&q.push(new Ve(i,m,'"text-font" does not support identity functions'))),q.concat(o({key:n.key,value:m,valueSpec:B,style:c,styleSpec:d,expressionContext:"property",propertyType:t,propertyKey:v}))}function qc(n){return Nc(n,"paint")}function bs(n){return Nc(n,"layout")}function ws(n){let t=[];const i=n.value,o=n.key,c=n.style,d=n.styleSpec;if(Rt(i)!=="object")return[new Ve(o,i,`object expected, ${Rt(i)} found`)];i.type||i.ref||t.push(new Ve(o,i,'either "type" or "ref" is required'));let m=Tr(i.type);const v=Tr(i.ref);if(i.id){const S=Tr(i.id);for(let I=0;I<n.arrayIndex;I++){const B=c.layers[I];Tr(B.id)===S&&t.push(new Ve(o,i.id,`duplicate layer id "${i.id}", previously used at line ${B.id.__line__}`))}}if("ref"in i){let S;["type","source","source-layer","filter","layout"].forEach(I=>{I in i&&t.push(new Ve(o,i[I],`"${I}" is prohibited for ref layers`))}),c.layers.forEach(I=>{Tr(I.id)===v&&(S=I)}),S?S.ref?t.push(new Ve(o,i.ref,"ref cannot reference another ref layer")):m=Tr(S.type):t.push(new Ve(o,i.ref,`ref layer "${v}" not found`))}else if(m!=="background")if(i.source){const S=c.sources&&c.sources[i.source],I=S&&Tr(S.type);S?I==="vector"&&m==="raster"?t.push(new Ve(o,i.source,`layer "${i.id}" requires a raster source`)):I!=="raster-dem"&&m==="hillshade"?t.push(new Ve(o,i.source,`layer "${i.id}" requires a raster-dem source`)):I==="raster"&&m!=="raster"?t.push(new Ve(o,i.source,`layer "${i.id}" requires a vector source`)):I!=="vector"||i["source-layer"]?I==="raster-dem"&&m!=="hillshade"?t.push(new Ve(o,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):m!=="line"||!i.paint||!i.paint["line-gradient"]||I==="geojson"&&S.lineMetrics||t.push(new Ve(o,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new Ve(o,i,`layer "${i.id}" must specify a "source-layer"`)):t.push(new Ve(o,i.source,`source "${i.source}" not found`))}else t.push(new Ve(o,i,'missing required property "source"'));return t=t.concat(Li({key:o,value:i,valueSpec:d.layer,style:n.style,styleSpec:n.styleSpec,validateSpec:n.validateSpec,objectElementValidators:{"*":()=>[],type:()=>n.validateSpec({key:`${o}.type`,value:i.type,valueSpec:d.layer.type,style:n.style,styleSpec:n.styleSpec,validateSpec:n.validateSpec,object:i,objectKey:"type"}),filter:dl,layout:S=>Li({layer:i,key:S.key,value:S.value,style:S.style,styleSpec:S.styleSpec,validateSpec:S.validateSpec,objectElementValidators:{"*":I=>bs(Kt({layerType:m},I))}}),paint:S=>Li({layer:i,key:S.key,value:S.value,style:S.style,styleSpec:S.styleSpec,validateSpec:S.validateSpec,objectElementValidators:{"*":I=>qc(Kt({layerType:m},I))}})}})),t}function Ur(n){const t=n.value,i=n.key,o=Rt(t);return o!=="string"?[new Ve(i,t,`string expected, ${o} found`)]:[]}const Ss={promoteId:function({key:n,value:t}){if(Rt(t)==="string")return Ur({key:n,value:t});{const i=[];for(const o in t)i.push(...Ur({key:`${n}.${o}`,value:t[o]}));return i}}};function fl(n){const t=n.value,i=n.key,o=n.styleSpec,c=n.style,d=n.validateSpec;if(!t.type)return[new Ve(i,t,'"type" is required')];const m=Tr(t.type);let v;switch(m){case"vector":case"raster":return v=Li({key:i,value:t,valueSpec:o[`source_${m.replace("-","_")}`],style:n.style,styleSpec:o,objectElementValidators:Ss,validateSpec:d}),v;case"raster-dem":return v=function(S){var I;const B=(I=S.sourceName)!==null&&I!==void 0?I:"",z=S.value,q=S.styleSpec,j=q.source_raster_dem,H=S.style;let G=[];const ee=Rt(z);if(z===void 0)return G;if(ee!=="object")return G.push(new Ve("source_raster_dem",z,`object expected, ${ee} found`)),G;const le=Tr(z.encoding)==="custom",ve=["redFactor","greenFactor","blueFactor","baseShift"],he=S.value.encoding?`"${S.value.encoding}"`:"Default";for(const U in z)!le&&ve.includes(U)?G.push(new Ve(U,z[U],`In "${B}": "${U}" is only valid when "encoding" is set to "custom". ${he} encoding found`)):j[U]?G=G.concat(S.validateSpec({key:U,value:z[U],valueSpec:j[U],validateSpec:S.validateSpec,style:H,styleSpec:q})):G.push(new Ve(U,z[U],`unknown property "${U}"`));return G}({sourceName:i,value:t,style:n.style,styleSpec:o,validateSpec:d}),v;case"geojson":if(v=Li({key:i,value:t,valueSpec:o.source_geojson,style:c,styleSpec:o,validateSpec:d,objectElementValidators:Ss}),t.cluster)for(const S in t.clusterProperties){const[I,B]=t.clusterProperties[S],z=typeof I=="string"?[I,["accumulated"],["get",S]]:I;v.push(...an({key:`${i}.${S}.map`,value:B,expressionContext:"cluster-map"})),v.push(...an({key:`${i}.${S}.reduce`,value:z,expressionContext:"cluster-reduce"}))}return v;case"video":return Li({key:i,value:t,valueSpec:o.source_video,style:c,validateSpec:d,styleSpec:o});case"image":return Li({key:i,value:t,valueSpec:o.source_image,style:c,validateSpec:d,styleSpec:o});case"canvas":return[new Ve(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return co({key:`${i}.type`,value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function Uc(n){const t=n.value,i=n.styleSpec,o=i.light,c=n.style;let d=[];const m=Rt(t);if(t===void 0)return d;if(m!=="object")return d=d.concat([new Ve("light",t,`object expected, ${m} found`)]),d;for(const v in t){const S=v.match(/^(.*)-transition$/);d=d.concat(S&&o[S[1]]&&o[S[1]].transition?n.validateSpec({key:v,value:t[v],valueSpec:i.transition,validateSpec:n.validateSpec,style:c,styleSpec:i}):o[v]?n.validateSpec({key:v,value:t[v],valueSpec:o[v],validateSpec:n.validateSpec,style:c,styleSpec:i}):[new Ve(v,t[v],`unknown property "${v}"`)])}return d}function jc(n){const t=n.value,i=n.styleSpec,o=i.sky,c=n.style,d=Rt(t);if(t===void 0)return[];if(d!=="object")return[new Ve("sky",t,`object expected, ${d} found`)];let m=[];for(const v in t)m=m.concat(o[v]?n.validateSpec({key:v,value:t[v],valueSpec:o[v],style:c,styleSpec:i}):[new Ve(v,t[v],`unknown property "${v}"`)]);return m}function ks(n){const t=n.value,i=n.styleSpec,o=i.terrain,c=n.style;let d=[];const m=Rt(t);if(t===void 0)return d;if(m!=="object")return d=d.concat([new Ve("terrain",t,`object expected, ${m} found`)]),d;for(const v in t)d=d.concat(o[v]?n.validateSpec({key:v,value:t[v],valueSpec:o[v],validateSpec:n.validateSpec,style:c,styleSpec:i}):[new Ve(v,t[v],`unknown property "${v}"`)]);return d}function ml(n){let t=[];const i=n.value,o=n.key;if(Array.isArray(i)){const c=[],d=[];for(const m in i)i[m].id&&c.includes(i[m].id)&&t.push(new Ve(o,i,`all the sprites' ids must be unique, but ${i[m].id} is duplicated`)),c.push(i[m].id),i[m].url&&d.includes(i[m].url)&&t.push(new Ve(o,i,`all the sprites' URLs must be unique, but ${i[m].url} is duplicated`)),d.push(i[m].url),t=t.concat(Li({key:`${o}[${m}]`,value:i[m],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:n.validateSpec}));return t}return Ur({key:o,value:i})}function la(n){return t=n.value,t&&t.constructor===Object?[]:[new Ve(n.key,n.value,`object expected, ${Rt(n.value)} found`)];var t}const Wc={"*":()=>[],array:ul,boolean:function(n){const t=n.value,i=n.key,o=Rt(t);return o!=="boolean"?[new Ve(i,t,`boolean expected, ${o} found`)]:[]},number:lo,color:pl,constants:ao,enum:co,filter:dl,function:hl,layer:ws,object:Li,source:fl,light:Uc,sky:jc,terrain:ks,projection:function(n){const t=n.value,i=n.styleSpec,o=i.projection,c=n.style,d=Rt(t);if(t===void 0)return[];if(d!=="object")return[new Ve("projection",t,`object expected, ${d} found`)];let m=[];for(const v in t)m=m.concat(o[v]?n.validateSpec({key:v,value:t[v],valueSpec:o[v],style:c,styleSpec:i}):[new Ve(v,t[v],`unknown property "${v}"`)]);return m},projectionDefinition:function(n){const t=n.key;let i=n.value;i=i instanceof String?i.valueOf():i;const o=Rt(i);return o!=="array"||function(c){return Array.isArray(c)&&c.length===3&&typeof c[0]=="string"&&typeof c[1]=="string"&&typeof c[2]=="number"}(i)||function(c){return!!["interpolate","step","literal"].includes(c[0])}(i)?["array","string"].includes(o)?[]:[new Ve(t,i,`projection expected, invalid type "${o}" found`)]:[new Ve(t,i,`projection expected, invalid array ${JSON.stringify(i)} found`)]},string:Ur,formatted:function(n){return Ur(n).length===0?[]:an(n)},resolvedImage:function(n){return Ur(n).length===0?[]:an(n)},padding:function(n){const t=n.key,i=n.value;if(Rt(i)==="array"){if(i.length<1||i.length>4)return[new Ve(t,i,`padding requires 1 to 4 values; ${i.length} values found`)];const o={type:"number"};let c=[];for(let d=0;d<i.length;d++)c=c.concat(n.validateSpec({key:`${t}[${d}]`,value:i[d],validateSpec:n.validateSpec,valueSpec:o}));return c}return lo({key:t,value:i,valueSpec:{}})},numberArray:function(n){const t=n.key,i=n.value;if(Rt(i)==="array"){const o={type:"number"};if(i.length<1)return[new Ve(t,i,"array length at least 1 expected, length 0 found")];let c=[];for(let d=0;d<i.length;d++)c=c.concat(n.validateSpec({key:`${t}[${d}]`,value:i[d],validateSpec:n.validateSpec,valueSpec:o}));return c}return lo({key:t,value:i,valueSpec:{}})},colorArray:function(n){const t=n.key,i=n.value;if(Rt(i)==="array"){if(i.length<1)return[new Ve(t,i,"array length at least 1 expected, length 0 found")];let o=[];for(let c=0;c<i.length;c++)o=o.concat(pl({key:`${t}[${c}]`,value:i[c]}));return o}return pl({key:t,value:i})},variableAnchorOffsetCollection:function(n){const t=n.key,i=n.value,o=Rt(i),c=n.styleSpec;if(o!=="array"||i.length<1||i.length%2!=0)return[new Ve(t,i,"variableAnchorOffsetCollection requires a non-empty array of even length")];let d=[];for(let m=0;m<i.length;m+=2)d=d.concat(co({key:`${t}[${m}]`,value:i[m],valueSpec:c.layout_symbol["text-anchor"]})),d=d.concat(ul({key:`${t}[${m+1}]`,value:i[m+1],valueSpec:{length:2,value:"number"},validateSpec:n.validateSpec,style:n.style,styleSpec:c}));return d},sprite:ml,state:la};function As(n){const t=n.value,i=n.valueSpec,o=n.styleSpec;return n.validateSpec=As,i.expression&&$o(Tr(t))?hl(n):i.expression&&ro(Tn(t))?an(n):i.type&&Wc[i.type]?Wc[i.type](n):Li(Kt({},n,{valueSpec:i.type?o[i.type]:i}))}function Hc(n){const t=n.value,i=n.key,o=Ur(n);return o.length||(t.indexOf("{fontstack}")===-1&&o.push(new Ve(i,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&o.push(new Ve(i,t,'"glyphs" url must include a "{range}" token'))),o}function hi(n,t=te){let i=[];return i=i.concat(As({key:"",value:n,valueSpec:t.$root,styleSpec:t,style:n,validateSpec:As,objectElementValidators:{glyphs:Hc,"*":()=>[]}})),n.constants&&(i=i.concat(ao({key:"constants",value:n.constants}))),Cs(i)}function Gi(n){return function(t){return n({...t,validateSpec:As})}}function Cs(n){return[].concat(n).sort((t,i)=>t.line-i.line)}function Ji(n){return function(...t){return Cs(n.apply(this,t))}}hi.source=Ji(Gi(fl)),hi.sprite=Ji(Gi(ml)),hi.glyphs=Ji(Gi(Hc)),hi.light=Ji(Gi(Uc)),hi.sky=Ji(Gi(jc)),hi.terrain=Ji(Gi(ks)),hi.state=Ji(Gi(la)),hi.layer=Ji(Gi(ws)),hi.filter=Ji(Gi(dl)),hi.paintProperty=Ji(Gi(qc)),hi.layoutProperty=Ji(Gi(bs));const Ts=hi,ca=Ts.light,Vh=Ts.sky,gl=Ts.paintProperty,ua=Ts.layoutProperty;function yl(n,t){let i=!1;if(t&&t.length)for(const o of t)n.fire(new ce(new Error(o.message))),i=!0;return i}class Es{constructor(t,i,o){const c=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;const m=new Int32Array(this.arrayBuffer);t=m[0],this.d=(i=m[1])+2*(o=m[2]);for(let S=0;S<this.d*this.d;S++){const I=m[3+S],B=m[3+S+1];c.push(I===B?null:m.subarray(I,B))}const v=m[3+c.length+1];this.keys=m.subarray(m[3+c.length],v),this.bboxes=m.subarray(v),this.insert=this._insertReadonly}else{this.d=i+2*o;for(let m=0;m<this.d*this.d;m++)c.push([]);this.keys=[],this.bboxes=[]}this.n=i,this.extent=t,this.padding=o,this.scale=i/t,this.uid=0;const d=o/i*t;this.min=-d,this.max=t+d}insert(t,i,o,c,d){this._forEachCell(i,o,c,d,this._insertCell,this.uid++,void 0,void 0),this.keys.push(t),this.bboxes.push(i),this.bboxes.push(o),this.bboxes.push(c),this.bboxes.push(d)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(t,i,o,c,d,m){this.cells[d].push(m)}query(t,i,o,c,d){const m=this.min,v=this.max;if(t<=m&&i<=m&&v<=o&&v<=c&&!d)return Array.prototype.slice.call(this.keys);{const S=[];return this._forEachCell(t,i,o,c,this._queryCell,S,{},d),S}}_queryCell(t,i,o,c,d,m,v,S){const I=this.cells[d];if(I!==null){const B=this.keys,z=this.bboxes;for(let q=0;q<I.length;q++){const j=I[q];if(v[j]===void 0){const H=4*j;(S?S(z[H+0],z[H+1],z[H+2],z[H+3]):t<=z[H+2]&&i<=z[H+3]&&o>=z[H+0]&&c>=z[H+1])?(v[j]=!0,m.push(B[j])):v[j]=!1}}}}_forEachCell(t,i,o,c,d,m,v,S){const I=this._convertToCellCoord(t),B=this._convertToCellCoord(i),z=this._convertToCellCoord(o),q=this._convertToCellCoord(c);for(let j=I;j<=z;j++)for(let H=B;H<=q;H++){const G=this.d*H+j;if((!S||S(this._convertFromCellCoord(j),this._convertFromCellCoord(H),this._convertFromCellCoord(j+1),this._convertFromCellCoord(H+1)))&&d.call(this,t,i,o,c,G,m,v,S))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;const t=this.cells,i=3+this.cells.length+1+1;let o=0;for(let m=0;m<this.cells.length;m++)o+=this.cells[m].length;const c=new Int32Array(i+o+this.keys.length+this.bboxes.length);c[0]=this.extent,c[1]=this.n,c[2]=this.padding;let d=i;for(let m=0;m<t.length;m++){const v=t[m];c[3+m]=d,c.set(v,d),d+=v.length}return c[3+t.length]=d,c.set(this.keys,d),d+=this.keys.length,c[3+t.length+1]=d,c.set(this.bboxes,d),d+=this.bboxes.length,c.buffer}static serialize(t,i){const o=t.toArrayBuffer();return i&&i.push(o),{buffer:o}}static deserialize(t){return new Es(t.buffer)}}const ln={};function nt(n,t,i={}){if(ln[n])throw new Error(`${n} is already registered.`);Object.defineProperty(t,"_classRegistryKey",{value:n,writeable:!1}),ln[n]={klass:t,omit:i.omit||[],shallow:i.shallow||[]}}nt("Object",Object),nt("TransferableGridIndex",Es),nt("Color",Ot),nt("Error",Error),nt("AJAXError",Dr),nt("ResolvedImage",Mi),nt("StylePropertyFunction",io),nt("StyleExpression",ta,{omit:["_evaluator"]}),nt("ZoomDependentExpression",ia),nt("ZoomConstantExpression",ol),nt("CompoundExpression",Ni,{omit:["_evaluate"]});for(const n in _s)_s[n]._classRegistryKey||nt(`Expression_${n}`,_s[n]);function ha(n){return n&&typeof ArrayBuffer<"u"&&(n instanceof ArrayBuffer||n.constructor&&n.constructor.name==="ArrayBuffer")}function pa(n){return n.$name||n.constructor._classRegistryKey}function Zc(n){return!function(t){if(t===null||typeof t!="object")return!1;const i=pa(t);return!(!i||i==="Object")}(n)&&(n==null||typeof n=="boolean"||typeof n=="number"||typeof n=="string"||n instanceof Boolean||n instanceof Number||n instanceof String||n instanceof Date||n instanceof RegExp||n instanceof Blob||n instanceof Error||ha(n)||Yt(n)||ArrayBuffer.isView(n)||n instanceof ImageData)}function Ps(n,t){if(Zc(n))return(ha(n)||Yt(n))&&t&&t.push(n),ArrayBuffer.isView(n)&&t&&t.push(n.buffer),n instanceof ImageData&&t&&t.push(n.data.buffer),n;if(Array.isArray(n)){const d=[];for(const m of n)d.push(Ps(m,t));return d}if(typeof n!="object")throw new Error("can't serialize object of type "+typeof n);const i=pa(n);if(!i)throw new Error(`can't serialize object of unregistered class ${n.constructor.name}`);if(!ln[i])throw new Error(`${i} is not registered.`);const{klass:o}=ln[i],c=o.serialize?o.serialize(n,t):{};if(o.serialize){if(t&&c===t[t.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const d in n){if(!n.hasOwnProperty(d)||ln[i].omit.indexOf(d)>=0)continue;const m=n[d];c[d]=ln[i].shallow.indexOf(d)>=0?m:Ps(m,t)}n instanceof Error&&(c.message=n.message)}if(c.$name)throw new Error("$name property is reserved for worker serialization logic.");return i!=="Object"&&(c.$name=i),c}function uo(n){if(Zc(n))return n;if(Array.isArray(n))return n.map(uo);if(typeof n!="object")throw new Error("can't deserialize object of type "+typeof n);const t=pa(n)||"Object";if(!ln[t])throw new Error(`can't deserialize unregistered class ${t}`);const{klass:i}=ln[t];if(!i)throw new Error(`can't deserialize unregistered class ${t}`);if(i.deserialize)return i.deserialize(n);const o=Object.create(i.prototype);for(const c of Object.keys(n)){if(c==="$name")continue;const d=n[c];o[c]=ln[t].shallow.indexOf(c)>=0?d:uo(d)}return o}class _l{constructor(){this.first=!0}update(t,i){const o=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=o,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=o,!0):(this.lastFloorZoom>o?(this.lastIntegerZoom=o+1,this.lastIntegerZoomTime=i):this.lastFloorZoom<o&&(this.lastIntegerZoom=o,this.lastIntegerZoomTime=i),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=o,!0))}}const Bt={"Latin-1 Supplement":n=>n>=128&&n<=255,"Hangul Jamo":n=>n>=4352&&n<=4607,Khmer:n=>n>=6016&&n<=6143,"General Punctuation":n=>n>=8192&&n<=8303,"Letterlike Symbols":n=>n>=8448&&n<=8527,"Number Forms":n=>n>=8528&&n<=8591,"Miscellaneous Technical":n=>n>=8960&&n<=9215,"Control Pictures":n=>n>=9216&&n<=9279,"Optical Character Recognition":n=>n>=9280&&n<=9311,"Enclosed Alphanumerics":n=>n>=9312&&n<=9471,"Geometric Shapes":n=>n>=9632&&n<=9727,"Miscellaneous Symbols":n=>n>=9728&&n<=9983,"Miscellaneous Symbols and Arrows":n=>n>=11008&&n<=11263,"Ideographic Description Characters":n=>n>=12272&&n<=12287,"CJK Symbols and Punctuation":n=>n>=12288&&n<=12351,Hiragana:n=>n>=12352&&n<=12447,Katakana:n=>n>=12448&&n<=12543,Kanbun:n=>n>=12688&&n<=12703,"CJK Strokes":n=>n>=12736&&n<=12783,"Enclosed CJK Letters and Months":n=>n>=12800&&n<=13055,"CJK Compatibility":n=>n>=13056&&n<=13311,"Yijing Hexagram Symbols":n=>n>=19904&&n<=19967,"CJK Unified Ideographs":n=>n>=19968&&n<=40959,"Hangul Syllables":n=>n>=44032&&n<=55215,"Private Use Area":n=>n>=57344&&n<=63743,"Vertical Forms":n=>n>=65040&&n<=65055,"CJK Compatibility Forms":n=>n>=65072&&n<=65103,"Small Form Variants":n=>n>=65104&&n<=65135,"Halfwidth and Fullwidth Forms":n=>n>=65280&&n<=65519};function da(n){for(const t of n)if(fa(t.charCodeAt(0)))return!0;return!1}function zh(n){for(const t of n)if(!Gc(t.charCodeAt(0)))return!1;return!0}function vl(n){const t=n.map(i=>{try{return new RegExp(`\\p{sc=${i}}`,"u").source}catch{return null}}).filter(i=>i);return new RegExp(t.join("|"),"u")}const Kc=vl(["Arab","Dupl","Mong","Ougr","Syrc"]);function Gc(n){return!Kc.test(String.fromCodePoint(n))}const xl=vl(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function fa(n){return!(n!==746&&n!==747&&(n<4352||!(Bt["CJK Compatibility Forms"](n)&&!(n>=65097&&n<=65103)||Bt["CJK Compatibility"](n)||Bt["CJK Strokes"](n)||!(!Bt["CJK Symbols and Punctuation"](n)||n>=12296&&n<=12305||n>=12308&&n<=12319||n===12336)||Bt["Enclosed CJK Letters and Months"](n)||Bt["Ideographic Description Characters"](n)||Bt.Kanbun(n)||Bt.Katakana(n)&&n!==12540||!(!Bt["Halfwidth and Fullwidth Forms"](n)||n===65288||n===65289||n===65293||n>=65306&&n<=65310||n===65339||n===65341||n===65343||n>=65371&&n<=65503||n===65507||n>=65512&&n<=65519)||!(!Bt["Small Form Variants"](n)||n>=65112&&n<=65118||n>=65123&&n<=65126)||Bt["Vertical Forms"](n)||Bt["Yijing Hexagram Symbols"](n)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(n))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(n))||xl.test(String.fromCodePoint(n)))))}function ho(n){return!(fa(n)||function(t){return!!(Bt["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||Bt["General Punctuation"](t)&&(t===8214||t===8224||t===8225||t===8240||t===8241||t===8251||t===8252||t===8258||t===8263||t===8264||t===8265||t===8273)||Bt["Letterlike Symbols"](t)||Bt["Number Forms"](t)||Bt["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||t===9003||t>=9085&&t<=9114||t>=9150&&t<=9165||t===9167||t>=9169&&t<=9179||t>=9186&&t<=9215)||Bt["Control Pictures"](t)&&t!==9251||Bt["Optical Character Recognition"](t)||Bt["Enclosed Alphanumerics"](t)||Bt["Geometric Shapes"](t)||Bt["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Bt["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Bt["CJK Symbols and Punctuation"](t)||Bt.Katakana(t)||Bt["Private Use Area"](t)||Bt["CJK Compatibility Forms"](t)||Bt["Small Form Variants"](t)||Bt["Halfwidth and Fullwidth Forms"](t)||t===8734||t===8756||t===8757||t>=9984&&t<=10087||t>=10102&&t<=10131||t===65532||t===65533)}(n))}const Fh=vl(["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 ma(n){return Fh.test(String.fromCodePoint(n))}function Oh(n,t){return!(!t&&ma(n)||n>=2304&&n<=3583||n>=3840&&n<=4255||Bt.Khmer(n))}function Nh(n){for(const t of n)if(ma(t.charCodeAt(0)))return!0;return!1}const fn=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(n){this.pluginStatus=n.pluginStatus,this.pluginURL=n.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(n){if(fn.isParsed())throw new Error("RTL text plugin already registered.");this.applyArabicShaping=n.applyArabicShaping,this.processBidirectionalText=n.processBidirectionalText,this.processStyledBidirectionalText=n.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}syncState(n,t){return s(this,void 0,void 0,function*(){if(this.isParsed())return this.getState();if(n.pluginStatus!=="loading")return this.setState(n),n;const i=n.pluginURL,o=new Promise(d=>{this.loadScriptResolve=d});t(i);const c=new Promise(d=>setTimeout(()=>d(),this.TIMEOUT));if(yield Promise.race([o,c]),this.isParsed()){const d={pluginStatus:"loaded",pluginURL:i};return this.setState(d),d}throw this.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${i}`)})}};class lr{constructor(t,i){this.zoom=t,i?(this.now=i.now,this.fadeDuration=i.fadeDuration,this.zoomHistory=i.zoomHistory,this.transition=i.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new _l,this.transition={})}isSupportedScript(t){return function(i,o){for(const c of i)if(!Oh(c.charCodeAt(0),o))return!1;return!0}(t,fn.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const t=this.zoom,i=t-Math.floor(t),o=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:i+(1-i)*o}:{fromScale:.5,toScale:1,t:1-(1-o)*i}}}class po{constructor(t,i){this.property=t,this.value=i,this.expression=function(o,c){if($o(o))return new io(o,c);if(ro(o)){const d=al(o,c);if(d.result==="error")throw new Error(d.value.map(m=>`${m.key}: ${m.message}`).join(", "));return d.value}{let d=o;return c.type==="color"&&typeof o=="string"?d=Ot.parse(o):c.type!=="padding"||typeof o!="number"&&!Array.isArray(o)?c.type!=="numberArray"||typeof o!="number"&&!Array.isArray(o)?c.type!=="colorArray"||typeof o!="string"&&!Array.isArray(o)?c.type==="variableAnchorOffsetCollection"&&Array.isArray(o)?d=gi.parse(o):c.type==="projectionDefinition"&&typeof o=="string"&&(d=Ai.parse(o)):d=ri.parse(o):d=Ir.parse(o):d=ti.parse(o),{kind:"constant",evaluate:()=>d}}}(i===void 0?t.specification.default:i,t.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(t,i,o){return this.property.possiblyEvaluate(this,t,i,o)}}class bl{constructor(t){this.property=t,this.value=new po(t,void 0)}transitioned(t,i){return new Xc(this.property,this.value,i,Qe({},t.transition,this.transition),t.now)}untransitioned(){return new Xc(this.property,this.value,null,{},0)}}class Jc{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}getValue(t){return ht(this._values[t].value.value)}setValue(t,i){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new bl(this._values[t].property)),this._values[t].value=new po(this._values[t].property,i===null?void 0:ht(i))}getTransition(t){return ht(this._values[t].transition)}setTransition(t,i){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new bl(this._values[t].property)),this._values[t].transition=ht(i)||void 0}serialize(){const t={};for(const i of Object.keys(this._values)){const o=this.getValue(i);o!==void 0&&(t[i]=o);const c=this.getTransition(i);c!==void 0&&(t[`${i}-transition`]=c)}return t}transitioned(t,i){const o=new Qc(this._properties);for(const c of Object.keys(this._values))o._values[c]=this._values[c].transitioned(t,i._values[c]);return o}untransitioned(){const t=new Qc(this._properties);for(const i of Object.keys(this._values))t._values[i]=this._values[i].untransitioned();return t}}class Xc{constructor(t,i,o,c,d){this.property=t,this.value=i,this.begin=d+c.delay||0,this.end=this.begin+c.duration||0,t.specification.transition&&(c.delay||c.duration)&&(this.prior=o)}possiblyEvaluate(t,i,o){const c=t.now||0,d=this.value.possiblyEvaluate(t,i,o),m=this.prior;if(m){if(c>this.end)return this.prior=null,d;if(this.value.isDataDriven())return this.prior=null,d;if(c<this.begin)return m.possiblyEvaluate(t,i,o);{const v=(c-this.begin)/(this.end-this.begin);return this.property.interpolate(m.possiblyEvaluate(t,i,o),d,Kr(v))}}return d}}class Qc{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,i,o){const c=new ga(this._properties);for(const d of Object.keys(this._values))c._values[d]=this._values[d].possiblyEvaluate(t,i,o);return c}hasTransition(){for(const t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}}class qh{constructor(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)}hasValue(t){return this._values[t].value!==void 0}getValue(t){return ht(this._values[t].value)}setValue(t,i){this._values[t]=new po(this._values[t].property,i===null?void 0:ht(i))}serialize(){const t={};for(const i of Object.keys(this._values)){const o=this.getValue(i);o!==void 0&&(t[i]=o)}return t}possiblyEvaluate(t,i,o){const c=new ga(this._properties);for(const d of Object.keys(this._values))c._values[d]=this._values[d].possiblyEvaluate(t,i,o);return c}}class yi{constructor(t,i,o){this.property=t,this.value=i,this.parameters=o}isConstant(){return this.value.kind==="constant"}constantOr(t){return this.value.kind==="constant"?this.value.value:t}evaluate(t,i,o,c){return this.property.evaluate(this.value,this.parameters,t,i,o,c)}}class ga{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}}class ct{constructor(t){this.specification=t}possiblyEvaluate(t,i){if(t.isDataDriven())throw new Error("Value should not be data driven");return t.expression.evaluate(i)}interpolate(t,i,o){const c=sn[this.specification.type];return c?c(t,i,o):t}}class yt{constructor(t,i){this.specification=t,this.overrides=i}possiblyEvaluate(t,i,o,c){return new yi(this,t.expression.kind==="constant"||t.expression.kind==="camera"?{kind:"constant",value:t.expression.evaluate(i,null,{},o,c)}:t.expression,i)}interpolate(t,i,o){if(t.value.kind!=="constant"||i.value.kind!=="constant")return t;if(t.value.value===void 0||i.value.value===void 0)return new yi(this,{kind:"constant",value:void 0},t.parameters);const c=sn[this.specification.type];if(c){const d=c(t.value.value,i.value.value,o);return new yi(this,{kind:"constant",value:d},t.parameters)}return t}evaluate(t,i,o,c,d,m){return t.kind==="constant"?t.value:t.evaluate(i,o,c,d,m)}}class fo extends yt{possiblyEvaluate(t,i,o,c){if(t.value===void 0)return new yi(this,{kind:"constant",value:void 0},i);if(t.expression.kind==="constant"){const d=t.expression.evaluate(i,null,{},o,c),m=t.property.specification.type==="resolvedImage"&&typeof d!="string"?d.name:d,v=this._calculate(m,m,m,i);return new yi(this,{kind:"constant",value:v},i)}if(t.expression.kind==="camera"){const d=this._calculate(t.expression.evaluate({zoom:i.zoom-1}),t.expression.evaluate({zoom:i.zoom}),t.expression.evaluate({zoom:i.zoom+1}),i);return new yi(this,{kind:"constant",value:d},i)}return new yi(this,t.expression,i)}evaluate(t,i,o,c,d,m){if(t.kind==="source"){const v=t.evaluate(i,o,c,d,m);return this._calculate(v,v,v,i)}return t.kind==="composite"?this._calculate(t.evaluate({zoom:Math.floor(i.zoom)-1},o,c),t.evaluate({zoom:Math.floor(i.zoom)},o,c),t.evaluate({zoom:Math.floor(i.zoom)+1},o,c),i):t.value}_calculate(t,i,o,c){return c.zoom>c.zoomHistory.lastIntegerZoom?{from:t,to:i}:{from:o,to:i}}interpolate(t){return t}}class wl{constructor(t){this.specification=t}possiblyEvaluate(t,i,o,c){if(t.value!==void 0){if(t.expression.kind==="constant"){const d=t.expression.evaluate(i,null,{},o,c);return this._calculate(d,d,d,i)}return this._calculate(t.expression.evaluate(new lr(Math.floor(i.zoom-1),i)),t.expression.evaluate(new lr(Math.floor(i.zoom),i)),t.expression.evaluate(new lr(Math.floor(i.zoom+1),i)),i)}}_calculate(t,i,o,c){return c.zoom>c.zoomHistory.lastIntegerZoom?{from:t,to:i}:{from:o,to:i}}interpolate(t){return t}}class Sl{constructor(t){this.specification=t}possiblyEvaluate(t,i,o,c){return!!t.expression.evaluate(i,null,{},o,c)}interpolate(){return!1}}class zr{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const i in t){const o=t[i];o.specification.overridable&&this.overridableProperties.push(i);const c=this.defaultPropertyValues[i]=new po(o,void 0),d=this.defaultTransitionablePropertyValues[i]=new bl(o);this.defaultTransitioningPropertyValues[i]=d.untransitioned(),this.defaultPossiblyEvaluatedValues[i]=c.possiblyEvaluate({})}}}nt("DataDrivenProperty",yt),nt("DataConstantProperty",ct),nt("CrossFadedDataDrivenProperty",fo),nt("CrossFadedProperty",wl),nt("ColorRampProperty",Sl);const kl="-transition";class qi extends _e{constructor(t,i){if(super(),this.id=t.id,this.type=t.type,this._featureFilter={filter:()=>!0,needGeometry:!1},t.type!=="custom"&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!=="background"&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),i.layout&&(this._unevaluatedLayout=new qh(i.layout)),i.paint)){this._transitionablePaint=new Jc(i.paint);for(const o in t.paint)this.setPaintProperty(o,t.paint[o],{validate:!1});for(const o in t.layout)this.setLayoutProperty(o,t.layout[o],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ga(i.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){return t==="visibility"?this.visibility:this._unevaluatedLayout.getValue(t)}setLayoutProperty(t,i,o={}){i!=null&&this._validate(ua,`layers.${this.id}.layout.${t}`,t,i,o)||(t!=="visibility"?this._unevaluatedLayout.setValue(t,i):this.visibility=i)}getPaintProperty(t){return t.endsWith(kl)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,i,o={}){if(i!=null&&this._validate(gl,`layers.${this.id}.paint.${t}`,t,i,o))return!1;if(t.endsWith(kl))return this._transitionablePaint.setTransition(t.slice(0,-11),i||void 0),!1;{const c=this._transitionablePaint._values[t],d=c.property.specification["property-type"]==="cross-faded-data-driven",m=c.value.isDataDriven(),v=c.value;this._transitionablePaint.setValue(t,i),this._handleSpecialPaintPropertyUpdate(t);const S=this._transitionablePaint._values[t].value;return S.isDataDriven()||m||d||this._handleOverridablePaintPropertyUpdate(t,v,S)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,i,o){return!1}isHidden(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||this.visibility==="none"}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,i){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,i)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,i)}serialize(){const 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),ot(t,(i,o)=>!(i===void 0||o==="layout"&&!Object.keys(i).length||o==="paint"&&!Object.keys(i).length))}_validate(t,i,o,c,d={}){return(!d||d.validate!==!1)&&yl(this,t.call(Ts,{key:i,layerType:this.type,objectKey:o,value:c,styleSpec:te,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const t in this.paint._values){const i=this.paint.get(t);if(i instanceof yi&&xs(i.property.specification)&&(i.value.kind==="source"||i.value.kind==="composite")&&i.value.isStateDependent)return!0}return!1}}const Yc={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Yn{constructor(t,i){this._structArray=t,this._pos1=i*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class wr{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,i){return t._trim(),i&&(t.isTransferred=!0,i.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){const i=Object.create(this.prototype);return i.arrayBuffer=t.arrayBuffer,i.length=t.length,i.capacity=t.arrayBuffer.byteLength/i.bytesPerElement,i._refreshViews(),i}_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);const i=this.uint8;this._refreshViews(),i&&this.uint8.set(i)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function fr(n,t=1){let i=0,o=0;return{members:n.map(c=>{const d=Yc[c.type].BYTES_PER_ELEMENT,m=i=Is(i,Math.max(t,d)),v=c.components||1;return o=Math.max(o,d),i+=d*v,{name:c.name,type:c.type,components:v,offset:m}}),size:Is(i,Math.max(o,t)),alignment:t}}function Is(n,t){return Math.ceil(n/t)*t}class mo extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i){const o=this.length;return this.resize(o+1),this.emplace(o,t,i)}emplace(t,i,o){const c=2*t;return this.int16[c+0]=i,this.int16[c+1]=o,t}}mo.prototype.bytesPerElement=4,nt("StructArrayLayout2i4",mo);class go extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,o){const c=this.length;return this.resize(c+1),this.emplace(c,t,i,o)}emplace(t,i,o,c){const d=3*t;return this.int16[d+0]=i,this.int16[d+1]=o,this.int16[d+2]=c,t}}go.prototype.bytesPerElement=6,nt("StructArrayLayout3i6",go);class $n extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,o,c){const d=this.length;return this.resize(d+1),this.emplace(d,t,i,o,c)}emplace(t,i,o,c,d){const m=4*t;return this.int16[m+0]=i,this.int16[m+1]=o,this.int16[m+2]=c,this.int16[m+3]=d,t}}$n.prototype.bytesPerElement=8,nt("StructArrayLayout4i8",$n);class Al extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,o,c,d,m){const v=this.length;return this.resize(v+1),this.emplace(v,t,i,o,c,d,m)}emplace(t,i,o,c,d,m,v){const S=6*t;return this.int16[S+0]=i,this.int16[S+1]=o,this.int16[S+2]=c,this.int16[S+3]=d,this.int16[S+4]=m,this.int16[S+5]=v,t}}Al.prototype.bytesPerElement=12,nt("StructArrayLayout2i4i12",Al);class Cl extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,o,c,d,m){const v=this.length;return this.resize(v+1),this.emplace(v,t,i,o,c,d,m)}emplace(t,i,o,c,d,m,v){const S=4*t,I=8*t;return this.int16[S+0]=i,this.int16[S+1]=o,this.uint8[I+4]=c,this.uint8[I+5]=d,this.uint8[I+6]=m,this.uint8[I+7]=v,t}}Cl.prototype.bytesPerElement=8,nt("StructArrayLayout2i4ub8",Cl);class Ms extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i){const o=this.length;return this.resize(o+1),this.emplace(o,t,i)}emplace(t,i,o){const c=2*t;return this.float32[c+0]=i,this.float32[c+1]=o,t}}Ms.prototype.bytesPerElement=8,nt("StructArrayLayout2f8",Ms);class Tl extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,o,c,d,m,v,S,I,B){const z=this.length;return this.resize(z+1),this.emplace(z,t,i,o,c,d,m,v,S,I,B)}emplace(t,i,o,c,d,m,v,S,I,B,z){const q=10*t;return this.uint16[q+0]=i,this.uint16[q+1]=o,this.uint16[q+2]=c,this.uint16[q+3]=d,this.uint16[q+4]=m,this.uint16[q+5]=v,this.uint16[q+6]=S,this.uint16[q+7]=I,this.uint16[q+8]=B,this.uint16[q+9]=z,t}}Tl.prototype.bytesPerElement=20,nt("StructArrayLayout10ui20",Tl);class h extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,o,c,d,m,v,S,I,B,z,q){const j=this.length;return this.resize(j+1),this.emplace(j,t,i,o,c,d,m,v,S,I,B,z,q)}emplace(t,i,o,c,d,m,v,S,I,B,z,q,j){const H=12*t;return this.int16[H+0]=i,this.int16[H+1]=o,this.int16[H+2]=c,this.int16[H+3]=d,this.uint16[H+4]=m,this.uint16[H+5]=v,this.uint16[H+6]=S,this.uint16[H+7]=I,this.int16[H+8]=B,this.int16[H+9]=z,this.int16[H+10]=q,this.int16[H+11]=j,t}}h.prototype.bytesPerElement=24,nt("StructArrayLayout4i4ui4i24",h);class e extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,o){const c=this.length;return this.resize(c+1),this.emplace(c,t,i,o)}emplace(t,i,o,c){const d=3*t;return this.float32[d+0]=i,this.float32[d+1]=o,this.float32[d+2]=c,t}}e.prototype.bytesPerElement=12,nt("StructArrayLayout3f12",e);class r extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){const i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){return this.uint32[1*t+0]=i,t}}r.prototype.bytesPerElement=4,nt("StructArrayLayout1ul4",r);class a extends wr{_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,i,o,c,d,m,v,S,I){const B=this.length;return this.resize(B+1),this.emplace(B,t,i,o,c,d,m,v,S,I)}emplace(t,i,o,c,d,m,v,S,I,B){const z=10*t,q=5*t;return this.int16[z+0]=i,this.int16[z+1]=o,this.int16[z+2]=c,this.int16[z+3]=d,this.int16[z+4]=m,this.int16[z+5]=v,this.uint32[q+3]=S,this.uint16[z+8]=I,this.uint16[z+9]=B,t}}a.prototype.bytesPerElement=20,nt("StructArrayLayout6i1ul2ui20",a);class l extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,o,c,d,m){const v=this.length;return this.resize(v+1),this.emplace(v,t,i,o,c,d,m)}emplace(t,i,o,c,d,m,v){const S=6*t;return this.int16[S+0]=i,this.int16[S+1]=o,this.int16[S+2]=c,this.int16[S+3]=d,this.int16[S+4]=m,this.int16[S+5]=v,t}}l.prototype.bytesPerElement=12,nt("StructArrayLayout2i2i2i12",l);class p extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,o,c,d){const m=this.length;return this.resize(m+1),this.emplace(m,t,i,o,c,d)}emplace(t,i,o,c,d,m){const v=4*t,S=8*t;return this.float32[v+0]=i,this.float32[v+1]=o,this.float32[v+2]=c,this.int16[S+6]=d,this.int16[S+7]=m,t}}p.prototype.bytesPerElement=16,nt("StructArrayLayout2f1f2i16",p);class y extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,o,c,d,m){const v=this.length;return this.resize(v+1),this.emplace(v,t,i,o,c,d,m)}emplace(t,i,o,c,d,m,v){const S=16*t,I=4*t,B=8*t;return this.uint8[S+0]=i,this.uint8[S+1]=o,this.float32[I+1]=c,this.float32[I+2]=d,this.int16[B+6]=m,this.int16[B+7]=v,t}}y.prototype.bytesPerElement=16,nt("StructArrayLayout2ub2f2i16",y);class w extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,o){const c=this.length;return this.resize(c+1),this.emplace(c,t,i,o)}emplace(t,i,o,c){const d=3*t;return this.uint16[d+0]=i,this.uint16[d+1]=o,this.uint16[d+2]=c,t}}w.prototype.bytesPerElement=6,nt("StructArrayLayout3ui6",w);class A extends wr{_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,i,o,c,d,m,v,S,I,B,z,q,j,H,G,ee,le){const ve=this.length;return this.resize(ve+1),this.emplace(ve,t,i,o,c,d,m,v,S,I,B,z,q,j,H,G,ee,le)}emplace(t,i,o,c,d,m,v,S,I,B,z,q,j,H,G,ee,le,ve){const he=24*t,U=12*t,Y=48*t;return this.int16[he+0]=i,this.int16[he+1]=o,this.uint16[he+2]=c,this.uint16[he+3]=d,this.uint32[U+2]=m,this.uint32[U+3]=v,this.uint32[U+4]=S,this.uint16[he+10]=I,this.uint16[he+11]=B,this.uint16[he+12]=z,this.float32[U+7]=q,this.float32[U+8]=j,this.uint8[Y+36]=H,this.uint8[Y+37]=G,this.uint8[Y+38]=ee,this.uint32[U+10]=le,this.int16[he+22]=ve,t}}A.prototype.bytesPerElement=48,nt("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",A);class R extends wr{_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,i,o,c,d,m,v,S,I,B,z,q,j,H,G,ee,le,ve,he,U,Y,pe,Ee,je,Me,ze,Ke,We){const Je=this.length;return this.resize(Je+1),this.emplace(Je,t,i,o,c,d,m,v,S,I,B,z,q,j,H,G,ee,le,ve,he,U,Y,pe,Ee,je,Me,ze,Ke,We)}emplace(t,i,o,c,d,m,v,S,I,B,z,q,j,H,G,ee,le,ve,he,U,Y,pe,Ee,je,Me,ze,Ke,We,Je){const Oe=32*t,st=16*t;return this.int16[Oe+0]=i,this.int16[Oe+1]=o,this.int16[Oe+2]=c,this.int16[Oe+3]=d,this.int16[Oe+4]=m,this.int16[Oe+5]=v,this.int16[Oe+6]=S,this.int16[Oe+7]=I,this.uint16[Oe+8]=B,this.uint16[Oe+9]=z,this.uint16[Oe+10]=q,this.uint16[Oe+11]=j,this.uint16[Oe+12]=H,this.uint16[Oe+13]=G,this.uint16[Oe+14]=ee,this.uint16[Oe+15]=le,this.uint16[Oe+16]=ve,this.uint16[Oe+17]=he,this.uint16[Oe+18]=U,this.uint16[Oe+19]=Y,this.uint16[Oe+20]=pe,this.uint16[Oe+21]=Ee,this.uint16[Oe+22]=je,this.uint32[st+12]=Me,this.float32[st+13]=ze,this.float32[st+14]=Ke,this.uint16[Oe+30]=We,this.uint16[Oe+31]=Je,t}}R.prototype.bytesPerElement=64,nt("StructArrayLayout8i15ui1ul2f2ui64",R);class D extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){const i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){return this.float32[1*t+0]=i,t}}D.prototype.bytesPerElement=4,nt("StructArrayLayout1f4",D);class N extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,o){const c=this.length;return this.resize(c+1),this.emplace(c,t,i,o)}emplace(t,i,o,c){const d=3*t;return this.uint16[6*t+0]=i,this.float32[d+1]=o,this.float32[d+2]=c,t}}N.prototype.bytesPerElement=12,nt("StructArrayLayout1ui2f12",N);class O extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,o){const c=this.length;return this.resize(c+1),this.emplace(c,t,i,o)}emplace(t,i,o,c){const d=4*t;return this.uint32[2*t+0]=i,this.uint16[d+2]=o,this.uint16[d+3]=c,t}}O.prototype.bytesPerElement=8,nt("StructArrayLayout1ul2ui8",O);class Z extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i){const o=this.length;return this.resize(o+1),this.emplace(o,t,i)}emplace(t,i,o){const c=2*t;return this.uint16[c+0]=i,this.uint16[c+1]=o,t}}Z.prototype.bytesPerElement=4,nt("StructArrayLayout2ui4",Z);class K extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){const i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){return this.uint16[1*t+0]=i,t}}K.prototype.bytesPerElement=2,nt("StructArrayLayout1ui2",K);class ne extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,o,c){const d=this.length;return this.resize(d+1),this.emplace(d,t,i,o,c)}emplace(t,i,o,c,d){const m=4*t;return this.float32[m+0]=i,this.float32[m+1]=o,this.float32[m+2]=c,this.float32[m+3]=d,t}}ne.prototype.bytesPerElement=16,nt("StructArrayLayout4f16",ne);class ie extends Yn{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 C(this.anchorPointX,this.anchorPointY)}}ie.prototype.size=20;class ae extends a{get(t){return new ie(this,t)}}nt("CollisionBoxArray",ae);class ue extends Yn{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]}}ue.prototype.size=48;class me extends A{get(t){return new ue(this,t)}}nt("PlacedSymbolArray",me);class fe extends Yn{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]}}fe.prototype.size=64;class ge extends R{get(t){return new fe(this,t)}}nt("SymbolInstanceArray",ge);class xe extends D{getoffsetX(t){return this.float32[1*t+0]}}nt("GlyphOffsetArray",xe);class ye extends go{getx(t){return this.int16[3*t+0]}gety(t){return this.int16[3*t+1]}gettileUnitDistanceFromAnchor(t){return this.int16[3*t+2]}}nt("SymbolLineVertexArray",ye);class Te extends Yn{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]}}Te.prototype.size=12;class Fe extends N{get(t){return new Te(this,t)}}nt("TextAnchorOffsetArray",Fe);class Le extends Yn{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]}}Le.prototype.size=8;class Be extends O{get(t){return new Le(this,t)}}nt("FeatureIndexArray",Be);class De extends mo{}class Ye extends mo{}class Xe extends mo{}class He extends Al{}class at extends Cl{}class Mt extends Ms{}class qt extends Tl{}class mr extends h{}class tr extends e{}class gr extends r{}class yr extends l{}class sr extends y{}class Ht extends w{}class jr extends Z{}const Xr=fr([{name:"a_pos",components:2,type:"Int16"}],4),{members:ii}=Xr;class Zt{constructor(t=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=t}prepareSegment(t,i,o,c){const d=this.segments[this.segments.length-1];return t>Zt.MAX_VERTEX_ARRAY_LENGTH&&_t(`Max vertices per segment is ${Zt.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${Zt.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!d||d.vertexLength+t>Zt.MAX_VERTEX_ARRAY_LENGTH||d.sortKey!==c?this.createNewSegment(i,o,c):d}createNewSegment(t,i,o){const c={vertexOffset:t.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0,vaos:{}};return o!==void 0&&(c.sortKey=o),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(c),c}getOrCreateLatestSegment(t,i,o){return this.prepareSegment(0,t,i,o)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(const t of this.segments)for(const i in t.vaos)t.vaos[i].destroy()}static simpleSegment(t,i,o,c){return new Zt([{vertexOffset:t,primitiveOffset:i,vertexLength:o,primitiveLength:c,vaos:{},sortKey:0}])}}function En(n,t){return 256*(n=Lr(Math.floor(n),0,255))+Lr(Math.floor(t),0,255)}Zt.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,nt("SegmentVector",Zt);const cn=fr([{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"}]);var Pn,es,yo,In={exports:{}},ts={exports:{}},Ri={exports:{}},Mn=function(){if(yo)return In.exports;yo=1;var n=(Pn||(Pn=1,ts.exports=function(i,o){var c,d,m,v,S,I,B,z;for(d=i.length-(c=3&i.length),m=o,S=3432918353,I=461845907,z=0;z<d;)B=255&i.charCodeAt(z)|(255&i.charCodeAt(++z))<<8|(255&i.charCodeAt(++z))<<16|(255&i.charCodeAt(++z))<<24,++z,m=27492+(65535&(v=5*(65535&(m=(m^=B=(65535&(B=(B=(65535&B)*S+(((B>>>16)*S&65535)<<16)&4294967295)<<15|B>>>17))*I+(((B>>>16)*I&65535)<<16)&4294967295)<<13|m>>>19))+((5*(m>>>16)&65535)<<16)&4294967295))+((58964+(v>>>16)&65535)<<16);switch(B=0,c){case 3:B^=(255&i.charCodeAt(z+2))<<16;case 2:B^=(255&i.charCodeAt(z+1))<<8;case 1:m^=B=(65535&(B=(B=(65535&(B^=255&i.charCodeAt(z)))*S+(((B>>>16)*S&65535)<<16)&4294967295)<<15|B>>>17))*I+(((B>>>16)*I&65535)<<16)&4294967295}return m^=i.length,m=2246822507*(65535&(m^=m>>>16))+((2246822507*(m>>>16)&65535)<<16)&4294967295,m=3266489909*(65535&(m^=m>>>13))+((3266489909*(m>>>16)&65535)<<16)&4294967295,(m^=m>>>16)>>>0}),ts.exports),t=(es||(es=1,Ri.exports=function(i,o){for(var c,d=i.length,m=o^d,v=0;d>=4;)c=1540483477*(65535&(c=255&i.charCodeAt(v)|(255&i.charCodeAt(++v))<<8|(255&i.charCodeAt(++v))<<16|(255&i.charCodeAt(++v))<<24))+((1540483477*(c>>>16)&65535)<<16),m=1540483477*(65535&m)+((1540483477*(m>>>16)&65535)<<16)^(c=1540483477*(65535&(c^=c>>>24))+((1540483477*(c>>>16)&65535)<<16)),d-=4,++v;switch(d){case 3:m^=(255&i.charCodeAt(v+2))<<16;case 2:m^=(255&i.charCodeAt(v+1))<<8;case 1:m=1540483477*(65535&(m^=255&i.charCodeAt(v)))+((1540483477*(m>>>16)&65535)<<16)}return m=1540483477*(65535&(m^=m>>>13))+((1540483477*(m>>>16)&65535)<<16),(m^=m>>>15)>>>0}),Ri.exports);return In.exports=n,In.exports.murmur3=n,In.exports.murmur2=t,In.exports}(),mn=V(Mn);class Ln{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,i,o,c){this.ids.push(Fr(t)),this.positions.push(i,o,c)}getPositions(t){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const i=Fr(t);let o=0,c=this.ids.length-1;for(;o<c;){const m=o+c>>1;this.ids[m]>=i?c=m:o=m+1}const d=[];for(;this.ids[o]===i;)d.push({index:this.positions[3*o],start:this.positions[3*o+1],end:this.positions[3*o+2]}),o++;return d}static serialize(t,i){const o=new Float64Array(t.ids),c=new Uint32Array(t.positions);return Or(o,c,0,o.length-1),i&&i.push(o.buffer,c.buffer),{ids:o,positions:c}}static deserialize(t){const i=new Ln;return i.ids=t.ids,i.positions=t.positions,i.indexed=!0,i}}function Fr(n){const t=+n;return!isNaN(t)&&t<=Number.MAX_SAFE_INTEGER?t:mn(String(n))}function Or(n,t,i,o){for(;i<o;){const c=n[i+o>>1];let d=i-1,m=o+1;for(;;){do d++;while(n[d]<c);do m--;while(n[m]>c);if(d>=m)break;_i(n,d,m),_i(t,3*d,3*m),_i(t,3*d+1,3*m+1),_i(t,3*d+2,3*m+2)}m-i<o-m?(Or(n,t,i,m),i=m+1):(Or(n,t,m+1,o),o=m)}}function _i(n,t,i){const o=n[t];n[t]=n[i],n[i]=o}nt("FeaturePositionMap",Ln);class cr{constructor(t,i){this.gl=t.gl,this.location=i}}class ya extends cr{constructor(t,i){super(t,i),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))}}class $c extends cr{constructor(t,i){super(t,i),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 eu extends cr{constructor(t,i){super(t,i),this.current=Ot.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))}}const Uh=new Float32Array(16);function El(n){return[En(255*n.r,255*n.g),En(255*n.b,255*n.a)]}class _o{constructor(t,i,o){this.value=t,this.uniformNames=i.map(c=>`u_${c}`),this.type=o}setUniform(t,i,o){t.set(o.constantOr(this.value))}getBinding(t,i,o){return this.type==="color"?new eu(t,i):new ya(t,i)}}class Ui{constructor(t,i){this.uniformNames=i.map(o=>`u_${o}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,i){this.pixelRatioFrom=i.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=i.tlbr,this.patternTo=t.tlbr}setUniform(t,i,o,c){const d=c==="u_pattern_to"?this.patternTo:c==="u_pattern_from"?this.patternFrom:c==="u_pixel_ratio_to"?this.pixelRatioTo:c==="u_pixel_ratio_from"?this.pixelRatioFrom:null;d&&t.set(d)}getBinding(t,i,o){return o.substr(0,9)==="u_pattern"?new $c(t,i):new ya(t,i)}}class un{constructor(t,i,o,c){this.expression=t,this.type=o,this.maxValue=0,this.paintVertexAttributes=i.map(d=>({name:`a_${d}`,type:"Float32",components:o==="color"?2:1,offset:0})),this.paintVertexArray=new c}populatePaintArray(t,i,o,c,d){const m=this.paintVertexArray.length,v=this.expression.evaluate(new lr(0),i,{},c,[],d);this.paintVertexArray.resize(t),this._setPaintValue(m,t,v)}updatePaintArray(t,i,o,c){const d=this.expression.evaluate({zoom:0},o,c);this._setPaintValue(t,i,d)}_setPaintValue(t,i,o){if(this.type==="color"){const c=El(o);for(let d=t;d<i;d++)this.paintVertexArray.emplace(d,c[0],c[1])}else{for(let c=t;c<i;c++)this.paintVertexArray.emplace(c,o);this.maxValue=Math.max(this.maxValue,Math.abs(o))}}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 ji{constructor(t,i,o,c,d,m){this.expression=t,this.uniformNames=i.map(v=>`u_${v}_t`),this.type=o,this.useIntegerZoom=c,this.zoom=d,this.maxValue=0,this.paintVertexAttributes=i.map(v=>({name:`a_${v}`,type:"Float32",components:o==="color"?4:2,offset:0})),this.paintVertexArray=new m}populatePaintArray(t,i,o,c,d){const m=this.expression.evaluate(new lr(this.zoom),i,{},c,[],d),v=this.expression.evaluate(new lr(this.zoom+1),i,{},c,[],d),S=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(S,t,m,v)}updatePaintArray(t,i,o,c){const d=this.expression.evaluate({zoom:this.zoom},o,c),m=this.expression.evaluate({zoom:this.zoom+1},o,c);this._setPaintValue(t,i,d,m)}_setPaintValue(t,i,o,c){if(this.type==="color"){const d=El(o),m=El(c);for(let v=t;v<i;v++)this.paintVertexArray.emplace(v,d[0],d[1],m[0],m[1])}else{for(let d=t;d<i;d++)this.paintVertexArray.emplace(d,o,c);this.maxValue=Math.max(this.maxValue,Math.abs(o),Math.abs(c))}}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,i){const o=this.useIntegerZoom?Math.floor(i.zoom):i.zoom,c=Lr(this.expression.interpolationFactor(o,this.zoom,this.zoom+1),0,1);t.set(c)}getBinding(t,i,o){return new ya(t,i)}}class gn{constructor(t,i,o,c,d,m){this.expression=t,this.type=i,this.useIntegerZoom=o,this.zoom=c,this.layerId=m,this.zoomInPaintVertexArray=new d,this.zoomOutPaintVertexArray=new d}populatePaintArray(t,i,o){const c=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(c,t,i.patterns&&i.patterns[this.layerId],o)}updatePaintArray(t,i,o,c,d){this._setPaintValues(t,i,o.patterns&&o.patterns[this.layerId],d)}_setPaintValues(t,i,o,c){if(!c||!o)return;const{min:d,mid:m,max:v}=o,S=c[d],I=c[m],B=c[v];if(S&&I&&B)for(let z=t;z<i;z++)this.zoomInPaintVertexArray.emplace(z,I.tl[0],I.tl[1],I.br[0],I.br[1],S.tl[0],S.tl[1],S.br[0],S.br[1],I.pixelRatio,S.pixelRatio),this.zoomOutPaintVertexArray.emplace(z,I.tl[0],I.tl[1],I.br[0],I.br[1],B.tl[0],B.tl[1],B.br[0],B.br[1],I.pixelRatio,B.pixelRatio)}upload(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,cn.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,cn.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class _a{constructor(t,i,o){this.binders={},this._buffers=[];const c=[];for(const d in t.paint._values){if(!o(d))continue;const m=t.paint.get(d);if(!(m instanceof yi&&xs(m.property.specification)))continue;const v=Pl(d,t.type),S=m.value,I=m.property.specification.type,B=m.property.useIntegerZoom,z=m.property.specification["property-type"],q=z==="cross-faded"||z==="cross-faded-data-driven";if(S.kind==="constant")this.binders[d]=q?new Ui(S.value,v):new _o(S.value,v,I),c.push(`/u_${d}`);else if(S.kind==="source"||q){const j=gd(d,I,"source");this.binders[d]=q?new gn(S,I,B,i,j,t.id):new un(S,v,I,j),c.push(`/a_${d}`)}else{const j=gd(d,I,"composite");this.binders[d]=new ji(S,v,I,B,i,j),c.push(`/z_${d}`)}}this.cacheKey=c.sort().join("")}getMaxValue(t){const i=this.binders[t];return i instanceof un||i instanceof ji?i.maxValue:0}populatePaintArrays(t,i,o,c,d){for(const m in this.binders){const v=this.binders[m];(v instanceof un||v instanceof ji||v instanceof gn)&&v.populatePaintArray(t,i,o,c,d)}}setConstantPatternPositions(t,i){for(const o in this.binders){const c=this.binders[o];c instanceof Ui&&c.setConstantPatternPositions(t,i)}}updatePaintArrays(t,i,o,c,d){let m=!1;for(const v in t){const S=i.getPositions(v);for(const I of S){const B=o.feature(I.index);for(const z in this.binders){const q=this.binders[z];if((q instanceof un||q instanceof ji||q instanceof gn)&&q.expression.isStateDependent===!0){const j=c.paint.get(z);q.expression=j.value,q.updatePaintArray(I.start,I.end,B,t[v],d),m=!0}}}}return m}defines(){const t=[];for(const i in this.binders){const o=this.binders[i];(o instanceof _o||o instanceof Ui)&&t.push(...o.uniformNames.map(c=>`#define HAS_UNIFORM_${c}`))}return t}getBinderAttributes(){const t=[];for(const i in this.binders){const o=this.binders[i];if(o instanceof un||o instanceof ji)for(let c=0;c<o.paintVertexAttributes.length;c++)t.push(o.paintVertexAttributes[c].name);else if(o instanceof gn)for(let c=0;c<cn.members.length;c++)t.push(cn.members[c].name)}return t}getBinderUniforms(){const t=[];for(const i in this.binders){const o=this.binders[i];if(o instanceof _o||o instanceof Ui||o instanceof ji)for(const c of o.uniformNames)t.push(c)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,i){const o=[];for(const c in this.binders){const d=this.binders[c];if(d instanceof _o||d instanceof Ui||d instanceof ji){for(const m of d.uniformNames)if(i[m]){const v=d.getBinding(t,i[m],m);o.push({name:m,property:c,binding:v})}}}return o}setUniforms(t,i,o,c){for(const{name:d,property:m,binding:v}of i)this.binders[m].setUniform(v,c,o.get(m),d)}updatePaintBuffers(t){this._buffers=[];for(const i in this.binders){const o=this.binders[i];if(t&&o instanceof gn){const c=t.fromScale===2?o.zoomInPaintVertexBuffer:o.zoomOutPaintVertexBuffer;c&&this._buffers.push(c)}else(o instanceof un||o instanceof ji)&&o.paintVertexBuffer&&this._buffers.push(o.paintVertexBuffer)}}upload(t){for(const i in this.binders){const o=this.binders[i];(o instanceof un||o instanceof ji||o instanceof gn)&&o.upload(t)}this.updatePaintBuffers()}destroy(){for(const t in this.binders){const i=this.binders[t];(i instanceof un||i instanceof ji||i instanceof gn)&&i.destroy()}}}class Rn{constructor(t,i,o=()=>!0){this.programConfigurations={};for(const c of t)this.programConfigurations[c.id]=new _a(c,i,o);this.needsUpload=!1,this._featureMap=new Ln,this._bufferOffset=0}populatePaintArrays(t,i,o,c,d,m){for(const v in this.programConfigurations)this.programConfigurations[v].populatePaintArrays(t,i,c,d,m);i.id!==void 0&&this._featureMap.add(i.id,o,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,i,o,c){for(const d of o)this.needsUpload=this.programConfigurations[d.id].updatePaintArrays(t,this._featureMap,i,d,c)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const i in this.programConfigurations)this.programConfigurations[i].upload(t);this.needsUpload=!1}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy()}}function Pl(n,t){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-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"]}[n]||[n.replace(`${t}-`,"").replace(/-/g,"_")]}function gd(n,t,i){const o={color:{source:Ms,composite:ne},number:{source:D,composite:Ms}},c=function(d){return{"line-pattern":{source:qt,composite:qt},"fill-pattern":{source:qt,composite:qt},"fill-extrusion-pattern":{source:qt,composite:qt}}[d]}(n);return c&&c[i]||o[t][i]}nt("ConstantBinder",_o),nt("CrossFadedConstantBinder",Ui),nt("SourceExpressionBinder",un),nt("CrossFadedCompositeBinder",gn),nt("CompositeExpressionBinder",ji),nt("ProgramConfiguration",_a,{omit:["_buffers"]}),nt("ProgramConfigurationSet",Rn);const jh=Math.pow(2,14)-1,yd=-jh-1;function vo(n){const t=Jt/n.extent,i=n.loadGeometry();for(let o=0;o<i.length;o++){const c=i[o];for(let d=0;d<c.length;d++){const m=c[d],v=Math.round(m.x*t),S=Math.round(m.y*t);m.x=Lr(v,yd,jh),m.y=Lr(S,yd,jh),(v<m.x||v>m.x+1||S<m.y||S>m.y+1)&&_t("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return i}function xo(n,t){return{type:n.type,id:n.id,properties:n.properties,geometry:t?vo(n):[]}}const _d=-32768;function my(n,t,i,o,c){n.emplaceBack(_d+8*t+o,_d+8*i+c)}class Wh{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(i=>i.id),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Ye,this.indexArray=new Ht,this.segments=new Zt,this.programConfigurations=new Rn(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(t,i,o){const c=this.layers[0],d=[];let m=null,v=!1,S=c.type==="heatmap";if(c.type==="circle"){const B=c;m=B.layout.get("circle-sort-key"),v=!m.isConstant(),S=S||B.paint.get("circle-pitch-alignment")==="map"}const I=S?i.subdivisionGranularity.circle:1;for(const{feature:B,id:z,index:q,sourceLayerIndex:j}of t){const H=this.layers[0]._featureFilter.needGeometry,G=xo(B,H);if(!this.layers[0]._featureFilter.filter(new lr(this.zoom),G,o))continue;const ee=v?m.evaluate(G,{},o):void 0,le={id:z,properties:B.properties,type:B.type,sourceLayerIndex:j,index:q,geometry:H?G.geometry:vo(B),patterns:{},sortKey:ee};d.push(le)}v&&d.sort((B,z)=>B.sortKey-z.sortKey);for(const B of d){const{geometry:z,index:q,sourceLayerIndex:j}=B,H=t[q].feature;this.addFeature(B,z,q,o,I),i.featureIndex.insert(H,z,q,j,this.index)}}update(t,i,o){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,i,this.stateDependentLayers,o)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ii),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,i,o,c,d=1){let m;switch(d){case 1:m=[0,7];break;case 3:m=[0,2,5,7];break;case 5:m=[0,1,3,4,6,7];break;case 7:m=[0,1,2,3,4,5,6,7];break;default:throw new Error(`Invalid circle bucket granularity: ${d}; valid values are 1, 3, 5, 7.`)}const v=m.length;for(const S of i)for(const I of S){const B=I.x,z=I.y;if(B<0||B>=Jt||z<0||z>=Jt)continue;const q=this.segments.prepareSegment(v*v,this.layoutVertexArray,this.indexArray,t.sortKey),j=q.vertexLength;for(let H=0;H<v;H++)for(let G=0;G<v;G++)my(this.layoutVertexArray,B,z,m[G],m[H]);for(let H=0;H<v-1;H++)for(let G=0;G<v-1;G++){const ee=j+H*v+G,le=j+(H+1)*v+G;this.indexArray.emplaceBack(ee,le+1,ee+1),this.indexArray.emplaceBack(ee,le,le+1)}q.vertexLength+=v*v,q.primitiveLength+=(v-1)*(v-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,o,{},c)}}function vd(n,t){for(let i=0;i<n.length;i++)if(bo(t,n[i]))return!0;for(let i=0;i<t.length;i++)if(bo(n,t[i]))return!0;return!!Hh(n,t)}function gy(n,t,i){return!!bo(n,t)||!!Zh(t,n,i)}function xd(n,t){if(n.length===1)return wd(t,n[0]);for(let i=0;i<t.length;i++){const o=t[i];for(let c=0;c<o.length;c++)if(bo(n,o[c]))return!0}for(let i=0;i<n.length;i++)if(wd(t,n[i]))return!0;for(let i=0;i<t.length;i++)if(Hh(n,t[i]))return!0;return!1}function yy(n,t,i){if(n.length>1){if(Hh(n,t))return!0;for(let o=0;o<t.length;o++)if(Zh(t[o],n,i))return!0}for(let o=0;o<n.length;o++)if(Zh(n[o],t,i))return!0;return!1}function Hh(n,t){if(n.length===0||t.length===0)return!1;for(let i=0;i<n.length-1;i++){const o=n[i],c=n[i+1];for(let d=0;d<t.length-1;d++)if(_y(o,c,t[d],t[d+1]))return!0}return!1}function _y(n,t,i,o){return dt(n,i,o)!==dt(t,i,o)&&dt(n,t,i)!==dt(n,t,o)}function Zh(n,t,i){const o=i*i;if(t.length===1)return n.distSqr(t[0])<o;for(let c=1;c<t.length;c++)if(bd(n,t[c-1],t[c])<o)return!0;return!1}function bd(n,t,i){const o=t.distSqr(i);if(o===0)return n.distSqr(t);const c=((n.x-t.x)*(i.x-t.x)+(n.y-t.y)*(i.y-t.y))/o;return n.distSqr(c<0?t:c>1?i:i.sub(t)._mult(c)._add(t))}function wd(n,t){for(let i=0;i<n.length;i++)if(bo(n[i],t))return!0;return!1}function bo(n,t){let i=!1;for(let o=0,c=n.length-1;o<n.length;c=o++){const d=n[o],m=n[c];d.y>t.y!=m.y>t.y&&t.x<(m.x-d.x)*(t.y-d.y)/(m.y-d.y)+d.x&&(i=!i)}return i}function vy(n,t,i){const o=i[0],c=i[2];if(n.x<o.x&&t.x<o.x||n.x>c.x&&t.x>c.x||n.y<o.y&&t.y<o.y||n.y>c.y&&t.y>c.y)return!1;const d=dt(n,t,i[0]);return d!==dt(n,t,i[1])||d!==dt(n,t,i[2])||d!==dt(n,t,i[3])}function Il(n,t,i){const o=t.paint.get(n).value;return o.kind==="constant"?o.value:i.programConfigurations.get(t.id).getMaxValue(n)}function tu(n){return Math.sqrt(n[0]*n[0]+n[1]*n[1])}function ru(n,t,i,o,c){if(!t[0]&&!t[1])return n;const d=C.convert(t)._mult(c);i==="viewport"&&d._rotate(-o);const m=[];for(let v=0;v<n.length;v++)m.push(n[v].sub(d));return m}let Sd,kd;nt("CircleBucket",Wh,{omit:["layers"]});var xy={get paint(){return kd=kd||new zr({"circle-radius":new yt(te.paint_circle["circle-radius"]),"circle-color":new yt(te.paint_circle["circle-color"]),"circle-blur":new yt(te.paint_circle["circle-blur"]),"circle-opacity":new yt(te.paint_circle["circle-opacity"]),"circle-translate":new ct(te.paint_circle["circle-translate"]),"circle-translate-anchor":new ct(te.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new ct(te.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new ct(te.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new yt(te.paint_circle["circle-stroke-width"]),"circle-stroke-color":new yt(te.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new yt(te.paint_circle["circle-stroke-opacity"])})},get layout(){return Sd=Sd||new zr({"circle-sort-key":new yt(te.layout_circle["circle-sort-key"])})}};class by extends qi{constructor(t){super(t,xy)}createBucket(t){return new Wh(t)}queryRadius(t){const i=t;return Il("circle-radius",this,i)+Il("circle-stroke-width",this,i)+tu(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:t,feature:i,featureState:o,geometry:c,transform:d,pixelsToTileUnits:m,unwrappedTileID:v,getElevation:S}){const I=ru(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-d.bearingInRadians,m),B=this.paint.get("circle-radius").evaluate(i,o)+this.paint.get("circle-stroke-width").evaluate(i,o),z=this.paint.get("circle-pitch-alignment")==="map",q=z?I:function(H,G,ee,le){return H.map(ve=>Ad(ve,G,ee,le))}(I,d,v,S),j=z?B*m:B;for(const H of c)for(const G of H){const ee=z?G:Ad(G,d,v,S);let le=j;const ve=d.projectTileCoordinates(G.x,G.y,v,S).signedDistanceFromCamera;if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?le*=ve/d.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(le*=d.cameraToCenterDistance/ve),gy(q,ee,le))return!0}return!1}}function Ad(n,t,i,o){const c=t.projectTileCoordinates(n.x,n.y,i,o).point;return new C((.5*c.x+.5)*t.width,(.5*-c.y+.5)*t.height)}class Cd extends Wh{}let Td;nt("HeatmapBucket",Cd,{omit:["layers"]});var wy={get paint(){return Td=Td||new zr({"heatmap-radius":new yt(te.paint_heatmap["heatmap-radius"]),"heatmap-weight":new yt(te.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new ct(te.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Sl(te.paint_heatmap["heatmap-color"]),"heatmap-opacity":new ct(te.paint_heatmap["heatmap-opacity"])})}};function Kh(n,{width:t,height:i},o,c){if(c){if(c instanceof Uint8ClampedArray)c=new Uint8Array(c.buffer);else if(c.length!==t*i*o)throw new RangeError(`mismatched image size. expected: ${c.length} but got: ${t*i*o}`)}else c=new Uint8Array(t*i*o);return n.width=t,n.height=i,n.data=c,n}function Ed(n,{width:t,height:i},o){if(t===n.width&&i===n.height)return;const c=Kh({},{width:t,height:i},o);Gh(n,c,{x:0,y:0},{x:0,y:0},{width:Math.min(n.width,t),height:Math.min(n.height,i)},o),n.width=t,n.height=i,n.data=c.data}function Gh(n,t,i,o,c,d){if(c.width===0||c.height===0)return t;if(c.width>n.width||c.height>n.height||i.x>n.width-c.width||i.y>n.height-c.height)throw new RangeError("out of range source coordinates for image copy");if(c.width>t.width||c.height>t.height||o.x>t.width-c.width||o.y>t.height-c.height)throw new RangeError("out of range destination coordinates for image copy");const m=n.data,v=t.data;if(m===v)throw new Error("srcData equals dstData, so image is already copied");for(let S=0;S<c.height;S++){const I=((i.y+S)*n.width+i.x)*d,B=((o.y+S)*t.width+o.x)*d;for(let z=0;z<c.width*d;z++)v[B+z]=m[I+z]}return t}class Ml{constructor(t,i){Kh(this,t,1,i)}resize(t){Ed(this,t,1)}clone(){return new Ml({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,i,o,c,d){Gh(t,i,o,c,d,1)}}class Xi{constructor(t,i){Kh(this,t,4,i)}resize(t){Ed(this,t,4)}replace(t,i){i?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t}clone(){return new Xi({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,i,o,c,d){Gh(t,i,o,c,d,4)}}function Pd(n){const t={},i=n.resolution||256,o=n.clips?n.clips.length:1,c=n.image||new Xi({width:i,height:o});if(Math.log(i)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${i}`);const d=(m,v,S)=>{t[n.evaluationKey]=S;const I=n.expression.evaluate(t);c.data[m+v+0]=Math.floor(255*I.r/I.a),c.data[m+v+1]=Math.floor(255*I.g/I.a),c.data[m+v+2]=Math.floor(255*I.b/I.a),c.data[m+v+3]=Math.floor(255*I.a)};if(n.clips)for(let m=0,v=0;m<o;++m,v+=4*i)for(let S=0,I=0;S<i;S++,I+=4){const B=S/(i-1),{start:z,end:q}=n.clips[m];d(v,I,z*(1-B)+q*B)}else for(let m=0,v=0;m<i;m++,v+=4)d(0,v,m/(i-1));return c}nt("AlphaImage",Ml),nt("RGBAImage",Xi);const Jh="big-fb";class Sy extends qi{createBucket(t){return new Cd(t)}constructor(t){super(t,wy),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){t==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Pd({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(Jh)&&this.heatmapFbos.delete(Jh)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}}let Id;var ky={get paint(){return Id=Id||new zr({"hillshade-illumination-direction":new ct(te.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-altitude":new ct(te.paint_hillshade["hillshade-illumination-altitude"]),"hillshade-illumination-anchor":new ct(te.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new ct(te.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new ct(te.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new ct(te.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new ct(te.paint_hillshade["hillshade-accent-color"]),"hillshade-method":new ct(te.paint_hillshade["hillshade-method"])})}};class Ay extends qi{constructor(t){super(t,ky),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let t=this.paint.get("hillshade-illumination-direction").values,i=this.paint.get("hillshade-illumination-altitude").values,o=this.paint.get("hillshade-highlight-color").values,c=this.paint.get("hillshade-shadow-color").values;const d=Math.max(t.length,i.length,o.length,c.length);t=t.concat(Array(d-t.length).fill(t.at(-1))),i=i.concat(Array(d-i.length).fill(i.at(-1))),o=o.concat(Array(d-o.length).fill(o.at(-1))),c=c.concat(Array(d-c.length).fill(c.at(-1)));const m=i.map(Xt);return{directionRadians:t.map(Xt),altitudeRadians:m,shadowColor:c,highlightColor:o}}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}}const Cy=fr([{name:"a_pos",components:2,type:"Int16"}],4),{members:Ty}=Cy;function Xh(n,t,i){const o=i.patternDependencies;let c=!1;for(const d of t){const m=d.paint.get(`${n}-pattern`);m.isConstant()||(c=!0);const v=m.constantOr(null);v&&(c=!0,o[v.to]=!0,o[v.from]=!0)}return c}function Qh(n,t,i,o,c){const d=c.patternDependencies;for(const m of t){const v=m.paint.get(`${n}-pattern`).value;if(v.kind!=="constant"){let S=v.evaluate({zoom:o-1},i,{},c.availableImages),I=v.evaluate({zoom:o},i,{},c.availableImages),B=v.evaluate({zoom:o+1},i,{},c.availableImages);S=S&&S.name?S.name:S,I=I&&I.name?I.name:I,B=B&&B.name?B.name:B,d[S]=!0,d[I]=!0,d[B]=!0,i.patterns[m.id]={min:S,mid:I,max:B}}}return i}function Md(n,t,i,o,c){let d;if(c===function(m,v,S,I){let B=0;for(let z=v,q=S-I;z<S;z+=I)B+=(m[q]-m[z])*(m[z+1]+m[q+1]),q=z;return B}(n,t,i,o)>0)for(let m=t;m<i;m+=o)d=Dd(m/o|0,n[m],n[m+1],d);else for(let m=i-o;m>=t;m-=o)d=Dd(m/o|0,n[m],n[m+1],d);return d&&va(d,d.next)&&(Dl(d),d=d.next),d}function wo(n,t){if(!n)return n;t||(t=n);let i,o=n;do if(i=!1,o.steiner||!va(o,o.next)&&Mr(o.prev,o,o.next)!==0)o=o.next;else{if(Dl(o),o=t=o.prev,o===o.next)break;i=!0}while(i||o!==t);return t}function Ll(n,t,i,o,c,d,m){if(!n)return;!m&&d&&function(S,I,B,z){let q=S;do q.z===0&&(q.z=Yh(q.x,q.y,I,B,z)),q.prevZ=q.prev,q.nextZ=q.next,q=q.next;while(q!==S);q.prevZ.nextZ=null,q.prevZ=null,function(j){let H,G=1;do{let ee,le=j;j=null;let ve=null;for(H=0;le;){H++;let he=le,U=0;for(let pe=0;pe<G&&(U++,he=he.nextZ,he);pe++);let Y=G;for(;U>0||Y>0&&he;)U!==0&&(Y===0||!he||le.z<=he.z)?(ee=le,le=le.nextZ,U--):(ee=he,he=he.nextZ,Y--),ve?ve.nextZ=ee:j=ee,ee.prevZ=ve,ve=ee;le=he}ve.nextZ=null,G*=2}while(H>1)}(q)}(n,o,c,d);let v=n;for(;n.prev!==n.next;){const S=n.prev,I=n.next;if(d?Py(n,o,c,d):Ey(n))t.push(S.i,n.i,I.i),Dl(n),n=I.next,v=I.next;else if((n=I)===v){m?m===1?Ll(n=Iy(wo(n),t),t,i,o,c,d,2):m===2&&My(n,t,i,o,c,d):Ll(wo(n),t,i,o,c,d,1);break}}}function Ey(n){const t=n.prev,i=n,o=n.next;if(Mr(t,i,o)>=0)return!1;const c=t.x,d=i.x,m=o.x,v=t.y,S=i.y,I=o.y,B=Math.min(c,d,m),z=Math.min(v,S,I),q=Math.max(c,d,m),j=Math.max(v,S,I);let H=o.next;for(;H!==t;){if(H.x>=B&&H.x<=q&&H.y>=z&&H.y<=j&&Rl(c,v,d,S,m,I,H.x,H.y)&&Mr(H.prev,H,H.next)>=0)return!1;H=H.next}return!0}function Py(n,t,i,o){const c=n.prev,d=n,m=n.next;if(Mr(c,d,m)>=0)return!1;const v=c.x,S=d.x,I=m.x,B=c.y,z=d.y,q=m.y,j=Math.min(v,S,I),H=Math.min(B,z,q),G=Math.max(v,S,I),ee=Math.max(B,z,q),le=Yh(j,H,t,i,o),ve=Yh(G,ee,t,i,o);let he=n.prevZ,U=n.nextZ;for(;he&&he.z>=le&&U&&U.z<=ve;){if(he.x>=j&&he.x<=G&&he.y>=H&&he.y<=ee&&he!==c&&he!==m&&Rl(v,B,S,z,I,q,he.x,he.y)&&Mr(he.prev,he,he.next)>=0||(he=he.prevZ,U.x>=j&&U.x<=G&&U.y>=H&&U.y<=ee&&U!==c&&U!==m&&Rl(v,B,S,z,I,q,U.x,U.y)&&Mr(U.prev,U,U.next)>=0))return!1;U=U.nextZ}for(;he&&he.z>=le;){if(he.x>=j&&he.x<=G&&he.y>=H&&he.y<=ee&&he!==c&&he!==m&&Rl(v,B,S,z,I,q,he.x,he.y)&&Mr(he.prev,he,he.next)>=0)return!1;he=he.prevZ}for(;U&&U.z<=ve;){if(U.x>=j&&U.x<=G&&U.y>=H&&U.y<=ee&&U!==c&&U!==m&&Rl(v,B,S,z,I,q,U.x,U.y)&&Mr(U.prev,U,U.next)>=0)return!1;U=U.nextZ}return!0}function Iy(n,t){let i=n;do{const o=i.prev,c=i.next.next;!va(o,c)&&Rd(o,i,i.next,c)&&Bl(o,c)&&Bl(c,o)&&(t.push(o.i,i.i,c.i),Dl(i),Dl(i.next),i=n=c),i=i.next}while(i!==n);return wo(i)}function My(n,t,i,o,c,d){let m=n;do{let v=m.next.next;for(;v!==m.prev;){if(m.i!==v.i&&Vy(m,v)){let S=Bd(m,v);return m=wo(m,m.next),S=wo(S,S.next),Ll(m,t,i,o,c,d,0),void Ll(S,t,i,o,c,d,0)}v=v.next}m=m.next}while(m!==n)}function Ly(n,t){let i=n.x-t.x;return i===0&&(i=n.y-t.y,i===0)&&(i=(n.next.y-n.y)/(n.next.x-n.x)-(t.next.y-t.y)/(t.next.x-t.x)),i}function Ry(n,t){const i=function(c,d){let m=d;const v=c.x,S=c.y;let I,B=-1/0;if(va(c,m))return m;do{if(va(c,m.next))return m.next;if(S<=m.y&&S>=m.next.y&&m.next.y!==m.y){const G=m.x+(S-m.y)*(m.next.x-m.x)/(m.next.y-m.y);if(G<=v&&G>B&&(B=G,I=m.x<m.next.x?m:m.next,G===v))return I}m=m.next}while(m!==d);if(!I)return null;const z=I,q=I.x,j=I.y;let H=1/0;m=I;do{if(v>=m.x&&m.x>=q&&v!==m.x&&Ld(S<j?v:B,S,q,j,S<j?B:v,S,m.x,m.y)){const G=Math.abs(S-m.y)/(v-m.x);Bl(m,c)&&(G<H||G===H&&(m.x>I.x||m.x===I.x&&By(I,m)))&&(I=m,H=G)}m=m.next}while(m!==z);return I}(n,t);if(!i)return t;const o=Bd(i,n);return wo(o,o.next),wo(i,i.next)}function By(n,t){return Mr(n.prev,n,t.prev)<0&&Mr(t.next,n,n.next)<0}function Yh(n,t,i,o,c){return(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=(n-i)*c|0)|n<<8))|n<<4))|n<<2))|n<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-o)*c|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Dy(n){let t=n,i=n;do(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next;while(t!==n);return i}function Ld(n,t,i,o,c,d,m,v){return(c-m)*(t-v)>=(n-m)*(d-v)&&(n-m)*(o-v)>=(i-m)*(t-v)&&(i-m)*(d-v)>=(c-m)*(o-v)}function Rl(n,t,i,o,c,d,m,v){return!(n===m&&t===v)&&Ld(n,t,i,o,c,d,m,v)}function Vy(n,t){return n.next.i!==t.i&&n.prev.i!==t.i&&!function(i,o){let c=i;do{if(c.i!==i.i&&c.next.i!==i.i&&c.i!==o.i&&c.next.i!==o.i&&Rd(c,c.next,i,o))return!0;c=c.next}while(c!==i);return!1}(n,t)&&(Bl(n,t)&&Bl(t,n)&&function(i,o){let c=i,d=!1;const m=(i.x+o.x)/2,v=(i.y+o.y)/2;do c.y>v!=c.next.y>v&&c.next.y!==c.y&&m<(c.next.x-c.x)*(v-c.y)/(c.next.y-c.y)+c.x&&(d=!d),c=c.next;while(c!==i);return d}(n,t)&&(Mr(n.prev,n,t.prev)||Mr(n,t.prev,t))||va(n,t)&&Mr(n.prev,n,n.next)>0&&Mr(t.prev,t,t.next)>0)}function Mr(n,t,i){return(t.y-n.y)*(i.x-t.x)-(t.x-n.x)*(i.y-t.y)}function va(n,t){return n.x===t.x&&n.y===t.y}function Rd(n,t,i,o){const c=nu(Mr(n,t,i)),d=nu(Mr(n,t,o)),m=nu(Mr(i,o,n)),v=nu(Mr(i,o,t));return c!==d&&m!==v||!(c!==0||!iu(n,i,t))||!(d!==0||!iu(n,o,t))||!(m!==0||!iu(i,n,o))||!(v!==0||!iu(i,t,o))}function iu(n,t,i){return t.x<=Math.max(n.x,i.x)&&t.x>=Math.min(n.x,i.x)&&t.y<=Math.max(n.y,i.y)&&t.y>=Math.min(n.y,i.y)}function nu(n){return n>0?1:n<0?-1:0}function Bl(n,t){return Mr(n.prev,n,n.next)<0?Mr(n,t,n.next)>=0&&Mr(n,n.prev,t)>=0:Mr(n,t,n.prev)<0||Mr(n,n.next,t)<0}function Bd(n,t){const i=$h(n.i,n.x,n.y),o=$h(t.i,t.x,t.y),c=n.next,d=t.prev;return n.next=t,t.prev=n,i.next=c,c.prev=i,o.next=i,i.prev=o,d.next=o,o.prev=d,o}function Dd(n,t,i,o){const c=$h(n,t,i);return o?(c.next=o.next,c.prev=o,o.next.prev=c,o.next=c):(c.prev=c,c.next=c),c}function Dl(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function $h(n,t,i){return{i:n,x:t,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class xa{constructor(t,i){if(i>t)throw new Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=t,this._minGranularity=i}getGranularityForZoomLevel(t){return Math.max(Math.floor(this._baseZoomGranularity/(1<<t)),this._minGranularity,1)}}class su{constructor(t){this.fill=t.fill,this.line=t.line,this.tile=t.tile,this.stencil=t.stencil,this.circle=t.circle}}su.noSubdivision=new su({fill:new xa(0,0),line:new xa(0,0),tile:new xa(0,0),stencil:new xa(0,0),circle:1}),nt("SubdivisionGranularityExpression",xa),nt("SubdivisionGranularitySetting",su);const ba=-32768,Vl=32767;class zy{constructor(t,i){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=t,this._granularityCellSize=Jt/t,this._canonical=i}_getKey(t,i){return(t+=32768)<<16|(i+=32768)<<0}_vertexToIndex(t,i){if(t<-32768||i<-32768||t>32767||i>32767)throw new Error("Vertex coordinates are out of signed 16 bit integer range.");const o=0|Math.round(t),c=0|Math.round(i),d=this._getKey(o,c);if(this._vertexDictionary.has(d))return this._vertexDictionary.get(d);const m=this._vertexBuffer.length/2;return this._vertexDictionary.set(d,m),this._vertexBuffer.push(o,c),m}_subdivideTrianglesScanline(t){if(this._granularity<2)return function(c,d){const m=[];for(let v=0;v<d.length;v+=3){const S=d[v],I=d[v+1],B=d[v+2],z=c[2*S],q=c[2*S+1];(c[2*I]-z)*(c[2*B+1]-q)-(c[2*I+1]-q)*(c[2*B]-z)>0?(m.push(S),m.push(B),m.push(I)):(m.push(S),m.push(I),m.push(B))}return m}(this._vertexBuffer,t);const i=[],o=t.length;for(let c=0;c<o;c+=3){const d=[t[c+0],t[c+1],t[c+2]],m=[this._vertexBuffer[2*t[c+0]+0],this._vertexBuffer[2*t[c+0]+1],this._vertexBuffer[2*t[c+1]+0],this._vertexBuffer[2*t[c+1]+1],this._vertexBuffer[2*t[c+2]+0],this._vertexBuffer[2*t[c+2]+1]];let v=1/0,S=1/0,I=-1/0,B=-1/0;for(let G=0;G<3;G++){const ee=m[2*G],le=m[2*G+1];v=Math.min(v,ee),I=Math.max(I,ee),S=Math.min(S,le),B=Math.max(B,le)}if(v===I||S===B)continue;const z=Math.floor(v/this._granularityCellSize),q=Math.ceil(I/this._granularityCellSize),j=Math.floor(S/this._granularityCellSize),H=Math.ceil(B/this._granularityCellSize);if(z!==q||j!==H)for(let G=j;G<H;G++){const ee=this._scanlineGenerateVertexRingForCellRow(G,m,d);Fy(this._vertexBuffer,ee,i)}else i.push(...d)}return i}_scanlineGenerateVertexRingForCellRow(t,i,o){const c=t*this._granularityCellSize,d=c+this._granularityCellSize,m=[];for(let v=0;v<3;v++){const S=i[2*v],I=i[2*v+1],B=i[2*(v+1)%6],z=i[(2*(v+1)+1)%6],q=i[2*(v+2)%6],j=i[(2*(v+2)+1)%6],H=B-S,G=z-I,ee=H===0,le=G===0,ve=(c-I)/G,he=(d-I)/G,U=Math.min(ve,he),Y=Math.max(ve,he);if(!le&&(U>=1||Y<=0)||le&&(I<c||I>d)){z>=c&&z<=d&&m.push(o[(v+1)%3]);continue}!le&&U>0&&m.push(this._vertexToIndex(S+H*U,I+G*U));const pe=S+H*Math.max(U,0),Ee=S+H*Math.min(Y,1);ee||this._generateIntraEdgeVertices(m,S,I,B,z,pe,Ee),!le&&Y<1&&m.push(this._vertexToIndex(S+H*Y,I+G*Y)),(le||z>=c&&z<=d)&&m.push(o[(v+1)%3]),!le&&(z<=c||z>=d)&&this._generateInterEdgeVertices(m,S,I,B,z,q,j,Ee,c,d)}return m}_generateIntraEdgeVertices(t,i,o,c,d,m,v){const S=c-i,I=d-o,B=I===0,z=B?Math.min(i,c):Math.min(m,v),q=B?Math.max(i,c):Math.max(m,v),j=Math.floor(z/this._granularityCellSize)+1,H=Math.ceil(q/this._granularityCellSize)-1;if(B?i<c:m<v)for(let G=j;G<=H;G++){const ee=G*this._granularityCellSize;t.push(this._vertexToIndex(ee,o+I*(ee-i)/S))}else for(let G=H;G>=j;G--){const ee=G*this._granularityCellSize;t.push(this._vertexToIndex(ee,o+I*(ee-i)/S))}}_generateInterEdgeVertices(t,i,o,c,d,m,v,S,I,B){const z=d-o,q=m-c,j=v-d,H=(I-d)/j,G=(B-d)/j,ee=Math.min(H,G),le=Math.max(H,G),ve=c+q*ee;let he=Math.floor(Math.min(ve,S)/this._granularityCellSize)+1,U=Math.ceil(Math.max(ve,S)/this._granularityCellSize)-1,Y=S<ve;const pe=j===0;if(pe&&(v===I||v===B))return;if(pe||ee>=1||le<=0){const je=o-v,Me=m+(i-m)*Math.min((I-v)/je,(B-v)/je);he=Math.floor(Math.min(Me,S)/this._granularityCellSize)+1,U=Math.ceil(Math.max(Me,S)/this._granularityCellSize)-1,Y=S<Me}const Ee=z>0?B:I;if(Y)for(let je=he;je<=U;je++)t.push(this._vertexToIndex(je*this._granularityCellSize,Ee));else for(let je=U;je>=he;je--)t.push(this._vertexToIndex(je*this._granularityCellSize,Ee))}_generateOutline(t){const i=[];for(const o of t){const c=So(o,this._granularity,!0),d=this._pointArrayToIndices(c),m=[];for(let v=1;v<d.length;v++)m.push(d[v-1]),m.push(d[v]);i.push(m)}return i}_handlePoles(t){let i=!1,o=!1;this._canonical&&(this._canonical.y===0&&(i=!0),this._canonical.y===(1<<this._canonical.z)-1&&(o=!0)),(i||o)&&this._fillPoles(t,i,o)}_ensureNoPoleVertices(){const t=this._vertexBuffer;for(let i=0;i<t.length;i+=2){const o=t[i+1];o===ba&&(t[i+1]=-32767),o===Vl&&(t[i+1]=32766)}}_generatePoleQuad(t,i,o,c,d,m){c>d!=(m===ba)?(t.push(i),t.push(o),t.push(this._vertexToIndex(c,m)),t.push(o),t.push(this._vertexToIndex(d,m)),t.push(this._vertexToIndex(c,m))):(t.push(o),t.push(i),t.push(this._vertexToIndex(c,m)),t.push(this._vertexToIndex(d,m)),t.push(o),t.push(this._vertexToIndex(c,m)))}_fillPoles(t,i,o){const c=this._vertexBuffer,d=Jt,m=t.length;for(let v=2;v<m;v+=3){const S=t[v-2],I=t[v-1],B=t[v],z=c[2*S],q=c[2*S+1],j=c[2*I],H=c[2*I+1],G=c[2*B],ee=c[2*B+1];i&&(q===0&&H===0&&this._generatePoleQuad(t,S,I,z,j,ba),H===0&&ee===0&&this._generatePoleQuad(t,I,B,j,G,ba),ee===0&&q===0&&this._generatePoleQuad(t,B,S,G,z,ba)),o&&(q===d&&H===d&&this._generatePoleQuad(t,S,I,z,j,Vl),H===d&&ee===d&&this._generatePoleQuad(t,I,B,j,G,Vl),ee===d&&q===d&&this._generatePoleQuad(t,B,S,G,z,Vl))}}_initializeVertices(t){for(let i=0;i<t.length;i+=2)this._vertexToIndex(t[i],t[i+1])}subdividePolygonInternal(t,i){if(this._used)throw new Error("Subdivision: multiple use not allowed.");this._used=!0;const{flattened:o,holeIndices:c}=function(v){const S=[],I=[];for(const B of v)if(B.length!==0){B!==v[0]&&S.push(I.length/2);for(let z=0;z<B.length;z++)I.push(B[z].x),I.push(B[z].y)}return{flattened:I,holeIndices:S}}(t);let d;this._initializeVertices(o);try{const v=function(I,B,z=2){const q=B&&B.length,j=q?B[0]*z:I.length;let H=Md(I,0,j,z,!0);const G=[];if(!H||H.next===H.prev)return G;let ee,le,ve;if(q&&(H=function(he,U,Y,pe){const Ee=[];for(let je=0,Me=U.length;je<Me;je++){const ze=Md(he,U[je]*pe,je<Me-1?U[je+1]*pe:he.length,pe,!1);ze===ze.next&&(ze.steiner=!0),Ee.push(Dy(ze))}Ee.sort(Ly);for(let je=0;je<Ee.length;je++)Y=Ry(Ee[je],Y);return Y}(I,B,H,z)),I.length>80*z){ee=1/0,le=1/0;let he=-1/0,U=-1/0;for(let Y=z;Y<j;Y+=z){const pe=I[Y],Ee=I[Y+1];pe<ee&&(ee=pe),Ee<le&&(le=Ee),pe>he&&(he=pe),Ee>U&&(U=Ee)}ve=Math.max(he-ee,U-le),ve=ve!==0?32767/ve:0}return Ll(H,G,z,ee,le,ve,0),G}(o,c),S=this._convertIndices(o,v);d=this._subdivideTrianglesScanline(S)}catch(v){console.error(v)}let m=[];return i&&(m=this._generateOutline(t)),this._ensureNoPoleVertices(),this._handlePoles(d),{verticesFlattened:this._vertexBuffer,indicesTriangles:d,indicesLineList:m}}_convertIndices(t,i){const o=[];for(let c=0;c<i.length;c++)o.push(this._vertexToIndex(t[2*i[c]],t[2*i[c]+1]));return o}_pointArrayToIndices(t){const i=[];for(let o=0;o<t.length;o++){const c=t[o];i.push(this._vertexToIndex(c.x,c.y))}return i}}function Vd(n,t,i,o=!0){return new zy(i,t).subdividePolygonInternal(n,o)}function So(n,t,i=!1){if(!n||n.length<1)return[];if(n.length<2)return[];const o=n[0],c=n[n.length-1],d=i&&(o.x!==c.x||o.y!==c.y);if(t<2)return d?[...n,n[0]]:[...n];const m=Math.floor(Jt/t),v=[];v.push(new C(n[0].x,n[0].y));const S=n.length,I=d?S:S-1;for(let B=0;B<I;B++){const z=n[B],q=B<S-1?n[B+1]:n[0],j=z.x,H=z.y,G=q.x,ee=q.y,le=j!==G,ve=H!==ee;if(!le&&!ve)continue;const he=G-j,U=ee-H,Y=Math.abs(he),pe=Math.abs(U);let Ee=j,je=H;for(;;){const ze=he>0?(Math.floor(Ee/m)+1)*m:(Math.ceil(Ee/m)-1)*m,Ke=U>0?(Math.floor(je/m)+1)*m:(Math.ceil(je/m)-1)*m,We=Math.abs(Ee-ze),Je=Math.abs(je-Ke),Oe=Math.abs(Ee-G),st=Math.abs(je-ee),mt=le?We/Y:Number.POSITIVE_INFINITY,pt=ve?Je/pe:Number.POSITIVE_INFINITY;if((Oe<=We||!le)&&(st<=Je||!ve))break;if(mt<pt&&le||!ve){Ee=ze,je+=U*mt;const lt=new C(Ee,Math.round(je));v[v.length-1].x===lt.x&&v[v.length-1].y===lt.y||v.push(lt)}else{Ee+=he*pt,je=Ke;const lt=new C(Math.round(Ee),je);v[v.length-1].x===lt.x&&v[v.length-1].y===lt.y||v.push(lt)}}const Me=new C(G,ee);v[v.length-1].x===Me.x&&v[v.length-1].y===Me.y||v.push(Me)}return v}function Fy(n,t,i){if(t.length===0)throw new Error("Subdivision vertex ring is empty.");let o=0,c=n[2*t[0]];for(let S=1;S<t.length;S++){const I=n[2*t[S]];I<c&&(c=I,o=S)}const d=t.length;let m=o,v=(m+1)%d;for(;;){const S=m-1>=0?m-1:d-1,I=(v+1)%d,B=n[2*t[S]],z=n[2*t[I]],q=n[2*t[m]],j=n[2*t[m]+1],H=n[2*t[v]+1];let G=!1;if(B<z)G=!0;else if(B>z)G=!1;else{const ee=H-j,le=-(n[2*t[v]]-q),ve=j<H?1:-1;((B-q)*ee+(n[2*t[S]+1]-j)*le)*ve>((z-q)*ee+(n[2*t[I]+1]-j)*le)*ve&&(G=!0)}if(G){const ee=t[S],le=t[m],ve=t[v];ee!==le&&ee!==ve&&le!==ve&&i.push(ve,le,ee),m--,m<0&&(m=d-1)}else{const ee=t[I],le=t[m],ve=t[v];ee!==le&&ee!==ve&&le!==ve&&i.push(ve,le,ee),v++,v>=d&&(v=0)}if(S===I)break}}function zd(n,t,i,o,c,d,m,v,S){const I=c.length/2,B=m&&v&&S;if(I<Zt.MAX_VERTEX_ARRAY_LENGTH){const z=t.prepareSegment(I,i,o),q=z.vertexLength;for(let G=0;G<d.length;G+=3)o.emplaceBack(q+d[G],q+d[G+1],q+d[G+2]);let j,H;z.vertexLength+=I,z.primitiveLength+=d.length/3,B&&(H=m.prepareSegment(I,i,v),j=H.vertexLength,H.vertexLength+=I);for(let G=0;G<c.length;G+=2)n(c[G],c[G+1]);if(B)for(let G=0;G<S.length;G++){const ee=S[G];for(let le=1;le<ee.length;le+=2)v.emplaceBack(j+ee[le-1],j+ee[le]);H.primitiveLength+=ee.length/2}}else(function(z,q,j,H,G,ee){const le=[];for(let pe=0;pe<H.length/2;pe++)le.push(-1);const ve={count:0};let he=0,U=z.getOrCreateLatestSegment(q,j),Y=U.vertexLength;for(let pe=2;pe<G.length;pe+=3){const Ee=G[pe-2],je=G[pe-1],Me=G[pe];let ze=le[Ee]<he,Ke=le[je]<he,We=le[Me]<he;U.vertexLength+((ze?1:0)+(Ke?1:0)+(We?1:0))>Zt.MAX_VERTEX_ARRAY_LENGTH&&(U=z.createNewSegment(q,j),he=ve.count,ze=!0,Ke=!0,We=!0,Y=0);const Je=zl(le,H,ee,ve,Ee,ze,U),Oe=zl(le,H,ee,ve,je,Ke,U),st=zl(le,H,ee,ve,Me,We,U);j.emplaceBack(Y+Je-he,Y+Oe-he,Y+st-he),U.primitiveLength++}})(t,i,o,c,d,n),B&&function(z,q,j,H,G,ee){const le=[];for(let pe=0;pe<H.length/2;pe++)le.push(-1);const ve={count:0};let he=0,U=z.getOrCreateLatestSegment(q,j),Y=U.vertexLength;for(let pe=0;pe<G.length;pe++){const Ee=G[pe];for(let je=1;je<G[pe].length;je+=2){const Me=Ee[je-1],ze=Ee[je];let Ke=le[Me]<he,We=le[ze]<he;U.vertexLength+((Ke?1:0)+(We?1:0))>Zt.MAX_VERTEX_ARRAY_LENGTH&&(U=z.createNewSegment(q,j),he=ve.count,Ke=!0,We=!0,Y=0);const Je=zl(le,H,ee,ve,Me,Ke,U),Oe=zl(le,H,ee,ve,ze,We,U);j.emplaceBack(Y+Je-he,Y+Oe-he),U.primitiveLength++}}}(m,i,v,c,S,n),t.forceNewSegmentOnNextPrepare(),m==null||m.forceNewSegmentOnNextPrepare()}function zl(n,t,i,o,c,d,m){if(d){const v=o.count;return i(t[2*c],t[2*c+1]),n[c]=o.count,o.count++,m.vertexLength++,v}return n[c]}class ep{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(i=>i.id),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Xe,this.indexArray=new Ht,this.indexArray2=new jr,this.programConfigurations=new Rn(t.layers,t.zoom),this.segments=new Zt,this.segments2=new Zt,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(t,i,o){this.hasPattern=Xh("fill",this.layers,i);const c=this.layers[0].layout.get("fill-sort-key"),d=!c.isConstant(),m=[];for(const{feature:v,id:S,index:I,sourceLayerIndex:B}of t){const z=this.layers[0]._featureFilter.needGeometry,q=xo(v,z);if(!this.layers[0]._featureFilter.filter(new lr(this.zoom),q,o))continue;const j=d?c.evaluate(q,{},o,i.availableImages):void 0,H={id:S,properties:v.properties,type:v.type,sourceLayerIndex:B,index:I,geometry:z?q.geometry:vo(v),patterns:{},sortKey:j};m.push(H)}d&&m.sort((v,S)=>v.sortKey-S.sortKey);for(const v of m){const{geometry:S,index:I,sourceLayerIndex:B}=v;if(this.hasPattern){const z=Qh("fill",this.layers,v,this.zoom,i);this.patternFeatures.push(z)}else this.addFeature(v,S,I,o,{},i.subdivisionGranularity);i.featureIndex.insert(t[I].feature,S,I,B,this.index)}}update(t,i,o){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,i,this.stateDependentLayers,o)}addFeatures(t,i,o){for(const c of this.patternFeatures)this.addFeature(c,c.geometry,c.index,i,o,t.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ty),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,i,o,c,d,m){for(const v of jo(i,500)){const S=Vd(v,c,m.fill.getGranularityForZoomLevel(c.z)),I=this.layoutVertexArray;zd((B,z)=>{I.emplaceBack(B,z)},this.segments,this.layoutVertexArray,this.indexArray,S.verticesFlattened,S.indicesTriangles,this.segments2,this.indexArray2,S.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,o,d,c)}}let Fd,Od;nt("FillBucket",ep,{omit:["layers","patternFeatures"]});var Oy={get paint(){return Od=Od||new zr({"fill-antialias":new ct(te.paint_fill["fill-antialias"]),"fill-opacity":new yt(te.paint_fill["fill-opacity"]),"fill-color":new yt(te.paint_fill["fill-color"]),"fill-outline-color":new yt(te.paint_fill["fill-outline-color"]),"fill-translate":new ct(te.paint_fill["fill-translate"]),"fill-translate-anchor":new ct(te.paint_fill["fill-translate-anchor"]),"fill-pattern":new fo(te.paint_fill["fill-pattern"])})},get layout(){return Fd=Fd||new zr({"fill-sort-key":new yt(te.layout_fill["fill-sort-key"])})}};class Ny extends qi{constructor(t){super(t,Oy)}recalculate(t,i){super.recalculate(t,i);const o=this.paint._values["fill-outline-color"];o.value.kind==="constant"&&o.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new ep(t)}queryRadius(){return tu(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:t,geometry:i,transform:o,pixelsToTileUnits:c}){return xd(ru(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-o.bearingInRadians,c),i)}isTileClipped(){return!0}}const qy=fr([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Uy=fr([{name:"a_centroid",components:2,type:"Int16"}],4),{members:jy}=qy;var tp,Nd,rp,qd,ip,Ud,jd,ou={};function Wd(){if(Nd)return tp;Nd=1;var n=F();function t(c,d,m,v,S){this.properties={},this.extent=m,this.type=0,this._pbf=c,this._geometry=-1,this._keys=v,this._values=S,c.readFields(i,this,d)}function i(c,d,m){c==1?d.id=m.readVarint():c==2?function(v,S){for(var I=v.readVarint()+v.pos;v.pos<I;){var B=S._keys[v.readVarint()],z=S._values[v.readVarint()];S.properties[B]=z}}(m,d):c==3?d.type=m.readVarint():c==4&&(d._geometry=m.pos)}function o(c){for(var d,m,v=0,S=0,I=c.length,B=I-1;S<I;B=S++)v+=((m=c[B]).x-(d=c[S]).x)*(d.y+m.y);return v}return tp=t,t.types=["Unknown","Point","LineString","Polygon"],t.prototype.loadGeometry=function(){var c=this._pbf;c.pos=this._geometry;for(var d,m=c.readVarint()+c.pos,v=1,S=0,I=0,B=0,z=[];c.pos<m;){if(S<=0){var q=c.readVarint();v=7&q,S=q>>3}if(S--,v===1||v===2)I+=c.readSVarint(),B+=c.readSVarint(),v===1&&(d&&z.push(d),d=[]),d.push(new n(I,B));else{if(v!==7)throw new Error("unknown command "+v);d&&d.push(d[0].clone())}}return d&&z.push(d),z},t.prototype.bbox=function(){var c=this._pbf;c.pos=this._geometry;for(var d=c.readVarint()+c.pos,m=1,v=0,S=0,I=0,B=1/0,z=-1/0,q=1/0,j=-1/0;c.pos<d;){if(v<=0){var H=c.readVarint();m=7&H,v=H>>3}if(v--,m===1||m===2)(S+=c.readSVarint())<B&&(B=S),S>z&&(z=S),(I+=c.readSVarint())<q&&(q=I),I>j&&(j=I);else if(m!==7)throw new Error("unknown command "+m)}return[B,q,z,j]},t.prototype.toGeoJSON=function(c,d,m){var v,S,I=this.extent*Math.pow(2,m),B=this.extent*c,z=this.extent*d,q=this.loadGeometry(),j=t.types[this.type];function H(le){for(var ve=0;ve<le.length;ve++){var he=le[ve];le[ve]=[360*(he.x+B)/I-180,360/Math.PI*Math.atan(Math.exp((180-360*(he.y+z)/I)*Math.PI/180))-90]}}switch(this.type){case 1:var G=[];for(v=0;v<q.length;v++)G[v]=q[v][0];H(q=G);break;case 2:for(v=0;v<q.length;v++)H(q[v]);break;case 3:for(q=function(le){var ve=le.length;if(ve<=1)return[le];for(var he,U,Y=[],pe=0;pe<ve;pe++){var Ee=o(le[pe]);Ee!==0&&(U===void 0&&(U=Ee<0),U===Ee<0?(he&&Y.push(he),he=[le[pe]]):he.push(le[pe]))}return he&&Y.push(he),Y}(q),v=0;v<q.length;v++)for(S=0;S<q[v].length;S++)H(q[v][S])}q.length===1?q=q[0]:j="Multi"+j;var ee={type:"Feature",geometry:{type:j,coordinates:q},properties:this.properties};return"id"in this&&(ee.id=this.id),ee},tp}function Hd(){if(qd)return rp;qd=1;var n=Wd();function t(o,c){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=o,this._keys=[],this._values=[],this._features=[],o.readFields(i,this,c),this.length=this._features.length}function i(o,c,d){o===15?c.version=d.readVarint():o===1?c.name=d.readString():o===5?c.extent=d.readVarint():o===2?c._features.push(d.pos):o===3?c._keys.push(d.readString()):o===4&&c._values.push(function(m){for(var v=null,S=m.readVarint()+m.pos;m.pos<S;){var I=m.readVarint()>>3;v=I===1?m.readString():I===2?m.readFloat():I===3?m.readDouble():I===4?m.readVarint64():I===5?m.readVarint():I===6?m.readSVarint():I===7?m.readBoolean():null}return v}(d))}return rp=t,t.prototype.feature=function(o){if(o<0||o>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[o];var c=this._pbf.readVarint()+this._pbf.pos;return new n(this._pbf,c,this.extent,this._keys,this._values)},rp}function Zd(){return jd||(jd=1,ou.VectorTile=function(){if(Ud)return ip;Ud=1;var n=Hd();function t(i,o,c){if(i===3){var d=new n(c,c.readVarint()+c.pos);d.length&&(o[d.name]=d)}}return ip=function(i,o){this.layers=i.readFields(t,{},o)},ip}(),ou.VectorTileFeature=Wd(),ou.VectorTileLayer=Hd()),ou}var Fl=V(Zd());const Wy=Fl.VectorTileFeature.types,np=Math.pow(2,13);function Ol(n,t,i,o,c,d,m,v){n.emplaceBack(t,i,2*Math.floor(o*np)+m,c*np*2,d*np*2,Math.round(v))}class sp{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(i=>i.id),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new He,this.centroidVertexArray=new De,this.indexArray=new Ht,this.programConfigurations=new Rn(t.layers,t.zoom),this.segments=new Zt,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(t,i,o){this.features=[],this.hasPattern=Xh("fill-extrusion",this.layers,i);for(const{feature:c,id:d,index:m,sourceLayerIndex:v}of t){const S=this.layers[0]._featureFilter.needGeometry,I=xo(c,S);if(!this.layers[0]._featureFilter.filter(new lr(this.zoom),I,o))continue;const B={id:d,sourceLayerIndex:v,index:m,geometry:S?I.geometry:vo(c),properties:c.properties,type:c.type,patterns:{}};this.hasPattern?this.features.push(Qh("fill-extrusion",this.layers,B,this.zoom,i)):this.addFeature(B,B.geometry,m,o,{},i.subdivisionGranularity),i.featureIndex.insert(c,B.geometry,m,v,this.index,!0)}}addFeatures(t,i,o){for(const c of this.features){const{geometry:d}=c;this.addFeature(c,d,c.index,i,o,t.subdivisionGranularity)}}update(t,i,o){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,i,this.stateDependentLayers,o)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,jy),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,Uy.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,i,o,c,d,m){for(const v of jo(i,500)){const S={x:0,y:0,sampleCount:0},I=this.layoutVertexArray.length;this.processPolygon(S,c,t,v,m);const B=this.layoutVertexArray.length-I,z=Math.floor(S.x/S.sampleCount),q=Math.floor(S.y/S.sampleCount);for(let j=0;j<B;j++)this.centroidVertexArray.emplaceBack(z,q)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,o,d,c)}processPolygon(t,i,o,c,d){if(c.length<1||Kd(c[0]))return;for(const z of c)z.length!==0&&Hy(t,z);const m={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},v=d.fill.getGranularityForZoomLevel(i.z),S=Wy[o.type]==="Polygon";for(const z of c){if(z.length===0||Kd(z))continue;const q=So(z,v,S);this._generateSideFaces(q,m)}if(!S)return;const I=Vd(c,i,v,!1),B=this.layoutVertexArray;zd((z,q)=>{Ol(B,z,q,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,I.verticesFlattened,I.indicesTriangles)}_generateSideFaces(t,i){let o=0;for(let c=1;c<t.length;c++){const d=t[c],m=t[c-1];if(Zy(d,m))continue;i.segment.vertexLength+4>Zt.MAX_VERTEX_ARRAY_LENGTH&&(i.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const v=d.sub(m)._perp()._unit(),S=m.dist(d);o+S>32768&&(o=0),Ol(this.layoutVertexArray,d.x,d.y,v.x,v.y,0,0,o),Ol(this.layoutVertexArray,d.x,d.y,v.x,v.y,0,1,o),o+=S,Ol(this.layoutVertexArray,m.x,m.y,v.x,v.y,0,0,o),Ol(this.layoutVertexArray,m.x,m.y,v.x,v.y,0,1,o);const I=i.segment.vertexLength;this.indexArray.emplaceBack(I,I+2,I+1),this.indexArray.emplaceBack(I+1,I+2,I+3),i.segment.vertexLength+=4,i.segment.primitiveLength+=2}}}function Hy(n,t){for(let i=0;i<t.length;i++){const o=t[i];i===t.length-1&&t[0].x===o.x&&t[0].y===o.y||(n.x+=o.x,n.y+=o.y,n.sampleCount++)}}function Zy(n,t){return n.x===t.x&&(n.x<0||n.x>Jt)||n.y===t.y&&(n.y<0||n.y>Jt)}function Kd(n){return n.every(t=>t.x<0)||n.every(t=>t.x>Jt)||n.every(t=>t.y<0)||n.every(t=>t.y>Jt)}let Gd;nt("FillExtrusionBucket",sp,{omit:["layers","features"]});var Ky={get paint(){return Gd=Gd||new zr({"fill-extrusion-opacity":new ct(te["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new yt(te["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new ct(te["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new ct(te["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new fo(te["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new yt(te["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new yt(te["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new ct(te["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Gy extends qi{constructor(t){super(t,Ky)}createBucket(t){return new sp(t)}queryRadius(){return tu(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:t,feature:i,featureState:o,geometry:c,transform:d,pixelsToTileUnits:m,pixelPosMatrix:v}){const S=ru(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-d.bearingInRadians,m),I=this.paint.get("fill-extrusion-height").evaluate(i,o),B=this.paint.get("fill-extrusion-base").evaluate(i,o),z=function(j,H,G){const ee=[];for(const le of j){const ve=[le.x,le.y,0,1];Lt(ve,ve,H),ee.push(new C(ve[0]/ve[3],ve[1]/ve[3]))}return ee}(S,v),q=function(j,H,G,ee){const le=[],ve=[],he=ee[8]*H,U=ee[9]*H,Y=ee[10]*H,pe=ee[11]*H,Ee=ee[8]*G,je=ee[9]*G,Me=ee[10]*G,ze=ee[11]*G;for(const Ke of j){const We=[],Je=[];for(const Oe of Ke){const st=Oe.x,mt=Oe.y,pt=ee[0]*st+ee[4]*mt+ee[12],lt=ee[1]*st+ee[5]*mt+ee[13],Vt=ee[2]*st+ee[6]*mt+ee[14],Sr=ee[3]*st+ee[7]*mt+ee[15],Hr=Vt+Y,di=Sr+pe,Yi=pt+Ee,Di=lt+je,ni=Vt+Me,_r=Sr+ze,Qr=new C((pt+he)/di,(lt+U)/di);Qr.z=Hr/di,We.push(Qr);const si=new C(Yi/_r,Di/_r);si.z=ni/_r,Je.push(si)}le.push(We),ve.push(Je)}return[le,ve]}(c,B,I,v);return function(j,H,G){let ee=1/0;xd(G,H)&&(ee=Jd(G,H[0]));for(let le=0;le<H.length;le++){const ve=H[le],he=j[le];for(let U=0;U<ve.length-1;U++){const Y=ve[U],pe=[Y,ve[U+1],he[U+1],he[U],Y];vd(G,pe)&&(ee=Math.min(ee,Jd(G,pe)))}}return ee!==1/0&&ee}(q[0],q[1],z)}}function Nl(n,t){return n.x*t.x+n.y*t.y}function Jd(n,t){if(n.length===1){let i=0;const o=t[i++];let c;for(;!c||o.equals(c);)if(c=t[i++],!c)return 1/0;for(;i<t.length;i++){const d=t[i],m=n[0],v=c.sub(o),S=d.sub(o),I=m.sub(o),B=Nl(v,v),z=Nl(v,S),q=Nl(S,S),j=Nl(I,v),H=Nl(I,S),G=B*q-z*z,ee=(q*j-z*H)/G,le=(B*H-z*j)/G,ve=o.z*(1-ee-le)+c.z*ee+d.z*le;if(isFinite(ve))return ve}return 1/0}{let i=1/0;for(const o of t)i=Math.min(i,o.z);return i}}const Jy=fr([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:Xy}=Jy,Qy=fr([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:Yy}=Qy,$y=Fl.VectorTileFeature.types,e_=Math.cos(Math.PI/180*37.5),Xd=Math.pow(2,14)/.5;class op{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(i=>i.id),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(i=>{this.gradients[i.id]={}}),this.layoutVertexArray=new at,this.layoutVertexArray2=new Mt,this.indexArray=new Ht,this.programConfigurations=new Rn(t.layers,t.zoom),this.segments=new Zt,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(t,i,o){this.hasPattern=Xh("line",this.layers,i);const c=this.layers[0].layout.get("line-sort-key"),d=!c.isConstant(),m=[];for(const{feature:v,id:S,index:I,sourceLayerIndex:B}of t){const z=this.layers[0]._featureFilter.needGeometry,q=xo(v,z);if(!this.layers[0]._featureFilter.filter(new lr(this.zoom),q,o))continue;const j=d?c.evaluate(q,{},o):void 0,H={id:S,properties:v.properties,type:v.type,sourceLayerIndex:B,index:I,geometry:z?q.geometry:vo(v),patterns:{},sortKey:j};m.push(H)}d&&m.sort((v,S)=>v.sortKey-S.sortKey);for(const v of m){const{geometry:S,index:I,sourceLayerIndex:B}=v;if(this.hasPattern){const z=Qh("line",this.layers,v,this.zoom,i);this.patternFeatures.push(z)}else this.addFeature(v,S,I,o,{},i.subdivisionGranularity);i.featureIndex.insert(t[I].feature,S,I,B,this.index)}}update(t,i,o){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,i,this.stateDependentLayers,o)}addFeatures(t,i,o){for(const c of this.patternFeatures)this.addFeature(c,c.geometry,c.index,i,o,t.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,Yy)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Xy),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,i,o,c,d,m){const v=this.layers[0].layout,S=v.get("line-join").evaluate(t,{}),I=v.get("line-cap"),B=v.get("line-miter-limit"),z=v.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(const q of i)this.addLine(q,t,S,I,B,z,c,m);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,o,d,c)}addLine(t,i,o,c,d,m,v,S){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,t=So(t,v?S.line.getGranularityForZoomLevel(v.z):1),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let he=0;he<t.length-1;he++)this.totalDistance+=t[he].dist(t[he+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const I=$y[i.type]==="Polygon";let B=t.length;for(;B>=2&&t[B-1].equals(t[B-2]);)B--;let z=0;for(;z<B-1&&t[z].equals(t[z+1]);)z++;if(B<(I?3:2))return;o==="bevel"&&(d=1.05);const q=this.overscaling<=16?15*Jt/(512*this.overscaling):0,j=this.segments.prepareSegment(10*B,this.layoutVertexArray,this.indexArray);let H,G,ee,le,ve;this.e1=this.e2=-1,I&&(H=t[B-2],ve=t[z].sub(H)._unit()._perp());for(let he=z;he<B;he++){if(ee=he===B-1?I?t[z+1]:void 0:t[he+1],ee&&t[he].equals(ee))continue;ve&&(le=ve),H&&(G=H),H=t[he],ve=ee?ee.sub(H)._unit()._perp():le,le=le||ve;let U=le.add(ve);U.x===0&&U.y===0||U._unit();const Y=le.x*ve.x+le.y*ve.y,pe=U.x*ve.x+U.y*ve.y,Ee=pe!==0?1/pe:1/0,je=2*Math.sqrt(2-2*pe),Me=pe<e_&&G&&ee,ze=le.x*ve.y-le.y*ve.x>0;if(Me&&he>z){const Je=H.dist(G);if(Je>2*q){const Oe=H.sub(H.sub(G)._mult(q/Je)._round());this.updateDistance(G,Oe),this.addCurrentVertex(Oe,le,0,0,j),G=Oe}}const Ke=G&&ee;let We=Ke?o:I?"butt":c;if(Ke&&We==="round"&&(Ee<m?We="miter":Ee<=2&&(We="fakeround")),We==="miter"&&Ee>d&&(We="bevel"),We==="bevel"&&(Ee>2&&(We="flipbevel"),Ee<d&&(We="miter")),G&&this.updateDistance(G,H),We==="miter")U._mult(Ee),this.addCurrentVertex(H,U,0,0,j);else if(We==="flipbevel"){if(Ee>100)U=ve.mult(-1);else{const Je=Ee*le.add(ve).mag()/le.sub(ve).mag();U._perp()._mult(Je*(ze?-1:1))}this.addCurrentVertex(H,U,0,0,j),this.addCurrentVertex(H,U.mult(-1),0,0,j)}else if(We==="bevel"||We==="fakeround"){const Je=-Math.sqrt(Ee*Ee-1),Oe=ze?Je:0,st=ze?0:Je;if(G&&this.addCurrentVertex(H,le,Oe,st,j),We==="fakeround"){const mt=Math.round(180*je/Math.PI/20);for(let pt=1;pt<mt;pt++){let lt=pt/mt;if(lt!==.5){const Sr=lt-.5;lt+=lt*Sr*(lt-1)*((1.0904+Y*(Y*(3.55645-1.43519*Y)-3.2452))*Sr*Sr+(.848013+Y*(.215638*Y-1.06021)))}const Vt=ve.sub(le)._mult(lt)._add(le)._unit()._mult(ze?-1:1);this.addHalfVertex(H,Vt.x,Vt.y,!1,ze,0,j)}}ee&&this.addCurrentVertex(H,ve,-Oe,-st,j)}else if(We==="butt")this.addCurrentVertex(H,U,0,0,j);else if(We==="square"){const Je=G?1:-1;this.addCurrentVertex(H,U,Je,Je,j)}else We==="round"&&(G&&(this.addCurrentVertex(H,le,0,0,j),this.addCurrentVertex(H,le,1,1,j,!0)),ee&&(this.addCurrentVertex(H,ve,-1,-1,j,!0),this.addCurrentVertex(H,ve,0,0,j)));if(Me&&he<B-1){const Je=H.dist(ee);if(Je>2*q){const Oe=H.add(ee.sub(H)._mult(q/Je)._round());this.updateDistance(H,Oe),this.addCurrentVertex(Oe,ve,0,0,j),H=Oe}}}}addCurrentVertex(t,i,o,c,d,m=!1){const v=i.y*c-i.x,S=-i.y-i.x*c;this.addHalfVertex(t,i.x+i.y*o,i.y-i.x*o,m,!1,o,d),this.addHalfVertex(t,v,S,m,!0,-c,d),this.distance>Xd/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,i,o,c,d,m))}addHalfVertex({x:t,y:i},o,c,d,m,v,S){const I=.5*(this.lineClips?this.scaledDistance*(Xd-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t<<1)+(d?1:0),(i<<1)+(m?1:0),Math.round(63*o)+128,Math.round(63*c)+128,1+(v===0?0:v<0?-1:1)|(63&I)<<2,I>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const B=S.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,B,this.e2),S.primitiveLength++),m?this.e2=B:this.e1=B}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,i){this.distance+=t.dist(i),this.updateScaledDistance()}}let Qd,Yd;nt("LineBucket",op,{omit:["layers","patternFeatures"]});var $d={get paint(){return Yd=Yd||new zr({"line-opacity":new yt(te.paint_line["line-opacity"]),"line-color":new yt(te.paint_line["line-color"]),"line-translate":new ct(te.paint_line["line-translate"]),"line-translate-anchor":new ct(te.paint_line["line-translate-anchor"]),"line-width":new yt(te.paint_line["line-width"]),"line-gap-width":new yt(te.paint_line["line-gap-width"]),"line-offset":new yt(te.paint_line["line-offset"]),"line-blur":new yt(te.paint_line["line-blur"]),"line-dasharray":new wl(te.paint_line["line-dasharray"]),"line-pattern":new fo(te.paint_line["line-pattern"]),"line-gradient":new Sl(te.paint_line["line-gradient"])})},get layout(){return Qd=Qd||new zr({"line-cap":new ct(te.layout_line["line-cap"]),"line-join":new yt(te.layout_line["line-join"]),"line-miter-limit":new ct(te.layout_line["line-miter-limit"]),"line-round-limit":new ct(te.layout_line["line-round-limit"]),"line-sort-key":new yt(te.layout_line["line-sort-key"])})}};class t_ extends yt{possiblyEvaluate(t,i){return i=new lr(Math.floor(i.zoom),{now:i.now,fadeDuration:i.fadeDuration,zoomHistory:i.zoomHistory,transition:i.transition}),super.possiblyEvaluate(t,i)}evaluate(t,i,o,c){return i=Qe({},i,{zoom:Math.floor(i.zoom)}),super.evaluate(t,i,o,c)}}let au;class r_ extends qi{constructor(t){super(t,$d),this.gradientVersion=0,au||(au=new t_($d.paint.properties["line-width"].specification),au.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if(t==="line-gradient"){const i=this.gradientExpression();this.stepInterpolant=!!function(o){return o._styleExpression!==void 0}(i)&&i._styleExpression.expression instanceof An,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,i){super.recalculate(t,i),this.paint._values["line-floorwidth"]=au.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new op(t)}queryRadius(t){const i=t,o=ef(Il("line-width",this,i),Il("line-gap-width",this,i)),c=Il("line-offset",this,i);return o/2+Math.abs(c)+tu(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:t,feature:i,featureState:o,geometry:c,transform:d,pixelsToTileUnits:m}){const v=ru(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-d.bearingInRadians,m),S=m/2*ef(this.paint.get("line-width").evaluate(i,o),this.paint.get("line-gap-width").evaluate(i,o)),I=this.paint.get("line-offset").evaluate(i,o);return I&&(c=function(B,z){const q=[];for(let j=0;j<B.length;j++){const H=B[j],G=[];for(let ee=0;ee<H.length;ee++){const le=H[ee-1],ve=H[ee],he=H[ee+1],U=ee===0?new C(0,0):ve.sub(le)._unit()._perp(),Y=ee===H.length-1?new C(0,0):he.sub(ve)._unit()._perp(),pe=U._add(Y)._unit(),Ee=pe.x*Y.x+pe.y*Y.y;Ee!==0&&pe._mult(1/Ee),G.push(pe._mult(z)._add(ve))}q.push(G)}return q}(c,I*m)),function(B,z,q){for(let j=0;j<z.length;j++){const H=z[j];if(B.length>=3){for(let G=0;G<H.length;G++)if(bo(B,H[G]))return!0}if(yy(B,H,q))return!0}return!1}(v,c,S)}isTileClipped(){return!0}}function ef(n,t){return t>0?t+2*n:n}const i_=fr([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),n_=fr([{name:"a_projected_pos",components:3,type:"Float32"}],4);fr([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const s_=fr([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);fr([{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"}]);const tf=fr([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),o_=fr([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function a_(n,t,i){return n.sections.forEach(o=>{o.text=function(c,d,m){const v=d.layout.get("text-transform").evaluate(m,{});return v==="uppercase"?c=c.toLocaleUpperCase():v==="lowercase"&&(c=c.toLocaleLowerCase()),fn.applyArabicShaping&&(c=fn.applyArabicShaping(c)),c}(o.text,t,i)}),n}fr([{name:"triangle",components:3,type:"Uint16"}]),fr([{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"}]),fr([{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"}]),fr([{type:"Float32",name:"offsetX"}]),fr([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),fr([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const ql={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var rf,ap,nf,Wr=24,lp={};function l_(){return rf||(rf=1,lp.read=function(n,t,i,o,c){var d,m,v=8*c-o-1,S=(1<<v)-1,I=S>>1,B=-7,z=i?c-1:0,q=i?-1:1,j=n[t+z];for(z+=q,d=j&(1<<-B)-1,j>>=-B,B+=v;B>0;d=256*d+n[t+z],z+=q,B-=8);for(m=d&(1<<-B)-1,d>>=-B,B+=o;B>0;m=256*m+n[t+z],z+=q,B-=8);if(d===0)d=1-I;else{if(d===S)return m?NaN:1/0*(j?-1:1);m+=Math.pow(2,o),d-=I}return(j?-1:1)*m*Math.pow(2,d-o)},lp.write=function(n,t,i,o,c,d){var m,v,S,I=8*d-c-1,B=(1<<I)-1,z=B>>1,q=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,j=o?0:d-1,H=o?1:-1,G=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(v=isNaN(t)?1:0,m=B):(m=Math.floor(Math.log(t)/Math.LN2),t*(S=Math.pow(2,-m))<1&&(m--,S*=2),(t+=m+z>=1?q/S:q*Math.pow(2,1-z))*S>=2&&(m++,S/=2),m+z>=B?(v=0,m=B):m+z>=1?(v=(t*S-1)*Math.pow(2,c),m+=z):(v=t*Math.pow(2,z-1)*Math.pow(2,c),m=0));c>=8;n[i+j]=255&v,j+=H,v/=256,c-=8);for(m=m<<c|v,I+=c;I>0;n[i+j]=255&m,j+=H,m/=256,I-=8);n[i+j-H]|=128*G}),lp}function sf(){if(nf)return ap;nf=1,ap=t;var n=l_();function t(U){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(U)?U:new Uint8Array(U||0),this.pos=0,this.type=0,this.length=this.buf.length}t.Varint=0,t.Fixed64=1,t.Bytes=2,t.Fixed32=5;var i=4294967296,o=1/i,c=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function d(U){return U.type===t.Bytes?U.readVarint()+U.pos:U.pos+1}function m(U,Y,pe){return pe?4294967296*Y+(U>>>0):4294967296*(Y>>>0)+(U>>>0)}function v(U,Y,pe){var Ee=Y<=16383?1:Y<=2097151?2:Y<=268435455?3:Math.floor(Math.log(Y)/(7*Math.LN2));pe.realloc(Ee);for(var je=pe.pos-1;je>=U;je--)pe.buf[je+Ee]=pe.buf[je]}function S(U,Y){for(var pe=0;pe<U.length;pe++)Y.writeVarint(U[pe])}function I(U,Y){for(var pe=0;pe<U.length;pe++)Y.writeSVarint(U[pe])}function B(U,Y){for(var pe=0;pe<U.length;pe++)Y.writeFloat(U[pe])}function z(U,Y){for(var pe=0;pe<U.length;pe++)Y.writeDouble(U[pe])}function q(U,Y){for(var pe=0;pe<U.length;pe++)Y.writeBoolean(U[pe])}function j(U,Y){for(var pe=0;pe<U.length;pe++)Y.writeFixed32(U[pe])}function H(U,Y){for(var pe=0;pe<U.length;pe++)Y.writeSFixed32(U[pe])}function G(U,Y){for(var pe=0;pe<U.length;pe++)Y.writeFixed64(U[pe])}function ee(U,Y){for(var pe=0;pe<U.length;pe++)Y.writeSFixed64(U[pe])}function le(U,Y){return(U[Y]|U[Y+1]<<8|U[Y+2]<<16)+16777216*U[Y+3]}function ve(U,Y,pe){U[pe]=Y,U[pe+1]=Y>>>8,U[pe+2]=Y>>>16,U[pe+3]=Y>>>24}function he(U,Y){return(U[Y]|U[Y+1]<<8|U[Y+2]<<16)+(U[Y+3]<<24)}return t.prototype={destroy:function(){this.buf=null},readFields:function(U,Y,pe){for(pe=pe||this.length;this.pos<pe;){var Ee=this.readVarint(),je=Ee>>3,Me=this.pos;this.type=7&Ee,U(je,Y,this),this.pos===Me&&this.skip(Ee)}return Y},readMessage:function(U,Y){return this.readFields(U,Y,this.readVarint()+this.pos)},readFixed32:function(){var U=le(this.buf,this.pos);return this.pos+=4,U},readSFixed32:function(){var U=he(this.buf,this.pos);return this.pos+=4,U},readFixed64:function(){var U=le(this.buf,this.pos)+le(this.buf,this.pos+4)*i;return this.pos+=8,U},readSFixed64:function(){var U=le(this.buf,this.pos)+he(this.buf,this.pos+4)*i;return this.pos+=8,U},readFloat:function(){var U=n.read(this.buf,this.pos,!0,23,4);return this.pos+=4,U},readDouble:function(){var U=n.read(this.buf,this.pos,!0,52,8);return this.pos+=8,U},readVarint:function(U){var Y,pe,Ee=this.buf;return Y=127&(pe=Ee[this.pos++]),pe<128?Y:(Y|=(127&(pe=Ee[this.pos++]))<<7,pe<128?Y:(Y|=(127&(pe=Ee[this.pos++]))<<14,pe<128?Y:(Y|=(127&(pe=Ee[this.pos++]))<<21,pe<128?Y:function(je,Me,ze){var Ke,We,Je=ze.buf;if(Ke=(112&(We=Je[ze.pos++]))>>4,We<128||(Ke|=(127&(We=Je[ze.pos++]))<<3,We<128)||(Ke|=(127&(We=Je[ze.pos++]))<<10,We<128)||(Ke|=(127&(We=Je[ze.pos++]))<<17,We<128)||(Ke|=(127&(We=Je[ze.pos++]))<<24,We<128)||(Ke|=(1&(We=Je[ze.pos++]))<<31,We<128))return m(je,Ke,Me);throw new Error("Expected varint not more than 10 bytes")}(Y|=(15&(pe=Ee[this.pos]))<<28,U,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var U=this.readVarint();return U%2==1?(U+1)/-2:U/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var U=this.readVarint()+this.pos,Y=this.pos;return this.pos=U,U-Y>=12&&c?function(pe,Ee,je){return c.decode(pe.subarray(Ee,je))}(this.buf,Y,U):function(pe,Ee,je){for(var Me="",ze=Ee;ze<je;){var Ke,We,Je,Oe=pe[ze],st=null,mt=Oe>239?4:Oe>223?3:Oe>191?2:1;if(ze+mt>je)break;mt===1?Oe<128&&(st=Oe):mt===2?(192&(Ke=pe[ze+1]))==128&&(st=(31&Oe)<<6|63&Ke)<=127&&(st=null):mt===3?(We=pe[ze+2],(192&(Ke=pe[ze+1]))==128&&(192&We)==128&&((st=(15&Oe)<<12|(63&Ke)<<6|63&We)<=2047||st>=55296&&st<=57343)&&(st=null)):mt===4&&(We=pe[ze+2],Je=pe[ze+3],(192&(Ke=pe[ze+1]))==128&&(192&We)==128&&(192&Je)==128&&((st=(15&Oe)<<18|(63&Ke)<<12|(63&We)<<6|63&Je)<=65535||st>=1114112)&&(st=null)),st===null?(st=65533,mt=1):st>65535&&(st-=65536,Me+=String.fromCharCode(st>>>10&1023|55296),st=56320|1023&st),Me+=String.fromCharCode(st),ze+=mt}return Me}(this.buf,Y,U)},readBytes:function(){var U=this.readVarint()+this.pos,Y=this.buf.subarray(this.pos,U);return this.pos=U,Y},readPackedVarint:function(U,Y){if(this.type!==t.Bytes)return U.push(this.readVarint(Y));var pe=d(this);for(U=U||[];this.pos<pe;)U.push(this.readVarint(Y));return U},readPackedSVarint:function(U){if(this.type!==t.Bytes)return U.push(this.readSVarint());var Y=d(this);for(U=U||[];this.pos<Y;)U.push(this.readSVarint());return U},readPackedBoolean:function(U){if(this.type!==t.Bytes)return U.push(this.readBoolean());var Y=d(this);for(U=U||[];this.pos<Y;)U.push(this.readBoolean());return U},readPackedFloat:function(U){if(this.type!==t.Bytes)return U.push(this.readFloat());var Y=d(this);for(U=U||[];this.pos<Y;)U.push(this.readFloat());return U},readPackedDouble:function(U){if(this.type!==t.Bytes)return U.push(this.readDouble());var Y=d(this);for(U=U||[];this.pos<Y;)U.push(this.readDouble());return U},readPackedFixed32:function(U){if(this.type!==t.Bytes)return U.push(this.readFixed32());var Y=d(this);for(U=U||[];this.pos<Y;)U.push(this.readFixed32());return U},readPackedSFixed32:function(U){if(this.type!==t.Bytes)return U.push(this.readSFixed32());var Y=d(this);for(U=U||[];this.pos<Y;)U.push(this.readSFixed32());return U},readPackedFixed64:function(U){if(this.type!==t.Bytes)return U.push(this.readFixed64());var Y=d(this);for(U=U||[];this.pos<Y;)U.push(this.readFixed64());return U},readPackedSFixed64:function(U){if(this.type!==t.Bytes)return U.push(this.readSFixed64());var Y=d(this);for(U=U||[];this.pos<Y;)U.push(this.readSFixed64());return U},skip:function(U){var Y=7&U;if(Y===t.Varint)for(;this.buf[this.pos++]>127;);else if(Y===t.Bytes)this.pos=this.readVarint()+this.pos;else if(Y===t.Fixed32)this.pos+=4;else{if(Y!==t.Fixed64)throw new Error("Unimplemented type: "+Y);this.pos+=8}},writeTag:function(U,Y){this.writeVarint(U<<3|Y)},realloc:function(U){for(var Y=this.length||16;Y<this.pos+U;)Y*=2;if(Y!==this.length){var pe=new Uint8Array(Y);pe.set(this.buf),this.buf=pe,this.length=Y}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(U){this.realloc(4),ve(this.buf,U,this.pos),this.pos+=4},writeSFixed32:function(U){this.realloc(4),ve(this.buf,U,this.pos),this.pos+=4},writeFixed64:function(U){this.realloc(8),ve(this.buf,-1&U,this.pos),ve(this.buf,Math.floor(U*o),this.pos+4),this.pos+=8},writeSFixed64:function(U){this.realloc(8),ve(this.buf,-1&U,this.pos),ve(this.buf,Math.floor(U*o),this.pos+4),this.pos+=8},writeVarint:function(U){(U=+U||0)>268435455||U<0?function(Y,pe){var Ee,je;if(Y>=0?(Ee=Y%4294967296|0,je=Y/4294967296|0):(je=~(-Y/4294967296),4294967295^(Ee=~(-Y%4294967296))?Ee=Ee+1|0:(Ee=0,je=je+1|0)),Y>=18446744073709552e3||Y<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");pe.realloc(10),function(Me,ze,Ke){Ke.buf[Ke.pos++]=127&Me|128,Me>>>=7,Ke.buf[Ke.pos++]=127&Me|128,Me>>>=7,Ke.buf[Ke.pos++]=127&Me|128,Me>>>=7,Ke.buf[Ke.pos++]=127&Me|128,Ke.buf[Ke.pos]=127&(Me>>>=7)}(Ee,0,pe),function(Me,ze){var Ke=(7&Me)<<4;ze.buf[ze.pos++]|=Ke|((Me>>>=3)?128:0),Me&&(ze.buf[ze.pos++]=127&Me|((Me>>>=7)?128:0),Me&&(ze.buf[ze.pos++]=127&Me|((Me>>>=7)?128:0),Me&&(ze.buf[ze.pos++]=127&Me|((Me>>>=7)?128:0),Me&&(ze.buf[ze.pos++]=127&Me|((Me>>>=7)?128:0),Me&&(ze.buf[ze.pos++]=127&Me)))))}(je,pe)}(U,this):(this.realloc(4),this.buf[this.pos++]=127&U|(U>127?128:0),U<=127||(this.buf[this.pos++]=127&(U>>>=7)|(U>127?128:0),U<=127||(this.buf[this.pos++]=127&(U>>>=7)|(U>127?128:0),U<=127||(this.buf[this.pos++]=U>>>7&127))))},writeSVarint:function(U){this.writeVarint(U<0?2*-U-1:2*U)},writeBoolean:function(U){this.writeVarint(!!U)},writeString:function(U){U=String(U),this.realloc(4*U.length),this.pos++;var Y=this.pos;this.pos=function(Ee,je,Me){for(var ze,Ke,We=0;We<je.length;We++){if((ze=je.charCodeAt(We))>55295&&ze<57344){if(!Ke){ze>56319||We+1===je.length?(Ee[Me++]=239,Ee[Me++]=191,Ee[Me++]=189):Ke=ze;continue}if(ze<56320){Ee[Me++]=239,Ee[Me++]=191,Ee[Me++]=189,Ke=ze;continue}ze=Ke-55296<<10|ze-56320|65536,Ke=null}else Ke&&(Ee[Me++]=239,Ee[Me++]=191,Ee[Me++]=189,Ke=null);ze<128?Ee[Me++]=ze:(ze<2048?Ee[Me++]=ze>>6|192:(ze<65536?Ee[Me++]=ze>>12|224:(Ee[Me++]=ze>>18|240,Ee[Me++]=ze>>12&63|128),Ee[Me++]=ze>>6&63|128),Ee[Me++]=63&ze|128)}return Me}(this.buf,U,this.pos);var pe=this.pos-Y;pe>=128&&v(Y,pe,this),this.pos=Y-1,this.writeVarint(pe),this.pos+=pe},writeFloat:function(U){this.realloc(4),n.write(this.buf,U,this.pos,!0,23,4),this.pos+=4},writeDouble:function(U){this.realloc(8),n.write(this.buf,U,this.pos,!0,52,8),this.pos+=8},writeBytes:function(U){var Y=U.length;this.writeVarint(Y),this.realloc(Y);for(var pe=0;pe<Y;pe++)this.buf[this.pos++]=U[pe]},writeRawMessage:function(U,Y){this.pos++;var pe=this.pos;U(Y,this);var Ee=this.pos-pe;Ee>=128&&v(pe,Ee,this),this.pos=pe-1,this.writeVarint(Ee),this.pos+=Ee},writeMessage:function(U,Y,pe){this.writeTag(U,t.Bytes),this.writeRawMessage(Y,pe)},writePackedVarint:function(U,Y){Y.length&&this.writeMessage(U,S,Y)},writePackedSVarint:function(U,Y){Y.length&&this.writeMessage(U,I,Y)},writePackedBoolean:function(U,Y){Y.length&&this.writeMessage(U,q,Y)},writePackedFloat:function(U,Y){Y.length&&this.writeMessage(U,B,Y)},writePackedDouble:function(U,Y){Y.length&&this.writeMessage(U,z,Y)},writePackedFixed32:function(U,Y){Y.length&&this.writeMessage(U,j,Y)},writePackedSFixed32:function(U,Y){Y.length&&this.writeMessage(U,H,Y)},writePackedFixed64:function(U,Y){Y.length&&this.writeMessage(U,G,Y)},writePackedSFixed64:function(U,Y){Y.length&&this.writeMessage(U,ee,Y)},writeBytesField:function(U,Y){this.writeTag(U,t.Bytes),this.writeBytes(Y)},writeFixed32Field:function(U,Y){this.writeTag(U,t.Fixed32),this.writeFixed32(Y)},writeSFixed32Field:function(U,Y){this.writeTag(U,t.Fixed32),this.writeSFixed32(Y)},writeFixed64Field:function(U,Y){this.writeTag(U,t.Fixed64),this.writeFixed64(Y)},writeSFixed64Field:function(U,Y){this.writeTag(U,t.Fixed64),this.writeSFixed64(Y)},writeVarintField:function(U,Y){this.writeTag(U,t.Varint),this.writeVarint(Y)},writeSVarintField:function(U,Y){this.writeTag(U,t.Varint),this.writeSVarint(Y)},writeStringField:function(U,Y){this.writeTag(U,t.Bytes),this.writeString(Y)},writeFloatField:function(U,Y){this.writeTag(U,t.Fixed32),this.writeFloat(Y)},writeDoubleField:function(U,Y){this.writeTag(U,t.Fixed64),this.writeDouble(Y)},writeBooleanField:function(U,Y){this.writeVarintField(U,!!Y)}},ap}var cp=V(sf());const up=3;function c_(n,t,i){n===1&&i.readMessage(u_,t)}function u_(n,t,i){if(n===3){const{id:o,bitmap:c,width:d,height:m,left:v,top:S,advance:I}=i.readMessage(h_,{});t.push({id:o,bitmap:new Ml({width:d+2*up,height:m+2*up},c),metrics:{width:d,height:m,left:v,top:S,advance:I}})}}function h_(n,t,i){n===1?t.id=i.readVarint():n===2?t.bitmap=i.readBytes():n===3?t.width=i.readVarint():n===4?t.height=i.readVarint():n===5?t.left=i.readSVarint():n===6?t.top=i.readSVarint():n===7&&(t.advance=i.readVarint())}const p_=up;function of(n){let t=0,i=0;for(const m of n)t+=m.w*m.h,i=Math.max(i,m.w);n.sort((m,v)=>v.h-m.h);const o=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),i),h:1/0}];let c=0,d=0;for(const m of n)for(let v=o.length-1;v>=0;v--){const S=o[v];if(!(m.w>S.w||m.h>S.h)){if(m.x=S.x,m.y=S.y,d=Math.max(d,m.y+m.h),c=Math.max(c,m.x+m.w),m.w===S.w&&m.h===S.h){const I=o.pop();v<o.length&&(o[v]=I)}else m.h===S.h?(S.x+=m.w,S.w-=m.w):m.w===S.w?(S.y+=m.h,S.h-=m.h):(o.push({x:S.x+m.w,y:S.y,w:S.w-m.w,h:m.h}),S.y+=m.h,S.h-=m.h);break}}return{w:c,h:d,fill:t/(c*d)||0}}const Bi=1;class hp{constructor(t,{pixelRatio:i,version:o,stretchX:c,stretchY:d,content:m,textFitWidth:v,textFitHeight:S}){this.paddedRect=t,this.pixelRatio=i,this.stretchX=c,this.stretchY=d,this.content=m,this.version=o,this.textFitWidth=v,this.textFitHeight=S}get tl(){return[this.paddedRect.x+Bi,this.paddedRect.y+Bi]}get br(){return[this.paddedRect.x+this.paddedRect.w-Bi,this.paddedRect.y+this.paddedRect.h-Bi]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2*Bi)/this.pixelRatio,(this.paddedRect.h-2*Bi)/this.pixelRatio]}}class af{constructor(t,i){const o={},c={};this.haveRenderCallbacks=[];const d=[];this.addImages(t,o,d),this.addImages(i,c,d);const{w:m,h:v}=of(d),S=new Xi({width:m||1,height:v||1});for(const I in t){const B=t[I],z=o[I].paddedRect;Xi.copy(B.data,S,{x:0,y:0},{x:z.x+Bi,y:z.y+Bi},B.data)}for(const I in i){const B=i[I],z=c[I].paddedRect,q=z.x+Bi,j=z.y+Bi,H=B.data.width,G=B.data.height;Xi.copy(B.data,S,{x:0,y:0},{x:q,y:j},B.data),Xi.copy(B.data,S,{x:0,y:G-1},{x:q,y:j-1},{width:H,height:1}),Xi.copy(B.data,S,{x:0,y:0},{x:q,y:j+G},{width:H,height:1}),Xi.copy(B.data,S,{x:H-1,y:0},{x:q-1,y:j},{width:1,height:G}),Xi.copy(B.data,S,{x:0,y:0},{x:q+H,y:j},{width:1,height:G})}this.image=S,this.iconPositions=o,this.patternPositions=c}addImages(t,i,o){for(const c in t){const d=t[c],m={x:0,y:0,w:d.data.width+2*Bi,h:d.data.height+2*Bi};o.push(m),i[c]=new hp(m,d),d.hasRenderCallback&&this.haveRenderCallbacks.push(c)}}patchUpdatedImages(t,i){t.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const o in t.updatedImages)this.patchUpdatedImage(this.iconPositions[o],t.getImage(o),i),this.patchUpdatedImage(this.patternPositions[o],t.getImage(o),i)}patchUpdatedImage(t,i,o){if(!t||!i||t.version===i.version)return;t.version=i.version;const[c,d]=t.tl;o.update(i.data,void 0,{x:c,y:d})}}var Ls;nt("ImagePosition",hp),nt("ImageAtlas",af),x.al=void 0,(Ls=x.al||(x.al={}))[Ls.none=0]="none",Ls[Ls.horizontal=1]="horizontal",Ls[Ls.vertical=2]="vertical",Ls[Ls.horizontalOnly=3]="horizontalOnly";const lu=-17;class Ul{constructor(){this.scale=1,this.fontStack="",this.imageName=null,this.verticalAlign="bottom"}static forText(t,i,o){const c=new Ul;return c.scale=t||1,c.fontStack=i,c.verticalAlign=o||"bottom",c}static forImage(t,i){const o=new Ul;return o.imageName=t,o.verticalAlign=i||"bottom",o}}class wa{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(t,i){const o=new wa;for(let c=0;c<t.sections.length;c++){const d=t.sections[c];d.image?o.addImageSection(d):o.addTextSection(d,i)}return o}length(){return this.text.length}getSection(t){return this.sections[this.sectionIndex[t]]}getSectionIndex(t){return this.sectionIndex[t]}getCharCode(t){return this.text.charCodeAt(t)}verticalizePunctuation(){this.text=function(t){let i="";for(let o=0;o<t.length;o++){const c=t.charCodeAt(o+1)||null,d=t.charCodeAt(o-1)||null;i+=c&&ho(c)&&!ql[t[o+1]]||d&&ho(d)&&!ql[t[o-1]]||!ql[t[o]]?t[o]:ql[t[o]]}return i}(this.text)}trim(){let t=0;for(let o=0;o<this.text.length&&uu[this.text.charCodeAt(o)];o++)t++;let i=this.text.length;for(let o=this.text.length-1;o>=0&&o>=t&&uu[this.text.charCodeAt(o)];o--)i--;this.text=this.text.substring(t,i),this.sectionIndex=this.sectionIndex.slice(t,i)}substring(t,i){const o=new wa;return o.text=this.text.substring(t,i),o.sectionIndex=this.sectionIndex.slice(t,i),o.sections=this.sections,o}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((t,i)=>Math.max(t,this.sections[i].scale),0)}getMaxImageSize(t){let i=0,o=0;for(let c=0;c<this.length();c++){const d=this.getSection(c);if(d.imageName){const m=t[d.imageName];if(!m)continue;const v=m.displaySize;i=Math.max(i,v[0]),o=Math.max(o,v[1])}}return{maxImageWidth:i,maxImageHeight:o}}addTextSection(t,i){this.text+=t.text,this.sections.push(Ul.forText(t.scale,t.fontStack||i,t.verticalAlign));const o=this.sections.length-1;for(let c=0;c<t.text.length;++c)this.sectionIndex.push(o)}addImageSection(t){const i=t.image?t.image.name:"";if(i.length===0)return void _t("Can't add FormattedSection with an empty image.");const o=this.getNextImageSectionCharCode();o?(this.text+=String.fromCharCode(o),this.sections.push(Ul.forImage(i,t.verticalAlign)),this.sectionIndex.push(this.sections.length-1)):_t("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function cu(n,t,i,o,c,d,m,v,S,I,B,z,q,j,H){const G=wa.fromFeature(n,c);let ee;z===x.al.vertical&&G.verticalizePunctuation();const{processBidirectionalText:le,processStyledBidirectionalText:ve}=fn;if(le&&G.sections.length===1){ee=[];const Y=le(G.toString(),pp(G,I,d,t,o,j));for(const pe of Y){const Ee=new wa;Ee.text=pe,Ee.sections=G.sections;for(let je=0;je<pe.length;je++)Ee.sectionIndex.push(0);ee.push(Ee)}}else if(ve){ee=[];const Y=ve(G.text,G.sectionIndex,pp(G,I,d,t,o,j));for(const pe of Y){const Ee=new wa;Ee.text=pe[0],Ee.sectionIndex=pe[1],Ee.sections=G.sections,ee.push(Ee)}}else ee=function(Y,pe){const Ee=[],je=Y.text;let Me=0;for(const ze of pe)Ee.push(Y.substring(Me,ze)),Me=ze;return Me<je.length&&Ee.push(Y.substring(Me,je.length)),Ee}(G,pp(G,I,d,t,o,j));const he=[],U={positionedLines:he,text:G.toString(),top:B[1],bottom:B[1],left:B[0],right:B[0],writingMode:z,iconsInText:!1,verticalizable:!1};return function(Y,pe,Ee,je,Me,ze,Ke,We,Je,Oe,st,mt){let pt=0,lt=0,Vt=0,Sr=0;const Hr=We==="right"?1:We==="left"?0:.5,di=Wr/mt;let Yi=0;for(const _r of Me){_r.trim();const Qr=_r.getMaxScale(),si={positionedGlyphs:[],lineOffset:0};Y.positionedLines[Yi]=si;const oi=si.positionedGlyphs;let Ci=0;if(!_r.length()){lt+=ze,++Yi;continue}const $i=g_(je,_r,di);for(let Vi=0;Vi<_r.length();Vi++){const Zr=_r.getSection(Vi),$r=_r.getSectionIndex(Vi),ei=_r.getCharCode(Vi),Nr=y_(Je,st,ei);let ur;if(Zr.imageName){if(Y.iconsInText=!0,Zr.scale=Zr.scale*di,ur=v_(Zr,Nr,Qr,$i,je),!ur)continue;Ci=Math.max(Ci,ur.imageOffset)}else if(ur=__(Zr,ei,Nr,$i,pe,Ee),!ur)continue;const{rect:yn,metrics:Ca,baselineOffset:_n}=ur;oi.push({glyph:ei,imageName:Zr.imageName,x:pt,y:lt+_n+lu,vertical:Nr,scale:Zr.scale,fontStack:Zr.fontStack,sectionIndex:$r,metrics:Ca,rect:yn}),Nr?(Y.verticalizable=!0,pt+=(Zr.imageName?Ca.advance:Wr)*Zr.scale+Oe):pt+=Ca.advance*Zr.scale+Oe}oi.length!==0&&(Vt=Math.max(pt-Oe,Vt),x_(oi,0,oi.length-1,Hr)),pt=0,si.lineOffset=Math.max(Ci,(Qr-1)*Wr);const Yr=ze*Qr+Ci;lt+=Yr,Sr=Math.max(Yr,Sr),++Yi}const{horizontalAlign:Di,verticalAlign:ni}=dp(Ke);(function(_r,Qr,si,oi,Ci,$i,Yr,Vi,Zr){const $r=(Qr-si)*Ci;let ei=0;ei=$i!==Yr?-Vi*oi-lu:-oi*Zr*Yr+.5*Yr;for(const Nr of _r)for(const ur of Nr.positionedGlyphs)ur.x+=$r,ur.y+=ei})(Y.positionedLines,Hr,Di,ni,Vt,Sr,ze,lt,Me.length),Y.top+=-ni*lt,Y.bottom=Y.top+lt,Y.left+=-Di*Vt,Y.right=Y.left+Vt}(U,t,i,o,ee,m,v,S,z,I,q,H),!function(Y){for(const pe of Y)if(pe.positionedGlyphs.length!==0)return!1;return!0}(he)&&U}const uu={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},d_={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},f_={40:!0};function lf(n,t,i,o,c,d){if(t.imageName){const m=o[t.imageName];return m?m.displaySize[0]*t.scale*Wr/d+c:0}{const m=i[t.fontStack],v=m&&m[n];return v?v.metrics.advance*t.scale+c:0}}function cf(n,t,i,o){const c=Math.pow(n-t,2);return o?n<t?c/2:2*c:c+Math.abs(i)*i}function m_(n,t,i){let o=0;return n===10&&(o-=1e4),i&&(o+=150),n!==40&&n!==65288||(o+=50),t!==41&&t!==65289||(o+=50),o}function uf(n,t,i,o,c,d){let m=null,v=cf(t,i,c,d);for(const S of o){const I=cf(t-S.x,i,c,d)+S.badness;I<=v&&(m=S,v=I)}return{index:n,x:t,priorBreak:m,badness:v}}function hf(n){return n?hf(n.priorBreak).concat(n.index):[]}function pp(n,t,i,o,c,d){if(!n)return[];const m=[],v=function(z,q,j,H,G,ee){let le=0;for(let ve=0;ve<z.length();ve++){const he=z.getSection(ve);le+=lf(z.getCharCode(ve),he,H,G,q,ee)}return le/Math.max(1,Math.ceil(le/j))}(n,t,i,o,c,d),S=n.text.indexOf("​")>=0;let I=0;for(let z=0;z<n.length();z++){const q=n.getSection(z),j=n.getCharCode(z);if(uu[j]||(I+=lf(j,q,o,c,t,d)),z<n.length()-1){const H=!((B=j)<11904)&&(!!Bt["CJK Compatibility Forms"](B)||!!Bt["CJK Compatibility"](B)||!!Bt["CJK Strokes"](B)||!!Bt["CJK Symbols and Punctuation"](B)||!!Bt["Enclosed CJK Letters and Months"](B)||!!Bt["Halfwidth and Fullwidth Forms"](B)||!!Bt["Ideographic Description Characters"](B)||!!Bt["Vertical Forms"](B)||xl.test(String.fromCodePoint(B)));(d_[j]||H||q.imageName||z!==n.length()-2&&f_[n.getCharCode(z+1)])&&m.push(uf(z+1,I,v,m,m_(j,n.getCharCode(z+1),H&&S),!1))}}var B;return hf(uf(n.length(),I,v,m,0,!0))}function dp(n){let t=.5,i=.5;switch(n){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(n){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:t,verticalAlign:i}}function g_(n,t,i){const o=t.getMaxScale()*Wr,{maxImageWidth:c,maxImageHeight:d}=t.getMaxImageSize(n),m=Math.max(o,d*i);return{verticalLineContentWidth:Math.max(o,c*i),horizontalLineContentHeight:m}}function pf(n){switch(n){case"top":return 0;case"center":return .5;default:return 1}}function y_(n,t,i){return!(n===x.al.horizontal||!t&&!fa(i)||t&&(uu[i]||(o=i,new RegExp("\\p{sc=Arab}","u").test(String.fromCodePoint(o)))));var o}function __(n,t,i,o,c,d){const m=d[n.fontStack],v=function(I,B,z,q){if(I&&I.rect)return I;const j=B[z.fontStack],H=j&&j[q];return H?{rect:null,metrics:H.metrics}:null}(m&&m[t],c,n,t);if(v===null)return null;let S;if(i)S=o.verticalLineContentWidth-n.scale*Wr;else{const I=pf(n.verticalAlign);S=(o.horizontalLineContentHeight-n.scale*Wr)*I}return{rect:v.rect,metrics:v.metrics,baselineOffset:S}}function v_(n,t,i,o,c){const d=c[n.imageName];if(!d)return null;const m=d.paddedRect,v=d.displaySize,S={width:v[0],height:v[1],left:Bi,top:-3,advance:t?v[1]:v[0]};let I;if(t)I=o.verticalLineContentWidth-v[1]*n.scale;else{const B=pf(n.verticalAlign);I=(o.horizontalLineContentHeight-v[1]*n.scale)*B}return{rect:m,metrics:S,baselineOffset:I,imageOffset:(t?v[0]:v[1])*n.scale-Wr*i}}function x_(n,t,i,o){if(o===0)return;const c=n[i],d=(n[i].x+c.metrics.advance*c.scale)*o;for(let m=t;m<=i;m++)n[m].x-=d}function b_(n,t,i){const{horizontalAlign:o,verticalAlign:c}=dp(i),d=t[0]-n.displaySize[0]*o,m=t[1]-n.displaySize[1]*c;return{image:n,top:m,bottom:m+n.displaySize[1],left:d,right:d+n.displaySize[0]}}function df(n){var t,i;let o=n.left,c=n.top,d=n.right-o,m=n.bottom-c;const v=(t=n.image.textFitWidth)!==null&&t!==void 0?t:"stretchOrShrink",S=(i=n.image.textFitHeight)!==null&&i!==void 0?i:"stretchOrShrink",I=(n.image.content[2]-n.image.content[0])/(n.image.content[3]-n.image.content[1]);if(S==="proportional"){if(v==="stretchOnly"&&d/m<I||v==="proportional"){const B=Math.ceil(m*I);o*=B/d,d=B}}else if(v==="proportional"&&S==="stretchOnly"&&I!==0&&d/m>I){const B=Math.ceil(d/I);c*=B/m,m=B}return{x1:o,y1:c,x2:o+d,y2:c+m}}function ff(n,t,i,o,c,d){const m=n.image;let v;if(m.content){const ee=m.content,le=m.pixelRatio||1;v=[ee[0]/le,ee[1]/le,m.displaySize[0]-ee[2]/le,m.displaySize[1]-ee[3]/le]}const S=t.left*d,I=t.right*d;let B,z,q,j;i==="width"||i==="both"?(j=c[0]+S-o[3],z=c[0]+I+o[1]):(j=c[0]+(S+I-m.displaySize[0])/2,z=j+m.displaySize[0]);const H=t.top*d,G=t.bottom*d;return i==="height"||i==="both"?(B=c[1]+H-o[0],q=c[1]+G+o[2]):(B=c[1]+(H+G-m.displaySize[1])/2,q=B+m.displaySize[1]),{image:m,top:B,right:z,bottom:q,left:j,collisionPadding:v}}const jl=255,Bn=128,Rs=jl*Bn;function mf(n,t){const{expression:i}=t;if(i.kind==="constant")return{kind:"constant",layoutSize:i.evaluate(new lr(n+1))};if(i.kind==="source")return{kind:"source"};{const{zoomStops:o,interpolationType:c}=i;let d=0;for(;d<o.length&&o[d]<=n;)d++;d=Math.max(0,d-1);let m=d;for(;m<o.length&&o[m]<n+1;)m++;m=Math.min(o.length-1,m);const v=o[d],S=o[m];return i.kind==="composite"?{kind:"composite",minZoom:v,maxZoom:S,interpolationType:c}:{kind:"camera",minZoom:v,maxZoom:S,minSize:i.evaluate(new lr(v)),maxSize:i.evaluate(new lr(S)),interpolationType:c}}}function fp(n,t,i){let o="never";const c=n.get(t);return c?o=c:n.get(i)&&(o="always"),o}const w_=Fl.VectorTileFeature.types,S_=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function hu(n,t,i,o,c,d,m,v,S,I,B,z,q){const j=v?Math.min(Rs,Math.round(v[0])):0,H=v?Math.min(Rs,Math.round(v[1])):0;n.emplaceBack(t,i,Math.round(32*o),Math.round(32*c),d,m,(j<<1)+(S?1:0),H,16*I,16*B,256*z,256*q)}function mp(n,t,i){n.emplaceBack(t.x,t.y,i),n.emplaceBack(t.x,t.y,i),n.emplaceBack(t.x,t.y,i),n.emplaceBack(t.x,t.y,i)}function k_(n){for(const t of n.sections)if(Nh(t.text))return!0;return!1}class gp{constructor(t){this.layoutVertexArray=new mr,this.indexArray=new Ht,this.programConfigurations=t,this.segments=new Zt,this.dynamicLayoutVertexArray=new tr,this.opacityVertexArray=new gr,this.hasVisibleVertices=!1,this.placedSymbolArray=new me}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(t,i,o,c){this.isEmpty()||(o&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,i_.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,i),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,n_.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,S_,!0),this.opacityVertexBuffer.itemSize=1),(o||c)&&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())}}nt("SymbolBuffers",gp);class yp{constructor(t,i,o){this.layoutVertexArray=new t,this.layoutAttributes=i,this.indexArray=new o,this.segments=new Zt,this.collisionVertexArray=new sr}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,s_.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}nt("CollisionBuffers",yp);class Sa{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(m=>m.id),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[];const i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=mf(this.zoom,i["text-size"]),this.iconSizeData=mf(this.zoom,i["icon-size"]);const o=this.layers[0].layout,c=o.get("symbol-sort-key"),d=o.get("symbol-z-order");this.canOverlap=fp(o,"text-overlap","text-allow-overlap")!=="never"||fp(o,"icon-overlap","icon-allow-overlap")!=="never"||o.get("text-ignore-placement")||o.get("icon-ignore-placement"),this.sortFeaturesByKey=d!=="viewport-y"&&!c.isConstant(),this.sortFeaturesByY=(d==="viewport-y"||d==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,o.get("symbol-placement")==="point"&&(this.writingModes=o.get("text-writing-mode").map(m=>x.al[m])),this.stateDependentLayerIds=this.layers.filter(m=>m.isStateDependent()).map(m=>m.id),this.sourceID=t.sourceID}createArrays(){this.text=new gp(new Rn(this.layers,this.zoom,t=>/^text/.test(t))),this.icon=new gp(new Rn(this.layers,this.zoom,t=>/^icon/.test(t))),this.glyphOffsetArray=new xe,this.lineVertexArray=new ye,this.symbolInstances=new ge,this.textAnchorOffsets=new Fe}calculateGlyphDependencies(t,i,o,c,d){for(let m=0;m<t.length;m++)if(i[t.charCodeAt(m)]=!0,(o||c)&&d){const v=ql[t.charAt(m)];v&&(i[v.charCodeAt(0)]=!0)}}populate(t,i,o){const c=this.layers[0],d=c.layout,m=d.get("text-font"),v=d.get("text-field"),S=d.get("icon-image"),I=(v.value.kind!=="constant"||v.value.value instanceof ki&&!v.value.value.isEmpty()||v.value.value.toString().length>0)&&(m.value.kind!=="constant"||m.value.value.length>0),B=S.value.kind!=="constant"||!!S.value.value||Object.keys(S.parameters).length>0,z=d.get("symbol-sort-key");if(this.features=[],!I&&!B)return;const q=i.iconDependencies,j=i.glyphDependencies,H=i.availableImages,G=new lr(this.zoom);for(const{feature:ee,id:le,index:ve,sourceLayerIndex:he}of t){const U=c._featureFilter.needGeometry,Y=xo(ee,U);if(!c._featureFilter.filter(G,Y,o))continue;let pe,Ee;if(U||(Y.geometry=vo(ee)),I){const Me=c.getValueAndResolveTokens("text-field",Y,o,H),ze=ki.factory(Me),Ke=this.hasRTLText=this.hasRTLText||k_(ze);(!Ke||fn.getRTLTextPluginStatus()==="unavailable"||Ke&&fn.isParsed())&&(pe=a_(ze,c,Y))}if(B){const Me=c.getValueAndResolveTokens("icon-image",Y,o,H);Ee=Me instanceof Mi?Me:Mi.fromString(Me)}if(!pe&&!Ee)continue;const je=this.sortFeaturesByKey?z.evaluate(Y,{},o):void 0;if(this.features.push({id:le,text:pe,icon:Ee,index:ve,sourceLayerIndex:he,geometry:Y.geometry,properties:ee.properties,type:w_[ee.type],sortKey:je}),Ee&&(q[Ee.name]=!0),pe){const Me=m.evaluate(Y,{},o).join(","),ze=d.get("text-rotation-alignment")!=="viewport"&&d.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(x.al.vertical)>=0;for(const Ke of pe.sections)if(Ke.image)q[Ke.image.name]=!0;else{const We=da(pe.toString()),Je=Ke.fontStack||Me,Oe=j[Je]=j[Je]||{};this.calculateGlyphDependencies(Ke.text,Oe,ze,this.allowVerticalPlacement,We)}}}d.get("symbol-placement")==="line"&&(this.features=function(ee){const le={},ve={},he=[];let U=0;function Y(Me){he.push(ee[Me]),U++}function pe(Me,ze,Ke){const We=ve[Me];return delete ve[Me],ve[ze]=We,he[We].geometry[0].pop(),he[We].geometry[0]=he[We].geometry[0].concat(Ke[0]),We}function Ee(Me,ze,Ke){const We=le[ze];return delete le[ze],le[Me]=We,he[We].geometry[0].shift(),he[We].geometry[0]=Ke[0].concat(he[We].geometry[0]),We}function je(Me,ze,Ke){const We=Ke?ze[0][ze[0].length-1]:ze[0][0];return`${Me}:${We.x}:${We.y}`}for(let Me=0;Me<ee.length;Me++){const ze=ee[Me],Ke=ze.geometry,We=ze.text?ze.text.toString():null;if(!We){Y(Me);continue}const Je=je(We,Ke),Oe=je(We,Ke,!0);if(Je in ve&&Oe in le&&ve[Je]!==le[Oe]){const st=Ee(Je,Oe,Ke),mt=pe(Je,Oe,he[st].geometry);delete le[Je],delete ve[Oe],ve[je(We,he[mt].geometry,!0)]=mt,he[st].geometry=null}else Je in ve?pe(Je,Oe,Ke):Oe in le?Ee(Je,Oe,Ke):(Y(Me),le[Je]=U-1,ve[Oe]=U-1)}return he.filter(Me=>Me.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((ee,le)=>ee.sortKey-le.sortKey)}update(t,i,o){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,i,this.layers,o),this.icon.programConfigurations.updatePaintArrays(t,i,this.layers,o))}isEmpty(){return this.symbolInstances.length===0&&!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,i){const o=this.lineVertexArray.length;if(t.segment!==void 0){let c=t.dist(i[t.segment+1]),d=t.dist(i[t.segment]);const m={};for(let v=t.segment+1;v<i.length;v++)m[v]={x:i[v].x,y:i[v].y,tileUnitDistanceFromAnchor:c},v<i.length-1&&(c+=i[v+1].dist(i[v]));for(let v=t.segment||0;v>=0;v--)m[v]={x:i[v].x,y:i[v].y,tileUnitDistanceFromAnchor:d},v>0&&(d+=i[v-1].dist(i[v]));for(let v=0;v<i.length;v++){const S=m[v];this.lineVertexArray.emplaceBack(S.x,S.y,S.tileUnitDistanceFromAnchor)}}return{lineStartIndex:o,lineLength:this.lineVertexArray.length-o}}addSymbols(t,i,o,c,d,m,v,S,I,B,z,q){const j=t.indexArray,H=t.layoutVertexArray,G=t.segments.prepareSegment(4*i.length,H,j,this.canOverlap?m.sortKey:void 0),ee=this.glyphOffsetArray.length,le=G.vertexLength,ve=this.allowVerticalPlacement&&v===x.al.vertical?Math.PI/2:0,he=m.text&&m.text.sections;for(let U=0;U<i.length;U++){const{tl:Y,tr:pe,bl:Ee,br:je,tex:Me,pixelOffsetTL:ze,pixelOffsetBR:Ke,minFontScaleX:We,minFontScaleY:Je,glyphOffset:Oe,isSDF:st,sectionIndex:mt}=i[U],pt=G.vertexLength,lt=Oe[1];hu(H,S.x,S.y,Y.x,lt+Y.y,Me.x,Me.y,o,st,ze.x,ze.y,We,Je),hu(H,S.x,S.y,pe.x,lt+pe.y,Me.x+Me.w,Me.y,o,st,Ke.x,ze.y,We,Je),hu(H,S.x,S.y,Ee.x,lt+Ee.y,Me.x,Me.y+Me.h,o,st,ze.x,Ke.y,We,Je),hu(H,S.x,S.y,je.x,lt+je.y,Me.x+Me.w,Me.y+Me.h,o,st,Ke.x,Ke.y,We,Je),mp(t.dynamicLayoutVertexArray,S,ve),j.emplaceBack(pt,pt+2,pt+1),j.emplaceBack(pt+1,pt+2,pt+3),G.vertexLength+=4,G.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Oe[0]),U!==i.length-1&&mt===i[U+1].sectionIndex||t.programConfigurations.populatePaintArrays(H.length,m,m.index,{},q,he&&he[mt])}t.placedSymbolArray.emplaceBack(S.x,S.y,ee,this.glyphOffsetArray.length-ee,le,I,B,S.segment,o?o[0]:0,o?o[1]:0,c[0],c[1],v,0,!1,0,z)}_addCollisionDebugVertex(t,i,o,c,d,m){return i.emplaceBack(0,0),t.emplaceBack(o.x,o.y,c,d,Math.round(m.x),Math.round(m.y))}addCollisionDebugVertices(t,i,o,c,d,m,v){const S=d.segments.prepareSegment(4,d.layoutVertexArray,d.indexArray),I=S.vertexLength,B=d.layoutVertexArray,z=d.collisionVertexArray,q=v.anchorX,j=v.anchorY;this._addCollisionDebugVertex(B,z,m,q,j,new C(t,i)),this._addCollisionDebugVertex(B,z,m,q,j,new C(o,i)),this._addCollisionDebugVertex(B,z,m,q,j,new C(o,c)),this._addCollisionDebugVertex(B,z,m,q,j,new C(t,c)),S.vertexLength+=4;const H=d.indexArray;H.emplaceBack(I,I+1),H.emplaceBack(I+1,I+2),H.emplaceBack(I+2,I+3),H.emplaceBack(I+3,I),S.primitiveLength+=4}addDebugCollisionBoxes(t,i,o,c){for(let d=t;d<i;d++){const m=this.collisionBoxArray.get(d);this.addCollisionDebugVertices(m.x1,m.y1,m.x2,m.y2,c?this.textCollisionBox:this.iconCollisionBox,m.anchorPoint,o)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new yp(yr,tf.members,jr),this.iconCollisionBox=new yp(yr,tf.members,jr);for(let t=0;t<this.symbolInstances.length;t++){const i=this.symbolInstances.get(t);this.addDebugCollisionBoxes(i.textBoxStartIndex,i.textBoxEndIndex,i,!0),this.addDebugCollisionBoxes(i.verticalTextBoxStartIndex,i.verticalTextBoxEndIndex,i,!0),this.addDebugCollisionBoxes(i.iconBoxStartIndex,i.iconBoxEndIndex,i,!1),this.addDebugCollisionBoxes(i.verticalIconBoxStartIndex,i.verticalIconBoxEndIndex,i,!1)}}_deserializeCollisionBoxesForSymbol(t,i,o,c,d,m,v,S,I){const B={};for(let z=i;z<o;z++){const q=t.get(z);B.textBox={x1:q.x1,y1:q.y1,x2:q.x2,y2:q.y2,anchorPointX:q.anchorPointX,anchorPointY:q.anchorPointY},B.textFeatureIndex=q.featureIndex;break}for(let z=c;z<d;z++){const q=t.get(z);B.verticalTextBox={x1:q.x1,y1:q.y1,x2:q.x2,y2:q.y2,anchorPointX:q.anchorPointX,anchorPointY:q.anchorPointY},B.verticalTextFeatureIndex=q.featureIndex;break}for(let z=m;z<v;z++){const q=t.get(z);B.iconBox={x1:q.x1,y1:q.y1,x2:q.x2,y2:q.y2,anchorPointX:q.anchorPointX,anchorPointY:q.anchorPointY},B.iconFeatureIndex=q.featureIndex;break}for(let z=S;z<I;z++){const q=t.get(z);B.verticalIconBox={x1:q.x1,y1:q.y1,x2:q.x2,y2:q.y2,anchorPointX:q.anchorPointX,anchorPointY:q.anchorPointY},B.verticalIconFeatureIndex=q.featureIndex;break}return B}deserializeCollisionBoxes(t){this.collisionArrays=[];for(let i=0;i<this.symbolInstances.length;i++){const o=this.symbolInstances.get(i);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,o.textBoxStartIndex,o.textBoxEndIndex,o.verticalTextBoxStartIndex,o.verticalTextBoxEndIndex,o.iconBoxStartIndex,o.iconBoxEndIndex,o.verticalIconBoxStartIndex,o.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,i){const o=t.placedSymbolArray.get(i),c=o.vertexStartIndex+4*o.numGlyphs;for(let d=o.vertexStartIndex;d<c;d+=4)t.indexArray.emplaceBack(d,d+2,d+1),t.indexArray.emplaceBack(d+1,d+2,d+3)}getSortedSymbolIndexes(t){if(this.sortedAngle===t&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;const i=Math.sin(t),o=Math.cos(t),c=[],d=[],m=[];for(let v=0;v<this.symbolInstances.length;++v){m.push(v);const S=this.symbolInstances.get(v);c.push(0|Math.round(i*S.anchorX+o*S.anchorY)),d.push(S.featureIndex)}return m.sort((v,S)=>c[v]-c[S]||d[S]-d[v]),m}addToSortKeyRanges(t,i){const o=this.sortKeyRanges[this.sortKeyRanges.length-1];o&&o.sortKey===i?o.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:i,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)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const i of this.symbolInstanceIndexes){const o=this.symbolInstances.get(i);this.featureSortOrder.push(o.featureIndex),[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((c,d,m)=>{c>=0&&m.indexOf(c)===d&&this.addIndicesForPlacedSymbol(this.text,c)}),o.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,o.verticalPlacedTextSymbolIndex),o.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.placedIconSymbolIndex),o.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let gf,yf;nt("SymbolBucket",Sa,{omit:["layers","collisionBoxArray","features","compareText"]}),Sa.MAX_GLYPHS=65535,Sa.addDynamicAttributes=mp;var _p={get paint(){return yf=yf||new zr({"icon-opacity":new yt(te.paint_symbol["icon-opacity"]),"icon-color":new yt(te.paint_symbol["icon-color"]),"icon-halo-color":new yt(te.paint_symbol["icon-halo-color"]),"icon-halo-width":new yt(te.paint_symbol["icon-halo-width"]),"icon-halo-blur":new yt(te.paint_symbol["icon-halo-blur"]),"icon-translate":new ct(te.paint_symbol["icon-translate"]),"icon-translate-anchor":new ct(te.paint_symbol["icon-translate-anchor"]),"text-opacity":new yt(te.paint_symbol["text-opacity"]),"text-color":new yt(te.paint_symbol["text-color"],{runtimeType:vr,getOverride:n=>n.textColor,hasOverride:n=>!!n.textColor}),"text-halo-color":new yt(te.paint_symbol["text-halo-color"]),"text-halo-width":new yt(te.paint_symbol["text-halo-width"]),"text-halo-blur":new yt(te.paint_symbol["text-halo-blur"]),"text-translate":new ct(te.paint_symbol["text-translate"]),"text-translate-anchor":new ct(te.paint_symbol["text-translate-anchor"])})},get layout(){return gf=gf||new zr({"symbol-placement":new ct(te.layout_symbol["symbol-placement"]),"symbol-spacing":new ct(te.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new ct(te.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new yt(te.layout_symbol["symbol-sort-key"]),"symbol-z-order":new ct(te.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new ct(te.layout_symbol["icon-allow-overlap"]),"icon-overlap":new ct(te.layout_symbol["icon-overlap"]),"icon-ignore-placement":new ct(te.layout_symbol["icon-ignore-placement"]),"icon-optional":new ct(te.layout_symbol["icon-optional"]),"icon-rotation-alignment":new ct(te.layout_symbol["icon-rotation-alignment"]),"icon-size":new yt(te.layout_symbol["icon-size"]),"icon-text-fit":new ct(te.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new ct(te.layout_symbol["icon-text-fit-padding"]),"icon-image":new yt(te.layout_symbol["icon-image"]),"icon-rotate":new yt(te.layout_symbol["icon-rotate"]),"icon-padding":new yt(te.layout_symbol["icon-padding"]),"icon-keep-upright":new ct(te.layout_symbol["icon-keep-upright"]),"icon-offset":new yt(te.layout_symbol["icon-offset"]),"icon-anchor":new yt(te.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new ct(te.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new ct(te.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new ct(te.layout_symbol["text-rotation-alignment"]),"text-field":new yt(te.layout_symbol["text-field"]),"text-font":new yt(te.layout_symbol["text-font"]),"text-size":new yt(te.layout_symbol["text-size"]),"text-max-width":new yt(te.layout_symbol["text-max-width"]),"text-line-height":new ct(te.layout_symbol["text-line-height"]),"text-letter-spacing":new yt(te.layout_symbol["text-letter-spacing"]),"text-justify":new yt(te.layout_symbol["text-justify"]),"text-radial-offset":new yt(te.layout_symbol["text-radial-offset"]),"text-variable-anchor":new ct(te.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new yt(te.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new yt(te.layout_symbol["text-anchor"]),"text-max-angle":new ct(te.layout_symbol["text-max-angle"]),"text-writing-mode":new ct(te.layout_symbol["text-writing-mode"]),"text-rotate":new yt(te.layout_symbol["text-rotate"]),"text-padding":new ct(te.layout_symbol["text-padding"]),"text-keep-upright":new ct(te.layout_symbol["text-keep-upright"]),"text-transform":new yt(te.layout_symbol["text-transform"]),"text-offset":new yt(te.layout_symbol["text-offset"]),"text-allow-overlap":new ct(te.layout_symbol["text-allow-overlap"]),"text-overlap":new ct(te.layout_symbol["text-overlap"]),"text-ignore-placement":new ct(te.layout_symbol["text-ignore-placement"]),"text-optional":new ct(te.layout_symbol["text-optional"])})}};class _f{constructor(t){if(t.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:wt,this.defaultValue=t}evaluate(t){if(t.formattedSection){const i=this.defaultValue.property.overrides;if(i&&i.hasOverride(t.formattedSection))return i.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}}nt("FormatSectionOverride",_f,{omit:["defaultValue"]});class pu extends qi{constructor(t){super(t,_p)}recalculate(t,i){if(super.recalculate(t,i),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const o=this.layout.get("text-writing-mode");if(o){const c=[];for(const d of o)c.indexOf(d)<0&&c.push(d);this.layout._values["text-writing-mode"]=c}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(t,i,o,c){const d=this.layout.get(t).evaluate(i,{},o,c),m=this._unevaluatedLayout._values[t];return m.isDataDriven()||ro(m.value)||!d?d:function(v,S){return S.replace(/{([^{}]+)}/g,(I,B)=>v&&B in v?String(v[B]):"")}(i.properties,d)}createBucket(t){return new Sa(t)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const t of _p.paint.overridableProperties){if(!pu.hasPaintOverride(this.layout,t))continue;const i=this.paint.get(t),o=new _f(i),c=new ta(o,i.property.specification);let d=null;d=i.value.kind==="constant"||i.value.kind==="source"?new ol("source",c):new ia("composite",c,i.value.zoomStops),this.paint._values[t]=new yi(i.property,d,i.parameters)}}_handleOverridablePaintPropertyUpdate(t,i,o){return!(!this.layout||i.isDataDriven()||o.isDataDriven())&&pu.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,i){const o=t.get("text-field"),c=_p.paint.properties[i];let d=!1;const m=v=>{for(const S of v)if(c.overrides&&c.overrides.hasOverride(S))return void(d=!0)};if(o.value.kind==="constant"&&o.value.value instanceof ki)m(o.value.value.sections);else if(o.value.kind==="source"){const v=I=>{d||(I instanceof At&&br(I.value)===zs?m(I.value.sections):I instanceof Oo?m(I.sections):I.eachChild(v))},S=o.value;S._styleExpression&&v(S._styleExpression.expression)}return d}}let vf;var A_={get paint(){return vf=vf||new zr({"background-color":new ct(te.paint_background["background-color"]),"background-pattern":new wl(te.paint_background["background-pattern"]),"background-opacity":new ct(te.paint_background["background-opacity"])})}};class C_ extends qi{constructor(t){super(t,A_)}}let xf;var T_={get paint(){return xf=xf||new zr({"raster-opacity":new ct(te.paint_raster["raster-opacity"]),"raster-hue-rotate":new ct(te.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new ct(te.paint_raster["raster-brightness-min"]),"raster-brightness-max":new ct(te.paint_raster["raster-brightness-max"]),"raster-saturation":new ct(te.paint_raster["raster-saturation"]),"raster-contrast":new ct(te.paint_raster["raster-contrast"]),"raster-resampling":new ct(te.paint_raster["raster-resampling"]),"raster-fade-duration":new ct(te.paint_raster["raster-fade-duration"])})}};class E_ extends qi{constructor(t){super(t,T_)}}class P_ extends qi{constructor(t){super(t,{}),this.onAdd=i=>{this.implementation.onAdd&&this.implementation.onAdd(i,i.painter.context.gl)},this.onRemove=i=>{this.implementation.onRemove&&this.implementation.onRemove(i,i.painter.context.gl)},this.implementation=t}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class I_{constructor(t){this._methodToThrottle=t,this._triggered=!1,typeof MessageChannel<"u"&&(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=()=>{}}}const M_={once:!0},vp=63710088e-1;class Bs{constructor(t,i){if(isNaN(t)||isNaN(i))throw new Error(`Invalid LngLat object: (${t}, ${i})`);if(this.lng=+t,this.lat=+i,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Bs(et(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){const i=Math.PI/180,o=this.lat*i,c=t.lat*i,d=Math.sin(o)*Math.sin(c)+Math.cos(o)*Math.cos(c)*Math.cos((t.lng-this.lng)*i);return vp*Math.acos(Math.min(d,1))}static convert(t){if(t instanceof Bs)return t;if(Array.isArray(t)&&(t.length===2||t.length===3))return new Bs(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&typeof t=="object"&&t!==null)return new Bs(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new 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>]")}}const bf=2*Math.PI*vp;function wf(n){return bf*Math.cos(n*Math.PI/180)}function Sf(n){return(180+n)/360}function kf(n){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n*Math.PI/360)))/360}function Af(n,t){return n/wf(t)}function xp(n){return 360/Math.PI*Math.atan(Math.exp((180-360*n)*Math.PI/180))-90}function Cf(n,t){return n*wf(xp(t))}class Wl{constructor(t,i,o=0){this.x=+t,this.y=+i,this.z=+o}static fromLngLat(t,i=0){const o=Bs.convert(t);return new Wl(Sf(o.lng),kf(o.lat),Af(i,o.lat))}toLngLat(){return new Bs(360*this.x-180,xp(this.y))}toAltitude(){return Cf(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/bf*(t=xp(this.y),1/Math.cos(t*Math.PI/180));var t}}function Tf(n,t,i){var o=2*Math.PI*6378137/256/Math.pow(2,i);return[n*o-2*Math.PI*6378137/2,t*o-2*Math.PI*6378137/2]}class bp{constructor(t,i,o){if(!function(c,d,m){return!(c<0||c>25||m<0||m>=Math.pow(2,c)||d<0||d>=Math.pow(2,c))}(t,i,o))throw new Error(`x=${i}, y=${o}, 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=i,this.y=o,this.key=ka(0,t,t,i,o)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,i,o){const c=(m=this.y,v=this.z,S=Tf(256*(d=this.x),256*(m=Math.pow(2,v)-m-1),v),I=Tf(256*(d+1),256*(m+1),v),S[0]+","+S[1]+","+I[0]+","+I[1]);var d,m,v,S,I;const B=function(z,q,j){let H,G="";for(let ee=z;ee>0;ee--)H=1<<ee-1,G+=(q&H?1:0)+(j&H?2:0);return G}(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(o==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,i>1?"@2x":"").replace(/{quadkey}/g,B).replace(/{bbox-epsg-3857}/g,c)}isChildOf(t){const i=this.z-t.z;return i>0&&t.x===this.x>>i&&t.y===this.y>>i}getTilePoint(t){const i=Math.pow(2,this.z);return new C((t.x*i-this.x)*Jt,(t.y*i-this.y)*Jt)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Ef{constructor(t,i){this.wrap=t,this.canonical=i,this.key=ka(t,i.z,i.z,i.x,i.y)}}class Qi{constructor(t,i,o,c,d){if(this.terrainRttPosMatrix32f=null,t<o)throw new Error(`overscaledZ should be >= z; overscaledZ = ${t}; z = ${o}`);this.overscaledZ=t,this.wrap=i,this.canonical=new bp(o,+c,+d),this.key=ka(i,t,o,c,d)}clone(){return new Qi(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 new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const i=this.canonical.z-t;return t>this.canonical.z?new Qi(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Qi(t,this.wrap,t,this.canonical.x>>i,this.canonical.y>>i)}calculateScaledKey(t,i){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const o=this.canonical.z-t;return t>this.canonical.z?ka(this.wrap*+i,t,this.canonical.z,this.canonical.x,this.canonical.y):ka(this.wrap*+i,t,t,this.canonical.x>>o,this.canonical.y>>o)}isChildOf(t){if(t.wrap!==this.wrap)return!1;const i=this.canonical.z-t.canonical.z;return t.overscaledZ===0||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>i&&t.canonical.y===this.canonical.y>>i}children(t){if(this.overscaledZ>=t)return[new Qi(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const i=this.canonical.z+1,o=2*this.canonical.x,c=2*this.canonical.y;return[new Qi(i,this.wrap,i,o,c),new Qi(i,this.wrap,i,o+1,c),new Qi(i,this.wrap,i,o,c+1),new Qi(i,this.wrap,i,o+1,c+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 Qi(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new Qi(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 Ef(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(t){return this.canonical.getTilePoint(new Wl(t.x-this.wrap,t.y))}}function ka(n,t,i,o,c){(n*=2)<0&&(n=-1*n-1);const d=1<<i;return(d*d*n+d*c+o).toString(36)+i.toString(36)+t.toString(36)}nt("CanonicalTileID",bp),nt("OverscaledTileID",Qi,{omit:["terrainRttPosMatrix32f"]});class Pf{constructor(t,i,o,c=1,d=1,m=1,v=0){if(this.uid=t,i.height!==i.width)throw new RangeError("DEM tiles must be square");if(o&&!["mapbox","terrarium","custom"].includes(o))return void _t(`"${o}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=i.height;const S=this.dim=i.height-2;switch(this.data=new Uint32Array(i.data.buffer),o){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=c,this.greenFactor=d,this.blueFactor=m,this.baseShift=v;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let I=0;I<S;I++)this.data[this._idx(-1,I)]=this.data[this._idx(0,I)],this.data[this._idx(S,I)]=this.data[this._idx(S-1,I)],this.data[this._idx(I,-1)]=this.data[this._idx(I,0)],this.data[this._idx(I,S)]=this.data[this._idx(I,S-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(S,-1)]=this.data[this._idx(S-1,0)],this.data[this._idx(-1,S)]=this.data[this._idx(0,S-1)],this.data[this._idx(S,S)]=this.data[this._idx(S-1,S-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let I=0;I<S;I++)for(let B=0;B<S;B++){const z=this.get(I,B);z>this.max&&(this.max=z),z<this.min&&(this.min=z)}}get(t,i){const o=new Uint8Array(this.data.buffer),c=4*this._idx(t,i);return this.unpack(o[c],o[c+1],o[c+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(t,i){if(t<-1||t>=this.dim+1||i<-1||i>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(i+1)*this.stride+(t+1)}unpack(t,i,o){return t*this.redFactor+i*this.greenFactor+o*this.blueFactor-this.baseShift}getPixels(){return new Xi({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(t,i,o){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let c=i*this.dim,d=i*this.dim+this.dim,m=o*this.dim,v=o*this.dim+this.dim;switch(i){case-1:c=d-1;break;case 1:d=c+1}switch(o){case-1:m=v-1;break;case 1:v=m+1}const S=-i*this.dim,I=-o*this.dim;for(let B=m;B<v;B++)for(let z=c;z<d;z++)this.data[this._idx(z,B)]=t.data[this._idx(z+S,B+I)]}}nt("DEMData",Pf);class If{constructor(t){this._stringToNumber={},this._numberToString=[];for(let i=0;i<t.length;i++){const o=t[i];this._stringToNumber[o]=i,this._numberToString[i]=o}}encode(t){return this._stringToNumber[t]}decode(t){if(t>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${t} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}}class Mf{constructor(t,i,o,c,d){this.type="Feature",this._vectorTileFeature=t,t._z=i,t._x=o,t._y=c,this.properties=t.properties,this.id=d}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(t){this._geometry=t}toJSON(){const t={geometry:this.geometry};for(const i in this)i!=="_geometry"&&i!=="_vectorTileFeature"&&(t[i]=this[i]);return t}}class Lf{constructor(t,i){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Es(Jt,16,0),this.grid3D=new Es(Jt,16,0),this.featureIndexArray=new Be,this.promoteId=i}insert(t,i,o,c,d,m){const v=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(o,c,d);const S=m?this.grid3D:this.grid;for(let I=0;I<i.length;I++){const B=i[I],z=[1/0,1/0,-1/0,-1/0];for(let q=0;q<B.length;q++){const j=B[q];z[0]=Math.min(z[0],j.x),z[1]=Math.min(z[1],j.y),z[2]=Math.max(z[2],j.x),z[3]=Math.max(z[3],j.y)}z[0]<Jt&&z[1]<Jt&&z[2]>=0&&z[3]>=0&&S.insert(v,z[0],z[1],z[2],z[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Fl.VectorTile(new cp(this.rawTileData)).layers,this.sourceLayerCoder=new If(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(t,i,o,c){this.loadVTLayers();const d=t.params,m=Jt/t.tileSize/t.scale,v=oo(d.filter),S=t.queryGeometry,I=t.queryPadding*m,B=Bf(S),z=this.grid.query(B.minX-I,B.minY-I,B.maxX+I,B.maxY+I),q=Bf(t.cameraQueryGeometry),j=this.grid3D.query(q.minX-I,q.minY-I,q.maxX+I,q.maxY+I,(ee,le,ve,he)=>function(U,Y,pe,Ee,je){for(const ze of U)if(Y<=ze.x&&pe<=ze.y&&Ee>=ze.x&&je>=ze.y)return!0;const Me=[new C(Y,pe),new C(Y,je),new C(Ee,je),new C(Ee,pe)];if(U.length>2){for(const ze of Me)if(bo(U,ze))return!0}for(let ze=0;ze<U.length-1;ze++)if(vy(U[ze],U[ze+1],Me))return!0;return!1}(t.cameraQueryGeometry,ee-I,le-I,ve+I,he+I));for(const ee of j)z.push(ee);z.sort(L_);const H={};let G;for(let ee=0;ee<z.length;ee++){const le=z[ee];if(le===G)continue;G=le;const ve=this.featureIndexArray.get(le);let he=null;this.loadMatchingFeature(H,ve.bucketIndex,ve.sourceLayerIndex,ve.featureIndex,v,d.layers,d.availableImages,i,o,c,(U,Y,pe)=>(he||(he=vo(U)),Y.queryIntersectsFeature({queryGeometry:S,feature:U,featureState:pe,geometry:he,zoom:this.z,transform:t.transform,pixelsToTileUnits:m,pixelPosMatrix:t.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:t.getElevation})))}return H}loadMatchingFeature(t,i,o,c,d,m,v,S,I,B,z){const q=this.bucketLayerIDs[i];if(m&&!q.some(ee=>m.has(ee)))return;const j=this.sourceLayerCoder.decode(o),H=this.vtLayers[j].feature(c);if(d.needGeometry){const ee=xo(H,!0);if(!d.filter(new lr(this.tileID.overscaledZ),ee,this.tileID.canonical))return}else if(!d.filter(new lr(this.tileID.overscaledZ),H))return;const G=this.getId(H,j);for(let ee=0;ee<q.length;ee++){const le=q[ee];if(m&&!m.has(le))continue;const ve=S[le];if(!ve)continue;let he={};G&&B&&(he=B.getState(ve.sourceLayer||"_geojsonTileLayer",G));const U=Qe({},I[le]);U.paint=Rf(U.paint,ve.paint,H,he,v),U.layout=Rf(U.layout,ve.layout,H,he,v);const Y=!z||z(H,ve,he);if(!Y)continue;const pe=new Mf(H,this.z,this.x,this.y,G);pe.layer=U;let Ee=t[le];Ee===void 0&&(Ee=t[le]=[]),Ee.push({featureIndex:c,feature:pe,intersectionZ:Y})}}lookupSymbolFeatures(t,i,o,c,d,m,v,S){const I={};this.loadVTLayers();const B=oo(d);for(const z of t)this.loadMatchingFeature(I,o,c,z,B,m,v,S,i);return I}hasLayer(t){for(const i of this.bucketLayerIDs)for(const o of i)if(t===o)return!0;return!1}getId(t,i){var o;let c=t.id;return this.promoteId&&(c=t.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[i]],typeof c=="boolean"&&(c=Number(c)),c===void 0&&(!((o=t.properties)===null||o===void 0)&&o.cluster)&&this.promoteId&&(c=Number(t.properties.cluster_id))),c}}function Rf(n,t,i,o,c){return xt(n,(d,m)=>{const v=t instanceof ga?t.get(m):null;return v&&v.evaluate?v.evaluate(i,o,c):v})}function Bf(n){let t=1/0,i=1/0,o=-1/0,c=-1/0;for(const d of n)t=Math.min(t,d.x),i=Math.min(i,d.y),o=Math.max(o,d.x),c=Math.max(c,d.y);return{minX:t,minY:i,maxX:o,maxY:c}}function L_(n,t){return t-n}function Df(n,t,i,o,c){const d=[];for(let m=0;m<n.length;m++){const v=n[m];let S;for(let I=0;I<v.length-1;I++){let B=v[I],z=v[I+1];B.x<t&&z.x<t||(B.x<t?B=new C(t,B.y+(t-B.x)/(z.x-B.x)*(z.y-B.y))._round():z.x<t&&(z=new C(t,B.y+(t-B.x)/(z.x-B.x)*(z.y-B.y))._round()),B.y<i&&z.y<i||(B.y<i?B=new C(B.x+(i-B.y)/(z.y-B.y)*(z.x-B.x),i)._round():z.y<i&&(z=new C(B.x+(i-B.y)/(z.y-B.y)*(z.x-B.x),i)._round()),B.x>=o&&z.x>=o||(B.x>=o?B=new C(o,B.y+(o-B.x)/(z.x-B.x)*(z.y-B.y))._round():z.x>=o&&(z=new C(o,B.y+(o-B.x)/(z.x-B.x)*(z.y-B.y))._round()),B.y>=c&&z.y>=c||(B.y>=c?B=new C(B.x+(c-B.y)/(z.y-B.y)*(z.x-B.x),c)._round():z.y>=c&&(z=new C(B.x+(c-B.y)/(z.y-B.y)*(z.x-B.x),c)._round()),S&&B.equals(S[S.length-1])||(S=[B],d.push(S)),S.push(z)))))}}return d}nt("FeatureIndex",Lf,{omit:["rawTileData","sourceLayerCoder"]});class Ds extends C{constructor(t,i,o,c){super(t,i),this.angle=o,c!==void 0&&(this.segment=c)}clone(){return new Ds(this.x,this.y,this.angle,this.segment)}}function Vf(n,t,i,o,c){if(t.segment===void 0||i===0)return!0;let d=t,m=t.segment+1,v=0;for(;v>-i/2;){if(m--,m<0)return!1;v-=n[m].dist(d),d=n[m]}v+=n[m].dist(n[m+1]),m++;const S=[];let I=0;for(;v<i/2;){const B=n[m],z=n[m+1];if(!z)return!1;let q=n[m-1].angleTo(B)-B.angleTo(z);for(q=Math.abs((q+3*Math.PI)%(2*Math.PI)-Math.PI),S.push({distance:v,angleDelta:q}),I+=q;v-S[0].distance>o;)I-=S.shift().angleDelta;if(I>c)return!1;m++,v+=B.dist(z)}return!0}function zf(n){let t=0;for(let i=0;i<n.length-1;i++)t+=n[i].dist(n[i+1]);return t}function Ff(n,t,i){return n?.6*t*i:0}function Of(n,t){return Math.max(n?n.right-n.left:0,t?t.right-t.left:0)}function R_(n,t,i,o,c,d){const m=Ff(i,c,d),v=Of(i,o)*d;let S=0;const I=zf(n)/2;for(let B=0;B<n.length-1;B++){const z=n[B],q=n[B+1],j=z.dist(q);if(S+j>I){const H=(I-S)/j,G=sn.number(z.x,q.x,H),ee=sn.number(z.y,q.y,H),le=new Ds(G,ee,q.angleTo(z),B);return le._round(),!m||Vf(n,le,v,m,t)?le:void 0}S+=j}}function B_(n,t,i,o,c,d,m,v,S){const I=Ff(o,d,m),B=Of(o,c),z=B*m,q=n[0].x===0||n[0].x===S||n[0].y===0||n[0].y===S;return t-z<t/4&&(t=z+t/4),Nf(n,q?t/2*v%t:(B/2+2*d)*m*v%t,t,I,i,z,q,!1,S)}function Nf(n,t,i,o,c,d,m,v,S){const I=d/2,B=zf(n);let z=0,q=t-i,j=[];for(let H=0;H<n.length-1;H++){const G=n[H],ee=n[H+1],le=G.dist(ee),ve=ee.angleTo(G);for(;q+i<z+le;){q+=i;const he=(q-z)/le,U=sn.number(G.x,ee.x,he),Y=sn.number(G.y,ee.y,he);if(U>=0&&U<S&&Y>=0&&Y<S&&q-I>=0&&q+I<=B){const pe=new Ds(U,Y,ve,H);pe._round(),o&&!Vf(n,pe,d,o,c)||j.push(pe)}}z+=le}return v||j.length||m||(j=Nf(n,z/2,i,o,c,d,m,!0,S)),j}nt("Anchor",Ds);const Hl=Bi;function qf(n,t,i,o){const c=[],d=n.image,m=d.pixelRatio,v=d.paddedRect.w-2*Hl,S=d.paddedRect.h-2*Hl;let I={x1:n.left,y1:n.top,x2:n.right,y2:n.bottom};const B=d.stretchX||[[0,v]],z=d.stretchY||[[0,S]],q=(Oe,st)=>Oe+st[1]-st[0],j=B.reduce(q,0),H=z.reduce(q,0),G=v-j,ee=S-H;let le=0,ve=j,he=0,U=H,Y=0,pe=G,Ee=0,je=ee;if(d.content&&o){const Oe=d.content,st=Oe[2]-Oe[0],mt=Oe[3]-Oe[1];(d.textFitWidth||d.textFitHeight)&&(I=df(n)),le=du(B,0,Oe[0]),he=du(z,0,Oe[1]),ve=du(B,Oe[0],Oe[2]),U=du(z,Oe[1],Oe[3]),Y=Oe[0]-le,Ee=Oe[1]-he,pe=st-ve,je=mt-U}const Me=I.x1,ze=I.y1,Ke=I.x2-Me,We=I.y2-ze,Je=(Oe,st,mt,pt)=>{const lt=fu(Oe.stretch-le,ve,Ke,Me),Vt=mu(Oe.fixed-Y,pe,Oe.stretch,j),Sr=fu(st.stretch-he,U,We,ze),Hr=mu(st.fixed-Ee,je,st.stretch,H),di=fu(mt.stretch-le,ve,Ke,Me),Yi=mu(mt.fixed-Y,pe,mt.stretch,j),Di=fu(pt.stretch-he,U,We,ze),ni=mu(pt.fixed-Ee,je,pt.stretch,H),_r=new C(lt,Sr),Qr=new C(di,Sr),si=new C(di,Di),oi=new C(lt,Di),Ci=new C(Vt/m,Hr/m),$i=new C(Yi/m,ni/m),Yr=t*Math.PI/180;if(Yr){const $r=Math.sin(Yr),ei=Math.cos(Yr),Nr=[ei,-$r,$r,ei];_r._matMult(Nr),Qr._matMult(Nr),oi._matMult(Nr),si._matMult(Nr)}const Vi=Oe.stretch+Oe.fixed,Zr=st.stretch+st.fixed;return{tl:_r,tr:Qr,bl:oi,br:si,tex:{x:d.paddedRect.x+Hl+Vi,y:d.paddedRect.y+Hl+Zr,w:mt.stretch+mt.fixed-Vi,h:pt.stretch+pt.fixed-Zr},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Ci,pixelOffsetBR:$i,minFontScaleX:pe/m/Ke,minFontScaleY:je/m/We,isSDF:i}};if(o&&(d.stretchX||d.stretchY)){const Oe=Uf(B,G,j),st=Uf(z,ee,H);for(let mt=0;mt<Oe.length-1;mt++){const pt=Oe[mt],lt=Oe[mt+1];for(let Vt=0;Vt<st.length-1;Vt++)c.push(Je(pt,st[Vt],lt,st[Vt+1]))}}else c.push(Je({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:v+1},{fixed:0,stretch:S+1}));return c}function du(n,t,i){let o=0;for(const c of n)o+=Math.max(t,Math.min(i,c[1]))-Math.max(t,Math.min(i,c[0]));return o}function Uf(n,t,i){const o=[{fixed:-1,stretch:0}];for(const[c,d]of n){const m=o[o.length-1];o.push({fixed:c-m.stretch,stretch:m.stretch}),o.push({fixed:c-m.stretch,stretch:m.stretch+(d-c)})}return o.push({fixed:t+Hl,stretch:i}),o}function fu(n,t,i,o){return n/t*i+o}function mu(n,t,i,o){return n-t*i/o}class gu{constructor(t,i,o,c,d,m,v,S,I,B){var z;if(this.boxStartIndex=t.length,I){let q=m.top,j=m.bottom;const H=m.collisionPadding;H&&(q-=H[1],j+=H[3]);let G=j-q;G>0&&(G=Math.max(10,G),this.circleDiameter=G)}else{const q=!((z=m.image)===null||z===void 0)&&z.content&&(m.image.textFitWidth||m.image.textFitHeight)?df(m):{x1:m.left,y1:m.top,x2:m.right,y2:m.bottom};q.y1=q.y1*v-S[0],q.y2=q.y2*v+S[2],q.x1=q.x1*v-S[3],q.x2=q.x2*v+S[1];const j=m.collisionPadding;if(j&&(q.x1-=j[0]*v,q.y1-=j[1]*v,q.x2+=j[2]*v,q.y2+=j[3]*v),B){const H=new C(q.x1,q.y1),G=new C(q.x2,q.y1),ee=new C(q.x1,q.y2),le=new C(q.x2,q.y2),ve=B*Math.PI/180;H._rotate(ve),G._rotate(ve),ee._rotate(ve),le._rotate(ve),q.x1=Math.min(H.x,G.x,ee.x,le.x),q.x2=Math.max(H.x,G.x,ee.x,le.x),q.y1=Math.min(H.y,G.y,ee.y,le.y),q.y2=Math.max(H.y,G.y,ee.y,le.y)}t.emplaceBack(i.x,i.y,q.x1,q.y1,q.x2,q.y2,o,c,d)}this.boxEndIndex=t.length}}class D_{constructor(t=[],i=(o,c)=>o<c?-1:o>c?1:0){if(this.data=t,this.length=this.data.length,this.compare=i,this.length>0)for(let o=(this.length>>1)-1;o>=0;o--)this._down(o)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;const t=this.data[0],i=this.data.pop();return--this.length>0&&(this.data[0]=i,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:i,compare:o}=this,c=i[t];for(;t>0;){const d=t-1>>1,m=i[d];if(o(c,m)>=0)break;i[t]=m,t=d}i[t]=c}_down(t){const{data:i,compare:o}=this,c=this.length>>1,d=i[t];for(;t<c;){let m=1+(t<<1);const v=m+1;if(v<this.length&&o(i[v],i[m])<0&&(m=v),o(i[m],d)>=0)break;i[t]=i[m],t=m}i[t]=d}}function V_(n,t=1,i=!1){let o=1/0,c=1/0,d=-1/0,m=-1/0;const v=n[0];for(let j=0;j<v.length;j++){const H=v[j];(!j||H.x<o)&&(o=H.x),(!j||H.y<c)&&(c=H.y),(!j||H.x>d)&&(d=H.x),(!j||H.y>m)&&(m=H.y)}const S=Math.min(d-o,m-c);let I=S/2;const B=new D_([],z_);if(S===0)return new C(o,c);for(let j=o;j<d;j+=S)for(let H=c;H<m;H+=S)B.push(new Aa(j+I,H+I,I,n));let z=function(j){let H=0,G=0,ee=0;const le=j[0];for(let ve=0,he=le.length,U=he-1;ve<he;U=ve++){const Y=le[ve],pe=le[U],Ee=Y.x*pe.y-pe.x*Y.y;G+=(Y.x+pe.x)*Ee,ee+=(Y.y+pe.y)*Ee,H+=3*Ee}return new Aa(G/H,ee/H,0,j)}(n),q=B.length;for(;B.length;){const j=B.pop();(j.d>z.d||!z.d)&&(z=j,i&&console.log("found best %d after %d probes",Math.round(1e4*j.d)/1e4,q)),j.max-z.d<=t||(I=j.h/2,B.push(new Aa(j.p.x-I,j.p.y-I,I,n)),B.push(new Aa(j.p.x+I,j.p.y-I,I,n)),B.push(new Aa(j.p.x-I,j.p.y+I,I,n)),B.push(new Aa(j.p.x+I,j.p.y+I,I,n)),q+=4)}return i&&(console.log(`num probes: ${q}`),console.log(`best distance: ${z.d}`)),z.p}function z_(n,t){return t.max-n.max}function Aa(n,t,i,o){this.p=new C(n,t),this.h=i,this.d=function(c,d){let m=!1,v=1/0;for(let S=0;S<d.length;S++){const I=d[S];for(let B=0,z=I.length,q=z-1;B<z;q=B++){const j=I[B],H=I[q];j.y>c.y!=H.y>c.y&&c.x<(H.x-j.x)*(c.y-j.y)/(H.y-j.y)+j.x&&(m=!m),v=Math.min(v,bd(c,j,H))}}return(m?1:-1)*Math.sqrt(v)}(this.p,o),this.max=this.d+this.h*Math.SQRT2}var pi;x.aB=void 0,(pi=x.aB||(x.aB={}))[pi.center=1]="center",pi[pi.left=2]="left",pi[pi.right=3]="right",pi[pi.top=4]="top",pi[pi.bottom=5]="bottom",pi[pi["top-left"]=6]="top-left",pi[pi["top-right"]=7]="top-right",pi[pi["bottom-left"]=8]="bottom-left",pi[pi["bottom-right"]=9]="bottom-right";const Vs=7,wp=Number.POSITIVE_INFINITY;function jf(n,t){return t[1]!==wp?function(i,o,c){let d=0,m=0;switch(o=Math.abs(o),c=Math.abs(c),i){case"top-right":case"top-left":case"top":m=c-Vs;break;case"bottom-right":case"bottom-left":case"bottom":m=-c+Vs}switch(i){case"top-right":case"bottom-right":case"right":d=-o;break;case"top-left":case"bottom-left":case"left":d=o}return[d,m]}(n,t[0],t[1]):function(i,o){let c=0,d=0;o<0&&(o=0);const m=o/Math.SQRT2;switch(i){case"top-right":case"top-left":d=m-Vs;break;case"bottom-right":case"bottom-left":d=-m+Vs;break;case"bottom":d=-o+Vs;break;case"top":d=o-Vs}switch(i){case"top-right":case"bottom-right":c=-m;break;case"top-left":case"bottom-left":c=m;break;case"left":c=o;break;case"right":c=-o}return[c,d]}(n,t[0])}function Wf(n,t,i){var o;const c=n.layout,d=(o=c.get("text-variable-anchor-offset"))===null||o===void 0?void 0:o.evaluate(t,{},i);if(d){const v=d.values,S=[];for(let I=0;I<v.length;I+=2){const B=S[I]=v[I],z=v[I+1].map(q=>q*Wr);B.startsWith("top")?z[1]-=Vs:B.startsWith("bottom")&&(z[1]+=Vs),S[I+1]=z}return new gi(S)}const m=c.get("text-variable-anchor");if(m){let v;v=n._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[c.get("text-radial-offset").evaluate(t,{},i)*Wr,wp]:c.get("text-offset").evaluate(t,{},i).map(I=>I*Wr);const S=[];for(const I of m)S.push(I,jf(I,v));return new gi(S)}return null}function Sp(n){switch(n){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function F_(n,t,i,o,c,d,m,v,S,I,B,z){let q=d.textMaxSize.evaluate(t,{});q===void 0&&(q=m);const j=n.layers[0].layout,H=j.get("icon-offset").evaluate(t,{},B),G=Zf(i.horizontal),ee=m/24,le=n.tilePixelRatio*ee,ve=n.tilePixelRatio*q/24,he=n.tilePixelRatio*v,U=n.tilePixelRatio*j.get("symbol-spacing"),Y=j.get("text-padding")*n.tilePixelRatio,pe=function(mt,pt,lt,Vt=1){const Sr=mt.get("icon-padding").evaluate(pt,{},lt),Hr=Sr&&Sr.values;return[Hr[0]*Vt,Hr[1]*Vt,Hr[2]*Vt,Hr[3]*Vt]}(j,t,B,n.tilePixelRatio),Ee=j.get("text-max-angle")/180*Math.PI,je=j.get("text-rotation-alignment")!=="viewport"&&j.get("symbol-placement")!=="point",Me=j.get("icon-rotation-alignment")==="map"&&j.get("symbol-placement")!=="point",ze=j.get("symbol-placement"),Ke=U/2,We=j.get("icon-text-fit");let Je;o&&We!=="none"&&(n.allowVerticalPlacement&&i.vertical&&(Je=ff(o,i.vertical,We,j.get("icon-text-fit-padding"),H,ee)),G&&(o=ff(o,G,We,j.get("icon-text-fit-padding"),H,ee)));const Oe=B?z.line.getGranularityForZoomLevel(B.z):1,st=(mt,pt)=>{pt.x<0||pt.x>=Jt||pt.y<0||pt.y>=Jt||function(lt,Vt,Sr,Hr,di,Yi,Di,ni,_r,Qr,si,oi,Ci,$i,Yr,Vi,Zr,$r,ei,Nr,ur,yn,Ca,_n,q_){const Ta=lt.addToLineVertexArray(Vt,Sr);let ko,Ea,Pa,Ia,Xf=0,Qf=0,Yf=0,$f=0,Mp=-1,Lp=-1;const rs={};let em=mn("");if(lt.allowVerticalPlacement&&Hr.vertical){const vi=ni.layout.get("text-rotate").evaluate(ur,{},_n)+90;Pa=new gu(_r,Vt,Qr,si,oi,Hr.vertical,Ci,$i,Yr,vi),Di&&(Ia=new gu(_r,Vt,Qr,si,oi,Di,Zr,$r,Yr,vi))}if(di){const vi=ni.layout.get("icon-rotate").evaluate(ur,{}),en=ni.layout.get("icon-text-fit")!=="none",Ao=qf(di,vi,Ca,en),xn=Di?qf(Di,vi,Ca,en):void 0;Ea=new gu(_r,Vt,Qr,si,oi,di,Zr,$r,!1,vi),Xf=4*Ao.length;const Co=lt.iconSizeData;let Dn=null;Co.kind==="source"?(Dn=[Bn*ni.layout.get("icon-size").evaluate(ur,{})],Dn[0]>Rs&&_t(`${lt.layerIds[0]}: Value for "icon-size" is >= ${jl}. Reduce your "icon-size".`)):Co.kind==="composite"&&(Dn=[Bn*yn.compositeIconSizes[0].evaluate(ur,{},_n),Bn*yn.compositeIconSizes[1].evaluate(ur,{},_n)],(Dn[0]>Rs||Dn[1]>Rs)&&_t(`${lt.layerIds[0]}: Value for "icon-size" is >= ${jl}. Reduce your "icon-size".`)),lt.addSymbols(lt.icon,Ao,Dn,Nr,ei,ur,x.al.none,Vt,Ta.lineStartIndex,Ta.lineLength,-1,_n),Mp=lt.icon.placedSymbolArray.length-1,xn&&(Qf=4*xn.length,lt.addSymbols(lt.icon,xn,Dn,Nr,ei,ur,x.al.vertical,Vt,Ta.lineStartIndex,Ta.lineLength,-1,_n),Lp=lt.icon.placedSymbolArray.length-1)}const tm=Object.keys(Hr.horizontal);for(const vi of tm){const en=Hr.horizontal[vi];if(!ko){em=mn(en.text);const xn=ni.layout.get("text-rotate").evaluate(ur,{},_n);ko=new gu(_r,Vt,Qr,si,oi,en,Ci,$i,Yr,xn)}const Ao=en.positionedLines.length===1;if(Yf+=Hf(lt,Vt,en,Yi,ni,Yr,ur,Vi,Ta,Hr.vertical?x.al.horizontal:x.al.horizontalOnly,Ao?tm:[vi],rs,Mp,yn,_n),Ao)break}Hr.vertical&&($f+=Hf(lt,Vt,Hr.vertical,Yi,ni,Yr,ur,Vi,Ta,x.al.vertical,["vertical"],rs,Lp,yn,_n));const U_=ko?ko.boxStartIndex:lt.collisionBoxArray.length,j_=ko?ko.boxEndIndex:lt.collisionBoxArray.length,W_=Pa?Pa.boxStartIndex:lt.collisionBoxArray.length,H_=Pa?Pa.boxEndIndex:lt.collisionBoxArray.length,Z_=Ea?Ea.boxStartIndex:lt.collisionBoxArray.length,K_=Ea?Ea.boxEndIndex:lt.collisionBoxArray.length,G_=Ia?Ia.boxStartIndex:lt.collisionBoxArray.length,J_=Ia?Ia.boxEndIndex:lt.collisionBoxArray.length;let vn=-1;const _u=(vi,en)=>vi&&vi.circleDiameter?Math.max(vi.circleDiameter,en):en;vn=_u(ko,vn),vn=_u(Pa,vn),vn=_u(Ea,vn),vn=_u(Ia,vn);const rm=vn>-1?1:0;rm&&(vn*=q_/Wr),lt.glyphOffsetArray.length>=Sa.MAX_GLYPHS&&_t("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),ur.sortKey!==void 0&&lt.addToSortKeyRanges(lt.symbolInstances.length,ur.sortKey);const X_=Wf(ni,ur,_n),[Q_,Y_]=function(vi,en){const Ao=vi.length,xn=en==null?void 0:en.values;if((xn==null?void 0:xn.length)>0)for(let Co=0;Co<xn.length;Co+=2){const Dn=xn[Co+1];vi.emplaceBack(x.aB[xn[Co]],Dn[0],Dn[1])}return[Ao,vi.length]}(lt.textAnchorOffsets,X_);lt.symbolInstances.emplaceBack(Vt.x,Vt.y,rs.right>=0?rs.right:-1,rs.center>=0?rs.center:-1,rs.left>=0?rs.left:-1,rs.vertical||-1,Mp,Lp,em,U_,j_,W_,H_,Z_,K_,G_,J_,Qr,Yf,$f,Xf,Qf,rm,0,Ci,vn,Q_,Y_)}(n,pt,mt,i,o,c,Je,n.layers[0],n.collisionBoxArray,t.index,t.sourceLayerIndex,n.index,le,[Y,Y,Y,Y],je,S,he,pe,Me,H,t,d,I,B,m)};if(ze==="line")for(const mt of Df(t.geometry,0,0,Jt,Jt)){const pt=So(mt,Oe),lt=B_(pt,U,Ee,i.vertical||G,o,24,ve,n.overscaling,Jt);for(const Vt of lt)G&&O_(n,G.text,Ke,Vt)||st(pt,Vt)}else if(ze==="line-center"){for(const mt of t.geometry)if(mt.length>1){const pt=So(mt,Oe),lt=R_(pt,Ee,i.vertical||G,o,24,ve);lt&&st(pt,lt)}}else if(t.type==="Polygon")for(const mt of jo(t.geometry,0)){const pt=V_(mt,16);st(So(mt[0],Oe,!0),new Ds(pt.x,pt.y,0))}else if(t.type==="LineString")for(const mt of t.geometry){const pt=So(mt,Oe);st(pt,new Ds(pt[0].x,pt[0].y,0))}else if(t.type==="Point")for(const mt of t.geometry)for(const pt of mt)st([pt],new Ds(pt.x,pt.y,0))}function Hf(n,t,i,o,c,d,m,v,S,I,B,z,q,j,H){const G=function(ve,he,U,Y,pe,Ee,je,Me){const ze=Y.layout.get("text-rotate").evaluate(Ee,{})*Math.PI/180,Ke=[];for(const We of he.positionedLines)for(const Je of We.positionedGlyphs){if(!Je.rect)continue;const Oe=Je.rect||{};let st=p_+1,mt=!0,pt=1,lt=0;const Vt=(pe||Me)&&Je.vertical,Sr=Je.metrics.advance*Je.scale/2;if(Me&&he.verticalizable&&(lt=We.lineOffset/2-(Je.imageName?-(Wr-Je.metrics.width*Je.scale)/2:(Je.scale-1)*Wr)),Je.imageName){const $r=je[Je.imageName];mt=$r.sdf,pt=$r.pixelRatio,st=Bi/pt}const Hr=pe?[Je.x+Sr,Je.y]:[0,0];let di=pe?[0,0]:[Je.x+Sr+U[0],Je.y+U[1]-lt],Yi=[0,0];Vt&&(Yi=di,di=[0,0]);const Di=Je.metrics.isDoubleResolution?2:1,ni=(Je.metrics.left-st)*Je.scale-Sr+di[0],_r=(-Je.metrics.top-st)*Je.scale+di[1],Qr=ni+Oe.w/Di*Je.scale/pt,si=_r+Oe.h/Di*Je.scale/pt,oi=new C(ni,_r),Ci=new C(Qr,_r),$i=new C(ni,si),Yr=new C(Qr,si);if(Vt){const $r=new C(-Sr,Sr-lu),ei=-Math.PI/2,Nr=Wr/2-Sr,ur=new C(5-lu-Nr,-(Je.imageName?Nr:0)),yn=new C(...Yi);oi._rotateAround(ei,$r)._add(ur)._add(yn),Ci._rotateAround(ei,$r)._add(ur)._add(yn),$i._rotateAround(ei,$r)._add(ur)._add(yn),Yr._rotateAround(ei,$r)._add(ur)._add(yn)}if(ze){const $r=Math.sin(ze),ei=Math.cos(ze),Nr=[ei,-$r,$r,ei];oi._matMult(Nr),Ci._matMult(Nr),$i._matMult(Nr),Yr._matMult(Nr)}const Vi=new C(0,0),Zr=new C(0,0);Ke.push({tl:oi,tr:Ci,bl:$i,br:Yr,tex:Oe,writingMode:he.writingMode,glyphOffset:Hr,sectionIndex:Je.sectionIndex,isSDF:mt,pixelOffsetTL:Vi,pixelOffsetBR:Zr,minFontScaleX:0,minFontScaleY:0})}return Ke}(0,i,v,c,d,m,o,n.allowVerticalPlacement),ee=n.textSizeData;let le=null;ee.kind==="source"?(le=[Bn*c.layout.get("text-size").evaluate(m,{})],le[0]>Rs&&_t(`${n.layerIds[0]}: Value for "text-size" is >= ${jl}. Reduce your "text-size".`)):ee.kind==="composite"&&(le=[Bn*j.compositeTextSizes[0].evaluate(m,{},H),Bn*j.compositeTextSizes[1].evaluate(m,{},H)],(le[0]>Rs||le[1]>Rs)&&_t(`${n.layerIds[0]}: Value for "text-size" is >= ${jl}. Reduce your "text-size".`)),n.addSymbols(n.text,G,le,v,d,m,I,t,S.lineStartIndex,S.lineLength,q,H);for(const ve of B)z[ve]=n.text.placedSymbolArray.length-1;return 4*G.length}function Zf(n){for(const t in n)return n[t];return null}function O_(n,t,i,o){const c=n.compareText;if(t in c){const d=c[t];for(let m=d.length-1;m>=0;m--)if(o.dist(d[m])<i)return!0}else c[t]=[];return c[t].push(o),!1}const Kf=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class kp{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[i,o]=new Uint8Array(t,0,2);if(i!==219)throw new Error("Data does not appear to be in a KDBush format.");const c=o>>4;if(c!==1)throw new Error(`Got v${c} data when expected v1.`);const d=Kf[15&o];if(!d)throw new Error("Unrecognized array type.");const[m]=new Uint16Array(t,2,1),[v]=new Uint32Array(t,4,1);return new kp(v,m,d,t)}constructor(t,i=64,o=Float64Array,c){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+i,2),65535),this.ArrayType=o,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const d=Kf.indexOf(this.ArrayType),m=2*t*this.ArrayType.BYTES_PER_ELEMENT,v=t*this.IndexArrayType.BYTES_PER_ELEMENT,S=(8-v%8)%8;if(d<0)throw new Error(`Unexpected typed array class: ${o}.`);c&&c instanceof ArrayBuffer?(this.data=c,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+v+S,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+m+v+S),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+v+S,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+d]),new Uint16Array(this.data,2,1)[0]=i,new Uint32Array(this.data,4,1)[0]=t)}add(t,i){const o=this._pos>>1;return this.ids[o]=o,this.coords[this._pos++]=t,this.coords[this._pos++]=i,o}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return Ap(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,i,o,c){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:d,coords:m,nodeSize:v}=this,S=[0,d.length-1,0],I=[];for(;S.length;){const B=S.pop()||0,z=S.pop()||0,q=S.pop()||0;if(z-q<=v){for(let ee=q;ee<=z;ee++){const le=m[2*ee],ve=m[2*ee+1];le>=t&&le<=o&&ve>=i&&ve<=c&&I.push(d[ee])}continue}const j=q+z>>1,H=m[2*j],G=m[2*j+1];H>=t&&H<=o&&G>=i&&G<=c&&I.push(d[j]),(B===0?t<=H:i<=G)&&(S.push(q),S.push(j-1),S.push(1-B)),(B===0?o>=H:c>=G)&&(S.push(j+1),S.push(z),S.push(1-B))}return I}within(t,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:c,coords:d,nodeSize:m}=this,v=[0,c.length-1,0],S=[],I=o*o;for(;v.length;){const B=v.pop()||0,z=v.pop()||0,q=v.pop()||0;if(z-q<=m){for(let ee=q;ee<=z;ee++)Jf(d[2*ee],d[2*ee+1],t,i)<=I&&S.push(c[ee]);continue}const j=q+z>>1,H=d[2*j],G=d[2*j+1];Jf(H,G,t,i)<=I&&S.push(c[j]),(B===0?t-o<=H:i-o<=G)&&(v.push(q),v.push(j-1),v.push(1-B)),(B===0?t+o>=H:i+o>=G)&&(v.push(j+1),v.push(z),v.push(1-B))}return S}}function Ap(n,t,i,o,c,d){if(c-o<=i)return;const m=o+c>>1;Gf(n,t,m,o,c,d),Ap(n,t,i,o,m-1,1-d),Ap(n,t,i,m+1,c,1-d)}function Gf(n,t,i,o,c,d){for(;c>o;){if(c-o>600){const I=c-o+1,B=i-o+1,z=Math.log(I),q=.5*Math.exp(2*z/3),j=.5*Math.sqrt(z*q*(I-q)/I)*(B-I/2<0?-1:1);Gf(n,t,i,Math.max(o,Math.floor(i-B*q/I+j)),Math.min(c,Math.floor(i+(I-B)*q/I+j)),d)}const m=t[2*i+d];let v=o,S=c;for(Zl(n,t,o,i),t[2*c+d]>m&&Zl(n,t,o,c);v<S;){for(Zl(n,t,v,S),v++,S--;t[2*v+d]<m;)v++;for(;t[2*S+d]>m;)S--}t[2*o+d]===m?Zl(n,t,o,S):(S++,Zl(n,t,S,c)),S<=i&&(o=S+1),i<=S&&(c=S-1)}}function Zl(n,t,i,o){Cp(n,i,o),Cp(t,2*i,2*o),Cp(t,2*i+1,2*o+1)}function Cp(n,t,i){const o=n[t];n[t]=n[i],n[i]=o}function Jf(n,t,i,o){const c=n-i,d=t-o;return c*c+d*d}var Tp;x.co=void 0,(Tp=x.co||(x.co={})).create="create",Tp.load="load",Tp.fullLoad="fullLoad";let yu=null,Kl=[];const Ep=1e3/60,Pp="loadTime",Ip="fullLoadTime",N_={mark(n){performance.mark(n)},frame(n){const t=n;yu!=null&&Kl.push(t-yu),yu=t},clearMetrics(){yu=null,Kl=[],performance.clearMeasures(Pp),performance.clearMeasures(Ip);for(const n in x.co)performance.clearMarks(x.co[n])},getPerformanceMetrics(){performance.measure(Pp,x.co.create,x.co.load),performance.measure(Ip,x.co.create,x.co.fullLoad);const n=performance.getEntriesByName(Pp)[0].duration,t=performance.getEntriesByName(Ip)[0].duration,i=Kl.length,o=1/(Kl.reduce((d,m)=>d+m,0)/i/1e3),c=Kl.filter(d=>d>Ep).reduce((d,m)=>d+(m-Ep)/Ep,0);return{loadTime:n,fullLoadTime:t,fps:o,percentDroppedFrames:c/(i+c)*100,totalFrames:i}}};x.$=Wl,x.A=Ce,x.B=sn,x.C=lr,x.D=ct,x.E=_e,x.F=Vh,x.G=function(n){if(bi==null){const t=n.navigator?n.navigator.userAgent:null;bi=!!n.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return bi},x.H=class{constructor(n,t){this.target=n,this.mapId=t,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new I_(()=>this.process()),this.subscription=ir(this.target,"message",i=>this.receive(i),!1),this.globalScope=er(self)?n:window}registerMessageHandler(n,t){this.messageHandlers[n]=t}sendAsync(n,t){return new Promise((i,o)=>{const c=Math.round(1e18*Math.random()).toString(36).substring(0,10),d=t?ir(t.signal,"abort",()=>{d==null||d.unsubscribe(),delete this.resolveRejects[c];const S={id:c,type:"<cancel>",origin:location.origin,targetMapId:n.targetMapId,sourceMapId:this.mapId};this.target.postMessage(S)},M_):null;this.resolveRejects[c]={resolve:S=>{d==null||d.unsubscribe(),i(S)},reject:S=>{d==null||d.unsubscribe(),o(S)}};const m=[],v=Object.assign(Object.assign({},n),{id:c,sourceMapId:this.mapId,origin:location.origin,data:Ps(n.data,m)});this.target.postMessage(v,{transfer:m})})}receive(n){const t=n.data,i=t.id;if(!(t.origin!=="file://"&&location.origin!=="file://"&&t.origin!=="resource://android"&&location.origin!=="resource://android"&&t.origin!==location.origin||t.targetMapId&&this.mapId!==t.targetMapId)){if(t.type==="<cancel>"){delete this.tasks[i];const o=this.abortControllers[i];return delete this.abortControllers[i],void(o&&o.abort())}if(er(self)||t.mustQueue)return this.tasks[i]=t,this.taskQueue.push(i),void this.invoker.trigger();this.processTask(i,t)}}process(){if(this.taskQueue.length===0)return;const n=this.taskQueue.shift(),t=this.tasks[n];delete this.tasks[n],this.taskQueue.length>0&&this.invoker.trigger(),t&&this.processTask(n,t)}processTask(n,t){return s(this,void 0,void 0,function*(){if(t.type==="<response>"){const c=this.resolveRejects[n];return delete this.resolveRejects[n],c?void(t.error?c.reject(uo(t.error)):c.resolve(uo(t.data))):void 0}if(!this.messageHandlers[t.type])return void this.completeTask(n,new Error(`Could not find a registered handler for ${t.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const i=uo(t.data),o=new AbortController;this.abortControllers[n]=o;try{const c=yield this.messageHandlers[t.type](t.sourceMapId,i,o);this.completeTask(n,null,c)}catch(c){this.completeTask(n,c)}})}completeTask(n,t,i){const o=[];delete this.abortControllers[n];const c={id:n,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:t?Ps(t):null,data:Ps(i,o)};this.target.postMessage(c,{transfer:o})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},x.I=hp,x.J=wi,x.K=function(){var n=new Ce(16);return Ce!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0),n[0]=1,n[5]=1,n[10]=1,n[15]=1,n},x.L=function(n,t,i){var o,c,d,m,v,S,I,B,z,q,j,H,G=i[0],ee=i[1],le=i[2];return t===n?(n[12]=t[0]*G+t[4]*ee+t[8]*le+t[12],n[13]=t[1]*G+t[5]*ee+t[9]*le+t[13],n[14]=t[2]*G+t[6]*ee+t[10]*le+t[14],n[15]=t[3]*G+t[7]*ee+t[11]*le+t[15]):(c=t[1],d=t[2],m=t[3],v=t[4],S=t[5],I=t[6],B=t[7],z=t[8],q=t[9],j=t[10],H=t[11],n[0]=o=t[0],n[1]=c,n[2]=d,n[3]=m,n[4]=v,n[5]=S,n[6]=I,n[7]=B,n[8]=z,n[9]=q,n[10]=j,n[11]=H,n[12]=o*G+v*ee+z*le+t[12],n[13]=c*G+S*ee+q*le+t[13],n[14]=d*G+I*ee+j*le+t[14],n[15]=m*G+B*ee+H*le+t[15]),n},x.M=function(n,t,i){var o=i[0],c=i[1],d=i[2];return n[0]=t[0]*o,n[1]=t[1]*o,n[2]=t[2]*o,n[3]=t[3]*o,n[4]=t[4]*c,n[5]=t[5]*c,n[6]=t[6]*c,n[7]=t[7]*c,n[8]=t[8]*d,n[9]=t[9]*d,n[10]=t[10]*d,n[11]=t[11]*d,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},x.N=function(n,t,i){var o=t[0],c=t[1],d=t[2],m=t[3],v=t[4],S=t[5],I=t[6],B=t[7],z=t[8],q=t[9],j=t[10],H=t[11],G=t[12],ee=t[13],le=t[14],ve=t[15],he=i[0],U=i[1],Y=i[2],pe=i[3];return n[0]=he*o+U*v+Y*z+pe*G,n[1]=he*c+U*S+Y*q+pe*ee,n[2]=he*d+U*I+Y*j+pe*le,n[3]=he*m+U*B+Y*H+pe*ve,n[4]=(he=i[4])*o+(U=i[5])*v+(Y=i[6])*z+(pe=i[7])*G,n[5]=he*c+U*S+Y*q+pe*ee,n[6]=he*d+U*I+Y*j+pe*le,n[7]=he*m+U*B+Y*H+pe*ve,n[8]=(he=i[8])*o+(U=i[9])*v+(Y=i[10])*z+(pe=i[11])*G,n[9]=he*c+U*S+Y*q+pe*ee,n[10]=he*d+U*I+Y*j+pe*le,n[11]=he*m+U*B+Y*H+pe*ve,n[12]=(he=i[12])*o+(U=i[13])*v+(Y=i[14])*z+(pe=i[15])*G,n[13]=he*c+U*S+Y*q+pe*ee,n[14]=he*d+U*I+Y*j+pe*le,n[15]=he*m+U*B+Y*H+pe*ve,n},x.O=function(n,t){const i={};for(let o=0;o<t.length;o++){const c=t[o];c in n&&(i[c]=n[c])}return i},x.P=C,x.Q=Bs,x.R=Xi,x.S=kf,x.T=Jc,x.U=Sf,x.V=Se,x.W=$,x.X=Qt,x.Y=Qi,x.Z=Jt,x._=s,x.a=qr,x.a$=function(n,t,i){var o=Math.sin(i),c=Math.cos(i),d=t[4],m=t[5],v=t[6],S=t[7],I=t[8],B=t[9],z=t[10],q=t[11];return t!==n&&(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15]),n[4]=d*c+I*o,n[5]=m*c+B*o,n[6]=v*c+z*o,n[7]=S*c+q*o,n[8]=I*c-d*o,n[9]=B*c-m*o,n[10]=z*c-v*o,n[11]=q*c-S*o,n},x.a0=25,x.a1=bp,x.a2=n=>{const t=window.document.createElement("video");return t.muted=!0,new Promise(i=>{t.onloadstart=()=>{i(t)};for(const o of n){const c=window.document.createElement("source");we(o)||(t.crossOrigin="Anonymous"),c.src=o,t.appendChild(c)}})},x.a3=Ve,x.a4=function(){return ut++},x.a5=ae,x.a6=Sa,x.a7=oo,x.a8=xo,x.a9=Mf,x.aA=function(n,t,i,o,c=!1){if(!i[0]&&!i[1])return[0,0];const d=c?o==="map"?-n.bearingInRadians:0:o==="viewport"?n.bearingInRadians:0;if(d){const m=Math.sin(d),v=Math.cos(d);i=[i[0]*v-i[1]*m,i[0]*m+i[1]*v]}return[c?i[0]:nn(t,i[0],n.zoom),c?i[1]:nn(t,i[1],n.zoom)]},x.aC=fp,x.aD=Sp,x.aE=dp,x.aF=kp,x.aG=fr,x.aH=su,x.aI=De,x.aJ=Zt,x.aK=Ht,x.aL=et,x.aM=bt,x.aN=Cf,x.aO=function(n,t,i){return n[0]=t[0]*i,n[1]=t[1]*i,n[2]=t[2]*i,n},x.aP=function(n,t,i){return n[0]=t[0]+i[0],n[1]=t[1]+i[1],n[2]=t[2]+i[2],n},x.aQ=function(n){var t=new Ce(3);return t[0]=n[0],t[1]=n[1],t[2]=n[2],t},x.aR=function(n,t,i){return n[0]=t[0]*i[0],n[1]=t[1]*i[1],n[2]=t[2]*i[2],n[3]=t[3]*i[3],n},x.aS=function(n,t,i){return n[0]=t[0]-i[0],n[1]=t[1]-i[1],n[2]=t[2]-i[2],n},x.aT=function(n,t){var i=t[0],o=t[1],c=t[2],d=i*i+o*o+c*c;return d>0&&(d=1/Math.sqrt(d)),n[0]=t[0]*d,n[1]=t[1]*d,n[2]=t[2]*d,n},x.aU=function(n,t,i){var o=t[0],c=t[1],d=t[2],m=i[0],v=i[1],S=i[2];return n[0]=c*S-d*v,n[1]=d*m-o*S,n[2]=o*v-c*m,n},x.aV=function(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]},x.aW=Ef,x.aX=ka,x.aY=function(n,t,i,o,c){var d,m=1/Math.tan(t/2);return n[0]=m/i,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=m,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,c!=null&&c!==1/0?(n[10]=(c+o)*(d=1/(o-c)),n[14]=2*c*o*d):(n[10]=-1,n[14]=-2*o),n},x.aZ=function(n){var t=new Ce(16);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},x.a_=function(n,t,i){var o=Math.sin(i),c=Math.cos(i),d=t[0],m=t[1],v=t[2],S=t[3],I=t[4],B=t[5],z=t[6],q=t[7];return t!==n&&(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[0]=d*c+I*o,n[1]=m*c+B*o,n[2]=v*c+z*o,n[3]=S*c+q*o,n[4]=I*c-d*o,n[5]=B*c-m*o,n[6]=z*c-v*o,n[7]=q*c-S*o,n},x.aa=function(n){const t={};if(n.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(i,o,c,d)=>{const m=c||d;return t[o]=!m||m.toLowerCase(),""}),t["max-age"]){const i=parseInt(t["max-age"],10);isNaN(i)?delete t["max-age"]:t["max-age"]=i}return t},x.ab=Xt,x.ac=function(n){return Math.pow(2,n)},x.ad=Ze,x.ae=Lr,x.af=85.051129,x.ag=Af,x.ah=function(n){return Math.log(n)/Math.LN2},x.ai=function(n){var t=n[0],i=n[1];return t*t+i*i},x.aj=function(n,t){const i=[];for(const o in n)o in t||i.push(o);return i},x.ak=function(n,t){let i=0,o=0;if(n.kind==="constant")o=n.layoutSize;else if(n.kind!=="source"){const{interpolationType:c,minZoom:d,maxZoom:m}=n,v=c?Lr(ui.interpolationFactor(c,t,d,m),0,1):0;n.kind==="camera"?o=sn.number(n.minSize,n.maxSize,v):i=v}return{uSizeT:i,uSize:o}},x.am=function(n,{uSize:t,uSizeT:i},{lowerSize:o,upperSize:c}){return n.kind==="source"?o/Bn:n.kind==="composite"?sn.number(o/Bn,c/Bn,i):t},x.an=function(n,t){var i=t[0],o=t[1],c=t[2],d=t[3],m=t[4],v=t[5],S=t[6],I=t[7],B=t[8],z=t[9],q=t[10],j=t[11],H=t[12],G=t[13],ee=t[14],le=t[15],ve=i*v-o*m,he=i*S-c*m,U=i*I-d*m,Y=o*S-c*v,pe=o*I-d*v,Ee=c*I-d*S,je=B*G-z*H,Me=B*ee-q*H,ze=B*le-j*H,Ke=z*ee-q*G,We=z*le-j*G,Je=q*le-j*ee,Oe=ve*Je-he*We+U*Ke+Y*ze-pe*Me+Ee*je;return Oe?(n[0]=(v*Je-S*We+I*Ke)*(Oe=1/Oe),n[1]=(c*We-o*Je-d*Ke)*Oe,n[2]=(G*Ee-ee*pe+le*Y)*Oe,n[3]=(q*pe-z*Ee-j*Y)*Oe,n[4]=(S*ze-m*Je-I*Me)*Oe,n[5]=(i*Je-c*ze+d*Me)*Oe,n[6]=(ee*U-H*Ee-le*he)*Oe,n[7]=(B*Ee-q*U+j*he)*Oe,n[8]=(m*We-v*ze+I*je)*Oe,n[9]=(o*ze-i*We-d*je)*Oe,n[10]=(H*pe-G*U+le*ve)*Oe,n[11]=(z*U-B*pe-j*ve)*Oe,n[12]=(v*Me-m*Ke-S*je)*Oe,n[13]=(i*Ke-o*Me+c*je)*Oe,n[14]=(G*he-H*Y-ee*ve)*Oe,n[15]=(B*Y-z*he+q*ve)*Oe,n):null},x.ao=hr,x.ap=function(n){return Math.hypot(n[0],n[1])},x.aq=function(n){return n[0]=0,n[1]=0,n},x.ar=function(n,t,i){return n[0]=t[0]*i,n[1]=t[1]*i,n},x.as=mp,x.at=Lt,x.au=function(n,t,i,o){const c=t.y-n.y,d=t.x-n.x,m=o.y-i.y,v=o.x-i.x,S=m*d-v*c;if(S===0)return null;const I=(v*(n.y-i.y)-m*(n.x-i.x))/S;return new C(n.x+I*d,n.y+I*c)},x.av=Df,x.aw=vd,x.ax=function(n){let t=1/0,i=1/0,o=-1/0,c=-1/0;for(const d of n)t=Math.min(t,d.x),i=Math.min(i,d.y),o=Math.max(o,d.x),c=Math.max(c,d.y);return[t,i,o,c]},x.ay=Wr,x.az=nn,x.b=Yt,x.b$=class extends K{},x.b0=function(){const n=new Float32Array(16);return Ze(n),n},x.b1=function(){const n=new Float64Array(16);return Ze(n),n},x.b2=function(){return new Float64Array(16)},x.b3=function(n,t,i){const o=new Float64Array(4);return function(c,d,m,v){var S=.5*Math.PI/180;d*=S,m*=S,v*=S;var I=Math.sin(d),B=Math.cos(d),z=Math.sin(m),q=Math.cos(m),j=Math.sin(v),H=Math.cos(v);c[0]=I*q*H-B*z*j,c[1]=B*z*H+I*q*j,c[2]=B*q*j-I*z*H,c[3]=B*q*H+I*z*j}(o,n,t-90,i),o},x.b4=function(n,t,i,o){var c,d,m,v,S,I=t[0],B=t[1],z=t[2],q=t[3],j=i[0],H=i[1],G=i[2],ee=i[3];return(d=I*j+B*H+z*G+q*ee)<0&&(d=-d,j=-j,H=-H,G=-G,ee=-ee),1-d>de?(c=Math.acos(d),m=Math.sin(c),v=Math.sin((1-o)*c)/m,S=Math.sin(o*c)/m):(v=1-o,S=o),n[0]=v*I+S*j,n[1]=v*B+S*H,n[2]=v*z+S*G,n[3]=v*q+S*ee,n},x.b5=function(n){const t=new Float64Array(9);var i,o,c,d,m,v,S,I,B,z,q,j,H,G,ee,le,ve,he;z=(c=(o=n)[0])*(S=c+c),q=(d=o[1])*S,H=(m=o[2])*S,G=m*(I=d+d),le=(v=o[3])*S,ve=v*I,he=v*(B=m+m),(i=t)[0]=1-(j=d*I)-(ee=m*B),i[3]=q-he,i[6]=H+ve,i[1]=q+he,i[4]=1-z-ee,i[7]=G-le,i[2]=H-ve,i[5]=G+le,i[8]=1-z-j;const U=bt(-Math.asin(Lr(t[2],-1,1)));let Y,pe;return Math.hypot(t[5],t[8])<.001?(Y=0,pe=-bt(Math.atan2(t[3],t[4]))):(Y=bt(t[5]===0&&t[8]===0?0:Math.atan2(t[5],t[8])),pe=bt(t[1]===0&&t[0]===0?0:Math.atan2(t[1],t[0]))),{roll:Y,pitch:U+90,bearing:pe}},x.b6=function(n,t){return n.roll==t.roll&&n.pitch==t.pitch&&n.bearing==t.bearing},x.b7=Ot,x.b8=ya,x.b9=ba,x.bA=function(n){if(n.type==="custom")return new P_(n);switch(n.type){case"background":return new C_(n);case"circle":return new by(n);case"fill":return new Ny(n);case"fill-extrusion":return new Gy(n);case"heatmap":return new Sy(n);case"hillshade":return new Ay(n);case"line":return new r_(n);case"raster":return new E_(n);case"symbol":return new pu(n)}},x.bB=ht,x.bC=function(n,t){if(!n)return[{command:"setStyle",args:[t]}];let i=[];try{if(!Ae(n.version,t.version))return[{command:"setStyle",args:[t]}];Ae(n.center,t.center)||i.push({command:"setCenter",args:[t.center]}),Ae(n.state,t.state)||i.push({command:"setGlobalState",args:[t.state]}),Ae(n.centerAltitude,t.centerAltitude)||i.push({command:"setCenterAltitude",args:[t.centerAltitude]}),Ae(n.zoom,t.zoom)||i.push({command:"setZoom",args:[t.zoom]}),Ae(n.bearing,t.bearing)||i.push({command:"setBearing",args:[t.bearing]}),Ae(n.pitch,t.pitch)||i.push({command:"setPitch",args:[t.pitch]}),Ae(n.roll,t.roll)||i.push({command:"setRoll",args:[t.roll]}),Ae(n.sprite,t.sprite)||i.push({command:"setSprite",args:[t.sprite]}),Ae(n.glyphs,t.glyphs)||i.push({command:"setGlyphs",args:[t.glyphs]}),Ae(n.transition,t.transition)||i.push({command:"setTransition",args:[t.transition]}),Ae(n.light,t.light)||i.push({command:"setLight",args:[t.light]}),Ae(n.terrain,t.terrain)||i.push({command:"setTerrain",args:[t.terrain]}),Ae(n.sky,t.sky)||i.push({command:"setSky",args:[t.sky]}),Ae(n.projection,t.projection)||i.push({command:"setProjection",args:[t.projection]});const o={},c=[];(function(m,v,S,I){let B;for(B in v=v||{},m=m||{})Object.prototype.hasOwnProperty.call(m,B)&&(Object.prototype.hasOwnProperty.call(v,B)||Ue(B,S,I));for(B in v)Object.prototype.hasOwnProperty.call(v,B)&&(Object.prototype.hasOwnProperty.call(m,B)?Ae(m[B],v[B])||(m[B].type==="geojson"&&v[B].type==="geojson"&&rt(m,v,B)?Ie(S,{command:"setGeoJSONSourceData",args:[B,v[B].data]}):$e(B,v,S,I)):ke(B,v,S))})(n.sources,t.sources,c,o);const d=[];n.layers&&n.layers.forEach(m=>{"source"in m&&o[m.source]?i.push({command:"removeLayer",args:[m.id]}):d.push(m)}),i=i.concat(c),function(m,v,S){v=v||[];const I=(m=m||[]).map(Tt),B=v.map(Tt),z=m.reduce(St,{}),q=v.reduce(St,{}),j=I.slice(),H=Object.create(null);let G,ee,le,ve,he;for(let U=0,Y=0;U<I.length;U++)G=I[U],Object.prototype.hasOwnProperty.call(q,G)?Y++:(Ie(S,{command:"removeLayer",args:[G]}),j.splice(j.indexOf(G,Y),1));for(let U=0,Y=0;U<B.length;U++)G=B[B.length-1-U],j[j.length-1-U]!==G&&(Object.prototype.hasOwnProperty.call(z,G)?(Ie(S,{command:"removeLayer",args:[G]}),j.splice(j.lastIndexOf(G,j.length-Y),1)):Y++,ve=j[j.length-U],Ie(S,{command:"addLayer",args:[q[G],ve]}),j.splice(j.length-U,0,G),H[G]=!0);for(let U=0;U<B.length;U++)if(G=B[U],ee=z[G],le=q[G],!H[G]&&!Ae(ee,le))if(Ae(ee.source,le.source)&&Ae(ee["source-layer"],le["source-layer"])&&Ae(ee.type,le.type)){for(he in ft(ee.layout,le.layout,S,G,null,"setLayoutProperty"),ft(ee.paint,le.paint,S,G,null,"setPaintProperty"),Ae(ee.filter,le.filter)||Ie(S,{command:"setFilter",args:[G,le.filter]}),Ae(ee.minzoom,le.minzoom)&&Ae(ee.maxzoom,le.maxzoom)||Ie(S,{command:"setLayerZoomRange",args:[G,le.minzoom,le.maxzoom]}),ee)Object.prototype.hasOwnProperty.call(ee,he)&&he!=="layout"&&he!=="paint"&&he!=="filter"&&he!=="metadata"&&he!=="minzoom"&&he!=="maxzoom"&&(he.indexOf("paint.")===0?ft(ee[he],le[he],S,G,he.slice(6),"setPaintProperty"):Ae(ee[he],le[he])||Ie(S,{command:"setLayerProperty",args:[G,he,le[he]]}));for(he in le)Object.prototype.hasOwnProperty.call(le,he)&&!Object.prototype.hasOwnProperty.call(ee,he)&&he!=="layout"&&he!=="paint"&&he!=="filter"&&he!=="metadata"&&he!=="minzoom"&&he!=="maxzoom"&&(he.indexOf("paint.")===0?ft(ee[he],le[he],S,G,he.slice(6),"setPaintProperty"):Ae(ee[he],le[he])||Ie(S,{command:"setLayerProperty",args:[G,he,le[he]]}))}else Ie(S,{command:"removeLayer",args:[G]}),ve=j[j.lastIndexOf(G)+1],Ie(S,{command:"addLayer",args:[le,ve]})}(d,t.layers,i)}catch(o){console.warn("Unable to compute style diff:",o),i=[{command:"setStyle",args:[t]}]}return i},x.bD=function(n){const t=[],i=n.id;return i===void 0&&t.push({message:`layers.${i}: missing required property "id"`}),n.render===void 0&&t.push({message:`layers.${i}: missing required method "render"`}),n.renderingMode&&n.renderingMode!=="2d"&&n.renderingMode!=="3d"&&t.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),t},x.bE=function n(t,i){if(Array.isArray(t)){if(!Array.isArray(i)||t.length!==i.length)return!1;for(let o=0;o<t.length;o++)if(!n(t[o],i[o]))return!1;return!0}if(typeof t=="object"&&t!==null&&i!==null){if(typeof i!="object"||Object.keys(t).length!==Object.keys(i).length)return!1;for(const o in t)if(!n(t[o],i[o]))return!1;return!0}return t===i},x.bF=xt,x.bG=ot,x.bH=class extends cr{constructor(n,t){super(n,t),this.current=0}set(n){this.current!==n&&(this.current=n,this.gl.uniform1i(this.location,n))}},x.bI=eu,x.bJ=class extends cr{constructor(n,t){super(n,t),this.current=Uh}set(n){if(n[12]!==this.current[12]||n[0]!==this.current[0])return this.current=n,void this.gl.uniformMatrix4fv(this.location,!1,n);for(let t=1;t<16;t++)if(n[t]!==this.current[t]){this.current=n,this.gl.uniformMatrix4fv(this.location,!1,n);break}}},x.bK=$c,x.bL=class extends cr{constructor(n,t){super(n,t),this.current=[0,0,0]}set(n){n[0]===this.current[0]&&n[1]===this.current[1]&&n[2]===this.current[2]||(this.current=n,this.gl.uniform3f(this.location,n[0],n[1],n[2]))}},x.bM=class extends cr{constructor(n,t){super(n,t),this.current=[0,0]}set(n){n[0]===this.current[0]&&n[1]===this.current[1]||(this.current=n,this.gl.uniform2f(this.location,n[0],n[1]))}},x.bN=Re,x.bO=function(n,t){var i=Math.sin(t),o=Math.cos(t);return n[0]=o,n[1]=i,n[2]=0,n[3]=-i,n[4]=o,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n},x.bP=function(n,t,i){var o=t[0],c=t[1],d=t[2];return n[0]=o*i[0]+c*i[3]+d*i[6],n[1]=o*i[1]+c*i[4]+d*i[7],n[2]=o*i[2]+c*i[5]+d*i[8],n},x.bQ=function(n,t,i,o,c,d,m){var v=1/(t-i),S=1/(o-c),I=1/(d-m);return n[0]=-2*v,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=-2*S,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=2*I,n[11]=0,n[12]=(t+i)*v,n[13]=(c+o)*S,n[14]=(m+d)*I,n[15]=1,n},x.bR=class extends cr{constructor(n,t){super(n,t),this.current=new Array}set(n){if(n!=this.current){this.current=n;const t=new Float32Array(4*n.length);for(let i=0;i<n.length;i++)t[4*i]=n[i].r,t[4*i+1]=n[i].g,t[4*i+2]=n[i].b,t[4*i+3]=n[i].a;this.gl.uniform4fv(this.location,t)}}},x.bS=class extends cr{constructor(n,t){super(n,t),this.current=new Array}set(n){if(n!=this.current){this.current=n;const t=new Float32Array(n);this.gl.uniform1fv(this.location,t)}}},x.bT=class extends p{},x.bU=o_,x.bV=class extends w{},x.bW=Jh,x.bX=function(n){return n<=1?1:Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))},x.bY=Pd,x.bZ=function(n,t,i){var o=t[0],c=t[1],d=t[2],m=i[3]*o+i[7]*c+i[11]*d+i[15];return n[0]=(i[0]*o+i[4]*c+i[8]*d+i[12])/(m=m||1),n[1]=(i[1]*o+i[5]*c+i[9]*d+i[13])/m,n[2]=(i[2]*o+i[6]*c+i[10]*d+i[14])/m,n},x.b_=class extends $n{},x.ba=Vl,x.bb=xa,x.bc=kn,x.bd=Kr,x.be=Ai,x.bf=function(n,t,i,o,c){return kn(o,c,Lr((n-t)/(i-t),0,1))},x.bg=Ei,x.bh=function(){return new Float64Array(3)},x.bi=function(n,t,i,o){return n[0]=t[0]+i[0]*o,n[1]=t[1]+i[1]*o,n[2]=t[2]+i[2]*o,n},x.bj=vt,x.bk=function(){return new Float64Array(4)},x.bl=function(n,t,i,o){var c=[],d=[];return c[0]=t[0]-i[0],c[1]=t[1]-i[1],c[2]=t[2]-i[2],d[0]=c[0]*Math.cos(o)-c[1]*Math.sin(o),d[1]=c[0]*Math.sin(o)+c[1]*Math.cos(o),d[2]=c[2],n[0]=d[0]+i[0],n[1]=d[1]+i[1],n[2]=d[2]+i[2],n},x.bm=function(n,t,i,o){var c=[],d=[];return c[0]=t[0]-i[0],c[1]=t[1]-i[1],c[2]=t[2]-i[2],d[0]=c[0],d[1]=c[1]*Math.cos(o)-c[2]*Math.sin(o),d[2]=c[1]*Math.sin(o)+c[2]*Math.cos(o),n[0]=d[0]+i[0],n[1]=d[1]+i[1],n[2]=d[2]+i[2],n},x.bn=function(n,t,i,o){var c=[],d=[];return c[0]=t[0]-i[0],c[1]=t[1]-i[1],c[2]=t[2]-i[2],d[0]=c[2]*Math.sin(o)+c[0]*Math.cos(o),d[1]=c[1],d[2]=c[2]*Math.cos(o)-c[0]*Math.sin(o),n[0]=d[0]+i[0],n[1]=d[1]+i[1],n[2]=d[2]+i[2],n},x.bo=tt,x.bp=function(n,t,i){var o=Math.sin(i),c=Math.cos(i),d=t[0],m=t[1],v=t[2],S=t[3],I=t[8],B=t[9],z=t[10],q=t[11];return t!==n&&(n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15]),n[0]=d*c-I*o,n[1]=m*c-B*o,n[2]=v*c-z*o,n[3]=S*c-q*o,n[8]=d*o+I*c,n[9]=m*o+B*c,n[10]=v*o+z*c,n[11]=S*o+q*c,n},x.bq=function(n,t){const i=Ei(n,360),o=Ei(t,360),c=o-i,d=o>i?c-360:c+360;return Math.abs(c)<Math.abs(d)?c:d},x.br=function(n){return n[0]=0,n[1]=0,n[2]=0,n},x.bs=function(n,t,i,o){const c=Math.sqrt(n*n+t*t),d=Math.sqrt(i*i+o*o);n/=c,t/=c,i/=d,o/=d;const m=Math.acos(n*i+t*o);return-t*i+n*o>0?m:-m},x.bt=function(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]},x.bu=vp,x.bv=function(n,t){const i=Ei(n,2*Math.PI),o=Ei(t,2*Math.PI);return Math.min(Math.abs(i-o),Math.abs(i-o+2*Math.PI),Math.abs(i-o-2*Math.PI))},x.bw=function(){const n={},t=te.$version;for(const i in te.$root){const o=te.$root[i];if(o.required){let c=null;c=i==="version"?t:o.type==="array"?[]:{},c!=null&&(n[i]=c)}}return n},x.bx=_l,x.by=nr,x.bz=function(n){n=n.slice();const t=Object.create(null);for(let i=0;i<n.length;i++)t[n[i].id]=n[i];for(let i=0;i<n.length;i++)"ref"in n[i]&&(n[i]=be(n[i],t[n[i].ref]));return n},x.c=zt,x.c0=function(n,t){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]},x.c1=function(n,t){var i=n[0],o=n[1],c=n[2],d=n[3],m=n[4],v=n[5],S=n[6],I=n[7],B=n[8],z=n[9],q=n[10],j=n[11],H=n[12],G=n[13],ee=n[14],le=n[15],ve=t[0],he=t[1],U=t[2],Y=t[3],pe=t[4],Ee=t[5],je=t[6],Me=t[7],ze=t[8],Ke=t[9],We=t[10],Je=t[11],Oe=t[12],st=t[13],mt=t[14],pt=t[15];return Math.abs(i-ve)<=de*Math.max(1,Math.abs(i),Math.abs(ve))&&Math.abs(o-he)<=de*Math.max(1,Math.abs(o),Math.abs(he))&&Math.abs(c-U)<=de*Math.max(1,Math.abs(c),Math.abs(U))&&Math.abs(d-Y)<=de*Math.max(1,Math.abs(d),Math.abs(Y))&&Math.abs(m-pe)<=de*Math.max(1,Math.abs(m),Math.abs(pe))&&Math.abs(v-Ee)<=de*Math.max(1,Math.abs(v),Math.abs(Ee))&&Math.abs(S-je)<=de*Math.max(1,Math.abs(S),Math.abs(je))&&Math.abs(I-Me)<=de*Math.max(1,Math.abs(I),Math.abs(Me))&&Math.abs(B-ze)<=de*Math.max(1,Math.abs(B),Math.abs(ze))&&Math.abs(z-Ke)<=de*Math.max(1,Math.abs(z),Math.abs(Ke))&&Math.abs(q-We)<=de*Math.max(1,Math.abs(q),Math.abs(We))&&Math.abs(j-Je)<=de*Math.max(1,Math.abs(j),Math.abs(Je))&&Math.abs(H-Oe)<=de*Math.max(1,Math.abs(H),Math.abs(Oe))&&Math.abs(G-st)<=de*Math.max(1,Math.abs(G),Math.abs(st))&&Math.abs(ee-mt)<=de*Math.max(1,Math.abs(ee),Math.abs(mt))&&Math.abs(le-pt)<=de*Math.max(1,Math.abs(le),Math.abs(pt))},x.c2=function(n,t){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},x.c3=n=>n.type==="symbol",x.c4=n=>n.type==="circle",x.c5=n=>n.type==="heatmap",x.c6=n=>n.type==="line",x.c7=n=>n.type==="fill",x.c8=n=>n.type==="fill-extrusion",x.c9=n=>n.type==="hillshade",x.cA=ep,x.cB=sp,x.cC=Fl,x.cD=cp,x.cE=class{constructor(n){this._marks={start:[n.url,"start"].join("#"),end:[n.url,"end"].join("#"),measure:n.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let n=performance.getEntriesByName(this._marks.measure);return n.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),n=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),n}},x.cF=function(n,t,i,o,c){return s(this,void 0,void 0,function*(){if($())try{return yield Qt(n,t,i,o,c)}catch{}return function(d,m,v,S,I){const B=d.width,z=d.height;Rr&&ai||(Rr=new OffscreenCanvas(B,z),ai=Rr.getContext("2d",{willReadFrequently:!0})),Rr.width=B,Rr.height=z,ai.drawImage(d,0,0,B,z);const q=ai.getImageData(m,v,S,I);return ai.clearRect(0,0,B,z),q.data}(n,t,i,o,c)})},x.cG=Pf,x.cH=V,x.cI=F,x.cJ=Zd,x.cK=sf,x.cL=ra,x.cM=fn,x.ca=n=>n.type==="raster",x.cb=n=>n.type==="background",x.cc=n=>n.type==="custom",x.cd=as,x.ce=function(n,t,i){const o=xi(t.x-i.x,t.y-i.y),c=xi(n.x-i.x,n.y-i.y);var d,m;return bt(Math.atan2(o[0]*c[1]-o[1]*c[0],(d=o)[0]*(m=c)[0]+d[1]*m[1]))},x.cf=Pi,x.cg=function(n,t){return Br[t]&&(n instanceof MouseEvent||n instanceof WheelEvent)},x.ch=function(n,t){return Er[t]&&"touches"in n},x.ci=function(n){return Er[n]||Br[n]},x.cj=function(n,t,i){var o=t[0],c=t[1];return n[0]=i[0]*o+i[4]*c+i[12],n[1]=i[1]*o+i[5]*c+i[13],n},x.ck=function(n,t){const{x:i,y:o}=Wl.fromLngLat(t);return!(n<0||n>25||o<0||o>=1||i<0||i>=1)},x.cl=function(n,t){return n[0]=t[0],n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=t[1],n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=t[2],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n},x.cm=class extends go{},x.cn=N_,x.cp=function(n){return n.message===Cr},x.cq=Dr,x.cr=function(n,t){qr.REGISTERED_PROTOCOLS[n]=t},x.cs=function(n){delete qr.REGISTERED_PROTOCOLS[n]},x.ct=function(n,t){const i={};for(let c=0;c<n.length;c++){const d=t&&t[n[c].id]||Fc(n[c]);t&&(t[n[c].id]=d);let m=i[d];m||(m=i[d]=[]),m.push(n[c])}const o=[];for(const c in i)o.push(i[c]);return o},x.cu=nt,x.cv=If,x.cw=Lf,x.cx=af,x.cy=function(n){n.bucket.createArrays(),n.bucket.tilePixelRatio=Jt/(512*n.bucket.overscaling),n.bucket.compareText={},n.bucket.iconsNeedLinear=!1;const t=n.bucket.layers[0],i=t.layout,o=t._unevaluatedLayout._values,c={layoutIconSize:o["icon-size"].possiblyEvaluate(new lr(n.bucket.zoom+1),n.canonical),layoutTextSize:o["text-size"].possiblyEvaluate(new lr(n.bucket.zoom+1),n.canonical),textMaxSize:o["text-size"].possiblyEvaluate(new lr(18))};if(n.bucket.textSizeData.kind==="composite"){const{minZoom:I,maxZoom:B}=n.bucket.textSizeData;c.compositeTextSizes=[o["text-size"].possiblyEvaluate(new lr(I),n.canonical),o["text-size"].possiblyEvaluate(new lr(B),n.canonical)]}if(n.bucket.iconSizeData.kind==="composite"){const{minZoom:I,maxZoom:B}=n.bucket.iconSizeData;c.compositeIconSizes=[o["icon-size"].possiblyEvaluate(new lr(I),n.canonical),o["icon-size"].possiblyEvaluate(new lr(B),n.canonical)]}const d=i.get("text-line-height")*Wr,m=i.get("text-rotation-alignment")!=="viewport"&&i.get("symbol-placement")!=="point",v=i.get("text-keep-upright"),S=i.get("text-size");for(const I of n.bucket.features){const B=i.get("text-font").evaluate(I,{},n.canonical).join(","),z=S.evaluate(I,{},n.canonical),q=c.layoutTextSize.evaluate(I,{},n.canonical),j=c.layoutIconSize.evaluate(I,{},n.canonical),H={horizontal:{},vertical:void 0},G=I.text;let ee,le=[0,0];if(G){const U=G.toString(),Y=i.get("text-letter-spacing").evaluate(I,{},n.canonical)*Wr,pe=zh(U)?Y:0,Ee=i.get("text-anchor").evaluate(I,{},n.canonical),je=Wf(t,I,n.canonical);if(!je){const We=i.get("text-radial-offset").evaluate(I,{},n.canonical);le=We?jf(Ee,[We*Wr,wp]):i.get("text-offset").evaluate(I,{},n.canonical).map(Je=>Je*Wr)}let Me=m?"center":i.get("text-justify").evaluate(I,{},n.canonical);const ze=i.get("symbol-placement")==="point"?i.get("text-max-width").evaluate(I,{},n.canonical)*Wr:1/0,Ke=()=>{n.bucket.allowVerticalPlacement&&da(U)&&(H.vertical=cu(G,n.glyphMap,n.glyphPositions,n.imagePositions,B,ze,d,Ee,"left",pe,le,x.al.vertical,!0,q,z))};if(!m&&je){const We=new Set;if(Me==="auto")for(let Oe=0;Oe<je.values.length;Oe+=2)We.add(Sp(je.values[Oe]));else We.add(Me);let Je=!1;for(const Oe of We)if(!H.horizontal[Oe])if(Je)H.horizontal[Oe]=H.horizontal[0];else{const st=cu(G,n.glyphMap,n.glyphPositions,n.imagePositions,B,ze,d,"center",Oe,pe,le,x.al.horizontal,!1,q,z);st&&(H.horizontal[Oe]=st,Je=st.positionedLines.length===1)}Ke()}else{Me==="auto"&&(Me=Sp(Ee));const We=cu(G,n.glyphMap,n.glyphPositions,n.imagePositions,B,ze,d,Ee,Me,pe,le,x.al.horizontal,!1,q,z);We&&(H.horizontal[Me]=We),Ke(),da(U)&&m&&v&&(H.vertical=cu(G,n.glyphMap,n.glyphPositions,n.imagePositions,B,ze,d,Ee,Me,pe,le,x.al.vertical,!1,q,z))}}let ve=!1;if(I.icon&&I.icon.name){const U=n.imageMap[I.icon.name];U&&(ee=b_(n.imagePositions[I.icon.name],i.get("icon-offset").evaluate(I,{},n.canonical),i.get("icon-anchor").evaluate(I,{},n.canonical)),ve=!!U.sdf,n.bucket.sdfIcons===void 0?n.bucket.sdfIcons=ve:n.bucket.sdfIcons!==ve&&_t("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(U.pixelRatio!==n.bucket.pixelRatio||i.get("icon-rotate").constantOr(1)!==0)&&(n.bucket.iconsNeedLinear=!0))}const he=Zf(H.horizontal)||H.vertical;n.bucket.iconsInText=!!he&&he.iconsInText,(he||ee)&&F_(n.bucket,I,H,ee,n.imageMap,c,q,j,le,ve,n.canonical,n.subdivisionGranularity)}n.showCollisionBoxes&&n.bucket.generateCollisionDebugBuffers()},x.cz=op,x.d=we,x.e=Qe,x.f=n=>s(void 0,void 0,void 0,function*(){if(n.byteLength===0)return createImageBitmap(new ImageData(1,1));const t=new Blob([new Uint8Array(n)],{type:"image/png"});try{return createImageBitmap(t)}catch(i){throw new Error(`Could not load image because of ${i.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),x.g=li,x.h=n=>new Promise((t,i)=>{const o=new Image;o.onload=()=>{t(o),URL.revokeObjectURL(o.src),o.onload=null,window.requestAnimationFrame(()=>{o.src=Fi})},o.onerror=()=>i(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const c=new Blob([new Uint8Array(n)],{type:"image/png"});o.src=n.byteLength?URL.createObjectURL(c):Fi}),x.i=er,x.j=(n,t)=>Vr(Qe(n,{type:"json"}),t),x.k=ce,x.l=re,x.m=Vr,x.n=(n,t)=>Vr(Qe(n,{type:"arrayBuffer"}),t),x.o=function(n){return new cp(n).readFields(c_,[])},x.p=of,x.q=Ml,x.r=zr,x.s=ir,x.t=ca,x.u=Bt,x.v=te,x.w=_t,x.x=yl,x.y=Ts,x.z=function([n,t,i]){return t+=90,t*=Math.PI/180,i*=Math.PI/180,{x:n*Math.cos(t)*Math.sin(i),y:n*Math.sin(t)*Math.sin(i),z:n*Math.cos(i)}}}),k("worker",["./shared"],function(x){class s{constructor(Q){this.keyCache={},Q&&this.replace(Q)}replace(Q){this._layerConfigs={},this._layers={},this.update(Q,[])}update(Q,X){for(const ce of Q){this._layerConfigs[ce.id]=ce;const _e=this._layers[ce.id]=x.bA(ce);_e._featureFilter=x.a7(_e.filter),this.keyCache[ce.id]&&delete this.keyCache[ce.id]}for(const ce of X)delete this.keyCache[ce],delete this._layerConfigs[ce],delete this._layers[ce];this.familiesBySource={};const re=x.ct(Object.values(this._layerConfigs),this.keyCache);for(const ce of re){const _e=ce.map(ke=>this._layers[ke.id]),te=_e[0];if(te.visibility==="none")continue;const Pe=te.source||"";let be=this.familiesBySource[Pe];be||(be=this.familiesBySource[Pe]={});const Ae=te.sourceLayer||"_geojsonTileLayer";let Ie=be[Ae];Ie||(Ie=be[Ae]=[]),Ie.push(_e)}}}class V{constructor(Q){const X={},re=[];for(const Pe in Q){const be=Q[Pe],Ae=X[Pe]={};for(const Ie in be){const ke=be[+Ie];if(!ke||ke.bitmap.width===0||ke.bitmap.height===0)continue;const Ue={x:0,y:0,w:ke.bitmap.width+2,h:ke.bitmap.height+2};re.push(Ue),Ae[Ie]={rect:Ue,metrics:ke.metrics}}}const{w:ce,h:_e}=x.p(re),te=new x.q({width:ce||1,height:_e||1});for(const Pe in Q){const be=Q[Pe];for(const Ae in be){const Ie=be[+Ae];if(!Ie||Ie.bitmap.width===0||Ie.bitmap.height===0)continue;const ke=X[Pe][Ae].rect;x.q.copy(Ie.bitmap,te,{x:0,y:0},{x:ke.x+1,y:ke.y+1},Ie.bitmap)}}this.image=te,this.positions=X}}x.cu("GlyphAtlas",V);class P{constructor(Q){this.tileID=new x.Y(Q.tileID.overscaledZ,Q.tileID.wrap,Q.tileID.canonical.z,Q.tileID.canonical.x,Q.tileID.canonical.y),this.uid=Q.uid,this.zoom=Q.zoom,this.pixelRatio=Q.pixelRatio,this.tileSize=Q.tileSize,this.source=Q.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=Q.showCollisionBoxes,this.collectResourceTiming=!!Q.collectResourceTiming,this.returnDependencies=!!Q.returnDependencies,this.promoteId=Q.promoteId,this.inFlightDependencies=[]}parse(Q,X,re,ce,_e){return x._(this,void 0,void 0,function*(){this.status="parsing",this.data=Q,this.collisionBoxArray=new x.a5;const te=new x.cv(Object.keys(Q.layers).sort()),Pe=new x.cw(this.tileID,this.promoteId);Pe.bucketLayerIDs=[];const be={},Ae={featureIndex:Pe,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:re,subdivisionGranularity:_e},Ie=X.familiesBySource[this.source];for(const wt in Ie){const qe=Q.layers[wt];if(!qe)continue;qe.version===1&&x.w(`Vector tile source "${this.source}" layer "${wt}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const gt=te.encode(wt),Et=[];for(let vr=0;vr<qe.length;vr++){const xr=qe.feature(vr),Si=Pe.getId(xr,wt);Et.push({feature:xr,id:Si,index:vr,sourceLayerIndex:gt})}for(const vr of Ie[wt]){const xr=vr[0];xr.source!==this.source&&x.w(`layer.source = ${xr.source} does not equal this.source = ${this.source}`),xr.minzoom&&this.zoom<Math.floor(xr.minzoom)||xr.maxzoom&&this.zoom>=xr.maxzoom||xr.visibility!=="none"&&(L(vr,this.zoom,re),(be[xr.id]=xr.createBucket({index:Pe.bucketLayerIDs.length,layers:vr,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:gt,sourceID:this.source})).populate(Et,Ae,this.tileID.canonical),Pe.bucketLayerIDs.push(vr.map(Si=>Si.id)))}}const ke=x.bF(Ae.glyphDependencies,wt=>Object.keys(wt).map(Number));this.inFlightDependencies.forEach(wt=>wt==null?void 0:wt.abort()),this.inFlightDependencies=[];let Ue=Promise.resolve({});if(Object.keys(ke).length){const wt=new AbortController;this.inFlightDependencies.push(wt),Ue=ce.sendAsync({type:"GG",data:{stacks:ke,source:this.source,tileID:this.tileID,type:"glyphs"}},wt)}const $e=Object.keys(Ae.iconDependencies);let rt=Promise.resolve({});if($e.length){const wt=new AbortController;this.inFlightDependencies.push(wt),rt=ce.sendAsync({type:"GI",data:{icons:$e,source:this.source,tileID:this.tileID,type:"icons"}},wt)}const ft=Object.keys(Ae.patternDependencies);let Tt=Promise.resolve({});if(ft.length){const wt=new AbortController;this.inFlightDependencies.push(wt),Tt=ce.sendAsync({type:"GI",data:{icons:ft,source:this.source,tileID:this.tileID,type:"patterns"}},wt)}const[St,Ve,Kt]=yield Promise.all([Ue,rt,Tt]),Ft=new V(St),Wt=new x.cx(Ve,Kt);for(const wt in be){const qe=be[wt];qe instanceof x.a6?(L(qe.layers,this.zoom,re),x.cy({bucket:qe,glyphMap:St,glyphPositions:Ft.positions,imageMap:Ve,imagePositions:Wt.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical,subdivisionGranularity:Ae.subdivisionGranularity})):qe.hasPattern&&(qe instanceof x.cz||qe instanceof x.cA||qe instanceof x.cB)&&(L(qe.layers,this.zoom,re),qe.addFeatures(Ae,this.tileID.canonical,Wt.patternPositions))}return this.status="done",{buckets:Object.values(be).filter(wt=>!wt.isEmpty()),featureIndex:Pe,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Ft.image,imageAtlas:Wt,glyphMap:this.returnDependencies?St:null,iconMap:this.returnDependencies?Ve:null,glyphPositions:this.returnDependencies?Ft.positions:null}})}}function L(we,Q,X){const re=new x.C(Q);for(const ce of we)ce.recalculate(re,X)}class F{constructor(Q,X,re){this.actor=Q,this.layerIndex=X,this.availableImages=re,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(Q,X){return x._(this,void 0,void 0,function*(){const re=yield x.n(Q.request,X);try{return{vectorTile:new x.cC.VectorTile(new x.cD(re.data)),rawData:re.data,cacheControl:re.cacheControl,expires:re.expires}}catch(ce){const _e=new Uint8Array(re.data);let te=`Unable to parse the tile at ${Q.request.url}, `;throw te+=_e[0]===31&&_e[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${ce.message}`,new Error(te)}})}loadTile(Q){return x._(this,void 0,void 0,function*(){const X=Q.uid,re=!!(Q&&Q.request&&Q.request.collectResourceTiming)&&new x.cE(Q.request),ce=new P(Q);this.loading[X]=ce;const _e=new AbortController;ce.abort=_e;try{const te=yield this.loadVectorTile(Q,_e);if(delete this.loading[X],!te)return null;const Pe=te.rawData,be={};te.expires&&(be.expires=te.expires),te.cacheControl&&(be.cacheControl=te.cacheControl);const Ae={};if(re){const ke=re.finish();ke&&(Ae.resourceTiming=JSON.parse(JSON.stringify(ke)))}ce.vectorTile=te.vectorTile;const Ie=ce.parse(te.vectorTile,this.layerIndex,this.availableImages,this.actor,Q.subdivisionGranularity);this.loaded[X]=ce,this.fetching[X]={rawTileData:Pe,cacheControl:be,resourceTiming:Ae};try{const ke=yield Ie;return x.e({rawTileData:Pe.slice(0)},ke,be,Ae)}finally{delete this.fetching[X]}}catch(te){throw delete this.loading[X],ce.status="done",this.loaded[X]=ce,te}})}reloadTile(Q){return x._(this,void 0,void 0,function*(){const X=Q.uid;if(!this.loaded||!this.loaded[X])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const re=this.loaded[X];if(re.showCollisionBoxes=Q.showCollisionBoxes,re.status==="parsing"){const ce=yield re.parse(re.vectorTile,this.layerIndex,this.availableImages,this.actor,Q.subdivisionGranularity);let _e;if(this.fetching[X]){const{rawTileData:te,cacheControl:Pe,resourceTiming:be}=this.fetching[X];delete this.fetching[X],_e=x.e({rawTileData:te.slice(0)},ce,Pe,be)}else _e=ce;return _e}if(re.status==="done"&&re.vectorTile)return re.parse(re.vectorTile,this.layerIndex,this.availableImages,this.actor,Q.subdivisionGranularity)})}abortTile(Q){return x._(this,void 0,void 0,function*(){const X=this.loading,re=Q.uid;X&&X[re]&&X[re].abort&&(X[re].abort.abort(),delete X[re])})}removeTile(Q){return x._(this,void 0,void 0,function*(){this.loaded&&this.loaded[Q.uid]&&delete this.loaded[Q.uid]})}}class M{constructor(){this.loaded={}}loadTile(Q){return x._(this,void 0,void 0,function*(){const{uid:X,encoding:re,rawImageData:ce,redFactor:_e,greenFactor:te,blueFactor:Pe,baseShift:be}=Q,Ae=ce.width+2,Ie=ce.height+2,ke=x.b(ce)?new x.R({width:Ae,height:Ie},yield x.cF(ce,-1,-1,Ae,Ie)):ce,Ue=new x.cG(X,ke,re,_e,te,Pe,be);return this.loaded=this.loaded||{},this.loaded[X]=Ue,Ue})}removeTile(Q){const X=this.loaded,re=Q.uid;X&&X[re]&&delete X[re]}}var E,C,W=function(){if(C)return E;function we(X,re){if(X.length!==0){Q(X[0],re);for(var ce=1;ce<X.length;ce++)Q(X[ce],!re)}}function Q(X,re){for(var ce=0,_e=0,te=0,Pe=X.length,be=Pe-1;te<Pe;be=te++){var Ae=(X[te][0]-X[be][0])*(X[be][1]+X[te][1]),Ie=ce+Ae;_e+=Math.abs(ce)>=Math.abs(Ae)?ce-Ie+Ae:Ae-Ie+ce,ce=Ie}ce+_e>=0!=!!re&&X.reverse()}return C=1,E=function X(re,ce){var _e,te=re&&re.type;if(te==="FeatureCollection")for(_e=0;_e<re.features.length;_e++)X(re.features[_e],ce);else if(te==="GeometryCollection")for(_e=0;_e<re.geometries.length;_e++)X(re.geometries[_e],ce);else if(te==="Feature")X(re.geometry,ce);else if(te==="Polygon")we(re.coordinates,ce);else if(te==="MultiPolygon")for(_e=0;_e<re.coordinates.length;_e++)we(re.coordinates[_e],ce);return re}}(),J=x.cH(W);const se=x.cC.VectorTileFeature.prototype.toGeoJSON;class oe{constructor(Q){this._feature=Q,this.extent=x.Z,this.type=Q.type,this.properties=Q.tags,"id"in Q&&!isNaN(Q.id)&&(this.id=parseInt(Q.id,10))}loadGeometry(){if(this._feature.type===1){const Q=[];for(const X of this._feature.geometry)Q.push([new x.P(X[0],X[1])]);return Q}{const Q=[];for(const X of this._feature.geometry){const re=[];for(const ce of X)re.push(new x.P(ce[0],ce[1]));Q.push(re)}return Q}}toGeoJSON(Q,X,re){return se.call(this,Q,X,re)}}class Se{constructor(Q){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=x.Z,this.length=Q.length,this._features=Q}feature(Q){return new oe(this._features[Q])}}var $,de,Ce,Re={exports:{}},Ze=function(){if(Ce)return Re.exports;Ce=1;var we=x.cK(),Q=function(){if(de)return $;de=1;var Ie=x.cI(),ke=x.cJ().VectorTileFeature;function Ue(rt,ft){this.options=ft||{},this.features=rt,this.length=rt.length}function $e(rt,ft){this.id=typeof rt.id=="number"?rt.id:void 0,this.type=rt.type,this.rawGeometry=rt.type===1?[rt.geometry]:rt.geometry,this.properties=rt.tags,this.extent=ft||4096}return $=Ue,Ue.prototype.feature=function(rt){return new $e(this.features[rt],this.options.extent)},$e.prototype.loadGeometry=function(){var rt=this.rawGeometry;this.geometry=[];for(var ft=0;ft<rt.length;ft++){for(var Tt=rt[ft],St=[],Ve=0;Ve<Tt.length;Ve++)St.push(new Ie(Tt[Ve][0],Tt[Ve][1]));this.geometry.push(St)}return this.geometry},$e.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var rt=this.geometry,ft=1/0,Tt=-1/0,St=1/0,Ve=-1/0,Kt=0;Kt<rt.length;Kt++)for(var Ft=rt[Kt],Wt=0;Wt<Ft.length;Wt++){var wt=Ft[Wt];ft=Math.min(ft,wt.x),Tt=Math.max(Tt,wt.x),St=Math.min(St,wt.y),Ve=Math.max(Ve,wt.y)}return[ft,St,Tt,Ve]},$e.prototype.toGeoJSON=ke.prototype.toGeoJSON,$}();function X(Ie){var ke=new we;return function(Ue,$e){for(var rt in Ue.layers)$e.writeMessage(3,re,Ue.layers[rt])}(Ie,ke),ke.finish()}function re(Ie,ke){var Ue;ke.writeVarintField(15,Ie.version||1),ke.writeStringField(1,Ie.name||""),ke.writeVarintField(5,Ie.extent||4096);var $e={keys:[],values:[],keycache:{},valuecache:{}};for(Ue=0;Ue<Ie.length;Ue++)$e.feature=Ie.feature(Ue),ke.writeMessage(2,ce,$e);var rt=$e.keys;for(Ue=0;Ue<rt.length;Ue++)ke.writeStringField(3,rt[Ue]);var ft=$e.values;for(Ue=0;Ue<ft.length;Ue++)ke.writeMessage(4,Ae,ft[Ue])}function ce(Ie,ke){var Ue=Ie.feature;Ue.id!==void 0&&ke.writeVarintField(1,Ue.id),ke.writeMessage(2,_e,Ie),ke.writeVarintField(3,Ue.type),ke.writeMessage(4,be,Ue)}function _e(Ie,ke){var Ue=Ie.feature,$e=Ie.keys,rt=Ie.values,ft=Ie.keycache,Tt=Ie.valuecache;for(var St in Ue.properties){var Ve=Ue.properties[St],Kt=ft[St];if(Ve!==null){Kt===void 0&&($e.push(St),ft[St]=Kt=$e.length-1),ke.writeVarint(Kt);var Ft=typeof Ve;Ft!=="string"&&Ft!=="boolean"&&Ft!=="number"&&(Ve=JSON.stringify(Ve));var Wt=Ft+":"+Ve,wt=Tt[Wt];wt===void 0&&(rt.push(Ve),Tt[Wt]=wt=rt.length-1),ke.writeVarint(wt)}}}function te(Ie,ke){return(ke<<3)+(7&Ie)}function Pe(Ie){return Ie<<1^Ie>>31}function be(Ie,ke){for(var Ue=Ie.loadGeometry(),$e=Ie.type,rt=0,ft=0,Tt=Ue.length,St=0;St<Tt;St++){var Ve=Ue[St],Kt=1;$e===1&&(Kt=Ve.length),ke.writeVarint(te(1,Kt));for(var Ft=$e===3?Ve.length-1:Ve.length,Wt=0;Wt<Ft;Wt++){Wt===1&&$e!==1&&ke.writeVarint(te(2,Ft-1));var wt=Ve[Wt].x-rt,qe=Ve[Wt].y-ft;ke.writeVarint(Pe(wt)),ke.writeVarint(Pe(qe)),rt+=wt,ft+=qe}$e===3&&ke.writeVarint(te(7,1))}}function Ae(Ie,ke){var Ue=typeof Ie;Ue==="string"?ke.writeStringField(1,Ie):Ue==="boolean"?ke.writeBooleanField(7,Ie):Ue==="number"&&(Ie%1!=0?ke.writeDoubleField(3,Ie):Ie<0?ke.writeSVarintField(6,Ie):ke.writeVarintField(5,Ie))}return Re.exports=X,Re.exports.fromVectorTileJs=X,Re.exports.fromGeojsonVt=function(Ie,ke){ke=ke||{};var Ue={};for(var $e in Ie)Ue[$e]=new Q(Ie[$e].features,ke),Ue[$e].name=$e,Ue[$e].version=ke.version,Ue[$e].extent=ke.extent;return X({layers:Ue})},Re.exports.GeoJSONWrapper=Q,Re.exports}(),kt=x.cH(Ze);const tt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:we=>we},Ge=Math.fround||(it=new Float32Array(1),we=>(it[0]=+we,it[0]));var it;const vt=3,Lt=5,Ar=6;class hr{constructor(Q){this.options=Object.assign(Object.create(tt),Q),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(Q){const{log:X,minZoom:re,maxZoom:ce}=this.options;X&&console.time("total time");const _e=`prepare ${Q.length} points`;X&&console.time(_e),this.points=Q;const te=[];for(let be=0;be<Q.length;be++){const Ae=Q[be];if(!Ae.geometry)continue;const[Ie,ke]=Ae.geometry.coordinates,Ue=Ge(nn(Ie)),$e=Ge(Ei(ke));te.push(Ue,$e,1/0,be,-1,1),this.options.reduce&&te.push(0)}let Pe=this.trees[ce+1]=this._createTree(te);X&&console.timeEnd(_e);for(let be=ce;be>=re;be--){const Ae=+Date.now();Pe=this.trees[be]=this._createTree(this._cluster(Pe,be)),X&&console.log("z%d: %d clusters in %dms",be,Pe.numItems,+Date.now()-Ae)}return X&&console.timeEnd("total time"),this}getClusters(Q,X){let re=((Q[0]+180)%360+360)%360-180;const ce=Math.max(-90,Math.min(90,Q[1]));let _e=Q[2]===180?180:((Q[2]+180)%360+360)%360-180;const te=Math.max(-90,Math.min(90,Q[3]));if(Q[2]-Q[0]>=360)re=-180,_e=180;else if(re>_e){const ke=this.getClusters([re,ce,180,te],X),Ue=this.getClusters([-180,ce,_e,te],X);return ke.concat(Ue)}const Pe=this.trees[this._limitZoom(X)],be=Pe.range(nn(re),Ei(te),nn(_e),Ei(ce)),Ae=Pe.data,Ie=[];for(const ke of be){const Ue=this.stride*ke;Ie.push(Ae[Ue+Lt]>1?xi(Ae,Ue,this.clusterProps):this.points[Ae[Ue+vt]])}return Ie}getChildren(Q){const X=this._getOriginId(Q),re=this._getOriginZoom(Q),ce="No cluster with the specified id.",_e=this.trees[re];if(!_e)throw new Error(ce);const te=_e.data;if(X*this.stride>=te.length)throw new Error(ce);const Pe=this.options.radius/(this.options.extent*Math.pow(2,re-1)),be=_e.within(te[X*this.stride],te[X*this.stride+1],Pe),Ae=[];for(const Ie of be){const ke=Ie*this.stride;te[ke+4]===Q&&Ae.push(te[ke+Lt]>1?xi(te,ke,this.clusterProps):this.points[te[ke+vt]])}if(Ae.length===0)throw new Error(ce);return Ae}getLeaves(Q,X,re){const ce=[];return this._appendLeaves(ce,Q,X=X||10,re=re||0,0),ce}getTile(Q,X,re){const ce=this.trees[this._limitZoom(Q)],_e=Math.pow(2,Q),{extent:te,radius:Pe}=this.options,be=Pe/te,Ae=(re-be)/_e,Ie=(re+1+be)/_e,ke={features:[]};return this._addTileFeatures(ce.range((X-be)/_e,Ae,(X+1+be)/_e,Ie),ce.data,X,re,_e,ke),X===0&&this._addTileFeatures(ce.range(1-be/_e,Ae,1,Ie),ce.data,_e,re,_e,ke),X===_e-1&&this._addTileFeatures(ce.range(0,Ae,be/_e,Ie),ce.data,-1,re,_e,ke),ke.features.length?ke:null}getClusterExpansionZoom(Q){let X=this._getOriginZoom(Q)-1;for(;X<=this.options.maxZoom;){const re=this.getChildren(Q);if(X++,re.length!==1)break;Q=re[0].properties.cluster_id}return X}_appendLeaves(Q,X,re,ce,_e){const te=this.getChildren(X);for(const Pe of te){const be=Pe.properties;if(be&&be.cluster?_e+be.point_count<=ce?_e+=be.point_count:_e=this._appendLeaves(Q,be.cluster_id,re,ce,_e):_e<ce?_e++:Q.push(Pe),Q.length===re)break}return _e}_createTree(Q){const X=new x.aF(Q.length/this.stride|0,this.options.nodeSize,Float32Array);for(let re=0;re<Q.length;re+=this.stride)X.add(Q[re],Q[re+1]);return X.finish(),X.data=Q,X}_addTileFeatures(Q,X,re,ce,_e,te){for(const Pe of Q){const be=Pe*this.stride,Ae=X[be+Lt]>1;let Ie,ke,Ue;if(Ae)Ie=Jt(X,be,this.clusterProps),ke=X[be],Ue=X[be+1];else{const ft=this.points[X[be+vt]];Ie=ft.properties;const[Tt,St]=ft.geometry.coordinates;ke=nn(Tt),Ue=Ei(St)}const $e={type:1,geometry:[[Math.round(this.options.extent*(ke*_e-re)),Math.round(this.options.extent*(Ue*_e-ce))]],tags:Ie};let rt;rt=Ae||this.options.generateId?X[be+vt]:this.points[X[be+vt]].id,rt!==void 0&&($e.id=rt),te.features.push($e)}}_limitZoom(Q){return Math.max(this.options.minZoom,Math.min(Math.floor(+Q),this.options.maxZoom+1))}_cluster(Q,X){const{radius:re,extent:ce,reduce:_e,minPoints:te}=this.options,Pe=re/(ce*Math.pow(2,X)),be=Q.data,Ae=[],Ie=this.stride;for(let ke=0;ke<be.length;ke+=Ie){if(be[ke+2]<=X)continue;be[ke+2]=X;const Ue=be[ke],$e=be[ke+1],rt=Q.within(be[ke],be[ke+1],Pe),ft=be[ke+Lt];let Tt=ft;for(const St of rt){const Ve=St*Ie;be[Ve+2]>X&&(Tt+=be[Ve+Lt])}if(Tt>ft&&Tt>=te){let St,Ve=Ue*ft,Kt=$e*ft,Ft=-1;const Wt=((ke/Ie|0)<<5)+(X+1)+this.points.length;for(const wt of rt){const qe=wt*Ie;if(be[qe+2]<=X)continue;be[qe+2]=X;const gt=be[qe+Lt];Ve+=be[qe]*gt,Kt+=be[qe+1]*gt,be[qe+4]=Wt,_e&&(St||(St=this._map(be,ke,!0),Ft=this.clusterProps.length,this.clusterProps.push(St)),_e(St,this._map(be,qe)))}be[ke+4]=Wt,Ae.push(Ve/Tt,Kt/Tt,1/0,Wt,-1,Tt),_e&&Ae.push(Ft)}else{for(let St=0;St<Ie;St++)Ae.push(be[ke+St]);if(Tt>1)for(const St of rt){const Ve=St*Ie;if(!(be[Ve+2]<=X)){be[Ve+2]=X;for(let Kt=0;Kt<Ie;Kt++)Ae.push(be[Ve+Kt])}}}}return Ae}_getOriginId(Q){return Q-this.points.length>>5}_getOriginZoom(Q){return(Q-this.points.length)%32}_map(Q,X,re){if(Q[X+Lt]>1){const te=this.clusterProps[Q[X+Ar]];return re?Object.assign({},te):te}const ce=this.points[Q[X+vt]].properties,_e=this.options.map(ce);return re&&_e===ce?Object.assign({},_e):_e}}function xi(we,Q,X){return{type:"Feature",id:we[Q+vt],properties:Jt(we,Q,X),geometry:{type:"Point",coordinates:[(re=we[Q],360*(re-.5)),kn(we[Q+1])]}};var re}function Jt(we,Q,X){const re=we[Q+Lt],ce=re>=1e4?`${Math.round(re/1e3)}k`:re>=1e3?Math.round(re/100)/10+"k":re,_e=we[Q+Ar],te=_e===-1?{}:Object.assign({},X[_e]);return Object.assign(te,{cluster:!0,cluster_id:we[Q+vt],point_count:re,point_count_abbreviated:ce})}function nn(we){return we/360+.5}function Ei(we){const Q=Math.sin(we*Math.PI/180),X=.5-.25*Math.log((1+Q)/(1-Q))/Math.PI;return X<0?0:X>1?1:X}function kn(we){const Q=(180-360*we)*Math.PI/180;return 360*Math.atan(Math.exp(Q))/Math.PI-90}function Kr(we,Q,X,re){let ce=re;const _e=Q+(X-Q>>1);let te,Pe=X-Q;const be=we[Q],Ae=we[Q+1],Ie=we[X],ke=we[X+1];for(let Ue=Q+3;Ue<X;Ue+=3){const $e=as(we[Ue],we[Ue+1],be,Ae,Ie,ke);if($e>ce)te=Ue,ce=$e;else if($e===ce){const rt=Math.abs(Ue-_e);rt<Pe&&(te=Ue,Pe=rt)}}ce>re&&(te-Q>3&&Kr(we,Q,te,re),we[te+2]=ce,X-te>3&&Kr(we,te,X,re))}function as(we,Q,X,re,ce,_e){let te=ce-X,Pe=_e-re;if(te!==0||Pe!==0){const be=((we-X)*te+(Q-re)*Pe)/(te*te+Pe*Pe);be>1?(X=ce,re=_e):be>0&&(X+=te*be,re+=Pe*be)}return te=we-X,Pe=Q-re,te*te+Pe*Pe}function Pi(we,Q,X,re){const ce={id:we??null,type:Q,geometry:X,tags:re,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(Q==="Point"||Q==="MultiPoint"||Q==="LineString")Lr(ce,X);else if(Q==="Polygon")Lr(ce,X[0]);else if(Q==="MultiLineString")for(const _e of X)Lr(ce,_e);else if(Q==="MultiPolygon")for(const _e of X)Lr(ce,_e[0]);return ce}function Lr(we,Q){for(let X=0;X<Q.length;X+=3)we.minX=Math.min(we.minX,Q[X]),we.minY=Math.min(we.minY,Q[X+1]),we.maxX=Math.max(we.maxX,Q[X]),we.maxY=Math.max(we.maxY,Q[X+1])}function et(we,Q,X,re){if(!Q.geometry)return;const ce=Q.geometry.coordinates;if(ce&&ce.length===0)return;const _e=Q.geometry.type,te=Math.pow(X.tolerance/((1<<X.maxZoom)*X.extent),2);let Pe=[],be=Q.id;if(X.promoteId?be=Q.properties[X.promoteId]:X.generateId&&(be=re||0),_e==="Point")Qe(ce,Pe);else if(_e==="MultiPoint")for(const Ae of ce)Qe(Ae,Pe);else if(_e==="LineString")ut(ce,Pe,te,!1);else if(_e==="MultiLineString"){if(X.lineMetrics){for(const Ae of ce)Pe=[],ut(Ae,Pe,te,!1),we.push(Pi(be,"LineString",Pe,Q.properties));return}xt(ce,Pe,te,!1)}else if(_e==="Polygon")xt(ce,Pe,te,!0);else{if(_e!=="MultiPolygon"){if(_e==="GeometryCollection"){for(const Ae of Q.geometry.geometries)et(we,{id:be,geometry:Ae,properties:Q.properties},X,re);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const Ae of ce){const Ie=[];xt(Ae,Ie,te,!0),Pe.push(Ie)}}we.push(Pi(be,_e,Pe,Q.properties))}function Qe(we,Q){Q.push(ot(we[0]),ht(we[1]),0)}function ut(we,Q,X,re){let ce,_e,te=0;for(let be=0;be<we.length;be++){const Ae=ot(we[be][0]),Ie=ht(we[be][1]);Q.push(Ae,Ie,0),be>0&&(te+=re?(ce*Ie-Ae*_e)/2:Math.sqrt(Math.pow(Ae-ce,2)+Math.pow(Ie-_e,2))),ce=Ae,_e=Ie}const Pe=Q.length-3;Q[2]=1,Kr(Q,0,Pe,X),Q[Pe+2]=1,Q.size=Math.abs(te),Q.start=0,Q.end=Q.size}function xt(we,Q,X,re){for(let ce=0;ce<we.length;ce++){const _e=[];ut(we[ce],_e,X,re),Q.push(_e)}}function ot(we){return we/360+.5}function ht(we){const Q=Math.sin(we*Math.PI/180),X=.5-.25*Math.log((1+Q)/(1-Q))/Math.PI;return X<0?0:X>1?1:X}function Ct(we,Q,X,re,ce,_e,te,Pe){if(re/=Q,_e>=(X/=Q)&&te<re)return we;if(te<X||_e>=re)return null;const be=[];for(const Ae of we){const Ie=Ae.geometry;let ke=Ae.type;const Ue=ce===0?Ae.minX:Ae.minY,$e=ce===0?Ae.maxX:Ae.maxY;if(Ue>=X&&$e<re){be.push(Ae);continue}if($e<X||Ue>=re)continue;let rt=[];if(ke==="Point"||ke==="MultiPoint")_t(Ie,rt,X,re,ce);else if(ke==="LineString")dt(Ie,rt,X,re,ce,!1,Pe.lineMetrics);else if(ke==="MultiLineString")bi(Ie,rt,X,re,ce,!1);else if(ke==="Polygon")bi(Ie,rt,X,re,ce,!0);else if(ke==="MultiPolygon")for(const ft of Ie){const Tt=[];bi(ft,Tt,X,re,ce,!0),Tt.length&&rt.push(Tt)}if(rt.length){if(Pe.lineMetrics&&ke==="LineString"){for(const ft of rt)be.push(Pi(Ae.id,ke,ft,Ae.tags));continue}ke!=="LineString"&&ke!=="MultiLineString"||(rt.length===1?(ke="LineString",rt=rt[0]):ke="MultiLineString"),ke!=="Point"&&ke!=="MultiPoint"||(ke=rt.length===3?"Point":"MultiPoint"),be.push(Pi(Ae.id,ke,rt,Ae.tags))}}return be.length?be:null}function _t(we,Q,X,re,ce){for(let _e=0;_e<we.length;_e+=3){const te=we[_e+ce];te>=X&&te<=re&&Yt(Q,we[_e],we[_e+1],we[_e+2])}}function dt(we,Q,X,re,ce,_e,te){let Pe=er(we);const be=ce===0?Fi:Qt;let Ae,Ie,ke=we.start;for(let Tt=0;Tt<we.length-3;Tt+=3){const St=we[Tt],Ve=we[Tt+1],Kt=we[Tt+2],Ft=we[Tt+3],Wt=we[Tt+4],wt=ce===0?St:Ve,qe=ce===0?Ft:Wt;let gt=!1;te&&(Ae=Math.sqrt(Math.pow(St-Ft,2)+Math.pow(Ve-Wt,2))),wt<X?qe>X&&(Ie=be(Pe,St,Ve,Ft,Wt,X),te&&(Pe.start=ke+Ae*Ie)):wt>re?qe<re&&(Ie=be(Pe,St,Ve,Ft,Wt,re),te&&(Pe.start=ke+Ae*Ie)):Yt(Pe,St,Ve,Kt),qe<X&&wt>=X&&(Ie=be(Pe,St,Ve,Ft,Wt,X),gt=!0),qe>re&&wt<=re&&(Ie=be(Pe,St,Ve,Ft,Wt,re),gt=!0),!_e&&gt&&(te&&(Pe.end=ke+Ae*Ie),Q.push(Pe),Pe=er(we)),te&&(ke+=Ae)}let Ue=we.length-3;const $e=we[Ue],rt=we[Ue+1],ft=ce===0?$e:rt;ft>=X&&ft<=re&&Yt(Pe,$e,rt,we[Ue+2]),Ue=Pe.length-3,_e&&Ue>=3&&(Pe[Ue]!==Pe[0]||Pe[Ue+1]!==Pe[1])&&Yt(Pe,Pe[0],Pe[1],Pe[2]),Pe.length&&Q.push(Pe)}function er(we){const Q=[];return Q.size=we.size,Q.start=we.start,Q.end=we.end,Q}function bi(we,Q,X,re,ce,_e){for(const te of we)dt(te,Q,X,re,ce,_e,!1)}function Yt(we,Q,X,re){we.push(Q,X,re)}function Fi(we,Q,X,re,ce,_e){const te=(_e-Q)/(re-Q);return Yt(we,_e,X+(ce-X)*te,1),te}function Qt(we,Q,X,re,ce,_e){const te=(_e-X)/(ce-X);return Yt(we,Q+(re-Q)*te,_e,1),te}function Rr(we,Q){const X=[];for(let re=0;re<we.length;re++){const ce=we[re],_e=ce.type;let te;if(_e==="Point"||_e==="MultiPoint"||_e==="LineString")te=ai(ce.geometry,Q);else if(_e==="MultiLineString"||_e==="Polygon"){te=[];for(const Pe of ce.geometry)te.push(ai(Pe,Q))}else if(_e==="MultiPolygon"){te=[];for(const Pe of ce.geometry){const be=[];for(const Ae of Pe)be.push(ai(Ae,Q));te.push(be)}}X.push(Pi(ce.id,_e,te,ce.tags))}return X}function ai(we,Q){const X=[];X.size=we.size,we.start!==void 0&&(X.start=we.start,X.end=we.end);for(let re=0;re<we.length;re+=3)X.push(we[re]+Q,we[re+1],we[re+2]);return X}function ir(we,Q){if(we.transformed)return we;const X=1<<we.z,re=we.x,ce=we.y;for(const _e of we.features){const te=_e.geometry,Pe=_e.type;if(_e.geometry=[],Pe===1)for(let be=0;be<te.length;be+=2)_e.geometry.push(Xt(te[be],te[be+1],Q,X,re,ce));else for(let be=0;be<te.length;be++){const Ae=[];for(let Ie=0;Ie<te[be].length;Ie+=2)Ae.push(Xt(te[be][Ie],te[be][Ie+1],Q,X,re,ce));_e.geometry.push(Ae)}}return we.transformed=!0,we}function Xt(we,Q,X,re,ce,_e){return[Math.round(X*(we*re-ce)),Math.round(X*(Q*re-_e))]}function bt(we,Q,X,re,ce){const _e=Q===ce.maxZoom?0:ce.tolerance/((1<<Q)*ce.extent),te={features:[],numPoints:0,numSimplified:0,numFeatures:we.length,source:null,x:X,y:re,z:Q,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const Pe of we)Er(te,Pe,_e,ce);return te}function Er(we,Q,X,re){const ce=Q.geometry,_e=Q.type,te=[];if(we.minX=Math.min(we.minX,Q.minX),we.minY=Math.min(we.minY,Q.minY),we.maxX=Math.max(we.maxX,Q.maxX),we.maxY=Math.max(we.maxY,Q.maxY),_e==="Point"||_e==="MultiPoint")for(let Pe=0;Pe<ce.length;Pe+=3)te.push(ce[Pe],ce[Pe+1]),we.numPoints++,we.numSimplified++;else if(_e==="LineString")Br(te,ce,we,X,!1,!1);else if(_e==="MultiLineString"||_e==="Polygon")for(let Pe=0;Pe<ce.length;Pe++)Br(te,ce[Pe],we,X,_e==="Polygon",Pe===0);else if(_e==="MultiPolygon")for(let Pe=0;Pe<ce.length;Pe++){const be=ce[Pe];for(let Ae=0;Ae<be.length;Ae++)Br(te,be[Ae],we,X,!0,Ae===0)}if(te.length){let Pe=Q.tags||null;if(_e==="LineString"&&re.lineMetrics){Pe={};for(const Ae in Q.tags)Pe[Ae]=Q.tags[Ae];Pe.mapbox_clip_start=ce.start/ce.size,Pe.mapbox_clip_end=ce.end/ce.size}const be={geometry:te,type:_e==="Polygon"||_e==="MultiPolygon"?3:_e==="LineString"||_e==="MultiLineString"?2:1,tags:Pe};Q.id!==null&&(be.id=Q.id),we.features.push(be)}}function Br(we,Q,X,re,ce,_e){const te=re*re;if(re>0&&Q.size<(ce?te:re))return void(X.numPoints+=Q.length/3);const Pe=[];for(let be=0;be<Q.length;be+=3)(re===0||Q[be+2]>te)&&(X.numSimplified++,Pe.push(Q[be],Q[be+1])),X.numPoints++;ce&&function(be,Ae){let Ie=0;for(let ke=0,Ue=be.length,$e=Ue-2;ke<Ue;$e=ke,ke+=2)Ie+=(be[ke]-be[$e])*(be[ke+1]+be[$e+1]);if(Ie>0===Ae)for(let ke=0,Ue=be.length;ke<Ue/2;ke+=2){const $e=be[ke],rt=be[ke+1];be[ke]=be[Ue-2-ke],be[ke+1]=be[Ue-1-ke],be[Ue-2-ke]=$e,be[Ue-1-ke]=rt}}(Pe,_e),we.push(Pe)}const Cr={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class zt{constructor(Q,X){const re=(X=this.options=function(_e,te){for(const Pe in te)_e[Pe]=te[Pe];return _e}(Object.create(Cr),X)).debug;if(re&&console.time("preprocess data"),X.maxZoom<0||X.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(X.promoteId&&X.generateId)throw new Error("promoteId and generateId cannot be used together.");let ce=function(_e,te){const Pe=[];if(_e.type==="FeatureCollection")for(let be=0;be<_e.features.length;be++)et(Pe,_e.features[be],te,be);else et(Pe,_e.type==="Feature"?_e:{geometry:_e},te);return Pe}(Q,X);this.tiles={},this.tileCoords=[],re&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",X.indexMaxZoom,X.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),ce=function(_e,te){const Pe=te.buffer/te.extent;let be=_e;const Ae=Ct(_e,1,-1-Pe,Pe,0,-1,2,te),Ie=Ct(_e,1,1-Pe,2+Pe,0,-1,2,te);return(Ae||Ie)&&(be=Ct(_e,1,-Pe,1+Pe,0,-1,2,te)||[],Ae&&(be=Rr(Ae,1).concat(be)),Ie&&(be=be.concat(Rr(Ie,-1)))),be}(ce,X),ce.length&&this.splitTile(ce,0,0,0),re&&(ce.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(Q,X,re,ce,_e,te,Pe){const be=[Q,X,re,ce],Ae=this.options,Ie=Ae.debug;for(;be.length;){ce=be.pop(),re=be.pop(),X=be.pop(),Q=be.pop();const ke=1<<X,Ue=qr(X,re,ce);let $e=this.tiles[Ue];if(!$e&&(Ie>1&&console.time("creation"),$e=this.tiles[Ue]=bt(Q,X,re,ce,Ae),this.tileCoords.push({z:X,x:re,y:ce}),Ie)){Ie>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",X,re,ce,$e.numFeatures,$e.numPoints,$e.numSimplified),console.timeEnd("creation"));const gt=`z${X}`;this.stats[gt]=(this.stats[gt]||0)+1,this.total++}if($e.source=Q,_e==null){if(X===Ae.indexMaxZoom||$e.numPoints<=Ae.indexMaxPoints)continue}else{if(X===Ae.maxZoom||X===_e)continue;if(_e!=null){const gt=_e-X;if(re!==te>>gt||ce!==Pe>>gt)continue}}if($e.source=null,Q.length===0)continue;Ie>1&&console.time("clipping");const rt=.5*Ae.buffer/Ae.extent,ft=.5-rt,Tt=.5+rt,St=1+rt;let Ve=null,Kt=null,Ft=null,Wt=null,wt=Ct(Q,ke,re-rt,re+Tt,0,$e.minX,$e.maxX,Ae),qe=Ct(Q,ke,re+ft,re+St,0,$e.minX,$e.maxX,Ae);Q=null,wt&&(Ve=Ct(wt,ke,ce-rt,ce+Tt,1,$e.minY,$e.maxY,Ae),Kt=Ct(wt,ke,ce+ft,ce+St,1,$e.minY,$e.maxY,Ae),wt=null),qe&&(Ft=Ct(qe,ke,ce-rt,ce+Tt,1,$e.minY,$e.maxY,Ae),Wt=Ct(qe,ke,ce+ft,ce+St,1,$e.minY,$e.maxY,Ae),qe=null),Ie>1&&console.timeEnd("clipping"),be.push(Ve||[],X+1,2*re,2*ce),be.push(Kt||[],X+1,2*re,2*ce+1),be.push(Ft||[],X+1,2*re+1,2*ce),be.push(Wt||[],X+1,2*re+1,2*ce+1)}}getTile(Q,X,re){Q=+Q,X=+X,re=+re;const ce=this.options,{extent:_e,debug:te}=ce;if(Q<0||Q>24)return null;const Pe=1<<Q,be=qr(Q,X=X+Pe&Pe-1,re);if(this.tiles[be])return ir(this.tiles[be],_e);te>1&&console.log("drilling down to z%d-%d-%d",Q,X,re);let Ae,Ie=Q,ke=X,Ue=re;for(;!Ae&&Ie>0;)Ie--,ke>>=1,Ue>>=1,Ae=this.tiles[qr(Ie,ke,Ue)];return Ae&&Ae.source?(te>1&&(console.log("found parent tile z%d-%d-%d",Ie,ke,Ue),console.time("drilling down")),this.splitTile(Ae.source,Ie,ke,Ue,Q,X,re),te>1&&console.timeEnd("drilling down"),this.tiles[be]?ir(this.tiles[be],_e):null):null}}function qr(we,Q,X){return 32*((1<<we)*X+Q)+we}function li(we,Q){return Q?we.properties[Q]:we.id}function wi(we,Q){if(we==null)return!0;if(we.type==="Feature")return li(we,Q)!=null;if(we.type==="FeatureCollection"){const X=new Set;for(const re of we.features){const ce=li(re,Q);if(ce==null||X.has(ce))return!1;X.add(ce)}return!0}return!1}function Dr(we,Q){const X=new Map;if(we!=null)if(we.type==="Feature")X.set(li(we,Q),we);else for(const re of we.features)X.set(li(re,Q),re);return X}class nr extends F{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile(Q,X){return x._(this,void 0,void 0,function*(){const re=Q.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");const ce=this._geoJSONIndex.getTile(re.z,re.x,re.y);if(!ce)return null;const _e=new Se(ce.features);let te=kt(_e);return te.byteOffset===0&&te.byteLength===te.buffer.byteLength||(te=new Uint8Array(te)),{vectorTile:_e,rawData:te.buffer}})}loadData(Q){return x._(this,void 0,void 0,function*(){var X;(X=this._pendingRequest)===null||X===void 0||X.abort();const re=!!(Q&&Q.request&&Q.request.collectResourceTiming)&&new x.cE(Q.request);this._pendingRequest=new AbortController;try{this._pendingData=this.loadAndProcessGeoJSON(Q,this._pendingRequest),this._geoJSONIndex=Q.cluster?new hr(function({superclusterOptions:te,clusterProperties:Pe}){if(!Pe||!te)return te;const be={},Ae={},Ie={accumulated:null,zoom:0},ke={properties:null},Ue=Object.keys(Pe);for(const $e of Ue){const[rt,ft]=Pe[$e],Tt=x.cL(ft),St=x.cL(typeof rt=="string"?[rt,["accumulated"],["get",$e]]:rt);be[$e]=Tt.value,Ae[$e]=St.value}return te.map=$e=>{ke.properties=$e;const rt={};for(const ft of Ue)rt[ft]=be[ft].evaluate(Ie,ke);return rt},te.reduce=($e,rt)=>{ke.properties=rt;for(const ft of Ue)Ie.accumulated=$e[ft],$e[ft]=Ae[ft].evaluate(Ie,ke)},te}(Q)).load((yield this._pendingData).features):(ce=yield this._pendingData,new zt(ce,Q.geojsonVtOptions)),this.loaded={};const _e={};if(re){const te=re.finish();te&&(_e.resourceTiming={},_e.resourceTiming[Q.source]=JSON.parse(JSON.stringify(te)))}return _e}catch(_e){if(delete this._pendingRequest,x.cp(_e))return{abandoned:!0};throw _e}var ce})}getData(){return x._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(Q){const X=this.loaded;return X&&X[Q.uid]?super.reloadTile(Q):this.loadTile(Q)}loadAndProcessGeoJSON(Q,X){return x._(this,void 0,void 0,function*(){let re=yield this.loadGeoJSON(Q,X);if(delete this._pendingRequest,typeof re!="object")throw new Error(`Input data given to '${Q.source}' is not a valid GeoJSON object.`);if(J(re,!0),Q.filter){const ce=x.cL(Q.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(ce.result==="error")throw new Error(ce.value.map(te=>`${te.key}: ${te.message}`).join(", "));re={type:"FeatureCollection",features:re.features.filter(te=>ce.value.evaluate({zoom:0},te))}}return re})}loadGeoJSON(Q,X){return x._(this,void 0,void 0,function*(){const{promoteId:re}=Q;if(Q.request){const ce=yield x.j(Q.request,X);return this._dataUpdateable=wi(ce.data,re)?Dr(ce.data,re):void 0,ce.data}if(typeof Q.data=="string")try{const ce=JSON.parse(Q.data);return this._dataUpdateable=wi(ce,re)?Dr(ce,re):void 0,ce}catch{throw new Error(`Input data given to '${Q.source}' is not a valid GeoJSON object.`)}if(!Q.dataDiff)throw new Error(`Input data given to '${Q.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${Q.source}`);return function(ce,_e,te){var Pe,be,Ae,Ie;if(_e.removeAll&&ce.clear(),_e.remove)for(const ke of _e.remove)ce.delete(ke);if(_e.add)for(const ke of _e.add){const Ue=li(ke,te);Ue!=null&&ce.set(Ue,ke)}if(_e.update)for(const ke of _e.update){let Ue=ce.get(ke.id);if(Ue==null)continue;const $e=!ke.removeAllProperties&&(((Pe=ke.removeProperties)===null||Pe===void 0?void 0:Pe.length)>0||((be=ke.addOrUpdateProperties)===null||be===void 0?void 0:be.length)>0);if((ke.newGeometry||ke.removeAllProperties||$e)&&(Ue=Object.assign({},Ue),ce.set(ke.id,Ue),$e&&(Ue.properties=Object.assign({},Ue.properties))),ke.newGeometry&&(Ue.geometry=ke.newGeometry),ke.removeAllProperties)Ue.properties={};else if(((Ae=ke.removeProperties)===null||Ae===void 0?void 0:Ae.length)>0)for(const rt of ke.removeProperties)Object.prototype.hasOwnProperty.call(Ue.properties,rt)&&delete Ue.properties[rt];if(((Ie=ke.addOrUpdateProperties)===null||Ie===void 0?void 0:Ie.length)>0)for(const{key:rt,value:ft}of ke.addOrUpdateProperties)Ue.properties[rt]=ft}}(this._dataUpdateable,Q.dataDiff,re),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(Q){return x._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(Q){return this._geoJSONIndex.getClusterExpansionZoom(Q.clusterId)}getClusterChildren(Q){return this._geoJSONIndex.getChildren(Q.clusterId)}getClusterLeaves(Q){return this._geoJSONIndex.getLeaves(Q.clusterId,Q.limit,Q.offset)}}class Vr{constructor(Q){this.self=Q,this.actor=new x.H(Q),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(X,re)=>{if(this.externalWorkerSourceTypes[X])throw new Error(`Worker source with name "${X}" already registered.`);this.externalWorkerSourceTypes[X]=re},this.self.addProtocol=x.cr,this.self.removeProtocol=x.cs,this.self.registerRTLTextPlugin=X=>{x.cM.setMethods(X)},this.actor.registerMessageHandler("LDT",(X,re)=>this._getDEMWorkerSource(X,re.source).loadTile(re)),this.actor.registerMessageHandler("RDT",(X,re)=>x._(this,void 0,void 0,function*(){this._getDEMWorkerSource(X,re.source).removeTile(re)})),this.actor.registerMessageHandler("GCEZ",(X,re)=>x._(this,void 0,void 0,function*(){return this._getWorkerSource(X,re.type,re.source).getClusterExpansionZoom(re)})),this.actor.registerMessageHandler("GCC",(X,re)=>x._(this,void 0,void 0,function*(){return this._getWorkerSource(X,re.type,re.source).getClusterChildren(re)})),this.actor.registerMessageHandler("GCL",(X,re)=>x._(this,void 0,void 0,function*(){return this._getWorkerSource(X,re.type,re.source).getClusterLeaves(re)})),this.actor.registerMessageHandler("LD",(X,re)=>this._getWorkerSource(X,re.type,re.source).loadData(re)),this.actor.registerMessageHandler("GD",(X,re)=>this._getWorkerSource(X,re.type,re.source).getData()),this.actor.registerMessageHandler("LT",(X,re)=>this._getWorkerSource(X,re.type,re.source).loadTile(re)),this.actor.registerMessageHandler("RT",(X,re)=>this._getWorkerSource(X,re.type,re.source).reloadTile(re)),this.actor.registerMessageHandler("AT",(X,re)=>this._getWorkerSource(X,re.type,re.source).abortTile(re)),this.actor.registerMessageHandler("RMT",(X,re)=>this._getWorkerSource(X,re.type,re.source).removeTile(re)),this.actor.registerMessageHandler("RS",(X,re)=>x._(this,void 0,void 0,function*(){if(!this.workerSources[X]||!this.workerSources[X][re.type]||!this.workerSources[X][re.type][re.source])return;const ce=this.workerSources[X][re.type][re.source];delete this.workerSources[X][re.type][re.source],ce.removeSource!==void 0&&ce.removeSource(re)})),this.actor.registerMessageHandler("RM",X=>x._(this,void 0,void 0,function*(){delete this.layerIndexes[X],delete this.availableImages[X],delete this.workerSources[X],delete this.demWorkerSources[X]})),this.actor.registerMessageHandler("SR",(X,re)=>x._(this,void 0,void 0,function*(){this.referrer=re})),this.actor.registerMessageHandler("SRPS",(X,re)=>this._syncRTLPluginState(X,re)),this.actor.registerMessageHandler("IS",(X,re)=>x._(this,void 0,void 0,function*(){this.self.importScripts(re)})),this.actor.registerMessageHandler("SI",(X,re)=>this._setImages(X,re)),this.actor.registerMessageHandler("UL",(X,re)=>x._(this,void 0,void 0,function*(){this._getLayerIndex(X).update(re.layers,re.removedIds)})),this.actor.registerMessageHandler("SL",(X,re)=>x._(this,void 0,void 0,function*(){this._getLayerIndex(X).replace(re)}))}_setImages(Q,X){return x._(this,void 0,void 0,function*(){this.availableImages[Q]=X;for(const re in this.workerSources[Q]){const ce=this.workerSources[Q][re];for(const _e in ce)ce[_e].availableImages=X}})}_syncRTLPluginState(Q,X){return x._(this,void 0,void 0,function*(){return yield x.cM.syncState(X,this.self.importScripts)})}_getAvailableImages(Q){let X=this.availableImages[Q];return X||(X=[]),X}_getLayerIndex(Q){let X=this.layerIndexes[Q];return X||(X=this.layerIndexes[Q]=new s),X}_getWorkerSource(Q,X,re){if(this.workerSources[Q]||(this.workerSources[Q]={}),this.workerSources[Q][X]||(this.workerSources[Q][X]={}),!this.workerSources[Q][X][re]){const ce={sendAsync:(_e,te)=>(_e.targetMapId=Q,this.actor.sendAsync(_e,te))};switch(X){case"vector":this.workerSources[Q][X][re]=new F(ce,this._getLayerIndex(Q),this._getAvailableImages(Q));break;case"geojson":this.workerSources[Q][X][re]=new nr(ce,this._getLayerIndex(Q),this._getAvailableImages(Q));break;default:this.workerSources[Q][X][re]=new this.externalWorkerSourceTypes[X](ce,this._getLayerIndex(Q),this._getAvailableImages(Q))}}return this.workerSources[Q][X][re]}_getDEMWorkerSource(Q,X){return this.demWorkerSources[Q]||(this.demWorkerSources[Q]={}),this.demWorkerSources[Q][X]||(this.demWorkerSources[Q][X]=new M),this.demWorkerSources[Q][X]}}return x.i(self)&&(self.worker=new Vr(self)),Vr}),k("index",["exports","./shared"],function(x,s){var V="5.5.0";function P(){var h=new s.A(4);return s.A!=Float32Array&&(h[1]=0,h[2]=0),h[0]=1,h[3]=1,h}let L,F;const M={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(h,e,r){const a=requestAnimationFrame(p=>{l(),e(p)}),{unsubscribe:l}=s.s(h.signal,"abort",()=>{l(),cancelAnimationFrame(a),r(s.c())},!1)},frameAsync(h){return new Promise((e,r)=>{this.frame(h,e,r)})},getImageData(h,e=0){return this.getImageCanvasContext(h).getImageData(-e,-e,h.width+2*e,h.height+2*e)},getImageCanvasContext(h){const e=window.document.createElement("canvas"),r=e.getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("failed to create canvas 2d context");return e.width=h.width,e.height=h.height,r.drawImage(h,0,0,h.width,h.height),r},resolveURL:h=>(L||(L=document.createElement("a")),L.href=h,L.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(F==null&&(F=matchMedia("(prefers-reduced-motion: reduce)")),F.matches)}};class E{static testProp(e){if(!E.docStyle)return e[0];for(let r=0;r<e.length;r++)if(e[r]in E.docStyle)return e[r];return e[0]}static create(e,r,a){const l=window.document.createElement(e);return r!==void 0&&(l.className=r),a&&a.appendChild(l),l}static createNS(e,r){return window.document.createElementNS(e,r)}static disableDrag(){E.docStyle&&E.selectProp&&(E.userSelect=E.docStyle[E.selectProp],E.docStyle[E.selectProp]="none")}static enableDrag(){E.docStyle&&E.selectProp&&(E.docStyle[E.selectProp]=E.userSelect)}static setTransform(e,r){e.style[E.transformProp]=r}static addEventListener(e,r,a,l={}){e.addEventListener(r,a,"passive"in l?l:l.capture)}static removeEventListener(e,r,a,l={}){e.removeEventListener(r,a,"passive"in l?l:l.capture)}static suppressClickInternal(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",E.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",E.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",E.suppressClickInternal,!0)},0)}static getScale(e){const r=e.getBoundingClientRect();return{x:r.width/e.offsetWidth||1,y:r.height/e.offsetHeight||1,boundingClientRect:r}}static getPoint(e,r,a){const l=r.boundingClientRect;return new s.P((a.clientX-l.left)/r.x-e.clientLeft,(a.clientY-l.top)/r.y-e.clientTop)}static mousePos(e,r){const a=E.getScale(e);return E.getPoint(e,a,r)}static touchPos(e,r){const a=[],l=E.getScale(e);for(let p=0;p<r.length;p++)a.push(E.getPoint(e,l,r[p]));return a}static mouseButton(e){return e.button}static remove(e){e.parentNode&&e.parentNode.removeChild(e)}static sanitize(e){const r=new DOMParser().parseFromString(e,"text/html").body||document.createElement("body"),a=r.querySelectorAll("script");for(const l of a)l.remove();return E.clean(r),r.innerHTML}static isPossiblyDangerous(e,r){const a=r.replace(/\s+/g,"").toLowerCase();return!(!["src","href","xlink:href"].includes(e)||!a.includes("javascript:")&&!a.includes("data:"))||!!e.startsWith("on")||void 0}static clean(e){const r=e.children;for(const a of r)E.removeAttributes(a),E.clean(a)}static removeAttributes(e){for(const{name:r,value:a}of e.attributes)E.isPossiblyDangerous(r,a)&&e.removeAttribute(r)}}E.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,E.selectProp=E.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),E.transformProp=E.testProp(["transform","WebkitTransform"]);const C={supported:!1,testSupport:function(h){!se&&J&&(oe?Se(h):W=h)}};let W,J,se=!1,oe=!1;function Se(h){const e=h.createTexture();h.bindTexture(h.TEXTURE_2D,e);try{if(h.texImage2D(h.TEXTURE_2D,0,h.RGBA,h.RGBA,h.UNSIGNED_BYTE,J),h.isContextLost())return;C.supported=!0}catch{}h.deleteTexture(e),se=!0}var $;typeof document<"u"&&(J=document.createElement("img"),J.onload=()=>{W&&Se(W),W=null,oe=!0},J.onerror=()=>{se=!0,W=null},J.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(h){let e,r,a,l;h.resetRequestQueue=()=>{e=[],r=0,a=0,l={}},h.addThrottleControl=A=>{const R=a++;return l[R]=A,R},h.removeThrottleControl=A=>{delete l[A],y()},h.getImage=(A,R,D=!0)=>new Promise((N,O)=>{C.supported&&(A.headers||(A.headers={}),A.headers.accept="image/webp,*/*"),s.e(A,{type:"image"}),e.push({abortController:R,requestParameters:A,supportImageRefresh:D,state:"queued",onError:Z=>{O(Z)},onSuccess:Z=>{N(Z)}}),y()});const p=A=>s._(this,void 0,void 0,function*(){A.state="running";const{requestParameters:R,supportImageRefresh:D,onError:N,onSuccess:O,abortController:Z}=A,K=D===!1&&!s.i(self)&&!s.g(R.url)&&(!R.headers||Object.keys(R.headers).reduce((ae,ue)=>ae&&ue==="accept",!0));r++;const ne=K?w(R,Z):s.m(R,Z);try{const ae=yield ne;delete A.abortController,A.state="completed",ae.data instanceof HTMLImageElement||s.b(ae.data)?O(ae):ae.data&&O({data:yield(ie=ae.data,typeof createImageBitmap=="function"?s.f(ie):s.h(ie)),cacheControl:ae.cacheControl,expires:ae.expires})}catch(ae){delete A.abortController,N(ae)}finally{r--,y()}var ie}),y=()=>{const A=(()=>{for(const R of Object.keys(l))if(l[R]())return!0;return!1})()?s.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:s.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let R=r;R<A&&e.length>0;R++){const D=e.shift();D.abortController.signal.aborted?R--:p(D)}},w=(A,R)=>new Promise((D,N)=>{const O=new Image,Z=A.url,K=A.credentials;K&&K==="include"?O.crossOrigin="use-credentials":(K&&K==="same-origin"||!s.d(Z))&&(O.crossOrigin="anonymous"),R.signal.addEventListener("abort",()=>{O.src="",N(s.c())}),O.fetchPriority="high",O.onload=()=>{O.onerror=O.onload=null,D({data:O})},O.onerror=()=>{O.onerror=O.onload=null,R.signal.aborted||N(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},O.src=Z})}($||($={})),$.resetRequestQueue();class de{constructor(e){this._transformRequestFn=e}transformRequest(e,r){return this._transformRequestFn&&this._transformRequestFn(e,r)||{url:e}}setTransformRequest(e){this._transformRequestFn=e}}function Ce(h){const e=[];if(typeof h=="string")e.push({id:"default",url:h});else if(h&&h.length>0){const r=[];for(const{id:a,url:l}of h){const p=`${a}${l}`;r.indexOf(p)===-1&&(r.push(p),e.push({id:a,url:l}))}}return e}function Re(h,e,r){try{const a=new URL(h);return a.pathname+=`${e}${r}`,a.toString()}catch{throw new Error(`Invalid sprite URL "${h}", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically`)}}class Ze{constructor(e,r,a,l){this.context=e,this.format=a,this.texture=e.gl.createTexture(),this.update(r,l)}update(e,r,a){const{width:l,height:p}=e,y=!(this.size&&this.size[0]===l&&this.size[1]===p||a),{context:w}=this,{gl:A}=w;if(this.useMipmap=!!(r&&r.useMipmap),A.bindTexture(A.TEXTURE_2D,this.texture),w.pixelStoreUnpackFlipY.set(!1),w.pixelStoreUnpack.set(1),w.pixelStoreUnpackPremultiplyAlpha.set(this.format===A.RGBA&&(!r||r.premultiply!==!1)),y)this.size=[l,p],e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||s.b(e)?A.texImage2D(A.TEXTURE_2D,0,this.format,this.format,A.UNSIGNED_BYTE,e):A.texImage2D(A.TEXTURE_2D,0,this.format,l,p,0,this.format,A.UNSIGNED_BYTE,e.data);else{const{x:R,y:D}=a||{x:0,y:0};e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||s.b(e)?A.texSubImage2D(A.TEXTURE_2D,0,R,D,A.RGBA,A.UNSIGNED_BYTE,e):A.texSubImage2D(A.TEXTURE_2D,0,R,D,l,p,A.RGBA,A.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&A.generateMipmap(A.TEXTURE_2D),w.pixelStoreUnpackFlipY.setDefault(),w.pixelStoreUnpack.setDefault(),w.pixelStoreUnpackPremultiplyAlpha.setDefault()}bind(e,r,a){const{context:l}=this,{gl:p}=l;p.bindTexture(p.TEXTURE_2D,this.texture),a!==p.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(a=p.LINEAR),e!==this.filter&&(p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,e),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,a||e),this.filter=e),r!==this.wrap&&(p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,r),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,r),this.wrap=r)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}function kt(h){const{userImage:e}=h;return!!(e&&e.render&&e.render())&&(h.data.replace(new Uint8Array(e.data.buffer)),!0)}class tt extends s.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new s.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(e){if(this.loaded!==e&&(this.loaded=e,e)){for(const{ids:r,promiseResolve:a}of this.requestors)a(this._getImagesForIds(r));this.requestors=[]}}getImage(e){const r=this.images[e];if(r&&!r.data&&r.spriteData){const a=r.spriteData;r.data=new s.R({width:a.width,height:a.height},a.context.getImageData(a.x,a.y,a.width,a.height).data),r.spriteData=null}return r}addImage(e,r){if(this.images[e])throw new Error(`Image id ${e} already exist, use updateImage instead`);this._validate(e,r)&&(this.images[e]=r)}_validate(e,r){let a=!0;const l=r.data||r.spriteData;return this._validateStretch(r.stretchX,l&&l.width)||(this.fire(new s.k(new Error(`Image "${e}" has invalid "stretchX" value`))),a=!1),this._validateStretch(r.stretchY,l&&l.height)||(this.fire(new s.k(new Error(`Image "${e}" has invalid "stretchY" value`))),a=!1),this._validateContent(r.content,r)||(this.fire(new s.k(new Error(`Image "${e}" has invalid "content" value`))),a=!1),a}_validateStretch(e,r){if(!e)return!0;let a=0;for(const l of e){if(l[0]<a||l[1]<l[0]||r<l[1])return!1;a=l[1]}return!0}_validateContent(e,r){if(!e)return!0;if(e.length!==4)return!1;const a=r.spriteData,l=a&&a.width||r.data.width,p=a&&a.height||r.data.height;return!(e[0]<0||l<e[0]||e[1]<0||p<e[1]||e[2]<0||l<e[2]||e[3]<0||p<e[3]||e[2]<e[0]||e[3]<e[1])}updateImage(e,r,a=!0){const l=this.getImage(e);if(a&&(l.data.width!==r.data.width||l.data.height!==r.data.height))throw new Error(`size mismatch between old image (${l.data.width}x${l.data.height}) and new image (${r.data.width}x${r.data.height}).`);r.version=l.version+1,this.images[e]=r,this.updatedImages[e]=!0}removeImage(e){const r=this.images[e];delete this.images[e],delete this.patterns[e],r.userImage&&r.userImage.onRemove&&r.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(e){return new Promise((r,a)=>{let l=!0;if(!this.isLoaded())for(const p of e)this.images[p]||(l=!1);this.isLoaded()||l?r(this._getImagesForIds(e)):this.requestors.push({ids:e,promiseResolve:r})})}_getImagesForIds(e){const r={};for(const a of e){let l=this.getImage(a);l||(this.fire(new s.l("styleimagemissing",{id:a})),l=this.getImage(a)),l?r[a]={data:l.data.clone(),pixelRatio:l.pixelRatio,sdf:l.sdf,version:l.version,stretchX:l.stretchX,stretchY:l.stretchY,content:l.content,textFitWidth:l.textFitWidth,textFitHeight:l.textFitHeight,hasRenderCallback:!!(l.userImage&&l.userImage.render)}:s.w(`Image "${a}" 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 r}getPixelSize(){const{width:e,height:r}=this.atlasImage;return{width:e,height:r}}getPattern(e){const r=this.patterns[e],a=this.getImage(e);if(!a)return null;if(r&&r.position.version===a.version)return r.position;if(r)r.position.version=a.version;else{const l={w:a.data.width+2,h:a.data.height+2,x:0,y:0},p=new s.I(l,a);this.patterns[e]={bin:l,position:p}}return this._updatePatternAtlas(),this.patterns[e].position}bind(e){const r=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new Ze(e,this.atlasImage,r.RGBA),this.atlasTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}_updatePatternAtlas(){const e=[];for(const p in this.patterns)e.push(this.patterns[p].bin);const{w:r,h:a}=s.p(e),l=this.atlasImage;l.resize({width:r||1,height:a||1});for(const p in this.patterns){const{bin:y}=this.patterns[p],w=y.x+1,A=y.y+1,R=this.getImage(p).data,D=R.width,N=R.height;s.R.copy(R,l,{x:0,y:0},{x:w,y:A},{width:D,height:N}),s.R.copy(R,l,{x:0,y:N-1},{x:w,y:A-1},{width:D,height:1}),s.R.copy(R,l,{x:0,y:0},{x:w,y:A+N},{width:D,height:1}),s.R.copy(R,l,{x:D-1,y:0},{x:w-1,y:A},{width:1,height:N}),s.R.copy(R,l,{x:0,y:0},{x:w+D,y:A},{width:1,height:N})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(e){for(const r of e){if(this.callbackDispatchedThisFrame[r])continue;this.callbackDispatchedThisFrame[r]=!0;const a=this.getImage(r);a||s.w(`Image with ID: "${r}" was not found`),kt(a)&&this.updateImage(r,a)}}}const Ge=1e20;function it(h,e,r,a,l,p,y,w,A){for(let R=e;R<e+a;R++)vt(h,r*p+R,p,l,y,w,A);for(let R=r;R<r+l;R++)vt(h,R*p+e,1,a,y,w,A)}function vt(h,e,r,a,l,p,y){p[0]=0,y[0]=-1e20,y[1]=Ge,l[0]=h[e];for(let w=1,A=0,R=0;w<a;w++){l[w]=h[e+w*r];const D=w*w;do{const N=p[A];R=(l[w]-l[N]+D-N*N)/(w-N)/2}while(R<=y[A]&&--A>-1);A++,p[A]=w,y[A]=R,y[A+1]=Ge}for(let w=0,A=0;w<a;w++){for(;y[A+1]<w;)A++;const R=p[A],D=w-R;h[e+w*r]=l[R]+D*D}}class Lt{constructor(e,r){this.requestManager=e,this.localIdeographFontFamily=r,this.entries={}}setURL(e){this.url=e}getGlyphs(e){return s._(this,void 0,void 0,function*(){const r=[];for(const p in e)for(const y of e[p])r.push(this._getAndCacheGlyphsPromise(p,y));const a=yield Promise.all(r),l={};for(const{stack:p,id:y,glyph:w}of a)l[p]||(l[p]={}),l[p][y]=w&&{id:w.id,bitmap:w.bitmap.clone(),metrics:w.metrics};return l})}_getAndCacheGlyphsPromise(e,r){return s._(this,void 0,void 0,function*(){let a=this.entries[e];a||(a=this.entries[e]={glyphs:{},requests:{},ranges:{}});let l=a.glyphs[r];if(l!==void 0)return{stack:e,id:r,glyph:l};if(l=this._tinySDF(a,e,r),l)return a.glyphs[r]=l,{stack:e,id:r,glyph:l};const p=Math.floor(r/256);if(256*p>65535)throw new Error("glyphs > 65535 not supported");if(a.ranges[p])return{stack:e,id:r,glyph:l};if(!this.url)throw new Error("glyphsUrl is not set");if(!a.requests[p]){const w=Lt.loadGlyphRange(e,p,this.url,this.requestManager);a.requests[p]=w}const y=yield a.requests[p];for(const w in y)this._doesCharSupportLocalGlyph(+w)||(a.glyphs[+w]=y[+w]);return a.ranges[p]=!0,{stack:e,id:r,glyph:y[r]||null}})}_doesCharSupportLocalGlyph(e){return!!this.localIdeographFontFamily&&(new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(e))||s.u["CJK Unified Ideographs"](e)||s.u["Hangul Syllables"](e)||s.u.Hiragana(e)||s.u.Katakana(e)||s.u["CJK Symbols and Punctuation"](e)||s.u["Halfwidth and Fullwidth Forms"](e))}_tinySDF(e,r,a){const l=this.localIdeographFontFamily;if(!l||!this._doesCharSupportLocalGlyph(a))return;let p=e.tinySDF;if(!p){let w="400";/bold/i.test(r)?w="900":/medium/i.test(r)?w="500":/light/i.test(r)&&(w="200"),p=e.tinySDF=new Lt.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:l,fontWeight:w})}const y=p.draw(String.fromCharCode(a));return{id:a,bitmap:new s.q({width:y.width||60,height:y.height||60},y.data),metrics:{width:y.glyphWidth/2||24,height:y.glyphHeight/2||24,left:y.glyphLeft/2+.5||0,top:y.glyphTop/2-27.5||-8,advance:y.glyphAdvance/2||24,isDoubleResolution:!0}}}}Lt.loadGlyphRange=function(h,e,r,a){return s._(this,void 0,void 0,function*(){const l=256*e,p=l+255,y=a.transformRequest(r.replace("{fontstack}",h).replace("{range}",`${l}-${p}`),"Glyphs"),w=yield s.n(y,new AbortController);if(!w||!w.data)throw new Error(`Could not load glyph range. range: ${e}, ${l}-${p}`);const A={};for(const R of s.o(w.data))A[R.id]=R;return A})},Lt.TinySDF=class{constructor({fontSize:h=24,buffer:e=3,radius:r=8,cutoff:a=.25,fontFamily:l="sans-serif",fontWeight:p="normal",fontStyle:y="normal"}={}){this.buffer=e,this.cutoff=a,this.radius=r;const w=this.size=h+4*e,A=this._createCanvas(w),R=this.ctx=A.getContext("2d",{willReadFrequently:!0});R.font=`${y} ${p} ${h}px ${l}`,R.textBaseline="alphabetic",R.textAlign="left",R.fillStyle="black",this.gridOuter=new Float64Array(w*w),this.gridInner=new Float64Array(w*w),this.f=new Float64Array(w),this.z=new Float64Array(w+1),this.v=new Uint16Array(w)}_createCanvas(h){const e=document.createElement("canvas");return e.width=e.height=h,e}draw(h){const{width:e,actualBoundingBoxAscent:r,actualBoundingBoxDescent:a,actualBoundingBoxLeft:l,actualBoundingBoxRight:p}=this.ctx.measureText(h),y=Math.ceil(r),w=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(p-l))),A=Math.min(this.size-this.buffer,y+Math.ceil(a)),R=w+2*this.buffer,D=A+2*this.buffer,N=Math.max(R*D,0),O=new Uint8ClampedArray(N),Z={data:O,width:R,height:D,glyphWidth:w,glyphHeight:A,glyphTop:y,glyphLeft:0,glyphAdvance:e};if(w===0||A===0)return Z;const{ctx:K,buffer:ne,gridInner:ie,gridOuter:ae}=this;K.clearRect(ne,ne,w,A),K.fillText(h,ne,ne+y);const ue=K.getImageData(ne,ne,w,A);ae.fill(Ge,0,N),ie.fill(0,0,N);for(let me=0;me<A;me++)for(let fe=0;fe<w;fe++){const ge=ue.data[4*(me*w+fe)+3]/255;if(ge===0)continue;const xe=(me+ne)*R+fe+ne;if(ge===1)ae[xe]=0,ie[xe]=Ge;else{const ye=.5-ge;ae[xe]=ye>0?ye*ye:0,ie[xe]=ye<0?ye*ye:0}}it(ae,0,0,R,D,R,this.f,this.v,this.z),it(ie,ne,ne,w,A,R,this.f,this.v,this.z);for(let me=0;me<N;me++){const fe=Math.sqrt(ae[me])-Math.sqrt(ie[me]);O[me]=Math.round(255-255*(fe/this.radius+this.cutoff))}return Z}};class Ar{constructor(){this.specification=s.v.light.position}possiblyEvaluate(e,r){return s.z(e.expression.evaluate(r))}interpolate(e,r,a){return{x:s.B.number(e.x,r.x,a),y:s.B.number(e.y,r.y,a),z:s.B.number(e.z,r.z,a)}}}let hr;class xi extends s.E{constructor(e){super(),hr=hr||new s.r({anchor:new s.D(s.v.light.anchor),position:new Ar,color:new s.D(s.v.light.color),intensity:new s.D(s.v.light.intensity)}),this._transitionable=new s.T(hr),this.setLight(e),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(e,r={}){if(!this._validate(s.t,e,r))for(const a in e){const l=e[a];a.endsWith("-transition")?this._transitionable.setTransition(a.slice(0,-11),l):this._transitionable.setValue(a,l)}}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,r,a){return(!a||a.validate!==!1)&&s.x(this,e.call(s.y,{value:r,style:{glyphs:!0,sprite:!0},styleSpec:s.v}))}}const Jt=new s.r({"sky-color":new s.D(s.v.sky["sky-color"]),"horizon-color":new s.D(s.v.sky["horizon-color"]),"fog-color":new s.D(s.v.sky["fog-color"]),"fog-ground-blend":new s.D(s.v.sky["fog-ground-blend"]),"horizon-fog-blend":new s.D(s.v.sky["horizon-fog-blend"]),"sky-horizon-blend":new s.D(s.v.sky["sky-horizon-blend"]),"atmosphere-blend":new s.D(s.v.sky["atmosphere-blend"])});class nn extends s.E{constructor(e){super(),this._transitionable=new s.T(Jt),this.setSky(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new s.C(0))}setSky(e,r={}){if(!this._validate(s.F,e,r)){e||(e={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(const a in e){const l=e[a];a.endsWith("-transition")?this._transitionable.setTransition(a.slice(0,-11),l):this._transitionable.setValue(a,l)}}}getSky(){return this._transitionable.serialize()}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,r,a={}){return(a==null?void 0:a.validate)!==!1&&s.x(this,e.call(s.y,s.e({value:r,style:{glyphs:!0,sprite:!0},styleSpec:s.v})))}calculateFogBlendOpacity(e){return e<60?0:e<70?(e-60)/10:1}}class Ei{constructor(e,r){this.width=e,this.height=r,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(e,r){const a=e.join(",")+String(r);return this.dashEntry[a]||(this.dashEntry[a]=this.addDash(e,r)),this.dashEntry[a]}getDashRanges(e,r,a){const l=[];let p=e.length%2==1?-e[e.length-1]*a:0,y=e[0]*a,w=!0;l.push({left:p,right:y,isDash:w,zeroLength:e[0]===0});let A=e[0];for(let R=1;R<e.length;R++){w=!w;const D=e[R];p=A*a,A+=D,y=A*a,l.push({left:p,right:y,isDash:w,zeroLength:D===0})}return l}addRoundDash(e,r,a){const l=r/2;for(let p=-a;p<=a;p++){const y=this.width*(this.nextRow+a+p);let w=0,A=e[w];for(let R=0;R<this.width;R++){R/A.right>1&&(A=e[++w]);const D=Math.abs(R-A.left),N=Math.abs(R-A.right),O=Math.min(D,N);let Z;const K=p/a*(l+1);if(A.isDash){const ne=l-Math.abs(K);Z=Math.sqrt(O*O+ne*ne)}else Z=l-Math.sqrt(O*O+K*K);this.data[y+R]=Math.max(0,Math.min(255,Z+128))}}}addRegularDash(e){for(let w=e.length-1;w>=0;--w){const A=e[w],R=e[w+1];A.zeroLength?e.splice(w,1):R&&R.isDash===A.isDash&&(R.left=A.left,e.splice(w,1))}const r=e[0],a=e[e.length-1];r.isDash===a.isDash&&(r.left=a.left-this.width,a.right=r.right+this.width);const l=this.width*this.nextRow;let p=0,y=e[p];for(let w=0;w<this.width;w++){w/y.right>1&&(y=e[++p]);const A=Math.abs(w-y.left),R=Math.abs(w-y.right),D=Math.min(A,R);this.data[l+w]=Math.max(0,Math.min(255,(y.isDash?D:-D)+128))}}addDash(e,r){const a=r?7:0,l=2*a+1;if(this.nextRow+l>this.height)return s.w("LineAtlas out of space"),null;let p=0;for(let w=0;w<e.length;w++)p+=e[w];if(p!==0){const w=this.width/p,A=this.getDashRanges(e,this.width,w);r?this.addRoundDash(A,w,a):this.addRegularDash(A)}const y={y:(this.nextRow+a+.5)/this.height,height:2*a/this.height,width:p};return this.nextRow+=l,this.dirty=!0,y}bind(e){const r=e.gl;this.texture?(r.bindTexture(r.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,r.texSubImage2D(r.TEXTURE_2D,0,0,0,this.width,this.height,r.ALPHA,r.UNSIGNED_BYTE,this.data))):(this.texture=r.createTexture(),r.bindTexture(r.TEXTURE_2D,this.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.REPEAT),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.REPEAT),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texImage2D(r.TEXTURE_2D,0,r.ALPHA,this.width,this.height,0,r.ALPHA,r.UNSIGNED_BYTE,this.data))}}const kn="maplibre_preloaded_worker_pool";class Kr{constructor(){this.active={}}acquire(e){if(!this.workers)for(this.workers=[];this.workers.length<Kr.workerCount;)this.workers.push(new Worker(s.a.WORKER_URL));return this.active[e]=!0,this.workers.slice()}release(e){delete this.active[e],this.numActive()===0&&(this.workers.forEach(r=>{r.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[kn]}numActive(){return Object.keys(this.active).length}}const as=Math.floor(M.hardwareConcurrency/2);let Pi,Lr;function et(){return Pi||(Pi=new Kr),Pi}Kr.workerCount=s.G(globalThis)?Math.max(Math.min(as,3),1):1;class Qe{constructor(e,r){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=r;const a=this.workerPool.acquire(r);for(let l=0;l<a.length;l++){const p=new s.H(a[l],r);p.name=`Worker ${l}`,this.actors.push(p)}if(!this.actors.length)throw new Error("No actors found")}broadcast(e,r){const a=[];for(const l of this.actors)a.push(l.sendAsync({type:e,data:r}));return Promise.all(a)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(e=!0){this.actors.forEach(r=>{r.remove()}),this.actors=[],e&&this.workerPool.release(this.id)}registerMessageHandler(e,r){for(const a of this.actors)a.registerMessageHandler(e,r)}}function ut(){return Lr||(Lr=new Qe(et(),s.J),Lr.registerMessageHandler("GR",(h,e,r)=>s.m(e,r))),Lr}function xt(h,e){const r=s.K();return s.L(r,r,[1,1,0]),s.M(r,r,[.5*h.width,.5*h.height,1]),h.calculatePosMatrix?s.N(r,r,h.calculatePosMatrix(e.toUnwrapped())):r}function ot(h,e,r,a,l,p,y){var w;const A=function(O,Z,K){if(O)for(const ne of O){const ie=Z[ne];if(ie&&ie.source===K&&ie.type==="fill-extrusion")return!0}else for(const ne in Z){const ie=Z[ne];if(ie.source===K&&ie.type==="fill-extrusion")return!0}return!1}((w=l==null?void 0:l.layers)!==null&&w!==void 0?w:null,e,h.id),R=p.maxPitchScaleFactor(),D=h.tilesIn(a,R,A);D.sort(ht);const N=[];for(const O of D)N.push({wrappedTileID:O.tileID.wrapped().key,queryResults:O.tile.queryRenderedFeatures(e,r,h._state,O.queryGeometry,O.cameraQueryGeometry,O.scale,l,p,R,xt(h.transform,O.tileID),y?(Z,K)=>y(O.tileID,Z,K):void 0)});return function(O,Z){for(const K in O)for(const ne of O[K])Ct(ne,Z);return O}(function(O){const Z={},K={};for(const ne of O){const ie=ne.queryResults,ae=ne.wrappedTileID,ue=K[ae]=K[ae]||{};for(const me in ie){const fe=ie[me],ge=ue[me]=ue[me]||{},xe=Z[me]=Z[me]||[];for(const ye of fe)ge[ye.featureIndex]||(ge[ye.featureIndex]=!0,xe.push(ye))}}return Z}(N),h)}function ht(h,e){const r=h.tileID,a=e.tileID;return r.overscaledZ-a.overscaledZ||r.canonical.y-a.canonical.y||r.wrap-a.wrap||r.canonical.x-a.canonical.x}function Ct(h,e){const r=h.feature,a=e.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=a}function _t(h,e,r){return s._(this,void 0,void 0,function*(){let a=h;if(h.url?a=(yield s.j(e.transformRequest(h.url,"Source"),r)).data:yield M.frameAsync(r),!a)return null;const l=s.O(s.e(a,h),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in a&&a.vector_layers&&(l.vectorLayerIds=a.vector_layers.map(p=>p.id)),l})}class dt{constructor(e,r){e&&(r?this.setSouthWest(e).setNorthEast(r):Array.isArray(e)&&(e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}setNorthEast(e){return this._ne=e instanceof s.Q?new s.Q(e.lng,e.lat):s.Q.convert(e),this}setSouthWest(e){return this._sw=e instanceof s.Q?new s.Q(e.lng,e.lat):s.Q.convert(e),this}extend(e){const r=this._sw,a=this._ne;let l,p;if(e instanceof s.Q)l=e,p=e;else{if(!(e instanceof dt))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(dt.convert(e)):this.extend(s.Q.convert(e)):e&&("lng"in e||"lon"in e)&&"lat"in e?this.extend(s.Q.convert(e)):this;if(l=e._sw,p=e._ne,!l||!p)return this}return r||a?(r.lng=Math.min(l.lng,r.lng),r.lat=Math.min(l.lat,r.lat),a.lng=Math.max(p.lng,a.lng),a.lat=Math.max(p.lat,a.lat)):(this._sw=new s.Q(l.lng,l.lat),this._ne=new s.Q(p.lng,p.lat)),this}getCenter(){return new s.Q((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 s.Q(this.getWest(),this.getNorth())}getSouthEast(){return new s.Q(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(e){const{lng:r,lat:a}=s.Q.convert(e);let l=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(l=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=a&&a<=this._ne.lat&&l}static convert(e){return e instanceof dt?e:e&&new dt(e)}static fromLngLat(e,r=0){const a=360*r/40075017,l=a/Math.cos(Math.PI/180*e.lat);return new dt(new s.Q(e.lng-l,e.lat-a),new s.Q(e.lng+l,e.lat+a))}adjustAntiMeridian(){const e=new s.Q(this._sw.lng,this._sw.lat),r=new s.Q(this._ne.lng,this._ne.lat);return new dt(e,e.lng>r.lng?new s.Q(r.lng+360,r.lat):r)}}class er{constructor(e,r,a){this.bounds=dt.convert(this.validateBounds(e)),this.minzoom=r||0,this.maxzoom=a||24}validateBounds(e){return Array.isArray(e)&&e.length===4?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}contains(e){const r=Math.pow(2,e.z),a=Math.floor(s.U(this.bounds.getWest())*r),l=Math.floor(s.S(this.bounds.getNorth())*r),p=Math.ceil(s.U(this.bounds.getEast())*r),y=Math.ceil(s.S(this.bounds.getSouth())*r);return e.x>=a&&e.x<p&&e.y>=l&&e.y<y}}class bi extends s.E{constructor(e,r,a,l){if(super(),this.id=e,this.dispatcher=a,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,s.e(this,s.O(r,["url","scheme","tileSize","promoteId"])),this._options=s.e({type:"vector"},r),this._collectResourceTiming=r.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(l)}load(){return s._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new s.l("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const e=yield _t(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),e&&(s.e(this,e),e.bounds&&(this.tileBounds=new er(e.bounds,this.minzoom,this.maxzoom)),this.fire(new s.l("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.l("data",{dataType:"source",sourceDataType:"content"})))}catch(e){this._tileJSONRequest=null,this.fire(new s.k(e))}})}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}setSourceProperty(e){this._tileJSONRequest&&this._tileJSONRequest.abort(),e(),this.load()}setTiles(e){return this.setSourceProperty(()=>{this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return s.e({},this._options)}loadTile(e){return s._(this,void 0,void 0,function*(){const r=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),a={request:this.map._requestManager.transformRequest(r,"Tile"),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.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};a.request.collectResourceTiming=this._collectResourceTiming;let l="RT";if(e.actor&&e.state!=="expired"){if(e.state==="loading")return new Promise((p,y)=>{e.reloadPromise={resolve:p,reject:y}})}else e.actor=this.dispatcher.getActor(),l="LT";e.abortController=new AbortController;try{const p=yield e.actor.sendAsync({type:l,data:a},e.abortController);if(delete e.abortController,e.aborted)return;this._afterTileLoadWorkerResponse(e,p)}catch(p){if(delete e.abortController,e.aborted)return;if(p&&p.status!==404)throw p;this._afterTileLoadWorkerResponse(e,null)}})}_afterTileLoadWorkerResponse(e,r){if(r&&r.resourceTiming&&(e.resourceTiming=r.resourceTiming),r&&this.map._refreshExpiredTiles&&e.setExpiryData(r),e.loadVectorData(r,this.map.painter),e.reloadPromise){const a=e.reloadPromise;e.reloadPromise=null,this.loadTile(e).then(a.resolve).catch(a.reject)}}abortTile(e){return s._(this,void 0,void 0,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.actor&&(yield e.actor.sendAsync({type:"AT",data:{uid:e.uid,type:this.type,source:this.id}}))})}unloadTile(e){return s._(this,void 0,void 0,function*(){e.unloadVectorData(),e.actor&&(yield e.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class Yt extends s.E{constructor(e,r,a,l){super(),this.id=e,this.dispatcher=a,this.setEventedParent(l),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=s.e({type:"raster"},r),s.e(this,s.O(r,["url","scheme","tileSize"]))}load(){return s._(this,arguments,void 0,function*(e=!1){this._loaded=!1,this.fire(new s.l("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const r=yield _t(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,r&&(s.e(this,r),r.bounds&&(this.tileBounds=new er(r.bounds,this.minzoom,this.maxzoom)),this.fire(new s.l("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.l("data",{dataType:"source",sourceDataType:"content",sourceDataChanged:e})))}catch(r){this._tileJSONRequest=null,this.fire(new s.k(r))}})}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(e){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),e(),this.load(!0)}setTiles(e){return this.setSourceProperty(()=>{this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}serialize(){return s.e({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(e){return s._(this,void 0,void 0,function*(){const r=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);e.abortController=new AbortController;try{const a=yield $.getImage(this.map._requestManager.transformRequest(r,"Tile"),e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(a&&a.data){this.map._refreshExpiredTiles&&(a.cacheControl||a.expires)&&e.setExpiryData({cacheControl:a.cacheControl,expires:a.expires});const l=this.map.painter.context,p=l.gl,y=a.data;e.texture=this.map.painter.getTileTexture(y.width),e.texture?e.texture.update(y,{useMipmap:!0}):(e.texture=new Ze(l,y,p.RGBA,{useMipmap:!0}),e.texture.bind(p.LINEAR,p.CLAMP_TO_EDGE,p.LINEAR_MIPMAP_NEAREST)),e.state="loaded"}}catch(a){if(delete e.abortController,e.aborted)e.state="unloaded";else if(a)throw e.state="errored",a}})}abortTile(e){return s._(this,void 0,void 0,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController)})}unloadTile(e){return s._(this,void 0,void 0,function*(){e.texture&&this.map.painter.saveTileTexture(e.texture)})}hasTransition(){return!1}}class Fi extends Yt{constructor(e,r,a,l){super(e,r,a,l),this.type="raster-dem",this.maxzoom=22,this._options=s.e({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox",this.redFactor=r.redFactor,this.greenFactor=r.greenFactor,this.blueFactor=r.blueFactor,this.baseShift=r.baseShift}loadTile(e){return s._(this,void 0,void 0,function*(){const r=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),a=this.map._requestManager.transformRequest(r,"Tile");e.neighboringTiles=this._getNeighboringTiles(e.tileID),e.abortController=new AbortController;try{const l=yield $.getImage(a,e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(l&&l.data){const p=l.data;this.map._refreshExpiredTiles&&(l.cacheControl||l.expires)&&e.setExpiryData({cacheControl:l.cacheControl,expires:l.expires});const y=s.b(p)&&s.V()?p:yield this.readImageNow(p),w={type:this.type,uid:e.uid,source:this.id,rawImageData:y,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!e.actor||e.state==="expired"){e.actor=this.dispatcher.getActor();const A=yield e.actor.sendAsync({type:"LDT",data:w});e.dem=A,e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.state="loaded"}}}catch(l){if(delete e.abortController,e.aborted)e.state="unloaded";else if(l)throw e.state="errored",l}})}readImageNow(e){return s._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&s.W()){const r=e.width+2,a=e.height+2;try{return new s.R({width:r,height:a},yield s.X(e,-1,-1,r,a))}catch{}}return M.getImageData(e,1)})}_getNeighboringTiles(e){const r=e.canonical,a=Math.pow(2,r.z),l=(r.x-1+a)%a,p=r.x===0?e.wrap-1:e.wrap,y=(r.x+1+a)%a,w=r.x+1===a?e.wrap+1:e.wrap,A={};return A[new s.Y(e.overscaledZ,p,r.z,l,r.y).key]={backfilled:!1},A[new s.Y(e.overscaledZ,w,r.z,y,r.y).key]={backfilled:!1},r.y>0&&(A[new s.Y(e.overscaledZ,p,r.z,l,r.y-1).key]={backfilled:!1},A[new s.Y(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},A[new s.Y(e.overscaledZ,w,r.z,y,r.y-1).key]={backfilled:!1}),r.y+1<a&&(A[new s.Y(e.overscaledZ,p,r.z,l,r.y+1).key]={backfilled:!1},A[new s.Y(e.overscaledZ,e.wrap,r.z,r.x,r.y+1).key]={backfilled:!1},A[new s.Y(e.overscaledZ,w,r.z,y,r.y+1).key]={backfilled:!1}),A}unloadTile(e){return s._(this,void 0,void 0,function*(){e.demTexture&&this.map.painter.saveTileTexture(e.demTexture),e.fbo&&(e.fbo.destroy(),delete e.fbo),e.dem&&delete e.dem,delete e.neighboringTiles,e.state="unloaded",e.actor&&(yield e.actor.sendAsync({type:"RDT",data:{type:this.type,uid:e.uid,source:this.id}}))})}}class Qt extends s.E{constructor(e,r,a,l){super(),this.id=e,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=a.getActor(),this.setEventedParent(l),this._data=r.data,this._options=s.e({},r),this._collectResourceTiming=r.collectResourceTiming,r.maxzoom!==void 0&&(this.maxzoom=r.maxzoom),r.type&&(this.type=r.type),r.attribution&&(this.attribution=r.attribution),this.promoteId=r.promoteId,r.clusterMaxZoom!==void 0&&this.maxzoom<=r.clusterMaxZoom&&s.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${r.clusterMaxZoom}".`),this.workerOptions=s.e({source:this.id,cluster:r.cluster||!1,geojsonVtOptions:{buffer:this._pixelsToTileUnits(r.buffer!==void 0?r.buffer:128),tolerance:this._pixelsToTileUnits(r.tolerance!==void 0?r.tolerance:.375),extent:s.Z,maxZoom:this.maxzoom,lineMetrics:r.lineMetrics||!1,generateId:r.generateId||!1},superclusterOptions:{maxZoom:r.clusterMaxZoom!==void 0?r.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,r.clusterMinPoints||2),extent:s.Z,radius:this._pixelsToTileUnits(r.clusterRadius||50),log:!1,generateId:r.generateId||!1},clusterProperties:r.clusterProperties,filter:r.filter},r.workerOptions),typeof this.promoteId=="string"&&(this.workerOptions.promoteId=this.promoteId)}_pixelsToTileUnits(e){return e*(s.Z/this.tileSize)}load(){return s._(this,void 0,void 0,function*(){yield this._updateWorkerData()})}onAdd(e){this.map=e,this.load()}setData(e){return this._data=e,this._updateWorkerData(),this}updateData(e){return this._updateWorkerData(e),this}getData(){return s._(this,void 0,void 0,function*(){const e=s.e({type:this.type},this.workerOptions);return this.actor.sendAsync({type:"GD",data:e})})}getCoordinatesFromGeometry(e){return e.type==="GeometryCollection"?e.geometries.map(r=>r.coordinates).flat(1/0):e.coordinates.flat(1/0)}getBounds(){return s._(this,void 0,void 0,function*(){const e=new dt,r=yield this.getData();let a;switch(r.type){case"FeatureCollection":a=r.features.map(l=>this.getCoordinatesFromGeometry(l.geometry)).flat(1/0);break;case"Feature":a=this.getCoordinatesFromGeometry(r.geometry);break;default:a=this.getCoordinatesFromGeometry(r)}if(a.length==0)return e;for(let l=0;l<a.length-1;l+=2)e.extend([a[l],a[l+1]]);return e})}setClusterOptions(e){return this.workerOptions.cluster=e.cluster,e&&(e.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=this._pixelsToTileUnits(e.clusterRadius)),e.clusterMaxZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=e.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(e){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:e,source:this.id}})}getClusterChildren(e){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:e,source:this.id}})}getClusterLeaves(e,r,a){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:e,limit:r,offset:a}})}_updateWorkerData(e){return s._(this,void 0,void 0,function*(){const r=s.e({type:this.type},this.workerOptions);e?r.dataDiff=e:typeof this._data=="string"?(r.request=this.map._requestManager.transformRequest(M.resolveURL(this._data),"Source"),r.request.collectResourceTiming=this._collectResourceTiming):r.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new s.l("dataloading",{dataType:"source"}));try{const a=yield this.actor.sendAsync({type:"LD",data:r});if(this._pendingLoads--,this._removed||a.abandoned)return void this.fire(new s.l("dataabort",{dataType:"source"}));let l=null;a.resourceTiming&&a.resourceTiming[this.id]&&(l=a.resourceTiming[this.id].slice(0));const p={dataType:"source"};this._collectResourceTiming&&l&&l.length>0&&s.e(p,{resourceTiming:l}),this.fire(new s.l("data",Object.assign(Object.assign({},p),{sourceDataType:"metadata"}))),this.fire(new s.l("data",Object.assign(Object.assign({},p),{sourceDataType:"content"})))}catch(a){if(this._pendingLoads--,this._removed)return void this.fire(new s.l("dataabort",{dataType:"source"}));this.fire(new s.k(a))}})}loaded(){return this._pendingLoads===0}loadTile(e){return s._(this,void 0,void 0,function*(){const r=e.actor?"RT":"LT";e.actor=this.actor;const a={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.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};e.abortController=new AbortController;const l=yield this.actor.sendAsync({type:r,data:a},e.abortController);delete e.abortController,e.unloadVectorData(),e.aborted||e.loadVectorData(l,this.map.painter,r==="RT")})}abortTile(e){return s._(this,void 0,void 0,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.aborted=!0})}unloadTile(e){return s._(this,void 0,void 0,function*(){e.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:e.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 s.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}class Rr extends s.E{constructor(e,r,a,l){super(),this.flippedWindingOrder=!1,this.id=e,this.dispatcher=a,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(l),this.options=r}load(e){return s._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new s.l("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const r=yield $.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,r&&r.data&&(this.image=r.data,e&&(this.coordinates=e),this._finishLoading())}catch(r){this._request=null,this._loaded=!0,this.fire(new s.k(r))}})}loaded(){return this._loaded}updateImage(e){return e.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=e.url,this.load(e.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new s.l("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(e){this.coordinates=e;const r=e.map(s.$.fromLngLat);var a;return this.tileID=function(l){let p=1/0,y=1/0,w=-1/0,A=-1/0;for(const O of l)p=Math.min(p,O.x),y=Math.min(y,O.y),w=Math.max(w,O.x),A=Math.max(A,O.y);const R=Math.max(w-p,A-y),D=Math.max(0,Math.floor(-Math.log(R)/Math.LN2)),N=Math.pow(2,D);return new s.a1(D,Math.floor((p+w)/2*N),Math.floor((y+A)/2*N))}(r),this.terrainTileRanges=this._getOverlappingTileRanges(r),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=r.map(l=>this.tileID.getTilePoint(l)._round()),this.flippedWindingOrder=((a=this.tileCoords)[1].x-a[0].x)*(a[2].y-a[0].y)-(a[1].y-a[0].y)*(a[2].x-a[0].x)<0,this.fire(new s.l("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const e=this.map.painter.context,r=e.gl;this.texture||(this.texture=new Ze(e,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let a=!1;for(const l in this.tiles){const p=this.tiles[l];p.state!=="loaded"&&(p.state="loaded",p.texture=this.texture,a=!0)}a&&this.fire(new s.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(e){return s._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={}):e.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}_getOverlappingTileRanges(e){let r=1/0,a=1/0,l=-1/0,p=-1/0;for(const w of e)r=Math.min(r,w.x),a=Math.min(a,w.y),l=Math.max(l,w.x),p=Math.max(p,w.y);const y={};for(let w=0;w<=s.a0;w++){const A=Math.pow(2,w),R=Math.floor(r*A),D=Math.floor(a*A),N=Math.floor(l*A),O=Math.floor(p*A);y[w]={minTileX:R,minTileY:D,maxTileX:N,maxTileY:O}}return y}}class ai extends Rr{constructor(e,r,a,l){super(e,r,a,l),this.roundZoom=!0,this.type="video",this.options=r}load(){return s._(this,void 0,void 0,function*(){this._loaded=!1;const e=this.options;this.urls=[];for(const r of e.urls)this.urls.push(this.map._requestManager.transformRequest(r,"Source").url);try{const r=yield s.a2(this.urls);if(this._loaded=!0,!r)return;this.video=r,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(r){this.fire(new s.k(r))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(e){if(this.video){const r=this.video.seekable;e<r.start(0)||e>r.end(0)?this.fire(new s.k(new s.a3(`sources.${this.id}`,null,`Playback for this video can be set only between the ${r.start(0)} and ${r.end(0)}-second mark.`))):this.video.currentTime=e}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const e=this.map.painter.context,r=e.gl;this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new Ze(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let a=!1;for(const l in this.tiles){const p=this.tiles[l];p.state!=="loaded"&&(p.state="loaded",p.texture=this.texture,a=!0)}a&&this.fire(new s.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 ir extends Rr{constructor(e,r,a,l){super(e,r,a,l),r.coordinates?Array.isArray(r.coordinates)&&r.coordinates.length===4&&!r.coordinates.some(p=>!Array.isArray(p)||p.length!==2||p.some(y=>typeof y!="number"))||this.fire(new s.k(new s.a3(`sources.${e}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new s.k(new s.a3(`sources.${e}`,null,'missing required property "coordinates"'))),r.animate&&typeof r.animate!="boolean"&&this.fire(new s.k(new s.a3(`sources.${e}`,null,'optional "animate" property must be a boolean value'))),r.canvas?typeof r.canvas=="string"||r.canvas instanceof HTMLCanvasElement||this.fire(new s.k(new s.a3(`sources.${e}`,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 s.k(new s.a3(`sources.${e}`,null,'missing required property "canvas"'))),this.options=r,this.animate=r.animate===void 0||r.animate}load(){return s._(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 s.k(new 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(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const r=this.map.painter.context,a=r.gl;this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new Ze(r,this.canvas,a.RGBA,{premultiply:!0});let l=!1;for(const p in this.tiles){const y=this.tiles[p];y.state!=="loaded"&&(y.state="loaded",y.texture=this.texture,l=!0)}l&&this.fire(new s.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}}const Xt={},bt=h=>{switch(h){case"geojson":return Qt;case"image":return Rr;case"raster":return Yt;case"raster-dem":return Fi;case"vector":return bi;case"video":return ai;case"canvas":return ir}return Xt[h]},Er="RTLPluginLoaded";class Br extends s.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=ut()}_syncState(e){return this.status=e,this.dispatcher.broadcast("SRPS",{pluginStatus:e,pluginURL:this.url}).catch(r=>{throw this.status="error",r})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(e){return s._(this,arguments,void 0,function*(r,a=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=M.resolveURL(r),!this.url)throw new Error(`requested url ${r} is invalid`);if(this.status==="unavailable"){if(!a)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return s._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new s.l(Er))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let Cr=null;function zt(){return Cr||(Cr=new Br),Cr}class qr{constructor(e,r){this.timeAdded=0,this.fadeEndTime=0,this.tileID=e,this.uid=s.a4(),this.uses=0,this.tileSize=r,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(e){const r=e+this.timeAdded;r<this.fadeEndTime||(this.fadeEndTime=r)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(e){this.demTexture&&e.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(e,r,a){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",e){e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=function(l,p){const y={};if(!p)return y;for(const w of l){const A=w.layerIds.map(R=>p.getLayer(R)).filter(Boolean);if(A.length!==0){w.layers=A,w.stateDependentLayerIds&&(w.stateDependentLayers=w.stateDependentLayerIds.map(R=>A.filter(D=>D.id===R)[0]));for(const R of A)y[R.id]=w}}return y}(e.buckets,r==null?void 0:r.style),this.hasSymbolBuckets=!1;for(const l in this.buckets){const p=this.buckets[l];if(p instanceof s.a6){if(this.hasSymbolBuckets=!0,!a)break;p.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const l in this.buckets){const p=this.buckets[l];if(p instanceof s.a6&&p.hasRTLText){this.hasRTLText=!0,zt().lazyLoad();break}}this.queryPadding=0;for(const l in this.buckets){const p=this.buckets[l];this.queryPadding=Math.max(this.queryPadding,r.style.getLayer(l).queryRadius(p))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)}else this.collisionBoxArray=new s.a5}unloadVectorData(){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(e){return this.buckets[e.id]}upload(e){for(const a in this.buckets){const l=this.buckets[a];l.uploadPending()&&l.upload(e)}const r=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Ze(e,this.imageAtlas.image,r.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Ze(e,this.glyphAtlasImage,r.ALPHA),this.glyphAtlasImage=null)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,r,a,l,p,y,w,A,R,D,N){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:l,cameraQueryGeometry:p,scale:y,tileSize:this.tileSize,pixelPosMatrix:D,transform:A,params:w,queryPadding:this.queryPadding*R,getElevation:N},e,r,a):{}}querySourceFeatures(e,r){const a=this.latestFeatureIndex;if(!a||!a.rawTileData)return;const l=a.loadVTLayers(),p=r&&r.sourceLayer?r.sourceLayer:"",y=l._geojsonTileLayer||l[p];if(!y)return;const w=s.a7(r&&r.filter),{z:A,x:R,y:D}=this.tileID.canonical,N={z:A,x:R,y:D};for(let O=0;O<y.length;O++){const Z=y.feature(O);if(w.needGeometry){const ie=s.a8(Z,!0);if(!w.filter(new s.C(this.tileID.overscaledZ),ie,this.tileID.canonical))continue}else if(!w.filter(new s.C(this.tileID.overscaledZ),Z))continue;const K=a.getId(Z,p),ne=new s.a9(Z,A,R,D,K);ne.tile=N,e.push(ne)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){const r=this.expirationTime;if(e.cacheControl){const a=s.aa(e.cacheControl);a["max-age"]&&(this.expirationTime=Date.now()+1e3*a["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){const a=Date.now();let l=!1;if(this.expirationTime>a)l=!1;else if(r)if(this.expirationTime<r)l=!0;else{const p=this.expirationTime-r;p?this.expirationTime=a+Math.max(p,3e4):l=!0}else l=!0;l?(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(),Math.pow(2,31)-1)}setFeatureState(e,r){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(e).length===0)return;const a=this.latestFeatureIndex.loadVTLayers();for(const l in this.buckets){if(!r.style.hasLayer(l))continue;const p=this.buckets[l],y=p.layers[0].sourceLayer||"_geojsonTileLayer",w=a[y],A=e[y];if(!w||!A||Object.keys(A).length===0)continue;p.update(A,w,this.imageAtlas&&this.imageAtlas.patternPositions||{});const R=r&&r.style&&r.style.getLayer(l);R&&(this.queryPadding=Math.max(this.queryPadding,R.queryRadius(p)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<M.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(e){this.symbolFadeHoldUntil=M.now()+e}setDependencies(e,r){const a={};for(const l of r)a[l]=!0;this.dependencies[e]=a}hasDependency(e,r){for(const a of e){const l=this.dependencies[a];if(l){for(const p of r)if(l[p])return!0}}return!1}}class li{constructor(e,r){this.max=e,this.onRemove=r,this.reset()}reset(){for(const e in this.data)for(const r of this.data[e])r.timeout&&clearTimeout(r.timeout),this.onRemove(r.value);return this.data={},this.order=[],this}add(e,r,a){const l=e.wrapped().key;this.data[l]===void 0&&(this.data[l]=[]);const p={value:r,timeout:void 0};if(a!==void 0&&(p.timeout=setTimeout(()=>{this.remove(e,p)},a)),this.data[l].push(p),this.order.push(l),this.order.length>this.max){const y=this._getAndRemoveByKey(this.order[0]);y&&this.onRemove(y)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){const r=this.data[e].shift();return r.timeout&&clearTimeout(r.timeout),this.data[e].length===0&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),r.value}getByKey(e){const r=this.data[e];return r?r[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,r){if(!this.has(e))return this;const a=e.wrapped().key,l=r===void 0?0:this.data[a].indexOf(r),p=this.data[a][l];return this.data[a].splice(l,1),p.timeout&&clearTimeout(p.timeout),this.data[a].length===0&&delete this.data[a],this.onRemove(p.value),this.order.splice(this.order.indexOf(a),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const r=this._getAndRemoveByKey(this.order[0]);r&&this.onRemove(r)}return this}filter(e){const r=[];for(const a in this.data)for(const l of this.data[a])e(l.value)||r.push(l);for(const a of r)this.remove(a.value.tileID,a)}}class wi{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,r,a){const l=String(r);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][l]=this.stateChanges[e][l]||{},s.e(this.stateChanges[e][l],a),this.deletedStates[e]===null){this.deletedStates[e]={};for(const p in this.state[e])p!==l&&(this.deletedStates[e][p]=null)}else if(this.deletedStates[e]&&this.deletedStates[e][l]===null){this.deletedStates[e][l]={};for(const p in this.state[e][l])a[p]||(this.deletedStates[e][l][p]=null)}else for(const p in a)this.deletedStates[e]&&this.deletedStates[e][l]&&this.deletedStates[e][l][p]===null&&delete this.deletedStates[e][l][p]}removeFeatureState(e,r,a){if(this.deletedStates[e]===null)return;const l=String(r);if(this.deletedStates[e]=this.deletedStates[e]||{},a&&r!==void 0)this.deletedStates[e][l]!==null&&(this.deletedStates[e][l]=this.deletedStates[e][l]||{},this.deletedStates[e][l][a]=null);else if(r!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][l])for(a in this.deletedStates[e][l]={},this.stateChanges[e][l])this.deletedStates[e][l][a]=null;else this.deletedStates[e][l]=null;else this.deletedStates[e]=null}getState(e,r){const a=String(r),l=s.e({},(this.state[e]||{})[a],(this.stateChanges[e]||{})[a]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){const p=this.deletedStates[e][r];if(p===null)return{};for(const y in p)delete l[y]}return l}initializeTileState(e,r){e.setFeatureState(this.state,r)}coalesceChanges(e,r){const a={};for(const l in this.stateChanges){this.state[l]=this.state[l]||{};const p={};for(const y in this.stateChanges[l])this.state[l][y]||(this.state[l][y]={}),s.e(this.state[l][y],this.stateChanges[l][y]),p[y]=this.state[l][y];a[l]=p}for(const l in this.deletedStates){this.state[l]=this.state[l]||{};const p={};if(this.deletedStates[l]===null)for(const y in this.state[l])p[y]={},this.state[l][y]={};else for(const y in this.deletedStates[l]){if(this.deletedStates[l][y]===null)this.state[l][y]={};else for(const w of Object.keys(this.deletedStates[l][y]))delete this.state[l][y][w];p[y]=this.state[l][y]}a[l]=a[l]||{},s.e(a[l],p)}if(this.stateChanges={},this.deletedStates={},Object.keys(a).length!==0)for(const l in e)e[l].setFeatureState(a,r)}}const Dr=89.25;function nr(h,e){const r=s.ae(e.lat,-85.051129,s.af);return new s.P(s.U(e.lng)*h,s.S(r)*h)}function Vr(h,e){return new s.$(e.x/h,e.y/h).toLngLat()}function we(h){return h.cameraToCenterDistance*Math.min(.85*Math.tan(s.ab(90-h.pitch)),Math.tan(s.ab(Dr-h.pitch)))}function Q(h,e){const r=h.canonical,a=e/s.ac(r.z),l=r.x+Math.pow(2,r.z)*h.wrap,p=s.ad(new Float64Array(16));return s.L(p,p,[l*a,r.y*a,0]),s.M(p,p,[a/s.Z,a/s.Z,1]),p}function X(h,e,r,a,l){const p=s.$.fromLngLat(h,e),y=l*s.ag(1,h.lat),w=y*Math.cos(s.ab(r)),A=Math.sqrt(y*y-w*w),R=A*Math.sin(s.ab(-a)),D=A*Math.cos(s.ab(-a));return new s.$(p.x+R,p.y+D,p.z+w)}function re(h,e,r){const a=e.intersectsFrustum(h);if(!r)return a;const l=e.intersectsPlane(r);return a===0||l===0?0:a===2&&l===2?2:1}function ce(h,e,r){let a=0;const l=(r-e)/10;for(let p=0;p<10;p++)a+=l*Math.pow(Math.cos(e+(p+.5)/10*(r-e)),h);return a}function _e(h,e){return function(r,a,l,p,y){const w=2*((h-1)/s.ah(Math.cos(s.ab(Dr-y))/Math.cos(s.ab(Dr)))-1),A=Math.acos(l/p),R=2*ce(w-1,0,s.ab(y/2)),D=Math.min(s.ab(Dr),A+s.ab(y/2)),N=ce(w-1,Math.min(D,A-s.ab(y/2)),D),O=Math.atan(a/l),Z=Math.hypot(a,l);let K=r;return K+=s.ah(p/Z/Math.max(.5,Math.cos(s.ab(y/2)))),K+=w*s.ah(Math.cos(O))/2,K-=s.ah(Math.max(1,N/R/e))/2,K}}const te=_e(9.314,3);function Pe(h,e){const r=(e.roundZoom?Math.round:Math.floor)(h.zoom+s.ah(h.tileSize/e.tileSize));return Math.max(0,r)}function be(h,e){const r=h.getCameraFrustum(),a=h.getClippingPlane(),l=h.screenPointToMercatorCoordinate(h.getCameraPoint()),p=s.$.fromLngLat(h.center,h.elevation);l.z=p.z+Math.cos(h.pitchInRadians)*h.cameraToCenterDistance/h.worldSize;const y=h.getCoveringTilesDetailsProvider(),w=y.allowVariableZoom(h,e),A=Pe(h,e),R=e.minzoom||0,D=e.maxzoom!==void 0?e.maxzoom:h.maxZoom,N=Math.min(Math.max(0,A),D),O=Math.pow(2,N),Z=[O*l.x,O*l.y,0],K=[O*p.x,O*p.y,0],ne=Math.hypot(p.x-l.x,p.y-l.y),ie=Math.abs(p.z-l.z),ae=Math.hypot(ne,ie),ue=ge=>({zoom:0,x:0,y:0,wrap:ge,fullyVisible:!1}),me=[],fe=[];if(h.renderWorldCopies&&y.allowWorldCopies())for(let ge=1;ge<=3;ge++)me.push(ue(-ge)),me.push(ue(ge));for(me.push(ue(0));me.length>0;){const ge=me.pop(),xe=ge.x,ye=ge.y;let Te=ge.fullyVisible;const Fe={x:xe,y:ye,z:ge.zoom},Le=y.getTileAABB(Fe,ge.wrap,h.elevation,e);if(!Te){const Xe=re(r,Le,a);if(Xe===0)continue;Te=Xe===2}const Be=y.distanceToTile2d(l.x,l.y,Fe,Le);let De=A;w&&(De=(e.calculateTileZoom||te)(h.zoom+s.ah(h.tileSize/e.tileSize),Be,ie,ae,h.fov)),De=(e.roundZoom?Math.round:Math.floor)(De),De=Math.max(0,De);const Ye=Math.min(De,D);if(ge.wrap=y.getWrap(p,Fe,ge.wrap),ge.zoom>=Ye){if(ge.zoom<R)continue;const Xe=N-ge.zoom,He=Z[0]-.5-(xe<<Xe),at=Z[1]-.5-(ye<<Xe),Mt=e.reparseOverscaled?Math.max(ge.zoom,De):ge.zoom;fe.push({tileID:new s.Y(ge.zoom===D?Mt:ge.zoom,ge.wrap,ge.zoom,xe,ye),distanceSq:s.ai([K[0]-.5-xe,K[1]-.5-ye]),tileDistanceToCamera:Math.sqrt(He*He+at*at)})}else for(let Xe=0;Xe<4;Xe++)me.push({zoom:ge.zoom+1,x:(xe<<1)+Xe%2,y:(ye<<1)+(Xe>>1),wrap:ge.wrap,fullyVisible:Te})}return fe.sort((ge,xe)=>ge.distanceSq-xe.distanceSq).map(ge=>ge.tileID)}class Ae extends s.E{constructor(e,r,a){super(),this.id=e,this.dispatcher=a,this.on("data",l=>this._dataHandler(l)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((l,p,y,w)=>{const A=new(bt(p.type))(l,p,y,w);if(A.id!==l)throw new Error(`Expected Source id to be ${l} instead of ${A.id}`);return A})(e,r,a,this),this._tiles={},this._cache=new li(0,l=>this._unloadTile(l)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new wi,this._didEmitContent=!1,this._updated=!1}onAdd(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._maxTileCacheZoomLevels=e?e._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(e)}onRemove(e){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(e)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const e in this._tiles){const r=this._tiles[e];if(r.state!=="loaded"&&r.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(e,r,a){return s._(this,void 0,void 0,function*(){try{yield this._source.loadTile(e),this._tileLoaded(e,r,a)}catch(l){e.state="errored",l.status!==404?this._source.fire(new s.k(l,{tile:e})):this.update(this.transform,this.terrain)}})}_unloadTile(e){this._source.unloadTile&&this._source.unloadTile(e)}_abortTile(e){this._source.abortTile&&this._source.abortTile(e),this._source.fire(new s.l("dataabort",{tile:e,coord:e.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const r in this._tiles){const a=this._tiles[r];a.upload(e),a.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(e=>e.tileID).sort(Ie).map(e=>e.key)}getRenderableIds(e){const r=[];for(const a in this._tiles)this._isIdRenderable(a,e)&&r.push(this._tiles[a]);return e?r.sort((a,l)=>{const p=a.tileID,y=l.tileID,w=new s.P(p.canonical.x,p.canonical.y)._rotate(-this.transform.bearingInRadians),A=new s.P(y.canonical.x,y.canonical.y)._rotate(-this.transform.bearingInRadians);return p.overscaledZ-y.overscaledZ||A.y-w.y||A.x-w.x}).map(a=>a.tileID.key):r.map(a=>a.tileID).sort(Ie).map(a=>a.key)}hasRenderableParent(e){const r=this.findLoadedParent(e,0);return!!r&&this._isIdRenderable(r.tileID.key)}_isIdRenderable(e,r){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(r||!this._tiles[e].holdingForFade())}reload(e){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const r in this._tiles)(e||this._tiles[r].state!=="errored")&&this._reloadTile(r,"reloading")}}_reloadTile(e,r){return s._(this,void 0,void 0,function*(){const a=this._tiles[e];a&&(a.state!=="loading"&&(a.state=r),yield this._loadTile(a,e,r))})}_tileLoaded(e,r,a){e.timeAdded=M.now(),a==="expired"&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(r,e),this.getSource().type==="raster-dem"&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),e.aborted||this._source.fire(new s.l("data",{dataType:"source",tile:e,coord:e.tileID}))}_backfillDEM(e){const r=this.getRenderableIds();for(let l=0;l<r.length;l++){const p=r[l];if(e.neighboringTiles&&e.neighboringTiles[p]){const y=this.getTileByID(p);a(e,y),a(y,e)}}function a(l,p){l.needsHillshadePrepare=!0,l.needsTerrainPrepare=!0;let y=p.tileID.canonical.x-l.tileID.canonical.x;const w=p.tileID.canonical.y-l.tileID.canonical.y,A=Math.pow(2,l.tileID.canonical.z),R=p.tileID.key;y===0&&w===0||Math.abs(w)>1||(Math.abs(y)>1&&(Math.abs(y+A)===1?y+=A:Math.abs(y-A)===1&&(y-=A)),p.dem&&l.dem&&(l.dem.backfillBorder(p.dem,y,w),l.neighboringTiles&&l.neighboringTiles[R]&&(l.neighboringTiles[R].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,r,a,l){for(const p in this._tiles){let y=this._tiles[p];if(l[p]||!y.hasData()||y.tileID.overscaledZ<=r||y.tileID.overscaledZ>a)continue;let w=y.tileID;for(;y&&y.tileID.overscaledZ>r+1;){const R=y.tileID.scaledTo(y.tileID.overscaledZ-1);y=this._tiles[R.key],y&&y.hasData()&&(w=R)}let A=w;for(;A.overscaledZ>r;)if(A=A.scaledTo(A.overscaledZ-1),e[A.key]||e[A.canonical.key]){l[w.key]=w;break}}}findLoadedParent(e,r){if(e.key in this._loadedParentTiles){const a=this._loadedParentTiles[e.key];return a&&a.tileID.overscaledZ>=r?a:null}for(let a=e.overscaledZ-1;a>=r;a--){const l=e.scaledTo(a),p=this._getLoadedTile(l);if(p)return p}}findLoadedSibling(e){return this._getLoadedTile(e)}_getLoadedTile(e){const r=this._tiles[e.key];return r&&r.hasData()?r:this._cache.getByKey(e.wrapped().key)}updateCacheSize(e){const r=Math.ceil(e.width/this._source.tileSize)+1,a=Math.ceil(e.height/this._source.tileSize)+1,l=Math.floor(r*a*(this._maxTileCacheZoomLevels===null?s.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),p=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,l):l;this._cache.setMaxSize(p)}handleWrapJump(e){const r=Math.round((e-(this._prevLng===void 0?e:this._prevLng))/360);if(this._prevLng=e,r){const a={};for(const l in this._tiles){const p=this._tiles[l];p.tileID=p.tileID.unwrapTo(p.tileID.wrap+r),a[p.tileID.key]=p}this._tiles=a;for(const l in this._timers)clearTimeout(this._timers[l]),delete this._timers[l];for(const l in this._tiles)this._setTileReloadTimer(l,this._tiles[l])}}_updateCoveredAndRetainedTiles(e,r,a,l,p,y){const w={},A={},R=Object.keys(e),D=M.now();for(const N of R){const O=e[N],Z=this._tiles[N];if(!Z||Z.fadeEndTime!==0&&Z.fadeEndTime<=D)continue;const K=this.findLoadedParent(O,r),ne=this.findLoadedSibling(O),ie=K||ne||null;ie&&(this._addTile(ie.tileID),w[ie.tileID.key]=ie.tileID),A[N]=O}this._retainLoadedChildren(A,l,a,e);for(const N in w)e[N]||(this._coveredTiles[N]=!0,e[N]=w[N]);if(y){const N={},O={};for(const Z of p)this._tiles[Z.key].hasData()?N[Z.key]=Z:O[Z.key]=Z;for(const Z in O){const K=O[Z].children(this._source.maxzoom);this._tiles[K[0].key]&&this._tiles[K[1].key]&&this._tiles[K[2].key]&&this._tiles[K[3].key]&&(N[K[0].key]=e[K[0].key]=K[0],N[K[1].key]=e[K[1].key]=K[1],N[K[2].key]=e[K[2].key]=K[2],N[K[3].key]=e[K[3].key]=K[3],delete O[Z])}for(const Z in O){const K=O[Z],ne=this.findLoadedParent(K,this._source.minzoom),ie=this.findLoadedSibling(K),ae=ne||ie||null;if(ae){N[ae.tileID.key]=e[ae.tileID.key]=ae.tileID;for(const ue in N)N[ue].isChildOf(ae.tileID)&&delete N[ue]}}for(const Z in this._tiles)N[Z]||(this._coveredTiles[Z]=!0)}}update(e,r){if(!this._sourceLoaded||this._paused)return;let a;this.transform=e,this.terrain=r,this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?a=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(D=>new s.Y(D.canonical.z,D.wrap,D.canonical.z,D.canonical.x,D.canonical.y)):(a=be(e,{tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:r,calculateTileZoom:this._source.calculateTileZoom}),this._source.hasTile&&(a=a.filter(D=>this._source.hasTile(D)))):a=[];const l=Pe(e,this._source),p=Math.max(l-Ae.maxOverzooming,this._source.minzoom),y=Math.max(l+Ae.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const D={};for(const N of a)if(N.canonical.z>this._source.minzoom){const O=N.scaledTo(N.canonical.z-1);D[O.key]=O;const Z=N.scaledTo(Math.max(this._source.minzoom,Math.min(N.canonical.z,5)));D[Z.key]=Z}a=a.concat(Object.values(D))}const w=a.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,w&&this.fire(new s.l("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const A=this._updateRetainedTiles(a,l);ke(this._source.type)&&this._updateCoveredAndRetainedTiles(A,p,y,l,a,r);for(const D in A)this._tiles[D].clearFadeHold();const R=s.aj(this._tiles,A);for(const D of R){const N=this._tiles[D];N.hasSymbolBuckets&&!N.holdingForFade()?N.setHoldDuration(this.map._fadeDuration):N.hasSymbolBuckets&&!N.symbolFadeFinished()||this._removeTile(D)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(e)}_updateRetainedTiles(e,r){var a;const l={},p={},y=Math.max(r-Ae.maxOverzooming,this._source.minzoom),w=Math.max(r+Ae.maxUnderzooming,this._source.minzoom),A={};for(const R of e){const D=this._addTile(R);l[R.key]=R,D.hasData()||r<this._source.maxzoom&&(A[R.key]=R)}this._retainLoadedChildren(A,r,w,l);for(const R of e){let D=this._tiles[R.key];if(D.hasData())continue;if(r+1>this._source.maxzoom){const O=R.children(this._source.maxzoom)[0],Z=this.getTile(O);if(Z&&Z.hasData()){l[O.key]=O;continue}}else{const O=R.children(this._source.maxzoom);if(l[O[0].key]&&l[O[1].key]&&l[O[2].key]&&l[O[3].key])continue}let N=D.wasRequested();for(let O=R.overscaledZ-1;O>=y;--O){const Z=R.scaledTo(O);if(p[Z.key])break;if(p[Z.key]=!0,D=this.getTile(Z),!D&&N&&(D=this._addTile(Z)),D){const K=D.hasData();if((K||!(!((a=this.map)===null||a===void 0)&&a.cancelPendingTileRequestsWhileZooming)||N)&&(l[Z.key]=Z),N=D.wasRequested(),K)break}}}return l}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const r=[];let a,l=this._tiles[e].tileID;for(;l.overscaledZ>0;){if(l.key in this._loadedParentTiles){a=this._loadedParentTiles[l.key];break}r.push(l.key);const p=l.scaledTo(l.overscaledZ-1);if(a=this._getLoadedTile(p),a)break;l=p}for(const p of r)this._loadedParentTiles[p]=a}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const e in this._tiles){const r=this._tiles[e].tileID,a=this._getLoadedTile(r);this._loadedSiblingTiles[r.key]=a}}_addTile(e){let r=this._tiles[e.key];if(r)return r;r=this._cache.getAndRemove(e),r&&(this._setTileReloadTimer(e.key,r),r.tileID=e,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,r)));const a=r;return r||(r=new qr(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(r,e.key,r.state)),r.uses++,this._tiles[e.key]=r,a||this._source.fire(new s.l("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r}_setTileReloadTimer(e,r){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const a=r.getExpiryTimeout();a&&(this._timers[e]=setTimeout(()=>{this._reloadTile(e,"expired"),delete this._timers[e]},a))}refreshTiles(e){for(const r in this._tiles)this._isIdRenderable(r)&&e.some(a=>a.equals(this._tiles[r].tileID.canonical))&&this._reloadTile(r,"expired")}_removeTile(e){const r=this._tiles[e];r&&(r.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),r.uses>0||(r.hasData()&&r.state!=="reloading"?this._cache.add(r.tileID,r,r.getExpiryTimeout()):(r.aborted=!0,this._abortTile(r),this._unloadTile(r))))}_dataHandler(e){const r=e.sourceDataType;e.dataType==="source"&&r==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&e.dataType==="source"&&r==="content"&&(this.reload(e.sourceDataChanged),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(e);this._cache.reset()}tilesIn(e,r,a){const l=[],p=this.transform;if(!p)return l;const y=a?p.getCameraQueryGeometry(e):e,w=e.map(K=>p.screenPointToMercatorCoordinate(K,this.terrain)),A=y.map(K=>p.screenPointToMercatorCoordinate(K,this.terrain)),R=this.getIds();let D=1/0,N=1/0,O=-1/0,Z=-1/0;for(const K of A)D=Math.min(D,K.x),N=Math.min(N,K.y),O=Math.max(O,K.x),Z=Math.max(Z,K.y);for(let K=0;K<R.length;K++){const ne=this._tiles[R[K]];if(ne.holdingForFade())continue;const ie=p.getCoveringTilesDetailsProvider().allowWorldCopies()?ne.tileID:ne.tileID.unwrapTo(0),ae=Math.pow(2,p.zoom-ne.tileID.overscaledZ),ue=r*ne.queryPadding*s.Z/ne.tileSize/ae,me=[ie.getTilePoint(new s.$(D,N)),ie.getTilePoint(new s.$(O,Z))];if(me[0].x-ue<s.Z&&me[0].y-ue<s.Z&&me[1].x+ue>=0&&me[1].y+ue>=0){const fe=w.map(xe=>ie.getTilePoint(xe)),ge=A.map(xe=>ie.getTilePoint(xe));l.push({tile:ne,tileID:ie,queryGeometry:fe,cameraQueryGeometry:ge,scale:ae})}}return l}getVisibleCoordinates(e){const r=this.getRenderableIds(e).map(a=>this._tiles[a].tileID);return this.transform&&this.transform.populateCache(r),r}hasTransition(){if(this._source.hasTransition())return!0;if(ke(this._source.type)){const e=M.now();for(const r in this._tiles)if(this._tiles[r].fadeEndTime>=e)return!0}return!1}setFeatureState(e,r,a){this._state.updateState(e=e||"_geojsonTileLayer",r,a)}removeFeatureState(e,r,a){this._state.removeFeatureState(e=e||"_geojsonTileLayer",r,a)}getFeatureState(e,r){return this._state.getState(e=e||"_geojsonTileLayer",r)}setDependencies(e,r,a){const l=this._tiles[e];l&&l.setDependencies(r,a)}reloadTilesForDependencies(e,r){for(const a in this._tiles)this._tiles[a].hasDependency(e,r)&&this._reloadTile(a,"reloading");this._cache.filter(a=>!a.hasDependency(e,r))}}function Ie(h,e){const r=Math.abs(2*h.wrap)-+(h.wrap<0),a=Math.abs(2*e.wrap)-+(e.wrap<0);return h.overscaledZ-e.overscaledZ||a-r||e.canonical.y-h.canonical.y||e.canonical.x-h.canonical.x}function ke(h){return h==="raster"||h==="image"||h==="video"}Ae.maxOverzooming=10,Ae.maxUnderzooming=3;class Ue{constructor(e,r){this.reset(e,r)}reset(e,r){this.points=e||[],this._distances=[0];for(let a=1;a<this.points.length;a++)this._distances[a]=this._distances[a-1]+this.points[a].dist(this.points[a-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(r||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(e){if(this.points.length===1)return this.points[0];e=s.ae(e,0,1);let r=1,a=this._distances[r];const l=e*this.paddedLength+this.padding;for(;a<l&&r<this._distances.length;)a=this._distances[++r];const p=r-1,y=this._distances[p],w=a-y,A=w>0?(l-y)/w:0;return this.points[p].mult(1-A).add(this.points[r].mult(A))}}function $e(h,e){let r=!0;return h==="always"||h!=="never"&&e!=="never"||(r=!1),r}class rt{constructor(e,r,a){const l=this.boxCells=[],p=this.circleCells=[];this.xCellCount=Math.ceil(e/a),this.yCellCount=Math.ceil(r/a);for(let y=0;y<this.xCellCount*this.yCellCount;y++)l.push([]),p.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=e,this.height=r,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/r,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(e,r,a,l,p){this._forEachCell(r,a,l,p,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(r),this.bboxes.push(a),this.bboxes.push(l),this.bboxes.push(p)}insertCircle(e,r,a,l){this._forEachCell(r-l,a-l,r+l,a+l,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(r),this.circles.push(a),this.circles.push(l)}_insertBoxCell(e,r,a,l,p,y){this.boxCells[p].push(y)}_insertCircleCell(e,r,a,l,p,y){this.circleCells[p].push(y)}_query(e,r,a,l,p,y,w){if(a<0||e>this.width||l<0||r>this.height)return[];const A=[];if(e<=0&&r<=0&&this.width<=a&&this.height<=l){if(p)return[{key:null,x1:e,y1:r,x2:a,y2:l}];for(let R=0;R<this.boxKeys.length;R++)A.push({key:this.boxKeys[R],x1:this.bboxes[4*R],y1:this.bboxes[4*R+1],x2:this.bboxes[4*R+2],y2:this.bboxes[4*R+3]});for(let R=0;R<this.circleKeys.length;R++){const D=this.circles[3*R],N=this.circles[3*R+1],O=this.circles[3*R+2];A.push({key:this.circleKeys[R],x1:D-O,y1:N-O,x2:D+O,y2:N+O})}}else this._forEachCell(e,r,a,l,this._queryCell,A,{hitTest:p,overlapMode:y,seenUids:{box:{},circle:{}}},w);return A}query(e,r,a,l){return this._query(e,r,a,l,!1,null)}hitTest(e,r,a,l,p,y){return this._query(e,r,a,l,!0,p,y).length>0}hitTestCircle(e,r,a,l,p){const y=e-a,w=e+a,A=r-a,R=r+a;if(w<0||y>this.width||R<0||A>this.height)return!1;const D=[];return this._forEachCell(y,A,w,R,this._queryCellCircle,D,{hitTest:!0,overlapMode:l,circle:{x:e,y:r,radius:a},seenUids:{box:{},circle:{}}},p),D.length>0}_queryCell(e,r,a,l,p,y,w,A){const{seenUids:R,hitTest:D,overlapMode:N}=w,O=this.boxCells[p];if(O!==null){const K=this.bboxes;for(const ne of O)if(!R.box[ne]){R.box[ne]=!0;const ie=4*ne,ae=this.boxKeys[ne];if(e<=K[ie+2]&&r<=K[ie+3]&&a>=K[ie+0]&&l>=K[ie+1]&&(!A||A(ae))&&(!D||!$e(N,ae.overlapMode))&&(y.push({key:ae,x1:K[ie],y1:K[ie+1],x2:K[ie+2],y2:K[ie+3]}),D))return!0}}const Z=this.circleCells[p];if(Z!==null){const K=this.circles;for(const ne of Z)if(!R.circle[ne]){R.circle[ne]=!0;const ie=3*ne,ae=this.circleKeys[ne];if(this._circleAndRectCollide(K[ie],K[ie+1],K[ie+2],e,r,a,l)&&(!A||A(ae))&&(!D||!$e(N,ae.overlapMode))){const ue=K[ie],me=K[ie+1],fe=K[ie+2];if(y.push({key:ae,x1:ue-fe,y1:me-fe,x2:ue+fe,y2:me+fe}),D)return!0}}}return!1}_queryCellCircle(e,r,a,l,p,y,w,A){const{circle:R,seenUids:D,overlapMode:N}=w,O=this.boxCells[p];if(O!==null){const K=this.bboxes;for(const ne of O)if(!D.box[ne]){D.box[ne]=!0;const ie=4*ne,ae=this.boxKeys[ne];if(this._circleAndRectCollide(R.x,R.y,R.radius,K[ie+0],K[ie+1],K[ie+2],K[ie+3])&&(!A||A(ae))&&!$e(N,ae.overlapMode))return y.push(!0),!0}}const Z=this.circleCells[p];if(Z!==null){const K=this.circles;for(const ne of Z)if(!D.circle[ne]){D.circle[ne]=!0;const ie=3*ne,ae=this.circleKeys[ne];if(this._circlesCollide(K[ie],K[ie+1],K[ie+2],R.x,R.y,R.radius)&&(!A||A(ae))&&!$e(N,ae.overlapMode))return y.push(!0),!0}}}_forEachCell(e,r,a,l,p,y,w,A){const R=this._convertToXCellCoord(e),D=this._convertToYCellCoord(r),N=this._convertToXCellCoord(a),O=this._convertToYCellCoord(l);for(let Z=R;Z<=N;Z++)for(let K=D;K<=O;K++)if(p.call(this,e,r,a,l,this.xCellCount*K+Z,y,w,A))return}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,r,a,l,p,y){const w=l-e,A=p-r,R=a+y;return R*R>w*w+A*A}_circleAndRectCollide(e,r,a,l,p,y,w){const A=(y-l)/2,R=Math.abs(e-(l+A));if(R>A+a)return!1;const D=(w-p)/2,N=Math.abs(r-(p+D));if(N>D+a)return!1;if(R<=A||N<=D)return!0;const O=R-A,Z=N-D;return O*O+Z*Z<=a*a}}function ft(h,e,r){const a=s.K();if(!h){const{vecSouth:N,vecEast:O}=St(e),Z=P();Z[0]=O[0],Z[1]=O[1],Z[2]=N[0],Z[3]=N[1],l=Z,(D=(y=(p=Z)[0])*(R=p[3])-(A=p[2])*(w=p[1]))&&(l[0]=R*(D=1/D),l[1]=-w*D,l[2]=-A*D,l[3]=y*D),a[0]=Z[0],a[1]=Z[1],a[4]=Z[2],a[5]=Z[3]}var l,p,y,w,A,R,D;return s.M(a,a,[1/r,1/r,1]),a}function Tt(h,e,r,a){if(h){const l=s.K();if(!e){const{vecSouth:p,vecEast:y}=St(r);l[0]=y[0],l[1]=y[1],l[4]=p[0],l[5]=p[1]}return s.M(l,l,[a,a,1]),l}return r.pixelsToClipSpaceMatrix}function St(h){const e=Math.cos(h.rollInRadians),r=Math.sin(h.rollInRadians),a=Math.cos(h.pitchInRadians),l=Math.cos(h.bearingInRadians),p=Math.sin(h.bearingInRadians),y=s.ao();y[0]=-l*a*r-p*e,y[1]=-p*a*r+l*e;const w=s.ap(y);w<1e-9?s.aq(y):s.ar(y,y,1/w);const A=s.ao();A[0]=l*a*e-p*r,A[1]=p*a*e+l*r;const R=s.ap(A);return R<1e-9?s.aq(A):s.ar(A,A,1/R),{vecEast:A,vecSouth:y}}function Ve(h,e,r,a){let l;a?(l=[h,e,a(h,e),1],s.at(l,l,r)):(l=[h,e,0,1],On(l,l,r));const p=l[3];return{point:new s.P(l[0]/p,l[1]/p),signedDistanceFromCamera:p,isOccluded:!1}}function Kt(h,e){return .5+h/e*.5}function Ft(h,e){return h.x>=-e[0]&&h.x<=e[0]&&h.y>=-e[1]&&h.y<=e[1]}function Wt(h,e,r,a,l,p,y,w,A,R,D,N,O){const Z=r?h.textSizeData:h.iconSizeData,K=s.ak(Z,e.transform.zoom),ne=[256/e.width*2+1,256/e.height*2+1],ie=r?h.text.dynamicLayoutVertexArray:h.icon.dynamicLayoutVertexArray;ie.clear();const ae=h.lineVertexArray,ue=r?h.text.placedSymbolArray:h.icon.placedSymbolArray,me=e.transform.width/e.transform.height;let fe=!1;for(let ge=0;ge<ue.length;ge++){const xe=ue.get(ge);if(xe.hidden||xe.writingMode===s.al.vertical&&!fe){hn(xe.numGlyphs,ie);continue}fe=!1;const ye=new s.P(xe.anchorX,xe.anchorY),Te={getElevation:O,pitchedLabelPlaneMatrix:a,lineVertexArray:ae,pitchWithMap:p,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:e.transform,tileAnchorPoint:ye,unwrappedTileID:A,width:R,height:D,translation:N},Fe=Pt(xe.anchorX,xe.anchorY,Te);if(!Ft(Fe.point,ne)){hn(xe.numGlyphs,ie);continue}const Le=Kt(e.transform.cameraToCenterDistance,Fe.signedDistanceFromCamera),Be=s.am(Z,K,xe),De=p?Be*e.transform.getPitchedTextCorrection(xe.anchorX,xe.anchorY,A)/Le:Be*Le,Ye=gt({projectionContext:Te,pitchedLabelPlaneMatrixInverse:l,symbol:xe,fontSize:De,flip:!1,keepUpright:y,glyphOffsetArray:h.glyphOffsetArray,dynamicLayoutVertexArray:ie,aspectRatio:me,rotateToLine:w});fe=Ye.useVertical,(Ye.notEnoughRoom||fe||Ye.needsFlipping&&gt({projectionContext:Te,pitchedLabelPlaneMatrixInverse:l,symbol:xe,fontSize:De,flip:!0,keepUpright:y,glyphOffsetArray:h.glyphOffsetArray,dynamicLayoutVertexArray:ie,aspectRatio:me,rotateToLine:w}).notEnoughRoom)&&hn(xe.numGlyphs,ie)}r?h.text.dynamicLayoutVertexBuffer.updateData(ie):h.icon.dynamicLayoutVertexBuffer.updateData(ie)}function wt(h,e,r,a,l,p,y,w){const A=p.glyphStartIndex+p.numGlyphs,R=p.lineStartIndex,D=p.lineStartIndex+p.lineLength,N=e.getoffsetX(p.glyphStartIndex),O=e.getoffsetX(A-1),Z=Fn(h*N,r,a,l,p.segment,R,D,w,y);if(!Z)return null;const K=Fn(h*O,r,a,l,p.segment,R,D,w,y);return K?w.projectionCache.anyProjectionOccluded?null:{first:Z,last:K}:null}function qe(h,e,r,a){return h===s.al.horizontal&&Math.abs(r.y-e.y)>Math.abs(r.x-e.x)*a?{useVertical:!0}:(h===s.al.vertical?e.y<r.y:e.x>r.x)?{needsFlipping:!0}:null}function gt(h){const{projectionContext:e,pitchedLabelPlaneMatrixInverse:r,symbol:a,fontSize:l,flip:p,keepUpright:y,glyphOffsetArray:w,dynamicLayoutVertexArray:A,aspectRatio:R,rotateToLine:D}=h,N=l/24,O=a.lineOffsetX*N,Z=a.lineOffsetY*N;let K;if(a.numGlyphs>1){const ne=a.glyphStartIndex+a.numGlyphs,ie=a.lineStartIndex,ae=a.lineStartIndex+a.lineLength,ue=wt(N,w,O,Z,p,a,D,e);if(!ue)return{notEnoughRoom:!0};const me=Si(ue.first.point.x,ue.first.point.y,e,r),fe=Si(ue.last.point.x,ue.last.point.y,e,r);if(y&&!p){const ge=qe(a.writingMode,me,fe,R);if(ge)return ge}K=[ue.first];for(let ge=a.glyphStartIndex+1;ge<ne-1;ge++)K.push(Fn(N*w.getoffsetX(ge),O,Z,p,a.segment,ie,ae,e,D));K.push(ue.last)}else{if(y&&!p){const ie=xr(e.tileAnchorPoint.x,e.tileAnchorPoint.y,e).point,ae=a.lineStartIndex+a.segment+1,ue=new s.P(e.lineVertexArray.getx(ae),e.lineVertexArray.gety(ae)),me=xr(ue.x,ue.y,e),fe=me.signedDistanceFromCamera>0?me.point:Et(e.tileAnchorPoint,ue,ie,1,e),ge=Si(ie.x,ie.y,e,r),xe=Si(fe.x,fe.y,e,r),ye=qe(a.writingMode,ge,xe,R);if(ye)return ye}const ne=Fn(N*w.getoffsetX(a.glyphStartIndex),O,Z,p,a.segment,a.lineStartIndex,a.lineStartIndex+a.lineLength,e,D);if(!ne||e.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};K=[ne]}for(const ne of K)s.as(A,ne.point,ne.angle);return{}}function Et(h,e,r,a,l){const p=h.add(h.sub(e)._unit()),y=xr(p.x,p.y,l).point,w=r.sub(y);return r.add(w._mult(a/w.mag()))}function vr(h,e,r){const a=e.projectionCache;if(a.projections[h])return a.projections[h];const l=new s.P(e.lineVertexArray.getx(h),e.lineVertexArray.gety(h)),p=xr(l.x,l.y,e);if(p.signedDistanceFromCamera>0)return a.projections[h]=p.point,a.anyProjectionOccluded=a.anyProjectionOccluded||p.isOccluded,p.point;const y=h-r.direction;return Et(r.distanceFromAnchor===0?e.tileAnchorPoint:new s.P(e.lineVertexArray.getx(y),e.lineVertexArray.gety(y)),l,r.previousVertex,r.absOffsetX-r.distanceFromAnchor+1,e)}function xr(h,e,r){const a=h+r.translation[0],l=e+r.translation[1];let p;return r.pitchWithMap?(p=Ve(a,l,r.pitchedLabelPlaneMatrix,r.getElevation),p.isOccluded=!1):(p=r.transform.projectTileCoordinates(a,l,r.unwrappedTileID,r.getElevation),p.point.x=(.5*p.point.x+.5)*r.width,p.point.y=(.5*-p.point.y+.5)*r.height),p}function Si(h,e,r,a){if(r.pitchWithMap){const l=[h,e,0,1];return s.at(l,l,a),r.transform.projectTileCoordinates(l[0]/l[3],l[1]/l[3],r.unwrappedTileID,r.getElevation).point}return{x:h/r.width*2-1,y:e/r.height*2-1}}function Pt(h,e,r){return r.transform.projectTileCoordinates(h,e,r.unwrappedTileID,r.getElevation)}function ls(h,e,r){return h._unit()._perp()._mult(e*r)}function zs(h,e,r,a,l,p,y,w,A){if(w.projectionCache.offsets[h])return w.projectionCache.offsets[h];const R=r.add(e);if(h+A.direction<a||h+A.direction>=l)return w.projectionCache.offsets[h]=R,R;const D=vr(h+A.direction,w,A),N=ls(D.sub(r),y,A.direction),O=r.add(N),Z=D.add(N);return w.projectionCache.offsets[h]=s.au(p,R,O,Z)||R,w.projectionCache.offsets[h]}function Fn(h,e,r,a,l,p,y,w,A){const R=a?h-e:h+e;let D=R>0?1:-1,N=0;a&&(D*=-1,N=Math.PI),D<0&&(N+=Math.PI);let O,Z=D>0?p+l:p+l+1;w.projectionCache.cachedAnchorPoint?O=w.projectionCache.cachedAnchorPoint:(O=xr(w.tileAnchorPoint.x,w.tileAnchorPoint.y,w).point,w.projectionCache.cachedAnchorPoint=O);let K,ne,ie=O,ae=O,ue=0,me=0;const fe=Math.abs(R),ge=[];let xe;for(;ue+me<=fe;){if(Z+=D,Z<p||Z>=y)return null;ue+=me,ae=ie,ne=K;const Fe={absOffsetX:fe,direction:D,distanceFromAnchor:ue,previousVertex:ae};if(ie=vr(Z,w,Fe),r===0)ge.push(ae),xe=ie.sub(ae);else{let Le;const Be=ie.sub(ae);Le=Be.mag()===0?ls(vr(Z+D,w,Fe).sub(ie),r,D):ls(Be,r,D),ne||(ne=ae.add(Le)),K=zs(Z,Le,ie,p,y,ne,r,w,Fe),ge.push(ne),xe=K.sub(ne)}me=xe.mag()}const ye=xe._mult((fe-ue)/me)._add(ne||ae),Te=N+Math.atan2(ie.y-ae.y,ie.x-ae.x);return ge.push(ye),{point:ye,angle:A?Te:0,path:ge}}const Fs=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function hn(h,e){for(let r=0;r<h;r++){const a=e.length;e.resize(a+4),e.float32.set(Fs,3*a)}}function On(h,e,r){const a=e[0],l=e[1];return h[0]=r[0]*a+r[4]*l+r[12],h[1]=r[1]*a+r[5]*l+r[13],h[3]=r[3]*a+r[7]*l+r[15],h}const Pr=100;class Ii{constructor(e,r=new rt(e.width+200,e.height+200,25),a=new rt(e.width+200,e.height+200,25)){this.transform=e,this.grid=r,this.ignoredGrid=a,this.pitchFactor=Math.cos(e.pitch*Math.PI/180)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+Pr,this.screenBottomBoundary=e.height+Pr,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(e,r,a,l,p,y,w,A,R,D,N,O){const Z=this.projectAndGetPerspectiveRatio(e.anchorPointX+A[0],e.anchorPointY+A[1],p,D,O),K=a*Z.perspectiveRatio;let ne;if(y||w)ne=this._projectCollisionBox(e,K,l,p,y,w,A,Z,D,N,O);else{const xe=Z.x+(N?N.x*K:0),ye=Z.y+(N?N.y*K:0);ne={allPointsOccluded:!1,box:[xe+e.x1*K,ye+e.y1*K,xe+e.x2*K,ye+e.y2*K]}}const[ie,ae,ue,me]=ne.box,fe=y?ne.allPointsOccluded:Z.isOccluded;let ge=fe;return ge||(ge=Z.perspectiveRatio<this.perspectiveRatioCutoff),ge||(ge=!this.isInsideGrid(ie,ae,ue,me)),ge||r!=="always"&&this.grid.hitTest(ie,ae,ue,me,r,R)?{box:[ie,ae,ue,me],placeable:!1,offscreen:!1,occluded:fe}:{box:[ie,ae,ue,me],placeable:!0,offscreen:this.isOffscreen(ie,ae,ue,me),occluded:fe}}placeCollisionCircles(e,r,a,l,p,y,w,A,R,D,N,O,Z,K){const ne=[],ie=new s.P(r.anchorX,r.anchorY),ae=this.getPerspectiveRatio(ie.x,ie.y,y,K),ue=(R?p*this.transform.getPitchedTextCorrection(r.anchorX,r.anchorY,y)/ae:p*ae)/s.ay,me={getElevation:K,pitchedLabelPlaneMatrix:w,lineVertexArray:a,pitchWithMap:R,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:this.transform,tileAnchorPoint:ie,unwrappedTileID:y,width:this.transform.width,height:this.transform.height,translation:Z},fe=wt(ue,l,r.lineOffsetX*ue,r.lineOffsetY*ue,!1,r,!1,me);let ge=!1,xe=!1,ye=!0;if(fe){const Te=.5*N*ae+O,Fe=new s.P(-100,-100),Le=new s.P(this.screenRightBoundary,this.screenBottomBoundary),Be=new Ue,De=fe.first,Ye=fe.last;let Xe=[];for(let Mt=De.path.length-1;Mt>=1;Mt--)Xe.push(De.path[Mt]);for(let Mt=1;Mt<Ye.path.length;Mt++)Xe.push(Ye.path[Mt]);const He=2.5*Te;if(R){const Mt=this.projectPathToScreenSpace(Xe,me);Xe=Mt.some(qt=>qt.signedDistanceFromCamera<=0)?[]:Mt.map(qt=>qt.point)}let at=[];if(Xe.length>0){const Mt=Xe[0].clone(),qt=Xe[0].clone();for(let mr=1;mr<Xe.length;mr++)Mt.x=Math.min(Mt.x,Xe[mr].x),Mt.y=Math.min(Mt.y,Xe[mr].y),qt.x=Math.max(qt.x,Xe[mr].x),qt.y=Math.max(qt.y,Xe[mr].y);at=Mt.x>=Fe.x&&qt.x<=Le.x&&Mt.y>=Fe.y&&qt.y<=Le.y?[Xe]:qt.x<Fe.x||Mt.x>Le.x||qt.y<Fe.y||Mt.y>Le.y?[]:s.av([Xe],Fe.x,Fe.y,Le.x,Le.y)}for(const Mt of at){Be.reset(Mt,.25*Te);let qt=0;qt=Be.length<=.5*Te?1:Math.ceil(Be.paddedLength/He)+1;for(let mr=0;mr<qt;mr++){const tr=mr/Math.max(qt-1,1),gr=Be.lerp(tr),yr=gr.x+Pr,sr=gr.y+Pr;ne.push(yr,sr,Te,0);const Ht=yr-Te,jr=sr-Te,Xr=yr+Te,ii=sr+Te;if(ye=ye&&this.isOffscreen(Ht,jr,Xr,ii),xe=xe||this.isInsideGrid(Ht,jr,Xr,ii),e!=="always"&&this.grid.hitTestCircle(yr,sr,Te,e,D)&&(ge=!0,!A))return{circles:[],offscreen:!1,collisionDetected:ge}}}}return{circles:!A&&ge||!xe||ae<this.perspectiveRatioCutoff?[]:ne,offscreen:ye,collisionDetected:ge}}projectPathToScreenSpace(e,r){const a=function(l,p){const y=s.K();return s.an(y,p.pitchedLabelPlaneMatrix),l.map(w=>{const A=Ve(w.x,w.y,y,p.getElevation),R=p.transform.projectTileCoordinates(A.point.x,A.point.y,p.unwrappedTileID,p.getElevation);return R.point.x=(.5*R.point.x+.5)*p.width,R.point.y=(.5*-R.point.y+.5)*p.height,R})}(e,r);return function(l){let p=0,y=0,w=0,A=0;for(let R=0;R<l.length;R++)l[R].isOccluded?(w=R+1,A=0):(A++,A>y&&(y=A,p=w));return l.slice(p,p+y)}(a)}queryRenderedSymbols(e){if(e.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const r=[];let a=1/0,l=1/0,p=-1/0,y=-1/0;for(const D of e){const N=new s.P(D.x+Pr,D.y+Pr);a=Math.min(a,N.x),l=Math.min(l,N.y),p=Math.max(p,N.x),y=Math.max(y,N.y),r.push(N)}const w=this.grid.query(a,l,p,y).concat(this.ignoredGrid.query(a,l,p,y)),A={},R={};for(const D of w){const N=D.key;if(A[N.bucketInstanceId]===void 0&&(A[N.bucketInstanceId]={}),A[N.bucketInstanceId][N.featureIndex])continue;const O=[new s.P(D.x1,D.y1),new s.P(D.x2,D.y1),new s.P(D.x2,D.y2),new s.P(D.x1,D.y2)];s.aw(r,O)&&(A[N.bucketInstanceId][N.featureIndex]=!0,R[N.bucketInstanceId]===void 0&&(R[N.bucketInstanceId]=[]),R[N.bucketInstanceId].push(N.featureIndex))}return R}insertCollisionBox(e,r,a,l,p,y){(a?this.ignoredGrid:this.grid).insert({bucketInstanceId:l,featureIndex:p,collisionGroupID:y,overlapMode:r},e[0],e[1],e[2],e[3])}insertCollisionCircles(e,r,a,l,p,y){const w=a?this.ignoredGrid:this.grid,A={bucketInstanceId:l,featureIndex:p,collisionGroupID:y,overlapMode:r};for(let R=0;R<e.length;R+=4)w.insertCircle(A,e[R],e[R+1],e[R+2])}projectAndGetPerspectiveRatio(e,r,a,l,p){if(p){let y;l?(y=[e,r,l(e,r),1],s.at(y,y,p)):(y=[e,r,0,1],On(y,y,p));const w=y[3];return{x:(y[0]/w+1)/2*this.transform.width+Pr,y:(-y[1]/w+1)/2*this.transform.height+Pr,perspectiveRatio:.5+this.transform.cameraToCenterDistance/w*.5,isOccluded:!1,signedDistanceFromCamera:w}}{const y=this.transform.projectTileCoordinates(e,r,a,l);return{x:(y.point.x+1)/2*this.transform.width+Pr,y:(1-y.point.y)/2*this.transform.height+Pr,perspectiveRatio:.5+this.transform.cameraToCenterDistance/y.signedDistanceFromCamera*.5,isOccluded:y.isOccluded,signedDistanceFromCamera:y.signedDistanceFromCamera}}}getPerspectiveRatio(e,r,a,l){const p=this.transform.projectTileCoordinates(e,r,a,l);return .5+this.transform.cameraToCenterDistance/p.signedDistanceFromCamera*.5}isOffscreen(e,r,a,l){return a<Pr||e>=this.screenRightBoundary||l<Pr||r>this.screenBottomBoundary}isInsideGrid(e,r,a,l){return a>=0&&e<this.gridRightBoundary&&l>=0&&r<this.gridBottomBoundary}getViewportMatrix(){const e=s.ad([]);return s.L(e,e,[-100,-100,0]),e}_projectCollisionBox(e,r,a,l,p,y,w,A,R,D,N){let O=1,Z=0,K=0,ne=1;const ie=e.anchorPointX+w[0],ae=e.anchorPointY+w[1];if(y&&!p){const Xe=this.projectAndGetPerspectiveRatio(ie+1,ae,l,R,N),He=Xe.x-A.x,at=Math.atan((Xe.y-A.y)/He)+(He<0?Math.PI:0),Mt=Math.sin(at),qt=Math.cos(at);O=qt,Z=Mt,K=-Mt,ne=qt}else if(!y&&p){const Xe=St(this.transform);O=Xe.vecEast[0],Z=Xe.vecEast[1],K=Xe.vecSouth[0],ne=Xe.vecSouth[1]}let ue=A.x,me=A.y,fe=r;p&&(ue=ie,me=ae,fe=Math.pow(2,-(this.transform.zoom-a.overscaledZ)),fe*=this.transform.getPitchedTextCorrection(ie,ae,l),D||(fe*=s.ae(.5+A.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))),D&&(ue+=O*D.x*fe+K*D.y*fe,me+=Z*D.x*fe+ne*D.y*fe);const ge=e.x1*fe,xe=e.x2*fe,ye=(ge+xe)/2,Te=e.y1*fe,Fe=e.y2*fe,Le=(Te+Fe)/2,Be=[{offsetX:ge,offsetY:Te},{offsetX:ye,offsetY:Te},{offsetX:xe,offsetY:Te},{offsetX:xe,offsetY:Le},{offsetX:xe,offsetY:Fe},{offsetX:ye,offsetY:Fe},{offsetX:ge,offsetY:Fe},{offsetX:ge,offsetY:Le}];let De=[];for(const{offsetX:Xe,offsetY:He}of Be)De.push(new s.P(ue+O*Xe+K*He,me+Z*Xe+ne*He));let Ye=!1;if(p){const Xe=De.map(He=>this.projectAndGetPerspectiveRatio(He.x,He.y,l,R,N));Ye=Xe.some(He=>!He.isOccluded),De=Xe.map(He=>new s.P(He.x,He.y))}else Ye=!0;return{box:s.ax(De),allPointsOccluded:!Ye}}}class pr{constructor(e,r,a,l){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?r:-r))):l&&a?1:0,this.placed=a}isHidden(){return this.opacity===0&&!this.placed}}class Os{constructor(e,r,a,l,p){this.text=new pr(e?e.text:null,r,a,p),this.icon=new pr(e?e.icon:null,r,l,p)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class cs{constructor(e,r,a){this.text=e,this.icon=r,this.skipFade=a}}class Fa{constructor(e,r,a,l,p){this.bucketInstanceId=e,this.featureIndex=r,this.sourceLayerIndex=a,this.bucketIndex=l,this.tileID=p}}class Nn{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){const r=++this.maxGroupID;this.collisionGroups[e]={ID:r,predicate:a=>a.collisionGroupID===r}}return this.collisionGroups[e]}}function pn(h,e,r,a,l){const{horizontalAlign:p,verticalAlign:y}=s.aE(h);return new s.P(-(p-.5)*e+a[0]*l,-(y-.5)*r+a[1]*l)}class lc{constructor(e,r,a,l,p){this.transform=e.clone(),this.terrain=r,this.collisionIndex=new Ii(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=a,this.retainedQueryData={},this.collisionGroups=new Nn(l),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=p,p&&(p.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(e){const r=this.terrain;return r?(a,l)=>r.getElevation(e,a,l):null}getBucketParts(e,r,a,l){const p=a.getBucket(r),y=a.latestFeatureIndex;if(!p||!y||r.id!==p.layerIds[0])return;const w=a.collisionBoxArray,A=p.layers[0].layout,R=p.layers[0].paint,D=Math.pow(2,this.transform.zoom-a.tileID.overscaledZ),N=a.tileSize/s.Z,O=a.tileID.toUnwrapped(),Z=A.get("text-rotation-alignment")==="map",K=s.az(a,1,this.transform.zoom),ne=s.aA(this.collisionIndex.transform,a,R.get("text-translate"),R.get("text-translate-anchor")),ie=s.aA(this.collisionIndex.transform,a,R.get("icon-translate"),R.get("icon-translate-anchor")),ae=ft(Z,this.transform,K);this.retainedQueryData[p.bucketInstanceId]=new Fa(p.bucketInstanceId,y,p.sourceLayerIndex,p.index,a.tileID);const ue={bucket:p,layout:A,translationText:ne,translationIcon:ie,unwrappedTileID:O,pitchedLabelPlaneMatrix:ae,scale:D,textPixelRatio:N,holdingForFade:a.holdingForFade(),collisionBoxArray:w,partiallyEvaluatedTextSize:s.ak(p.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(p.sourceID)};if(l)for(const me of p.sortKeyRanges){const{sortKey:fe,symbolInstanceStart:ge,symbolInstanceEnd:xe}=me;e.push({sortKey:fe,symbolInstanceStart:ge,symbolInstanceEnd:xe,parameters:ue})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:p.symbolInstances.length,parameters:ue})}attemptAnchorPlacement(e,r,a,l,p,y,w,A,R,D,N,O,Z,K,ne,ie,ae,ue,me,fe){const ge=s.aB[e.textAnchor],xe=[e.textOffset0,e.textOffset1],ye=pn(ge,a,l,xe,p),Te=this.collisionIndex.placeCollisionBox(r,O,A,R,D,w,y,ie,N.predicate,me,ye,fe);if((!ue||this.collisionIndex.placeCollisionBox(ue,O,A,R,D,w,y,ae,N.predicate,me,ye,fe).placeable)&&Te.placeable){let Fe;if(this.prevPlacement&&this.prevPlacement.variableOffsets[Z.crossTileID]&&this.prevPlacement.placements[Z.crossTileID]&&this.prevPlacement.placements[Z.crossTileID].text&&(Fe=this.prevPlacement.variableOffsets[Z.crossTileID].anchor),Z.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[Z.crossTileID]={textOffset:xe,width:a,height:l,anchor:ge,textBoxScale:p,prevAnchor:Fe},this.markUsedJustification(K,ge,Z,ne),K.allowVerticalPlacement&&(this.markUsedOrientation(K,ne,Z),this.placedOrientations[Z.crossTileID]=ne),{shift:ye,placedGlyphBoxes:Te}}}placeLayerBucketPart(e,r,a){const{bucket:l,layout:p,translationText:y,translationIcon:w,unwrappedTileID:A,pitchedLabelPlaneMatrix:R,textPixelRatio:D,holdingForFade:N,collisionBoxArray:O,partiallyEvaluatedTextSize:Z,collisionGroup:K}=e.parameters,ne=p.get("text-optional"),ie=p.get("icon-optional"),ae=s.aC(p,"text-overlap","text-allow-overlap"),ue=ae==="always",me=s.aC(p,"icon-overlap","icon-allow-overlap"),fe=me==="always",ge=p.get("text-rotation-alignment")==="map",xe=p.get("text-pitch-alignment")==="map",ye=p.get("icon-text-fit")!=="none",Te=p.get("symbol-z-order")==="viewport-y",Fe=ue&&(fe||!l.hasIconData()||ie),Le=fe&&(ue||!l.hasTextData()||ne);!l.collisionArrays&&O&&l.deserializeCollisionBoxes(O);const Be=this.retainedQueryData[l.bucketInstanceId].tileID,De=this._getTerrainElevationFunc(Be),Ye=this.transform.getFastPathSimpleProjectionMatrix(Be),Xe=(He,at,Mt)=>{var qt,mr;if(r[He.crossTileID])return;if(N)return void(this.placements[He.crossTileID]=new cs(!1,!1,!1));let tr=!1,gr=!1,yr=!0,sr=null,Ht={box:null,placeable:!1,offscreen:null,occluded:!1},jr={placeable:!1},Xr=null,ii=null,Zt=null,En=0,cn=0,Pn=0;at.textFeatureIndex?En=at.textFeatureIndex:He.useRuntimeCollisionCircles&&(En=He.featureIndex),at.verticalTextFeatureIndex&&(cn=at.verticalTextFeatureIndex);const es=at.textBox;if(es){const Ri=Fr=>{let Or=s.al.horizontal;if(l.allowVerticalPlacement&&!Fr&&this.prevPlacement){const _i=this.prevPlacement.placedOrientations[He.crossTileID];_i&&(this.placedOrientations[He.crossTileID]=_i,Or=_i,this.markUsedOrientation(l,Or,He))}return Or},Mn=(Fr,Or)=>{if(l.allowVerticalPlacement&&He.numVerticalGlyphVertices>0&&at.verticalTextBox){for(const _i of l.writingModes)if(_i===s.al.vertical?(Ht=Or(),jr=Ht):Ht=Fr(),Ht&&Ht.placeable)break}else Ht=Fr()},mn=He.textAnchorOffsetStartIndex,Ln=He.textAnchorOffsetEndIndex;if(Ln===mn){const Fr=(Or,_i)=>{const cr=this.collisionIndex.placeCollisionBox(Or,ae,D,Be,A,xe,ge,y,K.predicate,De,void 0,Ye);return cr&&cr.placeable&&(this.markUsedOrientation(l,_i,He),this.placedOrientations[He.crossTileID]=_i),cr};Mn(()=>Fr(es,s.al.horizontal),()=>{const Or=at.verticalTextBox;return l.allowVerticalPlacement&&He.numVerticalGlyphVertices>0&&Or?Fr(Or,s.al.vertical):{box:null,offscreen:null}}),Ri(Ht&&Ht.placeable)}else{let Fr=s.aB[(mr=(qt=this.prevPlacement)===null||qt===void 0?void 0:qt.variableOffsets[He.crossTileID])===null||mr===void 0?void 0:mr.anchor];const Or=(cr,ya,$c)=>{const eu=cr.x2-cr.x1,Uh=cr.y2-cr.y1,El=He.textBoxScale,_o=ye&&me==="never"?ya:null;let Ui=null,un=ae==="never"?1:2,ji="never";Fr&&un++;for(let gn=0;gn<un;gn++){for(let _a=mn;_a<Ln;_a++){const Rn=l.textAnchorOffsets.get(_a);if(Fr&&Rn.textAnchor!==Fr)continue;const Pl=this.attemptAnchorPlacement(Rn,cr,eu,Uh,El,ge,xe,D,Be,A,K,ji,He,l,$c,y,w,_o,De);if(Pl&&(Ui=Pl.placedGlyphBoxes,Ui&&Ui.placeable))return tr=!0,sr=Pl.shift,Ui}Fr?Fr=null:ji=ae}return a&&!Ui&&(Ui={box:this.collisionIndex.placeCollisionBox(es,"always",D,Be,A,xe,ge,y,K.predicate,De,void 0,Ye).box,offscreen:!1,placeable:!1,occluded:!1}),Ui};Mn(()=>Or(es,at.iconBox,s.al.horizontal),()=>{const cr=at.verticalTextBox;return l.allowVerticalPlacement&&(!Ht||!Ht.placeable)&&He.numVerticalGlyphVertices>0&&cr?Or(cr,at.verticalIconBox,s.al.vertical):{box:null,occluded:!0,offscreen:null}}),Ht&&(tr=Ht.placeable,yr=Ht.offscreen);const _i=Ri(Ht&&Ht.placeable);if(!tr&&this.prevPlacement){const cr=this.prevPlacement.variableOffsets[He.crossTileID];cr&&(this.variableOffsets[He.crossTileID]=cr,this.markUsedJustification(l,cr.anchor,He,_i))}}}if(Xr=Ht,tr=Xr&&Xr.placeable,yr=Xr&&Xr.offscreen,He.useRuntimeCollisionCircles){const Ri=l.text.placedSymbolArray.get(He.centerJustifiedTextSymbolIndex),Mn=s.am(l.textSizeData,Z,Ri),mn=p.get("text-padding");ii=this.collisionIndex.placeCollisionCircles(ae,Ri,l.lineVertexArray,l.glyphOffsetArray,Mn,A,R,a,xe,K.predicate,He.collisionCircleDiameter,mn,y,De),ii.circles.length&&ii.collisionDetected&&!a&&s.w("Collisions detected, but collision boxes are not shown"),tr=ue||ii.circles.length>0&&!ii.collisionDetected,yr=yr&&ii.offscreen}if(at.iconFeatureIndex&&(Pn=at.iconFeatureIndex),at.iconBox){const Ri=Mn=>this.collisionIndex.placeCollisionBox(Mn,me,D,Be,A,xe,ge,w,K.predicate,De,ye&&sr?sr:void 0,Ye);jr&&jr.placeable&&at.verticalIconBox?(Zt=Ri(at.verticalIconBox),gr=Zt.placeable):(Zt=Ri(at.iconBox),gr=Zt.placeable),yr=yr&&Zt.offscreen}const yo=ne||He.numHorizontalGlyphVertices===0&&He.numVerticalGlyphVertices===0,In=ie||He.numIconVertices===0;yo||In?In?yo||(gr=gr&&tr):tr=gr&&tr:gr=tr=gr&&tr;const ts=gr&&Zt.placeable;if(tr&&Xr.placeable&&this.collisionIndex.insertCollisionBox(Xr.box,ae,p.get("text-ignore-placement"),l.bucketInstanceId,jr&&jr.placeable&&cn?cn:En,K.ID),ts&&this.collisionIndex.insertCollisionBox(Zt.box,me,p.get("icon-ignore-placement"),l.bucketInstanceId,Pn,K.ID),ii&&tr&&this.collisionIndex.insertCollisionCircles(ii.circles,ae,p.get("text-ignore-placement"),l.bucketInstanceId,En,K.ID),a&&this.storeCollisionData(l.bucketInstanceId,Mt,at,Xr,Zt,ii),He.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(l.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[He.crossTileID]=new cs((tr||Fe)&&!(Xr!=null&&Xr.occluded),(gr||Le)&&!(Zt!=null&&Zt.occluded),yr||l.justReloaded),r[He.crossTileID]=!0};if(Te){if(e.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const He=l.getSortedSymbolIndexes(-this.transform.bearingInRadians);for(let at=He.length-1;at>=0;--at){const Mt=He[at];Xe(l.symbolInstances.get(Mt),l.collisionArrays[Mt],Mt)}}else for(let He=e.symbolInstanceStart;He<e.symbolInstanceEnd;He++)Xe(l.symbolInstances.get(He),l.collisionArrays[He],He);l.justReloaded=!1}storeCollisionData(e,r,a,l,p,y){if(a.textBox||a.iconBox){let w,A;this.collisionBoxArrays.has(e)?w=this.collisionBoxArrays.get(e):(w=new Map,this.collisionBoxArrays.set(e,w)),w.has(r)?A=w.get(r):(A={text:null,icon:null},w.set(r,A)),a.textBox&&(A.text=l.box),a.iconBox&&(A.icon=p.box)}if(y){let w=this.collisionCircleArrays[e];w===void 0&&(w=this.collisionCircleArrays[e]=[]);for(let A=0;A<y.circles.length;A+=4)w.push(y.circles[A+0]-Pr),w.push(y.circles[A+1]-Pr),w.push(y.circles[A+2]),w.push(y.collisionDetected?1:0)}}markUsedJustification(e,r,a,l){let p;p=l===s.al.vertical?a.verticalPlacedTextSymbolIndex:{left:a.leftJustifiedTextSymbolIndex,center:a.centerJustifiedTextSymbolIndex,right:a.rightJustifiedTextSymbolIndex}[s.aD(r)];const y=[a.leftJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.rightJustifiedTextSymbolIndex,a.verticalPlacedTextSymbolIndex];for(const w of y)w>=0&&(e.text.placedSymbolArray.get(w).crossTileID=p>=0&&w!==p?0:a.crossTileID)}markUsedOrientation(e,r,a){const l=r===s.al.horizontal||r===s.al.horizontalOnly?r:0,p=r===s.al.vertical?r:0,y=[a.leftJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.rightJustifiedTextSymbolIndex];for(const w of y)e.text.placedSymbolArray.get(w).placedOrientation=l;a.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).placedOrientation=p)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;const r=this.prevPlacement;let a=!1;this.prevZoomAdjustment=r?r.zoomAdjustment(this.transform.zoom):0;const l=r?r.symbolFadeChange(e):1,p=r?r.opacities:{},y=r?r.variableOffsets:{},w=r?r.placedOrientations:{};for(const A in this.placements){const R=this.placements[A],D=p[A];D?(this.opacities[A]=new Os(D,l,R.text,R.icon),a=a||R.text!==D.text.placed||R.icon!==D.icon.placed):(this.opacities[A]=new Os(null,l,R.text,R.icon,R.skipFade),a=a||R.text||R.icon)}for(const A in p){const R=p[A];if(!this.opacities[A]){const D=new Os(R,l,!1,!1);D.isHidden()||(this.opacities[A]=D,a=a||R.text.placed||R.icon.placed)}}for(const A in y)this.variableOffsets[A]||!this.opacities[A]||this.opacities[A].isHidden()||(this.variableOffsets[A]=y[A]);for(const A in w)this.placedOrientations[A]||!this.opacities[A]||this.opacities[A].isHidden()||(this.placedOrientations[A]=w[A]);if(r&&r.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");a?this.lastPlacementChangeTime=e:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=r?r.lastPlacementChangeTime:e)}updateLayerOpacities(e,r){const a={};for(const l of r){const p=l.getBucket(e);p&&l.latestFeatureIndex&&e.id===p.layerIds[0]&&this.updateBucketOpacities(p,l.tileID,a,l.collisionBoxArray)}}updateBucketOpacities(e,r,a,l){e.hasTextData()&&(e.text.opacityVertexArray.clear(),e.text.hasVisibleVertices=!1),e.hasIconData()&&(e.icon.opacityVertexArray.clear(),e.icon.hasVisibleVertices=!1),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();const p=e.layers[0],y=p.layout,w=new Os(null,0,!1,!1,!0),A=y.get("text-allow-overlap"),R=y.get("icon-allow-overlap"),D=p._unevaluatedLayout.hasValue("text-variable-anchor")||p._unevaluatedLayout.hasValue("text-variable-anchor-offset"),N=y.get("text-rotation-alignment")==="map",O=y.get("text-pitch-alignment")==="map",Z=y.get("icon-text-fit")!=="none",K=new Os(null,0,A&&(R||!e.hasIconData()||y.get("icon-optional")),R&&(A||!e.hasTextData()||y.get("text-optional")),!0);!e.collisionArrays&&l&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(l);const ne=(ae,ue,me)=>{for(let fe=0;fe<ue/4;fe++)ae.opacityVertexArray.emplaceBack(me);ae.hasVisibleVertices=ae.hasVisibleVertices||me!==qn},ie=this.collisionBoxArrays.get(e.bucketInstanceId);for(let ae=0;ae<e.symbolInstances.length;ae++){const ue=e.symbolInstances.get(ae),{numHorizontalGlyphVertices:me,numVerticalGlyphVertices:fe,crossTileID:ge}=ue;let xe=this.opacities[ge];a[ge]?xe=w:xe||(xe=K,this.opacities[ge]=xe),a[ge]=!0;const ye=ue.numIconVertices>0,Te=this.placedOrientations[ue.crossTileID],Fe=Te===s.al.vertical,Le=Te===s.al.horizontal||Te===s.al.horizontalOnly;if(me>0||fe>0){const De=Na(xe.text);ne(e.text,me,Fe?qn:De),ne(e.text,fe,Le?qn:De);const Ye=xe.text.isHidden();[ue.rightJustifiedTextSymbolIndex,ue.centerJustifiedTextSymbolIndex,ue.leftJustifiedTextSymbolIndex].forEach(at=>{at>=0&&(e.text.placedSymbolArray.get(at).hidden=Ye||Fe?1:0)}),ue.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(ue.verticalPlacedTextSymbolIndex).hidden=Ye||Le?1:0);const Xe=this.variableOffsets[ue.crossTileID];Xe&&this.markUsedJustification(e,Xe.anchor,ue,Te);const He=this.placedOrientations[ue.crossTileID];He&&(this.markUsedJustification(e,"left",ue,He),this.markUsedOrientation(e,He,ue))}if(ye){const De=Na(xe.icon),Ye=!(Z&&ue.verticalPlacedIconSymbolIndex&&Fe);ue.placedIconSymbolIndex>=0&&(ne(e.icon,ue.numIconVertices,Ye?De:qn),e.icon.placedSymbolArray.get(ue.placedIconSymbolIndex).hidden=xe.icon.isHidden()),ue.verticalPlacedIconSymbolIndex>=0&&(ne(e.icon,ue.numVerticalIconVertices,Ye?qn:De),e.icon.placedSymbolArray.get(ue.verticalPlacedIconSymbolIndex).hidden=xe.icon.isHidden())}const Be=ie&&ie.has(ae)?ie.get(ae):{text:null,icon:null};if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){const De=e.collisionArrays[ae];if(De){let Ye=new s.P(0,0);if(De.textBox||De.verticalTextBox){let Xe=!0;if(D){const He=this.variableOffsets[ge];He?(Ye=pn(He.anchor,He.width,He.height,He.textOffset,He.textBoxScale),N&&Ye._rotate(O?-this.transform.bearingInRadians:this.transform.bearingInRadians)):Xe=!1}if(De.textBox||De.verticalTextBox){let He;De.textBox&&(He=Fe),De.verticalTextBox&&(He=Le),Oa(e.textCollisionBox.collisionVertexArray,xe.text.placed,!Xe||He,Be.text,Ye.x,Ye.y)}}if(De.iconBox||De.verticalIconBox){const Xe=!!(!Le&&De.verticalIconBox);let He;De.iconBox&&(He=Xe),De.verticalIconBox&&(He=!Xe),Oa(e.iconCollisionBox.collisionVertexArray,xe.icon.placed,He,Be.icon,Z?Ye.x:0,Z?Ye.y:0)}}}}if(e.sortFeatures(-this.transform.bearingInRadians),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.text.opacityVertexArray.length!==e.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${e.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${e.text.layoutVertexArray.length}) / 4`);if(e.icon.opacityVertexArray.length!==e.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${e.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${e.icon.layoutVertexArray.length}) / 4`);e.bucketInstanceId in this.collisionCircleArrays&&(e.collisionCircleArray=this.collisionCircleArrays[e.bucketInstanceId],delete this.collisionCircleArrays[e.bucketInstanceId])}symbolFadeChange(e){return this.fadeDuration===0?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(e,r){const a=this.zoomAtLastRecencyCheck===r?1-this.zoomAdjustment(r):1;return this.zoomAtLastRecencyCheck=r,this.commitTime+this.fadeDuration*a>e}setStale(){this.stale=!0}}function Oa(h,e,r,a,l,p){a&&a.length!==0||(a=[0,0,0,0]);const y=a[0]-Pr,w=a[1]-Pr,A=a[2]-Pr,R=a[3]-Pr;h.emplaceBack(e?1:0,r?1:0,l||0,p||0,y,w),h.emplaceBack(e?1:0,r?1:0,l||0,p||0,A,w),h.emplaceBack(e?1:0,r?1:0,l||0,p||0,A,R),h.emplaceBack(e?1:0,r?1:0,l||0,p||0,y,R)}const cc=Math.pow(2,25),us=Math.pow(2,24),uc=Math.pow(2,17),mh=Math.pow(2,16),gh=Math.pow(2,9),yh=Math.pow(2,8),hc=Math.pow(2,1);function Na(h){if(h.opacity===0&&!h.placed)return 0;if(h.opacity===1&&h.placed)return 4294967295;const e=h.placed?1:0,r=Math.floor(127*h.opacity);return r*cc+e*us+r*uc+e*mh+r*gh+e*yh+r*hc+e}const qn=0;class qa{constructor(e){this._sortAcrossTiles=e.layout.get("symbol-z-order")!=="viewport-y"&&!e.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,r,a,l,p){const y=this._bucketParts;for(;this._currentTileIndex<e.length;)if(r.getBucketParts(y,l,e[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,p())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,y.sort((w,A)=>w.sortKey-A.sortKey));this._currentPartIndex<y.length;)if(r.placeLayerBucketPart(y[this._currentPartIndex],this._seenCrossTileIDs,a),this._currentPartIndex++,p())return!0;return!1}}class pc{constructor(e,r,a,l,p,y,w,A){this.placement=new lc(e,r,y,w,A),this._currentPlacementIndex=a.length-1,this._forceFullPlacement=l,this._showCollisionBoxes=p,this._done=!1}isDone(){return this._done}continuePlacement(e,r,a){const l=M.now(),p=()=>!this._forceFullPlacement&&M.now()-l>2;for(;this._currentPlacementIndex>=0;){const y=r[e[this._currentPlacementIndex]],w=this.placement.collisionIndex.transform.zoom;if(y.type==="symbol"&&(!y.minzoom||y.minzoom<=w)&&(!y.maxzoom||y.maxzoom>w)){if(this._inProgressLayer||(this._inProgressLayer=new qa(y)),this._inProgressLayer.continuePlacement(a[y.source],this.placement,this._showCollisionBoxes,y,p))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}const Un=512/s.Z/2;class Ua{constructor(e,r,a){this.tileID=e,this.bucketInstanceId=a,this._symbolsByKey={};const l=new Map;for(let p=0;p<r.length;p++){const y=r.get(p),w=y.key,A=l.get(w);A?A.push(y):l.set(w,[y])}for(const[p,y]of l){const w={positions:y.map(A=>({x:Math.floor(A.anchorX*Un),y:Math.floor(A.anchorY*Un)})),crossTileIDs:y.map(A=>A.crossTileID)};if(w.positions.length>128){const A=new s.aF(w.positions.length,16,Uint16Array);for(const{x:R,y:D}of w.positions)A.add(R,D);A.finish(),delete w.positions,w.index=A}this._symbolsByKey[p]=w}}getScaledCoordinates(e,r){const{x:a,y:l,z:p}=this.tileID.canonical,{x:y,y:w,z:A}=r.canonical,R=Un/Math.pow(2,A-p),D=(w*s.Z+e.anchorY)*R,N=l*s.Z*Un;return{x:Math.floor((y*s.Z+e.anchorX)*R-a*s.Z*Un),y:Math.floor(D-N)}}findMatches(e,r,a){const l=this.tileID.canonical.z<r.canonical.z?1:Math.pow(2,this.tileID.canonical.z-r.canonical.z);for(let p=0;p<e.length;p++){const y=e.get(p);if(y.crossTileID)continue;const w=this._symbolsByKey[y.key];if(!w)continue;const A=this.getScaledCoordinates(y,r);if(w.index){const R=w.index.range(A.x-l,A.y-l,A.x+l,A.y+l).sort();for(const D of R){const N=w.crossTileIDs[D];if(!a[N]){a[N]=!0,y.crossTileID=N;break}}}else if(w.positions)for(let R=0;R<w.positions.length;R++){const D=w.positions[R],N=w.crossTileIDs[R];if(Math.abs(D.x-A.x)<=l&&Math.abs(D.y-A.y)<=l&&!a[N]){a[N]=!0,y.crossTileID=N;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:e})=>e)}}class _h{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Ns{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){const r=Math.round((e-this.lng)/360);if(r!==0)for(const a in this.indexes){const l=this.indexes[a],p={};for(const y in l){const w=l[y];w.tileID=w.tileID.unwrapTo(w.tileID.wrap+r),p[w.tileID.key]=w}this.indexes[a]=p}this.lng=e}addBucket(e,r,a){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===r.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let p=0;p<r.symbolInstances.length;p++)r.symbolInstances.get(p).crossTileID=0;this.usedCrossTileIDs[e.overscaledZ]||(this.usedCrossTileIDs[e.overscaledZ]={});const l=this.usedCrossTileIDs[e.overscaledZ];for(const p in this.indexes){const y=this.indexes[p];if(Number(p)>e.overscaledZ)for(const w in y){const A=y[w];A.tileID.isChildOf(e)&&A.findMatches(r.symbolInstances,e,l)}else{const w=y[e.scaledTo(Number(p)).key];w&&w.findMatches(r.symbolInstances,e,l)}}for(let p=0;p<r.symbolInstances.length;p++){const y=r.symbolInstances.get(p);y.crossTileID||(y.crossTileID=a.generate(),l[y.crossTileID]=!0)}return this.indexes[e.overscaledZ]===void 0&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new Ua(e,r.symbolInstances,r.bucketInstanceId),!0}removeBucketCrossTileIDs(e,r){for(const a of r.getCrossTileIDsLists())for(const l of a)delete this.usedCrossTileIDs[e][l]}removeStaleBuckets(e){let r=!1;for(const a in this.indexes){const l=this.indexes[a];for(const p in l)e[l[p].bucketInstanceId]||(this.removeBucketCrossTileIDs(a,l[p]),delete l[p],r=!0)}return r}}class qs{constructor(){this.layerIndexes={},this.crossTileIDs=new _h,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(e,r,a){let l=this.layerIndexes[e.id];l===void 0&&(l=this.layerIndexes[e.id]=new Ns);let p=!1;const y={};l.handleWrapJump(a);for(const w of r){const A=w.getBucket(e);A&&e.id===A.layerIds[0]&&(A.bucketInstanceId||(A.bucketInstanceId=++this.maxBucketInstanceId),l.addBucket(w.tileID,A,this.crossTileIDs)&&(p=!0),y[A.bucketInstanceId]=!0)}return l.removeStaleBuckets(y)&&(p=!0),p}pruneUnusedLayers(e){const r={};e.forEach(a=>{r[a]=!0});for(const a in this.layerIndexes)r[a]||delete this.layerIndexes[a]}}var ja="void main() {fragColor=vec4(1.0);}";const fi={prelude:Ut(`#ifdef GL_ES
66
- precision mediump float;
67
- #else
68
- #if !defined(lowp)
69
- #define lowp
70
- #endif
71
- #if !defined(mediump)
72
- #define mediump
73
- #endif
74
- #if !defined(highp)
75
- #define highp
76
- #endif
77
- #endif
78
- out highp vec4 fragColor;`,`#ifdef GL_ES
79
- precision highp float;
80
- #else
81
- #if !defined(lowp)
82
- #define lowp
83
- #endif
84
- #if !defined(mediump)
85
- #define mediump
86
- #endif
87
- #if !defined(highp)
88
- #define highp
89
- #endif
90
- #endif
91
- vec2 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
92
- );}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
93
- );}
94
- #ifdef TERRAIN3D
95
- uniform 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;
96
- #endif
97
- const 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) {
98
- #ifdef TERRAIN3D
99
- highp 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));
100
- #else
101
- return 1.0;
102
- #endif
103
- }float calculate_visibility(vec4 pos) {
104
- #ifdef TERRAIN3D
105
- vec3 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;
106
- #else
107
- return 1.0;
108
- #endif
109
- }float ele(vec2 pos) {
110
- #ifdef TERRAIN3D
111
- vec4 rgb=(texture(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;
112
- #else
113
- return 0.0;
114
- #endif
115
- }float get_elevation(vec2 pos) {
116
- #ifdef TERRAIN3D
117
- #ifdef GLOBE
118
- if ((pos.y <-32767.5) || (pos.y > 32766.5)) {return 0.0;}
119
- #endif
120
- vec2 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;
121
- #else
122
- return 0.0;
123
- #endif
124
- }const float PI=3.141592653589793;uniform mat4 u_projection_matrix;`),projectionMercator:Ut("","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:Ut("",`#define GLOBE_RADIUS 6371008.8
125
- uniform 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
126
- );}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);
127
- if (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
128
- );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:Ut(`uniform vec4 u_color;uniform float u_opacity;void main() {fragColor=u_color*u_opacity;
129
- #ifdef OVERDRAW_INSPECTOR
130
- fragColor=vec4(1.0);
131
- #endif
132
- }`,"in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),backgroundPattern:Ut(`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;
133
- #ifdef OVERDRAW_INSPECTOR
134
- fragColor=vec4(1.0);
135
- #endif
136
- }`,"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:Ut(`in vec3 v_data;in float v_visibility;
137
- #pragma mapbox: define highp vec4 color
138
- #pragma mapbox: define mediump float radius
139
- #pragma mapbox: define lowp float blur
140
- #pragma mapbox: define lowp float opacity
141
- #pragma mapbox: define highp vec4 stroke_color
142
- #pragma mapbox: define mediump float stroke_width
143
- #pragma mapbox: define lowp float stroke_opacity
144
- void main() {
145
- #pragma mapbox: initialize highp vec4 color
146
- #pragma mapbox: initialize mediump float radius
147
- #pragma mapbox: initialize lowp float blur
148
- #pragma mapbox: initialize lowp float opacity
149
- #pragma mapbox: initialize highp vec4 stroke_color
150
- #pragma mapbox: initialize mediump float stroke_width
151
- #pragma mapbox: initialize lowp float stroke_opacity
152
- vec2 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;}
153
- #ifdef OVERDRAW_INSPECTOR
154
- fragColor=vec4(1.0);
155
- #endif
156
- }`,`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;
157
- #pragma mapbox: define highp vec4 color
158
- #pragma mapbox: define mediump float radius
159
- #pragma mapbox: define lowp float blur
160
- #pragma mapbox: define lowp float opacity
161
- #pragma mapbox: define highp vec4 stroke_color
162
- #pragma mapbox: define mediump float stroke_width
163
- #pragma mapbox: define lowp float stroke_opacity
164
- void main(void) {
165
- #pragma mapbox: initialize highp vec4 color
166
- #pragma mapbox: initialize mediump float radius
167
- #pragma mapbox: initialize lowp float blur
168
- #pragma mapbox: initialize lowp float opacity
169
- #pragma mapbox: initialize highp vec4 stroke_color
170
- #pragma mapbox: initialize mediump float stroke_width
171
- #pragma mapbox: initialize lowp float stroke_opacity
172
- vec2 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) {
173
- #ifdef GLOBE
174
- vec3 center_vector=projectToSphere(circle_center);
175
- #endif
176
- float 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 {
177
- #ifdef GLOBE
178
- vec4 projected_center=interpolateProjection(circle_center,center_vector,ele);
179
- #else
180
- vec4 projected_center=projectTileWithElevation(circle_center,ele);
181
- #endif
182
- corner_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);}
183
- #ifdef GLOBE
184
- vec2 angles=extrude*angle_scale;vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(corner_position,corner_vector,ele);
185
- #else
186
- gl_Position=projectTileWithElevation(corner_position,ele);
187
- #endif
188
- } 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:Ut(ja,"in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),heatmap:Ut(`uniform highp float u_intensity;in vec2 v_extrude;
189
- #pragma mapbox: define highp float weight
190
- #define GAUSS_COEF 0.3989422804014327
191
- void main() {
192
- #pragma mapbox: initialize highp float weight
193
- float 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);
194
- #ifdef OVERDRAW_INSPECTOR
195
- fragColor=vec4(1.0);
196
- #endif
197
- }`,`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;
198
- #pragma mapbox: define highp float weight
199
- #pragma mapbox: define mediump float radius
200
- const highp float ZERO=1.0/255.0/16.0;
201
- #define GAUSS_COEF 0.3989422804014327
202
- void main(void) {
203
- #pragma mapbox: initialize highp float weight
204
- #pragma mapbox: initialize mediump float radius
205
- vec2 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);
206
- #ifdef GLOBE
207
- vec2 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);
208
- #else
209
- gl_Position=projectTileFor3D(circle_center+extrude,get_elevation(circle_center));
210
- #endif
211
- }`),heatmapTexture:Ut(`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;
212
- #ifdef OVERDRAW_INSPECTOR
213
- fragColor=vec4(0.0);
214
- #endif
215
- }`,"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:Ut("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:Ut("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);}"),debug:Ut("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:Ut(ja,`in vec2 a_pos;void main() {
216
- #ifdef GLOBE
217
- gl_Position=projectTileFor3D(a_pos,0.0);
218
- #else
219
- gl_Position=u_projection_matrix*vec4(a_pos,0.0,1.0);
220
- #endif
221
- }`),fill:Ut(`#pragma mapbox: define highp vec4 color
222
- #pragma mapbox: define lowp float opacity
223
- void main() {
224
- #pragma mapbox: initialize highp vec4 color
225
- #pragma mapbox: initialize lowp float opacity
226
- fragColor=color*opacity;
227
- #ifdef OVERDRAW_INSPECTOR
228
- fragColor=vec4(1.0);
229
- #endif
230
- }`,`uniform vec2 u_fill_translate;in vec2 a_pos;
231
- #pragma mapbox: define highp vec4 color
232
- #pragma mapbox: define lowp float opacity
233
- void main() {
234
- #pragma mapbox: initialize highp vec4 color
235
- #pragma mapbox: initialize lowp float opacity
236
- gl_Position=projectTile(a_pos+u_fill_translate,a_pos);}`),fillOutline:Ut(`in vec2 v_pos;
237
- #ifdef GLOBE
238
- in float v_depth;
239
- #endif
240
- #pragma mapbox: define highp vec4 outline_color
241
- #pragma mapbox: define lowp float opacity
242
- void main() {
243
- #pragma mapbox: initialize highp vec4 outline_color
244
- #pragma mapbox: initialize lowp float opacity
245
- float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=outline_color*(alpha*opacity);
246
- #ifdef GLOBE
247
- if (v_depth > 1.0) {discard;}
248
- #endif
249
- #ifdef OVERDRAW_INSPECTOR
250
- fragColor=vec4(1.0);
251
- #endif
252
- }`,`uniform vec2 u_world;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos;
253
- #ifdef GLOBE
254
- out float v_depth;
255
- #endif
256
- #pragma mapbox: define highp vec4 outline_color
257
- #pragma mapbox: define lowp float opacity
258
- void main() {
259
- #pragma mapbox: initialize highp vec4 outline_color
260
- #pragma mapbox: initialize lowp float opacity
261
- gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;
262
- #ifdef GLOBE
263
- v_depth=gl_Position.z/gl_Position.w;
264
- #endif
265
- }`),fillOutlinePattern:Ut(`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;
266
- #ifdef GLOBE
267
- in float v_depth;
268
- #endif
269
- #pragma mapbox: define lowp float opacity
270
- #pragma mapbox: define lowp vec4 pattern_from
271
- #pragma mapbox: define lowp vec4 pattern_to
272
- void main() {
273
- #pragma mapbox: initialize lowp float opacity
274
- #pragma mapbox: initialize mediump vec4 pattern_from
275
- #pragma mapbox: initialize mediump vec4 pattern_to
276
- vec2 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;
277
- #ifdef GLOBE
278
- if (v_depth > 1.0) {discard;}
279
- #endif
280
- #ifdef OVERDRAW_INSPECTOR
281
- fragColor=vec4(1.0);
282
- #endif
283
- }`,`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;
284
- #ifdef GLOBE
285
- out float v_depth;
286
- #endif
287
- #pragma mapbox: define lowp float opacity
288
- #pragma mapbox: define lowp vec4 pattern_from
289
- #pragma mapbox: define lowp vec4 pattern_to
290
- #pragma mapbox: define lowp float pixel_ratio_from
291
- #pragma mapbox: define lowp float pixel_ratio_to
292
- void main() {
293
- #pragma mapbox: initialize lowp float opacity
294
- #pragma mapbox: initialize mediump vec4 pattern_from
295
- #pragma mapbox: initialize mediump vec4 pattern_to
296
- #pragma mapbox: initialize lowp float pixel_ratio_from
297
- #pragma mapbox: initialize lowp float pixel_ratio_to
298
- vec2 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;
299
- #ifdef GLOBE
300
- v_depth=gl_Position.z/gl_Position.w;
301
- #endif
302
- }`),fillPattern:Ut(`#ifdef GL_ES
303
- precision highp float;
304
- #endif
305
- uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;
306
- #pragma mapbox: define lowp float opacity
307
- #pragma mapbox: define lowp vec4 pattern_from
308
- #pragma mapbox: define lowp vec4 pattern_to
309
- void main() {
310
- #pragma mapbox: initialize lowp float opacity
311
- #pragma mapbox: initialize mediump vec4 pattern_from
312
- #pragma mapbox: initialize mediump vec4 pattern_to
313
- vec2 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;
314
- #ifdef OVERDRAW_INSPECTOR
315
- fragColor=vec4(1.0);
316
- #endif
317
- }`,`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;
318
- #pragma mapbox: define lowp float opacity
319
- #pragma mapbox: define lowp vec4 pattern_from
320
- #pragma mapbox: define lowp vec4 pattern_to
321
- #pragma mapbox: define lowp float pixel_ratio_from
322
- #pragma mapbox: define lowp float pixel_ratio_to
323
- void main() {
324
- #pragma mapbox: initialize lowp float opacity
325
- #pragma mapbox: initialize mediump vec4 pattern_from
326
- #pragma mapbox: initialize mediump vec4 pattern_to
327
- #pragma mapbox: initialize lowp float pixel_ratio_from
328
- #pragma mapbox: initialize lowp float pixel_ratio_to
329
- vec2 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:Ut(`in vec4 v_color;void main() {fragColor=v_color;
330
- #ifdef OVERDRAW_INSPECTOR
331
- fragColor=vec4(1.0);
332
- #endif
333
- }`,`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;
334
- #ifdef TERRAIN3D
335
- in vec2 a_centroid;
336
- #endif
337
- out vec4 v_color;
338
- #pragma mapbox: define highp float base
339
- #pragma mapbox: define highp float height
340
- #pragma mapbox: define highp vec4 color
341
- void main() {
342
- #pragma mapbox: initialize highp float base
343
- #pragma mapbox: initialize highp float height
344
- #pragma mapbox: initialize highp vec4 color
345
- vec3 normal=a_normal_ed.xyz;
346
- #ifdef TERRAIN3D
347
- float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
348
- #else
349
- float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
350
- #endif
351
- base=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;
352
- #ifdef GLOBE
353
- vec3 spherePos=projectToSphere(posInTile,a_pos);gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);
354
- #else
355
- gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);
356
- #endif
357
- float 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);
358
- #ifdef GLOBE
359
- mat3 rotMatrix=globeGetRotationMatrix(spherePos);normalForLighting=rotMatrix*normalForLighting;directional=mix(directional,clamp(dot(normalForLighting,u_lightpos_globe),0.0,1.0),u_projection_transition);
360
- #endif
361
- directional=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:Ut(`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;
362
- #pragma mapbox: define lowp float base
363
- #pragma mapbox: define lowp float height
364
- #pragma mapbox: define lowp vec4 pattern_from
365
- #pragma mapbox: define lowp vec4 pattern_to
366
- #pragma mapbox: define lowp float pixel_ratio_from
367
- #pragma mapbox: define lowp float pixel_ratio_to
368
- void main() {
369
- #pragma mapbox: initialize lowp float base
370
- #pragma mapbox: initialize lowp float height
371
- #pragma mapbox: initialize mediump vec4 pattern_from
372
- #pragma mapbox: initialize mediump vec4 pattern_to
373
- #pragma mapbox: initialize lowp float pixel_ratio_from
374
- #pragma mapbox: initialize lowp float pixel_ratio_to
375
- vec2 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;
376
- #ifdef OVERDRAW_INSPECTOR
377
- fragColor=vec4(1.0);
378
- #endif
379
- }`,`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;
380
- #ifdef TERRAIN3D
381
- in vec2 a_centroid;
382
- #endif
383
- #ifdef GLOBE
384
- out vec3 v_sphere_pos;
385
- #endif
386
- out vec2 v_pos_a;out vec2 v_pos_b;out vec4 v_lighting;
387
- #pragma mapbox: define lowp float base
388
- #pragma mapbox: define lowp float height
389
- #pragma mapbox: define lowp vec4 pattern_from
390
- #pragma mapbox: define lowp vec4 pattern_to
391
- #pragma mapbox: define lowp float pixel_ratio_from
392
- #pragma mapbox: define lowp float pixel_ratio_to
393
- void main() {
394
- #pragma mapbox: initialize lowp float base
395
- #pragma mapbox: initialize lowp float height
396
- #pragma mapbox: initialize mediump vec4 pattern_from
397
- #pragma mapbox: initialize mediump vec4 pattern_to
398
- #pragma mapbox: initialize lowp float pixel_ratio_from
399
- #pragma mapbox: initialize lowp float pixel_ratio_to
400
- vec2 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;
401
- #ifdef TERRAIN3D
402
- float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
403
- #else
404
- float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
405
- #endif
406
- base=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;
407
- #ifdef GLOBE
408
- vec3 spherePos=projectToSphere(posInTile,a_pos);vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);v_sphere_pos=elevatedPos;gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);
409
- #else
410
- gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);
411
- #endif
412
- vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0
413
- ? a_pos
414
- : 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:Ut(`#ifdef GL_ES
415
- precision highp float;
416
- #endif
417
- uniform 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);
418
- #ifdef OVERDRAW_INSPECTOR
419
- fragColor=vec4(1.0);
420
- #endif
421
- }`,"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:Ut(`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];
422
- #define PI 3.141592653589793
423
- #define STANDARD 0
424
- #define COMBINED 1
425
- #define IGOR 2
426
- #define MULTIDIRECTIONAL 3
427
- #define BASIC 4
428
- float 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
429
- {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
430
- {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;switch(u_method){case BASIC:
431
- basic_hillshade(deriv);break;case COMBINED:
432
- combined_hillshade(deriv);break;case IGOR:
433
- igor_hillshade(deriv);break;case MULTIDIRECTIONAL:
434
- multidirectional_hillshade(deriv);break;case STANDARD:
435
- default:
436
- standard_hillshade(deriv);break;}
437
- #ifdef OVERDRAW_INSPECTOR
438
- fragColor=vec4(1.0);
439
- #endif
440
- }`,"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:Ut(`uniform lowp float u_device_pixel_ratio;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;
441
- #ifdef GLOBE
442
- in float v_depth;
443
- #endif
444
- #pragma mapbox: define highp vec4 color
445
- #pragma mapbox: define lowp float blur
446
- #pragma mapbox: define lowp float opacity
447
- void main() {
448
- #pragma mapbox: initialize highp vec4 color
449
- #pragma mapbox: initialize lowp float blur
450
- #pragma mapbox: initialize lowp float opacity
451
- 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);fragColor=color*(alpha*opacity);
452
- #ifdef GLOBE
453
- if (v_depth > 1.0) {discard;}
454
- #endif
455
- #ifdef OVERDRAW_INSPECTOR
456
- fragColor=vec4(1.0);
457
- #endif
458
- }`,`
459
- #define scale 0.015873016
460
- in 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;
461
- #ifdef GLOBE
462
- out float v_depth;
463
- #endif
464
- #pragma mapbox: define highp vec4 color
465
- #pragma mapbox: define lowp float blur
466
- #pragma mapbox: define lowp float opacity
467
- #pragma mapbox: define mediump float gapwidth
468
- #pragma mapbox: define lowp float offset
469
- #pragma mapbox: define mediump float width
470
- void main() {
471
- #pragma mapbox: initialize highp vec4 color
472
- #pragma mapbox: initialize lowp float blur
473
- #pragma mapbox: initialize lowp float opacity
474
- #pragma mapbox: initialize mediump float gapwidth
475
- #pragma mapbox: initialize lowp float offset
476
- #pragma mapbox: initialize mediump float width
477
- float 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;
478
- #ifdef GLOBE
479
- v_depth=gl_Position.z/gl_Position.w;
480
- #endif
481
- #ifdef TERRAIN3D
482
- v_gamma_scale=1.0;
483
- #else
484
- float 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;
485
- #endif
486
- v_width2=vec2(outset,inset);}`),lineGradient:Ut(`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;
487
- #ifdef GLOBE
488
- in float v_depth;
489
- #endif
490
- #pragma mapbox: define lowp float blur
491
- #pragma mapbox: define lowp float opacity
492
- void main() {
493
- #pragma mapbox: initialize lowp float blur
494
- #pragma mapbox: initialize lowp float opacity
495
- 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);vec4 color=texture(u_image,v_uv);fragColor=color*(alpha*opacity);
496
- #ifdef GLOBE
497
- if (v_depth > 1.0) {discard;}
498
- #endif
499
- #ifdef OVERDRAW_INSPECTOR
500
- fragColor=vec4(1.0);
501
- #endif
502
- }`,`
503
- #define scale 0.015873016
504
- in 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;
505
- #ifdef GLOBE
506
- out float v_depth;
507
- #endif
508
- #pragma mapbox: define lowp float blur
509
- #pragma mapbox: define lowp float opacity
510
- #pragma mapbox: define mediump float gapwidth
511
- #pragma mapbox: define lowp float offset
512
- #pragma mapbox: define mediump float width
513
- void main() {
514
- #pragma mapbox: initialize lowp float blur
515
- #pragma mapbox: initialize lowp float opacity
516
- #pragma mapbox: initialize mediump float gapwidth
517
- #pragma mapbox: initialize lowp float offset
518
- #pragma mapbox: initialize mediump float width
519
- float 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;
520
- #ifdef GLOBE
521
- v_depth=gl_Position.z/gl_Position.w;
522
- #endif
523
- #ifdef TERRAIN3D
524
- v_gamma_scale=1.0;
525
- #else
526
- float 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;
527
- #endif
528
- v_width2=vec2(outset,inset);}`),linePattern:Ut(`#ifdef GL_ES
529
- precision highp float;
530
- #endif
531
- uniform 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;
532
- #ifdef GLOBE
533
- in float v_depth;
534
- #endif
535
- #pragma mapbox: define lowp vec4 pattern_from
536
- #pragma mapbox: define lowp vec4 pattern_to
537
- #pragma mapbox: define lowp float pixel_ratio_from
538
- #pragma mapbox: define lowp float pixel_ratio_to
539
- #pragma mapbox: define lowp float blur
540
- #pragma mapbox: define lowp float opacity
541
- void main() {
542
- #pragma mapbox: initialize mediump vec4 pattern_from
543
- #pragma mapbox: initialize mediump vec4 pattern_to
544
- #pragma mapbox: initialize lowp float pixel_ratio_from
545
- #pragma mapbox: initialize lowp float pixel_ratio_to
546
- #pragma mapbox: initialize lowp float blur
547
- #pragma mapbox: initialize lowp float opacity
548
- vec2 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;
549
- #ifdef GLOBE
550
- if (v_depth > 1.0) {discard;}
551
- #endif
552
- #ifdef OVERDRAW_INSPECTOR
553
- fragColor=vec4(1.0);
554
- #endif
555
- }`,`
556
- #define scale 0.015873016
557
- #define LINE_DISTANCE_SCALE 2.0
558
- in 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;
559
- #ifdef GLOBE
560
- out float v_depth;
561
- #endif
562
- #pragma mapbox: define lowp float blur
563
- #pragma mapbox: define lowp float opacity
564
- #pragma mapbox: define lowp float offset
565
- #pragma mapbox: define mediump float gapwidth
566
- #pragma mapbox: define mediump float width
567
- #pragma mapbox: define lowp float floorwidth
568
- #pragma mapbox: define lowp vec4 pattern_from
569
- #pragma mapbox: define lowp vec4 pattern_to
570
- #pragma mapbox: define lowp float pixel_ratio_from
571
- #pragma mapbox: define lowp float pixel_ratio_to
572
- void main() {
573
- #pragma mapbox: initialize lowp float blur
574
- #pragma mapbox: initialize lowp float opacity
575
- #pragma mapbox: initialize lowp float offset
576
- #pragma mapbox: initialize mediump float gapwidth
577
- #pragma mapbox: initialize mediump float width
578
- #pragma mapbox: initialize lowp float floorwidth
579
- #pragma mapbox: initialize mediump vec4 pattern_from
580
- #pragma mapbox: initialize mediump vec4 pattern_to
581
- #pragma mapbox: initialize lowp float pixel_ratio_from
582
- #pragma mapbox: initialize lowp float pixel_ratio_to
583
- float 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;
584
- #ifdef GLOBE
585
- v_depth=gl_Position.z/gl_Position.w;
586
- #endif
587
- #ifdef TERRAIN3D
588
- v_gamma_scale=1.0;
589
- #else
590
- float 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;
591
- #endif
592
- v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:Ut(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;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;
593
- #ifdef GLOBE
594
- in float v_depth;
595
- #endif
596
- #pragma mapbox: define highp vec4 color
597
- #pragma mapbox: define lowp float blur
598
- #pragma mapbox: define lowp float opacity
599
- #pragma mapbox: define mediump float width
600
- #pragma mapbox: define lowp float floorwidth
601
- void main() {
602
- #pragma mapbox: initialize highp vec4 color
603
- #pragma mapbox: initialize lowp float blur
604
- #pragma mapbox: initialize lowp float opacity
605
- #pragma mapbox: initialize mediump float width
606
- #pragma mapbox: initialize lowp float floorwidth
607
- 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 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);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*opacity);
608
- #ifdef GLOBE
609
- if (v_depth > 1.0) {discard;}
610
- #endif
611
- #ifdef OVERDRAW_INSPECTOR
612
- fragColor=vec4(1.0);
613
- #endif
614
- }`,`
615
- #define scale 0.015873016
616
- #define LINE_DISTANCE_SCALE 2.0
617
- in 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_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;out vec2 v_normal;out vec2 v_width2;out vec2 v_tex_a;out vec2 v_tex_b;out float v_gamma_scale;
618
- #ifdef GLOBE
619
- out float v_depth;
620
- #endif
621
- #pragma mapbox: define highp vec4 color
622
- #pragma mapbox: define lowp float blur
623
- #pragma mapbox: define lowp float opacity
624
- #pragma mapbox: define mediump float gapwidth
625
- #pragma mapbox: define lowp float offset
626
- #pragma mapbox: define mediump float width
627
- #pragma mapbox: define lowp float floorwidth
628
- void main() {
629
- #pragma mapbox: initialize highp vec4 color
630
- #pragma mapbox: initialize lowp float blur
631
- #pragma mapbox: initialize lowp float opacity
632
- #pragma mapbox: initialize mediump float gapwidth
633
- #pragma mapbox: initialize lowp float offset
634
- #pragma mapbox: initialize mediump float width
635
- #pragma mapbox: initialize lowp float floorwidth
636
- float 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;
637
- #ifdef GLOBE
638
- v_depth=gl_Position.z/gl_Position.w;
639
- #endif
640
- #ifdef TERRAIN3D
641
- v_gamma_scale=1.0;
642
- #else
643
- float 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;
644
- #endif
645
- v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:Ut(`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);
646
- #ifdef OVERDRAW_INSPECTOR
647
- fragColor=vec4(1.0);
648
- #endif
649
- }`,`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;
650
- #ifdef GLOBE
651
- if (a_pos.y <-32767.5) {v_pos0.y=0.0;}if (a_pos.y > 32766.5) {v_pos0.y=1.0;}
652
- #endif
653
- v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}`),symbolIcon:Ut(`uniform sampler2D u_texture;in vec2 v_tex;in float v_fade_opacity;
654
- #pragma mapbox: define lowp float opacity
655
- void main() {
656
- #pragma mapbox: initialize lowp float opacity
657
- lowp float alpha=opacity*v_fade_opacity;fragColor=texture(u_texture,v_tex)*alpha;
658
- #ifdef OVERDRAW_INSPECTOR
659
- fragColor=vec4(1.0);
660
- #endif
661
- }`,`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;
662
- #pragma mapbox: define lowp float opacity
663
- void main() {
664
- #pragma mapbox: initialize lowp float opacity
665
- vec2 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 ?
666
- camera_to_anchor_distance/u_camera_to_center_distance :
667
- u_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;
668
- #ifdef GLOBE
669
- if(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);}
670
- #endif
671
- vec4 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:Ut(`#define SDF_PX 8.0
672
- uniform 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;
673
- #pragma mapbox: define highp vec4 fill_color
674
- #pragma mapbox: define highp vec4 halo_color
675
- #pragma mapbox: define lowp float opacity
676
- #pragma mapbox: define lowp float halo_width
677
- #pragma mapbox: define lowp float halo_blur
678
- void main() {
679
- #pragma mapbox: initialize highp vec4 fill_color
680
- #pragma mapbox: initialize highp vec4 halo_color
681
- #pragma mapbox: initialize lowp float opacity
682
- #pragma mapbox: initialize lowp float halo_width
683
- #pragma mapbox: initialize lowp float halo_blur
684
- float 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);
685
- #ifdef OVERDRAW_INSPECTOR
686
- fragColor=vec4(1.0);
687
- #endif
688
- }`,`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;
689
- #pragma mapbox: define highp vec4 fill_color
690
- #pragma mapbox: define highp vec4 halo_color
691
- #pragma mapbox: define lowp float opacity
692
- #pragma mapbox: define lowp float halo_width
693
- #pragma mapbox: define lowp float halo_blur
694
- void main() {
695
- #pragma mapbox: initialize highp vec4 fill_color
696
- #pragma mapbox: initialize highp vec4 halo_color
697
- #pragma mapbox: initialize lowp float opacity
698
- #pragma mapbox: initialize lowp float halo_width
699
- #pragma mapbox: initialize lowp float halo_blur
700
- vec2 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;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 ?
701
- camera_to_anchor_distance/u_camera_to_center_distance :
702
- u_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;
703
- #ifdef GLOBE
704
- if(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);}
705
- #endif
706
- vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*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:Ut(`#define SDF_PX 8.0
707
- #define SDF 1.0
708
- #define ICON 0.0
709
- uniform 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;
710
- #pragma mapbox: define highp vec4 fill_color
711
- #pragma mapbox: define highp vec4 halo_color
712
- #pragma mapbox: define lowp float opacity
713
- #pragma mapbox: define lowp float halo_width
714
- #pragma mapbox: define lowp float halo_blur
715
- void main() {
716
- #pragma mapbox: initialize highp vec4 fill_color
717
- #pragma mapbox: initialize highp vec4 halo_color
718
- #pragma mapbox: initialize lowp float opacity
719
- #pragma mapbox: initialize lowp float halo_width
720
- #pragma mapbox: initialize lowp float halo_blur
721
- float 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;
722
- #ifdef OVERDRAW_INSPECTOR
723
- fragColor=vec4(1.0);
724
- #endif
725
- return;}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);
726
- #ifdef OVERDRAW_INSPECTOR
727
- fragColor=vec4(1.0);
728
- #endif
729
- }`,`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;
730
- #pragma mapbox: define highp vec4 fill_color
731
- #pragma mapbox: define highp vec4 halo_color
732
- #pragma mapbox: define lowp float opacity
733
- #pragma mapbox: define lowp float halo_width
734
- #pragma mapbox: define lowp float halo_blur
735
- void main() {
736
- #pragma mapbox: initialize highp vec4 fill_color
737
- #pragma mapbox: initialize highp vec4 halo_color
738
- #pragma mapbox: initialize lowp float opacity
739
- #pragma mapbox: initialize lowp float halo_width
740
- #pragma mapbox: initialize lowp float halo_blur
741
- vec2 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 ?
742
- camera_to_anchor_distance/u_camera_to_center_distance :
743
- u_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;
744
- #ifdef GLOBE
745
- if(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);}
746
- #endif
747
- vec4 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:Ut("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:Ut("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:Ut("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:Ut("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:Ut(`in 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
748
- );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:Ut("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 Ut(h,e){const r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,a=e.match(/in ([\w]+) ([\w]+)/g),l=h.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),p=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),y=p?p.concat(l):l,w={};return{fragmentSource:h=h.replace(r,(A,R,D,N,O)=>(w[O]=!0,R==="define"?`
749
- #ifndef HAS_UNIFORM_u_${O}
750
- in ${D} ${N} ${O};
751
- #else
752
- uniform ${D} ${N} u_${O};
753
- #endif
754
- `:`
755
- #ifdef HAS_UNIFORM_u_${O}
756
- ${D} ${N} ${O} = u_${O};
757
- #endif
758
- `)),vertexSource:e=e.replace(r,(A,R,D,N,O)=>{const Z=N==="float"?"vec2":"vec4",K=O.match(/color/)?"color":Z;return w[O]?R==="define"?`
759
- #ifndef HAS_UNIFORM_u_${O}
760
- uniform lowp float u_${O}_t;
761
- in ${D} ${Z} a_${O};
762
- out ${D} ${N} ${O};
763
- #else
764
- uniform ${D} ${N} u_${O};
765
- #endif
766
- `:K==="vec4"?`
767
- #ifndef HAS_UNIFORM_u_${O}
768
- ${O} = a_${O};
769
- #else
770
- ${D} ${N} ${O} = u_${O};
771
- #endif
772
- `:`
773
- #ifndef HAS_UNIFORM_u_${O}
774
- ${O} = unpack_mix_${K}(a_${O}, u_${O}_t);
775
- #else
776
- ${D} ${N} ${O} = u_${O};
777
- #endif
778
- `:R==="define"?`
779
- #ifndef HAS_UNIFORM_u_${O}
780
- uniform lowp float u_${O}_t;
781
- in ${D} ${Z} a_${O};
782
- #else
783
- uniform ${D} ${N} u_${O};
784
- #endif
785
- `:K==="vec4"?`
786
- #ifndef HAS_UNIFORM_u_${O}
787
- ${D} ${N} ${O} = a_${O};
788
- #else
789
- ${D} ${N} ${O} = u_${O};
790
- #endif
791
- `:`
792
- #ifndef HAS_UNIFORM_u_${O}
793
- ${D} ${N} ${O} = unpack_mix_${K}(a_${O}, u_${O}_t);
794
- #else
795
- ${D} ${N} ${O} = u_${O};
796
- #endif
797
- `}),staticAttributes:a,staticUniforms:y}}class hs{constructor(e,r,a){this.vertexBuffer=e,this.indexBuffer=r,this.segments=a}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}var mi=s.aG([{name:"a_pos",type:"Int16",components:2}]);const jn="#define PROJECTION_MERCATOR",Ot="mercator";class Us{constructor(){this._cachedMesh=null}get name(){return"mercator"}get useSubdivision(){return!1}get shaderVariantName(){return Ot}get shaderDefine(){return jn}get shaderPreludeCode(){return fi.projectionMercator}get vertexShaderPreludeCode(){return fi.projectionMercator.vertexSource}get subdivisionGranularity(){return s.aH.noSubdivision}get useGlobeControls(){return!1}get transitionState(){return 0}get latitudeErrorCorrectionRadians(){return 0}destroy(){}updateGPUdependent(e){}getMeshFromTileID(e,r,a,l,p){if(this._cachedMesh)return this._cachedMesh;const y=new s.aI;y.emplaceBack(0,0),y.emplaceBack(s.Z,0),y.emplaceBack(0,s.Z),y.emplaceBack(s.Z,s.Z);const w=e.createVertexBuffer(y,mi.members),A=s.aJ.simpleSegment(0,0,4,2),R=new s.aK;R.emplaceBack(1,0,2),R.emplaceBack(1,2,3);const D=e.createIndexBuffer(R);return this._cachedMesh=new hs(w,D,A),this._cachedMesh}recalculate(){}hasTransition(){return!1}setErrorQueryLatitudeDegrees(e){}}class js{constructor(e=0,r=0,a=0,l=0){if(isNaN(e)||e<0||isNaN(r)||r<0||isNaN(a)||a<0||isNaN(l)||l<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=r,this.left=a,this.right=l}interpolate(e,r,a){return r.top!=null&&e.top!=null&&(this.top=s.B.number(e.top,r.top,a)),r.bottom!=null&&e.bottom!=null&&(this.bottom=s.B.number(e.bottom,r.bottom,a)),r.left!=null&&e.left!=null&&(this.left=s.B.number(e.left,r.left,a)),r.right!=null&&e.right!=null&&(this.right=s.B.number(e.right,r.right,a)),this}getCenter(e,r){const a=s.ae((this.left+e-this.right)/2,0,e),l=s.ae((this.top+r-this.bottom)/2,0,r);return new s.P(a,l)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new js(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function ps(h,e){if(!h.renderWorldCopies||h.lngRange)return;const r=e.lng-h.center.lng;e.lng+=r>180?-360:r<-180?360:0}function ki(h){return Math.max(0,Math.floor(h))}class ti{constructor(e,r,a,l,p,y){this._callbacks=e,this._tileSize=512,this._renderWorldCopies=y===void 0||!!y,this._minZoom=r||0,this._maxZoom=a||22,this._minPitch=l??0,this._maxPitch=p??60,this.setMaxBounds(),this._width=0,this._height=0,this._center=new s.Q(0,0),this._elevation=0,this._zoom=0,this._tileZoom=ki(this._zoom),this._scale=s.ac(this._zoom),this._bearingInRadians=0,this._fovInRadians=.6435011087932844,this._pitchInRadians=0,this._rollInRadians=0,this._unmodified=!0,this._edgeInsets=new js,this._minElevationForCurrentTile=0,this._autoCalculateNearFarZ=!0}apply(e,r,a){this._latRange=e.latRange,this._lngRange=e.lngRange,this._width=e.width,this._height=e.height,this._center=e.center,this._elevation=e.elevation,this._minElevationForCurrentTile=e.minElevationForCurrentTile,this._zoom=e.zoom,this._tileZoom=ki(this._zoom),this._scale=s.ac(this._zoom),this._bearingInRadians=e.bearingInRadians,this._fovInRadians=e.fovInRadians,this._pitchInRadians=e.pitchInRadians,this._rollInRadians=e.rollInRadians,this._unmodified=e.unmodified,this._edgeInsets=new js(e.padding.top,e.padding.bottom,e.padding.left,e.padding.right),this._minZoom=e.minZoom,this._maxZoom=e.maxZoom,this._minPitch=e.minPitch,this._maxPitch=e.maxPitch,this._renderWorldCopies=e.renderWorldCopies,this._cameraToCenterDistance=e.cameraToCenterDistance,this._nearZ=e.nearZ,this._farZ=e.farZ,this._autoCalculateNearFarZ=!a&&e.autoCalculateNearFarZ,r&&this._constrain(),this._calcMatrices()}get pixelsToClipSpaceMatrix(){return this._pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._clipSpaceToPixelsMatrix}get minElevationForCurrentTile(){return this._minElevationForCurrentTile}setMinElevationForCurrentTile(e){this._minElevationForCurrentTile=e}get tileSize(){return this._tileSize}get tileZoom(){return this._tileZoom}get scale(){return this._scale}get width(){return this._width}get height(){return this._height}get bearingInRadians(){return this._bearingInRadians}get lngRange(){return this._lngRange}get latRange(){return this._latRange}get pixelsToGLUnits(){return this._pixelsToGLUnits}get minZoom(){return this._minZoom}setMinZoom(e){this._minZoom!==e&&(this._minZoom=e,this.setZoom(this.getConstrained(this._center,this.zoom).zoom))}get maxZoom(){return this._maxZoom}setMaxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.setZoom(this.getConstrained(this._center,this.zoom).zoom))}get minPitch(){return this._minPitch}setMinPitch(e){this._minPitch!==e&&(this._minPitch=e,this.setPitch(Math.max(this.pitch,e)))}get maxPitch(){return this._maxPitch}setMaxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.setPitch(Math.min(this.pitch,e)))}get renderWorldCopies(){return this._renderWorldCopies}setRenderWorldCopies(e){e===void 0?e=!0:e===null&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this._tileSize*this._scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new s.P(this._width,this._height)}get bearing(){return this._bearingInRadians/Math.PI*180}setBearing(e){const r=s.aL(e,-180,180)*Math.PI/180;var a,l,p,y,w,A,R,D,N;this._bearingInRadians!==r&&(this._unmodified=!1,this._bearingInRadians=r,this._calcMatrices(),this._rotationMatrix=P(),a=this._rotationMatrix,p=-this._bearingInRadians,y=(l=this._rotationMatrix)[0],w=l[1],A=l[2],R=l[3],D=Math.sin(p),N=Math.cos(p),a[0]=y*N+A*D,a[1]=w*N+R*D,a[2]=y*-D+A*N,a[3]=w*-D+R*N)}get rotationMatrix(){return this._rotationMatrix}get pitchInRadians(){return this._pitchInRadians}get pitch(){return this._pitchInRadians/Math.PI*180}setPitch(e){const r=s.ae(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitchInRadians!==r&&(this._unmodified=!1,this._pitchInRadians=r,this._calcMatrices())}get rollInRadians(){return this._rollInRadians}get roll(){return this._rollInRadians/Math.PI*180}setRoll(e){const r=e/180*Math.PI;this._rollInRadians!==r&&(this._unmodified=!1,this._rollInRadians=r,this._calcMatrices())}get fovInRadians(){return this._fovInRadians}get fov(){return s.aM(this._fovInRadians)}setFov(e){e=s.ae(e,.1,150),this.fov!==e&&(this._unmodified=!1,this._fovInRadians=s.ab(e),this._calcMatrices())}get zoom(){return this._zoom}setZoom(e){const r=this.getConstrained(this._center,e).zoom;this._zoom!==r&&(this._unmodified=!1,this._zoom=r,this._tileZoom=Math.max(0,Math.floor(r)),this._scale=s.ac(r),this._constrain(),this._calcMatrices())}get center(){return this._center}setCenter(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}setElevation(e){e!==this._elevation&&(this._elevation=e,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}setPadding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this._width,this._height)}get pixelsPerMeter(){return this._pixelPerMeter}get unmodified(){return this._unmodified}get cameraToCenterDistance(){return this._cameraToCenterDistance}get nearZ(){return this._nearZ}get farZ(){return this._farZ}get autoCalculateNearFarZ(){return this._autoCalculateNearFarZ}overrideNearFarZ(e,r){this._autoCalculateNearFarZ=!1,this._nearZ=e,this._farZ=r,this._calcMatrices()}clearNearFarZOverride(){this._autoCalculateNearFarZ=!0,this._calcMatrices()}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,r,a){this._unmodified=!1,this._edgeInsets.interpolate(e,r,a),this._constrain(),this._calcMatrices()}resize(e,r,a=!0){this._width=e,this._height=r,a&&this._constrain(),this._calcMatrices()}getMaxBounds(){return this._latRange&&this._latRange.length===2&&this._lngRange&&this._lngRange.length===2?new dt([this._lngRange[0],this._latRange[0]],[this._lngRange[1],this._latRange[1]]):null}setMaxBounds(e){e?(this._lngRange=[e.getWest(),e.getEast()],this._latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this._lngRange=null,this._latRange=[-85.051129,s.af])}getConstrained(e,r){return this._callbacks.getConstrained(e,r)}getCameraQueryGeometry(e,r){if(r.length===1)return[r[0],e];{let a=e.x,l=e.y,p=e.x,y=e.y;for(const w of r)a=Math.min(a,w.x),l=Math.min(l,w.y),p=Math.max(p,w.x),y=Math.max(y,w.y);return[new s.P(a,l),new s.P(p,l),new s.P(p,y),new s.P(a,y),new s.P(a,l)]}}_constrain(){if(!this.center||!this._width||!this._height||this._constraining)return;this._constraining=!0;const e=this._unmodified,{center:r,zoom:a}=this.getConstrained(this.center,this.zoom);this.setCenter(r),this.setZoom(a),this._unmodified=e,this._constraining=!1}_calcMatrices(){if(this._width&&this._height){this._pixelsToGLUnits=[2/this._width,-2/this._height];let e=s.ad(new Float64Array(16));s.M(e,e,[this._width/2,-this._height/2,1]),s.L(e,e,[1,-1,0]),this._clipSpaceToPixelsMatrix=e,e=s.ad(new Float64Array(16)),s.M(e,e,[1,-1,1]),s.L(e,e,[-1,-1,0]),s.M(e,e,[2/this._width,2/this._height,1]),this._pixelsToClipSpaceMatrix=e,this._cameraToCenterDistance=.5/Math.tan(this.fovInRadians/2)*this._height}this._callbacks.calcMatrices()}calculateCenterFromCameraLngLatAlt(e,r,a,l){const p=a!==void 0?a:this.bearing,y=l=l!==void 0?l:this.pitch,w=s.$.fromLngLat(e,r),A=-Math.cos(s.ab(y)),R=Math.sin(s.ab(y)),D=R*Math.sin(s.ab(p)),N=-R*Math.cos(s.ab(p));let O=this.elevation;const Z=r-O;let K;A*Z>=0||Math.abs(A)<.1?(K=1e4,O=r+K*A):K=-Z/A;let ne,ie,ae=s.aN(1,w.y),ue=0;do{if(ue+=1,ue>10)break;ie=K/ae,ne=new s.$(w.x+D*ie,w.y+N*ie),ae=1/ne.meterInMercatorCoordinateUnits()}while(Math.abs(K-ie*ae)>1e-12);return{center:ne.toLngLat(),elevation:O,zoom:s.ah(this.height/2/Math.tan(this.fovInRadians/2)/ie/this.tileSize)}}recalculateZoomAndCenter(e){if(this.elevation-e==0)return;const r=s.ag(1,this.center.lat)*this.worldSize,a=this.cameraToCenterDistance/r,l=s.$.fromLngLat(this.center,this.elevation),p=X(this.center,this.elevation,this.pitch,this.bearing,a);this._elevation=e;const y=this.calculateCenterFromCameraLngLatAlt(p.toLngLat(),s.aN(p.z,l.y),this.bearing,this.pitch);this._elevation=y.elevation,this._center=y.center,this.setZoom(y.zoom)}getCameraPoint(){const e=Math.tan(this.pitchInRadians)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new s.P(e*Math.sin(this.rollInRadians),e*Math.cos(this.rollInRadians)))}getCameraAltitude(){return Math.cos(this.pitchInRadians)*this._cameraToCenterDistance/this._pixelPerMeter+this.elevation}getCameraLngLat(){const e=s.ag(1,this.center.lat)*this.worldSize;return X(this.center,this.elevation,this.pitch,this.bearing,this.cameraToCenterDistance/e).toLngLat()}getMercatorTileCoordinates(e){if(!e)return[0,0,1,1];const r=e.canonical.z>=0?1<<e.canonical.z:Math.pow(2,e.canonical.z);return[e.canonical.x/r,e.canonical.y/r,1/r/s.Z,1/r/s.Z]}}class Ir{constructor(e,r){this.min=e,this.max=r,this.center=s.aO([],s.aP([],this.min,this.max),.5)}quadrant(e){const r=[e%2==0,e<2],a=s.aQ(this.min),l=s.aQ(this.max);for(let p=0;p<r.length;p++)a[p]=r[p]?this.min[p]:this.center[p],l[p]=r[p]?this.center[p]:this.max[p];return l[2]=this.max[2],new Ir(a,l)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}intersectsFrustum(e){let r=!0;for(let a=0;a<e.planes.length;a++){const l=this.intersectsPlane(e.planes[a]);if(l===0)return 0;l===1&&(r=!1)}return r?2:e.aabb.min[0]>this.max[0]||e.aabb.min[1]>this.max[1]||e.aabb.min[2]>this.max[2]||e.aabb.max[0]<this.min[0]||e.aabb.max[1]<this.min[1]||e.aabb.max[2]<this.min[2]?0:1}intersectsPlane(e){let r=e[3],a=e[3];for(let l=0;l<3;l++)e[l]>0?(r+=e[l]*this.min[l],a+=e[l]*this.max[l]):(a+=e[l]*this.min[l],r+=e[l]*this.max[l]);return r>=0?2:a<0?0:1}}class ri{distanceToTile2d(e,r,a,l){const p=l.distanceX([e,r]),y=l.distanceY([e,r]);return Math.hypot(p,y)}getWrap(e,r,a){return a}getTileAABB(e,r,a,l){var p,y;let w=a,A=a;if(l.terrain){const D=new s.Y(e.z,r,e.z,e.x,e.y),N=l.terrain.getMinMaxElevation(D);w=(p=N.minElevation)!==null&&p!==void 0?p:a,A=(y=N.maxElevation)!==null&&y!==void 0?y:a}const R=1<<e.z;return new Ir([r+e.x/R,e.y/R,w],[r+(e.x+1)/R,(e.y+1)/R,A])}allowVariableZoom(e,r){const a=e.fov*(Math.abs(Math.cos(e.rollInRadians))*e.height+Math.abs(Math.sin(e.rollInRadians))*e.width)/e.height,l=s.ae(78.5-a/2,0,60);return!!r.terrain||e.pitch>l}allowWorldCopies(){return!0}recalculateCache(){}}class ar{constructor(e,r,a){this.points=e,this.planes=r,this.aabb=a}static fromInvProjectionMatrix(e,r=1,a=0){const l=Math.pow(2,a),p=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(R=>{const D=1/(R=s.at([],R,e))[3]/r*l;return s.aR(R,R,[D,D,1/R[3],D])}),y=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(R=>{const D=s.aS([],p[R[0]],p[R[1]]),N=s.aS([],p[R[2]],p[R[1]]),O=s.aT([],s.aU([],D,N)),Z=-s.aV(O,p[R[1]]);return O.concat(Z)}),w=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],A=[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];for(const R of p)for(let D=0;D<3;D++)w[D]=Math.min(w[D],R[D]),A[D]=Math.max(A[D],R[D]);return new ar(p,y,new Ir(w,A))}}class ds{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(e){this._helper.setMinZoom(e)}setMaxZoom(e){this._helper.setMaxZoom(e)}setMinPitch(e){this._helper.setMinPitch(e)}setMaxPitch(e){this._helper.setMaxPitch(e)}setRenderWorldCopies(e){this._helper.setRenderWorldCopies(e)}setBearing(e){this._helper.setBearing(e)}setPitch(e){this._helper.setPitch(e)}setRoll(e){this._helper.setRoll(e)}setFov(e){this._helper.setFov(e)}setZoom(e){this._helper.setZoom(e)}setCenter(e){this._helper.setCenter(e)}setElevation(e){this._helper.setElevation(e)}setMinElevationForCurrentTile(e){this._helper.setMinElevationForCurrentTile(e)}setPadding(e){this._helper.setPadding(e)}interpolatePadding(e,r,a){return this._helper.interpolatePadding(e,r,a)}isPaddingEqual(e){return this._helper.isPaddingEqual(e)}resize(e,r,a=!0){this._helper.resize(e,r,a)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(e){this._helper.setMaxBounds(e)}overrideNearFarZ(e,r){this._helper.overrideNearFarZ(e,r)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(e){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),e)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(e,r){}constructor(e,r,a,l,p){this._posMatrixCache=new Map,this._alignedPosMatrixCache=new Map,this._fogMatrixCacheF32=new Map,this._helper=new ti({calcMatrices:()=>{this._calcMatrices()},getConstrained:(y,w)=>this.getConstrained(y,w)},e,r,a,l,p),this._coveringTilesDetailsProvider=new ri}clone(){const e=new ds;return e.apply(this),e}apply(e,r,a){this._helper.apply(e,r,a)}get cameraPosition(){return this._cameraPosition}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._viewProjMatrix}get inverseProjectionMatrix(){return this._invProjMatrix}get mercatorMatrix(){return this._mercatorMatrix}getVisibleUnwrappedCoordinates(e){const r=[new s.aW(0,e)];if(this._helper._renderWorldCopies){const a=this.screenPointToMercatorCoordinate(new s.P(0,0)),l=this.screenPointToMercatorCoordinate(new s.P(this._helper._width,0)),p=this.screenPointToMercatorCoordinate(new s.P(this._helper._width,this._helper._height)),y=this.screenPointToMercatorCoordinate(new s.P(0,this._helper._height)),w=Math.floor(Math.min(a.x,l.x,p.x,y.x)),A=Math.floor(Math.max(a.x,l.x,p.x,y.x)),R=1;for(let D=w-R;D<=A+R;D++)D!==0&&r.push(new s.aW(D,e))}return r}getCameraFrustum(){return ar.fromInvProjectionMatrix(this._invViewProjMatrix,this.worldSize)}getClippingPlane(){return null}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(e){const r=this.screenPointToLocation(this.centerPoint,e),a=e?e.getElevationForLngLatZoom(r,this._helper._tileZoom):0;this._helper.recalculateZoomAndCenter(a)}setLocationAtPoint(e,r){const a=s.ag(this.elevation,this.center.lat),l=this.screenPointToMercatorCoordinateAtZ(r,a),p=this.screenPointToMercatorCoordinateAtZ(this.centerPoint,a),y=s.$.fromLngLat(e),w=new s.$(y.x-(l.x-p.x),y.y-(l.y-p.y));this.setCenter(w==null?void 0:w.toLngLat()),this._helper._renderWorldCopies&&this.setCenter(this.center.wrap())}locationToScreenPoint(e,r){return r?this.coordinatePoint(s.$.fromLngLat(e),r.getElevationForLngLatZoom(e,this._helper._tileZoom),this._pixelMatrix3D):this.coordinatePoint(s.$.fromLngLat(e))}screenPointToLocation(e,r){var a;return(a=this.screenPointToMercatorCoordinate(e,r))===null||a===void 0?void 0:a.toLngLat()}screenPointToMercatorCoordinate(e,r){if(r){const a=r.pointCoordinate(e);if(a!=null)return a}return this.screenPointToMercatorCoordinateAtZ(e)}screenPointToMercatorCoordinateAtZ(e,r){const a=r||0,l=[e.x,e.y,0,1],p=[e.x,e.y,1,1];s.at(l,l,this._pixelMatrixInverse),s.at(p,p,this._pixelMatrixInverse);const y=l[3],w=p[3],A=l[1]/y,R=p[1]/w,D=l[2]/y,N=p[2]/w,O=D===N?0:(a-D)/(N-D);return new s.$(s.B.number(l[0]/y,p[0]/w,O)/this.worldSize,s.B.number(A,R,O)/this.worldSize,a)}coordinatePoint(e,r=0,a=this._pixelMatrix){const l=[e.x*this.worldSize,e.y*this.worldSize,r,1];return s.at(l,l,a),new s.P(l[0]/l[3],l[1]/l[3])}getBounds(){const e=Math.max(0,this._helper._height/2-we(this));return new dt().extend(this.screenPointToLocation(new s.P(0,e))).extend(this.screenPointToLocation(new s.P(this._helper._width,e))).extend(this.screenPointToLocation(new s.P(this._helper._width,this._helper._height))).extend(this.screenPointToLocation(new s.P(0,this._helper._height)))}isPointOnMapSurface(e,r){return r?r.pointCoordinate(e)!=null:e.y>this.height/2-we(this)}calculatePosMatrix(e,r=!1,a){var l;const p=(l=e.key)!==null&&l!==void 0?l:s.aX(e.wrap,e.canonical.z,e.canonical.z,e.canonical.x,e.canonical.y),y=r?this._alignedPosMatrixCache:this._posMatrixCache;if(y.has(p)){const R=y.get(p);return a?R.f32:R.f64}const w=Q(e,this.worldSize);s.N(w,r?this._alignedProjMatrix:this._viewProjMatrix,w);const A={f64:w,f32:new Float32Array(w)};return y.set(p,A),a?A.f32:A.f64}calculateFogMatrix(e){const r=e.key,a=this._fogMatrixCacheF32;if(a.has(r))return a.get(r);const l=Q(e,this.worldSize);return s.N(l,this._fogMatrix,l),a.set(r,new Float32Array(l)),a.get(r)}getConstrained(e,r){r=s.ae(+r,this.minZoom,this.maxZoom);const a={center:new s.Q(e.lng,e.lat),zoom:r};let l=this._helper._lngRange;this._helper._renderWorldCopies||l!==null||(l=[-179.9999999999,180-1e-10]);const p=this.tileSize*s.ac(a.zoom);let y=0,w=p,A=0,R=p,D=0,N=0;const{x:O,y:Z}=this.size;if(this._helper._latRange){const me=this._helper._latRange;y=s.S(me[1])*p,w=s.S(me[0])*p,w-y<Z&&(D=Z/(w-y))}l&&(A=s.aL(s.U(l[0])*p,0,p),R=s.aL(s.U(l[1])*p,0,p),R<A&&(R+=p),R-A<O&&(N=O/(R-A)));const{x:K,y:ne}=nr(p,e);let ie,ae;const ue=Math.max(N||0,D||0);if(ue){const me=new s.P(N?(R+A)/2:K,D?(w+y)/2:ne);return a.center=Vr(p,me).wrap(),a.zoom+=s.ah(ue),a}if(this._helper._latRange){const me=Z/2;ne-me<y&&(ae=y+me),ne+me>w&&(ae=w-me)}if(l){const me=(A+R)/2;let fe=K;this._helper._renderWorldCopies&&(fe=s.aL(K,me-p/2,me+p/2));const ge=O/2;fe-ge<A&&(ie=A+ge),fe+ge>R&&(ie=R-ge)}if(ie!==void 0||ae!==void 0){const me=new s.P(ie??K,ae??ne);a.center=Vr(p,me).wrap()}return a}calculateCenterFromCameraLngLatAlt(e,r,a,l){return this._helper.calculateCenterFromCameraLngLatAlt(e,r,a,l)}_calculateNearFarZIfNeeded(e,r,a){if(!this._helper.autoCalculateNearFarZ)return;const l=Math.min(this.elevation,this.minElevationForCurrentTile,this.getCameraAltitude()-100),p=e-l*this._helper._pixelPerMeter/Math.cos(r),y=l<0?p:e,w=Math.PI/2+this.pitchInRadians,A=s.ab(this.fov)*(Math.abs(Math.cos(s.ab(this.roll)))*this.height+Math.abs(Math.sin(s.ab(this.roll)))*this.width)/this.height*(.5+a.y/this.height),R=Math.sin(A)*y/Math.sin(s.ae(Math.PI-w-A,.01,Math.PI-.01)),D=we(this),N=Math.atan(D/this._helper.cameraToCenterDistance),O=s.ab(.75),Z=N>O?2*N*(.5+a.y/(2*D)):O,K=Math.sin(Z)*y/Math.sin(s.ae(Math.PI-w-Z,.01,Math.PI-.01)),ne=Math.min(R,K);this._helper._farZ=1.01*(Math.cos(Math.PI/2-r)*ne+y),this._helper._nearZ=this._helper._height/50}_calcMatrices(){if(!this._helper._height)return;const e=this.centerOffset,r=nr(this.worldSize,this.center),a=r.x,l=r.y;this._helper._pixelPerMeter=s.ag(1,this.center.lat)*this.worldSize;const p=s.ab(Math.min(this.pitch,Dr)),y=Math.max(this._helper.cameraToCenterDistance/2,this._helper.cameraToCenterDistance+this._helper._elevation*this._helper._pixelPerMeter/Math.cos(p));let w;this._calculateNearFarZIfNeeded(y,p,e),w=new Float64Array(16),s.aY(w,this.fovInRadians,this._helper._width/this._helper._height,this._helper._nearZ,this._helper._farZ),this._invProjMatrix=new Float64Array(16),s.an(this._invProjMatrix,w),w[8]=2*-e.x/this._helper._width,w[9]=2*e.y/this._helper._height,this._projectionMatrix=s.aZ(w),s.M(w,w,[1,-1,1]),s.L(w,w,[0,0,-this._helper.cameraToCenterDistance]),s.a_(w,w,-this.rollInRadians),s.a$(w,w,this.pitchInRadians),s.a_(w,w,-this.bearingInRadians),s.L(w,w,[-a,-l,0]),this._mercatorMatrix=s.M([],w,[this.worldSize,this.worldSize,this.worldSize]),s.M(w,w,[1,1,this._helper._pixelPerMeter]),this._pixelMatrix=s.N(new Float64Array(16),this.clipSpaceToPixelsMatrix,w),s.L(w,w,[0,0,-this.elevation]),this._viewProjMatrix=w,this._invViewProjMatrix=s.an([],w);const A=[0,0,-1,1];s.at(A,A,this._invViewProjMatrix),this._cameraPosition=[A[0]/A[3],A[1]/A[3],A[2]/A[3]],this._fogMatrix=new Float64Array(16),s.aY(this._fogMatrix,this.fovInRadians,this.width/this.height,y,this._helper._farZ),this._fogMatrix[8]=2*-e.x/this.width,this._fogMatrix[9]=2*e.y/this.height,s.M(this._fogMatrix,this._fogMatrix,[1,-1,1]),s.L(this._fogMatrix,this._fogMatrix,[0,0,-this.cameraToCenterDistance]),s.a_(this._fogMatrix,this._fogMatrix,-this.rollInRadians),s.a$(this._fogMatrix,this._fogMatrix,this.pitchInRadians),s.a_(this._fogMatrix,this._fogMatrix,-this.bearingInRadians),s.L(this._fogMatrix,this._fogMatrix,[-a,-l,0]),s.M(this._fogMatrix,this._fogMatrix,[1,1,this._helper._pixelPerMeter]),s.L(this._fogMatrix,this._fogMatrix,[0,0,-this.elevation]),this._pixelMatrix3D=s.N(new Float64Array(16),this.clipSpaceToPixelsMatrix,w);const R=this._helper._width%2/2,D=this._helper._height%2/2,N=Math.cos(this.bearingInRadians),O=Math.sin(-this.bearingInRadians),Z=a-Math.round(a)+N*R+O*D,K=l-Math.round(l)+N*D+O*R,ne=new Float64Array(w);if(s.L(ne,ne,[Z>.5?Z-1:Z,K>.5?K-1:K,0]),this._alignedProjMatrix=ne,w=s.an(new Float64Array(16),this._pixelMatrix),!w)throw new Error("failed to invert matrix");this._pixelMatrixInverse=w,this._clearMatrixCaches()}_clearMatrixCaches(){this._posMatrixCache.clear(),this._alignedPosMatrixCache.clear(),this._fogMatrixCacheF32.clear()}maxPitchScaleFactor(){if(!this._pixelMatrixInverse)return 1;const e=this.screenPointToMercatorCoordinate(new s.P(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return s.at(r,r,this._pixelMatrix)[3]/this._helper.cameraToCenterDistance}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){const e=s.ag(1,this.center.lat)*this.worldSize;return X(this.center,this.elevation,this.pitch,this.bearing,this._helper.cameraToCenterDistance/e).toLngLat()}lngLatToCameraDepth(e,r){const a=s.$.fromLngLat(e),l=[a.x*this.worldSize,a.y*this.worldSize,r,1];return s.at(l,l,this._viewProjMatrix),l[2]/l[3]}getProjectionData(e){const{overscaledTileID:r,aligned:a,applyTerrainMatrix:l}=e,p=this._helper.getMercatorTileCoordinates(r),y=r?this.calculatePosMatrix(r,a,!0):null;let w;return w=r&&r.terrainRttPosMatrix32f&&l?r.terrainRttPosMatrix32f:y||s.b0(),{mainMatrix:w,tileMercatorCoords:p,clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:w}}isLocationOccluded(e){return!1}getPixelScale(){return 1}getCircleRadiusCorrection(){return 1}getPitchedTextCorrection(e,r,a){return 1}transformLightDirection(e){return s.aQ(e)}getRayDirectionFromPixel(e){throw new Error("Not implemented.")}projectTileCoordinates(e,r,a,l){const p=this.calculatePosMatrix(a);let y;l?(y=[e,r,l(e,r),1],s.at(y,y,p)):(y=[e,r,0,1],On(y,y,p));const w=y[3];return{point:new s.P(y[0]/w,y[1]/w),signedDistanceFromCamera:w,isOccluded:!1}}populateCache(e){for(const r of e)this.calculatePosMatrix(r)}getMatrixForModel(e,r){const a=s.$.fromLngLat(e,r),l=a.meterInMercatorCoordinateUnits(),p=s.b1();return s.L(p,p,[a.x,a.y,a.z]),s.a_(p,p,Math.PI),s.a$(p,p,Math.PI/2),s.M(p,p,[-l,l,l]),p}getProjectionDataForCustomLayer(e=!0){const r=new s.Y(0,0,0,0,0),a=this.getProjectionData({overscaledTileID:r,applyGlobeMatrix:e}),l=Q(r,this.worldSize);s.N(l,this._viewProjMatrix,l),a.tileMercatorCoords=[0,0,1,1];const p=[s.Z,s.Z,this.worldSize/this._helper.pixelsPerMeter],y=s.b2();return s.M(y,l,p),a.fallbackMatrix=y,a.mainMatrix=y,a}getFastPathSimpleProjectionMatrix(e){return this.calculatePosMatrix(e)}}function gi(){s.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}function Mi(h){if(h.useSlerp)if(h.k<1){const e=s.b3(h.startEulerAngles.roll,h.startEulerAngles.pitch,h.startEulerAngles.bearing),r=s.b3(h.endEulerAngles.roll,h.endEulerAngles.pitch,h.endEulerAngles.bearing),a=new Float64Array(4);s.b4(a,e,r,h.k);const l=s.b5(a);h.tr.setRoll(l.roll),h.tr.setPitch(l.pitch),h.tr.setBearing(l.bearing)}else h.tr.setRoll(h.endEulerAngles.roll),h.tr.setPitch(h.endEulerAngles.pitch),h.tr.setBearing(h.endEulerAngles.bearing);else h.tr.setRoll(s.B.number(h.startEulerAngles.roll,h.endEulerAngles.roll,h.k)),h.tr.setPitch(s.B.number(h.startEulerAngles.pitch,h.endEulerAngles.pitch,h.k)),h.tr.setBearing(s.B.number(h.startEulerAngles.bearing,h.endEulerAngles.bearing,h.k))}function Ai(h,e,r,a,l){const p=l.padding,y=nr(l.worldSize,r.getNorthWest()),w=nr(l.worldSize,r.getNorthEast()),A=nr(l.worldSize,r.getSouthEast()),R=nr(l.worldSize,r.getSouthWest()),D=s.ab(-a),N=y.rotate(D),O=w.rotate(D),Z=A.rotate(D),K=R.rotate(D),ne=new s.P(Math.max(N.x,O.x,K.x,Z.x),Math.max(N.y,O.y,K.y,Z.y)),ie=new s.P(Math.min(N.x,O.x,K.x,Z.x),Math.min(N.y,O.y,K.y,Z.y)),ae=ne.sub(ie),ue=(l.width-(p.left+p.right+e.left+e.right))/ae.x,me=(l.height-(p.top+p.bottom+e.top+e.bottom))/ae.y;if(me<0||ue<0)return void gi();const fe=Math.min(s.ah(l.scale*Math.min(ue,me)),h.maxZoom),ge=s.P.convert(h.offset),xe=new s.P((e.left-e.right)/2,(e.top-e.bottom)/2).rotate(s.ab(a)),ye=ge.add(xe).mult(l.scale/s.ac(fe));return{center:Vr(l.worldSize,y.add(A).div(2).sub(ye)),zoom:fe,bearing:a}}class Ws{get useGlobeControls(){return!1}handlePanInertia(e,r){return{easingOffset:e,easingCenter:r.center}}handleMapControlsRollPitchBearingZoom(e,r){e.bearingDelta&&r.setBearing(r.bearing+e.bearingDelta),e.pitchDelta&&r.setPitch(r.pitch+e.pitchDelta),e.rollDelta&&r.setRoll(r.roll+e.rollDelta),e.zoomDelta&&r.setZoom(r.zoom+e.zoomDelta)}handleMapControlsPan(e,r,a){e.around.distSqr(r.centerPoint)<.01||r.setLocationAtPoint(a,e.around)}cameraForBoxAndBearing(e,r,a,l,p){return Ai(e,r,a,l,p)}handleJumpToCenterZoom(e,r){e.zoom!==(r.zoom!==void 0?+r.zoom:e.zoom)&&e.setZoom(+r.zoom),r.center!==void 0&&e.setCenter(s.Q.convert(r.center))}handleEaseTo(e,r){const a=e.zoom,l=e.padding,p={roll:e.roll,pitch:e.pitch,bearing:e.bearing},y={roll:r.roll===void 0?e.roll:r.roll,pitch:r.pitch===void 0?e.pitch:r.pitch,bearing:r.bearing===void 0?e.bearing:r.bearing},w=r.zoom!==void 0,A=!e.isPaddingEqual(r.padding);let R=!1;const D=w?+r.zoom:e.zoom;let N=e.centerPoint.add(r.offsetAsPoint);const O=e.screenPointToLocation(N),{center:Z,zoom:K}=e.getConstrained(s.Q.convert(r.center||O),D??a);ps(e,Z);const ne=nr(e.worldSize,O),ie=nr(e.worldSize,Z).sub(ne),ae=s.ac(K-a);return R=K!==a,{easeFunc:ue=>{if(R&&e.setZoom(s.B.number(a,K,ue)),s.b6(p,y)||Mi({startEulerAngles:p,endEulerAngles:y,tr:e,k:ue,useSlerp:p.roll!=y.roll}),A&&(e.interpolatePadding(l,r.padding,ue),N=e.centerPoint.add(r.offsetAsPoint)),r.around)e.setLocationAtPoint(r.around,r.aroundPoint);else{const me=s.ac(e.zoom-a),fe=K>a?Math.min(2,ae):Math.max(.5,ae),ge=Math.pow(fe,1-ue),xe=Vr(e.worldSize,ne.add(ie.mult(ue*ge)).mult(me));e.setLocationAtPoint(e.renderWorldCopies?xe.wrap():xe,N)}},isZooming:R,elevationCenter:Z}}handleFlyTo(e,r){const a=r.zoom!==void 0,l=e.zoom,p=e.getConstrained(s.Q.convert(r.center||r.locationAtOffset),a?+r.zoom:l),y=p.center,w=p.zoom;ps(e,y);const A=nr(e.worldSize,r.locationAtOffset),R=nr(e.worldSize,y).sub(A),D=R.mag(),N=s.ac(w-l);let O;if(r.minZoom!==void 0){const Z=Math.min(+r.minZoom,l,w),K=e.getConstrained(y,Z).zoom;O=s.ac(K-l)}return{easeFunc:(Z,K,ne,ie)=>{e.setZoom(Z===1?w:l+s.ah(K));const ae=Z===1?y:Vr(e.worldSize,A.add(R.mult(ne)).mult(K));e.setLocationAtPoint(e.renderWorldCopies?ae.wrap():ae,ie)},scaleOfZoom:N,targetCenter:y,scaleOfMinZoom:O,pixelPathLength:D}}}class $t{constructor(e,r,a){this.blendFunction=e,this.blendColor=r,this.mask=a}}$t.Replace=[1,0],$t.disabled=new $t($t.Replace,s.b7.transparent,[!1,!1,!1,!1]),$t.unblended=new $t($t.Replace,s.b7.transparent,[!0,!0,!0,!0]),$t.alphaBlended=new $t([1,771],s.b7.transparent,[!0,!0,!0,!0]);const br=2305;class Nt{constructor(e,r,a){this.enable=e,this.mode=r,this.frontFace=a}}Nt.disabled=new Nt(!1,1029,br),Nt.backCCW=new Nt(!0,1029,br),Nt.frontCCW=new Nt(!0,1028,br);class At{constructor(e,r,a){this.func=e,this.mask=r,this.range=a}}At.ReadOnly=!1,At.ReadWrite=!0,At.disabled=new At(519,At.ReadOnly,[0,1]);const fs=7680;class It{constructor(e,r,a,l,p,y){this.test=e,this.ref=r,this.mask=a,this.fail=l,this.depthFail=p,this.pass=y}}It.disabled=new It({func:519,mask:0},0,0,fs,fs,fs);const Ro=new WeakMap;function ci(h){var e;if(Ro.has(h))return Ro.get(h);{const r=(e=h.getParameter(h.VERSION))===null||e===void 0?void 0:e.startsWith("WebGL 2.0");return Ro.set(h,r),r}}class Wa{get awaitingQuery(){return!!this._readbackQueue}constructor(e){this._readbackWaitFrames=4,this._measureWaitFrames=6,this._texWidth=1,this._texHeight=1,this._measuredError=0,this._updateCount=0,this._lastReadbackFrame=-1e3,this._readbackQueue=null,this._cachedRenderContext=e;const r=e.context,a=r.gl;this._texFormat=a.RGBA,this._texType=a.UNSIGNED_BYTE;const l=new s.aI;l.emplaceBack(-1,-1),l.emplaceBack(2,-1),l.emplaceBack(-1,2);const p=new s.aK;p.emplaceBack(0,1,2),this._fullscreenTriangle=new hs(r.createVertexBuffer(l,mi.members),r.createIndexBuffer(p),s.aJ.simpleSegment(0,0,l.length,p.length)),this._resultBuffer=new Uint8Array(4),r.activeTexture.set(a.TEXTURE1);const y=a.createTexture();a.bindTexture(a.TEXTURE_2D,y),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.NEAREST),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.NEAREST),a.texImage2D(a.TEXTURE_2D,0,this._texFormat,this._texWidth,this._texHeight,0,this._texFormat,this._texType,null),this._fbo=r.createFramebuffer(this._texWidth,this._texHeight,!1,!1),this._fbo.colorAttachment.set(y),ci(a)&&(this._pbo=a.createBuffer(),a.bindBuffer(a.PIXEL_PACK_BUFFER,this._pbo),a.bufferData(a.PIXEL_PACK_BUFFER,4,a.STREAM_READ),a.bindBuffer(a.PIXEL_PACK_BUFFER,null))}destroy(){const e=this._cachedRenderContext.context.gl;this._fullscreenTriangle.destroy(),this._fbo.destroy(),e.deleteBuffer(this._pbo),this._fullscreenTriangle=null,this._fbo=null,this._pbo=null,this._resultBuffer=null}updateErrorLoop(e,r){const a=this._updateCount;return this._readbackQueue?a>=this._readbackQueue.frameNumberIssued+this._readbackWaitFrames&&this._tryReadback():a>=this._lastReadbackFrame+this._measureWaitFrames&&this._renderErrorTexture(e,r),this._updateCount++,this._measuredError}_bindFramebuffer(){const e=this._cachedRenderContext.context,r=e.gl;e.activeTexture.set(r.TEXTURE1),r.bindTexture(r.TEXTURE_2D,this._fbo.colorAttachment.get()),e.bindFramebuffer.set(this._fbo.framebuffer)}_renderErrorTexture(e,r){const a=this._cachedRenderContext.context,l=a.gl;if(this._bindFramebuffer(),a.viewport.set([0,0,this._texWidth,this._texHeight]),a.clear({color:s.b7.transparent}),this._cachedRenderContext.useProgram("projectionErrorMeasurement").draw(a,l.TRIANGLES,At.disabled,It.disabled,$t.unblended,Nt.disabled,((p,y)=>({u_input:p,u_output_expected:y}))(e,r),null,null,"$clipping",this._fullscreenTriangle.vertexBuffer,this._fullscreenTriangle.indexBuffer,this._fullscreenTriangle.segments),this._pbo&&ci(l)){l.bindBuffer(l.PIXEL_PACK_BUFFER,this._pbo),l.readBuffer(l.COLOR_ATTACHMENT0),l.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,0),l.bindBuffer(l.PIXEL_PACK_BUFFER,null);const p=l.fenceSync(l.SYNC_GPU_COMMANDS_COMPLETE,0);l.flush(),this._readbackQueue={frameNumberIssued:this._updateCount,sync:p}}else this._readbackQueue={frameNumberIssued:this._updateCount,sync:null}}_tryReadback(){const e=this._cachedRenderContext.context.gl;if(this._pbo&&this._readbackQueue&&ci(e)){const r=e.clientWaitSync(this._readbackQueue.sync,0,0);if(r===e.WAIT_FAILED)return s.w("WebGL2 clientWaitSync failed."),this._readbackQueue=null,void(this._lastReadbackFrame=this._updateCount);if(r===e.TIMEOUT_EXPIRED)return;e.bindBuffer(e.PIXEL_PACK_BUFFER,this._pbo),e.getBufferSubData(e.PIXEL_PACK_BUFFER,0,this._resultBuffer,0,4),e.bindBuffer(e.PIXEL_PACK_BUFFER,null)}else this._bindFramebuffer(),e.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,this._resultBuffer);this._readbackQueue=null,this._measuredError=Wa._parseRGBA8float(this._resultBuffer),this._lastReadbackFrame=this._updateCount}static _parseRGBA8float(e){let r=0;return r+=e[0]/256,r+=e[1]/65536,r+=e[2]/16777216,e[3]<127&&(r=-r),r/128}}const Ha=s.Z/128;function Hs(h,e){const r=h.granularity!==void 0?Math.max(h.granularity,1):1,a=r+(h.generateBorders?2:0),l=r+(h.extendToNorthPole||h.generateBorders?1:0)+(h.extendToSouthPole||h.generateBorders?1:0),p=a+1,y=l+1,w=h.generateBorders?-1:0,A=h.generateBorders||h.extendToNorthPole?-1:0,R=r+(h.generateBorders?1:0),D=r+(h.generateBorders||h.extendToSouthPole?1:0),N=p*y,O=a*l*6,Z=p*y>65536;if(Z&&e==="16bit")throw new Error("Granularity is too large and meshes would not fit inside 16 bit vertex indices.");const K=Z||e==="32bit",ne=new Int16Array(2*N);let ie=0;for(let me=A;me<=D;me++)for(let fe=w;fe<=R;fe++){let ge=fe/r*s.Z;fe===-1&&(ge=-64),fe===r+1&&(ge=s.Z+Ha);let xe=me/r*s.Z;me===-1&&(xe=h.extendToNorthPole?s.b9:-64),me===r+1&&(xe=h.extendToSouthPole?s.ba:s.Z+Ha),ne[ie++]=ge,ne[ie++]=xe}const ae=K?new Uint32Array(O):new Uint16Array(O);let ue=0;for(let me=0;me<l;me++)for(let fe=0;fe<a;fe++){const ge=fe+1+me*p,xe=fe+(me+1)*p,ye=fe+1+(me+1)*p;ae[ue++]=fe+me*p,ae[ue++]=xe,ae[ue++]=ge,ae[ue++]=ge,ae[ue++]=xe,ae[ue++]=ye}return{vertices:ne.buffer.slice(0),indices:ae.buffer.slice(0),uses32bitIndices:K}}const ms=new s.aH({fill:new s.bb(128,2),line:new s.bb(512,0),tile:new s.bb(128,32),stencil:new s.bb(128,1),circle:3});class Zs{constructor(){this._tileMeshCache={},this._errorCorrectionUsable=0,this._errorMeasurementLastValue=0,this._errorCorrectionPreviousValue=0,this._errorMeasurementLastChangeTime=-1e3}get name(){return"vertical-perspective"}get transitionState(){return 1}get useSubdivision(){return!0}get shaderVariantName(){return"globe"}get shaderDefine(){return"#define GLOBE"}get shaderPreludeCode(){return fi.projectionGlobe}get vertexShaderPreludeCode(){return fi.projectionMercator.vertexSource}get subdivisionGranularity(){return ms}get useGlobeControls(){return!0}get latitudeErrorCorrectionRadians(){return this._errorCorrectionUsable}destroy(){this._errorMeasurement&&this._errorMeasurement.destroy()}updateGPUdependent(e){this._errorMeasurement||(this._errorMeasurement=new Wa(e));const r=s.S(this._errorQueryLatitudeDegrees),a=2*Math.atan(Math.exp(Math.PI-r*Math.PI*2))-.5*Math.PI,l=this._errorMeasurement.updateErrorLoop(r,a),p=M.now();l!==this._errorMeasurementLastValue&&(this._errorCorrectionPreviousValue=this._errorCorrectionUsable,this._errorMeasurementLastValue=l,this._errorMeasurementLastChangeTime=p);const y=Math.min(Math.max((p-this._errorMeasurementLastChangeTime)/1e3/.5,0),1);this._errorCorrectionUsable=s.bc(this._errorCorrectionPreviousValue,-this._errorMeasurementLastValue,s.bd(y))}_getMeshKey(e){return`${e.granularity.toString(36)}_${e.generateBorders?"b":""}${e.extendToNorthPole?"n":""}${e.extendToSouthPole?"s":""}`}getMeshFromTileID(e,r,a,l,p){const y=(p==="stencil"?ms.stencil:ms.tile).getGranularityForZoomLevel(r.z);return this._getMesh(e,{granularity:y,generateBorders:a,extendToNorthPole:r.y===0&&l,extendToSouthPole:r.y===(1<<r.z)-1&&l})}_getMesh(e,r){const a=this._getMeshKey(r);if(a in this._tileMeshCache)return this._tileMeshCache[a];const l=function(p,y){const w=Hs(y,"16bit"),A=s.aI.deserialize({arrayBuffer:w.vertices,length:w.vertices.byteLength/2/2}),R=s.aK.deserialize({arrayBuffer:w.indices,length:w.indices.byteLength/2/3});return new hs(p.createVertexBuffer(A,mi.members),p.createIndexBuffer(R),s.aJ.simpleSegment(0,0,A.length,R.length))}(e,r);return this._tileMeshCache[a]=l,l}recalculate(e){}hasTransition(){const e=M.now();let r=!1;return r=r||(e-this._errorMeasurementLastChangeTime)/1e3<.7,r=r||this._errorMeasurement&&this._errorMeasurement.awaitingQuery,r}setErrorQueryLatitudeDegrees(e){this._errorQueryLatitudeDegrees=e}}const Za=new s.r({type:new s.D(s.v.projection.type)});class Bo extends s.E{constructor(e){super(),this._transitionable=new s.T(Za),this.setProjection(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new s.C(0)),this._mercatorProjection=new Us,this._verticalPerspectiveProjection=new Zs}get transitionState(){const e=this.properties.get("type");if(typeof e=="string"&&e==="mercator")return 0;if(typeof e=="string"&&e==="vertical-perspective")return 1;if(e instanceof s.be){if(e.from==="vertical-perspective"&&e.to==="mercator")return 1-e.transition;if(e.from==="mercator"&&e.to==="vertical-perspective")return e.transition}return 1}get useGlobeRendering(){return this.transitionState>0}get latitudeErrorCorrectionRadians(){return this._verticalPerspectiveProjection.latitudeErrorCorrectionRadians}get currentProjection(){return this.useGlobeRendering?this._verticalPerspectiveProjection:this._mercatorProjection}get name(){return"globe"}get useSubdivision(){return this.currentProjection.useSubdivision}get shaderVariantName(){return this.currentProjection.shaderVariantName}get shaderDefine(){return this.currentProjection.shaderDefine}get shaderPreludeCode(){return this.currentProjection.shaderPreludeCode}get vertexShaderPreludeCode(){return this.currentProjection.vertexShaderPreludeCode}get subdivisionGranularity(){return this.currentProjection.subdivisionGranularity}get useGlobeControls(){return this.transitionState>0}destroy(){this._mercatorProjection.destroy(),this._verticalPerspectiveProjection.destroy()}updateGPUdependent(e){this._mercatorProjection.updateGPUdependent(e),this._verticalPerspectiveProjection.updateGPUdependent(e)}getMeshFromTileID(e,r,a,l,p){return this.currentProjection.getMeshFromTileID(e,r,a,l,p)}setProjection(e){this._transitionable.setValue("type",(e==null?void 0:e.type)||"mercator")}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()||this.currentProjection.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}setErrorQueryLatitudeDegrees(e){this._verticalPerspectiveProjection.setErrorQueryLatitudeDegrees(e),this._mercatorProjection.setErrorQueryLatitudeDegrees(e)}}function Ks(h){const e=Hn(h.worldSize,h.center.lat);return 2*Math.PI*e}function Wn(h,e,r,a,l){const p=1/(1<<l),y=e/s.Z*p+a*p,w=s.bg((h/s.Z*p+r*p)*Math.PI*2+Math.PI,2*Math.PI),A=2*Math.atan(Math.exp(Math.PI-y*Math.PI*2))-.5*Math.PI,R=Math.cos(A),D=new Float64Array(3);return D[0]=Math.sin(w)*R,D[1]=Math.sin(A),D[2]=Math.cos(w)*R,D}function Gr(h){return function(e,r){const a=Math.cos(r),l=new Float64Array(3);return l[0]=Math.sin(e)*a,l[1]=Math.sin(r),l[2]=Math.cos(e)*a,l}(h.lng*Math.PI/180,h.lat*Math.PI/180)}function Hn(h,e){return h/(2*Math.PI)/Math.cos(e*Math.PI/180)}function Gs(h){const e=Math.asin(h[1])/Math.PI*180,r=Math.sqrt(h[0]*h[0]+h[2]*h[2]);if(r>1e-6){const a=h[0]/r,l=Math.acos(h[2]/r),p=(a>0?l:-l)/Math.PI*180;return new s.Q(s.aL(p,-180,180),e)}return new s.Q(0,e)}function An(h){return Math.cos(h*Math.PI/180)}function Jr(h,e){const r=An(h),a=An(e);return s.ah(a/r)}function Do(h,e){const r=h.rotate(e.bearingInRadians),a=e.zoom+Jr(e.center.lat,0),l=s.bc(1/An(e.center.lat),1/An(Math.min(Math.abs(e.center.lat),60)),s.bf(a,7,3,0,1)),p=360/Ks({worldSize:e.worldSize,center:{lat:e.center.lat}});return new s.Q(e.center.lng-r.x*p*l,s.ae(e.center.lat+r.y*p,-85.051129,s.af))}function Vo(h){const e=.5*h,r=Math.sin(e),a=Math.cos(e);return Math.log(r+a)-Math.log(a-r)}function dc(h,e,r,a){const l=h.lat+r*a;if(Math.abs(r)>1){const p=(Math.sign(h.lat+r)!==Math.sign(h.lat)?-Math.abs(h.lat):Math.abs(h.lat))*Math.PI/180,y=Math.abs(h.lat+r)*Math.PI/180,w=Vo(p+a*(y-p)),A=Vo(p),R=Vo(y);return new s.Q(h.lng+e*((w-A)/(R-A)),l)}return new s.Q(h.lng+e*a,l)}class vh{constructor(e){this._cachePrevious=new Map,this._cache=new Map,this._hadAnyChanges=!1,this._aabbFactory=e}recalculateCache(){if(!this._hadAnyChanges)return;const e=this._cachePrevious;this._cachePrevious=this._cache,this._cache=e,this._cache.clear(),this._hadAnyChanges=!1}getTileAABB(e,r,a,l){const p=`${e.z}_${e.x}_${e.y}`,y=this._cache.get(p);if(y)return y;const w=this._cachePrevious.get(p);if(w)return this._cache.set(p,w),w;const A=this._aabbFactory(e,r,a,l);return this._cache.set(p,A),this._hadAnyChanges=!0,A}}function ui(h,e,r){const a=h-e;return a<0?-a:Math.max(0,a-r)}function Js(h,e,r,a,l){const p=h-r;let y;return y=p<0?Math.min(-p,1+p-l):p>1?Math.min(Math.max(p-l,0),1-p):0,Math.max(y,ui(e,a,l))}class sn{constructor(){this._aabbCache=new vh(this._computeTileAABB)}recalculateCache(){this._aabbCache.recalculateCache()}distanceToTile2d(e,r,a,l){const p=1<<a.z,y=1/p,w=a.x/p,A=a.y/p;let R=2;return R=Math.min(R,Js(e,r,w,A,y)),R=Math.min(R,Js(e,r,w+.5,-A-y,y)),R=Math.min(R,Js(e,r,w+.5,2-A-y,y)),R}getWrap(e,r,a){const l=1<<r.z,p=1/l,y=r.x/l,w=ui(e.x,y,p),A=ui(e.x,y-1,p),R=ui(e.x,y+1,p),D=Math.min(w,A,R);return D===R?1:D===A?-1:0}allowVariableZoom(e,r){return Pe(e,r)>4}allowWorldCopies(){return!1}getTileAABB(e,r,a,l){return this._aabbCache.getTileAABB(e,r,a,l)}_computeTileAABB(e,r,a,l){if(e.z<=0)return new Ir([-1,-1,-1],[1,1,1]);if(e.z===1)return new Ir([e.x===0?-1:0,e.y===0?0:-1,-1],[e.x===0?0:1,e.y===0?1:0,1]);{const p=[Wn(0,0,e.x,e.y,e.z),Wn(s.Z,0,e.x,e.y,e.z),Wn(s.Z,s.Z,e.x,e.y,e.z),Wn(0,s.Z,e.x,e.y,e.z)],y=[1,1,1],w=[-1,-1,-1];for(const A of p)for(let R=0;R<3;R++)y[R]=Math.min(y[R],A[R]),w[R]=Math.max(w[R],A[R]);if(e.y===0||e.y===(1<<e.z)-1){const A=[0,e.y===0?1:-1,0];for(let R=0;R<3;R++)y[R]=Math.min(y[R],A[R]),w[R]=Math.max(w[R],A[R])}return new Ir(y,w)}}}class Zn{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(e){this._helper.setMinZoom(e)}setMaxZoom(e){this._helper.setMaxZoom(e)}setMinPitch(e){this._helper.setMinPitch(e)}setMaxPitch(e){this._helper.setMaxPitch(e)}setRenderWorldCopies(e){this._helper.setRenderWorldCopies(e)}setBearing(e){this._helper.setBearing(e)}setPitch(e){this._helper.setPitch(e)}setRoll(e){this._helper.setRoll(e)}setFov(e){this._helper.setFov(e)}setZoom(e){this._helper.setZoom(e)}setCenter(e){this._helper.setCenter(e)}setElevation(e){this._helper.setElevation(e)}setMinElevationForCurrentTile(e){this._helper.setMinElevationForCurrentTile(e)}setPadding(e){this._helper.setPadding(e)}interpolatePadding(e,r,a){return this._helper.interpolatePadding(e,r,a)}isPaddingEqual(e){return this._helper.isPaddingEqual(e)}resize(e,r){this._helper.resize(e,r)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(e){this._helper.setMaxBounds(e)}overrideNearFarZ(e,r){this._helper.overrideNearFarZ(e,r)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(e){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),e)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(e){}constructor(){this._cachedClippingPlane=s.bk(),this._projectionMatrix=s.b1(),this._globeViewProjMatrix32f=s.b0(),this._globeViewProjMatrixNoCorrection=s.b1(),this._globeViewProjMatrixNoCorrectionInverted=s.b1(),this._globeProjMatrixInverted=s.b1(),this._cameraPosition=s.bh(),this._globeLatitudeErrorCorrectionRadians=0,this._helper=new ti({calcMatrices:()=>{this._calcMatrices()},getConstrained:(e,r)=>this.getConstrained(e,r)}),this._coveringTilesDetailsProvider=new sn}clone(){const e=new Zn;return e.apply(this),e}apply(e,r){this._globeLatitudeErrorCorrectionRadians=r||0,this._helper.apply(e)}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._globeViewProjMatrixNoCorrection}get inverseProjectionMatrix(){return this._globeProjMatrixInverted}get cameraPosition(){const e=s.bh();return e[0]=this._cameraPosition[0],e[1]=this._cameraPosition[1],e[2]=this._cameraPosition[2],e}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}getProjectionData(e){const{overscaledTileID:r,applyGlobeMatrix:a}=e,l=this._helper.getMercatorTileCoordinates(r);return{mainMatrix:this._globeViewProjMatrix32f,tileMercatorCoords:l,clippingPlane:this._cachedClippingPlane,projectionTransition:a?1:0,fallbackMatrix:this._globeViewProjMatrix32f}}_computeClippingPlane(e){const r=this.pitchInRadians,a=this.cameraToCenterDistance/e,l=Math.sin(r)*a,p=Math.cos(r)*a+1,y=1/Math.sqrt(l*l+p*p)*1;let w=-l,A=p;const R=Math.sqrt(w*w+A*A);w/=R,A/=R;const D=[0,w,A];s.bl(D,D,[0,0,0],-this.bearingInRadians),s.bm(D,D,[0,0,0],-1*this.center.lat*Math.PI/180),s.bn(D,D,[0,0,0],this.center.lng*Math.PI/180);const N=1/s.bo(D);return s.aO(D,D,N),[...D,-y*N]}isLocationOccluded(e){return!this.isSurfacePointVisible(Gr(e))}transformLightDirection(e){const r=this._helper._center.lng*Math.PI/180,a=this._helper._center.lat*Math.PI/180,l=Math.cos(a),p=[Math.sin(r)*l,Math.sin(a),Math.cos(r)*l],y=[p[2],0,-p[0]],w=[0,0,0];s.aU(w,y,p),s.aT(y,y),s.aT(w,w);const A=[0,0,0];return s.aT(A,[y[0]*e[0]+w[0]*e[1]+p[0]*e[2],y[1]*e[0]+w[1]*e[1]+p[1]*e[2],y[2]*e[0]+w[2]*e[1]+p[2]*e[2]]),A}getPixelScale(){return 1/Math.cos(this._helper._center.lat*Math.PI/180)}getCircleRadiusCorrection(){return Math.cos(this._helper._center.lat*Math.PI/180)}getPitchedTextCorrection(e,r,a){const l=function(w,A,R){const D=1/(1<<R.z);return new s.$(w/s.Z*D+R.x*D,A/s.Z*D+R.y*D)}(e,r,a.canonical),p=(y=l.y,[s.bg(l.x*Math.PI*2+Math.PI,2*Math.PI),2*Math.atan(Math.exp(Math.PI-y*Math.PI*2))-.5*Math.PI]);var y;return this.getCircleRadiusCorrection()/Math.cos(p[1])}projectTileCoordinates(e,r,a,l){const p=a.canonical,y=Wn(e,r,p.x,p.y,p.z),w=1+(l?l(e,r):0)/s.bu,A=[y[0]*w,y[1]*w,y[2]*w,1];s.at(A,A,this._globeViewProjMatrixNoCorrection);const R=this._cachedClippingPlane,D=R[0]*y[0]+R[1]*y[1]+R[2]*y[2]+R[3]<0;return{point:new s.P(A[0]/A[3],A[1]/A[3]),signedDistanceFromCamera:A[3],isOccluded:D}}_calcMatrices(){if(!this._helper._width||!this._helper._height)return;const e=Hn(this.worldSize,this.center.lat),r=s.b2(),a=s.b2();this._helper.autoCalculateNearFarZ&&(this._helper._nearZ=.5,this._helper._farZ=this.cameraToCenterDistance+2*e),s.aY(r,this.fovInRadians,this.width/this.height,this._helper._nearZ,this._helper._farZ);const l=this.centerOffset;r[8]=2*-l.x/this._helper._width,r[9]=2*l.y/this._helper._height,this._projectionMatrix=s.aZ(r),this._globeProjMatrixInverted=s.b2(),s.an(this._globeProjMatrixInverted,r),s.L(r,r,[0,0,-this.cameraToCenterDistance]),s.a_(r,r,this.rollInRadians),s.a$(r,r,-this.pitchInRadians),s.a_(r,r,this.bearingInRadians),s.L(r,r,[0,0,-e]);const p=s.bh();p[0]=e,p[1]=e,p[2]=e,s.a$(a,r,this.center.lat*Math.PI/180),s.bp(a,a,-this.center.lng*Math.PI/180),s.M(a,a,p),this._globeViewProjMatrixNoCorrection=a,s.a$(r,r,this.center.lat*Math.PI/180-this._globeLatitudeErrorCorrectionRadians),s.bp(r,r,-this.center.lng*Math.PI/180),s.M(r,r,p),this._globeViewProjMatrix32f=new Float32Array(r),this._globeViewProjMatrixNoCorrectionInverted=s.b2(),s.an(this._globeViewProjMatrixNoCorrectionInverted,a);const y=s.bh();this._cameraPosition=s.bh(),this._cameraPosition[2]=this.cameraToCenterDistance/e,s.bl(this._cameraPosition,this._cameraPosition,y,-this.rollInRadians),s.bm(this._cameraPosition,this._cameraPosition,y,this.pitchInRadians),s.bl(this._cameraPosition,this._cameraPosition,y,-this.bearingInRadians),s.aP(this._cameraPosition,this._cameraPosition,[0,0,1]),s.bm(this._cameraPosition,this._cameraPosition,y,-this.center.lat*Math.PI/180),s.bn(this._cameraPosition,this._cameraPosition,y,this.center.lng*Math.PI/180),this._cachedClippingPlane=this._computeClippingPlane(e);const w=s.aZ(this._globeViewProjMatrixNoCorrectionInverted);s.M(w,w,[1,1,-1]),this._cachedFrustum=ar.fromInvProjectionMatrix(w)}calculateFogMatrix(e){s.w("calculateFogMatrix is not supported on globe projection.");const r=s.b2();return s.ad(r),r}getVisibleUnwrappedCoordinates(e){return[new s.aW(0,e)]}getCameraFrustum(){return this._cachedFrustum}getClippingPlane(){return this._cachedClippingPlane}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(e){e&&s.w("terrain is not fully supported on vertical perspective projection."),this._helper.recalculateZoomAndCenter(0)}maxPitchScaleFactor(){return 1}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(e,r){if(!this._globeViewProjMatrixNoCorrection)return 1;const a=Gr(e);s.aO(a,a,1+r/s.bu);const l=s.bk();return s.at(l,[a[0],a[1],a[2],1],this._globeViewProjMatrixNoCorrection),l[2]/l[3]}populateCache(e){}getBounds(){const e=.5*this.width,r=.5*this.height,a=[new s.P(0,0),new s.P(e,0),new s.P(this.width,0),new s.P(this.width,r),new s.P(this.width,this.height),new s.P(e,this.height),new s.P(0,this.height),new s.P(0,r)],l=[];for(const N of a)l.push(this.unprojectScreenPoint(N));let p=0,y=0,w=0,A=0;const R=this.center;for(const N of l){const O=s.bq(R.lng,N.lng),Z=s.bq(R.lat,N.lat);O<y&&(y=O),O>p&&(p=O),Z<A&&(A=Z),Z>w&&(w=Z)}const D=[R.lng+y,R.lat+A,R.lng+p,R.lat+w];return this.isSurfacePointOnScreen([0,1,0])&&(D[3]=90,D[0]=-180,D[2]=180),this.isSurfacePointOnScreen([0,-1,0])&&(D[1]=-90,D[0]=-180,D[2]=180),new dt(D)}getConstrained(e,r){const a=s.ae(e.lat,-85.051129,s.af),l=s.ae(+r,this.minZoom+Jr(0,a),this.maxZoom);return{center:new s.Q(e.lng,a),zoom:l}}calculateCenterFromCameraLngLatAlt(e,r,a,l){return this._helper.calculateCenterFromCameraLngLatAlt(e,r,a,l)}setLocationAtPoint(e,r){const a=Gr(this.unprojectScreenPoint(r)),l=Gr(e),p=s.bh();s.br(p);const y=s.bh();s.bn(y,a,p,-this.center.lng*Math.PI/180),s.bm(y,y,p,this.center.lat*Math.PI/180);const w=l[0]*l[0]+l[2]*l[2],A=y[0]*y[0];if(w<A)return;const R=Math.sqrt(w-A),D=-R,N=s.bs(l[0],l[2],y[0],R),O=s.bs(l[0],l[2],y[0],D),Z=s.bh();s.bn(Z,l,p,-N);const K=s.bs(Z[1],Z[2],y[1],y[2]),ne=s.bh();s.bn(ne,l,p,-O);const ie=s.bs(ne[1],ne[2],y[1],y[2]),ae=.5*Math.PI,ue=K>=-ae&&K<=ae,me=ie>=-ae&&ie<=ae;let fe,ge;if(ue&&me){const Fe=this.center.lng*Math.PI/180,Le=this.center.lat*Math.PI/180;s.bv(N,Fe)+s.bv(K,Le)<s.bv(O,Fe)+s.bv(ie,Le)?(fe=N,ge=K):(fe=O,ge=ie)}else if(ue)fe=N,ge=K;else{if(!me)return;fe=O,ge=ie}const xe=fe/Math.PI*180,ye=ge/Math.PI*180,Te=this.center.lat;this.setCenter(new s.Q(xe,s.ae(ye,-90,90))),this.setZoom(this.zoom+Jr(Te,this.center.lat))}locationToScreenPoint(e,r){const a=Gr(e);if(r){const l=r.getElevationForLngLatZoom(e,this._helper._tileZoom);s.aO(a,a,1+l/s.bu)}return this._projectSurfacePointToScreen(a)}_projectSurfacePointToScreen(e){const r=s.bk();return s.at(r,[...e,1],this._globeViewProjMatrixNoCorrection),r[0]/=r[3],r[1]/=r[3],new s.P((.5*r[0]+.5)*this.width,(.5*-r[1]+.5)*this.height)}screenPointToMercatorCoordinate(e,r){if(r){const a=r.pointCoordinate(e);if(a)return a}return s.$.fromLngLat(this.unprojectScreenPoint(e))}screenPointToLocation(e,r){var a;return(a=this.screenPointToMercatorCoordinate(e,r))===null||a===void 0?void 0:a.toLngLat()}isPointOnMapSurface(e,r){const a=this._cameraPosition,l=this.getRayDirectionFromPixel(e);return!!this.rayPlanetIntersection(a,l)}getRayDirectionFromPixel(e){const r=s.bk();r[0]=e.x/this.width*2-1,r[1]=-1*(e.y/this.height*2-1),r[2]=1,r[3]=1,s.at(r,r,this._globeViewProjMatrixNoCorrectionInverted),r[0]/=r[3],r[1]/=r[3],r[2]/=r[3];const a=s.bh();a[0]=r[0]-this._cameraPosition[0],a[1]=r[1]-this._cameraPosition[1],a[2]=r[2]-this._cameraPosition[2];const l=s.bh();return s.aT(l,a),l}isSurfacePointVisible(e){const r=this._cachedClippingPlane;return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]+r[3]>=0}isSurfacePointOnScreen(e){if(!this.isSurfacePointVisible(e))return!1;const r=s.bk();return s.at(r,[...e,1],this._globeViewProjMatrixNoCorrection),r[0]/=r[3],r[1]/=r[3],r[2]/=r[3],r[0]>-1&&r[0]<1&&r[1]>-1&&r[1]<1&&r[2]>-1&&r[2]<1}rayPlanetIntersection(e,r){const a=s.aV(e,r),l=s.bh(),p=s.bh();s.aO(p,r,a),s.aS(l,e,p);const y=1-s.aV(l,l);if(y<0)return null;const w=s.aV(e,e)-1,A=-a+(a<0?1:-1)*Math.sqrt(y),R=w/A,D=A;return{tMin:Math.min(R,D),tMax:Math.max(R,D)}}unprojectScreenPoint(e){const r=this._cameraPosition,a=this.getRayDirectionFromPixel(e),l=this.rayPlanetIntersection(r,a);if(l){const D=s.bh();s.aP(D,r,[a[0]*l.tMin,a[1]*l.tMin,a[2]*l.tMin]);const N=s.bh();return s.aT(N,D),Gs(N)}const p=this._cachedClippingPlane,y=p[0]*a[0]+p[1]*a[1]+p[2]*a[2],w=-s.bt(p,r)/y,A=s.bh();if(w>0)s.aP(A,r,[a[0]*w,a[1]*w,a[2]*w]);else{const D=s.bh();s.aP(D,r,[2*a[0],2*a[1],2*a[2]]);const N=s.bt(this._cachedClippingPlane,D);s.aS(A,D,[this._cachedClippingPlane[0]*N,this._cachedClippingPlane[1]*N,this._cachedClippingPlane[2]*N])}const R=function(D){const N=s.bh();return N[0]=D[0]*-D[3],N[1]=D[1]*-D[3],N[2]=D[2]*-D[3],{center:N,radius:Math.sqrt(1-D[3]*D[3])}}(p);return Gs(function(D,N,O){const Z=s.bh();s.aS(Z,O,D);const K=s.bh();return s.bi(K,D,Z,N/s.bj(Z)),K}(R.center,R.radius,A))}getMatrixForModel(e,r){const a=s.Q.convert(e),l=1/s.bu,p=s.b1();return s.bp(p,p,a.lng/180*Math.PI),s.a$(p,p,-a.lat/180*Math.PI),s.L(p,p,[0,0,1+r/s.bu]),s.a$(p,p,.5*Math.PI),s.M(p,p,[l,l,l]),p}getProjectionDataForCustomLayer(e=!0){const r=this.getProjectionData({overscaledTileID:new s.Y(0,0,0,0,0),applyGlobeMatrix:e});return r.tileMercatorCoords=[0,0,1,1],r}getFastPathSimpleProjectionMatrix(e){}}class Xs{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(e){this._helper.setMinZoom(e)}setMaxZoom(e){this._helper.setMaxZoom(e)}setMinPitch(e){this._helper.setMinPitch(e)}setMaxPitch(e){this._helper.setMaxPitch(e)}setRenderWorldCopies(e){this._helper.setRenderWorldCopies(e)}setBearing(e){this._helper.setBearing(e)}setPitch(e){this._helper.setPitch(e)}setRoll(e){this._helper.setRoll(e)}setFov(e){this._helper.setFov(e)}setZoom(e){this._helper.setZoom(e)}setCenter(e){this._helper.setCenter(e)}setElevation(e){this._helper.setElevation(e)}setMinElevationForCurrentTile(e){this._helper.setMinElevationForCurrentTile(e)}setPadding(e){this._helper.setPadding(e)}interpolatePadding(e,r,a){return this._helper.interpolatePadding(e,r,a)}isPaddingEqual(e){return this._helper.isPaddingEqual(e)}resize(e,r,a=!0){this._helper.resize(e,r,a)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(e){this._helper.setMaxBounds(e)}overrideNearFarZ(e,r){this._helper.overrideNearFarZ(e,r)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(e){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),e)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}get isGlobeRendering(){return this._globeness>0}setTransitionState(e,r){this._globeness=e,this._globeLatitudeErrorCorrectionRadians=r,this._calcMatrices(),this._verticalPerspectiveTransform.getCoveringTilesDetailsProvider().recalculateCache(),this._mercatorTransform.getCoveringTilesDetailsProvider().recalculateCache()}get currentTransform(){return this.isGlobeRendering?this._verticalPerspectiveTransform:this._mercatorTransform}constructor(){this._globeLatitudeErrorCorrectionRadians=0,this._globeness=1,this._helper=new ti({calcMatrices:()=>{this._calcMatrices()},getConstrained:(e,r)=>this.getConstrained(e,r)}),this._globeness=1,this._mercatorTransform=new ds,this._verticalPerspectiveTransform=new Zn}clone(){const e=new Xs;return e._globeness=this._globeness,e._globeLatitudeErrorCorrectionRadians=this._globeLatitudeErrorCorrectionRadians,e.apply(this),e}apply(e){this._helper.apply(e),this._mercatorTransform.apply(this),this._verticalPerspectiveTransform.apply(this,this._globeLatitudeErrorCorrectionRadians)}get projectionMatrix(){return this.currentTransform.projectionMatrix}get modelViewProjectionMatrix(){return this.currentTransform.modelViewProjectionMatrix}get inverseProjectionMatrix(){return this.currentTransform.inverseProjectionMatrix}get cameraPosition(){return this.currentTransform.cameraPosition}getProjectionData(e){const r=this._mercatorTransform.getProjectionData(e),a=this._verticalPerspectiveTransform.getProjectionData(e);return{mainMatrix:this.isGlobeRendering?a.mainMatrix:r.mainMatrix,clippingPlane:a.clippingPlane,tileMercatorCoords:a.tileMercatorCoords,projectionTransition:e.applyGlobeMatrix?this._globeness:0,fallbackMatrix:r.fallbackMatrix}}isLocationOccluded(e){return this.currentTransform.isLocationOccluded(e)}transformLightDirection(e){return this.currentTransform.transformLightDirection(e)}getPixelScale(){return s.bc(this._mercatorTransform.getPixelScale(),this._verticalPerspectiveTransform.getPixelScale(),this._globeness)}getCircleRadiusCorrection(){return s.bc(this._mercatorTransform.getCircleRadiusCorrection(),this._verticalPerspectiveTransform.getCircleRadiusCorrection(),this._globeness)}getPitchedTextCorrection(e,r,a){const l=this._mercatorTransform.getPitchedTextCorrection(e,r,a),p=this._verticalPerspectiveTransform.getPitchedTextCorrection(e,r,a);return s.bc(l,p,this._globeness)}projectTileCoordinates(e,r,a,l){return this.currentTransform.projectTileCoordinates(e,r,a,l)}_calcMatrices(){this._helper._width&&this._helper._height&&(this._verticalPerspectiveTransform.apply(this,this._globeLatitudeErrorCorrectionRadians),this._helper._nearZ=this._verticalPerspectiveTransform.nearZ,this._helper._farZ=this._verticalPerspectiveTransform.farZ,this._mercatorTransform.apply(this,!0,this.isGlobeRendering),this._helper._nearZ=this._mercatorTransform.nearZ,this._helper._farZ=this._mercatorTransform.farZ)}calculateFogMatrix(e){return this.currentTransform.calculateFogMatrix(e)}getVisibleUnwrappedCoordinates(e){return this.currentTransform.getVisibleUnwrappedCoordinates(e)}getCameraFrustum(){return this.currentTransform.getCameraFrustum()}getClippingPlane(){return this.currentTransform.getClippingPlane()}getCoveringTilesDetailsProvider(){return this.currentTransform.getCoveringTilesDetailsProvider()}recalculateZoomAndCenter(e){this._mercatorTransform.recalculateZoomAndCenter(e),this._verticalPerspectiveTransform.recalculateZoomAndCenter(e)}maxPitchScaleFactor(){return this._mercatorTransform.maxPitchScaleFactor()}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(e,r){return this.currentTransform.lngLatToCameraDepth(e,r)}populateCache(e){this._mercatorTransform.populateCache(e),this._verticalPerspectiveTransform.populateCache(e)}getBounds(){return this.currentTransform.getBounds()}getConstrained(e,r){return this.currentTransform.getConstrained(e,r)}calculateCenterFromCameraLngLatAlt(e,r,a,l){return this._helper.calculateCenterFromCameraLngLatAlt(e,r,a,l)}setLocationAtPoint(e,r){if(!this.isGlobeRendering)return this._mercatorTransform.setLocationAtPoint(e,r),void this.apply(this._mercatorTransform);this._verticalPerspectiveTransform.setLocationAtPoint(e,r),this.apply(this._verticalPerspectiveTransform)}locationToScreenPoint(e,r){return this.currentTransform.locationToScreenPoint(e,r)}screenPointToMercatorCoordinate(e,r){return this.currentTransform.screenPointToMercatorCoordinate(e,r)}screenPointToLocation(e,r){return this.currentTransform.screenPointToLocation(e,r)}isPointOnMapSurface(e,r){return this.currentTransform.isPointOnMapSurface(e,r)}getRayDirectionFromPixel(e){return this._verticalPerspectiveTransform.getRayDirectionFromPixel(e)}getMatrixForModel(e,r){return this.currentTransform.getMatrixForModel(e,r)}getProjectionDataForCustomLayer(e=!0){const r=this._mercatorTransform.getProjectionDataForCustomLayer(e);if(!this.isGlobeRendering)return r;const a=this._verticalPerspectiveTransform.getProjectionDataForCustomLayer(e);return a.fallbackMatrix=r.mainMatrix,a}getFastPathSimpleProjectionMatrix(e){return this.currentTransform.getFastPathSimpleProjectionMatrix(e)}}class Oi{get useGlobeControls(){return!0}handlePanInertia(e,r){const a=Do(e,r);return Math.abs(a.lng-r.center.lng)>180&&(a.lng=r.center.lng+179.5*Math.sign(a.lng-r.center.lng)),{easingCenter:a,easingOffset:new s.P(0,0)}}handleMapControlsRollPitchBearingZoom(e,r){const a=e.around,l=r.screenPointToLocation(a);e.bearingDelta&&r.setBearing(r.bearing+e.bearingDelta),e.pitchDelta&&r.setPitch(r.pitch+e.pitchDelta),e.rollDelta&&r.setRoll(r.roll+e.rollDelta);const p=r.zoom;e.zoomDelta&&r.setZoom(r.zoom+e.zoomDelta);const y=r.zoom-p;if(y===0)return;const w=s.bq(r.center.lng,l.lng),A=w/(Math.abs(w/180)+1),R=s.bq(r.center.lat,l.lat),D=r.getRayDirectionFromPixel(a),N=r.cameraPosition,O=-1*s.aV(N,D),Z=s.bh();s.aP(Z,N,[D[0]*O,D[1]*O,D[2]*O]);const K=s.bo(Z)-1,ne=Math.exp(.5*-Math.max(K-.3,0)),ie=Hn(r.worldSize,r.center.lat)/Math.min(r.width,r.height),ae=s.bf(ie,.9,.5,1,.25),ue=(1-s.ac(-y))*Math.min(ne,ae),me=r.center.lat,fe=r.zoom,ge=new s.Q(r.center.lng+A*ue,s.ae(r.center.lat+R*ue,-85.051129,s.af));r.setLocationAtPoint(l,a);const xe=r.center,ye=s.bf(Math.abs(w),45,85,0,1),Te=s.bf(ie,.75,.35,0,1),Fe=Math.pow(Math.max(ye,Te),.25),Le=s.bq(xe.lng,ge.lng),Be=s.bq(xe.lat,ge.lat);r.setCenter(new s.Q(xe.lng+Le*Fe,xe.lat+Be*Fe).wrap()),r.setZoom(fe+Jr(me,r.center.lat))}handleMapControlsPan(e,r,a){if(!e.panDelta)return;const l=r.center.lat,p=r.zoom;r.setCenter(Do(e.panDelta,r).wrap()),r.setZoom(p+Jr(l,r.center.lat))}cameraForBoxAndBearing(e,r,a,l,p){const y=Ai(e,r,a,l,p),w=r.left/p.width*2-1,A=(p.width-r.right)/p.width*2-1,R=r.top/p.height*-2+1,D=(p.height-r.bottom)/p.height*-2+1,N=s.bq(a.getWest(),a.getEast())<0,O=N?a.getEast():a.getWest(),Z=N?a.getWest():a.getEast(),K=Math.max(a.getNorth(),a.getSouth()),ne=Math.min(a.getNorth(),a.getSouth()),ie=O+.5*s.bq(O,Z),ae=K+.5*s.bq(K,ne),ue=p.clone();ue.setCenter(y.center),ue.setBearing(y.bearing),ue.setPitch(0),ue.setRoll(0),ue.setZoom(y.zoom);const me=ue.modelViewProjectionMatrix,fe=[Gr(a.getNorthWest()),Gr(a.getNorthEast()),Gr(a.getSouthWest()),Gr(a.getSouthEast()),Gr(new s.Q(Z,ae)),Gr(new s.Q(O,ae)),Gr(new s.Q(ie,K)),Gr(new s.Q(ie,ne))],ge=Gr(y.center);let xe=Number.POSITIVE_INFINITY;for(const ye of fe)w<0&&(xe=Oi.getLesserNonNegativeNonNull(xe,Oi.solveVectorScale(ye,ge,me,"x",w))),A>0&&(xe=Oi.getLesserNonNegativeNonNull(xe,Oi.solveVectorScale(ye,ge,me,"x",A))),R>0&&(xe=Oi.getLesserNonNegativeNonNull(xe,Oi.solveVectorScale(ye,ge,me,"y",R))),D<0&&(xe=Oi.getLesserNonNegativeNonNull(xe,Oi.solveVectorScale(ye,ge,me,"y",D)));if(Number.isFinite(xe)&&xe!==0)return y.zoom=ue.zoom+s.ah(xe),y;gi()}handleJumpToCenterZoom(e,r){const a=e.center.lat,l=e.getConstrained(r.center?s.Q.convert(r.center):e.center,e.zoom).center;e.setCenter(l.wrap());const p=r.zoom!==void 0?+r.zoom:e.zoom+Jr(a,l.lat);e.zoom!==p&&e.setZoom(p)}handleEaseTo(e,r){const a=e.zoom,l=e.center,p=e.padding,y={roll:e.roll,pitch:e.pitch,bearing:e.bearing},w={roll:r.roll===void 0?e.roll:r.roll,pitch:r.pitch===void 0?e.pitch:r.pitch,bearing:r.bearing===void 0?e.bearing:r.bearing},A=r.zoom!==void 0,R=!e.isPaddingEqual(r.padding);let D=!1;const N=r.center?s.Q.convert(r.center):l,O=e.getConstrained(N,a).center;ps(e,O);const Z=e.clone();Z.setCenter(O),Z.setZoom(A?+r.zoom:a+Jr(l.lat,N.lat)),Z.setBearing(r.bearing);const K=new s.P(s.ae(e.centerPoint.x+r.offsetAsPoint.x,0,e.width),s.ae(e.centerPoint.y+r.offsetAsPoint.y,0,e.height));Z.setLocationAtPoint(O,K);const ne=(r.offset&&r.offsetAsPoint.mag())>0?Z.center:O,ie=A?+r.zoom:a+Jr(l.lat,ne.lat),ae=a+Jr(l.lat,0),ue=ie+Jr(ne.lat,0),me=s.bq(l.lng,ne.lng),fe=s.bq(l.lat,ne.lat),ge=s.ac(ue-ae);return D=ie!==a,{easeFunc:xe=>{if(s.b6(y,w)||Mi({startEulerAngles:y,endEulerAngles:w,tr:e,k:xe,useSlerp:y.roll!=w.roll}),R&&e.interpolatePadding(p,r.padding,xe),r.around)s.w("Easing around a point is not supported under globe projection."),e.setLocationAtPoint(r.around,r.aroundPoint);else{const ye=ue>ae?Math.min(2,ge):Math.max(.5,ge),Te=Math.pow(ye,1-xe),Fe=dc(l,me,fe,xe*Te);e.setCenter(Fe.wrap())}if(D){const ye=s.B.number(ae,ue,xe)+Jr(0,e.center.lat);e.setZoom(ye)}},isZooming:D,elevationCenter:ne}}handleFlyTo(e,r){const a=r.zoom!==void 0,l=e.center,p=e.zoom,y=e.padding,w=!e.isPaddingEqual(r.padding),A=e.getConstrained(s.Q.convert(r.center||r.locationAtOffset),p).center,R=a?+r.zoom:e.zoom+Jr(e.center.lat,A.lat),D=e.clone();D.setCenter(A),D.setZoom(R),D.setBearing(r.bearing);const N=new s.P(s.ae(e.centerPoint.x+r.offsetAsPoint.x,0,e.width),s.ae(e.centerPoint.y+r.offsetAsPoint.y,0,e.height));D.setLocationAtPoint(A,N);const O=D.center;ps(e,O);const Z=function(fe,ge,xe){const ye=Gr(ge),Te=Gr(xe),Fe=s.aV(ye,Te),Le=Math.acos(Fe),Be=Ks(fe);return Le/(2*Math.PI)*Be}(e,l,O),K=p+Jr(l.lat,0),ne=R+Jr(O.lat,0),ie=s.ac(ne-K);let ae;if(typeof r.minZoom=="number"){const fe=+r.minZoom+Jr(O.lat,0),ge=Math.min(fe,K,ne)+Jr(0,O.lat),xe=e.getConstrained(O,ge).zoom+Jr(O.lat,0);ae=s.ac(xe-K)}const ue=s.bq(l.lng,O.lng),me=s.bq(l.lat,O.lat);return{easeFunc:(fe,ge,xe,ye)=>{const Te=dc(l,ue,me,xe);w&&e.interpolatePadding(y,r.padding,fe);const Fe=fe===1?O:Te;e.setCenter(Fe.wrap());const Le=K+s.ah(ge);e.setZoom(fe===1?R:Le+Jr(0,Fe.lat))},scaleOfZoom:ie,targetCenter:O,scaleOfMinZoom:ae,pixelPathLength:Z}}static solveVectorScale(e,r,a,l,p){const y=l==="x"?[a[0],a[4],a[8],a[12]]:[a[1],a[5],a[9],a[13]],w=[a[3],a[7],a[11],a[15]],A=e[0]*y[0]+e[1]*y[1]+e[2]*y[2],R=e[0]*w[0]+e[1]*w[1]+e[2]*w[2],D=r[0]*y[0]+r[1]*y[1]+r[2]*y[2],N=r[0]*w[0]+r[1]*w[1]+r[2]*w[2];return D+p*R===A+p*N||w[3]*(A-D)+y[3]*(N-R)+A*N==D*R?null:(D+y[3]-p*N-p*w[3])/(D-A-p*N+p*R)}static getLesserNonNegativeNonNull(e,r){return r!==null&&r>=0&&r<e?r:e}}class Kn{constructor(e){this._globe=e,this._mercatorCameraHelper=new Ws,this._verticalPerspectiveCameraHelper=new Oi}get useGlobeControls(){return this._globe.useGlobeRendering}get currentHelper(){return this.useGlobeControls?this._verticalPerspectiveCameraHelper:this._mercatorCameraHelper}handlePanInertia(e,r){return this.currentHelper.handlePanInertia(e,r)}handleMapControlsRollPitchBearingZoom(e,r){return this.currentHelper.handleMapControlsRollPitchBearingZoom(e,r)}handleMapControlsPan(e,r,a){this.currentHelper.handleMapControlsPan(e,r,a)}cameraForBoxAndBearing(e,r,a,l,p){return this.currentHelper.cameraForBoxAndBearing(e,r,a,l,p)}handleJumpToCenterZoom(e,r){this.currentHelper.handleJumpToCenterZoom(e,r)}handleEaseTo(e,r){return this.currentHelper.handleEaseTo(e,r)}handleFlyTo(e,r){return this.currentHelper.handleFlyTo(e,r)}}const zo=(h,e)=>s.x(h,e&&e.filter(r=>r.identifier!=="source.canvas")),xh=s.bw();class Ka extends s.E{constructor(e,r={}){super(),this._rtlPluginLoaded=()=>{for(const a in this.sourceCaches){const l=this.sourceCaches[a].getSource().type;l!=="vector"&&l!=="geojson"||this.sourceCaches[a].reload()}},this.map=e,this.dispatcher=new Qe(et(),e._getMapId()),this.dispatcher.registerMessageHandler("GG",(a,l)=>this.getGlyphs(a,l)),this.dispatcher.registerMessageHandler("GI",(a,l)=>this.getImages(a,l)),this.imageManager=new tt,this.imageManager.setEventedParent(this),this.glyphManager=new Lt(e._requestManager,r.localIdeographFontFamily),this.lineAtlas=new Ei(256,512),this.crossTileSymbolIndex=new qs,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new s.bx,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",s.by()),zt().on(Er,this._rtlPluginLoaded),this.on("data",a=>{if(a.dataType!=="source"||a.sourceDataType!=="metadata")return;const l=this.sourceCaches[a.sourceId];if(!l)return;const p=l.getSource();if(p&&p.vectorLayerIds)for(const y in this._layers){const w=this._layers[y];w.source===p.id&&this._validateLayer(w)}})}loadURL(e,r={},a){this.fire(new s.l("dataloading",{dataType:"style"})),r.validate=typeof r.validate!="boolean"||r.validate;const l=this.map._requestManager.transformRequest(e,"Style");this._loadStyleRequest=new AbortController;const p=this._loadStyleRequest;s.j(l,this._loadStyleRequest).then(y=>{this._loadStyleRequest=null,this._load(y.data,r,a)}).catch(y=>{this._loadStyleRequest=null,y&&!p.signal.aborted&&this.fire(new s.k(y))})}loadJSON(e,r={},a){this.fire(new s.l("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,M.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,r.validate=r.validate!==!1,this._load(e,r,a)}).catch(()=>{})}loadEmpty(){this.fire(new s.l("dataloading",{dataType:"style"})),this._load(xh,{validate:!1})}_load(e,r,a){var l,p;const y=r.transformStyle?r.transformStyle(a,e):e;if(!r.validate||!zo(this,s.y(y))){this._loaded=!0,this.stylesheet=y;for(const w in y.sources)this.addSource(w,y.sources[w],{validate:!1});y.sprite?this._loadSprite(y.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(y.glyphs),this._createLayers(),this.light=new xi(this.stylesheet.light),this._setProjectionInternal(((l=this.stylesheet.projection)===null||l===void 0?void 0:l.type)||"mercator"),this.sky=new nn(this.stylesheet.sky),this.map.setTerrain((p=this.stylesheet.terrain)!==null&&p!==void 0?p:null),this.fire(new s.l("data",{dataType:"style"})),this.fire(new s.l("style.load"))}}_createLayers(){const e=s.bz(this.stylesheet.layers);this.dispatcher.broadcast("SL",e),this._order=e.map(r=>r.id),this._layers={},this._serializedLayers=null;for(const r of e){const a=s.bA(r);a.setEventedParent(this,{layer:{id:r.id}}),this._layers[r.id]=a}}_loadSprite(e,r=!1,a=void 0){let l;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(p,y,w,A){return s._(this,void 0,void 0,function*(){const R=Ce(p),D=w>1?"@2x":"",N={},O={};for(const{id:Z,url:K}of R){const ne=y.transformRequest(Re(K,D,".json"),"SpriteJSON");N[Z]=s.j(ne,A);const ie=y.transformRequest(Re(K,D,".png"),"SpriteImage");O[Z]=$.getImage(ie,A)}return yield Promise.all([...Object.values(N),...Object.values(O)]),function(Z,K){return s._(this,void 0,void 0,function*(){const ne={};for(const ie in Z){ne[ie]={};const ae=M.getImageCanvasContext((yield K[ie]).data),ue=(yield Z[ie]).data;for(const me in ue){const{width:fe,height:ge,x:xe,y:ye,sdf:Te,pixelRatio:Fe,stretchX:Le,stretchY:Be,content:De,textFitWidth:Ye,textFitHeight:Xe}=ue[me];ne[ie][me]={data:null,pixelRatio:Fe,sdf:Te,stretchX:Le,stretchY:Be,content:De,textFitWidth:Ye,textFitHeight:Xe,spriteData:{width:fe,height:ge,x:xe,y:ye,context:ae}}}}return ne})}(N,O)})}(e,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(p=>{if(this._spriteRequest=null,p)for(const y in p){this._spritesImagesIds[y]=[];const w=this._spritesImagesIds[y]?this._spritesImagesIds[y].filter(A=>!(A in p)):[];for(const A of w)this.imageManager.removeImage(A),this._changedImages[A]=!0;for(const A in p[y]){const R=y==="default"?A:`${y}:${A}`;this._spritesImagesIds[y].push(R),R in this.imageManager.images?this.imageManager.updateImage(R,p[y][A],!1):this.imageManager.addImage(R,p[y][A]),r&&(this._changedImages[R]=!0)}}}).catch(p=>{this._spriteRequest=null,l=p,this.fire(new s.k(l))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),r&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new s.l("data",{dataType:"style"})),a&&a(l)})}_unloadSprite(){for(const e of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(e),this._changedImages[e]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new s.l("data",{dataType:"style"}))}_validateLayer(e){const r=this.sourceCaches[e.source];if(!r)return;const a=e.sourceLayer;if(!a)return;const l=r.getSource();(l.type==="geojson"||l.vectorLayerIds&&l.vectorLayerIds.indexOf(a)===-1)&&this.fire(new s.k(new Error(`Source layer "${a}" does not exist on source "${l.id}" as specified by style layer "${e.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const e in this.sourceCaches)if(!this.sourceCaches[e].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(e,r=!1){const a=this._serializedAllLayers();if(!e||e.length===0)return Object.values(r?s.bB(a):a);const l=[];for(const p of e)if(a[p]){const y=r?s.bB(a[p]):a[p];l.push(y)}return l}_serializedAllLayers(){let e=this._serializedLayers;if(e)return e;e=this._serializedLayers={};const r=Object.keys(this._layers);for(const a of r){const l=this._layers[a];l.type!=="custom"&&(e[a]=l.serialize())}return e}hasTransitions(){var e,r,a;if(!((e=this.light)===null||e===void 0)&&e.hasTransition()||!((r=this.sky)===null||r===void 0)&&r.hasTransition()||!((a=this.projection)===null||a===void 0)&&a.hasTransition())return!0;for(const l in this.sourceCaches)if(this.sourceCaches[l].hasTransition())return!0;for(const l in this._layers)if(this._layers[l].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(e){if(!this._loaded)return;const r=this._changed;if(r){const l=Object.keys(this._updatedLayers),p=Object.keys(this._removedLayers);(l.length||p.length)&&this._updateWorkerLayers(l,p);for(const y in this._updatedSources){const w=this._updatedSources[y];if(w==="reload")this._reloadSource(y);else{if(w!=="clear")throw new Error(`Invalid action ${w}`);this._clearSource(y)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const y in this._updatedPaintProps)this._layers[y].updateTransitions(e);this.light.updateTransitions(e),this.sky.updateTransitions(e),this._resetUpdates()}const a={};for(const l in this.sourceCaches){const p=this.sourceCaches[l];a[l]=p.used,p.used=!1}for(const l of this._order){const p=this._layers[l];p.recalculate(e,this._availableImages),!p.isHidden(e.zoom)&&p.source&&(this.sourceCaches[p.source].used=!0)}for(const l in a){const p=this.sourceCaches[l];!!a[l]!=!!p.used&&p.fire(new s.l("data",{sourceDataType:"visibility",dataType:"source",sourceId:l}))}this.light.recalculate(e),this.sky.recalculate(e),this.projection.recalculate(e),this.z=e.zoom,r&&this.fire(new s.l("data",{dataType:"style"}))}_updateTilesForChangedImages(){const e=Object.keys(this._changedImages);if(e.length){for(const r in this.sourceCaches)this.sourceCaches[r].reloadTilesForDependencies(["icons","patterns"],e);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(e,r){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(e,!1),removedIds:r})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(e,r={}){var a;this._checkLoaded();const l=this.serialize();if(e=r.transformStyle?r.transformStyle(l,e):e,((a=r.validate)===null||a===void 0||a)&&zo(this,s.y(e)))return!1;(e=s.bB(e)).layers=s.bz(e.layers);const p=s.bC(l,e),y=this._getOperationsToPerform(p);if(y.unimplemented.length>0)throw new Error(`Unimplemented: ${y.unimplemented.join(", ")}.`);if(y.operations.length===0)return!1;for(const w of y.operations)w();return this.stylesheet=e,this._serializedLayers=null,!0}_getOperationsToPerform(e){const r=[],a=[];for(const l of e)switch(l.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":case"setRoll":continue;case"addLayer":r.push(()=>this.addLayer.apply(this,l.args));break;case"removeLayer":r.push(()=>this.removeLayer.apply(this,l.args));break;case"setPaintProperty":r.push(()=>this.setPaintProperty.apply(this,l.args));break;case"setLayoutProperty":r.push(()=>this.setLayoutProperty.apply(this,l.args));break;case"setFilter":r.push(()=>this.setFilter.apply(this,l.args));break;case"addSource":r.push(()=>this.addSource.apply(this,l.args));break;case"removeSource":r.push(()=>this.removeSource.apply(this,l.args));break;case"setLayerZoomRange":r.push(()=>this.setLayerZoomRange.apply(this,l.args));break;case"setLight":r.push(()=>this.setLight.apply(this,l.args));break;case"setGeoJSONSourceData":r.push(()=>this.setGeoJSONSourceData.apply(this,l.args));break;case"setGlyphs":r.push(()=>this.setGlyphs.apply(this,l.args));break;case"setSprite":r.push(()=>this.setSprite.apply(this,l.args));break;case"setTerrain":r.push(()=>this.map.setTerrain.apply(this,l.args));break;case"setSky":r.push(()=>this.setSky.apply(this,l.args));break;case"setProjection":this.setProjection.apply(this,l.args);break;case"setTransition":r.push(()=>{});break;default:a.push(l.command)}return{operations:r,unimplemented:a}}addImage(e,r){if(this.getImage(e))return this.fire(new s.k(new Error(`An image named "${e}" already exists.`)));this.imageManager.addImage(e,r),this._afterImageUpdated(e)}updateImage(e,r){this.imageManager.updateImage(e,r)}getImage(e){return this.imageManager.getImage(e)}removeImage(e){if(!this.getImage(e))return this.fire(new s.k(new Error(`An image named "${e}" does not exist.`)));this.imageManager.removeImage(e),this._afterImageUpdated(e)}_afterImageUpdated(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new s.l("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(e,r,a={}){if(this._checkLoaded(),this.sourceCaches[e]!==void 0)throw new Error(`Source "${e}" already exists.`);if(!r.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(r).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(s.y.source,`sources.${e}`,r,null,a))return;this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);const l=this.sourceCaches[e]=new Ae(e,r,this.dispatcher);l.style=this,l.setEventedParent(this,()=>({isSourceLoaded:l.loaded(),source:l.serialize(),sourceId:e})),l.onAdd(this.map),this._changed=!0}removeSource(e){if(this._checkLoaded(),this.sourceCaches[e]===void 0)throw new Error("There is no source with this ID");for(const a in this._layers)if(this._layers[a].source===e)return this.fire(new s.k(new Error(`Source "${e}" cannot be removed while layer "${a}" is using it.`)));const r=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],r.fire(new s.l("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),r.setEventedParent(null),r.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(e,r){if(this._checkLoaded(),this.sourceCaches[e]===void 0)throw new Error(`There is no source with this ID=${e}`);const a=this.sourceCaches[e].getSource();if(a.type!=="geojson")throw new Error(`geojsonSource.type is ${a.type}, which is !== 'geojson`);a.setData(r),this._changed=!0}getSource(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()}addLayer(e,r,a={}){this._checkLoaded();const l=e.id;if(this.getLayer(l))return void this.fire(new s.k(new Error(`Layer "${l}" already exists on this map.`)));let p;if(e.type==="custom"){if(zo(this,s.bD(e)))return;p=s.bA(e)}else{if("source"in e&&typeof e.source=="object"&&(this.addSource(l,e.source),e=s.bB(e),e=s.e(e,{source:l})),this._validate(s.y.layer,`layers.${l}`,e,{arrayIndex:-1},a))return;p=s.bA(e),this._validateLayer(p),p.setEventedParent(this,{layer:{id:l}})}const y=r?this._order.indexOf(r):this._order.length;if(r&&y===-1)this.fire(new s.k(new Error(`Cannot add layer "${l}" before non-existing layer "${r}".`)));else{if(this._order.splice(y,0,l),this._layerOrderChanged=!0,this._layers[l]=p,this._removedLayers[l]&&p.source&&p.type!=="custom"){const w=this._removedLayers[l];delete this._removedLayers[l],w.type!==p.type?this._updatedSources[p.source]="clear":(this._updatedSources[p.source]="reload",this.sourceCaches[p.source].pause())}this._updateLayer(p),p.onAdd&&p.onAdd(this.map)}}moveLayer(e,r){if(this._checkLoaded(),this._changed=!0,!this._layers[e])return void this.fire(new s.k(new Error(`The layer '${e}' does not exist in the map's style and cannot be moved.`)));if(e===r)return;const a=this._order.indexOf(e);this._order.splice(a,1);const l=r?this._order.indexOf(r):this._order.length;r&&l===-1?this.fire(new s.k(new Error(`Cannot move layer "${e}" before non-existing layer "${r}".`))):(this._order.splice(l,0,e),this._layerOrderChanged=!0)}removeLayer(e){this._checkLoaded();const r=this._layers[e];if(!r)return void this.fire(new s.k(new Error(`Cannot remove non-existing layer "${e}".`)));r.setEventedParent(null);const a=this._order.indexOf(e);this._order.splice(a,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],this._serializedLayers&&delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}getLayer(e){return this._layers[e]}getLayersOrder(){return[...this._order]}hasLayer(e){return e in this._layers}setLayerZoomRange(e,r,a){this._checkLoaded();const l=this.getLayer(e);l?l.minzoom===r&&l.maxzoom===a||(r!=null&&(l.minzoom=r),a!=null&&(l.maxzoom=a),this._updateLayer(l)):this.fire(new s.k(new Error(`Cannot set the zoom range of non-existing layer "${e}".`)))}setFilter(e,r,a={}){this._checkLoaded();const l=this.getLayer(e);if(l){if(!s.bE(l.filter,r))return r==null?(l.filter=void 0,void this._updateLayer(l)):void(this._validate(s.y.filter,`layers.${l.id}.filter`,r,null,a)||(l.filter=s.bB(r),this._updateLayer(l)))}else this.fire(new s.k(new Error(`Cannot filter non-existing layer "${e}".`)))}getFilter(e){return s.bB(this.getLayer(e).filter)}setLayoutProperty(e,r,a,l={}){this._checkLoaded();const p=this.getLayer(e);p?s.bE(p.getLayoutProperty(r),a)||(p.setLayoutProperty(r,a,l),this._updateLayer(p)):this.fire(new s.k(new Error(`Cannot style non-existing layer "${e}".`)))}getLayoutProperty(e,r){const a=this.getLayer(e);if(a)return a.getLayoutProperty(r);this.fire(new s.k(new Error(`Cannot get style of non-existing layer "${e}".`)))}setPaintProperty(e,r,a,l={}){this._checkLoaded();const p=this.getLayer(e);p?s.bE(p.getPaintProperty(r),a)||(p.setPaintProperty(r,a,l)&&this._updateLayer(p),this._changed=!0,this._updatedPaintProps[e]=!0,this._serializedLayers=null):this.fire(new s.k(new Error(`Cannot style non-existing layer "${e}".`)))}getPaintProperty(e,r){return this.getLayer(e).getPaintProperty(r)}setFeatureState(e,r){this._checkLoaded();const a=e.source,l=e.sourceLayer,p=this.sourceCaches[a];if(p===void 0)return void this.fire(new s.k(new Error(`The source '${a}' does not exist in the map's style.`)));const y=p.getSource().type;y==="geojson"&&l?this.fire(new s.k(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):y!=="vector"||l?(e.id===void 0&&this.fire(new s.k(new Error("The feature id parameter must be provided."))),p.setFeatureState(l,e.id,r)):this.fire(new s.k(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(e,r){this._checkLoaded();const a=e.source,l=this.sourceCaches[a];if(l===void 0)return void this.fire(new s.k(new Error(`The source '${a}' does not exist in the map's style.`)));const p=l.getSource().type,y=p==="vector"?e.sourceLayer:void 0;p!=="vector"||y?r&&typeof e.id!="string"&&typeof e.id!="number"?this.fire(new s.k(new Error("A feature id is required to remove its specific state property."))):l.removeFeatureState(y,e.id,r):this.fire(new s.k(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(e){this._checkLoaded();const r=e.source,a=e.sourceLayer,l=this.sourceCaches[r];if(l!==void 0)return l.getSource().type!=="vector"||a?(e.id===void 0&&this.fire(new s.k(new Error("The feature id parameter must be provided."))),l.getFeatureState(a,e.id)):void this.fire(new s.k(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new s.k(new Error(`The source '${r}' does not exist in the map's style.`)))}getTransition(){return s.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const e=s.bF(this.sourceCaches,p=>p.serialize()),r=this._serializeByIds(this._order,!0),a=this.map.getTerrain()||void 0,l=this.stylesheet;return s.bG({version:l.version,name:l.name,metadata:l.metadata,light:l.light,sky:l.sky,center:l.center,zoom:l.zoom,bearing:l.bearing,pitch:l.pitch,sprite:l.sprite,glyphs:l.glyphs,transition:l.transition,projection:l.projection,sources:e,layers:r,terrain:a},p=>p!==void 0)}_updateLayer(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&this.sourceCaches[e.source].getSource().type!=="raster"&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(e){const r=y=>this._layers[y].type==="fill-extrusion",a={},l=[];for(let y=this._order.length-1;y>=0;y--){const w=this._order[y];if(r(w)){a[w]=y;for(const A of e){const R=A[w];if(R)for(const D of R)l.push(D)}}}l.sort((y,w)=>w.intersectionZ-y.intersectionZ);const p=[];for(let y=this._order.length-1;y>=0;y--){const w=this._order[y];if(r(w))for(let A=l.length-1;A>=0;A--){const R=l[A].feature;if(a[R.layer.id]<y)break;p.push(R),l.pop()}else for(const A of e){const R=A[w];if(R)for(const D of R)p.push(D.feature)}}return p}queryRenderedFeatures(e,r,a){r&&r.filter&&this._validate(s.y.filter,"queryRenderedFeatures.filter",r.filter,null,r);const l={};if(r&&r.layers){if(!(Array.isArray(r.layers)||r.layers instanceof Set))return this.fire(new s.k(new Error("parameters.layers must be an Array or a Set of strings"))),[];for(const R of r.layers){const D=this._layers[R];if(!D)return this.fire(new s.k(new Error(`The layer '${R}' does not exist in the map's style and cannot be queried for features.`))),[];l[D.source]=!0}}const p=[];r.availableImages=this._availableImages;const y=this._serializedAllLayers(),w=r.layers instanceof Set?r.layers:Array.isArray(r.layers)?new Set(r.layers):null,A=Object.assign(Object.assign({},r),{layers:w});for(const R in this.sourceCaches)r.layers&&!l[R]||p.push(ot(this.sourceCaches[R],this._layers,y,e,A,a,this.map.terrain?(D,N,O)=>this.map.terrain.getElevation(D,N,O):void 0));return this.placement&&p.push(function(R,D,N,O,Z,K,ne){const ie={},ae=K.queryRenderedSymbols(O),ue=[];for(const me of Object.keys(ae).map(Number))ue.push(ne[me]);ue.sort(ht);for(const me of ue){const fe=me.featureIndex.lookupSymbolFeatures(ae[me.bucketInstanceId],D,me.bucketIndex,me.sourceLayerIndex,Z.filter,Z.layers,Z.availableImages,R);for(const ge in fe){const xe=ie[ge]=ie[ge]||[],ye=fe[ge];ye.sort((Te,Fe)=>{const Le=me.featureSortOrder;if(Le){const Be=Le.indexOf(Te.featureIndex);return Le.indexOf(Fe.featureIndex)-Be}return Fe.featureIndex-Te.featureIndex});for(const Te of ye)xe.push(Te)}}return function(me,fe,ge){for(const xe in me)for(const ye of me[xe])Ct(ye,ge[fe[xe].source]);return me}(ie,R,N)}(this._layers,y,this.sourceCaches,e,A,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(p)}querySourceFeatures(e,r){r&&r.filter&&this._validate(s.y.filter,"querySourceFeatures.filter",r.filter,null,r);const a=this.sourceCaches[e];return a?function(l,p){const y=l.getRenderableIds().map(R=>l.getTileByID(R)),w=[],A={};for(let R=0;R<y.length;R++){const D=y[R],N=D.tileID.canonical.key;A[N]||(A[N]=!0,D.querySourceFeatures(w,p))}return w}(a,r):[]}getLight(){return this.light.getLight()}setLight(e,r={}){this._checkLoaded();const a=this.light.getLight();let l=!1;for(const y in e)if(!s.bE(e[y],a[y])){l=!0;break}if(!l)return;const p={now:M.now(),transition:s.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,r),this.light.updateTransitions(p)}getProjection(){var e;return(e=this.stylesheet)===null||e===void 0?void 0:e.projection}setProjection(e){if(this._checkLoaded(),this.projection){if(this.projection.name===e.type)return;this.projection.destroy(),delete this.projection}this.stylesheet.projection=e,this._setProjectionInternal(e.type)}getSky(){var e;return(e=this.stylesheet)===null||e===void 0?void 0:e.sky}setSky(e,r={}){this._checkLoaded();const a=this.getSky();let l=!1;if(!e&&!a)return;if(e&&!a)l=!0;else if(!e&&a)l=!0;else for(const y in e)if(!s.bE(e[y],a[y])){l=!0;break}if(!l)return;const p={now:M.now(),transition:s.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=e,this.sky.setSky(e,r),this.sky.updateTransitions(p)}_setProjectionInternal(e){const r=function(a){if(Array.isArray(a)){const l=new Bo({type:a});return{projection:l,transform:new Xs,cameraHelper:new Kn(l)}}switch(a){case"mercator":return{projection:new Us,transform:new ds,cameraHelper:new Ws};case"globe":{const l=new Bo({type:["interpolate",["linear"],["zoom"],11,"vertical-perspective",12,"mercator"]});return{projection:l,transform:new Xs,cameraHelper:new Kn(l)}}case"vertical-perspective":return{projection:new Zs,transform:new Zn,cameraHelper:new Oi};default:return s.w(`Unknown projection name: ${a}. Falling back to mercator projection.`),{projection:new Us,transform:new ds,cameraHelper:new Ws}}}(e);this.projection=r.projection,this.map.migrateProjection(r.transform,r.cameraHelper);for(const a in this.sourceCaches)this.sourceCaches[a].reload()}_validate(e,r,a,l,p={}){return(!p||p.validate!==!1)&&zo(this,e.call(s.y,s.e({key:r,style:this.serialize(),value:a,styleSpec:s.v},l)))}_remove(e=!0){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),zt().off(Er,this._rtlPluginLoaded);for(const r in this._layers)this._layers[r].setEventedParent(null);for(const r in this.sourceCaches){const a=this.sourceCaches[r];a.setEventedParent(null),a.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),e&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(e)}_clearSource(e){this.sourceCaches[e].clearTiles()}_reloadSource(e){this.sourceCaches[e].resume(),this.sourceCaches[e].reload()}_updateSources(e){for(const r in this.sourceCaches)this.sourceCaches[r].update(e,this.map.terrain)}_generateCollisionBoxes(){for(const e in this.sourceCaches)this._reloadSource(e)}_updatePlacement(e,r,a,l,p=!1){let y=!1,w=!1;const A={};for(const R of this._order){const D=this._layers[R];if(D.type!=="symbol")continue;if(!A[D.source]){const O=this.sourceCaches[D.source];A[D.source]=O.getRenderableIds(!0).map(Z=>O.getTileByID(Z)).sort((Z,K)=>K.tileID.overscaledZ-Z.tileID.overscaledZ||(Z.tileID.isLessThan(K.tileID)?-1:1))}const N=this.crossTileSymbolIndex.addLayer(D,A[D.source],e.center.lng);y=y||N}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((p=p||this._layerOrderChanged||a===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(M.now(),e.zoom))&&(this.pauseablePlacement=new pc(e,this.map.terrain,this._order,p,r,a,l,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,A),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(M.now()),w=!0),y&&this.pauseablePlacement.placement.setStale()),w||y)for(const R of this._order){const D=this._layers[R];D.type==="symbol"&&this.placement.updateLayerOpacities(D,A[D.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(M.now())}_releaseSymbolFadeTiles(){for(const e in this.sourceCaches)this.sourceCaches[e].releaseSymbolFadeTiles()}getImages(e,r){return s._(this,void 0,void 0,function*(){const a=yield this.imageManager.getImages(r.icons);this._updateTilesForChangedImages();const l=this.sourceCaches[r.source];return l&&l.setDependencies(r.tileID.key,r.type,r.icons),a})}getGlyphs(e,r){return s._(this,void 0,void 0,function*(){const a=yield this.glyphManager.getGlyphs(r.stacks),l=this.sourceCaches[r.source];return l&&l.setDependencies(r.tileID.key,r.type,[""]),a})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(e,r={}){this._checkLoaded(),e&&this._validate(s.y.glyphs,"glyphs",e,null,r)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=e,this.glyphManager.entries={},this.glyphManager.setURL(e))}addSprite(e,r,a={},l){this._checkLoaded();const p=[{id:e,url:r}],y=[...Ce(this.stylesheet.sprite),...p];this._validate(s.y.sprite,"sprite",y,null,a)||(this.stylesheet.sprite=y,this._loadSprite(p,!0,l))}removeSprite(e){this._checkLoaded();const r=Ce(this.stylesheet.sprite);if(r.find(a=>a.id===e)){if(this._spritesImagesIds[e])for(const a of this._spritesImagesIds[e])this.imageManager.removeImage(a),this._changedImages[a]=!0;r.splice(r.findIndex(a=>a.id===e),1),this.stylesheet.sprite=r.length>0?r:void 0,delete this._spritesImagesIds[e],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new s.l("data",{dataType:"style"}))}else this.fire(new s.k(new Error(`Sprite "${e}" doesn't exists on this map.`)))}getSprite(){return Ce(this.stylesheet.sprite)}setSprite(e,r={},a){this._checkLoaded(),e&&this._validate(s.y.sprite,"sprite",e,null,r)||(this.stylesheet.sprite=e,e?this._loadSprite(e,!0,a):(this._unloadSprite(),a&&a(null)))}}var bh=s.aG([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class wh{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(e,r,a,l,p,y,w,A,R){this.context=e;let D=this.boundPaintVertexBuffers.length!==l.length;for(let N=0;!D&&N<l.length;N++)this.boundPaintVertexBuffers[N]!==l[N]&&(D=!0);!this.vao||this.boundProgram!==r||this.boundLayoutVertexBuffer!==a||D||this.boundIndexBuffer!==p||this.boundVertexOffset!==y||this.boundDynamicVertexBuffer!==w||this.boundDynamicVertexBuffer2!==A||this.boundDynamicVertexBuffer3!==R?this.freshBind(r,a,l,p,y,w,A,R):(e.bindVertexArray.set(this.vao),w&&w.bind(),p&&p.dynamicDraw&&p.bind(),A&&A.bind(),R&&R.bind())}freshBind(e,r,a,l,p,y,w,A){const R=e.numAttributes,D=this.context,N=D.gl;this.vao&&this.destroy(),this.vao=D.createVertexArray(),D.bindVertexArray.set(this.vao),this.boundProgram=e,this.boundLayoutVertexBuffer=r,this.boundPaintVertexBuffers=a,this.boundIndexBuffer=l,this.boundVertexOffset=p,this.boundDynamicVertexBuffer=y,this.boundDynamicVertexBuffer2=w,this.boundDynamicVertexBuffer3=A,r.enableAttributes(N,e);for(const O of a)O.enableAttributes(N,e);y&&y.enableAttributes(N,e),w&&w.enableAttributes(N,e),A&&A.enableAttributes(N,e),r.bind(),r.setVertexAttribPointers(N,e,p);for(const O of a)O.bind(),O.setVertexAttribPointers(N,e,p);y&&(y.bind(),y.setVertexAttribPointers(N,e,p)),l&&l.bind(),w&&(w.bind(),w.setVertexAttribPointers(N,e,p)),A&&(A.bind(),A.setVertexAttribPointers(N,e,p)),D.currentNumAttributes=R}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}const Sh=(h,e,r,a,l)=>({u_texture:0,u_ele_delta:h,u_fog_matrix:e,u_fog_color:r?r.properties.get("fog-color"):s.b7.white,u_fog_ground_blend:r?r.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:l?0:r?r.calculateFogBlendOpacity(a):0,u_horizon_color:r?r.properties.get("horizon-color"):s.b7.white,u_horizon_fog_blend:r?r.properties.get("horizon-fog-blend"):1,u_is_globe_mode:l?1:0}),Fo={mainMatrix:"u_projection_matrix",tileMercatorCoords:"u_projection_tile_mercator_coords",clippingPlane:"u_projection_clipping_plane",projectionTransition:"u_projection_transition",fallbackMatrix:"u_projection_fallback_matrix"};function gs(h){const e=[];for(let r=0;r<h.length;r++){if(h[r]===null)continue;const a=h[r].split(" ");e.push(a.pop())}return e}class Oo{constructor(e,r,a,l,p,y,w,A,R=[]){const D=e.gl;this.program=D.createProgram();const N=gs(r.staticAttributes),O=a?a.getBinderAttributes():[],Z=N.concat(O),K=fi.prelude.staticUniforms?gs(fi.prelude.staticUniforms):[],ne=w.staticUniforms?gs(w.staticUniforms):[],ie=r.staticUniforms?gs(r.staticUniforms):[],ae=a?a.getBinderUniforms():[],ue=K.concat(ne).concat(ie).concat(ae),me=[];for(const Le of ue)me.indexOf(Le)<0&&me.push(Le);const fe=a?a.defines():[];ci(D)&&fe.unshift("#version 300 es"),p&&fe.push("#define OVERDRAW_INSPECTOR;"),y&&fe.push("#define TERRAIN3D;"),A&&fe.push(A),R&&fe.push(...R);let ge=fe.concat(fi.prelude.fragmentSource,w.fragmentSource,r.fragmentSource).join(`
798
- `),xe=fe.concat(fi.prelude.vertexSource,w.vertexSource,r.vertexSource).join(`
799
- `);ci(D)||(ge=function(Le){return Le.replace(/\bin\s/g,"varying ").replace("out highp vec4 fragColor;","").replace(/fragColor/g,"gl_FragColor").replace(/texture\(/g,"texture2D(")}(ge),xe=function(Le){return Le.replace(/\bin\s/g,"attribute ").replace(/\bout\s/g,"varying ").replace(/texture\(/g,"texture2D(")}(xe));const ye=D.createShader(D.FRAGMENT_SHADER);if(D.isContextLost())return void(this.failedToCreate=!0);if(D.shaderSource(ye,ge),D.compileShader(ye),!D.getShaderParameter(ye,D.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${D.getShaderInfoLog(ye)}`);D.attachShader(this.program,ye);const Te=D.createShader(D.VERTEX_SHADER);if(D.isContextLost())return void(this.failedToCreate=!0);if(D.shaderSource(Te,xe),D.compileShader(Te),!D.getShaderParameter(Te,D.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${D.getShaderInfoLog(Te)}`);D.attachShader(this.program,Te),this.attributes={};const Fe={};this.numAttributes=Z.length;for(let Le=0;Le<this.numAttributes;Le++)Z[Le]&&(D.bindAttribLocation(this.program,Le,Z[Le]),this.attributes[Z[Le]]=Le);if(D.linkProgram(this.program),!D.getProgramParameter(this.program,D.LINK_STATUS))throw new Error(`Program failed to link: ${D.getProgramInfoLog(this.program)}`);D.deleteShader(Te),D.deleteShader(ye);for(let Le=0;Le<me.length;Le++){const Be=me[Le];if(Be&&!Fe[Be]){const De=D.getUniformLocation(this.program,Be);De&&(Fe[Be]=De)}}this.fixedUniforms=l(e,Fe),this.terrainUniforms=((Le,Be)=>({u_depth:new s.bH(Le,Be.u_depth),u_terrain:new s.bH(Le,Be.u_terrain),u_terrain_dim:new s.b8(Le,Be.u_terrain_dim),u_terrain_matrix:new s.bJ(Le,Be.u_terrain_matrix),u_terrain_unpack:new s.bK(Le,Be.u_terrain_unpack),u_terrain_exaggeration:new s.b8(Le,Be.u_terrain_exaggeration)}))(e,Fe),this.projectionUniforms=((Le,Be)=>({u_projection_matrix:new s.bJ(Le,Be.u_projection_matrix),u_projection_tile_mercator_coords:new s.bK(Le,Be.u_projection_tile_mercator_coords),u_projection_clipping_plane:new s.bK(Le,Be.u_projection_clipping_plane),u_projection_transition:new s.b8(Le,Be.u_projection_transition),u_projection_fallback_matrix:new s.bJ(Le,Be.u_projection_fallback_matrix)}))(e,Fe),this.binderUniforms=a?a.getUniforms(e,Fe):[]}draw(e,r,a,l,p,y,w,A,R,D,N,O,Z,K,ne,ie,ae,ue,me){const fe=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.setDepthMode(a),e.setStencilMode(l),e.setColorMode(p),e.setCullFace(y),A){e.activeTexture.set(fe.TEXTURE2),fe.bindTexture(fe.TEXTURE_2D,A.depthTexture),e.activeTexture.set(fe.TEXTURE3),fe.bindTexture(fe.TEXTURE_2D,A.texture);for(const xe in this.terrainUniforms)this.terrainUniforms[xe].set(A[xe])}if(R)for(const xe in R)this.projectionUniforms[Fo[xe]].set(R[xe]);if(w)for(const xe in this.fixedUniforms)this.fixedUniforms[xe].set(w[xe]);ie&&ie.setUniforms(e,this.binderUniforms,K,{zoom:ne});let ge=0;switch(r){case fe.LINES:ge=2;break;case fe.TRIANGLES:ge=3;break;case fe.LINE_STRIP:ge=1}for(const xe of Z.get()){const ye=xe.vaos||(xe.vaos={});(ye[D]||(ye[D]=new wh)).bind(e,this,N,ie?ie.getPaintVertexBuffers():[],O,xe.vertexOffset,ae,ue,me),fe.drawElements(r,xe.primitiveLength*ge,fe.UNSIGNED_SHORT,xe.primitiveOffset*ge*2)}}}function No(h,e,r){const a=1/s.az(r,1,e.transform.tileZoom),l=Math.pow(2,r.tileID.overscaledZ),p=r.tileSize*Math.pow(2,e.transform.tileZoom)/l,y=p*(r.tileID.canonical.x+r.tileID.wrap*l),w=p*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[a,h.fromScale,h.toScale],u_fade:h.t,u_pixel_coord_upper:[y>>16,w>>16],u_pixel_coord_lower:[65535&y,65535&w]}}const qo=(h,e,r,a)=>{const l=h.style.light,p=l.properties.get("position"),y=[p.x,p.y,p.z],w=s.bN();l.properties.get("anchor")==="viewport"&&s.bO(w,h.transform.bearingInRadians),s.bP(y,y,w);const A=h.transform.transformLightDirection(y),R=l.properties.get("color");return{u_lightpos:y,u_lightpos_globe:A,u_lightintensity:l.properties.get("intensity"),u_lightcolor:[R.r,R.g,R.b],u_vertical_gradient:+e,u_opacity:r,u_fill_translate:a}},on=(h,e,r,a,l,p,y)=>s.e(qo(h,e,r,a),No(p,h,y),{u_height_factor:-Math.pow(2,l.overscaledZ)/y.tileSize/8}),fc=(h,e,r,a)=>s.e(No(e,h,r),{u_fill_translate:a}),Ga=(h,e)=>({u_world:h,u_fill_translate:e}),Qs=(h,e,r,a,l)=>s.e(fc(h,e,r,l),{u_world:a}),Ys=(h,e,r,a,l)=>{const p=h.transform;let y,w,A=0;if(r.paint.get("circle-pitch-alignment")==="map"){const R=s.az(e,1,p.zoom);y=!0,w=[R,R],A=R/(s.Z*Math.pow(2,e.tileID.overscaledZ))*2*Math.PI*l}else y=!1,w=p.pixelsToGLUnits;return{u_camera_to_center_distance:p.cameraToCenterDistance,u_scale_with_map:+(r.paint.get("circle-pitch-scale")==="map"),u_pitch_with_map:+y,u_device_pixel_ratio:h.pixelRatio,u_extrude_scale:w,u_globe_extrude_scale:A,u_translate:a}},kh=h=>({u_pixel_extrude_scale:[1/h.width,1/h.height]}),Uo=h=>({u_viewport_size:[h.width,h.height]}),mc=(h,e=1)=>({u_color:h,u_overlay:0,u_overlay_scale:e}),Gn=(h,e,r,a)=>{const l=s.az(h,1,e)/(s.Z*Math.pow(2,h.tileID.overscaledZ))*2*Math.PI*a;return{u_extrude_scale:s.az(h,1,e),u_intensity:r,u_globe_extrude_scale:l}},gc=(h,e,r,a)=>{const l=s.K();s.bQ(l,0,h.width,h.height,0,0,1);const p=h.context.gl;return{u_matrix:l,u_world:[p.drawingBufferWidth,p.drawingBufferHeight],u_image:r,u_color_ramp:a,u_opacity:e.paint.get("heatmap-opacity")}},yc=(h,e,r)=>{const a=r.paint.get("hillshade-accent-color");let l;switch(r.paint.get("hillshade-method")){case"basic":l=4;break;case"combined":l=1;break;case"igor":l=2;break;case"multidirectional":l=3;break;default:l=0}const p=r.getIlluminationProperties();for(let y=0;y<p.directionRadians.length;y++)r.paint.get("hillshade-illumination-anchor")==="viewport"&&(p.directionRadians[y]+=h.transform.bearingInRadians);return{u_image:0,u_latrange:_c(0,e.tileID),u_exaggeration:r.paint.get("hillshade-exaggeration"),u_altitudes:p.altitudeRadians,u_azimuths:p.directionRadians,u_accent:a,u_method:l,u_highlights:p.highlightColor,u_shadows:p.shadowColor}},Ah=(h,e)=>{const r=e.stride,a=s.K();return s.bQ(a,0,s.Z,-8192,0,0,1),s.L(a,a,[0,-8192,0]),{u_matrix:a,u_image:1,u_dimension:[r,r],u_zoom:h.overscaledZ,u_unpack:e.getUnpackVector()}};function _c(h,e){const r=Math.pow(2,e.canonical.z),a=e.canonical.y;return[new s.$(0,a/r).toLngLat().lat,new s.$(0,(a+1)/r).toLngLat().lat]}const $s=(h,e,r,a)=>{const l=h.transform;return{u_translation:Cn(h,e,r),u_ratio:a/s.az(e,1,l.zoom),u_device_pixel_ratio:h.pixelRatio,u_units_to_pixels:[1/l.pixelsToGLUnits[0],1/l.pixelsToGLUnits[1]]}},vc=(h,e,r,a,l)=>s.e($s(h,e,r,a),{u_image:0,u_image_height:l}),xc=(h,e,r,a,l)=>{const p=h.transform,y=Ja(e,p);return{u_translation:Cn(h,e,r),u_texsize:e.imageAtlasTexture.size,u_ratio:a/s.az(e,1,p.zoom),u_device_pixel_ratio:h.pixelRatio,u_image:0,u_scale:[y,l.fromScale,l.toScale],u_fade:l.t,u_units_to_pixels:[1/p.pixelsToGLUnits[0],1/p.pixelsToGLUnits[1]]}},bc=(h,e,r,a,l,p)=>{const y=h.lineAtlas,w=Ja(e,h.transform),A=r.layout.get("line-cap")==="round",R=y.getDash(l.from,A),D=y.getDash(l.to,A),N=R.width*p.fromScale,O=D.width*p.toScale;return s.e($s(h,e,r,a),{u_patternscale_a:[w/N,-R.height/2],u_patternscale_b:[w/O,-D.height/2],u_sdfgamma:y.width/(256*Math.min(N,O)*h.pixelRatio)/2,u_image:0,u_tex_y_a:R.y,u_tex_y_b:D.y,u_mix:p.t})};function Ja(h,e){return 1/s.az(h,1,e.tileZoom)}function Cn(h,e,r){return s.aA(h.transform,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}const wc=(h,e,r,a,l)=>{return{u_tl_parent:h,u_scale_parent:e,u_buffer_scale:1,u_fade_t:r.mix,u_opacity:r.opacity*a.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:a.paint.get("raster-brightness-min"),u_brightness_high:a.paint.get("raster-brightness-max"),u_saturation_factor:(y=a.paint.get("raster-saturation"),y>0?1-1/(1.001-y):-y),u_contrast_factor:(p=a.paint.get("raster-contrast"),p>0?1/(1-p):1+p),u_spin_weights:Sc(a.paint.get("raster-hue-rotate")),u_coords_top:[l[0].x,l[0].y,l[1].x,l[1].y],u_coords_bottom:[l[3].x,l[3].y,l[2].x,l[2].y]};var p,y};function Sc(h){h*=Math.PI/180;const e=Math.sin(h),r=Math.cos(h);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}const ys=(h,e,r,a,l,p,y,w,A,R,D,N,O)=>{const Z=y.transform;return{u_is_size_zoom_constant:+(h==="constant"||h==="source"),u_is_size_feature_constant:+(h==="constant"||h==="camera"),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:Z.cameraToCenterDistance,u_pitch:Z.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:Z.width/Z.height,u_fade_change:y.options.fadeDuration?y.symbolFadeChange:1,u_label_plane_matrix:w,u_coord_matrix:A,u_is_text:+D,u_pitch_with_map:+a,u_is_along_line:l,u_is_variable_anchor:p,u_texsize:N,u_texture:0,u_translation:R,u_pitched_scale:O}},kc=(h,e,r,a,l,p,y,w,A,R,D,N,O,Z)=>{const K=y.transform;return s.e(ys(h,e,r,a,l,p,y,w,A,R,D,N,Z),{u_gamma_scale:a?Math.cos(K.pitch*Math.PI/180)*K.cameraToCenterDistance:1,u_device_pixel_ratio:y.pixelRatio,u_is_halo:1})},jo=(h,e,r,a,l,p,y,w,A,R,D,N,O)=>s.e(kc(h,e,r,a,l,p,y,w,A,R,!0,D,0,O),{u_texsize_icon:N,u_texture_icon:1}),Ch=(h,e)=>({u_opacity:h,u_color:e}),Th=(h,e,r,a,l)=>s.e(function(p,y,w,A){const R=w.imageManager.getPattern(p.from.toString()),D=w.imageManager.getPattern(p.to.toString()),{width:N,height:O}=w.imageManager.getPixelSize(),Z=Math.pow(2,A.tileID.overscaledZ),K=A.tileSize*Math.pow(2,w.transform.tileZoom)/Z,ne=K*(A.tileID.canonical.x+A.tileID.wrap*Z),ie=K*A.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:R.tl,u_pattern_br_a:R.br,u_pattern_tl_b:D.tl,u_pattern_br_b:D.br,u_texsize:[N,O],u_mix:y.t,u_pattern_size_a:R.displaySize,u_pattern_size_b:D.displaySize,u_scale_a:y.fromScale,u_scale_b:y.toScale,u_tile_units_to_pixels:1/s.az(A,1,w.transform.tileZoom),u_pixel_coord_upper:[ne>>16,ie>>16],u_pixel_coord_lower:[65535&ne,65535&ie]}}(r,l,e,a),{u_opacity:h}),Xa=(h,e)=>{},Ac={fillExtrusion:(h,e)=>({u_lightpos:new s.bL(h,e.u_lightpos),u_lightpos_globe:new s.bL(h,e.u_lightpos_globe),u_lightintensity:new s.b8(h,e.u_lightintensity),u_lightcolor:new s.bL(h,e.u_lightcolor),u_vertical_gradient:new s.b8(h,e.u_vertical_gradient),u_opacity:new s.b8(h,e.u_opacity),u_fill_translate:new s.bM(h,e.u_fill_translate)}),fillExtrusionPattern:(h,e)=>({u_lightpos:new s.bL(h,e.u_lightpos),u_lightpos_globe:new s.bL(h,e.u_lightpos_globe),u_lightintensity:new s.b8(h,e.u_lightintensity),u_lightcolor:new s.bL(h,e.u_lightcolor),u_vertical_gradient:new s.b8(h,e.u_vertical_gradient),u_height_factor:new s.b8(h,e.u_height_factor),u_opacity:new s.b8(h,e.u_opacity),u_fill_translate:new s.bM(h,e.u_fill_translate),u_image:new s.bH(h,e.u_image),u_texsize:new s.bM(h,e.u_texsize),u_pixel_coord_upper:new s.bM(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new s.bM(h,e.u_pixel_coord_lower),u_scale:new s.bL(h,e.u_scale),u_fade:new s.b8(h,e.u_fade)}),fill:(h,e)=>({u_fill_translate:new s.bM(h,e.u_fill_translate)}),fillPattern:(h,e)=>({u_image:new s.bH(h,e.u_image),u_texsize:new s.bM(h,e.u_texsize),u_pixel_coord_upper:new s.bM(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new s.bM(h,e.u_pixel_coord_lower),u_scale:new s.bL(h,e.u_scale),u_fade:new s.b8(h,e.u_fade),u_fill_translate:new s.bM(h,e.u_fill_translate)}),fillOutline:(h,e)=>({u_world:new s.bM(h,e.u_world),u_fill_translate:new s.bM(h,e.u_fill_translate)}),fillOutlinePattern:(h,e)=>({u_world:new s.bM(h,e.u_world),u_image:new s.bH(h,e.u_image),u_texsize:new s.bM(h,e.u_texsize),u_pixel_coord_upper:new s.bM(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new s.bM(h,e.u_pixel_coord_lower),u_scale:new s.bL(h,e.u_scale),u_fade:new s.b8(h,e.u_fade),u_fill_translate:new s.bM(h,e.u_fill_translate)}),circle:(h,e)=>({u_camera_to_center_distance:new s.b8(h,e.u_camera_to_center_distance),u_scale_with_map:new s.bH(h,e.u_scale_with_map),u_pitch_with_map:new s.bH(h,e.u_pitch_with_map),u_extrude_scale:new s.bM(h,e.u_extrude_scale),u_device_pixel_ratio:new s.b8(h,e.u_device_pixel_ratio),u_globe_extrude_scale:new s.b8(h,e.u_globe_extrude_scale),u_translate:new s.bM(h,e.u_translate)}),collisionBox:(h,e)=>({u_pixel_extrude_scale:new s.bM(h,e.u_pixel_extrude_scale)}),collisionCircle:(h,e)=>({u_viewport_size:new s.bM(h,e.u_viewport_size)}),debug:(h,e)=>({u_color:new s.bI(h,e.u_color),u_overlay:new s.bH(h,e.u_overlay),u_overlay_scale:new s.b8(h,e.u_overlay_scale)}),depth:Xa,clippingMask:Xa,heatmap:(h,e)=>({u_extrude_scale:new s.b8(h,e.u_extrude_scale),u_intensity:new s.b8(h,e.u_intensity),u_globe_extrude_scale:new s.b8(h,e.u_globe_extrude_scale)}),heatmapTexture:(h,e)=>({u_matrix:new s.bJ(h,e.u_matrix),u_world:new s.bM(h,e.u_world),u_image:new s.bH(h,e.u_image),u_color_ramp:new s.bH(h,e.u_color_ramp),u_opacity:new s.b8(h,e.u_opacity)}),hillshade:(h,e)=>({u_image:new s.bH(h,e.u_image),u_latrange:new s.bM(h,e.u_latrange),u_exaggeration:new s.b8(h,e.u_exaggeration),u_altitudes:new s.bS(h,e.u_altitudes),u_azimuths:new s.bS(h,e.u_azimuths),u_accent:new s.bI(h,e.u_accent),u_method:new s.bH(h,e.u_method),u_shadows:new s.bR(h,e.u_shadows),u_highlights:new s.bR(h,e.u_highlights)}),hillshadePrepare:(h,e)=>({u_matrix:new s.bJ(h,e.u_matrix),u_image:new s.bH(h,e.u_image),u_dimension:new s.bM(h,e.u_dimension),u_zoom:new s.b8(h,e.u_zoom),u_unpack:new s.bK(h,e.u_unpack)}),line:(h,e)=>({u_translation:new s.bM(h,e.u_translation),u_ratio:new s.b8(h,e.u_ratio),u_device_pixel_ratio:new s.b8(h,e.u_device_pixel_ratio),u_units_to_pixels:new s.bM(h,e.u_units_to_pixels)}),lineGradient:(h,e)=>({u_translation:new s.bM(h,e.u_translation),u_ratio:new s.b8(h,e.u_ratio),u_device_pixel_ratio:new s.b8(h,e.u_device_pixel_ratio),u_units_to_pixels:new s.bM(h,e.u_units_to_pixels),u_image:new s.bH(h,e.u_image),u_image_height:new s.b8(h,e.u_image_height)}),linePattern:(h,e)=>({u_translation:new s.bM(h,e.u_translation),u_texsize:new s.bM(h,e.u_texsize),u_ratio:new s.b8(h,e.u_ratio),u_device_pixel_ratio:new s.b8(h,e.u_device_pixel_ratio),u_image:new s.bH(h,e.u_image),u_units_to_pixels:new s.bM(h,e.u_units_to_pixels),u_scale:new s.bL(h,e.u_scale),u_fade:new s.b8(h,e.u_fade)}),lineSDF:(h,e)=>({u_translation:new s.bM(h,e.u_translation),u_ratio:new s.b8(h,e.u_ratio),u_device_pixel_ratio:new s.b8(h,e.u_device_pixel_ratio),u_units_to_pixels:new s.bM(h,e.u_units_to_pixels),u_patternscale_a:new s.bM(h,e.u_patternscale_a),u_patternscale_b:new s.bM(h,e.u_patternscale_b),u_sdfgamma:new s.b8(h,e.u_sdfgamma),u_image:new s.bH(h,e.u_image),u_tex_y_a:new s.b8(h,e.u_tex_y_a),u_tex_y_b:new s.b8(h,e.u_tex_y_b),u_mix:new s.b8(h,e.u_mix)}),raster:(h,e)=>({u_tl_parent:new s.bM(h,e.u_tl_parent),u_scale_parent:new s.b8(h,e.u_scale_parent),u_buffer_scale:new s.b8(h,e.u_buffer_scale),u_fade_t:new s.b8(h,e.u_fade_t),u_opacity:new s.b8(h,e.u_opacity),u_image0:new s.bH(h,e.u_image0),u_image1:new s.bH(h,e.u_image1),u_brightness_low:new s.b8(h,e.u_brightness_low),u_brightness_high:new s.b8(h,e.u_brightness_high),u_saturation_factor:new s.b8(h,e.u_saturation_factor),u_contrast_factor:new s.b8(h,e.u_contrast_factor),u_spin_weights:new s.bL(h,e.u_spin_weights),u_coords_top:new s.bK(h,e.u_coords_top),u_coords_bottom:new s.bK(h,e.u_coords_bottom)}),symbolIcon:(h,e)=>({u_is_size_zoom_constant:new s.bH(h,e.u_is_size_zoom_constant),u_is_size_feature_constant:new s.bH(h,e.u_is_size_feature_constant),u_size_t:new s.b8(h,e.u_size_t),u_size:new s.b8(h,e.u_size),u_camera_to_center_distance:new s.b8(h,e.u_camera_to_center_distance),u_pitch:new s.b8(h,e.u_pitch),u_rotate_symbol:new s.bH(h,e.u_rotate_symbol),u_aspect_ratio:new s.b8(h,e.u_aspect_ratio),u_fade_change:new s.b8(h,e.u_fade_change),u_label_plane_matrix:new s.bJ(h,e.u_label_plane_matrix),u_coord_matrix:new s.bJ(h,e.u_coord_matrix),u_is_text:new s.bH(h,e.u_is_text),u_pitch_with_map:new s.bH(h,e.u_pitch_with_map),u_is_along_line:new s.bH(h,e.u_is_along_line),u_is_variable_anchor:new s.bH(h,e.u_is_variable_anchor),u_texsize:new s.bM(h,e.u_texsize),u_texture:new s.bH(h,e.u_texture),u_translation:new s.bM(h,e.u_translation),u_pitched_scale:new s.b8(h,e.u_pitched_scale)}),symbolSDF:(h,e)=>({u_is_size_zoom_constant:new s.bH(h,e.u_is_size_zoom_constant),u_is_size_feature_constant:new s.bH(h,e.u_is_size_feature_constant),u_size_t:new s.b8(h,e.u_size_t),u_size:new s.b8(h,e.u_size),u_camera_to_center_distance:new s.b8(h,e.u_camera_to_center_distance),u_pitch:new s.b8(h,e.u_pitch),u_rotate_symbol:new s.bH(h,e.u_rotate_symbol),u_aspect_ratio:new s.b8(h,e.u_aspect_ratio),u_fade_change:new s.b8(h,e.u_fade_change),u_label_plane_matrix:new s.bJ(h,e.u_label_plane_matrix),u_coord_matrix:new s.bJ(h,e.u_coord_matrix),u_is_text:new s.bH(h,e.u_is_text),u_pitch_with_map:new s.bH(h,e.u_pitch_with_map),u_is_along_line:new s.bH(h,e.u_is_along_line),u_is_variable_anchor:new s.bH(h,e.u_is_variable_anchor),u_texsize:new s.bM(h,e.u_texsize),u_texture:new s.bH(h,e.u_texture),u_gamma_scale:new s.b8(h,e.u_gamma_scale),u_device_pixel_ratio:new s.b8(h,e.u_device_pixel_ratio),u_is_halo:new s.bH(h,e.u_is_halo),u_translation:new s.bM(h,e.u_translation),u_pitched_scale:new s.b8(h,e.u_pitched_scale)}),symbolTextAndIcon:(h,e)=>({u_is_size_zoom_constant:new s.bH(h,e.u_is_size_zoom_constant),u_is_size_feature_constant:new s.bH(h,e.u_is_size_feature_constant),u_size_t:new s.b8(h,e.u_size_t),u_size:new s.b8(h,e.u_size),u_camera_to_center_distance:new s.b8(h,e.u_camera_to_center_distance),u_pitch:new s.b8(h,e.u_pitch),u_rotate_symbol:new s.bH(h,e.u_rotate_symbol),u_aspect_ratio:new s.b8(h,e.u_aspect_ratio),u_fade_change:new s.b8(h,e.u_fade_change),u_label_plane_matrix:new s.bJ(h,e.u_label_plane_matrix),u_coord_matrix:new s.bJ(h,e.u_coord_matrix),u_is_text:new s.bH(h,e.u_is_text),u_pitch_with_map:new s.bH(h,e.u_pitch_with_map),u_is_along_line:new s.bH(h,e.u_is_along_line),u_is_variable_anchor:new s.bH(h,e.u_is_variable_anchor),u_texsize:new s.bM(h,e.u_texsize),u_texsize_icon:new s.bM(h,e.u_texsize_icon),u_texture:new s.bH(h,e.u_texture),u_texture_icon:new s.bH(h,e.u_texture_icon),u_gamma_scale:new s.b8(h,e.u_gamma_scale),u_device_pixel_ratio:new s.b8(h,e.u_device_pixel_ratio),u_is_halo:new s.bH(h,e.u_is_halo),u_translation:new s.bM(h,e.u_translation),u_pitched_scale:new s.b8(h,e.u_pitched_scale)}),background:(h,e)=>({u_opacity:new s.b8(h,e.u_opacity),u_color:new s.bI(h,e.u_color)}),backgroundPattern:(h,e)=>({u_opacity:new s.b8(h,e.u_opacity),u_image:new s.bH(h,e.u_image),u_pattern_tl_a:new s.bM(h,e.u_pattern_tl_a),u_pattern_br_a:new s.bM(h,e.u_pattern_br_a),u_pattern_tl_b:new s.bM(h,e.u_pattern_tl_b),u_pattern_br_b:new s.bM(h,e.u_pattern_br_b),u_texsize:new s.bM(h,e.u_texsize),u_mix:new s.b8(h,e.u_mix),u_pattern_size_a:new s.bM(h,e.u_pattern_size_a),u_pattern_size_b:new s.bM(h,e.u_pattern_size_b),u_scale_a:new s.b8(h,e.u_scale_a),u_scale_b:new s.b8(h,e.u_scale_b),u_pixel_coord_upper:new s.bM(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new s.bM(h,e.u_pixel_coord_lower),u_tile_units_to_pixels:new s.b8(h,e.u_tile_units_to_pixels)}),terrain:(h,e)=>({u_texture:new s.bH(h,e.u_texture),u_ele_delta:new s.b8(h,e.u_ele_delta),u_fog_matrix:new s.bJ(h,e.u_fog_matrix),u_fog_color:new s.bI(h,e.u_fog_color),u_fog_ground_blend:new s.b8(h,e.u_fog_ground_blend),u_fog_ground_blend_opacity:new s.b8(h,e.u_fog_ground_blend_opacity),u_horizon_color:new s.bI(h,e.u_horizon_color),u_horizon_fog_blend:new s.b8(h,e.u_horizon_fog_blend),u_is_globe_mode:new s.b8(h,e.u_is_globe_mode)}),terrainDepth:(h,e)=>({u_ele_delta:new s.b8(h,e.u_ele_delta)}),terrainCoords:(h,e)=>({u_texture:new s.bH(h,e.u_texture),u_terrain_coords_id:new s.b8(h,e.u_terrain_coords_id),u_ele_delta:new s.b8(h,e.u_ele_delta)}),projectionErrorMeasurement:(h,e)=>({u_input:new s.b8(h,e.u_input),u_output_expected:new s.b8(h,e.u_output_expected)}),atmosphere:(h,e)=>({u_sun_pos:new s.bL(h,e.u_sun_pos),u_atmosphere_blend:new s.b8(h,e.u_atmosphere_blend),u_globe_position:new s.bL(h,e.u_globe_position),u_globe_radius:new s.b8(h,e.u_globe_radius),u_inv_proj_matrix:new s.bJ(h,e.u_inv_proj_matrix)}),sky:(h,e)=>({u_sky_color:new s.bI(h,e.u_sky_color),u_horizon_color:new s.bI(h,e.u_horizon_color),u_horizon:new s.bM(h,e.u_horizon),u_horizon_normal:new s.bM(h,e.u_horizon_normal),u_sky_horizon_blend:new s.b8(h,e.u_sky_horizon_blend),u_sky_blend:new s.b8(h,e.u_sky_blend)})};class Cc{constructor(e,r,a){this.context=e;const l=e.gl;this.buffer=l.createBuffer(),this.dynamicDraw=!!a,this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),l.bufferData(l.ELEMENT_ARRAY_BUFFER,r.arrayBuffer,this.dynamicDraw?l.DYNAMIC_DRAW:l.STATIC_DRAW),this.dynamicDraw||delete r.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){const r=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),r.bufferSubData(r.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Qa={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Tc{constructor(e,r,a,l){this.length=r.length,this.attributes=a,this.itemSize=r.bytesPerElement,this.dynamicDraw=l,this.context=e;const p=e.gl;this.buffer=p.createBuffer(),e.bindVertexBuffer.set(this.buffer),p.bufferData(p.ARRAY_BUFFER,r.arrayBuffer,this.dynamicDraw?p.DYNAMIC_DRAW:p.STATIC_DRAW),this.dynamicDraw||delete r.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){if(e.length!==this.length)throw new Error(`Length of new data is ${e.length}, which doesn't match current length of ${this.length}`);const r=this.context.gl;this.bind(),r.bufferSubData(r.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,r){for(let a=0;a<this.attributes.length;a++){const l=r.attributes[this.attributes[a].name];l!==void 0&&e.enableVertexAttribArray(l)}}setVertexAttribPointers(e,r,a){for(let l=0;l<this.attributes.length;l++){const p=this.attributes[l],y=r.attributes[p.name];y!==void 0&&e.vertexAttribPointer(y,p.components,e[Qa[p.type]],!1,this.itemSize,p.offset+this.itemSize*(a||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class jt{constructor(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(e){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class dn extends jt{getDefault(){return s.b7.transparent}set(e){const r=this.current;(e.r!==r.r||e.g!==r.g||e.b!==r.b||e.a!==r.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class Ya extends jt{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}}class $a extends jt{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}class el extends jt{getDefault(){return[!0,!0,!0,!0]}set(e){const r=this.current;(e[0]!==r[0]||e[1]!==r[1]||e[2]!==r[2]||e[3]!==r[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class Ec extends jt{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}}class tl extends jt{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}}class Jn extends jt{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){const r=this.current;(e.func!==r.func||e.ref!==r.ref||e.mask!==r.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}}class rl extends jt{getDefault(){const e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){const r=this.current;(e[0]!==r[0]||e[1]!==r[1]||e[2]!==r[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}}class Eh extends jt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;e?r.enable(r.STENCIL_TEST):r.disable(r.STENCIL_TEST),this.current=e,this.dirty=!1}}class Ph extends jt{getDefault(){return[0,1]}set(e){const r=this.current;(e[0]!==r[0]||e[1]!==r[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}}class Ih extends jt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;e?r.enable(r.DEPTH_TEST):r.disable(r.DEPTH_TEST),this.current=e,this.dirty=!1}}class Mh extends jt{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}}class Pc extends jt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;e?r.enable(r.BLEND):r.disable(r.BLEND),this.current=e,this.dirty=!1}}class Lh extends jt{getDefault(){const e=this.gl;return[e.ONE,e.ZERO]}set(e){const r=this.current;(e[0]!==r[0]||e[1]!==r[1]||this.dirty)&&(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)}}class Ic extends jt{getDefault(){return s.b7.transparent}set(e){const r=this.current;(e.r!==r.r||e.g!==r.g||e.b!==r.b||e.a!==r.a||this.dirty)&&(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class Wo extends jt{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquation(e),this.current=e,this.dirty=!1)}}class Ho extends jt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;e?r.enable(r.CULL_FACE):r.disable(r.CULL_FACE),this.current=e,this.dirty=!1}}class Zo extends jt{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}}class il extends jt{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}}class Xn extends jt{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}}class Ko extends jt{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}}class _s extends jt{getDefault(){const e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){const r=this.current;(e[0]!==r[0]||e[1]!==r[1]||e[2]!==r[2]||e[3]!==r[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class Ni extends jt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;r.bindFramebuffer(r.FRAMEBUFFER,e),this.current=e,this.dirty=!1}}class Mc extends jt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;r.bindRenderbuffer(r.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class Lc extends jt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;r.bindTexture(r.TEXTURE_2D,e),this.current=e,this.dirty=!1}}class nl extends jt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;r.bindBuffer(r.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class Qn extends jt{getDefault(){return null}set(e){const r=this.gl;r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class Go extends jt{getDefault(){return null}set(e){var r;if(e===this.current&&!this.dirty)return;const a=this.gl;ci(a)?a.bindVertexArray(e):(r=a.getExtension("OES_vertex_array_object"))===null||r===void 0||r.bindVertexArrayOES(e),this.current=e,this.dirty=!1}}class Jo extends jt{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;r.pixelStorei(r.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}}class eo extends jt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}}class Xo extends jt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}}class Qo extends jt{constructor(e,r){super(e),this.context=e,this.parent=r}getDefault(){return null}}class vs extends Qo{setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const r=this.gl;r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class xs extends Qo{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const r=this.gl;r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class Rc extends Qo{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const r=this.gl;r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,e),this.current=e,this.dirty=!1}}const Yo="Framebuffer is not complete";class Rt{constructor(e,r,a,l,p){this.context=e,this.width=r,this.height=a;const y=e.gl,w=this.framebuffer=y.createFramebuffer();if(this.colorAttachment=new vs(e,w),l)this.depthAttachment=p?new Rc(e,w):new xs(e,w);else if(p)throw new Error("Stencil cannot be set without depth");if(y.checkFramebufferStatus(y.FRAMEBUFFER)!==y.FRAMEBUFFER_COMPLETE)throw new Error(Yo)}destroy(){const e=this.context.gl,r=this.colorAttachment.get();if(r&&e.deleteTexture(r),this.depthAttachment){const a=this.depthAttachment.get();a&&e.deleteRenderbuffer(a)}e.deleteFramebuffer(this.framebuffer)}}class $o{constructor(e){var r,a;if(this.gl=e,this.clearColor=new dn(this),this.clearDepth=new Ya(this),this.clearStencil=new $a(this),this.colorMask=new el(this),this.depthMask=new Ec(this),this.stencilMask=new tl(this),this.stencilFunc=new Jn(this),this.stencilOp=new rl(this),this.stencilTest=new Eh(this),this.depthRange=new Ph(this),this.depthTest=new Ih(this),this.depthFunc=new Mh(this),this.blend=new Pc(this),this.blendFunc=new Lh(this),this.blendColor=new Ic(this),this.blendEquation=new Wo(this),this.cullFace=new Ho(this),this.cullFaceSide=new Zo(this),this.frontFace=new il(this),this.program=new Xn(this),this.activeTexture=new Ko(this),this.viewport=new _s(this),this.bindFramebuffer=new Ni(this),this.bindRenderbuffer=new Mc(this),this.bindTexture=new Lc(this),this.bindVertexBuffer=new nl(this),this.bindElementBuffer=new Qn(this),this.bindVertexArray=new Go(this),this.pixelStoreUnpack=new Jo(this),this.pixelStoreUnpackPremultiplyAlpha=new eo(this),this.pixelStoreUnpackFlipY=new Xo(this),this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),ci(e)){this.HALF_FLOAT=e.HALF_FLOAT;const l=e.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(r=e.RGBA16F)!==null&&r!==void 0?r:l==null?void 0:l.RGBA16F_EXT,this.RGB16F=(a=e.RGB16F)!==null&&a!==void 0?a:l==null?void 0:l.RGB16F_EXT,e.getExtension("EXT_color_buffer_float")}else{e.getExtension("EXT_color_buffer_half_float"),e.getExtension("OES_texture_half_float_linear");const l=e.getExtension("OES_texture_half_float");this.HALF_FLOAT=l==null?void 0:l.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(e,r){return new Cc(this,e,r)}createVertexBuffer(e,r,a){return new Tc(this,e,r,a)}createRenderbuffer(e,r,a){const l=this.gl,p=l.createRenderbuffer();return this.bindRenderbuffer.set(p),l.renderbufferStorage(l.RENDERBUFFER,e,r,a),this.bindRenderbuffer.set(null),p}createFramebuffer(e,r,a,l){return new Rt(this,e,r,a,l)}clear({color:e,depth:r,stencil:a}){const l=this.gl;let p=0;e&&(p|=l.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),r!==void 0&&(p|=l.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),a!==void 0&&(p|=l.STENCIL_BUFFER_BIT,this.clearStencil.set(a),this.stencilMask.set(255)),l.clear(p)}setCullFace(e){e.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}setStencilMode(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)}setColorMode(e){s.bE(e.blendFunction,$t.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)}createVertexArray(){var e;return ci(this.gl)?this.gl.createVertexArray():(e=this.gl.getExtension("OES_vertex_array_object"))===null||e===void 0?void 0:e.createVertexArrayOES()}deleteVertexArray(e){var r;return ci(this.gl)?this.gl.deleteVertexArray(e):(r=this.gl.getExtension("OES_vertex_array_object"))===null||r===void 0?void 0:r.deleteVertexArrayOES(e)}unbindVAO(){this.bindVertexArray.set(null)}}let ea;function sl(h,e,r,a,l){const p=h.context,y=h.transform,w=p.gl,A=h.useProgram("collisionBox"),R=[];let D=0,N=0;for(let ae=0;ae<a.length;ae++){const ue=a[ae],me=e.getTile(ue).getBucket(r);if(!me)continue;const fe=l?me.textCollisionBox:me.iconCollisionBox,ge=me.collisionCircleArray;ge.length>0&&(R.push({circleArray:ge,circleOffset:N,coord:ue}),D+=ge.length/4,N=D),fe&&A.draw(p,w.LINES,At.disabled,It.disabled,h.colorModeForRenderPass(),Nt.disabled,kh(h.transform),h.style.map.terrain&&h.style.map.terrain.getTerrainData(ue),y.getProjectionData({overscaledTileID:ue,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),r.id,fe.layoutVertexBuffer,fe.indexBuffer,fe.segments,null,h.transform.zoom,null,null,fe.collisionVertexBuffer)}if(!l||!R.length)return;const O=h.useProgram("collisionCircle"),Z=new s.bT;Z.resize(4*D),Z._trim();let K=0;for(const ae of R)for(let ue=0;ue<ae.circleArray.length/4;ue++){const me=4*ue,fe=ae.circleArray[me+0],ge=ae.circleArray[me+1],xe=ae.circleArray[me+2],ye=ae.circleArray[me+3];Z.emplace(K++,fe,ge,xe,ye,0),Z.emplace(K++,fe,ge,xe,ye,1),Z.emplace(K++,fe,ge,xe,ye,2),Z.emplace(K++,fe,ge,xe,ye,3)}(!ea||ea.length<2*D)&&(ea=function(ae){const ue=2*ae,me=new s.bV;me.resize(ue),me._trim();for(let fe=0;fe<ue;fe++){const ge=6*fe;me.uint16[ge+0]=4*fe+0,me.uint16[ge+1]=4*fe+1,me.uint16[ge+2]=4*fe+2,me.uint16[ge+3]=4*fe+2,me.uint16[ge+4]=4*fe+3,me.uint16[ge+5]=4*fe+0}return me}(D));const ne=p.createIndexBuffer(ea,!0),ie=p.createVertexBuffer(Z,s.bU.members,!0);for(const ae of R){const ue=Uo(h.transform);O.draw(p,w.TRIANGLES,At.disabled,It.disabled,h.colorModeForRenderPass(),Nt.disabled,ue,h.style.map.terrain&&h.style.map.terrain.getTerrainData(ae.coord),null,r.id,ie,ne,s.aJ.simpleSegment(0,2*ae.circleOffset,ae.circleArray.length,ae.circleArray.length/2),null,h.transform.zoom,null,null,null)}ie.destroy(),ne.destroy()}const to=s.ad(new Float32Array(16));function Rh(h,e,r,a,l,p){const{horizontalAlign:y,verticalAlign:w}=s.aE(h);return new s.P((-(y-.5)*e/l+a[0])*p,(-(w-.5)*r/l+a[1])*p)}function Bh(h,e,r,a,l,p){const y=e.tileAnchorPoint.add(new s.P(e.translation[0],e.translation[1]));if(e.pitchWithMap){let w=a.mult(p);r||(w=w.rotate(-l));const A=y.add(w);return Ve(A.x,A.y,e.pitchedLabelPlaneMatrix,e.getElevation).point}if(r){const w=xr(e.tileAnchorPoint.x+1,e.tileAnchorPoint.y,e).point.sub(h),A=Math.atan(w.y/w.x)+(w.x<0?Math.PI:0);return h.add(a.rotate(A))}return h.add(a)}function Bc(h,e,r,a,l,p,y,w,A,R,D,N){const O=h.text.placedSymbolArray,Z=h.text.dynamicLayoutVertexArray,K=h.icon.dynamicLayoutVertexArray,ne={};Z.clear();for(let ie=0;ie<O.length;ie++){const ae=O.get(ie),ue=ae.hidden||!ae.crossTileID||h.allowVerticalPlacement&&!ae.placedOrientation?null:a[ae.crossTileID];if(ue){const me=new s.P(ae.anchorX,ae.anchorY),fe={getElevation:N,width:l.width,height:l.height,pitchedLabelPlaneMatrix:p,pitchWithMap:r,transform:l,tileAnchorPoint:me,translation:R,unwrappedTileID:D},ge=r?Pt(me.x,me.y,fe):xr(me.x,me.y,fe),xe=Kt(l.cameraToCenterDistance,ge.signedDistanceFromCamera);let ye=s.am(h.textSizeData,w,ae)*xe/s.ay;r&&(ye*=h.tilePixelRatio/y);const{width:Te,height:Fe,anchor:Le,textOffset:Be,textBoxScale:De}=ue,Ye=Rh(Le,Te,Fe,Be,De,ye),Xe=l.getPitchedTextCorrection(me.x+R[0],me.y+R[1],D),He=Bh(ge.point,fe,e,Ye,-l.bearingInRadians,Xe),at=h.allowVerticalPlacement&&ae.placedOrientation===s.al.vertical?Math.PI/2:0;for(let Mt=0;Mt<ae.numGlyphs;Mt++)s.as(Z,He,at);A&&ae.associatedIconIndex>=0&&(ne[ae.associatedIconIndex]={shiftedAnchor:He,angle:at})}else hn(ae.numGlyphs,Z)}if(A){K.clear();const ie=h.icon.placedSymbolArray;for(let ae=0;ae<ie.length;ae++){const ue=ie.get(ae);if(ue.hidden)hn(ue.numGlyphs,K);else{const me=ne[ae];if(me)for(let fe=0;fe<ue.numGlyphs;fe++)s.as(K,me.shiftedAnchor,me.angle);else hn(ue.numGlyphs,K)}}h.icon.dynamicLayoutVertexBuffer.updateData(K)}h.text.dynamicLayoutVertexBuffer.updateData(Z)}function Dh(h,e,r){return r.iconsInText&&e?"symbolTextAndIcon":h?"symbolSDF":"symbolIcon"}function ta(h,e,r,a,l,p,y,w,A,R,D,N,O){const Z=h.context,K=Z.gl,ne=h.transform,ie=w==="map",ae=A==="map",ue=w!=="viewport"&&r.layout.get("symbol-placement")!=="point",me=ie&&!ae&&!ue,fe=!r.layout.get("symbol-sort-key").isConstant();let ge=!1;const xe=h.getDepthModeForSublayer(0,At.ReadOnly),ye=r._unevaluatedLayout.hasValue("text-variable-anchor")||r._unevaluatedLayout.hasValue("text-variable-anchor-offset"),Te=[],Fe=ne.getCircleRadiusCorrection();for(const Le of a){const Be=e.getTile(Le),De=Be.getBucket(r);if(!De)continue;const Ye=l?De.text:De.icon;if(!Ye||!Ye.segments.get().length||!Ye.hasVisibleVertices)continue;const Xe=Ye.programConfigurations.get(r.id),He=l||De.sdfIcons,at=l?De.textSizeData:De.iconSizeData,Mt=ae||ne.pitch!==0,qt=h.useProgram(Dh(He,l,De),Xe),mr=s.ak(at,ne.zoom),tr=h.style.map.terrain&&h.style.map.terrain.getTerrainData(Le);let gr,yr,sr,Ht,jr=[0,0],Xr=null;if(l)yr=Be.glyphAtlasTexture,sr=K.LINEAR,gr=Be.glyphAtlasTexture.size,De.iconsInText&&(jr=Be.imageAtlasTexture.size,Xr=Be.imageAtlasTexture,Ht=Mt||h.options.rotating||h.options.zooming||at.kind==="composite"||at.kind==="camera"?K.LINEAR:K.NEAREST);else{const Fr=r.layout.get("icon-size").constantOr(0)!==1||De.iconsNeedLinear;yr=Be.imageAtlasTexture,sr=He||h.options.rotating||h.options.zooming||Fr||Mt?K.LINEAR:K.NEAREST,gr=Be.imageAtlasTexture.size}const ii=s.az(Be,1,h.transform.zoom),Zt=ft(ie,h.transform,ii),En=s.K();s.an(En,Zt);const cn=Tt(ae,ie,h.transform,ii),Pn=s.aA(ne,Be,p,y),es=ne.getProjectionData({overscaledTileID:Le,applyGlobeMatrix:!O,applyTerrainMatrix:!0}),yo=ye&&De.hasTextData(),In=r.layout.get("icon-text-fit")!=="none"&&yo&&De.hasIconData();if(ue){const Fr=h.style.map.terrain?(_i,cr)=>h.style.map.terrain.getElevation(Le,_i,cr):null,Or=r.layout.get("text-rotation-alignment")==="map";Wt(De,h,l,Zt,En,ae,R,Or,Le.toUnwrapped(),ne.width,ne.height,Pn,Fr)}const ts=l&&ye||In,Ri=ue||ts?to:ae?Zt:h.transform.clipSpaceToPixelsMatrix,Mn=He&&r.paint.get(l?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let mn;mn=He?De.iconsInText?jo(at.kind,mr,me,ae,ue,ts,h,Ri,cn,Pn,gr,jr,Fe):kc(at.kind,mr,me,ae,ue,ts,h,Ri,cn,Pn,l,gr,0,Fe):ys(at.kind,mr,me,ae,ue,ts,h,Ri,cn,Pn,l,gr,Fe);const Ln={program:qt,buffers:Ye,uniformValues:mn,projectionData:es,atlasTexture:yr,atlasTextureIcon:Xr,atlasInterpolation:sr,atlasInterpolationIcon:Ht,isSDF:He,hasHalo:Mn};if(fe&&De.canOverlap){ge=!0;const Fr=Ye.segments.get();for(const Or of Fr)Te.push({segments:new s.aJ([Or]),sortKey:Or.sortKey,state:Ln,terrainData:tr})}else Te.push({segments:Ye.segments,sortKey:0,state:Ln,terrainData:tr})}ge&&Te.sort((Le,Be)=>Le.sortKey-Be.sortKey);for(const Le of Te){const Be=Le.state;if(Z.activeTexture.set(K.TEXTURE0),Be.atlasTexture.bind(Be.atlasInterpolation,K.CLAMP_TO_EDGE),Be.atlasTextureIcon&&(Z.activeTexture.set(K.TEXTURE1),Be.atlasTextureIcon&&Be.atlasTextureIcon.bind(Be.atlasInterpolationIcon,K.CLAMP_TO_EDGE)),Be.isSDF){const De=Be.uniformValues;Be.hasHalo&&(De.u_is_halo=1,ro(Be.buffers,Le.segments,r,h,Be.program,xe,D,N,De,Be.projectionData,Le.terrainData)),De.u_is_halo=0}ro(Be.buffers,Le.segments,r,h,Be.program,xe,D,N,Be.uniformValues,Be.projectionData,Le.terrainData)}}function ro(h,e,r,a,l,p,y,w,A,R,D){const N=a.context;l.draw(N,N.gl.TRIANGLES,p,y,w,Nt.backCCW,A,D,R,r.id,h.layoutVertexBuffer,h.indexBuffer,e,r.paint,a.transform.zoom,h.programConfigurations.get(r.id),h.dynamicLayoutVertexBuffer,h.opacityVertexBuffer)}function ra(h,e,r,a,l){const p=h.context,y=p.gl,w=It.disabled,A=new $t([y.ONE,y.ONE],s.b7.transparent,[!0,!0,!0,!0]),R=e.getBucket(r);if(!R)return;const D=a.key;let N=r.heatmapFbos.get(D);N||(N=ia(p,e.tileSize,e.tileSize),r.heatmapFbos.set(D,N)),p.bindFramebuffer.set(N.framebuffer),p.viewport.set([0,0,e.tileSize,e.tileSize]),p.clear({color:s.b7.transparent});const O=R.programConfigurations.get(r.id),Z=h.useProgram("heatmap",O,!l),K=h.transform.getProjectionData({overscaledTileID:e.tileID,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),ne=h.style.map.terrain.getTerrainData(a);Z.draw(p,y.TRIANGLES,At.disabled,w,A,Nt.disabled,Gn(e,h.transform.zoom,r.paint.get("heatmap-intensity"),1),ne,K,r.id,R.layoutVertexBuffer,R.indexBuffer,R.segments,r.paint,h.transform.zoom,O)}function ol(h,e,r,a,l){const p=h.context,y=p.gl,w=h.transform;p.setColorMode(h.colorModeForRenderPass());const A=al(p,e),R=r.key,D=e.heatmapFbos.get(R);if(!D)return;p.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,D.colorAttachment.get()),p.activeTexture.set(y.TEXTURE1),A.bind(y.LINEAR,y.CLAMP_TO_EDGE);const N=w.getProjectionData({overscaledTileID:r,applyTerrainMatrix:l,applyGlobeMatrix:!a});h.useProgram("heatmapTexture").draw(p,y.TRIANGLES,At.disabled,It.disabled,h.colorModeForRenderPass(),Nt.disabled,gc(h,e,0,1),null,N,e.id,h.rasterBoundsBuffer,h.quadTriangleIndexBuffer,h.rasterBoundsSegments,e.paint,w.zoom),D.destroy(),e.heatmapFbos.delete(R)}function ia(h,e,r){var a,l;const p=h.gl,y=p.createTexture();p.bindTexture(p.TEXTURE_2D,y),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,p.LINEAR),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,p.LINEAR);const w=(a=h.HALF_FLOAT)!==null&&a!==void 0?a:p.UNSIGNED_BYTE,A=(l=h.RGBA16F)!==null&&l!==void 0?l:p.RGBA;p.texImage2D(p.TEXTURE_2D,0,A,e,r,0,p.RGBA,w,null);const R=h.createFramebuffer(e,r,!1,!1);return R.colorAttachment.set(y),R}function al(h,e){return e.colorRampTexture||(e.colorRampTexture=new Ze(h,e.colorRamp,h.gl.RGBA)),e.colorRampTexture}function io(h,e,r,a,l){if(!r||!a||!a.imageAtlas)return;const p=a.imageAtlas.patternPositions;let y=p[r.to.toString()],w=p[r.from.toString()];if(!y&&w&&(y=w),!w&&y&&(w=y),!y||!w){const A=l.getPaintProperty(e);y=p[A],w=p[A]}y&&w&&h.setConstantPatternPositions(y,w)}function no(h,e,r,a,l,p,y,w){const A=h.context.gl,R="fill-pattern",D=r.paint.get(R),N=D&&D.constantOr(1),O=r.getCrossfadeParameters();let Z,K,ne,ie,ae;const ue=h.transform,me=r.paint.get("fill-translate"),fe=r.paint.get("fill-translate-anchor");y?(K=N&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",Z=A.LINES):(K=N?"fillPattern":"fill",Z=A.TRIANGLES);const ge=D.constantOr(null);for(const xe of a){const ye=e.getTile(xe);if(N&&!ye.patternsLoaded())continue;const Te=ye.getBucket(r);if(!Te)continue;const Fe=Te.programConfigurations.get(r.id),Le=h.useProgram(K,Fe),Be=h.style.map.terrain&&h.style.map.terrain.getTerrainData(xe);N&&(h.context.activeTexture.set(A.TEXTURE0),ye.imageAtlasTexture.bind(A.LINEAR,A.CLAMP_TO_EDGE),Fe.updatePaintBuffers(O)),io(Fe,R,ge,ye,r);const De=ue.getProjectionData({overscaledTileID:xe,applyGlobeMatrix:!w,applyTerrainMatrix:!0}),Ye=s.aA(ue,ye,me,fe);if(y){ie=Te.indexBuffer2,ae=Te.segments2;const He=[A.drawingBufferWidth,A.drawingBufferHeight];ne=K==="fillOutlinePattern"&&N?Qs(h,O,ye,He,Ye):Ga(He,Ye)}else ie=Te.indexBuffer,ae=Te.segments,ne=N?fc(h,O,ye,Ye):{u_fill_translate:Ye};const Xe=h.stencilModeForClipping(xe);Le.draw(h.context,Z,l,Xe,p,Nt.backCCW,ne,Be,De,r.id,Te.layoutVertexBuffer,ie,ae,r.paint,h.transform.zoom,Fe)}}function so(h,e,r,a,l,p,y,w){const A=h.context,R=A.gl,D="fill-extrusion-pattern",N=r.paint.get(D),O=N.constantOr(1),Z=r.getCrossfadeParameters(),K=r.paint.get("fill-extrusion-opacity"),ne=N.constantOr(null),ie=h.transform;for(const ae of a){const ue=e.getTile(ae),me=ue.getBucket(r);if(!me)continue;const fe=h.style.map.terrain&&h.style.map.terrain.getTerrainData(ae),ge=me.programConfigurations.get(r.id),xe=h.useProgram(O?"fillExtrusionPattern":"fillExtrusion",ge);O&&(h.context.activeTexture.set(R.TEXTURE0),ue.imageAtlasTexture.bind(R.LINEAR,R.CLAMP_TO_EDGE),ge.updatePaintBuffers(Z));const ye=ie.getProjectionData({overscaledTileID:ae,applyGlobeMatrix:!w,applyTerrainMatrix:!0});io(ge,D,ne,ue,r);const Te=s.aA(ie,ue,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),Fe=r.paint.get("fill-extrusion-vertical-gradient"),Le=O?on(h,Fe,K,Te,ae,Z,ue):qo(h,Fe,K,Te);xe.draw(A,A.gl.TRIANGLES,l,p,y,Nt.backCCW,Le,fe,ye,r.id,me.layoutVertexBuffer,me.indexBuffer,me.segments,r.paint,h.transform.zoom,ge,h.style.map.terrain&&me.centroidVertexBuffer)}}function ll(h,e,r,a,l,p,y,w,A){var R;const D=h.style.projection,N=h.context,O=h.transform,Z=N.gl,K=[`#define NUM_ILLUMINATION_SOURCES ${r.paint.get("hillshade-highlight-color").values.length}`],ne=h.useProgram("hillshade",null,!1,K),ie=!h.options.moving;for(const ae of a){const ue=e.getTile(ae),me=ue.fbo;if(!me)continue;const fe=D.getMeshFromTileID(N,ae.canonical,w,!0,"raster"),ge=(R=h.style.map.terrain)===null||R===void 0?void 0:R.getTerrainData(ae);N.activeTexture.set(Z.TEXTURE0),Z.bindTexture(Z.TEXTURE_2D,me.colorAttachment.get());const xe=O.getProjectionData({overscaledTileID:ae,aligned:ie,applyGlobeMatrix:!A,applyTerrainMatrix:!0});ne.draw(N,Z.TRIANGLES,p,l[ae.overscaledZ],y,Nt.backCCW,yc(h,ue,r),ge,xe,r.id,fe.vertexBuffer,fe.indexBuffer,fe.segments)}}const oo=[new s.P(0,0),new s.P(s.Z,0),new s.P(s.Z,s.Z),new s.P(0,s.Z)];function na(h,e,r,a,l,p,y,w,A=!1,R=!1){const D=a[a.length-1].overscaledZ,N=h.context,O=N.gl,Z=h.useProgram("raster"),K=h.transform,ne=h.style.projection,ie=h.colorModeForRenderPass(),ae=!h.options.moving;for(const ue of a){const me=h.getDepthModeForSublayer(ue.overscaledZ-D,r.paint.get("raster-opacity")===1?At.ReadWrite:At.ReadOnly,O.LESS),fe=e.getTile(ue);fe.registerFadeDuration(r.paint.get("raster-fade-duration"));const ge=e.findLoadedParent(ue,0),xe=e.findLoadedSibling(ue),ye=Dc(fe,ge||xe||null,e,r,h.transform,h.style.map.terrain);let Te,Fe;const Le=r.paint.get("raster-resampling")==="nearest"?O.NEAREST:O.LINEAR;N.activeTexture.set(O.TEXTURE0),fe.texture.bind(Le,O.CLAMP_TO_EDGE,O.LINEAR_MIPMAP_NEAREST),N.activeTexture.set(O.TEXTURE1),ge?(ge.texture.bind(Le,O.CLAMP_TO_EDGE,O.LINEAR_MIPMAP_NEAREST),Te=Math.pow(2,ge.tileID.overscaledZ-fe.tileID.overscaledZ),Fe=[fe.tileID.canonical.x*Te%1,fe.tileID.canonical.y*Te%1]):fe.texture.bind(Le,O.CLAMP_TO_EDGE,O.LINEAR_MIPMAP_NEAREST),fe.texture.useMipmap&&N.extTextureFilterAnisotropic&&h.transform.pitch>20&&O.texParameterf(O.TEXTURE_2D,N.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,N.extTextureFilterAnisotropicMax);const Be=h.style.map.terrain&&h.style.map.terrain.getTerrainData(ue),De=K.getProjectionData({overscaledTileID:ue,aligned:ae,applyGlobeMatrix:!R,applyTerrainMatrix:!0}),Ye=wc(Fe||[0,0],Te||1,ye,r,w),Xe=ne.getMeshFromTileID(N,ue.canonical,p,y,"raster");Z.draw(N,O.TRIANGLES,me,l?l[ue.overscaledZ]:It.disabled,ie,A?Nt.frontCCW:Nt.backCCW,Ye,Be,De,r.id,Xe.vertexBuffer,Xe.indexBuffer,Xe.segments)}}function Dc(h,e,r,a,l,p){const y=a.paint.get("raster-fade-duration");if(!p&&y>0){const w=M.now(),A=(w-h.timeAdded)/y,R=e?(w-e.timeAdded)/y:-1,D=r.getSource(),N=Pe(l,{tileSize:D.tileSize,roundZoom:D.roundZoom}),O=!e||Math.abs(e.tileID.overscaledZ-N)>Math.abs(h.tileID.overscaledZ-N),Z=O&&h.refreshedUponExpiration?1:s.ae(O?A:1-R,0,1);return h.refreshedUponExpiration&&A>=1&&(h.refreshedUponExpiration=!1),e?{opacity:1,mix:1-Z}:{opacity:Z,mix:0}}return{opacity:1,mix:0}}const sa=new s.b7(1,0,0,1),cl=new s.b7(0,1,0,1),Vc=new s.b7(0,0,1,1),zc=new s.b7(1,0,1,1),oa=new s.b7(0,1,1,1);function aa(h,e,r,a){ao(h,0,e+r/2,h.transform.width,r,a)}function Fc(h,e,r,a){ao(h,e-r/2,0,r,h.transform.height,a)}function ao(h,e,r,a,l,p){const y=h.context,w=y.gl;w.enable(w.SCISSOR_TEST),w.scissor(e*h.pixelRatio,r*h.pixelRatio,a*h.pixelRatio,l*h.pixelRatio),y.clear({color:p}),w.disable(w.SCISSOR_TEST)}function Tr(h,e,r){const a=h.context,l=a.gl,p=h.useProgram("debug"),y=At.disabled,w=It.disabled,A=h.colorModeForRenderPass(),R="$debug",D=h.style.map.terrain&&h.style.map.terrain.getTerrainData(r);a.activeTexture.set(l.TEXTURE0);const N=e.getTileByID(r.key).latestRawTileData,O=Math.floor((N&&N.byteLength||0)/1024),Z=e.getTile(r).tileSize,K=512/Math.min(Z,512)*(r.overscaledZ/h.transform.zoom)*.5;let ne=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(ne+=` => ${r.overscaledZ}`),function(ae,ue){ae.initDebugOverlayCanvas();const me=ae.debugOverlayCanvas,fe=ae.context.gl,ge=ae.debugOverlayCanvas.getContext("2d");ge.clearRect(0,0,me.width,me.height),ge.shadowColor="white",ge.shadowBlur=2,ge.lineWidth=1.5,ge.strokeStyle="white",ge.textBaseline="top",ge.font="bold 36px Open Sans, sans-serif",ge.fillText(ue,5,5),ge.strokeText(ue,5,5),ae.debugOverlayTexture.update(me),ae.debugOverlayTexture.bind(fe.LINEAR,fe.CLAMP_TO_EDGE)}(h,`${ne} ${O}kB`);const ie=h.transform.getProjectionData({overscaledTileID:r,applyGlobeMatrix:!0,applyTerrainMatrix:!0});p.draw(a,l.TRIANGLES,y,w,$t.alphaBlended,Nt.disabled,mc(s.b7.transparent,K),null,ie,R,h.debugBuffer,h.quadTriangleIndexBuffer,h.debugSegments),p.draw(a,l.LINE_STRIP,y,w,A,Nt.disabled,mc(s.b7.red),D,ie,R,h.debugBuffer,h.tileBorderIndexBuffer,h.debugSegments)}function Tn(h,e,r,a){const{isRenderingGlobe:l}=a,p=h.context,y=p.gl,w=h.transform,A=h.colorModeForRenderPass(),R=h.getDepthModeFor3D(),D=h.useProgram("terrain");p.bindFramebuffer.set(null),p.viewport.set([0,0,h.width,h.height]);for(const N of r){const O=e.getTerrainMesh(N.tileID),Z=h.renderToTexture.getTexture(N),K=e.getTerrainData(N.tileID);p.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,Z.texture);const ne=e.getMeshFrameDelta(w.zoom),ie=w.calculateFogMatrix(N.tileID.toUnwrapped()),ae=Sh(ne,ie,h.style.sky,w.pitch,l),ue=w.getProjectionData({overscaledTileID:N.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});D.draw(p,y.TRIANGLES,R,It.disabled,A,Nt.backCCW,ae,K,ue,"terrain",O.vertexBuffer,O.indexBuffer,O.segments)}}function Li(h,e){if(!e.mesh){const r=new s.aI;r.emplaceBack(-1,-1),r.emplaceBack(1,-1),r.emplaceBack(1,1),r.emplaceBack(-1,1);const a=new s.aK;a.emplaceBack(0,1,2),a.emplaceBack(0,2,3),e.mesh=new hs(h.createVertexBuffer(r,mi.members),h.createIndexBuffer(a),s.aJ.simpleSegment(0,0,r.length,a.length))}return e.mesh}class ul{constructor(e,r){this.context=new $o(e),this.transform=r,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:s.ad(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Ae.maxUnderzooming+Ae.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new qs}resize(e,r,a){if(this.width=Math.floor(e*a),this.height=Math.floor(r*a),this.pixelRatio=a,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const l of this.style._order)this.style._layers[l].resize()}setup(){const e=this.context,r=new s.aI;r.emplaceBack(0,0),r.emplaceBack(s.Z,0),r.emplaceBack(0,s.Z),r.emplaceBack(s.Z,s.Z),this.tileExtentBuffer=e.createVertexBuffer(r,mi.members),this.tileExtentSegments=s.aJ.simpleSegment(0,0,4,2);const a=new s.aI;a.emplaceBack(0,0),a.emplaceBack(s.Z,0),a.emplaceBack(0,s.Z),a.emplaceBack(s.Z,s.Z),this.debugBuffer=e.createVertexBuffer(a,mi.members),this.debugSegments=s.aJ.simpleSegment(0,0,4,5);const l=new s.b_;l.emplaceBack(0,0,0,0),l.emplaceBack(s.Z,0,s.Z,0),l.emplaceBack(0,s.Z,0,s.Z),l.emplaceBack(s.Z,s.Z,s.Z,s.Z),this.rasterBoundsBuffer=e.createVertexBuffer(l,bh.members),this.rasterBoundsSegments=s.aJ.simpleSegment(0,0,4,2);const p=new s.aI;p.emplaceBack(0,0),p.emplaceBack(s.Z,0),p.emplaceBack(0,s.Z),p.emplaceBack(s.Z,s.Z),this.rasterBoundsBufferPosOnly=e.createVertexBuffer(p,mi.members),this.rasterBoundsSegmentsPosOnly=s.aJ.simpleSegment(0,0,4,5);const y=new s.aI;y.emplaceBack(0,0),y.emplaceBack(1,0),y.emplaceBack(0,1),y.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(y,mi.members),this.viewportSegments=s.aJ.simpleSegment(0,0,4,2);const w=new s.b$;w.emplaceBack(0),w.emplaceBack(1),w.emplaceBack(3),w.emplaceBack(2),w.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(w);const A=new s.aK;A.emplaceBack(1,0,2),A.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(A);const R=this.context.gl;this.stencilClearMode=new It({func:R.ALWAYS,mask:0},0,255,R.ZERO,R.ZERO,R.ZERO),this.tileExtentMesh=new hs(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){const e=this.context,r=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const a=s.K();s.bQ(a,0,this.width,this.height,0,0,1),s.M(a,a,[r.drawingBufferWidth,r.drawingBufferHeight,0]);const l={mainMatrix:a,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:a};this.useProgram("clippingMask",null,!0).draw(e,r.TRIANGLES,At.disabled,this.stencilClearMode,$t.disabled,Nt.disabled,null,null,l,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(e,r,a){if(this.currentStencilSource===e.source||!e.isTileClipped()||!r||!r.length)return;this.currentStencilSource=e.source,this.nextStencilID+r.length>256&&this.clearStencil();const l=this.context;l.setColorMode($t.disabled),l.setDepthMode(At.disabled);const p={};for(const y of r)p[y.key]=this.nextStencilID++;this._renderTileMasks(p,r,a,!0),this._renderTileMasks(p,r,a,!1),this._tileClippingMaskIDs=p}_renderTileMasks(e,r,a,l){const p=this.context,y=p.gl,w=this.style.projection,A=this.transform,R=this.useProgram("clippingMask");for(const D of r){const N=e[D.key],O=this.style.map.terrain&&this.style.map.terrain.getTerrainData(D),Z=w.getMeshFromTileID(this.context,D.canonical,l,!0,"stencil"),K=A.getProjectionData({overscaledTileID:D,applyGlobeMatrix:!a,applyTerrainMatrix:!0});R.draw(p,y.TRIANGLES,At.disabled,new It({func:y.ALWAYS,mask:0},N,255,y.KEEP,y.KEEP,y.REPLACE),$t.disabled,a?Nt.disabled:Nt.backCCW,null,O,K,"$clipping",Z.vertexBuffer,Z.indexBuffer,Z.segments)}}_renderTilesDepthBuffer(){const e=this.context,r=e.gl,a=this.style.projection,l=this.transform,p=this.useProgram("depth"),y=this.getDepthModeFor3D(),w=be(l,{tileSize:l.tileSize});for(const A of w){const R=this.style.map.terrain&&this.style.map.terrain.getTerrainData(A),D=a.getMeshFromTileID(this.context,A.canonical,!0,!0,"raster"),N=l.getProjectionData({overscaledTileID:A,applyGlobeMatrix:!0,applyTerrainMatrix:!0});p.draw(e,r.TRIANGLES,y,It.disabled,$t.disabled,Nt.backCCW,null,R,N,"$clipping",D.vertexBuffer,D.indexBuffer,D.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const e=this.nextStencilID++,r=this.context.gl;return new It({func:r.NOTEQUAL,mask:255},e,255,r.KEEP,r.KEEP,r.REPLACE)}stencilModeForClipping(e){const r=this.context.gl;return new It({func:r.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,r.KEEP,r.KEEP,r.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(e){const r=this.context.gl,a=e.sort((y,w)=>w.overscaledZ-y.overscaledZ),l=a[a.length-1].overscaledZ,p=a[0].overscaledZ-l+1;if(p>1){this.currentStencilSource=void 0,this.nextStencilID+p>256&&this.clearStencil();const y={};for(let w=0;w<p;w++)y[w+l]=new It({func:r.GEQUAL,mask:255},w+this.nextStencilID,255,r.KEEP,r.KEEP,r.REPLACE);return this.nextStencilID+=p,[y,a]}return[{[l]:It.disabled},a]}stencilConfigForOverlapTwoPass(e){const r=this.context.gl,a=e.sort((y,w)=>w.overscaledZ-y.overscaledZ),l=a[a.length-1].overscaledZ,p=a[0].overscaledZ-l+1;if(this.clearStencil(),p>1){const y={},w={};for(let A=0;A<p;A++)y[A+l]=new It({func:r.GREATER,mask:255},p+1+A,255,r.KEEP,r.KEEP,r.REPLACE),w[A+l]=new It({func:r.GREATER,mask:255},1+A,255,r.KEEP,r.KEEP,r.REPLACE);return this.nextStencilID=2*p+1,[y,w,a]}return this.nextStencilID=3,[{[l]:new It({func:r.GREATER,mask:255},2,255,r.KEEP,r.KEEP,r.REPLACE)},{[l]:new It({func:r.GREATER,mask:255},1,255,r.KEEP,r.KEEP,r.REPLACE)},a]}colorModeForRenderPass(){const e=this.context.gl;return this._showOverdrawInspector?new $t([e.CONSTANT_COLOR,e.ONE],new s.b7(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?$t.unblended:$t.alphaBlended}getDepthModeForSublayer(e,r,a){if(!this.opaquePassEnabledForLayer())return At.disabled;const l=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new At(a||this.context.gl.LEQUAL,r,[l,l])}getDepthModeFor3D(){return new At(this.context.gl.LEQUAL,At.ReadWrite,this.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(e,r){var a,l;this.style=e,this.options=r,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(M.now()),this.imageManager.beginFrame();const p=this.style._order,y=this.style.sourceCaches,w={},A={},R={},D={isRenderingToTexture:!1,isRenderingGlobe:((a=e.projection)===null||a===void 0?void 0:a.transitionState)>0};for(const O in y){const Z=y[O];Z.used&&Z.prepare(this.context),w[O]=Z.getVisibleCoordinates(!1),A[O]=w[O].slice().reverse(),R[O]=Z.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let O=0;O<p.length;O++)if(this.style._layers[p[O]].is3D()){this.opaquePassCutoff=O;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(const O of p){const Z=this.style._layers[O];if(!Z.hasOffscreenPass()||Z.isHidden(this.transform.zoom))continue;const K=A[Z.source];(Z.type==="custom"||K.length)&&this.renderLayer(this,y[Z.source],Z,K,D)}if((l=this.style.projection)===null||l===void 0||l.updateGPUdependent({context:this.context,useProgram:O=>this.useProgram(O)}),this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:r.showOverdrawInspector?s.b7.black:s.b7.transparent,depth:1}),this.clearStencil(),this.style.sky&&function(O,Z){const K=O.context,ne=K.gl,ie=((xe,ye,Te)=>{const Fe=Math.cos(ye.rollInRadians),Le=Math.sin(ye.rollInRadians),Be=we(ye),De=ye.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition;return{u_sky_color:xe.properties.get("sky-color"),u_horizon_color:xe.properties.get("horizon-color"),u_horizon:[(ye.width/2-Be*Le)*Te,(ye.height/2+Be*Fe)*Te],u_horizon_normal:[-Le,Fe],u_sky_horizon_blend:xe.properties.get("sky-horizon-blend")*ye.height/2*Te,u_sky_blend:De}})(Z,O.style.map.transform,O.pixelRatio),ae=new At(ne.LEQUAL,At.ReadWrite,[0,1]),ue=It.disabled,me=O.colorModeForRenderPass(),fe=O.useProgram("sky"),ge=Li(K,Z);fe.draw(K,ne.TRIANGLES,ae,ue,me,Nt.disabled,ie,null,void 0,"sky",ge.vertexBuffer,ge.indexBuffer,ge.segments)}(this,this.style.sky),this._showOverdrawInspector=r.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=p.length-1;this.currentLayer>=0;this.currentLayer--){const O=this.style._layers[p[this.currentLayer]],Z=y[O.source],K=w[O.source];this._renderTileClippingMasks(O,K,!1),this.renderLayer(this,Z,O,K,D)}this.renderPass="translucent";let N=!1;for(this.currentLayer=0;this.currentLayer<p.length;this.currentLayer++){const O=this.style._layers[p[this.currentLayer]],Z=y[O.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(O,D))continue;this.opaquePassEnabledForLayer()||N||(N=!0,D.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());const K=(O.type==="symbol"?R:A)[O.source];this._renderTileClippingMasks(O,w[O.source],!!this.renderToTexture),this.renderLayer(this,Z,O,K,D)}if(D.isRenderingGlobe&&function(O,Z,K){const ne=O.context,ie=ne.gl,ae=O.useProgram("atmosphere"),ue=new At(ie.LEQUAL,At.ReadOnly,[0,1]),me=O.transform,fe=function(De,Ye){const Xe=De.properties.get("position"),He=[-Xe.x,-Xe.y,-Xe.z],at=s.ad(new Float64Array(16));return De.properties.get("anchor")==="map"&&(s.a_(at,at,Ye.rollInRadians),s.a$(at,at,-Ye.pitchInRadians),s.a_(at,at,Ye.bearingInRadians),s.a$(at,at,Ye.center.lat*Math.PI/180),s.bp(at,at,-Ye.center.lng*Math.PI/180)),s.bZ(He,He,at),He}(K,O.transform),ge=me.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),xe=Z.properties.get("atmosphere-blend")*ge.projectionTransition;if(xe===0)return;const ye=Hn(me.worldSize,me.center.lat),Te=me.inverseProjectionMatrix,Fe=new Float64Array(4);Fe[3]=1,s.at(Fe,Fe,me.modelViewProjectionMatrix),Fe[0]/=Fe[3],Fe[1]/=Fe[3],Fe[2]/=Fe[3],Fe[3]=1,s.at(Fe,Fe,Te),Fe[0]/=Fe[3],Fe[1]/=Fe[3],Fe[2]/=Fe[3],Fe[3]=1;const Le=((De,Ye,Xe,He,at)=>({u_sun_pos:De,u_atmosphere_blend:Ye,u_globe_position:Xe,u_globe_radius:He,u_inv_proj_matrix:at}))(fe,xe,[Fe[0],Fe[1],Fe[2]],ye,Te),Be=Li(ne,Z);ae.draw(ne,ie.TRIANGLES,ue,It.disabled,$t.alphaBlended,Nt.disabled,Le,null,null,"atmosphere",Be.vertexBuffer,Be.indexBuffer,Be.segments)}(this,this.style.sky,this.style.light),this.options.showTileBoundaries){const O=function(Z,K){let ne=null;const ie=Object.values(Z._layers).flatMap(fe=>fe.source&&!fe.isHidden(K)?[Z.sourceCaches[fe.source]]:[]),ae=ie.filter(fe=>fe.getSource().type==="vector"),ue=ie.filter(fe=>fe.getSource().type!=="vector"),me=fe=>{(!ne||ne.getSource().maxzoom<fe.getSource().maxzoom)&&(ne=fe)};return ae.forEach(fe=>me(fe)),ne||ue.forEach(fe=>me(fe)),ne}(this.style,this.transform.zoom);O&&function(Z,K,ne){for(let ie=0;ie<ne.length;ie++)Tr(Z,K,ne[ie])}(this,O,O.getVisibleCoordinates())}this.options.showPadding&&function(O){const Z=O.transform.padding;aa(O,O.transform.height-(Z.top||0),3,sa),aa(O,Z.bottom||0,3,cl),Fc(O,Z.left||0,3,Vc),Fc(O,O.transform.width-(Z.right||0),3,zc);const K=O.transform.centerPoint;(function(ne,ie,ae,ue){ao(ne,ie-1,ae-10,2,20,ue),ao(ne,ie-10,ae-1,20,2,ue)})(O,K.x,O.transform.height-K.y,oa)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(e){if(!this.style||!this.style.map||!this.style.map.terrain)return;const r=this.terrainFacilitator.matrix,a=this.transform.modelViewProjectionMatrix;let l=this.terrainFacilitator.dirty;l||(l=e?!s.c0(r,a):!s.c1(r,a)),l||(l=this.style.map.terrain.sourceCache.anyTilesAfterTime(this.terrainFacilitator.renderTime)),l&&(s.c2(r,a),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(p,y){const w=p.context,A=w.gl,R=p.transform,D=$t.unblended,N=new At(A.LEQUAL,At.ReadWrite,[0,1]),O=y.sourceCache.getRenderableTiles(),Z=p.useProgram("terrainDepth");w.bindFramebuffer.set(y.getFramebuffer("depth").framebuffer),w.viewport.set([0,0,p.width/devicePixelRatio,p.height/devicePixelRatio]),w.clear({color:s.b7.transparent,depth:1});for(const K of O){const ne=y.getTerrainMesh(K.tileID),ie=y.getTerrainData(K.tileID),ae=R.getProjectionData({overscaledTileID:K.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),ue={u_ele_delta:y.getMeshFrameDelta(R.zoom)};Z.draw(w,A.TRIANGLES,N,It.disabled,D,Nt.backCCW,ue,ie,ae,"terrain",ne.vertexBuffer,ne.indexBuffer,ne.segments)}w.bindFramebuffer.set(null),w.viewport.set([0,0,p.width,p.height])}(this,this.style.map.terrain),function(p,y){const w=p.context,A=w.gl,R=p.transform,D=$t.unblended,N=new At(A.LEQUAL,At.ReadWrite,[0,1]),O=y.getCoordsTexture(),Z=y.sourceCache.getRenderableTiles(),K=p.useProgram("terrainCoords");w.bindFramebuffer.set(y.getFramebuffer("coords").framebuffer),w.viewport.set([0,0,p.width/devicePixelRatio,p.height/devicePixelRatio]),w.clear({color:s.b7.transparent,depth:1}),y.coordsIndex=[];for(const ne of Z){const ie=y.getTerrainMesh(ne.tileID),ae=y.getTerrainData(ne.tileID);w.activeTexture.set(A.TEXTURE0),A.bindTexture(A.TEXTURE_2D,O.texture);const ue={u_terrain_coords_id:(255-y.coordsIndex.length)/255,u_texture:0,u_ele_delta:y.getMeshFrameDelta(R.zoom)},me=R.getProjectionData({overscaledTileID:ne.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});K.draw(w,A.TRIANGLES,N,It.disabled,D,Nt.backCCW,ue,ae,me,"terrain",ie.vertexBuffer,ie.indexBuffer,ie.segments),y.coordsIndex.push(ne.tileID.key)}w.bindFramebuffer.set(null),w.viewport.set([0,0,p.width,p.height])}(this,this.style.map.terrain))}renderLayer(e,r,a,l,p){a.isHidden(this.transform.zoom)||(a.type==="background"||a.type==="custom"||(l||[]).length)&&(this.id=a.id,s.c3(a)?function(y,w,A,R,D,N){if(y.renderPass!=="translucent")return;const{isRenderingToTexture:O}=N,Z=It.disabled,K=y.colorModeForRenderPass();(A._unevaluatedLayout.hasValue("text-variable-anchor")||A._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(ne,ie,ae,ue,me,fe,ge,xe,ye){const Te=ie.transform,Fe=ie.style.map.terrain,Le=me==="map",Be=fe==="map";for(const De of ne){const Ye=ue.getTile(De),Xe=Ye.getBucket(ae);if(!Xe||!Xe.text||!Xe.text.segments.get().length)continue;const He=s.ak(Xe.textSizeData,Te.zoom),at=s.az(Ye,1,ie.transform.zoom),Mt=ft(Le,ie.transform,at),qt=ae.layout.get("icon-text-fit")!=="none"&&Xe.hasIconData();if(He){const mr=Math.pow(2,Te.zoom-Ye.tileID.overscaledZ),tr=Fe?(gr,yr)=>Fe.getElevation(De,gr,yr):null;Bc(Xe,Le,Be,ye,Te,Mt,mr,He,qt,s.aA(Te,Ye,ge,xe),De.toUnwrapped(),tr)}}}(R,y,A,w,A.layout.get("text-rotation-alignment"),A.layout.get("text-pitch-alignment"),A.paint.get("text-translate"),A.paint.get("text-translate-anchor"),D),A.paint.get("icon-opacity").constantOr(1)!==0&&ta(y,w,A,R,!1,A.paint.get("icon-translate"),A.paint.get("icon-translate-anchor"),A.layout.get("icon-rotation-alignment"),A.layout.get("icon-pitch-alignment"),A.layout.get("icon-keep-upright"),Z,K,O),A.paint.get("text-opacity").constantOr(1)!==0&&ta(y,w,A,R,!0,A.paint.get("text-translate"),A.paint.get("text-translate-anchor"),A.layout.get("text-rotation-alignment"),A.layout.get("text-pitch-alignment"),A.layout.get("text-keep-upright"),Z,K,O),w.map.showCollisionBoxes&&(sl(y,w,A,R,!0),sl(y,w,A,R,!1))}(e,r,a,l,this.style.placement.variableOffsets,p):s.c4(a)?function(y,w,A,R,D){if(y.renderPass!=="translucent")return;const{isRenderingToTexture:N}=D,O=A.paint.get("circle-opacity"),Z=A.paint.get("circle-stroke-width"),K=A.paint.get("circle-stroke-opacity"),ne=!A.layout.get("circle-sort-key").isConstant();if(O.constantOr(1)===0&&(Z.constantOr(1)===0||K.constantOr(1)===0))return;const ie=y.context,ae=ie.gl,ue=y.transform,me=y.getDepthModeForSublayer(0,At.ReadOnly),fe=It.disabled,ge=y.colorModeForRenderPass(),xe=[],ye=ue.getCircleRadiusCorrection();for(let Te=0;Te<R.length;Te++){const Fe=R[Te],Le=w.getTile(Fe),Be=Le.getBucket(A);if(!Be)continue;const De=A.paint.get("circle-translate"),Ye=A.paint.get("circle-translate-anchor"),Xe=s.aA(ue,Le,De,Ye),He=Be.programConfigurations.get(A.id),at=y.useProgram("circle",He),Mt=Be.layoutVertexBuffer,qt=Be.indexBuffer,mr=y.style.map.terrain&&y.style.map.terrain.getTerrainData(Fe),tr={programConfiguration:He,program:at,layoutVertexBuffer:Mt,indexBuffer:qt,uniformValues:Ys(y,Le,A,Xe,ye),terrainData:mr,projectionData:ue.getProjectionData({overscaledTileID:Fe,applyGlobeMatrix:!N,applyTerrainMatrix:!0})};if(ne){const gr=Be.segments.get();for(const yr of gr)xe.push({segments:new s.aJ([yr]),sortKey:yr.sortKey,state:tr})}else xe.push({segments:Be.segments,sortKey:0,state:tr})}ne&&xe.sort((Te,Fe)=>Te.sortKey-Fe.sortKey);for(const Te of xe){const{programConfiguration:Fe,program:Le,layoutVertexBuffer:Be,indexBuffer:De,uniformValues:Ye,terrainData:Xe,projectionData:He}=Te.state;Le.draw(ie,ae.TRIANGLES,me,fe,ge,Nt.backCCW,Ye,Xe,He,A.id,Be,De,Te.segments,A.paint,y.transform.zoom,Fe)}}(e,r,a,l,p):s.c5(a)?function(y,w,A,R,D){if(A.paint.get("heatmap-opacity")===0)return;const N=y.context,{isRenderingToTexture:O,isRenderingGlobe:Z}=D;if(y.style.map.terrain){for(const K of R){const ne=w.getTile(K);w.hasRenderableParent(K)||(y.renderPass==="offscreen"?ra(y,ne,A,K,Z):y.renderPass==="translucent"&&ol(y,A,K,O,Z))}N.viewport.set([0,0,y.width,y.height])}else y.renderPass==="offscreen"?function(K,ne,ie,ae){const ue=K.context,me=ue.gl,fe=K.transform,ge=It.disabled,xe=new $t([me.ONE,me.ONE],s.b7.transparent,[!0,!0,!0,!0]);(function(ye,Te,Fe){const Le=ye.gl;ye.activeTexture.set(Le.TEXTURE1),ye.viewport.set([0,0,Te.width/4,Te.height/4]);let Be=Fe.heatmapFbos.get(s.bW);Be?(Le.bindTexture(Le.TEXTURE_2D,Be.colorAttachment.get()),ye.bindFramebuffer.set(Be.framebuffer)):(Be=ia(ye,Te.width/4,Te.height/4),Fe.heatmapFbos.set(s.bW,Be))})(ue,K,ie),ue.clear({color:s.b7.transparent});for(let ye=0;ye<ae.length;ye++){const Te=ae[ye];if(ne.hasRenderableParent(Te))continue;const Fe=ne.getTile(Te),Le=Fe.getBucket(ie);if(!Le)continue;const Be=Le.programConfigurations.get(ie.id),De=K.useProgram("heatmap",Be),Ye=fe.getProjectionData({overscaledTileID:Te,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),Xe=fe.getCircleRadiusCorrection();De.draw(ue,me.TRIANGLES,At.disabled,ge,xe,Nt.backCCW,Gn(Fe,fe.zoom,ie.paint.get("heatmap-intensity"),Xe),null,Ye,ie.id,Le.layoutVertexBuffer,Le.indexBuffer,Le.segments,ie.paint,fe.zoom,Be)}ue.viewport.set([0,0,K.width,K.height])}(y,w,A,R):y.renderPass==="translucent"&&function(K,ne){const ie=K.context,ae=ie.gl;ie.setColorMode(K.colorModeForRenderPass());const ue=ne.heatmapFbos.get(s.bW);ue&&(ie.activeTexture.set(ae.TEXTURE0),ae.bindTexture(ae.TEXTURE_2D,ue.colorAttachment.get()),ie.activeTexture.set(ae.TEXTURE1),al(ie,ne).bind(ae.LINEAR,ae.CLAMP_TO_EDGE),K.useProgram("heatmapTexture").draw(ie,ae.TRIANGLES,At.disabled,It.disabled,K.colorModeForRenderPass(),Nt.disabled,gc(K,ne,0,1),null,null,ne.id,K.viewportBuffer,K.quadTriangleIndexBuffer,K.viewportSegments,ne.paint,K.transform.zoom))}(y,A)}(e,r,a,l,p):s.c6(a)?function(y,w,A,R,D){if(y.renderPass!=="translucent")return;const{isRenderingToTexture:N}=D,O=A.paint.get("line-opacity"),Z=A.paint.get("line-width");if(O.constantOr(1)===0||Z.constantOr(1)===0)return;const K=y.getDepthModeForSublayer(0,At.ReadOnly),ne=y.colorModeForRenderPass(),ie=A.paint.get("line-dasharray"),ae=A.paint.get("line-pattern"),ue=ae.constantOr(1),me=A.paint.get("line-gradient"),fe=A.getCrossfadeParameters(),ge=ue?"linePattern":ie?"lineSDF":me?"lineGradient":"line",xe=y.context,ye=xe.gl,Te=y.transform;let Fe=!0;for(const Le of R){const Be=w.getTile(Le);if(ue&&!Be.patternsLoaded())continue;const De=Be.getBucket(A);if(!De)continue;const Ye=De.programConfigurations.get(A.id),Xe=y.context.program.get(),He=y.useProgram(ge,Ye),at=Fe||He.program!==Xe,Mt=y.style.map.terrain&&y.style.map.terrain.getTerrainData(Le),qt=ae.constantOr(null);if(qt&&Be.imageAtlas){const sr=Be.imageAtlas,Ht=sr.patternPositions[qt.to.toString()],jr=sr.patternPositions[qt.from.toString()];Ht&&jr&&Ye.setConstantPatternPositions(Ht,jr)}const mr=Te.getProjectionData({overscaledTileID:Le,applyGlobeMatrix:!N,applyTerrainMatrix:!0}),tr=Te.getPixelScale(),gr=ue?xc(y,Be,A,tr,fe):ie?bc(y,Be,A,tr,ie,fe):me?vc(y,Be,A,tr,De.lineClipsArray.length):$s(y,Be,A,tr);if(ue)xe.activeTexture.set(ye.TEXTURE0),Be.imageAtlasTexture.bind(ye.LINEAR,ye.CLAMP_TO_EDGE),Ye.updatePaintBuffers(fe);else if(ie&&(at||y.lineAtlas.dirty))xe.activeTexture.set(ye.TEXTURE0),y.lineAtlas.bind(xe);else if(me){const sr=De.gradients[A.id];let Ht=sr.texture;if(A.gradientVersion!==sr.version){let jr=256;if(A.stepInterpolant){const Xr=w.getSource().maxzoom,ii=Le.canonical.z===Xr?Math.ceil(1<<y.transform.maxZoom-Le.canonical.z):1;jr=s.ae(s.bX(De.maxLineLength/s.Z*1024*ii),256,xe.maxTextureSize)}sr.gradient=s.bY({expression:A.gradientExpression(),evaluationKey:"lineProgress",resolution:jr,image:sr.gradient||void 0,clips:De.lineClipsArray}),sr.texture?sr.texture.update(sr.gradient):sr.texture=new Ze(xe,sr.gradient,ye.RGBA),sr.version=A.gradientVersion,Ht=sr.texture}xe.activeTexture.set(ye.TEXTURE0),Ht.bind(A.stepInterpolant?ye.NEAREST:ye.LINEAR,ye.CLAMP_TO_EDGE)}const yr=y.stencilModeForClipping(Le);He.draw(xe,ye.TRIANGLES,K,yr,ne,Nt.disabled,gr,Mt,mr,A.id,De.layoutVertexBuffer,De.indexBuffer,De.segments,A.paint,y.transform.zoom,Ye,De.layoutVertexBuffer2),Fe=!1}}(e,r,a,l,p):s.c7(a)?function(y,w,A,R,D){const N=A.paint.get("fill-color"),O=A.paint.get("fill-opacity");if(O.constantOr(1)===0)return;const{isRenderingToTexture:Z}=D,K=y.colorModeForRenderPass(),ne=A.paint.get("fill-pattern"),ie=y.opaquePassEnabledForLayer()&&!ne.constantOr(1)&&N.constantOr(s.b7.transparent).a===1&&O.constantOr(0)===1?"opaque":"translucent";if(y.renderPass===ie){const ae=y.getDepthModeForSublayer(1,y.renderPass==="opaque"?At.ReadWrite:At.ReadOnly);no(y,w,A,R,ae,K,!1,Z)}if(y.renderPass==="translucent"&&A.paint.get("fill-antialias")){const ae=y.getDepthModeForSublayer(A.getPaintProperty("fill-outline-color")?2:0,At.ReadOnly);no(y,w,A,R,ae,K,!0,Z)}}(e,r,a,l,p):s.c8(a)?function(y,w,A,R,D){const N=A.paint.get("fill-extrusion-opacity");if(N===0)return;const{isRenderingToTexture:O}=D;if(y.renderPass==="translucent"){const Z=new At(y.context.gl.LEQUAL,At.ReadWrite,y.depthRangeFor3D);if(N!==1||A.paint.get("fill-extrusion-pattern").constantOr(1))so(y,w,A,R,Z,It.disabled,$t.disabled,O),so(y,w,A,R,Z,y.stencilModeFor3D(),y.colorModeForRenderPass(),O);else{const K=y.colorModeForRenderPass();so(y,w,A,R,Z,It.disabled,K,O)}}}(e,r,a,l,p):s.c9(a)?function(y,w,A,R,D){if(y.renderPass!=="offscreen"&&y.renderPass!=="translucent")return;const{isRenderingToTexture:N}=D,O=y.context,Z=y.style.projection.useSubdivision,K=y.getDepthModeForSublayer(0,At.ReadOnly),ne=y.colorModeForRenderPass();if(y.renderPass==="offscreen")(function(ie,ae,ue,me,fe,ge,xe){const ye=ie.context,Te=ye.gl;for(const Fe of ue){const Le=ae.getTile(Fe),Be=Le.dem;if(!Be||!Be.data||!Le.needsHillshadePrepare)continue;const De=Be.dim,Ye=Be.stride,Xe=Be.getPixels();if(ye.activeTexture.set(Te.TEXTURE1),ye.pixelStoreUnpackPremultiplyAlpha.set(!1),Le.demTexture=Le.demTexture||ie.getTileTexture(Ye),Le.demTexture){const at=Le.demTexture;at.update(Xe,{premultiply:!1}),at.bind(Te.NEAREST,Te.CLAMP_TO_EDGE)}else Le.demTexture=new Ze(ye,Xe,Te.RGBA,{premultiply:!1}),Le.demTexture.bind(Te.NEAREST,Te.CLAMP_TO_EDGE);ye.activeTexture.set(Te.TEXTURE0);let He=Le.fbo;if(!He){const at=new Ze(ye,{width:De,height:De,data:null},Te.RGBA);at.bind(Te.LINEAR,Te.CLAMP_TO_EDGE),He=Le.fbo=ye.createFramebuffer(De,De,!0,!1),He.colorAttachment.set(at.texture)}ye.bindFramebuffer.set(He.framebuffer),ye.viewport.set([0,0,De,De]),ie.useProgram("hillshadePrepare").draw(ye,Te.TRIANGLES,fe,ge,xe,Nt.disabled,Ah(Le.tileID,Be),null,null,me.id,ie.rasterBoundsBuffer,ie.quadTriangleIndexBuffer,ie.rasterBoundsSegments),Le.needsHillshadePrepare=!1}})(y,w,R,A,K,It.disabled,ne),O.viewport.set([0,0,y.width,y.height]);else if(y.renderPass==="translucent")if(Z){const[ie,ae,ue]=y.stencilConfigForOverlapTwoPass(R);ll(y,w,A,ue,ie,K,ne,!1,N),ll(y,w,A,ue,ae,K,ne,!0,N)}else{const[ie,ae]=y.getStencilConfigForOverlapAndUpdateStencilID(R);ll(y,w,A,ae,ie,K,ne,!1,N)}}(e,r,a,l,p):s.ca(a)?function(y,w,A,R,D){if(y.renderPass!=="translucent"||A.paint.get("raster-opacity")===0||!R.length)return;const{isRenderingToTexture:N}=D,O=w.getSource(),Z=y.style.projection.useSubdivision;if(O instanceof Rr)na(y,w,A,R,null,!1,!1,O.tileCoords,O.flippedWindingOrder,N);else if(Z){const[K,ne,ie]=y.stencilConfigForOverlapTwoPass(R);na(y,w,A,ie,K,!1,!0,oo,!1,N),na(y,w,A,ie,ne,!0,!0,oo,!1,N)}else{const[K,ne]=y.getStencilConfigForOverlapAndUpdateStencilID(R);na(y,w,A,ne,K,!1,!0,oo,!1,N)}}(e,r,a,l,p):s.cb(a)?function(y,w,A,R,D){const N=A.paint.get("background-color"),O=A.paint.get("background-opacity");if(O===0)return;const{isRenderingToTexture:Z}=D,K=y.context,ne=K.gl,ie=y.style.projection,ae=y.transform,ue=ae.tileSize,me=A.paint.get("background-pattern");if(y.isPatternMissing(me))return;const fe=!me&&N.a===1&&O===1&&y.opaquePassEnabledForLayer()?"opaque":"translucent";if(y.renderPass!==fe)return;const ge=It.disabled,xe=y.getDepthModeForSublayer(0,fe==="opaque"?At.ReadWrite:At.ReadOnly),ye=y.colorModeForRenderPass(),Te=y.useProgram(me?"backgroundPattern":"background"),Fe=R||be(ae,{tileSize:ue,terrain:y.style.map.terrain});me&&(K.activeTexture.set(ne.TEXTURE0),y.imageManager.bind(y.context));const Le=A.getCrossfadeParameters();for(const Be of Fe){const De=ae.getProjectionData({overscaledTileID:Be,applyGlobeMatrix:!Z,applyTerrainMatrix:!0}),Ye=me?Th(O,y,me,{tileID:Be,tileSize:ue},Le):Ch(O,N),Xe=y.style.map.terrain&&y.style.map.terrain.getTerrainData(Be),He=ie.getMeshFromTileID(K,Be.canonical,!1,!0,"raster");Te.draw(K,ne.TRIANGLES,xe,ge,ye,Nt.backCCW,Ye,Xe,De,A.id,He.vertexBuffer,He.indexBuffer,He.segments)}}(e,0,a,l,p):s.cc(a)&&function(y,w,A,R){const{isRenderingGlobe:D}=R,N=y.context,O=A.implementation,Z=y.style.projection,K=y.transform,ne=K.getProjectionDataForCustomLayer(D),ie={farZ:K.farZ,nearZ:K.nearZ,fov:K.fov*Math.PI/180,modelViewProjectionMatrix:K.modelViewProjectionMatrix,projectionMatrix:K.projectionMatrix,shaderData:{variantName:Z.shaderVariantName,vertexShaderPrelude:`const float PI = 3.141592653589793;
800
- uniform mat4 u_projection_matrix;
801
- ${Z.shaderPreludeCode.vertexSource}`,define:Z.shaderDefine},defaultProjectionData:ne},ae=O.renderingMode?O.renderingMode:"2d";if(y.renderPass==="offscreen"){const ue=O.prerender;ue&&(y.setCustomLayerDefaults(),N.setColorMode(y.colorModeForRenderPass()),ue.call(O,N.gl,ie),N.setDirty(),y.setBaseState())}else if(y.renderPass==="translucent"){y.setCustomLayerDefaults(),N.setColorMode(y.colorModeForRenderPass()),N.setStencilMode(It.disabled);const ue=ae==="3d"?y.getDepthModeFor3D():y.getDepthModeForSublayer(0,At.ReadOnly);N.setDepthMode(ue),O.render(N.gl,ie),N.setDirty(),y.setBaseState(),N.bindFramebuffer.set(null)}}(e,0,a,p))}saveTileTexture(e){const r=this._tileTextures[e.size[0]];r?r.push(e):this._tileTextures[e.size[0]]=[e]}getTileTexture(e){const r=this._tileTextures[e];return r&&r.length>0?r.pop():null}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;const r=this.imageManager.getPattern(e.from.toString()),a=this.imageManager.getPattern(e.to.toString());return!r||!a}useProgram(e,r,a=!1,l=[]){this.cache=this.cache||{};const p=!!this.style.map.terrain,y=this.style.projection,w=a?fi.projectionMercator:y.shaderPreludeCode,A=a?jn:y.shaderDefine,R=e+(r?r.cacheKey:"")+`/${a?Ot:y.shaderVariantName}`+(this._showOverdrawInspector?"/overdraw":"")+(p?"/terrain":"")+(l?`/${l.join("/")}`:"");return this.cache[R]||(this.cache[R]=new Oo(this.context,fi[e],r,Ac[e],this._showOverdrawInspector,p,w,A,l)),this.cache[R]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new Ze(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:e,drawingBufferHeight:r}=this.context.gl;return this.width!==e||this.height!==r}}function lo(h,e){let r,a=!1,l=null,p=null;const y=()=>{l=null,a&&(h.apply(p,r),l=setTimeout(y,e),a=!1)};return(...w)=>(a=!0,p=this,r=w,l||y(),l)}class hl{constructor(e){this._getCurrentHash=()=>{const r=window.location.hash.replace("#","");if(this._hashName){let a;return r.split("&").map(l=>l.split("=")).forEach(l=>{l[0]===this._hashName&&(a=l)}),(a&&a[1]||"").split("/")}return r.split("/")},this._onHashChange=()=>{const r=this._getCurrentHash();if(!this._isValidHash(r))return!1;const a=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(r[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+r[2],+r[1]],zoom:+r[0],bearing:a,pitch:+(r[4]||0)}),!0},this._updateHashUnthrottled=()=>{const r=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,r)},this._removeHash=()=>{const r=this._getCurrentHash();if(r.length===0)return;const a=r.join("/");let l=a;l.split("&").length>0&&(l=l.split("&")[0]),this._hashName&&(l=`${this._hashName}=${a}`);let p=window.location.hash.replace(l,"");p.startsWith("#&")?p=p.slice(0,1)+p.slice(2):p==="#"&&(p="");let y=window.location.href.replace(/(#.+)?$/,p);y=y.replace("&&","&"),window.history.replaceState(window.history.state,null,y)},this._updateHash=lo(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(e){const r=this._map.getCenter(),a=Math.round(100*this._map.getZoom())/100,l=Math.ceil((a*Math.LN2+Math.log(512/360/.5))/Math.LN10),p=Math.pow(10,l),y=Math.round(r.lng*p)/p,w=Math.round(r.lat*p)/p,A=this._map.getBearing(),R=this._map.getPitch();let D="";if(D+=e?`/${y}/${w}/${a}`:`${a}/${w}/${y}`,(A||R)&&(D+="/"+Math.round(10*A)/10),R&&(D+=`/${Math.round(R)}`),this._hashName){const N=this._hashName;let O=!1;const Z=window.location.hash.slice(1).split("&").map(K=>{const ne=K.split("=")[0];return ne===N?(O=!0,`${ne}=${D}`):K}).filter(K=>K);return O||Z.push(`${N}=${D}`),`#${Z.join("&")}`}return`#${D}`}_isValidHash(e){if(e.length<3||e.some(isNaN))return!1;try{new s.Q(+e[2],+e[1])}catch{return!1}const r=+e[0],a=+(e[3]||0),l=+(e[4]||0);return r>=this._map.getMinZoom()&&r<=this._map.getMaxZoom()&&a>=-180&&a<=180&&l>=this._map.getMinPitch()&&l<=this._map.getMaxPitch()}}const an={linearity:.3,easing:s.cd(0,0,.3,1)},pl=s.e({deceleration:2500,maxSpeed:1400},an),co=s.e({deceleration:20,maxSpeed:1400},an),dl=s.e({deceleration:1e3,maxSpeed:360},an),Oc=s.e({deceleration:1e3,maxSpeed:90},an),Nc=s.e({deceleration:1e3,maxSpeed:360},an);class qc{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:M.now(),settings:e})}_drainInertiaBuffer(){const e=this._inertiaBuffer,r=M.now();for(;e.length>0&&r-e[0].time>160;)e.shift()}_onMoveEnd(e){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const r={zoom:0,bearing:0,pitch:0,roll:0,pan:new s.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:p}of this._inertiaBuffer)r.zoom+=p.zoomDelta||0,r.bearing+=p.bearingDelta||0,r.pitch+=p.pitchDelta||0,r.roll+=p.rollDelta||0,p.panDelta&&r.pan._add(p.panDelta),p.around&&(r.around=p.around),p.pinchAround&&(r.pinchAround=p.pinchAround);const a=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,l={};if(r.pan.mag()){const p=ws(r.pan.mag(),a,s.e({},pl,e||{})),y=r.pan.mult(p.amount/r.pan.mag()),w=this._map.cameraHelper.handlePanInertia(y,this._map.transform);l.center=w.easingCenter,l.offset=w.easingOffset,bs(l,p)}if(r.zoom){const p=ws(r.zoom,a,co);l.zoom=this._map.transform.zoom+p.amount,bs(l,p)}if(r.bearing){const p=ws(r.bearing,a,dl);l.bearing=this._map.transform.bearing+s.ae(p.amount,-179,179),bs(l,p)}if(r.pitch){const p=ws(r.pitch,a,Oc);l.pitch=this._map.transform.pitch+p.amount,bs(l,p)}if(r.roll){const p=ws(r.roll,a,Nc);l.roll=this._map.transform.roll+s.ae(p.amount,-179,179),bs(l,p)}if(l.zoom||l.bearing){const p=r.pinchAround===void 0?r.around:r.pinchAround;l.around=p?this._map.unproject(p):this._map.getCenter()}return this.clear(),s.e(l,{noMoveStart:!0})}}function bs(h,e){(!h.duration||h.duration<e.duration)&&(h.duration=e.duration,h.easing=e.easing)}function ws(h,e,r){const{maxSpeed:a,linearity:l,deceleration:p}=r,y=s.ae(h*l/(e/1e3),-a,a),w=Math.abs(y)/(p*l);return{easing:r.easing,duration:1e3*w,amount:y*(w/2)}}class Ur extends s.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,r,a,l={}){a=a instanceof MouseEvent?a:new MouseEvent(e,a);const p=E.mousePos(r.getCanvas(),a),y=r.unproject(p);super(e,s.e({point:p,lngLat:y,originalEvent:a},l)),this._defaultPrevented=!1,this.target=r}}class Ss extends s.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,r,a){const l=e==="touchend"?a.changedTouches:a.touches,p=E.touchPos(r.getCanvasContainer(),l),y=p.map(A=>r.unproject(A)),w=p.reduce((A,R,D,N)=>A.add(R.div(N.length)),new s.P(0,0));super(e,{points:p,point:w,lngLats:y,lngLat:r.unproject(w),originalEvent:a}),this._defaultPrevented=!1}}class fl extends s.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,r,a){super(e,{originalEvent:a}),this._defaultPrevented=!1}}class Uc{constructor(e,r){this._map=e,this._clickTolerance=r.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new fl(e.type,this._map,e))}mousedown(e,r){return this._mousedownPos=r,this._firePreventable(new Ur(e.type,this._map,e))}mouseup(e){this._map.fire(new Ur(e.type,this._map,e))}click(e,r){this._mousedownPos&&this._mousedownPos.dist(r)>=this._clickTolerance||this._map.fire(new Ur(e.type,this._map,e))}dblclick(e){return this._firePreventable(new Ur(e.type,this._map,e))}mouseover(e){this._map.fire(new Ur(e.type,this._map,e))}mouseout(e){this._map.fire(new Ur(e.type,this._map,e))}touchstart(e){return this._firePreventable(new Ss(e.type,this._map,e))}touchmove(e){this._map.fire(new Ss(e.type,this._map,e))}touchend(e){this._map.fire(new Ss(e.type,this._map,e))}touchcancel(e){this._map.fire(new Ss(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class jc{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new Ur(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ur("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new Ur(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class ks{constructor(e){this._map=e}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(e){return this.transform.screenPointToLocation(s.P.convert(e),this._map.terrain)}}class ml{constructor(e,r){this._map=e,this._tr=new ks(e),this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=r.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,r){this.isEnabled()&&e.shiftKey&&e.button===0&&(E.disableDrag(),this._startPos=this._lastPos=r,this._active=!0)}mousemoveWindow(e,r){if(!this._active)return;const a=r;if(this._lastPos.equals(a)||!this._box&&a.dist(this._startPos)<this._clickTolerance)return;const l=this._startPos;this._lastPos=a,this._box||(this._box=E.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",e));const p=Math.min(l.x,a.x),y=Math.max(l.x,a.x),w=Math.min(l.y,a.y),A=Math.max(l.y,a.y);E.setTransform(this._box,`translate(${p}px,${w}px)`),this._box.style.width=y-p+"px",this._box.style.height=A-w+"px"}mouseupWindow(e,r){if(!this._active||e.button!==0)return;const a=this._startPos,l=r;if(this.reset(),E.suppressClick(),a.x!==l.x||a.y!==l.y)return this._map.fire(new s.l("boxzoomend",{originalEvent:e})),{cameraAnimation:p=>p.fitScreenCoordinates(a,l,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",e)}keydown(e){this._active&&e.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(E.remove(this._box),this._box=null),E.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,r){return this._map.fire(new s.l(e,{originalEvent:r}))}}function la(h,e){if(h.length!==e.length)throw new Error(`The number of touches and points are not equal - touches ${h.length}, points ${e.length}`);const r={};for(let a=0;a<h.length;a++)r[h[a].identifier]=e[a];return r}class Wc{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,r,a){(this.centroid||a.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=e.timeStamp),a.length===this.numTouches&&(this.centroid=function(l){const p=new s.P(0,0);for(const y of l)p._add(y);return p.div(l.length)}(r),this.touches=la(a,r)))}touchmove(e,r,a){if(this.aborted||!this.centroid)return;const l=la(a,r);for(const p in this.touches){const y=l[p];(!y||y.dist(this.touches[p])>30)&&(this.aborted=!0)}}touchend(e,r,a){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),a.length===0){const l=!this.aborted&&this.centroid;if(this.reset(),l)return l}}}class As{constructor(e){this.singleTap=new Wc(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,r,a){this.singleTap.touchstart(e,r,a)}touchmove(e,r,a){this.singleTap.touchmove(e,r,a)}touchend(e,r,a){const l=this.singleTap.touchend(e,r,a);if(l){const p=e.timeStamp-this.lastTime<500,y=!this.lastTap||this.lastTap.dist(l)<30;if(p&&y||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=l,this.count===this.numTaps)return this.reset(),l}}}class Hc{constructor(e){this._tr=new ks(e),this._zoomIn=new As({numTouches:1,numTaps:2}),this._zoomOut=new As({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,r,a){this._zoomIn.touchstart(e,r,a),this._zoomOut.touchstart(e,r,a)}touchmove(e,r,a){this._zoomIn.touchmove(e,r,a),this._zoomOut.touchmove(e,r,a)}touchend(e,r,a){const l=this._zoomIn.touchend(e,r,a),p=this._zoomOut.touchend(e,r,a),y=this._tr;return l?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:w=>w.easeTo({duration:300,zoom:y.zoom+1,around:y.unproject(l)},{originalEvent:e})}):p?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:w=>w.easeTo({duration:300,zoom:y.zoom-1,around:y.unproject(p)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class hi{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(...e){const r=this._moveFunction(...e);if(r.bearingDelta||r.pitchDelta||r.rollDelta||r.around||r.panDelta)return this._active=!0,r}dragStart(e,r){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=Array.isArray(r)?r[0]:r,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,r){if(!this.isEnabled())return;const a=this._lastPoint;if(!a)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e))return void this.reset(e);const l=Array.isArray(r)?r[0]:r;return!this._moved&&l.dist(a)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=l,this._move(a,l))}dragEnd(e){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(e)&&(this._moved&&E.suppressClick(),this.reset(e))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const Gi={0:1,2:2};class Cs{constructor(e){this._correctEvent=e.checkCorrectEvent}startMove(e){const r=E.mouseButton(e);this._eventButton=r}endMove(e){delete this._eventButton}isValidStartEvent(e){return this._correctEvent(e)}isValidMoveEvent(e){return!function(r,a){const l=Gi[a];return r.buttons===void 0||(r.buttons&l)!==l}(e,this._eventButton)}isValidEndEvent(e){return E.mouseButton(e)===this._eventButton}}class Ji{constructor(){this._firstTouch=void 0}_isOneFingerTouch(e){return e.targetTouches.length===1}_isSameTouchEvent(e){return e.targetTouches[0].identifier===this._firstTouch}startMove(e){this._firstTouch=e.targetTouches[0].identifier}endMove(e){delete this._firstTouch}isValidStartEvent(e){return this._isOneFingerTouch(e)}isValidMoveEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}isValidEndEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}}class Ts{constructor(e=new Cs({checkCorrectEvent:()=>!0}),r=new Ji){this.mouseMoveStateManager=e,this.oneFingerTouchMoveStateManager=r}_executeRelevantHandler(e,r,a){return e instanceof MouseEvent?r(e):typeof TouchEvent<"u"&&e instanceof TouchEvent?a(e):void 0}startMove(e){this._executeRelevantHandler(e,r=>this.mouseMoveStateManager.startMove(r),r=>this.oneFingerTouchMoveStateManager.startMove(r))}endMove(e){this._executeRelevantHandler(e,r=>this.mouseMoveStateManager.endMove(r),r=>this.oneFingerTouchMoveStateManager.endMove(r))}isValidStartEvent(e){return this._executeRelevantHandler(e,r=>this.mouseMoveStateManager.isValidStartEvent(r),r=>this.oneFingerTouchMoveStateManager.isValidStartEvent(r))}isValidMoveEvent(e){return this._executeRelevantHandler(e,r=>this.mouseMoveStateManager.isValidMoveEvent(r),r=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(r))}isValidEndEvent(e){return this._executeRelevantHandler(e,r=>this.mouseMoveStateManager.isValidEndEvent(r),r=>this.oneFingerTouchMoveStateManager.isValidEndEvent(r))}}const ca=h=>{h.mousedown=h.dragStart,h.mousemoveWindow=h.dragMove,h.mouseup=h.dragEnd,h.contextmenu=e=>{e.preventDefault()}};class Vh{constructor(e,r){this._clickTolerance=e.clickTolerance||1,this._map=r,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new s.P(0,0)}_shouldBePrevented(e){return e<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(e,r,a){return this._calculateTransform(e,r,a)}touchmove(e,r,a){if(this._active){if(!this._shouldBePrevented(a.length))return e.preventDefault(),this._calculateTransform(e,r,a);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",e)}}touchend(e,r,a){this._calculateTransform(e,r,a),this._active&&this._shouldBePrevented(a.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,r,a){a.length>0&&(this._active=!0);const l=la(a,r),p=new s.P(0,0),y=new s.P(0,0);let w=0;for(const R in l){const D=l[R],N=this._touches[R];N&&(p._add(D),y._add(D.sub(N)),w++,l[R]=D)}if(this._touches=l,this._shouldBePrevented(w)||!y.mag())return;const A=y.div(w);return this._sum._add(A),this._sum.mag()<this._clickTolerance?void 0:{around:p.div(w),panDelta:A}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class gl{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(e,r,a){this._firstTwoTouches||a.length<2||(this._firstTwoTouches=[a[0].identifier,a[1].identifier],this._start([r[0],r[1]]))}touchmove(e,r,a){if(!this._firstTwoTouches)return;e.preventDefault();const[l,p]=this._firstTwoTouches,y=ua(a,r,l),w=ua(a,r,p);if(!y||!w)return;const A=this._aroundCenter?null:y.add(w).div(2);return this._move([y,w],A,e)}touchend(e,r,a){if(!this._firstTwoTouches)return;const[l,p]=this._firstTwoTouches,y=ua(a,r,l),w=ua(a,r,p);y&&w||(this._active&&E.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&e.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function ua(h,e,r){for(let a=0;a<h.length;a++)if(h[a].identifier===r)return e[a]}function yl(h,e){return Math.log(h/e)/Math.LN2}class Es extends gl{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,r){const a=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(yl(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:yl(this._distance,a),pinchAround:r}}}function ln(h,e){return 180*h.angleWith(e)/Math.PI}class nt extends gl{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,r,a){const l=this._vector;if(this._vector=e[0].sub(e[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:ln(this._vector,l),pinchAround:r}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());const r=25/(Math.PI*this._minDiameter)*360,a=ln(e,this._startVector);return Math.abs(a)<r}}function ha(h){return Math.abs(h.y)>Math.abs(h.x)}class pa extends gl{constructor(e){super(),this._currentTouchCount=0,this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,r,a){super.touchstart(e,r,a),this._currentTouchCount=a.length}_start(e){this._lastPoints=e,ha(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,r,a){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const l=e[0].sub(this._lastPoints[0]),p=e[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(l,p,a.timeStamp),this._valid?(this._lastPoints=e,this._active=!0,{pitchDelta:(l.y+p.y)/2*-.5}):void 0}gestureBeginsVertically(e,r,a){if(this._valid!==void 0)return this._valid;const l=e.mag()>=2,p=r.mag()>=2;if(!l&&!p)return;if(!l||!p)return this._firstMove===void 0&&(this._firstMove=a),a-this._firstMove<100&&void 0;const y=e.y>0==r.y>0;return ha(e)&&ha(r)&&y}}const Zc={panStep:100,bearingStep:15,pitchStep:10};class Ps{constructor(e){this._tr=new ks(e);const r=Zc;this._panStep=r.panStep,this._bearingStep=r.bearingStep,this._pitchStep=r.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let r=0,a=0,l=0,p=0,y=0;switch(e.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:e.shiftKey?a=-1:(e.preventDefault(),p=-1);break;case 39:e.shiftKey?a=1:(e.preventDefault(),p=1);break;case 38:e.shiftKey?l=1:(e.preventDefault(),y=-1);break;case 40:e.shiftKey?l=-1:(e.preventDefault(),y=1);break;default:return}return this._rotationDisabled&&(a=0,l=0),{cameraAnimation:w=>{const A=this._tr;w.easeTo({duration:300,easeId:"keyboardHandler",easing:uo,zoom:r?Math.round(A.zoom)+r*(e.shiftKey?2:1):A.zoom,bearing:A.bearing+a*this._bearingStep,pitch:A.pitch+l*this._pitchStep,offset:[-p*this._panStep,-y*this._panStep],center:A.center},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function uo(h){return h*(2-h)}const _l=4.000244140625;class Bt{constructor(e,r){this._onTimeout=a=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(a)},this._map=e,this._tr=new ks(e),this._triggerRenderFrame=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&e.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return!!this._map.cooperativeGestures.isEnabled()&&!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e))}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",e);let r=e.deltaMode===WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY;const a=M.now(),l=a-(this._lastWheelEventTime||0);this._lastWheelEventTime=a,r!==0&&r%_l==0?this._type="wheel":r!==0&&Math.abs(r)<4?this._type="trackpad":l>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(l*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const r=E.mousePos(this._map.getCanvas(),e),a=this._tr;this._aroundPoint=this._aroundCenter?a.transform.locationToScreenPoint(s.Q.convert(a.center)):r,this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const e=this._tr.transform;if(typeof this._lastExpectedZoom=="number"){const w=e.zoom-this._lastExpectedZoom;typeof this._startZoom=="number"&&(this._startZoom+=w),typeof this._targetZoom=="number"&&(this._targetZoom+=w)}if(this._delta!==0){const w=this._type==="wheel"&&Math.abs(this._delta)>_l?this._wheelZoomRate:this._defaultZoomRate;let A=2/(1+Math.exp(-Math.abs(this._delta*w)));this._delta<0&&A!==0&&(A=1/A);const R=typeof this._targetZoom!="number"?e.scale:s.ac(this._targetZoom);this._targetZoom=e.getConstrained(e.getCameraLngLat(),s.ah(R*A)).zoom,this._type==="wheel"&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const r=typeof this._targetZoom!="number"?e.zoom:this._targetZoom,a=this._startZoom,l=this._easing;let p,y=!1;if(this._type==="wheel"&&a&&l){const w=M.now()-this._lastWheelEventTime,A=Math.min((w+5)/200,1),R=l(A);p=s.B.number(a,r,R),A<1?this._frameId||(this._frameId=!0):y=!0}else p=r,y=!0;return this._active=!0,y&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout},200)),this._lastExpectedZoom=p,{noInertia:!0,needsRenderFrame:!y,zoomDelta:p-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let r=s.cf;if(this._prevEase){const a=this._prevEase,l=(M.now()-a.start)/a.duration,p=a.easing(l+.01)-a.easing(l),y=.27/Math.sqrt(p*p+1e-4)*.01,w=Math.sqrt(.0729-y*y);r=s.cd(y,w,.25,1)}return this._prevEase={start:M.now(),duration:e,easing:r},r}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class da{constructor(e,r){this._clickZoom=e,this._tapZoom=r}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class zh{constructor(e){this._tr=new ks(e),this.reset()}reset(){this._active=!1}dblclick(e,r){return e.preventDefault(),{cameraAnimation:a=>{a.easeTo({duration:300,zoom:this._tr.zoom+(e.shiftKey?-1:1),around:this._tr.unproject(r)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class vl{constructor(){this._tap=new As({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,r,a){if(!this._swipePoint)if(this._tapTime){const l=r[0],p=e.timeStamp-this._tapTime<500,y=this._tapPoint.dist(l)<30;p&&y?a.length>0&&(this._swipePoint=l,this._swipeTouch=a[0].identifier):this.reset()}else this._tap.touchstart(e,r,a)}touchmove(e,r,a){if(this._tapTime){if(this._swipePoint){if(a[0].identifier!==this._swipeTouch)return;const l=r[0],p=l.y-this._swipePoint.y;return this._swipePoint=l,e.preventDefault(),this._active=!0,{zoomDelta:p/128}}}else this._tap.touchmove(e,r,a)}touchend(e,r,a){if(this._tapTime)this._swipePoint&&a.length===0&&this.reset();else{const l=this._tap.touchend(e,r,a);l&&(this._tapTime=e.timeStamp,this._tapPoint=l)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Kc{constructor(e,r,a){this._el=e,this._mousePan=r,this._touchPan=a}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Gc{constructor(e,r,a,l){this._pitchWithRotate=e.pitchWithRotate,this._rollEnabled=e.rollEnabled,this._mouseRotate=r,this._mousePitch=a,this._mouseRoll=l}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}}class xl{constructor(e,r,a,l){this._el=e,this._touchZoom=r,this._touchRotate=a,this._tapDragZoom=l,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class fa{constructor(e,r){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=e,this._options=r,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const e=this._map.getCanvasContainer();e.classList.add("maplibregl-cooperative-gestures"),this._container=E.create("div","maplibregl-cooperative-gesture-screen",e);let r=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(r=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const a=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),l=document.createElement("div");l.className="maplibregl-desktop-message",l.textContent=r,this._container.appendChild(l);const p=document.createElement("div");p.className="maplibregl-mobile-message",p.textContent=a,this._container.appendChild(p),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(E.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(e){return e[this._bypassKey]}notifyGestureBlocked(e,r){this._enabled&&(this._map.fire(new s.l("cooperativegestureprevented",{gestureType:e,originalEvent:r})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const ho=h=>h.zoom||h.drag||h.roll||h.pitch||h.rotate;class Fh extends s.l{}function ma(h){return h.panDelta&&h.panDelta.mag()||h.zoomDelta||h.bearingDelta||h.pitchDelta||h.rollDelta}class Oh{constructor(e,r){this.handleWindowEvent=l=>{this.handleEvent(l,`${l.type}Window`)},this.handleEvent=(l,p)=>{if(l.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const y=l.type==="renderFrame"?void 0:l,w={needsRenderFrame:!1},A={},R={};for(const{handlerName:O,handler:Z,allowed:K}of this._handlers){if(!Z.isEnabled())continue;let ne;if(this._blockedByActive(R,K,O))Z.reset();else if(Z[p||l.type]){if(s.cg(l,p||l.type)){const ie=E.mousePos(this._map.getCanvas(),l);ne=Z[p||l.type](l,ie)}else if(s.ch(l,p||l.type)){const ie=this._getMapTouches(l.touches),ae=E.touchPos(this._map.getCanvas(),ie);ne=Z[p||l.type](l,ae,ie)}else s.ci(p||l.type)||(ne=Z[p||l.type](l));this.mergeHandlerResult(w,A,ne,O,y),ne&&ne.needsRenderFrame&&this._triggerRenderFrame()}(ne||Z.isActive())&&(R[O]=Z)}const D={};for(const O in this._previousActiveHandlers)R[O]||(D[O]=y);this._previousActiveHandlers=R,(Object.keys(D).length||ma(w))&&(this._changes.push([w,A,D]),this._triggerRenderFrame()),(Object.keys(R).length||ma(w))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:N}=w;N&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],N(this._map))},this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new qc(e),this._bearingSnap=r.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(r);const a=this._el;this._listeners=[[a,"touchstart",{passive:!0}],[a,"touchmove",{passive:!1}],[a,"touchend",void 0],[a,"touchcancel",void 0],[a,"mousedown",void 0],[a,"mousemove",void 0],[a,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[a,"mouseover",void 0],[a,"mouseout",void 0],[a,"dblclick",void 0],[a,"click",void 0],[a,"keydown",{capture:!1}],[a,"keyup",void 0],[a,"wheel",{passive:!1}],[a,"contextmenu",void 0],[window,"blur",void 0]];for(const[l,p,y]of this._listeners)E.addEventListener(l,p,l===document?this.handleWindowEvent:this.handleEvent,y)}destroy(){for(const[e,r,a]of this._listeners)E.removeEventListener(e,r,e===document?this.handleWindowEvent:this.handleEvent,a)}_addDefaultHandlers(e){const r=this._map,a=r.getCanvasContainer();this._add("mapEvent",new Uc(r,e));const l=r.boxZoom=new ml(r,e);this._add("boxZoom",l),e.interactive&&e.boxZoom&&l.enable();const p=r.cooperativeGestures=new fa(r,e.cooperativeGestures);this._add("cooperativeGestures",p),e.cooperativeGestures&&p.enable();const y=new Hc(r),w=new zh(r);r.doubleClickZoom=new da(w,y),this._add("tapZoom",y),this._add("clickZoom",w),e.interactive&&e.doubleClickZoom&&r.doubleClickZoom.enable();const A=new vl;this._add("tapDragZoom",A);const R=r.touchPitch=new pa(r);this._add("touchPitch",R),e.interactive&&e.touchPitch&&r.touchPitch.enable(e.touchPitch);const D=()=>r.project(r.getCenter()),N=function({enable:fe,clickTolerance:ge,aroundCenter:xe=!0,minPixelCenterThreshold:ye=100,rotateDegreesPerPixelMoved:Te=.8},Fe){const Le=new Cs({checkCorrectEvent:Be=>E.mouseButton(Be)===0&&Be.ctrlKey||E.mouseButton(Be)===2&&!Be.ctrlKey});return new hi({clickTolerance:ge,move:(Be,De)=>{const Ye=Fe();if(xe&&Math.abs(Ye.y-Be.y)>ye)return{bearingDelta:s.ce(new s.P(Be.x,De.y),De,Ye)};let Xe=(De.x-Be.x)*Te;return xe&&De.y<Ye.y&&(Xe=-Xe),{bearingDelta:Xe}},moveStateManager:Le,enable:fe,assignEvents:ca})}(e,D),O=function({enable:fe,clickTolerance:ge,pitchDegreesPerPixelMoved:xe=-.5}){const ye=new Cs({checkCorrectEvent:Te=>E.mouseButton(Te)===0&&Te.ctrlKey||E.mouseButton(Te)===2});return new hi({clickTolerance:ge,move:(Te,Fe)=>({pitchDelta:(Fe.y-Te.y)*xe}),moveStateManager:ye,enable:fe,assignEvents:ca})}(e),Z=function({enable:fe,clickTolerance:ge,rollDegreesPerPixelMoved:xe=.3},ye){const Te=new Cs({checkCorrectEvent:Fe=>E.mouseButton(Fe)===2&&Fe.ctrlKey});return new hi({clickTolerance:ge,move:(Fe,Le)=>{const Be=ye();let De=(Le.x-Fe.x)*xe;return Le.y<Be.y&&(De=-De),{rollDelta:De}},moveStateManager:Te,enable:fe,assignEvents:ca})}(e,D);r.dragRotate=new Gc(e,N,O,Z),this._add("mouseRotate",N,["mousePitch"]),this._add("mousePitch",O,["mouseRotate","mouseRoll"]),this._add("mouseRoll",Z,["mousePitch"]),e.interactive&&e.dragRotate&&r.dragRotate.enable();const K=function({enable:fe,clickTolerance:ge}){const xe=new Cs({checkCorrectEvent:ye=>E.mouseButton(ye)===0&&!ye.ctrlKey});return new hi({clickTolerance:ge,move:(ye,Te)=>({around:Te,panDelta:Te.sub(ye)}),activateOnStart:!0,moveStateManager:xe,enable:fe,assignEvents:ca})}(e),ne=new Vh(e,r);r.dragPan=new Kc(a,K,ne),this._add("mousePan",K),this._add("touchPan",ne,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&r.dragPan.enable(e.dragPan);const ie=new nt,ae=new Es;r.touchZoomRotate=new xl(a,ae,ie,A),this._add("touchRotate",ie,["touchPan","touchZoom"]),this._add("touchZoom",ae,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&r.touchZoomRotate.enable(e.touchZoomRotate);const ue=r.scrollZoom=new Bt(r,()=>this._triggerRenderFrame());this._add("scrollZoom",ue,["mousePan"]),e.interactive&&e.scrollZoom&&r.scrollZoom.enable(e.scrollZoom);const me=r.keyboard=new Ps(r);this._add("keyboard",me),e.interactive&&e.keyboard&&r.keyboard.enable(),this._add("blockableMapEvent",new jc(r))}_add(e,r,a){this._handlers.push({handlerName:e,handler:r,allowed:a}),this._handlersById[e]=r}stop(e){if(!this._updatingCamera){for(const{handler:r}of this._handlers)r.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(const{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!ho(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,r,a){for(const l in e)if(l!==a&&(!r||r.indexOf(l)<0))return!0;return!1}_getMapTouches(e){const r=[];for(const a of e)this._el.contains(a.target)&&r.push(a);return r}mergeHandlerResult(e,r,a,l,p){if(!a)return;s.e(e,a);const y={handlerName:l,originalEvent:a.originalEvent||p};a.zoomDelta!==void 0&&(r.zoom=y),a.panDelta!==void 0&&(r.drag=y),a.rollDelta!==void 0&&(r.roll=y),a.pitchDelta!==void 0&&(r.pitch=y),a.bearingDelta!==void 0&&(r.rotate=y)}_applyChanges(){const e={},r={},a={};for(const[l,p,y]of this._changes)l.panDelta&&(e.panDelta=(e.panDelta||new s.P(0,0))._add(l.panDelta)),l.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+l.zoomDelta),l.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+l.bearingDelta),l.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+l.pitchDelta),l.rollDelta&&(e.rollDelta=(e.rollDelta||0)+l.rollDelta),l.around!==void 0&&(e.around=l.around),l.pinchAround!==void 0&&(e.pinchAround=l.pinchAround),l.noInertia&&(e.noInertia=l.noInertia),s.e(r,p),s.e(a,y);this._updateMapTransform(e,r,a),this._changes=[]}_updateMapTransform(e,r,a){const l=this._map,p=l._getTransformForUpdate(),y=l.terrain;if(!(ma(e)||y&&this._terrainMovement))return this._fireEvents(r,a,!0);l._stop(!0);let{panDelta:w,zoomDelta:A,bearingDelta:R,pitchDelta:D,rollDelta:N,around:O,pinchAround:Z}=e;Z!==void 0&&(O=Z),O=O||l.transform.centerPoint,y&&!p.isPointOnMapSurface(O)&&(O=p.centerPoint);const K={panDelta:w,zoomDelta:A,rollDelta:N,pitchDelta:D,bearingDelta:R,around:O};this._map.cameraHelper.useGlobeControls&&!p.isPointOnMapSurface(O)&&(O=p.centerPoint);const ne=O.distSqr(p.centerPoint)<.01?p.center:p.screenPointToLocation(w?O.sub(w):O);y?(this._map.cameraHelper.handleMapControlsRollPitchBearingZoom(K,p),this._terrainMovement||!r.drag&&!r.zoom?r.drag&&this._terrainMovement?p.setCenter(p.screenPointToLocation(p.centerPoint.sub(w))):this._map.cameraHelper.handleMapControlsPan(K,p,ne):(this._terrainMovement=!0,this._map._elevationFreeze=!0,this._map.cameraHelper.handleMapControlsPan(K,p,ne))):(this._map.cameraHelper.handleMapControlsRollPitchBearingZoom(K,p),this._map.cameraHelper.handleMapControlsPan(K,p,ne)),l._applyUpdatedTransform(p),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(r,a,!0)}_fireEvents(e,r,a){const l=ho(this._eventsInProgress),p=ho(e),y={};for(const N in e){const{originalEvent:O}=e[N];this._eventsInProgress[N]||(y[`${N}start`]=O),this._eventsInProgress[N]=e[N]}!l&&p&&this._fireEvent("movestart",p.originalEvent);for(const N in y)this._fireEvent(N,y[N]);p&&this._fireEvent("move",p.originalEvent);for(const N in e){const{originalEvent:O}=e[N];this._fireEvent(N,O)}const w={};let A;for(const N in this._eventsInProgress){const{handlerName:O,originalEvent:Z}=this._eventsInProgress[N];this._handlersById[O].isActive()||(delete this._eventsInProgress[N],A=r[O]||Z,w[`${N}end`]=A)}for(const N in w)this._fireEvent(N,w[N]);const R=ho(this._eventsInProgress),D=(l||p)&&!R;if(D&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const N=this._map._getTransformForUpdate();this._map.getCenterClampedToGround()&&N.recalculateZoomAndCenter(this._map.terrain),this._map._applyUpdatedTransform(N)}if(a&&D){this._updatingCamera=!0;const N=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),O=Z=>Z!==0&&-this._bearingSnap<Z&&Z<this._bearingSnap;!N||!N.essential&&M.prefersReducedMotion?(this._map.fire(new s.l("moveend",{originalEvent:A})),O(this._map.getBearing())&&this._map.resetNorth()):(O(N.bearing||this._map.getBearing())&&(N.bearing=0),N.freezeElevation=!0,this._map.easeTo(N,{originalEvent:A})),this._updatingCamera=!1}}_fireEvent(e,r){this._map.fire(new s.l(e,r?{originalEvent:r}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(e=>{delete this._frameId,this.handleEvent(new Fh("renderFrame",{timeStamp:e})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Nh extends s.E{constructor(e,r,a){super(),this._renderFrameCallback=()=>{const l=Math.min((M.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(l)),l<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=a.bearingSnap,this.cameraHelper=r,this.on("moveend",()=>{delete this._requestedCameraState})}migrateProjection(e,r){e.apply(this.transform),this.transform=e,this.cameraHelper=r}getCenter(){return new s.Q(this.transform.center.lng,this.transform.center.lat)}setCenter(e,r){return this.jumpTo({center:e},r)}getCenterElevation(){return this.transform.elevation}setCenterElevation(e,r){return this.jumpTo({elevation:e},r),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(e){this._centerClampedToGround=e}panBy(e,r,a){return e=s.P.convert(e).mult(-1),this.panTo(this.transform.center,s.e({offset:e},r),a)}panTo(e,r,a){return this.easeTo(s.e({center:e},r),a)}getZoom(){return this.transform.zoom}setZoom(e,r){return this.jumpTo({zoom:e},r),this}zoomTo(e,r,a){return this.easeTo(s.e({zoom:e},r),a)}zoomIn(e,r){return this.zoomTo(this.getZoom()+1,e,r),this}zoomOut(e,r){return this.zoomTo(this.getZoom()-1,e,r),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(e,r){return e!=this.transform.fov&&(this.transform.setFov(e),this.fire(new s.l("movestart",r)).fire(new s.l("move",r)).fire(new s.l("moveend",r))),this}getBearing(){return this.transform.bearing}setBearing(e,r){return this.jumpTo({bearing:e},r),this}getPadding(){return this.transform.padding}setPadding(e,r){return this.jumpTo({padding:e},r),this}rotateTo(e,r,a){return this.easeTo(s.e({bearing:e},r),a)}resetNorth(e,r){return this.rotateTo(0,s.e({duration:1e3},e),r),this}resetNorthPitch(e,r){return this.easeTo(s.e({bearing:0,pitch:0,roll:0,duration:1e3},e),r),this}snapToNorth(e,r){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,r):this}getPitch(){return this.transform.pitch}setPitch(e,r){return this.jumpTo({pitch:e},r),this}getRoll(){return this.transform.roll}setRoll(e,r){return this.jumpTo({roll:e},r),this}cameraForBounds(e,r){e=dt.convert(e).adjustAntiMeridian();const a=r&&r.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),a,r)}_cameraForBoxAndBearing(e,r,a,l){const p={top:0,bottom:0,right:0,left:0};if(typeof(l=s.e({padding:p,offset:[0,0],maxZoom:this.transform.maxZoom},l)).padding=="number"){const R=l.padding;l.padding={top:R,bottom:R,right:R,left:R}}const y=s.e(p,l.padding);l.padding=y;const w=this.transform,A=new dt(e,r);return this.cameraHelper.cameraForBoxAndBearing(l,y,A,a,w)}fitBounds(e,r,a){return this._fitInternal(this.cameraForBounds(e,r),r,a)}fitScreenCoordinates(e,r,a,l,p){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(s.P.convert(e)),this.transform.screenPointToLocation(s.P.convert(r)),a,l),l,p)}_fitInternal(e,r,a){return e?(delete(r=s.e(e,r)).padding,r.linear?this.easeTo(r,a):this.flyTo(r,a)):this}jumpTo(e,r){this.stop();const a=this._getTransformForUpdate();let l=!1,p=!1,y=!1;const w=a.zoom;this.cameraHelper.handleJumpToCenterZoom(a,e);const A=a.zoom!==w;return"elevation"in e&&a.elevation!==+e.elevation&&a.setElevation(+e.elevation),"bearing"in e&&a.bearing!==+e.bearing&&(l=!0,a.setBearing(+e.bearing)),"pitch"in e&&a.pitch!==+e.pitch&&(p=!0,a.setPitch(+e.pitch)),"roll"in e&&a.roll!==+e.roll&&(y=!0,a.setRoll(+e.roll)),e.padding==null||a.isPaddingEqual(e.padding)||a.setPadding(e.padding),this._applyUpdatedTransform(a),this.fire(new s.l("movestart",r)).fire(new s.l("move",r)),A&&this.fire(new s.l("zoomstart",r)).fire(new s.l("zoom",r)).fire(new s.l("zoomend",r)),l&&this.fire(new s.l("rotatestart",r)).fire(new s.l("rotate",r)).fire(new s.l("rotateend",r)),p&&this.fire(new s.l("pitchstart",r)).fire(new s.l("pitch",r)).fire(new s.l("pitchend",r)),y&&this.fire(new s.l("rollstart",r)).fire(new s.l("roll",r)).fire(new s.l("rollend",r)),this.fire(new s.l("moveend",r))}calculateCameraOptionsFromTo(e,r,a,l=0){const p=s.$.fromLngLat(e,r),y=s.$.fromLngLat(a,l),w=y.x-p.x,A=y.y-p.y,R=y.z-p.z,D=Math.hypot(w,A,R);if(D===0)throw new Error("Can't calculate camera options with same From and To");const N=Math.hypot(w,A),O=s.ah(this.transform.cameraToCenterDistance/D/this.transform.tileSize),Z=180*Math.atan2(w,-A)/Math.PI;let K=180*Math.acos(N/D)/Math.PI;return K=R<0?90-K:90+K,{center:y.toLngLat(),elevation:l,zoom:O,pitch:K,bearing:Z}}calculateCameraOptionsFromCameraLngLatAltRotation(e,r,a,l,p){const y=this.transform.calculateCenterFromCameraLngLatAlt(e,r,a,l);return{center:y.center,elevation:y.elevation,zoom:y.zoom,bearing:a,pitch:l,roll:p}}easeTo(e,r){this._stop(!1,e.easeId),((e=s.e({offset:[0,0],duration:500,easing:s.cf},e)).animate===!1||!e.essential&&M.prefersReducedMotion)&&(e.duration=0);const a=this._getTransformForUpdate(),l=this.getBearing(),p=a.pitch,y=a.roll,w="bearing"in e?this._normalizeBearing(e.bearing,l):l,A="pitch"in e?+e.pitch:p,R="roll"in e?this._normalizeBearing(e.roll,y):y,D="padding"in e?e.padding:a.padding,N=s.P.convert(e.offset);let O,Z;e.around&&(O=s.Q.convert(e.around),Z=a.locationToScreenPoint(O));const K={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},ne=this.cameraHelper.handleEaseTo(a,{bearing:w,pitch:A,roll:R,padding:D,around:O,aroundPoint:Z,offsetAsPoint:N,offset:e.offset,zoom:e.zoom,center:e.center});return this._rotating=this._rotating||l!==w,this._pitching=this._pitching||A!==p,this._rolling=this._rolling||R!==y,this._padding=!a.isPaddingEqual(D),this._zooming=this._zooming||ne.isZooming,this._easeId=e.easeId,this._prepareEase(r,e.noMoveStart,K),this.terrain&&this._prepareElevation(ne.elevationCenter),this._ease(ie=>{ne.easeFunc(ie),this.terrain&&!e.freezeElevation&&this._updateElevation(ie),this._applyUpdatedTransform(a),this._fireMoveEvents(r)},ie=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(r,ie)},e),this}_prepareEase(e,r,a={}){this._moving=!0,r||a.moving||this.fire(new s.l("movestart",e)),this._zooming&&!a.zooming&&this.fire(new s.l("zoomstart",e)),this._rotating&&!a.rotating&&this.fire(new s.l("rotatestart",e)),this._pitching&&!a.pitching&&this.fire(new s.l("pitchstart",e)),this._rolling&&!a.rolling&&this.fire(new s.l("rollstart",e))}_prepareElevation(e){this._elevationCenter=e,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(e,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(e){this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));const r=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(e<1&&r!==this._elevationTarget){const a=this._elevationTarget-this._elevationStart;this._elevationStart+=e*(a-(r-(a*e+this._elevationStart))/(1-e)),this._elevationTarget=r}this.transform.setElevation(s.B.number(this._elevationStart,this._elevationTarget,e))}_finalizeElevation(){this._elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(e){if(!this.terrain&&e.elevation>=0&&e.pitch<=90)return{};const r=e.getCameraLngLat(),a=e.getCameraAltitude(),l=this.terrain?this.terrain.getElevationForLngLatZoom(r,e.zoom):0;if(a<l){const p=this.calculateCameraOptionsFromTo(r,l,e.center,e.elevation);return{pitch:p.pitch,zoom:p.zoom}}return{}}_applyUpdatedTransform(e){const r=[];if(r.push(l=>this._elevateCameraIfInsideTerrain(l)),this.transformCameraUpdate&&r.push(l=>this.transformCameraUpdate(l)),!r.length)return;const a=e.clone();for(const l of r){const p=a.clone(),{center:y,zoom:w,roll:A,pitch:R,bearing:D,elevation:N}=l(p);y&&p.setCenter(y),N!==void 0&&p.setElevation(N),w!==void 0&&p.setZoom(w),A!==void 0&&p.setRoll(A),R!==void 0&&p.setPitch(R),D!==void 0&&p.setBearing(D),a.apply(p)}this.transform.apply(a)}_fireMoveEvents(e){this.fire(new s.l("move",e)),this._zooming&&this.fire(new s.l("zoom",e)),this._rotating&&this.fire(new s.l("rotate",e)),this._pitching&&this.fire(new s.l("pitch",e)),this._rolling&&this.fire(new s.l("roll",e))}_afterEase(e,r){if(this._easeId&&r&&this._easeId===r)return;delete this._easeId;const a=this._zooming,l=this._rotating,p=this._pitching,y=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,a&&this.fire(new s.l("zoomend",e)),l&&this.fire(new s.l("rotateend",e)),p&&this.fire(new s.l("pitchend",e)),y&&this.fire(new s.l("rollend",e)),this.fire(new s.l("moveend",e))}flyTo(e,r){if(!e.essential&&M.prefersReducedMotion){const De=s.O(e,["center","zoom","bearing","pitch","roll","elevation"]);return this.jumpTo(De,r)}this.stop(),e=s.e({offset:[0,0],speed:1.2,curve:1.42,easing:s.cf},e);const a=this._getTransformForUpdate(),l=a.bearing,p=a.pitch,y=a.roll,w=a.padding,A="bearing"in e?this._normalizeBearing(e.bearing,l):l,R="pitch"in e?+e.pitch:p,D="roll"in e?this._normalizeBearing(e.roll,y):y,N="padding"in e?e.padding:a.padding,O=s.P.convert(e.offset);let Z=a.centerPoint.add(O);const K=a.screenPointToLocation(Z),ne=this.cameraHelper.handleFlyTo(a,{bearing:A,pitch:R,roll:D,padding:N,locationAtOffset:K,offsetAsPoint:O,center:e.center,minZoom:e.minZoom,zoom:e.zoom});let ie=e.curve;const ae=Math.max(a.width,a.height),ue=ae/ne.scaleOfZoom,me=ne.pixelPathLength;typeof ne.scaleOfMinZoom=="number"&&(ie=Math.sqrt(ae/ne.scaleOfMinZoom/me*2));const fe=ie*ie;function ge(De){const Ye=(ue*ue-ae*ae+(De?-1:1)*fe*fe*me*me)/(2*(De?ue:ae)*fe*me);return Math.log(Math.sqrt(Ye*Ye+1)-Ye)}function xe(De){return(Math.exp(De)-Math.exp(-De))/2}function ye(De){return(Math.exp(De)+Math.exp(-De))/2}const Te=ge(!1);let Fe=function(De){return ye(Te)/ye(Te+ie*De)},Le=function(De){return ae*((ye(Te)*(xe(Ye=Te+ie*De)/ye(Ye))-xe(Te))/fe)/me;var Ye},Be=(ge(!0)-Te)/ie;if(Math.abs(me)<2e-6||!isFinite(Be)){if(Math.abs(ae-ue)<1e-6)return this.easeTo(e,r);const De=ue<ae?-1:1;Be=Math.abs(Math.log(ue/ae))/ie,Le=()=>0,Fe=Ye=>Math.exp(De*ie*Ye)}return e.duration="duration"in e?+e.duration:1e3*Be/("screenSpeed"in e?+e.screenSpeed/ie:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=l!==A,this._pitching=R!==p,this._rolling=D!==y,this._padding=!a.isPaddingEqual(N),this._prepareEase(r,!1),this.terrain&&this._prepareElevation(ne.targetCenter),this._ease(De=>{const Ye=De*Be,Xe=1/Fe(Ye),He=Le(Ye);this._rotating&&a.setBearing(s.B.number(l,A,De)),this._pitching&&a.setPitch(s.B.number(p,R,De)),this._rolling&&a.setRoll(s.B.number(y,D,De)),this._padding&&(a.interpolatePadding(w,N,De),Z=a.centerPoint.add(O)),ne.easeFunc(De,Xe,He,Z),this.terrain&&!e.freezeElevation&&this._updateElevation(De),this._applyUpdatedTransform(a),this._fireMoveEvents(r)},()=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(r)},e),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,r){var a;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const l=this._onEaseEnd;delete this._onEaseEnd,l.call(this,r)}return e||(a=this.handlers)===null||a===void 0||a.stop(!1),this}_ease(e,r,a){a.animate===!1||a.duration===0?(e(1),r()):(this._easeStart=M.now(),this._easeOptions=a,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,r){e=s.aL(e,-180,180);const a=Math.abs(e-r);return Math.abs(e-360-r)<a&&(e-=360),Math.abs(e+360-r)<a&&(e+=360),e}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLatZoom(s.Q.convert(e),this.transform.tileZoom):null}}const fn={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class lr{constructor(e=fn){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=r=>{!r||r.sourceDataType!=="metadata"&&r.sourceDataType!=="visibility"&&r.dataType!=="style"&&r.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=E.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=E.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=E.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){E.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,r){const a=this._map._getUIString(`AttributionControl.${r}`);e.title=a,e.setAttribute("aria-label",a)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map(l=>typeof l!="string"?"":l)):typeof this.options.customAttribution=="string"&&e.push(this.options.customAttribution)),this._map.style.stylesheet){const l=this._map.style.stylesheet;this.styleOwner=l.owner,this.styleId=l.id}const r=this._map.style.sourceCaches;for(const l in r){const p=r[l];if(p.used||p.usedForTerrain){const y=p.getSource();y.attribution&&e.indexOf(y.attribution)<0&&e.push(y.attribution)}}e=e.filter(l=>String(l).trim()),e.sort((l,p)=>l.length-p.length),e=e.filter((l,p)=>{for(let y=p+1;y<e.length;y++)if(e[y].indexOf(l)>=0)return!1;return!0});const a=e.join(" | ");a!==this._attribHTML&&(this._attribHTML=a,e.length?(this._innerContainer.innerHTML=E.sanitize(a),this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class po{constructor(e={}){this._updateCompact=()=>{const r=this._container.children;if(r.length){const a=r[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&a.classList.add("maplibregl-compact"):a.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){this._map=e,this._compact=this.options&&this.options.compact,this._container=E.create("div","maplibregl-ctrl");const r=E.create("a","maplibregl-ctrl-logo");return r.target="_blank",r.rel="noopener nofollow",r.href="https://maplibre.org/",r.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),r.setAttribute("rel","noopener nofollow"),this._container.appendChild(r),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){E.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class bl{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){const r=++this._id;return this._queue.push({callback:e,id:r,cancelled:!1}),r}remove(e){const r=this._currentlyRunning,a=r?this._queue.concat(r):this._queue;for(const l of a)if(l.id===e)return void(l.cancelled=!0)}run(e=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const r=this._currentlyRunning=this._queue;this._queue=[];for(const a of r)if(!a.cancelled&&(a.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Jc=s.aG([{name:"a_pos3d",type:"Int16",components:3}]);class Xc extends s.E{constructor(e){super(),this._lastTilesetChange=M.now(),this.sourceCache=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=e._source.tileSize*2**this.deltaZoom,e.usedForTerrain=!0,e.tileSize=this.tileSize}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(e,r){this.sourceCache.update(e,r),this._renderableTilesKeys=[];const a={};for(const l of be(e,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:r,calculateTileZoom:this.sourceCache._source.calculateTileZoom}))a[l.key]=!0,this._renderableTilesKeys.push(l.key),this._tiles[l.key]||(l.terrainRttPosMatrix32f=new Float64Array(16),s.bQ(l.terrainRttPosMatrix32f,0,s.Z,s.Z,0,0,1),this._tiles[l.key]=new qr(l,this.tileSize),this._lastTilesetChange=M.now());for(const l in this._tiles)a[l]||delete this._tiles[l]}freeRtt(e){for(const r in this._tiles){const a=this._tiles[r];(!e||a.tileID.equals(e)||a.tileID.isChildOf(e)||e.isChildOf(a.tileID))&&(a.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(e=>this.getTileByID(e))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e,r){return r?this._getTerrainCoordsForTileRanges(e,r):this._getTerrainCoordsForRegularTile(e)}_getTerrainCoordsForRegularTile(e){const r={};for(const a of this._renderableTilesKeys){const l=this._tiles[a].tileID,p=e.clone(),y=s.b2();if(l.canonical.equals(e.canonical))s.bQ(y,0,s.Z,s.Z,0,0,1);else if(l.canonical.isChildOf(e.canonical)){const w=l.canonical.z-e.canonical.z,A=l.canonical.x-(l.canonical.x>>w<<w),R=l.canonical.y-(l.canonical.y>>w<<w),D=s.Z>>w;s.bQ(y,0,D,D,0,0,1),s.L(y,y,[-A*D,-R*D,0])}else{if(!e.canonical.isChildOf(l.canonical))continue;{const w=e.canonical.z-l.canonical.z,A=e.canonical.x-(e.canonical.x>>w<<w),R=e.canonical.y-(e.canonical.y>>w<<w),D=s.Z>>w;s.bQ(y,0,s.Z,s.Z,0,0,1),s.L(y,y,[A*D,R*D,0]),s.M(y,y,[1/2**w,1/2**w,0])}}p.terrainRttPosMatrix32f=new Float32Array(y),r[a]=p}return r}_getTerrainCoordsForTileRanges(e,r){const a={};for(const l of this._renderableTilesKeys){const p=this._tiles[l].tileID;if(!this._isWithinTileRanges(p,r))continue;const y=e.clone(),w=s.b2();if(p.canonical.z===e.canonical.z){const A=e.canonical.x-p.canonical.x,R=e.canonical.y-p.canonical.y;s.bQ(w,0,s.Z,s.Z,0,0,1),s.L(w,w,[A*s.Z,R*s.Z,0])}else if(p.canonical.z>e.canonical.z){const A=p.canonical.z-e.canonical.z,R=p.canonical.x-(p.canonical.x>>A<<A),D=p.canonical.y-(p.canonical.y>>A<<A),N=e.canonical.x-(p.canonical.x>>A),O=e.canonical.y-(p.canonical.y>>A),Z=s.Z>>A;s.bQ(w,0,Z,Z,0,0,1),s.L(w,w,[-R*Z+N*s.Z,-D*Z+O*s.Z,0])}else{const A=e.canonical.z-p.canonical.z,R=e.canonical.x-(e.canonical.x>>A<<A),D=e.canonical.y-(e.canonical.y>>A<<A),N=(e.canonical.x>>A)-p.canonical.x,O=(e.canonical.y>>A)-p.canonical.y,Z=s.Z<<A;s.bQ(w,0,Z,Z,0,0,1),s.L(w,w,[R*s.Z+N*Z,D*s.Z+O*Z,0])}y.terrainRttPosMatrix32f=new Float32Array(w),a[l]=y}return a}getSourceTile(e,r){const a=this.sourceCache._source;let l=e.overscaledZ-this.deltaZoom;if(l>a.maxzoom&&(l=a.maxzoom),l<a.minzoom)return null;this._sourceTileCache[e.key]||(this._sourceTileCache[e.key]=e.scaledTo(l).key);let p=this.sourceCache.getTileByID(this._sourceTileCache[e.key]);if((!p||!p.dem)&&r)for(;l>=a.minzoom&&(!p||!p.dem);)p=this.sourceCache.getTileByID(e.scaledTo(l--).key);return p}anyTilesAfterTime(e=Date.now()){return this._lastTilesetChange>=e}_isWithinTileRanges(e,r){return r[e.canonical.z]&&e.canonical.x>=r[e.canonical.z].minTileX&&e.canonical.x<=r[e.canonical.z].maxTileX&&e.canonical.y>=r[e.canonical.z].minTileY&&e.canonical.y<=r[e.canonical.z].maxTileY}}class Qc{constructor(e,r,a){this._meshCache={},this.painter=e,this.sourceCache=new Xc(r),this.options=a,this.exaggeration=typeof a.exaggeration=="number"?a.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(e,r,a,l=s.Z){var p;if(!(r>=0&&r<l&&a>=0&&a<l))return 0;const y=this.getTerrainData(e),w=(p=y.tile)===null||p===void 0?void 0:p.dem;if(!w)return 0;const A=s.cj([],[r/l*s.Z,a/l*s.Z],y.u_terrain_matrix),R=[A[0]*w.dim,A[1]*w.dim],D=Math.floor(R[0]),N=Math.floor(R[1]),O=R[0]-D,Z=R[1]-N;return w.get(D,N)*(1-O)*(1-Z)+w.get(D+1,N)*O*(1-Z)+w.get(D,N+1)*(1-O)*Z+w.get(D+1,N+1)*O*Z}getElevationForLngLatZoom(e,r){if(!s.ck(r,e.wrap()))return 0;const{tileID:a,mercatorX:l,mercatorY:p}=this._getOverscaledTileIDFromLngLatZoom(e,r);return this.getElevation(a,l%s.Z,p%s.Z,s.Z)}getElevation(e,r,a,l=s.Z){return this.getDEMElevation(e,r,a,l)*this.exaggeration}getTerrainData(e){if(!this._emptyDemTexture){const l=this.painter.context,p=new s.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new Ze(l,p,l.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new Ze(l,new s.R({width:1,height:1}),l.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(l.gl.NEAREST,l.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=s.ad([])}const r=this.sourceCache.getSourceTile(e,!0);if(r&&r.dem&&(!r.demTexture||r.needsTerrainPrepare)){const l=this.painter.context;r.demTexture=this.painter.getTileTexture(r.dem.stride),r.demTexture?r.demTexture.update(r.dem.getPixels(),{premultiply:!1}):r.demTexture=new Ze(l,r.dem.getPixels(),l.gl.RGBA,{premultiply:!1}),r.demTexture.bind(l.gl.NEAREST,l.gl.CLAMP_TO_EDGE),r.needsTerrainPrepare=!1}const a=r&&r+r.tileID.key+e.key;if(a&&!this._demMatrixCache[a]){const l=this.sourceCache.sourceCache._source.maxzoom;let p=e.canonical.z-r.tileID.canonical.z;e.overscaledZ>e.canonical.z&&(e.canonical.z>=l?p=e.canonical.z-l:s.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const y=e.canonical.x-(e.canonical.x>>p<<p),w=e.canonical.y-(e.canonical.y>>p<<p),A=s.cl(new Float64Array(16),[1/(s.Z<<p),1/(s.Z<<p),0]);s.L(A,A,[y*s.Z,w*s.Z,0]),this._demMatrixCache[e.key]={matrix:A,coord:e}}return{u_depth:2,u_terrain:3,u_terrain_dim:r&&r.dem&&r.dem.dim||1,u_terrain_matrix:a?this._demMatrixCache[e.key].matrix:this._emptyDemMatrix,u_terrain_unpack:r&&r.dem&&r.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(r&&r.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:r}}getFramebuffer(e){const r=this.painter,a=r.width/devicePixelRatio,l=r.height/devicePixelRatio;return!this._fbo||this._fbo.width===a&&this._fbo.height===l||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new Ze(r.context,{width:a,height:l,data:null},r.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(r.context.gl.NEAREST,r.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new Ze(r.context,{width:a,height:l,data:null},r.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(r.context.gl.NEAREST,r.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=r.context.createFramebuffer(a,l,!0,!1),this._fbo.depthAttachment.set(r.context.createRenderbuffer(r.context.gl.DEPTH_COMPONENT16,a,l))),this._fbo.colorAttachment.set(e==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const e=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const r=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let p=0,y=0;p<this._coordsTextureSize;p++)for(let w=0;w<this._coordsTextureSize;w++,y+=4)r[y+0]=255&w,r[y+1]=255&p,r[y+2]=w>>8<<4|p>>8,r[y+3]=0;const a=new s.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(r.buffer)),l=new Ze(e,a,e.gl.RGBA,{premultiply:!1});return l.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._coordsTexture=l,l}pointCoordinate(e){this.painter.maybeDrawDepthAndCoords(!0);const r=new Uint8Array(4),a=this.painter.context,l=a.gl,p=Math.round(e.x*this.painter.pixelRatio/devicePixelRatio),y=Math.round(e.y*this.painter.pixelRatio/devicePixelRatio),w=Math.round(this.painter.height/devicePixelRatio);a.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),l.readPixels(p,w-y-1,1,1,l.RGBA,l.UNSIGNED_BYTE,r),a.bindFramebuffer.set(null);const A=r[0]+(r[2]>>4<<8),R=r[1]+((15&r[2])<<8),D=this.coordsIndex[255-r[3]],N=D&&this.sourceCache.getTileByID(D);if(!N)return null;const O=this._coordsTextureSize,Z=(1<<N.tileID.canonical.z)*O;return new s.$((N.tileID.canonical.x*O+A)/Z+N.tileID.wrap,(N.tileID.canonical.y*O+R)/Z,this.getElevation(N.tileID,A,R,O))}depthAtPoint(e){const r=new Uint8Array(4),a=this.painter.context,l=a.gl;return a.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),l.readPixels(e.x,this.painter.height/devicePixelRatio-e.y-1,1,1,l.RGBA,l.UNSIGNED_BYTE,r),a.bindFramebuffer.set(null),(r[0]/16777216+r[1]/65536+r[2]/256+r[3])/256}getTerrainMesh(e){var r;const a=((r=this.painter.style.projection)===null||r===void 0?void 0:r.transitionState)>0,l=a&&e.canonical.y===0,p=a&&e.canonical.y===(1<<e.canonical.z)-1,y=`m_${l?"n":""}_${p?"s":""}`;if(this._meshCache[y])return this._meshCache[y];const w=this.painter.context,A=new s.cm,R=new s.aK,D=this.meshSize,N=s.Z/D,O=D*D;for(let ye=0;ye<=D;ye++)for(let Te=0;Te<=D;Te++)A.emplaceBack(Te*N,ye*N,0);for(let ye=0;ye<O;ye+=D+1)for(let Te=0;Te<D;Te++)R.emplaceBack(Te+ye,D+Te+ye+1,D+Te+ye+2),R.emplaceBack(Te+ye,D+Te+ye+2,Te+ye+1);const Z=A.length,K=Z+(D+1),ne=(D+1)*D,ie=l?s.b9:0,ae=l?0:1,ue=p?s.ba:s.Z,me=p?0:1;for(let ye=0;ye<=D;ye++)A.emplaceBack(ye*N,ie,ae);for(let ye=0;ye<=D;ye++)A.emplaceBack(ye*N,ue,me);for(let ye=0;ye<D;ye++)R.emplaceBack(ne+ye,K+ye,K+ye+1),R.emplaceBack(ne+ye,K+ye+1,ne+ye+1),R.emplaceBack(0+ye,Z+ye+1,Z+ye),R.emplaceBack(0+ye,0+ye+1,Z+ye+1);const fe=A.length,ge=fe+2*(D+1);for(const ye of[0,1])for(let Te=0;Te<=D;Te++)for(const Fe of[0,1])A.emplaceBack(ye*s.Z,Te*N,Fe);for(let ye=0;ye<2*D;ye+=2)R.emplaceBack(fe+ye,fe+ye+1,fe+ye+3),R.emplaceBack(fe+ye,fe+ye+3,fe+ye+2),R.emplaceBack(ge+ye,ge+ye+3,ge+ye+1),R.emplaceBack(ge+ye,ge+ye+2,ge+ye+3);const xe=new hs(w.createVertexBuffer(A,Jc.members),w.createIndexBuffer(R),s.aJ.simpleSegment(0,0,A.length,R.length));return this._meshCache[y]=xe,xe}getMeshFrameDelta(e){return 2*Math.PI*s.bu/Math.pow(2,Math.max(e,0))/5}getMinTileElevationForLngLatZoom(e,r){var a;const{tileID:l}=this._getOverscaledTileIDFromLngLatZoom(e,r);return(a=this.getMinMaxElevation(l).minElevation)!==null&&a!==void 0?a:0}getMinMaxElevation(e){const r=this.getTerrainData(e).tile,a={minElevation:null,maxElevation:null};return r&&r.dem&&(a.minElevation=r.dem.min*this.exaggeration,a.maxElevation=r.dem.max*this.exaggeration),a}_getOverscaledTileIDFromLngLatZoom(e,r){const a=s.$.fromLngLat(e.wrap()),l=(1<<r)*s.Z,p=a.x*l,y=a.y*l,w=Math.floor(p/s.Z),A=Math.floor(y/s.Z);return{tileID:new s.Y(r,0,r,w,A),mercatorX:p,mercatorY:y}}}class qh{constructor(e,r,a){this._context=e,this._size=r,this._tileSize=a,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const e of this._objects)e.texture.destroy(),e.fbo.destroy()}_createObject(e){const r=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),a=new Ze(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return a.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),this._context.extTextureFilterAnisotropic&&this._context.gl.texParameterf(this._context.gl.TEXTURE_2D,this._context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this._context.extTextureFilterAnisotropicMax),r.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),r.colorAttachment.set(a.texture),{id:e,fbo:r,texture:a,stamp:-1,inUse:!1}}getObjectForId(e){return this._objects[e]}useObject(e){e.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(r=>e.id!==r),this._recentlyUsed.push(e.id)}stampObject(e){e.stamp=++this._stamp}getOrCreateFreeObject(){for(const r of this._recentlyUsed)if(!this._objects[r].inUse)return this._objects[r];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const e=this._createObject(this._objects.length);return this._objects.push(e),e}freeObject(e){e.inUse=!1}freeAllObjects(){for(const e of this._objects)this.freeObject(e)}isFull(){return!(this._objects.length<this._size)&&this._objects.some(e=>!e.inUse)===!1}}const yi={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class ga{constructor(e,r){this.painter=e,this.terrain=r,this.pool=new qh(e.context,30,r.sourceCache.tileSize*r.qualityFactor)}destruct(){this.pool.destruct()}getTexture(e){return this.pool.getObjectForId(e.rtt[this._stacks.length-1].id).texture}prepareForRender(e,r){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=e._order.filter(a=>!e._layers[a].isHidden(r)),this._coordsAscending={};for(const a in e.sourceCaches){this._coordsAscending[a]={};const l=e.sourceCaches[a].getVisibleCoordinates(),p=e.sourceCaches[a].getSource(),y=p instanceof Rr?p.terrainTileRanges:null;for(const w of l){const A=this.terrain.sourceCache.getTerrainCoords(w,y);for(const R in A)this._coordsAscending[a][R]||(this._coordsAscending[a][R]=[]),this._coordsAscending[a][R].push(A[R])}}this._coordsAscendingStr={};for(const a of e._order){const l=e._layers[a],p=l.source;if(yi[l.type]&&!this._coordsAscendingStr[p]){this._coordsAscendingStr[p]={};for(const y in this._coordsAscending[p])this._coordsAscendingStr[p][y]=this._coordsAscending[p][y].map(w=>w.key).sort().join()}}for(const a of this._renderableTiles)for(const l in this._coordsAscendingStr){const p=this._coordsAscendingStr[l][a.tileID.key];p&&p!==a.rttCoords[l]&&(a.rtt=[])}}renderLayer(e,r){if(e.isHidden(this.painter.transform.zoom))return!1;const a=Object.assign(Object.assign({},r),{isRenderingToTexture:!0}),l=e.type,p=this.painter,y=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(yi[l]&&(this._prevType&&yi[this._prevType]||this._stacks.push([]),this._prevType=l,this._stacks[this._stacks.length-1].push(e.id),!y))return!0;if(yi[this._prevType]||yi[l]&&y){this._prevType=l;const w=this._stacks.length-1,A=this._stacks[w]||[];for(const R of this._renderableTiles){if(this.pool.isFull()&&(Tn(this.painter,this.terrain,this._rttTiles,a),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(R),R.rtt[w]){const N=this.pool.getObjectForId(R.rtt[w].id);if(N.stamp===R.rtt[w].stamp){this.pool.useObject(N);continue}}const D=this.pool.getOrCreateFreeObject();this.pool.useObject(D),this.pool.stampObject(D),R.rtt[w]={id:D.id,stamp:D.stamp},p.context.bindFramebuffer.set(D.fbo.framebuffer),p.context.clear({color:s.b7.transparent,stencil:0}),p.currentStencilSource=void 0;for(let N=0;N<A.length;N++){const O=p.style._layers[A[N]],Z=O.source?this._coordsAscending[O.source][R.tileID.key]:[R.tileID];p.context.viewport.set([0,0,D.fbo.width,D.fbo.height]),p._renderTileClippingMasks(O,Z,!0),p.renderLayer(p,p.style.sourceCaches[O.source],O,Z,a),O.source&&(R.rttCoords[O.source]=this._coordsAscendingStr[O.source][R.tileID.key])}}return Tn(this.painter,this.terrain,this._rttTiles,a),this._rttTiles=[],this.pool.freeAllObjects(),yi[l]}return!1}}const ct={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","GlobeControl.Enable":"Enable globe","GlobeControl.Disable":"Disable globe","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use ⌘ + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},yt=V,fo={hash:!1,interactive:!0,bearingSnap:7,attributionControl:fn,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 0},scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:s.a.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0},wl={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};class Sl{constructor(e,r,a=!1){this.mousedown=p=>{this.startMove(p,E.mousePos(this.element,p)),E.addEventListener(window,"mousemove",this.mousemove),E.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=p=>{this.move(p,E.mousePos(this.element,p))},this.mouseup=p=>{this._rotatePitchHanlder.dragEnd(p),this.offTemp()},this.touchstart=p=>{p.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=E.touchPos(this.element,p.targetTouches)[0],this.startMove(p,this._startPos),E.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),E.addEventListener(window,"touchend",this.touchend))},this.touchmove=p=>{p.targetTouches.length!==1?this.reset():(this._lastPos=E.touchPos(this.element,p.targetTouches)[0],this.move(p,this._lastPos))},this.touchend=p=>{p.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this._rotatePitchHanlder.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=r;const l=new Ts;this._rotatePitchHanlder=new hi({clickTolerance:3,move:(p,y)=>{const w=r.getBoundingClientRect(),A=new s.P((w.bottom-w.top)/2,(w.right-w.left)/2);return{bearingDelta:s.ce(new s.P(p.x,y.y),y,A),pitchDelta:a?-.5*(y.y-p.y):void 0}},moveStateManager:l,enable:!0,assignEvents:()=>{}}),this.map=e,E.addEventListener(r,"mousedown",this.mousedown),E.addEventListener(r,"touchstart",this.touchstart,{passive:!1}),E.addEventListener(r,"touchcancel",this.reset)}startMove(e,r){this._rotatePitchHanlder.dragStart(e,r),E.disableDrag()}move(e,r){const a=this.map,{bearingDelta:l,pitchDelta:p}=this._rotatePitchHanlder.dragMove(e,r)||{};l&&a.setBearing(a.getBearing()+l),p&&a.setPitch(a.getPitch()+p)}off(){const e=this.element;E.removeEventListener(e,"mousedown",this.mousedown),E.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),E.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),E.removeEventListener(window,"touchend",this.touchend),E.removeEventListener(e,"touchcancel",this.reset),this.offTemp()}offTemp(){E.enableDrag(),E.removeEventListener(window,"mousemove",this.mousemove),E.removeEventListener(window,"mouseup",this.mouseup),E.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),E.removeEventListener(window,"touchend",this.touchend)}}let zr;function kl(h,e,r,a=!1){if(a||!r.getCoveringTilesDetailsProvider().allowWorldCopies())return h==null?void 0:h.wrap();const l=new s.Q(h.lng,h.lat);if(h=new s.Q(h.lng,h.lat),e){const p=new s.Q(h.lng-360,h.lat),y=new s.Q(h.lng+360,h.lat),w=r.locationToScreenPoint(h).distSqr(e);r.locationToScreenPoint(p).distSqr(e)<w?h=p:r.locationToScreenPoint(y).distSqr(e)<w&&(h=y)}for(;Math.abs(h.lng-r.center.lng)>180;){const p=r.locationToScreenPoint(h);if(p.x>=0&&p.y>=0&&p.x<=r.width&&p.y<=r.height)break;h.lng>r.center.lng?h.lng-=360:h.lng+=360}return h.lng!==l.lng&&r.isPointOnMapSurface(r.locationToScreenPoint(h))?h:l}const qi={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Yc(h,e,r){const a=h.classList;for(const l in qi)a.remove(`maplibregl-${r}-anchor-${l}`);a.add(`maplibregl-${r}-anchor-${e}`)}class Yn extends s.E{constructor(e){if(super(),this._onKeyPress=r=>{const a=r.code,l=r.charCode||r.keyCode;a!=="Space"&&a!=="Enter"&&l!==32&&l!==13||this.togglePopup()},this._onMapClick=r=>{const a=r.originalEvent.target,l=this._element;this._popup&&(a===l||l.contains(a))&&this.togglePopup()},this._update=r=>{if(!this._map)return;const a=this._map.loaded()&&!this._map.isMoving();((r==null?void 0:r.type)==="terrain"||(r==null?void 0:r.type)==="render"&&!a)&&this._map.once("render",this._update),this._lngLat=kl(this._lngLat,this._flatPos,this._map.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let l="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?l=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(l=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let p="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?p="rotateX(0deg)":this._pitchAlignment==="map"&&(p=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||r&&r.type!=="moveend"||(this._pos=this._pos.round()),E.setTransform(this._element,`${qi[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${p} ${l}`),M.frameAsync(new AbortController).then(()=>{this._updateOpacity(r&&r.type==="moveend")}).catch(()=>{})},this._onMove=r=>{if(!this._isDragging){const a=this._clickTolerance||this._map._clickTolerance;this._isDragging=r.point.dist(this._pointerdownPos)>=a}this._isDragging&&(this._pos=r.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new s.l("dragstart"))),this.fire(new s.l("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new s.l("dragend")),this._state="inactive"},this._addDragHandler=r=>{this._element.contains(r.originalEvent.target)&&(r.preventDefault(),this._positionDelta=r.point.sub(this._pos).add(this._offset),this._pointerdownPos=r.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",this._scale=e&&e.scale||1,this._draggable=e&&e.draggable||!1,this._clickTolerance=e&&e.clickTolerance||0,this._subpixelPositioning=e&&e.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=e&&e.rotation||0,this._rotationAlignment=e&&e.rotationAlignment||"auto",this._pitchAlignment=e&&e.pitchAlignment&&e.pitchAlignment!=="auto"?e.pitchAlignment:this._rotationAlignment,this.setOpacity(e==null?void 0:e.opacity,e==null?void 0:e.opacityWhenCovered),e&&e.element)this._element=e.element,this._offset=s.P.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=E.create("div");const r=E.createNS("http://www.w3.org/2000/svg","svg"),a=41,l=27;r.setAttributeNS(null,"display","block"),r.setAttributeNS(null,"height",`${a}px`),r.setAttributeNS(null,"width",`${l}px`),r.setAttributeNS(null,"viewBox",`0 0 ${l} ${a}`);const p=E.createNS("http://www.w3.org/2000/svg","g");p.setAttributeNS(null,"stroke","none"),p.setAttributeNS(null,"stroke-width","1"),p.setAttributeNS(null,"fill","none"),p.setAttributeNS(null,"fill-rule","evenodd");const y=E.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"fill-rule","nonzero");const w=E.createNS("http://www.w3.org/2000/svg","g");w.setAttributeNS(null,"transform","translate(3.0, 29.0)"),w.setAttributeNS(null,"fill","#000000");const A=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const ae of A){const ue=E.createNS("http://www.w3.org/2000/svg","ellipse");ue.setAttributeNS(null,"opacity","0.04"),ue.setAttributeNS(null,"cx","10.5"),ue.setAttributeNS(null,"cy","5.80029008"),ue.setAttributeNS(null,"rx",ae.rx),ue.setAttributeNS(null,"ry",ae.ry),w.appendChild(ue)}const R=E.createNS("http://www.w3.org/2000/svg","g");R.setAttributeNS(null,"fill",this._color);const D=E.createNS("http://www.w3.org/2000/svg","path");D.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),R.appendChild(D);const N=E.createNS("http://www.w3.org/2000/svg","g");N.setAttributeNS(null,"opacity","0.25"),N.setAttributeNS(null,"fill","#000000");const O=E.createNS("http://www.w3.org/2000/svg","path");O.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),N.appendChild(O);const Z=E.createNS("http://www.w3.org/2000/svg","g");Z.setAttributeNS(null,"transform","translate(6.0, 7.0)"),Z.setAttributeNS(null,"fill","#FFFFFF");const K=E.createNS("http://www.w3.org/2000/svg","g");K.setAttributeNS(null,"transform","translate(8.0, 8.0)");const ne=E.createNS("http://www.w3.org/2000/svg","circle");ne.setAttributeNS(null,"fill","#000000"),ne.setAttributeNS(null,"opacity","0.25"),ne.setAttributeNS(null,"cx","5.5"),ne.setAttributeNS(null,"cy","5.5"),ne.setAttributeNS(null,"r","5.4999962");const ie=E.createNS("http://www.w3.org/2000/svg","circle");ie.setAttributeNS(null,"fill","#FFFFFF"),ie.setAttributeNS(null,"cx","5.5"),ie.setAttributeNS(null,"cy","5.5"),ie.setAttributeNS(null,"r","5.4999962"),K.appendChild(ne),K.appendChild(ie),y.appendChild(w),y.appendChild(R),y.appendChild(N),y.appendChild(Z),y.appendChild(K),r.appendChild(y),r.setAttributeNS(null,"height",a*this._scale+"px"),r.setAttributeNS(null,"width",l*this._scale+"px"),this._element.appendChild(r),this._offset=s.P.convert(e&&e.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",r=>{r.preventDefault()}),this._element.addEventListener("mousedown",r=>{r.preventDefault()}),Yc(this._element,this._anchor,"marker"),e&&e.className)for(const r of e.className.split(" "))this._element.classList.add(r);this._popup=null}addTo(e){return this.remove(),this._map=e,this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label",e._getUIString("Marker.Title")),e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.on("terrain",this._update),e.on("projectiontransition",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),E.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=s.Q.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){const l=Math.abs(13.5)/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[l,-1*(38.1-13.5+l)],"bottom-right":[-l,-1*(38.1-13.5+l)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=e,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(e){return this._subpixelPositioning=e,this}getPopup(){return this._popup}togglePopup(){const e=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:e?(e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map)),this):this}_updateOpacity(e=!1){var r,a;const l=(r=this._map)===null||r===void 0?void 0:r.terrain,p=this._map.transform.isLocationOccluded(this._lngLat);if(!l||p){const Z=p?this._opacityWhenCovered:this._opacity;return void(this._element.style.opacity!==Z&&(this._element.style.opacity=Z))}if(e)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const y=this._map,w=y.terrain.depthAtPoint(this._pos),A=y.terrain.getElevationForLngLatZoom(this._lngLat,y.transform.tileZoom);if(y.transform.lngLatToCameraDepth(this._lngLat,A)-w<.006)return void(this._element.style.opacity=this._opacity);const R=-this._offset.y/y.transform.pixelsPerMeter,D=Math.sin(y.getPitch()*Math.PI/180)*R,N=y.terrain.depthAtPoint(new s.P(this._pos.x,this._pos.y-this._offset.y)),O=y.transform.lngLatToCameraDepth(this._lngLat,A+D)-N>.006;!((a=this._popup)===null||a===void 0)&&a.isOpen()&&O&&this._popup.remove(),this._element.style.opacity=O?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(e){return this._offset=s.P.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&e!=="auto"?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,r){return(this._opacity===void 0||e===void 0&&r===void 0)&&(this._opacity="1",this._opacityWhenCovered="0.2"),e!==void 0&&(this._opacity=e),r!==void 0&&(this._opacityWhenCovered=r),this._map&&this._updateOpacity(!0),this}}const wr={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let fr=0,Is=!1;const mo={maxWidth:100,unit:"metric"};function go(h,e,r){const a=r&&r.maxWidth||100,l=h._container.clientHeight/2,p=h._container.clientWidth/2,y=h.unproject([p-a/2,l]),w=h.unproject([p+a/2,l]),A=Math.round(h.project(w).x-h.project(y).x),R=Math.min(a,A,h._container.clientWidth),D=y.distanceTo(w);if(r&&r.unit==="imperial"){const N=3.2808*D;N>5280?$n(e,R,N/5280,h._getUIString("ScaleControl.Miles")):$n(e,R,N,h._getUIString("ScaleControl.Feet"))}else r&&r.unit==="nautical"?$n(e,R,D/1852,h._getUIString("ScaleControl.NauticalMiles")):D>=1e3?$n(e,R,D/1e3,h._getUIString("ScaleControl.Kilometers")):$n(e,R,D,h._getUIString("ScaleControl.Meters"))}function $n(h,e,r,a){const l=function(p){const y=Math.pow(10,`${Math.floor(p)}`.length-1);let w=p/y;return w=w>=10?10:w>=5?5:w>=3?3:w>=2?2:w>=1?1:function(A){const R=Math.pow(10,Math.ceil(-Math.log(A)/Math.LN10));return Math.round(A*R)/R}(w),y*w}(r);h.style.width=e*(l/r)+"px",h.innerHTML=`${l}&nbsp;${a}`}const Al={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0},Cl=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Ms(h){if(h){if(typeof h=="number"){const e=Math.round(Math.abs(h)/Math.SQRT2);return{center:new s.P(0,0),top:new s.P(0,h),"top-left":new s.P(e,e),"top-right":new s.P(-e,e),bottom:new s.P(0,-h),"bottom-left":new s.P(e,-e),"bottom-right":new s.P(-e,-e),left:new s.P(h,0),right:new s.P(-h,0)}}if(h instanceof s.P||Array.isArray(h)){const e=s.P.convert(h);return{center:e,top:e,"top-left":e,"top-right":e,bottom:e,"bottom-left":e,"bottom-right":e,left:e,right:e}}return{center:s.P.convert(h.center||[0,0]),top:s.P.convert(h.top||[0,0]),"top-left":s.P.convert(h["top-left"]||[0,0]),"top-right":s.P.convert(h["top-right"]||[0,0]),bottom:s.P.convert(h.bottom||[0,0]),"bottom-left":s.P.convert(h["bottom-left"]||[0,0]),"bottom-right":s.P.convert(h["bottom-right"]||[0,0]),left:s.P.convert(h.left||[0,0]),right:s.P.convert(h.right||[0,0])}}return Ms(new s.P(0,0))}const Tl=V;x.AJAXError=s.cq,x.Event=s.l,x.Evented=s.E,x.LngLat=s.Q,x.MercatorCoordinate=s.$,x.Point=s.P,x.addProtocol=s.cr,x.config=s.a,x.removeProtocol=s.cs,x.AttributionControl=lr,x.BoxZoomHandler=ml,x.CanvasSource=ir,x.CooperativeGesturesHandler=fa,x.DoubleClickZoomHandler=da,x.DragPanHandler=Kc,x.DragRotateHandler=Gc,x.EdgeInsets=js,x.FullscreenControl=class extends s.E{constructor(h={}){super(),this._onFullscreenChange=()=>{var e;let r=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((e=r==null?void 0:r.shadowRoot)===null||e===void 0)&&e.fullscreenElement;)r=r.shadowRoot.fullscreenElement;r===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,h&&h.container&&(h.container instanceof HTMLElement?this._container=h.container:s.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(h){return this._map=h,this._container||(this._container=this._map.getContainer()),this._controlContainer=E.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){E.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const h=this._fullscreenButton=E.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);E.create("span","maplibregl-ctrl-icon",h).setAttribute("aria-hidden","true"),h.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const h=this._getTitle();this._fullscreenButton.setAttribute("aria-label",h),this._fullscreenButton.title=h}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new s.l("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new s.l("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},x.GeoJSONSource=Qt,x.GeolocateControl=class extends s.E{constructor(h){super(),this._onSuccess=e=>{if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new s.l("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(e),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new s.l("geolocate",e)),this._finish()}},this._updateCamera=e=>{const r=new s.Q(e.coords.longitude,e.coords.latitude),a=e.coords.accuracy,l=this._map.getBearing(),p=s.e({bearing:l},this.options.fitBoundsOptions),y=dt.fromLngLat(r,a);this._map.fitBounds(y,p,{geolocateSource:!0})},this._updateMarker=e=>{if(e){const r=new s.Q(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=e=>{if(this._map){if(e.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(e.code===3&&Is)return;this.options.trackUserLocation&&this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new s.l("error",e)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",e=>e.preventDefault()),this._geolocateButton=E.create("button","maplibregl-ctrl-geolocate",this._container),E.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=e=>{if(this._map){if(e===!1){s.w("Geolocation support is not available so the GeolocateControl will be disabled.");const r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r)}else{const r=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=E.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Yn({element:this._dotElement}),this._circleElement=E.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Yn({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",r=>{r.geolocateSource||this._watchState!=="ACTIVE_LOCK"||r.originalEvent&&r.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new s.l("trackuserlocationend")),this.fire(new s.l("userlocationlostfocus")))})}},this.options=s.e({},wr,h)}onAdd(h){return this._map=h,this._container=E.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return s._(this,arguments,void 0,function*(e=!1){if(zr!==void 0&&!e)return zr;if(window.navigator.permissions===void 0)return zr=!!window.navigator.geolocation,zr;try{zr=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{zr=!!window.navigator.geolocation}return zr})}().then(e=>this._finishSetupUI(e)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),E.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,fr=0,Is=!1}_isOutOfMapMaxBounds(h){const e=this._map.getMaxBounds(),r=h.coords;return e&&(r.longitude<e.getWest()||r.longitude>e.getEast()||r.latitude<e.getSouth()||r.latitude>e.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const h=this._map.getBounds(),e=h.getSouthEast(),r=h.getNorthEast(),a=e.distanceTo(r),l=Math.ceil(this._accuracy/(a/this._map._container.clientHeight)*2);this._circleElement.style.width=`${l}px`,this._circleElement.style.height=`${l}px`}trigger(){if(!this._setup)return s.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new s.l("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":fr--,Is=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new s.l("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new s.l("trackuserlocationstart")),this.fire(new s.l("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let h;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),fr++,fr>1?(h={maximumAge:6e5,timeout:0},Is=!0):(h=this.options.positionOptions,Is=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,h)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},x.GlobeControl=class{constructor(){this._toggleProjection=()=>{var h;const e=(h=this._map.getProjection())===null||h===void 0?void 0:h.type;this._map.setProjection(e!=="mercator"&&e?{type:"mercator"}:{type:"globe"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{var h;this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),((h=this._map.getProjection())===null||h===void 0?void 0:h.type)==="globe"?(this._globeButton.classList.add("maplibregl-ctrl-globe-enabled"),this._globeButton.title=this._map._getUIString("GlobeControl.Disable")):(this._globeButton.classList.add("maplibregl-ctrl-globe"),this._globeButton.title=this._map._getUIString("GlobeControl.Enable"))}}onAdd(h){return this._map=h,this._container=E.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=E.create("button","maplibregl-ctrl-globe",this._container),E.create("span","maplibregl-ctrl-icon",this._globeButton).setAttribute("aria-hidden","true"),this._globeButton.type="button",this._globeButton.addEventListener("click",this._toggleProjection),this._updateGlobeIcon(),this._map.on("styledata",this._updateGlobeIcon),this._container}onRemove(){E.remove(this._container),this._map.off("styledata",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}},x.Hash=hl,x.ImageSource=Rr,x.KeyboardHandler=Ps,x.LngLatBounds=dt,x.LogoControl=po,x.Map=class extends Nh{constructor(h){var e,r;s.cn.mark(s.co.create);const a=Object.assign(Object.assign(Object.assign({},fo),h),{canvasContextAttributes:Object.assign(Object.assign({},fo.canvasContextAttributes),h.canvasContextAttributes)});if(a.minZoom!=null&&a.maxZoom!=null&&a.minZoom>a.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(a.minPitch!=null&&a.maxPitch!=null&&a.minPitch>a.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(a.minPitch!=null&&a.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(a.maxPitch!=null&&a.maxPitch>180)throw new Error("maxPitch must be less than or equal to 180");const l=new ds,p=new Ws;if(a.minZoom!==void 0&&l.setMinZoom(a.minZoom),a.maxZoom!==void 0&&l.setMaxZoom(a.maxZoom),a.minPitch!==void 0&&l.setMinPitch(a.minPitch),a.maxPitch!==void 0&&l.setMaxPitch(a.maxPitch),a.renderWorldCopies!==void 0&&l.setRenderWorldCopies(a.renderWorldCopies),super(l,p,{bearingSnap:a.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new bl,this._controls=[],this._mapId=s.a4(),this._contextLost=w=>{w.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new s.l("webglcontextlost",{originalEvent:w}))},this._contextRestored=w=>{this._setupPainter(),this.resize(),this._update(),this.fire(new s.l("webglcontextrestored",{originalEvent:w}))},this._onMapScroll=w=>{if(w.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=a.interactive,this._maxTileCacheSize=a.maxTileCacheSize,this._maxTileCacheZoomLevels=a.maxTileCacheZoomLevels,this._canvasContextAttributes=Object.assign({},a.canvasContextAttributes),this._trackResize=a.trackResize===!0,this._bearingSnap=a.bearingSnap,this._centerClampedToGround=a.centerClampedToGround,this._refreshExpiredTiles=a.refreshExpiredTiles===!0,this._fadeDuration=a.fadeDuration,this._crossSourceCollisions=a.crossSourceCollisions===!0,this._collectResourceTiming=a.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},ct),a.locale),this._clickTolerance=a.clickTolerance,this._overridePixelRatio=a.pixelRatio,this._maxCanvasSize=a.maxCanvasSize,this.transformCameraUpdate=a.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=a.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=$.addThrottleControl(()=>this.isMoving()),this._requestManager=new de(a.transformRequest),typeof a.container=="string"){if(this._container=document.getElementById(a.container),!this._container)throw new Error(`Container '${a.container}' not found.`)}else{if(!(a.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=a.container}if(a.maxBounds&&this.setMaxBounds(a.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let w=!1;const A=lo(R=>{this._trackResize&&!this._removed&&(this.resize(R),this.redraw())},50);this._resizeObserver=new ResizeObserver(R=>{w?A(R):w=!0}),this._resizeObserver.observe(this._container)}this.handlers=new Oh(this,a),this._hash=a.hash&&new hl(typeof a.hash=="string"&&a.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:a.center,elevation:a.elevation,zoom:a.zoom,bearing:a.bearing,pitch:a.pitch,roll:a.roll}),a.bounds&&(this.resize(),this.fitBounds(a.bounds,s.e({},a.fitBoundsOptions,{duration:0}))));const y=typeof a.style=="string"||((r=(e=a.style)===null||e===void 0?void 0:e.projection)===null||r===void 0?void 0:r.type)!=="globe";this.resize(null,y),this._localIdeographFontFamily=a.localIdeographFontFamily,this._validateStyle=a.validateStyle,a.style&&this.setStyle(a.style,{localIdeographFontFamily:a.localIdeographFontFamily}),a.attributionControl&&this.addControl(new lr(typeof a.attributionControl=="boolean"?void 0:a.attributionControl)),a.maplibreLogo&&this.addControl(new po,a.logoPosition),this.on("style.load",()=>{if(y||this._resizeTransform(),this.transform.unmodified){const w=s.O(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(w)}}),this.on("data",w=>{this._update(w.dataType==="style"),this.fire(new s.l(`${w.dataType}data`,w))}),this.on("dataloading",w=>{this.fire(new s.l(`${w.dataType}dataloading`,w))}),this.on("dataabort",w=>{this.fire(new s.l("sourcedataabort",w))})}_getMapId(){return this._mapId}addControl(h,e){if(e===void 0&&(e=h.getDefaultPosition?h.getDefaultPosition():"top-right"),!h||!h.onAdd)return this.fire(new s.k(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const r=h.onAdd(this);this._controls.push(h);const a=this._controlPositions[e];return e.indexOf("bottom")!==-1?a.insertBefore(r,a.firstChild):a.appendChild(r),this}removeControl(h){if(!h||!h.onRemove)return this.fire(new s.k(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const e=this._controls.indexOf(h);return e>-1&&this._controls.splice(e,1),h.onRemove(this),this}hasControl(h){return this._controls.indexOf(h)>-1}calculateCameraOptionsFromTo(h,e,r,a){return a==null&&this.terrain&&(a=this.terrain.getElevationForLngLatZoom(r,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(h,e,r,a)}resize(h,e=!0){const[r,a]=this._containerDimensions(),l=this._getClampedPixelRatio(r,a);if(this._resizeCanvas(r,a,l),this.painter.resize(r,a,l),this.painter.overLimit()){const y=this.painter.context.gl;this._maxCanvasSize=[y.drawingBufferWidth,y.drawingBufferHeight];const w=this._getClampedPixelRatio(r,a);this._resizeCanvas(r,a,w),this.painter.resize(r,a,w)}this._resizeTransform(e);const p=!this._moving;return p&&(this.stop(),this.fire(new s.l("movestart",h)).fire(new s.l("move",h))),this.fire(new s.l("resize",h)),p&&this.fire(new s.l("moveend",h)),this}_resizeTransform(h=!0){var e;const[r,a]=this._containerDimensions();this.transform.resize(r,a,h),(e=this._requestedCameraState)===null||e===void 0||e.resize(r,a,h)}_getClampedPixelRatio(h,e){const{0:r,1:a}=this._maxCanvasSize,l=this.getPixelRatio(),p=h*l,y=e*l;return Math.min(p>r?r/p:1,y>a?a/y:1)*l}getPixelRatio(){var h;return(h=this._overridePixelRatio)!==null&&h!==void 0?h:devicePixelRatio}setPixelRatio(h){this._overridePixelRatio=h,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(h){return this.transform.setMaxBounds(dt.convert(h)),this._update()}setMinZoom(h){if((h=h??-2)>=-2&&h<=this.transform.maxZoom)return this.transform.setMinZoom(h),this._update(),this.getZoom()<h&&this.setZoom(h),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(h){if((h=h??22)>=this.transform.minZoom)return this.transform.setMaxZoom(h),this._update(),this.getZoom()>h&&this.setZoom(h),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(h){if((h=h??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(h>=0&&h<=this.transform.maxPitch)return this.transform.setMinPitch(h),this._update(),this.getPitch()<h&&this.setPitch(h),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(h){if((h=h??60)>180)throw new Error("maxPitch must be less than or equal to 180");if(h>=this.transform.minPitch)return this.transform.setMaxPitch(h),this._update(),this.getPitch()>h&&this.setPitch(h),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(h){return this.transform.setRenderWorldCopies(h),this._update()}project(h){return this.transform.locationToScreenPoint(s.Q.convert(h),this.style&&this.terrain)}unproject(h){return this.transform.screenPointToLocation(s.P.convert(h),this.terrain)}isMoving(){var h;return this._moving||((h=this.handlers)===null||h===void 0?void 0:h.isMoving())}isZooming(){var h;return this._zooming||((h=this.handlers)===null||h===void 0?void 0:h.isZooming())}isRotating(){var h;return this._rotating||((h=this.handlers)===null||h===void 0?void 0:h.isRotating())}_createDelegatedListener(h,e,r){if(h==="mouseenter"||h==="mouseover"){let a=!1;return{layers:e,listener:r,delegates:{mousemove:p=>{const y=e.filter(A=>this.getLayer(A)),w=y.length!==0?this.queryRenderedFeatures(p.point,{layers:y}):[];w.length?a||(a=!0,r.call(this,new Ur(h,this,p.originalEvent,{features:w}))):a=!1},mouseout:()=>{a=!1}}}}if(h==="mouseleave"||h==="mouseout"){let a=!1;return{layers:e,listener:r,delegates:{mousemove:y=>{const w=e.filter(A=>this.getLayer(A));(w.length!==0?this.queryRenderedFeatures(y.point,{layers:w}):[]).length?a=!0:a&&(a=!1,r.call(this,new Ur(h,this,y.originalEvent)))},mouseout:y=>{a&&(a=!1,r.call(this,new Ur(h,this,y.originalEvent)))}}}}{const a=l=>{const p=e.filter(w=>this.getLayer(w)),y=p.length!==0?this.queryRenderedFeatures(l.point,{layers:p}):[];y.length&&(l.features=y,r.call(this,l),delete l.features)};return{layers:e,listener:r,delegates:{[h]:a}}}}_saveDelegatedListener(h,e){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[h]=this._delegatedListeners[h]||[],this._delegatedListeners[h].push(e)}_removeDelegatedListener(h,e,r){if(!this._delegatedListeners||!this._delegatedListeners[h])return;const a=this._delegatedListeners[h];for(let l=0;l<a.length;l++){const p=a[l];if(p.listener===r&&p.layers.length===e.length&&p.layers.every(y=>e.includes(y))){for(const y in p.delegates)this.off(y,p.delegates[y]);return void a.splice(l,1)}}}on(h,e,r){if(r===void 0)return super.on(h,e);const a=typeof e=="string"?[e]:e,l=this._createDelegatedListener(h,a,r);this._saveDelegatedListener(h,l);for(const p in l.delegates)this.on(p,l.delegates[p]);return{unsubscribe:()=>{this._removeDelegatedListener(h,a,r)}}}once(h,e,r){if(r===void 0)return super.once(h,e);const a=typeof e=="string"?[e]:e,l=this._createDelegatedListener(h,a,r);for(const p in l.delegates){const y=l.delegates[p];l.delegates[p]=(...w)=>{this._removeDelegatedListener(h,a,r),y(...w)}}this._saveDelegatedListener(h,l);for(const p in l.delegates)this.once(p,l.delegates[p]);return this}off(h,e,r){return r===void 0?super.off(h,e):(this._removeDelegatedListener(h,typeof e=="string"?[e]:e,r),this)}queryRenderedFeatures(h,e){if(!this.style)return[];let r;const a=h instanceof s.P||Array.isArray(h),l=a?h:[[0,0],[this.transform.width,this.transform.height]];if(e=e||(a?{}:h)||{},l instanceof s.P||typeof l[0]=="number")r=[s.P.convert(l)];else{const p=s.P.convert(l[0]),y=s.P.convert(l[1]);r=[p,new s.P(y.x,p.y),y,new s.P(p.x,y.y),p]}return this.style.queryRenderedFeatures(r,e,this.transform)}querySourceFeatures(h,e){return this.style.querySourceFeatures(h,e)}setStyle(h,e){return(e=s.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},e)).diff!==!1&&e.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&h?(this._diffStyle(h,e),this):(this._localIdeographFontFamily=e.localIdeographFontFamily,this._updateStyle(h,e))}setTransformRequest(h){return this._requestManager.setTransformRequest(h),this}_getUIString(h){const e=this._locale[h];if(e==null)throw new Error(`Missing UI string '${h}'`);return e}_updateStyle(h,e){var r,a;if(e.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(h,e));const l=this.style&&e.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!h)),h?(this.style=new Ka(this,e||{}),this.style.setEventedParent(this,{style:this.style}),typeof h=="string"?this.style.loadURL(h,e,l):this.style.loadJSON(h,e,l),this):((a=(r=this.style)===null||r===void 0?void 0:r.projection)===null||a===void 0||a.destroy(),delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Ka(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(h,e){if(typeof h=="string"){const r=this._requestManager.transformRequest(h,"Style");s.j(r,new AbortController).then(a=>{this._updateDiff(a.data,e)}).catch(a=>{a&&this.fire(new s.k(a))})}else typeof h=="object"&&this._updateDiff(h,e)}_updateDiff(h,e){try{this.style.setState(h,e)&&this._update(!0)}catch(r){s.w(`Unable to perform style diff: ${r.message||r.error||r}. Rebuilding the style from scratch.`),this._updateStyle(h,e)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():s.w("There is no style added to the map.")}addSource(h,e){return this._lazyInitEmptyStyle(),this.style.addSource(h,e),this._update(!0)}isSourceLoaded(h){const e=this.style&&this.style.sourceCaches[h];if(e!==void 0)return e.loaded();this.fire(new s.k(new Error(`There is no source with ID '${h}'`)))}setTerrain(h){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),h){const e=this.style.sourceCaches[h.source];if(!e)throw new Error(`cannot load terrain, because there exists no source with ID: ${h.source}`);this.terrain===null&&e.reload();for(const r in this.style._layers){const a=this.style._layers[r];a.type==="hillshade"&&a.source===h.source&&s.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Qc(this.painter,e,h),this.painter.renderToTexture=new ga(this.painter,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._terrainDataCallback=r=>{var a;r.dataType==="style"?this.terrain.sourceCache.freeRtt():r.dataType==="source"&&r.tile&&(r.sourceId!==h.source||this._elevationFreeze||(this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))),((a=r.source)===null||a===void 0?void 0:a.type)==="image"?this.terrain.sourceCache.freeRtt():this.terrain.sourceCache.freeRtt(r.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0);return this.fire(new s.l("terrain",{terrain:h})),this}getTerrain(){var h,e;return(e=(h=this.terrain)===null||h===void 0?void 0:h.options)!==null&&e!==void 0?e:null}areTilesLoaded(){const h=this.style&&this.style.sourceCaches;for(const e in h){const r=h[e]._tiles;for(const a in r){const l=r[a];if(l.state!=="loaded"&&l.state!=="errored")return!1}}return!0}removeSource(h){return this.style.removeSource(h),this._update(!0)}getSource(h){return this.style.getSource(h)}setSourceTileLodParams(h,e,r){if(r){const a=this.getSource(r);if(!a)throw new Error(`There is no source with ID "${r}", cannot set LOD parameters`);a.calculateTileZoom=_e(Math.max(1,h),Math.max(1,e))}else for(const a in this.style.sourceCaches)this.style.sourceCaches[a].getSource().calculateTileZoom=_e(Math.max(1,h),Math.max(1,e));return this._update(!0),this}refreshTiles(h,e){const r=this.style.sourceCaches[h];if(!r)throw new Error(`There is no source cache with ID "${h}", cannot refresh tile`);e===void 0?r.reload():r.refreshTiles(e.map(a=>new s.a1(a.z,a.x,a.y)))}addImage(h,e,r={}){const{pixelRatio:a=1,sdf:l=!1,stretchX:p,stretchY:y,content:w,textFitWidth:A,textFitHeight:R}=r;if(this._lazyInitEmptyStyle(),!(e instanceof HTMLImageElement||s.b(e))){if(e.width===void 0||e.height===void 0)return this.fire(new s.k(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:D,height:N,data:O}=e,Z=e;return this.style.addImage(h,{data:new s.R({width:D,height:N},new Uint8Array(O)),pixelRatio:a,stretchX:p,stretchY:y,content:w,textFitWidth:A,textFitHeight:R,sdf:l,version:0,userImage:Z}),Z.onAdd&&Z.onAdd(this,h),this}}{const{width:D,height:N,data:O}=M.getImageData(e);this.style.addImage(h,{data:new s.R({width:D,height:N},O),pixelRatio:a,stretchX:p,stretchY:y,content:w,textFitWidth:A,textFitHeight:R,sdf:l,version:0})}}updateImage(h,e){const r=this.style.getImage(h);if(!r)return this.fire(new s.k(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const a=e instanceof HTMLImageElement||s.b(e)?M.getImageData(e):e,{width:l,height:p,data:y}=a;if(l===void 0||p===void 0)return this.fire(new s.k(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(l!==r.data.width||p!==r.data.height)return this.fire(new s.k(new Error("The width and height of the updated image must be that same as the previous version of the image")));const w=!(e instanceof HTMLImageElement||s.b(e));return r.data.replace(y,w),this.style.updateImage(h,r),this}getImage(h){return this.style.getImage(h)}hasImage(h){return h?!!this.style.getImage(h):(this.fire(new s.k(new Error("Missing required image id"))),!1)}removeImage(h){this.style.removeImage(h)}loadImage(h){return $.getImage(this._requestManager.transformRequest(h,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(h,e){return this._lazyInitEmptyStyle(),this.style.addLayer(h,e),this._update(!0)}moveLayer(h,e){return this.style.moveLayer(h,e),this._update(!0)}removeLayer(h){return this.style.removeLayer(h),this._update(!0)}getLayer(h){return this.style.getLayer(h)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(h,e,r){return this.style.setLayerZoomRange(h,e,r),this._update(!0)}setFilter(h,e,r={}){return this.style.setFilter(h,e,r),this._update(!0)}getFilter(h){return this.style.getFilter(h)}setPaintProperty(h,e,r,a={}){return this.style.setPaintProperty(h,e,r,a),this._update(!0)}getPaintProperty(h,e){return this.style.getPaintProperty(h,e)}setLayoutProperty(h,e,r,a={}){return this.style.setLayoutProperty(h,e,r,a),this._update(!0)}getLayoutProperty(h,e){return this.style.getLayoutProperty(h,e)}setGlyphs(h,e={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(h,e),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(h,e,r={}){return this._lazyInitEmptyStyle(),this.style.addSprite(h,e,r,a=>{a||this._update(!0)}),this}removeSprite(h){return this._lazyInitEmptyStyle(),this.style.removeSprite(h),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(h,e={}){return this._lazyInitEmptyStyle(),this.style.setSprite(h,e,r=>{r||this._update(!0)}),this}setLight(h,e={}){return this._lazyInitEmptyStyle(),this.style.setLight(h,e),this._update(!0)}getLight(){return this.style.getLight()}setSky(h,e={}){return this._lazyInitEmptyStyle(),this.style.setSky(h,e),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(h,e){return this.style.setFeatureState(h,e),this._update()}removeFeatureState(h,e){return this.style.removeFeatureState(h,e),this._update()}getFeatureState(h){return this.style.getFeatureState(h)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let h=0,e=0;return this._container&&(h=this._container.clientWidth||400,e=this._container.clientHeight||300),[h,e]}_setupContainer(){const h=this._container;h.classList.add("maplibregl-map");const e=this._canvasContainer=E.create("div","maplibregl-canvas-container",h);this._interactive&&e.classList.add("maplibregl-interactive"),this._canvas=E.create("canvas","maplibregl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const r=this._containerDimensions(),a=this._getClampedPixelRatio(r[0],r[1]);this._resizeCanvas(r[0],r[1],a);const l=this._controlContainer=E.create("div","maplibregl-control-container",h),p=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(y=>{p[y]=E.create("div",`maplibregl-ctrl-${y} `,l)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(h,e,r){this._canvas.width=Math.floor(r*h),this._canvas.height=Math.floor(r*e),this._canvas.style.width=`${h}px`,this._canvas.style.height=`${e}px`}_setupPainter(){const h=Object.assign(Object.assign({},this._canvasContextAttributes),{alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0});let e=null;this._canvas.addEventListener("webglcontextcreationerror",a=>{e={requestedAttributes:h},a&&(e.statusMessage=a.statusMessage,e.type=a.type)},{once:!0});let r=null;if(r=this._canvasContextAttributes.contextType?this._canvas.getContext(this._canvasContextAttributes.contextType,h):this._canvas.getContext("webgl2",h)||this._canvas.getContext("webgl",h),!r){const a="Failed to initialize WebGL";throw e?(e.message=a,new Error(JSON.stringify(e))):new Error(a)}this.painter=new ul(r,this.transform),C.testSupport(r)}migrateProjection(h,e){super.migrateProjection(h,e),this.painter.transform=h,this.fire(new s.l("projectiontransition",{newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(h){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||h,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(h){return this._update(),this._renderTaskQueue.add(h)}_cancelRenderFrame(h){this._renderTaskQueue.remove(h)}_render(h){var e,r,a,l,p;const y=this._idleTriggered?this._fadeDuration:0,w=((e=this.style.projection)===null||e===void 0?void 0:e.transitionState)>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(h),this._removed)return;let A=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const N=this.transform.zoom,O=M.now();this.style.zoomHistory.update(N,O);const Z=new s.C(N,{now:O,fadeDuration:y,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),K=Z.crossFadingFactor();K===1&&K===this._crossFadingFactor||(A=!0,this._crossFadingFactor=K),this.style.update(Z)}const R=((r=this.style.projection)===null||r===void 0?void 0:r.transitionState)>0!==w;(a=this.style.projection)===null||a===void 0||a.setErrorQueryLatitudeDegrees(this.transform.center.lat),this.transform.setTransitionState((l=this.style.projection)===null||l===void 0?void 0:l.transitionState,(p=this.style.projection)===null||p===void 0?void 0:p.latitudeErrorCorrectionRadians),this.style&&(this._sourcesDirty||R)&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),!this._elevationFreeze&&this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0)),this._placementDirty=this.style&&this.style._updatePlacement(this.transform,this.showCollisionBoxes,y,this._crossSourceCollisions,R),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:y,showPadding:this.showPadding}),this.fire(new s.l("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,s.cn.mark(s.co.load),this.fire(new s.l("load"))),this.style&&(this.style.hasTransitions()||A)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const D=this._sourcesDirty||this._styleDirty||this._placementDirty;return D||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new s.l("idle")),!this._loaded||this._fullyLoaded||D||(this._fullyLoaded=!0,s.cn.mark(s.co.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var h;this._hash&&this._hash.remove();for(const r of this._controls)r.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),$.removeThrottleControl(this._imageQueueHandle),(h=this._resizeObserver)===null||h===void 0||h.disconnect();const e=this.painter.context.gl.getExtension("WEBGL_lose_context");e!=null&&e.loseContext&&e.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),E.remove(this._canvasContainer),E.remove(this._controlContainer),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map"),s.cn.clearMetrics(),this._removed=!0,this.fire(new s.l("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,M.frame(this._frameRequest,h=>{s.cn.frame(h),this._frameRequest=null;try{this._render(h)}catch(e){if(!s.cp(e)&&!function(r){return r.message===Yo}(e))throw e}},()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(h){this._showTileBoundaries!==h&&(this._showTileBoundaries=h,this._update())}get showPadding(){return!!this._showPadding}set showPadding(h){this._showPadding!==h&&(this._showPadding=h,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(h){this._showCollisionBoxes!==h&&(this._showCollisionBoxes=h,h?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(h){this._showOverdrawInspector!==h&&(this._showOverdrawInspector=h,this._update())}get repaint(){return!!this._repaint}set repaint(h){this._repaint!==h&&(this._repaint=h,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(h){this._vertices=h,this._update()}get version(){return yt}getCameraTargetElevation(){return this.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(h){return this._lazyInitEmptyStyle(),this.style.setProjection(h),this._update(!0)}},x.MapMouseEvent=Ur,x.MapTouchEvent=Ss,x.MapWheelEvent=fl,x.Marker=Yn,x.NavigationControl=class{constructor(h){this._updateZoomButtons=()=>{const e=this._map.getZoom(),r=e===this._map.getMaxZoom(),a=e===this._map.getMinZoom();this._zoomInButton.disabled=r,this._zoomOutButton.disabled=a,this._zoomInButton.setAttribute("aria-disabled",r.toString()),this._zoomOutButton.setAttribute("aria-disabled",a.toString())},this._rotateCompassArrow=()=>{this._compassIcon.style.transform=this.options.visualizePitch&&this.options.visualizeRoll?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateZ(${-this._map.transform.roll}deg) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizeRoll?`rotate(${-this._map.transform.bearing-this._map.transform.roll}deg)`:`rotate(${-this._map.transform.bearing}deg)`},this._setButtonTitle=(e,r)=>{const a=this._map._getUIString(`NavigationControl.${r}`);e.title=a,e.setAttribute("aria-label",a)},this.options=s.e({},wl,h),this._container=E.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",e=>e.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",e=>this._map.zoomIn({},{originalEvent:e})),E.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",e=>this._map.zoomOut({},{originalEvent:e})),E.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",e=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})}),this._compassIcon=E.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(h){return this._map=h,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.on("roll",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Sl(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){E.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.off("roll",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(h,e){const r=E.create("button",h,this._container);return r.type="button",r.addEventListener("click",e),r}},x.Popup=class extends s.E{constructor(h){super(),this._updateOpacity=()=>{this.options.locationOccludedOpacity!==void 0&&(this._container.style.opacity=this._map.transform.isLocationOccluded(this.getLngLat())?`${this.options.locationOccludedOpacity}`:void 0)},this.remove=()=>(this._content&&E.remove(this._content),this._container&&(E.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new s.l("close"))),this),this._onMouseUp=e=>{this._update(e.point)},this._onMouseMove=e=>{this._update(e.point)},this._onDrag=e=>{this._update(e.point)},this._update=e=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=E.create("div","maplibregl-popup",this._map.getContainer()),this._tip=E.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const y of this.options.className.split(" "))this._container.classList.add(y);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=kl(this._lngLat,this._flatPos,this._map.transform,this._trackPointer),this._trackPointer&&!e)return;const r=this._flatPos=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&e?e:this._map.transform.locationToScreenPoint(this._lngLat));let a=this.options.anchor;const l=Ms(this.options.offset);if(!a){const y=this._container.offsetWidth,w=this._container.offsetHeight;let A;A=r.y+l.bottom.y<w?["top"]:r.y>this._map.transform.height-w?["bottom"]:[],r.x<y/2?A.push("left"):r.x>this._map.transform.width-y/2&&A.push("right"),a=A.length===0?"bottom":A.join("-")}let p=r.add(l[a]);this.options.subpixelPositioning||(p=p.round()),E.setTransform(this._container,`${qi[a]} translate(${p.x}px,${p.y}px)`),Yc(this._container,a,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=s.e(Object.create(Al),h)}addTo(h){return this._map&&this.remove(),this._map=h,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new s.l("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(h){return this._lngLat=s.Q.convert(h),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(h){return this.setDOMContent(document.createTextNode(h))}setHTML(h){const e=document.createDocumentFragment(),r=document.createElement("body");let a;for(r.innerHTML=h;a=r.firstChild,a;)e.appendChild(a);return this.setDOMContent(e)}getMaxWidth(){var h;return(h=this._container)===null||h===void 0?void 0:h.style.maxWidth}setMaxWidth(h){return this.options.maxWidth=h,this._update(),this}setDOMContent(h){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=E.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(h),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(h){return this._container&&this._container.classList.add(h),this}removeClassName(h){return this._container&&this._container.classList.remove(h),this}setOffset(h){return this.options.offset=h,this._update(),this}toggleClassName(h){if(this._container)return this._container.classList.toggle(h)}setSubpixelPositioning(h){this.options.subpixelPositioning=h}_createCloseButton(){this.options.closeButton&&(this._closeButton=E.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const h=this._container.querySelector(Cl);h&&h.focus()}},x.RasterDEMTileSource=Fi,x.RasterTileSource=Yt,x.ScaleControl=class{constructor(h){this._onMove=()=>{go(this._map,this._container,this.options)},this.setUnit=e=>{this.options.unit=e,go(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},mo),h)}getDefaultPosition(){return"bottom-left"}onAdd(h){return this._map=h,this._container=E.create("div","maplibregl-ctrl maplibregl-ctrl-scale",h.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){E.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},x.ScrollZoomHandler=Bt,x.Style=Ka,x.TerrainControl=class{constructor(h){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=h}onAdd(h){return this._map=h,this._container=E.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=E.create("button","maplibregl-ctrl-terrain",this._container),E.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){E.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},x.TwoFingersTouchPitchHandler=pa,x.TwoFingersTouchRotateHandler=nt,x.TwoFingersTouchZoomHandler=Es,x.TwoFingersTouchZoomRotateHandler=xl,x.VectorTileSource=bi,x.VideoSource=ai,x.addSourceType=(h,e)=>s._(void 0,void 0,void 0,function*(){if(bt(h))throw new Error(`A source type called "${h}" already exists.`);((r,a)=>{Xt[r]=a})(h,e)}),x.clearPrewarmedResources=function(){const h=Pi;h&&(h.isPreloaded()&&h.numActive()===1?(h.release(kn),Pi=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},x.createTileMesh=Hs,x.getMaxParallelImageRequests=function(){return s.a.MAX_PARALLEL_IMAGE_REQUESTS},x.getRTLTextPluginStatus=function(){return zt().getRTLTextPluginStatus()},x.getVersion=function(){return Tl},x.getWorkerCount=function(){return Kr.workerCount},x.getWorkerUrl=function(){return s.a.WORKER_URL},x.importScriptInWorkers=function(h){return ut().broadcast("IS",h)},x.prewarm=function(){et().acquire(kn)},x.setMaxParallelImageRequests=function(h){s.a.MAX_PARALLEL_IMAGE_REQUESTS=h},x.setRTLTextPlugin=function(h,e){return zt().setRTLTextPlugin(h,e)},x.setWorkerCount=function(h){Kr.workerCount=h},x.setWorkerUrl=function(h){s.a.WORKER_URL=h}});var T=_;return T})}(Yu)),Yu.exports}var mx=fx();const ed=Xg(mx),Gt=(u,f)=>{const _=u.__vccOpts||u;for(const[b,k]of f)_[b]=k;return _},gx={key:0,class:"p-5 pb-0 flex justify-between items-center"},yx={class:"inline-block font-semibold text-lg text-gray-800"},_x={class:"flex flex-col gap-1 p-5"},vx={class:"flex items-center justify-between w-full text-sm text-gray-800"},xx={key:0,class:"ms-2 text-xs text-gray-500"},bx={__name:"vs-legend-widget",props:{config:{type:Object,required:!0}},setup(u){const f=u,_=g.computed(()=>{var k;return((k=f.config)==null?void 0:k.items)||[]}),b=g.computed(()=>{var k;return((k=f.config)==null?void 0:k.title)||""});return(k,T)=>(g.openBlock(),g.createElementBlock("div",{class:"legend-widget flex flex-col bg-white border border-stone-200 shadow-2xs rounded-xl z-10 relative",style:g.normalizeStyle({width:u.config.width||"100%"})},[b.value?(g.openBlock(),g.createElementBlock("div",gx,[g.createElementVNode("h2",yx,g.toDisplayString(b.value),1)])):g.createCommentVNode("",!0),g.createElementVNode("div",_x,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(_.value,x=>(g.openBlock(),g.createElementBlock("div",{class:"flex items-center",key:x.label},[g.createElementVNode("span",{class:g.normalizeClass(["shrink-0 size-2.5 inline-block me-2.5",[x.shape==="square"?"rounded-sm":"",x.shape==="circle"?"rounded-full":"",x.shape==="line"?"w-6 h-0.5":"",x.shape==="dashed-line"?"w-6 h-0.5 dashed-line":""]]),style:g.normalizeStyle({backgroundColor:x.color})},null,6),g.createElementVNode("span",vx,[g.createElementVNode("span",null,g.toDisplayString(x.label),1),x.count!==void 0?(g.openBlock(),g.createElementBlock("span",xx," ("+g.toDisplayString(x.count)+") ",1)):g.createCommentVNode("",!0)])]))),128))])],4))}},wx=Gt(bx,[["__scopeId","data-v-c521b2f4"]]),Sx="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmA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C03qc9jWkgSgMGAFHqssGmgWlpwABgWu/TnsY0EKUBA4Aoddlg08C0NPBnAT+diH1RP1wAAAAASUVORK5CYII=",kx={class:"flex flex-row gap-x-3 z-10 relative"},Ax=["onClick"],Cx=["src","alt"],Tx={__name:"vs-basemaps-widget",props:{map:{type:Object,required:!0},config:{type:Object,default:()=>({})},position:{type:String,default:"bottom-left"}},setup(u){const f=u,_=g.ref("voyager"),b=g.computed(()=>{var V;if(!((V=f.config)!=null&&V.layers))return[];const s=f.config.layers.map(P=>({id:P.id,title:P.label||P.title,url:P.url,service:P.type,category:"Базові карти",attribution:P.attribution,image:P.image,enabled:!0,owner:P.owner||"Unknown"}));return s.push({id:"__none__",title:"Без підложки",url:"",service:"",category:"Базові карти",attribution:"",image:Sx,enabled:!0,owner:""}),s});function k(s){return{version:8,sources:{[s.id]:{type:"raster",tiles:[s.url],tileSize:256,attribution:s.attribution||""}},layers:[{id:s.id,type:"raster",source:s.id}]}}const T=s=>{if(!f.map)return;const V=f.map.getStyle(),P=b.value.map(E=>E.id),L=V.layers.filter(E=>!P.includes(E.id)),F={};for(const E in V.sources)P.includes(E)||(F[E]=V.sources[E]);if(s.id==="__none__"){const E={version:8,sources:{...F},layers:[...L]};f.map.setStyle(E);return}const M=k(s);f.map.setStyle(M),f.map.once("styledata",()=>{for(const[E,C]of Object.entries(F))f.map.getSource(E)||f.map.addSource(E,C);for(const E of L)f.map.getLayer(E.id)||f.map.addLayer(E)})},x=s=>{_.value=s;const V=b.value.find(P=>P.id===s);V&&f.map&&T(V)};return g.onMounted(()=>{var s;(s=f.config)!=null&&s.default&&(_.value=f.config.default),x(_.value)}),(s,V)=>{const P=g.resolveComponent("VsPopover");return g.openBlock(),g.createElementBlock("div",kx,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(b.value,L=>(g.openBlock(),g.createBlock(P,{trigger:"hover",placement:"top",key:L.id},{reference:g.withCtx(()=>[g.createElementVNode("div",{class:g.normalizeClass(["w-14 h-14 flex items-center justify-center bg-white rounded-xl shadow-2xs cursor-pointer transition-all border-4",_.value===L.id?"border-blue-400":"border-transparent"]),onClick:F=>x(L.id)},[g.createElementVNode("img",{src:L.image,alt:L.title,class:g.normalizeClass(["object-cover rounded-lg",L.id==="__none__"?"w-10 h-10":"w-12 h-12"])},null,10,Cx)],10,Ax)]),default:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(L.title)+" ",1)]),_:2},1024))),128))])}}};function Da(u){if(!u.attrType||!u.attribute||!u.rules)return u.color||"#ccc";const f=u.rules.map(_=>[["==",["get",u.attribute],_.id||_.value],_.color]);return f.push(u.color||"#ccc"),["case",...f.flat()]}function Ex(u){if(!u.attrType||u.attrType!=="icon-by-attribute"||!u.attribute||!u.rules)return u.default_icon||null;const f=u.rules.map(_=>[["==",["get",u.attribute],_.value],_.icon]);return f.push(u.default_icon||"marker.svg"),["case",...f.flat()]}function Yg(u){if(!u.attrType||u.attrType!=="attribute-pattern"||!u.attribute||!u.rules)return u.fillPattern||"";const f=u.rules.map(_=>[["==",["get",u.attribute],_.value],_.fillPattern||""]);return f.push(u.fillPattern||""),["case",...f.flat()]}function os(u,f="stroke",_="#ccc"){return["case",["boolean",["feature-state","hovered"],!1],"#ff0000",["boolean",["feature-state","selected"],!1],"#ff0000",u[f]||_]}function Px(u){const f=[{type:"fill",minzoom:u.pointZoom||0,paint:{"fill-color":Da(u),"fill-outline-color":os(u,"stroke","#ccc"),"fill-opacity":u.opacity||1,...u.attrType==="attribute-pattern"&&{"fill-pattern":Yg(u)},...u.fillPattern&&!u.attrType&&{"fill-pattern":u.fillPattern}}},{type:"line",paint:{"line-color":os(u,"stroke","#ccc"),"line-width":u.width||2,"line-opacity":u.lineOpacity||u.opacity||1}}];return u.pointZoom&&f.push({type:"circle",maxzoom:u.pointZoom,paint:{"circle-color":u.color||"#ccc","circle-stroke-color":os(u,"stroke","#ccc"),"circle-stroke-width":u.width||2,"circle-opacity":u.opacity||1}}),f}function Ix(u){return[{type:"line",paint:{"line-color":os(u,"color",Da(u)),"line-width":u.width||2,"line-opacity":u.opacity||1,...u.dashArray&&{"line-dasharray":u.dashArray}},layout:{...u.lineCap&&{"line-cap":u.lineCap},...u.lineJoin&&{"line-join":u.lineJoin}}}]}function Mx(u){const f=[{type:"circle",maxzoom:u.icon&&+u.iconZoom||22,paint:{"circle-radius":u.radius||6,"circle-stroke-color":os(u,"stroke","#ccc"),"circle-stroke-width":u.width||2,"circle-color":Da(u),"circle-opacity":u.opacity||1}}];return u!=null&&u.clusterZoom?(f.push({type:"circle",filter:["has","point_count"],paint:{"circle-color":["step",["get","point_count"],"#51bbd6",100,"#f1f075",750,"#f28cb1"],"circle-radius":["step",["get","point_count"],20,100,30,750,40]}}),f.push({type:"symbol",filter:["has","point_count"],layout:{"text-field":["get","point_count"],"text-font":["Open Sans Regular"],"text-size":12}})):u.icon&&f.push({type:"symbol",minzoom:+u.iconZoom||16,layout:{"icon-image":u.icon,"icon-allow-overlap":!0}}),f}function Lx(u,f,_){const b=u.type||"point";return b==="polygon"?[{type:"fill",..._!==void 0?{maxzoom:_}:{},paint:{"fill-color":Da(u),"fill-outline-color":os(u,"stroke","#ccc"),"fill-opacity":u.opacity||1,...u.attrType==="attribute-pattern"&&{"fill-pattern":Yg(u)},...u.fillPattern&&!u.attrType&&{"fill-pattern":u.fillPattern}}},{type:"line",..._!==void 0?{maxzoom:_}:{},paint:{"line-color":os(u,"stroke","#ccc"),"line-width":u.width||2,"line-opacity":u.lineOpacity||u.opacity||1}}]:b==="line"?[{type:"line",..._!==void 0?{maxzoom:_}:{},paint:{"line-color":os(u,"color",Da(u)),"line-width":u.width||2,"line-opacity":u.opacity||1,...u.dashArray&&{"line-dasharray":u.dashArray}},layout:{...u.lineCap&&{"line-cap":u.lineCap},...u.lineJoin&&{"line-join":u.lineJoin}}}]:[{type:"circle",..._!==void 0?{maxzoom:_}:{},paint:{"circle-radius":u.radius||6,"circle-stroke-color":os(u,"stroke","#ccc"),"circle-stroke-width":u.width||2,"circle-color":Da(u),"circle-opacity":u.opacity||1}}]}function $g(u){var _,b;if(!u)return null;if(u.attrType==="icon-by-attribute"&&u.iconZoom){const k=Ex(u),T=Array.isArray(k)&&k[0]==="case"?k:["case",["==",["get",u.attribute],((b=(_=u.rules)==null?void 0:_[0])==null?void 0:b.value)||""],k,k],x=Lx(u,void 0,+u.iconZoom),s={type:"symbol",minzoom:+u.iconZoom,layout:{"icon-image":T,"icon-size":(u==null?void 0:u.icon_size)||1,"icon-allow-overlap":!0,"icon-anchor":(u==null?void 0:u.icon_anchor)||"bottom"},paint:{"icon-opacity":u.opacity||1}};return[...x,s]}const f=u.type||"point";return f==="polygon"?Px(u):f==="line"?Ix(u):Mx(u)}function Rx(u){return u.startsWith("http")?u:`${window.location.origin}${u}`}function Bx(u){const{id:f,sourceLayer:_,url:b,bounds:k,title:T,style:x,service:s,service_type:V,source_type:P,data:L}=u,F=Rx(b),M=V||s||P||"vector";switch(M){case"vtile":case"vector":return Vx(f,_,F,k,T,x);case"raster":return zx(f,F,k,T,x);case"geojson":return Fx(f,L||F,k,T,x);default:throw new Error(`Unsupported layer service type: ${M}`)}}function Dx(u){switch(u){case"polygon":return{type:"polygon",color:"#3388ff",opacity:.5};case"line":return{type:"line",color:"#3388ff",opacity:1};case"point":default:return{type:"point",color:"#3388ff",radius:6,opacity:1}}}function Vx(u,f,_,b,k,T){const x=f||(_.match(/\/vtile\/([^/]+)/)||[])[1]||u,s={type:"vector",tiles:[_],...b&&{bounds:b}},L=$g(T||{}).map((F,M)=>({...F,id:`${u}-${M}`,"source-layer":x,source:u}));return{id:u,title:k,source:s,layers:L,visible:!0}}function zx(u,f,_,b,k){const T={type:"raster",tiles:[f],tileSize:256,..._&&{bounds:_}},x=k||{},s={id:u,type:"raster",source:u,layout:{visibility:"visible"},...x&&{paint:x}};return{id:u,title:b,source:T,layers:[s],visible:!0}}function Fx(u,f,_,b,k){var L;const T={type:"geojson",data:f,..._&&{bounds:_}};let x="point";if(f&&f.features&&f.features.length>0){const F=(L=f.features[0].geometry)==null?void 0:L.type;F==="Polygon"||F==="MultiPolygon"?x="polygon":F==="LineString"||F==="MultiLineString"?x="line":x="point"}const s=k||Dx(x),P=$g(s).map((F,M)=>({...F,id:`${u}-${M}`,source:u}));return{id:u,title:b,source:T,layers:P,visible:!0}}function Ox(u){if(!u||u.attrType!=="icon-by-attribute")return[];const f=new Set;return u.default_icon&&f.add(u.default_icon),Array.isArray(u.rules)&&u.rules.forEach(_=>{_.icon&&f.add(_.icon)}),Array.from(f).map(_=>({name:_,url:(u.icon_base_url||"")+_}))}function Nx(u){const f=new Set;function _(b){typeof b=="string"?f.add(b):Array.isArray(b)&&b.forEach(_)}return u&&u["icon-image"]&&_(u["icon-image"]),Array.from(f)}async function ey(u,f){const _=f.map(async({name:b,url:k})=>{const T=await u.loadImage(k);return{name:b,data:T.data}});try{const b=await Promise.all(_);for(const{name:k,data:T}of b)u.hasImage(k)||u.addImage(k,T)}catch(b){console.error("Failed to load icons:",b)}}function qx(u,f,_="/icons/"){const k=Nx(f).map(T=>({name:T,url:_+T}));return ey(u,k)}async function Po(u,f){const _=Bx(f),b=Ox(f.style);b.length>0&&await ey(u,b),f.layout&&f.layout["icon-image"]&&await qx(u,f.layout),u.getSource(_.id)||u.addSource(_.id,_.source);for(const k of _.layers)f.visible!==void 0&&(k.layout={...k.layout,visibility:f.visible?"visible":"none"}),u.getLayer(k.id)?u.setLayoutProperty(k.id,"visibility",f.visible?"visible":"none"):await u.addLayer(k);return _}function Ba(u,f){u.getStyle().layers.filter(k=>k.source===f).forEach(k=>{u.removeLayer(k.id)}),u.getSource(f)&&u.removeSource(f)}const Ux={class:"w-full flex flex-col bg-white border border-stone-200 shadow-2xs rounded-xl z-10 relative"},jx={class:"flex flex-col justify-between h-full pb-5 px-5"},Wx={key:0,class:"relative mb-[10px]"},Hx={width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"absolute top-1/2 left-[8px] w-[16px] h-[16px]",style:{transform:"translate(0px, -50%)"}},Zx={key:1,class:"mb-4"},Kx={class:""},Gx={class:"space-y-2"},Jx={class:"flex items-center gap-[10px] text-gray-500"},Xx={class:"dataset-checkbox-container flex"},Qx=["onUpdate:modelValue","onChange"],Yx={class:"text-sm"},$x=["onClick"],eb=["innerHTML"],tb={key:0,class:"text-sm text-gray-500 text-center py-2"},rb={__name:"vs-layers-widget",props:{map:{type:Object,required:!0},history:{type:Boolean,default:!1},config:{type:Object,default:()=>({layers:[],search:!1,allow_toggle_all:!1})},position:{type:String,default:"bottom-left"},hasFilters:{type:Boolean,default:!1}},emits:["set-filter-layer","update:enabledLayerIds"],setup(u,{emit:f}){const _=u,b=f,k=g.ref(""),T=g.ref([]);function x(){const C=new URLSearchParams(window.location.search).get("layers");return C?C.split(","):[]}function s(E){const C=new URLSearchParams(window.location.search);E.length>0?C.set("layers",E.join(",")):C.delete("layers");const W=`${window.location.pathname}?${C.toString()}`;window.history.replaceState({},"",W)}g.onMounted(()=>{let E=[];_.history&&(E=x()),E.length>0?T.value=_.config.layers.map(C=>({...C,visible:E.includes(String(C.id))})):T.value=_.config.layers.map(C=>({...C,visible:C.visible??!1})),T.value.forEach(C=>{C.visible&&Po(_.map,C)}),b("update:enabledLayerIds",L())});const V=g.computed(()=>{if(!k.value)return T.value;const E=k.value.toLowerCase();return T.value.filter(C=>(C.title||C.name||C.label||"").toLowerCase().includes(E))}),P=g.computed(()=>T.value.every(E=>E.visible)),L=()=>T.value.filter(E=>E.visible).map(E=>E.id),F=E=>{E.visible?Po(_.map,E):(Ba(_.map,E.id),b("set-filter-layer",null)),_.map.getStyle().layers.filter(J=>J.source===E.id).forEach(J=>{_.map.setLayoutProperty(J.id,"visibility",E.visible?"visible":"none")}),b("update:enabledLayerIds",L())},M=()=>{const E=!P.value;T.value.forEach(C=>{C.visible=E,E?Po(_.map,C):Ba(_.map,C.id)}),E||b("set-filter-layer",null),b("update:enabledLayerIds",L())};return g.watch(()=>L(),E=>{_.history&&s(E)},{deep:!0}),(E,C)=>(g.openBlock(),g.createElementBlock("div",Ux,[C[2]||(C[2]=g.createElementVNode("div",{class:"p-5 pb-3 flex justify-between items-center"},[g.createElementVNode("h2",{class:"inline-block font-semibold text-lg text-gray-800"},"Шари")],-1)),g.createElementVNode("div",jx,[u.config.search?(g.openBlock(),g.createElementBlock("div",Wx,[g.withDirectives(g.createElementVNode("input",{type:"text","onUpdate:modelValue":C[0]||(C[0]=W=>k.value=W),placeholder:"Введіть назву шару...",class:"py-[7px] ps-8 pe-8 block w-full bg-gray-100 border-transparent rounded-lg text-sm focus:bg-white focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none"},null,512),[[g.vModelText,k.value]]),(g.openBlock(),g.createElementBlock("svg",Hx,C[1]||(C[1]=[g.createElementVNode("path",{d:"M7.33333 13.1667C10.2789 13.1667 12.6667 10.7789 12.6667 7.83333C12.6667 4.88781 10.2789 2.5 7.33333 2.5C4.38781 2.5 2 4.88781 2 7.83333C2 10.7789 4.38781 13.1667 7.33333 13.1667Z",stroke:"#6B7280","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),g.createElementVNode("path",{d:"M13.9995 14.5L11.1328 11.6333",stroke:"#6B7280","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])))])):g.createCommentVNode("",!0),u.config.allow_toggle_all?(g.openBlock(),g.createElementBlock("div",Zx,[g.createElementVNode("button",{onClick:M,class:"w-full py-[7px] bg-blue-500 text-white rounded-lg hover:bg-blue-600 transition-colors"},g.toDisplayString(P.value?"Вимкнути всі":"Увімкнути всі"),1)])):g.createCommentVNode("",!0),g.createElementVNode("div",Kx,[g.createElementVNode("ul",Gx,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(V.value,W=>(g.openBlock(),g.createElementBlock("li",{key:W.id,class:"flex flex-wrap justify-between items-center gap-x-2"},[g.createElementVNode("label",Jx,[g.createElementVNode("span",Xx,[g.withDirectives(g.createElementVNode("input",{class:"dataset-checkbox",type:"checkbox","onUpdate:modelValue":J=>W.visible=J,onChange:()=>F(W)},null,40,Qx),[[g.vModelCheckbox,W.visible]])]),g.createElementVNode("span",Yx,g.toDisplayString(W.title||W.name||W.label),1)]),W.actions&&W.visible?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(W.actions,J=>(g.openBlock(),g.createElementBlock("div",{key:J.id},[g.createElementVNode("button",{class:"text-sm text-gray-500",onClick:se=>E.$emit("show-widget",J.widget)},[g.createElementVNode("div",{innerHTML:J.icon},null,8,eb)],8,$x)]))),128)):g.createCommentVNode("",!0)]))),128)),k.value&&V.value.length===0?(g.openBlock(),g.createElementBlock("li",tb," Шарів не знайдено ")):g.createCommentVNode("",!0)])])])]))}},ib={class:"legend-widget flex flex-col bg-white border border-stone-200 shadow-2xs rounded-xl z-10 relative"},nb={key:0,class:"p-5 pb-3 flex justify-between items-start gap-[30px]"},sb={class:"inline-block font-semibold text-lg text-gray-800 dark:text-neutral-200"},ob={class:"flex flex-col gap-1"},ab={class:"flex flex-col gap-1 p-5 pt-0"},lb=["innerHTML"],cb={__name:"vs-info-widget",props:{config:{type:Object,required:!0}},setup(u){const f=u,_=g.computed(()=>{var T;return((T=f.config)==null?void 0:T.title)||""}),b=g.computed(()=>{var T;return((T=f.config)==null?void 0:T.content)||""}),k=g.computed(()=>{var T;return((T=f.config)==null?void 0:T.goTo)||[]});return(T,x)=>{var P,L;const s=g.resolveComponent("VsPopover"),V=g.resolveComponent("router-link");return g.openBlock(),g.createElementBlock("div",ib,[_.value||(P=k.value)!=null&&P.length?(g.openBlock(),g.createElementBlock("div",nb,[g.createElementVNode("h2",sb,g.toDisplayString(_.value),1),(L=k.value)!=null&&L.length?(g.openBlock(),g.createBlock(s,{key:0,placement:"bottom"},{reference:g.withCtx(()=>[g.createVNode(s,{trigger:"hover",placement:"right"},{reference:g.withCtx(()=>x[0]||(x[0]=[g.createElementVNode("div",{class:"flex items-center justify-center h-8 w-8 transition-colors rounded-full hover:bg-gray-100 cursor-pointer"},[g.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[g.createElementVNode("path",{d:"M4 12H20",stroke:"#000000","stroke-linecap":"round","stroke-linejoin":"round"}),g.createElementVNode("path",{d:"M4 6H20",stroke:"#000000","stroke-linecap":"round","stroke-linejoin":"round"}),g.createElementVNode("path",{d:"M4 18H20",stroke:"#000000","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)])),default:g.withCtx(()=>[x[1]||(x[1]=g.createTextVNode(" Перейти на карту "))]),_:1,__:[1]})]),default:g.withCtx(()=>[g.createElementVNode("div",ob,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(k.value,F=>(g.openBlock(),g.createElementBlock("div",{key:F.label},[F.url?(g.openBlock(),g.createBlock(V,{key:0,to:F.url,class:"text-sm text-gray-800 dark:text-neutral-200 hover:bg-gray-100 hover:text-blue-600 transition-colors rounded px-2 py-1 block"},{default:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(F.label),1)]),_:2},1032,["to"])):g.createCommentVNode("",!0)]))),128))])]),_:1})):g.createCommentVNode("",!0)])):g.createCommentVNode("",!0),g.createElementVNode("div",ab,[g.createElementVNode("div",{innerHTML:b.value},null,8,lb)])])}}},ub=Gt(cb,[["__scopeId","data-v-187a97ca"]]),hb={class:"w-full flex flex-col bg-white border border-stone-200 shadow-2xs rounded-xl z-10 relative overflow-hidden"},pb={key:0,class:"p-5 pb-3 flex justify-between items-center"},db={class:"inline-block font-semibold text-lg text-gray-800"},fb={key:1,class:"flex"},mb={class:"flex items-center mx-[8px]"},gb={class:"min-h-[34px] max-h-[34px] overflow-hidden min-w-[34px] flex justify-center items-center bg-stone-100 text-stone-800 py-2 px-3 text-sm rounded-lg"},yb={class:"min-h-[34px] flex justify-center items-center text-stone-500 py-2 px-1.5 text-sm"},_b={class:"flex flex-col justify-between pb-5 px-5 h-full overflow-y-auto flex-1 [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-transparent"},vb={key:0,class:"text-center"},xb={key:1,class:"text-red-500"},bb={key:2},wb=["innerHTML"],Sb={key:1,class:"flow-root"},kb={class:"-my-3 divide-y divide-gray-100 text-sm"},Ab={class:"font-medium text-gray-900"},Cb={class:"text-gray-700 sm:col-span-2"},Tb={key:2,class:"vs-map-card-info__nodata"},Eb={key:3,class:"pt-4 flex justify-end"},Pb=["href"],ty={__name:"vs-card-widget",props:{config:{type:Object,required:!0},cardValues:{type:Object,required:!0}},emits:["close","content-resize"],setup(u,{emit:f}){const _=u,b=f,k=g.computed(()=>{var se;return((se=_.config)==null?void 0:se.title)||""}),T=g.computed(()=>!!(typeof window.app=="object"&&window.app&&window.app.config)),x=g.ref([]),s=g.ref(!1),V=g.ref(null),P=g.ref(0),L=g.computed(()=>P.value+1),F=g.computed(()=>{var se;return((se=_.info)==null?void 0:se.length)||0}),M=g.computed(()=>x.value[P.value]),E=g.computed(()=>{if(!M.value)return{};const{rows:se,columns:oe}=M.value;return!se||!oe?{}:oe.reduce((Se,$)=>(!$.hide&&!["geom","geodata","id"].includes($.name)&&(Se[$.ua]=se[$.name]??"-"),Se),{})});async function C(){var se,oe,Se,$,de,Ce;s.value=!0,V.value=null;try{const Re={id:(se=_.cardValues)==null?void 0:se.id,layer:typeof((oe=_.cardValues)==null?void 0:oe.layer)=="object"?($=(Se=_.cardValues)==null?void 0:Se.layer)==null?void 0:$.id:(de=_.cardValues)==null?void 0:de.layer,map:(Ce=_.cardValues)==null?void 0:Ce.map},Ze=await kr.get("/api/map-format",{params:Re});x.value[P.value]=Ze.data}catch(Re){V.value=(Re==null?void 0:Re.message)||"Помилка запиту"}finally{s.value=!1,await g.nextTick(),b("content-resize")}}function W(){P.value<_.info.length-1&&(P.value+=1,x.value[P.value]||C())}function J(){P.value>0&&(P.value-=1,x.value[P.value]||C())}return g.onMounted(async()=>{await g.nextTick(),C()}),g.watch(()=>_.info,()=>{P.value=0,C(),b("content-resize")},{deep:!0}),g.watch([()=>_.cardValues,()=>_.config],async()=>{await g.nextTick(),C(),b("content-resize")}),(se,oe)=>{var Se,$;return g.openBlock(),g.createElementBlock("div",hb,[k.value?(g.openBlock(),g.createElementBlock("div",pb,[g.createElementVNode("h2",db,g.toDisplayString(k.value),1),g.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600 ml-2",onClick:oe[0]||(oe[0]=de=>b("close"))},oe[1]||(oe[1]=[g.createElementVNode("svg",{class:"shrink-0 size-4 cursor-pointer",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[g.createElementVNode("path",{d:"M18 6 6 18"}),g.createElementVNode("path",{d:"m6 6 12 12"})],-1)]))])):g.createCommentVNode("",!0),F.value>1?(g.openBlock(),g.createElementBlock("div",fb,[g.createElementVNode("button",{type:"button",class:g.normalizeClass([{"opacity-flex items-center justify-between border-b px-[16px] py-[8px]50 pointer-events-none":L.value===1},"min-h-[34px] min-w-[34px] py-2 px-2.5 inline-flex justify-center items-center gap-x-2 text-sm rounded-lg text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"]),onClick:J}," ◀ ",2),g.createElementVNode("div",mb,[g.createElementVNode("span",gb,g.toDisplayString(L.value),1),oe[2]||(oe[2]=g.createElementVNode("span",{class:"min-h-[34px] flex justify-center items-center text-stone-500 py-2 px-1.5 text-sm"},"з",-1)),g.createElementVNode("span",yb,g.toDisplayString(F.value),1)]),g.createElementVNode("button",{type:"button",onClick:W,class:g.normalizeClass([{"opacity-50 pointer-events-none":L.value===F.value},"min-h-[34px] min-w-[34px] py-2 px-2.5 inline-flex justify-center items-center gap-x-2 text-sm rounded-lg text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"])}," ▶ ",2)])):g.createCommentVNode("",!0),g.createElementVNode("div",_b,[s.value?(g.openBlock(),g.createElementBlock("div",vb,"Завантаження даних...")):V.value?(g.openBlock(),g.createElementBlock("div",xb," Помилка завантаження даних ")):(g.openBlock(),g.createElementBlock("div",bb,[(Se=M.value)!=null&&Se.html?(g.openBlock(),g.createElementBlock("div",{key:0,innerHTML:M.value.html,class:"custom-table-html border-b"},null,8,wb)):Object.keys(E.value).length?(g.openBlock(),g.createElementBlock("div",Sb,[g.createElementVNode("dl",kb,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(E.value,(de,Ce)=>(g.openBlock(),g.createElementBlock("div",{key:Ce,class:"grid grid-cols-1 gap-1 py-3 even:bg-gray-50 sm:grid-cols-3 sm:gap-4"},[g.createElementVNode("dt",Ab,g.toDisplayString(Ce),1),g.createElementVNode("dd",Cb,g.toDisplayString(de),1)]))),128))])])):(g.openBlock(),g.createElementBlock("div",Tb,"Даних не знайдено."))])),($=M.value)!=null&&$.cardInterface&&T.value?(g.openBlock(),g.createElementBlock("div",Eb,[g.createElementVNode("a",{href:`/card/${M.value.cardInterface}/${M.value.id}`,target:"_blank",class:"w-full !cursor-pointer text-center gap-2 px-3 py-1.5 bg-blue-600 text-white rounded hover:bg-blue-700 transition text-sm font-medium"}," Перейти в реєстр ",8,Pb)])):g.createCommentVNode("",!0)])])}}},Ib={class:"size-full flex flex-col bg-white border border-gray-200 shadow-2xs rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},Mb={key:0,class:"p-5 pb-0 items-center"},Lb={class:"inline-block font-semibold text-lg text-gray-800 dark:text-neutral-200"},Rb={class:"h-full p-5"},Bb={class:"h-full flex flex-col justify-between space-y-4"},Db={class:"space-y-4"},Vb={key:0,class:"flex gap-x-1 w-full h-2.5 rounded-full overflow-hidden"},zb=["aria-valuenow"],Fb={class:"text-sm text-gray-500 px-2 w-full py-2 cursor-pointer !flex flex-row items-center rounded-lg group hover:bg-gray-100"},Ob=["for"],Nb={key:0,width:"16",height:"auto",src:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTYgMTYnIGZpbGw9J3doaXRlJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnPjxwYXRoIGQ9J00xMi4yMDcgNC43OTNhMSAxIDAgMDEwIDEuNDE0bC01IDVhMSAxIDAgMDEtMS40MTQgMGwtMi0yYTEgMSAwIDAxMS40MTQtMS40MTRMNi41IDkuMDg2bDQuMjkzLTQuMjkzYTEgMSAwIDAxMS40MTQgMHonLz48L3N2Zz4="},qb=["id","onUpdate:modelValue"],Ub={class:"ms-2 text-gray-800 dark:text-neutral-200"},jb={key:0,class:"ms-auto text-xs text-gray-500 dark:text-neutral-500"},Wb={__name:"vs-attributre-widget",props:{config:{type:Object,required:!0},map:{type:Object,required:!0}},setup(u){const f=u,_=g.computed(()=>{var V;return((V=f.config)==null?void 0:V.title)||""}),b=g.ref([]),k=g.computed(()=>f.config.layer.style.rules.some(V=>V.count!==void 0)),T=g.computed(()=>f.config.layer.style.rules.reduce((V,P)=>V+(P.count||0),0)),x=V=>!V||T.value===0?0:Math.round(V/T.value*100),s=()=>{const P=f.config.layer.style.rules.filter((L,F)=>b.value[F]).map(L=>L.id||L.value).join(",");if(f.config.layer.id){const L=f.map.getSource(f.config.layer.id);if(L){const M=L.tiles[0].split("?filter=")[0],E=P?`${M}?filter=${f.config.layer.style.attribute}=${P}`:M;L.setTiles([E])}}};return g.onMounted(()=>{var V;(V=f.config)!=null&&V.layer&&(Po(f.map,f.config.layer),b.value=new Array(f.config.layer.style.rules.length).fill(!1))}),(V,P)=>(g.openBlock(),g.createElementBlock("div",Ib,[_.value?(g.openBlock(),g.createElementBlock("div",Mb,[g.createElementVNode("div",null,[g.createElementVNode("h2",Lb,g.toDisplayString(_.value),1)])])):g.createCommentVNode("",!0),g.createElementVNode("div",Rb,[g.createElementVNode("div",Bb,[g.createElementVNode("div",Db,[k.value?(g.openBlock(),g.createElementBlock("div",Vb,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(u.config.layer.style.rules,(L,F)=>(g.openBlock(),g.createElementBlock("div",{key:F,class:"flex flex-col justify-center overflow-hidden text-xs text-white text-center whitespace-nowrap",style:g.normalizeStyle({width:`${x(L.count)}%`,backgroundColor:L.color}),role:"progressbar","aria-valuenow":x(L.count),"aria-valuemin":"0","aria-valuemax":"100"},null,12,zb))),128))])):g.createCommentVNode("",!0),g.createElementVNode("ul",null,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(u.config.layer.style.rules,(L,F)=>(g.openBlock(),g.createElementBlock("li",{key:F},[g.createElementVNode("div",Fb,[g.createElementVNode("label",{for:`filter-${F}`,class:"flex items-center w-full cursor-pointer"},[g.createElementVNode("div",{class:"w-[18px] h-[18px] border rounded-[4px] flex items-center justify-center",style:g.normalizeStyle({background:b.value[F]?L.color||"#2563eb":"#fff",borderColor:b.value[F]?L.color||"#2563eb":L.color||"#d9d9d9"})},[b.value[F]?(g.openBlock(),g.createElementBlock("img",Nb)):g.createCommentVNode("",!0)],4),g.withDirectives(g.createElementVNode("input",{type:"checkbox",id:`filter-${F}`,"onUpdate:modelValue":M=>b.value[F]=M,onChange:s,class:"hidden",disabled:!1},null,40,qb),[[g.vModelCheckbox,b.value[F]]]),g.createElementVNode("span",Ub,g.toDisplayString(L.label||L.text),1),k.value?(g.openBlock(),g.createElementBlock("span",jb,"("+g.toDisplayString(L.count)+")",1)):g.createCommentVNode("",!0)],8,Ob)])]))),128))])])])])]))}},Hb={class:"hover:bg-gray-100 rounded-lg flex items-center ml-[20px] py-[8px] px-[8px]"},Zb=["for"],Kb={class:"custom-checkbox-wrapper"},Gb=["id","checked"],Jb={class:"custom-checkbox"},Xb={key:0,xmlns:"http://www.w3.org/2000/svg",width:"12",height:"8",viewBox:"0 0 12 8",fill:"none"},Qb={class:"flex items-center justify-between ml-2 w-full"},Yb=["title"],$b={key:0,class:"text-xs opacity-60 text-[#4b5563]"},e1={__name:"vs-map-catalog-item",props:{layer:{type:Object,required:!0},map:{type:Object,default:()=>null},selectedLayers:{type:Array,default:()=>[]}},emits:["select","remove"],setup(u,{emit:f}){const _=u,b=f,k=g.computed(()=>_.selectedLayers.some(s=>s.id===_.layer.id)),T=s=>Intl.NumberFormat("uk",{notation:"compact"}).format(s),x=s=>{b(s?"select":"remove",_.layer)};return(s,V)=>{var P,L,F,M,E;return g.openBlock(),g.createElementBlock("div",Hb,[g.createElementVNode("label",{class:"flex items-center w-full cursor-pointer",for:u.layer.id},[g.createElementVNode("div",Kb,[g.createElementVNode("input",{id:u.layer.id,type:"checkbox",checked:k.value,onChange:V[0]||(V[0]=C=>x(C.target.checked)),class:"custom-checkbox-input"},null,40,Gb),g.createElementVNode("div",Jb,[k.value?(g.openBlock(),g.createElementBlock("svg",Xb,V[1]||(V[1]=[g.createElementVNode("path",{d:"M10.6663 1L4.24967 7.41667L1.33301 4.5",stroke:"#fff","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))):g.createCommentVNode("",!0)])]),g.createElementVNode("div",Qb,[g.createElementVNode("div",{class:"whitespace-nowrap text text-ellipsis max-w-[260px] overflow-hidden text-[13px] text-[#4b5563]",title:(P=u.layer)==null?void 0:P.name},g.toDisplayString(((L=u.layer)==null?void 0:L.name)||((F=u.layer)==null?void 0:F.title)),9,Yb),isNaN(T((M=u.layer)==null?void 0:M.count))?g.createCommentVNode("",!0):(g.openBlock(),g.createElementBlock("div",$b,g.toDisplayString(T((E=u.layer)==null?void 0:E.count)),1))])],8,Zb)])}}},t1=Gt(e1,[["__scopeId","data-v-b96f3537"]]),r1={},i1={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-zoom-in"};function n1(u,f){return g.openBlock(),g.createElementBlock("svg",i1,f[0]||(f[0]=[g.createElementVNode("circle",{cx:"11",cy:"11",r:"8"},null,-1),g.createElementVNode("line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65"},null,-1),g.createElementVNode("line",{x1:"11",x2:"11",y1:"8",y2:"14"},null,-1),g.createElementVNode("line",{x1:"8",x2:"14",y1:"11",y2:"11"},null,-1)]))}const s1=Gt(r1,[["render",n1]]),o1={},a1={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-info"};function l1(u,f){return g.openBlock(),g.createElementBlock("svg",a1,f[0]||(f[0]=[g.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),g.createElementVNode("path",{d:"M12 16v-4"},null,-1),g.createElementVNode("path",{d:"M12 8h.01"},null,-1)]))}const c1=Gt(o1,[["render",l1]]),u1={},h1={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-table"};function p1(u,f){return g.openBlock(),g.createElementBlock("svg",h1,f[0]||(f[0]=[g.createElementVNode("path",{d:"M12 3v18"},null,-1),g.createElementVNode("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"},null,-1),g.createElementVNode("path",{d:"M3 9h18"},null,-1),g.createElementVNode("path",{d:"M3 15h18"},null,-1)]))}const d1=Gt(u1,[["render",p1]]),f1={},m1={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-trash2"};function g1(u,f){return g.openBlock(),g.createElementBlock("svg",m1,f[0]||(f[0]=[g.createStaticVNode('<path d="M3 6h18"></path><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"></path><line x1="10" x2="10" y1="11" y2="17"></line><line x1="14" x2="14" y1="11" y2="17"></line>',5)]))}const y1=Gt(f1,[["render",g1]]),_1={},v1={xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-more-vertical text-gray-600"};function x1(u,f){return g.openBlock(),g.createElementBlock("svg",v1,f[0]||(f[0]=[g.createElementVNode("circle",{cx:"12",cy:"12",r:"1"},null,-1),g.createElementVNode("circle",{cx:"12",cy:"5",r:"1"},null,-1),g.createElementVNode("circle",{cx:"12",cy:"19",r:"1"},null,-1)]))}const b1=Gt(_1,[["render",x1]]),w1={},S1={width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function k1(u,f){return g.openBlock(),g.createElementBlock("svg",S1,f[0]||(f[0]=[g.createElementVNode("path",{d:"M1 9L5 5L1 1",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))}const A1=Gt(w1,[["render",k1]]),C1={},T1={width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function E1(u,f){return g.openBlock(),g.createElementBlock("svg",T1,f[0]||(f[0]=[g.createStaticVNode('<g clip-path="url(#clip0_231_103)"><path d="M12 20L9 21V12.5L4.52 7.572C4.18545 7.20393 4.00005 6.7244 4 6.227V4H20V6.172C19.9999 6.70239 19.7891 7.21101 19.414 7.586L15 12" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path><path d="M21.121 20.1209C21.5406 19.7014 21.8265 19.1668 21.9423 18.5849C22.0581 18.0029 21.9988 17.3997 21.7717 16.8514C21.5447 16.3032 21.1602 15.8346 20.6668 15.5049C20.1734 15.1752 19.5934 14.9993 19 14.9993C18.4066 14.9993 17.8266 15.1752 17.3332 15.5049C16.8398 15.8346 16.4553 16.3032 16.2283 16.8514C16.0012 17.3997 15.9419 18.0029 16.0577 18.5849C16.1735 19.1668 16.4594 19.7014 16.879 20.1209C17.297 20.5399 18.004 21.1659 19 21.9999C20.051 21.1099 20.759 20.4839 21.121 20.1209Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path><path d="M19 18V18.01" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path></g><defs><clipPath id="clip0_231_103"><rect width="24" height="24" fill="white"></rect></clipPath></defs>',2)]))}const P1=Gt(C1,[["render",E1]]);function I1(){const f=new URLSearchParams(window.location.search).get("layers");return f?f.split(","):[]}function M1(u){const f=new URLSearchParams(window.location.search);u.length>0?f.set("layers",u.join(",")):f.delete("layers");const _=`${window.location.pathname}?${f.toString()}`;window.history.replaceState({},"",_)}const L1={components:{VsLayersItem:t1,ZoomInIcon:s1,InfoIcon:c1,TableIcon:d1,TrashIcon:y1,DotsIcon:b1,ChevronRightIcon:A1,FilterIcon:P1},props:{center:{type:Array,default:()=>[26.2516,50.6199]},zoom:{type:Number,default:12},map:{type:Object,default:()=>null},history:{type:Boolean,default:!1}},emits:["content-resize"],data(){return{layers:null,rawCatalog:null,categories:null,selectedCategory:"",search:"",activeView:"catalog",selectedLayers:[],mounted:!1,draggedLayerIndex:null,filterType:"",filterCategory:""}},computed:{searchedLayers(){return this.layers.filter(({name:u})=>u==null?void 0:u.toLowerCase().match(this.search.toLowerCase()))}},async mounted(){if(this.mounted=!0,await this.getLayers(),this.categories=this.layersCategories(),this.history){const u=I1();u.length>0&&this.layers&&(u.forEach(f=>{const _=this.layers.find(b=>String(b.id)===f);if(_&&!this.selectedLayers.find(b=>b.id===_.id)){const b={..._,visible:!0,opacity:100,showFilters:!1};this.selectedLayers.push(b),Po(this.map,b)}}),this.activeView="selected")}this._resizeObserver=new window.ResizeObserver(()=>{this.$emit("content-resize")}),this.$nextTick(()=>{const u=this.$el;u&&this._resizeObserver.observe(u)})},beforeUnmount(){this._resizeObserver&&this._resizeObserver.disconnect()},watch:{selectedLayers:{handler(u){this.history&&M1(u.map(f=>f.id))},deep:!0}},methods:{async getLayers(){try{const u=await kr.get("/api/map-catalog"),f=(u.data.services||[]).filter(_=>_.service_type!=="other");this.layers=[...f,...u.data.rasters||[]],this.$emit("catalog-layers",this.layers),this.rawCatalog={...u.data,services:f}}catch(u){console.error("Помилка завантаження шарів:",u)}},layersCategories(){return this.rawCatalog?{Сервіси:this.rawCatalog.services||[],Растри:this.rawCatalog.rasters||[]}:{}},selectCategory(u){this.selectedCategory=this.selectedCategory===u?"":u},formatNumber(u){return Intl.NumberFormat("uk",{notation:"compact"}).format(u)},onEnter(){this.layers.filter(({name:u})=>u==null?void 0:u.toLowerCase().match(this.search.toLowerCase()))},clearSearch(){this.search=""},addToSelected(u){if(!this.selectedLayers.find(f=>f.id===u.id)){const f={...u,visible:!0,opacity:100,showFilters:!1};this.selectedLayers.unshift(f),Po(this.map,f)}},deleteLayer(u){const f=this.selectedLayers.findIndex(_=>_.id===u.id);f!==-1&&this.selectedLayers.splice(f,1),Ba(this.map,u.id)},async toggleLayerVisibility(u){try{u.visible?(await Po(this.map,u),this.updateLayerOpacity(u)):await Ba(this.map,u.id)}catch(f){console.error("Error toggling layer visibility:",f),u.visible=!u.visible}},onLayerOpacityChange(u){this.updateLayerOpacity(u)},updateLayerOpacity(u){if(this.map){const f=this.map.getStyle().layers.filter(b=>b.id.includes(u.id)),_=u.opacity/100;f.forEach(b=>{b.type==="fill"?(u.originalFillOpacity||(u.originalFillOpacity=this.map.getPaintProperty(b.id,"fill-opacity")||1),this.map.setPaintProperty(b.id,"fill-opacity",u.originalFillOpacity*_)):b.type==="raster"?this.map.setPaintProperty(b.id,"raster-opacity",_):b.type==="line"?this.map.setPaintProperty(b.id,"line-opacity",_):b.type==="circle"?(this.map.setPaintProperty(b.id,"circle-opacity",_),this.map.setPaintProperty(b.id,"circle-stroke-opacity",_)):b.type==="symbol"&&(this.map.setPaintProperty(b.id,"icon-opacity",_),this.map.setPaintProperty(b.id,"text-opacity",_))})}},async handleRemoveFromCatalog(u){const f=this.selectedLayers.find(_=>_.id===u.id);f!=null&&f.visible&&await Ba(this.map,u.id),this.deleteLayer(u)},clearSelectedLayers(){this.selectedLayers.forEach(async u=>{u.visible&&await Ba(this.map,u.id)}),this.selectedLayers=[]},zoomToLayer(u){this.fitBoundsByLayer(u)},showLayerInfo(u){},showLayerTable(u){},showLayerFilter(u){u.showFilters=!u.showFilters},fitBoundsByLayer(u){u&&u.bbox&&Array.isArray(u.bbox)&&u.bbox.length===4&&this.map&&this.map.fitBounds([[u.bbox[0],u.bbox[1]],[u.bbox[2],u.bbox[3]]],{padding:50,duration:0})},async handleFilterChange({url:u},f){const _=this.map.getSource(f.id);if(_){const k=_.tiles[0].split("?filter=")[0],T=u?`${k}?filter=${u}`:k;_.setTiles([T])}},popoverActions(u){return[{label:"Збільшити до шару",icon:"ZoomInIcon",class:Array.isArray(u.bbox)&&u.bbox.length===4?"text-gray-700 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100 opacity-50 cursor-not-allowed",handler:"zoomToLayer"},{label:"Інформація про шар",icon:"InfoIcon",class:"text-gray-700 hover:bg-gray-100 opacity-50 cursor-not-allowed",handler:"showLayerInfo"},{label:"Таблиця шару",icon:"TableIcon",class:"text-gray-700 hover:bg-gray-100 opacity-50 cursor-not-allowed",handler:"showLayerTable"},{divider:!0},{label:"Видалити шар",icon:"TrashIcon",class:"text-red-600 hover:bg-red-50",handler:"deleteLayer"}]},onDragStart(u){this.draggedLayerIndex=u},onDragOver(u){},onDrop(u){if(this.draggedLayerIndex===null||this.draggedLayerIndex===u)return;const f=this.selectedLayers[this.draggedLayerIndex];if(this.selectedLayers.splice(this.draggedLayerIndex,1),this.selectedLayers.splice(u,0,f),this.draggedLayerIndex=null,this.map&&this.selectedLayers.length>1)for(let _=this.selectedLayers.length-1;_>=0;_--){const b=this.selectedLayers[_];b.visible&&this.map.getStyle().layers.find(k=>k.id.includes(b.id))&&this.map.getStyle().layers.forEach(k=>{k.id.includes(b.id)&&this.map.moveLayer(k.id)})}},onDragEnd(){this.draggedLayerIndex=null}}},R1={class:"w-full max-w-md mx-auto p-4 bg-white border border-gray-200 rounded-lg shadow-sm"},B1={class:"flex items-center justify-between mb-4"},D1={class:"flex items-center gap-2"},V1={class:"text-lg font-semibold text-gray-800"},z1={key:0},F1={key:1},O1={class:"flex mb-4 border-b border-gray-200"},N1={key:0},q1={class:"mb-4"},U1={key:0,class:"space-y-2 max-h-[400px] overflow-y-auto pr-1 [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-transparent"},j1=["onDragstart","onDragover","onDrop"],W1={class:"flex items-center justify-between"},H1={class:"flex items-center gap-2 cursor-move"},Z1=["onUpdate:modelValue","onChange"],K1={class:"text-gray-800"},G1={class:"flex items-center gap-2"},J1={class:"relative"},X1={class:"flex items-center gap-2"},Q1=["onUpdate:modelValue","onInput"],Y1={class:"text-xs text-gray-600 whitespace-nowrap"},$1=["onClick"],e2={class:"relative"},t2={class:"w-48"},r2={key:0,class:"my-1 border-gray-200"},i2=["disabled","onClick"],n2={class:"p-1 rounded-full hover:bg-gray-100 transition-colors","aria-label":"Layer actions"},s2={key:0,class:"bg-blue-50 rounded-md mt-2"},o2={class:"px-2 pt-2 text-blue-600 hover:text-blue-700 transition-colors"},a2={key:0,class:"text-center text-[14px] text-[#4b5563]"},l2={class:"relative mt-[10px]"},c2={class:"absolute top-1/2 left-[8px] w-[16px] h-[16px]",style:{transform:"translate(0, -50%)"},width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},u2={key:0,class:"vs-layers-catalog__list flex-1 scrollable-container overflow-auto mt-2 catalog-list"},h2={key:0,class:"text-center text-[14px] text-[#4b5563]"},p2={key:0,class:"text-center text-[14px] text-[#4b5563]"},d2=["onClick"],f2={class:"flex items-center gap-x-3"},m2=["title"],g2={class:"text-xs opacity-60 text-[#4b5563]"};function y2(u,f,_,b,k,T){var E;const x=g.resolveComponent("VsPopover"),s=g.resolveComponent("DotsIcon"),V=g.resolveComponent("VsFilter"),P=g.resolveComponent("searchIcon"),L=g.resolveComponent("closeIcon"),F=g.resolveComponent("VsLayersItem"),M=g.resolveComponent("chevronRightIcon");return g.openBlock(),g.createElementBlock("div",R1,[g.createElementVNode("div",B1,[g.createElementVNode("div",D1,[f[7]||(f[7]=g.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-layers text-blue-600"},[g.createElementVNode("path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z"}),g.createElementVNode("path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65"}),g.createElementVNode("path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65"})],-1)),g.createElementVNode("h2",V1,[g.createTextVNode(g.toDisplayString(k.activeView==="catalog"?"Каталог":"Вибрані шари")+" ",1),k.activeView==="catalog"?(g.openBlock(),g.createElementBlock("span",z1,"("+g.toDisplayString(((E=k.layers)==null?void 0:E.length)||0)+")",1)):(g.openBlock(),g.createElementBlock("span",F1,"("+g.toDisplayString(k.selectedLayers.length)+")",1))])]),g.createElementVNode("button",{class:"p-1 rounded-full hover:bg-gray-200 transition-colors","aria-label":"Reset layers",onClick:f[0]||(f[0]=(...C)=>T.clearSelectedLayers&&T.clearSelectedLayers(...C))},f[8]||(f[8]=[g.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-refresh-cw text-gray-600" data-v-7480b2b6><path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" data-v-7480b2b6></path><path d="M21 3v5h-5" data-v-7480b2b6></path><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" data-v-7480b2b6></path><path d="M8 16H3v5" data-v-7480b2b6></path></svg>',1)]))]),g.createElementVNode("div",O1,[g.createElementVNode("button",{class:g.normalizeClass(["px-4 py-2 text-sm font-medium",k.activeView==="catalog"?"text-blue-600 border-b-2 border-blue-600":"text-gray-600 hover:text-gray-800"]),onClick:f[1]||(f[1]=C=>k.activeView="catalog")}," Каталог ",2),g.createElementVNode("button",{class:g.normalizeClass(["px-4 py-2 text-sm font-medium",k.activeView==="selected"?"text-blue-600 border-b-2 border-blue-600":"text-gray-600 hover:text-gray-800"]),onClick:f[2]||(f[2]=C=>k.activeView="selected")}," Вибрані шари ",2)]),k.activeView==="selected"?(g.openBlock(),g.createElementBlock("div",N1,[g.createElementVNode("div",q1,[g.createElementVNode("button",{class:"flex items-center gap-2 text-blue-600 hover:text-blue-700 transition-colors px-3 py-2 rounded-md bg-blue-50 hover:bg-blue-100 w-full justify-center",onClick:f[3]||(f[3]=C=>k.activeView="catalog")},f[9]||(f[9]=[g.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-plus"},[g.createElementVNode("path",{d:"M5 12h14"}),g.createElementVNode("path",{d:"M12 5v14"})],-1),g.createElementVNode("span",null,"Вибрати шар",-1)]))]),k.mounted?(g.openBlock(),g.createElementBlock("div",U1,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(k.selectedLayers,(C,W)=>{var J,se;return g.openBlock(),g.createElementBlock("div",{key:C.id||W,class:g.normalizeClass(["border border-gray-200 rounded-md p-3 mb-2 bg-white shadow-sm text-[13px] text-[#4b5563]",{dragging:k.draggedLayerIndex===W}]),draggable:"true",onDragstart:oe=>T.onDragStart(W),onDragover:g.withModifiers(oe=>T.onDragOver(W),["prevent"]),onDrop:oe=>T.onDrop(W),onDragend:f[4]||(f[4]=(...oe)=>T.onDragEnd&&T.onDragEnd(...oe))},[g.createElementVNode("div",W1,[g.createElementVNode("div",H1,[f[10]||(f[10]=g.createStaticVNode('<svg width="16" height="16" fill="none" stroke="#9ca3af" stroke-width="2" viewBox="0 0 24 24" class="mr-1 shrink-0" data-v-7480b2b6><circle cx="5" cy="5" r="1.5" data-v-7480b2b6></circle><circle cx="5" cy="12" r="1.5" data-v-7480b2b6></circle><circle cx="5" cy="19" r="1.5" data-v-7480b2b6></circle><circle cx="12" cy="5" r="1.5" data-v-7480b2b6></circle><circle cx="12" cy="12" r="1.5" data-v-7480b2b6></circle><circle cx="12" cy="19" r="1.5" data-v-7480b2b6></circle><circle cx="19" cy="5" r="1.5" data-v-7480b2b6></circle><circle cx="19" cy="12" r="1.5" data-v-7480b2b6></circle><circle cx="19" cy="19" r="1.5" data-v-7480b2b6></circle></svg>',1)),g.withDirectives(g.createElementVNode("input",{type:"checkbox",class:"w-4 h-4 text-blue-600 rounded focus:ring-blue-500","onUpdate:modelValue":oe=>C.visible=oe,onChange:oe=>T.toggleLayerVisibility(C)},null,40,Z1),[[g.vModelCheckbox,C.visible]]),g.createElementVNode("span",K1,g.toDisplayString(C.name||C.title||C.label),1)]),g.createElementVNode("div",G1,[g.createElementVNode("div",J1,[g.createVNode(x,{placement:"bottom"},{reference:g.withCtx(()=>[g.createElementVNode("div",{class:"text-sm text-gray-600 hover:text-gray-800 transition-colors px-2 py-1 rounded hover:bg-gray-100 cursor-pointer",onClick:oe=>T.updateLayerOpacity(C)},g.toDisplayString(C.opacity||100)+"% ",9,$1)]),default:g.withCtx(()=>[g.createElementVNode("div",X1,[f[11]||(f[11]=g.createElementVNode("label",{class:"text-gray-600 whitespace-nowrap"},"Прозорість:",-1)),g.withDirectives(g.createElementVNode("input",{type:"range",min:"0",max:"100",step:"1","onUpdate:modelValue":oe=>C.opacity=oe,onInput:oe=>T.onLayerOpacityChange(C),class:"h-2 w-full accent-blue-600 rounded-lg cursor-pointer bg-gray-200"},null,40,Q1),[[g.vModelText,C.opacity]]),g.createElementVNode("span",Y1,g.toDisplayString(Math.round(C.opacity))+"% ",1)])]),_:2},1024)]),g.createElementVNode("div",e2,[g.createVNode(x,{placement:"bottom"},{reference:g.withCtx(()=>[g.createElementVNode("div",n2,[g.createVNode(s)])]),default:g.withCtx(()=>[g.createElementVNode("div",t2,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.popoverActions(C),(oe,Se)=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:Se},[oe.divider?(g.openBlock(),g.createElementBlock("hr",r2)):(g.openBlock(),g.createElementBlock("button",{key:1,class:g.normalizeClass("w-full p-2 text-left text-sm flex items-center gap-2 "+(oe.class||"")),disabled:oe.disabled,onClick:$=>!oe.disabled&&u.$options.methods[oe.handler].call(this,C)},[(g.openBlock(),g.createBlock(g.resolveDynamicComponent(oe.icon),{class:"lucide"})),g.createTextVNode(" "+g.toDisplayString(oe.label),1)],10,i2))],64))),128))])]),_:2},1024)])])]),C.showFilters?(g.openBlock(),g.createElementBlock("div",s2,[g.createElementVNode("div",o2," Фільтри для шару: "+g.toDisplayString(C.name||C.title||C.label),1),g.withDirectives(g.createVNode(V,{ref_for:!0,ref:"filter",scheme:C.filters,header:!1,urlSeparator:"true",view:"plain",name:"filter",onFilterChange:oe=>T.handleFilterChange(oe,C)},null,8,["scheme","onFilterChange"]),[[g.vShow,(J=C.filters)==null?void 0:J.length]]),g.withDirectives(g.createElementVNode("div",null,f[12]||(f[12]=[g.createElementVNode("div",{class:"px-2 text-[14px] text-[#4b5563]"}," Фільтри для шару відсутні ",-1)]),512),[[g.vShow,!((se=C.filters)!=null&&se.length)]])])):g.createCommentVNode("",!0)],42,j1)}),128)),k.selectedLayers.length===0?(g.openBlock(),g.createElementBlock("div",a2,f[13]||(f[13]=[g.createElementVNode("p",null,'Щоб додати шар, натисніть на кнопку "Вибрати шар".',-1)]))):g.createCommentVNode("",!0)])):g.createCommentVNode("",!0)])):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createElementVNode("div",l2,[(g.openBlock(),g.createElementBlock("svg",c2,f[14]||(f[14]=[g.createElementVNode("path",{d:"M7.33333 13.1667C10.2789 13.1667 12.6667 10.7789 12.6667 7.83333C12.6667 4.88781 10.2789 2.5 7.33333 2.5C4.38781 2.5 2 4.88781 2 7.83333C2 10.7789 4.38781 13.1667 7.33333 13.1667Z",stroke:"#6B7280","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),g.createElementVNode("path",{d:"M13.9995 14.5L11.1328 11.6333",stroke:"#6B7280","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))),g.withDirectives(g.createElementVNode("input",{title:"value",placeholder:"Введіть назву шару...","onUpdate:modelValue":f[5]||(f[5]=C=>k.search=C),type:"text",class:"py-[7px] ps-8 pe-8 block w-full bg-gray-100 border-transparent rounded-lg text-sm focus:bg-white focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:focus:bg-neutral-800 dark:focus:ring-neutral-600",onKeyup:f[6]||(f[6]=g.withKeys((...C)=>T.onEnter&&T.onEnter(...C),["enter"]))},null,544),[[g.vModelText,k.search]]),g.createVNode(P,{class:"absolute top-1/2 left-[8px] w-[16px] h-[16px]",style:{transform:"translate(0, -50%)"}}),k.search?(g.openBlock(),g.createBlock(L,{key:0,class:"absolute top-1/2 right-[10px] w-[16px] h-[16px] cursor-pointer",style:{transform:"translate(0, -50%)"},onClick:T.clearSearch},null,8,["onClick"])):g.createCommentVNode("",!0)]),k.categories?(g.openBlock(),g.createElementBlock("div",u2,[k.search?(g.openBlock(),g.createElementBlock(g.Fragment,{key:0},[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.searchedLayers,(C,W)=>(g.openBlock(),g.createBlock(F,{key:W,layer:C,map:_.map,selectedLayers:k.selectedLayers,onSelect:T.addToSelected,onRemove:T.handleRemoveFromCatalog},null,8,["layer","map","selectedLayers","onSelect","onRemove"]))),128)),T.searchedLayers.length===0?(g.openBlock(),g.createElementBlock("div",h2," Нічого не знайдено ")):g.createCommentVNode("",!0)],64)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[!k.categories||Object.keys(k.categories).length===0?(g.openBlock(),g.createElementBlock("div",p2," Каталог порожній ")):(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:1},g.renderList(Object.keys(k.categories),C=>(g.openBlock(),g.createElementBlock("div",{key:C},[g.createElementVNode("div",{class:"hover:bg-gray-100 focus:bg-gray-100 px-2.5 cursor-pointer p-[8px] rounded-lg flex justify-between items-center",onClick:W=>T.selectCategory(C)},[g.createElementVNode("div",f2,[g.createVNode(M,{class:g.normalizeClass({"rotate-up":C===k.selectedCategory,"rotate-down":C!==k.selectedCategory})},null,8,["class"]),g.createElementVNode("div",{class:"max-w-[260px] text-[14px] text-[#4b5563]",title:C},g.toDisplayString(C),9,m2)]),g.createElementVNode("div",g2,g.toDisplayString(T.formatNumber(k.categories[C].length)),1)],8,d2),g.withDirectives(g.createElementVNode("div",null,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(k.categories[C],(W,J)=>(g.openBlock(),g.createBlock(F,{key:J,layer:W,map:_.map,selectedLayers:k.selectedLayers,onSelect:T.addToSelected,onRemove:T.handleRemoveFromCatalog},null,8,["layer","map","selectedLayers","onSelect","onRemove"]))),128))],512),[[g.vShow,C===k.selectedCategory]])]))),128))],64))])):g.createCommentVNode("",!0)],64))])}const _2=Gt(L1,[["render",y2],["__scopeId","data-v-7480b2b6"]]);var xu={exports:{}},bu={exports:{}},bn={},Wi={},wm;function Ki(){if(wm)return Wi;wm=1,Wi.__esModule=!0,Wi.extend=k,Wi.indexOf=V,Wi.escapeExpression=P,Wi.isEmpty=L,Wi.createFrame=F,Wi.blockParams=M,Wi.appendContextPath=E;var u={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"},f=/[&<>"'`=]/g,_=/[&<>"'`=]/;function b(C){return u[C]}function k(C){for(var W=1;W<arguments.length;W++)for(var J in arguments[W])Object.prototype.hasOwnProperty.call(arguments[W],J)&&(C[J]=arguments[W][J]);return C}var T=Object.prototype.toString;Wi.toString=T;var x=function(W){return typeof W=="function"};x(/x/)&&(Wi.isFunction=x=function(C){return typeof C=="function"&&T.call(C)==="[object Function]"}),Wi.isFunction=x;var s=Array.isArray||function(C){return C&&typeof C=="object"?T.call(C)==="[object Array]":!1};Wi.isArray=s;function V(C,W){for(var J=0,se=C.length;J<se;J++)if(C[J]===W)return J;return-1}function P(C){if(typeof C!="string"){if(C&&C.toHTML)return C.toHTML();if(C==null)return"";if(!C)return C+"";C=""+C}return _.test(C)?C.replace(f,b):C}function L(C){return!C&&C!==0?!0:!!(s(C)&&C.length===0)}function F(C){var W=k({},C);return W._parent=C,W}function M(C,W){return C.path=W,C}function E(C,W){return(C?C+".":"")+W}return Wi}var wu={exports:{}},Sm;function Sn(){return Sm||(Sm=1,function(u,f){f.__esModule=!0;var _=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function b(k,T){var x=T&&T.loc,s=void 0,V=void 0,P=void 0,L=void 0;x&&(s=x.start.line,V=x.end.line,P=x.start.column,L=x.end.column,k+=" - "+s+":"+P);for(var F=Error.prototype.constructor.call(this,k),M=0;M<_.length;M++)this[_[M]]=F[_[M]];Error.captureStackTrace&&Error.captureStackTrace(this,b);try{x&&(this.lineNumber=s,this.endLineNumber=V,Object.defineProperty?(Object.defineProperty(this,"column",{value:P,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:L,enumerable:!0})):(this.column=P,this.endColumn=L))}catch{}}b.prototype=new Error,f.default=b,u.exports=f.default}(wu,wu.exports)),wu.exports}var Ql={},Su={exports:{}},km;function v2(){return km||(km=1,function(u,f){f.__esModule=!0;var _=Ki();f.default=function(b){b.registerHelper("blockHelperMissing",function(k,T){var x=T.inverse,s=T.fn;if(k===!0)return s(this);if(k===!1||k==null)return x(this);if(_.isArray(k))return k.length>0?(T.ids&&(T.ids=[T.name]),b.helpers.each(k,T)):x(this);if(T.data&&T.ids){var V=_.createFrame(T.data);V.contextPath=_.appendContextPath(T.data.contextPath,T.name),T={data:V}}return s(k,T)})},u.exports=f.default}(Su,Su.exports)),Su.exports}var ku={exports:{}},Am;function x2(){return Am||(Am=1,function(u,f){f.__esModule=!0;function _(x){return x&&x.__esModule?x:{default:x}}var b=Ki(),k=Sn(),T=_(k);f.default=function(x){x.registerHelper("each",function(s,V){if(!V)throw new T.default("Must pass iterator to #each");var P=V.fn,L=V.inverse,F=0,M="",E=void 0,C=void 0;V.data&&V.ids&&(C=b.appendContextPath(V.data.contextPath,V.ids[0])+"."),b.isFunction(s)&&(s=s.call(this)),V.data&&(E=b.createFrame(V.data));function W($,de,Ce){E&&(E.key=$,E.index=de,E.first=de===0,E.last=!!Ce,C&&(E.contextPath=C+$)),M=M+P(s[$],{data:E,blockParams:b.blockParams([s[$],$],[C+$,null])})}if(s&&typeof s=="object")if(b.isArray(s))for(var J=s.length;F<J;F++)F in s&&W(F,F,F===s.length-1);else if(typeof Symbol=="function"&&s[Symbol.iterator]){for(var se=[],oe=s[Symbol.iterator](),Se=oe.next();!Se.done;Se=oe.next())se.push(Se.value);s=se;for(var J=s.length;F<J;F++)W(F,F,F===s.length-1)}else(function(){var $=void 0;Object.keys(s).forEach(function(de){$!==void 0&&W($,F-1),$=de,F++}),$!==void 0&&W($,F-1,!0)})();return F===0&&(M=L(this)),M})},u.exports=f.default}(ku,ku.exports)),ku.exports}var Au={exports:{}},Cm;function b2(){return Cm||(Cm=1,function(u,f){f.__esModule=!0;function _(T){return T&&T.__esModule?T:{default:T}}var b=Sn(),k=_(b);f.default=function(T){T.registerHelper("helperMissing",function(){if(arguments.length!==1)throw new k.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})},u.exports=f.default}(Au,Au.exports)),Au.exports}var Cu={exports:{}},Tm;function w2(){return Tm||(Tm=1,function(u,f){f.__esModule=!0;function _(x){return x&&x.__esModule?x:{default:x}}var b=Ki(),k=Sn(),T=_(k);f.default=function(x){x.registerHelper("if",function(s,V){if(arguments.length!=2)throw new T.default("#if requires exactly one argument");return b.isFunction(s)&&(s=s.call(this)),!V.hash.includeZero&&!s||b.isEmpty(s)?V.inverse(this):V.fn(this)}),x.registerHelper("unless",function(s,V){if(arguments.length!=2)throw new T.default("#unless requires exactly one argument");return x.helpers.if.call(this,s,{fn:V.inverse,inverse:V.fn,hash:V.hash})})},u.exports=f.default}(Cu,Cu.exports)),Cu.exports}var Tu={exports:{}},Em;function S2(){return Em||(Em=1,function(u,f){f.__esModule=!0,f.default=function(_){_.registerHelper("log",function(){for(var b=[void 0],k=arguments[arguments.length-1],T=0;T<arguments.length-1;T++)b.push(arguments[T]);var x=1;k.hash.level!=null?x=k.hash.level:k.data&&k.data.level!=null&&(x=k.data.level),b[0]=x,_.log.apply(_,b)})},u.exports=f.default}(Tu,Tu.exports)),Tu.exports}var Eu={exports:{}},Pm;function k2(){return Pm||(Pm=1,function(u,f){f.__esModule=!0,f.default=function(_){_.registerHelper("lookup",function(b,k,T){return b&&T.lookupProperty(b,k)})},u.exports=f.default}(Eu,Eu.exports)),Eu.exports}var Pu={exports:{}},Im;function A2(){return Im||(Im=1,function(u,f){f.__esModule=!0;function _(x){return x&&x.__esModule?x:{default:x}}var b=Ki(),k=Sn(),T=_(k);f.default=function(x){x.registerHelper("with",function(s,V){if(arguments.length!=2)throw new T.default("#with requires exactly one argument");b.isFunction(s)&&(s=s.call(this));var P=V.fn;if(b.isEmpty(s))return V.inverse(this);var L=V.data;return V.data&&V.ids&&(L=b.createFrame(V.data),L.contextPath=b.appendContextPath(V.data.contextPath,V.ids[0])),P(s,{data:L,blockParams:b.blockParams([s],[L&&L.contextPath])})})},u.exports=f.default}(Pu,Pu.exports)),Pu.exports}var Mm;function ry(){if(Mm)return Ql;Mm=1,Ql.__esModule=!0,Ql.registerDefaultHelpers=W,Ql.moveHelperToHooks=J;function u(se){return se&&se.__esModule?se:{default:se}}var f=v2(),_=u(f),b=x2(),k=u(b),T=b2(),x=u(T),s=w2(),V=u(s),P=S2(),L=u(P),F=k2(),M=u(F),E=A2(),C=u(E);function W(se){_.default(se),k.default(se),x.default(se),V.default(se),L.default(se),M.default(se),C.default(se)}function J(se,oe,Se){se.helpers[oe]&&(se.hooks[oe]=se.helpers[oe],Se||delete se.helpers[oe])}return Ql}var Iu={},Mu={exports:{}},Lm;function C2(){return Lm||(Lm=1,function(u,f){f.__esModule=!0;var _=Ki();f.default=function(b){b.registerDecorator("inline",function(k,T,x,s){var V=k;return T.partials||(T.partials={},V=function(P,L){var F=x.partials;x.partials=_.extend({},F,T.partials);var M=k(P,L);return x.partials=F,M}),T.partials[s.args[0]]=s.fn,V})},u.exports=f.default}(Mu,Mu.exports)),Mu.exports}var Rm;function T2(){if(Rm)return Iu;Rm=1,Iu.__esModule=!0,Iu.registerDefaultDecorators=b;function u(k){return k&&k.__esModule?k:{default:k}}var f=C2(),_=u(f);function b(k){_.default(k)}return Iu}var Lu={exports:{}},Bm;function iy(){return Bm||(Bm=1,function(u,f){f.__esModule=!0;var _=Ki(),b={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(T){if(typeof T=="string"){var x=_.indexOf(b.methodMap,T.toLowerCase());x>=0?T=x:T=parseInt(T,10)}return T},log:function(T){if(T=b.lookupLevel(T),typeof console<"u"&&b.lookupLevel(b.level)<=T){var x=b.methodMap[T];console[x]||(x="log");for(var s=arguments.length,V=Array(s>1?s-1:0),P=1;P<s;P++)V[P-1]=arguments[P];console[x].apply(console,V)}}};f.default=b,u.exports=f.default}(Lu,Lu.exports)),Lu.exports}var Ma={},Ru={},Dm;function E2(){if(Dm)return Ru;Dm=1,Ru.__esModule=!0,Ru.createNewLookupObject=f;var u=Ki();function f(){for(var _=arguments.length,b=Array(_),k=0;k<_;k++)b[k]=arguments[k];return u.extend.apply(void 0,[Object.create(null)].concat(b))}return Ru}var Vm;function ny(){if(Vm)return Ma;Vm=1,Ma.__esModule=!0,Ma.createProtoAccessControl=T,Ma.resultIsAllowed=x,Ma.resetLoggedProperties=P;function u(L){return L&&L.__esModule?L:{default:L}}var f=E2(),_=iy(),b=u(_),k=Object.create(null);function T(L){var F=Object.create(null);F.constructor=!1,F.__defineGetter__=!1,F.__defineSetter__=!1,F.__lookupGetter__=!1;var M=Object.create(null);return M.__proto__=!1,{properties:{whitelist:f.createNewLookupObject(M,L.allowedProtoProperties),defaultValue:L.allowProtoPropertiesByDefault},methods:{whitelist:f.createNewLookupObject(F,L.allowedProtoMethods),defaultValue:L.allowProtoMethodsByDefault}}}function x(L,F,M){return s(typeof L=="function"?F.methods:F.properties,M)}function s(L,F){return L.whitelist[F]!==void 0?L.whitelist[F]===!0:L.defaultValue!==void 0?L.defaultValue:(V(F),!1)}function V(L){k[L]!==!0&&(k[L]=!0,b.default.log("error",'Handlebars: Access has been denied to resolve the property "'+L+`" because it is not an "own property" of its parent.
802
- You can add a runtime option to disable the check or this warning:
803
- See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}function P(){Object.keys(k).forEach(function(L){delete k[L]})}return Ma}var zm;function fd(){if(zm)return bn;zm=1,bn.__esModule=!0,bn.HandlebarsEnvironment=C;function u(J){return J&&J.__esModule?J:{default:J}}var f=Ki(),_=Sn(),b=u(_),k=ry(),T=T2(),x=iy(),s=u(x),V=ny(),P="4.7.8";bn.VERSION=P;var L=8;bn.COMPILER_REVISION=L;var F=7;bn.LAST_COMPATIBLE_COMPILER_REVISION=F;var M={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};bn.REVISION_CHANGES=M;var E="[object Object]";function C(J,se,oe){this.helpers=J||{},this.partials=se||{},this.decorators=oe||{},k.registerDefaultHelpers(this),T.registerDefaultDecorators(this)}C.prototype={constructor:C,logger:s.default,log:s.default.log,registerHelper:function(se,oe){if(f.toString.call(se)===E){if(oe)throw new b.default("Arg not supported with multiple helpers");f.extend(this.helpers,se)}else this.helpers[se]=oe},unregisterHelper:function(se){delete this.helpers[se]},registerPartial:function(se,oe){if(f.toString.call(se)===E)f.extend(this.partials,se);else{if(typeof oe>"u")throw new b.default('Attempting to register a partial called "'+se+'" as undefined');this.partials[se]=oe}},unregisterPartial:function(se){delete this.partials[se]},registerDecorator:function(se,oe){if(f.toString.call(se)===E){if(oe)throw new b.default("Arg not supported with multiple decorators");f.extend(this.decorators,se)}else this.decorators[se]=oe},unregisterDecorator:function(se){delete this.decorators[se]},resetLoggedPropertyAccesses:function(){V.resetLoggedProperties()}};var W=s.default.log;return bn.log=W,bn.createFrame=f.createFrame,bn.logger=s.default,bn}var Bu={exports:{}},Fm;function P2(){return Fm||(Fm=1,function(u,f){f.__esModule=!0;function _(b){this.string=b}_.prototype.toString=_.prototype.toHTML=function(){return""+this.string},f.default=_,u.exports=f.default}(Bu,Bu.exports)),Bu.exports}var is={},Du={},Om;function I2(){if(Om)return Du;Om=1,Du.__esModule=!0,Du.wrapHelper=u;function u(f,_){if(typeof f!="function")return f;var b=function(){var T=arguments[arguments.length-1];return arguments[arguments.length-1]=_(T),f.apply(this,arguments)};return b}return Du}var Nm;function M2(){if(Nm)return is;Nm=1,is.__esModule=!0,is.checkRevision=L,is.template=F,is.wrapProgram=M,is.resolvePartial=E,is.invokePartial=C,is.noop=W;function u($){return $&&$.__esModule?$:{default:$}}function f($){if($&&$.__esModule)return $;var de={};if($!=null)for(var Ce in $)Object.prototype.hasOwnProperty.call($,Ce)&&(de[Ce]=$[Ce]);return de.default=$,de}var _=Ki(),b=f(_),k=Sn(),T=u(k),x=fd(),s=ry(),V=I2(),P=ny();function L($){var de=$&&$[0]||1,Ce=x.COMPILER_REVISION;if(!(de>=x.LAST_COMPATIBLE_COMPILER_REVISION&&de<=x.COMPILER_REVISION))if(de<x.LAST_COMPATIBLE_COMPILER_REVISION){var Re=x.REVISION_CHANGES[Ce],Ze=x.REVISION_CHANGES[de];throw new T.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+Re+") or downgrade your runtime to an older version ("+Ze+").")}else throw new T.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+$[1]+").")}function F($,de){if(!de)throw new T.default("No environment passed to template");if(!$||!$.main)throw new T.default("Unknown template object: "+typeof $);$.main.decorator=$.main_d,de.VM.checkRevision($.compiler);var Ce=$.compiler&&$.compiler[0]===7;function Re(tt,Ge,it){it.hash&&(Ge=b.extend({},Ge,it.hash),it.ids&&(it.ids[0]=!0)),tt=de.VM.resolvePartial.call(this,tt,Ge,it);var vt=b.extend({},it,{hooks:this.hooks,protoAccessControl:this.protoAccessControl}),Lt=de.VM.invokePartial.call(this,tt,Ge,vt);if(Lt==null&&de.compile&&(it.partials[it.name]=de.compile(tt,$.compilerOptions,de),Lt=it.partials[it.name](Ge,vt)),Lt!=null){if(it.indent){for(var Ar=Lt.split(`
804
- `),hr=0,xi=Ar.length;hr<xi&&!(!Ar[hr]&&hr+1===xi);hr++)Ar[hr]=it.indent+Ar[hr];Lt=Ar.join(`
805
- `)}return Lt}else throw new T.default("The partial "+it.name+" could not be compiled when running in runtime-only mode")}var Ze={strict:function(Ge,it,vt){if(!Ge||!(it in Ge))throw new T.default('"'+it+'" not defined in '+Ge,{loc:vt});return Ze.lookupProperty(Ge,it)},lookupProperty:function(Ge,it){var vt=Ge[it];if(vt==null||Object.prototype.hasOwnProperty.call(Ge,it)||P.resultIsAllowed(vt,Ze.protoAccessControl,it))return vt},lookup:function(Ge,it){for(var vt=Ge.length,Lt=0;Lt<vt;Lt++){var Ar=Ge[Lt]&&Ze.lookupProperty(Ge[Lt],it);if(Ar!=null)return Ge[Lt][it]}},lambda:function(Ge,it){return typeof Ge=="function"?Ge.call(it):Ge},escapeExpression:b.escapeExpression,invokePartial:Re,fn:function(Ge){var it=$[Ge];return it.decorator=$[Ge+"_d"],it},programs:[],program:function(Ge,it,vt,Lt,Ar){var hr=this.programs[Ge],xi=this.fn(Ge);return it||Ar||Lt||vt?hr=M(this,Ge,xi,it,vt,Lt,Ar):hr||(hr=this.programs[Ge]=M(this,Ge,xi)),hr},data:function(Ge,it){for(;Ge&&it--;)Ge=Ge._parent;return Ge},mergeIfNeeded:function(Ge,it){var vt=Ge||it;return Ge&&it&&Ge!==it&&(vt=b.extend({},it,Ge)),vt},nullContext:Object.seal({}),noop:de.VM.noop,compilerInfo:$.compiler};function kt(tt){var Ge=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],it=Ge.data;kt._setup(Ge),!Ge.partial&&$.useData&&(it=J(tt,it));var vt=void 0,Lt=$.useBlockParams?[]:void 0;$.useDepths&&(Ge.depths?vt=tt!=Ge.depths[0]?[tt].concat(Ge.depths):Ge.depths:vt=[tt]);function Ar(hr){return""+$.main(Ze,hr,Ze.helpers,Ze.partials,it,Lt,vt)}return Ar=se($.main,Ar,Ze,Ge.depths||[],it,Lt),Ar(tt,Ge)}return kt.isTop=!0,kt._setup=function(tt){if(tt.partial)Ze.protoAccessControl=tt.protoAccessControl,Ze.helpers=tt.helpers,Ze.partials=tt.partials,Ze.decorators=tt.decorators,Ze.hooks=tt.hooks;else{var Ge=b.extend({},de.helpers,tt.helpers);oe(Ge,Ze),Ze.helpers=Ge,$.usePartial&&(Ze.partials=Ze.mergeIfNeeded(tt.partials,de.partials)),($.usePartial||$.useDecorators)&&(Ze.decorators=b.extend({},de.decorators,tt.decorators)),Ze.hooks={},Ze.protoAccessControl=P.createProtoAccessControl(tt);var it=tt.allowCallsToHelperMissing||Ce;s.moveHelperToHooks(Ze,"helperMissing",it),s.moveHelperToHooks(Ze,"blockHelperMissing",it)}},kt._child=function(tt,Ge,it,vt){if($.useBlockParams&&!it)throw new T.default("must pass block params");if($.useDepths&&!vt)throw new T.default("must pass parent depths");return M(Ze,tt,$[tt],Ge,0,it,vt)},kt}function M($,de,Ce,Re,Ze,kt,tt){function Ge(it){var vt=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],Lt=tt;return tt&&it!=tt[0]&&!(it===$.nullContext&&tt[0]===null)&&(Lt=[it].concat(tt)),Ce($,it,$.helpers,$.partials,vt.data||Re,kt&&[vt.blockParams].concat(kt),Lt)}return Ge=se(Ce,Ge,$,tt,Re,kt),Ge.program=de,Ge.depth=tt?tt.length:0,Ge.blockParams=Ze||0,Ge}function E($,de,Ce){return $?!$.call&&!Ce.name&&(Ce.name=$,$=Ce.partials[$]):Ce.name==="@partial-block"?$=Ce.data["partial-block"]:$=Ce.partials[Ce.name],$}function C($,de,Ce){var Re=Ce.data&&Ce.data["partial-block"];Ce.partial=!0,Ce.ids&&(Ce.data.contextPath=Ce.ids[0]||Ce.data.contextPath);var Ze=void 0;if(Ce.fn&&Ce.fn!==W&&function(){Ce.data=x.createFrame(Ce.data);var kt=Ce.fn;Ze=Ce.data["partial-block"]=function(Ge){var it=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];return it.data=x.createFrame(it.data),it.data["partial-block"]=Re,kt(Ge,it)},kt.partials&&(Ce.partials=b.extend({},Ce.partials,kt.partials))}(),$===void 0&&Ze&&($=Ze),$===void 0)throw new T.default("The partial "+Ce.name+" could not be found");if($ instanceof Function)return $(de,Ce)}function W(){return""}function J($,de){return(!de||!("root"in de))&&(de=de?x.createFrame(de):{},de.root=$),de}function se($,de,Ce,Re,Ze,kt){if($.decorator){var tt={};de=$.decorator(de,tt,Ce,Re&&Re[0],Ze,kt,Re),b.extend(de,tt)}return de}function oe($,de){Object.keys($).forEach(function(Ce){var Re=$[Ce];$[Ce]=Se(Re,de)})}function Se($,de){var Ce=de.lookupProperty;return V.wrapHelper($,function(Re){return b.extend({lookupProperty:Ce},Re)})}return is}var Vu={exports:{}},qm;function sy(){return qm||(qm=1,function(u,f){f.__esModule=!0,f.default=function(_){(function(){typeof globalThis!="object"&&(Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var b=globalThis.Handlebars;_.noConflict=function(){return globalThis.Handlebars===_&&(globalThis.Handlebars=b),_}},u.exports=f.default}(Vu,Vu.exports)),Vu.exports}var Um;function L2(){return Um||(Um=1,function(u,f){f.__esModule=!0;function _(oe){return oe&&oe.__esModule?oe:{default:oe}}function b(oe){if(oe&&oe.__esModule)return oe;var Se={};if(oe!=null)for(var $ in oe)Object.prototype.hasOwnProperty.call(oe,$)&&(Se[$]=oe[$]);return Se.default=oe,Se}var k=fd(),T=b(k),x=P2(),s=_(x),V=Sn(),P=_(V),L=Ki(),F=b(L),M=M2(),E=b(M),C=sy(),W=_(C);function J(){var oe=new T.HandlebarsEnvironment;return F.extend(oe,T),oe.SafeString=s.default,oe.Exception=P.default,oe.Utils=F,oe.escapeExpression=F.escapeExpression,oe.VM=E,oe.template=function(Se){return E.template(Se,oe)},oe}var se=J();se.create=J,W.default(se),se.default=se,f.default=se,u.exports=f.default}(bu,bu.exports)),bu.exports}var zu={exports:{}},jm;function oy(){return jm||(jm=1,function(u,f){f.__esModule=!0;var _={helpers:{helperExpression:function(k){return k.type==="SubExpression"||(k.type==="MustacheStatement"||k.type==="BlockStatement")&&!!(k.params&&k.params.length||k.hash)},scopedId:function(k){return/^\.|this\b/.test(k.original)},simpleId:function(k){return k.parts.length===1&&!_.helpers.scopedId(k)&&!k.depth}}};f.default=_,u.exports=f.default}(zu,zu.exports)),zu.exports}var La={},Fu={exports:{}},Wm;function R2(){return Wm||(Wm=1,function(u,f){f.__esModule=!0;var _=function(){var b={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(s,V,P,L,F,M,E){var C=M.length-1;switch(F){case 1:return M[C-1];case 2:this.$=L.prepareProgram(M[C]);break;case 3:this.$=M[C];break;case 4:this.$=M[C];break;case 5:this.$=M[C];break;case 6:this.$=M[C];break;case 7:this.$=M[C];break;case 8:this.$=M[C];break;case 9:this.$={type:"CommentStatement",value:L.stripComment(M[C]),strip:L.stripFlags(M[C],M[C]),loc:L.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:M[C],value:M[C],loc:L.locInfo(this._$)};break;case 11:this.$=L.prepareRawBlock(M[C-2],M[C-1],M[C],this._$);break;case 12:this.$={path:M[C-3],params:M[C-2],hash:M[C-1]};break;case 13:this.$=L.prepareBlock(M[C-3],M[C-2],M[C-1],M[C],!1,this._$);break;case 14:this.$=L.prepareBlock(M[C-3],M[C-2],M[C-1],M[C],!0,this._$);break;case 15:this.$={open:M[C-5],path:M[C-4],params:M[C-3],hash:M[C-2],blockParams:M[C-1],strip:L.stripFlags(M[C-5],M[C])};break;case 16:this.$={path:M[C-4],params:M[C-3],hash:M[C-2],blockParams:M[C-1],strip:L.stripFlags(M[C-5],M[C])};break;case 17:this.$={path:M[C-4],params:M[C-3],hash:M[C-2],blockParams:M[C-1],strip:L.stripFlags(M[C-5],M[C])};break;case 18:this.$={strip:L.stripFlags(M[C-1],M[C-1]),program:M[C]};break;case 19:var W=L.prepareBlock(M[C-2],M[C-1],M[C],M[C],!1,this._$),J=L.prepareProgram([W],M[C-1].loc);J.chained=!0,this.$={strip:M[C-2].strip,program:J,chain:!0};break;case 20:this.$=M[C];break;case 21:this.$={path:M[C-1],strip:L.stripFlags(M[C-2],M[C])};break;case 22:this.$=L.prepareMustache(M[C-3],M[C-2],M[C-1],M[C-4],L.stripFlags(M[C-4],M[C]),this._$);break;case 23:this.$=L.prepareMustache(M[C-3],M[C-2],M[C-1],M[C-4],L.stripFlags(M[C-4],M[C]),this._$);break;case 24:this.$={type:"PartialStatement",name:M[C-3],params:M[C-2],hash:M[C-1],indent:"",strip:L.stripFlags(M[C-4],M[C]),loc:L.locInfo(this._$)};break;case 25:this.$=L.preparePartialBlock(M[C-2],M[C-1],M[C],this._$);break;case 26:this.$={path:M[C-3],params:M[C-2],hash:M[C-1],strip:L.stripFlags(M[C-4],M[C])};break;case 27:this.$=M[C];break;case 28:this.$=M[C];break;case 29:this.$={type:"SubExpression",path:M[C-3],params:M[C-2],hash:M[C-1],loc:L.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:M[C],loc:L.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:L.id(M[C-2]),value:M[C],loc:L.locInfo(this._$)};break;case 32:this.$=L.id(M[C-1]);break;case 33:this.$=M[C];break;case 34:this.$=M[C];break;case 35:this.$={type:"StringLiteral",value:M[C],original:M[C],loc:L.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(M[C]),original:Number(M[C]),loc:L.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:M[C]==="true",original:M[C]==="true",loc:L.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:L.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:L.locInfo(this._$)};break;case 40:this.$=M[C];break;case 41:this.$=M[C];break;case 42:this.$=L.preparePath(!0,M[C],this._$);break;case 43:this.$=L.preparePath(!1,M[C],this._$);break;case 44:M[C-2].push({part:L.id(M[C]),original:M[C],separator:M[C-1]}),this.$=M[C-2];break;case 45:this.$=[{part:L.id(M[C]),original:M[C]}];break;case 46:this.$=[];break;case 47:M[C-1].push(M[C]);break;case 48:this.$=[];break;case 49:M[C-1].push(M[C]);break;case 50:this.$=[];break;case 51:M[C-1].push(M[C]);break;case 58:this.$=[];break;case 59:M[C-1].push(M[C]);break;case 64:this.$=[];break;case 65:M[C-1].push(M[C]);break;case 70:this.$=[];break;case 71:M[C-1].push(M[C]);break;case 78:this.$=[];break;case 79:M[C-1].push(M[C]);break;case 82:this.$=[];break;case 83:M[C-1].push(M[C]);break;case 86:this.$=[];break;case 87:M[C-1].push(M[C]);break;case 90:this.$=[];break;case 91:M[C-1].push(M[C]);break;case 94:this.$=[];break;case 95:M[C-1].push(M[C]);break;case 98:this.$=[M[C]];break;case 99:M[C-1].push(M[C]);break;case 100:this.$=[M[C]];break;case 101:M[C-1].push(M[C]);break}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function(s,V){throw new Error(s)},parse:function(s){var V=this,P=[0],L=[null],F=[],M=this.table,E="",C=0,W=0;this.lexer.setInput(s),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc>"u"&&(this.lexer.yylloc={});var J=this.lexer.yylloc;F.push(J);var se=this.lexer.options&&this.lexer.options.ranges;typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError);function oe(){var vt;return vt=V.lexer.lex()||1,typeof vt!="number"&&(vt=V.symbols_[vt]||vt),vt}for(var Se,$,de,Ce,Re={},Ze,kt,tt,Ge;;){if($=P[P.length-1],this.defaultActions[$]?de=this.defaultActions[$]:((Se===null||typeof Se>"u")&&(Se=oe()),de=M[$]&&M[$][Se]),typeof de>"u"||!de.length||!de[0]){var it="";{Ge=[];for(Ze in M[$])this.terminals_[Ze]&&Ze>2&&Ge.push("'"+this.terminals_[Ze]+"'");this.lexer.showPosition?it="Parse error on line "+(C+1)+`:
806
- `+this.lexer.showPosition()+`
807
- Expecting `+Ge.join(", ")+", got '"+(this.terminals_[Se]||Se)+"'":it="Parse error on line "+(C+1)+": Unexpected "+(Se==1?"end of input":"'"+(this.terminals_[Se]||Se)+"'"),this.parseError(it,{text:this.lexer.match,token:this.terminals_[Se]||Se,line:this.lexer.yylineno,loc:J,expected:Ge})}}if(de[0]instanceof Array&&de.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+Se);switch(de[0]){case 1:P.push(Se),L.push(this.lexer.yytext),F.push(this.lexer.yylloc),P.push(de[1]),Se=null,W=this.lexer.yyleng,E=this.lexer.yytext,C=this.lexer.yylineno,J=this.lexer.yylloc;break;case 2:if(kt=this.productions_[de[1]][1],Re.$=L[L.length-kt],Re._$={first_line:F[F.length-(kt||1)].first_line,last_line:F[F.length-1].last_line,first_column:F[F.length-(kt||1)].first_column,last_column:F[F.length-1].last_column},se&&(Re._$.range=[F[F.length-(kt||1)].range[0],F[F.length-1].range[1]]),Ce=this.performAction.call(Re,E,W,C,this.yy,de[1],L,F),typeof Ce<"u")return Ce;kt&&(P=P.slice(0,-1*kt*2),L=L.slice(0,-1*kt),F=F.slice(0,-1*kt)),P.push(this.productions_[de[1]][0]),L.push(Re.$),F.push(Re._$),tt=M[P[P.length-2]][P[P.length-1]],P.push(tt);break;case 3:return!0}}return!0}},k=function(){var x={EOF:1,parseError:function(V,P){if(this.yy.parser)this.yy.parser.parseError(V,P);else throw new Error(V)},setInput:function(V){return this._input=V,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var V=this._input[0];this.yytext+=V,this.yyleng++,this.offset++,this.match+=V,this.matched+=V;var P=V.match(/(?:\r\n?|\n).*/g);return P?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),V},unput:function(V){var P=V.length,L=V.split(/(?:\r\n?|\n)/g);this._input=V+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-P-1),this.offset-=P;var F=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),L.length-1&&(this.yylineno-=L.length-1);var M=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:L?(L.length===F.length?this.yylloc.first_column:0)+F[F.length-L.length].length-L[0].length:this.yylloc.first_column-P},this.options.ranges&&(this.yylloc.range=[M[0],M[0]+this.yyleng-P]),this},more:function(){return this._more=!0,this},less:function(V){this.unput(this.match.slice(V))},pastInput:function(){var V=this.matched.substr(0,this.matched.length-this.match.length);return(V.length>20?"...":"")+V.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var V=this.match;return V.length<20&&(V+=this._input.substr(0,20-V.length)),(V.substr(0,20)+(V.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var V=this.pastInput(),P=new Array(V.length+1).join("-");return V+this.upcomingInput()+`
808
- `+P+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var V,P,L,F,M;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),C=0;C<E.length&&(L=this._input.match(this.rules[E[C]]),!(L&&(!P||L[0].length>P[0].length)&&(P=L,F=C,!this.options.flex)));C++);return P?(M=P[0].match(/(?:\r\n?|\n).*/g),M&&(this.yylineno+=M.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:M?M[M.length-1].length-M[M.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+P[0].length},this.yytext+=P[0],this.match+=P[0],this.matches=P,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(P[0].length),this.matched+=P[0],V=this.performAction.call(this,this.yy,this,E[F],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),V||void 0):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
809
- `+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var V=this.next();return typeof V<"u"?V:this.lex()},begin:function(V){this.conditionStack.push(V)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(V){this.begin(V)}};return x.options={},x.performAction=function(V,P,L,F){function M(E,C){return P.yytext=P.yytext.substring(E,P.yyleng-C+E)}switch(L){case 0:if(P.yytext.slice(-2)==="\\\\"?(M(0,1),this.begin("mu")):P.yytext.slice(-1)==="\\"?(M(0,1),this.begin("emu")):this.begin("mu"),P.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw"?15:(M(5,9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(P.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return P.yytext=M(1,2).replace(/\\"/g,'"'),80;case 32:return P.yytext=M(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return P.yytext=P.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},x.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],x.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},x}();b.lexer=k;function T(){this.yy={}}return T.prototype=b,b.Parser=T,new T}();f.default=_,u.exports=f.default}(Fu,Fu.exports)),Fu.exports}var Ou={exports:{}},Nu={exports:{}},Hm;function ay(){return Hm||(Hm=1,function(u,f){f.__esModule=!0;function _(P){return P&&P.__esModule?P:{default:P}}var b=Sn(),k=_(b);function T(){this.parents=[]}T.prototype={constructor:T,mutating:!1,acceptKey:function(L,F){var M=this.accept(L[F]);if(this.mutating){if(M&&!T.prototype[M.type])throw new k.default('Unexpected node type "'+M.type+'" found when accepting '+F+" on "+L.type);L[F]=M}},acceptRequired:function(L,F){if(this.acceptKey(L,F),!L[F])throw new k.default(L.type+" requires "+F)},acceptArray:function(L){for(var F=0,M=L.length;F<M;F++)this.acceptKey(L,F),L[F]||(L.splice(F,1),F--,M--)},accept:function(L){if(L){if(!this[L.type])throw new k.default("Unknown type: "+L.type,L);this.current&&this.parents.unshift(this.current),this.current=L;var F=this[L.type](L);if(this.current=this.parents.shift(),!this.mutating||F)return F;if(F!==!1)return L}},Program:function(L){this.acceptArray(L.body)},MustacheStatement:x,Decorator:x,BlockStatement:s,DecoratorBlock:s,PartialStatement:V,PartialBlockStatement:function(L){V.call(this,L),this.acceptKey(L,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:x,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(L){this.acceptArray(L.pairs)},HashPair:function(L){this.acceptRequired(L,"value")}};function x(P){this.acceptRequired(P,"path"),this.acceptArray(P.params),this.acceptKey(P,"hash")}function s(P){x.call(this,P),this.acceptKey(P,"program"),this.acceptKey(P,"inverse")}function V(P){this.acceptRequired(P,"name"),this.acceptArray(P.params),this.acceptKey(P,"hash")}f.default=T,u.exports=f.default}(Nu,Nu.exports)),Nu.exports}var Zm;function B2(){return Zm||(Zm=1,function(u,f){f.__esModule=!0;function _(L){return L&&L.__esModule?L:{default:L}}var b=ay(),k=_(b);function T(){var L=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=L}T.prototype=new k.default,T.prototype.Program=function(L){var F=!this.options.ignoreStandalone,M=!this.isRootSeen;this.isRootSeen=!0;for(var E=L.body,C=0,W=E.length;C<W;C++){var J=E[C],se=this.accept(J);if(se){var oe=x(E,C,M),Se=s(E,C,M),$=se.openStandalone&&oe,de=se.closeStandalone&&Se,Ce=se.inlineStandalone&&oe&&Se;se.close&&V(E,C,!0),se.open&&P(E,C,!0),F&&Ce&&(V(E,C),P(E,C)&&J.type==="PartialStatement"&&(J.indent=/([ \t]+$)/.exec(E[C-1].original)[1])),F&&$&&(V((J.program||J.inverse).body),P(E,C)),F&&de&&(V(E,C),P((J.inverse||J.program).body))}}return L},T.prototype.BlockStatement=T.prototype.DecoratorBlock=T.prototype.PartialBlockStatement=function(L){this.accept(L.program),this.accept(L.inverse);var F=L.program||L.inverse,M=L.program&&L.inverse,E=M,C=M;if(M&&M.chained)for(E=M.body[0].program;C.chained;)C=C.body[C.body.length-1].program;var W={open:L.openStrip.open,close:L.closeStrip.close,openStandalone:s(F.body),closeStandalone:x((E||F).body)};if(L.openStrip.close&&V(F.body,null,!0),M){var J=L.inverseStrip;J.open&&P(F.body,null,!0),J.close&&V(E.body,null,!0),L.closeStrip.open&&P(C.body,null,!0),!this.options.ignoreStandalone&&x(F.body)&&s(E.body)&&(P(F.body),V(E.body))}else L.closeStrip.open&&P(F.body,null,!0);return W},T.prototype.Decorator=T.prototype.MustacheStatement=function(L){return L.strip},T.prototype.PartialStatement=T.prototype.CommentStatement=function(L){var F=L.strip||{};return{inlineStandalone:!0,open:F.open,close:F.close}};function x(L,F,M){F===void 0&&(F=L.length);var E=L[F-1],C=L[F-2];if(!E)return M;if(E.type==="ContentStatement")return(C||!M?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(E.original)}function s(L,F,M){F===void 0&&(F=-1);var E=L[F+1],C=L[F+2];if(!E)return M;if(E.type==="ContentStatement")return(C||!M?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(E.original)}function V(L,F,M){var E=L[F==null?0:F+1];if(!(!E||E.type!=="ContentStatement"||!M&&E.rightStripped)){var C=E.value;E.value=E.value.replace(M?/^\s+/:/^[ \t]*\r?\n?/,""),E.rightStripped=E.value!==C}}function P(L,F,M){var E=L[F==null?L.length-1:F-1];if(!(!E||E.type!=="ContentStatement"||!M&&E.leftStripped)){var C=E.value;return E.value=E.value.replace(M?/\s+$/:/[ \t]+$/,""),E.leftStripped=E.value!==C,E.leftStripped}}f.default=T,u.exports=f.default}(Ou,Ou.exports)),Ou.exports}var tn={},Km;function D2(){if(Km)return tn;Km=1,tn.__esModule=!0,tn.SourceLocation=k,tn.id=T,tn.stripFlags=x,tn.stripComment=s,tn.preparePath=V,tn.prepareMustache=P,tn.prepareRawBlock=L,tn.prepareBlock=F,tn.prepareProgram=M,tn.preparePartialBlock=E;function u(C){return C&&C.__esModule?C:{default:C}}var f=Sn(),_=u(f);function b(C,W){if(W=W.path?W.path.original:W,C.path.original!==W){var J={loc:C.path.loc};throw new _.default(C.path.original+" doesn't match "+W,J)}}function k(C,W){this.source=C,this.start={line:W.first_line,column:W.first_column},this.end={line:W.last_line,column:W.last_column}}function T(C){return/^\[.*\]$/.test(C)?C.substring(1,C.length-1):C}function x(C,W){return{open:C.charAt(2)==="~",close:W.charAt(W.length-3)==="~"}}function s(C){return C.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function V(C,W,J){J=this.locInfo(J);for(var se=C?"@":"",oe=[],Se=0,$=0,de=W.length;$<de;$++){var Ce=W[$].part,Re=W[$].original!==Ce;if(se+=(W[$].separator||"")+Ce,!Re&&(Ce===".."||Ce==="."||Ce==="this")){if(oe.length>0)throw new _.default("Invalid path: "+se,{loc:J});Ce===".."&&Se++}else oe.push(Ce)}return{type:"PathExpression",data:C,depth:Se,parts:oe,original:se,loc:J}}function P(C,W,J,se,oe,Se){var $=se.charAt(3)||se.charAt(2),de=$!=="{"&&$!=="&",Ce=/\*/.test(se);return{type:Ce?"Decorator":"MustacheStatement",path:C,params:W,hash:J,escaped:de,strip:oe,loc:this.locInfo(Se)}}function L(C,W,J,se){b(C,J),se=this.locInfo(se);var oe={type:"Program",body:W,strip:{},loc:se};return{type:"BlockStatement",path:C.path,params:C.params,hash:C.hash,program:oe,openStrip:{},inverseStrip:{},closeStrip:{},loc:se}}function F(C,W,J,se,oe,Se){se&&se.path&&b(C,se);var $=/\*/.test(C.open);W.blockParams=C.blockParams;var de=void 0,Ce=void 0;if(J){if($)throw new _.default("Unexpected inverse block on decorator",J);J.chain&&(J.program.body[0].closeStrip=se.strip),Ce=J.strip,de=J.program}return oe&&(oe=de,de=W,W=oe),{type:$?"DecoratorBlock":"BlockStatement",path:C.path,params:C.params,hash:C.hash,program:W,inverse:de,openStrip:C.strip,inverseStrip:Ce,closeStrip:se&&se.strip,loc:this.locInfo(Se)}}function M(C,W){if(!W&&C.length){var J=C[0].loc,se=C[C.length-1].loc;J&&se&&(W={source:J.source,start:{line:J.start.line,column:J.start.column},end:{line:se.end.line,column:se.end.column}})}return{type:"Program",body:C,strip:{},loc:W}}function E(C,W,J,se){return b(C,J),{type:"PartialBlockStatement",name:C.path,params:C.params,hash:C.hash,program:W,openStrip:C.strip,closeStrip:J&&J.strip,loc:this.locInfo(se)}}return tn}var Gm;function V2(){if(Gm)return La;Gm=1,La.__esModule=!0,La.parseWithoutProcessing=L,La.parse=F;function u(M){if(M&&M.__esModule)return M;var E={};if(M!=null)for(var C in M)Object.prototype.hasOwnProperty.call(M,C)&&(E[C]=M[C]);return E.default=M,E}function f(M){return M&&M.__esModule?M:{default:M}}var _=R2(),b=f(_),k=B2(),T=f(k),x=D2(),s=u(x),V=Ki();La.parser=b.default;var P={};V.extend(P,s);function L(M,E){if(M.type==="Program")return M;b.default.yy=P,P.locInfo=function(W){return new P.SourceLocation(E&&E.srcName,W)};var C=b.default.parse(M);return C}function F(M,E){var C=L(M,E),W=new T.default(E);return W.accept(C)}return La}var Ra={},Jm;function z2(){if(Jm)return Ra;Jm=1,Ra.__esModule=!0,Ra.Compiler=s,Ra.precompile=V,Ra.compile=P;function u(M){return M&&M.__esModule?M:{default:M}}var f=Sn(),_=u(f),b=Ki(),k=oy(),T=u(k),x=[].slice;function s(){}s.prototype={compiler:s,equals:function(E){var C=this.opcodes.length;if(E.opcodes.length!==C)return!1;for(var W=0;W<C;W++){var J=this.opcodes[W],se=E.opcodes[W];if(J.opcode!==se.opcode||!L(J.args,se.args))return!1}C=this.children.length;for(var W=0;W<C;W++)if(!this.children[W].equals(E.children[W]))return!1;return!0},guid:0,compile:function(E,C){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=C,this.stringParams=C.stringParams,this.trackIds=C.trackIds,C.blockParams=C.blockParams||[],C.knownHelpers=b.extend(Object.create(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},C.knownHelpers),this.accept(E)},compileProgram:function(E){var C=new this.compiler,W=C.compile(E,this.options),J=this.guid++;return this.usePartial=this.usePartial||W.usePartial,this.children[J]=W,this.useDepths=this.useDepths||W.useDepths,J},accept:function(E){if(!this[E.type])throw new _.default("Unknown type: "+E.type,E);this.sourceNode.unshift(E);var C=this[E.type](E);return this.sourceNode.shift(),C},Program:function(E){this.options.blockParams.unshift(E.blockParams);for(var C=E.body,W=C.length,J=0;J<W;J++)this.accept(C[J]);return this.options.blockParams.shift(),this.isSimple=W===1,this.blockParams=E.blockParams?E.blockParams.length:0,this},BlockStatement:function(E){F(E);var C=E.program,W=E.inverse;C=C&&this.compileProgram(C),W=W&&this.compileProgram(W);var J=this.classifySexpr(E);J==="helper"?this.helperSexpr(E,C,W):J==="simple"?(this.simpleSexpr(E),this.opcode("pushProgram",C),this.opcode("pushProgram",W),this.opcode("emptyHash"),this.opcode("blockValue",E.path.original)):(this.ambiguousSexpr(E,C,W),this.opcode("pushProgram",C),this.opcode("pushProgram",W),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(E){var C=E.program&&this.compileProgram(E.program),W=this.setupFullMustacheParams(E,C,void 0),J=E.path;this.useDecorators=!0,this.opcode("registerDecorator",W.length,J.original)},PartialStatement:function(E){this.usePartial=!0;var C=E.program;C&&(C=this.compileProgram(E.program));var W=E.params;if(W.length>1)throw new _.default("Unsupported number of partial arguments: "+W.length,E);W.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):W.push({type:"PathExpression",parts:[],depth:0}));var J=E.name.original,se=E.name.type==="SubExpression";se&&this.accept(E.name),this.setupFullMustacheParams(E,C,void 0,!0);var oe=E.indent||"";this.options.preventIndent&&oe&&(this.opcode("appendContent",oe),oe=""),this.opcode("invokePartial",se,J,oe),this.opcode("append")},PartialBlockStatement:function(E){this.PartialStatement(E)},MustacheStatement:function(E){this.SubExpression(E),E.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(E){this.DecoratorBlock(E)},ContentStatement:function(E){E.value&&this.opcode("appendContent",E.value)},CommentStatement:function(){},SubExpression:function(E){F(E);var C=this.classifySexpr(E);C==="simple"?this.simpleSexpr(E):C==="helper"?this.helperSexpr(E):this.ambiguousSexpr(E)},ambiguousSexpr:function(E,C,W){var J=E.path,se=J.parts[0],oe=C!=null||W!=null;this.opcode("getContext",J.depth),this.opcode("pushProgram",C),this.opcode("pushProgram",W),J.strict=!0,this.accept(J),this.opcode("invokeAmbiguous",se,oe)},simpleSexpr:function(E){var C=E.path;C.strict=!0,this.accept(C),this.opcode("resolvePossibleLambda")},helperSexpr:function(E,C,W){var J=this.setupFullMustacheParams(E,C,W),se=E.path,oe=se.parts[0];if(this.options.knownHelpers[oe])this.opcode("invokeKnownHelper",J.length,oe);else{if(this.options.knownHelpersOnly)throw new _.default("You specified knownHelpersOnly, but used the unknown helper "+oe,E);se.strict=!0,se.falsy=!0,this.accept(se),this.opcode("invokeHelper",J.length,se.original,T.default.helpers.simpleId(se))}},PathExpression:function(E){this.addDepth(E.depth),this.opcode("getContext",E.depth);var C=E.parts[0],W=T.default.helpers.scopedId(E),J=!E.depth&&!W&&this.blockParamIndex(C);J?this.opcode("lookupBlockParam",J,E.parts):C?E.data?(this.options.data=!0,this.opcode("lookupData",E.depth,E.parts,E.strict)):this.opcode("lookupOnContext",E.parts,E.falsy,E.strict,W):this.opcode("pushContext")},StringLiteral:function(E){this.opcode("pushString",E.value)},NumberLiteral:function(E){this.opcode("pushLiteral",E.value)},BooleanLiteral:function(E){this.opcode("pushLiteral",E.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(E){var C=E.pairs,W=0,J=C.length;for(this.opcode("pushHash");W<J;W++)this.pushParam(C[W].value);for(;W--;)this.opcode("assignToHash",C[W].key);this.opcode("popHash")},opcode:function(E){this.opcodes.push({opcode:E,args:x.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(E){E&&(this.useDepths=!0)},classifySexpr:function(E){var C=T.default.helpers.simpleId(E.path),W=C&&!!this.blockParamIndex(E.path.parts[0]),J=!W&&T.default.helpers.helperExpression(E),se=!W&&(J||C);if(se&&!J){var oe=E.path.parts[0],Se=this.options;Se.knownHelpers[oe]?J=!0:Se.knownHelpersOnly&&(se=!1)}return J?"helper":se?"ambiguous":"simple"},pushParams:function(E){for(var C=0,W=E.length;C<W;C++)this.pushParam(E[C])},pushParam:function(E){var C=E.value!=null?E.value:E.original||"";if(this.stringParams)C.replace&&(C=C.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),E.depth&&this.addDepth(E.depth),this.opcode("getContext",E.depth||0),this.opcode("pushStringParam",C,E.type),E.type==="SubExpression"&&this.accept(E);else{if(this.trackIds){var W=void 0;if(E.parts&&!T.default.helpers.scopedId(E)&&!E.depth&&(W=this.blockParamIndex(E.parts[0])),W){var J=E.parts.slice(1).join(".");this.opcode("pushId","BlockParam",W,J)}else C=E.original||C,C.replace&&(C=C.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",E.type,C)}this.accept(E)}},setupFullMustacheParams:function(E,C,W,J){var se=E.params;return this.pushParams(se),this.opcode("pushProgram",C),this.opcode("pushProgram",W),E.hash?this.accept(E.hash):this.opcode("emptyHash",J),se},blockParamIndex:function(E){for(var C=0,W=this.options.blockParams.length;C<W;C++){var J=this.options.blockParams[C],se=J&&b.indexOf(J,E);if(J&&se>=0)return[C,se]}}};function V(M,E,C){if(M==null||typeof M!="string"&&M.type!=="Program")throw new _.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+M);E=E||{},"data"in E||(E.data=!0),E.compat&&(E.useDepths=!0);var W=C.parse(M,E),J=new C.Compiler().compile(W,E);return new C.JavaScriptCompiler().compile(J,E)}function P(M,E,C){if(E===void 0&&(E={}),M==null||typeof M!="string"&&M.type!=="Program")throw new _.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+M);E=b.extend({},E),"data"in E||(E.data=!0),E.compat&&(E.useDepths=!0);var W=void 0;function J(){var oe=C.parse(M,E),Se=new C.Compiler().compile(oe,E),$=new C.JavaScriptCompiler().compile(Se,E,void 0,!0);return C.template($)}function se(oe,Se){return W||(W=J()),W.call(this,oe,Se)}return se._setup=function(oe){return W||(W=J()),W._setup(oe)},se._child=function(oe,Se,$,de){return W||(W=J()),W._child(oe,Se,$,de)},se}function L(M,E){if(M===E)return!0;if(b.isArray(M)&&b.isArray(E)&&M.length===E.length){for(var C=0;C<M.length;C++)if(!L(M[C],E[C]))return!1;return!0}}function F(M){if(!M.path.parts){var E=M.path;M.path={type:"PathExpression",data:!1,depth:0,parts:[E.original+""],original:E.original+"",loc:E.loc}}}return Ra}var qu={exports:{}},Uu={exports:{}},Yl={},Vp={},ju={},Wu={},Xm;function F2(){if(Xm)return Wu;Xm=1;var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");return Wu.encode=function(f){if(0<=f&&f<u.length)return u[f];throw new TypeError("Must be between 0 and 63: "+f)},Wu.decode=function(f){var _=65,b=90,k=97,T=122,x=48,s=57,V=43,P=47,L=26,F=52;return _<=f&&f<=b?f-_:k<=f&&f<=T?f-k+L:x<=f&&f<=s?f-x+F:f==V?62:f==P?63:-1},Wu}var Qm;function ly(){if(Qm)return ju;Qm=1;var u=F2(),f=5,_=1<<f,b=_-1,k=_;function T(s){return s<0?(-s<<1)+1:(s<<1)+0}function x(s){var V=(s&1)===1,P=s>>1;return V?-P:P}return ju.encode=function(V){var P="",L,F=T(V);do L=F&b,F>>>=f,F>0&&(L|=k),P+=u.encode(L);while(F>0);return P},ju.decode=function(V,P,L){var F=V.length,M=0,E=0,C,W;do{if(P>=F)throw new Error("Expected more digits in base 64 VLQ value.");if(W=u.decode(V.charCodeAt(P++)),W===-1)throw new Error("Invalid base64 digit: "+V.charAt(P-1));C=!!(W&k),W&=b,M=M+(W<<E),E+=f}while(C);L.value=x(M),L.rest=P},ju}var zp={},Ym;function oc(){return Ym||(Ym=1,function(u){function f($,de,Ce){if(de in $)return $[de];if(arguments.length===3)return Ce;throw new Error('"'+de+'" is a required argument.')}u.getArg=f;var _=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,b=/^data:.+\,.+$/;function k($){var de=$.match(_);return de?{scheme:de[1],auth:de[2],host:de[3],port:de[4],path:de[5]}:null}u.urlParse=k;function T($){var de="";return $.scheme&&(de+=$.scheme+":"),de+="//",$.auth&&(de+=$.auth+"@"),$.host&&(de+=$.host),$.port&&(de+=":"+$.port),$.path&&(de+=$.path),de}u.urlGenerate=T;function x($){var de=$,Ce=k($);if(Ce){if(!Ce.path)return $;de=Ce.path}for(var Re=u.isAbsolute(de),Ze=de.split(/\/+/),kt,tt=0,Ge=Ze.length-1;Ge>=0;Ge--)kt=Ze[Ge],kt==="."?Ze.splice(Ge,1):kt===".."?tt++:tt>0&&(kt===""?(Ze.splice(Ge+1,tt),tt=0):(Ze.splice(Ge,2),tt--));return de=Ze.join("/"),de===""&&(de=Re?"/":"."),Ce?(Ce.path=de,T(Ce)):de}u.normalize=x;function s($,de){$===""&&($="."),de===""&&(de=".");var Ce=k(de),Re=k($);if(Re&&($=Re.path||"/"),Ce&&!Ce.scheme)return Re&&(Ce.scheme=Re.scheme),T(Ce);if(Ce||de.match(b))return de;if(Re&&!Re.host&&!Re.path)return Re.host=de,T(Re);var Ze=de.charAt(0)==="/"?de:x($.replace(/\/+$/,"")+"/"+de);return Re?(Re.path=Ze,T(Re)):Ze}u.join=s,u.isAbsolute=function($){return $.charAt(0)==="/"||_.test($)};function V($,de){$===""&&($="."),$=$.replace(/\/$/,"");for(var Ce=0;de.indexOf($+"/")!==0;){var Re=$.lastIndexOf("/");if(Re<0||($=$.slice(0,Re),$.match(/^([^\/]+:\/)?\/*$/)))return de;++Ce}return Array(Ce+1).join("../")+de.substr($.length+1)}u.relative=V;var P=function(){var $=Object.create(null);return!("__proto__"in $)}();function L($){return $}function F($){return E($)?"$"+$:$}u.toSetString=P?L:F;function M($){return E($)?$.slice(1):$}u.fromSetString=P?L:M;function E($){if(!$)return!1;var de=$.length;if(de<9||$.charCodeAt(de-1)!==95||$.charCodeAt(de-2)!==95||$.charCodeAt(de-3)!==111||$.charCodeAt(de-4)!==116||$.charCodeAt(de-5)!==111||$.charCodeAt(de-6)!==114||$.charCodeAt(de-7)!==112||$.charCodeAt(de-8)!==95||$.charCodeAt(de-9)!==95)return!1;for(var Ce=de-10;Ce>=0;Ce--)if($.charCodeAt(Ce)!==36)return!1;return!0}function C($,de,Ce){var Re=J($.source,de.source);return Re!==0||(Re=$.originalLine-de.originalLine,Re!==0)||(Re=$.originalColumn-de.originalColumn,Re!==0||Ce)||(Re=$.generatedColumn-de.generatedColumn,Re!==0)||(Re=$.generatedLine-de.generatedLine,Re!==0)?Re:J($.name,de.name)}u.compareByOriginalPositions=C;function W($,de,Ce){var Re=$.generatedLine-de.generatedLine;return Re!==0||(Re=$.generatedColumn-de.generatedColumn,Re!==0||Ce)||(Re=J($.source,de.source),Re!==0)||(Re=$.originalLine-de.originalLine,Re!==0)||(Re=$.originalColumn-de.originalColumn,Re!==0)?Re:J($.name,de.name)}u.compareByGeneratedPositionsDeflated=W;function J($,de){return $===de?0:$===null?1:de===null?-1:$>de?1:-1}function se($,de){var Ce=$.generatedLine-de.generatedLine;return Ce!==0||(Ce=$.generatedColumn-de.generatedColumn,Ce!==0)||(Ce=J($.source,de.source),Ce!==0)||(Ce=$.originalLine-de.originalLine,Ce!==0)||(Ce=$.originalColumn-de.originalColumn,Ce!==0)?Ce:J($.name,de.name)}u.compareByGeneratedPositionsInflated=se;function oe($){return JSON.parse($.replace(/^\)]}'[^\n]*\n/,""))}u.parseSourceMapInput=oe;function Se($,de,Ce){if(de=de||"",$&&($[$.length-1]!=="/"&&de[0]!=="/"&&($+="/"),de=$+de),Ce){var Re=k(Ce);if(!Re)throw new Error("sourceMapURL could not be parsed");if(Re.path){var Ze=Re.path.lastIndexOf("/");Ze>=0&&(Re.path=Re.path.substring(0,Ze+1))}de=s(T(Re),de)}return x(de)}u.computeSourceURL=Se}(zp)),zp}var Fp={},$m;function cy(){if($m)return Fp;$m=1;var u=oc(),f=Object.prototype.hasOwnProperty,_=typeof Map<"u";function b(){this._array=[],this._set=_?new Map:Object.create(null)}return b.fromArray=function(T,x){for(var s=new b,V=0,P=T.length;V<P;V++)s.add(T[V],x);return s},b.prototype.size=function(){return _?this._set.size:Object.getOwnPropertyNames(this._set).length},b.prototype.add=function(T,x){var s=_?T:u.toSetString(T),V=_?this.has(T):f.call(this._set,s),P=this._array.length;(!V||x)&&this._array.push(T),V||(_?this._set.set(T,P):this._set[s]=P)},b.prototype.has=function(T){if(_)return this._set.has(T);var x=u.toSetString(T);return f.call(this._set,x)},b.prototype.indexOf=function(T){if(_){var x=this._set.get(T);if(x>=0)return x}else{var s=u.toSetString(T);if(f.call(this._set,s))return this._set[s]}throw new Error('"'+T+'" is not in the set.')},b.prototype.at=function(T){if(T>=0&&T<this._array.length)return this._array[T];throw new Error("No element indexed by "+T)},b.prototype.toArray=function(){return this._array.slice()},Fp.ArraySet=b,Fp}var Op={},eg;function O2(){if(eg)return Op;eg=1;var u=oc();function f(b,k){var T=b.generatedLine,x=k.generatedLine,s=b.generatedColumn,V=k.generatedColumn;return x>T||x==T&&V>=s||u.compareByGeneratedPositionsInflated(b,k)<=0}function _(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}return _.prototype.unsortedForEach=function(k,T){this._array.forEach(k,T)},_.prototype.add=function(k){f(this._last,k)?(this._last=k,this._array.push(k)):(this._sorted=!1,this._array.push(k))},_.prototype.toArray=function(){return this._sorted||(this._array.sort(u.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},Op.MappingList=_,Op}var tg;function uy(){if(tg)return Vp;tg=1;var u=ly(),f=oc(),_=cy().ArraySet,b=O2().MappingList;function k(T){T||(T={}),this._file=f.getArg(T,"file",null),this._sourceRoot=f.getArg(T,"sourceRoot",null),this._skipValidation=f.getArg(T,"skipValidation",!1),this._sources=new _,this._names=new _,this._mappings=new b,this._sourcesContents=null}return k.prototype._version=3,k.fromSourceMap=function(x){var s=x.sourceRoot,V=new k({file:x.file,sourceRoot:s});return x.eachMapping(function(P){var L={generated:{line:P.generatedLine,column:P.generatedColumn}};P.source!=null&&(L.source=P.source,s!=null&&(L.source=f.relative(s,L.source)),L.original={line:P.originalLine,column:P.originalColumn},P.name!=null&&(L.name=P.name)),V.addMapping(L)}),x.sources.forEach(function(P){var L=P;s!==null&&(L=f.relative(s,P)),V._sources.has(L)||V._sources.add(L);var F=x.sourceContentFor(P);F!=null&&V.setSourceContent(P,F)}),V},k.prototype.addMapping=function(x){var s=f.getArg(x,"generated"),V=f.getArg(x,"original",null),P=f.getArg(x,"source",null),L=f.getArg(x,"name",null);this._skipValidation||this._validateMapping(s,V,P,L),P!=null&&(P=String(P),this._sources.has(P)||this._sources.add(P)),L!=null&&(L=String(L),this._names.has(L)||this._names.add(L)),this._mappings.add({generatedLine:s.line,generatedColumn:s.column,originalLine:V!=null&&V.line,originalColumn:V!=null&&V.column,source:P,name:L})},k.prototype.setSourceContent=function(x,s){var V=x;this._sourceRoot!=null&&(V=f.relative(this._sourceRoot,V)),s!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[f.toSetString(V)]=s):this._sourcesContents&&(delete this._sourcesContents[f.toSetString(V)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},k.prototype.applySourceMap=function(x,s,V){var P=s;if(s==null){if(x.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);P=x.file}var L=this._sourceRoot;L!=null&&(P=f.relative(L,P));var F=new _,M=new _;this._mappings.unsortedForEach(function(E){if(E.source===P&&E.originalLine!=null){var C=x.originalPositionFor({line:E.originalLine,column:E.originalColumn});C.source!=null&&(E.source=C.source,V!=null&&(E.source=f.join(V,E.source)),L!=null&&(E.source=f.relative(L,E.source)),E.originalLine=C.line,E.originalColumn=C.column,C.name!=null&&(E.name=C.name))}var W=E.source;W!=null&&!F.has(W)&&F.add(W);var J=E.name;J!=null&&!M.has(J)&&M.add(J)},this),this._sources=F,this._names=M,x.sources.forEach(function(E){var C=x.sourceContentFor(E);C!=null&&(V!=null&&(E=f.join(V,E)),L!=null&&(E=f.relative(L,E)),this.setSourceContent(E,C))},this)},k.prototype._validateMapping=function(x,s,V,P){if(s&&typeof s.line!="number"&&typeof s.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(x&&"line"in x&&"column"in x&&x.line>0&&x.column>=0&&!s&&!V&&!P)){if(x&&"line"in x&&"column"in x&&s&&"line"in s&&"column"in s&&x.line>0&&x.column>=0&&s.line>0&&s.column>=0&&V)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:x,source:V,original:s,name:P}))}},k.prototype._serializeMappings=function(){for(var x=0,s=1,V=0,P=0,L=0,F=0,M="",E,C,W,J,se=this._mappings.toArray(),oe=0,Se=se.length;oe<Se;oe++){if(C=se[oe],E="",C.generatedLine!==s)for(x=0;C.generatedLine!==s;)E+=";",s++;else if(oe>0){if(!f.compareByGeneratedPositionsInflated(C,se[oe-1]))continue;E+=","}E+=u.encode(C.generatedColumn-x),x=C.generatedColumn,C.source!=null&&(J=this._sources.indexOf(C.source),E+=u.encode(J-F),F=J,E+=u.encode(C.originalLine-1-P),P=C.originalLine-1,E+=u.encode(C.originalColumn-V),V=C.originalColumn,C.name!=null&&(W=this._names.indexOf(C.name),E+=u.encode(W-L),L=W)),M+=E}return M},k.prototype._generateSourcesContent=function(x,s){return x.map(function(V){if(!this._sourcesContents)return null;s!=null&&(V=f.relative(s,V));var P=f.toSetString(V);return Object.prototype.hasOwnProperty.call(this._sourcesContents,P)?this._sourcesContents[P]:null},this)},k.prototype.toJSON=function(){var x={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(x.file=this._file),this._sourceRoot!=null&&(x.sourceRoot=this._sourceRoot),this._sourcesContents&&(x.sourcesContent=this._generateSourcesContent(x.sources,x.sourceRoot)),x},k.prototype.toString=function(){return JSON.stringify(this.toJSON())},Vp.SourceMapGenerator=k,Vp}var $l={},Np={},rg;function N2(){return rg||(rg=1,function(u){u.GREATEST_LOWER_BOUND=1,u.LEAST_UPPER_BOUND=2;function f(_,b,k,T,x,s){var V=Math.floor((b-_)/2)+_,P=x(k,T[V],!0);return P===0?V:P>0?b-V>1?f(V,b,k,T,x,s):s==u.LEAST_UPPER_BOUND?b<T.length?b:-1:V:V-_>1?f(_,V,k,T,x,s):s==u.LEAST_UPPER_BOUND?V:_<0?-1:_}u.search=function(b,k,T,x){if(k.length===0)return-1;var s=f(-1,k.length,b,k,T,x||u.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&T(k[s],k[s-1],!0)===0;)--s;return s}}(Np)),Np}var qp={},ig;function q2(){if(ig)return qp;ig=1;function u(b,k,T){var x=b[k];b[k]=b[T],b[T]=x}function f(b,k){return Math.round(b+Math.random()*(k-b))}function _(b,k,T,x){if(T<x){var s=f(T,x),V=T-1;u(b,s,x);for(var P=b[x],L=T;L<x;L++)k(b[L],P)<=0&&(V+=1,u(b,V,L));u(b,V+1,L);var F=V+1;_(b,k,T,F-1),_(b,k,F+1,x)}}return qp.quickSort=function(b,k){_(b,k,0,b.length-1)},qp}var ng;function U2(){if(ng)return $l;ng=1;var u=oc(),f=N2(),_=cy().ArraySet,b=ly(),k=q2().quickSort;function T(P,L){var F=P;return typeof P=="string"&&(F=u.parseSourceMapInput(P)),F.sections!=null?new V(F,L):new x(F,L)}T.fromSourceMap=function(P,L){return x.fromSourceMap(P,L)},T.prototype._version=3,T.prototype.__generatedMappings=null,Object.defineProperty(T.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),T.prototype.__originalMappings=null,Object.defineProperty(T.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),T.prototype._charIsMappingSeparator=function(L,F){var M=L.charAt(F);return M===";"||M===","},T.prototype._parseMappings=function(L,F){throw new Error("Subclasses must implement _parseMappings")},T.GENERATED_ORDER=1,T.ORIGINAL_ORDER=2,T.GREATEST_LOWER_BOUND=1,T.LEAST_UPPER_BOUND=2,T.prototype.eachMapping=function(L,F,M){var E=F||null,C=M||T.GENERATED_ORDER,W;switch(C){case T.GENERATED_ORDER:W=this._generatedMappings;break;case T.ORIGINAL_ORDER:W=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var J=this.sourceRoot;W.map(function(se){var oe=se.source===null?null:this._sources.at(se.source);return oe=u.computeSourceURL(J,oe,this._sourceMapURL),{source:oe,generatedLine:se.generatedLine,generatedColumn:se.generatedColumn,originalLine:se.originalLine,originalColumn:se.originalColumn,name:se.name===null?null:this._names.at(se.name)}},this).forEach(L,E)},T.prototype.allGeneratedPositionsFor=function(L){var F=u.getArg(L,"line"),M={source:u.getArg(L,"source"),originalLine:F,originalColumn:u.getArg(L,"column",0)};if(M.source=this._findSourceIndex(M.source),M.source<0)return[];var E=[],C=this._findMapping(M,this._originalMappings,"originalLine","originalColumn",u.compareByOriginalPositions,f.LEAST_UPPER_BOUND);if(C>=0){var W=this._originalMappings[C];if(L.column===void 0)for(var J=W.originalLine;W&&W.originalLine===J;)E.push({line:u.getArg(W,"generatedLine",null),column:u.getArg(W,"generatedColumn",null),lastColumn:u.getArg(W,"lastGeneratedColumn",null)}),W=this._originalMappings[++C];else for(var se=W.originalColumn;W&&W.originalLine===F&&W.originalColumn==se;)E.push({line:u.getArg(W,"generatedLine",null),column:u.getArg(W,"generatedColumn",null),lastColumn:u.getArg(W,"lastGeneratedColumn",null)}),W=this._originalMappings[++C]}return E},$l.SourceMapConsumer=T;function x(P,L){var F=P;typeof P=="string"&&(F=u.parseSourceMapInput(P));var M=u.getArg(F,"version"),E=u.getArg(F,"sources"),C=u.getArg(F,"names",[]),W=u.getArg(F,"sourceRoot",null),J=u.getArg(F,"sourcesContent",null),se=u.getArg(F,"mappings"),oe=u.getArg(F,"file",null);if(M!=this._version)throw new Error("Unsupported version: "+M);W&&(W=u.normalize(W)),E=E.map(String).map(u.normalize).map(function(Se){return W&&u.isAbsolute(W)&&u.isAbsolute(Se)?u.relative(W,Se):Se}),this._names=_.fromArray(C.map(String),!0),this._sources=_.fromArray(E,!0),this._absoluteSources=this._sources.toArray().map(function(Se){return u.computeSourceURL(W,Se,L)}),this.sourceRoot=W,this.sourcesContent=J,this._mappings=se,this._sourceMapURL=L,this.file=oe}x.prototype=Object.create(T.prototype),x.prototype.consumer=T,x.prototype._findSourceIndex=function(P){var L=P;if(this.sourceRoot!=null&&(L=u.relative(this.sourceRoot,L)),this._sources.has(L))return this._sources.indexOf(L);var F;for(F=0;F<this._absoluteSources.length;++F)if(this._absoluteSources[F]==P)return F;return-1},x.fromSourceMap=function(L,F){var M=Object.create(x.prototype),E=M._names=_.fromArray(L._names.toArray(),!0),C=M._sources=_.fromArray(L._sources.toArray(),!0);M.sourceRoot=L._sourceRoot,M.sourcesContent=L._generateSourcesContent(M._sources.toArray(),M.sourceRoot),M.file=L._file,M._sourceMapURL=F,M._absoluteSources=M._sources.toArray().map(function(Ce){return u.computeSourceURL(M.sourceRoot,Ce,F)});for(var W=L._mappings.toArray().slice(),J=M.__generatedMappings=[],se=M.__originalMappings=[],oe=0,Se=W.length;oe<Se;oe++){var $=W[oe],de=new s;de.generatedLine=$.generatedLine,de.generatedColumn=$.generatedColumn,$.source&&(de.source=C.indexOf($.source),de.originalLine=$.originalLine,de.originalColumn=$.originalColumn,$.name&&(de.name=E.indexOf($.name)),se.push(de)),J.push(de)}return k(M.__originalMappings,u.compareByOriginalPositions),M},x.prototype._version=3,Object.defineProperty(x.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function s(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}x.prototype._parseMappings=function(L,F){for(var M=1,E=0,C=0,W=0,J=0,se=0,oe=L.length,Se=0,$={},de={},Ce=[],Re=[],Ze,kt,tt,Ge,it;Se<oe;)if(L.charAt(Se)===";")M++,Se++,E=0;else if(L.charAt(Se)===",")Se++;else{for(Ze=new s,Ze.generatedLine=M,Ge=Se;Ge<oe&&!this._charIsMappingSeparator(L,Ge);Ge++);if(kt=L.slice(Se,Ge),tt=$[kt],tt)Se+=kt.length;else{for(tt=[];Se<Ge;)b.decode(L,Se,de),it=de.value,Se=de.rest,tt.push(it);if(tt.length===2)throw new Error("Found a source, but no line and column");if(tt.length===3)throw new Error("Found a source and line, but no column");$[kt]=tt}Ze.generatedColumn=E+tt[0],E=Ze.generatedColumn,tt.length>1&&(Ze.source=J+tt[1],J+=tt[1],Ze.originalLine=C+tt[2],C=Ze.originalLine,Ze.originalLine+=1,Ze.originalColumn=W+tt[3],W=Ze.originalColumn,tt.length>4&&(Ze.name=se+tt[4],se+=tt[4])),Re.push(Ze),typeof Ze.originalLine=="number"&&Ce.push(Ze)}k(Re,u.compareByGeneratedPositionsDeflated),this.__generatedMappings=Re,k(Ce,u.compareByOriginalPositions),this.__originalMappings=Ce},x.prototype._findMapping=function(L,F,M,E,C,W){if(L[M]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+L[M]);if(L[E]<0)throw new TypeError("Column must be greater than or equal to 0, got "+L[E]);return f.search(L,F,C,W)},x.prototype.computeColumnSpans=function(){for(var L=0;L<this._generatedMappings.length;++L){var F=this._generatedMappings[L];if(L+1<this._generatedMappings.length){var M=this._generatedMappings[L+1];if(F.generatedLine===M.generatedLine){F.lastGeneratedColumn=M.generatedColumn-1;continue}}F.lastGeneratedColumn=1/0}},x.prototype.originalPositionFor=function(L){var F={generatedLine:u.getArg(L,"line"),generatedColumn:u.getArg(L,"column")},M=this._findMapping(F,this._generatedMappings,"generatedLine","generatedColumn",u.compareByGeneratedPositionsDeflated,u.getArg(L,"bias",T.GREATEST_LOWER_BOUND));if(M>=0){var E=this._generatedMappings[M];if(E.generatedLine===F.generatedLine){var C=u.getArg(E,"source",null);C!==null&&(C=this._sources.at(C),C=u.computeSourceURL(this.sourceRoot,C,this._sourceMapURL));var W=u.getArg(E,"name",null);return W!==null&&(W=this._names.at(W)),{source:C,line:u.getArg(E,"originalLine",null),column:u.getArg(E,"originalColumn",null),name:W}}}return{source:null,line:null,column:null,name:null}},x.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(L){return L==null}):!1},x.prototype.sourceContentFor=function(L,F){if(!this.sourcesContent)return null;var M=this._findSourceIndex(L);if(M>=0)return this.sourcesContent[M];var E=L;this.sourceRoot!=null&&(E=u.relative(this.sourceRoot,E));var C;if(this.sourceRoot!=null&&(C=u.urlParse(this.sourceRoot))){var W=E.replace(/^file:\/\//,"");if(C.scheme=="file"&&this._sources.has(W))return this.sourcesContent[this._sources.indexOf(W)];if((!C.path||C.path=="/")&&this._sources.has("/"+E))return this.sourcesContent[this._sources.indexOf("/"+E)]}if(F)return null;throw new Error('"'+E+'" is not in the SourceMap.')},x.prototype.generatedPositionFor=function(L){var F=u.getArg(L,"source");if(F=this._findSourceIndex(F),F<0)return{line:null,column:null,lastColumn:null};var M={source:F,originalLine:u.getArg(L,"line"),originalColumn:u.getArg(L,"column")},E=this._findMapping(M,this._originalMappings,"originalLine","originalColumn",u.compareByOriginalPositions,u.getArg(L,"bias",T.GREATEST_LOWER_BOUND));if(E>=0){var C=this._originalMappings[E];if(C.source===M.source)return{line:u.getArg(C,"generatedLine",null),column:u.getArg(C,"generatedColumn",null),lastColumn:u.getArg(C,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},$l.BasicSourceMapConsumer=x;function V(P,L){var F=P;typeof P=="string"&&(F=u.parseSourceMapInput(P));var M=u.getArg(F,"version"),E=u.getArg(F,"sections");if(M!=this._version)throw new Error("Unsupported version: "+M);this._sources=new _,this._names=new _;var C={line:-1,column:0};this._sections=E.map(function(W){if(W.url)throw new Error("Support for url field in sections not implemented.");var J=u.getArg(W,"offset"),se=u.getArg(J,"line"),oe=u.getArg(J,"column");if(se<C.line||se===C.line&&oe<C.column)throw new Error("Section offsets must be ordered and non-overlapping.");return C=J,{generatedOffset:{generatedLine:se+1,generatedColumn:oe+1},consumer:new T(u.getArg(W,"map"),L)}})}return V.prototype=Object.create(T.prototype),V.prototype.constructor=T,V.prototype._version=3,Object.defineProperty(V.prototype,"sources",{get:function(){for(var P=[],L=0;L<this._sections.length;L++)for(var F=0;F<this._sections[L].consumer.sources.length;F++)P.push(this._sections[L].consumer.sources[F]);return P}}),V.prototype.originalPositionFor=function(L){var F={generatedLine:u.getArg(L,"line"),generatedColumn:u.getArg(L,"column")},M=f.search(F,this._sections,function(C,W){var J=C.generatedLine-W.generatedOffset.generatedLine;return J||C.generatedColumn-W.generatedOffset.generatedColumn}),E=this._sections[M];return E?E.consumer.originalPositionFor({line:F.generatedLine-(E.generatedOffset.generatedLine-1),column:F.generatedColumn-(E.generatedOffset.generatedLine===F.generatedLine?E.generatedOffset.generatedColumn-1:0),bias:L.bias}):{source:null,line:null,column:null,name:null}},V.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(L){return L.consumer.hasContentsOfAllSources()})},V.prototype.sourceContentFor=function(L,F){for(var M=0;M<this._sections.length;M++){var E=this._sections[M],C=E.consumer.sourceContentFor(L,!0);if(C)return C}if(F)return null;throw new Error('"'+L+'" is not in the SourceMap.')},V.prototype.generatedPositionFor=function(L){for(var F=0;F<this._sections.length;F++){var M=this._sections[F];if(M.consumer._findSourceIndex(u.getArg(L,"source"))!==-1){var E=M.consumer.generatedPositionFor(L);if(E){var C={line:E.line+(M.generatedOffset.generatedLine-1),column:E.column+(M.generatedOffset.generatedLine===E.line?M.generatedOffset.generatedColumn-1:0)};return C}}}return{line:null,column:null}},V.prototype._parseMappings=function(L,F){this.__generatedMappings=[],this.__originalMappings=[];for(var M=0;M<this._sections.length;M++)for(var E=this._sections[M],C=E.consumer._generatedMappings,W=0;W<C.length;W++){var J=C[W],se=E.consumer._sources.at(J.source);se=u.computeSourceURL(E.consumer.sourceRoot,se,this._sourceMapURL),this._sources.add(se),se=this._sources.indexOf(se);var oe=null;J.name&&(oe=E.consumer._names.at(J.name),this._names.add(oe),oe=this._names.indexOf(oe));var Se={source:se,generatedLine:J.generatedLine+(E.generatedOffset.generatedLine-1),generatedColumn:J.generatedColumn+(E.generatedOffset.generatedLine===J.generatedLine?E.generatedOffset.generatedColumn-1:0),originalLine:J.originalLine,originalColumn:J.originalColumn,name:oe};this.__generatedMappings.push(Se),typeof Se.originalLine=="number"&&this.__originalMappings.push(Se)}k(this.__generatedMappings,u.compareByGeneratedPositionsDeflated),k(this.__originalMappings,u.compareByOriginalPositions)},$l.IndexedSourceMapConsumer=V,$l}var Up={},sg;function j2(){if(sg)return Up;sg=1;var u=uy().SourceMapGenerator,f=oc(),_=/(\r?\n)/,b=10,k="$$$isSourceNode$$$";function T(x,s,V,P,L){this.children=[],this.sourceContents={},this.line=x??null,this.column=s??null,this.source=V??null,this.name=L??null,this[k]=!0,P!=null&&this.add(P)}return T.fromStringWithSourceMap=function(s,V,P){var L=new T,F=s.split(_),M=0,E=function(){var oe=$(),Se=$()||"";return oe+Se;function $(){return M<F.length?F[M++]:void 0}},C=1,W=0,J=null;return V.eachMapping(function(oe){if(J!==null)if(C<oe.generatedLine)se(J,E()),C++,W=0;else{var Se=F[M]||"",$=Se.substr(0,oe.generatedColumn-W);F[M]=Se.substr(oe.generatedColumn-W),W=oe.generatedColumn,se(J,$),J=oe;return}for(;C<oe.generatedLine;)L.add(E()),C++;if(W<oe.generatedColumn){var Se=F[M]||"";L.add(Se.substr(0,oe.generatedColumn)),F[M]=Se.substr(oe.generatedColumn),W=oe.generatedColumn}J=oe},this),M<F.length&&(J&&se(J,E()),L.add(F.splice(M).join(""))),V.sources.forEach(function(oe){var Se=V.sourceContentFor(oe);Se!=null&&(P!=null&&(oe=f.join(P,oe)),L.setSourceContent(oe,Se))}),L;function se(oe,Se){if(oe===null||oe.source===void 0)L.add(Se);else{var $=P?f.join(P,oe.source):oe.source;L.add(new T(oe.originalLine,oe.originalColumn,$,Se,oe.name))}}},T.prototype.add=function(s){if(Array.isArray(s))s.forEach(function(V){this.add(V)},this);else if(s[k]||typeof s=="string")s&&this.children.push(s);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+s);return this},T.prototype.prepend=function(s){if(Array.isArray(s))for(var V=s.length-1;V>=0;V--)this.prepend(s[V]);else if(s[k]||typeof s=="string")this.children.unshift(s);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+s);return this},T.prototype.walk=function(s){for(var V,P=0,L=this.children.length;P<L;P++)V=this.children[P],V[k]?V.walk(s):V!==""&&s(V,{source:this.source,line:this.line,column:this.column,name:this.name})},T.prototype.join=function(s){var V,P,L=this.children.length;if(L>0){for(V=[],P=0;P<L-1;P++)V.push(this.children[P]),V.push(s);V.push(this.children[P]),this.children=V}return this},T.prototype.replaceRight=function(s,V){var P=this.children[this.children.length-1];return P[k]?P.replaceRight(s,V):typeof P=="string"?this.children[this.children.length-1]=P.replace(s,V):this.children.push("".replace(s,V)),this},T.prototype.setSourceContent=function(s,V){this.sourceContents[f.toSetString(s)]=V},T.prototype.walkSourceContents=function(s){for(var V=0,P=this.children.length;V<P;V++)this.children[V][k]&&this.children[V].walkSourceContents(s);for(var L=Object.keys(this.sourceContents),V=0,P=L.length;V<P;V++)s(f.fromSetString(L[V]),this.sourceContents[L[V]])},T.prototype.toString=function(){var s="";return this.walk(function(V){s+=V}),s},T.prototype.toStringWithSourceMap=function(s){var V={code:"",line:1,column:0},P=new u(s),L=!1,F=null,M=null,E=null,C=null;return this.walk(function(W,J){V.code+=W,J.source!==null&&J.line!==null&&J.column!==null?((F!==J.source||M!==J.line||E!==J.column||C!==J.name)&&P.addMapping({source:J.source,original:{line:J.line,column:J.column},generated:{line:V.line,column:V.column},name:J.name}),F=J.source,M=J.line,E=J.column,C=J.name,L=!0):L&&(P.addMapping({generated:{line:V.line,column:V.column}}),F=null,L=!1);for(var se=0,oe=W.length;se<oe;se++)W.charCodeAt(se)===b?(V.line++,V.column=0,se+1===oe?(F=null,L=!1):L&&P.addMapping({source:J.source,original:{line:J.line,column:J.column},generated:{line:V.line,column:V.column},name:J.name})):V.column++}),this.walkSourceContents(function(W,J){P.setSourceContent(W,J)}),{code:V.code,map:P}},Up.SourceNode=T,Up}var og;function W2(){return og||(og=1,Yl.SourceMapGenerator=uy().SourceMapGenerator,Yl.SourceMapConsumer=U2().SourceMapConsumer,Yl.SourceNode=j2().SourceNode),Yl}var ag;function H2(){return ag||(ag=1,function(u,f){f.__esModule=!0;var _=Ki(),b=void 0;try{var k=W2();b=k.SourceNode}catch{}b||(b=function(s,V,P,L){this.src="",L&&this.add(L)},b.prototype={add:function(V){_.isArray(V)&&(V=V.join("")),this.src+=V},prepend:function(V){_.isArray(V)&&(V=V.join("")),this.src=V+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}});function T(s,V,P){if(_.isArray(s)){for(var L=[],F=0,M=s.length;F<M;F++)L.push(V.wrap(s[F],P));return L}else if(typeof s=="boolean"||typeof s=="number")return s+"";return s}function x(s){this.srcFile=s,this.source=[]}x.prototype={isEmpty:function(){return!this.source.length},prepend:function(V,P){this.source.unshift(this.wrap(V,P))},push:function(V,P){this.source.push(this.wrap(V,P))},merge:function(){var V=this.empty();return this.each(function(P){V.add([" ",P,`
810
- `])}),V},each:function(V){for(var P=0,L=this.source.length;P<L;P++)V(this.source[P])},empty:function(){var V=this.currentLocation||{start:{}};return new b(V.start.line,V.start.column,this.srcFile)},wrap:function(V){var P=arguments.length<=1||arguments[1]===void 0?this.currentLocation||{start:{}}:arguments[1];return V instanceof b?V:(V=T(V,this,P),new b(P.start.line,P.start.column,this.srcFile,V))},functionCall:function(V,P,L){return L=this.generateList(L),this.wrap([V,P?"."+P+"(":"(",L,")"])},quotedString:function(V){return'"'+(V+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(V){var P=this,L=[];Object.keys(V).forEach(function(M){var E=T(V[M],P);E!=="undefined"&&L.push([P.quotedString(M),":",E])});var F=this.generateList(L);return F.prepend("{"),F.add("}"),F},generateList:function(V){for(var P=this.empty(),L=0,F=V.length;L<F;L++)L&&P.add(","),P.add(T(V[L],this));return P},generateArray:function(V){var P=this.generateList(V);return P.prepend("["),P.add("]"),P}},f.default=x,u.exports=f.default}(Uu,Uu.exports)),Uu.exports}var lg;function Z2(){return lg||(lg=1,function(u,f){f.__esModule=!0;function _(M){return M&&M.__esModule?M:{default:M}}var b=fd(),k=Sn(),T=_(k),x=Ki(),s=H2(),V=_(s);function P(M){this.value=M}function L(){}L.prototype={nameLookup:function(E,C){return this.internalNameLookup(E,C)},depthedLookup:function(E){return[this.aliasable("container.lookup"),"(depths, ",JSON.stringify(E),")"]},compilerInfo:function(){var E=b.COMPILER_REVISION,C=b.REVISION_CHANGES[E];return[E,C]},appendToBuffer:function(E,C,W){return x.isArray(E)||(E=[E]),E=this.source.wrap(E,C),this.environment.isSimple?["return ",E,";"]:W?["buffer += ",E,";"]:(E.appendToBuffer=!0,E)},initializeBuffer:function(){return this.quotedString("")},internalNameLookup:function(E,C){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",E,",",JSON.stringify(C),")"]},lookupPropertyFunctionIsUsed:!1,compile:function(E,C,W,J){this.environment=E,this.options=C,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!J,this.name=this.environment.name,this.isChild=!!W,this.context=W||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(E,C),this.useDepths=this.useDepths||E.useDepths||E.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||E.useBlockParams;var se=E.opcodes,oe=void 0,Se=void 0,$=void 0,de=void 0;for($=0,de=se.length;$<de;$++)oe=se[$],this.source.currentLocation=oe.loc,Se=Se||oe.loc,this[oe.opcode].apply(this,oe.args);if(this.source.currentLocation=Se,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new T.default("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend(["var decorators = container.decorators, ",this.lookupPropertyFunctionVarDeclaration(),`;
811
- `]),this.decorators.push("return fn;"),J?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend(`function(fn, props, container, depth0, data, blockParams, depths) {
812
- `),this.decorators.push(`}
813
- `),this.decorators=this.decorators.merge()));var Ce=this.createFunctionContext(J);if(this.isChild)return Ce;var Re={compiler:this.compilerInfo(),main:Ce};this.decorators&&(Re.main_d=this.decorators,Re.useDecorators=!0);var Ze=this.context,kt=Ze.programs,tt=Ze.decorators;for($=0,de=kt.length;$<de;$++)kt[$]&&(Re[$]=kt[$],tt[$]&&(Re[$+"_d"]=tt[$],Re.useDecorators=!0));return this.environment.usePartial&&(Re.usePartial=!0),this.options.data&&(Re.useData=!0),this.useDepths&&(Re.useDepths=!0),this.useBlockParams&&(Re.useBlockParams=!0),this.options.compat&&(Re.compat=!0),J?Re.compilerOptions=this.options:(Re.compiler=JSON.stringify(Re.compiler),this.source.currentLocation={start:{line:1,column:0}},Re=this.objectLiteral(Re),C.srcName?(Re=Re.toStringWithSourceMap({file:C.destName}),Re.map=Re.map&&Re.map.toString()):Re=Re.toString()),Re},preamble:function(){this.lastContext=0,this.source=new V.default(this.options.srcName),this.decorators=new V.default(this.options.srcName)},createFunctionContext:function(E){var C=this,W="",J=this.stackVars.concat(this.registers.list);J.length>0&&(W+=", "+J.join(", "));var se=0;Object.keys(this.aliases).forEach(function($){var de=C.aliases[$];de.children&&de.referenceCount>1&&(W+=", alias"+ ++se+"="+$,de.children[0]="alias"+se)}),this.lookupPropertyFunctionIsUsed&&(W+=", "+this.lookupPropertyFunctionVarDeclaration());var oe=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&oe.push("blockParams"),this.useDepths&&oe.push("depths");var Se=this.mergeSource(W);return E?(oe.push(Se),Function.apply(this,oe)):this.source.wrap(["function(",oe.join(","),`) {
814
- `,Se,"}"])},mergeSource:function(E){var C=this.environment.isSimple,W=!this.forceBuffer,J=void 0,se=void 0,oe=void 0,Se=void 0;return this.source.each(function($){$.appendToBuffer?(oe?$.prepend(" + "):oe=$,Se=$):(oe&&(se?oe.prepend("buffer += "):J=!0,Se.add(";"),oe=Se=void 0),se=!0,C||(W=!1))}),W?oe?(oe.prepend("return "),Se.add(";")):se||this.source.push('return "";'):(E+=", buffer = "+(J?"":this.initializeBuffer()),oe?(oe.prepend("return buffer + "),Se.add(";")):this.source.push("return buffer;")),E&&this.source.prepend("var "+E.substring(2)+(J?"":`;
815
- `)),this.source.merge()},lookupPropertyFunctionVarDeclaration:function(){return`
816
- lookupProperty = container.lookupProperty || function(parent, propertyName) {
817
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
818
- return parent[propertyName];
819
- }
820
- return undefined
821
- }
822
- `.trim()},blockValue:function(E){var C=this.aliasable("container.hooks.blockHelperMissing"),W=[this.contextName(0)];this.setupHelperArgs(E,0,W);var J=this.popStack();W.splice(1,0,J),this.push(this.source.functionCall(C,"call",W))},ambiguousBlockValue:function(){var E=this.aliasable("container.hooks.blockHelperMissing"),C=[this.contextName(0)];this.setupHelperArgs("",0,C,!0),this.flushInline();var W=this.topStack();C.splice(1,0,W),this.pushSource(["if (!",this.lastHelper,") { ",W," = ",this.source.functionCall(E,"call",C),"}"])},appendContent:function(E){this.pendingContent?E=this.pendingContent+E:this.pendingLocation=this.source.currentLocation,this.pendingContent=E},append:function(){if(this.isInline())this.replaceStack(function(C){return[" != null ? ",C,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var E=this.popStack();this.pushSource(["if (",E," != null) { ",this.appendToBuffer(E,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(E){this.lastContext=E},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(E,C,W,J){var se=0;!J&&this.options.compat&&!this.lastContext?this.push(this.depthedLookup(E[se++])):this.pushContext(),this.resolvePath("context",E,se,C,W)},lookupBlockParam:function(E,C){this.useBlockParams=!0,this.push(["blockParams[",E[0],"][",E[1],"]"]),this.resolvePath("context",C,1)},lookupData:function(E,C,W){E?this.pushStackLiteral("container.data(data, "+E+")"):this.pushStackLiteral("data"),this.resolvePath("data",C,0,!0,W)},resolvePath:function(E,C,W,J,se){var oe=this;if(this.options.strict||this.options.assumeObjects){this.push(F(this.options.strict&&se,this,C,W,E));return}for(var Se=C.length;W<Se;W++)this.replaceStack(function($){var de=oe.nameLookup($,C[W],E);return J?[" && ",de]:[" != null ? ",de," : ",$]})},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(E,C){this.pushContext(),this.pushString(C),C!=="SubExpression"&&(typeof E=="string"?this.pushString(E):this.pushStackLiteral(E))},emptyHash:function(E){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(E?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var E=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(E.ids)),this.stringParams&&(this.push(this.objectLiteral(E.contexts)),this.push(this.objectLiteral(E.types))),this.push(this.objectLiteral(E.values))},pushString:function(E){this.pushStackLiteral(this.quotedString(E))},pushLiteral:function(E){this.pushStackLiteral(E)},pushProgram:function(E){E!=null?this.pushStackLiteral(this.programExpression(E)):this.pushStackLiteral(null)},registerDecorator:function(E,C){var W=this.nameLookup("decorators",C,"decorator"),J=this.setupHelperArgs(C,E);this.decorators.push(["fn = ",this.decorators.functionCall(W,"",["fn","props","container",J])," || fn;"])},invokeHelper:function(E,C,W){var J=this.popStack(),se=this.setupHelper(E,C),oe=[];W&&oe.push(se.name),oe.push(J),this.options.strict||oe.push(this.aliasable("container.hooks.helperMissing"));var Se=["(",this.itemsSeparatedBy(oe,"||"),")"],$=this.source.functionCall(Se,"call",se.callParams);this.push($)},itemsSeparatedBy:function(E,C){var W=[];W.push(E[0]);for(var J=1;J<E.length;J++)W.push(C,E[J]);return W},invokeKnownHelper:function(E,C){var W=this.setupHelper(E,C);this.push(this.source.functionCall(W.name,"call",W.callParams))},invokeAmbiguous:function(E,C){this.useRegister("helper");var W=this.popStack();this.emptyHash();var J=this.setupHelper(0,E,C),se=this.lastHelper=this.nameLookup("helpers",E,"helper"),oe=["(","(helper = ",se," || ",W,")"];this.options.strict||(oe[0]="(helper = ",oe.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",oe,J.paramsInit?["),(",J.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",J.callParams)," : helper))"])},invokePartial:function(E,C,W){var J=[],se=this.setupParams(C,1,J);E&&(C=this.popStack(),delete se.name),W&&(se.indent=JSON.stringify(W)),se.helpers="helpers",se.partials="partials",se.decorators="container.decorators",E?J.unshift(C):J.unshift(this.nameLookup("partials",C,"partial")),this.options.compat&&(se.depths="depths"),se=this.objectLiteral(se),J.push(se),this.push(this.source.functionCall("container.invokePartial","",J))},assignToHash:function(E){var C=this.popStack(),W=void 0,J=void 0,se=void 0;this.trackIds&&(se=this.popStack()),this.stringParams&&(J=this.popStack(),W=this.popStack());var oe=this.hash;W&&(oe.contexts[E]=W),J&&(oe.types[E]=J),se&&(oe.ids[E]=se),oe.values[E]=C},pushId:function(E,C,W){E==="BlockParam"?this.pushStackLiteral("blockParams["+C[0]+"].path["+C[1]+"]"+(W?" + "+JSON.stringify("."+W):"")):E==="PathExpression"?this.pushString(C):E==="SubExpression"?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:L,compileChildren:function(E,C){for(var W=E.children,J=void 0,se=void 0,oe=0,Se=W.length;oe<Se;oe++){J=W[oe],se=new this.compiler;var $=this.matchExistingProgram(J);if($==null){this.context.programs.push("");var de=this.context.programs.length;J.index=de,J.name="program"+de,this.context.programs[de]=se.compile(J,C,this.context,!this.precompile),this.context.decorators[de]=se.decorators,this.context.environments[de]=J,this.useDepths=this.useDepths||se.useDepths,this.useBlockParams=this.useBlockParams||se.useBlockParams,J.useDepths=this.useDepths,J.useBlockParams=this.useBlockParams}else J.index=$.index,J.name="program"+$.index,this.useDepths=this.useDepths||$.useDepths,this.useBlockParams=this.useBlockParams||$.useBlockParams}},matchExistingProgram:function(E){for(var C=0,W=this.context.environments.length;C<W;C++){var J=this.context.environments[C];if(J&&J.equals(E))return J}},programExpression:function(E){var C=this.environment.children[E],W=[C.index,"data",C.blockParams];return(this.useBlockParams||this.useDepths)&&W.push("blockParams"),this.useDepths&&W.push("depths"),"container.program("+W.join(", ")+")"},useRegister:function(E){this.registers[E]||(this.registers[E]=!0,this.registers.list.push(E))},push:function(E){return E instanceof P||(E=this.source.wrap(E)),this.inlineStack.push(E),E},pushStackLiteral:function(E){this.push(new P(E))},pushSource:function(E){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),E&&this.source.push(E)},replaceStack:function(E){var C=["("],W=void 0,J=void 0,se=void 0;if(!this.isInline())throw new T.default("replaceStack on non-inline");var oe=this.popStack(!0);if(oe instanceof P)W=[oe.value],C=["(",W],se=!0;else{J=!0;var Se=this.incrStack();C=["((",this.push(Se)," = ",oe,")"],W=this.topStack()}var $=E.call(this,W);se||this.popStack(),J&&this.stackSlot--,this.push(C.concat($,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var E=this.inlineStack;this.inlineStack=[];for(var C=0,W=E.length;C<W;C++){var J=E[C];if(J instanceof P)this.compileStack.push(J);else{var se=this.incrStack();this.pushSource([se," = ",J,";"]),this.compileStack.push(se)}}},isInline:function(){return this.inlineStack.length},popStack:function(E){var C=this.isInline(),W=(C?this.inlineStack:this.compileStack).pop();if(!E&&W instanceof P)return W.value;if(!C){if(!this.stackSlot)throw new T.default("Invalid stack pop");this.stackSlot--}return W},topStack:function(){var E=this.isInline()?this.inlineStack:this.compileStack,C=E[E.length-1];return C instanceof P?C.value:C},contextName:function(E){return this.useDepths&&E?"depths["+E+"]":"depth"+E},quotedString:function(E){return this.source.quotedString(E)},objectLiteral:function(E){return this.source.objectLiteral(E)},aliasable:function(E){var C=this.aliases[E];return C?(C.referenceCount++,C):(C=this.aliases[E]=this.source.wrap(E),C.aliasable=!0,C.referenceCount=1,C)},setupHelper:function(E,C,W){var J=[],se=this.setupHelperArgs(C,E,J,W),oe=this.nameLookup("helpers",C,"helper"),Se=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:J,paramsInit:se,name:oe,callParams:[Se].concat(J)}},setupParams:function(E,C,W){var J={},se=[],oe=[],Se=[],$=!W,de=void 0;$&&(W=[]),J.name=this.quotedString(E),J.hash=this.popStack(),this.trackIds&&(J.hashIds=this.popStack()),this.stringParams&&(J.hashTypes=this.popStack(),J.hashContexts=this.popStack());var Ce=this.popStack(),Re=this.popStack();(Re||Ce)&&(J.fn=Re||"container.noop",J.inverse=Ce||"container.noop");for(var Ze=C;Ze--;)de=this.popStack(),W[Ze]=de,this.trackIds&&(Se[Ze]=this.popStack()),this.stringParams&&(oe[Ze]=this.popStack(),se[Ze]=this.popStack());return $&&(J.args=this.source.generateArray(W)),this.trackIds&&(J.ids=this.source.generateArray(Se)),this.stringParams&&(J.types=this.source.generateArray(oe),J.contexts=this.source.generateArray(se)),this.options.data&&(J.data="data"),this.useBlockParams&&(J.blockParams="blockParams"),J},setupHelperArgs:function(E,C,W,J){var se=this.setupParams(E,C,W);return se.loc=JSON.stringify(this.source.currentLocation),se=this.objectLiteral(se),J?(this.useRegister("options"),W.push("options"),["options=",se]):W?(W.push(se),""):se}},function(){for(var M="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),E=L.RESERVED_WORDS={},C=0,W=M.length;C<W;C++)E[M[C]]=!0}(),L.isValidJavaScriptVariableName=function(M){return!L.RESERVED_WORDS[M]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(M)};function F(M,E,C,W,J){var se=E.popStack(),oe=C.length;for(M&&oe--;W<oe;W++)se=E.nameLookup(se,C[W],J);return M?[E.aliasable("container.strict"),"(",se,", ",E.quotedString(C[W]),", ",JSON.stringify(E.source.currentLocation)," )"]:se}f.default=L,u.exports=f.default}(qu,qu.exports)),qu.exports}var cg;function K2(){return cg||(cg=1,function(u,f){f.__esModule=!0;function _(oe){return oe&&oe.__esModule?oe:{default:oe}}var b=L2(),k=_(b),T=oy(),x=_(T),s=V2(),V=z2(),P=Z2(),L=_(P),F=ay(),M=_(F),E=sy(),C=_(E),W=k.default.create;function J(){var oe=W();return oe.compile=function(Se,$){return V.compile(Se,$,oe)},oe.precompile=function(Se,$){return V.precompile(Se,$,oe)},oe.AST=x.default,oe.Compiler=V.Compiler,oe.JavaScriptCompiler=L.default,oe.Parser=s.parser,oe.parse=s.parse,oe.parseWithoutProcessing=s.parseWithoutProcessing,oe}var se=J();se.create=J,C.default(se),se.Visitor=M.default,se.default=se,f.default=se,u.exports=f.default}(xu,xu.exports)),xu.exports}var G2=K2();const Hu=Xg(G2),J2="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQACWAJYAAD/4gogSUNDX1BST0ZJTEUAAQEAAAoQAAAAAAIQAABtbnRyUkdCIFhZWiAAAAAAAAAAAAAAAABhY3NwQVBQTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAApkZXNjAAAA/AAAAHxjcHJ0AAABeAAAACh3dHB0AAABoAAAABRia3B0AAABtAAAABRyWFlaAAAByAAAABRnWFlaAAAB3AAAABRiWFlaAAAB8AAAABRyVFJDAAACBAAACAxnVFJDAAACBAAACAxiVFJDAAACBAAACAxkZXNjAAAAAAAAACJBcnRpZmV4IFNvZnR3YXJlIHNSR0IgSUNDIFByb2ZpbGUAAAAAAAAAAAAAACJBcnRpZmV4IFNvZnR3YXJlIHNSR0IgSUNDIFByb2ZpbGUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdGV4dAAAAABDb3B5cmlnaHQgQXJ0aWZleCBTb2Z0d2FyZSAyMDExAFhZWiAAAAAAAADzUQABAAAAARbMWFlaIAAAAAAAAAAAAAAAAAAAAABYWVogAAAAAAAAb6IAADj1AAADkFhZWiAAAAAAAABimQAAt4UAABjaWFlaIAAAAAAAACSgAAAPhAAAts9jdXJ2AAAAAAAABAAAAAAFAAoADwAUABkAHgAjACgALQAyADcAOwBAAEUASgBPAFQAWQBeAGMAaABtAHIAdwB8AIEAhgCLAJAAlQCaAJ8ApACpAK4AsgC3ALwAwQDGAMsA0ADVANsA4ADlAOsA8AD2APsBAQEHAQ0BEwEZAR8BJQErATIBOAE+AUUB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uJLviqrzISYqsuek6+Y9ioA8VLcOfv+y+D0pcl+Zsc0y5zpcnAhMUefdlyvVSqpdcQkpj51Dk8z0ceb3Wfw5jshe6p7eD19KwzknUTDhZaSh6ZhqQTL6rMieRXvDjlT5JMMI5H2Vte3giCvMV2Xl7ft4S4idI9/52o0wFtXT2dxr/AEwsiIg/rCJE/smm53pZf2D7dyE4vV/Jvr+SryTwtJaSb7zjSaxRnLSwD+oXG8WUKI22d3RYfbCGpVMmpiKQFtzMnQ6l+Q9W6rsaeC4UsO+s2R9QsGowcDesqo3zfL4U0brit8pLsKCkmP3EHFOgRbLntsfZsKJxXweGbev3Nwah41Ri4B7qsmULgljTTuyICFMO14rbsTu4KKdbCC/27cS59afJFXweCZ1vzOk/LVZmVzAS0mccbHqOwhu+K+jYs3M85EXsEEQvUPqTP7fVx7C3RdvBML6l79zZVcjV2RceAioUx21rYZcjfquJJRpkLpacYe5gOy9r6IxxRNw35r8U8EVeqLIefqpW7LcujTmFCcZhXWMVsbziS/Ui5QpIPFuLacOppTd2X+fDimyqi+CMq48hZ1csfT+w/p6cYj06I6lIkDd8Nfyo/pea2pceO7GzBOP7Hv8AwUP5EngyC1y/89nossWhv6eQbt2PTbKGJXkvKKSyQbmU9Yxem6+YdxC0OyqvX2brvxXwc1jXHfmbz0vZOpMvARs0aVfNcfnVf9WxD9FJO41cdj9PHm5we3Z7B9i9zT2XwernFuRtQkWw8ts0nTYM+JMvC6np8hb1hslT33DLuY4K2vb1LunMV2L/AI28FxLaWMg50pA1n9L6eyr/AGY9seM5xu6HEVqI1THxjSU7B9+8FI+tPk3x2JVVfBXOkS/s7UibGO0NP36jUcX2ZEQHLwiw+UNtah6aWnIC9nuTv1L8m+v335J4LhHGN+Zui53plQpuAvX1MbmyO63ThuyK1zeekwFls9pBxT05C2PJU2d7Nx24r4L8f//Z",Y2={"diagonal-stripes":J2,dots:X2,crosshatch:Q2};async function $2(u){for(const[f,_]of Object.entries(Y2))if(!u.hasImage(f))try{const b=await u.loadImage(_);u.addImage(f,b.data)}catch(b){console.error(`Failed to load pattern image: ${f}`,b)}}const ew={key:0,class:"w-full flex flex-col bg-white border border-stone-200 shadow-2xs rounded-xl z-10 relative widget"},tw={key:0,class:"p-5 pb-3 flex justify-between items-center"},rw={class:"inline-block font-semibold text-lg text-gray-800 dark:text-neutral-200"},iw={class:"flex flex-col justify-between h-full"},nw={__name:"vs-filters-widget",props:{config:{type:Object,required:!0},map:{type:Object,required:!0},enabledLayerIds:{type:Array,default:()=>[]}},setup(u){const f=u,_=g.ref(0),b=g.ref(null),k=g.computed(()=>{var V;return((V=f.config)==null?void 0:V.filters)||[]}),T=g.computed(()=>k.value.map(V=>({...V,id:V.name}))),x=g.computed(()=>{var P;const V=(P=f.config)==null?void 0:P.conditions;return!V||!V.layers?!0:f.enabledLayerIds.some(L=>V.layers.includes(L))}),s=async({url:V})=>{var M;const P=(M=f.config)==null?void 0:M.conditions,L=(P==null?void 0:P.layers)||[],F=f.enabledLayerIds.filter(E=>L.includes(E));F.length&&F.forEach(E=>{const C=f.map.getSource(E);if(C){const J=C.tiles[0].split("?filter=")[0],se=V?`${J}?filter=${V}`:J;C.setTiles([se])}})};return g.watch(()=>f.enabledLayerIds,V=>{(!V||!V.length)&&b.value&&(b.value.activeFilters={},_.value=0)}),g.watch(()=>{var V;return(V=b.value)==null?void 0:V.activeFilters},V=>{_.value=Object.keys(V||{}).length},{deep:!0}),(V,P)=>{const L=g.resolveComponent("VsFilter");return x.value?(g.openBlock(),g.createElementBlock("div",ew,[u.config.title?(g.openBlock(),g.createElementBlock("div",tw,[g.createElementVNode("h2",rw,g.toDisplayString(u.config.title),1)])):g.createCommentVNode("",!0),g.createElementVNode("div",iw,[g.createVNode(L,{ref_key:"filter",ref:b,scheme:T.value,header:!1,urlSeparator:"true",view:"plain",name:"filter",onFilterChange:s},null,8,["scheme"])])])):g.createCommentVNode("",!0)}}},sw={type:"button",class:"py-2 px-2.5 inline-flex items-center gap-x-1.5 text-sm font-medium rounded-lg bg-white text-gray-800 hover:bg-gray-50 focus:outline-none focus:bg-gray-49 h-[38px] shadow-md"},ow={class:"flex gap-[5px] items-center"},aw={class:"text-gray-600"},lw={key:0,class:"w-[16px] h-[16px] font-medium bg-gray-800 text-white rounded-full flex items-center justify-center text-[10px]"},cw={__name:"vs-inline-filters-widget",props:{config:{type:Object,required:!0},map:{type:Object,required:!0},enabledLayerIds:{type:Array,default:()=>[]}},setup(u){const f=u,_=g.ref(0),b=g.ref(null),k=g.computed(()=>{var P;return((P=f.config)==null?void 0:P.filters)||[]}),T=g.computed(()=>k.value.map(P=>({...P,id:P.name}))),x=g.computed(()=>{var L;const P=(L=f.config)==null?void 0:L.conditions;return!P||!P.layers?!0:f.enabledLayerIds.some(F=>P.layers.includes(F))}),s=g.computed(()=>{var P;if(f.enabledLayerIds&&f.enabledLayerIds.length){const F=(((P=f.config)==null?void 0:P.layers)||[]).find(M=>M.id===f.enabledLayerIds[0]);return(F==null?void 0:F.title)||(F==null?void 0:F.name)||(F==null?void 0:F.label)||f.enabledLayerIds[0]}return""}),V=async({url:P})=>{var E,C;const L=(E=f.config)==null?void 0:E.conditions;if(!L){const W=(C=f.config)==null?void 0:C.layer_id;if(!W)return;const J=f.map.getSource(W);if(J){const oe=J.tiles[0].split("?filter=")[0],Se=P?`${oe}?filter=${P}`:oe;J.setTiles([Se])}return}const F=(L==null?void 0:L.layers)||[],M=f.enabledLayerIds.filter(W=>F.includes(W));M.length&&M.forEach(W=>{const J=f.map.getSource(W);if(J){const oe=J.tiles[0].split("?filter=")[0],Se=P?`${oe}?filter=${P}`:oe;J.setTiles([Se])}})};return g.watch(()=>f.enabledLayerIds,P=>{(!P||!P.length)&&b.value&&(b.value.activeFilters={},_.value=0)}),g.watch(()=>{var P;return(P=b.value)==null?void 0:P.activeFilters},P=>{_.value=Object.keys(P||{}).length},{deep:!0}),(P,L)=>{const F=g.resolveComponent("VsPopover"),M=g.resolveComponent("VsFilterList");return x.value&&T.value.length?(g.openBlock(),g.createBlock(M,{key:0,ref_key:"filter",ref:b,isDialog:u.config.dialog??!0,scheme:T.value,urlSeparator:"true",view:"plain",name:"filter",onFilterChange:V},{button:g.withCtx(({visible:E})=>[g.createVNode(F,{teleport:"body",trigger:"hover",placement:"bottom"},{reference:g.withCtx(()=>[g.createElementVNode("button",sw,[g.createElementVNode("div",ow,[L[0]||(L[0]=g.createElementVNode("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[g.createElementVNode("path",{d:"M12 20L9 21V12.5L4.52 7.572C4.18545 7.20393 4.00005 6.7244 4 6.227V4H20V6.172C19.9999 6.70239 19.7891 7.21101 19.414 7.586L15 12",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),g.createElementVNode("path",{d:"M21.121 20.1209C21.5406 19.7014 21.8265 19.1668 21.9423 18.5849C22.0581 18.0029 21.9988 17.3997 21.7717 16.8514C21.5447 16.3032 21.1602 15.8346 20.6668 15.5049C20.1734 15.1752 19.5934 14.9993 19 14.9993C18.4066 14.9993 17.8266 15.1752 17.3332 15.5049C16.8398 15.8346 16.4553 16.3032 16.2283 16.8514C16.0012 17.3997 15.9419 18.0029 16.0577 18.5849C16.1735 19.1668 16.4594 19.7014 16.879 20.1209C17.297 20.5399 18.004 21.1659 19 21.9999C20.051 21.1099 20.759 20.4839 21.121 20.1209Z",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),g.createElementVNode("path",{d:"M19 18V18.01",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"})],-1)),g.createElementVNode("span",aw,g.toDisplayString(s.value),1),_.value?(g.openBlock(),g.createElementBlock("span",lw,g.toDisplayString(_.value),1)):g.createCommentVNode("",!0)])])]),default:g.withCtx(()=>[L[1]||(L[1]=g.createTextVNode(" Відкрити бокову панель "))]),_:1,__:[1]})]),_:1},8,["isDialog","scheme"])):g.createCommentVNode("",!0)}}},uw={name:"VsListWidget",props:{config:{type:Object,required:!0}},data(){return{items:[],total:0,currentPage:1,limit:16,rootEl:null,resizeObserver:null}},methods:{async fetchData(){try{const u=await kr.get(this.config.api,{params:{page:this.currentPage,limit:this.limit}});this.items=u.data.rows,this.total=u.data.total,this.$emit("content-resize")}catch(u){console.error("Error fetching data:",u)}},handlePageChange(u){this.currentPage=u,this.fetchData()},changeLimit(u){this.limit=u,this.currentPage=1,this.fetchData()}},mounted(){this.fetchData(),this.resizeObserver=new ResizeObserver(()=>{this.$emit("content-resize")}),this.$nextTick(()=>{this.$refs.rootEl&&this.resizeObserver.observe(this.$refs.rootEl)})},beforeUnmount(){this.resizeObserver&&this.$refs.rootEl&&(this.resizeObserver.unobserve(this.$refs.rootEl),this.resizeObserver.disconnect())}},hw={class:"bg-white p-4 rounded-lg h-full flex flex-col overflow-hidden",ref:"rootEl"},pw={key:0,class:"flex flex-col flex-1 overflow-hidden"},dw={class:"space-y-0 overflow-y-auto flex-1 [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-transparent"},fw=["onClick"],mw={class:"text-base font-medium"},gw={class:"mt-2 flex flex-wrap gap-2"},yw={key:1,class:"px-2 py-1 text-sm bg-gray-100 rounded-full"},_w={key:0,class:"my-5 pr-2"},vw={class:"paginationWrapper relative flex justify-center"},xw={key:1,class:"text-center text-slate-400"};function bw(u,f,_,b,k,T){var s;const x=g.resolveComponent("VsPagination");return g.openBlock(),g.createElementBlock("div",hw,[f[0]||(f[0]=g.createElementVNode("h2",{class:"text-xl font-semibold mb-4"},"Список",-1)),((s=k.items)==null?void 0:s.length)>0?(g.openBlock(),g.createElementBlock("div",pw,[g.createElementVNode("div",dw,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(k.items,V=>(g.openBlock(),g.createElementBlock("div",{key:V.id,class:"py-4 border-b last:border-b-0 hover:bg-gray-50",onClick:P=>u.$emit("cardValuesId",V.id)},[g.createElementVNode("h3",mw,g.toDisplayString(V.name),1),g.createElementVNode("div",gw,[V.status_data?(g.openBlock(),g.createElementBlock("span",{key:0,class:g.normalizeClass(["px-2 py-1 text-sm rounded-full",{"bg-green-100 text-green-800":V.status_data.color==="green","bg-red-100 text-red-800":V.status_data.color==="red"}])},g.toDisplayString(V.status_data.text),3)):g.createCommentVNode("",!0),V.class_mbd_id_data?(g.openBlock(),g.createElementBlock("span",yw,g.toDisplayString(V.class_mbd_id_data.text),1)):g.createCommentVNode("",!0)])],8,fw))),128))]),k.total>k.limit?(g.openBlock(),g.createElementBlock("div",_w,[g.createElementVNode("div",vw,[g.createVNode(x,{total:k.total,maxPages:4,defaultPage:k.currentPage,pageSize:k.limit,goTo:!1,size:"medium",onPageChange:T.handlePageChange,backgroundColor:"#e5e7eb",borderedCellSelected:!0,pageSizes:[16,32,48,64],onPageSizeChange:T.changeLimit},null,8,["total","defaultPage","pageSize","onPageChange","onPageSizeChange"])])])):g.createCommentVNode("",!0)])):(g.openBlock(),g.createElementBlock("div",xw,"Немає даних"))],512)}const ww=Gt(uw,[["render",bw]]),Sw={class:"map-skeleton-loader"},kw={__name:"vs-skeleton-loader",setup(u){return(f,_)=>(g.openBlock(),g.createElementBlock("div",Sw,_[0]||(_[0]=[g.createElementVNode("div",{class:"dot-pulse"},null,-1)])))}},Aw=Gt(kw,[["__scopeId","data-v-954c1e03"]]),Cw={},Tw={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Ew(u,f){return g.openBlock(),g.createElementBlock("svg",Tw,f[0]||(f[0]=[g.createElementVNode("title",null,"Globe Icon",-1),g.createElementVNode("desc",null," A circular representation of a globe with horizontal and vertical lines ",-1),g.createElementVNode("path",{d:"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z",stroke:"#1E40AF","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),g.createElementVNode("path",{d:"M2 12H22",stroke:"#1E40AF","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),g.createElementVNode("path",{d:"M12 2C14.5013 4.73835 15.9228 8.29203 16 12C15.9228 15.708 14.5013 19.2616 12 22C9.49872 19.2616 8.07725 15.708 8 12C8.07725 8.29203 9.49872 4.73835 12 2Z",stroke:"#1E40AF","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))}const Pw=Gt(Cw,[["render",Ew]]),Iw={components:{homeIcon:Pw},name:"vs-homezoom",props:{map:{type:Object},initialView:{type:Object,default:()=>({})}},methods:{homeZoom(){!this.map||!this.initialView||(this.initialView.bbox?this.map.fitBounds(this.initialView.bbox,{duration:0,padding:10}):this.initialView.center&&this.initialView.zoom!==void 0&&(this.map.setCenter(this.initialView.center),this.map.setZoom(this.initialView.zoom)),this.initialView.pitch!==void 0&&this.map.setPitch(this.initialView.pitch),this.initialView.bearing!==void 0&&this.map.setBearing(this.initialView.bearing))}},computed:{}};function Mw(u,f,_,b,k,T){const x=g.resolveComponent("homeIcon"),s=g.resolveComponent("VsPopover");return g.openBlock(),g.createElementBlock("div",null,[g.createVNode(s,{trigger:"hover",placement:"left",teleport:"body",class:"flex"},{reference:g.withCtx(()=>[g.createVNode(x,{onClick:T.homeZoom,class:"w-full h-auto p-[9px] [transition:.3s] hover:[transition:.3s] text-[24px] hover:bg-[#DBEAFE] flex font-normal cursor-pointer text-[#1E40AF] bg-[#fff] rounded-[4px] border-[1px] border-solid border-[#E5E7EB]"},null,8,["onClick"])]),default:g.withCtx(()=>[f[0]||(f[0]=g.createElementVNode("div",null,"Повернутися до початкових налаштувань",-1))]),_:1,__:[0]})])}const Lw=Gt(Iw,[["render",Mw]]),Rw={},Bw={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Dw(u,f){return g.openBlock(),g.createElementBlock("svg",Bw,f[0]||(f[0]=[g.createElementVNode("title",null,"Document with Two Sections Icon",-1),g.createElementVNode("desc",null,"A document icon with a split design indicating two sections",-1),g.createElementVNode("path",{d:"M6 9V2H18V9",stroke:"#1E40AF","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),g.createElementVNode("path",{d:"M6 18H4C3.46957 18 2.96086 17.7893 2.58579 17.4142C2.21071 17.0391 2 16.5304 2 16V11C2 10.4696 2.21071 9.96086 2.58579 9.58579C2.96086 9.21071 3.46957 9 4 9H20C20.5304 9 21.0391 9.21071 21.4142 9.58579C21.7893 9.96086 22 10.4696 22 11V16C22 16.5304 21.7893 17.0391 21.4142 17.4142C21.0391 17.7893 20.5304 18 20 18H18",stroke:"#1E40AF","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),g.createElementVNode("path",{d:"M18 14H6V22H18V14Z",stroke:"#1E40AF","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))}const Vw=Gt(Rw,[["render",Dw]]),zw={components:{printIcon:Vw},props:{map:{type:Object},activeTool:String,setActiveTool:Function},data(){return{printVisible:!1,scriptElements:[],styleElements:[],resourcesLoaded:!1}},watch:{activeTool(u){u!=="print"?this.printVisible=!1:this.init()},async printVisible(u){!this.resourcesLoaded&&u?(await this.loadResources(),this.init(),this.simulateClick()):this.removeResources()},activeTool(u,f){u!=="print"&&f==="print"&&(this.closePrint&&this.closePrint(),this.printVisible=!1),u==="print"&&!this.printVisible&&(this.printVisible=!0,this.init())}},computed:{modalButtonClasses(){return{"!bg-[#DBEAFE]":this.printVisible,"bg-white":!this.printVisible}}},mounted(){document.addEventListener("click",u=>{const f=document.querySelector(".mapboxgl-export-list");if(f&&f.contains(u.target)){u.stopPropagation();return}!u.target.classList.contains("mapboxgl-export-list")&&!u.target.classList.contains("print-button")&&!u.target.classList.contains("mapboxgl-export-control")&&!u.target.id.includes("mapbox-gl-export")&&(this.printVisible=!1)})},methods:{addScript(u){return new Promise((f,_)=>{const b=document.createElement("script");b.src=u,b.async=!0,b.onload=f,b.onerror=_,document.head.appendChild(b),this.scriptElements.push(b)})},addStyle(u){return new Promise((f,_)=>{const b=document.createElement("link");b.href=u,b.rel="stylesheet",b.type="text/css",b.onload=f,b.onerror=_,document.head.appendChild(b),this.styleElements.push(b)})},async loadResources(){try{await this.addStyle("https://cdnjs.cloudflare.com/ajax/libs/mapbox-gl/3.8.0/mapbox-gl.min.css"),await this.addScript("https://cdnjs.cloudflare.com/ajax/libs/mapbox-gl/3.8.0/mapbox-gl.js"),await this.addStyle("https://cdn.jsdelivr.net/npm/@watergis/mapbox-gl-export@3.5.4/dist/mapbox-gl-export.min.css"),await this.addScript("https://cdn.jsdelivr.net/npm/@watergis/mapbox-gl-export@3.5.4/dist/mapbox-gl-export.umd.min.js"),this.resourcesLoaded=!0}catch(u){console.error("Failed to load resources:",u)}},removeResources(){this.scriptElements.forEach(u=>{u.parentNode&&u.parentNode.removeChild(u)}),this.scriptElements=[],this.styleElements.forEach(u=>{u.parentNode&&u.parentNode.removeChild(u)}),this.styleElements=[],this.resourcesLoaded=!1},async toggleResources(){this.printVisible=!this.printVisible},init(){if(!window.MapboxExportControl){console.error("MapboxExportControl is not loaded.");return}window.mapboxgl.accessToken="pk.eyJ1Ijoia3Jpemhhbm92c2t5IiwiYSI6ImNsemkxNWtkODA5dDcycnNhMWZzYWM0MTAifQ.6fEpgfd_2mA4UYuflDewpQ";const{MapboxExportControl:u,Size:f,PageOrientation:_,Format:b,DPI:k}=window.MapboxExportControl;this.map.addControl(new u({PageSize:f.A3,PageOrientation:_.Portrait,Format:b.PNG,DPI:k[96],Crosshair:!0,PrintableArea:!0,Local:"uk"}))},simulateClick(){new Promise(f=>{const _=setTimeout(()=>{const b=document.querySelector(".mapboxgl-export-control");b&&(clearInterval(_),f(b))},100)}).then(f=>{f.click()}).catch(()=>{console.error("Print button not found.")})},togglePrint(){!this.activeTool||this.activeTool!=="print"?this.setActiveTool&&this.setActiveTool("print"):this.setActiveTool&&this.setActiveTool(null),this.printVisible=!this.printVisible,this.printVisible?this.init():this.removeResources()}}};function Fw(u,f,_,b,k,T){const x=g.resolveComponent("printIcon"),s=g.resolveComponent("VsPopover");return g.openBlock(),g.createBlock(s,{trigger:"hover",placement:"left",teleport:"body"},{reference:g.withCtx(()=>[g.createVNode(x,{onClick:T.togglePrint,class:g.normalizeClass([T.modalButtonClasses,"print-button w-full h-auto p-[9px] [transition:.3s] hover:[transition:.3s] text-[24px] hover:bg-[#DBEAFE] flex font-normal cursor-pointer text-[#1E40AF] bg-[#fff] rounded-[4px] border-[1px] border-solid border-[#E5E7EB]"])},null,8,["onClick","class"])]),default:g.withCtx(()=>[f[0]||(f[0]=g.createElementVNode("div",null,"Надрукувати",-1))]),_:1,__:[0]})}const Ow=Gt(zw,[["render",Fw]]),Nw={props:{map:{type:Object,required:!0}},data(){return{is3D:!1}},mounted(){this.map.on("move",this.updateViewStatus),this.updateViewStatus()},beforeUnmount(){this.map.off("move",this.updateViewStatus)},methods:{toggleView(){this.is3D?this.map.easeTo({pitch:0,bearing:0,duration:1e3}):this.map.easeTo({pitch:60,bearing:-29.6,duration:1e3})},updateViewStatus(){this.is3D=this.map.getPitch()!==0}}};function qw(u,f,_,b,k,T){const x=g.resolveComponent("VsPopover");return g.openBlock(),g.createBlock(x,{trigger:"hover",placement:"left",teleport:"body",class:"flex"},{reference:g.withCtx(()=>[g.createElementVNode("div",{class:"font-light w-full h-[44px] p-[9px] [transition:.3s] hover:[transition:.3s] text-[19px] hover:bg-[#DBEAFE] flex cursor-pointer text-[#1E40AF] bg-[#fff] rounded-[4px] border-[1px] border-solid border-[#E5E7EB]",onClick:f[0]||(f[0]=(...s)=>T.toggleView&&T.toggleView(...s))},g.toDisplayString(k.is3D?"2D":"3D"),1)]),default:g.withCtx(()=>[f[1]||(f[1]=g.createElementVNode("div",null,"Перемикач виду",-1))]),_:1,__:[1]})}const Uw=Gt(Nw,[["render",qw]]),jw={},Ww={class:"shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Hw(u,f){return g.openBlock(),g.createElementBlock("svg",Ww,f[0]||(f[0]=[g.createElementVNode("path",{d:"M18 6 6 18"},null,-1),g.createElementVNode("path",{d:"m6 6 12 12"},null,-1)]))}const md=Gt(jw,[["render",Hw]]),Zw={props:{bgColor:{type:String,default:"#1E40AF"}}},Kw={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Gw=["stroke"],Jw=["stroke"],Xw=["stroke"],Qw=["stroke"],Yw=["stroke"],$w=["stroke"];function eS(u,f,_,b,k,T){return g.openBlock(),g.createElementBlock("svg",Kw,[f[0]||(f[0]=g.createElementVNode("title",null,"Target Icon",-1)),f[1]||(f[1]=g.createElementVNode("desc",null,"A target icon with a circular pattern inside a rounded square",-1)),g.createElementVNode("path",{d:"M2 12H5",stroke:_.bgColor,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},null,8,Gw),g.createElementVNode("path",{d:"M19 12H22",stroke:_.bgColor,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},null,8,Jw),g.createElementVNode("path",{d:"M12 2V5",stroke:_.bgColor,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},null,8,Xw),g.createElementVNode("path",{d:"M12 19V22",stroke:_.bgColor,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},null,8,Qw),g.createElementVNode("path",{d:"M12 19C15.866 19 19 15.866 19 12C19 8.13401 15.866 5 12 5C8.13401 5 5 8.13401 5 12C5 15.866 8.13401 19 12 19Z",stroke:_.bgColor,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},null,8,Yw),g.createElementVNode("path",{d:"M12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z",stroke:_.bgColor,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},null,8,$w)])}const tS=Gt(Zw,[["render",eS]]),{Marker:rS}=ed,iS={components:{geoIcon:tS,closeIcon:md},data(){return{location:null,data:null,marker:null,showLocation:!1}},computed:{modalButtonClasses(){return{"!bg-[#DBEAFE]":this.showLocation,"bg-white":!this.showLocation}}},props:{map:{type:Object}},beforeUnmount(){var u;(u=this.marker)==null||u.remove()},watch:{activeControl(u,f){u!=="geolocation"&&f==="geolocation"&&(this.showLocation=!1,this.closeGeolocation())}},methods:{togleGeolocation(){this.showLocation=!this.showLocation,this.showLocation?this.getUserLocation():(this.closeGeolocation(),this.activeControl="no")},getUserLocation(){navigator.geolocation?navigator.geolocation.getCurrentPosition(this.onGeolocationSuccess,this.onGeolocationError):(this.showLocation=!1,this.activeControl="no",this.$notify({type:"error",title:"Помилка",message:"Цей браузер не підтримує геолокацію"}),this.$emit("close"))},async onGeolocationSuccess(u){this.location={latitude:u.coords.latitude,longitude:u.coords.longitude};const _=await(await fetch(`https://nominatim.openstreetmap.org/reverse?format=json&lat=${this.location.latitude}&lon=${this.location.longitude}`)).json();this.data=_.address;const b=[this.location.longitude,this.location.latitude],k=[[parseFloat(_.boundingbox[2]),parseFloat(_.boundingbox[0])],[parseFloat(_.boundingbox[3]),parseFloat(_.boundingbox[1])]];this.map.fitBounds(k,{padding:200,maxZoom:16}),this.marker||(this.marker=new rS({color:"var(--primary)"})),this.marker.setLngLat(b).addTo(this.map),this.activeControl="geolocation"},closeGeolocation(){this.showLocation=!1,this.marker&&(this.marker.remove(),this.marker=null),this.location=null,this.data=null},onGeolocationError(){this.showLocation=!1,this.activeControl="no",this.$notify({type:"error",title:"Помилка",message:"Для визначення геолокації потрібен HTTPS протокол"}),this.$emit("close")}}},nS={key:0,class:"max-w-[412px] absolute w-full top-[20px] right-[70px] bg-white border rounded-[15px] p-4 z-10"},sS={class:"flex justify-between items-center border-b pb-[16px]"},oS={class:"d-flex"},aS={class:"pt-[16px]"};function lS(u,f,_,b,k,T){var P,L,F,M,E,C;const x=g.resolveComponent("closeIcon"),s=g.resolveComponent("geoIcon"),V=g.resolveComponent("VsPopover");return g.openBlock(),g.createElementBlock("div",null,[(g.openBlock(),g.createBlock(g.Teleport,{to:"#maplibre-demo-map"},[k.location?(g.openBlock(),g.createElementBlock("div",nS,[g.createElementVNode("div",sS,[f[0]||(f[0]=g.createElementVNode("div",{class:"text-lg font-semibold"},"Ваша геолокація",-1)),g.createElementVNode("div",oS,[g.createVNode(x,{onClick:T.closeGeolocation},null,8,["onClick"])])]),g.createElementVNode("div",aS,[g.createElementVNode("div",null,[f[1]||(f[1]=g.createElementVNode("strong",null,"Широта:",-1)),g.createTextVNode(" "+g.toDisplayString((P=k.location)==null?void 0:P.latitude),1)]),g.createElementVNode("div",null,[f[2]||(f[2]=g.createElementVNode("strong",null,"Довгота:",-1)),g.createTextVNode(" "+g.toDisplayString((L=k.location)==null?void 0:L.longitude),1)]),g.createElementVNode("div",null,[f[3]||(f[3]=g.createElementVNode("strong",null,"КраЇна:",-1)),g.createTextVNode(" "+g.toDisplayString((F=k.data)==null?void 0:F.country),1)]),g.createElementVNode("div",null,[f[4]||(f[4]=g.createElementVNode("strong",null,"Код країни:",-1)),g.createTextVNode(" "+g.toDisplayString((M=k.data)==null?void 0:M.country_code),1)]),g.createElementVNode("div",null,[f[5]||(f[5]=g.createElementVNode("strong",null,"Місто:",-1)),g.createTextVNode(" "+g.toDisplayString((E=k.data)==null?void 0:E.city),1)]),g.createElementVNode("div",null,[f[6]||(f[6]=g.createElementVNode("strong",null,"Поштовий індекс:",-1)),g.createTextVNode(" "+g.toDisplayString((C=k.data)==null?void 0:C.postcode),1)])])])):g.createCommentVNode("",!0)])),g.createVNode(V,{trigger:"hover",placement:"left",teleport:"body",class:"flex"},{reference:g.withCtx(()=>[g.createVNode(s,{onClick:T.togleGeolocation,class:g.normalizeClass([T.modalButtonClasses,"w-full h-auto p-[9px] [transition:.3s] hover:[transition:.3s] text-[24px] hover:bg-[#DBEAFE] flex font-normal cursor-pointer text-[#1E40AF] bg-[#fff] rounded-[4px] border-[1px] border-solid border-[#E5E7EB]"])},null,8,["onClick","class"])]),default:g.withCtx(()=>[f[7]||(f[7]=g.createElementVNode("div",null,"Дізнатися геолокацію",-1))]),_:1,__:[7]})])}const cS=Gt(iS,[["render",lS]]);var ug=63710088e-1;function uS(u,f){var _,b,k,T,x,s,V,P,L,F,M=0,E=u.type==="FeatureCollection",C=u.type==="Feature",W=E?u.features.length:1;for(_=0;_<W;_++){for(s=E?u.features[_].geometry:C?u.geometry:u,P=E?u.features[_].properties:C?u.properties:{},L=E?u.features[_].bbox:C?u.bbox:void 0,F=E?u.features[_].id:C?u.id:void 0,V=s?s.type==="GeometryCollection":!1,x=V?s.geometries.length:1,k=0;k<x;k++){if(T=V?s.geometries[k]:s,T===null){if(f(null,M,P,L,F)===!1)return!1;continue}switch(T.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(f(T,M,P,L,F)===!1)return!1;break}case"GeometryCollection":{for(b=0;b<T.geometries.length;b++)if(f(T.geometries[b],M,P,L,F)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}M++}}function hS(u,f,_){var b=_;return uS(u,function(k,T,x,s,V){T===0&&_===void 0?b=k:b=f(b,k,T,x,s,V)}),b}function pS(u){return hS(u,(f,_)=>f+dS(_),0)}function dS(u){let f=0,_;switch(u.type){case"Polygon":return hg(u.coordinates);case"MultiPolygon":for(_=0;_<u.coordinates.length;_++)f+=hg(u.coordinates[_]);return f;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}function hg(u){let f=0;if(u&&u.length>0){f+=Math.abs(pg(u[0]));for(let _=1;_<u.length;_++)f-=Math.abs(pg(u[_]))}return f}var fS=ug*ug/2,jp=Math.PI/180;function pg(u){const f=u.length-1;if(f<=2)return 0;let _=0,b=0;for(;b<f;){const k=u[b],T=u[b+1===f?0:b+1],x=u[b+2>=f?(b+2)%f:b+2],s=k[0]*jp,V=T[1]*jp,P=x[0]*jp;_+=(P-s)*Math.sin(V),b++}return _*fS}var rn=63710088e-1,mS={centimeters:rn*100,centimetres:rn*100,degrees:360/(2*Math.PI),feet:rn*3.28084,inches:rn*39.37,kilometers:rn/1e3,kilometres:rn/1e3,meters:rn,metres:rn,miles:rn/1609.344,millimeters:rn*1e3,millimetres:rn*1e3,nauticalmiles:rn/1852,radians:1,yards:rn*1.0936};function nh(u,f,_={}){const b={type:"Feature"};return(_.id===0||_.id)&&(b.id=_.id),_.bbox&&(b.bbox=_.bbox),b.properties=f||{},b.geometry=u,b}function hy(u,f,_={}){for(const k of u){if(k.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(k[k.length-1].length!==k[0].length)throw new Error("First and last Position are not equivalent.");for(let T=0;T<k[k.length-1].length;T++)if(k[k.length-1][T]!==k[0][T])throw new Error("First and last Position are not equivalent.")}return nh({type:"Polygon",coordinates:u},f,_)}function sh(u,f,_={}){if(u.length<2)throw new Error("coordinates must be an array of two or more positions");return nh({type:"LineString",coordinates:u},f,_)}function tc(u,f={}){const _={type:"FeatureCollection"};return f.id&&(_.id=f.id),f.bbox&&(_.bbox=f.bbox),_.features=u,_}function gS(u,f="kilometers"){const _=mS[f];if(!_)throw new Error(f+" units is invalid");return u*_}function Zu(u){return u%360*Math.PI/180}function dg(u){if(!u)throw new Error("coord is required");if(!Array.isArray(u)){if(u.type==="Feature"&&u.geometry!==null&&u.geometry.type==="Point")return[...u.geometry.coordinates];if(u.type==="Point")return[...u.coordinates]}if(Array.isArray(u)&&u.length>=2&&!Array.isArray(u[0])&&!Array.isArray(u[1]))return[...u];throw new Error("coord must be GeoJSON Point or an Array of numbers")}function td(u,f,_={}){var b=dg(u),k=dg(f),T=Zu(k[1]-b[1]),x=Zu(k[0]-b[0]),s=Zu(b[1]),V=Zu(k[1]),P=Math.pow(Math.sin(T/2),2)+Math.pow(Math.sin(x/2),2)*Math.cos(s)*Math.cos(V);return gS(2*Math.atan2(Math.sqrt(P),Math.sqrt(1-P)),_.units)}function py(u,f,_){if(u!==null)for(var b,k,T,x,s,V,P,L=0,F=0,M,E=u.type,C=E==="FeatureCollection",W=E==="Feature",J=C?u.features.length:1,se=0;se<J;se++){P=C?u.features[se].geometry:W?u.geometry:u,M=P?P.type==="GeometryCollection":!1,s=M?P.geometries.length:1;for(var oe=0;oe<s;oe++){var Se=0,$=0;if(x=M?P.geometries[oe]:P,x!==null){V=x.coordinates;var de=x.type;switch(L=0,de){case null:break;case"Point":if(f(V,F,se,Se,$)===!1)return!1;F++,Se++;break;case"LineString":case"MultiPoint":for(b=0;b<V.length;b++){if(f(V[b],F,se,Se,$)===!1)return!1;F++,de==="MultiPoint"&&Se++}de==="LineString"&&Se++;break;case"Polygon":case"MultiLineString":for(b=0;b<V.length;b++){for(k=0;k<V[b].length-L;k++){if(f(V[b][k],F,se,Se,$)===!1)return!1;F++}de==="MultiLineString"&&Se++,de==="Polygon"&&$++}de==="Polygon"&&Se++;break;case"MultiPolygon":for(b=0;b<V.length;b++){for($=0,k=0;k<V[b].length;k++){for(T=0;T<V[b][k].length-L;T++){if(f(V[b][k][T],F,se,Se,$)===!1)return!1;F++}$++}Se++}break;case"GeometryCollection":for(b=0;b<x.geometries.length;b++)if(py(x.geometries[b],f)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function yS(u,f){var _,b,k,T,x,s,V,P,L,F,M=0,E=u.type==="FeatureCollection",C=u.type==="Feature",W=E?u.features.length:1;for(_=0;_<W;_++){for(s=E?u.features[_].geometry:C?u.geometry:u,P=E?u.features[_].properties:C?u.properties:{},L=E?u.features[_].bbox:C?u.bbox:void 0,F=E?u.features[_].id:C?u.id:void 0,V=s?s.type==="GeometryCollection":!1,x=V?s.geometries.length:1,k=0;k<x;k++){if(T=V?s.geometries[k]:s,T===null){if(f(null,M,P,L,F)===!1)return!1;continue}switch(T.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(f(T,M,P,L,F)===!1)return!1;break}case"GeometryCollection":{for(b=0;b<T.geometries.length;b++)if(f(T.geometries[b],M,P,L,F)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}M++}}function _S(u,f){yS(u,function(_,b,k,T,x){var s=_===null?null:_.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return f(nh(_,k,{bbox:T,id:x}),b,0)===!1?!1:void 0}var V;switch(s){case"MultiPoint":V="Point";break;case"MultiLineString":V="LineString";break;case"MultiPolygon":V="Polygon";break}for(var P=0;P<_.coordinates.length;P++){var L=_.coordinates[P],F={type:V,coordinates:L};if(f(nh(F,k),b,P)===!1)return!1}})}function vS(u,f){_S(u,function(_,b,k){var T=0;if(_.geometry){var x=_.geometry.type;if(!(x==="Point"||x==="MultiPoint")){var s,V=0,P=0,L=0;if(py(_,function(F,M,E,C,W){if(s===void 0||b>V||C>P||W>L){s=F,V=b,P=C,L=W,T=0;return}var J=sh([s,F],_.properties);if(f(J,b,k,W,T)===!1)return!1;T++,s=F})===!1)return!1}}})}function xS(u,f,_){var b=_,k=!1;return vS(u,function(T,x,s,V,P){k===!1&&_===void 0?b=T:b=f(b,T,x,s,V,P),k=!0}),b}function bS(u,f={}){return xS(u,(_,b)=>{const k=b.geometry.coordinates;return _+td(k[0],k[1],f)},0)}const wS={props:{bgColor:{type:String,default:"#1E40AF"}}},SS={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},kS=["stroke"],AS=["stroke"],CS=["stroke"],TS=["stroke"],ES=["stroke"];function PS(u,f,_,b,k,T){return g.openBlock(),g.createElementBlock("svg",SS,[f[0]||(f[0]=g.createElementVNode("title",null,"Pencil Icon",-1)),f[1]||(f[1]=g.createElementVNode("desc",null,"A pencil icon with strokes and detailed lines",-1)),g.createElementVNode("path",{d:"M21.3 15.3C21.5238 15.523 21.7013 15.7879 21.8225 16.0796C21.9436 16.3714 22.0059 16.6841 22.0059 17C22.0059 17.3159 21.9436 17.6286 21.8225 17.9204C21.7013 18.2121 21.5238 18.477 21.3 18.7L18.7 21.3C18.4771 21.5237 18.2121 21.7013 17.9204 21.8224C17.6287 21.9435 17.3159 22.0059 17 22.0059C16.6842 22.0059 16.3714 21.9435 16.0797 21.8224C15.788 21.7013 15.523 21.5237 15.3 21.3L2.70005 8.7C2.2506 8.24838 1.99829 7.63715 1.99829 7C1.99829 6.36285 2.2506 5.75162 2.70005 5.3L5.30005 2.7C5.75167 2.25056 6.36289 1.99825 7.00005 1.99825C7.6372 1.99825 8.24842 2.25056 8.70005 2.7L21.3 15.3Z",stroke:_.bgColor,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},null,8,kS),g.createElementVNode("path",{d:"M14.5 12.5L16.5 10.5",stroke:_.bgColor,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},null,8,AS),g.createElementVNode("path",{d:"M11.5 9.5L13.5 7.5",stroke:_.bgColor,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},null,8,CS),g.createElementVNode("path",{d:"M8.5 6.5L10.5 4.5",stroke:_.bgColor,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},null,8,TS),g.createElementVNode("path",{d:"M17.5 15.5L19.5 13.5",stroke:_.bgColor,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},null,8,ES)])}const IS=Gt(wS,[["render",PS]]),MS={name:"vs-measure",components:{rulerIcon:IS,closeIcon:md},data(){return{points:[],inputPoint:[],distance:0,distanceType:!1,modalVisible:!1,draggingPointId:null}},watch:{async points(){this.inputPoint=this.points.map(u=>{var f,_;return{id:u.properties.id,value:((_=(f=u==null?void 0:u.geometry)==null?void 0:f.coordinates)==null?void 0:_.reduceRight((b,k)=>[...b,typeof k=="string"?k:k.toFixed(5)],[]).join(","))||""}}),this.setPoints()},activeTool(u,f){u!=="length"&&f==="length"&&(this.closeMeasure(),this.modalVisible=!1),u==="length"&&!this.modalVisible&&(this.modalVisible=!0,this.initMeasureLayer())}},props:{map:{type:Object},activeTool:String,setActiveTool:Function},methods:{measureMapClick(u){const f=this.map.queryRenderedFeatures(u.point,{layers:["measure-points"]});if(f.length)this.points=this.points.filter(_=>{var b,k;return _.properties.id!==((k=(b=f[0])==null?void 0:b.properties)==null?void 0:k.id)});else{const _={type:"Feature",geometry:{type:"Point",coordinates:Object.values(u.lngLat)},properties:{id:Math.floor(Math.random()*1e3)}};this.points=this.points.concat(_)}},async setPoints(){const u=this.points.filter(k=>k==null?void 0:k.geometry),f=u.map((k,T)=>{var V,P;const x=td(u[T?T-1:0],k),s=this.distanceType?x:x+ +((P=(V=u[T-1])==null?void 0:V.properties)==null?void 0:P.distance)||0;return k.properties.distance=s,k.properties.title=`${s.toLocaleString()}км`,k}),_=await tc(f);if(f.length>2){const k=hy([[...f.map(T=>T.geometry.coordinates),f[0].geometry.coordinates]]);this.map.getSource("linear-area").setData(tc([k]))}else{const k=this.map.getSource("measure");k&&k.setData(_)}f.length>1&&(_.features=_.features.concat(sh(f.map(k=>k.geometry.coordinates))),this.distance=bS(sh(f.map(k=>k.geometry.coordinates))));const b=this.map.getSource("measure");b&&b.setData(_)},handleDelete(u){this.points=this.points.filter(f=>f.properties.id!==u)},addCoords(){this.points=this.points.concat({type:"Feature",properties:{id:Math.floor(Math.random()*1e3)},geometry:null})},handleChange(){this.points=this.inputPoint.map(u=>{if(/^([^,]*,[^,]*)$/.test(u.value)){const f=u.value.split(",").reverse();if(f[0]<-90||f[0]>90||f[1]>180||f[1]<-180)this.$notify({type:"error",title:"Помилка",message:"Координати неправильні"});else return{type:"Feature",geometry:{type:"Point",coordinates:f},properties:{id:u.id}}}else this.$notify({type:"error",title:"Помилка",message:"Координати неправильні"})})},removeLinearLayer(){this.map.getLayer("measure-lines")&&this.map.removeLayer("measure-lines"),this.map.getLayer("measure-points")&&this.map.removeLayer("measure-points"),this.map.getLayer("measure-symbol")&&this.map.removeLayer("measure-symbol"),this.map.getSource("measure")&&this.map.removeSource("measure"),this.map.getLayer("linear-area-fill")&&this.map.removeLayer("linear-area-fill"),this.map.getSource("linear-area")&&this.map.removeSource("linear-area"),this.distance=0},createLinearLayer(){this.map.addSource("measure",{type:"geojson",data:{type:"FeatureCollection",features:[]}}),this.map.addLayer({id:"measure-lines",type:"line",source:"measure",layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#000","line-width":2.5},filter:["in","$type","LineString"]}),this.map.addLayer({id:"measure-points",type:"circle",source:"measure",paint:{"circle-radius":4.5,"circle-color":"#fff","circle-stroke-width":2,"circle-stroke-color":"#000"},filter:["in","$type","Point"]}),this.map.addLayer({id:"measure-symbol",source:"measure",type:"symbol",paint:{"text-color":"#111","text-halo-color":"#fff","text-halo-width":2},layout:{"symbol-placement":"point","text-letter-spacing":.2,"text-field":"{title}","text-font":["Open Sans Regular"],"text-size":15,"text-anchor":"bottom-left"},filter:["in","$type","Point"]}),this.createAreaLayer(),this.map.on("mousemove",this.mouseMove),this.map.on("mousemove",this.mouseMove)},mouseMove(u){const f=this.map.queryRenderedFeatures(u.point,{layers:["measure-points"]});this.map.getCanvas().style.cursor=f.length?"move":"crosshair"},createAreaLayer(){const{map:u}=this;u.addSource("linear-area",{type:"geojson",data:{type:"FeatureCollection",features:[]}})},distanceFormat(){const u=this.points.filter(f=>f.geometry).map(f=>f.geometry);u.forEach((f,_)=>{const b=td(u[_?_-1:0],f);distance.push(b);const k=this.distanceType?b:b+ +this.points[_?_-1:0].properties.distance||0;this.points[_].properties.distance=k,this.points[_].properties.title=`${k.toLocaleString()}km`})},initMeasureLayer(){this.createLinearLayer(),this.map.on("mousedown","measure-points",this.handleDrag),this.map.on("click",this.measureMapClick),this.map.on("touchend",this.measureMapClick)},onMove(u){const f=u.lngLat;this.points=this.points.map(_=>_.properties.id===this.draggingPointId?{..._,geometry:{..._.geometry,coordinates:[f.lng,f.lat]}}:_),this.setPoints()},onUp(){this.map.off("mousemove",this.onMove),this.draggingPointId=null},handleDrag(u){u.preventDefault();const f=this.map.queryRenderedFeatures(u.point,{layers:["measure-points"]});if(f.length){const _=f[0].properties.id;this.draggingPointId=_,this.map.on("mousemove",this.onMove),this.map.once("mouseup",this.onUp)}},closeMeasure(){this.points=[],this.map.off("touchend",this.measureMapClick),this.map.off("click",this.measureMapClick),this.map.off("mousemove",this.mouseMove),this.map.getCanvas().style.cursor="grab",this.modalVisible=!1,this.removeLinearLayer()},toggleMeasure(){!this.activeTool||this.activeTool!=="length"?this.setActiveTool&&this.setActiveTool("length"):this.setActiveTool&&this.setActiveTool(null),this.modalVisible=!this.modalVisible,this.modalVisible?this.initMeasureLayer():this.closeMeasure()}},computed:{buttonClasses(){return{"!bg-[#DBEAFE]":this.modalVisible,"bg-white":!this.modalVisible}}}},LS={key:0,class:"max-w-[412px] absolute w-full top-[20px] right-[60px] bg-white border rounded-[15px] p-4 z-10"},RS={class:"flex justify-between items-center border-b pb-[16px]"},BS={class:"pt-[16px]"},DS={class:"text-[14px] font-medium text-[#6B7280] mb-[16px]"},VS={key:0,class:"flex items-center mb-4"},zS={key:1,class:"text-[14px] font-bold",ref:"distanceContainer"};function FS(u,f,_,b,k,T){const x=g.resolveComponent("closeIcon"),s=g.resolveComponent("VsPopover"),V=g.resolveComponent("VsSwitch"),P=g.resolveComponent("rulerIcon");return g.openBlock(),g.createElementBlock("div",null,[(g.openBlock(),g.createBlock(g.Teleport,{to:"#maplibre-demo-map"},[k.modalVisible&&_.activeTool==="length"?(g.openBlock(),g.createElementBlock("div",LS,[g.createElementVNode("div",RS,[f[3]||(f[3]=g.createElementVNode("div",{class:"text-[20px]"},"Лінійка",-1)),g.createVNode(s,{trigger:"hover",teleport:"body"},{reference:g.withCtx(()=>[g.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:f[0]||(f[0]=(...L)=>T.toggleMeasure&&T.toggleMeasure(...L))},[g.createVNode(x,{class:"cursor-pointer"})])]),default:g.withCtx(()=>[f[2]||(f[2]=g.createTextVNode(" Приховати панель "))]),_:1,__:[2]})]),g.createElementVNode("div",BS,[g.createElementVNode("p",DS,[k.points.length?g.createCommentVNode("",!0):(g.openBlock(),g.createElementBlock(g.Fragment,{key:0},[g.createTextVNode(" Натисніть на мапу, щоб додати першу точку. ")],64)),k.points.length==1?(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createTextVNode(" Натисніть на мапу, щоб додати другу точку. ")],64)):g.createCommentVNode("",!0),k.points.length>1?(g.openBlock(),g.createElementBlock(g.Fragment,{key:2},[g.createTextVNode(" Продовжуйте натискати для додавання нових точок. Точки можна рухати. ")],64)):g.createCommentVNode("",!0)]),k.points.length>=3?(g.openBlock(),g.createElementBlock("div",VS,[g.createVNode(V,{modelValue:k.distanceType,"onUpdate:modelValue":f[1]||(f[1]=L=>k.distanceType=L),onChange:T.setPoints},null,8,["modelValue","onChange"]),f[4]||(f[4]=g.createElementVNode("span",{class:"text-[14px] font-medium text-[#6B7280] ml-2"},"загальна | до точки",-1))])):g.createCommentVNode("",!0),k.points.length>=2?(g.openBlock(),g.createElementBlock("div",zS,[f[5]||(f[5]=g.createTextVNode(" Загальна відстань: ")),g.createElementVNode("span",null,g.toDisplayString(k.distance.toLocaleString())+" км",1)],512)):g.createCommentVNode("",!0)])])):g.createCommentVNode("",!0)])),g.createVNode(s,{trigger:"hover",placement:"left",teleport:"body",class:"flex"},{reference:g.withCtx(()=>[g.createVNode(P,{class:g.normalizeClass([T.buttonClasses,"w-full h-auto p-[9px] [transition:.3s] hover:[transition:.3s] text-[24px] hover:bg-[#DBEAFE] flex font-normal cursor-pointer text-[#1E40AF] bg-[#fff] rounded-[4px] border-[1px] border-solid border-[#E5E7EB]"]),onClick:T.toggleMeasure},null,8,["class","onClick"])]),default:g.withCtx(()=>[f[6]||(f[6]=g.createElementVNode("div",null,"Виміряти довжину",-1))]),_:1,__:[6]})])}const OS=Gt(MS,[["render",FS],["__scopeId","data-v-401b2f16"]]),NS={props:{bgColor:{type:String,default:"#1E40AF"}}},qS={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},US=["stroke"],jS=["stroke"],WS=["stroke"];function HS(u,f,_,b,k,T){return g.openBlock(),g.createElementBlock("svg",qS,[f[0]||(f[0]=g.createElementVNode("title",null,"Crossed Arrows with Curved Line Icon",-1)),f[1]||(f[1]=g.createElementVNode("desc",null,"Two crossed arrows with a curved line to the right",-1)),g.createElementVNode("path",{d:"M4 19L12 11",stroke:_.bgColor,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},null,8,US),g.createElementVNode("path",{d:"M12 19L4 11",stroke:_.bgColor,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},null,8,jS),g.createElementVNode("path",{d:"M20 12H16C16 10.5 16.442 10 17.5 9.5C18.558 9 20 8.334 20 7.002C20 6.53 19.83 6.072 19.516 5.712C19.196 5.35007 18.7613 5.1092 18.2848 5.02981C17.8083 4.95043 17.319 5.03735 16.899 5.276C16.479 5.515 16.161 5.89 16 6.336",stroke:_.bgColor,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},null,8,WS)])}const ZS=Gt(NS,[["render",HS]]),KS={components:{areaIcon:ZS,closeIcon:md},name:"vs-area-measure",props:{map:{type:Object},activeTool:String,setActiveTool:Function},data(){return{points:[],inputPoint:[],area:0,modalVisible:!1,draggingPointId:null}},watch:{async points(){this.inputPoint=this.points.map(u=>{var f,_;return{id:u.properties.id,value:((_=(f=u==null?void 0:u.geometry)==null?void 0:f.coordinates)==null?void 0:_.reduceRight((b,k)=>[...b,typeof k=="string"?k:k.toFixed(5)],[]).join(","))||""}}),this.setPoints()},activeTool(u,f){u!=="area"&&f==="area"&&(this.closeMeasure(),this.modalVisible=!1),u==="area"&&!this.modalVisible&&(this.modalVisible=!0,this.initMeasureLayer())}},methods:{measureMapClick(u){const f=this.map.queryRenderedFeatures(u.point,{layers:["area-measure-points"]});if(f.length)this.points=this.points.filter(_=>_.properties.id!==f[0].properties.id);else{const _={type:"Feature",geometry:{type:"Point",coordinates:Object.values(u.lngLat)},properties:{id:Math.floor(Math.random()*1e3)}};this.points=this.points.concat(_)}},async setPoints(){const u=this.points.filter(b=>b==null?void 0:b.geometry),f=await tc(u);if(u.length>2){const b=hy([[...u.map(T=>T.geometry.coordinates),u[0].geometry.coordinates]]);this.area=pS(b)/1e6;const k=this.map.getSource("area-linear-area");k&&k.setData(tc([b]))}else{const b=this.map.getSource("area-linear-area");b&&b.setData(tc([]))}u.length>1&&(f.features=f.features.concat(sh(u.map(b=>b.geometry.coordinates))));const _=this.map.getSource("area-measure");_&&_.setData(f)},handleDelete(u){this.points=this.points.filter(f=>f.properties.id!==u)},addCoords(){this.points=this.points.concat({type:"Feature",properties:{id:Math.floor(Math.random()*1e3)},geometry:null})},handleChange(){this.points=this.inputPoint.map(u=>{if(/^([^,]*,[^,]*)$/.test(u.value)){const f=u.value.split(",").reverse();if(f[0]<-90||f[0]>90||f[1]>180||f[1]<-180)this.$notify({type:"error",title:"Помилка",message:"Недійсні координати!"});else return{type:"Feature",geometry:{type:"Point",coordinates:f},properties:{id:u.id}}}else this.$notify({type:"error",title:"Помилка",message:"Недійсні координати!"})})},removeLinearLayer(){["area-measure-lines","area-measure-points","area-linear-area-fill","center-symbol"].forEach(_=>{this.map.getLayer(_)&&this.map.removeLayer(_)}),["area-measure","area-linear-area"].forEach(_=>{this.map.getSource(_)&&this.map.removeSource(_)}),this.area=0},createLinearLayer(){this.map.addSource("area-measure",{type:"geojson",data:{type:"FeatureCollection",features:[]}}),this.map.addLayer({id:"area-measure-lines",type:"line",source:"area-measure",layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#000","line-width":2.5},filter:["in","$type","LineString"]}),this.map.addLayer({id:"area-measure-points",type:"circle",source:"area-measure",paint:{"circle-radius":4.5,"circle-color":"#fff","circle-stroke-width":2,"circle-stroke-color":"#000"},filter:["in","$type","Point"]}),this.createAreaLayer(),this.map.on("mousemove",this.mouseMove)},mouseMove(u){const f=this.map.queryRenderedFeatures(u.point,{layers:["area-measure-points"]});this.map.getCanvas().style.cursor=f.length?"move":"crosshair"},createAreaLayer(){this.map.addSource("area-linear-area",{type:"geojson",data:{type:"FeatureCollection",features:[]}}),this.map.addLayer({id:"area-linear-area-fill",type:"fill",source:"area-linear-area",layout:{},paint:{"fill-color":"#000","fill-opacity":.06}})},initMeasureLayer(){this.createLinearLayer(),this.map.on("mousedown","area-measure-points",this.handleDrag),this.map.on("click",this.measureMapClick),this.map.on("touchend",this.measureMapClick)},onMove(u){const f=u.lngLat;this.points=this.points.map(_=>_.properties.id===this.draggingPointId?{..._,geometry:{..._.geometry,coordinates:[f.lng,f.lat]}}:_),this.setPoints()},onUp(){this.map.off("mousemove",this.onMove),this.draggingPointId=null},handleDrag(u){u.preventDefault();const f=this.map.queryRenderedFeatures(u.point,{layers:["area-measure-points"]});if(f.length){const _=f[0].properties.id;this.draggingPointId=_,this.map.on("mousemove",this.onMove),this.map.once("mouseup",this.onUp)}},closeMeasure(){this.points=[],this.map.off("touchend",this.measureMapClick),this.map.off("click",this.measureMapClick),this.map.off("mousemove",this.mouseMove),this.map.getCanvas().style.cursor="grab",this.modalVisible=!1,this.removeLinearLayer()},toggleMeasure(){!this.activeTool||this.activeTool!=="area"?this.setActiveTool&&this.setActiveTool("area"):this.setActiveTool&&this.setActiveTool(null),this.modalVisible=!this.modalVisible,this.modalVisible?this.initMeasureLayer():this.closeMeasure()}},computed:{modalButtonClasses(){return{"!bg-[#DBEAFE]":this.modalVisible,"bg-white":!this.modalVisible}}}},GS={key:0,class:"max-w-[412px] absolute w-full top-[20px] right-[60px] bg-white border rounded-[15px] p-4 z-10"},JS={class:"flex justify-between items-center border-b pb-[16px]"},XS={class:"pt-[16px]"},QS={class:"text-[14px] font-medium text-[#6B7280] mb-[16px]"},YS={key:0,ref:"distanceContainer",class:"text-[14px] font-bold"};function $S(u,f,_,b,k,T){const x=g.resolveComponent("closeIcon"),s=g.resolveComponent("VsPopover"),V=g.resolveComponent("areaIcon");return g.openBlock(),g.createElementBlock("div",null,[(g.openBlock(),g.createBlock(g.Teleport,{to:"#maplibre-demo-map"},[k.modalVisible&&_.activeTool==="area"?(g.openBlock(),g.createElementBlock("div",GS,[g.createElementVNode("div",JS,[f[2]||(f[2]=g.createElementVNode("div",{class:"text-lg"},"Площа",-1)),g.createVNode(s,{trigger:"hover",teleport:"body"},{reference:g.withCtx(()=>[g.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:f[0]||(f[0]=(...P)=>T.toggleMeasure&&T.toggleMeasure(...P))},[g.createVNode(x,{class:"cursor-pointer"})])]),default:g.withCtx(()=>[f[1]||(f[1]=g.createTextVNode(" Приховати панель "))]),_:1,__:[1]})]),g.createElementVNode("div",XS,[g.createElementVNode("p",QS,[k.points.length?g.createCommentVNode("",!0):(g.openBlock(),g.createElementBlock(g.Fragment,{key:0},[g.createTextVNode(" Натисніть на мапу, щоб додати першу точку. ")],64)),k.points.length==1?(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createTextVNode(" Натисніть на мапу, щоб додати другу точку. ")],64)):g.createCommentVNode("",!0),k.points.length>1?(g.openBlock(),g.createElementBlock(g.Fragment,{key:2},[g.createTextVNode(" Продовжуйте натискати для додавання нових точок. Точки можна рухати. ")],64)):g.createCommentVNode("",!0)]),k.points.length>2?(g.openBlock(),g.createElementBlock("div",YS,[f[3]||(f[3]=g.createTextVNode(" Загальна площа: ")),g.createElementVNode("span",null,g.toDisplayString(k.area.toLocaleString())+" км²",1)],512)):g.createCommentVNode("",!0)])])):g.createCommentVNode("",!0)])),g.createVNode(s,{trigger:"hover",placement:"left",teleport:"body",class:"flex"},{reference:g.withCtx(()=>[g.createVNode(V,{onClick:T.toggleMeasure,class:g.normalizeClass([T.modalButtonClasses,"w-full h-auto p-[9px] [transition:.3s] hover:[transition:.3s] text-[24px] hover:bg-[#DBEAFE] flex font-normal cursor-pointer text-[#1E40AF] bg-[#fff] rounded-[4px] border-[1px] border-solid border-[#E5E7EB]"])},null,8,["onClick","class"])]),default:g.withCtx(()=>[f[4]||(f[4]=g.createElementVNode("div",null,"Виміряти площу",-1))]),_:1,__:[4]})])}const ek=Gt(KS,[["render",$S],["__scopeId","data-v-024154e1"]]),Ku={__name:"vs-map-widget-column",props:{position:String,widgets:Array,map:Object,mapLoaded:Boolean,cardValues:Object,hasFilters:Boolean,currentFilterLayer:Object,enabledLayerIds:Array,getWidgetComponent:Function,getColumnWidth:Function,rightColumnOffset:[String,Number],maxHeight:Number,history:Boolean},emits:["set-filter-layer","update:enabledLayerIds","cardValuesId","closeCard","content-resize"],setup(u,{expose:f,emit:_}){const b=_,k=u,T=g.ref(k.widgets.map(P=>{var L;return{...P,config:{...P.config,visible:((L=P.config)==null?void 0:L.visible)!==!1}}}));g.watch(()=>k.widgets.map(P=>P.id||P.type).join(","),()=>{T.value=k.widgets.map(P=>{var L;return{...P,config:{...P.config,visible:((L=P.config)==null?void 0:L.visible)!==!1}}})});function x(P){const L=T.value.find(F=>F.id===P);L&&L.config&&(L.config.visible=!L.config.visible,setTimeout(()=>{b("content-resize")},30))}const s=g.ref(null);f({columnRef:s});let V=null;return g.onMounted(()=>{V=new MutationObserver(()=>{var P;clearTimeout((P=s.value)==null?void 0:P._resizeTimeout),s.value._resizeTimeout=setTimeout(()=>{b("content-resize")},30)}),s.value&&V.observe(s.value,{childList:!0,subtree:!0,characterData:!0})}),g.onUnmounted(()=>{V&&V.disconnect()}),(P,L)=>u.mapLoaded?(g.openBlock(),g.createElementBlock("div",{key:0,class:"widget-column",ref_key:"columnRef",ref:s,style:g.normalizeStyle({width:u.getColumnWidth(u.position),paddingRight:u.rightColumnOffset})},[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.value,F=>{var M;return g.openBlock(),g.createElementBlock(g.Fragment,{key:F.id||F.type},[F.type!=="card"?g.withDirectives((g.openBlock(),g.createBlock(g.resolveDynamicComponent(u.getWidgetComponent(F.type)),{key:0,map:u.map,config:F.config,hasFilters:u.hasFilters,currentLayer:u.currentFilterLayer,enabledLayerIds:u.enabledLayerIds,history:u.history,onSetFilterLayer:L[0]||(L[0]=E=>P.$emit("set-filter-layer",E)),"onUpdate:enabledLayerIds":L[1]||(L[1]=E=>P.$emit("update:enabledLayerIds",E)),onCardValuesId:L[2]||(L[2]=E=>P.$emit("cardValuesId",E)),onShowWidget:x,onCatalogLayers:L[3]||(L[3]=E=>P.$emit("catalog-layers",E)),class:"widget"},null,40,["map","config","hasFilters","currentLayer","enabledLayerIds","history"])),[[g.vShow,((M=F.config)==null?void 0:M.visible)!==!1]]):g.createCommentVNode("",!0),u.cardValues&&F.type==="card"?(g.openBlock(),g.createBlock(ty,{key:1,config:F.config,cardValues:u.cardValues,class:"widget",onClose:L[4]||(L[4]=E=>P.$emit("closeCard"))},null,8,["config","cardValues"])):g.createCommentVNode("",!0)],64)}),128))],4)):g.createCommentVNode("",!0)}},tk={class:"map-widgets-flex"},rk={class:"widgets-left"},ik={class:"widgets-top"},nk={class:"widgets-bottom"},sk={class:"widgets-right"},ok={class:"widgets-top"},ak={class:"widgets-bottom"},lk={class:"absolute top-[180px] right-2 z-10 flex flex-col gap-[5px]"},ck={__name:"vs-map",props:{table:{type:String,required:!0},height:{type:String,required:!0}},setup(u){const f=u,_=g.ref(null),b=g.ref(!1);let k=null;const T=g.ref(null),x=g.ref(null),s=g.ref([]),V=g.ref([]),P=g.ref(null),L=g.ref(null),F=g.ref(null),M=g.ref([]);let E=null;function C(et){return!F.value||!F.value.widgets?[]:et==="center"?[...F.value.widgets.filter(ut=>(ut.position||{})==="center")||[],...V.value.filter(ut=>ut.position==="center")]:F.value.widgets.filter(Qe=>(Qe.position||{})===et)||[]}Hu.registerHelper("eq",(et,Qe)=>et===Qe),Hu.registerHelper("formatDate",et=>et?new Date(et).toLocaleDateString():"Немає дати"),Hu.registerHelper("get",(et,Qe)=>(et==null?void 0:et[Qe])??"");const W=(et,Qe,ut)=>{try{if(et)if(ut==="markdown"){const xt=et.replace(/\{\{([^}]+)\}\}/g,(ot,ht)=>{try{return new Function("data",`with(data) { return ${ht} }`)(Qe)}catch{return""}});return or(xt)}else return Hu.compile(et)(Qe)}catch(xt){return console.error("Error processing template:",xt),et}},J=(et,Qe,ut,xt,ot)=>{const ht=W(et,xt,ot),Ct=Qe?W(Qe,xt,ot):"";let _t="";return ut!=null&&ut.length&&(_t=ut.map(dt=>{const er=W(dt.value,xt,ot);return`
823
- <tr class="flex justify-between items-center">
824
- <td class="font-medium mr-1.5 flex items-center">${dt.label}</td>
825
- <td class="text-right">${er}</td>
826
- </tr>
827
- `}).join("")),`
828
- <div class="absolute min-w-28 max-w-[300px] bg-white/90 border border-gray-200 rounded-lg shadow-md text-gray-800 pointer-events-none">
829
- ${ht?`
830
- <div class="font-semibold text-sm border-b border-solid border-gray-200 text-gray-800 rounded-t-lg px-2 py-1">
831
- <h3>${ht}</h3>
832
- </div>
833
- `:""}
834
- ${Qe?`<div class="text-sm px-2 py-1 break-words">${Ct}</div>`:""}
835
- ${ut!=null&&ut.length&&!Qe?`
836
- <div class="text-xs px-2 py-0.5 text-gray-500">
837
- <table class="w-full">
838
- <tbody>${_t}</tbody>
839
- </table>
840
- </div>
841
- `:""}
842
- </div>
843
- `},se=et=>({legend:wx,basemaps:Tx,layers:rb,info:ub,attribute:Wb,catalog:_2,filters:nw,"inline-filters":cw,list:ww,card:ty})[et],oe=g.computed(()=>!!F.value&&Array.isArray(F.value.widgets)&&F.value.widgets.some(et=>et.type==="filters")),Se=et=>{T.value=et};function $(){const et=new URLSearchParams(window.location.search),Qe=parseFloat(et.get("x")),ut=parseFloat(et.get("y")),xt=parseFloat(et.get("z")),ot=parseFloat(et.get("bearing")),ht=parseFloat(et.get("pitch"));return{center:isFinite(Qe)&&isFinite(ut)?[Qe,ut]:null,zoom:isFinite(xt)?xt:null,bearing:isFinite(ot)?ot:null,pitch:isFinite(ht)?ht:null}}function de({center:et,zoom:Qe,bearing:ut,pitch:xt}){const ot=new URLSearchParams(window.location.search);ot.set("x",et[0].toFixed(5)),ot.set("y",et[1].toFixed(5)),ot.set("z",Qe.toFixed(2)),ot.set("bearing",ut.toFixed(2)),ot.set("pitch",xt.toFixed(2));const ht=`${window.location.pathname}?${ot.toString()}`;window.history.replaceState({},"",ht)}const Ce=()=>{var ht,Ct,_t;if(!F.value||!F.value.map)return;const et={version:8,glyphs:"https://cdn.softpro.ua/data/fonts/{fontstack}/{range}.pbf",sources:{},layers:[]};let Qe=F.value.map.center,ut=F.value.map.zoom,xt=F.value.map.bearing||0,ot=F.value.map.pitch||0;if(F.value.history){const dt=$();dt.center&&(Qe=dt.center),dt.zoom!==null&&(ut=dt.zoom),dt.bearing!==null&&(xt=dt.bearing),dt.pitch!==null&&(ot=dt.pitch)}_.value=new ed.Map({container:"maplibre-demo-map",style:et,center:Qe,zoom:ut,bearing:xt,pitch:ot,maxBounds:[18.0856083513,40.3614785833,58.0807890155,56.3350745713]}),(_t=(Ct=(ht=F==null?void 0:F.value)==null?void 0:ht.interactions)==null?void 0:Ct.navigation)!=null&&_t.enabled&&!E&&(E=new ed.NavigationControl({showCompass:!0,showZoom:!0,visualizePitch:!0}),_.value.addControl(E,"top-right")),_.value.on("load",async()=>{var Yt,Fi,Qt,Rr,ai;b.value=!0,await $2(_.value);const dt=$(),er=dt.center&&dt.zoom!==null;if((Yt=F.value.map)!=null&&Yt.bbox&&!er){const[ir,Xt,bt,Er]=F.value.map.bbox;_.value.fitBounds([[ir,Xt],[bt,Er]],{padding:50,duration:0})}if(await(async()=>{var Xt,bt,Er,Br,Cr;const ir=((Cr=(Br=(Er=(bt=(Xt=F.value)==null?void 0:Xt.widgets)==null?void 0:bt.find(zt=>zt.type==="layers"))==null?void 0:Er.config)==null?void 0:Br.layers)==null?void 0:Cr.filter(zt=>{var qr;return((qr=zt.style)==null?void 0:qr.attrType)==="icon-by-attribute"}))||[];for(const zt of ir){const{rules:qr,default_icon:li,icon_base_url:wi}=zt.style,Dr=[...qr.map(nr=>nr.icon),li].filter(Boolean);for(const nr of Dr)try{const Vr=`${wi}${nr}`,we=await _.value.loadImage(Vr);_.value.hasImage(nr)||_.value.addImage(nr,we.data)}catch(Vr){console.error(`Failed to load icon: ${nr}`,Vr)}}})(),(Rr=(Qt=(Fi=F.value)==null?void 0:Fi.interactions)==null?void 0:Qt.hover)!=null&&Rr.enabled&&(_.value.on("mousemove",ir=>{var qr,li,wi,Dr,nr,Vr,we,Q,X,re;const Xt=_.value.queryRenderedFeatures(ir.point);if(_.value&&_.value.getCanvas&&(_.value.getCanvas().style.cursor=Xt.length?"pointer":""),!Xt.length){if(x.value){const ce=(qr=_.value.getSource(x.value.source))==null?void 0:qr.type;x.value.source,x.value.id,ce==="vector"&&x.value.source,vt(_.value,x.value.source,x.value.id,{hovered:!1}),x.value=null}k&&(k.remove(),k=null);return}const bt=Xt[0];if(!x.value||x.value.id!==bt.id||x.value.source!==bt.layer.source){if(x.value){const _e=(li=_.value.getSource(x.value.source))==null?void 0:li.type;x.value.source,x.value.id,_e==="vector"&&x.value.source,vt(_.value,x.value.source,x.value.id,{hovered:!1})}const ce=(wi=_.value.getSource(bt.layer.source))==null?void 0:wi.type;bt.layer.source,bt.id,ce==="vector"&&bt.layer.source,vt(_.value,bt.layer.source,bt.id,{hovered:!0}),x.value={source:bt.layer.source,id:bt.id}}const Er=(nr=(Dr=F.value)==null?void 0:Dr.widgets)==null?void 0:nr.find(ce=>ce.type==="layers"),Br=(we=(Vr=F.value)==null?void 0:Vr.widgets)==null?void 0:we.find(ce=>ce.type==="attribute");let Cr=null;if(Er&&(Cr=Er.config.layers.find(ce=>ce.id===bt.layer.source)),(X=(Q=F.value)==null?void 0:Q.widgets)==null?void 0:X.find(ce=>ce.type==="catalog")){if(!Xt.length){k&&(k.style.display="none");return}const ce=Xt[0];k=Pi(ce,ir,k);return}if(!Cr&&Br&&Br.config.layer.id===bt.layer.source&&(Cr=Br.config.layer),(re=Cr==null?void 0:Cr.style)!=null&&re.popup){const ce=Cr.style.popup;let _e=ce.title,te="";ce.mode==="markdown"?te=Array.isArray(ce.content)?ce.content.join(`
844
-
845
- `):"":te=Array.isArray(ce.content)?ce.content.join(""):"",k||(k=document.createElement("div"),_.value.getContainer().appendChild(k)),k.innerHTML=J(_e,te,ce.fields,bt.properties,ce.mode),Lr(k,ir)}}),_.value.on("mouseleave",()=>{var ir;if(k&&(k.remove(),k=null),x.value){const Xt=(ir=_.value.getSource(x.value.source))==null?void 0:ir.type;x.value.source,x.value.id,Xt==="vector"&&x.value.source,vt(_.value,x.value.source,x.value.id,{hovered:!1}),x.value=null}_.value&&_.value.getCanvas&&(_.value.getCanvas().style.cursor="")})),_.value.on("click",async ir=>{var li,wi,Dr,nr,Vr,we,Q;if(Re(),["length","area","print"].includes(L.value))return;const Xt=_.value.queryRenderedFeatures(ir.point);if(!Xt.length)return;const bt=Xt[0],Er=(wi=(li=F.value)==null?void 0:li.widgets)==null?void 0:wi.find(X=>X.type==="layers"),Br=(nr=(Dr=F.value)==null?void 0:Dr.widgets)==null?void 0:nr.find(X=>X.type==="attribute"),Cr=(we=(Vr=F.value)==null?void 0:Vr.widgets)==null?void 0:we.find(X=>X.type==="catalog");let zt;if(Cr?zt=bt.layer.source:zt=(Br==null?void 0:Br.config.layer)||(Er==null?void 0:Er.config.layers.find(X=>X.id===bt.layer.source)),zt!=null&&zt.noCard)return;s.value.forEach(X=>{var ce;const re=(ce=_.value.getSource(X.source))==null?void 0:ce.type;X.source,X.id,re==="vector"&&X.source,vt(_.value,X.source,X.id,{selected:!1})}),s.value=[];const qr=(Q=_.value.getSource(bt.layer.source))==null?void 0:Q.type;bt.layer.source,bt.id,qr==="vector"&&bt.layer.source,vt(_.value,bt.layer.source,bt.id,{selected:!0}),s.value.push({source:bt.layer.source,id:bt.id}),P.value={layer:(zt==null?void 0:zt.service_key)||zt||"",map:(zt==null?void 0:zt.map_key)||"",id:bt.properties.id,title:(zt==null?void 0:zt.title)||""}}),_.value.on("dblclick",ir=>{var Er,Br,Cr;if(Re(),["length","area","print"].includes(L.value))return;Jt([ir.lngLat.lng,ir.lngLat.lat]);const Xt=(Br=(Er=F.value)==null?void 0:Er.widgets)==null?void 0:Br.find(zt=>zt.type==="layers");let bt=null;(Cr=Xt==null?void 0:Xt.config)!=null&&Cr.layers&&(bt=Xt.config.layers.find(zt=>zt.visible!==!1&&["tms","wms","raster"].includes((zt.service_type||zt.service||"").toLowerCase()))),!(bt!=null&&bt.noCard)&&(P.value={layer:(bt==null?void 0:bt.map_key)||"",map:(bt==null?void 0:bt.service_key)||"",id:"",title:(bt==null?void 0:bt.title)||""})}),_.value.resize(),(ai=F==null?void 0:F.value)!=null&&ai.history){const ir=()=>{const Xt=_.value.getCenter();de({center:[Xt.lng,Xt.lat],zoom:_.value.getZoom(),bearing:_.value.getBearing(),pitch:_.value.getPitch()})};_.value.on("moveend",ir),_.value.on("rotate",ir),_.value.on("pitch",ir)}})},Re=()=>{xi(),s.value.forEach(et=>{_.value&&vt(_.value,et.source,et.id,{selected:!1})}),s.value=[],P.value=null};g.onMounted(async()=>{await kt(),await g.nextTick(),Ce();const et=document.getElementById("maplibre-demo-map");et&&et.addEventListener("mouseleave",()=>{k&&(k.remove(),k=null)}),g.watch(()=>f.table,async Qe=>{if(Qe){if(Re(),L.value=null,k&&(k.remove(),k=null),_.value){try{_.value.remove()}catch{}_.value=null,b.value=!1}await kt(),await g.nextTick(),Ce()}})});const Ze=g.computed(()=>({height:(f==null?void 0:f.height)||"100vh",width:"100%"})),kt=async()=>{const et=await kr.get(`/api/map/${f.table}`);F.value=et.data},tt=et=>{if(!F.value||!F.value.widgets)return"400px";const Qe=F.value.widgets.find(ut=>ut.position===et);return(Qe==null?void 0:Qe.width)||"400px"},Ge=g.ref([]);g.watch(()=>F.value,et=>{et&&et.map&&(Ge.value=it(),Ce())});const it=()=>{var Qe;if(!F.value||!F.value.widgets)return[];const et=F.value.widgets.find(ut=>ut.type==="layers");return(Qe=et==null?void 0:et.config)!=null&&Qe.layers?et.config.layers.map(ut=>({...ut,visible:ut.visible??!1})).filter(ut=>ut.visible).map(ut=>ut.id):[]};function vt(et,Qe,ut,xt){et.getStyle().layers.filter(ht=>ht.source===Qe).forEach(ht=>{var _t;const Ct={source:Qe,id:ut};((_t=et.getSource(Qe))==null?void 0:_t.type)==="vector"&&ht["source-layer"]&&(Ct.sourceLayer=ht["source-layer"]),et.setFeatureState(Ct,xt)})}const Lt=g.computed(()=>!!F.value&&!!F.value.interactions&&!!F.value.interactions.navigation&&F.value.interactions.navigation.enabled),Ar=g.computed(()=>!!F.value&&Array.isArray(F.value.tools)&&F.value.tools.length>0),hr=g.computed(()=>Lt.value||Ar.value?"40px":"20px");function xi(){_.value&&(_.value.getLayer("layer-with-pulsing-dot")&&_.value.removeLayer("layer-with-pulsing-dot"),_.value.getSource("dot-point")&&_.value.removeSource("dot-point"),_.value.hasImage&&_.value.hasImage("pulsing-dot")&&_.value.removeImage("pulsing-dot"))}function Jt(et){var xt,ot,ht,Ct;xi();const Qe=80,ut={width:Qe,height:Qe,data:new Uint8Array(Qe*Qe*4),onAdd(){const _t=document.createElement("canvas");_t.width=this.width,_t.height=this.height,this.context=_t.getContext("2d",{willReadFrequently:!0})},render(){var Qt;const dt=performance.now()%2e3/2e3,er=Qe/2*.3,bi=Qe/2*.7*dt+er,{context:Yt}=this;Yt.clearRect(0,0,this.width,this.height),Yt.beginPath(),Yt.arc(this.width/2,this.height/2,bi,0,Math.PI*2),Yt.fillStyle=`rgba(255, 100, 100, ${1-dt})`,Yt.fill();const Fi=Qe/2*.7*(dt-.5<0?dt-.5+1:dt-.5)+er;return Yt.beginPath(),Yt.arc(this.width/2,this.height/2,Fi,0,Math.PI*2),Yt.fillStyle=`rgba(255, 100, 100, ${1-(dt-.5<0?dt-.5+1:dt-.5)})`,Yt.fill(),this.data=Yt.getImageData(0,0,this.width,this.height).data,(Qt=_.value)==null||Qt.triggerRepaint(),!0}};(xt=_.value)!=null&&xt.hasImage("pulsing-dot")||(ot=_.value)==null||ot.addImage("pulsing-dot",ut,{pixelRatio:2}),(ht=_.value)==null||ht.addSource("dot-point",{type:"geojson",data:{type:"Feature",geometry:{type:"Point",coordinates:et}}}),(Ct=_.value)==null||Ct.addLayer({id:"layer-with-pulsing-dot",type:"symbol",source:"dot-point",layout:{"icon-image":"pulsing-dot"},paint:{"icon-opacity":.6}})}const nn=g.computed(()=>{var et,Qe,ut,xt,ot,ht,Ct,_t,dt,er;return{center:(Qe=(et=F==null?void 0:F.value)==null?void 0:et.map)==null?void 0:Qe.center,zoom:(xt=(ut=F==null?void 0:F.value)==null?void 0:ut.map)==null?void 0:xt.zoom,pitch:((ht=(ot=F==null?void 0:F.value)==null?void 0:ot.map)==null?void 0:ht.pitch)||0,bearing:((_t=(Ct=F==null?void 0:F.value)==null?void 0:Ct.map)==null?void 0:_t.bearing)||0,bbox:((er=(dt=F==null?void 0:F.value)==null?void 0:dt.map)==null?void 0:er.bbox)||null}}),Ei={home:Lw,print:Ow,geolocation:cS,pitch:Uw,length:OS,area:ek},kn=et=>{L.value=et};function Kr(et){if(!F.value||!F.value.widgets)return;const Qe=F.value.widgets.find(ot=>ot.type==="list");if(!Qe||!Qe.config)return;const{map_key:ut,service_key:xt}=Qe.config;ut&&xt&&(P.value={id:et,map:ut,layer:xt})}const as=g.computed(()=>F.value&&F.value.widgets?F.value.widgets.filter(et=>et.position==="absolute"):[]);function Pi(et,Qe,ut){const xt=et.properties,ot=M.value.find(Qt=>String(Qt.id)===String(et.source)),ht=Array.isArray(ot==null?void 0:ot.popup)?ot.popup:[],_t=ht.filter(Qt=>Qt.meta==="image").map(Qt=>xt==null?void 0:xt[Qt.name]).filter(Boolean),dt=_t.length>0?`
846
- <div class="popup-image-single overflow-hidden rounded-t-xl" style="width:260px;height:160px;margin:0 auto 0 auto;">
847
- <img src="${_t[0]}" style="width:100%;height:100%;object-fit:cover;border-radius:12px 12px 0 0;display:block;" />
848
- </div>
849
- `:"",er=ht.find(Qt=>Qt.meta==="title"),bi=er?xt==null?void 0:xt[er.name]:"";let Yt=ht.filter(Qt=>Qt.meta!=="title"&&Qt.meta!=="image").map(Qt=>{const Rr=xt==null?void 0:xt[Qt.name];let ai=Rr??"-";switch(Qt.meta){case"badge":ai=Rr?`<span class="inline-block rounded px-2 py-0.5 text-xs bg-yellow-100 text-yellow-800 ">${Rr}</span>`:"-";break}return`
850
- <tr style="display: table-row;">
851
- <td style="display: table-cell; padding: 2px 8px 2px 0; vertical-align: middle; font-weight: 500; width: 50%; text-align: left;">${Qt.ua||Qt.name}</td>
852
- <td style="display: table-cell; padding: 2px 0 2px 8px; vertical-align: middle; width: 50%; text-align: right;">${ai}</td>
853
- </tr>
854
- `}).join("");ht.length||(Yt=Object.keys(xt).map(Qt=>`
855
- <tr style="display: table-row;">
856
- <td style="display: table-cell; padding: 2px 8px 2px 0; vertical-align: middle; font-weight: 500; width: 50%; text-align: left;">${Qt}</td>
857
- <td style="display: table-cell; padding: 2px 0 2px 8px; vertical-align: middle; width: 50%; text-align: right;">${xt[Qt]||"-"}</td>
858
- </tr>
859
- `).join(""));const Fi=`
860
- <div class="absolute min-w-[250px] max-w-[300px] bg-white/90 border border-gray-200 rounded-lg shadow-md text-gray-800 pointer-events-none" style="display: flex; flex-direction: column; justify-content: center;">
861
- ${dt}
862
- ${bi?`<div class="font-semibold text-sm border-b border-solid border-gray-200 text-gray-800 px-2 py-1">${bi}</div>`:""}
863
- <div class="text-xs px-2 py-0.5 text-gray-500" style="display: flex; justify-content: center; align-items: center; flex: 1;">
864
- <table class="w-full" style="border-collapse: collapse; border: none; margin: 0 auto;">
865
- <tbody>${Yt}</tbody>
866
- </table>
867
- </div>
868
- </div>
869
- `;return ut||(ut=document.createElement("div"),ut.className="custom-popup absolute z-50",document.body.appendChild(ut)),ut.innerHTML=Fi,Lr(ut,Qe),ut}function Lr(et,Qe){const ut=et.offsetWidth,xt=et.offsetHeight,ot=document.getElementById("maplibre-demo-map"),ht=ot.getBoundingClientRect(),Ct=Qe.originalEvent.clientX-ht.left,_t=Qe.originalEvent.clientY-ht.top;let dt=Ct-ut/2;dt=Math.max(10,Math.min(dt,ht.width-ut-10));let er;_t-xt-10>0?er=_t-xt-5:_t+xt+10<ht.height?er=_t+10:er=Math.max(10,ht.height-xt-10),et.style.position="absolute",et.style.left=`${dt+20}px`,et.style.top=`${er+10}px`,et.parentNode!==ot&&ot.appendChild(et)}return(et,Qe)=>{var ut,xt;return g.openBlock(),g.createElementBlock("div",{class:"maplibre-demo-map-container",style:g.normalizeStyle(Ze.value)},[Qe[10]||(Qe[10]=g.createElementVNode("div",{id:"maplibre-demo-map"},null,-1)),b.value?(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createElementVNode("div",tk,[g.createElementVNode("div",rk,[g.createElementVNode("div",ik,[(g.openBlock(),g.createElementBlock(g.Fragment,null,g.renderList(["top-left"],ot=>{var ht,Ct;return g.createVNode(Ku,{key:ot,position:ot,widgets:C(ot),map:_.value,mapLoaded:b.value,cardValues:P.value,hasFilters:oe.value,history:(Ct=(ht=F.value)==null?void 0:ht.value)==null?void 0:Ct.history,currentFilterLayer:T.value,enabledLayerIds:Ge.value,getWidgetComponent:se,getColumnWidth:tt,rightColumnOffset:ot==="top-right"?hr.value:void 0,onSetFilterLayer:Se,"onUpdate:enabledLayerIds":Qe[0]||(Qe[0]=_t=>Ge.value=_t),onCardValuesId:Kr,onCloseCard:Re,onCatalogLayers:Qe[1]||(Qe[1]=_t=>M.value=_t)},null,8,["position","widgets","map","mapLoaded","cardValues","hasFilters","history","currentFilterLayer","enabledLayerIds","rightColumnOffset"])}),64))]),g.createElementVNode("div",nk,[(g.openBlock(),g.createElementBlock(g.Fragment,null,g.renderList(["bottom-left"],ot=>{var ht,Ct;return g.createVNode(Ku,{key:ot,position:ot,widgets:C(ot),map:_.value,mapLoaded:b.value,cardValues:P.value,hasFilters:oe.value,history:(Ct=(ht=F.value)==null?void 0:ht.value)==null?void 0:Ct.history,currentFilterLayer:T.value,enabledLayerIds:Ge.value,getWidgetComponent:se,getColumnWidth:tt,rightColumnOffset:ot==="top-right"?hr.value:void 0,onSetFilterLayer:Se,"onUpdate:enabledLayerIds":Qe[2]||(Qe[2]=_t=>Ge.value=_t),onCardValuesId:Kr,onCloseCard:Re,onCatalogLayers:Qe[3]||(Qe[3]=_t=>M.value=_t)},null,8,["position","widgets","map","mapLoaded","cardValues","hasFilters","history","currentFilterLayer","enabledLayerIds","rightColumnOffset"])}),64))])]),g.createElementVNode("div",sk,[g.createElementVNode("div",ok,[(g.openBlock(),g.createElementBlock(g.Fragment,null,g.renderList(["top-right"],ot=>{var ht,Ct;return g.createVNode(Ku,{key:ot,position:ot,widgets:C(ot),map:_.value,mapLoaded:b.value,cardValues:P.value,hasFilters:oe.value,history:(Ct=(ht=F.value)==null?void 0:ht.value)==null?void 0:Ct.history,currentFilterLayer:T.value,enabledLayerIds:Ge.value,getWidgetComponent:se,getColumnWidth:tt,rightColumnOffset:ot==="top-right"?hr.value:void 0,onSetFilterLayer:Se,"onUpdate:enabledLayerIds":Qe[4]||(Qe[4]=_t=>Ge.value=_t),onCardValuesId:Kr,onCloseCard:Re,onCatalogLayers:Qe[5]||(Qe[5]=_t=>M.value=_t)},null,8,["position","widgets","map","mapLoaded","cardValues","hasFilters","history","currentFilterLayer","enabledLayerIds","rightColumnOffset"])}),64))]),g.createElementVNode("div",ak,[(g.openBlock(),g.createElementBlock(g.Fragment,null,g.renderList(["bottom-right"],ot=>{var ht,Ct;return g.createVNode(Ku,{key:ot,position:ot,widgets:C(ot),map:_.value,mapLoaded:b.value,cardValues:P.value,hasFilters:oe.value,history:(Ct=(ht=F.value)==null?void 0:ht.value)==null?void 0:Ct.history,currentFilterLayer:T.value,enabledLayerIds:Ge.value,getWidgetComponent:se,getColumnWidth:tt,rightColumnOffset:ot==="top-right"?hr.value:void 0,onSetFilterLayer:Se,"onUpdate:enabledLayerIds":Qe[6]||(Qe[6]=_t=>Ge.value=_t),onCardValuesId:Kr,onCloseCard:Re,onCatalogLayers:Qe[7]||(Qe[7]=_t=>M.value=_t)},null,8,["position","widgets","map","mapLoaded","cardValues","hasFilters","history","currentFilterLayer","enabledLayerIds","rightColumnOffset"])}),64))])])]),(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(as.value,(ot,ht)=>(g.openBlock(),g.createElementBlock("div",{key:"abs-"+(ot.id||ot.type||ht),class:"absolute z-20",style:g.normalizeStyle(ot.style)},[(g.openBlock(),g.createBlock(g.resolveDynamicComponent(se(ot.type)),{map:_.value,config:ot.config,hasFilters:oe.value,currentFilterLayer:T.value,enabledLayerIds:Ge.value,cardValues:P.value,onSetFilterLayer:Se,"onUpdate:enabledLayerIds":Qe[8]||(Qe[8]=Ct=>Ge.value=Ct),onCardValuesId:Kr,onCloseCard:Re,onCatalogLayers:Qe[9]||(Qe[9]=Ct=>M.value=Ct)},null,40,["map","config","hasFilters","currentFilterLayer","enabledLayerIds","cardValues"]))],4))),128)),g.createElementVNode("div",lk,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList((xt=(ut=F.value)==null?void 0:ut.value)==null?void 0:xt.tools,ot=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:ot},[b.value&&Ei[ot]?(g.openBlock(),g.createBlock(g.resolveDynamicComponent(Ei[ot]),g.mergeProps({key:0,map:_.value,activeTool:L.value,setActiveTool:kn},{ref_for:!0},ot==="home"?{initialView:nn.value}:{},{onCardValuesId:Kr}),null,16,["map","activeTool"])):g.createCommentVNode("",!0)],64))),128))])],64)):(g.openBlock(),g.createBlock(Aw,{key:0}))],4)}}},dy=Gt(ck,[["__scopeId","data-v-cf56a87d"]]),uk={props:{title:{type:String,required:!0},description:{type:String,required:!0}}},hk={class:"text-center mb-12"},pk={class:"text-3xl font-bold mb-4"},dk={class:"text-slate-600 max-w-2xl mx-auto"};function fk(u,f,_,b,k,T){return g.openBlock(),g.createElementBlock("div",hk,[g.createElementVNode("h2",pk,g.toDisplayString(_.title),1),g.createElementVNode("p",dk,g.toDisplayString(_.description),1)])}const mk=Gt(uk,[["render",fk]]),gk=["","січня","лютого","березня","квітня","травня","червня","липня","серпня","вересня","жовтня","листопада","грудня"];function ac(u){if(!u)return"";const[f,_]=u.split(" ");if(!f)return u;const[b,k,T]=f.split("-");if(!b||!k||!T)return u;const x=parseInt(k,10),s=gk[x]||k;let V=`${parseInt(T,10)} ${s} ${b}`;if(_){const P=_.split(".")[0],[L,F,M]=P.split(":");L&&F&&M?V+=`, ${L}:${F}:${M}`:L&&F?V+=`, ${L}:${F}`:L&&(V+=`, ${L}`)}return V}const yk={name:"Template1",props:{items:Array,columns:Array,path:String,id_key:String,query_params:{type:Array,default:()=>[]}},computed:{titleCol(){return this.columns.find(u=>u.meta==="title")},categoryCol(){return this.columns.filter(u=>u.meta==="category")},tagsCol(){return this.columns.filter(u=>u.meta==="tags")},featuresCols(){return this.columns.filter(u=>u.meta==="features")}},methods:{getItemLink(u){if(!this.id_key||!u[this.id_key]){if(!this.query_params||!this.query_params.length)return this.path;const _=this.query_params.map(b=>{const k=Object.keys(b)[0],T=b[k];return`${k}=${encodeURIComponent(u[T])}`}).join("&");return`${this.path}?${_}`}if(!this.query_params||!this.query_params.length)return`${this.path}/${u[this.id_key]}`;const f=this.query_params.map(_=>{const b=Object.keys(_)[0],k=_[b];return`${b}=${encodeURIComponent(u[k])}`}).join("&");return`${this.path}/${u[this.id_key]}?${f}`},formatDate:ac}},_k={class:"flex justify-between p-4 pb-2 bg-slate-50 gap-4"},vk={class:"flex items-center justify-between"},xk={class:"text-lg font-bold line-clamp-2"},bk={key:0,class:"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground ml-2 whitespace-nowrap","data-v0-t":"badge"},wk={key:0,class:"flex"},Sk={key:0,class:"h-fit inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground ml-2 whitespace-nowrap"},kk={class:"p-4 pt-2"},Ak={class:"grid grid-cols-2 gap-3 text-sm"},Ck={class:"text-gray-500"},Tk={class:"font-medium"},Ek={class:"items-center p-3 bg-slate-50 flex justify-end"},Pk=["href"];function Ik(u,f,_,b,k,T){return g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(_.items,x=>{var s,V;return g.openBlock(),g.createElementBlock("div",{key:x.id,class:"rounded-lg border bg-card text-card-foreground overflow-hidden border-none shadow-md relative","data-v0-t":"card"},[g.createElementVNode("div",_k,[g.createElementVNode("div",vk,[g.createElementVNode("h2",xk,g.toDisplayString(x[`${(s=T.titleCol)==null?void 0:s.name}_text`]||x[(V=T.titleCol)==null?void 0:V.name]||"Не вказано"),1),Array.isArray(T.categoryCol)&&T.categoryCol.length?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(T.categoryCol,P=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:P.name},[x[P.name]?(g.openBlock(),g.createElementBlock("div",bk,g.toDisplayString(x[`${P.name}_text`]||x[P.name]),1)):g.createCommentVNode("",!0)],64))),128)):g.createCommentVNode("",!0)]),Array.isArray(T.tagsCol)&&T.tagsCol.length?(g.openBlock(),g.createElementBlock("div",wk,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.tagsCol,P=>(g.openBlock(),g.createElementBlock("div",{key:P.name,class:"mt-2 flex flex-wrap gap-1"},[x[P.name]?(g.openBlock(),g.createElementBlock("span",Sk,g.toDisplayString(x[`${P.name}_text`]||x[P.name]),1)):g.createCommentVNode("",!0)]))),128))])):g.createCommentVNode("",!0)]),g.createElementVNode("div",kk,[g.createElementVNode("div",Ak,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.featuresCols,P=>(g.openBlock(),g.createElementBlock("div",{key:P.name,class:"flex items-center gap-1.5"},[g.createElementVNode("span",Ck,g.toDisplayString(P.ua)+": ",1),g.createElementVNode("span",Tk,[Array.isArray(x[P==null?void 0:P.name])?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(x[P==null?void 0:P.name],(L,F)=>(g.openBlock(),g.createElementBlock("span",{key:F,class:"bg-gray-200 px-1 py-0.5 rounded-lg mr-1"},g.toDisplayString(L),1))),128)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[P.type==="date"?(g.openBlock(),g.createElementBlock(g.Fragment,{key:0},[g.createTextVNode(g.toDisplayString(T.formatDate(x[P==null?void 0:P.name])||"Немає даних"),1)],64)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createTextVNode(g.toDisplayString(x[P==null?void 0:P.name]||"Немає даних"),1)],64))],64))])]))),128))])]),g.createElementVNode("div",Ek,[g.createElementVNode("a",{href:T.getItemLink(x),class:"inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-9 rounded-md px-3"},f[0]||(f[0]=[g.createTextVNode(" Детальніше "),g.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-arrow-right ml-1 h-3.5 w-3.5"},[g.createElementVNode("path",{d:"M5 12h14"}),g.createElementVNode("path",{d:"m12 5 7 7-7 7"})],-1)]),8,Pk)])])}),128)}const Mk=Gt(yk,[["render",Ik]]),Lk={name:"Template2",props:{items:Array,columns:Array,path:String,id_key:String,query_params:{type:Array,default:()=>[]}},computed:{titleCol(){return this.columns.find(u=>u.meta==="title")},categoryCol(){return this.columns?this.columns.filter(u=>u.meta==="category"):[]},tagsCol(){return this.columns?this.columns.filter(u=>u.meta==="tags"):[]},featuresCols(){return this.columns.filter(u=>u.meta==="features")}},methods:{getItemLink(u){if(!this.id_key||!u[this.id_key]){if(!this.query_params||!this.query_params.length)return this.path;const _=this.query_params.map(b=>{const k=Object.keys(b)[0],T=b[k];return`${k}=${encodeURIComponent(u[T])}`}).join("&");return`${this.path}?${_}`}if(!this.query_params||!this.query_params.length)return`${this.path}/${u[this.id_key]}`;const f=this.query_params.map(_=>{const b=Object.keys(_)[0],k=_[b];return`${b}=${encodeURIComponent(u[k])}`}).join("&");return`${this.path}/${u[this.id_key]}?${f}`},formatDate:ac}},Rk={class:"p-0"},Bk={class:"border-l-4 border-l-slate-400"},Dk={class:"p-4"},Vk={class:"flex flex-wrap items-center gap-2 mb-3"},zk={class:"text-lg font-bold"},Fk={key:0,class:"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-green-100 text-green-800 hover:bg-green-100","data-v0-t":"badge"},Ok={key:1,class:"flex"},Nk={key:0,class:"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold border-transparent bg-gray-100 text-gray-800"},qk={class:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-3 text-sm border-t pt-3"},Uk={class:"text-xs text-gray-500 mb-1"},jk={class:"font-medium"},Wk={class:"flex justify-end mt-3 border-t pt-3"},Hk=["href"];function Zk(u,f,_,b,k,T){return g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(_.items,x=>{var s,V;return g.openBlock(),g.createElementBlock("div",{key:x.id,class:"rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden","data-v0-t":"card"},[g.createElementVNode("div",Rk,[g.createElementVNode("div",Bk,[g.createElementVNode("div",Dk,[g.createElementVNode("div",Vk,[g.createElementVNode("h2",zk,g.toDisplayString(x[`${(s=T.titleCol)==null?void 0:s.name}_text`]||x[(V=T.titleCol)==null?void 0:V.name]||"Не вказано"),1),Array.isArray(T.categoryCol)&&T.categoryCol.length?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(T.categoryCol,P=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:P.name},[x[P.name]?(g.openBlock(),g.createElementBlock("div",Fk,g.toDisplayString(x[`${P.name}_text`]||x[P.name]),1)):g.createCommentVNode("",!0)],64))),128)):g.createCommentVNode("",!0),Array.isArray(T.tagsCol)&&T.tagsCol.length?(g.openBlock(),g.createElementBlock("div",Ok,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.tagsCol,P=>(g.openBlock(),g.createElementBlock("div",{key:P.name,class:"flex flex-wrap gap-1 ml-2"},[x[P.name]?(g.openBlock(),g.createElementBlock("span",Nk,g.toDisplayString(x[`${P.name}_text`]||x[P.name]),1)):g.createCommentVNode("",!0)]))),128))])):g.createCommentVNode("",!0)]),g.createElementVNode("div",qk,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.featuresCols,P=>(g.openBlock(),g.createElementBlock("div",{key:P.name},[g.createElementVNode("p",Uk,g.toDisplayString(P.ua),1),g.createElementVNode("p",jk,[Array.isArray(x[P==null?void 0:P.name])?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(x[P==null?void 0:P.name],(L,F)=>(g.openBlock(),g.createElementBlock("span",{key:F,class:"bg-gray-200 px-1 py-0.5 rounded-lg mr-1"},g.toDisplayString(L),1))),128)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[P.type==="date"?(g.openBlock(),g.createElementBlock(g.Fragment,{key:0},[g.createTextVNode(g.toDisplayString(T.formatDate(x[P==null?void 0:P.name])||"Немає даних"),1)],64)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createTextVNode(g.toDisplayString(x[P==null?void 0:P.name]||"Немає даних"),1)],64))],64))])]))),128))]),g.createElementVNode("div",Wk,[g.createElementVNode("a",{href:T.getItemLink(x),class:"inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 hover:bg-accent hover:text-accent-foreground h-9 rounded-md px-3"},f[0]||(f[0]=[g.createTextVNode(" Детальніше "),g.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-external-link ml-1 h-3.5 w-3.5"},[g.createElementVNode("path",{d:"M15 3h6v6"}),g.createElementVNode("path",{d:"M10 14 21 3"}),g.createElementVNode("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})],-1)]),8,Hk)])])])])])}),128)}const Kk=Gt(Lk,[["render",Zk]]),Gk={name:"Template3",props:{items:Array,columns:Array,path:String,id_key:String,query_params:{type:Array,default:()=>[]}},computed:{categoryCol(){return this.columns?this.columns.filter(u=>u.meta==="category"):[]},tagsCol(){return this.columns?this.columns.filter(u=>u.meta==="tags"):[]},featuresCols(){return this.columns.filter(u=>u.meta==="features")},colorClass(){return"bg-blue-500"},titleCol(){return this.columns.find(u=>u.meta==="title")}},methods:{featureColClass(u,f){return"col-span-2"},getItemLink(u){if(!this.id_key||!u[this.id_key]){if(!this.query_params||!this.query_params.length)return this.path;const _=this.query_params.map(b=>{const k=Object.keys(b)[0],T=b[k];return`${k}=${encodeURIComponent(u[T])}`}).join("&");return`${this.path}?${_}`}if(!this.query_params||!this.query_params.length)return`${this.path}/${u[this.id_key]}`;const f=this.query_params.map(_=>{const b=Object.keys(_)[0],k=_[b];return`${b}=${encodeURIComponent(u[k])}`}).join("&");return`${this.path}/${u[this.id_key]}?${f}`},formatDate:ac}},Jk={class:"space-y-4"},Xk={class:"flex items-center py-2 px-3"},Qk={class:"flex-1"},Yk={class:"grid grid-cols-12 gap-2 w-full text-xs"},$k={class:"col-span-5"},eA={key:0,class:"inline-flex items-center rounded-full border transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80 mt-1 text-[10px] font-normal px-1.5 py-0","data-v0-t":"badge"},tA={key:1,class:"flex flex-wrap gap-1 mt-1"},rA={key:0,class:"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold border-transparent bg-gray-100 text-gray-800"},iA={class:"col-span-7"},nA={class:"grid grid-cols-3 gap-3"},sA={class:"text-[10px] text-gray-500 mb-1"},oA={class:"truncate font-medium"},aA=["href"];function lA(u,f,_,b,k,T){return g.openBlock(),g.createElementBlock("div",Jk,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(_.items,x=>{var s,V;return g.openBlock(),g.createElementBlock("div",{key:x.id,class:"border-b border-slate-200 hover:bg-slate-50 transition-colors"},[g.createElementVNode("div",Xk,[g.createElementVNode("div",{class:g.normalizeClass(["w-1 h-8 rounded-full mr-3",T.colorClass])},null,2),g.createElementVNode("div",Qk,[g.createElementVNode("div",Yk,[g.createElementVNode("div",$k,[g.createElementVNode("p",{class:g.normalizeClass(["font-bold text-sm text-left",{"w-full h-full flex items-center":!Array.isArray(T.tagsCol)||!T.tagsCol.length}])},g.toDisplayString(x[`${(s=T.titleCol)==null?void 0:s.name}_text`]||x[(V=T.titleCol)==null?void 0:V.name]||x[Object.keys(x)[0]]||"Не вказано"),3),Array.isArray(T.categoryCol)&&T.categoryCol.length?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(T.categoryCol,P=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:P.name},[x[P.name]?(g.openBlock(),g.createElementBlock("div",eA,g.toDisplayString(x[`${P.name}_text`]||x[P.name]),1)):g.createCommentVNode("",!0)],64))),128)):g.createCommentVNode("",!0),Array.isArray(T.tagsCol)&&T.tagsCol.length?(g.openBlock(),g.createElementBlock("div",tA,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.tagsCol,P=>(g.openBlock(),g.createElementBlock("div",{key:P.name,class:"flex flex-wrap gap-1 mt-1"},[x[P.name]?(g.openBlock(),g.createElementBlock("span",rA,g.toDisplayString(x[`${P.name}_text`]||x[P.name]),1)):g.createCommentVNode("",!0)]))),128))])):g.createCommentVNode("",!0)]),g.createElementVNode("div",iA,[g.createElementVNode("div",nA,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.featuresCols,P=>(g.openBlock(),g.createElementBlock("div",{key:P.name},[g.createElementVNode("p",sA,g.toDisplayString(P.ua),1),g.createElementVNode("p",oA,[Array.isArray(x[P==null?void 0:P.name])?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(x[P==null?void 0:P.name],(L,F)=>(g.openBlock(),g.createElementBlock("span",{key:F,class:"bg-gray-200 px-1 py-0.5 rounded-lg mr-1"},g.toDisplayString(L),1))),128)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[P.type==="date"?(g.openBlock(),g.createElementBlock(g.Fragment,{key:0},[g.createTextVNode(g.toDisplayString(T.formatDate(x[P==null?void 0:P.name])||"Немає даних"),1)],64)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createTextVNode(g.toDisplayString(x[P==null?void 0:P.name]||"Немає даних"),1)],64))],64))])]))),128))])])])]),g.createElementVNode("a",{href:T.getItemLink(x),class:"ml-auto flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 hover:bg-accent hover:text-accent-foreground rounded-md h-7 w-7 p-0",style:{"min-width":"2.5rem"}},f[0]||(f[0]=[g.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-chevron-right h-4 w-4"},[g.createElementVNode("path",{d:"m9 18 6-6-6-6"})],-1)]),8,aA)])])}),128))])}const cA=Gt(Gk,[["render",lA]]),uA={name:"Template4",props:{items:Array,columns:Array,path:String,id_key:String,query_params:{type:Array,default:()=>[]}},computed:{featuresCols(){return this.columns.filter(u=>u.meta==="features")},titleCol(){return this.columns.find(u=>u.meta==="title")},categoryCol(){return this.columns?this.columns.filter(u=>u.meta==="category"):[]},tagsCol(){return this.columns?this.columns.filter(u=>u.meta==="tags"):[]}},methods:{getItemLink(u){if(!this.id_key||!u[this.id_key]){if(!this.query_params||!this.query_params.length)return this.path;const _=this.query_params.map(b=>{const k=Object.keys(b)[0],T=b[k];return`${k}=${encodeURIComponent(u[T])}`}).join("&");return`${this.path}?${_}`}if(!this.query_params||!this.query_params.length)return`${this.path}/${u[this.id_key]}`;const f=this.query_params.map(_=>{const b=Object.keys(_)[0],k=_[b];return`${b}=${encodeURIComponent(u[k])}`}).join("&");return`${this.path}/${u[this.id_key]}?${f}`},formatDate:ac}},hA={class:"flex flex-col space-y-1.5 p-6 pb-2"},pA={class:"flex items-center gap-2"},dA={class:"tracking-tight text-lg font-medium"},fA={key:0,class:"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-blue-100 text-blue-800 ml-2","data-v0-t":"badge"},mA={key:1,class:"flex"},gA={key:0,class:"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold border-transparent bg-gray-100 text-gray-800"},yA={class:"p-6 pt-0 pb-4"},_A={class:"grid grid-cols-2 gap-4"},vA={class:"text-sm text-gray-500"},xA={class:"font-medium"},bA={class:"flex items-center p-6 pt-0"},wA=["href"];function SA(u,f,_,b,k,T){return g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(_.items,x=>{var s,V;return g.openBlock(),g.createElementBlock("div",{key:x.id,class:"rounded-lg border bg-card text-card-foreground shadow-sm border-l-4 border-l-blue-600","data-v0-t":"card"},[g.createElementVNode("div",hA,[g.createElementVNode("div",pA,[g.createElementVNode("h3",dA,g.toDisplayString(x[`${(s=T.titleCol)==null?void 0:s.name}_text`]||x[(V=T.titleCol)==null?void 0:V.name]||Object.keys(x)[0]||"Не вказано"),1),Array.isArray(T.categoryCol)&&T.categoryCol.length?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(T.categoryCol,P=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:P.name},[x[P.name]?(g.openBlock(),g.createElementBlock("div",fA,g.toDisplayString(x[`${P.name}_text`]||x[P.name]),1)):g.createCommentVNode("",!0)],64))),128)):g.createCommentVNode("",!0),Array.isArray(T.tagsCol)&&T.tagsCol.length?(g.openBlock(),g.createElementBlock("div",mA,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.tagsCol,P=>(g.openBlock(),g.createElementBlock("div",{key:P.name,class:"flex flex-wrap gap-1 ml-2"},[x[P.name]?(g.openBlock(),g.createElementBlock("span",gA,g.toDisplayString(x[`${P.name}_text`]||x[P.name]),1)):g.createCommentVNode("",!0)]))),128))])):g.createCommentVNode("",!0)])]),g.createElementVNode("div",yA,[g.createElementVNode("div",_A,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.featuresCols,P=>(g.openBlock(),g.createElementBlock("div",{key:P.name},[g.createElementVNode("p",vA,g.toDisplayString(P.ua),1),g.createElementVNode("p",xA,[Array.isArray(x[P==null?void 0:P.name])?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(x[P==null?void 0:P.name],(L,F)=>(g.openBlock(),g.createElementBlock("span",{key:F,class:"bg-gray-200 px-1 py-0.5 rounded-lg mr-1"},g.toDisplayString(L),1))),128)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[P.type==="date"?(g.openBlock(),g.createElementBlock(g.Fragment,{key:0},[g.createTextVNode(g.toDisplayString(T.formatDate(x[P==null?void 0:P.name])||"Немає даних"),1)],64)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createTextVNode(g.toDisplayString(x[P==null?void 0:P.name]||"Немає даних"),1)],64))],64))])]))),128))])]),g.createElementVNode("div",bA,[g.createElementVNode("a",{href:T.getItemLink(x),class:"inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 border bg-background h-10 px-4 py-2 rounded-md text-black border-black hover:bg-gray-100 hover:text-black"}," Детальніше ",8,wA)])])}),128)}const kA=Gt(uA,[["render",SA]]),AA={name:"Template5",props:{items:Array,columns:Array,path:String,id_key:String,query_params:{type:Array,default:()=>[]}},computed:{imageCol(){return this.columns.find(u=>u.meta==="image")},descCol(){return this.columns.find(u=>u.meta==="desc")||this.columns.find(u=>u.name==="description")},categoryCol(){return this.columns?this.columns.filter(u=>u.meta==="category"):[]},tagsCol(){return this.columns?this.columns.filter(u=>u.meta==="tags"):[]},featuresCols(){return this.columns.filter(u=>u.meta==="features")},titleCol(){return this.columns.find(u=>u.meta==="title")}},methods:{getItemLink(u){if(!this.id_key||!u[this.id_key]){if(!this.query_params||!this.query_params.length)return this.path;const _=this.query_params.map(b=>{const k=Object.keys(b)[0],T=b[k];return`${k}=${encodeURIComponent(u[T])}`}).join("&");return`${this.path}?${_}`}if(!this.query_params||!this.query_params.length)return`${this.path}/${u[this.id_key]}`;const f=this.query_params.map(_=>{const b=Object.keys(_)[0],k=_[b];return`${b}=${encodeURIComponent(u[k])}`}).join("&");return`${this.path}/${u[this.id_key]}?${f}`},formatDate:ac}},CA={class:"grid grid-cols-12 divide-x divide-gray-100"},TA={key:0},EA=["src"],PA={key:1,class:"col-span-1 flex items-center justify-center"},IA={class:"col-span-7 p-4"},MA={class:"flex items-center mb-1 col-span-7 p-4"},LA={class:"text-base font-bold text-gray-900 mr-2"},RA={key:0,class:"inline-flex items-center rounded-full px-2.5 py-0.5 font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-primary/80 bg-blue-100 text-blue-800 border-0 text-xs ml-2"},BA={class:"text-sm text-gray-600 line-clamp-1 mb-2"},DA={class:"grid grid-cols-2 gap-x-4 gap-y-1 text-sm"},VA={class:"text-gray-500 mr-1"},zA=["innerHTML"],FA={class:"text-gray-600 truncate"},OA={class:"col-span-2 p-3 bg-gray-50 flex flex-col justify-center"},NA={class:"text-xs text-gray-500 mb-1.5"},qA={key:0,class:"flex flex-wrap gap-1"},UA={key:0,class:"inline-flex items-center rounded-full font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 hover:bg-secondary/80 bg-white border border-gray-200 text-gray-700 text-xs px-1.5 py-0"},jA={class:"col-span-2 flex flex-col justify-center items-center bg-gray-50 border-l p-2"},WA={class:"w-full space-y-2"},HA=["href"];function ZA(u,f,_,b,k,T){return g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(_.items,x=>{var s,V,P,L,F;return g.openBlock(),g.createElementBlock("div",{key:x.id,class:"bg-white border border-gray-200 rounded-lg overflow-hidden transition-all duration-200 hover:shadow-md"},[g.createElementVNode("div",CA,[T.imageCol?(g.openBlock(),g.createElementBlock("div",TA,[x[(s=T.imageCol)==null?void 0:s.name]?(g.openBlock(),g.createElementBlock("img",{key:0,src:x[(V=T.imageCol)==null?void 0:V.name],alt:"image",class:"object-cover h-full"},null,8,EA)):g.createCommentVNode("",!0)])):(g.openBlock(),g.createElementBlock("div",PA,f[0]||(f[0]=[g.createElementVNode("div",{class:"w-3 h-12 rounded-sm bg-blue-500",title:"Пріоритет: Високий","aria-hidden":"true"},null,-1)]))),g.createElementVNode("div",IA,[g.createElementVNode("div",MA,[g.createElementVNode("h3",LA,g.toDisplayString(x[`${(P=T.titleCol)==null?void 0:P.name}_text`]||x[(L=T.titleCol)==null?void 0:L.name]||Object.keys(x)[0]||"Не вказано"),1),Array.isArray(T.categoryCol)&&T.categoryCol.length?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(T.categoryCol,M=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:M.name},[x[M.name]?(g.openBlock(),g.createElementBlock("div",RA,g.toDisplayString(x[`${M.name}_text`]||x[M.name]),1)):g.createCommentVNode("",!0)],64))),128)):g.createCommentVNode("",!0)]),g.createElementVNode("p",BA,g.toDisplayString(x[(F=T.descCol)==null?void 0:F.name]),1),g.createElementVNode("div",DA,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.featuresCols,M=>(g.openBlock(),g.createElementBlock("div",{key:M.name,class:"flex items-center"},[g.createElementVNode("span",VA,g.toDisplayString((M==null?void 0:M.ua)||M.label||M.name)+":",1),M.icon?(g.openBlock(),g.createElementBlock("span",{key:0,class:"mr-1 flex-shrink-0",innerHTML:M.icon},null,8,zA)):g.createCommentVNode("",!0),g.createElementVNode("span",FA,[Array.isArray(x[M==null?void 0:M.name])?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(x[M==null?void 0:M.name],(E,C)=>(g.openBlock(),g.createElementBlock("span",{key:C,class:"bg-gray-200 px-1 py-0.5 rounded-lg mr-1"},g.toDisplayString(E),1))),128)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[M.type==="date"?(g.openBlock(),g.createElementBlock(g.Fragment,{key:0},[g.createTextVNode(g.toDisplayString(T.formatDate(x[M==null?void 0:M.name])||"Немає даних"),1)],64)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createTextVNode(g.toDisplayString(x[M==null?void 0:M.name]||"Немає даних"),1)],64))],64))])]))),128))])]),g.createElementVNode("div",OA,[g.createElementVNode("p",NA," Теги: "+g.toDisplayString(T.tagsCol.length&&x[T.tagsCol[0].name]?"":"відсутні"),1),Array.isArray(T.tagsCol)&&T.tagsCol.length?(g.openBlock(),g.createElementBlock("div",qA,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.tagsCol,M=>(g.openBlock(),g.createElementBlock("div",{key:M.name,class:"flex flex-wrap gap-1"},[x[M.name]?(g.openBlock(),g.createElementBlock("span",UA,g.toDisplayString(x[`${M.name}_text`]||x[M.name]),1)):g.createCommentVNode("",!0)]))),128))])):g.createCommentVNode("",!0)]),g.createElementVNode("div",jA,[g.createElementVNode("div",WA,[g.createElementVNode("a",{href:T.getItemLink(x),class:"inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-md px-3 w-full bg-blue-600 hover:bg-blue-700 text-white text-xs h-8"}," Детальніше ",8,HA)])])])])}),128)}const KA=Gt(AA,[["render",ZA]]),GA={template1:Mk,template2:Kk,template3:cA,template4:kA,template5:KA},JA={name:"RegistryList",components:{HeroBlock:mk,...GA},props:{title:{type:String,required:!0},description:{type:String,default:""},type:{type:String,default:"data"},items:{type:Array,default:()=>[]},total:{type:Number,default:0},filters:{type:Array,default:()=>null},emptyStateText:{type:String,default:"Немає даних"},breadcrumbs:{type:Array,default:()=>[]},dialog:{type:Boolean,default:!0},token:{type:String,default:""},table:{type:String,default:""},slug:{type:String,default:""},view:{type:String,default:""},path:{type:String,default:""},id_key:{type:String,default:""},columns:{type:Array,default:()=>[]},query_params:{type:Array,default:()=>[]}},data(){return{filterUrl:"",mounted:!1,tableData:[],currentPage:1,limit:16,localTotal:0}},created(){this.tableData=this.items,this.localTotal=this.total},mounted(){this.mounted=!0},methods:{handleFilterChange({url:u}){this.currentPage=1,this.filterUrl=u,this.getData()},handlePageChange(u){this.currentPage=u,this.getData()},changeLimit(u){this.limit=u,this.currentPage=1,this.getData()},async getData(){try{const u=this.type==="registry"?`/api/gis-registry/${this.slug}`:`/api/data/${this.table}`,{data:f}=await kr.get(`${u}?filter=${this.filterUrl}&page=${this.currentPage}&limit=${this.limit}`);f&&(this.tableData=f==null?void 0:f.rows,this.localTotal=this.type==="registry"?f==null?void 0:f.total:f==null?void 0:f.filtered)}catch(u){console.error(u.message)}}}},XA={class:"py-16 md:py-24"},QA={class:"py-6"},YA={class:"container"},$A={key:0,class:"flex items-center text-sm text-muted-foreground mb-6"},eC=["href"],tC={key:1,class:"text-foreground font-medium truncate"},rC={class:"flex flex-col md:flex-row gap-4 justify-start"},iC={class:"container"},nC={key:0,class:"space-y-4"},sC={class:"my-5 pr-2"},oC={class:"paginationWrapper relative flex justify-center"},aC={key:1,class:"text-center text-slate-400"};function lC(u,f,_,b,k,T){var P,L;const x=g.resolveComponent("HeroBlock"),s=g.resolveComponent("VsFilterList"),V=g.resolveComponent("VsPagination");return g.openBlock(),g.createElementBlock("div",XA,[g.createElementVNode("section",null,[g.createVNode(x,{title:_.title,description:_.description},null,8,["title","description"])]),g.createElementVNode("section",QA,[g.createElementVNode("div",YA,[(P=_.breadcrumbs)!=null&&P.length?(g.openBlock(),g.createElementBlock("div",$A,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(_.breadcrumbs,(F,M)=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:M},[M<_.breadcrumbs.length-1?(g.openBlock(),g.createElementBlock(g.Fragment,{key:0},[g.createElementVNode("a",{href:F.link,class:"hover:text-foreground"},g.toDisplayString(F.name),9,eC),f[0]||(f[0]=g.createElementVNode("span",{class:"mx-2"},"/",-1))],64)):(g.openBlock(),g.createElementBlock("span",tC,g.toDisplayString(F.name),1))],64))),128))])):g.createCommentVNode("",!0),g.createElementVNode("div",rC,[_.filters&&k.mounted?(g.openBlock(),g.createBlock(s,{key:0,ref:"filter",scheme:_.filters,isDialog:_.dialog,urlSeparator:"true",view:"plain",token:_.token,name:"filter",onFilterChange:T.handleFilterChange},{button:g.withCtx(()=>f[1]||(f[1]=[g.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border border-input bg-background hover:bg-accent hover:text-accent-foreground px-3 py-2",type:"button"}," Фільтри ",-1)])),_:1},8,["scheme","isDialog","token","onFilterChange"])):g.createCommentVNode("",!0)])])]),g.createElementVNode("section",null,[g.createElementVNode("div",iC,[((L=k.tableData)==null?void 0:L.length)>0?(g.openBlock(),g.createElementBlock("div",nC,[u.$slots.default?g.renderSlot(u.$slots,"default",{key:0,items:k.tableData}):_.view?(g.openBlock(),g.createBlock(g.resolveDynamicComponent(_.view),{key:1,items:k.tableData,path:_.path,id_key:_.id_key,columns:_.columns,query_params:_.query_params},null,8,["items","path","id_key","columns","query_params"])):g.createCommentVNode("",!0),g.createElementVNode("div",sC,[g.createElementVNode("div",oC,[g.createVNode(V,{total:k.localTotal,maxPages:4,defaultPage:k.currentPage,pageSize:k.limit,goTo:!1,size:"medium",backgroundColor:"#e5e7eb",borderedCellSelected:!0,pageSizes:[16,32,48,64],onPageChange:T.handlePageChange,onPageSizeChange:T.changeLimit},null,8,["total","defaultPage","pageSize","onPageChange","onPageSizeChange"])])])])):(g.openBlock(),g.createElementBlock("div",aC,g.toDisplayString(_.emptyStateText),1))])])])}const fy=Gt(JA,[["render",lC]]),cC={class:"pt-[10px]"},uC={__name:"vs-editor-style-ace",props:{yamlValue:{type:null,default:()=>""}},setup(u){const f=u,_=g.ref(f.yamlValue);return(b,k)=>{const T=g.resolveComponent("VsFormAce");return g.openBlock(),g.createElementBlock("div",cC,[g.createVNode(T,{modelValue:_.value,"onUpdate:modelValue":k[0]||(k[0]=x=>_.value=x),value:_.value,fontSize:"12px"},null,8,["modelValue","value"])])}}},hC={components:{VsEditorStyleAce:uC},props:{data:Object,value:null,name:String},data(){var u,f,_;return{style:((_=(f=(u=this.data)==null?void 0:u.rows)==null?void 0:f[0])==null?void 0:_.style)||""}}};function pC(u,f,_,b,k,T){const x=g.resolveComponent("VsEditorStyleAce");return g.openBlock(),g.createBlock(x,{yamlValue:k.style,onChangeData:u.onChange,height:500,onUpdate:u.getData},null,8,["yamlValue","onChangeData","onUpdate"])}const dC=Gt(hC,[["render",pC]]);function fC(u){u.component("MapCustom",dy),u.component("RegistryList",fy),u.component("vs-style-yml",dC)}const mC={MapCustom:dy,RegistryList:fy,install:fC};module.exports=mC;