1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BFGF_SA0.js","./B-IzRBbX.js","./BXR4fO0V.js","./clients.BMWOO8G1.css","./BshrIPAu.js","./wnFv17pU.js","./BNWO3Leu.js","./B2f3qR6A.js","./botThinking.rCI38bD_.css","./Bg3W5StB.js","./BehgbbjG.js","./3PGTFW48.js","./CIxwdm_r.js","./BGEszIoe.js","./wY_TX1mz.js","./Cn4O6nw6.js","./MFxCR3oM.js","./CvyjjAz9.js","./C5bddYYQ.js","./CtxYlh3C.js","./B639gDbi.js","./G4aAs7Kc.js","./vBOkb4jb.js","./Dph8-iTG.js","./Dci8hfk2.js","./CKDi48kg.js","./BiX2K0Qu.js","./s7nZxgpV.js","./BpfZ_2Fo.js","./yEmIem5T.js","./BWpBW5Ac.js","./DCkm7dUL.js","./CEX6oNBJ.js","./BHNhML9m.js","./BUPkQ2Oj.js","./z6YuzI_S.js","./CIsFUoGs.js","./bwXKZ1gr.js","./DWZrwo6J.js","./xgxdCp6f.js","./DNSc4Nv1.js","./B1a79knM.js","./3anXwZXZ.js","./9Sj_QenJ.js","./index.DOUYGzxe.css","./vtBLAdy1.js","./AHy86O8S.js","./BvWyLRzp.js","./Bld5IBqU.js","./B_Q5b61M.js","./BsEUTlT3.js","./DhQ27wsp.js","./ZQY5NQr1.js","./JkHUQE1f.js","./BvkFASj3.js","./CpDlFVbM.js","./CmNqo5Ep.js","./BIfsbth-.js","./DLnl5idV.js","./EecVqWag.js","./AiSearch.B7fzJJiY.css","./CJaOOzVH.js","./DihbRrbF.js","./CZqihn9k.js","./conversationBox.FzkpWxau.css","./D6JkfGBf.js","./BSEYiOu-.js","./BNt4n1Sd.js","./C6WKTvoy.js","./Ntl5wELU.js","./BNdK152G.js","./Bm2FaQfh.js","./COJ6yLpI.js","./Br-2K14o.js","./Dt3G0xOI.js","./5TFcVyyK.js","./DQu_ubnV.js","./ClkGwfOP.js","./Cnv9F1tm.js","./BW-n3W8D.js","./QkWhgPFE.js","./CtPRyofc.js","./Cenl6gV3.js","./ClE-FsSl.js","./Dy_EcPyZ.js","./header.CSGfbgfq.css","./Be0NANjz.js","./DNcW7WCh.js","./D2j5_3t5.js","./CjcInnxQ.js","./YnyRI4-B.js","./Chat.CVLMUNh7.css","./ZDwLw3Gf.js","./about.BAnS3gR-.css","./CW6waRHZ.js","./acceptable-use.D1vF2LZc.css","./DTKrqCjg.js","./q2BdnGUp.js","./checkout.CJ4kRmAY.css","./q_y6V2Os.js","./Cne-Ei7V.js","./Search.OO4OfqzB.css","./DV9MyqF-.js","./Folder.DIsJgpON.css","./BslOa1rF.js","./DZSp5C2B.js","./C7eKW-aI.js","./DHwRiroI.js","./CjTALc5n.js","./CeZ-Uc14.js","./httpError.ClZfdfOy.css","./BcIg86pI.js","./AuthArtPanel.BTLENb5p.css","./DLzfQzkm.js","./BkeUFNHV.js","./CDACh_GJ.js","./fk5_m0QZ.js","./DoJ9Gweh.js","./DkMH6UaR.js","./Bn8G2y3X.js","./forgot-password.BsEgJwtd.css","./CtaHe6Ic.js","./7pisIWVW.js","./C5IkuuD_.js","./CbOtiYPW.js","./DlIxjLPt.js","./7AliQnZD.js","./B_3Gw-VB.js","./pricing.CcdoFuj7.css","./D2fDuidE.js","./privacy-policy.BkkvSpIe.css","./Jpiw1y2a.js","./CxhudW71.js","./BpmcDYUe.js","./DNdn_YVI.js","./register.DSrMN6gM.css","./F11UVdGT.js","./terms.BKwMb14t.css","./BSZ77t73.js","./Bu8GP6sH.js","./F9ZkwYw2.js","./CQgbuffU.js","./DM98Vxap.js","./B7D1kfxr.js","./BcbVS1u_.js","./CZlNyotO.js","./CNME05W0.js","./C2IiP7p5.js","./DRM45I4j.js","./_LLO9ykd.js","./DK_u7NC2.js","./DLCFtQwu.js","./C8HwWdCO.js","./C7aO-96C.js","./CPbWazU9.js","./DDcTMoOv.js","./BbKRhhz0.js","./B-_D0PSa.js","./Hml0cgKS.js","./Cl3S4sQb.js","./BQSKM90r.js","./DTe-oDPu.js","./DLpflMJJ.js","./BJ0jU2Ei.js","./CZ1fxRv6.js","./Ds8mJGV-.js","./CVNsX2-5.js","./DqJZlPLI.js","./BkWJ2E2Y.js","./0KFwI30R.js","./BMBl4cDL.js","./B1evQvZv.js","./BDYWcOt4.js","./Z4x0ARm4.js","./CPZuu7aL.js","./D-g9_5-7.js","./CU5oS2F6.js","./DzcKlpLn.js","./DPgKtKtF.js","./De-71koh.js","./CKnfoym9.js","./Czxw5mTR.js","./D5KT_mT1.js","./DnOS1f95.js","./BVtnc0wg.js","./DGbS_1JX.js","./DuhClZgK.js","./CpdxZG3I.js","./B9Mk1-Rl.js","./B2N7hi9E.js","./WD0Ai5mL.js","./BQvHJkx7.js","./BO4Wcxyg.js","./Q4B1v1KE.js","./4P3orR7D.js","./Bd3kfP7w.js","./BJvV4PKO.js","./DBgKaxUh.js","./-duoZHVq.js","./CyFyPqq1.js","./6oONUG0n.js","./DULykO2F.js","./D2uAua94.js","./D7Dt9tFg.js","./DsT_vzJe.js","./BRx812Hm.js","./Ba5ggs9n.js","./Bnq_1edW.js","./RightPaneSheet.D5ZXg9k5.css","./BeeqtpQB.js","./appWrapper.C5PddwWQ.css","./Dx4YBjnz.js","./default.C-mH1bcJ.css","./DE1AxGPn.js","./home.CsOpe-pk.css","./BS7bbOLq.js","./Dc9uM4pG.js","./C6er5IJL.js","./BQrMc-Im.js","./RUL44rm0.js","./ZLs11_tY.js","./BEwYYCqP.js","./BOR_9qKf.js","./DspZud_N.js","./DpZVG-tC.js","./B23p-bMC.js","./CPXrYCl_.js","./phoneVerification.B2WcUhgv.css","./Cpuy-AEC.js","./EmailVerification.Beiy_FTm.css","./DAbtZ9wj.js","./t2b6Us2U.js","./B8bsCO9G.js","./BVaHL8xf.js","./BitmIHV5.js","./DB77rXod.js","./Ms3O6AvY.js","./Fx1E7Xnd.js","./SupportRequestModal.TmdXTvdl.css","./Cs5TymdA.js","./ContactRequestModal.fCBotMXs.css","./tX2sXAb_.js","./BA-GXItJ.js","./zAD4UtDj.js","./D1dcB4mo.js","./TvD2-JdQ.js","./BcSTZK1W.js","./ChartGenerateModal.Dhjc98Nj.css","./DWpd53PR.js","./JYVGTfOD.js","./urwwUaDS.js","./ZNd6l5HR.js","./Cw4AevCT.js","./CJKWFg2R.js","./BNuFq9wz.js"])))=>i.map(i=>d[i]); 2(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))i(c);new MutationObserver(c=>
vendor: 7,847 bytes, line 2
2{for(const h of c)if(h.type==="childList")for(const m of h.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&i(m)}).observe(document,{childList:!0,subtree:!0});function n(c){const h={};return c.integrity&&(h.integrity=c.integrity),c.referrerPolicy&&(h.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?h.credentials="include":c.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function i(c){if(c.ep)return;c.ep=!0;const h=n(c);fetch(c.href,h)}})();function Yk(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Ei={},H_=[],td=()=>{},ZV=()=>!1,Tx=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),nC=e=>e.startsWith("onUpdate:"),ns=Object.assign,Kk=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},nX=Object.prototype.hasOwnProperty,zi=(e,t)=>nX.call(e,t),dr=Array.isArray,W_=e=>wy(e)==="[object Map]",rC=e=>wy(e)==="[object Set]",xB=e=>wy(e)==="[object Date]",rX=e=>wy(e)==="[object RegExp]",Ir=e=>typeof e=="function",eo=e=>typeof e=="string",Ol=e=>typeof e=="symbol",Li=e=>e!==null&&typeof e=="object",YV=e=>(Li(e)||Ir(e))&&Ir(e.then)&&Ir(e.catch),KV=Object.prototype.toString,wy=e=>KV.call(e),iX=e=>wy(e).slice(8,-1),Jk=e=>wy(e)==="[object Object]",iC=e=>eo(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Em=Yk(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),oC=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},oX=/-\w/g,_a=oC(e=>e.replace(oX,t=>t.slice(1).toUpperCase())),sX=/\B([A-Z])/g,bh=oC(e=>e.replace(sX,"-$1").toLowerCase()),sC=oC(e=>e.charAt(0).toUpperCase()+e.slice(1)),NT=oC(e=>e?`on${sC(e)}`:""),$s=(e,t)=>!Object.is(e,t),q_=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},JV=(e,t,n,i=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:i,value:n})},aC=e=>{const t=parseFloat(e);return isNaN(t)?e:t},QV=e=>{const t=eo(e)?Number(e):NaN;return isNaN(t)?e:t};let wB;const lC=()=>wB||(wB=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function cC(e){if(dr(e)){const t={};for(let n=0;n<e.length;n++){const i=e[n],c=eo(i)?uX(i):cC(i);if(c)for(const h in c)t[h]=c[h]}return t}else if(eo(e)||Li(e))return e}const aX=/;(?![^(]*\))/g,lX=/:([^]+)/,cX=/\/\*[^]*?\*\//g;function uX(e){const t={};return e.replace(cX,"").split(aX).forEach(n=>{if(n){const i=n.split(lX);i.length>1&&(t[i[0].trim()]=i[1].trim())}}),t}function uC(e){let t="";if(eo(e))t=e;else if(dr(e))for(let n=0;n<e.length;n++){const i=uC(e[n]);i&&(t+=i+" ")}else if(Li(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function dX(e){if(!e)return null;let{class:t,style:n}=e;return t&&!eo(t)&&(e.class=uC(t)),n&&(e.style=cC(n)),e}const hX="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",fX=Yk(hX);function eU(e){return!!e||e===""}function pX(e,t){if(e.length!==t.length)return!1;let n=!0;for(let i=0;n&&i<e.length;i++)n=Ex(e[i],t[i]);return n}function Ex(e,t){if(e===t)return!0;let n=xB(e),i=xB(t);if(n||i)return n&&i?e.getTime()===t.getTime():!1;if(n=Ol(e),i=Ol(t),n||i)return e===t;if(n=dr(e),i=dr(t),n||i)return n&&i?pX(e,t):!1;if(n=Li(e),i=Li(t),n||i){if(!n||!i)return!1;const c=Object.keys(e).length,h=Object.keys(t).length;if(c!==h)return!1;for(const m in e){const a=e.hasOwnProperty(m),y=t.hasOwnProperty(m);if(a&&!y||!a&&y||!Ex(e[m],t[m]))return!1}}return String(e)===String(t)}function mX(e,t){return e.findIndex(n=>Ex(n,t))}const tU=e=>!!(e&&e.__v_isRef===!0),Cm=e=>eo(e)?e:e==null?"":dr(e)||Li(e)&&(e.toString===KV||!Ir(e.toString))?tU(e)?Cm(e.value):JSON.stringify(e,nU,2):String(e),nU=(e,t)=>tU(t)?nU(e,t.value):W_(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[i,c],h)=>(n[_I(i,h)+" =>"]=c,n),{})}:rC(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>_I(n))}:Ol(t)?_I(t):Li(t)&&!dr(t)&&!Jk(t)?String(t):t,_I=(e,t="")=>{var n;return Ol(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};let ws;class rU{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&ws&&(ws.active?(this.parent=ws,this.index=(ws.scopes||(ws.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=ws;try{return ws=this,t()}finally{ws=n}}}on(){++this._on===1&&(this.prevScope=ws,ws=this)}off(){if(this._on>0&&--this._on===0){if(ws===this)ws=this.prevScope;else{let t=ws;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,i;for(n=0,i=this.effects.length;n<i;n++)this.effects[n].stop();for(this.effects.length=0,n=0,i=this.cleanups.length;n<i;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,i=this.scopes.length;n<i;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const c=this.parent.scopes.pop();c&&c!==this&&(this.parent.scopes[this.index]=c,c.index=this.index)}this.parent=void 0}}}function Cx(e){return new rU(e)}function ld(){return ws}function Dm(e,t=!1){ws&&ws.cleanups.push(e)}let lo;const yI=new WeakSet;class iU{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,ws&&(ws.active?ws.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,yI.has(this)&&(yI.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||sU(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,SB(this),aU(this);const t=lo,n=Qc;lo=this,Qc=!0;try{return this.fn()}finally{lU(this),lo=t,Qc=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)tM(t);this.deps=this.depsTail=void 0,SB(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?yI.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){zP(this)&&this.run()}get dirty(){return zP(this)}}let oU=0,Cb,Ab;function sU(e,t=!1){if(e.flags|=8,t){e.next=Ab,Ab=e;return}e.next=Cb,Cb=e}function Qk(){oU++}function eM(){if(--oU>0)return;if(Ab){let t=Ab;for(Ab=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Cb;){let t=Cb;for(Cb=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(i){e||(e=i)}t=n}}if(e)throw e}function aU(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function lU(e){let t,n=e.depsTail,i=n;for(;i;){const c=i.prevDep;i.version===-1?(i===n&&(n=c),tM(i),gX(i)):t=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=c}e.deps=t,e.depsTail=n}function zP(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(cU(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function cU(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Hb)||(e.globalVersion=Hb,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!zP(e))))return;e.flags|=2;const t=e.dep,n=lo,i=Qc;lo=e,Qc=!0;try{aU(e);const c=e.fn(e._value);(t.version===0||$s(c,e._value))&&(e.flags|=128,e._value=c,t.version++)}catch(c){throw t.version++,c}finally{lo=n,Qc=i,lU(e),e.flags&=-3}}function tM(e,t=!1){const{dep:n,prevSub:i,nextSub:c}=e;if(i&&(i.nextSub=c,e.prevSub=void 0),c&&(c.prevSub=i,e.nextSub=void 0),n.subs===e&&(n.subs=i,!i&&n.c
2omputed)){n.computed.flags&=-5;for(let h=n.computed.deps;h;h=h.nextDep)tM(h,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function gX(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Qc=!0;const uU=[];function gh(){uU.push(Qc),Qc=!1}function _h(){const e=uU.pop();Qc=e===void 0?!0:e}function SB(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=lo;lo=void 0;try{t()}finally{lo=n}}}let Hb=0;class _X{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class dC{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!lo||!Qc||lo===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==lo)n=this.activeLink=new _X(lo,this),lo.deps?(n.prevDep=lo.depsTail,lo.depsTail.nextDep=n,lo.depsTail=n):lo.deps=lo.depsTail=n,dU(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const i=n.nextDep;i.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=i),n.prevDep=lo.depsTail,n.nextDep=void 0,lo.depsTail.nextDep=n,lo.depsTail=n,lo.deps===n&&(lo.deps=i)}return n}trigger(t){this.version++,Hb++,this.notify(t)}notify(t){Qk();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{eM()}}}function dU(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let i=t.deps;i;i=i.nextDep)dU(i)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const rE=new WeakMap,Am=Symbol(""),NP=Symbol(""),Wb=Symbol("");function ma(e,t,n){if(Qc&&lo){let i=rE.get(e);i||rE.set(e,i=new Map);let c=i.get(n);c||(i.set(n,c=new dC),c.map=i,c.key=n),c.track()}}function rh(e,t,n,i,c,h){const m=rE.get(e);if(!m){Hb++;return}const a=y=>{y&&y.trigger()};if(Qk(),t==="clear")m.forEach(a);else{const y=dr(e),E=y&&iC(n);if(y&&n==="length"){const C=Number(i);m.forEach((P,L)=>{(L==="length"||L===Wb||!Ol(L)&&L>=C)&&a(P)})}else switch((n!==void 0||m.has(void 0))&&a(m.get(n)),E&&a(m.get(Wb)),t){case"add":y?E&&a(m.get("length")):(a(m.get(Am)),W_(e)&&a(m.get(NP)));break;case"delete":y||(a(m.get(Am)),W_(e)&&a(m.get(NP)));break;case"set":W_(e)&&a(m.get(Am));break}}eM()}function yX(e,t){const n=rE.get(e);return n&&n.get(t)}function x_(e){const t=ci(e);return t===e?t:(ma(t,"iterate",Wb),Ml(e)?t:t.map(ru))}function hC(e){return ma(e=ci(e),"iterate",Wb),e}function Ku(e,t){return id(e)?ry(eu(e)?ru(t):t):ru(t)}const vX={__proto__:null,[Symbol.iterator](){return vI(this,Symbol.iterator,e=>Ku(this,e))},concat(...e){return x_(this).concat(...e.map(t=>dr(t)?x_(t):t))},entries(){return vI(this,"entries",e=>(e[1]=Ku(this,e[1]),e))},every(e,t){return Gd(this,"every",e,t,void 0,arguments)},filter(e,t){return Gd(this,"filter",e,t,n=>n.map(i=>Ku(this,i)),arguments)},find(e,t){return Gd(this,"find",e,t,n=>Ku(this,n),arguments)},findIndex(e,t){return Gd(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Gd(this,"findLast",e,t,n=>Ku(this,n),arguments)},findLastIndex(e,t){return Gd(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Gd(this,"forEach",e,t,void 0,arguments)},includes(...e){return bI(this,"includes",e)},indexOf(...e){return bI(this,"indexOf",e)},join(e){return x_(this).join(e)},lastIndexOf(...e){return bI(this,"lastIndexOf",e)},map(e,t){return Gd(this,"map",e,t,void 0,arguments)},pop(){return Zv(this,"pop")},push(...e){return Zv(this,"push",e)},reduce(e,...t){return TB(this,"reduce",e,t)},reduceRight(e,...t){return TB(this,"reduceRight",e,t)},shift(){return Zv(this,"shift")},some(e,t){return Gd(this,"some",e,t,void 0,arguments)},splice(...e){return Zv(this,"splice",e)},toReversed(){return x_(this).toReversed()},toSorted(e){return x_(this).toSorted(e)},toSpliced(...e){return x_(this).toSpliced(...e)},unshift(...e){return Zv(this,"unshift",e)},values(){return vI(this,"values",e=>Ku(this,e))}};function vI(e,t,n){const i=hC(e),c=i[t]();return i!==e&&!Ml(e)&&(c._next=c.next,c.next=()=>{const h=c._next();return h.done||(h.value=n(h.value)),h}),c}const bX=Array.prototype;function Gd(e,t,n,i,c,h){const m=hC(e),a=m!==e&&!Ml(e),y=m[t];if(y!==bX[t]){const P=y.apply(e,h);return a?ru(P):P}let E=n;m!==e&&(a?E=function(P,L){return n.call(this,Ku(e,P),L,e)}:n.length>2&&(E=function(P,L){return n.call(this,P,L,e)}));const C=y.call(m,E,i);return a&&c?c(C):C}function TB(e,t,n,i){const c=hC(e),h=c!==e&&!Ml(e);let m=n,a=!1;c!==e&&(h?(a=i.length===0,m=function(E,C,P){return a&&(a=!1,E=Ku(e,E)),n.call(this,E,Ku(e,C),P,e)}):n.length>3&&(m=function(E,C,P){return n.call(this,E,C,P,e)}));const y=c[t](m,...i);return a?Ku(e,y):y}function bI(e,t,n){const i=ci(e);ma(i,"iterate",Wb);const c=i[t](...n);return(c===-1||c===!1)&&mC(n[0])?(n[0]=ci(n[0]),i[t](...n)):c}function Zv(e,t,n=[]){gh(),Qk();const i=ci(e)[t].apply(e,n);return eM(),_h(),i}const xX=Yk("__proto__,__v_isRef,__isVue"),hU=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Ol));function wX(e){Ol(e)||(e=String(e));const t=ci(this);return ma(t,"has",e),t.hasOwnProperty(e)}class fU{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,i){if(n==="__v_skip")return t.__v_skip;const c=this._isReadonly,h=this._isShallow;if(n==="__v_isReactive")return!c;if(n==="__v_isReadonly")return c;if(n==="__v_isShallow")return h;if(n==="__v_raw")return i===(c?h?vU:yU:h?_U:gU).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(i)?t:void 0;const m=dr(t);if(!c){let y;if(m&&(y=vX[n]))return y;if(n==="hasOwnProperty")return wX}const a=Reflect.get(t,n,qi(t)?t:i);if((Ol(n)?hU.has(n):xX(n))||(c||ma(t,"get",n),h))return a;
2if(qi(a)){const y=m&&iC(n)?a:a.value;return c&&Li(y)?ny(y):y}return Li(a)?c?ny(a):Fl(a):a}}class pU extends fU{constructor(t=!1){super(!1,t)}set(t,n,i,c){let h=t[n];const m=dr(t)&&iC(n);if(!this._isShallow){const E=id(h);if(!Ml(i)&&!id(i)&&(h=ci(h),i=ci(i)),!m&&qi(h)&&!qi(i))return E||(h.value=i),!0}const a=m?Number(n)<t.length:zi(t,n),y=Reflect.set(t,n,i,qi(t)?t:c);return t===ci(c)&&(a?$s(i,h)&&rh(t,"set",n,i):rh(t,"add",n,i)),y}deleteProperty(t,n){const i=zi(t,n);t[n];const c=Reflect.deleteProperty(t,n);return c&&i&&rh(t,"delete",n,void 0),c}has(t,n){const i=Reflect.has(t,n);return(!Ol(n)||!hU.has(n))&&ma(t,"has",n),i}ownKeys(t){return ma(t,"iterate",dr(t)?"length":Am),Reflect.ownKeys(t)}}class mU extends fU{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const SX=new pU,TX=new mU,EX=new pU(!0),CX=new mU(!0),VP=e=>e,jS=e=>Reflect.getPrototypeOf(e);function AX(e,t,n){return function(...i){const c=this.__v_raw,h=ci(c),m=W_(h),a=e==="entries"||e===Symbol.iterator&&m,y=e==="keys"&&m,E=c[e](...i),C=n?VP:t?ry:ru;return!t&&ma(h,"iterate",y?NP:Am),ns(Object.create(E),{next(){const{value:P,done:L}=E.next();return L?{value:P,done:L}:{value:a?[C(P[0]),C(P[1])]:C(P),done:L}}})}}function GS(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function IX(e,t){const n={get(c){const h=this.__v_raw,m=ci(h),a=ci(c);e||($s(c,a)&&ma(m,"get",c),ma(m,"get",a));const{has:y}=jS(m),E=t?VP:e?ry:ru;if(y.call(m,c))return E(h.get(c));if(y.call(m,a))return E(h.get(a));h!==m&&h.get(c)},get size(){const c=this.__v_raw;return!e&&ma(ci(c),"iterate",Am),c.size},has(c){const h=this.__v_raw,m=ci(h),a=ci(c);return e||($s(c,a)&&ma(m,"has",c),ma(m,"has",a)),c===a?h.has(c):h.has(c)||h.has(a)},forEach(c,h){const m=this,a=m.__v_raw,y=ci(a),E=t?VP:e?ry:ru;return!e&&ma(y,"iterate",Am),a.forEach((C,P)=>c.call(h,E(C),E(P),m))}};return ns(n,e?{add:GS("add"),set:GS("set"),delete:GS("delete"),clear:GS("clear")}:{add(c){const h=ci(this),m=jS(h),a=ci(c),y=!t&&!Ml(c)&&!id(c)?a:c;return m.has.call(h,y)||$s(c,y)&&m.has.call(h,c)||$s(a,y)&&m.has.call(h,a)||(h.add(y),rh(h,"add",y,y)),this},set(c,h){!t&&!Ml(h)&&!id(h)&&(h=ci(h));const m=ci(this),{has:a,get:y}=jS(m);let E=a.call(m,c);E||(c=ci(c),E=a.call(m,c));const C=y.call(m,c);return m.set(c,h),E?$s(h,C)&&rh(m,"set",c,h):rh(m,"add",c,h),this},delete(c){const h=ci(this),{has:m,get:a}=jS(h);let y=m.call(h,c);y||(c=ci(c),y=m.call(h,c)),a&&a.call(h,c);const E=h.delete(c);return y&&rh(h,"delete",c,void 0),E},clear(){const c=ci(this),h=c.size!==0,m=c.clear();return h&&rh(c,"clear",void 0,void 0),m}}),["keys","values","entries",Symbol.iterator].forEach(c=>{n[c]=AX(c,e,t)}),n}function fC(e,t){const n=IX(e,t);return(i,c,h)=>c==="__v_isReactive"?!e:c==="__v_isReadonly"?e:c==="__v_raw"?i:Reflect.get(zi(n,c)&&c in i?n:i,c,h)}const PX={get:fC(!1,!1)},RX={get:fC(!1,!0)},kX={get:fC(!0,!1)},MX={get:fC(!0,!0)},gU=new WeakMap,_U=new WeakMap,yU=new WeakMap,vU=new WeakMap;function LX(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Fl(e){return id(e)?e:pC(e,!1,SX,PX,gU)}function Zc(e){return pC(e,!1,EX,RX,_U)}function ny(e){return pC(e,!0,TX,kX,yU)}function nM(e){return pC(e,!0,CX,MX,vU)}function pC(e,t,n,i,c){if(!Li(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const h=c.get(e);if(h)return h;const m=LX(iX(e));if(m===0)return e;const a=new Proxy(e,m===2?i:n);return c.set(e,a),a}function eu(e){return id(e)?eu(e.__v_raw):!!(e&&e.__v_isReactive)}function id(e){return!!(e&&e.__v_isReadonly)}function Ml(e){return!!(e&&e.__v_isShallow)}function mC(e){return e?!!e.__v_raw:!1}function ci(e){const t=e&&e.__v_raw;return t?ci(t):e}function Ax(e){return!zi(e,"__v_skip")&&Object.isExtensible(e)&&JV(e,"__v_skip",!0),e}const ru=e=>Li(e)?Fl(e):e,ry=e=>Li(e)?ny(e):e;function qi(e){return e?e.__v_isRef===!0:!1}function hn(e){return bU(e,!1)}function Vi(e){return bU(e,!0)}function bU(e,t){return qi(e)?e:new OX(e,t)}class OX{constructor(t,n){this.dep=new dC,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:ci(t),this._value=n?t:ru(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,i=this.__v_isShallow||Ml(t)||id(t);
2t=i?t:ci(t),$s(t,n)&&(this._rawValue=t,this._value=i?t:ru(t),this.dep.trigger())}}function Ar(e){return qi(e)?e.value:e}function ii(e){return Ir(e)?e():Ar(e)}const DX={get:(e,t,n)=>t==="__v_raw"?e:Ar(Reflect.get(e,t,n)),set:(e,t,n,i)=>{const c=e[t];return qi(c)&&!qi(n)?(c.value=n,!0):Reflect.set(e,t,n,i)}};function xU(e){return eu(e)?e:new Proxy(e,DX)}class FX{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new dC,{get:i,set:c}=t(n.track.bind(n),n.trigger.bind(n));this._get=i,this._set=c}get value(){return this._value=this._get()}set value(t){this._set(t)}}function rM(e){return new FX(e)}function BX(e){const t=dr(e)?new Array(e.length):{};for(const n in e)t[n]=wU(e,n);return t}class zX{constructor(t,n,i){this._object=t,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0,this._key=Ol(n)?n:String(n),this._raw=ci(t);let c=!0,h=t;if(!dr(t)||Ol(this._key)||!iC(this._key))do c=!mC(h)||Ml(h);while(c&&(h=h.__v_raw));this._shallow=c}get value(){let t=this._object[this._key];return this._shallow&&(t=Ar(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&qi(this._raw[this._key])){const n=this._object[this._key];if(qi(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return yX(this._raw,this._key)}}class NX{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function Ix(e,t,n){return qi(e)?e:Ir(e)?new NX(e):Li(e)&&arguments.length>1?wU(e,t,n):hn(e)}function wU(e,t,n){return new zX(e,t,n)}class VX{constructor(t,n,i){this.fn=t,this.setter=n,this._value=void 0,this.dep=new dC(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Hb-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&lo!==this)return sU(this,!0),!0}get value(){const t=this.dep.track();return cU(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function UX(e,t,n=!1){let i,c;return Ir(e)?i=e:(i=e.get,c=e.set),new VX(i,c,n)}const HS={},iE=new WeakMap;let gm;function $X(e,t=!1,n=gm){if(n){let i=iE.get(n);i||iE.set(n,i=[]),i.push(e)}}function jX(e,t,n=Ei){const{immediate:i,deep:c,once:h,scheduler:m,augmentJob:a,call:y}=n,E=K=>c?K:Ml(K)||c===!1||c===0?ih(K,1):ih(K);let C,P,L,D,V=!1,U=!1;if(qi(e)?(P=()=>e.value,V=Ml(e)):eu(e)?(P=()=>E(e),V=!0):dr(e)?(U=!0,V=e.some(K=>eu(K)||Ml(K)),P=()=>e.map(K=>{if(qi(K))return K.value;if(eu(K))return E(K);if(Ir(K))return y?y(K,2):K()})):Ir(e)?t?P=y?()=>y(e,2):e:P=()=>{if(L){gh();try{L()}finally{_h()}}const K=gm;gm=C;try{return y?y(e,3,[D]):e(D)}finally{gm=K}}:P=td,t&&c){const K=P,ne=c===!0?1/0:c;P=()=>ih(K(),ne)}const W=ld(),$=()=>{C.stop(),W&&W.active&&Kk(W.effects,C)};if(h&&t){const K=t;t=(...ne)=>{const fe=K(...ne);return $(),fe}}let Y=U?new Array(e.length).fill(HS):HS;const X=K=>{if(!(!(C.flags&1)||!C.dirty&&!K))if(t){const ne=C.run();if(K||c||V||(U?ne.some((fe,ye)=>$s(fe,Y[ye])):$s(ne,Y))){L&&L();const fe=gm;gm=C;try{const ye=[ne,Y===HS?void 0:U&&Y[0]===HS?[]:Y,D];Y=ne,y?y(t,3,ye):t(...ye)}finally{gm=fe}}}else C.run()};
vendor: 4,220 bytes, line 2
2return a&&a(X),C=new iU(P),C.scheduler=m?()=>m(X,!1):X,D=K=>$X(K,!1,C),L=C.onStop=()=>{const K=iE.get(C);if(K){if(y)y(K,4);else for(const ne of K)ne();iE.delete(C)}},t?i?X(!0):Y=C.run():m?m(X.bind(null,!0),!0):C.run(),$.pause=C.pause.bind(C),$.resume=C.resume.bind(C),$.stop=$,$}function ih(e,t=1/0,n){if(t<=0||!Li(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,qi(e))ih(e.value,t,n);else if(dr(e))for(let i=0;i<e.length;i++)ih(e[i],t,n);else if(rC(e)||W_(e))e.forEach(i=>{ih(i,t,n)});else if(Jk(e)){for(const i in e)ih(e[i],t,n);for(const i of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,i)&&ih(e[i],t,n)}return e}function Px(e,t,n,i){try{return i?e(...i):e()}catch(c){Sy(c,t,n)}}function yc(e,t,n,i){if(Ir(e)){const c=Px(e,t,n,i);return c&&YV(c)&&c.catch(h=>{Sy(h,t,n)}),c}if(dr(e)){const c=[];for(let h=0;h<e.length;h++)c.push(yc(e[h],t,n,i));return c}}function Sy(e,t,n,i=!0){const c=t?t.vnode:null,{errorHandler:h,throwUnhandledErrorInProduction:m}=t&&t.appContext.config||Ei;if(t){let a=t.parent;const y=t.proxy,E=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const C=a.ec;if(C){for(let P=0;P<C.length;P++)if(C[P](e,y,E)===!1)return}a=a.parent}if(h){gh(),Px(h,null,10,[e,y,E]),_h();return}}GX(e,n,c,i,m)}function GX(e,t,n,i=!0,c=!1){if(c)throw e;console.error(e)}const Ba=[];let qu=-1;const X_=[];let Pf=null,L_=0;const SU=Promise.resolve();let oE=null;function ts(e){const t=oE||SU;return e?t.then(this?e.bind(this):e):t}function HX(e){let t=qu+1,n=Ba.length;for(;t<n;){const i=t+n>>>1,c=Ba[i],h=Xb(c);h<e||h===e&&c.flags&2?t=i+1:n=i}return t}function iM(e){if(!(e.flags&1)){const t=Xb(e),n=Ba[Ba.length-1];!n||!(e.flags&2)&&t>=Xb(n)?Ba.push(e):Ba.splice(HX(t),0,e),e.flags|=1,TU()}}function TU(){oE||(oE=SU.then(EU))}function qb(e){dr(e)?X_.push(...e):Pf&&e.id===-1?Pf.splice(L_+1,0,e):e.flags&1||(X_.push(e),e.flags|=1),TU()}function EB(e,t,n=qu+1){for(;n<Ba.length;n++){const i=Ba[n];if(i&&i.flags&2){if(e&&i.id!==e.uid)continue;Ba.splice(n,1),n--,i.flags&4&&(i.flags&=-2),i(),i.flags&4||(i.flags&=-2)}}}function sE(e){if(X_.length){const t=[...new Set(X_)].sort((n,i)=>Xb(n)-Xb(i));if(X_.length=0,Pf){Pf.push(...t);return}for(Pf=t,L_=0;L_<Pf.length;L_++){const n=Pf[L_];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Pf=null,L_=0}}const Xb=e=>e.id==null?e.flags&2?-1:1/0:e.id;function EU(e){try{for(qu=0;qu<Ba.length;qu++){const t=Ba[qu];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Px(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;qu<Ba.length;qu++){const t=Ba[qu];t&&(t.flags&=-2)}qu=-1,Ba.length=0,sE(),oE=null,(Ba.length||X_.length)&&EU()}}let Ws=null,CU=null;function aE(e){const t=Ws;return Ws=e,CU=e&&e.type.__scopeId||null,t}function hh(e,t=Ws,n){if(!t||e._n)return e;const i=(...c)=>{i._d&&pE(-1);const h=aE(t);let m;try{m=e(...c)}finally{aE(h),i._d&&pE(1)}return m};return i._n=!0,i._c=!0,i._d=!0,i}function WX(e,t){if(Ws===null)return e;const n=bC(Ws),i=e.dirs||(e.dirs=[]);for(let c=0;c<t.length;c++){let[h,m,a,y=Ei]=t[c];h&&(Ir(h)&&(h={mounted:h,updated:h}),h.deep&&ih(m),i.push({dir:h,instance:n,value:m,oldValue:void 0,arg:a,modifiers:y}))}return e}function Zu(e,t,n,i){const c=e.dirs,h=t&&t.dirs;for(let m=0;m<c.length;m++){const a=c[m];h&&(a.oldValue=h[m].value);let y=a.dir[i];y&&(gh(),yc(y,n,8,[e.el,a,e,t]),_h())}}function fh(e,t){if(Gs){let n=Gs.provides;const i=Gs.parent&&Gs.parent.provides;i===n&&(n=Gs.provides=Object.create(i)),n[e]=t}}function wo(e,t,n=!1){const i=Ds();if(i||Im){let c=Im?Im._context.provides:i?i.parent==null||i.ce?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides:void 0;if(c&&e in c)return c[e];if(arguments.length>1)return n&&Ir(t)?t.call(i&&i.proxy):t}}function Wm(){return!!(Ds()||Im)}const qX=Symbol.for("v-scx"),XX=()=>wo(qX);function AU(e,t){return gC(e,null,t)}function ZX(e,t){return gC(e,null,{flush:"sync"})}function qr(e,t,n){return gC(e,t,n)}function gC(e,t,n=Ei){const{immediate:i,deep:c,flush:h,once:m}=n,a=ns({},n),y=t&&i||!t&&h!=="post";let E;if(oy){if(h==="sync"){const D=XX();E=D.__watcherHandles||(D.__watcherHandles=[])}else if(!y){const D=()=>{};return D.stop=td,D.resume=td,D.pause=td,D}}const C=Gs;a.call=(D,V,U)=>yc(D,C,V,U);let P=!1;
2h==="post"?a.scheduler=D=>{us(D,C&&C.suspense)}:h!=="sync"&&(P=!0,a.scheduler=(D,V)=>{V?D():iM(D)}),a.augmentJob=D=>{t&&(D.flags|=4),P&&(D.flags|=2,C&&(D.id=C.uid,D.i=C))};const L=jX(e,t,a);return oy&&(E?E.push(L):y&&L()),L}function YX(e,t,n){const i=this.proxy,c=eo(e)?e.includes(".")?IU(i,e):()=>i[e]:e.bind(i,i);let h;Ir(t)?h=t:(h=t.handler,n=t);const m=kx(this),a=gC(c,h.bind(i),n);return m(),a}function IU(e,t){const n=t.split(".");return()=>{let i=e;for(let c=0;c<n.length&&i;c++)i=i[n[c]];return i}}const Ef=new WeakMap,PU=Symbol("_vte"),RU=e=>e.__isTeleport,bm=e=>e&&(e.disabled||e.disabled===""),KX=e=>e&&(e.defer||e.defer===""),CB=e=>typeof SVGElement<"u"&&e instanceof SVGElement,AB=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,UP=(e,t)=>{const n=e&&e.to;return eo(n)?t?t(n):null:n},JX={name:"Teleport",__isTeleport:!0,process(e,t,n,i,c,h,m,a,y,E){const{mc:C,pc:P,pbc:L,o:{insert:D,querySelector:V,createText:U,createComment:W,parentNode:$}}=E,Y=bm(t.props);let{dynamicChildren:X}=t;const K=(ye,ke,Fe)=>{ye.shapeFlag&16&&C(ye.children,ke,Fe,c,h,m,a,y)},ne=(ye=t)=>{const ke=bm(ye.props),Fe=ye.target=UP(ye.props,V),qe=$P(Fe,ye,U,D);Fe&&(m!=="svg"&&CB(Fe)?m="svg":m!=="mathml"&&AB(Fe)&&(m="mathml"),c&&c.isCE&&(c.ce._teleportTargets||(c.ce._teleportTargets=new Set)).add(Fe),ke||(K(ye,Fe,qe),hb(ye,!1)))},fe=ye=>{const ke=()=>{if(Ef.get(ye)===ke){if(Ef.delete(ye),bm(ye.props)){const Fe=$(ye.el)||n;K(ye,Fe,ye.anchor),hb(ye,!0)}ne(ye)}};Ef.set(ye,ke),us(ke,h)};if(e==null){const ye=t.el=U(""),ke=t.anchor=U("");if(D(ye,n,i),D(ke,n,i),KX(t.props)||h&&h.pendingBranch){fe(t);return}Y&&(K(t,n,ke),hb(t,!0)),ne()}else{t.el=e.el;const ye=t.anchor=e.anchor,ke=Ef.get(e);if(ke){ke.flags|=8,Ef.delete(e),fe(t);return}t.targetStart=e.targetStart;const Fe=t.target=e.target,qe=t.targetAnchor=e.targetAnchor,lt=bm(e.props),pt=lt?n:Fe,Qt=lt?ye:qe;if(m==="svg"||CB(Fe)?m="svg":(m==="mathml"||AB(Fe))&&(m="mathml"),X?(L(e.dynamicChildren,X,pt,c,h,m,a),mM(e,t,!0)):y||P(e,t,pt,Qt,c,h,m,a,!1),Y)lt?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):WS(t,n,ye,E,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const Ht=t.target=UP(t.props,V);Ht&&WS(t,Ht,null,E,0)}else lt&&WS(t,Fe,qe,E,1);hb(t,Y)}},remove(e,t,n,{um:i,o:{remove:c}},h){const{shapeFlag:m,children:a,anchor:y,targetStart:E,targetAnchor:C,target:P,props:L}=e,D=h||!bm(L),V=Ef.get(e);if(V&&(V.flags|=8,Ef.delete(e)),P&&(c(E),c(C)),h&&c(y),!V&&m&16)for(let U=0;U<a.length;U++){const W=a[U];i(W,t,n,D,!!W.dynamicChildren)}},move:WS,hydrate:QX};function WS(e,t,n,{o:{insert:i},m:c},h=2){h===0&&i(e.targetAnchor,t,n);const{el:m,anchor:a,shapeFlag:y,children:E,props:C}=e,P=h===2;if(P&&i(m,t,n),!Ef.has(e)&&(!P||bm(C))&&y&16)for(let L=0;L<E.length;L++)c(E[L],t,n,2);P&&i(a,t,n)}function QX(e,t,n,i,c,h,{o:{nextSibling:m,parentNode:a,querySelector:y,insert:E,createText:C}},P){function L(W,$){let Y=$;for(;Y;){if(Y&&Y.nodeType===8){if(Y.data==="teleport start anchor")t.targetStart=Y;else if(Y.data==="teleport anchor"){t.targetAnchor=Y,W._lpa=t.targetAnchor&&m(t.targetAnchor);break}}Y=m(Y)}}function D(W,$){$.anchor=P(m(W),$,a(W),n,i,c,h)}const V=t.target=UP(t.props,y),U=bm(t.props);if(V){const W=V._lpa||V.firstChild;t.shapeFlag&16&&(U?(D(e,t),L(V,W),t.targetAnchor||$P(V,t,C,E,a(e)===V?e:null)):(t.anchor=m(e),L(V,W),t.targetAnchor||$P(V,t,C,E),P(W&&m(W),t,V,n,i,c,h))),hb(t,U)}else U&&t.shapeFlag&16&&(D(e,t),t.targetStart=e,t.targetAnchor=m(e));return t.anchor&&m(t.anchor)}const kU=JX;function hb(e,t){const n=e.ctx;if(n&&n.ut){let i,c;for(t?(i=e.el,c=e.anchor):(i=e.targetStart,c=e.targetAnchor);i&&i!==c;)i.nodeType===1&&i.setAttribute("data-v-owner",n.uid),i=i.nextSibling;n.ut()}}function $P(e,t,n,i,c=null){const h=t.targetStart=n(""),m=t.targetAnchor=n("");return h[PU]=m,e&&(i(h,e,c),i(m,e,c)),m}const fc=Symbol("_leaveCb"),Yv=Symbol("_enterCb");function MU(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return cu(()=>{e.isMounted=!0}),Ty(()=>{e.isUnmounting=!0}),e}const ac=[Function,Array],LU={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ac,onEnter:ac,onAfterEnter:ac,onEnterCancelled:ac,onBeforeLeave:ac,onLeave:ac,onAfterLeave:ac,onLeaveCancelled:ac,onBeforeAppear:ac,onAppear:ac,onAfterAppear:ac,onAppearCancelled:ac},OU=e=>{const t=e.subTree;return t.component?OU(t.component):t},eZ={name:"BaseTransition",props:LU,setup(e,{slots:t}){const n=Ds(),i=MU();return()=>{const c=t.default&&oM(t.default(),!0),h=c&&c.length?DU(c):n.subTree?Zf():void 0;if(!h)return;const m=ci(e),{mode:a}=m;if(i.isLeaving)return xI(h);const y=IB(h);if(!y)return xI(h);let E=Zb(y,m,i,n,P=>E=P);y.type!==hs&&Xf(y,E);let C=n.subTree&&IB(n.subTree);if(C&&C.type!==hs&&!Yc(C,y)&&OU(n).type!==hs){let P=Zb(C,m,i,n);if(Xf(C,P),a==="out-in"&&y.type!==hs)return i.isLeaving=!0,P.afterLeave=()=>{i.isLeaving=!1,n.job.flags&8||n.update(),delete P.afterLeave,C=void 0},xI(h);a==="in-out"&&y.type!==hs?P.delayLeave=(L,D,V)=>{const U=FU(i,C);
vendor: 40,279 bytes, lines 2-4
2U[String(C.key)]=C,L[fc]=()=>{D(),L[fc]=void 0,delete E.delayedLeave,C=void 0},E.delayedLeave=()=>{V(),delete E.delayedLeave,C=void 0}}:C=void 0}else C&&(C=void 0);return h}}};function DU(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==hs){t=n;break}}return t}const tZ=eZ;function FU(e,t){const{leavingVNodes:n}=e;let i=n.get(t.type);return i||(i=Object.create(null),n.set(t.type,i)),i}function Zb(e,t,n,i,c){const{appear:h,mode:m,persisted:a=!1,onBeforeEnter:y,onEnter:E,onAfterEnter:C,onEnterCancelled:P,onBeforeLeave:L,onLeave:D,onAfterLeave:V,onLeaveCancelled:U,onBeforeAppear:W,onAppear:$,onAfterAppear:Y,onAppearCancelled:X}=t,K=String(e.key),ne=FU(n,e),fe=(Fe,qe)=>{Fe&&yc(Fe,i,9,qe)},ye=(Fe,qe)=>{const lt=qe[1];fe(Fe,qe),dr(Fe)?Fe.every(pt=>pt.length<=1)&<():Fe.length<=1&<()},ke={mode:m,persisted:a,beforeEnter(Fe){let qe=y;if(!n.isMounted)if(h)qe=W||y;else return;Fe[fc]&&Fe[fc](!0);const lt=ne[K];lt&&Yc(e,lt)&<.el[fc]&<.el[fc](),fe(qe,[Fe])},enter(Fe){if(ne[K]===e)return;let qe=E,lt=C,pt=P;if(!n.isMounted)if(h)qe=$||E,lt=Y||C,pt=X||P;else return;let Qt=!1;Fe[Yv]=zt=>{Qt||(Qt=!0,zt?fe(pt,[Fe]):fe(lt,[Fe]),ke.delayedLeave&&ke.delayedLeave(),Fe[Yv]=void 0)};const Ht=Fe[Yv].bind(null,!1);qe?ye(qe,[Fe,Ht]):Ht()},leave(Fe,qe){const lt=String(e.key);if(Fe[Yv]&&Fe[Yv](!0),n.isUnmounting)return qe();fe(L,[Fe]);let pt=!1;Fe[fc]=Ht=>{pt||(pt=!0,qe(),Ht?fe(U,[Fe]):fe(V,[Fe]),Fe[fc]=void 0,ne[lt]===e&&delete ne[lt])};const Qt=Fe[fc].bind(null,!1);ne[lt]=e,D?ye(D,[Fe,Qt]):Qt()},clone(Fe){const qe=Zb(Fe,t,n,i,c);return c&&c(qe),qe}};return ke}function xI(e){if(Rx(e))return e=od(e),e.children=null,e}function IB(e){if(!Rx(e))return RU(e.type)&&e.children?DU(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&Ir(n.default))return n.default()}}function Xf(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Xf(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function oM(e,t=!1,n){let i=[],c=0;for(let h=0;h<e.length;h++){let m=e[h];const a=n==null?m.key:String(n)+String(m.key!=null?m.key:h);m.type===jo?(m.patchFlag&128&&c++,i=i.concat(oM(m.children,t,a))):(t||m.type!==hs)&&i.push(a!=null?od(m,{key:a}):m)}if(c>1)for(let h=0;h<i.length;h++)i[h].patchFlag=-2;return i}function Ys(e,t){return Ir(e)?ns({name:e.name},t,{setup:e}):e}function nZ(){const e=Ds();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function sM(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function PB(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const lE=new WeakMap;function Z_(e,t,n,i,c=!1){if(dr(e)){e.forEach((U,W)=>Z_(U,t&&(dr(t)?t[W]:t),n,i,c));return}if(ph(i)&&!c){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&Z_(e,t,n,i.component.subTree);return}const h=i.shapeFlag&4?bC(i.component):i.el,m=c?null:h,{i:a,r:y}=e,E=t&&t.r,C=a.refs===Ei?a.refs={}:a.refs,P=a.setupState,L=ci(P),D=P===Ei?ZV:U=>PB(C,U)?!1:zi(L,U),V=(U,W)=>!(W&&PB(C,W));if(E!=null&&E!==y){if(RB(t),eo(E))C[E]=null,D(E)&&(P[E]=null);else if(qi(E)){const U=t;V(E,U.k)&&(E.value=null),U.k&&(C[U.k]=null)}}if(Ir(y))Px(y,a,12,[m,C]);else{const U=eo(y),W=qi(y);if(U||W){const $=()=>{if(e.f){const Y=U?D(y)?P[y]:C[y]:V()||!e.k?y.value:C[e.k];if(c)dr(Y)&&Kk(Y,h);else if(dr(Y))Y.includes(h)||Y.push(h);else if(U)C[y]=[h],D(y)&&(P[y]=C[y]);else{const X=[h];V(y,e.k)&&(y.value=X),e.k&&(C[e.k]=X)}}else U?(C[y]=m,D(y)&&(P[y]=m)):W&&(V(y,e.k)&&(y.value=m),e.k&&(C[e.k]=m))};if(m){const Y=()=>{$(),lE.delete(e)};Y.id=-1,lE.set(e,Y),us(Y,n)}else RB(e),$()}}}function RB(e){const t=lE.get(e);t&&(t.flags|=8,lE.delete(e))}let kB=!1;const w_=()=>{kB||(console.error("Hydration completed but contains mismatches."),kB=!0)},rZ=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",iZ=e=>e.namespaceURI.includes("MathML"),qS=e=>{if(e.nodeType===1){if(rZ(e))return"svg";if(iZ(e))return"mathml"}},N_=e=>e.nodeType===8;function oZ(e){const{mt:t,p:n,o:{patchProp:i,createText:c,nextSibling:h,parentNode:m,remove:a,insert:y,createComment:E}}=e,C=(X,K)=>{if(!K.hasChildNodes()){n(null,X,K),sE(),K._vnode=X;return}P(K.firstChild,X,null,null,null),sE(),K._vnode=X},P=(X,K,ne,fe,ye,ke=!1)=>{ke=ke||!!K.dynamicChildren;const Fe=N_(X)&&X.data==="[",qe=()=>U(X,K,ne,fe,ye,Fe),{type:lt,ref:pt,shapeFlag:Qt,patchFlag:Ht}=K;let zt=X.nodeType;K.el=X,Ht===-2&&(ke=!1,K.dynamicChildren=null);let jt=null;switch(lt){case Vf:zt!==3?K.children===""?(y(K.el=c(""),m(X),X),jt=X):jt=qe():(X.data!==K.children&&(w_(),X.data=K.children),jt=h(X));break;case hs:Y(X)?(jt=h(X),$(K.el=X.content.firstChild,X,ne)):zt!==8||Fe?jt=qe():jt=h(X);break;case Pb:if(Fe&&(X=h(X),zt=X.nodeType),zt===1||zt===3){jt=X;const Zt=!K.children.length;for(let Wt=0;Wt<K.staticCount;Wt++)Zt&&(K.children+=jt.nodeType===1?jt.outerHTML:jt.data),Wt===K.staticCount-1&&(K.anchor=jt),jt=h(jt);return Fe?h(jt):jt}else qe();break;case jo:Fe?jt=V(X,K,ne,fe,ye,ke):jt=qe();break;default:if(Qt&1)(zt!==1||K.type.toLowerCase()!==X.tagName.toLowerCase())&&!Y(X)?jt=qe():jt=L(X,K,ne,fe,ye,ke);else if(Qt&6){K.slotScopeIds=ye;const Zt=m(X);if(Fe?jt=W(X):N_(X)&&X.data==="teleport start"?jt=W(X,X.data,"teleport end"):jt=h(X),t(K,Zt,null,ne,fe,qS(Zt),ke),ph(K)&&!K.type.__asyncResolved){let Wt;Fe?(Wt=Ai(jo),Wt.anchor=jt?jt.previousSibling:Zt.lastChild):Wt=X.nodeType===3?d$(""):Ai("div"),Wt.el=X,K.component.subTree=Wt}}else Qt&64?zt!==8?jt=qe():jt=K.type.hydrate(X,K,ne,fe,ye,ke,e,D):Qt&128&&(jt=K.type.hydrate(X,K,ne,fe,qS(m(X)),ye,ke,e,P))}return pt!=null&&Z_(pt,null,fe,K),jt},L=(X,K,ne,fe,ye,ke)=>{ke=ke||!!K.dynamicChildren;const{type:Fe,props:qe,patchFlag:lt,shapeFlag:pt,dirs:Qt,transition:Ht}=K,zt=Fe==="input"||Fe==="option";if(zt||lt!==-1){Qt&&Zu(K,null,ne,"created");let jt=!1;if(Y(X)){jt=r$(null,Ht)&&ne&&ne.vnode.props&&ne.vnode.props.appear;const Wt=X.content.firstChild;if(jt){const en=Wt.getAttribute("class");en&&(Wt.$cls=en),Ht.beforeEnter(Wt)}$(Wt,X,ne),K.el=X=Wt}if(pt&16&&!(qe&&(qe.innerHTML||qe.textContent))){let Wt=D(X.firstChild,K,X,ne,fe,ye,ke);for(Wt&&!XS(X,1)&&w_();Wt;){const en=Wt;Wt=Wt.nextSibling,a(en)}}else if(pt&8){let Wt=K.children;Wt[0]===` 3`&&(X.tagName==="PRE"||X.tagName==="TEXTAREA")&&(Wt=Wt.slice(1));const{textContent:en}=X;en!==Wt&&en!==Wt.replace(/\r\n|\r/g,` 4`)&&(XS(X,0)||w_(),X.textContent=K.children)}if(qe){if(zt||!ke||lt&48){const Wt=X.tagName.includes("-");for(const en in qe)(zt&&(en.endsWith("value")||en==="indeterminate")||Tx(en)&&!Em(en)||en[0]==="."||Wt&&!Em(en))&&i(X,en,null,qe[en],void 0,ne)}else if(qe.onClick)i(X,"onClick",null,qe.onClick,void 0,ne);else if(lt&4&&eu(qe.style))for(const Wt in qe.style)qe.style[Wt]}let Zt;(Zt=qe&&qe.onVnodeBeforeMount)&&ol(Zt,ne,K),Qt&&Zu(K,null,ne,"beforeMount"),((Zt=qe&&qe.onVnodeMounted)||Qt||jt)&&a$(()=>{Zt&&ol(Zt,ne,K),jt&&Ht.enter(X),Qt&&Zu(K,null,ne,"mounted")},fe)}return X.nextSibling},D=(X,K,ne,fe,ye,ke,Fe)=>{Fe=Fe||!!K.dynamicChildren;const qe=K.children,lt=qe.length;let pt=!1;for(let Qt=0;Qt<lt;Qt++){const Ht=Fe?qe[Qt]:qe[Qt]=Rl(qe[Qt]),zt=Ht.type===Vf;X?(zt&&!Fe&&Qt+1<lt&&Rl(qe[Qt+1]).type===Vf&&(y(c(X.data.slice(Ht.children.length)),ne,h(X)),X.data=Ht.children),X=P(X,Ht,fe,ye,ke,Fe)):zt&&!Ht.children?y(Ht.el=c(""),ne):(pt||(pt=!0,XS(ne,1)||w_()),n(null,Ht,ne,null,fe,ye,qS(ne),ke))}return X},V=(X,K,ne,fe,ye,ke)=>{const{slotScopeIds:Fe}=K;Fe&&(ye=ye?ye.concat(Fe):Fe);const qe=m(X),lt=D(h(X),K,qe,ne,fe,ye,ke);return lt&&N_(lt)&<.data==="]"?h(K.anchor=lt):(w_(),y(K.anchor=E("]"),qe,lt),lt)},U=(X,K,ne,fe,ye,ke)=>{if(XS(X.parentElement,1)||w_(),K.el=null,ke){const lt=W(X);for(;;){const pt=h(X);if(pt&&pt!==lt)a(pt);else break}}const Fe=h(X),qe=m(X);return a(X),n(null,K,qe,Fe,ne,fe,qS(qe),ye),ne&&(ne.vnode.el=K.el,vC(ne,K.el)),Fe},W=(X,K="[",ne="]")=>{let fe=0;for(;X;)if(X=h(X),X&&N_(X)&&(X.data===K&&fe++,X.data===ne)){if(fe===0)return h(X);fe--}return X},$=(X,K,ne)=>{const fe=K.parentNode;fe&&fe.replaceChild(X,K);let ye=ne;for(;ye;)ye.vnode.el===K&&(ye.vnode.el=ye.subTree.el=X),ye=ye.parent},Y=X=>X.nodeType===1&&X.tagName==="TEMPLATE";return[C,P]}const MB="data-allow-mismatch",sZ={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function XS(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(MB);)e=e.parentElement;const n=e&&e.getAttribute(MB);if(n==null)return!1;if(n==="")return!0;{const i=n.split(",");return t===0&&i.includes("children")?!0:i.includes(sZ[t])}}lC().requestIdleCallback;lC().cancelIdleCallback;function aZ(e,t){if(N_(e)&&e.data==="["){let n=1,i=e.nextSibling;for(;i;){if(i.nodeType===1){if(t(i)===!1)break}else if(N_(i))if(i.data==="]"){if(--n===0)break}else i.data==="["&&n++;i=i.nextSibling}}else t(e)}const ph=e=>!!e.type.__asyncLoader;function Nt(e){Ir(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:i,delay:c=200,hydrate:h,timeout:m,suspensible:a=!0,onError:y}=e;let E=null,C,P=0;const L=()=>(P++,E=null,D()),D=()=>{let V;return E||(V=E=t().catch(U=>{if(U=U instanceof Error?U:new Error(String(U)),y)return new Promise((W,$)=>{y(U,()=>W(L()),()=>$(U),P+1)});throw U}).then(U=>V!==E&&E?E:(U&&(U.__esModule||U[Symbol.toStringTag]==="Module")&&(U=U.default),C=U,U)))};return Ys({name:"AsyncComponentWrapper",__asyncLoader:D,__asyncHydrate(V,U,W){let $=!1;(U.bu||(U.bu=[])).push(()=>$=!0);const Y=()=>{$||W()},X=h?()=>{const K=h(Y,ne=>aZ(V,ne));K&&(U.bum||(U.bum=[])).push(K)}:Y;C?X():D().then(()=>!U.isUnmounted&&X())},get __asyncResolved(){return C},setup(){const V=Gs;if(sM(V),C)return()=>ZS(C,V);const U=ne=>{E=null,Sy(ne,V,13,!i)};if(a&&V.suspense||oy)return D().then(ne=>()=>ZS(ne,V)).catch(ne=>(U(ne),()=>i?Ai(i,{error:ne}):null));const W=hn(!1),$=hn(),Y=hn(!!c);let X,K;return Ey(()=>{X!=null&&clearTimeout(X),K!=null&&clearTimeout(K)}),c&&(K=setTimeout(()=>{V.isUnmounted||(Y.value=!1)},c)),m!=null&&(X=setTimeout(()=>{if(!V.isUnmounted&&!W.value&&!$.value){const ne=new Error(`Async component timed out after ${m}ms.`);U(ne),$.value=ne}},m)),D().then(()=>{V.isUnmounted||(W.value=!0,V.parent&&Rx(V.parent.vnode)&&V.parent.update())}).catch(ne=>{if(V.isUnmounted){E=null;return}U(ne),$.value=ne}),()=>{if(W.value&&C)return ZS(C,V);if($.value&&i)return Ai(i,{error:$.value});if(n&&!Y.value)return ZS(n,V)}}})}function ZS(e,t){const{ref:n,props:i,children:c,ce:h}=t.vnode,m=Ai(e,i,c);return m.ref=n,m.ce=h,delete t.vnode.ce,m}const Rx=e=>e.type.__isKeepAlive,lZ={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=Ds(),i=n.ctx;if(!i.renderer)return()=>{const Y=t.default&&t.default();return Y&&Y.length===1?Y[0]:Y};const c=new Map,h=new Set;let m=null;const a=n.suspense,{renderer:{p:y,m:E,um:C,o:{createElement:P}}}=i,L=P("div");i.activate=(Y,X,K,ne,fe)=>{const ye=Y.component;E(Y,X,K,0,a),y(ye.vnode,Y,X,K,ye,a,ne,Y.slotScopeIds,fe),us(()=>{ye.isDeactivated=!1,ye.a&&q_(ye.a);const ke=Y.props&&Y.props.onVnodeMounted;ke&&ol(ke,ye.parent,Y)},a)},i.deactivate=Y=>{const X=Y.component;hE(X.m),hE(X.a),E(Y,L,null,1,a),us(()=>{X.da&&q_(X.da);const K=Y.props&&Y.props.onVnodeUnmounted;K&&ol(K,X.parent,Y),X.isDeactivated=!0},a)};function D(Y){wI(Y),C(Y,n,a,!0)}function V(Y){c.forEach((X,K)=>{const ne=KP(ph(X)?X.type.__asyncResolved||{}:X.type);ne&&!Y(ne)&&U(K)})}function U(Y){const X=c.get(Y);X&&(!m||!Yc(X,m))?D(X):m&&wI(m),c.delete(Y),h.delete(Y)}qr(()=>[e.include,e.exclude],([Y,X])=>{Y&&V(K=>fb(Y,K)),X&&V(K=>!fb(X,K))},{flush:"post",deep:!0});let W=null;const $=()=>{W!=null&&(fE(n.subTree.type)?us(()=>{c.set(W,YS(n.subTree))},n.subTree.suspense):c.set(W,YS(n.subTree)))};return cu($),cM($),Ty(()=>{c.forEach(Y=>{const{subTree:X,suspense:K}=n,ne=YS(X);if(Y.type===ne.type&&Y.key===ne.key){wI(ne);const fe=ne.component.da;fe&&us(fe,K);return}D(Y)})}),()=>{if(W=null,!t.default)return m=null;const Y=t.default(),X=Y[0];if(Y.length>1)return m=null,Y;if(!Fm(X)||!(X.shapeFlag&4)&&!(X.shapeFlag&128))return m=null,X;let K=YS(X);if(K.type===hs)return m=null,K;const ne=K.type,fe=KP(ph(K)?K.type.__asyncResolved||{}:ne),{include:ye,exclude:ke,max:Fe}=e;if(ye&&(!fe||!fb(ye,fe))||ke&&fe&&fb(ke,fe))return K.shapeFlag&=-257,m=K,X;const qe=K.key==null?ne:K.key,lt=c.get(qe);return K.el&&(K=od(K),X.shapeFlag&128&&(X.ssContent=K)),W=qe,lt?(K.el=lt.el,K.component=lt.component,K.transition&&Xf(K,K.transition),K.shapeFlag|=512,h.delete(qe),h.add(qe)):(h.add(qe),Fe&&h.size>parseInt(Fe,10)&&U(h.values().next().value)),K.shapeFlag|=256,m=K,fE(X.type)?X:K}}},cZ=lZ;function fb(e,t){return dr(e)?e.some(n=>fb(n,t)):eo(e)?e.split(",").includes(t):rX(e)?(e.lastIndex=0,e.test(t)):!1}function aM(e,t){BU(e,"a",t)}function lM(e,t){BU(e,"da",t)}function BU(e,t,n=Gs){const i=e.__wdc||(e.__wdc=()=>{let c=n;for(;c;){if(c.isDeactivated)return;c=c.parent}return e()});if(_C(t,i,n),n){let c=n.parent;for(;c&&c.parent;)Rx(c.parent.vnode)&&uZ(i,t,n,c),c=c.parent}}function uZ(e,t,n,i){const c=_C(t,e,i,!0);Ey(()=>{Kk(i[t],c)},n)}function wI(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function YS(e){return e.shapeFlag&128?e.ssContent:e}function _C(e,t,n=Gs,i=!1){if(n){const c=n[e]||(n[e]=[]),h=t.__weh||(t.__weh=(...m)=>{gh();const a=kx(n),y=yc(t,n,e,m);return a(),_h(),y});return i?c.unshift(h):c.push(h),h}}const xh=e=>(t,n=Gs)=>{(!oy||e==="sp")&&_C(e,(...i)=>t(...i),n)},zU=xh("bm"),cu=xh("m"),dZ=xh("bu"),cM=xh("u"),Ty=xh("bum"),Ey=xh("um"),hZ=xh("sp"),fZ=xh("rtg"),pZ=xh("rtc");function uM(e,t=Gs){_C("ec",e,t)}const dM="components",mZ="directives";function cE(e,t){return hM(dM,e,!0,t)||e}const NU=Symbol.for("v-ndc");function wm(e){return eo(e)?hM(dM,e,!1)||e:e||NU}function gZ(e){return hM(mZ,e)}function hM(e,t,n=!0,i=!1){const c=Ws||Gs;if(c){const h=c.type;if(e===dM){const a=KP(h,!1);if(a&&(a===t||a===_a(t)||a===sC(_a(t))))return h}const m=LB(c[e]||h[e],t)||LB(c.appContext[e],t);return!m&&i?h:m}}function LB(e,t){return e&&(e[t]||e[_a(t)]||e[sC(_a(t))])}function _Z(e,t,n,i){let c;const h=n&&n[i],m=dr(e);if(m||eo(e)){const a=m&&eu(e);let y=!1,E=!1;a&&(y=!Ml(e),E=id(e),e=hC(e)),c=new Array(e.length);for(let C=0,P=e.length;C<P;C++)c[C]=t(y?E?ry(ru(e[C])):ru(e[C]):e[C],C,void 0,h&&h[C])}else if(typeof e=="number"){c=new Array(e);for(let a=0;a<e;a++)c[a]=t(a+1,a,void 0,h&&h[a])}else if(Li(e))if(e[Symbol.iterator])c=Array.from(e,(a,y)=>t(a,y,void 0,h&&h[y]));else{const a=Object.keys(e);c=new Array(a.length);for(let y=0,E=a.length;y<E;y++){const C=a[y];c[y]=t(e[C],C,y,h&&h[y])}}else c=[];return n&&(n[i]=c),c}function MLe(e,t){for(let n=0;n<t.length;n++){const i=t[n];if(dr(i))for(let c=0;c<i.length;c++)e[i[c].name]=i[c].fn;else i&&(e[i.name]=i.key?(...c)=>{const h=i.fn(...c);return h&&(h.key=i.key),h}:i.fn)}return e}function OB(e,t,n={},i,c){if(Ws.ce||Ws.parent&&ph(Ws.parent)&&Ws.parent.ce){const E=Object.keys(n).length>0;return t!=="default"&&(n.name=t),ei(),Ss(jo,null,[Ai("slot",n,i&&i())],E?-2:64)}let h=e[t];h&&h._c&&(h._d=!1),ei();const m=h&&VU(h(n)),a=n.key||m&&m.key,y=Ss(jo,{key:(a&&!Ol(a)?a:`_${t}`)+(!m&&i?"_fb":"")},m||(i?i():[]),m&&e._===1?64:-2);return!c&&y.scopeId&&(y.slotScopeIds=[y.scopeId+"-s"]),h&&h._c&&(h._d=!0),y}function VU(e){return e.some(t=>Fm(t)?!(t.type===hs||t.type===jo&&!VU(t.children)):!0)?e:null}function LLe(e,t){const n={};for(const i in e)n[t&&/[A-Z]/.test(i)?`on:${i}`:NT(i)]=e[i];return n}const jP=e=>e?h$(e)?bC(e):jP(e.parent):null,Ib=ns(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>jP(e.parent),$root:e=>jP(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>jU(e),$forceUpdate:e=>e.f||(e.f=()=>{iM(e.update)}),$nextTick:e=>e.n||(e.n=ts.bind(e.proxy)),$watch:e=>YX.bind(e)}),SI=(e,t)=>e!==Ei&&!e.__isScriptSetup&&zi(e,t),yZ={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:i,data:c,props:h,accessCache:m,type:a,appContext:y}=e;if(t[0]!=="$"){const L=m[t];if(L!==void 0)switch(L){case 1:return i[t];case 2:return c[t];case 4:return n[t];case 3:return h[t]}else{if(SI(i,t))return m[t]=1,i[t];if(c!==Ei&&zi(c,t))return m[t]=2,c[t];if(zi(h,t))return m[t]=3,h[t];if(n!==Ei&&zi(n,t))return m[t]=4,n[t];GP&&(m[t]=0)}}const E=Ib[t];let C,P;if(E)return t==="$attrs"&&ma(e.attrs,"get",""),E(e);if((C=a.__cssModules)&&(C=C[t]))return C;if(n!==Ei&&zi(n,t))return m[t]=4,n[t];if(P=y.config.globalProperties,zi(P,t))return P[t]},set({_:e},t,n){const{data:i,setupState:c,ctx:h}=e;return SI(c,t)?(c[t]=n,!0):i!==Ei&&zi(i,t)?(i[t]=n,!0):zi(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(h[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:i,appContext:c,props:h,type:m}},a){let y;return!!(n[a]||e!==Ei&&a[0]!=="$"&&zi(e,a)||SI(t,a)||zi(h,a)||zi(i,a)||zi(Ib,a)||zi(c.config.globalProperties,a)||(y=m.__cssModules)&&y[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:zi(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function OLe(){return UU().slots}function DLe(){return UU().attrs}function UU(e){const t=Ds();return t.setupContext||(t.setupContext=p$(t))}function uE(e){return dr(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function FLe(e,t){return!e||!t?e||t:dr(e)&&dr(t)?e.concat(t):ns({},uE(e),uE(t))}let GP=!0;function vZ(e){const t=jU(e),n=e.proxy,i=e.ctx;GP=!1,t.beforeCreate&&DB(t.beforeCreate,e,"bc");const{data:c,computed:h,methods:m,watch:a,provide:y,inject:E,created:C,beforeMount:P,mounted:L,beforeUpdate:D,updated:V,activated:U,deactivated:W,beforeDestroy:$,beforeUnmount:Y,destroyed:X,unmounted:K,render:ne,renderTracked:fe,renderTriggered:ye,errorCaptured:ke,serverPrefetch:Fe,expose:qe,inheritAttrs:lt,components:pt,directives:Qt,filters:Ht}=t;if(E&&bZ(E,i,null),m)for(const Zt in m){const Wt=m[Zt];Ir(Wt)&&(i[Zt]=Wt.bind(n))}if(c){const Zt=c.call(n,n);Li(Zt)&&(e.data=Fl(Zt))}if(GP=!0,h)for(const Zt in h){const Wt=h[Zt],en=Ir(Wt)?Wt.bind(n,n):Ir(Wt.get)?Wt.get.bind(n,n):td,sn=!Ir(Wt)&&Ir(Wt.set)?Wt.set.bind(n):td,Mn=vn({get:en,set:sn});Object.defineProperty(i,Zt,{enumerable:!0,configurable:!0,get:()=>Mn.value,set:xn=>Mn.value=xn})}if(a)for(const Zt in a)$U(a[Zt],i,n,Zt);if(y){const Zt=Ir(y)?y.call(n):y;Reflect.ownKeys(Zt).forEach(Wt=>{fh(Wt,Zt[Wt])})}C&&DB(C,e,"c");function jt(Zt,Wt){dr(Wt)?Wt.forEach(en=>Zt(en.bind(n))):Wt&&Zt(Wt.bind(n))}if(jt(zU,P),jt(cu,L),jt(dZ,D),jt(cM,V),jt(aM,U),jt(lM,W),jt(uM,ke),jt(pZ,fe),jt(fZ,ye),jt(Ty,Y),jt(Ey,K),jt(hZ,Fe),dr(qe))if(qe.length){const Zt=e.exposed||(e.exposed={});qe.forEach(Wt=>{Object.defineProperty(Zt,Wt,{get:()=>n[Wt],set:en=>n[Wt]=en,enumerable:!0})})}else e.exposed||(e.exposed={});ne&&e.render===td&&(e.render=ne),lt!=null&&(e.inheritAttrs=lt),pt&&(e.components=pt),Qt&&(e.directives=Qt),Fe&&sM(e)}function bZ(e,t,n=td){dr(e)&&(e=HP(e));for(const i in e){const c=e[i];let h;Li(c)?"default"in c?h=wo(c.from||i,c.default,!0):h=wo(c.from||i):h=wo(c),qi(h)?Object.defineProperty(t,i,{enumerable:!0,configurable:!0,get:()=>h.value,set:m=>h.value=m}):t[i]=h}}function DB(e,t,n){yc(dr(e)?e.map(i=>i.bind(t.proxy)):e.bind(t.proxy),t,n)}function $U(e,t,n,i){let c=i.includes(".")?IU(n,i):()=>n[i];if(eo(e)){const h=t[e];Ir(h)&&qr(c,h)}else if(Ir(e))qr(c,e.bind(n));else if(Li(e))if(dr(e))e.forEach(h=>$U(h,t,n,i));else{const h=Ir(e.handler)?e.handler.bind(n):t[e.handler];Ir(h)&&qr(c,h,e)}}function jU(e){const t=e.type,{mixins:n,extends:i}=t,{mixins:c,optionsCache:h,config:{optionMergeStrategies:m}}=e.appContext,a=h.get(t);let y;return a?y=a:!c.length&&!n&&!i?y=t:(y={},c.length&&c.forEach(E=>dE(y,E,m,!0)),dE(y,t,m)),Li(t)&&h.set(t,y),y}function dE(e,t,n,i=!1){const{mixins:c,extends:h}=t;h&&dE(e,h,n,!0),c&&c.forEach(m=>dE(e,m,n,!0));for(const m in t)if(!(i&&m==="expose")){const a=xZ[m]||n&&n[m];e[m]=a?a(e[m],t[m]):t[m]}return e}const xZ={data:FB,props:BB,emits:BB,methods:pb,computed:pb,beforeCreate:Da,created:Da,beforeMount:Da,mounted:Da,beforeUpdate:Da,updated:Da,beforeDestroy:Da,beforeUnmount:Da,destroyed:Da,unmounted:Da,activated:Da,deactivated:Da,errorCaptured:Da,serverPrefetch:Da,components:pb,directives:pb,watch:SZ,provide:FB,inject:wZ};function FB(e,t){return t?e?function(){return ns(Ir(e)?e.call(this,this):e,Ir(t)?t.call(this,this):t)}:t:e}function wZ(e,t){return pb(HP(e),HP(t))}function HP(e){if(dr(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Da(e,t){return e?[...new Set([].concat(e,t))]:t}function pb(e,t){return e?ns(Object.create(null),e,t):t}function BB(e,t){return e?dr(e)&&dr(t)?[...new Set([...e,...t])]:ns(Object.create(null),uE(e),uE(t??{})):t}function SZ(e,t){if(!e)return t;if(!t)return e;const n=ns(Object.create(null),e);for(const i in t)n[i]=Da(e[i],t[i]);return n}function GU(){return{app:null,config:{isNativeTag:ZV,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let TZ=0;function EZ(e,t){return function(i,c=null){Ir(i)||(i=ns({},i)),c!=null&&!Li(c)&&(c=null);const h=GU(),m=new WeakSet,a=[];let y=!1;const E=h.app={_uid:TZ++,_component:i,_props:c,_container:null,_context:h,_instance:null,version:nY,get config(){return h.config},set config(C){},use(C,...P){return m.has(C)||(C&&Ir(C.install)?(m.add(C),C.install(E,...P)):Ir(C)&&(m.add(C),C(E,...P))),E},mixin(C){return h.mixins.includes(C)||h.mixins.push(C),E},component(C,P){return P?(h.components[C]=P,E):h.components[C]},directive(C,P){return P?(h.directives[C]=P,E):h.directives[C]},mount(C,P,L){if(!y){const D=E._ceVNode||Ai(i,c);return D.appContext=h,L===!0?L="svg":L===!1&&(L=void 0),P&&t?t(D,C):e(D,C,L),y=!0,E._container=C,C.__vue_app__=E,bC(D.component)}},onUnmount(C){a.push(C)},unmount(){y&&(yc(a,E._instance,16),e(null,E._container),delete E._container.__vue_app__)},provide(C,P){return h.provides[C]=P,E},runWithContext(C){const P=Im;Im=E;try{return C()}finally{Im=P}}};return E}}let Im=null;function BLe(e,t,n=Ei){const i=Ds(),c=_a(t),h=bh(t),m=HU(e,c),a=rM((y,E)=>{let C,P=Ei,L;return ZX(()=>{const D=e[c];$s(C,D)&&(C=D,E())}),{get(){return y(),n.get?n.get(C):C},set(D){const V=n.set?n.set(D):D;if(!$s(V,C)&&!(P!==Ei&&$s(D,P)))return;const U=i.vnode.props,W=!!(U&&(t in U||c in U||h in U)&&(`onUpdate:${t}`in U||`onUpdate:${c}`in U||`onUpdate:${h}`in U));W||(C=D,E()),i.emit(`update:${t}`,V),$s(D,P)&&($s(D,V)&&!$s(V,L)||W&&P!==Ei&&!$s(V,C))&&E(),P=D,L=V}}});return a[Symbol.iterator]=()=>{let y=0;return{next(){return y<2?{value:y++?m||Ei:a,done:!1}:{done:!0}}}},a}const HU=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${_a(t)}Modifiers`]||e[`${bh(t)}Modifiers`];function CZ(e,t,...n){if(e.isUnmounted)return;const i=e.vnode.props||Ei;let c=n;const h=t.startsWith("update:"),m=h&&HU(i,t.slice(7));m&&(m.trim&&(c=n.map(C=>eo(C)?C.trim():C)),m.number&&(c=n.map(aC)));let a,y=i[a=NT(t)]||i[a=NT(_a(t))];!y&&h&&(y=i[a=NT(bh(t))]),y&&yc(y,e,6,c);const E=i[a+"Once"];if(E){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,yc(E,e,6,c)}}const AZ=new WeakMap;function WU(e,t,n=!1){const i=n?AZ:t.emitsCache,c=i.get(e);if(c!==void 0)return c;const h=e.emits;let m={},a=!1;if(!Ir(e)){const y=E=>{const C=WU(E,t,!0);C&&(a=!0,ns(m,C))};!n&&t.mixins.length&&t.mixins.forEach(y),e.extends&&y(e.extends),e.mixins&&e.mixins.forEach(y)}return!h&&!a?(Li(e)&&i.set(e,null),null):(dr(h)?h.forEach(y=>m[y]=null):ns(m,h),Li(e)&&i.set(e,m),m)}function yC(e,t){return!e||!Tx(t)?!1:(t=t.slice(2).replace(/Once$/,""),zi(e,t[0].toLowerCase()+t.slice(1))||zi(e,bh(t))||zi(e,t))}function TI(e){const{type:t,vnode:n,proxy:i,withProxy:c,propsOptions:[h],slots:m,attrs:a,emit:y,render:E,renderCache:C,props:P,data:L,setupState:D,ctx:V,inheritAttrs:U}=e,W=aE(e);let $,Y;try{if(n.shapeFlag&4){const K=c||i,ne=K;$=Rl(E.call(ne,K,C,P,D,L,V)),Y=a}else{const K=t;$=Rl(K.length>1?K(P,{attrs:a,slots:m,emit:y}):K(P,null)),Y=t.props?a:PZ(a)}}catch(K){Rb.length=0,Sy(K,e,1),$=Ai(hs)}let X=$;if(Y&&U!==!1){const K=Object.keys(Y),{shapeFlag:ne}=X;K.length&&ne&7&&(h&&K.some(nC)&&(Y=RZ(Y,h)),X=od(X,Y,!1,!0))}return n.dirs&&(X=od(X,null,!1,!0),X.dirs=X.dirs?X.dirs.concat(n.dirs):n.dirs),n.transition&&Xf(X,n.transition),$=X,aE(W),$}function IZ(e,t=!0){let n;for(let i=0;i<e.length;i++){const c=e[i];if(Fm(c)){if(c.type!==hs||c.children==="v-if"){if(n)return;n=c}}else return}return n}const PZ=e=>{let t;for(const n in e)(n==="class"||n==="style"||Tx(n))&&((t||(t={}))[n]=e[n]);return t},RZ=(e,t)=>{const n={};for(const i in e)(!nC(i)||!(i.slice(9)in t))&&(n[i]=e[i]);return n};function kZ(e,t,n){const{props:i,children:c,component:h}=e,{props:m,children:a,patchFlag:y}=t,E=h.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&y>=0){if(y&1024)return!0;if(y&16)return i?zB(i,m,E):!!m;if(y&8){const C=t.dynamicProps;for(let P=0;P<C.length;P++){const L=C[P];if(qU(m,i,L)&&!yC(E,L))return!0}}}else return(c||a)&&(!a||!a.$stable)?!0:i===m?!1:i?m?zB(i,m,E):!0:!!m;return!1}function zB(e,t,n){const i=Object.keys(t);if(i.length!==Object.keys(e).length)return!0;for(let c=0;c<i.length;c++){const h=i[c];if(qU(t,e,h)&&!yC(n,h))return!0}return!1}function qU(e,t,n){const i=e[n],c=t[n];return n==="style"&&Li(i)&&Li(c)?!Ex(i,c):i!==c}function vC({vnode:e,parent:t,suspense:n},i){for(;t;){const c=t.subTree;if(c.suspense&&c.suspense.activeBranch===e&&(c.suspense.vnode.el=c.el=i,e=c),c===e)(e=t.vnode).el=i,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=i)}const XU={},ZU=()=>Object.create(XU),YU=e=>Object.getPrototypeOf(e)===XU;function MZ(e,t,n,i=!1){const c={},h=ZU();e.propsDefaults=Object.create(null),KU(e,t,c,h);for(const m in e.propsOptions[0])m in c||(c[m]=void 0);n?e.props=i?c:Zc(c):e.type.props?e.props=c:e.props=h,e.attrs=h}function LZ(e,t,n,i){const{props:c,attrs:h,vnode:{patchFlag:m}}=e,a=ci(c),[y]=e.propsOptions;let E=!1;if((i||m>0)&&!(m&16)){if(m&8){const C=e.vnode.dynamicProps;for(let P=0;P<C.length;P++){let L=C[P];if(yC(e.emitsOptions,L))continue;const D=t[L];if(y)if(zi(h,L))D!==h[L]&&(h[L]=D,E=!0);else{const V=_a(L);c[V]=WP(y,a,V,D,e,!1)}else D!==h[L]&&(h[L]=D,E=!0)}}}else{KU(e,t,c,h)&&(E=!0);let C;for(const P in a)(!t||!zi(t,P)&&((C=bh(P))===P||!zi(t,C)))&&(y?n&&(n[P]!==void 0||n[C]!==void 0)&&(c[P]=WP(y,a,P,void 0,e,!0)):delete c[P]);if(h!==a)for(const P in h)(!t||!zi(t,P))&&(delete h[P],E=!0)}E&&rh(e.attrs,"set","")}function KU(e,t,n,i){const[c,h]=e.propsOptions;let m=!1,a;if(t)for(let y in t){if(Em(y))continue;const E=t[y];let C;c&&zi(c,C=_a(y))?!h||!h.includes(C)?n[C]=E:(a||(a={}))[C]=E:yC(e.emitsOptions,y)||(!(y in i)||E!==i[y])&&(i[y]=E,m=!0)}if(h){const y=ci(n),E=a||Ei;for(let C=0;C<h.length;C++){const P=h[C];n[P]=WP(c,y,P,E[P],e,!zi(E,P))}}return m}function WP(e,t,n,i,c,h){const m=e[n];if(m!=null){const a=zi(m,"default");if(a&&i===void 0){const y=m.default;if(m.type!==Function&&!m.skipFactory&&Ir(y)){const{propsDefaults:E}=c;if(n in E)i=E[n];else{const C=kx(c);i=E[n]=y.call(null,t),C()}}else i=y;c.ce&&c.ce._setProp(n,i)}m[0]&&(h&&!a?i=!1:m[1]&&(i===""||i===bh(n))&&(i=!0))}return i}const OZ=new WeakMap;function JU(e,t,n=!1){const i=n?OZ:t.propsCache,c=i.get(e);if(c)return c;const h=e.props,m={},a=[];let y=!1;if(!Ir(e)){const C=P=>{y=!0;const[L,D]=JU(P,t,!0);ns(m,L),D&&a.push(...D)};!n&&t.mixins.length&&t.mixins.forEach(C),e.extends&&C(e.extends),e.mixins&&e.mixins.forEach(C)}if(!h&&!y)return Li(e)&&i.set(e,H_),H_;if(dr(h))for(let C=0;C<h.length;C++){const P=_a(h[C]);NB(P)&&(m[P]=Ei)}else if(h)for(const C in h){const P=_a(C);if(NB(P)){const L=h[C],D=m[P]=dr(L)||Ir(L)?{type:L}:ns({},L),V=D.type;let U=!1,W=!0;if(dr(V))for(let $=0;$<V.length;++$){const Y=V[$],X=Ir(Y)&&Y.name;if(X==="Boolean"){U=!0;break}else X==="String"&&(W=!1)}else U=Ir(V)&&V.name==="Boolean";D[0]=U,D[1]=W,(U||zi(D,"default"))&&a.push(P)}}const E=[m,a];return Li(e)&&i.set(e,E),E}function NB(e){return e[0]!=="$"&&!Em(e)}const fM=e=>e==="_"||e==="_ctx"||e==="$stable",pM=e=>dr(e)?e.map(Rl):[Rl(e)],DZ=(e,t,n)=>{if(t._n)return t;const i=hh((...c)=>pM(t(...c)),n);return i._c=!1,i},QU=(e,t,n)=>{const i=e._ctx;for(const c in e){if(fM(c))continue;const h=e[c];if(Ir(h))t[c]=DZ(c,h,i);else if(h!=null){const m=pM(h);t[c]=()=>m}}},e$=(e,t)=>{const n=pM(t);e.slots.default=()=>n},t$=(e,t,n)=>{for(const i in t)(n||!fM(i))&&(e[i]=t[i])},FZ=(e,t,n)=>{const i=e.slots=ZU();if(e.vnode.shapeFlag&32){const c=t._;c?(t$(i,t,n),n&&JV(i,"_",c,!0)):QU(t,i)}else t&&e$(e,t)},BZ=(e,t,n)=>{const{vnode:i,slots:c}=e;let h=!0,m=Ei;if(i.shapeFlag&32){const a=t._;a?n&&a===1?h=!1:t$(c,t,n):(h=!t.$stable,QU(t,c)),m=t}else t&&(e$(e,t),m={default:1});if(h)for(const a in c)!fM(a)&&m[a]==null&&delete c[a]},us=a$;function zZ(e){return n$(e)}function NZ(e){return n$(e,oZ)}function n$(e,t){const n=lC();n.__VUE__=!0;const{insert:i,remove:c,patchProp:h,createElement:m,createText:a,createComment:y,setText:E,setElementText:C,parentNode:P,nextSibling:L,setScopeId:D=td,insertStaticContent:V}=e,U=(Be,Xe,mt,kt=null,Vt=null,Ie=null,Ve=void 0,tt=null,Rt=!!Xe.dynamicChildren)=>{if(Be===Xe)return;Be&&!Yc(Be,Xe)&&(kt=$t(Be),xn(Be,Vt,Ie,!0),Be=null),Xe.patchFlag===-2&&(Rt=!1,Xe.dynamicChildren=null);const{type:Ut,ref:nn,shapeFlag:st}=Xe;switch(Ut){case Vf:W(Be,Xe,mt,kt);break;case hs:$(Be,Xe,mt,kt);break;case Pb:Be==null&&Y(Xe,mt,kt,Ve);break;case jo:pt(Be,Xe,mt,kt,Vt,Ie,Ve,tt,Rt);break;default:st&1?ne(Be,Xe,mt,kt,Vt,Ie,Ve,tt,Rt):st&6?Qt(Be,Xe,mt,kt,Vt,Ie,Ve,tt,Rt):(st&64||st&128)&&Ut.process(Be,Xe,mt,kt,Vt,Ie,Ve,tt,Rt,Cn)}nn!=null&&Vt?Z_(nn,Be&&Be.ref,Ie,Xe||Be,!Xe):nn==null&&Be&&Be.ref!=null&&Z_(Be.ref,null,Ie,Be,!0)},W=(Be,Xe,mt,kt)=>{if(Be==null)i(Xe.el=a(Xe.children),mt,kt);else{const Vt=Xe.el=Be.el;Xe.children!==Be.children&&E(Vt,Xe.children)}},$=(Be,Xe,mt,kt)=>{Be==null?i(Xe.el=y(Xe.children||""),mt,kt):Xe.el=Be.el},Y=(Be,Xe,mt,kt)=>{[Be.el,Be.anchor]=V(Be.children,Xe,mt,kt,Be.el,Be.anchor)},X=({el:Be,anchor:Xe},mt,kt)=>{let Vt;for(;Be&&Be!==Xe;)Vt=L(Be),i(Be,mt,kt),Be=Vt;i(Xe,mt,kt)},K=({el:Be,anchor:Xe})=>{let mt;for(;Be&&Be!==Xe;)mt=L(Be),c(Be),Be=mt;c(Xe)},ne=(Be,Xe,mt,kt,Vt,Ie,Ve,tt,Rt)=>{if(Xe.type==="svg"?Ve="svg":Xe.type==="math"&&(Ve="mathml"),Be==null)fe(Xe,mt,kt,Vt,Ie,Ve,tt,Rt);else{const Ut=Be.el&&Be.el._isVueCE?Be.el:null;try{Ut&&Ut._beginPatch(),Fe(Be,Xe,Vt,Ie,Ve,tt,Rt)}finally{Ut&&Ut._endPatch()}}},fe=(Be,Xe,mt,kt,Vt,Ie,Ve,tt)=>{let Rt,Ut;const{props:nn,shapeFlag:st,transition:Lt,dirs:mn}=Be;if(Rt=Be.el=m(Be.type,Ie,nn&&nn.is,nn),st&8?C(Rt,Be.children):st&16&&ke(Be.children,Rt,null,kt,Vt,EI(Be,Ie),Ve,tt),mn&&Zu(Be,null,kt,"created"),ye(Rt,Be,Be.scopeId,Ve,kt),nn){for(const ir in nn)ir!=="value"&&!Em(ir)&&h(Rt,ir,null,nn[ir],Ie,kt);"value"in nn&&h(Rt,"value",null,nn.value,Ie),(Ut=nn.onVnodeBeforeMount)&&ol(Ut,kt,Be)}mn&&Zu(Be,null,kt,"beforeMount");const Hn=r$(Vt,Lt);Hn&&Lt.beforeEnter(Rt),i(Rt,Xe,mt),((Ut=nn&&nn.onVnodeMounted)||Hn||mn)&&us(()=>{Ut&&ol(Ut,kt,Be),Hn&&Lt.enter(Rt),mn&&Zu(Be,null,kt,"mounted")},Vt)},ye=(Be,Xe,mt,kt,Vt)=>{if(mt&&D(Be,mt),kt)for(let Ie=0;Ie<kt.length;Ie++)D(Be,kt[Ie]);if(Vt){let Ie=Vt.subTree;if(Xe===Ie||fE(Ie.type)&&(Ie.ssContent===Xe||Ie.ssFallback===Xe)){const Ve=Vt.vnode;ye(Be,Ve,Ve.scopeId,Ve.slotScopeIds,Vt.parent)}}},ke=(Be,Xe,mt,kt,Vt,Ie,Ve,tt,Rt=0)=>{for(let Ut=Rt;Ut<Be.length;Ut++){const nn=Be[Ut]=tt?eh(Be[Ut]):Rl(Be[Ut]);U(null,nn,Xe,mt,kt,Vt,Ie,Ve,tt)}},Fe=(Be,Xe,mt,kt,Vt,Ie,Ve)=>{const tt=Xe.el=Be.el;let{patchFlag:Rt,dynamicChildren:Ut,dirs:nn}=Xe;Rt|=Be.patchFlag&16;const st=Be.props||Ei,Lt=Xe.props||Ei;let mn;if(mt&&lm(mt,!1),(mn=Lt.onVnodeBeforeUpdate)&&ol(mn,mt,Xe,Be),nn&&Zu(Xe,Be,mt,"beforeUpdate"),mt&&lm(mt,!0),(st.innerHTML&&Lt.innerHTML==null||st.textContent&&Lt.textContent==null)&&C(tt,""),Ut?qe(Be.dynamicChildren,Ut,tt,mt,kt,EI(Xe,Vt),Ie):Ve||Wt(Be,Xe,tt,null,mt,kt,EI(Xe,Vt),Ie,!1),Rt>0){if(Rt&16)lt(tt,st,Lt,mt,Vt);else if(Rt&2&&st.class!==Lt.class&&h(tt,"class",null,Lt.class,Vt),Rt&4&&h(tt,"style",st.style,Lt.style,Vt),Rt&8){const Hn=Xe.dynamicProps;for(let ir=0;ir<Hn.length;ir++){const hr=Hn[ir],Sr=st[hr],zn=Lt[hr];(zn!==Sr||hr==="value")&&h(tt,hr,Sr,zn,Vt,mt)}}Rt&1&&Be.children!==Xe.children&&C(tt,Xe.children)}else!Ve&&Ut==null&<(tt,st,Lt,mt,Vt);((mn=Lt.onVnodeUpdated)||nn)&&us(()=>{mn&&ol(mn,mt,Xe,Be),nn&&Zu(Xe,Be,mt,"updated")},kt)},qe=(Be,Xe,mt,kt,Vt,Ie,Ve)=>{for(let tt=0;tt<Xe.length;tt++){const Rt=Be[tt],Ut=Xe[tt],nn=Rt.el&&(Rt.type===jo||!Yc(Rt,Ut)||Rt.shapeFlag&198)?P(Rt.el):mt;U(Rt,Ut,nn,null,kt,Vt,Ie,Ve,!0)}},lt=(Be,Xe,mt,kt,Vt)=>{if(Xe!==mt){if(Xe!==Ei)for(const Ie in Xe)!Em(Ie)&&!(Ie in mt)&&h(Be,Ie,Xe[Ie],null,Vt,kt);for(const Ie in mt){if(Em(Ie))continue;const Ve=mt[Ie],tt=Xe[Ie];Ve!==tt&&Ie!=="value"&&h(Be,Ie,tt,Ve,Vt,kt)}"value"in mt&&h(Be,"value",Xe.value,mt.value,Vt)}},pt=(Be,Xe,mt,kt,Vt,Ie,Ve,tt,Rt)=>{const Ut=Xe.el=Be?Be.el:a(""),nn=Xe.anchor=Be?Be.anchor:a("");let{patchFlag:st,dynamicChildren:Lt,slotScopeIds:mn}=Xe;mn&&(tt=tt?tt.concat(mn):mn),Be==null?(i(Ut,mt,kt),i(nn,mt,kt),ke(Xe.children||[],mt,nn,Vt,Ie,Ve,tt,Rt)):st>0&&st&64&&Lt&&Be.dynamicChildren&&Be.dynamicChildren.length===Lt.length?(qe(Be.dynamicChildren,Lt,mt,Vt,Ie,Ve,tt),(Xe.key!=null||Vt&&Xe===Vt.subTree)&&mM(Be,Xe,!0)):Wt(Be,Xe,mt,nn,Vt,Ie,Ve,tt,Rt)},Qt=(Be,Xe,mt,kt,Vt,Ie,Ve,tt,Rt)=>{Xe.slotScopeIds=tt,Be==null?Xe.shapeFlag&512?Vt.ctx.activate(Xe,mt,kt,Ve,Rt):Ht(Xe,mt,kt,Vt,Ie,Ve,Rt):zt(Be,Xe,Rt)},Ht=(Be,Xe,mt,kt,Vt,Ie,Ve)=>{const tt=Be.component=KZ(Be,kt,Vt);if(Rx(Be)&&(tt.ctx.renderer=Cn),JZ(tt,!1,Ve),tt.asyncDep){if(Vt&&Vt.registerDep(tt,jt,Ve),!Be.el){const Rt=tt.subTree=Ai(hs);$(null,Rt,Xe,mt),Be.placeholder=Rt.el}}else jt(tt,Be,Xe,mt,Vt,Ie,Ve)},zt=(Be,Xe,mt)=>{const kt=Xe.component=Be.component;if(kZ(Be,Xe,mt))if(kt.asyncDep&&!kt.asyncResolved){Zt(kt,Xe,mt);return}else kt.next=Xe,kt.update();else Xe.el=Be.el,kt.vnode=Xe},jt=(Be,Xe,mt,kt,Vt,Ie,Ve)=>{const tt=()=>{if(Be.isMounted){let{next:st,bu:Lt,u:mn,parent:Hn,vnode:ir}=Be;{const Un=i$(Be);if(Un){st&&(st.el=ir.el,Zt(Be,st,Ve)),Un.asyncDep.then(()=>{us(()=>{Be.isUnmounted||Ut()},Vt)});return}}let hr=st,Sr;lm(Be,!1),st?(st.el=ir.el,Zt(Be,st,Ve)):st=ir,Lt&&q_(Lt),(Sr=st.props&&st.props.onVnodeBeforeUpdate)&&ol(Sr,Hn,st,ir),lm(Be,!0);const zn=TI(Be),cr=Be.subTree;Be.subTree=zn,U(cr,zn,P(cr.el),$t(cr),Be,Vt,Ie),st.el=zn.el,hr===null&&vC(Be,zn.el),mn&&us(mn,Vt),(Sr=st.props&&st.props.onVnodeUpdated)&&us(()=>ol(Sr,Hn,st,ir),Vt)}else{let st;const{el:Lt,props:mn}=Xe,{bm:Hn,m:ir,parent:hr,root:Sr,type:zn}=Be,cr=ph(Xe);if(lm(Be,!1),Hn&&q_(Hn),!cr&&(st=mn&&mn.onVnodeBeforeMount)&&ol(st,hr,Xe),lm(Be,!0),Lt&&Bn){const Un=()=>{Be.subTree=TI(Be),Bn(Lt,Be.subTree,Be,Vt,null)};cr&&zn.__asyncHydrate?zn.__asyncHydrate(Lt,Be,Un):Un()}else{Sr.ce&&Sr.ce._hasShadowRoot()&&Sr.ce._injectChildStyle(zn,Be.parent?Be.parent.type:void 0);const Un=Be.subTree=TI(Be);U(null,Un,mt,kt,Be,Vt,Ie),Xe.el=Un.el}if(ir&&us(ir,Vt),!cr&&(st=mn&&mn.onVnodeMounted)){const Un=Xe;us(()=>ol(st,hr,Un),Vt)}(Xe.shapeFlag&256||hr&&ph(hr.vnode)&&hr.vnode.shapeFlag&256)&&Be.a&&us(Be.a,Vt),Be.isMounted=!0,Xe=mt=kt=null}};Be.scope.on();const Rt=Be.effect=new iU(tt);Be.scope.off();const Ut=Be.update=Rt.run.bind(Rt),nn=Be.job=Rt.runIfDirty.bind(Rt);nn.i=Be,nn.id=Be.uid,Rt.scheduler=()=>iM(nn),lm(Be,!0),Ut()},Zt=(Be,Xe,mt)=>{Xe.component=Be;const kt=Be.vnode.props;Be.vnode=Xe,Be.next=null,LZ(Be,Xe.props,kt,mt),BZ(Be,Xe.children,mt),gh(),EB(Be),_h()},Wt=(Be,Xe,mt,kt,Vt,Ie,Ve,tt,Rt=!1)=>{const Ut=Be&&Be.children,nn=Be?Be.shapeFlag:0,st=Xe.children,{patchFlag:Lt,shapeFlag:mn}=Xe;if(Lt>0){if(Lt&128){sn(Ut,st,mt,kt,Vt,Ie,Ve,tt,Rt);return}else if(Lt&256){en(Ut,st,mt,kt,Vt,Ie,Ve,tt,Rt);return}}mn&8?(nn&16&&Rn(Ut,Vt,Ie),st!==Ut&&C(mt,st)):nn&16?mn&16?sn(Ut,st,mt,kt,Vt,Ie,Ve,tt,Rt):Rn(Ut,Vt,Ie,!0):(nn&8&&C(mt,""),mn&16&&ke(st,mt,kt,Vt,Ie,Ve,tt,Rt))},en=(Be,Xe,mt,kt,Vt,Ie,Ve,tt,Rt)=>{Be=Be||H_,Xe=Xe||H_;const Ut=Be.length,nn=Xe.length,st=Math.min(Ut,nn);let Lt;for(Lt=0;Lt<st;Lt++){const mn=Xe[Lt]=Rt?eh(Xe[Lt]):Rl(Xe[Lt]);U(Be[Lt],mn,mt,null,Vt,Ie,Ve,tt,Rt)}Ut>nn?Rn(Be,Vt,Ie,!0,!1,st):ke(Xe,mt,kt,Vt,Ie,Ve,tt,Rt,st)},sn=(Be,Xe,mt,kt,Vt,Ie,Ve,tt,Rt)=>{let Ut=0;const nn=Xe.length;let st=Be.length-1,Lt=nn-1;for(;Ut<=st&&Ut<=Lt;){const mn=Be[Ut],Hn=Xe[Ut]=Rt?eh(Xe[Ut]):Rl(Xe[Ut]);if(Yc(mn,Hn))U(mn,Hn,mt,null,Vt,Ie,Ve,tt,Rt);else break;Ut++}for(;Ut<=st&&Ut<=Lt;){const mn=Be[st],Hn=Xe[Lt]=Rt?eh(Xe[Lt]):Rl(Xe[Lt]);if(Yc(mn,Hn))U(mn,Hn,mt,null,Vt,Ie,Ve,tt,Rt);else break;st--,Lt--}if(Ut>st){if(Ut<=Lt){const mn=Lt+1,Hn=mn<nn?Xe[mn].el:kt;for(;Ut<=Lt;)U(null,Xe[Ut]=Rt?eh(Xe[Ut]):Rl(Xe[Ut]),mt,Hn,Vt,Ie,Ve,tt,Rt),Ut++}}else if(Ut>Lt)for(;Ut<=st;)xn(Be[Ut],Vt,Ie,!0),Ut++;else{const mn=Ut,Hn=Ut,ir=new Map;for(Ut=Hn;Ut<=Lt;Ut++){const Lr=Xe[Ut]=Rt?eh(Xe[Ut]):Rl(Xe[Ut]);Lr.key!=null&&ir.set(Lr.key,Ut)}let hr,Sr=0;const zn=Lt-Hn+1;let cr=!1,Un=0;const Ur=new Array(zn);for(Ut=0;Ut<zn;Ut++)Ur[Ut]=0;for(Ut=mn;Ut<=st;Ut++){const Lr=Be[Ut];if(Sr>=zn){xn(Lr,Vt,Ie,!0);continue}let ar;if(Lr.key!=null)ar=ir.get(Lr.key);else for(hr=Hn;hr<=Lt;hr++)if(Ur[hr-Hn]===0&&Yc(Lr,Xe[hr])){ar=hr;break}ar===void 0?xn(Lr,Vt,Ie,!0):(Ur[ar-Hn]=Ut+1,ar>=Un?Un=ar:cr=!0,U(Lr,Xe[ar],mt,null,Vt,Ie,Ve,tt,Rt),Sr++)}const ko=cr?VZ(Ur):H_;for(hr=ko.length-1,Ut=zn-1;Ut>=0;Ut--){const Lr=Hn+Ut,ar=Xe[Lr],nr=Xe[Lr+1],ro=Lr+1<nn?nr.el||o$(nr):kt;Ur[Ut]===0?U(null,ar,mt,ro,Vt,Ie,Ve,tt,Rt):cr&&(hr<0||Ut!==ko[hr]?Mn(ar,mt,ro,2):hr--)}}},Mn=(Be,Xe,mt,kt,Vt=null)=>{const{el:Ie,type:Ve,transition:tt,children:Rt,shapeFlag:Ut}=Be;if(Ut&6){Mn(Be.component.subTree,Xe,mt,kt);return}if(Ut&128){Be.suspense.move(Xe,mt,kt);return}if(Ut&64){Ve.move(Be,Xe,mt,Cn);return}if(Ve===jo){i(Ie,Xe,mt);for(let st=0;st<Rt.length;st++)Mn(Rt[st],Xe,mt,kt);i(Be.anchor,Xe,mt);return}if(Ve===Pb){X(Be,Xe,mt);return}if(kt!==2&&Ut&1&&tt)if(kt===0)tt.persisted&&!Ie[fc]?i(Ie,Xe,mt):(tt.beforeEnter(Ie),i(Ie,Xe,mt),us(()=>tt.enter(Ie),Vt));else{const{leave:st,delayLeave:Lt,afterLeave:mn}=tt,Hn=()=>{Be.ctx.isUnmounted?c(Ie):i(Ie,Xe,mt)},ir=()=>{const hr=Ie._isLeaving||!!Ie[fc];Ie._isLeaving&&Ie[fc](!0),tt.persisted&&!hr?Hn():st(Ie,()=>{Hn(),mn&&mn()})};Lt?Lt(Ie,Hn,ir):ir()}else i(Ie,Xe,mt)},xn=(Be,Xe,mt,kt=!1,Vt=!1)=>{const{type:Ie,props:Ve,ref:tt,children:Rt,dynamicChildren:Ut,shapeFlag:nn,patchFlag:st,dirs:Lt,cacheIndex:mn,memo:Hn}=Be;if(st===-2&&(Vt=!1),tt!=null&&(gh(),Z_(tt,null,mt,Be,!0),_h()),mn!=null&&(Xe.renderCache[mn]=void 0),nn&256){Xe.ctx.deactivate(Be);return}const ir=nn&1&&Lt,hr=!ph(Be);let Sr;if(hr&&(Sr=Ve&&Ve.onVnodeBeforeUnmount)&&ol(Sr,Xe,Be),nn&6)Yn(Be.component,mt,kt);else{if(nn&128){Be.suspense.unmount(mt,kt);return}ir&&Zu(Be,null,Xe,"beforeUnmount"),nn&64?Be.type.remove(Be,Xe,mt,Cn,kt):Ut&&!Ut.hasOnce&&(Ie!==jo||st>0&&st&64)?Rn(Ut,Xe,mt,!1,!0):(Ie===jo&&st&384||!Vt&&nn&16)&&Rn(Rt,Xe,mt),kt&&Vn(Be)}const zn=Hn!=null&&mn==null;(hr&&(Sr=Ve&&Ve.onVnodeUnmounted)||ir||zn)&&us(()=>{Sr&&ol(Sr,Xe,Be),ir&&Zu(Be,null,Xe,"unmounted"),zn&&(Be.el=null)},mt)},Vn=Be=>{const{type:Xe,el:mt,anchor:kt,transition:Vt}=Be;if(Xe===jo){Ln(mt,kt);return}if(Xe===Pb){K(Be);return}const Ie=()=>{c(mt),Vt&&!Vt.persisted&&Vt.afterLeave&&Vt.afterLeave()};if(Be.shapeFlag&1&&Vt&&!Vt.persisted){const{leave:Ve,delayLeave:tt}=Vt,Rt=()=>Ve(mt,Ie);tt?tt(Be.el,Ie,Rt):Rt()}else Ie()},Ln=(Be,Xe)=>{let mt;for(;Be!==Xe;)mt=L(Be),c(Be),Be=mt;c(Xe)},Yn=(Be,Xe,mt)=>{const{bum:kt,scope:Vt,job:Ie,subTree:Ve,um:tt,m:Rt,a:Ut}=Be;hE(Rt),hE(Ut),kt&&q_(kt),Vt.stop(),Ie&&(Ie.flags|=8,xn(Ve,Be,Xe,mt)),tt&&us(tt,Xe),us(()=>{Be.isUnmounted=!0},Xe)},Rn=(Be,Xe,mt,kt=!1,Vt=!1,Ie=0)=>{for(let Ve=Ie;Ve<Be.length;Ve++)xn(Be[Ve],Xe,mt,kt,Vt)},$t=Be=>{if(Be.shapeFlag&6)return $t(Be.component.subTree);if(Be.shapeFlag&128)return Be.suspense.next();const Xe=L(Be.anchor||Be.el),mt=Xe&&Xe[PU];return mt?L(mt):Xe};let fn=!1;const yn=(Be,Xe,mt)=>{let kt;Be==null?Xe._vnode&&(xn(Xe._vnode,null,null,!0),kt=Xe._vnode.component):U(Xe._vnode||null,Be,Xe,null,null,null,mt),Xe._vnode=Be,fn||(fn=!0,EB(kt),sE(),fn=!1)},Cn={p:U,um:xn,m:Mn,r:Vn,mt:Ht,mc:ke,pc:Wt,pbc:qe,n:$t,o:e};let _n,Bn;return t&&([_n,Bn]=t(Cn)),{render:yn,hydrate:_n,createApp:EZ(yn,_n)}}function EI({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function lm({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function r$(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function mM(e,t,n=!1){const i=e.children,c=t.children;if(dr(i)&&dr(c))for(let h=0;h<i.length;h++){const m=i[h];let a=c[h];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=c[h]=eh(c[h]),a.el=m.el),!n&&a.patchFlag!==-2&&mM(m,a)),a.type===Vf&&(
4a.patchFlag===-1&&(a=c[h]=eh(a)),a.el=m.el),a.type===hs&&!a.el&&(a.el=m.el)}}function VZ(e){const t=e.slice(),n=[0];let i,c,h,m,a;const y=e.length;for(i=0;i<y;i++){const E=e[i];if(E!==0){if(c=n[n.length-1],e[c]<E){t[i]=c,n.push(i);continue}for(h=0,m=n.length-1;h<m;)a=h+m>>1,e[n[a]]<E?h=a+1:m=a;E<e[n[h]]&&(h>0&&(t[i]=n[h-1]),n[h]=i)}}for(h=n.length,m=n[h-1];h-- >0;)n[h]=m,m=t[m];return n}function i$(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:i$(t)}function hE(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function o$(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?o$(t.subTree):null}const fE=e=>e.__isSuspense;let qP=0;const UZ={name:"Suspense",__isSuspense:!0,process(e,t,n,i,c,h,m,a,y,E){if(e==null)$Z(t,n,i,c,h,m,a,y,E);else{if(h&&h.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}jZ(e,t,n,i,c,m,a,y,E)}},hydrate:GZ,normalize:HZ},gM=UZ;function Yb(e,t){const n=e.props&&e.props[t];Ir(n)&&n()}function $Z(e,t,n,i,c,h,m,a,y){const{p:E,o:{createElement:C}}=y,P=C("div"),L=e.suspense=s$(e,c,i,t,P,n,h,m,a,y);E(null,L.pendingBranch=e.ssContent,P,null,i,L,h,m),L.deps>0?(Yb(e,"onPending"),Yb(e,"onFallback"),E(null,e.ssFallback,t,n,i,null,h,m),Y_(L,e.ssFallback)):L.resolve(!1,!0)}function jZ(e,t,n,i,c,h,m,a,{p:y,um:E,o:{createElement:C}}){const P=t.suspense=e.suspense;P.vnode=t,t.el=e.el;const L=t.ssContent,D=t.ssFallback,{activeBranch:V,pendingBranch:U,isInFallback:W,isHydrating:$}=P;if(U)P.pendingBranch=L,Yc(U,L)?(y(U,L,P.hiddenContainer,null,c,P,h,m,a),P.deps<=0?P.resolve():W&&($||(y(V,D,n,i,c,null,h,m,a),Y_(P,D)))):(P.pendingId=qP++,$?(P.isHydrating=!1,P.activeBranch=U):E(U,c,P),P.deps=0,P.effects.length=0,P.hiddenContainer=C("div"),W?(y(null,L,P.hiddenContainer,null,c,P,h,m,a),P.deps<=0?P.resolve():(y(V,D,n,i,c,null,h,m,a),Y_(P,D))):V&&Yc(V,L)?(y(V,L,n,i,c,P,h,m,a),P.resolve(!0)):(y(null,L,P.hiddenContainer,null,c,P,h,m,a),P.deps<=0&&P.resolve()));else if(V&&Yc(V,L))y(V,L,n,i,c,P,h,m,a),Y_(P,L);else if(Yb(t,"onPending"),P.pendingBranch=L,L.shapeFlag&512?P.pendingId=L.component.suspenseId:P.pendingId=qP++,y(null,L,P.hiddenContainer,null,c,P,h,m,a),P.deps<=0)P.resolve();else{const{timeout:Y,pendingId:X}=P;Y>0?setTimeout(()=>{P.pendingId===X&&P.fallback(D)},Y):Y===0&&P.fallback(D)}}function s$(e,t,n,i,c,h,m,a,y,E,C=!1){const{p:P,m:L,um:D,n:V,o:{parentNode:U,remove:W}}=E;let $;const Y=WZ(e);Y&&t&&t.pendingBranch&&($=t.pendingId,t.deps++);const X=e.props?QV(e.props.timeout):void 0,K=h,ne={vnode:e,parent:t,parentComponent:n,namespace:m,container:i,hiddenContainer:c,deps:0,pendingId:qP++,timeout:typeof X=="number"?X:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!C,isHydrating:C,isUnmounted:!1,effects:[],resolve(fe=!1,ye=!1){const{vnode:ke,activeBranch:Fe,pendingBranch:qe,pendingId:lt,effects:pt,parentComponent:Qt,container:Ht,isInFallback:zt}=ne;let jt=!1;if(ne.isHydrating)ne.isHydrating=!1;else if(!fe){jt=Fe&&qe.transition&&qe.transition.mode==="out-in";let en=!1;jt&&(Fe.transition.afterLeave=()=>{lt===ne.pendingId&&(L(qe,Ht,h===K&&!en?V(Fe):h,0),qb(pt),zt&&ke.ssFallback&&(ke.ssFallback.el=null))}),Fe&&!ne.isFallbackMountPending&&(U(Fe.el)===Ht&&(h=V(Fe),en=!0),D(Fe,Qt,ne,!0),!jt&&zt&&ke.ssFallback&&us(()=>ke.ssFallback.el=null,ne)),jt||L(qe,Ht,h,0)}ne.isFallbackMountPending=!1,Y_(ne,qe),ne.pendingBranch=null,ne.isInFallback=!1;let Zt=ne.parent,Wt=!1;for(;Zt;){if(Zt.pendingBranch){Zt.effects.push(...pt),Wt=!0;break}Zt=Zt.parent}!Wt&&!jt&&qb(pt),ne.effects=[],Y&&t&&t.pendingBranch&&$===t.pendingId&&(t.deps--,t.deps===0&&!ye&&t.resolve()),Yb(ke,"onResolve")},fallback(fe){if(!ne.pendingBranch)return;const{vnode:ye,activeBranch:ke,parentComponent:Fe,container:qe,namespace:lt}=ne;Yb(ye,"onFallback");const pt=V(ke),Qt=()=>{ne.isFallbackMountPending=!1,ne.isInFallback&&(P(null,fe,qe,pt,Fe,null,lt,a,y),Y_(ne,fe))},Ht=fe.transition&&fe.transition.mode==="out-in";Ht&&(ne.isFallbackMountPending=!0,ke.transition.afterLeave=Qt),ne.isInFallback=!0,D(ke,Fe,null,!0),Ht||Qt()},move(fe,ye,ke){ne.activeBranch&&L(ne.activeBranch,fe,ye,ke),ne.container=fe},next(){return ne.activeBranch&&V(ne.activeBranch)},registerDep(fe,ye,ke){const Fe=!!ne.pendingBranch;Fe&&ne.deps++;const qe=fe.vnode.el;
vendor: 12,898 bytes, line 4
4fe.asyncDep.catch(lt=>{Sy(lt,fe,0)}).then(lt=>{if(fe.isUnmounted||ne.isUnmounted||ne.pendingId!==fe.suspenseId)return;ZP(),fe.asyncResolved=!0;const{vnode:pt}=fe;YP(fe,lt),qe&&(pt.el=qe);const Qt=!qe&&fe.subTree.el;ye(fe,pt,U(qe||fe.subTree.el),qe?null:V(fe.subTree),ne,m,ke),Qt&&(pt.placeholder=null,W(Qt)),vC(fe,pt.el),Fe&&--ne.deps===0&&ne.resolve()})},unmount(fe,ye){ne.isUnmounted=!0,ne.activeBranch&&D(ne.activeBranch,n,fe,ye),ne.pendingBranch&&D(ne.pendingBranch,n,fe,ye)}};return ne}function GZ(e,t,n,i,c,h,m,a,y){const E=t.suspense=s$(t,i,n,e.parentNode,document.createElement("div"),null,c,h,m,a,!0),C=y(e,E.pendingBranch=t.ssContent,n,E,h,m);return E.deps===0&&E.resolve(!1,!0),C}function HZ(e){const{shapeFlag:t,children:n}=e,i=t&32;e.ssContent=VB(i?n.default:n),e.ssFallback=i?VB(n.fallback):Ai(hs)}function VB(e){let t;if(Ir(e)){const n=iy&&e._c;n&&(e._d=!1,ei()),e=e(),n&&(e._d=!0,t=ll,l$())}return dr(e)&&(e=IZ(e)),e=Rl(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function a$(e,t){t&&t.pendingBranch?dr(e)?t.effects.push(...e):t.effects.push(e):qb(e)}function Y_(e,t){e.activeBranch=t;const{vnode:n,parentComponent:i}=e;let c=t.el;for(;!c&&t.component;)t=t.component.subTree,c=t.el;n.el=c,i&&i.subTree===n&&(i.vnode.el=c,vC(i,c))}function WZ(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const jo=Symbol.for("v-fgt"),Vf=Symbol.for("v-txt"),hs=Symbol.for("v-cmt"),Pb=Symbol.for("v-stc"),Rb=[];let ll=null;function ei(e=!1){Rb.push(ll=e?null:[])}function l$(){Rb.pop(),ll=Rb[Rb.length-1]||null}let iy=1;function pE(e,t=!1){iy+=e,e<0&&ll&&t&&(ll.hasOnce=!0)}function c$(e){return e.dynamicChildren=iy>0?ll||H_:null,l$(),iy>0&&ll&&ll.push(e),e}function ds(e,t,n,i,c,h){return c$(Go(e,t,n,i,c,h,!0))}function Ss(e,t,n,i,c){return c$(Ai(e,t,n,i,c,!0))}function Fm(e){return e?e.__v_isVNode===!0:!1}function Yc(e,t){return e.type===t.type&&e.key===t.key}const u$=({key:e})=>e??null,VT=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?eo(e)||qi(e)||Ir(e)?{i:Ws,r:e,k:t,f:!!n}:e:null);function Go(e,t=null,n=null,i=0,c=null,h=e===jo?0:1,m=!1,a=!1){const y={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&u$(t),ref:t&&VT(t),scopeId:CU,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:h,patchFlag:i,dynamicProps:c,dynamicChildren:null,appContext:null,ctx:Ws};return a?(_M(y,n),h&128&&e.normalize(y)):n&&(y.shapeFlag|=eo(n)?8:16),iy>0&&!m&&ll&&(y.patchFlag>0||h&6)&&y.patchFlag!==32&&ll.push(y),y}const Ai=qZ;function qZ(e,t=null,n=null,i=0,c=null,h=!1){if((!e||e===NU)&&(e=hs),Fm(e)){const a=od(e,t,!0);return n&&_M(a,n),iy>0&&!h&&ll&&(a.shapeFlag&6?ll[ll.indexOf(e)]=a:ll.push(a)),a.patchFlag=-2,a}if(tY(e)&&(e=e.__vccOpts),t){t=XZ(t);let{class:a,style:y}=t;a&&!eo(a)&&(t.class=uC(a)),Li(y)&&(mC(y)&&!dr(y)&&(y=ns({},y)),t.style=cC(y))}const m=eo(e)?1:fE(e)?128:RU(e)?64:Li(e)?4:Ir(e)?2:0;return Go(e,t,n,i,c,m,h,!0)}function XZ(e){return e?mC(e)||YU(e)?ns({},e):e:null}function od(e,t,n=!1,i=!1){const{props:c,ref:h,patchFlag:m,children:a,transition:y}=e,E=t?zo(c||{},t):c,C={__v_isVNode:!0,__v_skip:!0,type:e.type,props:E,key:E&&u$(E),ref:t&&t.ref?n&&h?dr(h)?h.concat(VT(t)):[h,VT(t)]:VT(t):h,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==jo?m===-1?16:m|16:m,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:y,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&od(e.ssContent),ssFallback:e.ssFallback&&od(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return y&&i&&Xf(C,y.clone(C)),C}function d$(e=" ",t=0){return Ai(Vf,null,e,t)}function zLe(e,t){const n=Ai(Pb,null,e);return n.staticCount=t,n}function Zf(e="",t=!1){return t?(ei(),Ss(hs,null,e)):Ai(hs,null,e)}function Rl(e){return e==null||typeof e=="boolean"?Ai(hs):dr(e)?Ai(jo,null,e.slice()):Fm(e)?eh(e):Ai(Vf,null,String(e))}function eh(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:od(e)}function _M(e,t){let n=0;const{shapeFlag:i}=e;if(t==null)t=null;else if(dr(t))n=16;else if(typeof t=="object")if(i&65){const c=t.default;c&&(c._c&&(c._d=!1),_M(e,c()),c._c&&(c._d=!0));return}else{n=32;const c=t._;!c&&!YU(t)?t._ctx=Ws:c===3&&Ws&&(Ws.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Ir(t)?(t={default:t,_ctx:Ws},n=32):(t=String(t),i&64?(n=16,t=[d$(t)]):n=8);e.children=t,e.shapeFlag|=n}function zo(...e){const t={};for(let n=0;n<e.length;n++){const i=e[n];for(const c in i)if(c==="class")t.class!==i.class&&(t.class=uC([t.class,i.class]));else if(c==="style")t.style=cC([t.style,i.style]);else if(Tx(c)){const h=t[c],m=i[c];m&&h!==m&&!(dr(h)&&h.includes(m))?t[c]=h?[].concat(h,m):m:m==null&&h==null&&!nC(c)&&(t[c]=m)}else c!==""&&(t[c]=i[c])}return t}function ol(e,t,n,i=null){yc(e,t,7,[n,i])}const ZZ=GU();let YZ=0;function KZ(e,t,n){const i=e.type,c=(t?t.appContext:e.appContext)||ZZ,h={uid:YZ++,vnode:e,type:i,parent:t,appContext:c,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new rU(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(c.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:JU(i,c),emitsOptions:WU(i,c),emit:null,emitted:null,propsDefaults:Ei,inheritAttrs:i.inheritAttrs,ctx:Ei,data:Ei,props:Ei,attrs:Ei,slots:Ei,refs:Ei,setupState:Ei,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return h.ctx={_:h},h.root=t?t.root:h,h.emit=CZ.bind(null,h),e.ce&&e.ce(h),h}let Gs=null;const Ds=()=>Gs||Ws;let mE,XP;{const e=lC(),t=(n,i)=>{let c;return(c=e[n])||(c=e[n]=[]),c.push(i),h=>{c.length>1?c.forEach(m=>m(h)):c[0](h)}};mE=t("__VUE_INSTANCE_SETTERS__",n=>Gs=n),XP=t("__VUE_SSR_SETTERS__",n=>oy=n)}const kx=e=>{const t=Gs;return mE(e),e.scope.on(),()=>{e.scope.off(),mE(t)}},ZP=()=>{Gs&&Gs.scope.off(),mE(null)};function h$(e){return e.vnode.shapeFlag&4}let oy=!1;function JZ(e,t=!1,n=!1){t&&XP(t);const{props:i,children:c}=e.vnode,h=h$(e);MZ(e,i,h,t),FZ(e,c,n||t);const m=h?QZ(e,t):void 0;return t&&XP(!1),m}function QZ(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,yZ);const{setup:i}=n;if(i){gh();const c=e.setupContext=i.length>1?p$(e):null,h=kx(e),m=Px(i,e,0,[e.props,c]),a=YV(m);if(_h(),h(),(a||e.sp)&&!ph(e)&&sM(e),a){if(m.then(ZP,ZP),t)return m.then(y=>{YP(e,y)}).catch(y=>{Sy(y,e,0)});e.asyncDep=m}else YP(e,m)}else f$(e)}function YP(e,t,n){Ir(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Li(t)&&(e.setupState=xU(t)),f$(e)}function f$(e,t,n){const i=e.type;e.render||(e.render=i.render||td);{const c=kx(e);gh();try{vZ(e)}finally{_h(),c()}}}const eY={get(e,t){return ma(e,"get",""),e[t]}};function p$(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,eY),slots:e.slots,emit:e.emit,expose:t}}function bC(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(xU(Ax(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Ib)return Ib[n](e)},has(t,n){return n in t||n in Ib}})):e.proxy}function KP(e,t=!0){return Ir(e)?e.displayName||e.name:e.name||t&&e.__name}function tY(e){return Ir(e)&&"__vccOpts"in e}const vn=(e,t)=>UX(e,t,oy);function Io(e,t,n){try{pE(-1);const i=arguments.length;return i===2?Li(t)&&!dr(t)?Fm(t)?Ai(e,null,[t]):Ai(e,t):Ai(e,null,t):(i>3?n=Array.prototype.slice.call(arguments,2):i===3&&Fm(n)&&(n=[n]),Ai(e,t,n))}finally{pE(1)}}const nY="3.5.38";let JP;const UB=typeof window<"u"&&window.trustedTypes;if(UB)try{JP=UB.createPolicy("vue",{createHTML:e=>e})}catch{}const m$=JP?e=>JP.createHTML(e):e=>e,rY="http://www.w3.org/2000/svg",iY="http://www.w3.org/1998/Math/MathML",Qd=typeof document<"u"?document:null,$B=Qd&&Qd.createElement("template"),oY={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,i)=>{const c=t==="svg"?Qd.createElementNS(rY,e):t==="mathml"?Qd.createElementNS(iY,e):n?Qd.createElement(e,{is:n}):Qd.createElement(e);return e==="select"&&i&&i.multiple!=null&&c.setAttribute("multiple",i.multiple),c},createText:e=>Qd.createTextNode(e),createComment:e=>Qd.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Qd.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,i,c,h){const m=n?n.previousSibling:t.lastChild;if(c&&(c===h||c.nextSibling))for(;t.insertBefore(c.cloneNode(!0),n),!(c===h||!(c=c.nextSibling)););else{$B.innerHTML=m$(i==="svg"?`<svg>${e}</svg>`:i==="mathml"?`<math>${e}</math>`:e);const a=$B.content;if(i==="svg"||i==="mathml"){const y=a.firstChild;for(;y.firstChild;)a.appendChild(y.firstChild);a.removeChild(y)}t.insertBefore(a,n)}return[m?m.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},xf="transition",Kv="animation",sy=Symbol("_vtc"),g$={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},_$=ns({},LU,g$),sY=e=>(e.displayName="Transition",e.props=_$,e),aY=sY((e,{slots:t})=>Io(tZ,y$(e),t)),cm=(e,t=[])=>{dr(e)?e.forEach(n=>n(...t)):e&&e(...t)},jB=e=>e?dr(e)?e.some(t=>t.length>1):e.length>1:!1;function y$(e){const t={};for(const pt in e)pt in g$||(t[pt]=e[pt]);if(e.css===!1)return t;const{name:n="v",type:i,duration:c,enterFromClass:h=`${n}-enter-from`,enterActiveClass:m=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:y=h,appearActiveClass:E=m,appearToClass:C=a,leaveFromClass:P=`${n}-leave-from`,leaveActiveClass:L=`${n}-leave-active`,leaveToClass:D=`${n}-leave-to`}=e,V=lY(c),U=V&&V[0],W=V&&V[1],{onBeforeEnter:$,onEnter:Y,onEnterCancelled:X,onLeave:K,onLeaveCancelled:ne,onBeforeAppear:fe=$,onAppear:ye=Y,onAppearCancelled:ke=X}=t,Fe=(pt,Qt,Ht,zt)=>{pt._enterCancelled=zt,Cf(pt,Qt?C:a),Cf(pt,Qt?E:m),Ht&&Ht()},qe=(pt,Qt)=>{pt._isLeaving=!1,Cf(pt,P),Cf(pt,D),Cf(pt,L),Qt&&Qt()},lt=pt=>(Qt,Ht)=>{const zt=pt?ye:Y,jt=()=>Fe(Qt,pt,Ht);cm(zt,[Qt,jt]),GB(()=>{Cf(Qt,pt?y:h),Hu(Qt,pt?C:a),jB(zt)||HB(Qt,i,U,jt)})};return ns(t,{onBeforeEnter(pt){cm($,[pt]),Hu(pt,h),Hu(pt,m)},onBeforeAppear(pt){cm(fe,[pt]),Hu(pt,y),Hu(pt,E)},onEnter:lt(!1),onAppear:lt(!0),onLeave(pt,Qt){pt._isLeaving=!0;const Ht=()=>qe(pt,Qt);Hu(pt,P),pt._enterCancelled?(Hu(pt,L),QP(pt)):(QP(pt),Hu(pt,L)),GB(()=>{pt._isLeaving&&(Cf(pt,P),Hu(pt,D),jB(K)||HB(pt,i,W,Ht))}),cm(K,[pt,Ht])},onEnterCancelled(pt){Fe(pt,!1,void 0,!0),cm(X,[pt])},onAppearCancelled(pt){Fe(pt,!0,void 0,!0),cm(ke,[pt])},onLeaveCancelled(pt){qe(pt),cm(ne,[pt])}})}function lY(e){if(e==null)return null;if(Li(e))return[CI(e.enter),CI(e.leave)];{const t=CI(e);return[t,t]}}function CI(e){return QV(e)}function Hu(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[sy]||(e[sy]=new Set)).add(t)}function Cf(e,t){t.split(/\s+/).forEach(i=>i&&e.classList.remove(i));const n=e[sy];n&&(n.delete(t),n.size||(e[sy]=void 0))}function GB(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let cY=0;function HB(e,t,n,i){const c=e._endId=++cY,h=()=>{c===e._endId&&i()};if(n!=null)return setTimeout(h,n);const{type:m,timeout:a,propCount:y}=v$(e,t);if(!m)return i();const E=m+"end";let C=0;const P=()=>{e.removeEventListener(E,L),h()},L=D=>{D.target===e&&++C>=y&&P()};setTimeout(()=>{C<y&&P()},a+1),e.addEventListener(E,L)}function v$(e,t){const n=window.getComputedStyle(e),i=V=>(n[V]||"").split(", "),c=i(`${xf}Delay`),h=i(`${xf}Duration`),m=WB(c,h),a=i(`${Kv}Delay`),y=i(`${Kv}Duration`),E=WB(a,y);let C=null,P=0,L=0;t===xf?m>0&&(C=xf,P=m,L=h.length):t===Kv?E>0&&(C=Kv,P=E,L=y.length):(P=Math.max(m,E),C=P>0?m>E?xf:Kv:null,L=C?C===xf?h.length:y.length:0);const D=C===xf&&/\b(?:transform|all)(?:,|$)/.test(i(`${xf}Property`).toString());return{type:C,timeout:P,propCount:L,hasTransform:D}}function WB(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,i)=>qB(n)+qB(e[i])))}function qB(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function QP(e){return(e?e.ownerDocument:document).body.offsetHeight}function uY(e,t,n){const i=e[sy];i&&(t=(t?[t,...i]:[...i]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const gE=Symbol("_vod"),yM=Symbol("_vsh"),NLe={name:"show",beforeMount(e,{value:t},{transition:n}){e[gE]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Jv(e,t)}
4,mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:i}){!t!=!n&&(i?t?(i.beforeEnter(e),Jv(e,!0),i.enter(e)):i.leave(e,()=>{Jv(e,!1)}):Jv(e,t))},beforeUnmount(e,{value:t}){Jv(e,t)}};function Jv(e,t){e.style.display=t?e[gE]:"none",e[yM]=!t}const dY=Symbol(""),hY=/(?:^|;)\s*display\s*:/;function fY(e,t,n){const i=e.style,c=eo(n);let h=!1;if(n&&!c){if(t)if(eo(t))for(const m of t.split(";")){const a=m.slice(0,m.indexOf(":")).trim();n[a]==null&&mb(i,a,"")}else for(const m in t)n[m]==null&&mb(i,m,"");for(const m in n){m==="display"&&(h=!0);const a=n[m];a!=null?mY(e,m,!eo(t)&&t?t[m]:void 0,a)||mb(i,m,a):mb(i,m,"")}}else if(c){if(t!==n){const m=i[dY];m&&(n+=";"+m),i.cssText=n,h=hY.test(n)}}else t&&e.removeAttribute("style");gE in e&&(e[gE]=h?i.display:"",e[yM]&&(i.display="none"))}const XB=/\s*!important$/;function mb(e,t,n){if(dr(n))n.forEach(i=>mb(e,t,i));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const i=pY(e,t);XB.test(n)?e.setProperty(bh(i),n.replace(XB,""),"important"):e[i]=n}}const ZB=["Webkit","Moz","ms"],AI={};function pY(e,t){const n=AI[t];if(n)return n;let i=_a(t);if(i!=="filter"&&i in e)return AI[t]=i;i=sC(i);for(let c=0;c<ZB.length;c++){const h=ZB[c]+i;if(h in e)return AI[t]=h}return t}function mY(e,t,n,i){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&eo(i)&&n===i}const YB="http://www.w3.org/1999/xlink";function KB(e,t,n,i,c,h=fX(t)){i&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(YB,t.slice(6,t.length)):e.setAttributeNS(YB,t,n):n==null||h&&!eU(n)?e.removeAttribute(t):e.setAttribute(t,h?"":Ol(n)?String(n):n)}function JB(e,t,n,i,c){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?m$(n):n);return}const h=e.tagName;if(t==="value"&&h!=="PROGRESS"&&!h.includes("-")){const a=h==="OPTION"?e.getAttribute("value")||"":e.value,y=n==null?e.type==="checkbox"?"on":"":String(n);(a!==y||!("_value"in e))&&(e.value=y),n==null&&e.removeAttribute(t),e._value=n;return}let m=!1;if(n===""||n==null){const a=typeof e[t];a==="boolean"?n=eU(n):n==null&&a==="string"?(n="",m=!0):a==="number"&&(n=0,m=!0)}try{e[t]=n}catch{}m&&e.removeAttribute(c||t)}function xm(e,t,n,i){e.addEventListener(t,n,i)}function gY(e,t,n,i){e.removeEventListener(t,n,i)}const QB=Symbol("_vei");function _Y(e,t,n,i,c=null){const h=e[QB]||(e[QB]={}),m=h[t];if(i&&m)m.value=i;else{const[a,y]=yY(t);if(i){const E=h[t]=xY(i,c);xm(e,a,E,y)}else m&&(gY(e,a,m,y),h[t]=void 0)}}const e3=/(?:Once|Passive|Capture)$/;function yY(e){let t;if(e3.test(e)){t={};let i;for(;i=e.match(e3);)e=e.slice(0,e.length-i[0].length),t[i[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):bh(e.slice(2)),t]}let II=0;const vY=Promise.resolve(),bY=()=>II||(vY.then(()=>II=0),II=Date.now());function xY(e,t){const n=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=n.attached)return;const c=n.value;if(dr(c)){const h=i.stopImmediatePropagation;i.stopImmediatePropagation=()=>{h.call(i),i._stopped=!0};const m=c.slice(),a=[i];for(let y=0;y<m.length&&!i._stopped;y++){const E=m[y];E&&yc(E,t,5,a)}}else yc(c,t,5,[i])};return n.value=e,n.attached=bY(),n}const t3=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,wY=(e,t,n,i,c,h)=>{const m=c==="svg";t==="class"?uY(e,i,m):t==="style"?fY(e,n,i):Tx(t)?nC(t)||_Y(e,t,n,i,h):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):SY(e,t,i,m))?(JB(e,t,i),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&KB(e,t,i,m,h,t!=="value")):e._isVueCE&&(TY(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!eo(i)))?JB(e,_a(t),i,h,t):(t==="true-value"?e._trueValue=i:t==="false-value"&&(e._falseValue=i),KB(e,t,i,m))};function SY(e,t,n,i){if(i)return!!(t==="innerHTML"||t==="textContent"||t in e&&t3(t)&&Ir(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const c=e.tagName;if(c==="IMG"||c==="VIDEO"||c==="CANVAS"||c==="SOURCE")return!1}return t3(t)&&eo(n)?!1:t in e}function TY(e,t){const n=e._def.props;if(!n)return!1;const i=_a(t);return Array.isArray(n)?n.some(c=>_a(c)===i):Object.keys(n).some(c=>_a(c)===i)}
4const b$=new WeakMap,x$=new WeakMap,_E=Symbol("_moveCb"),n3=Symbol("_enterCb"),EY=e=>(delete e.props.mode,e),CY=EY({name:"TransitionGroup",props:ns({},_$,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Ds(),i=MU();let c,h;return cM(()=>{if(!c.length)return;const m=e.moveClass||`${e.name||"v"}-move`;if(!kY(c[0].el,n.vnode.el,m)){c=[];return}c.forEach(IY),c.forEach(PY);const a=c.filter(RY);QP(n.vnode.el),a.forEach(y=>{const E=y.el,C=E.style;Hu(E,m),C.transform=C.webkitTransform=C.transitionDuration="";const P=E[_E]=L=>{L&&L.target!==E||(!L||L.propertyName.endsWith("transform"))&&(E.removeEventListener("transitionend",P),E[_E]=null,Cf(E,m))};E.addEventListener("transitionend",P)}),c=[]}),()=>{const m=ci(e),a=y$(m);let y=m.tag||jo;if(c=[],h)for(let E=0;E<h.length;E++){const C=h[E];C.el&&C.el instanceof Element&&!C.el[yM]&&(c.push(C),Xf(C,Zb(C,a,i,n)),b$.set(C,w$(C.el)))}h=t.default?oM(t.default()):[];for(let E=0;E<h.length;E++){const C=h[E];C.key!=null&&Xf(C,Zb(C,a,i,n))}return Ai(y,null,h)}}}),AY=CY;function IY(e){const t=e.el;t[_E]&&t[_E](),t[n3]&&t[n3]()}function PY(e){x$.set(e,w$(e.el))}function RY(e){const t=b$.get(e),n=x$.get(e),i=t.left-n.left,c=t.top-n.top;if(i||c){const h=e.el,m=h.style,a=h.getBoundingClientRect();let y=1,E=1;return h.offsetWidth&&(y=a.width/h.offsetWidth),h.offsetHeight&&(E=a.height/h.offsetHeight),(!Number.isFinite(y)||y===0)&&(y=1),(!Number.isFinite(E)||E===0)&&(E=1),Math.abs(y-1)<.01&&(y=1),Math.abs(E-1)<.01&&(E=1),m.transform=m.webkitTransform=`translate(${i/y}px,${c/E}px)`,m.transitionDuration="0s",e}}function w$(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function kY(e,t,n){const i=e.cloneNode(),c=e[sy];c&&c.forEach(a=>{a.split(/\s+/).forEach(y=>y&&i.classList.remove(y))}),n.split(/\s+/).forEach(a=>a&&i.classList.add(a)),i.style.display="none";const h=t.nodeType===1?t:t.parentNode;h.appendChild(i);const{hasTransform:m}=v$(i);return h.removeChild(i),m}const yE=e=>{const t=e.props["onUpdate:modelValue"]||!1;return dr(t)?n=>q_(t,n):t};function MY(e){e.target.composing=!0}function r3(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const K_=Symbol("_assign");function i3(e,t,n){return t&&(e=e.trim()),n&&(e=aC(e)),e}const VLe={created(e,{modifiers:{lazy:t,trim:n,number:i}},c){e[K_]=yE(c);const h=i||c.props&&c.props.type==="number";xm(e,t?"change":"input",m=>{m.target.composing||e[K_](i3(e.value,n,h))}),(n||h)&&xm(e,"change",()=>{e.value=i3(e.value,n,h)}),t||(xm(e,"compositionstart",MY),xm(e,"compositionend",r3),xm(e,"change",r3))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:i,trim:c,number:h}},m){if(e[K_]=yE(m),e.composing)return;const a=(h||e.type==="number")&&!/^0\d/.test(e.value)?aC(e.value):e.value,y=t??"";if(a===y)return;const E=e.getRootNode();(E instanceof Document||E instanceof ShadowRoot)&&E.activeElement===e&&e.type!=="range"&&(i&&t===n||c&&e.value.trim()===y)||(e.value=y)}},ULe={deep:!0,created(e,{value:t,modifiers:{number:n}},i){const c=rC(t);xm(e,"change",()=>{const h=Array.prototype.filter.call(e.options,m=>m.selected).map(m=>n?aC(vE(m)):vE(m));e[K_](e.multiple?c?new Set(h):h:h[0]),e._assigning=!0,ts(()=>{e._assigning=!1})}),e[K_]=yE(i)},mounted(e,{value:t}){o3(e,t)},beforeUpdate(e,t,n){e[K_]=yE(n)},updated(e,{value:t}){e._assigning||o3(e,t)}};function o3(e,t){const n=e.multiple,i=dr(t);if(!(n&&!i&&!rC(t))){for(let c=0,h=e.options.length;c<h;c++){const m=e.options[c],a=vE(m);if(n)if(i){const y=typeof a;y==="string"||y==="number"?m.selected=t.some(E=>String(E)===String(a)):m.selected=mX(t,a)>-1}else m.selected=t.has(a);else if(Ex(vE(m),t)){e.selectedIndex!==c&&(e.selectedIndex=c);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function vE(e){return"_value"in e?e._value:e.value}const LY=["ctrl","shift","alt","meta"],OY={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>
4LY.some(n=>e[`${n}Key`]&&!t.includes(n))},$Le=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),i=t.join(".");return n[i]||(n[i]=((c,...h)=>{for(let m=0;m<t.length;m++){const a=OY[t[m]];if(a&&a(c,t))return}return e(c,...h)}))},DY={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},jLe=(e,t)=>{const n=e._withKeys||(e._withKeys={}),i=t.join(".");return n[i]||(n[i]=(c=>{if(!("key"in c))return;const h=bh(c.key);if(t.some(m=>m===h||DY[m]===h))return e(c)}))},S$=ns({patchProp:wY},oY);let kb,s3=!1;function FY(){return kb||(kb=zZ(S$))}function BY(){return kb=s3?kb:NZ(S$),s3=!0,kb}const zY=((...e)=>{const t=FY().createApp(...e),{mount:n}=t;return t.mount=i=>{const c=E$(i);if(!c)return;const h=t._component;!Ir(h)&&!h.render&&!h.template&&(h.template=c.innerHTML),c.nodeType===1&&(c.textContent="");const m=n(c,!1,T$(c));return c instanceof Element&&(c.removeAttribute("v-cloak"),c.setAttribute("data-v-app","")),m},t}),NY=((...e)=>{const t=BY().createApp(...e),{mount:n}=t;return t.mount=i=>{const c=E$(i);if(c)return n(c,!0,T$(c))},t});function T$(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function E$(e){return eo(e)?document.querySelector(e):e}const VY=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,UY=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,$Y=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function jY(e,t){if(e==="__proto__"||e==="constructor"&&t&&typeof t=="object"&&"prototype"in t){GY(e);return}return t}function GY(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function HY(e,t={}){if(typeof e!="string")return e;if(e[0]==='"'&&e[e.length-1]==='"'&&e.indexOf("\\")===-1)return e.slice(1,-1);const n=e.trim();if(n.length<=9)switch(n.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!$Y.test(e)){if(t.strict)throw new SyntaxError("[destr] Invalid JSON");return e}try{if(VY.test(e)||UY.test(e)){if(t.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(e,jY)}return JSON.parse(e)}catch(i){if(t.strict)throw i;return e}}const C$=/#/g,A$=/&/g,WY=/\//g,qY=/=/g,XY=/\?/g,xC=/\+/g,ZY=/%5e/gi,YY=/%60/gi,KY=/%7c/gi,JY=/%20/gi,QY=/%2f/gi,eK=/%252f/gi;function I$(e){return encodeURI(""+e).replace(KY,"|")}function eR(e){return I$(typeof e=="string"?e:JSON.stringify(e)).replace(xC,"%2B").replace(JY,"+").replace(C$,"%23").replace(A$,"%26").replace(YY,"`").replace(ZY,"^").replace(WY,"%2F")}function PI(e){return eR(e).replace(qY,"%3D")}function tK(e){return I$(e).replace(C$,"%23").replace(XY,"%3F").replace(eK,"%2F").replace(A$,"%26").replace(xC,"%2B")}function Bm(e=""){try{return decodeURIComponent(""+e)}catch{return""+e}}function nK(e){return Bm(e.replace(QY,"%252F"))}function rK(e){return Bm(e.replace(xC," "))}function iK(e){return Bm(e.replace(xC," "))}function wC(e=""){const t=Object.create(null);e[0]==="?"&&(e=e.slice(1));for(const n of e.split("&")){const i=n.match(/([^=]+)=?(.*)/)||[];if(i.length<2)continue;const c=rK(i[1]);if(c==="__proto__"||c==="constructor")continue;const h=iK(i[2]||"");t[c]===void 0?t[c]=h:Array.isArray(t[c])?t[c].push(h):t[c]=[t[c],h]}return t}function oK(e,t){return(typeof t=="number"||typeof t=="boolean")&&(t=String(t)),t?Array.isArray(t)?t.map(n=>`${PI(e)}=${eR(n)}`).join("&"):`${PI(e)}=${eR(t)}`:PI(e)}function sK(e){return Object.keys(e).filter(t=>e[t]!==void 0).map(t=>oK(t,e[t])).filter(Boolean).join("&")}const aK=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,lK=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,cK=/^([/\\]\s*){2,}[^/\\]/,uK=/^[\s\0]*(blob|data|javascript|vbscript):$/i,dK=/\/$|\/\?|\/#/,hK=/^\.?\//;function bc(e,t={}){return typeof t=="boolean"&&(t={acceptRelative:t}),t.strict?aK.test(e):lK.test(e)||(t.acceptRelative?cK.test(e):!1)}function bE(e){return!!e&&uK.test(e)}function tR(e="",t){return t?dK.test(e):e.endsWith("/")}function ay(e="",t){if(!t)return(tR(e)?e.slice(0,-1):e)||"/";if(!tR(e,!0))return e||"/";let n=e,i="";const c=e.indexOf("#");c!==-1&&(n=e.slice(0,c),i=e.slice(c));const[h,...m]=n.split("?");return((h.endsWith("/")?h.slice(0,-1):h)||"/")+(m.length>0?`?${m.join("?")}`:"")+i}function xE(e="",t){if(!t)return e.endsWith("/")?e:e+"/";if(tR(e,!0))return e||"/";let n=e,i="";const c=e.indexOf("#");if(c!==-1&&(n=e.slice(0,c),i=e.slice(c),!n))return i;const[h,...m]=n.split("?");return h+"/"+(m.length>0?`?${m.join("?")}`:"")+i}function fK(e=""){return e.startsWith("/")}function a3(e=""){return fK(e)?e:"/"+e}function pK(e,t){if(P$(t)||bc(e))return e;const n=ay(t);
4if(e.startsWith(n)){const i=e[n.length];if(!i||i==="/"||i==="?")return e}return Uf(n,e)}function l3(e,t){if(P$(t))return e;const n=ay(t);if(!e.startsWith(n))return e;const i=e[n.length];return i&&i!=="/"&&i!=="?"?e:"/"+e.slice(n.length).replace(/^\/+/,"")}function SC(e,t){const n=vM(e),i={...wC(n.search),...t};return n.search=sK(i),_K(n)}function P$(e){return!e||e==="/"}function mK(e){return e&&e!=="/"}function Uf(e,...t){let n=e||"";for(const i of t.filter(c=>mK(c)))if(n){const c=i.replace(hK,"");n=xE(n)+c}else n=i;return n}function R$(...e){const t=/\/(?!\/)/,n=e.filter(Boolean),i=[];let c=0;for(const m of n)if(!(!m||m==="/")){for(const[a,y]of m.split(t).entries())if(!(!y||y===".")){if(y===".."){if(i.length===1&&bc(i[0]))continue;i.pop(),c--;continue}if(a===1&&i[i.length-1]?.endsWith(":/")){i[i.length-1]+="/"+y;continue}i.push(y),c++}}let h=i.join("/");return c>=0?n[0]?.startsWith("/")&&!h.startsWith("/")?h="/"+h:n[0]?.startsWith("./")&&!h.startsWith("./")&&(h="./"+h):h="../".repeat(-1*c)+h,n[n.length-1]?.endsWith("/")&&!h.endsWith("/")&&(h+="/"),h}function k$(e,t){return Bm(ay(e))===Bm(ay(t))}function gK(e,t,n={}){return n.trailingSlash||(e=xE(e),t=xE(t)),n.leadingSlash||(e=a3(e),t=a3(t)),n.encoding||(e=Bm(e),t=Bm(t)),e===t}const M$=Symbol.for("ufo:protocolRelative");function vM(e="",t){const n=e.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(n){const[,P,L=""]=n;return{protocol:P.toLowerCase(),pathname:L,href:P+L,auth:"",host:"",search:"",hash:""}}if(!bc(e,{acceptRelative:!0}))return nR(e);const[,i="",c,h=""]=e.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[];let[,m="",a=""]=h.match(/([^#/?]*)(.*)?/)||[];i==="file:"&&(a=a.replace(/\/(?=[A-Za-z]:)/,""));const{pathname:y,search:E,hash:C}=nR(a);return{protocol:i.toLowerCase(),auth:c?c.slice(0,Math.max(0,c.length-1)):"",host:m,pathname:y,search:E,hash:C,[M$]:!i}}function nR(e=""){const[t="",n="",i=""]=(e.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:t,search:n,hash:i}}function _K(e){const t=e.pathname||"",n=e.search?(e.search.startsWith("?")?"":"?")+e.search:"",i=e.hash||"",c=e.auth?e.auth+"@":"",h=e.host||"";return(e.protocol||e[M$]?(e.protocol||"")+"//":"")+c+h+t+n+i}class yK extends Error{constructor(t,n){super(t,n),this.name="FetchError",n?.cause&&!this.cause&&(this.cause=n.cause)}}function vK(e){const t=e.error?.message||e.error?.toString()||"",n=e.request?.method||e.options?.method||"GET",i=e.request?.url||String(e.request)||"/",c=`[${n}] ${JSON.stringify(i)}`,h=e.response?`${e.response.status} ${e.response.statusText}`:"<no response>",m=`${c}: ${h}${t?` ${t}`:""}`,a=new yK(m,e.error?{cause:e.error}:void 0);for(const y of["request","options","response"])Object.defineProperty(a,y,{get(){return e[y]}});for(const[y,E]of[["data","_data"],["status","status"],["statusCode","status"],["statusText","statusText"],["statusMessage","statusText"]])Object.defineProperty(a,y,{get(){return e.response&&e.response[E]}});return a}const bK=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function c3(e="GET"){return bK.has(e.toUpperCase())}function xK(e){if(e===void 0)return!1;const t=typeof e;return t==="string"||t==="number"||t==="boolean"||t===null?!0:t!=="object"?!1:Array.isArray(e)?!0:e.buffer||e instanceof FormData||e instanceof URLSearchParams?!1:e.constructor&&e.constructor.name==="Object"||typeof e.toJSON=="function"}const wK=new Set(["image/svg","application/xml","application/xhtml","application/html"]),SK=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function TK(e=""){if(!e)return"json";const t=e.split(";").shift()||"";return SK.test(t)?"json":t==="text/event-stream"?"stream":wK.has(t)||t.startsWith("text/")?"text":"blob"}function EK(e,t,n,i){const c=CK(t?.headers??e?.headers,n?.headers,i);let h;return(n?.query||n?.params||t?.params||t?.query)&&(h={...n?.params,...n?.query,...t?.params,...t?.query}),{...n,...t,query:h,params:h,headers:c}}function CK(e,t,n){if(!t)return new n(e);const i=new n(t);if(e)for(const[c,h]of Symbol.iterator in e||Array.isArray(e)?e:new n(e))i.set(c,h);return i}async function KS(e,t){if(t)if(Array.isArray(t))for(const n of t)await n(e);else await t(e)}const AK=new Set([408,409,425,429,500,502,503,504]),IK=new Set([101,204,205,304]);function L$(e={}){const{fetch:t=globalThis.fetch,Headers:n=globalThis.Headers,AbortController:i=globalThis.AbortController}=e;async function c(a){const y=a.error&&a.error.name==="AbortError"&&!a.options.timeout||!1;if(a.options.retry!==!1&&!y){let C;typeof a.options.retry=="number"?C=a.options.retry:C=c3(a.options.method)?0:1;const P=a.response&&a.response.status||500;if(C>0&&(Array.isArray(a.options.retryStatusCodes)?a.options.retryStatusCodes.includes(P):AK.has(P))){const L=typeof a.options.retryDelay=="function"?a.options.retryDelay(a):a.options.retryDelay||0;return L>0&&await new Promise(D=>setTimeout(D,L)),h(a.request,{...a.options,retry:C-1})}}const E=vK(a);throw Error.captureStackTrace&&Error.captureStackTrace(E,h),E}const h=async function(y,E={}){const C={request:y,options:EK(y,E,e.defaults,n),response:void 0,error:void 0};if(C.options.method&&(C.options.method=C.options.method.toUpperCase()),C.options.onRequest&&(await KS(C,C.options.onRequest),C.options.headers instanceof n||(C.options.headers=new n(C.options.headers||{}))),typeof C.request=="string"&&(C.options.baseURL&&(C.request=pK(C.request,C.options.baseURL)),C.options.query&&(C.request=SC(C.request,C.options.query),delete C.options.query),"query"in C.options&&delete C.options.query,"params"in C.options&&delete C.options.params),C.options.body&&c3(C.options.method))if(xK(C.options.body)){const D=C.options.headers.get("content-type");typeof C.options.body!="string"&&(C.options.body=D==="application/x-www-form-urlencoded"?new URLSearchParams(C.options.body).toString():JSON.stringify(C.options.body)),D||C.options.headers.set("content-type","application/json"),C.options.headers.has("accept")||C.options.headers.set("accept","application/json")}else("pipeTo"in C.options.body&&typeof C.options.body.pipeTo=="function"||typeof C.options.body.pipe=="function")&&("duplex"in C.options||(C.options.duplex="half"));let P;if(!C.options.signal&&C.options.timeout){const D=new i;P=setTimeout(()=>{const V=new Error("[TimeoutError]: The operation was aborted due to timeout");V.name="TimeoutError",V.code=23,D.abort(V)},C.options.timeout),C.options.signal=D.signal}try{C.response=await t(C.request,C.options)}catch(D){return C.error=D,C.options.onRequestError&&await KS(C,C.options.onRequestError),await c(C)}finally{P&&clearTimeout(P)}if((C.response.body||C.response._bodyInit)&&!IK.has(C.response.status)&&C.options.method!=="HEAD"){const D=(C.options.parseResponse?"json":C.options.responseType)||TK(C.response.headers.get("content-type")||"");switch(D){case"json":{const V=await C.response.text(),U=C.options.parseResponse||HY;C.response._data=U(V);break}case"stream":{C.response._data=C.response.body||C.response._bodyInit;break}default:C.response._data=await C.response[D]()}}return C.options.onResponse&&await KS(C,C.options.onResponse),!C.options.ignoreResponseError&&C.response.status>=400&&C.response.status<600?(C.options.onResponseError&&await KS(C,C.options.onResponseError),await c(C)):C.response},m=async function(y,E){return(await h(y,E))._data};return m.raw=h,m.native=(...a)=>t(...a),m.create=(a={},y={})=>L$({...e,...y,defaults:{...e.defaults,...y.defaults,...a}}),m}const wE=(function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")})(),PK=wE.fetch?(...e)=>wE.fetch(...e):()=>Promise.reject(new Error("[ofetch] global.fetch is not supported!")),RK=wE.Headers,kK=wE.AbortController,MK=L$({fetch:PK,Headers:RK,AbortController:kK}),LK=MK,OK=()=>window?.__NUXT__?.config||window?.useNuxtApp?.().payload?.config,bM=()=>OK().app,DK=()=>bM().baseURL,FK=()=>bM().buildAssetsDir,xM=(...e)=>R$(O$(),FK(),...e),O$=(...e)=>{const t=bM(),n=t.cdnURL||t.baseURL;return e.length?R$(n,...e):n};globalThis.__buildAssetsURL=xM,globalThis.__publicAssetsURL=O$;globalThis.$fetch||(globalThis.$fetch=LK.create({baseURL:DK()}));"global"in globalThis||(globalThis.global=globalThis);function rR(e,t={},n){for(const i in e){const c=e[i],h=n?`${n}:${i}`:i;typeof c=="object"&&c!==null?rR(c,t,h):typeof c=="function"&&(t[h]=c)}return t}const D$=(()=>
4{if(console.createTask)return console.createTask;const e={run:t=>t()};return()=>e})();function F$(e,t,n,i){for(let c=n;c<e.length;c+=1)try{const h=i?i.run(()=>e[c](...t)):e[c](...t);if(h&&typeof h.then=="function")return Promise.resolve(h).then(()=>F$(e,t,c+1,i))}catch(h){return Promise.reject(h)}}function BK(e,t,n){if(e.length>0)return F$(e,t,0,D$(n))}function zK(e,t,n){if(e.length>0){const i=D$(n);return Promise.all(e.map(c=>i.run(()=>c(...t))))}}function RI(e,t){for(const n of[...e])n(t)}var NK=class{_hooks;_before;_after;_deprecatedHooks;_deprecatedMessages;constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(e,t,n={}){if(!e||typeof t!="function")return()=>{};const i=e;let c;for(;this._deprecatedHooks[e];)c=this._deprecatedHooks[e],e=c.to;if(c&&!n.allowDeprecated){let h=c.message;h||(h=`${i} hook has been deprecated`+(c.to?`, please use ${c.to}`:"")),this._deprecatedMessages||(this._deprecatedMessages=new Set),this._deprecatedMessages.has(h)||(console.warn(h),this._deprecatedMessages.add(h))}if(!t.name)try{Object.defineProperty(t,"name",{get:()=>"_"+e.replace(/\W+/g,"_")+"_hook_cb",configurable:!0})}catch{}return this._hooks[e]=this._hooks[e]||[],this._hooks[e].push(t),()=>{t&&(this.removeHook(e,t),t=void 0)}}hookOnce(e,t){let n,i=(...c)=>(typeof n=="function"&&n(),n=void 0,i=void 0,t(...c));return n=this.hook(e,i),n}removeHook(e,t){const n=this._hooks[e];if(n){const i=n.indexOf(t);i!==-1&&n.splice(i,1),n.length===0&&(this._hooks[e]=void 0)}}clearHook(e){this._hooks[e]=void 0}deprecateHook(e,t){this._deprecatedHooks[e]=typeof t=="string"?{to:t}:t;const n=this._hooks[e]||[];this._hooks[e]=void 0;for(const i of n)this.hook(e,i)}deprecateHooks(e){for(const t in e)this.deprecateHook(t,e[t])}addHooks(e){const t=rR(e),n=Object.keys(t).map(i=>this.hook(i,t[i]));return()=>{for(const i of n)i();n.length=0}}removeHooks(e){const t=rR(e);for(const n in t)this.removeHook(n,t[n])}removeAllHooks(){this._hooks={}}callHook(e,...t){return this.callHookWith(BK,e,t)}callHookParallel(e,...t){return this.callHookWith(zK,e,t)}callHookWith(e,t,n){const i=this._before||this._after?{name:t,args:n,context:{}}:void 0;this._before&&RI(this._before,i);const c=e(this._hooks[t]?[...this._hooks[t]]:[],n,t);return c instanceof Promise?c.finally(()=>{this._after&&i&&RI(this._after,i)}):(this._after&&i&&RI(this._after,i),c)}beforeEach(e){return this._before=this._before||[],this._before.push(e),()=>{if(this._before!==void 0){const t=this._before.indexOf(e);t!==-1&&this._before.splice(t,1)}}}afterEach(e){return this._after=this._after||[],this._after.push(e),()=>{if(this._after!==void 0){const t=this._after.indexOf(e);t!==-1&&this._after.splice(t,1)}}}};function B$(){return new NK}function VK(e={}){let t,n=!1;const i=m=>{if(t&&t!==m)throw new Error("Context conflict")};let c;if(e.asyncContext){const m=e.AsyncLocalStorage||globalThis.AsyncLocalStorage;m?c=new m:console.warn("[unctx] `AsyncLocalStorage` is not provided.")}const h=()=>{if(c){const m=c.getStore();if(m!==void 0)return m}return t};return{use:()=>{const m=h();if(m===void 0)throw new Error("Context is not available");return m},tryUse:()=>h(),set:(m,a)=>{a||i(m),t=m,n=!0},unset:()=>{t=void 0,n=!1},call:(m,a)=>{i(m),t=m;try{return c?c.run(m,a):a()}finally{n||(t=void 0)}},async callAsync(m,a){t=m;const y=()=>{t=m},E=()=>t===m?y:void 0;iR.add(E);try{const C=c?c.run(m,a):a();return n||(t=void 0),await C}finally{iR.delete(E)}}}}function UK(e={}){const t={};return{get(n,i={}){return t[n]||(t[n]=VK({...e,...i})),t[n]}}}const SE=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof global<"u"?global:typeof window<"u"?window:{},u3="__unctx__",$K=SE[u3]||(SE[u3]=UK()),jK=(e,t={})=>$K.get(e,t),d3="__unctx_async_handlers__",iR=SE[d3]||(SE[d3]=new Set);function $f(e){const t=[];for(const c of iR){const h=c();h&&t.push(h)}const n=()=>{for(const c of t)c()};let i=e();return i&&typeof i=="object"&&"catch"in i&&(i=i.catch(c=>{throw n(),c})),[i,n]}
4const h3=!1,f3=!1,GK=!1,p3={id:"__nuxt-loader"},HK={componentName:"NuxtLink",prefetch:!0,prefetchOn:{visibility:!0}},WK={deep:!1},qK={},XK="#app",z$="nuxt-app",m3=36e5,ZK="vite:preloadError";function N$(e=z$){return jK(e,{asyncContext:!1})}const YK="__nuxt_plugin";function KK(e){let t=0;const n={_id:e.id||z$||"nuxt-app",_scope:Cx(),provide:void 0,versions:{get nuxt(){return"4.4.8"},get vue(){return n.vueApp.version}},payload:Zc({...e.ssrContext?.payload||{},data:Zc({}),state:Fl({}),once:new Set,_errors:Zc({})}),static:{data:{}},runWithContext(c){return n._scope.active&&!ld()?n._scope.run(()=>oR(n,c)):oR(n,c)},isHydrating:!0,deferHydration(){if(!n.isHydrating)return()=>{};t++;let c=!1;return()=>{if(!c&&(c=!0,t--,t===0))return n.isHydrating=!1,n.callHook("app:suspense:resolve")}},_asyncDataPromises:{},_asyncData:Zc({}),_state:Zc({}),_payloadRevivers:{},...e};{const c=window.__NUXT__;if(c)for(const h in c)switch(h){case"data":case"state":case"_errors":Object.assign(n.payload[h],c[h]);break;default:n.payload[h]=c[h]}}n.hooks=B$(),n.hook=n.hooks.hook;{const c=n.hooks.callHook;n.hooks.callHook=(h,...m)=>Promise.resolve().then(()=>c(h,...m))}n.callHook=n.hooks.callHook,n.provide=(c,h)=>{const m="$"+c;JS(n,m,h),JS(n.vueApp.config.globalProperties,m,h)},JS(n.vueApp,"$nuxt",n),JS(n.vueApp.config.globalProperties,"$nuxt",n);{window.addEventListener(ZK,h=>{n.callHook("app:chunkError",{error:h.payload}),h.payload?.message?.includes("Unable to preload CSS")&&h.preventDefault()}),window.useNuxtApp||=rr;const c=n.hook("app:error",(...h)=>{console.error("[nuxt] error caught during app initialization",...h)});n.hook("app:mounted",c)}const i=n.payload.config;return n.provide("config",i),n}function JK(e,t){t.hooks&&e.hooks.addHooks(t.hooks)}async function QK(e,t){if(typeof t=="function"){const{provide:n}=await e.runWithContext(()=>t(e))||{};if(n&&typeof n=="object")for(const i in n)e.provide(i,n[i])}}async function eJ(e,t){const n=new Set,i=[],c=[];let h,m=0;async function a(y){const E=y.dependsOn?.filter(C=>t.some(P=>P._name===C)&&!n.has(C))??[];if(E.length>0)i.push([new Set(E),y]);else{const C=QK(e,y).then(async()=>{y._name&&(n.add(y._name),await Promise.all(i.map(async([P,L])=>{P.has(y._name)&&(P.delete(y._name),P.size===0&&(m++,await a(L)))})))}).catch(P=>{if(!y.parallel&&!e.payload.error)throw P;h||=P});y.parallel?c.push(C):await C}}for(const y of t)JK(e,y);for(const y of t)await a(y);if(await Promise.all(c),m)for(let y=0;y<m;y++)await Promise.all(c);if(h)throw e.payload.error||h}function Ji(e){if(typeof e=="function")return e;const t=e._name||e.name;return delete e.name,Object.assign(e.setup||(()=>{}),e,{[YK]:!0,_name:t})}const tJ=Ji;function oR(e,t,n){const i=()=>t();return N$(e._id).set(e),e.vueApp.runWithContext(i)}function nJ(e){let t;return Wm()&&(t=Ds()?.appContext.app.$nuxt),t||=N$(e).tryUse(),t||null}function rr(e){const t=nJ(e);if(!t)throw new Error("[nuxt] instance unavailable");return t}function Dl(e){return rr().$config}function JS(e,t,n){Object.defineProperty(e,t,{get:()=>n})}function kI(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function sR(e,t,n=".",i){if(!kI(t))return sR(e,{},n,i);const c={...t};for(const h of Object.keys(e)){if(h==="__proto__"||h==="constructor")continue;const m=e[h];m!=null&&(i&&i(c,h,m,n)||(Array.isArray(m)&&Array.isArray(c[h])?c[h]=[...m,...c[h]]:kI(m)&&kI(c[h])?c[h]=sR(m,c[h],(n?`${n}.`:"")+h.toString(),i):c[h]=m))}return c}function V$(e){return(...t)=>t.reduce((n,i)=>sR(n,i,"",e),{})}const U$=V$();function rJ(e,t){try{return t in e}catch{return!1}}class g3 extends Error{static __h3_error__=!0;statusCode=500;fatal=!1;unhandled=!1;statusMessage;data;cause;constructor(t,n={}){super(t,n),n.cause&&!this.cause&&(this.cause=n.cause)}toJSON(){const t={message:this.message,statusCode:aR(this.statusCode,500)};return this.statusMessage&&(t.statusMessage=$$(this.statusMessage)),this.data!==void 0&&(t.data=this.data),t}}function iJ(e){if(typeof e=="string")return new g3(e);
4if(oJ(e))return e;const t=new g3(e.message??e.statusMessage??"",{cause:e.cause||e});if(rJ(e,"stack"))try{Object.defineProperty(t,"stack",{get(){return e.stack}})}catch{try{t.stack=e.stack}catch{}}if(e.data&&(t.data=e.data),e.statusCode?t.statusCode=aR(e.statusCode,t.statusCode):e.status&&(t.statusCode=aR(e.status,t.statusCode)),e.statusMessage?t.statusMessage=e.statusMessage:e.statusText&&(t.statusMessage=e.statusText),t.statusMessage){const n=t.statusMessage;$$(t.statusMessage)!==n&&console.warn("[h3] Please prefer using `message` for longer error messages instead of `statusMessage`. In the future, `statusMessage` will be sanitized by default.")}return e.fatal!==void 0&&(t.fatal=e.fatal),e.unhandled!==void 0&&(t.unhandled=e.unhandled),t}function oJ(e){return e?.constructor?.__h3_error__===!0}const sJ=/[^\u0009\u0020-\u007E]/g;function $$(e=""){return e.replace(sJ,"")}function aR(e,t=200){return!e||(typeof e=="string"&&(e=Number.parseInt(e,10)),e<100||e>999)?t:e}const j$=Symbol("layout-meta"),zm=Symbol("route");import.meta.url.replace(/\/app\/.*$/,"/");const ps=()=>rr()?.$router,wM=()=>Wm()?wo(zm,rr()._route):rr()._route;function GLe(e){return e}const aJ=(e,t,n={})=>{const i=rr(),c=n.global||typeof e!="string",h=t;if(!h){console.warn("[nuxt] No route middleware passed to `addRouteMiddleware`.",e);return}c?i._middleware.global.push(h):i._middleware.named[e]=h},lJ=()=>{try{if(rr()._processingMiddleware)return!0}catch{return!1}return!1},ly=(e,t)=>{e||="/";const n=typeof e=="string"?e:"path"in e?lR(e):ps().resolve(e).href;if(t?.open){const{protocol:E}=new URL(n,window.location.href);if(E&&bE(E))throw new Error(`Cannot navigate to a URL with '${E}' protocol.`);const{target:C="_blank",windowFeatures:P={}}=t.open,L=[];for(const[D,V]of Object.entries(P))V!==void 0&&L.push(`${D.toLowerCase()}=${V}`);return open(n,C,L.join(", ")),Promise.resolve()}const i=bc(n,{acceptRelative:!0}),c=t?.external||i;if(c){if(!t?.external)throw new Error("Navigating to an external URL is not allowed by default. Use `navigateTo(url, { external: true })`.");const{protocol:E}=new URL(n,window.location.href);if(E&&bE(E))throw new Error(`Cannot navigate to a URL with '${E}' protocol.`)}const h=lJ();if(!c&&h){if(t?.replace){if(typeof e=="string"){const{pathname:E,search:C,hash:P}=vM(e);return{path:E,...C&&{query:wC(C)},...P&&{hash:P},replace:!0}}return{...e,replace:!0}}return e}const m=ps(),a=rr();if(c)return a._scope.stop(),t?.replace?location.replace(n):location.href=n,h?a.isHydrating?new Promise(()=>{}):!1:Promise.resolve();const y=typeof e=="string"?G$(e):e;return t?.replace?m.replace(y):m.push(y)};function lR(e){return SC(e.path||"",e.query||{})+(e.hash||"")}function G$(e){const t=vM(e);return tK(nK(t.pathname))+t.search+t.hash}const H$="__nuxt_error",Mx=()=>Ix(rr().payload,"error"),_m=e=>{const t=jf(e);try{const n=Mx();rr().hooks.callHook("app:error",t),n.value||=t}catch{throw t}return t},cJ=async(e={})=>{const t=rr(),n=Mx();t.callHook("app:error:cleared",e),e.redirect&&await ps().replace(e.redirect),n.value=void 0},W$=e=>!!e&&typeof e=="object"&&H$ in e,jf=e=>{typeof e!="string"&&e.statusText&&(e.message??=e.statusText);const t=iJ(e);return Object.defineProperty(t,H$,{value:!0,configurable:!1,writable:!1}),Object.defineProperty(t,"status",{get:()=>t.statusCode,configurable:!0}),Object.defineProperty(t,"statusText",{get:()=>t.statusMessage,configurable:!0}),t};let q$;const cy=e=>q$=e,X$=Symbol();function cR(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var Mb;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(Mb||(Mb={}));function uJ(){const e=Cx(!0),t=e.run(()=>hn({}));let n=[],i=[];const c=Ax({install(h){cy(c),c._a=h,h.provide(X$,c),h.config.globalProperties.$pinia=c,i.forEach(m=>n.push(m)),i=[]},use(h){return this._a?n.push(h):i.push(h),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return c}const Z$=()=>{};function _3(e,t,n,i=Z$){e.add(t);const c=()=>{e.delete(t)&&i()};return!n&&ld()&&Dm(c),c}function S_(e,...t){e.forEach(n=>{n(...t)})}const dJ=e=>e(),y3=Symbol(),MI=Symbol();function uR(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,i)=>e.set(i,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const i=t[n],c=e[n];cR(c)&&cR(i)&&e.hasOwnProperty(n)&&!qi(i)&&!eu(i)?e[n]=uR(c,i):e[n]=i}return e}const hJ=Symbol();function fJ(e){return!cR(e)||!Object.prototype.hasOwnProperty.call(e,hJ)}const{assign:Af}=Object;function pJ(e){return!!(qi(e)&&e.effect)}function mJ(e,t,n,i){const{state:c,actions:h,getters:m}=t,a=n.state.value[e];let y;function E(){a||(n.state.value[e]=c?c():{});const C=BX(n.state.value[e]);return Af(C,h,Object.keys(m||{}).reduce((P,L)=>(P[L]=Ax(vn(()=>{cy(n);const D=n._s.get(e);return m[L].call(D,D)})),P),{}))}return y=Y$(e,E,t,n,i,!0),y}function Y$(e,t,n={},i,c,h){let m;const a=Af({actions:{}},n),y={deep:!0};let E,C,P=new Set,L=new Set,D;const V=i.state.value[e];!h&&!V&&(i.state.value[e]={});let U;function W(ke){let Fe;E=C=!1,typeof ke=="function"?(ke(i.state.value[e]),Fe={type:Mb.patchFunction,storeId:e,events:D}):(uR(i.state.value[e],ke),Fe={type:Mb.patchObject,payload:ke,storeId:e,events:D});const qe=U=Symbol();ts().then(()=>{U===qe&&(E=!0)}),C=!0,S_(P,Fe,i.state.value[e])}const $=h?function(){const{state:Fe}=n,qe=Fe?Fe():{};this.$patch(lt=>{Af(lt,qe)})}:Z$;function Y(){m.stop(),P.clear(),L.clear(),i._s.delete(e)}const X=(ke,Fe="")=>{if(y3 in ke)return ke[MI]=Fe,ke;const qe=function(){cy(i);const lt=Array.from(arguments),pt=new Set,Qt=new Set;function Ht(Zt){pt.add(Zt)}function zt(Zt){Qt.add(Zt)}S_(L,{args:lt,name:qe[MI],store:ne,after:Ht,onError:zt});let jt;try{jt=ke.apply(this&&this.$id===e?this:ne,lt)}catch(Zt){throw S_(Qt,Zt),Zt}return jt instanceof Promise?jt.then(Zt=>(S_(pt,Zt),Zt)).catch(Zt=>(S_(Qt,Zt),Promise.reject(Zt))):(S_(pt,jt),jt)};return qe[y3]=!0,qe[MI]=Fe,qe}
4,K={_p:i,$id:e,$onAction:_3.bind(null,L),$patch:W,$reset:$,$subscribe(ke,Fe={}){const qe=_3(P,ke,Fe.detached,()=>lt()),lt=m.run(()=>qr(()=>i.state.value[e],pt=>{(Fe.flush==="sync"?C:E)&&ke({storeId:e,type:Mb.direct,events:D},pt)},Af({},y,Fe)));return qe},$dispose:Y},ne=Fl(K);i._s.set(e,ne);const ye=(i._a&&i._a.runWithContext||dJ)(()=>i._e.run(()=>(m=Cx()).run(()=>t({action:X}))));for(const ke in ye){const Fe=ye[ke];if(qi(Fe)&&!pJ(Fe)||eu(Fe))h||(V&&fJ(Fe)&&(qi(Fe)?Fe.value=V[ke]:uR(Fe,V[ke])),i.state.value[e][ke]=Fe);else if(typeof Fe=="function"){const qe=X(Fe,ke);ye[ke]=qe,a.actions[ke]=Fe}}return Af(ne,ye),Af(ci(ne),ye),Object.defineProperty(ne,"$state",{get:()=>i.state.value[e],set:ke=>{W(Fe=>{Af(Fe,ke)})}}),i._p.forEach(ke=>{Af(ne,m.run(()=>ke({store:ne,app:i._a,pinia:i,options:a})))}),V&&h&&n.hydrate&&n.hydrate(ne.$state,V),E=!0,C=!0,ne}function xa(e,t,n){let i;const c=typeof t=="function";i=c?n:t;function h(m,a){const y=Wm();return m=m||(y?wo(X$,null):null),m&&cy(m),m=q$,m._s.has(e)||(c?Y$(e,t,i,m):mJ(e,i,m)),m._s.get(e)}return h.$id=e,h}function HLe(e){const t=ci(e),n={};for(const i in t){const c=t[i];c.effect?n[i]=vn({get:()=>e[i],set(h){e[i]=h}}):(qi(c)||eu(c))&&(n[i]=Ix(e,i))}return n}const gJ=-1,_J=-2,yJ=-3,vJ=-4,bJ=-5,xJ=-6,wJ=-7,K$=2**32-1,dR=K$-1;function SJ(e){return!(!Number.isInteger(e)||e<0||e>dR)}function TJ(e){return!(!Number.isInteger(e)||e<0||e>K$)}function EJ(e){return Uint8Array.fromBase64(e).buffer}function CJ(e){return Uint8Array.from(Buffer.from(e,"base64")).buffer}function AJ(e){const t=atob(e),n=t.length,i=new Uint8Array(n);for(let c=0;c<n;c++)i[c]=t.charCodeAt(c);return i.buffer}const IJ=typeof Uint8Array.fromBase64=="function",PJ=typeof process=="object"&&process.versions?.node!==void 0,RJ=IJ?EJ:PJ?CJ:AJ;function kJ(e,t){return MJ(JSON.parse(e),t)}function MJ(e,t){if(typeof e=="number")return h(e,!0);if(!Array.isArray(e)||e.length===0)throw new Error("Invalid input");const n=e,i=Array(n.length);let c=null;function h(m,a=!1){if(m===gJ)return;if(m===yJ)return NaN;if(m===vJ)return 1/0;if(m===bJ)return-1/0;if(m===xJ)return-0;if(a||typeof m!="number")throw new Error("Invalid input");if(m in i)return i[m];const y=n[m];if(!y||typeof y!="object")i[m]=y;else if(Array.isArray(y))if(typeof y[0]=="string"){const E=y[0],C=t&&Object.hasOwn(t,E)?t[E]:void 0;if(C){let P=y[1];if(typeof P!="number"&&(P=n.push(y[1])-1),c??=new Set,c.has(P))throw new Error("Invalid circular reference");return c.add(P),i[m]=C(h(P)),c.delete(P),i[m]}switch(E){case"Date":i[m]=new Date(y[1]);break;case"Set":const P=new Set;i[m]=P;for(let V=1;V<y.length;V+=1)P.add(h(y[V]));break;case"Map":const L=new Map;i[m]=L;for(let V=1;V<y.length;V+=2)L.set(h(y[V]),h(y[V+1]));break;case"RegExp":i[m]=new RegExp(y[1],y[2]);break;case"Object":{const V=y[1];if(typeof n[V]=="object"&&n[V][0]!=="BigInt")throw new Error("Invalid input");i[m]=Object(h(V));break}case"BigInt":i[m]=BigInt(y[1]);break;case"null":const D=Object.create(null);i[m]=D;for(let V=1;V<y.length;V+=2){if(y[V]==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");D[y[V]]=h(y[V+1])}break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Float16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":case"DataView":{if(n[y[1]][0]!=="ArrayBuffer")throw new Error("Invalid data");const V=globalThis[E],U=h(y[1]);i[m]=y[2]!==void 0?new V(U,y[2],y[3]):new V(U);break}case"ArrayBuffer":{const V=y[1];if(typeof V!="string")throw new Error("Invalid ArrayBuffer encoding");const U=RJ(V);i[m]=U;break}case"Temporal.Duration":case"Temporal.Instant":case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.PlainMonthDay":case"Temporal.PlainYearMonth":case"Temporal.ZonedDateTime":{const V=E.slice(9);i[m]=Temporal[V].from(y[1]);break}case"URL":{const V=new URL(y[1]);i[m]=V;break}case"URLSearchParams":{const V=new URLSearchParams(y[1]);i[m]=V;break}default:throw new Error(`Unknown type ${E}`)}}else if(y[0]===wJ){const E=y[1];if(!TJ(E))throw new Error("Invalid input");const C=[];i[m]=C,C[dR]=void 0,delete C[dR];for(let P=2;P<y.length;P+=2){const L=y[P];if(!SJ(L)||L>=E)throw new Error("Invalid input");C[L]=h(y[P+1])}C.length=E}else{const E=new Array(y.length);i[m]=E;for(let C=0;C<y.length;C+=1){const P=y[C];P!==_J&&(E[C]=h(P))}}else{const E={};i[m]=E;for(const C of Object.keys(y)){if(C==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");const P=y[C];E[C]=h(P)}}return i[m]}return h(0)}const LJ=new Set(["link","style","script","noscript"]),OJ=new Set(["title","titleTemplate","script","style","noscript"]),hR=new Set(["base","meta","link","style","script","noscript"]),DJ=new Set(["title","base","htmlAttrs","bodyAttrs","meta","link","style","script","noscript"]),FJ=new Set(["base","title","titleTemplate","bodyAttrs","htmlAttrs","templateParams"]),BJ=new Set(["key","tagPosition","tagPriority","tagDuplicateStrategy","innerHTML","textContent","processTemplateParams"]),zJ=new Set(["templateParams","htmlAttrs","bodyAttrs"]),SM=new Set(["theme-color","google-site-verification","og","article","book","profile","twitter","author"]),Kb={META:new Set(["twitter"]),OG:new Set(["og","book","article","profile","fb"]),MEDIA:new Set(["ogImage","ogVideo","ogAudio","twitterImage"]),HTTP_EQUIV:new Set(["contentType","defaultStyle","xUaCompatible"])},NJ={articleExpirationTime:"article:expiration_time",articleModifiedTime:"article:modified_time",articlePublishedTime:"article:published_time",bookReleaseDate:"book:release_date",fbAppId:"fb:app_id",ogAudioSecureUrl:"og:audio:secure_url",ogAudioUrl:"og:audio",ogImageSecureUrl:"og:image:secure_url",ogImageUrl:"og:image",ogSiteName:"og:site_name",ogVideoSecureUrl:"og:video:secure_url",ogVideoUrl:"og:video",profileFirstName:"profile:first_name",profileLastName:"profile:last_name",profileUsername:"profile:username",msapplicationConfig:"msapplication-Config",msapplicationTileColor:"msapplication-TileColor",msapplicationTileImage:"msapplication-TileImage"},J$={appleItunesApp:{unpack:{entrySeparator:", ",resolve:({key:e,value:t})=>`${oh(e)}=${t}`}},refresh:{metaKey:"http-equiv",unpack:{entrySeparator:";",resolve:({key:e,value:t})=>e==="seconds"?`${t}`:void 0}},robots:{unpack:{entrySeparator:", ",resolve:({key:e,value:t})=>typeof t=="boolean"?oh(e):`${oh(e)}:${t}`}},contentSecurityPolicy:{metaKey:"http-equiv",unpack:{entrySeparator:"; ",resolve:({key:e,value:t})=>`${oh(e)} ${t}`}},charset:{}};function oh(e){const t=e.replace(/([A-Z])/g,"-$1").toLowerCase(),n=t.indexOf("-");return n===-1?t:Kb.META.has(t.slice(0,n))||Kb.OG.has(t.slice(0,n))?e.replace(/([A-Z])/g,":$1").toLowerCase():t}function Q$(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>String(n)!=="false"&&t))}function fR(e){return Array.isArray(e)?e.map(fR):!e||typeof e!="object"?e:Object.fromEntries(Object.entries(e).map(([t,n])=>[oh(t),fR(n)]))}function e6(e,t={}){const{entrySeparator:n="",keyValueSeparator:i="",wrapValue:c,resolve:h}=t;return Object.entries(e).map(([m,a])=>{if(h){const E=h({key:m,value:a});if(E!==void 0)return E}const y=typeof a=="object"?e6(a,t):typeof a=="number"?a.toString():typeof a=="str
4ing"&&c?`${c}${a.replace(new RegExp(c,"g"),`\\${c}`)}${c}`:a;return`${m}${i}${y}`}).join(n)}function v3(e,t){const n=Q$(t),i=oh(e),c=t6(i);if(!SM.has(i))return[{[c]:i,...n}];const h=Object.fromEntries(Object.entries(n).map(([m,a])=>[`${e}${m==="url"?"":`${m[0].toUpperCase()}${m.slice(1)}`}`,a]));return TE(h||{}).sort((m,a)=>(m[c]?.length||0)-(a[c]?.length||0))}function t6(e){if(J$[e]?.metaKey==="http-equiv"||Kb.HTTP_EQUIV.has(e))return"http-equiv";const t=oh(e),n=t.indexOf(":");return n===-1?"name":Kb.OG.has(t.slice(0,n))?"property":"name"}function VJ(e){return NJ[e]||oh(e)}function UJ(e,t){return t==="refresh"?`${e.seconds};url=${e.url}`:e6(fR(e),{keyValueSeparator:"=",entrySeparator:", ",resolve:({value:n,key:i})=>n===null?"":typeof n=="boolean"?i:void 0,...J$[t]?.unpack})}function TE(e){const t=[],n={};for(const[c,h]of Object.entries(e)){if(Array.isArray(h)){if(c==="themeColor"){h.forEach(m=>{typeof m=="object"&&m!==null&&t.push({name:"theme-color",...m})});continue}for(const m of h)if(typeof m=="object"&&m!==null){const a=[],y=[];for(const[E,C]of Object.entries(m)){const P=`${c}${E==="url"?"":`:${E}`}`,L=TE({[P]:C});(E==="url"?a:y).push(...L)}t.push(...a,...y)}else t.push(...typeof m=="string"?TE({[c]:m}):v3(c,m));continue}if(typeof h=="object"&&h)if(Kb.MEDIA.has(c)){const m=c.startsWith("twitter")?"twitter":"og",a=c.replace(/^(og|twitter)/,"").toLowerCase(),y=m==="twitter"?"name":"property";h.url&&t.push({[y]:`${m}:${a}`,content:h.url}),h.secureUrl&&t.push({[y]:`${m}:${a}:secure_url`,content:h.secureUrl});for(const[E,C]of Object.entries(h))E!=="url"&&E!=="secureUrl"&&t.push({[y]:`${m}:${a}:${E}`,content:C})}else SM.has(oh(c))?t.push(...v3(c,h)):n[c]=Q$(h);else n[c]=h}const i=Object.entries(n).map(([c,h])=>{if(c==="charset")return{charset:h===null?"_null":h};const m=t6(c),a=VJ(c),y=h===null?"_null":typeof h=="object"?UJ(h,c):typeof h=="number"?h.toString():h;return m==="http-equiv"?{"http-equiv":a,content:y}:{[m]:a,content:y}});return[...t,...i].map(c=>"content"in c&&c.content==="_null"?{...c,content:null}:c)}const $J={key:"flatMeta",hooks:{"entries:normalize":e=>{const t=[];e.tags=e.tags.map(n=>n.tag!=="_flatMeta"?n:(t.push(TE(n.props).map(i=>({...n,tag:"meta",props:i}))),!1)).filter(Boolean).concat(...t)}}},jJ=["name","property","http-equiv"],GJ=new Set(["viewport","description","keywords","robots"]);function n6(e){const t=e.split(":");return t.length?SM.has(t[1]):!1}function pR(e){const{props:t,tag:n}=e;if(FJ.has(n))return n;if(n==="link"&&t.rel==="canonical")return"canonical";if(n==="link"&&t.rel==="alternate"){if(t.hreflang)return`alternate:${t.hreflang}`;if(t.type)return`alternate:${t.type}:${t.href||""}`}if(t.charset)return"charset";if(e.tag==="meta"){for(const i of jJ)if(t[i]!==void 0){const c=t[i],h=c&&typeof c=="string"&&c.includes(":"),m=c&&GJ.has(c),y=!(h||m)&&e.key?`:key:${e.key}`:"";return`${n}:${c}${y}`}}if(e.key)return`${n}:key:${e.key}`;if(t.id)return`${n}:id:${t.id}`;if(n==="link"&&t.rel==="alternate")return`alternate:${t.href||""}`;if(OJ.has(n)){const i=e.textContent||e.innerHTML;if(i)return`${n}:content:${i}`}}function r6(e){const t=e._h||e._d;if(t)return t;const n=e.textContent||e.innerHTML;return n||`${e.tag}:${Object.entries(e.props).map(([i,c])=>`${i}:${String(c)}`).join(",")}`}function EE(e,t,n){typeof e==="function"&&(!n||n!=="titleTemplate"&&!(n[0]==="o"&&n[1]==="n"))&&(e=e());const c=t?t(n,e):e;if(Array.isArray(c))return c.map(h=>EE(h,t));if(c?.constructor===Object){const h={};for(const m of Object.keys(c))h[m]=EE(c[m],t,m);return h}return c}function HJ(e,t){const n=e==="style"?new Map:new Set;function i(c){if(c==null||c===void 0)return;const h=String(c).trim();if(h)if(e==="style"){const[m,...a]=h.split(":").map(y=>y?y.trim():"");m&&a.length&&n.set(m,a.join(":"))}else h.split(" ").filter(Boolean).forEach(m=>n.add(m))}return typeof t=="string"?e==="style"?t.split(";").forEach(i):i(t):Array.isArray(t)?t.forEach(c=>i(c)):t&&typeof t=="object"&&Object.entries(t).forEach(([c,h])=>{h&&h!=="false"&&(e==="style"?n.set(String(c).trim(),String(h)):i(c))}),n}function i6(e,t){if(e.props=e.props||{},!t)return e;if(e.tag==="templateParams")return e.props=t,e;const n=hR.has(e.tag)||e.tag==="htmlAttrs"||e.tag==="bodyAttrs";return Object.entries(t).forEach(([i,c])=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;if(c===null){e.props[i]=null;return}if(i==="class"||i==="style"){e.props[i]=HJ(i,c);return}if(BJ.has(i)){if((i==="textContent"||i==="innerHTML")&&typeof c=="object"){let E=t.type;if(t.type||(E="application/json"),!E?.endsWith("json")&&E!=="speculationrules")return;t.type=E,e.props.type=E,e[i]=JSON.stringify(c)}else e[i]=c;return}const h=i.startsWith("data-"),m=n&&!h?i.toLowerCase():i,a=String(c),y=e.tag==="meta"&&m==="content";a==="true"||a===""?e.props[m]=h||y?a:!0:!c&&h&&a==="false"?e.props[m]="false":c!==void 0&&(e.props[m]=c)}),e}function WJ(e,t){const n=typeof t=="object"&&typeof t!="function"?t:{[e==="script"||e==="noscript"||e==="style"?"innerHTML":"textContent"]:t},i=i6({tag:e,props:{}},n);return i.key&&LJ.has(i.tag)&&(i.props["data-hid"]=i._h=i.key),i.tag==="script"&&typeof i.innerHTML=="object"&&(i.innerHTML=JSON.stringify(i.innerHTML),i.props.type=i.props.type||"application/json"),Array.isArray(i.props.content)?i.props.content.map(c=>({...i,props:{...i.props,content:c}})):i}function qJ(e,t){if(!e)return[];typeof e=="function"&&(e=e());const n=(c,h)=>{for(let m=0;m<t.length;m++)h=t[m](c,h);return h};e=n(void 0,e);const i=[];return e=EE(e,n),Object.entries(e||{}
4).forEach(([c,h])=>{if(h!==void 0)for(const m of Array.isArray(h)?h:[h])i.push(WJ(c,m))}),i.flat()}const b3=(e,t)=>e._w===t._w?e._p-t._p:e._w-t._w,x3={base:-10,title:10},XJ={critical:-8,high:-1,low:2},w3={meta:{"content-security-policy":-30,charset:-20,viewport:-15},link:{preconnect:20,stylesheet:60,preload:70,modulepreload:70,prefetch:90,"dns-prefetch":90,prerender:90},script:{async:30,defer:80,sync:50},style:{imported:40,sync:60}},ZJ=/@import/,Qv=e=>e===""||e===!0;function YJ(e,t){if(typeof t.tagPriority=="number")return t.tagPriority;let n=100;const i=XJ[t.tagPriority]||0,c=e.resolvedOptions.disableCapoSorting?{link:{},script:{},style:{}}:w3;if(t.tag in x3)n=x3[t.tag];else if(t.tag==="meta"){const h=t.props["http-equiv"]==="content-security-policy"?"content-security-policy":t.props.charset?"charset":t.props.name==="viewport"?"viewport":null;h&&(n=w3.meta[h])}else if(t.tag==="link"&&t.props.rel)n=c.link[t.props.rel];else if(t.tag==="script"){const h=String(t.props.type);Qv(t.props.async)?n=c.script.async:t.props.src&&!Qv(t.props.defer)&&!Qv(t.props.async)&&h!=="module"&&!h.endsWith("json")||t.innerHTML&&!h.endsWith("json")?n=c.script.sync:(Qv(t.props.defer)&&t.props.src&&!Qv(t.props.async)||h==="module")&&(n=c.script.defer)}else t.tag==="style"&&(n=t.innerHTML&&ZJ.test(t.innerHTML)?c.style.imported:c.style.sync);return(n||100)+i}function S3(e,t){const n=typeof t=="function"?t(e):t,i=n.key||String(e.plugins.size+1);e.plugins.get(i)||(e.plugins.set(i,n),e.hooks.addHooks(n.hooks||{}))}function KJ(e={}){const t=B$();t.addHooks(e.hooks||{});const n=!e.document,i=new Map,c=new Map,h=new Set,m={_entryCount:1,plugins:c,dirty:!1,resolvedOptions:e,hooks:t,ssr:n,entries:i,headEntries(){return[...i.values()]},use:a=>S3(m,a),push(a,y){const E={...y||{}};delete E.head;const C=E._index??m._entryCount++,P={_i:C,input:a,options:E},L={_poll(D=!1){m.dirty=!0,!D&&h.add(C),t.callHook("entries:updated",m)},dispose(){i.delete(C)&&m.invalidate()},patch(D){(!E.mode||E.mode==="server"&&n||E.mode==="client"&&!n)&&(P.input=D,i.set(C,P),L._poll())}};return L.patch(a),L},async resolveTags(){const a={tagMap:new Map,tags:[],entries:[...m.entries.values()]};for(await t.callHook("entries:resolve",a);h.size;){const L=h.values().next().value;h.delete(L);const D=i.get(L);if(D){const V={tags:qJ(D.input,e.propResolvers||[]).map(U=>Object.assign(U,D.options)),entry:D};await t.callHook("entries:normalize",V),D._tags=V.tags.map((U,W)=>(U._w=YJ(m,U),U._p=(D._i<<10)+W,U._d=pR(U),U._d||(U._h=r6(U)),U))}}let y=!1;a.entries.flatMap(L=>(L._tags||[]).map(D=>({...D,props:{...D.props}}))).sort(b3).reduce((L,D)=>{const V=D._d||D._h;if(!L.has(V))return L.set(V,D);const U=L.get(V);if((D?.tagDuplicateStrategy||(zJ.has(D.tag)?"merge":null)||(D.key&&D.key===U.key?"merge":null))==="merge"){const $={...U.props};Object.entries(D.props).forEach(([Y,X])=>$[Y]=Y==="style"?new Map([...U.props.style||new Map,...X]):Y==="class"?new Set([...U.props.class||new Set,...X]):X),L.set(V,{...D,props:$})}else D._p>>10===U._p>>10&&D.tag==="meta"&&n6(V)?(L.set(V,Object.assign([...Array.isArray(U)?U:[U],D],D)),y=!0):(D._w===U._w?D._p>U._p:D?._w<U?._w)&&L.set(V,D);return L},a.tagMap);const E=a.tagMap.get("title"),C=a.tagMap.get("titleTemplate");if(m._title=E?.textContent,C){const L=C?.textContent;if(m._titleTemplate=L,L){let D=typeof L=="function"?L(E?.textContent):L;
4typeof D=="string"&&!m.plugins.has("template-params")&&(D=D.replace("%s",E?.textContent||"")),E?D===null?a.tagMap.delete("title"):a.tagMap.set("title",{...E,textContent:D}):(C.tag="title",C.textContent=D)}}a.tags=Array.from(a.tagMap.values()),y&&(a.tags=a.tags.flat().sort(b3)),await t.callHook("tags:beforeResolve",a),await t.callHook("tags:resolve",a),await t.callHook("tags:afterResolve",a);const P=[];for(const L of a.tags){const{innerHTML:D,tag:V,props:U}=L;if(DJ.has(V)&&!(Object.keys(U).length===0&&!L.innerHTML&&!L.textContent)&&!(V==="meta"&&!U.content&&!U["http-equiv"]&&!U.charset)){if(V==="script"&&D){if(String(U.type).endsWith("json")){const W=typeof D=="string"?D:JSON.stringify(D);L.innerHTML=W.replace(/</g,"\\u003C")}else typeof D=="string"&&(L.innerHTML=D.replace(new RegExp(`</${V}`,"g"),`<\\/${V}`));L._d=pR(L)}P.push(L)}}return P},invalidate(){for(const a of i.values())h.add(a._i);m.dirty=!0,t.callHook("entries:updated",m)}};return(e?.plugins||[]).forEach(a=>S3(m,a)),m.hooks.callHook("init",m),e.init?.forEach(a=>a&&m.push(a)),m}const JJ=(e,t)=>qi(t)?ii(t):t,TM="usehead";function QJ(e){return{install(n){n.config.globalProperties.$unhead=e,n.config.globalProperties.$head=e,n.provide(TM,e)}}.install}function o6(){if(Wm()){const e=wo(TM);if(e)return e}throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.")}function s6(e,t={}){const n=t.head||o6();return n.ssr?n.push(e||{},t):eQ(n,e,t)}function eQ(e,t,n={}){const i=hn(!1);let c;return AU(()=>{const m=i.value?{}:EE(t,JJ);c?c.patch(m):c=e.push(m,n)}),Ds()&&(Ty(()=>{c.dispose()}),lM(()=>{i.value=!0}),aM(()=>{i.value=!1})),c}function tQ(e={},t={}){(t.head||o6()).use($J);const{title:i,titleTemplate:c,...h}=e;return s6({title:i,titleTemplate:c,_flatMeta:h},t)}function a6(e){const t=e||rr();return t.ssrContext?.head||t.runWithContext(()=>{if(Wm()){const n=wo(TM);if(!n)throw new Error("[nuxt] [unhead] Missing Unhead instance.");return n}})}function Cy(e,t={}){const n=t.head||a6(t.nuxt);return s6(e,{head:n,...t})}function nQ(e,t={}){const n=t.head||a6(t.nuxt);return tQ(e,{head:n,...t})}const rQ=(e,t)=>[],l6=e=>U$({},...rQ("",typeof e=="string"?e.toLowerCase():e).map(t=>t.data).reverse()),iQ=l6;let UT;function oQ(){let e;return e=$fetch(xM(`builds/meta/${Dl().app.buildId}.json`),{responseType:"json"}).then(t=>{if(!t||typeof t!="object"||!Array.isArray(t.prerendered))throw new Error("[nuxt] Received malformed app manifest. Ensure that `builds/meta/*.json` is served as JSON by your hosting/proxy and not rewritten to an HTML fallback.");return t}),UT=e,e.catch(t=>{UT===e&&(UT=void 0),console.error("[nuxt] Error fetching app manifest.",t)}),e}function c6(){return UT||oQ()}function u6(e){const t=typeof e=="string"?e:e.path;try{return iQ(t.toLowerCase())}catch(n){return console.error("[nuxt] Error matching route rules.",n),{}}}async function T3(e,t={}){return null}async function sQ(e){return null}let um=null;async function aQ(){if(um)return um;const e=document.getElementById("__NUXT_DATA__");if(!e)return{};const t=await lQ(e.textContent||""),n=e.dataset.src?await sQ(e.dataset.src):void 0;return um={...t,...n,...window.__NUXT__},um.config?.public&&(um.config.public=Fl(um.config.public)),um}async function lQ(e){return await kJ(e,rr()._payloadRevivers)}function d6(e,t){rr()._payloadRevivers[e]=t}const cQ=tJ(()=>{d6("skipHydrate",e=>{})});function E3(e){try{return JSON.parse(e)}catch{return e}}const uQ=[["NuxtError",e=>jf(e)],["EmptyShallowRef",e=>Vi(e==="_"?void 0:e==="0n"?BigInt(0):E3(e))],["EmptyRef",e=>hn(e==="_"?void 0:e==="0n"?BigInt(0):E3(e))],["ShallowRef",e=>Vi(e)],["ShallowReactive",e=>Zc(e)],["Ref",e=>hn(e)],["Reactive",e=>Fl(e)]],dQ=Ji({name:"nuxt:revive-payload:client",order:-30,async setup(e){let t,n;for(const[i,c]of uQ)d6(i,c);Object.assign(e.payload,([t,n]=$f(()=>e.runWithContext(aQ)),t=await t,n(),t)),delete window.__NUXT__}});async function EM(e,t={}){const n=t.document||e.resolvedOptions.document;if(!n||!e.dirty)return;const i={shouldRender:!0,tags:[]};if(await e.hooks.callHook("dom:beforeRender",i),!!i.shouldRender)return e._domUpdatePromise||(e._domUpdatePromise=new Promise(async c=>{const h=new Map,m=new Promise(D=>{e.resolveTags().then(V=>{D(V.map(U=>{const W=h.get(U._d)||0,$={tag:U,id:(W?`${U._d}:${W}`:U._d)||U._h,shouldRender:!0};return U._d&&n6(U._d)&&h.set(U._d,W+1),$}))})});let a=e._dom;if(!a){a={title:n.title,elMap:new Map().set("htmlAttrs",n.documentElement).set("bodyAttrs",n.body)};for(const D of["body","head"]){const V=n[D]?.children;for(const U of V){const W=U.tagName.toLowerCase();if(!hR.has(W))continue;const $=i6({tag:W,props:{}},{innerHTML:U.innerHTML,...U.getAttributeNames().reduce((Y,X)=>(Y[X]=U.getAttribute(X),Y),{})||{}});if($.key=U.getAttribute("data-hid")||void 0,$._d=pR($)||r6($),a.elMap.has($._d)){let Y=1,X=$._d;for(;a.elMap.has(X);)X=`${$._d}:${Y++}`;a.elMap.set(X,U)}else a.elMap.set($._d,U)}}}a.pendingSideEffects={...a.sideEffects},a.sideEffects={};function y(D,V,U){const W=`${D}:${V}`;a.sideEffects[W]=U,delete a.pendingSideEffects[W]}function E({id:D,$el:V,tag:U}){const W=U.tag.endsWith("Attrs");a.elMap.set(D,V),W||(U.textContent&&U.textContent!==V.textContent&&(V.textContent=U.textContent),U.innerHTML&&U.innerHTML!==V.innerHTML&&(V.innerHTML=U.innerHTML),y(D,"el",()=>{V?.remove(),a.elMap.delete(D)}));for(const $ in U.props){if(!Object.prototype.hasOwnProperty.call(U.props,$))continue;const Y=U.props[$];if($.startsWith("on")&&typeof Y=="function"){const K=V?.dataset;if(K&&K[`${$}fired`]){const ne=$.slice(0,-5);Y.call(V,new Event(ne.substring(2)))}V.getAttribute(`data-${$}`)!==""&&((U.tag==="bodyAttrs"?n.defaultView:V).addEventListener($.substring(2),Y.bind(V)),V.setAttribute(`data-${$}`,""));continue}const X=`attr:${$}`;if($==="class"){if(!Y)continue;for(const K of Y)W&&y(D,`${X}:${K}`,()=>V.classList.remove(K)),!V.classList.contains(K)&&V.classList.add(K)}else if($==="style"){if(!Y)continue;for(const[K,ne]of Y)y(D,`${X}:${K}`,()=>{V.style.removeProperty(K)}),V.style.setProperty(K,ne)}else Y!==!1&&Y!==null&&(V.getAttribute($)!==Y&&V.setAttribute($,Y===!0?"":String(Y)),W&&y(D,X,()=>V.removeAttribute($)))}}const C=[],P={bodyClose:void 0,bodyOpen:void 0,head:void 0},L=await m;for(const D of L){const{tag:V,shouldRender:U,id:W}=D;if(U){if(V.tag==="title"){n.title=V.textContent,y("title","",()=>n.title=a.title);continue}D.$el=D.$el||a.elMap.get(W),D.$el?E(D):hR.has(V.tag)&&C.push(D)}}for(const D of C){const V=D.tag.tagPosition||"head";D.$el=n.createElement(D.tag.tag),E(D),P[V]=P[V]||n.createDocumentFragment(),P[V].appendChild(D.$el)}for(const D of L)await e.hooks.callHook("dom:renderTag",D,n,y);P.head&&n.head.appendChild(P.head),P.bodyOpen&&n.body.insertBefore(P.bodyOpen,n.body.firstChild),P.bodyClose&&n.body.appendChild(P.bodyClose);for(const D in a.pendingSideEffects)a.pendingSideEffects[D]();e._dom=a,await e.hooks.callHook("dom:rendered",{renders:L}),c()}).finally(()=>{e._domUpdatePromise=void 0,e.dirty=!1})),e._domUpdatePromise}
4function hQ(e={}){const t=e.domOptions?.render||EM;e.document=e.document||(typeof window<"u"?document:void 0);const n=e.document?.head.querySelector('script[id="unhead:payload"]')?.innerHTML||!1;return KJ({...e,plugins:[...e.plugins||[],{key:"client",hooks:{"entries:updated":t}}],init:[n?JSON.parse(n):!1,...e.init||[]]})}function fQ(e,t){let n=0;return()=>{const i=++n;t(()=>{n===i&&e()})}}function pQ(e={}){const t=hQ({domOptions:{render:fQ(()=>EM(t),n=>setTimeout(n,0))},...e});return t.install=QJ(t),t}const mQ={disableDefaults:!0},gQ=Ji({name:"nuxt:head",enforce:"pre",setup(e){const t=pQ(mQ);e.vueApp.use(t);{let n=!0;const i=async()=>{n=!1,await EM(t)};t.hooks.hook("dom:beforeRender",h=>{h.shouldRender=!n}),e.hooks.hook("page:start",()=>{n=!0}),e.hooks.hook("page:finish",()=>{e.isHydrating||i()}),e.hooks.hook("app:error",i),e.hooks.hook("app:suspense:resolve",i);const c=t.push.bind(t);t.push=((h,m)=>{const a=c(h,m),y=a.dispose.bind(a);return a.dispose=()=>{const E=e["~transitionPromise"];E?E.then(y):y()},a})}}});const O_=typeof document<"u";function h6(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function _Q(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&h6(e.default)}const Fi=Object.assign;function LI(e,t){const n={};for(const i in t){const c=t[i];n[i]=iu(c)?c.map(e):e(c)}return n}const Lb=()=>{},iu=Array.isArray;function C3(e,t){const n={};for(const i in e)n[i]=i in t?t[i]:e[i];return n}const f6=Symbol("");function uy(e,t){return Fi(new Error,{type:e,[f6]:!0},t)}function Hd(e,t){return e instanceof Error&&f6 in e&&(t==null||!!(e.type&t))}const CM=Symbol(""),A3=Symbol(""),TC=Symbol(""),AM=Symbol(""),mR=Symbol("");function WLe(){return wo(TC)}function p6(e){return wo(AM)}const yQ={trailing:!0};function vQ(e,t=25,n={}){if(n={...yQ,...n},!Number.isFinite(t))throw new TypeError("Expected `wait` to be a finite number");let i,c,h=[],m,a;const y=(P,L)=>(m=bQ(e,P,L),m.finally(()=>{if(m=null,n.trailing&&a&&!c){const D=y(P,a);return a=null,D}}),m),E=function(...P){return n.trailing&&(a=P),m||new Promise(L=>{const D=!c&&n.leading;clearTimeout(c),c=setTimeout(()=>{c=null;const V=n.leading?i:y(this,P);a=null;for(const U of h)U(V);h=[]},t),D?(i=y(this,P),L(i)):h.push(L)})},C=P=>{P&&(clearTimeout(P),c=null)};return E.isPending=()=>!!c,E.cancel=()=>{C(c),h=[],a=null},E.flush=()=>
vendor: 5,816 bytes, line 4
4{if(C(c),!a||m)return;const P=a;return a=null,y(this,P)},E}async function bQ(e,t,n){return await e.apply(t,n)}const m6=/#/g,xQ=/&/g,wQ=/\//g,SQ=/=/g,TQ=/\?/g,g6=/\+/g,EQ=/%5B/g,CQ=/%5D/g,_6=/%5E/g,AQ=/%60/g,y6=/%7B/g,IQ=/%7C/g,v6=/%7D/g,PQ=/%20/g;function IM(e){return e==null?"":encodeURI(""+e).replace(IQ,"|").replace(EQ,"[").replace(CQ,"]")}function RQ(e){return IM(e).replace(y6,"{").replace(v6,"}").replace(_6,"^")}function gR(e){return IM(e).replace(g6,"%2B").replace(PQ,"+").replace(m6,"%23").replace(xQ,"%26").replace(AQ,"`").replace(y6,"{").replace(v6,"}").replace(_6,"^")}function kQ(e){return gR(e).replace(SQ,"%3D")}function MQ(e){return IM(e).replace(m6,"%23").replace(TQ,"%3F")}function LQ(e){return MQ(e).replace(wQ,"%2F")}function CE(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const OQ=/\/$/,DQ=e=>e.replace(OQ,"");function OI(e,t,n="/"){let i,c={},h="",m="";const a=t.indexOf("#");let y=t.indexOf("?");return y=a>=0&&y>a?-1:y,y>=0&&(i=t.slice(0,y),h=t.slice(y,a>0?a:t.length),c=e(h.slice(1))),a>=0&&(i=i||t.slice(0,a),m=t.slice(a,t.length)),i=NQ(i??t,n),{fullPath:i+h+m,path:i,query:c,hash:CE(m)}}function FQ(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function I3(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function BQ(e,t,n){const i=t.matched.length-1,c=n.matched.length-1;return i>-1&&i===c&&dy(t.matched[i],n.matched[c])&&b6(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function dy(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function b6(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!zQ(e[n],t[n]))return!1;return!0}function zQ(e,t){return iu(e)?P3(e,t):iu(t)?P3(t,e):(e&&e.valueOf())===(t&&t.valueOf())}function P3(e,t){return iu(t)?e.length===t.length&&e.every((n,i)=>n===t[i]):e.length===1&&e[0]===t}function NQ(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),i=e.split("/"),c=i[i.length-1];(c===".."||c===".")&&i.push("");let h=n.length-1,m,a;for(m=0;m<i.length;m++)if(a=i[m],a!==".")if(a==="..")h>1&&h--;else break;return n.slice(0,h).join("/")+"/"+i.slice(m).join("/")}const dc={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};function VQ(e){if(!e)if(O_){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),DQ(e)}const UQ=/^[^#]+#/;function $Q(e,t){return e.replace(UQ,"#")+t}function jQ(e,t){const n=document.documentElement.getBoundingClientRect(),i=e.getBoundingClientRect();return{behavior:t.behavior,left:i.left-n.left-(t.left||0),top:i.top-n.top-(t.top||0)}}const EC=()=>({left:window.scrollX,top:window.scrollY});function GQ(e){let t;if("el"in e){const n=e.el,i=typeof n=="string"&&n.startsWith("#"),c=typeof n=="string"?i?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!c)return;t=jQ(c,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function R3(e,t){return(history.state?history.state.position-t:-1)+e}const _R=new Map;function HQ(e,t){_R.set(e,t)}function WQ(e){const t=_R.get(e);return _R.delete(e),t}function qQ(e){return typeof e=="string"||e&&typeof e=="object"}function x6(e){return typeof e=="string"||typeof e=="symbol"}function XQ(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let i=0;i<n.length;++i){const c=n[i].replace(g6," "),h=c.indexOf("="),m=CE(h<0?c:c.slice(0,h)),a=h<0?null:CE(c.slice(h+1));if(m in t){let y=t[m];iu(y)||(y=t[m]=[y]),y.push(a)}else t[m]=a}return t}function k3(e){let t="";for(let n in e){const i=e[n];if(n=kQ(n),i==null){i!==void 0&&(t+=(t.length?"&":"")+n);continue}(iu(i)?i.map(c=>c&&gR(c)):[i&&gR(i)]).forEach(c=>{c!==void 0&&(t+=(t.length?"&":"")+n,c!=null&&(t+="="+c))})}return t}function ZQ(e){const t={};for(const n in e){const i=e[n];i!==void 0&&(t[n]=iu(i)?i.map(c=>c==null?null:""+c):i==null?i:""+i)}return t}function eb(){let e=[];function t(i){return e.push(i),()=>{const c=e.indexOf(i);c>-1&&e.splice(c,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function w6(e,t,n){const i=e.value;if(!i)return;let c=i;const h=()=>{c[t].delete(n)};Ey(h),lM(h),aM(()=>{const m=e.value;m&&(c=m),c[t].add(n)}),c[t].add(n)}function qLe(e){w6(wo(CM,{}),"leaveGuards",e)}function XLe(e){w6(wo(CM,{}),"updateGuards",e)}function Rf(e,t,n,i,c,h=m=>m()){const m=i&&(i.enterCallbacks[c]=i.enterCallbacks[c]||[]);return()=>new Promise((a,y)=>{const E=L=>{L===!1?y(uy(4,{from:n,to:t})):L instanceof Error?y(L):qQ(L)?y(uy(2,{from:t,to:L})):(m&&i.enterCallbacks[c]===m&&typeof L=="function"&&m.push(L),a())},C=h(()=>e.call(i&&i.instances[c],t,n,E));let P=Promise.resolve(C);e.length<3&&(P=P.then(E)),P.catch(L=>y(L))})}function DI(e,t,n,i,c=h=>h()){const h=[];for(const m of e)for(const a in m.components){let y=m.components[a];if(!(t!=="beforeRouteEnter"&&!m.instances[a]))if(h6(y)){const E=(y.__vccOpts||y)[t];E&&h.push(Rf(E,n,i,m,a,c))}else{let E=y();h.push(()=>E.then(C=>{if(!C)throw new Error(`Couldn't resolve component "${a}" at "${m.path}"`);const P=_Q(C)?C.default:C;m.mods[a]=C,m.components[a]=P;const L=(P.__vccOpts||P)[t];return L&&Rf(L,n,i,m,a,c)()}))}}return h}function YQ(e,t){const n=[],i=[],c=[],h=Math.max(t.matched.length,e.matched.length);for(let m=0;m<h;m++){const a=t.matched[m];a&&(e.matched.find(E=>dy(E,a))?i.push(a):n.push(a));const y=e.matched[m];y&&(t.matched.find(E=>dy(E,y))||c.push(y))}return[n,i,c]}let KQ=()=>location.protocol+"//"+location.host;function S6(e,t){const{pathname:n,search:i,hash:c}=t,h=e.indexOf("#");if(h>-1){let m=c.includes(e.slice(h))?e.slice(h).length:1,a=c.slice(m);
4return a[0]!=="/"&&(a="/"+a),I3(a,"")}return I3(n,e)+i+c}function JQ(e,t,n,i){let c=[],h=[],m=null;const a=({state:L})=>{const D=S6(e,location),V=n.value,U=t.value;let W=0;if(L){if(n.value=D,t.value=L,m&&m===V){m=null;return}W=U?L.position-U.position:0}else i(D);c.forEach($=>{$(n.value,V,{delta:W,type:"pop",direction:W?W>0?"forward":"back":""})})};function y(){m=n.value}function E(L){c.push(L);const D=()=>{const V=c.indexOf(L);V>-1&&c.splice(V,1)};return h.push(D),D}function C(){if(document.visibilityState==="hidden"){const{history:L}=window;if(!L.state)return;L.replaceState(Fi({},L.state,{scroll:EC()}),"")}}function P(){for(const L of h)L();h=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",C),document.removeEventListener("visibilitychange",C)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",C),document.addEventListener("visibilitychange",C),{pauseListeners:y,listen:E,destroy:P}}function M3(e,t,n,i=!1,c=!1){return{back:e,current:t,forward:n,replaced:i,position:window.history.length,scroll:c?EC():null}}function QQ(e){const{history:t,location:n}=window,i={value:S6(e,n)},c={value:t.state};c.value||h(i.value,{back:null,current:i.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function h(y,E,C){const P=e.indexOf("#"),L=P>-1?(n.host&&document.querySelector("base")?e:e.slice(P))+y:KQ()+e+y;try{t[C?"replaceState":"pushState"](E,"",L),c.value=E}catch(D){console.error(D),n[C?"replace":"assign"](L)}}function m(y,E){h(y,Fi({},t.state,M3(c.value.back,y,c.value.forward,!0),E,{position:c.value.position}),!0),i.value=y}function a(y,E){const C=Fi({},c.value,t.state,{forward:y,scroll:EC()});h(C.current,C,!0),h(y,Fi({},M3(i.value,y,null),{position:C.position+1},E),!1),i.value=y}return{location:i,state:c,push:a,replace:m}}function eee(e){e=VQ(e);const t=QQ(e),n=JQ(e,t.state,t.location,t.replace);function i(h,m=!0){m||n.pauseListeners(),history.go(h)}const c=Fi({location:"",base:e,go:i,createHref:$Q.bind(null,e)},t,n);return Object.defineProperty(c,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(c,"state",{enumerable:!0,get:()=>t.state.value}),c}const tee={type:0,value:""},nee=/[a-zA-Z0-9_]/;function ree(e){if(!e)return[[]];if(e==="/")return[[tee]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(D){throw new Error(`ERR (${n})/"${E}": ${D}`)}let n=0,i=n;const c=[];let h;function m(){h&&c.push(h),h=[]}let a=0,y,E="",C="";function P(){E&&(n===0?h.push({type:0,value:E}):n===1||n===2||n===3?(h.length>1&&(y==="*"||y==="+")&&t(`A repeatable param (${E}) must be alone in its segment. eg: '/:ids+.`),h.push({type:1,value:E,regexp:C,repeatable:y==="*"||y==="+",optional:y==="*"||y==="?"})):t("Invalid state to consume buffer"),E="")}function L(){E+=y}for(;a<e.length;)switch(y=e[a++],n){case 0:y==="\\"?(i=n,n=4):y==="/"?(E&&P(),m()):y===":"?(P(),n=1):L();break;case 4:L(),n=i;break;case 1:y==="("?n=2:nee.test(y)?L():(P(),n=0,y!=="*"&&y!=="?"&&y!=="+"&&a--);break;case 2:y===")"?C[C.length-1]=="\\"?C=C.slice(0,-1)+y:n=3:C+=y;break;case 3:P(),n=0,y!=="*"&&y!=="?"&&y!=="+"&&a--,C="";break;default:t("Unknown state");break}return n===2&&t(`Unfinished custom RegExp for param "${E}"`),P(),m(),c}const L3="[^/]+?",iee={sensitive:!1,strict:!1,start:!0,end:!0},oee=/[.+*?^${}()[\]/\\]/g;function see(e,t){const n=Fi({},iee,t),i=[];let c=n.start?"^":"";const h=[];for(const E of e){const C=E.length?[]:[90];n.strict&&!E.length&&(c+="/");for(let P=0;P<E.length;P++){const L=E[P];let D=40+(n.sensitive?.25:0);if(L.type===0)P||(c+="/"),c+=L.value.replace(oee,"\\$&"),D+=40;else if(L.type===1){const{value:V,repeatable:U,optional:W,regexp:$}=L;h.push({name:V,repeatable:U,optional:W});const Y=$||L3;if(Y!==L3){D+=10;try{new RegExp(`(${Y})`)}catch(K){throw new Error(`Invalid custom RegExp for param "${V}" (${Y}): `+K.message)}}let X=U?`((?:${Y})(?:/(?:${Y}))*)`:`(${Y})`;P||(X=W&&E.length<2?`(?:/${X})`:"/"+X),W&&(X+="?"),c+=X,D+=20,W&&(D+=-8),U&&(D+=-20),Y===".*"&&(D+=-50)}C.push(D)}i.push(C)}if(n.strict&&n.end){const E=i.length-1;i[E][i[E].length-1]+=.7000000000000001}n.strict||(c+="/?"),n.end?c+="$":n.strict&&!c.endsWith("/")&&(c+="(?:/|$)");const m=new RegExp(c,n.sensitive?"":"i");function a(E){const C=E.match(m),P={};if(!C)return null;for(let L=1;L<C.length;L++){const D=C[L]||"",V=h[L-1];P[V.name]=D&&V.repeatable?D.split("/"):D}return P}function y(E){let C="",P=!1;for(const L of e){(!P||!C.endsWith("/"))&&(C+="/"),P=!1;for(const D of L)if(D.type===0)C+=D.value;else if(D.type===1){const{value:V,repeatable:U,optional:W}=D,$=V in E?E[V]:"";if(iu($)&&!U)throw new Error(`Provided param "${V}" is an array but it is not repeatable (* or + modifiers)`);const Y=iu($)?$.join("/"):$;if(!Y)if(W)L.length<2&&(C.endsWith("/")?C=C.slice(0,-1):P=!0);else throw new Error(`Missing required param "${V}"`);C+=Y}}
vendor: 10,377 bytes, line 4
4return C||"/"}return{re:m,score:i,keys:h,parse:a,stringify:y}}function aee(e,t){let n=0;for(;n<e.length&&n<t.length;){const i=t[n]-e[n];if(i)return i;n++}return e.length<t.length?e.length===1&&e[0]===80?-1:1:e.length>t.length?t.length===1&&t[0]===80?1:-1:0}function T6(e,t){let n=0;const i=e.score,c=t.score;for(;n<i.length&&n<c.length;){const h=aee(i[n],c[n]);if(h)return h;n++}if(Math.abs(c.length-i.length)===1){if(O3(i))return 1;if(O3(c))return-1}return c.length-i.length}function O3(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const lee={strict:!1,end:!0,sensitive:!1};function cee(e,t,n){const i=see(ree(e.path),n),c=Fi(i,{record:e,parent:t,children:[],alias:[]});return t&&!c.record.aliasOf==!t.record.aliasOf&&t.children.push(c),c}function uee(e,t){const n=[],i=new Map;t=C3(lee,t);function c(P){return i.get(P)}function h(P,L,D){const V=!D,U=F3(P);U.aliasOf=D&&D.record;const W=C3(t,P),$=[U];if("alias"in P){const K=typeof P.alias=="string"?[P.alias]:P.alias;for(const ne of K)$.push(F3(Fi({},U,{components:D?D.record.components:U.components,path:ne,aliasOf:D?D.record:U})))}let Y,X;for(const K of $){const{path:ne}=K;if(L&&ne[0]!=="/"){const fe=L.record.path,ye=fe[fe.length-1]==="/"?"":"/";K.path=L.record.path+(ne&&ye+ne)}if(Y=cee(K,L,W),D?D.alias.push(Y):(X=X||Y,X!==Y&&X.alias.push(Y),V&&P.name&&!B3(Y)&&m(P.name)),E6(Y)&&y(Y),U.children){const fe=U.children;for(let ye=0;ye<fe.length;ye++)h(fe[ye],Y,D&&D.children[ye])}D=D||Y}return X?()=>{m(X)}:Lb}function m(P){if(x6(P)){const L=i.get(P);L&&(i.delete(P),n.splice(n.indexOf(L),1),L.children.forEach(m),L.alias.forEach(m))}else{const L=n.indexOf(P);L>-1&&(n.splice(L,1),P.record.name&&i.delete(P.record.name),P.children.forEach(m),P.alias.forEach(m))}}function a(){return n}function y(P){const L=fee(P,n);n.splice(L,0,P),P.record.name&&!B3(P)&&i.set(P.record.name,P)}function E(P,L){let D,V={},U,W;if("name"in P&&P.name){if(D=i.get(P.name),!D)throw uy(1,{location:P});W=D.record.name,V=Fi(D3(L.params,D.keys.filter(X=>!X.optional).concat(D.parent?D.parent.keys.filter(X=>X.optional):[]).map(X=>X.name)),P.params&&D3(P.params,D.keys.map(X=>X.name))),U=D.stringify(V)}else if(P.path!=null)U=P.path,D=n.find(X=>X.re.test(U)),D&&(V=D.parse(U),W=D.record.name,D.keys.forEach(X=>{X.optional&&!V[X.name]&&delete V[X.name]}));else{if(D=L.name?i.get(L.name):n.find(X=>X.re.test(L.path)),!D)throw uy(1,{location:P,currentLocation:L});W=D.record.name,V=Fi({},L.params,P.params),U=D.stringify(V)}const $=[];let Y=D;for(;Y;)$.unshift(Y.record),Y=Y.parent;return{name:W,path:U,params:V,matched:$,meta:hee($)}}e.forEach(P=>h(P));function C(){n.length=0,i.clear()}return{addRoute:h,resolve:E,removeRoute:m,clearRoutes:C,getRoutes:a,getRecordMatcher:c}}function D3(e,t){const n={};for(const i of t)i in e&&(n[i]=e[i]);return n}function F3(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:dee(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function dee(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const i in e.components)t[i]=typeof n=="object"?n[i]:n;return t}function B3(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function hee(e){return e.reduce((t,n)=>Fi(t,n.meta),{})}function fee(e,t){let n=0,i=t.length;for(;n!==i;){const h=n+i>>1;T6(e,t[h])<0?i=h:n=h+1}const c=pee(e);return c&&(i=t.lastIndexOf(c,i-1)),i}function pee(e){let t=e;for(;t=t.parent;)if(E6(t)&&T6(e,t)===0)return t}function E6({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function z3(e){const t=wo(TC),n=wo(AM),i=vn(()=>{const y=Ar(e.to);return t.resolve(y)}),c=vn(()=>{const{matched:y}=i.value,{length:E}=y,C=y[E-1],P=n.matched;if(!C||!P.length)return-1;const L=P.findIndex(dy.bind(null,C));if(L>-1)return L;const D=N3(y[E-2]);return E>1&&N3(C)===D&&P[P.length-1].path!==D?P.findIndex(dy.bind(null,y[E-2])):L}),h=vn(()=>c.value>-1&&yee(n.params,i.value.params)),m=vn(()=>c.value>-1&&c.value===n.matched.length-1&&b6(n.params,i.value.params));function a(y={}){if(_ee(y)){const E=t[Ar(e.replace)?"replace":"push"](Ar(e.to)).catch(Lb);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>E),E}return Promise.resolve()}return{route:i,href:vn(()=>i.value.href),isActive:h,isExactActive:m,navigate:a}}function mee(e){return e.length===1?e[0]:e}const gee=Ys({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:z3,setup(e,{slots:t}){const n=Fl(z3(e)),{options:i}=wo(TC),c=vn(()=>({[V3(e.activeClass,i.linkActiveClass,"router-link-active")]:n.isActive,[V3(e.exactActiveClass,i.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const h=t.default&&mee(t.default(n));return e.custom?h:Io("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:c.value},h)}}});function _ee(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function yee(e,t){for(const n in t){const i=t[n],c=e[n];if(typeof i=="string"){if(i!==c)return!1}else if(!iu(c)||c.length!==i.length||i.some((h,m)=>h.valueOf()!==c[m].valueOf()))return!1}return!0}function N3(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const V3=(e,t,n)=>e??t??n,vee=Ys({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const i=wo(mR),c=vn(()=>e.route||i.value),h=wo(A3,0),m=vn(()=>{let E=Ar(h);const{matched:C}=c.value;let P;for(;(P=C[E])&&!P.components;)E++;return E}),a=vn(()=>c.value.matched[m.value]);fh(A3,vn(()=>m.value+1)),fh(CM,a),fh(mR,c);const y=hn();return qr(()=>[y.value,a.value,e.name],([E,C,P],[L,D,V])=>{C&&(C.instances[P]=E,D&&D!==C&&E&&E===L&&(C.leaveGuards.size||(C.leaveGuards=D.leaveGuards),C.updateGuards.size||(C.updateGuards=D.updateGuards))),E&&C&&(!D||!dy(C,D)||!L)&&(C.enterCallbacks[P]||[]).forEach(U=>U(E))},{flush:"post"}),()=>{const E=c.value,C=e.name,P=a.value,L=P&&P.components[C];if(!L)return U3(n.default,{Component:L,route:E});const D=P.props[C],V=D?D===!0?E.params:typeof D=="function"?D(E):D:null,W=Io(L,Fi({},V,t,{onVnodeUnmounted:$=>{$.component.isUnmounted&&(P.instances[C]=null)},ref:y}));return U3(n.default,{Component:W,route:E})||W}}});function U3(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const C6=vee;function bee(e){const t=uee(e.routes,e),n=e.parseQuery||XQ,i=e.stringifyQuery||k3,c=e.history,h=eb(),m=eb(),a=eb(),y=Vi(dc);let E=dc;O_&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const C=LI.bind(null,$t=>""+$t),P=LI.bind(null,LQ),L=LI.bind(null,CE);function D($t,fn){let yn,Cn;return x6($t)?(yn=t.getRecordMatcher($t),Cn=fn):Cn=$t,t.addRoute(Cn,yn)}function V($t){const fn=t.getRecordMatcher($t);fn&&t.removeRoute(fn)}function U(){return t.getRoutes().map($t=>$t.record)}function W($t){return!!t.getRecordMatcher($t)}function $($t,fn){if(fn=Fi({},fn||y.value),typeof $t=="string"){const Xe=OI(n,$t,fn.path),mt=t.resolve({path:Xe.path},fn),kt=c.createHref(Xe.fullPath);return Fi(Xe,mt,{params:L(mt.params),redirectedFrom:void 0,href:kt})}let yn;if($t.path!=null)yn=Fi({},$t,{path:OI(n,$t.path,fn.path).path});else{const Xe=Fi({},$t.params);for(const mt in Xe)Xe[mt]==null&&delete Xe[mt];yn=Fi({},$t,{params:P(Xe)}),fn.params=P(fn.params)}const Cn=t.resolve(yn,fn),_n=$t.hash||"";Cn.params=C(L(Cn.params));const Bn=FQ(i,Fi({},$t,{hash:RQ(_n),path:Cn.path})),Be=c.createHref(Bn);return Fi({fullPath:Bn,hash:_n,query:i===k3?ZQ($t.query):$t.query||{}},Cn,{redirectedFrom:void 0,href:Be})}function Y($t){return typeof $t=="string"?OI(n,$t,y.value.path):Fi({},$t)}function X($t,fn){if(E!==$t)return uy(8,{from:fn,to:$t})}function K($t){return ye($t)}function ne($t){return K(Fi(Y($t),{replace:!0}))}function fe($t,fn){const yn=$t.matched[$t.matched.length-1];if(yn&&yn.redirect){const{redirect:Cn}=yn;let _n=typeof Cn=="function"?Cn($t,fn):Cn;return typeof _n=="string"&&(_n=_n.includes("?")||_n.includes("#")?_n=Y(_n):{path:_n},_n.params={}),Fi({query:$t.query,hash:$t.hash,params:_n.path!=null?{}:$t.params},_n)}}function ye($t,fn){const yn=E=$($t),Cn=y.value,_n=$t.state,Bn=$t.force,Be=$t.replace===!0,Xe=fe(yn,Cn);if(Xe)return ye(Fi(Y(Xe),{state:typeof Xe=="object"?Fi({},_n,Xe.state):_n,force:Bn,replace:Be}),fn||yn);const mt=yn;mt.redirectedFrom=fn;let kt;return!Bn&&BQ(i,Cn,yn)&&(kt=uy(16,{to:mt,from:Cn}),Mn(Cn,Cn,!0,!1)),(kt?Promise.resolve(kt):qe(mt,Cn)).catch(Vt=>Hd(Vt)?Hd(Vt,2)?Vt:sn(Vt):Wt(Vt,mt,Cn)).then(Vt=>{if(Vt){if(Hd(Vt,2))return ye(Fi({replace:Be},Y(Vt.to),{state:typeof Vt.to=="object"?Fi({},_n,Vt.to.state):_n,force:Bn}),fn||mt)}else Vt=pt(mt,Cn,!0,Be,_n);return lt(mt,Cn,Vt),Vt})}function ke($t,fn){const yn=X($t,fn);return yn?Promise.reject(yn):Promise.resolve()}function Fe($t){const fn=Ln.values().next().value;return fn&&typeof fn.runWithContext=="function"?fn.runWithContext($t):$t()}function qe($t,fn){let yn;const[Cn,_n,Bn]=YQ($t,fn);yn=DI(Cn.reverse(),"beforeRouteLeave",$t,fn);for(const Xe of Cn)Xe.leaveGuards.forEach(mt=>{yn.push(Rf(mt,$t,fn))});const Be=ke.bind(null,$t,fn);return yn.push(Be),Rn(yn).then(()=>{yn=[];for(const Xe of h.list())yn.push(Rf(Xe,$t,fn));return yn.push(Be),Rn(yn)}).then(()=>{yn=DI(_n,"beforeRouteUpdate",$t,fn);for(const Xe of _n)Xe.updateGuards.forEach(mt=>{yn.push(Rf(mt,$t,fn))});return yn.push(Be),Rn(yn)}).then(()=>{yn=[];for(const Xe of Bn)if(Xe.beforeEnter)if(iu(Xe.beforeEnter))for(const mt of Xe.beforeEnter)yn.push(Rf(mt,$t,fn));else yn.push(Rf(Xe.beforeEnter,$t,fn));return yn.push(Be),Rn(yn)}).then(()=>($t.matched.forEach(Xe=>Xe.enterCallbacks={}),yn=DI(Bn,"beforeRouteEnter",$t,fn,Fe),yn.push(Be),Rn(yn))).then(()=>{yn=[];for(const Xe of m.list())yn.push(Rf(Xe,$t,fn));return yn.push(Be),Rn(yn)}).catch(Xe=>Hd(Xe,8)?Xe:Promise.reject(Xe))}
4function lt($t,fn,yn){a.list().forEach(Cn=>Fe(()=>Cn($t,fn,yn)))}function pt($t,fn,yn,Cn,_n){const Bn=X($t,fn);if(Bn)return Bn;const Be=fn===dc,Xe=O_?history.state:{};yn&&(Cn||Be?c.replace($t.fullPath,Fi({scroll:Be&&Xe&&Xe.scroll},_n)):c.push($t.fullPath,_n)),y.value=$t,Mn($t,fn,yn,Be),sn()}let Qt;function Ht(){Qt||(Qt=c.listen(($t,fn,yn)=>{if(!Yn.listening)return;const Cn=$($t),_n=fe(Cn,Yn.currentRoute.value);if(_n){ye(Fi(_n,{replace:!0,force:!0}),Cn).catch(Lb);return}E=Cn;const Bn=y.value;O_&&HQ(R3(Bn.fullPath,yn.delta),EC()),qe(Cn,Bn).catch(Be=>Hd(Be,12)?Be:Hd(Be,2)?(ye(Fi(Y(Be.to),{force:!0}),Cn).then(Xe=>{Hd(Xe,20)&&!yn.delta&&yn.type==="pop"&&c.go(-1,!1)}).catch(Lb),Promise.reject()):(yn.delta&&c.go(-yn.delta,!1),Wt(Be,Cn,Bn))).then(Be=>{Be=Be||pt(Cn,Bn,!1),Be&&(yn.delta&&!Hd(Be,8)?c.go(-yn.delta,!1):yn.type==="pop"&&Hd(Be,20)&&c.go(-1,!1)),lt(Cn,Bn,Be)}).catch(Lb)}))}let zt=eb(),jt=eb(),Zt;function Wt($t,fn,yn){sn($t);const Cn=jt.list();return Cn.length?Cn.forEach(_n=>_n($t,fn,yn)):console.error($t),Promise.reject($t)}function en(){return Zt&&y.value!==dc?Promise.resolve():new Promise(($t,fn)=>{zt.add([$t,fn])})}function sn($t){return Zt||(Zt=!$t,Ht(),zt.list().forEach(([fn,yn])=>$t?yn($t):fn()),zt.reset()),$t}function Mn($t,fn,yn,Cn){const{scrollBehavior:_n}=e;if(!O_||!_n)return Promise.resolve();const Bn=!yn&&WQ(R3($t.fullPath,0))||(Cn||!yn)&&history.state&&history.state.scroll||null;return ts().then(()=>_n($t,fn,Bn)).then(Be=>Be&&GQ(Be)).catch(Be=>Wt(Be,$t,fn))}const xn=$t=>c.go($t);let Vn;const Ln=new Set,Yn={currentRoute:y,listening:!0,addRoute:D,removeRoute:V,clearRoutes:t.clearRoutes,hasRoute:W,getRoutes:U,resolve:$,options:e,push:K,replace:ne,go:xn,back:()=>xn(-1),forward:()=>xn(1),beforeEach:h.add,beforeResolve:m.add,afterEach:a.add,onError:jt.add,isReady:en,install($t){$t.component("RouterLink",gee),$t.component("RouterView",C6),$t.config.globalProperties.$router=Yn,Object.defineProperty($t.config.globalProperties,"$route",{enumerable:!0,get:()=>Ar(y)}),O_&&!Vn&&y.value===dc&&(Vn=!0,K(c.location).catch(Cn=>{}));const fn={};for(const Cn in dc)Object.defineProperty(fn,Cn,{get:()=>y.value[Cn],enumerable:!0});$t.provide(TC,Yn),$t.provide(AM,Zc(fn)),$t.provide(mR,y);const yn=$t.unmount;Ln.add($t),$t.unmount=function(){Ln.delete($t),Ln.size<1&&(E=dc,Qt&&Qt(),Qt=null,y.value=dc,Vn=!1,Zt=!1),yn()}}};function Rn($t){return $t.reduce((fn,yn)=>fn.then(()=>Fe(yn)),Promise.resolve())}return Yn}const xee=/(:\w+)\([^)]+\)/g,wee=/(:\w+)[?+*]/g,See=/:\w+/g,Tee=(e,t)=>t.path.replace(xee,"$1").replace(wee,"$1").replace(See,n=>e.params[n.slice(1)]?.toString()||""),yR=(e,t)=>{const n=e.route.matched.find(c=>c.components?.default===e.Component.type),i=t??n?.meta.key??(n&&Tee(e.route,n));return typeof i=="function"?i(e.route):i},Eee=(e,t)=>({default:()=>e?Io(cZ,e===!0?{}:e,t):t});function A6(e){return Array.isArray(e)?e:[e]}const Cee="modulepreload",Aee=function(e,t){return new URL(e,t).href},$3={},gt=function(t,n,i){let c=Promise.resolve();if(n&&n.length>0){let E=function(C){return Promise.all(C.map(P=>Promise.resolve(P).then(L=>({status:"fulfilled",value:L}),L=>({status:"rejected",reason:L}))))};const m=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),y=a?.nonce||a?.getAttribute("nonce");c=E(n.map(C=>{if(C=Aee(C,i),C in $3)return;$3[C]=!0;const P=C.endsWith(".css"),L=P?'[rel="stylesheet"]':"";if(i)for(let V=m.length-1;V>=0;V--){const U=m[V];if(U.href===C&&(!P||U.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${C}"]${L}`))return;const D=document.createElement("link");if(D.rel=P?"stylesheet":Cee,P||(D.as="script"),D.crossOrigin="",D.href=C,y&&D.setAttribute("nonce",y),document.head.appendChild(D),P)return new Promise((V,U)=>{D.addEventListener("load",V),D.addEventListener("error",()=>U(new Error(`Unable to preload CSS for ${C}`)))})}))}function h(m){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=m,window.dispatchEvent(a),!a.defaultPrevented)throw m}return c.then(m=>{for(const a of m||[])a.status==="rejected"&&h(a.reason);return t().catch(h)})};var tu;(e=>{(t=>{t.AR="ar",t.EN="en"})(e.Lang||(e.Lang={})),(t=>{t.DARK="dark",t.LIGHT="light",t.AUTO="system",t.LANDING_PAGE="landing_page"})(e.theme||(e.theme={})),(t=>{t.RTL="rtl",t.LTR="ltr"})(e.dir||(e.dir={}))})(tu||(tu={}));const FI={layout:"home",seoTitle:"SEO.pages.home.title",colorMode:tu.theme.LANDING_PAGE},j3={layout:"share",seoTitle:"SEO.pages.shared_chat.title"};var wh=(e=>(e.PASEET_CHAT="paseet-chat",e.TRANSACTIONS="paseet-transactions",e.TRANSACTIONS_FREEMIUM="paseet-transactions-freemium",e.PARCELS="paseet-parcels",e.RENTAL="paseet-rental",e.RENTAL_FREEMIUM="paseet-rental-freemium",e.DEMOGRAPHICS="paseet-demographics",e.VALUATION="paseet-valuation",e.REGULATIONS="paseet-regulations",e.PUBLIC_SERVICES="paseet-public-services",e.REIT="paseet-reit",e.OFFERS="paseet-offers",e.PASEET_EXPORT="paseet-export",e.PASEET_CHART="paseet-chart",e.PASEET_MULTI_MODEL="paseet-multi-model",e.PASEET_REGENERATE="paseet-regenerate",e.PASEET_CONSULTANT="paseet-consultant",e.PASEET_FULL_HISTORY="paseet-full-history",e.PASEET_COLLECTIONS="paseet-collections",e.PASEET_FILE_ATTACHMENT="paseet-file-attachment",e.PASEET_SUGGESTIONS="paseet-suggestions",e.PASEET_QUICK_INSIGHTS="paseet-quick-insights",e.PASEET_PROPERTY_EXPLORER="paseet-property-explorer",e))(wh||{});const G3={requiresPermission:wh.PASEET_PROPERTY_EXPLORER,layout:"app-wrapper",seoTitle:"SEO.pages.propertyExplorer.title"},H3={requiresPermission:wh.PASEET_PROPERTY_EXPLORER,layout:"app-wrapper",seoTitle:"SEO.pages.propertyExplorer.title"},W3={requiresPermission:wh.PASEET_PROPERTY_EXPLORER,layout:"app-wrapper",seoTitle:"SEO.pages.propertyExplorer.title"},q3={layout:"app-wrapper"},X3={requiresPermission:wh.PASEET_COLLECTIONS,layout:"app-wrapper"},Z3={layout:"home",seoTitle:"SEO.pages.about.title",colorMode:tu.theme.LANDING_PAGE},Y3={layout:"home",seoTitle:"SEO.pages.acceptable_use.title",colorMode:tu.theme.LANDING_PAGE},K3={layout:"app-wrapper"},J3={requiresPermission:wh.PASEET_COLLECTIONS,layout:"app-wrapper",seoTitle:"SEO.pages.collections.title"},Q3={seoTitle:"SEO.pages.forgot_password.title",layout:"auth"},ez={seoTitle:"SEO.pages.login.title",layout:"auth"},tz={layout:"home",seoTitle:"SEO.pages.pricing.title",colorMode:tu.theme.LANDING_PAGE},nz={layout:"home",seoTitle:"SEO.pages.privacy_policy.title",colorMode:tu.theme.LANDING_PAGE},rz={requiresPermission:wh.PASEET_PROPERTY_EXPLORER,layout:"app-wrapper",seoTitle:"SEO.pages.propertyExplorer.title"};function vR(e){return typeof e=="string"?`'${e}'`:new Iee().serialize(e)}
4const Iee=(function(){class e{#e=new Map;compare(n,i){const c=typeof n,h=typeof i;return c==="string"&&h==="string"?n.localeCompare(i):c==="number"&&h==="number"?n-i:String.prototype.localeCompare.call(this.serialize(n,!0),this.serialize(i,!0))}serialize(n,i){if(n===null)return"null";switch(typeof n){case"string":return i?n:`'${n}'`;case"bigint":return`${n}n`;case"object":return this.$object(n);case"function":return this.$function(n)}return String(n)}serializeObject(n){const i=Object.prototype.toString.call(n);if(i!=="[object Object]")return this.serializeBuiltInType(i.length<10?`unknown:${i}`:i.slice(8,-1),n);const c=n.constructor,h=c===Object||c===void 0?"":c.name;if(h!==""&&globalThis[h]===c)return this.serializeBuiltInType(h,n);if(typeof n.toJSON=="function"){const m=n.toJSON();return h+(m!==null&&typeof m=="object"?this.$object(m):`(${this.serialize(m)})`)}return this.serializeObjectEntries(h,Object.entries(n))}serializeBuiltInType(n,i){const c=this["$"+n];if(c)return c.call(this,i);if(typeof i?.entries=="function")return this.serializeObjectEntries(n,i.entries());throw new Error(`Cannot serialize ${n}`)}serializeObjectEntries(n,i){const c=Array.from(i).sort((m,a)=>this.compare(m[0],a[0]));let h=`${n}{`;for(let m=0;m<c.length;m++){const[a,y]=c[m];h+=`${this.serialize(a,!0)}:${this.serialize(y)}`,m<c.length-1&&(h+=",")}return h+"}"}$object(n){let i=this.#e.get(n);return i===void 0&&(this.#e.set(n,`#${this.#e.size}`),i=this.serializeObject(n),this.#e.set(n,i)),i}$function(n){const i=Function.prototype.toString.call(n);return i.slice(-15)==="[native code] }"?`${n.name||""}()[native]`:`${n.name}(${n.length})${i.replace(/\s*\n\s*/g,"")}`}$Array(n){let i="[";for(let c=0;c<n.length;c++)i+=this.serialize(n[c]),c<n.length-1&&(i+=",");return i+"]"}$Date(n){try{return`Date(${n.toISOString()})`}catch{return"Date(null)"}}$ArrayBuffer(n){return`ArrayBuffer[${new Uint8Array(n).join(",")}]`}$Set(n){return`Set${this.$Array(Array.from(n).sort((i,c)=>this.compare(i,c)))}`}
4$Map(n){return this.serializeObjectEntries("Map",n.entries())}}for(const t of["Error","RegExp","URL"])e.prototype["$"+t]=function(n){return`${t}(${n})`};for(const t of["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"])e.prototype["$"+t]=function(n){return`${t}[${n.join(",")}]`};for(const t of["BigInt64Array","BigUint64Array"])e.prototype["$"+t]=function(n){return`${t}[${n.join("n,")}${n.length>0?"n":""}]`};return e})();function Pee(e,t){return e===t||vR(e)===vR(t)}const Ree=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],kee=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],Mee="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",dm=[];let Lee=class{_data=new QS;_hash=new QS([...Ree]);_nDataBytes=0;_minBufferSize=0;finalize(t){t&&this._append(t);const n=this._nDataBytes*8,i=this._data.sigBytes*8;return this._data.words[i>>>5]|=128<<24-i%32,this._data.words[(i+64>>>9<<4)+14]=Math.floor(n/4294967296),this._data.words[(i+64>>>9<<4)+15]=n,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(t,n){const i=this._hash.words;let c=i[0],h=i[1],m=i[2],a=i[3],y=i[4],E=i[5],C=i[6],P=i[7];for(let L=0;L<64;L++){if(L<16)dm[L]=t[n+L]|0;else{const X=dm[L-15],K=(X<<25|X>>>7)^(X<<14|X>>>18)^X>>>3,ne=dm[L-2],fe=(ne<<15|ne>>>17)^(ne<<13|ne>>>19)^ne>>>10;dm[L]=K+dm[L-7]+fe+dm[L-16]}const D=y&E^~y&C,V=c&h^c&m^h&m,U=(c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22),W=(y<<26|y>>>6)^(y<<21|y>>>11)^(y<<7|y>>>25),$=P+W+D+kee[L]+dm[L],Y=U+V;P=C,C=E,E=y,y=a+$|0,a=m,m=h,h=c,c=$+Y|0}i[0]=i[0]+c|0,i[1]=i[1]+h|0,i[2]=i[2]+m|0,i[3]=i[3]+a|0,i[4]=i[4]+y|0,i[5]=i[5]+E|0,i[6]=i[6]+C|0,i[7]=i[7]+P|0}_append(t){typeof t=="string"&&(t=QS.fromUtf8(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes}_process(t){let n,i=this._data.sigBytes/64;t?i=Math.ceil(i):i=Math.max((i|0)-this._minBufferSize,0);const c=i*16,h=Math.min(c*4,this._data.sigBytes);if(c){for(let m=0;m<c;m+=16)this._doProcessBlock(this._data.words,m);n=this._data.words.splice(0,c),this._data.sigBytes-=h}return new QS(n,h)}},QS=class I6{words;sigBytes;constructor(t,n){t=this.words=t||[],this.sigBytes=n===void 0?t.length*4:n}static fromUtf8(t){const n=unescape(encodeURIComponent(t)),i=n.length,c=[];for(let h=0;h<i;h++)c[h>>>2]|=(n.charCodeAt(h)&255)<<24-h%4*8;return new I6(c,i)}toBase64(){const t=[];for(let n=0;n<this.sigBytes;n+=3){const i=this.words[n>>>2]>>>24-n%4*8&255,c=this.words[n+1>>>2]>>>24-(n+1)%4*8&255,h=this.words[n+2>>>2]>>>24-(n+2)%4*8&255,m=i<<16|c<<8|h;for(let a=0;a<4&&n*8+a*6<this.sigBytes*8;a++)t.push(Mee.charAt(m>>>6*(3-a)&63))}return t.join("")}concat(t){if(this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4),this.sigBytes%4)for(let n=0;n<t.sigBytes;n++){const i=t.words[n>>>2]>>>24-n%4*8&255;this.words[this.sigBytes+n>>>2]|=i<<24-(this.sigBytes+n)%4*8}else for(let n=0;n<t.sigBytes;n+=4)this.words[this.sigBytes+n>>>2]=t.words[n>>>2];this.sigBytes+=t.sigBytes}};function Oee(e){return new Lee().finalize(e).toBase64()}function D_(e){return Oee(vR(e))}const P6=(e,t)=>({default:()=>e?Io(aY,e===!0?{}:e,t):t.default?.()}),Dee=/(:\w+)\([^)]+\)/g,Fee=/(:\w+)[?+*]/g,Bee=/:\w+/g;function iz(e){const t=e?.meta.key??e.path.replace(Dee,"$1").replace(Fee,"$1").replace(Bee,n=>e.params[n.slice(1)]?.toString()||"");return typeof t=="function"?t(e):t}function zee(e,t){return e===t||t===dc?!1:iz(e)!==iz(t)?!0:!e.matched.every((i,c)=>i.components&&i.components.default===t.matched[c]?.components?.default)}function oz(e){return Array.isArray(e)?e:[e]}function R6(e){const t=[];for(const n of e)n&&t.push({...n,onAfterLeave:n.onAfterLeave?oz(n.onAfterLeave):void 0,onBeforeLeave:n.onBeforeLeave?oz(n.onBeforeLeave):void 0});return U$(...t)}const k6=Symbol.for("nuxt:client-only"),Nee=Ys({name:"ClientOnly",
4inheritAttrs:!1,props:["fallback","placeholder","placeholderTag","fallbackTag"],setup(e,{slots:t,attrs:n}){const i=Vi(!1);cu(()=>{i.value=!0});const c=Ds();return c&&(c._nuxtClientOnly=!0),fh(k6,!0),()=>{if(i.value){const y=t.default?.();return y&&y.length===1?[od(y[0],n)]:y}const h=t.fallback||t.placeholder;if(h)return Io(h);const m=e.fallback||e.placeholder||"",a=e.fallbackTag||e.placeholderTag||"span";return ds(a,n,m)}}}),bR=globalThis.requestIdleCallback||(e=>{const t=Date.now(),n={didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-t))};return setTimeout(()=>{e(n)},1)}),Vee=globalThis.cancelIdleCallback||(e=>{clearTimeout(e)}),Lx=e=>{const t=rr();t.isHydrating?t.hooks.hookOnce("app:suspense:resolve",()=>{bR(()=>e())}):bR(()=>e())};function M6(e){return Object.defineProperty(function(){throw new Error(`[nuxt] \`${e.name}\` is a compiler macro and cannot be called at runtime.`)},"__nuxt_factory",{enumerable:!1,get:()=>e.factory})}const L6=M6({name:"createUseAsyncData",factory(e={}){function t(...n){const i=typeof n[n.length-1]=="string"?n.pop():void 0;$ee(n[0],n[1])&&n.unshift(i);let[c,h,m={}]=n,a=!1;const y=qi(c)||typeof c=="function",E=y?vn(()=>ii(c)):{value:c};if(!E.value||typeof E.value!="string")throw new TypeError("[nuxt] [useAsyncData] key must be a non-empty string.");if(typeof h!="function")throw new TypeError("[nuxt] [useAsyncData] handler must be a function.");const C=typeof e=="function",P=rr(),L=C?e(m):e;if(!C)for(const X in L)L[X]!==void 0&&m[X]===void 0&&(m[X]=L[X]);if(m.server??=!0,m.default??=Gee,m.getCachedData??=D6,m.lazy??=!1,m.immediate??=!0,m.deep??=WK.deep,m.dedupe??="cancel",C)for(const X in L)L[X]!==void 0&&(m[X]=L[X]);P._asyncData[E.value];function D(){const X={cause:"initial",dedupe:m.dedupe},K=P._asyncData[E.value];return K?._init?P._asyncDataPromises[E.value]&&(X.cachedData=K._initialCachedData):(X.cachedData=m.getCachedData(E.value,P,{cause:"initial"}),P._asyncData[E.value]=sz(P,E.value,h,m,X.cachedData),P._asyncData[E.value]._initialCachedData=X.cachedData),()=>P._asyncData[E.value].execute(X)}const V=D(),U=P._asyncData[E.value];U._deps++;const W=m.server!==!1&&P.payload.serverRendered;{let X=function(qe){const lt=P._asyncData[qe];lt?._deps&&(lt._deps--,lt._deps===0&<?._off())};const K=Ds();if(K&&W&&m.immediate&&!K.sp&&(K.sp=[]),K&&!K._nuxtOnBeforeMountCbs){K._nuxtOnBeforeMountCbs=[];const qe=K._nuxtOnBeforeMountCbs;zU(()=>{qe.forEach(lt=>{lt()}),qe.splice(0,qe.length)}),Ey(()=>qe.splice(0,qe.length))}const ne=K&&(K._nuxtClientOnly||wo(k6,!1));W&&P.isHydrating&&(U.error.value||U.data.value!==void 0)?U.status.value=U.error.value?"error":"success":K&&(!ne&&P.payload.serverRendered&&P.isHydrating||m.lazy)&&m.immediate?K._nuxtOnBeforeMountCbs.push(V):m.immediate&&U.status.value!=="success"&&V();const fe=ld(),ye=()=>{},ke=y?qr(E,(qe,lt)=>{if((qe||lt)&&qe!==lt){a=!0;const pt=P._asyncData[lt]?.data.value!==void 0,Qt=P._asyncDataPromises[lt]!==void 0,Ht={cause:"initial",dedupe:m.dedupe};if(!P._asyncData[qe]?._init){let jt;lt&&pt?jt=P._asyncData[lt].data.value:(jt=m.getCachedData(qe,P,{cause:"initial"}),Ht.cachedData=jt),P._asyncData[qe]=sz(P,qe,h,m,jt)}P._asyncData[qe]._deps++,lt&&X(lt),m._keyTriggersExecute!==!1&&(m.immediate||pt||Qt)&&P._asyncData[qe].execute(Ht),qb(()=>{a=!1})}},{flush:"sync"}):ye,Fe=m.watch?qr(m.watch,()=>{a||(P._asyncData[E.value]?._execute.isPending()&&qb(()=>{P._asyncData[E.value]?._execute.flush()}),P._asyncData[E.value]?._execute({cause:"watch",dedupe:m.dedupe}))}):ye;fe&&Dm(()=>{ke(),Fe(),X(E.value)})}const $={data:eT(()=>P._asyncData[E.value]?.data),pending:eT(()=>P._asyncData[E.value]?.pending),status:eT(()=>P._asyncData[E.value]?.status),error:eT(()=>P._asyncData[E.value]?.error),refresh:(...X)=>P._asyncData[E.value]?._init?P._asyncData[E.value].execute(...X):D()(),execute:(...X)=>$.refresh(...X),clear:()=>{const X=P._asyncData[E.value];if(X?._abortController)try{X._abortController.abort(new DOMException("AsyncData aborted by user.","AbortError"))}finally{X._abortController=void 0}O6(P,E.value)}},Y=Promise.resolve(P._asyncDataPromises[E.value]).then(()=>$);return Object.assign(Y,$),Object.defineProperties(Y,{then:{enumerable:!0,value:Y.then.bind(Y)},catch:{enumerable:!0,value:Y.catch.bind(Y)},finally:{enumerable:!0,value:Y.finally.bind(Y)}}),Y}return t}}),Uee=L6.__nuxt_factory();L6.__nuxt_factory({lazy:!0,_functionName:"useLazyAsyncData"});function eT(e){return vn({get(){return e()?.value},set(t){const n=e();n&&(n.value=t)}})}function $ee(e,t){return!(typeof e=="string"||typeof e=="object"&&e!==null||typeof e=="function"&&typeof t=="function")}function O6(e,t){t in e.payload.data&&(e.payload.data[t]=void 0),t in e.payload._errors&&(e.payload._errors[t]=void 0),e._asyncData[t]&&(e._asyncData[t].data.value=Ar(e._asyncData[t]._default()),e._asyncData[t].error.value=void 0,e._asyncData[t].status.value="idle",e._asyncData[t]._initialCachedData=void 0),t in e._asyncDataPromises&&(e._asyncDataPromises[t]=void 0)}function jee(e,t){const n={};for(const i of t)n[i]=e[i];return n}function sz(e,t,n,i,c){e.payload._errors[t]??=void 0;const h=i.getCachedData!==D6,m=n,a=i.deep?hn:Vi,y=c!==void 0,E=e.hook("app:data:refresh",async P=>{(!P||P.includes(t))&&await C.execute({cause:"refresh:hook"})}),C={data:a(y?c:i.default()),pending:vn(()=>C.status.value==="pending"),error:Ix(e.payload._errors,t),status:Vi("idle"),execute:(...P)=>{const[L,D=void 0]=P,V=L&&D===void 0&&typeof L=="object"?L:{};if(e._asyncDataPromises[t]&&(V.dedupe??i.dedupe)==="defer")return e._asyncDataPromises[t];{const $="cachedData"in V?V.cachedData:i.getCachedData(t,e,{cause:V.cause??"refresh:manual"});if($!==void 0)return e.payload.data[t]=C.data.value=$,C.error.value=void 0,C.status.value="success",Promise.resolve($)}C._abortController&&C._abortController.abort(new DOMException("AsyncData request cancelled by deduplication","AbortError")),C._abortController=new AbortController,C.status.value="pending";const U=new AbortController,W=new Promise(($,Y)=>{try{const X=V.timeout??i.timeout,K=Hee([C._abortController?.signal,V?.signal],U.signal,X);if(K.aborted){const ne=K.reason;Y(ne instanceof Error?ne:new DOMException(String(ne??"Aborted"),"AbortError"));return}return K.addEventListener("abort",()=>{const ne=K.reason;Y(ne instanceof Error?ne:new DOMException(String(ne??"Aborted"),"AbortError"))},{once:!0,signal:U.signal}),Promise.resolve(m(e,{signal:K})).then($,Y)}catch(X){Y(X)}}).then(async $=>{if(e._asyncDataPromises[t]!==W)return;let Y=$;i.transform&&(Y=await i.transform($)),i.pick&&(Y=jee(Y,i.pick)),e.payload.data[t]=Y,C.data.value=Y,C.error.value=void 0,C.status.value="success"}).catch($=>{if(e._asyncDataPromises[t]!==W||C._abortController?.signal.aborted)return e._asyncDataPromises[t];if(typeof DOMException<"u"&&$ instanceof DOMException&&$.name==="AbortError")return C.status.value="idle",e._asyncDataPromises[t];C.error.value=jf($),C.data.value=Ar(i.default()),C.status.value="error"}).finally(()=>{U.abort(),e._asyncDataPromises[t]===W&&delete e._asyncDataPromises[t]});return e._asyncDataPromises[t]=W,e._asyncDataPromises[t]},_execute:vQ((...P)=>C.execute(...P),0,{leading:!0}),_default:i.default,_deps:0,_init:!0,_hash:void 0,_off:()=>{E(),e._asyncData[t]?._init&&(e._asyncData[t]._init=!1),h||ts(()=>{e._asyncData[t]?._init||(O6(e,t),C.execute=()=>Promise.resolve())})}};return C}const Gee=()=>{},D6=(e,t,n)=>{if(t.isHydrating)return t.payload.data[e];if(n.cause!=="refresh:manual"&&n.cause!=="refresh:hook")return t.static.data[e]};function Hee(e,t,n){const i=e.filter(m=>!!m);if(typeof n=="number"&&n>=0){const m=AbortSignal.timeout?.(n);m&&i.push(m)}if(AbortSignal.any)return AbortSignal.any(i);const c=new AbortController;for(const m of i)if(m.aborted){const a=m.reason??new DOMException("Aborted","AbortError");try{c.abort(a)}catch{c.abort()}return c.signal}const h=()=>{const a=i.find(y=>y.aborted)?.reason??new DOMException("Aborted","AbortError");try{c.abort(a)}catch{c.abort()}};for(const m of i)m.addEventListener?.("abort",h,{once:!0,signal:t});return c.signal}const Wee="$s";function CC(...e){const t=typeof e[e.length-1]=="string"?e.pop():void 0;
4typeof e[0]!="string"&&e.unshift(t);const[n,i]=e;if(!n||typeof n!="string")throw new TypeError("[nuxt] [useState] key must be a string: "+n);if(i!==void 0&&typeof i!="function")throw new Error("[nuxt] [useState] init must be a function: "+i);const c=Wee+n,h=rr(),m=Ix(h.payload.state,c);if(i&&(h._state[c]??={_default:i}),m.value===void 0&&i){const a=i();if(qi(a))return h.payload.state[c]=a,a;m.value=a}return m}function qee(e){const t=[ii(e.method)?.toUpperCase()||"GET",ii(e.baseURL)];for(const n of[e.query||e.params]){const i=ii(n);if(!i)continue;const c={};for(const[h,m]of Object.entries(i))c[ii(h)]=ii(m);t.push(c)}if(e.body){const n=ii(e.body);if(!n)t.push(D_(n));else if(n instanceof ArrayBuffer)t.push(D_(Object.fromEntries([...new Uint8Array(n).entries()].map(([i,c])=>[i,c.toString()]))));else if(n instanceof FormData){const i=[];for(const c of n.entries()){const[h,m]=c;i.push([h,m instanceof File?`${m.name}:${m.size}:${m.lastModified}`:m])}t.push(D_(i))}else if(Jk(n))t.push(D_(Fl(n)));else try{t.push(D_(n))}catch{console.warn("[useFetch] Failed to hash body",n)}}return t}const F6=M6({name:"createUseFetch",factory(e={}){function t(n,i,c){const[h={},m]=typeof i=="string"?[{},i]:[i,c],a=typeof e=="function"?e(h):e,{server:y,lazy:E,default:C,transform:P,pick:L,watch:D,immediate:V,getCachedData:U,deep:W,dedupe:$,timeout:Y,...X}={...typeof e=="function"?{}:a,...h,...typeof e=="function"?a:{}},K=vn(()=>ii(n)),ne=vn(()=>ii(X.key)||"$f"+D_([m,typeof K.value=="string"?K.value:"",...qee(X)]));if(!X.baseURL&&typeof K.value=="string"&&K.value[0]==="/"&&K.value[1]==="/")throw new Error('[nuxt] [useFetch] the request URL must not start with "//".');const fe=Fl({...qK,...X,cache:typeof X.cache=="boolean"?void 0:X.cache}),ye={server:y,lazy:E,default:C,transform:P,pick:L,immediate:V,getCachedData:U,deep:W,dedupe:$,timeout:Y,watch:D===!1?[]:[...D||[],fe]};return D===!1&&(ye._keyTriggersExecute=!1),Uee(ne,(Fe,{signal:qe})=>(X.$fetch||globalThis.$fetch)(K.value,{signal:qe,...fe}),ye)}return t}}),YLe=F6.__nuxt_factory();F6.__nuxt_factory({lazy:!0,_functionName:"useLazyFetch"});const Xee=3456e4;function Zee(e,t,n){const i=e.indexOf(";",t);return i===-1?n:i}function Yee(e,t,n){const i=e.indexOf("=",t);return i<n?i:-1}function az(e,t,n){if(t===n)return"";let i=t,c=n;do{const h=e.charCodeAt(i);if(h!==32&&h!==9)break}while(++i<c);for(;c>i;){const h=e.charCodeAt(c-1);if(h!==32&&h!==9)break;c--}return e.slice(i,c)}const Kee=(()=>{const e=function(){};return e.prototype=Object.create(null),e})();function Jee(e,t){const n=new Kee,i=e.length;if(i<2)return n;const c=t?.decode||Qee,h=t?.allowMultiple||!1;let m=0;do{const a=Yee(e,m,i);if(a===-1)break;const y=Zee(e,m,i);if(a>y){m=e.lastIndexOf(";",a-1)+1;continue}const E=az(e,m,a);if(t?.filter&&!t.filter(E)){m=y+1;continue}const C=c(az(e,a+1,y));if(h){const P=n[E];P===void 0?n[E]=C:Array.isArray(P)?P.push(C):n[E]=[P,C]}else n[E]===void 0&&(n[E]=C);m=y+1}while(m<i);return n}function Qee(e){if(!e.includes("%"))return e;try{return decodeURIComponent(e)}catch{return e}}const ete=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,tte=/^[\u0021-\u003A\u003C-\u007E]*$/,nte=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,rte=/^[\u0020-\u003A\u003C-\u007E]*$/,ite=Object.prototype.toString;function lz(e,t,n){const i=typeof e=="object"&&e!==null,c=i?t:n,h=c?.stringify||JSON.stringify,m=i?e:{...n,name:e,value:t==null?"":typeof t=="string"?t:h(t)},a=c?.encode||encodeURIComponent;if(!ete.test(m.name))throw new TypeError(`argument name is invalid: ${m.name}`);const y=m.value?a(m.value):"";if(!tte.test(y))throw new TypeError(`argument val is invalid: ${m.value}`);if(!m.secure){if(m.partitioned)throw new TypeError("Partitioned cookies must have the Secure attribute");if(m.sameSite&&String(m.sameSite).toLowerCase()==="none")throw new TypeError("SameSite=None cookies must have the Secure attribute");if(m.name.length>9&&m.name.charCodeAt(0)===95&&m.name.charCodeAt(1)===95){const C=m.name.toLowerCase();if(C.startsWith("__secure-")||C.startsWith("__host-"))throw new TypeError(`${m.name} cookies must have the Secure attribute`)}}if(m.name.length>7&&m.name.charCodeAt(0)===95&&m.name.charCodeAt(1)===95&&m.name.toLowerCase().startsWith("__host-")){if(m.path!=="/")throw new TypeError("__Host- cookies must have Path=/");if(m.domain)throw new TypeError("__Host- cookies must not have a Domain attribute")}let E=m.name+"="+y;if(m.maxAge!==void 0){if(!Number.isInteger(m.maxAge))throw new TypeError(`option maxAge is invali
4d: ${m.maxAge}`);E+="; Max-Age="+Math.max(0,Math.min(m.maxAge,Xee))}if(m.domain){if(!nte.test(m.domain))throw new TypeError(`option domain is invalid: ${m.domain}`);E+="; Domain="+m.domain}if(m.path){if(!rte.test(m.path))throw new TypeError(`option path is invalid: ${m.path}`);E+="; Path="+m.path}if(m.expires){if(!ote(m.expires)||!Number.isFinite(m.expires.valueOf()))throw new TypeError(`option expires is invalid: ${m.expires}`);E+="; Expires="+m.expires.toUTCString()}if(m.httpOnly&&(E+="; HttpOnly"),m.secure&&(E+="; Secure"),m.partitioned&&(E+="; Partitioned"),m.priority)switch(typeof m.priority=="string"?m.priority.toLowerCase():void 0){case"low":E+="; Priority=Low";break;case"medium":E+="; Priority=Medium";break;case"high":E+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${m.priority}`)}if(m.sameSite)switch(typeof m.sameSite=="string"?m.sameSite.toLowerCase():m.sameSite){case!0:case"strict":E+="; SameSite=Strict";break;case"lax":E+="; SameSite=Lax";break;case"none":E+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${m.sameSite}`)}return E}function ote(e){return ite.call(e)==="[object Date]"}function Hc(e){if(typeof e!="object")return e;var t,n,i=Object.prototype.toString.call(e);if(i==="[object Object]"){if(e.constructor!==Object&&typeof e.constructor=="function"){n=new e.constructor;for(t in e)e.hasOwnProperty(t)&&n[t]!==e[t]&&(n[t]=Hc(e[t]))}else{n={};for(t in e)t==="__proto__"?Object.defineProperty(n,t,{value:Hc(e[t]),configurable:!0,enumerable:!0,writable:!0}):n[t]=Hc(e[t])}return n}if(i==="[object Array]"){for(t=e.length,n=Array(t);t--;)n[t]=Hc(e[t]);return n}return i==="[object Set]"?(n=new Set,e.forEach(function(c){n.add(Hc(c))}),n):i==="[object Map]"?(n=new Map,e.forEach(function(c,h){n.set(Hc(h),Hc(c))}),n):i==="[object Date]"?new Date(+e):i==="[object RegExp]"?(n=new RegExp(e.source,e.flags),n.lastIndex=e.lastIndex,n):i==="[object DataView]"?new e.constructor(Hc(e.buffer)):i==="[object ArrayBuffer]"?e.slice(0):i.slice(-6)==="Array]"?new e.constructor(e):e}function ste(e){if(e!=="undefined")try{const t=JSON.parse(e);return typeof t=="number"&&String(t)!==e?e:t}catch{return e}}const ate={path:"/",watch:!0,decode:e=>e&&ste(decodeURIComponent(e)),encode:e=>{if(typeof e!="string"||e==="undefined")return encodeURIComponent(JSON.stringify(e));try{if(typeof JSON.parse(e)!="string")return encodeURIComponent(JSON.stringify(e))}catch{}return encodeURIComponent(e)},refresh:!1},tT=globalThis.cookieStore;function AE(e,t){const n={...ate,...t};n.filter??=E=>E===e;const i=cz(n)||{};let c;n.maxAge!==void 0?c=n.maxAge*1e3:n.expires&&(c=n.expires.getTime()-Date.now());const h=c!==void 0&&c<=0,m=h||i[e]===void 0||i[e]===null,a=Hc(h?void 0:i[e]??n.default?.()),y=c&&!h?hte(a,c,n.watch&&n.watch!=="shallow"):hn(a);{let E=null;try{!tT&&typeof BroadcastChannel<"u"&&(E=new BroadcastChannel(`nuxt:cookies:${e}`))}catch{}const C=(V=!1)=>{if(!V&&(n.readonly||Pee(y.value,i[e])))return;const U=y.value===null||y.value===void 0?void 0:n.encode(y.value);dte(e,U,n),i[e]=Hc(y.value),E?.postMessage({value:n.encode(y.value)})},P=V=>{const U=V.refresh?cz(n)?.[e]:n.decode(V.value);L=!0,y.value=U,i[e]=Hc(U),ts(()=>{L=!1})};let L=!1;const D=!!ld();if(D&&Dm(()=>{L=!0,C(),E?.close()}),tT){const V=U=>{const W=U.changed.find(Y=>Y.name===e),$=U.deleted.find(Y=>Y.name===e);W&&P({value:W.value}),$&&P({value:null})};tT.addEventListener("change",V),D&&Dm(()=>tT.removeEventListener("change",V))}else E&&(E.onmessage=({data:V})=>P(V));n.watch&&qr(y,()=>{L||C(n.refresh)},{deep:n.watch!=="shallow"}),m&&C(m)}return y}function cz(e={}){return Jee(document.cookie,e)}const lte=e=>e;function cte(e){const{encode:t,decode:n,...i}=e;return{...i,encode:lte}}function ute(e,t,n={}){const i=cte(n);return t===void 0?lz(e,"",{...i,maxAge:-1}):lz(e,t,i)}function dte(e,t,n={}){document.cookie=ute(e,t,n)}const uz=2147483647;function hte(e,t,n){let i,c,h=0;const m=n?hn(e):{value:e};return ld()&&Dm(()=>{c?.(),clearTimeout(i)}),rM((a,y)=>{n&&(c=qr(m,y));function E(){const P=t-h,L=P<uz?P:uz;i=setTimeout(()=>{if(h+=L,h<t)return E();m.value=void 0,y()},L)}function C(){h=0,clearTimeout(i),E()}return{get(){return a(),m.value},set(P){C(),m.value=P,y()}}})}function fte(e){if(e?.__asyncLoader&&!e.__asyncResolved)return e.__asyncLoader()}async function B6(e,t=ps()){const{path:n,matched:i}=t.resolve(e);if(!i.length||(t._routePreloaded||=new Set,t._routePreloaded.has(n)))return;const c=t._preloadPromises||=[];if(c.length>4)return Promise.all(c).then(()=>B6(e,t));t._routePreloaded.add(n);for(const h of i){const m=h.components?.default;if(typeof m!="function")continue;const a=Promise.resolve(m()).catch(()=>{}).finally(()=>c.splice(c.indexOf(a),1));c.push(a)}await Promise.all(c)}function pte(e={}){const t=e.path||window.location.pathname,n=new URL(t,window.location.href);if(n.host!==window.location.host)throw new Error(`Cannot navigate to a URL with a different host: '${t}'.`);if(n.protocol&&bE(n.protocol))throw new Error(`Cannot navigate to a URL with '${n.protocol}' protocol.`);let i={};try{i=JSON.parse(sessionStorage.getItem("nuxt:reload")||"{}")}catch{}if(e.force||i?.path!==t||i?.expires<Date.now()){try{sessionStorage.setItem("nuxt:reload",JSON.stringify({path:t,expires:Date.now()+(e.ttl??1e4)}))}catch{}if(e.persistState)try{sessionStorage.setItem("nuxt:reload:state",JSON.stringify({state:rr().payload.state}))}catch{}window.location.pathname!==t?window.location.href=t:window.location.reload()}}function IE(e){return new URL(globalThis.location.href)}const mte={scrollBehavior(e,t,n){const i=rr(),c=ps().options?.scrollBehaviorType??"auto";return e.path.replace(/\/$/,"")===t.path.replace(/\/$/,"")?t.hash&&!e.hash?{left:0,top:0}:e.hash?{el:e.hash,top:z6(e.hash),behavior:c}:!1:(typeof e.meta.scrollToTop=="function"?e.meta.scrollToTop(e,t):e.meta.scrollToTop)===!1?!1:t===dc?dz(e,t,n,c):new Promise(m=>{const a=()=>{requestAnimationFrame(()=>m(dz(e,t,n,c)))};i.hooks.hookOnce("page:loading:end",()=>{const y=i["~transitionPromise"];y?y.then(a):a()})})}};function z6(e){try{const t=document.querySelector(e);
4if(t)return(Number.parseFloat(getComputedStyle(t).scrollMarginTop)||0)+(Number.parseFloat(getComputedStyle(document.documentElement).scrollPaddingTop)||0)}catch{}return 0}function dz(e,t,n,i){return n||(e.hash?{el:e.hash,top:z6(e.hash),behavior:zee(e,t)?i:"instant"}:{left:0,top:0})}const gte={hashMode:!1,scrollBehaviorType:"auto"},wf={...gte,...mte},_te=(...e)=>e.find(t=>t!==void 0);function hz(e){let t=e.replace(/[\u0000-\u001F\s]+/g,"");for(;t.toLowerCase().startsWith("view-source:");)t=t.slice(12);const n=t.indexOf(":");return n>0&&bE(t.slice(0,n+1))?null:e}function yte(e){const t=e.componentName||"NuxtLink";function n(h){return typeof h=="string"&&h.startsWith("#")}function i(h,m,a){const y=a??e.trailingSlash;if(!h||y!=="append"&&y!=="remove")return h;if(typeof h=="string")return nT(h,y);const E="path"in h&&h.path!==void 0?h.path:m(h).path;return{...h,name:void 0,path:nT(E,y)}}function c(h){const m=ps(),a=Dl(),y=vn(()=>!!Ar(h.target)&&Ar(h.target)!=="_self"),E=vn(()=>{const W=Ar(h.to)||Ar(h.href)||"";return typeof W=="string"&&bc(W,{acceptRelative:!0})}),C=cE("RouterLink"),P=C&&typeof C!="string"?C.useLink:void 0,L=vn(()=>{if(Ar(h.external))return!0;const W=Ar(h.to)||Ar(h.href)||"";return typeof W=="object"?!1:W===""||E.value}),D=vn(()=>{const W=Ar(h.to)||Ar(h.href)||"";return L.value?W:i(W,m.resolve,Ar(h.trailingSlash))}),V=L.value?void 0:P?.({...h,to:D,viewTransition:Ar(h.viewTransition)}),U=vn(()=>{const W=Ar(h.trailingSlash)??e.trailingSlash;if(!D.value||E.value||n(D.value)){const $=D.value;return typeof $=="string"?hz($):$}if(L.value){const $=typeof D.value=="object"&&"path"in D.value?lR(D.value):D.value,Y=typeof $=="object"?m.resolve($).href:$,X=typeof Y=="string"?hz(Y):Y;return X===null?null:nT(X,W)}return typeof D.value=="object"?m.resolve(D.value)?.href??null:nT(Uf(a.app.baseURL,D.value),W)});return{to:D,hasTarget:y,isAbsoluteUrl:E,isExternal:L,href:U,isActive:V?.isActive??vn(()=>D.value===m.currentRoute.value.path),isExactActive:V?.isExactActive??vn(()=>D.value===m.currentRoute.value.path),route:V?.route??vn(()=>m.resolve(D.value)),async navigate(W){U.value!==null&&await ly(U.value,{replace:Ar(h.replace),external:L.value||y.value})}}}return Ys({name:t,props:{to:{type:[String,Object],default:void 0,required:!1},href:{type:[String,Object],default:void 0,required:!1},target:{type:String,default:void 0,required:!1},rel:{type:String,default:void 0,required:!1},noRel:{type:Boolean,default:void 0,required:!1},prefetch:{type:Boolean,default:void 0,required:!1},prefetchOn:{type:[String,Object],default:void 0,required:!1},noPrefetch:{type:Boolean,default:void 0,required:!1},activeClass:{type:String,default:void 0,required:!1},exactActiveClass:{type:String,default:void 0,required:!1},prefetchedClass:{type:String,default:void 0,required:!1},replace:{type:Boolean,default:void 0,required:!1},ariaCurrentValue:{type:String,default:void 0,required:!1},external:{type:Boolean,default:void 0,required:!1},custom:{type:Boolean,default:void 0,required:!1},trailingSlash:{type:String,default:void 0,required:!1}},useLink:c,setup(h,{slots:m}){const a=ps(),{to:y,href:E,navigate:C,isExternal:P,hasTarget:L,isAbsoluteUrl:D}=c(h),V=Vi(!1),U=hn(null),W=X=>{U.value=h.custom?X?.$el?.nextElementSibling:X?.$el};function $(X){return!V.value&&(typeof h.prefetchOn=="string"?h.prefetchOn===X:h.prefetchOn?.[X]??e.prefetchOn?.[X])&&(h.prefetch??e.prefetch)!==!1&&h.noPrefetch!==!0&&h.target!=="_blank"&&!xte()}async function Y(X=rr()){if(V.value||E.value===null)return;V.value=!0;const K=typeof y.value=="string"?y.value:P.value?lR(y.value):a.resolve(y.value).fullPath,ne=P.value?new URL(K,window.location.href).href:K;await Promise.all([X.hooks.callHook("link:prefetch",ne)?.catch(()=>{}),!P.value&&!L.value&&B6(y.value,a).catch(()=>{})])}if($("visibility")){const X=rr();let K,ne=null;cu(()=>{const fe=vte();Lx(()=>{K=bR(()=>{U?.value?.tagName&&(ne=fe.observe(U.value,async()=>{ne?.(),ne=null,await Y(X)}))})})}),Ty(()=>{K&&Vee(K),ne?.(),ne=null})}return()=>{if(!P.value&&!L.value&&!n(y.value)){const ne={ref:W,to:y.value,activeClass:h.activeClass||e.activeClass,exactActiveClass:h.exactActiveClass||e.exactActiveClass,replace:h.replace,ariaCurrentValue:h.ariaCurrentValue,custom:h.custom};
4return h.custom||($("interaction")&&(ne.onPointerenter=Y.bind(null,void 0),ne.onFocus=Y.bind(null,void 0)),V.value&&(ne.class=h.prefetchedClass||e.prefetchedClass),ne.rel=h.rel||void 0),Io(cE("RouterLink"),ne,m.default)}const X=h.target||null,K=_te(h.noRel?"":h.rel,e.externalRelAttribute,D.value||L.value?"noopener noreferrer":"")||null;return h.custom?m.default?m.default({href:E.value,navigate:C,prefetch:Y,get route(){if(!E.value)return;const ne=new URL(E.value,window.location.href);return{path:ne.pathname,fullPath:ne.pathname,get query(){return wC(ne.search)},hash:ne.hash,params:{},name:void 0,matched:[],redirectedFrom:void 0,meta:{},href:E.value}},rel:K,target:X,isExternal:P.value||L.value,isActive:!1,isExactActive:!1}):null:Io("a",{ref:U,href:E.value||null,rel:K,target:X,onClick:async ne=>{if(!(P.value||L.value)){ne.preventDefault();try{const fe=G$(E.value??"");return await(h.replace?a.replace(fe):a.push(fe))}finally{if(n(y.value)){const fe=y.value.slice(1);let ye=fe;try{ye=decodeURIComponent(fe)}catch{}document.getElementById(ye)?.focus()}}}}},m.default?.())}}})}const fz=yte(HK);function nT(e,t){const n=t==="append"?xE:ay;return bc(e)&&!e.startsWith("http")?e:n(e,!0)}function vte(){const e=rr();if(e._observer)return e._observer;let t=null;const n=new Map,i=(h,m)=>(t||=new IntersectionObserver(a=>{for(const y of a){const E=n.get(y.target);(y.isIntersecting||y.intersectionRatio>0)&&E&&E()}}),n.set(h,m),t.observe(h),()=>{n.delete(h),t?.unobserve(h),n.size===0&&(t?.disconnect(),t=null)});return e._observer={observe:i}}const bte=/2g/;function xte(){const e=navigator.connection;return!!(e&&(e.saveData||bte.test(e.effectiveType)))}function wte(e){return{getItem:t=>AE(t,{...e??Dl().public.piniaPluginPersistedstate.cookieOptions??{},decode:e?.decode??decodeURIComponent,readonly:!0}).value,setItem:(t,n)=>AE(t,{...e??Dl().public.piniaPluginPersistedstate.cookieOptions??{},encode:e?.encode??encodeURIComponent}).value=n}}function Ste(){return{getItem:e=>window.localStorage.getItem(e),setItem:(e,t)=>window.localStorage.setItem(e,t)}}function Tte(){return{getItem:e=>window.sessionStorage.getItem(e),setItem:(e,t)=>window.sessionStorage.setItem(e,t)}}const Ob={cookies:wte,localStorage:Ste,sessionStorage:Tte},Ete=xa("phoneEntry",()=>{const e=hn(null),t=hn(null);return{phone:e,verificationToken:t,setVerified:(c,h)=>{e.value=c,t.value=h},clear:()=>{e.value=null,t.value=null}}},{persist:{storage:Ob.sessionStorage()}}),pz={middleware:e=>{if(!Dl().public.ALLOW_REGISTER)return ly("/");if(!Ete().verificationToken){const{$localePath:i}=rr(),c=e.query?.redirect;return ly({path:i("login"),query:c?{redirect:c}:{}})}},seoTitle:"SEO.pages.register.title",layout:"auth"},mz={layout:"home",seoTitle:"SEO.pages.terms.title",colorMode:tu.theme.LANDING_PAGE},BI=[{name:"index",path:"/",meta:FI||{},component:()=>gt(()=>import("./BFGF_SA0.js"),__vite__mapDeps([0,1,2,3,4,5,6,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]),import.meta.url)},{name:"chat-share-shareId___ar",path:"/ar/chat/share/:shareId()",meta:j3||{},component:()=>gt(()=>import("./vtBLAdy1.js"),__vite__mapDeps([45,46,47,5,6,48,49,50,36,51,52,53,7,8,54,55,56,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,37,38,57,40,58,59,60,61,62,63,64]),import.meta.url)},{name:"chat-share-shareId___en",path:"/en/chat/share/:shareId()",meta:j3||{},component:()=>gt(()=>import("./vtBLAdy1.js"),__vite__mapDeps([45,46,47,5,6,48,49,50,36,51,52,53,7,8,54,55,56,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,37,38,57,40,58,59,60,61,62,63,64]),import.meta.url)},{name:"property-explorer-notifications___ar",path:"/ar/property-explorer/notifications",meta:{...G3||{},middleware:"auth"},component:()=>gt(()=>import("./D6JkfGBf.js"),__vite__mapDeps([65,66,67,41,68,21,43,69,70,5,6,71]),import.meta.url)},{name:"property-explorer-notifications___en",path:"/en/property-explorer/notifications",meta:{...G3||{},middleware:"auth"},component:()=>gt(()=>import("./D6JkfGBf.js"),__vite__mapDeps([65,66,67,41,68,21,43,69,70,5,6,71]),import.meta.url)},{name:"property-explorer-saved___ar",path:"/ar/property-explorer/saved",meta:{...H3||{},middleware:"auth"},component:()=>gt(()=>import("./COJ6yLpI.js"),__vite__mapDeps([72,61,5,6,62,55,73,41,74,75,43,69,70,71]),import.meta.url)},{name:"property-explorer-saved___en",path:"/en/property-explorer/saved",meta:{...H3||{},middleware:"auth"},component:()=>gt(()=>import("./COJ6yLpI.js"),__vite__mapDeps([72,61,5,6,62,55,73,41,74,75,43,69,70,71]),import.meta.url)},{name:"property-explorer-id-results___ar",path:"/ar/property-explorer/:id()/results",meta:{...W3||{},middleware:"auth"},component:()=>gt(()=>import("./DQu_ubnV.js"),__vite__mapDeps([76,77,62,55,73,74,75,59,60,61,5,
46,67,41,43,69,70,71]),import.meta.url)},{name:"property-explorer-id-results___en",path:"/en/property-explorer/:id()/results",meta:{...W3||{},middleware:"auth"},component:()=>gt(()=>import("./DQu_ubnV.js"),__vite__mapDeps([76,77,62,55,73,74,75,59,60,61,5,6,67,41,43,69,70,71]),import.meta.url)},{name:"chat-chatId___ar",path:"/ar/chat/:chatId()",meta:{...q3||{},middleware:"auth"},component:()=>gt(()=>import("./Cnv9F1tm.js"),__vite__mapDeps([78,79,46,47,5,6,48,49,50,36,51,52,53,7,8,54,55,56,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,37,38,57,40,58,59,60,61,62,63,64,41,80,39,81,1,82,75,83,84,70,71,85,86,87]),import.meta.url)},{name:"chat-chatId___en",path:"/en/chat/:chatId()",meta:{...q3||{},middleware:"auth"},component:()=>gt(()=>import("./Cnv9F1tm.js"),__vite__mapDeps([78,79,46,47,5,6,48,49,50,36,51,52,53,7,8,54,55,56,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,37,38,57,40,58,59,60,61,62,63,64,41,80,39,81,1,82,75,83,84,70,71,85,86,87]),import.meta.url)},{name:"collections-collectionId___ar",path:"/ar/collections/:collectionId()",meta:{...X3||{},middleware:"auth"},component:()=>gt(()=>import("./D2j5_3t5.js"),__vite__mapDeps([88,89,90,91,41,82,5,6,75,83,47,48,40,49,50,36,51,81,1,59,60,84,70,71,85,86,56,43,69]),import.meta.url)},{name:"collections-collectionId___en",path:"/en/collections/:collectionId()",meta:{...X3||{},middleware:"auth"},component:()=>gt(()=>import("./D2j5_3t5.js"),__vite__mapDeps([88,89,90,91,41,82,5,6,75,83,47,48,40,49,50,36,51,81,1,59,60,84,70,71,85,86,56,43,69]),import.meta.url)},{name:"about___ar",path:"/ar/about",meta:Z3||{},component:()=>gt(()=>import("./ZDwLw3Gf.js"),__vite__mapDeps([92,2,3,1,43,93]),import.meta.url)},{name:"about___en",path:"/en/about",meta:Z3||{},component:()=>gt(()=>import("./ZDwLw3Gf.js"),__vite__mapDeps([92,2,3,1,43,93]),import.meta.url)},{name:"acceptable-use___ar",path:"/ar/acceptable-use",meta:Y3||{},component:()=>gt(()=>import("./CW6waRHZ.js"),__vite__mapDeps([94,1,43,95]),import.meta.url)},{name:"acceptable-use___en",path:"/en/acceptable-use",meta:Y3||{},component:()=>gt(()=>import("./CW6waRHZ.js"),__vite__mapDeps([94,1,43,95]),import.meta.url)},{name:"chat___ar",path:"/ar/chat",meta:{...K3||{},middleware:"auth"},component:()=>gt(()=>import("./DTKrqCjg.js"),__vite__mapDeps([96,79,46,47,5,6,48,49,50,36,51,52,53,7,8,54,55,56,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,37,38,57,40,58,59,60,61,62,63,64,41,80,39,81,1,82,75,83,84,70,71,85,86,87]),import.meta.url)},{name:"chat___en",path:"/en/chat",meta:{...K3||{},middleware:"auth"},component:()=>gt(()=>import("./DTKrqCjg.js"),__vite__mapDeps([96,79,46,47,5,6,48,49,50,36,51,52,53,7,8,54,55,56,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,37,38,57,40,58,59,60,61,62,63,64,41,80,39,81,1,82,75,83,84,70,71,85,86,87]),import.meta.url)},{name:"checkout___ar",path:"/ar/checkout",meta:{middleware:["auth","plan-id"]},component:()=>gt(()=>import("./q2BdnGUp.js"),__vite__mapDeps([97,62,55,41,34,20,21,32,33,74,75,73,54,98]),import.meta.url)},{name:"checkout___en",path:"/en/checkout",meta:{middleware:["auth","plan-id"]},component:()=>gt(()=>import("./q2BdnGUp.js"),__vite__mapDeps([97,62,55,41,34,20,21,32,33,74,75,73,54,98]),import.meta.url)},{name:"collections___ar",path:"/ar/collections",meta:{...J3||{},middleware:"auth"},component:()=>gt(()=>import("./q_y6V2Os.js"),__vite__mapDeps([99,73,89,100,101,102,103,104,105,75,41,74,43,69,70,5,6,71]),import.meta.url)},{name:"collections___en",path:"/en/collections",meta:{...J3||{},middleware:"auth"},component:()=>gt(()=>import("./q_y6V2Os.js"),__vite__mapDeps([99,73,89,100,101,102,103,104,105,75,41,74,43,69,70,5,6,71]),import.meta.url)},{name:"forgot-password___ar",path:"/ar/forgot-password",meta:Q3||{},component:()=>gt(()=>import("./C7eKW-aI.js"),__vite__mapDeps([106,107,54,36,108,19,20,21,109,4,110,73,111,80,112,113,114,115,116,117,118,119,120]),import.meta.url)},{name:"forgot-password___en",path:"/en/forgot-password",meta:Q3||{},component:()=>gt(()=>
4import("./C7eKW-aI.js"),__vite__mapDeps([106,107,54,36,108,19,20,21,109,4,110,73,111,80,112,113,114,115,116,117,118,119,120]),import.meta.url)},{name:"login___ar",path:"/ar/login",meta:ez||{},component:()=>gt(()=>import("./CtaHe6Ic.js"),__vite__mapDeps([121,107,54,36,108,19,20,21,109,4,110,73,111,80,112,122,123,113,116,124,32,33]),import.meta.url)},{name:"login___en",path:"/en/login",meta:ez||{},component:()=>gt(()=>import("./CtaHe6Ic.js"),__vite__mapDeps([121,107,54,36,108,19,20,21,109,4,110,73,111,80,112,122,123,113,116,124,32,33]),import.meta.url)},{name:"payment-result___ar",path:"/ar/payment-result",component:()=>gt(()=>import("./CbmJHRs0.js"),[],import.meta.url)},{name:"payment-result___en",path:"/en/payment-result",component:()=>gt(()=>import("./CbmJHRs0.js"),[],import.meta.url)},{name:"pricing___ar",path:"/ar/pricing",meta:tz||{},component:()=>gt(()=>import("./DlIxjLPt.js"),__vite__mapDeps([125,55,126,1,41,127,81,43,128]),import.meta.url)},{name:"pricing___en",path:"/en/pricing",meta:tz||{},component:()=>gt(()=>import("./DlIxjLPt.js"),__vite__mapDeps([125,55,126,1,41,127,81,43,128]),import.meta.url)},{name:"privacy-policy___ar",path:"/ar/privacy-policy",meta:nz||{},component:()=>gt(()=>import("./D2fDuidE.js"),__vite__mapDeps([129,1,43,130]),import.meta.url)},{name:"privacy-policy___en",path:"/en/privacy-policy",meta:nz||{},component:()=>gt(()=>import("./D2fDuidE.js"),__vite__mapDeps([129,1,43,130]),import.meta.url)},{name:"property-explorer___ar",path:"/ar/property-explorer",meta:{...rz||{},middleware:"auth"},component:()=>gt(()=>import("./Jpiw1y2a.js"),__vite__mapDeps([131,5,6,66,67,75,68,21,59,60,77,62,55,73,41,11,12,13,14,15,16,10,17,18,19,20,22,23,24,25,26,27,74,83,84,43,69,70,71]),import.meta.url)},{name:"property-explorer___en",path:"/en/property-explorer",meta:{...rz||{},middleware:"auth"},component:()=>gt(()=>import("./Jpiw1y2a.js"),__vite__mapDeps([131,5,6,66,67,75,68,21,59,60,77,62,55,73,41,11,12,13,14,15,16,10,17,18,19,20,22,23,24,25,26,27,74,83,84,43,69,70,71]),import.meta.url)},{name:"register___ar",path:"/ar/register",meta:pz||{},component:()=>gt(()=>import("./CxhudW71.js"),__vite__mapDeps([132,73,111,80,112,133,117,54,122,123,36,32,33,20,21,113,134,118,135]),import.meta.url)},{name:"register___en",path:"/en/register",meta:pz||{},component:()=>gt(()=>import("./CxhudW71.js"),__vite__mapDeps([132,73,111,80,112,133,117,54,122,123,36,32,33,20,21,113,134,118,135]),import.meta.url)},{name:"terms___ar",path:"/ar/terms",meta:mz||{},component:()=>gt(()=>import("./F11UVdGT.js"),__vite__mapDeps([136,1,43,137]),import.meta.url)},{name:"terms___en",path:"/en/terms",meta:mz||{},component:()=>gt(()=>import("./F11UVdGT.js"),__vite__mapDeps([136,1,43,137]),import.meta.url)},{name:"index___ar",path:"/ar",meta:FI||{},component:()=>gt(()=>import("./BFGF_SA0.js"),__vite__mapDeps([0,1,2,3,4,5,6,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]),import.meta.url)},{name:"index___en",path:"/en",meta:FI||{},component:()=>gt(()=>import("./BFGF_SA0.js"),__vite__mapDeps([0,1,2,3,4,5,6,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]),import.meta.url)}],Cte=async(e,t)=>{let n,i;if(!e.meta?.validate)return;const c=([n,i]=$f(()=>Promise.resolve(e.meta.validate(e))),n=await n,i(),n);if(c===!0)return;const h=jf({fatal:!0,status:c&&(c.status||c.statusCode)||404,statusText:c&&(c.statusText||c.statusMessage)||`Page Not Found: ${e.fullPath}`,data:{path:e.fullPath}});return typeof window<"u"&&window.history.pushState({},"",t.fullPath),h},Ate=(e,t)=>{};var F_=(e=>(e.PROMPTS="prompts",e.PARCELS_MODEL="parcels-model",e.IDLE_LAND_FEES_MODEL="idle-land-fees-model",e.PUBLIC_TRANSPORT_MODEL="public-transport-model",e.RER_ANNOUNCED_AREA_MODEL="rer-announced-area-model",e.TRANSACTIONS_MODEL="transactions-model",e.RENTAL_MODEL="rental-model",e.DEMOGRAPHICS_MODEL="demographics-model",e.PUBLIC_SERVICES_MODEL="public-services-model",e.REIT_MODEL="reit-model",e.REGULATIONS_MODEL="regulations-model",e.SEARCH_MODEL="search-model",e.SPATIAL_COMBINATION_MODEL="spatial-combination-model",e.CHARTS="charts",e.CONSULTANT_QUICK="consultant-quick",e.CONSULTANT_BALANCED="consultant-balanced",e.CONSULTANT_DEEP="consultant-deep",e))(F_||{}),N6=Symbol();function Ox(){var e=wo(N6);if(!e)throw new Error("No PrimeVue Toast provided!");return e}
4function Dx(e,t){return ld()?(Dm(e,t),!0):!1}const zI=new WeakMap,Ite=(...e)=>{var t;const n=e[0],i=(t=Ds())===null||t===void 0?void 0:t.proxy,c=i??ld();if(c==null&&!Wm())throw new Error("injectLocal must be called in setup");return c&&zI.has(c)&&n in zI.get(c)?zI.get(c)[n]:wo(...e)},AC=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const KLe=e=>typeof e<"u",V6=e=>e!=null,Pte=Object.prototype.toString,Rte=e=>Pte.call(e)==="[object Object]",Qu=()=>{};function U6(...e){if(e.length!==1)return Ix(...e);const t=e[0];return typeof t=="function"?ny(rM(()=>({get:t,set:Qu}))):hn(t)}function $6(e,t){function n(...i){return new Promise((c,h)=>{Promise.resolve(e(()=>t.apply(this,i),{fn:t,thisArg:this,args:i})).then(c).catch(h)})}return n}const j6=e=>e();function G6(e,t={}){let n,i,c=Qu;const h=y=>{clearTimeout(y),c(),c=Qu};let m;return y=>{const E=ii(e),C=ii(t.maxWait);return n&&h(n),E<=0||C!==void 0&&C<=0?(i&&(h(i),i=void 0),Promise.resolve(y())):new Promise((P,L)=>{c=t.rejectOnCancel?L:P,m=y,C&&!i&&(i=setTimeout(()=>{n&&h(n),i=void 0,P(m())},C)),n=setTimeout(()=>{i&&h(i),i=void 0,P(y())},E)})}}function kte(e=j6,t={}){const{initialState:n="active"}=t,i=U6(n==="active");function c(){i.value=!1}function h(){i.value=!0}return{isActive:nM(i),pause:c,resume:h,eventFilter:(...a)=>{i.value&&e(...a)}}}function gz(e){return e.endsWith("rem")?Number.parseFloat(e)*16:Number.parseFloat(e)}function J_(e){return Array.isArray(e)?e:[e]}function Mte(e){return Ds()}function Lte(e,t=200,n={}){return $6(G6(t,n),e)}function Ote(e,t=200,n={}){const i=hn(ii(e)),c=Lte(()=>{i.value=e.value},t,n);return qr(e,()=>c()),nM(i)}const JLe=Ote;function H6(e,t,n={}){const{eventFilter:i=j6,...c}=n;return qr(e,$6(i,t),c)}function Dte(e,t,n={}){const{eventFilter:i,initialState:c="active",...h}=n,{eventFilter:m,pause:a,resume:y,isActive:E}=kte(i,{initialState:c});return{stop:H6(e,t,{...h,eventFilter:m}),pause:a,resume:y,isActive:E}}function IC(e,t=!0,n){Mte()?cu(e,n):t?e():ts(e)}function QLe(e,t,n={}){const{immediate:i=!0,immediateCallback:c=!1}=n,h=Vi(!1);let m;function a(){m&&(clearTimeout(m),m=void 0)}function y(){h.value=!1,a()}function E(...C){c&&e(),a(),h.value=!0,m=setTimeout(()=>{h.value=!1,m=void 0,e(...C)},ii(t))}return i&&(h.value=!0,AC&&E()),Dx(y),{isPending:nM(h),start:E,stop:y}}function eOe(e,t,n={}){const{debounce:i=0,maxWait:c=void 0,...h}=n;return H6(e,t,{...h,eventFilter:G6(i,{maxWait:c})})}function Fte(e,t,n){return qr(e,t,{...n,immediate:!0})}const za=AC?window:void 0,W6=AC?window.document:void 0;function qs(e){var t;const n=ii(e);return(t=n?.$el)!==null&&t!==void 0?t:n}function Xs(...e){const t=(i,c,h,m)=>(i.addEventListener(c,h,m),()=>i.removeEventListener(c,h,m)),n=vn(()=>{const i=J_(ii(e[0])).filter(c=>c!=null);return i.every(c=>typeof c!="string")?i:void 0});return Fte(()=>{var i,c;return[(i=(c=n.value)===null||c===void 0?void 0:c.map(h=>qs(h)))!==null&&i!==void 0?i:[za].filter(h=>h!=null),J_(ii(n.value?e[1]:e[0])),J_(Ar(n.value?e[2]:e[1])),ii(n.value?e[3]:e[2])]},([i,c,h,m],a,y)=>{if(!i?.length||!c?.length||!h?.length)return;const E=Rte(m)?{...m}:m,C=i.flatMap(P=>c.flatMap(L=>h.map(D=>t(P,L,D,E))));y(()=>{C.forEach(P=>P())})},{flush:"post"})}function tOe(e,t,n={}){const{window:i=za,ignore:c=[],capture:h=!0,detectIframe:m=!1,controls:a=!1}=n;if(!i)return a?{stop:Qu,cancel:Qu,trigger:Qu}:Qu;let y=!0;const E=W=>ii(c).some($=>{if(typeof $=="string")return Array.from(i.document.querySelectorAll($)).some(Y=>Y===W.target||W.composedPath().includes(Y));{const Y=qs($);return Y&&(W.target===Y||W.composedPath().includes(Y))}});function C(W){const $=ii(W);return $&&$.$.subTree.shapeFlag===16}function P(W,$){const Y=ii(W),X=Y.$.subTree&&Y.$.subTree.children;return X==null||!Array.isArray(X)?!1:X.some(K=>K.el===$.target||$.composedPath().includes(K.el))}const L=W=>{const $=qs(e);if(W.target!=null&&!(!($ instanceof Element)&&C(e)&&P(e,W))&&!(!$||$===W.target||W.composedPath().includes($))){if("detail"in W&&W.detail===0&&(y=!E(W)),!y){y=!0;return}t(W)}};let D=!1;const V=[Xs(i,"click",W=>{D||(D=!0,setTimeout(()=>{D=!1},0),L(W))},{passive:!0,capture:h}),Xs(i,"pointerdown",W=>{const $=qs(e);y=!E(W)&&!!($&&!W.composedPath().includes($))},{passive:!0}),m&&Xs(i,"blur",W=>{setTimeout(()=>{const $=qs(e);let Y=i.document.activeElement;for(;Y?.shadowRoot;)Y=Y.shadowRoot.activeElement;Y?.tagName==="IFRAME"&&!$?.contains(i.document.activeElement)&&t(W)},0)},{passive:!0}
4)].filter(Boolean),U=()=>V.forEach(W=>W());return a?{stop:U,cancel:()=>{y=!1},trigger:W=>{y=!0,L(W),y=!1}}:U}function Bte(){const e=Vi(!1),t=Ds();return t&&cu(()=>{e.value=!0},t),e}function PC(e){const t=Bte();return vn(()=>(t.value,!!e()))}function q6(e,t,n={}){const{window:i=za,...c}=n;let h;const m=PC(()=>i&&"MutationObserver"in i),a=()=>{h&&(h.disconnect(),h=void 0)},y=qr(vn(()=>{const P=J_(ii(e)).map(qs).filter(V6);return new Set(P)}),P=>{a(),m.value&&P.size&&(h=new MutationObserver(t),P.forEach(L=>h.observe(L,c)))},{immediate:!0,flush:"post"}),E=()=>h?.takeRecords(),C=()=>{y(),a()};return Dx(C),{isSupported:m,stop:C,takeRecords:E}}function zte(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function nOe(...e){let t,n,i={};e.length===3?(t=e[0],n=e[1],i=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],i=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:c=za,eventName:h="keydown",passive:m=!1,dedupe:a=!1}=i,y=zte(t);return Xs(c,h,C=>{C.repeat&&ii(a)||y(C)&&n(C)},m)}const Nte=500,Vte=10;function rOe(e,t,n){var i,c;const h=vn(()=>qs(e));let m,a,y,E=!1;function C(){m&&(clearTimeout(m),m=void 0),a=void 0,y=void 0,E=!1}function P(Y){const X=n?.delay;return typeof X=="function"?X(Y):X??Nte}function L(Y){var X,K,ne;const[fe,ye,ke]=[y,a,E];if(C(),!n?.onMouseUp||!ye||!fe||!(n==null||(X=n.modifiers)===null||X===void 0)&&X.self&&Y.target!==h.value)return;!(n==null||(K=n.modifiers)===null||K===void 0)&&K.prevent&&Y.preventDefault(),!(n==null||(ne=n.modifiers)===null||ne===void 0)&&ne.stop&&Y.stopPropagation();const Fe=Y.x-ye.x,qe=Y.y-ye.y,lt=Math.sqrt(Fe*Fe+qe*qe);n.onMouseUp(Y.timeStamp-fe,lt,ke,Y)}function D(Y){var X,K,ne;!(n==null||(X=n.modifiers)===null||X===void 0)&&X.self&&Y.target!==h.value||(C(),!(n==null||(K=n.modifiers)===null||K===void 0)&&K.prevent&&Y.preventDefault(),!(n==null||(ne=n.modifiers)===null||ne===void 0)&&ne.stop&&Y.stopPropagation(),a={x:Y.x,y:Y.y},y=Y.timeStamp,m=setTimeout(()=>{E=!0,t(Y)},P(Y)))}function V(Y){var X,K,ne,fe;if(!(n==null||(X=n.modifiers)===null||X===void 0)&&X.self&&Y.target!==h.value||!a||n?.distanceThreshold===!1)return;!(n==null||(K=n.modifiers)===null||K===void 0)&&K.prevent&&Y.preventDefault(),!(n==null||(ne=n.modifiers)===null||ne===void 0)&&ne.stop&&Y.stopPropagation();const ye=Y.x-a.x,ke=Y.y-a.y;Math.sqrt(ye*ye+ke*ke)>=((fe=n?.distanceThreshold)!==null&&fe!==void 0?fe:Vte)&&C()}const U={capture:n==null||(i=n.modifiers)===null||i===void 0?void 0:i.capture,once:n==null||(c=n.modifiers)===null||c===void 0?void 0:c.once},W=[Xs(h,"pointerdown",D,U),Xs(h,"pointermove",V,U),Xs(h,["pointerup","pointerleave"],L,U)];return()=>W.forEach(Y=>Y())}const Ute=Symbol("vueuse-ssr-width");function $te(){const e=Wm()?Ite(Ute,null):null;return typeof e=="number"?e:void 0}function jte(e,t={}){const{window:n=za,ssrWidth:i=$te()}=t,c=PC(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function"),h=Vi(typeof i=="number"),m=Vi(),a=Vi(!1),y=E=>{a.value=E.matches};return AU(()=>{if(h.value){h.value=!c.value,a.value=ii(e).split(",").some(E=>{const C=E.includes("not all"),P=E.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),L=E.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let D=!!(P||L);return P&&D&&(D=i>=gz(P[1])),L&&D&&(D=i<=gz(L[1])),C?!D:D});return}c.value&&(m.value=n.matchMedia(ii(e)),a.value=m.value.matches)}),Xs(m,"change",y,{passive:!0}),vn(()=>a.value)}const rT=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},iT="__vueuse_ssr_handlers__",Gte=Hte();function Hte(){return iT in rT||(rT[iT]=rT[iT]||{}),rT[iT]}function Wte(e,t){return Gte[e]||t}function qte(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const Xte={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},_z="vueuse-storage";function Zte(e,t,n,i={}){var c;const{flush:h="pre",deep:m=!0,listenToStorageChanges:a=!0,writeDefaults:y=!0,mergeDefaults:E=!1,shallow:C,window:P=za,eventFilter:L,onError:D=Ht=>{console.error(Ht)},initOnMounted:V}=i,U=(C?Vi:hn)(typeof t=="function"?t():t),W=vn(()=>ii(e));if(!n)try{n=Wte("getDefaultStorage",()=>za?.localStorage)()}catch(Ht){D(Ht)}if(!n)return U;const $=ii(t),Y=qte($),X=(c=i.serializer)!==null&&c!==void 0?c:Xte[Y],{pause:K,resume:ne}=Dte(U,Ht=>qe(Ht),{flush:h,deep:m,eventFilter:L});qr(W,()=>pt(),{flush:h});let fe=!1;const ye=Ht=>{V&&!fe||pt(Ht)},ke=Ht=>{V&&!fe||Qt(Ht)};P&&a&&(n instanceof Storage?Xs(P,"storage",ye,{passive:!0}):Xs(P,_z,ke)),V?IC(()=>{fe=!0,pt()}):pt();function Fe(Ht,zt){if(P){const jt={key:W.value,oldValue:Ht,newValue:zt,storageArea:n};P.dispatchEvent(n instanceof Storage?new StorageEvent("storage",jt):new CustomEvent(_z,{detail:jt}))}}
4function qe(Ht){try{const zt=n.getItem(W.value);if(Ht==null)Fe(zt,null),n.removeItem(W.value);else{const jt=X.write(Ht);zt!==jt&&(n.setItem(W.value,jt),Fe(zt,jt))}}catch(zt){D(zt)}}function lt(Ht){const zt=Ht?Ht.newValue:n.getItem(W.value);if(zt==null)return y&&$!=null&&n.setItem(W.value,X.write($)),$;if(!Ht&&E){const jt=X.read(zt);return typeof E=="function"?E(jt,$):Y==="object"&&!Array.isArray(jt)?{...$,...jt}:jt}else return typeof zt!="string"?zt:X.read(zt)}function pt(Ht){if(!(Ht&&Ht.storageArea!==n)){if(Ht&&Ht.key==null){U.value=$;return}if(!(Ht&&Ht.key!==W.value)){K();try{const zt=X.write(U.value);(Ht===void 0||Ht?.newValue!==zt)&&(U.value=lt(Ht))}catch(zt){D(zt)}finally{Ht?ts(ne):ne()}}}}function Qt(Ht){pt(Ht.detail)}return U}function iOe(e,t,n={}){const{window:i=za,initialValue:c,observe:h=!1}=n,m=Vi(c),a=vn(()=>{var E;return qs(t)||(i==null||(E=i.document)===null||E===void 0?void 0:E.documentElement)});function y(){const E=ii(e),C=ii(a);if(C&&i&&E){var P;m.value=((P=i.getComputedStyle(C).getPropertyValue(E))===null||P===void 0?void 0:P.trim())||m.value||c}}return h&&q6(a,y,{attributeFilter:["style","class"],window:i}),qr([a,()=>ii(e)],(E,C)=>{C[0]&&C[1]&&C[0].style.removeProperty(C[1]),y()},{immediate:!0}),qr([m,a],([E,C])=>{const P=ii(e);C?.style&&P&&(E==null?C.style.removeProperty(P):C.style.setProperty(P,E))},{immediate:!0}),m}function Yte(e={}){const{document:t=W6}=e;if(!t)return Vi("visible");const n=Vi(t.visibilityState);return Xs(t,"visibilitychange",()=>{n.value=t.visibilityState},{passive:!0}),n}function oOe(e,t={}){const n=Vi(!1),i=Vi(null);let c=0,h=!0;if(AC){var m,a;const y=typeof t=="function"?{onDrop:t}:t,E=(m=y.multiple)!==null&&m!==void 0?m:!0,C=(a=y.preventDefaultForUnhandled)!==null&&a!==void 0?a:!1,P=W=>{var $,Y;const X=Array.from(($=(Y=W.dataTransfer)===null||Y===void 0?void 0:Y.files)!==null&&$!==void 0?$:[]);return X.length===0?null:E?X:[X[0]]},L=W=>{const $=Ar(y.dataTypes);return typeof $=="function"?$(W):$?.length?W.length===0?!1:W.every(Y=>$.some(X=>Y.includes(X))):!0},D=W=>{if(y.checkValidity)return y.checkValidity(W);const $=L(Array.from(W??[]).map(X=>X.type)),Y=E||W.length<=1;return $&&Y},V=()=>/^(?:(?!chrome|android).)*safari/i.test(navigator.userAgent)&&!("chrome"in window),U=(W,$)=>{var Y,X;const K=(Y=W.dataTransfer)===null||Y===void 0?void 0:Y.items;if(h=(X=K&&D(K))!==null&&X!==void 0?X:!1,C&&W.preventDefault(),!V()&&!h){W.dataTransfer&&(W.dataTransfer.dropEffect="none");return}W.preventDefault(),W.dataTransfer&&(W.dataTransfer.dropEffect="copy");const ne=P(W);switch($){case"enter":var fe;c+=1,n.value=!0,(fe=y.onEnter)===null||fe===void 0||fe.call(y,null,W);break;case"over":var ye;(ye=y.onOver)===null||ye===void 0||ye.call(y,null,W);break;case"leave":var ke;c-=1,c===0&&(n.value=!1),(ke=y.onLeave)===null||ke===void 0||ke.call(y,null,W);break;case"drop":if(c=0,n.value=!1,h){var Fe;i.value=ne,(Fe=y.onDrop)===null||Fe===void 0||Fe.call(y,ne,W)}break}};Xs(e,"dragenter",W=>U(W,"enter")),Xs(e,"dragover",W=>U(W,"over")),Xs(e,"dragleave",W=>U(W,"leave")),Xs(e,"drop",W=>U(W,"drop"))}return{files:i,isOverDropZone:n}}function Kte(e,t,n={}){const{window:i=za,...c}=n;let h;const m=PC(()=>i&&"ResizeObserver"in i),a=()=>{h&&(h.disconnect(),h=void 0)},y=qr(vn(()=>{const C=ii(e);return Array.isArray(C)?C.map(P=>qs(P)):[qs(C)]}),C=>{if(a(),m.value&&i){h=new ResizeObserver(t);for(const P of C)P&&h.observe(P,c)}},{immediate:!0,flush:"post"}),E=()=>{a(),y()};return Dx(E),{isSupported:m,stop:E}}function sOe(e,t={width:0,height:0},n={}){const{window:i=za,box:c="content-box"}=n,h=vn(()=>{var P;return(P=qs(e))===null||P===void 0||(P=P.namespaceURI)===null||P===void 0?void 0:P.includes("svg")}),m=Vi(t.width),a=Vi(t.height),{stop:y}=Kte(e,([P])=>{const L=c==="border-box"?P.borderBoxSize:c==="content-box"?P.contentBoxSize:P.devicePixelContentBoxSize;if(i&&h.value){const D=qs(e);if(D){const V=D.getBoundingClientRect();m.value=V.width,a.value=V.height}}else if(L){const D=J_(L);m.value=D.reduce((V,{inlineSize:U})=>V+U,0),a.value=D.reduce((V,{blockSize:U})=>V+U,0)}else m.value=P.contentRect.width,a.value=P.contentRect.height},n);IC(()=>{const P=qs(e);P&&(m.value="offsetWidth"in P?P.offsetWidth:t.width,a.value="offsetHeight"in P?P.offsetHeight:t.height)});const E=qr(()=>qs(e),P=>{m.value=P?t.width:0,a.value=P?t.height:0});function C(){y(),E()}return{width:m,height:a,stop:C}}function aOe(e,t,n={}){const{root:i,rootMargin:c,threshold:h=0,window:m=za,immediate:a=!0}=n,y=PC(()=>m&&"IntersectionObserver"in m),E=vn(()=>J_(ii(e)).map(qs).filter(V6));let C=Qu;const P=Vi(a),L=y.value?qr(()=>[E.value,qs(i),ii(c),P.value],([V,U,W])=>
4{if(C(),!P.value||!V.length)return;const $=new IntersectionObserver(t,{root:qs(U),rootMargin:W,threshold:h});V.forEach(Y=>Y&&$.observe(Y)),C=()=>{$.disconnect(),C=Qu}},{immediate:a,flush:"post"}):Qu,D=()=>{C(),L(),P.value=!1};return Dx(D),{isSupported:y,isActive:P,pause(){C(),P.value=!1},resume(){P.value=!0},stop:D}}const tb=new Map;function yz(e){const t=ld();function n(a){var y;const E=tb.get(e)||new Set;E.add(a),tb.set(e,E);const C=()=>c(a);return t==null||(y=t.cleanups)===null||y===void 0||y.push(C),C}function i(a){function y(...E){c(y),a(...E)}return n(y)}function c(a){const y=tb.get(e);y&&(y.delete(a),y.size||h())}function h(){tb.delete(e)}function m(a,y){var E;(E=tb.get(e))===null||E===void 0||E.forEach(C=>C(a,y))}return{on:n,once:i,off:c,emit:m,reset:h}}function NI(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}function Jte(e,t,n={}){const{window:i=za}=n;return Zte(e,t,i?.localStorage,n)}const VI=new WeakMap;function lOe(e,t=!1){const n=Vi(t);let i="";qr(U6(e),m=>{const a=NI(ii(m));if(a){const y=a;if(VI.get(y)||VI.set(y,y.style.overflow),y.style.overflow!=="hidden"&&(i=y.style.overflow),y.style.overflow==="hidden")return n.value=!0;if(n.value)return y.style.overflow="hidden"}},{immediate:!0});const c=()=>{const m=NI(ii(e));!m||n.value||(m.style.overflow="hidden",n.value=!0)},h=()=>{const m=NI(ii(e));!m||!n.value||(m.style.overflow=i,VI.delete(m),n.value=!1)};return Dx(h),vn({get(){return n.value},set(m){m?c():h()}})}function Qte(e={}){const{document:t=W6,selector:n="html",observe:i=!1,initialValue:c="ltr"}=e;function h(){var a,y;return(a=t==null||(y=t.querySelector(n))===null||y===void 0?void 0:y.getAttribute("dir"))!==null&&a!==void 0?a:c}const m=Vi(h());return IC(()=>m.value=h()),i&&t&&q6(t.querySelector(n),()=>m.value=h(),{attributes:!0}),vn({get(){return m.value},set(a){var y,E;m.value=a,t&&(m.value?(y=t.querySelector(n))===null||y===void 0||y.setAttribute("dir",m.value):(E=t.querySelector(n))===null||E===void 0||E.removeAttribute("dir"))}})}function X6(e={}){const{window:t=za,initialWidth:n=Number.POSITIVE_INFINITY,initialHeight:i=Number.POSITIVE_INFINITY,listenOrientation:c=!0,includeScrollbar:h=!0,type:m="inner"}=e,a=Vi(n),y=Vi(i),E=()=>{if(t)if(m==="outer")a.value=t.outerWidth,y.value=t.outerHeight;else if(m==="visual"&&t.visualViewport){const{width:P,height:L,scale:D}=t.visualViewport;a.value=Math.round(P*D),y.value=Math.round(L*D)}else h?(a.value=t.innerWidth,y.value=t.innerHeight):(a.value=t.document.documentElement.clientWidth,y.value=t.document.documentElement.clientHeight)};E(),IC(E);const C={passive:!0};return Xs("resize",E,C),t&&m==="visual"&&t.visualViewport&&Xs(t.visualViewport,"resize",E,C),c&&qr(jte("(orientation: portrait)"),()=>E()),{width:a,height:y}}const oT=1200,V_="paseet_token",vz="paseet.seenFreemiumChatLimitWarning",cOe="paseet-chat-input-state",ene=()=>CC("color-mode").value,Nm=xa("settings",()=>{const{width:e}=X6(),t=rr(),n=hn(e.value<767),i=Qte(),c=vn(()=>i.value==="rtl"),h=ene(),m=vn(()=>h.value),a=vn({get:()=>h.preference,set:fe=>h.preference=fe}),y=fe=>{if(!["rtl","ltr"].includes(fe.toLowerCase()))throw new Error("Invalid direction");i.value=fe.toLowerCase()},E=hn(t.$i18n.locale.value),C=hn(!1),P=fe=>C.value=fe;E.value=document.documentElement.lang;const L=fe=>{E.value=fe},D=async fe=>{if(E.value!==fe)try{const{$axios:ye}=rr(),ke=Yf(),Fe=await ye.post("user/update-profile-settings",{theme:a.value,lang:fe}),qe=await Fe.data;if(Fe.status!==200)console.error(qe.message);else{const lt=qe.data.lang;ke.user&&(ke.user.lang=lt)}}catch(ye){console.error(ye)}finally{E.value=fe}},V=()=>{E.value=E.value==="ar"?"en":"ar"},U=hn(e.value<oT),W=hn(!1);Lx(()=>{U.value=e.value<oT,W.value=!0});const $=()=>{U.value=!U.value},Y=()=>{U.value=!0},X=()=>{U.value=!1};qr(e,(fe,ye)=>{n.value=fe<767;
4const ke=ye<oT,Fe=fe<oT;ke!==Fe&&(U.value=Fe)});const K=fe=>E.value==="ar"?fe:`/${E.value}${fe}`;return qr(E,fe=>{document.documentElement.lang=fe,y(fe==="ar"?"rtl":"ltr"),t.$i18n.setLocale(fe)}),{dir:i,isRTL:c,setDir:y,lang:E,setLang:L,isInIframe:C,setIsInIframe:P,getPath:K,theme:a,appliedTheme:m,setTheme:async(fe,ye=!1)=>{try{if(ye){const{$axios:ke}=rr(),Fe=Yf(),qe=await ke.post("user/update-profile-settings",{theme:fe,lang:E.value});qe.status!==200?console.error(qe.data.message):Fe.user&&(Fe.user.theme=fe)}}catch(ke){console.error(ke)}finally{a.value=fe}},isMobile:n,toggleLang:V,setAndSaveLang:D,isShrinkedSideBar:U,sidebarReady:W,toggleSideBar:$,shrinkSideBar:Y,expandSideBar:X}}),Z6=xa("toast",()=>{const e=hn(null);return{setToastInstance:i=>{e.value=i},getToastInstance:()=>e.value?e.value:(console.error("Toast instance has not been set properly."),null)}}),Gr={showError(e,t="",n=3e3){t||(Nm().lang==="ar"?t="ØØ¯Ø« خطأ Ù
Ø§Ø ÙØ±Ø¬Ù اÙÙ
ØØ§ÙÙØ© Ù
رة أخرÙ.":t="Something went wrong, please try again later."),this.showToast(e,"error",t,n)},showSuccess(e,t="",n=3e3){t||(Nm().lang==="ar"?t="تÙ
ت Ø§ÙØ¹Ù
ÙÙØ© Ø¨ÙØ¬Ø§Ø.":t="Operation completed successfully."),this.showToast(e,"success",t,n)},showToast(e,t,n,i=3e3){e||(e=Z6().getToastInstance()),e&&e.add({severity:t,detail:n,life:i,closable:!0,group:"headless"})}},Y6=xa("collections",()=>{const{$axios:e,$i18n:t}=rr(),n=t.t,i=hn(!1),c=hn([]),h=Ox();return{isLoading:i,collections:c,fetchCollections:async()=>{i.value=!0;try{const $=await e.get("/collections");if($.status!==200){i.value=!1;return}c.value=$.data.data}catch($){console.error($)}finally{i.value=!1}},fetchCollection:async $=>{try{const Y=await e.get(`/collections/${$}`);return Y.status!==200?null:Y.data.data}catch(Y){return console.error(Y),null}},handleChatRenamed:$=>{c.value.forEach(Y=>{const X=Y.chats.findIndex(K=>K.chat_id===$.chatId);if(X!==-1){const K={...Y.chats[X],title:$.newTitle,updated_at:new Date().toISOString()};Y.chats.splice(X,1),Y.chats.unshift(K)}})},removeChatFromCollection:async($,Y,X=!0)=>{try{X?(await e.delete(`/collections/${$}/chats/${Y}`)).status==200?(c.value=c.value.map(ne=>(ne.id===$&&(ne.chats=ne.chats.filter(fe=>fe.chat_id!==Y)),ne)),Gr.showSuccess(h,n("Platform.toasts.removeFromCollection.success"))):Gr.showError(h,n("Platform.toasts.removeFromCollection.error")):c.value=c.value.map(K=>(K.id===$&&(K.chats=K.chats.filter(ne=>ne.chat_id!==Y)),K))}catch(K){Gr.showError(h,n("Platform.toasts.removeFromCollection.error")),console.error(K)}},swapChatCollection:async($,Y)=>{try{if((await e.put(`/collections/${Y}/chats/${$}`)).status==200){let K=null;const ne=c.value.find(fe=>fe.id===Y);c.value=c.value.map(fe=>{const ye=fe.chats.find(ke=>ke.chat_id===$);return ye&&(K=ye,fe.chats=fe.chats.filter(ke=>ke.chat_id!==$)),fe}),c.value=c.value.map(fe=>(fe.id===Y&&K&&fe.chats.unshift({chat_id:K.chat_id,title:K.title,updated_at:new Date().toISOString(),request_source:K.request_source}),fe)),ne&&Gr.showSuccess(h,n("Platform.toasts.swapCollection.success",{collectionTitle:ne.title}))}else Gr.showError(h,n("Platform.toasts.swapCollection.error"))}catch(X){console.error(X)}},deleteCollection:async $=>{try{return(await e.delete(`/collections/${$}`)).status===200?(c.value=c.value.filter(X=>X.id!==$),Gr.showSuccess(h,n("Platform.collections.deleteModal.successToast")),!0):(Gr.showError(h,n("Platform.collections.deleteModal.errorToast")),!1)}catch(Y){return console.error("Error deleting collection:",Y),Gr.showError(h,n("Platform.collections.deleteModal.errorToast")),!1}},updateCollection:async($,Y,X)=>{try{const K=await e.put(`/collections/${$}`,{title:Y,description:X});if(K.status===200)return c.value=c.value.map(ne=>(ne.id===$&&(ne.title=Y,ne.description=X),ne)),Gr.showSuccess(h,n("Platform.collections.editModal.successToast")),!0;switch(K.status){case 400:Gr.showError(h,n("Platform.collections.editModal.errorToastEmptyTitle"));break;case 409:Gr.showError(h,n("Platform.SideBar.CollectionModal.CollectionExistMsg"));break;default:Gr.showError(h,n("Platform.collections.editModal.errorToast"));break}return!1}catch(K){return console.error("Error updating collection:",K),Gr.showError(h,n("Platform.collections.editModal.errorToast")),!1}},findChatInCollections:$=>c.value.find(Y=>Y.chats.some(X=>X.chat_id===$)),addChatToCollection:async($,Y)=>{try{const X=await e.post(`/collections/${$}/chats/${Y}`);if(X.status===200){const K=X.data.data;c.value=c.value.map(ye=>(ye.id===$&&ye.chats.unshift({chat_id:K.chat_id,title:K.title,updated_at:K.updated_at,request_source:K.request_source}),ye));const ne=c.value.find(ye=>
4ye.id===$)?.title,fe=`${n("Platform.AddChatToCollModal.ChatAddedTo")} ${ne} ${n("Platform.AddChatToCollModal.Successfully")}`;return Gr.showSuccess(h,fe),!0}else{switch(X.status){case 400:Gr.showError(h,n("Platform.AddChatToCollModal.ChatBelongsToCollMsg"));break;case 404:Gr.showError(h,n("Platform.Error"));break;case 403:Gr.showError(h,n("Platform.AddChatToCollModal.PermissionMsg"));break;default:Gr.showError(h,n("Platform.AddChatToCollModal.FailedToAddChat"))}return!1}}catch(X){return Gr.showError(h,n("Platform.AddChatToCollModal.FailedToAddChat")),console.error("Error adding chat to collection:",X),!1}},createCollection:async($,Y)=>{try{const X=await e.post("/collections",{title:$,description:Y}),K=X.data.data;if(X.status==200)return c.value.unshift({id:K.id,title:K.title,description:K.description,is_shared:K.is_shared,created_at:K.created_at,updated_at:K.updated_at,chats:[]}),Gr.showSuccess(h,n("Platform.SideBar.CollectionModal.CollectionSuccessMsg")),!0;switch(X.status){case 409:Gr.showError(h,n("Platform.SideBar.CollectionModal.CollectionExistMsg"));break;case 400:Gr.showError(h,n("Platform.SideBar.CollectionModal.ColletionMustTitleMsg"));break;default:Gr.showError(h,n("Platform.SideBar.CollectionModal.FailedToCreateColl"))}return!1}catch(X){return Gr.showError(h,n("Platform.SideBar.CollectionModal.FailedToCreateColl")),console.error(X),!1}},resetStore:()=>{i.value=!1,c.value=[]}}}),Bo={DEFAULT_CHAT_TITLE:"New Chat",SCROLL_ADJUSTMENT_DELAY:100,ENABLE_STREAM:!0,SUGGESTIONS_LIMIT:4,ENABLE_LOCATION:!0,ENABLE_TABLES_IN_MSG:!0,ENABLE_RESULT_TABLES_IN_MSG:!0,ENABLE_CHART_URL_IN_MSG:!0,ENABLE_MAP_VISUALIZATION:!0,ENABLE_WIDGETS_IN_MSG:!0,ENABLE_INTERACTIVE_CHART_GENERATION:!0},UI=3,Wc={TOO_MANY_REQUESTS:"Try Paseet.errors.too_many_requests",CHECK_CONNECTION:"Try Paseet.errors.check_connection",INPUT_INVALID:"Try Paseet.errors.input_invalid",REPHRASE:"Try Paseet.errors.rephrase",UNAUTHORIZED:"Try Paseet.errors.unauthorized",LIMIT_EXCEEDED:"Try Paseet.errors.limit_exceeded",SOMETHING_WRONG:"Try Paseet.errors.something_wrong"};var Db=(e=>(e.BOT="assistant",e.USER="user",e))(Db||{}),xR=(e=>(e.WEB="web",e.PASEET_PLATFORM="paseet-platform",e.WHATSAPP="whatsapp",e))(xR||{}),kf=(e=>(e.CHUNK="chunk",e.ERROR="error",e.PROGRESS="progress",e.COMPLETE="complete",e.REASONING="reasoning",e.SUGGESTIONS="suggestions",e))(kf||{}),$T=(e=>(e.LOADING="loading",e.COMPLETED="completed",e.ERROR="error",e))($T||{}),gb=(e=>(e.ACCOUNT_CREDIT_EXCEEDED="account-credit-exceeded",e.PROMPTS_CREDIT_EXCEEDED="prompts-credit-exceeded",e.FEATURE_CREDIT_EXCEEDED="feature-credit-exceeded",e))(gb||{}),wR=(e=>(e.TOKEN_CONSUMPTION_WARNING="token_consumption_warning",e))(wR||{}),K6="5.2.0";function PE(e,t){return new Promise(n=>setTimeout(n,e,t))}function tne(){return new Promise(e=>{const t=new MessageChannel;t.port1.onmessage=()=>e(),t.port2.postMessage(null)})}function nne(e,t=1/0){const{requestIdleCallback:n}=window;return n?new Promise(i=>n.call(window,()=>i(),{timeout:t})):PE(Math.min(e,t))}function J6(e){return!!e&&typeof e.then=="function"}function bz(e,t){try{const n=e();J6(n)?n.then(i=>t(!0,i),i=>t(!1,i)):t(!0,n)}catch(n){t(!1,n)}}async function xz(e,t,n=16){const i=Array(e.length);let c=Date.now();for(let h=0;h<e.length;++h){i[h]=t(e[h],h);const m=Date.now();m>=c+n&&(c=m,await tne())}return i}function Jb(e){return e.then(void 0,()=>{}),e}function rne(e,t){for(let n=0,i=e.length;n<i;++n)if(e[n]===t)return!0;return!1}function ine(e,t){return!rne(e,t)}function PM(e){return parseInt(e)}function qc(e){return parseFloat(e)}function th(e,t){return typeof e=="number"&&isNaN(e)?t:e}function Fs(e){return e.reduce((t,n)=>t+(n?1:0),0)}function Q6(e,t=1){if(Math.abs(t)>=1)return Math.round(e/t)*t;{const n=1/t;return Math.round(e*n)/n}}function one(e){var t,n;const i=`Unexpected syntax '${e}'`,c=/^\s*([a-z-]*)(.*)$/i.exec(e),h=c[1]||void 0,m={},a=/([.:#][\w-]+|\[.+?\])/gi,y=(E,C)=>{m[E]=m[E]||[],m[E].push(C)};for(;;){const E=a.exec(c[2]);if(!E)break;const C=E[0];switch(C[0]){case".":y("class",C.slice(1));break;case"#":y("id",C.slice(1));break;
4case"[":{const P=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(C);if(P)y(P[1],(n=(t=P[4])!==null&&t!==void 0?t:P[5])!==null&&n!==void 0?n:"");else throw new Error(i);break}default:throw new Error(i)}}return[h,m]}function sne(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++){const i=e.charCodeAt(n);if(i>127)return new TextEncoder().encode(e);t[n]=i}return t}function Sf(e,t){const n=e[0]>>>16,i=e[0]&65535,c=e[1]>>>16,h=e[1]&65535,m=t[0]>>>16,a=t[0]&65535,y=t[1]>>>16,E=t[1]&65535;let C=0,P=0,L=0,D=0;D+=h+E,L+=D>>>16,D&=65535,L+=c+y,P+=L>>>16,L&=65535,P+=i+a,C+=P>>>16,P&=65535,C+=n+m,C&=65535,e[0]=C<<16|P,e[1]=L<<16|D}function uc(e,t){const n=e[0]>>>16,i=e[0]&65535,c=e[1]>>>16,h=e[1]&65535,m=t[0]>>>16,a=t[0]&65535,y=t[1]>>>16,E=t[1]&65535;let C=0,P=0,L=0,D=0;D+=h*E,L+=D>>>16,D&=65535,L+=c*E,P+=L>>>16,L&=65535,L+=h*y,P+=L>>>16,L&=65535,P+=i*E,C+=P>>>16,P&=65535,P+=c*y,C+=P>>>16,P&=65535,P+=h*a,C+=P>>>16,P&=65535,C+=n*E+i*y+c*a+h*m,C&=65535,e[0]=C<<16|P,e[1]=L<<16|D}function T_(e,t){const n=e[0];t%=64,t===32?(e[0]=e[1],e[1]=n):t<32?(e[0]=n<<t|e[1]>>>32-t,e[1]=e[1]<<t|n>>>32-t):(t-=32,e[0]=e[1]<<t|n>>>32-t,e[1]=n<<t|e[1]>>>32-t)}function Al(e,t){t%=64,t!==0&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function Ao(e,t){e[0]^=t[0],e[1]^=t[1]}const ane=[4283543511,3981806797],lne=[3301882366,444984403];function wz(e){const t=[0,e[0]>>>1];Ao(e,t),uc(e,ane),t[1]=e[0]>>>1,Ao(e,t),uc(e,lne),t[1]=e[0]>>>1,Ao(e,t)}const sT=[2277735313,289559509],aT=[1291169091,658871167],Sz=[0,5],cne=[0,1390208809],une=[0,944331445];function dne(e,t){const n=sne(e);t=t||0;const i=[0,n.length],c=i[1]%16,h=i[1]-c,m=[0,t],a=[0,t],y=[0,0],E=[0,0];let C;for(C=0;C<h;C=C+16)y[0]=n[C+4]|n[C+5]<<8|n[C+6]<<16|n[C+7]<<24,y[1]=n[C]|n[C+1]<<8|n[C+2]<<16|n[C+3]<<24,E[0]=n[C+12]|n[C+13]<<8|n[C+14]<<16|n[C+15]<<24,E[1]=n[C+8]|n[C+9]<<8|n[C+10]<<16|n[C+11]<<24,uc(y,sT),T_(y,31),uc(y,aT),Ao(m,y),T_(m,27),Sf(m,a),uc(m,Sz),Sf(m,cne),uc(E,aT),T_(E,33),uc(E,sT),Ao(a,E),T_(a,31),Sf(a,m),uc(a,Sz),Sf(a,une);y[0]=0,y[1]=0,E[0]=0,E[1]=0;const P=[0,0];switch(c){case 15:P[1]=n[C+14],Al(P,48),Ao(E,P);case 14:P[1]=n[C+13],Al(P,40),Ao(E,P);case 13:P[1]=n[C+12],Al(P,32),Ao(E,P);case 12:P[1]=n[C+11],Al(P,24),Ao(E,P);case 11:P[1]=n[C+10],Al(P,16),Ao(E,P);case 10:P[1]=n[C+9],Al(P,8),Ao(E,P);case 9:P[1]=n[C+8],Ao(E,P),uc(E,aT),T_(E,33),uc(E,sT),Ao(a,E);case 8:P[1]=n[C+7],Al(P,56),Ao(y,P);case 7:P[1]=n[C+6],Al(P,48),Ao(y,P);case 6:P[1]=n[C+5],Al(P,40),Ao(y,P);case 5:P[1]=n[C+4],Al(P,32),Ao(y,P);case 4:P[1]=n[C+3],Al(P,24),Ao(y,P);case 3:P[1]=n[C+2],Al(P,16),Ao(y,P);case 2:P[1]=n[C+1],Al(P,8),Ao(y,P);case 1:P[1]=n[C],Ao(y,P),uc(y,sT),T_(y,31),uc(y,aT),Ao(m,y)}return Ao(m,i),Ao(a,i),Sf(m,a),Sf(a,m),wz(m),wz(a),Sf(m,a),Sf(a,m),("00000000"+(m[0]>>>0).toString(16)).slice(-8)+("00000000"+(m[1]>>>0).toString(16)).slice(-8)+("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)}function hne(e){var t;return{name:e.name,message:e.message,stack:(t=e.stack)===null||t===void 0?void 0:t.split(` 5`),...e}}function fne(e){return/^function\s.*?\{\s*\[native code]\s*}$/.test(String(e))}function pne(e){return typeof e!="function"}function mne(e,t){const n=Jb(new Promise(i=>{const c=Date.now();bz(e.bind(null,t),(...h)=>{const m=Date.now()-c;if(!h[0])return i(()=>({error:h[1],duration:m}));const a=h[1];if(pne(a))return i(()=>({value:a,duration:m}));i(()=>new Promise(y=>{const E=Date.now();bz(a,(...C)=>{const P=m+Date.now()-E;if(!C[0])return y({error:C[1],duration:P});y({value:C[1],duration:P})})}))})}));return function(){return n.then(c=>c())}}function gne(e,t,n,i){const c=Object.keys(e).filter(m=>ine(n,m)),h=Jb(xz(c,m=>mne(e[m],t),i));return async function(){const a=await h,y=await xz(a,P=>Jb(P()),i),E=await Promise.all(y),C={};for(let P=0;P<c.length;++P)C[c[P]]=E[P];return C}}function ej(){const e=window,t=navigator;return Fs(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function _ne(){const e=window,t=navigator;return Fs(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!ej()}function Ay(){const e=window,t=navigator;return Fs(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,(t.vendor||"").indexOf("Google")===0,"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>
5=5}function uu(){const e=window,t=navigator;return Fs(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,t.vendor.indexOf("Apple")===0,"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function RM(){const e=window,{HTMLElement:t,Document:n}=e;return Fs(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),n&&"pointerLockElement"in n.prototype])>=4}function Fx(){const e=window;return fne(e.print)&&String(e.browser)==="[object WebPageNamespace]"}function Bx(){var e,t;const n=window;return Fs(["buildID"in navigator,"MozAppearance"in((t=(e=document.documentElement)===null||e===void 0?void 0:e.style)!==null&&t!==void 0?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function yne(){const e=window,t=navigator,{CSS:n}=e;return Fs(["userActivation"in t,n.supports("color","light-dark(#000, #fff)"),n.supports("height","1lh"),"globalPrivacyControl"in t])>=3}function tj(){const{CSS:e}=window;return Fs([e.supports("selector(::details-content)"),e.supports("selector(::before::marker)"),e.supports("selector(::after::marker)"),!("locale"in CompositionEvent.prototype)])>=3}function vne(){const e=window;return Fs([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3}function bne(){const e=window,{URLPattern:t}=e;return Fs(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}function xne(){const e=window,t=document,{CSS:n,Promise:i,AudioContext:c}=e;return Fs([i&&"try"in i,"caretPositionFromPoint"in t,c&&"onerror"in c.prototype,n.supports("ruby-align","space-around")])>=3}function wne(){const e=window;return Fs(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}function zx(){const e=window,t=navigator,{CSS:n,HTMLButtonElement:i}=e;return Fs([!("getStorageUpdates"in t),i&&"popover"in i.prototype,"CSSCounterStyleRule"in e,n.supports("font-size-adjust: ex-height 0.5"),n.supports("text-transform: full-width")])>=4}function Sne(){if(navigator.platform==="iPad")return!0;const e=screen,t=e.width/e.height;return Fs(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}function Tne(){const e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null}function Ene(){const e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function RC(){const e=Ay(),t=Bx(),n=window,i=navigator,c="connection";return e?Fs([!("SharedWorker"in n),i[c]&&"ontypechange"in i[c],!("sinkId"in new Audio)])>=2:t?Fs(["onorientationchange"in n,"orientation"in n,/android/i.test(i.appVersion)])>=2:!1}function Cne(){const e=navigator,t=window,n=Audio.prototype,{visualViewport:i}=t;return Fs(["srLatency"in n,"srChannelCount"in n,"devicePosture"in e,i&&"segments"in i,"getTextInformation"in Image.prototype])>=3}function Ane(){return Rne()?-4:Ine()}function Ine(){const e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(Pne())return-1;const n=4500,i=5e3,c=new t(1,i,44100),h=c.createOscillator();h.type="triangle",h.frequency.value=1e4;const m=c.createDynamicsCompressor();m.threshold.value=-50,m.knee.value=40,m.ratio.value=12,m.attack.value=0,m.release.value=.25,h.connect(m),m.connect(c.destination),h.start(0);const[a,y]=kne(c),E=Jb(a.then(C=>Mne(C.getChannelData(0).subarray(n)),C=>{if(C.name==="timeout"||C.name==="suspended")return-3;throw C}));return()=>(y(),E)}function Pne(){return uu()&&!RM()&&!wne()}function Rne(){return uu()&&zx()&&Fx()||Ay()&&Cne()&&bne()}function kne(e){let h=()=>{};return[new Promise((a,y)=>{let E=!1,C=0,P=0;e.oncomplete=V=>a(V.renderedBuffer);const L=()=>{setTimeout(()=>y(Tz("timeout")),Math.min(500,P+5e3-Date.now()))},D=()=>{try{const V=e.startRendering();switch(J6(V)&&Jb(V),e.state){case"running":P=Date.now(),E&&L();break;case"suspended":document.hidden||C++,E&&C>=3?y(Tz("suspended")):setTimeout(D,500);break}}catch(V){y(V)}};D(),h=()=>{E||(E=!0,P>0&&L())}}),h]}function Mne(e){let t=0;for(let n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}function Tz(e){const t=new Error(e);return t.name=e,t}async function nj(e,t,n=50){var i,c,h;
5const m=document;for(;!m.body;)await PE(n);const a=m.createElement("iframe");try{for(await new Promise((y,E)=>{let C=!1;const P=()=>{C=!0,y()},L=U=>{C=!0,E(U)};a.onload=P,a.onerror=L;const{style:D}=a;D.setProperty("display","block","important"),D.position="absolute",D.top="0",D.left="0",D.visibility="hidden",t&&"srcdoc"in a?a.srcdoc=t:a.src="about:blank",m.body.appendChild(a);const V=()=>{var U,W;C||(((W=(U=a.contentWindow)===null||U===void 0?void 0:U.document)===null||W===void 0?void 0:W.readyState)==="complete"?P():setTimeout(V,10))};V()});!(!((c=(i=a.contentWindow)===null||i===void 0?void 0:i.document)===null||c===void 0)&&c.body);)await PE(n);return await e(a,a.contentWindow)}finally{(h=a.parentNode)===null||h===void 0||h.removeChild(a)}}function Lne(e){const[t,n]=one(e),i=document.createElement(t??"div");for(const c of Object.keys(n)){const h=n[c].join(" ");c==="style"?One(i.style,h):i.setAttribute(c,h)}return i}function One(e,t){for(const n of t.split(";")){const i=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(n);if(i){const[,c,h,,m]=i;e.setProperty(c,h,m||"")}}}function Dne(){let e=window;for(;;){const t=e.parent;if(!t||t===e)return!1;try{if(t.location.origin!==e.location.origin)return!0}catch(n){if(n instanceof Error&&n.name==="SecurityError")return!0;throw n}e=t}}const Fne="mmMwWLliI0O&1",Bne="48px",E_=["monospace","sans-serif","serif"],Ez=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function zne(){return nj(async(e,{document:t})=>{const n=t.body;n.style.fontSize=Bne;const i=t.createElement("div");i.style.setProperty("visibility","hidden","important");const c={},h={},m=D=>{const V=t.createElement("span"),{style:U}=V;return U.position="absolute",U.top="0",U.left="0",U.fontFamily=D,V.textContent=Fne,i.appendChild(V),V},a=(D,V)=>m(`'${D}',${V}`),y=()=>E_.map(m),E=()=>{const D={};for(const V of Ez)D[V]=E_.map(U=>a(V,U));return D},C=D=>E_.some((V,U)=>D[U].offsetWidth!==c[V]||D[U].offsetHeight!==h[V]),P=y(),L=E();n.appendChild(i);for(let D=0;D<E_.length;D++)c[E_[D]]=P[D].offsetWidth,h[E_[D]]=P[D].offsetHeight;return Ez.filter(D=>C(L[D]))})}function Nne(){const e=navigator.plugins;if(!e)return;const t=[];for(let n=0;n<e.length;++n){const i=e[n];if(!i)continue;const c=[];for(let h=0;h<i.length;++h){const m=i[h];c.push({type:m.type,suffixes:m.suffixes})}t.push({name:i.name,description:i.description,mimeTypes:c})}return t}function Vne(){return Une(Xne())}function Une(e){let t=!1,n,i;const[c,h]=$ne();return jne(c,h)?(t=Gne(h),e?n=i="skipped":[n,i]=Hne(c,h)):n=i="unsupported",{winding:t,geometry:n,text:i}}function $ne(){const e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}function jne(e,t){return!!(t&&e.toDataURL)}function Gne(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}function Hne(e,t){Wne(e,t);const n=$I(e),i=$I(e);return n!==i?["unstable","unstable"]:(qne(e,t),[$I(e),n])}function Wne(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';const n="Cwm fjordbank gly ð";t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(n,4,45)}function qne(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(const[n,i,c]of[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]])t.fillStyle=n,t.beginPath(),t.arc(i,c,40,0,Math.PI*2,!0),t.closePath(),t.fill();t.fillStyle="#f9c",t.arc(60,60,60,0,Math.PI*2,!0),t.arc(60,60,20,0,Math.PI*2,!0),t.fill("evenodd")}function $I(e){return e.toDataURL()}function Xne(){const e=uu()&&zx()&&Fx(),t=Bx()&&yne();return e||t}function Zne(){const e=navigator;let t=0,n;e.maxTouchPoints!==void 0?t=PM(e.maxTouchPoints):e.msMaxTouchPoints!==void 0&&(t=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),n=!0}catch{n=!1}const i="ontouchstart"in window;return{maxTouchPoints:t,touchEvent:n,touchStart:i}}function Yne(){return navigator.oscpu}function Kne(){const e=navigator,t=[],n=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;
5if(n!==void 0&&t.push([n]),Array.isArray(e.languages))Ay()&&vne()||t.push(e.languages);else if(typeof e.languages=="string"){const i=e.languages;i&&t.push(i.split(","))}return t}function Jne(){return window.screen.colorDepth}function Qne(){return th(qc(navigator.deviceMemory),void 0)}function ere(){if(!(uu()&&zx()&&Fx()))return tre()}function tre(){const e=screen,t=i=>th(PM(i),null),n=[t(e.width),t(e.height)];return n.sort().reverse(),n}const nre=2500,rre=10;let jT,jI;function ire(){if(jI!==void 0)return;const e=()=>{const t=SR();TR(t)?jI=setTimeout(e,nre):(jT=t,jI=void 0)};e()}function ore(){return ire(),async()=>{let e=SR();if(TR(e)){if(jT)return[...jT];Tne()&&(await Ene(),e=SR())}return TR(e)||(jT=e),e}}function sre(){const e=uu()&&zx()&&Fx(),t=Bx()&&tj();if(e||t)return()=>Promise.resolve(void 0);const n=ore();return async()=>{const i=await n(),c=h=>h===null?null:Q6(h,rre);return[c(i[0]),c(i[1]),c(i[2]),c(i[3])]}}function SR(){const e=screen;return[th(qc(e.availTop),null),th(qc(e.width)-qc(e.availWidth)-th(qc(e.availLeft),0),null),th(qc(e.height)-qc(e.availHeight)-th(qc(e.availTop),0),null),th(qc(e.availLeft),null)]}function TR(e){for(let t=0;t<4;++t)if(e[t])return!1;return!0}function are(){const e=lre();return e!==void 0&&Bx()&&tj()?e>=8?8:4:e}function lre(){return th(PM(navigator.hardwareConcurrency),void 0)}function cre(){var e;const t=(e=window.Intl)===null||e===void 0?void 0:e.DateTimeFormat;if(t){const i=new t().resolvedOptions().timeZone;if(i)return i}const n=-ure();return`UTC${n>=0?"+":""}${n}`}function ure(){const e=new Date().getFullYear();return Math.max(qc(new Date(e,0,1).getTimezoneOffset()),qc(new Date(e,6,1).getTimezoneOffset()))}function dre(){try{return!!window.sessionStorage}catch{return!0}}function hre(){try{return!!window.localStorage}catch{return!0}}function fre(){if(!(ej()||_ne()))try{return!!window.indexedDB}catch{return!0}}function pre(){return!!window.openDatabase}function mre(){return navigator.cpuClass}function gre(){const{platform:e}=navigator;return e==="MacIntel"&&uu()&&!RM()?Sne()?"iPad":"iPhone":e}function _re(){return navigator.vendor||""}function yre(){const e=[];for(const t of["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"]){const n=window[t];n&&typeof n=="object"&&e.push(t)}return e.sort()}function vre(){const e=document;try{e.cookie="cookietest=1; SameSite=Strict;";const t=e.cookie.indexOf("cookietest=")!==-1;return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch{return!1}}function bre(){const e=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',e("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",e("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",e("LnNwb25zb3JpdA=="),".ylamainos",e("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",e("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",e("LmhlYWRlci1ibG9ja2VkLWFk"),e("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0MjI="),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardChinese:[e("LlppX2FkX2FfSA=="),e("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",e("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),e("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",e("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",e("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",e("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),e("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),e("LmFkZ29vZ2xl"),e("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[e("YW1wLWF1dG8tYWRz"),e("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",e("I2FkX2ludmlld19hcmVh")],adGuardRussian:[e("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),e("LnJlY2xhbWE="),'div[id^="smi2adblock"]',e("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[e("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),e("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",e("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),e("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),e("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",e("I3Jla2xhbWk="),e("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbn
5Rlay5jb20udHIvIl0="),e("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),e("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[e("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[e("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),e("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",e("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",e("I3Jla2xhbW5pLWJveA=="),e("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",e("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[e("I2FkdmVydGVudGll"),e("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",e("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",e("LnNwb25zb3JsaW5rZ3J1ZW4="),e("I3dlcmJ1bmdza3k="),e("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),e("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[e("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",e("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[e("LnJla2xhbW9zX3RhcnBhcw=="),e("LnJla2xhbW9zX251b3JvZG9z"),e("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),e("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),e("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[e("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[e("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),e("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",e("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[e("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),e("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),e("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",e("LmFkX19tYWlu"),e("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[e("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[e("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),e("I2xpdmVyZUFkV3JhcHBlcg=="),e("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),e("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[e("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",e("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),e("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),e("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[e("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),e("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),e("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",e("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),e("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),e("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiX
5Q=="),e("ZGl2I3NrYXBpZWNfYWQ=")],ro:[e("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),e("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[e("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),e("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),e("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",e("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),e("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",e("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}async function xre({debug:e}={}){if(!wre())return;const t=bre(),n=Object.keys(t),i=[].concat(...n.map(m=>t[m])),c=await Sre(i);e&&Tre(t,c);const h=n.filter(m=>{const a=t[m];return Fs(a.map(E=>c[E]))>a.length*.6});return h.sort(),h}function wre(){return uu()||RC()}async function Sre(e){var t;const n=document,i=n.createElement("div"),c=new Array(e.length),h={};Cz(i);for(let m=0;m<e.length;++m){const a=Lne(e[m]);a.tagName==="DIALOG"&&a.show();const y=n.createElement("div");Cz(y),y.appendChild(a),i.appendChild(y),c[m]=a}for(;!n.body;)await PE(50);n.body.appendChild(i);try{for(let m=0;m<e.length;++m)c[m].offsetParent||(h[e[m]]=!0)}finally{(t=i.parentNode)===null||t===void 0||t.removeChild(i)}return h}function Cz(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function Tre(e,t){let n="DOM blockers debug:\n```";for(const i of Object.keys(e)){n+=` 6${i}:`;for(const c of e[i])n+=` 7 ${t[c]?"ð«":"â¡ï¸"} ${c}`}console.log(`${n} 8\`\`\``)}function Ere(){for(const e of["rec2020","p3","srgb"])if(matchMedia(`(color-gamut: ${e})`).matches)return e}function Cre(){if(Az("inverted"))return!0;if(Az("none"))return!1}function Az(e){return matchMedia(`(inverted-colors: ${e})`).matches}function Are(){if(Iz("active"))return!0;if(Iz("none"))return!1}function Iz(e){return matchMedia(`(forced-colors: ${e})`).matches}const Ire=100;function Pre(){if(matchMedia("(min-monochrome: 0)").matches){for(let e=0;e<=Ire;++e)if(matchMedia(`(max-monochrome: ${e})`).matches)return e;throw new Error("Too high value")}}function Rre(){if(C_("no-preference"))return 0;if(C_("high")||C_("more"))return 1;if(C_("low")||C_("less"))return-1;if(C_("forced"))return 10}function C_(e){return matchMedia(`(prefers-contrast: ${e})`).matches}function kre(){if(Pz("reduce"))return!0;if(Pz("no-preference"))return!1}function Pz(e){return matchMedia(`(prefers-reduced-motion: ${e})`).matches}function Mre(){if(Rz("reduce"))return!0;if(Rz("no-preference"))return!1}function Rz(e){return matchMedia(`(prefers-reduced-transparency: ${e})`).matches}function Lre(){if(kz("high"))return!0;if(kz("standard"))return!1}function kz(e){return matchMedia(`(dynamic-range: ${e})`).matches}const Di=Math,Oa=()=>0;function Ore(){const e=Di.acos||Oa,t=Di.acosh||Oa,n=Di.asin||Oa,i=Di.asinh||Oa,c=Di.atanh||Oa,h=Di.atan||Oa,m=Di.sin||Oa,a=Di.sinh||Oa,y=Di.cos||Oa,E=Di.cosh||Oa,C=Di.tan||Oa,P=Di.tanh||Oa,L=Di.exp||Oa,D=Di.expm1||Oa,V=Di.log1p||Oa,U=ke=>Di.pow(Di.PI,ke),W=ke=>Di.log(ke+Di.sqrt(ke*ke-1)),$=ke=>Di.log(ke+Di.sqrt(ke*ke+1)),Y=ke=>Di.log((1+ke)/(1-ke))/2,X=ke=>Di.exp(ke)-1/Di.exp(ke)/2,K=ke=>(Di.exp(ke)+1/Di.exp(ke))/2,ne=ke=>Di.exp(ke)-1,fe=ke=>(Di.exp(2*ke)-1)/(Di.exp(2*ke)+1),ye=ke=>Di.log(1+ke);return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:W(1e154),asin:n(.12312423423423424),asinh:i(1),asinhPf:$(1),atanh:c(.5),atanhPf:Y(.5),atan:h(.5),sin:m(-1e300),sinh:a(1),sinhPf:X(1),cos:y(10.000000000123),cosh:E(1),coshPf:K(1),tan:C(-1e300),tanh:P(1),tanhPf:fe(1),exp:L(1),expm1:D(1),expm1Pf:ne(1),log1p:V(10),log1pPf:ye(10),powPI:U(-100)}}const Dre="mmMwWLliI0fiflO&1",GI={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function Fre(){return zre((e,t,n)=>{const i={},c={};for(const m of Object.keys(GI)){const[a={},y=Dre]=GI[m],E=e.createElement("span");E.textContent=y,E.style.whiteSpace="nowrap";for(const C of Object.keys(a)){const P=a[C];P!==void 0&&(E.style[C]=P)}i[m]=E,t.append(e.createElement("br"),E)}const h=Ay()&&xne();for(const m of Object.keys(GI)){const a=i[m].getBoundingClientRect().width;c[m]=h?Bre(a*n.devicePixelRatio):a}return c})}function Bre(e){const t=RC()?0:3,n=Math.pow(10,t);return Math.floor(e*n)/n}function zre(e,t=4e3){return nj((n,i)=>{const c=i.document,h=c.body,m=h.style;m.width=`${t}px`,m.webkitTextSizeAdjust=m.textSizeAdjust="none",Ay()?h.style.zoom=`${1/i.devicePixelRatio}
8`:uu()&&(h.style.zoom="reset");const a=c.createElement("div");return a.textContent=[...Array(t/20<<0)].map(()=>"word").join(" "),h.appendChild(a),e(c,h,i)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}function Nre(){return navigator.pdfViewerEnabled}function Vre(){const e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}function Ure(){const{ApplePaySession:e}=window;if(typeof e?.canMakePayments!="function")return-1;if($re())return-3;try{return e.canMakePayments()?1:0}catch(t){return jre(t)}}const $re=Dne;function jre(e){if(e instanceof Error&&e.name==="InvalidAccessError"&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}function Gre(){var e;const t=document.createElement("a"),n=(e=t.attributionSourceId)!==null&&e!==void 0?e:t.attributionsourceid;return n===void 0?void 0:String(n)}const rj=-1,ij=-2,Hre=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),Wre=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),qre=["FRAGMENT_SHADER","VERTEX_SHADER"],Xre=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],oj="WEBGL_debug_renderer_info",Zre="WEBGL_polygon_mode";function Yre({cache:e}){var t,n,i,c,h,m;const a=sj(e);if(!a)return rj;if(!lj(a))return ij;const y=aj()?null:a.getExtension(oj);return{version:((t=a.getParameter(a.VERSION))===null||t===void 0?void 0:t.toString())||"",vendor:((n=a.getParameter(a.VENDOR))===null||n===void 0?void 0:n.toString())||"",vendorUnmasked:y?(i=a.getParameter(y.UNMASKED_VENDOR_WEBGL))===null||i===void 0?void 0:i.toString():"",renderer:((c=a.getParameter(a.RENDERER))===null||c===void 0?void 0:c.toString())||"",rendererUnmasked:y?(h=a.getParameter(y.UNMASKED_RENDERER_WEBGL))===null||h===void 0?void 0:h.toString():"",shadingLanguageVersion:((m=a.getParameter(a.SHADING_LANGUAGE_VERSION))===null||m===void 0?void 0:m.toString())||""}}function Kre({cache:e}){const t=sj(e);if(!t)return rj;if(!lj(t))return ij;const n=t.getSupportedExtensions(),i=t.getContextAttributes(),c=[],h=[],m=[],a=[],y=[];if(i)for(const C of Object.keys(i))h.push(`${C}=${i[C]}`);const E=Mz(t);for(const C of E){const P=t[C];m.push(`${C}=${P}${Hre.has(P)?`=${t.getParameter(P)}`:""}`)}if(n)for(const C of n){if(C===oj&&aj()||C===Zre&&eie())continue;const P=t.getExtension(C);if(!P){c.push(C);continue}for(const L of Mz(P)){const D=P[L];a.push(`${L}=${D}${Wre.has(D)?`=${t.getParameter(D)}`:""}`)}}for(const C of qre)for(const P of Xre){const L=Jre(t,C,P);y.push(`${C}.${P}=${L.join(",")}`)}return a.sort(),m.sort(),{contextAttributes:h,parameters:m,shaderPrecisions:y,extensions:n,extensionParameters:a,unsupportedExtensions:c}}function sj(e){if(e.webgl)return e.webgl.context;const t=document.createElement("canvas");let n;t.addEventListener("webglCreateContextError",()=>n=void 0);for(const i of["webgl","experimental-webgl"]){try{n=t.getContext(i)}catch{}if(n)break}return e.webgl={context:n},n}function Jre(e,t,n){const i=e.getShaderPrecisionFormat(e[t],e[n]);return i?[i.rangeMin,i.rangeMax,i.precision]:[]}function Mz(e){return Object.keys(e.__proto__).filter(Qre)}function Qre(e){return typeof e=="string"&&!e.match(/[^A-Z0-9_x]/)}function aj(){return Bx()}function eie(){return Ay()||uu()}function lj(e){return typeof e.getParameter=="function"}function tie(){if(!(RC()||uu()))return-2;if(!window.AudioContext)return-1;const t=new AudioContext().baseLatency;return t==null?-1:isFinite(t)?t:-3}function nie(){if(!window.Intl)return-1;const e=window.Intl.DateTimeFormat;if(!e)return-2;const t=e().resolvedOptions().locale;return!t&&t!==""?-3:t}function rie(e){return/not/i.test(e)}async function iie(){const e=navigator.userAgentData;if(!e)return;const t=e.brands.filter(({brand:c}
8)=>!rie(c)).map(({brand:c})=>c),i={brands:t.length>1?t.filter(c=>c!=="Chromium"):t,mobile:e.mobile,platform:e.platform};if(e.getHighEntropyValues)try{const c=await e.getHighEntropyValues(["architecture","bitness","model","platformVersion"]);i.architecture=c.architecture,i.bitness=c.bitness,i.model=c.model,i.platformVersion=c.platformVersion}catch(c){if(c instanceof DOMException&&c.name==="NotAllowedError")i.highEntropyStatus="not_allowed";else throw c}return i}const oie={userAgentData:iie,fonts:zne,domBlockers:xre,fontPreferences:Fre,audio:Ane,screenFrame:sre,canvas:Vne,osCpu:Yne,languages:Kne,colorDepth:Jne,deviceMemory:Qne,screenResolution:ere,hardwareConcurrency:are,timezone:cre,sessionStorage:dre,localStorage:hre,indexedDB:fre,openDatabase:pre,cpuClass:mre,platform:gre,plugins:Nne,touchSupport:Zne,vendor:_re,vendorFlavors:yre,cookiesEnabled:vre,colorGamut:Ere,invertedColors:Cre,forcedColors:Are,monochrome:Pre,contrast:Rre,reducedMotion:kre,reducedTransparency:Mre,hdr:Lre,math:Ore,pdfViewerEnabled:Nre,architecture:Vre,applePay:Ure,privateClickMeasurement:Gre,audioBaseLatency:tie,dateTimeLocale:nie,webGlBasics:Yre,webGlExtensions:Kre};function sie(e){return gne(oie,e,[])}const aie="$ if upgrade to Pro: https://fingerprint.com/github/?utm_source=oss&utm_medium=referral&utm_campaign=confidence_score";function lie(e){const t=cie(e),n=uie(t);return{score:t,comment:aie.replace(/\$/g,`${n}`)}}function cie(e){if(RC())return .4;if(uu())return RM()&&!(zx()&&Fx())?.5:.3;const t="value"in e.platform?e.platform.value:"";return/^Win/.test(t)?.6:/^Mac/.test(t)?.5:.7}function uie(e){return Q6(.99+.01*e,1e-4)}function die(e){let t="";for(const n of Object.keys(e).sort()){const i=e[n],c="error"in i?"error":JSON.stringify(i.value);t+=`${t?"|":""}${n.replace(/([:|\\])/g,"\\$1")}:${c}`}return t}function cj(e){return JSON.stringify(e,(t,n)=>n instanceof Error?hne(n):n,2)}function uj(e){return dne(die(e))}function hie(e){let t;const n=lie(e);return{get visitorId(){return t===void 0&&(t=uj(this.components)),t},set visitorId(i){t=i},confidence:n,components:e,version:K6}}function fie(e=50){return nne(e,e*2)}function pie(e,t){const n=Date.now();return{async get(i){const c=Date.now(),h=await e(),m=hie(h);return(t||i?.debug)&&console.log(`Copy the text below to get the debug data: 9 10\`\`\` 11version: ${m.version} 12userAgent: ${navigator.userAgent} 13timeBetweenLoadAndGet: ${c-n} 14visitorId: ${m.visitorId} 15components: ${cj(h)} 16\`\`\``),m}}}function mie(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{const e=new XMLHttpRequest;e.open("get",`https://m1.openfpcdn.io/fingerprintjs/v${K6}/npm-monitoring`,!0),e.send()}catch(e){console.error(e)}}async function gie(e={}){const{delayFallback:t,debug:n,monitoring:i=!0}=e;i&&mie(),await fie(t);const c=sie({cache:{},debug:n});return pie(c,n)}var _ie={load:gie,hashComponents:uj,componentsToDebugString:cj};const yie=async()=>(await(await _ie.load()).get()).visitorId;var ER=(e=>(e.CHAT_RENAMED="chatRenamed",e.TABLE_LOCATIONS_TOGGLE="tableLocationsToggle",e))(ER||{});function dj(){const e=yz(ER.CHAT_RENAMED),t=yz(ER.TABLE_LOCATIONS_TOGGLE);return{chatRenamedBus:e,tableLocationsToggleBus:t}}const HI=(e,t)=>{const n={role:Db.BOT,msg:e.msg,...t&&{error:t},results:[{page_number:1,results_data:e.results,has_more:e.has_more}],charts:e.charts||[],visualizations:e.visualizations?.map(i=>({uuid:i.uuid,visType:i.visType,metadata:i.metadata})),uuid:e.uuid??void 0,ishelpful:null,allow_regenerate:e.allow_regenerate||!1,detected_lang:e.detected_lang,created_at:new Date().toISOString()};return e.form&&(n.form=e.form),e.offers&&(n.offers=e.offers),e.created_job&&(n.created_job=e.created_job),e.citations&&(n.citations=e.citations),e.embedded_results?.length&&(n.embedded_results=e.embedded_results),e.suggestions?.length&&(n.suggestions=e.suggestions),e.insights?.length&&(n.insights=e.insights),e.enrichments?.length&&(n.enrichments=e.enrichments),e.chartUrl&&(n.charts=[{chart_url:e.chartUrl,chart_config:e.chartConfig,chart_uuid:e.chart_uuid,explanation:e.explanation,page_number:1,custom_request:"",is_helpful:null,created_at:new Date().toISOString()}]),n},vie={map:{minWidthPct:30,maxWidthPct:70,mobileMode:"split"},chart:{minWidthPct:32,maxWidthPct:40,mobileMode:"sheet",titleKey:"Platform.Chatbox.charts.title"},citations:{minWidthPct:32,maxWidthPct:40,mobileMode:"sheet",titleKey:"Platform.Chatbox.citations.sources"}},bie={minWidthPct:30,maxWidthPct:70,mobileMode:"split"},hj=xa("rightPane",()=>{const e=hn(null),t=hn(!1),n=vn(()=>e.value!==null),i=vn(()=>e.value?vie[e.value]:bie);return{activePane:e,expanded:t,isOpen:n,activeConfig:i,isPane:E=>e.value===E,open:E=>{e.value=E},close:()=>{e.value=null,t.value=!1},toggleExpanded:()=>{t.value=!t.value},setExpanded:E=>{t.value=E}}});let WI=()=>{},qI=()=>{};const xie=xa("chartPane",()=>{const e=hn(void 0),t=hn([]),n=hn(""),i=hn(null),c=hn(null),h=C=>WI(C),m=(C,P)=>qI(C,P),a=C=>{e.value=C.messageUuid,t.value=C.existingCharts,WI=C.onChartGenerated,qI=C.onChartFeedbackUpdated,y()},y=()=>{n.value="",i.value=null,c.value=null};return{messageUuid:e,existingCharts:t,onChartGenerated:h,onChartFeedbackUpdated:m,customRequest:n,visualizationType:i,chartType:c,setContext:a,resetForm:y,clear:()=>{e.value=void 0,t.value=[],WI=()=>{},qI=()=>{},y()}}});function wie(e,t){const{$i18n:n,$logger:i}=rr(),c=n.t,h=(V,U)=>{switch(V){case 429:return c(Wc.TOO_MANY_REQUESTS);case 503:return c(Wc.CHECK_CONNECTION);
16case 402:case 422:case 424:return U.message==="Input is not valid"?c(Wc.INPUT_INVALID):U.message;case 449:return c(Wc.REPHRASE);case 404:return U.message;case 401:return c(Wc.UNAUTHORIZED);case 403:return c(Wc.LIMIT_EXCEEDED);default:return console.log("Unexpected response:",V),c(Wc.SOMETHING_WRONG)}},m=(V,U,W)=>{const $=V.event?.target?.response;if(!$)return!1;const Y=$.substring(U.lastProcessedLength);if(!Y)return!1;U.value+=Y,U.lastProcessedLength=$.length;const X=U.value.split(` 17 18`),K=X.pop(),ne=X.filter(ye=>ye.trim());if(ne.length===0)return U.value=K||"",!1;U.value=K||"";let fe=!1;for(const ye of ne)if(ye.startsWith("data:")){fe=!0;try{const ke=ye.substring(5).trim();if(!ke)continue;const Fe=JSON.parse(ke);switch(Fe.type){case kf.CHUNK:a(Fe,W);break;case kf.ERROR:y(Fe);break;case kf.PROGRESS:E(Fe);break;case kf.REASONING:C(Fe);break;case kf.SUGGESTIONS:t.onSuggestions?.(Fe);break;case kf.COMPLETE:t.onComplete?.();break;default:console.warn("Unknown streaming event type:",Fe.type);break}}catch(ke){console.error("Failed to parse streaming event:",{error:ke instanceof Error?ke.message:"Unknown parsing error",eventPreview:ye.substring(0,200)+(ye.length>200?"...":""),bufferSize:U.value.length})}}return fe},a=(V,U)=>{const W=V.content,$=V.session_id;t.onChunk?.(W,$,V.response_id),U.value&&$&&(t.onFirstMessage?.($),U.value=!1),V.chat_title&&t.onTitleUpdate?.(V.chat_title)},y=V=>{const U=h(V.status,V);t.onError?.(V.status,U,V.data)},E=V=>{V.timestamp=new Date().toISOString(),t.onProgress?.(V)},C=V=>{V.timestamp=new Date().toISOString(),t.onReasoning?.(V)},P=(V,U)=>{const W=V.data,$=W.session_id;W.responses&&Array.isArray(W.responses)?W.responses.forEach((X,K)=>{const ne={...X,session_id:$};t.onResponse?.(ne,$,K)}):t.onResponse?.(W,$),U.value&&$&&t.onFirstMessage?.($,W.chat_title),W.chat_title&&t.onTitleUpdate?.(W.chat_title),t.onComplete?.()},L=(V,U,W)=>{const $=h(V,U);[422,424].includes(V)&&U.data?.session_id,t.onError?.(V,$,U)};return{sendMessage:async(V,U,W)=>{V.session_id===null&&delete V.session_id;const $={value:"",lastProcessedLength:0};let Y=!1;const X=hn(W);try{const K=await e.axiosInstance.post(e.endpoint,V,{headers:{"x-fingerprint":U.fingerprint,"x-accept":U.enableStreaming?"text/event-stream":"application/json"},onDownloadProgress:U.enableStreaming?ne=>{m(ne,$,X)&&(Y=!0)}:void 0});K.status===200&&!Y?P(K.data,X):K.status!==200&&L(K.status,K.data,X)}catch(K){K.response?L(K.response.status,K.response.data):t.onError?.(500,c(Wc.SOMETHING_WRONG),null)}finally{Y||t.onComplete?.()}},processStreamedResponse:m,processNormalResponse:P,handleErrorResponse:h,handleApiError:L}}function Iy(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var GT={exports:{}},Sie=GT.exports,Lz;function Tie(){return Lz||(Lz=1,(function(e,t){(function(n,i){e.exports=i()})(Sie,(function(){let n,i,c;function h(a,y){if(!n)n=y;else if(!i)i=y;else{const E={};n(void 0,E),c=y(E);const C="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+n+")(undefined, sharedChunk); ("+i+")(undefined, sharedChunk); self.onerror = null;";typeof window<"u"&&window&&window.URL&&window.URL.createObjectURL&&(c.workerUrl=window.URL.createObjectURL(new Blob([C],{type:"text/javascript"})))}}h(["require","exports"],function(a,y){var E=1e-6,C=typeof Float32Array<"u"?Float32Array:Array;function P(l,r){var s=r[0],u=r[1],f=r[2],g=r[3],v=s*g-f*u;return v?(l[0]=g*(v=1/v),l[1]=-u*v,l[2]=-f*v,l[3]=s*v,l):null}function L(){var l=new C(9);return C!=Float32Array&&(l[1]=0,l[2]=0,l[3]=0,l[5]=0,l[6]=0,l[7]=0),l[0]=1,l[4]=1,l[8]=1,l}function D(l,r){var s=r[0],u=r[1],f=r[2],g=r[3],v=r[4],x=r[5],w=r[6],A=r[7],R=r[8];return l[0]=v*R-x*A,l[1]=f*A-u*R,l[2]=u*x-f*v,l[3]=x*w-g*R,l[4]=s*R-f*w,l[5]=f*g-s*x,l[6]=g*A-v*w,l[7]=u*w-s*A,l[8]=s*v-u*g,l}function V(l,r,s){var u=r[0],f=r[1],g=r[2],v=r[3],x=r[4],w=r[5],A=r[6],R=r[7],M=r[8],O=s[0],B=s[1],N=s[2],G=s[3],H=s[4],J=s[5],re=s[6],Q=s[7],le=s[8];return l[0]=O*u+B*v+N*A,l[1]=O*f+B*x+N*R,l[2]=O*g+B*w+N*M,l[3]=G*u+H*v+J*A,l[4]=G*f+H*x+J*R,l[5]=G*g+H*w+J*M,l[6]=re*u+Q*v+le*A,l[7]=re*f+Q*x+le*R,l[8]=re*g+Q*w+le*M,l}function U(){var l=new C(16);return C!=Float32Array&&(l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[11]=0,l[12]=0,l[13]=0,l[14]=0),l[0]=1,l[5]=1,l[10
vendor: 8,665 bytes, line 18
18]=1,l[15]=1,l}function W(l){var r=new C(16);return r[0]=l[0],r[1]=l[1],r[2]=l[2],r[3]=l[3],r[4]=l[4],r[5]=l[5],r[6]=l[6],r[7]=l[7],r[8]=l[8],r[9]=l[9],r[10]=l[10],r[11]=l[11],r[12]=l[12],r[13]=l[13],r[14]=l[14],r[15]=l[15],r}function $(l){return l[0]=1,l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=1,l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[10]=1,l[11]=0,l[12]=0,l[13]=0,l[14]=0,l[15]=1,l}function Y(l,r){var s=r[0],u=r[1],f=r[2],g=r[3],v=r[4],x=r[5],w=r[6],A=r[7],R=r[8],M=r[9],O=r[10],B=r[11],N=r[12],G=r[13],H=r[14],J=r[15],re=s*x-u*v,Q=s*w-f*v,le=s*A-g*v,ue=u*w-f*x,he=u*A-g*x,Te=f*A-g*w,me=R*G-M*N,xe=R*H-O*N,_e=R*J-B*N,we=M*H-O*G,je=M*J-B*G,He=O*J-B*H,Qe=re*He-Q*je+le*we+ue*_e-he*xe+Te*me;return Qe?(l[0]=(x*He-w*je+A*we)*(Qe=1/Qe),l[1]=(f*je-u*He-g*we)*Qe,l[2]=(G*Te-H*he+J*ue)*Qe,l[3]=(O*he-M*Te-B*ue)*Qe,l[4]=(w*_e-v*He-A*xe)*Qe,l[5]=(s*He-f*_e+g*xe)*Qe,l[6]=(H*le-N*Te-J*Q)*Qe,l[7]=(R*Te-O*le+B*Q)*Qe,l[8]=(v*je-x*_e+A*me)*Qe,l[9]=(u*_e-s*je-g*me)*Qe,l[10]=(N*he-G*le+J*re)*Qe,l[11]=(M*le-R*he-B*re)*Qe,l[12]=(x*xe-v*we-w*me)*Qe,l[13]=(s*we-u*xe+f*me)*Qe,l[14]=(G*Q-N*ue-H*re)*Qe,l[15]=(R*ue-M*Q+O*re)*Qe,l):null}function X(l,r,s){var u=r[0],f=r[1],g=r[2],v=r[3],x=r[4],w=r[5],A=r[6],R=r[7],M=r[8],O=r[9],B=r[10],N=r[11],G=r[12],H=r[13],J=r[14],re=r[15],Q=s[0],le=s[1],ue=s[2],he=s[3];return l[0]=Q*u+le*x+ue*M+he*G,l[1]=Q*f+le*w+ue*O+he*H,l[2]=Q*g+le*A+ue*B+he*J,l[3]=Q*v+le*R+ue*N+he*re,l[4]=(Q=s[4])*u+(le=s[5])*x+(ue=s[6])*M+(he=s[7])*G,l[5]=Q*f+le*w+ue*O+he*H,l[6]=Q*g+le*A+ue*B+he*J,l[7]=Q*v+le*R+ue*N+he*re,l[8]=(Q=s[8])*u+(le=s[9])*x+(ue=s[10])*M+(he=s[11])*G,l[9]=Q*f+le*w+ue*O+he*H,l[10]=Q*g+le*A+ue*B+he*J,l[11]=Q*v+le*R+ue*N+he*re,l[12]=(Q=s[12])*u+(le=s[13])*x+(ue=s[14])*M+(he=s[15])*G,l[13]=Q*f+le*w+ue*O+he*H,l[14]=Q*g+le*A+ue*B+he*J,l[15]=Q*v+le*R+ue*N+he*re,l}function K(l,r,s){var u,f,g,v,x,w,A,R,M,O,B,N,G=s[0],H=s[1],J=s[2];return r===l?(l[12]=r[0]*G+r[4]*H+r[8]*J+r[12],l[13]=r[1]*G+r[5]*H+r[9]*J+r[13],l[14]=r[2]*G+r[6]*H+r[10]*J+r[14],l[15]=r[3]*G+r[7]*H+r[11]*J+r[15]):(f=r[1],g=r[2],v=r[3],x=r[4],w=r[5],A=r[6],R=r[7],M=r[8],O=r[9],B=r[10],N=r[11],l[0]=u=r[0],l[1]=f,l[2]=g,l[3]=v,l[4]=x,l[5]=w,l[6]=A,l[7]=R,l[8]=M,l[9]=O,l[10]=B,l[11]=N,l[12]=u*G+x*H+M*J+r[12],l[13]=f*G+w*H+O*J+r[13],l[14]=g*G+A*H+B*J+r[14],l[15]=v*G+R*H+N*J+r[15]),l}function ne(l,r,s){var u=s[0],f=s[1],g=s[2];return l[0]=r[0]*u,l[1]=r[1]*u,l[2]=r[2]*u,l[3]=r[3]*u,l[4]=r[4]*f,l[5]=r[5]*f,l[6]=r[6]*f,l[7]=r[7]*f,l[8]=r[8]*g,l[9]=r[9]*g,l[10]=r[10]*g,l[11]=r[11]*g,l[12]=r[12],l[13]=r[13],l[14]=r[14],l[15]=r[15],l}function fe(l,r,s){var u=Math.sin(s),f=Math.cos(s),g=r[4],v=r[5],x=r[6],w=r[7],A=r[8],R=r[9],M=r[10],O=r[11];return r!==l&&(l[0]=r[0],l[1]=r[1],l[2]=r[2],l[3]=r[3],l[12]=r[12],l[13]=r[13],l[14]=r[14],l[15]=r[15]),l[4]=g*f+A*u,l[5]=v*f+R*u,l[6]=x*f+M*u,l[7]=w*f+O*u,l[8]=A*f-g*u,l[9]=R*f-v*u,l[10]=M*f-x*u,l[11]=O*f-w*u,l}function ye(l,r,s){var u=Math.sin(s),f=Math.cos(s),g=r[0],v=r[1],x=r[2],w=r[3],A=r[8],R=r[9],M=r[10],O=r[11];return r!==l&&(l[4]=r[4],l[5]=r[5],l[6]=r[6],l[7]=r[7],l[12]=r[12],l[13]=r[13],l[14]=r[14],l[15]=r[15]),l[0]=g*f-A*u,l[1]=v*f-R*u,l[2]=x*f-M*u,l[3]=w*f-O*u,l[8]=g*u+A*f,l[9]=v*u+R*f,l[10]=x*u+M*f,l[11]=w*u+O*f,l}function ke(l,r,s){var u=Math.sin(s),f=Math.cos(s),g=r[0],v=r[1],x=r[2],w=r[3],A=r[4],R=r[5],M=r[6],O=r[7];return r!==l&&(l[8]=r[8],l[9]=r[9],l[10]=r[10],l[11]=r[11],l[12]=r[12],l[13]=r[13],l[14]=r[14],l[15]=r[15]),l[0]=g*f+A*u,l[1]=v*f+R*u,l[2]=x*f+M*u,l[3]=w*f+O*u,l[4]=A*f-g*u,l[5]=R*f-v*u,l[6]=M*f-x*u,l[7]=O*f-w*u,l}function Fe(l,r){return l[0]=1,l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=1,l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[10]=1,l[11]=0,l[12]=r[0],l[13]=r[1],l[14]=r[2],l[15]=1,l}function qe(l,r){return l[0]=r[0],l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=r[1],l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[10]=r[2],l[11]=0,l[12]=0,l[13]=0,l[14]=0,l[15]=1,l}function lt(l,r,s){var u,f,g,v=s[0],x=s[1],w=s[2],A=Math.sqrt(v*v+x*x+w*w);return A<E?null:(v*=A=1/A,x*=A,w*=A,u=Math.sin(r),f=Math.cos(r),l[0]=v*v*(g=1-f)+f,l[1]=x*v*g+w*u,l[2]=w*v*g-x*u,l[3]=0,l[4]=v*x*g-w*u,l[5]=x*x*g+f,l[6]=w*x*g+v*u,l[7]=0,l[8]=v*w*g+x*u,l[9]=x*w*g-v*u,l[10]=w*w*g+f,l[11]=0,l[12]=0,l[13]=0,l[14]=0,l[15]=1,l)}function pt(l,r){var s=r[0],u=r[1],f=r[2],g=r[4],v=r[5],x=r[6],w=r[8],A=r[9],R=r[10];return l[0]=Math.sqrt(s*s+u*u+f*f),l[1]=Math.sqrt(g*g+v*v+x*x),l[2]=Math.sqrt(w*w+A*A+R*R),l}function Qt(l,r){var s=r[0],u=r[1],f=r[2],g=r[3],v=s+s,x=u+u,w=f+f,A=s*v,R=u*v,M=u*x,O=f*v,B=f*x,N=f*w,G=g*v,H=g*x,J=g*w;return l[0]=1-M-N,l[1]=R+J,l[2]=O-H,l[3]=0,l[4]=R-J,l[5]=1-A-N,l[6]=B+G,l[7]=0,l[8]=O+H,l[9]=B-G,l[10]=1-A-M,l[11]=0,l[12]=0,l[13]=0,l[14]=0,l[15]=1,l}var Ht=X;function zt(){var l=new C(3);return C!=Float32Array&&(l[0]=0,l[1]=0,l[2]=0),l}function jt(l){var r=new C(3);return r[0]=l[0],r[1]=l[1],r[2]=l[2],r}function Zt(l){var r=l[0],s=l[1],u=l[2];return Math.sqrt(r*r+s*s+u*u)}function Wt(l,r,s){var u=new C(3);return u[0]=l,u[1]=r,u[2]=s,u}function en(l,r,s,u){return l[0]=r,l[1]=s,l[2]=u,l}function sn(l,r,s){return l[0]=r[0]+s[0],l[1]=r[1]+s[1],l[2]=r[2]+s[2],l}function Mn(l,r,s){return l[0]=r[0]-s[0],l[1]=r[1]-s[1],l[2]=r[2]-s[2],l}function xn(l,r,s){return l[0]=r[0]*s[0],l[1]=r[1]*s[1],l[2]=r[2]*s[2],l}function Vn(l,r,s){return l[0]=Math.min(r[0],s[0]),l[1]=Math.min(r[1],s[1]),l[2]=Math.min(r[2],s[2]),l}function Ln(l,r,s){return l[0]=Math.max(r[0],s[0]),l[1]=Math.max(r[1],s[1]),l[2]=Math.max(r[2],s[2]),l}function Yn(l,r,s){return l[0]=r[0]*s,l[1]=r[1]*s,l[2]=r[2]*s,l}function Rn(l,r,s,u){return l[0]=r[0]+s[0]*u,l[1]=r[1]+s[1]*u,l[2]=r[2]+s[2]*u,l}function $t(l,r){var s=r[0]-l[0],u=r[1]-l[1],f=r[2]-l[2];return Math.sqrt(s*s+u*u+f*f)}function fn(l,r){var s=r[0]-l[0],u=r[1]-l[1],f=r[2]-l[2];return s*s+u*u+f*f}function yn(l){var r=l[0],s=l[1],u=l[2];return r*r+s*s+u*u}function Cn(l,r){return l[0]=-r[0],l[1]=-r[1],l[2]=-r[2],l}function _n(l,r){var s=r[0],u=r[1],f=r[2],g=s*s+u*u+f*f;return g>0&&(g=1/Math.sqrt(g)),l[0]=r[0]*g,l[1]=r[1]*g,l[2]=r[2]*g,l}function Bn(l,r){return l[0]*r[0]+l[1]*r[1]+l[2]*r[2]}function Be(l,r,s){var u=r[0],f=r[1],g=r[2],v=s[0],x=s[1],w=s[2];return l[0]=f*w-g*x,l[1]=g*v-u*w,l[2]=u*x-f*v,l}function Xe(l,r,s,u){var f=r[0],g=r[1],v=r[2];return l[0]=f+u*(s[0]-f),l[1]=g+u*(s[1]-g),l[2]=v+u*(s[2]-v),l}function mt(l,r,s){var u=r[0],f=r[1],g=r[2],v=s[3]*u+s[7]*f+s[11]*g+s[15];return l[0]=(s[0]*u+s[4]*f+s[8]*g+s[12])/(v=v||1),l[1]=(s[1]*u+s[5]*f+s[9]*g+s[13])/v,l[2]=(s[2]*u+s[6]*f+s[10]*g+s[14])/v,l}function kt(l,r,s){var u=r[0],f=r[1],g=r[2];return l[0]=u*s[0]+f*s[3]+g*s[6],l[1]=u*s[1]+f*s[4]+g*s[7],l[2]=u*s[2]+f*s[5]+g*s[8],l}function Vt(l,r,s){var u=s[0],f=s[1],g=s[2],v=s[3],x=r[0],w=r[1],A=r[2],R=f*A-g*w,M=g*x-u*A,O=u*w-f*x;return l[0]=x+v*(R+=R)+f*(O+=O)-g*(M+=M),l[1]=w+v*M+g*R-u*O,l[2]=A+v*O+u*M-f*R,l}function Ie(l){return l[0]=0,l[1]=0,l[2]=0,l}function Ve(l,r){return l[0]===r[0]&&l[1]===r[1]&&l[2]===r[2]}var tt=Mn,Rt=xn,Ut=Zt;function nn(){var l=new C(4);return C!=Float32Array&&(l[0]=0,l[1]=0,l[2]=0,l[3]=0),l}function st(l,r,s){return l[0]=r[0]*s,l[1]=r[1]*s,l[2]=r[2]*s,l[3]=r[3]*s,l}function Lt(l,r){var s=r[0],u=r[1],f=r[2],g=r[3],v=s*s+u*u+f*f+g*g;return v>0&&(v=1/Math.sqrt(v)),l[0]=s*v,l[1]=u*v,l[2]=f*v,l[3]=g*v,l}function mn(l,r,s){var u=r[0],f=r[1],g=r[2],v=r[3];return l[0]=s[0]*u+s[4]*f+s[8]*g+s[12]*v,l[1]=s[1]*u+s[5]*f+s[9]*g+s[13]*v,l[2]=s[2]*u+s[6]*f+s[10]*g+s[14]*v,l[3]=s[3]*u+s[7]*f+s[11]*g+s[15]*v,l}function Hn(){var l=new C(4);return C!=Float32Array&&(l[0]=0,l[1]=0,l[2]=0),l[3]=1,l}function ir(l){return l[0]=0,l[1]=0,l[2]=0,l[3]=1,l}function hr(l,r,s){s*=.5;var u=r[0],f=r[1],g=r[2],v=r[3],x=Math.sin(s),w=Math.cos(s);return l[0]=u*w+v*x,l[1]=f*w+g*x,l[2]=g*w-f*x,l[3]=v*w-u*x,l}function Sr(l,r,s){s*=.5;var u=r[0],f=r[1],g=r[2],v=r[3],x=Math.sin(s),w=Math.cos(s);return l[0]=u*w-g*x,l[1]=f*w+v*x,l[2]=g*w+u*x,l[3]=v*w-f*x,l}zt(),nn();var zn,cr,Un,Ur=Lt,ko=(zn=zt(),cr=Wt(1,0,0),Un=Wt(0,1,0),function(l,r,s){var u=Bn(r,s);return u<-.999999?(Be(zn,cr,r),Ut(zn)<1e-6&&Be(zn,Un,r),_n(zn,zn),(function(f,g,v){v*=.5;var x=Math.sin(v);f[0]=x*g[0],f[1]=x*g[1],f[2]=x*g[2],f[3]=Math.cos(v)})(l,zn,Math.PI),l):u>.999999?(l[0]=0,l[1]=0,l[2]=0,l[3]=1,l):(Be(zn,r,s),l[0]=zn[0],l[1]=zn[1],l[2]=zn[2],l[3]=1+u,Ur(l,l))});function Lr(){var l=new C(2);return C!=Float32Array&&(l[0]=0,l[1]=0),l}function ar(l,r){var s=new C(2);return s[0]=l,s[1]=r,s}function nr(l,r,s){return l[0]=r,l[1]=s,l}function ro(l,r,s){return l[0]=r[0]+s[0],l[1]=r[1]+s[1],l}function ms(l,r,s){return l[0]=r[0]-s[0],l[1]=r[1]-s[1],l}function Ks(l,r,s){return l[0]=r[0]*s,l[1]=r[1]*s,l}function xc(l){var r=l[0],s=l[1];return Math.sqrt(r*r+s*s)}function wc(l,r){var s=r[0],u=r[1],f=s*s+u*u;return f>0&&(f=1/Math.sqrt(f)),l[0]=r[0]*f,l[1]=r[1]*f,l}function Js(l,r){return l[0]*r[0]+l[1]*r[1]}Hn(),Hn(),L();var hu,ud,Sc=ms;
18function fu(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}Lr();var Eh=(function(){if(ud)return hu;function l(r,s,u,f){this.cx=3*r,this.bx=3*(u-r)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*s,this.by=3*(f-s)-this.cy,this.ay=1-this.cy-this.by,this.p1x=r,this.p1y=s,this.p2x=u,this.p2y=f}return ud=1,hu=l,l.prototype={sampleCurveX:function(r){return((this.ax*r+this.bx)*r+this.cx)*r},sampleCurveY:function(r){return((this.ay*r+this.by)*r+this.cy)*r},sampleCurveDerivativeX:function(r){return(3*this.ax*r+2*this.bx)*r+this.cx},solveCurveX:function(r,s){if(s===void 0&&(s=1e-6),r<0)return 0;if(r>1)return 1;for(var u=r,f=0;f<8;f++){var g=this.sampleCurveX(u)-r;if(Math.abs(g)<s)return u;var v=this.sampleCurveDerivativeX(u);if(Math.abs(v)<1e-6)break;u-=g/v}var x=0,w=1;for(u=r,f=0;f<20&&(g=this.sampleCurveX(u),!(Math.abs(g-r)<s));f++)r>g?x=u:w=u,u=.5*(w-x)+x;return u},solve:function(r,s){return this.sampleCurveY(this.solveCurveX(r,s))}},hu})(),pu=fu(Eh);function St(l,r){this.x=l,this.y=r}function dl(l,r){if(Array.isArray(l)){if(!Array.isArray(r)||l.length!==r.length)return!1;for(let s=0;s<l.length;s++)if(!dl(l[s],r[s]))return!1;return!0}if(typeof l=="object"&&l!==null&&r!==null){if(typeof r!="object"||Object.keys(l).length!==Object.keys(r).length)return!1;for(const s in l)if(!dl(l[s],r[s]))return!1;return!0}return l===r}St.prototype={clone(){return new St(this.x,this.y)},add(l){return this.clone()._add(l)},sub(l){return this.clone()._sub(l)},multByPoint(l){return this.clone()._multByPoint(l)},divByPoint(l){return this.clone()._divByPoint(l)},mult(l){return this.clone()._mult(l)},div(l){return this.clone()._div(l)},rotate(l){return this.clone()._rotate(l)},rotateAround(l,r){return this.clone()._rotateAround(l,r)},matMult(l){return this.clone()._matMult(l)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(l){return this.x===l.x&&this.y===l.y},dist(l){return Math.sqrt(this.distSqr(l))},distSqr(l){const r=l.x-this.x,s=l.y-this.y;return r*r+s*s},angle(){return Math.atan2(this.y,this.x)},angleTo(l){return Math.atan2(this.y-l.y,this.x-l.x)},angleWith(l){return this.angleWithSep(l.x,l.y)},angleWithSep(l,r){return Math.atan2(this.x*r-this.y*l,this.x*l+this.y*r)},_matMult(l){const r=l[2]*this.x+l[3]*this.y;return this.x=l[0]*this.x+l[1]*this.y,this.y=r,this},_add(l){return this.x+=l.x,this.y+=l.y,this},_sub(l){return this.x-=l.x,this.y-=l.y,this},_mult(l){return this.x*=l,this.y*=l,this},_div(l){return this.x/=l,this.y/=l,this},_multByPoint(l){return this.x*=l.x,this.y*=l.y,this},_divByPoint(l){return this.x/=l.x,this.y/=l.y,this},_unit(){return this._div(this.mag()),this},_perp(){const l=this.y;return this.y=this.x,this.x=-l,this},_rotate(l){const r=Math.cos(l),s=Math.sin(l),u=s*this.x+r*this.y;return this.x=r*this.x-s*this.y,this.y=u,this},_rotateAround(l,r){const s=Math.cos(l),u=Math.sin(l),f=r.y+u*(this.x-r.x)+s*(this.y-r.y);return this.x=r.x+s*(this.x-r.x)-u*(this.y-r.y),this.y=f,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:St},St.convert=function(l){if(l instanceof St)return l;if(Array.isArray(l))return new St(+l[0],+l[1]);if(l.x!==void 0&&l.y!==void 0)return new St(+l.x,+l.y);throw new Error("Expected [x, y] or {x, y} point format")};const Nl=Math.PI/180,Tc=180/Math.PI,mu=/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,Ge=/\b(iPad|iPhone|iPod)\b/,ie=/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/;function ae(l){return l*Nl}function ge(l){return l*Tc}const Pe=[[0,0],[1,0],[1,1],[0,1]];function Me(l){if(l<=0)return 0;if(l>=1)return 1;const r=l*l,s=r*l;return 4*(l<.5?s:3*(l-r)+s-.75)}function Oe(l,r,s,u){const f=new pu(l,r,s,u);return function(g){return f.solve(g)}}const Je=Oe(.25,.1,.25,1);function Ee(l,r,s){return Math.min(s,Math.max(r,l))}function We(l,r,s){return(s=Ee((s-l)/(r-l),0,1))*s*(3-2*s)}function Et(l,r,s){const u=s-r,f=((l-r)%u+u)%u+r;return f===r?s:f}function vt(l,r,s){if(!l.length)return s(null,[]);let u=l.length;const f=new Array(l.length);let g=null;l.forEach((v,x)=>{r(v,(w,A)=>{w&&(g=w),f[x]=A,--u===0&&s(g,f)})})}function Le(l,r){const s={};for(let u=0;u<r.length;u++){const f=r[u];f in l&&(s[f]=l[f])}return s}let yt=1;function Ot(){return yt++}function qt(l){return l<=1?1:Math.pow(2,Math.ceil(Math.log2(l)))}function cn(l,r){l.forEach(s=>{r[s]&&(r[s]=r[s].bind(r))})}function ht(l,r,s){const u={};for(const f in l)u[f]=r.call(this,l[f],f,l);return u}function ln(l,r,s){const u={};for(const f in l)r.call(this,l[f],f,l)&&(u[f]=l[f]);return u}function Kn(l){return Array.isArray(l)?l.map(Kn):typeof l=="object"&&l?ht(l,Kn):l}function Hr(l,r){for(let s=0;s<l.length;s++)if(r.includes(l[s]))return!0;return!1}const ti={};function On(l){ti[l]||(typeof console<"u"&&console.warn(l),ti[l]=!0)}function br(l,r,s){return(s.y-l.y)*(r.x-l.x)>(r.y-l.y)*(s.x-l.x)}function si(l){let r=0;for(let s,u,f=0,g=l.length,v=g-1;f<g;v=f++)s=l[f],u=l[v],r+=(u.x-s.x)*(s.y+u.y);return r}function bi([l,r,s]){const u=ae(r+90),f=ae(s);return{x:l*Math.cos(u)*Math.sin(f),y:l*Math.sin(u)*Math.sin(f),z:l*Math.cos(f),azimuthal:r,polar:s}}function Pr(l){return(typeof self<"u"||l!==void 0)&&typeof WorkerGlobalScope<"u"&&(l!==void 0?l:self)instanceof WorkerGlobalScope}function ni(l){const r={};if(l.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(s,u,f,g)=>{const v=f||g;return r[u]=!v||v.toLowerCase(),""}),r["max-age"]){const s=parseInt(r["max-age"],10);isNaN(s)?delete r["max-age"]:r["max-age"]=s}return r}let xi,Qr=null;function Xi(l,r){return[l[4*r],l[4*r+1],l[4*r+2],l[4*r+3]]}function Xo(l,r,s,u){for(;r<s;){const f=r+s>>1;l[f]<u?r=f+1:s=f}return r}function So(l,r,s,u){for(;r<s;){const f=r+s>>1;l[f]<=u?r=f+1:s=f}return r}function ho(l){return l>0?1/(1.001-l):1+l}function Vl(l){return l>0?1-1/(1.001-l):-l}function hl(l,r,s){return(l-r.min)*(s.max-s.min)/(r.max-r.min)+s.min}const Xr={API_URL:"https://api.mapbox.com",API_URL_REGEX:/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i,API_TILEJSON_REGEX:/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i,API_SPRITE_REGEX:/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i,API_FONTS_REGEX:/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i,API_STYLE_REGEX:/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i,API_CDN_URL_REGEX:/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i,get EVENTS_URL(){if(!Xr.API_URL)return null;try{const l=new URL(Xr.API_URL);return l.hostname==="api.mapbox.cn"?"https://events.mapbox.cn/events/v2":l.hostname==="api.mapbox.com"?"https://events.mapbox.com/events/v2":null}catch{return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",RASTERARRAYS_URL_PREFIX:"rasterarrays/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,DEFAULT_STYLE:"mapbox://styles/mapbox/standard",MAX_PARALLEL_IMAGE_REQUESTS:16,DRACO_URL:"/mapbox-gl-js/draco_decoder_gltf_v1.5.6.wasm",MES
18HOPT_URL:"/mapbox-gl-js/meshopt_base_v0.20.wasm",MESHOPT_SIMD_URL:"/mapbox-gl-js/meshopt_simd_v0.20.wasm",BUILDING_GEN_URL:"/mapbox-gl-js/building-gen/building_gen_v1.2.4.wasm",GLYPHS_URL:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf",TILES3D_URL_PREFIX:"3dtiles/v1",TILE_PROVIDER_URLS:Object.assign(Object.create(null),{pmtiles:"/mapbox-gl-js/plugins/mapbox-gl-pmtiles-provider/v0.0.2/mapbox-gl-pmtiles-provider.js"})};function gu(){return new URL(Xr.DRACO_URL,Xr.API_URL).href}function dd(){if(typeof WebAssembly!="object")throw new Error("WebAssembly not supported, cannot instantiate meshoptimizer");return new URL((function(){if(xi===void 0){if(typeof WebAssembly!="object")return!1;const l=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]);xi=WebAssembly.validate(l)}return xi})()?Xr.MESHOPT_SIMD_URL:Xr.MESHOPT_URL,Xr.API_URL).href}function hd(){return new URL(Xr.BUILDING_GEN_URL,Xr.API_URL).href}function _u(l){return Xr.API_URL_REGEX.test(l)}function Ch(l){return Xr.API_SPRITE_REGEX.test(l)}let Ym,up,wi,rs,fd,Ah;function Ul(){return Ym==null&&(Ym=self.OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&typeof self.createImageBitmap=="function"),Ym}const Qs={requestIdleCallback:l=>{if(typeof requestIdleCallback<"u")return requestIdleCallback(l);setTimeout(()=>l({didTimeout:!1,timeRemaining:()=>50}),0)},now:()=>rs!==void 0?rs:performance.now(),setNow(l){rs=l},restoreNow(){rs=void 0},frame(l){const r=requestAnimationFrame(l);return{cancel:()=>cancelAnimationFrame(r)}},getImageData(l,r=0){const{width:s,height:u}=l;fd||(fd=document.createElement("canvas"));const f=fd.getContext("2d",{willReadFrequently:!0});if(!f)throw new Error("failed to create canvas 2d context");return(s>fd.width||u>fd.height)&&(fd.width=s,fd.height=u),f.clearRect(-r,-r,s+2*r,u+2*r),f.drawImage(l,0,0,s,u),f.getImageData(-r,-r,s+2*r,u+2*r)},resolveURL:l=>(up||(up=document.createElement("a")),up.href=l,up.href),get devicePixelRatio(){return window.devicePixelRatio},get prefersReducedMotion(){return!!window.matchMedia&&(wi==null&&(wi=window.matchMedia("(prefers-reduced-motion: reduce)")),wi.matches)},hasCanvasFingerprintNoise(){if(Ah!==void 0)return Ah;if(!Ul())return Ah=!1,!1;const l=new OffscreenCanvas(85,1),r=l.getContext("2d",{willReadFrequently:!0});let s=0;for(let f=0;f<l.width;++f)r.fillStyle=`rgba(${s++},${s++},${s++}, 255)`,r.fillRect(f,0,1,1);const u=r.getImageData(0,0,l.width,l.height);s=0;for(let f=0;f<u.data.length;++f)if(f%4!=3&&s++!==u.data[f])return Ah=!0,!0;return Ah=!1,!1}};function r1(l,r){const s=l.indexOf("?");if(s<0)return`${l}?${new URLSearchParams(r).toString()}`;const u=new URLSearchParams(l.slice(s));for(const f in r)u.set(f,r[f]);return`${l.slice(0,s)}?${u.toString()}`}
18function Ly(l,r={persistentParams:[]}){const s=l.indexOf("?");if(s<0)return l;const u=new URLSearchParams,f=new URLSearchParams(l.slice(s));for(const v of r.persistentParams){const x=f.get(v);x&&u.set(v,x)}const g=u.toString();return`${l.slice(0,s)}${g.length>0?`?${g}`:""}`}const i1="mapbox-tiles";let o1=500,s1=50;const a1=["language","worldview","jobid"];let Ec;function dp(){try{return caches}catch{}}function Km(){const l=dp();l&&Ec==null&&(Ec=l.open(i1))}let Oy=1/0;const Dy={supported:!1,testSupport:function(l){!Ih&&$l&&(Fy?zy(l):gs=l)}};let gs,$l,Ih=!1,Fy=!1;const By=typeof self<"u"?self:{};function zy(l){const r=l.createTexture();l.bindTexture(l.TEXTURE_2D,r);try{if(l.texImage2D(l.TEXTURE_2D,0,l.RGBA,l.RGBA,l.UNSIGNED_BYTE,$l),l.isContextLost())return;Dy.supported=!0}catch{}l.deleteTexture(r),Ih=!0}By.document&&($l=By.document.createElement("img"),$l.onload=function(){gs&&zy(gs),gs=null,Fy=!0},$l.onerror=function(){Ih=!0,gs=null},$l.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const pd={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Iconset:"Iconset",Image:"Image",Model:"Model"};Object.freeze(pd);class Cc extends Error{constructor(r,s,u){s===401&&_u(u)&&(r+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(r),this.status=s,this.url=u}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}function hp(l){return typeof l=="object"&&l!==null&&"status"in l&&l.status===404}const Jm=Pr()?()=>self.worker.referrer:()=>(location.protocol==="blob:"?parent:self).location.href,l1=/^\w+:/,Ac=/[\r\n]+/,fp=function(l,r){return(s=l.url).startsWith("file:")||Jm().startsWith("file:")&&!l1.test(s)?(function(u,f){const g=new XMLHttpRequest;g.open(u.method||"GET",u.url,!0),u.type==="arrayBuffer"&&(g.responseType="arraybuffer");for(const v in u.headers)g.setRequestHeader(v,u.headers[v]);return u.type==="json"&&(g.responseType="text",g.setRequestHeader("Accept","application/json")),g.withCredentials=u.credentials==="include",g.onerror=()=>{f(new Error(g.statusText))},g.onload=()=>{if((g.status>=200&&g.status<300||g.status===0)&&g.response!==null){let v=g.response;if(u.type==="json")try{v=JSON.parse(g.response)}catch(w){return f(w)}const x=new Headers;g.getAllResponseHeaders().trim().split(Ac).forEach(w=>{const A=w.split(": "),R=A.shift(),M=A.join(": ");x.append(R,M)}),f(null,v,x)}else f(new Cc(g.statusText,g.status,u.url))},g.send(u.body),{cancel:()=>g.abort()}})(l,r):(function(u,f){const g=new AbortController,v=new Request(u.url,{method:u.method||"GET",body:u.body,credentials:u.credentials,headers:u.headers,referrer:Jm(),referrerPolicy:u.referrerPolicy,signal:g.signal});let x=!1,w=!1;const A=(R=v.url).indexOf("sku=")>0&&_u(R);var R;u.type==="json"&&v.headers.set("Accept","application/json");const M=(B,N,G)=>{if(w)return;if(B&&B.message!=="SecurityError"&&On(B.toString()),N&&G)return O(N);const H=Date.now();fetch(v).then(J=>{if(J.ok){const re=A?J.clone():null;return O(J,re,H)}return f(new Cc(J.statusText,J.status,u.url))}).catch(J=>{J.name!=="AbortError"&&f(new Error(`${J.message} ${u.url}`))})},O=(B,N,G)=>{(u.type==="arrayBuffer"?B.arrayBuffer():u.type==="json"?B.json():B.text()).then(H=>{w||(N&&G&&(function(J,re,Q){if(Km(),Ec==null)return;const le=ni(re.headers.get("cache-control")||"");if(le["no-store"])return;const ue={status:re.status,statusText:re.statusText,headers:new Headers};re.headers.forEach((_e,we)=>ue.headers.set(we,_e)),le["max-age"]&&ue.headers.set("Expires",new Date(Q+1e3*le["max-age"]).toUTCString());const he=ue.headers.get("expires");if(!he||new Date(he).getTime()-Q<42e4)return;
18let Te=Ly(J.url,{persistentParams:a1});if(re.status===206){const _e=J.headers.get("Range");if(!_e)return;ue.status=200,Te=r1(Te,{range:_e})}const me=new Response((xe=re.status)!==200&&xe!==404&&[101,103,204,205,304].includes(xe)?null:re.body,ue);var xe;Km(),Ec?.then(_e=>_e.put(Te,me)).catch(_e=>On(_e.message))})(v,N,G),x=!0,f(null,H,B.headers))}).catch(H=>{w||f(new Error(H.message))})};return A?(function(B,N){if(Km(),Ec==null)return N(null);Ec.then(G=>{let H=Ly(B.url,{persistentParams:a1});const J=B.headers.get("Range");J&&(H=r1(H,{range:J})),G.match(H).then(re=>{const Q=(function(le){if(!le)return!1;const ue=new Date(le.headers.get("expires")||0),he=ni(le.headers.get("cache-control")||"");return Number(ue)>Date.now()&&!he["no-cache"]})(re);G.delete(H).catch(N),Q&&G.put(H,re.clone()).catch(N),N(null,re,Q)}).catch(N)}).catch(N)})(v,M):M(null,null),{cancel:()=>{w=!0,x||g.abort()}}})(l,r);var s},Ny=function(l,r){return fp(Object.assign(l,{type:"json"}),r)},Ph=function(l,r){return fp(Object.assign(l,{type:"arrayBuffer"}),r)};function u2(l){const r=document.createElement("a");return r.href=l,r.protocol===location.protocol&&r.host===location.host}let Qm,ea;Qm=[],ea=0;const Vy=function(l,r){if(Dy.supported&&(l.headers||(l.headers={}),l.headers.accept="image/webp,*/*"),ea>=Xr.MAX_PARALLEL_IMAGE_REQUESTS){const g={requestParameters:l,callback:r,cancelled:!1,cancel(){this.cancelled=!0}};return Qm.push(g),g}ea++;let s=!1;const u=()=>{if(!s)for(s=!0,ea--;Qm.length&&ea<Xr.MAX_PARALLEL_IMAGE_REQUESTS;){const g=Qm.shift(),{requestParameters:v,callback:x,cancelled:w}=g;w||(g.cancel=Vy(v,x).cancel)}},f=Ph(l,(g,v,x)=>{u(),g?r(g):v&&(function(w,A){const R=new Blob([new Uint8Array(w)],{type:"image/png"});createImageBitmap(R).then(M=>{A(null,M)}).catch(M=>{A(new Error(`Could not load image because of ${M.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})})(v,(w,A)=>r(w,A,x))});return{cancel:()=>{f.cancel(),u()}}};var eg,yu,pp,Rh={exports:{}},Uy={exports:{}},c1={exports:{}},u1=(function(){if(pp)return Rh.exports;pp=1;var l=(eg||(eg=1,Uy.exports=function(s,u){var f,g,v,x,w,A,R,M;for(g=s.length-(f=3&s.length),v=u,w=3432918353,A=461845907,M=0;M<g;)R=255&s.charCodeAt(M)|(255&s.charCodeAt(++M))<<8|(255&s.charCodeAt(++M))<<16|(255&s.charCodeAt(++M))<<24,++M,v=27492+(65535&(x=5*(65535&(v=(v^=R=(65535&(R=(R=(65535&R)*w+(((R>>>16)*w&65535)<<16)&4294967295)<<15|R>>>17))*A+(((R>>>16)*A&65535)<<16)&4294967295)<<13|v>>>19))+((5*(v>>>16)&65535)<<16)&4294967295))+(((x>>>16)+58964&65535)<<16);switch(R=0,f){case 3:R^=(255&s.charCodeAt(M+2))<<16;case 2:R^=(255&s.charCodeAt(M+1))<<8;case 1:v^=R=(65535&(R=(R=(65535&(R^=255&s.charCodeAt(M)))*w+(((R>>>16)*w&65535)<<16)&4294967295)<<15|R>>>17))*A+(((R>>>16)*A&65535)<<16)&4294967295}return v^=s.length,v=2246822507*(65535&(v^=v>>>16))+((2246822507*(v>>>16)&65535)<<16)&4294967295,v=3266489909*(65535&(v^=v>>>13))+((3266489909*(v>>>16)&65535)<<16)&4294967295,(v^=v>>>16)>>>0}),Uy.exports),r=(yu||(yu=1,c1.exports=function(s,u){for(var f,g=s.length,v=u^g,x=0;g>=4;)f=1540483477*(65535&(f=255&s.charCodeAt(x)|(255&s.charCodeAt(++x))<<8|(255&s.charCodeAt(++x))<<16|(255&s.charCodeAt(++x))<<24))+((1540483477*(f>>>16)&65535)<<16),v=1540483477*(65535&v)+((1540483477*(v>>>16)&65535)<<16)^(f=1540483477*(65535&(f^=f>>>24))+((1540483477*(f>>>16)&65535)<<16)),g-=4,++x;switch(g){case 3:v^=(255&s.charCodeAt(x+2))<<16;case 2:v^=(255&s.charCodeAt(x+1))<<8;case 1:v=1540483477*(65535&(v^=255&s.charCodeAt(x)))+((1540483477*(v>>>16)&65535)<<16)}return v=1540483477*(65535&(v^=v>>>13))+((1540483477*(v>>>16)&65535)<<16),(v^=v>>>15)>>>0}),c1.exports);return Rh.exports=l,Rh.exports.murmur3=l,Rh.exports.murmur2=r,Rh.exports})(),tg=fu(u1);class fl{constructor(r,...s){Object.assign(this,s[0]||{}),this.type=r}}class kh extends fl{constructor(r,s={}){super("error",Object.assign({error:r},s))}}function Mh(l,r,s){s[l]&&s[l].includes(r)||(s[l]=s[l]||[],s[l].push(r))}function ng(l,r,s){if(s&&s[l]){const u=s[l].indexOf(r);u!==-1&&s[l].splice(u,1)}}class Lh{on(r,s){return this._listeners=this._listeners||{},Mh(r,s,this._listeners),this}off(r,s){return ng(r,s,this._listeners),ng(r,s,this._oneTimeListeners),this}once(r,s){return s?(this._oneTimeListeners=this._oneTimeListeners||{},Mh(r,s,this._oneTimeListeners),this):new Promise(u=>{this.once(r,u)})}fire(r,s){const u=typeof r=="string"?new fl(r,s):r,f=u.type;if(this.listens(f)){u.target=this;const g=this._listeners&&this._listeners[f]?this._listeners[f].slice():[];for(const w of g)w.call(this,u);const v=this._oneTimeListeners&&this._oneTimeListeners[f]?this._oneTimeListeners[f].slice():[];for(const w of v)ng(f,w,this._oneTimeListeners),w.call(this,u);const x=this._eventedParent;if(x){const w=typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData;Object.assign(u,w),x.fire(u)}}else u instanceof kh&&console.error(u.error);return this}listens(r){return!!(this._listeners&&this._listeners[r]&&this._listeners[r].length>0||this._oneTimeListeners&&this._oneTimeListeners[r]&&this._oneTimeListeners[r].length>0||this._eventedParent&&this._eventedParent.listens(r))}setEventedParent(r,s){return this._eventedParent=r,this._eventedParentData=s,this}}class is{constructor(r){typeof r=="string"?this.name=r:(this.name=r.name,this.iconsetId=r.iconsetId)}static from(r){return new is(r)}static toString(r){return r.iconsetId?`${r.name}�${r.iconsetId}`:r.name}
18static parse(r){const[s,u]=r.split("�");return new is({name:s,iconsetId:u})}static isEqual(r,s){return r.name===s.name&&r.iconsetId===s.iconsetId}toString(){return is.toString(this)}serialize(){return{name:this.name,iconsetId:this.iconsetId}}}var $y,Oh={},d1=(function(){if($y)return Oh;$y=1;var l={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function r(g){return(g=Math.round(g))<0?0:g>255?255:g}function s(g){return r(g[g.length-1]==="%"?parseFloat(g)/100*255:parseInt(g))}function u(g){return(v=g[g.length-1]==="%"?parseFloat(g)/100:parseFloat(g))<0?0:v>1?1:v;var v}function f(g,v,x){return x<0?x+=1:x>1&&(x-=1),6*x<1?g+(v-g)*x*6:2*x<1?v:3*x<2?g+(v-g)*(2/3-x)*6:g}try{Oh.parseCSSColor=function(g){var v,x=g.replace(/ /g,"").toLowerCase();if(x in l)return l[x].slice();if(x[0]==="#")return x.length===4?(v=parseInt(x.substr(1),16))>=0&&v<=4095?[(3840&v)>>4|(3840&v)>>8,240&v|(240&v)>>4,15&v|(15&v)<<4,1]:null:x.length===7&&(v=parseInt(x.substr(1),16))>=0&&v<=16777215?[(16711680&v)>>16,(65280&v)>>8,255&v,1]:null;var w=x.indexOf("("),A=x.indexOf(")");if(w!==-1&&A+1===x.length){var R=x.substr(0,w),M=x.substr(w+1,A-(w+1)).split(","),O=1;switch(R){case"rgba":if(M.length!==4)return null;O=u(M.pop());case"rgb":return M.length!==3?null:[s(M[0]),s(M[1]),s(M[2]),O];case"hsla":if(M.length!==4)return null;O=u(M.pop());case"hsl":if(M.length!==3)return null;var B=(parseFloat(M[0])%360+360)%360/360,N=u(M[1]),G=u(M[2]),H=G<=.5?G*(N+1):G
18+N-G*N,J=2*G-H;return[r(255*f(J,H,B+1/3)),r(255*f(J,H,B)),r(255*f(J,H,B-1/3)),O];default:return null}}return null}}catch{}return Oh})();function Sn(l,r,s){return l*(1-s)+r*s}class xr{constructor(r,s,u,f=1){this.r=r,this.g=s,this.b=u,this.a=f}static parse(r){if(!r)return;if(r instanceof xr)return r;if(typeof r!="string")return;const s=d1.parseCSSColor(r);return s?new xr(s[0]/255,s[1]/255,s[2]/255,s[3]):void 0}toString(){const{r,g:s,b:u,a:f}=this;return`rgba(${Math.round(255*r)},${Math.round(255*s)},${Math.round(255*u)},${f})`}toNonPremultipliedRenderColor(r){const{r:s,g:u,b:f,a:g}=this;return new h1(r,s,u,f,g)}toPremultipliedRenderColor(r){const{r:s,g:u,b:f,a:g}=this;return new f1(r,s*g,u*g,f*g,g)}clone(){return new xr(this.r,this.g,this.b,this.a)}}class rg{constructor(r,s,u,f,g,v=!1){if(this.premultiplied=!1,this.premultiplied=v,r){const x=r.image.height,w=x*x;this.premultiplied?(s=g===0?0:s/g*(x-1),u=g===0?0:u/g*(x-1),f=g===0?0:f/g*(x-1)):(s*=x-1,u*=x-1,f*=x-1),s=Math.max(0,Math.min(x-1,s)),u=Math.max(0,Math.min(x-1,u)),f=Math.max(0,Math.min(x-1,f));const A=Math.floor(s),R=Math.floor(u),M=Math.floor(f),O=Math.ceil(s),B=Math.ceil(u),N=Math.ceil(f),G=s-A,H=u-R,J=f-M,re=r.image.data,Q=4*(A+R*w+M*x),le=4*(A+R*w+N*x),ue=4*(A+B*w+M*x),he=4*(A+B*w+N*x),Te=4*(O+R*w+M*x),me=4*(O+R*w+N*x),xe=4*(O+B*w+M*x),_e=4*(O+B*w+N*x);this.r=Sn(Sn(Sn(re[Q],re[le],J),Sn(re[ue],re[he],J),H),Sn(Sn(re[Te],re[me],J),Sn(re[xe],re[_e],J),H),G)/255*(this.premultiplied?g:1),this.g=Sn(Sn(Sn(re[Q+1],re[le+1],J),Sn(re[ue+1],re[he+1],J),H),Sn(Sn(re[Te+1],re[me+1],J),Sn(re[xe+1],re[_e+1],J),H),G)/255*(this.premultiplied?g:1),this.b=Sn(Sn(Sn(re[Q+2],re[le+2],J),Sn(re[ue+2],re[he+2],J),H),Sn(Sn(re[Te+2],re[me+2],J),Sn(re[xe+2],re[_e+2],J),H),G)/255*(this.premultiplied?g:1),this.a=g}else this.r=s,this.g=u,this.b=f,this.a=g}toArray(){const{r,g:s,b:u,a:f}=this;return[255*r,255*s,255*u,f]}toHslaArray(){let{r,g:s,b:u,a:f}=this;if(this.premultiplied){if(f===0)return[0,0,0,0];const N=1/f;r*=N,s*=N,u*=N}const g=Math.min(Math.max(r,0),1),v=Math.min(Math.max(s,0),1),x=Math.min(Math.max(u,0),1),w=Math.min(g,v,x),A=Math.max(g,v,x),R=A-w,M=.5*(w+A);if(R===0)return[0,0,100*M,f];const O=M>.5?R/(2-A-w):R/(A+w);let B;switch(A){case g:B=60*((v-x)/R+(v<x?6:0));break;case v:B=60*((x-g)/R+2);break;default:B=60*((g-v)/R+4)}return[B,100*O,100*M,f]}toArray01(){const{r,g:s,b:u,a:f}=this;return[r,s,u,f]}toArray01Scaled(r){const{r:s,g:u,b:f}=this;return[s*r,u*r,f*r]}toArray01Linear(){const{r,g:s,b:u,a:f}=this;return[Math.pow(r,2.2),Math.pow(s,2.2),Math.pow(u,2.2),f]}}class h1 extends rg{constructor(r,s,u,f,g){super(r,s,u,f,g,!1)}}class f1 extends rg{constructor(r,s,u,f,g){super(r,s,u,f,g,!0)}}function p1(l,r,s){return l.map((u,f)=>Sn(u,r[f],s))}xr.black=new xr(0,0,0,1),xr.white=new xr(1,1,1,1),xr.transparent=new xr(0,0,0,0),xr.red=new xr(1,0,0,1),xr.blue=new xr(0,0,1,1);var ig=Object.freeze({__proto__:null,array:p1,color:function(l,r,s){return new xr(Sn(l.r,r.r,s),Sn(l.g,r.g,s),Sn(l.b,r.b,s),Sn(l.a,r.a,s))},number:Sn});class pl extends Error{constructor(r,s){super(s),this.message=s,this.key=r}}class og{constructor(r,s=[]){this.parent=r,this.bindings={};for(const[u,f]of s)this.bindings[u]=f}concat(r){return new og(this,r)}get(r){if(this.bindings[r])return this.bindings[r];if(this.parent)return this.parent.get(r);throw new Error(`${r} not found in scope.`)}has(r){return!!this.bindings[r]||!!this.parent&&this.parent.has(r)}}const vu={kind:"null"},un={kind:"number"},Rr={kind:"string"},ur={kind:"boolean"},Es={kind:"color"},jl={kind:"object"},Mr={kind:"value"},bu={kind:"collator"},Dh={kind:"formatted"},mp={kind:"resolvedImage"};function os(l,r){return{kind:"array",itemType:l,N:r}}function $n(l){if(l.kind==="array"){const r=$n(l.itemType);return typeof l.N=="number"?`array<${r}, ${l.N}>`:l.itemType.kind==="value"?"array":`array<${r}>`}return l.kind}const m1=[vu,un,Rr,ur,Es,Dh,jl,os(Mr),mp];function Fh(l,r){if(r.kind==="error")return null;if(l.kind==="array"){if(r.kind==="array"&&(r.N===0&&r.itemType.kind==="value"||!Fh(l.itemType,r.itemType))&&(typeof l.N!="number"||l.N===r.N))return null}else{if(l.kind===r.kind)return null;if(l.kind==="value"){for(const s of m1)if(!Fh(s,r))return null}}return`Expected ${$n(l)} but found ${$n(r)} instead.`}function jy(l,r){return r.some(s=>s.kind===l.kind)}function gp(l,r){return r.some(s=>s==="null"?l===null:s==="array"?Array.isArray(l):s==="object"?l&&!Array.isArray(l)&&typeof l=="object":s===typeof l)}function md(l,r){return l.kind==="array"&&r.kind==="array"?l.N===r.N&&md(l.itemType,r.itemType):l.kind===r.kind}class Bh{constructor(r,s,u){this.sensitivity=r?s?"variant":"case":s?"accent":"base",this.locale=u,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(r,s){return this.collator.compare(r,s)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class gd{constructor(r,s,u,f,g){this.text=r.normalize?r.normalize():r,this.image=s,this.scale=u,this.fontStack=f,this.textColor=g}}class ss{constructor(r){this.sections=r}static fromString(r){return new ss([new gd(r,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(r=>r.text.length!==0||!!r.image&&r.image.hasPrimary())}static factory(r){return r instanceof ss?r:ss.fromString(r)}toString(){return this.sections.length===0?"":this.sections.map(r=>r.text).join("")}serialize(){const r=["format"];for(const s of this.sections){if(s.image){const f=s.image.getPrimary().id.toString();r.push(["image",f]);continue}r.push(s.text);const u={};s.fontStack&&(u["text-font"]=["literal",s.fontStack.split(",")]),s.scale&&(u["font-scale"]=s.scale),s.textColor&&(u["text-color"]=["rgba"].concat(s.textColor.toNonPremultipliedRenderColor(null).toArray())),r.push(u)}return r}}class $a{constructor(r,s={}){this.id=is.from(r),this.params=s.params,this.sx=s.sx||1,this.sy=s.sy||1}toString(){return JSON.stringify(this)}static parse(r){let s,u,f,g;
18try{({id:s,params:u,sx:f,sy:g}=JSON.parse(r)||{})}catch{return null}return s?new $a(s,{params:u,sx:f,sy:g}):null}scaleSelf(r,s=r){return this.sx*=r,this.sy*=s,this}}class _s{constructor(r,s,u,f,g=!1){this.primaryId=is.from(r),this.primaryOptions=s,u&&(this.secondaryId=is.from(u)),this.secondaryOptions=f,this.available=g}toString(){return this.primaryId&&this.secondaryId?`[${this.primaryId.name},${this.secondaryId.name}]`:this.primaryId.name}hasPrimary(){return!!this.primaryId}getPrimary(){return new $a(this.primaryId,this.primaryOptions)}hasSecondary(){return!!this.secondaryId}getSecondary(){return this.secondaryId?new $a(this.secondaryId,this.secondaryOptions):null}static from(r){return typeof r=="string"?_s.build({name:r}):r}static build(r,s,u,f){return!r||typeof r=="object"&&!("name"in r)?null:new _s(r,u,s,f)}}function g1(l,r,s,u){return typeof l=="number"&&l>=0&&l<=255&&typeof r=="number"&&r>=0&&r<=255&&typeof s=="number"&&s>=0&&s<=255?u===void 0||typeof u=="number"&&u>=0&&u<=1?null:`Invalid rgba value [${[l,r,s,u].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof u=="number"?[l,r,s,u]:[l,r,s]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function zh(l){if(l===null||typeof l=="string"||typeof l=="boolean"||typeof l=="number"||l instanceof xr||l instanceof Bh||l instanceof ss||l instanceof _s)return!0;if(Array.isArray(l)){for(const r of l)if(!zh(r))return!1;return!0}if(typeof l=="object"){for(const r in l)if(!zh(l[r]))return!1;return!0}return!1}function Zi(l){if(l===null)return vu;if(typeof l=="string")return Rr;if(typeof l=="boolean")return ur;if(typeof l=="number")return un;if(l instanceof xr)return Es;if(l instanceof Bh)return bu;if(l instanceof ss)return Dh;if(l instanceof _s)return mp;if(Array.isArray(l)){const r=l.length;let s;for(const u of l){const f=Zi(u);if(s){if(s===f)continue;s=Mr;break}s=f}return os(s||Mr,r)}return jl}function ja(l){const r=typeof l;return l===null?"":r==="string"||r==="number"||r==="boolean"?String(l):l instanceof ss||l instanceof _s||l instanceof xr?l.toString():JSON.stringify(l)}class ml{constructor(r,s){this.type=r,this.value=s}static parse(r,s){if(r.length!==2)return s.error(`'literal' expression requires exactly one argument, but found ${r.length-1} instead.`);if(!zh(r[1]))return s.error("invalid value");const u=r[1];let f=Zi(u);const g=s.expectedType;return f.kind!=="array"||f.N!==0||!g||g.kind!=="array"||typeof g.N=="number"&&g.N!==0||(f=g),new ml(f,u)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof xr?["rgba"].concat(this.value.toNonPremultipliedRenderColor(null).toArray()):this.value instanceof ss?this.value.serialize():this.value}}class hi{constructor(r){this.name="ExpressionEvaluationError",this.message=r}toJSON(){return this.message}}const sg={string:Rr,number:un,boolean:ur,object:jl};class gl{constructor(r,s){this.type=r,this.args=s}static parse(r,s){if(r.length<2)return s.error("Expected at least one argument.");let u,f=1;const g=r[0];if(g==="array"){let x,w;if(r.length>2){const A=r[1];if(typeof A!="string"||!(A in sg)||A==="object")return s.error('The item type argument of "array" must be one of string, number, boolean',1);x=sg[A],f++}else x=Mr;if(r.length>3){if(r[2]!==null&&(typeof r[2]!="number"||r[2]<0||r[2]!==Math.floor(r[2])))return s.error('The length argument to "array" must be a positive integer literal',2);w=r[2],f++}u=os(x,w)}else u=sg[g];const v=[];for(;f<r.length;f++){const x=s.parse(r[f],f,Mr);if(!x)return null;v.push(x)}return new gl(u,v)}evaluate(r){for(let s=0;s<this.args.length;s++){const u=this.args[s].evaluate(r);if(!Fh(this.type,Zi(u)))return u;if(s===this.args.length-1)throw new hi(`The expression ${JSON.stringify(this.args[s].serialize())} evaluated to ${$n(Zi(u))} but was expected to be of type ${$n(this.type)}.`)}return null}eachChild(r){this.args.forEach(r)}outputDefined(){return this.args.every(r=>r.outputDefined())}serialize(){const r=this.type,s=[r.kind];if(r.kind==="array"){const u=r.itemType;
vendor: 4,534 bytes, line 18
18if(u.kind==="string"||u.kind==="number"||u.kind==="boolean"){s.push(u.kind);const f=r.N;(typeof f=="number"||this.args.length>1)&&s.push(f)}}return s.concat(this.args.map(u=>u.serialize()))}}class Nh{constructor(r){this.type=Dh,this.sections=r}static parse(r,s){if(r.length<2)return s.error("Expected at least one argument.");const u=r[1];if(!Array.isArray(u)&&typeof u=="object")return s.error("First argument must be an image or text section.");const f=[];let g=!1;for(let v=1;v<=r.length-1;++v){const x=r[v];if(g&&typeof x=="object"&&!Array.isArray(x)){g=!1;let w=null;if(x["font-scale"]&&(w=s.parseObjectValue(x["font-scale"],v,"font-scale",un),!w))return null;let A=null;if(x["text-font"]&&(A=s.parseObjectValue(x["text-font"],v,"text-font",os(Rr)),!A))return null;let R=null;if(x["text-color"]&&(R=s.parseObjectValue(x["text-color"],v,"text-color",Es),!R))return null;const M=f.at(-1);M.scale=w,M.font=A,M.textColor=R}else{const w=s.parse(r[v],v,Mr);if(!w)return null;const A=w.type.kind;if(A!=="string"&&A!=="value"&&A!=="null"&&A!=="resolvedImage")return s.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");g=!0,f.push({content:w,scale:null,font:null,textColor:null})}}return new Nh(f)}evaluate(r){return new ss(this.sections.map(s=>{const u=s.content.evaluate(r);return md(Zi(u),mp)?new gd("",u,null,null,null):new gd(ja(u),null,s.scale?s.scale.evaluate(r):null,s.font?s.font.evaluate(r).join(","):null,s.textColor?s.textColor.evaluate(r):null)}))}eachChild(r){for(const s of this.sections)r(s.content),s.scale&&r(s.scale),s.font&&r(s.font),s.textColor&&r(s.textColor)}outputDefined(){return!1}serialize(){const r=["format"];for(const s of this.sections){r.push(s.content.serialize());const u={};s.scale&&(u["font-scale"]=s.scale.serialize()),s.font&&(u["text-font"]=s.font.serialize()),s.textColor&&(u["text-color"]=s.textColor.serialize()),r.push(u)}return r}}class _p{constructor(r,s,u,f){this._imageWarnHistory={},this.type=mp,this.namePrimary=r,this.nameSecondary=s,u&&(this.paramsPrimary=u.params,this.iconsetIdPrimary=u.iconset?u.iconset.id:void 0),f&&(this.paramsSecondary=f.params,this.iconsetIdSecondary=f.iconset?f.iconset.id:void 0)}static parse(r,s){if(r.length<2)return s.error("Expected two or more arguments.");let u=1;const f=[];function g(){if(u<r.length){const x=s.parse(r[u],u++,Rr);return x?(f.push({image:x,options:{}}),!0):(s.error(f.length?"Secondary image variant is not a string.":"No image name provided."),!1)}return!0}function v(){if(u<r.length){const w=r[u];if((x=w)===null||typeof x!="object"||Array.isArray(x))return!0;const A=w.params,R=w.iconset,M=s.concat(u);if(!A&&!R)return u++,!0;if(A){if(typeof A!="object"||A.constructor!==Object)return M.error('Image options "params" should be an object'),!1;const O={},B=M.concat(void 0,"params");for(const N in A){if(!N)return B.error("Image parameter name should be non-empty"),!1;const G=B.concat(void 0,N).parse(A[N],void 0,Es,void 0,{typeAnnotation:"coerce"});if(!G)return!1;O[N]=G}f.at(-1).options.params=O}if(R){if(typeof R!="object"||R.constructor!==Object)return M.error('Image options "iconset" should be an object'),!1;if(!R.id)return M.error('Image options "iconset" should have an "id" property'),!1;f.at(-1).options.iconset=R}return u++,!0}var x;return!0}for(let x=0;x<2;x++)if(!g()||!v())return;return new _p(f[0].image,f[1]?f[1].image:void 0,f[0].options,f[1]?f[1].options:void 0)}evaluateParams(r,s){const u={};if(s){for(const f in s)if(s[f])try{u[f]=s[f].evaluate(r)}catch{continue}if(Object.keys(u).length!==0)return{params:u}}}evaluate(r){const s={name:this.namePrimary.evaluate(r),iconsetId:this.iconsetIdPrimary},u=this.nameSecondary?{name:this.nameSecondary.evaluate(r),iconsetId:this.iconsetIdSecondary}:void 0,f=_s.build(s,u,this.paramsPrimary?this.evaluateParams(r,this.paramsPrimary):void 0,this.paramsSecondary?this.evaluateParams(r,this.paramsSecondary):void 0);if(f&&r.availableImages){const g=f.getPrimary().id;if(f.available=r.availableImages.some(v=>is.isEqual(v,g)),f.available){const v=f.getSecondary()?f.getSecondary().id:null;v&&(f.available=r.availableImages.some(x=>is.isEqual(x,v)))}}return f}eachChild(r){if(r(this.namePrimary),this.paramsPrimary)for(const s in this.paramsPrimary)this.paramsPrimary[s]&&r(this.paramsPrimary[s]);if(this.nameSecondary&&(r(this.nameSecondary),this.paramsSecondary))for(const s in this.paramsSecondary)this.paramsSecondary[s]&&r(this.paramsSecondary[s])}outputDefined(){return!1}serializeOptions(r,s){const u={};if(s&&(u.iconset={id:s}),r){u.params={};
18for(const f in r)r[f]&&(u.params[f]=r[f].serialize())}return Object.keys(u).length>0?u:void 0}serialize(){const r=["image",this.namePrimary.serialize()];if(this.paramsPrimary||this.iconsetIdPrimary){const s=this.serializeOptions(this.paramsPrimary,this.iconsetIdPrimary);s&&r.push(s)}if(this.nameSecondary&&(r.push(this.nameSecondary.serialize()),this.paramsSecondary||this.iconsetIdSecondary)){const s=this.serializeOptions(this.paramsSecondary,this.iconsetIdSecondary);s&&r.push(s)}return r}}function ag(l){return Hy(l)?"string":yp(l)?"number":vp(l)?"boolean":Array.isArray(l)?"array":l===null?"null":Gy(l)?"object":typeof l}function Gy(l){return l!=null&&!Array.isArray(l)&&typeof l!="function"&&!(l instanceof String||l instanceof Number||l instanceof Boolean)&&typeof l=="object"}function Hy(l){return typeof l=="string"||l instanceof String}function yp(l){return typeof l=="number"||l instanceof Number}function vp(l){return typeof l=="boolean"||l instanceof Boolean}const Vh={"to-boolean":ur,"to-color":Es,"to-number":un,"to-string":Rr};class Gl{constructor(r,s){this.type=r,this.args=s}static parse(r,s){if(r.length<2)return s.error("Expected at least one argument.");const u=r[0],f=[];let g=vu;if(u==="to-array"){if(!Array.isArray(r[1]))return null;const v=r[1].length;if(s.expectedType){if(s.expectedType.kind!=="array")return s.error(`Expected ${s.expectedType.kind} but found array.`);g=os(s.expectedType.itemType,v)}else{if(!(v>0&&zh(r[1][0])))return null;g=os(Zi(r[1][0]),v)}for(let x=0;x<v;x++){const w=r[1][x];let A;if(Array.isArray(w))A=s.parse(w,void 0,g.itemType);else{const R=ag(w);if(R!==g.itemType.kind)return s.error(`Expected ${g.itemType.kind} but found ${R}.`);A=s.registry.literal.parse(["literal",w===void 0?null:w],s)}if(!A)return null;f.push(A)}}else{if((u==="to-boolean"||u==="to-string")&&r.length!==2)return s.error("Expected one argument.");g=Vh[u];for(let v=1;v<r.length;v++){const x=s.parse(r[v],v,Mr);if(!x)return null;f.push(x)}}return new Gl(g,f)}evaluate(r){if(this.type.kind==="boolean")return!!this.args[0].evaluate(r);if(this.type.kind==="color"){let s,u;for(const f of this.args){if(s=f.evaluate(r),u=null,s instanceof xr)return s;if(typeof s=="string"){const g=r.parseColor(s);if(g)return g}else if(Array.isArray(s)&&(u=s.length<3||s.length>4?`Invalid rbga value ${JSON.stringify(s)}: expected an array containing either three or four numeric values.`:g1(s[0],s[1],s[2],s[3]),!u))return new xr(s[0]/255,s[1]/255,s[2]/255,s[3])}throw new hi(u||`Could not parse color from value '${typeof s=="string"?s:String(JSON.stringify(s))}'`)}if(this.type.kind==="number"){let s=null;for(const u of this.args){if(s=u.evaluate(r),s===null)return 0;const f=Number(s);if(!isNaN(f))return f}throw new hi(`Could not convert ${JSON.stringify(s)} to number.`)}return this.type.kind==="formatted"?ss.fromString(ja(this.args[0].evaluate(r))):this.type.kind==="resolvedImage"?_s.build(ja(this.args[0].evaluate(r))):this.type.kind==="array"?this.args.map(s=>s.evaluate(r)):ja(this.args[0].evaluate(r))}eachChild(r){this.args.forEach(r)}outputDefined(){return this.args.every(r=>r.outputDefined())}serialize(){if(this.type.kind==="formatted")return new Nh([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new _p(this.args[0]).serialize();const r=this.type.kind==="array"?[]:[`to-${this.type.kind}`];return this.eachChild(s=>{r.push(s.serialize())}),r}}const Hl=["Unknown","Point","LineString","Polygon"];class Wy{constructor(r,s,u){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null,this.scope=r,this.options=s,this.iconImageUseTheme=u}id(){return this.feature&&this.feature.id!==void 0?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Hl[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||{}}measureLight(r){return this.globals.brightness||0}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const r=this.featureDistanceData.center,s=this.featureDistanceData.scale,{x:u,y:f}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(u*s-r[0])+this.featureDistanceData.bearing[1]*(f*s-r[1])}return 0}parseColor(r){let s=this._parseColorCache[r];return s||(s=this._parseColorCache[r]=xr.parse(r)),s}getConfig(r){return this.options?this.options.get(r):null}}class Cs{constructor(r,s,u,f,g){this.name=r,this.type=s,this._evaluate=u,this.args=f,this._overloadIndex=g}evaluate(r){if(!this._evaluate){const s=Cs.definitions[this.name];this._evaluate=Array.isArray(s)?s[2]:s.overloads[this._overloadIndex][1]}return this._evaluate(r,this.args)}
18eachChild(r){this.args.forEach(r)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(r=>r.serialize()))}static parse(r,s){const u=r[0],f=Cs.definitions[u];if(!f)return s.error(`Unknown expression "${u}". If you wanted a literal array, use ["literal", [...]].`,0);const g=Array.isArray(f)?f[0]:f.type,v=Array.isArray(f)?[[f[1],f[2]]]:f.overloads,x=[];let w=null,A=-1;for(const[R,M]of v){if(Array.isArray(R)&&R.length!==r.length-1)continue;x.push(R),A++,w===null?w=new ta(s.registry,s.path,null,s.scope,[],s._scope,s.options,s.iconImageUseTheme):w.errors.length=0;const O=[];let B=!1;for(let N=1;N<r.length;N++){const G=r[N],H=Array.isArray(R)?R[N-1]:R.type,J=w.parse(G,1+O.length,H);if(!J){B=!0;break}O.push(J)}if(!B)if(Array.isArray(R)&&R.length!==O.length)w.error(`Expected ${R.length} arguments, but found ${O.length} instead.`);else{for(let N=0;N<O.length;N++){const G=Array.isArray(R)?R[N]:R.type;w.checkSubtype(G,O[N].type,N+1)}if(w.errors.length===0)return new Cs(u,g,M,O,A)}}if(x.length===1)s.errors.push(...w.errors);else{const R=(x.length?x:v.map(([O])=>O)).map(bp).join(" | "),M=[];for(let O=1;O<r.length;O++){const B=s.parse(r[O],1+M.length);if(!B)return null;M.push($n(B.type))}s.error(`Expected arguments of type ${R}, but found (${M.join(", ")}) instead.`)}return null}static register(r,s){Cs.definitions=s;for(const u in s)r[u]=Cs}}function bp(l){return Array.isArray(l)?`(${l.map($n).join(", ")})`:`(${$n(l.type)}...)`}class _d{constructor(r,s,u){this.type=bu,this.locale=u,this.caseSensitive=r,this.diacriticSensitive=s}static parse(r,s){if(r.length!==2)return s.error("Expected one argument."),null;const u=r[1];if(typeof u!="object"||Array.isArray(u))return s.error("Collator options argument must be an object."),null;const f=u["case-sensitive"]===void 0?s.parse(!1,1,ur):s.parseObjectValue(u["case-sensitive"],1,"case-sensitive",ur);if(!f)return null;const g=u["diacritic-sensitive"]===void 0?s.parse(!1,1,ur):s.parseObjectValue(u["diacritic-sensitive"],1,"diacritic-sensitive",ur);if(!g)return null;let v=null;return u.locale&&(v=s.parseObjectValue(u.locale,1,"locale",Rr),!v)?null:new _d(f,g,v)}evaluate(r){return new Bh(this.caseSensitive.evaluate(r),this.diacriticSensitive.evaluate(r),this.locale?this.locale.evaluate(r):null)}eachChild(r){r(this.caseSensitive),r(this.diacriticSensitive),this.locale&&r(this.locale)}outputDefined(){return!1}serialize(){const r={};return r["case-sensitive"]=this.caseSensitive.serialize(),r["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(r.locale=this.locale.serialize()),["collator",r]}}function _1(l,r,s=0,u=l.length-1,f=d2){for(;u>s;){if(u-s>600){const w=u-s+1,A=r-s+1,R=Math.log(w),M=.5*Math.exp(2*R/3),O=.5*Math.sqrt(R*M*(w-M)/w)*(A-w/2<0?-1:1);_1(l,r,Math.max(s,Math.floor(r-A*M/w+O)),Math.min(u,Math.floor(r+(w-A)*M/w+O)),f)}const g=l[r];let v=s,x=u;for(xp(l,s,r),f(l[u],g)>0&&xp(l,s,u);v<x;){for(xp(l,v,x),v++,x--;f(l[v],g)<0;)v++;for(;f(l[x],g)>0;)x--}f(l[s],g)===0?xp(l,s,x):(x++,xp(l,x,u)),x<=r&&(s=x+1),r<=x&&(u=x-1)}}function xp(l,r,s){const u=l[r];l[r]=l[s],l[s]=u}function d2(l,r){return l<r?-1:l>r?1:0}function y1(l){let r=0;for(let s,u,f=0,g=l.length,v=g-1;f<g;v=f++)s=l[f],u=l[v],r+=(u.x-s.x)*(s.y+u.y);return r}function yd(l,r){l[0]=Math.min(l[0],r[0]),l[1]=Math.min(l[1],r[1]),l[2]=Math.max(l[2],r[0]),l[3]=Math.max(l[3],r[1])}function wp(l,r){return!(l[0]<=r[0]||l[2]>=r[2]||l[1]<=r[1]||l[3]>=r[3])}function lg(l,r,s){const u=l[0]-r[0],f=l[1]-r[1],g=l[0]-s[0],v=l[1]-s[1];return u*v-g*f===0&&u*g<=0&&f*v<=0}function h2(l,r,s){return r[1]>l[1]!=s[1]>l[1]&&l[0]<(s[0]-r[0])*(l[1]-r[1])/(s[1]-r[1])+r[0]}function Uh(l,r,s=!1){let u=!1;for(let f=0,g=r.length;f<g;f++){const v=r[f];for(let x=0,w=v.length,A=w-1;x<w;A=x++){const R=v[A],M=v[x];if(lg(l,R,M))return s;h2(l,R,M)&&(u=!u)}}return u}function v1(l,r,s,u){const f=u[0]-s[0],g=u[1]-s[1],v=(l[0]-s[0])*g-f*(l[1]-s[1]),x=(r[0]-s[0])*g-f*(r[1]-s[1]);return v>0&&x<0||v<0&&x>0}function cg(l,r,s,u){return(f=[u[0]-s[0],u[1]-s[1]])[0]*(g=[r[0]-l[0],r[1]-l[1]])[1]-f[1]*g[0]!==0&&!(!v1(l,r,s,u)||!v1(s,u,l,r));var f,g}function qy(l){const r=new St(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),s=new St(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(const u of l[0])r.x>
18u.x&&(r.x=u.x),r.y>u.y&&(r.y=u.y),s.x<u.x&&(s.x=u.x),s.y<u.y&&(s.y=u.y);return{min:r,max:s}}const xu=8192;function f2(l,r){const s=(180+l[0])/360,u=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+l[1]*Math.PI/360)))/360,f=Math.pow(2,r.z);return[Math.round(s*f*xu),Math.round(u*f*xu)]}function b1(l,r){for(let s=0;s<r.length;s++)if(Uh(l,r[s]))return!0;return!1}function $h(l,r,s){for(const u of s)for(let f=0,g=u.length,v=g-1;f<g;v=f++)if(cg(l,r,u[v],u[f]))return!0;return!1}function x1(l,r){for(let s=0;s<l.length;++s)if(!Uh(l[s],r))return!1;for(let s=0;s<l.length-1;++s)if($h(l[s],l[s+1],r))return!1;return!0}function w1(l,r){for(let s=0;s<r.length;s++)if(x1(l,r[s]))return!0;return!1}function Sp(l,r,s){const u=[];for(let f=0;f<l.length;f++){const g=[];for(let v=0;v<l[f].length;v++){const x=f2(l[f][v],s);yd(r,x),g.push(x)}u.push(g)}return u}function S1(l,r,s){const u=[];for(let f=0;f<l.length;f++){const g=Sp(l[f],r,s);u.push(g)}return u}function T1(l,r,s,u){if(l[0]<s[0]||l[0]>s[2]){const f=.5*u;let g=l[0]-s[0]>f?-u:s[0]-l[0]>f?u:0;g===0&&(g=l[0]-s[2]>f?-u:s[2]-l[0]>f?u:0),l[0]+=g}yd(r,l)}function E1(l,r,s,u){const f=Math.pow(2,u.z)*xu,g=[u.x*xu,u.y*xu],v=[];if(!l)return v;for(const x of l)for(const w of x){const A=[w.x+g[0],w.y+g[1]];T1(A,r,s,f),v.push(A)}return v}function C1(l,r,s,u){const f=Math.pow(2,u.z)*xu,g=[u.x*xu,u.y*xu],v=[];if(!l)return v;for(const w of l){const A=[];for(const R of w){const M=[R.x+g[0],R.y+g[1]];yd(r,M),A.push(M)}v.push(A)}if(r[2]-r[0]<=f/2){(x=r)[0]=x[1]=1/0,x[2]=x[3]=-1/0;for(const w of v)for(const A of w)T1(A,r,s,f)}var x;return v}class Wl{constructor(r,s){this.type=ur,this.geojson=r,this.geometries=s}static parse(r,s){if(r.length!==2)return s.error(`'within' expression requires exactly one argument, but found ${r.length-1} instead.`);if(zh(r[1])){const u=r[1];if(u.type==="FeatureCollection")for(let f=0;f<u.features.length;++f){const g=u.features[f].geometry.type;if(g==="Polygon"||g==="MultiPolygon")return new Wl(u,u.features[f].geometry)}else if(u.type==="Feature"){const f=u.geometry.type;if(f==="Polygon"||f==="MultiPolygon")return new Wl(u,u.geometry)}else if(u.type==="Polygon"||u.type==="MultiPolygon")return new Wl(u,u)}return s.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(r){if(r.geometry()!=null&&r.canonicalID()!=null){if(r.geometryType()==="Point")return(function(s,u){const f=[1/0,1/0,-1/0,-1/0],g=[1/0,1/0,-1/0,-1/0],v=s.canonicalID();if(!v)return!1;if(u.type==="Polygon"){const x=Sp(u.coordinates,g,v),w=E1(s.geometry(),f,g,v);if(!wp(f,g))return!1;for(const A of w)if(!Uh(A,x))return!1}if(u.type==="MultiPolygon"){const x=S1(u.coordinates,g,v),w=E1(s.geometry(),f,g,v);if(!wp(f,g))return!1;for(const A of w)if(!b1(A,x))return!1}return!0})(r,this.geometries);if(r.geometryType()==="LineString")return(function(s,u){const f=[1/0,1/0,-1/0,-1/0],g=[1/0,1/0,-1/0,-1/0],v=s.canonicalID();if(!v)return!1;if(u.type==="Polygon"){const x=Sp(u.coordinates,g,v),w=C1(s.geometry(),f,g,v);if(!wp(f,g))return!1;for(const A of w)if(!x1(A,x))return!1}if(u.type==="MultiPolygon"){const x=S1(u.coordinates,g,v),w=C1(s.geometry(),f,g,v);if(!wp(f,g))return!1;for(const A of w)if(!w1(A,x))return!1}return!0})(r,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}const ql={kilometers:1,miles:1e3/1609.344,nauticalmiles:1e3/1852,meters:1e3,metres:1e3,yards:1e3/.9144,feet:1e3/.3048,inches:1e3/.0254},In=1/298.257223563,rn=In*(2-In),vd=Math.PI/180;class Tn{static fromTile(r,s,u){const f=Math.PI*(1-2*(r+.5)/Math.pow(2,s)),g=Math.atan(.5*(Math.exp(f)-Math.exp(-f)))/vd;return new Tn(g,u)}static get units(){return ql}constructor(r,s){if(r===void 0)throw new Error("No latitude given.");if(s&&!ql[s])throw new Error(`Unknown unit ${s}. Use one of: ${Object.keys(ql).join(", ")}`);const u=6378.137*vd*(s?ql[s]:1),f=Math.cos(r*vd),g=1/(1-rn*(1-f*f)),v=Math.sqrt(g);this.kx=u*v*f,this.ky=u*v*g*(1-rn)}distance(r,s){const u=pn(r[0]-s[0])*this.kx,f=(r[1]-s[1])*this.ky;return Math.sqrt(u*u+f*f)}bearing(r,s){const u=pn(s[0]-r[0])*this.kx;return Math.atan2(u,(s[1]-r[1])*this.ky)/vd}destination(r,s,u){const f=u*vd;return this.offset(r,Math.sin(f)*s,Math.cos(f)*s)}offset(r,s,u){return[r[0]+s/this.kx,r[1]+u/this.ky]}lineDistance(r){let s=0;for(let u=0;u<r.length-1;u++)s+=this.distance(r[u],r[u+1]);return s}area(r){let s=0;for(let u=0;u<r.length;u++){const f=r[u];for(let g=0,v=f.length,x=v-1;g<v;x=g++)s+=pn(f[g][0]-f[x][0])*(f[g][1]+f[x][1])*(u?-1:1)}return Math.abs(s)/2*this.kx*this.ky}along(r,s){let u=0;if(s<=0)return r[0];for(let f=0;f<r.length-1;f++){const g=r[f],v=r[f+1],x=this.distance(g,v);if(u+=x,u>s)return Tp(g,v,(s-(u-x))/x)}return r[r.length-1]}pointToSegmentDistance(r,s,u){let[f,g]=s,v=pn(u[0]-f)*this.kx,x=(u[1]-g)*this.ky;if(v!==0||x!==0){const w=(pn(r[0]-f)*this.kx*v+(r[1]-g)*this.ky*x)/(v*v+x*x);w>1?(f=u[0],g=u[1]):w>0&&(f+=v/this.kx*w,g+=x/this.ky*w)}return v=pn(r[0]-f)*this.kx,x=(r[1]-g)*this.ky,Math.sqrt(v*v+x*x)}pointOnLine(r,s){let u=1/0,f=r[0][0],g=r[0][1],v=0,x=0;for(let w=0;w<r.length-1;w++){let A=r[w][0],R=r[w][1],M=pn(r[w+1][0]-A)*this.kx,O=(r[w+1][1]-R)*this.ky,B=0;M===0&&O===0||(B=(pn(s[0]-A)*this.kx*M+(s[1]-R)*this.ky*O)/(M*M+O*O),B>1?(A=r[w+1][0],R=r[w+1][1]):B>0&&(A+=M/this.kx*B,R+=O/this.ky*B)),M=pn(s[0]-A)*this.kx,O=(s[1]-R)*this.ky;const N=M*M+O*O;N<u&&(u=N,f=A,g=R,v=w,x=B)}
18return{point:[f,g],index:v,t:Math.max(0,Math.min(1,x))}}lineSlice(r,s,u){let f=this.pointOnLine(u,r),g=this.pointOnLine(u,s);if(f.index>g.index||f.index===g.index&&f.t>g.t){const A=f;f=g,g=A}const v=[f.point],x=f.index+1,w=g.index;!ug(u[x],v[0])&&x<=w&&v.push(u[x]);for(let A=x+1;A<=w;A++)v.push(u[A]);return ug(u[w],g.point)||v.push(g.point),v}lineSliceAlong(r,s,u){let f=0;const g=[];for(let v=0;v<u.length-1;v++){const x=u[v],w=u[v+1],A=this.distance(x,w);if(f+=A,f>r&&g.length===0&&g.push(Tp(x,w,(r-(f-A))/A)),f>=s)return g.push(Tp(x,w,(s-(f-A))/A)),g;f>r&&g.push(w)}return g}bufferPoint(r,s){const u=s/this.ky,f=s/this.kx;return[r[0]-f,r[1]-u,r[0]+f,r[1]+u]}bufferBBox(r,s){const u=s/this.ky,f=s/this.kx;return[r[0]-f,r[1]-u,r[2]+f,r[3]+u]}insideBBox(r,s){return pn(r[0]-s[0])>=0&&pn(r[0]-s[2])<=0&&r[1]>=s[1]&&r[1]<=s[3]}}function ug(l,r){return l[0]===r[0]&&l[1]===r[1]}function Tp(l,r,s){const u=pn(r[0]-l[0]);return[l[0]+u*s,l[1]+(r[1]-l[1])*s]}function pn(l){for(;l<-180;)l+=360;for(;l>180;)l-=360;return l}class Ep{constructor(r=[],s=(u,f)=>u<f?-1:u>f?1:0){if(this.data=r,this.length=this.data.length,this.compare=s,this.length>0)for(let u=(this.length>>1)-1;u>=0;u--)this._down(u)}push(r){this.data.push(r),this._up(this.length++)}pop(){if(this.length===0)return;const r=this.data[0],s=this.data.pop();return--this.length>0&&(this.data[0]=s,this._down(0)),r}peek(){return this.data[0]}_up(r){const{data:s,compare:u}=this,f=s[r];for(;r>0;){const g=r-1>>1,v=s[g];if(u(f,v)>=0)break;s[r]=v,r=g}s[r]=f}_down(r){const{data:s,compare:u}=this,f=this.length>>1,g=s[r];for(;r<f;){let v=1+(r<<1);const x=v+1;if(x<this.length&&u(s[x],s[v])<0&&(v=x),u(s[v],g)>=0)break;s[r]=s[v],r=v}s[r]=g}}var Bt=8192;function Xy(l,r){return r.dist-l.dist}function Zy(l){const r=[1/0,1/0,-1/0,-1/0];if(r.length!==l.length)return!1;for(let s=0;s<r.length;s++)if(r[s]!==l[s])return!1;return!0}function bd(l){return l[1]-l[0]+1}function Ic(l,r){const s=l[1]>=l[0]&&l[1]<r;return s||console.warn("Distance Expression: Index is out of range"),s}function Cp(l,r){if(l[0]>l[1])return[null,null];const s=bd(l);if(r){if(s===2)return[l,null];const u=Math.floor(s/2);return[[l[0],l[0]+u],[l[0]+u,l[1]]]}{if(s===1)return[l,null];const u=Math.floor(s/2)-1;return[[l[0],l[0]+u],[l[0]+u+1,l[1]]]}}function wa(l,r){const s=[1/0,1/0,-1/0,-1/0];if(!Ic(r,l.length))return s;for(let u=r[0];u<=r[1];++u)yd(s,l[u]);return s}function jh(l){const r=[1/0,1/0,-1/0,-1/0];for(let s=0;s<l.length;++s)for(let u=0;u<l[s].length;++u)yd(r,l[s][u]);return r}function Sa(l,r,s){if(Zy(l)||Zy(r))return NaN;let u=0,f=0;return l[2]<r[0]&&(u=r[0]-l[2]),l[0]>r[2]&&(u=l[0]-r[2]),l[1]>r[3]&&(f=l[1]-r[3]),l[3]<r[1]&&(f=r[1]-l[3]),s.distance([0,0],[u,f])}function A1(l){return 360*l-180}function I1(l){return 360/Math.PI*Math.atan(Math.exp((180-360*l)*Math.PI/180))-90}function dg(l,r,s=8192){const u=Math.pow(2,r.z),f=(l.y/s+r.y)/u;return[A1((l.x/s+r.x)/u),I1(f)]}function p2(l,r){const s=[];for(let u=0;u<l.length;++u)s.push(dg(l[u],r));return s}function P1(l,r,s){const u=s.pointOnLine(r,l).point;return s.distance(l,u)}function Ap(l,r,s,u,f){const g=s.slice(u[0],u[1]+1);let v=1/0;for(let x=r[0];x<=r[1];++x)if((v=Math.min(v,P1(l[x],g,f)))===0)return 0;return v}function hg(l,r,s,u,f){const g=Math.min(f.pointToSegmentDistance(l,s,u),f.pointToSegmentDistance(r,s,u)),v=Math.min(f.pointToSegmentDistance(s,l,r),f.pointToSegmentDistance(u,l,r));return Math.min(g,v)}function xd(l,r,s,u,f){if(!Ic(r,l.length)||!Ic(u,s.length))return NaN;let g=1/0;for(let v=r[0];v<r[1];++v)for(let x=u[0];x<u[1];++x){if(cg(l[v],l[v+1],s[x],s[x+1]))return 0;g=Math.min(g,hg(l[v],l[v+1],s[x],s[x+1],f))}return g}function m2(l,r,s,u,f){if(!Ic(r,l.length)||!Ic(u,s.length))return NaN;let g=1/0;for(let v=r[0];v<=r[1];++v)for(let x=u[0];x<=u[1];++x)if((g=Math.min(g,f.distance(l[v],s[x])))===0)return g;return g}function g2(l,r,s){if(Uh(l,r,!0))return 0;let u=1/0;for(const f of r){const g=f.length;if(g<2)return console.warn("Distance Expression: Invalid polygon!"),NaN;if(f[0]!==f[g-1]&&(u=Math.min(u,s.pointToSegmentDistance(l,f[g-1],f[0])))===0||(u=Math.min(u,P1(l,f,s)))===0)return u}return u}function _2(l,r,s,u){if(!Ic(r,l.length))return NaN;for(let g=r[0];g<=r[1];++g)if(Uh(l[g],s,!0))return 0;let f=1/0;for(let g=r[0];g<r[1];++g)for(const v of s)for(let x=0,w=v.length,A=w-1;x<w;A=x++){if(cg(l[g],l[g+1],v[A],v[x]))return 0;f=Math.min(f,hg(l[g],l[g+1],v[A],v[x],u))}return f}function R1(l,r){for(const s of l)for(let u=0;u<=s.length-1;++u)if(Uh(s[u],r,!0))return!0;return!1}function Yy(l,r,s,u=1/0){const f=jh(l),g=jh(r);if(u!==1/0&&Sa(f,g,s)>=u)return u;if(wp(f,g)){if(R1(l,r))return 0}else if(R1(r,l))return 0;let v=u;for(const x of l)for(let w=0,A=x.length,R=A-1;w<A;R=w++)for(const M of r)for(let O=0,B=M.length,N=B-1;O<B;N=O++){if(cg(x[R],x[w],M[N],M[O]))return 0;v=Math.min(v,hg(x[R],x[w],M[N],M[O],s))}return v}function fg(l,r,s,u,f,g,v){if(g===null||v===null)return;const x=Sa(wa(u,g),wa(f,v),s);x<r&&l.push({dist:x,range1:g,range2:v})}function Ky(l,r,s,u,f=1/0){let g=Math.min(u.distance(l[0],s[0][0]),f);if(g===0)return g;const v=new Ep([{dist:0,range1:[0,l.length-1],range2:[0,0]}],Xy),x=r?50:100,w=jh(s);for(;v.length;){const A=v.pop();if(A.dist>=g)continue;const R=A.range1;if(bd(R)<=x){if(!Ic(R,l.length))return NaN;if(r){const M=_2(l,R,s,u);if((g=Math.min(g,M))===0)return g}else for(let M=R[0];M<=R[1];++M){const O=g2(l[M],s,u);if((g=Math.min(g,O))===0)return g}}else{const M=Cp(R,r);if(M[0]!==null){const O=Sa(wa(l,M[0]),w,u);O<g&&v.push({dist:O,range1:M[0],range2:[0,0]})}if(M[1]!==null){const O=Sa(wa(l,M[1]),w,u);O<g&&v.push({dist:O,range1:M[1],range2:[0,0]})}}}return g}function k1(l,r,s,u,f,g=1/0){let v=Math.min(g,f.distance(l[0],s[0]));if(v===0)return v;const x=new Ep([{dist:0,range1:[0,l.length-1],range2:[0,s.length-1]}],Xy),w=r?50:100,A=u?50:100;for(;x.length;){const R=x.pop();if(R.dist>=v)continue;const M=R.range1,O=R.range2;if(bd(M)<=w&&bd(O)<=A){if(!Ic(M,l.length)||!Ic(O,s.length))return NaN;if(r&&u?v=Math.min(v,xd(l,M,s,O,f)):r||u?r&&!u?v=Math.min(v,Ap(s,O,l,M,f)):!r&&u&&(v=Math.min(v,Ap(l,M,s,O,f))):v=Math.min(v,m2(l,M,s,O,f)),v===0)return v}else{const B=Cp(M,r),N=Cp(O,u);fg(x,v,f,l,s,B[0],N[0]),fg(x,v,f,l,s,B[0],N[1]),fg(x,v,f,l,s,B[1],N[0]),fg(x,v,f,l,s,B[1],N[1])}}return v}function Jy(l,r,s,u,f=1/0){let g=f;const v=wa(l,[0,l.length-1]);for(const x of s)if(!(g!==1/0&&Sa(v,wa(x,[0,x.length-1]),u)>=g)&&(g=Math.min(g,k1(l,r,x,!0,u,g)),g===0))return g;return g}function Ip(l,r,s,u,f=1/0){let g=f;const v=wa(l,[0,l.length-1]);for(const x of s){if(g!==1/0&&Sa(v,jh(x),u)>=g)continue;const w=Ky(l,r,x,u,g);if(isNaN(w))return w;if((g=Math.min(g,w))===0)return g}return g}function Qy(l){return l==="Point"||l==="MultiPoint"||l==="LineString"||l==="MultiLineString"||l==="Polygon"||l==="MultiPolygon"}class wd{constructor(r,s){this.type=un,this.geojson=r,this.geometries=s}static parse(r,s){if(r.length!==2)return s.error(`'distance' expression requires either one argument, but found ' ${r.length-1} instead.`);if(zh(r[1])){const u=r[1];if(u.type==="FeatureCollection"){for(let f=0;f<u.features.length;++f)if(Qy(u.features[f].geometry.type))return new wd(u,u.features[f].geometry)}else if(u.type==="Feature"){if(Qy(u.geometry.type))return new wd(u,u.geometry)}else if(Qy(u.type))return new wd(u,u)}return s.error("'distance' expression needs to be an array with format ['Distance', GeoJSONObj].")}evaluate(r){const s=r.geometry(),u=r.canonicalID();if(s!=null&&u!=null){if(r.geometryType()==="Point")return(function(f,g,v){const x=[];for(const A of f)for(const R of A)x.push(dg(R,g));const w=new Tn(x[0][1],"meters");return v.type==="Point"||v.type==="MultiPoint"||v.type==="LineString"?k1(x,!1,v.type==="Point"?[v.coordinates]:v.coordinates,v.type==="LineString",w):v.type==="MultiLineString"?Jy(x,!1,v.coordinates,w):v.type==="Polygon"||v.type==="MultiPolygon"?Ip(x,!1,v.type==="Polygon"?[v.coordinates]:v.coordinates,w):null})(s,u,this.geometries);if(r.geometryType()==="LineString")return(function(f,g,v){const x=[];for(const A of f){const R=[];for(const M of A)R.push(dg(M,g));x.push(R)}const w=new Tn(x[0][0][1],"meters");if(v.type==="Point"||v.type==="MultiPoint"||v.type==="LineString")return Jy(v.type==="Point"?[v.coordinates]:v.coordinates,v.type==="LineString",x,w);if(v.type==="MultiLineString"){let A=1/0;for(let R=0;R<v.coordinates.length;R++){const M=Jy(v.coordinates[R],!0,x,w,A);if(isNaN(M))return M;if((A=Math.min(A,M))===0)return A}return A}if(v.type==="Polygon"||v.type==="MultiPolygon"){let A=1/0;for(let R=0;R<x.length;R++){const M=Ip(x[R],!0,v.type==="Polygon"?[v.coordinates]:v.coordinates,w,A);if(isNaN(M))return M;if((A=Math.min(A,M))===0)return A}return A}return null})(s,u,this.geometries);if(r.geometryType()==="Polygon")return(function(f,g,v){const x=[];for(const A of(function(R){const M=R.length;if(M<=1)return[R];const O=[];let B,N;for(let G=0;G<M;G++){const H=y1(R[G]);H!==0&&(R[G].area=Math.abs(H),N===void 0&&(N=H<0),N===H<0?(B&&O.push(B),B=[R[G]]):B.push(R[G]))}return B&&O.push(B),O})(f)){const R=[];for(let M=0;M<A.length;++M)R.push(p2(A[M],g));x.push(R)}const w=new Tn(x[0][0][0][1],"meters");if(v.type==="Point"||v.type==="MultiPoint"||v.type==="LineString")return Ip(v.type==="Point"?[v.coordinates]:v.coordinates,v.type==="LineString",x,w);if(v.type==="MultiLineString"){let A=1/0;for(let R=0;R<v.coordinates.length;R++){const M=Ip(v.coordinates[R],!0,x,w,A);if(isNaN(M))return M;if((A=Math.min(A,M))===0)return A}return A}return v.type==="Polygon"||v.type==="MultiPolygon"?(function(A,R,M){let O=1/0;for(const B of A)for(const N of R){const G=Yy(B,N,M,O);if(isNaN(G))return G;if((O=Math.min(O,G))===0)return O}return O})(v.type==="Polygon"?[v.coordinates]:v.coordinates,x,w):null})(s,u,this.geometries);console.warn("Distance Expression: currently only evaluates valid Point/LineString/Polygon geometries.")}else console.warn("Distance Expression: requires valid feature and canonical information.");return null}eachChild(){}outputDefined(){return!0}serialize(){return["distance",this.geojson]}}function Sd(l){if(l instanceof Cs&&(l.name==="get"&&l.args.length===1||l.name==="feature-state"||l.name==="has"&&l.args.length===1||l.name==="properties"||l.name==="geometry-type"||l.name==="id"||l.name.startsWith("filter-"))||l instanceof Wl||l instanceof wd)return!1;if(l instanceof Td)return l.featureConstant;let r=!0;return l.eachChild(s=>{r&&!Sd(s)&&(r=!1)}),r}function Ga(l){if(l instanceof Cs&&l.name==="feature-state")return!1;let r=!0;return l.eachChild(s=>{r&&!Ga(s)&&(r=!1)}),r}function Xl(l,r){if(l instanceof Cs&&r.includes(l.name))return!1;let s=!0;return l.eachChild(u=>{s&&!Xl(u,r)&&(s=!1)}),s}
18function M1(l,r,s){return[l,r,s].filter(Boolean).join("�")}function Pp(l,r){switch(l){case"string":return ja(r);case"number":return+r;case"boolean":return!!r;case"color":return xr.parse(r);case"formatted":return ss.fromString(ja(r));case"resolvedImage":return _s.build(ja(r))}return r}function L1(l,r,s,u){return u!==void 0&&(l=u*Math.round(l/u)),r!==void 0&&l<r&&(l=r),s!==void 0&&l>s&&(l=s),l}class Td{constructor(r,s,u,f=!1){this.type=r,this.key=s,this.scope=u,this.featureConstant=f}static parse(r,s){let u=s.expectedType;if(u==null&&(u=Mr),r.length<2||r.length>3)return s.error("Invalid number of arguments for 'config' expression.");const f=s.parse(r[1],1);if(!(f instanceof ml))return s.error("Key name of 'config' expression must be a string literal.");let g,v=!0;const x=ja(f.value);if(r.length>=3){const w=s.parse(r[2],2);if(!(w instanceof ml))return s.error("Scope of 'config' expression must be a string literal.");g=ja(w.value)}if(s.options){const w=M1(x,g,s._scope),A=s.options.get(w);A&&(v=Sd(A.value||A.default))}return new Td(u,x,g,v)}evaluate(r){const s=M1(this.key,this.scope,r.scope),u=r.getConfig(s);if(!u)return null;const{type:f,value:g,values:v,minValue:x,maxValue:w,stepValue:A}=u,R=u.default.evaluate(r);let M=R;if(g){const O=r.scope;r.scope=(O||"").split("�").slice(1).join("�"),M=g.evaluate(r),r.scope=O}return f&&(M=Pp(f,M)),M===void 0||x===void 0&&w===void 0&&A===void 0||(typeof M=="number"?M=L1(M,x,w,A):Array.isArray(M)&&(M=M.map(O=>typeof O=="number"?L1(O,x,w,A):O))),g!==void 0&&M!==void 0&&v&&!v.includes(M)&&(M=R,f&&(M=Pp(f,M))),(f&&f!==this.type||M!==void 0&&!md(Zi(M),this.type))&&(M=Pp(this.type.kind,M)),M}eachChild(){}outputDefined(){return!1}serialize(){const r=["config",this.key];return this.scope&&r.concat(this.scope),r}}class Rp{constructor(r,s){this.type=s.type,this.name=r,this.boundExpression=s}static parse(r,s){if(r.length!==2||typeof r[1]!="string")return s.error("'var' expression requires exactly one string literal argument.");const u=r[1];return s.scope.has(u)?new Rp(u,s.scope.get(u)):s.error(`Unknown variable "${u}". Make sure "${u}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(r){return this.boundExpression.evaluate(r)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class ta{constructor(r,s=[],u,f=new og,g=[],v,x,w){this.registry=r,this.path=s,this.scope=f,this.errors=g,this.expectedType=u,this._scope=v,this.options=x,this.iconImageUseTheme=w}get key(){if(this._key===void 0){const r=this.path;let s="";for(let u=0;u<r.length;u++){const f=r[u];s+=typeof f=="string"?`['${f}']`:`[${f}]`}this._key=s}return this._key}parse(r,s,u,f,g={}){return s||u?this.concat(s,null,u,f)._parse(r,g):this._parse(r,g)}parseObjectValue(r,s,u,f,g,v={}){return this.concat(s,u,f,g)._parse(r,v)}_parse(r,s){function u(f,g,v){return v==="assert"?new gl(g,[f]):v==="coerce"?new Gl(g,[f]):f}if(r!==null&&typeof r!="string"&&typeof r!="boolean"&&typeof r!="number"||(r=["literal",r]),Array.isArray(r)){if(r.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const f=typeof r[0]=="string"?this.registry[r[0]]:void 0;if(f){let g=f.parse(r,this);if(!g)return null;if(this.expectedType){const v=this.expectedType,x=g.type;if(v.kind!=="string"&&v.kind!=="number"&&v.kind!=="boolean"&&v.kind!=="object"&&v.kind!=="array"||x.kind!=="value")if(v.kind!=="color"&&v.kind!=="formatted"&&v.kind!=="resolvedImage"||x.kind!=="value"&&x.kind!=="string"){if(this.checkSubtype(v,x))return null}else g=u(g,v,s.typeAnnotation||"coerce");else g=u(g,v,s.typeAnnotation||"assert")}if(!(g instanceof ml)&&g.type.kind!=="resolvedImage"&&kp(g)){const v=new Wy(this._scope,this.options,this.iconImageUseTheme);try{g=new ml(g.type,g.evaluate(v))}catch(x){return this.error(x.message),null}}return g}return Gl.parse(["to-array",r],this)}return this.error(r===void 0?"'undefined' value invalid. Use null instead.":typeof r=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof r} instead.`)}concat(r,s,u,f){let g=typeof r=="number"?this.path.concat(r):this.path;g=typeof s=="string"?g.concat(s):g;const v=f?this.scope.concat(f):this.scope;return new ta(this.registry,g,u||null,v,this.errors,this._scope,this.options,this.iconImageUseTheme)}error(r,...s){const u=`${this.key}${s.map(f=>`[${f}]`).join("")}`;this.errors.push(new pl(u,r))}checkSubtype(r,s,u){const f=Fh(r,s);return f&&this.error(f,...typeof u=="number"?[u]:[]),f}}function kp(l){if(l instanceof Rp)return kp(l.boundExpression);if(l instanceof Cs&&l.name==="error"||l instanceof _d||l instanceof Wl||l instanceof wd||l instanceof Td)return!1;const r=l instanceof Gl||l instanceof gl;let s=!0;return l.eachChild(u=>{s=r?s&&kp(u):s&&u instanceof ml}),!!s&&Sd(l)&&Xl(l,["zoom","heatmap-density","worldview","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed","is-active-floor"])}function Mp(l,r){const s=l.length-1;let u,f,g=0,v=s,x=0;for(;g<=v;)if(x=Math.floor((g+v)/2),u=l[x],f=l[x+1],u<=r){if(x===s||r<f)return x;g=x+1}else{if(!(u>r))throw new hi("Input is not a number.");v=x-1}return 0}class Gh{constructor(r,s,u){this.type=r,this.input=s,this.labels=[],this.outputs=[];for(const[f,g]of u)this.labels.push(f),this.outputs.push(g)}static parse(r,s){if(r.length-1<4)return s.error(`Expected at least 4 arguments, but found only ${r.length-1}.`);if((r.length-1)%2!=0)return s.error("Expected an even number of arguments.");const u=s.parse(r[1],1,un);if(!u)return null;const f=[];let g=null;s.expectedType&&s.expectedType.kind!=="value"&&(g=s.expectedType);for(let v=1;v<r.length;v+=2){const x=v===1?-1/0:r[v],w=r[v+1],A=v,R=v+1;
18if(typeof x!="number")return s.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',A);if(f.length&&f.at(-1)[0]>=x)return s.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',A);const M=s.parse(w,R,g);if(!M)return null;g=g||M.type,f.push([x,M])}return new Gh(g,u,f)}evaluate(r){const s=this.labels,u=this.outputs;if(s.length===1)return u[0].evaluate(r);const f=this.input.evaluate(r);if(f<=s[0])return u[0].evaluate(r);const g=s.length;return f>=s[g-1]?u[g-1].evaluate(r):u[Mp(s,f)].evaluate(r)}eachChild(r){r(this.input);for(const s of this.outputs)r(s)}outputDefined(){return this.outputs.every(r=>r.outputDefined())}serialize(){const r=["step",this.input.serialize()];for(let s=0;s<this.labels.length;s++)s>0&&r.push(this.labels[s]),r.push(this.outputs[s].serialize());return r}}const e0=.95047,t0=1.08883,n0=4/29,Ed=6/29,pg=3*Ed*Ed,O1=Ed*Ed*Ed,D1=Math.PI/180,F1=180/Math.PI;function mg(l){return l>O1?Math.pow(l,1/3):l/pg+n0}function gg(l){return l>Ed?l*l*l:pg*(l-n0)}function r0(l){return 255*(l<=.0031308?12.92*l:1.055*Math.pow(l,1/2.4)-.055)}function i0(l){return(l/=255)<=.04045?l/12.92:Math.pow((l+.055)/1.055,2.4)}function Lp(l){const r=i0(l.r),s=i0(l.g),u=i0(l.b),f=mg((.4124564*r+.3575761*s+.1804375*u)/e0),g=mg((.2126729*r+.7151522*s+.072175*u)/1);return{l:116*g-16,a:500*(f-g),b:200*(g-mg((.0193339*r+.119192*s+.9503041*u)/t0)),alpha:l.a}}function Hh(l){let r=(l.l+16)/116,s=isNaN(l.a)?r:r+l.a/500,u=isNaN(l.b)?r:r-l.b/200;return r=1*gg(r),s=e0*gg(s),u=t0*gg(u),new xr(r0(3.2404542*s-1.5371385*r-.4985314*u),r0(-.969266*s+1.8760108*r+.041556*u),r0(.0556434*s-.2040259*r+1.0572252*u),l.alpha)}function _g(l,r,s){const u=r-l;return l+s*(u>180||u<-180?u-360*Math.round(u/360):u)}const Wh={forward:Lp,reverse:Hh,interpolate:function(l,r,s){return{l:Sn(l.l,r.l,s),a:Sn(l.a,r.a,s),b:Sn(l.b,r.b,s),alpha:Sn(l.alpha,r.alpha,s)}}},qh={forward:function(l){const{l:r,a:s,b:u}=Lp(l),f=Math.atan2(u,s)*F1;return{h:f<0?f+360:f,c:Math.sqrt(s*s+u*u),l:r,alpha:l.a}},reverse:function(l){const r=l.h*D1,s=l.c;return Hh({l:l.l,a:Math.cos(r)*s,b:Math.sin(r)*s,alpha:l.alpha})},interpolate:function(l,r,s){return{h:_g(l.h,r.h,s),c:Sn(l.c,r.c,s),l:Sn(l.l,r.l,s),alpha:Sn(l.alpha,r.alpha,s)}}};var o0=Object.freeze({__proto__:null,hcl:qh,lab:Wh});class na{constructor(r,s,u,f,g){this.type=r,this.operator=s,this.interpolation=u,this.input=f,this.labels=[],this.outputs=[];for(const[v,x]of g)this.labels.push(v),this.outputs.push(x)}static interpolationFactor(r,s,u,f){let g=0;if(r.name==="exponential")g=s0(s,r.base,u,f);else if(r.name==="linear")g=s0(s,1,u,f);else if(r.name==="cubic-bezier"){const v=r.controlPoints;g=new pu(v[0],v[1],v[2],v[3]).solve(s0(s,1,u,f))}return g}static parse(r,s){let[u,f,g,...v]=r;if(!Array.isArray(f)||f.length===0)return s.error("Expected an interpolation type expression.",1);if(f[0]==="linear")f={name:"linear"};else if(f[0]==="exponential"){const A=f[1];if(typeof A!="number")return s.error("Exponential interpolation requires a numeric base.",1,1);f={name:"exponential",base:A}}else{if(f[0]!=="cubic-bezier")return s.error(`Unknown interpolation type ${String(f[0])}`,1,0);{const A=f.slice(1);if(A.length!==4||A.some(R=>typeof R!="number"||R<0||R>1))return s.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);f={name:"cubic-bezier",controlPoints:A}}}if(r.length-1<4)return s.error(`Expected at least 4 arguments, but found only ${r.length-1}.`);if(r.length-1>3&&(r.length-1)%2!=0)return s.error("Expected an even number of arguments.");if(g=s.parse(g,2,un),!g)return null;const x=[];let w=null;u==="interpolate-hcl"||u==="interpolate-lab"?w=Es:s.expectedType&&s.expectedType.kind!=="value"&&(w=s.expectedType);for(let A=0;A<v.length;A+=2){const R=v[A],M=v[A+1],O=A+3,B=A+4;if(typeof R!="number")return s.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',O);if(x.length&&x.at(-1)[0]>=R)return s.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',O);const N=s.parse(M,B,w);if(!N)return null;w=w||N.type,x.push([R,N])}return w.kind==="number"||w.kind==="color"||w.kind==="array"&&w.itemType.kind==="number"&&typeof w.N=="number"?new na(w,u,f,g,x):s.error(`Type ${$n(w)} is not interpolatable.`)}evaluate(r){const s=this.labels,u=this.outputs;if(s.length===1)return u[0].evaluate(r);const f=this.input.evaluate(r);if(f<=s[0])return u[0].evaluate(r);const g=s.length;if(f>=s[g-1])return u[g-1].evaluate(r);const v=Mp(s,f),x=na.interpolationFactor(this.interpolation,f,s[v],s[v+1]),w=u[v].evaluate(r),A=u[v+1].evaluate(r);return this.operator==="interpolate"?ig[this.type.kind.toLowerCase()](w,A,x):this.operator==="interpolate-hcl"?qh.reverse(qh.interpolate(qh.forward(w),qh.forward(A),x)):Wh.reverse(Wh.interpolate(Wh.forward(w),Wh.forward(A),x))}eachChild(r){r(this.input);for(const s of this.outputs)r(s)}outputDefined(){return this.outputs.every(r=>r.outputDefined())}serialize(){let r;r=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier",...this.interpolation.controlPoints];const s=[this.operator,r,this.input.serialize()];for(let u=0;u<this.labels.length;u++)s.push(this.labels[u],this.outputs[u].serialize());return s}}function s0(l,r,s,u){const f=u-s,g=l-s;return f===0?0:r===1?g/f:(Math.pow(r,g)-1)/(Math.pow(r,f)-1)}class yg{constructor(r,s){this.type=r,this.args=s}static parse(r,s){if(r.length<2)return s.error("Expectected at least one argument."),null;let u=null;const f=s.expectedType;f&&f.kind!=="value"&&(u=f);const g=[];for(const x of r.slice(1)){const w=s.parse(x,1+g.length,u,void 0,{typeAnnotation:"omit"});if(!w)return null;u=u||w.type,g.push(w)}const v=f&&g.some(x=>Fh(f,x.type));return new yg(v?Mr:u,g)}evaluate(r){let s,u=null,f=0;for(const g of this.args){if(f++,u=g.evaluate(r),u&&u instanceof _s&&!u.available&&(s||(s=u),u=null,f===this.args.length))return s;if(u!==null)break}return u}
18eachChild(r){this.args.forEach(r)}outputDefined(){return this.args.every(r=>r.outputDefined())}serialize(){const r=["coalesce"];return this.eachChild(s=>{r.push(s.serialize())}),r}}const y2=/[^a-zA-Z0-9_]/;class Pc{constructor(r,s){this.type=s.type,this.bindings=[].concat(r),this.result=s}evaluate(r){return this.result.evaluate(r)}eachChild(r){for(const s of this.bindings)r(s[1]);r(this.result)}static parse(r,s){if(r.length<4)return s.error(`Expected at least 3 arguments, but found ${r.length-1} instead.`);const u=[];for(let g=1;g<r.length-1;g+=2){const v=r[g];if(typeof v!="string")return s.error(`Expected string, but found ${typeof v} instead.`,g);if(y2.test(v))return s.error("Variable names must contain only alphanumeric characters or '_'.",g);const x=s.parse(r[g+1],g+1);if(!x)return null;u.push([v,x])}const f=s.parse(r.at(-1),r.length-1,s.expectedType,u);return f?new Pc(u,f):null}outputDefined(){return this.result.outputDefined()}serialize(){const r=["let"];for(const[s,u]of this.bindings)r.push(s,u.serialize());return r.push(this.result.serialize()),r}}class vg{constructor(r,s,u){this.type=r,this.index=s,this.input=u}static parse(r,s){if(r.length!==3)return s.error(`Expected 2 arguments, but found ${r.length-1} instead.`);const u=s.parse(r[1],1,un),f=s.parse(r[2],2,os(s.expectedType||Mr));return u&&f?new vg(f.type.itemType,u,f):null}evaluate(r){const s=this.index.evaluate(r),u=this.input.evaluate(r);if(s<0)throw new hi("Array index out of bounds: negative index");if(s>=u.length)throw new hi("Array index out of bounds: index exceeds array size");if(s!==Math.floor(s))throw new hi("Array index must be an integer. Use at-interpolated for fractional indices");return u[s]}eachChild(r){r(this.index),r(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class tr{constructor(r,s,u){this.type=r,this.index=s,this.input=u}static parse(r,s){if(r.length!==3)return s.error(`Expected 2 arguments, but found ${r.length-1} instead.`);const u=s.parse(r[1],1,un),f=s.parse(r[2],2,os(s.expectedType||Mr));return u&&f?new tr(f.type.itemType,u,f):null}evaluate(r){const s=this.index.evaluate(r),u=this.input.evaluate(r);if(s<0)throw new hi(`Array index out of bounds: ${s} < 0.`);if(s>u.length-1)throw new hi(`Array index out of bounds: ${s} > ${u.length-1}.`);if(s===Math.floor(s))return u[s];const f=Math.floor(s),g=Math.ceil(s),v=u[f],x=u[g];if(typeof v!="number"||typeof x!="number")throw new hi(`Cannot interpolate between non-number values at index ${s}.`);const w=s-f;return v*(1-w)+x*w}eachChild(r){r(this.index),r(this.input)}outputDefined(){return!1}serialize(){return["at-interpolated",this.index.serialize(),this.input.serialize()]}}class a0{constructor(r,s){this.type=ur,this.needle=r,this.haystack=s}static parse(r,s){if(r.length!==3)return s.error(`Expected 2 arguments, but found ${r.length-1} instead.`),null;const u=s.parse(r[1],1,Mr),f=s.parse(r[2],2,Mr);return u&&f?jy(u.type,[ur,Rr,un,vu,Mr])?new a0(u,f):(s.error(`Expected first argument to be of type boolean, string, number or null, but found ${$n(u.type)} instead`),null):null}evaluate(r){const s=this.needle.evaluate(r),u=this.haystack.evaluate(r);if(u==null)return!1;if(!gp(s,["boolean","string","number","null"]))throw new hi(`Expected first argument to be of type boolean, string, number or null, but found ${$n(Zi(s))} instead.`);if(!gp(u,["string","array"]))throw new hi(`Expected second argument to be of type array or string, but found ${$n(Zi(u))} instead.`);return u.includes(s)}eachChild(r){r(this.needle),r(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class bg{constructor(r,s,u){this.type=un,this.needle=r,this.haystack=s,this.fromIndex=u}static parse(r,s){if(r.length<=2||r.length>=5)return s.error(`Expected 3 or 4 arguments, but found ${r.length-1} instead.`),null;const u=s.parse(r[1],1,Mr),f=s.parse(r[2],2,Mr);if(!u||!f)return null;if(!jy(u.type,[ur,Rr,un,vu,Mr]))return s.error(`Expected first argument to be of type boolean, string, number or null, but found ${$n(u.type)} instead`),null;if(r.length===4){const g=s.parse(r[3],3,un);return g?new bg(u,f,g):null}return new bg(u,f)}evaluate(r){const s=this.needle.evaluate(r),u=this.haystack.evaluate(r);if(!gp(s,["boolean","string","number","null"]))throw new hi(`Expected first argument to be of type boolean, string, number or null, but found ${$n(Zi(s))} instead.`);if(!gp(u,["string","array"]))throw new hi(`Expected second argument to be of type array or string, but found ${$n(Zi(u))} instead.`);if(this.fromIndex){const f=this.fromIndex.evaluate(r);return u.indexOf(s,f)}return u.indexOf(s)}eachChild(r){r(this.needle),r(this.haystack),this.fromIndex&&r(this.fromIndex)}outputDefined(){return!1}serialize(){if(this.fromIndex!=null&&this.fromIndex!==void 0){const r=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),r]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class l0{constructor(r,s,u,f,g,v){this.inputType=r,this.type=s,this.input=u,this.cases=f,this.outputs=g,this.otherwise=v}static parse(r,s){if(r.length<5)return s.error(`Expected at least 4 arguments, but found only ${r.length-1}.`);if(r.length%2!=1)return s.error("Expected an even number of arguments.");let u,f;s.expectedType&&s.expectedType.kind!=="value"&&(f=s.expectedType);const g={},v=[];for(let A=2;A<r.length-1;A+=2){let R=r[A];const M=r[A+1];
18Array.isArray(R)||(R=[R]);const O=s.concat(A);if(R.length===0)return O.error("Expected at least one branch label.");for(const N of R){if(typeof N!="number"&&typeof N!="string")return O.error("Branch labels must be numbers or strings.");if(typeof N=="number"&&Math.abs(N)>Number.MAX_SAFE_INTEGER)return O.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof N=="number"&&Math.floor(N)!==N)return O.error("Numeric branch labels must be integer values.");if(u){if(O.checkSubtype(u,Zi(N)))return null}else u=Zi(N);if(g[String(N)]!==void 0)return O.error("Branch labels must be unique.");g[String(N)]=v.length}const B=s.parse(M,A,f);if(!B)return null;f=f||B.type,v.push(B)}const x=s.parse(r[1],1,Mr);if(!x)return null;const w=s.parse(r.at(-1),r.length-1,f);return w?x.type.kind!=="value"&&s.concat(1).checkSubtype(u,x.type)?null:new l0(u,f,x,g,v,w):null}evaluate(r){const s=this.input.evaluate(r);return(md(Zi(s),this.inputType)&&this.outputs[this.cases[s]]||this.otherwise).evaluate(r)}eachChild(r){r(this.input),this.outputs.forEach(r),r(this.otherwise)}outputDefined(){return this.outputs.every(r=>r.outputDefined())&&this.otherwise.outputDefined()}serialize(){const r=["match",this.input.serialize()],s=Object.keys(this.cases).sort(),u=[],f={};for(const v of s){const x=f[this.cases[v]];x===void 0?(f[this.cases[v]]=u.length,u.push([this.cases[v],[v]])):u[x][1].push(v)}const g=v=>this.inputType.kind==="number"?Number(v):v;for(const[v,x]of u)r.push(x.length===1?g(x[0]):x.map(g)),r.push(this.outputs[v].serialize());return r.push(this.otherwise.serialize()),r}}class xg{constructor(r,s,u){this.type=r,this.branches=s,this.otherwise=u}static parse(r,s){if(r.length<4)return s.error(`Expected at least 3 arguments, but found only ${r.length-1}.`),null;if(r.length%2!=0)return s.error("Expected an odd number of arguments."),null;let u;s.expectedType&&s.expectedType.kind!=="value"&&(u=s.expectedType);const f=[];for(let v=1;v<r.length-1;v+=2){const x=s.parse(r[v],v,ur);if(!x)return null;const w=s.parse(r[v+1],v+1,u);if(!w)return null;f.push([x,w]),u=u||w.type}const g=s.parse(r.at(-1),r.length-1,u);return g?new xg(u,f,g):null}evaluate(r){for(const[s,u]of this.branches)if(s.evaluate(r))return u.evaluate(r);return this.otherwise.evaluate(r)}eachChild(r){for(const[s,u]of this.branches)r(s),r(u);r(this.otherwise)}outputDefined(){return this.branches.every(([r,s])=>s.outputDefined())&&this.otherwise.outputDefined()}serialize(){const r=["case"];return this.eachChild(s=>{r.push(s.serialize())}),r}}class wg{constructor(r,s,u,f){this.type=r,this.input=s,this.beginIndex=u,this.endIndex=f}static parse(r,s){if(r.length<=2||r.length>=5)return s.error(`Expected 3 or 4 arguments, but found ${r.length-1} instead.`),null;const u=s.parse(r[1],1,Mr),f=s.parse(r[2],2,un);if(!u||!f)return null;if(!jy(u.type,[os(Mr),Rr,Mr]))return s.error(`Expected first argument to be of type array or string, but found ${$n(u.type)} instead`),null;if(r.length===4){const g=s.parse(r[3],3,un);return g?new wg(u.type,u,f,g):null}return new wg(u.type,u,f)}evaluate(r){const s=this.input.evaluate(r),u=this.beginIndex.evaluate(r);if(!gp(s,["string","array"]))throw new hi(`Expected first argument to be of type array or string, but found ${$n(Zi(s))} instead.`);if(this.endIndex){const f=this.endIndex.evaluate(r);return s.slice(u,f)}return s.slice(u)}eachChild(r){r(this.input),r(this.beginIndex),this.endIndex&&r(this.endIndex)}outputDefined(){return!1}serialize(){if(this.endIndex!=null&&this.endIndex!==void 0){const r=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),r]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}class ai{constructor(r,s){this.type=os(Rr),this.str=r,this.delimiter=s}static parse(r,s){if(r.length!==3)return s.error(`Expected 2 arguments, but found ${r.length-1} instead.`);const u=s.parse(r[1],1,Rr),f=s.parse(r[2],2,Rr);return u&&f?new ai(u,f):void 0}evaluate(r){const s=this.str.evaluate(r),u=this.delimiter.evaluate(r);return s.split(u)}eachChild(r){r(this.str),r(this.delimiter)}outputDefined(){return!1}serialize(){return["split",this.str.serialize(),this.delimiter.serialize()]}}function B1(l,r){return l==="=="||l==="!="?r.kind==="boolean"||r.kind==="str
18ing"||r.kind==="number"||r.kind==="null"||r.kind==="value":r.kind==="string"||r.kind==="number"||r.kind==="value"}function z1(l,r,s,u){return u.compare(r,s)===0}function Xh(l,r,s){const u=l!=="=="&&l!=="!=";return class fj{constructor(g,v,x){this.type=ur,this.lhs=g,this.rhs=v,this.collator=x,this.hasUntypedArgument=g.type.kind==="value"||v.type.kind==="value"}static parse(g,v){if(g.length!==3&&g.length!==4)return v.error("Expected two or three arguments.");const x=g[0];let w=v.parse(g[1],1,Mr);if(!w)return null;if(!B1(x,w.type))return v.concat(1).error(`"${x}" comparisons are not supported for type '${$n(w.type)}'.`);let A=v.parse(g[2],2,Mr);if(!A)return null;if(!B1(x,A.type))return v.concat(2).error(`"${x}" comparisons are not supported for type '${$n(A.type)}'.`);if(w.type.kind!==A.type.kind&&w.type.kind!=="value"&&A.type.kind!=="value")return v.error(`Cannot compare types '${$n(w.type)}' and '${$n(A.type)}'.`);u&&(w.type.kind==="value"&&A.type.kind!=="value"?w=new gl(A.type,[w]):w.type.kind!=="value"&&A.type.kind==="value"&&(A=new gl(w.type,[A])));let R=null;if(g.length===4){if(w.type.kind!=="string"&&A.type.kind!=="string"&&w.type.kind!=="value"&&A.type.kind!=="value")return v.error("Cannot use collator to compare non-string types.");if(R=v.parse(g[3],3,bu),!R)return null}return new fj(w,A,R)}evaluate(g){const v=this.lhs.evaluate(g),x=this.rhs.evaluate(g);if(u&&this.hasUntypedArgument){const w=Zi(v),A=Zi(x);if(w.kind!==A.kind||w.kind!=="string"&&w.kind!=="number")throw new hi(`Expected arguments for "${l}" to be (string, string) or (number, number), but found (${w.kind}, ${A.kind}) instead.`)}if(this.collator&&!u&&this.hasUntypedArgument){const w=Zi(v),A=Zi(x);if(w.kind!=="string"||A.kind!=="string")return r(g,v,x)}return this.collator?s(g,v,x,this.collator.evaluate(g)):r(g,v,x)}eachChild(g){g(this.lhs),g(this.rhs),this.collator&&g(this.collator)}outputDefined(){return!0}serialize(){const g=[l];return this.eachChild(v=>{g.push(v.serialize())}),g}}}const v2=Xh("==",function(l,r,s){return r===s},z1),b2=Xh("!=",function(l,r,s){return r!==s},function(l,r,s,u){return!z1(0,r,s,u)}),x2=Xh("<",function(l,r,s){return r<s},function(l,r,s,u){return u.compare(r,s)<0}),w2=Xh(">",function(l,r,s){return r>s},function(l,r,s,u){return u.compare(r,s)>0}),S2=Xh("<=",function(l,r,s){return r<=s},function(l,r,s,u){return u.compare(r,s)<=0}),T2=Xh(">=",function(l,r,s){return r>=s},function(l,r,s,u){return u.compare(r,s)>=0});class c0{constructor(r,s,u,f,g,v){this.type=Rr,this.number=r,this.locale=s,this.currency=u,this.unit=f,this.minFractionDigits=g,this.maxFractionDigits=v}static parse(r,s){if(r.length!==3)return s.error("Expected two arguments.");const u=s.parse(r[1],1,un);if(!u)return null;const f=r[2];if(typeof f!="object"||Array.isArray(f))return s.error("NumberFormat options argument must be an object.");let g=null;if(f.locale&&(g=s.parseObjectValue(f.locale,2,"locale",Rr),!g))return null;let v=null;if(f.currency&&(v=s.parseObjectValue(f.currency,2,"currency",Rr),!v))return null;let x=null;if(f.unit&&(x=s.parseObjectValue(f.unit,2,"unit",Rr),!x))return null;let w=null;if(f["min-fraction-digits"]&&(w=s.parseObjectValue(f["min-fraction-digits"],2,"min-fraction-digits",un),!w))return null;let A=null;return f["max-fraction-digits"]&&(A=s.parseObjectValue(f["max-fraction-digits"],2,"max-fraction-digits",un),!A)?null:new c0(u,g,v,x,w,A)}evaluate(r){return new Intl.NumberFormat(this.locale?this.locale.evaluate(r):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(r):void 0,unit:this.unit?this.unit.evaluate(r):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(r):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(r):void 0}).format(this.number.evaluate(r))}eachChild(r){r(this.number),this.locale&&r(this.locale),this.currency&&r(this.currency),this.unit&&r(this.unit),this.minFractionDigits&&r(this.minFractionDigits),this.maxFractionDigits&&r(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const r={};return this.locale&&(r.locale=this.locale.serialize()),this.currency&&(r.currency=this.currency.serialize()),this.unit&&(r.unit=this.unit.serialize()),this.minFractionDigits&&(r["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(r["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),r]}}class u0{constructor(r){this.type=un,this.input=r}static parse(r,s){if(r.length!==2)return s.error(`Expected 1 argument, but found ${r.length-1} instead.`),null;const u=s.parse(r[1],1);return u?u.type.kind!=="array"&&u.type.kind!=="string"&&u.type.kind!=="value"?(s.error(`Expected argument of type string or array, but found ${$n(u.type)} instead.`),null):new u0(u):null}evaluate(r){const s=this.input.evaluate(r);if(typeof s=="string"||Array.isArray(s))return s.length;throw new hi(`Expected value to be of type string or array, but found ${$n(Zi(s))} instead.`)}eachChild(r){r(this.input)}outputDefined(){return!1}serialize(){const r=["length"];return this.eachChild(s=>{r.push(s.serialize())}),r}}function d0(l){return function(){l=1831565813+(l|=0)|0;let r=Math.imul(l^l>>
18>15,1|l);return r=r+Math.imul(r^r>>>7,61|r)^r,((r^r>>>14)>>>0)/4294967296}}const Zh={"==":v2,"!=":b2,">":w2,"<":x2,">=":T2,"<=":S2,array:gl,at:vg,"at-interpolated":tr,boolean:gl,case:xg,coalesce:yg,collator:_d,format:Nh,image:_p,in:a0,"index-of":bg,interpolate:na,"interpolate-hcl":na,"interpolate-lab":na,length:u0,let:Pc,literal:ml,match:l0,number:gl,"number-format":c0,object:gl,slice:wg,step:Gh,string:gl,"to-boolean":Gl,"to-color":Gl,"to-number":Gl,"to-string":Gl,var:Rp,within:Wl,distance:wd,config:Td,split:ai};function N1(l,[r,s,u,f]){r=r.evaluate(l),s=s.evaluate(l),u=u.evaluate(l);const g=f?f.evaluate(l):1,v=g1(r,s,u,g);if(v)throw new hi(v);return new xr(r/255,s/255,u/255,g)}function V1(l,[r,s,u,f]){r=r.evaluate(l),s=s.evaluate(l),u=u.evaluate(l);const g=f?f.evaluate(l):1,v=(function(A,R,M,O){return typeof A=="number"&&A>=0&&A<=360?typeof R=="number"&&R>=0&&R<=100&&typeof M=="number"&&M>=0&&M<=100?O===void 0||typeof O=="number"&&O>=0&&O<=1?null:`Invalid hsla value [${[A,R,M,O].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid hsla value [${(typeof O=="number"?[A,R,M,O]:[A,R,M]).join(", ")}]: 's', and 'l' must be between 0 and 100.`:`Invalid hsla value [${(typeof O=="number"?[A,R,M,O]:[A,R,M]).join(", ")}]: 'h' must be between 0 and 360.`})(r,s,u,g);if(v)throw new hi(v);const x=`hsla(${r}, ${s}%, ${u}%, ${g})`,w=xr.parse(x);if(!w)throw new hi(`Failed to parse HSLA color: ${x}`);return w}function U1(l,r){return l in r}function h0(l,r){const s=r[l];return s===void 0?null:s}function wu(l){return{type:l}}function Sg(l){if(l instanceof Td)return new Set([l.key]);let r=new Set;return l.eachChild(s=>{r=new Set([...r,...Sg(s)])}),r}function Tg(l){if(l instanceof Cs&&l.name==="is-active-floor")return!0;let r=!1;return l.eachChild(s=>{!r&&Tg(s)&&(r=!0)}),r}function $1(l){return{result:"success",value:l}}function Su(l){return{result:"error",value:l}}function f0(l,r){return!!l&&!!l.parameters&&l.parameters.includes(r)}function Eg(l){return l["property-type"]==="data-driven"}function j1(l){return f0(l.expression,"measure-light")}function G1(l){return f0(l.expression,"zoom")}function p0(l){return!!l.expression&&l.expression.interpolated}function m0(l){return typeof l=="object"&&l!==null&&!Array.isArray(l)}function E2(l){return l}function H1(l,r){const s=r.type==="color",u=l.stops&&typeof l.stops[0][0]=="object",f=u||!(u||l.property!==void 0),g=l.type||(p0(r)?"exponential":"interval");if(s&&((l=Object.assign({},l)).stops&&(l.stops=l.stops.map(A=>[A[0],xr.parse(A[1])])),l.default=xr.parse(l.default?l.default:r.default)),l.colorSpace&&l.colorSpace!=="rgb"&&!o0[l.colorSpace])throw new Error(`Unknown color space: ${l.colorSpace}`);let v,x,w;if(g==="exponential")v=_0;else if(g==="interval")v=Cg;else if(g==="categorical"){v=g0,x=Object.create(null);for(const A of l.stops)x[A[0]]=A[1];w=typeof l.stops[0][0]}else{if(g!=="identity")throw new Error(`Unknown function type "${g}"`);v=C2}if(u){const A={},R=[];for(let B=0;B<l.stops.length;B++){const N=l.stops[B],G=N[0].zoom;A[G]===void 0&&(A[G]={zoom:G,type:l.type,property:l.property,default:l.default,stops:[]},R.push(G)),A[G].stops.push([N[0].value,N[1]])}const M=[];for(const B of R)M.push([A[B].zoom,H1(A[B],r)]);const O={name:"linear"};return{kind:"composite",interpolationType:O,interpolationFactor:na.interpolationFactor.bind(void 0,O),zoomStops:M.map(B=>B[0]),evaluate:({zoom:B},N)=>_0({stops:M,base:l.base},r,B).evaluate(B,N)}}if(f){const A=g==="exponential"?{name:"exponential",base:l.base!==void 0?l.base:1}:null;return{kind:"camera",interpolationType:A,interpolationFactor:na.interpolationFactor.bind(void 0,A),zoomStops:l.stops.map(R=>R[0]),evaluate:({zoom:R})=>v(l,r,R,x,w)}}return{kind:"source",evaluate(A,R){const M=R&&R.properties?R.properties[l.property]:void 0;return M===void 0?Op(l.default,r.default):v(l,r,M,x,w)}}}function Op(l,r,s){return l!==void 0?l:r!==void 0?r:s!==void 0?s:void 0}function g0(l,r,s,u,f){return Op(typeof s===f?u[s]:void 0,l.default,r.default)}function Cg(l,r,s){if(!yp(s))return Op(l.default,r.default);const u=l.stops.length;if(u===1||s<=l.stops[0][0])return l.stops[0][1];if(s>=l.stops[u-1][0])return l.stops[u-1][1];const f=Mp(l.stops.map(g=>g[0]),s);return l.stops[f][1]}function _0(l,r,s){const u=l.base!==void 0?l.base:1;if(!yp(s))return Op(l.default,r.default);const f=l.stops.length;if(f===1||s<=l.stops[0][0])return l.stops[0][1];if(s>=l.stops[f-1][0])return l.stops[f-1][1];const g=Mp(l.stops.map(R=>R[0]),s),v=(function(R,M,O,B){const N=B-O,G=R-O;return N===0?0:M===1?G/N:(Math.pow(M,G)-1)/(Math.pow(M,N)-1)})(s,u,l.stops[g][0],l.stops[g+1][0]),x=l.stops[g][1],w=l.stops[g+1][1];let A=ig[r.type]||E2;if(l.colorSpace&&l.colorSpace!=="rgb"){const R=o0[l.colorSpace];A=(M,O)=>R.reverse(R.interpolate(R.forward(M),R.forward(O),v))}return typeof x.evaluate=="function"?{evaluate(...R){const M=x.evaluate.apply(void 0,R),O=w.evaluate.apply(void 0,R);if(M!==void 0&&O!==void 0)return A(M,O,v)}}:A(x,w,v)}function C2(l,r,s){return r.type==="color"?s=xr.parse(s):r.type==="formatted"?s=ss.fromString(s.toString()):r.type==="resolvedImage"?s=_s.build(s.toString()):ag(s)===r.type||r.type==="enum"&&r.values[s]||(s=void 0),Op(s,l.default,r.default)}Cs.register(Zh,{error:[{kind:"error"},[Rr],(l,[r])=>{throw new hi(r.evaluate(l))}],typeof:[Rr,[Mr],(l,[r])=>$n(Zi(r.evaluate(l)))],"to-rgba":[os(un,4),[Es],(l,[r])=>r.evaluate(l).toNonPremultipliedRenderColor(null).toArray()],"to-hsla":[os(un,4),[Es],(l,[r])=>r.evaluate(l).toNonPremultipliedRenderColor(null).toHslaArray()],rgb:[Es,[un,un,un],N1],rgba:[Es,[un,un,un,un],N1],hsl:[Es,[un,un,un],V1],hsla:[Es,[un,un,un,un],V1],has:{type:ur,overloads:[[[Rr],(l,[r])=>U1(r.evaluate(l),l.properties())],[[Rr,jl],(l,[r,s])=>U1(r.evaluate(l),s.evaluate(l))]]},get:{type:Mr,overloads:[[[Rr],(l,[r])=>h0(r.evaluate(l),l.properties())],[[Rr,jl],(l,[r,s])=>h0(r.evaluate(l),s.evaluate(l))]]},"feature-state":[Mr,[Rr],(l,[r])=>h0(r.evaluate(l),l.featureState||{})],properties:[jl,[],l=>l.properties()],"geometry-type":[Rr,[],l=>l.geometryType()],worldview:[Rr,[],l=>l.globals.worldview||""],"is-active-floor":[ur,wu(Rr),(l,r)=>{if(!(l.globals&&l.globals.activeFloors&&l.globals.activeFloors.size>0))return!1;if(r.length===0)return!0;const s=l.globals.activeFloors;return r.some(u=>{const f=u.evaluate(l);return s.has(f)})}],id:[Mr,[],l=>l.id()],zoom:[un,[],l=>l.globals.zoom],pitch:[un,[],l=>l.globals.pitch||0],"distance-from-center":[un,[],l=>l.distanceFromCenter()],"measure-light":[un,[Rr],(l,[r])=>l.measureLight(r.evaluate(l))],"heatmap-density":[un,[],l=>l.globals.heatmapDensity||0],"line-progress":[un,[],l=>l.globals.lineProgress||0],"raster-value":[un,[],l=>l.globals.rasterValue||0],"raster-particle-speed":[un,[],l=>l.globals.rasterParticleSpeed||0],"sky-radial-progress":[un,[],l=>l.globals.skyRadialProgress||0],accumulated:[Mr,[],l=>l.globals.accumulated===void 0?null:l.globals.accumulated],"+":[un,wu(un),(l,r)=>{let s=0;for(const u of r)s+=u.evaluate(l);return s}],"*":[un,wu(un),(l,r)=>{let s=1;for(const u of r)s*=u.evaluate(l);return s}],"-":{type:un,overloads:[[[un,un],(l,[r,s])=>r.evaluate(l)-s.evaluate(l)],[[un],(l,[r])=>-r.evaluate(l)]]},"/":[un,[un,un],(l,[r,s])=>r.evaluate(l)/s.evaluate(l)],"%":[un,[un,un],(l,[r,s])=>r.evaluate(l)%s.evaluate(l)],ln2:[un,[],()=>Math.LN2],pi:[un,[],()=>Math.PI],e:[un,[],()=>Math.E],"^":[un,[un,un],(l,[r,s])=>Math.pow(r.evaluate(l),s.evaluate(l))],sqrt:[un,[un],(l,[r])=>Math.sqrt(r.evaluate(l))],log10:[un,[un],(l,[r])=>Math.log(r.evaluate(l))/Math.LN10],ln:[un,[un],(l,[r])=>Math.log(r.evaluate(l))],log2:[un,[un],(l,[r])=>Math.log2(r.evaluate(l))],sin:[un,[un],(l,[r])=>Math.sin(r.evaluate(l))],cos:[un,[un],(l,[r])=>Math.cos(r.evaluate(l))],tan:[un,[un],(l,[r])=>Math.tan(r.evaluate(l))],asin:[un,[un],(l,[r])=>Math.asin(r.evaluate(l))],acos:[un,[un],(l,[r])=>Math.acos(r.evaluate(l))],atan:[un,[un],(l,[r])=>Math.atan(r.evaluate(l))],min:[un,wu(un),(l,r)=>Math.min(...r.map(s=>s.evaluate(l)))],max:[un,wu(un),(l,r)=>Math.max(...r.map(s=>s.evaluate(l)))],abs:[un,[un],(l,[r])=>Math.abs(r.evaluate(l))],round:[un,[un],(l,[r])=>{const s=r.evaluate(l);return s<0?-Math.round(-s):Math.round(s)}],floor:[un,[un],(l,[r])=>Math.floor(r.evaluate(l))],ceil:[un,[un],(l,[r])=>Math.ceil(r.evaluate(l))],"filter-==":[ur,[Rr,Mr],(l,[r,s])=>l.properties()[r.value]===s.value],"filter-id-==":[ur,[Mr],(l,[r])=>l.id()===r.value],"filter-type-==":[ur,[Rr],(l,[r])=>l.geometryType()===r.value],"filter-<":[ur,[Rr,Mr],(l,[r,s])=>{const u=l.properties()[r.value],f=s.value;return typeof u==typeof f&&u<f}],"filter-id-<":[ur,[Mr],(l,[r])=>{const s=l.id(),u=r.value;return typeof s==typeof u&&s<u}],"filter->":[ur,[Rr,Mr],(l,[r,s])=>{const u=l.properties()[r.value],f=s.value;return typeof u==typeof f&&u>f}
18],"filter-id->":[ur,[Mr],(l,[r])=>{const s=l.id(),u=r.value;return typeof s==typeof u&&s>u}],"filter-<=":[ur,[Rr,Mr],(l,[r,s])=>{const u=l.properties()[r.value],f=s.value;return typeof u==typeof f&&u<=f}],"filter-id-<=":[ur,[Mr],(l,[r])=>{const s=l.id(),u=r.value;return typeof s==typeof u&&s<=u}],"filter->=":[ur,[Rr,Mr],(l,[r,s])=>{const u=l.properties()[r.value],f=s.value;return typeof u==typeof f&&u>=f}],"filter-id->=":[ur,[Mr],(l,[r])=>{const s=l.id(),u=r.value;return typeof s==typeof u&&s>=u}],"filter-has":[ur,[Mr],(l,[r])=>r.value in l.properties()],"filter-has-id":[ur,[],l=>l.id()!==null&&l.id()!==void 0],"filter-type-in":[ur,[os(Rr)],(l,[r])=>r.value.includes(l.geometryType())],"filter-id-in":[ur,[os(Mr)],(l,[r])=>r.value.includes(l.id())],"filter-in-small":[ur,[Rr,os(Mr)],(l,[r,s])=>s.value.includes(l.properties()[r.value])],"filter-in-large":[ur,[Rr,os(Mr)],(l,[r,s])=>(function(u,f,g,v){for(;g<=v;){const x=g+v>>1;if(f[x]===u)return!0;f[x]>u?v=x-1:g=x+1}return!1})(l.properties()[r.value],s.value,0,s.value.length-1)],all:{type:ur,overloads:[[[ur,ur],(l,[r,s])=>r.evaluate(l)&&s.evaluate(l)],[wu(ur),(l,r)=>{for(const s of r)if(!s.evaluate(l))return!1;return!0}]]},any:{type:ur,overloads:[[[ur,ur],(l,[r,s])=>r.evaluate(l)||s.evaluate(l)],[wu(ur),(l,r)=>{for(const s of r)if(s.evaluate(l))return!0;return!1}]]},"!":[ur,[ur],(l,[r])=>!r.evaluate(l)],"is-supported-script":[ur,[Rr],(l,[r])=>{const s=l.globals&&l.globals.isSupportedScript;return!s||s(r.evaluate(l))}],upcase:[Rr,[Rr],(l,[r])=>r.evaluate(l).toUpperCase()],downcase:[Rr,[Rr],(l,[r])=>r.evaluate(l).toLowerCase()],concat:[Rr,wu(Mr),(l,r)=>r.map(s=>ja(s.evaluate(l))).join("")],"resolved-locale":[Rr,[bu],(l,[r])=>r.evaluate(l).resolvedLocale()],random:[un,[un,un,Mr],(l,r)=>{const[s,u,f]=r.map(v=>v.evaluate(l));if(s>u||s===u)return s;let g;if(typeof f=="string")g=(function(v){let x=0;if(v.length===0)return x;for(let w=0;w<v.length;w++)x=(x<<5)-x+v.charCodeAt(w),x&=x;return x})(f);else{if(typeof f!="number")throw new hi(`Invalid seed input: ${f}`);g=f}return s+d0(g)()*(u-s)}]});class y0{constructor(r,s,u,f,g){this.expression=r,this._warningHistory={},this._scope=u,this._options=f,this._iconImageUseTheme=g,this._evaluator=new Wy(u,f,g),this._defaultValue=s?(function(v){return v.type==="color"&&(m0(v.default)||Array.isArray(v.default))?new xr(0,0,0,0):v.type==="color"?xr.parse(v.default)||null:v.default===void 0?null:v.default})(s):null,this._enumValues=s&&s.type==="enum"?s.values:null,this.configDependencies=Sg(r),this.isIndoorDependent=Tg(r)}evaluateWithoutErrorHandling(r,s,u,f,g,v,x,w){return this._evaluator.globals=r,this._evaluator.feature=s,this._evaluator.featureState=u,this._evaluator.canonical=f||null,this._evaluator.availableImages=g||null,this._evaluator.formattedSection=v,this._evaluator.featureTileCoord=x||null,this._evaluator.featureDistanceData=w||null,this.expression.evaluate(this._evaluator)}evaluate(r,s,u,f,g,v,x,w,A){this._evaluator||(this._evaluator=new Wy(this._scope,this._options,this._iconImageUseTheme)),this._evaluator.globals=r,this._evaluator.feature=s||null,this._evaluator.featureState=u||null,this._evaluator.canonical=f||null,this._evaluator.availableImages=g||null,this._evaluator.formattedSection=v||null,this._evaluator.featureTileCoord=x||null,this._evaluator.featureDistanceData=w||null,this._evaluator.iconImageUseTheme=A||null;try{const R=this.expression.evaluate(this._evaluator);if(R==null||typeof R=="number"&&R!=R)return this._defaultValue;if(this._enumValues&&!(R in this._enumValues))throw new hi(`Expected value to be one of ${Object.keys(this._enumValues).map(M=>JSON.stringify(M)).join(", ")}, but found ${JSON.stringify(R)} instead.`);return R}catch(R){const M=R;return this._warningHistory[M.message]||(this._warningHistory[M.message]=!0,typeof console<"u"&&console.warn(`Failed to evaluate expression "${JSON.stringify(this.expression.serialize())}". ${M.message}`)),this._defaultValue}}}function Ag(l){return Array.isArray(l)&&l.length>0&&typeof l[0]=="string"&&l[0]in Zh}function Tu(l,r,s,u,f){const g=new ta(Zh,[],r?(function(x){const w={color:Es,string:Rr,number:un,enum:Rr,boolean:ur,formatted:Dh,resolvedImage:mp};return x.type==="array"?os(w[x.value]||Mr,x.length):w[x.type]})(r):void 0,void 0,void 0,s,u,f),v=g.parse(l,void 0,void 0,void 0,r&&r.type==="string"?{typeAnnotation:"coerce"}:void 0);return v?$1(new y0(v,r,s,u,f)):Su(g.errors)}class Dp{constructor(r,s,u,f){this.kind=r,this._styleExpression=s,this.isLightConstant=u,this.isLineProgressConstant=f,this.isStateDependent=r!=="constant"&&!Ga(s.expression),this.configDependencies=Sg(s.expression),this.isIndo
vendor: 8,624 bytes, line 18
18orDependent=Tg(s.expression)}evaluateWithoutErrorHandling(r,s,u,f,g,v){return this._styleExpression.evaluateWithoutErrorHandling(r,s,u,f,g,v)}evaluate(r,s,u,f,g,v,x){return this._styleExpression.evaluate(r,s,u,f,g,v,void 0,void 0,x)}}class Zl{constructor(r,s,u,f,g,v){this.kind=r,this.zoomStops=u,this._styleExpression=s,this.isStateDependent=r!=="camera"&&!Ga(s.expression),this.isIndoorDependent=Tg(s.expression),this.isLightConstant=g,this.isLineProgressConstant=v,this.configDependencies=Sg(s.expression),this.interpolationType=f}evaluateWithoutErrorHandling(r,s,u,f,g,v){return this._styleExpression.evaluateWithoutErrorHandling(r,s,u,f,g,v)}evaluate(r,s,u,f,g,v){return this._styleExpression.evaluate(r,s,u,f,g,v)}interpolationFactor(r,s,u){return this.interpolationType?na.interpolationFactor(this.interpolationType,r,s,u):0}}function v0(l,r,s,u,f){if((l=Tu(l,r,s,u,f)).result==="error")return l;const g=l.value.expression,v=Sd(g);if(!v&&!Eg(r))return Su([new pl("","data expressions not supported")]);const x=Xl(g,["zoom","pitch","distance-from-center"]);if(!x&&!G1(r))return Su([new pl("","zoom expressions not supported")]);const w=Xl(g,["measure-light"]);if(!w&&!j1(r))return Su([new pl("","measure-light expression not supported")]);const A=Xl(g,["line-progress"]);if(!A&&!(function(O){return f0(O.expression,"line-progress")})(r))return Su([new pl("","line-progress expression not supported")]);const R=r.expression&&r.expression.relaxZoomRestriction,M=Yh(g);return M||x||R?M instanceof pl?Su([M]):M instanceof na&&!p0(r)?Su([new pl("",'"interpolate" expressions cannot be used with this property')]):$1(M?new Zl(v&&A?"camera":"composite",l.value,M.labels,M instanceof na?M.interpolation:void 0,w,A):new Dp(v&&A?"constant":"source",l.value,w,A)):Su([new pl("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression, or in the properties of atmosphere.')])}class Ig{constructor(r,s){this._parameters=r,this._specification=s,Object.assign(this,H1(this._parameters,this._specification))}static deserialize(r){return new Ig(r._parameters,r._specification)}static serialize(r){return{_parameters:r._parameters,_specification:r._specification}}}function Yh(l){let r=null;if(l instanceof Pc)r=Yh(l.result);else if(l instanceof yg){for(const s of l.args)if(r=Yh(s),r)break}else(l instanceof Gh||l instanceof na)&&l.input instanceof Cs&&l.input.name==="zoom"&&(r=l);return r instanceof pl||l.eachChild(s=>{const u=Yh(s);u instanceof pl?r=u:r&&u&&r!==u&&(r=new pl("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),r}class Cd{constructor(r,s,u){if(this.boxSeen=new Uint32Array(0),this.circleSeen=new Uint32Array(0),this.generation=0,r instanceof ArrayBuffer){const f=new Int32Array(r);this.width=f[0],this.height=f[1],this.xCellCount=f[2],this.yCellCount=f[3],this.boxUid=f[4],this.circleUid=f[5];const g=this.xCellCount*this.yCellCount,v=[];for(let R=0;R<g;R++){const M=f[6+R],O=f[6+R+1];v.push(M===O?null:f.subarray(M,O))}const x=f[6+g],w=[];for(let R=0;R<g;R++){const M=f[x+R],O=f[x+R+1];w.push(M===O?null:f.subarray(M,O))}let A=f[x+g];this.boxCells=v,this.circleCells=w,this.boxKeys=f.subarray(A,A+this.boxUid),A+=this.boxUid,this.circleKeys=f.subarray(A,A+this.circleUid),A+=this.circleUid,this.bboxes=f.subarray(A,A+4*this.boxUid),A+=4*this.boxUid,this.circles=f.subarray(A,A+3*this.circleUid)}else{this.width=r,this.height=s,this.xCellCount=Math.ceil(r/u),this.yCellCount=Math.ceil(s/u);const f=this.xCellCount*this.yCellCount,g=[],v=[];for(let x=0;x<f;x++)g.push([]),v.push([]);this.boxCells=g,this.circleCells=v,this.boxKeys=[],this.circleKeys=[],this.bboxes=[],this.circles=[],this.boxUid=0,this.circleUid=0}this.xScale=this.xCellCount/this.width,this.yScale=this.yCellCount/this.height}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(r,s,u,f,g){const v=this.boxUid++,x=this._xCell(s),w=this._yCell(u),A=this._xCell(f),R=this._yCell(g);for(let M=x;M<=A;M++)for(let O=w;O<=R;O++)this.boxCells[this.xCellCount*O+M].push(v);this.boxKeys.push(r),this.bboxes.push(s,u,f,g)}insertCircle(r,s,u,f){const g=this.circleUid++,v=this._xCell(s-f),x=this._yCell(u-f),w=this._xCell(s+f),A=this._yCell(u+f);for(let R=v;R<=w;R++)for(let M=x;M<=A;M++)this.circleCells[this.xCellCount*M+R].push(g);this.circleKeys.push(r),this.circles.push(s,u,f)}query(r,s,u,f,g){const v=[];if(u<0||r>this.width||f<0||s>this.height)return v;const x=this._nextGen(),{boxCells:w,circleCells:A,boxKeys:R,circleKeys:M,bboxes:O,circles:B,boxSeen:N,circleSeen:G,xCellCount:H}=this,J=this._xCell(r),re=this._yCell(s),Q=this._xCell(u),le=this._yCell(f);for(let ue=J;ue<=Q;ue++)for(let he=re;he<=le;he++){const Te=H*he+ue,me=w[Te];if(me)for(let _e=0;_e<me.length;_e++){const we=me[_e];if(N[we]===x)continue;N[we]=x;const je=4*we,He=O[je],Qe=O[je+1],it=O[je+2],nt=O[je+3];r<=it&&s<=nt&&u>=He&&f>=Qe&&(!g||g(R[we]))&&v.push({key:R[we],x1:He,y1:Qe,x2:it,y2:nt})}const xe=A[Te];if(xe)for(let _e=0;_e<xe.length;_e++){const we=xe[_e];if(G[we]===x)continue;G[we]=x;const je=3*we,He=B[je],Qe=B[je+1],it=B[je+2];!this._circleAndRectCollide(He,Qe,it,r,s,u,f)||g&&!g(M[we])||v.push({key:M[we],x1:He-it,y1:Qe-it,x2:He+it,y2:Qe+it})}}return v}queryKeys(r,s,u,f,g){const v=[];if(u<0||r>this.width||f<0||s>this.height)return v;const x=this._nextGen(),{boxCells:w,boxKeys:A,bboxes:R,boxSeen:M,xCellCount:O,xScale:B,yScale:N}=this,G=this._xCell(r),H=this._yCell(s),J=this._xCell(u),re=this._yCell(f);for(let Q=G;Q<=J;Q++)for(let le=H;le<=re;le++){if(g&&!g(Q/B,le/N,(Q+1)/B,(le+1)/N))continue;const ue=w[O*le+Q];if(ue)for(let he=0;he<ue.length;he++){const Te=ue[he];if(M[Te]===x)continue;M[Te]=x;const me=4*Te,xe=R[me],_e=R[me+1],we=R[me+2],je=R[me+3];(g?g(xe,_e,we,je):r<=we&&s<=je&&u>=xe&&f>=_e)&&v.push(A[Te])}}return v}hitTest(r,s,u,f,g){if(u<0||r>this.width||f<0||s>this.height)return!1;const v=this._nextGen(),{boxCells:x,circleCells:w,boxKeys:A,circleKeys:R,bboxes:M,circles:O,boxSeen:B,circleSeen:N,xCellCount:G}=this,H=this._xCell(r),J=this._yCell(s),re=this._xCell(u),Q=this._yCell(f);for(let le=H;le<=re;le++)for(let ue=J;ue<=Q;ue++){const he=G*ue+le,Te=x[he];if(Te)for(let xe=0;xe<Te.length;xe++){const _e=Te[xe];if(B[_e]===v)continue;B[_e]=v;const we=4*_e;if(r<=M[we+2]&&s<=M[we+3]&&u>=M[we]&&f>=M[we+1]&&(!g||g(A[_e])))return!0}const me=w[he];if(me)for(let xe=0;xe<me.length;xe++){const _e=me[xe];if(N[_e]===v)continue;N[_e]=v;const we=3*_e;if(this._circleAndRectCollide(O[we],O[we+1],O[we+2],r,s,u,f)&&(!g||g(R[_e])))return!0}}return!1}hitTestCircle(r,s,u,f){const g=r-u,v=s-u,x=r+u,w=s+u;if(x<0||g>this.width||w<0||v>this.height)return!1;const A=this._nextGen(),{boxCells:R,circleCells:M,boxKeys:O,circleKeys:B,bboxes:N,circles:G,boxSeen:H,circleSeen:J,xCellCount:re}=this,Q=this._xCell(g),le=this._yCell(v),ue=this._xCell(x),he=this._yCell(w);for(let Te=Q;Te<=ue;Te++)for(let me=le;me<=he;me++){const xe=re*me+Te,_e=R[xe];if(_e)for(let je=0;je<_e.length;je++){const He=_e[je];if(H[He]===A)continue;H[He]=A;const Qe=4*He;if(this._circleAndRectCollide(r,s,u,N[Qe],N[Qe+1],N[Qe+2],N[Qe+3])&&(!f||f(O[He])))return!0}const we=M[xe];if(we)for(let je=0;je<we.length;je++){const He=we[je];if(J[He]===A)continue;J[He]=A;const Qe=3*He;if(this._circlesCollide(G[Qe],G[Qe+1],G[Qe+2],r,s,u)&&(!f||f(B[He])))return!0}}return!1}static serialize(r,s){const u=r.toArrayBuffer();return s&&s.add(u),{buffer:u}}static deserialize(r){return new Cd(r.buffer)}toArrayBuffer(){const r=this.xCellCount*this.yCellCount;let s=0,u=0;for(let x=0;x<r;x++)s+=this.boxCells[x].length,u+=this.circleCells[x].length;const f=new Int32Array(6+(r+1)+s+(r+1)+u+this.boxUid+this.circleUid+4*this.boxUid+3*this.circleUid);f[0]=this.width,f[1]=this.height,f[2]=this.xCellCount,f[3]=this.yCellCount,f[4]=this.boxUid,f[5]=this.circleUid;let g=6+(r+1);for(let x=0;x<r;x++){f[6+x]=g;const w=this.boxCells[x];f.set(w,g),g+=w.length}f[6+r]=g;const v=g;g+=r+1;for(let x=0;x<r;x++){f[v+x]=g;const w=this.circleCells[x];f.set(w,g),g+=w.length}return f[v+r]=g,f.set(this.boxKeys,g),g+=this.boxUid,f.set(this.circleKeys,g),g+=this.circleUid,f.set(this.bboxes,g),g+=4*this.boxUid,f.set(this.circles,g),f.buffer}_xCell(r){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(r*this.xScale)))}_yCell(r){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(r*this.yScale)))}_nextGen(){return this.boxSeen.length<this.boxUid&&(this.boxSeen=new Uint32Array(this.boxUid)),this.circleSeen.length<this.circleUid&&(this.circleSeen=new Uint32Array(this.circleUid)),this.generation=this.generation+1>>>0,this.generation===0&&(this.boxSeen.fill(0),this.circleSeen.fill(0),this.generation=1),this.generation}
18_circlesCollide(r,s,u,f,g,v){const x=f-r,w=g-s,A=u+v;return A*A>x*x+w*w}_circleAndRectCollide(r,s,u,f,g,v,x){const w=(v-f)/2,A=Math.abs(r-(f+w));if(A>w+u)return!1;const R=(x-g)/2,M=Math.abs(s-(g+R));if(M>R+u)return!1;if(A<=w||M<=R)return!0;const O=A-w,B=M-R;return O*O+B*B<=u*u}}const Kh={};function Kt(l,r,s={}){Object.defineProperty(l,"_classRegistryKey",{value:r,writable:!1}),Kh[r]={klass:l,omit:s.omit||[]}}Kt(Object,"Object"),Kt(Cd,"Grid"),delete St.prototype.constructor,Kt(xr,"Color"),Kt(Error,"Error"),Kt(ss,"Formatted"),Kt(gd,"FormattedSection"),Kt(Cc,"AJAXError"),Kt(_s,"ResolvedImage"),Kt(Ig,"StylePropertyFunction"),Kt(y0,"StyleExpression",{omit:["_evaluator"]}),Kt(is,"ImageId"),Kt($a,"ImageVariant"),Kt(Zl,"ZoomDependentExpression"),Kt(Dp,"ZoomConstantExpression"),Kt(Cs,"CompoundExpression",{omit:["_evaluate"]});for(const l in Zh)Kh[Zh[l]._classRegistryKey]||Kt(Zh[l],`Expression${l}`);function W1(l){return l&&(l instanceof ArrayBuffer||l.constructor&&l.constructor.name==="ArrayBuffer")}function Rc(l,r){if(l===null)return null;const s=typeof l;if(s!=="object")return s==="bigint"?{$name:"BigInt",value:l.toString()}:l;if(Array.isArray(l)){const v=l.length,x=[];x.length=v;for(let w=0;w<v;w++)x[w]=Rc(l[w],r);return x}if(ArrayBuffer.isView(l))return r&&r.add(l.buffer),l;if(W1(l)||l instanceof ImageBitmap)return r&&r.add(l),l;if(l instanceof ImageData)return r&&r.add(l.data.buffer),l;if(l instanceof Map){const v={$name:"Map",entries:[]};for(const[x,w]of l.entries())v.entries.push(Rc(x),Rc(w,r));return v}if(l instanceof Set){const v={$name:"Set"};let x=0;for(const w of l.values())v[++x]=Rc(w);return v}if(l instanceof Date||l instanceof RegExp||l instanceof Boolean||l instanceof Number||l instanceof String)return l;const u=l.constructor,f=u._classRegistryKey;if(!f)throw new Error(`Can't serialize object of unregistered class "${u.name}".`);const g=u.serialize?u.serialize(l,r):{};if(!u.serialize){const v=Kh[f].omit,x=l;for(const w in x)Object.hasOwn(x,w)&&(v.includes(w)||(g[w]=Rc(x[w],r)));l instanceof Error&&(g.message=l.message)}if(g.$name)throw new Error("$name property is reserved for worker serialization logic.");return f!=="Object"&&(g.$name=f),g}function kc(l){if(l===null||typeof l!="object")return l;if(Array.isArray(l)){for(let f=0;f<l.length;f++)l[f]=kc(l[f]);return l}if(ArrayBuffer.isView(l)||W1(l)||l instanceof ImageBitmap||l instanceof ImageData||l instanceof Date||l instanceof RegExp||l instanceof Boolean||l instanceof Number||l instanceof String)return l;const r=l.$name||"Object";if(r==="Map"){const f=l.entries||[],g=new Map;for(let v=0;v<f.length;v+=2)g.set(kc(f[v]),kc(f[v+1]));return g}if(r==="Set"){const f=new Set;for(const g in l)g!=="$name"&&f.add(kc(l[g]));return f}if(r==="BigInt")return BigInt(l.value);const{klass:s}=Kh[r];if(!s)throw new Error(`Can't deserialize unregistered class "${r}".`);if(s.deserialize)return s.deserialize(l);const u=Object.create(s.prototype);for(const f in l)f!=="$name"&&(u[f]=kc(l[f]));return u}const q1=l=>l>=1536&&l<=1791,X1=l=>l>=1872&&l<=1919,Z1=l=>l>=2208&&l<=2303,b0=l=>l>=11904&&l<=12031,x0=l=>l>=12032&&l<=12255,Fp=l=>l>=12272&&l<=12287,Pg=l=>l>=12288&&l<=12351,Rg=l=>l>=12352&&l<=12447,kg=l=>l>=12448&&l<=12543,Y1=l=>l>=12544&&l<=12591,w0=l=>l>=12704&&l<=12735,S0=l=>l>=12736&&l<=12783,K1=l=>l>=12784&&l<=12799,J1=l=>l>=12800&&l<=13055,Q1=l=>l>=13056&&l<=13311,T0=l=>l>=13312&&l<=19903,Jh=l=>l>=19968&&l<=40959,ew=l=>l>=40960&&l<=42127,tw=l=>l>=42128&&l<=42191,nw=l=>l>=44032&&l<=55215,Mg=l=>l>=63744&&l<=64255,E0=l=>l>=64336&&l<=65023,rw=l=>l>=65040&&l<=65055,Lg=l=>l>=65072&&l<=65103,C0=l=>l>=65104&&l<=65135,A0=l=>l>=65136&&l<=65279,Og=l=>l>=65280&&l<=65519;function I0(l){for(const r of l)if(Dg(r.charCodeAt(0)))return!0;return!1}function iw(l){for(const r of l)if(!ow(r.charCodeAt(0)))return!1;return!0}function ow(l){return!(q1(l)||X1(l)||Z1(l)||E0(l)||A0(l))}function sw(l){return!(l<11904||!(w0(l)||Y1(l)||Lg(l)||Mg(l)||Q1(l)||b0(l)||S0(l)||Pg(l)||T0(l)||Jh(l)||J1(l)||Og(l)||Rg(l)||Fp(l)||x0(l)||K1(l)||kg(l)||rw(l)||tw(l)||ew(l)))}function Dg(l){return!(l!==746&&l!==747&&(l<4352||!(w0(l)||Y1(l)||Lg(l)&&!(l>=65097&&l<=65103)||Mg(l)||Q1(l)||b0(l)||S0(l)||!(!Pg(l)||l>=12296&&l<=12305||l>=12308&&l<=12319||l===12336)||T0(l)||Jh(l)||J1(l)||(r=>r>=12592&&r<=12687)(l)||(r=>r>=43360&&r<=43391)(l)||(r=>r>=55216&&r<=55295)(l)||(r=>r>=4352&&r<=4607)(l)||nw(l)||Rg(l)||Fp(l)||(r=>r>=12688&&r<=12703)(l)||x0(l)||K1(l)||kg(l)&&l!==12540||!(!Og(l)||l===65288||l===65289||l===65293||l>=65306&&l<=65310||l===65339||l===65341||l===65343||l>=65371&&l<=65503||l===65507||l>=65512&&l<=65519)||!(!C0(l)||l>=65112&&l<=65118||l>=65123&&l<=65126)||(r=>r>=5120&&r<=5759)(l)||(r=>r>=6320&&r<=6399)(l)||rw(l)||(r=>r>=19904&&r<=19967)(l)||ew(l)||tw(l))))}function P0(l){return l===12312||l===12313||l===12316||l===12540||l===12448}function Fg(l){return!(Dg(l)||(function(r){return!!((s=>s>=128&&s<=255)(r)&&(r===167||r===169||r===174||r===177||r===188||r===189||r===190||r===215||r===247)||(s=>s>=8192&&s<=8303)(r)&&(r===8214||r===8224||r===8225||r===8240||r===8241||r===8251||r===8252||r===8258||r===8263||r===8264||r===8265||r===8273)||(s=>s>=8448&&s<=8527)(r)||(s=>s>=8528&&s<=8591)(r)||(s=>s>=8960&&s<=9215)(r)&&(r>=8960&&r<=8967||r>=8972&&r<=8991||r>=8996&&r<=9e3||r===9003||r>=9085&&r<=9114||r>=9150&&r<=9165||r===9167||r>=9169&&r<=9179||r>=9186&&r<=9215)||(s=>s>=9216&&s<=9279)(r)&&r!==9251||(s=>s>=9280&&s<=9311)(r)||(s=>s>=9312&&s<=9471)(r)||(s=>s>=9632&&s<=9727)(r)||(s=>s>=9728&&s<=9983)(r)&&!(r>=9754&&r<=9759)||(s=>s>=11008&&s<=11263)(r)&&(r>=11026&&r<=11055||r>=11088&&r<=11097||r>=11192&&r<=11243)||Pg(r)||kg(r)||(s=>s>=57344&&s<=63743)(r)||Lg(r)||C0(r)||Og(r)||r===8734||r===8756||r===8757||r>=9984&&r<=10087||r>=10102&&r<=10131||r===65532||r===65533)})(l))}function aw(l){return q1(l)||X1(l)||Z1(l)||E0(l)||A0(l)}function lw(l){return l>=1424&&l<=2303||E0(l)||A0(l)}function Eu(l,r){return!(!r&&lw(l)||l>=2304&&l<=3583||l>=3840&&l<=4255||(s=>s>=6016&&s<=6143)(l))}function A2(l){for(const r of l)if(lw(r.charCodeAt(0)))return!0;return!1}const ra={unavailable:"unavailable",deferred:"deferred",loading:"loading",parsing:"parsing",parsed:"parsed",loaded:"loaded",error:"error"};let Cu=null,As=ra.unavailable,_l=null;const R0=function(l){l&&(As=ra.error),Cu&&Cu(l)};function Qh(){Bg.fire(new fl("pluginStateChange",{pluginStatus:As,pluginURL:_l}))}const Bg=new Lh,k0=function(){return As},cw=function(){if(As!==ra.deferred||!_l)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");As=ra.loading,Qh(),_l&&Ph({url:_l},l=>{l?R0(l):(As=ra.loaded,Qh())})},yl={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>As===ra.loaded||yl.applyArabicShaping!=null,isLoading:()=>As===ra.loading,setState(l){As=l.pluginStatus,_l=l.pluginURL},isParsing:()=>As===ra.parsing,isParsed:()=>As===ra.parsed,getPluginURL:()=>_l},M0=function(){yl.isLoading()||yl.isLoaded()||k0()!=="deferred"||cw()};class Tr{constructor(r,s){this.zoom=r,s?(this.now=s.now,this.fadeDuration=s.fadeDuration,this.transition=s.transition,this.pitch=s.pitch,this.brightness=s.brightness,this.worldview=s.worldview,this.activeFloors=s.activeFloors):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0,this.brightness=0)}isSupportedScript(r){return(function(s,u){for(const f of s)if(!Eu(f.charCodeAt(0),u))return!1;return!0})(r,yl.isLoaded())}}class Bp{constructor(r,s,u,f,g){this.property=r,this.value=s,this.expression=(function(v,x,w,A,R){if(m0(v))return new Ig(v,x);if(Ag(v)||Array.isArray(v)&&v.length>0){const M=v0(v,x,w,A,R);if(M.result==="error")throw new Error(M.value.map(O=>
18`${O.key}: ${O.message}`).join(", "));return M.value}{let M=v;return typeof v=="string"&&x.type==="color"&&(M=xr.parse(v)),{kind:"constant",configDependencies:new Set,isIndoorDependent:!1,evaluate:()=>M}}})(s===void 0?r.specification.default:s,r.specification,u,f,g)}isIndoorDependent(){return this.expression.isIndoorDependent}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(r,s,u,f){return this.property.possiblyEvaluate(this,r,s,u,f)}}class L0{constructor(r,s,u,f){this.property=r,this.value=new Bp(r,void 0,s,u,f)}transitioned(r,s){return new Np(this.property,this.value,s,Object.assign({},r.transition,this.transition),r.now)}untransitioned(){return new Np(this.property,this.value,null,{},0)}}class zp{constructor(r,s,u,f){this._properties=r,this._values=Object.create(r.defaultTransitionablePropertyValues),this._scope=s,this._options=u,this._iconImageUseTheme=f,this._isIndoorDependent=!1,this.configDependencies=new Set}getValue(r){return Kn(this._values[r].value.value)}setValue(r,s){Object.hasOwn(this._values,r)||(this._values[r]=new L0(this._values[r].property,this._scope,this._options,this._iconImageUseTheme)),this._values[r].value=new Bp(this._values[r].property,s===null?void 0:Kn(s),this._scope,this._options,this._iconImageUseTheme),this._values[r].value.expression.configDependencies&&(this.configDependencies=new Set([...this.configDependencies,...this._values[r].value.expression.configDependencies]),this._isIndoorDependent=this._isIndoorDependent||this._values[r].value.isIndoorDependent())}setTransitionOrValue(r,s){s&&(this._options=s);const u=this._properties.properties;if(r)for(const f in r){const g=r[f];if(f.endsWith("-transition")){const v=f.slice(0,-11);u[v]&&this.setTransition(v,g)}else Object.hasOwn(u,f)&&this.setValue(f,g)}}getTransition(r){return Kn(this._values[r].transition)}setTransition(r,s){Object.hasOwn(this._values,r)||(this._values[r]=new L0(this._values[r].property)),this._values[r].transition=Kn(s)||void 0}serialize(){const r={};for(const s of Object.keys(this._values)){const u=this.getValue(s);u!==void 0&&(r[s]=u);const f=this.getTransition(s);f!==void 0&&(r[`${s}-transition`]=f)}return r}transitioned(r,s){const u=new zg(this._properties);for(const f of Object.keys(this._values))u._values[f]=this._values[f].transitioned(r,s._values[f]);return u}untransitioned(){const r=new zg(this._properties);for(const s of Object.keys(this._values))r._values[s]=this._values[s].untransitioned();return r}isIndoorDependent(){return this._isIndoorDependent}}class Np{constructor(r,s,u,f,g){const v=f.delay||0,x=f.duration||0;g=g||0,this.property=r,this.value=s,this.begin=g+v,this.end=this.begin+x,r.specification.transition&&(f.delay||f.duration)&&(this.prior=u)}possiblyEvaluate(r,s,u){const f=r.now||0,g=this.value.possiblyEvaluate(r,s,u),v=this.prior;if(v){if(f>this.end)return this.prior=null,g;if(this.value.isDataDriven())return this.prior=null,g;if(f<this.begin)return v.possiblyEvaluate(r,s,u);{const x=(f-this.begin)/(this.end-this.begin);return this.property.interpolate(v.possiblyEvaluate(r,s,u),g,Me(x))}}return g}}class zg{constructor(r){this._properties=r,this._values=Object.create(r.defaultTransitioningPropertyValues)}possiblyEvaluate(r,s,u){const f=new Mc(this._properties);for(const g of Object.keys(this._values))f._values[g]=this._values[g].possiblyEvaluate(r,s,u);return f}hasTransition(){for(const r of Object.keys(this._values))if(this._values[r].prior)return!0;return!1}}class Ng{constructor(r,s,u,f){this._properties=r,this._values=Object.create(r.defaultPropertyValues),this._scope=s,this._options=u,this._iconImageUseTheme=f,this._isIndoorDependent=!1,this.configDependencies=new Set}getValue(r){return Kn(this._values[r].value)}setValue(r,s){this._values[r]=new Bp(this._values[r].property,s===null?void 0:Kn(s),this._scope,this._options,this._iconImageUseTheme),this._values[r].expression.configDependencies&&(this.configDependencies=new Set([...this.configDependencies,...this._values[r].expression.configDependencies]),this._isIndoorDependent=this._isIndoorDependent||this._values[r].isIndo
18orDependent())}serialize(){const r={};for(const s of Object.keys(this._values)){const u=this.getValue(s);u!==void 0&&(r[s]=u)}return r}possiblyEvaluate(r,s,u,f){const g=new Mc(this._properties);for(const v of Object.keys(this._values))g._values[v]=this._values[v].possiblyEvaluate(r,s,u,f);return g}isIndoorDependent(){return this._isIndoorDependent}}class Au{constructor(r,s,u,f){this.property=r,this.value=s,this.parameters=u,this.iconImageUseTheme=f}isConstant(){return this.value.kind==="constant"}constantOr(r){return this.value.kind==="constant"?this.value.value:r}evaluate(r,s,u,f,g){return this.property.evaluate(this.value,this.parameters,r,s,u,f,this.iconImageUseTheme,g)}}class Mc{constructor(r){this._properties=r,this._values=Object.create(r.defaultPossiblyEvaluatedValues)}get(r){return this._values[r]}}class Pt{constructor(r){this.specification=r}possiblyEvaluate(r,s){return r.expression.evaluate(s)}interpolate(r,s,u){const f=ig[this.specification.type];return f?f(r,s,u):r}}class Dt{constructor(r,s){this.specification=r,this.overrides=s}possiblyEvaluate(r,s,u,f,g){return r.expression.kind==="constant"||r.expression.kind==="camera"?new Au(this,{kind:"constant",value:r.expression.evaluate(s,null,{},u,f,void 0,g)},s):new Au(this,r.expression,s,g)}interpolate(r,s,u){if(r.value.kind!=="constant"||s.value.kind!=="constant")return r;if(r.value.value===void 0||s.value.value===void 0)return new Au(this,{kind:"constant",value:void 0},r.parameters);const f=ig[this.specification.type];return f?new Au(this,{kind:"constant",value:f(r.value.value,s.value.value,u)},r.parameters):r}evaluate(r,s,u,f,g,v,x,w){return r.kind==="constant"?r.value:r.evaluate(s,u,f,g,v,w,x)}}class Iu{constructor(r){this.specification=r}possiblyEvaluate(r,s,u,f){return!!r.expression.evaluate(s,null,{},u,f)}interpolate(){return!1}}class fi{constructor(r){this.properties=r,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];const s=new Tr(0,{});for(const u in r){const f=r[u],g=f.specification;g&&g.overridable&&this.overridableProperties.push(u);const v=this.defaultPropertyValues[u]=new Bp(f,void 0),x=this.defaultTransitionablePropertyValues[u]=new L0(f);this.defaultTransitioningPropertyValues[u]=x.untransitioned(),this.defaultPossiblyEvaluatedValues[u]=v.possiblyEvaluate(s)}}}Kt(Dt,"DataDrivenProperty"),Kt(Pt,"DataConstantProperty"),Kt(Iu,"ColorRampProperty");var ze=JSON.parse('{"$version":8,"$root":{"version":{"type":"enum","values":[8]},"fragment":{"type":"boolean"},"name":{"type":"string"},"metadata":{"type":"*"},"center":{"type":"array","value":"number"},"zoom":{"type":"number"},"bearing":{"type":"number","default":0,"period":360},"pitch":{"type":"number","default":0},"light":{"type":"light"},"lights":{"type":"array","value":"light-3d"},"terrain":{"type":"terrain","optional":true},"fog":{"type":"fog"},"snow":{"type":"snow"},"rain":{"type":"rain"},"camera":{"type":"camera"},"color-theme":{"type":"colorTheme"},"indoor":{"type":"indoor"},"imports":{"type":"array","value":"import"},"iconsets":{"type":"iconsets"},"schema":{"type":"schema"},"sources":{"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string","default":"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"type":"array","value":"layer"},"models":{"type":"models"},"featuresets":{"type":"featuresets"}},"featuresets":{"*":{"type":"featureset"}},"featureset":{"metadata":{"type":"*"},"selectors":{"type":"array","value":"selector"}},"selector":{"layer":{"type":"string"},"properties":{"type":"selectorProperty"},"featureNamespace":{"type":"string"},"_uniqueFeatureID":{"type":"boolean"}},"selectorProperty":{"*":{"type":"*"}},"model":{"type":"string"},"import":{"id":{"type":"string"},"url":{"type":"string"},"config":{"type":"config"},"data":{"type":"$root"},"color-theme":{"type":"colorTheme","optional":true}},"config":{"*":{"type":"*"}},"schema":{"*":{"type":"option"}},"option":{"default":{"type":"*","expression":{}},"type":{"type":"enum","values":{"string":1,"number":1,"boolean":1,"color":1}},"array":{"type":"boolean"},"minValue":{"type":"number"},"maxValue":{"type":"number"},"stepValue":{"type":"number"},"values":{"type":"array","value":"*"},"metadata":{"type":"*"}},"models":{"*":{"type":"model"}}
18,"light-3d":{"id":{"type":"string"},"properties":{"type":"properties"},"type":{"type":"enum","values":{"ambient":{},"directional":{},"flat":{}}}},"properties":["properties_light_directional","properties_light_ambient","properties_light_flat"],"properties_light_directional":{"direction":{"type":"array","default":[210,30],"minimum":[0,0],"maximum":[360,90],"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"use-theme":true,"transition":true},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"cast-shadows":{"type":"boolean","default":false},"shadow-quality":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"parameters":["zoom"]}},"shadow-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"shadow-draw-before-layer":{"type":"string"}},"properties_light_ambient":{"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"use-theme":true,"transition":true},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"properties_light_flat":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"use-theme":true,"transition":true},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"iconsets":{"*":{"type":"iconset"}},"iconset":["iconset_sprite","iconset_source"],"iconset_sprite":{"type":{"type":"enum","values":{"sprite":1}},"url":{"type":"string"}},"iconset_source":{"type":{"type":"enum","values":{"source":1}},"source":{"type":"string"}},"sources":{"*":{"type":"source"}},"source":["source_vector","source_raster","source_raster_dem","source_raster_array","source_geojson","source_video","source_image","source_model"],"source_vector":{"type":{"type":"enum","values":{"vector":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"extra_bounds":{"type":"array","value":{"type":"array","value":"number","length":4}},"scheme":{"type":"enum","values":{"xyz":1,"tms":1},"default":"xyz"},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"attribution":{"type":"string"},"promoteId":{"type":"promoteId"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster":{"type":{"type":"enum","values":{"raster":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"extra_bounds":{"type":"array","value":{"type":"array","value":"number","length":4}},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"scheme":{"type":"enum","values":{"xyz":1,"tms":1},"default":"xyz"},"attribution":{"type":"string"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"type":"enum","values":{"raster-dem":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"extra_bounds":{"type":"array","value":{"type":"array","value":"number","length":4}},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"attribution":{"type":"string"},"encoding":{"type":"enum","values":{"terrarium":1,"mapbox":1},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_array":{"type":{"type":"enum","values":{"raster-array":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"extra_bounds":{"type":"array","value":{"type":"array","value":"number","length":4}},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"attribution":{"type":"string"},"rasterLayers":{"type":"*"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"type":"enum","values":{"geojson":1}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"minzoom":{"type":"number","default":0},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0}
18,"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"},"dynamic":{"type":"boolean","default":false}},"source_video":{"type":{"type":"enum","values":{"video":1}},"urls":{"type":"array","value":"string"},"coordinates":{"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"type":"enum","values":{"image":1}},"url":{"type":"string"},"coordinates":{"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"modelNodeOverride":{"orientation":{"type":"array","value":"number","length":3,"default":[0,0,0],"period":360}},"modelNodeOverrides":{"*":{"type":"modelNodeOverride"}},"modelMaterialOverride":{"model-color":{"type":"color"},"model-color-mix-intensity":{"type":"number"},"model-opacity":{"type":"number"},"model-emissive-strength":{"type":"number"}},"modelMaterialOverrides":{"*":{"type":"modelMaterialOverride"}},"modelSourceModel":{"uri":{"type":"string"},"position":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[-180,-90],"maximum":[180,90]},"orientation":{"type":"array","value":"number","length":3,"default":[0,0,0],"period":360},"nodeOverrides":{"type":"modelNodeOverrides"},"materialOverrides":{"type":"modelMaterialOverrides"},"nodeOverrideNames":{"type":"array","value":"string"},"materialOverrideNames":{"type":"array","value":"string"},"featureProperties":{"type":"*"}},"modelSourceModels":{"*":{"type":"modelSourceModel"}},"source_model":{"type":{"type":"enum","values":{"model":1,"batched-model":1}},"url":{"type":"string"},"maxzoom":{"type":"number","default":18},"minzoom":{"type":"number","default":0},"tiles":{"type":"array","value":"string"},"models":{"type":"modelSourceModels"}},"layer":{"id":{"type":"string"},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"building":{},"raster":{},"raster-particle":{},"hillshade":{},"model":{},"background":{},"sky":{},"slot":{},"clip":{}}},"metadata":{"type":"*"},"source":{"type":"string"},"source-layer":{"type":"string"},"slot":{"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"},"appearances":{"type":"array","value":"appearance","supported-layer-types":["symbol"]}},"appearance":{"condition":{"type":"boolean","expression":{"interpolated":true,"parameters":["zoom","pitch","feature","feature-state","measure-light","distance-from-center"]},"property-type":"data-driven"},"name":{"type":"string"},"properties":{"type":"*"}},"layout":["layout_clip","layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_building","layout_symbol","layout_raster","layout_raster-particle","layout_hillshade","layout_background","layout_sky","layout_model"],"layout_background":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_model":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}},"model-id":{"type":"string","default":"","property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"model-allow-density-reduction":{"type":"boolean","default":true}},"layout_clip":{"clip-layer-types":{"type":"array","value":"enum","values":{"model":1,"symbol":1},"default":[],"expression":{}},"clip-layer-scope":{"type":"array","value":"string","default":[],"expression":{}},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}},"fill-elevation-reference":{"type":"enum","values":{"none":1,"hd-road-base":1,"hd-road-markup":1},"default":"none","expression":{}},"fill-construct-bridge-guard-rail":{"type":"boolean","default":"true","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"}},"layout_circle":{"circle-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"circle-elevation-reference":{"type":"enum","values":{"none":1,"hd-road-markup":1},"default":"none","expression":{}},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_heatmap":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_fill-extrusion":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}},"fill-extrusion-edge-radius":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{}},"source-max-zoom":{"type":"number","minimum":0,"maximum":24}},"layout_building":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}},"building-facade":{"type":"boolean","default":false,"expression":{"parameters":["feature"]},"property-type":"data-driven"},"building-facade-floors":{"type":"number","minimum":1,"maximum":200,"default":3,"property-type":"data-driven","expression":{"parameters":["feature"]}},"building-facade-unit-width":{"type":"number","minimum":1,"maximum":20,"default":3.1,"property-type":"data-driven","expression":{"parameters":["feature"]}},"building-facade-window":{"type":"array","length":2,"value":"number","minimum":0.1,"maximum":1,"default":[0.9,0.9],"property-type":"data-driven","expression":{"parameters":["feature"]}},"building-roof-shape":{"type":"enum","values":{"flat":1,"hipped":1,"gabled":1,"parapet":1,"mansard":1,"skillion":1,"pyramidal":1},"default":"flat","expression":{"parameters":["feature"]},"property-type":"data-driven"},"building-height":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{},"property-type":"data-driven"},"building-base":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{},"property-type":"data-driven"},"building-flood-light-wall-radius":{"property-type":"data-driven","type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"building-flood-light-ground-radius":{"property-type":"data-driven","type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"building-flip-roof-orientation":{"property-type":"data-driven","type":"boolean","default":false,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":1,"round":1,"square":1},"default":"butt","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":1,"round":1,"miter":1,"none":1},"default":"miter","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"expression":{"interpolated":true,"parameters":["zoom"]}},"line-round-limit":{"type":"number","default":1.05,"expression":{"interpolated":true,"parameters":["zoom"]}},"line-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-z-offset":{"type":"number","default":0,"expression":{"parameters":["zoom","feature","line-progress"]},"property-type":"data-driven"},"line-elevation-reference":{"type":"enum","values":{"none":1,"sea":1,"ground":1,"hd-road-markup":1},"default":"none","expression":{}},"line-cross-slope":{"type":"number","expression":{}},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}},"line-width-unit":{"type":"enum","values":{"pixels":1,"meters":1},"default":"pixels","expression":{"parameters":["zoom"]}},"line-elevation-ground-scale":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","feature","line-progress"]},"transition":true,"property-type":"data-driven"}},"layout_symbol":{"symbol-placement":{"type":"enum","values":{"point":1,"line":1,"line-center":1},"default":"point","expression":{"parameters":["zoom"]}},"symbol-spacing":{"type":"number","default":250,"minimum":1,"expression":{"interpolated":true,"parameters":["zoom"]}},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"symbol-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":1,"viewport-y":1,"source":1},"default":"auto","expression":{"parameters":["zoom"]}},"symbol-z-elevate":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"symbol-elevation-reference":{"type":"enum","values":{"sea":1,"ground":1,"hd-road-markup":1},"default":"ground","expression":{"parameters":["zoom"]}},"icon-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"icon-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"icon-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"icon-rotation-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]}},"icon-size":{"type":"number","default":1,"minimum":0,"appearance":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-size-scale-range":{"type":"array","value":"number","length":2,"default":[0.8,2],"minimum":[0.1,0.1],"maximum":[10,10],"expression":{}},"icon-text-fit":{"type":"enum","values":{"none":1,"width":1,"height":1,"both":1},"default":"none","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit-padding":{"type":"array","value":"number","length":4,"default":[0,0,0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-image":{"type":"resolvedImage","tokens":true,"appearance":true,"use-theme":true,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"appearance":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]}},"icon-keep-upright":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"appearance":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"}
18,"icon-anchor":{"type":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]}},"text-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]}},"text-rotation-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]}},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-font":{"type":"array","value":"string","default":["Open Sans Regular","Arial Unicode MS Regular"],"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"appearance":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size-scale-range":{"type":"array","value":"number","length":2,"default":[0.8,2],"minimum":[0.1,0.1],"maximum":[10,10],"expression":{}},"text-max-width":{"type":"number","default":10,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":1,"left":1,"center":1,"right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{"type":"number","default":0,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["zoom","feature"]}},"text-variable-anchor":{"type":"array","value":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"expression":{"parameters":["zoom"]}},"text-anchor":{"type":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{"type":"number","default":45,"expression":{"interpolated":true,"parameters":["zoom"]}},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":1,"vertical":1},"expression":{"parameters":["zoom"]}},"text-rotate":{"type":"number","default":0,"period":360,"appearance":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]}},"text-keep-upright":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"text-transform":{"type":"enum","values":{"none":1,"uppercase":1,"lowercase":1},"default":"none","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-offset":{"type":"array","value":"number","length":2,"default":[0,0],"appearance":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"text-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"text-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_raster":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_raster-particle":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_hillshade":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"filter":{"type":"array","value":"*"},"filter_symbol":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_hillshade":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_raster":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_raster-particle":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_clip":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_model":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_building":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":1,"!=":1,">":1,">=":1,"<":1,"<=":1,"in":1,"!in":1,"all":1,"any":1,"none":1,"has":1,"!has":1}},"geometry_type":{"type":"enum","values":{"Point":1,"LineString":1,"Polygon":1}},"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":1,"exponential":1,"interval":1,"categorical":1},"default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":1,"lab":1,"hcl":1},"default":"rgb"},"default":{"type":"*"}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"use-theme":true,"transition":true},"high-color":{"type":"color","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"use-theme":true,"transition":true},"space-color":{"type":"color","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"use-theme":true,"transition":true},"horizon-blend":{"type":"number","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"star-intensity":{"type":"number","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vertical-range":{"type":"array","default":[0,0],"minimum":0,"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}}},"snow":{"density":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,0.85],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"use-theme":true,"transition":true},"opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,0.3],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette-color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"use-theme":true,"transition":true},"center-thinning":{"type":"number","default":0.4,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"direction":{"type":"array","default":[0,50],"minimum":0,"maximum":360,"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"flake-size":{"type":"number","default":0.71,"minimum":0,"maximum":5,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true}},"rain":{"density":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,0.5],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"color":{"type":"color","default":["interpolate",["linear"],["measure-light","brightness"],0,"#03113d",0.3,"#a8adbc"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"use-theme":true,"transition":true},"opacity":{"type":"number","default":["interpolate",["linear"],["measure-light","brightness"],0,0.88,1,0.7],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette-color":{"type":"color","default":["interpolate",["linear"],["measure-light","brightness"],0,"#001736",0.3,"#464646"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"use-theme":true,"transition":true},"center-thinning":{"type":"number","default":0.57,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"direction":{"type":"array","default":[0,80],"minimum":0,"maximum":360,"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"droplet-size":{"type":"array","default":[2.6,18.2],"minimum":0,"maximum":50,"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"distortion-strength":{"type":"number","default":0.7,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true}},"camera":{"camera-projection":{"type":"enum","values":{"perspective":1,"orthographic":1},"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"default":"perspective"}},"colorTheme":{"data":{"type":"string","expression":{}}},"indoor_source":{"sourceId":{"type":"string"},"sourceLayers":{"type":"array","value":"string"}},"indoor":{"*":{"type":"indoor_source"}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"use-theme":true,"transition":true},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":1,"equalEarth":1,"equirectangular":1,"lambertConformalConic":1,"mercator":1,"naturalEarth":1,"winkelTripel":1,"globe":1},"default":"mercator"},"center":{"type":"array","length":2,"value":"number","minimum":[-180,-90],"maximum":[180,90]},"parallels":{"type":"array","length":2,"value":"number","minimum":[-90,-90],"maximum":[90,90]}},"terrain":{"source":{"type":"string"},"exaggeration":{"type":"number","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_building","paint_symbol","paint_raster","paint_raster-particle","paint_hillshade","paint_background","paint_sky","paint_model"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"fill-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-pattern-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-z-offset":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-bridge-guard-rail-color":{"type":"color","default":"rgba(241, 236, 225, 255)","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature"]},"property-type":"data-driven"},"fill-tunnel-structure-color":{"type":"color","default":"rgba(241, 236, 225, 255)","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","meas
18ure-light"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"fill-extrusion-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-pattern-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-height-alignment":{"type":"enum","values":{"terrain":1,"flat":1},"default":"flat"},"fill-extrusion-base-alignment":{"type":"enum","values":{"terrain":1,"flat":1},"default":"terrain"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-extrusion-ambient-occlusion-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-wall-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-flood-light-color":{"type":"color","default":"#ffffff","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-wall-radius":{"property-type":"data-driven","type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-radius":{"property-type":"data-driven","type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-vertical-scale":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-rounded-roof":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-extrusion-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{}},"fill-extrusion-front-cutoff":{"type":"array","value":"number","expression":{"interpolated":true,"parameters":["zoom"]},"length":3,"default":[0,0,1],"minimum":[0,0,0],"maximum":[1,1,1]},"fill-extrusion-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"property-type":"data-driven"},"fill-extrusion-line-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-cast-shadows":{"type":"boolean","default":true}},"paint_building":{"building-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"building-ambient-occlusion-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"parameters":[]},"transition":true},"building-ambient-occlusion-ground-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"building-ambient-occlusion-ground-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"building-ambient-occlusion-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"building-vertical-scale":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"building-cast-shadows":{"type":"boolean","default":true},"building-color":{"type":"color","default":"rgba(193, 154, 127, 1)","use-theme":true,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"property-type":"data-driven"},"building-emissive-strength":{"type":"number","default":0,"minimum":0,"maximum":5,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"property-type":"data-driven"},"building-facade-emissive-chance":{"type":"number","default":0.35,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["measure-light","zoom"]}},"building-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{}},"building-front-cutoff":{"type":"array","value":"number","expression":{"interpolated":true,"parameters":["zoom"]},"length":3,"default":[0,0,1],"minimum":[0,0,0],"maximum":[1,1,1]},"building-flood-light-color":{"type":"color","default":"#ffffff","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"building-flood-light-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"building-flood-light-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"line-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light","line-progress"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"}
18,"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"line-gradient":{"type":"color","use-theme":true,"expression":{"interpolated":true,"parameters":["line-progress"]}},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1]},"line-trim-fade-range":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"line-trim-color":{"type":"color","default":"transparent","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"line-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-driven"},"line-border-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-border-color":{"type":"color","default":"rgba(0, 0, 0, 0)","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-occlusion-opacity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"line-blend-mode":{"type":"enum","values":{"default":1,"multiply":1,"additive":1},"default":"default","expression":{"parameters":["zoom"]}},"line-blend-additive-clamp":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]}}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"circle-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"circle-pitch-scale":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"circle-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]}},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"use-theme":true,"expression":{"interpolated":true,"parameters":["heatmap-density"]}},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"appearance":true,"property-type":"data-driven"},"icon-occlusion-opacity":{"type":"number","minimum":0,"maximum":1,"default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"appearance":true,"property-type":"data-driven"},"icon-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"appearance":true,"property-type":"data-driven"},"text-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"appearance":true,"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"appearance":true,"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"appearance":true,"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"appearance":true,"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"appearance":true,"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"appearance":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"icon-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"icon-image-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"appearance":true,"property-type":"data-driven"},"text-occlusion-opacity":{"type":"number","minimum":0,"maximum":1,"default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"appearance":true,"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"overridable":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"appearance":true,"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"appearance":true,"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"appearance":true,"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"appearance":true,"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"appearance":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"text-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"icon-color-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{}},"icon-color-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{}},"icon-color-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{}},"icon-color-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{}},"symbol-z-offset":{"type":"number","default":0,"minimum":0,"transition":true,"appearance":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-color":{"type":"color","use-theme":true,"expression":{"interpolated":true,"parameters":["raster-value"]}},"raster-color-mix":{"type":"array","default":[0.2126,0.7152,0.0722,0],"length":4,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-color-range":{"type":"array","length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-resampling":{"type":"enum","values":{"linear":1,"nearest":1},"default":"linear","expression":{"parameters":["zoom"]}},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"raster-array-band":{"type":"string"},"raster-elevation":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-elevation-reference":{"type":"enum","values":{"sea":1,"ground":1},"default":"sea","expression":{}}},"paint_raster-particle":{"raster-particle-array-band":{"type":"string"},"raster-particle-count":{"type":"number","default":512,"minimum":1},"raster-particle-color":{"type":"color","use-theme":true,"expression":{"interpolated":true,"parameters":["raster-particle-speed"]}},"raster-particle-max-speed":{"type":"number","default":1,"minimum":1},"raster-particle-speed-factor":{"type":"number","default":0.2,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-particle-fade-opacity-factor":{"type":"number","default":0.98,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-particle-reset-rate-factor":{"type":"number","default":0.8,"minimum":0,"maximum":1},"raster-particle-elevation":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"expression":{"interpolated":true,"parameters":["zoom"]}},"hillshade-illumination-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]}},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"hillshade-shadow-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"hillshade-accent-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"hillshade-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}}},"paint_background":{"background-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":[]}},"background-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"background-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom"]}},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"background-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":1,"atmosphere":1},"default":"atmosphere","expression":{"parameters":["zoom"]}},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]}},"sky-atmosphere-sun-intensity":{"type":"number","default":10,"minimum":0,"maximum":100},"sky-gradient-center":{"type":"array","value":"number","default":[0,0],"length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]}},"sky-gradient-radius":{"type":"number","default":90,"minimum":0,"maximum":180,"expression":{"parameters":["zoom"]}},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"use-theme":true,"expression":{"interpolated":true,"parameters":["sky-radial-progress"]}},"sky-atmosphere-halo-color":{"type":"color","default":"white","use-theme":true},"sky-atmosphere-color":{"type":"color","default":"white","use-theme":true},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}}},"paint_model":{"model-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"property-type":"data-driven"},"model-rotation":{"type":"array","value":"number","length":3,"default":[0,0,0],"period":360,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-scale":{"type":"array","value":"n
18umber","length":3,"default":[1,1,1],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-translation":{"type":"array","value":"number","length":3,"default":[0,0,0],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-color":{"type":"color","default":"#ffffff","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light","zoom"]},"use-theme":true,"transition":true},"model-color-mix-intensity":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-type":{"type":"enum","values":{"common-3d":1,"location-indicator":1},"default":"common-3d"},"model-cast-shadows":{"type":"boolean","default":true},"model-receive-shadows":{"type":"boolean","default":true},"model-ambient-occlusion-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"model-emissive-strength":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":5,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-roughness":{"type":"number","default":1,"minimum":0,"maximum":1,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state"]},"transition":true},"model-height-based-emissive-strength-multiplier":{"type":"array","default":[1,1,1,1,0],"length":5,"value":"number","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{}},"model-front-cutoff":{"type":"array","value":"number","expression":{"interpolated":true,"parameters":["zoom"]},"length":3,"default":[0,0,1],"minimum":[0,0,0],"maximum":[1,1,1]},"model-elevation-reference":{"type":"enum","values":{"sea":1,"ground":1,"hd-road-markup":1},"default":"ground","expression":{}},"model-ignore-line-cutout":{"type":"boolean","default":false,"expression":{}}},"transition":{"duration":{"type":"number","default":300,"minimum":0},"delay":{"type":"number","default":0,"minimum":0}},"promoteId":{"*":{"type":"*"}}}');function O0(l){return l instanceof Number||l instanceof String||l instanceof Boolean?l.valueOf():l}function ef(l){if(Array.isArray(l))return l.map(ef);if(l instanceof Object&&!(l instanceof Number||l instanceof String||l instanceof Boolean)){const r={};for(const s in l)r[s]=ef(l[s]);return r}return O0(l)}function vl(l){if(l===!0||l===!1)return!0;if(!Array.isArray(l)||l.length===0)return!1;switch(l[0]){case"has":return l.length>=2&&l[1]!=="$id"&&l[1]!=="$type";case"in":return l.length>=3&&(typeof l[1]!="string"||Array.isArray(l[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return l.length!==3||Array.isArray(l[1])||Array.isArray(l[2]);case"any":case"all":for(const r of l.slice(1))if(!vl(r)&&typeof r!="boolean")return!1;return!0;default:return!0}}function Vg(l,r="",s=null,u="fill"){if(l==null)return{filter:()=>!0,needGeometry:!1,needFeature:!1};vl(l)||(l=Ug(l));const f=l;let g=!0;try{g=(function(R){if(!tf(R))return R;let M=ef(R);return dw(M),M=uw(M),M})(f)}catch{console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate. 19This is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md 20and paste the contents of this message in the report. 21Thank you! 22Filter Expression: 23${JSON.stringify(f,null,2)} 24 `)}let v=null,x=null;if(u!=="background"&&u!=="sky"&&u!=="slot"){x=ze[`filter_${u}`];const R=Tu(g,x,r,s);if(R.result==="error")throw new Error(R.value.map(M=>`${M.key}: ${M.message}`).join(", "));v=(M,O,B)=>R.value.evaluate(M,O,{},B)}let w=null,A=null;if(g!==f){const R=Tu(f,x,r,s);if(R.result==="error")throw new Error(R.value.map(M=>`${M.key}: ${M.message}`).join(", "));w=(M,O,B,N,G)=>R.value.evaluate(M,O,{},B,void 0,void 0,N,G),A=!Sd(R.value.expression)}return{filter:v,dynamicFilter:w||void 0,needGeometry:fw(g),needFeature:!!A}}function uw(l){if(!Array.isArray(l))return l;const r=(function(s){if(hw.has(s[0])){for(let u=1;u<s.length;u++)if(tf(s[u]))return!0}return s})(l);return r===!0?r:r.map(s=>uw(s))}function dw(l){let r=!1;const s=[];if(l[0]==="case"){for(let u=1;u<l.length-1;u+=2)r=r||tf(l[u]),s.push(l[u+1]);s.push(l.at(-1))}else if(l[0]==="match"){r=r||tf(l[1]);for(let u=2;u<l.length-1;u+=2)s.push(l[u+1]);s.push(l.at(-1))}else if(l[0]==="step"){r=r||tf(l[1]);for(let u=1;u<l.length-1;u+=2)s.push(l[u+1])}r&&(l.length=0,l.push("any",...s));for(let u=1;u<l.length;u++)dw(l[u])}function tf(l){if(!Array.isArray(l))return!1;if((r=l[0])==="pitch"||r==="distance-from-center")return!0;var r;for(let s=1;s<l.length;s++)if(tf(l[s]))return!0;return!1}const hw=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function I2(l,r){return l<r?-1:l>r?1:0}function fw(l){if(!Array.isArray(l))return!1;if(l[0]==="within"||l[0]==="distance")return!0;for(let r=1;r<l.length;r++)if(fw(l[r]))return!0;return!1}function Ug(l){if(!l)return!0;const r=l[0];return l.length<=1?r!=="any":r==="=="?$g(l[1],l[2],"=="):r==="!="?Up($g(l[1],l[2],"==")):r==="<"||r
24===">"||r==="<="||r===">="?$g(l[1],l[2],r):r==="any"?(s=l.slice(1),["any"].concat(s.map(Ug))):r==="all"?["all"].concat(l.slice(1).map(Ug)):r==="none"?["all"].concat(l.slice(1).map(Ug).map(Up)):r==="in"?Ad(l[1],l.slice(2)):r==="!in"?Up(Ad(l[1],l.slice(2))):r==="has"?Vp(l[1]):r!=="!has"||Up(Vp(l[1]));var s}function $g(l,r,s){switch(l){case"$type":return[`filter-type-${s}`,r];case"$id":return[`filter-id-${s}`,r];default:return[`filter-${s}`,l,r]}}function Ad(l,r){if(r.length===0)return!1;switch(l){case"$type":return["filter-type-in",["literal",r]];case"$id":return["filter-id-in",["literal",r]];default:return r.length>200&&!r.some(s=>typeof s!=typeof r[0])?["filter-in-large",l,["literal",r.sort(I2)]]:["filter-in-small",l,["literal",r]]}}function Vp(l){switch(l){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",l]}}function Up(l){return["!",l]}const Yl="�";function D0(l,r){return r?`${l}${Yl}${r}`:l}function pw(l){const r=l.indexOf(Yl);return r>=0?l.slice(r+1):""}let mw;const gw=()=>mw||(mw=new fi({"icon-size":new Dt(ze.layout_symbol["icon-size"]),"icon-image":new Dt(ze.layout_symbol["icon-image"]),"icon-rotate":new Dt(ze.layout_symbol["icon-rotate"]),"icon-offset":new Dt(ze.layout_symbol["icon-offset"]),"text-size":new Dt(ze.layout_symbol["text-size"]),"text-rotate":new Dt(ze.layout_symbol["text-rotate"]),"text-offset":new Dt(ze.layout_symbol["text-offset"])}));let _w;const yw=()=>_w||(_w=new fi({"icon-opacity":new Dt(ze.paint_symbol["icon-opacity"]),"icon-occlusion-opacity":new Dt(ze.paint_symbol["icon-occlusion-opacity"]),"icon-emissive-strength":new Dt(ze.paint_symbol["icon-emissive-strength"]),"text-emissive-strength":new Dt(ze.paint_symbol["text-emissive-strength"]),"icon-color":new Dt(ze.paint_symbol["icon-color"]),"icon-halo-color":new Dt(ze.paint_symbol["icon-halo-color"]),"icon-halo-width":new Dt(ze.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Dt(ze.paint_symbol["icon-halo-blur"]),"icon-translate":new Dt(ze.paint_symbol["icon-translate"]),"text-opacity":new Dt(ze.paint_symbol["text-opacity"]),"text-occlusion-opacity":new Dt(ze.paint_symbol["text-occlusion-opacity"]),"text-color":new Dt(ze.paint_symbol["text-color"],{runtimeType:Es,getOverride:l=>l.textColor,hasOverride:l=>!!l.textColor}),"text-halo-color":new Dt(ze.paint_symbol["text-halo-color"]),"text-halo-width":new Dt(ze.paint_symbol["text-halo-width"]),"text-halo-blur":new Dt(ze.paint_symbol["text-halo-blur"]),"text-translate":new Dt(ze.paint_symbol["text-translate"]),"symbol-z-offset":new Dt(ze.paint_symbol["symbol-z-offset"]),"icon-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"}),"icon-halo-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"}),"text-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"}),"text-halo-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"})}));class P2{constructor(r,s,u,f,g,v){this._conditionSpec=r,this._propertiesSpec=u;const x=Tu(r,ze.appearance.condition);if(x.result==="success"&&(this.condition=x.value),this.name=s,u){this.layoutProperties=new Mc(gw()),this.unevaluatedLayout=new Ng(gw(),f,g,v),this.paintProperties=new Mc(yw()),this.unevaluatedPaint=new Ng(yw(),f,g,"");for(const w in u)w in this.unevaluatedLayout._values?this.unevaluatedLayout.setValue(w,u[w]):w in this.unevaluatedPaint._values&&this.unevaluatedPaint.setValue(w,u[w])}}isActive(r){return!(this.condition||!r.isHidden||this.name!=="hidden")||this.condition.evaluate(r.globals,r.feature,r.featureState,r.canonical)}getCondition(){return this.condition}getName(){return this.name}getLayoutProperty(r){return this.layoutProperties.get(r)}getPaintProperty(r){return this.paintProperties.get(r)}getUnevaluatedLayoutProperties(){return this.unevaluatedLayout}getUnevaluatedLayoutProperty(r){return this.unevaluatedLayout._values[r]}getUnevaluatedPaintProperty(r){return this.unevaluatedPaint._values[r]}recalculate(r,s,u){this.unevaluatedLayout&&(this.layoutProperties=this.unevaluatedLayout.possiblyEvaluate(r,void 0,s,u)),this.unevaluatedPaint&&(this.paintProperties=this.unevaluatedPaint.possiblyEvaluate(r,void 0,s,""))}serialize(){const r={};r.condition=this.condition.expression.serialize(),this.name&&(r.name=this.name);const s=this.unevaluatedLayout?this.unevaluatedLayout.serialize():{},u=this.unevaluatedPaint?this.unevaluatedPaint.serialize():{},f=Object.assign({},s,u);return Object.keys(f).length>0&&(r.properties=f),r}hasIconLayoutProperties(){const r=this.hasLayoutProperty("icon-image"),s=this.hasLayoutProperty("icon-size"),u=this.hasLayoutProperty("icon-offset"),f=this.hasLayoutProperty("icon-rotate");return r||s||u||f}hasTextLayoutProperties(){const r=this.hasLayoutProperty("text-size"),s=this.hasLayoutProperty("text-offset"),u=this.hasLayoutProperty("text-rotate");return r||s||u}hasIconPaintProperties(){return!!this.unevaluatedPaint&&Object.keys(this.unevaluatedPaint._values).filter(r=>!r.endsWith("-use-theme")).some(r=>(r.startsWith("icon-")||r==="symbol-z-offset")&&this.hasPaintProperty(r))}hasTextPaintProperties(){return!!this.unevaluatedPaint&&Object.keys(this.unevaluatedPaint._values).filter(r=>!r.endsWith("-use-theme")).some(r=>(r.startsWith("text-")||r==="symbol-z-offset")&&this.hasPaintProperty(r))}hasLayoutProperty(r){return this.unevaluatedLayout&&this.unevaluatedLayout._values[r].value!==void 0}hasPaintProperty(r){return this.unevaluatedPaint&&this.unevaluatedPaint._values[r].value!==void 0}}const F0="-transition",R2=new Set(["fill","line","background","hillshade","raster"]);class Is extends Lh{constructor(r,s,u,f,g,v){if(super(),this.id=r.id,this.fqid=D0(this.id,u),this.type=r.type,this.scope=u,this.lut=f,this.options=g,this.iconImageUseTheme=v,this.appearances=new Array,this.appearancesVersion=0,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,this.expressionDependencies={isIndoorDependent:!1,configDependencies:new Set},r.type!=="custom"){if(this.metadata=r.metadata,this.minzoom=r.minzoom,this.maxzoom=r.maxzoom,r.type&&r.type!=="background"&&r.type!=="sky"&&r.type!=="slot"){this.source=r.source,this.sourceLayer=r["source-layer"],this.filter=r.filter;const x=Tu(this.filter,ze[`filter_${r.type}`]);x.result!=="error"&&(this.expressionDependencies.configDependencies=new Set([...this.expressionDependencies.configDependencies,...x.value.configDependencies]),this.expressionDependencies.isIndoorDependent=this.expressionDependencies.isIndoorDependent||x.value.isIndoorDependent)}if(r.slot&&(this.slot=r.slot),r.appearances&&this.setAppearances(r.appearances),s.layout&&(this._unevaluatedLayout=new Ng(s.layout,this.scope,g,this.iconImageUseTheme),this.expressionDependencies.configDependencies=new Set([...this.expressionDependencies.configDependencies,...this._unevaluatedLayout.configDependencies]),this.expressionDependencies.isIndoorDependent=this.expressionDependencies.isIndoorDependent||this._unevaluatedLayout.isIndoorDependent()),s.paint){this._transitionablePaint=new zp(s.paint,this.scope,g);for(const x in r.paint)this.setPaintProperty(x,r.paint[x]);for(const x in r.layout)this.setLayoutProperty(x,r.layout[x]);this.expressionDependencies.configDependencies=new Set([...this.expressionDependencies.configDependencies,...this._transitionablePaint.configDependencies]),this.expressionDependencies.isIndoorDependent=this.expressionDependencies.isIndoorDependent||this._transitionablePaint.isIndoorDependent(),this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Mc(s.paint)}}}onAdd(r){}onRemove(r){}isDraped(r){return!this.is3D(!0)&&R2.has(this.type)}getLayoutProperty(r){return r==="visibility"?this.visibility:this._unevaluatedLayout.getValue(r)}
24setLayoutProperty(r,s){if(this.type==="custom"&&r==="visibility")return void(this.visibility=s);const u=this._unevaluatedLayout;u._properties.properties[r]&&(u.setValue(r,s),this.expressionDependencies.configDependencies=new Set([...this.expressionDependencies.configDependencies,...u.configDependencies]),this.expressionDependencies.isIndoorDependent=this.expressionDependencies.isIndoorDependent||u.isIndoorDependent(),r==="visibility"&&this.possiblyEvaluateVisibility())}setAppearances(r){this.appearances=[],r.forEach(s=>{this.appearances.push(new P2(s.condition,s.name,s.properties,this.scope,this.options,this.iconImageUseTheme))}),this.appearancesVersion++}possiblyEvaluateVisibility(){this._unevaluatedLayout._values.visibility&&(this.visibility=this._unevaluatedLayout._values.visibility.possiblyEvaluate({zoom:0}))}getPaintProperty(r){return r.endsWith(F0)?this._transitionablePaint.getTransition(r.slice(0,-11)):this._transitionablePaint.getValue(r)}isPaintProperty(r){return!!this._transitionablePaint._properties.properties[r]}setPaintProperty(r,s){const u=this._transitionablePaint,f=u._properties.properties;if(r.endsWith(F0)){const M=r.slice(0,-11);return f[M]&&u.setTransition(M,s||void 0),!1}if(!f[r])return!1;const g=u._values[r],v=g.value.isDataDriven(),x=g.value;u.setValue(r,s),this.expressionDependencies.configDependencies=new Set([...this.expressionDependencies.configDependencies,...u.configDependencies]),this.expressionDependencies.isIndoorDependent=this.expressionDependencies.isIndoorDependent||u.isIndoorDependent(),this._handleSpecialPaintPropertyUpdate(r);const w=u._values[r].value,A=w.isDataDriven(),R=r.endsWith("pattern")||r==="line-dasharray";return A||v||R||this._handleOverridablePaintPropertyUpdate(r,x,w)}_handleSpecialPaintPropertyUpdate(r){}getProgramIds(){return null}getDefaultProgramParams(r,s,u){return null}_handleOverridablePaintPropertyUpdate(r,s,u){return!1}isHidden(r){return!!(this.minzoom&&r<this.minzoom)||!!(this.maxzoom&&r>=this.maxzoom)||this.visibility==="none"}updateTransitions(r){this._transitioningPaint=this._transitionablePaint.transitioned(r,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(r,s){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(r,void 0,s,this.iconImageUseTheme)),this.paint=this._transitioningPaint.possiblyEvaluate(r,void 0,s)}
24serialize(){const r={id:this.id,type:this.type,slot:this.slot,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.appearances.length!==0&&(r.appearances=this.appearances.map(s=>s.serialize())),ln(r,(s,u)=>!(s===void 0||u==="layout"&&!Object.keys(s).length||u==="paint"&&!Object.keys(s).length))}is3D(r){return!1}hasElevation(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}hasShadowPass(){return!1}canCastShadows(){return!1}hasLightBeamPass(){return!1}cutoffRange(){return 0}tileCoverLift(){return 0}resize(){}_clear(){}isStateDependent(){for(const r in this.paint._values){const s=this.paint.get(r);if(s instanceof Au&&Eg(s.property.specification)&&(s.value.kind==="source"||s.value.kind==="composite")&&s.value.isStateDependent)return!0}for(const r of this.appearances)if(!Ga(r.condition.expression))return!0;return!1}compileFilter(r){this._filterCompiled||(this._featureFilter=Vg(this.filter,this.scope,r),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}dynamicFilterNeedsGeometry(){return this._featureFilter.needGeometry}getLayerRenderingStats(){return this._stats}resetLayerRenderingStats(r){this._stats&&(r.renderPass==="shadow"?this._stats.numRenderedVerticesInShadowPass=0:this._stats.numRenderedVerticesInTransparentPass=0)}getAppearances(){return this.appearances}queryRenderedFeatures(r,s,u){return{}}queryRadius(r){}queryIntersectsFeature(r,s,u,f,g,v,x,w,A,R){}}const k2={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class $p{constructor(r,s){this._structArray=r,this._pos1=s*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}const M2=new ArrayBuffer(0);class Zr{constructor(){this._reallocCount=0,this.capacity=0,this.length=0}static serialize(r,s){return r._trim(),s&&r.arrayBuffer&&s.add(r.arrayBuffer),{length:r.length,arrayBuffer:r.arrayBuffer}}static deserialize(r){const s=Object.create(this.prototype);return s.arrayBuffer=r.arrayBuffer,s.length=r.length,r.arrayBuffer?s.capacity=r.arrayBuffer.byteLength/s.bytesPerElement:(s.capacity=0,s.arrayBuffer=M2),s._refreshViews(),s}_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(r){this.reserve(r),this.length=r}reserve(r){if(r>this.capacity){this._reallocCount++,this.capacity=Math.max(r,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const s=this.uint8;this._refreshViews(),s&&this.uint8.set(s)}}reserveForAdditional(r){this.reserve(this.length+r)}_refreshViews(){throw new Error("StructArray#_refreshViews() must be implemented by each concrete StructArray layout")}emplace(...r){throw new Error("StructArray#emplace() must be implemented by each concrete StructArray layout")}emplaceBack(...r){throw new Error("StructArray#emplaceBack() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function Jn(l,r=1){let s=0,u=0;return{members:l.map(f=>{const g=k2[f.type].BYTES_PER_ELEMENT,v=s=Lc(s,Math.max(r,g)),x=f.components||1;return u=Math.max(u,g),s+=g*x,{name:f.name,type:f.type,components:x,offset:v}}),size:Lc(s,Math.max(u,r)),alignment:r}}function Lc(l,r){return Math.ceil(l/r)*r}class Ha extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,s){const u=this.length;return this.resize(u+1),this.emplace(u,r,s)}emplace(r,s,u){const f=2*r;return this.int16[f+0]=s,this.int16[f+1]=u,r}}Ha.prototype.bytesPerElement=4,Kt(Ha,"StructArrayLayout2i4");class Id extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,s,u){const f=this.length;return this.resize(f+1),this.emplace(f,r,s,u)}emplace(r,s,u,f){const g=3*r;return this.int16[g+0]=s,this.int16[g+1]=u,this.int16[g+2]=f,r}}
vendor: 23,838 bytes, line 24
24Id.prototype.bytesPerElement=6,Kt(Id,"StructArrayLayout3i6");class Pd extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,s,u,f){const g=this.length;return this.resize(g+1),this.emplace(g,r,s,u,f)}emplace(r,s,u,f,g){const v=4*r;return this.int16[v+0]=s,this.int16[v+1]=u,this.uint16[v+2]=f,this.uint16[v+3]=g,r}}Pd.prototype.bytesPerElement=8,Kt(Pd,"StructArrayLayout2i2ui8");class Zo extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r){const s=this.length;return this.resize(s+1),this.emplace(s,r)}emplace(r,s){return this.float32[1*r+0]=s,r}}Zo.prototype.bytesPerElement=4,Kt(Zo,"StructArrayLayout1f4");class jg extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,s,u){const f=this.length;return this.resize(f+1),this.emplace(f,r,s,u)}emplace(r,s,u,f){const g=4*r,v=2*r;return this.int16[g+0]=s,this.int16[g+1]=u,this.float32[v+1]=f,r}}jg.prototype.bytesPerElement=8,Kt(jg,"StructArrayLayout2i1f8");class jp extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,s,u){const f=this.length;return this.resize(f+1),this.emplace(f,r,s,u)}emplace(r,s,u,f){const g=4*r;return this.int16[g+0]=s,this.int16[g+1]=u,this.int16[g+2]=f,r}}jp.prototype.bytesPerElement=8,Kt(jp,"StructArrayLayout3i8");class B0 extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,s,u,f){const g=this.length;return this.resize(g+1),this.emplace(g,r,s,u,f)}emplace(r,s,u,f,g){const v=4*r;return this.int16[v+0]=s,this.int16[v+1]=u,this.int16[v+2]=f,this.int16[v+3]=g,r}}B0.prototype.bytesPerElement=8,Kt(B0,"StructArrayLayout4i8");class z0 extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,s,u,f,g){const v=this.length;return this.resize(v+1),this.emplace(v,r,s,u,f,g)}emplace(r,s,u,f,g,v){const x=5*r;return this.int16[x+0]=s,this.int16[x+1]=u,this.int16[x+2]=f,this.int16[x+3]=g,this.int16[x+4]=v,r}}z0.prototype.bytesPerElement=10,Kt(z0,"StructArrayLayout5i10");class N0 extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,s,u,f,g,v,x){const w=this.length;return this.resize(w+1),this.emplace(w,r,s,u,f,g,v,x)}emplace(r,s,u,f,g,v,x,w){const A=6*r,R=12*r,M=3*r;return this.int16[A+0]=s,this.int16[A+1]=u,this.uint8[R+4]=f,this.uint8[R+5]=g,this.uint8[R+6]=v,this.uint8[R+7]=x,this.float32[M+2]=w,r}}N0.prototype.bytesPerElement=12,Kt(N0,"StructArrayLayout2i4ub1f12");class Ta extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,s,u){const f=this.length;return this.resize(f+1),this.emplace(f,r,s,u)}emplace(r,s,u,f){const g=3*r;return this.float32[g+0]=s,this.float32[g+1]=u,this.float32[g+2]=f,r}}Ta.prototype.bytesPerElement=12,Kt(Ta,"StructArrayLayout3f12");class Pu extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,s,u,f,g){const v=this.length;return this.resize(v+1),this.emplace(v,r,s,u,f,g)}emplace(r,s,u,f,g,v){const x=6*r,w=3*r;return this.uint16[x+0]=s,this.uint16[x+1]=u,this.uint16[x+2]=f,this.uint16[x+3]=g,this.float32[w+2]=v,r}}Pu.prototype.bytesPerElement=12,Kt(Pu,"StructArrayLayout4ui1f12");class nf extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,s,u,f){const g=this.length;return this.resize(g+1),this.emplace(g,r,s,u,f)}emplace(r,s,u,f,g){const v=4*r;return this.uint16[v+0]=s,this.uint16[v+1]=u,this.uint16[v+2]=f,this.uint16[v+3]=g,r}}nf.prototype.bytesPerElement=8,Kt(nf,"StructArrayLayout4ui8");class Gg extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,s,u,f,g,v){const x=this.length;return this.resize(x+1),this.emplace(x,r,s,u,f,g,v)}emplace(r,s,u,f,g,v,x){const w=6*r;return this.int16[w+0]=s,this.int16[w+1]=u,this.int16[w+2]=f,this.int16[w+3]=g,this.int16[w+4]=v,this.int16[w+5]=x,r}}Gg.prototype.bytesPerElement=12,Kt(Gg,"StructArrayLayout6i12");class V0 extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,s,u,f,g,v,x,w,A,R,M,O){const B=this.length;return this.resize(B+1),this.emplace(B,r,s,u,f,g,v,x,w,A,R,M,O)}emplace(r,s,u,f,g,v,x,w,A,R,M,O,B){const N=12*r;return this.int16[N+0]=s,this.int16[N+1]=u,this.int16[N+2]=f,this.int16[N+3]=g,this.uint16[N+4]=v,this.uint16[N+5]=x,this.uint16[N+6]=w,this.uint16[N+7]=A,this.int16[N+8]=R,this.int16[N+9]=M,this.int16[N+10]=O,this.int16[N+11]=B,r}}V0.prototype.bytesPerElement=24,Kt(V0,"StructArrayLayout4i4ui4i24");class U0 extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,s,u,f,g,v){const x=this.length;return this.resize(x+1),this.emplace(x,r,s,u,f,g,v)}emplace(r,s,u,f,g,v,x){const w=10*r,A=5*r;return this.int16[w+0]=s,this.int16[w+1]=u,this.int16[w+2]=f,this.float32[A+2]=g,this.float32[A+3]=v,this.float32[A+4]=x,r}}U0.prototype.bytesPerElement=20,Kt(U0,"StructArrayLayout3i3f20");class Oc extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,s,u,f){const g=this.length;return this.resize(g+1),this.emplace(g,r,s,u,f)}emplace(r,s,u,f,g){const v=4*r;return this.float32[v+0]=s,this.float32[v+1]=u,this.float32[v+2]=f,this.float32[v+3]=g,r}}Oc.prototype.bytesPerElement=16,Kt(Oc,"StructArrayLayout4f16");class Hg extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(r){const s=this.length;return this.resize(s+1),this.emplace(s,r)}emplace(r,s){return this.uint32[1*r+0]=s,r}}Hg.prototype.bytesPerElement=4,Kt(Hg,"StructArrayLayout1ul4");class Bs extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,s){const u=this.length;return this.resize(u+1),this.emplace(u,r,s)}emplace(r,s,u){const f=2*r;return this.uint16[f+0]=s,this.uint16[f+1]=u,r}}Bs.prototype.bytesPerElement=4,Kt(Bs,"StructArrayLayout2ui4");class $0 extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,s,u,f,g,v,x,w,A,R,M,O,B){const N=this.length;return this.resize(N+1),this.emplace(N,r,s,u,f,g,v,x,w,A,R,M,O,B)}emplace(r,s,u,f,g,v,x,w,A,R,M,O,B,N){const G=20*r,H=10*r;return this.int16[G+0]=s,this.int16[G+1]=u,this.int16[G+2]=f,this.int16[G+3]=g,this.int16[G+4]=v,this.float32[H+3]=x,this.float32[H+4]=w,this.float32[H+5]=A,this.float32[H+6]=R,this.int16[G+14]=M,this.uint32[H+8]=O,this.uint16[G+18]=B,this.uint16[G+19]=N,r}}$0.prototype.bytesPerElement=40,Kt($0,"StructArrayLayout5i4f1i1ul2ui40");class Wg extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,s,u,f,g,v,x){const w=this.length;return this.resize(w+1),this.emplace(w,r,s,u,f,g,v,x)}emplace(r,s,u,f,g,v,x,w){const A=8*r;return this.int16[A+0]=s,this.int16[A+1]=u,this.int16[A+2]=f,this.int16[A+4]=g,this.int16[A+5]=v,this.int16[A+6]=x,this.int16[A+7]=w,r}}Wg.prototype.bytesPerElement=16,Kt(Wg,"StructArrayLayout3i2i2i16");class Kl extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,s,u,f,g){const v=this.length;return this.resize(v+1),this.emplace(v,r,s,u,f,g)}emplace(r,s,u,f,g,v){const x=4*r,w=8*r;return this.float32[x+0]=s,this.float32[x+1]=u,this.float32[x+2]=f,this.int16[w+6]=g,this.int16[w+7]=v,r}}Kl.prototype.bytesPerElement=16,Kt(Kl,"StructArrayLayout2f1f2i16");class qg extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,s,u,f,g,v){const x=this.length;return this.resize(x+1),this.emplace(x,r,s,u,f,g,v)}emplace(r,s,u,f,g,v,x){const w=20*r,A=5*r;return this.uint8[w+0]=s,this.uint8[w+1]=u,this.float32[A+1]=f,this.float32[A+2]=g,this.float32[A+3]=v,this.float32[A+4]=x,r}}qg.prototype.bytesPerElement=20,Kt(qg,"StructArrayLayout2ub4f20");class _i extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,s,u){const f=this.length;return this.resize(f+1),this.emplace(f,r,s,u)}emplace(r,s,u,f){const g=3*r;return this.uint16[g+0]=s,this.uint16[g+1]=u,this.uint16[g+2]=f,r}}_i.prototype.bytesPerElement=6,Kt(_i,"StructArrayLayout3ui6");class j0 extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(r,s,u,f,g,v,x,w,A,R,M,O,B,N,G,H,J,re,Q,le,ue){const he=this.length;return this.resize(he+1),this.emplace(he,r,s,u,f,g,v,x,w,A,R,M,O,B,N,G,H,J,re,Q,le,ue)}emplace(r,s,u,f,g,v,x,w,A,R,M,O,B,N,G,H,J,re,Q,le,ue,he){const Te=30*r,me=15*r,xe=60*r;return this.int16[Te+0]=s,this.int16[Te+1]=u,this.int16[Te+2]=f,this.float32[me+2]=g,this.float32[me+3]=v,this.uint16[Te+8]=x,this.uint16[Te+9]=w,this.uint32[me+5]=A,this.uint32[me+6]=R,this.uint32[me+7]=M,this.uint16[Te+16]=O,this.uint16[Te+17]=B,this.uint16[Te+18]=N,this.float32[me+10]=G,this.float32[me+11]=H,this.uint8[xe+48]=J,this.uint8[xe+49]=re,this.uint8[xe+50]=Q,this.uint32[me+13]=le,this.int16[Te+28]=ue,this.uint8[xe+58]=he,r}}j0.prototype.bytesPerElement=60,Kt(j0,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class G0 extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(r,s,u,f,g,v,x,w,A,R,M,O,B,N,G,H,J,re,Q,le,ue,he,Te,me,xe,_e,we,je,He,Qe,it,nt,bt){const Ze=this.length;return this.resize(Ze+1),this.emplace(Ze,r,s,u,f,g,v,x,w,A,R,M,O,B,N,G,H,J,re,Q,le,ue,he,Te,me,xe,_e,we,je,He,Qe,it,nt,bt)}emplace(r,s,u,f,g,v,x,w,A,R,M,O,B,N,G,H,J,re,Q,le,ue,he,Te,me,xe,_e,we,je,He,Qe,it,nt,bt,Ze){const et=20*r,ot=40*r,ft=80*r;return this.float32[et+0]=s,this.float32[et+1]=u,this.int16[ot+4]=f,this.int16[ot+5]=g,this.int16[ot+6]=v,this.int16[ot+7]=x,this.int16[ot+8]=w,this.int16[ot+9]=A,this.int16[ot+10]=R,this.int16[ot+11]=M,this.int16[ot+12]=O,this.uint16[ot+13]=B,this.uint16[ot+14]=N,this.uint16[ot+15]=G,this.uint16[ot+16]=H,this.uint16[ot+17]=J,this.uint16[ot+18]=re,this.uint16[ot+19]=Q,this.uint16[ot+20]=le,this.uint16[ot+21]=ue,this.uint16[ot+22]=he,this.uint16[ot+23]=Te,this.uint16[ot+24]=me,this.uint16[ot+25]=xe,this.uint16[ot+26]=_e,this.uint16[ot+27]=we,this.uint32[et+14]=je,this.float32[et+15]=He,this.float32[et+16]=Qe,this.float32[et+17]=it,this.float32[et+18]=nt,this.uint8[ft+76]=bt,this.uint16[ot+39]=Ze,r}}G0.prototype.bytesPerElement=80,Kt(G0,"StructArrayLayout2f9i15ui1ul4f1ub1ui80");class H0 extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,s,u,f,g,v){const x=this.length;return this.resize(x+1),this.emplace(x,r,s,u,f,g,v)}emplace(r,s,u,f,g,v,x){const w=6*r;return this.float32[w+0]=s,this.float32[w+1]=u,this.float32[w+2]=f,this.float32[w+3]=g,this.float32[w+4]=v,this.float32[w+5]=x,r}}H0.prototype.bytesPerElement=24,Kt(H0,"StructArrayLayout6f24");class Rd extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,s,u,f,g){const v=this.length;return this.resize(v+1),this.emplace(v,r,s,u,f,g)}emplace(r,s,u,f,g,v){const x=5*r;return this.float32[x+0]=s,this.float32[x+1]=u,this.float32[x+2]=f,this.float32[x+3]=g,this.float32[x+4]=v,r}}Rd.prototype.bytesPerElement=20,Kt(Rd,"StructArrayLayout5f20");class W0 extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,s,u,f,g,v,x){const w=this.length;return this.resize(w+1),this.emplace(w,r,s,u,f,g,v,x)}emplace(r,s,u,f,g,v,x,w){const A=7*r;return this.float32[A+0]=s,this.float32[A+1]=u,this.float32[A+2]=f,this.float32[A+3]=g,this.float32[A+4]=v,this.float32[A+5]=x,this.float32[A+6]=w,r}}W0.prototype.bytesPerElement=28,Kt(W0,"StructArrayLayout7f28");class zs extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,s,u,f,g,v,x,w,A,R,M){const O=this.length;return this.resize(O+1),this.emplace(O,r,s,u,f,g,v,x,w,A,R,M)}emplace(r,s,u,f,g,v,x,w,A,R,M,O){const B=11*r;return this.float32[B+0]=s,this.float32[B+1]=u,this.float32[B+2]=f,this.float32[B+3]=g,this.float32[B+4]=v,this.float32[B+5]=x,this.float32[B+6]=w,this.float32[B+7]=A,this.float32[B+8]=R,this.float32[B+9]=M,this.float32[B+10]=O,r}}zs.prototype.bytesPerElement=44,Kt(zs,"StructArrayLayout11f44");class Wa extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,s,u,f,g,v,x,w,A){const R=this.length;return this.resize(R+1),this.emplace(R,r,s,u,f,g,v,x,w,A)}emplace(r,s,u,f,g,v,x,w,A,R){const M=9*r;return this.float32[M+0]=s,this.float32[M+1]=u,this.float32[M+2]=f,this.float32[M+3]=g,this.float32[M+4]=v,this.float32[M+5]=x,this.float32[M+6]=w,this.float32[M+7]=A,this.float32[M+8]=R,r}}Wa.prototype.bytesPerElement=36,Kt(Wa,"StructArrayLayout9f36");class Ru extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,s){const u=this.length;return this.resize(u+1),this.emplace(u,r,s)}emplace(r,s,u){const f=2*r;return this.float32[f+0]=s,this.float32[f+1]=u,r}}Ru.prototype.bytesPerElement=8,Kt(Ru,"StructArrayLayout2f8");class q0 extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,s,u,f){const g=this.length;return this.resize(g+1),this.emplace(g,r,s,u,f)}emplace(r,s,u,f,g){const v=6*r;return this.uint32[3*r+0]=s,this.uint16[v+2]=u,this.uint16[v+3]=f,this.uint16[v+4]=g,r}}q0.prototype.bytesPerElement=12,Kt(q0,"StructArrayLayout1ul3ui12");class Dc extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r){const s=this.length;return this.resize(s+1),this.emplace(s,r)}emplace(r,s){return this.uint16[1*r+0]=s,r}}Dc.prototype.bytesPerElement=2,Kt(Dc,"StructArrayLayout1ui2");class Xg extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,s,u,f,g,v,x,w,A,R,M,O,B,N,G,H){const J=this.length;return this.resize(J+1),this.emplace(J,r,s,u,f,g,v,x,w,A,R,M,O,B,N,G,H)}emplace(r,s,u,f,g,v,x,w,A,R,M,O,B,N,G,H,J){const re=16*r;return this.float32[re+0]=s,this.float32[re+1]=u,this.float32[re+2]=f,this.float32[re+3]=g,this.float32[re+4]=v,this.float32[re+5]=x,this.float32[re+6]=w,this.float32[re+7]=A,this.float32[re+8]=R,this.float32[re+9]=M,this.float32[re+10]=O,this.float32[re+11]=B,this.float32[re+12]=N,this.float32[re+13]=G,this.float32[re+14]=H,this.float32[re+15]=J,r}}Xg.prototype.bytesPerElement=64,Kt(Xg,"StructArrayLayout16f64");class kd extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,s,u,f,g,v,x){const w=this.length;return this.resize(w+1),this.emplace(w,r,s,u,f,g,v,x)}emplace(r,s,u,f,g,v,x,w){const A=10*r,R=5*r;return this.uint16[A+0]=s,this.uint16[A+1]=u,this.uint16[A+2]=f,this.uint16[A+3]=g,this.float32[R+2]=v,this.float32[R+3]=x,this.float32[R+4]=w,r}}kd.prototype.bytesPerElement=20,Kt(kd,"StructArrayLayout4ui3f20");class rf extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r){const s=this.length;return this.resize(s+1),this.emplace(s,r)}emplace(r,s){return this.int16[1*r+0]=s,r}}rf.prototype.bytesPerElement=2,Kt(rf,"StructArrayLayout1i2");class Gp extends Zr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer)}emplaceBack(r){const s=this.length;return this.resize(s+1),this.emplace(s,r)}emplace(r,s){return this.uint8[1*r+0]=s,r}}Gp.prototype.bytesPerElement=1,Kt(Gp,"StructArrayLayout1ub1");class Zg extends $p{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}Zg.prototype.size=40;class Md extends $0{get(r){return new Zg(this,r)}}Kt(Md,"CollisionBoxArray");class X0 extends $p{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(r){this._structArray.uint8[this._pos1+49]=r}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(r){this._structArray.uint8[this._pos1+50]=r}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(r){this._structArray.uint32[this._pos4+13]=r}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(r){this._structArray.uint8[this._pos1+58]=r}}X0.prototype.size=60;class vw extends j0{get(r){return new X0(this,r)}}Kt(vw,"PlacedSymbolArray");class bw extends $p{get tileAnchorX(){return this._structArray.float32[this._pos4+0]}get tileAnchorY(){return this._structArray.float32[this._pos4+1]}get projectedAnchorX(){return this._structArray.int16[this._pos2+4]}get projectedAnchorY(){return this._structArray.int16[this._pos2+5]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+6]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+7]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+11]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get key(){return this._structArray.uint16[this._pos2+13]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+14]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+15]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+17]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+19]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+21]}get featureIndex(){return this._structArray.uint16[this._pos2+22]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+23]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numIconVertices(){return this._structArray.uint16[this._pos2+25]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+26]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+27]}get crossTileID(){return this._structArray.uint32[this._pos4+14]}set crossTileID(r){this._structArray.uint32[this._pos4+14]=r}get textOffset0(){return this._structArray.float32[this._pos4+15]}get textOffset1(){return this._structArray.float32[this._pos4+16]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+17]}get zOffset(){return this._structArray.float32[this._pos4+18]}set zOffset(r){this._structArray.float32[this._pos4+18]=r}get hasIconTextFit(){return this._structArray.uint8[this._pos1+76]}get elevationFeatureIndex(){return this._structArray.uint16[this._pos2+39]}}bw.prototype.size=80;class Z0 extends G0{get(r){return new bw(this,r)}}Kt(Z0,"SymbolInstanceArray");class xw extends Zo{getoffsetX(r){return this.float32[1*r+0]}}Kt(xw,"GlyphOffsetArray");class bl extends Ha{getx(r){return this.int16[2*r+0]}gety(r){return this.int16[2*r+1]}}Kt(bl,"SymbolLineVertexArray");class ww extends $p{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]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}ww.prototype.size=12;class Y0 extends q0{get(r){return new ww(this,r)}}Kt(Y0,"FeatureIndexArray");class Sw extends Bs{geta_centroid_pos0(r){return this.uint16[2*r+0]}geta_centroid_pos1(r){return this.uint16[2*r+1]}}Kt(Sw,"FillExtrusionCentroidArray");class Tw extends $p{get a_join_normal_inside0(){return this._structArray.int16[this._pos2+0]}get a_join_normal_inside1(){return this._structArray.int16[this._pos2+1]}get a_join_normal_inside2(){return this._structArray.int16[this._pos2+2]}}Tw.prototype.size=6;class Ew extends Id{get(r){return new Tw(this,r)}}Kt(Ew,"FillExtrusionWallArray");const L2=Jn([{name:"a_pos",components:2,type:"Int16"}],4),O2=Jn([{name:"a_circle_z_offset",components:1,type:"Float32"}],4),D2=Jn([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);
vendor: 4,220 bytes, line 24
24class Wr{constructor(r=[]){this.segments=r}_prepareSegment(r,s,u,f,g){let v=this.segments.at(-1);return r>Wr.MAX_VERTEX_ARRAY_LENGTH&&On(`Max vertices per segment is ${Wr.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${r}`),(!v||v.vertexLength+r>Wr.MAX_VERTEX_ARRAY_LENGTH||v.sortKey!==f||g!==void 0&&v&&v.batchIndex!==void 0&&v.batchIndex!==g)&&(v={vertexOffset:s,primitiveOffset:u,vertexLength:0,primitiveLength:0},f!==void 0&&(v.sortKey=f),g!==void 0&&(v.batchIndex=g),this.segments.push(v)),v}prepareSegment(r,s,u,f,g){return this._prepareSegment(r,s.length,u.length,f,g)}get(){return this.segments}destroy(){for(const r of this.segments)for(const s in r.vaos)r.vaos[s].destroy()}static simpleSegment(r,s,u,f){return new Wr([{vertexOffset:r,primitiveOffset:s,vertexLength:u,primitiveLength:f,vaos:{},sortKey:0}])}}function of(l,r){return 256*(l=Ee(Math.floor(l),0,255))+Ee(Math.floor(r),0,255)}Wr.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Kt(Wr,"SegmentVector");const Yg=Jn([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),K0=Jn([{name:"a_pattern_b",components:4,type:"Uint16"}]),Cw=Jn([{name:"a_dash",components:4,type:"Uint16"}]);class sf{constructor(){this.ids=[],this.uniqueIds=[],this.positions=[],this.indexed=!1}add(r,s,u,f){this.ids.push(Aw(r)),this.positions.push(s,u,f)}eachPosition(r,s){const u=Aw(r);let f=0,g=this.ids.length-1;for(;f<g;){const v=f+g>>1;this.ids[v]>=u?g=v:f=v+1}for(;this.ids[f]===u;)s(this.positions[3*f],this.positions[3*f+1],this.positions[3*f+2]),f++}static serialize(r,s){const u=new Float64Array(r.ids),f=new Uint32Array(r.positions);return Kg(u,f,0,u.length-1),s&&(s.add(u.buffer),s.add(f.buffer)),{ids:u,positions:f}}static deserialize(r){const s=new sf;let u;s.ids=r.ids,s.positions=r.positions;for(const f of s.ids)f!==u&&s.uniqueIds.push(f),u=f;return s.indexed=!0,s}}function Aw(l){const r=+l;return Number.isSafeInteger(r)?r:tg(String(l))}function Kg(l,r,s,u){for(;s<u;){const f=l[s+u>>1];let g=s-1,v=u+1;for(;;){do g++;while(l[g]<f);do v--;while(l[v]>f);if(g>=v)break;Jg(l,g,v),Jg(r,3*g,3*v),Jg(r,3*g+1,3*v+1),Jg(r,3*g+2,3*v+2)}v-s<u-v?(Kg(l,r,s,v),s=v+1):(Kg(l,r,v+1,u),u=v)}}function Jg(l,r,s){const u=l[r];l[r]=l[s],l[s]=u}Kt(sf,"FeaturePositionMap");class Jl{constructor(r){this.gl=r.gl,this.initialized=!1}fetchUniformLocation(r,s){return this.location||this.initialized||(this.location=this.gl.getUniformLocation(r,s),this.initialized=!0),!!this.location}set(r,s,u){throw new Error("Uniform#set() must be implemented by each concrete Uniform")}}class Hp extends Jl{constructor(r){super(r),this.current=0}set(r,s,u){this.fetchUniformLocation(r,s)&&this.current!==u&&(this.current=u,this.gl.uniform1i(this.location,u))}}class Ui extends Jl{constructor(r){super(r),this.current=0}set(r,s,u){this.fetchUniformLocation(r,s)&&this.current!==u&&(this.current=u,this.gl.uniform1f(this.location,u))}}class qa extends Jl{constructor(r){super(r),this.current=[0,0]}set(r,s,u){this.fetchUniformLocation(r,s)&&(u[0]===this.current[0]&&u[1]===this.current[1]||(this.current=u,this.gl.uniform2f(this.location,u[0],u[1])))}}class Wp extends Jl{constructor(r){super(r),this.current=[0,0,0]}set(r,s,u){this.fetchUniformLocation(r,s)&&(u[0]===this.current[0]&&u[1]===this.current[1]&&u[2]===this.current[2]||(this.current=u,this.gl.uniform3f(this.location,u[0],u[1],u[2])))}}class F2 extends Jl{constructor(r){super(r),this.current=[0,0,0,0]}set(r,s,u){this.fetchUniformLocation(r,s)&&(u[0]===this.current[0]&&u[1]===this.current[1]&&u[2]===this.current[2]&&u[3]===this.current[3]||(this.current=u,this.gl.uniform4ui(this.location,u[0],u[1],u[2],u[3])))}}class J0 extends Jl{constructor(r){super(r),this.current=[0,0,0,0]}set(r,s,u){this.fetchUniformLocation(r,s)&&(u[0]===this.current[0]&&u[1]===this.current[1]&&u[2]===this.current[2]&&u[3]===this.current[3]||(this.current=u,this.gl.uniform4f(this.location,u[0],u[1],u[2],u[3])))}}class Iw extends Jl{constructor(r){super(r),this.current=xr.transparent.toPremultipliedRenderColor(null)}set(r,s,u){this.fetchUniformLocation(r,s)&&(u.r===this.current.r&&u.g===this.current.g&&u.b===this.current.b&&u.a===this.current.a||(this.current=u,this.gl.uniform4f(this.location,u.r,u.g,u.b,u.a)))}}
24class ku extends Jl{constructor(r){super(r),this.current=new Float32Array(16)}set(r,s,u){if(!this.fetchUniformLocation(r,s))return;const f=this.current;if(u[12]!==f[12]||u[0]!==f[0])return f.set(u),void this.gl.uniformMatrix4fv(this.location,!1,f);for(let g=1;g<16;g++)if(u[g]!==f[g]){f.set(u),this.gl.uniformMatrix4fv(this.location,!1,f);break}}}class af extends Jl{constructor(r){super(r),this.current=new Float32Array(4)}set(r,s,u){if(!this.fetchUniformLocation(r,s))return;const f=this.current;for(let g=0;g<4;g++)if(u[g]!==f[g]){f.set(u),this.gl.uniformMatrix2fv(this.location,!1,f);break}}}function Ns(l){return[of(255*l.r,255*l.g),of(255*l.b,255*l.a)]}function Ld(l,r,s,u,f,g,v,x){return!!l&&(l.kind==="composite"||l.kind==="source"?l.evaluate(new Tr(0,{brightness:g,worldview:x}),r,s,f,u,v)==="none":l.value==="none")}class Qg{constructor(r,s,u,f){this.value=r,this.uniformNames=s.map(g=>`u_${g}`),this.type=u,this.context=f}setUniform(r,s,u,f,g){const v=f.constantOr(this.value);s.set(r,g,v instanceof xr?v.toPremultipliedRenderColor(this.lutExpression&&this.lutExpression.kind==="constant"&&this.lutExpression.value==="none"?null:this.context.lut):v)}getBinding(r,s){return this.type==="color"?new Iw(r):new Ui(r)}}class qp{constructor(r,s){this.uniformNames=s.map(u=>`u_${u}`),this.pattern=null,this.patternTransition=null,this.pixelRatio=1}setConstantPatternPositions(r,s){this.pixelRatio=r.pixelRatio||1,this.pattern=r.tl.concat(r.br),this.patternTransition=s?s.tl.concat(s.br):this.pattern}setUniform(r,s,u,f,g){let v=null;g!=="u_pattern"&&g!=="u_dash"||(v=this.pattern),g==="u_pattern_b"&&(v=this.patternTransition),g==="u_pixel_ratio"&&(v=this.pixelRatio),v&&s.set(r,g,v)}getBinding(r,s){return s==="u_pattern"||s==="u_pattern_b"||s==="u_dash"?new F2(r):new Ui(r)}}class Fc{constructor(r,s,u,f){this.expression=r,this.type=u,this.maxValue=0,this.paintVertexAttributes=s.map(g=>({name:`a_${g}`,type:"Float32",components:u==="color"?2:1,offset:0})),this.paintVertexArray=new f}populatePaintArray(r,s,u,f,g,v,x,w){const A=this.paintVertexArray.length,R=this.expression.kind==="composite"||this.expression.kind==="source"?this.expression.evaluate(new Tr(0,{brightness:v,worldview:w}),s,{},g,f,x):this.expression.kind==="constant"&&this.expression.value,M=Ld(this.lutExpression,s,{},f,g,v,x,w);this.paintVertexArray.resize(r),this._setPaintValue(A,r,R,M?null:this.context.lut)}updatePaintArray(r,s,u,f,g,v,x,w){const A=this.expression.kind==="composite"||this.expression.kind==="source"?this.expression.evaluate({zoom:0,brightness:x,worldview:w},u,f,void 0,g):this.expression.kind==="constant"&&this.expression.value,R=Ld(this.lutExpression,u,f,g,void 0,x,void 0,w);this._setPaintValue(r,s,A,R?null:this.context.lut)}_setPaintValue(r,s,u,f){if(this.type==="color"){const g=Ns(u.toPremultipliedRenderColor(f));for(let v=r;v<s;v++)this.paintVertexArray.emplace(v,g[0],g[1])}else{for(let g=r;g<s;g++)this.paintVertexArray.emplace(g,u);this.maxValue=Math.max(this.maxValue,Math.abs(u))}}upload(r){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=r.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.lutExpression&&this.lutExpression.kind!=="constant"&&(this.lutExpression.isStateDependent||!this.lutExpression.isLightConstant)||this.expression.kind!=="constant"&&(this.expression.isStateDependent||!this.expression.isLightConstant)))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Ql{constructor(r,s,u,f,g,v){this.expression=r,this.uniformNames=s.map(x=>`u_${x}_t`),this.type=u,this.useIntegerZoom=f,this.context=g,this.maxValue=0,this.paintVertexAttributes=s.map(x=>({name:`a_${x}`,type:"Float32",components:u==="color"?4:2,offset:0})),this.paintVertexArray=new v}populatePaintArray(r,s,u,f,g,v,x,w){const A=this.expression.evaluate(new Tr(this.context.zoom,{brightness:v,worldview:w}),s,{},g,f,x),R=this.expression.evaluate(new Tr(this.context.zoom+1,{brightness:v,worldview:w}),s,{},g,f,x),M=Ld(this.lutExpression,s,{},f,g,v,x,w),O=this.paintVertexArray.length;this.paintVertexArray.resize(r),this._setPaintValue(O,r,A,R,M?null:this.context.lut)}updatePaintArray(r,s,u,f,g,v,x,w){const A=this.expression.evaluate({zoom:this.context.zoom,brightness:x,worldview:w},u,f,void 0,g),R=this.expression.evaluate({zoom:this.context.zoom+1,brightness:x,worldview:w},u,f,void 0,g),M=Ld(this.lutExpression,u,f,g,void 0,x,void 0,w);
vendor: 7,815 bytes, line 24
24this._setPaintValue(r,s,A,R,M?null:this.context.lut)}_setPaintValue(r,s,u,f,g){if(this.type==="color"){const v=Ns(u.toPremultipliedRenderColor(g)),x=Ns(f.toPremultipliedRenderColor(g));for(let w=r;w<s;w++)this.paintVertexArray.emplace(w,v[0],v[1],x[0],x[1])}else{for(let v=r;v<s;v++)this.paintVertexArray.emplace(v,u,f);this.maxValue=Math.max(this.maxValue,Math.abs(u),Math.abs(f))}}upload(r){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=r.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent||!this.expression.isLightConstant))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(r,s,u,f,g){const v=this.useIntegerZoom?Math.floor(u.zoom):u.zoom,x=Ee(this.expression.interpolationFactor(v,this.context.zoom,this.context.zoom+1),0,1);s.set(r,g,x)}getBinding(r,s){return new Ui(r)}}class Xa{constructor(r,s,u,f,g){this.expression=r,this.layerId=g,this.paintVertexAttributes=(u==="array"?Cw:Yg).members;for(let v=0;v<s.length;++v);this.paintVertexArray=new f,this.paintTransitionVertexArray=new nf}populatePaintArray(r,s,u,f){const g=this.paintVertexArray.length;this.paintVertexArray.resize(r),this._setPaintValues(g,r,s.patterns&&s.patterns[this.layerId],u)}updatePaintArray(r,s,u,f,g,v,x){this._setPaintValues(r,s,u.patterns&&u.patterns[this.layerId],v)}_setPaintValues(r,s,u,f){if(!f||!u)return;const g=f[u[0]],v=f[u[1]];if(g){if(g){const{tl:x,br:w,pixelRatio:A}=g;for(let R=r;R<s;R++)this.paintVertexArray.emplace(R,x[0],x[1],w[0],w[1],A)}if(v){this.paintTransitionVertexArray.resize(this.paintVertexArray.length);const{tl:x,br:w}=v;for(let A=r;A<s;A++)this.paintTransitionVertexArray.emplace(A,x[0],x[1],w[0],w[1])}}}upload(r){const s=this.expression.isStateDependent||!this.expression.isLightConstant;this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer=r.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,s)),this.paintTransitionVertexArray&&this.paintTransitionVertexArray.length&&(this.paintTransitionVertexBuffer=r.createVertexBuffer(this.paintTransitionVertexArray,K0.members,s))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy(),this.paintTransitionVertexBuffer&&this.paintTransitionVertexBuffer.destroy()}}class Od{constructor(r,s,u=()=>!0){this.binders={},this._buffers=[],this.context=s;const f=[],g=r;for(const v in r.paint._values){const x=g.paint.get(v);if(v.endsWith("-use-theme")||!u(v)||!(x instanceof Au&&Eg(x.property.specification)))continue;const w=z2(v,r.type),A=x.value,R=x.property.specification.type,M=!!x.property.useIntegerZoom,O=v==="line-dasharray"||v.endsWith("pattern"),B=g.paint.get(`${v}-use-theme`),N=v==="line-dasharray"&&g.layout.get("line-cap").value.kind!=="constant"||B&&B.value.kind!=="constant";if(A.kind!=="constant"||N)if(A.kind==="source"||N||O){const G=Q0(v,R,"source");this.binders[v]=O?new Xa(A,w,R,G,r.id):new Fc(A,w,R,G),f.push(`/a_${v}`)}else{const G=Q0(v,R,"composite");this.binders[v]=new Ql(A,w,R,M,s,G),f.push(`/z_${v}`)}else this.binders[v]=O?new qp(A.value,w):new Qg(A.value,w,R,s),f.push(`/u_${v}`);B&&(this.binders[v].lutExpression=B.value)}this.cacheKey=f.sort().join("")}updateExpressions(r){const s=r;for(const u in this.binders){const f=this.binders[u];if(f instanceof Fc||f instanceof Ql||f instanceof Xa){const g=s.paint.get(u);f.expression=g.value}}}getMaxValue(r){const s=this.binders[r];return s instanceof Fc||s instanceof Ql?s.maxValue:0}populatePaintArrays(r,s,u,f,g,v,x,w){for(const A in this.binders){const R=this.binders[A];R.context=this.context,(R instanceof Fc||R instanceof Ql||R instanceof Xa)&&R.populatePaintArray(r,s,u,f,g,v,x,w)}}setConstantPatternPositions(r,s){for(const u in this.binders){const f=this.binders[u];f instanceof qp&&f.setConstantPatternPositions(r,s)}}getPatternTransitionVertexBuffer(r){const s=this.binders[r];return s instanceof Xa?s.paintTransitionVertexBuffer:null}updatePaintArrays(r,s,u,f,g,v,x,w,A,R){let M=!1;const O=Object.keys(r),B=O.length!==0&&!w,N=B?O:s.uniqueIds;this.context.lut=g.lut;for(const G in this.binders){const H=this.binders[G];if(H.context=this.context,(H instanceof Fc||H instanceof Ql||H instanceof Xa)&&H.expression&&H.expression.kind&&H.expression.kind!=="constant"&&(H.expression.isStateDependent===!0||H.expression.isLightConstant===!1)){const J=g.paint.get(G);H.expression=J.value;for(const re of N){const Q=r[re.toString()];s.eachPosition(re,(le,ue,he)=>{const Te=f.feature(le);H.updatePaintArray(ue,he,Te,Q,v,x,A,R)})}if(!B)for(const re of u.uniqueIds){const Q=r[re.toString()];u.eachPosition(re,(le,ue,he)=>{const Te=f.feature(le);H.updatePaintArray(ue,he,Te,Q,v,x,A,R)})}M=!0}}return M}defines(){const r=[];for(const s in this.binders){const u=this.binders[s];(u instanceof Qg||u instanceof qp)&&r.push(...u.uniformNames.map(f=>`#define HAS_UNIFORM_${f}`))}return r}getPaintVertexBuffers(){return this._buffers}getUniforms(r){const s=[];for(const u in this.binders){const f=this.binders[u];if(f instanceof Qg||f instanceof qp||f instanceof Ql)for(const g of f.uniformNames)s.push({name:g,property:u,binding:f.getBinding(r,g)})}return s}setUniforms(r,s,u,f,g){for(const{name:v,property:x,binding:w}of u)this.binders[x].setUniform(r,w,g,f.get(x),v)}updatePaintBuffers(){this._buffers=[];for(const r in this.binders){const s=this.binders[r];(s instanceof Fc||s instanceof Ql||s instanceof Xa)&&s.paintVertexBuffer&&this._buffers.push(s.paintVertexBuffer),s instanceof Xa&&s.paintTransitionVertexBuffer&&this._buffers.push(s.paintTransitionVertexBuffer)}}upload(r){for(const s in this.binders){const u=this.binders[s];(u instanceof Fc||u instanceof Ql||u instanceof Xa)&&u.upload(r)}this.updatePaintBuffers()}destroy(){for(const r in this.binders){const s=this.binders[r];(s instanceof Fc||s instanceof Ql||s instanceof Xa)&&s.destroy()}}}class Ea{constructor(r,s,u=()=>!0){this.programConfigurations={};for(const f of r)this.programConfigurations[f.id]=new Od(f,s,u);this.needsUpload=!1,this._featureMap=new sf,this._featureMapWithoutIds=new sf,this._bufferOffset=0,this._idlessCounter=0}populatePaintArrays(r,s,u,f,g,v,x,w,A){for(const R in this.programConfigurations)this.programConfigurations[R].populatePaintArrays(r,s,f,g,v,x,w,A);s.id!==void 0?this._featureMap.add(s.id,u,this._bufferOffset,r):(this._featureMapWithoutIds.add(this._idlessCounter,u,this._bufferOffset,r),this._idlessCounter+=1),this._bufferOffset=r,this.needsUpload=!0}updatePaintArrays(r,s,u,f,g,v,x,w){for(const A of u)this.needsUpload=this.programConfigurations[A.id].updatePaintArrays(r,this._featureMap,this._featureMapWithoutIds,s,A,f,g,v,x||0,w)||this.needsUpload}get(r){return this.programConfigurations[r]}upload(r){if(this.needsUpload){for(const s in this.programConfigurations)this.programConfigurations[s].upload(r);this.needsUpload=!1}}destroy(){for(const r in this.programConfigurations)this.programConfigurations[r].destroy()}updateExpressions(r){const s=new Set;for(const u of r){const f=this.programConfigurations[u.id];f&&(f.updateExpressions(u),s.add(u.id))}for(const u in this.programConfigurations)s.has(u)||delete this.programConfigurations[u]}}const B2={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-occlusion-opacity":["occlusion_opacity"],"icon-occlusion-opacity":["occlusion_opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-emissive-strength":["emissive_strength"],"icon-emissive-strength":["emissive_strength"],"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"],"symbol-z-offset":["z_offset"],"line-gap-width":["ga
24pwidth"],"line-pattern":["pattern","pixel_ratio","pattern_b"],"fill-pattern":["pattern","pixel_ratio","pattern_b"],"fill-extrusion-pattern":["pattern","pixel_ratio","pattern_b"],"line-dasharray":["dash"],"fill-bridge-guard-rail-color":["structure_color"],"fill-tunnel-structure-color":["structure_color"]};function z2(l,r){return B2[l]||[l.replace(`${r}-`,"").replace(/-/g,"_")]}const N2={"line-pattern":{source:Pu,composite:Pu},"fill-pattern":{source:Pu,composite:Pu},"fill-extrusion-pattern":{source:Pu,composite:Pu},"line-dasharray":{source:nf,composite:nf}},V2={color:{source:Ru,composite:Oc},number:{source:Zo,composite:Ru}};function Q0(l,r,s){const u=N2[l];return u&&u[s]||V2[r][s]}Kt(Qg,"ConstantBinder"),Kt(qp,"PatternConstantBinder"),Kt(Fc,"SourceExpressionBinder",{omit:["expression"]}),Kt(Xa,"PatternCompositeBinder",{omit:["expression"]}),Kt(Ql,"CompositeExpressionBinder",{omit:["expression"]}),Kt(Od,"ProgramConfiguration",{omit:["_buffers"]}),Kt(Ea,"ProgramConfigurationSet");const as=Bt/Math.PI/2,lf=64,e_=[lf,32,16],Ca=-as,Za=as;function Mu(l,r,s,u=as){return s=ae(s),[l*Math.sin(s)*u,-r*u,l*Math.cos(s)*u]}function ec(l,r,s){return Mu(Math.cos(ae(l)),Math.sin(ae(l)),r,s)}const Dd=63710088e-1,ev=2*Math.PI*Dd;class wr{constructor(r,s){if(isNaN(r)||isNaN(s))throw new Error(`Invalid LngLat object: (${r}, ${s})`);if(this.lng=+r,this.lat=+s,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new wr(Et(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(r){const s=Math.PI/180,u=this.lat*s,f=r.lat*s,g=Math.sin(u)*Math.sin(f)+Math.cos(u)*Math.cos(f)*Math.cos((r.lng-this.lng)*s);return Dd*Math.acos(Math.min(g,1))}toBounds(r=0){const s=360*r/40075017,u=s/Math.cos(Math.PI/180*this.lat);return new Lu({lng:this.lng-u,lat:this.lat-s},{lng:this.lng+u,lat:this.lat+s})}toEcef(r){return ec(this.lat,this.lng,as+r*as/Dd)}static convert(r){if(r instanceof wr)return r;if(Array.isArray(r)&&(r.length===2||r.length===3))return new wr(Number(r[0]),Number(r[1]));if(!Array.isArray(r)&&typeof r=="object"&&r!==null)return new wr(Number("lng"in r?r.lng:r.lon),Number(r.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>]")}}class Lu{constructor(r,s){r&&(s?this.setSouthWest(r).setNorthEast(s):Array.isArray(r)&&r.length===4?this.setSouthWest([r[0],r[1]]).setNorthEast([r[2],r[3]]):this.setSouthWest(r[0]).setNorthEast(r[1]))}setNorthEast(r){return this._ne=r instanceof wr?new wr(r.lng,r.lat):wr.convert(r),this}setSouthWest(r){return this._sw=r instanceof wr?new wr(r.lng,r.lat):wr.convert(r),this}extend(r){const s=this._sw,u=this._ne;let f,g;if(r instanceof wr)f=r,g=r;else{if(!(r instanceof Lu))return Array.isArray(r)?r.length===4||r.every(Array.isArray)?this.extend(Lu.convert(r)):this.extend(wr.convert(r)):typeof r=="object"&&r!==null&&Object.hasOwn(r,"lat")&&(Object.hasOwn(r,"lon")||Object.hasOwn(r,"lng"))?this.extend(wr.convert(r)):this;if(f=r._sw,g=r._ne,!f||!g)return this}return s||u?(s.lng=Math.min(f.lng,s.lng),s.lat=Math.min(f.lat,s.lat),u.lng=Math.max(g.lng,u.lng),u.lat=Math.max(g.lat,u.lat)):(this._sw=new wr(f.lng,f.lat),this._ne=new wr(g.lng,g.lat)),this}getCenter(){return new wr((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 wr(this.getWest(),this.getNorth())}getSouthEast(){return new wr(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(r){const{lng:s,lat:u}=wr.convert(r);let f=this._sw.lng<=s&&s<=this._ne.lng;return this._sw.lng>this._ne.lng&&(f=this._sw.lng>=s&&s>=this._ne.lng),this._sw.lat<=u&&u<=this._ne.lat&&f}static convert(r){if(r)return r instanceof Lu?r:new Lu(r)}}function Xp(l){return ev*Math.cos(l*Math.PI/180)}function Bc(l){return(180+l)/360}function tc(l){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+l*Math.PI/360)))/360}function Ps(l,r){return l/Xp(r)}function ia(l){return 360*l-180}function Mo(l){return 360/Math.PI*Math.atan(Math.exp((180-360*l)*Math.PI/180)
24)-90}function tv(l,r){return l*Xp(Mo(r))}const oa=85.051129;function Pw(l){return Math.cos(ae(Ee(l,-85.051129,oa)))}function Fd(l,r){const s=Ee(r,0,25.5),u=Math.pow(2,s);return Pw(l)*ev/(512*u)}function Rw(l){return 1/Math.cos(l*Math.PI/180)}function Aa(l,r=0){const s=Math.exp(Math.PI*(1-(l.y+r/Bt)/(1<<l.z)*2));return 80150034*s/(s*s+1)/Bt/(1<<l.z)}class ls{constructor(r,s,u=0){this.x=+r,this.y=+s,this.z=+u}static fromLngLat(r,s=0){const u=wr.convert(r);return new ls(Bc(u.lng),tc(u.lat),Ps(s,u.lat))}toLngLat(){return new wr(ia(this.x),Mo(this.y))}toAltitude(){return tv(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/ev*Rw(Mo(this.y))}}function nv(l,r,s,u,f,g,v,x,w){const A=(r+u)/2,R=(s+f)/2,M=new St(A,R);x(M),(function(O,B,N,G,H,J){const re=N-H,Q=G-J;return Math.abs((G-B)*re-(N-O)*Q)/Math.hypot(re,Q)})(M.x,M.y,g.x,g.y,v.x,v.y)>=w?(nv(l,r,s,A,R,g,M,x,w),nv(l,A,R,u,f,M,v,x,w)):l.push(v)}function kw(l,r,s){let u=l[0],f=u.x,g=u.y;r(u);const v=[u];for(let x=1;x<l.length;x++){const w=l[x],{x:A,y:R}=w;r(w),nv(v,f,g,A,R,u,w,r,s),f=A,g=R,u=w}return v}function cf(l,r,s,u){if(u(r,s)){const f=r.add(s)._mult(.5);cf(l,r,f,u),cf(l,f,s,u)}else l.push(s)}function U2(l,r){let s=l[0];const u=[s];for(let f=1;f<l.length;f++){const g=l[f];cf(u,s,g,r),s=g}return u}const rv=Math.pow(2,14)-1,Zp=-rv-1;function $2(l,r){const s=Math.round(l.x*r),u=Math.round(l.y*r);return l.x=Ee(s,Zp,rv),l.y=Ee(u,Zp,rv),(s<l.x||s>l.x+1||u<l.y||u>l.y+1)&&On("Geometry exceeds allowed extent, reduce your vector tile buffer size"),l}function sa(l,r,s){const u=l.loadGeometry(),f=l.extent,g=Bt/f;if(r&&s&&s.projection.isReprojectedInTileSpace){const v=1<<r.z,{scale:x,x:w,y:A,projection:R}=s,M=O=>{const B=ia((r.x+O.x/f)/v),N=Mo((r.y+O.y/f)/v),G=R.project(B,N);O.x=(G.x*x-w)*f,O.y=(G.y*x-A)*f};for(let O=0;O<u.length;O++)if(l.type!==1)u[O]=kw(u[O],M,1);else{const B=[];for(const N of u[O])N.x<0||N.x>=f||N.y<0||N.y>=f||(M(N),B.push(N));u[O]=B}}for(const v of u)for(const x of v)$2(x,g);return u}function Ya(l,r){return{type:l.type,id:l.id,properties:l.properties,geometry:r?sa(l):[]}}class Ou{constructor(r,s,u,f,g){this.properties={},this.extent=u,this.type=0,this.id=void 0,this._pbf=r,this._geometry=-1,this._keys=f,this._values=g,r.readFields(Mw,this,s)}loadGeometry(){const r=this._pbf;r.pos=this._geometry;const s=r.readVarint()+r.pos,u=[];let f,g=1,v=0,x=0,w=0;for(;r.pos<s;){if(v<=0){const A=r.readVarint();g=7&A,v=A>>3}if(v--,g===1||g===2)x+=r.readSVarint(),w+=r.readSVarint(),g===1&&(f&&u.push(f),f=[]),f&&f.push(new St(x,w));else{if(g!==7)throw new Error(`unknown command ${g}`);f&&f.push(f[0].clone())}}return f&&u.push(f),u}bbox(){const r=this._pbf;r.pos=this._geometry;const s=r.readVarint()+r.pos;let u=1,f=0,g=0,v=0,x=1/0,w=-1/0,A=1/0,R=-1/0;for(;r.pos<s;){if(f<=0){const M=r.readVarint();u=7&M,f=M>>3}if(f--,u===1||u===2)g+=r.readSVarint(),v+=r.readSVarint(),g<x&&(x=g),g>w&&(w=g),v<A&&(A=v),v>R&&(R=v);else if(u!==7)throw new Error(`unknown command ${u}`)}return[x,A,w,R]}toGeoJSON(r,s,u){const f=this.extent*Math.pow(2,u),g=this.extent*r,v=this.extent*s,x=this.loadGeometry();function w(O){return[360*(O.x+g)/f-180,360/Math.PI*Math.atan(Math.exp((1-2*(O.y+v)/f)*Math.PI))-90]}function A(O){return O.map(w)}let R;if(this.type===1){const O=[];for(const N of x)O.push(N[0]);const B=A(O);R=O.length===1?{type:"Point",coordinates:B[0]}:{type:"MultiPoint",coordinates:B}}else if(this.type===2){const O=x.map(A);R=O.length===1?{type:"LineString",coordinates:O[0]}:{type:"MultiLineString",coordinates:O}}else{if(this.type!==3)throw new Error("unknown feature type");{const O=(function(N){const G=N.length;if(G<=1)return[N];const H=[];let J,re;for(let Q=0;Q<G;Q++){const le=Lw(N[Q]);le!==0&&(re===void 0&&(re=le<0),re===le<0?(J&&H.push(J),J=[N[Q]]):J&&J.push(N[Q]))}return J&&H.push(J),H})(x),B=[];for(const N of O)B.push(N.map(A));R=B.length===1?{type:"Polygon",coordinates:B[0]}:{type:"MultiPolygon",coordinates:B}}}const M={type:"Feature",geometry:R,properties:this.properties};return this.id!=null&&(M.id=this.id),M}}function Mw(l,r,s){l===1?r.id=s.readVarint():l===2?(function(u,f){const g=u.readVarint()+u.pos;for(;u.pos<g;){const v=f._keys[u.readVarint()],x=f._values[u.readVarint()];f.properties[v]=x}})(s,r):l===3?r.type=s.readVarint():l===4&&(r._geometry=s.pos)}function Lw(l){let r=0;for(let s,u,f=0,g=l.length,v=g-1;f<g;v=f++)s=l[f],u=l[v],r+=(u.x-s.x)*(s.y+u.y);return r}Ou.types=["Unknown","Point","LineString","Polygon"];class Ow{constructor(r,s){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=r,this._keys=[],this._values=[],this._features=[],r.readFields(j2,this,s),this.length=this._features.length}feature(r){if(r<0||r>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[r];const s=this._pbf.readVarint()+this._pbf.pos;return new Ou(this._pbf,s,this.extent,this._keys,this._values)}}function j2(l,r,s){l===15?r.version=s.readVarint():l===1?r.name=s.readString():l===5?r.extent=s.readVarint():l===2?r._features.push(s.pos):l===3?r._keys.push(s.readString()):l===4&&r._values.push((function(u){let f=null;const g=u.readVarint()+u.pos;for(;u.pos<g;){const v=u.readVarint()>>3;f=v===1?u.readString():v===2?u.readFloat():v===3?u.readDouble():v===4?u.readVarint64():v===5?u.readVarint():v===6?u.readSVarint():v===7?u.readBoolean():null}if(f==null)throw new Error("unknown feature value");return f})(s))}class iv{constructor(r,s){this.layers=r.readFields(Dw,{},s)}}function Dw(l,r,s){if(l===3){const u=new Ow(s,s.readVarint()+s.pos);u.length&&(r[u.name]=u)}}const Bd="3d_elevation_id",Fw="level";
24class G2{constructor(){this._valid=!1}reset(r){return this.feature=r,this._valid=!0,this._geometry=r.loadGeometry(),this._geometry.length!==0&&this._geometry[0].length!==0||(this._valid=!1),this}geometry(r,s){return this._valid&&r(s(this._geometry)),this}require(r,s,u){return this.get(r,!0,s,u)}optional(r,s,u){return this.get(r,!1,s,u)}success(){return this._valid}get(r,s,u,f){const g=Object.hasOwn(this.feature.properties,r)?+this.feature.properties[r]:void 0;return this._valid&&g!==void 0&&!Number.isNaN(g)?u(f?f(g):g):s&&(this._valid=!1),this}}class Bw{constructor(r,s){this.featureFunc=r,this.vertexFunc=s}parseFeature(r,s,u){return this.featureFunc(r,s,u)}parseVertex(r,s,u){return this.vertexFunc(r,s,u)}}const H2=new Bw((l,r,s)=>l.reset(r).require(Bd,u=>{s.id=u}).optional("fixed_height_relative",u=>{s.constantHeight=u},nc.decodeRelativeHeight).geometry(u=>{s.bounds=u},qy).success(),(l,r,s)=>l.reset(r).require(Bd,u=>{s.id=u}).require("elevation_idx",u=>{s.idx=u}).require("extent",u=>{s.extent=u}).require("height_relative",u=>{s.height=u},nc.decodeRelativeHeight).geometry(u=>{s.position=u},nc.getPoint).success()),W2=new Bw((l,r,s)=>l.reset(r).require(Bd,u=>{s.id=u}).optional("fixed_height",u=>{s.constantHeight=u},nc.decodeMetricHeight).geometry(u=>{s.bounds=u},qy).success(),(l,r,s)=>l.reset(r).require(Bd,u=>{s.id=u}).require("elevation_idx",u=>{s.idx=u}).require("extent",u=>{s.extent=u}).require("height",u=>{s.height=u},nc.decodeMetricHeight).geometry(u=>{s.position=u},nc.getPoint).success());class nc{static getPoint(r){return ar(r[0][0].x,r[0][0].y)}static decodeRelativeHeight(r){return 1e-4*r*5}static decodeMetricHeight(r){return 1e-4*r}static getVersionSchema(r){return r?r==="1.0.1"?W2:void 0:H2}static parse(r){const s=[],u=[],f=r.length,g=new G2;for(let v=0;v<f;v++){const x=r.feature(v),w=x.properties.version,A=nc.getVersionSchema(w);if(A===void 0){On(`Unknown elevation feature version number ${w||"(unknown)"}`);continue}const R=x.properties.type;if(!R)continue;const M=Ou.types[x.type];if(M==="Point"&&R==="curve_point"){const O={};A.parseVertex(g,x,O)&&s.push(O)}else if(M==="Polygon"&&R==="curve_meta"){const O={};A.parseFeature(g,x,O)&&u.push(O)}}return{vertices:s,features:u}}}class ov{constructor(r,s){this.pos=r,this.dir=s}intersectsPlane(r,s,u){const f=Js(s,this.dir);if(Math.abs(f)<1e-6)return!1;const g=((r[0]-this.pos[0])*s[0]+(r[1]-this.pos[1])*s[1])/f;return u[0]=this.pos[0]+this.dir[0]*g,u[1]=this.pos[1]+this.dir[1]*g,!0}}class sv{constructor(r,s){this.pos=r,this.dir=s}intersectsPlane(r,s,u){const f=Bn(s,this.dir);if(Math.abs(f)<1e-6)return!1;const g=((r[0]-this.pos[0])*s[0]+(r[1]-this.pos[1])*s[1]+(r[2]-this.pos[2])*s[2])/f;return u[0]=this.pos[0]+this.dir[0]*g,u[1]=this.pos[1]+this.dir[1]*g,u[2]=this.pos[2]+this.dir[2]*g,!0}closestPointOnSphere(r,s,u){if((function(B,N){var G=B[0],H=B[1],J=B[2],re=N[0],Q=N[1],le=N[2];return Math.abs(G-re)<=E*Math.max(1,Math.abs(G),Math.abs(re))&&Math.abs(H-Q)<=E*Math.max(1,Math.abs(H),Math.abs(Q))&&Math.abs(J-le)<=E*Math.max(1,Math.abs(J),Math.abs(le))})(this.pos,r)||s===0)return u[0]=u[1]=u[2]=0,!1;const[f,g,v]=this.dir,x=this.pos[0]-r[0],w=this.pos[1]-r[1],A=this.pos[2]-r[2],R=f*f+g*g+v*v,M=2*(x*f+w*g+A*v),O=M*M-4*R*(x*x+w*w+A*A-s*s);if(O<0){const B=Math.max(-M/2,0),N=x+f*B,G=w+g*B,H=A+v*B,J=Math.hypot(N,G,H);return u[0]=N*s/J,u[1]=G*s/J,u[2]=H*s/J,!1}{const B=(-M-Math.sqrt(O))/(2*R);if(B<0){const N=Math.hypot(x,w,A);return u[0]=x*s/N,u[1]=w*s/N,u[2]=A*s/N,!1}return u[0]=x+f*B,u[1]=w+g*B,u[2]=A+v*B,!0}}}class Ka{constructor(r,s,u,f,g){this.TL=r,this.TR=s,this.BR=u,this.BL=f,this.horizon=g}static fromInvProjectionMatrix(r,s,u){const f=[-1,1,1],g=[1,1,1],v=[1,-1,1],x=[-1,-1,1],w=mt(f,f,r),A=mt(g,g,r),R=mt(v,v,r),M=mt(x,x,r);return new Ka(w,A,R,M,s/u)}}function Yp(l,r,s,u){const f=r[0],g=r[1],v=r[2],x=s[0],w=s[1],A=s[2];let R=1/0,M=-1/0;for(let O=0;O<l.length;O++){const B=l[O],N=(B[0]-f)*x+(B[1]-g)*w+(B[2]-v)*A;N<R&&(R=N),N>M&&(M=N)}return u[0]=R,u[1]=M,u}function av(l,r){let s=!0;for(let u=0;u<l.planes.length;u++){const f=l.planes[u];let g=0;for(let v=0;v<r.length;v++)g+=+(Bn(f,r[v])+f[3]>=0);if(g===0)return 0;g!==r.length&&(s=!1)}return s?2:1}const q2=[0,0];function zw(l,r){for(const s of l.projections){const u=Yp(r,l.points[0],s.axis,q2);if(s.projection[1]<u[0]||s.projection[0]>u[1])return 0}return 1}function Nw(l,r){const s=r[0],u=r[1],f=r[2],g=r[3];for(let v=0;v<l.length;v++){const x=l[v];
vendor: 6,553 bytes, line 24
24if(s*x[0]+u*x[1]+f*x[2]+g>=0)return!0}return!1}class lv{constructor(r,s){this.points=r||new Array(8).fill([0,0,0]),this.planes=s||new Array(6).fill([0,0,0,0]),this.bounds=pi.fromPoints(this.points),this.projections=[],this.frustumEdges=[tt([],this.points[2],this.points[3]),tt([],this.points[0],this.points[3]),tt([],this.points[4],this.points[0]),tt([],this.points[5],this.points[1]),tt([],this.points[6],this.points[2]),tt([],this.points[7],this.points[3])];for(const u of this.frustumEdges){const f=[0,-u[2],u[1]],g=[u[2],0,-u[0]];this.projections.push({axis:f,projection:Yp(this.points,this.points[0],f,[0,0])}),this.projections.push({axis:g,projection:Yp(this.points,this.points[0],g,[0,0])})}}static fromInvProjectionMatrix(r,s,u,f){const g=Math.pow(2,u),v=[[-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(A=>{const R=mn([],A,r),M=1/R[3]/s*g;return(O=R)[0]=(B=R)[0]*(N=[M,M,f?1/R[3]:M,M])[0],O[1]=B[1]*N[1],O[2]=B[2]*N[2],O[3]=B[3]*N[3],O;var O,B,N}),x=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(A=>{const R=_n([],Be([],tt([],v[A[0]],v[A[1]]),tt([],v[A[2]],v[A[1]]))),M=-Bn(R,v[A[1]]);return R.concat(M)}),w=[];for(let A=0;A<v.length;A++)w.push([v[A][0],v[A][1],v[A][2]]);return new lv(w,x)}intersectsPrecise(r,s,u){for(let w=0;w<s.length;w++)if(!Nw(r,s[w]))return 0;for(let w=0;w<this.planes.length;w++)if(!Nw(r,this.planes[w]))return 0;const f=this.points,g=f[0][0],v=f[0][1],x=f[0][2];for(const w of u)for(const A of this.frustumEdges){const R=w[1]*A[2]-w[2]*A[1],M=w[2]*A[0]-w[0]*A[2],O=w[0]*A[1]-w[1]*A[0];if(R===0&&M===0&&O===0)continue;let B=1/0,N=-1/0;for(let J=0;J<f.length;J++){const re=f[J],Q=(re[0]-g)*R+(re[1]-v)*M+(re[2]-x)*O;Q<B&&(B=Q),Q>N&&(N=Q)}let G=1/0,H=-1/0;for(let J=0;J<r.length;J++){const re=r[J],Q=(re[0]-g)*R+(re[1]-v)*M+(re[2]-x)*O;Q<G&&(G=Q),Q>H&&(H=Q)}if(B>H||G>N)return 0}return 1}containsPoint(r){for(const s of this.planes){const u=s[3];if(Bn([s[0],s[1],s[2]],r)+u<0)return!1}return!0}}class pi{static fromPoints(r){const s=[1/0,1/0,1/0],u=[-1/0,-1/0,-1/0];for(const f of r)Vn(s,s,f),Ln(u,u,f);return new pi(s,u)}static fromTileIdAndHeight(r,s,u){const f=1<<r.canonical.z,g=r.canonical.x,v=r.canonical.y;return new pi([g/f,v/f,s],[(g+1)/f,(v+1)/f,u])}static applyTransform(r,s){const u=r.getCorners();for(let f=0;f<u.length;++f)mt(u[f],u[f],s);return pi.fromPoints(u)}static applyTransformFast(r,s){const u=[s[12],s[13],s[14]],f=[...u];for(let g=0;g<3;g++)for(let v=0;v<3;v++){const x=s[4*v+g],w=x*r.min[v],A=x*r.max[v];u[g]+=Math.min(w,A),f[g]+=Math.max(w,A)}return new pi(u,f)}static projectAabbCorners(r,s){const u=r.getCorners();for(let f=0;f<u.length;++f)mt(u[f],u[f],s);return u}constructor(r,s){this.min=r,this.max=s,this.center=Yn([],sn([],this.min,this.max),.5)}quadrant(r){const s=[r%2==0,r<2],u=jt(this.min),f=jt(this.max);for(let g=0;g<s.length;g++)u[g]=s[g]?this.min[g]:this.center[g],f[g]=s[g]?this.center[g]:this.max[g];return f[2]=this.max[2],new pi(u,f)}distanceX(r){return Math.max(Math.min(this.max[0],r[0]),this.min[0])-r[0]}distanceY(r){return Math.max(Math.min(this.max[1],r[1]),this.min[1])-r[1]}distanceZ(r){return Math.max(Math.min(this.max[2],r[2]),this.min[2])-r[2]}getCorners(){const r=this.min,s=this.max;return[[r[0],r[1],r[2]],[s[0],r[1],r[2]],[s[0],s[1],r[2]],[r[0],s[1],r[2]],[r[0],r[1],s[2]],[s[0],r[1],s[2]],[s[0],s[1],s[2]],[r[0],s[1],s[2]]]}intersects(r){return this.intersectsAabb(r.bounds)?av(r,this.getCorners()):0}intersectsFlat(r){return this.intersectsAabb(r.bounds)?av(r,[[this.min[0],this.min[1],0],[this.max[0],this.min[1],0],[this.max[0],this.max[1],0],[this.min[0],this.max[1],0]]):0}intersectsPrecise(r,s){return s||this.intersects(r)?zw(r,this.getCorners()):0}intersectsPreciseFlat(r,s){return s||this.intersectsFlat(r)?zw(r,[[this.min[0],this.min[1],0],[this.max[0],this.min[1],0],[this.max[0],this.max[1],0],[this.min[0],this.max[1],0]]):0}intersectsAabb(r){for(let s=0;s<3;++s)if(this.min[s]>r.max[s]||r.min[s]>this.max[s])return!1;return!0}intersectsAabbXY(r){return!(this.min[0]>r.max[0]||r.min[0]>this.max[0]||this.min[1]>r.max[1]||r.min[1]>this.max[1])}encapsulate(r){for(let s=0;s<3;s++)this.min[s]=Math.min(this.min[s],r.min[s]),this.max[s]=Math.max(this.max[s],r.max[s])}encapsulatePoint(r){for(let s=0;s<3;s++)this.min[s]=Math.min(this.min[s],r[s]),this.max[s]=Math.max(this.max[s],r[s])}closestPoint(r){return[Math.max(Math.min(this.max[0],r[0]),this.min[0]),Math.max(Math.min(this.max[1],r[1]),this.min[1]),Math.max(Math.min(this.max[2],r[2]),this.min[2])]}}Kt(pi,"Aabb");class cv{constructor(r,s){this.feature=r,this.metersToTile=s,this.index=0}get(){const r=this.feature.vertices[this.index],s=this.feature.vertexProps[this.index].dir,u=s[1],f=-s[0],g=(r.extent+1)*this.metersToTile;return[new St(Math.trunc(r.position[0]+u*g),Math.trunc(r.position[1]+f*g)),new St(Math.trunc(r.position[0]-u*g),Math.trunc(r.position[1]-f*g))]}next(){this.index++}valid(){return this.index<this.feature.vertices.length}}class Vw{constructor(r,s,u,f,g,v){if(this.vertices=new Array,this.vertexProps=new Array,this.edges=new Array,this.edgeProps=new Array,this._tmpVec2=[Lr(),Lr(),Lr(),Lr(),Lr(),Lr(),Lr()],this.id=r,this.heightRange={min:u,max:u},this.safeArea=s,this.constantHeight=u,this.constantHeight==null&&(this.constantHeight!=null||f.length!==0)){this.vertices=f,this.edges=g,this.edges=this.edges.filter(x=>{return x.a<this.vertices.length&&x.b<this.vertices.length&&!((w=this.vertices[x.a].position)[0]===(A=this.vertices[x.b].position)[0]&&w[1]===A[1]);var w,A}),this.heightRange={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};for(const x of this.vertices)this.vertexProps.push({dir:ar(0,0)}),this.heightRange.min=Math.min(this.heightRange.min,x.height),this.heightRange.max=Math.max(this.heightRange.max,x.height);for(const x of this.edges){const w=this.vertices[x.a].position,A=this.vertices[x.b].position,R=ms(Lr(),A,w),M=xc(R),O=Ks(Lr(),R,1/M);this.edgeProps.push({vec:R,dir:O,len:M});const B=this.vertexProps[x.a].dir,N=this.vertexProps[x.b].dir;ro(B,B,O),ro(N,N,O)}for(const x of this.vertexProps)x.dir[0]===0&&x.dir[1]===0||wc(x.dir,x.dir);this.tessellate(v)}}pointElevation(r){if(this.constantHeight!=null)return this.constantHeight;const s=this.getClosestEdge(r);if(s==null)return 0;const[u,f]=s;return Sn(this.vertices[this.edges[u].a].height,this.vertices[this.edges[u].b].height,f)}computeSlopeNormal(r,s){const u=this.getClosestEdge(r);if(!u)return Wt(0,0,1);const f=u[0],g=this.edges[f],v=this.edgeProps[f].vec,x=Wt(v[0],v[1],(this.vertices[g.b].height-this.vertices[g.a
24].height)*s),w=Wt(x[1],-x[0],0);Be(w,w,x);const A=Zt(w);return A>0?Yn(w,w,1/A):en(w,0,0,1)}getSafeArea(){return this.safeArea}isTunnel(){return this.heightRange.max<=-5}getClosestEdge(r){if(this.edges.length===0)return;let s=0,u=Number.POSITIVE_INFINITY,f=0;const[g,v,x,w,A,R,M]=this._tmpVec2;nr(M,r.x,r.y);const O=new ov(M,null);for(let B=0;B<this.edges.length;B++){const N=this.edges[B],G=this.edgeProps[B].dir;O.dir=G;const H=this.vertices[N.a].position,J=this.vertices[N.b].position,re=O.intersectsPlane(H,this.vertexProps[N.a].dir,g),Q=O.intersectsPlane(J,this.vertexProps[N.b].dir,v);if(!re||!Q)continue;ms(x,v,g),ms(w,M,g);const le=Js(x,x),ue=le>0?Js(w,x)/le:0,he=Ee(ue,0,1),Te=Math.abs((ue-he)*this.edgeProps[B].len);ms(A,M,H),nr(R,G[1],-G[0]);const me=Te+Math.abs(Js(A,R));me<u&&(s=B,u=me,f=he)}return[s,f]}tessellate(r){const s=zt(),u=zt(),f=zt(),g=zt();for(let v=this.edges.length-1;v>=0;--v){const x=this.edges[v].a,w=this.edges[v].b,{position:A,height:R,extent:M}=this.vertices[x],{position:O,height:B,extent:N}=this.vertices[w],G=this.vertexProps[x].dir,H=this.vertexProps[w].dir;if(en(s,A[0]/r,A[1]/r,R),en(u,O[0]/r,O[1]/r,B),en(f,G[1],-G[0],0),Yn(f,f,M),en(g,H[1],-H[0],0),Yn(g,g,N),this.distSqLines(Wt(s[0]+.5*f[0],s[1]+.5*f[1],s[2]+.5*f[2]),Wt(u[0]-.5*g[0],u[1]-.5*g[1],u[2]-.5*g[2]),Wt(s[0]-.5*f[0],s[1]-.5*f[1],s[2]-.5*f[2]),Wt(u[0]+.5*g[0],u[1]+.5*g[1],u[2]+.5*g[2]))<=.0025000000000000005)continue;const J=this.vertices.length,re=ro(Lr(),A,O);this.vertices.push({position:Ks(re,re,.5),height:.5*(R+B),extent:.5*(M+N)});const Q=ro(Lr(),G,H);this.vertexProps.push({dir:wc(Q,Q)}),this.edges.splice(v,1),this.edgeProps.splice(v,1),this.edges.push({a:x,b:J}),this.edges.push({a:J,b:w});const le=ms(Lr(),this.vertices[J].position,A),ue=xc(le),he={vec:le,dir:Ks(Lr(),le,1/ue),len:ue};this.edgeProps.push(he),this.edgeProps.push(he)}}distSqLines(r,s,u,f){const g=Mn(zt(),s,r),v=Mn(zt(),f,u),x=Mn(zt(),r,u),w=Bn(g,g),A=Bn(g,v),R=Bn(g,x),M=Bn(v,v),O=Bn(v,x),B=w*M-A*A;if(B===0)return fn(Xe(g,u,f,Bn(x,v)/Bn(v,v)),r);const N=(w*O-A*R)/B;return fn(Xe(g,r,s,(A*O-R*M)/B),Xe(v,u,f,N))}}class p{static parseFrom(r,s){const u=nc.parse(r);if(!u)return[];let{vertices:f,features:g}=u;const v=1/Aa(s);g.sort((R,M)=>R.id-M.id),f.sort((R,M)=>R.id-M.id||R.idx-M.idx),f=f.filter((R,M,O)=>M===O.findIndex(B=>B.id===R.id&&B.idx===R.idx));const x=new Array;let w=0;const A=f.length;for(const R of g){if(R.constantHeight){x.push(new Vw(R.id,R.bounds,R.constantHeight));continue}for(;w!==A&&f[w].id<R.id;)w++;if(w===A||f[w].id!==R.id)continue;const M=new Array,O=new Array,B=w;for(;w!==A&&f[w].id===R.id;){const N=f[w];if(M.push({position:N.position,height:N.height,extent:N.extent}),w!==B&&f[w-1].idx===N.idx-1){const G=w-B;O.push({a:G-1,b:G})}w++}x.push(new Vw(R.id,R.bounds,void 0,M,O,v))}return x}static getElevationFeature(r,s){if(!s)return;const u=+r.properties[Bd];return Number.isNaN(u)?void 0:s.find(f=>f.id===u)}}class o{constructor(r,s){this.zScale=1,this.xOffset=0,this.yOffset=0,r.equals(s)||(this.zScale=Math.pow(2,s.z-r.z),this.xOffset=(r.x*this.zScale-s.x)*Bt,this.yOffset=(r.y*this.zScale-s.y)*Bt)}constantElevation(r,s){if(r.constantHeight!=null)return this.computeBiasedHeight(r.constantHeight,s)}pointElevation(r,s,u){const f=this.constantElevation(s,u);return f??(r.x=r.x*this.zScale+this.xOffset,r.y=r.y*this.zScale+this.yOffset,this.computeBiasedHeight(s.pointElevation(r),u))}computeBiasedHeight(r,s){return s<=0?r:r+s*We(0,s,r>=0?r:Math.abs(.5*r))}}function d(l){if(l===0)return[0,0,0];const r=d0(l);return[r(),r(),r()]}Kt(Vw,"ElevationFeature");class _{constructor(r){this.zoom=r.zoom,this.overscaling=r.overscaling,this.layers=r.layers,this.layerIds=this.layers.map(s=>s.fqid),this.index=r.index,this.hasPattern=!1,this.projection=r.projection,this.layoutVertexArray=new Ha,this.indexArray=new _i,this.segments=new Wr,this.programConfigurations=new Ea(r.layers,{zoom:r.zoom,lut:r.lut}),this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id),this.elevationMode=this.layers[0].layout.get("circle-elevation-reference"),this.hasElevation=!1,this.elevationMode!=="none"&&(this.elevatedLayoutVertexArray=new Zo),this.worldview=r.worldview,this.hasAppearances=null}updateFootprints(r,s){}updateAppearances(r,s,u,f){return{hasLayoutChanges:!1,hasUboChanges:!1}}populate(r,s,u,f){const g=this.layers[0],v=[];let x=null;
24g.type==="circle"&&(x=g.layout.get("circle-sort-key"));for(const{feature:A,id:R,index:M,sourceLayerIndex:O}of r){const B=this.layers[0]._featureFilter.needGeometry,N=Ya(A,B);if(!this.layers[0]._featureFilter.filter(new Tr(this.zoom,{worldview:this.worldview,activeFloors:s.activeFloors}),N,u))continue;const G=x?x.evaluate(N,{},u):void 0,H={id:R,properties:A.properties,type:A.type,sourceLayerIndex:O,index:M,geometry:B?N.geometry:sa(A,u,f),patterns:{},sortKey:G};v.push(H)}x&&v.sort((A,R)=>A.sortKey-R.sortKey);let w=null;f.projection.name==="globe"&&(this.globeExtVertexArray=new Gg,w=f.projection);for(const A of v){const{geometry:R,index:M,sourceLayerIndex:O}=A,B=r[M].feature;this.addFeature(A,R,M,s.availableImages,u,w,s.brightness,s.elevationFeatures),s.featureIndex.insert(B,R,M,O,this.index)}this.hasElevation||(this.elevatedLayoutVertexArray=void 0)}update(r,s,u,f,g,v,x){this.programConfigurations.updatePaintArrays(r,s,g,u,f,v,x,this.worldview)}updateExpressions(r){this.programConfigurations.updateExpressions(r)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(r){this.uploaded||(this.layoutVertexBuffer=r.createVertexBuffer(this.layoutVertexArray,L2.members),this.indexBuffer=r.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=r.createVertexBuffer(this.globeExtVertexArray,D2.members)),this.elevatedLayoutVertexArray&&(this.elevatedLayoutVertexBuffer=r.createVertexBuffer(this.elevatedLayoutVertexArray,O2.members))),this.programConfigurations.upload(r),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy(),this.elevatedLayoutVertexBuffer&&this.elevatedLayoutVertexBuffer.destroy())}addFeature(r,s,u,f,g,v,x,w){let A;this.elevationMode!=="none"&&(A=p.getElevationFeature(r,w));for(const R of s)for(const M of R){const O=M.x,B=M.y;if(O<0||O>=Bt||B<0||B>=Bt)continue;if(v){const H=v.projectTilePoint(O,B,g),J=v.upVector(g,O,B);this.addGlobeExtVertex(H,J),this.addGlobeExtVertex(H,J),this.addGlobeExtVertex(H,J),this.addGlobeExtVertex(H,J)}const N=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,r.sortKey),G=N.vertexLength;if(this.addCircleVertex(O,B,-1,-1),this.addCircleVertex(O,B,1,-1),this.addCircleVertex(O,B,1,1),this.addCircleVertex(O,B,-1,1),this.elevationMode!=="none"){const H=A?A.pointElevation(new St(O,B)):0;this.hasElevation=this.hasElevation||H!==0;for(let J=0;J<4;J++)this.elevatedLayoutVertexArray.emplaceBack(H)}this.indexArray.emplaceBack(G,G+1,G+2),this.indexArray.emplaceBack(G,G+2,G+3),N.vertexLength+=4,N.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,r,u,{},f,g,x,void 0,this.worldview)}addCircleVertex(r,s,u,f){this.layoutVertexArray.emplaceBack(2*r+(u+1)/2,2*s+(f+1)/2)}addGlobeExtVertex(r,s){this.globeExtVertexArray.emplaceBack(r.x,r.y,r.z,s[0]*16384,s[1]*16384,s[2]*16384)}}function b(l,r){for(let s=0;s<l.length;s++)if(ee(r,l[s]))return!0;for(let s=0;s<r.length;s++)if(ee(l,r[s]))return!0;return!!k(l,r)}function S(l,r,s){return!!ee(l,r)||!!j(r,l,s)}function T(l,r){if(l.length===1)return te(r,l[0]);for(let s=0;s<r.length;s++){const u=r[s];for(let f=0;f<u.length;f++)if(ee(l,u[f]))return!0}for(let s=0;s<l.length;s++)if(te(r,l[s]))return!0;for(let s=0;s<r.length;s++)if(k(l,r[s]))return!0;return!1}function I(l,r,s){if(l.length>1){if(k(l,r))return!0;for(let u=0;u<r.length;u++)if(j(r[u],l,s))return!0}for(let u=0;u<l.length;u++)if(j(l[u],r,s))return!0;return!1}function k(l,r){if(l.length===0||r.length===0)return!1;for(let s=0;s<l.length-1;s++){const u=l[s],f=l[s+1];for(let g=0;g<r.length-1;g++)if(F(u,f,r[g],r[g+1]))return!0}return!1}function F(l,r,s,u){return br(l,s,u)!==br(r,s,u)&&br(l,r,s)!==br(l,r,u)}function z(l,r,s){return(l.x-s.x)*(r.y-s.y)-(l.y-s.y)*(r.x-s.x)}function q(l,r,s,u){const f=z(l,r,u),g=z(l,r,s);if(Math.sign(f)===Math.sign(g))return;const v=z(s,u,l),x=v+g-f;return Math.sign(v)!==Math.sign(x)?[v/(v-x),g/(g-f)]:void 0}function j(l,r,s){const u=s*s;if(r.length===1)return l.distSqr(r[0])<u;for(let f=1;f<r.length;f++)if(Z(l,r[f-1],r[f])<u)return!0;return!1}function Z(l,r,s){const u=r.distSqr(s);if(u===0)return l.distSqr(r);const f=((l.x-r.x)*(s.x-r.x)+(l.y-r.y)*(s.y-r.y))/u;return l.distSqr(f<0?r:f>1?s:s.sub(r)._mult(f)._add(r))}function te(l,r){let s,u,f,g=!1;for(let v=0;v<l.length;v++){s=l[v];for(let x=0,w=s.length-1;x<s.length;w=x++)u=s[x],f=s[w],u.y>r.y!=f.y>r.y&&r.x<(f.x-u.x)*(r.y-u.y)/(f.y-u.y)+u.x&&(g=!g)}return g}function ee(l,r){let s=!1;for(let u=0,f=l.length-1;u<l.length;f=u++){const g=l[u],v=l[f];
vendor: 5,087 bytes, line 24
24g.y>r.y!=v.y>r.y&&r.x<(v.x-g.x)*(r.y-g.y)/(v.y-g.y)+g.x&&(s=!s)}return s}function oe(l,r,s,u,f){for(const v of l)if(r<=v.x&&s<=v.y&&u>=v.x&&f>=v.y)return!0;const g=[new St(r,s),new St(r,f),new St(u,f),new St(u,s)];if(l.length>2){for(const v of g)if(ee(l,v))return!0}for(let v=0;v<l.length-1;v++)if(se(l[v],l[v+1],g))return!0;return!1}function se(l,r,s){const u=s[0],f=s[2];if(l.x<u.x&&r.x<u.x||l.x>f.x&&r.x>f.x||l.y<u.y&&r.y<u.y||l.y>f.y&&r.y>f.y)return!1;const g=br(l,r,s[0]);return g!==br(l,r,s[1])||g!==br(l,r,s[2])||g!==br(l,r,s[3])}function de(l,r,s,u,f,g){let v=r.y-l.y,x=l.x-r.x;if(g=g||0){const w=v*v+x*x;if(w===0)return!0;const A=Math.sqrt(w);v/=A,x/=A}return!((s.x-l.x)*v+(s.y-l.y)*x-g<0||(u.x-l.x)*v+(u.y-l.y)*x-g<0||(f.x-l.x)*v+(f.y-l.y)*x-g<0)}function pe(l,r,s,u,f,g,v){return!(de(l,r,u,f,g,v)||de(r,s,u,f,g,v)||de(s,l,u,f,g,v)||de(u,f,l,r,s,v)||de(f,g,l,r,s,v)||de(g,u,l,r,s,v))}function ce(l,r,s){const u=r.paint.get(l).value;return u.kind==="constant"?u.value:s.programConfigurations.get(r.id).getMaxValue(l)}function Ce(l){return Math.sqrt(l[0]*l[0]+l[1]*l[1])}function Se(l,r,s,u,f){if(!r[0]&&!r[1])return l;const g=St.convert(r)._mult(f);s==="viewport"&&g._rotate(-u);const v=[];for(let x=0;x<l.length;x++)v.push(l[x].sub(g));return v}function Re(l,r,s,u){const f=St.convert(l)._mult(u);return r==="viewport"&&f._rotate(-s),f}let ve,be;Kt(_,"CircleBucket",{omit:["layers"]});class Ae{constructor(r,s,u){this.z=r,this.x=s,this.y=u,this.key=Ye(0,r,r,s,u)}equals(r){return this.z===r.z&&this.x===r.x&&this.y===r.y}isChildOf(r){const s=this.z-r.z;return r.z===0||r.z<this.z&&r.x===this.x>>s&&r.y===this.y>>s}url(r,s){const u=(function(g,v,x){const w=2**x,A=2*Math.PI*6378137,R=A*(g/w-.5),M=A*(.5-(v+1)/w);return`${R},${M},${R+A/w},${M+A/w}`})(this.x,this.y,this.z),f=(function(g,v,x){let w,A="";for(let R=g;R>0;R--)w=1<<R-1,A+=(v&w?1:0)+(x&w?2:0);return A})(this.z,this.x,this.y);return r[(this.x+this.y)%r.length].replace("{prefix}",(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(s==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",f).replace("{bbox-epsg-3857}",u)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Ne{constructor(r,s){this.wrap=r,this.canonical=s,this.key=Ye(r,s.z,s.z,s.x,s.y)}}class De{constructor(r,s,u,f,g){this.overscaledZ=r,this.wrap=s,this.canonical=new Ae(u,+f,+g),this.key=s===0&&r===u?this.canonical.key:Ye(s,r,u,f,g)}equals(r){return this.overscaledZ===r.overscaledZ&&this.wrap===r.wrap&&this.canonical.equals(r.canonical)}scaledTo(r){const s=this.canonical.z-r;return r>this.canonical.z?new De(r,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new De(r,this.wrap,r,this.canonical.x>>s,this.canonical.y>>s)}calculateScaledKey(r,s=!0){if(this.overscaledZ===r&&s)return this.key;if(r>this.canonical.z)return Ye(this.wrap*+s,r,this.canonical.z,this.canonical.x,this.canonical.y);{const u=this.canonical.z-r;return Ye(this.wrap*+s,r,r,this.canonical.x>>u,this.canonical.y>>u)}}isChildOf(r){if(r.wrap!==this.wrap)return!1;const s=this.canonical.z-r.canonical.z;return r.overscaledZ===0||r.overscaledZ<this.overscaledZ&&r.canonical.z<this.canonical.z&&r.canonical.x===this.canonical.x>>s&&r.canonical.y===this.canonical.y>>s}children(r){if(this.overscaledZ>=r)return[new De(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const s=this.canonical.z+1,u=2*this.canonical.x,f=2*this.canonical.y;return[new De(s,this.wrap,s,u,f),new De(s,this.wrap,s,u+1,f),new De(s,this.wrap,s,u,f+1),new De(s,this.wrap,s,u+1,f+1)]}isLessThan(r){return this.wrap<r.wrap||!(this.wrap>r.wrap)&&(this.overscaledZ<r.overscaledZ||!(this.overscaledZ>r.overscaledZ)&&(this.canonical.x<r.canonical.x||!(this.canonical.x>r.canonical.x)&&this.canonical.y<r.canonical.y))}wrapped(){return new De(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(r){return new De(this.overscaledZ,r,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Ne(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}}function Ye(l,r,s,u,f){const g=1<<Math.min(s,22);let v=g*(f%g)+u%g;return l&&s<22&&(v+=g*g*((l<0?-2*l-1:2*l)%(1<<2*(22-s)))),16*(32*v+s)+(r-s)}const Ke=[l=>{let r=l.canonical.x-1,s=l.wrap;return r<0&&(r=(1<<l.canonical.z)-1,s--),new De(l.overscaledZ,s,l.canonical.z,r,l.canonical.y)},l=>{let r=l.canonical.x+1,s=l.wrap;return r===1<<l.canonical.z&&(r=0,s++),new De(l.overscaledZ,s,l.canonical.z,r,l.canonical.y)},l=>new De(l.overscaledZ,l.wrap,l.canonical.z,l.canonical.x,(l.canonical.y===0?1<<l.canonical.z:l.canonical.y)-1),l=>new De(l.overscaledZ,l.wrap,l.canonical.z,l.canonical.x,l.canonical.y===(1<<l.canonical.z)-1?0:l.canonical.y+1)];Kt(Ae,"CanonicalTileID"),Kt(De,"OverscaledTileID",{omit:["projMatrix","expandedProjMatrix"]});const Tt=Jn([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:Ue}
vendor: 5,349 bytes, line 24
24=Tt,rt=Jn([{name:"a_pos_3",components:3,type:"Int16"}]);var $e=Jn([{name:"a_pos",type:"Int16",components:2}]);function ct(l){return l*as/Dd}const at=[new pi([Ca,Ca,Ca],[Za,Za,Za]),new pi([Ca,Ca,Ca],[0,0,Za]),new pi([0,Ca,Ca],[Za,0,Za]),new pi([Ca,0,Ca],[0,Za,Za]),new pi([0,0,Ca],[Za,Za,Za])];function dt(l,r,s,u=!0){const f=Yn([],l._camera.position,l.worldSize),g=[r,s,1,1];mn(g,g,l.pixelMatrixInverse),st(g,g,1/g[3]);const v=_n([],tt([],g,f)),x=l.globeMatrix,w=[x[12],x[13],x[14]],A=tt([],w,f),R=Zt(A),M=_n([],A),O=l.worldSize/(2*Math.PI),B=Bn(M,v),N=Math.asin(O/R);if(N<Math.acos(B)){if(!u)return null;const _e=[],we=[];Yn(_e,v,R/B),_n(we,tt(we,_e,A)),_n(v,sn(v,A,Yn(v,we,Math.tan(N)*R)))}const G=[];new sv(f,v).closestPointOnSphere(w,O,G);const H=_n([],Xi(x,0)),J=_n([],Xi(x,1)),re=_n([],Xi(x,2)),Q=Bn(H,G),le=Bn(J,G),ue=Bn(re,G),he=ge(Math.asin(-le/O));let Te=ge(Math.atan2(Q,ue));Te=l.center.lng+(function(_e,we){const je=(we-_e+180)%360-180;return je<-180?je+360:je})(l.center.lng,Te);const me=Bc(Te),xe=Ee(tc(he),0,1);return new ls(me,xe)}class Gt{constructor(r,s,u){this.a=tt([],r,u),this.b=tt([],s,u),this.center=u;const f=_n([],this.a),g=_n([],this.b);this.angle=Math.acos(Bn(f,g))}}function Mt(l,r){if(l.angle===0)return null;let s;return s=l.a[r]===0?1/l.angle*.5*Math.PI:1/l.angle*Math.atan(l.b[r]/l.a[r]/Math.sin(l.angle)-1/Math.tan(l.angle)),s<0||s>1?null:(function(u,f,g,v){const x=Math.sin(g);return u*(Math.sin((1-v)*g)/x)+f*(Math.sin(v*g)/x)})(l.a[r],l.b[r],l.angle,Ee(s,0,1))+l.center[r]}function Ct(l){if(l.z<=1)return at[l.z+2*l.y+l.x];const r=bn(tn(l));return pi.fromPoints(r)}function xt(l,r,s){return Yn(l,l,1-s),Rn(l,l,r,s)}function dn(l,r){const s=Fr(r.zoom);if(s===0)return Ct(l);const u=tn(l),f=bn(u),g=Bc(u.getWest())*r.worldSize,v=Bc(u.getEast())*r.worldSize,x=tc(u.getNorth())*r.worldSize,w=tc(u.getSouth())*r.worldSize,A=[g,x,0],R=[v,x,0],M=[g,w,0],O=[v,w,0],B=Y([],r.globeMatrix);return mt(A,A,B),mt(R,R,B),mt(M,M,B),mt(O,O,B),f[0]=xt(f[0],M,s),f[1]=xt(f[1],O,s),f[2]=xt(f[2],R,s),f[3]=xt(f[3],A,s),pi.fromPoints(f)}function an(l,r,s){for(const u of l)mt(u,u,r),Yn(u,u,s)}function Jt(l,r,s,u){const f=r/l.worldSize,g=l.globeMatrix;if(s.z<=1){const xe=Ct(s).getCorners();return an(xe,g,f),pi.fromPoints(xe)}const v=tn(s,u),x=bn(v,as+ct(l._tileCoverLift));an(x,g,f);const w=Number.MAX_VALUE,A=[-w,-w,-w],R=[w,w,w];if(v.contains(l.center)){for(const we of x)Vn(R,R,we),Ln(A,A,we);A[2]=0;const xe=l.point,_e=[xe.x*f,xe.y*f,0];return Vn(R,R,_e),Ln(A,A,_e),new pi(R,A)}if(l._tileCoverLift>0){for(const xe of x)Vn(R,R,xe),Ln(A,A,xe);return new pi(R,A)}const M=[g[12]*f,g[13]*f,g[14]*f],O=v.getCenter(),B=Ee(l.center.lat,-85.051129,oa),N=Ee(O.lat,-85.051129,oa),G=Bc(l.center.lng),H=tc(B);let J=G-Bc(O.lng);const re=H-tc(N);J>.5?J-=1:J<-.5&&(J+=1);let Q=0;Math.abs(J)>Math.abs(re)?Q=J>=0?1:3:(Q=re>=0?0:2,Rn(M,M,[g[4]*f,g[5]*f,g[6]*f],-Math.sin(ae(re>=0?v.getSouth():v.getNorth()))*as));const le=x[Q],ue=x[(Q+1)%4],he=new Gt(le,ue,M),Te=[Mt(he,0)||le[0],Mt(he,1)||le[1],Mt(he,2)||le[2]],me=Fr(l.zoom);if(me>0){const xe=(function({x:we,y:je,z:He},Qe,it,nt,bt){const Ze=1/(1<<He);let et=we*Ze,ot=et+Ze,ft=je*Ze,_t=ft+Ze,Ft=0;const ut=(et+ot)/2-nt;return ut>.5?Ft=-1:ut<-.5&&(Ft=1),et=((et+Ft)*Qe-(nt*=Qe))*it+nt,ot=((ot+Ft)*Qe-nt)*it+nt,ft=(ft*Qe-(bt*=Qe))*it+bt,_t=(_t*Qe-bt)*it+bt,[[et,_t,0],[ot,_t,0],[ot,ft,0],[et,ft,0]]})(s,r,l._pixelsPerMercatorPixel,G,H);for(let we=0;we<x.length;we++)xt(x[we],xe[we],me);const _e=sn([],xe[Q],xe[(Q+1)%4]);Yn(_e,_e,.5),xt(Te,_e,me)}for(const xe of x)Vn(R,R,xe),Ln(A,A,xe);return R[2]=Math.min(le[2],ue[2]),Vn(R,R,Te),Ln(A,A,Te),new pi(R,A)}function tn({x:l,y:r,z:s},u=!1){const f=1/(1<<s),g=new wr(ia(l*f),r===(1<<s)-1&&u?-90:Mo((r+1)*f)),v=new wr(ia((l+1)*f),r===0&&u?90:Mo(r*f));return new Lu(g,v)}function bn(l,r=as){const s=ae(l.getNorth()),u=ae(l.getSouth()),f=Math.cos(s),g=Math.cos(u),v=Math.sin(s),x=Math.sin(u),w=l.getWest(),A=l.getEast();return[Mu(g,x,w,r),Mu(g,x,A,r),Mu(f,v,A,r),Mu(f,v,w,r)]}function kn(l,r,s,u){const f=1<<s.z,g=(l/Bt+s.x)/f;return ec(Mo((r/Bt+s.y)/f),ia(g),u)}function Pn({min:l,max:r}){return 16383/Math.max(r[0]-l[0],r[1]-l[1],r[2]-l[2])}const jn=new Float64Array(16);function An(l){const r=Pn(l),s=qe(jn,[r,r,r]);return K(s,s,Cn([],l.min))}function or(l){const r=1/Pn(l);return Fe(jn,l.min),ne(jn,jn,[r,r,r])}function Fn(l){const r=Bt/(2*Math.PI);return l/(2*Math.PI)/r}function fr(l,r){return Bt/(512*Math.pow(2,l))*Pn(Ct(r))}function Or(l,r,s,u,f){const g=Fn(s),v=[l,r,-s/(2*Math.PI)],x=$(new Float64Array(16));return K(x,x,v),ne(x,x,[g,g,g]),fe(x,x,ae(-f)),ye(x,x,ae(-u)),x}function Fr(l){return We(5,6,l)}function zr(l,r){const s=ec(r.lat,r.lng),u=(function(N){const G=ec(N._center.lat,N._center.lng);let H=Be([],Wt(0,1,0),G);const J=lt([],-N.angle,G);H=mt(H,H,J),lt(J,-N._pitch,H);const re=_n([],G);return Yn(re,re,ct(N.cameraToCenterDistance/N.pixelsPerMeter)),mt(re,re,J),sn([],G,re)})(l);return v=(f=Mn([],u,s))[0],x=f[1],w=f[2],A=(g=s)[0],R=g[1],M=g[2],B=(O=Math.sqrt((v*v+x*x+w*w)*(A*A+R*R+M*M)))&&Bn(f,g)/O,Math.acos(Math.min(Math.max(B,-1),1));var f,g,v,x,w,A,R,M,O,B}function yr(l,r){return zr(l,r)>Math.PI/2*1.01}const Gn=ae(85),Xn=Math.cos(Gn),Nr=Math.sin(Gn),Si=U(),kr=l=>{const r=[];return l.paint.get("circle-pitch-alignment")==="map"&&r.push("PITCH_WITH_MAP"),l.paint.get("circle-pitch-scale")==="map"&&r.push("SCALE_WITH_MAP"),r};
24function Dn(l,r,s,u,f,g,v,x,w){if(g&&l.queryGeometry.isAboveHorizon)return!1;g&&(w*=l.pixelToTileUnitsFactor);const A=l.tileID.canonical,R=s.projection.upVectorScale(A,s.center.lat,s.worldSize).metersToTile;for(const M of r)for(const O of M){const B=O.add(x),N=f&&s.elevation?s.elevation.exaggeration()*f.getElevationAt(B.x,B.y,!0):0,G=s.projection.projectTilePoint(B.x,B.y,A);if(N>0){const Q=s.projection.upVector(A,B.x,B.y);G.x+=Q[0]*R*N,G.y+=Q[1]*R*N,G.z+=Q[2]*R*N}const H=g?B:ri(G.x,G.y,G.z,u),J=g?l.tilespaceRays.map(Q=>lr(Q,N)):l.queryGeometry.screenGeometry,re=mn([],[G.x,G.y,G.z,1],u);if(!v&&g?w*=re[3]/s.cameraToCenterDistance:v&&!g&&(w*=s.cameraToCenterDistance/re[3]),g){const Q=Mo((O.y/Bt+A.y)/(1<<A.z));w/=s.projection.pixelsPerMeter(Q,1)/Ps(1,Q)}if(S(J,H,w))return!0}return!1}function ri(l,r,s,u){const f=mn([],[l,r,s,1],u);return new St(f[0]/f[3],f[1]/f[3])}const $r=Wt(0,0,0),Ii=Wt(0,0,1);function lr(l,r){const s=zt();return $r[2]=r,l.intersectsPlane($r,Ii,s),new St(s[0],s[1])}class $i extends _{}let Yo,fo,Lo,io;function Rs(l,{width:r,height:s},u,f){if(f){if(f instanceof Uint8ClampedArray)f=new Uint8Array(f.buffer);else if(f.length!==r*s*u)throw new RangeError("mismatched image size")}else f=new Uint8Array(r*s*u);return l.width=r,l.height=s,l.data=f,l}function ks(l,r,s){const{width:u,height:f}=r;u===l.width&&f===l.height||(Yi(l,r,{x:0,y:0},{x:0,y:0},{width:Math.min(l.width,u),height:Math.min(l.height,f)},s,null),l.width=u,l.height=f,l.data=r.data)}function Yi(l,r,s,u,f,g,v,x){if(f.width===0||f.height===0)return r;if(f.width>l.width||f.height>l.height||s.x>l.width-f.width||s.y>l.height-f.height)throw new RangeError("out of range source coordinates for image copy");if(f.width>r.width||f.height>r.height||u.x>r.width-f.width||u.y>r.height-f.height)throw new RangeError("out of range destination coordinates for image copy");const w=l.data,A=r.data,R=g===4&&x;for(let M=0;M<f.height;M++){const O=((s.y+M)*l.width+s.x)*g,B=((u.y+M)*r.width+u.x)*g;if(R)for(let N=0;N<f.width;N++){const G=O+N*g+3,H=B+N*g;A[H+0]=255,A[H+1]=255,A[H+2]=255,A[H+3]=w[G]}else if(v)for(let N=0;N<f.width;N++){const G=O+N*g,H=B+N*g,J=new xr(w[G+0]/255,w[G+1]/255,w[G+2]/255,w[G+3]).toNonPremultipliedRenderColor(v).toArray();A[H+0]=J[0],A[H+1]=J[1],A[H+2]=J[2],A[H+3]=J[3]}else for(let N=0;N<f.width*g;N++)A[B+N]=w[O+N]}return r}Kt($i,"HeatmapBucket",{omit:["layers"]});class cs{constructor(r,s){Rs(this,r,1,s)}resize(r){ks(this,new cs(r),1)}clone(){return new cs({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(r,s,u,f,g){Yi(r,s,u,f,g,1,null)}}class vr{constructor(r,s){Rs(this,r,4,s)}resize(r){ks(this,new vr(r),4)}replace(r,s){s?this.data.set(r):this.data=r instanceof Uint8ClampedArray?new Uint8Array(r.buffer):r}clone(){return new vr({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(r,s,u,f,g,v,x){Yi(r,s,u,f,g,4,v,x)}}class Dr{constructor(r,s){this.width=r.width,this.height=r.height,this.data=s instanceof Uint8Array?new Float32Array(s.buffer):s}}function Er(l){const r={},s=l.resolution||256,u=l.clips?l.clips.length:1,f=l.image||new vr({width:s,height:u}),g=(v,x,w)=>{r[l.evaluationKey]=w;const A=l.expression.evaluate(r),R=A?A.toNonPremultipliedRenderColor(null):null;R&&(f.data[v+x+0]=Math.floor(255*R.r),f.data[v+x+1]=Math.floor(255*R.g),f.data[v+x+2]=Math.floor(255*R.b),f.data[v+x+3]=Math.floor(255*R.a))};if(l.clips)for(let v=0,x=0;v<u;++v,x+=4*s)for(let w=0,A=0;w<s;w++,A+=4){const R=w/(s-1),{start:M,end:O}=l.clips[v];g(x,A,M*(1-R)+O*R)}else for(let v=0,x=0;v<s;v++,x+=4)g(0,x,v/(s-1));return f}Kt(cs,"AlphaImage"),Kt(vr,"RGBAImage");const ji=Jn([{name:"a_pos",components:2,type:"Int16"}],4),To=Jn([{name:"a_road_z_offset",components:1,type:"Float32"}],4),Ti=Jn([{name:"a_pos",components:2,type:"Int16"},{name:"a_height",components:1,type:"Float32"}],4),ys=Jn([{name:"a_pos_normal_3",components:3,type:"Int16"}],4);function vs(l,r,s=2){const u=r&&r.length,f=u?r[0]*s:l.length;let g=xl(l,0,f,s,!0);const v=[];if(!g||g.next===g.prev)return v;let x,w,A;if(u&&(g=(function(R,M,O,B){const N=[];for(let G=0,H=M.length;G<H;G++){const J=xl(R,M[G]*B,G<H-1?M[G+1]*B:R.length,B,!1);J===J.next&&(J.steiner=!0),N.push(X2(J))}N.sort(zd);for(let G=0;G<N.length;G++)O=uv(N[G],O);return O})(l,r,g,s)),l.length>80*s){x=l[0],w=l[1];let R=x,M=w;for(let O=s;O<f;O+=s){const B=l[O],N=l[O+1];B<x&&(x=B),N<w&&(w=N),B>R&&(R=B),N>M&&(M=N)}A=Math.max(R-x,M-w),A=A!==0?32767/A:0}return Ia(g,v,s,x,w,A,0),v}function xl(l,r,s,u,f){let g;if(f===(function(v,x,w,A){let R=0;for(let M=x,O=w-A;M<w;M+=A)R+=(v[O]-v[M])*(v[M+1]+v[O+1]),O=M;return R})(l,r,s,u)>0)for(let v=r;v<s;v+=u)g=GL(v/u|0,l[v],l[v+1],g);else for(let v=s-u;v>=r;v-=u)g=GL(v/u|0,l[v],l[v+1],g);return g&&n_(g,g.next)&&(pv(g),g=g.next),g}function aa(l,r){if(!l)return l;r||(r=l);let s,u=l;
24do if(s=!1,u.steiner||!n_(u,u.next)&&Oo(u.prev,u,u.next)!==0)u=u.next;else{if(pv(u),u=r=u.prev,u===u.next)break;s=!0}while(s||u!==r);return r}function Ia(l,r,s,u,f,g,v){if(!l)return;!v&&g&&(function(w,A,R,M){let O=w;do O.z===0&&(O.z=t_(O.x,O.y,A,R,M)),O.prevZ=O.prev,O.nextZ=O.next,O=O.next;while(O!==w);O.prevZ.nextZ=null,O.prevZ=null,(function(B){let N,G=1;do{let H,J=B;B=null;let re=null;for(N=0;J;){N++;let Q=J,le=0;for(let he=0;he<G&&(le++,Q=Q.nextZ,Q);he++);let ue=G;for(;le>0||ue>0&&Q;)le!==0&&(ue===0||!Q||J.z<=Q.z)?(H=J,J=J.nextZ,le--):(H=Q,Q=Q.nextZ,ue--),re?re.nextZ=H:B=H,H.prevZ=re,re=H;J=Q}re.nextZ=null,G*=2}while(N>1)})(O)})(l,u,f,g);let x=l;for(;l.prev!==l.next;){const w=l.prev,A=l.next;if(g?wl(l,u,f,g):zc(l))r.push(w.i,l.i,A.i),pv(l),l=A.next,x=A.next;else if((l=A)===x){v?v===1?Ia(l=Kp(aa(l),r),r,s,u,f,g,2):v===2&&Du(l,r,s,u,f,g):Ia(aa(l),r,s,u,f,g,1);break}}}function zc(l){const r=l.prev,s=l,u=l.next;if(Oo(r,s,u)>=0)return!1;const f=r.x,g=s.x,v=u.x,x=r.y,w=s.y,A=u.y,R=Math.min(f,g,v),M=Math.min(x,w,A),O=Math.max(f,g,v),B=Math.max(x,w,A);let N=u.next;for(;N!==r;){if(N.x>=R&&N.x<=O&&N.y>=M&&N.y<=B&&hv(f,x,g,w,v,A,N.x,N.y)&&Oo(N.prev,N,N.next)>=0)return!1;N=N.next}return!0}function wl(l,r,s,u){const f=l.prev,g=l,v=l.next;if(Oo(f,g,v)>=0)return!1;const x=f.x,w=g.x,A=v.x,R=f.y,M=g.y,O=v.y,B=Math.min(x,w,A),N=Math.min(R,M,O),G=Math.max(x,w,A),H=Math.max(R,M,O),J=t_(B,N,r,s,u),re=t_(G,H,r,s,u);let Q=l.prevZ,le=l.nextZ;for(;Q&&Q.z>=J&&le&&le.z<=re;){if(Q.x>=B&&Q.x<=G&&Q.y>=N&&Q.y<=H&&Q!==f&&Q!==v&&hv(x,R,w,M,A,O,Q.x,Q.y)&&Oo(Q.prev,Q,Q.next)>=0||(Q=Q.prevZ,le.x>=B&&le.x<=G&&le.y>=N&&le.y<=H&&le!==f&&le!==v&&hv(x,R,w,M,A,O,le.x,le.y)&&Oo(le.prev,le,le.next)>=0))return!1;le=le.nextZ}for(;Q&&Q.z>=J;){if(Q.x>=B&&Q.x<=G&&Q.y>=N&&Q.y<=H&&Q!==f&&Q!==v&&hv(x,R,w,M,A,O,Q.x,Q.y)&&Oo(Q.prev,Q,Q.next)>=0)return!1;Q=Q.prevZ}for(;le&&le.z<=re;){if(le.x>=B&&le.x<=G&&le.y>=N&&le.y<=H&&le!==f&&le!==v&&hv(x,R,w,M,A,O,le.x,le.y)&&Oo(le.prev,le,le.next)>=0)return!1;le=le.nextZ}return!0}function Kp(l,r){let s=l;do{const u=s.prev,f=s.next.next;!n_(u,f)&&$L(u,s,s.next,f)&&fv(u,f)&&fv(f,u)&&(r.push(u.i,s.i,f.i),pv(s),pv(s.next),s=l=f),s=s.next}while(s!==l);return aa(s)}function Du(l,r,s,u,f,g){let v=l;do{let x=v.next.next;for(;x!==v.prev;){if(v.i!==x.i&&VG(v,x)){let w=jL(v,x);return v=aa(v,v.next),w=aa(w,w.next),Ia(v,r,s,u,f,g,0),void Ia(w,r,s,u,f,g,0)}x=x.next}v=v.next}while(v!==l)}function zd(l,r){let s=l.x-r.x;return s===0&&(s=l.y-r.y,s===0)&&(s=(l.next.y-l.y)/(l.next.x-l.x)-(r.next.y-r.y
24)/(r.next.x-r.x)),s}function uv(l,r){const s=(function(f,g){let v=g;const x=f.x,w=f.y;let A,R=-1/0;if(n_(f,v))return v;do{if(n_(f,v.next))return v.next;if(w<=v.y&&w>=v.next.y&&v.next.y!==v.y){const G=v.x+(w-v.y)*(v.next.x-v.x)/(v.next.y-v.y);if(G<=x&&G>R&&(R=G,A=v.x<v.next.x?v:v.next,G===x))return A}v=v.next}while(v!==g);if(!A)return null;const M=A,O=A.x,B=A.y;let N=1/0;v=A;do{if(x>=v.x&&v.x>=O&&x!==v.x&&UL(w<B?x:R,w,O,B,w<B?R:x,w,v.x,v.y)){const G=Math.abs(w-v.y)/(x-v.x);fv(v,f)&&(G<N||G===N&&(v.x>A.x||v.x===A.x&&dv(A,v)))&&(A=v,N=G)}v=v.next}while(v!==M);return A})(l,r);if(!s)return r;const u=jL(s,l);return aa(u,u.next),aa(s,s.next)}function dv(l,r){return Oo(l.prev,l,r.prev)<0&&Oo(r.next,l,l.next)<0}function t_(l,r,s,u,f){return(l=1431655765&((l=858993459&((l=252645135&((l=16711935&((l=(l-s)*f|0)|l<<8))|l<<4))|l<<2))|l<<1))|(r=1431655765&((r=858993459&((r=252645135&((r=16711935&((r=(r-u)*f|0)|r<<8))|r<<4))|r<<2))|r<<1))<<1}function X2(l){let r=l,s=l;do(r.x<s.x||r.x===s.x&&r.y<s.y)&&(s=r),r=r.next;while(r!==l);return s}function UL(l,r,s,u,f,g,v,x){return(f-v)*(r-x)>=(l-v)*(g-x)&&(l-v)*(u-x)>=(s-v)*(r-x)&&(s-v)*(g-x)>=(f-v)*(u-x)}function hv(l,r,s,u,f,g,v,x){return!(l===v&&r===x)&&UL(l,r,s,u,f,g,v,x)}function VG(l,r){return l.next.i!==r.i&&l.prev.i!==r.i&&!(function(s,u){let f=s;do{if(f.i!==s.i&&f.next.i!==s.i&&f.i!==u.i&&f.next.i!==u.i&&$L(f,f.next,s,u))return!0;f=f.next}while(f!==s);return!1})(l,r)&&(fv(l,r)&&fv(r,l)&&(function(s,u){let f=s,g=!1;const v=(s.x+u.x)/2,x=(s.y+u.y)/2;do f.y>x!=f.next.y>x&&f.next.y!==f.y&&v<(f.next.x-f.x)*(x-f.y)/(f.next.y-f.y)+f.x&&(g=!g),f=f.next;while(f!==s);return g})(l,r)&&(Oo(l.prev,l,r.prev)||Oo(l,r.prev,r))||n_(l,r)&&Oo(l.prev,l,l.next)>0&&Oo(r.prev,r,r.next)>0)}function Oo(l,r,s){return(r.y-l.y)*(s.x-r.x)-(r.x-l.x)*(s.y-r.y)}function n_(l,r){return l.x===r.x&&l.y===r.y}function $L(l,r,s,u){const f=$w(Oo(l,r,s)),g=$w(Oo(l,r,u)),v=$w(Oo(s,u,l)),x=$w(Oo(s,u,r));return f!==g&&v!==x||!(f!==0||!Uw(l,s,r))||!(g!==0||!Uw(l,u,r))||!(v!==0||!Uw(s,l,u))||!(x!==0||!Uw(s,r,u))}function Uw(l,r,s){return r.x<=Math.max(l.x,s.x)&&r.x>=Math.min(l.x,s.x)&&r.y<=Math.max(l.y,s.y)&&r.y>=Math.min(l.y,s.y)}function $w(l){return l>0?1:l<0?-1:0}function fv(l,r){return Oo(l.prev,l,l.next)<0?Oo(l,r,l.next)>=0&&Oo(l,l.prev,r)>=0:Oo(l,r,l.prev)<0||Oo(l,l.next,r)<0}function jL(l,r){const s=Z2(l.i,l.x,l.y),u=Z2(r.i,r.x,r.y),f=l.next,g=r.prev;return l.next=r,r.prev=l,s.next=f,f.prev=s,u.next=s,s.prev=u,g.next=u,u.prev=g,u}function GL(l,r,s,u){const f=Z2(l,r,s);return u?(f.next=u.next,f.prev=u,u.next.prev=f,u.next=f):(f.prev=f,f.next=f),f}function pv(l){l.next.prev=l.prev,l.prev.next=l.next,l.prevZ&&(l.prevZ.nextZ=l.nextZ),l.nextZ&&(l.nextZ.prevZ=l.prevZ)}function Z2(l,r,s){return{i:l,x:r,y:s,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function mv(l,r){const s=l.length;if(s<=1)return[l];const u=[];let f,g;for(let v=0;v<s;v++){const x=si(l[v]);x!==0&&(l[v].area=Math.abs(x),g===void 0&&(g=x<0),g===x<0?(f&&u.push(f),f=[l[v]]):f.push(l[v]))}if(f&&u.push(f),r>1)for(let v=0;v<u.length;v++)u[v].length<=r||(_1(u[v],r,1,u[v].length-1,UG),u[v]=u[v].slice(0,r));return u}function UG(l,r){return r.area-l.area}function HL(l,r,s=1){if(!l)return null;const u=typeof l=="string"?_s.from(l).getPrimary():l.getPrimary(),f=typeof l=="string"?null:l.getSecondary();for(const g of[u,f]){if(!g)continue;const v=g.id.toString();r.has(v)||r.set(v,[]),g.scaleSelf(s),r.get(v).push(g)}return{primary:u.toString(),secondary:f?f.toString():null}}function Y2(l,r,s,u){const f=u.patternDependencies;let g=!1;for(const v of r){const x=v.paint.get(`${l}-pattern`);x.isConstant()||(g=!0),HL(x.constantOr(null),f,s)&&(g=!0)}return g}function K2(l,r,s,u,f,g){const v=g.patternDependencies;for(const x of r){const w=x.paint.get(`${l}-pattern`).value;if(w.kind!=="constant"){const A=HL(w.evaluate({zoom:u},s,{},void 0,g.availableImages),v,f);if(!A)continue;const{primary:R,secondary:M}=A;R&&(s.patterns[x.id]=[R,M].filter(Boolean))}}return s}class Nd{constructor(){this.portals=[]}static isOnBorder(r,s){return r<=0&&s<=0||r>=Bt&&s>=Bt}static evaluate(r){if(r.length===0)return new Nd;let s=[];for(const w of r)s.push(...w.portals);if(s.length===0)return new Nd;for(const w of s){const A=w.va,R=w.vb;(Nd.isOnBorder(A.x,R.x)||Nd.isOnBorder(A.y,R.y))&&(w.type="border")}const u=s.filter(w=>w.type!=="unevaluated"),f=s.filter(w=>w.type==="unevaluated");if(f.length===0)return new Nd;f.sort((w,A)=>w.hash===A.hash?w.isTunnel===A.isTunnel?0:w.isTunnel?-1:1:w.hash<A.hash?1:-1),s=u.concat(f);let g=u.length,v=g,x=g;do if(v++,v===s.length||s[g].hash!==s[v].hash){if(v-g===2){x<g&&(s[x]=s[g],s[g]=null);const w=s[x],A=s[v-1];w.type=w.isTunnel!==A.isTunnel?"tunnel":"polygon",w.connection={a:w.connection.a,b:A.connection.a},x++}g=v}while(g!==s.length);
24return s.splice(x),s.sort((w,A)=>w.hash<A.hash?1:-1),{portals:s}}}Kt(Nd,"ElevationPortalGraph");class $G{constructor(r,s,u){this.outPositions=r,this.outNormals=s,this.outIndices=u,this.vertexLookup=new Map}addVertex(r,s,u){let f=r[2];u!=null&&(f*=u);const g=`${r[0]},${r[1]},${r[2]},${s[0]},${s[1]},${s[2]}`,v=this.vertexLookup.get(g);if(v!=null)return v;const x=this.outPositions.length;this.vertexLookup.set(g,x);const w=Math.trunc(16384*s[0]),A=Math.trunc(16384*s[1]),R=Math.trunc(16384*s[2]);return this.outPositions.emplaceBack(r[0],r[1],f),this.outNormals.emplaceBack(w,A,R),x}addTriangle(r,s,u){this.outIndices.emplaceBack(r,s,u)}addTriangles(r,s,u){if(r.length===0)return;const f=u.length===1,g=zt(),v=zt();for(let x=0;x<r.length;x+=3){const w=s[r[x+0]],A=s[r[x+1]],R=s[r[x+2]],M=f?u[0]:u[r[x+1]],O=f?u[0]:u[r[x+2]];en(g,w.x,w.y,f?u[0]:u[r[x+0]]);const B=this.addVertex(g,v);en(g,A.x,A.y,M);const N=this.addVertex(g,v);en(g,R.x,R.y,O);const G=this.addVertex(g,v);this.outIndices.emplaceBack(B,N,G)}}addQuad(r,s,u,f,g,v){const x=this.addVertex(r,g,v),w=this.addVertex(s,g,v),A=this.addVertex(u,g,v),R=this.addVertex(f,g,v);this.addTriangle(x,w,A),this.addTriangle(A,R,x)}getVertexCount(){return this.outPositions.length}clearVertexLookup(){this.vertexLookup.clear()}}class Pa{constructor(r,s,u,f){this.unevaluatedPortals=new Nd,this.bridgeFeatureSections=[],this.tunnelFeatureSections=[],this.vertexHashLookup=new Map,this.unevalVertices=[],this.unevalHeights=[],this.unevalTriangles=[],this.unevalTunnelTriangles=[],this.unevalEdges=[],this.vertexPositions=new jg,this.vertexNormals=new jp,this.indexArray=new _i,this.tileToMeters=Aa(r),this.bridgeProgramConfigurations=new Ea(s,{zoom:u,lut:f},g=>g!=="fill-tunnel-structure-color"),this.tunnelProgramConfigurations=new Ea(s,{zoom:u,lut:f},g=>g!=="fill-bridge-guard-rail-color")}addVertices(r,s){const u=this.unevalVertices.length;for(let f=0;f<r.length;f++)this.unevalVertices.push(r[f]),this.unevalHeights.push(s[f]);return u}addTriangles(r,s,u){const f=u?this.unevalTunnelTriangles:this.unevalTriangles;for(const g of r)f.push(g+s)}addRenderableRing(r,s,u,f,g,v){const x=[new St(g.min.x,g.min.y),new St(g.max.x,g.min.y),new St(g.max.x,g.max.y),new St(g.min.x,g.max.y)];for(let w=0;w<u-1;w++){const A=s+w,R=A+1,M=this.unevalVertices[A],O=this.unevalVertices[R];if(!(M.x>=g.min.x&&M.x<=g.max.x&&M.y>=g.min.y&&M.y<=g.max.y||O.x>=g.min.x&&O.x<=g.max.x&&O.y>=g.min.y&&O.y<=g.max.y||se(M,O,x))||this.isOnBorder(M.x,O.x)||this.isOnBorder(M.y,O.y))continue;const B=Pa.computeEdgeHash(this.unevalVertices[A],this.unevalVertices[R]);let N,G=this.vertexHashLookup.get(Pa.computePosHash(M));G!=null?N=G.next:(G=this.vertexHashLookup.get(Pa.computePosHash(O)),N=G!=null?G.prev:B),this.unevalEdges.push({polygonIdx:r,a:A,b:R,hash:B,portalHash:N,isTunnel:f,type:"unevaluated",featureInfo:v})}}addPortalCandidates(r,s,u,f,g){if(s.length!==0){this.vertexHashLookup.clear();for(const v of s){if(v.length===0)continue;const x=v[0];let w=Pa.computeEdgeHash(x[x.length-2],x.at(-1));for(let A=0;A<x.length-1;A++){const R=x[A+0],M=x[A+1],O=ar(M.x-R.x,M.y-R.y),B=xc(O);if(B===0)continue;let N="unevaluated";const G=f.pointElevation(R),H=f.pointElevation(M);Math.abs(G)<.01&&Math.abs(H)<.01?N="entrance":(this.isOnBorder(R.x,M.x)||this.isOnBorder(R.y,M.y))&&(N="border");const J=Pa.computeEdgeHash(R,M);this.unevaluatedPortals.portals.push({connection:{a:r,b:void 0},va:R,vb:M,vab:O,length:B,hash:J,isTunnel:u,type:N});const re=Pa.computePosHash(R);this.vertexHashLookup.set(re,{prev:w,next:J}),w=J}}}}construct(r){if(this.unevalVertices.length===0)return;const s=()=>({vertexOffset:0,primitiveOffset:this.indexArray.length}),u=O=>{O.primitiveLength=this.indexArray.length-O.primitiveOffset},f=new $G(this.vertexPositions,this.vertexNormals,this.indexArray);this.prepareEdges(r.portals,this.unevalEdges);const g=s(),v=s(),x=s(),w=(O,B)=>{O.sort((G,H)=>G.type===B&&H.type!==B?-1:G.type!==B&&H.type===B?1:0);const N=O.findIndex(G=>G.type!==B);return N>=0?N:O.length};let A=0;this.unevalEdges.length>0&&(A=w(this.unevalEdges,"none"),this.constructBridgeStructures(f,this.unevalVertices,this.unevalHeights,this.unevalEdges,{min:0,max:A},this.tileToMeters)),u(x);const R=s(),M=s();if(this.unevalEdges.length>0){const O=this.unevalEdges.splice(A),B=w(O,"tunnel")+A;this.unevalEdges.push(...O),this.constructTunnelStructures(f,this.unevalVertices,this.unevalHeights,this.unevalEdges,{min:0,max:A},{min:A,max:B})}u(R),f.addTriangles(this.unevalTriangles,this.unevalVertices,this.unevalHeights),u(M),f.addTriangles(this.unevalTunnelTriangles,this.unevalVertices,this.unevalHeights),u(v),f.addTriangles(this.unevalTunnelTriangles,this.unevalVertices,[-.1]),u(g),this.maskSegments=Wr.simpleSegment(0,M.primitiveOffset,0,M.primitiveLength),this.depthSegments=Wr.simpleSegment(0,v.primitiveOffset,0,v.primitiveLength),this.renderableBridgeSegments=Wr.simpleSegment(0,x.primitiveOffset,0,x.primitiveLength),this.renderableTunnelSegments=Wr.simpleSegment(0,R.primitiveOffset,0,R.primitiveLength),this.shadowCasterSegments=Wr.simpleSegment(0,g.primitiveOffset,0,g.primitiveLength)}update(r,s,u,f,g,v,x,w){this.bridgeProgramConfigurations.updatePaintArrays(r,s,g,u,f,v,x,w),this.tunnelProgramConfigurations.updatePaintArrays(r,s,g,u,f,v,x,w)}upload(r){this.vertexBuffer||this.vertexPositions.length===0||this.vertexNormals.length===0||this.indexArray.length===0||(this.vertexBuffer=r.createVertexBuffer(this.vertexPositions,Ti.members),this.vertexBufferNormal=r.createVertexBuffer(this.vertexNormals,ys.members),this.indexBuffer=r.createIndexBuffer(this.indexArray),this.bridgeProgramConfigurations.upload(r),this.tunnelProgramConfigurations.upload(r))}destroy(){this.vertexBuffer&&(this.vertexBuffer.destroy(),this.vertexBufferNormal.destroy(),this.indexBuffer.destroy()),this.maskSegments&&(this.maskSegments.destroy(),this.depthSegments.destroy(),this.renderableBridgeSegments.destroy(),this.renderableTunnelSegments.destroy(),this.shadowCasterSegments.destroy()),this.bridgeProgramConfigurations.destroy(),this.tunnelProgramConfigurations.destroy()}populatePaintArrays(r,s,u,f,g){const v=(x,w)=>{for(let A=0;A<w.length-1;A++){const R=w[A].featureIndex,M=w[A+1].vertexStart,O=r.feature(R);x.populatePaintArrays(M,O,R,{},u,s,f,void 0,g)}};v(this.bridgeProgramConfigurations,this.bridgeFeatureSections),v(this.tunnelProgramConfigurations,this.tunnelFeatureSections)}computeVertexConnections(r,s,u,f,g){const v=new Map;for(let x=f;x<g;x++){const w=u[x],A=w.a,R=w.b,M=Pa.computePosHash(r[A]),O=Pa.computePosHash(r[R]);let B=v.get(M);B||(B={},v.set(M,B));let N=v.get(O);N||(N={},v.set(O,N)),s[A]<=0&&s[R]<=0||(B.to=R,N.from=A)}return v}isTerminalVertex(r,s){const u=Pa.computePosHash(this.unevalVertices[r]),f=s.get(u);return!f||!f.from||!f.to}constructBridgeStructures(r,s,u,f,g,v){r.clearVertexLookup();const x=this.computeVertexConnections(s,u,f,g.min,g.max),w=1/v,A=.5*w,R=(it,nt)=>en(it,s[nt].x,s[nt].y,u[nt]*w),M=zt(),O=zt(),B=zt(),N=zt(),G=zt(),H=(it,nt)=>{const bt=x.get(Pa.computePosHash(s[nt])),Ze=bt.from,et=bt.to;
vendor: 4,037 bytes, line 24
24if(!Ze||!et)return;R(M,Ze),R(O,nt),R(B,et),Ie(N),Ve(M,O)||(tt(G,O,M),_n(N,G)),Ve(B,O)||(tt(G,B,O),sn(N,N,_n(G,G)));const ot=Ut(N);return ot>0?Yn(it,N,1/ot):void 0};let J=Number.POSITIVE_INFINITY;this.sortSubarray(f,g.min,g.max,(it,nt)=>it.featureInfo.featureIndex-nt.featureInfo.featureIndex);const re=zt(),Q=zt(),le=zt(),ue=zt(),he=zt(),Te=zt(),me=zt(),xe=zt(),_e=zt(),we=[zt(),zt(),zt(),zt()],je=[zt(),zt(),zt(),zt()],He=[{coord:new St(0,0),height:0},{coord:new St(0,0),height:0}],Qe=(it,nt)=>it>nt;for(let it=g.min;it<g.max;it++){const nt=f[it];if(!nt.featureInfo.guardRailEnabled||!this.prepareEdgePoints(He,s,u,nt,Qe))continue;const[bt,Ze]=He;if(en(re,bt.coord.x,bt.coord.y,w*bt.height),en(Q,Ze.coord.x,Ze.coord.y,w*Ze.height),Ve(re,Q))continue;tt(le,Q,re),_n(le,le);const et=H(xe,nt.a)||le,ot=H(_e,nt.b)||le;en(ue,et[1],-et[0],0),_n(ue,ue),en(he,ot[1],-ot[0],0),_n(he,he),Be(xe,ue,et),_n(Te,xe),Be(xe,he,ot),_n(me,xe),sn(we[0],re,Yn(xe,tt(xe,ue,Te),A)),sn(we[1],re,Yn(xe,sn(xe,ue,Te),A)),sn(we[2],re,Yn(xe,Te,A)),we[3]=re,sn(je[0],Q,Yn(xe,tt(xe,he,me),A)),sn(je[1],Q,Yn(xe,sn(xe,he,me),A)),sn(je[2],Q,Yn(xe,me,A)),je[3]=Q,J=this.addFeatureSection(nt.featureInfo.featureIndex,J,this.bridgeFeatureSections,r);const ft=r.addVertex(we[0],ue,v),_t=r.addVertex(we[1],ue,v),Ft=r.addVertex(je[0],he,v),ut=r.addVertex(je[1],he,v);r.addTriangle(ft,_t,Ft),r.addTriangle(_t,ut,Ft);const At=r.addVertex(we[1],Te,v),It=r.addVertex(we[2],Te,v),Xt=r.addVertex(je[1],me,v),Yt=r.addVertex(je[2],me,v);r.addTriangle(At,It,Xt),r.addTriangle(It,Yt,Xt),Cn(ue,ue),Cn(he,he);const gn=r.addVertex(we[2],ue,v),on=r.addVertex(we[3],ue,v),En=r.addVertex(je[2],he,v),_r=r.addVertex(je[3],he,v);r.addTriangle(gn,on,En),r.addTriangle(on,_r,En);const Nn=this.isTerminalVertex(nt.a,x),sr=this.isTerminalVertex(nt.b,x);bt.height<.01&&Nn&&r.addQuad(we[3],we[2],we[1],we[0],Cn(et,et),v),Ze.height<.01&&sr&&r.addQuad(je[0],je[1],je[2],je[3],ot,v)}this.bridgeFeatureSections.push({featureIndex:Number.POSITIVE_INFINITY,vertexStart:r.getVertexCount()})}constructTunnelStructures(r,s,u,f,g,v){r.clearVertexLookup();let x=Number.POSITIVE_INFINITY;const w=(J,re)=>J.featureInfo.featureIndex-re.featureInfo.featureIndex;this.sortSubarray(f,g.min,g.max,w),this.sortSubarray(f,v.min,v.max,w);const A=J=>_n(J,J),R=[{coord:new St(0,0),height:0},{coord:new St(0,0),height:0}],M=(J,re)=>J<re,O=zt(),B=zt(),N=zt(),G=zt(),H=zt();for(let J=g.min;J<g.max;J++){if(!this.prepareEdgePoints(R,s,u,f[J],M))continue;const[re,Q]=R,le=A(en(H,-(Q.coord.y-re.coord.y),Q.coord.x-re.coord.x,0));x=this.addFeatureSection(f[J].featureInfo.featureIndex,x,this.tunnelFeatureSections,r),r.addQuad(en(O,re.coord.x,re.coord.y,re.height),en(B,Q.coord.x,Q.coord.y,Q.height),en(N,Q.coord.x,Q.coord.y,f[J].isTunnel?-.1:0),en(G,re.coord.x,re.coord.y,f[J].isTunnel?-.1:0),le)}for(let J=v.min;J<v.max;J++){const re=f[J];re.isTunnel&&([re.a,re.b]=[re.b,re.a]);const Q=s[re.a],le=s[re.b],ue=A(en(H,-(le.y-Q.y),le.x-Q.x,0));x=this.addFeatureSection(re.featureInfo.featureIndex,x,this.tunnelFeatureSections,r),r.addQuad(en(O,le.x,le.y,0),en(B,Q.x,Q.y,0),en(N,Q.x,Q.y,u[re.a]+4),en(G,le.x,le.y,u[re.b]+4),ue),r.addQuad(en(O,Q.x,Q.y,0),en(B,le.x,le.y,0),en(N,le.x,le.y,u[re.b]+4),en(G,Q.x,Q.y,u[re.a]+4),ue)}this.tunnelFeatureSections.push({featureIndex:Number.POSITIVE_INFINITY,vertexStart:r.getVertexCount()})}setElevatedPoint(r,s,u,f){r.coord.x=s,r.coord.y=u,r.height=f}prepareEdgePoints(r,s,u,f,g){let v=s[f.a].x,x=s[f.a].y,w=s[f.b].x,A=s[f.b].y,R=u[f.a],M=u[f.b];const O=g(R,0),B=g(M,0);if(O&&B)return this.setElevatedPoint(r[0],v,x,R),this.setElevatedPoint(r[1],w,A,M),!0;if(!O&&!B)return!1;if(O){if(!B){const N=M/(M-R);w=Sn(w,v,N),A=Sn(A,x,N),M=Sn(M,R,N)}}else{const N=R/(R-M);v=Sn(v,w,N),x=Sn(x,A,N),R=Sn(R,M,N)}return this.setElevatedPoint(r[0],v,x,R),this.setElevatedPoint(r[1],w,A,M),!0}prepareEdges(r,s){if(s.length===0)return;s.sort((x,w)=>x.hash===w.hash?w.polygonIdx-x.polygonIdx:w.hash>x.hash?1:-1);let u=0,f=0,g=0,v=s[u].polygonIdx;do f++,(f===s.length||s[u].hash!==s[f].hash)&&((f-u===1||s[f-1].pol
vendor: 6,409 bytes, line 24
24ygonIdx!==v)&&(g<u&&(s[g]=s[u],s[u]=null),s[g].type="none",g++),u=f,u!==s.length&&(v=s[u].polygonIdx));while(u!==s.length);if(s.splice(g),s.length!==0&&r.length!==0){s.sort((A,R)=>A.portalHash<R.portalHash?1:-1);let x=0,w=0;for(;x!==s.length&&w!==r.length;){const A=s[x],R=r[w];A.portalHash>R.hash?x++:R.hash>A.portalHash?w++:(A.type=R.type,x++)}}}isOnBorder(r,s){return r<=0&&s<=0||r>=Bt&&s>=Bt}addFeatureSection(r,s,u,f){return r!==s&&(s=r,u.push({featureIndex:r,vertexStart:f.getVertexCount()}),f.clearVertexLookup()),s}sortSubarray(r,s,u,f){const g=r.slice(s,u);g.sort(f),r.splice(s,g.length,...g)}static computeEdgeHash(r,s){return(r.y===s.y&&r.x>s.x||r.y>s.y)&&([r,s]=[s,r]),BigInt(Pa.computePosHash(r))<<32n|BigInt(Pa.computePosHash(s))}static computePosHash(r){return((65535&r.x)<<16|65535&r.y)>>>0}}function jG(l,r){return l>r?1:l<r?-1:0}class J2{constructor(r=jG,s=!1){this._compare=r,this._root=null,this._size=0,this._noDuplicates=!!s}rotateLeft(r){var s=r.right;s&&(r.right=s.left,s.left&&(s.left.parent=r),s.parent=r.parent),r.parent?r===r.parent.left?r.parent.left=s:r.parent.right=s:this._root=s,s&&(s.left=r),r.parent=s}rotateRight(r){var s=r.left;s&&(r.left=s.right,s.right&&(s.right.parent=r),s.parent=r.parent),r.parent?r===r.parent.left?r.parent.left=s:r.parent.right=s:this._root=s,s&&(s.right=r),r.parent=s}_splay(r){for(;r.parent;){var s=r.parent;s.parent?s.left===r&&s.parent.left===s?(this.rotateRight(s.parent),this.rotateRight(s)):s.right===r&&s.parent.right===s?(this.rotateLeft(s.parent),this.rotateLeft(s)):s.left===r&&s.parent.right===s?(this.rotateRight(s),this.rotateLeft(s)):(this.rotateLeft(s),this.rotateRight(s)):s.left===r?this.rotateRight(s):this.rotateLeft(s)}}splay(r){for(var s,u,f,g,v;r.parent;)(u=(s=r.parent).parent)&&u.parent?((f=u.parent).left===u?f.left=r:f.right=r,r.parent=f):(r.parent=null,this._root=r),g=r.left,v=r.right,r===s.left?(u&&(u.left===s?(s.right?(u.left=s.right,u.left.parent=u):u.left=null,s.right=u,u.parent=s):(g?(u.right=g,g.parent=u):u.right=null,r.left=u,u.parent=r)),v?(s.left=v,v.parent=s):s.left=null,r.right=s,s.parent=r):(u&&(u.right===s?(s.left?(u.right=s.left,u.right.parent=u):u.right=null,s.left=u,u.parent=s):(v?(u.left=v,v.parent=u):u.left=null,r.right=u,u.parent=r)),g?(s.right=g,g.parent=s):s.right=null,r.left=s,s.parent=r)}replace(r,s){r.parent?r===r.parent.left?r.parent.left=s:r.parent.right=s:this._root=s,s&&(s.parent=r.parent)}minNode(r=this._root){if(r)for(;r.left;)r=r.left;return r}maxNode(r=this._root){if(r)for(;r.right;)r=r.right;return r}insert(r,s){var u=this._root,f=null,g=this._compare;if(this._noDuplicates)for(;u;){if(f=u,g(u.key,r)===0)return;u=g(u.key,r)<0?u.right:u.left}else for(;u;)f=u,u=g(u.key,r)<0?u.right:u.left;return u={key:r,data:s,left:null,right:null,parent:f},f?g(f.key,u.key)<0?f.right=u:f.left=u:this._root=u,this.splay(u),this._size++,u}find(r){for(var s=this._root,u=this._compare;s;){var f=u(s.key,r);if(f<0)s=s.right;else{if(!(f>0))return s;s=s.left}}return null}contains(r){for(var s=this._root,u=this._compare;s;){var f=u(r,s.key);if(f===0)return!0;s=f<0?s.left:s.right}return!1}remove(r){var s=this.find(r);if(!s)return!1;if(this.splay(s),s.left)if(s.right){var u=this.minNode(s.right);u.parent!==s&&(this.replace(u,u.right),u.right=s.right,u.right.parent=u),this.replace(s,u),u.left=s.left,u.left.parent=u}else this.replace(s,s.left);else this.replace(s,s.right);return this._size--,!0}removeNode(r){if(!r)return!1;if(this.splay(r),r.left)if(r.right){var s=this.minNode(r.right);s.parent!==r&&(this.replace(s,s.right),s.right=r.right,s.right.parent=s),this.replace(r,s),s.left=r.left,s.left.parent=s}else this.replace(r,r.left);else this.replace(r,r.right);return this._size--,!0}erase(r){var s=this.find(r);if(s){this.splay(s);var u=s.left,f=s.right,g=null;u&&(u.parent=null,g=this.maxNode(u),this.splay(g),this._root=g),f&&(u?g.right=f:this._root=f,f.parent=g),this._size--}}pop(){var r=this._root,s=null;if(r){for(;r.left;)r=r.left;s={key:r.key,data:r.data},this.remove(r.key)}return s}next(r){var s=r;if(s)if(s.right)for(s=s.right;s&&s.left;)s=s.left;else for(s=r.parent;s&&s.right===r;)r=s,s=s.parent;return s}prev(r){var s=r;if(s)if(s.left)for(s=s.left;s&&s.right;)s=s.right;else for(s=r.parent;s&&s.left===r;)r=s,s=s.parent;return s}forEach(r){for(var s=this._root,u=[],f=!1,g=0;!f;)s?(u.push(s),s=s.left):u.length>0?(r(s=u.pop(),g++),s=s.right):f=!0;return this}range(r,s,u,f){const g=[],v=this._compare;let x,w=this._root;for(;g.length!==0||w;)if(w)g.push(w),w=w.left;else{if(w=g.pop(),x=v(w.key,s),x>0)break;if(v(w.key,r)>=0&&u.call(f,w))return this;w=w.right}return this}keys(){for(var r=this._root,s=[],u=[],f=!1;!f;)r?(s.push(r),r=r.left):s.length>0?(r=s.pop(),u.push(r.key),r=r.right):f=!0;return u}values(){for(var r=this._root,s=[],u=[],f=!1;!f;)r?(s.push(r),r=r.left):s.length>0?(r=s.pop(),u.push(r.data),r=r.right):f=!0;return u}at(r){for(var s=this._root,u=[],f=!1,g=0;!f;)if(s)u.push(s),s=s.left;else if(u.length>0){if(s=u.pop(),g===r)return s;g++,s=s.right}else f=!0;return null}load(r=[],s=[],u=!1){if(this._size!==0)throw new Error("bulk-load: tree is not empty");const f=r.length;return u&&eA(r,s,0,f-1,this._compare),this._root=Q2(null,r,s,0,f),this._size=f,this}min(){var r=this.minNode(this._root);return r?r.key:null}max(){var r=this.maxNode(this._root);return r?r.key:null}isEmpty(){return this._root===null}get size(){return this._size}static createTree(r,s,u,f,g){return new J2(u,g).load(r,s,f)}}function Q2(l,r,s,u,f){const g=f-u;if(g>0){const v=u+Math.floor(g/2),x={key:r[v],data:s[v],parent:l};return x.left=Q2(x,r,s,u,v),x.right=Q2(x,r,s,v+1,f),x}return null}function eA(l,r,s,u,f){if(s>=u)return;const g=l[s+u>>1];let v=s-1,x=u+1;for(;;){do v++;while(f(l[v],g)<0);do x--;while(f(l[x],g)>0);if(v>=x)break;let w=l[v];l[v]=l[x],l[x]=w,w=r[v],r[v]=r[x],r[x]=w}eA(l,r,s,x,f),eA(l,r,x+1,u,f)}const WL=11102230246251565e-32,la=134217729,GG=(3+8*WL)*WL;function tA(l,r,s,u,f){let g,v,x,w,A=r[0],R=u[0],M=0,O=0;R>A==R>-A?(g=A,A=r[++M]):(g=R,R=u[++O]);let B=0;if(M<l&&O<s)for(R>A==R>-A?(v=A+g,x=g-(v-A),A=r[++M]):(v=R+g,x=g-(v-R),R=u[++O]),g=v,x!==0&&(f[B++]=x);M<l&&O<s;)R>A==R>-A?(v=g+A,w=v-g,x=g-(v-w)+(A-w),A=r[++M]):(v=g+R,w=v-g,x=g-(v-w)+(R-w),R=u[++O]),g=v,x!==0&&(f[B++]=x);for(;M<l;)v=g+A,w=v-g,x=g-(v-w)+(A-w),A=r[++M],g=v,x!==0&&(f[B++]=x);for(;O<s;)v=g+R,w=v-g,x=g-(v-w)+(R-w),R=u[++O],g=v,x!==0&&(f[B++]=x);return g===0&&B!==0||(f[B++]=g),B}
24function gv(l){return new Float64Array(l)}const r_=gv(4),qL=gv(8),XL=gv(12),ZL=gv(16),Ra=gv(4);function _v(l,r,s){r===null?(l.inOut=!1,l.otherInOut=!0):(l.isSubject===r.isSubject?(l.inOut=!r.inOut,l.otherInOut=r.otherInOut):(l.inOut=!r.otherInOut,l.otherInOut=r.isVertical()?!r.inOut:r.inOut),r&&(l.prevInResult=!YL(r,s)||r.isVertical()?r.prevInResult:r)),l.resultTransition=YL(l,s)?(function(u,f){let g,v=!u.inOut,x=!u.otherInOut;switch(f){case 0:g=v&&x;break;case 1:g=v||x;break;case 3:g=v!==x;break;case 2:g=u.isSubject?v&&!x:x&&!v}return g?1:-1})(l,s):0}function YL(l,r){switch(l.type){case 0:switch(r){case 0:return!l.otherInOut;case 1:return l.otherInOut;case 2:return l.isSubject&&l.otherInOut||!l.isSubject&&!l.otherInOut;case 3:return!0}break;case 2:return r===0||r===1;case 3:return r===2;case 1:return!1}return!1}class i_{constructor(r,s,u,f,g){this.left=s,this.point=r,this.otherEvent=u,this.isSubject=f??!1,this.type=g||0,this.inOut=!1,this.otherInOut=!1,this.prevInResult=null,this.resultTransition=0,this.otherPos=-1,this.outputContourId=-1,this.isExteriorRing=!0}isBelow(r){const s=this.point,u=this.otherEvent.point;return this.left?(s[0]-r[0])*(u[1]-r[1])-(u[0]-r[0])*(s[1]-r[1])>0:(u[0]-r[0])*(s[1]-r[1])-(s[0]-r[0])*(u[1]-r[1])>0}isAbove(r){return!this.isBelow(r)}isVertical(){return this.point[0]===this.otherEvent.point[0]}get inResult(){return this.resultTransition!==0}clone(){const r=new i_(this.point,this.left,this.otherEvent,this.isSubject,this.type);return r.contourId=this.contourId,r.resultTransition=this.resultTransition,r.prevInResult=this.prevInResult,r.isExteriorRing=this.isExteriorRing,r.inOut=this.inOut,r.otherInOut=this.otherInOut,r}}function Fu(l,r){return l[0]===r[0]&&l[1]===r[1]}function nA(l,r,s){const u=(function(f,g,v,x,w,A){const R=(g-A)*(v-w),M=(f-w)*(x-A),O=R-M;if(R===0||M===0||R>0!=M>0)return O;const B=Math.abs(R+M);return Math.abs(O)>=33306690738754716e-32*B?O:-(function(N,G,H,J,re,Q,le){let ue,he,Te,me,xe,_e,we,je,He,Qe,it,nt,bt,Ze,et,ot,ft,_t;const Ft=N-re,ut=H-re,At=G-Q,It=J-Q;Ze=Ft*It,_e=la*Ft,we=_e-(_e-Ft),je=Ft-we,_e=la*It,He=_e-(_e-It),Qe=It-He,et=je*Qe-(Ze-we*He-je*He-we*Qe),ot=At*ut,_e=la*At,we=_e-(_e-At),je=At-we,_e=la*ut,He=_e-(_e-ut),Qe=ut-He,ft=je*Qe-(ot-we*He-je*He-we*Qe),it=et-ft,xe=et-it,r_[0]=et-(it+xe)+(xe-ft),nt=Ze+it,xe=nt-Ze,bt=Ze-(nt-xe)+(it-xe),it=bt-ot,xe=bt-it,r_[1]=bt-(it+xe)+(xe-ot),_t=nt+it,xe=_t-nt,r_[2]=nt-(_t-xe)+(it-xe),r_[3]=_t;let Xt=(function(_r,Nn){let sr=Nn[0];for(let Zn=1;Zn<4;Zn++)sr+=Nn[Zn];return sr})(0,r_),Yt=22204460492503146e-32*le;if(Xt>=Yt||-Xt>=Yt||(xe=N-Ft,ue=N-(Ft+xe)+(xe-re),xe=H-ut,Te=H-(ut+xe)+(xe-re),xe=G-At,he=G-(At+xe)+(xe-Q),xe=J-It,me=J-(It+xe)+(xe-Q),ue===0&&he===0&&Te===0&&me===0)||(Yt=11093356479670487e-47*le+GG*Math.abs(Xt),Xt+=Ft*me+It*ue-(At*Te+ut*he),Xt>=Yt||-Xt>=Yt))return Xt;Ze=ue*It,_e=la*ue,we=_e-(_e-ue),je=ue-we,_e=la*It,He=_e-(_e-It),Qe=It-He,et=je*Qe-(Ze-we*He-je*He-we*Qe),ot=he*ut,_e=la*he,we=_e-(_e-he),je=he-we,_e=la*ut,He=_e-(_e-ut),Qe=ut-He,ft=je*Qe-(ot-we*He-je*He-we*Qe),it=et-ft,xe=et-it,Ra[0]=et-(it+xe)+(xe-ft),nt=Ze+it,xe=nt-Ze,bt=Ze-(nt-xe)+(it-xe),it=bt-ot,xe=bt-it,Ra[1]=bt-(it+xe)+(xe-ot),_t=nt+it,xe=_t-nt,Ra[2]=nt-(_t-xe)+(it-xe),Ra[3]=_t;const gn=tA(4,r_,4,Ra,qL);Ze=Ft*me,_e=la*Ft,we=_e-(_e-Ft),je=Ft-we,_e=la*me,He=_e-(_e-me),Qe=me-He,et=je*Qe-(Ze-we*He-je*He-we*Qe),ot=At*Te,_e=la*At,we=_e-(_e-At),je=At-we,_e=la*Te,He=_e-(_e-Te),Qe=Te-He,ft=je*Qe-(ot-we*He-je*He-we*Qe),it=et-ft,xe=et-it,Ra[0]=et-(it+xe)+(xe-ft),nt=Ze+it,xe=nt-Ze,bt=Ze-(nt-xe)+(it-xe),it=bt-ot,xe=bt-it,Ra[1]=bt-(it+xe)+(xe-ot),_t=nt+it,xe=_t-nt,Ra[2]=nt-(_t-xe)+(it-xe),Ra[3]=_t;const on=tA(gn,qL,4,Ra,XL);Ze=ue*me,_e=la*ue,we=_e-(_e-ue),je=ue-we,_e=la*me,He=_e-(_e-me),Qe=me-He,et=je*Qe-(Ze-we*He-je*He-we*Qe),ot=he*Te,_e=la*he,we=_e-(_e-he),je=he-we,_e=la*Te,He=_e-(_e-Te),Qe=Te-He,ft=je*Qe-(ot-we*He-je*He-we*Qe),it=et-ft,xe=et-it,Ra[0]=et-(it+xe)+(xe-ft),nt=Ze+it,xe=nt-Ze,bt=Ze-(nt-xe)+(it-xe),it=bt-ot,xe=bt-it,Ra[1]=bt-(it+xe)+(xe-ot),_t=nt+it,xe=_t-nt,Ra[2]=nt-(_t-xe)+(it-xe),Ra[3]=_t;const En=tA(on,XL,4,Ra,ZL);return ZL[En-1]})(f,g,v,x,w,A,B)})(l[0],l[1],r[0],r[1],s[0],s[1]);return u>0?-1:u<0?1:0}function uf(l,r){const s=l.point,u=r.point;return s[0]>u[0]?1:s[0]<u[0]?-1:s[1]!==u[1]?s[1]>u[1]?1:-1:(function(f,g,v){return f.left!==g.left?f.left?1:-1:nA(v,f.otherEvent.point,g.otherEvent.point)!==0?f.isBelow(g.otherEvent.point)?-1:1:!f.isSubject&&g.isSubject?1:-1})(l,r,s)}function df(l,r,s){const u=new i_(r,!1,l,l.isSubject),f=new i_(r,!0,l.otherEvent,l.isSubject);return Fu(l.point,l.otherEvent.point)&&console.warn("what is that, a collapsed
24segment?",l),u.contourId=f.contourId=l.contourId,uf(f,l.otherEvent)>0&&(l.otherEvent.left=!0,f.left=!1),l.otherEvent.otherEvent=f,l.otherEvent=u,s.push(f),s.push(u),s}function jw(l,r){return l[0]*r[1]-l[1]*r[0]}function rA(l,r){return l[0]*r[0]+l[1]*r[1]}function iA(l,r,s){const u=(function(w,A,R,M){const O=[A[0]-w[0],A[1]-w[1]],B=[M[0]-R[0],M[1]-R[1]];function N(Te,me,xe){return[Te[0]+me*xe[0],Te[1]+me*xe[1]]}const G=[R[0]-w[0],R[1]-w[1]];let H=jw(O,B),J=H*H;const re=rA(O,O);if(J>0){const Te=jw(G,B)/H;if(Te<0||Te>1)return null;const me=jw(G,O)/H;return me<0||me>1?null:Te===0||Te===1?[N(w,Te,O)]:me===0||me===1?[N(R,me,B)]:[N(w,Te,O)]}if(H=jw(G,O),J=H*H,J>0)return null;const Q=rA(O,G)/re,le=Q+rA(O,B)/re,ue=Math.min(Q,le),he=Math.max(Q,le);return ue<=1&&he>=0?ue===1?[N(w,ue>0?ue:0,O)]:he===0?[N(w,he<1?he:1,O)]:[N(w,ue>0?ue:0,O),N(w,he<1?he:1,O)]:null})(l.point,l.otherEvent.point,r.point,r.otherEvent.point),f=u?u.length:0;if(f===0||f===1&&(Fu(l.point,r.point)||Fu(l.otherEvent.point,r.otherEvent.point))||f===2&&l.isSubject===r.isSubject)return 0;if(f===1)return!Fu(l.point,u[0])&&!Fu(l.otherEvent.point,u[0])&&df(l,u[0],s),!Fu(r.point,u[0])&&!Fu(r.otherEvent.point,u[0])&&df(r,u[0],s),1;const g=[];let v=!1,x=!1;return Fu(l.point,r.point)?v=!0:uf(l,r)===1?g.push(r,l):g.push(l,r),Fu(l.otherEvent.point,r.otherEvent.point)?x=!0:uf(l.otherEvent,r.otherEvent)===1?g.push(r.otherEvent,l.otherEvent):g.push(l.otherEvent,r.otherEvent),v&&x||v?(r.type=1,l.type=r.inOut===l.inOut?2:3,v&&!x&&df(g[1].otherEvent,g[0].point,s),2):x?(df(g[0],g[1].point,s),3):g[0]!==g[3].otherEvent?(df(g[0],g[1].point,s),df(g[1],g[2].point,s),3):(df(g[0],g[1].point,s),df(g[3].otherEvent,g[2].point,s),3)}function HG(l,r){if(l===r)return 0;if(nA(l.point,l.otherEvent.point,r.point)!==0||nA(l.point,l.otherEvent.point,r.otherEvent.point)!==0)return Fu(l.point,r.point)?l.isBelow(r.otherEvent.point)?-1:1:l.point[0]===r.point[0]?l.point[1]<r.point[1]?-1:1:uf(l,r)===1?r.isAbove(l.point)?-1:1:l.isBelow(r.point)?-1:1;if(l.isSubject!==r.isSubject)return l.isSubject?-1:1;{let s=l.point,u=r.point;if(s[0]===u[0]&&s[1]===u[1])return s=l.otherEvent.point,u=r.otherEvent.point,s[0]===u[0]&&s[1]===u[1]?0:(l.contourId??0)>(r.contourId??0)?1:-1}return uf(l,r)===1?1:-1}class WG{constructor(){this.points=[],this.holeIds=[],this.holeOf=null,this.depth=null}isExterior(){return this.holeOf==null}}function qG(l,r,s,u){let f,g=l+1,v=r[l].point;const x=r.length;for(g<x&&(f=r[g].point);g<x&&f[0]===v[0]&&f[1]===v[1];){if(!s[g])return g;g++,g<x&&(f=r[g].point)}for(g=l-1;s[g]&&g>u;)g--;return g}function XG(l,r,s){const u=new WG;if(l.prevInResult!=null){const f=l.prevInResult,g=f.outputContourId;if(f.resultTransition>0){const v=r[g];if(v.holeOf!=null){const x=v.holeOf;r[x].holeIds.push(s),u.holeOf=x,u.depth=r[g].depth}else r[g].holeIds.push(s),u.holeOf=g,u.depth=r[g].depth+1}else u.holeOf=null,u.depth=r[g].depth}else u.holeOf=null,u.depth=0;return u}const KL=Math.max,JL=Math.min;let Gw=0;function QL(l,r,s,u,f,g){let v,x,w,A,R,M;for(v=0,x=l.length-1;v<x;v++){if(w=l[v],A=l[v+1],R=new i_(w,!1,void 0,r),M=new i_(A,!1,R,r),R.otherEvent=M,w[0]===A[0]&&w[1]===A[1])continue;R.contourId=M.contourId=s,g||(R.isExteriorRing=!1,M.isExteriorRing=!1),uf(R,M)>0?M.left=!0:R.left=!0;const O=w[0],B=w[1];f[0]=JL(f[0],O),f[1]=JL(f[1],B),f[2]=KL(f[2],O),f[3]=KL(f[3],B),u.push(R),u.push(M)}}const Hw=[];function eO(l,r,s){let u=l,f=r;typeof l[0][0][0]=="number"&&(u=[l]),typeof r[0][0][0]=="number"&&(f=[r]);let g=(function(O,B,N){let G=null;return O.length*B.length===0&&(N===0?G=Hw:N===2?G=O:(N===1||N===3)&&(G=O.length===0?B:O)),G})(u,f,s);if(g)return g===Hw?null:g;const v=[1/0,1/0,-1/0,-1/0],x=[1/0,1/0,-1/0,-1/0],w=(function(O,B,N,G,H){const J=new Ep(void 0,uf);let re,Q,le,ue,he,Te;for(le=0,ue=O.length;le<ue;le++)for(re=O[le],he=0,Te=re.length;he<Te;he++)Q=he===0,Q&&Gw++,QL(re[he],!0,Gw,J,N,Q);for(le=0,ue=B.length;le<ue;le++)for(re=B[le],he=0,Te=re.length;he<Te;he++)Q=he===0,H===2&&(Q=!1),Q&&Gw++,QL(re[he],!1,Gw,J,G,Q);return J})(u,f,v,x,s);if(g=(function(O,B,N,G,H){let J=null;return(N[0]>G[2]||G[0]>N[2]||N[1]>G[3]||G[1]>N[3])&&(H===0?J=Hw:H===2?J=O:(H===1||H===3)&&(J=O.concat(B))),J})(u,f,v,x,s),g)return g===Hw?null:g;const A=(function(O,B,N,G,H,J){const re=new J2(HG),Q=[],le=Math.min(G[2],H[2]);let ue,he,Te;for(;O.length!==0;){let me=O.pop();if(Q.push(me),J===0&&me.point[0]>le||J===2&&me.point[0]>G[2])break;if(me.left){he=ue=re.insert(me),Te=re.minNode(),ue=ue!==Te?re.prev(ue):null,he=re.next(he);const xe=ue?ue.key:null;let _e;if(_v(me,xe,J),he&&iA(me,he.key,O)===2&&(_v(me,xe,J),_v(he.key,me,J)),ue&&iA(ue.key,me,O)===2){let we=ue;we=we!==Te?re.prev(we):null,_e=we?we.key:null,_v(xe,_e,J),_v(me,xe,J)}}else me=me.otherEvent,he=ue=re.find(me),ue&&he&&(ue=ue!==Te?re.prev(ue):null,he=re.next(he),re.remove(me),he&&ue&&iA(ue.key,he.key,O))}return Q})(w,0,0,v,x,s),R=(function(O){let B,N;const G=(function(re){let Q,le,ue,he,Te;const me=[];for(le=0,ue=re.length;le<ue;le++)Q=re[le],(Q.left&&Q.inResult||!Q.left&&Q.otherEvent.inResult)&&me.push(Q);let xe=!1;for(;!xe;)for(xe=!0,le=0,ue=me.length;le<ue;le++)le+1<ue&&uf(me[le],me[le+1])===1&&(he=me[le],me[le]=me[le+1],me[le+1]=he,xe=!1);for(le=0,ue=me.length;le<ue;le++)Q=me[le],Q.otherPos=le;for(le=0,ue=me.length;le<ue;le++)Q=me[le],Q.left||(Te=Q.otherPos,Q.otherPos=Q.otherEvent.otherPos,Q.otherEvent.otherPos=Te);return me})(O),H={},J=[];for(B=0,N=G.length;B<N;B++){if(H[B])continue;const re=J.length,Q=XG(G[B],J,re),le=Te=>{H[Te]=!0,Te<G.length&&G[Te]&&(G[Te].outputContourId=re)};let ue=B,he=B;for(Q.points.push(G[B].point);le(ue),ue=G[ue].otherPos,le(ue),Q.points.push(G[ue].point),ue=qG(ue,G,H,he),!(ue==he||ue>=G.length)&&G[ue];);J.push(Q)}return J})(A),M=[];for(let O=0;O<R.length;O++){let B=R[O];if(B.isExterior()){let N=[B.points];for(let G=0;G<B.holeIds.length;G++)N.push(R[B.holeIds[G]].points);M.push(N)}}return M}function Ww(l,r,s,u){const f=[],g=u===0?(v,x,w,A,R,M)=>{v.push(new St(M,w+(M-x)/(A-x)*(R-w)))}:(v,x,w,A,R,M)=>{v.push(new St(x+(M-w)/(R-w)*(A-x),M))};for(const v of l){const x=[];for(const w of v){if(w.length<=2)continue;const A=[];for(let O=0;O<w.length-1;O++){const B=w[O].x,N=w[O].y,G=w[O+1].x,H=w[O+1].y,J=u===0?B:N,re=u===0?G:H;J<r?re>r&&g(A,B,N,G,H,r):J>s?re<s&&g(A,B,N,G,H,s):A.push(w[O]),re<r&&J>=r&&g(A,B,N,G,H,r),re>s&&J<=s&&g(A,B,N,G,H,s)}let R=w.at(-1);const M=u===0?R.x:R.y;M>=r&&M<=s&&A.push(R),A.length&&(R=A.at(-1),A[0].x===R.x&&A[0].y===R.y||A.push(A[0]),x.push(A))}x.length&&f.push(x)}return f}function ZG(l,r){const s=eO(oA(l),oA([r]),0);return s==null?[]:tO(s)}function YG(l,r,s=0){let f=oA(l,65536);const g=[];for(;r.valid();r.next()){const[v,x]=r.get();let w=v.x*65536,A=v.y*65536,R=x.x*65536,M=x.y*65536;const O=R-w,B=M-A,N=Math.hypot(O,B);if(N===0)continue;w-=O*s,A-=B*s,R+=O*s,M+=B*s;const G=Math.trunc(B/N*3),H=-Math.trunc(O/N*3);g.push([[[w,A],[R,M],[R+G,M+H],[w+G,A+H],[w,A]]])}return g.length>0&&(f=eO(f,g,2)),tO(f,1/65536,128)}function oA(l,r=1){return[l.map(s=>s.map(u=>[u.x*r,u.y*r]))]}function tO(l,r=1,s){return l.map(u=>u.map((f,g)=>{const v=f.map(x=>{let w=x[0],A=x[1];return s&&(w=Math.round(w/s)*s,A=Math.round(A/s)*s),new St(w*r,A*r)._roun
24d()});return g>0&&v.reverse(),v}))}class sA{constructor(r,s){this.layoutVertexArray=new Ha,this.indexArray=new _i,this.lineIndexArray=new Bs,this.triangleSegments=new Wr,this.lineSegments=new Wr,this.programConfigurations=new Ea(r.layers,{zoom:r.zoom,lut:r.lut}),this.uploaded=!1,s&&(this.elevatedLayoutVertexArray=new Zo)}update(r,s,u,f,g,v,x,w){this.programConfigurations.updatePaintArrays(r,s,g,u,f,v,x,w)}isEmpty(){return this.layoutVertexArray.length===0}needsUpload(){return this.programConfigurations.needsUpload}upload(r){this.uploaded||(this.layoutVertexBuffer=r.createVertexBuffer(this.layoutVertexArray,ji.members),this.indexBuffer=r.createIndexBuffer(this.indexArray),this.lineIndexBuffer=r.createIndexBuffer(this.lineIndexArray),this.elevatedLayoutVertexArray&&this.elevatedLayoutVertexArray.length>0&&(this.elevatedLayoutVertexBuffer=r.createVertexBuffer(this.elevatedLayoutVertexArray,To.members))),this.programConfigurations.upload(r),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.elevatedLayoutVertexBuffer&&this.elevatedLayoutVertexBuffer.destroy(),this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.lineIndexBuffer.destroy(),this.programConfigurations.destroy(),this.triangleSegments.destroy(),this.lineSegments.destroy())}populatePaintArrays(r,s,u,f,g,v,x){this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,r,s,u,f,g,v,void 0,x)}}class qw{constructor(r){this.zoom=r.zoom,this.pixelRatio=r.pixelRatio,this.overscaling=r.overscaling,this.layers=r.layers,this.layerIds=this.layers.map(s=>s.fqid),this.index=r.index,this.hasPattern=!1,this.patternFeatures=[],this.lut=r.lut,this.bufferData=new sA(r,!1),this.elevationBufferData=new sA(r,!0),this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id),this.projection=r.projection,this.elevationMode=this.layers[0].layout.get("fill-elevation-reference"),this.sourceLayerIndex=r.sourceLayerIndex,this.worldview=r.worldview,this.hasAppearances=null}updateFootprints(r,s){}updateAppearances(r,s,u,f){return{hasLayoutChanges:!1,hasUboChanges:!1}}populate(r,s,u,f){this.hasPattern=Y2("fill",this.layers,this.pixelRatio,s);const g=this.layers[0].layout.get("fill-sort-key"),v=[];for(const{feature:x,id:w,index:A,sourceLayerIndex:R}of r){const M=this.layers[0]._featureFilter.needGeometry,O=Ya(x,M);if(!this.layers[0]._featureFilter.filter(new Tr(this.zoom,{worldview:this.worldview,activeFloors:s.activeFloors}),O,u))continue;const B=g?g.evaluate(O,{},u,s.availableImages):void 0,N={id:w,properties:x.properties,type:x.type,sourceLayerIndex:R,index:A,geometry:M?O.geometry:sa(x,u,f),patterns:{},sortKey:B};v.push(N)}g&&v.sort((x,w)=>x.sortKey-w.sortKey);for(const x of v){const{geometry:w,index:A,sourceLayerIndex:R}=x;if(this.hasPattern){const M=K2("fill",this.layers,x,this.zoom,this.pixelRatio,s);this.patternFeatures.push(M)}else this.addFeature(x,w,A,u,{},s.availableImages,s.brightness,s.elevationFeatures);s.featureIndex.insert(r[A].feature,w,A,R,this.index)}}update(r,s,u,f,g,v,x){this.bufferData.update(r,s,u,f,g,v,x,this.worldview),this.elevationBufferData.update(r,s,u,f,g,v,x,this.worldview),this.elevatedStructures&&this.elevatedStructures.update(r,s,u,f,g,v,x,this.worldview)}updateExpressions(r){this.bufferData.programConfigurations.updateExpressions(r),this.elevationBufferData.programConfigurations.updateExpressions(r),this.elevatedStructures&&(this.elevatedStructures.bridgeProgramConfigurations.updateExpressions(r),this.elevatedStructures.tunnelProgramConfigurations.updateExpressions(r))}addFeatures(r,s,u,f,g,v){for(const x of this.patternFeatures)this.addFeature(x,x.geometry,x.index,s,u,f,v,r.elevationFeatures)}isEmpty(){return this.bufferData.isEmpty()&&this.elevationBufferData.isEmpty()}uploadPending(){return!this.uploaded||this.bufferData.needsUpload()||this.elevationBufferData.needsUpload()}upload(r){this.bufferData.upload(r),this.elevationBufferData.upload(r),this.elevatedStructures&&this.elevatedStructures.upload(r)}destroy(){this.bufferData.destroy(),this.elevationBufferData.destroy(),this.elevatedStructures&&this.elevatedStructures.destroy()}
24addFeature(r,s,u,f,g,v=[],x,w){const A=mv(s,500);this.elevationMode!=="none"?this.addElevatedRoadFeature(r,A,f,u,w):this.addGeometry(A,this.bufferData),this.bufferData.populatePaintArrays(r,u,g,v,f,x,this.worldview),this.elevationBufferData.populatePaintArrays(r,u,g,v,f,x,this.worldview)}getUnevaluatedPortalGraph(){return this.elevatedStructures?this.elevatedStructures.unevaluatedPortals:void 0}setEvaluatedPortalGraph(r,s,u,f,g){this.elevatedStructures&&(this.elevatedStructures.construct(r),this.elevatedStructures.populatePaintArrays(s,u,f,g,this.worldview))}addElevatedRoadFeature(r,s,u,f,g){const v=new Array,x=p.getElevationFeature(r,g);if(!x)return void this.addGeometry(s,this.bufferData);{const A=this.clipPolygonsToTile(s,1);A.length>0&&v.push({polygons:A,elevationFeature:x,elevationTileID:u})}const w={guardRailEnabled:this.layers[0].layout.get("fill-construct-bridge-guard-rail").evaluate(r,{},u),featureIndex:f};for(const A of v)if(A.elevationFeature){if(this.elevationMode==="hd-road-base"){this.elevatedStructures||(this.elevatedStructures=new Pa(A.elevationTileID,this.layers,this.zoom,this.lut));const M=A.elevationFeature.isTunnel();let O=0;Object.hasOwn(r.properties,Fw)&&(O=+r.properties[Fw]),this.elevatedStructures.addPortalCandidates(A.elevationFeature.id,A.polygons,M,A.elevationFeature,O)}A.elevationFeature.constantHeight==null&&(A.polygons=this.prepareElevatedPolygons(A.polygons,A.elevationFeature,A.elevationTileID));const R=new o(u,A.elevationTileID);this.addElevatedGeometry(A.polygons,R,A.elevationFeature,this.elevationMode==="hd-road-base"?0:.05,f,w)}}addElevatedGeometry(r,s,u,f,g,v){const x={elevation:u,elevationSampler:s,bias:f,index:g,featureInfo:v},[w,A]=this.addGeometry(r,this.elevationBufferData,x);this.elevationBufferData.heightRange==null?this.elevationBufferData.heightRange={min:w,max:A}:(this.elevationBufferData.heightRange.min=Math.min(this.elevationBufferData.heightRange.min,w),this.elevationBufferData.heightRange.max=Math.max(this.elevationBufferData.heightRange.max,A))}addGeometry(r,s,u){let f=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY,v=null;u&&(v=u.elevationSampler.constantElevation(u.elevation,u.bias),v!=null&&(f=v,g=v));const x=(w,A,R)=>{if(u!=null)if(A.push(w),v!=null)s.elevatedLayoutVertexArray.emplaceBack(v),R.push(v);else{const M=u.elevationSampler.pointElevation(w,u.elevation,u.bias);s.elevatedLayoutVertexArray.emplaceBack(M),R.push(M),f=Math.min(f,M),g=Math.max(g,M)}};for(const w of r){let A=0;for(const Q of w)A+=Q.length;const R=s.triangleSegments.prepareSegment(A,s.layoutVertexArray,s.indexArray),M=R.vertexLength,O=[],B=[],N=[],G=[],H=[],J=s.layoutVertexArray.length;for(const Q of w){if(Q.length===0)continue;Q!==w[0]&&B.push(O.length/2);const le=s.lineSegments.prepareSegment(Q.length,s.layoutVertexArray,s.lineIndexArray),ue=le.vertexLength;u&&H.push(s.layoutVertexArray.length-J),x(Q[0],N,G),s.layoutVertexArray.emplaceBack(Q[0].x,Q[0].y),s.lineIndexArray.emplaceBack(ue+Q.length-1,ue),O.push(Q[0].x),O.push(Q[0].y);for(let he=1;he<Q.length;he++)x(Q[he],N,G),s.layoutVertexArray.emplaceBack(Q[he].x,Q[he].y),s.lineIndexArray.emplaceBack(ue+he-1,ue+he),O.push(Q[he].x),O.push(Q[he].y);le.vertexLength+=Q.length,le.primitiveLength+=Q.length}const re=vs(O,B);for(let Q=0;Q<re.length;Q+=3)s.indexArray.emplaceBack(M+re[Q],M+re[Q+1],M+re[Q+2]);if(re.length>0&&u&&this.elevationMode==="hd-road-base"){const Q=u.elevation.isTunnel(),le=u.elevation.safeArea,ue=this.elevatedStructures.addVertices(N,G);this.elevatedStructures.addTriangles(re,ue,Q);const he=H.length;if(he>0){for(let Te=0;Te<he-1;Te++)this.elevatedStructures.addRenderableRing(u.index,H[Te]+ue,H[Te+1]-H[Te],Q,le,u.featureInfo);this.elevatedStructures.addRenderableRing(u.index,H[he-1]+ue,N.length-H[he-1],Q,le,u.featureInfo)}}R.vertexLength+=A,R.primitiveLength+=re.length/3}return[f,g]}prepareElevatedPolygons(r,s,u){const f=1/Aa(u),g=[];for(const v of r){const x=YG(v,new cv(s,f),.1);g.push(...x)}return g}clipPolygonsToTile(r,s){const u=-s,f=-s,g=Bt+s,v=Bt+s;let x=0;const w=[],A=[];for(;x<r.length;x++){const O=r[x],B=qy(O);(B.min.x>=u&&B.max.x<=g&&B.min.y>=f&&B.max.y<=v?w:A).push(O)}if(w.length===r.length)return r;const R=[new St(u,f),new St(g,f),new St(g,v),new St(u,v),new St(u,f)],M=w;for(const O of A)M.push(...ZG(O,R));return M}}let nO,rO,iO,oO;Kt(qw,"FillBucket",{omit:["layers","patternFeatures"]}),Kt(sA,"FillBufferData"),Kt(Pa,"ElevatedStructures");class Xw{constructor(r,s,u,f){if(this.triangleCount=s.length/3,this.min=new St(0,0),this.max=new St(0,0),this.xScale=0,this.yScale=0,this.cellsX=0,this.cellsY=0,this.cells=[],this.payload=[],this.triangleCount===0||r.length===0)return;const[g,v]=[r[0].clone(),r[0].clone()];for(let M=1;M<r.length;++M){const O=r[M];g.x=Math.min(g.x,O.x),g.y=Math.min(g.y,O.y),v.x=Math.max(v.x,O.x),v.y=Math.max(v.y,O.y)}if(f){const M=Math.ceil(Math.max(v.x-g.x,v.y-g.y)/f);u=Math.max(u,M)}if(u===0)return;this.min=g,this.max=v;const x=this.max.sub(this.min);x.x=Math.max(x.x,1),x.y=Math.max(x.y,1);const w=Math.max(x.x,x.y)/u;this.cellsX=Math.max(1,Math.ceil(x.x/w)),this.cellsY=Math.max(1,Math.ceil(x.y/w)),this.xScale=1/w,this.yScale=1/w;const A=[];for(let M=0;M<this.triangleCount;M++){const O=r[s[3*M+0]].sub(this.min),B=r[s[3*M+1]].sub(this.min),N=r[s[3*M+2]].sub(this.min),G=Bu(Math.floor(Math.min(O.x,B.x,N.x)),this.xScale,this.cellsX),H=Bu(Math.floor(Math.max(O.x,B.x,N.x)),this.xScale,this.cellsX),J=Bu(Math.floor(Math.min(O.y,B.y,N.y)),this.yScale,this.cellsY),re=Bu(Math.floor(Math.max(O.y,B.y,N.y)),this.yScale,this.cellsY),Q=new St(0,0),le=new St(0,0),ue=new St(0,0),he=new St(0,0);for(let Te=J;Te<=re;++Te){Q.y=le.y=Te*w,ue.y=he.y=(Te+1)*w;for(let me=G;me<=H;++me)Q.x=ue.x=me*w,le.x=he.x=(me+1)*w,(pe(O,B,N,Q,le,he)||pe(O,B,N,Q,he,ue))&&A.push({cellIdx:Te*this.cellsX+me,triIdx:M})}}if(A.length===0)return;
24A.sort((M,O)=>M.cellIdx-O.cellIdx||M.triIdx-O.triIdx);let R=0;for(;R<A.length;){const M=A[R].cellIdx,O={start:this.payload.length,len:0};for(;R<A.length&&A[R].cellIdx===M;)++O.len,this.payload.push(A[R++].triIdx);this.cells[M]=O}}_lazyInitLookup(){this.lookup||(this.lookup=new Uint8Array(Math.ceil(this.triangleCount/8))),this.lookup.fill(0)}queryPoint(r,s){if(this.triangleCount===0||this.cells.length===0||r.x>this.max.x||this.min.x>r.x||r.y>this.max.y||this.min.y>r.y)return;const u=Bu(r.x-this.min.x,this.xScale,this.cellsX),f=Bu(r.y-this.min.y,this.yScale,this.cellsY),g=this.cells[f*this.cellsX+u];if(g){this._lazyInitLookup();for(let v=0;v<g.len;v++){const x=this.payload[g.start+v],w=Math.floor(x/8),A=1<<x%8;if(!(this.lookup[w]&A)&&(this.lookup[w]|=A,s.push(x),s.length===this.triangleCount))return}}}query(r,s,u){if(this.triangleCount===0||this.cells.length===0||r.x>this.max.x||this.min.x>s.x||r.y>this.max.y||this.min.y>s.y)return;this._lazyInitLookup();const f=Bu(r.x-this.min.x,this.xScale,this.cellsX),g=Bu(s.x-this.min.x,this.xScale,this.cellsX),v=Bu(r.y-this.min.y,this.yScale,this.cellsY),x=Bu(s.y-this.min.y,this.yScale,this.cellsY);for(let w=v;w<=x;w++)for(let A=f;A<=g;A++){const R=this.cells[w*this.cellsX+A];if(R)for(let M=0;M<R.len;M++){const O=this.payload[R.start+M],B=Math.floor(O/8),N=1<<O%8;if(!(this.lookup[B]&N)&&(this.lookup[B]|=N,u.push(O),u.length===this.triangleCount))return}}}}function Bu(l,r,s){return Math.max(0,Math.min(s-1,Math.floor(l*r)))}Kt(Xw,"TriangleGridIndex");class sO{constructor(r){this.zoom=r.zoom,this.layers=r.layers,this.layerIds=this.layers.map(s=>s.fqid),this.index=r.index,this.hasPattern=!1,this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id),this.footprints=[],this.worldview=r.worldview,this.hasAppearances=null}updateFootprints(r,s){for(const u of this.footprints)s.push({footprint:u,id:r})}updateAppearances(r,s,u,f){return{hasLayoutChanges:!1,hasUboChanges:!1}}populate(r,s,u,f){const g=[];for(const{feature:v,id:x,index:w,sourceLayerIndex:A}of r){const R=this.layers[0]._featureFilter.needGeometry,M=Ya(v,R);if(!this.layers[0]._featureFilter.filter(new Tr(this.zoom,{worldview:this.worldview,activeFloors:s.activeFloors}),M,u))continue;const O={id:x,properties:v.properties,type:v.type,sourceLayerIndex:A,index:w,geometry:R?M.geometry:sa(v,u,f),patterns:{}};g.push(O)}for(const v of g){const{geometry:x,index:w,sourceLayerIndex:A}=v;this.addFeature(v,x,w,u,{},s.availableImages,s.brightness),s.featureIndex.insert(r[w].feature,x,w,A,this.index)}}isEmpty(){return this.footprints.length===0}uploadPending(){return!1}upload(r){}update(r,s,u,f,g,v,x){}destroy(){}addFeature(r,s,u,f,g,v=[],x){for(const w of mv(s,2)){const A=[],R=[],M=[],O=new St(1/0,1/0),B=new St(-1/0,-1/0);for(const H of w)if(H.length!==0){H!==w[0]&&M.push(R.length/2);for(let J=0;J<H.length;J++)R.push(H[J].x),R.push(H[J].y),A.push(H[J]),O.x=Math.min(O.x,H[J].x),O.y=Math.min(O.y,H[J].y),B.x=Math.max(B.x,H[J].x),B.y=Math.max(B.y,H[J].y)}const N=vs(R,M),G=new Xw(A,N,8,256);this.footprints.push({vertices:A,indices:N,grid:G,min:O,max:B})}}}Kt(sO,"ClipBucket",{omit:["layers"]});const KG=Jn([{name:"a_pos_normal_ed",components:4,type:"Int16"}]),JG=Jn([{name:"a_pos_end",components:4,type:"Int16"},{name:"a_angular_offset_factor",components:1,type:"Int16"}]),QG=Jn([{name:"a_flood_light_ground_radius",components:1,type:"Float32"}]),eH=Jn([{name:"a_centroid_pos",components:2,type:"Uint16"}]),tH=Jn([{name:"a_join_normal_inside",components:3,type:"Int16"}]),nH=Jn([{name:"a_hidden_by_landmark",components:1,type:"Uint8"}]),rH=Jn([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]),{members:iH}=KG,yv=Number.MAX_SAFE_INTEGER,oH=yv-1;function aO(l,r,s,u){return l.order<r||l.order===yv||!(l.clipMask&s)||(function(f,g){if(g.length===0)return!1;let v=f;for(;v!=="";){if(g.includes(v))return!1;v=pw(v)}return!0})(u,l.clipScope)}function Zw(l,r){return l.x-r.x||l.y-r.y}function lO(l,r){return Zw(l.min,r.min)===0&&Zw(l.max,r.max)===0}function aA(l,r){return!(l.min.x>r.max.x||l.max.x<r.min.x||l.min.y>r.max.y||l.max.y<r.min.y)}function Yw(l,r){if(l.length!==r.length)return!1;for(let s=0;s<l.length;
vendor: 4,196 bytes, line 24
24s++)if(l[s].sourceId!==r[s].sourceId||!lO(l[s],r[s])||l[s].order!==r[s].order||l[s].clipMask!==r[s].clipMask||!dl(l[s].clipScope,r[s].clipScope))return!1;return!0}function cO(l,r,s){const u=1/Bt,f=1/(1<<s.canonical.z),g=(r.x*u+s.canonical.x)*f+s.wrap,v=(r.y*u+s.canonical.y)*f;return{min:new St((l.x*u+s.canonical.x)*f+s.wrap,(l.y*u+s.canonical.y)*f),max:new St(g,v)}}function sH(l,r,s){const u=1<<s.canonical.z,f=((r.x-s.wrap)*u-s.canonical.x)*Bt,g=(r.y*u-s.canonical.y)*Bt;return{min:new St(((l.x-s.wrap)*u-s.canonical.x)*Bt,(l.y*u-s.canonical.y)*Bt),max:new St(f,g)}}function lA(l,r,s,u,f,g,v){const x=l.indices,w=l.vertices,A=[];for(let R=u;R<u+f;R+=3){const M=r[s[R+0]+g],O=r[s[R+1]+g],B=r[s[R+2]+g],N=Math.min(M.x,O.x,B.x),G=Math.max(M.x,O.x,B.x),H=Math.min(M.y,O.y,B.y),J=Math.max(M.y,O.y,B.y);A.length=0,l.grid.query(new St(N,H),new St(G,J),A);for(let re=0;re<A.length;re++){const Q=A[re];if(pe(w[x[3*Q+0]],w[x[3*Q+1]],w[x[3*Q+2]],M,O,B,v))return!0}}return!1}function uO(l,r,s,u){if(!l||!s)return!1;let f=l.vertices;if(!r.canonical.equals(u.canonical)||r.wrap!==u.wrap){if(s.vertices.length<l.vertices.length)return uO(s,u,l,r);const g=r.canonical,v=u.canonical,x=Math.pow(2,v.z-g.z);f=l.vertices.map(w=>new St((w.x+g.x*Bt)*x-v.x*Bt,(w.y+g.y*Bt)*x-v.y*Bt))}return lA(s,f,l.indices,0,l.indices.length,0,0)}function dO(l,r,s,u){const f=Math.pow(2,u.z-s.z);return new St((l+s.x*Bt)*f-u.x*Bt,(r+s.y*Bt)*f-u.y*Bt)}function hO(l,r){const s=[];r.grid.queryPoint(l,s);const u=r.indices,f=r.vertices;for(let g=0;g<s.length;g++){const v=s[g];if(ee([f[u[3*v+0]],f[u[3*v+1]],f[u[3*v+2]]],l))return!0}return!1}const Kw={None:0,Model:1,Symbol:2,FillExtrusion:4},cA=[new St(0,0),new St(Bt,0),new St(Bt,Bt),new St(0,Bt)];function fO(l,r){const s=[];let u=[];if(!r||l.length<2)return[l];if(l.length===2)return se(l[0],l[1],cA)?[l]:[];for(let f=0;f<l.length+2;f++){const g=f===0?l.at(-1):l[(f-1)%l.length],v=l[f%l.length],x=l[(f+1)%l.length],w=se(g,v,cA),A=se(v,x,cA),R=w||A;R&&u.push(v),R&&A||u.length>0&&(u.length>1&&s.push(u),u=[])}return u.length>1&&s.push(u),s}const uA=Ou.types,aH=["fill-extrusion-base","fill-extrusion-height","fill-extrusion-color","fill-extrusion-pattern","fill-extrusion-flood-light-wall-radius","fill-extrusion-line-width","fill-extrusion-emissive-strength"],lH=["fill-extrusion-flood-light-ground-radius"],cH=Math.pow(2,13),uH=Math.pow(2,15)-1,Jw=new St(0,1),Vd=2147483648,Qw=1073741824;function vv(l,r,s,u,f,g,v,x){l.emplaceBack((r<<1)+v,(s<<1)+g,(Math.floor(u*cH)<<1)+f,Math.round(x))}function bv(l,r,s){l.emplaceBack(r.x*Bt,r.y*Bt,s?1:0)}function eS(l,r,s,u,f,g){l.emplaceBack(r.x,r.y,(s.x<<1)+u,(s.y<<1)+f,g)}function xv(l,r,s){l.emplaceBack(r.x,r.y,r.z,s[0]*16384,s[1]*16384,s[2]*16384)}class pO{constructor(){this.vertexOffset=0,this.vertexCount=0,this.indexOffset=0,this.indexCount=0}}class tS{constructor(){this.data=[]}get length(){return this.data.length}push(r){this.data.push(r)}get(r){return this.data[r]}static serialize(r,s){const u=r.data.length,f=new Uint32Array(4*u),g=[];g.length=u;for(let v=0;v<u;v++){const x=r.data[v],w=4*v;f[w]=x.vertexOffset,f[w+1]=x.vertexCount,f[w+2]=x.indexOffset,f[w+3]=x.indexCount,g[v]=x.ringIndices}return s&&s.add(f.buffer),{scalars:f,rings:g}}static deserialize(r){const{scalars:s,rings:u}=r,f=s.length/4,g=new tS,v=[];v.length=f,g.data=v;for(let x=0;x<f;x++){const w=4*x,A=new pO;A.vertexOffset=s[w],A.vertexCount=s[w+1],A.indexOffset=s[w+2],A.indexCount=s[w+3],A.ringIndices=u[x],g.data[x]=A}return g}}class nS{constructor(){this.centroidXY=new St(0,0),this.vertexArrayOffset=0,this.vertexCount=0,this.groundVertexArrayOffset=0,this.groundVertexCount=0,this.flags=0,this.footprintSegIdx=-1,this.footprintSegLen=0,this.polygonSegIdx=-1,this.polygonSegLen=0,this.min=new St(Number.MAX_VALUE,Number.MAX_VALUE),this.max=new St(-Number.MAX_VALUE,-Number.MAX_VALUE),this.height=0,this.buildingId=0,this.groupCentroidPos=new St(0,0)}span(){return new St(this.max.x-this.min.x,this.max.y-this.min.y)}}class rS{constructor(){this.data=[],this.buffer=null}get length(){return this.data.length}push(r){this.data.push(r)}get(r){return this.data[r]}find(r){return this.data.find(r)}[Symbol.iterator](){return this.data[Symbol.iterator]()}
vendor: 4,649 bytes, line 24
24static serialize(r,s){const u=r.data.length,f=new Float64Array(15*u);for(let g=0;g<u;g++){const v=r.data[g],x=15*g;f[x]=v.centroidXY.x,f[x+1]=v.centroidXY.y,f[x+2]=v.min.x,f[x+3]=v.min.y,f[x+4]=v.max.x,f[x+5]=v.max.y,f[x+6]=v.groupCentroidPos.x,f[x+7]=v.groupCentroidPos.y,f[x+8]=v.vertexArrayOffset,f[x+9]=v.vertexCount,f[x+10]=v.groundVertexArrayOffset,f[x+11]=v.groundVertexCount,f[x+12]=v.footprintSegLen,f[x+13]=v.height,f[x+14]=v.buildingId}return s&&s.add(f.buffer),{buffer:f}}static deserialize(r){const s=r.buffer,u=s.length/15,f=new rS;f.buffer=s;const g=[];g.length=u,f.data=g;let v=0;for(let x=0;x<u;x++){const w=15*x,A=new nS;A.centroidXY=new St(s[w],s[w+1]),A.min=new St(s[w+2],s[w+3]),A.max=new St(s[w+4],s[w+5]),A.groupCentroidPos=new St(s[w+6],s[w+7]),A.vertexArrayOffset=s[w+8],A.vertexCount=s[w+9],A.groundVertexArrayOffset=s[w+10],A.groundVertexCount=s[w+11],A.footprintSegLen=s[w+12],A.height=s[w+13],A.buildingId=s[w+14],A.footprintSegIdx=v,v+=A.footprintSegLen,f.data[x]=A}return f}}class dA{constructor(){this.acc=new St(0,0),this.accCount=0,this.centroidDataIndex=0}startRing(r,s){r.min.x===Number.MAX_VALUE&&(r.min.x=r.max.x=s.x,r.min.y=r.max.y=s.y)}appendEdge(r,s,u){this.accCount++,this.acc._add(s);let f=!!this.borders;s.x<r.min.x?(r.min.x=s.x,f=!0):s.x>r.max.x&&(r.max.x=s.x,f=!0),s.y<r.min.y?(r.min.y=s.y,f=!0):s.y>r.max.y&&(r.max.y=s.y,f=!0),((s.x===0||s.x===Bt)&&s.x===u.x)!=((s.y===0||s.y===Bt)&&s.y===u.y)&&this.processBorderOverlap(s,u),f&&this.checkBorderIntersection(s,u)}checkBorderIntersection(r,s){s.x<0!=r.x<0&&this.addBorderIntersection(0,Sn(s.y,r.y,(0-s.x)/(r.x-s.x))),s.x>Bt!=r.x>Bt&&this.addBorderIntersection(1,Sn(s.y,r.y,(Bt-s.x)/(r.x-s.x))),s.y<0!=r.y<0&&this.addBorderIntersection(2,Sn(s.x,r.x,(0-s.y)/(r.y-s.y))),s.y>Bt!=r.y>Bt&&this.addBorderIntersection(3,Sn(s.x,r.x,(Bt-s.y)/(r.y-s.y)))}addBorderIntersection(r,s){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const u=this.borders[r];s<u[0]&&(u[0]=s),s>u[1]&&(u[1]=s)}processBorderOverlap(r,s){if(r.x===s.x){if(r.y===s.y)return;const u=r.x===0?0:1;this.addBorderIntersection(u,s.y),this.addBorderIntersection(u,r.y)}else{const u=r.y===0?2:3;this.addBorderIntersection(u,s.x),this.addBorderIntersection(u,r.x)}}centroid(){return this.accCount===0?new St(0,0):new St(Math.floor(Math.max(0,this.acc.x)/this.accCount),Math.floor(Math.max(0,this.acc.y)/this.accCount))}intersectsCount(){return this.borders?this.borders.reduce((r,s)=>r+ +(s[0]!==Number.MAX_VALUE),0):0}}function mO(l,r){const s=l.add(r)._unit(),u=Ee(l.x*s.x+l.y*s.y,-1,1);var f,g,v;return v=Math.acos(u),Math.min(4,Math.max(-4,Math.tan(v)))/4*uH*((f=l).x*(g=r).y-f.y*g.x<0?-1:1)}const dH=[l=>l.x<0,l=>l.x>Bt,l=>l.y<0,l=>l.y>Bt];function hH(l,r,s,u){const f=[4];if(u===0)return f;s._mult(u);const g=l.sub(s),v=r.sub(s),x=[l,r,g,v];for(let w=0;w<4;w++)for(const A of x)if(dH[w](A)){f.push(w);break}return f}class hA{constructor(r){this.groundRadiusArray=null,this.groundRadiusBuffer=null,this.vertexArray=new z0,this.indexArray=new _i,this.programConfigurations=new Ea(r.layers,{zoom:r.zoom,lut:r.lut},s=>lH.includes(s)),this._segments=new Wr,this.hiddenByLandmarkVertexArray=new Gp,this._segmentToGroundQuads={},this._segmentToGroundQuads[0]=[],this._segmentToRegionTriCounts={},this._segmentToRegionTriCounts[0]=[0,0,0,0,0],this.regionSegments={},this.regionSegments[4]=new Wr}getDefaultSegment(){return this.regionSegments[4]}hasData(){return this.vertexArray.length!==0}addData(r,s,u,f=!1){const g=r.length;if(g>2){let v=Math.max(0,this._segments.get().length-1);const x=this._segments._prepareSegment(4*g,this.vertexArray.length,2*this._segmentToGroundQuads[v].length);let w;v!==this._segments.get().length-1&&(v++,this._segmentToGroundQuads[v]=[],this._segmentToRegionTriCounts[v]=[0,0,0,0,0]);{const A=r[0],R=r[1];w=mO(A.sub(r[g-1])._perp()._unit(),R.sub(A)._perp()._unit())}for(let A=0;A<g;A++){const R=A===g-1?0:A+1,M=r[A],O=r[R],B=r[R===g-1?0:R+1],N=O.sub(M)._perp()._unit(),G=mO(N,B.sub(O)._perp()._unit()),H=w,J=G;if(fA(M,O,s)||f&&yO(M,s)&&yO(O,s)){w=G;continue}const re=x.vertexLength;eS(this.vertexArray,M,O,1,1,H),eS(this.vertexArray,M,O,1,0,H),eS(this.vertexArray,M,O,0,1,J),eS(this.vertexArray,M,O,0,0,J),x.vertexLength+=4;const Q=hH(M,O,N,u);for(const le of Q)this._segmentToGroundQuads[v].push({id:re,region:le}),this._segmentToRegionTriCounts[v][le]+=2,x.primitiveLength+=2;w=G}}}prepareBorderSegments(){if(!this.hasData())return;const r=this._segments.get(),s=r.length;for(let u=0;u<s;u++)this._segmentToGroundQuads[u].sort((f,g)=>
vendor: 4,571 bytes, line 24
24f.region-g.region);for(let u=0;u<s;u++){const f=this._segmentToGroundQuads[u],g=r[u],v=this._segmentToRegionTriCounts[u];v.reduce((w,A)=>w+A,0);let x=0;for(let w=0;w<=4;w++){const A=v[w];if(A!==0){let R=this.regionSegments[w];R||(R=this.regionSegments[w]=new Wr);const M={vertexOffset:g.vertexOffset,primitiveOffset:g.primitiveOffset+x,vertexLength:g.vertexLength,primitiveLength:A};R.get().push(M)}x+=A}for(let w=0;w<f.length;w++){const A=f[w].id;this.indexArray.emplaceBack(A,A+1,A+3),this.indexArray.emplaceBack(A,A+3,A+2)}}this._segmentToGroundQuads=null,this._segmentToRegionTriCounts=null,this._segments.destroy(),this._segments=null}addPaintPropertiesData(r,s,u,f,g,v,x){this.hasData()&&this.programConfigurations.populatePaintArrays(this.vertexArray.length,r,s,u,f,g,v,void 0,x)}upload(r){this.hasData()&&(this.vertexBuffer=r.createVertexBuffer(this.vertexArray,JG.members),this.indexBuffer=r.createIndexBuffer(this.indexArray),this.groundRadiusArray!=null&&(this.groundRadiusBuffer=r.createVertexBuffer(this.groundRadiusArray,QG.members)))}uploadPaintProperties(r){this.hasData()&&this.programConfigurations.upload(r)}update(r,s,u,f,g,v,x,w){this.hasData()&&this.programConfigurations.updatePaintArrays(r,s,u,f,g,v,x,w)}updateHiddenByLandmark(r){this.updateHiddenByLandmarkRange(r.groundVertexArrayOffset,r.groundVertexCount,!!(r.flags&Vd||r.flags&Qw))}updateHiddenByLandmarkRange(r,s,u){if(!this.hasData())return;const f=s+r;if(s!==0){for(let g=r;g<f;++g)this.hiddenByLandmarkVertexArray.emplace(g,u?1:0);this._needsHiddenByLandmarkUpdate=!0}}uploadHiddenByLandmark(r){this.hasData()&&this._needsHiddenByLandmarkUpdate&&(!this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexArray.length>0?this.hiddenByLandmarkVertexBuffer=r.createVertexBuffer(this.hiddenByLandmarkVertexArray,nH.members,!0):this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.updateData(this.hiddenByLandmarkVertexArray),this._needsHiddenByLandmarkUpdate=!1)}destroy(){if(this.vertexBuffer){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.destroy(),this.groundRadiusBuffer&&this.groundRadiusBuffer.destroy(),this._segments&&this._segments.destroy(),this.programConfigurations.destroy();for(let r=0;r<=4;r++){const s=this.regionSegments[r];s&&s.destroy()}}}}class iS{constructor(r){this.zoom=r.zoom,this.canonical=r.canonical,this.overscaling=r.overscaling,this.layers=r.layers,this.pixelRatio=r.pixelRatio,this.layerIds=this.layers.map(s=>s.fqid),this.index=r.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=r.projection,this.activeReplacements=[],this.replacementUpdateTime=0,this.centroidData=new rS,this.footprintIndices=new _i,this.footprintVertices=new Ha,this.footprintSegments=new tS,this.layoutVertexArray=new B0,this.centroidVertexArray=new Sw,this.wallVertexArray=new Ew,this.indexArray=new _i,this.programConfigurations=new Ea(r.layers,{zoom:r.zoom,lut:r.lut},s=>aH.includes(s)),this.segments=new Wr,this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id),this.groundEffect=new hA(r),this.maxHeight=0,this.partLookup={},this.triangleSubSegments=[],this.polygonSegments=[],this.buildingGroups=new Map,this.worldview=r.worldview,this.hasAppearances=null}updateFootprints(r,s){}updateAppearances(r,s,u,f){return{hasLayoutChanges:!1,hasUboChanges:!1}}populate(r,s,u,f){this.features=[],this.hasPattern=Y2("fill-extrusion",this.layers,this.pixelRatio,s),this.featuresOnBorder=[],this.borderFeatureIndices=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.selfDEMTileTimestamp=Number.MAX_VALUE,this.borderDEMTileTimestamp=[Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE],this.tileToMeter=Aa(u),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter,this.wallMode=this.layers[0].paint.get("fill-extrusion-line-width").constantOr(1)!==0;for(const{feature:g,id:v,index:x,sourceLayerIndex:w}of r){const A=this.layers[0]._featureFilter.needGeometry,R=Ya(g,A);if(!this.layers[0]._featureFilter.filter(new Tr(this.zoom,{worldview:this.worldview,activeFloors:s.activeFloors}),R,u))continue;const M={id:v,sourceLayerIndex:w,index:x,geometry:A?R.geometry:sa(g,u,f),properties:g.properties,type:g.type,patterns:{}},O=this.layoutVertexArray.length,B=uA[M.type]==="Polygon";if(this.hasPattern)this.features.push({featureId:g.id,feature:K2("fill-extrusion",this.layers,M,this.zoom,this.pixelRatio,s)});else if(this.wallMode)for(const N of M.geometry)for(const G of fO(N,B))this.addFeature(g.i
24d,M,[G],x,u,{},s.availableImages,f,s.brightness);else this.addFeature(g.id,M,M.geometry,x,u,{},s.availableImages,f,s.brightness);s.featureIndex.insert(g,M.geometry,x,w,this.index,O)}this._finalizeBuildingGroups(),this.sortBorders(),this.projection.name==="mercator"&&this.splitToSubtiles(),this.groundEffect.prepareBorderSegments(),this.polygonSegments.length=0}addFeatures(r,s,u,f,g,v){for(const{featureId:x,feature:w}of this.features){const A=uA[w.type]==="Polygon",{geometry:R}=w;if(this.wallMode)for(const M of R)for(const O of fO(M,A))this.addFeature(x,w,[O],w.index,s,u,f,g,v);else this.addFeature(x,w,R,w.index,s,u,f,g,v)}this._finalizeBuildingGroups(),this.sortBorders(),this.projection.name==="mercator"&&this.splitToSubtiles()}update(r,s,u,f,g,v,x){this.programConfigurations.updatePaintArrays(r,s,g,u,f,v,x,this.worldview),this.groundEffect.update(r,s,g,u,f,v,x,this.worldview)}updateExpressions(r){this.programConfigurations.updateExpressions(r),this.groundEffect.programConfigurations.updateExpressions(r)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload||this.groundEffect.programConfigurations.needsUpload}upload(r){this.uploaded||(this.layoutVertexBuffer=r.createVertexBuffer(this.layoutVertexArray,iH),this.indexBuffer=r.createIndexBuffer(this.indexArray),this.wallVertexBuffer=r.createVertexBuffer(this.wallVertexArray,tH.members),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=r.createVertexBuffer(this.layoutVertexExtArray,rH.members,!0)),this.groundEffect.upload(r)),this.groundEffect.uploadPaintProperties(r),this.programConfigurations.upload(r),this.uploaded=!0}uploadCentroid(r){this.groundEffect.uploadHiddenByLandmark(r),this.needsCentroidUpdate&&(!this.centroidVertexBuffer&&this.centroidVertexArray.length>0?this.centroidVertexBuffer=r.createVertexBuffer(this.centroidVertexArray,eH.members,!0):this.centroidVertexBuffer&&this.centroidVertexBuffer.updateData(this.centroidVertexArray),this.needsCentroidUpdate=!1)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.layoutVertexExtBuffer&&this.layoutVertexExtBuffer.destroy(),this.groundEffect.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(r,s,u,f,g,v,x,w,A){const R=this.layers[0].paint.get("fill-extrusion-flood-light-ground-radius").evaluate(s,{})/this.tileToMeter,M=[new St(0,0),new St(Bt,Bt)],O=w.projection,B=O.name==="globe",N=this.wallMode||uA[s.type]==="Polygon",G=new dA;G.centroidDataIndex=this.centroidData.length;const H=new nS;H.buildingId=r,s.properties&&Object.hasOwn(s.properties,"building_id")&&(H.buildingId=Number(s.properties.building_id)),G.buildingId=H.buildingId;const J=this.layers[0].paint.get("fill-extrusion-base").evaluate(s,{},g)<=0,re=this.layers[0].paint.get("fill-extrusion-height").evaluate(s,{},g);let Q;if(H.height=re,H.vertexArrayOffset=this.layoutVertexArray.length,H.groundVertexArrayOffset=this.groundEffect.vertexArray.length,B&&!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new Gg),this.wallMode){if(B)return void On("Non zero fill-extrusion-line-width is not yet supported on globe.");if(u.length!==1)return;Q=(function(_e){const we=_e[0].x===_e.at(-1).x&&_e[0].y===_e.at(-1).y;(function(At){let It=0;const Xt=At.length;for(let Yt=0;Yt<Xt;Yt++)It+=(At[(Yt+1)%Xt].x-At[Yt].x)*(At[(Yt+1)%Xt].y+At[Yt].y);return It>=0})(_e)||(_e=_e.reverse());const He={geometry:[],joinNormals:[],indices:[]},Qe=[],it=[],nt=[];let bt=_e.length;for(;bt>=2&&_e[bt-1].equals(_e[bt-2]);)bt--;if(bt<(we?3:2))return He;let Ze,et,ot,ft,_t,Ft=0;for(;Ft<bt-1&&_e[Ft].equals(_e[Ft+1]);)Ft++;we&&(Ze=_e[bt-2],_t=_e[Ft].sub(Ze)._unit()._perp());for(let At=Ft;At<bt;At++){if(ot=At===bt-1?we?_e[Ft+1]:void 0:_e[At+1],ot&&_e[At].equals(ot))continue;_t&&(ft=_t),Ze&&(et=Ze),Ze=_e[At],_t=ot?ot.sub(Ze)._unit()._perp():ft,ft=ft||_t;let It=ft.add(_t);It.x===0&&It.y===0||It._unit();const Xt=It.x*_t.x+It.y*_t.y,Yt=Xt!==0?1/Xt:1/0,gn=ft.x*_t.y-ft.y*_t.x>0;let on="miter";const En=2;on==="miter"&&Yt>En&&(on="bevel"),on==="bevel"&&(Yt>100&&(on="flipbevel"),Yt<En&&(on="miter"));const _r=(Nn,sr,Zn,Pi)=>{const Cr=new St(Nn.x,Nn.y),gr=new St(Nn.x,Nn.y);Cr.x+=sr.x*Pi,Cr.y+=sr.y*Pi,gr.x-=sr.x*Math.max(Zn,1),gr.y-=sr.y*Math.max(Zn,1),nt.push(sr),Qe.push(Cr),it.push(gr)};if(on==="miter")It._mult(Yt),_r(Ze,It,0,0);else if(on==="flipbevel")It=_t.mult(-1),_r(Ze,It,0,0),_r(Ze,It.mult(-1),0,0);else{const Nn=-Math.sqrt(Yt*Yt-1),sr=gn?Nn:0,Zn=gn?0:Nn;et&&_r(Ze,ft,sr,Zn),ot&&_r(Ze,_t,sr,Zn)}}He.geometry=[...Qe,...it.reverse(),Qe[0]],He.joinNormals=[...nt,...nt.reverse(),nt.at(-1)];const ut=He.geometry.length-1;for(let At=0;At<ut/2;At++)if(At+1<ut/2){let It=At,Xt=At+1,Yt=ut-1-At,gn=ut-2-At;It=It===0?ut-1:It-1,Xt=Xt===0?ut-1:Xt-1,Yt=Yt===0?ut-1:Yt-1,gn=gn===0?ut-1:gn-1,He.indices.push(Yt),He.indices.push(Xt),He.indices.push(It),He.indices.push(Yt),He.indices.push(gn),He.indices.push(Xt)}return He})(u[0]),u=[Q.geometry]}const le=(_e,we)=>_e<(we.length-1)/2||_e===we.length-1,ue=this.wallMode?[u]:mv(u,500);for(let _e=ue.length-1;_e>=0;_e--){const we=ue[_e];(we.length===0||pH(we[0]))&&ue.splice(_e,1)}let he;if(B)he=wO(ue,M,g);else{he=[];for(const _e of ue)he.push({polygon:_e,bounds:M})}const Te=N?this.edgeRadius:0,me=Te>0&&this.zoom<17,xe=(_e,we)=>{if(_e.length===0)return!1;const je=_e.at(-1);return we.x===je.x&&we.y===je.y};for(const{polygon:_e,bounds:we}of he){let je=0,He=0;for(const bt of _e)N&&!bt[0].equals(bt.at(-1))&&bt.push(bt[0]),He+=N?bt.length-1:bt.length;const Qe=this.segments.prepareSegment((N?5:4)*He,this.layoutVertexArray,this.indexArray);H.footprintSegIdx<0&&(H.footprintSegIdx=this.footprintSegments.length),H.polygonSegIdx<0&&(H.polygonSegIdx=this.polygonSegments.length);const it={triangleArrayOffset:this.indexArray.length,triangleCount:0,triangleSegIdx:this.segments.segments.length-1},nt=new pO;if(nt.vertexOffset=this.footprintVertices.length,nt.indexOffset=3*this.footprintIndices.length,nt.ringIndices=[],N){const bt=[],Ze=[];je=Qe.vertexLength;for(let ot=0;ot<_e.length;
vendor: 15,979 bytes, line 24
24ot++){const ft=_e[ot];ft.length&&ot!==0&&Ze.push(bt.length/2);const _t=[];let Ft,ut;Ft=ft[1].sub(ft[0])._perp()._unit(),nt.ringIndices.push(ft.length-1);for(let At=1;At<ft.length;At++){const It=ft[At],Xt=ft[At===ft.length-1?1:At+1],Yt=It.clone();if(Te){ut=Xt.sub(It)._perp()._unit();const gn=Ft.add(ut)._unit(),on=Te*Math.min(4,1/(Ft.x*gn.x+Ft.y*gn.y));Yt.x+=on*gn.x,Yt.y+=on*gn.y,Yt.x=Math.round(Yt.x),Yt.y=Math.round(Yt.y),Ft=ut}if(!J||Te!==0&&!me||xe(_t,Yt)||_t.push(Yt),vv(this.layoutVertexArray,Yt.x,Yt.y,0,0,1,1,0),this.wallMode){const gn=le(At,ft);bv(this.wallVertexArray,Q.joinNormals[At],!gn)}Qe.vertexLength++,this.footprintVertices.emplaceBack(It.x,It.y),bt.push(It.x,It.y),B&&xv(this.layoutVertexExtArray,O.projectTilePoint(Yt.x,Yt.y,g),O.upVector(g,Yt.x,Yt.y))}J&&(Te===0||me)&&(_t.length!==0&&xe(_t,_t[0])&&_t.pop(),this.groundEffect.addData(_t,we,R))}const et=this.wallMode?Q.indices:vs(bt,Ze);for(let ot=0;ot<et.length;ot+=3)this.footprintIndices.emplaceBack(nt.vertexOffset+et[ot+0],nt.vertexOffset+et[ot+1],nt.vertexOffset+et[ot+2]),this.indexArray.emplaceBack(je+et[ot],je+et[ot+2],je+et[ot+1]),Qe.primitiveLength++;nt.indexCount+=et.length,nt.vertexCount+=this.footprintVertices.length-nt.vertexOffset}for(let bt=0;bt<_e.length;bt++){const Ze=_e[bt];G.startRing(H,Ze[0]);let et=Ze.length>4&&vO(Ze[Ze.length-2],Ze[0],Ze[1]),ot=Te?fH(Ze[Ze.length-2],Ze[0],Ze[1],Te):0;const ft=[];let _t,Ft,ut;Ft=Ze[1].sub(Ze[0])._perp()._unit();let At=!0;for(let It=1,Xt=0;It<Ze.length;It++){let Yt=Ze[It-1],gn=Ze[It];const on=Ze[It===Ze.length-1?1:It+1];if(G.appendEdge(H,gn,Yt),fA(gn,Yt,we)){Te&&(Ft=on.sub(gn)._perp()._unit(),At=!At);continue}const En=gn.sub(Yt)._perp(),_r=En.x/(Math.abs(En.x)+Math.abs(En.y)),Nn=En.y>0?1:0,sr=Yt.dist(gn);if(Xt+sr>32768&&(Xt=0),Te){ut=on.sub(gn)._perp()._unit();let gr=_O(Yt,gn,on,gO(Ft,ut),Te);isNaN(gr)&&(gr=0);const jr=gn.sub(Yt)._unit();Yt=Yt.add(jr.mult(ot))._round(),gn=gn.add(jr.mult(-gr))._round(),ot=gr,Ft=ut,J&&this.zoom>=17&&(xe(ft,Yt)||ft.push(Yt),xe(ft,gn)||ft.push(gn))}const Zn=Qe.vertexLength,Pi=Ze.length>4&&vO(Yt,gn,on);let Cr=bO(Xt,et,At);if(vv(this.layoutVertexArray,Yt.x,Yt.y,_r,Nn,0,0,Cr),vv(this.layoutVertexArray,Yt.x,Yt.y,_r,Nn,0,1,Cr),this.wallMode){const gr=le(It-1,Ze),jr=Q.joinNormals[It-1];bv(this.wallVertexArray,jr,gr),bv(this.wallVertexArray,jr,gr)}if(Xt+=sr,Cr=bO(Xt,Pi,!At),et=Pi,vv(this.layoutVertexArray,gn.x,gn.y,_r,Nn,0,0,Cr),vv(this.layoutVertexArray,gn.x,gn.y,_r,Nn,0,1,Cr),this.wallMode){const gr=le(It,Ze),jr=Q.joinNormals[It];bv(this.wallVertexArray,jr,gr),bv(this.wallVertexArray,jr,gr)}if(Qe.vertexLength+=4,this.indexArray.emplaceBack(Zn+0,Zn+1,Zn+2),this.indexArray.emplaceBack(Zn+1,Zn+3,Zn+2),Qe.primitiveLength+=2,Te){const gr=je+(It===1?Ze.length-2:It-2),jr=It===1?je:gr+1;if(this.indexArray.emplaceBack(Zn+1,gr,Zn+3),this.indexArray.emplaceBack(gr,jr,Zn+3),Qe.primitiveLength+=2,_t===void 0&&(_t=Zn),!fA(on,Ze[It],we)){const mi=It===Ze.length-1?_t:Qe.vertexLength;this.indexArray.emplaceBack(Zn+2,Zn+3,mi),this.indexArray.emplaceBack(Zn+3,mi+1,mi),this.indexArray.emplaceBack(Zn+3,jr,mi+1),Qe.primitiveLength+=3}At=!At}if(B){const gr=this.layoutVertexExtArray,jr=O.projectTilePoint(Yt.x,Yt.y,g),mi=O.projectTilePoint(gn.x,gn.y,g),Co=O.upVector(g,Yt.x,Yt.y),Yr=O.upVector(g,gn.x,gn.y);xv(gr,jr,Co),xv(gr,jr,Co),xv(gr,mi,Yr),xv(gr,mi,Yr)}}N&&(je+=Ze.length-1),J&&Te&&this.zoom>=17&&(ft.length!==0&&xe(ft,ft[0])&&ft.pop(),this.groundEffect.addData(ft,we,R,Te>0))}this.footprintSegments.push(nt),it.triangleCount=this.indexArray.length-it.triangleArrayOffset,this.polygonSegments.push(it),++H.footprintSegLen,++H.polygonSegLen}if(H.vertexCount=this.layoutVertexArray.length-H.vertexArrayOffset,H.groundVertexCount=this.groundEffect.vertexArray.length-H.groundVertexArrayOffset,H.vertexCount!==0){if(H.centroidXY=G.borders?Jw:this.encodeCentroid(G,H),s.properties&&Object.hasOwn(s.properties,"building_id")){const _e=H.buildingId;let we=this.buildingGroups.get(_e);we||(we={accX:0,accY:0,accCount:0,mergedMin:new St(Number.MAX_VALUE,Number.MAX_VALUE),mergedMax:new St(-Number.MAX_VALUE,-Number.MAX_VALUE),partIndices:[]},this.buildingGroups.set(_e,we)),we.accX+=G.acc.x,we.accY+=G.acc.y,we.accCount+=G.accCount,we.mergedMin.x=Math.min(we.mergedMin.x,H.min.x),we.mergedMin.y=Math.min(we.mergedMin.y,H.min.y),we.mergedMax.x=Math.max(we.mergedMax.x,H.max.x),we.mergedMax.y=Math.max(we.mergedMax.y,H.max.y),we.partIndices.push(this.centroidData.length)}if(this.centroidData.push(H),G.borders){this.featuresOnBorder.push(G);const _e=this.featuresOnBorder.length-1;for(let we=0;we<G.borders.length;we++)G.borders[we][0]!==Number.MAX_VALUE&&this.borderFeatureIndices[we].push(_e)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,s,f,v,x,g,A,void 0,this.worldview),this.groundEffect.addPaintPropertiesData(s,f,v,x,g,A,this.worldview),this.maxHeight=Math.max(this.maxHeight,re)}}_finalizeBuildingGroups(){for(const[,r]of this.buildingGroups){if(r.partIndices.length===0)continue;const s=new dA;s.acc=new St(r.accX,r.accY),s.accCount=r.accCount;const u=new nS;u.min=r.mergedMin,u.max=r.mergedMax;const f=this.encodeCentroid(s,u),g=s.centroid();for(const v of r.partIndices){const x=this.centroidData.get(v);x.centroidXY.x===Jw.x&&x.centroidXY.y===Jw.y||(x.centroidXY=f),x.min=r.mergedMin,x.max=r.mergedMax,x.groupCentroidPos=g}}this.buildingGroups.clear()}sortBorders(){for(let r=0;r<this.borderFeatureIndices.length;r++)this.borderFeatureIndices[r].sort((s,u)=>this.featuresOnBorder[s].borders[r][0]-this.featuresOnBorder[u].borders[r][0])}splitToSubtiles(){const r=[];for(let x=0;x<this.centroidData.length;x++){const w=this.centroidData.get(x),A=+(w.min.y+w.max.y>Bt),R=2*A+(+(w.min.x+w.max.x>Bt)^A);for(let M=0;M<w.polygonSegLen;M++){const O=w.polygonSegIdx+M;r.push({centroidIdx:x,subtile:R,polygonSegmentIdx:O,triangleSegmentIdx:this.polygonSegments[O].triangleSegIdx})}}const s=new _i;r.sort((x,w)=>x.triangleSegmentIdx===w.triangleSegmentIdx?x.subtile-w.subtile:x.triangleSegmentIdx-w.triangleSegmentIdx);let u=0,f=0,g=0;for(const x of r){if(x.triangleSegmentIdx!==u)break;g++}const v=r.length;for(;f!==r.length;){u=r[f].triangleSegmentIdx;let x=0,w=f,A=f;for(let R=w;R<g&&r[R].subtile===x;R++)A++;for(;w!==g;){const R=r[w];x=R.subtile;const M=this.centroidData.get(R.centroidIdx).min.clone(),O=this.centroidData.get(R.centroidIdx).max.clone(),B={vertexOffset:this.segments.segments[u].vertexOffset,primitiveOffset:s.length,vertexLength:this.segments.segments[u].vertexLength,primitiveLength:0,sortKey:void 0,vaos:{}};for(let N=w;N<A;N++){const G=r[N],H=this.polygonSegments[G.polygonSegmentIdx],J=this.centroidData.get(G.centroidIdx).min,re=this.centroidData.get(G.centroidIdx).max,Q=this.indexArray.uint16;for(let le=H.triangleArrayOffset;le<H.triangleArrayOffset+H.triangleCount;le++)s.emplaceBack(Q[3*le],Q[3*le+1],Q[3*le+2]);B.primitiveLength+=H.triangleCount,M.x=Math.min(M.x,J.x),M.y=Math.min(M.y,J.y),O.x=Math.max(O.x,re.x),O.y=Math.max(O.y,re.y)}B.primitiveLength>0&&this.triangleSubSegments.push({segment:B,min:M,max:O}),w=A;for(let N=w;N<g&&r[N].subtile===r[w].subtile;N++)A++}f=g;for(let R=f;R<v&&r[R].triangleSegmentIdx===r[f].triangleSegmentIdx;R++)g++}s._trim(),this.indexArray=s}getVisibleSegments(r,s,u){const f=new Wr;if(this.wallMode){for(const G of this.triangleSubSegments)f.segments.push(G.segment);return f}let g=0,v=0;const x=1<<r.canonical.z;if(s){const G=s.getMinMaxForTile(r);G&&(g=G.min,v=G.max)}v+=this.maxHeight;const w=r.toUnwrapped();let A;const R=[w.canonical.x/x+w.wrap,w.canonical.y/x],M=[(w.canonical.x+1)/x+w.wrap,(w.canonical.y+1)/x],O=(G,H,J)=>[G[0]*(1-J[0])+H[0]*J[0],G[1]*(1-J[1])+H[1]*J[1]],B=[],N=[];for(const G of this.triangleSubSegments){B[0]=G.min.x/Bt,B[1]=G.min.y/Bt,N[0]=G.max.x/Bt,N[1]=G.max.y/Bt;const H=O(R,M,B),J=O(R,M,N);if(new pi([H[0],H[1],g],[J[0],J[1],v]).intersectsPrecise(u)===0){A&&(f.segments.push(A),A=void 0);continue}const re=G.segment;A&&A.vertexOffset!==re.vertexOffset&&(f.segments.push(A),A=void 0),A?(A.vertexLength+=re.vertexLength,A.primitiveLength+=re.primitiveLength):A={vertexOffset:re.vertexOffset,primitiveLength:re.primitiveLength,vertexLength:re.vertexLength,primitiveOffset:re.primitiveOffset,sortKey:void 0,vaos:{}}}return A&&f.segments.push(A),f}encodeCentroid(r,s){const u=r.centroid(),f=s.span(),g=Math.min(7,Math.round(f.x*this.tileToMeter/10)),v=Math.min(6,Math.round(f.y*this.tileToMeter/10));return new St(Ee(u.x,1,8191)<<3|g,Ee(u.y,1,8191)<<3|v)}encodeBorderCentroid(r){if(!r.borders)return new St(0,0);const s=r.borders,u=Number.MAX_VALUE;if(s[0][0]!==u||s[1][0]!==u){const f=s[0][0]!==u?0:1;return new St(6|(s[0][0]!==u?0:65528),(s[f][0]+s[f][1])/2<<3|6)}{const f=s[2][0]!==u?2:3;return new St((s[f][0]+s[f][1])/2<<3|6,6|(s[2][0]!==u?0:65528))}}showCentroid(r){const s=this.centroidData.get(r.centroidDataIndex);if(s.flags&=Vd,s.groupCentroidPos.x!==0||s.groupCentroidPos.y!==0){const u=s.span(),f=Math.min(7,Math.round(u.x*this.tileToMeter/10)),g=Math.min(6,Math.round(u.y*this.tileToMeter/10));s.centroidXY=new St(Ee(s.groupCentroidPos.x,1,8191)<<3|f,Ee(s.groupCentroidPos.y,1,8191)<<3|g)}else s.centroidXY=new St(0,0);this.writeCentroidToBuffer(s)}writeCentroidToBuffer(r){this.groundEffect.updateHiddenByLandmark(r);const s=r.vertexArrayOffset,u=r.vertexCount+r.vertexArrayOffset,f=-1073741824&r.flags?Jw:r.centroidXY,g=this.centroidVertexArray.geta_centroid_pos0(s);if(this.centroidVertexArray.geta_centroid_pos1(s)!==f.y||g!==f.x){for(let v=s;v<u;++v)this.centroidVertexArray.emplace(v,f.x,f.y);this.needsCentroidUpdate=!0}}createCentroidsBuffer(){this.centroidVertexArray.resize(this.layoutVertexArray.length),this.groundEffect.hiddenByLandmarkVertexArray.resize(this.groundEffect.vertexArray.length);for(const r of this.centroidData)this.writeCentroidToBuffer(r)}updateReplacement(r,s,u){if(s.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=s.updateTime;const f=s.getReplacementRegionsForTile(r.toUnwrapped());if(Yw(this.activeReplacements,f))return;if(this.activeReplacements=f,this.centroidVertexArray.length===0)this.createCentroidsBuffer();else for(const v of this.centroidData)v.flags&=1073741823;const g=[];for(const v of this.activeReplacements){if(v.order<u)continue;const x=Math.max(1,Math.pow(2,v.footprintTileId.canonical.z-r.canonical.z));if(v.footprint.buildingIds)for(const w of this.centroidData)w.flags&Vd||w.flags&Qw||v.min.x>w.max.x||w.min.x>v.max.x||v.min.y>w.max.y||w.min.y>v.max.y||v.footprint.buildingIds.has(w.buildingId)&&(w.flags|=v.clipMask!==Kw.None?-1073741824:Vd);else for(const w of this.centroidData)if(!(w.flags&Vd||w.flags&Qw||v.min.x>w.max.x||w.min.x>v.max.x||v.min.y>w.max.y||w.min.y>v.max.y))for(let A=0;A<w.footprintSegLen;A++){const R=this.footprintSegments.get(w.footprintSegIdx+A);if(g.length=0,mH(this.footprintVertices,R.vertexOffset,R.vertexCount,v.footprintTileId.canonical,r.canonical,g),lA(v.footprint,g,this.footprintIndices.uint16,R.indexOffset,R.indexCount,-R.vertexOffset,-x)){w.flags|=v.clipMask!==Kw.None?-1073741824:Vd;break}}}for(const v of this.centroidData)this.writeCentroidToBuffer(v);this.borderDoneWithNeighborZ=[-1,-1,-1,-1]}footprintContainsPoint(r,s,u){let f=!1;for(let g=0;g<u.footprintSegLen;g++){const v=this.footprintSegments.get(u.footprintSegIdx+g);let x=0;for(const w of v.ringIndices){for(let A=x,R=w+x-1;A<w+x;R=A++){const M=this.footprintVertices.int16[2*(A+v.vertexOffset)+0],O=this.footprintVertices.int16[2*(A+v.vertexOffset)+1],B=this.footprintVertices.int16[2*(R+v.vertexOffset)+1];O>s!=B>s&&r<(this.footprintVertices.int16[2*(R+v.vertexOffset)+0]-M)*(s-O)/(B-O)+M&&(f=!f)}x=w}}return f}getHeightAtTileCoord(r,s){let u=Number.NEGATIVE_INFINITY,f=!0;const g=4*(r+Bt)*Bt+(s+Bt);if(Object.hasOwn(this.partLookup,g)){const w=this.partLookup[g];return w?{height:w.height,hidden:!!(w.flags&Vd)}:void 0}const v=this.centroidData.buffer,x=this.centroidData.length;for(let w=0;w<x;w++){const A=15*w;if(r>v[A+4]||v[A+2]>r||s>v[A+5]||v[A+3]>s)continue;const R=v[A+13];if(R<=u)continue;const M=this.centroidData.get(w);this.footprintContainsPoint(r,s,M)&&(u=R,this.partLookup[g]=M,f=!!(M.flags&Vd))}if(u!==Number.NEGATIVE_INFINITY)return{height:u,hidden:f};this.partLookup[g]=void 0}}function gO(l,r){const s=l.add(r)._unit();return l.x*s.x+l.y*s.y}function fH(l,r,s,u){const f=r.sub(l)._perp()._unit(),g=s.sub(r)._perp()._unit();return _O(l,r,s,gO(f,g),u)}function _O(l,r,s,u,f){const g=Math.sqrt(1-u*u);return Math.min(l.dist(r)/3,r.dist(s)/3,f*g/u)}function fA(l,r,s){return l.x<s[0].x&&r.x<s[0].x||l.x>s[1].x&&r.x>s[1].x||l.y<s[0].y&&r.y<s[0].y||l.y>s[1].y&&r.y>s[1].y}function yO(l,r){return l.x<r[0].x||l.x>r[1].x||l.y<r[0].y||l.y>r[1].y}function pH(l){return l.every(r=>r.x<=0)||l.every(r=>r.x>=Bt)||l.every(r=>r.y<=0)||l.every(r=>r.y>=Bt)}function vO(l,r,s){if(l.x<0||l.x>=Bt||r.x<0||r.x>=Bt||s.x<0||s.x>=Bt)return!1;const u=s.sub(r),f=u.perp(),g=l.sub(r);return(u.x*g.x+u.y*g.y)/Math.sqrt((u.x*u.x+u.y*u.y)*(g.x*g.x+g.y*g.y))>-.866&&f.x*g.x+f.y*g.y<0}function bO(l,r,s){const u=r?2|l:-3&l;return s?1|u:-2&u}function xO(){const l=Math.PI/32,r=Math.tan(l),s=Dd;return s*Math.sqrt(1+2*r*r)-s}function wO(l,r,s){const u=1<<s.z,f=ia(s.x/u),g=ia((s.x+1)/u),v=Mo(s.y/u),x=Mo((s.y+1)/u);return(function(w,A,R,M,O=0,B){const N=[];if(!w.length||!R||!M)return N;const G=(he,Te)=>{for(const me of he)N.push({polygon:me,bounds:Te})},H=Math.ceil(Math.log2(R)),J=Math.ceil(Math.log2(M)),re=H-J,Q=[];for(let he=0;he<Math.abs(re);he++)Q.push(re>0?0:1);for(let he=0;he<Math.min(H,J);he++)Q.push(0),Q.push(1);let le=w;if(le=Ww(le,A[0].y-O,A[1].y+O,1),le=Ww(le,A[0].x-O,A[1].x+O,0),!le.length)return N;const ue=[];for(Q.length?ue.push({polygons:le,bounds:A,depth:0}):G(le,A);ue.length;){const he=ue.pop(),Te=he.depth,me=Q[Te],xe=he.bounds[0],_e=he.bounds[1],we=me===0?xe.x:xe.y,je=me===0?_e.x:_e.y,He=B?B(me,we,je):.5*(we+je),Qe=Ww(he.polygons,we-O,He+O,me),it=Ww(he.polygons,He-O,je+O,me);if(Qe.length){const nt=[xe,new St(me===0?He:_e.x,me===1?He:_e.y)];Q.length>Te+1?ue.push({polygons:Qe,bounds:nt,depth:Te+1}):G(Qe,nt)}if(it.length){const nt=[new St(me===0?He:xe.x,me===1?He:xe.y),_e];Q.length>Te+1?ue.push({polygons:it,bounds:nt,depth:Te+1}):G(it,nt)}}return N})(l,r,Math.ceil((g-f)/11.25),Math.ceil((v-x)/11.25),1,(w,A,R)=>{if(w===0)return .5*(A+R);{const M=Mo((s.y+A/Bt)/u);return(tc(.5*(Mo((s.y+R/Bt)/u)+M))*u-s.y)*Bt}})}function mH(l,r,s,u,f,g){const v=Math.pow(2,u.z-f.z);for(let x=0;x<s;x++){let w=l.int16[2*(x+r)+0],A=l.int16[2*(x+r)+1];w=(w+f.x*Bt)*v-u.x*Bt,A=(A+f.y*Bt)*v-u.y*Bt,g.push(new St(w,A))}}let SO,TO,EO,CO;Kt(iS,"FillExtrusionBucket",{omit:["layers","features"]}),Kt(nS,"PartData"),Kt(rS,"PartDataArray"),Kt(tS,"FootprintSegmentArray"),Kt(dA,"BorderCentroidData"),Kt(hA,"GroundEffect");class Jp extends St{constructor(r,s,u){super(r,s),this.z=u}}class AO extends Jp{constructor(r,s,u,f){super(r,s,u),this.w=f}}function IO(l,r,s,u){const f=s==="x"?"y":"x",g=(u-l[s])/(r[s]-l[s]);l[f]=Math.round(l[f]+(r[f]-l[f])*g),l[s]=u,Object.hasOwn(l,"z")&&(l.z=Sn(l.z,r.z,g)),Object.hasOwn(l,"w")&&(l.w=Sn(l.w,r.w,g))}function PO(l,r,s,u){const f=s,g=u;for(const v of["x","y"]){let x=l,w=r;x[v]>=w[v]&&(x=r,w=l),x[v]<f&&w[v]>f&&IO(x,w,v,f),x[v]<g&&w[v]>g&&IO(w,x,v,g)}}function oS(l,r,s,u,f,g){const v=[];for(let x=0;x<l.length;x++){const w=l[x];let A;const R=v.length;let M=0;for(let O=0;O<w.length-1;O++){let B=w[O],N=w[O+1],G=0;const H=M;let J,re;g&&(G=Math.hypot(N.x-B.x,N.y-B.y),M+=G,J=B,re=N),B.x<r&&N.x<r||(B.x<r?B=new St(r,B.y+(r-B.x)/(N.x-B.x)*(N.y-B.y))._round():N.x<r&&(N=new St(r,B.y+(r-B.x)/(N.x-B.x)*(N.y-B.y))._round()),B.y<s&&N.y<s||(B.y<s?B=new St(B.x+(s-B.y)/(N.y-B.y)*(N.x-B.x),s)._round():N.y<s&&(N=new St(B.x+(s-B.y)/(N.y-B.y)*(N.x-B.x),s)._round()),B.x>=u&&N.x>=u||(B.x>=u?B=new St(u,B.y+(u-B.x)/(N.x-B.x)*(N.y-B.y))._round():N.x>=u&&(N=new St(u,B.y+(u-B.x)/(N.x-B.x)*(N.y-B.y))._round()),B.y>=f&&N.y>=f||(B.y>=f?B=new St(B.x+(f-B.y)/(N.y-B.y)*(N.x-B.x),f)._round():N.y>=f&&(N=new St(B.x+(f-B.y)/(N.y-B.y)*(N.x-B.x),f)._round()),A&&B.equals(A.at(-1))||
24(A=[B],v.push(A),g&&g.push({progress:{min:H+RO(J,re,B)*G,max:1},parentIndex:x,prevPoint:J,nextPoint:re})),A.push(N),g&&(g.at(-1).progress.max=H+RO(J,re,N)*G,g.at(-1).nextPoint=re)))))}if(g&&M>0)for(let O=R;O<v.length;O++)g[O].progress.min/=M,g[O].progress.max/=M}return v}function gH(l,r,s,u,f){if(l.length<2)return void u.push(l);const g=[];for(;r.valid();){const[A,R]=r.get();for(let M=0;M<l.length-1;M++){const O=l[M],B=l[M+1],N=q(O,B,A,R);if(N){const[G]=N,H=new St(Sn(O.x,B.x,G),Sn(O.y,B.y,G));g.push({t:M+G,distance:0,point:H})}}r.next()}if(g.length===0)return void u.push(l);g.sort((A,R)=>A.t-R.t);let v=0,x=0,w=[];for(u.push(w);v!==l.length;){if(x===g.length){for(;v!==l.length;)w.length!==0&&w.at(-1).equals(l[v])||w.push(l[v]),v++;break}g[x].t<=v?(w.length!==0&&w.at(-1).equals(g[x].point)||w.push(g[x].point),Math.trunc(g[x].t),x++):(w.length!==0&&w.at(-1).equals(l[v])||w.push(l[v]),v++)}}function RO(l,r,s){return l.x!==r.x?(s.x-l.x)/(r.x-l.x):l.y!==r.y?(s.y-l.y)/(r.y-l.y):0}function wv(l,r){return l.x*r.x+l.y*r.y}function kO(l,r){if(l.length===1){let s=0;const u=r[s++];let f;for(;!f||u.equals(f);)if(f=r[s++],!f)return 1/0;for(;s<r.length;s++){const g=r[s],v=l[0],x=f.sub(u),w=g.sub(u),A=v.sub(u),R=wv(x,x),M=wv(x,w),O=wv(w,w),B=wv(A,x),N=wv(A,w),G=R*O-M*M,H=(O*B-M*N)/G,J=(R*N-M*B)/G,re=u.z*(1-H-J)+f.z*H+g.z*J;if(isFinite(re))return re}return 1/0}{let s=1/0;for(const u of r)s=Math.min(s,u.z);return s}}function MO(l,r,s){let u=1/0;T(s,r)&&(u=kO(s,r[0]));for(let f=0;f<r.length;f++){const g=r[f],v=l[f];for(let x=0;x<g.length-1;x++){const w=g[x],A=[w,g[x+1],v[x+1],v[x],w];b(s,A)&&(u=Math.min(u,kO(s,A)))}}return u!==1/0&&u}function LO(l,r,s,u,f,g,v,x,w,A,R){return l.projection.name==="globe"?(function(M,O,B,N,G,H,J,re,Q,le,ue){const he=[],Te=[],me=M.projection.upVectorScale(ue,M.center.lat,M.worldSize).metersToTile,xe=[0,0,0,1],_e=[0,0,0,1],we=(He,Qe,it,nt)=>{He[0]=Qe,He[1]=it,He[2]=nt,He[3]=1},je=xO();B>0&&(B+=je),N+=je;for(const He of O){const Qe=[],it=[];for(const nt of He){const bt=nt.x+G.x,Ze=nt.y+G.y,et=M.projection.projectTilePoint(bt,Ze,ue),ot=M.projection.upVector(ue,nt.x,nt.y);let ft=B,_t=N;if(J){const Ft=OO(bt,Ze,B,N,J,re,Q,le);ft+=Ft.base,_t+=Ft.top}B!==0?we(xe,et.x+ot[0]*me*ft,et.y+ot[1]*me*ft,et.z+ot[2]*me*ft):we(xe,et.x,et.y,et.z),we(_e,et.x+ot[0]*me*_t,et.y+ot[1]*me*_t,et.z+ot[2]*me*_t),mt(xe,xe,H),mt(_e,_e,H),Qe.push(new Jp(xe[0],xe[1],xe[2])),it.push(new Jp(_e[0],_e[1],_e[2]))}he.push(Qe),Te.push(it)}return[he,Te]})(l,r,s,u,f,g,v,x,w,A,R):v?(function(M,O,B,N,G,H,J,re,Q){const le=[],ue=[],he=[0,0,0,1];for(const Te of M){const me=[],xe=[];for(const _e of Te){const we=_e.x+N.x,je=_e.y+N.y,He=OO(we,je,O,B,H,J,re,Q);he[0]=we,he[1]=je,he[2]=He.base,he[3]=1,mn(he,he,G),he[3]=Math.max(he[3],1e-5);const Qe=new Jp(he[0]/he[3],he[1]/he[3],he[2]/he[3]);he[0]=we,he[1]=je,he[2]=He.top,he[3]=1,mn(he,he,G),he[3]=Math.max(he[3],1e-5);const it=new Jp(he[0]/he[3],he[1]/he[3],he[2]/he[3]);me.push(Qe),xe.push(it)}le.push(me),ue.push(xe)}return[le,ue]})(r,s,u,f,g,v,x,w,A):(function(M,O,B,N,G){const H=[],J=[],re=G[8]*O,Q=G[9]*O,le=G[10]*O,ue=G[11]*O,he=G[8]*B,Te=G[9]*B,me=G[10]*B,xe=G[11]*B;for(const _e of M){const we=[],je=[];for(const He of _e){const Qe=He.x+N.x,it=He.y+N.y,nt=G[0]*Qe+G[4]*it+G[12],bt=G[1]*Qe+G[5]*it+G[13],Ze=G[2]*Qe+G[6]*it+G[14],et=G[3]*Qe+G[7]*it+G[15],ot=nt+re,ft=bt+Q,_t=Ze+le,Ft=Math.max(et+ue,1e-5),ut=nt+he,At=bt+Te,It=Ze+me,Xt=Math.max(et+xe,1e-5);we.push(new Jp(ot/Ft,ft/Ft,_t/Ft)),je.push(new Jp(ut/Xt,At/Xt,It/Xt))}H.push(we),J.push(je)}return[H,J]})(r,s,u,f,g)}function OO(l,r,s,u,f,g,v,x){const w=v*f.getElevationAt(l,r,!0,!0),A=g[0]!==0,R=A?g[1]===0?v*(g[0]/7-450):v*(function(M,O,B){const N=Math.floor(O[0]/8),G=Math.floor(O[1]/8),H=10*(O[0]-8*N),J=10*(O[1]-8*G),re=M.getElevationAt(N,G,!0,!0),Q=M.getMeterToDEM(B),le=Math.floor(.5*(H*Q-1)),ue=Math.floor(.5*(J*Q-1)),he=M.tileCoordToPixel(N,G),Te=2*le+1,me=2*ue+1,xe=(function(it,nt,bt,Ze,et){return[it.getElevationAtPixel(nt,bt,!0),it.getElevationAtPixel(nt+et,bt,!0),it.getElevationAtPixel(nt,bt+et,!0),it.getElevationAtPixel(nt+Ze,bt+et,!0)]})(M,he.x-le,he.y-ue,Te,me),_e=Math.abs(xe[0]-xe[1]),we=Math.abs(xe[2]-xe[3]),je=Math.abs(xe[0]-xe[2])+Math.abs(xe[1]-xe[3]),He=Math.min(.25,.5*Q*(_e+we)/Te),Qe=Math.min(.25,.5*Q*je/me);return re+Math.max(He*H,Qe*J)})(f,g,x):w;return{base:w+(s===0?-1:s),top:A?Math.max(R+u,w+s+2):w+u}}let Nc=null,sS=null,pA=null,aS=null;
vendor: 5,068 bytes, line 24
24const DO=5120,FO=5121,BO=5122,zO=5123,NO=5125,VO=5126,lS={[DO]:Int8Array,[FO]:Uint8Array,[BO]:Int16Array,[zO]:Uint16Array,[NO]:Uint32Array,[VO]:Float32Array},_H={[DO]:"DT_INT8",[FO]:"DT_UINT8",[BO]:"DT_INT16",[zO]:"DT_UINT16",[NO]:"DT_UINT32",[VO]:"DT_FLOAT32"},Sv={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16};function UO(l,r,s){const u=s.json.bufferViews.length,f=s.buffers.length;r.bufferView=u,s.json.bufferViews[u]={buffer:f,byteLength:l.byteLength},s.buffers[f]=l}const mA="KHR_draco_mesh_compression";function yH(l,r){const s=l.extensions&&l.extensions[mA];if(!s)return;const u=new Nc.Decoder,f=HO(r,s.bufferView),g=new Nc.Mesh;if(!u.DecodeArrayToMesh(f,f.byteLength,g))throw new Error("Failed to decode Draco mesh");const v=r.json.accessors[l.indices],x=lS[v.componentType],w=v.count*x.BYTES_PER_ELEMENT,A=Nc._malloc(w);x===Uint16Array?u.GetTrianglesUInt16Array(g,w,A):u.GetTrianglesUInt32Array(g,w,A),UO(Nc.memory.buffer.slice(A,A+w),v,r),Nc._free(A);for(const R of Object.keys(s.attributes)){const M=u.GetAttributeByUniqueId(g,s.attributes[R]),O=r.json.accessors[l.attributes[R]],B=_H[O.componentType],N=O.count*Sv[O.type]*lS[O.componentType].BYTES_PER_ELEMENT,G=Nc._malloc(N);u.GetAttributeDataArrayForAllPoints(g,M,Nc[B],N,G),UO(Nc.memory.buffer.slice(G,G+N),O,r),Nc._free(G)}u.destroy(),g.destroy(),delete l.extensions[mA]}const cS="EXT_meshopt_compression";function vH(l,r){if(!l.extensions||!l.extensions[cS])return;const s=l.extensions[cS],u=new Uint8Array(r.buffers[s.buffer],s.byteOffset||0,s.byteLength||0),f=new Uint8Array(s.count*s.byteStride);pA.decodeGltfBuffer(f,s.count,s.byteStride,u,s.mode,s.filter),l.buffer=r.buffers.length,l.byteOffset=0,r.buffers[l.buffer]=f.buffer,delete l.extensions[cS]}const $O=1179937895,jO=new TextDecoder("utf8");function GO(l,r){return new URL(l,r).href}async function bH(l,r,s,u,f){const g=await fetch(GO(l.uri,u),{signal:f}),v=await g.arrayBuffer();r.buffers[s]=v}function HO(l,r){const s=l.json.bufferViews[r];return new Uint8Array(l.buffers[s.buffer],s.byteOffset||0,s.byteLength)}async function xH(l,r,s,u,f){if(l.uri){const g=GO(l.uri,u),v=await fetch(g,{signal:f}),x=await v.blob(),w=await createImageBitmap(x);r.images[s]=w}else if(l.bufferView!==void 0){const g=HO(r,l.bufferView),v=new Blob([g],{type:l.mimeType}),x=await createImageBitmap(v);r.images[s]=x}}async function WO(l,r=0,s,u){const f={json:null,images:[],buffers:[]};if(new Uint32Array(l,r,1)[0]===$O){const B=new Uint32Array(l,r);let N=2;const G=(B[N++]>>2)-3,H=B[N++]>>2;if(N++,f.json=JSON.parse(jO.decode(B.subarray(N,N+H))),N+=H,N<G){const J=B[N++];N++;const re=r+(N<<2);f.buffers[0]=l.slice(re,re+J)}}else f.json=JSON.parse(jO.decode(new Uint8Array(l,r)));const{buffers:g,images:v,meshes:x,extensionsUsed:w,bufferViews:A}=f.json;if(g){const B=[];for(let N=0;N<g.length;N++){const G=g[N];G.uri?B.push(bH(G,f,N,s,u)):f.buffers[N]||(f.buffers[N]=null)}await Promise.all(B)}if(u&&u.aborted)throw new DOMException("Aborted","AbortError");const R=[],M=w&&w.includes(mA),O=w&&w.includes(cS);if(M&&R.push((function(){if(!Nc)return sS!=null||(sS=(function(B){let N,G=null;function H(){N=new Uint8Array(G.buffer)}function J(){throw new Error("Unexpected Draco error.")}return WebAssembly.instantiateStreaming(B,{a:{a:J,d:function(re,Q,le){return N.copyWithin(re,Q,Q+le)},c:function(re){const Q=N.length,le=Math.max(re>>>0,Math.ceil(1.2*Q)),ue=Math.ceil((le-Q)/65536);try{return G.grow(ue),H(),!0}catch{return!1}},b:J}}).then(re=>{const{Rb:Q,Qb:le,P:ue,T:he,X:Te,Ja:me,La:xe,Qa:_e,Va:we,Wa:je,eb:He,jb:Qe,f:it,e:nt,yb:bt,zb:Ze,Ab:et,Bb:ot,Db:ft,Gb:_t}=re.instance.exports;G=nt;const Ft=(()=>{let ut=0,At=0,It=0,Xt=0;return Yt=>{It&&(Q(Xt),Q(ut),At+=It,It=ut=0),ut||(At+=128,ut=le(At));const gn=Yt.length+7&-8;let on=ut;gn>=At&&(It=gn,on=Xt=le(gn));for(let En=0;En<Yt.length;En++)N[on+En]=Yt[En];return on}})();return H(),it(),{memory:nt,_free:Q,_malloc:le,Mesh:class{constructor(){this.ptr=ue()}destroy(){he(this.ptr)}},Decoder:class{constructor(){this.ptr=me()}destroy(){Qe(this.ptr)}DecodeArrayToMesh(ut,At,It){const Xt=Ft(ut),Yt=xe(this.ptr,Xt,At,It.ptr);return!!Te(Yt)}GetAttributeByUniqueId(ut,At){return{ptr:_e(this.ptr,ut.ptr,At)}}GetTrianglesUInt16Array(ut,At,It){we(this.ptr,ut.ptr,At,It)}GetTrianglesUInt32Array(ut,At,It){je(this.ptr,ut.ptr,At,It)}GetAttributeDataArrayForAllPoints(ut,At,It,Xt,Yt){He(this.ptr,ut.ptr,At.ptr,It,Xt,Yt)}},DT_INT8:bt(),DT_UINT8:Ze(),DT_INT16:et(),DT_UINT16:ot(),DT_UINT32:ft(),DT_FLOAT32:_t()}})})(fetch(gu())).then(B=>{Nc=B,sS=null})),sS})()),O&&R.push((function(){var B;if(!pA)return aS!=null||(aS=(B=fetch(dd()),WebAssembly.instantiateStreaming(B,{}).then(N=>{const{sbrk:G,memory:H,meshopt_decodeVertexBuffer:J,meshopt_decodeIndexBuffer:re,meshopt_decodeIndexSequence:Q,meshopt_decodeFilterOct:le,meshopt_decodeFilterQuat:ue,meshopt_decodeFilterExp:he}=N.instance.exports,Te={ATTRIBUTES:J,TRIANGLES:re,INDICES:Q},me={OCTAHEDRAL:le,QUATERNION:ue,EXPONENTIAL:he};return N.instance.exports.__wasm_call_ctors(),{decodeGltfBuffer(xe,_e,we,je,He,Qe){const it=_e+3&-4,nt=G(it*we),bt=G(je.length),Ze=new
24Uint8Array(H.buffer);Ze.set(je,bt);const et=Te[He](nt,_e,we,bt,je.length);if(et===0&&me[Qe]&&me[Qe](nt,it,we),xe.set(Ze.subarray(nt,nt+_e*we)),G(nt-G(0)),et!==0)throw new Error(`Malformed buffer data: ${et}`)}}})).then(N=>{pA=N,aS=null})),aS})()),v)for(let B=0;B<v.length;B++)R.push(xH(v[B],f,B,s,u));if(R.length&&await Promise.all(R),u&&u.aborted)throw new DOMException("Aborted","AbortError");if(M&&x)for(const{primitives:B}of x)for(const N of B)yH(N,f);if(O&&x&&A)for(const B of A)vH(B,f);return f}async function qO(l,r){const s=await(async function(u,f){if(f&&f.aborted)throw new DOMException("Aborted","AbortError");return new Promise((g,v)=>{const x=fp(u,(w,A)=>{w?v(w):g(A)});f&&f.addEventListener("abort",()=>{x.cancel(),v(new DOMException("Aborted","AbortError"))},{once:!0})})})({url:l,type:"arrayBuffer"},r);return WO(s,0,l,r)}function gA(l){switch(l){case WebGL2RenderingContext.RGBA8:case WebGL2RenderingContext.RGBA16F:return WebGL2RenderingContext.RGBA;case WebGL2RenderingContext.DEPTH_COMPONENT16:return WebGL2RenderingContext.DEPTH_COMPONENT;case WebGL2RenderingContext.DEPTH24_STENCIL8:return WebGL2RenderingContext.DEPTH_STENCIL;case WebGL2RenderingContext.R8:case WebGL2RenderingContext.R32F:return WebGL2RenderingContext.RED}}function _A(l){switch(l){case WebGL2RenderingContext.RGBA8:return WebGL2RenderingContext.UNSIGNED_BYTE;case WebGL2RenderingContext.RGBA16F:return WebGL2RenderingContext.HALF_FLOAT;case WebGL2RenderingContext.DEPTH_COMPONENT16:return WebGL2RenderingContext.UNSIGNED_SHORT;case WebGL2RenderingContext.DEPTH24_STENCIL8:return WebGL2RenderingContext.UNSIGNED_INT_24_8;case WebGL2RenderingContext.R8:return WebGL2RenderingContext.UNSIGNED_BYTE;case WebGL2RenderingContext.R32F:return WebGL2RenderingContext.FLOAT}}class zu{constructor(r,s,u,f){this.context=r,this.format=u,this.useMipmap=f&&f.useMipmap,this.texture=r.gl.createTexture(),this.update(s,{premultiply:f&&f.premultiply})}update(r,s){const u=r&&r instanceof HTMLVideoElement&&r.width===0?r.videoWidth:r.width,f=r&&r instanceof HTMLVideoElement&&r.height===0?r.videoHeight:r.height,{context:g}=this,{gl:v}=g,{x,y:w}=s&&s.position?s.position:{x:0,y:0},A=x+u,R=w+f;this.size&&(this.size[0]!==A||this.size[1]!==R)&&(!s||s.recreateWhenResize===void 0||s.recreateWhenResize)&&(v.bindTexture(v.TEXTURE_2D,null),v.deleteTexture(this.texture),this.texture=v.createTexture(),this.size=null),v.bindTexture(v.TEXTURE_2D,this.texture),g.pixelStoreUnpackFlipY.set(!1),g.pixelStoreUnpack.set(1),g.pixelStoreUnpackPremultiplyAlpha.set(this.format===v.RGBA8&&(!s||s.premultiply!==!1));const M=r instanceof HTMLImageElement||r instanceof HTMLCanvasElement||r instanceof HTMLVideoElement||r instanceof ImageData||ImageBitmap&&r instanceof ImageBitmap;if(!this.size&&A>0&&R>0){const O=this.useMipmap?Math.floor(Math.log2(Math.max(A,R)))+1:1;v.texStorage2D(v.TEXTURE_2D,O,this.format,A,R),this.size=[A,R]}this.size&&(M?v.texSubImage2D(v.TEXTURE_2D,0,x,w,gA(this.format),_A(this.format),r):"data"in r&&r.data&&v.texSubImage2D(v.TEXTURE_2D,0,x,w,u,f,gA(this.format),_A(this.format),r.data)),this.useMipmap&&v.generateMipmap(v.TEXTURE_2D)}bind(r,s,u=!1){const{context:f}=this,{gl:g}=f;g.bindTexture(g.TEXTURE_2D,this.texture),r!==this.minFilter&&(g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,r),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,this.useMipmap&&!u?r===g.NEAREST?g.NEAREST_MIPMAP_NEAREST:g.LINEAR_MIPMAP_LINEAR:r),this.minFilter=r),s!==this.wrapS&&(g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,s),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,s),this.wrapS=s)}bindExtraParam(r,s,u,f,g){const{context:v}=this,{gl:x}=v;x.bindTexture(x.TEXTURE_2D,this.texture),s!==this.magFilter&&(x.texParameteri(x.TEXTURE_2D,x.TEXTURE_MAG_FILTER,s),this.magFilter=s),r!==this.minFilter&&(x.texParameteri(x.TEXTURE_2D,x.TEXTURE_MIN_FILTER,this.useMipmap?r===x.NEAREST?x.NEAREST_MIPMAP_NEAREST:x.LINEAR_MIPMAP_LINEAR:r),this.minFilter=r),u!==this.wrapS&&(x.texParameteri(x.TEXTURE_2D,x.TEXTURE_WRAP_S,u),this.wrapS=u),f!==this.wrapT&&(x.texParameteri(x.TEXTURE_2D,x.TEXTURE_WRAP_T,f),this.wrapT=f),g!==this.compareMode&&(g?(x.texParameteri(x.TEXTURE_2D,x.TEXTURE_COMPARE_MODE,x.COMPARE_REF_TO_TEXTURE),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_COMPARE_FUNC,g)):x.texParameteri(x.TEXTURE_2D,x.TEXTURE_COMPARE_MODE,x.NONE),this.compareMode=g)}destroy(){const{gl:r}=this.context;r.deleteTexture(this.texture),this.texture=null}}class Tv{constructor(r,s){this.context=r,this.texture=s}bind(r,s){const{context:u}=this,{gl:f}=u;f.bindTexture(f.TEXTURE_2D,this.texture),r!==this.minFilter&&(f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,r),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,r),this.minFilter=r),s!==this.wrapS&&(f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,s),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,s),this.wrapS=s)}}const wH=Jn([{name:"a_pos_3f",components:3,type:"Float32"}]),SH=Jn([{name:"a_color_3f",components:3,type:"Float32"}]),TH=Jn([{name:"a_color_4f",components:4,type:"Float32"}]),EH=Jn([{name:"a_uv_2f",components:2,type:"Float32"}]),CH=Jn([{name:"a_normal_3f",components:3,type:"Float32"}]),AH=Jn([{name:"a_normal_matrix0",components:4,type:"Float32"},{name:"a_normal_matrix1",components:4,type:"Float32"},{name:"a_normal_matrix2",components:4,type:"Float32"},{name:"a_normal_matrix3",components:4,type:"Float32"}]),IH=Jn([{name:"a_pbr",components:4,type:"Uint16"},{name:"a_heightBasedEmissiveStrength",components:3,type:"Float32"}]);function XO(l,r){const s=uS(l.projection,l.zoom,l.width,l.height),u=(function(g,v,x,w,A){const R=new wr(x.lng-180*hf,x.lat),M=new wr(x.lng+180*hf,x.lat),O=g.project(R.lng,R.lat),B=g.project(M.lng,M.lat),N=-Math.atan2(B.y-O.y,B.x-O.x),G=ls.fromLngLat(x);G.y=Ee(G.y,-1+hf,1-hf);const H=G.toLngLat(),J=g.project(H.lng,H.lat),re=ls.fromLngLat(H);re.x+=hf;const Q=re.toLngLat(),le=g.project(Q.lng,Q.lat),ue=YO(le.x-J.x,le.y-J.y,N),he=ls.fromLngLat(H);he.y+=hf;const Te=he.toLngLat(),me=g.project(Te.lng,Te.lat),xe=YO(me.x-J.x,me.y-J.y,N),_e=Math.abs(ue.x)/Math.abs(xe.y),we=$([]);ke(we,we,-N*(1-(A?0:w)));const je=$([]);return ne(je,je,[1,1-(1-_e)*w,1]),je[4]=-xe.x/xe.y*w,ke(je,je,N),X(je,we,je),je}
vendor: 4,291 bytes, line 24
24)(l.projection,0,l.center,s,r),f=ZO(l);return ne(u,u,[f,f,1]),u}function ZO(l){const r=l.projection,s=uS(l.projection,l.zoom,l.width,l.height),u=yA(r,l.center),f=yA(r,wr.convert(r.center));return Math.pow(2,u*s+(1-s)*f)}function uS(l,r,s,u,f=1/0){const g=l.range;if(!g)return 0;const v=Math.min(f,Math.max(s,u)),x=Math.log2(v/1024);return We(g[0]+x,g[1]+x,r)}const hf=1/4e4;function yA(l,r){const s=Ee(r.lat,-85.051129,oa),u=new wr(r.lng-180*hf,s),f=new wr(r.lng+180*hf,s),g=l.project(u.lng,s),v=l.project(f.lng,s),x=ls.fromLngLat(u),w=ls.fromLngLat(f),A=v.x-g.x,R=v.y-g.y,M=w.x-x.x,O=w.y-x.y,B=Math.sqrt((M*M+O*O)/(A*A+R*R));return Math.log2(B)}function YO(l,r,s){const u=Math.cos(s),f=Math.sin(s);return{x:l*u-r*f,y:l*f+r*u}}const PH=new Float64Array([1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1]);function KO(l,r,s){$(l),ke(l,l,ae(r[2])),fe(l,l,ae(r[0])),ye(l,l,ae(r[1])),ne(l,l,s),X(l,l,PH)}function dS(l,r,s,u,f,g,v,x){const w=[s[0]-r[0],s[1]-r[1],0],A=[u[0]-r[0],u[1]-r[1],0];if(Zt(w)<1e-12||Zt(A)<1e-12)return ir(l);const R=Be([],w,A);_n(R,R),Mn(A,u,r),w[2]=(g-f)*x,A[2]=(v-f)*x;const M=w;return Be(M,w,A),_n(M,M),ko(l,R,M)}function hS(l,r,s=!1){const u=Fr(r.zoom),f=(function(g,v,x){const w=v.worldSize,A=[g[12],g[13],g[14]],R=Mo(A[1]/w),M=ia(A[0]/w),O=$([]),B=Ps(1,R)*w,N=Ps(1,0)*w*Fd(R,v.zoom),G=1/Fn(w);let H=N*G;if(x){const le=uS(v.projection,v.zoom,v.width,v.height,1024);H=G*v.projection.pixelSpaceConversion(v.center.lat,w,le)}const J=ec(R,M);sn(J,J,Yn([],_n([],J),B*H*A[2]));const re=(function(le){const ue=[le[0],le[1],le[2]];let he=[0,1,0];const Te=Be([],he,ue);return Be(he,ue,Te),yn(he)===0&&(he=[0,1,0],Be(Te,ue,he)),_n(Te,Te),_n(he,he),_n(ue,ue),[Te[0],Te[1],Te[2],0,he[0],he[1],he[2],0,ue[0],ue[1],ue[2],0,le[0],le[1],le[2],1]})(J);ne(O,O,[H,H,H*B]),K(O,O,[-A[0],-A[1],-A[2]]);const Q=X([],v.globeMatrix,re);return X(Q,Q,O),X(Q,Q,g),Q})(l,r,s);if(u>0){const g=(function(v,x){const w=x.worldSize,A=Ps(1,0)*w*Fd(x.center.lat,x.zoom)/Fn(w),R=Ps(1,x.center.lat)*w,M=$([]);ye(M,M,ae(x.center.lng)),fe(M,M,ae(x.center.lat)),K(M,M,[0,0,as]),ne(M,M,[A,A,A*R]);const O=x.point;return K(M,M,[-O.x,-O.y,0]),X(M,M,v),X(M,x.globeMatrix,M)})(l,r);return(function(v,x,w){const A=(N,G,H)=>{const J=Zt(N),re=Zt(G),Q=xt(N,G,H);return Yn(Q,Q,1/Zt(Q)*Sn(J,re,H))},R=A([v[0],v[1],v[2]],[x[0],x[1],x[2]],w),M=A([v[4],v[5],v[6]],[x[4],x[5],x[6]],w),O=A([v[8],v[9],v[10]],[x[8],x[9],x[10]],w),B=xt([v[12],v[13],v[14]],[x[12],x[13],x[14]],w);return[R[0],R[1],R[2],0,M[0],M[1],M[2],0,O[0],O[1],O[2],0,B[0],B[1],B[2],1]})(f,g,u)}return f}function vA(l,r,s,u){const f=pi.projectAabbCorners(u,s);let g=Number.MAX_VALUE;for(let x=0;x<f.length;++x){const w=f[x];w[0]=(.5*w[0]+.5)*r.width,w[1]=(.5-.5*w[1])*r.height,w[2]<g&&(g=w[2])}const v=(function(x){const w=[];let A=0;for(let B=1;B<x.length;B++)(x[B][0]<x[A][0]||x[B][0]===x[A][0]&&x[B][1]<x[A][1])&&(A=B);let R,M=A;const O=new Uint8Array(x.length);do{if(O[M])break;w.push(new St(x[M][0],x[M][1])),O[M]=1,R=(M+1)%x.length;for(let B=0;B<x.length;B++){if(x[B][0]===x[R][0]&&x[B][1]===x[R][1]||x[B][0]===x[M][0]&&x[B][1]===x[M][1])continue;const N=[x[B][0]-x[M][0],x[B][1]-x[M][1]],G=[x[R][0]-x[M][0],x[R][1]-x[M][1]],H=N[0]*G[1]-N[1]*G[0];(H>0||H===0&&N[0]*G[0]+N[1]*G[1]>=0&&N[0]*N[0]+N[1]*N[1]>G[0]*G[0]+G[1]*G[1])&&(R=B)}M=R}while(M!==A);return w.length>0&&w.push(w[0]),w})(f);if(b(l,v))return g}const Qp=64,o_={CoordinateSpaceTile:1,HasMapboxMeshFeatures:4,HasMeshoptCompression:8};function fS(l,r,s,u,f,g,v,x,w,A=!1){const R=s.zoom,M=s.project(u),O=Fd(u.lat,R),B=1/O;$(l),K(l,l,[M.x+v[0]*B,M.y+v[1]*B,v[2]]);let N=1,G=1;const H=s.worldSize;if(A){if(s.projection.name==="mercator"){let le=0;s.elevation&&(le=s.elevation.getAtPointOrZero(new ls(M.x/H,M.y/H),0));const ue=mn([],[M.x,M.y,le,1],s.projMatrix)[3]/s.cameraToCenterDistance;N=ue,G=ue*Fd(s.center.lat,R)}else if(s.projection.name==="globe"){const le=hS(l,s),ue=[0,0,0,1];mn(ue,ue,X([],s.projMatrix,le));const he=ue[3]/s.cameraToCenterDistance,Te=Fr(R),me=s.projection.pixelsPerMeter(u.lat,H)*Fd(u.lat,R),xe=s.projection.pixelsPerMeter(s.center.lat,H)*Fd(s.center.lat,R);N=he/Sn(me,Pw(s.center.lat),Te),G=he*O/me,N*=xe,G*=xe}}else N=B;ne(l,l,[N,N,G]);const J=[...l],re=r.orientation,Q=[];if(KO(Q,[re[0]+(f?f[0]:0),re[1]+(f?f[1]:0),re[2]+(f?f[2]:0)],g),X(l,J,Q),x&&s.elevation){let le=0;const ue=[];
24if(w&&s.elevation){le=(function(Te,me,xe,_e,we){const je=me.elevation;if(!je)return 0;const He=pi.projectAabbCorners(xe,_e),Qe=Ps(1,we.lat)*me.worldSize,it=(function(It,Xt){const Yt=[0,0,1],gn=[{corners:[0,1,3,2],dotProductWithUp:0},{corners:[1,5,2,6],dotProductWithUp:0},{corners:[0,4,1,5],dotProductWithUp:0},{corners:[2,6,3,7],dotProductWithUp:0},{corners:[4,7,5,6],dotProductWithUp:0},{corners:[0,3,4,7],dotProductWithUp:0}];for(const on of gn){const En=It[on.corners[0]],_r=It[on.corners[1]],Nn=It[on.corners[2]],sr=[_r[0]-En[0],_r[1]-En[1],Xt*(_r[2]-En[2])],Zn=Be(sr,sr,[Nn[0]-En[0],Nn[1]-En[1],Xt*(Nn[2]-En[2])]);_n(Zn,Zn),on.dotProductWithUp=Bn(Zn,Yt)}return gn.sort((on,En)=>on.dotProductWithUp-En.dotProductWithUp),gn[0].corners})(He,Qe),nt=He[it[0]],bt=He[it[1]],Ze=He[it[2]],et=He[it[3]],ot=je.getAtPointOrZero(new ls(nt[0]/me.worldSize,nt[1]/me.worldSize),0),ft=je.getAtPointOrZero(new ls(bt[0]/me.worldSize,bt[1]/me.worldSize),0),_t=je.getAtPointOrZero(new ls(Ze[0]/me.worldSize,Ze[1]/me.worldSize),0),Ft=je.getAtPointOrZero(new ls(et[0]/me.worldSize,et[1]/me.worldSize),0),ut=(ot+Ft)/2,At=(ft+_t)/2;return ut>At?ft<_t?dS(Te,bt,et,nt,ft,Ft,ot,Qe):dS(Te,Ze,nt,et,_t,ot,Ft,Qe):ot<Ft?dS(Te,nt,bt,Ze,ot,ft,_t,Qe):dS(Te,et,Ze,bt,Ft,_t,ft,Qe),Math.max(ut,At)})(ue,s,r.aabb,l,u);const he=X([],Qt([],ue),Q);X(l,J,he)}else le=s.elevation.getAtPointOrZero(new ls(M.x/H,M.y/H),0);le!==0&&(l[14]+=le)}}class JO{constructor(r,s,u,f,g){this.materialOverrides=new Map,this.nodeOverrides=new Map,this.materialOverrideNames=[],this.nodeOverrideNames=[],this.featureProperties={},this.id=r,this.uri=s,this.position=u!=null?new wr(u[0],u[1]):new wr(0,0),this.orientation=f??[0,0,0],this.nodes=g,this.uploaded=!1,this.aabb=new pi([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),this.matrix=[]}_applyTransformations(r,s){X(r.globalMatrix,s,r.localMatrix);const u=this.nodeOverrides.get(r.name);if(u!==void 0){const v=[];g=u.orientation,$(f=v),ye(f,f,ae(g[1])),ke(f,f,ae(g[2])),fe(f,f,ae(g[0])),X(r.globalMatrix,r.globalMatrix,v)}var f,g;if(r.meshes)for(const v of r.meshes){const x=pi.applyTransformFast(v.aabb,r.globalMatrix);this.aabb.encapsulate(x)}if(r.children)for(const v of r.children)this._applyTransformations(v,r.globalMatrix)}computeBoundsAndApplyParent(){const r=$([]);this.aabb=new pi([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);for(const s of this.nodes)this._applyTransformations(s,r)}computeModelMatrix(r,s,u,f,g,v,x=!1){fS(this.matrix,this,r.transform,this.position,s,u,f,g,v,x)}upload(r){if(!this.uploaded){for(const s of this.nodes)bA(s,r);for(const s of this.nodes)pS(s);this.uploaded=!0}}destroy(){for(const r of this.nodes)xA(r)}}function Ev(l,r,s=!1){l.uploaded||(l.gfxTexture=new zu(r,l.image,s?r.gl.R8:r.gl.RGBA8,{useMipmap:l.sampler.minFilter>=r.gl.NEAREST_MIPMAP_NEAREST}),l.uploaded=!0,l.image=null)}function QO(l,r,s){l.indexBuffer=r.createIndexBuffer(l.indexArray,!1,!0),l.vertexBuffer=r.createVertexBuffer(l.vertexArray,wH.members,!1,!0),l.normalArray&&(l.normalBuffer=r.createVertexBuffer(l.normalArray,CH.members,!1,!0)),l.texcoordArray&&(l.texcoordBuffer=r.createVertexBuffer(l.texcoordArray,EH.members,!1,!0)),l.colorArray&&(l.colorBuffer=r.createVertexBuffer(l.colorArray,(l.colorArray.bytesPerElement===12?SH:TH).members,!1,!0)),l.featureArray&&(l.pbrBuffer=r.createVertexBuffer(l.featureArray,IH.members,!0)),l.segments=Wr.simpleSegment(0,0,l.vertexArray.length,l.indexArray.length);const u=l.material;u.pbrMetallicRoughness.baseColorTexture&&Ev(u.pbrMetallicRoughness.baseColorTexture,r),u.pbrMetallicRoughness.metallicRoughnessTexture&&Ev(u.pbrMetallicRoughness.metallicRoughnessTexture,r),u.normalTexture&&Ev(u.normalTexture,r),u.occlusionTexture&&Ev(u.occlusionTexture,r,s),u.emissionTexture&&Ev(u.emissionTexture,r)}function bA(l,r,s){if(l.meshes)for(const u of l.meshes)QO(u,r,s);if(l.lodMeshes)for(const u of l.lodMeshes)QO(u,r,s);if(l.children)for(const u of l.children)bA(u,r,s)}function eD(l){l.indexArray.destroy(),l.vertexArray.destroy(),l.colorArray&&l.colorArray.destroy(),l.normalArray&&l.normalArray.destroy(),l.texcoordArray&&l.texcoordArray.destroy(),l.featureArray&&l.featureArray.destroy()}function pS(l){if(l.meshes)for(const r of l.meshes)eD(r);if(l.lodMeshes)for(const r of l.lodMeshes)eD(r);if(l.children)for(const r of l.children)pS(r)}function tD(l){var r;l.vertexBuffer&&(l.vertexBuffer.destroy(),l.indexBuffer.destroy(),l.normalBuffer&&l.normalBuffer.destroy(),l.texcoordBuffer&&l.texcoordBuffer.destroy(),l.colorBuffer&&l.colorBuffer.destroy(),l.pbrBuffer&&l.pbrBuffer.destroy(),l.segments.destroy(),l.material&&((r=l.material).pbrMetallicRoughness.baseColorTexture&&r.pbrMetallicRoughness.baseColorTexture.gfxTexture&&r.pbrMetallicRoughness.baseColorTexture.gfxTexture.destroy(),r.pbrMetallicRoughness.metallicRoughnessTexture&&r.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture&&r.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture.destroy(),r.normalTexture&&r.normalTexture.gfxTexture&&r.normalTexture.gfxTexture.destroy(),r.emissionTexture&&r.emissionTexture.gfxTexture&&r.emissionTexture.gfxTexture.destroy(),r.occlusionTexture&&r.occlusionTexture.gfxTexture&&r.occlusionTexture.gfxTexture.destroy()))}function xA(l){if(l.meshes)for(const r of l.meshes)tD(r);if(l.lodMeshes)for(const r of l.lodMeshes)tD(r);if(l.footprintDebugMesh&&(l.footprintDebugMesh.vertexBuffer.destroy(),l.footprintDebugMesh.indexBuffer.destroy(),l.footprintDebugMesh.segments.destroy()),l.children)for(const r of l.children)xA(r)}function wA(l,r,s,u){return l[0]<=u[0]&&r[0]>=s[0]&&l[1]<=u[1]&&r[1]>=s[1]&&l[2]<=u[2]&&r[2]>=s[2]}function RH(l,r,s,u,f,g,v,x,w,A,R){const M=.5*(A[0]+R[0]),O=.5*(A[1]+R[1]),B=.5*(A[2]+R[2]),N=.5*(R[0]-A[0]),G=.5*(R[1]-A[1]),H=.5*(R[2]-A[2]),J=l-M,re=r-O,Q=s-B,le=u-M,ue=f-O,he=g-B,Te=v-M,me=x-O,xe=w-B,_e=le-J,we=ue-re,je=he-Q,He=Te-le,Qe=me-ue,it=xe-he,nt=J-Te,bt=re-me,Ze=Q-xe;let et,ot,ft,_t,Ft,ut;if(et=Q*we-re*je,ot=he*we-ue*je,ft=xe*we-me*je,_t=Math.min(et,ot,ft),Ft=Math.max(et,ot,ft),ut=Math.abs(je)*G+Math.abs(we)*H,_t>ut||Ft<-ut||(et=Q*Qe-re*it,ot=he*Qe-ue*it,ft=xe*Qe-me*it,_t=Math.min(et,ot,ft),Ft=Math.max(et,ot,ft),ut=Math.abs(it)*G+Math.abs(Qe)*H,_t>ut||Ft<-ut)||(et=Q*bt-re*Ze,ot=he*bt-ue*Ze,ft=xe*bt-me*Ze,_t=Math.min(et,ot,ft),Ft=Math.max(et,ot,ft),ut=Math.abs(Ze)*G+Math.abs(bt)*H,_t>ut||Ft<-ut)||(et=J*je-Q*_e,ot=le*je-he*_e,ft=Te*je-xe*_e,_t=Math.min(et,ot,ft),Ft=Math.max(et,ot,ft),ut=Math.abs(je)*N+Math.abs(_e)*H,_t>ut||Ft<-ut)||(et=J*it-Q*He,ot=le*it-he*He,ft=Te*it-xe*He,_t=Math.min(et,ot,ft),Ft=Math.max(et,ot,ft),ut=Math.abs(it)*N+Math.abs(He)*H,_t>ut||Ft<-ut)||(et=J*Ze-Q*nt,ot=le*Ze-he*nt,ft=Te*Ze-xe*nt,_t=Math.min(et,ot,ft),Ft=Math.max(et,ot,ft),ut=Math.abs(Ze)*N+Math.abs(nt)*H,_t>ut||Ft<-ut)||(et=re*_e-J*we,ot=ue*_e-le*we,ft=me*_e-Te*we,_t=Math.min(et,ot,ft),Ft=Math.max(et,ot,ft),ut=Math.abs(we)*N+Math.abs(_e)*G,_t>ut||Ft<-ut)||(et=re*He-J*Qe,ot=ue*He-le*Qe,ft=me*He-Te*Qe,_t=Math.min(et,ot,ft),Ft=Math.max(et,ot,ft),ut=Math.abs(Qe)*N+Math.abs(He)*G,_t>ut||Ft<-ut)||(et=re*nt-J*bt,ot=ue*nt-le*bt,ft=me*nt-Te*bt,_t=Math.min(et,ot,ft),Ft=Math.max(et,ot,ft),ut=Math.abs(bt)*N+Math.abs(nt)*G,_t>ut||Ft<-ut)||(_t=Math.min(J,le,Te),Ft=Math.max(J,le,Te),_t>N||Ft<-N)||(_t=Math.min(re,ue,me),Ft=Math.max(re,ue,me),_t>G||Ft<-G)||(_t=Math.min(Q,he,xe),Ft=Math.max(Q,he,xe),_t>H||Ft<-H))return!1;const At=we*it-je*Qe,It=je*He-_e*it,Xt=_e*Qe-we*He,Yt=-(At*J+It*re+Xt*Q);return ut=N*Math.abs(At)+G*Math.abs(It)+H*Math.abs(Xt),!(Math.abs(Yt)>ut)}const kH=[];class nD{serializeFromGltf(r,s,u,f){if(r.length<7)return;let g=0;if(r[g++]!==109||r[g++]!==98||r[g++]!==120||r[g++]!==98||r[g++]!==118||r[g++]!==104||r[g++]!==43)return;const v=new DataView(r.buffer,r.byteOffset),x=v.getUint16(g,!0);if(g+=2,x===0)return;this._nodes=[];let w=0;for(let R=0;R<x;R++){const M=[s[3*w],s[3*w+1],s[3*w+2]],O=[u[3*w],u[3*w+1],u[3*w+2]];w++;const B=v.getUint16(g,!0);g+=2;let N=0,G=0;B===65535&&(N=v.getUint16(g,!0),g+=2,G=v.getUint32(g,!0),g+=4),this._nodes.push({aabbMin:M,aabbMax:O,backChild:B,indexCount:N,indexOffset:G})}const A=v.getUint32(g,!0);this._indices=f.slice(0,A)}setVertices(r){this._vertices=r}findHighestPoint(r,s){if(!this._nodes||this._nodes.length===0||!wA(this._nodes[0].aabbMin,this._nodes[0].aabbMax,r,s))return null;const u=kH;u.length=0,u.push(0);let f=-1/0;for(;u.length>0;){const g=u.pop(),v=this._nodes[g];if(v.aabbMax[2]<=f)continue;if(v.backChild===65535){for(let B=0;B<v.indexCount;B+=3){const N=3*this._indices[v.indexOffset+B],G=3*this._indices[v.indexOffset+B+1],H=3*this._indices[v.indexOffset+B+2];RH(this._vertices[N],this._vertices[N+1],this._vertices[N+2],this._vertices[G],this._vertices[G+1],this._vertices[G+2],this._vertices[H],this._vertices[H+1],this._vertices[H+2],r,s)&&(f=Math.max(f,this._vertices[N+2],this._vertices[G+2],this._vertices[H+2]))}continue}const x=g+1,w=v.backChild,A=this._nodes[x],R=this._nodes[w],M=wA(A.aabbMin,A.aabbMax,r,s),O=wA(R.aabbMin,R.aabbMax,r,s);M&&O?A.aabbMax[2]<R.aabbMax[2]?(u.push(x),u.push(w)):(u.push(w),u.push(x)):M?u.push(x):O&&u.push(w)}return f>=0?f:null}}function em(l,r){const s=l.json.bufferViews[r.bufferView],u=lS[r.componentType];return new u(l.buffers[s.buffer],(r.byteOffset||0)+(s.byteOffset||0),r.count*(s.byteStride&&s.byteStride!==Sv[r.type]*u.BYTES_PER_ELEMENT?s.byteStride/u.BYTES_PER_ELEMENT:Sv[r.type]))}function SA(l,r,s,u){const f=lS[r.componentType],g=(function(R){switch(R){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:return 1}})(f),v=l.json.bufferViews[r.bufferView],x=v.byteStride?v.byteStride/f.BYTES_PER_ELEMENT:Sv[r.type],w=s.float32,A=w.length/s.capacity;for(let R=0,M=0;R<r.count*x;R+=x,M+=A)for(let O=0;O<A;O++)w[M+O]=u[R+O]*g;s._trim()}function MH(l,r,s){const u=l.indices,f=l.attributes,g={};g.indexArray=new _i;const v=r.json.accessors[u],x=v.count/3;g.indexArray.reserve(x);const w=em(r,v);for(let O=0;O<x;O++)g.indexArray.emplaceBack(w[3*O],w[3*O+1],w[3*O+2]);g.indexArray._trim(),g.vertexArray=new Ta;const A=r.json.accessors[f.POSITION];g.vertexArray.reserve(A.count);const R=em(r,A);for(let O=0;O<A.count;O++)g.vertexArray.emplaceBack(R[3*O],R[3*O+1],R[3*O+2]);if(g.vertexArray._trim(),g.aabb=new pi(A.min,A.max),g.centroid=(function(O,B){const N=[0,0,0],G=O.length;if(G>0){for(let H=0;H<G;H++){const J=3*O[H];
24N[0]+=B[J],N[1]+=B[J+1],N[2]+=B[J+2]}N[0]/=G,N[1]/=G,N[2]/=G}return N})(w,R),f.COLOR_0!==void 0){const O=r.json.accessors[f.COLOR_0],B=Sv[O.type],N=em(r,O);g.colorArray=B===3?new Ta:new Oc,g.colorArray.resize(O.count),SA(r,O,g.colorArray,N)}if(f.NORMAL!==void 0){g.normalArray=new Ta;const O=r.json.accessors[f.NORMAL];g.normalArray.resize(O.count);const B=em(r,O);SA(r,O,g.normalArray,B)}if(f.TEXCOORD_0!==void 0&&s.length>0){g.texcoordArray=new Ru;const O=r.json.accessors[f.TEXCOORD_0];g.texcoordArray.resize(O.count);const B=em(r,O);SA(r,O,g.texcoordArray,B)}if(f._FEATURE_ID_RGBA4444!==void 0){const O=r.json.accessors[f._FEATURE_ID_RGBA4444];r.json.extensionsUsed&&r.json.extensionsUsed.includes("EXT_meshopt_compression")&&(g.featureData=em(r,O))}f._FEATURE_RGBA4444!==void 0&&(g.featureData=new Uint32Array(em(r,r.json.accessors[f._FEATURE_RGBA4444]).buffer));const M=l.material;return g.material=(function(O,B){const{emissiveFactor:N=[0,0,0],alphaMode:G="OPAQUE",alphaCutoff:H=.5,normalTexture:J,occlusionTexture:re,emissiveTexture:Q,doubleSided:le,name:ue}=O,{baseColorFactor:he=[1,1,1,1],metallicFactor:Te=1,roughnessFactor:me=1,baseColorTexture:xe,metallicRoughnessTexture:_e}=O.pbrMetallicRoughness||{},we=re?B[re.index]:void 0;if(re&&re.extensions&&re.extensions.KHR_texture_transform&&we){const je=re.extensions.KHR_texture_transform;we.offsetScale=[je.offset[0],je.offset[1],je.scale[0],je.scale[1]]}return{name:ue,pbrMetallicRoughness:{baseColorFactor:new xr(...he),metallicFactor:Te,roughnessFactor:me,baseColorTexture:xe?B[xe.index]:void 0,metallicRoughnessTexture:_e?B[_e.index]:void 0},doubleSided:le,emissiveFactor:new xr(...N),alphaMode:G,alphaCutoff:H,normalTexture:J?B[J.index]:void 0,occlusionTexture:we,emissionTexture:Q?B[Q.index]:void 0,defined:O.defined===void 0}})(M!==void 0?r.json.materials[M]:{defined:!1},s),g}function TA(l,r,s){const{matrix:u,rotation:f,translation:g,scale:v,mesh:x,extras:w,children:A,name:R}=l,M={};if(M.name=R,M.localMatrix=u||(function(O,B,N,G){var H=B[0],J=B[1],re=B[2],Q=B[3],le=H+H,ue=J+J,he=re+re,Te=H*le,me=H*ue,xe=H*he,_e=J*ue,
24we=J*he,je=re*he,He=Q*le,Qe=Q*ue,it=Q*he,nt=G[0],bt=G[1],Ze=G[2];return O[0]=(1-(_e+je))*nt,O[1]=(me+it)*nt,O[2]=(xe-Qe)*nt,O[3]=0,O[4]=(me-it)*bt,O[5]=(1-(Te+je))*bt,O[6]=(we+He)*bt,O[7]=0,O[8]=(xe+Qe)*Ze,O[9]=(we-He)*Ze,O[10]=(1-(Te+_e))*Ze,O[11]=0,O[12]=N[0],O[13]=N[1],O[14]=N[2],O[15]=1,O})([],f||[0,0,0,1],g||[0,0,0],v||[1,1,1]),M.globalMatrix=W(M.localMatrix),x!==void 0){M.meshes=s[x];const O=M.anchor=[0,0];for(const B of M.meshes){const{min:N,max:G}=B.aabb;O[0]+=N[0]+G[0],O[1]+=N[1]+G[1]}O[0]=Math.floor(O[0]/M.meshes.length/2),O[1]=Math.floor(O[1]/M.meshes.length/2)}if(w&&(w.id&&(M.id=w.id),w.lights&&(M.lights=(function(O){if(!O.length)return[];const B=(function(re){const Q=atob(re),le=new Uint8Array(Q.length);for(let ue=0;ue<Q.length;ue++)le[ue]=Q.codePointAt(ue);return le})(O),N=[],G=B.length/24,H=new Uint16Array(B.buffer),J=new Float32Array(B.buffer);for(let re=0;re<G;re++){const Q=H[2*re*6]/30,le=H[2*re*6+1]/30,ue=H[2*re*6+10]/100,he=J[6*re+1],Te=J[6*re+2],me=J[6*re+3],xe=J[6*re+4],_e=me-he,we=xe-Te,je=Math.hypot(_e,we);N.push({pos:[he+.5*_e,Te+.5*we,le],normal:[we/je,-_e/je,0],width:je,height:Q,depth:ue,points:[he,Te,me,xe]})}return N})(w.lights)),w.MAPBOX_geometry_bloom&&(M.isGeometryBloom=w.MAPBOX_geometry_bloom)),A){const O=[];for(const B of A)O.push(TA(r.json.nodes[B],r,s));M.children=O}if(l.extensions&&l.extensions.mbx_bvh&&(M.meshBVH=(function(O,B,N){const G=B.binaryAccessor,H=B.positionMinAccessor,J=B.positionMaxAccessor,re=B.indexAccessor;if(!(Number.isInteger(G)&&Number.isInteger(H)&&Number.isInteger(J)&&Number.isInteger(re)))return null;const Q=O.json.accessors;if(G>=Q.length||H>=Q.length||J>=Q.length||re>=Q.length)return null;const le=Q[G],ue=Q[H],he=Q[J],Te=Q[re];if(le.bufferView===void 0||ue.bufferView===void 0||he.bufferView===void 0||Te.bufferView===void 0)return null;const me=O.json.bufferViews;if(le.bufferView>=me.length||ue.bufferView>=me.length||he.bufferView>=me.length||Te.bufferView>=me.length)return null;const xe=me[le.bufferView],_e=me[ue.bufferView],we=me[he.bufferView],je=me[Te.bufferView];if(xe.buffer>=O.buffers.length||_e.buffer>=O.buffers.length||we.buffer>=O.buffers.length||je.buffer>=O.buffers.length)return null;const He=(Ft,ut,At)=>Ft>=0&&Ft<=At&&ut<=At-Ft,Qe=le.byteOffset||0,it=ue.byteOffset||0,nt=he.byteOffset||0,bt=Te.byteOffset||0;if(!(He(Qe,0,xe.byteLength)&&He(it,3*ue.count*4,_e.byteLength)&&He(nt,3*he.count*4,we.byteLength)&&He(bt,4*Te.count,je.byteLength)))return null;const Ze=new Uint8Array(O.buffers[xe.buffer],(xe.byteOffset||0)+Qe,xe.byteLength-Qe),et=new Float32Array(O.buffers[_e.buffer],(_e.byteOffset||0)+it,3*ue.count),ot=new Float32Array(O.buffers[we.buffer],(we.byteOffset||0)+nt,3*he.count),ft=new Uint32Array(O.buffers[je.buffer],(je.byteOffset||0)+bt,Te.count),_t=new nD;if(_t.serializeFromGltf(Ze,et,ot,ft),N!==void 0&&O.json.meshes&&O.json.meshes[N]){const Ft=O.json.meshes[N].primitives[0];if(Ft&&Ft.attributes.POSITION!==void 0&&Ft.attributes.POSITION<Q.length){const ut=Q[Ft.attributes.POSITION];if(ut.bufferView!==void 0&&ut.bufferView<me.length){const At=me[ut.bufferView];if(At.buffer<O.buffers.length){const It=ut.byteOffset||0,Xt=At.byteStride?At.byteStride/4:3;if(He(It,ut.count*Xt*4,At.byteLength)){const Yt=(At.byteOffset||0)+It;if(Xt===3)_t.setVertices(new Float32Array(O.buffers[At.buffer],Yt,3*ut.count));else{const gn=new Float32Array(O.buffers[At.buffer],Yt,ut.count*Xt),on=new Float32Array(3*ut.count);for(let En=0;En<ut.count;En++)on[3*En]=gn[En*Xt],on[3*En+1]=gn[En*Xt+1],on[3*En+2]=gn[En*Xt+2];_t.setVertices(on)}}}}}}return _t})(r,l.extensions.mbx_bvh,x)),!M.meshBVH&&M.children){for(const O of M.children)if(O.meshBVH){M.meshBVH=O.meshBVH;break}}return M}function LH(l){if(l.vertices.length===0||l.indices.length===0)return null;const r=new Xw(l.vertices,l.indices,8,256),[s,u]=[r.min.clone(),r.max.clone()];return{vertices:l.vertices,indices:l.indices,grid:r,min:s,max:u}}function OH(l){if(!l.extras||!l.extras.ground)return null;const r=l.extras.ground;if(!r||!Array.isArray(r)||r.length===0)return null;const s=r[0];if(!s||!Array.isArray(s)||s.length===0)return null;const u=[];for(const v of s){if(!Array.isArray(v)||v.length!==2)continue;const x=v[0],w=v[1];typeof x=="number"&&typeof w=="number"&&u.push(new St(x,w))}if(u.length<3)return null;u.length>1&&u.at(-1).equals(u[0])&&u.pop();let f=0;for(let v=0;v<u.length;v++){const x=u[v],w=u[(v+1)%u.length],A=u[(v+2)%u.length];f+=(x.x-w.x)*(A.y-w.y)-(A.x-w.x)*(x.y-w.y)}f>0&&u.reverse();const g=vs(u.flatMap(v=>[v.x,v.y]),[]);return g.length===0?null:{vertices:u,indices:g}}function DH(l,r){const s=[],u=[];let f=0;const g=[];for(const v of l){f=s.length;const x=v.vertexArray.float32,w=v.indexArray.uint16;for(let A=0;A<v.vertexArray.length;A++)g[0]=x[3*A+0],g[1]=x[3*A+1],g[2]=x[3*A+2],mt(g,g,r),s.push(new St(g[0],g[1]));for(let A=0;A<3*v.indexArray.length;A++)u.push(w[A]+f)}if(u.length%3!=0)return null;for(let v=0;v<u.length;v+=3){const x=s[u[v+0]],w=s[u[v+1]],A=s[u[v+2]];(x.x-w.x)*(A.y-w.y)-(A.x-w.x)*(x.y-w.y)>0&&([u[v+1],u[v+2]]=[u[v+2],u[v+1]])}return{vertices:s,indices:u}}function rD(l,r){for(let s=0;s<l.length;s++)if(l[s].name===r)return s;return-1}function EA(l){const r=(function(R,M){const O=[],B=WebGL2RenderingContext;if(R.json.textures)for(const N of R.json.textures){const G={magFilter:B.LINEAR,minFilter:B.NEAREST,wrapS:B.REPEAT,wrapT:B.REPEAT};N.sampler!==void 0&&Object.assign(G,R.json.samplers[N.sampler]),O.push({image:M[N.source],sampler:G,uploaded:!1})}return O})(l,l.images),s=(function(R,M){const O=[];for(const B of R.json.meshes){const N=[];for(const G of B.primitives)N.push(MH(G,R,M));O.push(N)}return O})(l,r),{scenes:u,scene:f,nodes:g}=l.json;let v=u?rD(u,"Default Scene"):-1;v<0&&(v=f||0);const x=u?u[v].nodes:[...g.keys()],w=[];for(const R of x)w.push(TA(g[R],l,s));(function(R,M,O){const B={},N=new Set;for(let G=0;G<R.length;G++){const H=O[M[G]];if(!H.extras)continue;const J=H.extras["mapbox:footprint:version"],re=H.extras["mapbox:footprint:id"];(J||re)&&N.add(G),J==="1.0.0"&&re&&(B[re]=G)}for(let G=0;G<R.length;G++){if(N.has(G))continue;const H=R[G],J=O[M[G]];if(!J.extras)continue;let re=null;H.id in B&&(re=DH(R[B[H.id]].meshes,H.localMatrix)),re||(re=OH(J)),re&&(H.footprint=LH(re))}if(N.size>0){const G=Array.from(N.values()).sort((H,J)=>H-J);for(let H=G.length-1;H>=0;H--)R.splice(G[H],1)}})(w,x,l.json.nodes);const A=u?rD(u,"LOD"):-1;if(A>=0){const R=u[A].nodes,M=new Map;for(const O of R){const B=TA(g[O],l,s);B.id&&M.set(B.id,B)}for(const O of w)if(O.id){const B=M.get(O.id);
vendor: 4,527 bytes, line 24
24B&&B.meshes&&(O.lodMeshes=B.meshes,B.meshBVH&&(O.meshBVH=B.meshBVH))}}return w}function FH(l){l.heightmap=new Float32Array(4096),l.heightmap.fill(-1);const r=l.vertexArray.float32,s=l.aabb.min[0]-1,u=l.aabb.min[1]-1,f=Qp/(l.aabb.max[0]-s+2),g=Qp/(l.aabb.max[1]-u+2);for(let v=0;v<r.length;v+=3){const x=r[v+2],w=(r[v+0]-s)*f|0,A=(r[v+1]-u)*g|0;x>l.heightmap[A*Qp+w]&&(l.heightmap[A*Qp+w]=x)}}function iD(l,r,s,u,f){s.reserve(s.length+4*l.length),u.reserve(u.length+10*l.length),f.reserve(f.length+10*l.length);let g=u.length;for(const v of l){const x=Math.min(10,Math.max(4,1.3*v.height))*r,w=[-v.normal[1],v.normal[0],0],A=Math.min(.29,.1*v.width/v.depth),R=v.width-2*v.depth*r*(A+.01),M=Rn([],v.pos,w,R/2),O=Rn([],v.pos,w,-R/2),B=[M[0],M[1],M[2]+v.height],N=[O[0],O[1],O[2]+v.height],G=Rn([],v.normal,w,A);Yn(G,G,x);const H=Rn([],v.normal,w,-A);Yn(H,H,x),sn(G,M,G),sn(H,O,H),M[2]+=.1,O[2]+=.1,u.emplaceBack(G[0],G[1],G[2]),u.emplaceBack(H[0],H[1],H[2]),u.emplaceBack(M[0],M[1],M[2]),u.emplaceBack(O[0],O[1],O[2]),u.emplaceBack(B[0],B[1],B[2]),u.emplaceBack(N[0],N[1],N[2]),u.emplaceBack(M[0],M[1],M[2]),u.emplaceBack(O[0],O[1],O[2]),u.emplaceBack(G[0],G[1],G[2]),u.emplaceBack(H[0],H[1],H[2]);const J=R/x/2;f.emplaceBack(-J-A,-1,J,.8),f.emplaceBack(J+A,-1,J,.8),f.emplaceBack(-J,0,J,1.3),f.emplaceBack(J,0,J,1.3),f.emplaceBack(J+A,-.8,J,.7),f.emplaceBack(J+A,-.8,J,.7),f.emplaceBack(0,0,J,1.3),f.emplaceBack(0,0,J,1.3),f.emplaceBack(J+A,-1.2,J,.8),f.emplaceBack(J+A,-1.2,J,.8),s.emplaceBack(6+g,4+g,8+g),s.emplaceBack(7+g,9+g,5+g),s.emplaceBack(0+g,1+g,2+g),s.emplaceBack(1+g,3+g,2+g),g+=10}}function BH(l,r){const s={};s.indexArray=new _i,s.vertexArray=new Ta,s.colorArray=new Oc,iD(l,r,s.indexArray,s.vertexArray,s.colorArray);const u={defined:!0};u.emissiveFactor=xr.black;const f={};return f.baseColorFactor=xr.white,u.pbrMetallicRoughness=f,s.material=u,s.aabb=new pi([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),s}Kt(nD,"ModelBVH");const oD=Jn([{name:"a_pos_3f",components:3,type:"Float32"}]),zH=Jn([{name:"a_normal_3",components:3,type:"Int16"}]),NH=Jn([{name:"a_centroid_3",components:3,type:"Int16"}]),sD=Jn([{name:"a_part_color_emissive",components:2,type:"Uint16"}]),VH=Jn([{name:"a_faux_facade_color_emissive",components:2,type:"Uint16"}]),UH=Jn([{name:"a_faux_facade_data",components:4,type:"Uint16"}]),$H=Jn([{name:"a_faux_facade_vertical_range",components:2,type:"Uint16"}]),jH=Jn([{name:"a_bloom_attenuation",components:4,type:"Float32"}]),GH=Jn([{name:"a_flood_light_wall_radius_1i16",components:1,type:"Int16"}]),CA=4096;class HH{constructor(r){this.module=r,this.memoryStack=this.module.malloc(CA),this.memoryStackNextFree=this.memoryStack}createIntArray(r){const s=this.memoryStackNextFree;return this.memoryStackNextFree+=r.length*Int32Array.BYTES_PER_ELEMENT,this.memoryStackNextFree-this.memoryStack>CA?-1:(new Int32Array(this.module.heap32.buffer,s,r.length).set(r),s)}createFloatArray(r){const s=this.memoryStackNextFree;return this.memoryStackNextFree+=r.length*Float32Array.BYTES_PER_ELEMENT,this.memoryStackNextFree-this.memoryStack>CA?-1:(new Float32Array(this.module.heapF32.buffer,s,r.length).set(r),s)}readStringBuffer(r){let s="";for(;this.module.heapU8[r]!==0;)s+=String.fromCharCode(this.module.heapU8[r]),++r;return s}setStyle(r){const s=r.normalScale;this.module.setStyle(s[0],s[1],s[2],r.tileToMeters)}setAOOptions(r,s){this.module.setAOOptions(r?1:0,s)}setMetricOptions(r,s){this.module.setMetricOptions(r?1:0,s)}setStructuralOptions(r){this.module.setStructuralOptions(r?1:0)}setFacadeOptions(r,s){this.module.setFacadeOptions(r,s?1:0)}setFauxFacadeOptions(r,s,u){this.module.setFauxFacadeOptions(r?1:0,s?1:0,u)}setFacadeClassifierOptions(r){this.module.setFacadeClassifierOptions(r)}generateMesh(r,s){this.memoryStackNextFree=this.memoryStack;for(const x of r){const w=this.createIntArray(x.ringIndices),A=this.createFloatArray(x.coordinates);if(w===-1||A===-1)return`building_gen: Out of stack memory: ${this.memoryStackNextFree-this.memoryStack}/4096`;this.module.addFeature(x.id,x.sourceId,x.minHeight,x.height,x.roofType,A,w,x.ringIndices.length-1)}for(const x of s){let w;w=x.entrances?JSON.parse(x.entrances):[];const A=this.createFloatArray(w),R=this.createFloatArray(x.coordinates);if(A===-1||R===-1)return`building_gen: Out of stack memory: ${this.memoryStackNextFree-this.memoryStack}/4096`;this.module.addFacade(x.sourceId,x.crossPerc,x.distanceToRoad,A,w.length,R,x.coordinates.length)}if(!this.module.generateMesh()){const x=this.module.getLastError();return this.readStringBuffer(x)}
vendor: 11,613 bytes, line 24
24const u=this.module.getMeshCount(),f=new Array(u);for(let x=0;x<u;x++){const w=this.module.getPositionsPtr(x),A=this.module.getPositionsLength(x),R=new Float32Array(this.module.heapF32.buffer,w,A),M=this.module.getNormalsPtr(x),O=this.module.getNormalsLength(x),B=new Float32Array(this.module.heapF32.buffer,M,O),N=this.module.getAOPtr(x),G=this.module.getAOLength(x),H=new Float32Array(this.module.heapF32.buffer,N,G),J=this.module.getUVPtr(x),re=this.module.getUVLength(x),Q=new Float32Array(this.module.heapF32.buffer,J,re),le=this.module.getFauxFacadePtr(x),ue=this.module.getFauxFacadeLength(x),he=new Uint8Array(this.module.heapU8.buffer,le,ue),Te=this.module.getIndicesPtr(x),me=this.module.getIndicesLength(x),xe=new Int16Array(this.module.heap16.buffer,Te,me),_e=this.module.getBuildingPart(x);f[x]={positions:R,normals:B,ao:H,uv:Q,isFauxFacade:he,indices:xe,buildingPart:_e}}const g=this.module.getRingCount(),v=[];for(let x=0;x<g;x++){const w=this.module.getRingPtr(x),A=this.module.getRingLength(x),R=new Float32Array(this.module.heapF32.buffer,w,A);v.push(R)}return{meshes:f,outerRingLength:this.module.getOuterRingLength(),modifiedPolygonRings:v}}}const aD=Ou.types,mS=32767;function WH(l,r){const s=Bt+r;for(const u of l)for(const f of u)if(f.x<-r||f.x>s||f.y<-r||f.y>s)return!1;return!0}function qH(l){switch(l){case"flat":return 3;case"hipped":return 1;case"gabled":return 2;case"parapet":return 0;case"mansard":return 4;case"skillion":return 5;case"pyramidal":return 6;default:throw new Error(`Unknown roof shape: ${l}`)}}let s_=null,lD=null,Sl=null;class AA{constructor(){this.layoutVertexArray=new Ta,this.layoutAttenuationArray=new Oc,this.layoutColorArray=new Bs,this.indexArray=new _i,this.indexArrayForConflation=new _i,this.segmentsBucket=new Wr}}class IA{constructor(r){this.layoutFacadePaintArray=null,this.layoutFacadeDataArray=null,this.layoutFacadeVerticalRangeArray=null,this.segmentsBucket=new Wr,this.entranceBloom=new AA;const s=66560;this.layoutVertexArray=new Ta,this.layoutVertexArray.reserve(s),this.layoutNormalArray=new Id,this.layoutNormalArray.reserve(s),this.layoutCentroidArray=new Id,this.layoutCentroidArray.reserve(s),this.layoutColorArray=new Bs,this.layoutColorArray.reserve(s),this.layoutFloodLightDataArray=new rf,this.layoutFloodLightDataArray.reserve(s),this.layoutAOArray=new Gp,this.layoutAOArray.reserve(s),this.indexArray=new _i,this.indexArray.reserve(66560),this.indexArrayForConflation=new _i,this.segmentsBucket=new Wr,this.entranceBloom=new AA,r&&(this.layoutFacadePaintArray=new Bs,this.layoutFacadeDataArray=new nf,this.layoutFacadeVerticalRangeArray=new Bs)}reserve(r,s,u){this.layoutVertexArray.reserveForAdditional(r),this.layoutCentroidArray.reserveForAdditional(r),this.layoutFloodLightDataArray.reserveForAdditional(r),this.layoutNormalArray.reserveForAdditional(r),this.layoutAOArray.reserveForAdditional(r),this.layoutColorArray.reserveForAdditional(r),this.indexArray.reserveForAdditional(s),u&&(this.layoutFacadePaintArray.reserveForAdditional(r),this.layoutFacadeDataArray.reserveForAdditional(r),this.layoutFacadeVerticalRangeArray.reserveForAdditional(r))}}class cD{constructor(r){this.colorBufferUploaded=!1,this.maxHeight=0,this.replacementUpdateTime=0,this.activeReplacements=[],this.footprints=[],this.footprintsVertices=new Ru,this.footprintsIndices=new Dc,this.footprintsMin=new St(1/0,1/0),this.footprintsMax=new St(-1/0,-1/0),this.featuresOnBorder=[],this.buildingWithoutFacade=new IA(!1),this.buildingWithFacade=new IA(!0),this.indexArrayForConflationUploaded=!1,this.featureFootprintLookup=new Map,this.buildingIds=new Set,this.footprintLookup={},this.zoom=r.zoom,this.canonical=r.canonical,this.layers=r.layers,this.layerIds=this.layers.map(s=>s.fqid),this.index=r.index,this.hasPattern=!1,this.worldview=r.worldview,this.lut=r.lut,this.programConfigurations=new Ea(r.layers,{zoom:r.zoom,lut:r.lut}),this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id),this.projection=r.projection,this.groundEffect=new hA(r),this.groundEffect.groundRadiusArray=new Zo,this.hasAppearances=null}updateFootprints(r,s){const u=new Xw([],[],1),f={vertices:[],indices:new Uint32Array(0),grid:u,min:this.footprintsMin,max:this.footprintsMax,buildingIds:this.buildingIds};s.push({footprint:f,id:r})}updateAppearances(r,s,u,f){return{hasLayoutChanges:!1,hasUboChanges:!1}}populate(r,s,u,f){if(!Sl)return;const g=Aa(u);this.tileToMeter=g,this.brightness=s.brightness,Sl.setStyle({normalScale:[1,-1,g],tileToMeters:g}),Sl.setAOOptions(!1,.3),Sl.setMetricOptions(!1,16),Sl.setStructuralOptions(!0),Sl.setFacadeClassifierOptions(3);const v=new Map,x=new Map;let w=0;for(const{feature:H}of r){if(aD[H.type]!=="LineString"){v.set(H.id,H.properties.source_id);continue}const J=this.layers[0]._featureFilter.needGeometry;if(J&&!this.layers[0]._featureFilter.filter(new Tr(this.zoom),H,u))continue;const re=Ya(H,J);if(!J&&!this.layers[0]._featureFilter.filter(new Tr(this.zoom),re,u))continue;const Q=J?re.geometry:sa(H,u,f),le=[];for(const me of Q)for(const xe of me)le.push(xe.x),le.push(xe.y);const ue={coordinates:le,crossPerc:H.properties.cross_perc,distanceToRoad:H.properties.distance_to_road,entrances:H.properties.entrances,sourceId:0},he=H.properties.source_id;let Te=x.get(he);Te||(Te=[],x.set(he,Te)),Te.push(ue),++w}this.maxHeight=0;const A=new Array,R=new Set,M=H=>{H!=null&&R.add(H)},O=(H,J)=>{H!=null&&A.push({buildingId:H,footprintIndex:J})},B=64*(r.length-w),N=B/2;this.buildingWithFacade.reserve(B,N,!0),this.buildingWithoutFacade.reserve(2*B,2*N,!1),this.footprintsIndices.reserve(16*(r.length-w)),this.footprintsVertices.reserve(8*(r.length-w));for(const{feature:H,id:J,index:re,sourceLayerIndex:Q}of r){if(aD[H.type]==="LineString")continue;const le=this.layers[0]._featureFilter.needGeometry;if(le&&!this.layers[0]._featureFilter.filter(new Tr(this.zoom),H,u))continue;let ue=null;if(H.properties&&Object.hasOwn(H.properties,"building_id")&&(ue=Number(H.properties.building_id),R.has(ue)))continue;const he=Ya(H,le);if(!le&&!this.layers[0]._featureFilter.filter(new Tr(this.zoom),he,u))continue;const Te=le?he.geometry:sa(H,u,f),me=mv(Te,500);let xe=!1;for(const er of me)if(er.length!==1){xe=!0;break}if(xe){M(ue);continue}if(!WH(Te,163)){M(ue);continue}const _e=this.layers[0],we=qH(_e.layout.get("building-roof-shape").evaluate(H,{},u)),je=_e.layout.get("building-base").evaluate(H,{},u),He=_e.layout.get("building-height").evaluate(H,{},u),Qe=_e.layout.get("building-flood-light-ground-radius").evaluate(H,{},u),it=_e.paint.get("building-ambient-occlusion-intensity"),nt=Qe/this.tileToMeter;H.properties["building-part"]="roof";const bt=_e.paint.get("building-color").evaluate(H,{},this.canonical).toPremultipliedRenderColor(this.lut),Ze=_e.paint.get("building-emissive-strength").evaluate(H,{},this.canonical);H.properties["building-part"]="wall";const et=_e.paint.get("building-color").evaluate(H,{},this.canonical).toPremultipliedRenderColor(this.lut),ot=_e.paint.get("building-emissive-strength").evaluate(H,{},this.canonical);H.properties["building-part"]="window";const ft=_e.paint.get("building-color").evaluate(H,{},this.canonical).toPremultipliedRenderColor(this.lut),_t=_e.paint.get("building-emissive-strength").evaluate(H,{},this.canonical);H.properties["building-part"]="door";const Ft=_e.paint.get("building-color").evaluate(H,{},this.canonical).toPremultipliedRenderColor(this.lut),ut=_e.paint.get("building-emissive-strength").evaluate(H,{},this.canonical);let At=_e.layout.get("building-flood-light-wall-radius").evaluate(H,{},u);At=Ee(At,0,2048);const It=At/2048*mS,Xt=v.get(J),Yt=x.get(Xt)||[],gn=Yt.length!==0&&_e.layout.get("building-facade").evaluate(H,{},u);Sl.setFacadeOptions(4,!0),Sl.setFauxFacadeOptions(gn,!1,1);let on=0,En=0,_r=0,Nn=0,sr=0,Zn=0,Pi=0,Cr=0,gr=0,jr=0,mi=0;if(gn){let er=Math.round(_e.layout.get("building-facade-floors").evaluate(H,{},u));if(je===0){er=Math.max(1,er-(Yt.length>0?1:0));let ki=4;if(He>100){const go=[10,13,15];ki=go[H.id?H.id%go.length:0]}else He<=10&&(ki=3);Sl.setFacadeOptions(ki,!0),sr=(He<15?1.3:1.61803)*ki/g}else sr=je/g;Zn=He/g,sr=Math.min(sr,Zn),_r=_e.layout.get("building-facade-unit-width").evaluate(H,{},u)/g,Nn=(Zn-sr)/er,Sl.setFauxFacadeOptions(!0,!0,_r);const Fo=_e.layout.get("building-facade-window").evaluate(H,{},u);on=Fo[0],En=Fo[1],Pi=Math.floor(65535*Math.min(1,sr/Bt)),Cr=Math.floor(65535*Math.min(1,Zn/Bt)),gr=Math.floor(255*on)<<8|Math.floor(255*En),jr=Math.floor(65535*Math.min(1,_r/Bt)),mi=Math.floor(65535*Math.min(1,Nn/Bt))}const Co=Array(me.length),Yr={x:1/0,y:1/0},Ri={x:-1/0,y:-1/0},oo={x:0,y:0};let Ki=0;for(let er=0;er<me.length;er++){const Fo=me[er];if(Fo.length>0){const ki=[],go=Array(Fo.length+1);go[0]=0;for(let Cl=0;Cl<Fo.length;Cl++){const Ma=Fo[Cl];for(let Qa=0;Qa<Ma.length;Qa++){const La=Ma[Ma.length-Qa-1];Yr.x=Math.min(Yr.x,La.x),Yr.y=Math.min(Yr.y,La.y),Ri.x=Math.max(Ri.x,La.x),Ri.y=Math.max(Ri.y,La.y),oo.x+=La.x,oo.y+=La.y,Ki++,ki.push(La.x),ki.push(La.y)}go[Cl+1]=ki.length}Co[er]={id:H.id?H.id:0,height:He,minHeight:je,sourceId:0,roofType:we,coordinates:ki,ringIndices:go}}}oo.x/=Ki||1,oo.y/=Ki||1;const so=Sl.generateMesh(Co,Yt);if(typeof so=="string"){On(`Unable to generate building ${H.id}: ${so}`),M(ue);continue}if(so.meshes.length===0||so.modifiedPolygonRings.length===0){M(ue);continue}const Qn=gn?this.buildingWithFacade:this.buildingWithoutFacade;let Ko=0;for(const er of so.meshes)Ko+=er.positions.length/3;const Ms=Qn.segmentsBucket.prepareSegment(Ko,Qn.layoutVertexArray,Qn.indexArray),Gi=[];let Do=null,bs=0,Jo=-1;const yi=Qn.layoutVertexArray.length,mo=yi+Ko;Qn.layoutVertexArray.resize(mo),Qn.layoutCentroidArray.resize(mo),Qn.layoutNormalArray.resize(mo),Qn.layoutAOArray.resize(mo),Qn.layoutColorArray.resize(mo),Qn.layoutFloodLightDataArray.resize(mo),gn&&(Qn.layoutFacadePaintArray.resize(mo),Qn.layoutFacadeDataArray.resize(mo),Qn.layoutFacadeVerticalRangeArray.resize(mo));const ca=Qn.indexArray.length;let g_=0,Vs=yi;for(const er of so.meshes){let Fo,ki;if(er.buildingPart===1)Fo=bt,ki=Ze;else if(er.buildingPart===0)Fo=et,ki=ot;else if(er.buildingPart===2)Fo=ft,ki=_t;else{if(er.buildingPart!==3)continue;Fo=Ft,ki=ut}if(ki=Ee(ki,0,1),er.buildingPart===3){const ao=new Array;for(let Us=0;Us<er.positions.length;Us+=12){const Qo=er.positions[Us+0],xs=er.positions[Us+1],tl=er.positions[Us+3],$u=er.positions[Us+4],US=er.positions[Us+2],pI=er.positions[Us+8]-US,mI=1,v_=tl-Qo,jc=$u-xs,Xv=Math.hypot(v_,jc);ao.push({pos:[Qo+.5*v_,xs+.5*jc,US],normal:[jc/Xv,-v_/Xv,0],width:Xv,height:pI,depth:mI,points:[Qo,xs,tl,$u]})}const $o=Qn.entranceBloom.segmentsBucket.prepareSegment(10*ao.length,Qn.entranceBloom.layoutVertexArray,Qn.entranceBloom.indexArray),Oi=Qn.entranceBloom.layoutVertexArray.length;bs=Qn.entranceBloom.indexArray.length,iD(ao,.5/this.tileToMeter,Qn.entranceBloom.indexArray,Qn.entranceBloom.layoutVertexArray,Qn.entranceBloom.layoutAttenuationArray);const el=Qn.entranceBloom.layoutVertexArray.length-Oi;Jo=Qn.entranceBloom.indexArray.length-bs;for(let Us=0;Us<el;Us++)Qn.entranceBloom.layoutColorArray.emplaceBack(255*Ft.r<<8|255*Ft.g,255*Ft.b<<8|51*ut);$o.vertexLength+=el,$o.primitiveLength+=Jo,Do={part:er.buildingPart,vertexOffset:Oi,vertexLength:el}}Qn.layoutVertexArray.float32.set(er.positions,3*Vs);const go=er.positions.length/3;for(let ao=0;ao<go;++ao){const $o=3*ao;g_=Math.max(g_,er.positions[$o+2]);const Oi=er.normals[$o+1]*mS,el=er.normals[$o+2]*mS,Us=3*(Vs+ao);Qn.layoutNormalArray.int16[Us]=er.normals[$o]*mS,Qn.layoutNormalArray.int16[Us+1]=Oi,Qn.layoutNormalArray.int16[Us+2]=el;const Qo=er.ao[ao];Qn.layoutAOArray.uint8[Vs+ao]=255*Qo;
vendor: 15,196 bytes, line 24
24const xs=1+(Qo-1)*it,tl=255*Fo.b*xs<<8|255*ki;Qn.layoutColorArray.uint16[2*(Vs+ao)]=255*Fo.r*xs<<8|255*Fo.g*xs,Qn.layoutColorArray.uint16[2*(Vs+ao)+1]=tl}const Cl=Math.min(8191,Math.max(0,Math.floor(oo.x))),Ma=Math.min(8191,Math.max(0,Math.floor(oo.y))),Qa=Math.floor(He),La=20,qv=4*Cl+Math.min(3,Math.round((Ri.x-Yr.x)*this.tileToMeter/La)),sc=4*Ma+Math.min(3,Math.round((Ri.y-Yr.y)*this.tileToMeter/La));for(let ao=0;ao<go;++ao){const $o=3*(Vs+ao);Qn.layoutCentroidArray.int16[$o]=qv,Qn.layoutCentroidArray.int16[$o+1]=sc,Qn.layoutCentroidArray.int16[$o+2]=Qa}if(Qn.layoutFloodLightDataArray.int16.fill(er.buildingPart===0?It:0,Vs,Vs+go),gn){const ao=255*ft.r<<8|255*ft.g,$o=255*ft.b<<8|255*_t;for(let Oi=0;Oi<go;++Oi){const el=2*(Vs+Oi);Qn.layoutFacadePaintArray.uint16[el]=ao,Qn.layoutFacadePaintArray.uint16[el+1]=$o}for(let Oi=0;Oi<go;++Oi)if(er.isFauxFacade[Oi]){const el=Math.min(65535,Math.floor(er.uv[2*Oi]*so.outerRingLength));Qn.layoutFacadeDataArray.emplace(Vs+Oi,1|el,gr,jr,mi),Qn.layoutFacadeVerticalRangeArray.emplace(Vs+Oi,Pi,Cr)}else Qn.layoutFacadeDataArray.emplace(Vs+Oi,0,0,0,0),Qn.layoutFacadeVerticalRangeArray.emplace(Vs+Oi,0,0)}const __=Ms.vertexLength,Uu=er.indices.length/3,y_=Qn.indexArray.length;Qn.indexArray.resize(y_+Uu);for(let ao=0;ao<Uu;++ao){const $o=3*ao,Oi=3*y_+$o;Qn.indexArray.uint16[Oi]=__+er.indices[$o],Qn.indexArray.uint16[Oi+1]=__+er.indices[$o+1],Qn.indexArray.uint16[Oi+2]=__+er.indices[$o+2]}er.buildingPart!==1&&er.buildingPart!==0&&er.buildingPart!==2&&er.buildingPart!==3||Gi.push({part:er.buildingPart,vertexOffset:Vs,vertexLength:er.positions.length/3}),Vs+=go,Ms.vertexLength+=go,Ms.primitiveLength+=er.indices.length/3}this.maxHeight=Math.max(this.maxHeight,g_);const fI=Qn.indexArray.length-ca,Hv=this.footprintsIndices.length,Wv=this.footprintsVertices.length,jd=[],Ja=new St(1/0,1/0),El=new St(-1/0,-1/0),vf=this.groundEffect.vertexArray.length;for(const er of so.modifiedPolygonRings){const Fo=[],ki=new St(1/0,1/0),go=new St(-1/0,-1/0);for(let Cl=0;Cl<er.length;Cl+=2){const Ma=er.length-Cl-2;ki.x=Math.min(ki.x,er[Ma]),ki.y=Math.min(ki.y,er[Ma+1]),go.x=Math.max(go.x,er[Ma]),go.y=Math.max(go.y,er[Ma+1]);const Qa=new St(er[Ma],er[Ma+1]);Fo.push(Qa),jd.push(Qa.x,Qa.y),this.footprintsVertices.emplaceBack(Qa.x,Qa.y)}Ja.x=Math.min(Ja.x,ki.x),Ja.y=Math.min(Ja.y,ki.y),El.x=Math.max(El.x,go.x),El.y=Math.max(El.y,go.y),this.groundEffect.addData(Fo,[ki,go],nt)}const bf=this.groundEffect.vertexArray.length-vf;this.groundEffect.groundRadiusArray.reserveForAdditional(bf);for(let er=0;er<bf;er++)this.groundEffect.groundRadiusArray.emplaceBack(Qe);(Yr.x<0||Ri.x>Bt||Yr.y<0||Ri.y>Bt)&&this.featuresOnBorder.push({featureId:H.id,footprintIndex:this.footprints.length});{const er=vs(jd,null,2);this.footprintsIndices.resize(this.footprintsIndices.length+er.length),this.footprintsIndices.uint16.set(er,Hv),this.buildingIds.add(ue??H.id),this.footprintsMin.x=Math.min(this.footprintsMin.x,Ja.x),this.footprintsMin.y=Math.min(this.footprintsMin.y,Ja.y),this.footprintsMax.x=Math.max(this.footprintsMax.x,El.x),this.footprintsMax.y=Math.max(this.footprintsMax.y,El.y);const Fo={footprintVertexOffset:Wv,footprintVertexLength:this.footprintsVertices.length-Wv,footprintIndexOffset:Hv,footprintIndexLength:this.footprintsIndices.length-Hv,min:Ja,max:El,hiddenFlags:0,indicesOffset:ca,indicesLength:fI,bloomIndicesOffset:bs,bloomIndicesLength:Jo,groundEffectVertexOffset:vf,groundEffectVertexLength:bf,hasFauxFacade:gn,height:g_,promoteId:J,feature:he,parts:Gi,buildingBloom:Do},ki=this.footprints.length;H.id!==void 0&&this.featureFootprintLookup.set(H.id,ki),O(ue,ki),this.footprints.push(Fo)}this.programConfigurations.populatePaintArrays(Qn.layoutVertexArray.length,H,re,{},s.availableImages,u,s.brightness),this.groundEffect.addPaintPropertiesData(H,re,{},s.availableImages,u,s.brightness),s.featureIndex.insert(H,Te,re,Q,this.index,yi)}A.forEach(({buildingId:H,footprintIndex:J})=>{R.has(H)&&(this.footprints[J].hiddenFlags|=4)});const G=new Set;this.buildingIds.forEach((H,J,re)=>{R.has(H)||G.add(H)}),this.buildingIds=G,this.groundEffect.prepareBorderSegments()}update(r,s,u,f,g,v,x){this.programConfigurations.updatePaintArrays(r,s,g,u,f,v,x),this.groundEffect.update(r,s,g,u,f,v,x),this.evaluate(this.layers[0],r),this.colorBufferUploaded=!1}updateExpressions(r){this.programConfigurations.updateExpressions(r),this.groundEffect.programConfigurations.updateExpressions(r)}isEmpty(){return this.buildingWithoutFacade.layoutVertexArray.length===0&&this.buildingWithFacade.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload||this.groundEffect.programConfigurations.needsUpload}upload(r){const s=u=>{u.layoutVertexBuffer=r.createVertexBuffer(u.layoutVertexArray,oD.members),u.layoutNormalBuffer=r.createVertexBuffer(u.layoutNormalArray,zH.members),u.layoutCentroidBuffer=r.createVertexBuffer(u.layoutCentroidArray,NH.members),u.layoutFloodLightDataBuffer=r.createVertexBuffer(u.layoutFloodLightDataArray,GH.members),u.layoutFacadeDataArray&&u.layoutFacadeDataArray.length&&(u.layoutFacadeDataBuffer=r.createVertexBuffer(u.layoutFacadeDataArray,UH.members)),u.layoutFacadeVerticalRangeArray&&u.layoutFacadeVerticalRangeArray.length&&(u.layoutFacadeVerticalRangeBuffer=r.createVertexBuffer(u.layoutFacadeVerticalRangeArray,$H.members)),u.entranceBloom.layoutVertexArray.length&&(u.entranceBloom.layoutVertexBuffer=r.createVertexBuffer(u.entranceBloom.layoutVertexArray,oD.members),u.entranceBloom.layoutAttenuationBuffer=r.createVertexBuffer(u.entranceBloom.layoutAttenuationArray,jH.members)),this.uploadUpdatedColorBuffer(r),this.uploadUpdatedIndexBuffer(r)};this.uploaded||(s(this.buildingWithoutFacade),s(this.buildingWithFacade),this.groundEffect.upload(r)),this.groundEffect.uploadPaintProperties(r),this.programConfigurations.upload(r),this.uploaded=!0}destroy(){const r=s=>{s.layoutVertexBuffer&&(s.layoutVertexBuffer.destroy(),s.layoutNormalBuffer.destroy(),s.layoutColorBuffer.destroy(),s.segmentsBucket.destroy(),s.indexBuffer&&s.indexBuffer.destroy(),s.entranceBloom.layoutVertexBuffer&&(s.entranceBloom.layoutVertexBuffer.destroy(),s.entranceBloom.layoutColorBuffer.destroy(),s.entranceBloom.layoutAttenuationBuffer.destroy(),s.entranceBloom.indexBuffer.destroy(),s.entranceBloom.segmentsBucket.destroy()))};r(this.buildingWithoutFacade),r(this.buildingWithFacade),this.groundEffect.destroy(),this.programConfigurations.destroy()}updateFootprintHiddenFlags(r,s,u=!0){let f=!1;const g=u?s:0,v=0|(u?-1:~s);this.groundEffect.hiddenByLandmarkVertexArray.length===0&&this.groundEffect.hiddenByLandmarkVertexArray.resize(this.groundEffect.vertexArray.length);for(const x of r){const w=this.footprints[x],A=w.hiddenFlags&v|g;w.hiddenFlags!==A&&(w.hiddenFlags=A,f=!0,this.groundEffect.updateHiddenByLandmarkRange(w.groundEffectVertexOffset,w.groundEffectVertexLength,w.hiddenFlags!==0))}return f&&(this.indexArrayForConflationUploaded=!1),f}uploadUpdatedIndexBuffer(r){if(this.groundEffect.uploadHiddenByLandmark(r),this.indexArrayForConflationUploaded)return;const s=f=>{f.indexArray.length!==0&&(f.indexArrayForConflation.resize(f.indexArray.length),f.indexArrayForConflation.uint16.set(f.indexArray.uint16),f.entranceBloom.indexArrayForConflation.resize(f.entranceBloom.indexArray.length),f.entranceBloom.indexArrayForConflation.uint16.set(f.entranceBloom.indexArray.uint16))};s(this.buildingWithoutFacade),s(this.buildingWithFacade);for(const f of this.footprints){const g=f.hasFauxFacade?this.buildingWithFacade:this.buildingWithoutFacade,v=f.indicesOffset+f.indicesLength;if(f.hiddenFlags!==0){for(let w=f.indicesOffset;w<v;w++)g.indexArrayForConflation.uint16[3*w+0]=0,g.indexArrayForConflation.uint16[3*w+1]=0,g.indexArrayForConflation.uint16[3*w+2]=0;const x=f.bloomIndicesOffset+f.bloomIndicesLength;for(let w=f.bloomIndicesOffset;w<x;w++)g.entranceBloom.indexArrayForConflation.uint16[3*w+0]=0,g.entranceBloom.indexArrayForConflation.uint16[3*w+1]=0,g.entranceBloom.indexArrayForConflation.uint16[3*w+2]=0}}const u=f=>{f.indexArray.length!==0&&(f.indexBuffer?f.indexBuffer.updateData(f.indexArrayForConflation):f.indexBuffer=r.createIndexBuffer(f.indexArrayForConflation,!0),f.entranceBloom.indexBuffer?f.entranceBloom.indexBuffer.updateData(f.entranceBloom.indexArrayForConflation):f.entranceBloom.indexBuffer=r.createIndexBuffer(f.entranceBloom.indexArrayForConflation,!0))};u(this.buildingWithoutFacade),u(this.buildingWithFacade),this.indexArrayForConflationUploaded=!0}uploadUpdatedColorBuffer(r){const s=u=>{u.layoutColorBuffer?u.layoutColorBuffer.updateData(u.layoutColorArray):u.layoutColorBuffer=r.createVertexBuffer(u.layoutColorArray,sD.members,!0),u.layoutFacadePaintArray&&(u.layoutFacadePaintBuffer?u.layoutFacadePaintBuffer.updateData(u.layoutFacadePaintArray):u.layoutFacadePaintBuffer=r.createVertexBuffer(u.layoutFacadePaintArray,VH.members,!0)),u.entranceBloom.layoutColorBuffer?u.entranceBloom.layoutColorBuffer.updateData(u.entranceBloom.layoutColorArray):u.entranceBloom.layoutColorBuffer=r.createVertexBuffer(u.entranceBloom.layoutColorArray,sD.members,!0)};s(this.buildingWithoutFacade),s(this.buildingWithFacade),this.colorBufferUploaded=!0}evaluate(r,s){const u=r.paint.get("building-ambient-occlusion-intensity");for(const f of this.footprints){if(4&f.hiddenFlags)continue;const g=s[f.promoteId],v=f.feature;v.properties["building-part"]="roof";const x=r.paint.get("building-color").evaluate(v,g,this.canonical).toPremultipliedRenderColor(this.lut),w=r.paint.get("building-emissive-strength").evaluate(v,g,this.canonical);v.properties["building-part"]="wall";const A=r.paint.get("building-color").evaluate(v,g,this.canonical).toPremultipliedRenderColor(this.lut),R=r.paint.get("building-emissive-strength").evaluate(v,g,this.canonical);v.properties["building-part"]="window";const M=r.paint.get("building-color").evaluate(v,g,this.canonical).toPremultipliedRenderColor(this.lut),O=r.paint.get("building-emissive-strength").evaluate(v,g,this.canonical);v.properties["building-part"]="door";const B=r.paint.get("building-color").evaluate(v,g,this.canonical).toPremultipliedRenderColor(this.lut),N=r.paint.get("building-emissive-strength").evaluate(v,g,this.canonical),G=f.hasFauxFacade?this.buildingWithFacade:this.buildingWithoutFacade;for(const J of f.parts){let re,Q=x;J.part===1?(Q=x,re=w):J.part===0?(Q=A,re=R):J.part===2?(Q=M,re=O):J.part===3&&(Q=B,re=N),re=Ee(re,0,1);for(let le=0;le<J.vertexLength;le++){const ue=J.vertexOffset+le,he=1+(G.layoutAOArray.uint8[ue]/255-1)*u;G.layoutColorArray.emplace(ue,Q.r*he*255<<8|Q.g*he*255,Q.b*he*255<<8|255*re),f.hasFauxFacade&&G.layoutFacadePaintArray.emplace(ue,255*M.r<<8|255*M.g,255*M.b<<8|255*O)}}const H=f.buildingBloom;if(H)for(let J=0;J<H.vertexLength;J++)G.entranceBloom.layoutColorArray.emplace(H.vertexOffset+J,255*B.r<<8|255*B.g,255*B.b<<8|51*N)}}needsEvaluation(){return!this.colorBufferUploaded}updateReplacement(r,s,u){if(s.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=s.updateTime;const f=s.getReplacementRegionsForTile(r.toUnwrapped());if(Yw(this.activeReplacements,f))return;this.activeReplacements=f;for(const v of this.footprints)v.hiddenFlags&=-2;const g=[];for(const v of this.activeReplacements){if(v.order<u)continue;const x=Math.max(1,Math.pow(2,v.footprintTileId.canonical.z-r.canonical.z));for(const w of this.footprints)w.min.x>v.max.x||w.max.x<v.min.x||w.min.y>v.max.y||w.max.y<v.min.y||(g.length=0,ZH(this.footprintsVertices,w.footprintVertexOffset,w.footprintVertexLength,v.footprintTileId.canonical,r.canonical,g),lA(v.footprint,g,this.footprintsIndices.uint16,w.footprintIndexOffset,w.footprintIndexLength,0,-x)&&(w.hiddenFlags|=1))}this.groundEffect.hiddenByLandmarkVertexArray.length===0&&this.groundEffect.hiddenByLandmarkVertexArray.resize(this.groundEffect.vertexArray.length);for(const v of this.footprints)this.groundEffect.updateHiddenByLandmarkRange(v.groundEffectVertexOffset,v.groundEffectVertexLength,v.hiddenFlags!==0);this.indexArrayForConflationUploaded=!1}getFootprint(r){if(r.id!==void 0){const s=this.featureFootprintLookup.get(r.id);return this.footprints[s]}return null}getHeightAtTileCoord(r,s){let u=Number.NEGATIVE_INFINITY,f=!0;const g=4*(r+Bt)*Bt+(s+Bt);if(Object.hasOwn(this.footprintLookup,g)){const x=this.footprintLookup[g];return x?{height:x.height,hidden:x.hiddenFlags!==0}:void 0}const v=new St(r,s);for(const x of this.footprints)r>x.max.x||x.min.x>r||s>x.max.y||x.min.y>s||x.height<=u||XH(v,this.footprintsVertices.float32.subarray(2*x.footprintVertexOffset,2*(x.footprintVertexOffset+x.footprintVertexLength)),this.footprintsIndices.uint16.subarray(x.footprintIndexOffset,x.footprintIndexOffset+x.footprintIndexLength))&&(u=x.height,this.footprintLookup[g]=x,f=x.hiddenFlags!==0);if(u!==Number.NEGATIVE_INFINITY)return{height:u,hidden:f};this.footprintLookup[g]=void 0}}function XH(l,r,s){for(let u=0;u<s.length;u+=3){const f=s[u],g=s[u+1],v=s[u+2],x=r[2*f+0],w=r[2*f+1],A=r[2*g+0],R=r[2*g+1],M=r[2*v+0],O=r[2*v+1],B=(x-M)*(l.y-O)-(w-O)*(l.x-M),N=(A-x)*(l.y-w)-(R-w)*(l.x-x);if(B<0!=N<0&&B!==0&&N!==0)continue;const G=(M-A)*(l.y-R)-(O-R)*(l.x-A);if(G===0||G<0==B+N<=0)return!0}return!1}function ZH(l,r,s,u,f,g){const v=Math.pow(2,u.z-f.z);for(let x=0;x<s;x++){let w=l.float32[2*(x+r)+0],A=l.float32[2*(x+r)+1];w=(w+f.x*Bt)*v-u.x*Bt,A=(A+f.y*Bt)*v-u.y*Bt,g.push(new St(w,A))}}async function uD(){return(function(){if(!Pr(self)||Sl!=null||lD!=null)return null;if(s_!=null)return s_;const l=fetch(hd());return s_=(function(r){let s,u,f,g,v;function x(){s=new Uint8Array(v.buffer),u=new Int16Array(v.buffer),f=new Int32Array(v.buffer),g=new Float32Array(v.buffer)}function w(){throw new Error("Unexpected BuildingGen error.")}const A=()=>{},R={a:{a:w,f:function(M){const O=s.length,B=Math.max(M>>>0,Math.ceil(1.2*O)),N=Math.ceil((B-O)/65536);try{return v.grow(N),x(),!0}catch{return!1}},g:w,b:A,c:A,d:A,e:A}};return(WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(r,R):r.then(M=>M.arrayBuffer()).then(M=>WebAssembly.instantiate(M,R))).then(M=>{const O=M.instance.exports;return(0,O.g)(),v=O.f,x(),new HH({setStyle:O.h,setAOOptions:O.i,setMetricOptions:O.j,setStructuralOptions:O.k,setFacadeOptions:O.l,setFauxFacadeOptions:O.m,setFacadeClassifierOptions:O.n,addFeature:O.o,addFacade:O.p,generateMesh:O.q,getLastError:O.r,getOuterRingLength:O.s,getMeshCount:O.t,getPositionsPtr:O.u,getPositionsLength:O.v,getNormalsPtr:O.w,getNormalsLength:O.x,getAOPtr:O.y,getAOLength:O.z,getUVPtr:O.A,getUVLength:O.B,getFauxFacadePtr:O.C,getFauxFacadeLength:O.D,getIndicesPtr:O.E,getIndicesLength:O.F,getBuildingPart:O.G,getRingCount:O.H,getRingPtr:O.I,getRingLength:O.J,malloc:O.K,free:O.L,heapU8:s,heap16:u,heap32:f,heapF32:g})})})(l).then(r=>{s_=null,Sl=r}).catch(r=>{On("Could not load building-gen"),s_=null,lD=r}),s_})()}Kt(cD,"BuildingBucket",{omit:["layers"]}),Kt(IA,"BuildingGeometry"),Kt(AA,"BuildingBloomGeometry");const YH=Jn([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_linesofar",components:1,type:"Float32"}],4),KH=Jn([{name:"a_z_offset_width",components:3,type:"Float32"}],4),JH=Jn([{name:"a_elevation_id_col",components:3,type:"Float32"}
24],4),QH=Jn([{name:"a_elevation_ground_scale",components:1,type:"Float32"}],4),{members:eW}=YH,tW=Jn([{name:"a_packed",components:3,type:"Float32"}]),{members:nW}=tW,rW=Jn([{name:"a_pattern_data",components:3,type:"Float32"}]),{members:iW}=rW;class dD{constructor(r,s){this.width=r,this.height=s,this.nextRow=0,this.image=new cs({width:r,height:s}),this.positions={},this.uploaded=!1}getDash(r,s){const u=this.getKey(r,s);return this.positions[u]}trim(){const r=this.width,s=this.height=qt(this.nextRow);this.image.resize({width:r,height:s})}getKey(r,s){return r.join(",")+s}getDashRanges(r,s,u){const f=[];let g=r.length%2==1?-r.at(-1)*u:0,v=r[0]*u,x=!0;f.push({left:g,right:v,isDash:x,zeroLength:r[0]===0});let w=r[0];for(let A=1;A<r.length;A++){x=!x;const R=r[A];g=w*u,w+=R,v=w*u,f.push({left:g,right:v,isDash:x,zeroLength:R===0})}return f}addRoundDash(r,s,u){const f=s/2;for(let g=-u;g<=u;g++){const v=this.width*(this.nextRow+u+g);let x=0,w=r[x];for(let A=0;A<this.width;A++){A/w.right>1&&(w=r[++x]);const R=Math.abs(A-w.left),M=Math.abs(A-w.right),O=Math.min(R,M);let B;const N=g/u*(f+1);if(w.isDash){const G=f-Math.abs(N);B=Math.sqrt(O*O+G*G)}else B=f-Math.sqrt(O*O+N*N);this.image.data[v+A]=Math.max(0,Math.min(255,B+128))}}}addRegularDash(r,s){for(let w=r.length-1;w>=0;--w){const A=r[w],R=r[w+1];A.zeroLength?r.splice(w,1):R&&R.isDash===A.isDash&&(R.left=A.left,r.splice(w,1))}const u=r[0],f=r.at(-1);u.isDash===f.isDash&&(u.left=f.left-this.width,f.right=u.right+this.width);const g=this.width*this.nextRow;let v=0,x=r[v];for(let w=0;w<this.width;w++){w/x.right>1&&(x=r[++v]);const A=Math.abs(w-x.left),R=Math.abs(w-x.right),M=Math.min(A,R);this.image.data[g+w]=Math.max(0,Math.min(255,(x.isDash?M:-M)+s+128))}}addDash(r,s){const u=this.getKey(r,s);if(this.positions[u])return this.positions[u];const f=s==="round",g=f?7:0,v=2*g+1;if(this.nextRow+v>this.height)return On("LineAtlas out of space"),null;r.length===0&&r.push(1);let x=0;for(let M=0;M<r.length;M++)r[M]<0&&(On("Negative value is found in line dasharray, replacing values with 0"),r[M]=0),x+=r[M];if(x!==0){const M=this.width/x,O=this.getDashRanges(r,this.width,M);f?this.addRoundDash(O,M,g):this.addRegularDash(O,s==="square"?.5*M:0)}const w=this.nextRow+g;this.nextRow+=v;const A=Math.floor(x),R={tl:[w,g],br:[A,Math.round(65535*(x-A))]};return this.positions[u]=R,R}}Kt(dD,"LineAtlas");const oW=Ou.types,sW=Math.cos(Math.PI/180*37.5),aW=Math.cos(Math.PI/180*5);class gS{constructor(r){this.evaluationGlobals={zoom:0,lineProgress:void 0},this.elevationType="none",this.isSeaLevelReference=!1,this.showElevationIdDebug=!1,this.zoom=r.zoom,this.evaluationGlobals.zoom=this.zoom,this.overscaling=r.overscaling,this.pixelRatio=r.pixelRatio,this.layers=r.layers,this.layerIds=this.layers.map(s=>s.fqid),this.index=r.index,this.projection=r.projection,this.hasPattern=!1,this.hasCrossSlope=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(s=>{this.gradients[s.id]={}}),this.layoutVertexArray=new N0,this.layoutVertexArray2=new Ta,this.patternVertexArray=new Ta,this.indexArray=new _i,this.programConfigurations=new Ea(r.layers,{zoom:r.zoom,lut:r.lut}),this.segments=new Wr,this.maxLineLength=0,this.zOffsetVertexArray=new Ta,this.elevationIdColVertexArray=new Ta,this.elevationGroundScaleVertexArray=new Zo,this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id),this.tessellationStep=r.tessellationStep?r.tessellationStep:128,this.worldview=r.worldview,this.hasAppearances=null}updateFootprints(r,s){}updateAppearances(r,s,u,f){return{hasLayoutChanges:!1,hasUboChanges:!1}}populate(r,s,u,f){this.showElevationIdDebug=s.showElevationIdDebug,this.hasPattern=Y2("line",this.layers,this.pixelRatio,s);const g=this.layers[0].layout.get("line-sort-key");this.tileToMeter=Aa(u);const v=this.layers[0].layout.get("line-elevation-reference");if(v==="hd-road-markup")this.elevationType="road";else{const O=this.layers[0].layout.get("line-z-offset"),B=O.isConstant()&&!O.constantOr(0);this.elevationType=v!=="sea"&&v!=="ground"&&B?"none":"offset",this.elevationType==="offset"&&v==="none"&&On(`line-elevation-reference: ground is used for the layer ${this.layerIds[0]} because non-zero line-z-offset value was found.`),this.isSeaLevelReference=v==="sea"}const x=this.layers[0].layout.get("line-cross-slope");this.hasCrossSlope=this.elevationType==="offset"&&x!==void 0;const w=[];for(const{feature:O,id:B,index:N,sourceLayerIndex:G}of r){const H=this.layers[0]._featureFilter.needGeometry,J=Ya(O,H);if(!this.layers[0]._featureFilter.filter(new Tr(this.zoom,{worldview:this.worldview,activeFloors:s.activeFloors}),J,u))continue;const re=g?g.evaluate(J,{},u):void 0,Q={id:B,properties:O.properties,type:O.type,sourceLayerIndex:G,index:N,geometry:H?J.geometry:sa(O,u,f),patterns:{},sortKey:re};
24w.push(Q)}g&&w.sort((O,B)=>O.sortKey-B.sortKey);const{lineAtlas:A,featureIndex:R}=s,M=this.addConstantDashes(A);for(const O of w){const{geometry:B,index:N,sourceLayerIndex:G}=O;if(M&&this.addFeatureDashes(O,A),this.hasPattern){const H=K2("line",this.layers,O,this.zoom,this.pixelRatio,s);this.patternFeatures.push(H)}else this.addFeature(O,B,N,u,A.positions,s.availableImages,s.brightness,s.elevationFeatures);R.insert(r[N].feature,B,N,G,this.index)}}addConstantDashes(r){let s=!1;for(const u of this.layers){const f=u.paint.get("line-dasharray").value,g=u.layout.get("line-cap").value;if(f.kind!=="constant"||g.kind!=="constant")s=!0;else{const v=g.value,x=f.value;if(!x)continue;r.addDash(x,v)}}return s}addFeatureDashes(r,s){const u=this.zoom;for(const f of this.layers){const g=f.paint.get("line-dasharray").value,v=f.layout.get("line-cap").value;if(g.kind==="constant"&&v.kind==="constant")continue;let x,w;if(g.kind==="constant"){if(x=g.value,!x)continue}else x=g.evaluate({zoom:u},r);w=v.kind==="constant"?v.value:v.evaluate({zoom:u},r),s.addDash(x,w),r.patterns[f.id]=[s.getKey(x,w)]}}update(r,s,u,f,g,v,x,w,A){this.programConfigurations.updatePaintArrays(r,s,g,u,f,v,x,A)}updateExpressions(r){this.programConfigurations.updateExpressions(r)}addFeatures(r,s,u,f,g,v){for(const x of this.patternFeatures)this.addFeature(x,x.geometry,x.index,s,u,f,v,r.elevationFeatures)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(r){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=r.createVertexBuffer(this.layoutVertexArray2,nW)),this.patternVertexArray.length!==0&&(this.patternVertexBuffer=r.createVertexBuffer(this.patternVertexArray,iW)),!this.zOffsetVertexBuffer&&this.zOffsetVertexArray.length>0&&(this.zOffsetVertexBuffer=r.createVertexBuffer(this.zOffsetVertexArray,KH.members,!0)),!this.elevationIdColVertexBuffer&&this.elevationIdColVertexArray.length>0&&(this.elevationIdColVertexBuffer=r.createVertexBuffer(this.elevationIdColVertexArray,JH.members,!0)),!this.elevationGroundScaleVertexBuffer&&this.elevationGroundScaleVertexArray.length>0&&(this.elevationGroundScaleVertexBuffer=r.createVertexBuffer(this.elevationGroundScaleVertexArray,QH.members,!0)),this.layoutVertexBuffer=r.createVertexBuffer(this.layoutVertexArray,eW),this.indexBuffer=r.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(r),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy(),this.elevationIdColVertexBuffer&&this.elevationIdColVertexBuffer.destroy(),this.elevationGroundScaleVertexBuffer&&this.elevationGroundScaleVertexBuffer.destroy(),this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(r,s){let u,f;if(s&&s>0?(u=`mapbox_clip_start_${s}`,f=`mapbox_clip_end_${s}`):(u="mapbox_clip_start",f="mapbox_clip_end"),r.properties&&Object.hasOwn(r.properties,u)&&Object.hasOwn(r.properties,f))return{start:+r.properties[u],end:+r.properties[f]}}addFeature(r,s,u,f,g,v,x,w){const A=this.layers[0].layout,R=A.get("line-join").evaluate(r,{}),M=A.get("line-cap").evaluate(r,{}),O=A.get("line-miter-limit"),B=A.get("line-round-limit");this.lineClips=this.lineFeatureClips(r),this.lineFeature=r;const N=!(!r.properties||!Object.hasOwn(r.properties,"mapbox_line_metrics"))&&r.properties.mapbox_line_metrics;this.zOffsetValue=A.get("line-z-offset").value;const G=this.layers[0].paint.get("line-width").value;if(G.kind!=="constant"&&G.isLineProgressConstant===!1&&(this.variableWidthValue=G),this.isSeaLevelReference){const H=A.get("line-elevation-ground-scale").value;H.kind==="constant"&&H.value===0||(this.elevationGroundScaleValue=H)}if(this.elevationType==="road"){const H=this.layoutVertexArray.length;if(!this.addElevatedRoadFeature(r,s,f,w,R,M,O,B)){const[J,re]=this.clipRuntimeLinesToTile(s,1);for(let Q=0;Q<J.length;Q++){const le=J[Q],ue=re[Q],he={progress:{min:ue.progress.min,max:ue.progress.max},nextDir:this.computeSegNextDir(ue,le),prevDir:this.computeSegPrevDir(ue,le)};this.addLine(le,r,f,R,M,O,B,he,N&&ue.parentIndex>0?ue.parentIndex:null)}this.fillNonElevatedRoadSegment(H)}}else for(let H=0;H<s.length;H++)this.addLine(s[H],r,f,R,M,O,B,void 0,N&&H>0?H:null);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,r,u,g,v,f,x,void 0,this.worldview)}computeSegNextDir(r,s){return r.nextPoint.sub(s.at(-2)).unit()}computeSegPrevDir(r,s){return s[1].sub(r.prevPoint).unit()}clipLinesToTile(r,s){return oS(r,-s,-s,Bt+s,Bt+s)}clipRuntimeLinesToTile(r,s){const u=[];return[oS(r,-s,-s,Bt+s,Bt+s,u),u]}addElevatedRoadFeature(r,s,u,f,g,v,x,w){const A=[],R=p.getElevationFeature(r,f);if(R){const M=this.clipLinesToTile(s,1),O=this.prepareElevatedLines(M,R,u);for(const B of O)A.push({geometry:B,elevation:R,elevationTileID:u,segment:{progress:{min:0,max:1},nextDir:void 0,prevDir:void 0}})}if(A.length===0)return!1;for(const M of A){const O=this.layoutVertexArray.length;this.addLine(M.geometry,r,u,g,v,x,w);const B=new o(u,M.elevationTileID);if(M.elevation){const N=this.showElevationIdDebug?d(M.elevation.id):null;for(let G=O;G<this.layoutVertexArray.length;G++){const H=new St(this.layoutVertexArray.int16[6*G]>>1,this.layoutVertexArray.int16[6*G+1]>>1),J=B.pointElevation(H,M.elevation,.05);this.updateHeightRange(J),this.zOffsetVertexArray.emplaceBack(J,0,0),N?this.elevationIdColVertexArray.emplaceBack(N[0],N[1],N[2]):this.showElevationIdDebug&&this.elevationIdColVertexArray.emplaceBack(0,0,0)}}else this.fillNonElevatedRoadSegment(O)}return!0}prepareElevatedLines(r,s,u){if(s.constantHeight!=null)return r;const f=[],g=1/Aa(u);for(const v of r)gH(v,new cv(s,g),0,f);return f}fillNonElevatedRoadSegment(r){for(let s=r;s<this.layoutVertexArray.length;s++)this.zOffsetVertexArray.emplaceBack(0,0,0),this.showElevationIdDebug&&this.elevationIdColVertexArray.emplaceBack(0,0,0)}updateHeightRange(r){this.heightRange?(this.heightRange.min=Math.min(this.heightRange.min,r),this.heightRange.max=Math.max(this.heightRange.max,r)):this.heightRange={min:r,max:r}}addLine(r,s,u,f,g,v,x,w,A){this.distance=0,this.prevDistance=0,this.scaledDistance=0,this.totalDistance=0,this.totalFeatureLength=0,this.lineS
24oFar=0,this.currentVertex=void 0,this.lineClips=A?this.lineFeatureClips(s,A):this.lineClips;const R=f==="none";this.patternJoinNone=this.hasPattern&&R,this.currentLineJoinType=f,this.segmentStart=0,this.segmentStartf32=0,this.segmentPoints=[];const M=w&&w.progress.min>0,O=w&&w.progress.max<1;if(this.lineClips){let xe={min:this.lineClips.start,max:this.lineClips.end},_e=1;if(w){const He=this.lineClips.end-this.lineClips.start;xe=(function(Qe,it,nt){return{min:hl(Qe.min,it,nt),max:hl(Qe.max,it,nt)}})(w.progress,{min:0,max:1},xe),He>0&&(_e=(xe.max-xe.min)/He)}const we=+s.properties.mapbox_clip_feature_len,je=+s.properties.mapbox_clip_seg_len;if(Number.isNaN(we)||Number.isNaN(je)){for(let Qe=0;Qe<r.length-1;Qe++)this.totalDistance+=r[Qe].dist(r[Qe+1]);const He=this.totalDistance/(xe.max-xe.min);this.totalFeatureLength=Number.isFinite(He)?He:0,this.lineClips.start=xe.min,this.lineClips.end=xe.max,this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}else this.totalFeatureLength=we,this.distance=je*_e,this.lineClips.start=xe.min,this.lineClips.end=xe.max,this.maxLineLength=Math.max(this.maxLineLength,this.distance);this.lineClipsArray.push(this.lineClips),this.updateScaledDistance()}const B=oW[s.type]==="Polygon";let N=r.length;for(;N>=2&&r[N-1].equals(r[N-2]);)N--;let G=0;for(;G<N-1&&r[G].equals(r[G+1]);)G++;if(N<(B?3:2))return;f==="bevel"&&(v=1.05);const H=this.segments.prepareSegment(10*N,this.layoutVertexArray,this.indexArray);let J,re,Q,le,ue,he,Te,me;w&&w.prevDir&&(he=w.prevDir.perp()),w&&w.nextDir&&(Te=w.nextDir.perp()),this.e1=this.e2=-1,B&&(J=r[N-2],ue=r[G].sub(J)._unit()._perp());for(let xe=G;xe<N;xe++){if(Q=xe===N-1?B?r[G+1]:void 0:r[xe+1],Q&&r[xe].equals(Q))continue;ue&&(le=ue),J&&(re=J),J=r[xe],me=this.evaluateLineProgressFeatures(re?re.dist(J):0),ue=Q?Q.sub(J)._unit()._perp():le,le=le||ue;const _e=re&&Q;let we=_e?f:B||R?"butt":g;const je=le.x*ue.x+le.y*ue.y;if(R){const ot=function(ft){if(ft.patternJoinNone){const _t=ft.segmentPoints.length/2,Ft=ft.lineSoFar-ft.segmentStart;for(let ut=0;ut<_t;++ut){const At=ft.segmentPoints[2*ut+1],It=Math.round(ft.segmentPoints[2*ut])+.5+.25*At;ft.patternVertexArray.emplaceBack(It,Ft,ft.segmentStart),ft.patternVertexArray.emplaceBack(It,Ft,ft.segmentStart)}ft.segmentPoints.length=0}ft.e1=ft.e2=-1};if(_e&&je<aW){this.updateDistance(re,J),this.addCurrentVertex(J,le,1,1,H,me),ot(this),this.addCurrentVertex(J,ue,-1,-1,H,me);continue}if(re){if(!Q){this.updateDistance(re,J),this.addCurrentVertex(J,le,1,1,H,me),ot(this);continue}we="miter"}}let He=le.add(ue);He.x===0&&He.y===0||He._unit();const Qe=He.x*ue.x+He.y*ue.y,it=Qe!==0?1/Qe:1/0,nt=2*Math.sqrt(2-2*Qe),bt=Qe<sW&&re&&Q,Ze=le.x*ue.y-le.y*ue.x>0,et=this.overscaling<=16?122880/(512*this.overscaling):0;if(_e&&we==="round"){if(it<x)we="miter";else if(it<=2){const ot=PA(J,-10,8202);we=this.elevationType==="offset"&&(ot||this.hasCrossSlope)?"miter":"fakeround"}}if(we==="miter"&&it>v&&(we="bevel"),we==="bevel"&&(it>2&&(we="flipbevel"),it<v&&(we="miter")),re&&!(we==="miter"&&bt)&&this.updateDistance(re,J),we==="miter")if(bt){const ot=J.dist(re);if(ot>2*et){const _t=J.sub(J.sub(re)._mult(et/ot)._round());this.updateDistance(re,_t),this.addCurrentVertex(_t,le,0,0,H,me),re=_t}this.updateDistance(re,J),He._mult(it),this.addCurrentVertex(J,He,0,0,H,me);const ft=J.dist(Q);if(ft>2*et){const _t=J.add(Q.sub(J)._mult(et/ft)._round());this.updateDistance(J,_t),this.addCurrentVertex(_t,ue,0,0,H,me),J=_t}}else He._mult(it),this.addCurrentVertex(J,He,0,0,H,me);else if(we==="flipbevel"){if(it>100)He=ue.mult(-1);else{const ot=it*le.add(ue).mag()/le.sub(ue).mag();He._perp()._mult(ot*(Ze?-1:1))}this.addCurrentVertex(J,He,0,0,H,me),this.addCurrentVertex(J,He.mult(-1),0,0,H,me)}else if(we==="bevel"||we==="fakeround"){const ot=J.dist(re);let ft=1;if(this.elevationType==="offset"&&we==="bevel"&&this.currentLineJoinType!=="round"&&!this.patternJoinNone&&me!=null&&re&&Q){const Xt=4*et;ot<Xt&&(ft=Math.max(0,ot/Xt))}me!=null&&re&&this.addCurrentVertex(J,Te||le,-ft,-ft,H,me);const _t=ot<=2*et&&we!=="bevel",Ft=He.mult(Ze?1:-1);Ft._mult(it);const ut=ue.mult(Ze?-1:1),At=le.mult(Ze?-1:1),It=this.evaluateLineProgressFeatures(this.distance);if(me==null&&(this.addHalfVertex(J,Ft.x,Ft.y,!1,!Ze,0,H,It),_t||this.addHalfVertex(J,Ft.x+2*At.x,Ft.y+2*At.y,!1,Ze,0,H,It)),we==="fakeround"){const Xt=Math.round(180*nt/Math.PI/20);this.addHalfVertex(J,At.x,At.y,!1,Ze,0,H,It);for(let Yt=0;Yt<Xt;Yt++){let gn=Yt/Xt;if(gn!==.5){const En=gn-.5;gn+=gn*En*(gn-1)*((1.0904+je*(je*(3.55645-1.43519*je)-3.2452))*En*En+(.848013+je*(.215638*je-1.06021)))}const on=ut.sub(At)._mult(gn)._add(At)._unit();this.addHalfVertex(J,on.x,on.y,!1,Ze,0,H,It)}this.addHalfVertex(J,ut.x,ut.y,!1,Ze,0,H,It)}_t||me!=null||this.addHalfVertex(J,Ft.x+2*ut.x,Ft.y+2*ut.y,!1,Ze,0,H,It),me!=null&&Q&&this.addCurrentVertex(J,he||ue,ft,ft,H,me)}else if(we==="butt")this.addCurrentVertex(J,He,0,0,H,me);else if(we==="square"){if(!re){const ot=M?0:-1;this.addCurrentVertex(J,He,ot,ot,H,me)}if(this.addCurrentVertex(J,He,0,0,H,me),re){const ot=O?0:1;this.addCurrentVertex(J,He,ot,ot,H,me)}}else if(we==="round"){if(re){const ot=!_e&&Te?Te:le;this.addCurrentVertex(J,ot,0,0,H,me),!_e&&O||this.addCurrentVertex(J,ot,1,1,H,me,!0)}if(Q){const ot=!_e&&he?he:ue;!_e&&M||this.addCurrentVertex(J,ot,-1,-1,H,me,!0),this.addCurrentVertex(J,ot,0,0,H,me)}}}}addVerticesTo(r,s,u,f,g,v,x,w,A,R){const M=(s.w-r.w)/this.tessellationStep|0;let O=0;const B=this.scaledDistance;if(M>
241){this.lineSoFar=r.w;const G=(s.x-r.x)/M,H=(s.y-r.y)/M,J=(s.z-r.z)/M,re=(s.w-r.w)/M,Q=s.x-r.x,le=s.y-r.y,ue=Math.sqrt(Q*Q+le*le);if(ue===0)return;const he=-le/ue,Te=Q/ue,me=he,xe=Te,_e=-he,we=-Te;for(let je=1;je<M;++je){r.x+=G,r.y+=H,r.z+=J,this.lineSoFar+=re,O+=re;const He=this.evaluateLineProgressFeatures(this.prevDistance+O);this.scaledDistance=(this.prevDistance+O)/this.totalDistance,this.addHalfVertex(r,me,xe,R,!1,0,A,He),this.addHalfVertex(r,_e,we,R,!0,0,A,He)}}this.lineSoFar=s.w,this.scaledDistance=B;const N=this.evaluateLineProgressFeatures(this.distance);this.addHalfVertex(s,u,f,R,!1,x,A,N),this.addHalfVertex(s,g,v,R,!0,-w,A,N)}evaluateLineProgressFeatures(r){if(!this.variableWidthValue&&this.elevationType!=="offset")return null;this.evaluationGlobals.lineProgress=0,this.lineClips?this.evaluationGlobals.lineProgress=Math.min(1,(this.totalFeatureLength*this.lineClips.start+r)/this.totalFeatureLength):On(`line-progress evaluation for ${this.layerIds[0]} requires enabling 'lineMetrics' for the source.`);let s=0;this.variableWidthValue&&this.variableWidthValue.kind!=="constant"&&(s=this.variableWidthValue.evaluate(this.evaluationGlobals,this.lineFeature)||0);const u=this.evaluateElevationGroundScale();return this.elevationType!=="offset"?{zOffset:0,variableWidth:s,elevationGroundScale:u}:this.zOffsetValue.kind==="constant"?{zOffset:this.zOffsetValue.value,variableWidth:s,elevationGroundScale:u}:{zOffset:this.zOffsetValue.evaluate(this.evaluationGlobals,this.lineFeature)||0,variableWidth:s,elevationGroundScale:u}}evaluateElevationGroundScale(){return this.elevationGroundScaleValue?this.elevationGroundScaleValue.kind==="constant"?this.elevationGroundScaleValue.value:this.elevationGroundScaleValue.evaluate(this.evaluationGlobals,this.lineFeature)||0:0}addCurrentVertex(r,s,u,f,g,v,x=!1){const w=s.x+s.y*u,A=s.y-s.x*u,R=s.y*f-s.x,M=-s.y-s.x*f;if(v!=null){const O=this.elevationType==="offset",B=this.elevationType==="offset"?2:10,N=-B,G=Bt+B,H=v.zOffset,J=new AO(r.x,r.y,H,this.lineSoFar),re=!!O&&PA(r,N,G),Q=this.lineSoFar,le=this.distance;if(this.currentVertex)if(re){const ue=this.currentVertexIsOutside,he=this.currentVertex,Te=new AO(r.x,r.y,H,this.lineSoFar);if(PO(he,Te,N,G),!PA(Te,N,G)){if(ue){this.e1=this.e2=-1,this.distance-=he.dist(J),this.lineSoFar=he.w;const me=this.evaluateLineProgressFeatures(he.w-this.totalFeatureLength*(this.lineClips?this.lineClips.start:0));this.addHalfVertex(he,w,A,x,!1,u,g,me),this.addHalfVertex(he,R,M,x,!0,-f,g,me),this.prevDistance=this.distance}this.distance=this.prevDistance+he.dist(Te),this.scaledDistance=this.distance/this.totalDistance,this.addVerticesTo(he,Te,w,A,R,M,u,f,g,x),this.distance=le,this.scaledDistance=this.distance/this.totalDistance}}else{const ue=this.currentVertex;if(this.currentVertexIsOutside){PO(ue,J,N,G),this.e1=this.e2=-1,this.distance-=ue.dist(J),this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=ue.w;const he=this.evaluateLineProgressFeatures(ue.w-this.totalFeatureLength*(this.lineClips?this.lineClips.start:0));this.addHalfVertex(ue,w,A,x,!1,u,g,he),this.addHalfVertex(ue,R,M,x,!0,-f,g,he),this.prevDistance=this.distance,this.distance=le,this.scaledDistance=this.distance/this.totalDistance}this.addVerticesTo(ue,J,w,A,R,M,u,f,g,x)}else re||(this.addHalfVertex(r,w,A,x,!1,u,g,v),this.addHalfVertex(r,R,M,x,!0,-f,g,v));this.currentVertex=J,this.currentVertexIsOutside=re,this.lineSoFar=Q}else this.addHalfVertex(r,w,A,x,!1,u,g,v),this.addHalfVertex(r,R,M,x,!0,-f,g,v)}addHalfVertex({x:r,y:s},u,f,g,v,x,w,A){if(this.patternJoinNone&&(this.segmentPoints.length===0&&(this.segmentStart=this.lineSoFar,this.segmentStartf32=Math.fround(this.lineSoFar)),v||this.segmentPoints.push(this.lineSoFar-this.segmentStart,x)),this.layoutVertexArray.emplaceBack((r<<1)+(g?1:0),(s<<1)+(v?1:0),Math.round(63*u)+128,Math.round(63*f)+128,1+(x===0?0:x<0?-1:1),0,this.lineSoFar-this.segmentStartf32),this.lineClips){const M=Sn(this.lineClips.start,this.lineClips.end,this.scaledDistance);this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,M)}const R=w.vertexLength++;if(this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,R),w.primitiveLength++),v?this.e2=R:this.e1=R,A!=null&&(this.zOffsetVertexArray.emplaceBack(A.zOffset,A.variableWidth,A.variableWidth),this.showElevationIdDebug&&this.elevationIdColVertexArray.emplaceBack(0,0,0)),this.elevationGroundScaleValue){const M=A?A.elevationGroundScale:this.evaluateElevationGroundScale();this.elevationGroundScaleVertexArray.emplaceBack(M)}}updateScaledDistance(){this.lineClips?(this.scaledDistance=this.distance/this.totalDistance,this.lineS
24oFar=this.totalFeatureLength*this.lineClips.start+this.distance):this.lineSoFar=this.distance}updateDistance(r,s){this.prevDistance=this.distance,this.distance+=r.dist(s),this.updateScaledDistance()}}function PA(l,r,s){return l.x<r||l.x>s||l.y<r||l.y>s}let hD,fD;function pD(l,r,s){return r*(Bt/(l.tileSize*Math.pow(2,s-l.tileID.overscaledZ)))}Kt(gS,"LineBucket",{omit:["layers","patternFeatures","currentVertex","currentVertexIsOutside"]});const mD=(l,r,s)=>(1-s)*l+s*r;function gD(l,r){return 1/pD(l,1,r.tileZoom)}function _D(l,r,s,u){return l.translatePosMatrix(u||r.tileID.projMatrix,r,s.paint.get("line-translate"),s.paint.get("line-translate-anchor"))}const yD=l=>{const r=[];vD(l)&&r.push("RENDER_LINE_DASH"),l.paint.get("line-gradient")&&r.push("RENDER_LINE_GRADIENT"),l.paint.get("line-blend-mode")==="multiply"&&r.push("LINE_BLEND_MULTIPLY"),l.paint.get("line-blend-mode")==="additive"&&r.push("LINE_BLEND_ADDITIVE");const s=l.paint.get("line-trim-offset");s[0]===0&&s[1]===0||r.push("RENDER_LINE_TRIM_OFFSET"),l.paint.get("line-border-width").constantOr(1)!==0&&r.push("RENDER_LINE_BORDER");const u=l.layout.get("line-join").constantOr("miter")==="none",f=!!l.paint.get("line-pattern").constantOr(1);return u&&f&&r.push("LINE_JOIN_NONE"),r};function vD(l){const r=l.paint.get("line-dasharray").value;return r.kind!=="constant"||r.value}let RA;const bD=()=>RA||(RA={layout:hD||(hD=new fi({"line-cap":new Dt(ze.layout_line["line-cap"]),"line-join":new Dt(ze.layout_line["line-join"]),"line-miter-limit":new Pt(ze.layout_line["line-miter-limit"]),"line-round-limit":new Pt(ze.layout_line["line-round-limit"]),"line-sort-key":new Dt(ze.layout_line["line-sort-key"]),"line-z-offset":new Dt(ze.layout_line["line-z-offset"]),"line-elevation-reference":new Pt(ze.layout_line["line-elevation-reference"]),"line-cross-slope":new Pt(ze.layout_line["line-cross-slope"]),visibility:new Pt(ze.layout_line.visibility),"line-width-unit":new Pt(ze.layout_line["line-width-unit"]),"line-elevation-ground-scale":new Dt(ze.layout_line["line-elevation-ground-scale"])})),paint:fD||(fD=new fi({"line-opacity":new Dt(ze.paint_line["line-opacity"]),"line-color":new Dt(ze.paint_line["line-color"]),"line-translate":new Pt(ze.paint_line["line-translate"]),"line-translate-anchor":new Pt(ze.paint_line["line-translate-anchor"]),"line-width":new Dt(ze.paint_line["line-width"]),"line-gap-width":new Dt(ze.paint_line["line-gap-width"]),"line-offset":new Dt(ze.paint_line["line-offset"]),"line-blur":new Dt(ze.paint_line["line-blur"]),"line-dasharray":new Dt(ze.paint_line["line-dasharray"]),"line-pattern":new Dt(ze.paint_line["line-pattern"]),"line-pattern-cross-fade":new Pt(ze.paint_line["line-pattern-cross-fade"]),"line-gradient":new Iu(ze.paint_line["line-gradient"]),"line-trim-offset":new Pt(ze.paint_line["line-trim-offset"]),"line-trim-fade-range":new Pt(ze.paint_line["line-trim-fade-range"]),"line-trim-color":new Pt(ze.paint_line["line-trim-color"]),"line-emissive-strength":new Dt(ze.paint_line["line-emissive-strength"]),"line-border-width":new Dt(ze.paint_line["line-border-width"]),"line-border-color":new Dt(ze.paint_line["line-border-color"]),"line-occlusion-opacity":new Pt(ze.paint_line["line-occlusion-opacity"]),"line-blend-mode":new Pt(ze.paint_line["line-blend-mode"]),"line-blend-additive-clamp":new Pt(ze.paint_line["line-blend-additive-clamp"]),"line-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"}),"line-gradient-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"}),"line-trim-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"}),"line-border-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"})}))},RA);class lW extends Dt{possiblyEvaluate(r,s){return s=new Tr(Math.floor(s.zoom),{now:s.now,fadeDuration:s.fadeDuration,transition:s.transition,worldview:s.worldview}),super.possiblyEvaluate(r,s)}evaluate(r,s,u,f){return s=Object.assign({},s,{zoom:Math.floor(s.zoom)}),super.evaluate(r,s,u,f)}}let Cv;function xD(l,r){return r>0?r+2*l:l}const cW=Jn([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),uW=Jn([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),dW=Jn([{name:"a_projected_pos",components:4,type:"Float32"}],4);Jn([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const hW=Jn([{name:"a_auto_z_offset",components:1,type:"Float32"}],4),fW=Jn([{name:"a_feature_index",components:1,type:"Float32"}],4),pW=Jn([{name:"a_x_axis",components:3,type:"Float32"},{name:"a_y_axis",components:3,type:"Float32"}]),mW=Jn([{name:"a_texb",components:2,type:"Uint16"}]),gW=Jn([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_elevation_from_sea",components:2,type:"Float32"}]),_W=Jn([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"},{name:"a_auto_z_offset",components:1,type:"Float32"}]);Jn([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);
24const wD=Jn([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),yW=Jn([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);Jn([{name:"triangle",components:3,type:"Uint16"}]),Jn([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{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"},{type:"Uint8",name:"flipState"}]),Jn([{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{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",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Float32",name:"zOffset"},{type:"Uint8",name:"hasIconTextFit"},{type:"Uint16",name:"elevationFeatureIndex"}]),Jn([{type:"Float32",name:"offsetX"}]),Jn([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);const tm=class If{constructor(r=null,s=0,u=4096){if(this.batchIndex=s,this.headerBuffer=null,this.propertiesBuffer=null,this.blockIndicesBuffer=null,this.context=r||null,this.propsDwords=u,this.totalBytes=4*this.propsDwords,this.headerData=new Uint32Array(If.HEADER_DWORDS),this.propertiesData=new Float32Array(this.propsDwords),!If._blockIndicesTemplate){If._blockIndicesTemplate=new Uint32Array(this.propsDwords);for(let f=0;f<this.propsDwords;f++)If._blockIndicesTemplate[f]=f}this.blockIndicesData=new Uint32Array(If._blockIndicesTemplate),r&&this._initBuffers(r)}_initBuffers(r){const s=r.gl;if(this.totalBytes>r.maxUniformBlockSize)throw new Error(`UBO size ${this.totalBytes} exceeds device limit ${r.maxUniformBlockSize}`);if(this.headerBuffer=s.createBuffer(),!this.headerBuffer)throw new Error("Failed to create header UBO buffer");if(s.bindBuffer(s.UNIFORM_BUFFER,this.headerBuffer),s.bufferData(s.UNIFORM_BUFFER,If.HEADER_BYTES,s.DYNAMIC_DRAW),this.propertiesBuffer=s.createBuffer(),!this.propertiesBuffer)throw new Error("Failed to create properties UBO buffer");if(s.bindBuffer(s.UNIFORM_BUFFER,this.propertiesBuffer),s.bufferData(s.UNIFORM_BUFFER,this.totalBytes,s.DYNAMIC_DRAW),this.blockIndicesBuffer=s.createBuffer(),!this.blockIndicesBuffer)throw new Error("Failed to create block-indices UBO buffer");s.bindBuffer(s.UNIFORM_BUFFER,this.blockIndicesBuffer),s.bufferData(s.UNIFORM_BUFFER,this.totalBytes,s.DYNAMIC_DRAW),s.bindBuffer(s.UNIFORM_BUFFER,null)}writeHeader(r){const s=this.headerData;s[0]=r.dataDrivenMask,s[1]=r.zoomDependentMask,s[2]=r.dataDrivenBlockSizeVec4,s[3]=r.offsets[0],s[4]=r.offsets[1],s[5]=r.offsets[2],s[6]=r.offsets[3],s[7]=r.offsets[4],s[8]=r.offsets[5],s[9]=r.offsets[6],s[10]=r.offsets[7],s[11]=r.offsets[8]}writeDataDrivenBlock(r,s,u){const f=4*u.dataDrivenBlockSizeVec4;if(f===0)return;const g=s*f;if(g+f>this.propertiesData.length)throw new Error(`UBO write out of bounds: feature index ${s} exceeds propertiesData capacity`);for(let v=0;v<9;v++)u.dataDrivenMask&1<<v&&this._copyFromFlat(g+u.offsets[v],v,r,If.EVAL_FLAT_OFFSETS[v],u.zoomDependentMask)}static getMaxFeatureCount(r,s=4096){const u=4*r.dataDrivenBlockSizeVec4;return u===0?1/0:Math.floor(s/u)}_copyFromFlat(r,s,u,f,g){const v=this.propertiesData,x=s===8,w=!!(g&1<<s);
24s<2||x&&w?(v[r]=u[f],v[r+1]=u[f+1],v[r+2]=u[f+2],v[r+3]=u[f+3]):x||w?(v[r]=u[f],v[r+1]=u[f+1]):v[r]=u[f]}upload(r){this.context||(this.context=r);const s=r.gl;this.headerBuffer&&this.propertiesBuffer&&this.blockIndicesBuffer||this._initBuffers(r),s.bindBuffer(s.UNIFORM_BUFFER,this.headerBuffer),s.bufferSubData(s.UNIFORM_BUFFER,0,this.headerData),s.bindBuffer(s.UNIFORM_BUFFER,this.propertiesBuffer),s.bufferSubData(s.UNIFORM_BUFFER,0,this.propertiesData),s.bindBuffer(s.UNIFORM_BUFFER,this.blockIndicesBuffer),s.bufferSubData(s.UNIFORM_BUFFER,0,this.blockIndicesData),s.bindBuffer(s.UNIFORM_BUFFER,null)}bind(r,s){const u=r.gl,f=(v,x,w)=>{if(!x)return;const A=u.getUniformBlockIndex(s,v);A!==u.INVALID_INDEX&&(u.uniformBlockBinding(s,A,w),u.bindBufferBase(u.UNIFORM_BUFFER,w,x))},g=3*this.batchIndex;f("SymbolPaintPropertiesHeaderUniform",this.headerBuffer,g),f("SymbolPaintPropertiesUniform",this.propertiesBuffer,g+1),f("SymbolPaintPropertiesIndexUniform",this.blockIndicesBuffer,g+2)}destroy(){if(this.context){const r=this.context.gl;this.headerBuffer&&(r.deleteBuffer(this.headerBuffer),this.headerBuffer=null),this.propertiesBuffer&&(r.deleteBuffer(this.propertiesBuffer),this.propertiesBuffer=null),this.blockIndicesBuffer&&(r.deleteBuffer(this.blockIndicesBuffer),this.blockIndicesBuffer=null)}}};tm.HEADER_DWORDS=12,tm.HEADER_BYTES=48,tm.EVAL_FLAT_OFFSETS=[0,4,8,10,12,14,16,18,20],tm.EVAL_FLAT_SIZES=[4,4,2,2,2,2,2,2,4],tm.EVAL_FLAT_TOTAL=24,tm._blockIndicesTemplate=null;let ff=tm;function SD(l,r,s,u,f,g,v,x){return!!l&&(l.kind==="constant"?l.value==="none":l.kind==="composite"||l.kind==="source"?l.evaluate({zoom:0,brightness:g,worldview:x},r,s,f,u,v)==="none":typeof l=="string"&&l==="none")}Kt(ff,"SymbolPropertiesUBO",{omit:["headerBuffer","propertiesBuffer","blockIndicesBuffer"]});class kA{constructor(r,s,u,f,g="",v,x){this.layer=r,this.zoom=s,this.lut=u,this.isText=f,this.propDefs=this._getPropDefs(),this.worldview=g,this.maxUniformBufferBindings=v||24,this.uboSizeDwords=x||4096,this.featureVertexRangesFromId=new Map,this.allFeatures=[],this.ubos=[],this.featureCount=0,this.cachedHeader=null,this.maxFeaturesPerBatch=0,this.propertyHashToUBOIndex=new Map,this.canDeduplicate=this._checkIfAllPropertiesAreConstant(r,f),this.cachedParams=null,this.cachedParamsNext=null,this.cachedBrightness=void 0,this.cachedConstantUniforms=null,this.cachedConstantRenderZoom=null,this.cachedConstantBrightness=void 0,this.activeAppearanceByVtIndex=new Map,this.isLightConstant=!0,this._evalFlat=new Float32Array(ff.EVAL_FLAT_TOTAL)}_getPropDefs(){const r=this.isText?"text":"icon";return[{name:`${r}-color`,useThemeName:`${r}-color-use-theme`,isColor:!0},{name:`${r}-halo-color`,useThemeName:`${r}-halo-color-use-theme`,isColor:!0},{name:`${r}-opacity`,useThemeName:null,isColor:!1},{name:`${r}-halo-width`,useThemeName:null,isColor:!1},{name:`${r}-halo-blur`,useThemeName:null,isColor:!1},{name:`${r}-emissive-strength`,useThemeName:null,isColor:!1},{name:`${r}-occlusion-opacity`,useThemeName:null,isColor:!1},{name:"symbol-z-offset",useThemeName:null,isColor:!1},{name:`${r}-translate`,useThemeName:null,isColor:!1,isVec2:!0}]}buildHeader(){const r=this.layer.paint,s=this.propDefs;let u=0,f=0,g=0,v=0,x=!0;const w=[0,0,0,0,0,0,0,0,0];for(let R=0;R<9;R++){const{name:M,isColor:O,isVec2:B}=s[R],N=r.get(M),G=!(!N||typeof N.isConstant!="function"||N.isConstant()),H=this._appearancesHavePaintProperties(M),J=G||H,re=!(!N||!N.value||N.value.kind!=="composite"),Q=this.layer._transitionablePaint._values[M],le=!J&&(Q&&Q.value&&Q.value.expression&&Q.value.expression.kind)==="camera";if(J){u|=1<<R,re&&(f|=1<<R);const ue=N&&N.value;ue&&ue.isLightConstant===!1&&(x=!1),O?(v%4!=0&&(v=v+3&-4),w[R]=v,v+=4):B?re?(v%4!=0&&(v=v+3&-4),w[R]=v,v+=4):(v%4==3&&v++,w[R]=v,v+=2):(w[R]=v,v+=re?2:1)}else le&&(g|=1<<R)}const A=(v===0?0:v+3&-4)/4;return this.isLightConstant=x,{dataDrivenMask:u,zoomDependentMask:f,cameraMask:g,dataDrivenBlockSizeVec4:A,offsets:w}}get hasCameraExpression(){return!(!this.cachedHeader||!this.cachedHeader.cameraMask)}evaluateAllProperties(r,s,u,f,g,v,x){const{params:w,paramsNext:A}=this._getCachedParams(g),R={feature:r,featureState:s,canonical:u,availableImages:f,params:w,paramsNext:A,formattedSection:v},M=this.cachedHeader,O=this.propDefs;this._evalFlat||(this._evalFlat=new Float32Array(ff.EVAL_FLAT_TOTAL));const B=this._evalFlat;for(let N=0;N<9;N++){const{name:G,useThemeName:H,isColor:J,isVec2:re}=O[N],Q=!!(M&&M.zoomDependentMask&1<<N),le=ff.EVAL_FLAT_OFFSETS[N];J?this._evaluateColorValue(G,H,R,g,Q,x,B,le):re?this._evaluateTranslateValue(G,Q,R,x,B,le):this._evaluateFloatValue(G,Q,R,x,B,le)}return B}
24_evaluateColorValue(r,s,u,f,g,v,x,w){const A=this.layer.paint,R=r,M=v&&v.hasPaintProperty(R)?v.paintProperties.get(R):A.get(r),O=s,B=s&&v&&v.hasPaintProperty(O)?v.paintProperties.get(O):s?A.get(s):void 0;if(!M)return x[w]=0,x[w+1]=0,x[w+2]=0,void(x[w+3]=1);const N=SD(B&&typeof B!="string"?B.value:void 0,u.feature,u.featureState,u.availableImages,u.canonical,f,u.formattedSection,this.worldview)?null:this.lut;let G,H;M.isConstant()?G=H=M.constantOr(xr.transparent):(G=M.property.evaluate(M.value,u.params,u.feature,u.featureState,u.canonical,u.availableImages,M.iconImageUseTheme,u.formattedSection),H=g?M.property.evaluate(M.value,u.paramsNext,u.feature,u.featureState,u.canonical,u.availableImages,M.iconImageUseTheme,u.formattedSection):G);const J=(G||xr.transparent).toNonPremultipliedRenderColor(N);if(x[w]=of(255*J.r,255*J.g),x[w+1]=of(255*J.b,255*J.a),g){const re=(H||xr.transparent).toNonPremultipliedRenderColor(N);x[w+2]=of(255*re.r,255*re.g),x[w+3]=of(255*re.b,255*re.a)}else x[w+2]=0,x[w+3]=0}_evaluateFloatValue(r,s,u,f,g,v){const x=this.layer.paint,w=r.endsWith("opacity")?1:0,A=r,R=f&&f.hasPaintProperty(A)?f.paintProperties.get(A):x.get(r);if(!R)return g[v]=w,void(g[v+1]=0);if(R.isConstant())return g[v]=R.constantOr(w),void(g[v+1]=0);const M=R.property.evaluate(R.value,u.params,u.feature,u.featureState,u.canonical,u.availableImages,R.iconImageUseTheme,u.formattedSection);if(g[v]=M??w,s){const O=R.property.evaluate(R.value,u.paramsNext,u.feature,u.featureState,u.canonical,u.availableImages,R.iconImageUseTheme,u.formattedSection);g[v+1]=O??w}else g[v+1]=0}_evaluateTranslateValue(r,s,u,f,g,v){const x=this.layer.paint,w=r,A=f&&f.hasPaintProperty(w)?f.paintProperties.get(w):x.get(r);if(!A)return g[v]=0,g[v+1]=0,g[v+2]=0,void(g[v+3]=0);if(typeof A.isConstant!="function"){const M=A||[0,0];return g[v]=M[0],g[v+1]=M[1],g[v+2]=0,void(g[v+3]=0)}if(A.isConstant()){const M=A.constantOr([0,0]);return g[v]=M[0],g[v+1]=M[1],g[v+2]=0,void(g[v+3]=0)}const R=A.property.evaluate(A.value,u.params,u.feature,u.featureState,u.canonical,u.availableImages,A.iconImageUseTheme,u.formattedSection)||[0,0];if(g[v]=R[0],g[v+1]=R[1],s){const M=A.property.evaluate(A.value,u.paramsNext,u.feature,u.featureState,u.canonical,u.availableImages,A.iconImageUseTheme,u.formattedSection)||[0,0];g[v+2]=M[0],g[v+3]=M[1]}else g[v+2]=0,g[v+3]=0}_getCachedParams(r){return this.cachedParams&&this.cachedParamsNext&&this.cachedBrightness===r||(this.cachedParams=new Tr(this.zoom,{brightness:r,worldview:this.worldview}),this.cachedParamsNext=new Tr(this.zoom+1,{brightness:r,worldview:this.worldview}),this.cachedBrightness=r),{params:this.cachedParams,paramsNext:this.cachedParamsNext}}_appearancesHavePaintProperties(r){return this.layer.getAppearances().some(r!==void 0?s=>s.hasPaintProperty(r):this.isText?s=>s.hasTextPaintProperties():s=>s.hasIconPaintProperties())}_checkIfAllPropertiesAreConstant(r,s){const u=r.paint,f=s?"text":"icon",g=[`${f}-color`,`${f}-halo-color`,`${f}-opacity`,`${f}-halo-width`,`${f}-halo-blur`,`${f}-emissive-strength`,`${f}-occlusion-opacity`,"symbol-z-offset",`${f}-translate`];for(const v of g){const x=u.get(v);if(x&&typeof x=="object"&&"isConstant"in x&&!x.isConstant())return!1}return!this._appearancesHavePaintProperties()}_hashDataDrivenValues(r,s){if(s.dataDrivenMask===0)return"";const u=[];for(let f=0;f<this.propDefs.length;f++){if(!(s.dataDrivenMask&1<<f))continue;const g=ff.EVAL_FLAT_OFFSETS[f],v=ff.EVAL_FLAT_SIZES[f];let x=String(r[g]);for(let w=1;w<v;w++)x+=`,${String(r[g+w])}`;u.push(x)}return u.join("|")}getCurrentBatchIndex(){return this.cachedHeader&&this.maxFeaturesPerBatch!==0?Math.floor(this.featureCount/this.maxFeaturesPerBatch):0}populateUBO(r,s,u,f,g,v,x){const w=r.id;if(!this.cachedHeader){this.cachedHeader=this.buildHeader();const H=ff.getMaxFeatureCount(this.cachedHeader,this.uboSizeDwords);this.maxFeaturesPerBatch=isFinite(H)?H:Number.MAX_SAFE_INTEGER}const A=this.cachedHeader,R=this.evaluateAllProperties(r,{},u,f,g,v);if(this.canDeduplicate){const H=this._hashDataDrivenValues(R,A),J=this.propertyHashToUBOIndex.get(H);if(J!==void 0){const re=isFinite(this.maxFeaturesPerBatch)?Math.floor(J/this.maxFeaturesPerBatch):0,Q=isFinite(this.maxFeaturesPerBatch)?J%this.maxFeaturesPerBatch:J,le={batchIndex:re,localFeatureIndex:Q,vtFeatureIndex:s,featureId:w};return this.allFeatures.push(le),w!=null&&(this.featureVertexRangesFromId.has(w)||this.featureVertexRangesFromId.set(w,[]),this.featureVertexRangesFromId.get(w).push(le)),Q}this.propertyHashToUBOIndex.set(H,this.featureCount)}
24const M=this.featureCount++,O=isFinite(this.maxFeaturesPerBatch)?Math.floor(M/this.maxFeaturesPerBatch):0,B=isFinite(this.maxFeaturesPerBatch)?M%this.maxFeaturesPerBatch:M,N=x?x.maxUniformBufferBindings:this.maxUniformBufferBindings;if(3*O+2>=N){On(`Too many symbol features: batch ${O} requires binding points up to ${3*O+2}, device limit ${N}. Some features will render incorrectly.`);const H={batchIndex:0,localFeatureIndex:0,vtFeatureIndex:s,featureId:w};return this.allFeatures.push(H),w!=null&&(this.featureVertexRangesFromId.has(w)||this.featureVertexRangesFromId.set(w,[]),this.featureVertexRangesFromId.get(w).push(H)),0}this.ubos[O]||(this.ubos[O]=new ff(x,O,this.uboSizeDwords),this.ubos[O].writeHeader(A)),this.ubos[O].writeDataDrivenBlock(R,B,A);const G={batchIndex:O,localFeatureIndex:B,vtFeatureIndex:s,featureId:w};return this.allFeatures.push(G),w!=null&&(this.featureVertexRangesFromId.has(w)||this.featureVertexRangesFromId.set(w,[]),this.featureVertexRangesFromId.get(w).push(G)),B}updateFeatures(r,s,u,f,g,v,x){if(this.layer=s,this.cachedConstantUniforms=null,!this.cachedHeader)return;const w=this.cachedHeader;for(const A of r){const R=this.featureVertexRangesFromId.get(A);if(!R)continue;const M=v[A]||{};for(const O of R){if(!u)continue;const B=u.feature(O.vtFeatureIndex);if(!B)continue;const N={type:B.type,id:A,properties:B.properties||{},geometry:[]},G=this.activeAppearanceByVtIndex?this.activeAppearanceByVtIndex.get(O.vtFeatureIndex):void 0,H=this.evaluateAllProperties(N,M,f,g,x,void 0,G);this.ubos[O.batchIndex]&&this.ubos[O.batchIndex].writeDataDrivenBlock(H,O.localFeatureIndex,w)}}}updateDynamicExpressions(r,s,u,f,g,v){if(this.layer=r,this.cachedConstantUniforms=null,!this.cachedHeader||this.cachedHeader.dataDrivenMask===0)return;const x=this.cachedHeader;for(const w of this.allFeatures){if(!s)continue;const A=s.feature(w.vtFeatureIndex);if(!A)continue;const R=w.featureId!=null&&g[w.featureId]||{},M={type:A.type,id:w.featureId,properties:A.properties||{},geometry:[]},O=this.activeAppearanceByVtIndex?this.activeAppearanceByVtIndex.get(w.vtFeatureIndex):void 0,B=this.evaluateAllProperties(M,R,u,f,v,void 0,O);this.ubos[w.batchIndex]&&this.ubos[w.batchIndex].writeDataDrivenBlock(B,w.localFeatureIndex,x)}}updateFeaturePaintForAppearance(r,s,u,f,g,v,x){if(!this.layer||(this.activeAppearanceByVtIndex||(this.activeAppearanceByVtIndex=new Map),this.activeAppearanceByVtIndex.set(r,x||null),!this.cachedHeader))return!1;const w=this.cachedHeader;if(w.dataDrivenMask===0)return!1;let A=!1;for(const R of this.allFeatures){if(R.vtFeatureIndex!==r)continue;const M=this.evaluateAllProperties(s,u,f,g,v,void 0,x);this.ubos[R.batchIndex]&&(this.ubos[R.batchIndex].writeDataDrivenBlock(M,R.localFeatureIndex,w),A=!0)}return A}getConstantUniformValues(r,s){const u=this.cachedHeader,f=!(!u||!u.cameraMask);if(this.cachedConstantUniforms&&this.cachedConstantBrightness===s&&(!f||this.cachedConstantRenderZoom===r))return this.cachedConstantUniforms;const g=this.layer.paint,v=this.propDefs,x=f?new Tr(r,{brightness:s,worldview:this.worldview}):null,w={type:1,id:void 0,properties:{},geometry:[]},A=O=>{const B=v[O],N=g.get(B.name);if(!N)return[0,0,0,1];const G=B.useThemeName?g.get(B.useThemeName):void 0,H=SD(G&&typeof G!="string"?G.value:void 0,w,{},[],void 0,s,void 0,this.worldview)?null:this.lut;let J;J=u&&u.cameraMask&1<<O&&x?N.property.evaluate(N.value,x,w,{},void 0,[]):N.constantOr(xr.transparent);const re=(J||xr.transparent).toNonPremultipliedRenderColor(H);return[re.r,re.g,re.b,re.a]},R=(O,B)=>{const N=g.get(v[O].name);if(!N)return B;if(u&&u.cameraMask&1<<O&&x){const G=N.property.evaluate(N.value,x,w,{},void 0,[]);return G??B}return N.constantOr(B)},M={fill_np_color:A(0),halo_np_color:A(1),opacity:R(2,1),halo_width:R(3,0),halo_blur:R(4,0),emissive_strength:R(5,0),occlusion_opacity:R(6,1),z_offset:R(7,0)};return this.cachedConstantUniforms=M,this.cachedConstantRenderZoom=r,this.cachedConstantBrightness=s,M}upload(r){for(const s of this.ubos)s.upload(r)}bind(r,s,u=0){this.ubos[u]&&this.ubos[u].bind(r,s)}destroy(){for(const r of this.ubos)r.destroy();this.ubos=[],this.featureVertexRangesFromId.clear(),this.allFeatures=[],this.featureCount=0,this.cachedHeader=null,this.maxFeaturesPerBatch=0,this.propertyHashToUBOIndex&&this.propertyHashToUBOIndex.clear()}}Kt(kA,"SymbolPropertyBinderUBO",{omit:["layer","cachedParams","cachedParamsNext","cachedBrightness","propertyHashToUBOIndex","cachedConstantUniforms","cachedConstantRenderZoom","cachedConstantBrightness","activeAppearanceByVtIndex","_evalFlat"]});var Eo=24;function vW(l,r,s){return l.sections.forEach(u=>{u.text=(function(f,g,v){const x=g.layout.get("text-transform").evaluate(v,{});return x==="uppercase"?f=f.toLocaleUpperCase():x==="lowercase"&&(f=f.toLocaleLowerCase()),yl.applyArabicShaping&&(f=yl.applyArabicShaping(f)),f})(u.text,r,s)}),l}const Av={"!":"ï¸","#":"ï¼",$:"ï¼","%":"ï¼
","&":"ï¼","(":"︵",")":"︶","*":"ï¼","+":"ï¼",",":"ï¸","-":"︲",".":"ã»","/":"ï¼",":":"ï¸",";":"ï¸","<":"︿","=":"ï¼",">":"ï¹","?":"ï¸","@":"ï¼ ","[":"ï¹","\\":"ï¼¼","]":"ï¹","^":"ï¼¾",_:"︳","`":"ï½","{":"︷","|":"â","}":"︸","~":"ï½","¢":"ï¿ ","£":"ï¿¡","Â¥":"ï¿¥","¦":"¦","¬":"ï¿¢","¯":"ï¿£","â":"︲","â":"︱","â":"ï¹","â":"ï¹","â":"ï¹","â":"ï¹","â¦":"ï¸","â§":"ã»","â©":"₩","ã":"ï¸","ã":"ï¸","ã":"︿","ã":"ï¹","ã":"︽","ã":"︾","ã":"ï¹","ã":"ï¹","ã":"ï¹","ã":"ï¹","ã":"︻","ã":"︼","ã":"︹","ã":"︺","ã":"ï¸","ã":"ï¸","ï¼":"ï¸","ï¼":"︵","ï¼":"︶","ï¼":"ï¸","ï¼":"︲","ï¼":"ã»","ï¼":"ï¸","ï¼":"ï¸","ï¼":"︿","ï¼":"ï¹","ï¼":"ï¸","ï¼»":"ï¹","ï¼½":"ï¹","_":"︳","ï½":"︷","ï½":"â","ï½":"︸","ï½":"︵","ï½ ":"︶","。":"ï¸","ï½¢":"ï¹","ï½£":"ï¹","â":"â","â":"â"};function bW(l){return l==="︶"||l==="ï¹"||l==="︸"||l==="ï¹"||l==="ï¹"||l==="︾"||l==="︼"||l==="︺"||l==="ï¸"||l==="ï¹"||l==="ï¸"||l==="ï¸"||l==="ï¸"||l==="ï½"||l==="ï¿£"||l==="ï¸"||l==="ï¸"}function xW(l){return l==="︵"||l==="ï¹"||l==="︷"||l==="ï¹"||l==="ï¹"||l==="︽"||l==="︻"||l==="︹"||l==="ï¸"||l==="︿"}const MA=4294967296,TD=1/MA,ED=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");let _S=class{constructor(l=new Uint8Array(16)){this.buf=ArrayBuffer.isView(l)?l:new Uint8Array(l),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(l,r,s=this.length){for(;this.pos<s;){const u=this.readVarint(),f=u>>3,g=this.pos;this.type=7&u,l(f,r,this),this.pos===g&&this.skip(u)}return r}readMessage(l,r){return this.readFields(l,r,this.readVarint()+this.pos)}readFixed32(){const l=this.dataView.getUint32(this.pos,!0);return this.pos+=4,l}readSFixed32(){const l=this.dataView.getInt32(this.pos,!0);return this.pos+=4,l}readFixed64(){const l=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*MA;return this.pos+=8,l}readSFixed64(){const l=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*MA;return this.pos+=8,l}readFloat(){const l=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,l}readDouble(){const l=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,l}readVarint(l){const r=this.buf;let s,u;return u=r[this.pos++],s=127&u,u<128?s:(u=r[this.pos++],s|=(127&u)<<7,u<128?s:(u=r[this.pos++],s|=(127&u)<<14,u<128?s:(u=r[this.pos++],s|=(127&u)<<21,u<128?s:(u=r[this.pos],s|=(15&u)<<28,(function(f,g,v){const x=v.buf;let w,A;if(A=x[v.pos++],w=(112&A)>>4,A<128||(A=x[v.pos++],w|=(127&A)<<3,A<128)||(A=x[v.pos++],w|=(127&A)<<10,A<128)||(A=x[v.pos++],w|=(127&A)<<17,A<128)||(A=x[v.pos++],w|=(127&A)<<24,A<128)||(A=x[v.pos++],w|=(1&A)<<31,A<128))return a_(f,w,g);throw new Error("Expected varint not more than 10 bytes")})(s,l,this)))))}readVarint64(){return this.readVarint(!0)}readSVarint(){const l=this.readVarint();return l%2==1?(l+1)/-2:l/2}readBoolean(){return!!this.readVarint()}readString(){const l=this.readVarint()+this.pos,r=this.pos;return this.pos=l,l-r>=12&&ED?ED.decode(this.buf.subarray(r,l)):(function(s,u,f){let g="",v=u;for(;v<f;){const x=s[v];let w,A,R,M=null,O=x>239?4:x>223?3:x>191?2:1;if(v+O>f)break;O===1?x<128&&(M=x):O===2?(w=s[v+1],(192&w)==128&&(M=(31&x)<<6|63&w,M<=127&&(M=null))):O===3?(w=s[v+1],A=s[v+2],(192&w)==128&&(192&A)==128&&(M=(15&x)<<12|(63&w)<<6|63&A,(M<=2047||M>=55296&&M<=57343)&&(M=null))):O===4&&(w=s[v+1],A=s[v+2],R=s[v+3],(192&w)==128&&(192&A)==128&&(192&R)==128&&(M=(15&x)<<18|(63&w)<<12|(63&A)<<6|63&R,(M<=65535||M>=1114112)&&(M=null))),M===null?(M=65533,O=1):M>65535&&(M-=65536,g+=String.fromCharCode(M>>>10&1023|55296),M=56320|1023&M),g+=String.fromCharCode(M),v+=O}return g})(this.buf,r,l)}readBytes(){const l=this.readVarint()+this.pos,r=this.buf.subarray(this.pos,l);return this.pos=l,r}readPackedVarint(l=[],r){const s=this.readPackedEnd();for(;this.pos<s;)l.push(this.readVarint(r));return l}readPackedSVarint(l=[]){const r=this.readPackedEnd();for(;this.pos<r;)l.push(this.readSVarint());return l}readPackedBoolean(l=[]){const r=this.readPackedEnd();for(;this.pos<r;)l.push(this.readBoolean());return l}readPackedFloat(l=[]){const r=this.readPackedEnd();for(;this.pos<r;)l.push(this.readFloat());return l}readPackedDouble(l=[]){const r=this.readPackedEnd();for(;this.pos<r;)l.push(this.readDouble());return l}readPackedFixed32(l=[]){const r=this.readPackedEnd();for(;this.pos<r;)l.push(this.readFixed32());return l}readPackedSFixed32(l=[]){const r=this.readPackedEnd();for(;this.pos<r;)l.push(this.readSFixed32());return l}readPackedFixed64(l=[]){const r=this.readPackedEnd();for(;this.pos<r;)l.push(this.readFixed64());return l}readPackedSFixed64(l=[]){const r=this.readPackedEnd();for(;this.pos<r;)l.push(this.readSFixed64());return l}readPackedEnd(){return this.type===2?this.readVarint()+this.pos:this.pos+1}skip(l){const r=7&l;if(r===0)for(;this.buf[this.pos++]>127;);else if(r===2)this.pos=this.readVarint()+this.pos;else if(r===5)this.pos+=4;else{if(r!==1)throw new Error(`Unimplemented type: ${r}`);this.pos+=8}}writeTag(l,r){this.writeVarint(l<<3|r)}realloc(l){let r=this.length||16;for(;r<this.pos+l;)r*=2;if(r!==this.length){const s=new Uint8Array(r);s.set(this.buf),this.buf=s,this.dataView=new DataView(s.buffer),this.length=r}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(l){this.realloc(4),this.dataView.setInt32(this.pos,l,!0),this.pos+=4}writeSFixed32(l){this.realloc(4),this.dataView.setInt32(this.pos,l,!0),this.pos+=4}
24writeFixed64(l){this.realloc(8),this.dataView.setInt32(this.pos,-1&l,!0),this.dataView.setInt32(this.pos+4,Math.floor(l*TD),!0),this.pos+=8}writeSFixed64(l){this.realloc(8),this.dataView.setInt32(this.pos,-1&l,!0),this.dataView.setInt32(this.pos+4,Math.floor(l*TD),!0),this.pos+=8}writeVarint(l){(l=+l||0)>268435455||l<0?(function(r,s){let u,f;if(r>=0?(u=r%4294967296|0,f=r/4294967296|0):(u=~(-r%4294967296),f=~(-r/4294967296),4294967295^u?u=u+1|0:(u=0,f=f+1|0)),r>=18446744073709552e3||r<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");s.realloc(10),(function(g,v,x){x.buf[x.pos++]=127&g|128,g>>>=7,x.buf[x.pos++]=127&g|128,g>>>=7,x.buf[x.pos++]=127&g|128,g>>>=7,x.buf[x.pos++]=127&g|128,x.buf[x.pos]=127&(g>>>=7)})(u,0,s),(function(g,v){const x=(7&g)<<4;v.buf[v.pos++]|=x|((g>>>=3)?128:0),g&&(v.buf[v.pos++]=127&g|((g>>>=7)?128:0),g&&(v.buf[v.pos++]=127&g|((g>>>=7)?128:0),g&&(v.buf[v.pos++]=127&g|((g>>>=7)?128:0),g&&(v.buf[v.pos++]=127&g|((g>>>=7)?128:0),g&&(v.buf[v.pos++]=127&g)))))})(f,s)})(l,this):(this.realloc(4),this.buf[this.pos++]=127&l|(l>127?128:0),l<=127||(this.buf[this.pos++]=127&(l>>>=7)|(l>127?128:0),l<=127||(this.buf[this.pos++]=127&(l>>>=7)|(l>127?128:0),l<=127||(this.buf[this.pos++]=l>>>7&127))))}writeSVarint(l){this.writeVarint(l<0?2*-l-1:2*l)}writeBoolean(l){this.writeVarint(+l)}writeString(l){l=String(l),this.realloc(4*l.length),this.pos++;const r=this.pos;this.pos=(function(u,f,g){for(let v,x,w=0;w<f.length;w++){if(v=f.charCodeAt(w),v>55295&&v<57344){if(!x){v>56319||w+1===f.length?(u[g++]=239,u[g++]=191,u[g++]=189):x=v;continue}if(v<56320){u[g++]=239,u[g++]=191,u[g++]=189,x=v;continue}v=x-55296<<10|v-56320|65536,x=null}else x&&(u[g++]=239,u[g++]=191,u[g++]=189,x=null);v<128?u[g++]=v:(v<2048?u[g++]=v>>6|192:(v<65536?u[g++]=v>>12|224:(u[g++]=v>>18|240,u[g++]=v>>12&63|128),u[g++]=v>>6&63|128),u[g++]=63&v|128)}return g})(this.buf,l,this.pos);const s=this.pos-r;s>=128&&CD(r,s,this),this.pos=r-1,this.writeVarint(s),this.pos+=s}writeFloat(l){this.realloc(4),this.dataView.setFloat32(this.pos,l,!0),this.pos+=4}writeDouble(l){this.realloc(8),this.dataView.setFloat64(this.pos,l,!0),this.pos+=8}writeBytes(l){const r=l.length;this.writeVarint(r),this.realloc(r);for(let s=0;s<r;s++)this.buf[this.pos++]=l[s]}writeRawMessage(l,r){this.pos++;const s=this.pos;l(r,this);const u=this.pos-s;u>=128&&CD(s,u,this),this.pos=s-1,this.writeVarint(u),this.pos+=u}writeMessage(l,r,s){this.writeTag(l,2),this.writeRawMessage(r,s)}writePackedVarint(l,r){r.length&&this.writeMessage(l,wW,r)}writePackedSVarint(l,r){r.length&&this.writeMessage(l,SW,r)}writePackedBoolean(l,r){r.length&&this.writeMessage(l,CW,r)}writePackedFloat(l,r){r.length&&this.writeMessage(l,TW,r)}writePackedDouble(l,r){r.length&&this.writeMessage(l,EW,r)}writePackedFixed32(l,r){r.length&&this.writeMessage(l,AW,r)}writePackedSFixed32(l,r){r.length&&this.writeMessage(l,IW,r)}writePackedFixed64(l,r){r.length&&this.writeMessage(l,PW,r)}writePackedSFixed64(l,r){r.length&&this.writeMessage(l,RW,r)}writeBytesField(l,r){this.writeTag(l,2),this.writeBytes(r)}writeFixed32Field(l,r){this.writeTag(l,5),this.writeFixed32(r)}writeSFixed32Field(l,r){this.writeTag(l,5),this.writeSFixed32(r)}writeFixed64Field(l,r){this.writeTag(l,1),this.writeFixed64(r)}writeSFixed64Field(l,r){this.writeTag(l,1),this.writeSFixed64(r)}writeVarintField(l,r){this.writeTag(l,0),this.writeVarint(r)}writeSVarintField(l,r){this.writeTag(l,0),this.writeSVarint(r)}writeStringField(l,r){this.writeTag(l,2),this.writeString(r)}writeFloatField(l,r){this.writeTag(l,5),this.writeFloat(r)}writeDoubleField(l,r){this.writeTag(l,1),this.writeDouble(r)}writeBooleanField(l,r){this.writeVarintField(l,+r)}};function a_(l,r,s){return s?4294967296*r+(l>>>0):4294967296*(r>>>0)+(l>>>0)}function CD(l,r,s){const u=r<=16383?1:r<=2097151?2:r<=268435455?3:Math.floor(Math.log(r)/(7*Math.LN2));s.realloc(u);for(let f=s.pos-1;f>=l;f--)s.buf[f+u]=s.buf[f]}function wW(l,r){for(let s=0;s<l.length;s++)r.writeVarint(l[s])}function SW(l,r){for(let s=0;s<l.length;s++)r.writeSVarint(l[s])}function TW(l,r){for(let s=0;s<l.length;s++)r.writeFloat(l[s])}function EW(l,r){for(let s=0;s<l.length;s++)r.writeDouble(l[s])}function CW(l,r){for(let s=0;s<l.length;s++)r.writeBoolean(l[s])}function AW(l,r){for(let s=0;s<l.length;s++)r.writeFixed32(l[s])}function IW(l,r){for(let s=0;s<l.length;s++)r.writeSFixed32(l[s])}function PW(l,r){for(let s=0;s<l.length;
24s++)r.writeFixed64(l[s])}function RW(l,r){for(let s=0;s<l.length;s++)r.writeSFixed64(l[s])}function kW(l,r,s){r.glyphs=[],l===1&&s.readMessage(MW,r)}function MW(l,r,s){if(l===3){const{id:u,bitmap:f,width:g,height:v,left:x,top:w,advance:A}=s.readMessage(LW,{});r.glyphs.push({id:u,bitmap:new cs({width:g+6,height:v+6},f),metrics:{width:g,height:v,left:x,top:w,advance:A}})}else l===4?r.ascender=s.readSVarint():l===5&&(r.descender=s.readSVarint())}function LW(l,r,s){l===1?r.id=s.readVarint():l===2?r.bitmap=s.readBytes():l===3?r.width=s.readVarint():l===4?r.height=s.readVarint():l===5?r.left=s.readSVarint():l===6?r.top=s.readSVarint():l===7&&(r.advance=s.readVarint())}const ka={horizontal:1,vertical:2,horizontalOnly:3};class Iv{constructor(){this.scale=1,this.fontStack="",this.image=null}static forText(r,s){const u=new Iv;return u.scale=r||1,u.fontStack=s,u}static forImage(r){const s=new Iv;return s.image=r,s}}class l_{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(r,s,u,f=1){const g=new l_;for(let v=0;v<r.sections.length;v++){const x=r.sections[v];x.image?g.addImageSection(x,u,f):g.addTextSection(x,s)}return g}length(){return this.text.length}getSection(r){return this.sections[this.sectionIndex[r]]}getSections(){return this.sections}getSectionIndex(r){return this.sectionIndex[r]}getCodePoint(r){return this.text.codePointAt(r)}verticalizePunctuation(r){this.text=(function(s,u){let f="";for(let g=0;g<s.length;g++){const v=s.charCodeAt(g+1)||null,x=s.charCodeAt(g-1)||null;f+=!u&&(v&&Fg(v)&&!Av[s[g+1]]||x&&Fg(x)&&!Av[s[g-1]])||!Av[s[g]]?s[g]:Av[s[g]]}return f})(this.text,r)}trim(){let r=0;for(let u=0;u<this.text.length&&yS[this.text.charCodeAt(u)];u++)r++;let s=this.text.length;for(let u=this.text.length-1;u>=0&&u>=r&&yS[this.text.charCodeAt(u)];u--)s--;this.text=this.text.substring(r,s),this.sectionIndex=this.sectionIndex.slice(r,s)}substring(r,s){const u=new l_;return u.text=this.text.substring(r,s),u.sectionIndex=this.sectionIndex.slice(r,s),u.sections=this.sections,u}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((r,s)=>Math.max(r,this.sections[s].scale),0)}addTextSection(r,s){this.text+=r.text,this.sections.push(Iv.forText(r.scale,r.fontStack||s));const u=this.sections.length-1;for(let f=0;f<r.text.length;++f)this.sectionIndex.push(u)}addImageSection(r,s,u=1){const f=r.image?r.image.getPrimary():null;if(!f)return void On("Can't add FormattedSection with an empty image.");f.scaleSelf(s*u);const g=this.getNextImageSectionCharCode();g?(this.text+=String.fromCodePoint(g),this.sections.push(Iv.forImage(f)),this.sectionIndex.push(this.sections.length-1)):On("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function LA(l,r,s,u,f,g,v,x,w,A,R,M,O,B,N,G=1,H=1){const J=l_.fromFeature(l,f,G,H);M===ka.vertical&&J.verticalizePunctuation(O);let re=[];const Q=(function(me,xe,_e,we,je,He,Qe=1){if(!me)return[];const it=[],nt=(function(et,ot,ft,_t,Ft,ut,At=1){let It=0;for(let Xt=0;Xt<et.length();Xt++){const Yt=et.getSection(Xt);It+=AD(et.getCodePoint(Xt),Yt,_t,Ft,ot,ut,At)}return It/Math.max(1,Math.ceil(It/ft))})(me,xe,_e,we,je,He,Qe),bt=me.text.includes("â");let Ze=0;for(let et=0;et<me.length();et++){const ot=me.getSection(et),ft=me.getCodePoint(et);if(yS[ft]||(Ze+=AD(ft,ot,we,je,xe,He,Qe)),et<me.length()-1){const _t=sw(ft);(OW[ft]||_t||ot.image)&&it.push(PD(et+1,Ze,nt,it,DW(ft,me.getCodePoint(et+1),_t&&bt),!1))}}return RD(PD(me.length(),Ze,nt,it,0,!0))})(J,A,g,r,u,B,H),{processBidirectionalText:le,processStyledBidirectionalText:ue}=yl;if(le&&J.sections.length===1){const me=le(J.toString(),Q);for(const xe of me){const _e=new l_;_e.text=xe,_e.sections=J.sections;for(let we=0;we<xe.length;we++)_e.sectionIndex.push(0);re.push(_e)}}else if(ue){const me=ue(J.text,J.sectionIndex,Q);for(const xe of me){const _e=new l_;_e.text=xe[0],_e.sectionIndex=xe[1],_e.sections=J.sections,re.push(_e)}}else re=(function(me,xe){const _e=[],we=me.text;let je=0;for(const He of xe)_e.push(me.substring(je,He)),je=He;return je<we.length&&_e.push(me.substring(je,we.length)),_e})(J,Q);const he=[],Te={positionedLines:he,text:J.toString(),top:R[1],bottom:R[1],left:R[0],right:R[0],writingMode:M,iconsInText:!1,verticalizable:!1,hasBaseline:!1};if((function(me,xe,_e,we,je,He,Qe,it,nt,bt,Ze,et,ot=1){let ft=0,_t=0,Ft=0;const ut=it==="right"?1:it==="left"?0:.5;let At=!1;for(const on of je){const En=on.getSections();for(const _r of En){if(_r.image)continue;const Nn=xe[_r.fontStack];if(Nn&&(At=Nn.ascender!==void 0&&Nn.descender!==void 0,!At))break}if(!At)break}let It=0;for(const on of je){on.trim();const En=on.getMaxScale(),_r=(En-1)*Eo,Nn={positionedGlyphs:[],lineOffset:0};me.positionedLines[It]=Nn;const sr=Nn.positionedGlyphs;let Zn=0;if(!on.length()){_t+=He,++It;continue}let Pi=0,Cr=0;for(let jr=0;jr<on.length();jr++){const mi=on.getSection(jr),Co=on.getSectionIndex(jr),Yr=on.getCodePoint(jr);let Ri=mi.scale,oo=null,Ki=null,so=null,Qn=Eo,Ko=0,Ms=nt;Ms===ka.vertical&&P0(Yr)&&(Ms=ka.horizontal);const Gi=!(Ms===ka.horizontal||!Ze&&!Dg(Yr)||Ze&&(yS[Yr]||aw(Yr)));if(mi.image){const Do=we.get(mi.image.toString());if(!Do)continue;so=mi.image,me.iconsInText=me.iconsInText||!0,Ki=Do.paddedRect;const bs=Do.displaySize,Jo=bs[0]*ot,yi=bs[1]*ot;Ri=Ri*Eo/et,oo={width:Jo,height:yi,left:0,top:-3,advance:Gi?yi:Jo,localGlyph:!1},Ko=At?-oo.height*Ri:En*Eo-17-yi*Ri,Qn=oo.advance;const mo=(Gi?Jo:yi)*Ri-Eo*En;mo>0&&mo>Zn&&(Zn=mo)}else{const Do=_e[mi.fontStack];if(!Do)continue;Do[Yr]&&(Ki=Do[Yr]);const bs=xe[mi.fontStack];if(!bs)continue;const Jo=bs.glyphs[Yr];if(!Jo)continue;if(oo=Jo.metrics,Qn=Yr!==8203?Eo:0,At){const yi=bs.ascender!==void 0?Math.abs(bs.ascender):0,mo=bs.descender!==void 0?Math.abs(bs.descender):0,ca=(yi+mo)*Ri;Pi<ca&&(Pi=ca,Cr=(yi-mo)/2*Ri),Ko=-yi*Ri}else Ko=(En-Ri)*Eo-17}
24Gi?(me.verticalizable=!0,sr.push({glyph:Yr,image:so,x:ft,y:_t+Ko,vertical:Gi,scale:Ri,localGlyph:oo.localGlyph,fontStack:mi.fontStack,sectionIndex:Co,metrics:oo,rect:Ki}),ft+=Qn*Ri+bt):(sr.push({glyph:Yr,image:so,x:ft,y:_t+Ko,vertical:Gi,scale:Ri,localGlyph:oo.localGlyph,fontStack:mi.fontStack,sectionIndex:Co,metrics:oo,rect:Ki}),ft+=oo.advance*Ri+bt)}sr.length!==0&&(Ft=Math.max(ft-bt,Ft),At?kD(sr,ut,Zn,Cr,He*En/2):kD(sr,ut,Zn,0,He/2)),ft=0;const gr=He*En+Zn;Nn.lineOffset=Math.max(Zn,_r),_t+=gr,++It}const Xt=_t,{horizontalAlign:Yt,verticalAlign:gn}=OA(Qe);(function(on,En,_r,Nn,sr,Zn){const Pi=(En-_r)*sr,Cr=-Zn*Nn;for(const gr of on)for(const jr of gr.positionedGlyphs)jr.x+=Pi,jr.y+=Cr})(me.positionedLines,ut,Yt,gn,Ft,Xt),me.top+=-gn*Xt,me.bottom=me.top+Xt,me.left+=-Yt*Ft,me.right=me.left+Ft,me.hasBaseline=At})(Te,r,s,u,re,v,x,w,M,A,O,N,H),!(function(me){for(const xe of me)if(xe.positionedGlyphs.length!==0)return!1;return!0})(he))return Te}const yS={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},OW={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function AD(l,r,s,u,f,g,v=1){if(r.image){const x=u.get(r.image.toString());return x?x.displaySize[0]*v*r.scale*Eo/g+f:0}{const x=s[r.fontStack],w=x&&x.glyphs[l];return w?w.metrics.advance*r.scale+f:0}}function ID(l,r,s,u){const f=Math.pow(l-r,2);return u?l<r?f/2:2*f:f+Math.abs(s)*s}function DW(l,r,s){let u=0;return l===10&&(u-=1e4),s&&(u+=150),l!==40&&l!==65288||(u+=50),r!==41&&r!==65289||(u+=50),u}function PD(l,r,s,u,f,g){let v=null,x=ID(r,s,f,g);for(const w of u){const A=ID(r-w.x,s,f,g)+w.badness;A<=x&&(v=w,x=A)}return{index:l,x:r,priorBreak:v,badness:x}}function RD(l){return l?RD(l.priorBreak).concat(l.index):[]}function OA(l){let r=.5,s=.5;switch(l){case"right":case"top-right":case"bottom-right":r=1;break;case"left":case"top-left":case"bottom-left":r=0}switch(l){case"bottom":case"bottom-right":case"bottom-left":s=1;break;case"top":case"top-right":case"top-left":s=0}return{horizontalAlign:r,verticalAlign:s}}function kD(l,r,s,u,f){if(!(r||s||u||f))return;const g=l.length-1,v=l[g],x=(v.x+v.metrics.advance*v.scale)*r;for(let w=0;w<=g;w++)l[w].x-=x,l[w].y+=s+u+f}function DA(l){return l.imagePrimary!==void 0&&l.top!==void 0&&l.bottom!==void 0&&l.left!==void 0&&l.right!==void 0}function vS(l,r,s,u){const{horizontalAlign:f,verticalAlign:g}=OA(u),v=s[0]-l.displaySize[0]*f,x=s[1]-l.displaySize[1]*g;return{imagePrimary:l,imageSecondary:r,top:x,bottom:x+l.displaySize[1],left:v,right:v+l.displaySize[0]}}function FA(l,r,s,u,f,g){const v=l.imagePrimary;let x;if(v.content){const H=v.content,J=v.pixelRatio||1;x=[H[0]/J,H[1]/J,v.displaySize[0]-H[2]/J,v.displaySize[1]-H[3]/J]}const w=r.left*g,A=r.right*g;let R,M,O,B;s==="width"||s==="both"?(B=f[0]+w-u[3],M=f[0]+A+u[1]):(B=f[0]+(w+A-v.displaySize[0])/2,M=B+v.displaySize[0]);const N=r.top*g,G=r.bottom*g;return s==="height"||s==="both"?(R=f[1]+N-u[0],O=f[1]+G+u[2]):(R=f[1]+(N+G-v.displaySize[1])/2,O=R+v.displaySize[1]),{imagePrimary:v,imageSecondary:void 0,top:R,right:M,bottom:O,left:B,collisionPadding:x}}function MD(l){return!l.imagePrimary.stretchX}function LD(l){return!l.imagePrimary.stretchY}function OD(l){return{width:l.right-l.left,height:l.bottom-l.top}}const Ud=128;function nm(l,r,s,u){const{expression:f}=r;if(f.kind==="constant")return{kind:"constant",layoutSize:f.evaluate(new Tr(l+1,{worldview:s}),void 0,void 0,void 0,u)};if(f.kind==="source")return{kind:"source"};{const{zoomStops:g,interpolationType:v}=f;let x=0;for(;x<g.length&&g[x]<=l;)x++;x=Math.max(0,x-1);let w=x;for(;w<g.length&&g[w]<l+1;)w++;w=Math.min(g.length-1,w);const A=g[x],R=g[w];return f.kind==="composite"?{kind:"composite",minZoom:A,maxZoom:R,interpolationType:v}:{kind:"camera",minZoom:A,maxZoom:R,minSize:f.evaluate(new Tr(A,{worldview:s}),void 0,void 0,void 0,u),maxSize:f.evaluate(new Tr(R,{worldview:s}),void 0,void 0,void 0,u),interpolationType:v}}}function BA(l,{uSize:r,uSizeT:s},{lowerSize:u,upperSize:f}){return l.kind==="source"?u/Ud:l.kind==="composite"?Sn(u/Ud,f/Ud,s):r}function c_(l,r,s=1){let u=0,f=0;if(l.kind==="constant")f=l.layoutSize*s;else if(l.kind!=="source"){const{interpolationType:g,minZoom:v,maxZoom:x}=l,w=g?Ee(na.interpolationFactor(g,r,v,x),0,1):0;l.kind==="camera"?f=Sn(l.minSize,l.maxSize,w)*s:u=w*s}return{uSizeT:u,uSize:f}}class $d extends St{constructor(r,s,u,f,g){super(r,s),this.angle=f,this.z=u,g!==void 0&&(this.segment=g)}clone(){return new $d(this.x,this.y,this.z,this.angle,this.segment)}}function DD(l,r,s,u,f){if(r.segment===void 0)return!0;let g=r,v=r.segment+1,x=0;for(;x>-s/2;){if(v--,v<0)return!1;x-=l[v].dist(g),g=l[v]}x+=l[v].dist(l[v+1]),v++;const w=[];let A=0;for(;x<s/2;){const R=l[v],M=l[v+1];if(!M)return!1;let O=l[v-1].angleTo(R)-R.angleTo(M);for(O=Math.abs((O+3*Math.PI)%(2*Math.PI)-Math.PI),w.push({distance:x,angleDelta:O}),A+=O;x-w[0].distance>u;)A-=w.shift().angleDelta;if(A>f)return!1;v++,x+=R.dist(M)}return!0}function FD(l){let r=0;for(let s=0;s<l.length-1;s++)r+=l[s].dist(l[s+1]);return r}function BD(l,r,s){return l?.6*r*s:0}function zD(l,r){return Math.max(l?l.right-l.left:0,r?r.right-r.left:0)}function FW(l,r,s,u,f,g){const v=BD(s,f,g),x=zD(s,u)*g;let w=0;
vendor: 5,387 bytes, line 24
24const A=FD(l)/2;for(let R=0;R<l.length-1;R++){const M=l[R],O=l[R+1],B=M.dist(O);if(w+B>A){const N=(A-w)/B,G=Sn(M.x,O.x,N),H=Sn(M.y,O.y,N),J=new $d(G,H,0,O.angleTo(M),R);return!v||DD(l,J,x,v,r)?J:void 0}w+=B}}function BW(l,r,s,u,f,g,v,x,w){const A=BD(u,g,v),R=zD(u,f),M=R*v,O=l[0].x===0||l[0].x===w||l[0].y===0||l[0].y===w;return r-M<r/4&&(r=M+r/4),ND(l,O?r/2*x%r:(R/2+2*g)*v*x%r,r,A,s,M,O,!1,w)}function ND(l,r,s,u,f,g,v,x,w){const A=g/2,R=FD(l);let M=0,O=r-s,B=[];for(let N=0;N<l.length-1;N++){const G=l[N],H=l[N+1],J=G.dist(H),re=H.angleTo(G);for(;O+s<M+J;){O+=s;const Q=(O-M)/J,le=Sn(G.x,H.x,Q),ue=Sn(G.y,H.y,Q);if(le>=0&&le<w&&ue>=0&&ue<w&&O-A>=0&&O+A<=R){const he=new $d(le,ue,0,re,N);u&&!DD(l,he,g,u,f)||B.push(he)}}M+=J}return x||B.length||v||(B=ND(l,M/2,s,u,f,g,v,!0,w)),B}function VD(l){let r=0,s=0;for(const v of l)r+=v.w*v.h,s=Math.max(s,v.w);l.sort((v,x)=>x.h-v.h);const u=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(r/.95)),s),h:1/0}];let f=0,g=0;for(const v of l)for(let x=u.length-1;x>=0;x--){const w=u[x];if(!(v.w>w.w||v.h>w.h)){if(v.x=w.x,v.y=w.y,g=Math.max(g,v.y+v.h),f=Math.max(f,v.x+v.w),v.w===w.w&&v.h===w.h){const A=u.pop();A&&x<u.length&&(u[x]=A)}else v.h===w.h?(w.x+=v.w,w.w-=v.w):v.w===w.w?(w.y+=v.h,w.h-=v.h):(u.push({x:w.x+v.w,y:w.y,w:w.w-v.w,h:v.h}),w.y+=v.h,w.h-=v.h);break}}return{w:f,h:g,fill:r/(f*g)||0}}function bS(l,r){return l.id<r.id?-1:l.id>r.id?1:l.version<r.version?-1:l.version>r.version?1:l.sx<r.sx?-1:l.sx>r.sx?1:l.sy<r.sy?-1:l.sy>r.sy?1:0}function zA(l){let r=0;for(let s=0;s<l.length;s++)r=(r<<5)-r+l.charCodeAt(s),r&=r;return r}function Vc(l,r){return(l<<5)-l+r}function UD(l,r,s,u){for(const[f]of l.entries()){const g=u&&u.get(f)||$a.parse(f),v=g.id.toString(),x=r.get(v)||0;s.push({id:f,version:x,sx:g.sx,sy:g.sy})}}Kt($d,"Anchor");class NA{constructor(r,s,u,f,g){this.iconDescriptors=[],this.patternDescriptors=[],this.requiresMipMaps=s.size>0,UD(r,u,this.iconDescriptors,g),UD(s,u,this.patternDescriptors,g),this.iconDescriptors.sort(bS),this.patternDescriptors.sort(bS);let v=0;const x=f?f.data:"";x&&(v=Vc(v,zA(x))),v=Vc(v,1);for(const w of this.iconDescriptors)v=Vc(v,zA(w.id)),v=Vc(v,w.version),v=Vc(v,w.sx),v=Vc(v,w.sy);v=Vc(v,1);for(const w of this.patternDescriptors)v=Vc(v,zA(w.id)),v=Vc(v,w.version),v=Vc(v,w.sx),v=Vc(v,w.sy);this.hash=v}subsetOf(r){return this.isSubsetArray(this.iconDescriptors,r.iconDescriptors,bS)&&this.isSubsetArray(this.patternDescriptors,r.patternDescriptors,bS)}isSubsetArray(r,s,u){let f=0,g=0;if(r.length>s.length)return!1;for(;f<r.length&&g<s.length;){const v=u(r[f],s[g]);if(v===0)f++,g++;else{if(v<0)return!1;g++}}return f===r.length}}Kt(NA,"AtlasContentDescriptor");class Pv{static getImagePositionScale(r,s,u){if(s&&r){const{sx:f,sy:g}=r;return{x:f,y:g}}return{x:u,y:u}}constructor(r,s,u,f){this.paddedRect=r;const{pixelRatio:g,version:v,stretchX:x,stretchY:w,content:A,sdf:R,usvg:M}=s;this.pixelRatio=g,this.stretchX=x,this.stretchY=w,this.content=A,this.version=v,this.padding=u,this.sdf=R,this.usvg=M,this.scale=Pv.getImagePositionScale(f,M,g)}get tl(){return[this.paddedRect.x+this.padding,this.paddedRect.y+this.padding]}get br(){return[this.paddedRect.x+this.paddedRect.w-this.padding,this.paddedRect.y+this.paddedRect.h-this.padding]}get displaySize(){return[(this.paddedRect.w-2*this.padding)/this.scale.x,(this.paddedRect.h-2*this.padding)/this.scale.y]}}function VA(l,r,s){const u=$a.parse(l),f=(function(g,v,x=[1,1]){return{x:0,y:0,w:(g.data?g.data.width:g.width*x[0])+2*v,h:(g.data?g.data.height:g.height*x[1])+2*v}})(r,s,[u.sx,u.sy]);return{bin:f,imagePosition:new Pv(f,r,s,u),imageVariant:u}}function UA(l,r){const s=[];for(const[f,g]of l.entries()){const v=$a.parse(f);v&&(s.push({key:f,value:g,variant:v}),r&&r.set(f,v))}s.sort((f,g)=>{const v=f.variant.id.toString().localeCompare(g.variant.id.toString());return v!==0?v:f.variant.sx!==g.variant.sx?f.variant.sx-g.variant.sx:f.variant.sy!==g.variant.sy?f.variant.sy-g.variant.sy:0});const u=new Map;for(const f of s)u.set(f.key,f.value);return u}class $D{constructor(r){this.sourceAtlasHash=r}}class jD{constructor(r,s,u,f){const g=new Map,v=new Map;this.haveRenderCallbacks=[];const x=[],w=f!==void 0,A=w?new Map:void 0,R=w?UA(r,A):r,M=w?UA(s,A):s;this.addImages(R,g,1,x),this.addImages(M,v,2,x);const{w:O,h:B}=VD(x),N=new vr({width:O||1,height:B||1});for(const[G,H]of R.entries()){const J=g.get(G).paddedRect;vr.copy(H.data,N,{x:0,y:0},{x:J.x+1,y:J.y+1},H.data,null,H.sdf)}for(const[G,H]of M.entries()){const J=v.get(G),re=J.paddedRect;let Q=J.padding;const le=re.x+Q,ue=re.y+Q,he=H.data.width,Te=H.data.height;Q=Q>1?Q-1:Q,vr.copy(H.data,N,{x:0,y:0},{x:le,y:ue},H.data,u),vr.copy(H.data,N,{x:0,y:Te-Q},{x:le,y:ue-Q},{width:he,height:Q},u),vr.copy(H.data,N,{x:0,y:0},{x:le,y:ue+Te},{width:he,height:Q},u),vr.copy(H.data,N,{x:he-Q,y:0},{x:le-Q,y:ue},{width:Q,height:Te},u),vr.copy(H.data,N,{x:0,y:0},{x:le+he,y:ue},{width:Q,height:Te},u),vr.copy(H.data,N,{x:he-Q,y:Te-Q},{x:le-Q,y:ue-Q},{width:Q,height:Q},u),vr.copy(H.data,N,{x:0,y:Te-Q},{x:le+he,y:ue-Q},{width:Q,height:Q},u),vr.copy(H.data,N,{x:0,y:0},{x:le+he,y:ue+Te},{width:Q,height:Q},u),vr.copy(H.data,N,{x:he-Q,y:0},{x:le-Q,y:ue+Te},{width:Q,height:Q},u)}this.lut=u,this.image=N,this.iconPositions=g,this.patternPositions=v,w&&(this.contentDescriptor=new NA(R,M,f,u,A))}addImages(r,s,u,f){for(const[g,v]of r.entries()){const{bin:x,imagePosition:w,imageVariant:A}=VA(g,v,u);
24s.set(g,w),f.push(x),v.hasRenderCallback&&this.haveRenderCallbacks.push(A.id)}}patchUpdatedImages(r,s,u,f){this.haveRenderCallbacks=this.haveRenderCallbacks.filter(g=>r.hasImage(g,u)),r.dispatchRenderCallbacks(this.haveRenderCallbacks,u);for(const g of r.getUpdatedImages(u)){for(const v of this.iconPositions.keys()){const x=$a.parse(v);if(is.isEqual(x.id,g)){const w=r.getImage(g,u);this.patchUpdatedImage(this.iconPositions.get(v),w,s,null)}}for(const v of this.patternPositions.keys()){const x=$a.parse(v);if(is.isEqual(x.id,g)){const w=r.getImage(g,u);this.patchUpdatedImage(this.patternPositions.get(v),w,s,f||this.lut)}}}}patchUpdatedImage(r,s,u,f=null){if(!r||!s||r.version===s.version)return;r.version=s.version;const[g,v]=r.tl,x=r.sdf;if(this.lut||x){const w={width:s.data.width,height:s.data.height},A=new vr(w);vr.copy(s.data,A,{x:0,y:0},{x:0,y:0},w,f,x),u.update(A,{position:{x:g,y:v},recreateWhenResize:!1})}else u.update(s.data,{position:{x:g,y:v},recreateWhenResize:!1})}}Kt(Pv,"ImagePosition"),Kt(jD,"ImageAtlas",{omit:["lut"]}),Kt($D,"ImageAtlasReference");class Rv{constructor(r){this.pendingRequests=new Map,this.cachedRanges=new Map,this.fontstackCompositing=r&&r.fontstackCompositing||"client"}loadGlyphRange(r,s,u,f,g){if(this.fontstackCompositing==="server")return void Rv.loadGlyphRange(r,s,u,f,g);const v=r.split(",").map(x=>x.trim()).filter(x=>x.length>0);v.length!==0?v.length!==1?this._loadMultipleFonts(v,s,u,f,g):this._loadFont(v[0],s,u,f,g):g(new Error("Empty fontstack"))}_loadMultipleFonts(r,s,u,f,g){const v=r.map(()=>null),x={completed:0,firstError:null,callbackCalled:!1},w=(A,R,M)=>{if(!x.callbackCalled&&(R&&!x.firstError&&(x.firstError=R),M&&(v[A]=M),x.completed++,x.completed===r.length)){x.callbackCalled=!0;const O=v.filter(N=>N!==null);if(O.length===0)return void g(x.firstError||new Error("All fonts failed to load"));const B=this._composeGlyphs(O);g(null,B)}};for(let A=0;A<r.length;A++)this._loadFont(r[A],s,u,f,(R,M)=>{w(A,R,M)})}_loadFont(r,s,u,f,g){const v=`${r}:${s}`;if(this.cachedRanges.has(v)){const w=this.cachedRanges.get(v);return void Qs.frame(()=>g(null,w))}const x=this.pendingRequests.get(v);x?x.push(g):(this.pendingRequests.set(v,[g]),Rv.loadGlyphRange(r,s,u,f,(w,A)=>{w||this.cachedRanges.set(v,A||null);const R=this.pendingRequests.get(v);if(this.pendingRequests.delete(v),R)for(const M of R)M(w,A)}))}_composeGlyphs(r){const s={};let u,f;for(const g of r)if(u===void 0&&g.ascender!==void 0&&(u=g.ascender),f===void 0&&g.descender!==void 0&&(f=g.descender),g.glyphs)for(const v in g.glyphs)s[v]===void 0&&(s[v]=g.glyphs[v]);
vendor: 7,694 bytes, line 24
24return{glyphs:s,ascender:u,descender:f}}}Rv.loadGlyphRange=function(l,r,s,u,f){const g=256*r,v=g+255,x=u.transformRequest(u.normalizeGlyphsURL(s).replace("{fontstack}",l).replace("{range}",`${g}-${v}`),pd.Glyphs);Ph(x,(w,A)=>{if(w)f(w);else if(A){const R={},M=(function(O){return new _S(O).readFields(kW,{})})(A);for(const O of M.glyphs)R[O.id]=O;f(null,{glyphs:R,ascender:M.ascender,descender:M.descender})}})};const kv=1e20,$A=new Float64Array(256);for(let l=0;l<256;l++){const r=.5-Math.pow(l/255,.45454545454545453);$A[l]=r*Math.abs(r)}function GD(l,r,s,u,f,g,v,x,w){for(let A=r;A<r+u;A++)HD(l,s*g+A,g,f,v,x,w);for(let A=s;A<s+f;A++)HD(l,A*g+r,1,u,v,x,w)}function HD(l,r,s,u,f,g,v){g[0]=0,v[0]=-kv,v[1]=kv,f[0]=l[r];for(let x=1,w=0,A=0;x<u;x++){f[x]=l[r+x*s];const R=x*x;do{const M=g[w];A=(f[x]-f[M]+R-M*M)/(x-M)/2}while(A<=v[w]&&--w>-1);w++,g[w]=x,v[w]=A,v[w+1]=kv}for(let x=0,w=0;x<u;x++){for(;v[w+1]<x;)w++;const A=g[w],R=x-A;l[r+x*s]=f[A]+R*R}}$A[255]=-kv;const zW=/bold/i,NW=/medium/i,VW=/light/i,jA={none:0,ideographs:1,all:2};class xS{constructor(r,s,u,f){this.requestManager=r,this.localGlyphMode=s,this.localFontFamily=u,this.url="",this.entries={},this.localGlyphs={200:{},400:{},500:{},900:{}},this.glyphLoader=new Rv({fontstackCompositing:f})}setURL(r){this.url=r}prefetchRange(r,s){const u=this.url||Xr.GLYPHS_URL;if(!u)return;let f=this.entries[r];f||(f=this.entries[r]={glyphs:{},requests:{},ranges:{}}),f.ranges[s]||f.requests[s]||(f.requests[s]=[],this.glyphLoader.loadGlyphRange(r,s,u,this.requestManager,(g,v)=>{if(v){f.ascender=v.ascender,f.descender=v.descender;for(const x in v.glyphs)this._doesCharSupportLocalGlyph(+x)||(f.glyphs[+x]=v.glyphs[+x]);f.ranges[s]=!0}for(const x of f.requests[s]||[])x(g,v);delete f.requests[s]}))}getGlyphs(r,s){const u=[],f=this.url||Xr.GLYPHS_URL;for(const g in r)for(const v of r[g])u.push({stack:g,id:v});vt(u,({stack:g,id:v},x)=>{let w=this.entries[g];w||(w=this.entries[g]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let A=w.glyphs[v];if(A!==void 0)return void x(null,{stack:g,id:v,glyph:A});if(A=this._tinySDF(w,g,v),A)return w.glyphs[v]=A,void x(null,{stack:g,id:v,glyph:A});const R=Math.floor(v/256);if(256*R>65535)return On("glyphs > 65535 not supported"),void x(null,{stack:g,id:v,glyph:A});if(w.ranges[R])return void x(null,{stack:g,id:v,glyph:A});let M=w.requests[R];M||(M=w.requests[R]=[],this.glyphLoader.loadGlyphRange(g,R,f,this.requestManager,(O,B)=>{if(B){w.ascender=B.ascender,w.descender=B.descender;for(const N in B.glyphs)this._doesCharSupportLocalGlyph(+N)||(w.glyphs[+N]=B.glyphs[+N]);w.ranges[R]=!0}for(const N of M)N(O,B);delete w.requests[R]})),M.push((O,B)=>{O?x(O):B&&x(null,{stack:g,id:v,glyph:B.glyphs[v]||null})})},(g,v)=>{if(g)s(g);else if(v){const x={};for(const{stack:w,id:A,glyph:R}of v)x[w]===void 0&&(x[w]={}),x[w].glyphs===void 0&&(x[w].glyphs={}),x[w].glyphs[A]=R&&{id:R.id,bitmap:R.bitmap.clone(),metrics:R.metrics},x[w].ascender=this.entries[w].ascender,x[w].descender=this.entries[w].descender;s(null,x)}})}_doesCharSupportLocalGlyph(r){return this.localGlyphMode!==jA.none&&(this.localGlyphMode===jA.all?!!this.localFontFamily:!!this.localFontFamily&&(Jh(r)||nw(r)||Rg(r)||kg(r)||Pg(r)||T0(r)||(s=r)>=131072&&s<=173791||(u=>u>=66736&&u<=66815)(r)));var s}_tinySDF(r,s,u){const f=this.localFontFamily;if(!f||!this._doesCharSupportLocalGlyph(u))return;let g=r.tinySDF;if(!g){let H="400";zW.test(s)?H="900":NW.test(s)?H="500":VW.test(s)&&(H="200"),g=r.tinySDF=new xS.TinySDF({fontFamily:f,fontWeight:H,fontSize:48,buffer:6,radius:16}),g.fontWeight=H}const v=g.fontWeight;if(this.localGlyphs[v][u])return this.localGlyphs[v][u];const x=String.fromCodePoint(u),{data:w,width:A,height:R,glyphWidth:M,glyphHeight:O,glyphLeft:B,glyphTop:N,glyphAdvance:G}=g.draw(x);return this.localGlyphs[v][u]={id:u,bitmap:new cs({width:A,height:R},w),metrics:{width:M/2,height:O/2,left:B/2,top:N/2-27,advance:G/2,localGlyph:!0}}}}function WD(l,r){return l+r[1]-r[0]}function GA(l,r,s,u,f=1){const g=[],v=l.imagePrimary,x=v.pixelRatio,w=v.paddedRect.w-2,A=v.paddedRect.h-2,R=(l.right-l.left)*f,M=(l.bottom-l.top)*f,O=v.stretchX||[[0,w]],B=v.stretchY||[[0,A]],N=O.reduce(WD,0),G=B.reduce(WD,0),H=w-N,J=A-G;let re=0,Q=N,le=0,ue=G,he=0,Te=H,me=0,xe=J;if(v.content&&u){const we=v.content;re=wS(O,0,we[0]),le=wS(B,0,we[1]),Q=wS(O,we[0],we[2]),ue=wS(B,we[1],we[3]),he=we[0]-re,me=we[1]-le,Te=we[2]-we[0]-Q,xe=we[3]-we[1]-ue}const _e=(we,je,He,Qe)=>{const it=SS(we.stretch-re,Q,R,l.left*f),nt=TS(we.fixed-he,Te,we.stretch,N),bt=SS(je.stretch-le,ue,M,l.top*f),Ze=TS(je.fixed-me,xe,je.stretch,G),et=SS(He.stretch-re,Q,R,l.left*f),ot=TS(He.fixed-he,Te,He.stretch,N),ft=SS(Qe.stretch-le,ue,M,l.top*f),_t=TS(Qe.fixed-me,xe,Qe.stretch,G),Ft=new St(it,bt),ut=new St(et,bt),At=new St(et,ft),It=new St(it,ft),Xt=new St(nt/x,Ze/x),Yt=new St(ot/x,_t/x),gn=r*Math.PI/180;if(gn){const Zn=Math.sin(gn),Pi=Math.cos(gn),Cr=[Pi,-Zn,Zn,Pi];Ft._matMult(Cr),ut._matMult(Cr),It._matMult(Cr),At._matMult(Cr)}const on=we.stretch+we.fixed,En=He.stretch+He.fixed,_r=je.stretch+je.fixed,Nn=Qe.stretch+Qe.fixed,sr=l.imageSecondary;return{tl:Ft,tr:ut,bl:It,br:At,texPrimary:{x:v.paddedRect.x+1+on,y:v.paddedRect.y+1+_r,w:En-on,h:Nn-_r},texSecondary:sr?{x:sr.paddedRect.x+1+on,y:sr.paddedRect.y+1+_r,w:En-on,h:Nn-_r}:void 0,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Xt,pixelOffsetBR:Yt,minFontScaleX:Te/x/R,minFontScaleY:xe/x/M,isSDF:s}};if(v.stretchX||v.stretchY){const we=qD(O,H,N),je=qD(B,J,G);for(let He=0;He<we.length-1;He++){const Qe=we[He],it=we[He+1];for(let nt=0;nt<je.length-1;nt++)g.push(_e(Qe,je[nt],it,je[nt+1]))}}else g.push(_e({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:w+1},{fixed:0,stretch:A+1}));return g}function UW(l,r){const s=l.stretchY||[[0,l.paddedRect.h-2]];return l.stretchX||l.stretchY?XD(l.stretchX||[[0,l.paddedRect.w-2]])*XD(s):1}function wS(l,r,s){let u=0;for(const f of l)u+=Math.max(r,Math.min(s,f[1]))-Math.max(r,Math.min(s,f[0]));return u}function qD(l,r,s){const u=[{fixed:-1,stretch:0}];for(const[f,g]of l){const v=u.at(-1);u.push({fixed:f-v.stretch,stretch:v.stretch}),u.push({fixed:f-v.stretch,stretch:v.stretch+(g-f)})}return u.push({fixed:r+1,stretch:s}),u}function XD(l){return 2*l.length+1}function SS(l,r,s,u){return l/r*s+u}function TS(l,r,s,u){return l-r*s/u}function $W(l,r,s,u){const f=r+l.positionedLines[u].lineOffset;return u===0?s+f/2:s+(f+(r+l.positionedLines[u-1].lineOffset))/2}function ZD(l,r,s,u,f,g,v,x,w,A=1){const R=[];if(r.positionedLines.length===0)return R;const M=(w!==void 0?w:u.layout.get("text-rotate").evaluate(g,{}))*Math.PI/180,O=(function(J){const re=J[0],Q=J[1],le=re*Q;return le>0?[re,-Q]:le<0?[-re,Q]:re===0?[Q,re]:[Q,-re]})(s);let B=Math.abs(r.top-r.bottom);for(const J of r.positionedLines)B-=J.lineOffset;const N=r.positionedLines.length,G=B/N;let H=r.top-s[1];for(let J=0;J<N;++J){const re=r.positionedLines[J];H=$W(r,G,H,J);for(const Q of re.positionedGlyphs){if(!Q.rect)continue;const le=Q.rect||{};let ue=4,he=!0,Te=1,me=0;if(Q.image){const At=v.get(Q.image.toString());if(!At)continue;if(At.sdf){On("SDF images are not supported in formatted text and will be ignored.");continue}he=!1,Te=At.pixelRatio,ue=1/Te,At.usvg||(Te/=A)}const xe=(f||x)&&Q.vertical,_e=Q.metrics.advance*Q.scale/2,we=Q.metrics,je=Q.rect;if(je===null)continue;x&&r.verticalizable&&(me=Q.image?_e-Q.metrics.width*Q.scale/2:0);const He=f?[Q.x+_e,Q.y]:[0,0];let Qe=[0,0],it=[0,0],nt=!1;f||(xe?(it=[Q.x+_e+O[0],Q.y+O[1]-me],nt=!0):Qe=[Q.x+_e+s[0],Q.y+s[1]-me]);const bt=je.w*Q.scale/(Te*(Q.localGlyph?2:1)),Ze=je.h*Q.scale/(Te*(Q.localGlyph?2:1));let et,ot,ft,_t;if(xe){const At=Q.y-H,It=new St(-_e,_e-At),Xt=-Math.PI/2,Yt=new St(...it);
24et=new St(-_e+Qe[0],Qe[1]),et._rotateAround(Xt,It)._add(Yt),et.x+=-At+_e,et.y-=(we.left-ue)*Q.scale;const gn=Q.image?we.advance*Q.scale:Eo*Q.scale,on=String.fromCodePoint(Q.glyph);bW(on)?et.x+=(1-ue)*Q.scale:xW(on)?et.x+=gn-we.height*Q.scale+(-ue-1)*Q.scale:et.x+=Q.image||we.width+2*ue===je.w&&we.height+2*ue===je.h?(gn-Ze)/2:(gn-(we.height+2*ue)*Q.scale)/2,ot=new St(et.x,et.y-bt),ft=new St(et.x+Ze,et.y),_t=new St(et.x+Ze,et.y-bt)}else{const At=(we.left-ue)*Q.scale-_e+Qe[0],It=(-we.top-ue)*Q.scale+Qe[1],Xt=At+bt,Yt=It+Ze;et=new St(At,It),ot=new St(Xt,It),ft=new St(At,Yt),_t=new St(Xt,Yt)}if(M){let At;At=f?new St(0,0):nt?new St(O[0],O[1]):new St(s[0],s[1]),et._rotateAround(M,At),ot._rotateAround(M,At),ft._rotateAround(M,At),_t._rotateAround(M,At)}const Ft=new St(0,0),ut=new St(0,0);R.push({tl:et,tr:ot,bl:ft,br:_t,texPrimary:le,texSecondary:void 0,writingMode:r.writingMode,glyphOffset:He,sectionIndex:Q.sectionIndex,isSDF:he,pixelOffsetTL:Ft,pixelOffsetBR:ut,minFontScaleX:0,minFontScaleY:0})}}return R}function jW(l,r=1,s=!1){let u=1/0,f=1/0,g=-1/0,v=-1/0;const x=l[0];for(let B=0;B<x.length;B++){const N=x[B];(!B||N.x<u)&&(u=N.x),(!B||N.y<f)&&(f=N.y),(!B||N.x>g)&&(g=N.x),(!B||N.y>v)&&(v=N.y)}const w=Math.min(g-u,v-f);let A=w/2;const R=new Ep([],GW);if(w===0)return new St(u,f);for(let B=u;B<g;B+=w)for(let N=f;N<v;N+=w)R.push(new u_(B+A,N+A,A,l));let M=(function(B){let N=0,G=0,H=0;const J=B[0];for(let re=0,Q=J.length,le=Q-1;re<Q;le=re++){const ue=J[re],he=J[le],Te=ue.x*he.y-he.x*ue.y;G+=(ue.x+he.x)*Te,H+=(ue.y+he.y)*Te,N+=3*Te}return new u_(G/N,H/N,0,B)})(l),O=R.length;for(;R.length;){const B=R.pop();(B.d>M.d||!M.d)&&(M=B,s&&console.log("found best %d after %d probes",Math.round(1e4*B.d)/1e4,O)),B.max-M.d<=r||(A=B.h/2,R.push(new u_(B.p.x-A,B.p.y-A,A,l)),R.push(new u_(B.p.x+A,B.p.y-A,A,l)),R.push(new u_(B.p.x-A,B.p.y+A,A,l)),R.push(new u_(B.p.x+A,B.p.y+A,A,l)),O+=4)}return s&&(console.log(`num probes: ${O}`),console.log(`best distance: ${M.d}`)),M.p}function GW(l,r){return r.max-l.max}xS.TinySDF=class{constructor({fontSize:l=24,buffer:r=3,radius:s=8,cutoff:u=.25,fontFamily:f="sans-serif",fontWeight:g="normal",fontStyle:v="normal",lang:x=null}={}){this.buffer=r,this.radius=s,this.cutoff=u,this.lang=x;const w=this.size=l+4*r,A=this._createCanvas(w),R=this.ctx=A.getContext("2d",{willReadFrequently:!0});R.font=`${v} ${g} ${l}px ${f}`,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(l){if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(l,l);const r=document.createElement("canvas");return r.width=r.height=l,r}draw(l){const{width:r,actualBoundingBoxAscent:s,actualBoundingBoxDescent:u,actualBoundingBoxLeft:f,actualBoundingBoxRight:g}=this.ctx.measureText(l),v=Math.ceil(s),x=Math.floor(f),w=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(g)-x)),A=Math.max(0,Math.min(this.size-this.buffer,v+Math.ceil(u))),R=w+2*this.buffer,M=A+2*this.buffer,O=Math.max(R*M,0),B=new Uint8ClampedArray(O),N={data:B,width:R,height:M,glyphWidth:w,glyphHeight:A,glyphTop:v,glyphLeft:x,glyphAdvance:r};if(w===0||A===0)return N;const{ctx:G,buffer:H,gridInner:J,gridOuter:re}=this;this.lang&&(G.lang=this.lang),G.clearRect(H,H,w,A),G.fillText(l,H-x,H+v);const Q=G.getImageData(H,H,w,A);re.fill(kv,0,O),J.fill(0,0,O);let le=3;for(let Te=0;Te<A;Te++){let me=(Te+H)*R+H;for(let xe=0;xe<w;xe++,le+=4,me++){const _e=Q.data[le];if(_e===0)continue;const we=$A[_e];re[me]=Math.max(0,we),J[me]=Math.max(0,-we)}}GD(re,0,0,R,M,R,this.f,this.v,this.z),GD(J,H,H,w,A,R,this.f,this.v,this.z);const ue=255/this.radius,he=255*(1-this.cutoff);for(let Te=0;Te<O;Te++){const me=Math.sqrt(re[Te])-Math.sqrt(J[Te]);B[Te]=Math.round(he-ue*me)}return N}};class u_{constructor(r,s,u,f){this.p=new St(r,s),this.h=u,this.d=(function(g,v){let x=!1,w=1/0;for(let A=0;A<v.length;A++){const R=v[A];for(let M=0,O=R.length,B=O-1;M<O;B=M++){const N=R[M],G=R[B];N.y>g.y!=G.y>g.y&&g.x<(G.x-N.x)*(g.y-N.y)/(G.y-N.y)+N.x&&(x=!x),w=Math.min(w,Z(g,N,G))}}return(x?1:-1)*Math.sqrt(w)})(this.p,f),this.max=this.d+this.h*Math.SQRT2}}const HW=Object.keys,HA=Number.POSITIVE_INFINITY,WW=Math.sqrt(2);function pf(l,r,s,u,f,g){const v=DA(l)&&l.collisionPadding?l.collisionPadding:[0,0,0,0],x={top:l.top-v[1],bottom:l.bottom+v[3],left:l.left-v[0],right:l.right+v[2],scaled:!1};return u!==void 0&&(function(w,A){w.top*=A,w.bottom*=A,w.left*=A,w.right*=A,w.scaled=!0})(x,u),g&&(x.left+=g[0],x.right+=g[0],x.top+=g[1],x.bottom+=g[1]),s&&(function(w,A,R){
24if(!A)return;const M=ae(A),O=new St(R?R[0]:0,R?R[1]:0),B=new St(w.left,w.top),N=new St(w.right,w.top),G=new St(w.left,w.bottom),H=new St(w.right,w.bottom);B._rotateAround(M,O),N._rotateAround(M,O),G._rotateAround(M,O),H._rotateAround(M,O),w.left=Math.min(B.x,N.x,G.x,H.x),w.right=Math.max(B.x,N.x,G.x,H.x),w.top=Math.min(B.y,N.y,G.y,H.y),w.bottom=Math.max(B.y,N.y,G.y,H.y)})(x,s,f),r?{top:Math.min(r.top,x.top),bottom:Math.max(r.bottom,x.bottom),left:Math.min(r.left,x.left),right:Math.max(r.right,x.right),scaled:r.scaled||x.scaled}:x}function YD(l,[r,s]){let u=0,f=0;if(s===HA){r<0&&(r=0);const g=r/WW;switch(l){case"top-right":case"top-left":f=g-7;break;case"bottom-right":case"bottom-left":f=7-g;break;case"bottom":f=7-r;break;case"top":f=r-7}switch(l){case"top-right":case"bottom-right":u=-g;break;case"top-left":case"bottom-left":u=g;break;case"left":u=r;break;case"right":u=-r}}else{switch(r=Math.abs(r),s=Math.abs(s),l){case"top-right":case"top-left":case"top":f=s-7;break;case"bottom-right":case"bottom-left":case"bottom":f=7-s}switch(l){case"top-right":case"bottom-right":case"right":u=-r;break;case"top-left":case"bottom-left":case"left":u=r}}return[u,f]}function qW(l,r,s,u,f,g,v,x,w,A,R,M,O,B,N){const G=l.layers[0],H=G.appearances;if(H.length===0)return{iconBBox:null,iconVerticalBBox:null,textBBox:null,textVerticalBBox:null};const J={iconBBox:null,iconVerticalBBox:null},re={textBBox:null,textVerticalBBox:null},{baseIconRotate:Q,baseTextRotate:le,iconScaleFactor:ue}=(function(Te,me,xe){const _e=Te.get("icon-rotate").evaluate(me,{},xe),we=Te.get("text-rotate").evaluate(me,{},xe),[je,He]=Te.get("icon-size-scale-range");return{baseIconRotate:_e,baseTextRotate:we,iconScaleFactor:Ee(1,je,He)}})(u,f,g);r&&(J.iconBBox=pf(r,J.iconBBox,Q),s)&&(J.iconVerticalBBox=pf(s,J.iconVerticalBBox,Q+90));const he=CS(M.horizontal);he&&(re.textBBox=pf(he,re.textBBox,le,1,B)),M.vertical&&(re.textVerticalBBox=pf(M.vertical,re.textVerticalBBox,le+90,1,B));for(const Te of H)Te.hasIconLayoutProperties()&&XW(J,l,G,Te,f,g,x,Q,v,w,r,A,ue,R,N),Te.hasTextLayoutProperties()&&ZW(re,G,Te,f,g,B,le,O,he,M.vertical);return{iconBBox:J.iconBBox,iconVerticalBBox:J.iconVerticalBBox,textBBox:re.textBBox,textVerticalBBox:re.textVerticalBBox}}function XW(l,r,s,u,f,g,v,x,w,A,R,M,O,B,N){const{appearanceIconOffset:G,appearanceIconRotate:H,appearanceIconSize:J}=KD(u,s,f,g,v,x,w,A.iconScaleFactor);let re=null,Q=null,le=null;u.hasLayoutProperty("icon-image")?le=(function(he,Te,me,xe,_e,we,je,He){let Qe=null;const it=Te.getAppearanceValueAndResolveTokens(me,"icon-image",xe,_e,He);if(it){const nt=he.getResolvedImageFromTokens(it),bt=me.hasLayoutProperty("icon-size")?me.getUnevaluatedLayoutProperty("icon-size"):Te._unevaluatedLayout._values["icon-size"],Ze=Mv(nt,nm(he.zoom,bt,he.worldview,He),bt,_e,he.zoom,xe,he.pixelRatio,je,he.worldview,He);Qe=we.get(Ze.iconPrimary.toString())}return Qe})(r,s,u,f,g,M,O,N):R&&(le=R.imagePrimary),le&&(re=vS(le,null,G,B),r.allowVerticalPlacement&&(Q=vS(le,null,G,B)));const ue=w>0?J/w:1;re&&(l.iconBBox=pf(re,l.iconBBox,H,ue!==1?ue:void 0)),Q&&(l.iconVerticalBBox=pf(Q,l.iconVerticalBBox,H+90,ue!==1?ue:void 0))}function KD(l,r,s,u,f,g,v,x){const w=l.hasLayoutProperty("icon-offset")?r.getAppearanceValueAndResolveTokens(l,"icon-offset",s,u,[]):null,A=w&&Array.isArray(w)?w:f,R=l.hasLayoutProperty("icon-rotate")?r.getAppearanceValueAndResolveTokens(l,"icon-rotate",s,u,[]):null,M=typeof R=="number"?R:g,O=l.hasLayoutProperty("icon-size")?r.getAppearanceValueAndResolveTokens(l,"icon-size",s,u,[]):null;return{appearanceIconOffset:A,appearanceIconRotate:M,appearanceIconSize:typeof O=="number"?O*x:v}}function ZW(l,r,s,u,f,g,v,x,w,A){const{appearanceTextOffset:R,appearanceTextRotate:M,appearanceTextSize:O}=JD(s,r,u,f,g,v,x),B=O/x,N=[(R[0]-g[0])*B,(R[1]-g[1])*B],G=N[0]!==0||N[1]!==0;w&&(l.textBBox=pf(w,l.textBBox,M,B,R,G?N:void 0)),A&&(l.textVerticalBBox=pf(A,l.textVerticalBBox,M+90,B,R,G?N:void 0))}function JD(l,r,s,u,f,g,v){const x=l.hasLayoutProperty("text-offset")?r.getAppearanceValueAndResolveTokens(l,"text-offset",s,u,[]):null,w=x&&Array.isArray(x)?[x[0]*Eo,x[1]*Eo]:f,A=l.hasLayoutProperty("text-rotate")?r.getAppearanceValueAndResolveTokens(l,"text-rotate",s,u,[]):null,R=typeof A=="number"?A:g,M=l.hasLayoutProperty("text-size")?r.getAppearanceValueAndResolveTokens(l,"text-size",s,u,[]):null;return{appearanceTextOffset:w,appearanceTextRotate:R,appearanceTextSize:typeof M=="number"?M:v}}
24function ES(l,r,s,u,f,g,v,x,w){if(!r||!r.usvg)return;const A=OD(u),R=OD(f),M=g!=="both"&&g!=="width"||!MD(u)?1:R.width/A.width,O=g!=="both"&&g!=="height"||!LD(u)?1:R.height/A.height;s.scaleSelf(M,O);const B=s.toString();v.set(B,s),x.set(B,r);const{imagePosition:N}=VA(B,r,1);w.set(B,N)}function QD(l,r,s,u,f,g,v,x,w,A){if(!l)return;const R=(function(M,O,B,N,G,H,J){if(M.kind==="camera")return M.maxSize;if(M.kind==="composite"){const re=O.possiblyEvaluate(new Tr(M.maxZoom,{worldview:H}),B,J).evaluate(G,{},B,J),Q=O.possiblyEvaluate(new Tr(M.minZoom,{worldview:H}),B,J).evaluate(G,{},B,J);return Math.max(re,Q)}return O.possiblyEvaluate(new Tr(N,{worldview:H}),B,J).evaluate(G,{},B,J)})(r,s,u,f,g,w,A);return l.scaleSelf(R*x*v)}function Mv(l,r,s,u,f,g,v,x,w,A){return{iconPrimary:QD(l.getPrimary(),r,s,u,f,g,v,x,w,A),iconSecondary:QD(l.getSecondary(),r,s,u,f,g,v,x,w,A)}}function YW(l,r,s){if(!r)return;const u=s.get(l.toString()),f=s.get(r.toString());u&&f&&(u.paddedRect.w===f.paddedRect.w&&u.paddedRect.h===f.paddedRect.h||On(`Mismatch in icon variant sizes: ${l.toString()} and ${r.toString()}`),u.usvg!==f.usvg&&On(`Mismatch in icon variant image types: ${l.id} and ${r.id}`))}function eF(l,r,s,u){if(!l)return;const f=r.get(s.toString());if(f&&(l.imagePrimary=f),u){const g=r.get(u.toString());l.imageSecondary=g}}function KW(l,r){for(const s in l.horizontal)tF(l.horizontal[s],r);tF(l.vertical,r)}function tF(l,r){if(l){for(const s of l.positionedLines)for(const u of s.positionedGlyphs)if(u.image!==null){const f=u.image.toString();u.rect=r.get(f).paddedRect}}}function WA(l){switch(l){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function JW(l,r,s,u,f,g,v,x,w){const A=CS(g.horizontal)||g.vertical,R=s.get("icon-text-fit-padding").evaluate(u,{},f);let M,O=r;return r&&w!=="none"&&(l.allowVerticalPlacement&&g.vertical&&(M=FA(r,g.vertical,w,R,x,v)),A&&(O=FA(r,A,w,R,x,v))),{defaultShapedIcon:O,verticallyShapedIcon:M}}function nF(l,r){return l*r/24}function QW(l,r,s,u,f,g,v,x,w,A,R,M,O,B,N,G,H,J,re,Q,le,ue,he,Te){let me=v.textMaxSize.evaluate(r,{},O);me===void 0?me=x*v.textScaleFactor:me*=v.textScaleFactor;const xe=l.layers[0].layout,_e=nF(x,v.textScaleFactor),we=CS(s.horizontal)||s.vertical,je=l.hasAnyAppearanceLayoutProperty(["text-size","text-offset","text-rotate"]),He=l.getAppearanceFeatureData(r.index);(H!=="none"||je)&&He&&(He.textShaping=we,He.iconTextFitPadding=xe.get("icon-text-fit-padding").evaluate(r,{},O),He.fontScale=_e,He.textScaleFactor=v.textScaleFactor);const Qe=B.name==="globe",it=l.tilePixelRatio*me/24,nt=(_t=l.overscaling,l.zoom>18&&_t>2&&(_t>>=1),Math.max(Bt/(512*_t),1)*xe.get("symbol-spacing")),bt=xe.get("text-padding")*l.tilePixelRatio,Ze=xe.get("icon-padding")*l.tilePixelRatio,et=ae(xe.get("text-max-angle")),ot=xe.get("icon-rotation-alignment")==="map"&&Q!=="point",ft=nt/2;var _t;l.hasAnyIconTextFit===!1&&H!=="none"&&(l.hasAnyIconTextFit=!0);const Ft=r.properties?+r.properties[Bd]:null,ut=Ft&&l.elevationFeatureIdToIndex?l.elevationFeatureIdToIndex.get(Ft):65535,At=(It,Xt,Yt)=>{if(Xt.x<0||Xt.x>=Bt||Xt.y<0||Xt.y>=Bt)return;let gn=null;if(Qe){const{x:on,y:En,z:_r}=B.projectTilePoint(Xt.x,Xt.y,Yt);gn={anchor:new $d(on,En,_r,0,void 0),up:B.upVector(Yt,Xt.x,Xt.y)}}(function(on,En,_r,Nn,sr,Zn,Pi,Cr,gr,jr,mi,Co,Yr,Ri,oo,Ki,so,Qn,Ko,Ms,Gi,Do,bs,Jo,yi,mo,ca,g_,Vs,fI,Hv,Wv){const jd=on.addToLineVertexArray(En,Nn);let Ja,El,vf,bf,er,Fo,ki,go=0,Cl=0,Ma=0,Qa=0,La=-1,qv=-1;const sc={};let __=tg("");const Uu=_r?_r.anchor:En,y_=g_!=="none";let ao=0,$o=0;if(gr._unevaluatedLayout.getValue("text-radial-offset")===void 0){const Qo=gr.layout.get("text-offset").evaluate(Gi,{},yi);ao=Qo[0]*Eo,$o=Qo[1]*Eo}else ao=gr.layout.get("text-radial-offset").evaluate(Gi,{},yi)*Eo,$o=HA;if(on.allowVerticalPlacement&&sr.vertical){const Qo=sr.vertical;if(oo)Fo=ZA(Qo),Cr&&(ki=ZA(Cr));else{const xs=gr.layout.get("text-rotate").evaluate(Gi,{},yi)+90;vf=AS(jr,Uu,En,mi,Co,Yr,Qo,Ri,xs,Ki,Wv),Cr&&(bf=AS(jr,Uu,En,mi,Co,Yr,Cr,Qn,xs,null,Hv))}}if(Zn){const Qo=gr.layout.get("icon-rotate").evaluate(Gi,{},yi),xs=GA(Zn,Qo,bs,y_,Do.iconScaleFactor),tl=Cr?GA(Cr,Qo,bs,y_,Do.iconScaleFactor):void 0;El=AS(jr,Uu,En,mi,Co,Yr,Zn,Qn,Qo,null,fI);const $u=(function(jc,Xv,hB,Zq,Yq,fB,pB,Kq,kLe,gI){const mB=jc.layers[0],gB=mB.appearances;let b_=Xv.length;
24if(hB&&(b_=Math.max(b_,hB.length)),gB.length===0)return b_;const[Jq,Qq]=Zq.get("icon-size-scale-range"),eX=Ee(1,Jq,Qq);for(const $S of gB)if($S.hasLayoutProperty("icon-image")){const _B=mB.getAppearanceValueAndResolveTokens($S,"icon-image",fB,pB,gI);if(_B){const yB=jc.getResolvedImageFromTokens(_B);if(yB){const vB=$S.hasLayoutProperty("icon-size")?$S.getUnevaluatedLayoutProperty("icon-size"):Yq._values["icon-size"],tX=Mv(yB,nm(jc.zoom,vB,jc.worldview,gI),vB,pB,jc.zoom,fB,jc.pixelRatio,eX,jc.worldview,gI),bB=Kq.get(tX.iconPrimary.toString());bB&&(b_=Math.max(b_,UW(bB)))}}}return b_})(on,xs,tl,gr.layout,gr._unevaluatedLayout,Gi,yi,on.iconAtlasPositions,0,Jo);go=4*$u;const US=gr.layout.get("icon-size").evaluate(Gi,{},yi,Jo),pI=Do.compositeIconSizes?Do.compositeIconSizes[0].evaluate(Gi,{},yi,Jo):0,mI=Do.compositeIconSizes?Do.compositeIconSizes[1].evaluate(Gi,{},yi,Jo):0,v_=XA(on.layerIds[0],on.iconSizeData,US,Zn.imagePrimary.usvg?1:Do.iconScaleFactor,pI,mI);on.addSymbols(on.icon,xs,v_,Ms,Ko,Gi,void 0,_r,En,jd.lineStartIndex,jd.lineLength,-1,Jo,yi,mo,ca,on.symbolInstances.length,$u),La=on.icon.placedSymbolArray.length-1,tl&&(Cl=4*$u,on.addSymbols(on.icon,tl,v_,Ms,Ko,Gi,ka.vertical,_r,En,jd.lineStartIndex,jd.lineLength,-1,Jo,yi,mo,ca,on.symbolInstances.length,$u),qv=on.icon.placedSymbolArray.length-1)}for(const Qo in sr.horizontal){const xs=Qo,tl=sr.horizontal[xs];Ja||(__=tg(tl.text),oo?er=ZA(tl):Ja=AS(jr,Uu,En,mi,Co,Yr,tl,Ri,gr.layout.get("text-rotate").evaluate(Gi,{},yi),Ki,Wv));const $u=tl.positionedLines.length===1;if(Ma+=rF(on,_r,En,tl,Pi,gr,oo,Gi,Ki,jd,sr.vertical?ka.horizontal:ka.horizontalOnly,$u?HW(sr.horizontal):[xs],sc,La,Do,Jo,yi,on.symbolInstances.length,mo),$u)break}sr.vertical&&(Qa+=rF(on,_r,En,sr.vertical,Pi,gr,oo,Gi,Ki,jd,ka.vertical,["vertical"],sc,qv,Do,Jo,yi,on.symbolInstances.length,mo));let Oi=-1;const el=(Qo,xs)=>Qo?Math.max(Qo,xs):xs;Oi=el(er,Oi),Oi=el(Fo,Oi),Oi=el(ki,Oi);const Us=Oi>-1?1:0;on.glyphOffsetArray.length>=65535&&On("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Gi.sortKey!==void 0&&on.addToSortKeyRanges(on.symbolInstances.length,Gi.sortKey),on.symbolInstances.emplaceBack(En.x,En.y,Uu.x,Uu.y,Uu.z,sc.right>=0?sc.right:-1,sc.center>=0?sc.center:-1,sc.left>=0?sc.left:-1,sc.vertical>=0?sc.vertical:-1,La,qv,__,Ja!==void 0?Ja:on.collisionBoxArray.length,Ja!==void 0?Ja+1:on.collisionBoxArray.length,vf!==void 0?vf:on.collisionBoxArray.length,vf!==void 0?vf+1:on.collisionBoxArray.length,El!==void 0?El:on.collisionBoxArray.length,El!==void 0?El+1:on.collisionBoxArray.length,bf||on.collisionBoxArray.length,bf?bf+1:on.collisionBoxArray.length,mi,Ma,Qa,go,Cl,Us,0,ao,$o,Oi,0,y_?1:0,Vs)})(l,Xt,gn,It,s,u,g,f,l.layers[0],l.collisionBoxArray,r.index,r.sourceLayerIndex,l.index,bt,re,A,0,Ze,ot,J,r,v,R,M,O,N,G,H,ut,le,ue,he)};if(Q==="line")for(const It of oS(r.geometry,0,0,Bt,Bt)){const Xt=BW(It,nt,et,s.vertical||we,u,24,it,l.overscaling,Bt);for(const Yt of Xt)we&&eq(l,we.text,ft,Yt)||At(It,Yt,O)}else if(Q==="line-center"){for(const It of r.geometry)if(It.length>1){const Xt=FW(It,et,s.vertical||we,u,24,it);Xt&&At(It,Xt,O)}}else if(r.type==="Polygon")for(const It of mv(r.geometry,0)){const Xt=jW(It,16);At(It[0],new $d(Xt.x,Xt.y,0,0,void 0),O)}else if(r.type==="LineString")for(const It of r.geometry)At(It,new $d(It[0].x,It[0].y,0,0,void 0),O);else if(r.type==="Point")for(const It of r.geometry)for(const Xt of It)At([Xt],new $d(Xt.x,Xt.y,0,0,void 0),O)}const qA=255,rm=qA*Ud;function rF(l,r,s,u,f,g,v,x,w,A,R,M,O,B,N,G,H,J,re){const Q=ZD(0,u,w,g,v,x,f,l.allowVerticalPlacement,void 0,N.textScaleFactor),le=g.layout.get("text-size").evaluate(x,{},H),ue=N.compositeTextSizes?N.compositeTextSizes[0].evaluate(x,{},H):0,he=N.compositeTextSizes?N.compositeTextSizes[1].evaluate(x,{},H):0,Te=XA(l.layerIds[0],l.textSizeData,le,N.textScaleFactor,ue,he);l.addSymbols(l.text,Q,Te,w,v,x,R,r,s,A.lineStartIndex,A.lineLength,B,G,H,re,!1,J,Q.length);for(const me of M)O[me]=l.text.placedSymbolArray.length-1;return 4*Q.length}function XA(l,r,s,u,f,g){const v=r;let x=null;return v.kind==="source"?(x=[Ud*s*u],x[0]>rm&&On(`${l}: Value for "text-size" or "icon-size" is >= ${qA}. Reduce your "text-size" or "icon-size".`)):v.kind==="composite"&&(x=[Ud*f*u,Ud*g*u],(x[0]>rm||x[1]>rm)&&On(`${l}: Value for "text-size" or "icon-size" is >= ${qA}. Reduce your "text-size" or "icon-size".`)),x}function CS(l){for(const r in l)return l[r];return null}function AS(l,r,s,u,f,g,v,x,w,A,R){let M,O,B,N;if(M=R?R.top:v.top,O=R?R.bottom:v.bottom,B=R?R.left:v.left,N=R?R.right:v.right,DA(v)&&v.collisionPadding){const G=v.collisionPadding;B-=G[0],M-=G[1],N+=G[2],O+=G[3]}
vendor: 7,984 bytes, line 24
24if(w){const G=new St(B,M),H=new St(N,M),J=new St(B,O),re=new St(N,O),Q=ae(w);let le=new St(0,0);A&&(le=new St(A[0],A[1])),G._rotateAround(Q,le),H._rotateAround(Q,le),J._rotateAround(Q,le),re._rotateAround(Q,le),B=Math.min(G.x,H.x,J.x,re.x),N=Math.max(G.x,H.x,J.x,re.x),M=Math.min(G.y,H.y,J.y,re.y),O=Math.max(G.y,H.y,J.y,re.y)}return l.emplaceBack(r.x,r.y,r.z,s.x,s.y,B,M,N,O,x,u,f,g),l.length-1}function ZA(l){DA(l)&&l.collisionPadding&&(l.top-=l.collisionPadding[1],l.bottom+=l.collisionPadding[3]);const r=l.bottom-l.top;return r>0?Math.max(10,r):null}function eq(l,r,s,u){const f=l.compareText;if(r in f){const g=f[r];for(let v=g.length-1;v>=0;v--)if(u.dist(g[v])<s)return!0}else f[r]=[];return f[r].push(u),!1}function iF(l,r){const s=l.fovAboveCenter,u=l.elevation?l.elevation.getMinElevationBelowMSL()*r:0,f=Math.min(u,l.isOrthographic?-10*r:0),g=(l._camera.position[2]*l.worldSize-f)/Math.cos(l._pitch),v=Math.sin(s)*g/Math.sin(Math.max(Math.PI/2-l._pitch-s,.01));let x=Math.sin(l._pitch)*v+g;const w=g*(1/l._horizonShift);if(!l.elevation||l.elevation.exaggeration()===0){let A=Math.max(l.zoom-17,0);l.isOrthographic&&(A/=10),x*=1+A}return Math.min(1.01*x,w)}function im(l,r){if(!r.isReprojectedInTileSpace)return{scale:1<<l.z,x:l.x,y:l.y,x2:l.x+1,y2:l.y+1,projection:r};const s=Math.pow(2,-l.z),u=l.x*s,f=(l.x+1)*s,g=l.y*s,v=(l.y+1)*s,x=ia(u),w=ia(f),A=Mo(g),R=Mo(v),M=r.project(x,A),O=r.project(w,A),B=r.project(w,R),N=r.project(x,R);let G=Math.min(M.x,O.x,B.x,N.x),H=Math.min(M.y,O.y,B.y,N.y),J=Math.max(M.x,O.x,B.x,N.x),re=Math.max(M.y,O.y,B.y,N.y);const Q=s/16;function le(he,Te,me,xe,_e,we){const je=(me+_e)/2,He=(xe+we)/2,Qe=r.project(ia(je),Mo(He)),it=Math.max(0,G-Qe.x,H-Qe.y,Qe.x-J,Qe.y-re);G=Math.min(G,Qe.x),J=Math.max(J,Qe.x),H=Math.min(H,Qe.y),re=Math.max(re,Qe.y),it>Q&&(le(he,Qe,me,xe,je,He),le(Qe,Te,je,He,_e,we))}le(M,O,u,g,f,g),le(O,B,f,g,f,v),le(B,N,f,v,u,v),le(N,M,u,v,u,g),G-=Q,H-=Q,J+=Q,re+=Q;const ue=1/Math.max(J-G,re-H);return{scale:ue,x:G*ue,y:H*ue,x2:J*ue,y2:re*ue,projection:r}}function oF(l,{x:r,y:s},u=0){return new St(((r-u)*l.scale-l.x)*Bt,(s*l.scale-l.y)*Bt)}const tq=$(new Float32Array(16));class mf{constructor(r){this.spec=r,this.name=r.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(r,s){return{x:0,y:0,z:0}}unproject(r,s){return new wr(0,0)}projectTilePoint(r,s,u){return{x:r,y:s,z:0}}locationPoint(r,s,u,f=!0){return r._coordinatePoint(r.locationCoordinate(s,u),f)}pixelsPerMeter(r,s){return Ps(1,r)*s}pixelSpaceConversion(r,s,u){return 1}farthestPixelDistance(r){return iF(r,r.pixelsPerMeter)}pointCoordinate(r,s,u,f){const g=r.horizonLineFromTop(!1),v=new St(s,Math.max(g,u));return r.rayIntersectionCoordinate(r.pointRayIntersection(v,f))}pointCoordinate3D(r,s,u){const f=new St(s,u);if(r.elevation)return r.elevation.pointCoordinate(f);{const g=this.pointCoordinate(r,f.x,f.y,0);return[g.x,g.y,g.z]}}isPointAboveHorizon(r,s){if(r.elevation&&r.elevation.visibleDemTiles.length)return!this.pointCoordinate3D(r,s.x,s.y);const u=r.horizonLineFromTop();return s.y<u}createInversionMatrix(r,s){return tq}createTileMatrix(r,s,u){let f,g,v;const x=u.canonical,w=$(new Float64Array(16));if(this.isReprojectedInTileSpace){const A=im(x,this);f=1,g=A.x+u.wrap*A.scale,v=A.y,ne(w,w,[f/A.scale,f/A.scale,r.pixelsPerMeter/s])}else f=s/r.zoomScale(x.z),g=(x.x+Math.pow(2,x.z)*u.wrap)*f,v=x.y*f;return K(w,w,[g,v,0]),ne(w,w,[f/Bt,f/Bt,1]),w}upVector(r,s,u){return[0,0,1]}upVectorScale(r,s,u){return{metersToTile:1}}}class nq extends mf{constructor(r){super(r),this.range=[4,7],this.center=r.center||[-96,37.5];const[s,u]=this.parallels=r.parallels||[29.5,45.5],f=Math.sin(ae(s));this.n=(f+Math.sin(ae(u)))/2,this.c=1+f*(2*this.n-f),this.r0=Math.sqrt(this.c)/this.n}project(r,s){const{n:u,c:f,r0:g}=this,v=ae(r-this.center[0]),x=ae(s),w=Math.sqrt(f-2*u*Math.sin(x))/u;return{x:w*Math.sin(v*u),y:w*Math.cos(v*u)-g,z:0}}unproject(r,s){const{n:u,c:f,r0:g}=this,v=g+s;let x=Math.atan2(r,Math.abs(v))*Math.sign(v);v*u<0&&(x-=Math.PI*Math.sign(r)*Math.sign(v));const w=ae(this.center[0])*u;x=Et(x,-Math.PI-w,Math.PI-w);const A=Ee(ge(x/u)+this.center[0],-180,180),R=Math.asin(Ee((f-(r*r+v*v)*u*u)/(2*u),-1,1)),M=Ee(ge(R),-85.051129,oa);return new wr(A,M)}}const Lv=1.340264,Ov=-.081106,Dv=893e-6,Fv=.003796,IS=Math.sqrt(3)/2;class rq extends mf{project(r,s){s=s/180*Math.PI,r=r/180*Math.PI;const u=Math.asin(IS*Math.sin(s)),f=u*u,g=f*f*f;return{x:.5*(r*Math.cos(u)/(IS*(Lv+3*Ov*f+g*(7*Dv+9*Fv*f)))/Math.PI+.5),y:1-.5*(u*(Lv+Ov*f+g*(Dv+Fv*f))/Math.PI+1),z:0}}unproject(r,s){r=(2*r-.5)*Math.PI;let u=s=(2*(1-s)-1)*Math.PI,f=u*u,g=f*f*f;for(let R,M,O,B=0;B<12&&(M=u*(Lv+Ov*f+g*(Dv+Fv*f))-s,O=Lv+3*Ov*f+g*(7*Dv+9*Fv*f),R=M/O,u=Ee(u-R,-Math.PI/3,Math.PI/3),f=u*u,g=f*f*f,!(Math.abs(R)<1e-12));++B);const v=IS*r*(Lv+3*Ov*f+g*(7*Dv+9*Fv*f))/Math.cos(u),x=Math.asin(Math.sin(u)/IS),w=Ee(180*v/Math.PI,-180,180),A=Ee(180*x/Math.PI,-85.051129,oa);return new wr(w,A)}}class iq extends mf{constructor(r){super(r),this.wrap=!0,this.supportsWorldCopies=!0}project(r,s){return{x:.5+r/360,y:.5-s/360,z:0}}unproject(r,s){const u=360*(r-.5),f=Ee(360*(.5-s),-85.051129,oa);return new wr(u,f)}}const d_=Math.PI/2;function PS(l){return Math.tan((d_+l)/2)}class oq extends mf{constructor(r){super(r),this.center=r.center||[0,30];const[s,u]=this.parallels=r.parallels||[30,30];let f=ae(s),g=ae(u);this.southernCenter=f+g<0,this.southernCenter&&(f=-f,g=-g);const v=Math.cos(f),x=PS(f);this.n=f===g?Math.sin(f):Math.log(v/Math.cos(g))/Math.log(PS(g)/x),this.f=v*Math.pow(PS(f),this.n)/this.n}project(r,s){s=ae(s),this.southernCenter&&(s=-s),r=ae(r-this.center[0]);const u=1e-6,{n:f,f:g}=this;g>0?s<-d_+u&&(s=-d_+u):s>d_-u&&(s=d_-u);const v=g/Math.pow(PS(s),f);let x=v*Math.sin(f*r),w=g-v*Math.cos(f*r);return x=.5*(x/Math.PI+.5),w=.5*(w/Math.PI+.5),{x,y:this.southernCenter?w:1-w,z:0}}unproject(r,s){r=(2*r-.5)*Math.PI,this.southernCenter&&(s=1-s),s=(2*(1-s)-.5)*Math.PI;const{n:u,f}=this,g=f-s,v=Math.sign(g),x=Math.sign(u)*Math.sqrt(r*r+g*g);let w=Math.atan2(r,Math.abs(g))*v;g*u<0&&(w-=Math.PI*Math.sign(r)*v);const A=Ee(ge(w/u)+this.center[0],-180,180),R=Ee(ge(2*Math.atan(Math.pow(f/x,1/u))-d_),-85.051129,oa);return new wr(A,this.southernCenter?-R:R)}}class sF extends mf{constructor(r){super(r),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(r,s){return{x:Bc(r),y:tc(s),z:0}}unproject(r,s){const u=ia(r),f=Mo(s);return new wr(u,f)}}const aF=ae(oa);class sq extends mf{project(r,s){const u=(s=ae(s))*s,f=u*u;return{x:.5*((r=ae(r))*(.8707-.131979*u+f*(f*(.003971*u-.001529*f)-.013791))/Math.PI+.5),y:1-.5*(s*(1.007226+u*(.015085+f*(.028874*u-.044475-.005916*f)))/Math.PI+1),z:0}}unproject(r,s){r=(2*r-.5)*Math.PI;let u=s=(2*(1-s)-1)*Math.PI,f=25,g=0,v=u*u;do{v=u*u;const A=v*v;g=(u*(1.007226+v*(.015085+A*(.028874*v-.044475-.005916*A)))-s)/(1.007226+v*(.045255+A*(.259866*v-.311325-.005916*11*A))),u=Ee(u-g,-aF,aF)}while(Math.abs(g)>1e-6&&--f>0);v=u*u;const x=Ee(ge(r/(.8707+v*(v*(v*v*v*(.003971-.001529*v)-.013791)-.131979))),-180,180),w=ge(u);return new wr(x,w)}}const lF=ae(oa);class aq extends mf{project(r,s){s=ae(s),r=ae(r);const u=Math.cos(s),f=2/Math.PI,g=Math.acos(u*Math.cos(r/2)),v=Math.sin(g)/g,x=.5*(r*f+2*u*Math.sin(r/2)/v)||0,w=.5*(s+Math.sin(s)/v)||0;return{x:.5*(x/Math.PI+.5),y:1-.5*(w/Math.PI+1),z:0}}unproject(r,s){let u=r=(2*r-.5)*Math.PI,f=s=(2*(1-s)-1)*Math.PI,g=25;const v=1e-6;let x=0,w=0;do{const A=Math.cos(f),R=Math.sin(f),M=2*R*A,O=R*R,B=A*A,N=Math.cos(u/2),G=Math.sin(u/2),H=2*N*G,J=G*G,re=1-B*N*N,Q=re?1/re:0,le=re?Math.acos(A*N)*Math.sqrt(1/re):0,ue=.5*(2*le*A*G+2*u/Math.PI)-r,he=.5*(le*R+f)-s,Te=.5*Q*(B*J+le*A*N*O)+1/Math.PI,me=Q*(H*M/4-le*R*G),xe=.125*Q*(M*G-le*R
vendor: 4,431 bytes, line 24
24*B*H),_e=.5*Q*(O*N+le*J*A)+.5,we=me*xe-_e*Te;x=(he*me-ue*_e)/we,w=(ue*xe-he*Te)/we,u=Ee(u-x,-Math.PI,Math.PI),f=Ee(f-w,-lF,lF)}while((Math.abs(x)>v||Math.abs(w)>v)&&--g>0);return new wr(ge(u),ge(f))}}class cF extends mf{constructor(r){super(r),this.center=r.center||[0,0],this.parallels=r.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(ae(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(r,s){const{scale:u,cosPhi:f}=this;return{x:ae(r)*f*u+.5,y:-Math.sin(ae(s))/f*u+.5,z:0}}unproject(r,s){const{scale:u,cosPhi:f}=this,g=-(s-.5)/u,v=Ee(ge((r-.5)/u)/f,-180,180),x=Math.asin(Ee(g*f,-1,1)),w=Ee(ge(x),-85.051129,oa);return new wr(v,w)}}class lq extends sF{constructor(r){super(r),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(r,s,u){const f=kn(r,s,u);return mt(f,f,An(Ct(u))),{x:f[0],y:f[1],z:f[2]}}locationPoint(r,s,u){const f=ec(s.lat,s.lng),g=_n([],f),v=u?r._centerAltitude+u:r.elevation?r.elevation.getAtPointOrZero(r.locationCoordinate(s),r._centerAltitude):r._centerAltitude;Rn(f,f,g,Ps(1,0)*Bt*v);const x=$(new Float64Array(16));return X(x,r.pixelMatrix,r.globeMatrix),mt(f,f,x),new St(f[0],f[1])}pixelsPerMeter(r,s){return Ps(1,0)*s}pixelSpaceConversion(r,s,u){const f=Ps(1,r)*s,g=Sn(Ps(1,45)*s,f,u);return this.pixelsPerMeter(r,s)/g}createTileMatrix(r,s,u){const f=or(Ct(u.canonical));return X(new Float64Array(16),r.globeMatrix,f)}createInversionMatrix(r,s){const{center:u}=r,f=An(Ct(s));return ye(f,f,ae(u.lng)),fe(f,f,ae(u.lat)),ne(f,f,[r._pixelsPerMercatorPixel,r._pixelsPerMercatorPixel,1]),Float32Array.from(f)}pointCoordinate(r,s,u,f){return dt(r,s,u,!0)||new ls(0,0)}pointCoordinate3D(r,s,u){const f=this.pointCoordinate(r,s,u,0);return[f.x,f.y,f.z]}isPointAboveHorizon(r,s){return!dt(r,s.x,s.y,!1)}farthestPixelDistance(r){const s=(function(f,g){const v=f.cameraToCenterDistance,x=f._centerAltitude*g,w=f._camera,A=f._camera.forward(),R=sn([],Yn([],A,-v),[0,0,x]),M=f.worldSize/(2*Math.PI),O=[0,0,-M],B=f.width/f.height,N=Math.tan(f.fovAboveCenter),G=Yn([],w.up(),N),H=Yn([],w.right(),N*B),J=_n([],sn([],sn([],A,G),H)),re=[];let Q;if(new sv(R,J).closestPointOnSphere(O,M,re)){const le=sn([],re,O),ue=tt([],le,R);Q=Math.cos(f.fovAboveCenter)*Zt(ue)}else{const le=tt([],R,O),ue=tt([],O,R);_n(ue,ue);const he=Zt(le)-M;Q=Math.sqrt(he*(he+2*M));const Te=Math.acos(Q/(M+he))-Math.acos(Bn(A,ue));Q*=Math.cos(Te)}return 1.01*Q})(r,this.pixelsPerMeter(r.center.lat,r.worldSize)),u=Fr(r.zoom);if(u>0){const f=iF(r,Ps(1,r.center.lat)*r.worldSize),g=r.worldSize/(2*Math.PI),v=Math.max(r.width,r.height)/r.worldSize*Math.PI;return Sn(s,f+g*(1-Math.cos(v)),Math.pow(u,10))}return s}upVector(r,s,u){return kn(s,u,r,1)}upVectorScale(r){return{metersToTile:ct(Pn(Ct(r)))}}}function uF(l){const r=l.parallels,s=!!r&&Math.abs(r[0]+r[1])<.01;switch(l.name){case"mercator":return new sF(l);case"equirectangular":return new iq(l);case"naturalEarth":return new sq(l);case"equalEarth":return new rq(l);case"winkelTripel":return new aq(l);case"albers":return s?new cF(l):new nq(l);case"lambertConformalConic":return s?new cF(l):new oq(l);case"globe":return new lq(l)}throw new Error(`Invalid projection name: ${l.name}`)}class cq{constructor(r,s){this.lastParams=null,this.lastAllFeaturesIndex=-2,this.appearancesVersion=s,this.appearances=r;const u=r.map(f=>(function(g){if(!g.condition)return{featureDependent:!1,stateDependent:!1,zoomDependent:!1,pitchDependent:!1,brightnessDependent:!1,worldviewDependent:!1};const v=g.condition.expression;return{featureDependent:!Sd(v),stateDependent:!Ga(v),zoomDependent:!Xl(v,["zoom"]),pitchDependent:!Xl(v,["pitch"]),brightnessDependent:!Xl(v,["brightness","measure-light"]),worldviewDependent:!Xl(v,["worldview"])}})(f));this.anyFeatureDependent=u.some(f=>f.featureDependent),this.anyStateDependent=u.some(f=>f.stateDependent)}update(r,s){const u=this.lastParams,f=!u||u.zoom!==r.zoom||u.pitch!==(r.pitch||0)||u.brightness!==(r.brightness||0)||u.worldview!==r.worldview;this.lastParams={zoom:r.zoom,pitch:r.pitch||0,brightness:r.brightness||0,worldview:r.worldview};const g=s&&this.anyStateDependent;if(!f&&!g&&this.lastAllFeaturesIndex!==-2)return{kind:"no-changes"};if(!this.anyFeatureDependent&&!g){const v=this.evaluateAllFeatures(r);return v===this.lastAllFeaturesIndex?{kind:"no-changes"}
vendor: 5,288 bytes, line 24
24:(this.lastAllFeaturesIndex=v,{kind:"all-features",appearanceIndex:v})}return{kind:"per-feature"}}evaluateAllFeatures(r){for(let s=0;s<this.appearances.length;s++){const u=this.appearances[s];if(u.condition&&u.condition.evaluate(r,void 0,void 0,void 0))return s}return-1}}const uq=Ou.types,dq=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Bv(l,r,s,u,f,g,v,x,w,A,R,M,O){const B=x?Math.min(rm,Math.round(x[0])):0,N=x?Math.min(rm,Math.round(x[1])):0;l.emplaceBack(r,s,Math.round(32*u),Math.round(32*f),g,v,(B<<1)+(w?1:0),0+(N<<1),16*A,16*R,256*M,256*O)}function zv(l,r,s){l.emplaceBack(r,s)}function Nv(l,r,s,u,f,g,v){l.emplaceBack(r,s,u,f,g,v)}const RS=(l,r,s,u)=>{for(let f=0;f<r;f++)l.emplaceBack(s[0],s[1],s[2],u[0],u[1],u[2])};function h_(l,r,s,u,f){l.emplaceBack(r,s,u,f),l.emplaceBack(r,s,u,f),l.emplaceBack(r,s,u,f),l.emplaceBack(r,s,u,f)}function hq(l){for(const r of l.sections)if(A2(r.text))return!0;return!1}const f_=12;class YA{constructor(r){this.layoutVertexArray=new V0,this.indexArray=new _i,this.programConfigurations=r,this.segments=new Wr,this.dynamicLayoutVertexArray=new Oc,this.opacityVertexArray=new Hg,this.placedSymbolArray=new vw,this.iconTransitioningVertexArray=new Bs,this.globeExtVertexArray=new U0,this.zOffsetVertexArray=new Zo,this.orientationVertexArray=new H0,this.symbolInstanceIndices=[],this.uboBinder=null,this.featureIdArray=new Zo,this.featureIdBuffer=null,this.cachedBatchIndices=null,this.cachedBatchSegments=null}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0&&this.iconTransitioningVertexArray.length===0}getBatchGrouping(r){const s=r.get().length===this.segments.get().length;if(s&&this.cachedBatchIndices&&this.cachedBatchSegments)return{batchIndices:this.cachedBatchIndices,batchSegments:this.cachedBatchSegments};const u=new Map;for(const v of r.get()){const x=v.batchIndex!==void 0?v.batchIndex:0;u.has(x)||u.set(x,[]),u.get(x).push(v)}const f=Array.from(u.keys()).sort((v,x)=>v-x),g=new Map;for(const v of f){const x=u.get(v);g.set(v,new Wr(x))}return s&&(this.cachedBatchIndices=f,this.cachedBatchSegments=g),{batchIndices:f,batchSegments:g}}snapshotSymbolVertexData(r,s){const u=r*f_;return this.layoutVertexArray.uint16.slice(u,u+s*f_)}restoreSymbolVertexData(r,s){this.layoutVertexArray.uint16.set(s,r*f_)}updateSymbolVertexData(r,s,u,f,g,v,x,w,A,R,M,O,B){const N=this.layoutVertexArray.uint16,G=r*f_;N[G]=s,N[G+1]=u,N[G+2]=f,N[G+3]=g,N[G+4]=v,N[G+5]=x,N[G+6]=w,N[G+7]=A,N[G+8]=R,N[G+9]=M,N[G+10]=O,N[G+11]=B}upload(r,s,u,f,g,v){this.isEmpty()||(u&&(this.cachedBatchIndices=null,this.cachedBatchSegments=null,this.layoutVertexBuffer=r.createVertexBuffer(this.layoutVertexArray,cW.members,!!v),this.indexBuffer=r.createIndexBuffer(this.indexArray,s),this.dynamicLayoutVertexBuffer=r.createVertexBuffer(this.dynamicLayoutVertexArray,dW.members,!0),this.opacityVertexBuffer=r.createVertexBuffer(this.opacityVertexArray,dq,!0),this.iconTransitioningVertexArray.length>0&&(this.iconTransitioningVertexBuffer=r.createVertexBuffer(this.iconTransitioningVertexArray,mW.members,!0)),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=r.createVertexBuffer(this.globeExtVertexArray,uW.members,!0)),!this.zOffsetVertexBuffer&&(this.zOffsetVertexArray.length>0||g)&&(this.zOffsetVertexBuffer=r.createVertexBuffer(this.zOffsetVertexArray,hW.members,!0)),!this.orientationVertexBuffer&&this.orientationVertexArray&&this.orientationVertexArray.length>0&&(this.orientationVertexBuffer=r.createVertexBuffer(this.orientationVertexArray,pW.members,!0)),this.opacityVertexBuffer.itemSize=1,this.featureIdArray&&this.featureIdArray.length>0&&(this.featureIdBuffer=r.createVertexBuffer(this.featureIdArray,fW.members,!1))),(u||f)&&(this.programConfigurations.upload(r),this.uboBinder&&this.uboBinder.upload(r)))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.iconTransitioningVertexBuffer&&this.iconTransitioningVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy(),this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy(),this.orientationVertexBuffer&&this.orientationVertexBuffer.destroy(),this.featureIdBuffer&&this.featureIdBuffer.destroy(),this.uboBinder&&this.uboBinder.destroy())}}Kt(YA,"SymbolBuffers",{omit:["cachedBatchIndices","cachedBatchSegments"]});class KA{constructor(r,s,u){this.layoutVertexArray=new r,this.layoutAttributes=s,this.indexArray=new u,this.segments=new Wr,this.collisionVertexArray=new qg,this.collisionVertexArrayExt=new Oc}upload(r){this.layoutVertexBuffer=r.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=r.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=r.createVertexBuffer(this.collisionVertexArray,gW.members,!0),this.collisionVertexBufferExt=r.createVertexBuffer(this.collisionVertexArrayExt,_W.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.de
24stroy())}}Kt(KA,"CollisionBuffers");class rc{constructor(r){this.collisionBoxArray=r.collisionBoxArray,this.zoom=r.zoom,this.overscaling=r.overscaling,this.layers=r.layers,this.layerIds=this.layers.map(v=>v.fqid),this.index=r.index,this.pixelRatio=r.pixelRatio,this.sourceLayerIndex=r.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.hasAnyIconTextFit=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=$([]),this.placementViewportMatrix=$([]);const s=this.layers[0]._unevaluatedLayout._values;this.worldview=r.worldview,this.localizable=r.localizable,this.maxUniformBufferBindings=r.maxUniformBufferBindings,this.maxUniformBlockSizeDwords=r.maxUniformBlockSizeDwords,this.disableSymbolUBO=r.disableSymbolUBO,this.textSizeData=nm(this.zoom,s["text-size"],this.worldview,r.availableImages),this.iconSizeData=nm(this.zoom,s["icon-size"],this.worldview,r.availableImages);const u=this.layers[0].layout,f=u.get("symbol-sort-key"),g=u.get("symbol-z-order");this.lut=r.lut,this.canOverlap=u.get("text-allow-overlap")||u.get("icon-allow-overlap")||u.get("text-ignore-placement")||u.get("icon-ignore-placement"),this.sortFeaturesByKey=g!=="viewport-y"&&f.constantOr(1)!==void 0,this.sortFeaturesByY=(g==="viewport-y"||g==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=u.get("text-writing-mode").map(v=>ka[v]),this.stateDependentLayerIds=this.layers.filter(v=>v.isStateDependent()).map(v=>v.id),this.sourceID=r.sourceID,this.projection=r.projection,this.hasAnyZOffset=!1,this.zOffsetSortDirty=!1,this.zOffsetBuffersNeedUpload=!1,this.elevationType="none",this.elevationStateComplete=!1,this.activeReplacements=[],this.replacementUpdateTime=0,this.hasAnySecondaryIcon=!1,this.hasAppearances=null,this.featureAppearances=null,this.featureAppearanceData=new Map}hasAnyAppearanceLayoutProperty(r){const s=this.layers[0].getAppearances();if(!s||s.length===0)return!1;const u=Array.isArray(r)?r:[r];return s.some(f=>u.some(g=>f.hasLayoutProperty(g)))}getAppearanceFeatureData(r){return this.featureAppearanceData.get(r)}createArrays(){this.text=new YA(new Ea(this.layers,{zoom:this.zoom,lut:this.lut},r=>r.startsWith("text")||r.startsWith("symbol"))),this.icon=new YA(new Ea(this.layers,{zoom:this.zoom,lut:this.lut},r=>r.startsWith("icon")||r.startsWith("symbol"))),this.disableSymbolUBO||(this.text.uboBinder=new kA(this.layers[0],this.zoom,this.lut,!0,"",this.maxUniformBufferBindings,this.maxUniformBlockSizeDwords),this.icon.uboBinder=new kA(this.layers[0],this.zoom,this.lut,!1,"",this.maxUniformBufferBindings,this.maxUniformBlockSizeDwords)),this.glyphOffsetArray=new xw,this.lineVertexArray=new bl,this.symbolInstances=new Z0}calculateGlyphDependencies(r,s,u,f,g){for(const v of r){const x=v.codePointAt(0);if(x===void 0)break;if(s[x]=!0,f&&g&&x<=65535){const w=Av[v];w&&(s[w.charCodeAt(0)]=!0)}}}calculateEffectiveAppearanceIconSize(r,s,u,f,g,v,x){if(!r.hasLayoutProperty("icon-size"))return x*v;let w=1;const A=r.getUnevaluatedLayoutProperty("icon-size"),R=nm(this.zoom,A,this.worldview,g),M=c_(R,s);if(R.kind!=="constant"&&R.kind!=="camera"||(w=M.uSize),R.kind==="composite"){const{minZoom:O,maxZoom:B}=R,N=A.possiblyEvaluate(new Tr(O,{worldview:this.worldview}),f),G=A.possiblyEvaluate(new Tr(B,{worldview:this.worldview}),f),H=N.evaluate(u,{},f,g);w=H+(G.evaluate(u,{},f,g)-H)*M.uSizeT}return R.kind==="source"&&(w=A.possiblyEvaluate(new Tr(this.zoom,{worldview:this.worldview}),f).evaluate(u,{},f,g)),w*v}updateFootprints(r,s){}updateReplacement(r,s){if(s.updateTime===this.replacementUpdateTime)return!1;this.replacementUpdateTime=s.updateTime;const u=s.getReplacementRegionsForTile(r.toUnwrapped(),!0);return!Yw(this.activeReplacements,u)&&(this.activeReplacements=u,!0)}getResolvedImageFromTokens(r){return typeof r=="string"?_s.build(r):r}populate(r,s,u,f){const g=this.layers[0],v=g.layout,x=this.projection.name==="globe",w=v.get("text-font"),A=v.get("text-field"),R=v.get("icon-image"),[M,O]=v.get("icon-size-scale-range"),B=Ee(s.scaleFactor||1,M,O),[N,G]=v.get("text-size-scale-range"),H=Ee(s.scaleFactor||1,N,G),J=(A.value.kind!=="constant"||A.value.value instanceof ss&&!A.value.value.isEmpty()||A.value.value.toString().length>0)&&(w.value.kind!=="constant"||w.value.value.length>0),re=R.value.kind!=="constant"||!!R.value.value||Object.keys(R.parameters).length>0,Q=this.hasAnyAppearanceLayoutProperty("icon-image"),le=v.get("symbol-sort-key");if(this.features=[],this.featureAppearanceData=new Map,!J&&!re&&!Q)return;const ue=s.iconDependencies,he=s.glyphDependencies,Te=s.availableImages,me=new Tr(this.zoom,{worldview:this.worldview,activeFloors:s.activeFloors}),xe=_e=>{const we=_e.id.toString();ue.has(we)?ue.get(we).push(_e):ue.set(we,[_e])};for(const _e of r){const{feature:we,id:je,index:He,sourceLayerIndex:Qe}=_e,it=g._featureFilter.needGeometry,nt=Ya(we,it);if(!g._featureFilter.filter(me,nt,u))continue;if(it||(nt.geometry=sa(we,u,f)),x&&we.type!==1&&u.z<=5){const ut=nt.geometry,At=.98078528056,It=(Xt,Yt)=>Bn(kn(Xt.x,Xt.y,u,1),kn(Yt.x,Yt.y,u,1))<At;for(let Xt=0;Xt<ut.length;Xt++)ut[Xt]=U2(ut[Xt],It)}let bt,Ze;if(J){const ut=g.getValueAndResolveTokens("text-field",nt,u,Te),At=ss.factory(ut);hq(At)&&(this.hasRTLText=!0),(!this.hasRTLText||k0()==="unavailable"||this.hasRTLText&&yl.isParsed())&&(bt=vW(At,g,nt))}if(re){const ut=g.getValueAndResolveTokens("icon-image",nt,u,Te);Ze=this.getResolvedImageFromTokens(ut)}const et=this.layers[0];let ot=!1;if(!Ze&&Q){const ut=et.getAppearances();for(const At of ut)if(At.getLayoutProperty("icon-image")){const It=et.getAppearanceValueAndResolveTokens(At,"icon-image",nt,u,Te);if(It){Ze=this.getResolvedImageFromTokens(It),ot=!0;break}}}if(!bt&&!Ze)continue;
24const ft=this.sortFeaturesByKey?le.evaluate(nt,{},u):void 0,_t={id:je,text:bt,icon:Ze,index:He,sourceLayerIndex:Qe,geometry:nt.geometry,properties:we.properties,type:uq[we.type],sortKey:ft};if(this.features.push(_t),this.featureAppearanceData.set(He,{id:je,properties:we.properties,usesAppearanceIconAsPlaceholder:ot}),Ze){const ut=et._unevaluatedLayout._values,{iconPrimary:At,iconSecondary:It}=Mv(Ze,this.iconSizeData,ut["icon-size"],u,this.zoom,_t,this.pixelRatio,B,this.worldview,Te);xe(At),It&&(this.hasAnySecondaryIcon=!0,xe(It))}const Ft=et.getAppearances();if(Ft.length!==0&&Ft.forEach(ut=>{if(!ut.getLayoutProperty("icon-image"))return;const At=this.getCombinedIconPrimary(ut,et,nt,u,Te,_t,B);At&&xe(At)}),bt){const ut=w.evaluate(nt,{},u).join(","),At=v.get("text-rotation-alignment")==="map"&&v.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.includes(ka.vertical);for(const It of bt.sections)if(It.image){const Xt=It.image.getPrimary().scaleSelf(this.pixelRatio*H),Yt=Xt.id.toString(),gn=ue.get(Yt)||[];gn.push(Xt),ue.set(Yt,gn)}else{const Xt=I0(bt.toString()),Yt=It.fontStack||ut,gn=he[Yt]=he[Yt]||{};this.calculateGlyphDependencies(It.text,gn,At,this.allowVerticalPlacement,Xt)}}}if(v.get("symbol-placement")==="line"&&(this.features=(function(_e){const we={},je={},He=[];let Qe=0;function it(et){He.push(_e[et]),Qe++}function nt(et,ot,ft){const _t=je[et];return delete je[et],je[ot]=_t,He[_t].geometry[0].pop(),He[_t].geometry[0]=He[_t].geometry[0].concat(ft[0]),_t}function bt(et,ot,ft){const _t=we[ot];return delete we[ot],we[et]=_t,He[_t].geometry[0].shift(),He[_t].geometry[0]=ft[0].concat(He[_t].geometry[0]),_t}function Ze(et,ot,ft){const _t=ft?ot[0].at(-1):ot[0][0];return`${et}:${_t.x}:${_t.y}`}for(let et=0;et<_e.length;et++){const ot=_e[et],ft=ot.geometry,_t=ot.text?ot.text.toString():null;if(!_t){it(et);continue}const Ft=Ze(_t,ft),ut=Ze(_t,ft,!0);if(Ft in je&&ut in we&&je[Ft]!==we[ut]){const At=bt(Ft,ut,ft),It=nt(Ft,ut,He[At].geometry);delete we[Ft],delete je[ut],je[Ze(_t,He[It].geometry,!0)]=It,He[At].geometry=null}else Ft in je?nt(Ft,ut,ft):ut in we?bt(Ft,ut,ft):(it(et),we[Ft]=Qe-1,je[ut]=Qe-1)}return He.filter(et=>et.geometry)})(this.features)),v.get("symbol-elevation-reference")==="hd-road-markup"){if(this.elevationType="road",s.elevationFeatures){!this.elevationFeatures&&s.elevationFeatures.length>0&&(this.elevationFeatures=[],this.elevationFeatureIdToIndex=new Map);for(const _e of s.elevationFeatures)this.elevationFeatureIdToIndex.set(_e.id,this.elevationFeatures.length),this.elevationFeatures.push(_e)}}else v.get("symbol-z-elevate")&&(this.elevationType="offset");this.elevationType!=="none"&&(this.zOffsetBuffersNeedUpload=!0),this.sortFeaturesByKey&&this.features.sort((_e,we)=>_e.sortKey-we.sortKey)}getCombinedIconPrimary(r,s,u,f,g,v,x){let w,A;if(r.hasLayoutProperty("icon-image")){const R=s.getAppearanceValueAndResolveTokens(r,"icon-image",u,f,g);w=this.getResolvedImageFromTokens(R)}else{const R=s.getValueAndResolveTokens("icon-image",u,f,g);w=this.getResolvedImageFromTokens(R)}if(w){const R=r.hasLayoutProperty("icon-size")?r.getUnevaluatedLayoutProperty("icon-size"):s._unevaluatedLayout._values["icon-size"];A=Mv(w,nm(this.zoom,R,this.worldview,g),R,f,this.zoom,v,this.pixelRatio,x,this.worldview,g).iconPrimary}return A}updateSymbolInstanceIconVertices(r,s,u,f,g,v){const{canonical:x,availableImages:w,globalProperties:A,layer:R,iconScaleFactor:M,featureState:O,layoutIconOffset:B,layoutIconSize:N,layoutIconRotate:G}=v;if(r.placedIconSymbolIndex<0)return{vertexOffsetDelta:0,hasChanges:!1};if(s.activeAppearanceIndex===u)return{vertexOffsetDelta:r.numIconVertices,hasChanges:!1};const H=u>=0?R.appearances[u]:null;if(H){const J=this.getCombinedIconPrimary(H,R,f,x,w,{sortKey:void 0,text:void 0,icon:null,index:r.featureIndex,sourceLayerIndex:r.featureIndex,geometry:[],properties:s.properties,type:"Point",id:s.id},M);if(!J)return{vertexOffsetDelta:0,hasChanges:!1};const re=J.toString(),Q=this.iconAtlasPositions&&this.iconAtlasPositions.get(re);if(Q){const{appearanceIconOffset:le,appearanceIconRotate:ue}=KD(H,R,f,x,B,G,N,M);let he=vS(Q,void 0,le,R.layout.get("icon-anchor").evaluate(f,O,x));const Te=Q.sdf,me=R.layout.get("icon-text-fit").constantOr("none");me!=="none"&&s.textShaping&&s.iconTextFitPadding&&s.fontScale&&(he=FA(he,s.textShaping,me,s.iconTextFitPadding,le,s.fontScale));
vendor: 5,175 bytes, line 24
24const xe=this.calculateEffectiveAppearanceIconSize(H,A.zoom,f,x,w,M,N),_e=0,we=1+(Math.min(rm,Math.round(xe*Ud))<<1),je=GA(he,ue,Te,me!=="none",M);s.isUsingAppearanceIconVertexData||(s.isUsingAppearanceIconVertexData=!0,s.layoutBasedIconVertexData=this.icon.snapshotSymbolVertexData(g,r.numIconVertices));const He=Math.floor(r.numIconVertices/4),Qe=Math.min(je.length,He);let it=g;for(let bt=0;bt<Qe;++bt){const Ze=je[bt],et=s.layoutBasedIconVertexData[0]||r.tileAnchorX,ot=s.layoutBasedIconVertexData[1]||r.tileAnchorY,ft=16*Ze.pixelOffsetTL.x,_t=16*Ze.pixelOffsetTL.y,Ft=16*Ze.pixelOffsetBR.x,ut=16*Ze.pixelOffsetBR.y,At=16*Ze.minFontScaleX,It=16*Ze.minFontScaleY;this.icon.updateSymbolVertexData(it,et,ot,Math.round(32*Ze.tl.x),Math.round(32*Ze.tl.y),Ze.texPrimary.x,Ze.texPrimary.y,_e,we,ft,_t,At,It),this.icon.updateSymbolVertexData(it+1,et,ot,Math.round(32*Ze.tr.x),Math.round(32*Ze.tr.y),Ze.texPrimary.x+Ze.texPrimary.w,Ze.texPrimary.y,_e,we,Ft,_t,At,It),this.icon.updateSymbolVertexData(it+2,et,ot,Math.round(32*Ze.bl.x),Math.round(32*Ze.bl.y),Ze.texPrimary.x,Ze.texPrimary.y+Ze.texPrimary.h,_e,we,ft,ut,At,It),this.icon.updateSymbolVertexData(it+3,et,ot,Math.round(32*Ze.br.x),Math.round(32*Ze.br.y),Ze.texPrimary.x+Ze.texPrimary.w,Ze.texPrimary.y+Ze.texPrimary.h,_e,we,Ft,ut,At,It),it+=4}const nt=r.numIconVertices-4*Qe;for(let bt=0;bt<nt;++bt)this.icon.updateSymbolVertexData(it+bt,0,0,0,0,0,0,0,0,0,0,0,0);return{vertexOffsetDelta:r.numIconVertices,hasChanges:!0}}}else{if(s.usesAppearanceIconAsPlaceholder)return this.icon.updateSymbolVertexData(g,0,0,0,0,0,0,0,0,0,0,0,0),this.icon.updateSymbolVertexData(g+1,0,0,0,0,0,0,0,0,0,0,0,0),this.icon.updateSymbolVertexData(g+2,0,0,0,0,0,0,0,0,0,0,0,0),this.icon.updateSymbolVertexData(g+3,0,0,0,0,0,0,0,0,0,0,0,0),{vertexOffsetDelta:r.numIconVertices,hasChanges:!0};if(s.isUsingAppearanceIconVertexData)return this.icon.restoreSymbolVertexData(g,s.layoutBasedIconVertexData),s.isUsingAppearanceIconVertexData=!1,{vertexOffsetDelta:s.layoutBasedIconVertexData.length/f_,hasChanges:!0}}return{vertexOffsetDelta:r.numIconVertices,hasChanges:!1}}updateSymbolInstanceTextVertices(r,s,u,f,g,v){const{canonical:x,layer:w,textScaleFactor:A,imageMap:R,featureState:M,layoutTextOffset:O,layoutTextSize:B,layoutTextRotate:N,layoutMinZoomSize:G,layoutMaxZoomSize:H,layoutTextSizeMinZoom:J,layoutTextSizeMaxZoom:re,availableImages:Q}=v,le=r.numHorizontalGlyphVertices>0||r.numVerticalGlyphVertices>0;if(!le)return{vertexOffsetDelta:le?r.numHorizontalGlyphVertices+r.numVerticalGlyphVertices:0,hasChanges:!1};if(s.activeAppearanceIndex===u)return{vertexOffsetDelta:r.numHorizontalGlyphVertices+r.numVerticalGlyphVertices,hasChanges:!1};const ue=u>=0?w.appearances[u]:null;if(ue&&s.textShaping){const{appearanceTextOffset:he,appearanceTextRotate:Te,appearanceTextSize:me}=JD(ue,w,f,x,O,N,B);s.fontScale=nF(me,s.textScaleFactor);const xe=ue.getUnevaluatedLayoutProperty("text-size");let _e=this.textSizeData,we=J,je=re;ue.hasLayoutProperty("text-size")&&(_e=nm(this.zoom,xe,this.worldview,Q),we=this.textSizeData.kind==="composite"?this.textSizeData.minZoom:0,je=this.textSizeData.kind==="composite"?this.textSizeData.maxZoom:0);const He=s.textShaping.bottom-O[1],Qe=s.textShaping.left-O[0],it=s.textShaping.right-O[0];s.textShaping.top=he[1]+(s.textShaping.top-O[1]),s.textShaping.bottom=he[1]+He,s.textShaping.left=he[0]+Qe,s.textShaping.right=he[0]+it;const nt=ZD(0,s.textShaping,he,w,!1,f,R,this.allowVerticalPlacement,Te),bt=me&&_e.kind==="composite"?xe.possiblyEvaluate(new Tr(we,{}),x).evaluate(f,M,x):G,Ze=me&&_e.kind==="composite"?xe.possiblyEvaluate(new Tr(je,{}),x).evaluate(f,M,x):H,et=XA(ue.name,_e,me,A,bt,Ze),ot=Array.isArray(et)?et[1]:me,ft=0,_t=1+(Math.min(rm,Math.round(ot*Ud))<<1);s.isUsingAppearanceTextVertexData||(s.isUsingAppearanceTextVertexData=!0,s.layoutBasedTextVertexData=this.text.snapshotSymbolVertexData(g,r.numHorizontalGlyphVertices+r.numVerticalGlyphVertices));for(let Ft=0;Ft<nt.length&&Ft<(r.numHorizontalGlyphVertices+r.numVerticalGlyphVertices)/4;++Ft){const ut=nt[Ft],At=ut.glyphOffset[1],It=r.tileAnchorX,Xt=r.tileAnchorY,Yt=g+4*Ft;this.text.updateSymbolVertexData(Yt,It,Xt,Math.round(32*ut.tl.x),Math.round(32*(At+ut.tl.y)),ut.texPrimary.x,ut.texPrimary.y,ft,_t,ut.pixelOffsetTL.x,ut.pixelOffsetTL.y,ut.minFontScaleX,ut.minFontScaleY),this.text.updateSymbolVertexData(Yt+1,It,Xt,Math.round(32*ut.tr.x),Math.round(32*(At+ut.tr.y)),ut.texPrimary.x+ut.texPrimary.w,ut.texPrimary.y,ft,_t,ut.pixelOffsetBR.x,ut.pixelOffsetTL.y,ut.minFontScaleX,ut.minFontScaleY),this.text.updateSymbolVertexData(Yt+2,It,Xt,Math.round(32*ut.bl.x),Math.round(32*(At+ut.bl.y)),ut.texPrimary.x,ut.texPrimary.y+ut.texPrimary.h,ft,_t,ut.pixelOffsetTL.x,ut.pixelOffsetBR.y,ut.minFontScaleX,ut.minFontScaleY),this.text.updateSymbolVertexData(Yt+3,It,Xt,Math.round(32*ut.br.x),Math.round(32*(At+ut.br.y)),ut.texPrimary.x+ut.texPrimary.w,ut.texPrimary.y+ut.texPrimary.h,ft,_t,ut.pixelOffsetBR.x,ut.pixelOffsetBR.y,ut.minFontScaleX,ut.minFontScaleY)}return{vertexOffsetDelta:r.numHorizontalGlyphVertices+r.numVerticalGlyphVertices,hasChanges:!0}}return s.isUsingAppearanceTextVertexData?(this.text.restoreSymbolVertexData(g,
24s.layoutBasedTextVertexData),s.isUsingAppearanceTextVertexData=!1,{vertexOffsetDelta:s.layoutBasedTextVertexData.length/f_,hasChanges:!0}):{vertexOffsetDelta:r.numHorizontalGlyphVertices+r.numVerticalGlyphVertices,hasChanges:!1}}updateExpressions(r){this.text&&this.text.programConfigurations.updateExpressions(r),this.icon&&this.icon.programConfigurations.updateExpressions(r)}update(r,s,u,f,g,v,x,w){if(this.text.uboBinder||this.text.programConfigurations.updatePaintArrays(r,s,g,u,f,v,x,this.worldview),this.icon.uboBinder||this.icon.programConfigurations.updatePaintArrays(r,s,g,u,f,v,x,this.worldview),w){if(v)this.text.uboBinder&&!this.text.uboBinder.isLightConstant&&this.text.uboBinder.updateDynamicExpressions(g[0],s,w,u,r,x),this.icon.uboBinder&&!this.icon.uboBinder.isLightConstant&&this.icon.uboBinder.updateDynamicExpressions(g[0],s,w,u,r,x);else if(Object.keys(r).length>0){const A=new Set(Object.keys(r).map(R=>{const M=Number(R);return!isNaN(M)&&Number.isSafeInteger(M)&&String(M)===R?M:R}));this.text.uboBinder&&this.text.uboBinder.updateFeatures(A,g[0],s,w,u,r,x),this.icon.uboBinder&&this.icon.uboBinder.updateFeatures(A,g[0],s,w,u,r,x)}}}updateRoadElevation(r){if(this.elevationType!=="road"||!this.elevationFeatures||this.elevationStateComplete)return;this.elevationStateComplete=!0,this.hasAnyZOffset=!1;let s=!1;const u=Aa(r),f=1/u;let g=!1,v=!1;for(let x=0;x<this.symbolInstances.length;x++){const w=this.symbolInstances.get(x),A=Wt(1,0,0),R=Wt(0,1,0),{numHorizontalGlyphVertices:M,numVerticalGlyphVertices:O,numIconVertices:B,numVerticalIconVertices:N}=w,G=M>0||O>0,H=B>0,J=this.elevationFeatures[w.elevationFeatureIndex];if(J){const re=new St(w.tileAnchorX,w.tileAnchorY),Q=.075+J.pointElevation(re);w.zOffset!==Q&&(s=!0,w.zOffset=Q),Q!==0&&(this.hasAnyZOffset=!0);const le=J.computeSlopeNormal(re,f),ue=ko(Hn(),Wt(0,0,1),le);Vt(A,A,ue),Vt(R,R,ue),A[2]*=u,R[2]*=u,A[0]===1&&A[1]===0&&A[2]===0&&R[0]===0&&R[1]===1&&R[2]===0||(g=g||G,v=v||H)}if(G&&(RS(this.text.orientationVertexArray,M,A,R),RS(this.text.orientationVertexArray,O,A,R)),H){const{placedIconSymbolIndex:re,verticalPlacedIconSymbolIndex:Q}=w;re>=0&&RS(this.icon.orientationVertexArray,B,A,R),Q>=0&&RS(this.icon.orientationVertexArray,N,A,R)}}g||(this.text.orientationVertexArray=void 0),v||(this.icon.orientationVertexArray=void 0),s&&(this.zOffsetBuffersNeedUpload=!0,this.zOffsetSortDirty=!0)}updateZOffset(){const r=(g,v,x)=>{u+=v,u>g.length&&g.resize(u);for(let w=-v;w<0;w++)g.emplace(w+u,x)},s=(g,v,x)=>{f+=v,f>g.length&&g.resize(f);for(let w=-v;w<0;w++)g.emplace(w+f,x)};if(!this.zOffsetBuffersNeedUpload)return;this.zOffsetBuffersNeedUpload=!1;let u=0,f=0;for(let g=0;g<this.symbolInstances.length;g++){const v=this.symbolInstances.get(g),{numHorizontalGlyphVertices:x,numVerticalGlyphVertices:w,numIconVertices:A}=v,R=v.zOffset,M=A>0;if((x>0||w>0)&&(r(this.text.zOffsetVertexArray,x,R),r(this.text.zOffsetVertexArray,w,R)),M){const{placedIconSymbolIndex:O,verticalPlacedIconSymbolIndex:B}=v;O>=0&&s(this.icon.zOffsetVertexArray,A,R),B>=0&&s(this.icon.zOffsetVertexArray,v.numVerticalIconVertices,R)}}this.text.zOffsetVertexBuffer&&this.text.zOffsetVertexBuffer.updateData(this.text.zOffsetVertexArray),this.icon.zOffsetVertexBuffer&&this.icon.zOffsetVertexBuffer.updateData(this.icon.zOffsetVertexArray)}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(r,s,u,f,g){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(r),this.iconCollisionBox.upload(r)),this.text.upload(r,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload,this.hasAppearances),this.hasAppearances===null&&(this.hasAppearances=this.layers.some(v=>v.appearances&&v.appearances.length>0)),this.icon.upload(r,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload,this.hasAppearances),this.uploaded=!0}updateAppearances(r,s,u,f,g,v=!1){const x={hasLayoutChanges:!1,hasUboChanges:!1};if(!r||!u||!this.featureAppearanceData)return x;const w=s||{},A=this.icon.layoutVertexArray&&this.icon.layoutVertexArray.length>0&&this.icon.layoutVertexArray.arrayBuffer,R=this.text.layoutVertexArray&&this.text.layoutVertexArray.length>0&&this.text.layoutVertexArray.arrayBuffer;if(!A&&!R)return x;const M=this.layers[0],O=M.layout;this.featureAppearances&&this.featureAppearances.appearancesVersion===M.appearancesVersion||(this.featureAppearances=new cq(M.appearances,M.appearancesVersion));const B=this.featureAppearances.update(f,v);if(B.kind==="no-changes")return x;let N=1,G=0,H=!1,J=!1;if(A){const[he,Te]=O.get("icon-size-scale-range");N=Ee(1,he,Te)}let re=1,Q=0,le=!1;if(R){const[he,Te]=O.get("text-size-scale-range");re=Ee(1,he,Te)}const ue=new Map;if(g&&u)for(const he of u){const Te=g.getImage(he,M.scope);if(Te){const me=new $a(he.toString());ue.set(me.toString(),Te)}}for(let he=0;he<this.symbolInstances.length;he++){const Te=this.symbolInstances.get(he),me=this.getAppearanceFeatureData(Te.featureIndex);if(!me)continue;const xe=me.id,_e=xe!==void 0?w[String(xe)]:void 0,we={type:"Point",id:me.i
24d,properties:me.properties,geometry:[]};let je;if(B.kind==="all-features")je=B.appearanceIndex;else{const Qe=M.appearances?M.appearances.findIndex(it=>it.isActive({globals:f,feature:we,canonical:r,featureState:_e})):-1;je=Qe>=0?Qe:-1}const He=me.activeAppearanceIndex!==je;if(R){const Qe=O.get("text-size"),it=this.textSizeData.kind==="composite"?this.textSizeData.minZoom:0,nt=this.textSizeData.kind==="composite"?this.textSizeData.maxZoom:0,bt={canonical:r,layer:M,featureState:_e,availableImages:u,textScaleFactor:re,imageMap:ue,layoutTextOffset:O.get("text-offset").evaluate(we,_e,r).map(et=>et*Eo),layoutTextSize:Qe.evaluate(we,_e,r),layoutTextRotate:O.get("text-rotate").evaluate(we,_e,r),layoutMinZoomSize:Qe.evaluate(we,{zoom:it},r),layoutMaxZoomSize:Qe.evaluate(we,{zoom:nt},r),layoutTextSizeMinZoom:it,layoutTextSizeMaxZoom:nt},Ze=this.updateSymbolInstanceTextVertices(Te,me,je,we,Q,bt);Q+=Ze.vertexOffsetDelta,le=le||Ze.hasChanges}if(A){const Qe={canonical:r,layer:M,featureState:_e,availableImages:u,globalProperties:f,iconScaleFactor:N,layoutIconOffset:O.get("icon-offset").evaluate(we,_e,r),layoutIconSize:O.get("icon-size").evaluate(we,_e,r,u),layoutIconRotate:O.get("icon-rotate").evaluate(we,_e,r)},it=this.updateSymbolInstanceIconVertices(Te,me,je,we,G,Qe);G+=it.vertexOffsetDelta,H=H||it.hasChanges}if(He){const Qe=Te.featureIndex,it=f?f.brightness:null,nt=_e||{},bt=je>=0?M.appearances[je]:null;this.text.uboBinder&&(this.text.uboBinder.layer=M,J=this.text.uboBinder.updateFeaturePaintForAppearance(Qe,we,nt,r,u,
vendor: 6,135 bytes, line 24
24it,bt)||J),this.icon.uboBinder&&(this.icon.uboBinder.layer=M,J=this.icon.uboBinder.updateFeaturePaintForAppearance(Qe,we,nt,r,u,it,bt)||J)}me.activeAppearanceIndex=je}return H&&this.icon.layoutVertexBuffer&&this.icon.layoutVertexArray.arrayBuffer!==null&&this.icon.layoutVertexArray.length===this.icon.layoutVertexBuffer.length&&this.icon.layoutVertexBuffer.updateData(this.icon.layoutVertexArray),le&&this.text.layoutVertexBuffer&&this.text.layoutVertexArray.arrayBuffer!==null&&this.text.layoutVertexArray.length===this.text.layoutVertexBuffer.length&&this.text.layoutVertexBuffer.updateData(this.text.layoutVertexArray),{hasLayoutChanges:H||le,hasUboChanges:J}}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=uF(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(r,s){const u=this.lineVertexArray.length;if(r.segment!==void 0)for(const{x:f,y:g}of s)this.lineVertexArray.emplaceBack(f,g);return{lineStartIndex:u,lineLength:this.lineVertexArray.length-u}}addSymbols(r,s,u,f,g,v,x,w,A,R,M,O,B,N,G,H,J,re){const Q=r.indexArray,le=r.layoutVertexArray,ue=r.globeExtVertexArray,he=re,Te=r.uboBinder?r.uboBinder.getCurrentBatchIndex():void 0,me=r.segments.prepareSegment(4*he,le,Q,this.canOverlap?v.sortKey:void 0,Te),xe=this.glyphOffsetArray.length,_e=me.vertexLength,we=this.allowVerticalPlacement&&x===ka.vertical?Math.PI/2:0,je=v.text&&v.text.sections;let He=le.length,Qe=-1;for(let bt=0;bt<s.length;bt++){const{tl:Ze,tr:et,bl:ot,br:ft,texPrimary:_t,texSecondary:Ft,pixelOffsetTL:ut,pixelOffsetBR:At,minFontScaleX:It,minFontScaleY:Xt,glyphOffset:Yt,isSDF:gn,sectionIndex:on}=s[bt],En=me.vertexLength,_r=Yt[1];if(Bv(le,A.x,A.y,Ze.x,_r+Ze.y,_t.x,_t.y,u,gn,ut.x,ut.y,It,Xt),Bv(le,A.x,A.y,et.x,_r+et.y,_t.x+_t.w,_t.y,u,gn,At.x,ut.y,It,Xt),Bv(le,A.x,A.y,ot.x,_r+ot.y,_t.x,_t.y+_t.h,u,gn,ut.x,At.y,It,Xt),Bv(le,A.x,A.y,ft.x,_r+ft.y,_t.x+_t.w,_t.y+_t.h,u,gn,At.x,At.y,It,Xt),w){const{x:Nn,y:sr,z:Zn}=w.anchor,[Pi,Cr,gr]=w.up;Nv(ue,Nn,sr,Zn,Pi,Cr,gr),Nv(ue,Nn,sr,Zn,Pi,Cr,gr),Nv(ue,Nn,sr,Zn,Pi,Cr,gr),Nv(ue,Nn,sr,Zn,Pi,Cr,gr),h_(r.dynamicLayoutVertexArray,Nn,sr,Zn,we)}else h_(r.dynamicLayoutVertexArray,A.x,A.y,A.z,we);if(H){const Nn=Ft||_t;zv(r.iconTransitioningVertexArray,Nn.x,Nn.y),zv(r.iconTransitioningVertexArray,Nn.x+Nn.w,Nn.y),zv(r.iconTransitioningVertexArray,Nn.x,Nn.y+Nn.h),zv(r.iconTransitioningVertexArray,Nn.x+Nn.w,Nn.y+Nn.h)}if(Q.emplaceBack(En,En+1,En+2),Q.emplaceBack(En+1,En+2,En+3),me.vertexLength+=4,me.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Yt[0]),(bt===s.length-1||on!==s[bt+1].sectionIndex)&&(r.uboBinder||r.programConfigurations.populatePaintArrays(le.length,v,v.index,{},B,N,G,je&&je[on],this.worldview),r.uboBinder&&r.featureIdArray)){const Nn=r.uboBinder.populateUBO(v,v.index,N,B,G,je&&je[on],void 0);Qe=Nn;const sr=le.length-He;for(let Zn=0;Zn<sr;Zn++)r.featureIdArray.emplaceBack(Nn);He=le.length}}const it=re-s.length;if(it!==0&&(this._addNullVertices(it,le,u,w,ue,r,H,me,Q),r.uboBinder&&r.featureIdArray&&Qe>=0)){const bt=4*it;for(let Ze=0;Ze<bt;Ze++)r.featureIdArray.emplaceBack(Qe)}const nt=w?w.anchor:A;r.placedSymbolArray.emplaceBack(nt.x,nt.y,nt.z,A.x,A.y,xe,this.glyphOffsetArray.length-xe,_e,R,M,A.segment,u?u[0]:0,u?u[1]:0,f[0],f[1],x,0,0,0,O,0),r.symbolInstanceIndices.push(J)}_addNullVertices(r,s,u,f,g,v,x,w,A){for(let R=0;R<r;R++){for(let O=0;O<4;O++)Bv(s,0,0,0,0,0,0,u,!1,0,0,0,0),f&&Nv(g,0,0,0,0,0,0),h_(v.dynamicLayoutVertexArray,0,0,0,0),x&&zv(v.iconTransitioningVertexArray,0,0);const M=w.vertexLength;A.emplaceBack(M,M+1,M+2),A.emplaceBack(M+1,M+2,M+3),w.vertexLength+=4,w.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(0)}}_commitLayoutVertex(r,s,u,f,g,v,x){r.emplaceBack(s,u,f,g,v,Math.round(x.x),Math.round(x.y))}_addCollisionDebugVertices(r,s,u,f,g,v,x){const w=u.segments.prepareSegment(4,u.layoutVertexArray,u.indexArray),A=w.vertexLength,R=x.tileAnchorX,M=x.tileAnchorY;for(let B=0;B<4;B++)u.collisionVertexArray.emplaceBack(0,0,0,0,0,0);this._commitDebugCollisionVertexUpdate(u.collisionVertexArrayExt,s,r.padding,x.zOffset),this._commitLayoutVertex(u.layoutVertexArray,f,g,v,R,M,new St(r.x1,r.y1)),this._commitLayoutVertex(u.layoutVertexArray,f,g,v,R,M,new St(r.x2,r.y1)),this._commitLayoutVertex(u.layoutVertexArray,f,g,v,R,M,new St(r.x2,r.y2)),this._commitLayoutVertex(u.layoutVertexArray,f,g,v,R,M,new St(r.x1,r.y2)),w.vertexLength+=4;const O=u.indexArray;O.emplaceBack(A,A+1),O.emplaceBack(A+1,A+2),O.emplaceBack(A+2,A+3),O.emplaceBack(A+3,A),w.primitiveLength+=4}_addTextDebugCollisionBoxes(r,s,u,f,g,v){for(let x=f;x<g;x++){const w=u.get(x),A=this.getSymbolInstanceTextSize(r,v,s,x);this._addCollisionDebugVertices(w,A,this.textCollisionBox,w.projectedAnchorX,w.projectedAnchorY,w.projectedAnchorZ,v)}}_addIconDebugCollisionBoxes(r,s,u,f,g,v){for(let x=f;x<g;x++){const w=u.get(x),A=this.getSymbolInstanceIconSize(r,s,v.placedIconSymbolIndex);this._addCollisionDebugVertices(w,A,this.iconCollisionBox,w.projectedAnchorX,w.projectedAnchorY,w.projectedAnchorZ,v)}}generateCollisionDebugBuffers(r,s,u){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new KA(Wg,wD.members,Bs),this.iconCollisionBox=new KA(Wg,wD.members,Bs);const f=c_(this.iconSizeData,r),g=c_(this.textSizeData,r,u);for(let v=0;v<this.symbolInstances.length;v++){const x=this.symbolInstances.get(v);this._addTextDebugCollisionBoxes(g,r,s,x.textBoxStartIndex,x.textBoxEndIndex,x),this._addTextDebugCollisionBoxes(g,r,s,x.verticalTextBoxStartIndex,x.verticalTextBoxEndIndex,x),this._addIconDebugCollisionBoxes(f,r,s,x.iconBoxStartIndex,x.iconBoxEndIndex,x),this._addIconDebugCollisionBoxes(f,r,s,x.verticalIconBoxStartIndex,x.verticalIconBoxEndIndex,x)}}getSymbolInstanceTextSize(r,s,u,f){const g=this.text.placedSymbolArray.get(s.rightJustifiedTextSymbolIndex>=0?s.rightJustifiedTextSymbolIndex:s.centerJustifiedTextSymbolIndex>=0?s.centerJustifiedTextSymbolIndex:s.leftJustifiedTextSymbolIndex>=0?s.leftJustifiedTextSymbolIndex:s.verticalPlacedTextSymbolIndex>
vendor: 3,625 bytes, line 24
24=0?s.verticalPlacedTextSymbolIndex:f),v=BA(this.textSizeData,r,g)/Eo;return this.tilePixelRatio*v}getSymbolInstanceIconSize(r,s,u){const f=this.icon.placedSymbolArray.get(u),g=BA(this.iconSizeData,r,f);return this.tilePixelRatio*g}_commitDebugCollisionVertexUpdate(r,s,u,f){r.emplaceBack(s,-u,-u,f),r.emplaceBack(s,u,-u,f),r.emplaceBack(s,u,u,f),r.emplaceBack(s,-u,u,f)}_updateTextDebugCollisionBoxes(r,s,u,f,g,v,x){for(let w=f;w<g;w++){const A=u.get(w),R=this.getSymbolInstanceTextSize(r,v,s,w);this._commitDebugCollisionVertexUpdate(this.textCollisionBox.collisionVertexArrayExt,R,A.padding,v.zOffset)}}_updateIconDebugCollisionBoxes(r,s,u,f,g,v,x){for(let w=f;w<g;w++){const A=u.get(w),R=this.getSymbolInstanceIconSize(r,s,v.placedIconSymbolIndex);this._commitDebugCollisionVertexUpdate(this.iconCollisionBox.collisionVertexArrayExt,R,A.padding,v.zOffset)}}updateCollisionDebugBuffers(r,s,u,f){if(!this.hasDebugData())return;this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexArrayExt.clear(),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexArrayExt.clear();const g=c_(this.iconSizeData,r,f),v=c_(this.textSizeData,r,u);for(let x=0;x<this.symbolInstances.length;x++){const w=this.symbolInstances.get(x);this._updateTextDebugCollisionBoxes(v,r,s,w.textBoxStartIndex,w.textBoxEndIndex,w,u),this._updateTextDebugCollisionBoxes(v,r,s,w.verticalTextBoxStartIndex,w.verticalTextBoxEndIndex,w,u),this._updateIconDebugCollisionBoxes(g,r,s,w.iconBoxStartIndex,w.iconBoxEndIndex,w,f),this._updateIconDebugCollisionBoxes(g,r,s,w.verticalIconBoxStartIndex,w.verticalIconBoxEndIndex,w,f)}this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexBufferExt&&this.textCollisionBox.collisionVertexBufferExt.updateData(this.textCollisionBox.collisionVertexArrayExt),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexBufferExt&&this.iconCollisionBox.collisionVertexBufferExt.updateData(this.iconCollisionBox.collisionVertexArrayExt)}_deserializeCollisionBoxesForSymbol(r,s,u,f,g,v,x,w,A){const R={};if(s<u){const{x1:M,y1:O,x2:B,y2:N,padding:G,projectedAnchorX:H,projectedAnchorY:J,projectedAnchorZ:re,tileAnchorX:Q,tileAnchorY:le,featureIndex:ue}=r.get(s);R.textBox={x1:M,y1:O,x2:B,y2:N,padding:G,projectedAnchorX:H,projectedAnchorY:J,projectedAnchorZ:re,tileAnchorX:Q,tileAnchorY:le},R.textFeatureIndex=ue}if(f<g){const{x1:M,y1:O,x2:B,y2:N,padding:G,projectedAnchorX:H,projectedAnchorY:J,projectedAnchorZ:re,tileAnchorX:Q,tileAnchorY:le,featureIndex:ue}=r.get(f);R.verticalTextBox={x1:M,y1:O,x2:B,y2:N,padding:G,projectedAnchorX:H,projectedAnchorY:J,projectedAnchorZ:re,tileAnchorX:Q,tileAnchorY:le},R.verticalTextFeatureIndex=ue}if(v<x){const{x1:M,y1:O,x2:B,y2:N,padding:G,projectedAnchorX:H,projectedAnchorY:J,projectedAnchorZ:re,tileAnchorX:Q,tileAnchorY:le,featureIndex:ue}=r.get(v);R.iconBox={x1:M,y1:O,x2:B,y2:N,padding:G,projectedAnchorX:H,projectedAnchorY:J,projectedAnchorZ:re,tileAnchorX:Q,tileAnchorY:le},R.iconFeatureIndex=ue}if(w<A){const{x1:M,y1:O,x2:B,y2:N,padding:G,projectedAnchorX:H,projectedAnchorY:J,projectedAnchorZ:re,tileAnchorX:Q,tileAnchorY:le,featureIndex:ue}=r.get(w);R.verticalIconBox={x1:M,y1:O,x2:B,y2:N,padding:G,projectedAnchorX:H,projectedAnchorY:J,projectedAnchorZ:re,tileAnchorX:Q,tileAnchorY:le},R.verticalIconFeatureIndex=ue}return R}deserializeCollisionBoxes(r){this.collisionArrays=[];for(let s=0;s<this.symbolInstances.length;s++){const u=this.symbolInstances.get(s);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(r,u.textBoxStartIndex,u.textBoxEndIndex,u.verticalTextBoxStartIndex,u.verticalTextBoxEndIndex,u.
24iconBoxStartIndex,u.iconBoxEndIndex,u.verticalIconBoxStartIndex,u.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}hasIconTextFit(){return this.hasAnyIconTextFit}addIndicesForPlacedSymbol(r,s){const u=r.placedSymbolArray.get(s),f=u.vertexStartIndex+4*u.numGlyphs;for(let g=u.vertexStartIndex;g<f;g+=4)r.indexArray.emplaceBack(g,g+1,g+2),r.indexArray.emplaceBack(g+1,g+2,g+3)}getSortedSymbolIndexes(r){if(this.sortedAngle===r&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;const s=Math.sin(r),u=Math.cos(r),f=[],g=[],v=[];for(let x=0;x<this.symbolInstances.length;++x){v.push(x);const w=this.symbolInstances.get(x);f.push(0|Math.round(s*w.tileAnchorX+u*w.tileAnchorY)),g.push(w.featureIndex)}return v.sort((x,w)=>f[x]-f[w]||g[w]-g[x]),v}getSortedIndexesByZOffset(){if(!this.zOffsetSortDirty)return this.symbolInstanceIndexesSortedZOffset;if(!this.symbolInstanceIndexesSortedZOffset){this.symbolInstanceIndexesSortedZOffset=[];for(let r=0;r<this.symbolInstances.length;++r)this.symbolInstanceIndexesSortedZOffset.push(r)}return this.zOffsetSortDirty=!1,this.symbolInstanceIndexesSortedZOffset.sort((r,s)=>this.symbolInstances.get(s).zOffset-this.symbolInstances.get(r).zOffset)}addToSortKeyRanges(r,s){const u=this.sortKeyRanges.at(-1);u&&u.sortKey===s?u.symbolInstanceEnd=r+1:this.sortKeyRanges.push({sortKey:s,symbolInstanceStart:r,symbolInstanceEnd:r+1})}sortFeatures(r){if(this.sortFeaturesByY&&this.sortedAngle!==r)if(this.text.segments.get().length>1||this.icon.segments.get().length>1)this.sortFeaturesWithinSegments();else{this.symbolInstanceIndexes=this.getSortedSymbolIndexes(r),this.sortedAngle=r,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const s of this.symbolInstanceIndexes){const u=this.symbolInstances.get(s);this.featureSortOrder.push(u.featureIndex);const{rightJustifiedTextSymbolIndex:f,centerJustifiedTextSymbolIndex:g,leftJustifiedTextSymbolIndex:v,verticalPlacedTextSymbolIndex:x,placedIconSymbolIndex:w,verticalPlacedIconSymbolIndex:A}=u;f>=0&&this.addIndicesForPlacedSymbol(this.text,f),g>=0&&g!==f&&this.addIndicesForPlacedSymbol(this.text,g),v>=0&&v!==g&&v!==f&&this.addIndicesForPlacedSymbol(this.text,v),x>=0&&this.addIndicesForPlacedSymbol(this.text,x),w>=0&&this.addIndicesForPlacedSymbol(this.icon,w),A>=0&&this.addIndicesForPlacedSymbol(this.icon,A)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}getOrCreateSortedSymbolsByBatch(r,s){const u=(this.text.uboBinder&&this.text.uboBinder.maxFeaturesPerBatch>0?this.text.uboBinder:this.icon.uboBinder&&this.icon.uboBinder.maxFeaturesPerBatch>0?this.icon.uboBinder:null).maxFeaturesPerBatch;if(this.symbolsByBatch)for(const f of this.symbolsByBatch.values())for(const g of f){const v=this.symbolInstances.get(g.index);g.rotatedY=0|Math.round(r*v.tileAnchorX+s*v.tileAnchorY)}else{this.symbolsByBatch=new Map;for(let f=0;f<this.symbolInstances.length;f++){const g=this.symbolInstances.get(f),v=Math.floor(f/u),x=0|Math.round(r*g.tileAnchorX+s*g.tileAnchorY);this.symbolsByBatch.has(v)||this.symbolsByBatch.set(v,[]),this.symbolsByBatch.get(v).push({index:f,rotatedY:x,featureIndex:g.featureIndex})}}for(const f of this.symbolsByBatch.values())f.sort((g,v)=>g.rotatedY-v.rotatedY||v.featureIndex-g.featureIndex);return this.symbolsByBatch}rebuildTextSegmentIndices(r,s){for(const u of r){const f=u.batchIndex;if(f===void 0)continue;const g=s.get(f);if(!g){u.primitiveOffset=this.text.indexArray.length,u.primitiveLength=0;continue}u.primitiveOffset=this.text.indexArray.length;const v=this.text.indexArray.length;for(const{index:x}of g){const w=this.symbolInstances.get(x),{rightJustifiedTextSymbolIndex:A,centerJustifiedTextSymbolIndex:R,leftJustifiedTextSymbolIndex:M,verticalPlacedTextSymbolIndex:O}=w;A>=0&&this.addIndicesForPlacedSymbol(this.text,A),R>=0&&R!==A&&this.addIndicesForPlacedSymbol(this.text,R),M>=0&&M!==R&&M!==A&&this.addIndicesForPlacedSymbol(this.text,M),O>=0&&this.addIndicesForPlacedSymbol(this.text,O)}u.primitiveLength=this.text.indexArray.length-v}}rebuildIconSegmentIndices(r,s){for(const u of r){const f=u.batchIndex;if(f===void 0)continue;const g=s.get(f);if(!g){u.primitiveOffset=this.icon.indexArray.length,u.primitiveLength=0;continue}u.primitiveOffset=this.icon.indexArray.length;const v=this.icon.indexArray.length;for(const{index:x}of g){const w=this.symbolInstances.get(x),{placedIconSymbolIndex:A,verticalPlacedIconSymbolIndex:R}=w;A>=0&&this.addIndicesForPlacedSymbol(this.icon,A),R>=0&&this.addIndicesForPlacedSymbol(this.icon,R)}u.primitiveLength=this.icon.indexArray.length-v}}sortFeaturesWithinSegments(){this.featureSortOrder=[];const r=Math.sin(this.sortedAngle),s=Math.cos(this.sortedAngle),u=this.getOrCreateSortedSymbolsByBatch(r,s),f=Array.from(u.keys()).sort((g,v)=>g-v);for(const g of f){const v=u.get(g);for(const{index:x}of v){const w=this.symbolInstances.get(x);this.featureSortOrder.push(w.featureIndex)}}this.text.indexArray.clear(),this.icon.indexArray.clear(),this.rebuildTextSegmentIndices(this.text.segments.get(),u),this.rebuildIconSegmentIndices(this.icon.segments.get(),u),this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}getElevationFeatureForText(r){const s=this.symbolInstances.get(this.text.symbolInstanceIndices[r]).elevationFeatureIndex;let u;return this.elevationFeatures&&s<this.elevationFeatures.length&&(u=this.elevationFeatures[s]),u}}function dF(l,r){return r.replace(/{([^{}]+)}/g,(s,u)=>u in l?String(l[u]):"")}let hF,fF,JA;Kt(rc,"SymbolBucket",{omit:["layers","collisionBoxArray","compareText","features"]}),rc.addDynamicAttributes=h_;class pF{constructor(r){this.type=r.property.overrides?r.property.overrides.runtimeType:vu,this.defaultValue=r}evaluate(r){if(r.formattedSection){const s=this.defaultValue.property.overrides;if(s&&s.hasOverride(r.formattedSection))return s.getOverride(r.formattedSection)}return r.feature&&r.featureState?this.defaultValue.evaluate(r.feature,r.featureState):this.defaultValue.property.specification.default}eachChild(r){this.defaultValue.isConstant()||r(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Kt(pF,"FormatSectionOverride",{omit:["defaultValue"]});const QA=()=>JA||(JA={layout:hF||(hF=new fi({"symbol-placement":new Pt(ze.layout_symbol["symbol-placement"]),"symbol-spacing":new Pt(ze.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Pt(ze.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Dt(ze.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Pt(ze.layout_symbol["symbol-z-order"]),"symbol-z-elevate":new Pt(ze.layout_symbol["symbol-z-elevate"]),"symbol-elevation-reference":new Pt(ze.layout_symbol["symbol-elevation-reference"]),"icon-allow-overlap":new Pt(ze.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Pt(ze.layout_symbol["icon-ignore-placement"]),"icon-optional":new Pt(ze.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Pt(ze.layout_symbol["icon-rotation-alignment"]),"icon-size":new Dt(ze.layout_symbol["icon-size"]),"icon-size-scale-range":new Pt(ze.layout_symbol["icon-size-scale-range"]),"icon-text-fit":new Dt(ze.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Dt(ze.layout_symbol["icon-text-fit-padding"]),"icon-image":new Dt(ze.layout_symbol["icon-image"]),"icon-image-use-theme":new Pt({type:"string",default:"default","property-type":"data-constant"}),"icon-rotate":new Dt(ze.layout_symbol["icon-rotate"]),"icon-padding":new Pt(ze.layout_symbol["icon-padding"]),"icon-keep-upright":new Pt(ze.layout_symbol["icon-keep-upright"]),"icon-offset":new Dt(ze.layout_symbol["icon-offset"]),"icon-anchor":new Dt(ze.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Pt(ze.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Pt(ze.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Pt(ze.layout_symbol["text-rotation-alignment"]),"text-field":new Dt(ze.layout_symbol["text-field"]),"text-font":new Dt(ze.layout_symbol["text-font"]),"text-size":new Dt(ze.layout_symbol["text-size"]),"text-size-scale-range":new Pt(ze.layout_symbol["text-size-scale-range"]),"text-max-width":new Dt(ze.layout_symbol["text-max-width"]),"text-line-height":new Dt(ze.layout_symbol["text-line-height"]),"text-letter-spacing":new Dt(ze.layout_symbol["text-letter-spacing"]),"text-justify":new Dt(ze.layout_symbol["text-justify"]),"text-radial-offset":new Dt(ze.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Pt(ze.layout_symbol["text-variable-anchor"]),"text-anchor":new Dt(ze.layout_symbol["text-anchor"]),"text-max-angle":new Pt(ze.layout_symbol["text-max-angle"]),"text-writing-mode":new Pt(ze.layout_symbol["text-writing-mode"]),"text-rotate":new Dt(ze.layout_symbol["text-rotate"]),"text-padding":new Pt(ze.layout_symbol["text-padding"]),"text-keep-upright":new Pt(ze.layout_symbol["text-keep-upright"]),"text-transform":new Dt(ze.layout_symbol["text-transform"]),"text-offset":new Dt(ze.layout_symbol["text-offset"]),"text-allow-overlap":new Pt(ze.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Pt(ze.layout_symbol["text-ignore-placement"]),"text-optional":new Pt(ze.layout_symbol["text-optional"]),visibility:new Pt(ze.layout_symbol.visibility)}
24)),paint:fF||(fF=new fi({"icon-opacity":new Dt(ze.paint_symbol["icon-opacity"]),"icon-occlusion-opacity":new Dt(ze.paint_symbol["icon-occlusion-opacity"]),"icon-emissive-strength":new Dt(ze.paint_symbol["icon-emissive-strength"]),"text-emissive-strength":new Dt(ze.paint_symbol["text-emissive-strength"]),"icon-color":new Dt(ze.paint_symbol["icon-color"]),"icon-halo-color":new Dt(ze.paint_symbol["icon-halo-color"]),"icon-halo-width":new Dt(ze.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Dt(ze.paint_symbol["icon-halo-blur"]),"icon-translate":new Pt(ze.paint_symbol["icon-translate"]),"icon-translate-anchor":new Pt(ze.paint_symbol["icon-translate-anchor"]),"icon-image-cross-fade":new Pt(ze.paint_symbol["icon-image-cross-fade"]),"text-opacity":new Dt(ze.paint_symbol["text-opacity"]),"text-occlusion-opacity":new Dt(ze.paint_symbol["text-occlusion-opacity"]),"text-color":new Dt(ze.paint_symbol["text-color"],{runtimeType:Es,getOverride:l=>l.textColor,hasOverride:l=>!!l.textColor}),"text-halo-color":new Dt(ze.paint_symbol["text-halo-color"]),"text-halo-width":new Dt(ze.paint_symbol["text-halo-width"]),"text-halo-blur":new Dt(ze.paint_symbol["text-halo-blur"]),"text-translate":new Pt(ze.paint_symbol["text-translate"]),"text-translate-anchor":new Pt(ze.paint_symbol["text-translate-anchor"]),"icon-color-saturation":new Pt(ze.paint_symbol["icon-color-saturation"]),"icon-color-contrast":new Pt(ze.paint_symbol["icon-color-contrast"]),"icon-color-brightness-min":new Pt(ze.paint_symbol["icon-color-brightness-min"]),"icon-color-brightness-max":new Pt(ze.paint_symbol["icon-color-brightness-max"]),"symbol-z-offset":new Dt(ze.paint_symbol["symbol-z-offset"]),"icon-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"}),"icon-halo-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"}),"text-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"}),"text-halo-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"})}))},JA);class kS extends Is{constructor(r,s,u,f){super(r,QA(),s,u,f,r.layout?r.layout["icon-image-use-theme"]:null),this._colorAdjustmentMatrix=$([]),this.hasOcclusionOpacityProperties=r.paint!==void 0&&("icon-occlusion-opacity"in r.paint||"text-occlusion-opacity"in r.paint)}_handleSpecialPaintPropertyUpdate(r){r!=="icon-occlusion-opacity"&&r!=="text-occlusion-opacity"||(this.hasOcclusionOpacityProperties=!0)}recalculate(r,s){super.recalculate(r,s),this.appearances&&this.appearances.forEach(f=>{f.recalculate(r,s,this.iconImageUseTheme)}),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")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const u=this.layout.get("text-writing-mode");if(u){const f=[];for(const g of u)f.includes(g)||f.push(g);this.layout._values["text-writing-mode"]=f}else this.layout._values["text-writing-mode"]=this.layout.get("symbol-placement")==="point"?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getColorAdjustmentMatrix(r,s,u,f){return this._saturation===r&&this._contrast===s&&this._brightnessMin===u&&this._brightnessMax===f||(this._colorAdjustmentMatrix=(function(g,v,x,w){g=Vl(g),v=ho(v);const A=U(),R=g/3,M=1-2*R,O=[M,R,R,0,R,M,R,0,R,R,M,0,0,0,0,1],B=.5-.5*v,N=w-x;return X(A,[N,0,0,0,0,N,0,0,0,0,N,0,x,x,x,1],[v,0,0,0,0,v,0,0,0,0,v,0,B,B,B,1]),X(A,A,O),A})(r,s,u,f),this._saturation=r,this._contrast=s,this._brightnessMin=u,this._brightnessMax=f),this._colorAdjustmentMatrix}getValueAndResolveTokens(r,s,u,f){const g=this.layout.get(r).evaluate(s,{},u,f),v=this._unevaluatedLayout._values[r];return v.isDataDriven()||Ag(v.value)||!g?g:dF(s.properties,g)}getAppearanceValueAndResolveTokens(r,s,u,f,g){const v=r.getLayoutProperty(s);if(!v)return;const x=v.evaluate(u,{},f,g),w=r.getUnevaluatedLayoutProperties()._values[s];return w.isDataDriven()||Ag(w.value)||!x||typeof x!="string"?x:dF(u.properties,x)}createBucket(r){return new rc(r)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const r of QA().paint.overridableProperties){if(!kS.hasPaintOverride(this.layout,r))continue;const s=this.paint.get(r),u=new pF(s),f=new y0(u,s.property.specification,this.scope,this.options,this.layout.get("icon-image-use-theme"));let g=null;g=s.value.kind==="constant"||s.value.kind==="source"?new Dp("source",f):new Zl("composite",f,s.value.zoomStops,s.value.interpolationType),this.paint._values[r]=new Au(s.property,g,s.parameters)}}_handleOverridablePaintPropertyUpdate(r,s,u){return!(!this.layout||s.isDataDriven()||u.isDataDriven())&&kS.hasPaintOverride(this.layout,r)}static hasPaintOverride(r,s){const u=r.get("text-field"),f=QA().paint.properties[s];let g=!1;
24const v=x=>{for(const w of x)if(f.overrides&&f.overrides.hasOverride(w))return void(g=!0)};if(u.value.kind==="constant"&&u.value.value instanceof ss)v(u.value.value.sections);else if(u.value.kind==="source"){const x=A=>{g||(A instanceof ml&&Zi(A.value)===Dh?v(A.value.sections):A instanceof Nh?v(A.sections):A.eachChild(x))},w=u.value;w._styleExpression&&x(w._styleExpression.expression)}return g}getProgramIds(){return["symbol"]}getDefaultProgramParams(r,s,u){return{config:new Od(this,{zoom:s,lut:u}),overrideFog:!1}}hasElevation(){return this.layout&&this.layout.get("symbol-elevation-reference")==="hd-road-markup"}}let mF,gF,_F,yF;var MS=Jn([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Uint16",components:2}]);function LS(l,r,s,u,f,g,v,x){const w=[l,r,1,s,u,1,f,g,1],A=[v,x,1],R=D([],w),[M,O,B]=kt(A,A,R);return V(w,w,[M,0,0,0,O,0,0,0,B])}function vF(l,r,s,u,f,g,v,x){const w=(function(A,R,M,O,B,N,G,H){const J=LS(0,0,1,0,1,1,0,1),re=LS(A,R,M,O,B,N,G,H);return V(re,re,D([],J))})(l,r,s,u,f,g,v,x);return[w[2]/w[8]/Bt,w[5]/w[8]/Bt]}function OS(l){return[l[0],Math.min(Math.max(l[1],-85.051129),oa)]}class bF extends Lh{constructor(r,s,u,f){super(),this.id=r,this.dispatcher=u,this.coordinates=s.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.onNorthPole=!1,this.onSouthPole=!1,this.setEventedParent(f),this.options=s,this._dirty=!1}load(r,s){if(this._loaded=s||!1,this.fire(new fl("dataloading",{dataType:"source"})),this.url=this.options.url,!this.url)return r&&(this.coordinates=r),this._loaded=!0,void this._finishLoading();this._imageRequest=Vy(this.map._requestManager.transformRequest(this.url,pd.Image),(u,f)=>{this._imageRequest=null,this._loaded=!0,u?this.fire(new kh(u)):f&&(this.image=f,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,r&&(this.coordinates=r),this._finishLoading())})}loaded(){return this._loaded}updateImage(r){return r.url?(this._imageRequest&&r.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=r.url,this.load(r.coordinates,this._loaded),this):this}setTexture(r){if(!(r.handle instanceof WebGLTexture))throw new Error("The provided handle is not a WebGLTexture instance");return this.texture=new Tv(this.map.painter.context,r.handle),this.width=r.dimensions[0],this.height=r.dimensions[1],this._dirty=!1,this._loaded=!0,this._finishLoading(),this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new fl("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(r){this.map=r,this.load()}onRemove(r){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),!this.texture||this.texture instanceof Tv||this.texture.destroy(),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy())}setCoordinates(r){if(this.coordinates=r,this._boundsArray=void 0,this._unsupportedCoords=!1,!r.length)return this;this.onNorthPole=!1,this.onSouthPole=!1;let s=r[0][1],u=r[0][1];for(const g of r)g[1]>u&&(u=g[1]),g[1]<s&&(s=g[1]);const f=(u+s)/2;if(f>oa?this.onNorthPole=!0:f<-85.051129&&(this.onSouthPole=!0),!this.onNorthPole&&!this.onSouthPole){const g=r.map(ls.fromLngLat);this.tileID=(function(v){let x=1/0,w=1/0,A=-1/0,R=-1/0;for(const G of v)x=Math.min(x,G.x),w=Math.min(w,G.y),A=Math.max(A,G.x),R=Math.max(R,G.y);const M=Math.max(A-x,R-w),O=Math.max(0,Math.floor(-Math.log2(M))),B=Math.pow(2,O);let N=Math.floor((x+A)/2*B);return N>1&&(N-=1),new Ae(O,N,Math.floor((w+R)/2*B))})(g),this.minzoom=this.maxzoom=this.tileID.z}return this.fire(new fl("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){!this.texture||this.texture instanceof Tv||(this.texture.destroy(),this._dirty=!0),this.texture=null,this._boundsArray=void 0,this._unsupportedCoords=!1}_prepareData(r){for(const H in this.tiles){const J=this.tiles[H];J.state!=="loaded"&&(J.state="loaded",J.texture=this.texture)}if(this._boundsArray||this.onNorthPole||this.onSouthPole||this._unsupportedCoords)return;const s=im(new Ae(0,0,0),this.map.transform.projection),u=[s.projection.project(this.coordinates[0][0],this.coordinates[0][1]),s.projection.project(this.coordinates[1][0],this.coordinates[1][1]),s.projection.project(this.coordinates[2][0],this.coordinates[2][1]),s.projection.project(this.coordinates[3][0],this.coordinates[3][1])];if(!(function(H){const J=H[1].x-H[0].x,re=H[1].y-H[0].y,Q=H[2].x-H[1].x,le=H[2].y-H[1].y,ue=H[3].x-H[2].x,he=H[3].y-H[2].y,Te=H[0].x-H[3].x,me=H[0].y-H[3].y,xe=J*le-Q*re,_e=Q*he-ue*le,we=ue*me-Te*he,je=Te*re-J*me;return xe>0&&_e>0&&we>0&&je>0||xe<0&&_e<0&&we<0&&je<0})(u))return console.warn("Image source coordinates are defining non-convex area in the Mercator projection"),void(this._unsupportedCoords=!0);const f=im(this.tileID,this.map.transform.projection),[g,v,x,w]=this.coordinates.map(H=>{const J=f.projection.project(H[0],H[1]);
vendor: 4,534 bytes, line 24
24return oF(f,J)._round()});this.perspectiveTransform=vF(g.x,g.y,v.x,v.y,x.x,x.y,w.x,w.y);const A=this._boundsArray=new Pd;A.emplaceBack(g.x,g.y,0,0),A.emplaceBack(v.x,v.y,Bt,0),A.emplaceBack(w.x,w.y,0,Bt),A.emplaceBack(x.x,x.y,Bt,Bt),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy()),this.boundsBuffer=r.createVertexBuffer(A,MS.members),this.boundsSegments=Wr.simpleSegment(0,0,4,2);const R=[],M=(function(H){return[OS(H[0]),OS(H[1]),OS(H[2]),OS(H[3])]})(this.coordinates),[O,B,N,G]=(function(H){let J=H[0][0],re=J,Q=H[0][1],le=Q;for(let ue=1;ue<H.length;ue++)H[ue][0]<J?J=H[ue][0]:H[ue][0]>re&&(re=H[ue][0]),H[ue][1]<Q?Q=H[ue][1]:H[ue][1]>le&&(le=H[ue][1]);return[J,Q,re-J,le-Q]})(M);{const H=new Pd,[J,re,Q,le]=(function(nt){let bt=nt[0].x,Ze=bt,et=nt[0].y,ot=et;for(let ft=1;ft<nt.length;ft++)nt[ft].x<bt?bt=nt[ft].x:nt[ft].x>Ze&&(Ze=nt[ft].x),nt[ft].y<et?et=nt[ft].y:nt[ft].y>ot&&(ot=nt[ft].y);return[bt,et,Ze-bt,ot-et]})(u),ue=nt=>[(nt.x-J)/Q,(nt.y-re)/le],[he,Te,me,xe]=u.map(ue),_e=(function(nt,bt,Ze,et,ot,ft,_t,Ft){const ut=LS(0,0,1,0,1,1,0,1);return V(ut,ut,D([],LS(nt,bt,Ze,et,ot,ft,_t,Ft)))})(he[0],he[1],Te[0],Te[1],me[0],me[1],xe[0],xe[1]);this.elevatedGlobePerspectiveTransform=vF(he[0],he[1],Te[0],Te[1],me[0],me[1],xe[0],xe[1]);const we=(nt,bt)=>{R.push(nt.lng);const Ze=Math.round((nt.lng-O)/N*Bt),et=Math.round((nt.lat-B)/G*Bt),ot=ue(bt),ft=kt([],[ot[0],ot[1],1],_e),_t=Math.round(ft[0]/ft[2]*Bt),Ft=Math.round(ft[1]/ft[2]*Bt);H.emplaceBack(Ze,et,_t,Ft)},je=u[3].x-u[0].x,He=u[3].y-u[0].y,Qe=u[2].x-u[1].x,it=u[2].y-u[1].y;for(let nt=0;nt<65;nt++){const bt=nt/64,Ze=[u[0].x+bt*je,u[0].y+bt*He],et=[u[1].x+bt*Qe,u[1].y+bt*it],ot=et[0]-Ze[0],ft=et[1]-Ze[1];for(let _t=0;_t<65;_t++){const Ft=_t/64,ut={x:Ze[0]+ot*Ft,y:Ze[1]+ft*Ft};we(s.projection.unproject(ut.x,ut.y),ut)}}this.elevatedGlobeVertexBuffer=r.createVertexBuffer(H,MS.members)}{this.maxLongitudeTriangleSize=0;let H=[],J=new _i;const re=(Q,le,ue)=>{J.emplaceBack(Q,le,ue);const he=R[Q],Te=R[le],me=R[ue],xe=Math.min(Math.min(he,Te),me),_e=Math.max(Math.max(he,Te),me)-xe;_e>this.maxLongitudeTriangleSize&&(this.maxLongitudeTriangleSize=_e),H.push(xe+_e/2)};for(let Q=0;Q<64;Q++)for(let le=0;le<64;le++){const ue=65*Q+le,he=ue+1,Te=ue+65,me=Te+1;re(ue,Te,he),re(he,Te,me)}[H,J]=(function(Q,le){const ue=Array.from({length:Q.length},(me,xe)=>xe);ue.sort((me,xe)=>Q[me]-Q[xe]);const he=[],Te=new _i;for(let me=0;me<ue.length;me++){const xe=ue[me];he.push(Q[xe]);const _e=3*xe,we=_e+1;Te.emplaceBack(le.uint16[_e],le.uint16[we],le.uint16[we+1])}return[he,Te]})(H,J),this.elevatedGlobeTrianglesCenterLongitudes=H,this.elevatedGlobeIndexBuffer=r.createIndexBuffer(J)}this.elevatedGlobeSegments=Wr.simpleSegment(0,0,4225,8192),this.elevatedGlobeGridMatrix=new Float32Array([0,N/Bt,0,G/Bt,0,0,B,O,0])}prepare(){const r=Object.keys(this.tiles).length!==0;if(this.tileID&&!r)return;const s=this.map.painter.context,u=s.gl;!this._dirty||this.texture instanceof Tv||(this.texture?this.texture.update(this.image):(this.texture=new zu(s,this.image,u.RGBA8),this.texture.bind(u.LINEAR,u.CLAMP_TO_EDGE)),this._dirty=!1),r&&this._prepareData(s)}loadTile(r,s){this.tileID&&this.tileID.equals(r.tileID.canonical)?(this.tiles[String(r.tileID.wrap)]=r,r.buckets={},s(null)):(r.state="errored",s(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}getSegmentsForLongitude(r){const s=this.elevatedGlobeSegments;if(!this.elevatedGlobeTrianglesCenterLongitudes||!s)return null;const u=this.elevatedGlobeTrianglesCenterLongitudes;let f=(g=r+180)+360*Math.round((u[0]-g)/360);var g;const v=new Wr,x=(M,O)=>{v.segments.push({vertexOffset:0,primitiveOffset:M,vertexLength:s.segments[0].vertexLength,primitiveLength:O,sortKey:void 0,vaos:{}})},w=.51*this.maxLongitudeTriangleSize;if(Math.abs(u[0]-f)<=w){const M=So(u,0,u.length,f+w);return M===u.length||x(M,Xo(u,M+1,u.length,f+360-w)-M),v}f<u[0]&&(f+=360);const A=Xo(u,0,u.length,f-w);if(A===u.length)return x(0,u.length),v;x(0,A-0);const R=So(u,A+1,u.length,f+w);return R!==u.length&&x(R,u.length-R),v}}const eI=1024,fq=(Math.pow(eI,2)-1)/268170240;class xF extends Is{constructor(r,s,u,f){super(r,{layout:_F||(_F=new fi({visibility:new Pt(ze.layout_raster.visibility)})),paint:yF||(yF=new fi({"raster-opacity":new Pt(ze.paint_raster["raster-opacity"]),"raster-color":new Iu(ze.paint_raster["raster-color"]),"raster-color-mix":ne
24w Pt(ze.paint_raster["raster-color-mix"]),"raster-color-range":new Pt(ze.paint_raster["raster-color-range"]),"raster-hue-rotate":new Pt(ze.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Pt(ze.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Pt(ze.paint_raster["raster-brightness-max"]),"raster-saturation":new Pt(ze.paint_raster["raster-saturation"]),"raster-contrast":new Pt(ze.paint_raster["raster-contrast"]),"raster-resampling":new Pt(ze.paint_raster["raster-resampling"]),"raster-fade-duration":new Pt(ze.paint_raster["raster-fade-duration"]),"raster-emissive-strength":new Pt(ze.paint_raster["raster-emissive-strength"]),"raster-array-band":new Pt(ze.paint_raster["raster-array-band"]),"raster-elevation":new Pt(ze.paint_raster["raster-elevation"]),"raster-elevation-reference":new Pt(ze.paint_raster["raster-elevation-reference"]),"raster-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"})}))},s,u,f),this.updateColorRamp(),this._curRampRange=[NaN,NaN]}getProgramIds(){return["raster"]}hasColorMap(){return!!this._transitionablePaint._values["raster-color"].value.value}tileCoverLift(){return this.paint.get("raster-elevation")}isDraped(r){return!(r&&r._source instanceof bF&&(r._source.onNorthPole||r._source.onSouthPole))&&this.paint.get("raster-elevation")===0}_handleSpecialPaintPropertyUpdate(r){r!=="raster-color"&&r!=="raster-color-range"||(this._curRampRange=[NaN,NaN],this.updateColorRamp())}_clear(){this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}updateColorRamp(r){if(!this.hasColorMap()||!this._curRampRange)return;const s=this._transitionablePaint._values["raster-color"].value.expression,[u,f]=r||this._transitionablePaint._values["raster-color-range"].value.expression.evaluate({zoom:0})||[NaN,NaN];isNaN(u)&&isNaN(f)||u===this._curRampRange[0]&&f===this._curRampRange[1]||(this.colorRamp=Er({expression:s,evaluationKey:"rasterValue",image:this.colorRamp,clips:[{start:u,end:f}],resolution:eI}),this.colorRampTexture=null,this._curRampRange=[u,f])}is3D(r){return this.paint.get("raster-elevation")>0}}let wF,SF,TF,EF,CF,AF,IF;class PF extends Is{constructor(r,s,u,f){super(r,{layout:wF||(wF=new fi({visibility:new Pt(ze["layout_raster-particle"].visibility)})),paint:SF||(SF=new fi({"raster-particle-array-band":new Pt(ze["paint_raster-particle"]["raster-particle-array-band"]),"raster-particle-count":new Pt(ze["paint_raster-particle"]["raster-particle-count"]),"raster-particle-color":new Iu(ze["paint_raster-particle"]["raster-particle-color"]),"raster-particle-max-speed":new Pt(ze["paint_raster-particle"]["raster-particle-max-speed"]),"raster-particle-speed-factor":new Pt(ze["paint_raster-particle"]["raster-particle-speed-factor"]),"raster-particle-fade-opacity-factor":new Pt(ze["paint_raster-particle"]["raster-particle-fade-opacity-factor"]),"raster-particle-reset-rate-factor":new Pt(ze["paint_raster-particle"]["raster-particle-reset-rate-factor"]),"raster-particle-elevation":new Pt(ze["paint_raster-particle"]["raster-particle-elevation"]),"raster-particle-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"})}))},s,u,f),this._updateColorRamp(),this.lastInvalidatedAt=Qs.now()}_clear(){this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null),this.tileFramebuffer&&(this.tileFramebuffer.destroy(),this.tileFramebuffer=null),this.particleFramebuffer&&(this.particleFramebuffer.destroy(),this.particleFramebuffer=null)}onRemove(r){this.colorRampTexture&&this.colorRampTexture.destroy(),this.tileFramebuffer&&this.tileFramebuffer.destroy(),this.particleFramebuffer&&this.particleFramebuffer.destroy()}hasColorMap(){return!!this._transitionablePaint._values["raster-particle-color"].value.value}getProgramIds(){return["rasterParticle"]}hasOffscreenPass(){return this.visibility!=="none"}isDraped(r){return!1}_handleSpecialPaintPropertyUpdate(r){r!=="raster-particle-color"&&r!=="raster-particle-max-speed"||(this._updateColorRamp(),this._invalidateAnimationState()),r==="raster-particle-count"&&this._invalidateAnimationState()}_updateColorRamp(){if(!this.hasColorMap())return;const r=this._transitionablePaint._values["raster-particle-color"].value.expression,s=this._transitionablePaint._values["raster-particle-max-speed"].value.expression.evaluate({zoom:0});this.colorRamp=Er({expression:r,evaluationKey:"rasterParticleSpeed",image:this.colorRamp,clips:[{start:0,end:s}],resolution:256}),this.colorRampTexture=null}
vendor: 10,967 bytes, line 24
24_invalidateAnimationState(){this.lastInvalidatedAt=Qs.now()}tileCoverLift(){return this.paint.get("raster-particle-elevation")}}class pq extends Is{constructor(r,s){super(r,{},s,null),this.implementation=r,r.slot&&(this.slot=r.slot)}is3D(r){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}isDraped(r){return this.implementation.renderToTile!==void 0}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(r){this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)}onRemove(r){this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)}}function tI(l,r,s){const u=[0,0,1],f=ir([]);return Sr(f,f,s?-ae(l)+Math.PI:ae(l)),hr(f,f,-ae(r)),Vt(u,u,f),_n(u,u)}class RF{constructor(r,s){this.feature=r,this.instancedDataOffset=s,this.instancedDataCount=0,this.rotation=[0,0,0],this.scale=[1,1,1],this.translation=[0,0,0]}}class kF{constructor(){this.maxScale=1,this.maxXYTranslationDistance=0,this.instancedDataArray=new Xg,this.instancesEvaluatedElevation=[],this.features=[],this.idToFeaturesIndex={}}colorForInstance(r){const s=16*r,u=this.instancedDataArray.float32;let f=Math.floor(u[s+2]);const g=1.05*(u[s+2]-f);return f/=100,[u[s]%1*1.05,u[s+1]%1*1.05,g,f]}tileCoordinatesForInstance(r){const s=16*r,u=this.instancedDataArray.float32;let f=u[s+0];return f=f>Bt?f-Bt:f,new St(Math.trunc(f),Math.trunc(u[s+1]))}translationForInstance(r){const s=16*r,u=this.instancedDataArray.float32;return[u[s+4],u[s+5],u[s+6]]}rotationScaleForInstance(r){const s=16*r,u=this.instancedDataArray.float32;return[u[s+7],u[s+8],u[s+9],u[s+10],u[s+11],u[s+12],u[s+13],u[s+14],u[s+15]]}transformForInstance(r){const s=16*r,u=this.instancedDataArray.float32;return[u[s+7],u[s+8],u[s+9],u[s+4],u[s+10],u[s+11],u[s+12],u[s+5],u[s+13],u[s+14],u[s+15],u[s+6],0,0,0,1]}}class nI{constructor(r){this.zoom=r.zoom,this.canonical=r.canonical,this.overscaledZ=this.canonical.z+Math.log2(r.overscaling),this.layers=r.layers,this.layerIds=this.layers.map(s=>s.fqid),this.projection=r.projection,this.index=r.index,this.worldview=r.worldview,this.hasZoomDependentProperties=this.layers[0].isZoomDependent(),this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id),this.hasPattern=!1,this.instancesPerModel={},this.validForExaggeration=0,this.maxVerticalOffset=0,this.maxScale=0,this.maxHeight=0,this.lookupDim=this.zoom>this.canonical.z+1?0:this.zoom>this.canonical.z?256:this.zoom>15?75:100,this.instanceCount=0,this.terrainElevationMin=0,this.terrainElevationMax=0,this.validForDEMTile={id:null,timestamp:0},this.modelUris=[],this.modelsRequested=!1,this.activeReplacements=[],this.replacementUpdateTime=0,this.styleDefinedModelURLs=r.styleDefinedModelURLs,this.hasAppearances=null}updateFootprints(r,s){}updateAppearances(r,s,u,f){return{hasLayoutChanges:!1,hasUboChanges:!1}}populate(r,s,u,f){this.tileToMeter=Aa(u);const g=this.layers[0]._featureFilter.needGeometry;this.lookup=new Uint8Array(this.lookupDim*this.lookupDim);const v=this.layers[0].paint.get("model-elevation-reference")==="hd-road-markup"?s.elevationFeatures:void 0;for(const{feature:x,id:w,index:A,sourceLayerIndex:R}of r){const M=w??(x.properties&&Object.hasOwn(x.properties,"id")?x.properties.id:void 0),O=Ya(x,g);if(!this.layers[0]._featureFilter.filter(new Tr(this.zoom,{worldview:this.worldview,activeFloors:s.activeFloors}),O,u))continue;const B={id:M,sourceLayerIndex:R,index:A,geometry:g?O.geometry:sa(x,u,f),properties:x.properties,type:x.type,patterns:{}},N=this.addFeature(B,B.geometry,O,v,u);N&&s.featureIndex.insert(x,B.geometry,A,R,this.index,this.instancesPerModel[N].instancedDataArray.length,256)}this.lookup=null}evaluateQueryRenderedFeaturePadding(){const r=this.layers[0].modelManager,s=this.layers[0].scope;let u=0;for(const f of this.modelUris){const g=r.getModel(f,s);if(!g)continue;const v=this.instancesPerModel[f];if(v){const x=.5*$t(g.aabb.max,g.aabb.min)*v.maxScale+v.maxXYTranslationDistance,w=Math.min(Bt,Math.max(x/this.tileToMeter,256));u=Math.max(w,u)}}return u}update(r,s,u,f){for(const g in this.instancesPerModel){const v=this.instancesPerModel[g];for(const x in r)Object.hasOwn(v.idToFeaturesIndex,x)&&(this.evaluate(v.features[v.idToFeaturesIndex[x]],r[x],v,!0),this.uploaded=!1)}this.maxHeight=0}updateZoomBasedPaintProperties(){if(!this.hasZoomDependentProperties)return!1;let r=!1;for(const s in this.instancesPerModel){const u=this.instancesPerModel[s];for(const f of u.features){const g=this.layers[0],v=f.feature,x=this.canonical,w=g.paint.get("model-rotation").evaluate(v,{},x),A=g.paint.get("model-scale").evaluate(v,{},x),R=g.paint.get("model-translation").evaluate(v,{},x);Ve(f.rotation,w)&&Ve(f.scale,A)&&Ve(f.translation,R)||(this.evaluate(f,f.featureStates,u,!0),r=!0)}}return r}updateReplacement(r,s,u,f){if(s.updateTime===this.replacementUpdateTime)return!1;this.replacementUpdateTime=s.updateTime;const g=s.getReplacementRegionsForTile(r.toUnwrapped(),!0);if(Yw(this.activeReplacements,g))return!1;this.activeReplacements=g;let v=!1;for(const x in this.instancesPerModel){const w=this.instancesPerModel[x],A=w.instancedDataArray;for(const R of w.features){const M=R.instancedDataOffset,O=R.instancedDataCount;for(let B=0;B<O;B++){const N=16*(B+M);let G=A.float32[N+0];const H=G>Bt;G=H?G-Bt:G;const J=Math.floor(G),re=Math.floor(A.float32[N+1]);let Q=!1;for(const le of this.activeReplacements)if(!aO(le,u,Kw.Model,f)&&!(le.min.x>J||J>le.max.x||le.min.y>re||re>le.max.y)&&(Q=hO(dO(J,re,r.canonical,le.footprintTileId.canonical),le.footprint),Q))break;A.float32[N]=Q?G+Bt:G,v=v||Q!==H}}}return v}isEmpty(){for(const r in this.instancesPerModel)if(this.instancesPerModel[r].instancedDataArray.length!==0)return!1;return!0}uploadPending(){return!this.uploaded}upload(r){if(!this.uploaded)for(const s in this.instancesPerModel){const u=this.instancesPerModel[s];u.instancedDataArray.length<0||u.instancedDataArray.length===0||(u.instancedDataBuffer?u.instancedDataBuffer.updateData(u.instancedDataArray):u.instancedDataBuffer=r.createVertexBuffer(u.instancedDataArray,AH.members,!0,void 0,this.instanceCount))}this.uploaded=!0}destroy(r){for(const u in this.instancesPerModel){const f=this.instancesPerModel[u];f.instancedDataArray.length!==0&&f.instancedDataBuffer&&f.instancedDataBuffer.destroy()}const s=this.layers[0].modelManager;if(r&&s&&this.modelUris&&this.modelsRequested)for(const u of this.modelUris)s.removeModel(u,"",!0)}addFeature(r,s,u,f,g){const v=this.layers[0],x=v.layout.get("model-id"),w=v.layout.get("model-allow-density-reduction"),A=x.evaluate(u,{},this.canonical);if(!A)return On(`modelId is not evaluated for layer ${v.id} and it is not going to get rendered.`),A;!A.includes("://")&&!this.styleDefinedModelURLs[A]||this.modelUris.includes(A)||this.modelUris.push(A),this.instancesPerModel[A]||(this.instancesPerModel[A]=new kF);const R=this.instancesPerModel[A],M=R.instancedDataArray,O=new RF(u,M.length);let B;f&&(B=p.getElevationFeature(r,f));for(const N of s)for(const G of N){if(G.x<0||G.x>=Bt||G.y<0||G.y>=Bt)continue;if(this.lookupDim!==0&&w){const J=(this.lookupDim-1)/Bt,re=this.lookupDim*(G.y*J|0)+G.x*J|0;if(this.lookup){if(this.lookup[re]!==0)continue;this.lookup[re]=1}}this.instanceCount++;const H=M.length;if(M.resize(H+1),f){R.instancesRoadElevation||(R.instancesRoadElevation=[]);const J=B?B.pointElevation(new St(G.x,G.y)):0;R.instancesRoadElevation.push(J)}R.instancesEvaluatedElevation.push(0),M.float32[16*H]=G.x,M.float32[16*H+1]=G.y}return O.instancedDataCount=R.instancedDataArray.length-O.instancedDataOffset,O.instancedDataCount>0&&(r.id&&(R.idToFeaturesIndex[r.id]=R.features.length),R.features.push(O),this.evaluate(O,{},R,!1)),A}getModelUris(){return this.modelUris}evaluate(r,s,u,f){const g=this.layers[0],v=r.feature,x=this.canonical,w=r.rotation=g.paint.get("model-rotation").evaluate(v,s,x),A=r.scale=g.paint.get("model-scale").evaluate(v,s,x),R=r.translation=g.paint.get("model-translation").evaluate(v,s,x),M=Object.assign({},g.paint.get("model-color").evaluate(v,s,x));M.a=g.paint.get("model-color-mix-intensity").evaluate(v,s,x);const O=[];this.maxVerticalOffset<R[2]&&(this.maxVerticalOffset=R[2]);const B=R[0]*R[0]+R[1]*R[1],N=B>0?Math.sqrt(B):0;u.maxScale=Math.max(Math.max(u.maxScale,A[0]),Math.max(A[1],A[2])),u.maxXYTranslationDistance=Math.max(u.maxXYTranslationDistance,N),this.maxScale=Math.max(Math.max(this.maxScale,A[0]),Math.max(A[1],A[2])),KO(O,w,A);const G=Math.round(100*M.a)+M.b/1.05;for(let H=0;H<r.instancedDataCount;++H){const J=r.instancedDataOffset+H,re=16*J,Q=u.instancedDataArray.float32;let le=0;f&&(le=Q[re+6]-u.instancesEvaluatedElevation[J]);const ue=0|Q[re+1];Q[re]=(0|Q[re])+M.r/1.05,Q[re+1]=ue+M.g/1.05,Q[re+2]=G,Q[re+3]=1/(x.z>10?this.tileToMeter:Aa(x,ue)),Q[re+4]=R[0],Q[re+5]=R[1],Q[re+6]=R[2]+(u.instancesRoadElevation?u.instancesRoadElevation[J]:0)+le,Q[re+7]=O[0],Q[re+8]=O[1],Q[re+9]=O[2],Q[re+10]=O[4],Q[re+11]=O[5],Q[re+12]=O[6],Q[re+13]=O[8],Q[re+14]=O[9],Q[re+15]=O[10],u.instancesEvaluatedElevation[J]=R[2]}}}Kt(nI,"ModelBucket",{omit:["layers"]}),Kt(kF,"PerModelAttributes"),Kt(RF,"ModelFeature");class p_{constructor(r,s,u){this._demTile=r,this._dem=this._demTile.dem,this._scale=s,this._offset=u}static create(r,s,u){const f=u||r.findDEMTileFor(s);if(!f||!f.dem)return;const g=f.dem,v=f.tileID,x=1<<s.canonical.z-v.canonical.z;return new p_(f,g.dim/Bt/x,[(s.canonical.x/x-v.canonical.x)*g.dim,(s.canonical.y/x-v.canonical.y)*g.dim])}tileCoordToPixel(r,s){const u=s*this._scale+this._offset[1];return new St(Math.floor(r*this._scale+this._offset[0]),Math.floor(u))}getElevationAt(r,s,u,f){const g=r*this._scale+this._offset[0],v=s*this._scale+this._offset[1],x=Math.floor(g),w=Math.floor(v),A=this._dem;return f=!!f,u?Sn(Sn(A.get(x,w,f),A.get(x,w+1,f),v-w),Sn(A.get(x+1,w,f),A.get(x+1,w+1,f),v-w),g-x):A.get(x,w,f)}getElevationAtPixel(r,s,u){return this._dem.get(r,s,!!u)}getMeterToDEM(r){return(1<<this._demTile.tileID.canonical.z)*Ps(1,r)*this._dem.stride}}const rI=new Float32Array(262144),om=new Uint8Array(262144),DS=[0,0,0],FS=[0,0,0];function MF(l){let r=0;if(l.meshes)for(const s of l.meshes)r=Math.max(r,s.aabb.max[2]);if(l.children)for(const s of l.children)r=Math.max(r,MF(s));return r}function LF(l,r,s){if(l.meshes)for(const u of l.meshes){if(u.aabb.min[0]===1/0)continue;const f=pi.applyTransform(u.aabb,l.globalMatrix);s.insert(r,f.min[0],f.min[1],f.max[0],f.max[1])}if(l.children)for(const u of l.children)LF(u,r,s)}const OF=["","wall","door","roof","window","lamp","logo"];class DF{constructor(r){this.node=r,this.evaluatedRMEA=[[1,0,0,1],[1,0,0,1],[1,0,0,1],[1,0,0,1],[.4,1,0,1],[1,0,0,1],[1,0,0,1]],this.hiddenByReplacement=!1,this.evaluatedTranslation=[0,0,0],this.evaluatedScale=[1,1,1],this.evaluatedColor=[],this.emissionHeightBasedParams=[],this.cameraCollisionOpacity=1,this.targetL
24od=-1,this.feature={type:"Point",id:r.id,geometry:[],properties:{height:MF(r)}},this.aabb=this._getLocalBounds(),this.state=null}_getLocalBounds(){if(!this.node.meshes)return new pi([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);if(!this.aabb){let r=0;const s=new pi([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);for(const u of this.node.meshes)this.node.lightMeshIndex!==r&&(u.transformedAabb=pi.applyTransformFast(u.aabb,this.node.globalMatrix),s.encapsulate(u.transformedAabb)),r++;this.aabb=s}return this.aabb}}class BS{constructor(r,s,u,f,g,v,x,w){this.id=u,this.layers=r,this.layerIds=this.layers.map(A=>A.fqid),this.stateDependentLayerIds=this.layers.filter(A=>A.isStateDependent()).map(A=>A.id),this.modelTraits|=o_.CoordinateSpaceTile,this.uploaded=!1,this.hasPattern=!1,f&&(this.modelTraits|=o_.HasMapboxMeshFeatures),g&&(this.modelTraits|=o_.HasMeshoptCompression),this.zoom=-1,this.terrainExaggeration=1,this.projection={name:"mercator"},this.replacementUpdateTime=0,this.elevationReadFromZ=255,this.brightness=v,this.worldview=w,this.dirty=!0,this.needsUpload=!1,this.filter=null,this.nodesInfo=[];for(const A of s)this.nodesInfo.push(new DF(A)),LF(A,x.featureIndexArray.length,x.grid),x.featureIndexArray.emplaceBack(this.nodesInfo.length-1,0,x.bucketLayerIDs.length-1,0);this.states={},this.hasAppearances=null}updateFootprints(r,s){for(const u of this.getNodesInfo()){const f=u.node;f.footprint&&s.push({footprint:f.footprint,id:r})}}updateAppearances(r,s,u,f){return{hasLayoutChanges:!1,hasUboChanges:!1}}update(r){const s=Object.keys(r).length!==0;if(s&&!this.stateDependentLayers.length)return;const u=s?this.stateDependentLayers:this.layers;if(!dl(r,this.states))for(const f of u)this.evaluate(f,r);this.states=structuredClone(r)}populate(){console.log("populate 3D model bucket")}uploadPending(){return!this.uploaded||this.needsUpload}upload(r){if(!this.needsUpload)return;const s=this.getNodesInfo();for(const u of s){const f=u.node;this.uploaded?this.updatePbrBuffer(f):bA(f,r,!0)}for(const u of s)pS(u.node);this.uploaded=!0,this.needsUpload=!1}updatePbrBuffer(r){let s=!1;if(!r.meshes)return s;for(const u of r.meshes)u.pbrBuffer&&(u.pbrBuffer.updateData(u.featureArray),s=!0);if(r.lodMeshes)for(const u of r.lodMeshes)u.pbrBuffer&&(u.pbrBuffer.updateData(u.featureArray),s=!0);return s}needsReEvaluation(r,s,u){const f=r.transform.projectionOptions,g=r.style.getBrightness(),v=this.brightness!==g;if(!this.uploaded||this.dirty||f.name!==this.projection.name||Vv(u.paint.get("model-color").value,v)||Vv(u.paint.get("model-color-mix-intensity").value,v)||Vv(u.paint.get("model-roughness").value,v)||Vv(u.paint.get("model-emissive-strength").value,v)||Vv(u.paint.get("model-height-based-emissive-strength-multiplier").value,v)){this.projection=f,this.brightness=g;const x=this.getNodesInfo();for(const w of x)w.state=null;return!0}return!1}evaluateTransform(r,s){if(r.transform.zoom===this.zoom)return;this.zoom=r.transform.zoom;const u=this.getNodesInfo(),f=this.id.canonical;for(const g of u){const v=g.feature;g.evaluatedTranslation=s.paint.get("model-translation").evaluate(v,{},f),g.evaluatedScale=s.paint.get("model-scale").evaluate(v,{},f)}}evaluate(r,s){const u=this.getNodesInfo();for(const f of u){if(!f.node.meshes)continue;const g=f.feature,v=s&&s[g.id];if(dl(v,f.state))continue;f.state=structuredClone(v);const x=f.node.meshes&&f.node.meshes[0].featureData,w=f.evaluatedColor[2],A=f.evaluatedRMEA[2],R=this.id.canonical;if(f.hasTranslucentParts=!1,x){for(let M=0;M<OF.length;M++){const O=OF[M];O.length&&(g.properties.part=O);const B=r.paint.get("model-color").evaluate(g,v,R).toPremultipliedRenderColor(null),N=r.paint.get("model-color-mix-intensity").evaluate(g,v,R);f.evaluatedColor[M]=[B.r,B.g,B.b,N],f.evaluatedRMEA[M][0]=r.paint.get("model-roughness").evaluate(g,v,R),f.evaluatedRMEA[M][2]=r.paint.get("model-emissive-strength").evaluate(g,v,R),f.evaluatedRMEA[M][3]=B.a,f.emissionHeightBasedParams[M]=r.paint.get("model-height-based-emissive-strength-multiplier").evaluate(g,v,R),!f.hasTranslucentParts&&B.a<1&&(f.hasTranslucentParts=!0)}delete g.properties.part,mq(f,w!==f.evaluatedColor[2]||A!==f.evaluatedRMEA[2],this.modelTraits)}else f.evaluatedRMEA[0][2]=r.paint.get("model-emissive-strength").evaluate(g,v,R);f.evaluatedTranslation=r.paint.get("model-translation").evaluate(g,v,R),f.evaluatedScale=r.paint.get("model-scale").evaluate(g,v,R),this.updatePbrBuffer(f.node)||(this.needsUpload=!0)}this.dirty=!1}elevationUpdate(r,s,u,f){const g=r.findDEMTileFor(u);if(g&&(g.tileID.canonical!==this.terrainTile||s!==this.terrainExaggeration)){if
24(g.dem&&g.tileID.overscaledZ!==this.elevationReadFromZ){this.elevationReadFromZ=g.tileID.overscaledZ;const v=p_.create(r,u,g);if(!v)return;this.modelTraits&o_.HasMapboxMeshFeatures&&this.updateDEM(r,v,u,f);for(const x of this.getNodesInfo()){const w=x.node;if(!w.footprint||!w.footprint.vertices||!w.footprint.vertices.length)continue;const A=w.footprint.vertices;let R=v.getElevationAt(A[0].x,A[0].y,!0,!0);for(let M=1;M<A.length;M++)R=Math.min(R,v.getElevationAt(A[M].x,A[M].y,!0,!0));w.elevation=R}}this.terrainTile=g.tileID.canonical,this.terrainExaggeration=s}}updateDEM(r,s,u,f){let g=s._dem._modifiedForSources[f];if(g===void 0&&(s._dem._modifiedForSources[f]=[],g=s._dem._modifiedForSources[f]),g.includes(u.canonical))return;const v=s._dem.dim;g.push(u.canonical);let x=!1;for(const w of this.getNodesInfo()){const A=w.node;if(!A.footprint||!A.footprint.grid)continue;const R=A.footprint.grid,M=s.tileCoordToPixel(R.min.x,R.min.y),O=s.tileCoordToPixel(R.max.x,R.max.y),B=Math.min(Math.min(v-O.y,M.x),Math.min(M.y,v-O.x));if(B<0)continue;const N=Ee(B,2,5);let G=Math.max(0,M.x-N),H=Math.max(0,M.y-N),J=Math.min(O.x+N,v-1),re=Math.min(O.y+N,v-1);for(let he=H;he<=re;++he)for(let Te=G;Te<=J;++Te)om[he*v+Te]=255;let Q=0,le=0;for(let he=0;he<R.cellsY;++he)for(let Te=0;Te<R.cellsX;++Te){if(!R.cells[he*R.cellsX+Te])continue;const me=s.tileCoordToPixel(R.min.x+Te/R.xScale,R.min.y+he/R.yScale),xe=s.tileCoordToPixel(R.min.x+(Te+1)/R.xScale,R.min.y+(he+1)/R.yScale);for(let _e=me.y;_e<=Math.min(xe.y+1,v-1);++_e)for(let we=me.x;we<=Math.min(xe.x+1,v-1);++we)om[_e*v+we]===255&&(om[_e*v+we]=0,Q+=s.getElevationAtPixel(we,_e),le++)}const ue=Q/le;G=Math.max(1,M.x-N),H=Math.max(1,M.y-N),J=Math.min(O.x+N,v-2),re=Math.min(O.y+N,v-2),x=!0;for(let he=H;he<=re;++he)for(let Te=G;Te<=J;++Te)om[he*v+Te]===0&&(rI[he*v+Te]=s._dem.set(Te,he,ue));for(let he=1;he<N;++he){G=Math.max(1,M.x-he),H=Math.max(1,M.y-he),J=Math.min(O.x+he,v-2),re=Math.min(O.y+he,v-2);for(let Te=H;Te<=re;++Te)for(let me=G;me<=J;++me){const xe=Te*v+me;if(om[xe]===255){let _e=0,we=0,je=-1,He=-1;for(let Qe=-1;Qe<=1;++Qe)for(let it=-1;it<=1;++it){const nt=(Te+Qe)*v+me+it;if(om[nt]>=he)continue;const bt=rI[nt],Ze=Math.abs(bt);Ze>we&&(_e=bt,we=Ze,je=it,He=Qe)}if(we>.1){const Qe=1-(he+.5*Math.abs(je*He))/N;let it=s._dem.get(me,Te)+_e*Qe;const nt=s._dem.get(me+je,Te+He),bt=s._dem.get(me-je,Te-He,!0);(it-nt)*(it-bt)>0&&(it=(nt+bt)/2),rI[xe]=s._dem.set(me,Te,it),om[xe]=he}}}}}x&&(s._demTile.needsDEMTextureUpload=!0,s._dem._timestamp=Qs.now())}setFilter(r){this.filter=r?Vg(r):null}getNodesInfo(){return this.filter?this.nodesInfo.filter(r=>this.filter.filter(new Tr(this.id.overscaledZ,{worldview:this.worldview}),r.feature,this.id.canonical)):this.nodesInfo}destroy(){const r=this.getNodesInfo();for(const s of r)pS(s.node),xA(s.node)}isEmpty(){return!this.nodesInfo.length}updateReplacement(r,s){if(s.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=s.updateTime;const u=s.getReplacementRegionsForTile(r.toUnwrapped());for(const f of this.getNodesInfo()){const g=f.node.footprint;f.hiddenByReplacement=!!g&&!u.some(v=>v.footprint===g)}}getHeightAtTileCoord(r,s){const u=[0,0,0],f=$([]);for(const g of this.getNodesInfo()){const v=g.node.meshes[0],x=v.transformedAabb;if(r<x.min[0]||s<x.min[1]||r>x.max[0]||s>x.max[1])continue;if(g.node.hidden===!0)return{height:1/0,maxHeight:g.feature.properties.height,hidden:!1,verticalScale:g.evaluatedScale[2]};if(Y(f,g.node.globalMatrix),u[0]=r,u[1]=s,u[2]=0,mt(u,u,f),g.node.meshBVH){const M=u[0],O=u[1];DS[0]=M-1,DS[1]=O-1,DS[2]=-1e3,FS[0]=M+1,FS[1]=O+1,FS[2]=1e3;const B=g.node.meshBVH.findHighestPoint(DS,FS);if(B!==null)return{height:B,maxHeight:g.feature.properties.height,hidden:g.hiddenByReplacement,verticalScale:g.evaluatedScale[2]};continue}const w=(u[0]-v.aabb.min[0])/(v.aabb.max[0]-v.aabb.min[0])*Qp|0,A=Math.min(63,(u[1]-v.aabb.min[1])/(v.aabb.max[1]-v.aabb.min[1])*Qp|0)*Qp+Math.min(63,w),R=v.heightmap[A];if(R<0&&g.node.footprint){const M=[];if(g.node.footprint.grid.query(new St(r,s),new St(r,s),M),M.length>0)return{height:void 0,maxHeight:g.feature.properties.height,hidden:g.hiddenByReplacement,verticalScale:g.evaluatedScale[2]};continue}return g.hiddenByReplacement?void 0:{height:R,maxHeight:g.feature.properties.height,hidden:!1,verticalScale:g.evaluatedScale[2]}}}}function Vv(l,r){return l instanceof Dp&&!l.isLightConstant&&r}function FF(l,r,s,u,f,g,v,x){let w=(61440&r|(61440&r)>>4)>>8,A=(3840&r|(3840&r)>>4)>>4,R=240&r|(240&r)>>4;const M=15&r|(15&r)<<4;s[3]>0&&(w=Sn(w,255*s[0],s[3]),A=Sn(A,255*s[1],s[3]),R=Sn(R,255*s[2],s[3]));const O=M/255;w*=O,A*=O,R*=O;const B=w<<8|A,N=R<<8|Math.floor(255*u[3]),G=(function(me){const xe=Ee(me,0,2);return Math.min(Math.round(.5*xe*255),255)})(u[2])<<8|15*u[0]<<4|15*u[1],H=Ee(f[0],0,1),J=Ee(f[1],0,1),re=Ee(f[2],0,1),Q=Ee(f[3],0,1);let le,ue,he,Te;if(H!==J&&v!==g&&J!==H){const me=v-g;
24ue=1/(me*(J-H)),he=-(g+me*H)/(me*(J-H));const xe=Ee(f[4],-1,1);Te=Math.pow(10,xe),le=255*re<<8|255*Q}else le=65535,ue=0,he=1,Te=1;if(l.emplaceBack(B,N,G,le,ue,he,Te),x){const me=x.length;x.clear();for(let xe=0;xe<me;xe++)x.emplaceBack(B,N,G,le,ue,he,Te)}}function mq(l,r,s){const u=l.node;let f=0;const g=s&o_.HasMeshoptCompression;for(const v of u.meshes){if(u.lights&&u.lightMeshIndex===f||!v.featureData)continue;v.featureArray=new kd,v.featureArray.reserve(v.featureData.length);let x=r;for(const w of v.featureData){const A=g?65535&w:w>>16&65535,R=g?w>>16&65535:65535&w,M=(15&R)<8?15&R:0,O=l.evaluatedRMEA[M],B=l.evaluatedColor[M],N=l.emissionHeightBasedParams[M];let G;if(x&&M===2&&u.lights&&(G=new kd,G.resize(10*u.lights.length)),FF(v.featureArray,A,B,O,N,v.aabb.min[2],v.aabb.max[2],G),G&&x){x=!1;const H=u.meshes[u.lightMeshIndex];H.featureArray=G,H.featureArray._trim()}}v.featureArray._trim(),f++}if(u.lodMeshes){for(const v of u.lodMeshes)if(v.featureData){v.featureArray=new kd,v.featureArray.reserve(v.featureData.length);for(const x of v.featureData){const w=g?x>>16&65535:65535&x,A=(15&w)<8?15&w:0;FF(v.featureArray,g?65535&x:x>>16&65535,l.evaluatedColor[A],l.evaluatedRMEA[A],l.emissionHeightBasedParams[A],v.aabb.min[2],v.aabb.max[2],null)}v.featureArray._trim()}}}Kt(BS,"Tiled3dModelBucket",{omit:["layers"]}),Kt(DF,"Tiled3dModelFeature");const gq=["id","tile","layer","source","sourceLayer","state"];class sm{constructor(r,s,u,f,g){this.type="Feature",this._vectorTileFeature=r,this._z=s,this._x=u,this._y=f,this.properties=r?r.properties:{},this.id=g}clone(){const r=new sm(this._vectorTileFeature,this._z,this._x,this._y,this.id);return this.state&&(r.state=Object.assign({},this.state)),this.layer&&(r.layer=Object.assign({},this.layer)),this.source&&(r.source=this.source),this.sourceLayer&&(r.sourceLayer=this.sourceLayer),r}get geometry(){return this._geometry===void 0&&this._vectorTileFeature&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._x,this._y,this._z).geometry),this._geometry}set geometry(r){this._geometry=r}toJSON(){const r={type:"Feature",state:void 0,geometry:this.geometry,properties:this.properties};for(const s of gq)this[s]!==void 0&&(r[s]=this[s]);return r}}class am extends Lh{constructor(r,s,u,f){super(),this.id=r,this.type="model",this.models=[],this._options=s,this._modelsInfo=new Map,this._abortController=null}cancelModelRequests(){this._abortController&&(this._abortController.abort(),this._abortController=null)}loadGLTFFromURI(r,s){return qO(this.map._requestManager.transformRequest(r,pd.Model).url,s)}async loadModel(r,s,u){try{const f=await this.loadGLTFFromURI(s.uri,u);if(u.aborted)return;const g=this._modelsInfo.get(r);if(!g)return;const v=EA(f),x=g.modelSpec,w=new JO(r,x.uri,x.position,x.orientation,v);am.applyModelSpecification(w,x),w.computeBoundsAndApplyParent(),this.models.push(w),g.model=w}catch(f){if(f instanceof Error&&f.name==="AbortError")return;const g=f instanceof Error?f.message:"Unknown error";this.fire(new kh(new Error(`Could not load model ${r} from ${s.uri}: ${g}`)))}}async load(){this._abortController||(this._abortController=new AbortController);const r=this._abortController.signal,s=[];for(const u in this._options.models){const f=this._options.models[u],g=this._modelsInfo.get(u);if(g&&g.model){g.modelSpec=f;const v=g.model;v.position=f.position!=null?new wr(f.position[0],f.position[1]):new wr(0,0),v.orientation=f.orientation!=null?f.orientation:[0,0,0],am.applyModelSpecification(v,f),v.computeBoundsAndApplyParent(),this.models.push(v)}else g?g.modelSpec=f:(this._modelsInfo.set(u,{modelSpec:f,model:null}),s.push(this.loadModel(u,f,r)))}s.length!==0?(await Promise.allSettled(s),r.aborted||this.fire(new fl("data",{dataType:"source",sourceDataType:"metadata"}))):this.loaded()&&this.fire(new fl("data",{dataType:"source",sourceDataType:"metadata"}))}static applyModelSpecification(r,s){s.nodeOverrides&&am.convertNodeOverrides(r,s.nodeOverrides),s.materialOverrides&&am.convertMaterialOverrides(r,s.materialOverrides),s.nodeOverrideNames&&(r.nodeOverrideNames=[...s.nodeOverrideNames]),s.materialOverrideNames&&(r.materialOverrideNames=[...s.materialOverrideNames]),s.featureProperties&&(r.featureProperties=s.featureProperties)}static convertNodeOverrides(r,s){if(Array.isArray(s)&&s.every(u=>typeof u=="string")){r.nodeOverrideNames=[];for(const u of s)r.nodeOverrideNames.push(u)}
24else Object.entries(s).forEach(([u,f])=>{const g={orientation:[0,0,0]};if(Object.hasOwn(f,"orientation")){const v=f.orientation;v&&(g.orientation=v)}r.nodeOverrides.set(u,g)})}static convertMaterialOverrides(r,s){if(Array.isArray(s)&&s.every(u=>typeof u=="string")){r.materialOverrideNames=[];for(const u of s)r.materialOverrideNames.push(u)}else Object.entries(s).forEach(([u,f])=>{const g={color:new xr(1,1,1),colorMix:0,emissionStrength:0,opacity:1},v=f["model-color"];v!==void 0&&(g.color.r=v[0],g.color.g=v[1],g.color.b=v[2]);const x=f["model-color-mix-intensity"];x!==void 0&&(g.colorMix=x);const w=f["model-emissive-strength"];w!==void 0&&(g.emissionStrength=w);const A=f["model-opacity"];A!==void 0&&(g.opacity=A),r.materialOverrides.set(u,g)})}onAdd(r){this.map=r,this.load()}hasTransition(){return!1}loaded(){if(this._modelsInfo.size===0)return!0;for(const r of this._modelsInfo.values())if(r.model==null)return!1;return!0}getModels(){return this.models}loadTile(r,s){}serialize(){return this._options}setProperty(r,s){return!1}reload(){this.cancelModelRequests();const r=D0(this.id,this.scope);this.map.style.clearSource(r),this.models=[],this._modelsInfo.clear(),this.load()}onRemove(r){this.cancelModelRequests()}setModels(r){this.models=[];const s=new Map;for(const u in r){const f=r[u],g=this._modelsInfo.get(u);g&&g.modelSpec.uri===f.uri&&s.set(u,g)}if(this._modelsInfo.size!==s.size){this.cancelModelRequests();for(const[u,f]of s)f.model||s.delete(u)}this._modelsInfo=s,this._options.models=r,this.load()}}function iI(l,r,s,u){const f=1<<l.z;r.lat=Mo((u/Bt+l.y)/f),r.lng=ia((s/Bt+l.x)/f)}function _q(l,r,s,u){const f=l.getNodesInfo()[r];if(!f||f.hiddenByReplacement||!f.node.meshes)return;let g=Number.MAX_VALUE;const v=f.node,x=s.tile,w=u.calculatePosMatrix(x.tileID.toUnwrapped(),u.worldSize),A=f.evaluatedScale;let R=0;
vendor: 2,037 bytes, line 24
24u.elevation&&v.elevation&&(R=v.elevation*u.elevation.exaggeration()),K(w,w,[(v.anchor?v.anchor[0]:0)*(A[0]-1),(v.anchor?v.anchor[1]:0)*(A[1]-1),R]),ne(w,w,A);const M=s.queryGeometry,O=M.isPointQuery()?M.screenBounds:M.screenGeometry,B=function(G){const H=X([],w,G.globalMatrix);X(H,u.expandedFarZProjMatrix,H);for(let J=0;J<G.meshes.length;++J){const re=G.meshes[J];if(J===G.lightMeshIndex)continue;const Q=vA(O,u,H,re.aabb);Q!=null&&(g=Math.min(Q,g))}if(G.children)for(const J of G.children)B(J)};if(B(v),g===Number.MAX_VALUE)return;const N=new wr(0,0);return iI(x.tileID.canonical,N,f.node.anchor[0],f.node.anchor[1]),{intersectionZ:g,position:N,feature:f.feature}}const yq={circle:class extends Is{constructor(l,r,s,u){super(l,{layout:ve||(ve=new fi({"circle-sort-key":new Dt(ze.layout_circle["circle-sort-key"]),"circle-elevation-reference":new Pt(ze.layout_circle["circle-elevation-reference"]),visibility:new Pt(ze.layout_circle.visibility)})),paint:be||(be=new fi({"circle-radius":new Dt(ze.paint_circle["circle-radius"]),"circle-color":new Dt(ze.paint_circle["circle-color"]),"circle-blur":new Dt(ze.paint_circle["circle-blur"]),"circle-opacity":new Dt(ze.paint_circle["circle-opacity"]),"circle-translate":new Pt(ze.paint_circle["circle-translate"]),"circle-translate-anchor":new Pt(ze.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Pt(ze.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Pt(ze.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Dt(ze.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Dt(ze.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Dt(ze.paint_circle["circle-stroke-opacity"]),"circle-emissive-strength":new Pt(ze.paint_circle["circle-emissive-strength"]),"circle-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"}),"circle-stroke-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"})}))},r,s,u)}createBucket(l){return new _(l)}queryRadius(l){const r=l;
vendor: 14,274 bytes, line 24
24return ce("circle-radius",this,r)+ce("circle-stroke-width",this,r)+Ce(this.paint.get("circle-translate"))}queryIntersectsFeature(l,r,s,u,f,g,v,x){const w=Re(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),g.angle,l.pixelToTileUnitsFactor),A=this.paint.get("circle-radius").evaluate(r,s)+this.paint.get("circle-stroke-width").evaluate(r,s);return Dn(l,u,g,v,x,this.paint.get("circle-pitch-alignment")==="map",this.paint.get("circle-pitch-scale")==="map",w,A)}getProgramIds(){return["circle"]}getDefaultProgramParams(l,r,s){const u=kr(this);return{config:new Od(this,{zoom:r,lut:s}),defines:u,overrideFog:!1}}is3D(l){return!l&&!!this.layout&&this.layout.get("circle-elevation-reference")!=="none"}hasElevation(){return this.layout&&this.layout.get("circle-elevation-reference")!=="none"}},heatmap:class extends Is{createBucket(l){return new $i(l)}constructor(l,r,s,u){super(l,{layout:Yo||(Yo=new fi({visibility:new Pt(ze.layout_heatmap.visibility)})),paint:fo||(fo=new fi({"heatmap-radius":new Dt(ze.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Dt(ze.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Pt(ze.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Iu(ze.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Pt(ze.paint_heatmap["heatmap-opacity"]),"heatmap-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"})}))},r,s,u),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(l){l==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Er({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}_clear(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}queryRadius(l){return ce("heatmap-radius",this,l)}queryIntersectsFeature(l,r,s,u,f,g,v,x){const w=this.paint.get("heatmap-radius").evaluate(r,s);return Dn(l,u,g,v,x,!0,!0,new St(0,0),w)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}getProgramIds(){return["heatmap","heatmapTexture"]}getDefaultProgramParams(l,r,s){return l==="heatmap"?{config:new Od(this,{zoom:r,lut:s}),overrideFog:!1}:{}}},hillshade:class extends Is{constructor(l,r,s,u){super(l,{layout:Lo||(Lo=new fi({visibility:new Pt(ze.layout_hillshade.visibility)})),paint:io||(io=new fi({"hillshade-illumination-direction":new Pt(ze.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Pt(ze.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Pt(ze.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Pt(ze.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Pt(ze.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Pt(ze.paint_hillshade["hillshade-accent-color"]),"hillshade-emissive-strength":new Pt(ze.paint_hillshade["hillshade-emissive-strength"]),"hillshade-shadow-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"}),"hillshade-highlight-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"}),"hillshade-accent-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"})}))},r,s,u)}shouldRedrape(){return this.hasOffscreenPass()&&this.paint.get("hillshade-illumination-anchor")==="viewport"}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}getProgramIds(){return["hillshade","hillshadePrepare"]}getDefaultProgramParams(l,r,s){return{overrideFog:!1}}},fill:class extends Is{constructor(l,r,s,u){super(l,{layout:nO||(nO=new fi({"fill-sort-key":new Dt(ze.layout_fill["fill-sort-key"]),visibility:new Pt(ze.layout_fill.visibility),"fill-elevation-reference":new Pt(ze.layout_fill["fill-elevation-reference"]),"fill-construct-bridge-guard-rail":new Dt(ze.layout_fill["fill-construct-bridge-guard-rail"])})),paint:rO||(rO=new fi({"fill-antialias":new Pt(ze.paint_fill["fill-antialias"]),"fill-opacity":new Dt(ze.paint_fill["fill-opacity"]),"fill-color":new Dt(ze.paint_fill["fill-color"]),"fill-outline-color":new Dt(ze.paint_fill["fill-outline-color"]),"fill-translate":new Pt(ze.paint_fill["fill-translate"]),"fill-translate-anchor":new Pt(ze.paint_fill["fill-translate-anchor"]),"fill-pattern":new Dt(ze.paint_fill["fill-pattern"]),"fill-pattern-cross-fade":new Pt(ze.paint_fill["fill-pattern-cross-fade"]),"fill-emissive-strength":new Pt(ze.paint_fill["fill-emissive-strength"]),"fill-z-offset":new Dt(ze.paint_fill["fill-z-offset"]),"fill-bridge-guard-rail-color":new Dt(ze.paint_fill["fill-bridge-guard-rail-color"]),"fill-tunnel-structure-color":new Dt(ze.paint_fill["fill-tunnel-structure-color"]),"fill-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"}),"fill-outline-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"}),"fill-bridge-guard-rail-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"}),"fill-tunnel-structure-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"})}))},r,s,u)}getProgramIds(){const l=this.paint.get("fill-pattern"),r=l&&l.constantOr(1),s=[r?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&s.push(r&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),s}getDefaultProgramParams(l,r,s){return{config:new Od(this,{zoom:r,lut:s}),overrideFog:!1}}recalculate(l,r){super.recalculate(l,r);const s=this.paint._values["fill-outline-color"];s.value.kind==="constant"&&s.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(l){return new qw(l)}queryRadius(){return Ce(this.paint.get("fill-translate"))}queryIntersectsFeature(l,r,s,u,f,g){return!l.queryGeometry.isAboveHorizon&&T(Se(l.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),g.angle,l.pixelToTileUnitsFactor),u)}isTileClipped(){return this.paint.get("fill-z-offset").constantOr(1)===0}is3D(l){if(this.paint.get("fill-z-offset").constantOr(1)!==0)return!0;const r=this.layout&&this.layout.get("fill-elevation-reference")!=="none";return l!=null?r&&!l:r}hasElevation(){return this.layout&&this.layout.get("fill-elevation-reference")!=="none"}hasShadowPass(){return this.layout&&this.layout.get("fill-elevation-reference")!=="none"}},"fill-extrusion":class extends Is{constructor(l,r,s,u){super(l,{layout:SO||(SO=new fi({visibility:new Pt(ze["layout_fill-extrusion"].visibility),"fill-extrusion-edge-radius":new Pt(ze["layout_fill-extrusion"]["fill-extrusion-edge-radius"]),"source-max-zoom":new Pt(ze["layout_fill-extrusion"]["source-max-zoom"])})),paint:TO||(TO=new fi({"fill-extrusion-opacity":new Pt(ze["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Dt(ze["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Pt(ze["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Pt(ze["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Dt(ze["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-pattern-cross-fade":new Pt(ze["paint_fill-extrusion"]["fill-extrusion-pattern-cross-fade"]),"fill-extrusion-height":new Dt(ze["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Dt(ze["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-height-alignment":new Pt(ze["paint_fill-extrusion"]["fill-extrusion-height-alignment"]),"fill-extrusion-base-alignment":new Pt(ze["paint_fill-extrusion"]["fill-extrusion-base-alignment"]),"fill-extrusion-vertical-gradient":new Pt(ze["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new Pt(ze["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new Pt(ze["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-ambient-occlusion-wall-radius":new Pt(ze["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-wall-radius"]),"fill-extrusion-ambient-occlusion-ground-radius":new Pt(ze["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-radius"]),"fill-extrusion-ambient-occlusion-ground-attenuation":new Pt(ze["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-attenuation"]),"fill-extrusion-flood-light-color":new Pt(ze["paint_fill-extrusion"]["fill-extrusion-flood-light-color"]),"fill-extrusion-flood-light-intensity":new Pt(ze["paint_fill-extrusion"]["fill-extrusion-flood-light-intensity"]),"fill-extrusion-flood-light-wall-radius":new Dt(ze["paint_fill-extrusion"]["fill-extrusion-flood-light-wall-radius"]),"fill-extrusion-flood-light-ground-radius":new Dt(ze["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-radius"]),"fill-extrusion-flood-light-ground-attenuation":new Pt(ze["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-attenuation"]),"fill-extrusion-vertical-scale":new Pt(ze["paint_fill-extrusion"]["fill-extrusion-vertical-scale"]),"fill-extrusion-rounded-roof":new Pt(ze["paint_fill-extrusion"]["fill-extrusion-rounded-roof"]),"fill-extrusion-cutoff-fade-range":new Pt(ze["paint_fill-extrusion"]["fill-extrusion-cutoff-fade-range"]),"fill-extrusion-front-cutoff":new Pt(ze["paint_fill-extrusion"]["fill-extrusion-front-cutoff"]),"fill-extrusion-emissive-strength":new Dt(ze["paint_fill-extrusion"]["fill-extrusion-emissive-strength"]),"fill-extrusion-line-width":new Dt(ze["paint_fill-extrusion"]["fill-extrusion-line-width"]),"fill-extrusion-cast-shadows":new Pt(ze["paint_fill-extrusion"]["fill-extrusion-cast-shadows"]),"fill-extrusion-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"}),"fill-extrusion-flood-light-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"})}))},r,s,u),this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}createBucket(l){return new iS(l)}queryRadius(){return Ce(this.paint.get("fill-extrusion-translate"))}is3D(l){return!0}hasShadowPass(){return this.paint.get("fill-extrusion-cast-shadows")}cutoffRange(){return this.paint.get("fill-extrusion-cutoff-fade-range")}canCastShadows(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}queryIntersectsFeature(l,r,s,u,f,g,v,x,w){const A=Re(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),g.angle,l.pixelToTileUnitsFactor),R=this.paint.get("fill-extrusion-height").evaluate(r,s),M=this.paint.get("fill-extrusion-base").evaluate(r,s),O=[0,0],B=x&&g.elevation,N=g.elevation?g.elevation.exaggeration():1,G=l.tile.getBucket(this);if(G instanceof iS){const le=G.centroidData.find(ue=>w>=ue.vertexArrayOffset&&w<ue.vertexArrayOffset+ue.vertexCount);if(le&&le.flags&Qw)return!1;if(B){const ue=G.centroidVertexArray,he=w+1;he<ue.length&&(O[0]=ue.geta_centroid_pos0(he),O[1]=ue.geta_centroid_pos1(he))}}if(O[0]===0&&O[1]===1)return!1;g.projection.name==="globe"&&(u=wO([u],[new St(0,0),new St(Bt,Bt)],l.tileID.canonical).map(le=>le.polygon).flat());const H=B?x:null,[J,re]=LO(g,u,M,R,A,v,H,O,N,g.center.lat,l.tileID.canonical),Q=l.queryGeometry;return MO(J,re,Q.isPointQuery()?Q.screenBounds:Q.screenGeometry)}},building:class extends Is{constructor(l,r,s,u){super(l,{layout:EO||(EO=new fi({visibility:new Pt(ze.layout_building.visibility),"building-facade":new Dt(ze.layout_building["building-facade"]),"building-facade-floors":new Dt(ze.layout_building["building-facade-floors"]),"building-facade-unit-width":new Dt(ze.layout_building["building-facade-unit-width"]),"building-facade-window":new Dt(ze.layout_building["building-facade-window"]),"building-roof-shape":new Dt(ze.layout_building["building-roof-shape"]),"building-height":new Dt(ze.layout_building["building-height"]),"building-base":new Dt(ze.layout_building["building-base"]),"building-flood-light-wall-radius":new Dt(ze.layout_building["building-flood-light-wall-radius"]),"building-flood-light-ground-radius":new Dt(ze.layout_building["building-flood-light-ground-radius"]),"building-flip-roof-orientation":new Dt(ze.layout_building["building-flip-roof-orientation"])})),paint:CO||(CO=new fi({"building-opacity":new Pt(ze.paint_building["building-opacity"]),"building-ambient-occlusion-intensity":new Pt(ze.paint_building["building-ambient-occlusion-intensity"]),"building-ambient-occlusion-ground-intensity":new Pt(ze.paint_building["building-ambient-occlusion-ground-intensity"]),"building-ambient-occlusion-ground-radius":new Pt(ze.paint_building["building-ambient-occlusion-ground-radius"]),"building-ambient-occlusion-ground-attenuation":new Pt(ze.paint_building["building-ambient-occlusion-ground-attenuation"]),"building-vertical-scale":new Pt(ze.paint_building["building-vertical-scale"]),"building-cast-shadows":new Pt(ze.paint_building["building-cast-shadows"]),"building-color":new Dt(ze.paint_building["building-color"]),"building-emissive-strength":new Dt(ze.paint_building["building-emissive-strength"]),"building-facade-emissive-chance":new Pt(ze.paint_building["building-facade-emissive-chance"]),"building-cutoff-fade-range":new Pt(ze.paint_building["building-cutoff-fade-range"]),"building-front-cutoff":new Pt(ze.paint_building["building-front-cutoff"]),"building-flood-light-color":new Pt(ze.paint_building["building-flood-light-color"]),"building-flood-light-intensity":new Pt(ze.paint_building["building-flood-light-intensity"]),"building-flood-light-ground-attenuation":new Pt(ze.paint_building["building-flood-light-ground-attenuation"]),"building-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"}),"building-flood-light-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"})}))},r,s,u),this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}prepare(){return uD()}
24createBucket(l){return new cD(l)}cutoffRange(){return this.paint.get("building-cutoff-fade-range")}hasShadowPass(){return this.paint.get("building-cast-shadows")}hasLightBeamPass(){return!0}canCastShadows(){return!0}is3D(l){return!0}queryRadius(l){return 0}queryIntersectsFeature(l,r,s,u,f,g,v,x,w,A){let R=this.layout.get("building-height").evaluate(r,s);const M=this.layout.get("building-base").evaluate(r,s),O=l.tile.getBucket(this).getFootprint(r);if(O){if(O.hiddenFlags!==0)return!1;R=O.height}const[B,N]=LO(g,u,M,R,new St(0,0),v,null,[0,0],1,g.center.lat,l.tileID.canonical),G=l.queryGeometry;return MO(B,N,G.isPointQuery()?G.screenBounds:G.screenGeometry)}},line:class extends Is{constructor(l,r,s,u){const f=bD();super(l,f,r,s,u),f.layout&&(this.layout=new Mc(f.layout)),this.gradientVersion=0,this.hasElevatedBuckets=!1,this.hasNonElevatedBuckets=!1,this.lineBlendFbos=null,this.lineBlendDensityReadback=null}_handleSpecialPaintPropertyUpdate(l){if(l==="line-gradient"){const r=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=r._styleExpression&&r._styleExpression.expression instanceof Gh,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}widthExpression(){return this._transitionablePaint._values["line-width"].value.expression}emissiveStrengthExpression(){return this._transitionablePaint._values["line-emissive-strength"].value.expression}recalculate(l,r){super.recalculate(l,r),this.paint._values["line-floorwidth"]=(()=>
24{if(Cv)return Cv;const s=bD();return Cv=new lW(s.paint.properties["line-width"].specification),Cv.useIntegerZoom=!0,Cv})().possiblyEvaluate(this._transitioningPaint._values["line-width"].value,l)}createBucket(l){return new gS(l)}getProgramIds(){const l=[this.paint.get("line-pattern").constantOr(1)?"linePattern":"line"];return this.paint.get("line-blend-mode")!=="default"&&l.push("lineBlendComposite"),l}getDefaultProgramParams(l,r,s){if(l==="lineBlendComposite")return{};const u=yD(this);return{config:new Od(this,{zoom:r,lut:s}),defines:u,overrideFog:!1}}queryRadius(l){const r=l,s=xD(ce("line-width",this,r),ce("line-gap-width",this,r)),u=ce("line-offset",this,r);return s/2+Math.abs(u)+Ce(this.paint.get("line-translate"))}queryIntersectsFeature(l,r,s,u,f,g){if(l.queryGeometry.isAboveHorizon)return!1;const v=Se(l.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),g.angle,l.pixelToTileUnitsFactor),x=l.pixelToTileUnitsFactor/2*xD(this.paint.get("line-width").evaluate(r,s),this.paint.get("line-gap-width").evaluate(r,s)),w=this.paint.get("line-offset").evaluate(r,s);return w&&(u=(function(A,R){const M=[],O=new St(0,0);for(let B=0;B<A.length;B++){const N=A[B],G=[];for(let H=0;H<N.length;H++){const J=N[H],re=N[H+1],Q=H===0?O:J.sub(N[H-1])._unit()._perp(),le=H===N.length-1?O:re.sub(J)._unit()._perp(),ue=Q._add(le)._unit();ue._mult(1/(ue.x*le.x+ue.y*le.y)),G.push(ue._mult(R)._add(J))}M.push(G)}return M})(u,w*l.pixelToTileUnitsFactor)),(function(A,R,M){for(let O=0;O<R.length;O++){const B=R[O];if(A.length>=3){for(let N=0;N<B.length;N++)if(ee(A,B[N]))return!0}if(I(A,B,M))return!0}return!1})(v,u,x)}isTileClipped(){return this.hasNonElevatedBuckets}isDraped(l){return!this.hasElevatedBuckets||this.layout&&this.layout.get("line-elevation-reference")==="hd-road-markup"}hasElevation(){return this.layout&&this.layout.get("line-elevation-reference")!=="none"}hasOffscreenPass(){return this.paint.get("line-blend-mode")!=="default"&&this.paint.get("line-opacity").constantOr(1)!==0&&this.paint.get("line-width").constantOr(1)!==0&&this.visibility!=="none"}resize(){this._destroyLineBlendFbo()}onRemove(l){this._destroyLineBlendFbo(l.painter&&l.painter.context&&l.painter.context.gl||void 0)}_clear(){this._destroyLineBlendFbo()}_destroyLineBlendFbo(l){this.lineBlendFbos&&(this.lineBlendFbos.destroy(),this.lineBlendFbos=null),l&&this.lineBlendDensityReadback&&this.lineBlendDensityReadback.destroy(l),this.lineBlendDensityReadback=null}},symbol:kS,background:class extends Is{constructor(l,r,s,u){super(l,{layout:mF||(mF=new fi({visibility:new Pt(ze.layout_background.visibility)})),paint:gF||(gF=new fi({"background-pitch-alignment":new Pt(ze.paint_background["background-pitch-alignment"]),"background-color":new Pt(ze.paint_background["background-color"]),"background-pattern":new Pt(ze.paint_background["background-pattern"]),"background-opacity":new Pt(ze.paint_background["background-opacity"]),"background-emissive-strength":new Pt(ze.paint_background["background-emissive-strength"]),"background-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"})}))},r,s,u)}getProgramIds(){return[this.paint.get("background-pattern")?"backgroundPattern":"background"]}getDefaultProgramParams(l,r,s){return{overrideFog:!1}}is3D(l){return this.paint.get("background-pitch-alignment")==="viewport"}},raster:xF,"raster-particle":PF,sky:class extends Is{constructor(l,r,s,u){super(l,{layout:TF||(TF=new fi({visibility:new Pt(ze.layout_sky.visibility)})),paint:EF||(EF=new fi({"sky-type":new Pt(ze.paint_sky["sky-type"]),"sky-atmosphere-sun":new Pt(ze.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new Pt(ze.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new Pt(ze.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new Pt(ze.paint_sky["sky-gradient-radius"]),"sky-gradient":new Iu(ze.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new Pt(ze.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new Pt(ze.paint_sky["sky-atmosphere-color"]),"sky-opacity":new Pt(ze.paint_sky["sky-opacity"]),"sky-gradient-use
24-theme":new Dt({type:"string",default:"default","property-type":"data-driven"}),"sky-atmosphere-halo-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"}),"sky-atmosphere-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"})}))},r,s,u),this._updateColorRamp()}_clear(){this.skyboxFbo&&(this.skyboxFbo.destroy(),this.skyboxFbo=null),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null),this._skyboxInvalidated=!0}_handleSpecialPaintPropertyUpdate(l){l==="sky-gradient"?this._updateColorRamp():l!=="sky-atmosphere-sun"&&l!=="sky-atmosphere-halo-color"&&l!=="sky-atmosphere-color"&&l!=="sky-atmosphere-sun-intensity"||(this._skyboxInvalidated=!0)}_updateColorRamp(){this.colorRamp=Er({expression:this._transitionablePaint._values["sky-gradient"].value.expression,evaluationKey:"skyRadialProgress"}),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}needsSkyboxCapture(l){if(this._skyboxInvalidated||!this.skyboxTexture||!this.skyboxGeometry)return!0;if(!this.paint.get("sky-atmosphere-sun")){const r=l.style.light.properties.get("position");return this._lightPosition.azimuthal!==r.azimuthal||this._lightPosition.polar!==r.polar}return!1}getCenter(l,r){if(this.paint.get("sky-type")==="atmosphere"){const u=this.paint.get("sky-atmosphere-sun"),f=!u,g=l.style.light,v=g.properties.get("position");return f&&g.properties.get("anchor")==="viewport"&&On("The sun direction is attached to a light with viewport anchor, lighting may behave unexpectedly."),f?tI(v.azimuthal,90-v.polar,r):tI(u[0],90-u[1],r)}const s=this.paint.get("sky-gradient-center");return tI(s[0],90-s[1],r)}isSky(){return!0}markSkyboxValid(l){this._skyboxInvalidated=!1,this._lightPosition=l.style.light.properties.get("position")}hasOffscreenPass(){return!0}getProgramIds(){const l=this.paint.get("sky-type");return l==="atmosphere"?["skyboxCapture","skybox"]:l==="gradient"?["skyboxGradient"]:null}},slot:class extends Is{constructor(l,r,s,u){super(l,{paint:CF||(CF=new fi({}))},r,null)}},model:class extends Is{constructor(l,r,s,u){super(l,{layout:AF||(AF=new fi({visibility:new Pt(ze.layout_model.visibility),"model-id":new Dt(ze.layout_model["model-id"]),"model-allow-density-reduction":new Pt(ze.layout_model["model-allow-density-reduction"])})),paint:IF||(IF=new fi({"model-opacity":new Dt(ze.paint_model["model-opacity"]),"model-rotation":new Dt(ze.paint_model["model-rotation"]),"model-scale":new Dt(ze.paint_model["model-scale"]),"model-translation":new Dt(ze.paint_model["model-translation"]),"model-color":new Dt(ze.paint_model["model-color"]),"model-color-mix-intensity":new Dt(ze.paint_model["model-color-mix-intensity"]),"model-type":new Pt(ze.paint_model["model-type"]),"model-cast-shadows":new Pt(ze.paint_model["model-cast-shadows"]),"model-receive-shadows":new Pt(ze.paint_model["model-receive-shadows"]),"model-ambient-occlusion-intensity":new Pt(ze.paint_model["model-ambient-occlusion-intensity"]),"model-emissive-strength":new Dt(ze.paint_model["model-emissive-strength"]),"model-roughness":new Dt(ze.paint_model["model-roughness"]),"model-height-based-emissive-strength-multiplier":new Dt(ze.paint_model["model-height-based-emissive-strength-multiplier"]),"model-cutoff-fade-range":new Pt(ze.paint_model["model-cutoff-fade-range"]),"model-front-cutoff":new Pt(ze.paint_model["model-front-cutoff"]),"model-elevation-reference":new Pt(ze.paint_model["model-elevation-reference"]),"model-ignore-line-cutout":new Pt(ze.paint_model["model-ignore-line-cutout"]),"model-color-use-theme":new Dt({type:"string",default:"default","property-type":"data-driven"})}))},r,s,u),this.layer=l,this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}createBucket(l){return new nI(l)}getProgramIds(){return["model"]}is3D(l){return!0}hasShadowPass(){return!0}canCastShadows(){return!0}hasLightBeamPass(){return!0}cutoffRange(){return this.paint.get("model-cutoff-fade-range")}queryRadius(l){return l instanceof BS?8191:0}queryRenderedFeatures(l,r,s){const u=r.getSource();if(!(u&&u instanceof am))return{};const f=u,g={};g[this.id]=[];const v=g[this.id];let x=0;for(const w of f.models){const A=r.getFeatureState(this.sourceLayer,w.id),R={type:"Unknown",id:w.id,properties:w.featureProperties},M=this.paint.get("model-rotation").evaluate(R,A),O=this.paint.get("model-scale").evaluate(R,A),B=this.paint.get("model-translation").evaluate(R,A),N=this.paint.get("model-elevation-reference");let G=[];fS(G,w,s,w.position,M,O,B,N==="ground",N==="ground",!1),s.projection.name==="globe"&&(G=hS(G,s));const H=X([],s.projMatrix,G),J=vA(l.isPointQuery()?l.screenBounds:l.screenGeometry,s,H,w.aabb);if(J!=null){const re=new sm(void 0,0,0,0,w.id);re.layer=this.layer,re.properties=structuredClone(w.featureProperties),re.properties.layer=this.id,re.properties.uri=w.uri,re.properties.orientation=w.orientation,re.sourceLayer=this.sourceLayer,re.geometry={type:"Point",coordinates:[w.position.lng,w.position.lat]},re.state=A,re.source=this.source,v.push({featureIndex:x,feature:re,intersectionZ:J})}++x}return g}queryIntersectsFeature(l,r,s,u,f,g,v,x,w,A){if(!this.modelManager)return!1;const R=this.modelManager,M=l.tile.getBucket(this);if(!(M&&M instanceof nI))return!1;for(const O in M.instancesPerModel){const B=M.instancesPerModel[O],N=r.id!==void 0?r.id:r.properties&&Object.hasOwn(r.properties,"id")?r.properties.id:void 0;if(Object.hasOwn(B.idToFeaturesIndex,N)){const G=B.features[B.idToFeaturesIndex[N]],H=R.getModel(O,A||this.scope);if(!H)return!1;let J=[];const re=new wr(0,0),Q=M.canonical;let le=Number.MAX_VALUE;for(let ue=0;ue<G.instancedDataCount;++ue){const he=16*(G.instancedDataOffset+ue),Te=B.instancedDataArray.float32,me=[Te[he+4],Te[he+5],Te[he+6]];iI(Q,re,Math.floor(Te[he]),Math.floor(Te[he+1])),fS(J,H,g,re,G.rotation,G.scale,me,!1,!1,!1),g.projection.name==="globe"&&(J=hS(J,g));const xe=X([],g.projMatrix,J),_e=l.queryGeometry,we=vA(_e.isPointQuery()?_e.screenBounds:_e.screenGeometry,g,xe,H.aabb);we!=null&&(le=Math.min(we,le))}return le!==Number.MAX_VALUE&&le}}return!1}_handleOverridablePaintPropertyUpdate(l,r,s){return!(!this.layout||r.isDataDriven()||s.isDataDriven()||l!=="model-color"&&l!=="model-color-mix-intensity"&&l!=="model-rotation"&&l!=="model-scale"&&l!=="model-translation"&&l!=="model-emissive-strength")}_isPropertyZoomDependent(l){const r=this._transitionablePaint._values[l];return r!=null&&r.value!=null&&r.value.expression!=null&&r.value.expression instanceof Zl}isZoomDependent(){return this._isPropertyZoomDependent("model-scale")||this._isPropertyZoomDependent("model-rotation")||this._isPropertyZoomDependent("model-translation")}},clip:class extends Is{constructor(l,r,s,u){super(l,{layout:iO||(iO=new fi({"clip-layer-types":ne
vendor: 4,326 bytes, line 24
24w Pt(ze.layout_clip["clip-layer-types"]),"clip-layer-scope":new Pt(ze.layout_clip["clip-layer-scope"]),visibility:new Pt(ze.layout_clip.visibility)})),paint:oO||(oO=new fi({}))},r,s,u)}recalculate(l,r){super.recalculate(l,r)}createBucket(l){return new sO(l)}is3D(l){return!0}}};class oI{constructor(r){this.capacity=r,this.cache=new Map}get(r){if(!this.cache.has(r))return;const s=this.cache.get(r);return this.cache.delete(r),this.cache.set(r,s),s}put(r,s){this.cache.has(r)?this.cache.delete(r):this.cache.size===this.capacity&&this.cache.delete(this.cache.keys().next().value),this.cache.set(r,s)}delete(r){this.cache.delete(r)}}Kt(oI,"LRUCache");class vq{constructor(r){this._callback=r,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){this._channel=void 0,this._callback=()=>{}}}class BF{constructor(r){this._stringToNumber={},this._numberToString=[];for(let s=0;s<r.length;s++){const u=r[s];this._stringToNumber[u]=s,this._numberToString[s]=u}}encode(r){return this._stringToNumber[r]}decode(r){return this._numberToString[r]}}class zF{constructor(r,s){this.tileID=r,this.x=r.canonical.x,this.y=r.canonical.y,this.z=r.canonical.z,this.grid=new Cd(Bt,Bt,512),this.featureIndexArray=new Y0,this.promoteId=s,this.is3DTile=!1,this.serializedLayersCache=new Map}insert(r,s,u,f,g,v=0,x=0){const w=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(u,f,g,v);const A=this.grid;for(let R=0;R<s.length;R++){const M=s[R],O=[1/0,1/0,-1/0,-1/0];for(let B=0;B<M.length;B++){const N=M[B];O[0]=Math.min(O[0],N.x),O[1]=Math.min(O[1],N.y),O[2]=Math.max(O[2],N.x),O[3]=Math.max(O[3],N.y)}x!==0&&(O[0]-=x,O[1]-=x,O[2]+=x,O[3]+=x),O[0]<Bt&&O[1]<Bt&&O[2]>=0&&O[3]>=0&&A.insert(w,O[0],O[1],O[2],O[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new iv(new _S(this.rawTileData)).layers,this.sourceLayerCoder=new BF(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const r in this.vtLayers)this.vtFeatures[r]=[]}return this.vtLayers}query(r,s){const{tilespaceGeometry:u,transform:f,tileTransform:g,pixelPosMatrix:v,availableImages:x,worldview:w}=s;this.loadVTLayers(),this.serializedLayersCache.clear();const A=s.queryRadius?s.queryRadius:0,R=u.bufferedTilespaceBounds,M=this.grid.queryKeys(R.min.x,R.min.y,R.max.x,R.max.y,(G,H,J,re)=>oe(u.bufferedTilespaceGeometry,G-A,H-A,J+A,re+A));M.sort(bq);let O=null;f.elevation&&M.length>0&&(O=p_.create(f.elevation,this.tileID));const B={};let N;for(let G=0;G<M.length;G++){const H=M[G];if(H===N)continue;N=H;const J=this.featureIndexArray.get(H);let re=null;this.is3DTile?this.loadMatchingModelFeature(B,J,r,u,f,w):this.loadMatchingFeature(B,J,r,x,w,(Q,le,ue,he=0)=>(re||(re=sa(Q,this.tileID.canonical,g)),le.queryIntersectsFeature(u,Q,ue,re,this.z,f,v,O,he,s.scope)))}return B}loadMatchingFeature(r,s,u,f,g,v){const{featureIndex:x,bucketIndex:w,sourceLayerIndex:A,layoutVertexArrayOffset:R}=s,M=this.bucketLayerIDs[w],O=u.layers,B=Object.keys(O);if(B.length&&!Hr(B,M))return;const N=u.sourceCache,G=this.sourceLayerCoder.decode(A),H=this.vtLayers[G].feature(x),J=this.getId(H,G);for(let re=0;re<M.length;re++){const Q=M[re];if(!O[Q])continue;const{styleLayer:le,targets:ue}=O[Q];let he={};J!==void 0&&(he=N.getFeatureState(le.sourceLayer,J));const Te=!v||v(H,le,he,R);if(!Te)continue;const me=new sm(H,this.z,this.x,this.y,J);me.tile=this.tileID.canonical,me.state=he;let xe=this.serializedLayersCache.get(Q);xe||(xe=le.serialize(),xe.id=Q,this.serializedLayersCache.set(Q,xe)),me.source=xe.source,me.sourceLayer=xe["source-layer"],me.layer=Object.assign({},xe),me.layer.paint=NF(xe.paint,le.paint,H,he,f),me.layer.layout=NF(xe.layout,le.layout,H,he,f);let _e=!1;for(const we of ue){this.updateFeatureProperties(me,we);const{filter:je}=we;if(je){if(H.properties=me.properties,je.needGeometry){const He=Ya(H,!0);if(!je.filter(new Tr(this.tileID.overscaledZ,{worldview:g}),He,this.tileID.canonical))continue}else if(!je.filter(new Tr(this.tileID.overscaledZ,{worldview:g}),H))continue}_e=!0,we.targetId&&this.addFeatureVariant(me,we)}_e&&this.appendToResult(r,Q,x,me,Te)}}
24loadMatchingModelFeature(r,s,u,f,g,v){const{featureIndex:x,bucketIndex:w}=s,A=this.bucketLayerIDs[w],R=u.layers,M=Object.keys(R);if(!M.length||Hr(M,A))for(let O=0;O<A.length;O++){const B=A[O],{styleLayer:N,targets:G}=R[B];if(N.type!=="model")continue;const H=f.tile,J=H.getBucket(N);if(!(J&&J instanceof BS))continue;const re=_q(J,x,f,g);if(!re)continue;const{z:Q,x:le,y:ue}=H.tileID.canonical,{feature:he,intersectionZ:Te,position:me}=re;let xe={};he.id!==void 0&&(xe=u.sourceCache.getFeatureState(N.sourceLayer,he.id));const _e=new sm({},Q,le,ue,he.id);_e.tile=this.tileID.canonical,_e.state=xe,_e.properties=he.properties,_e.geometry={type:"Point",coordinates:[me.lng,me.lat]};let we=this.serializedLayersCache.get(B);we||(we=N.serialize(),we.id=B,this.serializedLayersCache.set(B,we)),_e.source=we.source,_e.sourceLayer=we["source-layer"],_e.layer=Object.assign({},we);let je=!1;for(const He of G){this.updateFeatureProperties(_e,He);const{filter:Qe}=He;if(Qe){if(he.properties=_e.properties,Qe.needGeometry){if(!Qe.filter(new Tr(this.tileID.overscaledZ,{worldview:v}),he,this.tileID.canonical))continue}else if(!Qe.filter(new Tr(this.tileID.overscaledZ,{worldview:v}),he))continue}je=!0,He.targetId&&this.addFeatureVariant(_e,He)}je&&this.appendToResult(r,B,x,_e,Te)}}updateFeatureProperties(r,s,u){if(s.properties){const f={};for(const g in s.properties){const v=s.properties[g].evaluate({zoom:this.z},r._vectorTileFeature,r.state,r.tile,u);v!=null&&(f[g]=v)}r.properties=f}}addFeatureVariant(r,s,u){const f={target:s.target,namespace:s.namespace,uniqueFeatureID:s.uniqueFeatureID};s.properties&&(f.properties=r.properties),r.variants=r.variants||{},r.variants[s.targetId]=r.variants[s.targetId]||[],r.variants[s.targetId].push(f)}appendToResult(r,s,u,f,g){let v=r[s];v===void 0&&(v=r[s]=[]),v.push({featureIndex:u,feature:f,intersectionZ:g})}lookupSymbolFeatures(r,s,u,f,g,v){const x={};this.loadVTLayers();for(const w of r)this.loadMatchingFeature(x,{bucketIndex:s,sourceLayerIndex:u,featureIndex:w,layoutVertexArrayOffset:0},f,g,v);return x}loadFeature(r){const{featureIndex:s,sourceLayerIndex:u}=r;this.loadVTLayers();const f=this.sourceLayerCoder.decode(u),g=this.vtFeatures[f];if(g[s])return g[s];const v=this.vtLayers[f].feature(s);return g[s]=v,v}hasLayer(r){for(const s of this.bucketLayerIDs)for(const u of s)if(r===u)return!0;return!1}getId(r,s){let u=r.id;if(this.promoteId){const f=Array.isArray(this.promoteId)||typeof this.promoteId!="object"?this.promoteId:this.promoteId[s];if(f!=null)if(Array.isArray(f)){if(!this.promoteIdExpression){const g=Tu(f);if(g.result!=="success"){const v=g.value.map(x=>`${x.key}: ${x.message}`).join(", ");return void On(`Failed to create expression for promoteId: ${v}`)}this.promoteIdExpression=g.value}u=this.promoteIdExpression.evaluate({zoom:0},r)}else u=r.properties[f];typeof u=="boolean"&&(u=Number(u))}return u}}function NF(l,r,s,u,f){return ht(l,(g,v)=>{const x=r instanceof Mc?r.get(v):null;return x&&x.evaluate?x.evaluate(s,u,void 0,f):x})}function bq(l,r){return r-l}function VF(l,r){const s={};if(!r)return s;for(const u of l){const f=u.layerIds.map(g=>r.getLayer(g)).filter(Boolean);if(f.length!==0){u.layers=f,u.stateDependentLayerIds&&(u.stateDependentLayers=u.stateDependentLayerIds.map(g=>f.filter(v=>v.id===g)[0])),u.updateExpressions&&u.updateExpressions(f);for(const g of f)s[g.fqid]=u}}return s}Kt(zF,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});const ic=32,Nu=33,gf=new Uint16Array(8184);for(let l=0;l<2046;l++){let r=l+2,s=0,u=0,f=0,g=0,v=0,x=0;for(1&r?f=g=v=ic:s=u=x=ic;(r>>=1)>1;){const A=s+f>>1,R=u+g>>1;1&r?(f=s,g=u,s=v,u=x):(s=f,u=g,f=v,g=x),v=A,x=R}const w=4*l;gf[w+0]=s,gf[w+1]=u,gf[w+2]=f,gf[w+3]=g}const Vu=new Uint16Array(2178),_f=new Uint8Array(1089),zS=new Uint16Array(1089);function UF(l){return l===0?-.03125:l===32?.03125:0}const $F={Other:0,Symbol:1,FillExtrusion:2},jF={type:2,extent:Bt,loadGeometry:()=>[[new St(0,0),new St(8193,0),new St(8193,8193),new St(0,8193),new St(0,0)]]};class xq{constructor(){this.tasks={},this.taskQueue=[],cn(["process"],this),this.invoker=new vq(this.process),this.nextId=0}
24add(r,s){const u=this.nextId++,f=(function({type:g,renderSourceType:v,zoom:x}){x=x||0;const w=v===$F.Symbol;return g==="message"?0:g!=="maybePrepare"||w?g!=="parseTile"||w?g==="parseTile"&&w?300-x:g==="maybePrepare"&&w?400-x:500:200-x:100-x})(s);return f===0?(r(),null):(this.tasks[u]={fn:r,metadata:s,priority:f,id:u},this.taskQueue.push(u),this.invoker.trigger(),{cancel:()=>{delete this.tasks[u]}})}process(){{if(this.taskQueue=this.taskQueue.filter(u=>!!this.tasks[u]),!this.taskQueue.length)return;const r=this.pick();if(r===null)return;const s=this.tasks[r];if(delete this.tasks[r],this.taskQueue.length&&this.invoker.trigger(),!s)return;s.fn()}}pick(){let r=null,s=1/0;for(let f=0;f<this.taskQueue.length;f++){const g=this.tasks[this.taskQueue[f]];g.priority<s&&(s=g.priority,r=f)}if(r===null)return null;const u=this.taskQueue[r];return this.taskQueue.splice(r,1),u}remove(){this.invoker.remove()}}function GF(l,r,s){try{r=(function(f){if(!f.variants)return f;if(!Array.isArray(f.variants))throw new Error("variants must be an array");for(const g of f.variants){if(g==null||typeof g!="object"||g.constructor!==Object)throw new Error("variant must be an object");if(!Array.isArray(g.capabilities))throw new Error("capabilities must be an array");if(g.capabilities.length===1&&g.capabilities[0]==="meshopt")return Object.assign(f,g)}return f})(r)}catch(f){return new Error("Failed to process TileJSON variants",{cause:f})}const u=Le(Object.assign({},r,l),["tilejson","tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","extra_bounds","scheme","tileSize","encoding","vector_layers","raster_layers","worldview_options","worldview_default","worldview"]);return l.url&&r.tiles&&l.tiles&&(u.tiles=r.tiles),u.tiles=s.canonicalizeTileset(u,l.url),u}const sI=new Map,HF=new Map;class WF{constructor(r){this.size=r,this.minimums=[],this.maximums=[],this.leaves=[]}getElevation(r,s){const u=this.toIdx(r,s);return{min:this.minimums[u],max:this.maximums[u]}}isLeaf(r,s){return this.leaves[this.toIdx(r,s)]}toIdx(r,s){return s*this.size+r}}function qF(l,r,s,u){let f=0,g=Number.MAX_VALUE;for(let v=0;v<3;v++)if(Math.abs(u[v])<1e-15){if(s[v]<l[v]||s[v]>r[v])return null}else{const x=1/u[v];let w=(l[v]-s[v])*x,A=(r[v]-s[v])*x;if(w>A){const R=w;w=A,A=R}if(w>f&&(f=w),A<g&&(g=A),f>g)return null}return f}function XF(l,r,s,u,f,g,v,x,w,A,R){const M=u-l,O=f-r,B=g-s,N=v-l,G=x-r,H=w-s,J=R[1]*H-R[2]*G,re=R[2]*N-R[0]*H,Q=R[0]*G-R[1]*N,le=M*J+O*re+B*Q;if(Math.abs(le)<1e-15)return null;const ue=1/le,he=A[0]-l,Te=A[1]-r,me=A[2]-s,xe=(he*J+Te*re+me*Q)*ue;if(xe<0||xe>1)return null;const _e=Te*B-me*O,we=me*M-he*B,je=he*O-Te*M,He=(R[0]*_e+R[1]*we+R[2]*je)*ue;return He<0||xe+He>1?null:(N*_e+G*we+H*je)*ue}function ZF(l,r,s){return(l-r)/(s-r)}function YF(l,r,s,u,f,g,v,x,w){const A=1<<s,R=g-u,M=v-f,O=(l+1)/A*R+u,B=(r+0)/A*M+f,N=(r+1)/A*M+f;x[0]=(l+0)/A*R+u,x[1]=B,w[0]=O,w[1]=N}class KF{constructor(r){if(this.maximums=[],this.minimums=[],this.leaves=[],this.childOffsets=[],this.nodeCount=0,this.dem=r,this._siblingOffset=[[0,0],[1,0],[0,1],[1,1]],!this.dem)return;const s=(function(g){const v=Math.ceil(Math.log2(g.dim/8)),x=[];let w=Math.ceil(Math.pow(2,v));const A=1/w,R=(B,N,G,H,J)=>{const re=H?1:0,Q=(B+1)*G-re,le=N*G,ue=(N+1)*G-re;J[0]=B*G,J[1]=le,J[2]=Q,J[3]=ue};let M=new WF(w);const O=[];for(let B=0;B<w*w;B++){R(B%w,Math.floor(B/w),A,!1,O);const N=yf(O[0],O[1],g),G=yf(O[2],O[1],g),H=yf(O[2],O[3],g),J=yf(O[0],O[3],g);M.minimums.push(Math.min(N,G,H,J)),M.maximums.push(Math.max(N,G,H,J)),M.leaves.push(1)}for(x.push(M),w/=2;w>=1;w/=2){const B=x.at(-1);M=new WF(w);for(let N=0;N<w*w;N++){R(N%w,Math.floor(N/w),2,!0,O);const G=B.getElevation(O[0],O[1]),H=B.getElevation(O[2],O[1]),J=B.getElevation(O[2],O[3]),re=B.getElevation(O[0],O[3]),Q=B.isLeaf(O[0],O[1]),le=B.isLeaf(O[2],O[1]),ue=B.isLeaf(O[2],O[3]),he=B.isLeaf(O[0],O[3]),Te=Math.min(G.min,H.min,J.min,re.min),me=Math.max(G.max,H.max,J.max,re.max),xe=Q&&le&&ue&&he;M.maximums.push(me),M.minimums.push(Te),M.leaves.push(me-Te<=5&&xe?1:0)}x.push(M)}return x})(this.dem),u=s.length-1,f=s[u];this._addNode(f.minimums[0],f.maximums[0],f.leaves[0]),this._construct(s,0,0,u,0)}raycastRoot(r,s,u,f,g,v,x=1){return qF([r,s,-100],[u,f,this.maximums[0]*x],g,v)}raycast(r,s,u,f,g,v,x=1){if(!this.nodeCount)return null;const w=this.raycastRoot(r,s,u,f,g,v,x);if(w==null)return null;const A=[],R=[],M=[],O=[],B=[{idx:0,t:w,nodex:0,nodey:0,depth:0}];for(;B.length>0;){const{idx:N,t:G,nodex:H,nodey:J,depth:re}=B.pop();if(this.leaves[N]){YF(H,J,re,r,s,u,f,M,O);const le=1<<re,ue=(H+0)/le,he=(H+1)/le,Te=(J+0)/le,me=(J+1)/le,xe=yf(ue,Te,this.dem)*x,_e=yf(he,Te,this.dem)*x,we=yf(he,me,this.dem)*x,je=yf(ue,me,this.dem)*x,He=XF(M[0],M[1],xe,O[0],M[1],_e,O[0],O[1],we,g,v),Qe=XF(O[0],O[1],we,M[0],O[1],je,M[0],M[1],xe,g,v),it=Math.min(He!==null?He:Number.MAX_VALUE,Qe!==null?Qe:Number.MAX_VALUE);if(it!==Number.MAX_VALUE)return it;{const nt=Rn([],g,v,G);if(JF(xe,_e,je,we,ZF(nt[0],M[0],O[0]),ZF(nt[1],M[1],O[1]))>=nt[2])return G}continue}let Q=0;for(let le=0;le<this._siblingOffset.length;le++){YF((H<<1)+this._siblingOffset[le][0],(J<<1)+this._siblingOffset[le][1],re+1,r,s,u,f,M,O),M[2]=-100,O[2]=this.maximums[this.childOffsets[N]+le]*x;const ue=qF(M,O,g,v);if(ue!=null){const he=ue;A[le]=he;let Te=!1;for(let me=0;me<Q&&!Te;me++)he>=A[R[me]]&&(R.splice(me,0,le),Te=!0);Te||(R[Q]=le),Q++}}for(let le=0;le<Q;le++){const ue=R[le];B.push({idx:this.childOffsets[N]+ue,t:A[ue],nodex:(H<<1)+this._siblingOffset[ue][0],nodey:(J<<1)+this._siblingOffset[ue][1],depth:re+1})}}return null}_addNode(r,s,u){return this.minimums.push(r),this.maximums.push(s),this.leaves.push(u),this.childOffsets.push(0),this.nodeCount++}_construct(r,s,u,f,g){if(r[f].isLeaf(s,u)===1)return;this.childOffsets[g]||(this.childOffsets[g]=this.nodeCount);const v=f-1,x=r[v];let w=0,A=0;for(let R=0;R<this._siblingOffset.length;
24R++){const M=2*s+this._siblingOffset[R][0],O=2*u+this._siblingOffset[R][1],B=x.getElevation(M,O),N=x.isLeaf(M,O),G=this._addNode(B.min,B.max,N);N&&(w|=1<<R),A||(A=G)}for(let R=0;R<this._siblingOffset.length;R++)w&1<<R||this._construct(r,2*s+this._siblingOffset[R][0],2*u+this._siblingOffset[R][1],v,A+R)}}function JF(l,r,s,u,f,g){return Sn(Sn(l,s,g),Sn(r,u,g),f)}function yf(l,r,s){const u=s.dim,f=Ee(l*u-.5,0,u-1),g=Ee(r*u-.5,0,u-1),v=Math.floor(f),x=Math.floor(g),w=Math.min(v+1,u-1),A=Math.min(x+1,u-1);return JF(s.get(v,x),s.get(w,x),s.get(v,A),s.get(w,A),f-v,g-x)}const wq={mapbox:[6553.6,25.6,.1,1e4],terrarium:[256,1,1/256,32768]};function Sq(l,r,s){return(256*l*256+256*r+s)/10-1e4}function Tq(l,r,s){return 256*l+r+s/256-32768}class NS{get tree(){return this._tree||this._buildQuadTree(),this._tree}constructor(r,s,u,f=!1){if(this.uid=r,s.height!==s.width)throw new RangeError("DEM tiles must be square");if(u&&u!=="mapbox"&&u!=="terrarium")return void On(`"${u}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=s.height;const g=this.dim=s.height-2,v=new Uint32Array(s.data.buffer);if(this.pixels=new Uint8Array(s.data.buffer),this.floatView=new Float32Array(s.data.buffer),this.borderReady=f,this._modifiedForSources={},!f){for(let w=0;w<g;w++)v[this._idx(-1,w)]=v[this._idx(0,w)],v[this._idx(g,w)]=v[this._idx(g-1,w)],v[this._idx(w,-1)]=v[this._idx(w,0)],v[this._idx(w,g)]=v[this._idx(w,g-1)];v[this._idx(-1,-1)]=v[this._idx(0,0)],v[this._idx(g,-1)]=v[this._idx(g-1,0)],v[this._idx(-1,g)]=v[this._idx(0,g-1)],v[this._idx(g,g)]=v[this._idx(g-1,g-1)]}const x=u==="terrarium"?Tq:Sq;for(let w=0;w<v.length;++w){const A=4*w;this.floatView[w]=x(this.pixels[A],this.pixels[A+1],this.pixels[A+2])}this._timestamp=Qs.now()}_buildQuadTree(){this._tree=new KF(this)}get(r,s,u=!1){u&&(r=Ee(r,-1,this.dim),s=Ee(s,-1,this.dim));const f=this._idx(r,s);return this.floatView[f]}set(r,s,u){const f=this._idx(r,s),g=this.floatView[f];return this.floatView[f]=u,u-g}static getUnpackVector(r){return wq[r]}_idx(r,s){if(r<-1||r>=this.dim+1||s<-1||s>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(s+1)*this.stride+(r+1)}static pack(r,s){const u=[0,0,0,0],f=NS.getUnpackVector(s);let g=Math.floor((r+f[3])/f[2]);return u[2]=g%256,g=Math.floor(g/256),u[1]=g%256,g=Math.floor(g/256),u[0]=g,u}getPixels(){return new Dr({width:this.stride,height:this.stride},this.pixels)}backfillBorder(r,s,u){if(this.dim!==r.dim)throw new Error("dem dimension mismatch");let f=s*this.dim,g=s*this.dim+this.dim,v=u*this.dim,x=u*this.dim+this.dim;switch(s){case-1:f=g-1;break;case 1:g=f+1}switch(u){case-1:v=x-1;break;case 1:x=v+1}const w=-s*this.dim,A=-u*this.dim;for(let R=v;R<x;R++)for(let M=f;M<g;M++){const O=4*this._idx(M,R),B=4*this._idx(M+w,R+A);this.pixels[O+0]=r.pixels[B+0],this.pixels[O+1]=r.pixels[B+1],this.pixels[O+2]=r.pixels[B+2],this.pixels[O+3]=r.pixels[B+3]}}onDeserialize(){this._tree&&(this._tree.dem=this)}}function Eq(l,r,s){l===1?r.headerLength=s.readFixed32():l===2?r.x=s.readVarint():l===3?r.y=s.readVarint():l===4?r.z=s.readVarint():l===5&&r.layers.push((function(u,f){return u.readFields(Rq,{version:0,name:"",units:"",tileSize:0,buffer:0,pixelFormat:0,dataIndex:[]},f)})(s,s.readVarint()+s.pos))}function Cq(l,r,s){l===1?(r.delta_filter=(function(u,f){return u.readFields(Aq,{blockSize:0},f)})(s,s.readVarint()+s.pos),r.filter="delta_filter"):l===2?(s.readVarint(),r.filter="zigzag_filter"):l===3?(s.readVarint(),r.filter="bitshuffle_filter"):l===4&&(s.readVarint(),r.filter="byteshuffle_filter")}function Aq(l,r,s){l===1&&(r.blockSize=s.readVarint())}function Iq(l,r,s){l===1?(s.readVarint(),r.codec="gzip_data"):l===2?(s.readVarint(),r.codec="jpeg_image"):l===3?(s.readVarint(),r.codec="webp_image"):l===4&&(s.readVarint(),r.codec="png_image")}function Pq(l,r,s){let u=0,f=0;l===1?r.firstByte=s.readFixed64():l===2?r.lastByte=s.readFixed64():l===3?r.filters.push((function(g,v){return g.readFields(Cq,{},v)})(s,s.readVarint()+s.pos)):l===4?r.codec=(function(g,v){return g.readFields(Iq,{},v)})(s,s.readVarint()+s.pos):l===5?f=s.readFloat():l===6?u=s.readFloat():l===7?r.bands.push(s.readString()):l===8?r.offset=s.readDouble():l===9&&(r.scale=s.readDouble()),r.offset===0&&(r.offset=f),r.scale===0&&(r.scale=u)}function Rq(l,r,s){l===1?r.version=s.readVarint():l===2?r.name=s.readString():l===3?r.units=s.readString():l===4?r.tileSize=s.readVarint():l===5?r.buffer=s.readVarint():l===6?r.pixelFormat=s.readVarint():l===7&&r.dataIndex.push((function(u,f){return u.readFields(Pq,{firstByte:0,lastByte:0,filters:[],codec:null,offset:0,scale:0,bands:[]},f)})(s,s.readVarint()+s.pos))}function kq(l,r,s){if(l===2)(function(u,f,g){u.readFields(Mq,g,f)})(s,s.readVarint()+s.pos,r);else if(l===3)throw new Error("Not implemented")}function Mq(l,r,s){if(l===1){let u=0;const f=s.readVarint()+s.pos;for(;s.pos<f;)r[u++]=s.readVarint()}}function Lq(l,r){if(r.length!==4)throw new Error(`Expected data of dimension 4 but got ${r.length}.`);let s=r[3];for(let u=2;u>=1;u--){const f=u===1?1:0,g=u===2?1:0;for(let v=0;v<r[0];v++){const x=r[1]*v;for(let w=f;w<r[1];w++){const A=r[2]*(w+x);for(let R=g;R<r[2];R++){const M=r[3]*(R+A);for(let O=0;O<r[3];O++){const B=M+O;l[B]+=l[B-s]}}}}s*=r[u]}return l}function Oq(l){for(let r=0,s=l.length;r<s;r++)l[r]=l[r]>>>1^-(1&l[r]);return l}function Dq(l,r){switch(r){case"uint32":return l;case"uint16":for(let s=0;s<l.length;s+=2){const u=l[s],f=l[s+1];l[s]=(240&u)>>4|(61440&u)>>8|(240&f)<<4|61440&f,l[s+1]=15&u|(3840&u)>>4|(15&f)<<8|(3840&f)<<4}return l;case"uint8":for(let s=0;s<l.length;s+=4){const u=l[s],f=l[s+1],g=l[s+2],v=l[s+3];l[s+0]=(192&u)>>6|(192&f)>>4|(192&g)>>2|192&v,l[s+1]=(48&u)>>4|(48&f)>>2|48&g|(48&v)<<2,l[s+2]=(12&u)>>2|12&f|(12&g)<<2|(12&v)<<4,l[s+3]=3&u|(3&f)<<2|(3&g)<<4|(3&v)<<6}return l;default:throw new Error(`Invalid pixel format, "${r}"`)}}Kt(NS,"DEMData"),Kt(KF,"DemMinMaxQuadTree",{omit:["dem"]});var Tl=Uint8Array,Uv=Uint16Array,Fq=Int32Array,QF=new Tl([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),eB=new Tl([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Bq=new Tl([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),tB=function(l,r){for(var s=new Uv(31),u=0;u<31;++u)s[u]=r+=1<<l[u-1];var f=new Fq(s[30]);for(u=1;u<30;++u)for(var g=s[u];g<s[u+1];++g)f[g]=g-s[u]<<5|u;return{b:s,r:f}},nB=tB(QF,2),rB=nB.b,zq=nB.r;rB[28]=258,zq[258]=28;for(var Nq=tB(eB,0).b,iB=new Uv(32768),po=0;po<32768;++po){var m_=(43690&po)>>1|(21845&po)<<1;iB[po]=((65280&(m_=(61680&(m_=(52428&m_)>>2|(13107&m_)<<2))>>4|(3855&m_)<<4))>>8|(255&m_)<<8)>>1}var $v=function(l,r,s){for(var u=l.length,f=0,g=new Uv(r);f<u;++f)l[f]&&++g[l[f]-1];var v,x=new Uv(r);for(f=1;f<r;++f)x[f]=x[f-1]+g[f-1]<<1;
vendor: 5,200 bytes, line 24
24v=new Uv(1<<r);var w=15-r;for(f=0;f<u;++f)if(l[f])for(var A=f<<4|l[f],R=r-l[f],M=x[l[f]-1]++<<R,O=M|(1<<R)-1;M<=O;++M)v[iB[M]>>w]=A;return v},jv=new Tl(288);for(po=0;po<144;++po)jv[po]=8;for(po=144;po<256;++po)jv[po]=9;for(po=256;po<280;++po)jv[po]=7;for(po=280;po<288;++po)jv[po]=8;var oB=new Tl(32);for(po=0;po<32;++po)oB[po]=5;var Vq=$v(jv,9),Uq=$v(oB,5),aI=function(l){for(var r=l[0],s=1;s<l.length;++s)l[s]>r&&(r=l[s]);return r},Uc=function(l,r,s){var u=r/8|0;return(l[u]|l[u+1]<<8)>>(7&r)&s},lI=function(l,r){var s=r/8|0;return(l[s]|l[s+1]<<8|l[s+2]<<16)>>(7&r)},$q=function(l){return(l+7)/8|0},jq=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],$c=function(l,r,s){var u=new Error(r||jq[l]);if(u.code=l,Error.captureStackTrace&&Error.captureStackTrace(u,$c),!s)throw u;return u},Gq=new Tl(0),Hq=typeof TextDecoder<"u"&&new TextDecoder;try{Hq.decode(Gq,{stream:!0})}catch{}const Wq={gzip_data:"gzip"};class oc extends Error{constructor(r){super(r),this.name="MRTError"}}const qq={0:"uint32",1:"uint32",2:"uint16",3:"uint8"},sB={uint32:1,uint16:2,uint8:4},Xq={uint32:Uint32Array,uint16:Uint16Array,uint8:Uint8Array};let cI;class VS{constructor(r=5){this.x=NaN,this.y=NaN,this.z=NaN,this.layers={},this._cacheSize=r}getLayer(r){const s=this.layers[r];if(!s)throw new oc(`Layer '${r}' not found`);return s}getHeaderLength(r){const s=new Uint8Array(r),u=new DataView(r);if(s[0]!==13)throw new oc("File is not a valid MRT.");return u.getUint32(1,!0)}parseHeader(r){const s=new Uint8Array(r),u=this.getHeaderLength(r);if(s.length<u)throw new oc(`Expected header with length >= ${u} but got buffer of length ${s.length}`);const f=new cI(s.subarray(0,u)).readFields(Eq,{headerLength:0,x:0,y:0,z:0,layers:[]},void 0);if(!isNaN(this.x)&&(this.x!==f.x||this.y!==f.y||this.z!==f.z))throw new oc(`Invalid attempt to parse header ${f.z}/${f.x}/${f.y} for tile ${this.z}/${this.x}/${this.y}`);this.x=f.x,this.y=f.y,this.z=f.z;for(const g of f.layers)this.layers[g.name]=new aB(g,{cacheSize:this._cacheSize});return this}createDecodingTask(r){const s=[],u=this.getLayer(r.layerName);for(let f of r.blockIndices){const g=u.dataIndex[f],v=g.firstByte-r.firstByte,x=g.lastByte-r.firstByte;if(u._blocksInProgress.has(f))continue;const w={layerName:u.name,firstByte:v,lastByte:x,pixelFormat:u.pixelFormat,blockIndex:f,blockShape:[g.bands.length].concat(u.bandShape),buffer:u.buffer,codec:g.codec.codec,filters:g.filters.map(A=>A.filter)};u._blocksInProgress.add(f),s.push(w)}return new lB(s,()=>{s.forEach(f=>u._blocksInProgress.delete(f.blockIndex))},(f,g)=>{if(s.forEach(v=>u._blocksInProgress.delete(v.blockIndex)),f)throw f;g.forEach(v=>{this.getLayer(v.layerName).processDecodedData(v)})})}}class aB{constructor({version:r,name:s,units:u,tileSize:f,pixelFormat:g,buffer:v,dataIndex:x},w){if(this.version=r,this.version!==1)throw new oc(`Cannot parse raster layer encoded with MRT version ${r}`);this.name=s,this.units=u,this.tileSize=f,this.buffer=v,this.pixelFormat=qq[g],this.dataIndex=x,this.bandShape=[f+2*v,f+2*v,sB[this.pixelFormat]],this._decodedBlocks=new oI(w?w.cacheSize:5),this._blocksInProgress=new Set}get dimension(){return sB[this.pixelFormat]}get cacheSize(){return this._decodedBlocks.capacity}getBandList(){return this.dataIndex.map(({bands:r})=>r).flat()}processDecodedData(r){const s=r.blockIndex.toString();this._decodedBlocks.get(s)||this._decodedBlocks.put(s,r.data)}getBlockForBand(r){let s=0;switch(typeof r){case"string":for(const[u,f]of this.dataIndex.entries()){for(const[g,v]of f.bands.entries())if(v===r)return{bandIndex:s+g,blockIndex:u,blockBandIndex:g};s+=f.bands.length}break;case"number":for(const[u,f]of this.dataIndex.entries()){if(r>=s&&r<s+f.bands.length)return{bandIndex:r,blockIndex:u,blockBandIndex:r-s};s+=f.bands.length}break;default:throw new oc(`Invalid band \`${JSON.stringify(r)}\`. Expected string or integer.`)}return{blockIndex:-1,blockBandIndex:-1}}getDataRange(r){let s=1/0,u=-1/0;const f=[],g=new Set;for(const v of r){const{blockIndex:x}=this.getBlockForBand(v);if(x<0)throw new oc(`Invalid band: ${JSON.stringify(v)}`);const w=this.dataIndex[x];f.includes(x)||f.push(x),g.add(x),s=Math.min(s,w.firstByte),u=Math.max(u,w.lastByte)}if(g.size>this.cacheSize)throw new oc(`Number of blocks to decode (${g.size}) exceeds cache size (${this.cacheSize}).`);return{layerName:this.name,firstByte:s,lastByte:u,blockIndices:f}}hasBand(r){const{blockIndex:s}=this.getBlockForBand(r);return s>=0}hasDataForBand(r){const{blockIndex:s}=this.getBlockForBand(r);return s>=0&&!!this._decodedBlocks.get(s.toString())}getBandView(r){const{blockIndex:s,blockBandIndex:u}=this.getBlockForBand(r);if(s<0)throw new oc(`Band not found: ${JSON.stringify(r)}`);const f=this._decodedBlocks.get(s.toString());if(!f)throw new oc(`Data for band ${JSON.stringify(r)} of layer "${this.name}" not decoded.`);const g=this.dataIndex[s],v=this.bandShape.reduce((A,R)=>A*R,1),x=u*v,w=f.subarray(x,x+v);return{data:w,bytes:new Uint8Array(w.buffer).subarray(w.byteOffset,w.b
24yteOffset+w.byteLength),tileSize:this.tileSize,buffer:this.buffer,pixelFormat:this.pixelFormat,dimension:this.dimension,offset:g.offset,scale:g.scale}}}VS.setPbf=function(l){cI=l};class lB{constructor(r,s,u){this.tasks=r,this._onCancel=s,this._onComplete=u,this._finalized=!1}cancel(){this._finalized||(this._onCancel(),this._finalized=!0)}complete(r,s){this._finalized||(this._onComplete(r,s),this._finalized=!0)}}VS.performDecoding=function(l,r){const s=new Uint8Array(l);return Promise.all(r.tasks.map(u=>{const{layerName:f,firstByte:g,lastByte:v,pixelFormat:x,blockShape:w,blockIndex:A,filters:R,codec:M}=u,O=s.subarray(g,v+1),B=new Uint32Array(w[0]*w[1]*w[2]);let N;if(M!=="gzip_data")throw new oc(`Unhandled codec: ${M}`);return N=(function(G,H){if(!globalThis.DecompressionStream&&H==="gzip_data")return Promise.resolve((ue=(function(me){me[0]==31&&me[1]==139&&me[2]==8||$c(6,"invalid gzip data");var xe=me[3],_e=10;4&xe&&(_e+=2+(me[10]|me[11]<<8));for(var we=(xe>>3&1)+(xe>>4&1);we>0;we-=!me[_e++]);return _e+(2&xe)})(J=G),ue+8>J.length&&$c(6,"invalid gzip data"),(function(me,xe,_e,we){var je=me.length;if(!je||xe.f&&!xe.l)return _e||new Tl(0);var He=!_e,Qe=He||xe.i!=2,it=xe.i;He&&(_e=new Tl(3*je));var nt=function(yi){var mo=_e.length;if(yi>mo){var ca=new Tl(Math.max(2*mo,yi));ca.set(_e),_e=ca}},bt=xe.f||0,Ze=xe.p||0,et=xe.b||0,ot=xe.l,ft=xe.d,_t=xe.m,Ft=xe.n,ut=8*je;do{if(!ot){bt=Uc(me,Ze,1);var At=Uc(me,Ze+1,3);if(Ze+=3,!At){var It=me[(Cr=$q(Ze)+4)-4]|me[Cr-3]<<8,Xt=Cr+It;if(Xt>je){it&&$c(0);break}Qe&&nt(et+It),_e.set(me.subarray(Cr,Xt),et),xe.b=et+=It,xe.p=Ze=8*Xt,xe.f=bt;continue}if(At==1)ot=Vq,ft=Uq,_t=9,Ft=5;else if(At==2){var Yt=Uc(me,Ze,31)+257,gn=Uc(me,Ze+10,15)+4,on=Yt+Uc(me,Ze+5,31)+1;Ze+=14;for(var En=new Tl(on),_r=new Tl(19),Nn=0;Nn<gn;++Nn)_r[Bq[Nn]]=Uc(me,Ze+3*Nn,7);Ze+=3*gn;var sr=aI(_r),Zn=(1<<sr)-1,Pi=$v(_r,sr);for(Nn=0;Nn<on;){var Cr,gr=Pi[Uc(me,Ze,Zn)];if(Ze+=15&gr,(Cr=gr>>4)<16)En[Nn++]=Cr;else{var jr=0,mi=0;for(Cr==16?(mi=3+Uc(me,Ze,3),Ze+=2,jr=En[Nn-1]):Cr==17?(mi=3+Uc(me,Ze,7),Ze+=3):Cr==18&&(mi=11+Uc(me,Ze,127),Ze+=7);mi--;)En[Nn++]=jr}}var Co=En.subarray(0,Yt),Yr=En.subarray(Yt);_t=aI(Co),Ft=aI(Yr),ot=$v(Co,_t),ft=$v(Yr,Ft)}else $c(1);if(Ze>ut){it&&$c(0);break}}Qe&&nt(et+131072);for(var Ri=(1<<_t)-1,oo=(1<<Ft)-1,Ki=Ze;;Ki=Ze){var so=(jr=ot[lI(me,Ze)&Ri])>>4;if((Ze+=15&jr)>ut){it&&$c(0);break}if(jr||$c(2),so<256)_e[et++]=so;else{if(so==256){Ki=Ze,ot=null;break}var Qn=so-254;so>264&&(Qn=Uc(me,Ze,(1<<(Gi=QF[Nn=so-257]))-1)+rB[Nn],Ze+=Gi);var Ko=ft[lI(me,Ze)&oo],Ms=Ko>>4;if(Ko||$c(3),Ze+=15&Ko,Yr=Nq[Ms],Ms>3){var Gi=eB[Ms];Yr+=lI(me,Ze)&(1<<Gi)-1,Ze+=Gi}if(Ze>ut){it&&$c(0);break}Qe&&nt(et+131072);var Do=et+Qn;if(et<Yr){var bs=0-Yr,Jo=Math.min(Yr,Do);for(bs+et<0&&$c(3);et<Jo;++et)_e[et]=we[bs+et]}for(;et<Do;++et)_e[et]=_e[et-Yr]}}xe.l=ot,xe.p=Ki,xe.b=et,xe.f=bt,ot&&(bt=1,xe.m=_t,xe.d=ft,xe.n=Ft)}while(!bt);return et!=_e.length&&He?(function(yi,mo,ca){return(ca==null||ca>yi.length)&&(ca=yi.length),new Tl(yi.subarray(0,ca))})(_e,0,et):_e.subarray(0,et)})(J.subarray(ue,-8),{i:2},new Tl(((Q=J)[(le=Q.length)-4]|Q[le-3]<<8|Q[le-2]<<16|Q[le-1]<<24)>>>0),re)));var J,re,Q,le,ue;const he=Wq[H];if(!he)throw new Error(`Unhandled codec: ${H}`);const Te=new globalThis.DecompressionStream(he);return new Response(new Blob([G]).stream().pipeThrough(Te)).arrayBuffer().then(me=>new Uint8Array(me))})(O,M).then(G=>((function(H,J){H.readFields(kq,J)})(new cI(G),B),new Xq[x](B.buffer))),N.then(G=>{for(let H=R.length-1;H>=0;H--)switch(R[H]){case"delta_filter":Lq(G,w);break;case"zigzag_filter":Oq(G);break;case"bitshuffle_filter":Dq(G,x);break;default:throw new oc(`Unhandled filter "${R[H]}"`)}return{layerName:f,blockIndex:A,data:G}}).catch(G=>{throw G})}))},Kt(lB,"MRTDecodingBatch",{omit:["_onCancel","_onComplete"]}),Kt(VS,"MapboxRasterTile"),Kt(aB,"MapboxRasterLayer",{omit:["_blocksInProgress"]});const cB=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class uI{static from(r){if(!(r instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[s,u]=new Uint8Array(r,0,2);if(s!==219)throw new Error("Data does not appear to be in a KDBush format.");const f=u>>4;if(f!==1)throw new Error(`Got v${f} data when expected v1.`);const g=cB[15&u];
24if(!g)throw new Error("Unrecognized array type.");const[v]=new Uint16Array(r,2,1),[x]=new Uint32Array(r,4,1);return new uI(x,v,g,r)}constructor(r,s=64,u=Float64Array,f){if(isNaN(r)||r<0)throw new Error(`Unpexpected numItems value: ${r}.`);this.numItems=+r,this.nodeSize=Math.min(Math.max(+s,2),65535),this.ArrayType=u,this.IndexArrayType=r<65536?Uint16Array:Uint32Array;const g=cB.indexOf(this.ArrayType),v=2*r*this.ArrayType.BYTES_PER_ELEMENT,x=r*this.IndexArrayType.BYTES_PER_ELEMENT,w=(8-x%8)%8;if(g<0)throw new Error(`Unexpected typed array class: ${u}.`);f&&f instanceof ArrayBuffer?(this.data=f,this.ids=new this.IndexArrayType(this.data,8,r),this.coords=new this.ArrayType(this.data,8+x+w,2*r),this._pos=2*r,this._finished=!0):(this.data=new ArrayBuffer(8+v+x+w),this.ids=new this.IndexArrayType(this.data,8,r),this.coords=new this.ArrayType(this.data,8+x+w,2*r),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+g]),new Uint16Array(this.data,2,1)[0]=s,new Uint32Array(this.data,4,1)[0]=r)}add(r,s){const u=this._pos>>1;return this.ids[u]=u,this.coords[this._pos++]=r,this.coords[this._pos++]=s,u}finish(){const r=this._pos>>1;if(r!==this.numItems)throw new Error(`Added ${r} items when expected ${this.numItems}.`);return dI(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(r,s,u,f){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:g,coords:v,nodeSize:x}=this,w=[0,g.length-1,0],A=[];for(;w.length;){const R=w.pop()||0,M=w.pop()||0,O=w.pop()||0;if(M-O<=x){for(let H=O;H<=M;H++){const J=v[2*H],re=v[2*H+1];J>=r&&J<=u&&re>=s&&re<=f&&A.push(g[H])}continue}const B=O+M>>1,N=v[2*B],G=v[2*B+1];N>=r&&N<=u&&G>=s&&G<=f&&A.push(g[B]),(R===0?r<=N:s<=G)&&(w.push(O),w.push(B-1),w.push(1-R)),(R===0?u>=N:f>=G)&&(w.push(B+1),w.push(M),w.push(1-R))}return A}within(r,s,u){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:f,coords:g,nodeSize:v}=this,x=[0,f.length-1,0],w=[],A=u*u;for(;x.length;){const R=x.pop()||0,M=x.pop()||0,O=x.pop()||0;if(M-O<=v){for(let H=O;H<=M;H++)dB(g[2*H],g[2*H+1],r,s)<=A&&w.push(f[H]);continue}const B=O+M>>1,N=g[2*B],G=g[2*B+1];dB(N,G,r,s)<=A&&w.push(f[B]),(R===0?r-u<=N:s-u<=G)&&(x.push(O),x.push(B-1),x.push(1-R)),(R===0?r+u>=N:s+u>=G)&&(x.push(B+1),x.push(M),x.push(1-R))}return w}}function dI(l,r,s,u,f,g){if(f-u<=s)return;const v=u+f>>1;uB(l,r,v,u,f,g),dI(l,r,s,u,v-1,1-g),dI(l,r,s,v+1,f,1-g)}function uB(l,r,s,u,f,g){for(;f>u;){if(f-u>600){const A=f-u+1,R=s-u+1,M=Math.log(A),O=.5*Math.exp(2*M/3),B=.5*Math.sqrt(M*O*(A-O)/A)*(R-A/2<0?-1:1);uB(l,r,s,Math.max(u,Math.floor(s-R*O/A+B)),Math.min(f,Math.floor(s+(A-R)*O/A+B)),g)}const v=r[2*s+g];let x=u,w=f;for(Gv(l,r,u,s),r[2*f+g]>v&&Gv(l,r,u,f);x<w;){for(Gv(l,r,x,w),x++,w--;r[2*x+g]<v;)x++;for(;r[2*w+g]>v;)w--}r[2*u+g]===v?Gv(l,r,u,w):(w++,Gv(l,r,w,f)),w<=s&&(u=w+1),s<=w&&(f=w-1)}}function Gv(l,r,s,u){hI(l,s,u),hI(r,2*s,2*u),hI(r,2*s+1,2*u+1)}function hI(l,r,s){const u=l[r];l[r]=l[s],l[s]=u}function dB(l,r,s,u){const f=l-s,g=r-u;return f*f+g*g}y.$=Hy,y.A=$a,y.B=2,y.C=xr,y.D=Pv,y.E=Lh,y.F=VD,y.G=Gy,y.H=O0,y.I=is,y.J=ag,y.K=yp,y.L=oI,y.M=p0,y.N=Eg,y.O=G1,y.P=St,y.Q=Ag,y.R=pd,y.S=ef,y.T=zu,y.U=Tu,y.V=v0,y.W=Xl,y.X=Sd,y.Y=Ga,y.Z=Cs,y._=vp,y.a=function(l){return Xr.API_CDN_URL_REGEX.test(l)},y.a$=am,y.a0=d1,y.a1=vl,y.a2=/^(.*)-use-theme$/,y.a3=/^(.*)-transition$/,y.a4=m0,y.a5=j1,y.a6=ze,y.a7=zp,y.a8=fi,y.a9=Pt,y.aA=function(l){let r=1/0,s=1/0,u=-1/0,f=-1/0;for(const g of l)r=Math.min(r,g.x),s=Math.min(s,g.y),u=Math.max(u,g.x),f=Math.max(f,g.y);return{min:new St(r,s),max:new St(u,f)}},y.aB=Ee,y.aC=X,y.aD=mn,y.aE=as,y.aF=ee,y.aG=Bc,y.aH=kw,y.aI=Lu,y.aJ=tc,y.aK=Le,y.aL=class{constructor(l){this.entries={},this.scheduler=l}request(l,r,s,u){const f=this.entries[l]=this.entries[l]||{callbacks:[]};if(f.result){const[g,v]=f.result;return this.scheduler?this.scheduler.add(()=>{u(g,v)},r):u(g,v),()=>{}}return f.callbacks.push(u),f.cancel||(f.cancel=s((g,v)=>{f.result=[g,v];for(const x of f.callbacks)this.scheduler?this.scheduler.add(()=>{x(g,v)},r):x(g,v);setTimeout(()=>delete this.entries[l],3e3)})),()=>{f.result||(f.callbacks=f.callbacks.filter(g=>g!==u),f.callbacks.length||(f.cancel(),delete this.entries[l]))}}},y.aM=function(l){if("provider"in l&&!l.provider)return null;let r=l.provider;if(!r&&"url"in l&&l.url&&(r=(function(f){try{const g=new URL(f).pathname.split("/").pop()||"",v=g.lastIndexOf(".");return v>=0?g.slice(v+1):""}catch{return""}})(l.url)),!r)return null;const s=Xr.TILE_PROVIDER_URLS[r];if(!s)return null;let u;
24try{u=new URL(s,Xr.API_URL).href}catch{return new Error(`TileProvider "${r}" has an invalid URL: "${s}"`)}return{name:r,url:u}},y.aN=function(l,r,s,u,f){const g=function(x,w){if(x)return f(x);if(w){l.url&&w.tiles&&l.tiles&&delete l.tiles;const A=GF(l,w,r);if(A instanceof Error)return f(A);f(null,A)}},v=(function(x,w,A){if(!x)return null;if(!w&&!A)return x;A=A||x.worldview_default;const R=Object.values(x.language||{});if(R.length===0)return null;const M=Object.values(x.worldview||{});if(M.length===0)return null;const O=R.every(N=>N===w),B=M.every(N=>N===A);return O&&B?x:w in(x.language_options||{})||A in(x.worldview_options||{})?null:x.language_options&&x.worldview_options?x:null})(l.data,s,u);return v?Qs.frame(()=>g(null,v)):l.url?Ny(r.transformRequest(r.normalizeSourceURL(l.url,null,s,u),pd.Source),g):Qs.frame(()=>{const{data:x,...w}=l;g(null,w)})},y.aO=function(l,r){const s=l.url&&!l.tiles?r.transformRequest(l.url,pd.Source):void 0;return{request:s,options:s?Object.assign({},l,{url:s.url}):l}},y.aP=function(l,r,s){return r?GF(l,r,s):l.tiles&&l.tiles.length>0?{tiles:l.tiles}:new Error('TileJSON is missing required "tiles" property')},y.aQ=function(l,r,s){const u=JSON.stringify(l.request);return l.data&&(this.deduped.entries[u]={result:[null,l.data]}),this.deduped.request(u,{type:"parseTile",renderSourceType:l.renderSourceType,zoom:l.tileZoom},f=>{const g=Ph(l.request,(v,x,w)=>{v?hp(v)?f(null,null):f(v):x&&f(null,{rawData:x,vectorTile:s?void 0:new iv(new _S(x)),responseHeaders:new Map(w.entries())})});return()=>{g.cancel(),f(null,null)}},r)},y.aR=function(l){return l?{cacheControl:l.get("cache-control"),expires:l.get("expires")}:{cacheControl:void 0,expires:void 0}},y.aS=function(l){Oy++,Oy>s1&&(l.getActor().send("enforceCacheSizeLimit",o1),Oy=0)},y.aT=async function(l,r){const s=HF.get(l);if(s)return s;const u=sI.get(l);if(u!==void 0)return u;const f=import(r).catch(g=>{throw new Error(`TileProvider "${l}" failed to load: ${g instanceof Error?g.message:String(g)}`)}).then(g=>{const v=g.default;if(typeof v!="function")throw new Error(`TileProvider "${l}" module must default-export a class`);if(typeof v.prototype.loadTile!="function")throw new Error(`TileProvider "${l}" class must have a loadTile method`);return HF.set(l,v),v}).finally(()=>{sI.delete(l)});return sI.set(l,f),f},y.aU=De,y.aV=xF,y.aW=PF,y.aX=wr,y.aY=bF,y.aZ=function(l,r){const s=document.createElement("video");s.muted=!0,s.onloadstart=function(){r(null,s)};for(let u=0;u<l.length;u++){const f=document.createElement("source");u2(l[u])||(s.crossOrigin="Anonymous"),f.src=l[u],s.appendChild(f)}return{cancel:()=>{}}},y.a_=Tv,y.aa=class{constructor(l){this.specification=l}possiblyEvaluate(l,r){return bi(l.expression.evaluate(r))}interpolate(l,r,s){return{x:Sn(l.x,r.x,s),y:Sn(l.y,r.y,s),z:Sn(l.z,r.z,s),azimuthal:Sn(l.azimuthal,r.azimuthal,s),polar:Sn(l.polar,r.polar,s)}}},y.ab=Tr,y.ac=Zl,y.ad=ls,y.ae=mt,y.af=Zt,y.ag=We,y.ah=Mc,y.ai=Fr,y.aj=Sn,y.ak=Bt,y.al=p1,y.am=ae,y.an=Ot,y.ao=vt,y.ap=class{constructor(l,r,s){this.target=l,this.parent=r,this.mapId=s,this.callbacks={},this.cancelCallbacks={},cn(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.scheduler=new xq}send(l,r,s,u,f=!1,g){const v=Math.round(1e18*Math.random()).toString(36).substring(0,10);s&&(s.metadata=g,this.callbacks[v]=s);const x=new Set;return this.target.postMessage({id:v,type:l,hasCallback:!!s,targetMapId:u,mustQueue:f,sourceMapId:this.mapId,data:Rc(r,x)},x),{cancel:()=>{s&&delete this.callbacks[v],this.target.postMessage({id:v,type:"<cancel>",targetMapId:u,sourceMapId:this.mapId})}}}receive(l){const r=l.data;if(!r)return;const s=r.id;if(s&&(!r.targetMapId||this.mapId===r.targetMapId))if(r.type==="<cancel>"){const u=this.cancelCallbacks[s];delete this.cancelCallbacks[s],u&&u.cancel()}else if(r.mustQueue||Pr(self)){const u=this.callbacks[s],f=this.scheduler.add(()=>this.processTask(s,r),u&&u.metadata||{type:"message"});f&&(this.cancelCallbacks[s]=f)}else this.processTask(s,r)}processTask(l,r){if(delete this.cancelCallbacks[l],r.type==="<response>"){const s=this.callbacks[l];delete this.callbacks[l],s&&(r.error?s(kc(r.error)):s(null,kc(r.data)))}else{const s=new Set,u=r.hasCallback?(g,v)=>{this.target.postMessage({id:l,type:"<response>",sourceMapId:this.mapId,error:g?Rc(g):null,data:Rc(v,s)},s)}:()=>{},f=kc(r.data);if(this.parent[r.type])this.parent[r.type](r.sourceMapId,f,u);else if(this.parent.getWorkerSource){const g=r.type.split("."),{source:v,scope:x}=f;this.parent.getWorkerSource(r.sourceMapId,{type:g[0],source:v,scope:x,uid:0})[g[1]](f,u)}else u(new Error(`Could not find function ${r.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}},y.aq=class{constructor(l){this.specification=l}possiblyEvaluate(l,r){return(function([s,u]){const f=bi([1,s,u]);return{x:f.x,y:f.y,z:f.z}})(l.expression.evaluate(r))}interpolate(l,r,s){return{x:Sn(l.x,r.x,s),y:Sn(l.y,r.y,s),z:Sn(l.z,r.z,s)}}},y.ar=function(l,r,s=0,u=!0){const f=new St(s,s),g=l.sub(f),v=r.add(f),x=[g,new St(v.x,g.y),v,new St(g.x,v.y)];return u&&x.push(g.clone()),x},y.as=function(l,r){const s=[];for(let u=0;u<l.length;u++){const f=Et(u-1,-1,l.length-1),g=Et(u+1,-1,l.length-1),v=l[u],x=l[g],w=l[f].sub(v).unit(),A=x.sub(v).unit(),R=A.angleWithSep(w.x,w.y),M=w.add(A).unit().mult(-1*r/Math.sin(R/2));s.push(v.add(M))}return s},y.at=oF,y.au=oe,y.av=function(l,r,s=0){return Wt(((r.x-s)*l.scale-l.x)*Bt,(r.y*l.scale-l.y)*Bt,tv(r.z,r.y))},y.aw=tt,y.ax=_n,y.ay=sv,y.az=pD,y.b=function(l){return Xr.API_FONTS_REGEX.test(l)},y.b$=Hp,y.b0=cn,y.b1=VS,y.b2=_S,y.b3=class{constructor(l,r,s,u,f,g){this.tileID=l,this.uid=Ot(),this.uses=0,this.tileSize=r,this.tileZoom=s,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasTunnelGeometry=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=f,u&&u.style&&(this._lastUpdatedBrightness=u.style.getBrightness()),this._lastAvailableImagesCount=0,this._firstPrepareComplete=!1,this.expiredRequestCount=0,this.state="loading",u&&u.transform&&(this.projection=u.transform.projection),this.worldview=g,this._hasAppearances=null}registerFadeDuration(l){const r=l+this.timeAdded;r<Qs.now()||this.fadeEndTime!==void 0&&r<this.fadeEndTime||(this.fadeEndTime=r)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}get tileTransform(){return this._tileTransform||(this._tileTransform=im(this.tileID.canonical,this.projection)),this._tileTransform}loadVectorData(l,r,s){if(this.unloadVectorData(),this.state="loaded",l){l.featureIndex&&(this.latestFeatureIndex=l.featureIndex,l.rawTileData?(this.latestRawTileData=l.rawTileData,this.latestFeatureIndex.rawTileData=l.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=l.collisionBoxArray,this.buckets=VF(l.buckets,r.style),this.hasSymbolBuckets=!1,this.hasTunnelGeometry=!!l.hasTunnelGeometry;for(const u in this.buckets){const f=this.buckets[u];if(f instanceof rc){if(this.hasSymbolBuckets=!0,!s)break;f.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const u in this.buckets){const f=this.buckets[u];if(f instanceof rc&&f.hasRTLText){this.hasRTLText=!0,M0();break}}this.queryPadding=0;for(const u in this.buckets){const f=this.buckets[u],g=r.style.getOwnLayer(u);if(!g)continue;const v=g.queryRadius(f)||0;this.queryPadding=Math.max(this.queryPadding,v)}l.imageAtlas&&(this.imageAtlas=r.style.imageManager.imageAtlasCache.getOrCache(l.imageAtlas)),l.glyphAtlasImage&&(this.glyphAtlasImage=l.glyphAtlasImage),l.lineAtlas&&(this.lineAtlas=l.lineAtlas),this._lastUpdatedBrightness=l.brightness}else this.collisionBoxArray=new Md}unloadVectorData(){if(this.hasData()){for(const l in this.buckets)this.buckets[l].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&(this.imageAtlasTexture=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}loadModelData(l,r,s){l&&(l.resourceTiming&&(this.resourceTiming=l.resourceTiming),this.buckets=Object.assign({},this.buckets,VF(l.buckets,r.style)),l.featureIndex&&(this.latestFeatureIndex=l.featureIndex))}getBucket(l){return this.buckets[l.fqid]}upload(l,r){for(const f in this.buckets){const g=this.buckets[f];if(g.uploadPending()){let v={},x=[],w={zoom:0,pitch:0,brightness:0,worldview:""};if(r){if(r.style){x=r.style.listImages();const A=g.layers[0],R=A.sourceLayer||"_geojsonTileLayer",M=r.style.getLayerSourceCache(A);M&&(v=M._state.getState(R,void 0))}w={zoom:r.transform.zoom||0,pitch:r.transform.pitch||0,brightness:r.style.getBrightness()||0,worldview:r.worldview||""}}g.upload(l,this.tileID.canonical,v,x,w)}}const s=l.gl,u=this.imageAtlas;!u||this.imageAtlasTexture&&u.uploaded||(this.imageAtlasTexture=null,this.imageAtlasTexture=r.style.imageManager.imageAtlasCache.getTextureForAtlas(u,l,s.RGBA8),u.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new zu(l,this.glyphAtlasImage,s.R8),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new zu(l,this.lineAtlas.image,s.R8),this.lineAtlas.uploaded=!0)}prepare(l,r,s){if(this.imageAtlas&&this.imageAtlasTexture&&r){const M=r.style.getLut(s);this.imageAtlas.patchUpdatedImages(l,this.imageAtlasTexture,s,M)}if(!r||!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData)return;const u=r.style.getBrightness(),f=r.style.listImages(),g=f.length,v=r.style._changes.getUpd
24atedPaintProperties(),x=Object.keys(this.buckets).some(M=>this.buckets[M].layers.some(O=>v.has(O.fqid))),w=Object.keys(this.buckets).some(M=>this.buckets[M].layers.some(O=>O.hasTransition&&O.hasTransition())),A=this._firstPrepareComplete&&g!==this._lastAvailableImagesCount;this._hasAppearances===null&&(this._hasAppearances=this.hasAppearances(r));const R=this._lastUpdatedBrightness!==u;this._lastAvailableImagesCount=g,this._firstPrepareComplete=!0,(this._lastUpdatedBrightness||u||this._hasAppearances||x||w||A)&&(!(this._hasAppearances||x||w||A)&&this._lastUpdatedBrightness&&u&&Math.abs(this._lastUpdatedBrightness-u)<.001||(this.updateBuckets(r,R,void 0,A||x||w,v,f),this._lastUpdatedBrightness=u))}evaluateQueryRenderedFeaturePadding(){let l=0;for(const r in this.buckets){const s=this.buckets[r];s.evaluateQueryRenderedFeaturePadding&&(l=Math.max(l,s.evaluateQueryRenderedFeaturePadding()))}return l}queryRenderedFeatures(l,r,s,u,f,g,v){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData&&!this.latestFeatureIndex.is3DTile)return{};const x=this.evaluateQueryRenderedFeaturePadding(),w=(function(A,R){const M=qe([],[.5*A.width,.5*-A.height,1]);return K(M,M,[1,-1,0]),X(M,M,A.calculateProjMatrix(R.toUnwrapped())),Float32Array.from(M)})(f,this.tileID);return this.latestFeatureIndex.query(l,{tilespaceGeometry:r,pixelPosMatrix:w,transform:u,availableImages:s,tileTransform:this.tileTransform,worldview:this.worldview,queryRadius:x,scope:v})}querySourceFeatures(l,r){const s=this.latestFeatureIndex;if(!s||!s.rawTileData)return;const u=s.loadVTLayers(),f=r?r.sourceLayer:"",g=u._geojsonTileLayer||u[f];if(!g)return;const v=Vg(r&&r.filter),{z:x,x:w,y:A}=this.tileID.canonical,R={z:x,x:w,y:A};for(let M=0;M<g.length;M++){const O=g.feature(M);if(v.needGeometry){const G=Ya(O,!0);if(!v.filter(new Tr(this.tileID.overscaledZ,{worldview:this.worldview}),G,this.tileID.canonical))continue}else if(!v.filter(new Tr(this.tileID.overscaledZ,{worldview:this.worldview}),O))continue;const B=s.getId(O,f),N=new sm(O,x,w,A,B);N.tile=R,l.push(N)}}loaded(){return this.state==="loaded"||this.state==="errored"}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return!!this.imageAtlas&&!!this.imageAtlas.patternPositions.size}setExpiryData(l){const r=this.expirationTime;if(l.cacheControl){const s=ni(l.cacheControl);s["max-age"]&&(this.expirationTime=Date.now()+1e3*s["max-age"])}else l.expires&&(this.expirationTime=new Date(l.expires).getTime());if(this.expirationTime){const s=Date.now();let u=!1;if(this.expirationTime>s)u=!1;else if(r)if(this.expirationTime<r)u=!0;else{const f=this.expirationTime-r;f?this.expirationTime=s+Math.max(f,3e4):u=!0}else u=!0;u?(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-Date.now(),Math.pow(2,31)-1)}refreshFeatureState(l,r){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData&&!this.latestFeatureIndex.is3DTile||!l)return;const s=l.style.listImages();this.updateBuckets(l,!1,r,void 0,void 0,s)}hasAppearances(l){for(const r in this.buckets)if(l.style.hasLayer(r)&&this.buckets[r].layers.some(s=>s.appearances&&s.appearances.length>0))return!0;return!1}updateBuckets(l,r,s,u,f,g){if(!this.latestFeatureIndex||!l.style)return;const v=g||l.style.listImages(),x=l.style.getBrightness(),w=f||new Set;for(const A in this.buckets){if(!l.style.hasLayer(A))continue;const R=this.buckets[A],M=R.layers[0],O=M.sourceLayer||"_geojsonTileLayer",B=l.style.getLayerSourceCache(M),N=R.layers.some(ue=>w.has(ue.fqid)),G=(u||N)&&R instanceof rc?l.style.getOwnLayer(A):void 0;let H=s&&s[O]||{};B&&!s&&(H=B._state.getState(O,void 0));const J=this.imageAtlas?Object.fromEntries(this.imageAtlas.patternPositions):{},re=Object.keys(H).length>0&&!r;R.hasAppearances=R.layers.some(ue=>ue.appearances&&ue.appearances.length>0);const Q=re?R.stateDependentLayers:R.layers;if(re&&R.stateDependentLayers.length!==0||r||N||u){const ue=this.latestFeatureIndex.loadVTLayers()[O];if(R.update(H,ue,v,J,Q,r,x,this.tileID.canonical),(u||N)&&(!r||r&&R instanceof rc&&(!R.text.uboBinder||R.text.uboBinder.isLightConstant||!R.icon.uboBinder||R.icon.uboBinder.isLightConstant))&&R instanceof rc&&G&&G.type==="symbol"){const he=R;he.text&&he.text.uboBinder&&he.text.uboBinder.updateDynamicExpressions(G,ue,this.tileID.canonical,v,H,x),he.icon&&he.icon.uboBinder&&he.icon.uboBinder.updateDynamicExpressions(G,ue,this.tileID.canonical,v,H,x)}if(R instanceof rc){const he=R,Te=l.context;he.text&&he.text.uboBinder&&he.text.uboBinder.upload(Te),he.icon&&he.icon.uboBinder&&he.icon.uboBinder.upload(Te)}}if(re&&R.stateDependentLayers.length!==0||r||R.hasAppearances){const ue={zoom:l.transform.zoom,pitch:l.transform.pitch,brightness:l.style.getBrightness()||0,worldview:l.worldview},he=R.updateAppearances(this.tileID.canonical,H,v,ue,l.imageManager,re&&R.stateDependentLayers.length!==0);if(he&&he.hasUboChanges){const Te=l.context;R instanceof rc&&R.text&&R.text.uboBinder&&R.text.uboBinder.upload(Te),R instanceof rc&&R.icon&&R.icon.uboBinder&&R.icon.uboBinder.upload(Te)}}(R instanceof gS||R instanceof qw)&&l._terrain&&l._terrain.enabled&&B&&R.uploadPending()&&l._terrain._clearRenderCacheForTile(B.id,this.tileID);const le=l&&l.style&&l.style.getOwnLayer(A);le&&(this.queryPadding=Math.max(this.queryPadding,le.queryRadius(R)||0))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<Qs.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(l){this.symbolFadeHoldUntil=Qs.now()+l}setTexture(l,r){const s=r.context,u=s.gl;this.texture=this.texture||r.getTileTexture(l.width),this.texture&&this.texture instanceof zu?this.texture.update(l):(this.texture=new zu(s,l,u.RGBA8,{useMipmap:!0}),this.texture.bind(u.LINEAR,u.CLAMP_TO_EDGE))}
vendor: 6,769 bytes, line 24
24setDependencies(l,r){const s={};for(const u of r)s[u]=!0;this.dependencies[l]=s}hasDependency(l,r){for(const s of l){const u=this.dependencies[s];if(u){for(const f of r)if(u[f])return!0}}return!1}clearQueryDebugViz(){}_makeDebugTileBoundsBuffers(l,r){if(!r||r.name==="mercator"||this._tileDebugBuffer)return;const s=sa(jF,this.tileID.canonical,this.tileTransform)[0],u=new Ha,f=new Dc;for(let g=0;g<s.length;g++){const{x:v,y:x}=s[g];u.emplaceBack(v,x),f.emplaceBack(g)}f.emplaceBack(0),this._tileDebugIndexBuffer=l.createIndexBuffer(f),this._tileDebugBuffer=l.createVertexBuffer(u,$e.members),this._tileDebugSegments=Wr.simpleSegment(0,0,u.length,f.length)}_makeTileBoundsBuffers(l,r){if(this._tileBoundsBuffer||!r||r.name==="mercator")return;const s=sa(jF,this.tileID.canonical,this.tileTransform)[0];let u,f;if(this.isRaster){const g=(function(v,x){const w=im(v,x),A=Math.pow(2,v.z);for(let G=0;G<Nu;G++)for(let H=0;H<Nu;H++){const J=ia((v.x+(H+UF(H))/ic)/A),re=Mo((v.y+(G+UF(G))/ic)/A),Q=x.project(J,re),le=G*Nu+H;Vu[2*le+0]=Math.round((Q.x*w.scale-w.x)*Bt),Vu[2*le+1]=Math.round((Q.y*w.scale-w.y)*Bt)}_f.fill(0),zS.fill(0);for(let G=2045;G>=0;G--){const H=4*G,J=gf[H+0],re=gf[H+1],Q=gf[H+2],le=gf[H+3],ue=J+Q>>1,he=re+le>>1,Te=ue+he-re,me=he+J-ue,xe=re*Nu+J,_e=le*Nu+Q,we=he*Nu+ue,je=Math.hypot((Vu[2*xe+0]+Vu[2*_e+0])/2-Vu[2*we+0],(Vu[2*xe+1]+Vu[2*_e+1])/2-Vu[2*we+1])>=16;_f[we]=_f[we]||(je?1:0),G<1022&&(_f[we]=_f[we]||_f[(re+me>>1)*Nu+(J+Te>>1)]||_f[(le+me>>1)*Nu+(Q+Te>>1)])}const R=new Pd,M=new _i;let O=0;function B(G,H){const J=H*Nu+G;return zS[J]===0&&(R.emplaceBack(Vu[2*J+0],Vu[2*J+1],G*Bt/ic,H*Bt/ic),zS[J]=++O),zS[J]-1}function N(G,H,J,re,Q,le){const ue=G+J>>1,he=H+re>>1;if(Math.abs(G-Q)+Math.abs(H-le)>1&&_f[he*Nu+ue])N(Q,le,G,H,ue,he),N(J,re,Q,le,ue,he);else{const Te=B(G,H),me=B(J,re),xe=B(Q,le);M.emplaceBack(Te,me,xe)}}return N(0,0,ic,ic,ic,0),N(ic,ic,0,0,0,ic),{vertices:R,indices:M}})(this.tileID.canonical,r);u=g.vertices,f=g.indices}else{u=new Pd,f=new _i;for(const{x:v,y:x}of s)u.emplaceBack(v,x,0,0);const g=vs(u.int16.subarray(0,4*u.length),void 0,4);for(let v=0;v<g.length;v+=3)f.emplaceBack(g[v],g[v+1],g[v+2])}this._tileBoundsBuffer=l.createVertexBuffer(u,MS.members),this._tileBoundsIndexBuffer=l.createIndexBuffer(f),this._tileBoundsSegments=Wr.simpleSegment(0,0,u.length,f.length)}_makeGlobeTileDebugBuffers(l,r){const s=r.projection;if(!s||s.name!=="globe"||r.freezeTileCoverage)return;const u=this.tileID.canonical,f=An(dn(u,r)),g=Fr(r.zoom);let v;g>0&&(v=Y(new Float64Array(16),r.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(l,u,r,f,v,g),this._makeGlobeTileDebugTextBuffer(l,u,r,f,v,g)}_globePoint(l,r,s,u,f,g,v){let x=kn(l,r,s);if(g){const w=1<<s.z,A=Bc(u.center.lng),R=tc(u.center.lat),M=(s.x+.5)/w-A;let O=0;M>.5?O=-1:M<-.5&&(O=1);let B=(l/Bt+s.x)/w+O,N=(r/Bt+s.y)/w;B=(B-A)*u._pixelsPerMercatorPixel+A,N=(N-R)*u._pixelsPerMercatorPixel+R;const G=[B*u.worldSize,N*u.worldSize,0];mt(G,G,g),x=xt(x,G,v)}return mt(x,x,f)}_makeGlobeTileDebugBorderBuffer(l,r,s,u,f,g){const v=new Ha,x=new Dc,w=new Id,A=(M,O,B,N,G)=>{const H=(B-M)/(G-1),J=(N-O)/(G-1),re=v.length;for(let Q=0;Q<G;Q++){const le=M+Q*H,ue=O+Q*J;v.emplaceBack(le,ue);const he=this._globePoint(le,ue,r,s,u,f,g);w.emplaceBack(he[0],he[1],he[2]),x.emplaceBack(re+Q)}},R=Bt;A(0,0,R,0,16),A(R,0,R,R,16),A(R,R,0,R,16),A(0,R,0,0,16),this._tileDebugIndexBuffer=l.createIndexBuffer(x),this._tileDebugBuffer=l.createVertexBuffer(v,$e.members),this._globeTileDebugBorderBuffer=l.createVertexBuffer(w,rt.members),this._tileDebugSegments=Wr.simpleSegment(0,0,v.length,x.length)}_makeGlobeTileDebugTextBuffer(l,r,s,u,f,g){const v=new Ha,x=new _i,w=new Id,A=25;x.reserve(32),v.reserve(A),w.reserve(A);const R=(M,O)=>A*M+O;for(let M=0;M<A;M++){const O=2048*M;for(let B=0;B<A;B++){const N=2048*B;v.emplaceBack(N,O);const G=this._globePoint(N,O,r,s,u,f,g);w.emplaceBack(G[0],G[1],G[2])}}for(let M=0;M<4;M++)for(let O=0;O<4;O++){const B=R(M,O),N=R(M,O+1),G=R(M+1,O),H=R(M+1,O+1);x.emplaceBack(B,N,G),x.emplaceBack(G,N,H)}this._tileDebugTextIndexBuffer=l.createIndexBuffer(x),this._tileDebugTextBuffer=l.createVertexBuffer(v,$e.members),this._globeTileDebugTextBuffer=l.createVertexBuffer(w,rt.members),this._tileDebugTextSegments=Wr.simpleSegment(0,0,A,32)}destroy(l=!0){for(const r in this.buckets)this.buckets[r].destroy(l);this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&delete this.imageAtlasTexture,this.glyphAtlasTexture&&(this.glyphAtlasTexture.destroy(),delete this.glyphAtlasTexture),this.lineAtlasTexture&&(this.lineAtlasTexture.destroy(),delete this.lineAtlasTexture),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),l&&this.texture&&this.texture instanceof zu&&(this.texture.destroy(),delete this.texture),this.emissiveTexture&&this.emissiveTexture instanceof zu&&(this.emissiveTexture.destroy(),delete this.emissiveTexture),this.hillshadeFBO&&(this.hillshadeFBO.destroy(),delete this.hillshadeFBO),this.dem&&delete this.dem,this.neighboringTiles&&delete this.neighboringTiles,this.demTexture&&(this.demTexture.destroy(),delete this.demTexture),this.rasterParticleState&&(this.rasterParticleState.destroy(),delete this.rasterParticleState),this.latestFeatureIndex=null,this.state="unloaded"}},y.b4=Ph,y.b5=hp,y.b6=function(l,r){const s=[];for(const u in l)u in r||s.push(u);return s},y.b7=$F,y.b8=["type","source","source-layer","minzoom","maxzoom","filter","layout"],y.b9=dl,y.bA=$,y.bB=K,y.bC=Eo,y.bD=aO,y.bE=Kw,y.bF=dO,y.bG=hO,y.bH=Ya,y.bI=nn,y.bJ=OA,y.bK=YD,y.bL=WA,y.bM=uI,y.bN=Yn,y.bO=Ut,y.bP=ir,y.bQ=function(l,r,s){s*=.5;var u=r[0],f=r[1],g=r[2],v=r[3],x=Math.sin(s),w=Math.cos(s);return l[0]=u*w+f*x,l[1]=f*w-u*x,l[2]=g*w+v*x,l[3]=v*w-g*x,l},y.bR=hr,y.bS=Xi,y.bT=qe,y.bU=function(l,r){return l[0]=-r[0],l[1]=-r[1],l[2]=-r[2],l[3]=r[3],l},y.bV=Qt,y.bW=function(l,r,s,u,f){var g=1/Math.tan(r/2);if(l[0]=g/s,l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=g,l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[11]=-1,l[12]=0,l[13]=0,l[15]=0,f!=null&&f!==1/0){var v=1/(u-f);l[10]=(f+u)*v,l[14]=2*f*u*v}
24else l[10]=-1,l[14]=-2*u;return l},y.bX=function(l,r,s,u,f,g,v){var x=1/(r-s),w=1/(u-f),A=1/(g-v);return l[0]=-2*x,l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=-2*w,l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[10]=2*A,l[11]=0,l[12]=(r+s)*x,l[13]=(f+u)*w,l[14]=(v+g)*A,l[15]=1,l},y.bY=Ps,y.bZ=Mo,y.b_=function(l,r,s){l[4*r+0]=s[0],l[4*r+1]=s[1],l[4*r+2]=s[2],l[4*r+3]=s[3]},y.ba=Y,y.bb=W,y.bc=ke,y.bd=U,y.be=function(l,r){const{x:s,y:u}=l.point,f=Or(s,u,l.worldSize/l._pixelsPerMercatorPixel,0,0);return X(f,f,or(Ct(r)))},y.bf=P,y.bg=Ie,y.bh=$t,y.bi=Rn,y.bj=Be,y.bk=Bn,y.bl=c_,y.bm=ka,y.bn=BA,y.bo=function(l,r,s,u,f){const g=5*r+2;l.float32[g+0]=s,l.float32[g+1]=u,l.float32[g+2]=f},y.bp=h_,y.bq=Cd,y.br=ar,y.bs=Ks,y.bt=ro,y.bu=Sc,y.bv=Et,y.bw=function(l,r,s,u){var f=new C(4);return f[0]=l,f[1]=r,f[2]=s,f[3]=u,f},y.bx=class{isDataAvailableAtPoint(l){const r=this._source();if(this.isUsingMockSource()||!r||l.y<0||l.y>1)return!1;const s=r.getSource().maxzoom,u=1<<s,f=Math.floor(l.x),g=Math.floor((l.x-f)*u),v=Math.floor(l.y*u),x=this.findDEMTileFor(new De(s,f,s,g,v));return!(!x||!x.dem)}getAtPointOrZero(l,r=0){return this.getAtPoint(l,r)||0}getAtPoint(l,r,s=!0){if(this.isUsingMockSource())return null;r==null&&(r=null);const u=this._source();if(!u||l.y<0||l.y>1)return r;const f=u.getSource().maxzoom,g=1<<f,v=Math.floor(l.x),x=l.x-v,w=new De(f,v,f,Math.floor(x*g),Math.floor(l.y*g)),A=this.findDEMTileFor(w);if(!A||!A.dem)return r;const R=A.dem,M=1<<A.tileID.canonical.z,O=(x*M-A.tileID.canonical.x)*R.dim,B=(l.y*M-A.tileID.canonical.y)*R.dim,N=Math.floor(O),G=Math.floor(B);return(s?this.exaggeration():1)*Sn(Sn(R.get(N,G),R.get(N,G+1),B-G),Sn(R.get(N+1,G),R.get(N+1,G+1),B-G),O-N)}static getAtTileOffset(l,r,s,u){const f=1<<l.canonical.z;return u?u.pointElevation(r):s?s.getAtPointOrZero(new ls(l.wrap+(l.canonical.x+r.x/Bt)/f,(l.canonical.y+r.y/Bt)/f)):0}static getAtTileOffsetFunc(l,r,s,u){return(f,g,v)=>{const x=this.getAtTileOffset(l,f,g,v),w=u.upVector(l.canonical,f.x,f.y);return Yn(w,w,x*u.upVectorScale(l.canonical,r,s).metersToTile),w}}getForTilePoints(l,r,s,u){if(this.isUsingMockSource())return!1;const f=p_.create(this,l,u);return!!f&&(r.forEach(g=>{g[2]=this.exaggeration()*f.getElevationAt(g[0],g[1],s,!0)}),!0)}getMinMaxForTile(l){if(this.isUsingMockSource())return null;const r=this.findDEMTileFor(l);if(!r||!r.dem)return null;const s=r.dem.tree,u=r.tileID,f=1<<l.canonical.z-u.canonical.z;let g=l.canonical.x/f-u.canonical.x,v=l.canonical.y/f-u.canonical.y,x=0;for(let w=0;w<l.canonical.z-u.canonical.z&&!s.leaves[x];w++){g*=2,v*=2;const A=2*Math.floor(v)+Math.floor(g);x=s.childOffsets[x]+A,g%=1,v%=1}return{min:this.exaggeration()*s.minimums[x],max:this.exaggeration()*s.maximums[x]}}getMinElevationBelowMSL(){throw new Error("Pure virtual method called.")}raycast(l,r,s){throw new Error("Pure virtual method called.")}pointCoordinate(l){throw new Error("Pure virtual method called.")}_source(){throw new Error("Pure virtual method called.")}isUsingMockSource(){throw new Error("Pure virtual method called.")}exaggeration(){throw new Error("Pure virtual method called.")}findDEMTileFor(l){throw new Error("Pure virtual method called.")}get visibleDemTiles(){throw new Error("Getter must be implemented in subclass.")}getMinMaxForVisibleTiles(){const l=this.visibleDemTiles;if(l.length===0)return null;let r=!1,s=Number.MAX_VALUE,u=Number.MIN_VALUE;for(const f of l){const g=this.getMinMaxForTile(f.tileID);g&&(s=Math.min(s,g.min),u=Math.max(u,g.max),r=!0)}return r?{min:s,max:u}:null}},y.by=oS,y.bz=b,y.c=Ch,y.c$=qO,y.c0=Wp,y.c1=Ui,y.c2=qa,y.c3=ku,y.c4=uF,y.c5=function(l,r){return l[0]===r[0]&&l[1]===r[1]&&l[2]===r[2]&&l[3]===r[3]},y.c6=Ve,y.c7=function(l){var r=l[0],s=l[1],u=l[2],f=l[3];return Math.sqrt(r*r+s*s+u*u+f*f)},y.c8=Ur,y.c9=Vt,y.cA=uS,y.cB=Ht,y.cC=XO,y.cD=function(l){const r=XO(l,!0);return P([],[r[0],r[1],r[4],r[5]])},y.cE=ne,y.cF=Ka,y.cG=fe,y.cH=function(l,r){return l[0]=r[0],l[1]=r[1],l[2]=r[2],l[3]=r[3],l[4]=r[4],l[5]=r[5],l[6]=r[6],l[7]=r[7],l[8]=r[8],l[9]=r[9],l[10]=r[10],l[11]=r[11],l[12]=r[12],l[13]=r[13],l[14]=r[14],l[15]=r[15],l},y.cI=function(l){const{x:r,y:s}=l.point,{lng:u,lat:f}=l._center;return Or(r,s,l.worldSize,u,f)},y.cJ=xn,y.cK=Fe,y.cL=ge,y.cM=se,y.cN=5,y.cO=function(l,r,s){let u=0;for(let f=0;f<2;++f)l[f]>0&&(u+=(l[f]-0)*(l[f]-0)),r[f]<0&&(u+=(0-r[f])*(0-r[f]));return u},y.cP=function(l){return l*l*l*l*l},y.cQ=Xp,y.cR=45,y.cS=J0,y.cT=function(l,r,s){const u=Math.sqrt(l*l+r*r+s*s),f=u>0?Math.acos(s/u)*Tc:0;let g=l!==0||r!==0?Math.atan2(-r,-l)*Tc+90:0;return g<0&&(g+=360),[u,g,f]},y.cU=Wt,y.cV=bi,y.cW=Aa,y.cX=sn,y.cY=pi,y.cZ=Mn,y.c_=function(l){return[Math.pow(l[0],1/2.2),Math.pow(l[1],1/2.2),Math.pow(l[2],1/2.2)]},y.ca=Ne,y.cb=3,y.cc=2,y.cd=7,y.ce=6,y.cf=Xe,y.cg=zt,y.ch=jt,y.ci=0,y.cj=1,y.ck=4,y.cl=5,y.cm=Ye,y.cn=lv,y.co=ZO,y.cp=Ae,y.cq=Jt,y.cr=function(l,r,s,u,f,g,v,x,w){if
24(w.name==="globe")return Jt(l,r,new Ae(s,u,f),!1);const A=im({z:s,x:u,y:f},w);return new pi([(g+A.x/A.scale)*r,r*(A.y/A.scale),v],[(g+A.x2/A.scale)*r,r*(A.y2/A.scale),x])},y.cs=function(l,r,s){return l[0]=Math.min(r[0],s[0]),l[1]=Math.min(r[1],s[1]),l[2]=Math.min(r[2],s[2]),l[3]=Math.min(r[3],s[3]),l},y.ct=function(l,r,s){return l[0]=Math.max(r[0],s[0]),l[1]=Math.max(r[1],s[1]),l[2]=Math.max(r[2],s[2]),l[3]=Math.max(r[3],s[3]),l},y.cu=function(l){const r=Math.round((l+45+360)%360/90)%4;return Pe[r]},y.cv=oa,y.cw=st,y.cx=6,y.cy=function(l){const r=$(new Float64Array(16));X(r,l.pixelMatrix,l.globeMatrix);const s=[0,Ca,0],u=[0,Za,0];return mt(s,s,r),mt(u,u,r),[s[0]>0&&s[0]<=l.width&&s[1]>0&&s[1]<=l.height&&!yr(l,new wr(l.center.lat,90)),u[0]>0&&u[0]<=l.width&&u[1]>0&&u[1]<=l.height&&!yr(l,new wr(l.center.lat,-90))]},y.cz=function(l,r){const{scale:s}=l.tileTransform,u=s*Bt/(l.tileSize*Math.pow(2,r.zoom-l.tileID.overscaledZ+l.tileID.canonical.z)),f=r.inverseAdjustmentMatrix;return new Float32Array([f[0]*u,f[1]*u,f[2]*u,f[3]*u])},y.d=function(l){return Xr.API_TILEJSON_REGEX.test(l)},y.d$=qt,y.d0=EA,y.d1=JO,y.d2=T,y.d3=class{static calculate(l,r,s){const u=new Set,f=new Map,g=new Set,v=new Set;for(const w of Object.values(l))for(const[A,R]of Object.entries(w.floors)){g.add(A),R.isDefault&&v.add(A),R.conflicts&&f.set(A,R.conflicts);const M=A===r,O=R.connections&&r&&R.connections.has(r);(M||O)&&u.add(A)}const x=w=>{const A=f.get(w)||new Set;for(const R of u)if((f.get(R)||new Set).has(w)||A.has(R))return!0;return!1};if(s)for(const w of s)g.has(w)&&(x(w)||u.add(w));for(const w of v)u.has(w)||x(w)||u.add(w);return u}},y.d4=xS,y.d5=jA,y.d6=Jm,y.d7=function(){return{API_URL:Xr.API_URL,DRACO_URL:Xr.DRACO_URL,MESHOPT_URL:Xr.MESHOPT_URL,MESHOPT_SIMD_URL:Xr.MESHOPT_SIMD_URL,BUILDING_GEN_URL:Xr.BUILDING_GEN_URL}},y.d8=R0,y.d9=Ly,y.dA=$e,y.dB=Wr,y.dC=Dr,y.dD=ct,y.dE=Ha,y.dF=_i,y.dG=function(l,r){return[Math.pow(l[0],2.2)*r,Math.pow(l[1],2.2)*r,Math.pow(l[2],2.2)*r]},y.dH=L,y.dI=function(l,r){var s=Math.sin(r),u=Math.cos(r);return l[0]=u,l[1]=s,l[2]=0,l[3]=-s,l[4]=u,l[5]=0,l[6]=0,l[7]=0,l[8]=1,l},y.dJ=kt,y.dK=fr,y.dL=ho,y.dM=Vl,y.dN=eI,y.dO=function(l,r){const s=[0,0,0];return mt(s,s,An(Ct(r.canonical))),mt(s,s,l),s},y.dP=l=>({u_matrix:new ku(l),u_texsize:new qa(l),u_pixels_to_tile_units:new af(l),u_device_pixel_ratio:new Ui(l),u_width_scale:new Ui(l),u_floor_width_scale:new Ui(l),u_image:new Hp(l),u_units_to_pixels:new qa(l),u_tile_units_to_pixels:new Ui(l),u_alpha_discard_threshold:new Ui(l),u_trim_offset:new qa(l),u_trim_fade_range:new qa(l),u_trim_gradient_mix_range:new qa(l),u_trim_color:new J0(l),u_zbias_factor:new Ui(l),u_tile_to_meter:new Ui(l),u_ground_shadow_factor:new Wp(l),u_pattern_transition:new Ui(l)}),y.dQ=l=>({u_matrix:new ku(l),u_pixels_to_tile_units:new af(l),u_device_pixel_ratio:new Ui(l),u_width_scale:new Ui(l),u_floor_width_scale:new Ui(l),u_units_to_pixels:new qa(l),u_dash_image:new Hp(l),u_gradient_image:new Hp(l),u_image_height:new Ui(l),u_texsize:new qa(l),u_tile_units_to_pixels:new Ui(l),u_alpha_discard_threshold:new Ui(l),u_trim_offset:new qa(l),u_trim_fade_range:new qa(l),u_trim_gradient_mix_range:new qa(l),u_trim_color:new J0(l),u_zbias_factor:new Ui(l),u_tile_to_meter:new Ui(l),u_ground_shadow_factor:new Wp(l)}),y.dR=l=>({u_camera_to_center_distance:new Ui(l),u_extrude_scale:new af(l),u_device_pixel_ratio:new Ui(l),u_matrix:new ku(l),u_inv_rot_matrix:new ku(l),u_merc_center:new qa(l),u_tile_id:new Wp(l),u_zoom_transition:new Ui(l),u_up_dir:new Wp(l),u_emissive_strength:new Ui(l)}),y.dS=Kl,y.dT=yW,y.dU=class{constructor(l,r,s,u){this.context=l,this.format=u,this.size=s,this.texture=l.gl.createTexture();const[f,g,v]=this.size,{gl:x}=l;x.bindTexture(x.TEXTURE_3D,this.texture),l.pixelStoreUnpackFlipY.set(!1),l.pixelStoreUnpack.set(1),l.pixelStoreUnpackPremultiplyAlpha.set(!1),"data"in r&&r.data&&x.texImage3D(x.TEXTURE_3D,0,this.format,f,g,v,0,gA(this.format),_A(this.format),r.data)}bind(l,r){const{context:s}=this,{gl:u}=s;u.bindTexture(u.TEXTURE_3D,this.texture),l!==this.minFilter&&(u.texParameteri(u.TEXTURE_3D,u.TEXTURE_MAG_FILTER,l),u.texParameteri(u.TEXTURE_3D,u.TEXTURE_MIN_FILTER,l),this.minFilter=l),r!==this.wrapS&&(u.texParameteri(u.TEXTURE_3D,u.TEXTURE_WRAP_S,r),u.texParameteri(u.TEXTURE_3D,u.TEXTURE_WRAP_T,r),this.wrapS=r)}destroy(){const{gl:l}=this.context;l.deleteTexture(this.texture),this.texture=null}},y.dV=kr,y.dW=(l,r,s,u,f,g)=>{const v=l.transform,x=v.projection.name==="globe";let w;if(g.paint.get("circle-pitch-alignment")==="map")if(x){const R=fr(v.zoom,r.canonical)*v._pixelsPerMercatorPixel;
24w=Float32Array.from([R,0,0,R])}else w=v.calculatePixelsToTileUnitsMatrix(s);else w=new Float32Array([v.pixelsToGLUnits[0],0,0,v.pixelsToGLUnits[1]]);const A={u_camera_to_center_distance:l.transform.getCameraToCenterDistance(v.projection),u_matrix:l.translatePosMatrix(r.projMatrix,s,g.paint.get("circle-translate"),g.paint.get("circle-translate-anchor")),u_device_pixel_ratio:Qs.devicePixelRatio,u_extrude_scale:w,u_inv_rot_matrix:Si,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0],u_emissive_strength:g.paint.get("circle-emissive-strength")};if(x){A.u_inv_rot_matrix=u,A.u_merc_center=f,A.u_tile_id=[r.canonical.x,r.canonical.y,1<<r.canonical.z],A.u_zoom_transition=Fr(v.zoom);const R=f[0]*Bt,M=f[1]*Bt;A.u_up_dir=v.projection.upVector(new Ae(0,0,0),R,M)}return A},y.dX=yD,y.dY=_s,y.dZ=(l,r,s,u,f,g,v,x,w,A)=>{const R=l.transform,M=R.pitch<15?mD(.07,.7,Ee((14-R.zoom)/5,0,1)):.07,O=s.paint.get("line-trim-color-use-theme").constantOr("default")==="none";return{u_matrix:_D(l,r,s,u),u_texsize:r.imageAtlasTexture?r.imageAtlasTexture.size:[0,0],u_pixels_to_tile_units:R.calculatePixelsToTileUnitsMatrix(r),u_device_pixel_ratio:f,u_width_scale:g,u_floor_width_scale:v,u_image:0,u_tile_units_to_pixels:gD(r,R),u_units_to_pixels:[1/R.pixelsToGLUnits[0],1/R.pixelsToGLUnits[1]],u_alpha_discard_threshold:0,u_trim_offset:x,u_trim_fade_range:s.paint.get("line-trim-fade-range"),u_trim_gradient_mix_range:[1,1],u_trim_color:s.paint.get("line-trim-color").toPremultipliedRenderColor(O?null:s.lut).toArray01(),u_zbias_factor:M,u_tile_to_meter:Aa(r.tileID.canonical,0),u_ground_shadow_factor:w,u_pattern_transition:A}},y.d_=(l,r,s,u,f,g,v,x,w,A)=>{const R=l.transform,M=R.calculatePixelsToTileUnitsMatrix(r),O=s.paint.get("line-trim-color-use-theme").constantOr("default")==="none",B=R.pitch<15?mD(.07,.7,Ee((14-R.zoom)/5,0,1)):.07;return{u_matrix:_D(l,r,s,u),u_pixels_to_tile_units:M,u_device_pixel_ratio:g,u_width_scale:v,u_floor_width_scale:x,u_units_to_pixels:[1/R.pixelsToGLUnits[0],1/R.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:f,u_texsize:vD(s)&&r.lineAtlasTexture?r.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:gD(r,l.transform),u_alpha_discard_threshold:0,u_trim_offset:w,u_trim_fade_range:s.paint.get("line-trim-fade-range"),u_trim_gradient_mix_range:[1,1],u_trim_color:s.paint.get("line-trim-color").toPremultipliedRenderColor(O?null:s.lut).toArray01(),u_zbias_factor:B,u_tile_to_meter:Aa(r.tileID.canonical,0),u_ground_shadow_factor:A}},y.da=tg,y.db=Kn,y.dc=function(l){const r=l.indexOf(Yl);return r>=0?l.slice(0,r):l},y.dd=uD,y.de=function(l){return l.includes(Yl)},y.df=function(l){const r=l.lastIndexOf(Yl);return r>=0?l.slice(r+1):""},y.dg=function(l){const r=[],s=l.id;return s===void 0&&r.push({message:`layers.${s}: missing required property "id"`}),l.render===void 0&&r.push({message:`layers.${s}: missing required method "render"`}),l.renderingMode&&l.renderingMode!=="2d"&&l.renderingMode!=="3d"&&r.push({message:`layers.${s}: property "renderingMode" must be either "2d" or "3d"`}),r},y.dh=function(l,r,s,u){return l.type==="custom"?new pq(l,r):new yq[l.type](l,r,s,u)},y.di=ln,y.dj=Vg,y.dk=pw,y.dl=class extends sm{constructor(l,r){super(l._vectorTileFeature,l._z,l._x,l._y,l.id),l.state&&(this.state=Object.assign({},l.state)),this.target=r.target,this.namespace=r.namespace,r.properties&&(this.properties=r.properties),this.target&&("featuresetId"in this.target&&!this.target.importId||"layerId"in this.target)&&(this.source=l.source,this.sourceLayer=l.sourceLayer,this.layer=l.layer)}toJSON(){const l=super.toJSON();return l.target=this.target,l.namespace=this.namespace,l}},y.dm=Bg,y.dn=function(l){return l({pluginStatus:As,pluginURL:_l}),Bg.on("pluginStateChange",l),l},y.dp=Iw,y.dq=class extends Jl{constructor(l){super(l),this.current=new Float32Array(9)}set(l,r,s){if(!this.fetchUniformLocation(l,r))return;const u=this.current;for(let f=0;f<9;f++)if(s[f]!==u[f]){u.set(s),this.gl.uniformMatrix3fv(this.location,!1,u);break}}},y.dr=Me,y.ds=function(l,r,s){const u=Fr(s.zoom),f=l.style.map._antialias,g=l.terrain&&l.terrain.exaggeration()>0;return u===0&&!f&&!g},y.dt=function(l){const r=l.pixelsPerMeter,s=r/Ps(1,l.center.lat),u=$(new Float64Array(16));return K(u,u,[l.point.x,l.point.y,0]),ne(u,u,[s,s,r]),Float32Array.from(u)},y.du=tn,y.dv=function(l){const r=80.051129;l=Ee(l,-80.051129,r)/r*90;const s=Math.pow(Math.abs(Math.sin(ae(l))),3);return Math.round(s*(e_.length-1))},y.dw=function(l,r,s,u){const f=r.getNorth(),g=r.getSouth(),v=r.getWest(),x=r.getEast(),w=1<<l.z,A=x-v,R=f-g,M=A/lf,O=-R/e_[s],B=[0,M,
vendor: 4,741 bytes, line 24
240,O,0,0,f,v,0];if(l.z>0){const N=180/u;V(B,B,[N/A+1,0,0,0,N/R+1,0,-.5*N/M,.5*N/O,1])}return B[2]=w,B[5]=l.x,B[8]=l.y,B},y.dx=An,y.dy=Ct,y.dz=function(l,r,s){const u=$(new Float64Array(16)),f=(r/(1<<l)-.5)*Math.PI*2;return ye(u,s.globeMatrix,f),Float32Array.from(u)},y.e=function(l){return l.indexOf("mapbox:")===0},y.e$=yA,y.e0=Er,y.e1=tv,y.e2=Ke,y.e3=iS,y.e4=xO,y.e5=Vd,y.e6=450,y.e7=7,y.e8=Fd,y.e9=function(l,r){if(l===r){var s=r[1],u=r[2],f=r[3],g=r[6],v=r[7],x=r[11];l[1]=r[4],l[2]=r[8],l[3]=r[12],l[4]=s,l[6]=r[9],l[7]=r[13],l[8]=u,l[9]=g,l[11]=r[14],l[12]=f,l[13]=v,l[14]=x}else l[0]=r[0],l[1]=r[4],l[2]=r[8],l[3]=r[12],l[4]=r[1],l[5]=r[5],l[6]=r[9],l[7]=r[13],l[8]=r[2],l[9]=r[6],l[10]=r[10],l[11]=r[14],l[12]=r[3],l[13]=r[7],l[14]=r[11],l[15]=r[15];return l},y.eA=function(l,r){var s=2*Math.acos(r[3]),u=Math.sin(s/2);return u>E?(l[0]=r[0]/u,l[1]=r[1]/u,l[2]=r[2]/u):(l[0]=1,l[1]=0,l[2]=0),s},y.eB=iI,y.eC=fS,y.eD=hS,y.eE=[1,1,1],y.eF=p_,y.eG=function(l,r,s,u){var f=r[0],g=r[1],v=r[2],x=r[3];return l[0]=f+u*(s[0]-f),l[1]=g+u*(s[1]-g),l[2]=v+u*(s[2]-v),l[3]=x+u*(s[3]-x),l},y.eH=o_,y.eI=Bs,y.eJ=class{constructor(){this._updateTime=0,this._sourceIds=[],this._activeRegions=[],this._prevRegions=[],this._globalClipBounds={min:new St(1/0,1/0),max:new St(-1/0,-1/0)}}clear(){this._activeRegions.length>0&&++this._updateTime,this._activeRegions=[],this._prevRegions=[]}get updateTime(){return this._updateTime}getReplacementRegionsForTile(l,r=!1){const s=cO(new St(0,0),new St(Bt,Bt),l),u=[];if(r&&!aA(s,this._globalClipBounds))return u;for(const f of this._activeRegions){if(f.hiddenByOverlap||!aA(s,f))continue;const g=sH(f.min,f.max,l);u.push({min:g.min,max:g.max,sourceId:this._sourceIds[f.priority],footprint:f.footprint,footprintTileId:f.tileId,order:f.order,clipMask:f.clipMask,clipScope:f.clipScope})}return u}setSources(l){this._setSources(l.map(r=>({getSourceId:()=>r.cache.id,getFootprints:()=>{const s=[];for(const u of r.cache.getVisibleCoordinates()){const f=r.cache.getTile(u).buckets[r.layer];f&&f.updateFootprints(u.toUnwrapped(),s)}return s},getOrder:()=>r.order,getClipMask:()=>r.clipMask,getClipScope:()=>r.clipScope})))}_addSource(l){const r=l.getFootprints();if(r.length===0)return;const s=l.getOrder(),u=l.getClipMask(),f=l.getClipScope();for(const g of r){if(!g.footprint)continue;const v=cO(g.footprint.min,g.footprint.max,g.id);this._activeRegions.push({min:v.min,max:v.max,hiddenByOverlap:!1,priority:this._sourceIds.length,tileId:g.id,footprint:g.footprint,order:s,clipMask:u,clipScope:f})}this._sourceIds.push(l.getSourceId())}_computeReplacement(){this._activeRegions.sort((r,s)=>r.priority-s.priority||Zw(r.min,s.min)||Zw(r.max,s.max)||r.order-s.order||r.clipMask-s.clipMask||(function(u,f){const g=(v,x)=>v+x;return u.length-f.length||u.reduce(g,"").localeCompare(f.reduce(g,""))})(r.clipScope,s.clipScope));let l=this._activeRegions.length!==this._prevRegions.length;if(!l){let r=0;for(;!l&&r!==this._activeRegions.length;){const s=this._activeRegions[r],u=this._prevRegions[r];l=s.priority!==u.priority||!lO(s,u)||s.order!==u.order||s.clipMask!==u.clipMask||!dl(s.clipScope,u.clipScope),this._activeRegions[r].hiddenByOverlap=u.hiddenByOverlap,++r}}if(l){++this._updateTime;for(const s of this._activeRegions)s.order!==yv&&(this._globalClipBounds.min.x=Math.min(this._globalClipBounds.min.x,s.min.x),this._globalClipBounds.min.y=Math.min(this._globalClipBounds.min.y,s.min.y),this._globalClipBounds.max.x=Math.max(this._globalClipBounds.max.x,s.max.x),this._globalClipBounds.max.y=Math.max(this._globalClipBounds.max.y,s.max.y));const r=s=>{const u=this._activeRegions;if(s>=u.length)return s;const f=u[s].priority;for(;s<u.length&&u[s].priority===f;)++s;return s};if(this._sourceIds.length>1){let s=0,u=r(s);for(;s!==u;){let f=s;const g=s;for(;f!==u;){const v=this._activeRegions[f];v.hiddenByOverlap=!1;for(let x=0;x<g;x++){const w=this._activeRegions[x];if(!w.hiddenByOverlap&&v.order===yv&&aA(v,w)&&(v.hiddenByOverlap=uO(v.footprint,v.tileId,w.footprint,w.tileId),v.hiddenByOverlap))break}++f}s=u,u=r(s)}}}}_setSources(l){[this._prevRegions,this._activeRegions]=[this._activeRegions,[]],this._sourceIds=[];for(let r=l.length-1;r>=0;r--)this._addSource(l[r]);this._computeReplacement()}},y.eK=Pd,y.eL=MS,y.eM=Dc,y.eN=yv,y.eO=class{constructor(l){this._createGrid(l),this._createPoles(l)}destroy(){this._poleIndexBuffer.destroy(),this._gridBuffer.destroy(),this._gridIndexBuffer.destroy(),this._poleNorthVertexBuffer.destroy(),this._poleSouthVertexBuffer.destroy();for(const l of this._poleSegments)l.destroy();for(const l of this._gridSegments)l.withSkirts.destroy(),l.withoutSkirts.destroy()}_fillGridMeshWithLods(l,r){const s=new Ha,u=new _i,f=[],g=l+1+2,v=r[0]+1,x=r[0]+1+(1+r.length),w=(A,R,M)=>
24{let O=A===g-1?A-2:A===0?A:A-1;return O+=M?24575:0,[O,R]};for(let A=0;A<g;++A)s.emplaceBack(...w(A,0,!0));for(let A=0;A<v;++A)for(let R=0;R<g;++R)s.emplaceBack(...w(R,A,(R===0||R===g-1)&&!0));for(let A=0;A<r.length;++A){const R=r[A];for(let M=0;M<g;++M)s.emplaceBack(...w(M,R,!0))}for(let A=0;A<r.length;++A){const R=u.length,M=r[A]+1+2,O=new _i;for(let G=0;G<M-1;G++){const H=G===M-2,J=H?g*(x-r.length+A-G):g;for(let re=0;re<g-1;re++){const Q=G*g+re;G===0||H||re===0||re===g-2?(O.emplaceBack(Q+1,Q,Q+J),O.emplaceBack(Q+J,Q+J+1,Q+1)):(u.emplaceBack(Q+1,Q,Q+J),u.emplaceBack(Q+J,Q+J+1,Q+1))}}const B=Wr.simpleSegment(0,R,s.length,u.length-R);for(let G=0;G<O.uint16.length;G+=3)u.emplaceBack(O.uint16[G],O.uint16[G+1],O.uint16[G+2]);const N=Wr.simpleSegment(0,R,s.length,u.length-R);f.push({withoutSkirts:B,withSkirts:N})}return{vertices:s,indices:u,segments:f}}_createGrid(l){const r=this._fillGridMeshWithLods(lf,e_);this._gridSegments=r.segments,this._gridBuffer=l.createVertexBuffer(r.vertices,$e.members),this._gridIndexBuffer=l.createIndexBuffer(r.
24indices,!0)}_createPoles(l){const r=new _i;for(let v=0;v<=lf;v++)r.emplaceBack(0,v+1,v+2);this._poleIndexBuffer=l.createIndexBuffer(r,!0);const s=new Rd,u=new Rd,f=new Rd,g=new Rd;this._poleSegments=[];for(let v=0,x=0;v<6;v++){const w=360/(1<<v);s.emplaceBack(0,-as,0,.5,0),u.emplaceBack(0,-as,0,.5,1),f.emplaceBack(0,-as,0,.5,.5),g.emplaceBack(0,-as,0,.5,.5);for(let A=0;A<=lf;A++){let R=A/lf,M=0;const O=Sn(0,w,R),[B,N,G]=Mu(Xn,Nr,O,as);s.emplaceBack(B,N,G,R,M),u.emplaceBack(B,N,G,R,1-M);const H=ae(O);R=.5+.5*Math.sin(H),M=.5+.5*Math.cos(H),f.emplaceBack(B,N,G,R,M),g.emplaceBack(B,N,G,R,1-M)}this._poleSegments.push(Wr.simpleSegment(x,0,66,64)),x+=66}this._poleNorthVertexBuffer=l.createVertexBuffer(s,Ue,!1),this._poleSouthVertexBuffer=l.createVertexBuffer(u,Ue,!1),this._texturedPoleNorthVertexBuffer=l.createVertexBuffer(f,Ue,!1),this._texturedPoleSouthVertexBuffer=l.createVertexBuffer(g,Ue,!1)}getGridBuffers(l,r){return[this._gridBuffer,this._gridIndexBuffer,r?this._gridSegments[l].withSkirts:this._gridSegments[l].withoutSkirts]}getPoleBuffers(l,r){return[r?this._texturedPoleNorthVertexBuffer:this._poleNorthVertexBuffer,r?this._texturedPoleSouthVertexBuffer:this._poleSouthVertexBuffer,this._poleIndexBuffer,this._poleSegments[l]]}},y.eP=oH,y.eQ=Oe,y.eR=function(){return!!document.fullscreenElement||!!document.webkitFullscreenElement},y.eS=Je,y.eT=Rw,y.eU=function(l,r,s){return l[0]=r[0]/s[0],l[1]=r[1]/s[1],l[2]=r[2]/s[2],l},y.eV=Rt,y.eW=ec,y.eX=yn,y.eY=en,y.eZ=function([l,r,s]){const u=Math.hypot(l,r,s),f=Math.atan2(l,s),g=.5*Math.PI-Math.acos(-r/u);return new wr(ge(f),ge(g))},y.e_=Lt,y.ea=Jn,y.eb=rf,y.ec=256,y.ed=function(l){return l>>>=0,l=Math.imul(2747636419^l,2654435769)>>>0,l=Math.imul(l^l>>>16,2654435769)>>>0,(l=Math.imul(l^l>>>16,2654435769)>>>0)/4294967296},y.ee=Ru,y.ef=d0,y.eg=Dd,y.eh=Wa,y.ei=zs,y.ej=fq,y.ek=dn,y.el=or,y.em=Ta,y.en=function(l,r){var s=Math.sin(r),u=Math.cos(r);return l[0]=u,l[1]=0,l[2]=-s,l[3]=0,l[4]=0,l[5]=1,l[6]=0,l[7]=0,l[8]=s,l[9]=0,l[10]=u,l[11]=0,l[12]=0,l[13]=0,l[14]=0,l[15]=1,l},y.eo=function(l,r){var s=Math.sin(r),u=Math.cos(r);return l[0]=1,l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=u,l[6]=s,l[7]=0,l[8]=0,l[9]=-s,l[10]=u,l[11]=0,l[12]=0,l[13]=0,l[14]=0,l[15]=1,l},y.ep=function(l,r){return l[0]=r[0],l[1]=r[1],l[2]=r[2],l[3]=r[4],l[4]=r[5],l[5]=r[6],l[6]=r[8],l[7]=r[9],l[8]=r[10],l},y.eq=Rd,y.er=W0,y.es=function(l,r,s,u,f){return Ee((l-r)/(s-r)*(f-u)+u,u,f)},y.et=Sr,y.eu=function(l,r){var s=r[0],u=r[1],f=r[2],g=r[3],v=r[4],x=r[5],w=r[6],A=r[7],R=r[8],M=R*v-x*A,O=-R*g+x*w,B=A*g-v*w,N=s*M+u*O+f*B;return N?(l[0]=M*(N=1/N),l[1]=(-R*u+f*A)*N,l[2]=(x*u-f*v)*N,l[3]=O*N,l[4]=(R*s-f*w)*N,l[5]=(-x*s+f*g)*N,l[6]=B*N,l[7]=(-A*s+u*w)*N,l[8]=(v*s-u*g)*N,l):null},y.ev=2,y.ew=Cn,y.ex=Hn,y.ey=pt,y.ez=function(l,r){var s=new C(3);pt(s,r);var u=1/s[0],f=1/s[1],g=1/s[2],v=r[0]*u,x=r[1]*f,w=r[2]*g,A=r[4]*u,R=r[5]*f,M=r[6]*g,O=r[8]*u,B=r[9]*f,N=r[10]*g,G=v+R+N,H=0;return G>0?(H=2*Math.sqrt(G+1),l[3]=.25*H,l[0]=(M-B)/H,l[1]=(O-w)/H,l[2]=(x-A)/H):v>R&&v>N?(H=2*Math.sqrt(1+v-R-N),l[3]=(M-B)/H,l[0]=.25*H,l[1]=(x+A)/H,l[2]=(O+w)/H):R>N?(H=2*Math.sqrt(1+R-v-N),l[3]=(O-w)/H,l[0]=(x+A)/H,l[1]=.25*H,l[2]=(M+B)/H):(H=2*Math.sqrt(1+N-v-R),l[3]=(x-A)/H,l[0]=(O+w)/H,l[1]=(M+B)/H,l[2]=.25*H),l},y.f=_u,y.f0=function(l){const r=l.navigator?l.navigator.userAgent:null;return!!(function(s){if(Qr==null){const u=s.navigator?s.navigator.userAgent:null;Qr=!!s.safari||!(!u||!(Ge.test(u)||u.match("Safari")&&!u.match("Chrome")))}return Qr})(l)&&!(!r||!(r.match("Version/15.4")||r.match("Version/15.5")||r.match(ie)))},y.f1=function(l,r){o1=l,s1=r},y.f2=yr,y.f3=zr,y.f4=function(l){const r=[0,0,0],s=$(new Float64Array(16));return X(s,l.pixelMatrix,l.globeMatrix),mt(r,r,s),new St(r[0],r[1])},y.f5=function(l,r){if(!l||!r)throw new Error("TileProvider name and URL are required");Xr.TILE_PROVIDER_URLS[l]=Qs.resolveURL(r)},y.f6=k0,y.f7=function(l,r,s=!1){if(As===ra.deferred||As===ra.loading||As===ra.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");_l=Qs.resolveURL(l),As=ra.deferred,Cu=r,Qh(),s||cw()},y.f8=hd,y.f9=dd,y.fA=gS,y.fB=iv,y.fC=function(l){return l<=1?1:Math.pow(2,Math.floor(Math.log2(l)))},y.fD=NS,y.fE=Ou,y.fF=function(l){let r=0;
24if(new Uint32Array(l,0,1)[0]!==$O){const s=new Uint32Array(l,0,7),[,,u,f,g,v]=s;r=s.byteLength+f+g+v+g,(u!==l.byteLength||r>=l.byteLength)&&On("Invalid b3dm header information.")}return WO(l,r)},y.fG=function(l,r){const s=l.json.extensionsUsed&&l.json.extensionsUsed.includes("mbx_bvh"),u=EA(l);for(const f of u){if(!s)for(const g of f.meshes)FH(g);f.lights&&(f.lightMeshIndex=f.meshes.length,f.meshes.push(BH(f.lights,r)))}return u},y.fH=BS,y.fI=Pr,y.fJ=yl,y.fK=ra,y.fL=function(l){Km(),Ec?.then(r=>{r.keys().then(s=>{for(let u=0;u<s.length-l;u++)r.delete(s[u]).catch(f=>On(f.message))}).catch(s=>On(s.message))}).catch(r=>On(r.message))},y.fa=gu,y.fb=function(l){const r=dp();if(!r)return;const s=r.delete(i1);l&&s.then(()=>l()).catch(l)},y.fc=Kt,y.fd=cs,y.fe=2,y.ff=dg,y.fg=im,y.fh=Md,y.fi=BF,y.fj=zF,y.fk=dD,y.fl=Bd,y.fm="hd_road_elevation",y.fn=p,y.fo=ht,y.fp=qw,y.fq=Nd,y.fr=VA,y.fs=1,y.ft=rc,y.fu=function(l,r,s,u,f,g,v,x=1,w,A,R,M){l.createArrays(),l.tilePixelRatio=Bt/(512*l.overscaling),l.compareText={},l.iconsNeedLinear=!1;const O=l.layers[0].layout,B=l.layers[0]._unevaluatedLayout._values,N={};N.scaleFactor=x,N.textSizeScaleRange=O.get("text-size-scale-range"),N.iconSizeScaleRange=O.get("icon-size-scale-range");const[G,H]=N.textSizeScaleRange,[J,re]=N.iconSizeScaleRange;N.textScaleFactor=Ee(N.scaleFactor,G,H),N.iconScaleFactor=Ee(N.scaleFactor,J,re);const Q=B["text-size"],le=B["icon-size"];if(l.textSizeData.kind==="composite"){const{minZoom:_e,maxZoom:we}=l.textSizeData;N.compositeTextSizes=[Q.possiblyEvaluate(new Tr(_e,{worldview:R}),g),Q.possiblyEvaluate(new Tr(we,{worldview:R}),g)]}if(l.iconSizeData.kind==="composite"){const{minZoom:_e,maxZoom:we}=l.iconSizeData;N.compositeIconSizes=[le.possiblyEvaluate(new Tr(_e,{worldview:R}),g,M),le.possiblyEvaluate(new Tr(we,{worldview:R}),g,M)]}N.layoutTextSize=Q.possiblyEvaluate(new Tr(v+1,{worldview:R}),g),N.layoutIconSize=le.possiblyEvaluate(new Tr(v+1,{worldview:R}),g,M),N.textMaxSize=Q.possiblyEvaluate(new Tr(18,{worldview:R}),g);const ue=O.get("symbol-placement"),he=O.get("text-rotation-alignment")==="map"&&ue!=="point",Te=O.get("text-size");let me=!1;const xe=[];for(const _e of l.features){const we=O.get("text-font").evaluate(_e,{},g).join(","),je=Te.evaluate(_e,{},g)*N.textScaleFactor,He=N.layoutTextSize.evaluate(_e,{},g)*N.textScaleFactor,Qe=N.layoutIconSize.evaluate(_e,{},g,M)*N.iconScaleFactor,it={horizontal:{},vertical:void 0},nt=_e.text;let bt,Ze=[0,0];if(nt){const Zn=nt.toString(),Pi=O.get("text-letter-spacing").evaluate(_e,{},g)*Eo,Cr=O.get("text-line-height").evaluate(_e,{},g)*Eo,gr=iw(Zn)?Pi:0,jr=O.get("text-anchor").evaluate(_e,{},g),mi=O.get("text-variable-anchor");if(!mi){const Ki=O.get("text-radial-offset").evaluate(_e,{},g);if(Ki)Ze=YD(jr,[Ki*Eo,HA]);else{const so=O.get("text-offset").evaluate(_e,{},g);Ze=[so[0]*Eo,so[1]*Eo]}}let Co=he?"center":O.get("text-justify").evaluate(_e,{},g);const Yr=ue==="point",Ri=Yr?O.get("text-max-width").evaluate(_e,{},g)*Eo:1/0,oo=Ki=>{l.allowVerticalPlacement&&I0(Zn)&&(it.vertical=LA(nt,r,s,f,we,Ri,Cr,jr,Ki,gr,Ze,ka.vertical,!0,He,je,w,N.textScaleFactor))};if(!he&&mi){const Ki=Co==="auto"?mi.map(Qn=>WA(Qn)):[Co];let so=!1;for(let Qn=0;Qn<Ki.length;Qn++){const Ko=Ki[Qn];if(!it.horizontal[Ko])if(so)it.horizontal[Ko]=it.horizontal[0];else{const Ms=LA(nt,r,s,f,we,Ri,Cr,"center",Ko,gr,Ze,ka.horizontal,!1,He,je,w,N.textScaleFactor);Ms&&(it.horizontal[Ko]=Ms,so=Ms.positionedLines.length===1)}}oo("left")}else{if(Co==="auto"&&(Co=WA(jr)),Yr||O.get("text-writing-mode").includes("horizontal")||!I0(Zn)){const Ki=LA(nt,r,s,f,we,Ri,Cr,jr,Co,gr,Ze,ka.horizontal,!1,He,je,w,N.textScaleFactor);Ki&&(it.horizontal[Co]=Ki)}oo(Yr?"left":Co)}}let et,ot,ft,_t,Ft,ut,At=!1;const It=O.get("icon-text-fit").evaluate(_e,{},g);if(_e.icon&&_e.icon.hasPrimary()){const Zn=Mv(_e.icon,l.iconSizeData,B["icon-size"],g,l.zoom,_e,w,N.iconScaleFactor,R,M);et=Zn.iconPrimary,ft=Zn.iconSecondary;const Pi=et.toString();if(ot=u.get(Pi),ot&&(Ft=O.get("icon-offset").evaluate(_e,{},g),ut=O.get("icon-anchor").evaluate(_e,{},g),bt=vS(f.get(Pi),ft?f.get(ft.toString()):void 0,Ft,ut),At=ot.sdf,l.sdfIcons===void 0?l.sdfIcons=ot.sdf:l.sdfIcons!==ot.sdf&&On("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(ot.pixelRatio!==l.pixelRatio||O.get("icon-rotate").constantOr(1)!==0)&&(l.iconsNeedLinear=!0)),ft){const Cr=ft.toString();_t=u.get(Cr)}}me=me||!(!_e.icon||!_e.icon.hasSecondary());const Xt=CS(it.horizontal)||it.vertical;l.iconsInText||(l.iconsInText=!!Xt&&Xt.iconsInText);const Yt=He*N.textScaleFactor/Eo,{defaultShapedIcon:gn,verticallyShapedIcon:on}=JW(l,bt,O,_e,g,it,Yt,Ft,It);It!=="none"&&bt&&(MD(bt)||LD(bt))&&(ES(0,ot,et,bt,gn,It,A,u,f),ES(0,_t,ft,bt,gn,It,A,u,f),on&&(ES(0,ot,et,bt,on,It,A,u,f),ES(0,_t,ft,bt,on,It,A,u,f))),bt=gn;const{iconBBox:En,iconVerticalBBox:_r,textBBox:Nn,textVerticalBBox:sr}=qW(l,bt,on,O,_e,g,Qe,Ft,N,f,ut,it,He,Ze,M);xe.push({feature:_e,shapedTextOrientations:it,shapedText:Xt,shapedIcon:bt,iconPrimary:et,iconSecondary:ft,iconOffset:Ft,iconA
24nchor:ut,verticallyShapedIcon:on,layoutTextSize:He,layoutIconSize:Qe,textOffset:Ze,isSDFIcon:At,iconTextFit:It,iconCollisionBounds:En,iconVerticalCollisionBounds:_r,textCollisionBounds:Nn,textVerticalCollisionBounds:sr})}return{featureData:xe,sizes:N,hasAnySecondaryIcon:me,textAlongLine:he,symbolPlacement:ue}},y.fv=UA,y.fw=NA,y.fx=$D,y.fy=jD,y.fz=function(l,r,s,u,f,g,v,x,w,A){l.iconAtlasPositions=A.iconPositions;const{featureData:R,hasAnySecondaryIcon:M,sizes:O,textAlongLine:B,symbolPlacement:N}=r;for(const G of R){const{shapedIcon:H,verticallyShapedIcon:J,feature:re,shapedTextOrientations:Q,shapedText:le,layoutTextSize:ue,textOffset:he,isSDFIcon:Te,iconPrimary:me,iconSecondary:xe,iconTextFit:_e,iconOffset:we,iconCollisionBounds:je,iconVerticalCollisionBounds:He,textCollisionBounds:Qe}=G;eF(H,A.iconPositions,me,xe),eF(J,A.iconPositions,me,xe),KW(Q,A.iconPositions),YW(me,xe,A.iconPositions),(le||H)&&QW(l,re,Q,H,J,w,O,ue,0,he,Te,u,f,v,x,M,_e,we,B,N,je,He,Qe)}s&&l.generateCollisionDebugBuffers(g,l.collisionBoxArray,O.textScaleFactor)},y.g=Xr,y.h=function(l,r){return fp(Object.assign(l,{method:"GET"}),r)},y.i=function(l){return Xr.API_STYLE_REGEX.test(l)&&!Ch(l)},y.j=function(l){return btoa(encodeURIComponent(l).replace(/%([0-9A-F]{2})/g,(r,s)=>String.fromCharCode(+("0x"+s))))},y.k=Dy,y.l=function(l){return decodeURIComponent(atob(l).split("").map(r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)).join(""))},y.m=Ny,y.n=Vy,y.o=Qs,y.p=function(l,r){return fp(Object.assign(l,{method:"POST"}),r)},y.q=vr,y.r=Ul,y.s=function(l){try{const r=self[l];return r.setItem("_mapbox_test_",1),r.removeItem("_mapbox_test_"),!0}catch{return!1}},y.t=D0,y.u=function(){return(function l(r){return r?(r^Math.random()*(16>>r/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,l)})()},y.v=function(l){return!!l&&mu.test(l)},y.w=On,y.x=class{constructor(l){this.cache=new Map,this.textures=new Map,this.textureAccessTimes=new Map,this.textureMemoryUsed=0,this.maxTextureMemory=1024*(l&&l.maxTextureMemoryMB?l.maxTextureMemoryMB:256)*1024,this.finalizationRegistry=new FinalizationRegistry(r=>{this.cache.delete(r),this.clearExpiredTextures()})}calculateTextureMemory(l){return l.image?Math.ceil(l.image.width*l.image.height*4*(l.patternPositions.size>0?1.33:1)):0}evictTexture(l){const r=this.textures.get(l);if(r){const s=this.calculateTextureMemory(l);r.destroy(),this.textures.delete(l),this.textureAccessTimes.delete(l),this.textureMemoryUsed-=s,l.uploaded=!1}}evictTexturesIfNeeded(l){for(;this.textureMemoryUsed+l>this.maxTextureMemory&&this.textures.size>0;){let r=null,s=1/0;for(const[u]of this.textures.entries()){const f=this.textureAccessTimes.get(u)||0;f<s&&(s=f,r=u)}if(!r)break;this.evictTexture(r)}}findCachedAtlas(l){const r=this.cache.get(l.hash);if(r){const s=r.deref();if(s&&s.contentDescriptor&&this.isMipmapCompatible(l,s.contentDescriptor))return s}for(const[,s]of this.cache.entries()){const u=s.deref();if(u&&u.contentDescriptor){const f=l.subsetOf(u.contentDescriptor),g=this.isMipmapCompatible(l,u.contentDescriptor);if(f&&g)return u}}}getTextureForAtlas(l,r,s){this.textureAccessTimes.set(l,performance.now());let u=this.textures.get(l);if(u)return u;if(l.image){const f=this.calculateTextureMemory(l);return this.evictTexturesIfNeeded(f),u=new zu(r,l.image,s,{useMipmap:!!l.patternPositions.size}),this.textures.set(l,u),this.textureMemoryUsed+=f,u}return null}clearExpiredTextures(){for(const[l]of this.textures.entries())if(!this.isAtlasCached(l)){const r=this.textures.get(l);if(r){const s=this.calculateTextureMemory(l);r.destroy(),this.textureMemoryUsed-=s}this.textures.delete(l),this.textureAccessTimes.delete(l)}}isAtlasCached(l){if(!l.contentDescriptor)return!1;const r=this.cache.get(l.contentDescriptor.hash);return!!r&&r.deref()===l}getOrCache(l){if(!("image"in l)){const f=this.cache.get(l.sourceAtlasHash);if(f){const g=f.deref();if(g)return g}return On("ImageAtlasReference points to GC'd atlas - atlas may have been evicted"),null}if(!l.contentDescriptor)return l;const r=l.contentDescriptor,s=r.hash,u=this.cache.get(s);if(u){const f=u.deref();if(f&&f.contentDescriptor&&this.isMipmapCompatible(r,f.contentDescriptor))return f}return this.cache.set(s,new WeakRef(l)),this.finalizationRegistry.register(l,s,l),l}isMipmapCompatible(l,r){return!l.requiresMipMaps||r.requiresMipMaps}destroyTextures(){for(const l of this.textures.values())l&&l.destroy();this.textures.clear(),this.textureAccessTimes.clear(),this.textureMemoryUsed=0}clear(){for(const l of this.textures.values())l&&l.destroy();this.cache.clear(),this.textures.clear(),this.textureAccessTimes.clear(),this.textureMemoryUsed=0}},y.y=kh,y.z=fl}),h(["require","./shared"],function(a,y){function E(Ge){const ie=Ge?Ge.url.toString():void 0;return ie?performance.getEntriesByName(ie):[]}function C(Ge){if(typeof Ge=="number"||typeof Ge=="boolean"||typeof Ge=="string"||Ge==null)return JSON.stringify(Ge);if(Array.isArray(Ge)){let ae="[";for(const ge of Ge)ae+=`${C(ge)},`;return`${ae}]`}let ie="{";for(const ae of Object.keys(Ge).sort())ie+=`${ae}:${C(Ge[ae])},`;return`${ie}}`}function P(Ge){let ie="";for(const ae of y.b8)ie+=`/${C(Ge[ae])}`;return ie}function L(Ge,ie){return(function ae(ge){return typeof ge=="string"&&ge===ie||(Array.isArray(ge)?ge.some(ae):!(!ge||typeof ge!="object")&&Object.values(ge).some(ae))})(Ge)}class D{constructor(ie){this.keyCache=Object.create(null),this._layers=Object.create(null),this._layerConfigs=Object.create(null),ie&&this.replace(ie)}replace(ie,ae){this._layerConfigs=Object.create(null),this._layers=Object.create(null),this.update(ie,[],ae)}update(ie,ae,ge){this._options=ge;for(const Me of ie)this._layerConfigs[Me.id]=Me,(this._layers[Me.id]=y.dh(Me,this.scope,null,this._options)).compileFilter(ge),this.keyCache[Me.id]&&delete this.keyCache[Me.id];for(const Me of ae)delete this.keyCache[Me],delete this._layerConfigs[Me],delete this._layers[Me];this.familiesBySource=Object.create(null);const Pe=(function(Me,Oe){const Je=Object.create(null);for(let We=0;We<Me.length;We++){const Et=Me[We];let vt=Oe&&Oe[Et.id];
24vt||(Et.type==="symbol"?vt=Et.id:(vt=P(Et),Et.type==="line"&&Et.paint&&L(Et.paint["line-width"],"line-progress")&&(vt+=`/${C(Et.paint["line-width"])}`))),Oe&&(Oe[Et.id]=vt);let Le=Je[vt];Le||(Le=Je[vt]=[]),Le.push(Et)}const Ee=[];for(const We in Je)Ee.push(Je[We]);return Ee})(Object.values(this._layerConfigs),this.keyCache);for(const Me of Pe){const Oe=Me.map(Le=>this._layers[Le.id]),Je=Oe[0];if(Je.visibility==="none")continue;const Ee=Je.source||"";let We=this.familiesBySource[Ee];We||(We=this.familiesBySource[Ee]=Object.create(null));const Et=Je.sourceLayer||"_geojsonTileLayer";let vt=We[Et];vt||(vt=We[Et]=[]),vt.push(Oe)}}}const V=1*y.fe;class U{constructor(ie){const ae={},ge=[];for(const Je in ie){const Ee=ie[Je],We=ae[Je]={};for(const Et in Ee.glyphs){const vt=Ee.glyphs[+Et];if(!vt||vt.bitmap.width===0||vt.bitmap.height===0)continue;const Le=vt.metrics.localGlyph?V:1,yt={x:0,y:0,w:vt.bitmap.width+2*Le,h:vt.bitmap.height+2*Le};ge.push(yt),We[Et]=yt}}const{w:Pe,h:Me}=y.F(ge),Oe=new y.fd({width:Pe||1,height:Me||1});for(const Je in ie){const Ee=ie[Je];for(const We in Ee.glyphs){const Et=Ee.glyphs[+We];if(!Et||Et.bitmap.width===0||Et.bitmap.height===0)continue;const vt=ae[Je][We],Le=Et.metrics.localGlyph?V:1;y.fd.copy(Et.bitmap,Oe,{x:0,y:0},{x:vt.x+Le,y:vt.y+Le},Et.bitmap)}}this.image=Oe,this.positions=ae}}function W(Ge,ie,ae){Ge[ie]?ae&&(Ge[ie].center=ae):Ge[ie]={floorIds:new Set,center:ae||[0,0],floors:{}}}function $(Ge,ie,ae,ge){for(const Pe of ie)W(Ge,Pe),Ge[Pe].floors[ae]=ge,Ge[Pe].floorIds.add(ae)}function Y(Ge){return{id:Ge.properties.id.toString(),center:[Ge.properties.center_lon||0,Ge.properties.center_lat||0]}}function X(Ge,ie){const ae=Ge.properties.id.toString(),ge=!!Ge.properties.is_default&&Ge.properties.is_default,Pe=Ge.properties.connected_floor_ids?new Set(Ge.properties.connected_floor_ids.toString().split(";")):new Set,Me=Ge.properties.conflicted_floor_ids?new Set(Ge.properties.conflicted_floor_ids.toString().split(";")):new Set,Oe=Ge.properties.structure_ids?new Set(Ge.properties.structure_ids.toString().split(";")):new Set,Je=Ge.properties.name.toString(),Ee=Ge.properties.z_index,We=(function(Et,vt){const Le=Et.loadGeometry();if(!Le||Le.length===0)return;const yt=Le.map(Ot=>Ot.map(qt=>y.ff(qt,vt,Et.extent)));return yt.length===0?void 0:{type:"Polygon",coordinates:[yt[0]]}})(Ge,ie);return{id:ae,isDefault:ge,connections:Pe,conflicts:Me,buildings:Oe,name:Je,zIndex:Ee,geometry:We}}function K(Ge,ie){return ie.every(ae=>Ge.properties&&Ge.properties[ae]!=null)}function ne(Ge){return K(Ge,["type","id","name"])&&Ge.properties.type==="structure"}function fe(Ge){return K(Ge,["type","id","name","z_index"])&&Ge.properties.type==="floor"}y.fc(U,"GlyphAtlas");class ye{constructor(ie){this.tileID=new y.aU(ie.tileID.overscaledZ,ie.tileID.wrap,ie.tileID.canonical.z,ie.tileID.canonical.x,ie.tileID.canonical.y),this.tileZoom=ie.tileZoom,this.uid=ie.uid,this.zoom=ie.zoom,this.lut=ie.lut,this.canonical=ie.tileID.canonical,this.pixelRatio=ie.pixelRatio,this.tileSize=ie.tileSize,this.source=ie.source,this.scope=ie.scope,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=ie.showCollisionBoxes,this.showElevationIdDebug=ie.showElevationIdDebug,this.collectResourceTiming=!!ie.request&&ie.request.collectResourceTiming,this.promoteId=ie.promoteId,this.renderSourceType=ie.renderSourceType,this.tileTransform=y.fg(ie.tileID.canonical,ie.projection),this.projection=ie.projection,this.worldview=ie.worldview,this.localizableLayerIds=ie.localizableLayerIds,this.brightness=ie.brightness,this.extraShadowCaster=!!ie.extraShadowCaster,this.tessellationStep=ie.tessellationStep,this.scaleFactor=ie.scaleFactor,this.worldview=ie.worldview,this.indoor=ie.indoor}parse(ie,ae,ge,Pe,Me,Oe){this.status="parsing",this.data=ie,this.collisionBoxArray=new y.fh;const Je=new y.fi(Object.keys(ie.layers).sort()),Ee=new y.fj(this.tileID,this.promoteId);Ee.bucketLayerIDs=[];const We={},Et=new y.fk(256,256),vt={featureIndex:Ee,iconDependencies:new Map,patternDependencies:new Map,glyphDependencies:{},lineAtlas:Et,availableImages:ge,brightness:this.brightness,scaleFactor:this.scaleFactor,showElevationIdDebug:this.showElevationIdDebug,elevationFeatures:void 0,activeFloors:void 0};this.indoor&&(vt.activeFloors=(function(qt,cn,ht,ln){const Kn=cn.indoorState.activeFloorsVisible;if(!cn.sourceLayers)return Kn?cn.indoorState.activeFloors:void 0;const Hr=(function(br,si){if(!br)return y.w("No source layers defined in indoor specification"),si;if(br.size===0)return si;const bi=br.difference(si);for(const Pr of bi)y.w(`Missing source layer required in indoor specification: ${Pr}`);return si.intersection(si)}
24)(cn.sourceLayers,new Set(Object.keys(qt.layers))),ti=cn.indoorState,On=(function(br,si,bi,Pr,ni){const xi={};for(const Qr of si){const Xi=br.layers[Qr];if(Xi)for(let Xo=0;Xo<Xi.length;Xo++){const So=Xi.feature(Xo);if(ne(So)){const{id:ho,center:Vl}=Y(So);W(xi,ho,Vl);continue}if(fe(So)){const ho=X(So,ni);$(xi,ho.buildings,ho.id,ho)}}else y.w(`indoor source layer not found: ${Qr}`)}return{buildings:xi,activeFloors:y.d3.calculate(xi,Pr,bi)}})(qt,Hr,ti.activeFloors,ti.selectedFloorId,ln);return ht.send("setIndoorData",On),Kn?On.activeFloors:void 0})(ie,this.indoor,Me,this.canonical));const Le=[],yt=ae.familiesBySource[this.source];for(const qt in yt){const cn=ie.layers[qt];if(!cn)continue;let ht=!1,ln=!1,Kn=!1,Hr=!1;for(const bi of yt[qt])bi[0].type==="symbol"?ht=!0:bi[0].type==="fill-extrusion"?ln=!0:Kn=!0,bi[0].is3D()&&bi[0].type!=="model"&&(Hr=!0);if(this.extraShadowCaster&&!Hr||this.renderSourceType===y.b7.Symbol&&!ht||this.renderSourceType===y.b7.FillExtrusion&&!ln||this.renderSourceType===y.b7.Other&&!Kn)continue;cn.version===1&&y.w(`Vector tile source "${this.source}" layer "${qt}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const ti=Je.encode(qt),On=[],br=this.localizableLayerIds&&this.localizableLayerIds.has(qt);let si=!1;for(let bi=0,Pr=0;bi<cn.length;bi++){const ni=cn.feature(bi),xi=Ee.getId(ni,qt),Qr=ni.properties?ni.properties.worldview:null;if(br&&this.worldview&&typeof Qr=="string")if(Qr==="all")ni.properties.$localized=!0;else{if(!Qr.split(",").includes(this.worldview))continue;ni.properties.$localized=!0,ni.properties.worldview=this.worldview}!si&&ni.properties&&Object.hasOwn(ni.properties,y.fl)&&(si=!0),On.push({feature:ni,id:xi,index:Pr,sourceLayerIndex:ti}),Pr++}si&&!vt.elevationFeatures&&Object.hasOwn(ie.layers,y.fm)&&(vt.elevationFeatures=y.fn.parseFrom(ie.layers[y.fm],this.canonical));for(const bi of yt[qt]){const Pr=bi[0];if(this.extraShadowCaster&&(!Pr.is3D()||Pr.type==="model")||this.renderSourceType===y.b7.Symbol&&Pr.type!=="symbol"||this.renderSourceType===y.b7.FillExtrusion&&Pr.type!=="fill-extrusion"||this.renderSourceType===y.b7.Other&&(Pr.type==="symbol"||Pr.type==="fill-extrusion")||Pr.minzoom&&this.zoom<Math.floor(Pr.minzoom)||Pr.maxzoom&&this.zoom>=Pr.maxzoom||Pr.visibility==="none")continue;ke(bi,this.zoom,vt.brightness,ge,this.worldview,vt.activeFloors);const ni=()=>{const xi=We[Pr.id]=Pr.createBucket({index:Ee.bucketLayerIDs.length,layers:bi,zoom:this.zoom,lut:this.lut,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:ti,sourceID:this.source,projection:this.projection.spec,tessellationStep:this.tessellationStep,styleDefinedModelURLs:Pe,worldview:this.worldview,localizable:br,availableImages:ge,maxUniformBufferBindings:this.maxUniformBufferBindings,maxUniformBlockSizeDwords:this.maxUniformBlockSizeDwords,disableSymbolUBO:this.disableSymbolUBO});Ee.bucketLayerIDs.push(bi.map(Qr=>y.t(Qr.id,Qr.scope))),xi.populate(On,vt,this.tileID.canonical,this.tileTransform)};if("prepare"in Pr){const xi=Pr.prepare().then(()=>ni());Le.push(xi)}else ni()}}const Ot=()=>{Et.trim();const qt=!(!vt.elevationFeatures||!vt.elevationFeatures.some(Pr=>Pr.heightRange.min<0));let cn,ht,ln,Kn,Hr,ti,On;const br={type:"maybePrepare",renderSourceType:this.renderSourceType,zoom:this.zoom},si=()=>{if(cn)return this.status="done",Oe(cn);if(this.extraShadowCaster)this.status="done",Oe(null,{buckets:Object.values(We).filter(Pr=>!Pr.isEmpty()),featureIndex:Ee,collisionBoxArray:null,hasTunnelGeometry:qt,glyphAtlasImage:null,lineAtlas:null,imageAtlas:null,brightness:vt.brightness,glyphMap:null,iconMap:null,glyphPositions:null});else if(ht&&ln&&Kn&&On){const ni=new U(ht),xi=new Map;for(const[Xi,Xo]of ln.entries()){const{imagePosition:So}=y.fr(Xi,Xo,y.fs);xi.set(Xi,So)}const Qr={};for(const Xi in We){const Xo=We[Xi];Xo instanceof y.ft&&(ke(Xo.layers,this.zoom,vt.brightness,ge,this.worldview,vt.activeFloors),Qr[Xi]=y.fu(Xo,ht,ni.positions,ln,xi,this.tileID.canonical,this.tileZoom,this.scaleFactor,this.pixelRatio,Hr,this.worldview,ge))}Hr.size||ti.size?this.rasterizeTask=Me.send("rasterizeImages",{scope:this.scope,iconTasks:Hr,patternTasks:ti},(Xi,Xo)=>
24{if(!Xi)for(const[So,ho]of Xo.entries())ln.has(So)&&ln.set(So,Object.assign(ln.get(So),{data:ho})),Kn.has(So)&&Kn.set(So,Object.assign(Kn.get(So),{data:ho}));bi(Qr,ni,void 0,On)}):bi(Qr,ni,void 0,On)}},bi=(Pr,ni,xi,Qr)=>{const Xi=ln.size>0||Kn.size>0,Xo=Object.keys(Pr).length>0;if(!Xi&&!Xo)return this.status="done",void Oe(null,{buckets:Object.values(We).filter(ho=>!ho.isEmpty()),featureIndex:Ee,collisionBoxArray:this.collisionBoxArray,hasTunnelGeometry:qt,glyphAtlasImage:ni.image,lineAtlas:Et,imageAtlas:null,brightness:vt.brightness});const So=(ho,Vl)=>{for(const hl in We){const Xr=We[hl];if(hl in Pr)y.fz(Xr,Pr[hl],this.showCollisionBoxes,ge,this.tileID.canonical,this.tileZoom,this.projection,this.brightness,ln,Vl);else if(Xr.hasPattern&&(Xr instanceof y.fA||Xr instanceof y.fp||Xr instanceof y.e3)){ke(Xr.layers,this.zoom,vt.brightness,ge,this.worldview,vt.activeFloors);const gu=Object.fromEntries(Vl.patternPositions);Xr.addFeatures(vt,this.tileID.canonical,gu,ge,this.tileTransform,this.brightness)}}this.status="done",Oe(null,{buckets:Object.values(We).filter(hl=>!hl.isEmpty()),featureIndex:Ee,collisionBoxArray:this.collisionBoxArray,hasTunnelGeometry:qt,glyphAtlasImage:ni.image,lineAtlas:Et,imageAtlas:ho,brightness:vt.brightness})};if(Xi){const ho=new Map,Vl=y.fv(ln,ho),hl=y.fv(Kn,ho),Xr=new y.fw(Vl,hl,Qr,this.lut,ho);Me.send("checkAtlasCache",{descriptor:Xr,scope:this.scope},(gu,dd)=>{let hd,_u;if(gu&&y.w(`[Worker] Error checking atlas cache: ${gu.message}`),dd)hd=new y.fx(dd.sourceHash),_u=dd;else{const Ch=new y.fy(ln,Kn,this.lut,Qr);hd=Ch,_u=Ch}So(hd,_u)})}else So(null,{iconPositions:new Map,patternPositions:new Map})};if(!this.extraShadowCaster){const Pr=y.fo(vt.glyphDependencies,Qr=>Object.keys(Qr).map(Number));Object.keys(Pr).length?Me.send("getGlyphs",{uid:this.uid,stacks:Pr},(Qr,Xi)=>{cn||(cn=Qr,ht=Xi,si())},void 0,!1,br):ht={},On=new Map;const ni=Array.from(vt.iconDependencies.keys()).map(Qr=>y.I.parse(Qr)),xi=Array.from(vt.patternDependencies.keys()).map(Qr=>y.I.parse(Qr));ni.length||xi.length?Me.send("getImages",{icons:ni,patterns:xi,source:this.source,scope:this.scope,tileID:this.tileID},(Qr,Xi)=>{if(!cn){cn=Qr,ln=new Map,Kn=new Map,Hr=this.updateImageMapAndGetImageTaskQueue(ln,Xi.images,vt.iconDependencies),ti=this.updateImageMapAndGetImageTaskQueue(Kn,Xi.images,vt.patternDependencies);for(const[Xo,So]of Xi.versions.entries())On.set(Xo,So);si()}},void 0,!1,br):(ln=new Map,Kn=new Map,Hr=new Map,ti=new Map)}if(vt.elevationFeatures&&vt.elevationFeatures.length>0){const Pr=[];for(const xi of Object.values(We))if(xi instanceof y.fp){const Qr=xi.getUnevaluatedPortalGraph();Qr&&Pr.push(Qr)}const ni=y.fq.evaluate(Pr);for(const xi of Object.values(We))if(xi instanceof y.fp){const Qr=ie.layers[Je.decode(xi.sourceLayerIndex)];xi.setEvaluatedPortalGraph(ni,Qr,this.tileID.canonical,vt.availableImages,vt.brightness)}}si()};Le.length>0?Promise.allSettled(Le).then(Ot).catch(Oe):Ot()}updateParameters(ie){this.scaleFactor=ie.scaleFactor,this.showCollisionBoxes=ie.showCollisionBoxes,this.showElevationIdDebug=ie.showElevationIdDebug,this.projection=ie.projection,this.brightness=ie.brightness,this.tileTransform=y.fg(ie.tileID.canonical,ie.projection),this.extraShadowCaster=ie.extraShadowCaster,this.lut=ie.lut,this.worldview=ie.worldview,this.indoor=ie.indoor}updateImageMapAndGetImageTaskQueue(ie,ae,ge){const Pe=new Map;for(const Me of ae.keys()){const Oe=ge.get(Me)||[];for(const Je of Oe){const Ee=Je.toString(),We=ae.get(Je.id.toString());We.usvg?Pe.has(Ee)||(Pe.set(Ee,Je),ie.set(Ee,Object.assign({},We))):ie.set(Ee,We)}}return Pe}cancelRasterize(){this.rasterizeTask&&this.rasterizeTask.cancel()}}function ke(Ge,ie,ae,ge,Pe,Me){const Oe=new y.ab(ie,{brightness:ae,worldview:Pe,activeFloors:Me});for(const Je of Ge)Je.recalculate(Oe,ge)}class Fe extends y.E{constructor({actor:ie,layerIndex:ae,availableImages:ge,availableModels:Pe,isSpriteLoaded:Me,tileProvider:Oe,brightness:Je,maxUniformBufferBindings:Ee,maxUniformBlockSizeDwords:We,disableSymbolUBO:Et}){super(),this.actor=ie,this.layerIndex=ae,this.availableImages=ge,this.availableModels=Pe,this.loadVectorData=y.aQ,this.tileProvider=Oe,this.loading={},this.loaded={},this.deduped=new y.aL(ie.scheduler),this.isSpriteLoaded=Me,this.scheduler
24=ie.scheduler,this.brightness=Je,this.maxUniformBufferBindings=Ee,this.maxUniformBlockSizeDwords=We,this.disableSymbolUBO=Et}loadTileData(ie,ae){if(!this.tileProvider)return this.loadVectorData(ie,ae);const ge=new AbortController;return this.loadTileWithProvider(this.tileProvider,ie,ge,ae),()=>ge.abort()}async loadTileWithProvider(ie,ae,ge,Pe){const{z:Me,x:Oe,y:Je}=ae.tileID.canonical;try{const Ee=await ie.loadTile({z:Me,x:Oe,y:Je},{request:ae.request,signal:ge.signal});if(ge.signal.aborted)return;if(Ee==null){const Et=new Error("Tile not found");return Et.status=404,Pe(Et)}if(Ee.data==null)return Pe(null,null);const We=new Map;Ee.expires&&We.set("expires",Ee.expires),Ee.cacheControl&&We.set("cache-control",Ee.cacheControl),Pe(null,{rawData:Ee.data,responseHeaders:We})}catch(Ee){if(ge.signal.aborted)return;Pe(Ee instanceof Error?Ee:new Error(String(Ee)))}}loadTile(ie,ae){const ge=ie.uid,Pe=ie&&ie.request,Me=Pe&&Pe.collectResourceTiming,Oe=this.loading[ge]=new ye(ie);Oe.maxUniformBufferBindings=this.maxUniformBufferBindings,Oe.maxUniformBlockSizeDwords=this.maxUniformBlockSizeDwords,Oe.disableSymbolUBO=this.disableSymbolUBO,Oe.abort=this.loadTileData(ie,(Je,Ee)=>{const We=!this.loading[ge];if(delete this.loading[ge],Oe.cancelRasterize(),We||Je||!Ee)return Oe.status="done",We||(this.loaded[ge]=Oe),ae(Je);const Et=Ee.rawData,vt={},Le=y.aR(Ee.responseHeaders);Le&&Le.expires&&(vt.expires=Le.expires),Le&&Le.cacheControl&&(vt.cacheControl=Le.cacheControl),Oe.vectorTile=Ee.vectorTile||new y.fB(new y.b2(Et));const yt=()=>{Oe.parse(Oe.vectorTile,this.layerIndex,this.availableImages,this.availableModels,this.actor,(Ot,qt)=>{if(Ot||!qt)return ae(Ot);const cn={};if(Me){const ht=E(Pe);ht.length>0&&(cn.resourceTiming=JSON.parse(JSON.stringify(ht)))}ae(null,Object.assign({rawTileData:Et.slice(0),responseHeaders:Ee.responseHeaders},qt,vt,cn))})};this.isSpriteLoaded?yt():this.once("isSpriteLoaded",()=>{this.scheduler?this.scheduler.add(yt,{type:"parseTile",renderSourceType:ie.renderSourceType,zoom:ie.tileZoom}):yt()}),this.loaded=this.loaded||{},this.loaded[ge]=Oe})}reloadTile(ie,ae){const ge=this.loaded,Pe=ie.uid;if(ge&&ge[Pe]){const Me=ge[Pe];Me.updateParameters(ie);const Oe=(Je,Ee)=>{const We=Me.reloadCallback;We&&(delete Me.reloadCallback,Me.parse(Me.vectorTile,this.layerIndex,this.availableImages,this.availableModels,this.actor,We)),ae(Je,Ee)};Me.status==="parsing"?Me.reloadCallback=Oe:Me.status==="done"&&(Me.vectorTile?Me.parse(Me.vectorTile,this.layerIndex,this.availableImages,this.availableModels,this.actor,Oe):Oe())}else ae(null,void 0)}abortTile(ie,ae){const ge=ie.uid,Pe=this.loading[ge];Pe&&(Pe.abort&&Pe.abort(),delete this.loading[ge]),ae()}removeTile(ie,ae){const ge=this.loaded,Pe=ie.uid;ge&&ge[Pe]&&delete ge[Pe],ae()}}class qe{constructor(ie){this.tileProvider=ie.tileProvider,this.loading={}}loadTile(ie,ae){const ge=ie.uid;if(this.tileProvider){const Me=new AbortController;return this.loading[ge]={cancel:()=>Me.abort()},void this.loadTileWithProvider(this.tileProvider,ge,ie,Me,ae)}const{cancel:Pe}=y.b4(ie.request,(Me,Oe,Je)=>{const Ee=!this.loading[ge];if(delete this.loading[ge],Ee||Me||!Oe)return ae(Me);this.decodeTile(ge,Oe,ie.encoding).then(We=>{const{expires:Et,cacheControl:vt}=y.aR(Je);ae(null,Object.assign(We,{expires:Et,cacheControl:vt}))}).catch(We=>ae(We))});this.loading[ge]={cancel:Pe}}async decodeTile(ie,ae,ge){const Pe=await createImageBitmap(new Blob([new Uint8Array(ae)],{type:"image/png"})),Me=1-(Pe.width-y.fC(Pe.width))/2,Oe=Me<1,Je=this.getImageData(Pe,Me);return Pe.close(),{dem:new y.fD(ie,Je,ge,Oe),borderReady:Oe}}async loadTileWithProvider(ie,ae,ge,Pe,Me){const{z:Oe,x:Je,y:Ee}=ge.tileID.canonical;try{const We=await ie.loadTile({z:Oe,x:Je,y:Ee},{request:ge.request,signal:Pe.signal});if(Pe.signal.aborted)return Me(null,null);if(We==null){const vt=new Error("Tile not found");return vt.status=404,Me(vt)}if(We.data==null)return Me(null,null);const Et=await this.decodeTile(ae,We.data,ge.encoding);if(Pe.signal.aborted)return Me(null,null);Me(null,Object.assign(Et,{expires:We.expires,cacheControl:We.cacheControl}))}catch(We){if(Pe.signal.aborted||We instanceof DOMException&&We.name==="AbortError")return Me(null,null);Me(We instanceof Error?We:new Error(String(We)))}finally{delete this.loading[ae]}}reloadTile(ie,ae){ae(null,null)}abortTile(ie,ae){const ge=ie.uid,Pe=this.loading[ge];Pe&&(Pe.cancel(),delete this.loading[ge]),ae()}removeTile(ie,ae){ae()}getImageData(ie,ae){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(ie.width,ie.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=ie.width,this.offscreenCanvas.height=ie.he
24ight,this.offscreenCanvasContext.drawImage(ie,0,0,ie.width,ie.height);const ge=this.offscreenCanvasContext.getImageData(-ae,-ae,ie.width+2*ae,ie.height+2*ae);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),ge}}y.b1.setPbf(y.b2);class lt{constructor(ie){this._mrt=new y.b1(ie.partial?30:1/0),this._isHeaderLoaded=!1,this.uid=ie.uid,this.tileID=ie.tileID,this.source=ie.source}parse(ie,ae){const ge=this._mrt;this.status="parsing",this._entireBuffer=ie;try{ge.parseHeader(ie),this._isHeaderLoaded=!0;const Pe=[];for(const Me in ge.layers){const Oe=ge.getLayer(Me),Je=Oe.getDataRange(Oe.getBandList()),Ee=ge.createDecodingTask(Je),We=ie.slice(Je.firstByte,Je.lastByte+1),Et=y.b1.performDecoding(We,Ee).then(vt=>Ee.complete(null,vt)).catch(vt=>Ee.complete(vt,null));Pe.push(Et)}Promise.allSettled(Pe).then(()=>ae(null,ge)).catch(Me=>ae(Me))}catch(Pe){ae(Pe)}}}class pt{constructor({actor:ie}){this.actor=ie,this.loading={},this.loaded={}}loadTile(ie,ae){const ge=ie.uid,Pe=ie.request,Me=this.loading[ge]=new lt(ie),{cancel:Oe}=y.b4(Pe,(Je,Ee,We)=>{const Et=!this.loading[ge];if(delete this.loading[ge],Et||Je||!Ee)return Me.status="done",Et||(this.loaded[ge]=Me),ae(Je);Me.parse(Ee,(vt,Le)=>{if(vt||!Le)return ae(vt);ae(null,Le,We)}),this.loaded[ge]=Me});Me.abort=Oe}reloadTile(ie,ae){ae(null,void 0)}abortTile(ie,ae){const ge=ie.uid,Pe=this.loading[ge];Pe&&(Pe.abort&&Pe.abort(),delete this.loading[ge]),ae()}removeTile(ie,ae){const ge=ie.uid;this.loaded[ge]&&delete this.loaded[ge],ae()}decodeRasterArray(ie,ae){y.b1.performDecoding(ie.buffer,ie.task).then(ge=>ae(null,ge)).catch(ge=>ae(ge))}}const Qt=y.fE.prototype.toGeoJSON;class Ht{constructor(ie){this._feature=ie,this.extent=y.ak,this.type=ie.type,this.properties=ie.tags,"id"in ie&&!isNaN(ie.id)&&(this.id=parseInt(ie.id,10))}loadGeometry(){if(this._feature.type===1){const ie=[];for(const ae of this._feature.geometry)ie.push([new y.P(ae[0],ae[1])]);return ie}{const ie=[];for(const ae of this._feature.geometry){const ge=[];for(const Pe of ae)ge.push(new y.P(Pe[0],Pe[1]));ie.push(ge)}return ie}}toGeoJSON(ie,ae,ge){return Qt.call(this,ie,ae,ge)}}class zt{constructor(ie,ae){this.name=ie,this.extent=y.ak,this.length=ae.length,this._jsonFeatures=ae}feature(ie){return new Ht(this._jsonFeatures[ie])}}class jt{constructor(ie){this.layers={},this.extent=y.ak;for(const ae of Object.keys(ie))this.layers[ae]=new zt(ae,ie[ae])}}const Zt=64/4096;class Wt{constructor(){this.features=new Map}clear(){this.features.clear()}load(ie=[],ae){for(const ge of ie){const Pe=ge.id;if(Pe==null)continue;let Me=this.features.get(Pe);Me&&this.updateCache(Me,ae),ge.geometry?(Me=sn(ge),this.updateCache(Me,ae),this.features.set(Pe,Me)):this.features.delete(Pe),this.updateCache(Me,ae)}}updateCache(ie,ae){for(const{canonical:ge,uid:Pe}of Object.values(ae)){const{z:Me,x:Oe,y:Je}=ge;en(ie,Math.pow(2,Me),Oe,Je)&&delete ae[Pe]}}getTile(ie,ae,ge){const Pe=Math.pow(2,ie),Me=[];for(const Oe of this.features.values())en(Oe,Pe,ae,ge)&&Me.push(Ln(Oe,Pe,ae,ge));return{features:Me}}getFeatures(){return[...this.features.values()]}}function en({minX:Ge,minY:ie,maxX:ae,maxY:ge},Pe,Me,Oe){return Ge<(Me+1+Zt)/Pe&&ie<(Oe+1+Zt)/Pe&&ae>(Me-Zt)/Pe&&ge>(Oe-Zt)/Pe}function sn(Ge){const{id:ie,geometry:ae,properties:ge}=Ge;if(!ae)return;if(ae.type==="GeometryCollection")throw new Error("GeometryCollection not supported in dynamic mode.");const{type:Pe,coordinates:Me}=ae,Oe={id:ie,type:1,geometry:[],tags:ge,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},Je=Oe.geometry;if(Pe==="Point")Mn(Me,Je,Oe);else if(Pe==="MultiPoint")for(const Ee of Me)Mn(Ee,Je,Oe);else if(Pe==="LineString")Oe.type=2,xn(Me,Je,Oe);else if(Pe==="MultiLineString")Oe.type=2,Vn(Me,Je,Oe);else if(Pe==="Polygon")Oe.type=3,Vn(Me,Je,Oe,!0);else{if(Pe!=="MultiPolygon")throw new Error("Input data is not a valid GeoJSON object.");Oe.type=3;for(const Ee of Me)Vn(Ee,Je,Oe,!0)}return Oe}function Mn([Ge,ie],ae,ge){const Pe=y.aG(Ge);let Me=y.aJ(ie);Me=Me<0?0:Me>1?1:Me,ae.push(Pe,Me),ge.minX=Math.min(ge.minX,Pe),ge.minY=Math.min(ge.minY,Me),ge.maxX=Math.max(ge.maxX,Pe),ge.maxY=Math.max(ge.maxY,Me)}function xn(Ge,ie,ae,ge=!1,Pe=!1){const Me=[];for(const Oe of Ge)Mn(Oe,Me,ae);ie.push(Me),ge&&(function(Oe,Je){let Ee=0;for(let We=0,Et=Oe.length,vt=Et-2;We<Et;vt=We,We+=2)Ee+=(Oe[We]-Oe[vt])*(Oe[We+1]+Oe[vt+1]);if(Ee>0===Je)for(let We=0,Et=Oe.length;We<Et/2;We+=2){const vt=Oe[We],Le=Oe[We+1];Oe[We]=Oe[Et-2-We],Oe[We+1]=Oe[Et-1-We],Oe[Et-2-We]=vt,Oe[Et-1-We]=Le}})(Me,Pe)}function Vn(Ge,ie,ae,ge=!1){for(let Pe=0;Pe<Ge.length;Pe++)xn(Ge[Pe],ie,ae,ge,Pe===0)}function Ln(Ge,ie,ae,ge){const{id:Pe,type:Me,geometry:Oe,tags:Je}=Ge,Ee=[];if(Me===1)(function(We,Et,vt,Le,yt){for(let Ot=0;Ot<We.length;Ot+=2){const qt=Math.round(y.ak*(We[Ot+0]*Et-vt)),cn=Math.round(y.ak*(We[Ot+1]*Et-Le));yt.push([qt,cn])}})(Oe,ie,ae,ge,Ee);else if(Me===2)for(const We of Oe)Yn(We,ie,ae,ge,Ee);else if(Me===3)for(const We of Oe)Rn(We,ie,ae,ge,Ee);return{id:Pe,type:Me,geometry:Ee,tags:Je}}function Yn(Ge,ie,ae,ge,Pe){const Oe=y.ak+128;let Je;for(let Ee=0;Ee<Ge.length-2;Ee+=2){let We=Math.round(y.ak*(Ge[Ee+0]*ie-ae)),Et=Math.round(y.ak*(Ge[Ee+1]*ie-ge)),vt=Math.round(y.ak*(Ge[Ee+2]*ie-ae)),Le=Math.round(y.ak*(Ge[Ee+3]*ie-ge));const yt=vt-We,Ot=Le-Et;We<-128&&vt<-128||(We<-128?(Et+=Math.round(Ot*((-128-We)/yt)),We=-128):vt<-128&&(Le=Et+Math.round(Ot*((-128-We)/yt)),vt=-128),Et<-128&&Le<-128||(Et<-128?(We+=Math.round(yt*((-128-Et)/Ot)),Et=-128):Le<-128&&(vt=We+Math.round(yt*((-128-Et)/Ot)),Le=-128),We>=Oe&&vt>=Oe||(We>=Oe?(Et+=Math.round(Ot*((Oe-We)/yt)),We=Oe):vt>=Oe&&(Le=Et+Math.round(Ot*((Oe-We)/yt)),vt=Oe),Et>=Oe&&Le>=Oe||(Et>=Oe?(We+=Math.round(yt*((Oe-Et)/Ot)),Et=Oe):Le>=Oe&&(vt=We+Math.round(yt*((Oe-Et)/Ot)),Le=Oe),Je&&We===Je.at(-1)[0]&&Et===Je.at(-1)[1]||(Je=[[We,Et]],Pe.push(Je)),Je.push([vt,Le])))))}}function Rn(Ge,ie,ae,ge,Pe){const Me=(ae-Zt)/ie,Oe=(ge-Zt)/ie,Je=(ae+1+Zt)/ie,Ee=(ge+1+Zt)/ie;function We(Le,yt){let Ot=0;return Le<Me?Ot|=1:Le>Je&&(Ot|=2),yt<Oe?Ot|=4:yt>Ee&&(Ot|=8),Ot}let Et=[];for(let Le=1;Le<=8;Le*=2){let yt=Ge[Ge.length-2],Ot=Ge.at(-1),qt=!(We(yt,Ot)&Le);for(let cn=0;cn<Ge.length;cn+=2){const ht=Ge[cn],ln=Ge[cn+1],Kn=!(We(ht,ln)&Le);Kn!==qt&&(8&Le?Et.push(yt+(ht-yt)*(Ee-Ot)/(ln-Ot),Ee):4&Le?Et.push(yt+(ht-yt)*(Oe-Ot)/(ln-Ot),Oe):2&Le?Et.push(Je,Ot+(ln-Ot)*(Je-yt)/(ht-yt)):1&Le&&Et.push(Me,Ot+(ln-Ot)*(Me-yt)/(ht-yt))),Kn&&Et.push(ht,ln),yt=ht,Ot=ln,qt=Kn}if(!(Ge=Et).length||Le===8)break;Et=[]}const vt=[];for(let Le=0;Le<Et.length;Le+=2)vt.push([Math.round(y.ak*(Et[Le]*ie-ae)),Math.round(y.ak*(Et[Le+1]*ie-ge))]);vt.length&&Pe.push(vt)}function $t({name:Ge,features:ie},ae){ae.writeStringField(1,Ge),ae.writeVarintField(5,y.ak);const ge=new Map,Pe=new Map,Me={keys:ge,values:Pe,feature:null};for(const Oe of ie)Me.feature=Oe,ae.writeMessage(2,fn,Me);for(const Oe of ge.keys())ae.writeStringField(3,Oe);for(const Oe of Pe.keys())ae.writeMessage(4,Be,Oe)}function fn(Ge,ie){const ae=Ge.feature;ae.id!==void 0&&Number.isSafeInteger(+ae.id)&&ie.writeVarintField(1,+ae.id),ae.tags&&ie.writeMessage(2,yn,Ge),ie.writeVarintField(3,ae.type),ie.writeMessage(4,Bn,ae)}function yn({keys:Ge,values:ie,feature:ae}
24,ge){for(const Pe of Object.keys(ae.tags)){let Me=ae.tags[Pe];if(Me===null)continue;let Oe=Ge.get(Pe);Oe===void 0&&(Oe=Ge.size,Ge.set(Pe,Oe)),ge.writeVarint(Oe);const Je=typeof Me;Je!=="string"&&Je!=="boolean"&&Je!=="number"&&(Me=JSON.stringify(Me));let Ee=ie.get(Me);Ee===void 0&&(Ee=ie.size,ie.set(Me,Ee)),ge.writeVarint(Ee)}}function Cn(Ge,ie){return(ie<<3)+(7&Ge)}function _n(Ge){return Ge<<1^Ge>>31}function Bn(Ge,ie){const{geometry:ae,type:ge}=Ge;let Pe=0,Me=0;if(ge===1){ie.writeVarint(Cn(1,ae.length));for(const Oe of ae){const Je=Oe[0]-Pe,Ee=Oe[1]-Me;ie.writeVarint(_n(Je)),ie.writeVarint(_n(Ee)),Pe+=Je,Me+=Ee}}else for(const Oe of ae){if(Oe.length===0)continue;ie.writeVarint(Cn(1,1));const Je=Oe.length-(ge===3?1:0);for(let Ee=0;Ee<Je;Ee++){Ee===1&&ie.writeVarint(Cn(2,Je-1));const We=Oe[Ee][0]-Pe,Et=Oe[Ee][1]-Me;ie.writeVarint(_n(We)),ie.writeVarint(_n(Et)),Pe+=We,Me+=Et}ge===3&&ie.writeVarint(Cn(7,1))}}function Be(Ge,ie){const ae=typeof Ge;ae==="string"?ie.writeStringField(1,Ge):ae==="boolean"?ie.writeBooleanField(7,Ge):ae==="number"&&(Ge%1!=0?ie.writeDoubleField(3,Ge):Ge<0?ie.writeSVarintField(6,Ge):ie.writeVarintField(5,Ge))}const Xe={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:Ge=>Ge},mt=Math.fround||(kt=new Float32Array(1),Ge=>(kt[0]=+Ge,kt[0]));var kt;class Vt{constructor(ie){this.options=Object.assign(Object.create(Xe),ie),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(ie){const{log:ae,minZoom:ge,maxZoom:Pe}=this.options;ae&&console.time("total time");const Me=`prepare ${ie.length} points`;ae&&console.time(Me),this.points=ie;const Oe=[];for(let Ee=0;Ee<ie.length;Ee++){const We=ie[Ee];if(!We.geometry)continue;const[Et,vt]=We.geometry.coordinates,Le=mt(tt(Et)),yt=mt(Rt(vt));Oe.push(Le,yt,1/0,Ee,-1,1),this.options.reduce&&Oe.push(0)}let Je=this.trees[Pe+1]=this._createTree(Oe);ae&&console.timeEnd(Me);for(let Ee=Pe;Ee>=ge;Ee--){const We=+Date.now();Je=this.trees[Ee]=this._createTree(this._cluster(Je,Ee)),ae&&console.log("z%d: %d clusters in %dms",Ee,Je.numItems,+Date.now()-We)}return ae&&console.timeEnd("total time"),this}getClusters(ie,ae){let ge=((ie[0]+180)%360+360)%360-180;const Pe=Math.max(-90,Math.min(90,ie[1]));let Me=ie[2]===180?180:((ie[2]+180)%360+360)%360-180;const Oe=Math.max(-90,Math.min(90,ie[3]));if(ie[2]-ie[0]>=360)ge=-180,Me=180;else if(ge>Me){const vt=this.getClusters([ge,Pe,180,Oe],ae),Le=this.getClusters([-180,Pe,Me,Oe],ae);return vt.concat(Le)}const Je=this.trees[this._limitZoom(ae)],Ee=Je.range(tt(ge),Rt(Oe),tt(Me),Rt(Pe)),We=Je.data,Et=[];for(const vt of Ee){const Le=this.stride*vt;Et.push(We[Le+5]>1?Ie(We,Le,this.clusterProps):this.points[We[Le+3]])}return Et}getChildren(ie){const ae=this._getOriginId(ie),ge=this._getOriginZoom(ie),Pe="No cluster with the specified id.",Me=this.trees[ge];if(!Me)throw new Error(Pe);const Oe=Me.data;if(ae*this.stride>=Oe.length)throw new Error(Pe);const Je=this.options.radius/(this.options.extent*Math.pow(2,ge-1)),Ee=Me.within(Oe[ae*this.stride],Oe[ae*this.stride+1],Je),We=[];for(const Et of Ee){const vt=Et*this.stride;Oe[vt+4]===ie&&We.push(Oe[vt+5]>1?Ie(Oe,vt,this.clusterProps):this.points[Oe[vt+3]])}if(We.length===0)throw new Error(Pe);return We}getLeaves(ie,ae,ge){const Pe=[];return this._appendLeaves(Pe,ie,ae=ae||10,ge=ge||0,0),Pe}getTile(ie,ae,ge){const Pe=this.trees[this._limitZoom(ie)],Me=Math.pow(2,ie),{extent:Oe,radius:Je}=this.options,Ee=Je/Oe,We=(ge-Ee)/Me,Et=(ge+1+Ee)/Me,vt={features:[]};return this._addTileFeatures(Pe.range((ae-Ee)/Me,We,(ae+1+Ee)/Me,Et),Pe.data,ae,ge,Me,vt),ae===0&&this._addTileFeatures(Pe.range(1-Ee/Me,We,1,Et),Pe.data,Me,ge,Me,vt),ae===Me-1&&this._addTileFeatures(Pe.range(0,We,Ee/Me,Et),Pe.data,-1,ge,Me,vt),vt.features.length?vt:null}getClusterExpansionZoom(ie){let ae=this._getOriginZoom(ie)-1;for(;ae<=this.options.maxZoom;){const ge=this.getChildren(ie);if(ae++,ge.length!==1)break;ie=ge[0].properties.cluster_id}return ae}_appendLeaves(ie,ae,ge,Pe,Me){const Oe=this.getChildren(ae);for(const Je of Oe){const Ee=Je.properties;if(Ee&&Ee.cluster?Me+Ee.point_count<=Pe?Me+=Ee.point_count:Me=this._appendLeaves(ie,Ee.cluster_id,ge,Pe,Me):Me<Pe?Me++:ie.push(Je),ie.length===ge)break}return Me}_createTree(ie){const ae=new y.bM(ie.length/this.stride|0,this.options.nodeSize,Float32Array);for(let ge=0;ge<ie.length;ge+=this.stride)ae.add(ie[ge],ie[ge+1]);return ae.finish(),ae.data=ie,ae}_addTileFeatures(ie,ae,ge,Pe,Me,Oe){for(const Je of ie){const Ee=Je*this.stride,We=ae[Ee+5]>1;let Et,vt,Le;if(We)Et=Ve(ae,Ee,this.clusterProps),vt=ae[Ee],Le=ae[Ee+1];else{const qt=this.points[ae[Ee+3]];Et=qt.properties;const[cn,ht]=qt.geometry.coordinates;vt=tt(cn),Le=Rt(ht)}const yt={type:1,geometry:[[Math.round(this.options.extent*(vt*Me-ge)),Math.round(this.options.extent*(Le*Me-Pe))]],tags:Et};let Ot;Ot=We||this.options.generateId?ae[Ee+3]:this.points[ae[Ee+3]].id,Ot!==void 0&&(yt.id=Ot),Oe.features.push(yt)}}_limitZoom(ie){return Math.max(this.options.minZoom,Math.min(Math.floor(+ie),this.options.maxZoom+1))}_cluster(ie,ae){const{radius:ge,extent:Pe,reduce:Me,minPoints:Oe}=this.options,Je=ge/(Pe*Math.pow(2,ae)),Ee=ie.data,We=[],Et=this.stride;for(let vt=0;vt<Ee.length;vt+=Et){if(Ee[vt+2]<=ae)continue;Ee[vt+2]=ae;const Le=Ee[vt],yt=Ee[vt+1],Ot=ie.within(Ee[vt],Ee[vt+1],Je),qt=Ee[vt+5];let cn=qt;for(const ht of Ot){const ln=ht*Et;Ee[ln+2]>ae&&(cn+=Ee[ln+5])}if(cn>qt&&cn>=Oe){let ht,ln=Le*qt,Kn=yt*qt,Hr=-1;const ti=(vt/Et<<5)+(ae+1)+this.points.length;
24for(const On of Ot){const br=On*Et;if(Ee[br+2]<=ae)continue;Ee[br+2]=ae;const si=Ee[br+5];ln+=Ee[br]*si,Kn+=Ee[br+1]*si,Ee[br+4]=ti,Me&&(ht||(ht=this._map(Ee,vt,!0),Hr=this.clusterProps.length,this.clusterProps.push(ht)),Me(ht,this._map(Ee,br)))}Ee[vt+4]=ti,We.push(ln/cn,Kn/cn,1/0,ti,-1,cn),Me&&We.push(Hr)}else{for(let ht=0;ht<Et;ht++)We.push(Ee[vt+ht]);if(cn>1)for(const ht of Ot){const ln=ht*Et;if(!(Ee[ln+2]<=ae)){Ee[ln+2]=ae;for(let Kn=0;Kn<Et;Kn++)We.push(Ee[ln+Kn])}}}}return We}_getOriginId(ie){return ie-this.points.length>>5}_getOriginZoom(ie){return(ie-this.points.length)%32}_map(ie,ae,ge){if(ie[ae+5]>1){const Oe=this.clusterProps[ie[ae+6]];return ge?Object.assign({},Oe):Oe}const Pe=this.points[ie[ae+3]].properties,Me=this.options.map(Pe);return ge&&Me===Pe?Object.assign({},Me):Me}}function Ie(Ge,ie,ae){return{type:"Feature",id:Ge[ie+3],properties:Ve(Ge,ie,ae),geometry:{type:"Point",coordinates:[(ge=Ge[ie],360*(ge-.5)),Ut(Ge[ie+1])]}};var ge}function Ve(Ge,ie,ae){const ge=Ge[ie+5],Pe=ge>=1e4?`${Math.round(ge/1e3)}k`:ge>=1e3?Math.round(ge/100)/10+"k":ge,Me=Ge[ie+6],Oe=Me===-1?{}:Object.assign({},ae[Me]);return Object.assign(Oe,{cluster:!0,cluster_id:Ge[ie+3],point_count:ge,point_count_abbreviated:Pe})}function tt(Ge){return Ge/360+.5}function Rt(Ge){const ie=Math.sin(Ge*Math.PI/180),ae=.5-.25*Math.log((1+ie)/(1-ie))/Math.PI;return ae<0?0:ae>1?1:ae}function Ut(Ge){const ie=(180-360*Ge)*Math.PI/180;return 360*Math.atan(Math.exp(ie))/Math.PI-90}function nn(Ge,ie,ae,ge){let Pe=ge;const Me=ie+(ae-ie>>1);let Oe,Je=ae-ie;const Ee=Ge[ie],We=Ge[ie+1],Et=Ge[ae],vt=Ge[ae+1];for(let Le=ie+3;Le<ae;Le+=3){const yt=st(Ge[Le],Ge[Le+1],Ee,We,Et,vt);if(yt>Pe)Oe=Le,Pe=yt;else if(yt===Pe){const Ot=Math.abs(Le-Me);Ot<Je&&(Oe=Le,Je=Ot)}}Pe>ge&&(Oe-ie>3&&nn(Ge,ie,Oe,ge),Ge[Oe+2]=Pe,ae-Oe>3&&nn(Ge,Oe,ae,ge))}function st(Ge,ie,ae,ge,Pe,Me){let Oe=Pe-ae,Je=Me-ge;if(Oe!==0||Je!==0){const Ee=((Ge-ae)*Oe+(ie-ge)*Je)/(Oe*Oe+Je*Je);Ee>1?(ae=Pe,ge=Me):Ee>0&&(ae+=Oe*Ee,ge+=Je*Ee)}return Oe=Ge-ae,Je=ie-ge,Oe*Oe+Je*Je}function Lt(Ge,ie,ae,ge){const Pe={id:Ge??null,type:ie,geometry:ae,tags:ge,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(ie==="Point"||ie==="MultiPoint"||ie==="LineString")mn(Pe,ae);else if(ie==="Polygon")mn(Pe,ae[0]);else if(ie==="MultiLineString")for(const Me of ae)mn(Pe,Me);else if(ie==="MultiPolygon")for(const Me of ae)mn(Pe,Me[0]);return Pe}function mn(Ge,ie){for(let ae=0;ae<ie.length;ae+=3)Ge.minX=Math.min(Ge.minX,ie[ae]),Ge.minY=Math.min(Ge.minY,ie[ae+1]),Ge.maxX=Math.max(Ge.maxX,ie[ae]),Ge.maxY=Math.max(Ge.maxY,ie[ae+1])}function Hn(Ge,ie,ae,ge){if(!ie.geometry)return;const Pe=ie.geometry.coordinates;if(Pe&&Pe.length===0)return;const Me=ie.geometry.type,Oe=Math.pow(ae.tolerance/((1<<ae.maxZoom)*ae.extent),2);let Je=[],Ee=ie.id;if(ae.promoteId?Ee=ie.properties[ae.promoteId]:ae.generateId&&(Ee=ge||0),Me==="Point")ir(Pe,Je);else if(Me==="MultiPoint")for(const We of Pe)ir(We,Je);else if(Me==="LineString")hr(Pe,Je,Oe,!1);else if(Me==="MultiLineString"){if(ae.lineMetrics){for(const We of Pe)Je=[],hr(We,Je,Oe,!1),Ge.push(Lt(Ee,"LineString",Je,ie.properties));return}Sr(Pe,Je,Oe,!1)}else if(Me==="Polygon")Sr(Pe,Je,Oe,!0);else{if(Me!=="MultiPolygon"){if(Me==="GeometryCollection"){for(const We of ie.geometry.geometries)Hn(Ge,{id:Ee,geometry:We,properties:ie.properties},ae,ge);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const We of Pe){const Et=[];Sr(We,Et,Oe,!0),Je.push(Et)}}Ge.push(Lt(Ee,Me,Je,ie.properties))}function ir(Ge,ie){ie.push(zn(Ge[0]),cr(Ge[1]),0)}function hr(Ge,ie,ae,ge){let Pe,Me,Oe=0;for(let Ee=0;Ee<Ge.length;Ee++){const We=zn(Ge[Ee][0]),Et=cr(Ge[Ee][1]);ie.push(We,Et,0),Ee>0&&(Oe+=ge?(Pe*Et-We*Me)/2:Math.sqrt(Math.pow(We-Pe,2)+Math.pow(Et-Me,2))),Pe=We,Me=Et}const Je=ie.length-3;ie[2]=1,nn(ie,0,Je,ae),ie[Je+2]=1,ie.size=Math.abs(Oe),ie.start=0,ie.end=ie.size}function Sr(Ge,ie,ae,ge){for(let Pe=0;Pe<Ge.length;Pe++){const Me=[];hr(Ge[Pe],Me,ae,ge),ie.push(Me)}}function zn(Ge){return Ge/360+.5}function cr(Ge){const ie=Math.sin(Ge*Math.PI/180),ae=.5-.25*Math.log((1+ie)/(1-ie))/Math.PI;return ae<0?0:ae>1?1:ae}function Un(Ge,ie,ae,ge,Pe,Me,Oe,Je){if(ge/=ie,Me>=(ae/=ie)&&Oe<ge)return Ge;if(Oe<ae||Me>=ge)return null;const Ee=[];for(const We of Ge){const Et=We.geometry;let vt=We.type;const Le=Pe===0?We.minX:We.minY,yt=Pe===0?We.maxX:We.maxY;if(Le>=ae&&yt<ge){Ee.push(We);continue}if(yt<ae||Le>=ge)continue;let Ot=[];if(vt==="Point"||vt==="MultiPoint")Ur(Et,Ot,ae,ge,Pe);else if(vt==="LineString")ko(Et,Ot,ae,ge,Pe,!1,Je.lineMetrics);else if(vt==="MultiLineString")ar(Et,Ot,ae,ge,Pe,!1);else if(vt==="Polygon")ar(Et,Ot,ae,ge,Pe,!0);else if(vt==="MultiPolygon")for(const qt of Et){const cn=[];ar(qt,cn,ae,ge,Pe,!0),cn.length&&Ot.push(cn)}if(Ot.length){if(Je.lineMetrics&&vt==="LineString"){for(const qt of Ot)Ee.push(Lt(We.id,vt,qt,We.tags));continue}vt!=="LineString"&&vt!=="MultiLineString"||(Ot.length===1?(vt="LineString",Ot=Ot[0]):vt="MultiLineString"),vt!=="Point"&&vt!=="MultiPoint"||(vt=Ot.length===3?"Point":"MultiPoint"),Ee.push(Lt(We.id,vt,Ot,We.tags))}}return Ee.length?Ee:null}function Ur(Ge,ie,ae,ge,Pe){for(let Me=0;Me<Ge.length;Me+=3){const Oe=Ge[Me+Pe];Oe>=ae&&Oe<=ge&&nr(ie,Ge[Me],Ge[Me+1],Ge[Me+2])}}function ko(Ge,ie,ae,ge,Pe,Me,Oe){let Je=Lr(Ge);const Ee=Pe===0?ro:ms;let We,Et,vt=Ge.start;for(let cn=0;cn<Ge.length-3;cn+=3){const ht=Ge[cn],ln=Ge[cn+1],Kn=Ge[cn+2],Hr=Ge[cn+3],ti=Ge[cn+4],On=Pe===0?ht:ln,br=Pe===0?Hr:ti;let si=!1;Oe&&(We=Math.sqrt(Math.pow(ht-Hr,2)+Math.pow(ln-ti,2))),On<ae?br>ae&&(Et=Ee(Je,ht,ln,Hr,ti,ae),Oe&&(Je.start=vt+We*Et)):On>ge?br<ge&&(Et=Ee(Je,ht,ln,Hr,ti,ge),Oe&&(Je.start=vt+We*Et)):nr(Je,ht,ln,Kn),br<ae&&On>=ae&&(Et=Ee(Je,ht,ln,Hr,ti,ae),si=!0),br>ge&&On<=ge&&(Et=Ee(Je,ht,ln,Hr,ti,ge),si=!0),!Me&&si&&(Oe&&(Je.end=vt+We*Et),ie.pu
24sh(Je),Je=Lr(Ge)),Oe&&(vt+=We)}let Le=Ge.length-3;const yt=Ge[Le],Ot=Ge[Le+1],qt=Pe===0?yt:Ot;qt>=ae&&qt<=ge&&nr(Je,yt,Ot,Ge[Le+2]),Le=Je.length-3,Me&&Le>=3&&(Je[Le]!==Je[0]||Je[Le+1]!==Je[1])&&nr(Je,Je[0],Je[1],Je[2]),Je.length&&ie.push(Je)}function Lr(Ge){const ie=[];return ie.size=Ge.size,ie.start=Ge.start,ie.end=Ge.end,ie}function ar(Ge,ie,ae,ge,Pe,Me){for(const Oe of Ge)ko(Oe,ie,ae,ge,Pe,Me,!1)}function nr(Ge,ie,ae,ge){Ge.push(ie,ae,ge)}function ro(Ge,ie,ae,ge,Pe,Me){const Oe=(Me-ie)/(ge-ie);return nr(Ge,Me,ae+(Pe-ae)*Oe,1),Oe}function ms(Ge,ie,ae,ge,Pe,Me){const Oe=(Me-ae)/(Pe-ae);return nr(Ge,ie+(ge-ie)*Oe,Me,1),Oe}function Ks(Ge,ie){const ae=[];for(let ge=0;ge<Ge.length;ge++){const Pe=Ge[ge],Me=Pe.type;let Oe;if(Me==="Point"||Me==="MultiPoint"||Me==="LineString")Oe=xc(Pe.geometry,ie);else if(Me==="MultiLineString"||Me==="Polygon"){Oe=[];for(const Je of Pe.geometry)Oe.push(xc(Je,ie))}else if(Me==="MultiPolygon"){Oe=[];for(const Je of Pe.geometry){const Ee=[];for(const We of Je)Ee.push(xc(We,ie));Oe.push(Ee)}}ae.push(Lt(Pe.id,Me,Oe,Pe.tags))}return ae}function xc(Ge,ie){const ae=[];ae.size=Ge.size,Ge.start!==void 0&&(ae.start=Ge.start,ae.end=Ge.end);for(let ge=0;ge<Ge.length;ge+=3)ae.push(Ge[ge]+ie,Ge[ge+1],Ge[ge+2]);return ae}function wc(Ge,ie){if(Ge.transformed)return Ge;const ae=1<<Ge.z,ge=Ge.x,Pe=Ge.y;for(const Me of Ge.features){const Oe=Me.geometry,Je=Me.type;if(Me.geometry=[],Je===1)for(let Ee=0;Ee<Oe.length;Ee+=2)Me.geometry.push(Js(Oe[Ee],Oe[Ee+1],ie,ae,ge,Pe));else for(let Ee=0;Ee<Oe.length;Ee++){const We=[];for(let Et=0;Et<Oe[Ee].length;Et+=2)We.push(Js(Oe[Ee][Et],Oe[Ee][Et+1],ie,ae,ge,Pe));Me.geometry.push(We)}}return Ge.transformed=!0,Ge}function Js(Ge,ie,ae,ge,Pe,Me){return[Math.round(ae*(Ge*ge-Pe)),Math.round(ae*(ie*ge-Me))]}function hu(Ge,ie,ae,ge,Pe){const Me=ie===Pe.maxZoom?0:Pe.tolerance/((1<<ie)*Pe.extent),Oe={features:[],numPoints:0,numSimplified:0,numFeatures:Ge.length,source:null,x:ae,y:ge,z:ie,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const Je of Ge)ud(Oe,Je,Me,Pe);return Oe}function ud(Ge,ie,ae,ge){const Pe=ie.geometry,Me=ie.type,Oe=[];if(Ge.minX=Math.min(Ge.minX,ie.minX),Ge.minY=Math.min(Ge.minY,ie.minY),Ge.maxX=Math.max(Ge.maxX,ie.maxX),Ge.maxY=Math.max(Ge.maxY,ie.maxY),Me==="Point"||Me==="MultiPoint")for(let Je=0;Je<Pe.length;Je+=3)Oe.push(Pe[Je],Pe[Je+1]),Ge.numPoints++,Ge.numSimplified++;else if(Me==="LineString")Sc(Oe,Pe,Ge,ae,!1,!1);else if(Me==="MultiLineString"||Me==="Polygon")for(let Je=0;Je<Pe.length;Je++)Sc(Oe,Pe[Je],Ge,ae,Me==="Polygon",Je===0);else if(Me==="MultiPolygon")for(let Je=0;Je<Pe.length;Je++){const Ee=Pe[Je];for(let We=0;We<Ee.length;We++)Sc(Oe,Ee[We],Ge,ae,!0,We===0)}if(Oe.length){let Je=ie.tags||null;if(Me==="LineString"&&ge.lineMetrics){Je={};for(const We in ie.tags)Je[We]=ie.tags[We];Je.mapbox_clip_start=Pe.start/Pe.size,Je.mapbox_clip_end=Pe.end/Pe.size}const Ee={geometry:Oe,type:Me==="Polygon"||Me==="MultiPolygon"?3:Me==="LineString"||Me==="MultiLineString"?2:1,tags:Je};ie.id!==null&&(Ee.id=ie.id),Ge.features.push(Ee)}}function Sc(Ge,ie,ae,ge,Pe,Me){const Oe=ge*ge;if(ge>0&&ie.size<(Pe?Oe:ge))return void(ae.numPoints+=ie.length/3);const Je=[];for(let Ee=0;Ee<ie.length;Ee+=3)(ge===0||ie[Ee+2]>Oe)&&(ae.numSimplified++,Je.push(ie[Ee],ie[Ee+1])),ae.numPoints++;Pe&&(function(Ee,We){let Et=0;for(let vt=0,Le=Ee.length,yt=Le-2;vt<Le;yt=vt,vt+=2)Et+=(Ee[vt]-Ee[yt])*(Ee[vt+1]+Ee[yt+1]);if(Et>0===We)for(let vt=0,Le=Ee.length;vt<Le/2;vt+=2){const yt=Ee[vt],Ot=Ee[vt+1];Ee[vt]=Ee[Le-2-vt],Ee[vt+1]=Ee[Le-1-vt],Ee[Le-2-vt]=yt,Ee[Le-1-vt]=Ot}})(Je,Me),Ge.push(Je)}const fu={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class Eh{constructor(ie,ae){const ge=(ae=this.options=(function(Me,Oe){for(const Je in Oe)Me[Je]=Oe[Je];return Me})(Object.create(fu),ae)).debug;if(ge&&console.time("preprocess data"),ae.maxZoom<0||ae.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(ae.promoteId&&ae.generateId)throw new Error("promoteId and generateId cannot be used together.");let Pe=(function(Me,Oe){const Je=[];
24if(Me.type==="FeatureCollection")for(let Ee=0;Ee<Me.features.length;Ee++)Hn(Je,Me.features[Ee],Oe,Ee);else Hn(Je,Me.type==="Feature"?Me:{geometry:Me},Oe);return Je})(ie,ae);this.tiles={},this.tileCoords=[],ge&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",ae.indexMaxZoom,ae.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),Pe=(function(Me,Oe){const Je=Oe.buffer/Oe.extent;let Ee=Me;const We=Un(Me,1,-1-Je,Je,0,-1,2,Oe),Et=Un(Me,1,1-Je,2+Je,0,-1,2,Oe);return(We||Et)&&(Ee=Un(Me,1,-Je,1+Je,0,-1,2,Oe)||[],We&&(Ee=Ks(We,1).concat(Ee)),Et&&(Ee=Ee.concat(Ks(Et,-1)))),Ee})(Pe,ae),Pe.length&&this.splitTile(Pe,0,0,0),ge&&(Pe.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(ie,ae,ge,Pe,Me,Oe,Je){const Ee=[ie,ae,ge,Pe],We=this.options,Et=We.debug;for(;Ee.length;){Pe=Ee.pop(),ge=Ee.pop(),ae=Ee.pop(),ie=Ee.pop();const vt=1<<ae,Le=pu(ae,ge,Pe);let yt=this.tiles[Le];if(!yt&&(Et>1&&console.time("creation"),yt=this.tiles[Le]=hu(ie,ae,ge,Pe,We),this.tileCoords.push({z:ae,x:ge,y:Pe}),Et)){Et>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",ae,ge,Pe,yt.numFeatures,yt.numPoints,yt.numSimplified),console.timeEnd("creation"));const si=`z${ae}`;this.stats[si]=(this.stats[si]||0)+1,this.total++}if(yt.source=ie,Me==null){if(ae===We.indexMaxZoom||yt.numPoints<=We.indexMaxPoints)continue}else{if(ae===We.maxZoom||ae===Me)continue;if(Me!=null){const si=Me-ae;if(ge!==Oe>>si||Pe!==Je>>si)continue}}if(yt.source=null,ie.length===0)continue;Et>1&&console.time("clipping");const Ot=.5*We.buffer/We.extent,qt=.5-Ot,cn=.5+Ot,ht=1+Ot;let ln=null,Kn=null,Hr=null,ti=null,On=Un(ie,vt,ge-Ot,ge+cn,0,yt.minX,yt.maxX,We),br=Un(ie,vt,ge+qt,ge+ht,0,yt.minX,yt.maxX,We);ie=null,On&&(ln=Un(On,vt,Pe-Ot,Pe+cn,1,yt.minY,yt.maxY,We),Kn=Un(On,vt,Pe+qt,Pe+ht,1,yt.minY,yt.maxY,We),On=null),br&&(Hr=Un(br,vt,Pe-Ot,Pe+cn,1,yt.minY,yt.maxY,We),ti=Un(br,vt,Pe+qt,Pe+ht,1,yt.minY,yt.maxY,We),br=null),Et>1&&console.timeEnd("clipping"),Ee.push(ln||[],ae+1,2*ge,2*Pe),Ee.push(Kn||[],ae+1,2*ge,2*Pe+1),Ee.push(Hr||[],ae+1,2*ge+1,2*Pe),Ee.push(ti||[],ae+1,2*ge+1,2*Pe+1)}}getTile(ie,ae,ge){ie=+ie,ae=+ae,ge=+ge;const Pe=this.options,{extent:Me,debug:Oe}=Pe;if(ie<0||ie>24)return null;const Je=1<<ie,Ee=pu(ie,ae=ae+Je&Je-1,ge);if(this.tiles[Ee])return wc(this.tiles[Ee],Me);Oe>1&&console.log("drilling down to z%d-%d-%d",ie,ae,ge);let We,Et=ie,vt=ae,Le=ge;for(;!We&&Et>0;)Et--,vt>>=1,Le>>=1,We=this.tiles[pu(Et,vt,Le)];return We&&We.source?(Oe>1&&(console.log("found parent tile z%d-%d-%d",Et,vt,Le),console.time("drilling down")),this.splitTile(We.source,Et,vt,Le,ie,ae,ge),Oe>1&&console.timeEnd("drilling down"),this.tiles[Ee]?wc(this.tiles[Ee],Me):null):null}}function pu(Ge,ie,ae){return 32*((1<<Ge)*ae+ie)+Ge}function St(Ge,ie){const ae=Ge.tileID.canonical;if(!this._geoJSONIndex)return void ie(null,null);const ge=this._geoJSONIndex.getTile(ae.z,ae.x,ae.y);if(!ge)return void ie(null,null);const Pe=We=>We.tags&&"3d_elevation_id"in We.tags&&"source"in We.tags&&We.tags.source==="elevation",Me=ge.features.filter(We=>Pe(We));let Oe={_geojsonTileLayer:ge.features};Me.length>0&&(Oe={_geojsonTileLayer:ge.features.filter(We=>!Pe(We)),hd_road_elevation:Me});const Je=new jt(Oe),Ee=(function(We){const Et=new y.b2;for(const vt of Object.keys(We))Et.writeMessage(3,$t,{name:vt,features:We[vt]});return Et.finish()})(Oe).buffer;ie(null,{vectorTile:Je,rawData:Ee})}class dl extends Fe{constructor(ie){super(ie),this.loadVectorData=St,this._dynamicIndex=new Wt}loadData(ie,ae){const ge=ie&&ie.request,Pe=ge&&ge.collectResourceTiming;this._geoJSONIndex=null,this.loadGeoJSON(ie,(Me,Oe)=>{if(Me||!Oe)return ae(Me);
24if(typeof Oe!="object")return ae(new Error(`Input data given to '${ie.source}' is not a valid GeoJSON object.`));{try{if(ie.filter){const Ee=y.U(ie.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Ee.result==="error")throw new Error(Ee.value.map(We=>`${We.key}: ${We.message}`).join(", "));Oe.features=Oe.features.filter(We=>Ee.value.evaluate({zoom:0},We))}ie.dynamic?(Oe.type==="Feature"&&(Oe={type:"FeatureCollection",features:[Oe]}),ie.append||(this._dynamicIndex.clear(),this.loaded={}),this._dynamicIndex.load(Oe.features,this.loaded),ie.cluster&&(Oe.features=this._dynamicIndex.getFeatures())):this.loaded={},this._geoJSONIndex=ie.cluster?new Vt((function({superclusterOptions:Ee,clusterProperties:We}){if(!We||!Ee)return Ee;const Et={},vt={},Le={accumulated:null,zoom:0},yt={properties:null},Ot=Object.keys(We);for(const qt of Ot){const[cn,ht]=We[qt],ln=y.U(ht),Kn=y.U(typeof cn=="string"?[cn,["accumulated"],["get",qt]]:cn);Et[qt]=ln.value,vt[qt]=Kn.value}return Ee.map=qt=>{yt.properties=qt;const cn={};for(const ht of Ot)cn[ht]=Et[ht].evaluate(Le,yt);return cn},Ee.reduce=(qt,cn)=>{yt.properties=cn;for(const ht of Ot)Le.accumulated=qt[ht],qt[ht]=vt[ht].evaluate(Le,yt)},Ee})(ie)).load(Oe.features):ie.dynamic?this._dynamicIndex:(function(Ee,We){return new Eh(Ee,We)})(Oe,ie.geojsonVtOptions)}catch(Ee){return ae(Ee)}const Je={};if(Pe){const Ee=E(ge);Ee&&(Je.resourceTiming={},Je.resourceTiming[ie.source]=JSON.parse(JSON.stringify(Ee)))}ae(null,Je)}})}reloadTile(ie,ae){const ge=this.loaded;return ge&&ge[ie.uid]?ie.partial?ae(null,void 0):super.reloadTile(ie,ae):this.loadTile(ie,ae)}loadGeoJSON(ie,ae){if(ie.request)y.m(ie.request,ae);else{if(typeof ie.data!="string")return ae(new Error(`Input data given to '${ie.source}' is not a valid GeoJSON object.`));setTimeout(()=>{try{return ae(null,JSON.parse(ie.data))}catch{return ae(new Error(`Input data given to '${ie.source}' is not a valid GeoJSON object.`))}},0)}}getClusterExpansionZoom(ie,ae){try{ae(null,this._geoJSONIndex.getClusterExpansionZoom(ie.clusterId))}catch(ge){ae(ge)}}getClusterChildren(ie,ae){try{ae(null,this._geoJSONIndex.getChildren(ie.clusterId))}catch(ge){ae(ge)}}getClusterLeaves(ie,ae){try{ae(null,this._geoJSONIndex.getLeaves(ie.clusterId,ie.limit,ie.offset))}catch(ge){ae(ge)}}}class Nl{constructor(ie,ae,ge){this.tileID=new y.aU(ie.tileID.overscaledZ,ie.tileID.wrap,ie.tileID.canonical.z,ie.tileID.canonical.x,ie.tileID.canonical.y),this.tileZoom=ie.tileZoom,this.uid=ie.uid,this.zoom=ie.zoom,this.canonical=ie.tileID.canonical,this.pixelRatio=ie.pixelRatio,this.tileSize=ie.tileSize,this.source=ie.source,this.overscaling=this.tileID.overscaleFactor(),this.projection=ie.projection,this.brightness=ae,this.worldview=ge}parse(ie,ae,ge,Pe){this.status="parsing";const Me=new y.aU(ge.tileID.overscaledZ,ge.tileID.wrap,ge.tileID.canonical.z,ge.tileID.canonical.x,ge.tileID.canonical.y),Oe=[],Je=ae.familiesBySource[ge.source],Ee=new y.fj(Me,ge.promoteId);Ee.bucketLayerIDs=[],Ee.is3DTile=!0,y.fF(ie).then(We=>{const Et=We.json.extensionsUsed&&We.json.extensionsUsed.includes("MAPBOX_mesh_features")||We.json.asset.extras&&We.json.asset.extras.MAPBOX_mesh_features,vt=We.json.extensionsUsed&&We.json.extensionsUsed.includes("EXT_meshopt_compression"),Le=new y.ab(this.zoom,{brightness:this.brightness,worldview:this.worldview});for(const yt in Je)for(const Ot of Je[yt]){const qt=Ot[0];Ee.bucketLayerIDs.push(Ot.map(ln=>y.t(ln.id,ln.scope))),qt.recalculate(Le,[]);const cn=y.fG(We,1/y.cW(ge.tileID.canonical)),ht=new y.fH(Ot,cn,Me,Et,vt,this.brightness,Ee,this.worldview);Et||(ht.needsUpload=!0),Oe.push(ht),ht.evaluate(qt)}this.status="done",Pe(null,{buckets:Oe,featureIndex:Ee,collisionBoxArray:null,glyphAtlasImage:null,lineAtlas:null,imageAtlas:null,brightness:null})}).catch(We=>Pe(new Error(We.message)))}}class Tc{constructor({actor:ie,layerIndex:ae,availableImages:ge,availableModels:Pe,brightness:Me,worldview:Oe}){this.actor=ie,this.layerIndex=ae,this.availableImages=ge,this.availableModels=Pe,this.brightness=Me,this.loading={},this.loaded={},this.worldview=Oe}loadTile(ie,ae){const ge=ie.uid,Pe=this.loading[ge]=new Nl(ie,this.brightness,this.worldview);y.b4(ie.request,(Me,Oe)=>{const Je=!this.loading[ge];return delete this.loading[ge],Je||Me?(Pe.status="done",Je||(this.loaded[ge]=Pe),ae(Me)):Oe&&Oe.byteLength!==0?void Pe.parse(Oe,this.layerIndex,ie,(Ee,We)=>{Pe.status="done",this.loaded=this.loaded||{},this.loaded[ge]=Pe,Ee||!We?ae(Ee):ae(null,We)}):(Pe.status="done",this.loaded[ge]=Pe,ae())})}reloadTile(ie,ae){const ge=this.loaded,Pe=ie.uid;if(ge&&ge[Pe]){const Me=ge[Pe];Me.projection=ie.projection,Me.brightness=ie.brightness;const Oe=(Je,Ee)=>{Me.reloadCallback&&(delete Me.reloadCallback,this.loadTile(ie,ae)),ae(Je,Ee)};Me.status==="parsing"?Me.reloadCallback=Oe:Me.status==="done"&&this.loadTile(ie,ae)}}abortTile(ie,ae){const ge=ie.uid;this.loading[ge]&&delete this.loading[ge],ae()}removeTile(ie,ae){const ge=this.loaded,Pe=ie.uid;ge&&ge[Pe]&&delete ge[Pe],ae()}}class mu{constructor(ie){this.self=ie,this.actor=new y.ap(ie,this),this.layerIndexes={},this.availableImages={},this.availableModels={},this.isSpriteLoaded={},this.rtlPluginParsingListeners=[],this.projections={},this.defaultProjection=y.c4({name:"mercator"}),this.workerSourceTypes={vector:Fe,geojson:dl,"raster-dem":qe,"raster-array":pt,"batched-model":Tc},this.workerSources={}
24,this.self.registerWorkerSource=(ae,ge)=>{if(this.workerSourceTypes[ae])throw new Error(`Worker source with name "${ae}" already registered.`);this.workerSourceTypes[ae]=ge},this.self.registerRTLTextPlugin=ae=>{if(y.fJ.isParsed())throw new Error("RTL text plugin already registered.");y.fJ.setState({pluginStatus:y.fK.parsed,pluginURL:y.fJ.getPluginURL()}),y.fJ.applyArabicShaping=ae.applyArabicShaping,y.fJ.processBidirectionalText=ae.processBidirectionalText,y.fJ.processStyledBidirectionalText=ae.processStyledBidirectionalText;for(const ge of this.rtlPluginParsingListeners)ge(null,!0);this.rtlPluginParsingListeners=[]}}clearCaches(ie,ae,ge){delete this.layerIndexes[ie],delete this.availableImages[ie],delete this.availableModels[ie],delete this.workerSources[ie],ge()}checkIfReady(ie,ae,ge){ge()}setReferrer(ie,ae){this.referrer=ae}spriteLoaded(ie,ae){this.isSpriteLoaded[ie]||(this.isSpriteLoaded[ie]={});const{scope:ge,isLoaded:Pe}=ae;if(this.isSpriteLoaded[ie][ge]=Pe,this.workerSources[ie]&&this.workerSources[ie][ge])for(const Me in this.workerSources[ie][ge]){const Oe=this.workerSources[ie][ge][Me];for(const Je in Oe){const Ee=Oe[Je];Ee instanceof Fe&&(Ee.isSpriteLoaded=Pe,Ee.fire(new y.z("isSpriteLoaded")))}}}setImages(ie,ae,ge){this.availableImages[ie]||(this.availableImages[ie]={});const{scope:Pe,images:Me}=ae;if(this.availableImages[ie][Pe]=Me,this.workerSources[ie]&&this.workerSources[ie][Pe]){for(const Oe in this.workerSources[ie][Pe]){const Je=this.workerSources[ie][Pe][Oe];for(const Ee in Je)Je[Ee].availableImages=Me}ge()}else ge()}setModels(ie,{scope:ae,models:ge},Pe){if(this.availableModels[ie]||(this.availableModels[ie]={}),this.availableModels[ie][ae]=ge,this.workerSources[ie]&&this.workerSources[ie][ae]){for(const Me in this.workerSources[ie][ae]){const Oe=this.workerSources[ie][ae][Me];for(const Je in Oe)Oe[Je].availableModels=ge}Pe()}else Pe()}setProjection(ie,ae){this.projections[ie]=y.c4(ae)}setBrightness(ie,ae,ge){this.brightness=ae,ge()}setContextParams(ie,ae,ge){this.maxUniformBufferBindings=ae.maxBindingPoints,this.maxUniformBlockSizeDwords=ae.maxUniformBlockSizeDwords,this.disableSymbolUBO=ae.disableSymbolUBO,ge()}setWorldview(ie,ae,ge){this.worldview=ae,ge()}setLayers(ie,ae,ge){this.getLayerIndex(ie,ae.scope).replace(ae.layers,ae.options),ge()}updateLayers(ie,ae,ge){this.getLayerIndex(ie,ae.scope).update(ae.layers,ae.removedIds,ae.options),ge()}loadTile(ie,ae,ge){ae.projection=this.projections[ie]||this.defaultProjection,this.getWorkerSource(ie,ae).loadTile(ae,ge)}decodeRasterArray(ie,ae,ge){this.getWorkerSource(ie,ae).decodeRasterArray(ae,ge)}reloadTile(ie,ae,ge){ae.projection=this.projections[ie]||this.defaultProjection,this.getWorkerSource(ie,ae).reloadTile(ae,ge)}abortTile(ie,ae,ge){this.getWorkerSource(ie,ae).abortTile(ae,ge)}removeTile(ie,ae,ge){this.getWorkerSource(ie,ae).removeTile(ae,ge)}removeSource(ie,ae,ge){if(!(this.workerSources[ie]&&this.workerSources[ie][ae.scope]&&this.workerSources[ie][ae.scope][ae.type]&&this.workerSources[ie][ae.scope][ae.type][ae.source]))return;const Pe=this.workerSources[ie][ae.scope][ae.type][ae.source];delete this.workerSources[ie][ae.scope][ae.type][ae.source],Pe.removeSource!==void 0?Pe.removeSource(ae,ge):ge()}loadTileProvider(ie,ae,ge){y.aT(ae.name,ae.url).then(Pe=>{const Me=new Pe(ae.options);return this.getWorkerSource(ie,{type:ae.type,source:ae.source,scope:ae.scope},Me),Me.load&&ae.request?Me.load({request:ae.request}):null}).then(Pe=>ge(null,Pe)).catch(Pe=>ge(Pe instanceof Error?Pe:new Error(String(Pe))))}async syncRTLPluginState(ie,ae,ge){if(y.fJ.isParsed())return void ge(null,!0);if(y.fJ.isParsing())return void this.rtlPluginParsingListeners.push(ge);y.fJ.setState(ae);const Pe=y.fJ.getPluginURL();if(!y.fJ.isLoaded()||y.fJ.isParsed()||y.fJ.isParsing())ge(null,!1);else{y.fJ.setState({pluginStatus:y.fK.parsing,pluginURL:Pe});try{await import(Pe),y.fJ.isParsed()?ge(null,!0):this.rtlPluginParsingListeners.push(ge)}catch(Me){y.fJ.setState({pluginStatus:y.fK.error,pluginURL:Pe}),ge(Me);for(const Oe of this.rtlPluginParsingListeners)Oe(Me);this.rtlPluginParsingListeners=[]}}}setConfig(ie,ae){Object.assign(y.g,ae)}getAvailableImages(ie,ae){this.availableImages[ie]||(this.availableImages[ie]={});let ge=this.availableImages[ie][ae];return ge||(ge=[]),ge}getAvailableModels(ie,ae){this.availableModels[ie]||(this.availableModels[ie]={});let ge=this.availableModels[ie][ae];return ge||(ge={}),ge}getLayerIndex(ie,ae){this.layerIndexes[ie]||(this.layerIndexes[ie]={});let ge=this.layerIndexes[ie][ae];return ge||(ge=this.layerIndexes[ie][ae]=new D,ge.scope=ae),ge}getWorkerSource(ie,ae,ge){const{type:Pe,source:Me,scope:Oe}=ae,Je=this.workerSources;if(Je[ie]||(Je[ie]={}),Je[ie][Oe]||(Je[ie][Oe]={}),Je[ie][Oe][Pe]||(Je[ie][Oe][Pe]={}),this.isSpriteLoaded[ie]||(this.isSpriteLoaded[ie]={}),Je[ie][Oe][Pe][Me])ge&&(Je[ie][Oe][Pe][Me].tileProvider=ge);else{const Ee={send:(Et,vt,Le,yt,Ot,qt)=>this.actor.send(Et,vt,Le,ie,Ot,qt),scheduler:this.actor.scheduler},We=this.workerSourceTypes[Pe];if(!We)throw new Error(`Unknown worker source type "${Pe}".`);Je[ie][Oe][Pe][Me]=new We({actor:Ee,layerIndex:this.getLayerIndex(ie,Oe),availableImages:this.getAvailableImages(ie,Oe),availableModels:this.getAvailableModels(ie,Oe),isSpriteLoaded:this.isSpriteLoaded[ie][Oe],tileProvider:ge,brightness:this.brightness,worldview:this.worldview,maxUniformBufferBindings:this.maxUniformBufferBindings,maxUniformBlockSizeDwords:this.maxUniformBlockSizeDwords,disableSymbolUBO:this.disableSymbolUBO})}return Je[ie][Oe][Pe][Me]}enforceCacheSizeLimit(ie,ae){y.fL(ae)}getWorkerPerformanceMetrics(ie,ae,ge){ge(void 0,void 0)}}return y.fI(self)&&(self.worker=new mu(self)),mu}),h(["./shared"],function(a){var y="3.24.1";const E={create:"create",load:"load",fullLoad:"fullLoad"},C={mark(p){performance.mark(p)},measure(p,o,d){performance.measure(p,o,d)}};function P(p){const o=p.name.split("?")[0];return a.a(o)&&o.includes("mapbox-gl.js")?"javascript":a.a(o)&&o.includes("mapbox-gl.css")?"css":a.b(o)?"fontRange":a.c(o)?"sprite":a.i(o)?"style":a.d(o)?"tilejson":"other"}var L,D={},V=(function(){if(L)return D;function p(_){return!o(_)}function o(_){return typeof window>"u"||typeof document>"u"?"not a browser":(function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var S,T,I=new Blob([""],{type:"text/javascript"}),k=URL.createObjectURL(I);try{T=new Worker(k),S=!0}catch{S=!1}return T&&T.terminate(),URL.revokeObjectURL(k),S})()?(function(){var S=document.createElement("canvas");S.width=S.height=1;var T=S.getContext("2d");if(!T)return!1;var I=T.getImageData(0,0,1,1);return I&&I.width===S.width})()?(d[b=_&&_.failIfMajorPerformanceCaveat]===void 0&&(d[b]=(function(S){var T,I=(function(k){var F=document.createElement("canvas"),z=Object.create(p.webGLContextAttributes);return z.failIfMajorPerformanceCaveat=k,F.getContext("webgl2",z)})(S);if(!I)return!1;try{T=I.createShader(I.VERTEX_SHADER)}catch{return!1}return!(!T||I.isContextLost())&&(I.shaderSource(T,"void main() {}"),I.compileShader(T),I.getShaderParameter(T,I.COMPILE_STATUS)===!0)})(b)),d[b]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL2 support"):"insufficient Canvas/getImageData support":"insufficient worker support";var b}L=1,D.supported=p,D.notSupportedReason=o;var d={};return p.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0},D})();const U=/firefox/i,W=/macintosh/i;function $(p,o,d){const _=document.createElement(p);return o!=null&&(_.className=o),d&&d.appendChild(_),_}function Y(p,o,d){const _=document.createElementNS("http://www.w3.org/2000/svg",p);for(const b of Object.keys(o))_.setAttributeNS(null,b,String(o[b]));return d&&d.appendChild(_),_}const X=typeof document<"u"?document.documentElement&&document.documentElement.style:null,K=X&&X.userSelect!==void 0?"userSelect":"WebkitUserSelect";let ne;function fe(){X&&K&&(ne=X[K],X[K]="none")}function ye(){X&&K&&(X[K]=ne)}function ke(p){p.preventDefault(),p.stopPropagation(),window.removeEventListener("click",ke,!0)}function Fe(){window.addEventListener("click",ke,!0),window.setTimeout(()=>{window.removeEventListener("click",ke,!0)},0)}function qe(p,o){const d=p.getBoundingClientRect();return Qt(p,d,o)}function lt(p,o){const d=p.getBoundingClientRect(),_=[];for(let b=0;b<o.length;b++)_.push(Qt(p,d,o[b]));return _}function pt(p){return U.test(navigator.userAgent)&&W.test(navigator.userAgent)&&p.button===2&&p.ctrlKey?0:p.button}function Qt(p,o,d){const _=p.offsetWidth===o.width?1:p.offsetWidth/o.width;return new a.P((d.clientX-o.left)*_,(d.clientY-o.top)*_)}const Ht="01",zt=/(\.(png|jpg)\d*)(?=$)/,jt=/^.+\/v4\//,Zt=/\.[\w]+$/,Wt=/^(\/v4\/|\/(raster|rasterarrays)\/v1\/)/,en=/^access_token=(.*)$/,sn="NO_ACCESS_TOKEN";class Mn{constructor(o,d,_){this._transformRequestFn=o,this._customAccessToken=d,this._silenceAuthErrors=!!_,this._createSkuToken()}_createSkuToken(){const o=(function(){let d="";for(let _=0;_<10;_++)d+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",Ht,d].join(""),tokenExpiresAt:Date.now()+432e5}})();this._skuToken=o.token,this._skuTokenExpiresAt=o.tokenExpiresAt}_isSkuTokenExpired(){return Date.now()>this._skuTokenExpiresAt}transformRequest(o,d){return this._transformRequestFn&&this._transformRequestFn(o,d)||{url:o}}normalizeStyleURL(o,d){if(!a.e(o))return o;const _=Vn(o);return _.params.push(`sdk=js-${y}`),_.path=`/styles/v1${_.path}`,this._makeAPIURL(_,this._customAccessToken||d)}normalizeGlyphsURL(o,d){if(!a.e(o))return o;const _=Vn(o);return _.path=`/fonts/v1${_.path}`,this._makeAPIURL(_,this._customAccessToken||d)}normalizeModelURL(o,d){if(!a.e(o))return o;const _=Vn(o);return _.path=`/models/v1${_.path}`,this._makeAPIURL(_,this._customAccessToken||d)}normalizeSourceURL(o,d,_,b){if(!a.e(o))return o;const S=Vn(o);return S.path=`/v4/${S.authority}.json`,S.params.push("secure"),_&&S.params.push(`language=${_}`),b&&S.params.push(`worldview=${b}`),this._makeAPIURL(S,this._customAccessToken||d)}normalizeIconsetURL(o,d){const _=Vn(o);return a.e(o)?(_.path=`/styles/v1${_.path}/iconset.pbf`,this._makeAPIURL(_,this._customAccessToken||d)):Ln(_)}normalizeSpriteURL(o,d,_,b){const S=Vn(o);return a.e(o)?(S.path=`/styles/v1${S.path}/sprite${d}${_}`,this._makeAPIURL(S,this._customAccessToken||b)):(S.path+=`${d}${_}`,Ln(S))}normalizeTileURL(o,d,_){if(this._isSkuTokenExpired()&&this._createSkuToken(),o&&!a.e(o))return o;const b=Vn(o);b.path=b.path.replace(zt,`${d||_&&b.authority!=="raster"&&_===512?"@2x":""}${a.k.supported?".webp":"$1"}`),b.authority==="raster"?b.path=`/${a.g.RASTER_URL_PREFIX}${b.path}`:b.authority==="rasterarrays"?b.path=`/${a.g.RASTERARRAYS_URL_PREFIX}${b.path}`:b.authority==="3dtiles"?b.path=`/${a.g.TILES3D_URL_PREFIX}${b.path}`:(b.path=b.path.replace(jt,"/"),b.path=`/${a.g.TILE_URL_VERSION}${b.path}`);const S=this._customAccessToken||(function(T){for(const I of T){const k=I.match(en);if(k)return k[1]}return null})(b.params)||a.g.ACCESS_TOKEN;return a.g.REQUIRE_ACCESS_TOKEN&&S&&this._skuToken&&b.params.push(`sku=${this._skuToken}`),this._makeAPIURL(b,S)}canonicalizeTileURL(o,d){const _=Vn(o);if(!Wt.test(_.path)||!Zt.test(_.path))return o;let b="mapbox://";_.path.startsWith("/raster/v1/")?b+=`raster/${_.path.replace(`/${a.g.RASTER_URL_PREFIX}/`,"")}`:_.path.startsWith("/rasterarrays/v1/")?b+=`rasterarrays/${_.path.replace(`/${a.g.RASTERARRAYS_URL_PREFIX}/`,"")}`:b+=`tiles/${_.path.replace(`/${a.g.TILE_URL_VERSION}/`,"")}`;let S=_.params;return d&&(S=S.filter(T=>!T.match(en))),S.length&&(b+=`?${S.join("&")}`),b}canonicalizeTileset(o,d){const _=!!d&&a.e(d),b=[];for(const S of o.tiles||[])a.f(S)?b.push(this.canonicalizeTileURL(S,_)):b.push(S);return b}_makeAPIURL(o,d){const _="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",b=Vn(a.g.API_URL);if(o.protocol=b.protocol,o.authority=b.authority,o.protocol==="http"){const S=o.params.indexOf("secure");S>=0&&o.params.splice(S,1)}if(b.path!=="/"&&(o.path=`${b.path}${o.path}`),!a.g.REQUIRE_ACCESS_TOKEN)return Ln(o);if(d=d||a.g.ACCESS_TOKEN,!this._silenceAuthErrors){if(!d)throw new Error(`An API access token is required to use Mapbox GL. ${_}`);if(d[0]==="s")throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${_}`)}return o.params=o.params.filter(S=>!S.includes("access_token")),o.params.push(`access_token=${d||""}`),Ln(o)}}const xn=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Vn(p){const o=p.match(xn);if(!o)throw new Error("Unable to parse URL object");return{protocol:o[1],authority:o[2],path:o[3]||"/",params:o[4]?o[4].split("&"):[]}}function Ln(p){const o=p.params.length?`?${p.params.join("&")}`:"";return`${p.protocol}://${p.authority}${p.path}${o}`}const Yn="mapbox.eventData";function Rn(p){if(!p)return null;const o=p.split(".");if(!o||o.length!==3)return null;try{return JSON.parse(a.l(o[1]))}catch{return null}}function $t(p){return!(!a.g.EVENTS_URL||!p&&!a.g.ACCESS_TOKEN)}class fn{constructor(o){this.type=o,this.anonId=null,this.anonIdTimestamp=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(o){const d=Rn(a.g.ACCESS_TOKEN);let _="";return _=d&&d.u?a.j(d.u):a.g.ACCESS_TOKEN||"",o?`${Yn}.${o}:${_}`:`${Yn}:${_}`}fetchEventData(){const o=a.s("localStorage"),d=this.getStorageKey(),_=this.getStorageKey("uuid"),b=this.getStorageKey("uuidTimestamp");if(o)try{const S=localStorage.getItem(d);S&&(this.eventData=JSON.parse(S));const T=localStorage.getItem(_);T&&(this.anonId=T);const I=localStorage.getItem(b);I&&(this.anonIdTimestamp=Number(I));const k=Date.now()-864e5;(!this.anonIdTimestamp||this.anonIdTimestamp<k)&&this.refreshUUID()}catch{a.w("Unable to read from LocalStorage")}}refreshUUID(){this.anonId=a.u(),this.anonIdTimestamp=Date.now()}saveEventData(){const o=a.s("localStorage"),d=this.getStorageKey(),_=this.getStorageKey("uuid"),b=this.getStorageKey("uuidTimestamp"),S=this.anonId,T=this.anonIdTimestamp;if(o&&S)try{localStorage.setItem(_,S),Object.keys(this.eventData).length>=1&&localStorage.setItem(d,JSON.stringify(this.eventData)),T&&localStorage.setItem(b,T.toString())}catch{a.w("Unable to write to LocalStorage")}}processRequests(o){}postEvent(o,d,_,b){if(!a.g.EVENTS_URL)return;const S=Vn(a.g.EVENTS_URL);S.params.push(`access_token=${b||a.g.ACCESS_TOKEN||""}`);const T={event:this.type,created:new Date(o).toISOString()},I=d?Object.assign(T,d):T,k={url:Ln(S),headers:{"Content-Type":"text/plain"},body:JSON.stringify([I])};this.pendingRequest=a.p(k,F=>
24{this.pendingRequest=null,_(F),this.saveEventData(),this.processRequests(b)})}queueRequest(o,d){this.queue.push(o),this.processRequests(d)}}class yn extends fn{constructor(o){super("metrics"),o&&(this.data=o)}postMetricsEvent(o){if(!$t(o))return;this.anonId||this.fetchEventData(),a.v(this.anonId)||this.refreshUUID();const d=Object.assign({},this.data,{sessionId:this.anonId});this.queueRequest({timestamp:Date.now(),payload:d},o)}processRequests(o){if(this.pendingRequest||this.queue.length===0)return;const{timestamp:d,payload:_}=this.queue.shift();this.postEvent(d,_,()=>{},o)}}const Cn=new class extends fn{constructor(p){super("appUserTurnstile"),this._customAccessToken=p}postTurnstileEvent(p,o){$t(o)&&Array.isArray(p)&&p.some(d=>a.e(d)||a.f(d))&&this.queueRequest(Date.now(),o)}processRequests(p){if(this.pendingRequest||this.queue.length===0)return;this.anonId&&this.anonIdTimestamp&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const o=Rn(a.g.ACCESS_TOKEN),d=o?o.u:a.g.ACCESS_TOKEN;let _=d!==this.eventData.tokenU;a.v(this.anonId)||(this.refreshUUID(),_=!0);const b=this.queue.shift();if(this.eventData.lastSuccess){const S=new Date(this.eventData.lastSuccess),T=new Date(b),I=(b-this.eventData.lastSuccess)/864e5;_=_||I>=1||I<-1||S.getDate()!==T.getDate()}else _=!0;_?this.postEvent(b,{sdkIdentifier:"mapbox-gl-js",sdkVersion:y,skuId:Ht,"enabled.telemetry":!1,userId:this.anonId},S=>{S||(this.eventData.lastSuccess=b,this.eventData.tokenU=d)},p):this.processRequests()}},_n=Cn.postTurnstileEvent.bind(Cn),Bn=new class extends fn{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(p,o,d,_){this.skuToken=o,this.errorCb=_,a.g.EVENTS_URL&&(d||a.g.ACCESS_TOKEN?this.queueRequest({id:p,timestamp:Date.now()},d):this.errorCb(new Error(sn)))}processRequests(p){if(this.pendingRequest||this.queue.length===0)return;const{id:o,timestamp:d}=this.queue.shift();o&&this.success[o]||(this.anonId&&this.anonIdTimestamp||this.fetchEventData(),a.v(this.anonId)||this.refreshUUID(),this.postEvent(d,{sdkIdentifier:"mapbox-gl-js",sdkVersion:y,skuId:Ht,skuToken:this.skuToken,userId:this.anonId},_=>{_?this.errorCb(_):o&&(this.success[o]=!0)},p))}remove(){this.errorCb=null}},Be=Bn.postMapLoadEvent.bind(Bn),Xe=new class extends fn{constructor(){super("style.load"),this.eventIdPerMapInstanceMap=new Map,this.mapInstanceIdMap=new WeakMap}getMapInstanceId(p){let o=this.mapInstanceIdMap.get(p);return o||(o=a.u(),this.mapInstanceIdMap.set(p,o)),o}getEventId(p){const o=this.eventIdPerMapInstanceMap.get(p)||0;return this.eventIdPerMapInstanceMap.set(p,o+1),o}postStyleLoadEvent(p,o){const{map:d,style:_,importedStyles:b}=o;if(!$t(p))return;const S=this.getMapInstanceId(d),T={mapInstanceId:S,eventId:this.getEventId(S),style:_};b.length&&(T.importedStyles=b),this.queueRequest({timestamp:Date.now(),payload:T},p)}processRequests(p){if(this.pendingRequest||this.queue.length===0)return;const{timestamp:o,payload:d}=this.queue.shift();this.postEvent(o,d,()=>{},p)}},mt=Xe.postStyleLoadEvent.bind(Xe),kt=new yn({attributes:[{name:"maps/js/layer-animations/style-with-appearances"}]}),Vt=kt.postMetricsEvent.bind(kt),Ie=new yn({attributes:[{name:"maps/js/layer-animations/runtime-appearances"}]}),Ve=Ie.postMetricsEvent.bind(Ie),tt=new class extends fn{constructor(){super("gljs.performance")}postPerformanceEvent(p,o){$t(p)&&this.queueRequest({timestamp:Date.now(),performanceData:o},p)}processRequests(p){if(this.pendingRequest||this.queue.length===0)return;const{timestamp:o,performanceData:d}=this.queue.shift(),_=(function(b){const S=performance.getEntriesByType("resource"),T=performance.getEntriesByType("mark"),I=(function(Z){const te={};
24if(Z){for(const ee in Z)if(ee!=="other")for(const oe of Z[ee]){const se=`${ee}ResolveRangeMin`,de=`${ee}ResolveRangeMax`,pe=`${ee}RequestCount`,ce=`${ee}RequestCachedCount`;te[se]=Math.min(te[se]||1/0,oe.startTime),te[de]=Math.max(te[de]||-1/0,oe.responseEnd);const Ce=Se=>{te[Se]===void 0&&(te[Se]=0),++te[Se]};oe.transferSize!==void 0&&oe.transferSize===0&&Ce(ce),Ce(pe)}}return te})((function(Z,te){const ee={};if(Z)for(const oe of Z){const se=te(oe);ee[se]===void 0&&(ee[se]=[]),ee[se].push(oe)}return ee})(S,P)),k=window.devicePixelRatio,F=navigator.connection||navigator.mozConnection||navigator.webkitConnection,z=F?F.effectiveType:void 0,q={counters:[],metadata:[],attributes:[]},j=(Z,te,ee)=>{ee!=null&&Z.push({name:te,value:ee.toString()})};for(const Z in I)j(q.counters,Z,I[Z]);if(b.interactionRange[0]!==1/0&&b.interactionRange[1]!==-1/0&&(j(q.counters,"interactionRangeMin",b.interactionRange[0]),j(q.counters,"interactionRangeMax",b.interactionRange[1])),T)for(const Z of Object.values(E)){const te=T.find(ee=>ee.name===Z);te&&j(q.counters,Z,te.startTime)}return j(q.counters,"visibilityHidden",b.visibilityHidden),j(q.attributes,"style",(function(Z){if(Z)for(const te of Z){const ee=te.name.split("?")[0];if(a.i(ee)){const oe=ee.split("/").slice(-2);if(oe.length===2)return`mapbox://styles/${oe[0]}/${oe[1]}`}}})(S)),j(q.attributes,"terrainEnabled",b.terrainEnabled?"true":"false"),j(q.attributes,"fogEnabled",b.fogEnabled?"true":"false"),j(q.attributes,"projection",b.projection),j(q.attributes,"zoom",b.zoom),j(q.metadata,"devicePixelRatio",k),j(q.metadata,"connectionEffectiveType",z),j(q.metadata,"navigatorUserAgent",navigator.userAgent),j(q.metadata,"screenWidth",window.screen.width),j(q.metadata,"screenHeight",window.screen.height),j(q.metadata,"windowWidth",window.innerWidth),j(q.metadata,"windowHeight",window.innerHeight),j(q.metadata,"mapWidth",b.width/k),j(q.metadata,"mapHeight",b.height/k),j(q.metadata,"webglRenderer",b.renderer),j(q.metadata,"webglVendor",b.vendor),j(q.metadata,"sdkVersion",y),j(q.metadata,"sdkIdentifier","mapbox-gl-js"),q})(d);for(const b of _.metadata);for(const b of _.counters);for(const b of _.attributes);this.postEvent(o,_,()=>{},p)}},Rt=tt.postPerformanceEvent.bind(tt),Ut=new class extends fn{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(p,o,d,_){if(!a.g.API_URL||!a.g.SESSION_PATH)return;const b=Vn(a.g.API_URL+a.g.SESSION_PATH);b.params.push(`sku=${o||""}`),b.params.push(`access_token=${_||a.g.ACCESS_TOKEN||""}`);const S={url:Ln(b),headers:{"Content-Type":"text/plain"}};this.pendingRequest=a.h(S,T=>{this.pendingRequest=null,d(T),this.saveEventData(),this.processRequests(_)})}getSessionAPI(p,o,d,_){this.skuToken=o,this.errorCb=_,a.g.EVENTS_URL&&a.g.SESSION_PATH&&a.g.API_URL&&(d||a.g.ACCESS_TOKEN?this.queueRequest({id:p,timestamp:Date.now()},d):this.errorCb(new Error(sn)))}processRequests(p){if(this.pendingRequest||this.queue.length===0)return;const{id:o,timestamp:d}=this.queue.shift();o&&this.success[o]||this.getSession(d,this.skuToken,_=>{_?this.errorCb(_):o&&(this.success[o]=!0)},p)}remove(){this.errorCb=null}},nn=Ut.getSessionAPI.bind(Ut),st=new Set;function Lt(p,o){o?st.add(p):st.delete(p)}class mn{constructor(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps=new Set,this._updatedImages={}}isDirty(){return this._changed}setDirty(){this._changed=!0}getUpdatedSourceCaches(){return this._updatedSourceCaches}updateSourceCache(o,d){this._updatedSourceCaches[o]=d,this.setDirty()}discardSourceCacheUpdate(o){delete this._updatedSourceCaches[o]}updateLayer(o){const d=o.scope;this._updatedLayers[d]=this._updatedLayers[d]||new Set,this._updatedLayers[d].add(o.id),this.setDirty()}removeLayer(o){const d=o.scope;this._removedLayers[d]=this._removedLayers[d]||{},this._updatedLayers[d]=this._updatedLayers[d]||new Set,this._removedLayers[d][o.id]=o,this._updatedLayers[d].delete(o.id),this._updatedPaintProps.delete(o.fqid),this.setDirty()}getRemovedLayer(o){return this._removedLayers[o.scope]?this._removedLayers[o.scope][o.id]:null}discardLayerRemoval(o){this._removedLayers[o.scope]&&delete this._removedLayers[o.scope][o.id]}getLayerUpdatesByScope(){const o={};for(const d in this._updatedLayers)o[d]=o[d]||{},o[d].updatedIds=Array.from(this._updatedLayers[d].values());for(const d in this._removedLayers)o[d]=o[d]||{},o[d].removedIds=Object.keys(this._removedLayers[d]);return o}getUpdatedPaintProperties(){return this._updatedPaintProps}updatePaintProperties(o){this._updatedPaintProps.add(o.fqid),this.setDirty()}getUpdatedImages(o){return this._updatedImages[o]?Array.from(this._updatedImages[o].values()):[]}updateImage(o,d){this._updatedImages[d]=this._updatedImages[d]||new Set,this._updatedImages[d].add(a.I.toString(o)),this.setDirty()}resetUpdatedImages(o){this._updatedImages[o]&&this._updatedImages[o].clear()}reset(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps.clear(),this._updatedImages={}}}function Hn(p){const{userImage:o}=p;return!!(o&&o.render&&o.render())&&(p.data.replace(new Uint8Array(o.data.buffer)),!0)}const ir=new a.C(0,0,0);function hr(p,o,d){p===1&&o.icons.push((function(_,b){return(function(S){if(S.usvg_tree.height||(S.usvg_tree.height=S.usvg_tree.width),!S.metadata)return S;const{metadata:T}=S;
24if(T.content_area){const{content_area:I}=T;I.left==null&&(I.left=0),I.top==null&&(I.top=I.left),I.width==null&&(I.width=S.usvg_tree.width),I.height==null&&(I.height=I.width)}if(T.text_placeholder){const{text_placeholder:I}=T;I.top==null&&(I.top=I.left),I.height==null&&(I.height=I.width)}return T.stretch_x&&T.stretch_x.length&&Sr(T,"x"),T.stretch_y&&T.stretch_y.length&&Sr(T,"y"),S})(_.readFields(zn,{name:void 0},b))})(d,d.readVarint()+d.pos))}function Sr(p,o){const d=[],_=p[`stretch_${o}`];let b=null;for(let S=0;S<_.length;S++)b===null?b=d.length===0?_[0]:d.at(-1)[1]+_[S]:(d.push([b,b+_[S]]),b=null);p[`stretch_${o}_areas`]=d}function zn(p,o,d){p===1?o.name=d.readString():p===2?o.metadata=(function(_,b){return _.readFields(cr,{stretch_x:null,stretch_y:null,stretch_x_areas:null,stretch_y_areas:null,variables:[]},b)})(d,d.readVarint()+d.pos):p===3&&(o.usvg_tree=(function(_,b){return _.readFields(Lr,{width:20,children:[],linear_gradients:[],radial_gradients:[],clip_paths:[],masks:[]},b)})(d,d.readVarint()+d.pos),o.data="usvg_tree")}function cr(p,o,d){p===1?o.stretch_x=d.readPackedVarint():p===2?o.stretch_y=d.readPackedVarint():p===3?o.content_area=Un(d,d.readVarint()+d.pos):p===4?o.variables.push((function(_,b){return _.readFields(ko,{name:void 0},b)})(d,d.readVarint()+d.pos)):p===5&&(o.text_placeholder=Un(d,d.readVarint()+d.pos))}function Un(p,o){return p.readFields(Ur,{},o)}function Ur(p,o,d){p===1?o.left=d.readVarint():p===2?o.width=d.readVarint():p===3?o.top=d.readVarint():p===4&&(o.height=d.readVarint())}function ko(p,o,d){p===1?o.name=d.readString():p===2&&(o.rgb_color=Js(d.readVarint()),o.value="rgb_color")}function Lr(p,o,d){p===1?o.width=o.height=d.readVarint():p===2?o.height=d.readVarint():p===3?o.children.push(ar(d,d.readVarint()+d.pos)):p===4?o.linear_gradients.push((function(_,b){return _.readFields(ud,{spread_method:1,stops:[],x1:0,y1:0,x2:1,y2:0},b)})(d,d.readVarint()+d.pos)):p===5?o.radial_gradients.push((function(_,b){return _.readFields(Eh,{spread_method:1,stops:[],cx:.5,cy:.5,r:.5,fx:.5,fy:.5,fr:0},b)})(d,d.readVarint()+d.pos)):p===7?o.clip_paths.push((function(_,b){return _.readFields(pu,{children:[]},b)})(d,d.readVarint()+d.pos)):p===8&&o.masks.push((function(_,b){const S=_.readFields(St,{left:0,width:20,mask_type:1,children:[]},b);return S.height==null&&(S.height=S.width),S.top==null&&(S.top=S.left),S})(d,d.readVarint()+d.pos))}function ar(p,o){return p.readFields(nr,{},o)}function nr(p,o,d){p===1?(o.group=(function(_,b){return _.readFields(ro,{opacity:255,children:[]},b)})(d,d.readVarint()+d.pos),o.node="group"):p===2&&(o.path=(function(_,b){return _.readFields(xc,{paint_order:1,commands:[],step:1,diffs:[],rule:1},b)})(d,d.readVarint()+d.pos),o.node="path")}function ro(p,o,d){p===1?o.transform=ms(d,d.readVarint()+d.pos):p===2?o.opacity=d.readVarint():p===5?o.clip_path_idx=d.readVarint():p===6?o.mask_idx=d.readVarint():p===7&&o.children.push(ar(d,d.readVarint()+d.pos))}function ms(p,o){return p.readFields(Ks,{sx:1,ky:0,kx:0,sy:1,tx:0,ty:0},o)}function Ks(p,o,d){p===1?o.sx=d.readFloat():p===2?o.ky=d.readFloat():p===3?o.kx=d.readFloat():p===4?o.sy=d.readFloat():p===5?o.tx=d.readFloat():p===6&&(o.ty=d.readFloat())}function xc(p,o,d){p===1?o.fill=(function(_,b){return _.readFields(wc,{rgb_color:ir,paint:"rgb_color",opacity:255},b)})(d,d.readVarint()+d.pos):p===2?o.stroke=(function(_,b){return _.readFields(hu,{rgb_color:ir,paint:"rgb_color",dasharray:[],dashoffset:0,miterlimit:4,opacity:255,width:1,linecap:1,linejoin:1},b)})(d,d.readVarint()+d.pos):p===3?o.paint_order=d.readVarint():p===5?d.readPackedVarint(o.commands):p===6?o.step=d.readFloat():p===7?d.readPackedSVarint(o.diffs):p===8&&(o.rule=d.readVarint())}function wc(p,o,d){p===1?(o.rgb_color=Js(d.readVarint()),o.paint="rgb_color"):p===2?(o.linear_gradient_idx=d.readVarint(),o.paint="linear_gradient_idx"):p===3?(o.radial_gradient_idx=d.readVarint(),o.paint="radial_gradient_idx"):p===5&&(o.opacity=d.readVarint())}function Js(p){return new a.C((p>>16&255)/255,(p>>8&255)/255,(255&p)/255,1)}function hu(p,o,d){p===1?(o.rgb_color=Js(d.readVarint()),o.paint="rgb_color"):p===2?(o.linear_gradient_idx=d.readVarint(),o.paint="linear_gradient_idx"):p===3?(o.radial_gradient_idx=d.readVarint(),o.paint="radial_gradient_idx"):p===5?d.readPackedFloat(o.dasharray):p===6?o.dashoffset=d.readFloat():p===7?o.miterlimit=d.readFloat():p===8?o.opacity=d.readVarint():p===9?o.width=d.readFloat():p===10?o.linecap=d.readVarint():p===11&&(o.linejoin=d.readVarint())}function ud(p,o,d){p===1?o.transform=ms(d,d.readVarint()+d.pos):p===2?o.spread_method=d.readVarint():p===3?o.stops.push(Sc(d,d.readVarint()+d.pos)):p===4?o.x1=d.readFloat():p===5?o.y1=d.readFloat():p===6?o.x2=d.readFloat():p===7&&(o.y2=d.readFloat())}function Sc(p,o){return p.readFields(fu,{offset:0,opacity:255,rgb_color:ir},o)}function fu(p,o,d){p===1?o.offset=d.readFloat():p===2?o.opacity=d.readVarint():p===3&&(o.rgb_color=Js(d.readVarint()))}function Eh(p,o,d){p===1?o.transform=ms(d,d.readVarint()+d.pos):p===2?o.spread_method=d.readVarint():p===3?o.stops.push(Sc(d,d.readVarint()+d.pos)):p===4?o.cx=d.readFloat():p===5?o.cy=d.readFloat():p===6?o.r=d.readFloat():p===7?o.fx=d.readFloat():p===8?o.fy=d.readFloat():p===9&&(o.fr=d.readFloat())}function pu(p,o,d){p===1?o.transform=ms(d,d.readVarint()+d.pos):p===2?o.clip_path_idx=d.readVarint():p===3&&o.children.push(ar(d,d.readVarint()+d.pos))}function St(p,o,d){p===1?o.left=o.top=d.readFloat():p===2?o.width=o.height=d.readFloat():p===3?o.top=d.readFloat():p===4?o.height=d.readFloat():p===5?o.mask_type=d.readVarint():p===6?o.mask_idx=d.readVarint():p===7&&o.children.push(ar(d,d.readVarint()+d.pos))}class dl{static calculate(o={},d=[]){const _=new Map,b=new Map;if(Object.keys(o).length===0)return _;d.forEach(S=>{b.set(S.name,S.rgb_color||new a.C(0,0,0))});for(const[S,T]of Object.entries(o))b.has(S)?_.set(b.get(S).toString(),T):console.warn(`Ignoring unknown image variable "${S}"`);return _}}function Nl(p,o=255,d){const _=d.get(p.toString())||p;if(o===255)return _.toString();const b=_.clone();return b.a*=o/255,b.toString()}const Tc=[];let mu=0;function Ge(p,o){if(mu>=Tc.length){const _=a.r()?new OffscreenCanvas(p,o):document.createElement("canvas");Tc.push(_.getContext("2d",{willReadFrequently:!0}))}const d=Tc[mu++];return d.canvas.width=p,d.canvas.height=o,d}function ie(){mu--}function ae(p,o,d,_,b){for(const S of _.children)ge(p,o,d,S,b)}function ge(p,o,d,_,b){_.group?(p.save(),(function(S,T,I,k,F){const z=k.mask_idx!=null?I.masks[k.mask_idx]:null,q=k.clip_path_idx!=null?I.clip_paths[k.clip_path_idx]:null;if(k.transform&&(T=Le(k.transform).preMultiplySelf(T)),!(function(Z,te,ee){return Z.opacity!==255||te||ee})(k,q!=null,z!=null))return void ae(S,T,I,k,F);const j=Ge(S.canvas.width,S.canvas.height);ae(j,T,I,k,F),q&&Et(j,T,I,q),z&&vt(j,T,I,z,F),S.globalAlpha=k.opacity/255,S.drawImage(j.canvas,0,0),ie()}
24)(p,o,d,_.group,b),p.restore()):_.path&&(p.save(),(function(S,T,I,k,F){S.setTransform(T),k.paint_order===1?(Pe(S,I,k,F),Oe(S,I,k,F)):(Oe(S,I,k,F),Pe(S,I,k,F))})(p,o,d,_.path,b),p.restore())}function Pe(p,o,d,_){const b=d.fill;if(!b)return;const S=b.opacity/255;switch(p.save(),p.beginPath(),yt(d,p),b.paint){case"rgb_color":p.fillStyle=Nl(b.rgb_color,b.opacity,_);break;case"linear_gradient_idx":{const T=o.linear_gradients[b.linear_gradient_idx];T.transform&&p.setTransform(Le(T.transform).preMultiplySelf(p.getTransform())),p.fillStyle=Je(p,T,S,_);break}case"radial_gradient_idx":{const T=o.radial_gradients[b.radial_gradient_idx];T.transform&&p.setTransform(Le(T.transform).preMultiplySelf(p.getTransform())),p.fillStyle=Ee(p,T,S,_)}}p.fill(Me(d)),p.restore()}function Me(p){return p.rule===1?"nonzero":p.rule===2?"evenodd":void 0}function Oe(p,o,d,_){const b=d.stroke;if(!b)return;const S=Ot(d);p.lineWidth=b.width,p.miterLimit=b.miterlimit,p.setLineDash(b.dasharray),p.lineDashOffset=b.dashoffset;const T=b.opacity/255;switch(b.paint){case"rgb_color":p.strokeStyle=Nl(b.rgb_color,b.opacity,_);break;case"linear_gradient_idx":p.strokeStyle=Je(p,o.linear_gradients[b.linear_gradient_idx],T,_,!0);break;case"radial_gradient_idx":p.strokeStyle=Ee(p,o.radial_gradients[b.radial_gradient_idx],T,_,!0)}switch(b.linejoin){case 2:case 1:p.lineJoin="miter";break;case 3:p.lineJoin="round";break;case 4:p.lineJoin="bevel"}switch(b.linecap){case 1:p.lineCap="butt";break;case 2:p.lineCap="round";break;case 3:p.lineCap="square"}p.stroke(S)}function Je(p,o,d,_,b=!1){if(o.stops.length===1){const j=o.stops[0];return Nl(j.rgb_color,j.opacity*d,_)}const{x1:S,y1:T,x2:I,y2:k}=o;let F=new DOMPoint(S,T),z=new DOMPoint(I,k);if(b){const j=Le(o.transform);F=j.transformPoint(F),z=j.transformPoint(z)}const q=p.createLinearGradient(F.x,F.y,z.x,z.y);for(const j of o.stops)q.addColorStop(j.offset,Nl(j.rgb_color,j.opacity*d,_));return q}function Ee(p,o,d,_,b=!1){if(o.stops.length===1){const se=o.stops[0];return Nl(se.rgb_color,se.opacity*d,_)}const S=Le(o.transform),{fx:T,fy:I,fr:k,cx:F,cy:z,r:q}=o;let j=new DOMPoint(T,I),Z=new DOMPoint(F,z),te=k,ee=q;if(b){j=S.transformPoint(j),Z=S.transformPoint(Z);const se=(S.a+S.d)/2;te=k*se,ee=o.r*se}const oe=p.createRadialGradient(j.x,j.y,te,Z.x,Z.y,ee);for(const se of o.stops)oe.addColorStop(se.offset,Nl(se.rgb_color,se.opacity*d,_));return oe}function We(p,o,d,_){const b=_.transform?Le(_.transform).preMultiplySelf(o):o,S=Ge(p.canvas.width,p.canvas.height);for(const I of _.children)if(I.group)We(S,b,d,I.group);else if(I.path){const k=I.path,F=new Path2D;F.addPath(Ot(k),b),S.fill(F,Me(k))}const T=_.clip_path_idx!=null?d.clip_paths[_.clip_path_idx]:null;T&&Et(S,b,d,T),p.globalCompositeOperation="source-over",p.drawImage(S.canvas,0,0),ie()}function Et(p,o,d,_){const b=Ge(p.canvas.width,p.canvas.height);We(b,o,d,_),p.globalCompositeOperation="destination-in",p.drawImage(b.canvas,0,0),ie()}function vt(p,o,d,_,b){if(_.children.length===0)return;const S=_.mask_idx!=null?d.masks[_.mask_idx]:null;S&&vt(p,o,d,S,b);const T=p.canvas.width,I=p.canvas.height,k=Ge(T,I),F=_.width,z=_.height,q=_.left,j=_.top,Z=new Path2D,te=new Path2D;te.rect(q,j,F,z),Z.addPath(te,o),k.clip(Z);for(const se of _.children)ge(k,o,d,se,b);const ee=k.getImageData(0,0,T,I),oe=ee.data;if(_.mask_type===1)for(let se=0;se<oe.length;se+=4)oe[se+3]=oe[se+3]/255*(.2126*oe[se]+.7152*oe[se+1]+.0722*oe[se+2]);k.putImageData(ee,0,0),p.globalCompositeOperation="destination-in",p.drawImage(k.canvas,0,0),ie()}function Le(p){return p?new DOMMatrix([p.sx,p.ky,p.kx,p.sy,p.tx,p.ty]):new DOMMatrix}function yt(p,o){const d=p.step;let _=p.diffs[0]*d,b=p.diffs[1]*d;o.moveTo(_,b);for(let S=0,T=2;S<p.commands.length;S++)switch(p.commands[S]){case 1:_+=p.diffs[T++]*d,b+=p.diffs[T++]*d,o.moveTo(_,b);break;case 2:_+=p.diffs[T++]*d,b+=p.diffs[T++]*d,o.lineTo(_,b);break;case 3:{const I=_+p.diffs[T++]*d,k=b+p.diffs[T++]*d;_=I+p.diffs[T++]*d,b=k+p.diffs[T++]*d,o.quadraticCurveTo(I,k,_,b);break}case 4:{const I=_+p.diffs[T++]*d,k=b+p.diffs[T++]*d,F=I+p.diffs[T++]*d,z=k+p.diffs[T++]*d;_=F+p.diffs[T++]*d,b=z+p.diffs[T++]*d,o.bezierCurveTo(I,k,F,z,_,b);break}case 5:o.closePath();break}return o}function Ot(p){return yt(p,new Path2D)}class qt{constructor(){this.cacheMap=new Map,this.cacheDependenciesMap=new Map}static _getImage(o){return new a.q(o,o.data)}getFromCache(o,d,_){return this.cacheMap.has(_)||this.cacheMap.set(_,new a.L(150)),this.cacheMap.get(_).get(a.t(o.toString(),d))}setInCache(o,d,_,b){this.cacheDependenciesMap.has(b)||this.cacheDependenciesMap.set(b,new Map),this.cacheMap.has(b)||this.cacheMap.set(b,new a.L(150));const S=this.cacheDependenciesMap.get(b),T=a.t(o.id.toString(),_);S.get(T)||S.set(T,new Set);const I=this.cacheMap.get(b),k=o.toString();S.get(T).add(k),I.put(a.t(o.toString(),_),d)}removeImagesFromCacheByIds(o,d,_=0){if(!this.cacheMap.has(_)||!this.cacheDependenciesMap.has(_))return;const b=this.cacheMap.get(_),S=this.cacheDependenciesMap.get(_);for(const T of o){const I=a.t(T.toString(),d);if(S.has(I)){for(const k of S.get(I))b.delete(k);S.delete(I)}}}rasterize(o,d,_,b){const S=this.getFromCache(o,_,b);if(S)return S.clone();const T=(function(k,F){const z=dl.calculate(F.params,k.metadata?k.metadata.variables:[]),q=k.usvg_tree,j=q.width,Z=q.height,te=Math.max(1,Math.round(j*F.sx)),ee=Math.max(1,Math.round(Z*F.sy)),oe=new DOMMatrix([te/j,0,0,ee/Z,0,0]),se=Ge(te,ee);ae(se,oe,q,q,z);const de=se.getImageData(0,0,te,ee);return ie(),de})(d.icon,o),I=qt._getImage(T);return this.setInCache(o,I,_,b),I.clone()}}class cn extends a.E{constructor(o){super(),this.imageProviders=new Map,this.images=new Map,this.updatedImages=new Map,this.callbackDispatchedThisFrame=new Map,this.imageVersions=new Map,this.loaded=new Map,this.requestors=[],this.patterns=new Map,this.patternsInFlight=new Set,this.atlasImage=new Map,this.atlasTexture=new Map,this.imageAtlasCache=new a.x,this.dirty=!0,this.spriteFormat=o,this.imageRasterizer=new qt}addScope(o){this.loaded.set(o,!1),this.imageProviders.set(o,new Map),this.images.set(o,new Map),this.updatedImages.set(o,new Set),this.callbackDispatchedThisFrame.set(o,new Set),this.imageVersions.set(o,new Map),this.patterns.set(o,new Map),this.atlasImage.set(o,new a.q({width:1,height:1}))}removeScope(o){this.loaded.delete(o),this.imageProviders.delete(o),this.images.delete(o),this.updatedImages.delete(o),this.callbackDispatchedThisFrame.delete(o),this.imageVersions.delete(o),this.patterns.delete(o),this.atlasImage.delete(o);const d=this.atlasTexture.get(o);d&&(d.destroy(),this.atlasTexture.delete(o))}addImageProvider(o,d){this.imageProviders.has(d)||this.imageProviders.set(d,new Map),this.imageProviders.get(d).set(o.id,o)}removeImageProvider(o,d){this.imageProviders.has(d)&&this.imageProviders.get(d).delete(o)}getPendingImageProviders(){const o=[];for(const d of this.imageProviders.values())for(const _ of d.values())_.hasPendingRequests()&&o.push(_);return o}isLoaded(){for(const o of this.loaded.keys())if(!this.loaded.get(o))return!1;return!0}setLoaded(o,d){if(this.loaded.get(d)!==o&&(this.loaded.set(d,o),o)){for(const{ids:_,callback:b}of this.requestors)this._notify(_,d,b);this.requestors=[]}}
24hasImage(o,d){return!!this.getImage(o,d)}getImage(o,d){return this.images.get(d).get(o.toString())}addImage(o,d,_){if(this._validate(o,_)){this.images.get(d).set(o.toString(),_);const b=this.imageVersions.get(d),S=b.get(o.toString())||0;b.set(o.toString(),S+1)}}_validate(o,d){let _=!0;return this._validateStretch(d.stretchX,d.data&&d.data.width)||(this.fire(new a.y(new Error(`Image "${o.name}" has invalid "stretchX" value`))),_=!1),this._validateStretch(d.stretchY,d.data&&d.data.height)||(this.fire(new a.y(new Error(`Image "${o.name}" has invalid "stretchY" value`))),_=!1),this._validateContent(d.content,d)||(this.fire(new a.y(new Error(`Image "${o.name}" has invalid "content" value`))),_=!1),_}_validateStretch(o,d){if(!o)return!0;let _=0;for(const b of o){if(b[0]<_||b[1]<b[0]||d<b[1])return!1;_=b[1]}return!0}_validateContent(o,d){return o?o.length!==4||!d.usvg&&(o[0]<0||d.data.width<o[0]||o[1]<0||d.data.height<o[1]||o[2]<0||d.data.width<o[2]||o[3]<0||d.data.height<o[3])?!1:!(o[2]<o[0]||o[3]<o[1]):!0}updateImage(o,d,_){const b=this.images.get(d).get(o.toString());_.version=b.version+1,this.images.get(d).set(o.toString(),_),this.updatedImages.get(d).add(o);const S=this.imageVersions.get(d),T=S.get(o.toString())||0;S.set(o.toString(),T+1),this.removeFromImageRasterizerCache(o,d)}clearUpdatedImages(o){this.updatedImages.get(o).clear()}removeFromImageRasterizerCache(o,d){this.spriteFormat!=="raster"&&this.imageRasterizer.removeImagesFromCacheByIds([o],d)}removeImage(o,d){const _=this.images.get(d),b=_.get(o.toString());_.delete(o.toString());const S=this.imageVersions.get(d),T=S.get(o.toString())||0;S.set(o.toString(),T+1),this.patterns.get(d).delete(o.toString()),this.removeFromImageRasterizerCache(o,d),b.userImage&&b.userImage.onRemove&&b.userImage.onRemove()}listImages(o){return Array.from(this.images.get(o).keys()).map(d=>a.I.from(d))}getImageVersions(o){const d=this.imageVersions.get(o);if(d)return d}getImages(o,d,_){const b=[],S=[],T=this.imageProviders.get(d);for(const z of o){if(!z.iconsetId){b.push(z);continue}const q=T.get(z.iconsetId);q&&(this.getImage(z,d)?S.push(z):q.addPendingRequest(z))}if(b.length===0)return void this._notify(S,d,_);let I=!0;const k=!!this.loaded.get(d),F=this.images.get(d);if(!k)for(const z of b)F.has(z.toString())||(I=!1);k||I?this._notify(b,d,_):this.requestors.push({ids:b,scope:d,callback:_})}rasterizeImages(o,d){const _=new Map,{iconTasks:b,patternTasks:S,scope:T}=o;for(const I of[b,S])for(const[k,F]of I.entries()){const z=this.getImage(F.id,T);z&&_.set(k,{image:z,imageVariant:F})}d(null,this._rasterizeImages(T,_))}_rasterizeImages(o,d){const _=new Map;for(const[b,{image:S,imageVariant:T}]of d.entries())_.set(b,this.imageRasterizer.rasterize(T,S,o,0));return _}getUpdatedImages(o){return this.updatedImages.get(o)||new Set}_notify(o,d,_){const b=this.images.get(d),S=new Map;for(const T of o){if(!b.get(T.toString())){if(T.iconsetId)continue;this.fire(new a.z("styleimagemissing",{id:T.name}))}const I=b.get(T.toString());if(!I){a.w(`Image "${T.name}" 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.`);continue}const k={data:I.usvg?null:I.data.clone(),pixelRatio:I.pixelRatio,sdf:I.sdf,usvg:I.usvg,stretchX:I.stretchX,stretchY:I.stretchY,content:I.content,hasRenderCallback:!!(I.userImage&&I.userImage.render)};I.usvg&&Object.assign(k,{width:I.icon.usvg_tree.width,height:I.icon.usvg_tree.height}),S.set(a.I.toString(T),k)}_(null,{images:S,versions:this.getImageVersions(d)})}getPixelSize(o){const{width:d,height:_}=this.atlasImage.get(o);return{width:d,height:_}}getPattern(o,d,_){const b=o.toString(),S=this.patterns.get(d),T=S.get(b),I=this.getImage(o,d);if(!I)return null;if(T){if(T.position.version===I.version)return T.position;T.position.version=I.version}else{if(I.usvg&&!I.data){const k=this.getPatternInFlightId(b,d);if(this.patternsInFlight.has(k))return null;this.patternsInFlight.add(k);const F=new a.A(o).scaleSelf(a.o.devicePixelRatio),z=new Map([[F.toString(),{image:I,imageVariant:F}]]),q=this._rasterizeImages(d,z);return this.storePatternImage(F,d,I,_,q),null}this.storePattern(o,d,I)}return this._updatePatternAtlas(d,_),S.get(b).position}getPatternInFlightId(o,d){return a.t(o,d)}hasPatternsInFlight(){return this.patternsInFlight.size!==0}storePatternImage(o,d,_,b,S){const T=o.toString(),I=S?S.get(T):void 0;I&&(_.data=I,this.storePattern(o.id,d,_),this._updatePatternAtlas(d,b),this.patternsInFlight.delete(this.getPatternInFlightId(o.id.toString(),d)))}storePattern(o,d,_){const b={w:_.data.width+2*a.B,h:_.data.height+2*a.B,x:0,y:0},S=new a.D(b,_,a.B);this.patterns.get(d).set(o.toString(),{bin:b,position:S}
24)}destroyAtlasTextures(){for(const o of this.atlasTexture.values())o&&o.destroy();this.atlasTexture.clear()}bind(o,d){const _=o.gl;let b=this.atlasTexture.get(d);b?this.dirty&&(b.update(this.atlasImage.get(d)),this.dirty=!1):(b=new a.T(o,this.atlasImage.get(d),_.RGBA8),this.atlasTexture.set(d,b)),b.bind(_.LINEAR,_.CLAMP_TO_EDGE)}_updatePatternAtlas(o,d){const _=this.patterns.get(o),b=Array.from(_.values()).map(({bin:F})=>F),{w:S,h:T}=a.F(b),I=this.atlasImage.get(o);I.resize({width:S||1,height:T||1});const k=this.images.get(o);for(const[F,{bin:z,position:q}]of _.entries()){let j=q.padding;const Z=z.x+j,te=z.y+j,ee=k.get(F).data,oe=ee.width,se=ee.height;j=j>1?j-1:j,a.q.copy(ee,I,{x:0,y:0},{x:Z,y:te},{width:oe,height:se},d),a.q.copy(ee,I,{x:0,y:se-j},{x:Z,y:te-j},{width:oe,height:j},d),a.q.copy(ee,I,{x:0,y:0},{x:Z,y:te+se},{width:oe,height:j},d),a.q.copy(ee,I,{x:oe-j,y:0},{x:Z-j,y:te},{width:j,height:se},d),a.q.copy(ee,I,{x:0,y:0},{x:Z+oe,y:te},{width:j,height:se},d),a.q.copy(ee,I,{x:oe-j,y:se-j},{x:Z-j,y:te-j},{width:j,height:j},d),a.q.copy(ee,I,{x:0,y:se-j},{x:Z+oe,y:te-j},{width:j,height:j},d),a.q.copy(ee,I,{x:0,y:0},{x:Z+oe,y:te+se},{width:j,height:j},d),a.q.copy(ee,I,{x:oe-j,y:0},{x:Z-j,y:te+se},{width:j,height:j},d)}this.dirty=!0}beginFrame(){for(const o of this.images.keys())this.callbackDispatchedThisFrame.set(o,new Set)}dispatchRenderCallbacks(o,d){const _=this.images.get(d);for(const b of o){if(this.callbackDispatchedThisFrame.get(d).has(b.toString()))continue;this.callbackDispatchedThisFrame.get(d).add(b.toString());const S=_.get(b.toString());Hn(S)&&this.updateImage(b,d,S)}}}class ht{constructor(o,d,_,b){this.message=(o?`${o}: `:"")+_,b&&(this.identifier=b),d!=null&&d.__line__&&(this.line=d.__line__)}}class ln extends ht{}function Kn(p){const o=p.value,d=p.valueSpec,_=p.style,b=p.styleSpec,S=p.key,T=p.arrayElementValidator||wi;if(!Array.isArray(o))return[new ht(S,o,`array expected, ${a.J(o)} found`)];if(d.length&&o.length!==d.length)return[new ht(S,o,`array length ${d.length} expected, length ${o.length} found`)];if(d["min-length"]&&o.length<d["min-length"])return[new ht(S,o,`array length at least ${d["min-length"]} expected, length ${o.length} found`)];let I={type:d.value,values:d.values,minimum:d.minimum,maximum:d.maximum,function:void 0};b.$version<7&&(I.function=d.function),a.G(d.value)&&(I=d.value);let k=[];for(let F=0;F<o.length;F++)k=k.concat(T({array:o,arrayIndex:F,value:o[F],valueSpec:I,style:_,styleSpec:b,key:`${S}[${F}]`},!0));return k}function Hr(p){const o=p.key,d=p.value,_=p.valueSpec;if(!a.K(d))return[new ht(o,d,`number expected, ${a.J(d)} found`)];if(d!=d)return[new ht(o,d,"number expected, NaN found")];if("minimum"in _){let b=_.minimum;if(Array.isArray(_.minimum)&&(b=_.minimum[p.arrayIndex]),d<b)return[new ht(o,d,`${d} is less than the minimum value ${b}`)]}if("maximum"in _){let b=_.maximum;if(Array.isArray(_.maximum)&&(b=_.maximum[p.arrayIndex]),d>b)return[new ht(o,d,`${d} is greater than the maximum value ${b}`)]}return[]}function ti(p){const o=p.key,d=p.value;if(!a.G(d))return[new ht(o,d,`object expected, ${a.J(d)} found`)];const _=p.valueSpec,b=a.H(d.type);let S,T,I,k={};const F=b!=="categorical"&&d.property===void 0,z=!F,q=(function(ee){const oe=ee.stops;return Array.isArray(oe)&&Array.isArray(oe[0])&&a.G(oe[0][0])})(d),j=rs({key:p.key,value:p.value,valueSpec:p.styleSpec.function,style:p.style,styleSpec:p.styleSpec,objectElementValidators:{stops:function(ee){if(b==="identity")return[new ht(ee.key,ee.value,'identity function may not have a "stops" property')];let oe=[];const se=ee.value;return oe=oe.concat(Kn({key:ee.key,value:se,valueSpec:ee.valueSpec,style:ee.style,styleSpec:ee.styleSpec,arrayElementValidator:Z})),Array.isArray(se)&&se.length===0&&oe.push(new ht(ee.key,se,"array must have at least one stop")),oe},default:function(ee){return wi({key:ee.key,value:ee.value,valueSpec:_,style:ee.style,styleSpec:ee.styleSpec})}}});return b==="identity"&&F&&j.push(new ht(p.key,p.value,'missing required property "property"')),b==="identity"||d.stops||j.push(new ht(p.key,p.value,'missing required property "stops"')),b==="exponential"&&_.expression&&!a.M(_)&&j.push(new ht(p.key,p.value,"exponential functions not supported")),p.styleSpec.$version>
24=8&&(z&&!a.N(_)?j.push(new ht(p.key,p.value,"property functions not supported")):F&&!a.O(_)&&j.push(new ht(p.key,p.value,"zoom functions not supported"))),b!=="categorical"&&!q||d.property!==void 0||j.push(new ht(p.key,p.value,'"property" property is required')),j;function Z(ee){let oe=[];const se=ee.value,de=ee.key;if(!Array.isArray(se))return[new ht(de,se,`array expected, ${a.J(se)} found`)];if(se.length!==2)return[new ht(de,se,`array length 2 expected, length ${se.length} found`)];if(q){if(!a.G(se[0]))return[new ht(de,se,`object expected, ${a.J(se[0])} found`)];const pe=se[0];if(pe.zoom===void 0)return[new ht(de,se,"object stop key must have zoom")];if(pe.value===void 0)return[new ht(de,se,"object stop key must have value")];const ce=a.H(pe.zoom);if(typeof ce!="number")return[new ht(de,pe.zoom,"stop zoom values must be numbers")];if(I&&I>ce)return[new ht(de,pe.zoom,"stop zoom values must appear in ascending order")];ce!==I&&(I=ce,T=void 0,k={}),oe=oe.concat(rs({key:`${de}[0]`,value:se[0],valueSpec:{zoom:{}},style:ee.style,styleSpec:ee.styleSpec,objectElementValidators:{zoom:Hr,value:te}}))}else oe=oe.concat(te({key:`${de}[0]`,value:se[0],style:ee.style,styleSpec:ee.styleSpec},se));return a.Q(a.S(se[1]))?oe.concat([new ht(`${de}[1]`,se[1],"expressions are not allowed in function stops.")]):oe.concat(wi({key:`${de}[1]`,value:se[1],valueSpec:_,style:ee.style,styleSpec:ee.styleSpec}))}function te(ee,oe){const se=a.J(ee.value),de=a.H(ee.value),pe=ee.value!==null?ee.value:oe;if(S){if(se!==S)return[new ht(ee.key,pe,`${se} stop domain type must match previous stop domain type ${S}`)]}else S=se;if(se!=="number"&&se!=="string"&&se!=="boolean"&&typeof de!="number"&&typeof de!="string"&&typeof de!="boolean")return[new ht(ee.key,pe,"stop domain value must be a number, string, or boolean")];if(se!=="number"&&b!=="categorical"){let ce=`number expected, ${se} found`;return a.N(_)&&b===void 0&&(ce+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ht(ee.key,pe,ce)]}return b!=="categorical"||se!=="number"||typeof de=="number"&&isFinite(de)&&Math.floor(de)===de?b!=="categorical"&&se==="number"&&typeof de=="number"&&typeof T=="number"&&T!==void 0&&de<T?[new ht(ee.key,pe,"stop domain values must appear in ascending order")]:(T=de,b==="categorical"&&de in k?[new ht(ee.key,pe,"stop domain values must be unique")]:(k[de]=!0,[])):[new ht(ee.key,pe,`integer expected, found ${String(de)}`)]}}function On(p){const o=(p.expressionContext==="property"?a.V:a.U)(a.S(p.value),p.valueSpec);if(o.result==="error")return o.value.map(_=>new ht(`${p.key}${_.key}`,p.value,_.message));const d=o.value.expression||o.value._styleExpression.expression;if(p.expressionContext==="property"&&p.propertyKey==="text-font"&&!d.outputDefined())return[new ht(p.key,p.value,`Invalid data expression for "${p.propertyKey}". Output values must be contained as literals within the expression.`)];if(p.expressionContext==="property"&&p.propertyType==="layout"&&!a.Y(d))return[new ht(p.key,p.value,'"feature-state" data expressions are not supported with layout properties.')];if(p.expressionContext==="filter")return br(d,p);if(p.expressionContext==="appearance")return si(d,p);if(p.expressionContext&&p.expressionContext.indexOf("cluster")===0){if(!a.W(d,["zoom","feature-state"]))return[new ht(p.key,p.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(p.expressionContext==="cluster-initial"&&!a.X(d))return[new ht(p.key,p.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function br(p,o){const d=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(o.valueSpec&&o.valueSpec.expression)for(const b of o.valueSpec.expression.parameters)d.delete(b);if(d.size===0)return[];const _=[];return p instanceof a.Z&&d.has(p.name)?[new ht(o.key,o.value,`["${p.name}"] expression is not supported in a filter for a ${o.object.type} layer with id: ${o.object.id}`)]:(p.eachChild(b=>{_.push(...br(b,o))}),_)}function si(p,o){const d=new Set;if(o.valueSpec&&o.valueSpec.expression)for(const b of o.valueSpec.expression.parameters)d.add(b);if(d.size===0)return[];const _=[];
24return p instanceof a.Z&&!d.has(p.name)?[new ht(o.key,o.value,`["${p.name}"] is not an allowed parameter`)]:(p.eachChild(b=>{_.push(...si(b,o))}),_)}function bi(p){const o=p.key,d=p.value,_=p.valueSpec,b=[];return Array.isArray(_.values)?_.values.includes(a.H(d))||b.push(new ht(o,d,`expected one of [${_.values.join(", ")}], ${JSON.stringify(d)} found`)):Object.keys(_.values).includes(a.H(d))||b.push(new ht(o,d,`expected one of [${Object.keys(_.values).join(", ")}], ${JSON.stringify(d)} found`)),b}function Pr(p){return a.a1(a.S(p.value))?On(Object.assign({},p,{expressionContext:"filter",valueSpec:p.styleSpec[`filter_${p.layerType||"fill"}`]})):ni(p)}function ni(p){const o=p.value,d=p.key;if(!Array.isArray(o))return[new ht(d,o,`array expected, ${a.J(o)} found`)];if(o.length<1)return[new ht(d,o,"filter array must have at least 1 element")];const _=p.styleSpec;let b=bi({key:`${d}[0]`,value:o[0],valueSpec:_.filter_operator});const S=()=>{o.length>=2&&(a.$(o[1])||b.push(new ht(`${d}[1]`,o[1],`string expected, ${a.J(o[1])} found`)));for(let T=2;T<o.length;T++)a.H(o[1])==="$type"?b=b.concat(bi({key:`${d}[${T}]`,value:o[T],valueSpec:_.geometry_type})):a.$(o[T])||a.K(o[T])||a._(o[T])||b.push(new ht(`${d}[${T}]`,o[T],`string, number, or boolean expected, ${a.J(o[T])} found.`))};switch(a.H(o[0])){case"<":case"<=":case">":case">=":o.length>=2&&a.H(o[1])==="$type"&&b.push(new ht(d,o,`"$type" cannot be use with operator "${o[0]}"`)),o.length!==3&&b.push(new ht(d,o,`filter array for operator "${o[0]}" must have 3 elements`)),S();break;case"==":case"!=":o.length!==3&&b.push(new ht(d,o,`filter array for operator "${o[0]}" must have 3 elements`)),S();break;case"in":case"!in":S();break;case"any":case"all":case"none":for(let T=1;T<o.length;T++)b=b.concat(ni({key:`${d}[${T}]`,value:o[T],style:p.style,styleSpec:p.styleSpec}));break;case"has":case"!has":o.length!==2?b.push(new ht(d,o,`filter array for "${o[0]}" operator must have 2 elements`)):a.$(o[1])||b.push(new ht(`${d}[1]`,o[1],`string expected, ${a.J(o[1])} found`))}return b}const xi=/^{([^}]+)}$/;function Qr(p,o){const d=p.key,_=p.style,b=p.layer,S=p.styleSpec,T=p.value,I=p.objectKey,k=S[`${o}_${p.layerType}`];if(!k)return[];const F=I.match(a.a2);if(F&&k[F[1]])return a.Q(a.S(T))?[].concat(wi({key:d,value:T,valueSpec:{type:"string",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},style:_,styleSpec:S,expressionContext:"property",propertyType:o,propertyKey:I})):wi({key:d,value:T,valueSpec:{type:"string"},style:_,styleSpec:S});const z=I.match(a.a3);if(o==="paint"&&z&&k[z[1]]&&k[z[1]].transition)return wi({key:d,value:T,valueSpec:S.transition,style:_,styleSpec:S});const q=p.valueSpec||k[I];if(!q)return[new ln(d,T,`unknown property "${I}"`)];let j;if(a.$(T)&&a.N(q)&&!q.tokens&&(j=xi.exec(T))){const te=`\`{ "type": "identity", "property": ${j?JSON.stringify(j[1]):'"_"'} }\``;return[new ht(d,T,`"${I}" does not support interpolation syntax 25Use an identity property function instead: ${te}.`)]}const Z=[];if(p.layerType==="symbol")I!=="text-field"||!_||_.glyphs||_.imports||Z.push(new ht(d,T,'use of "text-field" requires a style "glyphs" property')),I==="text-font"&&a.a4(a.S(T))&&a.H(T.type)==="identity"&&Z.push(new ht(d,T,'"text-font" does not support identity functions'));else if(p.layerType==="model"&&o==="paint"&&b&&b.layout&&Object.hasOwn(b.layout,"model-id")&&a.N(q)&&(a.a5(q)||a.O(q))){const te=a.V(a.S(T),q).value,ee="expression"in te&&te.expression||"_styleExpression"in te&&te._styleExpression&&te._styleExpression.expression;ee&&!a.W(ee,["measure-light"])&&(I==="model-emissive-strength"&&a.X(ee)&&a.Y(ee)||Z.push(new ht(d,T,`${I} does not support measure-light expressions when the model layer source is vector tile or GeoJSON.`)))}return Z.concat(wi({key:p.key,value:T,valueSpec:q,style:_,styleSpec:S,expressionContext:"property",propertyType:o,propertyKey:I}))}function Xi(p){return Qr(p,"paint")}function Xo(p){return Qr(p,"layout")}function So(p){let o=[];const d=p.value,_=p.key,b=p.style,S=p.styleSpec;if(!a.G(d))return[new ht(_,d,"object expected")];d.type||d.ref||o.push(new ht(_,d,'either "type" or "ref" is required'));let T=a.H(d.type);const I=a.H(d.ref);
25if(d.id){const k=a.H(d.id);for(let F=0;F<p.arrayIndex;F++){const z=b.layers[F];a.H(z.id)===k&&o.push(new ht(_,d.id,`duplicate layer id "${k}", previously used at line ${z.id.__line__}`))}}if("ref"in d){let k;["type","source","source-layer","filter","layout"].forEach(F=>{F in d&&o.push(new ht(_,d[F],`"${F}" is prohibited for ref layers`))}),b.layers.forEach(F=>{a.H(F.id)===I&&(k=F)}),k?k.ref?o.push(new ht(_,d.ref,"ref cannot reference another ref layer")):T=a.H(k.type):typeof I=="string"&&o.push(new ht(_,d.ref,`ref layer "${I}" not found`))}else if(T!=="background"&&T!=="sky"&&T!=="slot")if(d.source)if(a.$(d.source)){const k=b.sources&&b.sources[d.source],F=k&&a.H(k.type);k?F==="vector"&&T==="raster"?o.push(new ht(_,d.source,`layer "${d.id}" requires a raster source`)):F==="raster"&&T!=="raster"?o.push(new ht(_,d.source,`layer "${d.id}" requires a vector source`)):F!=="vector"||d["source-layer"]?F==="raster-dem"&&T!=="hillshade"?o.push(new ht(_,d.source,"raster-dem source can only be used with layer type 'hillshade'.")):F!=="raster-array"||["raster","raster-particle"].includes(T)?T==="line"&&d.paint&&d.paint["line-gradient"]&&F==="geojson"&&!k.lineMetrics?o.push(new ht(_,d,`layer "${d.id}" specifies a line-gradient, which requires the GeoJSON source to have \`lineMetrics\` enabled.`)):T==="line"&&d.paint&&d.paint["line-trim-offset"]&&F==="geojson"&&!k.lineMetrics?o.push(new ht(_,d,`layer "${d.id}" specifies a line-trim-offset, which requires the GeoJSON source to have \`lineMetrics\` enabled.`)):T==="raster-particle"&&F!=="raster-array"&&o.push(new ht(_,d.source,`layer "${d.id}" requires a 'raster-array' source.`)):o.push(new ht(_,d.source,"raster-array source can only be used with layer type 'raster'.")):o.push(new ht(_,d,`layer "${d.id}" must specify a "source-layer"`)):o.push(new ht(_,d.source,`source "${d.source}" not found`))}else o.push(new ht(`${_}.source`,d.source,'"source" must be a string'));else o.push(new ht(_,d,'missing required property "source"'));return o=o.concat(rs({key:_,value:d,valueSpec:S.layer,style:p.style,styleSpec:p.styleSpec,objectElementValidators:{"*":()=>[],type:()=>wi({key:`${_}.type`,value:d.type,valueSpec:S.layer.type,style:p.style,styleSpec:p.styleSpec,object:d,objectKey:"type"}),filter:k=>Pr(Object.assign({layerType:T},k)),layout:k=>rs({layer:d,key:k.key,value:k.value,valueSpec:{},style:k.style,styleSpec:k.styleSpec,objectElementValidators:{"*":F=>Xo(Object.assign({layerType:T},F))}}),paint:k=>rs({layer:d,key:k.key,value:k.value,valueSpec:{},style:k.style,styleSpec:k.styleSpec,objectElementValidators:{"*":F=>Xi(Object.assign({layerType:T,layer:d},F))}}),appearances(k){const F=Kn({key:k.key,value:k.value,valueSpec:k.valueSpec,style:k.style,styleSpec:k.styleSpec,arrayElementValidator:j=>(function(Z){const{key:te,layer:ee,layerType:oe}=Z,se=a.H(Z.value),de=a.H(se.name),pe=a.H(se.condition),ce=rs({key:te,value:se,valueSpec:Z.styleSpec.appearance,style:Z.style,styleSpec:Z.styleSpec,objectElementValidators:{condition:Ce=>(function(Se){const Re=[];return Re.push(...On({key:Se.key,value:Se.object.condition,valueSpec:a.a6.appearance.condition,expressionContext:"appearance"})),Re})(Object.assign({layer:ee,layerType:oe},Ce)),properties:Ce=>(function(Se){const Re=[],{styleSpec:ve,layer:be,layerType:Ae}=Se,Ne=ve[`paint_${Ae}`],De=ve[`layout_${Ae}`],Ye=Se.object[Se.objectKey];for(const Ke in Ye){const Tt=Ke in Ne?"paint":Ke in De?"layout":void 0;if(!Tt){Re.push(new ht(Se.key,Ke,`unknown property "${Ke}" for layer type "${Ae}"`));continue}const Ue=Object.assign({},Se,{key:`${Se.key}.${Ke}`,object:Ye,objectKey:Ke,layer:be,layerType:Ae,value:Ye[Ke],valueSpec:Tt==="paint"?Ne[Ke]:De[Ke]});Re.push(...Qr(Ue,Tt))}return Re})(Object.assign({layer:ee,layerType:oe},Ce))}});return de!=="hidden"&&pe===void 0&&ce.push(new ht(Z.key,"name",'Appearance with name different than "hidden" must have a condition')),ce})(Object.assign({layerType:T,layer:d},j))}),z=Array.isArray(k.value)?k.value:[],q=new Set;return z.forEach((j,Z)=>{const te=a.H(j.name);if(te)if(q.has(te)){const ee=a.H(d.id);F.push(new ht(k.key,te,`Duplicated appearance name "${te}" for layer "${ee}"`))}else q.add(te)}),F}}})),o}function ho({key:p,value:o}){return a.$(o)?[]:[new ht(p,o,`string expected, ${a.J(o)} found`)]}const Vl={promoteId:function p({key:o,value:d}){if(a.$(d))return ho({key:o,value:d});if(Array.isArray(d)){const b=[],S=a.S(d),T=a.U(S);return T.result==="error"?(T.value.forEach(I=>{b.push(new ht(`${o}${I.key}`,null,`${I.message}`))}),b):(a.W(T.value.expression,["zoom","heatmap-density","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])||b.push(new ht(`${o}`,null,"promoteId expression should be only feature dependent")),b)}if(!a.G(d))return[new ht(o,d,`string, expression or object expected, "${a.J(d)}" found`)];const _=[];for(const b in d)_.push(...p({key:`${o}.${b}`,value:d[b]}));return _}};function hl(p){const o=p.value,d=p.key,_=p.styleSpec,b=p.style;if(!a.G(o))return[new ht(d,o,`object expected, ${a.J(o)} found`)];if(!("type"in o))return[new ht(d,o,'"type" is required')];const S=a.H(o.type);let T=[];switch(["vector","raster","raster-dem","raster-array"].includes(S)&&("url"in o||"tiles"in o||T.push(new ln(d,o,'Either "url" or "tiles" is required.'))),S){case"vector":case"raster":case"raster-dem":case"raster-array":return T=T.concat(rs({key:d,value:o,valueSpec:_[`source_${S.replace("-","_")}`],style:p.style,styleSpec:_,objectElementValidators:Vl})),T;case"geojson":if(T=rs({key:d,value:o,valueSpec:_.source_geojson,style:b,styleSpec:_,objectElementValidators:Vl}
25),"cluster"in o&&"clusterProperties"in o){if(!a.G(o.clusterProperties))return[new ht(`${d}.clusterProperties`,o,`object expected, ${a.J(o)} found`)];for(const I in o.clusterProperties){const k=o.clusterProperties[I];if(!Array.isArray(k))return[new ht(`${d}.clusterProperties.${I}`,k,"array expected")];const[F,z]=k,q=typeof F=="string"?[F,["accumulated"],["get",I]]:F;T.push(...On({key:`${d}.${I}.map`,value:z,expressionContext:"cluster-map"})),T.push(...On({key:`${d}.${I}.reduce`,value:q,expressionContext:"cluster-reduce"}))}}return T;case"video":return rs({key:d,value:o,valueSpec:_.source_video,style:b,styleSpec:_});case"image":return rs({key:d,value:o,valueSpec:_.source_image,style:b,styleSpec:_});case"canvas":return[new ht(d,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return bi({key:`${d}.type`,value:o.type,valueSpec:{values:Xr(_)}})}}function Xr(p){return p.source.reduce((o,d)=>{const _=p[d];return _.type.type==="enum"&&(o=o.concat(Object.keys(_.type.values||{}))),o},[])}function gu(p,o){const d=!p.includes("://");try{return new URL(p,d&&o?"http://example.com":void 0),!0}catch{return!1}}function dd(p){const o=p.value;return o?a.$(o)?gu(o,!0)?[]:[new ht(p.key,o,`invalid url "${o}"`)]:[new ht(p.key,o,`string expected, "${a.J(o)}" found`)]:[]}function hd(p){const o=p.value,d=p.styleSpec,_=d.light,b=p.style;if(o===void 0)return[];if(!a.G(o))return[new ht("light",o,`object expected, ${a.J(o)} found`)];let S=[];for(const T in o){const I=T.match(a.a3),k=T.match(a.a2);S=S.concat(k&&_[k[1]]?wi({key:T,value:o[T],valueSpec:{type:"string"},style:b,styleSpec:d}):I&&_[I[1]]&&_[I[1]].transition?wi({key:T,value:o[T],valueSpec:d.transition,style:b,styleSpec:d}):_[T]?wi({key:T,value:o[T],valueSpec:_[T],style:b,styleSpec:d}):[new ht(T,o[T],`unknown property "${T}"`)])}return S}function _u(p){const o=p.value;if(!o)return[];const d=p.key;if(!a.G(o))return[new ht(d,o,`object expected, ${a.J(o)} found`)];let _=[];const b=p.styleSpec,S=b["light-3d"],T=p.style,I=p.style.lights;for(const z of["type","id"])if(!(z in o))return _=_.concat([new ht(d,o,`missing property "${z}"`)]),_;if(!a.$(o.type))return _=_.concat([new ht(`${d}.type`,o.type,"string expected")]),_;if(I)for(let z=0;z<p.arrayIndex;z++){const q=a.H(o.type),j=I[z];a.H(j.type)===q&&_.push(new ht(d,o.id,`duplicate light type "${o.type}", previously defined at line ${j.id.__line__}`))}const k=`properties_light_${o.type}`;if(!(k in b))return _=_.concat([new ht(`${d}.type`,o,`Invalid light type ${o.type}`)]),_;const F=b[k];for(const z in o)if(z==="properties"){const q=o[z];if(!a.G(q))return _=_.concat([new ht("properties",q,`object expected, ${a.J(q)} found`)]),_;for(const j in q){const Z=j.match(a.a3),te=j.match(a.a2);_=_.concat(te&&F[te[1]]?wi({key:z,value:q[j],valueSpec:{type:"string"},style:T,styleSpec:b}):Z&&F[Z[1]]&&F[Z[1]].transition?wi({key:z,value:o[z],valueSpec:b.transition,style:T,styleSpec:b}):F[j]?wi({key:j,value:q[j],valueSpec:F[j],style:T,styleSpec:b}):[new ln(p.key,q[j],`unknown property "${j}"`)])}}else _=_.concat(S[z]?wi({key:z,value:o[z],valueSpec:S[z],style:T,styleSpec:b}):[new ln(z,o[z],`unknown property "${z}"`)]);return _}function Ch(p){const o=p.value,d=p.key,_=p.style,b=p.styleSpec,S=b.terrain;if(o==null)return[];if(!a.G(o))return[new ht("terrain",o,`object expected, ${a.J(o)} found`)];let T=[];for(const I in o){const k=I.match(a.a3),F=I.match(a.a2);T=T.concat(F&&S[F[1]]?wi({key:I,value:o[I],valueSpec:{type:"string"},style:_,styleSpec:b}):k&&S[k[1]]&&S[k[1]].transition?wi({key:I,value:o[I],valueSpec:b.transition,style:_,styleSpec:b}):S[I]?wi({key:I,value:o[I],valueSpec:S[I],style:_,styleSpec:b}):[new ln(I,o[I],`unknown property "${I}"`)])}if(o.source)if(a.$(o.source)){const I=_.sources&&_.sources[o.source],k=I&&a.H(I.type);I?k!=="raster-dem"&&T.push(new ht(`${d}.source`,o.source,`terrain cannot be used with a source of type ${k}, it only be used with a "raster-dem" source type`)):T.push(new ht(`${d}.source`,o.source,`source "${o.source}" not found`))}else T.push(new ht(`${d}.source`,o.source,"source must be a string"));else T.push(new ht(d,o,'terrain is missing required property "source"'));return T}function Ym(p){const o=p.value,d=p.style,_=p.styleSpec,b=_.fog;if(o===void 0)return[];if(!a.G(o))return[new ht("fog",o,`object expected, ${a.J(o)} found`)];let S=[];for(const T in o){const I=T.match(a.a3),k=T.match(a.a2);S=S.concat(k&&b[k[1]]?wi({key:T,value:o[T],valueSpec:{type:"string"},style:d,styleSpec:_}):I&&b[I[1]]&&b[I[1]].transition?wi({key:T,value:o[T],valueSpec:_.transition,style:d,styleSpec:_}):b[T]?wi({key:T,value:o[T],valueSpec:b[T],style:d,styleSpec:_}):[new ln(T,o[T],`unknown property "${T}"`)])}return S}const up={"*":()=>[],array:Kn,boolean:function(p){const o=p.value,d=p.key;return a._(o)?[]:[new ht(d,o,`boolean expected, ${a.J(o)} found`)]},number:Hr,color:function({key:p,value:o}){return a.$(o)?a.a0.parseCSSColor(o)===null?[new ht(p,o,`color expected, "${o}" found`)]:[]:[new ht(p,o,`color expected, ${a.J(o)} found`)]},enum:bi,filter:Pr,function:ti,layer:So,object:rs,source:hl,model:dd,light:hd,"light-3d":_u,terrain:Ch,fog:Ym,string:ho,formatted:function(p){return ho(p).length===0?[]:On(p)},resolvedImage:function(p){return ho(p).length===0?[]:On(p)},projection:function(p){const o=p.value,d=p.styleSpec,_=d.projection,b=p.style;if(a.G(o)){let S=[];for(const T in o)S=S.concat(wi({key:T,value:o[T],valueSpec:_[T],style:b,styleSpec:d}));return S}return a.$(o)?[]:[new ht("projection",o,`object or string expected, ${a.J(o)} found`)]},import:function(p){const o=p.key,{value:d,styleSpec:_}=p;if(!a.G(d))return[new ht(o,d,"import must be an object")];const{data:b,...S}=d;Object.defineProperty(S,"__line__",{value:d.__line__,enumerable:!1});let T=rs(Object.assign({},p,{value:S,valueSpec:_.import}));return a.H(S.id)===""&&T.push(new ht(`${p.key}.id`,S,"import id can't be an empty string")),b&&(T=T.concat(Ah(b,_,{key:`${p.key}.data`}))),T},iconset:function(p){const o=p.value,d=p.key,_=p.styleSpec,b=p.style;if(!a.G(o))return[new ht(d,o,"object expected")];if(!o.type)return[new ht(d,o,'"type" is required')];const S=a.H(o.type);let T=[];
25if(T=T.concat(rs({key:d,value:o,valueSpec:_[`iconset_${S}`],style:b,styleSpec:_})),(function(I,k){return!(I!=="source"||!k.source)})(S,o)){const I=b.sources&&b.sources[o.source],k=I&&a.H(I.type);I?k!=="raster-array"&&T.push(new ht(d,o.source,`iconset cannot be used with a source of type ${String(k)}, it only be used with a "raster-array" source type`)):T.push(new ht(d,o.source,`source "${o.source}" not found`))}return T}};function wi(p,o=!1){const d=p.value,_=p.valueSpec,b=p.styleSpec;if(_.expression){if(a.a4(a.H(d)))return ti(p);if(a.Q(a.S(d)))return On(p)}if(_.type&&up[_.type]){const S=up[_.type](p);return o===!0&&S.length>0&&Array.isArray(p.value)?On(p):S}return rs(Object.assign({},p,{valueSpec:_.type?b[_.type]:_}))}function rs(p){const o=p.key,d=p.value,_=p.valueSpec||{},b=p.objectElementValidators||{},S=p.style,T=p.styleSpec;if(!a.G(d))return[new ht(o,d,`object expected, ${a.J(d)} found`)];let I=[];for(const k in d){const F=k.split(".")[0];let z;b[F]?z=b[F]:_[F]?z=wi:b["*"]?z=b["*"]:_["*"]&&(z=wi),z?I=I.concat(z({key:(o&&`${o}.`)+k,value:d[k],valueSpec:_[F]||_["*"],style:S,styleSpec:T,object:d,objectKey:k},d)):I.push(new ln(o,d[k],`unknown property "${k}"`))}for(const k in _){if(b[k])continue;const F=_[k];F.required&&F.default===void 0&&d[k]===void 0&&I.push(new ht(o,d,`missing required property "${k}"`))}return I}function fd({key:p,value:o}){const d=ho({key:p,value:o});if(d.length)return d;const _=o;return _.includes("{fontstack}")||d.push(new ht(p,o,'"glyphs" url must include a "{fontstack}" token')),_.includes("{range}")||d.push(new ht(p,o,'"glyphs" url must include a "{range}" token')),d}function Ah(p,o=a.a6,d={}){return rs({key:d.key||"",value:p,valueSpec:Object.assign({},o.$root,{"*":{type:"*"}}),styleSpec:o,style:p,objectElementValidators:{glyphs:fd}})}function Ul(p,o=a.a6){return gs(Ah(p,o))}const Qs=p=>gs(hl(p)),r1=p=>gs(hd(p)),Ly=p=>gs(_u(p)),i1=p=>gs(Ch(p)),o1=p=>gs(Ym(p)),s1=p=>gs((function(o){const d=o.value,_=o.style,b=o.styleSpec,S=b.snow;if(d===void 0)return[];if(!a.G(d))return[new ht("snow",d,`object expected, ${a.J(d)} found`)];let T=[];for(const I in d){const k=I.match(a.a3);T=T.concat(k&&S[k[1]]&&S[k[1]].transition?wi({key:I,value:d[I],valueSpec:b.transition,style:_,styleSpec:b}):S[I]?wi({key:I,value:d[I],valueSpec:S[I],style:_,styleSpec:b}):[new ln(I,d[I],`unknown property "${I}"`)])}return T})(p)),a1=p=>gs((function(o){const d=o.value,_=o.style,b=o.styleSpec,S=b.rain;if(d===void 0)return[];if(!a.G(d))return[new ht("rain",d,`object expected, ${a.J(d)} found`)];let T=[];for(const I in d){const k=I.match(a.a3);T=T.concat(k&&S[k[1]]&&S[k[1]].transition?wi({key:I,value:d[I],valueSpec:b.transition,style:_,styleSpec:b}):S[I]?wi({key:I,value:d[I],valueSpec:S[I],style:_,styleSpec:b}):[new ln(I,d[I],`unknown property "${I}"`)])}return T})(p)),Ec=p=>gs(So(p)),dp=p=>gs(Pr(p)),Km=p=>gs(Xi(p)),Oy=p=>gs(Xo(p)),Dy=p=>gs(dd(p));function gs(p){return p.slice().sort((o,d)=>o.line&&d.line?o.line-d.line:0)}function $l(p,o){let d=!1;if(o&&o.length)for(const _ of o)_ instanceof ln?a.w(_.message):(p.fire(new a.y(new Error(_.message))),d=!0);return d}const Ih=a.a6.light;let Fy;class By extends a.E{constructor(o,d="flat"){super(),this._transitionable=new a.a7(Fy||(Fy=new a.a8({anchor:new a.a9(Ih.anchor),position:new a.aa(Ih.position),color:new a.a9(Ih.color),intensity:new a.a9(Ih.intensity)}))),this.setLight(o,d),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(o,d,_={}){this._validate(r1,o,_)||(this._transitionable.setTransitionOrValue(o),this.id=d)}updateTransitions(o){this._transitioning=this._transitionable.transitioned(o,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(o){this.properties=this._transitioning.possiblyEvaluate(o)}_validate(o,d,_){return(!_||_.validate!==!1)&&$l(this,o.call(Ul,Object.assign({value:d,style:{glyphs:!0,sprite:!0},styleSpec:a.a6})))}}const zy=a.a6.terrain;let pd=class extends a.E{constructor(p,o,d,_,b){super(),this.scope=d,this._transitionable=new a.a7(new a.a8({source:new a.a9(zy.source),exaggeration:new a.a9(zy.exaggeration)}),d,_),this._transitionable.setTransitionOrValue(p,_),this._transitioning=this._transitionable.untransitioned(),this.drapeRenderMode=o,this.worldview=b}get(){return this._transitionable.serialize()}set(p,o){this._transitionable.setTransitionOrValue(p,o)}updateTransitions(p){this._transitioning=this._transitionable.transitioned(p,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(p){this.properties=this._transitioning.possiblyEvaluate(p)}getExaggeration(p){return this._transitioning.possiblyEvaluate(new a.ab(p,{worldview:this.worldview})).get("exaggeration")}getAttenuationRange(){if(!this.isZoomDependent())return null;const p=this._transitionable._values.exaggeration;if(!p)return null;const o=p.value.expression;if(!o)return null;let d=-1,_=-1,b=1;for(const S of o.zoomStops)b=o.evaluate(new a.ab(S,{worldview:this.worldview})),b>.01?(d=S,_=-1):_=S;return b<.01&&d>0&&_>d?[d,_]:null}isZoomDependent(){const p=this._transitionable._values.exaggeration;return p!=null&&p.value!=null&&p.value.expression!=null&&p.value.expression instanceof a.ac}};
25const Cc=.05;function hp(p,o,d){const _=a.ag(45,65,d),[b,S]=p.range;let T=1-Math.min(1,Math.exp((o-b)/(S-b)*-6));return T*=T*T,T=Math.min(1,1.00747*T),T*_*p.alpha}function Jm(p,o,d,_,b){const S=a.ae([],[o,d,_],b.mercatorFogMatrix);return hp(p,a.af(S),b.pitch)}function l1(p,o,d,_,b,S,T){const I=[[d,_,0],[b,_,0],[b,S,0],[d,S,0]];let k=Number.MAX_VALUE,F=-Number.MAX_VALUE;for(const z of I){const q=a.ae([],z,o),j=a.af(q);k=Math.min(k,j),F=Math.max(F,j)}return[hp(p,k,T.pitch),hp(p,F,T.pitch)]}const Ac=a.a6.fog;class fp extends a.E{constructor(o,d,_,b){super();const S=new a.a8({range:new a.a9(Ac.range),color:new a.a9(Ac.color),"color-use-theme":new a.a9({type:"string","property-type":"data-constant",default:"default"}),"high-color":new a.a9(Ac["high-color"]),"high-color-use-theme":new a.a9({type:"string","property-type":"data-constant",default:"default"}),"space-color":new a.a9(Ac["space-color"]),"space-color-use-theme":new a.a9({type:"string","property-type":"data-constant",default:"default"}),"horizon-blend":new a.a9(Ac["horizon-blend"]),"star-intensity":new a.a9(Ac["star-intensity"]),"vertical-range":new a.a9(Ac["vertical-range"])});this._transitionable=new a.a7(S,_,b),this.set(o,b),this._transitioning=this._transitionable.untransitioned(),this._transform=d,this.properties=new a.ah(S),this.scope=_}get state(){const o=this._transform,d=o.projection.name==="globe",_=a.ai(o.zoom),b=this.properties.get("range"),S=[2,4.5],T=.5/Math.tan(.5*o._fov),I=[b[0]+T,b[1]+T];return{range:d?[a.aj(S[0],I[0],_),a.aj(S[1],I[1],_)]:I,horizonBlend:this.properties.get("horizon-blend"),alpha:this.properties.get("color").a}}get(){return this._transitionable.serialize()}set(o,d,_={}){if(this._validate(o1,o,_))return;const b=Object.assign({},o);for(const S of Object.keys(Ac))b[S]===void 0&&(b[S]=Ac[S].default);this._options=b,this._transitionable.setTransitionOrValue(this._options,d)}getOpacity(o){if(!this._transform.projection.supportsFog)return 0;const d=this.properties&&this.properties.get("color")||1;return(this._transform.projection.name==="globe"?1:a.ag(45,65,o))*d.a}getOpacityAtLatLng(o,d){return this._transform.projection.supportsFog?(function(_,b,S){const T=a.ad.fromLngLat(b),I=S.elevation?S.elevation.getAtPointOrZero(T):0;return Jm(_,T.x,T.y,I,S)})(this.state,o,d):0}getOpacityForTile(o){if(!this._transform.projection.supportsFog)return[1,1];const d=this._transform.calculateFogTileMatrix(o.toUnwrapped());return l1(this.state,d,0,0,a.ak,a.ak,this._transform)}getOpacityForBounds(o,d,_,b,S){return this._transform.projection.supportsFog?l1(this.state,o,d,_,b,S,this._transform):[1,1]}getRangeForProjection(){return this._transform.projection.supportsFog?this.state.range:[0,1]}isVisibleOnFrustum(o){if(!this._transform.projection.supportsFog)return!1;const d=[4,5,6,7];for(const _ of d){const b=o.points[_];let S;if(b[2]>=0)S=b;else{const T=o.points[_-4];S=a.al(T,b,T[2]/(T[2]-b[2]))}if(Jm(this.state,S[0],S[1],0,this._transform)>=Cc)return!0}return!1}updateConfig(o){this._transitionable.setTransitionOrValue(this._options,o)}updateTransitions(o){this._transitioning=this._transitionable.transitioned(o,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(o){this.properties=this._transitioning.possiblyEvaluate(o)}_validate(o,d,_){return(!_||_.validate!==!1)&&$l(this,o.call(Ul,Object.assign({value:d,style:{glyphs:!0,sprite:!0},styleSpec:a.a6})))}}let Ny,Ph,u2=class extends a.E{constructor(p,o,d,_){super();const b=Ny||(Ny=new a.a8({density:new a.a9(a.a6.snow.density),intensity:new a.a9(a.a6.snow.intensity),color:new a.a9(a.a6.snow.color),opacity:new a.a9(a.a6.snow.opacity),vignette:new a.a9(a.a6.snow.vignette),"vignette-color":new a.a9(a.a6.snow["vignette-color"]),"center-thinning":new a.a9(a.a6.snow["center-thinning"]),direction:new a.a9(a.a6.snow.direction),"flake-size":new a.a9(a.a6.snow["flake-size"])}));this._transitionable=new a.a7(b,d,_),this.set(p,_),this._transitioning=this._transitionable.untransitioned(),this.properties=new a.ah(b),this.scope=d}get state(){const p=this.properties.get("opacity"),o=this.properties.get("color"),d=this.properties.get("direction"),_=a.am(d[0]),b=-Math.max(a.am(d[1]),.01),S=[Math.cos(_)*Math.cos(b),Math.sin(_)*Math.cos(b),Math.sin(b)],T=this.properties.get("vignette"),I=this.properties.get("vignette-color");return I.a=T,{density:this.properties.get("density"),intensity:this.properties.get("intensity"),color:new a.C(o.r,o.g,o.b,o.a*p),direction:S,centerThinning:this.properties.get("center-thinning"),flakeSize:this.properties.get("flake-size"),vignetteColor:I}}get(){return this._transitionable.serialize()}set(p,o,d={}
25){if(this._validate(s1,p,d))return;const _=Object.assign({},p),b=a.a6.snow;for(const S of Object.keys(b))_[S]===void 0&&(_[S]=b[S].default);this._options=_,this._transitionable.setTransitionOrValue(this._options,o)}updateConfig(p){this._transitionable.setTransitionOrValue(this._options,p)}updateTransitions(p){this._transitioning=this._transitionable.transitioned(p,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(p){this.properties=this._transitioning.possiblyEvaluate(p)}_validate(p,o,d){return(!d||d.validate!==!1)&&$l(this,p.call(Ul,Object.assign({value:o,style:{glyphs:!0,sprite:!0},styleSpec:a.a6})))}},Qm=class extends a.E{constructor(p,o,d,_){super();const b=Ph||(Ph=new a.a8({density:new a.a9(a.a6.rain.density),intensity:new a.a9(a.a6.rain.intensity),color:new a.a9(a.a6.rain.color),opacity:new a.a9(a.a6.rain.opacity),vignette:new a.a9(a.a6.rain.vignette),"vignette-color":new a.a9(a.a6.rain["vignette-color"]),"center-thinning":new a.a9(a.a6.rain["center-thinning"]),direction:new a.a9(a.a6.rain.direction),"droplet-size":new a.a9(a.a6.rain["droplet-size"]),"distortion-strength":new a.a9(a.a6.rain["distortion-strength"])}));this._transitionable=new a.a7(b,d,_),this.set(p,_),this._transitioning=this._transitionable.untransitioned(),this.properties=new a.ah(b),this.scope=d}get state(){const p=this.properties.get("opacity"),o=this.properties.get("color"),d=this.properties.get("direction"),_=a.am(d[0]),b=-Math.max(a.am(d[1]),.01),S=[Math.cos(_)*Math.cos(b),Math.sin(_)*Math.cos(b),Math.sin(b)],T=this.properties.get("vignette-color");return T.a=this.properties.get("vignette"),{density:this.properties.get("density"),intensity:this.properties.get("intensity"),color:new a.C(o.r,o.g,o.b,o.a*p),direction:S,centerThinning:this.properties.get("center-thinning"),dropletSize:this.properties.get("droplet-size"),distortionStrength:this.properties.get("distortion-strength"),vignetteColor:T}}get(){return this._transitionable.serialize()}set(p,o,d={}){if(this._validate(a1,p,d))return;const _=Object.assign({},p),b=a.a6.rain;for(const S of Object.keys(b))_[S]===void 0&&(_[S]=b[S].default);this._options=_,this._transitionable.setTransitionOrValue(this._options,o)}updateConfig(p){this._transitionable.setTransitionOrValue(this._options,p)}updateTransitions(p){this._transitioning=this._transitionable.transitioned(p,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(p){this.properties=this._transitioning.possiblyEvaluate(p)}_validate(p,o,d){return(!d||d.validate!==!1)&&$l(this,p.call(Ul,Object.assign({value:o,style:{glyphs:!0,sprite:!0},styleSpec:a.a6})))}};const ea={workerUrl:"",workerClass:null,workerParams:void 0};function Vy(p){return ea.workerClass!=null?new ea.workerClass:new self.Worker(ea.workerUrl,Object.assign({name:p},ea.workerParams))}const eg="mapboxgl_preloaded_worker_pool";class yu{constructor(o){this.active={},this.name=o}acquire(o,d=yu.workerCount){if(!this.workers)for(this.workers=[];this.workers.length<d;){const _=Vy(`${this.name||""}WorkerPool: ${o}-${this.workers.length}`);this.workers.push(_)}return this.active[o]=!0,this.workers.slice()}release(o){delete this.active[o],this.workers&&this.numActive()===0&&(this.workers.forEach(d=>{d.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[eg]}numActive(){return Object.keys(this.active).length}}yu.workerCount=2;class pp{constructor(o,d,_="Worker",b=yu.workerCount){this.workerPool=o,this.actors=[],this.currentActor=0,this.id=a.an();const S=this.workerPool.acquire(this.id,b);for(let T=0;T<S.length;T++){const I=new pp.Actor(S[T],d,this.id);I.name=`${_} ${T}`,this.actors.push(I)}this.ready=!1,this.broadcast("checkIfReady",null,()=>{this.ready=!0})}broadcast(o,d,_){a.ao(this.actors,(b,S)=>{b.send(o,d,S)},_=_||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(o=>{o.remove()}),this.actors=[],this.workerPool.release(this.id)}}pp.Actor=a.ap;class Rh extends a.E{constructor(o,d,_,b){super(),this.scope=_,this._options=o,this.properties=new a.ah(d),this._transitionable=new a.a7(d,_,b),this._transitionable.setTransitionOrValue(o.properties),this._transitioning=this._transitionable.untransitioned()}updateConfig(o){this._transitionable.setTransitionOrValue(this._options.properties,o)}updateTransitions(o){this._transitioning=this._transitionable.transitioned(o,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(o){this.properties=this._transitioning.possiblyEvaluate(o)}get(){return this._options.properties=this._transitionable.serialize(),this._options}set(o,d){this._options=o,this._transitionable.setTransitionOrValue(o.properties,d)}shadowsEnabled(){return!!this.properties&&this.properties.get("cast-shadows")===!0}}let Uy;const c1=()=>Uy||(Uy=new a.a8({color:new a.a9(a.a6.properties_light_ambient.color),"color-use-theme":new a.a9({type:"string",default:"default","property-type":"data-constant"}),intensity:new a.a9(a.a6.properties_light_ambient.intensity)}));let u1;const tg=()=>u1||(u1=new a.a8({direction:new a.aq(a.a6.properties_light_directional.direction),color:new a.a9(a.a6.properties_light_directional.color),"color-use-theme":new a.a9({type:"string",default:"default","property-type":"data-constant"}),intensity:new a.a9(a.a6.properties_light_directional.intensity),"cast-shadows":new a.a9(a.a6.properties_light_directional["cast-shadows"]),"shadow-quality":new a.a9(a.a6.properties_light_directional["shadow-quality"]),"shadow-intensity":new a.a9(a.a6.properties_light_directional["shadow-intensity"]),"shadow-draw-before-layer":new a.a9(a.a6.properties_light_directional["shadow-draw-before-layer"])}));class fl{constructor(o,d,_){this.screenBounds=o,this.cameraPoint=_.getCameraPoint(),this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=d,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,_)}static createFromScreenPoints(o,d){let _,b;if(o instanceof a.P||typeof o[0]=="number"){const S=a.P.convert(o);_=[S],b=d.isPointAboveHorizon(S)}else{const S=a.P.convert(o[0]),T=a.P.convert(o[1]),I=S.add(T)._div(2);_=[S,T],b=a.ar(S,T).every(k=>d.isPointAboveHorizon(k))&&d.isPointAboveHorizon(I)}return new fl(_,b,d)}isPointQuery(){return this.screenBounds.length===1}bufferedScreenGeometry(o){return a.ar(this.screenBounds[0],this.screenBounds.length===1?this.screenBounds[0]:this.screenBounds[1],o)}bufferedCameraGeometry(o){const d=this.screenBounds[0],_=this.screenBounds.length===1?this.screenBounds[0].add(new a.P(1,1)):this.screenBounds[1],b=a.ar(d,_,0,!1);return this.cameraPoint.y>_.y&&(this.cameraPoint.x>d.x&&this.cameraPoint.x<_.x?b.splice(3,0,this.cameraPoint):this.cameraPoint.x>=_.x?b[2]=this.cameraPoint:this.cameraPoint.x<=d.x&&(b[3]=this.cameraPoint)),a.as(b,o)}bufferedCameraGeometryGlobe(o){const d=this.screenBounds[0],_=this.screenBounds.length===1?this.screenBounds[0].add(new a.P(1,1)):this.screenBounds[1],b=a.ar(d,_,o),S=this.cameraPoint.clone(),T=+(S.x>d.x)+ +(S.x>_.x);switch(3*(+(S.y>d.y)+ +(S.y>_.y))+T){case 0:b[0]=S,b[4]=S.clone();break;case 1:b.splice(1,0,S);break;case 2:b[1]=S;break;case 3:b.splice(4,0,S);break;case 5:b.splice(2,0,S);break;case 6:b[3]=S;break;case 7:b.splice(3,0,S);break;case 8:b[2]=S}return b}containsTile(o,d,_,b=0){const S=Math.max(o.queryPadding,o.evaluateQueryRenderedFeaturePadding())/d._pixelsPerMercatorPixel+1,T=_?this._bufferedCameraMercator(S,d):this._bufferedScreenMercator(S,d);let I=o.tileID.wrap+(T.unwrapped?b:0);const k=T.polygon.map(oe=>a.at(o.tileTransform,oe,I));if(!a.au(k,0,0,a.ak,a.ak))return;I=o.tileID.wrap+(this.screenGeometryMercator.unwrapped?b:0);const F=this.screenGeometryMercator.polygon.map(oe=>a.av(o.tileTransform,oe,I)),z=F.map(oe=>new a.P(oe[0],oe[1])),q=d.getFreeCameraOptions().position||new a.ad(0,0,0),j=a.av(o.tileTransform,q,I),Z=F.map(oe=>{const se=a.aw(oe,oe,j);return a.ax(se,se),new a.ay(j,se)}),te=a.az(o,1,d.zoom)*d._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:z,tilespaceRays:Z,bufferedTilespaceGeometry:k,bufferedTilespaceBounds:(ee=a.aA(k),ee.min.x=a.aB(ee.min.x,0,a.ak),ee.min.y=a.aB(ee.min.y,0,a.ak),ee.max.x=a.aB(ee.max.x,0,a.ak),ee.max.y=a.aB(ee.max.y,0,a.ak),ee),tile:o,tileID:o.tileID,pixelToTileUnitsFactor:te};var ee}_bufferedScreenMercator(o,d){const _=ng(o);if(this._screenRaycastCache[_])return this._screenRaycastCache[_];{let b;return b=d.projection.name==="globe"?this._projectAndResample(this.bufferedScreenGeometry(o),d):{polygon:this.bufferedScreenGeometry(o).map(S=>d.pointCoordinate3D(S)),unwrapped:!0},this._screenRaycastCache[_]=b,b}}_bufferedCameraMercator(o,d){const _=ng(o);if(this._cameraRaycastCache[_])return this._cameraRaycastCache[_];{let b;return b=d.projection.name==="globe"?this._projectAndResample(this.bufferedCameraGeometryGlobe(o),d):{polygon:this.bufferedCameraGeometry(o).map(S=>d.pointCoordinate3D(S)),unwrapped:!0},this._cameraRaycastCache[_]=b,b}}_projectAndResample(o,d){const _=(function(S,T){const I=a.aC([],T.pixelMatrix,T.globeMatrix),k=[0,-a.aE,0,1],F=[0,a.aE,0,1],z=[0,0,0,1];a.aD(k,k,I),a.aD(F,F,I),a.aD(z,z,I);const q=new a.P(k[0]/k[3],k[1]/k[3]),j=new a.P(F[0]/F[3],F[1]/F[3]),Z=a.aF(S,q)&&k[3]<z[3],te=a.aF(S,j)&&F[3]<z[3];if(!Z&&!te)return null;const ee=(function(ve,be,Ae){for(let Ne=1;Ne<ve.length;Ne++){const De=Mh(be.pointCoordinate3D(ve[Ne-1]).x),Ye=Mh(be.pointCoordinate3D(ve[Ne]).x);if(Ae<0){if(De<Ye)return{idx:Ne,t:-De/(Ye-1-De)}}else if(Ye<De)return{idx:Ne,t:(1-De)/(Ye+1-De)}}return null})(S,T,Z?-1:1);if(!ee)return null;const{idx:oe,t:se}=ee;let de=oe>1?kh(S.slice(0,oe),T):[],pe=oe<S.length?kh(S.slice(oe),T):[];de=de.map(ve=>new a.P(Mh(ve.x),ve.y)),pe=pe.map(ve=>new a.P(Mh(ve.x),ve.y));const ce=[...de];
25ce.length===0&&ce.push(pe.at(-1));const Ce=ce.at(-1),Se=a.aj(Ce.y,(pe.length===0?de[0]:pe[0]).y,se);let Re;return Re=Z?[new a.P(0,Se),new a.P(0,0),new a.P(1,0),new a.P(1,Se)]:[new a.P(1,Se),new a.P(1,1),new a.P(0,1),new a.P(0,Se)],ce.push(...Re),pe.length===0?ce.push(de[0]):ce.push(...pe),{polygon:ce.map(ve=>new a.ad(ve.x,ve.y)),unwrapped:!1}})(o,d);if(_)return _;const b=(function(S,T){let I=!1,k=-1/0,F=0;for(let q=0;q<S.length-1;q++)S[q].x>k&&(k=S[q].x,F=q);for(let q=0;q<S.length-1;q++){const j=(F+q)%(S.length-1),Z=S[j],te=S[j+1];Math.abs(Z.x-te.x)>.5&&(Z.x<te.x?(Z.x+=1,j===0&&(S.at(-1).x+=1)):(te.x+=1,j+1===S.length-1&&(S[0].x+=1)),I=!0)}const z=a.aG(T.center.lng);return I&&z<Math.abs(z-1)&&S.forEach(q=>{q.x-=1}),{polygon:S,unwrapped:I}})(kh(o,d).map(S=>new a.P(Mh(S.x),S.y)),d);return{polygon:b.polygon.map(S=>new a.ad(S.x,S.y)),unwrapped:b.unwrapped}}}function kh(p,o){return a.aH(p,d=>{const _=o.pointCoordinate3D(d);d.x=_.x,d.y=_.y},1/256)}function Mh(p){return p<0?1+p%1:p%1}function ng(p){return 100*p|0}function Lh(p,o){const d=Math.pow(2,o.z),_=Math.floor(a.aG(p.getWest())*d),b=Math.floor(a.aJ(p.getNorth())*d),S=Math.ceil(a.aG(p.getEast())*d),T=Math.ceil(a.aJ(p.getSouth())*d);return o.x>=_&&o.x<S&&o.y>=b&&o.y<T}class is{constructor(o,d,_){this.bounds=o?a.aI.convert(this.validateBounds(o)):null,this.minzoom=d||0,this.maxzoom=_||24}validateBounds(o){return Array.isArray(o)&&o.length===4?[Math.max(-180,o[0]),Math.max(-90,o[1]),Math.min(180,o[2]),Math.min(90,o[3])]:[-180,-90,180,90]}addExtraBounds(o){if(o){this.extraBounds||(this.extraBounds=[]);for(const d of o)this.extraBounds.push(a.aI.convert(this.validateBounds(d)))}}contains(o){if(o.z>this.maxzoom||o.z<this.minzoom||this.bounds&&!Lh(this.bounds,o))return!1;if(!this.extraBounds)return!0;for(const d of this.extraBounds)if(Lh(d,o))return!0;return!1}static fromTileJSON(o){if(!o.bounds&&!o.extra_bounds)return null;const d=new is(o.bounds,o.minzoom,o.maxzoom);return d.addExtraBounds(o.extra_bounds),d}}class $y extends a.E{constructor(o,d,_,b){if(super(),this.id=o,this.dispatcher=_,this.type="vector",this.provider=d.provider,this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,Object.assign(this,a.aK(d,["url","scheme","tileSize","promoteId"])),this._options=Object.assign({type:"vector"},d),this._collectResourceTiming=!!d.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(b),this._tileWorkers={},this._deduped=new a.aL}load(o){this._loaded=!1,this.fire(new a.z("dataloading",{dataType:"source"}));const d=Array.isArray(this.map._language)?this.map._language.join():this.map._language,_=this.map.getWorldview(),b=(T,I)=>{this._tileJSONRequest=null,this._loaded=!0,T?(d&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${d}`),_&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${_}`),this.fire(new a.y(T))):I&&(this._setTileJSON(I),_n(I.tiles,this.map._requestManager._customAccessToken),this.fire(new a.z("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new a.z("data",{dataType:"source",sourceDataType:"content"}))),o&&o(T)};this.provider=this._options.provider;const S=a.aM(this._options);return S instanceof Error?(this._loaded=!0,this.fire(new a.y(S)),void(o&&o())):this.provider&&!S?(this._loaded=!0,this.fire(new a.y(new Error(`TileProvider "${this.provider}" is not registered`))),void(o&&o())):void(this._tileJSONRequest=S?this.loadTileJSONWithProvider(S,b):a.aN(this._options,this.map._requestManager,d,_,b))}loadTileJSONWithProvider(o,d){this.provider=o.name;const{request:_,options:b}=a.aO(this._options,this.map._requestManager),S=new AbortController;return this.dispatcher.broadcast("loadTileProvider",{name:o.name,url:o.url,source:this.id,scope:this.scope,type:this.type,options:b,request:_},(T,I)=>{if(S.signal.aborted)return;if(T)return void d(T);const k=I?I.find(z=>z!=null):null,F=a.aP(this._options,k,this.map._requestManager);F instanceof Error?d(F):d(null,F)}),{cancel:()=>S.abort()}}_setTileJSON(o){if(Object.assign(this,o),this.hasWorldviews=!!o.worldview_options,o.worldview_default&&(this.worldviewDefault=o.worldview_default),o.vector_layers){this.vectorLayers=o.vector_layers,this.vectorLayerIds=[],this.localizableLayerIds=new Set;for(const d of o.vector_layers)this.vectorLayerIds.push(d.id),o.worldview&&o.worldview[d.source]&&this.localizableLayerIds.add(d.id)}this.tileBounds=is.fromTileJSON(o)}loaded(){return this._loaded}hasTile(o){return!this.tileBounds||this.tileBounds.contains(o.canonical)}onAdd(o){this.map=o,this.load()}reload(){this.cancelTileJSONRequest();const o=a.t(this.id,this.scope);this.load(()=>this.map.style.clearSource(o))}setTiles(o){return this._options.tiles=o,this.reload(),this}setUrl(o){return this.url=o,this._options.url=o,this.reload(),this}onRemove(o){this.cancelTileJSONRequest()}serialize(){return Object.assign({},this._options)}loadTile(o,d){const _=o.tileID.canonical.url(this.tiles,this.scheme),b=this.map._requestManager.normalizeTileURL(_),S=this.map._requestManager.transformRequest(b,a.R.Tile),T=this.map.style?this.map.style.getLut(this.scope):null,I=T?{image:T.image.clone()}:null,k={request:S,data:void 0,uid:o.uid,tileID:o.tileID,tileZoom:o.tileZoom,zoom:o.tileID.overscaledZ,maxZoom:this.maxzoom,lut:I,tileSize:this.tileSize*o.tileID.overscaleFactor(),type:this.t
25ype,source:this.id,scope:this.scope,pixelRatio:a.o.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,showElevationIdDebug:!!this.map.painter&&this.map.painter._debugParams.showElevationIdDebug,promoteId:this.promoteId,renderSourceType:o.renderSourceType,brightness:this.map.style&&this.map.style.getBrightness()||0,extraShadowCaster:o.isExtraShadowCaster,tessellationStep:this.map._tessellationStep,scaleFactor:this.map.getScaleFactor(),worldview:this.map.getWorldview()||this.worldviewDefault,indoor:this.map.getIndoorTileOptions(this.id,this.scope)};if(this.hasWorldviews&&a.e(_)&&(k.localizableLayerIds=this.localizableLayerIds),k.request.collectResourceTiming=this._collectResourceTiming,o.actor&&o.state!=="expired")o.state==="loading"?o.reloadCallback=d:o.request=o.actor.send("reloadTile",k,F.bind(this));else if(o.actor=this._tileWorkers[b]=this._tileWorkers[b]||this.dispatcher.getActor(),this.dispatcher.ready||this.provider)o.request=o.actor.send("loadTile",k,F.bind(this),void 0,!0);else{const z=a.aQ.call({deduped:this._deduped},k,(q,j)=>{if(q||!j)F.call(this,q);else{const Z=a.aR(j.responseHeaders);k.data={rawData:j.rawData.slice(0),expires:Z.expires,cacheControl:Z.cacheControl},o.actor&&o.actor.send("loadTile",k,F.bind(this),void 0,!0)}},!0);o.request={cancel:z}}function F(z,q){return delete o.request,o.aborted?d(null):z?d(z):(q&&q.resourceTiming&&(o.resourceTiming=q.resourceTiming),this.map._refreshExpiredTiles&&q&&o.setExpiryData(q),o.loadVectorData(q,this.map.painter),a.aS(this.dispatcher),d(null,q),void(o.reloadCallback&&(this.loadTile(o,o.reloadCallback),o.reloadCallback=null)))}}abortTile(o){o.request&&(o.request.cancel(),delete o.request),o.actor&&o.actor.send("abortTile",{uid:o.uid,type:this.t
25ype,source:this.id,scope:this.scope})}unloadTile(o,d){o.actor&&o.actor.send("removeTile",{uid:o.uid,type:this.type,source:this.id,scope:this.scope}),o.destroy()}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class Oh extends a.E{constructor(o,d,_,b){super(),this.id=o,this.dispatcher=_,this.setEventedParent(b),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=Object.assign({type:"raster"},d),Object.assign(this,a.aK(d,["url","scheme","tileSize"]))}load(o){this._loaded=!1,this.fire(new a.z("dataloading",{dataType:"source"}));const d=this.map.getWorldview(),_=(S,T)=>{this._tileJSONRequest=null,this._loaded=!0,S?this.fire(new a.y(S)):T&&(Object.assign(this,T),T.raster_layers&&(this.rasterLayers=T.raster_layers,this.rasterLayerIds=this.rasterLayers.map(I=>I.id)),this.tileBounds=is.fromTileJSON(T),_n(T.tiles),this.fire(new a.z("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new a.z("data",{dataType:"source",sourceDataType:"content"}))),o&&o(S)};this.provider=typeof this._options.provider=="string"?this._options.provider:void 0,this._tileProvider=void 0;const b=a.aM(this._options);return b instanceof Error?(this._loaded=!0,this.fire(new a.y(b)),void(o&&o())):this.provider&&!b?(this._loaded=!0,this.fire(new a.y(new Error(`TileProvider "${this.provider}" is not registered`))),void(o&&o())):void(this._tileJSONRequest=b?this.loadTileJSONWithProvider(b,_):a.aN(this._options,this.map._requestManager,null,d,_))}loadTileJSONWithProvider(o,d){this.provider=o.name;const{request:_,options:b}=a.aO(this._options,this.map._requestManager),S=new AbortController;return a.aT(o.name,o.url).then(T=>{if(S.signal.aborted)return;const I=new T(b);return I.load&&_?I.load({request:_}).then(k=>(this._tileProvider=I,k)):(this._tileProvider=I,null)}).then(T=>{if(S.signal.aborted)return;const I=a.aP(this._options,T,this.map._requestManager);I instanceof Error?d(I):d(null,I)}).catch(T=>{S.signal.aborted||d(T instanceof Error?T:new Error(String(T)))}),{cancel:()=>S.abort()}}loaded(){return this._loaded}onAdd(o){this.map=o,this.load()}reload(){this.cancelTileJSONRequest();const o=a.t(this.id,this.scope);this.load(()=>this.map.style.clearSource(o))}setTiles(o){return this._options.tiles=o,this.reload(),this}setUrl(o){return this.url=o,this._options.url=o,this.reload(),this}onRemove(o){this.cancelTileJSONRequest()}serialize(){return Object.assign({},this._options)}hasTile(o){return!this.tileBounds||this.tileBounds.contains(o.canonical)}loadTile(o,d){const _=a.o.devicePixelRatio>=2,b=this.map._requestManager.normalizeTileURL(o.tileID.canonical.url(this.tiles,this.scheme),_,this.tileSize),S=this.map._requestManager.transformRequest(b,a.R.Tile);if(this._tileProvider){const T=new AbortController;o.request={cancel:()=>T.abort()},this.loadTileWithProvider(o,this._tileProvider,S,T,d)}else o.request=a.n(S,(T,I,k)=>{if(delete o.request,o.aborted)return o.state="unloaded",d(null);if(T)return o.state="errored",d(T);if(!I)return d(null);const F=a.aR(k);this.map._refreshExpiredTiles&&o.setExpiryData(F),o.setTexture(I,this.map.painter),o.state="loaded",a.aS(this.dispatcher),d(null)})}async loadTileWithProvider(o,d,_,b,S){const{z:T,x:I,y:k}=o.tileID.canonical;try{const F=await d.loadTile({z:T,x:I,y:k},{request:_,signal:b.signal});if(b.signal.aborted)return o.state="unloaded",S(null);if(F==null){const q=new Error("Tile not found");return q.status=404,o.state="errored",S(q)}if(F.data==null)return o.state="loaded",S(null);const z=await createImageBitmap(new Blob([F.data]));if(b.signal.aborted)return o.state="unloaded",S(null);o.setTexture(z,this.map.painter),o.state="loaded",this.map._refreshExpiredTiles&&o.setExpiryData({cacheControl:F.cacheControl,expires:F.expires}),S(null)}catch(F){if(b.signal.aborted||F instanceof DOMException&&F.name==="AbortError")return o.state="unloaded",S(null);o.state="errored",S(F instanceof Error?F:new Error(String(F)))}finally{delete o.request}}abortTile(o,d){o.request&&(o.request.cancel(),delete o.request),d&&d()}unloadTile(o,d){o.texture&&o.texture instanceof a.T?(o.destroy(!1),o.texture&&o.texture instanceof a.T&&this.map.painter.saveTileTexture(o.texture)):o.destroy(),d&&d()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}function d1([p,o],d,_,{scaled:b=!0}={}){const{tileSize:S,buffer:T}=_,{x:I,y:k,z:F}=d;
25if(!isFinite(I)||!isFinite(k)||!isFinite(F))throw new Error("Invalid MRT header");const z=2**F,q=z*a.aG(p),j=z*a.aJ(o);return(function([Z,te],ee,{scaled:oe=!0}={}){if(!ee)throw new Error("bandView is undefined");const{data:se,tileSize:de,buffer:pe,offset:ce,scale:Ce,dimension:Se}=ee;if(Z<-pe||Z>de+pe||te<-pe||te>de+pe)throw new Error(`Point (${Z}, ${te}) out of bounds for tileSize=${de}, buffer=${pe}`);const Re=(te+pe)*(de+2*pe)+(Z+pe);if(new Uint32Array(se.buffer)[Re]===4294967295)return null;let ve=[];ve=oe?[]:new ee.data.constructor(Se);for(let be=0;be<Se;be++)ve[be]=Math.round(1e12*(se[Se*Re+be]*Ce+ce))/1e12;return ve})([Math.min(Math.max(-T,Math.floor((q-I)*S)),S-1+T),Math.min(Math.max(-T,Math.floor((j-k)*S)),S-1+T)],_,{scaled:b})}class Sn extends Oh{constructor(o,d,_,b){super(o,d,_,b),this.type="raster-array",this.maxzoom=22,this.partial=!0,this._loadTilePending={},this._loadTileLoaded={},this._options=Object.assign({type:"raster-array"},d)}triggerRepaint(o){const d=this.map.painter._terrain,_=this.map.style.getSourceCache(this.id);d&&d.enabled&&_&&d._clearRenderCacheForTile(_.id,o.tileID),this.map.triggerRepaint()}loadTile(o,d){const _=this.map._requestManager.normalizeTileURL(o.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize),b=this.map._requestManager.transformRequest(_,a.R.Tile),S={request:b,uid:o.uid,tileID:o.tileID,type:this.t
25ype,source:this.id,scope:this.scope,partial:this.partial};o.source=this.id,o.scope=this.scope,o.requestParams=b,o.actor||(o.actor=this.dispatcher.getActor());const T=(I,k,F)=>{if(delete o.request,o.aborted)return o.state="unloaded",d(null);if(I)return I.name==="AbortError"?void 0:(o.state="errored",d(I));if(this.map._refreshExpiredTiles&&k){const z=a.aR(F);o.setExpiryData(z)}if(this.partial&&o.state!=="expired")o.state="empty";else if(!this.partial){if(!k)return d(null);o.state="loaded",o._isHeaderLoaded=!0,o._mrt=k}d(null)};o.request=this.partial?o.fetchHeader(void 0,T.bind(this)):o.actor.send("loadTile",S,T.bind(this),void 0,!0)}abortTile(o){o.request&&(o.request.cancel(),delete o.request),o.actor&&o.actor.send("abortTile",{uid:o.uid,type:this.type,source:this.id,scope:this.scope})}unloadTile(o,d){const _=o.texturePerLayer;if(o.flushAllQueues(),_.size){o.destroy(!1);for(const b of _.values())this.map.painter.saveTileTexture(b)}else o.destroy()}prepareTile(o,d,_,b){o._isHeaderLoaded&&(o.state!=="empty"&&(o.state="reloading"),o.fetchBandForRender(d,_,b,(S,T)=>{S?(o.state="errored",this.fire(new a.y(S))):T&&(o._isHeaderLoaded=!0,o.setTexturePerLayer(_,T,this.map.painter),o.state="loaded"),this.triggerRepaint(o)}))}getInitialBand(o){if(!this.rasterLayers)return 0;const d=this.rasterLayers.find(({id:S})=>S===o),_=d&&d.fields,b=_&&_.bands&&_.bands;return b?b[0]:0}getTextureDescriptor(o,d,_){if(!o)return;const b=d.sourceLayer||this.rasterLayerIds&&this.rasterLayerIds[0];if(!b)return;let S=null;d instanceof a.aV?S=d.paint.get("raster-array-band"):d instanceof a.aW&&(S=d.paint.get("raster-particle-array-band"));const T=S||this.getInitialBand(b);if(T==null)return;if(!o.textureDescriptorPerLayer.get(d.id))return void this.prepareTile(o,b,d.id,T);if(o.updateNeeded(d.id,T)&&!_)return;const I=o.textureDescriptorPerLayer.get(d.id);return Object.assign({},I,{texture:o.texturePerLayer.get(d.id)})}getImages(o,d){const _=new Map;for(const b of o)for(const S of d){const[T,I]=S.split("/"),k=b.getLayer(T);if(!k||!k.hasBand(I)||!k.hasDataForBand(I))continue;const{bytes:F,tileSize:z,buffer:q}=k.getBandView(I),j=z+2*q,Z={data:new a.q({width:j,height:j},F),pixelRatio:2,sdf:!1,usvg:!1,version:0};_.set(S,Z)}return _}queryRasterArrayValueByBandId(o,d,_){const b=d._mrt;return new Promise(S=>{const T={},I=new Set;for(const[k,F]of Object.entries(b.layers)){if(_.layerName&&k!==_.layerName)continue;const z={};T[k]=z;for(const{bands:q}of F.dataIndex)for(const j of q)_.bands&&!_.bands.includes(j)||(I.add(a.t(k,j)),d.fetchBand(k,null,j,Z=>{a.o.frame(()=>{z[j]=Z?null:d1([o.lng,o.lat],b,F.getBandView(j)),I.delete(a.t(k,j)),I.size===0&&S(T)})},!1))}I.size===0&&S(T)})}_loadTileForQuery(o,d){if(this._loadTileLoaded[o.uid])return void d(null,o._mrt);if(this._loadTilePending[o.uid])return void this._loadTilePending[o.uid].push(d);this._loadTilePending[o.uid]=[d];const _=this.map._requestManager.normalizeTileURL(o.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize),b=this.map._requestManager.transformRequest(_,a.R.Tile);o.actor.send("loadTile",{request:b,uid:o.uid,tileID:o.tileID,type:this.t
25ype,source:this.id,scope:this.scope,partial:!1},(S,T,I)=>{if(S)return this._loadTilePending[o.uid].forEach(k=>k(S,null)),void delete this._loadTilePending[o.uid];if(!T)return this._loadTilePending[o.uid].forEach(k=>k(null,null)),void delete this._loadTilePending[o.uid];if(this.map._refreshExpiredTiles&&T){const k=a.aR(I);o.setExpiryData(k)}o._mrt=T,o._isHeaderLoaded=!0,o.state="loaded",this._loadTilePending[o.uid].forEach(k=>k(null,T)),this._loadTileLoaded[o.uid]=!0,delete this._loadTilePending[o.uid]},void 0,!0)}queryRasterArrayValueByAllBands(o,d,_){return new Promise((b,S)=>{this._loadTileForQuery(d,(T,I)=>{T?S(T):b(I?this.queryRasterArrayValueByBandId(o,d,_):null)})})}queryRasterArrayValue(o,d){const _=a.aX.convert(o),b=this.findLoadedParent(_);return b&&b._mrt?d.bands||!this.partial?this.queryRasterArrayValueByBandId(_,b,d):this.queryRasterArrayValueByAllBands(_,b,d):Promise.resolve(null)}findLoadedParent(o){const d=a.ad.fromLngLat(o,this.map.transform.tileSize),_=this.maxzoom+1,b=1<<_,S=Math.floor(d.x),T=Math.floor((d.x-S)*b),I=Math.floor(d.y*b),k=this.map.style.getSourceCache(this.id),F=new a.aU(_,S,_,T,I);return k.findLoadedParent(F,this.minzoom)}}const xr={vector:$y,raster:Oh,"raster-dem":class extends Oh{constructor(p,o,d,_){super(p,o,d,_),this.type="raster-dem",this.maxzoom=22,this._options=Object.assign({type:"raster-dem"},o),this.encoding=o.encoding||"mapbox"}loadTileJSONWithProvider(p,o){this.provider=p.name;const{request:d,options:_}=a.aO(this._options,this.map._requestManager),b=new AbortController;return this.dispatcher.broadcast("loadTileProvider",{name:p.name,url:p.url,source:this.id,scope:this.scope,type:this.type,options:_,request:d},(S,T)=>{if(b.signal.aborted)return;if(S)return void o(S);const I=T?T.find(F=>F!=null):null,k=a.aP(this._options,I,this.map._requestManager);k instanceof Error?o(k):o(null,k)}),{cancel:()=>b.abort()}}loadTile(p,o){const d=this.map._requestManager.normalizeTileURL(p.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize),_=this.map._requestManager.transformRequest(d,a.R.Tile),b={uid:p.uid,tileID:p.tileID,source:this.id,type:this.t
25ype,scope:this.scope,request:_,encoding:this.encoding};p.actor&&p.state!=="expired"||(p.actor=this.dispatcher.getActor(),p.request=p.actor.send("loadTile",b,(function(S,T){return delete p.request,p.aborted?(p.state="unloaded",o(null)):S?(p.state="errored",o(S)):(T&&(this.map._refreshExpiredTiles&&p.setExpiryData(T),T.borderReady||p.neighboringTiles||(p.neighboringTiles=this._getNeighboringTiles(p.tileID)),p.dem=T.dem,p.dem.onDeserialize(),p.needsHillshadePrepare=!0,p.needsDEMTextureUpload=!0),p.state="loaded",void o(null))}).bind(this),void 0,!0))}abortTile(p,o){p.request&&(p.request.cancel(),delete p.request),p.actor&&p.actor.send("abortTile",{uid:p.uid,type:this.type,source:this.id,scope:this.scope}),o&&o()}_getNeighboringTiles(p){const o=p.canonical,d=Math.pow(2,o.z),_=(o.x-1+d)%d,b=o.x===0?p.wrap-1:p.wrap,S=(o.x+1+d)%d,T=o.x+1===d?p.wrap+1:p.wrap,I={};return I[new a.aU(p.overscaledZ,b,o.z,_,o.y).key]={backfilled:!1},I[new a.aU(p.overscaledZ,T,o.z,S,o.y).key]={backfilled:!1},o.y>0&&(I[new a.aU(p.overscaledZ,b,o.z,_,o.y-1).key]={backfilled:!1},I[new a.aU(p.overscaledZ,p.wrap,o.z,o.x,o.y-1).key]={backfilled:!1},I[new a.aU(p.overscaledZ,T,o.z,S,o.y-1).key]={backfilled:!1}),o.y+1<d&&(I[new a.aU(p.overscaledZ,b,o.z,_,o.y+1).key]={backfilled:!1},I[new a.aU(p.overscaledZ,p.wrap,o.z,o.x,o.y+1).key]={backfilled:!1},I[new a.aU(p.overscaledZ,T,o.z,S,o.y+1).key]={backfilled:!1}),I}},"raster-array":Sn,geojson:class extends a.E{constructor(p,o,d,_){super(),this.id=p,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._loaded=!1,this.actor=d.getActor(),this.setEventedParent(_),this._data=o.data,this._options=Object.assign({},o),this._collectResourceTiming=o.collectResourceTiming,o.maxzoom!==void 0&&(this.maxzoom=o.maxzoom),o.minzoom!==void 0&&(this.minzoom=o.minzoom),o.type&&(this.type=o.type),o.attribution&&(this.attribution=o.attribution),this.promoteId=o.promoteId;const b=a.ak/this.tileSize;this.workerOptions=Object.assign({source:this.id,scope:this.scope,cluster:o.cluster||!1,geojsonVtOptions:{buffer:(o.buffer!==void 0?o.buffer:128)*b,tolerance:(o.tolerance!==void 0?o.tolerance:.375)*b,extent:a.ak,maxZoom:this.maxzoom,lineMetrics:o.lineMetrics||!1,generateId:o.generateId||!1},superclusterOptions:{maxZoom:o.clusterMaxZoom!==void 0?o.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,o.clusterMinPoints||2),extent:a.ak,radius:(o.clusterRadius!==void 0?o.clusterRadius:50)*b,log:!1,generateId:o.generateId||!1},clusterProperties:o.clusterProperties,filter:o.filter,dynamic:o.dynamic},o.workerOptions)}onAdd(p){this.map=p,this.setData(this._data)}setData(p){return this._data=p,this._updateWorkerData(),this}updateData(p){if(!this._options.dynamic)return this.fire(new a.y(new Error("Can't call updateData on a GeoJSON source with dynamic set to false.")));if(typeof p!="string"&&(p.type==="Feature"&&(p={type:"FeatureCollection",features:[p]}),p.type!=="FeatureCollection"))return this.fire(new a.y(new Error("Data to update should be a feature or a feature collection.")));if(this._coalesce&&typeof p!="string"&&typeof this._data!="string"&&this._data.type==="FeatureCollection"){const o=new Map;for(const d of this._data.features)o.set(d.id,d);for(const d of p.features)o.set(d.id,d);this._data.features=[...o.values()]}else this._data=p;return this._updateWorkerData(!0),this}getClusterExpansionZoom(p,o){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:p,source:this.id,scope:this.scope},o),this}getClusterChildren(p,o){return this.actor.send("geojson.getClusterChildren",{clusterId:p,source:this.id,scope:this.scope},o),this}getClusterLeaves(p,o,d,_){return this.actor.send("geojson.getClusterLeaves",{source:this.id,scope:this.scope,clusterId:p,limit:o,offset:d},_),this}_updateWorkerData(p=!1){if(this._pendingLoad)return void(this._coalesce=!0);this.fire(new a.z("dataloading",{dataType:"source"})),this._loaded=!1;const o=Object.assign({append:p},this.workerOptions);o.scope=this.scope;const d=this._data;typeof d=="string"?(o.request=this.map._requestManager.transformRequest(a.o.resolveURL(d),a.R.Source),o.request.collectResourceTiming=this._collectResourceTiming):o.data=JSON.stringify(d),this._pendingLoad=this.actor.send(`${this.type}.loadData`,o,(_,b)=>{if(this._loaded=!0,this._pendingLoad=null,_)this.fire(new a.y(_));else{const S={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&b&&b.resourceTiming&&b.resourceTiming[this.id]&&(S.resourceTiming=b.resourceTiming[this.id]),p&&(this._partialReload=!0),this.fire(new a.z("data",S)),this._partialReload=!1,this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(p),this._coalesce=!1)})}loaded(){return this._loaded}reload(){const p=a.t(this.id,this.scope);this.map.style.clearSource(p),this._updateWorkerData()}loadTile(p,o){const d=p.actor?"reloadTile":"loadTile";p.actor=this.actor;const _=this.map.style?this.map.style.getLut(this.scope):null,b=_?{image:_.image.clone()}
25:null,S=this._partialReload,T={type:this.type,uid:p.uid,tileID:p.tileID,tileZoom:p.tileZoom,zoom:p.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,lut:b,scope:this.scope,pixelRatio:a.o.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,showElevationIdDebug:!!this.map.painter&&this.map.painter._debugParams.showElevationIdDebug,promoteId:this.promoteId,brightness:this.map.style&&this.map.style.getBrightness()||0,extraShadowCaster:p.isExtraShadowCaster,scaleFactor:this.map.getScaleFactor(),partial:S,worldview:this.map.getWorldview(),indoor:this.map.getIndoorTileOptions(this.id,this.scope)};p.request=this.actor.send(d,T,(I,k)=>S&&!k?(p.state="loaded",o(null)):(delete p.request,p.destroy(!1),p.aborted?o(null):I?o(I):(p.loadVectorData(k,this.map.painter,d==="reloadTile"),o(null))),void 0,d==="loadTile")}abortTile(p){p.request&&(p.request.cancel(),delete p.request),p.aborted=!0}unloadTile(p,o){this.actor.send("removeTile",{uid:p.uid,type:this.type,source:this.id,scope:this.scope}),p.destroy()}onRemove(p){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return Object.assign({}
25,this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends a.aY{constructor(p,o,d,_){super(p,o,d,_),this.roundZoom=!0,this.type="video",this.options=o}load(){this._loaded=!1;const p=this.options;this.urls=[];for(const o of p.urls)this.urls.push(this.map._requestManager.transformRequest(o,a.R.Source).url);a.aZ(this.urls,(o,d)=>{this._loaded=!0,o?this.fire(new a.y(o)):d&&(this.video=d,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(p){if(this.video){const o=this.video.seekable;p<o.start(0)||p>o.end(0)?this.fire(new a.y(new ht(`sources.${this.id}`,null,`Playback for this video can be set only between the ${o.start(0)} and ${o.end(0)}-second mark.`))):this.video.currentTime=p}}getVideo(){return this.video}onAdd(p){this.map||(this.map=p,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 p=this.map.painter.context,o=p.gl;this.texture?this.video.paused||(this.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE),o.texSubImage2D(o.TEXTURE_2D,0,0,0,o.RGBA,o.UNSIGNED_BYTE,this.video)):(this.texture=new a.T(p,this.video,o.RGBA8),this.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(p)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:a.aY,model:a.a$,"batched-model":class extends a.E{constructor(p,o,d,_){super(),this.type="batched-model",this.id=p,this.tileSize=512,this._options=o,this.tiles=this._options.tiles,this.maxzoom=o.maxzoom||19,this.minzoom=o.minzoom||0,this.roundZoom=!0,this.usedInConflation=!0,this.dispatcher=d,this.reparseOverscaled=!1,this.scheme="xyz",this._loaded=!1,this.setEventedParent(_)}onAdd(p){this.map=p,this.load()}reload(){this.cancelTileJSONRequest();const p=a.t(this.id,this.scope);this.load(()=>this.map.style.clearSource(p))}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}load(p){this._loaded=!1,this.fire(new a.z("dataloading",{dataType:"source"}));const o=Array.isArray(this.map._language)?this.map._language.join():this.map._language,d=this.map.getWorldview();this._tileJSONRequest=a.aN(this._options,this.map._requestManager,o,d,(_,b)=>{this._tileJSONRequest=null,this._loaded=!0,_?(o&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${o}`),d&&d.length!==2&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${d}`),this.fire(new a.y(_))):b&&(Object.assign(this,b),b.bounds&&(this.tileBounds=new is(b.bounds,this.minzoom,this.maxzoom)),_n(b.tiles,this.map._requestManager._customAccessToken),this.fire(new a.z("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new a.z("data",{dataType:"source",sourceDataType:"content"}))),p&&p(_)})}hasTransition(){return!1}hasTile(p){return!this.tileBounds||this.tileBounds.contains(p.canonical)}loaded(){return this._loaded}loadTile(p,o){const d=this.map._requestManager.normalizeTileURL(p.tileID.canonical.url(this.tiles,this.scheme)),_={request:this.map._requestManager.transformRequest(d,a.R.Tile),data:void 0,uid:p.uid,tileID:p.tileID,tileZoom:p.tileZoom,zoom:p.tileID.overscaledZ,tileSize:this.tileSize*p.tileID.overscaleFactor(),type:this.t
25ype,source:this.id,scope:this.scope,showCollisionBoxes:this.map.showCollisionBoxes,renderSourceType:p.renderSourceType,brightness:this.map.style&&this.map.style.getBrightness()||0,pixelRatio:a.o.devicePixelRatio,promoteId:this.promoteId};if(p.actor&&p.state!=="expired")if(p.state==="loading")p.reloadCallback=o;else{if(p.buckets){const S=Object.values(p.buckets);for(const T of S)T.dirty=!0;return void(p.state="loaded")}p.request=p.actor.send("reloadTile",_,b.bind(this))}else p.actor=this.dispatcher.getActor(),p.request=p.actor.send("loadTile",_,b.bind(this),void 0,!0);function b(S,T){return p.aborted?o(null):S&&S.status!==404?o(S):(this.map._refreshExpiredTiles&&T&&p.setExpiryData(T),p.loadModelData(T,this.map.painter),p.state="loaded",void o(null))}}serialize(){return Object.assign({},this._options)}},canvas:class extends a.aY{constructor(p,o,d,_){super(p,o,d,_),o.coordinates?Array.isArray(o.coordinates)&&o.coordinates.length===4&&!o.coordinates.some(b=>!Array.isArray(b)||b.length!==2||b.some(S=>typeof S!="number"))||this.fire(new a.y(new ht(`sources.${p}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new a.y(new ht(`sources.${p}`,null,'missing required property "coordinates"'))),o.animate&&typeof o.animate!="boolean"&&this.fire(new a.y(new ht(`sources.${p}`,null,'optional "animate" property must be a boolean value'))),o.canvas?typeof o.canvas=="string"||o.canvas instanceof HTMLCanvasElement||this.fire(new a.y(new ht(`sources.${p}`,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 a.y(new ht(`sources.${p}`,null,'missing required property "canvas"'))),this.options=o,this.animate=o.animate===void 0||o.animate}load(){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 a.y(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(p){this.map=p,this.load(),this.canvas&&this.animate&&this.play()}onRemove(p){this.pause()}prepare(){let p=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,p=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,p=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const o=this.map.painter.context;this.texture?!p&&!this._playing||this.texture instanceof a.a_||this.texture.update(this.canvas,{premultiply:!0}):this.texture=new a.T(o,this.canvas,o.gl.RGBA8,{premultiply:!0}),this._prepareData(o)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const p of[this.canvas.width,this.canvas.height])if(isNaN(p)||p<=0)return!0;return!1}},custom:class extends a.E{constructor(p,o,d,_){super(),this.id=p,this.type="custom",this._dataType="raster",this._dispatcher=d,this._implementation=o,this.setEventedParent(_),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new a.y(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new a.y(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new is(this._implementation.bounds,this.minzoom,this.maxzoom));const b=o;b.update=this._update.bind(this),b.clearTiles=this._clearTiles.bind(this),b.coveringTiles=this._coveringTiles.bind(this),Object.assign(this,a.aK(o,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]))}serialize(){return a.aK(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new a.z("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new a.z("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(p){this.map=p,this._loaded=!1,this.fire(new a.z("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(p),this.load()}onRemove(p){this._implementation.onRemove&&this._implementation.onRemove(p)}hasTile(p){if(this._implementation.hasTile){const{x:o,y:d,z:_}
25=p.canonical;return this._implementation.hasTile({x:o,y:d,z:_})}return!this.tileBounds||this.tileBounds.contains(p.canonical)}loadTile(p,o){const{x:d,y:_,z:b}=p.tileID.canonical,S=new AbortController,T=Promise.resolve(this._implementation.loadTile({x:d,y:_,z:b},{signal:S.signal})).then((function(I){return delete p.request,p.aborted?(p.state="unloaded",o(null)):I===void 0?(p.state="errored",o(null)):I===null?(this.loadTileData(p,{width:this.tileSize,height:this.tileSize,data:null}),p.state="loaded",o(null)):(function(k){return k instanceof ImageData||k instanceof HTMLCanvasElement||k instanceof ImageBitmap||k instanceof HTMLImageElement})(I)?(this.loadTileData(p,I),p.state="loaded",void o(null)):(p.state="errored",o(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)))}).bind(this)).catch(I=>{I.name!=="AbortError"&&(p.state="errored",o(I))});T.cancel=()=>S.abort(),p.request=T}loadTileData(p,o){p.setTexture(o,this.map.painter)}unloadTile(p,o){if(p.texture&&p.texture instanceof a.T?(p.destroy(!1),p.texture&&p.texture instanceof a.T&&this.map.painter.saveTileTexture(p.texture)):p.destroy(),this._implementation.unloadTile){const{x:d,y:_,z:b}=p.tileID.canonical;this._implementation.unloadTile({x:d,y:_,z:b})}o&&o()}abortTile(p,o){p.request&&p.request.cancel&&(p.request.cancel(),delete p.request),o&&o()}hasTransition(){return!1}_coveringTiles(){return this.map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map(p=>({x:p.canonical.x,y:p.canonical.y,z:p.canonical.z}))}_clearTiles(){const p=a.t(this.id,this.scope);this.map.style.clearSource(p)}_update(){this.fire(new a.z("data",{dataType:"source",sourceDataType:"content"}))}}},rg=function(p,o,d,_){const b=new xr[o.type](p,o,d,_);if(b.id!==p)throw new Error(`Expected Source id to be ${p} instead of ${b.id}`);return a.b0(["load","abort","unload","serialize","prepare"],b),b};function h1(p,o,d=""){return`${d}:${o.id||""}:${o.layer.id}:${(function(_){if("layerId"in _)return`layer:${_.layerId}`;{const{featuresetId:b,importId:S}=_;return`featureset:${b}${S?`:import:${S}`:""}`}})(p.target)}`}function f1(p,o,d,_=""){if(p.uniqueFeatureID){const b=h1(p,o,_);if(d.has(b))return!0;d.add(b)}return!1}function p1(p,o,d,_,b=!1,S=void 0){const T=o.sourceCache.transform,I=o.sourceCache.tilesIn(p,o.has3DLayers,b);I.sort(og);const k=[];for(const F of I){const z=F.tile.queryRenderedFeatures(o,F,d,_,T,b,S);Object.keys(z).length&&k.push({wrappedTileID:F.tile.tileID.wrapped().key,queryResults:z})}for(const F in o.layers){const z=o.layers[F];if(z.styleLayer){const q=z.styleLayer.queryRenderedFeatures(p,o.sourceCache,_);Object.keys(q).length&&k.push({wrappedTileID:0,queryResults:q})}}return k.length===0?{}:(function(F){const z={},q={};for(const j of F){const Z=j.queryResults,te=j.wrappedTileID,ee=q[te]=q[te]||{};for(const oe in Z){const se=Z[oe],de=ee[oe]=ee[oe]||{},pe=z[oe]=z[oe]||[];for(const ce of se)de[ce.featureIndex]||(de[ce.featureIndex]=!0,pe.push(ce))}}return z})(k)}function ig(p,o,d,_,b,S){const T={},I=_.queryRenderedSymbols(p),k=[];for(const F of Object.keys(I).map(Number))k.push(b[F]);k.sort(og);for(const F of k){const z=F.featureIndex.lookupSymbolFeatures(I[F.bucketInstanceId],F.bucketIndex,F.sourceLayerIndex,o,d,S);for(const q in z){const j=T[q]=T[q]||[],Z=z[q];Z.sort((te,ee)=>{const oe=F.featureSortOrder;if(oe){const se=oe.indexOf(te.featureIndex);return oe.indexOf(ee.featureIndex)-se}return ee.featureIndex-te.featureIndex});for(const te of Z)j.push(te)}}return T}function pl(p,o){const d=p.getRenderableIds().map(S=>p.getTileByID(S)),_=[],b={};for(let S=0;S<d.length;S++){const T=d[S],I=T.tileID.canonical.key;b[I]||(b[I]=!0,T.querySourceFeatures(_,o))}return _}function og(p,o){const d=p.tileID,_=o.tileID;return d.overscaledZ-_.overscaledZ||d.canonical.y-_.canonical.y||d.wrap-_.wrap||d.canonical.x-_.canonical.x}a.b1.setPbf(a.b2);class vu extends a.b3{constructor(o,d,_,b,S){super(o,d,_,b,S),this._workQueuePerLayer=new Map,this._fetchQueuePerLayer=new Map,this._taskQueue=new Map,this._isHeaderLoaded=!1,this.textureDescriptorPerLayer=new Map,this.texturePerLayer=new Map}
25getLayers(){return this._mrt?Object.values(this._mrt.layers):[]}getLayer(o){return this._mrt&&this._mrt.getLayer(o)}setTexturePerLayer(o,d,_){const b=_.context,S=b.gl;let T=this.texturePerLayer.get(o)||_.getTileTexture(d.width);T&&T instanceof a.T?T.update(d,{premultiply:!1}):T=new a.T(b,d,S.RGBA8,{premultiply:!1}),this.texturePerLayer.has(o)||this.texturePerLayer.set(o,T)}flushQueues(o){const d=this._workQueuePerLayer.get(o)||[],_=this._fetchQueuePerLayer.get(o)||[];for(;d.length;)d.pop()();for(;_.length;)_.pop()()}flushAllQueues(){for(const o of this._workQueuePerLayer.keys()){const d=this._workQueuePerLayer.get(o)||[];for(;d.length;)d.pop()()}for(const o of this._fetchQueuePerLayer.keys()){const d=this._fetchQueuePerLayer.get(o)||[];for(;d.length;)d.pop()()}}fetchHeader(o=16384,d){const _=this._mrt=new a.b1(30),b=Object.assign({},this.requestParams,{headers:{Range:"bytes=0-"+(o-1)}});return this.entireBuffer=null,this.request=a.b4(b,(S,T,I)=>{if(S)d(S);else try{const k=_.getHeaderLength(T);if(k>o)return void(this.request=this.fetchHeader(k,d));_.parseHeader(T),this._isHeaderLoaded=!0;let F=0;for(const z of Object.values(_.layers))F=Math.max(F,z.dataIndex.at(-1).lastByte);T.byteLength>=F&&(this.entireBuffer=T),d(null,this.entireBuffer||T,I)}catch(k){d(k)}}),this.request}fetchBandForRender(o,d,_,b){this.fetchBand(o,d,_,S=>{if(S)return void b(S);this.updateTextureDescriptor(o,d,_);const T=this.textureDescriptorPerLayer.get(d);b(null,T?T.img:null)})}fetchBand(o,d,_,b,S=!0){const T=this._mrt;if(!this._isHeaderLoaded||!T)return void b(new Error("Tile header is not ready"));const I=this.actor;if(!I)return void b(new Error("Can't fetch tile band without an actor"));let k;const F=a.t(String(_),a.t(this.tileID.key,o));let z=this._taskQueue.get(F);z?z.add(b):(z=new Set,z.add(b),this._taskQueue.set(F,z));const q=(ee,oe)=>{k.complete(ee,oe),ee?b(ee):(z.forEach(se=>se(null,oe)),this._taskQueue.delete(F))},j=(ee,oe)=>{if(ee)return b(ee);const se=I.send("decodeRasterArray",{type:"raster-array",source:this.source,scope:this.scope,tileID:this.tileID,uid:this.uid,buffer:oe,task:k},q,void 0,!0);if(d!==null){const de=this._workQueuePerLayer.get(d)||[];de.push(()=>{se&&se.cancel(),k.cancel()}),this._workQueuePerLayer.has(d)||this._workQueuePerLayer.set(d,de)}};let Z;try{Z=T.getLayer(o)}catch(ee){if(this.state==="reloading")return;throw ee}if(!Z)return void b(new Error(`Unknown sourceLayer "${o}"`));if(Z.hasDataForBand(_))return z.forEach(ee=>ee(null,null)),void this._taskQueue.delete(F);const te=Z.getDataRange([_]);if(k=T.createDecodingTask(te),!k||k.tasks.length)if(d!==null&&this.flushQueues(d),this.entireBuffer)j(null,this.entireBuffer.slice(te.firstByte,te.lastByte+1));else{const ee=Object.assign({},this.requestParams,{headers:{Range:`bytes=${te.firstByte}-${te.lastByte}`}}),oe=a.b4(ee,j);if(d!==null){const se=this._fetchQueuePerLayer.get(d)||[];se.push(()=>{oe.cancel(),k.cancel()}),this._fetchQueuePerLayer.has(d)||this._fetchQueuePerLayer.set(d,se)}}}updateNeeded(o,d){return(!this.textureDescriptorPerLayer.get(o)||this.textureDescriptorPerLayer.get(o).band!==d||this.refreshedUponExpiration)&&this.state!=="errored"}updateTextureDescriptor(o,d,_){if(!this._mrt)return;const b=this._mrt.getLayer(o);if(!b||!b.hasBand(_)||!b.hasDataForBand(_))return;const{bytes:S,tileSize:T,buffer:I,offset:k,scale:F}=b.getBandView(_),z=T+2*I,q=new a.q({width:z,height:z},S),j=this.texturePerLayer.get(d);j&&j instanceof a.T&&j.update(q,{premultiply:!1}),this.textureDescriptorPerLayer.set(d,{layer:o,band:_,img:q,buffer:I,offset:k,tileSize:T,format:b.pixelFormat,mix:[F,256*F,65536*F,16777216*F]})}destroy(o=!1){if(super.destroy(o),delete this._mrt,!o)for(const d of this.texturePerLayer.values())d&&d instanceof a.T&&d.destroy();this.texturePerLayer.clear(),this.textureDescriptorPerLayer.clear(),this.fbo&&(this.fbo.destroy(),delete this.fbo),delete this.request,delete this.requestParams,this._isHeaderLoaded=!1}}class un{constructor(o,d){this.max=o,this.onRemove=d,this.reset()}reset(){for(const o in this.data)for(const d of this.data[o])d.timeout&&clearTimeout(d.timeout),this.onRemove(d.value);return this.data={},this.order=[],this}add(o,d,_){const b=o.wrapped().key;this.data[b]===void 0&&(this.data[b]=[]);const S={value:d,timeout:void 0};if(_!==void 0&&(S.timeout=setTimeout(()=>{this.remove(o,S)},_)),this.data[b].push(S),this.order.push(b),this.order.length>this.max){const T=this._getAndRemoveByKey(this.order[0]);T&&this.onRemove(T)}return this}has(o){return o.wrapped().key in this.data}getAndRemove(o){return this.has(o)?this._getAndRemoveByKey(o.wrapped().key):null}_getAndRemoveByKey(o){const d=this.data[o].shift();return d.timeout&&clearTimeout(d.timeout),this.data[o].length===0&&delete this.data[o],this.order.splice(this.order.indexOf(o),1),d.value}getByKey(o){const d=this.data[o];return d?d[0].value:null}get(o){return this.has(o)?this.data[o.wrapped().key][0].value:null}remove(o,d){if(!this.has(o))return this;const _=o.wrapped().key,b=d===void 0?0:this.data[_].indexOf(d),S=this.data[_][b];return this.data[_].splice(b,1),S.timeout&&clearTimeout(S.timeout),this.data[_].length===0&&delete this.data[_],this.onRemove(S.value),this.order.splice(this.order.indexOf(_),1),this}setMaxSize(o){for(this.max=o;this.order.length>this.max;){const d=this._getAndRemoveByKey(this.order[0]);d&&this.onRemove(d)}return this}filter(o){const d=[];for(const _ in this.data)for(const b of this.data[_])o(b.value)||d.push(b);for(const _ of d)this.remove(_.value.tileID,_)}}class Rr{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(o,d,_){const b=String(d);if(this.stateChanges[o]=this.stateChanges[o]||{},this.stateChanges[o][b]=this.stateChanges[o][b]||{},Object.assign(this.stateChanges[o][b],_),this.deletedStates[o]===null){this.deletedStates[o]={};for(const S in this.state[o])S!==b&&(this.deletedStates[o][S]=null)}else if(this.deletedStates[o]&&this.deletedStates[o][b]===null){this.deletedStates[o][b]={};for(const S in this.state[o][b])_[S]||(this.deletedStates[o][b][S]=null)}else for(const S in _)this.deletedStates[o]&&this.deletedStates[o][b]&&this.deletedStates[o][b][S]===null&&delete this.deletedStates[o][b][S]}
25removeFeatureState(o,d,_){if(this.deletedStates[o]===null)return;const b=String(d);if(this.deletedStates[o]=this.deletedStates[o]||{},_&&d!==void 0)this.deletedStates[o][b]!==null&&(this.deletedStates[o][b]=this.deletedStates[o][b]||{},this.deletedStates[o][b][_]=null);else if(d!==void 0)if(this.stateChanges[o]&&this.stateChanges[o][b])for(_ in this.deletedStates[o][b]={},this.stateChanges[o][b])this.deletedStates[o][b][_]=null;else this.deletedStates[o][b]=null;else this.deletedStates[o]=null}getState(o,d){const _=this.state[o]||{},b=this.stateChanges[o]||{},S=this.deletedStates[o];if(S===null)return{};if(d!==void 0){const I=String(d),k=Object.assign({},_[I],b[I]);if(S){const F=S[d];if(F===null)return{};for(const z in F)delete k[z]}return k}const T=Object.assign({},_,b);if(S)for(const I in S)delete T[I];return T}initializeTileState(o,d){o.refreshFeatureState(d)}coalesceChanges(o,d){const _={};for(const b in this.stateChanges){this.state[b]=this.state[b]||{};const S={};for(const T in this.stateChanges[b])this.state[b][T]||(this.state[b][T]={}),Object.assign(this.state[b][T],this.stateChanges[b][T]),S[T]=this.state[b][T];_[b]=S}for(const b in this.deletedStates){this.state[b]=this.state[b]||{};const S={};if(this.deletedStates[b]===null)for(const T in this.state[b])S[T]={},this.state[b][T]={};else for(const T in this.deletedStates[b]){if(this.deletedStates[b][T]===null)this.state[b][T]={};else if(this.state[b][T])for(const I of Object.keys(this.deletedStates[b][T]))delete this.state[b][T][I];S[T]=this.state[b][T]}_[b]=_[b]||{},Object.assign(_[b],S)}if(this.stateChanges={},this.deletedStates={},Object.keys(_).length!==0)for(const b in o)o[b].refreshFeatureState(d,_)}}class ur extends a.E{constructor(o,d,_){super(),this.id=o,this._renderSourceType=_,this._maxzoomOverride=null,d.on("data",b=>{b.dataType==="source"&&b.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&b.dataType==="source"&&b.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform))}),d.on("error",()=>{this._sourceErrored=!0}),this._source=d,this._tiles={},this._cache=new un(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=d.minTileCacheSize,this._maxTileCacheSize=d.maxTileCacheSize,this._loadedParentTiles={},this.castsShadows=!1,this.tileCoverLift=0,this._coveredTiles={},this._shadowCasterTiles={},this._state=new Rr,this._isRaster=this._source.type==="raster"||this._source.type==="raster-dem"||this._source.type==="raster-array"||this._source.type==="custom"&&"_dataType"in this._source&&this._source._dataType==="raster",this._supportsFading=this._source.type==="raster"||this._source.type==="raster-array"||this._source.type==="image"||this._source.type==="video"||this._source.type==="custom",this._isRasterElevatedOverTerrain=!1}onAdd(o){this.map=o,this._minTileCacheSize=this._minTileCacheSize===void 0&&o?o._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=this._maxTileCacheSize===void 0&&o?o._maxTileCacheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const o in this._tiles)if(!this._tiles[o].loaded())return!1;return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const o=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,o&&this.reload(),this.transform&&this.update(this.transform)}setMaxzoomOverride(o){this._maxzoomOverride=o}_loadTile(o,d){return o.renderSourceType=this._renderSourceType,o.isExtraShadowCaster=this._shadowCasterTiles[o.tileID.key],this._source.loadTile(o,d)}_unloadTile(o){if(this._source.unloadTile)return this._source.unloadTile(o)}_abortTile(o){if(this._source.abortTile)return this._source.abortTile(o)}serialize(){return this._source.serialize()}prepare(o){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const d in this._tiles){const _=this._tiles[d];_.upload(o,this.map?this.map.painter:void 0),_.prepare(this.map.style.imageManager,this.map?this.map.painter:null,this._source.scope)}}getIds(){return Object.values(this._tiles).map(o=>o.tileID).sort(Es).map(o=>o.key)}getRenderableIds(o,d){const _=[];for(const b in this._tiles)this._isIdRenderable(+b,o,d)&&_.push(this._tiles[b]);
25return o?_.sort((b,S)=>{const T=b.tileID,I=S.tileID,k=new a.P(T.canonical.x,T.canonical.y)._rotate(this.transform.angle),F=new a.P(I.canonical.x,I.canonical.y)._rotate(this.transform.angle);return T.overscaledZ-I.overscaledZ||F.y-k.y||F.x-k.x}).map(b=>b.tileID.key):_.map(b=>b.tileID).sort(Es).map(b=>b.key)}hasRenderableParent(o){const d=this.findLoadedParent(o,0);return!!d&&this._isIdRenderable(d.tileID.key)}_isIdRenderable(o,d,_){return this._tiles[o]&&this._tiles[o].hasData()&&!this._coveredTiles[o]&&(d||!this._tiles[o].holdingForFade())&&(_||!this._shadowCasterTiles[o])}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const o in this._tiles)this._tiles[o].state!=="errored"&&this._reloadTile(+o,"reloading")}}_reloadTile(o,d){const _=this._tiles[o];_&&(_.state!=="loading"&&(_.state=d),this._loadTile(_,this._tileLoaded.bind(this,_,o,d)))}_tileLoaded(o,d,_,b,S){if(b){if(o.state="errored",a.b5(b)){if(this._source.fire(new a.z("data",{dataType:"source",sourceDataType:"error",sourceId:this._source.id,tile:o})),!(o.tileID.key in this._loadedParentTiles))return;if(this._source.type==="raster-dem"&&this.usedForTerrain&&this.map.painter.terrain){const I=this.map.painter.terrain;this.update(this.transform,I.getScaledDemTileSize(),!0),I.resetTileLookupCache(this.id)}else this.update(this.transform)}else this._source.fire(new a.y(b,{tile:o}));return}o.timeAdded=a.o.now(),_==="expired"&&(o.refreshedUponExpiration=!0),this._setTileReloadTimer(d,o),this._source.type==="raster-dem"&&o.dem&&this._backfillDEM(o),this._state.initializeTileState(o,this.map?this.map.painter:null);let T=new Map;S&&S.responseHeaders&&(T=S.responseHeaders),this._source.fire(new a.z("data",{dataType:"source",tile:o,coord:o.tileID,sourceCacheId:this.id,responseHeaders:T}))}_hasTunnelGeometry(){for(const o in this._tiles){const d=this._tiles[o];if(d&&d.hasTunnelGeometry)return!0}return!1}_backfillDEM(o){const d=this.getRenderableIds();for(let b=0;b<d.length;b++){const S=d[b];if(o.neighboringTiles&&o.neighboringTiles[S]){const T=this.getTileByID(S);_(o,T),_(T,o)}}function _(b,S){if(!b.dem||b.dem.borderReady)return;b.needsHillshadePrepare=!0,b.needsDEMTextureUpload=!0;let T=S.tileID.canonical.x-b.tileID.canonical.x;const I=S.tileID.canonical.y-b.tileID.canonical.y,k=Math.pow(2,b.tileID.canonical.z),F=S.tileID.key;T===0&&I===0||Math.abs(I)>1||(Math.abs(T)>1&&(Math.abs(T+k)===1?T+=k:Math.abs(T-k)===1&&(T-=k)),S.dem&&b.dem&&(b.dem.backfillBorder(S.dem,T,I),b.neighboringTiles&&b.neighboringTiles[F]&&(b.neighboringTiles[F].backfilled=!0)))}}getTile(o){return this.getTileByID(o.key)}getTileByID(o){return this._tiles[o]}_retainLoadedChildren(o,d,_,b){for(const S in this._tiles){let T=this._tiles[S];if(b[S]||!T.hasData()||T.tileID.overscaledZ<=d||T.tileID.overscaledZ>_)continue;let I=T.tileID;for(;T&&T.tileID.overscaledZ>d+1;){const F=T.tileID.scaledTo(T.tileID.overscaledZ-1);T=this._tiles[F.key],T&&T.hasData()&&(I=F)}let k=I;for(;k.overscaledZ>d;)if(k=k.scaledTo(k.overscaledZ-1),o[k.key]){b[I.key]=I;break}}}findLoadedParent(o,d){if(o.key in this._loadedParentTiles){const _=this._loadedParentTiles[o.key];return _&&_.tileID.overscaledZ>=d?_:null}for(let _=o.overscaledZ-1;_>=d;_--){const b=o.scaledTo(_),S=this._getLoadedTile(b);if(S)return S}}_getLoadedTile(o){const d=this._tiles[o.key];return d&&d.hasData()?d:this._cache.getByKey(this._source.reparseOverscaled?o.wrapped().key:o.canonical.key)}updateCacheSize(o,d){d=d||this._source.tileSize;const _=Math.ceil(o.width/d)+1,b=Math.ceil(o.height/d)+1,S=Math.floor(_*b*5),T=typeof this._minTileCacheSize=="number"?Math.max(this._minTileCacheSize,S):S,I=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,T):T;this._cache.setMaxSize(I)}handleWrapJump(o){const d=Math.round((o-(this._prevLng===void 0?o:this._prevLng))/360);if(this._prevLng=o,d){const _={};for(const b in this._tiles){const S=this._tiles[b];S.tileID=S.tileID.unwrapTo(S.tileID.wrap+d),_[S.tileID.key]=S}this._tiles=_;for(const b in this._timers)clearTimeout(this._timers[b]),delete this._timers[b];for(const b in this._tiles)this._setTileReloadTimer(+b,this._tiles[b])}}update(o,d,_,b,S){if(this.transform=o,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage||this.usedForTerrain&&!_)return;this.updateCacheSize(o,d),this.transform.projection.name!=="globe"&&this.handleWrapJump(this.transform.center.lng),this._shadowCasterTiles={},this._coveredTiles={};const T=this._source.type==="batched-model";let I,k=this._source.maxzoom;this._maxzoomOverride!==null&&(k=Math.min(k,this._maxzoomOverride));const F=this.map&&this.map.painter?this.map.painter._terrain:null;if(F&&F.sourceCache===this&&F.attenuationRange()){const Z=F.attenuationRange()[0],te=Math.floor(Z)-Math.log2(F.getDemUpscale());k>te&&(k=te)}const z=this._maxzoomOverride===null&&this._source.reparseOverscaled;if(this.used||this.usedForTerrain){if(this._source.tileID)I=o.getVisibleUnwrappedCoordinates(this._source.tileID).map(Z=>new a.aU(Z.canonical.z,Z.wrap,Z.canonical.z,Z.canonical.x,Z.canonical.y));else if(this.tileCoverLift!==0){const Z=o.clone();Z.tileCoverLift=this.tileCoverLift,I=Z.coveringTiles({tileSize:d||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:k,roundZoom:this._source.roundZoom&&!_,reparseOverscaled:z,isTerrainDEM:this.usedForTerrain,calculateQuadrantVisibility:T}),this._source.minzoom<=1&&o.projection.name==="globe"&&(I.push(new a.aU(1,0,1,0,0)),I.push(new a.aU(1,0,1,1,0)),I.push(new a.aU(1,0,1,0,1)),I.push(new a.aU(1,0,1,1,1)))}else if(I=o.coveringTiles({tileSize:d||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:k,roundZoom:this._source.roundZoom&&!_,reparseOverscaled:z,isTerrainDEM:this.usedForTerrain,calculateQuadrantVisibility:T}),this._source.hasTile){const Z=this._source.hasTile.bind(this._source);I=I.filter(te=>Z(te))}}else I=[];if(I.length>0&&this.transform.projection.name!=="globe"&&!this.usedForTerrain&&!this._supportsFading){const Z=o.coveringZoomLevel({tileSize:d||this._source.tileSize,roundZoom:this._source.roundZoom&&!_}),te=Math.min(Z,k);if(T){const ee=o.extendTileCover(I,te);for(const oe of ee)I.push(oe)}else if(S){const ee=this.transform.getFrustum(te),oe=o.extendTileCoverToNearPlane(I,ee,te);for(const se of oe)I.push(se);if(te>=18&&this._hasTunnelGeometry()){const se=o.extendTileCoverForTunnels(I,ee,te,20);for(const de of se)I.push(de)}}else if(this.castsShadows&&b){const ee=o.extendTileCover(I,te,b,16);for(const oe of ee)this._shadowCasterTiles[oe.key]=!0,I.push(oe)}}const q=this._updateRetainedTiles(I);if(this._supportsFading&&I.length!==0){const Z={},te={},ee=a.o.now(),oe=Object.keys(q);for(const de of oe){const pe=q[de],ce=this._tiles[de];if(!ce||ce.fadeEndTime!==void 0&&ce.fadeEndTime<=ee)continue;const Ce=this.findLoadedParent(pe,Math.max(pe.overscaledZ-ur.maxOverzooming,this._source.minzoom));Ce&&(this._addTile(Ce.tileID),Z[Ce.tileID.key]=Ce.tileID),te[de]=pe}const se=I.at(-1).overscaledZ;for(const de in this._tiles){const pe=this._tiles[de];if(q[de]||!pe.hasData())continue;let ce=pe.tileID;for(;ce.overscaledZ>se;){ce=ce.scaledTo(ce.overscaledZ-1);const Ce=this._tiles[ce.key];if(Ce&&Ce.hasData()&&te[ce.key]){q[de]=pe.tileID;break}}}for(const de in Z)q[de]||(this._coveredTiles[de]=!0,q[de]=Z[de])}for(const Z in q)this._tiles[Z].clearFadeHold();const j=a.b6(this._tiles,q);for(const Z of j){const te=this._tiles[Z];te.hasSymbolBuckets&&!te.holdingForFade()?te.setHoldDuration(this.map._fadeDuration):te.hasSymbolBuckets&&!te.symbolFadeFinished()||this._removeTile(+Z)}this._updateLoadedParentTileCache(),this._renderSourceType===a.b7.Symbol&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const o in this._tiles)this._tiles[o].holdingForFade()&&this._removeTile(+o)}_updateRetainedTiles(o){const d={};if(o.length===0)return d;const _={},b=o.reduce((F,z)=>
25Math.min(F,z.overscaledZ),1/0),S=o[0].overscaledZ,T=Math.max(S-ur.maxOverzooming,this._source.minzoom),I=Math.max(S+ur.maxUnderzooming,this._source.minzoom),k={};for(const F of o){const z=this._addTile(F);d[F.key]=F,z.hasData()||b<this._source.maxzoom&&(k[F.key]=F)}this._retainLoadedChildren(k,b,I,d);for(const F of o){let z=this._tiles[F.key];if(z.hasData())continue;if(F.canonical.z>=this._source.maxzoom){const j=F.children(this._source.maxzoom)[0],Z=this.getTile(j);if(Z&&Z.hasData()){d[j.key]=j;continue}}else{const j=F.children(this._source.maxzoom);if(d[j[0].key]&&d[j[1].key]&&d[j[2].key]&&d[j[3].key])continue}let q=z.wasRequested();for(let j=F.overscaledZ-1;j>=T;--j){const Z=F.scaledTo(j);if(_[Z.key]||(_[Z.key]=!0,z=this.getTile(Z),!z&&q&&(z=this._addTile(Z)),z&&(d[Z.key]=Z,q=z.wasRequested(),z.hasData())))break}}return d}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const o in this._tiles){const d=[];let _,b=this._tiles[o].tileID;for(;b.overscaledZ>0;){if(b.key in this._loadedParentTiles){_=this._loadedParentTiles[b.key];break}d.push(b.key);const S=b.scaledTo(b.overscaledZ-1);if(_=this._getLoadedTile(S),_)break;b=S}for(const S of d)this._loadedParentTiles[S]=_}}_addTile(o){let d=this._tiles[o.key];if(d)return d.isExtraShadowCaster!==!0||this._shadowCasterTiles[o.key]||this._reloadTile(o.key,"reloading"),d;d=this._cache.getAndRemove(o),d&&(this._setTileReloadTimer(o.key,d),d.tileID=o,this._state.initializeTileState(d,this.map?this.map.painter:null),this._cacheTimers[o.key]&&(clearTimeout(this._cacheTimers[o.key]),delete this._cacheTimers[o.key],this._setTileReloadTimer(o.key,d)));const _=!!d;if(!_){const b=this.map?this.map.painter:null,S=this._source.tileSize*o.overscaleFactor();d=this._source.type==="raster-array"?new vu(o,S,this.transform.tileZoom,b,this._isRaster):new a.b3(o,S,this.transform.tileZoom,b,this._isRaster,this._source.worldview),this._loadTile(d,this._tileLoaded.bind(this,d,o.key,d.state))}return d.uses++,this._tiles[o.key]=d,_||this._source.fire(new a.z("dataloading",{tile:d,coord:d.tileID,dataType:"source"})),d}_setTileReloadTimer(o,d){o in this._timers&&(clearTimeout(this._timers[o]),delete this._timers[o]);const _=d.getExpiryTimeout();_&&(this._timers[o]=setTimeout(()=>{this._reloadTile(o,"expired"),delete this._timers[o]},_))}_removeTile(o){const d=this._tiles[o];d&&(d.uses--,delete this._tiles[o],this._timers[o]&&(clearTimeout(this._timers[o]),delete this._timers[o]),d.uses>0||(d.hasData()&&d.state!=="reloading"||d.state==="empty"?this._cache.add(d.tileID,d,d.getExpiryTimeout()):(d.aborted=!0,this._abortTile(d),this._unloadTile(d))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const o in this._tiles)this._removeTile(+o);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(o,d,_){const b=[],S=this.transform;if(!S)return b;const T=S.projection.name==="globe",I=a.aG(S.center.lng);for(const k in this._tiles){const F=this._tiles[k];if(_&&F.clearQueryDebugViz(),F.holdingForFade())continue;let z;if(T){const q=F.tileID.canonical;if(q.z===0){const j=[Math.abs(a.aB(I,...jl(q,-1))-I),Math.abs(a.aB(I,...jl(q,1))-I)];z=[0,2*j.indexOf(Math.min(...j))-1]}else{const j=[Math.abs(a.aB(I,...jl(q,-1))-I),Math.abs(a.aB(I,...jl(q,0))-I),Math.abs(a.aB(I,...jl(q,1))-I)];z=[j.indexOf(Math.min(...j))-1]}}else z=[0];for(const q of z){const j=o.containsTile(F,S,d,q);j&&b.push(j)}}return b}getShadowCasterCoordinates(){return this._getRenderableCoordinates(!1,!0)}getVisibleCoordinates(o){return this._getRenderableCoordinates(o)}_getRenderableCoordinates(o,d){const _=this.getRenderableIds(o,d).map(S=>this._tiles[S].tileID),b=this.transform.projection.name==="globe";for(const S of _)S.projMatrix=this.transform.calculateProjMatrix(S.toUnwrapped()),S.expandedProjMatrix=b?this.transform.calculateProjMatrix(S.toUnwrapped(),!1,!0):S.projMatrix;return _}sortCoordinatesByDistance(o){const d=o.slice(),_=this.transform._camera.position,b=this.transform._camera.forward(),S={};for(const T of d){const I=1/(1<<T.canonical.z);S[T.key]=((T.canonical.x+.5)*I+T.wrap-_[0])*b[0]+((T.canonical.y+.5)*I-_[1])*b[1]-_[2]*b[2]}return d.sort((T,I)=>S[T.key]-S[I.key]),d}hasTransition(){if(this._source.hasTransition())return!0;
25if(this._supportsFading){const o=a.o.now();for(const d in this._tiles){const _=this._tiles[d];if(_.fadeEndTime!==void 0&&_.fadeEndTime>=o)return!0}}return!1}setFeatureState(o,d,_){this._state.updateState(o=o||"_geojsonTileLayer",d,_)}removeFeatureState(o,d,_){this._state.removeFeatureState(o=o||"_geojsonTileLayer",d,_)}getFeatureState(o,d){return this._state.getState(o=o||"_geojsonTileLayer",d)}setDependencies(o,d,_){const b=this._tiles[o];b&&b.setDependencies(d,_)}reloadTilesForDependencies(o,d){for(const _ in this._tiles)this._tiles[_].hasDependency(o,d)&&this._reloadTile(+_,"reloading");this._cache.filter(_=>!_.hasDependency(o,d))}_preloadTiles(o,d){if(!this._sourceLoaded){const k=()=>{this._sourceLoaded&&(this._source.off("data",k),this._preloadTiles(o,d))};return void this._source.on("data",k)}const _=new Map,b=Array.isArray(o)?o:[o],S=this.map.painter.terrain,T=this.usedForTerrain&&S?S.getScaledDemTileSize():this._source.tileSize;for(const k of b){const F=k.coveringTiles({tileSize:T,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const z of F)_.set(z.key,z);this.usedForTerrain&&k.updateElevation(!1)}const I=Array.from(_.values());a.ao(I,(k,F)=>{const z=new a.b3(k,this._source.tileSize*k.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster,this._source.worldview);this._loadTile(z,q=>{this._source.type==="raster-dem"&&z.dem&&this._backfillDEM(z),F(q,z)})},d)}}function Es(p,o){const d=Math.abs(2*p.wrap)-+(p.wrap<0),_=Math.abs(2*o.wrap)-+(o.wrap<0);return p.overscaledZ-o.overscaledZ||_-d||o.canonical.y-p.canonical.y||o.canonical.x-p.canonical.x}function jl(p,o){const d=1<<p.z;return[p.x/d+o,(p.x+1)/d+o]}ur.maxOverzooming=10,ur.maxUnderzooming=3;class Mr{constructor(o){this.style=o,this.layersGotHidden=!1,this.layers=[]}processLayersChanged(){this.layers=[];const o=!1,d=!1;for(const _ in this.style._mergedLayers){const b=this.style._mergedLayers[_];if(b.type==="fill-extrusion"||b.type==="building")this.layers.push({layer:b,visible:o,visibilityChanged:d});else if(b.type==="model"){const S=this.style.getLayerSource(b);S&&S.type==="batched-model"&&this.layers.push({layer:b,visible:o,visibilityChanged:d})}}}onNewFrame(o){this.layersGotHidden=!1;for(const d of this.layers){const _=d.layer;let b=!1;_.type==="fill-extrusion"?b=!_.isHidden(o)&&_.paint.get("fill-extrusion-opacity")>0:_.type==="building"?b=!_.isHidden(o)&&_.paint.get("building-opacity")>0:_.type==="model"&&(b=!_.isHidden(o)&&_.paint.get("model-opacity").constantOr(1)>0),this.layersGotHidden=this.layersGotHidden||!b&&d.visible,d.visible=b}}updateZOffset(o,d){this.currentBuildingBuckets=[];for(const b of this.layers){const S=b.layer,T=this.style.getLayerSourceCache(S);let I=1;S.type==="fill-extrusion"?I=b.visible?S.paint.get("fill-extrusion-vertical-scale"):0:S.type==="building"&&(I=b.visible?S.paint.get("building-vertical-scale"):0);let k=T?T.getTile(d):null;if(!k&&T)for(const F in T._tiles){const z=T._tiles[F];if(d.canonical.isChildOf(z.tileID.canonical)){k=z;break}}this.currentBuildingBuckets.push({bucket:k?k.getBucket(S):null,tileID:k?k.tileID:d,verticalScale:I})}o.hasAnyZOffset=!1;let _=!1;for(let b=0;b<o.symbolInstances.length;b++){const S=o.symbolInstances.get(b),T=S.zOffset,I=this._getHeightAtTileOffset(d,S.tileAnchorX,S.tileAnchorY);S.zOffset=I!==Number.NEGATIVE_INFINITY?I:T,_||T===S.zOffset||(_=!0),o.hasAnyZOffset||S.zOffset===0||(o.hasAnyZOffset=!0)}_&&(o.zOffsetBuffersNeedUpload=!0,o.zOffsetSortDirty=!0)}_mapCoordToOverlappingTile(o,d,_,b){let S=d,T=_;if(o.canonical.z!==b.canonical.z){const I=b.canonical,k=1/(1<<o.canonical.z-I.z);S=(d+o.canonical.x*a.ak)*k-I.x*a.ak|0,T=(_+o.canonical.y*a.ak)*k-I.y*a.ak|0}return{tileX:S,tileY:T}}_getHeightAtTileOffset(o,d,_){let b,S;for(let T=0;T<this.layers.length;++T){const I=this.layers[T].layer;if(I.type!=="fill-extrusion"&&I.type!=="building")continue;const{bucket:k,tileID:F,verticalScale:z}=this.currentBuildingBuckets[T];if(!k)continue;const{tileX:q,tileY:j}=this._mapCoordToOverlappingTile(o,d,_,F),Z=k.getHeightAtTileCoord(q,j);Z&&Z.height!==void 0&&(Z.hidden?b=Z.height:S=Math.max(Z.height*z,S||0))}if(S!==void 0)return S;for(let T=0;T<this.layers.length;++T){const I=this.layers[T];if(I.layer.type!=="model"||!I.visible)continue;const{bucket:k,tileID:F}=this.currentBuildingBuckets[T];if(!k)continue;const{tileX:z,tileY:q}=this._mapCoordToOverlappingTile(o,d,_,F),j=k.getHeightAtTileCoord(z,q);if(j&&!j.hidden)return j.height===void 0&&b!==void 0?Math.min(j.maxHeight,b)*j.verticalScale:j.height?j.height*j.verticalScale:Number.NEGATIVE_INFINITY}return this.layersGotHidden?0:Number.NEGATIVE_INFINITY}}let bu;function Dh(){return bu||(bu=new yu),bu}function mp(p,o){const d={};for(const _ in p)_!=="ref"&&(d[_]=p[_]);return a.b8.forEach(_=>{_ in o&&(d[_]=o[_])}),d}function os(p){p=p.slice();const o=Object.create(null);for(const d of p)o[d.id]=d;for(let d=0;d<p.length;d++){const _=p[d];if(_&&"ref"in _){const b=o[_.ref];b&&(p[d]=mp(_,b))}}return p}const $n={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setSlot:"setSlot",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight",setTerrain:"setTerrain",setFog:"setFog",setSnow:"setSnow",setRain:"setRain",setCamera:"setCamera",setLights:"setLights",setProjection:"setProjection",addImport:"addImport",removeImport:"removeImport",updateImport:"updateImport",addIconset:"addIconset",removeIconset:"removeIconset"};function m1(p,o,d){d.push({command:$n.addSource,args:[p,o[p]]})}function Fh(p,o,d){o.push({command:$n.removeSource,args:[p]}),d[p]=!0}function jy(p,o,d,_){Fh(p,d,_),m1(p,o,d)}function gp(p,o,d){let _;for(_ in p[d])if(Object.hasOwn(p[d],_)&&_!=="data"&&!a.b9(p[d][_],o[d][_]))return!1;for(_ in o[d])if(Object.hasOwn(o[d],_)&&_!=="data"&&!a.b9(p[d][_],o[d][_]))return!1;return!0}function md(p,o,d,_,b,S){let T;for(T in o=o||{},p=p||{})Object.hasOwn(p,T)&&(a.b9(p[T],o[T])||d.push({command:S,args:[_,T,o[T],b]}));for(T in o)Object.hasOwn(o,T)&&!Object.hasOwn(p,T)&&(a.b9(p[T],o[T])||d.push({command:S,args:[_,T,o[T],b]}))}function Bh(p){return p.id}function gd(p,o){return p[o.id]=o,p}function ss(p,o,d){const _=o.createTileMatrix(p,p.worldSize,d.toUnwrapped());return a.aC(new Float32Array(16),p.projMatrix,_)}function $a(p,o,d){if(o.projection.name===d.projection.name)return p.projMatrix;const _=d.clone();return _.setProjection(o.projection),ss(_,o.getProjection(),p)}function _s(p,o,d){return o.name===d.projection.name?p.projMatrix:ss(d,o,p)}class g1{constructor(o,d){this.reset(o,d)}reset(o,d){this.points=o||[],this._distances=[0];for(let _=1;_<this.points.length;_++)this._distances[_]=this._distances[_-1]+this.points[_].dist(this.points[_-1]);this.length=this._distances.at(-1),this.padding=Math.min(d||0,.5*this.length),this.paddedLength=this.length-2*this.padding}
25lerp(o){if(this.points.length===1)return this.points[0];o=a.aB(o,0,1);let d=1,_=this._distances[d];const b=o*this.paddedLength+this.padding;for(;_<b&&d<this._distances.length;)_=this._distances[++d];const S=d-1,T=this._distances[S],I=_-T,k=I>0?(b-T)/I:0;return this.points[S].mult(1-k).add(this.points[d].mult(k))}}const zh=Math.tan(85*Math.PI/180);function Zi(p,o,d,_,b,S,T){const I=a.bd();if(d)if(S.name==="globe"){const k=a.be(b,o);a.aC(I,I,k)}else{const k=a.bf([],T);I[0]=k[0],I[1]=k[1],I[4]=k[2],I[5]=k[3],_||a.bc(I,I,b.angle)}else a.aC(I,b.labelPlaneMatrix,p);return I}function ja(p,o,d,_,b,S,T){const I=Zi(p,o,d,_,b,S,T);return S.name==="globe"&&d||(I[2]=I[6]=I[10]=I[14]=0),I}function ml(p,o,d,_,b,S,T){if(d){if(S.name==="globe"){const I=Zi(p,o,d,_,b,S,T);return a.ba(I,I),a.aC(I,p,I),I}{const I=a.bb(p),[k,F,z,q]=T,[j,Z,te,ee,oe,se,de,pe]=I;return I[0]=k*j+F*oe,I[1]=k*Z+F*se,I[2]=k*te+F*de,I[3]=k*ee+F*pe,I[4]=z*j+q*oe,I[5]=z*Z+q*se,I[6]=z*te+q*de,I[7]=z*ee+q*pe,_||a.bc(I,I,-b.angle),I}}return b.glCoordMatrix}function hi(p,o,d,_){const b=[p,o,d,1];d?a.aD(b,b,_):Gl(b,b,_);const S=b[3];return b[0]/=S,b[1]/=S,b[2]/=S,b}function sg(p,o){return Math.min(.5+p/o*.5,1.5)}function gl(p,o){const d=p[0]/p[3],_=p[1]/p[3];return d>=-o[0]&&d<=o[0]&&_>=-o[1]&&_<=o[1]}function Nh(p,o,d,_,b,S,T,I,k,F,z=1){const q=d.transform,j=_?p.textSizeData:p.iconSizeData,Z=a.bl(j,d.transform.zoom,z),te=q.projection.name==="globe",ee=[256/d.width*2+1,256/d.height*2+1],oe=_?p.text.dynamicLayoutVertexArray:p.icon.dynamicLayoutVertexArray;oe.clear();let se=null;te&&(se=_?p.text.globeExtVertexArray:p.icon.globeExtVertexArray);const de=p.lineVertexArray,pe=_?p.text.placedSymbolArray:p.icon.placedSymbolArray,ce=d.transform.width/d.transform.height;let Ce,Se=!1;for(let Re=0;Re<pe.length;Re++){const ve=pe.get(Re),{numGlyphs:be,writingMode:Ae}=ve;if(Ae!==a.bm.vertical||Se||Ce===a.bm.horizontal||(Se=!0),Ce=Ae,(ve.hidden||Ae===a.bm.vertical)&&!Se){Vh(be,oe);continue}Se=!1;const Ne=new a.P(ve.tileAnchorX,ve.tileAnchorY),De=p.elevationType==="road",Ye=!!q.elevation||De;let{x:Ke,y:Tt,z:Ue}=q.projection.projectTilePoint(Ne.x,Ne.y,F.canonical),rt=null;if(Ye){const tn=De?p.getElevationFeatureForText(Re):null;rt={getElevation:k,elevation:q.elevation,elevationFeature:tn};const[bn,kn,Pn]=k(Ne,q.elevation,tn);Ke+=bn,Tt+=kn,Ue+=Pn}const $e=[Ke,Tt,Ue,1];if(a.aD($e,$e,o),!gl($e,ee)){Vh(be,oe);continue}const ct=$e[3],at=sg(d.transform.getCameraToCenterDistance(q.projection),ct),dt=a.bn(j,Z,ve),Gt=T?dt/at:dt*at,Mt=hi(Ke,Tt,Ue,b);if(Mt[3]<=0){Vh(be,oe);continue}let Ct={};const xt=a.am(p.layers[0].layout.get("text-max-angle")),dn=Math.cos(xt),an=T?null:rt,Jt=Gy(ve,Gt,!1,I,o,b,S,p.glyphOffsetArray,de,oe,se,Mt,Ne,Ct,ce,an,q.projection,F,T,dn);Se=Jt.useVertical,an&&Jt.needsFlipping&&(Ct={}),(Jt.notEnoughRoom||Se||Jt.needsFlipping&&Gy(ve,Gt,!0,I,o,b,S,p.glyphOffsetArray,de,oe,se,Mt,Ne,Ct,ce,an,q.projection,F,T,dn).notEnoughRoom)&&Vh(be,oe)}_?(p.text.dynamicLayoutVertexBuffer.updateData(oe),se&&p.text.globeExtVertexBuffer&&p.text.globeExtVertexBuffer.updateData(se)):(p.icon.dynamicLayoutVertexBuffer.updateData(oe),se&&p.icon.globeExtVertexBuffer&&p.icon.globeExtVertexBuffer.updateData(se))}function _p(p,o,d,_,b,S,T,I,k,F,z,q,j,Z,te,ee,oe){const{lineStartIndex:se,glyphStartIndex:de,segment:pe}=I,ce=de+I.numGlyphs,Ce=se+I.lineLength,Se=o.getoffsetX(de),Re=o.getoffsetX(ce-1),ve=vp(p*Se,d,_,b,S,T,pe,se,Ce,k,F,z,q,j,!0,Z,te,ee,oe);if(!ve)return null;const be=vp(p*Re,d,_,b,S,T,pe,se,Ce,k,F,z,q,j,!0,Z,te,ee,oe);return be?{first:ve,last:be}:null}function ag(p,o,d,_){return p===a.bm.horizontal&&Math.abs(_)>Math.abs(d)?{useVertical:!0}:p===a.bm.vertical?_>0?{needsFlipping:!0}:null:o!==0&&(function(b,S){return b===0||Math.abs(S/b)>zh})(d,_)?o===1?{needsFlipping:!0}:null:d<0?{needsFlipping:!0}:null}function Gy(p,o,d,_,b,S,T,I,k,F,z,q,j,Z,te,ee,oe,se,de,pe){const ce=o/24,Ce=p.lineOffsetX*ce,Se=p.lineOffsetY*ce,{lineStartIndex:Re,glyphStartIndex:ve,numGlyphs:be,segment:Ae,writingMode:Ne,flipState:De}=p,Ye=Re+p.lineLength,Ke=Tt=>{if(z){const[ct,at,dt]=Tt.up,Gt=F.length;a.bo(z,Gt+0,ct,at,dt),a.bo(z,Gt+1,ct,at,dt),a.bo(z,Gt+2,ct,at,dt),a.bo(z,Gt+3,ct,at,dt)}const[Ue,rt,$e]=Tt.point;a.bp(F,Ue,rt,$e,Tt.angle)};if(be>1){const Tt=_p(ce,I,Ce,Se,d,q,j,p,k,S,Z,ee,!1,oe,se,de,pe);if(!Tt)return{notEnoughRoom:!0};if(_&&!d){let[Ue,rt,$e]=Tt.first.point,[ct,at,dt]=Tt.last.point;[Ue,rt]=hi(Ue,rt,$e,T),[ct,at]=hi(ct,at,dt,T);const Gt=ag(Ne,De,(ct-Ue)*te,at-rt);
25if(p.flipState=Gt&&Gt.needsFlipping?1:2,Gt)return Gt}Ke(Tt.first);for(let Ue=ve+1;Ue<ve+be-1;Ue++){const rt=vp(ce*I.getoffsetX(Ue),Ce,Se,d,q,j,Ae,Re,Ye,k,S,Z,ee,!1,!1,oe,se,de,pe);if(!rt)return F.length-=4*(Ue-ve),{notEnoughRoom:!0};Ke(rt)}Ke(Tt.last)}else{if(_&&!d){const Ue=hi(j.x,j.y,0,b),rt=Re+Ae+1,$e=new a.P(k.getx(rt),k.gety(rt)),ct=hi($e.x,$e.y,0,b),at=ct[3]>0?ct:yp(j,$e,Ue,1,b,void 0,oe,se.canonical),dt=ag(Ne,De,(at[0]-Ue[0])*te,at[1]-Ue[1]);if(p.flipState=dt&&dt.needsFlipping?1:2,dt)return dt}const Tt=vp(ce*I.getoffsetX(ve),Ce,Se,d,q,j,Ae,Re,Ye,k,S,Z,ee,!1,!1,oe,se,de,pe);if(!Tt)return{notEnoughRoom:!0};Ke(Tt)}return{}}function Hy(p,o,d,_,b){const{x:S,y:T,z:I}=_.projectTilePoint(p.x,p.y,o);if(!b)return hi(S,T,I,d);const[k,F,z]=b.getElevation(p,b.elevation,b.elevationFeature);return hi(S+k,T+F,I+z,d)}function yp(p,o,d,_,b,S,T,I){const k=Hy(p.sub(o)._unit()._add(p),I,b,T,S);return a.aw(k,d,k),a.ax(k,k),a.bi(k,d,k,_)}function vp(p,o,d,_,b,S,T,I,k,F,z,q,j,Z,te,ee,oe,se,de){const pe=_?p-o:p+o;let ce=pe>0?1:-1,Ce=0;_&&(ce*=-1,Ce=Math.PI),ce<0&&(Ce+=Math.PI);let Se=I+T+(ce>0?0:1)|0,Re=b,ve=b,be=0,Ae=0;const Ne=Math.abs(pe),De=[],Ye=[];let Ke=S,Tt=Ke,Ue=a.bg([]);const rt=()=>yp(Tt,Ke,ve,Ne-be+1,z,j,ee,oe.canonical);for(;be+Ae<=Ne;){if(Se+=ce,Se<I||Se>=k)return null;if(ve=Re,Tt=Ke,De.push(ve),Z&&Ye.push(Tt),Ke=new a.P(F.getx(Se),F.gety(Se)),Re=q[Se],!Re){const an=Hy(Ke,oe.canonical,z,ee,j);Re=an[3]>0?q[Se]=an:rt()}be+=Ae;const xt=a.aw([],Re,ve),dn=a.bh(ve,Re);if(d&&dn>0&&Ae>0&&a.bk(Ue,xt)/(Ae*dn)<de)return null;Ae=dn,Ue=xt}te&&j&&(q[Se]&&(Re=rt(),Ae=a.bh(ve,Re),Ue=a.aw([],Re,ve)),q[Se]=Re);const $e=(Ne-be)/Ae,ct=Ke.sub(Tt)._mult($e)._add(Tt),at=a.bi([],ve,Ue,$e);let dt=[0,0,1],Gt=Ue[0],Mt=Ue[1];if(se&&(dt=ee.upVector(oe.canonical,ct.x,ct.y),dt[0]!==0||dt[1]!==0||dt[2]!==1)){const xt=[dt[2],0,-dt[0]],dn=a.bj([],dt,xt);a.ax(xt,xt),a.ax(dn,dn),Gt=a.bk(Ue,xt),Mt=a.bk(Ue,dn)}if(d){const xt=a.bj([],dt,Ue);a.ax(xt,xt),a.bi(at,at,xt,d*ce)}const Ct=Ce+Math.atan2(Mt,Gt);return De.push(at),Z&&Ye.push(ct),{point:at,angle:Ct,path:De,tilePath:Ye,up:dt}}function Vh(p,o){const d=o.length,_=d+4*p;o.resize(_),o.float32.fill(-1/0,4*d,4*_)}function Gl(p,o,d){const _=o[0],b=o[1];return p[0]=d[0]*_+d[4]*b+d[12],p[1]=d[1]*_+d[5]*b+d[13],p[3]=d[3]*_+d[7]*b+d[15],p}const Hl=100;class Wy{constructor(o,d,_=new a.bq(o.width+200,o.height+200,25),b=new a.bq(o.width+200,o.height+200,25)){this.transform=o,this.grid=_,this.ignoredGrid=b,this.pitchfactor=Math.cos(o._pitch)*o.cameraToCenterDistance,this.screenRightBoundary=o.width+Hl,this.screenBottomBoundary=o.height+Hl,this.gridRightBoundary=o.width+200,this.gridBottomBoundary=o.height+200,this.fogState=d,this.clippedSymbols=new Map}clearClippedSymbolsForBucket(o){this.clippedSymbols.delete(o)}markSymbolAsClipped(o,d){let _=this.clippedSymbols.get(o);_||(_=new Set,this.clippedSymbols.set(o,_)),_.add(d)}placeCollisionBox(o,d,_,b,S,T,I,k,F,z,q){let j=_.projectedAnchorX,Z=_.projectedAnchorY,te=_.projectedAnchorZ;const ee=_.tileAnchorX,oe=_.tileAnchorY,se=_.elevation,de=_.tileID,pe=o.getProjection();if(se&&de){const[Ye,Ke,Tt]=pe.upVector(de.canonical,_.tileAnchorX,_.tileAnchorY),Ue=pe.upVectorScale(de.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;j+=Ye*se*Ue,Z+=Ke*se*Ue,te+=Tt*se*Ue}const ce=o.projection.name==="globe",Ce=o.projection.name==="globe"?a.ai(this.transform.zoom):0;if(de&&ce&&Ce<1&&!T){const Ye=1<<de.canonical.z,Ke=a.br(ee,oe);a.bs(Ke,Ke,1/a.ak),a.bt(Ke,Ke,a.br(de.canonical.x,de.canonical.y)),a.bs(Ke,Ke,1/Ye),a.bu(Ke,Ke,a.br(b[0],b[1])),Ke[0]=a.bv(Ke[0],-.5,.5),a.bs(Ke,Ke,a.ak);const Tt=a.bw(Ke[0],Ke[1],a.ak/(2*Math.PI),1);a.aD(Tt,Tt,S),j=a.aj(j,Tt[0],Ce),Z=a.aj(Z,Tt[1],Ce),te=a.aj(te,Tt[2],Ce)}const Se=this.projectAndGetPerspectiveRatio(z,j,Z,te,_.tileID,pe.name==="globe"||!!se||this.transform.pitch>0,pe),Re=F*Se.perspectiveRatio,ve=(_.x1*d+I.x-_.padding)*Re+Se.point.x,be=(_.y1*d+I.y-_.padding)*Re+Se.point.y,Ae=(_.x2*d+I.x+_.padding)*Re+Se.point.x,Ne=(_.y2*d+I.y+_.padding)*Re+Se.point.y,De=Se.perspectiveRatio<=.55||Se.occluded;return!this.isInsideGrid(ve,be,Ae,Ne)||!k&&this.grid.hitTest(ve,be,Ae,Ne,q)||De?{box:[],offscreen:!1,occluded:Se.occluded}:{box:[ve,be,Ae,Ne],offscreen:this.isOffscreen(ve,be,Ae,Ne),occluded:!1}}placeCollisionCircles(o,d,_,b,S,T,I,k,F,z,q,j,Z,te,ee,oe){const se=[],de=this.transform.elevation,pe=o.getProjection(),ce=o.elevationType==="road",Ce=!!de||ce,Se=a.bx.getAtTileOffsetFunc(oe,this.transform.center.lat,this.transform.worldSize,pe),Re=new a.P(_.tileAnchorX,_.tileAnchorY),ve=new a.P(_.tileAnchorX,_.tileAnchorY);let{x:be,y:Ae,z:Ne}=pe.projectTilePoint(ve.x,ve.y,oe.canonical),De=null;if(Ce){const dn=ce?o.getElevationFeatureForText(b):null;De={getElevation:Se,elevation:de,elevationFeature:dn};const[an,Jt,tn]=Se(Re,de,dn);be+=an,Ae+=Jt,Ne+=tn}const Ye=pe.name==="globe",Ke=this.projectAndGetPerspectiveRatio(k,be,Ae,Ne,oe,Ye||!!de||this.transform.pitch>0,pe),{perspectiveRatio:Tt}=Ke,Ue=(j?I/Tt:I*Tt)/a.bC,rt=hi(be,Ae,Ne,F),$e=_.lineOffsetX*Ue,ct=_.lineOffsetY*Ue,at=a.am(o.layers[0].layout.get("text-max-angle")),dt=Math.cos(at),Gt=Ke.signedDistanceFromCamera>0?_p(Ue,T,$e,ct,ce&&_.flipState===1,rt,ve,_,S,F,{},Ce&&!j?De:null,j&&Ce,pe,oe,j,dt):null;let Mt=!1,Ct=!1,xt=!0;if(Gt&&!Ke.occluded){const dn=.5*te*Tt+ee,an=new a.P(-100,-100),Jt=new a.P(this.screenRightBoundary,this.screenBottomBoundary),tn=new g1,{first:bn,last:kn}=Gt,Pn=bn.path.length;let jn=[];for(let Fn=Pn-1;Fn>=1;Fn--)jn.push(bn.path[Fn]);for(let Fn=1;Fn<kn.path.length;Fn++)jn.push(kn.path[Fn]);const An=2.5*dn;z&&(jn=jn.map(([Fn,fr,Or],Fr)=>(Ce&&!Ye&&(Or=Se(Fr<Pn-1?bn.tilePath[Pn-1-Fr]:kn.tilePath[Fr-Pn+2],de,De.elevationFeature)[2]),hi(Fn,fr,Or,z))),jn.some(Fn=>Fn[3]<=0)&&(jn=[]));let or=[];if(jn.length>0){let Fn=1/0,fr=-1/0,Or=1/0,Fr=-1/0;for(const zr of jn)Fn=Math.min(Fn,zr[0]),Or=Math.min(Or,zr[1]),fr=Math.max(fr,zr[0]),Fr=Math.max(Fr,zr[1]);fr>=an.x&&Fn<=Jt.x&&Fr>=an.y&&Or<=Jt.y&&(or=[jn.map(zr=>new a.P(zr[0],zr[1]))],(Fn<an.x||fr>Jt.x||Or<an.y||Fr>Jt.y)&&(or=a.by(or,an.x,an.y,Jt.x,Jt.y)))}for(const Fn of or){tn.reset(Fn,.25*dn);let fr=0;fr=tn.length<=.5*dn?1:Math.ceil(tn.paddedLength/An)+1;for(let Or=0;Or<fr;Or++){const Fr=Or/Math.max(fr-1,1),zr=tn.lerp(Fr),yr=zr.x+Hl,Gn=zr.y+Hl;se.push(yr,Gn,dn,0);const Xn=yr-dn,Nr=Gn-dn,Si=yr+dn,kr=Gn+dn;if(xt=xt&&this.isOffscreen(Xn,Nr,Si,kr),Ct=Ct||this.isInsideGrid(Xn,Nr,Si,kr),!d&&this.grid.hitTestCircle(yr,Gn,dn,Z)&&(Mt=!0,!q))return{circles:[],offscreen:!1,collisionDetected:Mt,occluded:!1}}}}return{circles:!q&&Mt||!Ct?[]:se,offscreen:xt,collisionDetected:Mt,occluded:Ke.occluded}}queryRenderedSymbols(o){if(o.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const d=[];let _=1/0,b=1/0,S=-1/0,T=-1/0;for(const z of o){const q=new a.P(z.x+Hl,z.y+Hl);_=Math.min(_,q.x),b=Math.min(b,q.y),S=Math.max(S,q.x),T=Math.max(T,q.y),d.push(q)}const I=this.grid.query(_,b,S,T).concat(this.ignoredGrid.query(_,b,S,T)),k={},F={};for(const z of I){const q=z.key;if(k[q.bucketInstanceId]===void 0&&(k[q.bucketInstanceId]={}),k[q.bucketInstanceId][q.featureIndex])continue;
25const j=this.clippedSymbols.get(q.bucketInstanceId);if(j&&j.has(q.featureIndex))continue;const Z=[new a.P(z.x1,z.y1),new a.P(z.x2,z.y1),new a.P(z.x2,z.y2),new a.P(z.x1,z.y2)];a.bz(d,Z)&&(k[q.bucketInstanceId][q.featureIndex]=!0,F[q.bucketInstanceId]===void 0&&(F[q.bucketInstanceId]=[]),F[q.bucketInstanceId].push(q.featureIndex))}return F}insertCollisionBox(o,d,_,b,S){(d?this.ignoredGrid:this.grid).insert({bucketInstanceId:_,featureIndex:b,collisionGroupID:S},o[0],o[1],o[2],o[3])}insertCollisionCircles(o,d,_,b,S){const T=d?this.ignoredGrid:this.grid,I={bucketInstanceId:_,featureIndex:b,collisionGroupID:S};for(let k=0;k<o.length;k+=4)T.insertCircle(I,o[k],o[k+1],o[k+2])}projectAndGetPerspectiveRatio(o,d,_,b,S,T,I){const k=[d,_,b,1];let F=!1;b||this.transform.pitch>0?(a.aD(k,k,o),this.fogState&&S&&I.name!=="globe"&&(F=(function(j,Z,te,ee,oe,se){const de=se.calculateFogTileMatrix(oe),pe=[Z,te,ee];return a.ae(pe,pe,de),hp(j,a.af(pe),se.pitch)})(this.fogState,d,_,b,S.toUnwrapped(),this.transform)>.9)):Gl(k,k,o);const z=k[3];return{point:new a.P((k[0]/z+1)/2*this.transform.width+Hl,(-k[1]/z+1)/2*this.transform.height+Hl),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(I)/z*.5,1.5),signedDistanceFromCamera:z,occluded:T&&k[2]>z||F}}isOffscreen(o,d,_,b){return _<Hl||o>=this.screenRightBoundary||b<Hl||d>this.screenBottomBoundary}isInsideGrid(o,d,_,b){return _>=0&&o<this.gridRightBoundary&&b>=0&&d<this.gridBottomBoundary}getViewportMatrix(){const o=a.bA([]);return a.bB(o,o,[-100,-100,0]),o}}class Cs{constructor(o,d,_,b){this.opacity=o?Math.max(0,Math.min(1,o.opacity+(o.placed?d:-d))):b&&_?1:0,this.placed=_}isHidden(){return this.opacity===0&&!this.placed}}class bp{constructor(o,d,_,b,S,T=!1){this.text=new Cs(o?o.text:null,d,_,S),this.icon=new Cs(o?o.icon:null,d,b,S),this.clipped=T}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class _d{constructor(o,d,_,b=!1){this.text=o,this.icon=d,this.skipFade=_,this.clipped=b}}class _1{constructor(){this.invProjMatrix=a.bd(),this.viewportMatrix=a.bd(),this.circles=[]}}class xp{constructor(o,d,_,b,S){this.bucketInstanceId=o,this.featureIndex=d,this.sourceLayerIndex=_,this.bucketIndex=b,this.tileID=S}}class d2{constructor(o){this.crossSourceCollisions=o,this.maxGroupID=0,this.collisionGroups={}}get(o){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[o]){const d=++this.maxGroupID;this.collisionGroups[o]={ID:d,predicate:_=>_.collisionGroupID===d}}return this.collisionGroups[o]}}function y1(p,o,d,_,b){const{horizontalAlign:S,verticalAlign:T}=a.bJ(p),I=-(S-.5)*o,k=-(T-.5)*d,F=a.bK(p,_);return new a.P(I+F[0]*b,k+F[1]*b)}function yd(p,o,d,_,b){const S=new a.P(p,o);return d&&S._rotate(_?b:-b),S}class wp{constructor(o,d,_,b,S,T){this.transform=o.clone(),this.projection=o.projection.name,this.collisionIndex=new Wy(this.transform,S),this.buildingIndex=T,this.frontCutoffStart=0,this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=d,this.retainedQueryData={},this.collisionGroups=new d2(_),this.collisionCircleArrays={},this.prevPlacement=b,b&&(b.prevPlacement=void 0),this.placedOrientations={},this.lastReplacementSourceUpdateTime=0}getBucketParts(o,d,_,b,S=1){const T=_.getBucket(d),I=_.latestFeatureIndex;if(!T||!I||d.fqid!==T.layerIds[0])return;const k=T.layers[0].layout,F=T.layers[0].paint,z=_.collisionBoxArray,q=Math.pow(2,this.transform.zoom-_.tileID.overscaledZ),j=_.tileSize/a.ak,Z=_.tileID.toUnwrapped();this.transform.setProjection(T.projection);const te=(ee=_.tileID,oe=T.getProjection(),se=this.transform,oe.name===this.projection?se.calculateProjMatrix(ee.toUnwrapped()):ss(se,oe,ee));var ee,oe,se;const de=k.get("text-pitch-alignment")==="map",pe=k.get("text-rotation-alignment")==="map";d.compileFilter(d.options);const ce=d.dynamicFilter(),Ce=d.dynamicFilterNeedsFeature(),Se=d.dynamicFilterNeedsGeometry(),Re=this.transform.calculatePixelsToTileUnitsMatrix(_),ve=ja(te,_.tileID.canonical,de,pe,this.transform,T.getProjection(),Re);let be=null;const Ae=T.getProjection().createInversionMatrix(this.transform,_.tileID.canonical);if(de){const ct=ml(te,_.tileID.canonical,de,pe,this.transform,T.getProjection(),Re);
25be=a.aC([],this.transform.labelPlaneMatrix,ct)}let Ne=null;ce&&_.latestFeatureIndex&&(Ne={unwrappedTileID:Z,dynamicFilter:ce,dynamicFilterNeedsFeature:Ce,needGeometry:Se}),this.retainedQueryData[T.bucketInstanceId]=new xp(T.bucketInstanceId,I,T.sourceLayerIndex,T.index,_.tileID);const[De,Ye]=T.layers[0].layout.get("text-size-scale-range"),Ke=a.aB(S,De,Ye),[Tt,Ue]=k.get("icon-size-scale-range"),rt=a.aB(S,Tt,Ue),$e={bucket:T,layout:k,paint:F,posMatrix:te,invMatrix:Ae,mercatorCenter:[a.aG(this.transform.center.lng),a.aJ(this.transform.center.lat)],textLabelPlaneMatrix:ve,labelToScreenMatrix:be,clippingData:Ne,scale:q,textPixelRatio:j,holdingForFade:_.holdingForFade(),collisionBoxArray:z,partiallyEvaluatedTextSize:a.bl(T.textSizeData,this.transform.zoom,Ke),partiallyEvaluatedIconSize:a.bl(T.iconSizeData,this.transform.zoom,rt),collisionGroup:this.collisionGroups.get(T.sourceID),latestFeatureIndex:_.latestFeatureIndex};if(b)for(const ct of T.sortKeyRanges){const{sortKey:at,symbolInstanceStart:dt,symbolInstanceEnd:Gt}=ct;o.push({sortKey:at,symbolInstanceStart:dt,symbolInstanceEnd:Gt,parameters:$e})}else o.push({symbolInstanceStart:0,symbolInstanceEnd:T.symbolInstances.length,parameters:$e})}attemptAnchorPlacement(o,d,_,b,S,T,I,k,F,z,q,j,Z,te,ee,oe,se,de,pe,ce,Ce){const{textOffset0:Se,textOffset1:Re,crossTileID:ve}=ee,be=[Se,Re],Ae=y1(o,T,I,be,k),Ne=this.collisionIndex.placeCollisionBox(se,k,d,_,b,S,yd(Ae.x,Ae.y,F,z,this.transform.angle),te,q,j,Z.predicate);if(pe){const De=se.getSymbolInstanceIconSize(Ce,this.transform.zoom,ee.placedIconSymbolIndex);if(this.collisionIndex.placeCollisionBox(se,De,pe,_,b,S,yd(Ae.x,Ae.y,F,z,this.transform.angle),te,q,j,Z.predicate).box.length===0)return}if(Ne.box.length>0){let De;return this.prevPlacement&&this.prevPlacement.variableOffsets[ve]&&this.prevPlacement.placements[ve]&&this.prevPlacement.placements[ve].text&&(De=this.prevPlacement.variableOffsets[ve].anchor),this.variableOffsets[ve]={textOffset:be,width:T,height:I,anchor:o,textScale:k,prevAnchor:De},this.markUsedJustification(se,o,ee,de),se.allowVerticalPlacement&&(this.markUsedOrientation(se,de,ee),this.placedOrientations[ve]=de),{shift:Ae,placedGlyphBoxes:Ne}}}placeLayerBucketPart(o,d,_,b,S=1){const{bucket:T,layout:I,paint:k,posMatrix:F,textLabelPlaneMatrix:z,labelToScreenMatrix:q,clippingData:j,textPixelRatio:Z,mercatorCenter:te,invMatrix:ee,holdingForFade:oe,collisionBoxArray:se,partiallyEvaluatedTextSize:de,partiallyEvaluatedIconSize:pe,collisionGroup:ce,latestFeatureIndex:Ce}=o.parameters,Se=I.get("text-optional"),Re=I.get("icon-optional"),ve=I.get("text-allow-overlap"),be=I.get("icon-allow-overlap"),Ae=I.get("text-rotation-alignment")==="map",Ne=I.get("icon-rotation-alignment")==="map",De=I.get("text-pitch-alignment")==="map",Ye=k.get("symbol-z-offset"),Ke=I.get("symbol-elevation-reference")==="sea",Tt=I.get("symbol-placement"),[Ue,rt]=I.get("text-size-scale-range"),[$e,ct]=I.get("icon-size-scale-range"),at=a.aB(S,Ue,rt),dt=a.aB(S,$e,ct),Gt=I.get("text-variable-anchor"),Mt=Ae&&Tt!=="point",Ct=Ne&&Tt!=="point",xt=Gt&&T.hasTextData(),dn=T.hasIconTextFit()&&xt&&T.hasIconData();this.transform.setProjection(T.projection);const an=xt||Mt,Jt=Ct||dn;let tn=ve&&(be||!T.hasIconData()||Re),bn=be&&(ve||!T.hasTextData()||Se);const kn=!Ye.isConstant();!T.collisionArrays&&se&&T.deserializeCollisionBoxes(se),_&&b&&T.updateCollisionDebugBuffers(this.transform.zoom,se,at,dt);const Pn=(An,or,Fn)=>{const{crossTileID:fr,numVerticalGlyphVertices:Or}=An;let Fr=null;if(j&&j.dynamicFilterNeedsFeature||kn){const vr=this.retainedQueryData[T.bucketInstanceId],Dr=Ce.loadFeature({featureIndex:An.featureIndex,bucketIndex:vr.bucketIndex,sourceLayerIndex:vr.sourceLayerIndex,layoutVertexArrayOffset:0}),Er=Dr.properties?Dr.properties.worldview:null;if(T.localizable&&T.worldview&&typeof Er=="string")if(Er==="all")Dr.properties.$localized=!0;else{if(!Er.split(",").includes(T.worldview))return;Dr.properties.$localized=!0,Dr.properties.worldview=T.worldview}Fr=j&&j.needGeometry?a.bH(Dr,!0):Dr}if(j&&!(0,j.dynamicFilter)({zoom:this.transform.zoom,pitch:this.transform.pitch,worldview:T.worldview},Fr,this.retainedQueryData[T.bucketInstanceId].tileID.canonical,new a.P(An.tileAnchorX,An.tileAnchorY),this.transform.calculateDistanceTileData(j.unwrappedTileID)))return this.placements[fr]=new _d(!1,!1,!1,!0),void d.add(fr);const zr=Ye.evaluate(Fr,{});if((An.zOffset||0)+(zr||0)>
250&&this.frontCutoffStart>0){const vr=2*this.frontCutoffStart-1,Dr=[An.tileAnchorX,An.tileAnchorY,0,1],Er=a.aD(a.bI(),Dr,F);if(Er[1]/Er[3]<vr)return this.placements[fr]=new _d(!1,!1,!1,!0),void d.add(fr)}if(d.has(fr))return;if(oe)return void(this.placements[fr]=new _d(!1,!1,!1));let yr=!1,Gn=!1,Xn=!0,Nr=!1,Si=!1,kr=null,Dn={box:null,offscreen:null,occluded:null},ri={box:null},$r=null,Ii=null,lr=null,$i=0,Yo=0,fo=0;Fn.textFeatureIndex?$i=Fn.textFeatureIndex:An.useRuntimeCollisionCircles&&($i=An.featureIndex),Fn.verticalTextFeatureIndex&&(Yo=Fn.verticalTextFeatureIndex);const Lo=T.elevationFeatures?T.elevationFeatures[An.elevationFeatureIndex]:void 0,io=vr=>{vr.tileID=this.retainedQueryData[T.bucketInstanceId].tileID;const Dr=this.transform.elevation;vr.elevation=Ke?zr:zr+a.bx.getAtTileOffset(vr.tileID,new a.P(vr.tileAnchorX,vr.tileAnchorY),Dr,Lo),vr.elevation+=An.zOffset},Rs=Fn.textBox;if(Rs){io(Rs);const vr=Er=>{let ji=a.bm.horizontal;if(T.allowVerticalPlacement&&!Er&&this.prevPlacement){const To=this.prevPlacement.placedOrientations[fr];To&&(this.placedOrientations[fr]=To,ji=To,this.markUsedOrientation(T,ji,An))}return ji},Dr=(Er,ji)=>
25{if(T.allowVerticalPlacement&&Or>0&&Fn.verticalTextBox){for(const To of T.writingModes)if(To===a.bm.vertical?(Dn=ji(),ri=Dn):Dn=Er(),Dn&&Dn.box&&Dn.box.length)break}else Dn=Er()};if(Gt){let Er=Gt;if(this.prevPlacement&&this.prevPlacement.variableOffsets[fr]){const Ti=this.prevPlacement.variableOffsets[fr];Er.indexOf(Ti.anchor)>0&&(Er=Er.filter(ys=>ys!==Ti.anchor),Er.unshift(Ti.anchor))}const ji=(Ti,ys,vs)=>{const xl=T.getSymbolInstanceTextSize(de,An,this.transform.zoom,or),aa=(Ti.x2-Ti.x1)*xl+2*Ti.padding,Ia=(Ti.y2-Ti.y1)*xl+2*Ti.padding,zc=An.hasIconTextFit&&!be?ys:null;zc&&io(zc);let wl={box:[],offscreen:!1,occluded:!1};const Kp=ve?2*Er.length:Er.length;for(let Du=0;Du<Kp;++Du){const zd=this.attemptAnchorPlacement(Er[Du%Er.length],Ti,te,ee,an,aa,Ia,xl,Ae,De,Z,F,ce,Du>=Er.length,An,or,T,vs,zc,de,pe);if(zd&&(wl=zd.placedGlyphBoxes,wl&&wl.box&&wl.box.length)){yr=!0,kr=zd.shift;break}}return wl};Dr(()=>ji(Rs,Fn.iconBox,a.bm.horizontal),()=>{const Ti=Fn.verticalTextBox;return Ti&&io(Ti),T.allowVerticalPlacement&&!(Dn&&Dn.box&&Dn.box.length)&&Or>0&&Ti?ji(Ti,Fn.verticalIconBox,a.bm.vertical):{box:null,offscreen:null,occluded:null}}),Dn&&(yr=Dn.box,Xn=Dn.offscreen,Nr=Dn.occluded);const To=vr(!(!Dn||!Dn.box));if(!yr&&this.prevPlacement){const Ti=this.prevPlacement.variableOffsets[fr];Ti&&(this.variableOffsets[fr]=Ti,this.markUsedJustification(T,Ti.anchor,An,To))}}else{const Er=(ji,To)=>{const Ti=T.getSymbolInstanceTextSize(de,An,this.transform.zoom,or),ys=this.collisionIndex.placeCollisionBox(T,Ti,ji,te,ee,an,new a.P(0,0),ve,Z,F,ce.predicate);return ys&&ys.box&&ys.box.length&&(this.markUsedOrientation(T,To,An),this.placedOrientations[fr]=To),ys};Dr(()=>Er(Rs,a.bm.horizontal),()=>{const ji=Fn.verticalTextBox;return T.allowVerticalPlacement&&Or>0&&ji?(io(ji),Er(ji,a.bm.vertical)):{box:null,offscreen:null,occluded:null}}),vr(!!(Dn&&Dn.box&&Dn.box.length))}}if($r=Dn,yr=$r&&$r.box&&$r.box.length>0,Xn=$r&&$r.offscreen,Nr=$r&&$r.occluded,An.useRuntimeCollisionCircles){const vr=An.centerJustifiedTextSymbolIndex>=0?An.centerJustifiedTextSymbolIndex:An.verticalPlacedTextSymbolIndex,Dr=T.text.placedSymbolArray.get(vr),Er=a.bn(T.textSizeData,de,Dr),ji=I.get("text-padding");Ii=this.collisionIndex.placeCollisionCircles(T,ve,Dr,vr,T.lineVertexArray,T.glyphOffsetArray,Er,F,z,q,_,De,ce.predicate,An.collisionCircleDiameter*Er/a.bC,ji,this.retainedQueryData[T.bucketInstanceId].tileID),yr=ve||Ii.circles.length>0&&!Ii.collisionDetected,Xn=Xn&&Ii.offscreen,Nr=Ii.occluded}if(Fn.iconFeatureIndex&&(fo=Fn.iconFeatureIndex),Fn.iconBox){const vr=Dr=>{io(Dr);const Er=An.hasIconTextFit&&kr?yd(kr.x,kr.y,Ae,De,this.transform.angle):new a.P(0,0),ji=T.getSymbolInstanceIconSize(pe,this.transform.zoom,An.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(T,ji,Dr,te,ee,Jt,Er,be,Z,F,ce.predicate)};ri&&ri.box&&ri.box.length&&Fn.verticalIconBox?(lr=vr(Fn.verticalIconBox),Gn=lr.box.length>0):(lr=vr(Fn.iconBox),Gn=lr.box.length>0),Xn=Xn&&lr.offscreen,Si=lr.occluded}const ks=Se||An.numHorizontalGlyphVertices===0&&Or===0,Yi=Re||An.numIconVertices===0;if(ks||Yi?Yi?ks||(Gn=Gn&&yr):yr=Gn&&yr:Gn=yr=Gn&&yr,yr&&$r&&$r.box&&this.collisionIndex.insertCollisionBox($r.box,I.get("text-ignore-placement"),T.bucketInstanceId,ri&&ri.box&&Yo?Yo:$i,ce.ID),Gn&&lr&&this.collisionIndex.insertCollisionBox(lr.box,I.get("icon-ignore-placement"),T.bucketInstanceId,fo,ce.ID),Ii&&(yr&&this.collisionIndex.insertCollisionCircles(Ii.circles,I.get("text-ignore-placement"),T.bucketInstanceId,$i,ce.ID),_)){const vr=T.bucketInstanceId;let Dr=this.collisionCircleArrays[vr];Dr===void 0&&(Dr=this.collisionCircleArrays[vr]=new _1);for(let Er=0;Er<Ii.circles.length;Er+=4)Dr.circles.push(Ii.circles[Er+0]),Dr.circles.push(Ii.circles[Er+1]),Dr.circles.push(Ii.circles[Er+2]),Dr.circles.push(Ii.collisionDetected?1:0)}const cs=T.projection.name!=="globe";tn=tn&&(cs||!Nr),bn=bn&&(cs||!Si),this.placements[fr]=new _d(yr||tn,Gn||bn,Xn||T.justReloaded),d.add(fr)},jn=this.retainedQueryData[T.bucketInstanceId].tileID;if(T.elevationType==="offset"&&this.buildingIndex&&this.buildingIndex.updateZOffset(T,jn),T.elevationType==="road"&&T.updateRoadElevation(jn.canonical),T.updateZOffset(),T.sortFeaturesByY){const An=T.getSortedSymbolIndexe
25s(this.transform.angle);for(let or=An.length-1;or>=0;--or){const Fn=An[or];Pn(T.symbolInstances.get(Fn),Fn,T.collisionArrays[Fn])}T.hasAnyZOffset&&a.w(`${T.layerIds[0]} layer symbol-z-elevate: symbols are not sorted by elevation if symbol-z-order is evaluated to viewport-y`)}else if(T.hasAnyZOffset){const An=T.getSortedIndexesByZOffset();for(let or=0;or<An.length;++or){const Fn=An[or];Pn(T.symbolInstances.get(Fn),Fn,T.collisionArrays[Fn])}}else for(let An=o.symbolInstanceStart;An<o.symbolInstanceEnd;An++)Pn(T.symbolInstances.get(An),An,T.collisionArrays[An]);if(_&&T.bucketInstanceId in this.collisionCircleArrays){const An=this.collisionCircleArrays[T.bucketInstanceId];a.ba(An.invProjMatrix,F),An.viewportMatrix=this.collisionIndex.getViewportMatrix()}T.justReloaded=!1}markUsedJustification(o,d,_,b){const{leftJustifiedTextSymbolIndex:S,centerJustifiedTextSymbolIndex:T,rightJustifiedTextSymbolIndex:I,verticalPlacedTextSymbolIndex:k,crossTileID:F}=_,z=a.bL(d),q=b===a.bm.vertical?k:z==="left"?S:z==="center"?T:z==="right"?I:-1;S>=0&&(o.text.placedSymbolArray.get(S).crossTileID=q>=0&&S!==q?0:F),T>=0&&(o.text.placedSymbolArray.get(T).crossTileID=q>=0&&T!==q?0:F),I>=0&&(o.text.placedSymbolArray.get(I).crossTileID=q>=0&&I!==q?0:F),k>=0&&(o.text.placedSymbolArray.get(k).crossTileID=q>=0&&k!==q?0:F)}markUsedOrientation(o,d,_){const b=d===a.bm.horizontal||d===a.bm.horizontalOnly?d:0,S=d===a.bm.vertical?d:0,{leftJustifiedTextSymbolIndex:T,centerJustifiedTextSymbolIndex:I,rightJustifiedTextSymbolIndex:k,verticalPlacedTextSymbolIndex:F}=_,z=o.text.placedSymbolArray;T>=0&&(z.get(T).placedOrientation=b),I>=0&&(z.get(I).placedOrientation=b),k>=0&&(z.get(k).placedOrientation=b),F>=0&&(z.get(F).placedOrientation=S)}commit(o){this.commitTime=o,this.zoomAtLastRecencyCheck=this.transform.zoom;const d=this.prevPlacement;let _=!1;this.prevZoomAdjustment=d?d.zoomAdjustment(this.transform.zoom):0;const b=d?d.symbolFadeChange(o):1,S=d?d.opacities:{},T=d?d.variableOffsets:{},I=d?d.placedOrientations:{};for(const k in this.placements){const F=this.placements[k],z=S[k];z?(this.opacities[k]=new bp(z,b,F.text,F.icon,null,F.clipped),_=_||F.text!==z.text.placed||F.icon!==z.icon.placed):(this.opacities[k]=new bp(null,b,F.text,F.icon,F.skipFade,F.clipped),_=_||F.text||F.icon)}for(const k in S){const F=S[k];if(!this.opacities[k]){const z=new bp(F,b,!1,!1);z.isHidden()||(this.opacities[k]=z,_=_||F.text.placed||F.icon.placed)}}for(const k in T)this.variableOffsets[k]||!this.opacities[k]||this.opacities[k].isHidden()||(this.variableOffsets[k]=T[k]);for(const k in I)this.placedOrientations[k]||!this.opacities[k]||this.opacities[k].isHidden()||(this.placedOrientations[k]=I[k]);_?this.lastPlacementChangeTime=o:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=d?d.lastPlacementChangeTime:o)}updateLayerOpacities(o,d,_,b){b&&(this.lastReplacementSourceUpdateTime=b.updateTime);const S=new Set;for(const T of d){const I=T.getBucket(o);I&&T.latestFeatureIndex&&o.fqid===I.layerIds[0]&&(this.updateBucketOpacities(I,S,T,T.collisionBoxArray,_,b,T.tileID,o.scope),I.elevationType==="offset"&&this.buildingIndex&&this.buildingIndex.updateZOffset(I,T.tileID),I.elevationType==="road"&&I.updateRoadElevation(T.tileID.canonical),I.updateZOffset())}}updateBucketOpacities(o,d,_,b,S,T,I,k){o.hasTextData()&&o.text.opacityVertexArray.clear(),o.hasIconData()&&o.icon.opacityVertexArray.clear(),o.hasIconCollisionBoxData()&&o.iconCollisionBox.collisionVertexArray.clear(),o.hasTextCollisionBoxData()&&o.textCollisionBox.collisionVertexArray.clear();const F=o.layers[0].layout,z=o.layers[0].paint,q=!!o.layers[0].dynamicFilter(),j=new bp(null,0,!1,!1,!0),Z=F.get("text-allow-overlap"),te=F.get("icon-allow-overlap"),ee=F.get("text-variable-anchor"),oe=F.get("text-rotation-alignment")==="map",se=F.get("text-pitch-alignment")==="map",de=z.get("symbol-z-offset"),pe=F.get("symbol-elevation-reference")==="sea",ce=!de.isConstant(),Ce=new bp(null,0,Z&&(te||!o.hasIconData()||F.get("icon-optional")),te&&(Z||!o.hasTextData()||F.get("text-optional")),!0);!o.collisionArrays&&b&&(o.hasIconCollisionBoxData()||o.hasTextCollisionBoxData())&&o.deserializeCollisionBoxes(b);const Se=(ve,be,Ae)=>{for(let Ne=0;Ne<be/4;Ne++)ve.opacityVertexArray.emplaceBack(Ae)};let Re=0;T&&o.updateReplacement(I,T),this.collisionIndex.clearClippedSymbol
25sForBucket(o.bucketInstanceId);for(let ve=0;ve<o.symbolInstances.length;ve++){const be=o.symbolInstances.get(ve),{numHorizontalGlyphVertices:Ae,numVerticalGlyphVertices:Ne,crossTileID:De,numIconVertices:Ye,tileAnchorX:Ke,tileAnchorY:Tt}=be;let Ue=null;const rt=this.retainedQueryData[o.bucketInstanceId];ce&&be&&rt&&(Ue=_.latestFeatureIndex.loadFeature({featureIndex:be.featureIndex,bucketIndex:rt.bucketIndex,sourceLayerIndex:rt.sourceLayerIndex,layoutVertexArrayOffset:0}));const $e=de.evaluate(Ue,{}),ct=d.has(De);let at=this.opacities[De];ct?at=j:at||(at=Ce,this.opacities[De]=at),d.add(De);const dt=Ae>0||Ne>0,Gt=Ye>0,Mt=this.placedOrientations[De],Ct=Mt===a.bm.vertical,xt=Mt===a.bm.horizontal||Mt===a.bm.horizontalOnly;!dt&&!Gt||at.isHidden()||Re++;let dn=!1;if((dt||Gt)&&T)for(const an of o.activeReplacements){if(a.bD(an,S,a.bE.Symbol,k)||an.min.x>Ke||Ke>an.max.x||an.min.y>Tt||Tt>an.max.y)continue;const Jt=a.bF(Ke,Tt,I.canonical,an.footprintTileId.canonical);if(dn=a.bG(Jt,an.footprint),dn)break}if(dn&&this.collisionIndex.markSymbolAsClipped(o.bucketInstanceId,be.featureIndex),dt){const an=dn?$h:b1(at.text);Se(o.text,Ae,Ct?$h:an),Se(o.text,Ne,xt?$h:an);const Jt=at.text.isHidden(),{leftJustifiedTextSymbolIndex:tn,centerJustifiedTextSymbolIndex:bn,rightJustifiedTextSymbolIndex:kn,verticalPlacedTextSymbolIndex:Pn}=be,jn=o.text.placedSymbolArray,An=Jt||Ct?1:0;tn>=0&&(jn.get(tn).hidden=An),bn>=0&&(jn.get(bn).hidden=An),kn>=0&&(jn.get(kn).hidden=An),Pn>=0&&(jn.get(Pn).hidden=Jt||xt?1:0);const or=this.variableOffsets[De];or&&this.markUsedJustification(o,or.anchor,be,Mt);const Fn=this.placedOrientations[De];Fn&&(this.markUsedJustification(o,"left",be,Fn),this.markUsedOrientation(o,Fn,be))}if(Gt){const an=dn?$h:b1(at.icon),{placedIconSymbolIndex:Jt,verticalPlacedIconSymbolIndex:tn}=be,bn=o.icon.placedSymbolArray,kn=at.icon.isHidden()?1:0;Jt>=0&&(Se(o.icon,Ye,Ct?$h:an),bn.get(Jt).hidden=kn),tn>=0&&(Se(o.icon,be.numVerticalIconVertices,xt?$h:an),bn.get(tn).hidden=kn)}if(o.hasIconCollisionBoxData()||o.hasTextCollisionBoxData()){const an=o.collisionArrays[ve];if(an){let Jt=new a.P(0,0),tn=!0;if(an.textBox||an.verticalTextBox){if(ee){const kn=this.variableOffsets[De];kn?(Jt=y1(kn.anchor,kn.width,kn.height,kn.textOffset,kn.textScale),oe&&Jt._rotate(se?this.transform.angle:-this.transform.angle)):tn=!1}q&&(tn=!at.clipped),an.textBox&&lg(o.textCollisionBox.collisionVertexArray,at.text.placed,!tn||Ct,$e,pe,Jt.x,Jt.y),an.verticalTextBox&&lg(o.textCollisionBox.collisionVertexArray,at.text.placed,!tn||xt,$e,pe,Jt.x,Jt.y)}const bn=tn&&!!(!xt&&an.verticalIconBox);an.iconBox&&lg(o.iconCollisionBox.collisionVertexArray,at.icon.placed,bn,$e,pe,be.hasIconTextFit?Jt.x:0,be.hasIconTextFit?Jt.y:0),an.verticalIconBox&&lg(o.iconCollisionBox.collisionVertexArray,at.icon.placed,!bn,$e,pe,be.hasIconTextFit?Jt.x:0,be.hasIconTextFit?Jt.y:0)}}}if(o.fullyClipped=Re===0,o.sortFeatures(this.transform.angle),this.retainedQueryData[o.bucketInstanceId]&&(this.retainedQueryData[o.bucketInstanceId].featureSortOrder=o.featureSortOrder),o.hasTextData()&&o.text.opacityVertexBuffer&&o.text.opacityVertexBuffer.updateData(o.text.opacityVertexArray),o.hasIconData()&&o.icon.opacityVertexBuffer&&o.icon.opacityVertexBuffer.updateData(o.icon.opacityVertexArray),o.hasIconCollisionBoxData()&&o.iconCollisionBox.collisionVertexBuffer&&o.iconCollisionBox.collisionVertexBuffer.updateData(o.iconCollisionBox.collisionVertexArray),o.hasTextCollisionBoxData()&&o.textCollisionBox.collisionVertexBuffer&&o.textCollisionBox.collisionVertexBuffer.updateData(o.textCollisionBox.collisionVertexArray),o.bucketInstanceId in this.collisionCircleArrays){const ve=this.collisionCircleArrays[o.bucketInstanceId];o.placementInvProjMatrix=ve.invProjMatrix,o.placementViewportMatrix=ve.viewportMatrix,o.collisionCircleArray=ve.circles,delete this.collisionCircleArrays[o.bucketInstanceId]}}symbolFadeChange(o){return this.fadeDuration===0?1:(o-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(o){return Math.max(0,(this.transform.zoom-o)/1.5)}hasTransitions(o){return o-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(o,d){const _=this.zoomAtLastRecencyCheck===d?1-this.zoomAdjustment(d):1;return this.zoomAtLastRecencyCheck=d,this.commitTime+this.fadeDuration*_>o}isStale(){return this.stale}setStale(){this.stale=!0}}function lg(p,o,d,_,b,S,T){p.emplaceBack(o?1:0,d?1:0,S||0,T||0,_,b?1:0),p.emplaceBack(o?1:0,d?1:0,S||0,T||0,_,b?1:0),p.emplaceBack(o?1:0,d?1:0,S||0,T||0,_,b?1:0),p.emplaceBack(o?1:0,d?1:0,S||0,T||0,_,b?1:0)}const h2=Math.pow(2,25),Uh=Math.pow(2,24),v1=Math.pow(2,17),cg=Math.pow(2,16),qy=Math.pow(2,9),xu=Math.pow(2,8),f2=Math.pow(2,1);function b1(p){if(p.opacity===0&&!p.placed)return 0;if(p.opacity===1&&p.placed)return 4294967295;const o=p.placed?1:0,d=Math.floor(127*p.opacity);
25return d*h2+o*Uh+d*v1+o*cg+d*qy+o*xu+d*f2+o}const $h=0;class x1{constructor(o){this._sortAcrossTiles=o.layout.get("symbol-z-order")!=="viewport-y"&&o.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(o,d,_,b,S,T){const I=this._bucketParts;for(;this._currentTileIndex<o.length;)if(d.getBucketParts(I,b,o[this._currentTileIndex],this._sortAcrossTiles,T),this._currentTileIndex++,S())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,I.sort((k,F)=>k.sortKey-F.sortKey));this._currentPartIndex<I.length;){const k=I[this._currentPartIndex];if(d.placeLayerBucketPart(k,this._seenCrossTileIDs,_,k.symbolInstanceStart===0,T),this._currentPartIndex++,S())return!0}return!1}}class w1{startNewPlacement(o,d,_,b,S,T,I,k){return this.placement=new wp(o,b,S,T,I,k),this._currentPlacementIndex=d.length-1,this._forceFullPlacement=!1,this._showCollisionBoxes=_,this._fadeDuration=b,this._done=!1,this._inProgressLayer=null,this}requestFullPlacement(){this._forceFullPlacement=!0}isFullPlacementRequested(){return this._forceFullPlacement}setStale(){this.placement&&(this.placement.stale=!0)}isStale(){return!!this.placement&&this.placement.stale}isDone(){return this._done}continuePlacement(o,d,_,b,S){const T=a.o.now(),I=()=>{const k=a.o.now()-T;return!this.isFullPlacementRequested()&&this._fadeDuration!==0&&k>2};for(;this._currentPlacementIndex>=0;){const k=d[o[this._currentPlacementIndex]],F=this.placement.collisionIndex.transform.zoom;if(k.type==="symbol"&&k.visibility!=="none"&&(!k.minzoom||k.minzoom<=F)&&(!k.maxzoom||k.maxzoom>F)){const z=k,q=z.layout.get("symbol-z-elevate"),j=z.layout.get("symbol-sort-key").constantOr(1)!==void 0,Z=z.layout.get("symbol-z-order"),te=Z==="viewport-y"||Z==="auto"&&!(Z!=="viewport-y"&&j),ee=z.layout.get("text-allow-overlap")||z.layout.get("icon-allow-overlap")||z.layout.get("text-ignore-placement")||z.layout.get("icon-ignore-placement"),oe=te&&ee,se=this._inProgressLayer=this._inProgressLayer||new x1(z),de=a.t(k.source,k.scope);if(se.continuePlacement(q||oe?b[de]:_[de],this.placement,this._showCollisionBoxes,k,I,S))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._forceFullPlacement=!1,this._done=!0}commit(o){return this.placement.commit(o),this.placement}}const Sp=512/a.ak/2;class S1{constructor(o,d,_){this.tileID=o,this.bucketInstanceId=_,this.index=new a.bM(d.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const b=o.canonical.x*a.ak,S=o.canonical.y*a.ak;for(let T=0;T<d.length;T++){const{key:I,crossTileID:k,tileAnchorX:F,tileAnchorY:z}=d.get(T),q=Math.floor((b+F)*Sp),j=Math.floor((S+z)*Sp);this.index.add(q,j),this.keys.push(I),this.crossTileIDs.push(k)}this.index.finish()}findMatches(o,d,_){const b=this.tileID.canonical.z<d.canonical.z?1:Math.pow(2,this.tileID.canonical.z-d.canonical.z),S=Sp/Math.pow(2,d.canonical.z-this.tileID.canonical.z),T=d.canonical.x*a.ak,I=d.canonical.y*a.ak;for(let k=0;k<o.length;k++){const F=o.get(k);if(F.crossTileID)continue;const{key:z,tileAnchorX:q,tileAnchorY:j}=F,Z=Math.floor((T+q)*S),te=Math.floor((I+j)*S),ee=this.index.range(Z-b,te-b,Z+b,te+b).sort((oe,se)=>oe-se);for(const oe of ee){const se=this.crossTileIDs[oe];if(this.keys[oe]===z&&!_.has(se)){_.add(se),F.crossTileID=se;break}}}}}class T1{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class E1{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(o){const d=Math.round((o-this.lng)/360);if(d!==0)for(const _ in this.indexes){const b=this.indexes[_],S={};for(const T in b){const I=b[T];I.tileID=I.tileID.unwrapTo(I.tileID.wrap+d),S[I.tileID.key]=I}this.indexes[_]=S}this.lng=o}addBucket(o,d,_){if(this.indexes[o.overscaledZ]&&this.indexes[o.overscaledZ][o.key]){if
25(this.indexes[o.overscaledZ][o.key].bucketInstanceId===d.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(o.overscaledZ,this.indexes[o.overscaledZ][o.key])}for(let S=0;S<d.symbolInstances.length;S++)d.symbolInstances.get(S).crossTileID=0;this.usedCrossTileIDs[o.overscaledZ]||(this.usedCrossTileIDs[o.overscaledZ]=new Set);const b=this.usedCrossTileIDs[o.overscaledZ];for(const S in this.indexes){const T=this.indexes[S];if(Number(S)>o.overscaledZ)for(const I in T){const k=T[I];k.tileID.isChildOf(o)&&k.findMatches(d.symbolInstances,o,b)}else{const I=T[o.scaledTo(Number(S)).key];I&&I.findMatches(d.symbolInstances,o,b)}}for(let S=0;S<d.symbolInstances.length;S++){const T=d.symbolInstances.get(S);T.crossTileID||(T.crossTileID=_.generate(),b.add(T.crossTileID))}return this.indexes[o.overscaledZ]===void 0&&(this.indexes[o.overscaledZ]={}),this.indexes[o.overscaledZ][o.key]=new S1(o,d.symbolInstances,d.bucketInstanceId),!0}removeBucketCrossTileIDs(o,d){for(const _ of d.crossTileIDs)this.usedCrossTileIDs[o].delete(_)}removeStaleBuckets(o){let d=!1;for(const _ in this.indexes){const b=this.indexes[_];for(const S in b)o[b[S].bucketInstanceId]||(this.removeBucketCrossTileIDs(_,b[S]),delete b[S],d=!0)}return d}}class C1{constructor(){this.layerIndexes={},this.crossTileIDs=new T1,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(o,d,_,b){let S=this.layerIndexes[o.fqid];S===void 0&&(S=this.layerIndexes[o.fqid]=new E1);let T=!1;const I={};b.name!=="globe"&&S.handleWrapJump(_);for(const k of d){const F=k.getBucket(o);F&&o.fqid===F.layerIds[0]&&(F.bucketInstanceId||(F.bucketInstanceId=++this.maxBucketInstanceId),S.addBucket(k.tileID,F,this.crossTileIDs)&&(T=!0),I[F.bucketInstanceId]=!0)}return S.removeStaleBuckets(I)&&(T=!0),T}pruneUnusedLayers(o){const d={};o.forEach(_=>{d[_]=!0});for(const _ in this.layerIndexes)d[_]||delete this.layerIndexes[_]}}const Wl=770,ql=771;class In{constructor(o,d,_,b){this.blendFunction=o,this.blendColor=d.toNonPremultipliedRenderColor(null),this.mask=_,this.blendEquation=b}}In.Replace=[1,0,1,0],In.disabled=new In(In.Replace,a.C.transparent,[!1,!1,!1,!1]),In.unblended=new In(In.Replace,a.C.transparent,[!0,!0,!0,!0]),In.alphaBlended=new In([1,ql,1,ql],a.C.transparent,[!0,!0,!0,!0]),In.alphaBlendedNonPremultiplied=new In([Wl,ql,Wl,ql],a.C.transparent,[!0,!0,!0,!0]),In.multiply=new In([774,0,774,0],a.C.transparent,[!0,!0,!0,!0]),In.multiplyAccumulateAlpha=new In([774,0,1,ql],a.C.transparent,[!0,!0,!0,!0]),In.additive=new In([1,1,1,1],a.C.transparent,[!0,!0,!0,!0]),In.additiveAlphaWeighted=new In([Wl,1,773,1],a.C.transparent,[!0,!0,!0,!0]),In.additiveAlphaWeightedUnboundedAlpha=new In([Wl,1,1,1],a.C.transparent,[!0,!0,!0,!0]);class rn{constructor(o,d,_){this.func=o,this.mask=d,this.range=_}}rn.ReadOnly=!1,rn.ReadWrite=!0,rn.disabled=new rn(519,rn.ReadOnly,[0,1]);const vd=7680;class Tn{constructor(o,d,_,b,S,T){this.test=o,this.ref=d,this.mask=_,this.fail=b,this.depthFail=S,this.pass=T}}Tn.disabled=new Tn({func:519,mask:0},0,0,vd,vd,vd);const ug=1029,Tp=2305;class pn{constructor(o,d,_){this.enable=o,this.mode=d,this.frontFace=_}}function Ep(p,o){const d=a.bS(p,3);a.bV(p,o),a.b_(p,3,d)}function Bt(p,o){const d=a.bP([]);return a.bQ(d,d,-o),a.bR(d,d,-p),d}function Xy(p,o){const d=[p[0],p[1],0],_=[o[0],o[1],0];if(a.af(d)>=1e-15){const T=a.ax([],d);a.bN(_,T,a.bk(_,T)),o[0]=_[0],o[1]=_[1]}const b=a.bj([],o,p);if(a.bO(b)<1e-15)return null;const S=Math.atan2(-b[1],b[0]);return Bt(Math.atan2(Math.sqrt(p[0]*p[0]+p[1]*p[1]),-p[2]),S)}pn.disabled=new pn(!1,ug,Tp),pn.backCCW=new pn(!0,ug,Tp),pn.backCW=new pn(!0,ug,2304),pn.frontCW=new pn(!0,1028,2304),pn.frontCCW=new pn(!0,1028,Tp);class Zy{constructor(o,d){this.position=o,this.orientation=d}get position(){return this._position}set position(o){if(o){const d=o instanceof a.ad?o:new a.ad(o[0],o[1],o[2]);
25this._renderWorldCopies&&(d.x=a.bv(d.x,0,1)),this._position=d}else this._position=null}lookAtPoint(o,d,_){if(this.orientation=null,!this.position)return;const b=this.position,S=_||(this._elevation?this._elevation.getAtPointOrZero(a.ad.fromLngLat(o)):0),T=a.ad.fromLngLat(o,S),I=[T.x-b.x,T.y-b.y,T.z-b.z];d||(d=[0,0,1]),d[2]=Math.abs(d[2]),this.orientation=Xy(I,d)}setPitchBearing(o,d){this.orientation=Bt(a.am(o),a.am(-d))}}class bd{constructor(o,d){this._transform=a.bA([]),this.orientation=d,this.position=o}get mercatorPosition(){const o=this.position;return new a.ad(o[0],o[1],o[2])}get position(){const o=a.bS(this._transform,3);return[o[0],o[1],o[2]]}set position(o){var d;o&&a.b_(this._transform,3,[(d=o)[0],d[1],d[2],1])}get orientation(){return this._orientation}set orientation(o){this._orientation=o||a.bP([]),o&&Ep(this._transform,this._orientation)}getPitchBearing(){const o=this.forward(),d=this.right();return{bearing:Math.atan2(-d[1],d[0]),pitch:Math.atan2(Math.sqrt(o[0]*o[0]+o[1]*o[1]),-o[2])}}setPitchBearing(o,d){this._orientation=Bt(o,d),Ep(this._transform,this._orientation)}forward(){const o=a.bS(this._transform,2);return[-o[0],-o[1],-o[2]]}up(){const o=a.bS(this._transform,1);return[-o[0],-o[1],-o[2]]}right(){const o=a.bS(this._transform,0);return[o[0],o[1],o[2]]}getCameraToWorld(o,d){const _=new Float64Array(16);return a.ba(_,this.getWorldToCamera(o,d)),_}getCameraToWorldMercator(){return this._transform}getWorldToCameraPosition(o,d,_){const b=this.position;a.bN(b,b,-o);const S=new Float64Array(16);return a.bT(S,[_,_,_]),a.bB(S,S,b),S[10]*=d,S}getWorldToCamera(o,d){const _=new Float64Array(16),b=new Float64Array(4),S=this.position;return a.bU(b,this._orientation),a.bN(S,S,-o),a.bV(_,b),a.bB(_,_,S),_[1]*=-1,_[5]*=-1,_[9]*=-1,_[13]*=-1,_[8]*=d,_[9]*=d,_[10]*=d,_[11]*=d,_}getCameraToClipPerspective(o,d,_,b){const S=new Float64Array(16);return a.bW(S,o,d,_,b),S}getCameraToClipOrthographic(o,d,_,b,S,T){const I=new Float64Array(16);return a.bX(I,o,d,_,b,S,T),I}getDistanceToElevation(o,d=!1){const _=o===0?0:a.bY(o,d?a.bZ(this.position[1]):this.position[1]),b=this.forward();return(_-this.position[2])/b[2]}clone(){return new bd([...this.position],[...this.orientation])}}const Ic=(p,o)=>({u_matrix:p,u_ground_shadow_factor:o});class Cp{constructor(o=0,d=0,_=0,b=0){if(isNaN(o)||o<0||isNaN(d)||d<0||isNaN(_)||_<0||isNaN(b)||b<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=o,this.bottom=d,this.left=_,this.right=b}interpolate(o,d,_){return d.top!=null&&o.top!=null&&(this.top=a.aj(o.top,d.top,_)),d.bottom!=null&&o.bottom!=null&&(this.bottom=a.aj(o.bottom,d.bottom,_)),d.left!=null&&o.left!=null&&(this.left=a.aj(o.left,d.left,_)),d.right!=null&&o.right!=null&&(this.right=a.aj(o.right,d.right,_)),this}getCenter(o,d){const _=a.aB((this.left+o-this.right)/2,0,o),b=a.aB((this.top+d-this.bottom)/2,0,d);return new a.P(_,b)}equals(o){return this.top===o.top&&this.bottom===o.bottom&&this.left===o.left&&this.right===o.right}clone(){return new Cp(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const wa=15;class jh{constructor(o,d,_,b,S,T,I){this.tileSize=512,this._renderWorldCopies=S===void 0||S,this._minZoom=o||0,this._maxZoom=d||22,this._minPitch=_??0,this._maxPitch=b??60,this.setProjection(T),this.setMaxBounds(I),this.width=0,this.height=0,this._center=new a.aX(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._nearClipOffset=0,this._unmodified=!0,this._edgeInsets=new Cp,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._expandedProjMatrixCache={},this._distanceTileDataCache={},this._camera=new bd,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._tileCoverLift=0,this.freezeTileCoverage=!1,this._horizonShift=.1,this._orthographicProjectionAtLowPitch=!1,this._allowWorldUnderZoom=!1,this.mercatorMatrix=new Float64Array(16),this.mercatorFogMatrix=new Float32Array(16),this.invProjMatrix=new Float64Array(16),this._expandedFarZProjMatrixBuf=new Float64Array(16),this.expandedFarZProjMatrix=this._expandedFarZProjMatrixBuf,this.starsProjMatrix=new Float32Array(16),this.skyboxMatrix=new Float32Array(16),this._mat4Scratch=new Float64Array(16),this.alignedProjMatrix=new Float64Array(16),this.labelPlaneMatr
25ix=new Float32Array(16),this.glCoordMatrix=new Float32Array(16),this.pixelMatrix=new Float64Array(16),this.pixelMatrixInverse=new Float64Array(16)}clone(){const o=new jh(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection(),this.maxBounds);return o._elevation=this._elevation,o._centerAltitude=this._centerAltitude,o._centerAltitudeValidForExaggeration=this._centerAltitudeValidForExaggeration,o.tileSize=this.tileSize,o.mercatorFromTransition=this.mercatorFromTransition,o.width=this.width,o.height=this.height,o.cameraElevationReference=this.cameraElevationReference,o._center=this._center,o._setZoom(this.zoom),o._seaLevelZoom=this._seaLevelZoom,o.angle=this.angle,o._fov=this._fov,o._pitch=this._pitch,o._nearZ=this._nearZ,o._farZ=this._farZ,o._nearClipOffset=this._nearClipOffset,o._averageElevation=this._averageElevation,o._orthographicProjectionAtLowPitch=this._orthographicProjectionAtLowPitch,o._unmodified=this._unmodified,o._edgeInsets=this._edgeInsets.clone(),o._camera=this._camera.clone(),o._calcMatrices(),o.freezeTileCoverage=this.freezeTileCoverage,o.frustumCorners=this.frustumCorners,o._allowWorldUnderZoom=this._allowWorldUnderZoom,o}get isOrthographic(){return this.projection.name!=="globe"&&this._orthographicProjectionAtLowPitch&&this.pitch<wa}get elevation(){return this._elevation}set elevation(o){this._elevation!==o&&(this._elevation=o,this._updateCameraOnTerrain(),this._calcMatrices())}get nearClipOffset(){return this._nearClipOffset}set nearClipOffset(o){this._nearClipOffset=o,this._calcMatrices()}get depthOcclusionForSymbolsAndCircles(){return this.projection.name!=="globe"&&!this.isOrthographic}updateElevation(o,d=!1){const _=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForE
25xaggeration;(this._seaLevelZoom==null||_)&&this._updateCameraOnTerrain(),(o||_)&&this._constrainCamera(d),this._calcMatrices()}getProjection(){return a.aK(this.projection,["name","center","parallels"])}setProjection(o){this.projectionOptions=o||{name:"mercator"};const d=this.projection?this.getProjection():void 0;this.projection=a.c4(this.projectionOptions);const _=this.getProjection(),b=!a.b9(d,_);return b&&this._calcMatrices(),this.mercatorFromTransition=!1,b}setOrthographicProjectionAtLowPitch(o){return this._orthographicProjectionAtLowPitch!==o&&(this._orthographicProjectionAtLowPitch=o,this._calcMatrices(),!0)}setMercatorFromTransition(){const o=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=a.c4({name:"mercator"});const d=o!==this.projection.name;return d&&this._calcMatrices(),d}get minZoom(){return this._minZoom}set minZoom(o){this._minZoom!==o&&(this._minZoom=o,this.zoom=Math.max(this.zoom,o))}get maxZoom(){return this._maxZoom}set maxZoom(o){this._maxZoom!==o&&(this._maxZoom=o,this.zoom=Math.min(this.zoom,o))}get minPitch(){return this._minPitch}set minPitch(o){this._minPitch!==o&&(this._minPitch=o,this.pitch=Math.max(this.pitch,o))}get maxPitch(){return this._maxPitch}set maxPitch(o){this._maxPitch!==o&&(this._maxPitch=o,this.pitch=Math.min(this.pitch,o))}get renderWorldCopies(){return this._renderWorldCopies&&this.projection.supportsWorldCopies===!0}set renderWorldCopies(o){o===void 0?o=!0:o===null&&(o=!1),this._renderWorldCopies=o}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){const o=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(o))}get cameraWorldSize(){const o=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(o))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return a.bY(1,this.center.lat)*this.cameraWorldSizeForFog}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new a.P(this.width,this.height)}get bearing(){return a.bv(this.rotation,-180,180)}set bearing(o){this.rotation=o}get rotation(){return-this.angle/Math.PI*180}set rotation(o){const d=-o*Math.PI/180;if(this.angle===d)return;this._unmodified=!1,this.angle=d,this._calcMatrices();const _=Math.sin(this.angle),b=Math.cos(this.angle);this.rotationMatrix=[b,_,-_,b]}get pitch(){return this._pitch/Math.PI*180}set pitch(o){const d=a.aB(o,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==d&&(this._unmodified=!1,this._pitch=d,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}set fov(o){o=Math.max(.01,Math.min(60,o)),this._fov!==o&&(this._unmodified=!1,this._fov=a.am(o),this._calcMatrices())}get fovX(){return this._fov}get fovY(){const o=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/o)}get averageElevation(){return this._averageElevation}set averageElevation(o){this._averageElevation=o,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(o){const d=Math.min(Math.max(o,this.minZoom),this.maxZoom);this._zoom!==d&&(this._unmodified=!1,this._setZoom(d),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(o){this._zoom=o,this.scale=this.zoomScale(o),this.tileZoom=Math.floor(o),this.zoomFraction=o-this.tileZoom}get tileCoverLift(){return this._tileCoverLift}set tileCoverLift(o){this._tileCoverLift!==o&&(this._tileCoverLift=o)}_updateCameraOnTerrain(){const o=this.elevation?this.elevation.getAtPoint(this.locationCoordinate(this.center),Number.NEGATIVE_INFINITY):Number.NEGATIVE_INFINITY,d=this.elevation&&o===Number.NEGATIVE_INFINITY&&this.elevation.visibleDemTiles.length>0&&this.elevation.exaggeration()>
vendor: 1,092 bytes, line 25
250&&this._centerAltitudeValidForExaggeration;if(!this._elevation||o===Number.NEGATIVE_INFINITY&&(!d||!this._centerAltitude))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);const _=this._elevation;d||this._centerAltitude&&this._centerAltitudeValidForExaggeration&&_.exaggeration()&&this._centerAltitudeValidForExaggeration!==_.exaggeration()?(this._centerAltitude=this._centerAltitude/this._centerAltitudeValidForExaggeration*_.exaggeration(),this._centerAltitudeValidForExaggeration=_.exaggeration()):(this._centerAltitude=o||0,this._centerAltitudeValidForExaggeration=_.exaggeration()),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){if(this._centerAltitudeValidForExaggeration===void 0)return;const o=Math.max(0,(this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize);this._seaLevelZoom=this._zoomFromMercatorZ(o)}sampleAverageElevation(){if(!this._elevation)return 0;const o=this._elevation,d=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],_=this.horizonLineFromTop();let b=0,S=0;for(let T=0;T<d.length;
25T++){const I=new a.P(d[T][0]*this.width,_+d[T][1]*(this.height-_)),k=o.pointCoordinate(I);if(!k)continue;const F=1/Math.hypot(k[0]-this._camera.position[0],k[1]-this._camera.position[1]);b+=k[3]*F,S+=F}return S===0?NaN:b/S}get center(){return this._center}set center(o){o.lat===this._center.lat&&o.lng===this._center.lng||(this._unmodified=!1,this._center=o,this._terrainEnabled()&&(this.cameraElevationReference==="ground"?this._updateCameraOnTerrain():this._updateZoomFromElevation()),this._constrain(),this._calcMatrices())}_updateZoomFromElevation(){if(this._seaLevelZoom==null||!this._elevation)return;const o=this._seaLevelZoom,d=this._elevation.getAtPointOrZero(this.locationCoordinate(this.center)),_=this.pixelsPerMeter/this.worldSize*d,b=this._mercatorZfromZoom(o),S=this._mercatorZfromZoom(this._maxZoom),T=Math.max(b-_,S);this._setZoom(this._zoomFromMercatorZ(T))}get padding(){return this._edgeInsets.toJSON()}set padding(o){this._edgeInsets.equals(o)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,o,1),this._calcMatrices())}equals(o){const d=this.elevation,_=o.elevation,b=d!=null!=(_!=null)||d&&_&&d.exaggeration()!==_.exaggeration();return this.width===o.width&&this.height===o.height&&this.center.lng===o.center.lng&&this.center.lat===o.center.lat&&this.zoom===o.zoom&&this.bearing===o.bearing&&this.pitch===o.pitch&&this.fov===o.fov&&this.projection.name===o.projection.name&&this._edgeInsets.equals(o.padding)&&!b}computeZoomRelativeTo(o){const d=this.rayIntersectionCoordinate(this.pointRayIntersection(this.centerPoint,o.toAltitude()));let _;_=o.z<this._camera.position[2]?[d.x,d.y,d.z]:[o.x,o.y,o.z];const b=a.af(a.aw([],this._camera.position,_));return a.aB(this._zoomFromMercatorZ(b),this._minZoom,this._maxZoom)}setFreeCameraOptions(o){if(!this.height||!o.position&&!o.orientation)return;this._updateCameraState();let d=!1;if(o.orientation&&!a.c5(o.orientation,this._camera.orientation)&&(d=this._setCameraOrientation(o.orientation)),o.position){const _=[o.position.x,o.position.y,o.position.z];a.c6(_,this._camera.position)||(this._setCameraPosition(_),d=!0)}d&&(this._updateStateFromCamera(),this.recenterOnTerrain())}getFreeCameraOptions(){this._updateCameraState();const o=this._camera.position,d=new Zy;return d.position=new a.ad(o[0],o[1],o[2]),d.orientation=this._camera.orientation,d._elevation=this.elevation,d._renderWorldCopies=this.renderWorldCopies,d}_setCameraOrientation(o){if(!a.c7(o))return!1;a.c8(o,o);const d=a.c9([],[0,0,-1],o),_=a.c9([],[0,-1,0],o);if(_[2]<0)return!1;const b=Xy(d,_);return!!b&&(this._camera.orientation=b,!0)}_setCameraPosition(o){const d=this.zoomScale(this.minZoom)*this.tileSize,_=this.zoomScale(this.maxZoom)*this.tileSize,b=this.cameraToCenterDistance;o[2]=a.aB(o[2],b/_,b/d),this._camera.position=o}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}get fovAboveCenter(){return this._fov*(.5+this.centerOffset.y/this.height)}isPaddingEqual(o){return this._edgeInsets.equals(o)}interpolatePadding(o,d,_){this._unmodified=!1,this._edgeInsets.interpolate(o,d,_),this._constrain(),this._calcMatrices()}coveringZoomLevel(o){const d=(o.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/o.tileSize));return Math.max(0,d)}getVisibleUnwrappedCoordinates(o){const d=[new a.ca(0,o)];if(this.renderWorldCopies){const _=this.pointCoordinate(new a.P(0,0)),b=this.pointCoordinate(new a.P(this.width,0)),S=this.pointCoordinate(new a.P(this.width,this.height)),T=this.pointCoordinate(new a.P(0,this.height)),I=Math.floor(Math.min(_.x,b.x,S.x,T.x)),k=Math.floor(Math.max(_.x,b.x,S.x,T.x)),F=1;for(let z=I-F;z<=k+F;z++)z!==0&&d.push(new a.ca(z,o))}return d}isLODDisabled(o){return(!o||this.pitch<=60)&&this._edgeInsets.top<=this._edgeInsets.bottom&&!this._elevation&&!this.projection.isReprojectedInTileSpace}extendTileCover(o,d,_,b){let S=[];const T=_!=null,I=!T;if(I&&this.zoom<d||T&&_[0]===0&&_[1]===0)return S;const k=new Set,F=(q,j,Z,te,ee)=>{const oe=a.cm(j,q,Z,te,ee);k.has(oe)||(S.push(new a.aU(q,j,Z,te,ee)),k.add(oe))};for(let q=0;q<o.length;q++){const j=o[q];if(I&&j.canonical.z!==d||T&&b!==void 0&&b>j.canonical.z)continue;const Z=j.canonical,te=j.overscaledZ,ee=j.wrap,oe=1<<Z.z,se=Z.x+1<oe,de=Z.x>0,pe=Z.y+1<oe,ce=Z.y>0,Ce=j.wrap-(de?0:1),Se=j.wrap+(se?0:1),Re=de?Z.x-1:oe-1,ve=se?Z.x+1:0;if(T)_[0]<0?(F(te,Se,Z.z,ve,Z.y),_[1]<0&&pe&&(F(te,ee,Z.z,Z.x,Z.y+1),F(te,Se,Z.z,ve,Z.y+1)),_[1]>0&&ce&&(F(te,ee,Z.z,Z.x,Z.y-1),F(te,Se,Z.z,ve,Z.y-1))):_[0]>0?(F(te,Ce,Z.z,Re,Z.y),_[1]<0&&pe&&(F(te,ee,Z.z,Z.x,Z.y+1),F(te,Ce,Z.z,Re,Z.y+1)),_[1]>0&&ce&&(F(te,ee,Z.z,Z.x,Z.y-1),F(te,Ce,Z.z,Re,Z.y-1))):_[1]<0&&pe?F(te,ee,Z.z,Z.x,Z.y+1):ce&&F(te,ee,Z.z,Z.x,Z.y-1);else{const be=j.visibleQuadrants;1&be&&(F(te,Ce,Z.z,Re,Z.y),ce&&(F(te,ee,Z.z,Z.x,Z.y-1),F(te,Ce,Z.z,Re,Z.y-1))),2&be&&(F(te,Se,Z.z,ve,Z.y),ce&&(F(te,ee,Z.z,Z.x,Z.y-1),F(te,Se,Z.z,ve,Z.y-1))),4&be&&(F(te,Ce,Z.z,Re,Z.y),pe&&(F(te,ee,Z.z,Z.x,Z.y+1),F(te,Ce,Z.z,Re,Z.y+1))),8&be&&(F(te,Se,Z.z,ve,Z.y),pe&&(F(te,ee,Z.z,Z.x,Z.y+1),F(te,Se,Z.z,ve,Z.y+1)))}}const z=[];for(const q of S)S.some(j=>q.isChildOf(j))||z.push(q);if(S=z.filter(q=>!o.some(j=>!!(q.overscaledZ<d&&j.isChildOf(q))||q.equals(j)||q.isChildOf(j))),I){const q=1<<d,j=this.projection.name==="globe"?this._camera.mercatorPosition:this.pointCoordinate(this.getCameraPoint()),Z=[q*j.x,q*j.y],te=4,ee=te*te;S=S.filter(oe=>{const se=oe.canonical.x+.5-Z[0],de=oe.canonical.y+.5-Z[1];return se*se+de*de<ee})}return S}extendTileCoverToNearPlane(o,d,_){const b=[],S=new Set;for(const de of o)S.add(de.key);const T=(de,pe,ce,Ce,Se)=>{const Re=a.cm(pe,de,ce,Ce,Se);S.has(Re)||(b.push(new a.aU(de,pe,ce,Ce,Se)),S.add(Re))},I=o.reduce((de,pe)=>
25Math.max(de,pe.overscaledZ),_),k=1<<_,F=[new a.P(0,0),new a.P(a.ak,0),new a.P(a.ak,a.ak),new a.P(0,a.ak)],z=new a.P(0,0),q=new a.P(0,0),j=(de,pe)=>{const ce=Math.floor(de[0]),Ce=Math.floor(de[1]),Se=(de[0]-ce)*a.ak,Re=(de[1]-Ce)*a.ak,ve=Math.floor(pe[0]),be=Math.floor(pe[1]),Ae=(pe[0]-ve)*a.ak,Ne=(pe[1]-be)*a.ak;for(let De=-1;De<=1;De++){const Ye=ce+De;if(!(Ye<0||Ye>=k)){z.x=Se-De*a.ak,q.x=Ae-(Ye-ve)*a.ak;for(let Ke=-1;Ke<=1;Ke++){const Tt=Ce+Ke;z.y=Re-Ke*a.ak,q.y=Ne-(Tt-be)*a.ak,a.cM(z,q,F)&&T(I,0,_,Ye,Tt)}}}},Z=d.points,te=Z[a.cb],ee=Z[a.cc],oe=this._projectToGround(te,Z[a.cd]),se=this._projectToGround(ee,Z[a.ce]);return j(te,oe),j(ee,se),b}_projectToGround(o,d){return a.cf(a.cg(),o,d,o[2]/(o[2]-d[2]))}_projectToZ(o,d,_){const b=o[2]-d[2];return Math.abs(b)<1e-6?a.ch(o):a.cf(a.cg(),o,d,(o[2]-_)/b)}extendTileCoverForTunnels(o,d,_,b){if(_<18)return[];const S=d.points,T=S[a.ci],I=S[a.cj],k=S[a.ck],F=S[a.cl];if(k[2]>=0&&F[2]>=0||T[2]<=0||I[2]<=0)return[];const z=k[2]<0?this._projectToZ(T,k,0):k,q=F[2]<0?this._projectToZ(I,F,0):F,j=-b,Z=k[2]<j?this._projectToZ(T,k,j):k,te=F[2]<j?this._projectToZ(I,F,j):F,ee=this._findExtensionTilesInQuad(o,_,[te,Z,q,z],[.5*(z[0]+q[0]),.5*(z[1]+q[1])]);return ee.length>3&&(ee.length=3),ee}_findExtensionTilesInQuad(o,d,_,b){const S=[],T=new Set;for(const ve of o)T.add(ve.key);const I=o.reduce((ve,be)=>Math.max(ve,be.overscaledZ),d),k=1<<d,F=[new a.P(_[0][0],_[0][1]),new a.P(_[1][0],_[1][1]),new a.P(_[3][0],_[3][1]),new a.P(_[2][0],_[2][1]),new a.P(_[0][0],_[0][1])],z=_[0][0],q=_[1][0],j=_[2][0],Z=_[3][0],te=_[0][1],ee=_[1][1],oe=_[2][1],se=_[3][1],de=Math.max(0,Math.floor(Math.min(z,q,j,Z))),pe=Math.min(k-1,Math.ceil(Math.max(z,q,j,Z))-1),ce=Math.max(0,Math.floor(Math.min(te,ee,oe,se))),Ce=Math.min(k-1,Math.ceil(Math.max(te,ee,oe,se))-1);for(let ve=ce;ve<=Ce;ve++)for(let be=de;be<=pe;be++){if(!a.au(F,be,ve,be+1,ve+1))continue;const Ae=a.cm(0,I,d,be,ve);T.has(Ae)||(S.push(new a.aU(I,0,d,be,ve)),T.add(Ae))}const Se=b[0],Re=b[1];return S.sort((ve,be)=>{const Ae=ve.canonical.x+.5-Se,Ne=ve.canonical.y+.5-Re,De=be.canonical.x+.5-Se,Ye=be.canonical.y+.5-Re;return Ae*Ae+Ne*Ne-(De*De+Ye*Ye)||ve.canonical.x-be.canonical.x||ve.canonical.y-be.canonical.y}),S}coveringTiles(o){let d=this.coveringZoomLevel(o);const _=d,b=this.elevation&&this.elevation.exaggeration(),S=b&&!o.isTerrainDEM,T=this.projection.name==="mercator";if(o.minzoom!==void 0&&d<o.minzoom)return[];o.maxzoom!==void 0&&d>o.maxzoom&&(d=o.maxzoom);const I=this.locationCoordinate(this.center),k=this.center.lat,F=1<<d,z=[F*I.x,F*I.y,0],q=this.projection.name==="globe",j=!q,Z=a.cn.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,d,j),te=q?this._camera.mercatorPosition:this.pointCoordinate(this.getCameraPoint()),ee=F*a.bY(1,this.center.lat),oe=this._camera.position[2]/a.bY(1,this.center.lat),se=[F*te.x,F*te.y,oe*(j?1:ee)],de=q||b,pe=this.cameraToCenterDistance/o.tileSize*(o.roundZoom?1:.502),ce=this.isLODDisabled(!0)?d:0;let Ce;if(this._elevation&&o.isTerrainDEM)Ce=1e4*this._elevation.exaggeration();else if(this._elevation){const $e=this._elevation.getMinMaxForVisibleTiles();Ce=$e?$e.max:this._centerAltitude}else Ce=this._centerAltitude;const Se=o.isTerrainDEM?-Ce:this._elevation?this._elevation.getMinElevationBelowMSL():0,Re=this.projection.isReprojectedInTileSpace?a.co(this):1,ve=$e=>{const at=new a.ad($e.x+25e-6,$e.y,$e.z),dt=new a.ad($e.x,$e.y+25e-6,$e.z),Gt=$e.toLngLat(),Mt=at.toLngLat(),Ct=dt.toLngLat(),xt=this.locationCoordinate(Gt),dn=this.locationCoordinate(Mt),an=this.locationCoordinate(Ct),Jt=Math.hypot(dn.x-xt.x,dn.y-xt.y),tn=Math.hypot(an.x-xt.x,an.y-xt.y);return Math.sqrt(Jt*tn)*Re/25e-6},be=$e=>{const ct=Ce,at=Se;return{aabb:a.cr(this,F,0,0,0,$e,at,ct,this.projection),zoom:0,x:0,y:0,minZ:at,maxZ:ct,wrap:$e,fullyVisible:!1}},Ae=[];let Ne=[];const De=d,Ye=o.reparseOverscaled?_:d,Ke=(oe-this._centerAltitude)*ee,Tt=$e=>{if(!this._elevation||!$e.tileID||!T)return;const ct=this._elevation.getMinMaxForTile($e.tileID),at=$e.aabb;ct?(at.min[2]=ct.min,at.max[2]=ct.max,at.center[2]=(at.min[2]+at.max[2])/2):($e.shouldSplit=rt($e),$e.shouldSplit||(at.min[2]=at.max[2]=at.center[2]=this._centerAltitude))},Ue=($e,ct)=>{if(.707*ct<$e)return 1;const at=ct/$e;return at/(1.4144271570014144+(Math.pow(1.1,at-1.4144271570014144+1)-1)/(1.1-1)-1)},rt=$e=>{if($e.zoom<ce)return!0;
25if($e.zoom===De)return!1;if($e.shouldSplit!=null)return $e.shouldSplit;const ct=$e.aabb.distanceX(se),at=$e.aabb.distanceY(se);let dt=Ke,Gt=1;if(q){dt=$e.aabb.distanceZ(se);const tn=Math.pow(2,$e.zoom),bn=a.bZ(($e.y+1)/tn),kn=a.bZ($e.y/tn),Pn=Math.min(Math.max(k,bn),kn),jn=a.cQ(Pn)/a.cQ(k);if(Gt=Pn===k?1/Math.max(1,this._mercatorScaleRatio-.3):Math.min(1,jn/this._mercatorScaleRatio),this.zoom<=a.cN&&$e.zoom===De-1&&jn>=.9)return!0}else if(S&&(dt=$e.aabb.distanceZ(se)*ee),this.projection.isReprojectedInTileSpace&&_<=5){const tn=Math.pow(2,$e.zoom),bn=ve(new a.ad(($e.x+.5)/tn,($e.y+.5)/tn));Gt=bn>.85?1:bn}if(!T&&!q){const tn=Math.sqrt(ct*ct+at*at+dt*dt);let bn=(1<<De-$e.zoom)*pe*Gt;return bn*=Ue(Math.max(dt,Ke),tn),tn<bn}let Mt=Number.MAX_VALUE,Ct=0;const xt=$e.aabb.getCorners(),dn=[0,0,0];for(const tn of xt){a.aw(dn,tn,se),q||(S?dn[2]*=ee:dn[2]=Ke);const bn=a.bk(dn,this._camera.forward());bn<Mt&&(Mt=bn,Ct=Math.abs(dn[2]))}let an=(1<<De-$e.zoom)*pe*Gt;if(an*=Ue(Math.max(Ct,Ke),Mt),Mt<an)return!0;const Jt=$e.aabb.closestPoint(z);return Jt[0]===z[0]&&Jt[1]===z[1]};if(this.renderWorldCopies)for(let $e=1;$e<=3;$e++)Ae.push(be(-$e)),Ae.push(be($e));for(Ae.push(be(0));Ae.length>0;){const $e=Ae.pop(),ct=$e.x,at=$e.y;let dt=$e.fullyVisible;const Gt=()=>this.projection.name==="globe"&&($e.y===0||$e.y===(1<<$e.zoom)-1);if(!dt){let Mt=de?$e.aabb.intersects(Z):$e.aabb.intersectsFlat(Z);if(Mt===0&&Gt()){const Ct=new a.cp($e.zoom,ct,at);Mt=a.cq(this,F,Ct,!0).intersects(Z)}if(Mt===0)continue;dt=Mt===2}if($e.zoom===De||!rt($e)){const Mt=$e.zoom===De?Ye:$e.zoom;if(o.minzoom&&o.minzoom>Mt)continue;let Ct=0;if(!dt){let Jt=de?$e.aabb.intersectsPrecise(Z):$e.aabb.intersectsPreciseFlat(Z);if(Jt===0&&Gt()){const tn=new a.cp($e.zoom,ct,at);Jt=a.cq(this,F,tn,!0).intersectsPrecise(Z)}if(Jt===0)continue;if(o.calculateQuadrantVisibility)if(Z.containsPoint($e.aabb.center))Ct=15;else for(let tn=0;tn<4;tn++)$e.aabb.quadrant(tn).intersects(Z)!==0&&(Ct|=1<<tn)}const xt=z[0]-(.5+ct+($e.wrap<<$e.zoom))*(1<<d-$e.zoom),dn=z[1]-.5-at,an=$e.tileID?$e.tileID:new a.aU(Mt,$e.wrap,$e.zoom,ct,at);o.calculateQuadrantVisibility&&(an.visibleQuadrants=Ct),Ne.push({tileID:an,distanceSq:xt*xt+dn*dn});continue}for(let Mt=0;Mt<4;Mt++){const Ct=(ct<<1)+Mt%2,xt=(at<<1)+(Mt>>1),dn={aabb:T?$e.aabb.quadrant(Mt):a.cr(this,F,$e.zoom+1,Ct,xt,$e.wrap,$e.minZ,$e.maxZ,this.projection),zoom:$e.zoom+1,x:Ct,y:xt,wrap:$e.wrap,fullyVisible:dt,tileID:void 0,shouldSplit:void 0,minZ:$e.minZ,maxZ:$e.maxZ};S&&!q&&(dn.tileID=new a.aU($e.zoom+1===De?Ye:$e.zoom+1,$e.wrap,$e.zoom+1,Ct,xt),Tt(dn)),Ae.push(dn)}}if(this.fogCullDistSq){const $e=this.fogCullDistSq,ct=this.horizonLineFromTop();Ne=Ne.filter(at=>{const dt=[0,0,0,1],Gt=[a.ak,a.ak,0,1],Mt=this.calculateFogTileMatrix(at.tileID.toUnwrapped());a.aD(dt,dt,Mt),a.aD(Gt,Gt,Mt);const Ct=a.cs([],dt,Gt),xt=a.ct([],dt,Gt),dn=a.cO(Ct,xt);if(dn===0)return!0;let an=!1;const Jt=this._elevation;if(Jt&&dn>$e&&ct!==0){const tn=this.calculateProjMatrix(at.tileID.toUnwrapped());let bn;o.isTerrainDEM||(bn=Jt.getMinMaxForTile(at.tileID)),bn||(bn={min:Se,max:Ce});const kn=a.cu(this.rotation),Pn=[kn[0]*a.ak,kn[1]*a.ak,bn.max];a.ae(Pn,Pn,tn),an=(1-Pn[1])*this.height*.5<ct}return dn<$e||an})}return Ne.sort(($e,ct)=>$e.distanceSq-ct.distanceSq).map($e=>$e.tileID)}resize(o,d){this.width=o,this.height=d,this.pixelsToGLUnits=[2/o,-2/d],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(o){return Math.pow(2,o)}scaleZoom(o){return Math.log2(o)}project(o){const d=a.aB(o.lat,-a.cv,a.cv),_=this.projection.project(o.lng,d);return new a.P(_.x*this.worldSize,_.y*this.worldSize)}unproject(o){return this.projection.unproject(o.x/this.worldSize,o.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/a.bY(1,this.center.lat)/this.worldSize}setLocationAtPoint(o,d){let _,b;const S=this.centerPoint;if(this.projection.name==="globe"){const I=this.worldSize;_=(d.x-S.x)/I,b=(d.y-S.y)/I}else{const I=this.pointCoordinate(d),k=this.pointCoordinate(S);_=I.x-k.x,b=I.y-k.y}const T=this.locationCoordinate(o);this.setLocation(new a.ad(T.x-_,T.y-b))}setLocation(o){this.center=this.coordinateLocation(o),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(o,d){return this.projection.locationPoint(this,o,d)}locationPoint3D(o,d){return this.projection.locationPoint(this,o,d,!0)}pointLocation(o){return this.coordinateLocation(this.pointCoordinate(o))}pointLocation3D(o,d){return this.coordinateLocation(this.pointCoordinate3D(o,d))}locationCoordinate(o,d){const _=d?a.bY(d,o.lat):void 0,b=this.projection.project(o.lng,o.lat);return new a.ad(b.x,b.y,_)}coordinateLocation(o){return this.projection.unproject(o.x,o.y)}pointRayIntersection(o,d){const _=d??this._centerAltitude,b=[o.x,o.y,0,1],S=[o.x,o.y,1,1];a.aD(b,b,this.pixelMatrixInverse),a.aD(S,S,this.pixelMatrixInverse);const T=S[3];a.cw(b,b,1/b[3]),a.cw(S,S,1/T);const I=b[2],k=S[2];return{p0:b,p1:S,t:I===k?0:(_-I)/(k-I)}}screenPointToMercatorRay(o){const d=[o.x,o.y,0,1],_=[o.x,o.y,1,1];return a.aD(d,d,this.pixelMatrixInverse),a.aD(_,_,this.pixelMatrixInverse),a.cw(d,d,1/d[3]),a.cw(_,_,1/_[3]),d[2]=a.bY(d[2],this._center.lat)*this.worldSize,_[2]=a.bY(_[2],this._center.lat)*this.worldSize,a.cw(d,d,1/this.worldSize),a.cw(_,_,1/this.worldSize),new a.ay([d[0],d[1],d[2]],a.ax([],a.aw([],_,d)))}rayIntersectionCoordinate(o){const{p0:d,p1:_,t:b}=o,S=a.bY(d[2],this._center.lat),T=a.bY(_[2],this._center.lat);return new a.ad(a.aj(d[0],_[0],b)/this.worldSize,a.aj(d[1],_[1],b)/this.worldSize,a.aj(S,T,b))}pointCoordinate(o,d=this._centerAltitude){return this.projection.pointCoordinate(this,o.x,o.y,d)}pointCoordinate3D(o,d){if(!this.elevation)return this.pointCoordinate(o,d);let _=this.projection.pointCoordinate3D(this,o.x,o.y);if(_)return new a.ad(_[0],_[1],_[2]);let b=0,S=this.horizonLineFromTop();if(o.y>S)return this.pointCoordinate(o,d);const T=.02*S,I=o.clone();for(let k=0;k<10&&S-b>T;k++){I.y=a.aj(b,S,.66);const F=this.projection.pointCoordinate3D(this,I.x,I.y);F?(S=I.y,_=F):b=I.y}return _?new a.ad(_[0],_[1],_[2]):this.pointCoordinate(o)}isPointAboveHorizon(o){return this.projection.isPointAboveHorizon(this,o)}
25isPointOnSurface(o){if(o.y<0||o.y>this.height||o.x<0||o.x>this.width)return!1;if(this.elevation||this.zoom>=a.cx)return!this.isPointAboveHorizon(o);const d=this.pointCoordinate(o);return d.y>=0&&d.y<=1}_coordinatePoint(o,d){const _=d&&this.elevation?this.elevation.getAtPointOrZero(o,this._centerAltitude):this._centerAltitude,b=[o.x*this.worldSize,o.y*this.worldSize,_+o.toAltitude(),1];return a.aD(b,b,this.pixelMatrix),b[3]>0?new a.P(b[0]/b[3],b[1]/b[3]):new a.P(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:o,left:d}=this._edgeInsets,_=this.height-this._edgeInsets.bottom,b=this.width-this._edgeInsets.right,S=this.pointLocation3D(new a.P(d,o)),T=this.pointLocation3D(new a.P(b,o)),I=this.pointLocation3D(new a.P(b,_)),k=this.pointLocation3D(new a.P(d,_));let F=Math.min(S.lng,T.lng,I.lng,k.lng),z=Math.max(S.lng,T.lng,I.lng,k.lng),q=Math.min(S.lat,T.lat,I.lat,k.lat),j=Math.max(S.lat,T.lat,I.lat,k.lat);const Z=Math.pow(2,-this.zoom)/16*270,te=this.projection.name==="globe"?1:4,ee=(oe,se,de,pe,ce)=>{const Ce=(oe+de)/2,Se=(se+pe)/2,Re=new a.P(Ce,Se),{lng:ve,lat:be}=this.pointLocation3D(Re),Ae=Math.max(0,F-ve,q-be,ve-z,be-j);F=Math.min(F,ve),z=Math.max(z,ve),q=Math.min(q,be),j=Math.max(j,be),(ce<te||Ae>Z)&&(ee(oe,se,Ce,Se,ce+1),ee(Ce,Se,de,pe,ce+1))};if(ee(d,o,b,o,1),ee(b,o,b,_,1),ee(b,_,d,_,1),ee(d,_,d,o,1),this.projection.name==="globe"){const[oe,se]=a.cy(this);oe?(j=90,z=180,F=-180):se&&(q=-90,z=180,F=-180)}return new a.aI(new a.aX(F,q),new a.aX(z,j))}_getBoundsRectangular(o,d){const{top:_,left:b}=this._edgeInsets,S=this.height-this._edgeInsets.bottom,T=this.width-this._edgeInsets.right,I=new a.P(b,_),k=new a.P(T,_),F=new a.P(T,S),z=new a.P(b,S);let q=this.pointCoordinate(I,o),j=this.pointCoordinate(k,o);const Z=this.pointCoordinate(F,d),te=this.pointCoordinate(z,d),ee=(oe,se)=>(se.y-oe.y)/(se.x-oe.x);return q.y>1&&j.y>=0?q=new a.ad((1-te.y)/ee(te,q)+te.x,1):q.y<0&&j.y<=1&&(q=new a.ad(-te.y/ee(te,q)+te.x,0)),j.y>1&&q.y>=0?j=new a.ad((1-Z.y)/ee(Z,j)+Z.x,1):j.y<0&&q.y<=1&&(j=new a.ad(-Z.y/ee(Z,j)+Z.x,0)),new a.aI().extend(this.coordinateLocation(q)).extend(this.coordinateLocation(j)).extend(this.coordinateLocation(te)).extend(this.coordinateLocation(Z))}_getBoundsRectangularTerrain(){const o=this.elevation;if(!o.visibleDemTiles.length||o.isUsingMockSource())return this._getBoundsRectangular(0,0);const d=o.visibleDemTiles.reduce((_,b)=>{if(b.dem){const S=b.dem.tree;_.min=Math.min(_.min,S.minimums[0]),_.max=Math.max(_.max,S.maximums[0])}return _},{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(d.min*o.exaggeration(),d.max*o.exaggeration())}getBounds(){return this.projection.name==="mercator"||this.projection.name==="equirectangular"?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(o=!0){const d=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))-this.centerOffset.y,_=this.height/2-d*(1-this._horizonShift);return o?Math.max(0,_):_}getMaxBounds(){return this.maxBounds}setMaxBounds(o){this.maxBounds=o,this.minLat=-a.cv,this.maxLat=a.cv,this.minLng=-180,this.maxLng=180,o&&(this.minLat=o.getSouth(),this.maxLat=o.getNorth(),this.minLng=o.getWest(),this.maxLng=o.getEast(),this.maxLng<this.minLng&&(this.maxLng+=360)),this.worldMinX=a.aG(this.minLng)*this.tileSize,this.worldMaxX=a.aG(this.maxLng)*this.tileSize,this.worldMinY=a.aJ(this.maxLat)*this.tileSize,this.worldMaxY=a.aJ(this.minLat)*this.tileSize,this._constrain()}calculatePosMatrix(o,d){return this.projection.createTileMatrix(this,d,o)}calculateDistanceTileData(o){const d=o.key,_=this._distanceTileDataCache;if(_[d])return _[d];const b=o.canonical,S=1/this.height,T=this.cameraWorldSize,I=T/this.zoomScale(b.z),k=(b.x+Math.pow(2,b.z)*o.wrap)*I,F=b.y*I,z=this.point;z.x*=T/this.worldSize,z.y*=T/this.worldSize;const q=this.angle,j=Math.sin(-q),Z=-Math.cos(-q);return _[d]={bearing:[j,Z],center:[(z.x-k)*S,(z.y-F)*S],scale:I/a.ak*S},_[d]}calculateFogTileMatrix(o){const d=o.key,_=this._fogTileMatrixCache;if(_[d])return _[d];const b=this.projection.createTileMatrix(this,this.cameraWorldSizeForFog,o);return a.aC(b,this.worldToFogMatrix,b),_[d]=new Float32Array(b),_[d]}calculateProjMatrix(o,d=!1,_=!1){const b=o.key;let S;if(S=_?this._expandedProjMatrixCache:d?this._alignedProjMatrixCache:this._projMatrixCache,S[b])return S[b];const T=this.calculatePosMatrix(o,this.worldSize);let I;return I=this.projection.isReprojectedInTileSpace?this.mercatorMatrix:_?this.expandedFarZProjMatrix:d?this.alignedProjMatrix:this.projMatrix,a.aC(T,I,T),S[b]=new Float32Array(T),S[b]}calculatePixelsToTileUnitsMatrix(o){const d=o.tileID.key,_=this._pixelsToTileUnitsCache;if(_[d])return _[d];const b=a.cz(o,this);return _[d]=b,_[d]}customLayerMatrix(){return this.mercatorMatrix.slice()}globeToMercatorMatrix(){if(this.projection.name==="globe"){const o=1/this.worldSize,d=a.bT([],[o,o,o]);return a.aC(d,d,this.globeMatrix),d}}recenterOnTerrain(){if(!this._elevation||this.projection.name==="globe")return;const o=this._elevation;this._updateCameraState();const d=a.bY(1,this._center.lat)*this.worldSize,_=this._computeCameraPosition(d),b=this._camera.forward(),S=a.bY(1,this._center.lat);_[2]/=S,b[2]/=S,a.ax(b,b);const T=o.raycast(_,b,o.exaggeration());if(T){const I=a.bi([],_,b,T),k=new a.ad(I[0],I[1],a.bY(I[2],a.bZ(I[1]))),F=(k.z+a.af([k.x-_[0],k.y-_[1],k.z-_[2]*S]))*this._pixelsPerMercatorPixel;this._seaLevelZoom=this._zoomFromMercatorZ(F),this._centerAltitude=k.toAltitude(),this._center=this.coordinateLocation(k),this._updateZoomFromElevation(),this._constrain(),this._calcMatrices()}}_constrainCamera(o=!1){if(!this._elevation)return;const d=this._elevation,_=a.bY(1,this._center.lat)*this.worldSize,b
25=this._computeCameraPosition(_),S=d.getAtPointOrZero(new a.ad(...b)),T=this.pixelsPerMeter/this.worldSize*S,I=this._minimumHeightOverTerrain(),k=b[2]-T;if(k<=I)if(k<0||o){const F=this.locationCoordinate(this._center,this._centerAltitude),z=[b[0],b[1],F.z-b[2]],q=a.af(z);z[2]-=(I-k)/this._pixelsPerMercatorPixel;const j=a.af(z);if(j===0)return;a.bN(z,z,q/j*this._pixelsPerMercatorPixel),this._camera.position=[b[0],b[1],F.z*this._pixelsPerMercatorPixel-z[2]],this._updateStateFromCamera()}else this._isCameraConstrained=!0}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const o=this.projection.name==="globe"||this.mercatorFromTransition;if(this.projection.isReprojectedInTileSpace||o){const j=this.center;return j.lat=a.aB(j.lat,this.minLat,this.maxLat),(this.maxBounds||!this.renderWorldCopies&&!o)&&(j.lng=a.aB(j.lng,this.minLng,this.maxLng)),this.center=j,void(this._constraining=!1)}const d=this._unmodified,{x:_,y:b}=this.point;let S=0,T=_,I=b;const k=this.width/2,F=this.height/2,z=this.worldMinY*this.scale,q=this.worldMaxY*this.scale;if(b-F<z&&(I=z+F),b+F>q&&(I=q-F),q-z<this.height&&(S=Math.max(S,this.height/(q-z)),I=(q+z)/2),this.maxBounds||!this._renderWorldCopies||!this.projection.wrap){const j=this.worldMinX*this.scale,Z=this.worldMaxX*this.scale,te=this.worldSize/2-(j+Z)/2;T=(_+te+this.worldSize)%this.worldSize-te,T-k<j&&(T=j+k),T+k>Z&&(T=Z-k),Z-j<this.width&&(S=Math.max(S,this.width/(Z-j)),T=(Z+j)/2)}T===_&&I===b||this._allowWorldUnderZoom||(this.center=this.unproject(new a.P(T,I))),S&&!this._allowWorldUnderZoom&&(this.zoom+=this.scaleZoom(S)),this._constrainCamera(),this._unmodified=d,this._constraining=!1}_minZoomForBounds(){let o=Math.max(0,this.scaleZoom(Math.max(0,this.height)/(this.worldMaxY-this.worldMinY)));return this.maxBounds&&(o=Math.max(o,this.scaleZoom(this.width/(this.worldMaxX-this.worldMinX)))),o}_maxCameraBoundsDistance(){return this._mercatorZfromZoom(this._minZoomForBounds())}_calcMatrices(){if(!this.height)return;const o=this.centerOffset,d=this.projection.name==="globe",_=this.pixelsPerMeter;this.projection.name==="globe"&&(this._mercatorScaleRatio=a.bY(1,this.center.lat)/a.bY(1,a.cR));const b=a.cA(this.projection,this.zoom,this.width,this.height,1024);this._pixelsPerMercatorPixel=this.projection.pixelSpaceConversion(this.center.lat,this.worldSize,b),this.cameraToCenterDistance=.5/Math.tan(.5*this._fov)*this.height*this._pixelsPerMercatorPixel,this._updateCameraState(),this._farZ=this.projection.farthestPixelDistance(this),this._nearZ=this.height/50;const S=this.projection.zAxisUnit==="meters"?_:1,T=this._camera.getWorldToCamera(this.worldSize,S);let I;const k=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,this._farZ);if(k[8]=2*-o.x/this.width,k[9]=2*o.y/this.height,this.isOrthographic){let Ce=.5*this.height/Math.tan(this._fov/2)*1*Math.tan(.5*this._fov),Se=Ce*this.aspect,Re=-Se,ve=-Ce;Se-=o.x,Re-=o.x,Ce+=o.y,ve+=o.y,I=this._camera.getCameraToClipOrthographic(Re,Se,ve,Ce,this._nearZ+this._nearClipOffset,this._farZ),((be,Ae,Ne,De)=>{for(let Ye=0;Ye<16;Ye++)be[Ye]=a.aj(Ae[Ye],Ne[Ye],De)})(I,I,k,a.cP(this.pitch>=wa?1:this.pitch/wa))}else I=k;const F=a.cB([],k,T),z=a.cB([],I,T);if(this.projection.isReprojectedInTileSpace){const Ce=this.locationCoordinate(this.center);a.bA(this._mat4Scratch);const Se=this._mat4Scratch;a.bB(Se,Se,[Ce.x*this.worldSize,Ce.y*this.worldSize,0]),a.aC(Se,Se,a.cC(this)),a.bB(Se,Se,[-Ce.x*this.worldSize,-Ce.y*this.worldSize,0]),a.aC(z,z,Se),a.aC(F,F,Se),this.inverseAdjustmentMatrix=a.cD(this)}else this.inverseAdjustmentMatrix=[1,0,0,1];if(a.cE(this.mercatorMatrix,z,[this.worldSize,this.worldSize,this.worldSize/S,1]),this.projMatrix=z,a.ba(this.invProjMatrix,this.projMatrix),d){const Ce=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,1/0);Ce[8]=2*-o.x/this.width,Ce[9]=2*o.y/this.height,a.cB(this._expandedFarZProjMatrixBuf,Ce,T),this.expandedFarZProjMatrix=this._expandedFarZProjMatrixBuf}else this.expandedFarZProjMatrix=this.projMatrix;a.ba(this._mat4Scratch,I),this.frustumCorners=a.cF.fromInvProjectionMatrix(this._mat4Scratch,this.horizonLineFromTop(),this.height),this.cameraFrustum=a.cn.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,0,!d),a.bT(this.skyboxMatrix,[1,-1,1]),a.cG(this.skyboxMatrix,this.skyboxMatrix,this._pitch),a.bc(this.skyboxMatrix,this.skyboxMatrix,this.angle),a.bW(this.starsProjMatrix,this._fov,this.width/this.height,this._nearZ,this._farZ);const q=(Math.PI/2-this._pitch)*(this.height/this._fov)*this._horizonShift;a.cH(this._mat4Scratch,this.starsProjMatrix),this._mat4Scratch[8]=2*-o.x/this.width,this._mat4Scratch[9]=2*(o.y+q)/this.height,a.aC(this.skyboxMatrix,this._mat4Scratch,this.skyboxMatrix);const j=this.point,Z=j.x,te=j.y,ee=this.width%2/2,oe=this.height%2/2,se=Math.cos(this.angle),de=Math.sin(this.angle),pe=Z-Math.round(Z)+se*ee+de*oe,ce=te-Math.round(te)+se*oe+de*ee;if(a.cH(this.alignedProjMatrix,z),a.bB(this.alignedProjMatrix,this.alignedProjMatrix,[pe>.5?pe-1:pe,ce>
25.5?ce-1:ce,0]),a.bT(this.labelPlaneMatrix,[this.width/2,-this.height/2,1]),a.bB(this.labelPlaneMatrix,this.labelPlaneMatrix,[1,-1,0]),a.bT(this.glCoordMatrix,[1,-1,1]),a.bB(this.glCoordMatrix,this.glCoordMatrix,[-1,-1,0]),a.cE(this.glCoordMatrix,this.glCoordMatrix,[2/this.width,2/this.height,1]),a.aC(this.pixelMatrix,this.labelPlaneMatrix,F),this._calcFogMatrices(),this._distanceTileDataCache={},!a.ba(this.pixelMatrixInverse,this.pixelMatrix))throw new Error("failed to invert matrix");if(this.projection.name==="globe"||this.mercatorFromTransition){this.globeMatrix=a.cI(this);const Ce=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=a.ae(Ce,Ce,T),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=this.pixelMatrixInverse;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={},this._expandedProjMatrixCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const o=this.cameraWorldSizeForFog,d=this.cameraPixelsPerMeter,_=this._camera.position,b=1/this.height/this._pixelsPerMercatorPixel,S=[o,o,d];a.bN(S,S,b),a.bN(_,_,-1),a.cJ(_,_,S),a.cK(this.mercatorFogMatrix,_),a.cE(this.mercatorFogMatrix,this.mercatorFogMatrix,S),this.worldToFogMatrix=this._camera.getWorldToCameraPosition(o,d,b)}_computeCameraPosition(o){const d=(o=o||this.pixelsPerMeter)/this.pixelsPerMeter,_=this._camera.forward(),b=this.point,S=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*d-o/this.worldSize*this._centerAltitude;return[b.x/this.worldSize-_[0]*S,b.y/this.worldSize-_[1]*S,o/this.worldSize*this._centerAltitude-_[2]*S]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(o){const d=this._maxCameraBoundsDistance()*Math.cos(this._pitch),_=this._camera.position[2],b=o[2];let S=1;this.projection.wrap&&(this.center=this.center.wrap()),b>0&&(S=Math.min((d-_)/b,1)),this._camera.position=a.bi([],this._camera.position,o,S),this._updateStateFromCamera()}_updateStateFromCamera(){const o=this._camera.position,d=this._camera.forward(),{pitch:_,bearing:b}=this._camera.getPitchBearing(),S=a.bY(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,T=this._mercatorZfromZoom(this._maxZoom)*Math.cos(a.am(this._maxPitch)),I=Math.max((o[2]-S)/Math.cos(_),T),k=this._zoomFromMercatorZ(I);a.bi(o,o,d,I),this._pitch=a.aB(_,a.am(this.minPitch),a.am(this.maxPitch)),this.angle=a.bv(b,-Math.PI,Math.PI),this._setZoom(a.aB(k,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new a.ad(o[0],o[1],o[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(o){return Math.pow(2,o)*this.tileSize}_mercatorZfromZoom(o){return this.cameraToCenterDistance/this._worldSizeFromZoom(o)}_minimumHeightOverTerrain(){const o=Math.min(this._seaLevelZoom!=null?this._seaLevelZoom:this._zoom,this._maxZoom)+4;return this._mercatorZfromZoom(o)}_zoomFromMercatorZ(o){return this.scaleZoom(this.cameraToCenterDistance/(Math.max(0,o)*this.tileSize))}zoomFromMercatorZAdjusted(o){let d=0,_=a.cx,b=0,S=1/0;for(;_-d>1e-6&&_>d;){const T=d+.5*(_-d),I=this.tileSize*Math.pow(2,T),k=this.getCameraToCenterDistance(this.projection,T,I),F=this.scaleZoom(k/(Math.max(0,o)*this.tileSize)),z=Math.abs(T-F);z<S&&(S=z,b=T),T<F?d=T:_=T}return b}_terrainEnabled(){return!(!this._elevation||!this.projection.supportsTerrain&&(a.w("Terrain is not yet supported with alternate projections. Use mercator or globe to enable terrain."),1))}anyCornerOffEdge(o,d){const _=Math.min(o.x,d.x),b=Math.max(o.x,d.x),S=Math.min(o.y,d.y),T=Math.max(o.y,d.y);if(S<this.horizonLineFromTop(!1))return!0;if(this.projection.name!=="mercator")return!1;const I=[new a.P(_,S),new a.P(b,T),new a.P(_,T),new a.P(b,S)],k=this.renderWorldCopies?-3:0,F=this.renderWorldCopies?4:1;for(const z of I){const q=this.pointRayIntersection(z);if(q.t<0)return!0;const j=this.rayIntersectionCoordinate(q);if(j.x<k||j.y<0||j.x>F||j.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+a.cL(this.fovAboveCenter)>88||this.anyCornerOffEdge(new a.P(0,0),new a.P(this.width,this.height))}zoomDeltaToMovement(o,d){const _=a.af(a.aw([],this._camera.position,o)),b=this._zoomFromMercatorZ(_)+d;return _-this._mercatorZfromZoom(b)}getCameraPoint(){if(this.projection.name==="globe"){const o=(function([d,_,b],S){const T=[d,_,b,1];a.aD(T,T,S);const I=T[3]=Math.max(T[3],1e-6);return T[0]/=I,T[1]/=I,T[2]/=I,T})([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new a.P(o[0],o[1])}{const o=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new a.P(0,o))}}getCameraToCenterDistance(o,d=this.zoom,_=this.worldSize){const b=a.cA(o,d,this.width,this.height,1024),S=o.pixelSpaceConversion(this.center.lat,_,b);let T=.5/Math.tan(.5*this._fov)*this.height*S;return this.isOrthographic&&(T=a.aj(1,T,a.cP(this.pitch>=wa?1:this.pitch/wa))),T}getWorldToCameraMatrix(){const o=this._camera.getWorldToCamera(this.worldSize,this.projection.zAxisUnit==="meters"?this.pixelsPerMeter:1);return this.projection.name==="globe"&&a.aC(o,o,this.globeMatrix),o}getFrustum(o){return a.cn.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,o,this.projection.zAxisUnit==="meters")}}const Sa=(p,o)=>
25{if(o>0&&p.terrain&&a.w("Cutoff is currently disabled on terrain"),o<=0||p.terrain)return{shouldRenderCutoff:!1,uniformValues:{u_cutoff_params:[0,0,0,1]}};const d=p.transform,_=d.pitch,b=d.isLODDisabled(!1)?60:30;if(_<b-15)return{shouldRenderCutoff:!1,uniformValues:{u_cutoff_params:[0,0,0,1]}};const S=d._farZ-d._nearZ,T=o*d.height*1.3,I=Math.pow(2,.85*Math.max(d._zoom-p.minCutoffZoom,0)),k=1.4*d.cameraToCenterDistance*I,F=a.ag(b-15,b,_),z=(1-(q=F))*(d._farZ+T)+q*k;var q;const j=Math.min(T,z-d._nearZ);return{shouldRenderCutoff:F>0,uniformValues:{u_cutoff_params:[d._nearZ,d._farZ,(z-d._nearZ)/S,(z-j-d._nearZ)/S]}}},A1=[];function I1(p){return A1[p]=A1[p]||new Float64Array(16)}class dg{constructor(o,d){this.aabb=o,this.lastCascade=d}}class p2{add(o,d){const _=this.receivers[o.key];_!==void 0?(_.aabb.min[0]=Math.min(_.aabb.min[0],d.min[0]),_.aabb.min[1]=Math.min(_.aabb.min[1],d.min[1]),_.aabb.min[2]=Math.min(_.aabb.min[2],d.min[2]),_.aabb.max[0]=Math.max(_.aabb.max[0],d.max[0]),_.aabb.max[1]=Math.max(_.aabb.max[1],d.max[1]),_.aabb.max[2]=Math.max(_.aabb.max[2],d.max[2])):this.receivers[o.key]=new dg(d,null)}clear(){this.receivers={}}get(o){return this.receivers[o.key]}computeRequiredCascades(o,d,_){const b=a.cY.fromPoints(o.points);let S=0;for(const T in this.receivers){const I=this.receivers[T];if(!I||!b.intersectsAabb(I.aabb))continue;I.aabb.min=b.closestPoint(I.aabb.min),I.aabb.max=b.closestPoint(I.aabb.max);const k=I.aabb.getCorners();for(let F=0;F<_.length;F++){let z=!0;for(const q of k){const j=[q[0]*d,q[1]*d,q[2]];if(a.ae(j,j,_[F].matrix),j[0]<-1||j[0]>1||j[1]<-1||j[1]>1){z=!1;break}}if(I.lastCascade=F,S=Math.max(S,F),z)break}}return S+1}}class P1{constructor(o){this.painter=o,this._enabled=!1,this._drawShadowAfterLayer=-1,this._numCascadesToRender=0,this._cascades=[],this._groundShadowTiles=[],this._receivers=new p2,this._depthMode=new rn(o.context.gl.LEQUAL,rn.ReadWrite,[0,1]),this._uniformValues={u_light_matrix_0:new Float32Array(16),u_light_matrix_1:new Float32Array(16),u_shadow_intensity:0,u_fade_range:[0,0],u_shadow_normal_offset:[1,1,1],u_shadow_texel_size:1,u_shadow_map_resolution:1,u_shadow_direction:[0,0,1],u_shadow_bias:[36e-5,.0012,.012],u_shadowmap_0:0,u_shadowmap_1:0},this._forceDisable=!1,this._devtoolsFolder=null,this.useNormalOffset=!1,this._shadowParameters={cascadeCount:2,normalOffset:3,shadowMapResolution:2048}}destroy(){for(const o of this._cascades)o.texture.destroy(),o.framebuffer.destroy();this._cascades=[]}updateShadowParameters(o,d){const _=this.painter;if(this._enabled=!1,this._drawShadowAfterLayer=-1,this._receivers.clear(),!d||!d.properties)return;const b=d.properties.get("shadow-intensity"),S=d.properties.get("shadow-draw-before-layer");if(!d.shadowsEnabled()||b<=0)return;let T=-1,I=0;for(const se of _.style.order){const de=_.style._mergedLayers[se];de.hasShadowPass()&&!de.isHidden(o.zoom)&&(T=I),!S||S!==se&&S!==de.slot||(this._drawShadowAfterLayer=I>0?I-1:0),I+=1}if(this._enabled=T>=0,!this.enabled)return;this._drawShadowAfterLayer<0&&(this._drawShadowAfterLayer=T);const k=_.context,F=this._shadowParameters.shadowMapResolution,z=this._shadowParameters.shadowMapResolution;if(this._cascades.length===0||this._shadowParameters.shadowMapResolution!==this._cascades[0].texture.size[0]){this._cascades=[];for(let se=0;se<this._shadowParameters.cascadeCount;++se){const de=k.gl,pe=k.createFramebuffer(F,z,0,"texture"),ce=new a.T(k,{width:F,height:z,data:null},de.DEPTH_COMPONENT16);pe.depthAttachment.set(ce.texture),this._cascades.push({framebuffer:pe,texture:ce,matrix:[],far:0,boundingSphereRadius:0,frustum:new a.cn,scale:0})}}this.shadowDirection=hg(d);let q=0;if(o.elevation){const se=o.elevation,de=[1e4,-1e4];se.visibleDemTiles.filter(pe=>pe.dem).forEach(pe=>{const ce=pe.dem.tree;de[0]=Math.min(de[0],ce.minimums[0]),de[1]=Math.max(de[1],ce.maximums[0])}),de[0]!==1e4&&(q=(de[1]-de[0])*se.exaggeration())}const j=1.5*o.cameraToCenterDistance,Z=3*j,te=new Float64Array(16);for(let se=0;se<this._cascades.length;++se){const de=this._cascades[se];let pe=o.height/50,ce=1;this._shadowParameters.cascadeCount===1?ce=Z:se===0?ce=j:(pe=j,ce=Z);const[Ce,Se]=m2(o,this.shadowDirection,pe,ce,this._shadowParameters.shadowMapResolution,q);de.scale=o.scale,de.matrix=Ce,de.boundingSphereRadius=Se,a.ba(te,de.matrix),de.frustum=a.cn.fromInvProjectionMatrix(te,1,0,!0),de.far=ce}const ee=this._cascades.length-1;this._uniformValues.u_fade_range=[.75*this._cascades[ee].far,this._cascades[ee].far],this._uniformValues.u_shadow_intensity=b,this._uniformValues.u_shadow_direction=[this.shadowDirection[0],this.shadowDirection[1],this.shadowDirection[2]],this._uniformValues.u_shadow_texel_size=1/this._shadowParameters.shadowMapResolution,this._uniformValues.u_shadow_map_resolution=this._shadowParameters.shadowMapResolution,this._uniformValues.u_shadowmap_0=11,this._uniformValues.u_shadowmap_1=12,this._groundShadowTiles=_.transform.coveringTiles({tileSize:512,renderWorldCopies:!0});const oe=_.transform.elevation;for(const se of this._groundShadowTiles){let de={min:0,max:0};if(oe){const pe=oe.getMinMaxForTile(se);pe&&(de=pe)}this.addShadowReceiver(se.toUnwrapped(),de.min,de.max)}}get enabled(){return this._enabled&&!this._forceDisable}set enabled(o){this._enabled=o}drawShadowPass(o,d){if(!this.enabled)return;const _=this.painter,b=_.context;this._numCascadesToRender=this._receivers.computeRequiredCascades(_.transform.getFrustum(0),_.transform.worldSize,this._cascades),b.viewport.set([0,0,this._shadowParameters.shadowMapResolution,this._shadowParameters.shadowMapResolution]);for(let S=0;S<this._numCascadesToRender;++S){_.currentShadowCascade=S,b.bindFramebuffer.set(this._cascades[S].framebuffer.framebuffer),b.clear({color:a.C.white,depth:1});for(const T of o.order){const I=o._mergedLayers[T];if(!I.hasShadowPass()||I.isHidden(_.transform.zoom))continue;
25const k=o.getLayerSourceCache(I),F=k?d[k.id]:void 0;(I.type==="model"||F&&F.length)&&_.renderLayer(_,k,I,F)}}_.currentShadowCascade=0}drawGroundShadows(){if(!this.enabled)return;const o=this.painter,d=o.style,_=o.context,b=_.gl,S=d.directionalLight,T=d.ambientLight;if(!S||!T)return;const I=[],k=Sa(o,o.longestCutoffRange);k.shouldRenderCutoff&&I.push("RENDER_CUTOFF"),I.push("RENDER_SHADOWS"),this.useNormalOffset&&I.push("NORMAL_OFFSET");const F=xd(d,S,T),z=new rn(b.LEQUAL,rn.ReadOnly,o.depthRangeFor3D),q=new Tn({func:b.EQUAL,mask:255},0,255,b.KEEP,b.KEEP,b.KEEP);for(const j of this._groundShadowTiles){const Z=j.toUnwrapped(),te=o.isTileAffectedByFog(j),ee=o.getOrCreateProgram("groundShadow",{defines:I,overrideFog:te});this.setupShadows(Z,ee),o.uploadCommonUniforms(_,ee,Z,null,k);const oe=Ic(o.transform.calculateProjMatrix(Z),F);ee.draw(o,b.TRIANGLES,z,q,In.multiply,pn.disabled,oe,"ground_shadow",o.tileExtentBuffer,o.quadTriangleIndexBuffer,o.tileExtentSegments,null,o.transform.zoom,null,null)}}getShadowPassDepthMode(){return this._depthMode}getGroundShadowLayerIndex(){return this._drawShadowAfterLayer}calculateShadowPassMatrixFromTile(o){const d=this.painter.transform,_=d.calculatePosMatrix(o,d.worldSize);return a.aC(_,this._cascades[this.painter.currentShadowCascade].matrix,_),Float32Array.from(_)}calculateShadowPassMatrixFromMatrix(o){const d=a.bb(o);return a.aC(d,this._cascades[this.painter.currentShadowCascade].matrix,o),d}setupShadows(o,d,_){if(!this.enabled)return;const b=this.painter.transform,S=this.painter.context,T=S.gl,I=this._uniformValues,k=b.calculatePosMatrix(o,b.worldSize);for(let F=0;F<this._cascades.length;F++){const z=I1(F);a.aC(z,this._cascades[F].matrix,k),I[F===0?"u_light_matrix_0":"u_light_matrix_1"]=z,S.activeTexture.set(T.TEXTURE0+11+F),this._cascades[F].texture.bindExtraParam(T.LINEAR,T.LINEAR,T.CLAMP_TO_EDGE,T.CLAMP_TO_EDGE,T.GREATER)}if(this.useNormalOffset=!!_,this.useNormalOffset){const F=a.cW(o.canonical),z=2/b.tileSize*a.ak/this._shadowParameters.shadowMapResolution,q=z*this._cascades[0].boundingSphereRadius,j=z*this._cascades.at(-1).boundingSphereRadius,Z=(_==="vector-tile"?1:3)*(function(te){const ee=a.aB((te-22)/-22,0,1);return .125*(1-ee)+4*ee})(b.zoom);I.u_shadow_normal_offset=[F,q*Z,j*Z],I.u_shadow_bias=[1e-4,.0012,.012]}else I.u_shadow_bias=[36e-5,.0012,.012];d.setShadowUniformValues(S,I)}setupShadowsFromMatrix(o,d,_=!1){if(!this.enabled)return;const b=this.painter.context,S=b.gl,T=this._uniformValues;for(let I=0;I<this._shadowParameters.cascadeCount;I++){const k=I1(I);a.aC(k,this._cascades[I].matrix,o),T[I===0?"u_light_matrix_0":"u_light_matrix_1"]=k,b.activeTexture.set(S.TEXTURE0+11+I),this._cascades[I].texture.bindExtraParam(S.LINEAR,S.LINEAR,S.CLAMP_TO_EDGE,S.CLAMP_TO_EDGE,S.GREATER)}if(this.useNormalOffset=_,_){const I=this._shadowParameters.normalOffset;T.u_shadow_normal_offset=[1,I,I],T.u_shadow_bias=[6e-5,.0012,.012]}else T.u_shadow_bias=[36e-5,.0012,.012];d.setShadowUniformValues(b,T)}getShadowUniformValues(){return this._uniformValues}getCurrentCascadeFrustum(){return this._cascades[this.painter.currentShadowCascade].frustum}computeSimplifiedTileShadowVolume(o,d,_,b){if(b[2]>=0)return{};const S=(function(k,F,z){const q=z/(1<<k.canonical.z);return new a.cY([k.canonical.x*q+k.wrap*z,k.canonical.y*q+k.wrap*z,0],[(k.canonical.x+1)*q+k.wrap*z,(k.canonical.y+1)*q+k.wrap*z,F])})(o,d,_).getCorners(),T=d/-b[2];b[0]<0?(a.cX(S[0],S[0],[b[0]*T,0,0]),a.cX(S[3],S[3],[b[0]*T,0,0])):b[0]>0&&(a.cX(S[1],S[1],[b[0]*T,0,0]),a.cX(S[2],S[2],[b[0]*T,0,0])),b[1]<0?(a.cX(S[0],S[0],[0,b[1]*T,0]),a.cX(S[1],S[1],[0,b[1]*T,0])):b[1]>0&&(a.cX(S[2],S[2],[0,b[1]*T,0]),a.cX(S[3],S[3],[0,b[1]*T,0]));const I={};return I.vertices=S,I.planes=[Ap(S[1],S[0],S[4]),Ap(S[2],S[1],S[5]),Ap(S[3],S[2],S[6]),Ap(S[0],S[3],S[7])],I}addShadowReceiver(o,d,_){this._receivers.add(o,a.cY.fromTileIdAndHeight(o,d,_))}getMaxCascadeForTile(o){const d=this._receivers.get(o);return d&&d.lastCascade?d.lastCascade:0}}function Ap(p,o,d){const _=a.aw([],d,o),b=a.aw([],p,o),S=a.bj([],_,b),T=a.af(S);return T===0?[0,0,1,0]:(a.bN(S,S,1/T),[S[0],S[1],S[2],-a.bk(S,o)])}function hg(p){const o=p.properties.get("direction"),d=a.cT(o.x,o.y,o.z);
25d[2]=a.aB(d[2],0,75);const _=a.cV([d[0],d[1],d[2]]);return a.cU(_.x,_.y,_.z)}function xd(p,o,d){const _=o.properties.get("color-use-theme")==="none",b=o.properties.get("color"),S=o.properties.get("intensity"),T=o.properties.get("direction"),I=[T.x,T.y,T.z],k=d.properties.get("color-use-theme")==="none",F=d.properties.get("color"),z=d.properties.get("intensity"),q=Math.max(a.bk([0,0,1],I),0),j=[0,0,0];a.bN(j,F.toPremultipliedRenderColor(k?null:p.getLut(o.scope)).toArray01Linear().slice(0,3),z);const Z=[0,0,0];return a.bN(Z,b.toPremultipliedRenderColor(_?null:p.getLut(d.scope)).toArray01Linear().slice(0,3),q*S),a.c_([j[0]>0?j[0]/(j[0]+Z[0]):0,j[1]>0?j[1]/(j[1]+Z[1]):0,j[2]>0?j[2]/(j[2]+Z[2]):0])}function m2(p,o,d,_,b,S){const T=p.zoom,I=p.scale,k=p.worldSize,F=1/k,z=p.aspect,q=Math.sqrt(1+z*z)*Math.tan(.5*p.fovX),j=q*q,Z=_-d,te=_+d;let ee,oe;j>Z/te?(ee=_,oe=_*q):(ee=.5*te*(1+j),oe=.5*Math.sqrt(Z*Z+2*(_*_+d*d)*j+te*te*j*j));const se=p.projection.pixelsPerMeter(p.center.lat,k),de=p._camera.getCameraToWorldMercator(),pe=[0,0,-ee*F];a.ae(pe,pe,de);let ce=oe*F;const Ce=function(dt){return dt[0]/=I,dt[1]/=I,dt[2]=a.bY(dt[2],p._center.lat),dt},Se=p._edgeInsets;if(!(Se.left===0&&Se.top===0&&Se.right===0&&Se.bottom===0||Se.left===Se.right&&Se.top===Se.bottom)){const dt=p._camera.getWorldToCamera(p.worldSize,p.projection.zAxisUnit==="meters"?se:1),Gt=p._camera.getCameraToClipPerspective(p._fov,p.width/p.height,d,_);Gt[8]=2*-p.centerOffset.x/p.width,Gt[9]=2*p.centerOffset.y/p.height;const Mt=new Float64Array(16);a.cB(Mt,Gt,dt);const Ct=new Float64Array(16);a.ba(Ct,Mt);const xt=a.cn.fromInvProjectionMatrix(Ct,k,T,!0);for(const dn of xt.points){const an=Ce(dn);ce=Math.max(ce,a.bO(a.cZ([],pe,an)))}}ce*=b/(b-1);const Re=Math.acos(o[2]),ve=Math.atan2(-o[0],-o[1]),be=new bd;be.position=pe,be.setPitchBearing(Re,ve);const Ae=be.getWorldToCamera(k,se),Ne=ce*k,De=Math.min(p._mercatorZfromZoom(17)*k*-2,-2*Ne),Ye=be.getCameraToClipOrthographic(-Ne,Ne,-Ne,Ne,De,(Ne+S*se)/o[2]),Ke=new Float64Array(16);a.aC(Ke,Ye,Ae);const Tt=a.cU(Math.floor(1e6*pe[0])/1e6*k,Math.floor(1e6*pe[1])/1e6*k,0),Ue=.5*b,rt=[0,0,0];a.ae(rt,Tt,Ke),a.bN(rt,rt,Ue);const $e=[Math.floor(rt[0]),Math.floor(rt[1]),Math.floor(rt[2])],ct=[0,0,0];a.aw(ct,rt,$e),a.bN(ct,ct,-1/Ue);const at=new Float64Array(16);return a.bA(at),a.bB(at,at,ct),a.aC(Ke,at,Ke),[Ke,Ne]}class g2 extends a.E{constructor(o){super(),this.requestManager=o,this.models={"":{}},this.modelUris={"":{}},this.modelByURL={},this.numModelsLoading={}}loadModel(o,d){return a.c$(this.requestManager.transformRequest(d,a.R.Model).url).then(_=>{const b=a.d0(_),S=new a.d1(o,d,void 0,void 0,b);return S.computeBoundsAndApplyParent(),S}).catch(_=>{if(_&&_.status===404)return null;this.fire(new a.y(new Error(`Could not load model ${o} from ${d}: ${_.message}`)))})}load(o,d,_={forceReload:!1}){this.models[d]||(this.models[d]={});const b=Object.keys(o),S=[],T=[];for(const I of b){const k=o[I];this.hasURLBeenRequested(k)&&!_.forceReload||(this.modelByURL[k]={modelId:I,scope:d},S.push(this.loadModel(I,k)),T.push(I)),this.models[d][I]||(this.models[d][I]={model:null,numReferences:1})}this.numModelsLoading[d]=(this.numModelsLoading[d]||0)+T.length,Promise.allSettled(S).then(I=>{for(let k=0;k<I.length;k++){const{status:F}=I[k];if(F==="rejected")continue;const{value:z}=I[k];this.models[d][T[k]]||(this.models[d][T[k]]={model:null,numReferences:1}),this.models[d][T[k]].model=z}this.numModelsLoading[d]-=T.length,this.fire(new a.z("data",{dataType:"style"}))}).catch(I=>{this.fire(new a.y(new Error(`Could not load models: ${I.message}`)))})}isLoaded(){for(const o in this.numModelsLoading)if(this.numModelsLoading[o]>0)return!1;return!0}hasModel(o,d,_={exactIdMatch:!1}){return!!(_.exactIdMatch?this.getModel(o,d):this.getModelByURL(this.modelUris[d][o]))}getModel(o,d){return this.models[d]||(this.models[d]={}),this.models[d][o]?this.models[d][o].model:void 0}
25getModelByURL(o){if(!o)return null;const d=this.modelByURL[o];return d?this.models[d.scope][d.modelId].model:null}hasModelBeenAdded(o,d){return this.models[d]&&this.models[d][o]!==void 0}getModelURIs(o){return this.modelUris[o]||{}}addModel(o,d,_){this.models[_]||(this.models[_]={}),this.modelUris[_]||(this.modelUris[_]={});const b=this.requestManager.normalizeModelURL(d);if((this.hasModel(o,_,{exactIdMatch:!0})||this.hasModelBeenAdded(o,_))&&this.modelUris[_][o]===b)this.models[_][o].numReferences++;else if(this.hasURLBeenRequested(b)){const{scope:S,modelId:T}=this.modelByURL[b];this.models[S][T].numReferences++}else this.modelUris[_][o]=b,this.load({[o]:this.modelUris[_][o]},_)}addModelURLs(o,d){this.models[d]||(this.models[d]={}),this.modelUris[d]||(this.modelUris[d]={});const _=this.modelUris[d];for(const b in o)_[b]=this.requestManager.normalizeModelURL(o[b])}reloadModels(o){this.load(this.modelUris[o],o,{forceReload:!0})}addModelsFromBucket(o,d){this.models[d]||(this.models[d]={}),this.modelUris[d]||(this.modelUris[d]={});const _={};for(const b of o)this.hasModel(b,d,{exactIdMatch:!0})||this.hasURLBeenRequested(b)?this.models[d][b].numReferences++:this.modelUris[d][b]&&!this.hasURLBeenRequested(b)?_[b]=this.modelUris[d][b]:!this.hasURLBeenRequested(b)&&gu(b,!1)&&(this.modelUris[d][b]=this.requestManager.normalizeModelURL(b),_[b]=this.modelUris[d][b]);this.load(_,d)}hasURLBeenRequested(o){return this.modelByURL[o]!==void 0}removeModel(o,d,_=!1,b=!1){if(this.models[d]&&this.models[d][o]&&(this.models[d][o].numReferences--,this.models[d][o].numReferences===0||b)){const S=this.modelUris[d][o];_||delete this.modelUris[d][o],delete this.modelByURL[S];const T=this.models[d][o].model;if(!T)return;delete this.models[d][o],T.destroy()}}destroy(){for(const o of Object.keys(this.models))for(const d of Object.keys(this.models[o])){const _=this.models[o][d].model;delete this.models[o][d],_&&_.destroy()}this.models={"":{}},this.modelUris={"":{}},this.modelByURL={},this.numModelsLoading={}}listModels(o){return this.models[o]||(this.models[o]={}),Object.keys(this.models[o])}upload(o,d){this.models[d]||(this.models[d]={});for(const _ in this.models[d])this.models[d][_].model&&this.models[d][_].model.upload(o.context)}}const _2=["RENDER_SHADOWS","NORMAL_OFFSET"],R1=new Set(["symbol","circle"]),Yy=class CR{constructor(){this._queue=[],this._needsBuild=!0,this._idleHandle=null}needsBuild(){return this._needsBuild}buildQueue(o,d,_){this._idleHandle!=null&&typeof cancelIdleCallback<"u"&&cancelIdleCallback(this._idleHandle),this._idleHandle=null,this._queue=[],this._needsBuild=!1;const b=_.stylesheet,S=!!_.fog,T=!!(_.getTerrain()||b&&b.terrain),I=!(!_.projection||_.projection.name!=="globe"),k=T||I,F=!(!_.directionalLight||!_.directionalLight.shadowsEnabled()),z=_.map&&_.map.painter,q=!z||!z.context.extParallelShaderCompile,j=!!z&&z.emissiveMode==="mrt-fallback",Z=(te,ee=[],oe={})=>{this._queue.push({programId:te,params:Object.assign({},oe.params,{defines:ee,overrideFog:!!oe.fog,overrideTerrain:!!oe.terrain,overrideGlobe:!!oe.globe,overrideRtt:!!oe.rtt,precompiled:!0})})};for(const te of o){if(te.visibility==="none")continue;const ee=te.getProgramIds();if(ee)for(const oe of ee){if(R1.has(oe))continue;const se=te.getDefaultProgramParams(oe,d.zoom,_._styleColorTheme.lut);if(!se)continue;const de=z?z.getShaderSource(oe):null,pe=k&&(!de||de.usedDefines.has("RENDER_TO_TEXTURE")),ce=j&&pe?(se.defines||[]).concat("USE_MRT1"):se.defines;if(q){Z(oe,se.defines,{params:se}),pe&&Z(oe,ce,{params:se,rtt:!0});continue}const Ce=S&&(!de||de.usedDefines.has("FOG")),Se=T&&!te.isDraped()&&(!de||de.usedDefines.has("TERRAIN")),Re=I&&(!de||de.usedDefines.has("GLOBE")),ve=F&&te.hasElevation()&&(!de||de.usedDefines.has("RENDER_SHADOWS"));for(const be of ve?[!1,!0]:[!1]){const Ae=be?(se.defines||[]).concat(_2):se.defines||[];for(const Ne of Se?[!1,!0]:[!1])for(const De of Re?[!1,!0]:[!1])for(const Ye of Ce?[!1,!0]:[!1])Z(oe,Ae,{params:se,fog:Ye,terrain:Ne,globe:De})}pe&&Z(oe,ce,{params:se,rtt:!0})}}if(Z("clippingMask"),T)for(const te of[!1,!0])Z("terrainRaster",te?["TERRAIN_VERTEX_MORPHING"]:[],{terrain:!0,fog:S});if(!q){if(o.some(te=>te.type==="hillshade")&&Z("hillshadePrepare"),F)for(const te of[!1,!0])for(const ee of[!1,!0]){const oe=[];te&&oe.push("RENDER_CUTOFF"),oe.push("RENDER_SHADOWS"),ee&&oe.push("NORMAL_OFFSET"),Z("groundShadow",oe),S&&Z("groundShadow",oe,{fog:!0})}if(I){for(const te of[[],["TERRAIN_VERTEX_MORPHING"],["GLOBE_POLES"]])for(const ee of[!1,!0]){const oe=[...te,"PROJECTION_GLOBE_VIEW"];ee&&oe.push("CUSTOM_ANTIALIASING"),Z("globeRaster",oe,{terrain:T,globe:!0,fog:S})}for(const te of[!1,!0]){const ee=te?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"];Z("globeAtmosphere",ee,{fog:!0,terrain:T,globe:te}),Z("globeAtmosphere",[...ee,"ALPHA_PASS"],{fog:!0,terrain:T,globe:te})}Z("stars",[],{fog:S,terrain:T,globe:!0})}}}_executeBatch(o,d,_){if(_.map&&_.map.isMoving())return void(this._idleHandle=a.o.requestIdleCallback(I=>this._executeBatch(I,d,_)));d.context.sweepPendingPrograms();const b=d.context.extParallelShaderCompile?CR.DEADLINE_MARGIN_KHR_MS:CR.DEADLINE_MARGIN_SYNC_MS;let S=0;for(;this._queue.length>0;){const I=this._queue.shift();if(!I||(d.style=_,d._fogVisible=!!I.params.overrideFog,d.getOrCreateProgram(I.programId,I.params),S++,o.timeRemaining()<=b))break}const T=this._queue.length===0||o.timeRemaining()>b;S>0&&T&&d.context.gl.flush(),this._idleHandle=this._queue.length>0||d.context._pendingPrograms.size>0?a.o.requestIdleCallback(I=>this._executeBatch(I,d,_)):null}processQueue(o,d){this._queue.length!==0&&(this._idleHandle!=null&&typeof cancelIdleCallback<"u"&&cancelIdleCallback(this._idleHandle),this._idleHandle=a.o.requestIdleCallback(_=>this._executeBatch(_,o,d)))}reset(){this._idleHandle!=null&&typeof cancelIdleCallback<"u"&&cancelIdleCallback(this._idleHandle),this._queue=[],this._idleHandle=null,this._needsBuild=!0}};Yy.DEADLINE_MARGIN_KHR_MS=5,Yy.DEADLINE_MARGIN_SYNC_MS=25;let fg=Yy;const Ky=a.a6.colorTheme,k1=new a.a8({data:new a.a9(Ky.data)});function Jy(p){if(!p.metadata||!p.metadata.content_area)return;const o=a.o.devicePixelRatio,{left:d,top:_,width:b,height:S}=p.metadata.content_area,T=d*o,I=_*o;return[T,I,T+b*o,I+S*o]}function Ip(p){if(p)return p.map(([o,d])=>[o*a.o.devicePixelRatio,d*a.o.devicePixelRatio])}class Qy{constructor(o,d,_){this.id=o,this.scope=d,this.sourceCache=_,this.pendingRequests=new Set,this.missingRequests=new Set}addPendingRequest(o){this.missingRequests.has(o.name)||this.pendingRequests.has(o.name)||this.pendingRequests.add(o.name)}hasPendingRequests(){return this.pendingRequests.size>0}resolvePendingRequests(){const o=new Map;if(!this.sourceCache.loaded())return o;const d=this.sourceCache.getVisibleCoordinates();if(d.length===0)return o;const _=this.sourceCache.getSource();if(!(_ instanceof Sn))return o;const b=d.map(T=>this.sourceCache.getTile(T)),S=_.getImages(b,Array.from(this.pendingRequests));for(const[T,I]of S)o.set(a.I.from({name:T,iconsetId:this.id}),I),this.pendingRequests.delete(T);for(const T of this.pendingRequests)this.missingRequests.add(T);return this.pendingRequests.clear(),o}}class wd{constructor(){this._previousClosestBuildingId=null,this._hysteresisRatio=.8,this._indo
25orMinimumZoom=16}findClosestBuilding(o,d,_,b,S){if(_<this._indoorMinimumZoom)return this._previousClosestBuildingId=null,null;let T=null,I=Number.MAX_VALUE,k=Number.MAX_VALUE,F=!1;const z=this._previousClosestBuildingId?o[this._previousClosestBuildingId]:null;this._previousClosestBuildingId&&z&&this._isBuildingVisible(z,b,S)&&(F=!0,k=this._calculateDistance(d,z));for(const[q,j]of Object.entries(o)){if(!this._isBuildingVisible(j,b,S))continue;const Z=this._calculateDistance(d,j);Z<I&&(I=Z,T=q)}return F&&T&&this._previousClosestBuildingId&&T!==this._previousClosestBuildingId?I>k*this._hysteresisRatio&&(T=this._previousClosestBuildingId):F&&!T&&(T=this._previousClosestBuildingId),this._previousClosestBuildingId=T,T}_calculateDistance(o,d){if(!d.center)return Number.MAX_VALUE;const _=o.lat-d.center[1],b=o.lng-d.center[0];return _*_+b*b}_isBuildingVisible(o,d,_){if(!_)return!1;for(const b of o.floorIds){const S=o.floors[b];if(!S.geometry)continue;const T=S.geometry;if(T.type==="Polygon"){const I=this._convertRingToPoints(T.coordinates[0]);if(a.bz(I,_))return!0}else if(T.type==="MultiPolygon"){const I=this._convertMultiPolygonToPoints(T.coordinates);if(a.d2(_,I))return!0}}return!1}_convertRingToPoints(o){return o.map(d=>new a.P(d[0],d[1]))}_convertMultiPolygonToPoints(o){return o.map(d=>d.length===0?[]:d[0].map(_=>new a.P(_[0],_[1])))}}class Sd extends a.E{constructor(o){super(),this._style=o,this._buildings={},this._activeFloors=new Set,this._closestBuildingId=null,this._indoorState={selectedFloorId:null,activeFloorsVisible:!0,activeFloors:this._activeFloors},this._buildingDetectionStrategy=new wd,this._initialLoadDone=!1,a.b0(["_updateUI"],this),this._style.on("style.load",()=>{this._style.isIndoorEnabled()&&(this._style.map.on("load",()=>{this._initialLoadDone=!0,this._indoorState&&this._indoorState.needsUpdate&&(this._indoorState.needsUpdate=!1,this._style.updateIndoorDependentLayers()),this._updateUI()}),this._style.map.on("move",this._updateUI),this._style.map.on("idle",this._updateUI))})}destroy(){this._buildings={},this._activeFloors=new Set,this._indoorState=null}selectFloor(o){o===this._selectedFloorId&&this._indoorState&&this._indoorState.activeFloorsVisible||(this._selectedFloorId=o,this._recalculateActiveFloors())}setActiveFloorsVisibility(o){this._updateActiveFloors(o),this._updateIndoorSelector()}setIndoorData(o){let d=!1;for(const[_,b]of Object.entries(o.buildings))if(this._buildings[_])for(const S of b.floorIds)this._buildings[_].floorIds.add(S),this._buildings[_].floors[S]?this._mergeFloors(this._buildings[_].floors[S],b.floors[S]):(this._buildings[_].floors[S]=b.floors[S],d=!0);else this._buildings[_]=b,d=!0;d&&this._recalculateActiveFloors()}getIndoorTileOptions(o,d){return this._indoorState?{sourceLayers:this._style.getIndoorSourceLayers(o,d),indoorState:this._indoorState}:null}getControlState(){const o=this._buildings,d=this._closestBuildingId,_=d&&o?o[d]:void 0;if(!_)return{selectedFloorId:null,activeFloorsVisible:!!this._indoorState&&this._indoorState.activeFloorsVisible,floors:[]};let b=null;for(const T of _.floorIds)if(this._activeFloors&&this._activeFloors.has(T)){b=T;break}const S=Array.from(_.floorIds).map(T=>({id:T,name:_.floors[T].name,zIndex:_.floors[T].zIndex})).sort((T,I)=>I.zIndex-T.zIndex).filter((T,I,k)=>I===0||T.zIndex!==k[I-1].zIndex);return{selectedFloorId:b,activeFloorsVisible:!!this._indoorState&&this._indoorState.activeFloorsVisible,floors:S}}_updateUI(){this._initialLoadDone=!0;const o=this._style.map.transform,d=this._buildingDetectionStrategy.findClosestBuilding(this._buildings,o.center,o.zoom,o.getBounds(),this._makeViewportPolygon());if(d!==this._closestBuildingId){const _=this._closestBuildingId;this._closestBuildingId=d,this._onBuildingTransition(_,d),this._updateIndoorSelector()}}_onBuildingTransition(o,d){if(!this._indoorState)return;!d&&o?(this._indoorState.activeFloors=new Set,this._indoorState.activeFloorsVisible=!1,this._style.updateIndoorDependentLayers()):d&&!o&&(this._recalculateActiveFloors(),this._updateActiveFloors(!0))}_updateIndoorSelector(){this.fire(new a.z("selector-update",this.getControlState()))}
25_updateActiveFloors(o){this._indoorState={selectedFloorId:this._selectedFloorId,activeFloorsVisible:o,activeFloors:this._activeFloors},this._initialLoadDone?this._style.updateIndoorDependentLayers():this._indoorState.needsUpdate=!0}_recalculateActiveFloors(){if(!this._buildings)return;const o=a.d3.calculate(this._buildings,this._selectedFloorId,this._activeFloors);(function(d,_){if(d===_)return!0;if(!d||!_||d.size!==_.size)return!1;for(const b of d)if(!_.has(b))return!1;return!0})(o,this._activeFloors)||(this._activeFloors=o,this._updateActiveFloors(!!this._indoorState&&this._indoorState.activeFloorsVisible),this._updateIndoorSelector())}_mergeFloors(o,d){d.geometry&&(o.geometry?(o.geometry.type==="Polygon"&&(o.geometry={type:"MultiPolygon",coordinates:[o.geometry.coordinates]}),d.geometry.type==="Polygon"?o.geometry.coordinates.push(d.geometry.coordinates):d.geometry.type==="MultiPolygon"&&o.geometry.coordinates.push(...d.geometry.coordinates)):o.geometry=d.geometry)}_makeViewportPolygon(){const o=this._style.map.transform,d=o.width,_=o.height;return[o.pointLocation(new a.P(0,0)),o.pointLocation(new a.P(d,0)),o.pointLocation(new a.P(d,_)),o.pointLocation(new a.P(0,_))].map(b=>new a.P(b.lng,b.lat))}}const Ga=(p,o)=>$l(p,o&&o.filter(d=>d.identifier!=="source.canvas")),Xl=a.aK($n,["addLayer","removeLayer","setLights","setPaintProperty","setLayoutProperty","setLayerProperty","setSlot","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setSnow","setRain","setProjection","setCamera","addImport","removeImport","updateImport","addIconset","removeIconset"]),M1=a.aK($n,["setCenter","setZoom","setBearing","setPitch"]),Pp=new Set(["background","sky","slot","custom"]),L1=new Set(["building"]),Td={version:8,layers:[],sources:{}},Rp={duration:300,delay:0};class ta extends a.E{constructor(o,d={}){if(super(),this.map=o,this.scope=d.scope||"",this.globalId=null,this.fragments=[],this.importDepth=d.importDepth||0,this.importsCache=d.importsCache||new Map,this.resolvedImports=d.resolvedImports||new Set,this.transition=Object.assign({},Rp),this._buildingIndex=new Mr(this),this.crossTileSymbolIndex=new C1,this._mergedOrder=[],this._drapedFirstOrder=[],this._mergedLayers={},this._mergedIndoor={},this._mergedSourceCaches={},this._mergedOtherSourceCaches={},this._mergedSymbolSourceCaches={},this._mergedFillExtrusionSourceCaches={},this._clipLayerPresent=!1,this._hasAppearances=!1,this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this._importedAsBasemap=!1,this._changes=d.styleChanges||new mn,this._hasDataDrivenEmissive=!1,this.indoorManager=new Sd(this),this.dispatcher=d.dispatcher?d.dispatcher:new pp(Dh(),this),this.map.painter&&this.map.painter.context){const b=this.map.painter.context.maxUniformBufferBindings,S=Math.floor(this.map.painter.context.maxUniformBlockSize/4);this.dispatcher.broadcast("setContextParams",{maxBindingPoints:b,maxUniformBlockSizeDwords:S,disableSymbolUBO:this.map.painter.context.disableSymbolUBO})}d.imageManager?this.imageManager=d.imageManager:(this.imageManager=new cn(this.map._spriteFormat),this.imageManager.setEventedParent(this)),this.imageManager.addScope(this.scope),this.glyphManager=d.glyphManager?d.glyphManager:new a.d4(o._requestManager,d.localFontFamily?a.d5.all:d.localIdeographFontFamily?a.d5.ideographs:a.d5.none,d.localFontFamily||d.localIdeographFontFamily,d.fontstackCompositing),d.modelManager?this.modelManager=d.modelManager:(this.modelManager=new g2(o._requestManager),this.modelManager.setEventedParent(this)),this._layers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._fillExtrusionSourceCaches={},this._loaded=!1,this._initialBroadcastDone=!1,this._programPrecompiler=this.map._precompilePrograms&&this.isRootStyle()?new fg:null,this._availableImages=[],this._availableModels={},this._order=[],this._markersNeedUpdate=!1,this.options=d.configOptions?d.configOptions:new Map,this._configDependentLayers=d.configDependentLayers?d.configDependentLayers:new Set,this._indoorDependentLayers=d.indoorDependentLayers?d.indoorDependentLayers:new Set,this._config=d.config,this._styleColorTheme={lut:null,lutLoading:!1,lutLoadingCorrelationID:0,colorTheme:null,colorThemeOverride:d.colorThemeOverride},this._styleColorThemeForScope={},this._initialConfig=d.initialConfig,this.dispatcher.broadcast("setReferrer",a.d6()),this.dispatcher.broadcast("setConfig",a.d7());const _=this;this._rtlTextPluginCallback=ta.registerForPluginStateChange(b=>{_.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:b.pluginStatus,pluginURL:b.pluginURL},(S,T)=>{if(a.d8(S),T&&T.every(I=>I))for(const I in _._sourceCaches){const k=_._sourceCaches[I],F=k.getSource().type;F!=="vector"&&F!=="geojson"||k.reload()}})}),this.on("data",b=>{if(b.dataType!=="source"||b.sourceDataType!=="metadata")return;const S=this.getOwnSource(b.sourceId);if(S&&S.vectorLayerIds)for(const T in this._layers){const I=this._layers[T];
25I.source===S.id&&this._validateLayer(I)}})}load(o){return o?(typeof o=="string"?this.loadURL(o):this.loadJSON(o),this):this}_getGlobalId(o){if(!o)return null;if(typeof o=="string"){if(a.e(o))return o;const d=a.d9(o);if(!d.startsWith("http"))try{return new URL(d,location.href).toString()}catch{return d}return d}return`json://${a.da(JSON.stringify(o))}`}_diffStyle(o,d,_){this.globalId=this._getGlobalId(o);const b=(S,T)=>{try{T(null,this.setState(S,_))}catch(I){T(I,!1)}};if(typeof o=="string"){const S=this.map._requestManager.normalizeStyleURL(o),T=this.map._requestManager.transformRequest(S,a.R.Style);a.m(T,(I,k)=>{I?this.fire(new a.y(I)):k&&b(k,d)})}else typeof o=="object"&&b(o,d)}loadURL(o,d={}){this.fire(new a.z("dataloading",{dataType:"style"}));const _=typeof d.validate=="boolean"?d.validate:!a.e(o);this.globalId=this._getGlobalId(o),o=this.map._requestManager.normalizeStyleURL(o,d.accessToken),this.resolvedImports.add(o);const b=this.importsCache.get(o);if(b)return this._load(b,_);const S=this.map._requestManager.transformRequest(o,a.R.Style);this._request=a.m(S,(T,I)=>{if(this._request=null,T)this.fire(new a.y(T));else if(I)return this.importsCache.set(o,I),this._load(I,_)})}loadJSON(o,d={}){this.fire(new a.z("dataloading",{dataType:"style"})),this.globalId=this._getGlobalId(o),this._request=a.o.frame(()=>{this._request=null,this._load(o,d.validate!==!1)})}loadEmpty(){this.fire(new a.z("dataloading",{dataType:"style"})),this._load(Td,!1)}_loadImports(o,d,_){if(this.importDepth>=4)return a.w("Style doesn't support nesting deeper than 5"),Promise.resolve();const b=[];for(const S of o){const T=this._createFragmentStyle(S),I=new Promise(z=>{T.once("style.import.load",z),T.once("error",z)}).then(()=>{this.mergeAll(),this.fire(new a.z("data",{dataType:"style"}))});if(b.push(I),this.resolvedImports.has(S.url)){T.loadEmpty();continue}const k=S.data||this.importsCache.get(S.url);k?(S.data?(T.fire(new a.z("dataloading",{dataType:"style"})),T.globalId=T._getGlobalId(k),queueMicrotask(()=>T._load(k,d))):T.loadJSON(k,{validate:d}),this._isInternalStyle(k)&&(T.globalId=null)):S.url?T.loadURL(S.url,{validate:d}):T.loadEmpty();const F={style:T,id:S.id,config:S.config};if(_){const z=this.fragments.findIndex(({id:q})=>q===_);this.fragments=this.fragments.slice(0,z).concat(F).concat(this.fragments.slice(z))}else this.fragments.push(F)}return Promise.allSettled(b)}getImportGlobalIds(o=this,d=new Set){for(const _ of o.fragments)_.style.globalId&&d.add(_.style.globalId),this.getImportGlobalIds(_.style,d);return[...d.values()]}_createFragmentStyle(o){const d=this.scope?a.t(o.id,this.scope):o.id;let _;const b=this._initialConfig&&this._initialConfig[d];(o.config||b)&&(_=Object.assign({},o.config,b));const S=new ta(this.map,{scope:d,styleChanges:this._changes,importDepth:this.importDepth+1,importsCache:this.importsCache,resolvedImports:new Set(this.resolvedImports),dispatcher:this.dispatcher,imageManager:this.imageManager,glyphManager:this.glyphManager,modelManager:this.modelManager,config:_,configOptions:this.options,colorThemeOverride:o["color-theme"],configDependentLayers:this._configDependentLayers,indoorDependentLayers:this._indoorDependentLayers});return S.setEventedParent(this.map,{style:S}),S}_reloadImports(o=!1){this.mergeAll(),this._updateMapProjection(),o||this.updateConfigDependencies(),this._updateLayers(this._indoorDependentLayers),this.map._triggerCameraUpdate(this.camera),(!o||this.isRootStyle()||this.map.style._initialBroadcastDone)&&(o&&this.isRootStyle()?(this.forEachFragmentStyle(d=>{this.dispatcher.broadcast("setLayers",{layers:d._serializeLayers(d._order),scope:d.scope,options:d.options})}),this._initialBroadcastDone=!0):this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}))}_isInternalStyle(o){return this.isRootStyle()&&(o.fragment||!!o.schema&&o.fragment!==!1)}_load(o,d){if(this._isInternalStyle(o)){const S=Object.assign({},Td,{imports:[{id:"basemap",data:o,url:""}]},o.center?{center:o.center}:{},o.bearing?{bearing:o.bearing}:{},o.pitch?{pitch:o.pitch}:{},o.zoom?{zoom:o.zoom}:{},o.light?{light:o.light}:{});return this._importedAsBasemap=!0,void this._load(S,d)}if(this.updateConfig(this._config,o.schema),d&&Ga(this,Ul(o)))return;this._loaded=!0;for(const S in o.sources)this.addSource(S,o.sources[S],{validate:!1,isInitialLoad:!0});this.stylesheet=a.db(o);const _=()=>{if(o.iconsets)for(const k in o.iconsets)this.addIconset(k,o.iconsets[k]);o.sprite?this._loadIconset(o.sprite):(this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0})),!this.glyphManager.url&&o.glyphs&&this.glyphManager.setURL(o.glyphs);
25const S=os(this.stylesheet.layers);if(this._order=S.map(k=>k.id),this.stylesheet.light&&a.w("The `light` root property is deprecated, prefer using `lights` with `flat` light type instead."),this.stylesheet.lights)if(this.stylesheet.lights.length===1&&this.stylesheet.lights[0].type==="flat"){const k=this.stylesheet.lights[0];this.light=new By(k.properties,k.id)}else this.setLights(this.stylesheet.lights);this.light||(this.light=new By(this.stylesheet.light)),this._layers={};for(const k of S){const F=a.dh(k,this.scope,this._styleColorTheme.lut,this.options);F.expressionDependencies.configDependencies.size!==0&&this._configDependentLayers.add(F.fqid),F.expressionDependencies.isIndoorDependent&&this._indoorDependentLayers.add(F.fqid),this._hasAppearances=this._hasAppearances||F.getAppearances().length!==0,F.setEventedParent(this,{layer:{id:F.id}}),this._layers[F.id]=F;const z=this.getOwnLayerSourceCache(F),q=!!this.directionalLight&&this.directionalLight.shadowsEnabled();z&&F.canCastShadows()&&q&&(z.castsShadows=!0)}if(this.glyphManager.url){const k=new Set;for(const F in this._layers){const z=this._layers[F];if(z.type==="symbol"&&z.layout){const q=z.layout.get("text-font");q&&q.value&&q.value.kind==="constant"&&k.add(q.value.value.join(","))}}for(const F of k)this.glyphManager.prefetchRange(F,0)}this.stylesheet.featuresets&&this.setFeaturesetSelectors(this.stylesheet.featuresets),this.stylesheet.models&&this.addModelURLs(this.stylesheet.models);const T=this.stylesheet.terrain;T&&(this.checkCanvasFingerprintNoise(),this.disableElevatedTerrain||this.terrainSetForDrapingOnly()||this._createTerrain(T,1)),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this.stylesheet.snow&&this._createSnow(this.stylesheet.snow),this.stylesheet.rain&&this._createRain(this.stylesheet.rain),this.stylesheet.transition&&this.setTransition(this.stylesheet.transition),this.fire(new a.z("data",{dataType:"style"}));const I=this.isRootStyle();o.imports?this._loadImports(o.imports,d).then(()=>{this._reloadImports(!0),this.fire(new a.z(I?"style.load":"style.import.load"))}).catch(k=>{this.fire(new a.y(new Error("Failed to load imports",k))),this.fire(new a.z(I?"style.load":"style.import.load"))}):(this._reloadImports(!0),this.fire(new a.z(I?"style.load":"style.import.load")))};this._styleColorTheme.colorTheme=this.stylesheet["color-theme"];const b=this._styleColorTheme.colorThemeOverride?this._styleColorTheme.colorThemeOverride:this._styleColorTheme.colorTheme;if(b){const S=this._evaluateColorThemeData(b);this._loadColorTheme(S).then(()=>{_()}).catch(T=>{a.w(`Couldn't load color theme from the stylesheet: ${T}`),_()})}else this._styleColorTheme.lut=null,_()}isRootStyle(){return this.importDepth===0}hasAppearances(){return this._hasAppearances||this.fragments.some(o=>o.style.hasAppearances())}mergeAll(){let o,d,_,b,S,T,I,k,F,z;const q={};this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle(j=>{if(j.stylesheet){if(j.disableElevatedTerrain&&(this.disableElevatedTerrain=!0),j.light!=null&&(o=j.light),j.stylesheet.lights)for(const Z of j.stylesheet.lights)Z.type==="ambient"&&j.ambientLight!=null&&(d=j.ambientLight),Z.type==="directional"&&j.directionalLight!=null&&(_=j.directionalLight);b=this._prioritizeTerrain(b,j.terrain,j.stylesheet.terrain),j.stylesheet.fog&&j.fog!=null&&(S=j.fog),j.stylesheet.snow&&j.snow!=null&&(T=j.snow),j.stylesheet.rain&&j.rain!=null&&(I=j.rain),j.stylesheet.camera!=null&&(z=j.stylesheet.camera),j.stylesheet.projection!=null&&(k=j.stylesheet.projection),j.stylesheet.transition!=null&&(F=j.stylesheet.transition),q[j.scope]=j._styleColorTheme}}),this.light=o,this.ambientLight=d,this.directionalLight=_,this.fog=S,this.snow=T,this.rain=I,this._styleColorThemeForScope=q,b===null?delete this.terrain:this.terrain=b,this.camera=z||{"camera-projection":"perspective"},this.projection=k||{name:"mercator"},this.transition=Object.assign({},Rp,F),this.mergeSources(),this.mergeLayers(),this.mergeIndoor(),this._programPrecompiler&&this._programPrecompiler.reset()}forEachFragmentStyle(o){const d=_=>{for(const b of _.fragments)d(b.style);o(_)};d(this)}_prioritizeTerrain(o,d,_){const b=o&&o.drapeRenderMode===0;return _===null?d&&d.drapeRenderMode===0?d:b?o:null:d!=null&&(!o||b||d&&d.drapeRenderMode===1)?d:o}mergeTerrain(){let o;this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle(d=>{o=this._prioritizeTerrain(o,d.terrain,d.stylesheet.terrain)}),o===null?delete this.terrain:this.terrain=o,this._programPrecompiler&&this._programPrecompiler.reset()}mergeProjection(){let o;this.forEachFragmentStyle(d=>{d.stylesheet.projection!=null&&(o=d.stylesheet.projection)}),this.projection=o||{name:"mercator"},this._programPrecompiler&&this._programPrecompiler.reset()}mergeSources(){const o={},d={},_={},b={};this.forEachFragmentStyle(S=>{for(const T in S._sourceCaches){const I=a.t(T,S.scope);o[I]=S._sourceCaches[T]}for(const T in S._otherSourceCaches){const I=a.t(T,S.scope);d[I]=S._otherSourceCaches[T]}for(const T in S._symbolSourceCaches){const I=a.t(T,S.scope);_[I]=S._symbolSourceCaches[T]}for(const T in S._fillExtrusionSourceCaches){const I=a.t(T,S.scope);b[I]=S._fillExtrusionSourceCaches[T]}}),this._mergedSourceCaches=o,this._mergedOtherSourceCaches=d,this._mergedSymbolSourceCaches=_,this._mergedFillExtrusionSourceCaches=b}mergeIndoor(){this.forEachFragmentStyle(o=>{if(o.stylesheet&&o.stylesheet.indoor)for(const d of Object.values(o.stylesheet.indoor)){const _=d,b=a.t(_.sourceId,o.scope);this._mergedIndoor[b]=new Set(_.sourceLayers||[])}})}mergeLayers(){const o={},d=[],_={};this._mergedSlots=[],this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this.forEachFragmentStyle(T=>{for(const I of T._order){const k=T._layers[I];if(k.type==="slot"){const F=a.dc(I);if(o[F])continue;o[F]=[]}k.slot&&o[k.slot]?o[k.slot].push(k):d.push(k)}}),this._mergedOrder=[];let b=-1;const S=(T=[])=>{for(const I of T)if(I.type==="slot"){const k=a.dc(I.id);o[k]&&S(o[k]),this._mergedSlots.push(k)}
25else{const k=a.t(I.id,I.scope);this._mergedOrder.push(k),_[k]=I,I.is3D(!!this.terrain)&&(this._has3DLayers=!0,b=this._mergedOrder.length-1),I.type==="circle"&&(this._hasCircleLayers=!0),I.type==="symbol"&&(this._hasSymbolLayers=!0),I.type==="clip"&&(this._clipLayerPresent=!0)}};if(S(d),this._has3DLayers){const T={};for(let I=0;I<this._mergedOrder.length;++I){const k=this._mergedOrder[I];T[k]=I===b?1:I<b?_[k].hasOcclusionOpacityProperties?2:0:4}this._mergedOrder.sort((I,k)=>T[I]-T[k])}this._mergedLayers=_,this.updateDrapeFirstLayers(),this._buildingIndex.processLayersChanged(),this._updateDataDrivenEmissiveStrength()}terrainSetForDrapingOnly(){return!!this.terrain&&this.terrain.drapeRenderMode===0}getCamera(){return this.stylesheet.camera}setCamera(o){return this.stylesheet.camera=Object.assign({},this.stylesheet.camera,o),this.camera=this.stylesheet.camera,this}_evaluateColorThemeData(o){return o.data?(function(d,_,b){const S=Object.assign({},_);for(const I of Object.keys(Ky))S[I]===void 0&&(S[I]=Ky[I].default);const T=new a.a7(k1,d,new Map(b));return T.setTransitionOrValue(S,b),T.untransitioned().possiblyEvaluate(new a.ab(0,{worldview:void 0}))})(this.scope,o,this.options).get("data"):null}_loadColorTheme(o){this._styleColorTheme.lutLoading=!0,this._styleColorTheme.lutLoadingCorrelationID+=1;const d=this._styleColorTheme.lutLoadingCorrelationID;return new Promise((_,b)=>{const S="data:image/png;base64,";if(!o||o.length===0)return this._styleColorTheme.lut=null,this._styleColorTheme.lutLoading=!1,void _();let T=o;T.startsWith(S)||(T=S+T);const I=a.I.from("mapbox-reserved-lut"),k=new Image;k.src=T,k.onerror=()=>{this._styleColorTheme.lutLoading=!1,b(new Error("Failed to load image data"))},k.onload=()=>{if(this._styleColorTheme.lutLoadingCorrelationID!==d)return void _();this._styleColorTheme.lutLoading=!1;const{width:F,height:z,data:q}=a.o.getImageData(k);if(z>32)return void b(new Error("The height of the image must be less than or equal to 32 pixels."));if(F!==z*z)return void b(new Error("The width of the image must be equal to the height squared."));this.getImage(I)&&this.removeImage(I),this.addImage(I,{data:new a.q({width:F,height:z},q),pixelRatio:1,sdf:!1,usvg:!1,version:0});const j=this.imageManager.getImage(I,this.scope);j?(this._styleColorTheme.lut={image:j.data,data:o},_()):b(new Error("Missing LUT image."))}})}getLut(o){const d=this._styleColorThemeForScope[o];return d?d.lut:null}setProjection(o){o?this.stylesheet.projection=o:delete this.stylesheet.projection,this.mergeProjection(),this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?(this.getTerrain()||this.stylesheet.terrain)&&!this.disableElevatedTerrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null,0))}_updateMapProjection(){this.isRootStyle()&&(this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.projection))}_loadSprite(o){this._spriteRequest=(function(d,_,b){let S,T,I;const k=a.o.devicePixelRatio>1?"@2x":"";let F=a.m(_.transformRequest(_.normalizeSpriteURL(d,k,".json"),a.R.SpriteJSON),(j,Z)=>{F=null,I||(I=j,S=Z,q())}),z=a.n(_.transformRequest(_.normalizeSpriteURL(d,k,".png"),a.R.SpriteImage),(j,Z)=>{z=null,I||(I=j,T=Z,q())});function q(){if(I)b(I);else if(S&&T){const j=a.o.getImageData(T),Z={};for(const te in S){const{width:ee,height:oe,x:se,y:de,sdf:pe,pixelRatio:ce,stretchX:Ce,stretchY:Se,content:Re}=S[te],ve=new a.q({width:ee,height:oe});a.q.copy(j,ve,{x:se,y:de},{x:0,y:0},{width:ee,height:oe},null),Z[te]={data:ve,pixelRatio:ce!==void 0?ce:1,sdf:pe!==void 0&&pe,stretchX:Ce,stretchY:Se,content:Re,usvg:!1,version:0}}b(null,Z)}}return{cancel(){F&&(F.cancel(),F=null),z&&(z.cancel(),z=null)}}})(o,this.map._requestManager,(d,_)=>{if(this._spriteRequest=null,d)this.fire(new a.y(d));else if(_){const b=new Map;for(const S in _)b.set(a.I.from(S),_[S]);this.addImages(b)}this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0}),this.fire(new a.z("data",{dataType:"style"}))})}addIconset(o,d){if(d.type==="sprite")return void this._loadSprite(d.url);const _=this.getOwnSourceCache(d.source);if(!_)return void this.fire(new a.y(new Error(`Source "${d.source}" as specified by iconset "${o}" does not exist and cannot be used as an iconset source`)));const b=_.getSource();if(b.type!=="raster-array")return void this.fire(new a.y(new Error(`Source "${d.source}" as specified by iconset "${o}" is not a "raster-array" source and cannot be used as an iconset source`)));b.partial=!1;const S=new Qy(o,this.scope,_);this.imageManager.addImageProvider(S,this.scope)}removeIconset(o){this.imageManager.removeImageProvider(o,this.scope)}_loadIconset(o){if(!a.e(o)&&this.map._spriteFormat!=="icon_set"||this.map._spriteFormat==="raster")return void this._loadSprite(o);const d=this.map._spriteFormat==="auto";var _,b;this._spriteRequest=(b=(S,T)=>{if(this._spriteRequest=null,S)d?this._loadSprite(o):this.fire(new a.y(S));else if(T){const I=new Map;for(const k in T)I.set(a.I.from(k),T[k]);this.addImages(I)}this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0}),this.fire(new a.z("data",{dataType:"style"}))},a.b4((_=this.map._requestManager).transformRequest(_.normalizeIconsetURL(o),a.R.Iconset),(S,T)=>{if(S)return void b(S);const I={},k=new a.b2(T).readFields(hr,{icons:[]},void 0);for(const F of k.icons){const z={version:1,pixelRatio:a.o.devicePixelRatio,content:Jy(F),stretchX:F.metadata?Ip(F.metadata.stretch_x_areas):void 0,stretchY:F.metadata?Ip(F.metadata.stretch_y_areas):void 0,sdf:!1,usvg:!0,icon:F};I[F.name]=z}b(null,I)}))}_validateLayer(o){const d=this.getOwnSource(o.source);if(!d)return;const _=o.sourceLayer;_&&(d.type==="geojson"||d.vectorLayerIds&&!d.vectorLayerIds.includes(_))&&this.fire(new a.y(new Error(`Source layer "${_}" does not exist on source "${d.id}" as specified by style layer "${o.id}"`)))}
25loaded(){if(!this._loaded||Object.keys(this._changes.getUpdatedSourceCaches()).length)return!1;for(const o in this._sourceCaches)if(!this._sourceCaches[o].loaded())return!1;if(!this.imageManager.isLoaded()||this.imageManager.hasPatternsInFlight()||!this.modelManager.isLoaded()||this._styleColorTheme.lutLoading)return!1;for(const{style:o}of this.fragments)if(!o.loaded())return!1;return!0}_serializeImports(){if(this.stylesheet.imports)return this.stylesheet.imports.map((o,d)=>{const _=this.fragments[d];return _&&_.style&&(o.data=_.style.serialize()),o})}_serializeSources(){const o={};for(const d in this._sourceCaches){const _=this._sourceCaches[d].getSource();o[_.id]||(o[_.id]=_.serialize())}return o}_serializeLayers(o){const d=[];for(const _ of o){const b=this._layers[_];b&&b.type!=="custom"&&d.push(b.serialize())}return d}hasLightTransitions(){return!(!this.light||!this.light.hasTransition())||!(!this.ambientLight||!this.ambientLight.hasTransition())||!(!this.directionalLight||!this.directionalLight.hasTransition())}hasFogTransition(){return!!this.fog&&this.fog.hasTransition()}hasSnowTransition(){return!!this.snow&&this.snow.hasTransition()}hasRainTransition(){return!!this.rain&&this.rain.hasTransition()}hasTransitions(){if(this.hasLightTransitions()||this.hasFogTransition()||this.hasSnowTransition()||this.hasRainTransition())return!0;for(const o in this._sourceCaches)if(this._sourceCaches[o].hasTransition())return!0;for(const o in this._layers)if(this._layers[o].hasTransition())return!0;return!1}_updateDataDrivenEmissiveStrength(){for(const o in this._mergedLayers){const d=this._mergedLayers[o];if(d._transitionablePaint&&d._transitionablePaint._values){const _=d._transitionablePaint._values["line-emissive-strength"];if(_&&_.value&&_.value.isDataDriven())return void(this._hasDataDrivenEmissive=!0)}}this._hasDataDrivenEmissive=!1}hasDataDrivenEmissiveStrength(){return this._hasDataDrivenEmissive}get order(){return this.terrain?this._drapedFirstOrder:this._mergedOrder}_getOrder(o){return o?this.order:this._mergedOrder}isLayerDraped(o){return!!this.terrain&&o.isDraped(this.getLayerSourceCache(o))}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}_checkLayer(o){const d=this.getOwnLayer(o);if(d)return d;this.fire(new a.y(new Error(`The layer '${o}' does not exist in the map's style.`)))}_checkSource(o){const d=this.getOwnSource(o);if(d)return d;this.fire(new a.y(new Error(`The source '${o}' does not exist in the map's style.`)))}handleIdle(){const o=this.map.painter;o&&(o.context.sweepPendingPrograms(),this._programPrecompiler&&this._programPrecompiler.processQueue(o,this))}handleContextLost(){this._programPrecompiler&&this._programPrecompiler.reset()}update(o){if(!this._loaded)return;this.ambientLight&&this.ambientLight.recalculate(o),this.directionalLight&&this.directionalLight.recalculate(o);const d=this.calculateLightsBrightness();o.brightness=d||0,d!==this._brightness&&(this._brightness=d,this.dispatcher.broadcast("setBrightness",d)),o.worldview!==this._worldview&&(this._worldview=o.worldview,this.dispatcher.broadcast("setWorldview",this._worldview));const _=this._changes.isDirty();let b=!1;if(this._changes.isDirty()){const k=this._changes.getLayerUpdatesByScope();for(const F in k){const{updatedIds:z,removedIds:q}=k[F];(z||q)&&(this._updateWorkerLayers(F,z,q),b=!0)}this.updateSourceCaches(),this._updateTilesForChangedImages(),this.updateLayers(o),this.light&&this.light.updateTransitions(o),this.ambientLight&&this.ambientLight.updateTransitions(o),this.directionalLight&&this.directionalLight.updateTransitions(o),this.fog&&this.fog.updateTransitions(o),this.snow&&this.snow.updateTransitions(o),this.rain&&this.rain.updateTransitions(o),this._changes.reset()}const S={};for(const k in this._mergedSourceCaches){const F=this._mergedSourceCaches[k];S[k]=F.used,F.used=!1,F.tileCoverLift=0}const T={};for(const k of this._mergedOrder){const F=this._mergedLayers[k];if((F.visibility!=="none"||F.hasTransition())&&F.recalculate(o,this._availableImages),!F.isHidden(o.zoom)){L1.has(F.type)&&a.dd();const z=this.getLayerSourceCache(F);z&&(z.used=!0,z.tileCoverLift=Math.max(z.tileCoverLift,F.tileCoverLift()))}if(F.type==="fill-extrusion"){const z=a.t(F.source,F.scope);if(z in this._mergedFillExtrusionSourceCaches){const q=F.layout&&F.layout.get("source-max-zoom");if(q!=null){const j=T[z];T[z]=j==null?q:Math.min(j,q)}}}}if(this._programPrecompiler&&this._programPrecompiler.needsBuild()){const k=this._mergedOrder.map(F=>this._mergedLayers[F]);this._programPrecompiler.buildQueue(k,o,this)}for(const k in this._mergedFillExtrusionSourceCaches)this._mergedFillExtrusionSourceCaches[k].setMaxzoomOverride(T[k]!=null?T[k]:null);this.terrain&&b&&this.mergeLayers();const I=this.imageManager.getPendingImageProviders();for(const k of I)k.sourceCache.used=!0;for(const k in S){const F=this._mergedSourceCaches[k];
25S[k]!==F.used&&F.getSource().fire(new a.z("data",{sourceDataType:"visibility",dataType:"source",sourceId:F.getSource().id}))}this.light&&this.light.recalculate(o),this.terrain&&this.terrain.recalculate(o),this.fog&&this.fog.recalculate(o),this.snow&&this.snow.recalculate(o),this.rain&&this.rain.recalculate(o),this.z=o.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),this.imageManager.clearUpdatedImages(this.scope),_&&this.fire(new a.z("data",{dataType:"style"}))}updateImageProviders(){const o=this.imageManager.getPendingImageProviders();for(const d of o){const _=d.resolvePendingRequests(),b=this.getFragmentStyle(d.scope);b&&b.addImages(_)}}_updateTilesForChangedImages(){const o={};for(const d in this._mergedSourceCaches){const _=this._mergedSourceCaches[d].getSource().scope;o[_]=o[_]||this._changes.getUpdatedImages(_),o[_].length!==0&&this._mergedSourceCaches[d].reloadTilesForDependencies(["icons","patterns"],o[_])}for(const d in o)this._changes.resetUpdatedImages(d)}_updateWorkerLayers(o,d,_){const b=this.getFragmentStyle(o);b&&this.dispatcher.broadcast("updateLayers",{layers:d?b._serializeLayers(d):[],scope:o,removedIds:_||[],options:b.options})}setState(o,d){if(this._checkLoaded(),Ga(this,Ul(o)))return!1;(o=a.db(o)).layers=os(o.layers);const _=(function(T,I){if(!T)return[{command:$n.setStyle,args:[I]}];let k=[];try{if(!a.b9(T.version,I.version))return[{command:$n.setStyle,args:[I]}];if(a.b9(T.center,I.center)||k.push({command:$n.setCenter,args:[I.center]}),a.b9(T.zoom,I.zoom)||k.push({command:$n.setZoom,args:[I.zoom]}),a.b9(T.bearing,I.bearing)||k.push({command:$n.setBearing,args:[I.bearing]}),a.b9(T.pitch,I.pitch)||k.push({command:$n.setPitch,args:[I.pitch]}),a.b9(T.sprite,I.sprite)||k.push({command:$n.setSprite,args:[I.sprite]}),a.b9(T.glyphs,I.glyphs)||k.push({command:$n.setGlyphs,args:[I.glyphs]}),a.b9(T.imports,I.imports)||(function(Z=[],te=[],ee){te=te||[];const oe=(Z=Z||[]).map(Bh),se=te.map(Bh),de=Z.reduce(gd,{}),pe=te.reduce(gd,{}),ce=oe.slice();let Ce,Se,Re,ve;for(Ce=0,Se=0;Ce<oe.length;Ce++)Re=oe[Ce],Object.hasOwn(pe,Re)?Se++:(ee.push({command:$n.removeImport,args:[Re]}),ce.splice(ce.indexOf(Re,Se),1));for(Ce=0,Se=0;Ce<se.length;Ce++)Re=se[se.length-1-Ce],ce[ce.length-1-Ce]!==Re&&(Object.hasOwn(de,Re)?(ee.push({command:$n.removeImport,args:[Re]}),ce.splice(ce.lastIndexOf(Re,ce.length-Se),1)):Se++,ve=ce[ce.length-Ce],ee.push({command:$n.addImport,args:[pe[Re],ve]}),ce.splice(ce.length-Ce,0,Re));for(const be of te){const Ae=de[be.id];Ae&&(delete Ae.data,a.b9(Ae,be)||ee.push({command:$n.updateImport,args:[be.id,be]}))}})(T.imports,I.imports,k),a.b9(T.transition,I.transition)||k.push({command:$n.setTransition,args:[I.transition]}),a.b9(T.light,I.light)||k.push({command:$n.setLight,args:[I.light]}),a.b9(T.fog,I.fog)||k.push({command:$n.setFog,args:[I.fog]}),a.b9(T.snow,I.snow)||k.push({command:$n.setSnow,args:[I.snow]}),a.b9(T.rain,I.rain)||k.push({command:$n.setRain,args:[I.rain]}),a.b9(T.projection,I.projection)||k.push({command:$n.setProjection,args:[I.projection]}),a.b9(T.lights,I.lights)||k.push({command:$n.setLights,args:[I.lights]}),a.b9(T.camera,I.camera)||k.push({command:$n.setCamera,args:[I.camera]}),a.b9(T.iconsets,I.iconsets)||(function(Z,te,ee){let oe;for(oe in te=te||{},Z=Z||{})Object.hasOwn(Z,oe)&&(Object.hasOwn(te,oe)||ee.push({command:$n.removeIconset,args:[oe]}));for(oe in te){if(!Object.hasOwn(te,oe))continue;const se=te[oe];Object.hasOwn(Z,oe)?a.b9(Z[oe],se)||(ee.push({command:$n.removeIconset,args:[oe]}),ee.push({command:$n.addIconset,args:[oe,se]})):ee.push({command:$n.addIconset,args:[oe,se]})}})(T.iconsets,I.iconsets,k),!a.b9(T["color-theme"],I["color-theme"]))return[{command:$n.setStyle,args:[I]}];const F={},z=[];(function(Z,te,ee,oe){let se;for(se in te=te||{},Z=Z||{})Object.hasOwn(Z,se)&&(Object.hasOwn(te,se)||Fh(se,ee,oe));for(se in te){if(!Object.hasOwn(te,se))continue;const de=te[se];Object.hasOwn(Z,se)?a.b9(Z[se],de)||(Z[se].type==="geojson"&&de.type==="geojson"&&gp(Z,te,se)?ee.push({command:$n.setGeoJSONSourceData,args:[se,de.data]}):jy(se,te,ee,oe)):m1(se,te,ee)}})(T.sources,I.sources,z,F);const q=[];
25T.layers&&T.layers.forEach(Z=>{Z.source&&F[Z.source]?k.push({command:$n.removeLayer,args:[Z.id]}):q.push(Z)});let j=T.terrain;j&&F[j.source]&&(k.push({command:$n.setTerrain,args:[void 0]}),j=void 0),k=k.concat(z),a.b9(j,I.terrain)||k.push({command:$n.setTerrain,args:[I.terrain]}),(function(Z,te,ee){te=te||[];const oe=(Z=Z||[]).map(Bh),se=te.map(Bh),de=Z.reduce(gd,{}),pe=te.reduce(gd,{}),ce=oe.slice(),Ce=Object.create(null);let Se,Re,ve,be,Ae,Ne,De;for(Se=0,Re=0;Se<oe.length;Se++)ve=oe[Se],Object.hasOwn(pe,ve)?Re++:(ee.push({command:$n.removeLayer,args:[ve]}),ce.splice(ce.indexOf(ve,Re),1));for(Se=0,Re=0;Se<se.length;Se++)ve=se[se.length-1-Se],ce[ce.length-1-Se]!==ve&&(Object.hasOwn(de,ve)?(ee.push({command:$n.removeLayer,args:[ve]}),ce.splice(ce.lastIndexOf(ve,ce.length-Re),1)):Re++,Ne=ce[ce.length-Se],ee.push({command:$n.addLayer,args:[pe[ve],Ne]}),ce.splice(ce.length-Se,0,ve),Ce[ve]=!0);for(Se=0;Se<se.length;Se++)if(ve=se[Se],be=de[ve],Ae=pe[ve],!Ce[ve]&&!a.b9(be,Ae))if(a.b9(be.source,Ae.source)&&a.b9(be["source-layer"],Ae["source-layer"])&&a.b9(be.type,Ae.type)){for(De in md(be.layout,Ae.layout,ee,ve,null,$n.setLayoutProperty),md(be.paint,Ae.paint,ee,ve,null,$n.setPaintProperty),a.b9(be.slot,Ae.slot)||ee.push({command:$n.setSlot,args:[ve,Ae.slot]}),a.b9(be.filter,Ae.filter)||ee.push({command:$n.setFilter,args:[ve,Ae.filter]}),a.b9(be.minzoom,Ae.minzoom)&&a.b9(be.maxzoom,Ae.maxzoom)||ee.push({command:$n.setLayerZoomRange,args:[ve,Ae.minzoom,Ae.maxzoom]}),be)Object.hasOwn(be,De)&&De!=="layout"&&De!=="paint"&&De!=="filter"&&De!=="metadata"&&De!=="minzoom"&&De!=="maxzoom"&&De!=="slot"&&(De.indexOf("paint.")===0?md(be[De],Ae[De],ee,ve,De.slice(6),$n.setPaintProperty):a.b9(be[De],Ae[De])||ee.push({command:$n.setLayerProperty,args:[ve,De,Ae[De]]}));for(De in Ae)Object.hasOwn(Ae,De)&&!Object.hasOwn(be,De)&&De!=="layout"&&De!=="paint"&&De!=="filter"&&De!=="metadata"&&De!=="minzoom"&&De!=="maxzoom"&&De!=="slot"&&(De.indexOf("paint.")===0?md(be[De],Ae[De],ee,ve,De.slice(6),$n.setPaintProperty):a.b9(be[De],Ae[De])||ee.push({command:$n.setLayerProperty,args:[ve,De,Ae[De]]}))}else ee.push({command:$n.removeLayer,args:[ve]}),Ne=ce[ce.lastIndexOf(ve)+1],ee.push({command:$n.addLayer,args:[Ae,Ne]})})(q,I.layers,k)}catch(F){console.warn("Unable to compute style diff:",F),k=[{command:$n.setStyle,args:[I]}]}return k})(this.serialize(),o).filter(T=>!(T.command in M1));if(_.length===0)return!1;const b=_.filter(T=>!(T.command in Xl));if(b.length>0)throw new Error(`Unimplemented: ${b.map(T=>T.command).join(", ")}.`);const S=[];return _.forEach(T=>{S.push(this[T.command](...T.args))}),d&&Promise.all(S).then(d).catch(d),this.stylesheet=o,this.mergeAll(),this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}),!0}_updateWorkerImages(){this._availableImages=this.imageManager.listImages(this.scope),this.dispatcher.broadcast("setImages",{scope:this.scope,images:this._availableImages})}_updateWorkerModels(){this._availableModels=this.modelManager.getModelURIs(this.scope),this.dispatcher.broadcast("setModels",{scope:this.scope,models:this._availableModels})}addImages(o){if(o.size===0)return this;for(const[d,_]of o.entries()){if(this.getImage(d))return this.fire(new a.y(new Error(`An image with the name "${d.name}" already exists.`)));this.imageManager.addImage(d,this.scope,_),this._changes.updateImage(d,this.scope)}return this._updateWorkerImages(),this.fire(new a.z("data",{dataType:"style"})),this}addImage(o,d){return this.getImage(o)?this.fire(new a.y(new Error(`An image with the name "${o.name}" already exists.`))):(this.imageManager.addImage(o,this.scope,d),this._changes.updateImage(o,this.scope),this._updateWorkerImages(),this.fire(new a.z("data",{dataType:"style"})),this)}updateImage(o,d,_=!1){this.imageManager.updateImage(o,this.scope,d),_&&(this._changes.updateImage(o,this.scope),this._updateWorkerImages(),this.fire(new a.z("data",{dataType:"style"})))}getImage(o){return this.imageManager.getImage(o,this.scope)}removeImage(o){return this.getImage(o)?(this.imageManager.removeImage(o,this.scope),this._changes.updateImage(o,this.scope),this._updateWorkerImages(),this.fire(new a.z("data",{dataType:"style"})),this):this.fire(new a.y(new Error("No image with this name exists.")))}listImages(){return this._checkLoaded(),this._availableImages.slice()}getActualScope(){return this._importedAsBasemap?"basemap":this.scope}addModelURLs(o){return this.modelManager.addModelURLs(o,this.getActualScope()),this._updateWorkerModels(),this.fire(new a.z("data",{dataType:"style"})),this}addModel(o,d,_={}
25){return this._checkLoaded(),this._validate(Dy,`models.${o}`,d,null,_)||(this.modelManager.addModel(o,d,this.getActualScope()),this.fire(new a.z("data",{dataType:"style"}))),this}hasModel(o){return this.modelManager.hasModel(o,this.getActualScope())}removeModel(o){return this.hasModel(o)?(this.modelManager.removeModel(o,this.getActualScope(),!1,!0),this.fire(new a.z("data",{dataType:"style"})),this):this.fire(new a.y(new Error("No model with this ID exists.")))}listModels(){return this._checkLoaded(),this.modelManager.listModels(this.getActualScope())}addSource(o,d,_={}){if(this._checkLoaded(),this.getOwnSource(o)!==void 0)throw new Error(`There is already a source with ID "${o}".`);if(!d.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(d).join(", ")}.`);if(["vector","raster","geojson","video","image"].includes(d.type)&&this._validate(Qs,`sources.${o}`,d,null,_))return;this.map&&this.map._collectResourceTiming&&(d.collectResourceTiming=!0);const b=rg(o,d,this.dispatcher,this);b.scope=this.scope,b.setEventedParent(this,()=>({isSourceLoaded:this._isSourceCacheLoaded(b.id),source:b.serialize(),sourceId:b.id}));const S=T=>{const I=(T===a.b7.Symbol?"symbol:":T===a.b7.FillExtrusion?"fill-extrusion:":"other:")+b.id,k=a.t(I,this.scope),F=this._sourceCaches[I]=new ur(k,b,T);T===a.b7.Symbol?this._symbolSourceCaches[b.id]=F:T===a.b7.FillExtrusion?this._fillExtrusionSourceCaches[b.id]=F:this._otherSourceCaches[b.id]=F,F.onAdd(this.map)};S(a.b7.Other),d.type!=="vector"&&d.type!=="geojson"||(S(a.b7.Symbol),d.type==="vector"&&S(a.b7.FillExtrusion)),b.onAdd&&b.onAdd(this.map),_.isInitialLoad||(this.mergeSources(),this._changes.setDirty())}removeSource(o){this._checkLoaded();const d=this.getOwnSource(o);if(!d)throw new Error("There is no source with this ID");for(const b in this._layers)if(this._layers[b].source===o)return this.fire(new a.y(new Error(`Source "${o}" cannot be removed while layer "${b}" is using it.`)));if(this.terrain&&this.terrain.scope===this.scope&&this.terrain.get().source===o)return this.fire(new a.y(new Error(`Source "${o}" cannot be removed while terrain is using it.`)));if(this.stylesheet.iconsets){const b=Object.entries(this.stylesheet.iconsets).find(([S,T])=>T.type==="source"&&T.source===o);if(b)return this.fire(new a.y(new Error(`Source "${o}" cannot be removed while iconset "${b[0]}" is using it.`)))}const _=this.getOwnSourceCaches(o);for(const b of _){const S=a.dc(b.id);delete this._sourceCaches[S],this._changes.discardSourceCacheUpdate(b.id),b.fire(new a.z("data",{sourceDataType:"metadata",dataType:"source",sourceId:b.getSource().id})),b.setEventedParent(null),b.clearTiles()}return delete this._otherSourceCaches[o],delete this._symbolSourceCaches[o],delete this._fillExtrusionSourceCaches[o],this.mergeSources(),d.setEventedParent(null),d.onRemove&&d.onRemove(this.map),this._changes.setDirty(),this}setGeoJSONSourceData(o,d){this._checkLoaded(),this.getOwnSource(o).setData(d),this._changes.setDirty()}getOwnSource(o){const d=this.getOwnSourceCache(o);return d&&d.getSource()}getOwnSources(){const o=[];for(const d in this._otherSourceCaches){const _=this.getOwnSourceCache(d);_&&o.push(_.getSource())}return o}areTilesLoaded(){const o=this._mergedSourceCaches;for(const d in o){const _=o[d]._tiles;for(const b in _){const S=_[b];if(S.state!=="loaded"&&S.state!=="errored")return!1}}return!0}setLights(o){if(this._checkLoaded(),this._programPrecompiler&&this._programPrecompiler.reset(),!o)return delete this.ambientLight,void delete this.directionalLight;const d=this._getTransitionParameters();for(const S of o){if(this._validate(Ly,"lights",S))return;switch(S.type){case"ambient":if(this.ambientLight){const T=this.ambientLight;T.set(S),T.updateTransitions(d)}else this.ambientLight=new Rh(S,c1(),this.scope,this.options);break;case"directional":if(this.directionalLight){const T=this.directionalLight;T.set(S),T.updateTransitions(d)}else this.directionalLight=new Rh(S,tg(),this.scope,this.options)}}const _=Object.assign(d,{worldview:this.map.getWorldview()}),b=new a.ab(this.z||0,_);this.ambientLight&&this.ambientLight.recalculate(b),this.directionalLight&&this.directionalLight.recalculate(b),this._brightness=this.calculateLightsBrightness(),this.dispatcher.broadcast("setBrightness",this._brightness)}calculateLightsBrightness(){const o=this.directionalLight,d=this.ambientLight;if(!o||!d)return;const _=j=>.2126*(j[0]<=.03928?j[0]/12.92:Math.pow((j[0]+.055)/1.055,2.4))+.7152*(j[1]<=.03928?j[1]/12.92:Math.pow((j[1]+.055)/1.055,2.4))+.0722*(j[2]<=.03928?j[2]/12.92:Math.pow((j[2]+.055)/1.055,2.4)),b=o.properties.get("color").toNonPremultipliedRenderColor(null).toArray01(),S=o.properties.get("intensity"),T=o.properties.get("direction"),I=1-a.cT(T.x,T.y,T.z)[2]/90,
25k=_(b)*S*I,F=d.properties.get("color").toNonPremultipliedRenderColor(null).toArray01(),z=d.properties.get("intensity"),q=_(F)*z;return Number(((k+q)/2).toFixed(6))}getBrightness(){return this._brightness}getLights(){if(!this.enable3dLights())return null;const o=[];return this.directionalLight&&o.push(this.directionalLight.get()),this.ambientLight&&o.push(this.ambientLight.get()),o}enable3dLights(){return!!this.ambientLight&&!!this.directionalLight}getFragmentStyle(o){if(o==null||o===""&&this.isRootStyle())return this;if(a.de(o)){const d=a.df(o),_=this.fragments.find(({id:S})=>S===d);if(!_)return;const b=a.dc(o);return _.style.getFragmentStyle(b)}{const d=this.fragments.find(({id:_})=>_===o);return d?d.style:void 0}}setFeaturesetSelectors(o){if(!o)return;const d=(_,b="")=>`${_}::${b}`;this._featuresetSelectors={};for(const _ in o){const b={},S=this._featuresetSelectors[_]=[];for(const T of o[_].selectors){if(T.featureNamespace){const k=this.getOwnLayer(T.layer);if(!k){a.w(`Layer is undefined for selector: ${T.layer}`);continue}const F=d(k.source,k.sourceLayer);if(F in b&&b[F]!==T.featureNamespace){a.w(`"featureNamespace ${T.featureNamespace} of featureset ${_}'s selector is not associated to the same source, skip this selector`);continue}b[F]=T.featureNamespace}let I;if(T.properties)for(const k in T.properties){const F=a.U(T.properties[k]);F.result==="success"&&(I=I||{},I[k]=F.value)}S.push({layerId:T.layer,namespace:T.featureNamespace,properties:I,uniqueFeatureID:T._uniqueFeatureID})}}}getFeaturesetDescriptors(o){const d=this.getFragmentStyle(o);if(!d||!d.stylesheet.featuresets)return[];const _=[];for(const b in d.stylesheet.featuresets)_.push({featuresetId:b,importId:d.scope?d.scope:void 0});return _}getFeaturesetLayers(o,d){const _=this.getFragmentStyle(d),b=_.stylesheet.featuresets;if(!b||!b[o])return this.fire(new a.y(new Error(`The featureset '${o}' does not exist in the map's style and cannot be queried.`))),[];const S=[];for(const T of b[o].selectors){const I=_.getOwnLayer(T.layer);I&&S.push(I)}return S}getConfigProperty(o,d){const _=this.getFragmentStyle(o);if(!_)return null;const b=a.t(d,_.scope),S=_.options.get(b),T=S?S.value||S.default:null;return T?T.serialize():null}isIndoorEnabled(){return Object.keys(this._mergedIndoor).length>0}getIndoorSourceLayers(o,d){const _=a.t(o,d);return this._mergedIndoor[_]}setIndoorData(o,d){this.indoorManager.setIndoorData(d)}updateIndoorDependentLayers(){this._updateLayers(this._indoorDependentLayers),this.map._styleDirty=!0,this.map.triggerRepaint()}setConfigProperty(o,d,_){const b=this.getFragmentStyle(o);if(!b)return;const S=b.stylesheet.schema;if(!S||!S[d])return;const T=a.U(_);if(T.result!=="success")return void Ga(this,T.value);const I=T.value.expression,k=a.t(d,b.scope),F=b.options.get(k);if(!F)return;let z;const{minValue:q,maxValue:j,stepValue:Z,type:te,values:ee}=S[d],oe=a.U(S[d].default);oe.result==="success"&&(z=oe.value.expression),z?(this.options.set(k,Object.assign({},F,{value:I,default:z,minValue:q,maxValue:j,stepValue:Z,type:te,values:ee})),this.updateConfigDependencies(d)):this.fire(new a.y(new Error(`No schema defined for the config option "${d}" in the "${o}" fragment.`)))}getConfig(o){const d=this.getFragmentStyle(o);if(!d)return null;const _=d.stylesheet.schema;if(!_)return null;const b={};for(const S in _){const T=a.t(S,d.scope),I=d.options.get(T),k=I?I.value||I.default:null;b[S]=k?k.serialize():null}return b}setConfig(o,d){const _=this.getFragmentStyle(o);_&&(_.updateConfig(d,_.stylesheet.schema),this.updateConfigDependencies())}getSchema(o){const d=this.getFragmentStyle(o);return d?d.stylesheet.schema:null}setSchema(o,d){const _=this.getFragmentStyle(o);_&&(_.stylesheet.schema=d,_.updateConfig(_._config,d),this.updateConfigDependencies())}updateConfig(o,d){if(this._config=o,o||d)if(d)for(const _ in d){let b,S;const T=a.U(d[_].default);if(T.result==="success"&&(b=T.value.expression),o&&o[_]!==void 0){const j=a.U(o[_]);j.result==="success"&&(S=j.value.expression)}const{minValue:I,maxValue:k,stepValue:F,type:z,values:q}=d[_];if(b){const j=a.t(_,this.scope);this.options.set(j,{default:b,value:S,minValue:I,maxValue:k,stepValue:F,type:z,values:q})}
25else this.fire(new a.y(new Error(`No schema defined for config option "${_}".`)))}else this.fire(new a.y(new Error("Attempting to set config for a style without schema.")))}_updateLayers(o,d=()=>!0){for(const _ of o){const b=this.getLayer(_);b&&d(b)&&(b.possiblyEvaluateVisibility(),this._updateLayer(b),this._changes.setDirty())}}updateConfigDependencies(o){this._updateLayers(this._configDependentLayers,d=>!o||d.expressionDependencies.configDependencies.has(o)),this.ambientLight&&this.ambientLight.updateConfig(this.options),this.directionalLight&&this.directionalLight.updateConfig(this.options),this.fog&&this.fog.updateConfig(this.options),this.snow&&this.snow.updateConfig(this.options),this.rain&&this.rain.updateConfig(this.options),this.forEachFragmentStyle(d=>{const _=d._styleColorTheme.colorThemeOverride?d._styleColorTheme.colorThemeOverride:d._styleColorTheme.colorTheme;if(_){const b=d._evaluateColorThemeData(_);(!d._styleColorTheme.lut&&b!==""||d._styleColorTheme.lut&&b!==d._styleColorTheme.lut.data)&&d.setColorTheme(_)}}),this._changes.setDirty()}addLayer(o,d,_={}){this._checkLoaded();const b=o.id;if(this._layers[b])return void this.fire(new a.y(new Error(`Layer with i
25d "${b}" already exists on this map`)));let S;if(o.type==="custom"){if(Ga(this,a.dg(o)))return;S=a.dh(o,this.scope,this._styleColorTheme.lut,this.options)}else{if(typeof o.source=="object"&&(this.addSource(b,o.source),o=a.db(o),o=Object.assign(o,{source:b})),this._validate(Ec,`layers.${b}`,o,{arrayIndex:-1},_))return;S=a.dh(o,this.scope,this._styleColorTheme.lut,this.options),this._validateLayer(S),S.setEventedParent(this,{layer:{id:b}})}const T=a.t(S.source,S.scope);S.expressionDependencies.configDependencies.size!==0&&this._configDependentLayers.add(T),S.expressionDependencies.isIndoorDependent&&this._indoorDependentLayers.add(T);let I=this._order.length;if(d){const q=this._order.indexOf(d);if(q===-1)return void this.fire(new a.y(new Error(`Layer with id "${d}" does not exist on this map.`)));S.slot&&S.slot!==this._layers[d].slot?a.w(`Layer with id "${d}" has a different slot. Layers can only be rearranged within the same slot.`):I=q}this._order.splice(I,0,b),this._handleLayerOrderChange(),this._layers[b]=S;const k=this.getOwnLayerSourceCache(S),F=!!this.directionalLight&&this.directionalLight.shadowsEnabled();k&&S.canCastShadows()&&F&&(k.castsShadows=!0);const z=this._changes.getRemovedLayer(S);if(z&&S.source&&k&&S.type!=="custom"){this._changes.discardLayerRemoval(S);const q=a.t(S.source,S.scope);z.type!==S.type?this._changes.updateSourceCache(q,"clear"):(this._changes.updateSourceCache(q,"reload"),k.pause())}this._updateLayer(S),S.onAdd&&S.onAdd(this.map),S.scope=this.scope,this.mergeLayers()}moveLayer(o,d){this._checkLoaded();const _=this._checkLayer(o);if(!_||o===d)return;const b=this._order.indexOf(o);this._order.splice(b,1);let S=this._order.length;if(d){const T=this._order.indexOf(d);
25if(T===-1)return void this.fire(new a.y(new Error(`Layer with id "${d}" does not exist on this map.`)));_.slot&&_.slot!==this._layers[d].slot?a.w(`Layer with id "${d}" has a different slot. Layers can only be rearranged within the same slot.`):S=T}this._order.splice(S,0,o),this._changes.setDirty(),this._handleLayerOrderChange(),this.mergeLayers()}removeLayer(o){this._checkLoaded();const d=this._checkLayer(o);if(!d)return;d.setEventedParent(null);const _=this._order.indexOf(o);this._order.splice(_,1),delete this._layers[o],this._changes.setDirty(),this._handleLayerOrderChange(),this._configDependentLayers.delete(d.fqid),this._indoorDependentLayers.delete(d.fqid),this._changes.removeLayer(d);const b=this.getOwnLayerSourceCache(d);if(b&&b.castsShadows){let S=!1;for(const T in this._layers)if(this._layers[T].source===d.source&&this._layers[T].canCastShadows()){S=!0;break}b.castsShadows=S}d.onRemove&&d.onRemove(this.map),this.mergeLayers()}getOwnLayer(o){return this._layers[o]}hasLayer(o){return o in this._mergedLayers}hasLayerType(o){for(const d in this._layers)if(this._layers[d].type===o)return!0;return!1}setLayerZoomRange(o,d,_){this._checkLoaded();const b=this._checkLayer(o);b&&(b.minzoom===d&&b.maxzoom===_||(d!=null&&(b.minzoom=d),_!=null&&(b.maxzoom=_),this._updateLayer(b)))}getSlots(){return this._checkLoaded(),this._mergedSlots}setSlot(o,d){this._checkLoaded();const _=this._checkLayer(o);_&&_.slot!==d&&(_.slot=d,this._updateLayer(_))}setFilter(o,d,_={}){this._checkLoaded();const b=this._checkLayer(o);if(b&&!a.b9(b.filter,d))return d==null?(b.filter=void 0,void this._updateLayer(b)):void(this._validate(dp,`layers.${b.id}.filter`,d,{layerType:b.type},_)||(b.filter=a.db(d),this._updateLayer(b)))}getFilter(o){const d=this._checkLayer(o);if(d)return a.db(d.filter)}setLayoutProperty(o,d,_,b={}){this._checkLoaded();const S=this._checkLayer(o);if(S&&!a.b9(S.getLayoutProperty(d),_)){if(_!=null&&(!b||b.validate!==!1)&&Ga(S,Oy.call(Ul,{key:`layers.${o}.layout.${d}`,layerType:S.type,objectKey:d,value:_,styleSpec:a.a6,style:{glyphs:!0,sprite:!0}})))return;S.setLayoutProperty(d,_),S.expressionDependencies.configDependencies.size!==0&&this._configDependentLayers.add(S.fqid),S.expressionDependencies.isIndoorDependent&&this._indoorDependentLayers.add(S.fqid),this._updateLayer(S)}}setLayerProperty(o,d,_,b={}){this._checkLoaded();const S=this._checkLayer(o);S&&(d==="appearances"?(S.setAppearances(_),this._updateLayer(S)):S.isPaintProperty(d)?this.setPaintProperty(o,d,_,b):this.setLayoutProperty(o,d,_,b))}getLayoutProperty(o,d){const _=this._checkLayer(o);if(_)return _.getLayoutProperty(d)}setPaintProperty(o,d,_,b={}){this._checkLoaded();const S=this._checkLayer(o);if(!S||a.b9(S.getPaintProperty(d),_)||_!=null&&(!b||b.validate!==!1)&&Ga(S,Km.call(Ul,{key:`layers.${o}.paint.${d}`,layerType:S.type,objectKey:d,value:_,styleSpec:a.a6})))return;const T=S.setPaintProperty(d,_);S.expressionDependencies.configDependencies.size!==0&&this._configDependentLayers.add(S.fqid),S.expressionDependencies.isIndoorDependent&&this._indoorDependentLayers.add(S.fqid),T&&this._updateLayer(S),this._changes.updatePaintProperties(S)}getPaintProperty(o,d){const _=this._checkLayer(o);if(_)return _.getPaintProperty(d)}setFeatureState(o,d){if(this._checkLoaded(),"target"in o){if("featuresetId"in o.target){const{featuresetId:k,importId:F}=o.target,z=this.getFragmentStyle(F),q=z.getFeaturesetLayers(k);for(const{source:j,sourceLayer:Z}of q)z.setFeatureState({id:o.id,source:j,sourceLayer:Z},d)}else if("layerId"in o.target){const{layerId:k}=o.target,F=this.getLayer(k);this.setFeatureState({id:o.id,source:F.source,sourceLayer:F.sourceLayer},d)}return}const _=o.source,b=o.sourceLayer,S=this._checkSource(_);if(!S)return;const T=S.type;if(T==="geojson"&&b)return void this.fire(new a.y(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if(T==="vector"&&!b)return void this.fire(new a.y(new Error("The sourceLayer parameter must be provided for vector source types.")));o.id===void 0&&this.fire(new a.y(new Error("The feature id parameter must be provided.")));const I=this.getOwnSourceCaches(_);for(const k of I)k.setFeatureState(b,o.id,d)}
25removeFeatureState(o,d){if(this._checkLoaded(),"target"in o){if("featuresetId"in o.target){const{featuresetId:k,importId:F}=o.target,z=this.getFragmentStyle(F),q=z.getFeaturesetLayers(k);for(const{source:j,sourceLayer:Z}of q)z.removeFeatureState({id:o.id,source:j,sourceLayer:Z},d)}else if("layerId"in o.target){const{layerId:k}=o.target,F=this.getLayer(k);this.removeFeatureState({id:o.id,source:F.source,sourceLayer:F.sourceLayer},d)}return}const _=o.source,b=this._checkSource(_);if(!b)return;const S=b.type,T=S==="vector"?o.sourceLayer:void 0;if(S==="vector"&&!T)return void this.fire(new a.y(new Error("The sourceLayer parameter must be provided for vector source types.")));if(d&&typeof o.id!="string"&&typeof o.id!="number")return void this.fire(new a.y(new Error("A feature id is required to remove its specific state property.")));const I=this.getOwnSourceCaches(_);for(const k of I)k.removeFeatureState(T,o.id,d)}getFeatureState(o){if(this._checkLoaded(),"target"in o){let S;if("featuresetId"in o.target){const{featuresetId:T,importId:I}=o.target,k=this.getFragmentStyle(I),F=k.getFeaturesetLayers(T);for(const{source:z,sourceLayer:q}of F){const j=k.getFeatureState({id:o.id,source:z,sourceLayer:q});if(j&&!S)S=j;else if(!a.b9(S,j))return void this.fire(new a.y(new Error("The same feature id exists in multiple sources in the featureset, but their feature states are not consistent through the sources.")))}}else if("layerId"in o.target){const{layerId:T}=o.target,I=this.getLayer(T);S=this.getFeatureState({id:o.id,source:I.source,sourceLayer:I.sourceLayer})}return S}const d=o.source,_=o.sourceLayer,b=this._checkSource(d);if(b){if(b.type!=="vector"||_)return o.id===void 0&&this.fire(new a.y(new Error("The feature id parameter must be provided."))),this.getOwnSourceCaches(d)[0].getFeatureState(_,o.id);this.fire(new a.y(new Error("The sourceLayer parameter must be provided for vector source types.")))}}setTransition(o){return this.stylesheet.transition=Object.assign({},this.stylesheet.transition,o),this.transition=this.stylesheet.transition,this}getTransition(){return Object.assign({},this.stylesheet.transition)}setWorldview(o){o!==this._worldview&&(this._worldview=o,this.dispatcher.broadcast("setWorldview",this._worldview),this.reloadSources())}serialize(){this._checkLoaded();const o=this.getTerrain(),d=o&&this.terrain&&this.terrain.scope===this.scope?o:this.stylesheet.terrain;return a.di({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,fragment:this.stylesheet.fragment,iconsets:this.stylesheet.iconsets,featuresets:this.stylesheet.featuresets,imports:this._serializeImports(),schema:this.stylesheet.schema,camera:this.stylesheet.camera,light:this.stylesheet.light,lights:this.stylesheet.lights,terrain:d,fog:this.stylesheet.fog,snow:this.stylesheet.snow,rain:this.stylesheet.rain,indoor:this.stylesheet.indoor,center:this.stylesheet.center,"color-theme":this.stylesheet["color-theme"],zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:this._serializeSources(),layers:this._serializeLayers(this._order)},_=>_!==void 0)}_updateFilteredLayers(o){for(const d of Object.values(this._mergedLayers))o(d)&&this._updateLayer(d)}_updateLayer(o){this._changes.updateLayer(o);const d=this.getLayerSourceCache(o),_=a.t(o.source,o.scope),b=this._changes.getUpdatedSourceCaches();o.source&&!b[_]&&d&&d.getSource().type!=="raster"&&(this._changes.updateSourceCache(_,"reload"),d.pause()),o.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(o){const d=I=>this._mergedLayers[I].is3D(!!this.terrain),_=this.order,b={},S=[];for(let I=_.length-1;I>=0;I--){const k=_[I];if(d(k)){b[k]=I;for(const F of o){const z=F[k];if(z)for(const q of z)S.push(q)}}}S.sort((I,k)=>k.intersectionZ-I.intersectionZ);const T=[];for(let I=_.length-1;I>=0;I--){const k=_[I];if(d(k))for(let F=S.length-1;F>=0;F--){const z=S[F].feature;if(z.layer&&b[z.layer.id]<I)break;T.push(z),S.pop()}else for(const F of o){const z=F[k];if(z)for(const q of z)T.push(q.feature)}}return T}queryRasterValue(o,d,_){const b=this.getOwnSource(o);return b?b.type!=="raster-array"?(this.fire(new a.y(new Error('queryRasterValue support only "raster-array" sources.'))),Promise.resolve(null)):b.queryRasterArrayValue(d,_):(this.fire(new a.y(new Error(`Source with i
25d "${o}" does not exist in the style.`))),Promise.resolve(null))}queryRenderedFeatures(o,d,_){let b;d&&!Array.isArray(d)&&d.filter&&(this._validate(dp,"queryRenderedFeatures.filter",d.filter,null,d),b=a.dj(d.filter));const S={},T=z=>{if(Pp.has(z.type))return;const q=this.getOwnLayerSourceCache(z),j=S[q.id]=S[q.id]||{sourceCache:q,layers:{},has3DLayers:!1};z.is3D(!!this.terrain)&&(j.has3DLayers=!0),j.layers[z.fqid]=j.layers[z.fqid]||{styleLayer:z,targets:[]},j.layers[z.fqid].targets.push({filter:b})};if(d&&d.layers){if(!Array.isArray(d.layers))return this.fire(new a.y(new Error("parameters.layers must be an Array."))),[];for(const z of d.layers){const q=this._layers[z];if(!q)return this.fire(new a.y(new Error(`The layer '${z}' does not exist in the map's style and cannot be queried for features.`))),[];T(q)}}else for(const z in this._layers)T(this._layers[z]);const I=this._queryRenderedFeatures(o,S,_),k=this._flattenAndSortRenderedFeatures(I),F=[];for(const z of k)a.dk(z.layer.id)===this.scope&&F.push(z);return F}queryRenderedFeatureset(o,d,_){let b;d&&!Array.isArray(d)&&d.filter&&(this._validate(dp,"queryRenderedFeatures.filter",d.filter,null,d),b=a.dj(d.filter));const S="mock",T=[];if(d&&d.target)T.push(Object.assign({},d,{targetId:S,filter:b}));else{const z=this.getFeaturesetDescriptors();for(const q of z)T.push({targetId:S,filter:b,target:q});for(const{style:q}of this.fragments){const j=q.getFeaturesetDescriptors();for(const Z of j)T.push({targetId:S,filter:b,target:Z})}}const I=this.queryRenderedTargets(o,T,_),k=[],F=new Set;for(const z of I)for(const q of z.variants[S])f1(q,z,F)||k.push(new a.dl(z,q));return k}queryRenderedTargets(o,d,_){const b={},S=(I,k,F,z)=>{const q=b[k.id]=b[k.id]||{sourceCache:k,layers:{},has3DLayers:!1};if(q.layers[I.fqid]=q.layers[I.fqid]||{styleLayer:I,targets:[]},I.is3D(!!this.terrain)&&(q.has3DLayers=!0),!z)return F.uniqueFeatureID=!1,void q.layers[I.fqid].targets.push(F);q.layers[I.fqid].targets.push(Object.assign({},F,{namespace:z.namespace,properties:z.properties,uniqueFeatureID:z.uniqueFeatureID}))};for(const I of d)if("featuresetId"in I.target){const{featuresetId:k,importId:F}=I.target,z=this.getFragmentStyle(F);if(!z||!z._featuresetSelectors)continue;const q=z._featuresetSelectors[k];if(!q){this.fire(new a.y(new Error(`The featureset '${k}' does not exist in the map's style and cannot be queried for features.`)));continue}for(const j of q){const Z=z.getOwnLayer(j.layerId);Z&&!Pp.has(Z.type)&&S(Z,z.getOwnLayerSourceCache(Z),I,j)}}else if("layerId"in I.target){const{layerId:k}=I.target,F=this.getLayer(k);if(!F||Pp.has(F.type))continue;S(F,this.getLayerSourceCache(F),I)}const T=this._queryRenderedFeatures(o,b,_);return this._flattenAndSortRenderedFeatures(T)}_queryRenderedFeatures(o,d,_){const b=[],S=!!this.map._showQueryGeometry,T=fl.createFromScreenPoints(o,_);for(const I in d){const k=p1(T,d[I],this._availableImages,_,S,this.getActualScope());Object.keys(k).length&&b.push(k)}if(this.placement)for(const I in d){if(d[I].sourceCache._renderSourceType!==a.b7.Symbol)continue;const k=ig(T.screenGeometry,d[I],this._availableImages,this.placement.collisionIndex,this.placement.retainedQueryData,this.map.getWorldview());Object.keys(k).length&&b.push(k)}return b}querySourceFeatures(o,d){const _=d&&d.filter;_&&this._validate(dp,"querySourceFeatures.filter",_,null,d);let b=[];const S=this.getOwnSourceCaches(o);for(const T of S)b=b.concat(pl(T,d));return b}addSourceType(o,d,_){return ta.getSourceType(o)?_(new Error(`A source type called "${o}" already exists.`)):(ta.setSourceType(o,d),_(null,null))}getFlatLight(){return this.light.getLight()}setFlatLight(o,d,_={}){this._checkLoaded();const b=this.light.getLight();let S=!1;for(const I in o)if(!a.b9(o[I],b[I])){S=!0;break}if(!S)return;const T=this._getTransitionParameters();this.light.setLight(o,d,_),this.light.updateTransitions(T)}getTerrain(){return this.terrain&&this.terrain.drapeRenderMode===1?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}checkCanvasFingerprintNoise(){this.disableElevatedTerrain===void 0&&(this.disableElevatedTerrain=a.o.hasCanvasFingerprintNoise(),this.disableElevatedTerrain&&a.w("Terrain and hillshade are disabled because of Canvas2D limitations when fingerprinting protection is enabled (e.g. in private browsing mode)."))}setTerrain(o,d=1){if(this._checkLoaded(),!o)return this.terrainSetForDrapingOnly()||(delete this.terrain,this.map.transform.projection.requiresDraping&&this.setTerrainForDraping()),d===0&&delete this.terrain,o===null?this.stylesheet.terrain=null:delete this.stylesheet.terrain,this._force3DLayerUpdate(),void(this._markersNeedU
25pdate=!0);this.checkCanvasFingerprintNoise();let _=o;const b=!("source"in o)||o.source==null;if(d===1){if(this.disableElevatedTerrain)return;if("source"in _&&typeof _.source=="object"){const I="terrain-dem-src";this.addSource(I,_.source),_=a.db(_),_=Object.assign(_,{source:I})}const S=Object.assign({},_),T={};if(this.terrain&&b){S.source=this.terrain.get().source;const I=this.terrain?this.getFragmentStyle(this.terrain.scope):null;I&&(T.style=I.serialize())}if(this._validate(i1,"terrain",S,T))return}if(!this.terrain||this.terrain.scope!==this.scope&&!b||this.terrain&&d!==this.terrain.drapeRenderMode){if(!_)return;this._createTerrain(_,d),this.fire(new a.z("data",{dataType:"style"}))}else{const S=this.terrain,T=S.get();for(const I of Object.keys(a.a6.terrain))!Object.hasOwn(_,I)&&a.a6.terrain[I].default&&(_[I]=a.a6.terrain[I].default);for(const I in o)if(!a.b9(o[I],T[I])){S.set(o,this.options),this.stylesheet.terrain=o;const k=this._getTransitionParameters({duration:0});S.updateTransitions(k),this.fire(new a.z("data",{dataType:"style"}));break}}this.mergeTerrain(),this.updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(o){const d=this.fog=new fp(o,this.map.transform,this.scope,this.options);this.stylesheet.fog=d.get();const _=this._getTransitionParameters({duration:0});d.updateTransitions(_)}_createSnow(o){const d=this.snow=new u2(o,this.map.transform,this.scope,this.options);this.stylesheet.snow=d.get();const _=this._getTransitionParameters({duration:0});d.updateTransitions(_)}_createRain(o){const d=this.rain=new Qm(o,this.map.transform,this.scope,this.options);this.stylesheet.rain=d.get();const _=this._getTransitionParameters({duration:0});d.updateTransitions(_)}_updateMarkersOpacity(){this.map._markers.length!==0&&this.map._requestDomTask(()=>{for(const o of this.map._markers)o._evaluateOpacity()})}getFog(){return this.fog?this.fog.get():null}setFog(o){if(this._checkLoaded(),o)if(this.fog){const d=this.fog;if(!a.b9(d.get(),o)){d.set(o,this.options),this.stylesheet.fog=d.get();const _=this._getTransitionParameters({duration:0});d.updateTransitions(_)}}else this._createFog(o);else delete this.fog,delete this.stylesheet.fog;this._markersNeedUpdate=!0,this._programPrecompiler&&this._programPrecompiler.reset()}getSnow(){return this.snow?this.snow.get():null}setSnow(o){if(this._checkLoaded(),!o)return delete this.snow,void delete this.stylesheet.snow;if(this.snow){const d=this.snow;if(!a.b9(d.get(),o)){d.set(o,this.options),this.stylesheet.snow=d.get();const _=this._getTransitionParameters({duration:0});d.updateTransitions(_)}}else this._createSnow(o);this._markersNeedUpdate=!0}getRain(){return this.rain?this.rain.get():null}setRain(o){if(this._checkLoaded(),!o)return delete this.rain,void delete this.stylesheet.rain;if(this.rain){const d=this.rain;if(!a.b9(d.get(),o)){d.set(o,this.options),this.stylesheet.rain=d.get();const _=this._getTransitionParameters({duration:0});d.updateTransitions(_)}}else this._createRain(o);this._markersNeedUpdate=!0}_reloadColorTheme(){const o=()=>{for(const b in this._layers)this._layers[b].lut=this._styleColorTheme.lut;for(const b in this._sourceCaches)this._sourceCaches[b].clearTiles()},d=this._styleColorTheme.colorThemeOverride?this._styleColorTheme.colorThemeOverride:this._styleColorTheme.colorTheme;if(!d)return this._styleColorTheme.lut=null,void o();const _=this._evaluateColorThemeData(d);this._loadColorTheme(_).then(()=>{this.fire(new a.z("colorthemeset")),o()}).catch(b=>{a.w(`Couldn't set color theme: ${b}`)})}setColorTheme(o){this._checkLoaded(),this._styleColorTheme.colorThemeOverride&&a.w("Note: setColorTheme is called on a style with a color-theme override, the passed color-theme won't be visible."),this._styleColorTheme.colorTheme=o,this._reloadColorTheme()}setImportColorTheme(o,d){const _=this.getFragmentStyle(o);_&&(_._styleColorTheme.colorThemeOverride=d,_._reloadColorTheme())}_getTransitionParameters(o){return{now:a.o.now(),transition:Object.assign(this.transition,o)}}updateDrapeFirstLayers(){if(!this.terrain)return;const o=[],d=[];for(const _ of this._mergedOrder)this.isLayerDraped(this._mergedLayers[_])?o.push(_):d.push(_);this._drapedFirstOrder=[],this._drapedFirstOrder.push(...o),this._drapedFirstOrder.push(...d)}_createTerrain(o,d){const _=this.terrain=new pd(o,d,this.scope,this.options,this.map.getWorldview());d===1&&(this.stylesheet.terrain=o),this.mergeTerrain(),this.updateDrapeFirstLayers(),this._force3DLayerUpdate();const b=this._getTransitionParameters({duration:0});_.updateTransitions(b)}_force3DLayerUpdate(){for(const o in this._layers){const d=this._layers[o];
25d.type==="fill-extrusion"&&this._updateLayer(d)}}_forceSymbolLayerUpdate(){for(const o in this._layers){const d=this._layers[o];d.type==="symbol"&&this._updateLayer(d)}}_validate(o,d,_,b,S={}){if(S&&S.validate===!1)return!1;const T=Object.assign({},this.serialize());return Ga(this,o.call(Ul,Object.assign({key:d,style:T,value:_,styleSpec:a.a6},b)))}_remove(){this._programPrecompiler&&(this._programPrecompiler.reset(),this._programPrecompiler=null),this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),a.dm.off("pluginStateChange",this._rtlTextPluginCallback);for(const o in this._mergedLayers)this._mergedLayers[o].setEventedParent(null);for(const o in this._mergedSourceCaches){const d=this._mergedSourceCaches[o];d.clearTiles(),d.setEventedParent(null);const _=d.getSource();_&&_.onRemove&&_.onRemove(this.map)}this.imageManager.removeScope(this.scope),this.imageManager.imageAtlasCache.clear(),this.setEventedParent(null),delete this.fog,delete this.snow,delete this.rain,delete this.terrain,delete this.ambientLight,delete this.directionalLight,this.indoorManager.destroy(),this.isRootStyle()&&(this.imageManager.setEventedParent(null),this.modelManager.setEventedParent(null),this.modelManager.destroy(),this.dispatcher.remove())}clearSource(o){const d=this.getSourceCaches(o);for(const _ of d)_.clearTiles()}clearSources(){for(const o in this._mergedSourceCaches)this._mergedSourceCaches[o].clearTiles()}clearLayers(){for(const o in this._mergedLayers){const d=this._mergedLayers[o];d._clear&&d._clear()}}reloadSource(o){const d=this.getSourceCaches(o);for(const _ of d)_.resume(),_.reload()}
25reloadSources(){for(const o of this.getSources())o.reload&&o.reload()}reloadModels(){this.modelManager.reloadModels(""),this.forEachFragmentStyle(o=>{o.modelManager.reloadModels(o.scope)})}updateSources(o){let d;this.directionalLight&&(d=hg(this.directionalLight));const _=new Set,b=new Set,S=new Set;for(const T in this._mergedLayers){const I=this._mergedLayers[T];I.type==="building"?_.add(I.source):I.type==="raster"&&I.paint&&I.paint.get("raster-elevation-reference")==="ground"&&S.add(I.source),I.hasElevation()&&!b.has(I.source)&&b.add(I.source)}for(const T in this._mergedSourceCaches){const I=this._mergedSourceCaches[T],k=b.has(I._source.id);I._isRasterElevatedOverTerrain=S.has(I._source.id),_.has(I._source.id)&&(I._source.reparseOverscaled=!1),I.update(o,void 0,void 0,d,k)}}_reloadSources(){for(const o in this._sourceCaches){const d=this._sourceCaches[o];d.resume(),d.reload()}}_handleLayerOrderChange(){this._requestFullLabelPlacement(),this.fire(new a.z("neworder"))}_requestFullLabelPlacement(){this.pauseablePlacement||(this.pauseablePlacement=new w1),this.pauseablePlacement.requestFullPlacement()}_setLabelPlacementStale(){this.placement&&this.placement.setStale()}_updatePlacement(o,d,_,b,S){this.pauseablePlacement||(this.pauseablePlacement=new w1);let T=!1,I=!1;const k={},F={};for(const ee of this._mergedOrder){const oe=this._mergedLayers[ee];if(oe.type!=="symbol")continue;const se=a.t(oe.source,oe.scope);let de=k[se];if(!de){const ce=this.getLayerSourceCache(oe);if(!ce)continue;const Ce=ce.getRenderableIds(!0).map(Se=>ce.getTileByID(Se));F[se]=Ce.slice(),de=k[se]=Ce.sort((Se,Re)=>Re.tileID.overscaledZ-Se.tileID.overscaledZ||(Se.tileID.isLessThan(Re.tileID)?-1:1))}const pe=this.crossTileSymbolIndex.addLayer(oe,de,o.center.lng,o.projection);T=T||pe}this.crossTileSymbolIndex.pruneUnusedLayers(this._mergedOrder);const z=!!(this.placement&&!o.equals(this.placement.transform)),q=!!(this.placement&&(this.placement.lastReplacementSourceUpdateTime!==0&&!S||this.placement.lastReplacementSourceUpdateTime!==S.updateTime)),j=z||q||T,Z=(j||this.pauseablePlacement.isStale())&&_===0,te=this.pauseablePlacement.isDone()&&!this.placement.stillRecent(a.o.now(),o.zoom)&&_!==0;if((this.pauseablePlacement.isFullPlacementRequested()||!this.pauseablePlacement.placement||Z||te)&&(this.pauseablePlacement=this.pauseablePlacement.startNewPlacement(o,this._mergedOrder,d,_,b,this.placement,this.fog&&o.projection.supportsFog?this.fog.state:null,this._buildingIndex),this.map.painter)){const ee=this.map.painter.maxFrontCutoffRawStart;if(ee>0){const oe=180*o.pitch/Math.PI;if(oe>=15){const se=Math.min(1,Math.max(0,(oe-15)/5)),de=se*se*(3-2*se);this.pauseablePlacement.placement.frontCutoffStart=-.5*(1-de)+ee*de}}}if(this.pauseablePlacement.isDone()?j&&_!==0&&this.pauseablePlacement.setStale():(this.pauseablePlacement.continuePlacement(this._mergedOrder,this._mergedLayers,k,F,this.map.painter.scaleFactor),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(a.o.now()),I=!0),T&&this.pauseablePlacement.setStale()),I||T){this._buildingIndex.onNewFrame(o.zoom);for(let ee=0;ee<this._mergedOrder.length;ee++){const oe=this._mergedLayers[this._mergedOrder[ee]];if(oe.type!=="symbol"||oe.visibility==="none")continue;const se=this.isLayerClipped(oe);this.placement.updateLayerOpacities(oe,k[a.t(oe.source,oe.scope)],ee,se?S:null)}}return!this.pauseablePlacement.isDone()||this.placement.isStale()||this.placement.hasTransitions(a.o.now())}_releaseSymbolFadeTiles(){for(const o in this._sourceCaches)this._sourceCaches[o].releaseSymbolFadeTiles()}addImport(o,d){this._checkLoaded();const _=this.stylesheet.imports=this.stylesheet.imports||[];if(_.findIndex(({id:S})=>S===o.id)!==-1)return void this.fire(new a.y(new Error(`Import with id '${o.id}' already exists in the map's style.`)));if(!d)return _.push(o),this._loadImports([o],!0);const b=_.findIndex(({id:S})=>S===d);return b===-1&&this.fire(new a.y(new Error(`Import with id "${d}" does not exist on this map.`))),this.stylesheet.imports=_.slice(0,b).concat(o).concat(_.slice(b)),this._loadImports([o],!0,d)}updateImport(o,d){this._checkLoaded();const _=this.stylesheet.imports||[],b=this.getImportIndex(o);
25return b===-1?this:typeof d=="string"?(this.setImportUrl(o,d),this):(d.url&&d.url!==_[b].url&&this.setImportUrl(o,d.url),a.b9(d.config,_[b].config)||this.setImportConfig(o,d.config,d.data.schema),a.b9(d.data,_[b].data)||this.setImportData(o,d.data),this)}moveImport(o,d){this._checkLoaded();let _=this.stylesheet.imports||[];const b=this.getImportIndex(o);if(b===-1)return this;const S=this.getImportIndex(d);if(S===-1)return this;const T=_[b],I=this.fragments[b];return _=_.filter(({id:k})=>k!==o),this.fragments=this.fragments.filter(({id:k})=>k!==o),this.stylesheet.imports=_.slice(0,S).concat(T).concat(_.slice(S)),this.fragments=this.fragments.slice(0,S).concat(I).concat(this.fragments.slice(S)),this.mergeLayers(),this}setImportUrl(o,d){this._checkLoaded();const _=this.stylesheet.imports||[],b=this.getImportIndex(o);if(b===-1)return this;_[b].url=d;const S=this.fragments[b];return S.style=this._createFragmentStyle(_[b]),S.style.on("style.import.load",()=>this.mergeAll()),S.style.loadURL(d),this}setImportData(o,d){this._checkLoaded();const _=this.getImportIndex(o),b=this.stylesheet.imports||[];return _===-1?this:d?(this.fragments[_].style.setState(d),this._reloadImports(),this):(delete b[_].data,this.setImportUrl(o,b[_].url))}setImportConfig(o,d,_){this._checkLoaded();const b=this.getImportIndex(o),S=this.stylesheet.imports||[];if(b===-1)return this;d?S[b].config=d:delete S[b].config;const T=this.fragments[b];_&&T.style.stylesheet&&(T.style.stylesheet.schema=_);const I=T.style.stylesheet&&T.style.stylesheet.schema;return T.config=d,T.style.updateConfig(d,I),this.updateConfigDependencies(),this}removeImport(o){this._checkLoaded();const d=this.stylesheet.imports||[],_=this.getImportIndex(o);_!==-1&&(d.splice(_,1),this.fragments[_].style._remove(),this.fragments.splice(_,1),this._reloadImports())}getImportIndex(o){const d=(this.stylesheet.imports||[]).findIndex(_=>_.id===o);return d===-1&&this.fire(new a.y(new Error(`Import '${o}' does not exist in the map's style and cannot be updated.`))),d}getLayer(o){return this._mergedLayers[o]}getSources(){const o=[];for(const d in this._mergedOtherSourceCaches){const _=this._mergedOtherSourceCaches[d];_&&o.push(_.getSource())}return o}getSource(o,d){const _=this.getSourceCache(o,d);return _&&_.getSource()}getLayerSource(o){const d=this.getLayerSourceCache(o);return d&&d.getSource()}getSourceCache(o,d){const _=a.t(o,d);return this._mergedOtherSourceCaches[_]}getLayerSourceCache(o){const d=a.t(o.source,o.scope);return o.type==="symbol"?this._mergedSymbolSourceCaches[d]:o.type==="fill-extrusion"&&this._mergedFillExtrusionSourceCaches[d]||this._mergedOtherSourceCaches[d]}getSourceCaches(o){if(o==null)return Object.values(this._mergedSourceCaches);const d=[];return this._mergedOtherSourceCaches[o]&&d.push(this._mergedOtherSourceCaches[o]),this._mergedSymbolSourceCaches[o]&&d.push(this._mergedSymbolSourceCaches[o]),this._mergedFillExtrusionSourceCaches[o]&&d.push(this._mergedFillExtrusionSourceCaches[o]),d}updateSourceCaches(){const o=this._changes.getUpdatedSourceCaches();for(const d in o){const _=o[d];_==="reload"?this.reloadSource(d):_==="clear"&&this.clearSource(d)}}updateLayers(o){const d=this._changes.getUpdatedPaintProperties();for(const _ of d){const b=this.getLayer(_);b&&b.updateTransitions(o)}}getGlyphsUrl(){return this.stylesheet.glyphs}setGlyphsUrl(o){this.stylesheet.glyphs=o,this.glyphManager.setURL(o)}getImages(o,d,_){this.imageManager.getImages(d.icons.concat(d.patterns),d.scope,_),this._updateTilesForChangedImages();const b=d.icons.map(k=>a.I.toString(k)),S=d.patterns.map(k=>a.I.toString(k)),T=k=>{k&&(k.setDependencies(d.tileID.key,"icons",b),k.setDependencies(d.tileID.key,"patterns",S))},I=a.t(d.source,d.scope);T(this._mergedOtherSourceCaches[I]),T(this._mergedSymbolSourceCaches[I]),(d.icons.some(k=>k.iconsetId)||d.patterns.some(k=>k.iconsetId))&&this.fire(new a.z("data",{dataType:"style"}))}rasterizeImages(o,d,_){this.imageManager.rasterizeImages(d,_)}checkAtlasCache(o,d,_){const b=this.imageManager.imageAtlasCache.findCachedAtlas(d.descriptor);_(null,b&&b.contentDescriptor?{iconPositions:b.iconPositions,patternPositions:b.patternPositions,sourceHash:b.contentDescriptor.hash}:null)}getGlyphs(o,d,_){this.glyphManager.getGlyphs(d.stacks,_)}getOwnSourceCache(o){return this._otherSourceCaches[o]}getOwnLayerSourceCache(o){return o.type==="symbol"?this._symbolSourceCaches[o.source]:o.type==="fill-extrusion"&&this._fillExtrusionSourceCaches[o.source]||this._otherSourceCaches[o.source]}getOwnSourceCaches(o){const d=[];return this._otherSourceCaches[o]&&d.push(this._otherSourceCaches[o]),this._symbolSourceCaches[o]&&d.push(this._symbolSourceCaches[o]),this._fillExtrusionSourceCaches[o]&&d.push(this._fillExtrusionSourceCaches[o]),d}_isSourceCacheLoaded(o){const d=this.getOwnSourceCaches(o);return d.length===0?(this.fire(new a.y(new Error(`There is no source with ID '${o}'`))),!1):d.every(_=>_.loaded())}has3DLayers(){return this._has3DLayers}hasSymbolLayers(){return this._hasSymbolLayers}hasCircleLayers(){return this._hasCircleLayers}isLayerClipped(o,d){if(!this._clipLayerPresent&&o.type!=="fill-extrusion"&&o.type!=="building")return!1;const _=o.type==="fill-extrusion"&&(o.sourceLayer==="building"||o.sourceLayer==="procedural_buildings"),b=o.type==="building";if(o.is3D(!!this.terrain)){if(_||b||d&&d.type==="batched-model"||o.type==="model")return!0}else if(o.type==="symbol")return!0;return!1}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}getBOMObject(){}destroy(){this._clearWorkerCaches(),this.imageManager.imageAtlasCache.clear(),this.fragments.forEac
25h(o=>{o.style._remove()}),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}ta.getSourceType=function(p){return xr[p]},ta.setSourceType=function(p,o){xr[p]=o},ta.registerForPluginStateChange=a.dn;var kp=` 26#define EPSILON 0.0000001 27#define PI 3.141592653589793 28#ifdef RENDER_CUTOFF 29float cutoff_opacity(vec4 cutoff_params,float depth) {float near=cutoff_params.x;float far=cutoff_params.y;float cutoffStart=cutoff_params.z;float cutoffEnd=cutoff_params.w;float linearDepth=(depth-near)/(far-near);return clamp((linearDepth-cutoffStart)/(cutoffEnd-cutoffStart),0.0,1.0);} 30#endif`,Mp=` 31#ifdef DUAL_SOURCE_BLENDING 32layout(location=0,index=0) out vec4 glFragColor;layout(location=0,index=1) out vec4 glFragColorSrc1; 33#elif defined(FLOAT_RENDER_TARGET) 34layout(location=0) out highp vec4 glFragColor; 35#else 36layout(location=0) out vec4 glFragColor; 37#endif 38#ifdef USE_MRT1 39layout(location=1) out vec4 out_Target1; 40#endif 41highp float unpack_depth(highp vec4 rgba_depth) 42{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;} 43#ifdef INDICATOR_CUTOUT 44uniform vec3 u_indicator_cutout_centers;uniform vec4 u_indicator_cutout_params; 45#endif 46const float DITHER_THRESHOLDS[16]=float[16]( 471.0/17.0, 9.0/17.0, 3.0/17.0,11.0/17.0,13.0/17.0, 5.0/17.0,15.0/17.0, 7.0/17.0,4.0/17.0,12.0/17.0, 2.0/17.0,10.0/17.0,16.0/17.0, 8.0/17.0,14.0/17.0, 6.0/17.0 48);vec4 applyCutout(vec4 color,float height) { 49#ifdef INDICATOR_CUTOUT 50float verticalFadeRange=u_indicator_cutout_centers.z*0.25;float holeMinOpacity=mix(1.0,u_indicator_cutout_params.x,smoothstep(u_indicator_cutout_centers.z,u_indicator_cutout_centers.z+verticalFadeRange,height));float holeRadius=max(u_indicator_cutout_params.y,0.0);float holeAspectRatio=u_indicator_cutout_params.z;float fadeStart=u_indicator_cutout_params.w;float distA=distance(vec2(gl_FragCoord.x,gl_FragCoord.y*holeAspectRatio),vec2(u_indicator_cutout_centers[0],u_indicator_cutout_centers[1]*holeAspectRatio));return color*min(smoothstep(fadeStart,holeRadius,distA)+holeMinOpacity,1.0); 51#else 52return color; 53#endif 54}float cutoutGroundRoofOpacity(vec4 groundRoof) { 55#ifdef INDICATOR_CUTOUT 56float fadeStartX=u_indicator_cutout_params.w;float holeRadius=u_indicator_cutout_params.y;float holeMinOpacity=mix(u_indicator_cutout_params.x,1.0,smoothstep(u_indicator_cutout_params.z,u_indicator_cutout_centers.z,groundRoof.y));float distX=abs(u_indicator_cutout_centers.x-groundRoof.x);float roofOpacity=mix(holeMinOpacity,1.0,smoothstep(fadeStartX,holeRadius,u_indicator_cutout_centers.y-groundRoof.w));float groundOpacity=min(smoothstep(fadeStartX,holeRadius,distX)+holeMinOpacity,1.0);return max(roofOpacity,groundOpacity); 57#else 58return 1.0; 59#endif 60} 61#ifdef DEBUG_WIREFRAME 62#define HANDLE_WIREFRAME_DEBUG \\ 63glFragColor=vec4(0.7,0.0,0.0,0.7); \\ 64gl_FragDepth=gl_FragCoord.z-0.0001; 65#else 66#define HANDLE_WIREFRAME_DEBUG 67#endif 68#ifdef RENDER_CUTOFF 69uniform highp vec4 u_cutoff_params;in float v_cutoff_opacity; 70#endif 71vec4 textureLodCustom(sampler2D image,highp vec2 pos,highp vec2 lod_coord) {highp vec2 size=vec2(textureSize(image,0));highp vec2 dx=dFdx(lod_coord.xy*size);highp vec2 dy=dFdy(lod_coord.xy*size);highp float delta_max_sqr=max(dot(dx,dx),dot(dy,dy));highp float lod=0.5*log2(delta_max_sqr);return textureLod(image,pos,lod);}vec4 premultiplyColor(vec3 nonPremultipliedColor,float a) {return vec4(nonPremultipliedColor*a,a);}vec3 unpremultiplyColor(vec4 premultipliedColor) {if (premultipliedColor.a > 0.0) {return premultipliedColor.rgb/premultipliedColor.a;}return premultipliedColor.rgb;}vec3 applyLUT(highp sampler3D lut,vec3 col) {vec3 size=vec3(textureSize(lut,0));vec3 uvw=(col.rbg*float(size-1.0)+0.5)/size;return texture(lut,uvw).rgb;}vec4 applyLUT(highp sampler3D lut,vec4 premultipliedColor) {return premultiplyColor(applyLUT(lut,unpremultiplyColor(premultipliedColor)),premultipliedColor.a);}`,Gh=` 72#define EXTENT 8192.0 73#define RAD_TO_DEG 180.0/PI 74#define DEG_TO_RAD PI/180.0 75#define GLOBE_RADIUS EXTENT/PI/2.0 76float wrap(float n,float min,float max) {float d=max-min;
76float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;} 77#ifdef PROJECTION_GLOBE_VIEW 78vec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) { 79#ifndef PROJECTED_POS_ON_VIEWPORT 80float tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz; 81#else 82return vec3(0.0); 83#endif 84}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);} 85#endif 86vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec4 decode_color(const vec2 encodedColor) {return vec4( 87unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 88);}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 vec2 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 (units_to_pixels*pos+offset)/pattern_size;}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) {return get_pattern_pos(pixel_coord_upper,pixel_coord_lower,pattern_size,vec2(tile_units_to_pixels),pos);}float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(PI/4.0+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);} 89#ifdef RENDER_CUTOFF 90uniform vec4 u_cutoff_params;out float v_cutoff_opacity; 91#endif 92const vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);const float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(ivec2 posWithComposedSkirt) 93{float skirt=float(float(posWithComposedSkirt.x) >=skirtOffset);vec2 pos=vec2(posWithComposedSkirt)-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);} 94#ifndef HAS_SHADER_STORAGE_BLOCK_material_buffer 95#define GET_ATTRIBUTE_float(attrib,matInfo,attrib_id) attrib 96#define GET_ATTRIBUTE_vec4(attrib,matInfo,attrib_id) attrib 97#define GET_ATTRIBUTE_vec2(attrib,matInfo,attrib_id) attrib 98#define DECLARE_MATERIAL_TABLE_INFO 99#endif`,e0="in highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;out highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",t0=` 100#define ELEVATION_SCALE 7.0 101#define ELEVATION_OFFSET 450.0 102#ifdef PROJECTION_GLOBE_VIEW 103uniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix( 104mix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;} 105#else 106vec3 elevationVector(vec2 pos) { return vec3(0,0,1); } 107#endif 108#ifdef TERRAIN 109uniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float currentElevation(vec2 apos) { 110#ifdef TERRAIN_DEM_FLOAT_FORMAT 111vec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture(u_dem,pos).r; 112#else 113float dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(dd,0)).r;float bl=texture(u_dem,pos+vec2(0,dd)).r;float br=texture(u_dem,pos+vec2(dd,dd)).r;return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y); 114#endif 115}float prevElevation(vec2 apos) { 116#ifdef TERRAIN_DEM_FLOAT_FORMAT 117vec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture(u_dem_prev,pos).r; 118#else 119float dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=texture(u_dem_prev,pos).r;float tr=texture(u_dem_prev,pos+vec2(dd,0)).r;float bl=texture(u_dem_prev,pos+vec2(0,dd)).r;float br=texture(u_dem_prev,pos+vec2(dd,dd)).r;return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y); 120#endif 121} 122#ifdef TERRAIN_VERTEX_MORPHING 123float elevation(vec2 apos) { 124#ifdef ZERO_EXAGGERATION 125return 0.0; 126#endif 127float nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);} 128#else 129float elevation(vec2 apos) { 130#ifdef ZERO_EXAGGERATION 131return 0.0; 132#endif 133return currentElevation(apos);} 134#endif 135vec4 fourSample(vec2 pos,vec2 off) {float tl=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(off.x,0.0)).r;float bl=texture(u_dem,pos+vec2(0.0,off.y)).r;float br=texture(u_dem,pos+off).r;return vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);} 136#else 137float elevation(vec2 pos) { return 0.0; } 138#endif 139#ifdef DEPTH_OCCLUSION 140uniform highp sampler2D u_depth;uniform highp vec2 u_depth_size_inv;uniform highp vec2 u_depth_range_unpack;uniform highp float u_occluder_half_size;uniform highp float u_occlusion_depth_offset; 141#ifdef DEPTH_D24 142float unpack_depth(float depth) {return depth*u_depth_range_unpack.x+u_depth_range_unpack.y;}vec4 unpack_depth4(vec4 depth) {return depth*u_depth_range_unpack.x+vec4(u_depth_range_unpack.y);} 143#else 144highp float unpack_depth_rgba(vec4 rgba_depth) 145{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;} 146#endif 147bool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w; 148#ifdef CLIP_ZERO_TO_ONE 149coord.z=-1.0+2.0*coord.z; 150#endif 151#ifdef DEPTH_D24 152float depth=unpack_depth(texture(u_depth,(coord.xy+1.0)*0.5).r); 153#else 154float depth=unpack_depth_rgba(texture(u_depth,(coord.xy+1.0)*0.5)); 155#endif 156return coord.z+u_occlusion_depth_offset > depth;}highp vec4 getCornerDepths(vec2 coord) {highp vec3 df=vec3(u_occluder_half_size*u_depth_
156size_inv,0.0);highp vec2 uv=0.5*coord.xy+0.5; 157#ifdef DEPTH_D24 158highp vec4 depth=vec4( 159texture(u_depth,uv-df.xz).r,texture(u_depth,uv+df.xz).r,texture(u_depth,uv-df.zy).r,texture(u_depth,uv+df.zy).r 160);depth=unpack_depth4(depth); 161#else 162highp vec4 depth=vec4( 163unpack_depth_rgba(texture(u_depth,uv-df.xz)),unpack_depth_rgba(texture(u_depth,uv+df.xz)),unpack_depth_rgba(texture(u_depth,uv-df.zy)),unpack_depth_rgba(texture(u_depth,uv+df.zy)) 164); 165#endif 166return depth;}highp float occlusionFadeMultiSample(vec4 frag) {highp vec3 coord=frag.xyz/frag.w;highp vec2 uv=0.5*coord.xy+0.5; 167#ifdef CLIP_ZERO_TO_ONE 168coord.z=-1.0+2.0*coord.z; 169#endif 170int NX=3;int NY=4;highp vec2 df=u_occluder_half_size*u_depth_size_inv;highp vec2 oneStep=2.0*u_occluder_half_size*u_depth_size_inv/vec2(NX-1,NY-1);highp float res=0.0;for (int y=0; y < NY;++y) {for (int x=0; x < NX;++x) { 171#ifdef DEPTH_D24 172highp float depth=unpack_depth(texture(u_depth,uv-df+vec2(float(x)*oneStep.x,float(y)*oneStep.y)).r); 173#else 174highp float depth=unpack_depth_rgba(texture(u_depth,uv-df+vec2(float(x)*oneStep.x,float(y)*oneStep.y))); 175#endif 176res+=1.0-clamp(300.0*(coord.z+u_occlusion_depth_offset-depth),0.0,1.0);}}res=clamp(2.0*res/float(NX*NY)-0.5,0.0,1.0);return res;}highp float occlusionFade(vec4 frag) {highp vec3 coord=frag.xyz/frag.w; 177#ifdef CLIP_ZERO_TO_ONE 178coord.z=-1.0+2.0*coord.z; 179#endif 180highp vec4 depth=getCornerDepths(coord.xy);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z+u_occlusion_depth_offset)-depth),0.0,1.0));} 181#else 182bool isOccluded(vec4 frag) { return false; }highp float occlusionFade(vec4 frag) { return 1.0; }highp float occlusionFadeMultiSample(vec4 frag) { return 1.0; } 183#endif`,n0=`#ifdef FOG 184uniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;out vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);} 185#endif`,Ed=`#ifdef FOG 186uniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump vec2 u_fog_vertical_limit;uniform mediump float u_fog_temporal_offset;in vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport; 187#ifdef FLIP_Y 188uv.y=1.0-uv.y; 189#endif 190highp vec3 ray_dir=mix( 191mix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos,float opacity_limit) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,min(opacity,opacity_limit));}vec3 fog_apply(vec3 color,vec3 pos) {return fog_apply(color,pos,1.0);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}
191vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec4 fog_apply_premultiplied(vec4 color,vec3 pos,float heightMeters) {float verticalProgress=(u_fog_vertical_limit.x > 0.0 || u_fog_vertical_limit.y > 0.0) ? smoothstep(u_fog_vertical_limit.x,u_fog_vertical_limit.y,heightMeters) : 0.0;float opacityLimit=1.0-smoothstep(0.9,1.0,fog_opacity(pos));return mix(fog_apply_premultiplied(color,pos),color,min(verticalProgress,opacityLimit));}vec3 fog_dither(vec3 color) {return color;}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);} 192#endif`,pg=` 193#ifdef LIGHTING_3D_MODE 194uniform mediump vec3 u_lighting_ambient_color;uniform mediump vec3 u_lighting_directional_dir;uniform mediump vec3 u_lighting_directional_color;uniform mediump vec3 u_ground_radiance;float calculate_ambient_directional_factor(vec3 normal) {float NdotL=dot(normal,u_lighting_directional_dir);const float factor_reduction_max=0.3;float dir_luminance=dot(u_lighting_directional_color,vec3(0.2126,0.7152,0.0722));float directional_factor_min=1.0-factor_reduction_max*min(dir_luminance,1.0);float ambient_directional_factor=mix(directional_factor_min,1.0,min((NdotL+1.0),1.0));const float vertical_factor_min=0.92;float vertical_factor=mix(vertical_factor_min,1.0,normal.z*0.5+0.5);return vertical_factor*ambient_directional_factor;}vec3 linearProduct(vec3 srgbIn,vec3 k) {return srgbIn*pow(k,vec3(1./2.2));}vec3 apply_lighting(vec3 color,vec3 normal,float dir_factor) {float ambient_directional_factor=calculate_ambient_directional_factor(normal);vec3 ambient_contrib=ambient_directional_factor*u_lighting_ambient_color;vec3 directional_contrib=u_lighting_directional_color*dir_factor;return linearProduct(color,ambient_contrib+directional_contrib);}vec4 apply_lighting(vec4 color,vec3 normal,float dir_factor) {return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting(vec3 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return apply_lighting(color.rgb,normal,dir_factor);}vec4 apply_lighting(vec4 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting_ground(vec3 color) {return color*u_ground_radiance;}vec4 apply_lighting_ground(vec4 color) {return vec4(apply_lighting_ground(color.rgb),color.a);}float calculate_NdotL(vec3 normal) {const float ext=0.70710678118;return (clamp(dot(normal,u_lighting_directional_dir),-ext,1.0)+ext)/(1.0+ext);}vec4 apply_lighting_with_emission_ground(vec4 color,float emissive_strength) {return mix(apply_lighting_ground(color),color,emissive_strength);}vec3 compute_flood_lighting(vec3 flood_light_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=flood_light_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);float occlusion_ramp=smoothstep(0.0,0.2,1.0-occlusion);return mix(fully_occluded_color,flood_light_color,occlusion_ramp);}vec3 compute_emissive_draped(vec3 unlit_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=unlit_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);return mix(fully_occluded_color,unlit_color,1.0-occlusion);} 195#endif`,O1=`#ifdef RASTER_ARRAY 196uniform highp sampler2D u_image0;uniform sampler2D u_image1;const vec4 NODATA=vec4(1);ivec4 _raTexLinearCoord(highp vec2 texCoord,highp vec2 texResolution,out highp vec2 fxy) {texCoord=texCoord*texResolution-0.5;fxy=fract(texCoord);texCoord-=fxy;return ivec4(texCoord.xxyy+vec2(1.5,0.5).xyxy);}vec2 _raTexLinearMix(highp vec2 fxy,highp vec4 colorMix,highp float colorOffset,highp vec4 t00,highp vec4 t10,highp vec4 t01,highp vec4 t11) {vec2 c00=t00==NODATA ? vec2(0) : vec2(colorOffset+dot(t00,colorMix),1);vec2 c10=t10==NODATA ? vec2(0) : vec2(colorOffset+dot(t10,colorMix),1);vec2 c01=t01==NODATA ? vec2(0) : vec2(colorOffset+dot(t01,colorMix),1);vec2 c11=t11==NODATA ? vec2(0) : vec2(colorOffset+dot(t11,colorMix),1);return mix(mix(c01,c11,fxy.x),mix(c00,c10,fxy.x),fxy.y);}
196vec2 raTexture2D_image0_linear(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec2 fxy;ivec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texelFetch(u_image0,c.yz,0),texelFetch(u_image0,c.xz,0),texelFetch(u_image0,c.yw,0),texelFetch(u_image0,c.xw,0) 197);}vec2 raTexture2D_image1_linear(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec2 fxy;ivec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texelFetch(u_image1,c.yz,0),texelFetch(u_image1,c.xz,0),texelFetch(u_image1,c.yw,0),texelFetch(u_image1,c.xw,0) 198);}vec2 raTexture2D_image0_nearest(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec4 t=texelFetch(u_image0,ivec2(texCoord*texResolution),0);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);}vec2 raTexture2D_image1_nearest(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec4 t=texelFetch(u_image1,ivec2(texCoord*texResolution),0);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);} 199#endif`,D1=`#ifdef RENDER_SHADOWS 200uniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_normal_offset;vec3 shadow_normal_offset(vec3 normal) {float tileInMeters=u_shadow_normal_offset[0];vec3 n=vec3(-normal.xy,tileInMeters*normal.z);float dotScale=min(1.0-dot(normal,u_shadow_direction),1.0)*0.5+0.5;return n*dotScale;}vec3 shadow_normal_offset_model(vec3 normal) {vec3 transformed_normal=vec3(-normal.xy,normal.z);float NDotL=dot(normalize(transformed_normal),u_shadow_direction);float dotScale=min(1.0-NDotL,1.0)*0.5+0.5;return normal*dotScale;}float shadow_normal_offset_multiplier0() {return u_shadow_normal_offset[1];}float shadow_normal_offset_multiplier1() {return u_shadow_normal_offset[2];} 201#endif`,F1=`#ifdef RENDER_SHADOWS 202precision highp sampler2DShadow;uniform sampler2DShadow u_shadowmap_0;uniform sampler2DShadow u_shadowmap_1;uniform float u_shadow_intensity;uniform float u_shadow_map_resolution;uniform float u_shadow_texel_size;uniform highp vec3 u_shadow_normal_offset;uniform vec2 u_fade_range;uniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_bias;float shadow_sample(sampler2DShadow shadowmap,highp vec3 pos,highp float bias) { 203#ifdef CLIP_ZERO_TO_ONE 204highp vec3 coord=vec3(pos.xy*0.5+0.5,pos.z-bias); 205#else 206highp vec3 coord=vec3(pos.xy*0.5+0.5,pos.z*0.5+0.5-bias); 207#endif 208return texture(shadowmap,coord);}float shadow_occlusion(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth,highp float bias) {light_view_pos0.xyz/=light_view_pos0.w; 209#ifdef SHADOWS_SINGLE_CASCADE 210vec2 abs_bounds=abs(light_view_pos0.xy);if (abs_bounds.x >=1.0 || abs_bounds.y >=1.0) {return 0.0;}return shadow_sample(u_shadowmap_0,light_view_pos0.xyz,bias); 211#else 212light_view_pos1.xyz/=light_view_pos1.w;vec4 abs_bounds=abs(vec4(light_view_pos0.xy,light_view_pos1.xy));if (abs_bounds.x < 1.0 && abs_bounds.y < 1.0) {return shadow_sample(u_shadowmap_0,light_view_pos0.xyz,bias);}if (abs_bounds.z >=1.0 || abs_bounds.w >=1.0) {return 0.0;}float occlusion1=shadow_sample(u_shadowmap_1,light_view_pos1.xyz,bias);return clamp(mix(occlusion1,0.0,smoothstep(u_fade_range.x,u_fade_range.y,view_depth)),0.0,1.0); 213#endif 214}highp float calculate_shadow_bias(float NDotL) { 215#ifdef NORMAL_OFFSET 216return 0.5*u_shadow_bias.x; 217#else 218return 0.5*(u_shadow_bias.x+clamp(u_shadow_bias.y*tan(acos(NDotL)),0.0,u_shadow_bias.z)); 219#endif 220}float shadowed_light_factor_normal(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=calculate_shadow_bias(NDotL);float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor_normal_opacity(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth,float shadow_opacity) {float NDotL=dot(N,u_shadow_direction);float bias=calculate_shadow_bias(NDotL);float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias)*shadow_opacity;return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor_normal_unbiased(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}highp vec2 compute_receiver_plane_depth_bias(highp vec3 pos_dx,highp vec3 pos_dy) 221{highp vec2 biasUV=vec2( 222pos_dy.y*pos_dx.z-pos_dx.y*pos_dy.z,pos_dx.x*pos_dy.z-pos_dy.x*pos_dx.z);biasUV*=1.0/((pos_dx.x*pos_dy.y)-(pos_dx.y*pos_dy.x));return biasUV;}float shadowed_light_factor_plane_bias(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {highp vec3 light_view_pos0_xyz=light_view_pos0.xyz/light_view_pos0.w*0.5+0.5;highp vec3 light_view_pos0_ddx=dFdx(light_view_pos0_xyz);highp vec3 light_view_pos0_ddy=dFdy(light_view_pos0_xyz);highp vec2 plane_depth_bias=compute_receiver_plane_depth_bias(light_view_pos0_ddx,light_view_pos0_ddy);highp float bias=dot(vec2(u_shadow_texel_size,u_shadow_texel_size),plane_depth_bias)+0.0001;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return 1.0-(u_shadow_intensity*occlusion);}float shadowed_light_factor(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return 1.0-(u_shadow_intensity*occlusion);}float shadow_occlusion(float ndotl,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=calculate_shadow_bias(ndotl);return shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);} 223#endif`;
vendor: 9,998 bytes, lines 223-353
223const mg=/#include\s+"([^"]+)"/g,gg=/#pragma mapbox: ([\w\-]+) ([\w]+) ([\w]+) ([\w]+)/g,r0=/\b[A-Za-z_][A-Za-z0-9_]*\b/g,i0=new Set(["ifdef","ifndef","elif","if","defined"]),Lp=new Set;Pc(kp,Lp),Pc(Gh,Lp),Pc(Mp,Lp);const Hh={"_prelude_fog.vertex.glsl":n0,"_prelude_terrain.vertex.glsl":t0,"_prelude_shadow.vertex.glsl":D1,"_prelude_material_table.vertex.glsl":`#ifdef HAS_SHADER_STORAGE_BLOCK_material_buffer 224#define MATERIAL_TABLE_DEBUG 0 225uniform int u_material_offset;uniform int u_vertex_offset;layout(std140,binding=0)readonly buffer material_buffer{uvec4 material_data[];};struct MaterialInfo{uint dataOffset; 226#if MATERIAL_TABLE_DEBUG 227vec4 colorDebug; 228#endif 229};uint read_buf_no_offset(uint iDword) {return material_data[iDword/4u][iDword % 4u];}uint read_buf(uint iDword) {iDword+=uint(u_material_offset/4);return read_buf_no_offset(iDword);}float read_buf_float(uint iDword){return uintBitsToFloat(read_buf(iDword));}uint read_buf_uint8(uint iDword,uint iUint8){uint dwordOffset=iDword+(iUint8/4u);uint byteOffset=iUint8 & 3u;uint bitOffset=8u*byteOffset;uint mask=0xffu << bitOffset;uint dwordVal=read_buf(dwordOffset);return (dwordVal & mask) >> bitOffset;}uint read_buf_uint16(uint iDword,uint iUint16){uint dwordOffset=iDword+(iUint16 >> 1u);uint bitOffset=(iUint16 & 1u)*16u;uint mask=0xffffu << bitOffset;uint dwordVal=read_buf(dwordOffset);return (dwordVal & mask) >> bitOffset;}uint nrDwordsForVertexIdEntries(uint nrMaterialLookupEntries) {return nrMaterialLookupEntries;}uint nrDwordsForMaterialIdEntries(uint nrMaterialLookupEntries) {return (nrMaterialLookupEntries*2u+3u)/4u;}uint findRangeBinarySearch(uint vertexId,uint numRanges,uint dwordOffset) {uint left=0u;uint right=numRanges-1u;for (uint i=0u; i < 16u; i++) { 230if (left > right) {break;}uint mid=(left+right)/2u;uint start=read_buf(dwordOffset+mid);uint nextStart=(mid+1u < numRanges) ? read_buf(dwordOffset+mid+1u) : 0xffffffffu;if (vertexId >=start && vertexId < nextStart) {return mid;} else if (vertexId < start) {if (mid==0u) {break;}right=mid-1u;} else {left=mid+1u;}}return 0u; 231}uint readVertexId(uint dwordOffset,uint iMaterialLookupEntry) {return read_buf(dwordOffset+iMaterialLookupEntry);}uint findRange(uint vertexId,uint numRanges,uint dwordOffset) {uint iRange;if(numRanges <=64u){uint vertexBegin;for(iRange=0u; iRange < numRanges;++iRange) {vertexBegin=readVertexId(dwordOffset,iRange);if(vertexBegin > vertexId) {break;}}iRange=iRange==0u? 0u : iRange-1u;} else { 232iRange=findRangeBinarySearch(vertexId,numRanges,dwordOffset);}return iRange;}MaterialInfo read_material_info(uint vertex_id) {MaterialInfo info; 233#if MATERIAL_TABLE_DEBUG 234const vec4 red=vec4(1.0,0.0,0.0,1.0);const vec4 orange=vec4(1.0,0.5,0.0,1.0);const vec4 yellow=vec4(1.0,1.0,0.0,1.0);const vec4 green=vec4(0.0,1.0,0.0,1.0);const vec4 indigo=vec4(0.294,0.0,0.510,1.0);const vec4 blue=vec4(0.0,0.0,1.0,1.0);const vec4 purple=vec4(0.5,0.0,0.5,1.0);const vec4 pink=vec4(1.0,0.0,1.0,1.0);info.colorDebug=green; 235#endif 236uint offset=0u; 237#if MATERIAL_TABLE_DEBUG 238bool keepFinding=true;uint magic=read_buf(offset);if(magic !=0xCAFEBABEu) {info.colorDebug=red;keepFinding=false;return info;} 239#endif 240offset++; 241#if MATERIAL_TABLE_DEBUG 242uint nrMaterials=read_buf(offset);uint nrVertices=read_buf(offset+1u);if(keepFinding && vertex_id >=nrVertices) {info.colorDebug=red;keepFinding=false;} 243#endif 244offset+=2u;uint nrMaterialLookupEntries=read_buf(offset++);uint perMaterialEntrySizeDwords=read_buf(offset++); 245#if MATERIAL_TABLE_DEBUG 246if(keepFinding && perMaterialEntrySizeDwords !=1u) {info.colorDebug=red;keepFinding=false;} 247#endif 248uint iMaterialLookup=findRange(vertex_id,nrMaterialLookupEntries,offset); 249#if MATERIAL_TABLE_DEBUG 250if(keepFinding) 251{uint vertexBeginCheck=readVertexId(offset,iMaterialLookup);if(vertexBeginCheck > vertex_id) {info.colorDebug=red;keepFinding=false;}if(iMaterialLookup < nrMaterialLookupEntries-1u) {uint vertexEndCheck=readVertexId(offset,iMaterialLookup+1u);if(vertexEndCheck <=vertex_id) {info.colorDebug=red;keepFinding=false;}}} 252#endif 253offset+=nrDwordsForVertexIdEntries(nrMaterialLookupEntries);uint materialId=iMaterialLookup; 254#if MATERIAL_TABLE_DEBUG 255if(keepFinding) {if(materialId >=nrMaterialLookupEntries) {info.colorDebug=red;}} 256#endif 257info.dataOffset=offset+materialId*perMaterialEntrySizeDwords;return info;}uint get_data_location(const MaterialInfo matInfo,uint attribOffsetBytes) 258{uint attribFieldOffsetDwords=attribOffsetBytes/4u;return matInfo.dataOffset+attribFieldOffsetDwords;}vec4 read_material_vec4(const MaterialInfo matInfo,uint attribOffsetBytes){uint loc=get_data_location(matInfo,attribOffsetBytes);return vec4(read_buf_float(loc),read_buf_float(loc+1u),read_buf_float(loc+2u),read_buf_float(loc+3u));}vec2 read_material_vec2(const MaterialInfo matInfo,uint attribOffsetBytes){uint loc=get_data_location(matInfo,attribOffsetBytes);return vec2(read_buf_float(loc),read_buf_float(loc+1u));}float read_material_float(const MaterialInfo matInfo,uint attribOffsetBytes){uint loc=get_data_location(matInfo,attribOffsetBytes);return read_buf_float(loc);} 259#define GET_ATTRIBUTE_float(attrib,matInfo,attrib_offset) read_material_float(matInfo,attrib_offset) 260#define GET_ATTRIBUTE_vec4(attrib,matInfo,attrib_offset) read_material_vec4(matInfo,attrib_offset) 261#define GET_ATTRIBUTE_vec2(attrib,matInfo,attrib_offset) read_material_vec2(matInfo,attrib_offset) 262#define DECLARE_MATERIAL_TABLE_INFO MaterialInfo materialInfo=read_material_info(uint(gl_VertexID)); 263#define DECLARE_MATERIAL_TABLE_INFO_DEBUG(dbgColor) MaterialInfo materialInfo=read_material_info(uint(gl_VertexID)); dbgColor=materialInfo.colorDebug; 264#endif`,"_prelude_fog.fragment.glsl":Ed,"_prelude_shadow.fragment.glsl":F1,"_prelude_lighting.glsl":pg,"_prelude_raster_array.glsl":O1},_g={},Wh="precision highp float;",qh="precision mediump float;",o0=` 265#if defined(GL_EXT_blend_func_extended) && defined(DUAL_SOURCE_BLENDING) 266#extension GL_EXT_blend_func_extended : require 267#endif`,na={preludeTerrain:tr("",t0),preludeFog:tr(Ed,n0),preludeShadow:tr(F1,D1),preludeRasterArray:tr(O1,""),preludeLighting:tr(pg,pg),preludePrecisionQualifiers:tr(qh,Wh),prelude:tr(Mp,Gh),preludeExtensions:tr(o0,"")},s0=[o0,qh,kp,na.prelude.fragmentSource].join(` 268`),yg=[Wh,kp,na.prelude.vertexSource].join(` 269`);var y2={background:tr(`#include "_prelude_fog.fragment.glsl" 270#include "_prelude_lighting.glsl" 271uniform vec4 u_color;uniform float u_opacity;uniform mediump float u_emissive_strength; 272#ifdef LIGHTING_3D_MODE 273in vec4 v_color; 274#endif 275void main() {vec4 out_color; 276#ifdef FEATURE_CUTOUT 277vec2 uv=gl_FragCoord.xy*u_inv_viewport_size.xy; 278#ifdef FLIP_Y 279uv.y=1.0-uv.y; 280#endif 281float factorTex=min(texture(u_cutout_factor_image,uv).r,1.0);float cutoutFactor=(1.0-u_feature_cutout_params.x)*factorTex;out_color=u_color*(1.0-cutoutFactor); 282#else 283#ifdef LIGHTING_3D_MODE 284out_color=v_color; 285#else 286out_color=u_color; 287#endif 288#ifdef FOG 289out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); 290#endif 291#endif 292glFragColor=out_color*u_opacity; 293#ifdef USE_MRT1 294out_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a); 295#endif 296#ifdef OVERDRAW_INSPECTOR 297glFragColor=vec4(1.0); 298#endif 299HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 300#include "_prelude_lighting.glsl" 301in ivec2 a_pos;uniform mat4 u_matrix;uniform mediump float u_emissive_strength; 302#ifdef LIGHTING_3D_MODE 303uniform mediump vec4 u_color;out vec4 v_color; 304#endif 305void main() {gl_Position=u_matrix*vec4(a_pos,0,1); 306#ifndef FEATURE_CUTOUT 307#ifdef LIGHTING_3D_MODE 308v_color=apply_lighting_with_emission_ground(u_color,u_emissive_strength); 309#endif 310#ifdef FOG 311v_fog_pos=fog_position(vec2(a_pos)); 312#endif 313#endif 314}`),backgroundPattern:tr(`#include "_prelude_fog.fragment.glsl" 315#include "_prelude_lighting.glsl" 316uniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform float u_emissive_strength;uniform sampler2D u_image;in highp vec2 v_pos;void main() {highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=textureLodCustom(u_image,pos,v_pos); 317#ifdef LIGHTING_3D_MODE 318out_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength); 319#endif 320#ifdef FOG 321out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); 322#endif 323glFragColor=out_color*u_opacity; 324#ifdef USE_MRT1 325out_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a); 326#endif 327#ifdef OVERDRAW_INSPECTOR 328glFragColor=vec4(1.0); 329#endif 330HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 331uniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec2 u_pattern_units_to_pixels;in ivec2 a_pos;out highp vec2 v_pos;void main() {vec2 pos=vec2(a_pos);gl_Position=u_matrix*vec4(pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_pattern_units_to_pixels,pos); 332#ifdef FOG 333v_fog_pos=fog_position(pos); 334#endif 335}`),circle:tr(`#include "_prelude_fog.fragment.glsl" 336#include "_prelude_lighting.glsl" 337in vec3 v_data;in float v_visibility; 338#pragma mapbox: define highp vec4 color 339#pragma mapbox: define mediump float radius 340#pragma mapbox: define lowp float blur 341#pragma mapbox: define lowp float opacity 342#pragma mapbox: define highp vec4 stroke_color 343#pragma mapbox: define mediump float stroke_width 344#pragma mapbox: define lowp float stroke_opacity 345uniform float u_emissive_strength;void main() { 346#pragma mapbox: initialize highp vec4 color 347#pragma mapbox: initialize mediump float radius 348#pragma mapbox: initialize lowp float blur 349#pragma mapbox: initialize lowp float opacity 350#pragma mapbox: initialize highp vec4 stroke_color 351#pragma mapbox: initialize mediump float stroke_width 352#pragma mapbox: initialize lowp float stroke_opacity 353vec2 extrude=v_data.xy;float blur_positive=blur < 0.0 ? 0.0 : 1.0;lowp float antialiasblur=v_data.z;float extrude_length=length(extrude)+antialiasblur*(1.0-blur_positive);float antialiased_blur=-max(abs(blur),antialiasblur);
353float antialiase_blur_opacity=smoothstep(0.0,antialiasblur,extrude_length-1.0);float opacity_t=blur_positive==1.0 ? 354smoothstep(0.0,-antialiased_blur,1.0-extrude_length) : 355smoothstep(antialiased_blur,0.0,extrude_length-1.0)-antialiase_blur_opacity;float color_t=stroke_width < 0.01 ? 0.0 : smoothstep( 356antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width) 357);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t); 358#ifdef LIGHTING_3D_MODE 359out_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength); 360#endif 361#ifdef FOG 362out_color=fog_apply_premultiplied(out_color,v_fog_pos); 363#endif 364glFragColor=out_color*(v_visibility*opacity_t); 365#ifdef OVERDRAW_INSPECTOR 366glFragColor=vec4(1.0); 367#endif 368}`,`#include "_prelude_fog.vertex.glsl" 369#include "_prelude_terrain.vertex.glsl" 370#define NUM_VISIBILITY_RINGS 2 371#define INV_SQRT2 0.70710678 372#define ELEVATION_BIAS 0.0001 373#define NUM_SAMPLES_PER_RING 16 374uniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;in ivec2 a_pos; 375#ifdef PROJECTION_GLOBE_VIEW 376in ivec4 a_pos_3;in ivec4 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir; 377#endif 378#ifdef ELEVATED_ROADS 379in float a_circle_z_offset; 380#endif 381out vec3 v_data;out float v_visibility; 382#pragma mapbox: define highp vec4 color 383#pragma mapbox: define mediump float radius 384#pragma mapbox: define lowp float blur 385#pragma mapbox: define lowp float opacity 386#pragma mapbox: define highp vec4 stroke_color 387#pragma mapbox: define mediump float stroke_width 388#pragma mapbox: define lowp float stroke_opacity 389vec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1.0,-1.0),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1.0,-1.0),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1.0,1.0),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1.0,1.0),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) { 390#if defined(TERRAIN) 391return elevation(pos)+ELEVATION_BIAS; 392#else 393return 0.0; 394#endif 395}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale); 396#ifdef PITCH_WITH_MAP 397#ifdef PROJECTION_GLOBE_VIEW 398return u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) ); 399#else 400return u_matrix*( world_center+vec4(sample_offset,0,0) ); 401#endif 402#else 403return projected_center+vec4(sample_offset,0,0); 404#endif 405}float get_sample_step() { 406#ifdef PITCH_WITH_MAP 407return 2.0*PI/float(NUM_SAMPLES_PER_RING); 408#else 409return PI/float(NUM_SAMPLES_PER_RING); 410#endif 411}void main() { 412#pragma mapbox: initialize highp vec4 color 413#pragma mapbox: initialize mediump float radius 414#pragma mapbox: initialize lowp float blur 415#pragma mapbox: initialize lowp float opacity 416#pragma mapbox: initialize highp vec4 stroke_color 417#pragma mapbox: initialize mediump float stroke_width 418#pragma mapbox: initialize lowp float stroke_opacity 419vec2 pos2=vec2(a_pos);vec2 extrude=vec2(mod(pos2,2.0)*2.0-1.0);vec2 circle_center=floor(pos2*0.5);float height=circle_elevation(circle_center);vec4 world_center;mat3 surface_vectors; 420#ifdef PROJECTION_GLOBE_VIEW 421surface_vectors=globe_mercator_surface_vectors(vec3(a_pos_normal_3)/16384.0,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*height;vec3 globe_pos=vec3(a_pos_3)+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*height;vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1); 422#else
423surface_vectors=mat3(1.0);world_center=vec4(circle_center,height,1); 424#endif 425#ifdef ELEVATED_ROADS 426world_center.z+=a_circle_z_offset+ELEVATION_BIAS; 427#endif 428vec4 projected_center=u_matrix*world_center;float view_scale=0.0; 429#ifdef PITCH_WITH_MAP 430#ifdef SCALE_WITH_MAP 431view_scale=1.0; 432#else 433view_scale=projected_center.w/u_camera_to_center_distance; 434#endif 435#else 436#ifdef SCALE_WITH_MAP 437view_scale=u_camera_to_center_distance; 438#else 439view_scale=projected_center.w; 440#endif 441#endif 442gl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0; 443#ifdef TERRAIN 444float step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center; 445#ifdef PITCH_WITH_MAP 446float cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center; 447#else 448occlusion_world_center=world_center;occlusion_projected_center=projected_center; 449#endif 450for(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING); 451#else 452visibility=1.0; 453#endif 454#ifdef PROJECTION_GLOBE_VIEW 455visibility=1.0; 456#endif 457v_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur); 458#ifdef FOG 459v_fog_pos=fog_position(world_center.xyz); 460#endif 461}`),clippingMask:tr("void main() {glFragColor=vec4(1.0);}","in ivec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:tr(`#include "_prelude_fog.fragment.glsl" 462uniform highp float u_intensity;in vec2 v_extrude; 463#pragma mapbox: define highp float weight 464#define GAUSS_COEF 0.3989422804014327 465void main() { 466#pragma mapbox: initialize highp float weight 467float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);glFragColor=vec4(val,1.0,1.0,1.0); 468#ifdef FOG 469if (u_is_globe==0) {glFragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);} 470#endif 471#ifdef OVERDRAW_INSPECTOR 472glFragColor=vec4(1.0); 473#endif 474HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_terrain.vertex.glsl" 475#include "_prelude_fog.vertex.glsl" 476uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;in ivec2 a_pos; 477#ifdef PROJECTION_GLOBE_VIEW 478in ivec4 a_pos_3;in ivec4 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir; 479#endif 480out vec2 v_extrude; 481#pragma mapbox: define highp float weight 482#pragma mapbox: define mediump float radius 483const highp float ZERO=1.0/255.0/16.0; 484#define GAUSS_COEF 0.3989422804014327 485void main() { 486#pragma mapbox: initialize highp float weight 487#pragma mapbox: initialize mediump float radius 488vec2 unscaled_extrude=vec2(mod(vec2(a_pos),2.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 tilePos=floor(vec2(a_pos)*0.5);vec3 pos; 489#ifdef PROJECTION_GLOBE_VIEW 490vec3 pos_normal_3=vec3(a_pos_normal_3)/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=vec3(a_pos_3)+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); 491#else 492pos=vec3(tilePos+extrude,elevation(tilePos)); 493#endif 494gl_Position=u_matrix*vec4(pos,1); 495#ifdef FOG 496v_fog_pos=fog_position(pos); 497#endif 498}`),heatmapTexture:tr(`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));glFragColor=color*u_opacity; 499#ifdef OVERDRAW_INSPECTOR 500glFragColor=vec4(0.0); 501#endif 502HANDLE_WIREFRAME_DEBUG;}`,"in ivec2 a_pos;out vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=vec2(a_pos)*0.5+0.5;}"),collisionBox:tr("in float v_placed;in float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);glFragColor =mix(red,blue,step(0.5,v_placed))*0.5;glFragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}",`#include "_prelude_terrain.vertex.glsl" 503in ivec4 a_pos;in ivec2 a_anchor_pos;in ivec2 a_extrude;in uvec2 a_placed;in vec2 a_shift;in vec2 a_elevation_from_sea;in float a_size_scale;in vec2 a_padding;in float a_auto_z_offset;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance; 504#ifdef PROJECTION_GLOBE_VIEW 505uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform float u_zoom_transition; 506#endif 507out float v_placed;out float v_notUsed;void main() {vec2 anchor_pos=vec2(a_anchor_pos);float feature_elevation=a_elevation_from_sea.x+a_auto_z_offset;float terrain_elevation=(a_elevation_from_sea.y==1.0 ? 0.0 : elevation(anchor_pos));vec3 proj_pos=vec3(a_pos)+elevationVector(anchor_pos)*(feature_elevation+terrain_elevation); 508#ifdef PROJECTION_GLOBE_VIEW 509#ifndef PROJECTED_POS_ON_VIEWPORT 510vec3 globe_pos=proj_pos;vec3 mercator_pos=mercator_tile_position(u_inv_rot_matrix,anchor_pos,u_tile_id,u_merc_center);proj_pos=mix_globe_mercator(globe_pos,mercator_pos,u_zoom_transition); 511#endif 512#endif 513vec4 projectedPoint=u_matrix*vec4(proj_pos,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp( 5140.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(vec2(a_extrude)*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=float(a_placed.x);v_notUsed=float(a_placed.y);}`),collisionCircle:tr("in float v_radius;in vec2 v_extrude;in float v_perspective_ratio;in float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);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);glFragColor=color*alpha*opacity_t;}",`in vec2 a_pos_2f;in float a_radius;in ivec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;out float v_radius;out vec2 v_extrude;out float v_perspective_ratio;out float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos_2f;float radius=a_radius;int vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2( 515mix(-1.0,1.0,float(vertexIdx >=2)),mix(-1.0,1.0,float(vertexIdx >=1 && vertexIdx <=2)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp( 5160.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=float(a_flags.x);gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}`),debug:tr("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);glFragColor=mix(u_color,overlay_color,overlay_color.a);}",`#include "_prelude_terrain.vertex.glsl" 517in ivec2 a_pos; 518#ifdef PROJECTION_GLOBE_VIEW 519in ivec4 a_pos_3; 520#endif 521out vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {vec2 pos=vec2(a_pos);float h=elevation(pos);v_uv=pos/8192.0; 522#ifdef PROJECTION_GLOBE_VIEW
523gl_Position=u_matrix*vec4(vec3(a_pos_3)+elevationVector(pos)*h,1); 524#else 525gl_Position=u_matrix*vec4(pos*u_overlay_scale,h,1); 526#endif 527}`),elevatedStructuresDepth:tr("void main() {}","in ivec2 a_pos;in float a_height;uniform mat4 u_matrix;uniform float u_depth_bias;void main() {gl_Position=u_matrix*vec4(a_pos,a_height,1);gl_Position.z=gl_Position.z+u_depth_bias;}"),elevatedStructuresDepthReconstruct:tr(`#ifdef DEPTH_RECONSTRUCTION 528in float v_height; 529#endif 530void main() { 531#ifdef DEPTH_RECONSTRUCTION 532if (v_height >=0.0) 533discard; 534#else 535#ifdef FEATURE_CUTOUT 536apply_feature_cutout(vec4(0.0,0.0,0.0,1.0),gl_FragCoord,get_cutout_factors(gl_FragCoord).x); 537#endif 538#endif 539glFragColor=vec4(1.0,0.0,0.0,1.0);}`,`in ivec2 a_pos;in float a_height;uniform mat4 u_matrix;uniform vec3 u_camera_pos;uniform highp float u_depth_bias;uniform lowp float u_height_scale;uniform lowp float u_reset_depth; 540#ifdef DEPTH_RECONSTRUCTION 541out float v_height; 542#endif 543void main() {vec3 vpos=vec3(a_pos,a_height*u_height_scale); 544#ifdef DEPTH_RECONSTRUCTION 545if (u_camera_pos.z > vpos.z) {vpos-=(u_camera_pos-vpos)*(vpos.z/(u_camera_pos.z-vpos.z));}v_height=a_height; 546#endif 547gl_Position=u_matrix*vec4(vpos,1);gl_Position.z=u_reset_depth==1.0 ? gl_Position.w : gl_Position.z+u_depth_bias;}`),elevatedStructures:tr(`#include "_prelude_fog.fragment.glsl" 548#include "_prelude_lighting.glsl" 549#include "_prelude_shadow.fragment.glsl" 550in vec3 v_normal;in float v_height; 551#ifdef RENDER_SHADOWS 552in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in float v_depth; 553#endif 554vec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}
554vec3 compute_view_dependent_emissive_color(float ndotl,float emissive_strength,vec3 color) 555{color=sRGBToLinear(color);color=color*(ndotl+(1.0-min(ndotl*57.29,1.0))*emissive_strength);color=linearTosRGB(color.rgb);return color;}uniform float u_emissive_strength; 556#pragma mapbox: define highp vec4 structure_color 557void main() { 558#pragma mapbox: initialize highp vec4 structure_color 559vec3 color=structure_color.xyz;vec2 cutout_factors=vec2(0.0); 560#ifdef FEATURE_CUTOUT 561cutout_factors=get_cutout_factors(gl_FragCoord); 562#endif 563#ifdef LIGHTING_3D_MODE 564vec3 normal=normalize(v_normal);vec3 transformed_normal=vec3(-normal.xy,normal.z);float ndotl=calculate_NdotL(transformed_normal);float emissive_strength=u_emissive_strength;emissive_strength=0.0;vec3 emissive_color=compute_view_dependent_emissive_color(ndotl,emissive_strength,color.xyz); 565#ifdef RENDER_SHADOWS 566float light=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth);light=mix(light,1.0,cutout_factors.y);color.rgb=apply_lighting(color.rgb,transformed_normal,light); 567#else 568color=apply_lighting(color,transformed_normal); 569#endif 570color=mix(color,emissive_color,emissive_strength);if (v_height < 0.0) {float penetration=max(v_height+7.5,0.0);float occlusion=1.0-1.0/PI*acos(1.0-penetration/4.0);color=color*(1.0-pow(occlusion,2.0)*0.3);} 571#endif 572#ifdef FOG 573color=fog_apply(color,v_fog_pos); 574#endif 575vec4 out_color=vec4(color,1.0); 576#ifdef INDICATOR_CUTOUT 577out_color=applyCutout(out_color,v_height); 578#endif 579#ifdef FEATURE_CUTOUT 580out_color=apply_feature_cutout(out_color,gl_FragCoord,cutout_factors.x); 581#endif 582glFragColor=out_color;HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 583#include "_prelude_shadow.vertex.glsl" 584in ivec2 a_pos;in float a_height;in ivec4 a_pos_normal_3;uniform mat4 u_matrix;out vec3 v_normal;out float v_height; 585#ifdef RENDER_SHADOWS 586uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out float v_depth; 587#endif 588#pragma mapbox: define highp vec4 structure_color 589void main() { 590#pragma mapbox: initialize highp vec4 structure_color 591v_normal=vec3(a_pos_normal_3)/16384.0;v_height=a_height;vec3 pos=vec3(vec2(a_pos),a_height);gl_Position=u_matrix*vec4(pos,1); 592#ifdef RENDER_SHADOWS 593vec3 shd_pos0=pos;vec3 shd_pos1=pos; 594#ifdef NORMAL_OFFSET 595vec3 offset=shadow_normal_offset(vec3(-v_normal.xy,v_normal.z));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1(); 596#endif 597v_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w; 598#endif 599#ifdef FOG 600v_fog_pos=fog_position(vec2(a_pos)); 601#endif 602}`),fill:tr(`#include "_prelude_fog.fragment.glsl" 603#include "_prelude_lighting.glsl" 604#include "_prelude_shadow.fragment.glsl" 605#pragma mapbox: define highp vec4 color 606#pragma mapbox: define lowp float opacity 607uniform float u_emissive_strength; 608#ifdef RENDER_SHADOWS 609uniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth; 610#endif 611#ifdef ELEVATED_ROADS 612in highp float v_road_z_offset; 613#endif 614#ifdef INDICATOR_CUTOUT 615in highp float v_z_offset; 616#endif 617void main() { 618#pragma mapbox: initialize highp vec4 color 619#pragma mapbox: initialize lowp float opacity 620vec2 cutout_factors=vec2(0.0); 621#ifdef FEATURE_CUTOUT 622cutout_factors=get_cutout_factors(gl_FragCoord); 623#endif 624vec4 out_color=color; 625#ifdef LIGHTING_3D_MODE 626out_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength); 627#ifdef RENDER_SHADOWS 628float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);light=mix(light,1.0,cutout_factors.y);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light); 629#endif 630#endif 631#ifdef FOG 632out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); 633#endif 634out_color*=opacity; 635#ifdef INDICATOR_CUTOUT 636if (v_z_offset >=0.0) {out_color=applyCutout(out_color,v_z_offset);} 637#endif 638#ifdef FEATURE_CUTOUT 639out_color=apply_feature_cutout(out_color,gl_FragCoord,cutout_factors.x); 640#endif 641glFragColor=out_color; 642#ifdef USE_MRT1 643out_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a); 644#endif 645#ifdef OVERDRAW_INSPECTOR 646glFragColor=vec4(1.0); 647#endif 648HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 649#include "_prelude_shadow.vertex.glsl" 650in ivec2 a_pos; 651#ifdef ELEVATED_ROADS 652in float a_road_z_offset;out highp float v_road_z_offset; 653#endif 654#ifdef RENDER_SHADOWS 655uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth; 656#endif 657#ifdef INDICATOR_CUTOUT 658out highp float v_z_offset; 659#endif 660uniform mat4 u_matrix; 661#pragma mapbox: define highp vec4 color 662#pragma mapbox: define lowp float opacity 663#pragma mapbox: define highp float z_offset 664void main() { 665#pragma mapbox: initialize highp vec4 color 666#pragma mapbox: initialize lowp float opacity 667#pragma mapbox: initialize highp float z_offset 668#ifdef ELEVATED_ROADS 669z_offset+=a_road_z_offset;v_road_z_offset=z_offset; 670#endif 671float hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden); 672#ifdef RENDER_SHADOWS 673vec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset); 674#ifdef NORMAL_OFFSET 675vec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1(); 676#endif 677v_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w; 678#endif 679#ifdef FOG 680v_fog_pos=fog_position(vec2(a_pos)); 681#endif 682#ifdef INDICATOR_CUTOUT 683v_z_offset=z_offset; 684#endif 685}`),fillOutline:tr(`#include "_prelude_fog.fragment.glsl" 686#include "_prelude_lighting.glsl" 687#include "_prelude_shadow.fragment.glsl" 688in highp vec2 v_pos;uniform float u_emissive_strength; 689#ifdef RENDER_SHADOWS 690uniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth; 691#endif 692#pragma mapbox: define highp vec4 outline_color 693#pragma mapbox: define lowp float opacity 694void main() { 695#pragma mapbox: initialize highp vec4 outline_color 696#pragma mapbox: initialize lowp float opacity 697float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color;vec2 cutout_factors=vec2(0.0); 698#ifdef FEATURE_CUTOUT 699cutout_factors=get_cutout_factors(gl_FragCoord); 700#endif 701#ifdef LIGHTING_3D_MODE 702out_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength); 703#ifdef RENDER_SHADOWS 704float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);light=mix(light,1.0,cutout_factors.y);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light); 705#endif 706#endif 707#ifdef FOG 708out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); 709#endif 710#ifdef FEATURE_CUTOUT 711out_color=apply_feature_cutout(out_color,gl_FragCoord,cutout_factors.x); 712#endif 713glFragColor=out_color*(alpha*opacity); 714#ifdef USE_MRT1 715out_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a); 716#endif 717#ifdef OVERDRAW_INSPECTOR 718glFragColor=vec4(1.0); 719#endif 720HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 721#include "_prelude_shadow.vertex.glsl" 722in ivec2 a_pos; 723#ifdef ELEVATED_ROADS 724in float a_road_z_offset; 725#endif 726#ifdef RENDER_SHADOWS 727uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth; 728#endif 729uniform mat4 u_matrix;uniform vec2 u_world;out highp vec2 v_pos; 730#pragma mapbox: define highp vec4 outline_color 731#pragma mapbox: define lowp float opacity 732#pragma mapbox: define highp float z_offset 733void main() { 734#pragma mapbox: initialize highp vec4 outline_color 735#pragma mapbox: initialize lowp float opacity 736#pragma mapbox: initialize highp float z_offset 737#ifdef ELEVATED_ROADS 738z_offset+=a_road_z_offset; 739#endif 740float hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden); 741#ifdef FLIP_Y 742v_pos=(vec2(gl_Position.x,-gl_Position.y)/gl_Position.w+1.0)/2.0*u_world; 743#else 744v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world; 745#endif 746#ifdef RENDER_SHADOWS 747vec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset); 748#ifdef NORMAL_OFFSET 749vec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1(); 750#endif 751v_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w; 752#endif 753#ifdef FOG 754v_fog_pos=fog_position(vec2(a_pos)); 755#endif 756}`),fillOutlinePattern:tr(`#include "_prelude_fog.fragment.glsl" 757#include "_prelude_lighting.glsl" 758#include "_prelude_shadow.fragment.glsl" 759uniform vec2 u_texsize;uniform sampler2D u_image; 760#ifdef FILL_PATTERN_TRANSITION 761uniform float u_pattern_transition; 762#endif 763uniform float u_emissive_strength; 764#ifdef APPLY_LUT_ON_GPU 765uniform highp sampler3D u_lutTexture; 766#endif 767#ifdef RENDER_SHADOWS 768uniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth; 769#endif 770in highp vec2 v_pos;in highp vec2 v_pos_world; 771#pragma mapbox: define lowp float opacity 772#pragma mapbox: define lowp uvec4 pattern 773#ifdef FILL_PATTERN_TRANSITION 774#pragma mapbox: define mediump uvec4 pattern_b 775#endif 776void main() { 777#pragma mapbox: initialize lowp float opacity 778#pragma mapbox: initialize mediump uvec4 pattern 779#ifdef FILL_PATTERN_TRANSITION 780#pragma mapbox: initialize mediump uvec4 pattern_b 781#endif 782vec2 pattern_tl=vec2(pattern.xy);vec2 pattern_br=vec2(pattern.zw);highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=textureLodCustom(u_image,pos,lod_pos); 783#ifdef APPLY_LUT_ON_GPU 784out_color=applyLUT(u_lutTexture,out_color); 785#endif 786#ifdef FILL_PATTERN_TRANSITION 787vec2 pattern_b_tl=pattern_b.xy;vec2 pattern_b_br=pattern_b.zw;highp vec2 pos_b=mix(pattern_b_tl/u_texsize,pattern_b_br/u_texsize,imagecoord);vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);out_color=out_color*(1.0-u_pattern_transition)+color_b*u_pattern_transition; 788#endif 789vec2 cutout_factors=vec2(0.0); 790#ifdef FEATURE_CUTOUT 791cutout_factors=get_cutout_factors(gl_FragCoord); 792#endif 793#ifdef LIGHTING_3D_MODE 794out_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength); 795#ifdef RENDER_SHADOWS 796float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);light=mix(light,1.0,cutout_factors.y);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light); 797#endif 798#endif 799#ifdef FEATURE_CUTOUT 800out_color=apply_feature_cutout(out_color,gl_FragCoord,cutout_factors.x); 801#endif 802#ifdef FOG 803out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); 804#endif 805glFragColor=out_color*(alpha*opacity); 806#ifdef USE_MRT1 807out_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a); 808#endif 809#ifdef OVERDRAW_INSPECTOR 810glFragColor=vec4(1.0); 811#endif 812HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 813#include "_prelude_shadow.vertex.glsl" 814uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in ivec2 a_pos; 815#ifdef ELEVATED_ROADS 816in float a_road_z_offset; 817#endif 818#ifdef RENDER_SHADOWS 819uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth; 820#endif 821out highp vec2 v_pos;out highp vec2 v_pos_world; 822#pragma mapbox: define lowp float opacity 823#pragma mapbox: define lowp uvec4 pattern 824#ifdef FILL_PATTERN_TRANSITION 825#pragma mapbox: define mediump uvec4 pattern_b 826#endif 827#pragma mapbox: define lowp float pixel_ratio 828#pragma mapbox: define highp float z_offset 829void main() { 830#pragma mapbox: initialize lowp float opacity 831#pragma mapbox: initialize mediump uvec4 pattern 832#ifdef FILL_PATTERN_TRANSITION 833#pragma mapbox: initialize mediump uvec4 pattern_b 834#endif 835#pragma mapbox: initialize lowp float pixel_ratio 836#pragma mapbox: initialize highp float z_offset 837vec2 pattern_tl=vec2(pattern.xy);vec2 pattern_br=vec2(pattern.zw); 838#ifdef ELEVATED_ROADS 839z_offset+=a_road_z_offset; 840#endif 841float hidden=float(opacity==0.0);vec2 pos=vec2(a_pos);gl_Position=mix(u_matrix*vec4(pos,z_offset,1),AWAY,hidden);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos); 842#ifdef FLIP_Y 843v_pos_world=(vec2(gl_Position.x,-gl_Position.y)/gl_Position.w+1.0)/2.0*u_world; 844#else 845v_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world; 846#endif 847#ifdef RENDER_SHADOWS 848vec3 shd_pos0=vec3(pos,z_offset);vec3 shd_pos1=vec3(pos,z_offset); 849#ifdef NORMAL_OFFSET 850vec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1(); 851#endif 852v_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w; 853#endif 854#ifdef FOG 855v_fog_pos=fog_position(pos); 856#endif 857}`),fillPattern:tr(`#include "_prelude_fog.fragment.glsl" 858#include "_prelude_lighting.glsl" 859#include "_prelude_shadow.fragment.glsl" 860uniform vec2 u_texsize;uniform sampler2D u_image; 861#ifdef FILL_PATTERN_TRANSITION 862uniform float u_pattern_transition; 863#endif 864in highp vec2 v_pos;uniform float u_emissive_strength; 865#ifdef RENDER_SHADOWS 866uniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth; 867#endif 868#ifdef ELEVATED_ROADS 869in highp float v_road_z_offset; 870#endif 871#ifdef APPLY_LUT_ON_GPU 872uniform highp sampler3D u_lutTexture; 873#endif 874#pragma mapbox: define lowp float opacity 875#pragma mapbox: define lowp uvec4 pattern 876#ifdef FILL_PATTERN_TRANSITION 877#pragma mapbox: define mediump uvec4 pattern_b 878#endif 879void main() { 880#pragma mapbox: initialize lowp float opacity 881#pragma mapbox: initialize mediump uvec4 pattern 882#ifdef FILL_PATTERN_TRANSITION 883#pragma mapbox: initialize mediump uvec4 pattern_b 884#endif 885vec2 pattern_tl=vec2(pattern.xy);vec2 pattern_br=vec2(pattern.zw);highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);vec4 out_color=textureLodCustom(u_image,pos,lod_pos); 886#ifdef APPLY_LUT_ON_GPU 887out_color=applyLUT(u_lutTexture,out_color); 888#endif 889#ifdef FILL_PATTERN_TRANSITION 890vec2 pattern_b_tl=vec2(pattern_b.xy);vec2 pattern_b_br=vec2(pattern_b.zw);highp vec2 pos_b=mix(pattern_b_tl/u_texsize,pattern_b_br/u_texsize,imagecoord);vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);out_color=out_color*(1.0-u_pattern_transition)+color_b*u_pattern_transition; 891#endif 892vec2 cutout_factors=vec2(0.0); 893#ifdef FEATURE_CUTOUT 894cutout_factors=get_cutout_factors(gl_FragCoord); 895#endif 896#ifdef LIGHTING_3D_MODE 897out_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength); 898#ifdef RENDER_SHADOWS 899float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);light=mix(light,1.0,cutout_factors.y); 900#ifdef ELEVATED_ROADS 901out_color.rgb*=mix(v_road_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light); 902#else 903out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light); 904#endif 905#endif 906#endif 907#ifdef FEATURE_CUTOUT 908out_color=apply_feature_cutout(out_color,gl_FragCoord,cutout_factors.x); 909#endif 910#ifdef FOG 911out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); 912#endif 913glFragColor=out_color*opacity; 914#ifdef USE_MRT1 915out_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a); 916#endif 917#ifdef OVERDRAW_INSPECTOR 918glFragColor=vec4(1.0); 919#endif 920HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 921#include "_prelude_shadow.vertex.glsl" 922uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in ivec2 a_pos; 923#ifdef ELEVATED_ROADS 924in float a_road_z_offset;out highp float v_road_z_offset; 925#endif 926#ifdef RENDER_SHADOWS 927uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp floa
927t v_depth; 928#endif 929out highp vec2 v_pos; 930#pragma mapbox: define lowp float opacity 931#pragma mapbox: define lowp uvec4 pattern 932#ifdef FILL_PATTERN_TRANSITION 933#pragma mapbox: define mediump uvec4 pattern_b 934#endif 935#pragma mapbox: define lowp float pixel_ratio 936#pragma mapbox: define highp float z_offset 937void main() { 938#pragma mapbox: initialize lowp float opacity 939#pragma mapbox: initialize mediump uvec4 pattern 940#pragma mapbox: initialize lowp float pixel_ratio 941#pragma mapbox: initialize highp float z_offset 942#ifdef FILL_PATTERN_TRANSITION 943#pragma mapbox: initialize mediump uvec4 pattern_b 944#endif 945vec2 pattern_tl=vec2(pattern.xy);vec2 pattern_br=vec2(pattern.zw);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio; 946#ifdef ELEVATED_ROADS 947z_offset+=a_road_z_offset;v_road_z_offset=z_offset; 948#endif 949float hidden=float(opacity==0.0);vec2 pos=vec2(a_pos);gl_Position=mix(u_matrix*vec4(pos,z_offset,1),AWAY,hidden);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos); 950#ifdef RENDER_SHADOWS 951vec3 shd_pos0=vec3(pos,z_offset);vec3 shd_pos1=vec3(pos,z_offset); 952#ifdef NORMAL_OFFSET 953vec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1(); 954#endif 955v_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w; 956#endif 957#ifdef FOG 958v_fog_pos=fog_position(pos); 959#endif 960}`),lineBlendComposite:tr(`uniform highp sampler2D u_image;uniform float u_opacity;uniform int u_blend_mode;uniform highp float u_max_density;in vec2 v_pos; 961#define ADDITIVE 1 962void main() {vec4 color=texture(u_image,v_pos);if (u_blend_mode==ADDITIVE) {if (color.a <=0.0) {discard;}highp float density=color.a;vec3 avgColor=color.rgb/max(density,0.001);highp float n=density/max(u_max_density,0.001);highp float t=sqrt(n/(n+1.0));glFragColor=vec4(avgColor*t,t);} else {vec3 multiplyFactor=color.rgb*u_opacity+(1.0-u_opacity);glFragColor=vec4(multiplyFactor,1.0);} 963#ifdef OVERDRAW_INSPECTOR 964glFragColor=vec4(0.0); 965#endif 966HANDLE_WIREFRAME_DEBUG;}`,"in ivec2 a_pos;out vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=vec2(a_pos)*0.5+0.5;}"),lineBlendReduce:tr("uniform highp sampler2D u_image;uniform vec2 u_texel_size;uniform bool u_first_pass;in vec2 v_pos;void main() {vec2 o=u_texel_size*0.5;vec4 s0=texture(u_image,v_pos+vec2(-o.x,-o.y));vec4 s1=texture(u_image,v_pos+vec2( o.x,-o.y));vec4 s2=texture(u_image,v_pos+vec2(-o.x, o.y));vec4 s3=texture(u_image,v_pos+vec2( o.x, o.y));float r0; float g0;float r1; float g1;float r2; float g2;float r3; float g3;if (u_first_pass) {float a0=s0.a;float a1=s1.a;float a2=s2.a;float a3=s3.a;r0=a0; g0=a0 > 0.0 ? 1.0 : 0.0;r1=a1; g1=a1 > 0.0 ? 1.0 : 0.0;r2=a2; g2=a2 > 0.0 ? 1.0 : 0.0;r3=a3; g3=a3 > 0.0 ? 1.0 : 0.0;} else {r0=s0.r; g0=s0.g;r1=s1.r; g1=s1.g;r2=s2.r; g2=s2.g;r3=s3.r; g3=s3.g;}glFragColor=vec4((r0+r1+r2+r3)*0.25,(g0+g1+g2+g3)*0.25,0.0,0.0);}","in ivec2 a_pos;out vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=vec2(a_pos)*0.5+0.5;}"),fillExtrusion:tr(`#include "_prelude_fog.fragment.glsl" 967#include "_prelude_shadow.fragment.glsl" 968#include "_prelude_lighting.glsl" 969in vec4 v_color;in vec4 v_flat; 970#ifdef RENDER_SHADOWS 971in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1; 972#endif 973uniform lowp float u_opacity; 974#ifdef RENDER_FRONT_CUTOFF 975in float v_front_cutoff_opacity; 976#endif 977#ifdef INDICATOR_CUTOUT 978#ifdef FEATURE_CUTOUT 979in vec4 v_ground_roof; 980#endif 981#endif 982#ifdef FAUX_AO 983uniform lowp vec2 u_ao;in vec2 v_ao; 984#endif 985#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE) 986in vec4 v_roof_color; 987#endif 988#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE) 989in highp vec3 v_normal; 990#endif 991uniform vec3 u_flood_light_color;uniform highp float u_vertical_scale;uniform float u_flood_light_intensity;uniform vec3 u_ground_shadow_factor; 992#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT) 993in float v_flood_radius;in float v_has_floodlight; 994#endif 995in float v_height; 996#pragma mapbox: define highp float emissive_strength 997void main() { 998#pragma mapbox: initialize highp float emissive_strength 999#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE) 1000vec3 normal=normalize(v_normal); 1001#endif 1002float z;vec4 color=v_color; 1003#ifdef ZERO_ROOF_RADIUS 1004z=float(normal.z > 0.00001); 1005#ifdef LIGHTING_3D_MODE 1006normal=mix(normal,vec3(0.0,0.0,1.0),z); 1007#else 1008color=mix(v_color,v_roof_color,z); 1009#endif 1010#endif 1011float h=max(0.0,v_height);float ao_shade=1.0; 1012#ifdef FAUX_AO 1013float intensity=u_ao[0];float h_floors=h/(u_ao[1]*u_vertical_scale);float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);ao_shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0
1013),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x; 1014#ifdef ZERO_ROOF_RADIUS 1015concave*=(1.0-z); 1016#endif 1017float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);ao_shade*=mix(1.0,x_shade*x_shade*x_shade,concave); 1018#ifdef LIGHTING_3D_MODE 1019#ifdef FLOOD_LIGHT 1020color.rgb*=mix(ao_shade,1.0,v_has_floodlight); 1021#else 1022color.rgb*=ao_shade; 1023#endif 1024#else 1025color.rgb*=ao_shade; 1026#endif 1027#endif 1028#ifdef LIGHTING_3D_MODE 1029float flood_radiance=0.0; 1030#ifdef FLOOD_LIGHT 1031flood_radiance=(1.0-min(h/v_flood_radius,1.0))*u_flood_light_intensity*v_has_floodlight; 1032#endif 1033#ifdef RENDER_SHADOWS 1034#ifdef FLOOD_LIGHT 1035float ndotl_unclamped=dot(normal,u_shadow_direction);float ndotl=max(0.0,ndotl_unclamped);float occlusion=ndotl_unclamped < 0.0 ? 1.0 : shadow_occlusion(ndotl,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);vec3 litColor=apply_lighting(color.rgb,normal,(1.0-u_shadow_intensity*occlusion)*ndotl);vec3 floodLitColor=compute_flood_lighting(u_flood_light_color*u_opacity,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=mix(litColor,floodLitColor,flood_radiance); 1036#else 1037float shadowed_lighting_factor; 1038#ifdef RENDER_CUTOFF 1039shadowed_lighting_factor=shadowed_light_factor_normal_opacity(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,v_cutoff_opacity);if (v_cutoff_opacity==0.0) {discard;} 1040#else 1041shadowed_lighting_factor=shadowed_light_factor_normal(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w); 1042#endif 1043color.rgb=apply_lighting(color.rgb,normal,shadowed_lighting_factor); 1044#endif 1045#else 1046color.rgb=apply_lighting(color.rgb,normal); 1047#ifdef FLOOD_LIGHT 1048color.rgb=mix(color.rgb,u_flood_light_color*u_opacity,flood_radiance); 1049#endif 1050#endif 1051color.rgb=mix(color.rgb,v_flat.rgb,emissive_strength);color*=u_opacity; 1052#endif 1053#ifdef FOG 1054color=fog_dither(fog_apply_premultiplied(color,v_fog_pos,h)); 1055#endif 1056#ifdef INDICATOR_CUTOUT 1057#ifdef FEATURE_CUTOUT 1058{float ditherOpacity=cutoutGroundRoofOpacity(v_ground_roof);if (ditherOpacity < 1.0) {int index=(int(gl_FragCoord.x) % 4)*4+(int(gl_FragCoord.y) % 4);if (ditherOpacity < DITHER_THRESHOLDS[index]) {discard;}}} 1059#else 1060color=applyCutout(color,h); 1061#endif 1062#endif 1063#ifdef RENDER_FRONT_CUTOFF 1064if (v_front_cutoff_opacity < 1.0) {int index=(int(gl_FragCoord.x) % 4)*4+(int(gl_FragCoord.y) % 4);if (v_front_cutoff_opacity < DITHER_THRESHOLDS[index]) {discard;}} 1065#endif 1066#ifdef FEATURE_CUTOUT 1067color=apply_feature_cutout(color,gl_FragCoord,get_cutout_factors(gl_FragCoord).x); 1068#endif 1069glFragColor=color; 1070#ifdef OVERDRAW_INSPECTOR 1071glFragColor=vec4(1.0); 1072#endif 1073HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 1074#include "_prelude_terrain.vertex.glsl" 1075#include "_prelude_shadow.vertex.glsl" 1076#include "_prelude_lighting.glsl" 1077#include "_prelude_material_table.vertex.glsl" 1078uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_edge_radius;uniform float u_width_scale;in ivec4 a_pos_normal_ed; 1079#if defined(HAS_CENTROID) || defined(TERRAIN) 1080in uvec2 a_centroid_pos; 1081#endif 1082#ifdef RENDER_WALL_MODE 1083in ivec4 a_join_normal_inside; 1084#endif 1085#ifdef PROJECTION_GLOBE_VIEW 1086in ivec4 a_pos_3;in ivec4 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift; 1087#endif 1088#ifdef TERRAIN 1089uniform int u_height_type;uniform int u_base_type; 1090#endif 1091uniform highp float u_vertical_scale; 1092#ifdef RENDER_FRONT_CUTOFF 1093uniform vec3 u_front_cutoff_params;out float v_front_cutoff_opacity; 1094#endif 1095out vec4 v_color;out vec4 v_flat; 1096#ifdef RENDER_SHADOWS 1097uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1; 1098#endif 1099#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE) 1100out vec4 v_roof_color; 1101#endif 1102#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE) 1103out highp vec3 v_normal; 1104#endif 1105#ifdef FAUX_AO 1106uniform lowp vec2 u_ao;out vec2 v_ao; 1107#endif 1108#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT)
1109out float v_flood_radius;out float v_has_floodlight; 1110#endif 1111out float v_height; 1112#ifdef INDICATOR_CUTOUT 1113#ifdef FEATURE_CUTOUT 1114out vec4 v_ground_roof; 1115#endif 1116#endif 1117vec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));} 1118#pragma mapbox: define highp float base 1119#pragma mapbox: define highp float height 1120#pragma mapbox: define highp vec4 color 1121#pragma mapbox: define highp float flood_light_wall_radius 1122#pragma mapbox: define highp float line_width 1123#pragma mapbox: define highp float emissive_strength 1124void main() {DECLARE_MATERIAL_TABLE_INFO 1125#pragma mapbox: initialize highp float base 1126#pragma mapbox: initialize highp float height 1127#pragma mapbox: initialize highp vec4 color 1128#pragma mapbox: initialize highp float flood_light_wall_radius 1129#pragma mapbox: initialize highp float line_width 1130#pragma mapbox: initialize highp float emissive_strength 1131base*=u_vertical_scale;height*=u_vertical_scale;vec4 top_up_ny_start=vec4(a_pos_normal_ed & 1);vec4 pos_nx=vec4(a_pos_normal_ed >> 1);float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny_start.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny_start.z-1.0)*(1.0-abs(x_normal)),0.0)); 1132#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE) 1133v_normal=normal; 1134#endif 1135base=max(0.0,base);float attr_height=height;height=max(0.0,top_up_ny_start.y==0.0 && top_up_ny_start.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny_start.x;vec2 centroid_pos=vec2(0.0); 1136#if defined(HAS_CENTROID) || defined(TERRAIN) 1137centroid_pos=vec2(a_centroid_pos); 1138#endif 1139float ele=0.0;float h=0.0;float c_ele=0.0;vec3 pos; 1140#ifdef TERRAIN 1141bool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;ele=elevation(pos_nx.xy);bool is_elevation_encoded=centroid_pos.y==0.0 || (centroid_pos.y > 0.0 && (int(centroid_pos.y) & 7)==7);c_ele=is_flat_height || is_flat_base ? (is_elevation_encoded ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);h=t > 0.0 ? max(h_base,h_height) : h_base; 1142#else 1143h=t > 0.0 ? height : base; 1144#endif 1145pos=vec3(pos_nx.xy,h); 1146#ifdef PROJECTION_GLOBE_VIEW 1147float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(vec3(a_pos_normal_3)/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=vec3(a_pos_3)+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); 1148#endif 1149float cutoff=1.0;vec3 scaled_pos=pos; 1150#if defined(RENDER_CUTOFF) || defined(RENDER_FRONT_CUTOFF) 1151vec2 centroid_decoded=pos.xy;bool isBorderCentroid=false;if (centroid_pos.x > 0.0 && centroid_pos.y > 0.0) {int iy=int(centroid_pos.y);int spanYbits=iy & 7;if (spanYbits==7) {isBorderCentroid=true;int borderID=(iy >> 3) & 3;float coordAlongBorder=float(iy >> 5)*4.0;if (borderID==0) centroid_decoded=vec2(0.0,coordAlongBorder);else if (borderID==1) centroid_decoded=vec2(EXTENT,coordAlongBorder);else if (borderID==2) centroid_decoded=vec2(coordAlongBorder,0.0);else centroid_decoded=vec2(coordAlongBorder,EXTENT);} else {centroid_decoded=floor(centroid_pos/8.0);}} 1152#endif 1153#if defined(RENDER_CUTOFF) || defined(RENDER_FRONT_CUTOFF) 1154vec4 ground=u_matrix*vec4(centroid_decoded,ele,1.0); 1155#endif 1156#ifdef RENDER_CUTOFF 1157#ifdef CLIP_ZERO_TO_ONE 1158cutoff=cutoff_opacity(u_cutoff_params,ground.z*2.0-ground.w); 1159#else 1160cutoff=cutoff_opacity(u_cutoff_params,ground.z); 1161#endif 1162if (centroid_pos.y !=0.0 && centroid_pos.x !=0.0) {vec3 centroid_random=vec3(centroid_pos.xy,centroid_pos.x+centroid_pos.y+1.0);vec3 ground_pos=centroid_random/8.0;vec3 g=floor(ground_pos);vec3 mod_=centroid_random-g*8.0;float seed=min(1.0,0.1*(min(3.5,max(mod_.x+mod_.y,0.2*attr_height))*0.35+mod_.z));if (cutoff < 0.8-seed) {cutoff=0.0;}}float cutoff_scale=cutoff;v_cutoff_opacity=cutoff;scaled_pos.z=mix(c_ele,h,cutoff_scale); 1163#endif 1164float hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (cutoff==0.0 && centroid_pos.x !=0.0) || (color.a==0.0)); 1165#ifdef RENDER_FRONT_CUTOFF 1166v_front_cutoff_opacity=1.0;if (centroid_pos.x > 0.0 && centroid_pos.y > 0.0) {hidden=max(hidden,float(ground.w <=0.0));
1166float ndc_y=ground.y/max(ground.w,0.001);float threshold=u_front_cutoff_params.x*2.0-1.0;float range_ndc=u_front_cutoff_params.y*2.0;if (!isBorderCentroid) {hidden=max(hidden,float(ndc_y < threshold-range_ndc));}float t=clamp((ndc_y-(threshold-range_ndc))/max(range_ndc,0.001),0.0,1.0);v_front_cutoff_opacity=mix(u_front_cutoff_params.z,1.0,t);} 1167#endif 1168#ifdef RENDER_WALL_MODE 1169vec3 join_normal_inside=vec3(a_join_normal_inside);vec2 wall_offset=u_width_scale*line_width*(join_normal_inside.xy/EXTENT);scaled_pos.xy+=(1.0-join_normal_inside.z)*wall_offset*0.5;scaled_pos.xy-=join_normal_inside.z*wall_offset*0.5; 1170#endif 1171gl_Position=mix(u_matrix*vec4(scaled_pos,1),AWAY,hidden);h=h-ele;v_height=h; 1172#ifdef RENDER_SHADOWS 1173vec3 shd_pos0=pos;vec3 shd_pos1=pos; 1174#ifdef NORMAL_OFFSET 1175vec3 offset=shadow_normal_offset(normal);shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1(); 1176#endif 1177v_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1); 1178#endif 1179float NdotL=0.0;float colorvalue=0.0; 1180#ifndef LIGHTING_3D_MODE 1181colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL);if (normal.y !=0.0) {float r=0.84;r=mix(0.7,0.98,1.0-u_lightintensity);NdotL*=( 1182(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));} 1183#endif 1184#ifdef FAUX_AO 1185float concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height; 1186#ifdef TERRAIN 1187top_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(ce
1187ntroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height); 1188#endif 1189v_ao=vec2(mix(concave,-concave,start),y_ground);NdotL*=(1.0+0.05*(1.0-top_up_ny_start.y)*u_ao[0]); 1190#ifdef PROJECTION_GLOBE_VIEW 1191top_height+=u_height_lift; 1192#endif 1193gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w; 1194#endif 1195#ifdef LIGHTING_3D_MODE 1196#ifdef FLOOD_LIGHT 1197float is_wall=1.0-float(t > 0.0 && top_up_ny_start.y > 0.0);v_has_floodlight=float(flood_light_wall_radius > 0.0 && is_wall > 0.0);v_flood_radius=flood_light_wall_radius*u_vertical_scale; 1198#endif 1199v_color=vec4(color.rgb,1.0);float ndotl=calculate_NdotL(normal);v_flat.rgb=sRGBToLinear(color.rgb);v_flat.rgb=v_flat.rgb*(ndotl+(1.0-min(ndotl*57.29,1.0))*emissive_strength);v_flat=vec4(linearTosRGB(v_flat.rgb),1.0); 1200#else 1201v_color=vec4(0.0,0.0,0.0,1.0);v_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_color*=u_opacity; 1202#endif 1203#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE) 1204float roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color=vec4(0.0,0.0,0.0,1.0);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_roof_color*=u_opacity; 1205#endif 1206#ifdef FOG 1207v_fog_pos=fog_position(pos); 1208#endif 1209#ifdef INDICATOR_CUTOUT 1210#ifdef FEATURE_CUTOUT 1211vec4 pos_ground=u_matrix*vec4(pos.xy,ele,1.0);vec4 pos_roof=u_matrix*vec4(pos.xy,ele+height,1.0);v_ground_roof=vec4(pos_ground.xy/pos_ground.w,pos_roof.xy/pos_roof.w); 1212#endif 1213#endif 1214}`),fillExtrusionDepth:tr("void main() {}",`#include "_prelude_terrain.vertex.glsl" 1215#include "_prelude_material_table.vertex.glsl" 1216uniform mat4 u_matrix;uniform float u_edge_radius;uniform float u_width_scale;uniform float u_vertical_scale; 1217#ifdef TERRAIN 1218uniform int u_height_type;uniform int u_base_type; 1219#endif 1220in ivec4 a_pos_normal_ed; 1221#if defined(HAS_CENTROID) || defined(TERRAIN) 1222in uvec2 a_centroid_pos; 1223#endif 1224#ifdef RENDER_WALL_MODE 1225in ivec4 a_join_normal_inside; 1226#endif 1227#pragma mapbox: define highp float base 1228#pragma mapbox: define highp float height 1229#pragma mapbox: define highp float line_width 1230#pragma mapbox: define highp vec4 color 1231void main() {DECLARE_MATERIAL_TABLE_INFO 1232#pragma mapbox: initialize highp float base 1233#pragma mapbox: initialize highp float height 1234#pragma mapbox: initialize highp float line_width 1235#pragma mapbox: initialize highp vec4 color 1236base*=u_vertical_scale;height*=u_vertical_scale;vec3 top_up_ny=vec3(a_pos_normal_ed.xyz & 1);vec3 pos_nx=vec3(a_pos_normal_ed.xyz >> 1);base=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0); 1237#if defined(HAS_CENTROID) || defined(TERRAIN) 1238centroid_pos=vec2(a_centroid_pos); 1239#endif 1240vec3 pos; 1241#ifdef TERRAIN 1242bool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;float ele=elevation(pos_nx.xy);bool is_elevation_encoded=centroid_pos.y==0.0 || (centroid_pos.y > 0.0 && int(centroid_pos.y)-(int(centroid_pos.y)/8)*8==7);float c_ele=is_flat_height || is_flat_base ? (is_elevation_encoded ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);float h=t > 0.0 ? max(h_base,h_height) : h_base;pos=vec3(pos_nx.xy,h); 1243#else 1244pos=vec3(pos_nx.xy,t > 0.0 ? height : base); 1245#endif 1246#ifdef RENDER_WALL_MODE 1247vec3 join_normal_inside=vec3(a_join_normal_inside);vec2 wall_offset=u_width_scale*line_width*(join_normal_inside.xy/EXTENT);pos.xy+=(1.0-join_normal_inside.z)*wall_offset*0.5;pos.xy-=join_normal_inside.z*wall_offset*0.5; 1248#endif 1249float hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (color.a==0.0));gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);}`),fillExtrusionPattern:tr(`#include "_prelude_fog.fragment.glsl" 1250#include "_prelude_lighting.glsl" 1251uniform vec2 u_texsize;uniform sampler2D u_image; 1252#ifdef FILL_EXTRUSION_PATTERN_TRANSITION 1253uniform float u_pattern_transition; 1254#endif 1255#ifdef FAUX_AO 1256uniform lowp vec2 u_ao;in vec3 v_ao; 1257#endif 1258#ifdef LIGHTING_3D_MODE 1259in vec3 v_normal; 1260#endif 1261#ifdef APPLY_LUT_ON_GPU 1262uniform highp sampler3D u_lutTexture; 1263#endif 1264in highp vec2 v_pos;in vec4 v_lighting;uniform lowp float u_opacity; 1265#pragma mapbox: define highp float base 1266#pragma mapbox: define highp float height 1267#pragma mapbox: define mediump uvec4 pattern 1268#ifdef FILL_EXTRUSION_PATTERN_TRANSITION 1269#pragma mapbox: define mediump uvec4 pattern_b 1270#endif 1271#pragma mapbox: define highp float pixel_ratio 1272void main() { 1273#pragma mapbox: initialize highp float base 1274#pragma mapbox: initialize highp float height 1275#pragma mapbox: initialize mediump uvec4 pattern 1276#ifdef FILL_EXTRUSION_PATTERN_TRANSITION 1277#pragma mapbox: initialize mediump uvec4 pattern_b 1278#endif 1279#pragma mapbox: initialize highp float pixel_ratio 1280vec2 pattern_tl=vec2(pattern.xy);vec2 pattern_br=vec2(pattern.zw);highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);vec4 out_color=textureLodCustom(u_image,pos,lod_pos); 1281#ifdef APPLY_LUT_ON_GPU 1282out_color=applyLUT(u_lutTexture,out_color); 1283#endif 1284#ifdef FILL_EXTRUSION_PATTERN_TRANSITION 1285vec2 pattern_b_tl=vec2(pattern_b.xy);vec2 pattern_b_br=vec2(pattern_b.zw);highp vec2 pos_b=mix(pattern_b_tl/u_texsize,pattern_b_br/u_texsize,imagecoord);vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);out_color=out_color*(1.0-u_pattern_transition)+color_b*u_pattern_transition; 1286#endif 1287#ifdef LIGHTING_3D_MODE 1288out_color=apply_lighting(out_color,normalize(v_normal))*u_opacity; 1289#else 1290out_color=out_color*v_lighting; 1291#endif 1292#ifdef FAUX_AO 1293float intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0
1293),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade; 1294#endif 1295#ifdef FOG 1296out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); 1297#endif 1298#ifdef INDICATOR_CUTOUT 1299out_color=applyCutout(out_color,height); 1300#endif 1301glFragColor=out_color; 1302#ifdef OVERDRAW_INSPECTOR 1303glFragColor=vec4(1.0); 1304#endif 1305HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 1306#include "_prelude_terrain.vertex.glsl" 1307#include "_prelude_lighting.glsl" 1308#include "_prelude_material_table.vertex.glsl" 1309uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_width_scale;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;in ivec4 a_pos_normal_ed; 1310#if defined(HAS_CENTROID) || defined(TERRAIN) 1311in uvec2 a_centroid_pos; 1312#endif 1313#ifdef RENDER_WALL_MODE 1314in ivec4 a_join_normal_inside; 1315#endif 1316#ifdef PROJECTION_GLOBE_VIEW 1317in ivec4 a_pos_3;in ivec4 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift; 1318#endif 1319#ifdef TERRAIN 1320uniform int u_height_type;uniform int u_base_type; 1321#endif 1322out highp vec2 v_pos;out vec4 v_lighting; 1323#ifdef FAUX_AO 1324uniform lowp vec2 u_ao;out vec3 v_ao; 1325#endif 1326#ifdef LIGHTING_3D_MODE 1327out vec3 v_normal; 1328#endif 1329#pragma mapbox: define highp float base 1330#pragma mapbox: define highp float height 1331#pragma mapbox: define highp vec4 color 1332#pragma mapbox: define mediump uvec4 pattern 1333#ifdef FILL_EXTRUSION_PATTERN_TRANSITION 1334#pragma mapbox: define mediump uvec4 pattern_b 1335#endif 1336#pragma mapbox: define highp float pixel_ratio 1337#pragma mapbox: define highp float line_width 1338void main() {DECLARE_MATERIAL_TABLE_INFO 1339#pragma mapbox: initialize highp float base 1340#pragma mapbox: initialize highp float height 1341#pragma mapbox: initialize highp vec4 color 1342#pragma mapbox: initialize mediump uvec4 pattern 1343#ifdef FILL_EXTRUSION_PATTERN_TRANSITION 1344#pragma mapbox: initialize mediump uvec4 pattern_b 1345#endif 1346#pragma mapbox: initialize highp float pixel_ratio 1347#pragma mapbox: initialize highp float line_width 1348vec2 pattern_tl=vec2(pattern.xy);vec2 pattern_br=vec2(pattern.zw);vec4 top_up_ny_start=vec4(a_pos_normal_ed & 1);vec4 pos_nx=vec4(a_pos_normal_ed >> 1);float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny_start.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny_start.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=float(a_pos_normal_ed.w);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny_start.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0); 1349#if defined(HAS_CENTROID) || defined(TERRAIN) 1350centroid_pos=vec2(a_centroid_pos); 1351#endif 1352float ele=0.0;float h=z;vec3 p;float c_ele; 1353#ifdef TERRAIN 1354bool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;ele=elevation(pos_nx.xy);bool is_elevation_encoded=centroid_pos.y==0.0 || (centroid_pos.y > 0.0 && int(centroid_pos.y)-(int(centroid_pos.y)/8)*8==7);c_ele=is_flat_height || is_flat_base ? (is_elevation_encoded ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);h=t > 0.0 ? max(h_base,h_height) : h_base;p=vec3(pos_nx.xy,h); 1355#else 1356p=vec3(pos_nx.xy,z); 1357#endif 1358#ifdef PROJECTION_GLOBE_VIEW 1359float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(vec3(a_pos_normal_3)/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=vec3(a_pos_3)+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); 1360#endif 1361#ifdef RENDER_WALL_MODE 1362vec3 join_normal_inside=vec3(a_join_normal_inside);vec2 wall_offset=u_width_scale*line_width*(join_normal_inside.xy/EXTENT);p.xy+=(1.0-join_normal_inside.z)*wall_offset*0.5;p.xy-=join_normal_inside.z*wall_offset*0.5; 1363#endif 1364float hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (color.a==0.0));gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0 1365? pos_nx.xy 1366: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0; 1367#ifdef LIGHTING_3D_MODE 1368NdotL=calculate_NdotL(normal); 1369#else 1370NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL); 1371#endif 1372if (normal.y !=0.0) {float r=0.84; 1373#ifndef LIGHTING_3D_MODE 1374r=mix(0.7,0.98,1.0-u_lightintensity); 1375#endif 1376NdotL*=( 1377(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));} 1378#ifdef FAUX_AO
1379float concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height; 1380#ifdef TERRAIN 1381top_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height); 1382#endif 1383v_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny_start.y)*u_ao[0]); 1384#ifdef PROJECTION_GLOBE_VIEW 1385top_height+=u_height_lift; 1386#endif 1387gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w; 1388#endif 1389#ifdef LIGHTING_3D_MODE 1390v_normal=normal; 1391#else 1392v_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity; 1393#endif 1394#ifdef FOG 1395v_fog_pos=fog_position(p); 1396#endif 1397}`),groundShadow:tr(`#include "_prelude_shadow.fragment.glsl" 1398precision highp float;uniform vec3 u_ground_shadow_factor;in vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1; 1399#ifdef FOG 1400in float v_fog_opacity; 1401#endif 1402void main() {float light=shadowed_light_factor_plane_bias(v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);vec3 shadow=mix(u_ground_shadow_factor,vec3(1.0),light); 1403#ifdef RENDER_CUTOFF 1404shadow=mix(vec3(1.0),shadow,cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w)); 1405#endif 1406#ifdef FOG 1407shadow=mix(shadow,vec3(1.0),v_fog_opacity); 1408#endif 1409#ifdef INDICATOR_CUTOUT 1410shadow=mix(shadow,vec3(1.0),1.0-applyCutout(vec4(1.0),0.0).r); 1411#endif 1412#ifdef FEATURE_CUTOUT 1413shadow=mix(shadow,vec3(1.0),get_cutout_factors(gl_FragCoord).y); 1414#endif 1415glFragColor=vec4(shadow,1.0);}`,`#include "_prelude_fog.vertex.glsl" 1416uniform mat4 u_matrix;uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;in ivec2 a_pos;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1; 1417#ifdef FOG 1418out float v_fog_opacity; 1419#endif 1420void main() {gl_Position=u_matrix*vec4(a_pos,0.0,1.0);v_pos_light_view_0=u_light_matrix_0*vec4(a_pos,0.0,1.0);v_pos_light_view_1=u_light_matrix_1*vec4(a_pos,0.0,1.0); 1421#ifdef FOG 1422v_fog_pos=fog_position(vec2(a_pos));v_fog_opacity=fog(v_fog_pos); 1423#endif 1424}`),fillExtrusionGroundEffect:tr(`uniform highp float u_ao_pass;uniform highp float u_opacity;uniform highp float u_flood_light_intensity;uniform highp vec3 u_flood_light_color;uniform highp float u_attenuation;uniform sampler2D u_fb;uniform float u_fb_size; 1425#ifdef SDF_SUBPASS 1426in highp vec2 v_pos;in highp vec4 v_line_segment;in highp float v_flood_light_radius_tile;in highp vec2 v_ao;float line_df(highp vec2 a,highp vec2 b,highp vec2 p) {highp vec2 ba=b-a;highp vec2 pa=p-a;highp float r=clamp(dot(pa,ba)/dot(ba,ba),0.0,1.0);return length(pa-r*ba);} 1427#ifdef FOG 1428in highp float v_fog; 1429#endif 1430#endif 1431void main() { 1432#ifdef CLEAR_SUBPASS 1433vec4 color=vec4(1.0); 1434#ifdef CLEAR_FROM_TEXTURE 1435color=texture(u_fb,gl_FragCoord.xy/vec2(u_fb_size)); 1436#endif 1437glFragColor=color; 1438#else 1439#ifdef SDF_SUBPASS 1440highp float d=line_df(v_line_segment.xy,v_line_segment.zw,v_pos);highp float effect_radius=mix(v_flood_light_radius_tile,v_ao.y,u_ao_pass);d/=effect_radius;d=min(d,1.0);d=1.0-pow(1.0-d,u_attenuation);highp float effect_intensity=mix(u_flood_light_intensity,v_ao.x,u_ao_pass);highp float fog=1.0; 1441#ifdef FOG 1442fog=v_fog; 1443#endif 1444#ifdef RENDER_CUTOFF 1445fog*=v_cutoff_opacity; 1446#endif 1447glFragColor=vec4(vec3(0.0),mix(1.0,d,effect_intensity*u_opacity*fog)); 1448#else 1449#ifdef USE_MRT1 1450out_Target1=vec4(1.0-texture(u_fb,gl_FragCoord.xy/vec2(u_fb_size)).a,0.0,0.0,0.0); 1451#else 1452vec4 color=mix(vec4(u_flood_light_color,1.0),vec4(vec3(0.0),1.0),u_ao_pass); 1453#ifdef OVERDRAW_INSPECTOR 1454color=vec4(1.0); 1455#endif 1456glFragColor=color; 1457#endif 1458#endif 1459HANDLE_WIREFRAME_DEBUG; 1460#endif 1461}`,`#include "_prelude_fog.vertex.glsl" 1462in highp ivec4 a_pos_end;in highp int a_angular_offset_factor;in highp uint a_hidden_by_landmark; 1463#ifdef SDF_SUBPASS 1464out highp vec2 v_pos;out highp vec4 v_line_segment;out highp float v_flood_light_radius_tile;out highp vec2 v_ao; 1465#ifdef FOG 1466out highp float v_fog; 1467#endif 1468#endif 1469uniform highp float u_flood_light_intensity;uniform highp mat4 u_matrix;uniform highp float u_ao_pass;uniform highp float u_meter_to_tile;uniform highp float u_edge_radius;uniform highp float u_dynamic_offset;uniform highp vec2 u_ao;
1470#pragma mapbox: define highp float flood_light_ground_radius 1471const float TANGENT_CUTOFF=4.0;const float NORM=32767.0;void main() { 1472#pragma mapbox: initialize highp float flood_light_ground_radius 1473vec4 pos_end=vec4(a_pos_end);vec2 p=pos_end.xy;vec2 q=floor(pos_end.zw*0.5);vec2 start_bottom=pos_end.zw-q*2.0;float fl_ground_radius=abs(flood_light_ground_radius);float direction=flood_light_ground_radius < 0.0 ?-1.0 : 1.0;float flood_radius_tile=fl_ground_radius*u_meter_to_tile;vec2 v=normalize(q-p);float ao_radius=u_ao.y/3.5;float effect_radius=mix(flood_radius_tile,ao_radius,u_ao_pass)+u_edge_radius;float angular_offset_factor=float(a_angular_offset_factor)/NORM*TANGENT_CUTOFF;float angular_offset=direction*angular_offset_factor*effect_radius;float top=1.0-start_bottom.y;float side=(0.5-start_bottom.x)*2.0;vec2 extrusion_parallel=v*side*mix(u_dynamic_offset,angular_offset,top);vec2 perp=vec2(v.y,-v.x);vec2 extrusion_perp=direction*perp*effect_radius*top;vec3 pos=vec3(mix(q,p,start_bottom.x),0.0);pos.xy+=extrusion_parallel+extrusion_perp; 1474#ifdef SDF_SUBPASS 1475v_pos=pos.xy;v_line_segment=vec4(p,q)+perp.xyxy*u_edge_radius;v_flood_light_radius_tile=flood_radius_tile;v_ao=vec2(u_ao.x,ao_radius); 1476#ifdef FOG 1477v_fog_pos=fog_position(pos);v_fog=1.0-fog(v_fog_pos); 1478#endif 1479#endif 1480float hidden_by_landmark=0.0; 1481#ifdef HAS_CENTROID 1482hidden_by_landmark=float(a_hidden_by_landmark); 1483#endif 1484float isFloodlit=float(fl_ground_radius > 0.0 && u_flood_light_intensity > 0.0);float hidden=mix(1.0-isFloodlit,isFloodlit,u_ao_pass);hidden+=hidden_by_landmark;gl_Position=mix(u_matrix*vec4(pos,1.0),AWAY,float(hidden > 0.0)); 1485#ifdef RENDER_CUTOFF 1486v_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z); 1487#endif 1488}`),hillshadePrepare:tr(`precision highp float;uniform highp sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;float getElevation(vec2 coord) {return texture(u_image,coord).r/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));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( 1489(c+e+e+h)-(a+d+d+f),(f+g+g+h)-(a+b+b+c) 1490)/pow(2.0,exaggeration+(19.2562-u_zoom));glFragColor=clamp(vec4( 1491deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;in ivec2 a_pos;in uvec2 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=(vec2(a_texture_pos)/8192.0)*scale+epsilon;}"),hillshade:tr(`#include "_prelude_fog.fragment.glsl" 1492#include "_prelude_lighting.glsl" 1493uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;uniform float u_emissive_strength;void main() {vec4 pixel=texture(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;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_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);glFragColor=accent_color*(1.0-shade_color.a)+shade_color; 1494#ifdef LIGHTING_3D_MODE 1495glFragColor=apply_lighting_with_emission_ground(glFragColor,u_emissive_strength); 1496#endif 1497#ifdef FOG 1498glFragColor=fog_dither(fog_apply_premultiplied(glFragColor,v_fog_pos)); 1499#endif 1500#ifdef USE_MRT1 1501out_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a); 1502#endif 1503#ifdef OVERDRAW_INSPECTOR 1504glFragColor=vec4(1.0); 1505#endif 1506HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 1507uniform mat4 u_matrix;in ivec2 a_pos;in uvec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=vec2(a_texture_pos)/8192.0; 1508#ifdef FOG 1509v_fog_pos=fog_position(vec2(a_pos)); 1510#endif 1511}`),line:tr(`#include "_prelude_fog.fragment.glsl" 1512#include "_prelude_lighting.glsl" 1513#include "_prelude_shadow.fragment.glsl" 1514uniform lowp float u_device_pixel_ratio;uniform highp float u_width_scale;uniform highp float u_floor_width_scale;
1514uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;uniform highp vec2 u_trim_fade_range;uniform highp vec2 u_trim_gradient_mix_range;uniform lowp vec4 u_trim_color;uniform bool u_emissive_in_shadows;uniform bool u_clip_to_tile_borders;in vec4 v_width2_dilute;in vec2 v_normal;in float v_gamma_scale;in highp vec3 v_uv;in vec2 v_tile_pos; 1515#ifdef ELEVATED_ROADS 1516in highp float v_road_z_offset; 1517#endif 1518#ifdef VARIABLE_LINE_WIDTH 1519in float stub_side; 1520#endif 1521#ifdef RENDER_LINE_DASH 1522uniform sampler2D u_dash_image;in vec2 v_tex; 1523#endif 1524#ifdef DEBUG_ELEVATION_ID 1525in vec3 v_elevation_id_col; 1526#endif 1527#ifdef RENDER_LINE_GRADIENT 1528uniform sampler2D u_gradient_image; 1529#endif 1530#ifdef INDICATOR_CUTOUT 1531in highp float v_z_offset; 1532#endif 1533#ifdef RENDER_SHADOWS 1534uniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth; 1535#endif 1536float luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;} 1537#pragma mapbox: define highp vec4 color 1538#pragma mapbox: define lowp float floorwidth 1539#pragma mapbox: define mediump uvec4 dash 1540#pragma mapbox: define lowp float blur 1541#pragma mapbox: define lowp float opacity 1542#pragma mapbox: define mediump float side_z_offset 1543#pragma mapbox: define lowp float border_width 1544#pragma mapbox: define lowp vec4 border_color 1545#pragma mapbox: define lowp float emissive_strength 1546float linearstep(float edge0,float edge1,float x) {return clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() { 1547#pragma mapbox: initialize highp vec4 color 1548#pragma mapbox: initialize lowp float floorwidth 1549#pragma mapbox: initialize mediump uvec4 dash 1550#pragma mapbox: initialize lowp float blur 1551#pragma mapbox: initialize lowp float opacity 1552#pragma mapbox: initialize mediump float side_z_offset 1553#pragma mapbox: initialize lowp float border_width 1554#pragma mapbox: initialize lowp vec4 border_color 1555#pragma mapbox: initialize lowp float emissive_strength 1556float dist=length(v_normal)*v_width2_dilute.x; 1557#ifdef VARIABLE_LINE_WIDTH 1558blur=mix(blur,0.0,stub_side); 1559#endif 1560float diluted_opacity=opacity*v_width2_dilute.z;float blur2=(u_width_scale*blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2_dilute.y-blur2),v_width2_dilute.x-dist)/blur2,0.0,1.0); 1561#ifdef VARIABLE_LINE_WIDTH 1562alpha=mix(alpha,1.0,stub_side); 1563#endif 1564alpha=side_z_offset > 0.0 ? 1.0-alpha : alpha; 1565#ifdef RENDER_LINE_DASH 1566float sdfdist=texture(u_dash_image,v_tex).r;
1566float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/(float(dash.z)+float(dash.w)/65535.0);float scaled_floorwidth=(floorwidth*u_floor_width_scale);alpha*=linearstep(0.5-sdfgamma/scaled_floorwidth,0.5+sdfgamma/scaled_floorwidth,sdfdist); 1567#endif 1568highp vec4 out_color; 1569#ifdef RENDER_LINE_GRADIENT 1570out_color=texture(u_gradient_image,v_uv.xy); 1571#else 1572out_color=color; 1573#endif 1574float trim_alpha=1.0; 1575#ifdef RENDER_LINE_TRIM_OFFSET 1576highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=v_uv[2];if (trim_end > trim_start) {highp float start_transition=max(0.0,min(1.0,(line_progress-trim_start)/max(u_trim_fade_range[0],1.0e-9)));highp float end_transition=max(0.0,min(1.0,(trim_end-line_progress)/max(u_trim_fade_range[1],1.0e-9)));highp float transition_factor=min(start_transition,end_transition);highp float gradient_trim_color_mix_factor=0.0; 1577#ifdef RENDER_LINE_GRADIENT 1578gradient_trim_color_mix_factor=smoothstep(u_trim_gradient_mix_range.x,u_trim_gradient_mix_range.y,line_progress); 1579#endif 1580highp vec4 trim_color=mix(u_trim_color,out_color,gradient_trim_color_mix_factor);out_color=mix(u_trim_gradient_mix_range.x < 1.0 ? color : out_color,trim_color,transition_factor);trim_alpha=1.0-transition_factor;} 1581#endif 1582if (u_alpha_discard_threshold !=0.0) {if (alpha < u_alpha_discard_threshold) {discard;}} 1583#ifdef RENDER_LINE_BORDER 1584#ifndef VARIABLE_LINE_WIDTH 1585float edgeBlur=((border_width*u_width_scale)+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2_dilute.y-edgeBlur),v_width2_dilute.x-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2);if (border_color.a==0.0) {float Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);}} else {out_color=mix(border_color*trim_alpha,out_color,smoothAlpha);}out_color*=v_width2_dilute.w;} 1586#endif 1587#endif 1588vec2 cutout_factors=vec2(0.0); 1589#ifdef FEATURE_CUTOUT 1590cutout_factors=get_cutout_factors(gl_FragCoord); 1591#endif 1592#ifdef LIGHTING_3D_MODE 1593out_color=apply_lighting_with_emission_ground(out_color,emissive_strength); 1594#ifdef RENDER_SHADOWS 1595float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);light=mix(light,1.0,cutout_factors.y);light=u_emissive_in_shadows ? mix(light,1.0,emissive_strength) : light; 1596#ifdef ELEVATED_ROADS 1597out_color.rgb*=mix(v_road_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light); 1598#else 1599out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light); 1600#endif 1601#endif 1602#endif 1603#ifdef FOG 1604out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); 1605#endif 1606out_color*=(alpha*diluted_opacity); 1607#ifdef INDICATOR_CUTOUT 1608out_color=applyCutout(out_color,v_z_offset); 1609#endif 1610#ifdef FEATURE_CUTOUT 1611out_color=apply_feature_cutout(out_color,gl_FragCoord,cutout_factors.x); 1612#endif 1613#ifdef LINE_BLEND_ADDITIVE 1614{float cov=alpha*diluted_opacity;glFragColor=vec4(cov > 0.0 ? out_color.rgb/cov : vec3(0.0),cov);} 1615#else 1616#ifdef LINE_BLEND_MULTIPLY 1617glFragColor=vec4(out_color.rgb+(1.0-out_color.a),1.0); 1618#else 1619glFragColor=out_color; 1620#endif 1621#endif 1622#ifdef DUAL_SOURCE_BLENDING 1623glFragColorSrc1=vec4(vec3(0.0),emissive_strength); 1624#else 1625#ifdef USE_MRT1 1626out_Target1=vec4(emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a); 1627#endif 1628#endif 1629#ifdef OVERDRAW_INSPECTOR 1630glFragColor=vec4(1.0); 1631#endif 1632#ifdef DEBUG_ELEVATION_ID 1633glFragColor=vec4(v_elevation_id_col,1.0); 1634#endif 1635if (u_clip_to_tile_borders) {if (v_tile_pos.x > 1.0 || v_tile_pos.y > 1.0 || v_tile_pos.x < 0.0 || v_tile_pos.y < 0.0) {discard;}}HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 1636#include "_prelude_shadow.vertex.glsl" 1637#include "_prelude_terrain.vertex.glsl" 1638#define EXTRUDE_SCALE 0.015873016 1639in ivec2 a_pos_normal;in uvec4 a_data; 1640#if defined(ELEVATED) || defined(ELEVATED_ROADS) || defined(VARIABLE_LINE_WIDTH) 1641in vec3 a_z_offset_width; 1642#endif 1643#ifdef DEBUG_ELEVATION_ID 1644in vec3 a_elevation_id_col; 1645#endif 1646#ifdef DEBUG_ELEVATION_ID 1647out vec3 v_elevation_id_col; 1648#endif 1649#ifdef ELEVATION_GROUND_SCALE 1650in float a_elevation_ground_scale; 1651#endif 1652#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET) || defined(RENDER_LINE_CURVE) 1653in highp vec3 a_packed; 1654#endif 1655#ifdef RENDER_LINE_DASH 1656in float a_linesofar; 1657#endif 1658uniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;uniform float u_width_scale;uniform float u_z_offset;uniform highp float u_floor_width_scale; 1659#ifdef RENDER_LINE_CURVE 1660uniform mat3 u_curve_points_x;uniform mat3 u_curve_points_y;uniform mat3 u_curve_points_z;uniform float u_curve_point_count; 1661#endif 1662#ifdef ELEVATED 1663uniform lowp float u_zbias_factor;uniform lowp float u_tile_to_meter;float sample_elevation(vec2 apos) { 1664#ifdef ELEVATION_REFERENCE_SEA 1665return 0.0; 1666#else 1667return elevation(apos); 1668#endif 1669} 1670#endif 1671out vec2 v_normal;out vec4 v_width2_dilute;out float v_gamma_scale;out highp vec3 v_uv;out vec2 v_tile_pos; 1672#ifdef ELEVATED_ROADS 1673out highp float v_road_z_offset; 1674#endif 1675#ifdef VARIABLE_LINE_WIDTH 1676out float stub_side; 1677#endif 1678#ifdef RENDER_LINE_DASH 1679uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;out vec2 v_tex; 1680#endif 1681#ifdef RENDER_LINE_GRADIENT 1682uniform float u_image_height; 1683#endif 1684#ifdef INDICATOR_CUTOUT 1685out highp float v_z_offset; 1686#endif 1687#ifdef RENDER_SHADOWS 1688uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth; 1689#endif 1690#pragma mapbox: define highp vec4 color 1691#pragma mapbox: define lowp float floorwidth 1692#pragma mapbox: define mediump uvec4 dash 1693#pragma mapbox: define lowp float blur 1694#pragma mapbox: define lowp float opacity 1695#pragma mapbox: define mediump float gapwidth 1696#pragma mapbox: define lowp float offset 1697#pragma mapbox: define mediump float width 1698#pragma mapbox: define mediump float side_z_offset 1699#pragma mapbox: define lowp float border_width 1700#pragma mapbox: define lowp vec4 border_color 1701#pragma mapbox: define lowp float emissive_strength 1702#ifdef RENDER_LINE_CURVE 1703vec3 getCurvePoint(int index) {int row=index/3;int col=index-row*3;float x=u_curve_points_x[row][col];float y=u_curve_points_y[row][col];float z=u_curve_points_z[row][col];return vec3(x,y,z);}vec3 catmullRom(vec3 p0,vec3 p1,vec3 p2,vec3 p3,float t) {float t2
1703=t*t;float t3=t2*t;return 0.5*( 17042.0*p1+(-p0+p2)*t+(2.0*p0-5.0*p1+4.0*p2-p3)*t2+(-p0+3.0*p1-3.0*p2+p3)*t3 1705);}vec2 catmullRomTangent(vec2 p0,vec2 p1,vec2 p2,vec2 p3,float t) {float t2=t*t;return 0.5*( 1706(-p0+p2)+(2.0*p0-5.0*p1+4.0*p2-p3)*2.0*t+(-p0+3.0*p1-3.0*p2+p3)*3.0*t2 1707);}struct CurveResult {vec3 point;vec2 tangent;};CurveResult calculateCurve(float line_progress) {float curve_progress=line_progress*(u_curve_point_count-1.0);float curve_progress_local=fract(curve_progress);float curve_segment=floor(curve_progress);int seg=int(curve_segment);vec3 p1=getCurvePoint(seg);vec3 p2=getCurvePoint(seg+1);float is_first_seg=step(curve_segment,0.5);vec3 p0_extrapolated=p1-(p2-p1);vec3 p0_fetched=getCurvePoint(max(seg-1,0));vec3 p0=mix(p0_fetched,p0_extrapolated,is_first_seg);int last_seg=int(u_curve_point_count)-2;float is_last_seg=step(float(last_seg)-0.5,curve_segment);vec3 p3_extrapolated=p2+(p2-p1);vec3 p3_fetched=getCurvePoint(min(seg+2,int(u_curve_point_count)-1));vec3 p3=mix(p3_fetched,p3_extrapolated,is_last_seg);vec3 point=catmullRom(p0,p1,p2,p3,curve_progress_local);vec2 tangent=catmullRomTangent(p0.xy,p1.xy,p2.xy,p3.xy,curve_progress_local)*(u_curve_point_count-1.0);CurveResult result;result.point=point;result.tangent=tangent;return result;} 1708#endif 1709void main() { 1710#pragma mapbox: initialize highp vec4 color 1711#pragma mapbox: initialize lowp float floorwidth 1712#pragma mapbox: initialize mediump uvec4 dash 1713#pragma mapbox: initialize lowp float blur 1714#pragma mapbox: initialize lowp float opacity 1715#pragma mapbox: initialize mediump float gapwidth 1716#pragma mapbox: initialize lowp float offset 1717#pragma mapbox: initialize mediump float width 1718#pragma mapbox: initialize mediump float side_z_offset 1719#pragma mapbox: initialize lowp float border_width 1720#pragma mapbox: initialize lowp vec4 border_color 1721#pragma mapbox: initialize lowp float emissive_strength 1722float a_z_offset=u_z_offset; 1723#if defined(ELEVATED) || defined(ELEVATED_ROADS) 1724a_z_offset+=a_z_offset_width.x; 1725#endif 1726#ifdef DEBUG_ELEVATION_ID 1727v_elevation_id_col=a_elevation_id_col; 1728#endif 1729highp float line_progress=0.0; 1730#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET) || defined(RENDER_LINE_CURVE) 1731line_progress=a_packed[2]; 1732#endif 1733float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=vec2(a_data.xy)-128.0;float a_direction=float(a_data.z & 3u)-1.0;vec2 pos_normal=vec2(a_pos_normal);vec2 pos=floor(pos_normal*0.5);mediump vec2 normal=pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;offset=-1.0*offset*u_width_scale;bool left=normal.y==1.0; 1734#ifdef RENDER_LINE_CURVE 1735CurveResult curve=calculateCurve(line_progress);pos=curve.point.xy*8192.0;a_extrude=length(a_extrude)*normalize(curve.tangent);a_extrude=left ? vec2(-a_extrude.y,a_extrude.x) : vec2(a_extrude.y,-a_extrude.x);a_z_offset+=curve.point.z; 1736#endif 1737gapwidth=gapwidth/2.0;float halfwidth;float dilute_scale=1.0;float dilute_border_scale=1.0; 1738#ifdef VARIABLE_LINE_WIDTH 1739float left_width=a_z_offset_width.y;float right_width=a_z_offset_width.z;halfwidth=(u_width_scale*(left ? left_width : right_width))/2.0;if (side_z_offset !=0.0) {float left_f=step(1.0,normal.y);float is_negative=step(side_z_offset,0.0);float apply=mix(1.0-left_f,left_f,is_negative);a_extrude*=apply;a_z_offset+=abs(side_z_offset)*apply;v_normal*=left_f;}offset=border_width > 0.0 ? (left_width+right_width)*u_width_scale*0.5 : offset;halfwidth=border_width > 0.0 ? border_width*u_width_scale*0.5 : halfwidth;bool zero_right_width=border_width==0.0 && right_width==0.0;stub_side=zero_right_width ?-normal.y : 0.0;v_normal=!left && zero_right_width ? vec2(0.0) : v_normal;ANTIALIASING=!left && zero_right_width ? 0.0 : ANTIALIASING; 1740#else 1741halfwidth=(u_width_scale*width)/2.0; 1742#endif 1743float 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*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);float hidden=float(opacity==0.0);vec2 extrude=dist*u_pixels_to_tile_units;
1743vec4 projected_extrude=u_matrix*vec4(extrude,0.0,0.0);vec2 projected_extrude_xy=projected_extrude.xy; 1744#ifdef ELEVATED_ROADS 1745v_road_z_offset=a_z_offset;v_tile_pos=pos+offset2*u_pixels_to_tile_units;gl_Position=u_matrix*vec4(v_tile_pos,a_z_offset,1.0); 1746#else 1747#ifdef ELEVATED 1748vec2 offsetTile=offset2*u_pixels_to_tile_units;vec2 offset_pos=pos+offsetTile;float ele=0.0;float scaled_z_offset=a_z_offset; 1749#ifdef ELEVATION_GROUND_SCALE 1750scaled_z_offset=a_z_offset*mix(1.0,u_exaggeration,a_elevation_ground_scale); 1751#endif 1752#ifdef CROSS_SLOPE_VERTICAL 1753float top=pos_normal.y-2.0*floor(pos_normal.y*0.5);float line_height=2.0*u_tile_to_meter*outset*top*u_pixels_to_tile_units[1][1]+scaled_z_offset;ele=sample_elevation(offset_pos)+line_height;projected_extrude=vec4(0); 1754#else 1755#ifdef CROSS_SLOPE_HORIZONTAL 1756float ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,max(ele1,ele2));ele=ele_max+scaled_z_offset; 1757#else 1758float ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,0.5*(ele1+ele2));ele=ele_max-ele0+ele1+scaled_z_offset; 1759#endif 1760#endif 1761v_tile_pos=offset_pos;gl_Position=u_matrix*vec4(v_tile_pos,ele,1.0)+projected_extrude;float z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*u_zbias_factor*u_exaggeration);gl_Position.z-=(gl_Position.w*zbias);gl_Position=mix(gl_Position,AWAY,hidden); 1762#else 1763v_tile_pos=pos+offset2*u_pixels_to_tile_units;gl_Position=u_matrix*vec4(v_tile_pos,0.0,1.0); 1764#endif 1765#endif 1766#ifndef ELEVATED 1767#ifndef VARIABLE_LINE_WIDTH 1768#ifndef RENDER_TO_TEXTURE 1769float base_w=gl_Position.w;vec2 screen_width=abs(projected_extrude.xy/base_w*u_units_to_pixels);float max_extrude_component=max(screen_width.x,screen_width.y);if (width >=1.0 && base_w > 0.0 && max_extrude_component > 0.0001) {float min_pixel=1.05;if (max_extrude_component < min_pixel) {vec2 abs_pos=abs(gl_Position.xy);float is_out=max(abs_pos.x,abs_pos.y)/base_w;dilute_scale=mix(max_extrude_component/min_pixel,1.0,smoothstep(2.5,4.5,is_out));projected_extrude/=dilute_scale;}else if (gapwidth > 0.0) {float visible_ratio=(halfwidth+ANTIALIASING)/outset;vec2 visible_screen_width=screen_width*visible_ratio;float max_visible_component=max(visible_screen_width.x,visible_screen_width.y);dilute_scale=min(1.0,max_visible_component/min_pixel);}else 1770{ 1771#ifdef RENDER_LINE_BORDER 1772float border_ratio=(border_width*u_width_scale+ANTIALIASING)/outset;screen_width*=border_ratio;float max_border_component=max(screen_width.x,screen_width.y);dilute_border_scale=min(1.0,max_border_component/min_pixel); 1773#endif 1774}} 1775#endif 1776#endif 1777v_tile_pos=(v_tile_pos+extrude)/EXTENT; 1778#ifdef ELEVATED_ROADS 1779gl_Position=gl_Position+projected_extrude; 1780#else 1781gl_Position=mix(gl_Position+projected_extrude,AWAY,hidden); 1782#endif 1783#endif 1784#ifdef ELEVATED_ROADS 1785#ifdef RENDER_SHADOWS 1786vec3 shd_pos=vec3(pos+(offset2+dist)*u_pixels_to_tile_units,a_z_offset);vec3 shd_pos0=shd_pos;vec3 shd_pos1=shd_pos; 1787#ifdef NORMAL_OFFSET 1788vec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1(); 1789#endif 1790v_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w; 1791#endif 1792#endif 1793#ifndef RENDER_TO_TEXTURE 1794float epsilon=0.0001;float extrude_length_without_perspective=max(length(dist),epsilon);float extrude_length_with_perspective=max(length(projected_extrude_xy/gl_Position.w*u_units_to_pixels),epsilon);v_gamma_scale=mix(extrude_length_without_perspective/extrude_length_with_perspective,1.0,step(0.01,blur)); 1795#else 1796v_gamma_scale=1.0; 1797#endif 1798#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET) 1799highp float a_uv_x=a_packed[0];float a_split_index=a_packed[1]; 1800#ifdef RENDER_LINE_GRADIENT 1801highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec3(a_uv_x,a_split_index*texel_height-half_texel_height,line_progress); 1802#else 1803v_uv=vec3(a_uv_x,0.0,line_progress); 1804#endif 1805#endif 1806#ifdef RENDER_LINE_DASH 1807vec4 dashf=vec4(dash);float totalLength=dashf.z+dashf.w/65535.0;float scale=totalLength==0.0 ? 0.0 : u_tile_units_to_pixels/totalLength;v_tex=vec2(a_linesofar*scale/(floorwidth*u_floor_width_scale),(-normal.y*dashf.y+dashf.x+0.5)/u_texsize.y); 1808#endif 1809v_width2_dilute=vec4(outset,inset,dilute_scale,dilute_border_scale); 1810#ifdef FOG 1811v_fog_pos=fog_position(pos); 1812#endif 1813#ifdef INDICATOR_CUTOUT 1814v_z_offset=a_z_offset; 1815#endif 1816}`),linePattern:tr(`#include "_prelude_fog.fragment.glsl" 1817#include "_prelude_lighting.glsl" 1818#include "_prelude_shadow.fragment.glsl" 1819uniform highp float u_device_pixel_ratio;uniform highp float u_width_scale;
1819uniform highp float u_alpha_discard_threshold;uniform highp vec2 u_texsize;uniform highp float u_tile_units_to_pixels;uniform highp vec2 u_trim_offset;uniform highp vec2 u_trim_fade_range;uniform lowp vec4 u_trim_color;uniform sampler2D u_image; 1820#ifdef APPLY_LUT_ON_GPU 1821uniform highp sampler3D u_lutTexture; 1822#endif 1823#ifdef LINE_PATTERN_TRANSITION 1824uniform float u_pattern_transition; 1825#endif 1826in vec2 v_normal;in vec2 v_width2;in highp float v_linesofar;in float v_gamma_scale;in float v_width; 1827#ifdef RENDER_LINE_TRIM_OFFSET 1828in highp vec3 v_uv; 1829#endif 1830#ifdef ELEVATED_ROADS 1831in highp float v_road_z_offset; 1832#endif 1833#ifdef LINE_JOIN_NONE 1834in vec2 v_pattern_data; 1835#endif 1836#ifdef INDICATOR_CUTOUT 1837in highp float v_z_offset; 1838#endif 1839#ifdef RENDER_SHADOWS 1840uniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth; 1841#endif 1842#pragma mapbox: define mediump uvec4 pattern 1843#ifdef LINE_PATTERN_TRANSITION 1844#pragma mapbox: define mediump uvec4 pattern_b 1845#endif 1846#pragma mapbox: define mediump float pixel_ratio 1847#pragma mapbox: define mediump float blur 1848#pragma mapbox: define mediump float opacity 1849#pragma mapbox: define lowp float emissive_strength 1850void main() { 1851#pragma mapbox: initialize mediump uvec4 pattern 1852#ifdef LINE_PATTERN_TRANSITION 1853#pragma mapbox: initialize mediump uvec4 pattern_b 1854#endif 1855#pragma mapbox: initialize mediump float pixel_ratio 1856#pragma mapbox: initialize mediump float blur 1857#pragma mapbox: initialize mediump float opacity 1858#pragma mapbox: initialize lowp float emissive_strength 1859vec2 pattern_tl=vec2(pattern.xy);vec2 pattern_br=vec2(pattern.zw);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;highp float pattern_size=display_size.x/u_tile_units_to_pixels;float aspect=display_size.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(u_width_scale*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);highp float pattern_x=v_linesofar/pattern_size*aspect;highp float x=mod(pattern_x,1.0);highp float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;highp vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));highp vec2 lod_pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(pattern_x,y));vec4 color=textureLodCustom(u_image,pos,lod_pos); 1860#ifdef APPLY_LUT_ON_GPU 1861color=applyLUT(u_lutTexture,color); 1862#endif 1863#ifdef LINE_PATTERN_TRANSITION 1864vec2 pattern_b_tl=vec2(pattern_b.xy);vec2 pattern_b_br=vec2(pattern_b.zw);highp vec2 pos_b=mix(pattern_b_tl*texel_size-texel_size,pattern_b_br*texel_size+texel_size,vec2(x,y));vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);color=color*(1.0-u_pattern_transition)+color_b*u_pattern_transition; 1865#endif 1866#ifdef RENDER_LINE_TRIM_OFFSET 1867highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=v_uv[2];if (trim_end > trim_start) {highp float start_transition=max(0.0,min(1.0,(line_progress-trim_start)/max(u_trim_fade_range[0],1.0e-9)));highp float end_transition=max(0.0,min(1.0,(trim_end-line_progress)/max(u_trim_fade_range[1],1.0e-9)));highp float transition_factor=min(start_transition,end_transition);color=mix(color,color.a*u_trim_color,transition_factor);} 1868#endif 1869#ifdef LINE_JOIN_NONE 1870highp float pattern_len=pattern_size/aspect;highp float segment_phase=pattern_len-mod(v_linesofar-v_pattern_data.x+pattern_len,pattern_len);highp float visible_start=segment_phase-step(pattern_len*0.5,segment_phase)*pattern_len;highp float visible_end=floor((v_pattern_data.y-segment_phase)/pattern_len)*pattern_len+segment_phase;visible_end+=step(pattern_len*0.5,v_pattern_data.y-visible_end)*pattern_len;if (v_pattern_data.x < visible_start || v_pattern_data.x >=visible_end) {color=vec4(0.0);} 1871#endif 1872#ifdef LIGHTING_3D_MODE 1873color=apply_lighting_with_emission_ground(color,emissive_strength); 1874#ifdef RENDER_SHADOWS 1875float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth); 1876#ifdef ELEVATED_ROADS 1877color.rgb*=mix(v_road_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light); 1878#else 1879color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light); 1880#endif 1881#endif 1882#endif 1883#ifdef FOG 1884color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); 1885#endif 1886color*=(alpha*opacity);if (u_alpha_discard_threshold !=0.0) {if (color.a < u_alpha_discard_threshold) {discard;}} 1887#ifdef INDICATOR_CUTOUT 1888color=applyCutout(color,v_z_offset); 1889#endif 1890glFragColor=color; 1891#ifdef DUAL_SOURCE_BLENDING 1892glFragColorSrc1=vec4(vec3(0.0),emissive_strength); 1893#else 1894#ifdef USE_MRT1 1895out_Target1=vec4(emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a); 1896#endif 1897#endif 1898#ifdef OVERDRAW_INSPECTOR 1899glFragColor=vec4(1.0); 1900#endif 1901HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 1902#include "_prelude_shadow.vertex.glsl" 1903#include "_prelude_terrain.vertex.glsl" 1904#define scale 0.015873016 1905in ivec2 a_pos_normal;in uvec4 a_data; 1906#if defined(ELEVATED) || defined(ELEVATED_ROADS) 1907in vec3 a_z_offset_width; 1908#endif 1909#ifdef ELEVATION_GROUND_SCALE 1910in float a_elevation_ground_scale; 1911#endif 1912#ifdef RENDER_LINE_TRIM_OFFSET 1913in highp vec3 a_packed; 1914#endif 1915in highp float a_linesofar; 1916#ifdef LINE_JOIN_NONE 1917in highp vec3 a_pattern_data;out vec2 v_pattern_data; 1918#endif 1919#ifdef INDICATOR_CUTOUT 1920out highp float v_z_offset; 1921#endif 1922uniform mat4 u_matrix;uniform float u_tile_units_to_pixels;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;uniform float u_device_pixel_ratio;uniform float u_width_scale;uniform float u_floor_width_scale; 1923#ifdef ELEVATED 1924uniform lowp float u_zbias_factor;uniform lowp float u_tile_to_meter;float sample_elevation(vec2 apos) { 1925#ifdef ELEVATION_REFERENCE_SEA 1926return 0.0; 1927#else 1928return elevation(apos); 1929#endif 1930} 1931#endif 1932out vec2 v_normal;out vec2 v_width2;out highp float v_linesofar;out float v_gamma_scale;out float v_width; 1933#ifdef RENDER_LINE_TRIM_OFFSET 1934out highp vec3 v_uv; 1935#endif 1936#ifdef ELEVATED_ROADS 1937out highp float v_road_z_offset; 1938#endif 1939#ifdef RENDER_SHADOWS 1940uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth; 1941#endif 1942#pragma mapbox: define mediump float blur 1943#pragma mapbox: define mediump float opacity 1944#pragma mapbox: define mediump float offset 1945#pragma mapbox: define mediump float gapwidth 1946#pragma mapbox: define mediump float width 1947#pragma mapbox: define mediump float floorwidth 1948#pragma mapbox: define mediump uvec4 pattern 1949#ifdef LINE_PATTERN_TRANSITION 1950#pragma mapbox: define mediump uvec4 pattern_b 1951#endif 1952#pragma mapbox: define mediump float pixel_ratio 1953#pragma mapbox: define lowp float emissive_strength 1954void main() { 1955#pragma mapbox: initialize mediump float blur 1956#pragma mapbox: initialize mediump float opacity 1957#pragma mapbox: initialize mediump float offset 1958#pragma mapbox: initialize mediump float gapwidth 1959#pragma mapbox: initialize mediump float width 1960#pragma mapbox: initialize mediump float floorwidth 1961#pragma mapbox: initialize mediump uvec4 pattern 1962#ifdef LINE_PATTERN_TRANSITION 1963#pragma mapbox: initialize mediump uvec4 pattern_b 1964#endif 1965#pragma mapbox: initialize mediump float pixel_ratio 1966#pragma mapbox: initialize lowp float emissive_strength 1967float a_z_offset; 1968#if defined(ELEVATED) || defined(ELEVATED_ROADS) 1969a_z_offset=a_z_offset_width.x; 1970#endif 1971float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=vec2(a_data.xy)-128.0;float a_direction=float(a_data.z & 3u)-1.0;vec2 pos_normal=vec2(a_pos_normal);vec2 pos=floor(pos_normal*0.5);vec2 normal=pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=(u_width_scale*width)/2.0;offset=-1.0*offset*u_width_scale;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);vec2 dist=outset*a_extrude*scale;float u=0.5*a_direction;float t=1.0-abs(u);vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float hidden=float(opacity==0.0);vec2 extrude=dist*u_pixels_to_tile_units;
1971vec4 projected_extrude=u_matrix*vec4(extrude,0.0,0.0);vec2 projected_extrude_xy=projected_extrude.xy; 1972#ifdef ELEVATED_ROADS 1973v_road_z_offset=a_z_offset;gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,a_z_offset,1.0)+projected_extrude; 1974#else 1975#ifdef ELEVATED 1976vec2 offsetTile=offset2*u_pixels_to_tile_units;vec2 offset_pos=pos+offsetTile;float ele=0.0;float scaled_z_offset=a_z_offset; 1977#ifdef ELEVATION_GROUND_SCALE 1978scaled_z_offset=a_z_offset*mix(1.0,u_exaggeration,a_elevation_ground_scale); 1979#endif 1980#ifdef CROSS_SLOPE_VERTICAL 1981float top=pos_normal.y-2.0*floor(pos_normal.y*0.5);float line_height=2.0*u_tile_to_meter*outset*top*u_pixels_to_tile_units[1][1]+scaled_z_offset;ele=sample_elevation(offset_pos)+line_height;projected_extrude=vec4(0); 1982#else 1983#ifdef CROSS_SLOPE_HORIZONTAL 1984float ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,max(ele1,ele2));ele=ele_max+scaled_z_offset; 1985#else 1986float ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,0.5*(ele1+ele2));ele=ele_max-ele0+ele1+scaled_z_offset; 1987#endif 1988#endif 1989gl_Position=u_matrix*vec4(offset_pos,ele,1.0)+projected_extrude;float z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*u_zbias_factor*u_exaggeration);gl_Position.z-=(gl_Position.w*zbias);gl_Position=mix(gl_Position,AWAY,hidden); 1990#else 1991gl_Position=mix(u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude,AWAY,hidden); 1992#endif 1993#endif 1994#ifdef ELEVATED_ROADS 1995#ifdef RENDER_SHADOWS 1996vec3 shd_pos=vec3(pos+(offset2+dist)*u_pixels_to_tile_units,a_z_offset);vec3 shd_pos0=shd_pos;vec3 shd_pos1=shd_pos; 1997#ifdef NORMAL_OFFSET 1998vec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1(); 1999#endif 2000v_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w; 2001#endif 2002#endif 2003#ifndef RENDER_TO_TEXTURE 2004float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude_xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=mix(extrude_length_without_perspective/extrude_length_with_perspective,1.0,step(0.01,blur)); 2005#else 2006v_gamma_scale=1.0; 2007#endif 2008#ifdef RENDER_LINE_TRIM_OFFSET 2009highp float a_uv_x=a_packed[0];highp float line_progress=a_packed[2];v_uv=vec3(a_uv_x,0.0,line_progress); 2010#endif 2011v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=(floorwidth*u_floor_width_scale); 2012#ifdef LINE_JOIN_NONE 2013v_width=(floorwidth*u_floor_width_scale)+ANTIALIASING;mediump float pixels_to_tile_units=1.0/u_tile_units_to_pixels;mediump float pixel_ratio_inverse=1.0/pixel_ratio;mediump float aspect=v_width/(float(pattern.w-pattern.y)*pixel_ratio_inverse);highp float subt_multiple=float(pattern.z-pattern.x)*pixel_ratio_inverse*pixels_to_tile_units*aspect*32.0;highp float subt=floor(a_pattern_data.z/subt_multiple)*subt_multiple;float offset_sign=(fract(a_pattern_data.x)-0.5)*4.0;float line_progress_offset=offset_sign*v_width*0.5*pixels_to_tile_units;v_linesofar=(a_pattern_data.z-subt)+a_linesofar+line_progress_offset;v_pattern_data=vec2(a_pattern_data.x+line_progress_offset,a_pattern_data.y); 2014#endif 2015#ifdef FOG 2016v_fog_pos=fog_position(pos); 2017#endif 2018#ifdef INDICATOR_CUTOUT 2019v_z_offset=a_z_offset; 2020#endif 2021}`),raster:tr(`#include "_prelude_fog.fragment.glsl" 2022#include "_prelude_lighting.glsl" 2023#include "_prelude_raster_array.glsl" 2024uniform float u_fade_t;uniform float u_opacity;uniform highp float u_raster_elevation;uniform highp float u_zoom_transition;in vec2 v_pos0;in vec2 v_pos1;in float v_depth; 2025#ifdef PROJECTION_GLOBE_VIEW 2026in float v_split_fade; 2027#endif 2028uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;uniform float u_emissive_strength; 2029#ifndef RASTER_ARRAY 2030uniform highp sampler2D u_image0;uniform sampler2D u_image1; 2031#endif 2032#ifdef RASTER_COLOR 2033uniform sampler2D u_color_ramp;uniform highp vec4 u_colorization_mix;uniform highp float u_colorization_offset;uniform vec2 u_texture_res; 2034#endif 2035void main() {vec4 color0,color1,color;vec2 value; 2036#ifdef RASTER_COLOR 2037#ifdef RASTER_ARRAY 2038#ifdef RASTER_ARRAY_LINEAR 2039value=mix( 2040raTexture2D_image0_linear(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_linear(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t 2041); 2042#else 2043value=mix( 2044raTexture2D_image0_nearest(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_nearest(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t 2045); 2046#endif 2047if (value.y > 0.0) value.x/=value.y; 2048#else 2049color=mix(texture(u_image0,v_pos0),texture(u_image1,v_pos1),u_fade_t);value=vec2(u_colorization_offset+dot(color.rgb,u_colorization_mix.rgb),color.a); 2050#endif 2051color=texture(u_color_ramp,vec2(value.x,0.5));if (color.a > 0.0) color.rgb/=color.a;color.a*=value.y; 2052#else 2053color0=texture(u_image0,v_pos0);color1=texture(u_image1,v_pos1);if (color0.a > 0.0) color0.rgb/=color0.a;if (color1.a > 0.0) color1.rgb/=color1.a;color=mix(color0,color1,u_fade_t); 2054#endif 2055color.a*=u_opacity; 2056#ifdef GLOBE_POLES 2057color.a*=1.0-smoothstep(0.0,0.05,u_zoom_transition); 2058#endif 2059vec3 rgb=color.rgb;rgb=vec3( 2060dot(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);vec3 out_color=mix(u_high_vec,u_low_vec,rgb); 2061#ifdef LIGHTING_3D_MODE 2062out_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),u_emissive_strength).rgb; 2063#endif 2064#ifdef FOG 2065highp float fog_limit_high_meters=1000000.0;highp float fog_limit_low_meters=600000.0;float fog_limit=1.0-smoothstep(fog_limit_low_meters,fog_limit_high_meters,u_raster_elevation);out_color=fog_dither(fog_apply(out_color,v_fog_pos,fog_limit)); 2066#endif 2067glFragColor=vec4(out_color*color.a,color.a); 2068#ifdef PROJECTION_GLOBE_VIEW 2069glFragColor*=mix(1.0,1.0-smoothstep(0.0,0.05,u_zoom_transition),smoothstep(0.8,0.9,v_split_fade)); 2070#endif 2071#ifdef RENDER_CUTOFF 2072glFragColor=glFragColor*cutoff_opacity(u_cutoff_params,v_depth); 2073#endif 2074#ifdef OVERDRAW_INSPECTOR 2075glFragColor=vec4(1.0); 2076#endif 2077#ifdef USE_MRT1 2078out_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a); 2079#endif 2080HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 2081#include "_prelude_terrain.vertex.glsl" 2082uniform mat4 u_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform mat3 u_grid_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;uniform vec2 u_texture_offset;uniform float u_raster_elevation;uniform float u_zoom_transition;uniform vec2 u_merc_center; 2083#ifdef ELEVATED 2084uniform lowp float u_zbias_factor; 2085#endif 2086#define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8 2087#ifdef GLOBE_POLES 2088in vec3 a_globe_pos;in vec2 a_uv; 2089#else 2090in ivec2 a_pos;in uvec2 a_texture_pos; 2091#endif 2092out vec2 v_pos0;out vec2 v_pos1;out float v_depth; 2093#ifdef PROJECTION_GLOBE_VIEW 2094out float v_split_fade; 2095#endif 2096void main() {vec2 uv; 2097#ifdef GLOBE_POLES 2098vec3 globe_pos=a_globe_pos;uv=a_uv;float ele=u_raster_elevation; 2099#ifdef ELEVATION_REFERENCE_GROUND 2100ele+=elevation(uv*EXTENT); 2101#endif 2102globe_pos+=normalize(globe_pos)*ele*GLOBE_UPSCALE;gl_Position=u_matrix*u_globe_matrix*vec4(globe_pos,1.0); 2103#ifdef FOG 2104v_fog_pos=fog_position((u_normalize_matrix*vec4(a_globe_pos,1.0)).xyz); 2105#endif 2106#else 2107vec4 world_pos; 2108#ifdef PROJECTION_GLOBE_VIEW 2109vec2 texture_pos=vec2(a_texture_pos);uv=texture_pos/8192.0;vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float mercatorX=mercatorXfromLng(latLng[1]); 2110float tiles=u_grid_matrix[0][2];
2110if (tiles > 0.0) {float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];float uvY=mercatorY*tiles-idy;float uvX=mercatorX*tiles-idx;uv=vec2(uvX,uvY);}float ele=u_raster_elevation; 2111#ifdef ELEVATION_REFERENCE_GROUND 2112ele+=elevation(uv*EXTENT)-decomposed_pos_and_skirt.z; 2113#endif 2114vec4 merc_world_pos=vec4(0.0); 2115v_split_fade=0.0;if (u_zoom_transition > 0.0) {vec2 merc_pos=vec2(mercatorX,mercatorY);merc_world_pos=vec4(merc_pos,ele,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;float opposite_merc_center=mod(u_merc_center.x+0.5,1.0);float dist_from_poles=(abs(mercatorY-0.5)*2.0);float range=0.1;v_split_fade=abs(opposite_merc_center-mercatorX);v_split_fade=clamp(1.0-v_split_fade,0.0,1.0);v_split_fade=max(smoothstep(1.0-range,1.0,dist_from_poles),max(smoothstep(1.0-range,1.0,v_split_fade),smoothstep(1.0-range,1.0,1.0-v_split_fade)));}vec3 globe_pos=latLngToECEF(latLng.xy);globe_pos+=normalize(globe_pos)*ele*GLOBE_UPSCALE;vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);world_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0); 2116#ifdef FOG 2117v_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz); 2118#endif 2119#else 2120float ele=0.0;vec2 decodedPos=vec2(a_pos); 2121#ifdef ELEVATION_REFERENCE_GROUND 2122vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;decodedPos=decomposedPosAndSkirt.xy;uv=decodedPos/8192.0;ele=elevation(decodedPos)-skirt; 2123#else 2124uv=vec2(a_texture_pos)/8192.0; 2125#endif 2126world_pos=vec4(decodedPos,(u_raster_elevation+ele),1.0); 2127#ifdef FOG 2128v_fog_pos=fog_position(decodedPos); 2129#endif 2130#endif 2131float w=1.0+dot(uv*EXTENT,u_perspective_transform);gl_Position=u_matrix*world_pos*w; 2132#endif 2133v_pos0=uv;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;v_pos0=u_texture_offset.x+u_texture_offset.y*v_pos0;v_pos1=u_texture_offset.x+u_texture_offset.y*v_pos1; 2134#ifdef ELEVATED 2135float z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*u_zbias_factor);gl_Position.z-=(gl_Position.w*zbias); 2136#endif 2137#ifdef RENDER_CUTOFF 2138v_depth=gl_Position.z; 2139#endif 2140}`),symbol:tr(`#include "_prelude_lighting.glsl" 2141#include "_prelude_shadow.fragment.glsl" 2142#define SDF_PX 8.0 2143#define SDF 1.0 2144#define ICON 0.0 2145uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;uniform bool u_is_halo;uniform lowp float u_scale_factor; 2146#ifdef ICON_TRANSITION 2147uniform float u_icon_transition; 2148#endif 2149#ifdef COLOR_ADJUSTMENT 2150uniform mat4 u_color_adj_mat; 2151#endif 2152#ifdef INDICATOR_CUTOUT 2153in highp float v_z_offset; 2154#else 2155#ifdef RENDER_SHADOWS 2156in highp float v_z_offset; 2157#endif 2158#endif 2159in vec2 v_tex_a; 2160#ifdef ICON_TRANSITION 2161in vec2 v_tex_b; 2162#endif 2163in float v_draw_halo;in vec3 v_gamma_scale_size_fade_opacity; 2164#ifdef RENDER_TEXT_AND_SYMBOL 2165in float is_sdf;in vec2 v_tex_a_icon; 2166#endif 2167#ifdef RENDER_SHADOWS 2168uniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth; 2169#endif 2170#ifdef APPLY_LUT_ON_GPU 2171uniform highp sampler3D u_lutTexture; 2172#endif 2173#ifdef USE_PAINT_PROPERTIES_UBO 2174in lowp float v_opacity; 2175#ifdef RENDER_SDF 2176in lowp vec4 v_fill_np_color;in lowp vec4 v_halo_np_color;in lowp float v_halo_width;in lowp float v_halo_blur; 2177#endif 2178#ifdef LIGHTING_3D_MODE 2179in lowp float v_emissive_strength; 2180#endif 2181#else 2182#pragma mapbox: define highp vec4 fill_color 2183#pragma mapbox: define highp vec4 halo_color 2184#pragma mapbox: define lowp float opacity 2185#pragma mapbox: define lowp float halo_width 2186#pragma mapbox: define lowp float halo_blur 2187#pragma mapbox: define lowp float emissive_strength 2188#endif 2189void main() { 2190#ifdef USE_PAINT_PROPERTIES_UBO 2191lowp float opacity=v_opacity;lowp vec4 fill_color=vec4(0.0);lowp vec4 halo_color=vec4(0.0);lowp float halo_width=0.0;lowp float halo_blur=0.0; 2192#ifdef RENDER_SDF 2193fill_color=vec4(v_fill_np_color.rgb*v_fill_np_color.a,v_fill_np_color.a);halo_color=vec4(v_halo_np_color.rgb*v_halo_np_color.a,v_halo_np_color.a);halo_width=v_halo_width;halo_blur=v_halo_blur; 2194#endif 2195lowp float emissive_strength=0.0; 2196#ifdef LIGHTING_3D_MODE 2197emissive_strength=v_emissive_strength; 2198#endif 2199#else 2200#pragma mapbox: initialize highp vec4 fill_color 2201#pragma mapbox: initialize highp vec4 halo_color 2202#pragma mapbox: initialize lowp float opacity 2203#pragma mapbox: initialize lowp float halo_width 2204#pragma mapbox: initialize lowp float halo_blur 2205#pragma mapbox: initialize lowp float emissive_strength 2206#endif 2207vec4 out_color;float fade_opacity=v_gamma_scale_size_fade_opacity[2]; 2208#ifdef RENDER_TEXT_AND_SYMBOL 2209if (is_sdf==ICON) {vec2 tex_icon=v_tex_a_icon;lowp float alpha=opacity*fade_opacity;
2209glFragColor=texture(u_texture_icon,tex_icon)*alpha; 2210#ifdef OVERDRAW_INSPECTOR 2211glFragColor=vec4(1.0); 2212#endif 2213return;} 2214#endif 2215vec2 cutout_factors=vec2(0.0); 2216#ifdef FEATURE_CUTOUT 2217cutout_factors=get_cutout_factors(gl_FragCoord); 2218#endif 2219#ifdef RENDER_SDF 2220float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_gamma_scale_size_fade_opacity.x;float size=v_gamma_scale_size_fade_opacity.y;float fontScale=u_is_text ? size/24.0 : size;out_color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;bool draw_halo=v_draw_halo > 0.0;if (draw_halo) {out_color=halo_color;gamma=(halo_blur*u_scale_factor*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width*u_scale_factor/fontScale)/SDF_PX;}lowp float dist=texture(u_texture,v_tex_a).r;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);out_color*=alpha; 2221#else 2222#ifdef ICON_TRANSITION 2223vec4 a=texture(u_texture,v_tex_a)*(1.0-u_icon_transition);vec4 b=texture(u_texture,v_tex_b)*u_icon_transition;out_color=(a+b); 2224#else 2225out_color=texture(u_texture,v_tex_a); 2226#endif 2227#ifdef APPLY_LUT_ON_GPU 2228out_color=applyLUT(u_lutTexture,out_color); 2229#endif 2230#ifdef COLOR_ADJUSTMENT 2231out_color=u_color_adj_mat*out_color; 2232#endif 2233#endif 2234out_color*=opacity*fade_opacity; 2235#ifdef LIGHTING_3D_MODE 2236out_color=apply_lighting_with_emission_ground(out_color,emissive_strength); 2237#ifdef RENDER_SHADOWS 2238float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);light=mix(light,1.0,cutout_factors.y); 2239#ifdef TERRAIN 2240out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light); 2241#else 2242out_color.rgb*=mix(v_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light); 2243#endif 2244#endif 2245#endif 2246#ifdef INDICATOR_CUTOUT 2247out_color=applyCutout(out_color,v_z_offset); 2248#endif 2249#ifdef FEATURE_CUTOUT 2250out_color=apply_feature_cutout(out_color,gl_FragCoord,cutout_factors.x); 2251#endif 2252glFragColor=out_color; 2253#ifdef OVERDRAW_INSPECTOR 2254glFragColor=vec4(1.0); 2255#endif 2256HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_terrain.vertex.glsl" 2257#include "_prelude_shadow.vertex.glsl" 2258#define USING_APPEARANCE 1.0 2259in ivec4 a_pos_offset;in uvec4 a_tex_size;in ivec4 a_pixeloffset;in vec4 a_projected_pos;in uint a_fade_opacity; 2260#ifdef Z_OFFSET 2261in float a_auto_z_offset; 2262#endif 2263#ifdef PROJECTION_GLOBE_VIEW 2264in ivec4 a_globe_anchor;in vec3 a_globe_normal; 2265#endif 2266#ifdef ICON_TRANSITION 2267in uvec2 a_texb; 2268#endif 2269#ifdef OCCLUSION_QUERIES 2270in float a_occlusion_query_opacity; 2271#endif 2272#ifdef ELEVATED_ROADS 2273in vec3 a_x_axis;in vec3 a_y_axis;uniform float u_normal_scale; 2274#endif 2275#ifdef INDICATOR_CUTOUT 2276out highp float v_z_offset; 2277#else 2278#ifdef RENDER_SHADOWS 2279out highp float v_z_offset; 2280#endif 2281#endif 2282uniform 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_matrix;uniform mat4 u_inv_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_elevation_from_sea;uniform bool u_pitch_with_map;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 vec3 u_up_vector;uniform vec2 u_texsize_icon;uniform bool u_is_halo; 2283#ifdef PROJECTION_GLOBE_VIEW 2284uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix; 2285#endif 2286out vec2 v_tex_a; 2287#ifdef ICON_TRANSITION 2288out vec2 v_tex_b; 2289#endif 2290out float v_draw_halo;out vec3 v_gamma_scale_size_fade_opacity; 2291#ifdef RENDER_TEXT_AND_SYMBOL 2292out float is_sdf;out vec2 v_tex_a_icon; 2293#endif 2294#ifdef RENDER_SHADOWS 2295uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth; 2296#endif 2297#ifdef USE_PAINT_PROPERTIES_UBO 2298#ifndef MAX_UBO_SIZE_VEC4 2299#define MAX_UBO_SIZE_VEC4 1024u 2300#endif 2301#define SPP_HEADER_SIZE_VEC4 3u 2302#define DWORDS_PER_VEC4 4u 2303struct SymbolPaintProperties {vec4 fill_np_color;vec4 halo_np_color;float opacity;float halo_width;float halo_blur;float emissive_strength;float occlusion_opacity;float z_offset;vec2 translate;};struct PropertyType {bool isDataDriven;bool isZoomDependent;uint offsetDwords;};struct SymbolPropertyHeader {uint dataDrivenBlockSizeVec4;PropertyType fill_np_color;PropertyType halo_np_color;PropertyType opacity;PropertyType halo_width;PropertyType halo_blur;PropertyType emissive_strength;PropertyType occlusion_opacity;PropertyType z_offset;PropertyType translate;};uniform float u_zoom;uniform lowp vec4 u_spp_fill_np_color;uniform lowp vec4 u_spp_halo_np_color;uniform lowp float u_spp_opacity;uniform lowp float u_spp_halo_width;uniform lowp float u_spp_halo_blur;uniform lowp float u_spp_emissive_strength;uniform lowp float u_spp_occlusion_opacity;uniform highp float u_spp_z_offset;uniform lowp vec2 u_spp_translate_rotation;in float a_feature_index;layout(std140) uniform SymbolPaintPropertiesHeaderUniform {uvec4 header[SPP_HEADER_SIZE_VEC4];} u_spp_header;layout(std140) uniform SymbolPaintPropertiesUniform {vec4 properties[MAX_UBO_SIZE_VEC4];} u_spp_properties;layout(std140) uniform SymbolPaintPropertiesIndexUniform {uvec4 block_indices[MAX_UBO_SIZE_VEC4];} u_spp_index;out lowp float v_opacity; 2304#ifdef RENDER_SDF 2305out lowp vec4 v_fill_np_color;out lowp vec4 v_halo_np_color;out lowp float v_halo_width;out lowp float v_halo_blur; 2306#endif 2307#ifdef LIGHTING_3D_MODE 2308out lowp float v_emissive_strength; 2309#endif 2310PropertyType getPropertyType(uint propertyIndex,uint dataDrivenMask,uint zoomDependentMask,uint offsetDwords) {PropertyType type;type.isDataDriven=(dataDrivenMask & (1u << propertyIndex)) !=0u;type.isZoomDependent=(zoomDependentMask & (1u << propertyIndex)) !=0u;type.offsetDwords=offsetDwords;return type;}SymbolPropertyHeader readSymbolPropertiesHeader() {SymbolPropertyHeader header;uint dataDrivenMask=u_spp_header.header[0][0];uint zoomDependentMask=u_spp_header.header[0][1];header.dataDrivenBlockSizeVec4=u_spp_header.header[0][2];header.fill_np_color =getPropertyType(0u,dataDrivenMask,zoomDependentMask,u_spp_header.header[0][3]);header.halo_np_color =getPropertyType(1u,dataDrivenMask,zoomDependentMask,u_spp_header.header[1][0]);header.opacity =getPropertyType(2u,dataDrivenMask,zoomDependentMask,u_spp_header.header[1][1]);header.halo_width =getPropertyType(3u,dataDrivenMask,zoomDependentMask,u_spp_header.header[1][2]);header.halo_blur =getPropertyType(4u,dataDrivenMask,zoomDependentMask,u_spp_header.header[1][3]);header.emissive_strength =getPropertyType(5u,dataDrivenMask,zoomDependentMask,u_spp_header.header[2][0]);header.occlusion_opacity =getPropertyType(6u,dataDrivenMask,zoomDependentMask,u_spp_header.header[2][1]);header.z_offset =getPropertyType(7u,dataDrivenMask,zoomDependentMask,u_spp_header.header[2][2]);header.translate =getPropertyType(8u,dataDrivenMask,zoomDependentMask,u_spp_header.header[2][3]);return header;}uint uvec4At(uvec4 v,uint index) {return (index==0u) ? v.x : 2311(index==1u) ? v.y : 2312(index==2u) ? v.z : v.w;}float vec4At(vec4 v,uint index) {return (index==0u) ? v.x : 2313(index==1u) ? v.y : 2314(index==2u) ? v.z : v.w;}vec4 readVec4(uint baseOffsetVec4,uint propertyOffsetDwords) {return u_spp_properties.properties[baseOffsetVec4+propertyOffsetDwords/DWORDS_PER_VEC4];}float readFloat(vec4 slot,uint propertyOffsetDwords) {return slot[propertyOffsetDwords % DWORDS_PER_VEC4];}uint readUint(uvec4 slot,uint offset) {return slot[offset % DWORDS_PER_VEC4];}vec2 readVec2(vec4 slot,uint propertyOffsetDwords) {float x=vec4At(slot,propertyOffsetDwords % DWORDS_PER_VEC4);float y=vec4At(slot,propertyOffsetDwords % DWORDS_PER_VEC4+1u);return vec2(x,y);}uint getDataDrivenBlockOffsetVec4(uint dataDrivenBlockSizeVec4) {uint featureIndex=uint(a_feature_index);uvec4 slot=u_spp_index.block_indices[featureIndex/DWORDS_PER_VEC4];uint blockIndex=uvec4At(slot,featureIndex % DWORDS_PER_VEC4);return blockIndex*dataDrivenBlockSizeVec4;}vec4 readColorProperty(PropertyType propertyType,uint dataDrivenBlockSizeVec4) {uint blockOffsetVec4=getDataDrivenBlockOffsetVec4(dataDrivenBlockSizeVec4);vec4 color=readVec4(blockOffsetVec4,propertyType.offsetDwords);if (propertyType.isZoomDependent) {color=unpack_mix_color(color,u_zoom);} else {vec2 packedColor=readVec2(color,propertyType.offsetDwords);color=decode_color(packedColor);}return color;}vec2 readVec2Property(PropertyType propertyType,uint dataDrivenBlockSizeVec4) {uint blockOffsetVec4=getDataDrivenBlockOffsetVec4(dataDrivenBlockSizeVec4);vec4 slot=readVec4(blockOffsetVec4,propertyType.offsetDwords);if (propertyType.isZoomDependent) {vec2 minVal=slot.xy;vec2 maxVal=slot.zw;return mix(minVal,maxVal,u_zoom);}return readVec2(slot,propertyType.offsetDwords);}float readFloatProperty(PropertyType propertyType,uint dataDrivenBlockSizeVec4) {uint blockOffsetVec4=getDataDrivenBlockOffsetVec4(dataDrivenBlockSizeVec4);vec4 slot=readVec4(blockOffsetVec4,propertyType.offsetDwords);float value;if (propertyType.isZoomDependent) {vec2 packedValues=readVec2(slot,propertyType.offsetDwords);value=unpack_mix_vec2(packedValues,u_zoom);} else {value=readFloat(slot,propertyType.offsetDwords);}return value;}SymbolPaintProperties readSymbolPaintProperties() {SymbolPropertyHeader header=readSymbolPropertiesHeader();uint sizeVec4=header.dataDrivenBlockSizeVec4;SymbolPaintProperties props;props.fill_np_color =header.fill_np_color.isDataDriven ? readColorProperty(header.fill_np_color,sizeVec4) : u_spp_fill_np_color;props.halo_np_color =header.halo_np_color.isDataDriven ? readColorProperty(header.halo_np_color,sizeVec4) : u_spp_halo_np_color;props.opacity =header.opacity.isDataDriven ? readFloatProperty(header.opacity,sizeVec4) : u_spp_opacity;props.halo_width =header.halo_width.isDataDriven ? readFloatProperty(header.halo_width,sizeVec4) : u_spp_halo_width;props.halo_blur =header.halo_blur.isDataDriven ? readFloatProperty(header.halo_blur,sizeVec4) : u_spp_halo_blur;props.emissive_strength =header.emissive_strength.isDataDriven ? readFloatProperty(header.emissive_strength,sizeVec4) : u_spp_emissive_strength;props.occlusion_opacity =header.occlusion_opacity.isDataDriven ? readFloatProperty(header.occlusion_opacity,sizeVec4) : u_spp_occlusion_opacity;props.z_offset =header.z_offset.isDataDriven ? readFloatProperty(header.z_offset,sizeVec4) : u_spp_z_offset;props.translate =header.translate.isDataDriven ? readVec2Property(header.translate,sizeVec4) : vec2(0.0);return props;} 2315#else 2316#pragma mapbox: define highp vec4 fill_color 2317#pragma mapbox: define highp vec4 halo_color 2318#pragma mapbox: define lowp float opacity 2319#pragma mapbox: define lowp float halo_width 2320#pragma mapbox: define lowp float halo_blur 2321#pragma mapbox: define lowp float emissive_strength 2322#pragma mapbox: define lowp float occlusion_opacity 2323#pragma mapbox: define highp float z_offset 2324#endif 2325vec2 unpack_opacity(uint packedOpacity) {return vec2(float(packedOpacity/2u)/127.0,float(packedOpacity & 1u));}void main() { 2326#ifdef USE_PAINT_PROPERTIES_UBO 2327SymbolPaintProperties paint_properties=readSymbolPaintProperties();lowp float opacity=paint_properties.opacity;v_opacity=opacity; 2328#ifdef RENDER_SDF 2329v_fill_np_color=paint_properties.fill_np_color;v_halo_np_color=paint_properties.halo_np_color;v_halo_width=paint_properties.halo_width;v_halo_blur=paint_properties.halo_blur; 2330#endif 2331#ifdef LIGHTING_3D_MODE 2332v_emissive_strength=paint_properties.emissive_strength; 2333#endif 2334lowp float occlusion_opacity=paint_properties.occlusion_opacity;highp float z_offset=paint_properties.z_offset; 2335#else 2336#pragma mapbox: initialize highp vec4 fill_color 2337#pragma mapbox: initialize highp vec4 halo_color 2338#pragma mapbox: initialize lowp float opacity 2339#pragma mapbox: initialize lowp float halo_width 2340#pragma mapbox: initialize lowp float halo_blur 2341#pragma mapbox: initialize lowp float emissive_strength 2342#pragma mapbox: initialize lowp float occlusion_opacity 2343#pragma mapbox: initialize highp float z_offset 2344#endif 2345vec2 a_pos=vec2(a_pos_offset.xy);vec2 a_offset=vec2(a_pos_offset.zw);vec2 a_tex=vec2(a_tex_size.xy);vec2 a_size=vec2(a_tex_size.zw);float a_size_min=floor(a_size[0]*0.5);float a_size_max= floor(a_size[1]*0.5);float a_apperance=a_size[1]-2.0*a_size_max;vec2 a_pxoffset=vec2(a_pixeloffset.xy);vec2 a_min_font_scale=vec2(a_pixeloffset.zw)/256.0;highp float segment_angle=-a_projected_pos[3];float size;if (a_apperance==USING_APPEARANCE) {size=a_size_max/128.0;} else if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size_max,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 tile_anchor=a_pos;float e=u_elevation_from_sea ? z_offset : z_offset+elevation(tile_anchor); 2346#ifdef Z_OFFSET 2347e+=a_auto_z_offset; 2348#endif 2349vec3 h=elevationVector(tile_anchor)*e;float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;vec3 world_pos_globe; 2350#ifdef PROJECTION_GLOBE_VIEW 2351mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos_globe=vec3(a_globe_anchor)+h;world_pos=mix_globe_mercator(world_pos_globe,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0; 2352#else 2353world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0; 2354#endif 2355vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ? 2356camera_to_anchor_distance/u_camera_to_center_distance : 2357u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp( 23580.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point;vec2 a; 2359#ifdef PROJECTION_GLOBE_VIEW 2360vec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);
2360offsetprojected_point=u_matrix*vec4(vec3(a_globe_anchor)+displacement,1);vec4 projected_point_globe=u_matrix*vec4(world_pos_globe,1);a=projected_point_globe.xy/projected_point_globe.w; 2361#else 2362offsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);a=projected_point.xy/projected_point.w; 2363#endif 2364vec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos; 2365#ifdef PROJECTION_GLOBE_VIEW 2366#ifdef PROJECTED_POS_ON_VIEWPORT 2367projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xyz+h,1.0); 2368#else 2369vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz,mercator_pos,u_zoom_transition)+h;projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0); 2370#endif 2371#else 2372projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0); 2373#endif 2374highp 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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0); 2375#ifdef TERRAIN 2376#ifdef PITCH_WITH_MAP_TERRAIN 2377vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy); 2378#endif 2379#endif 2380#ifdef Z_OFFSET 2381z+=u_pitch_with_map ? a_auto_z_offset+z_offset : 0.0; 2382#else 2383z+=u_pitch_with_map ? z_offset : 0.0; 2384#endif 2385float occlusion_fade=globe_occlusion_fade;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float out_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change)); 2386#ifdef DEPTH_OCCLUSION 2387float depth_occlusion=occlusionFadeMultiSample(projected_point);float depth_occlusion_multplier=mix(occlusion_opacity,1.0,depth_occlusion);out_fade_opacity*=depth_occlusion_multplier; 2388#endif 2389#ifdef OCCLUSION_QUERIES 2390float occludedFadeMultiplier=mix(occlusion_opacity,1.0,a_occlusion_query_opacity);out_fade_opacity*=occludedFadeMultiplier; 2391#endif 2392#ifdef Z_TEST_OCCLUSION 2393out_fade_opacity*=occlusion_opacity; 2394#endif 2395float alpha=opacity*out_fade_opacity;float hidden=float(alpha==0.0 || projected_point.w <=0.0 || occlusion_fade==0.0);vec3 pos; 2396#ifdef PROJECTION_GLOBE_VIEW 2397vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);pos=projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y; 2398#else 2399#ifdef ELEVATED_ROADS 2400vec3 xAxis=vec3(a_x_axis.xy,a_x_axis.z*u_normal_scale);vec3 yAxis=vec3(a_y_axis.xy,a_y_axis.z*u_normal_scale);pos=projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y; 2401#else 2402pos=vec3(projected_pos.xy/projected_pos.w+offset,z); 2403#endif 2404#endif 2405gl_Position=mix(u_coord_matrix*vec4(pos,1.0),AWAY,hidden); 2406#ifdef USE_PAINT_PROPERTIES_UBO 2407{vec2 tr=paint_properties.translate;vec2 rotated_tr=vec2( 2408u_spp_translate_rotation.x*tr.x-u_spp_translate_rotation.y*tr.y,u_spp_translate_rotation.y*tr.x+u_spp_translate_rotation.x*tr.y 2409);gl_Position.xy+=(u_coord_matrix*vec4(rotated_tr,0.0,0.0)).xy;} 2410#endif 2411float gamma_scale=gl_Position.w;v_draw_halo=(u_is_halo && float(gl_InstanceID)==0.0) ? 1.0 : 0.0;v_gamma_scale_size_fade_opacity=vec3(gamma_scale,size,out_fade_opacity);v_tex_a=a_tex/u_texsize; 2412#ifdef RENDER_TEXT_AND_SYMBOL 2413is_sdf=a_size[0]-2.0*a_size_min;v_tex_a_icon=a_tex/u_texsize_icon; 2414#endif 2415#ifdef ICON_TRANSITION 2416v_tex_b=vec2(a_texb)/u_texsize; 2417#endif 2418#ifdef RENDER_SHADOWS 2419vec4 shd_pos=u_inv_matrix*vec4(pos,1.0);vec3 shd_pos0=shd_pos.xyz;vec3 shd_pos1=shd_pos.xyz; 2420#ifdef NORMAL_OFFSET 2421vec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1(); 2422#endif 2423v_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w; 2424#endif 2425#ifdef INDICATOR_CUTOUT 2426v_z_offset=e; 2427#else 2428#ifdef RENDER_SHADOWS 2429v_z_offset=e; 2430#endif 2431#endif 2432}`),terrainRaster:tr(`#include "_prelude_fog.fragment.glsl" 2433#include "_prelude_shadow.fragment.glsl" 2434#include "_prelude_lighting.glsl" 2435uniform sampler2D u_image0; 2436#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS
2437uniform sampler2D u_image1;uniform float u_emissive_texture_available; 2438#endif 2439in vec2 v_pos0; 2440#ifdef FOG 2441in float v_fog_opacity; 2442#endif 2443#ifdef RENDER_SHADOWS 2444in vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1; 2445#endif 2446uniform vec3 u_ground_shadow_factor;void main() {vec4 image_color=texture(u_image0,v_pos0);vec4 color; 2447#ifdef LIGHTING_3D_MODE 2448const vec3 normal=vec3(0.0,0.0,1.0); 2449#ifdef RENDER_SHADOWS 2450float cutoffOpacity=1.0; 2451#ifdef RENDER_CUTOFF 2452cutoffOpacity=cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w); 2453#endif 2454#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS 2455float emissive_strength=u_emissive_texture_available > 0.5 ? texture(u_image1,v_pos0).r : image_color.a;vec3 unlit_base=image_color.rgb*(1.0-emissive_strength);vec3 emissive_base=image_color.rgb*emissive_strength;float ndotl=u_shadow_direction.z;float occlusion=ndotl < 0.0 ? 1.0 : shadow_occlusion(v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,0.0);ndotl=max(0.0,ndotl);vec3 lit=apply_lighting(unlit_base,normal,mix(1.0,(1.0-(u_shadow_intensity*occlusion))*ndotl,cutoffOpacity));vec3 emissive=compute_emissive_draped(emissive_base,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=lit+emissive;color.a=1.0; 2456#else 2457float lighting_factor=shadowed_light_factor_normal_unbiased(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);color=apply_lighting(image_color,normal,mix(1.0,lighting_factor,cutoffOpacity)); 2458#endif 2459#else 2460float lighting_factor=u_lighting_directional_dir.z;color=apply_lighting(image_color,normal,lighting_factor); 2461#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS 2462float emissive_strength=u_emissive_texture_available > 0.5 ? texture(u_image1,v_pos0).r : image_color.a;color.rgb=mix(color.rgb,image_color.rgb,emissive_strength);color.a=1.0; 2463#endif 2464#endif 2465#else 2466color=image_color; 2467#endif 2468#ifdef FOG 2469#ifdef ZERO_EXAGGERATION 2470color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); 2471#else 2472color=fog_dither(fog_apply_from_vert(color,v_fog_opacity)); 2473#endif 2474#endif 2475glFragColor=color; 2476#ifdef OVERDRAW_INSPECTOR 2477glFragColor=vec4(1.0); 2478#endif 2479HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 2480#include "_prelude_terrain.vertex.glsl" 2481uniform mat4 u_matrix;uniform float u_skirt_height;in ivec2 a_pos;out vec2 v_pos0; 2482#ifdef FOG 2483out float v_fog_opacity; 2484#endif 2485#ifdef RENDER_SHADOWS 2486uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1; 2487#endif 2488void main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height;v_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0); 2489#ifdef FOG 2490#ifdef ZERO_EXAGGERATION 2491v_fog_pos=fog_position(decodedPos); 2492#else 2493v_fog_opacity=fog(fog_position(vec3(decodedPos,elevation))); 2494#endif 2495#endif 2496#ifdef RENDER_SHADOWS 2497vec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.); 2498#endif 2499}`),terrainDepth:tr("precision highp float;in float v_depth;void main() {glFragColor=pack_depth(v_depth);}",`#include "_prelude_terrain.vertex.glsl" 2500uniform mat4 u_matrix;in ivec2 a_pos;out float v_depth;void main() {float elevation=elevation(vec2(a_pos));gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}`),skybox:tr(`#include "_prelude_fog.fragment.glsl" 2501in lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep( 2502cos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(e
2502nd-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=texture(u_cubemap,uv).rgb; 2503#ifdef FOG 2504sky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color); 2505#endif 2506sky_color+=0.1*sun_disk(v_uv,u_sun_direction);glFragColor=vec4(sky_color*u_opacity,u_opacity); 2507#ifdef OVERDRAW_INSPECTOR 2508glFragColor=vec4(1.0); 2509#endif 2510}`,e0),skyboxGradient:tr(`#include "_prelude_fog.fragment.glsl" 2511in highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture(u_color_ramp,vec2(progress,0.5)); 2512#ifdef FOG 2513color.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a; 2514#endif 2515color*=u_opacity;glFragColor=color; 2516#ifdef OVERDRAW_INSPECTOR 2517glFragColor=vec4(1.0); 2518#endif 2519}`,e0),skyboxCapture:tr(` 2520in highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m;precision highp float; 2521#define BETA_R vec3(5.5e-6,13.0e-6,22.4e-6) 2522#define BETA_M vec3(21e-6,21e-6,21e-6) 2523#define MIE_G 0.76 2524#define DENSITY_HEIGHT_SCALE_R 8000.0 2525#define DENSITY_HEIGHT_SCALE_M 1200.0 2526#define PLANET_RADIUS 6360e3 2527#define ATMOSPHERE_RADIUS 6420e3 2528#define SAMPLE_STEPS 10 2529#define DENSITY_STEPS 4 2530float ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}
2530float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;glFragColor=vec4(color,1.0);}`,"in highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;out highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(e
2530nd-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:tr(`#include "_prelude_fog.fragment.glsl" 2531#include "_prelude_lighting.glsl" 2532uniform sampler2D u_image0; 2533#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS 2534uniform sampler2D u_image1;uniform float u_emissive_texture_available; 2535#endif 2536uniform float u_far_z_cutoff;in vec2 v_pos0; 2537#ifndef FOG 2538uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport; 2539#endif 2540void main() {vec4 color; 2541#ifdef CUSTOM_ANTIALIASING 2542highp vec2 uv=gl_FragCoord.xy/u_viewport; 2543#ifdef FLIP_Y 2544uv.y=1.0-uv.y; 2545#endif 2546highp vec3 ray_dir=mix( 2547mix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;highp float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);highp float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture(u_image0,v_pos0); 2548#ifdef LIGHTING_3D_MODE 2549#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS 2550float emissive_strength=u_emissive_texture_available > 0.5 ? texture(u_image1,v_pos0).r : raster.a;raster=apply_lighting_with_emission_ground(raster,emissive_strength);color=vec4(clamp(raster.rgb,vec3(0),vec3(1))*antialias,antialias); 2551#else 2552raster=apply_lighting_ground(raster);color=vec4(raster.rgb*antialias,raster.a*antialias); 2553#endif 2554#else 2555color=vec4(raster.rgb*antialias,raster.a*antialias); 2556#endif 2557#else 2558color=texture(u_image0,v_pos0); 2559#ifdef LIGHTING_3D_MODE 2560#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS 2561float emissive_strength=u_emissive_texture_available > 0.5 ? texture(u_image1,v_pos0).r : color.a;color=apply_lighting_with_emission_ground(color,emissive_strength);color.a=1.0; 2562#else 2563color=apply_lighting_ground(color); 2564#endif 2565#endif 2566#endif 2567#ifdef FOG 2568color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); 2569#endif 2570color*=1.0-step(u_far_z_cutoff,1.0/gl_FragCoord.w);glFragColor=color; 2571#ifdef OVERDRAW_INSPECTOR 2572glFragColor=vec4(1.0); 2573#endif 2574HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 2575#include "_prelude_terrain.vertex.glsl" 2576uniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height; 2577#ifdef GLOBE_POLES 2578in vec3 a_globe_pos;in vec2 a_uv; 2579#else 2580in ivec2 a_pos; 2581#endif 2582out vec2 v_pos0;void main() { 2583#ifdef GLOBE_POLES 2584vec3 globe_pos=a_globe_pos;vec2 uv=a_uv; 2585#else 2586float tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY); 2587#endif 2588v_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale; 2589#ifdef GLOBE_POLES 2590vec3 up_vector=globe_derived_up_vector; 2591#else 2592vec3 up_vector=elevationVector(tile_pos); 2593#endif 2594float height=elevation(tile_pos);globe_pos+=up_vector*height; 2595#ifndef GLOBE_POLES 2596globe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z; 2597#endif 2598#ifdef GLOBE_POLES 2599vec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0); 2600#else 2601vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0); 2602#endif 2603gl_Position=u_proj_matrix*interpolated_pos; 2604#ifdef FOG 2605v_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz); 2606#endif 2607}`),globeAtmosphere:tr(`#include "_prelude_fog.fragment.glsl" 2608uniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec4 u_atmosphere_fog_color;uniform vec4 u_high_color;uniform vec4 u_space_color;uniform float u_horizon_angle;in highp vec3 v_ray_dir;in highp vec3 v_horizon_dir;void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir; 2609#ifdef PROJECTION_GLOBE_VIEW 2610globe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) { 2611#ifdef ALPHA_PASS 2612glFragColor=vec4(0,0,0,0);return; 2613#else 2614#ifdef NATIVE 2615glFragColor=vec4(1,1,1,1); 2616#else 2617glFragColor=vec4(0,0,0,1); 2618#endif 2619return; 2620#endif 2621} 2622#endif 2623highp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ? 26240.0 : max(acos(clamp(dot(dir,horizon_dir),-1.0,1.0)),0.0);float horizon_angle; 2625#ifdef PROJECTION_GLOBE_VIEW 2626highp vec3 closest_point=globe_pos_dot_dir*dir;highp float closest_point_to_center=length(closest_point-u_globe_pos);highp float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ? 2627PI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t); 2628#else 2629horizon_angle=horizon_angle_mercator; 2630#endif 2631horizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_atmosphere_fog_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_atmosphere_fog_color.rgb;vec3 color_stop_1=u_high_color.rgb;
2631vec3 color_stop_2=u_space_color.rgb; 2632#ifdef ALPHA_PASS 2633float a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);glFragColor=vec4(1.0,1.0,1.0,a); 2634#else 2635vec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c=c2;glFragColor=vec4(c*t,t); 2636#endif 2637}`,`in vec3 a_pos;in vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;out highp vec3 v_ray_dir;out highp vec3 v_horizon_dir;void main() {v_ray_dir=mix( 2638mix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix( 2639mix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}`),model:tr(`#include "_prelude_fog.fragment.glsl" 2640#include "_prelude_shadow.fragment.glsl" 2641#include "_prelude_lighting.glsl" 2642uniform float u_opacity; 2643#ifdef DITHERED_DISCARD 2644uniform float u_dithered_discard_threshold; 2645#endif 2646uniform vec3 u_lightcolor;uniform vec3 u_lightpos;uniform float u_lightintensity;uniform vec4 u_baseColorFactor;uniform vec4 u_emissiveFactor;uniform float u_metallicFactor;uniform float u_roughnessFactor;uniform float u_emissive_strength;in highp vec4 v_position_height;in lowp vec4 v_color_mix; 2647#ifdef RENDER_SHADOWS 2648in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in float v_depth_shadows; 2649#endif 2650#ifdef OCCLUSION_TEXTURE_TRANSFORM 2651uniform vec4 u_occlusionTextureTransform; 2652#endif 2653#pragma mapbox: define-attribute highp vec3 normal_3f 2654#pragma mapbox: define-attribute highp vec3 color_3f 2655#pragma mapbox: define-attribute highp vec4 color_4f 2656#pragma mapbox: define-attribute highp vec2 uv_2f 2657#pragma mapbox: initialize-attribute highp vec3 normal_3f 2658#pragma mapbox: initialize-attribute highp vec3 color_3f 2659#pragma mapbox: initialize-attribute highp vec4 color_4f 2660#pragma mapbox: initialize-attribute highp vec2 uv_2f 2661#ifdef HAS_ATTRIBUTE_a_pbr 2662in lowp vec4 v_roughness_metallic_emissive_alpha;in mediump vec4 v_height_based_emission_params; 2663#endif 2664#ifdef HAS_TEXTURE_u_baseColorTexture 2665uniform sampler2D u_baseColorTexture;uniform bool u_baseTextureIsAlpha;uniform bool u_alphaMask;uniform float u_alphaCutoff; 2666#endif 2667#ifdef HAS_TEXTURE_u_metallicRoughnessTexture 2668uniform sampler2D u_metallicRoughnessTexture; 2669#endif 2670#ifdef HAS_TEXTURE_u_occlusionTexture 2671uniform sampler2D u_occlusionTexture;uniform float u_aoIntensity; 2672#endif 2673#ifdef HAS_TEXTURE_u_normalTexture 2674uniform sampler2D u_normalTexture; 2675#endif 2676#ifdef HAS_TEXTURE_u_emissionTexture 2677uniform sampler2D u_emissionTexture; 2678#endif 2679#ifdef APPLY_LUT_ON_GPU 2680uniform highp sampler3D u_lutTexture; 2681#endif 2682#ifdef TERRAIN_FRAGMENT_OCCLUSION 2683in highp float v_depth;uniform highp sampler2D u_depthTexture;uniform highp vec2 u_inv_depth_size;uniform highp vec2 u_depth_range_unpack; 2684#ifdef DEPTH_D24 2685highp float unpack_depth(highp float depth) {return depth*u_depth_range_unpack.x+u_depth_range_unpack.y;} 2686#else 2687highp float unpack_depth_rgba(highp vec4 rgba_depth) 2688{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;} 2689#endif 2690bool isOccluded() {highp vec2 coord=gl_FragCoord.xy*u_inv_depth_size; 2691#ifdef FLIP_Y 2692coord.y=1.0-coord.y; 2693#endif 2694#ifdef DEPTH_D24 2695highp float depth=unpack_depth(texture(u_depthTexture,coord).r); 2696#else 2697highp float depth=unpack_depth_rgba(texture(u_depthTexture,coord)); 2698#endif 2699return v_depth > depth+0.0005;} 2700#endif 2701#define saturate(_x) clamp(_x,0.,1.) 2702vec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}float calculate_NdotL(vec3 normal,vec3 lightDir) {const float ext=0.70710678118;return (clamp(dot(normal,lightDir),-ext,1.0)+ext)/(1.0+ext);}vec3 getDiffuseShadedColor(vec3 albedo,vec3 normal,vec3 lightDir,vec3 lightColor) 2703{ 2704#ifdef LIGHTING_3D_MODE 2705vec3 transformed_normal=vec3(-normal.xy,normal.z);float lighting_factor; 2706#ifdef RENDER_SHADOWS 2707lighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows); 2708#else 2709lighting_factor=saturate(dot(transformed_normal,u_lighting_directional_dir)); 2710#endif 2711return apply_lighting(albedo,transformed_normal,lighting_factor); 2712#else 2713vec3 n=normal;float colorvalue=((albedo.x*0.2126)+(albedo.y*0.7152))+(albedo.z*0.0722);vec3 c=vec3(0.03,0.03,0.03);float directional=clamp(dot(n,vec3(lightDir)),0.0,1.0);directional=mix(1.0-u_lightintensity,max((1.0-colorvalue)+u_lightintensity,1.0),directional);vec3 c3=c+clamp((albedo*directional)*lightColor,mix(vec3(0.0),vec3(0.3),vec3(1.0)-light
2713Color),vec3(1.0));return c3; 2714#endif 2715}vec4 getBaseColor() {vec4 albedo=u_baseColorFactor; 2716#ifdef HAS_ATTRIBUTE_a_color_3f 2717albedo*=vec4(color_3f,1.0); 2718#endif 2719#ifdef HAS_ATTRIBUTE_a_pbr 2720#else 2721#ifdef HAS_ATTRIBUTE_a_color_4f 2722albedo*=color_4f; 2723#endif 2724#endif 2725#if defined (HAS_TEXTURE_u_baseColorTexture) && defined (HAS_ATTRIBUTE_a_uv_2f) 2726vec4 texColor=texture(u_baseColorTexture,uv_2f);if(u_alphaMask) {if (texColor.w < u_alphaCutoff) {discard;}} 2727#ifdef UNPREMULT_TEXTURE_IN_SHADER 2728texColor=vec4(unpremultiplyColor(texColor),1.0); 2729#endif 2730if(u_baseTextureIsAlpha) {if (texColor.r < 0.5) {discard;}} else {texColor.rgb=sRGBToLinear(texColor.rgb);albedo*=texColor;} 2731#endif 2732vec4 color=vec4(mix(albedo.rgb,v_color_mix.rgb,v_color_mix.a),albedo.a); 2733#ifdef APPLY_LUT_ON_GPU 2734color=applyLUT(u_lutTexture,color); 2735#endif 2736return color;}highp mat3 cotangentFrame(highp vec3 N,highp vec3 p,highp vec2 uv ) { 2737#ifdef HAS_TEXTURE_u_normalTexture 2738highp vec3 dp1=vec3(dFdx(p.x),dFdx(p.y),dFdx(p.z));highp vec3 dp2=vec3(dFdy(p.x),dFdy(p.y),dFdy(p.z));highp vec2 duv1=vec2(dFdx(uv.x),dFdx(uv.y));highp vec2 duv2=vec2(dFdy(uv.x),dFdy(uv.y));highp vec3 dp2perp=cross( dp2,N );highp vec3 dp1perp=cross( N,dp1 );highp vec3 T=dp2perp*duv1.x+dp1perp*duv2.x;highp vec3 B=dp2perp*duv1.y+dp1perp*duv2.y; 2739#ifdef FLIP_Y 2740T=-T;B=-B; 2741#endif 2742highp float lengthT=dot(T,T);highp float lengthB=dot(B,B);highp float maxLength=max(lengthT,lengthB);highp float invmax=inversesqrt( maxLength );highp mat3 res=mat3( T*invmax,B*invmax,N );return res; 2743#else 2744return mat3(1.0); 2745#endif 2746}highp vec3 getNormal(){highp vec3 n; 2747#ifdef HAS_ATTRIBUTE_a_normal_3f 2748n=normalize(normal_3f); 2749#else 2750highp vec3 fdx=vec3(dFdx(v_position_height.x),dFdx(v_position_height.y),dFdx(v_position_height.z));highp vec3 fdy=vec3(dFdy(v_position_height.x),dFdy(v_position_height.y),dFdy(v_position_height.z)); 2751#ifdef FLIP_Y 2752n=normalize(cross(fdx,fdy)); 2753#else 2754n=normalize(cross(fdx,fdy))*-1.0; 2755#endif 2756#endif 2757#if defined(HAS_TEXTURE_u_normalTexture) && defined(HAS_ATTRIBUTE_a_uv_2f) 2758vec3 nMap=texture( u_normalTexture,uv_2f).xyz;nMap=normalize(2.0*nMap-vec3(1.0));highp vec3 v=normalize(-v_position_height.xyz);highp mat3 TBN=cotangentFrame(n,v,uv_2f);n=normalize(TBN*nMap); 2759#endif 2760return n;}struct Material {float perceptualRoughness;float alphaRoughness;float metallic;vec3 f90;vec4 baseColor;vec3 diffuseColor;vec3 specularColor;highp vec3 normal;};Material getPBRMaterial() {Material mat;mat.baseColor=getBaseColor();mat.perceptualRoughness=u_roughnessFactor;mat.metallic=u_metallicFactor; 2761#ifdef HAS_ATTRIBUTE_a_pbr 2762mat.perceptualRoughness=v_roughness_metallic_emissive_alpha.x;mat.metallic=v_roughness_metallic_emissive_alpha.y;mat.baseColor.w*=v_roughness_metallic_emissive_alpha.w; 2763#endif 2764#if defined(HAS_TEXTURE_u_metallicRoughnessTexture) && defined(HAS_ATTRIBUTE_a_uv_2f) 2765vec4 mrSample=texture(u_metallicRoughnessTexture,uv_2f);mat.perceptualRoughness*=mrSample.g;mat.metallic*=mrSample.b; 2766#endif 2767const float c_minRoughness=0.04;mat.perceptualRoughness=clamp(mat.perceptualRoughness,c_minRoughness,1.0);mat.metallic=saturate(mat.metallic);mat.alphaRoughness=mat.perceptualRoughness*mat.perceptualRoughness;const vec3 f0=vec3(0.04);mat.diffuseColor=mat.baseColor.rgb*(vec3(1.0)-f0);mat.diffuseColor*=1.0-mat.metallic;mat.specularColor=mix(f0,mat.baseColor.rgb,mat.metallic);highp float reflectance=max(max(mat.specularColor.r,mat.specularColor.g),mat.specularColor.b);highp float reflectance90=saturate(reflectance*25.0);mat.f90=vec3(reflectance90);mat.normal=getNormal();return mat;}float V_GGX(float NdotL,float NdotV,float roughness) 2768{float a2=roughness*roughness;float GGXV=NdotL*sqrt(NdotV*NdotV*(1.0-a2)+a2);float GGXL=NdotV*sqrt(NdotL*NdotL*(1.0-a2)+a2);return 0.5/(GGXV+GGXL);}float V_GGXFast(float NdotL,float NdotV,float roughness) {float a=roughness;float GGXV=NdotL*(NdotV*(1.0-a)+a);float GGXL=NdotV*(NdotL*(1.0-a)+a);return 0.5/(GGXV+GGXL);}vec3 F_Schlick(vec3 specularColor,vec3 f90,float VdotH) 2769{return specularColor+(f90-specularColor)*pow(clamp(1.0-VdotH,0.0,1.0),5.0);}vec3 F_SchlickFast(vec3 specularColor,float VdotH) 2770{float x=1.0-VdotH;float x4=x*x*x*x;return specularColor+(1.0-specularColor)*x4*x;}float D_GGX(highp float NdotH,float alphaRoughness) 2771{highp float a4=alphaRoughness*alphaRoughness;highp float f=(NdotH*a4-NdotH)*NdotH+1.0;return a4/(PI*f*f);}vec3 diffuseBurley(Material mat,float LdotH,float NdotL,float NdotV) 2772{float f90=2.0*LdotH*LdotH*mat.alphaRoughness-0.5;return (mat.diffuseColor/PI)*(1.0+f90*pow((1.0-NdotL),5.0))*(1.0+f90*pow((1.0-NdotV),5.0));}vec3 diffuseLambertian(Material mat) 2773{ 2774#ifdef LIGHTING_3D_MODE 2775return mat.diffuseColor; 2776#else 2777return mat.diffuseColor/PI; 2778#endif 2779}vec3 EnvBRDFApprox(vec3 specularColor,float roughness,highp float NdotV) 2780{vec4 c0=vec4(-1,-0.0275,-0.572,0.022);vec4 c1=vec4(1,0.0425,1.04,-0.04);highp vec4 r=roughness*c0+c1;highp float a004=min(r.x*r.x,exp2(-9.28*NdotV))*r.x+r.y;vec2 AB=vec2(-1.04,1.04)*a004+r.zw;return specularColor*AB.x+AB.y;}vec3 computeIndirectLightContribution(Material mat,float NdotV,vec3 normal) 2781{vec3 env_light=vec3(0.65,0.65,0.65); 2782#ifdef LIGHTING_3D_MODE 2783float ambient_factor=calculate_ambient_directional_factor(normal);env_light=u_lighting_ambient_color*ambient_factor; 2784#endif 2785vec3 envBRDF=EnvBRDFApprox(mat.specularColor,mat.perceptualRoughness,NdotV);vec3 indirectSpecular= envBRDF*env_light;vec3 indirectDiffuse=mat.diffuseColor*env_light;return indirectSpecular+indirectDiffuse;}vec3 computeLightContribution(Material mat,vec3 lightPosition,vec3 lightColor) 2786{highp vec3 n=mat.normal;highp vec3 v=normalize(-v_position_height.xyz);highp vec3 l=normalize(lightPosition);highp vec3 h=normalize(v+l);float NdotV=clamp(abs(dot(n,v)),0.001,1.0);float NdotL=saturate(dot(n,l));highp float NdotH=saturate(dot(n,h));float VdotH=saturate(dot(v,h));vec3 f=F_SchlickFast(mat.specularColor,VdotH);float g=V_GGXFast(NdotL,NdotV,mat.alphaRoughness);float d=D_GGX(NdotH,mat.alphaRoughness);vec3 diffuseTerm=(1.0-f)*diffuseLambertian(mat);vec3 specularTerm=f*g*d;vec3 transformed_normal=vec3(-n.xy,n.z);float lighting_factor; 2787#ifdef RENDER_SHADOWS 2788lighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows); 2789#else 2790lighting_factor=NdotL; 2791#endif 2792vec3 directLightColor=(specularTerm+diffuseTerm)*lighting_factor*light
2792Color;vec3 indirectLightColor=computeIndirectLightContribution(mat,NdotV,transformed_normal);vec3 color=(saturate(directLightColor)+indirectLightColor);float intensityFactor=1.0; 2793#if !defined(LIGHTING_3D_MODE) 2794const vec3 luminosityFactor=vec3(0.2126,0.7152,0.0722);float luminance=dot(diffuseTerm,luminosityFactor);intensityFactor=mix((1.0-u_lightintensity),max((1.0-luminance+u_lightintensity),1.0),NdotL); 2795#endif 2796color*=intensityFactor;return color;}void main() { 2797#ifdef TERRAIN_FRAGMENT_OCCLUSION 2798if (isOccluded()) {discard;} 2799#endif 2800vec3 lightDir=u_lightpos;vec3 lightColor=u_lightcolor; 2801#ifdef LIGHTING_3D_MODE 2802lightDir=u_lighting_directional_dir;lightDir.xy=-lightDir.xy;lightColor=u_lighting_directional_color; 2803#endif 2804vec4 finalColor; 2805#ifdef DIFFUSE_SHADED 2806vec3 N=getNormal();vec3 baseColor=getBaseColor().rgb;vec3 diffuse=getDiffuseShadedColor(baseColor,N,lightDir,lightColor); 2807#ifdef HAS_TEXTURE_u_occlusionTexture 2808float ao=(texture(u_occlusionTexture,uv_2f).r-1.0)*u_aoIntensity+1.0;diffuse*=ao; 2809#endif 2810finalColor=vec4(mix(diffuse,baseColor,u_emissive_strength),1.0)*u_opacity; 2811#else 2812Material mat=getPBRMaterial();vec3 color=computeLightContribution(mat,lightDir,lightColor);float ao=1.0; 2813#if defined (HAS_TEXTURE_u_occlusionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f) 2814#ifdef OCCLUSION_TEXTURE_TRANSFORM 2815vec2 uv=uv_2f.xy*u_occlusionTextureTransform.zw+u_occlusionTextureTransform.xy; 2816#else 2817vec2 uv=uv_2f; 2818#endif 2819ao=(texture(u_occlusionTexture,uv).x-1.0)*u_aoIntensity+1.0;color*=ao; 2820#endif 2821vec4 emissive=u_emissiveFactor; 2822#if defined(HAS_TEXTURE_u_emissionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f) 2823emissive.rgb*=sRGBToLinear(texture(u_emissionTexture,uv_2f).rgb); 2824#endif 2825#ifdef APPLY_LUT_ON_GPU 2826float emissiveFactorLength=max(length(u_emissiveFactor.rgb),0.001);emissive.rgb=sRGBToLinear(applyLUT(u_lutTexture,linearTosRGB(emissive.rgb/emissiveFactorLength).rbg))*emissiveFactorLength; 2827#endif 2828color+=emissive.rgb;float opacity=mat.baseColor.w*u_opacity; 2829#ifdef HAS_ATTRIBUTE_a_pbr 2830float resEmission=v_roughness_metallic_emissive_alpha.z;resEmission*=v_height_based_emission_params.z+v_height_based_emission_params.w*pow(clamp(v_height_based_emission_params.x,0.0,1.0),v_height_based_emission_params.y);vec3 color_mix=v_color_mix.rgb; 2831#ifdef APPLY_LUT_ON_GPU 2832color_mix=applyLUT(u_lutTexture,color_mix); 2833#endif 2834color=mix(color,color_mix,min(1.0,resEmission)); 2835#ifdef HAS_ATTRIBUTE_a_color_4f 2836float distance=length(vec2(1.3*max(0.0,abs(color_4f.x)-color_4f.z),color_4f.
2836y));distance+= mix(0.5,0.0,clamp(resEmission-1.0,0.0,1.0));opacity*=v_roughness_metallic_emissive_alpha.w*saturate(1.0-distance*distance); 2837#endif 2838#endif 2839vec3 unlitColor=mat.baseColor.rgb*ao+emissive.rgb;color=mix(color,unlitColor,u_emissive_strength);color=linearTosRGB(color);color*=opacity;finalColor=vec4(color,opacity); 2840#endif 2841#ifdef DITHERED_DISCARD 2842if (abs(u_dithered_discard_threshold) < 1.0) {float ditherValue=fract(52.9829189*fract(0.06711056*gl_FragCoord.x+0.00583715*gl_FragCoord.y));float compareValue=mix(1.0-ditherValue,ditherValue,step(0.0,u_dithered_discard_threshold));if (abs(u_dithered_discard_threshold) < compareValue) {discard;}} 2843#endif 2844#ifdef FOG 2845finalColor=fog_dither(fog_apply_premultiplied(finalColor,v_fog_pos,v_position_height.w)); 2846#endif 2847#ifdef RENDER_CUTOFF 2848finalColor*=v_cutoff_opacity; 2849#endif 2850#ifdef INDICATOR_CUTOUT 2851finalColor=applyCutout(finalColor,v_position_height.w); 2852#endif 2853#ifdef FEATURE_CUTOUT 2854finalColor=apply_feature_cutout(finalColor,gl_FragCoord,get_cutout_factors(gl_FragCoord).x); 2855#endif 2856glFragColor=finalColor; 2857#ifdef OVERDRAW_INSPECTOR 2858glFragColor=vec4(1.0); 2859#endif 2860HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 2861#include "_prelude_shadow.vertex.glsl" 2862in vec3 a_pos_3f; 2863#pragma mapbox: define-attribute highp vec3 normal_3f 2864#pragma mapbox: define-attribute highp vec2 uv_2f 2865#pragma mapbox: define-attribute highp vec3 color_3f 2866#pragma mapbox: define-attribute highp vec4 color_4f 2867#pragma mapbox: define-attribute-vertex-shader-only highp uvec4 pbr 2868#pragma mapbox: define-attribute-vertex-shader-only highp vec3 heightBasedEmissiveStrength 2869uniform mat4 u_matrix;uniform mat4 u_node_matrix;uniform mat4 u_lighting_matrix;uniform vec3 u_camera_pos;uniform vec4 u_color_mix; 2870#ifdef INSTANCED_ARRAYS 2871in vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3; 2872#else 2873uniform highp mat4 u_normal_matrix; 2874#endif 2875#ifdef RENDER_SHADOWS 2876uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out float v_depth_shadows; 2877#endif 2878out vec4 v_position_height;out lowp vec4 v_color_mix; 2879#ifdef TERRAIN_FRAGMENT_OCCLUSION 2880out highp float v_depth; 2881#endif 2882#ifdef HAS_ATTRIBUTE_a_pbr 2883out lowp vec4 v_roughness_metallic_emissive_alpha;out mediump vec4 v_height_based_emission_params; 2884#endif 2885vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}void main() { 2886#pragma mapbox: initialize-attribute highp vec3 normal_3f 2887#pragma mapbox: initialize-attribute highp vec2 uv_2f 2888#pragma mapbox: initialize-attribute highp vec3 color_3f 2889#pragma mapbox: initialize-attribute highp vec4 color_4f 2890#pragma mapbox: initialize-attribute-custom highp uvec4 pbr 2891#pragma mapbox: initialize-attribute-custom highp vec3 heightBasedEmissiveStrength 2892highp mat4 normal_matrix; 2893#ifdef INSTANCED_ARRAYS 2894normal_matrix=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3); 2895#else 2896normal_matrix=u_normal_matrix; 2897#endif 2898vec3 local_pos;mat3 rs; 2899#ifdef MODEL_POSITION_ON_GPU 2900vec3 pos_color=normal_matrix[0].xyz;vec4 translate=normal_matrix[1];vec3 pos_a=floor(pos_color);vec3 rgb=1.05*(pos_color-pos_a);float hidden=float(pos_a.x > EXTENT);float color_mix=pos_a.z/100.0;v_color_mix=vec4(sRGBToLinear(rgb),color_mix);float meter_to_tile=normal_matrix[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);rs[0].x=normal_matrix[1].w;rs[0].yz=normal_matrix[2].xy;rs[1].xy=normal_matrix[2].zw;rs[1].z=normal_matrix[3].x;rs[2].xyz=normal_matrix[3].yzw;vec4 pos_node=u_lighting_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;local_pos=pos.xyz;gl_Position=mix(u_matrix*pos,AWAY,hidden);pos.z*=meter_to_tile;v_position_height.xyz=pos.xyz-u_camera_pos; 2901#else 2902local_pos=a_pos_3f;gl_Position=u_matrix*vec4(a_pos_3f,1);v_position_height.xyz=vec3(u_lighting_matrix*vec4(a_pos_3f,1));v_color_mix=vec4(sRGBToLinear(u_color_mix.rgb),u_color_mix.a); 2903#endif 2904v_position_height.w=a_pos_3f.z; 2905#ifdef HAS_ATTRIBUTE_a_pbr 2906vec4 albedo_c=decode_color(vec2(pbr.xy));vec2 e_r_m=unpack_float(float(pbr.z));vec2 r_m= unpack_float(e_r_m.y*16.0);r_m.r=r_m.r*16.0;v_color_mix=vec4(albedo_c.rgb,1.0);v_roughness_metallic_emissive_alpha=vec4(vec3(r_m,e_r_m.x)/255.0,albedo_c.a);v_roughness_metallic_emissive_alpha.z*=2.0;float heightBasedRelativeIntepolation=a_pos_3f.z*heightBasedEmissiveStrength.x+heightBasedEmissiveStrength.y;v_height_based_emission_params.x=heightBasedRelativeIntepolation;v_height_based_emission_params.y=heightBasedEmissiveStrength.z;vec2 emissionMultiplierValues=unpack_float(float(pbr.w))/256.0;v_height_based_emission_params.z=emissionMultiplierValues.x;v_height_based_emission_params.w=emissionMultiplierValues.y-emissionMultiplierValues.x; 2907#endif 2908#ifdef FOG 2909v_fog_pos=fog_position(local_pos); 2910#endif 2911#ifdef RENDER_CUTOFF 2912v_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z); 2913#endif 2914#ifdef TERRAIN_FRAGMENT_OCCLUSION 2915v_depth=gl_Position.z/gl_Position.w; 2916#ifdef CLIP_ZERO_TO_ONE 2917v_depth=-1.0+2.0*v_depth; 2918#endif 2919#endif 2920#ifdef HAS_ATTRIBUTE_a_normal_3f 2921#ifdef MODEL_POSITION_ON_GPU 2922float x_squared_scale=dot(rs[0],rs[0]);float y_squared_scale=dot(rs[1],rs[1]);float z_squared_scale=dot(rs[2],rs[2]);vec3 squared_scale=vec3(x_squared_scale,y_squared_scale,z_squared_scale);normal_3f=rs*((u_lighting_matrix*vec4(normal_3f,0.0)).xyz/squared_scale);normal_3f=normalize(normal_3f); 2923#else
2924normal_3f=vec3(normal_matrix*vec4(normal_3f,0)); 2925#endif 2926#endif 2927#ifdef HAS_ATTRIBUTE_a_pbr 2928#ifdef HAS_ATTRIBUTE_a_color_4f 2929v_roughness_metallic_emissive_alpha.w=clamp(color_4f.a*v_roughness_metallic_emissive_alpha.w*(v_roughness_metallic_emissive_alpha.z-1.0),0.0,1.0); 2930#endif 2931#endif 2932#ifdef RENDER_SHADOWS 2933vec4 shadow_pos=u_node_matrix*vec4(local_pos,1.0); 2934#ifdef NORMAL_OFFSET 2935#ifdef HAS_ATTRIBUTE_a_normal_3f 2936#ifdef MODEL_POSITION_ON_GPU 2937vec3 offset=shadow_normal_offset(vec3(-normal_3f.xy,normal_3f.z));shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0(); 2938#else 2939vec3 offset=shadow_normal_offset_model(normal_3f);shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0(); 2940#endif 2941#endif 2942#endif 2943v_pos_light_view_0=u_light_matrix_0*shadow_pos;v_pos_light_view_1=u_light_matrix_1*shadow_pos;v_depth_shadows=gl_Position.w; 2944#endif 2945}`),modelDepth:tr("void main() {}",`in vec3 a_pos_3f;uniform mat4 u_matrix; 2946#ifdef MODEL_POSITION_ON_GPU 2947#ifdef INSTANCED_ARRAYS 2948in vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3; 2949#else 2950uniform highp mat4 u_instance; 2951#endif 2952uniform highp mat4 u_node_matrix; 2953#endif 2954void main() { 2955#ifdef MODEL_POSITION_ON_GPU 2956highp mat4 instance; 2957#ifdef INSTANCED_ARRAYS 2958instance=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3); 2959#else 2960instance=u_instance; 2961#endif 2962vec3 pos_color=instance[0].xyz;vec4 translate=instance[1];vec3 pos_a=floor(pos_color);float hidden=float(pos_a.x > EXTENT);float meter_to_tile=instance[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);mat3 rs;rs[0].x=instance[1].w;rs[0].yz=instance[2].xy;
2962rs[1].xy=instance[2].zw;rs[1].z=instance[3].x;rs[2].xyz=instance[3].yzw;vec4 pos_node=u_node_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;gl_Position=mix(u_matrix*pos,AWAY,hidden); 2963#else 2964gl_Position=u_matrix*vec4(a_pos_3f,1); 2965#endif 2966}`),stars:tr(`in highp vec2 v_uv;in mediump float v_intensity;float shapeCircle(in vec2 uv) 2967{float beginFade=0.6;float lengthFromCenter=length(v_uv);return 1.0-clamp((lengthFromCenter-beginFade)/(1.0-beginFade),0.0,1.0);}void main() {float alpha=shapeCircle(v_uv);vec3 color=vec3(1.0,1.0,1.0);alpha*=v_intensity;glFragColor=vec4(color*alpha,alpha);HANDLE_WIREFRAME_DEBUG;}`,` 2968in vec3 a_pos_3f;in vec2 a_uv;in float a_size_scale;in float a_opacity;uniform mat4 u_matrix;uniform vec3 u_up;uniform vec3 u_right;uniform float u_intensity_multiplier;out highp vec2 v_uv;out mediump float v_intensity;void main() {v_uv=a_uv;v_intensity=a_opacity*u_intensity_multiplier;vec3 pos=a_pos_3f;pos+=a_uv.x*u_right*a_size_scale;pos+=a_uv.y*u_up*a_size_scale;gl_Position=u_matrix*vec4(pos,1.0);}`),occlusion:tr("uniform vec4 u_color;void main() {glFragColor=u_color;}",`#include "_prelude_terrain.vertex.glsl" 2969in highp vec2 a_offset_xy;uniform highp vec3 u_anchorPos;uniform mat4 u_matrix;uniform vec2 u_screenSizePx;uniform vec2 u_occluderSizePx;void main() {vec3 world_pos=u_anchorPos; 2970#ifdef TERRAIN 2971float e=elevation(world_pos.xy);world_pos.z+=e; 2972#endif 2973vec4 projected_point=u_matrix*vec4(world_pos,1.0);projected_point.xy+=projected_point.w*a_offset_xy*0.5*u_occluderSizePx/u_screenSizePx;gl_Position=projected_point;}`)};function Pc(p,o){const d=p.split(` 2974`);for(let _ of d){if(_=_.trimStart(),_[0]!=="#"||!_.includes("if")||_.startsWith("#endif"))continue;const b=_.match(r0);if(b)for(const S of b)i0.has(S)||o.add(S)}}function vg(p){return new Set(["uint","int","uvec2","ivec2","uvec3","ivec3","uvec4","ivec4"]).has(p)}function tr(p,o){const d=new Set,_=[],b=[];p=p.replace(mg,(T,I)=>(b.push(I),"")),o=o.replace(mg,(T,I)=>(_.push(I),""));let S=new Set(Lp);Pc(p,S),Pc(o,S);for(const T of[..._,...b])_g[T]||(_g[T]=new Set,Pc(Hh[T],_g[T])),S=new Set([...S,..._g[T]]);return{fragmentSource:p=p.replace(gg,(T,I,k,F,z)=>(d.add(z),I==="define"?` 2975#ifndef HAS_UNIFORM_u_${z} 2976${vg(F)?"flat ":""}in ${k} ${F} ${z}; 2977#else 2978uniform ${k} ${F} u_${z}; 2979#endif 2980`:I==="initialize"?` 2981#ifdef HAS_UNIFORM_u_${z} 2982 ${k} ${F} ${z} = u_${z}; 2983#endif 2984`:I==="define-attribute"?` 2985#ifdef HAS_ATTRIBUTE_a_${z} 2986 in ${k} ${F} ${z}; 2987#endif 2988`:I==="initialize-attribute"?"":void 0)),vertexSource:o=o.replace(gg,(T,I,k,F,z)=>{const q=`MATERIAL_ATTRIBUTE_OFFSET_${z}`,j=F==="float"?"vec2":F,Z=`GET_ATTRIBUTE_${j}(a_${z}, materialInfo, ${q})`,te=z.includes("color")?"color":j;return I==="define-attribute-vertex-shader-only"?` 2989#ifdef HAS_ATTRIBUTE_a_${z} 2990in ${k} ${F} a_${z}; 2991#endif 2992`:d.has(z)?I==="define"?` 2993#ifndef HAS_UNIFORM_u_${z} 2994uniform lowp float u_${z}_t; 2995 #if !defined(${q}) 2996 in ${k} ${j} a_${z}; 2997 #endif 2998${vg(F)?"flat ":""}out ${k} ${F} ${z}; 2999#else 3000uniform ${k} ${F} u_${z}; 3001#endif 3002`:I==="initialize"?te==="vec4"||te==="uvec4"?` 3003#ifndef HAS_UNIFORM_u_${z} 3004 ${z} = a_${z}; 3005#else 3006 ${k} ${F} ${z} = u_${z}; 3007#endif 3008`:` 3009#if !defined(HAS_UNIFORM_u_${z}) 3010 #ifdef ${q} 3011 ${z} = unpack_mix_${te}(${Z}, u_${z}_t); 3012 #else 3013 ${z} = unpack_mix_${te}(a_${z}, u_${z}_t); 3014 #endif 3015#else 3016 ${k} ${F} ${z} = u_${z}; 3017#endif 3018`:I==="define-attribute"?` 3019#ifdef HAS_ATTRIBUTE_a_${z} 3020 in ${k} ${F} a_${z}; 3021 out ${k} ${F} ${z}; 3022#endif 3023`:I==="initialize-attribute"?` 3024#ifdef HAS_ATTRIBUTE_a_${z} 3025 ${z} = a_${z}; 3026#endif 3027`:void 0:I==="define"?` 3028#ifndef HAS_UNIFORM_u_${z} 3029uniform lowp float u_${z}_t; 3030 #if !defined(${q}) 3031 in ${k} ${j} a_${z}; 3032 #endif 3033#else 3034uniform ${k} ${F} u_${z}; 3035#endif 3036`:I==="define-instanced"?te==="mat4"?` 3037#ifdef INSTANCED_ARRAYS 3038in vec4 a_${z}0; 3039in vec4 a_${z}1; 3040in vec4 a_${z}2; 3041in vec4 a_${z}3; 3042#else 3043uniform ${k} ${F} u_${z}; 3044#endif 3045`:` 3046#ifdef INSTANCED_ARRAYS 3047in ${k} ${j} a_${z}; 3048#else 3049uniform ${k} ${F} u_${z}; 3050#endif 3051`:I==="initialize-attribute-custom"?` 3052#ifdef HAS_ATTRIBUTE_a_${z} 3053 ${k} ${F} ${z} = a_${z}; 3054#endif 3055`:te==="vec4"||te==="uvec4"?` 3056#ifndef HAS_UNIFORM_u_${z} 3057 #ifdef ${q} 3058 ${k} ${F} ${z} = ${Z}; 3059 #else 3060 ${k} ${F} ${z} = a_${z}; 3061 #endif 3062#else 3063 ${k} ${F} ${z} = u_${z}; 3064#endif 3065`:` 3066#ifndef HAS_UNIFORM_u_${z} 3067 #ifdef ${q} 3068 ${k} ${F} ${z} = unpack_mix_${te}(${Z}, u_${z}_t); 3069 #else 3070 ${k} ${F} ${z} = unpack_mix_${te}(a_${z}, u_${z}_t); 3071 #endif 3072#else 3073 ${k} ${F} ${z} = u_${z}; 3074#endif 3075`}),usedDefines:S,vertexIncludes:_,fragmentIncludes:b}}class a0{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(o,d,_,b,S,T,I,k){this.context=o;let F=this.boundPaintVertexBuffers.length!==b.length;for(let q=0;!F&&q<b.length;q++)this.boundPaintVertexBuffers[q]!==b[q]&&(F=!0);let z=this.boundDynamicVertexBuffers.length!==I.length;for(let q=0;!z&&q<I.length;q++)this.boundDynamicVertexBuffers[q]!==I[q]&&(z=!0);if(!this.vao||this.boundProgram!==d||this.boundLayoutVertexBuffer!==_||F||z||this.boundIndexBuffer!==S||this.boundVertexOffset!==T)this.freshBind(d,_,b,S,T,I,k);else{o.bindVertexArrayOES.set(this.vao);for(const q of I)q&&(q.bind(),k&&q.instanceCount&&q.setVertexAttribDivisor(o.gl,d,k));S&&S.dynamicDraw&&S.bind()}}freshBind(o,d,_,b,S,T,I){const k=this.context,F=k.gl;this.vao&&this.destroy(),this.vao=k.gl.createVertexArray(),k.bindVertexArrayOES.set(this.vao),this.boundProgram=o,this.boundLayoutVertexBuffer=d,this.boundPaintVertexBuffers=_,this.boundIndexBuffer=b,this.boundVertexOffset=S,this.boundDynamicVertexBuffers=T,d.enableAttributes(F,o),d.bind(),d.setVertexAttribPointers(F,o,S);for(const z of _)z.enableAttributes(F,o),z.bind(),z.setVertexAttribPointers(F,o,S);for(const z of T)z&&(z.enableAttributes(F,o),z.bind(),z.setVertexAttribPointers(F,o,S),I&&z.instanceCount&&z.setVertexAttribDivisor(F,o,I));b&&b.bind()}destroy(){this.vao&&(this.context.gl.deleteVertexArray(this.vao),this.vao=null)}}function bg(p,o){const d=Math.pow(2,o.canonical.z),_=o.canonical.y;return[new a.ad(0,_/d).toLngLat().lat,new a.ad(0,(_+1)/d).toLngLat().lat]}function l0(p,o,d,_,b,S,T){const I=p.context,k=I.gl,F=d.hillshadeFBO;if(!F)return;p.prepareDrawTile();const z=p.isTileAffectedByFog(o),q=[];p.terrain&&p.terrain.renderingToTexture&&p.emissiveMode==="mrt-fallback"&&q.push("USE_MRT1");const j=p.getOrCreateProgram("hillshade",{overrideFog:z,defines:q});I.activeTexture.set(k.TEXTURE0),k.bindTexture(k.TEXTURE_2D,F.colorAttachment0.get());const Z=((se,de,pe,ce)=>{const Ce=pe.paint.get("hillshade-shadow-color"),Se=pe.paint.get("hillshade-shadow-color-use-theme").
3075constantOr("default")==="none",Re=pe.paint.get("hillshade-highlight-color"),ve=pe.paint.get("hillshade-highlight-color-use-theme").constantOr("default")==="none",be=pe.paint.get("hillshade-accent-color"),Ae=pe.paint.get("hillshade-accent-color-use-theme").constantOr("default")==="none",Ne=pe.paint.get("hillshade-emissive-strength");let De=a.am(pe.paint.get("hillshade-illumination-direction"));if(pe.paint.get("hillshade-illumination-anchor")==="viewport")De-=se.transform.angle;else if(se.style&&se.style.enable3dLights()&&se.style.directionalLight){const Ke=se.style.directionalLight.properties.get("direction"),Tt=a.cT(Ke.x,Ke.y,Ke.z);De=a.am(Tt[1])}const Ye=!se.options.moving;return{u_matrix:ce||se.transform.calculateProjMatrix(de.tileID.toUnwrapped(),Ye),u_image:0,u_latrange:bg(0,de.tileID),u_light:[pe.paint.get("hillshade-exaggeration"),De],u_shadow:Ce.toPremultipliedRenderColor(Se?null:pe.lut),u_highlight:Re.toPremultipliedRenderColor(ve?null:pe.lut),u_emissive_strength:Ne,u_accent:be.toPremultipliedRenderColor(Ae?null:pe.lut)}})(p,d,_,p.terrain?o.projMatrix:null);p.uploadCommonUniforms(I,j,o.toUnwrapped());const{tileBoundsBuffer:te,tileBoundsIndexBuffer:ee,tileBoundsSegments:oe}=p.getTileBoundsBuffers(d);j.draw(p,k.TRIANGLES,b,S,T,pn.disabled,Z,_.id,te,ee,oe)}function xg(p,o,d){if(!o.needsDEMTextureUpload)return;const _=p.context,b=_.gl;_.pixelStoreUnpackPremultiplyAlpha.set(!1),o.demTexture=o.demTexture||p.getTileTexture(d.stride);const S=d.getPixels();o.demTexture?o.demTexture.update(S,{premultiply:!1}):o.demTexture=new a.T(_,S,b.R32F,{premultiply:!1}),o.needsDEMTextureUpload=!1}function wg(p,o,d){const _=p.context,b=_.gl;if(!o.dem)return;const S=o.dem;if(_.activeTexture.set(b.TEXTURE1),xg(p,o,S),!o.demTexture)return;o.demTexture.bind(b.NEAREST,b.CLAMP_TO_EDGE);const T=S.dim;_.activeTexture.set(b.TEXTURE0);let I=o.hillshadeFBO;if(!I){const j=new a.T(_,{width:T,height:T,data:null},b.RGBA8);j.bind(b.LINEAR,b.CLAMP_TO_EDGE),I=o.hillshadeFBO=_.createFramebuffer(T,T,1,"renderbuffer"),I.colorAttachment0.set(j.texture)}_.bindFramebuffer.set(I.framebuffer),_.viewport.set([0,0,T,T]);const{tileBoundsBuffer:k,tileBoundsIndexBuffer:F,tileBoundsSegments:z}=p.getMercatorTileBoundsBuffers(),q=[];p.linearFloatFilteringSupported()&&q.push("TERRAIN_DEM_FLOAT_FORMAT"),p.terrain&&p.terrain.renderingToTexture&&p.emissiveMode==="mrt-fallback"&&q.push("USE_MRT1"),p.getOrCreateProgram("hillshadePrepare",{defines:q}).draw(p,b.TRIANGLES,rn.disabled,Tn.disabled,In.unblended,pn.disabled,((j,Z)=>{const te=Z.stride,ee=a.bd();return a.bX(ee,0,a.ak,-a.ak,0,0,1),a.bB(ee,ee,[0,-a.ak,0]),{u_matrix:ee,u_image:1,u_dimension:[te,te],u_zoom:j.overscaledZ}})(o.tileID,S),d.id,k,F,z),o.needsHillshadePrepare=!1}class ai{constructor(o){this.gl=o.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(o){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class B1 extends ai{getDefault(){return a.C.transparent.toNonPremultipliedRenderColor(null)}set(o){const d=this.current;(o.r!==d.r||o.g!==d.g||o.b!==d.b||o.a!==d.a||this.dirty)&&(this.gl.clearColor(o.r,o.g,o.b,o.a),this.current=o,this.dirty=!1)}}class z1 extends ai{getDefault(){return 1}set(o){(o!==this.current||this.dirty)&&(this.gl.clearDepth(o),this.current=o,this.dirty=!1)}}class Xh extends ai{getDefault(){return 0}set(o){(o!==this.current||this.dirty)&&(this.gl.clearStencil(o),this.current=o,this.dirty=!1)}}class v2 extends ai{getDefault(){return[!0,!0,!0,!0]}set(o){const d=this.current;(o[0]!==d[0]||o[1]!==d[1]||o[2]!==d[2]||o[3]!==d[3]||this.dirty)&&(this.gl.colorMask(o[0],o[1],o[2],o[3]),this.current=o,this.dirty=!1)}}class b2 extends ai{getDefault(){return!0}set(o){(o!==this.current||this.dirty)&&(this.gl.depthMask(o),this.current=o,this.dirty=!1)}}class x2 extends ai{getDefault(){return 255}set(o){(o!==this.current||this.dirty)&&(this.gl.stencilMask(o),this.current=o,this.dirty=!1)}}class w2 extends ai{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(o){const d=this.current;(o.func!==d.func||o.ref!==d.ref||o.mask!==d.mask||this.dirty)&&(this.gl.stencilFunc(o.func,o.ref,o.mask),this.current=o,this.dirty=!1)}}class S2 extends ai{getDefault(){const o=this.gl;return[o.KEEP,o.KEEP,o.KEEP]}
vendor: 6,503 bytes, line 3075
3075set(o){const d=this.current;(o[0]!==d[0]||o[1]!==d[1]||o[2]!==d[2]||this.dirty)&&(this.gl.stencilOp(o[0],o[1],o[2]),this.current=o,this.dirty=!1)}}class T2 extends ai{getDefault(){return!1}set(o){if(o===this.current&&!this.dirty)return;const d=this.gl;o?d.enable(d.STENCIL_TEST):d.disable(d.STENCIL_TEST),this.current=o,this.dirty=!1}}class c0 extends ai{getDefault(){return[0,1]}set(o){const d=this.current;(o[0]!==d[0]||o[1]!==d[1]||this.dirty)&&(this.gl.depthRange(o[0],o[1]),this.current=o,this.dirty=!1)}}class u0 extends ai{getDefault(){return!1}set(o){if(o===this.current&&!this.dirty)return;const d=this.gl;o?d.enable(d.DEPTH_TEST):d.disable(d.DEPTH_TEST),this.current=o,this.dirty=!1}}class d0 extends ai{getDefault(){return this.gl.LESS}set(o){(o!==this.current||this.dirty)&&(this.gl.depthFunc(o),this.current=o,this.dirty=!1)}}class Zh extends ai{getDefault(){return!1}set(o){if(o===this.current&&!this.dirty)return;const d=this.gl;o?d.enable(d.BLEND):d.disable(d.BLEND),this.current=o,this.dirty=!1}}class N1 extends ai{getDefault(){const o=this.gl;return[o.ONE,o.ZERO,o.ONE,o.ZERO]}set(o){const d=this.current;(o[0]!==d[0]||o[1]!==d[1]||o[2]!==d[2]||o[3]!==d[3]||this.dirty)&&(this.gl.blendFuncSeparate(o[0],o[1],o[2],o[3]),this.current=o,this.dirty=!1)}}class V1 extends ai{getDefault(){return a.C.transparent.toNonPremultipliedRenderColor(null)}set(o){const d=this.current;(o.r!==d.r||o.g!==d.g||o.b!==d.b||o.a!==d.a||this.dirty)&&(this.gl.blendColor(o.r,o.g,o.b,o.a),this.current=o,this.dirty=!1)}}class U1 extends ai{getDefault(){return this.gl.FUNC_ADD}set(o){(o!==this.current||this.dirty)&&(this.gl.blendEquationSeparate(o,o),this.current=o,this.dirty=!1)}}class h0 extends ai{getDefault(){return!1}set(o){if(o===this.current&&!this.dirty)return;const d=this.gl;o?d.enable(d.CULL_FACE):d.disable(d.CULL_FACE),this.current=o,this.dirty=!1}}class wu extends ai{getDefault(){return this.gl.BACK}set(o){(o!==this.current||this.dirty)&&(this.gl.cullFace(o),this.current=o,this.dirty=!1)}}class Sg extends ai{getDefault(){return this.gl.CCW}set(o){(o!==this.current||this.dirty)&&(this.gl.frontFace(o),this.current=o,this.dirty=!1)}}let Tg=class extends ai{getDefault(){return null}set(p){(p!==this.current||this.dirty)&&(this.gl.useProgram(p),this.current=p,this.dirty=!1)}};class $1 extends ai{getDefault(){return this.gl.TEXTURE0}set(o){(o!==this.current||this.dirty)&&(this.gl.activeTexture(o),this.current=o,this.dirty=!1)}}class Su extends ai{getDefault(){const o=this.gl;return[0,0,o.drawingBufferWidth,o.drawingBufferHeight]}set(o){const d=this.current;(o[0]!==d[0]||o[1]!==d[1]||o[2]!==d[2]||o[3]!==d[3]||this.dirty)&&(this.gl.viewport(o[0],o[1],o[2],o[3]),this.current=o,this.dirty=!1)}}class f0 extends ai{getDefault(){return null}set(o){if(o===this.current&&!this.dirty)return;const d=this.gl;d.bindFramebuffer(d.FRAMEBUFFER,o),this.current=o,this.dirty=!1}}class Eg extends ai{getDefault(){return null}set(o){if(o===this.current&&!this.dirty)return;const d=this.gl;d.bindRenderbuffer(d.RENDERBUFFER,o),this.current=o,this.dirty=!1}}class j1 extends ai{getDefault(){return null}set(o){if(o===this.current&&!this.dirty)return;const d=this.gl;d.bindTexture(d.TEXTURE_2D,o),this.current=o,this.dirty=!1}}class G1 extends ai{getDefault(){return null}set(o){if(o===this.current&&!this.dirty)return;const d=this.gl;d.bindBuffer(d.ARRAY_BUFFER,o),this.current=o,this.dirty=!1}}class p0 extends ai{getDefault(){return null}set(o){const d=this.gl;d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,o),this.current=o,this.dirty=!1}}class m0 extends ai{getDefault(){return null}set(o){this.gl&&(o!==this.current||this.dirty)&&(this.gl.bindVertexArray(o),this.current=o,this.dirty=!1)}}class E2 extends ai{getDefault(){return 4}set(o){if(o===this.current&&!this.dirty)return;const d=this.gl;d.pixelStorei(d.UNPACK_ALIGNMENT,o),this.current=o,this.dirty=!1}}class H1 extends ai{getDefault(){return!1}set(o){if(o===this.current&&!this.dirty)return;const d=this.gl;d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o),this.current=o,this.dirty=!1}}class Op extends ai{getDefault(){return!1}set(o){if(o===this.current&&!this.dirty)return;const d=this.gl;d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,o),this.current=o,this.dirty=!1}}class g0 extends ai{constructor(o,d){super(o),this.context=o,this.parent=d}getDefault(){return null}}class Cg extends g0{constructor(o,d,_=0){super(o,d),this.attachmentPoint=o.gl.COLOR_ATTACHMENT0+_}setDirty(){this.dirty=!0}set(o){if(o===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const d=this.gl;d.framebufferTexture2D(d.FRAMEBUFFER,this.attachmentPoint,d.TEXTURE_2D,o,0),this.current=o,this.dirty=!1}}class _0 extends g0{attachment(){return this.gl.DEPTH_ATTACHMENT}set(o){if(o===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const d=this.gl;d.framebufferRenderbuffer(d.FRAMEBUFFER,this.attachment(),d.RENDERBUFFER,o),this.current=o,this.dirty=!1}}class C2 extends g0{attachment(){return this.gl.DEPTH_ATTACHMENT}set(o){if(o===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const d=this.gl;d.framebufferTexture2D(d.FRAMEBUFFER,this.attachment(),d.TEXTURE_2D,o,0),this.current=o,this.dirty=!1}}class y0 extends _0{attachment(){return this.gl.DEPTH_STENCIL_ATTACHMENT}}const Ag=(p,o,d,_)=>({u_matrix:p,u_image0:0,u_image1:1,u_skirt_height:o,u_ground_shadow_factor:d,u_emissive_texture_available:_}),Tu=(p,o,d,_,b,S,T,I,k,F,z,q,j,Z,te,ee,oe)=>({u_proj_matrix:Float32Array.from(p),u_globe_matrix:o,u_normalize_matrix:Float32Array.from(_),u_merc_matrix:d,u_zoom_transition:b,u_merc_center:S,u_image0:0,u_image1:1,u_frustum_tl:T,u_frustum_tr:I,u_frustum_br:k,u_frustum_bl:F,u_globe_pos:z,u_globe_radius:q,u_viewport:j,u_grid_matrix:oe?Float32Array.from(oe):new Float32Array(9),u_skirt_height:Z,u_far_z_cutoff:te,u_emissive_texture_available:ee});function Dp(p,o){return p!=null&&o!=null&&!(!p.hasData()||!o.hasData())&&p.demTexture!=null&&o.demTexture!=null&&p.tileID.key!==o.tileID.key}const Zl=new class{constructor(){this.operations={}}newMorphing(p,o,d,_,b){if(p in this.operations){const S=this.operations[p];S.to.tileID.key!==d.tileID.key&&(S.queued=d)}else this.operations[p]={startTime:_,phase:0,duration:b,from:o,to:d,queued:null}}getMorphValuesForProxy(p){if(!(p in this.operations))return null;const o=this.operations[p];return{from:o.from,to:o.to,phase:o.phase}}update(p){for(const o in this.operations){const d=this.operations[o];for(d.phase=(p-d.startTime)/d.duration;d.phase>
3075=1||!this._validOp(d);)if(!this._nextOp(d,p)){delete this.operations[o];break}}}_nextOp(p,o){return!!p.queued&&(p.from=p.to,p.to=p.queued,p.queued=null,p.phase=0,p.startTime=o,!0)}_validOp(p){return p.from.hasData()&&p.to.hasData()}};function v0(p,o,d){if(o===0)return 0;const _=o<1&&d===514?.25/o:1;return 6*Math.pow(1.5,22-p)*Math.max(o,1)*_}function Ig(p,o){const d=1<<p.z;return!o&&(p.x===0||p.x===d-1)||p.y===0||p.y===d-1}function Yh(p,o){if(!p.style||!p.style.enable3dLights())return;const d=p.context,_=d.gl;d.activeTexture.set(_.TEXTURE1),o?o.bind(_.LINEAR,_.CLAMP_TO_EDGE):p.emptyTexture.bind(_.LINEAR,_.CLAMP_TO_EDGE)}const Cd=p=>({u_matrix:p});function Kh(p,o,d,_,b){if(b>0){const S=a.o.now(),T=(S-p.timeAdded)/b,I=o?(S-o.timeAdded)/b:-1,k=d.getSource(),F=_.coveringZoomLevel({tileSize:k.tileSize,roundZoom:k.roundZoom}),z=!o||Math.abs(o.tileID.overscaledZ-F)>Math.abs(p.tileID.overscaledZ-F),q=z&&p.refreshedUponExpiration?1:a.aB(z?T:1-I,0,1);return o?{opacity:1,mix:1-q,isFading:T<1}:{opacity:q,mix:0,isFading:T<1}}return{opacity:1,mix:0,isFading:!1}}class Kt extends ur{constructor(o){const d={type:"raster-dem",maxzoom:Math.ceil(o.transform.maxZoom)},_=rg("mock-dem",d,o.style.dispatcher,o.style);super("mock-dem",_,null),_.setEventedParent(this),this._sourceLoaded=!0}_loadTile(o,d){o.state="loaded",d(null)}}class W1 extends ur{constructor(o){const d=rg("proxy",{type:"geojson",maxzoom:Math.ceil(o.transform.maxZoom)},o.style.dispatcher,o.style);super("proxy",d,null),d.setEventedParent(this),this.map=this.getSource().map=o,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(o,d,_){if(o.freezeTileCoverage)return;this.transform=o;const b=o.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce((S,T)=>{if(S[T.key]="",!this._tiles[T.key]){const I=new a.b3(T,this._source.tileSize*T.overscaleFactor(),o.tileZoom,void 0,void 0,this._source.worldview);I.state="loaded",this._tiles[T.key]=I}return S},{});for(const S in this._tiles)S in b||(this.freeFBO(S),this._tiles[S].unloadVectorData(),delete this._tiles[S])}freeFBO(o){const d=this.proxyCachedFBO[o];if(d!==void 0){const _=Object.values(d);this.renderCachePool.push(..._),delete this.proxyCachedFBO[o]}}deallocRenderCache(){this.renderCache.forEach(o=>o.fb.destroy()),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class Rc extends a.aU{constructor(o,d,_){super(o.overscaledZ,o.wrap,o.canonical.z,o.canonical.x,o.canonical.y),this.proxyTileKey=d,this.projMatrix=_}}class kc extends a.bx{constructor(o,d){super(),this.painter=o,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[_,b,S]=(function(){const k=new a.dE,F=new a.dF,z=131;k.reserve(17161),F.reserve(33800);const q=a.ak/128,j=a.ak+q/2,Z=j+q;for(let ee=-q;ee<Z;ee+=q)for(let oe=-q;oe<Z;oe+=q){const se=oe<0||oe>j||ee<0||ee>j?24575:0,de=a.aB(Math.round(oe),0,a.ak),pe=a.aB(Math.round(ee),0,a.ak);k.emplaceBack(de+se,pe)}const te=(ee,oe)=>{const se=oe*z+ee;F.emplaceBack(se+1,se,se+z),F.emplaceBack(se+z,se+z+1,se+1)};for(let ee=1;ee<129;ee++)for(let oe=1;oe<129;oe++)te(oe,ee);return[0,129].forEach(ee=>{for(let oe=0;oe<130;oe++)te(oe,ee),te(ee,oe)}),[k,F,32768]})(),T=o.context;this.gridBuffer=T.createVertexBuffer(_,a.dA.members),this.gridIndexBuffer=T.createIndexBuffer(b),this.gridSegments=a.dB.simpleSegment(0,0,_.length,b.length),this.gridNoSkirtSegments=a.dB.simpleSegment(0,0,_.length,S),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new W1(d.map),this.orthoMatrix=a.bd(),a.bX(this.orthoMatrix,this.painter.transform.projection.name==="globe"?.015:0,a.ak,0,a.ak,0,1);const I=T.gl;this._overlapStencilMode=new Tn({func:I.GEQUAL,mask:255}
3075,0,255,I.KEEP,I.KEEP,I.REPLACE),this._previousZoom=o.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=d,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new Kt(d.map),this._pendingGroundEffectLayers=[],this._emissiveTexture=!1,this._devtoolsFolder=null}set style(o){o.on("data",this._onStyleDataEvent.bind(this)),this._style=o,this._style.map.on("moveend",()=>{this._clearLineLayersFromRenderCache()})}update(o,d,_){if(o&&o.terrain){this._style!==o&&(this.style=o,this._evaluationZoom=void 0);const b=o.terrain.properties,S=o.terrain.drapeRenderMode===0,T=o.terrain.isZoomDependent();this._previousUpdateTimestamp=this.enabled?this._updateTimestamp:void 0,this._updateTimestamp=a.o.now();const I=o.terrain&&o.terrain.scope,k=b.get("source"),F=S?this._mockSourceCache:o.getSourceCache(k,I);if(!F)return void a.w(`Couldn't find terrain source "${k}".`);if(this.sourceCache=F,this._attenuationRange=o.terrain.getAttenuationRange(),this._exaggeration=T?this.calculateExaggeration(d):b.get("exaggeration"),!d.projection.requiresDraping&&T&&this._exaggeration===0)return void this._disable();this.enabled=!0;const z=()=>{this.sourceCache.used&&a.w(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source. 3076This leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const q=this.getScaledDemTileSize();this.sourceCache.update(d,q,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,z(),this._initializing=!0),z(),d.updateElevation(!0,_),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(d),this._emptyDEMTextureDirty=!0,this._previousZoom=d.zoom}else this._disable()}calculateExaggeration(o){if(this._attenuationRange&&o.zoom>=Math.ceil(this._attenuationRange[1]))return this._style.terrain.getExaggeration(o.zoom);const d=this._previousCameraAltitude,_=o.getFreeCameraOptions().position.z/o.pixelsPerMeter*o.worldSize;this._previousCameraAltitude=_;const b=d!=null?_-d:Number.MAX_VALUE;if(Math.abs(b)<2)return this._exaggeration;const S=o.zoom,T=this._style.terrain;if(!this._previousUpdateTimestamp)return T.getExaggeration(S);let I=S-this._previousZoom;const k=this._previousUpdateTimestamp;let F=S;this._evaluationZoom!=null&&(F=this._evaluationZoom,Math.abs(S-F)>.5&&(I=.5*(S-F+I)),I*b<0&&(F+=I)),this._evaluationZoom=F;const z=T.getExaggeration(F),q=z===T.getExaggeration(Math.max(0,F-.1));if(q&&Math.abs(z-this._exaggeration)<.01)return z;let j=Math.min(.1,.00375*(this._updateTimestamp-k));return(q||z<.1||Math.abs(I)<1e-4)&&(j=Math.min(.2,4*j)),a.aj(this._exaggeration,z,j)}resetTileLookupCache(o){this._findCoveringTileCache[o]={}}attenuationRange(){return this._attenuationRange}getDemUpscale(){return this.proxySourceCache.getSource().tileSize/128}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_onStyleDataEvent(o){o.dataType==="source"&&o.coord?this._clearRenderCacheForTile(o.sourceCacheId,o.coord):o.dataType==="style"&&(this.invalidateRenderCache=!0,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this._previousCameraAltitude=void 0)}_disable(){if(this.enabled&&(this.enabled=!1,this._emptyDEMTextureDirty=!0,this._sharedDepthStencil=void 0,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const o in this._style._mergedSourceCaches)this._style._mergedSourceCaches[o].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this.pool.forEach(o=>o.fb.destroy()),this.pool=[],this.framebufferCopyTexture&&this.framebufferCopyTexture.destroy()}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this.enabled?this._exaggeration:0}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const o=2*this.proxySourceCache.getSource().tileSize;return[o,o]}set useVertexMorphing(o){this._useVertexMorphing=o}updateTileBinding(o){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const d=this.proxySourceCache,_=this.painter.transform;this._initializing&&(this._initializing=_._centerAltitude===0&&this.getAtPointOrZero(a.ad.fromLngLat(_.center),-1)===-1,this._emptyDEMTextureDirty=!this._initializing);const b=this.proxyCoords=d.getIds().map(k=>{const F=d.getTileByID(k).tileID;return F.projMatrix=_.calculateProjMatrix(F.toUnwrapped()),F});(function(k,F){const z=F.transform.pointCoordinate(F.transform.getCameraPoint()),q=new a.P(z.x,z.y);k.sort((j,Z)=>
3076{if(Z.overscaledZ-j.overscaledZ)return Z.overscaledZ-j.overscaledZ;const te=new a.P(j.canonical.x+(1<<j.canonical.z)*j.wrap,j.canonical.y),ee=new a.P(Z.canonical.x+(1<<Z.canonical.z)*Z.wrap,Z.canonical.y),oe=q.mult(1<<j.canonical.z);return oe.x-=.5,oe.y-=.5,oe.distSqr(te)-oe.distSqr(ee)})})(b,this.painter);const S=this.proxyToSource||{};this.proxyToSource={},b.forEach(k=>{this.proxyToSource[k.key]={}}),this.terrainTileForTile={};const T=this._style._mergedSourceCaches;for(const k in T){const F=T[k];if(!F.used||(F!==this.sourceCache&&this.resetTileLookupCache(F.id),this._setupProxiedCoordsForOrtho(F,o[k],S),F.usedForTerrain))continue;const z=o[k];(F.getSource().reparseOverscaled||F._isRasterElevatedOverTerrain)&&this._assignTerrainTiles(z)}this.proxiedCoords[d.id]=b.map(k=>new Rc(k,k.key,this.orthoMatrix)),this._assignTerrainTiles(b),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(S),this.renderingToTexture=!1;const I={};this._visibleDemTiles=[];for(const k of this.proxyCoords){const F=this.terrainTileForTile[k.key];if(!F)continue;const z=F.tileID.key;z in I||(this._visibleDemTiles.push(F),I[z]=z)}}_assignTerrainTiles(o){this._initializing||o.forEach(d=>{if(this.terrainTileForTile[d.key])return;const _=this._findTileCoveringTileID(d,this.sourceCache);_&&(this.terrainTileForTile[d.key]=_)})}_prepareDEMTextures(){const o=this.painter.context,d=o.gl;for(const _ in this.terrainTileForTile){const b=this.terrainTileForTile[_],S=b.dem;!S||b.demTexture&&!b.needsDEMTextureUpload||(o.activeTexture.set(d.TEXTURE1),xg(this.painter,b,S))}}_prepareDemTileUniforms(o,d,_,b){if(!d||d.demTexture==null)return!1;const S=o.tileID.canonical,T=Math.pow(2,d.tileID.canonical.z-S.z),I=b||"";return _[`u_dem_tl${I}`]=[S.x*T%1,S.y*T%1],_[`u_dem_scale${I}`]=T,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}_getLoadedAreaMinimum(){if(!this.enabled)return 0;let o=0;const d=this._visibleDemTiles.reduce((_,b)=>{if(!b.dem)return _;const S=b.dem.tree.minimums[0];return S>0&&o++,_+S},0);return o?d/o:0}_updateEmptyDEMTexture(){const o=this.painter.context,d=o.gl;o.activeTexture.set(d.TEXTURE2);const _=this._getLoadedAreaMinimum(),b=new a.dC({width:1,height:1},new Float32Array([_]));this._emptyDEMTextureDirty=!1;let S=this._emptyDEMTexture;return S?S.update(b,{premultiply:!1}):S=this._emptyDEMTexture=new a.T(o,b,d.R32F,{premultiply:!1}),S}setupElevationDraw(o,d,_){const b=this.painter.context,S=b.gl,T={u_dem:2,u_dem_prev:4,u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_depth_range_unpack:[0,1],u_occluder_half_size:16,u_occlusion_depth_offset:-1e-4,u_exaggeration:0};T.u_exaggeration=this.exaggeration();let I=null,k=null,F=1;if(_&&_.morphing&&this._useVertexMorphing){const Z=_.morphing.srcDemTile,te=_.morphing.dstDemTile;F=_.morphing.phase,Z&&te&&(this._prepareDemTileUniforms(o,Z,T,"_prev")&&(k=Z),this._prepareDemTileUniforms(o,te,T)&&(I=te))}const z=Z=>Z&&Z.demTexture&&this.painter.linearFloatFilteringSupported()?S.LINEAR:S.NEAREST;let q=null;var j;if(this.enabled?k&&I?(q=I.demTexture,b.activeTexture.set(S.TEXTURE4),k.demTexture.bind(z(k),S.CLAMP_TO_EDGE),T.u_dem_lerp=F):(I=this.terrainTileForTile[o.tileID.key],q=this._prepareDemTileUniforms(o,I,T)?I.demTexture:this.emptyDEMTexture):q=this.emptyDEMTexture,b.activeTexture.set(S.TEXTURE2),q&&(T.u_dem_size=(j=q).size[0]===1?1:j.size[0]-2,q.bind(z(I),S.CLAMP_TO_EDGE)),this.painter.setupDepthForOcclusion(_&&_.useDepthForOcclusion,d,T),_&&_.useMeterToDem&&I){const Z=(1<<I.tileID.canonical.z)*a.bY(1,this.painter.transform.center.lat)*this.sourceCache.getSource().tileSize;T.u_meter_to_dem=Z}if(_&&_.labelPlaneMatrixInv&&(T.u_label_plane_matrix_inv=_.labelPlaneMatrixInv),d.setTerrainUniformValues(b,T),this.painter.transform.projection.name==="globe"){const Z=this.globeUniformValues(this.painter.transform,o.tileID.canonical,_&&_.useDenormalizedUpVectorScale);d.setGlobeUniformValues(b,Z)}}globeUniformValues(o,d,_){const b=o.projection;return{u_tile_tl_up:b.upVector(d,0,0),u_tile_tr_up:b.upVector(d,a.ak,0),u_tile_br_up:b.upVector(d,a.ak,a.ak),u_tile_bl_up:b.upVector(d,0,a.ak),u_tile_up_scale:_?a.dD(1):b.upVectorScale(d,o.center.lat,o.worldSize).metersToTile}}renderToBackBuffer(o){const d=this.painter,_=this.painter.context;o.length!==0&&(_.bindFramebuffer.set(null),_.viewport.set([0,0,d.width,d.height]),d.gpuTimingDeferredRenderStart(),this.renderingToTexture=!1,(function(b,S,T,I,k){if(b.transform.projection.name==="globe")(function(F,z,q,j,Z){const te=F.context,ee=te.gl;let oe,se;const de=F.transform,pe=a.ds(F,te,de),ce=(Ye,Ke)=>{if(se===Ke)return;const Tt=[];Ke===1&&Tt.push("TERRAIN_VERTEX_MORPHING"),Tt.push("PROJECTION_GLOBE_VIEW"),pe&&Tt.push("CUSTOM_ANTIALIASING");const Ue=F.isTileAffectedByFog(Ye);oe=F.getOrCreateProgram("globeRaster",{defines:Tt,overrideFog:Ue}),se=Ke},Ce=F.colorModeForRenderPass(),Se=new rn(ee.LEQUAL,rn.ReadWrite,F.depthRangeFor3D);Zl.update(Z);const Re=a.dt(de),ve=[a.aG(de.center.lng),a.aJ(de.center.lat)],be=F.globeSharedBuffers,Ae=[de.width*a.o.devicePixelRatio,de.he
3076ight*a.o.devicePixelRatio],Ne=Float32Array.from(de.globeMatrix),De={useDenormalizedUpVectorScale:!0};{const Ye=F.transform,Ke=v0(Ye.zoom,z.exaggeration(),z.sourceCache._source.tileSize);se=-1;const Tt=ee.TRIANGLES;for(const Ue of j){const rt=q.getTile(Ue),$e=Tn.disabled,ct=z.prevTerrainTileForTile[Ue.key],at=z.terrainTileForTile[Ue.key];Dp(ct,at)&&Zl.newMorphing(Ue.key,ct,at,Z,250),Yh(F,rt.emissiveTexture),te.activeTexture.set(ee.TEXTURE0),rt.texture&&rt.texture.bind(ee.LINEAR,ee.CLAMP_TO_EDGE);const dt=Zl.getMorphValuesForProxy(Ue.key),Gt=dt?1:0;dt&&Object.assign(De,{morphing:{srcDemTile:dt.from,dstDemTile:dt.to,phase:a.dr(dt.phase)}});const Mt=a.du(Ue.canonical),Ct=a.dv(Mt.getCenter().lat),xt=a.dw(Ue.canonical,Mt,Ct,Ye.worldSize/Ye._pixelsPerMercatorPixel),dn=a.dx(a.dy(Ue.canonical)),an=F.emissiveMode==="mrt-fallback"?1:0,Jt=Tu(Ye.expandedFarZProjMatrix,Ne,Re,dn,a.ai(Ye.zoom),ve,Ye.frustumCorners.TL,Ye.frustumCorners.TR,Ye.frustumCorners.BR,Ye.frustumCorners.BL,Ye.globeCenterInViewSpace,Ye.globeRadius,Ae,Ke,Ye._farZ,an,xt);if(ce(Ue,Gt),oe&&(z.setupElevationDraw(rt,oe,De),F.uploadCommonUniforms(te,oe,Ue.toUnwrapped()),be)){const[tn,bn,kn]=be.getGridBuffers(Ct,Ke!==0);oe.draw(F,Tt,Se,$e,Ce,pn.backCCW,Jt,"globe_raster",tn,bn,kn)}}}if(be&&(F.renderDefaultNorthPole||F.renderDefaultSouthPole)){const Ye=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];pe&&Ye.push("CUSTOM_ANTIALIASING"),oe=F.getOrCreateProgram("globeRaster",{defines:Ye});for(const Ke of j){const{x:Tt,y:Ue,z:rt}=Ke.canonical,$e=Ue===0,ct=Ue===(1<<rt)-1,[at,dt,Gt,Mt]=be.getPoleBuffers(rt,!1);if(Mt&&($e||ct)){const Ct=q.getTile(Ke);Yh(F,Ct.emissiveTexture),te.activeTexture.set(ee.TEXTURE0),Ct.texture&&Ct.texture.bind(ee.LINEAR,ee.CLAMP_TO_EDGE);let xt=a.dz(rt,Tt,de);const dn=a.dx(a.dy(Ke.canonical)),an=F.emissiveMode==="mrt-fallback"?1:0,Jt=(tn,bn)=>tn.draw(F,ee.TRIANGLES,Se,Tn.disabled,Ce,pn.disabled,Tu(de.expandedFarZProjMatrix,xt,xt,dn,0,ve,de.frustumCorners.TL,de.frustumCorners.TR,de.frustumCorners.BR,de.frustumCorners.BL,de.globeCenterInViewSpace,de.globeRadius,Ae,0,de._farZ,an),"globe_pole_raster",bn,Gt,Mt);z.setupElevationDraw(Ct,oe,De),F.uploadCommonUniforms(te,oe,Ke.toUnwrapped()),$e&&F.renderDefaultNorthPole&&Jt(oe,at),ct&&F.renderDefaultSouthPole&&(xt=a.cE(a.bd(),xt,[1,-1,1]),Jt(oe,dt))}}}})(b,S,T,I,k);else{const F=b.context,z=F.gl;let q,j;const Z=b.shadowRenderer,te=Sa(b,b.longestCutoffRange),ee=Ce=>{if(j===Ce)return;const Se=[];Ce===1&&Se.push("TERRAIN_VERTEX_MORPHING"),te.shouldRenderCutoff&&Se.push("RENDER_CUTOFF"),Z&&(Se.push("RENDER_SHADOWS"),Z.useNormalOffset&&Se.push("NORMAL_OFFSET")),q=b.getOrCreateProgram("terrainRaster",{defines:Se}),j=Ce},oe=b.colorModeForRenderPass(),se=new rn(z.LEQUAL,rn.ReadWrite,b.depthRangeFor3D);Zl.update(k);const de=b.transform,pe=v0(de.zoom,S.exaggeration(),S.sourceCache._source.tileSize);let ce=[0,0,0];if(Z){const Ce=b.style.directionalLight,Se=b.style.ambientLight;Ce&&Se&&(ce=xd(b.style,Ce,Se))}{j=-1;const Ce=z.TRIANGLES,[Se,Re]=[S.gridIndexBuffer,S.gridSegments];for(const ve of I){const be=T.getTile(ve),Ae=Tn.disabled,Ne=S.prevTerrainTileForTile[ve.key],De=S.terrainTileForTile[ve.key];Dp(Ne,De)&&Zl.newMorphing(ve.key,Ne,De,k,250),Yh(b,be.emissiveTexture),F.activeTexture.set(z.TEXTURE0),be.texture&&be.texture.bind(z.LINEAR,z.CLAMP_TO_EDGE);const Ye=Zl.getMorphValuesForProxy(ve.key),Ke=Ye?1:0;let Tt;Ye&&(Tt={morphing:{srcDemTile:Ye.from,dstDemTile:Ye.to,phase:a.dr(Ye.phase)}});const Ue=b.emissiveMode==="mrt-fallback"?1:0,rt=Ag(ve.projMatrix,Ig(ve.canonical,de.renderWorldCopies)?pe/10:pe,ce,Ue);if(ee(Ke),!q)continue;S.setupElevationDraw(be,q,Tt);const $e=ve.toUnwrapped();Z&&Z.setupShadows($e,q),b.uploadCommonUniforms(F,q,$e,null,te),q.draw(b,Ce,se,Ae,oe,pn.backCCW,rt,"terrain_raster",S.gridBuffer,Se,Re)}}}})(d,this,this.proxySourceCache,o,this._updateTimestamp),this.renderingToTexture=!0,d.gpuTimingDeferredRenderEnd(),o.splice(0,o.length))}renderBatch(o){if(this._drapedRenderBatches.length===0)return o+1;this.renderingToTexture=!0;const d=this.painter,_=this.painter.context,b=this.proxySourceCache,S=this.proxiedCoords[b.id],T=this._drapedRenderBatches.shift(),I=d.style.order,k=[];this._updateFBOs(d.emissiveMode==="mrt-fallback");let F=0;for(const z of S){const q=b.getTileByID(z.proxyTileKey),j=b.proxyCachedFBO[z.key]?b.proxyCachedFBO[z.key][o]:void 0,Z=j!==void 0?b.renderCache[j]:this.pool[F++],te=j!==void 0;if(q.texture=Z.tex,q.emissiveTexture=Z.emissiveTex,te&&!Z.dirty){k.push(q.tileID);continue}_.bindFramebuffer.set(Z.fb.framebuffer);const ee=_.gl;let oe;ee.drawBuffers(d.emissiveMode==="mrt-fallback"?[ee.COLOR_ATTACHMENT0,ee.COLOR_ATTACHMENT1]:[ee.COLOR_ATTACHMENT0]),this.renderedToTile=!1,Z.dirty&&(_.clear({color:a.C.transparent,stencil:0}),Z.dirty=!1);for(let se=T.start;se<=T.end;++se){const de=d.style._mergedLayers[I[se]];if(de.isHidden(d.transform.zoom))continue;const pe=d.style.getLayerSourceCache(de),ce=pe?this.proxyToSource[z.ke
3076y][pe.id]:[z];if(!ce)continue;const Ce=ce;_.viewport.set([0,0,Z.fb.width,Z.fb.height]),oe!==(pe?pe.id:null)&&(this._setupStencil(Z,ce,de,pe),oe=pe?pe.id:null),d.renderLayer(d,pe,de,Ce)}if(ee.drawBuffers([ee.COLOR_ATTACHMENT0]),this._drapedRenderBatches.length===0)for(const se of this._pendingGroundEffectLayers){const de=d.style._mergedLayers[I[se]];if(de.isHidden(d.transform.zoom))continue;const pe=d.style.getLayerSourceCache(de),ce=pe?this.proxyToSource[z.key][pe.id]:[z];if(!ce)continue;const Ce=ce;_.viewport.set([0,0,Z.fb.width,Z.fb.height]),oe!==(pe?pe.id:null)&&(this._setupStencil(Z,ce,de,pe),oe=pe?pe.id:null),d.renderLayer(d,pe,de,Ce)}this.renderedToTile?(Z.dirty=!0,k.push(q.tileID)):te||--F,F===5&&(F=0,this.renderToBackBuffer(k))}return this.renderToBackBuffer(k),this.renderingToTexture=!1,_.bindFramebuffer.set(null),_.viewport.set([0,0,d.width,d.height]),T.end+1}postRender(){}isLayerOrderingCorrect(o){const d=o.order.length;let _=-1,b=d;for(let S=0;S<d;++S)this._style.isLayerDraped(o._mergedLayers[o.order[S]])?_=Math.max(_,S):b=Math.min(b,S);return b>_}getMinElevationBelowMSL(){let o=0;return this._visibleDemTiles.filter(d=>d.dem).forEach(d=>{o=Math.min(o,d.dem.tree.minimums[0])}),o===0?o:(o-30)*this._exaggeration}raycast(o,d,_){if(!this._visibleDemTiles)return null;const b=this._visibleDemTiles.filter(S=>S.dem).map(S=>{const T=S.tileID,I=1<<T.overscaledZ,{x:k,y:F}=T.canonical,z=k/I,q=(k+1)/I,j=F/I,Z=(F+1)/I;return{minx:z,miny:j,maxx:q,maxy:Z,t:S.dem.tree.raycastRoot(z,j,q,Z,o,d,_),tile:S}});b.sort((S,T)=>(S.t!==null?S.t:Number.MAX_VALUE)-(T.t!==null?T.t:Number.MAX_VALUE));for(const S of b){if(S.t==null)return null;const T=S.tile.dem.tree.raycast(S.minx,S.miny,S.maxx,S.maxy,o,d,_);if(T!=null)return T}return null}_createFBO(){const o=this.painter.context,d=o.gl,_=this.drapeBufferSize;o.activeTexture.set(d.TEXTURE0);const b=new a.T(o,{width:_[0],height:_[1],data:null},d.RGBA8);b.bind(d.LINEAR,d.CLAMP_TO_EDGE);const S=o.createFramebuffer(_[0],_[1],1,null);let T;return S.colorAttachment0.set(b.texture),this._emissiveTexture&&(T=new a.T(o,{width:_[0],height:_[1],data:null},d.R8),T.bind(d.LINEAR,d.CLAMP_TO_EDGE),S.createColorAttachment(o,1),S.colorAttachment1.set(T.texture)),S.depthAttachment=new y0(o,S.framebuffer),this._sharedDepthStencil===void 0?(this._sharedDepthStencil=o.createRenderbuffer(o.gl.DEPTH_STENCIL,_[0],_[1]),this._stencilRef=0,S.depthAttachment.set(this._sharedDepthStencil),o.clear({stencil:0})):S.depthAttachment.set(this._sharedDepthStencil),o.extTextureFilterAnisotropic&&d.texParameterf(d.TEXTURE_2D,o.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,o.extTextureFilterAnisotropicMax),{fb:S,tex:b,emissiveTex:T,dirty:!1}}_updateFBOs(o){if(this._emissiveTexture!==o){for(const d of this.pool)this._updateFBO(d,o);for(const d of this.proxySourceCache.renderCache)this._updateFBO(d,o);this._emissiveTexture=o}}_updateFBO(o,d){const _=o.fb,b=this.painter.context,S=b.gl,T=this.drapeBufferSize;if(d){const I=new a.T(b,{width:T[0],height:T[1],data:null},S.R8);I.bind(S.LINEAR,S.CLAMP_TO_EDGE),o.emissiveTex=I,_.createColorAttachment(b,1),_.colorAttachment1.set(I.texture)}else o.emissiveTex=void 0,_.removeColorAttachment(b,1);o.dirty=!0}_initFBOPool(){for(;this.pool.length<Math.min(5,this.proxyCoords.length);)this.pool.push(this._createFBO())}_shouldDisableRenderCache(){if(this._style.hasLightTransitions())return!0;for(const o in this._style._mergedSourceCaches)if(this._style._mergedSourceCaches[o].hasTransition())return!0;return this._style.order.some(o=>{const d=this._style._mergedLayers[o],_=d.isHidden(this.painter.transform.zoom);return d.type==="hillshade"||d.type==="custom"?!_&&d.shouldRedrape():!_&&d.hasTransition()})}_clearLineLayersFromRenderCache(){let o=!1;for(const _ of this._style.getSources())if(_ instanceof $y){o=!0;break}if(!o)return;const d={};for(let _=0;_<this._style.order.length;++_){const b=this._style._mergedLayers[this._style.order[_]],S=this._style.getLayerSourceCache(b);if(!S||d[S.id]||b.isHidden(this.painter.transform.zoom)||b.type!=="line")continue;const T=b.widthExpression(),I=b.emissiveStrengthExpression();if(T instanceof a.ac||I instanceof a.ac){d[S.id]=!0;for(const k of this.proxyCoords){const F=this.proxyToSource[k.key][S.id];if(F)for(const z of F)this._clearRenderCacheForTile(S.id,z)}}}}_clearRasterLayersFromRenderCache(){let o=!1;for(const _ in this._style._mergedSourceCaches)if(this._style._mergedSourceCaches[_]._source instanceof Oh){o=!0;break}if(!o)return;const d={};for(let _=0;_<this._style.order.length;++_){const b=this._style._mergedLayers[this._style.order[_]],S=this._style.getLayerSourceCache(b);if(!S||d[S.id]||b.isHidden(this.painter.transform.zoom)||b.type!=="raster")continue;const T=b.paint.get("raster-fade-duration");for(const I of this.proxyCoords){const k=this.proxyToSource[I.key][S.id];if(k)for(const F of k){const z=Kh(S.getTile(F),S.findLoadedParent(F,0),S,this.painter.transform,T);(z.opacity!==1||z.mix!==0)&&this._clearRenderCacheForTile(S.id,F)}}}}_setupDrapedRenderBatches(){this._style.updateDrapeFirstLayers();const o=this._style.order,d=o.length;if(d===0)return;const _=[];this._pendingGroundEffectLayers=[];
3076let b,S=0,T=this._style._mergedLayers[o[S]];for(;!this._style.isLayerDraped(T)&&T.isHidden(this.painter.transform.zoom)&&++S<d;)T=this._style._mergedLayers[o[S]];for(;S<d;++S){const I=this._style._mergedLayers[o[S]];I.isHidden(this.painter.transform.zoom)||(this._style.isLayerDraped(I)?b===void 0&&(b=S):(I.type==="fill-extrusion"&&this._pendingGroundEffectLayers.push(S),b!==void 0&&(_.push({start:b,end:S-1}),b=void 0)))}if(b!==void 0&&_.push({start:b,end:S-1}),_.length!==0){const I=_.at(-1);this._pendingGroundEffectLayers.every(k=>k>I.end)||a.w("fill-extrusion with flood lighting and/or ground ambient occlusion should be moved to be on top of all draped layers.")}this._drapedRenderBatches=_}_setupRenderCache(o){const d=this.proxySourceCache;if(this._shouldDisableRenderCache()||this.invalidateRenderCache){if(this.invalidateRenderCache=!1,d.renderCache.length>d.renderCachePool.length){const T=Object.values(d.proxyCachedFBO);d.proxyCachedFBO={};for(let I=0;I<T.length;++I){const k=Object.values(T[I]);d.renderCachePool.push(...k)}}return}this._clearRasterLayersFromRenderCache();const _=this.proxyCoords,b=this._tilesDirty;for(let T=_.length-1;T>=0;T--){const I=_[T];if(d.getTileByID(I.key),d.proxyCachedFBO[I.key]!==void 0){const k=o[I.key],F=this.proxyToSource[I.key];let z=0;for(const q in F){const j=F[q],Z=k[q];if(!Z||Z.length!==j.length||j.some((te,ee)=>te!==Z[ee]||b[q]&&Object.hasOwn(b[q],te.key))){z=-1;break}++z}for(const q in d.proxyCachedFBO[I.key])d.renderCache[d.proxyCachedFBO[I.key][q]].dirty=z<0||z!==Object.values(k).length}}const S=[...this._drapedRenderBatches];S.sort((T,I)=>I.end-I.start-(T.end-T.start));for(const T of S)for(const I of _){if(d.proxyCachedFBO[I.key])continue;let k=d.renderCachePool.pop();k===void 0&&d.renderCache.length<50&&(k=d.renderCache.length,d.renderCache.push(this._createFBO())),k!==void 0&&(d.proxyCachedFBO[I.key]={},d.proxyCachedFBO[I.key][T.start]=k,d.renderCache[k].dirty=!0)}this._tilesDirty={}}_setupStencil(o,d,_,b){if(!b||!this._sourceTilesOverlap[b.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const S=this.painter.context,T=S.gl;if(d.length<=1)return void(this._overlapStencilType=!1);let I;if(_.isTileClipped())I=d.length,this._overlapStencilMode.test={func:T.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(d[0].overscaledZ>d.at(-1).overscaledZ))return void(this._overlapStencilType=!1);I=1,this._overlapStencilMode.test={func:T.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+I>255&&(S.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=I,this._overlapStencilMode.ref=this._stencilRef,_.isTileClipped()&&this._renderTileClippingMasks(d,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return this._overlapStencilType==="Clip"||this._overlapStencilType==="Mask"}stencilModeForRTTOverlap(o){return this.renderingToTexture&&this._overlapStencilType?(this._overlapStencilType==="Clip"&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[o.key]),this._overlapStencilMode):Tn.disabled}_renderTileClippingMasks(o,d){const _=this.painter,b=this.painter.context,S=b.gl;_._tileClippingMaskIDs={},b.setColorMode(In.disabled),b.setDepthMode(rn.disabled);const T=_.getOrCreateProgram("clippingMask");for(const I of o){const k=_._tileClippingMaskIDs[I.key]=--d;T.draw(_,S.TRIANGLES,rn.disabled,new Tn({func:S.ALWAYS,mask:0},k,255,S.KEEP,S.KEEP,S.REPLACE),In.disabled,pn.disabled,Cd(I.projMatrix),"$clipping",_.tileExtentBuffer,_.quadTriangleIndexBuffer,_.tileExtentSegments)}}pointCoordinate(o){const d=this.painter.transform;if(o.x<0||o.x>d.width||o.y<0||o.y>d.height)return null;const _=[o.x,o.y,1,1];a.aD(_,_,d.pixelMatrixInverse),a.cw(_,_,1/_[3]),_[0]/=d.worldSize,_[1]/=d.worldSize;const b=d._camera.position,S=a.bY(1,d.center.lat),T=[b[0],b[1],b[2]/S,0],I=a.cZ([],_.slice(0,3),T);a.ax(I,I);const k=this.raycast(T,I,this._exaggeration);return k!==null&&k?(a.bi(T,T,I,k),T[3]=T[2],T[2]*=S,T):null}_setupProxiedCoordsForOrtho(o,d,_){if(o.getSource()instanceof a.aY)return this._setupProxiedCoordsForImageSource(o,d,_);this._findCoveringTileCache[o.id]=this._findCoveringTileCache[o.id]||{};const b=this.proxiedCoords[o.id]=[],S=this.proxyCoords;for(let k=0;k<S.length;k++){const F=S[k],z=this._findTileCoveringTileID(F,o);if(z){const q=this._createProxiedId(F,z,_[F.key]&&_[F.key][o.id]);b.push(q),this.proxyToSource[F.key][o.id]=[q]}}let T=!1;const I=new Set;for(let k=0;k<d.length;k++){const F=o.getTile(d[k]);if(!F||!F.hasData())continue;const z=this._findTileCoveringTileID(F.tileID,this.proxySourceCache);
3076if(z&&z.tileID.canonical.z!==F.tileID.canonical.z){const q=this.proxyToSource[z.tileID.key][o.id],j=this._createProxiedId(z.tileID,F,_[z.tileID.key]&&_[z.tileID.key][o.id]);q?q.splice(q.length-1,0,j):this.proxyToSource[z.tileID.key][o.id]=[j];const Z=this.proxyToSource[z.tileID.key][o.id];I.has(Z)||I.add(Z),b.push(j),T=!0}}if(this._sourceTilesOverlap[o.id]=T,T)for(const k of I)k.sort((F,z)=>z.overscaledZ-F.overscaledZ)}_setupProxiedCoordsForImageSource(o,d,_){if(!o.getSource().loaded())return;const b=this.proxiedCoords[o.id]=[],S=this.proxyCoords,T=o.getSource(),I=T.tileID;if(!I)return;const k=new a.P(I.x,I.y)._div(1<<I.z),F=T.coordinates.map(a.ad.fromLngLat).reduce((q,j)=>(q.min.x=Math.min(q.min.x,j.x-k.x),q.min.y=Math.min(q.min.y,j.y-k.y),q.max.x=Math.max(q.max.x,j.x-k.x),q.max.y=Math.max(q.max.y,j.y-k.y),q),{min:new a.P(Number.MAX_VALUE,Number.MAX_VALUE),max:new a.P(-Number.MAX_VALUE,-Number.MAX_VALUE)}),z=(q,j)=>{const Z=q.wrap+q.canonical.x/(1<<q.canonical.z),te=q.canonical.y/(1<<q.canonical.z),ee=a.ak/(1<<q.canonical.z),oe=j.wrap+j.canonical.x/(1<<j.canonical.z),se=j.canonical.y/(1<<j.canonical.z);return Z+ee<oe+F.min.x||Z>oe+F.max.x||te+ee<se+F.min.y||te>se+F.max.y};for(let q=0;q<S.length;q++){const j=S[q];for(let Z=0;Z<d.length;Z++){const te=o.getTile(d[Z]);if(!te||!te.hasData()||z(j,te.tileID))continue;const ee=this._createProxiedId(j,te,_[j.key]&&_[j.key][o.id]),oe=this.proxyToSource[j.key][o.id];oe?oe.push(ee):this.proxyToSource[j.key][o.id]=[ee],b.push(ee)}}}_createProxiedId(o,d,_){let b=this.orthoMatrix;if(_){const S=_.find(T=>T.key===d.tileID.key);if(S)return S}if(d.tileID.key!==o.key){const S=o.canonical.z-d.tileID.canonical.z;let T,I,k;b=a.bd();const F=d.tileID.wrap-o.wrap<<o.overscaledZ;S>0?(T=a.ak>>S,I=T*((d.tileID.canonical.x<<S)-o.canonical.x+F),k=T*((d.tileID.canonical.y<<S)-o.canonical.y)):(T=a.ak<<-S,I=a.ak*(d.tileID.canonical.x-(o.canonical.x+F<<-S)),k=a.ak*(d.tileID.canonical.y-(o.canonical.y<<-S))),a.bX(b,0,T,0,T,0,1),a.bB(b,b,[I,k,0])}return new Rc(d.tileID,o.key,b)}_findTileCoveringTileID(o,d){let _=d.getTile(o);if(_&&_.hasData())return _;const b=this._findCoveringTileCache[d.id],S=b[o.key];if(_=S?d.getTileByID(S):null,_&&_.hasData()||S===null)return _;let T=_?_.tileID:o,I=T.overscaledZ;const k=d.getSource().minzoom,F=[];if(!S){const q=d.getSource().maxzoom;if(o.canonical.z>=q){const j=o.canonical.z-q;d.getSource().reparseOverscaled?(I=Math.max(o.canonical.z+2,d.transform.tileZoom),T=new a.aU(I,o.wrap,q,o.canonical.x>>j,o.canonical.y>>j)):j!==0&&(I=q,T=new a.aU(I,o.wrap,q,o.canonical.x>>j,o.canonical.y>>j))}T.key!==o.key&&(F.push(T.key),_=d.getTile(T))}const z=q=>{F.forEach(j=>{b[j]=q}),F.length=0};for(I-=1;I>=k&&(!_||!_.hasData());I--){_&&z(_.tileID.key);const q=T.calculateScaledKey(I);if(_=d.getTileByID(q),_&&_.hasData())break;const j=b[q];if(j===null)break;j===void 0?F.push(q):_=d.getTileByID(j)}return z(_?_.tileID.key:null),_&&_.hasData()?_:null}findDEMTileFor(o){return this.enabled?this._findTileCoveringTileID(o,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(o,d){let _=this._tilesDirty[o];_||(_=this._tilesDirty[o]={}),_[d.key]=!0}}function q1(p,o,d){const _=(function(I,k,F){const z=a.bk(k,I),q=a.bk(F,[.2126,.7152,.0722]),j=(te,ee,oe)=>(1-oe)*te+oe*ee,Z=j(1-.3*Math.min(q,1),1,Math.min(z+1,1));return j(.92,1,Math.asin(a.aB(k[2],-1,1))/Math.PI+.5)*Z})(p,[0,0,1],o),b=[0,0,0];a.bN(b,d.slice(0,3),_);const S=[0,0,0];a.bN(S,o.slice(0,3),p[2]);const T=[0,0,0];return a.cX(T,b,S),a.c_(T)}const X1=["fill","fillOutline","fillPattern","line","linePattern","background","backgroundPattern","hillshade","raster"],Z1=["stars","rainParticle","snowParticle","fillExtrusion","fillExtrusionGroundEffect","building","buildingBloom","elevatedStructures","model","symbol"];class b0{static cacheKey(o,d,_,b){const S=[d];b&&S.push(b.cacheKey);for(const T of _)(typeof T=="string"&&T.includes(" ")||o.usedDefines.has(T))&&S.push(T);return S.join("/")}constructor(o,d,_,b,S,T,I=!1){const k=o.gl;this.program=k.createProgram(),this._context=o,this._fixedUniformsFn=S,this._pending=!0,this._precompiled=I,this.attributes={},this.configuration=b,this.name=d,this.fixedDefines=[...T],I?o._compileStats.precompiled++:o._compileStats.onDemand++;const F=`#version 300 es 3077${(b?b.defines():[]).concat(T.map(oe=>`#define ${oe}`)).join(` 3078`)}`,z=[F,s0];for(const oe of _.fragmentIncludes)z.push(Hh[oe]);z.push(_.fragmentSource);const q=z.join(` 3079`),j=[F,yg];for(const oe of _.vertexIncludes)j.push(Hh[oe]);this.forceManualRenderingForInstanceIDShaders=o.forceManualRenderingForInstanceIDShaders&&_.vertexSource.includes("gl_InstanceID"),this.forceManualRenderingForInstanceIDShaders&&j.push("uniform int u_instanceID;"),j.push(_.vertexSource);let Z=j.join(` 3080`);this.forceManualRenderingForInstanceIDShaders&&(Z=Z.replaceAll("gl_InstanceID","u_instanceID"));const te=k.createShader(k.FRAGMENT_SHADER);if(k.isContextLost())return this.failedToCreate=!0,void(this._pe
3080nding=!1);k.shaderSource(te,q),k.compileShader(te),k.attachShader(this.program,te);const ee=k.createShader(k.VERTEX_SHADER);if(k.isContextLost())return this.failedToCreate=!0,void(this._pending=!1);k.shaderSource(ee,Z),k.compileShader(ee),k.attachShader(this.program,ee),k.linkProgram(this.program),this._fragmentShader=te,this._vertexShader=ee,o.extParallelShaderCompile?o._pendingPrograms.add(this):this._finalize()}_finalize(){if(!this._pending)return;this._pending=!1;const o=this._context,d=o.gl;o._pendingPrograms.delete(this);const _=a.o.now(),b=d.getProgramParameter(this.program,d.LINK_STATUS),S=a.o.now()-_,T=o._compileStats;if(T.totalStallMs+=S,S>T.maxStallMs&&(T.maxStallMs=S),S>1){T.framesMissed+=Math.floor(60*S/1e3);const F=this.fixedDefines.join(",");T.stalls.push({name:`${this.name}${F?"/":""}${F}`,ms:S,timestamp:_})}if(this._fragmentShader&&(b||a.w(`Fragment shader '${this.name}': ${d.getShaderInfoLog(this._fragmentShader)}`),d.deleteShader(this._fragmentShader),this._fragmentShader=null),this._vertexShader&&(b||a.w(`Vertex shader '${this.name}': ${d.getShaderInfoLog(this._vertexShader)}`),d.deleteShader(this._vertexShader),this._vertexShader=null),!b)return a.w(`Failed to link program '${this.name}': ${d.getProgramInfoLog(this.program)}`),void(this.failedToCreate=!0);this.fixedUniforms=this._fixedUniformsFn(o),this.fixedUniformsEntries=Object.entries(this.fixedUniforms),this.binderUniforms=this.configuration?this.configuration.getUniforms(o):[],this.forceManualRenderingForInstanceIDShaders&&(this.instancingUniforms=(F=>({u_instanceID:new a.b$(F)}))(o));const I=this.fixedDefines,k=this.name;(I.includes("TERRAIN")||I.includes("ELEVATED")||k.includes("symbol")||k.includes("circle"))&&(this.terrainUniforms=(F=>({u_dem:new a.b$(F),u_dem_prev:new a.b$(F),u_dem_tl:new a.c2(F),u_dem_scale:new a.c1(F),u_dem_tl_prev:new a.c2(F),u_dem_scale_prev:new a.c1(F),u_dem_size:new a.c1(F),u_dem_lerp:new a.c1(F),u_exaggeration:new a.c1(F),u_depth:new a.b$(F),u_depth_size_inv:new a.c2(F),u_depth_range_unpack:new a.c2(F),u_occluder_half_size:new a.c1(F),u_occlusion_depth_offset:new a.c1(F),u_meter_to_dem:new a.c1(F),u_label_plane_matrix_inv:new a.c3(F)}))(o)),I.includes("GLOBE")&&(this.globeUniforms=(F=>({u_tile_tl_up:new a.c0(F),u_tile_tr_up:new a.c0(F),u_tile_br_up:new a.c0(F),u_tile_bl_up:new a.c0(F),u_tile_up_scale:new a.c1(F)}))(o)),I.includes("FOG")&&(this.fogUniforms=(F=>({u_fog_matrix:new a.c3(F),u_fog_range:new a.c2(F),u_fog_color:new a.cS(F),u_fog_horizon_blend:new a.c1(F),u_fog_vertical_limit:new a.c2(F),u_fog_temporal_offset:new a.c1(F),u_frustum_tl:new a.c0(F),u_frustum_tr:new a.c0(F),u_frustum_br:new a.c0(F),u_frustum_bl:new a.c0(F),u_globe_pos:new a.c0(F),u_globe_radius:new a.c1(F),u_globe_transition:new a.c1(F),u_is_globe:new a.b$(F),u_viewport:new a.c2(F)}))(o)),I.includes("RENDER_CUTOFF")&&(this.cutoffUniforms=(F=>({u_cutoff_params:new a.cS(F)}))(o)),I.includes("LIGHTING_3D_MODE")&&(this.lightsUniforms=(F=>({u_lighting_ambient_color:new a.c0(F),u_lighting_directional_dir:new a.c0(F),u_lighting_directional_color:new a.c0(F),u_ground_radiance:new a.c0(F)}))(o)),I.includes("RENDER_SHADOWS")&&(this.shadowUniforms=(F=>({u_light_matrix_0:new a.c3(F),u_light_matrix_1:new a.c3(F),u_fade_range:new a.c2(F),u_shadow_normal_offset:new a.c0(F),u_shadow_intensity:new a.c1(F),u_shadow_texel_size:new a.c1(F),u_shadow_map_resolution:new a.c1(F),u_shadow_direction:new a.c0(F),u_shadow_bias:new a.c0(F),u_shadowmap_0:new a.b$(F),u_shadowmap_1:new a.b$(F)}))(o))}maybeFinalize(){if(!this._pending)return;const o=this._context.extParallelShaderCompile;o&&!this._context.gl.getProgramParameter(this.program,o.COMPLETION_STATUS_KHR)||this._finalize()}_ensureReady(){this._pending&&(this._finalize(),this._context.sweepPendingPrograms())}getAttributeLocation(o,d){this._ensureReady();let _=this.attributes[d];return _===void 0&&(_=this.attributes[d]=o.getAttribLocation(this.program,d)),_}setTerrainUniformValues(o,d){if(this._ensureReady(),!this.terrainUniforms)return;const _=this.terrainUniforms;if(!this.failedToCreate){o.program.set(this.program);for(const b in d)_[b]&&_[b].set(this.program,b,d[b])}}setGlobeUniformValues(o,d){if(this._ensureReady(),!this.globeUniforms)return;const _=this.globeUniforms;if(!this.failedToCreate){o.program.set(this.program);for(const b in d)_[b]&&_[b].set(this.program,b,d[b])}}setFogUniformValues(o,d){if(this._ensureReady(),!this.fogUniforms)return;const _=this.fogUniforms;if(!this.failedToCreate){o.program.set(this.program);for(const b in d)_[b].set(this.program,b,d[b])}}setCutoffUniformValues(o,d){if(this._ensureReady(),!this.cutoffUniforms)return;const _=this.cutoffUniforms;if(!this.failedToCreate){o.program.set(this.program);for(const b in d)_[b].set(this.program,b,d[b])}}setLightsUniformValues(o,d){if(this._ensureReady(),!this.lightsUniforms)return;const _=this.lightsUniforms;if(!this.failedToCreate){o.program.set(this.program);for(const b in d)_[b].set(this.program,b,d[b])}}setShadowUniformValues(o,d){if(this._ensureReady(),this.failedToCreate||!this.shadowUniforms)return;const _=this.shadowUniforms;o.program.set(this.program);for(const b in d)_[b].set(this.program,b,d[b])}_drawDebugWireframe(o,d,_,b,S,T,I,k,F,z){const q=o.options.wireframe;if(q.terrain===!1&&q.layers2D===!1&&q.layers3D===!1)return;const j=o.context;if(!(!(!q.terrain||this.name!=="terrainRaster"&&this.name!=="globeRaster")||!(!q.layers2D||o._terrain&&o._terrain.renderingToTexture||!X1.includes(this.name))||!(!q.layers3D||!Z1.includes(this.name))))return;const Z=j.gl,te=o.wireframeDebugCache.getLinesFromTrianglesBuffer(o.frameCounter,S,j);if(!te)return;
3080const ee=[...this.fixedDefines,"DEBUG_WIREFRAME"],oe=o.getOrCreateProgram(this.name,{config:this.configuration,defines:ee});oe._ensureReady(),j.program.set(oe.program);const se=(ce,Ce,Se)=>{if(Ce[ce]&&Se[ce])for(const Re in Ce[ce])Se[ce][Re]&&Se[ce][Re].set(Se.program,Re,Ce[ce][Re].current)};F&&F.setUniforms(oe.program,j,oe.binderUniforms,I,{zoom:k}),se("fixedUniforms",this,oe),se("terrainUniforms",this,oe),se("globeUniforms",this,oe),se("fogUniforms",this,oe),se("lightsUniforms",this,oe),se("shadowUniforms",this,oe),te.bind(),j.setColorMode(new In([Z.ONE,Z.ONE_MINUS_SRC_ALPHA,Z.ZERO,Z.ONE],a.C.transparent,[!0,!0,!0,!1])),j.setDepthMode(new rn(d.func===Z.LESS?Z.LEQUAL:d.func,rn.ReadOnly,d.range)),j.setStencilMode(Tn.disabled);const de=3*T.primitiveLength*2,pe=3*T.primitiveOffset*2*2;if(this.forceManualRenderingForInstanceIDShaders){const ce=z||1;for(let Ce=0;Ce<ce;++Ce)oe.instancingUniforms.u_instanceID.set(this.program,"u_instanceID",Ce),Z.drawElements(Z.LINES,de,Z.UNSIGNED_SHORT,pe)}else z&&z>1?Z.drawElementsInstanced(Z.LINES,de,Z.UNSIGNED_SHORT,pe,z):Z.drawElements(Z.LINES,de,Z.UNSIGNED_SHORT,pe);S.bind(),j.program.set(this.program),j.setDepthMode(d),j.setStencilMode(_),j.setColorMode(b)}checkUniforms(o,d,_){if(this.fixedDefines.includes(d)){for(const b of Object.keys(_))if(!_[b].initialized)throw new Error(`Program '${this.name}', from draw '${o}': uniform ${b} not set but required by ${d} being defined`)}}draw(o,d,_,b,S,T,I,k,F,z,q,j,Z,te,ee,oe){const se=o.context,de=se.gl;if(this._ensureReady(),this.failedToCreate)return;se.program.set(this.program),se.setDepthMode(_),se.setStencilMode(b),se.setColorMode(S),se.setCullFace(T);for(const[ve,be]of this.fixedUniformsEntries)be.set(this.program,ve,I[ve]);te&&te.setUniforms(this.program,se,this.binderUniforms,j,{zoom:Z});const pe={[de.POINTS]:1,[de.LINES]:2,[de.TRIANGLES]:3,[de.LINE_STRIP]:1}[d];this.checkUniforms(k,"RENDER_SHADOWS",this.shadowUniforms);const ce=ee||[],Ce=te?te.getPaintVertexBuffers():[],Se=d===de.TRIANGLES&&z,Re=oe&&oe>0?1:void 0;for(const ve of q.get()){const be=ve.vaos||(ve.vaos={});if((be[k]||(be[k]=new a0)).bind(se,this,F,Ce,z,ve.vertexOffset,ce,Re),this.forceManualRenderingForInstanceIDShaders){const Ae=oe||1;for(let Ne=0;Ne<Ae;++Ne)this.instancingUniforms.u_instanceID.set(this.program,"u_instanceID",Ne),z?de.drawElements(d,ve.primitiveLength*pe,de.UNSIGNED_SHORT,ve.primitiveOffset*pe*2):de.drawArrays(d,ve.vertexOffset,ve.vertexLength)}else oe&&oe>1?de.drawElementsInstanced(d,ve.primitiveLength*pe,de.UNSIGNED_SHORT,ve.primitiveOffset*pe*2,oe):z?de.drawElements(d,ve.primitiveLength*pe,de.UNSIGNED_SHORT,ve.primitiveOffset*pe*2):de.drawArrays(d,ve.vertexOffset,ve.vertexLength);Se&&this._drawDebugWireframe(o,_,b,S,z,ve,j,Z,te,oe)}}}function x0(p,o,d=0){const _=Math.pow(2,o.tileID.overscaledZ),b=o.tileSize*Math.pow(2,p.transform.tileZoom)/_,S=b*(o.tileID.canonical.x+o.tileID.wrap*_),T=b*o.tileID.canonical.y;return{u_image:0,u_texsize:o.imageAtlasTexture?o.imageAtlasTexture.size:[0,0],u_tile_units_to_pixels:1/a.az(o,1,p.transform.tileZoom),u_pixel_coord_upper:[S>>16,T>>16],u_pixel_coord_lower:[65535&S,65535&T],u_pattern_transition:d}}const Fp={terrain:0,flat:1},Pg=a.bd(),Rg=(p,o,d,_,b,S,T,I,k,F,z,q,j,Z,te,ee,oe,se,de=[0,0,1])=>{const pe=o.style.light,ce=pe.properties.get("position"),Ce=[ce.x,ce.y,ce.z],Se=a.dH();pe.properties.get("anchor")==="viewport"&&(a.dI(Se,-o.transform.angle),a.dJ(Ce,Ce,Se));const Re=pe.properties.get("color").toPremultipliedRenderColor(null),ve=o.transform,be={u_matrix:p,u_lightpos:Ce,u_lightintensity:pe.properties.get("intensity"),u_lightcolor:[Re.r,Re.g,Re.b],u_vertical_gradient:+d,u_opacity:_,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:Pg,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_height_type:Fp[F],u_base_type:Fp[z],u_ao:b,u_edge_radius:S,u_width_scale:T,u_flood_light_color:te,u_vertical_scale:ee,u_flood_light_intensity:oe,u_ground_shadow_factor:se,u_front_cutoff_params:de};return ve.projection.name==="globe"&&(be.u_tile_id=[I.canonical.x,I.canonical.y,1<<I.canonical.z],be.u_zoom_transition=q,be.u_inv_rot_matrix=Z,be.u_merc_center=j,be.u_up_dir=ve.projection.upVector(new a.cp(0,0,0),j[0]*a.ak,j[1]
3080*a.ak),be.u_height_lift=k),be},kg=(p,o,d,_,b,S)=>({u_matrix:p,u_edge_radius:o,u_width_scale:d,u_vertical_scale:_,u_height_type:Fp[b],u_base_type:Fp[S]}),Y1=(p,o,d,_,b,S,T,I,k,F,z,q,j,Z,te,ee,oe,se)=>{const de=Rg(p,o,d,_,b,S,T,I,F,z,q,j,Z,te,ee,oe,1,[0,0,0]),pe={u_height_factor:-Math.pow(2,I.overscaledZ)/k.tileSize/8};return Object.assign(de,x0(o,k,se),pe)},w0=(p,o,d)=>({u_matrix:p,u_emissive_strength:o,u_ground_shadow_factor:d}),S0=(p,o,d,_,b,S=0)=>Object.assign(w0(p,o,b),x0(d,_,S)),K1=(p,o,d,_)=>({u_matrix:p,u_world:d,u_emissive_strength:o,u_ground_shadow_factor:_}),J1=(p,o,d,_,b,S,T=0)=>Object.assign(S0(p,o,d,_,S,T),{u_world:b}),Q1=(p,o)=>({u_matrix:p,u_depth_bias:o}),T0=(p,o)=>({u_matrix:p,u_ground_shadow_factor:o}),Jh=(p,o,d,_,b)=>({u_matrix:p,u_camera_pos:[o[0],o[1],o[2]],u_depth_bias:d,u_height_scale:_,u_reset_depth:b}),ew=(p,o,d)=>({u_image:p,u_texel_size:o,u_first_pass:d?1:0}),tw=(p,o,d,_,b,S,T,I)=>{const k=a.ak/S.tileSize;return{u_matrix:p,u_inv_rot_matrix:o,u_camera_to_center_distance:d.getCameraToCenterDistance(I),u_extrude_scale:[d.pixelsToGLUnits[0]/k,d.pixelsToGLUnits[1]/k],u_zoom_transition:_,u_tile_id:T,u_merc_center:b}},nw=(p,o,d,_)=>({u_matrix:p,u_inv_matrix:o,u_camera_to_center_distance:d.getCameraToCenterDistance(_),u_viewport_size:[d.width,d.height]}),Mg=(p,o,d=1)=>({u_matrix:p,u_color:o,u_overlay:0,u_overlay_scale:d}),E0=a.bd(),rw=(p,o,d,_,b,S,T)=>{const I=p.transform,k=I.projection.name==="globe",F=k?a.dK(I.zoom,o.canonical)*I._pixelsPerMercatorPixel:a.az(d,1,S),z={u_matrix:o.projMatrix,u_extrude_scale:F,u_intensity:T,u_inv_rot_matrix:E0,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(k){z.u_inv_rot_matrix=_,z.u_merc_center=b,z.u_tile_id=[o.canonical.x,o.canonical.y,1<<o.canonical.z],z.u_zoom_transition=a.ai(I.zoom);const q=b[0]*a.ak,j=b[1]*a.ak;z.u_up_dir=I.projection.upVector(new a.cp(0,0,0),q,j)}return z};function Lg(p,[o,d,_,b],[S,T]){if(S===T)return[0,0,0,0];const I=255*(p-1)/(p*(T-S));return[o*I,d*I,_*I,b*I]}function C0(p,o,[d,_]){return d===_?0:.5/p+(o-d)*(p-1)/(p*(_-d))}function A0(p){const o=p.terrain?p.terrain.exaggeration():1;var d;return(p.transform.pitch<15?.07*(1-(d=a.aB((14-p.transform.zoom)/5,0,1)))+.7*d:.07)*o}const Og=(p,o,d,_,b,S,T,I,k,F,z,q,j,Z,te,ee,oe,se,de,pe,ce,Ce)=>({u_matrix:o,u_normalize_matrix:d,u_globe_matrix:_,u_merc_matrix:b,u_grid_matrix:S,u_tl_parent:T,u_scale_parent:z,u_fade_t:q.mix,u_opacity:q.opacity*j.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:j.paint.get("raster-brightness-min"),u_brightness_high:j.paint.get("raster-brightness-max"),u_saturation_factor:a.dM(j.paint.get("raster-saturation")),u_contrast_factor:a.dL(j.paint.get("raster-contrast")),u_spin_weights:I0(j.paint.get("raster-hue-rotate")),u_perspective_transform:Z,u_raster_elevation:te,u_zoom_transition:I,u_merc_center:k,u_cutoff_params:F,u_colorization_mix:Lg(a.dN,oe,de),u_colorization_offset:C0(a.dN,se,de),u_color_ramp:ee,u_texture_offset:[ce/(pe+2*ce),pe/(pe+2*ce)],u_texture_res:[pe+2*ce,pe+2*ce],u_emissive_strength:Ce,u_zbias_factor:A0(p)});function I0(p){p*=Math.PI/180;const o=Math.sin(p),d=Math.cos(p);return[(2*d+1)/3,(-Math.sqrt(3)*o-d+1)/3,(Math.sqrt(3)*o-d+1)/3]}const iw=a.bd(),ow=(p,o,d,_,b,S,T,I,k,F,z,q,j,Z,te,ee,oe,se,de,pe,ce,Ce,Se,Re)=>{const ve=b.transform,be={u_is_size_zoom_constant:+(p==="constant"||p==="source"),u_is_size_feature_constant:+(p==="constant"||p==="camera"),u_size_t:o?o.uSizeT:0,u_size:o?o.uSize:0,u_camera_to_center_distance:ve.getCameraToCenterDistance(de),u_rotate_symbol:+d,u_aspect_ratio:ve.width/ve.height,u_fade_change:b.options.fadeDuration?b.symbolFadeChange:1,u_matrix:S,u_label_plane_matrix:T,u_coord_matrix:I,u_is_text:+F,u_elevation_from_sea:k?1:0,u_pitch_with_map:+_,u_texsize:z,u_texsize_icon:q,u_texture:0,u_texture_icon:1,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:iw,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:iw,u_up_vector:[0,-1,0],u_color_adj_mat:Ce,u_icon_transition:Se||0,u_gamma_scale:_?b.transform.getCameraToCenterDistance(de)*Math.cos(b.terrain?0:b.transform._pitch):1,u_device_pixel_ratio:a.o.devicePixelRatio,u_is_halo:1,u_scale_factor:Re||1,u_ground_shadow_factor:pe,u_inv_matrix:a.ba(a.bd(),T),u_normal_scale:ce,u_lutTexture:10,u_zoom:ve.zoom-Math.floor(ve.zoom),u_spp_fill_np_color:[0,0,0,1],u_spp_halo_np_color:[0,0,0,0],u_spp_opacity:1,u_spp_halo_width:0,u_spp_halo_blur:0,u_spp_emissive_strength:0,u_spp_occlusion_opacity:1,u_spp_z_offset:0,u_spp_translate_rotation:[1,0]};return de.name==="globe"&&(be.u_tile_id=[Z.canonical.x,Z.canonical.y,1<<Z.canonical.z],be.u_zoom_transition=te,be.u_inv_rot_matrix=oe,be.u_merc_center=ee,be.u_camera_forward=ve._camera.forward(),be.u_ecef_origin=a.dO(ve.globeMatrix,Z.toUnwrapped()),be.u_tile_matrix=ve.globeMatrix,be.u_up_vector=se),be},sw=(p,o,d,_)=>({u_matrix:p,u_emissive_strength:o,u_opacity:d,u_color:_}),Dg=(p,o,d,_,b,S,T,I,k)=>Object.assign((function(F,z,q,j,Z,te){const{width:ee,height:oe}=j.imageManager.getPixelSize(z),se=Math.pow(2,te.tileID.overscaledZ
3080),de=te.tileSize*Math.pow(2,j.transform.tileZoom)/se,pe=de*(te.tileID.canonical.x+te.tileID.wrap*se),ce=de*te.tileID.canonical.y;return{u_image:0,u_pattern_tl:q.tl,u_pattern_br:q.br,u_texsize:[ee,oe],u_pattern_size:q.displaySize,u_pattern_units_to_pixels:Z?[j.transform.width,-1*j.transform.height]:[1/a.az(te,1,j.transform.tileZoom),1/a.az(te,1,j.transform.tileZoom)],u_pixel_coord_upper:[pe>>16,ce>>16],u_pixel_coord_lower:[65535&pe,65535&ce]}})(0,S,T,_,I,k),{u_matrix:p,u_emissive_strength:o,u_opacity:d}),P0=new Float32Array(a.bA([])),Fg=(p,o,d,_,b,S,T,I,k,F,z,q,j,Z=[0,0,0],te,ee,oe,se=1)=>{const de=b.style.light,pe=de.properties.get("position"),ce=[-pe.x,-pe.y,pe.z],Ce=a.dH();de.properties.get("anchor")==="viewport"&&(a.dI(Ce,-b.transform.angle),a.dJ(ce,ce,Ce));const Se=z.alphaMode==="MASK",Re=de.properties.get("color").toNonPremultipliedRenderColor(null),ve=j.paint.get("model-ambient-occlusion-intensity"),be=j.paint.get("model-color").constantOr(a.C.white).toNonPremultipliedRenderColor(null);return be.a=j.paint.get("model-color-mix-intensity").constantOr(0),oe&&(be.r=oe[0],be.g=oe[1],be.b=oe[2],be.a=oe[3]),ee&&(be.r=ee.color.r,be.g=ee.color.g,be.b=ee.color.b,be.a=ee.colorMix,q=ee.emissionStrength,S*=ee.opacity),{u_matrix:p,u_lighting_matrix:o,u_normal_matrix:d,u_node_matrix:_||P0,u_lightpos:ce,u_lightintensity:de.properties.get("intensity"),u_lightcolor:[Re.r,Re.g,Re.b],u_camera_pos:Z,u_opacity:S,u_baseTextureIsAlpha:0,u_alphaMask:+Se,u_alphaCutoff:z.alphaCutoff,u_baseColorFactor:T.toNonPremultipliedRenderColor(null).toArray01(),u_emissiveFactor:I.toNonPremultipliedRenderColor(null).toArray01(),u_metallicFactor:k,u_roughnessFactor:F,u_baseColorTexture:5,u_metallicRoughnessTexture:6,u_normalTexture:7,u_occlusionTexture:8,u_emissionTexture:9,u_lutTexture:10,u_color_mix:be.toArray01(),u_aoIntensity:ve,u_emissive_strength:q,u_occlusionTextureTransform:te||[0,0,0,0],u_dithered_discard_threshold:se}},aw=(p,o=P0,d=P0)=>({u_matrix:p,u_instance:o,u_node_matrix:d}),lw={fillExtrusion:p=>({u_matrix:new a.c3(p),u_lightpos:new a.c0(p),u_lightintensity:new a.c1(p),u_lightcolor:new a.c0(p),u_vertical_gradient:new a.c1(p),u_opacity:new a.c1(p),u_edge_radius:new a.c1(p),u_width_scale:new a.c1(p),u_ao:new a.c2(p),u_height_type:new a.b$(p),u_base_type:new a.b$(p),u_tile_id:new a.c0(p),u_zoom_transition:new a.c1(p),u_inv_rot_matrix:new a.c3(p),u_merc_center:new a.c2(p),u_up_dir:new a.c0(p),u_height_lift:new a.c1(p),u_flood_light_color:new a.c0(p),u_vertical_scale:new a.c1(p),u_flood_light_intensity:new a.c1(p),u_ground_shadow_factor:new a.c0(p),u_front_cutoff_params:new a.c0(p)}),fillExtrusionDepth:p=>({u_matrix:new a.c3(p),u_edge_radius:new a.c1(p),u_width_scale:new a.c1(p),u_vertical_scale:new a.c1(p),u_height_type:new a.b$(p),u_base_type:new a.b$(p)}),fillExtrusionPattern:p=>({u_matrix:new a.c3(p),u_lightpos:new a.c0(p),u_lightintensity:new a.c1(p),u_lightcolor:new a.c0(p),u_vertical_gradient:new a.c1(p),u_height_factor:new a.c1(p),u_edge_radius:new a.c1(p),u_width_scale:new a.c1(p),u_ao:new a.c2(p),u_height_type:new a.b$(p),u_base_type:new a.b$(p),u_tile_id:new a.c0(p),u_zoom_transition:new a.c1(p),u_inv_rot_matrix:new a.c3(p),u_merc_center:new a.c2(p),u_up_dir:new a.c0(p),u_height_lift:new a.c1(p),u_image:new a.b$(p),u_texsize:new a.c2(p),u_pixel_coord_upper:new a.c2(p),u_pixel_coord_lower:new a.c2(p),u_tile_units_to_pixels:new a.c1(p),u_opacity:new a.c1(p),u_pattern_transition:new a.c1(p)}),fillExtrusionGroundEffect:p=>({u_matrix:new a.c3(p),u_opacity:new a.c1(p),u_ao_pass:new a.c1(p),u_meter_to_tile:new a.c1(p),u_ao:new a.c2(p),u_flood_light_intensity:new a.c1(p),u_flood_light_color:new a.c0(p),u_attenuation:new a.c1(p),u_edge_radius:new a.c1(p),u_fb:new a.b$(p),u_fb_size:new a.c1(p),u_dynamic_offset:new a.c1(p)}),fill:p=>({u_matrix:new a.c3(p),u_emissive_strength:new a.c1(p),u_ground_shadow_factor:new a.c0(p)}),fillPattern:p=>({u_matrix:new a.c3(p),u_emissive_strength:new a.c1(p),u_image:new a.b$(p),u_texsize:new a.c2(p),u_pixel_coord_upper:new a.c2(p),u_pixel_coord_lower:new a.c2(p),u_tile_units_to_pixels:new a.c1(p),u_ground_shadow_factor:new a.c0(p),u_pattern_transition:new a.c1(p)}),fillOutline:p=>({u_matrix:new a.c3(p),u_emissive_strength:new a.c1(p),u_world:new a.c2(p),u_ground_shadow_factor:new a.c0(p)}),fillOutlinePattern:p=>({u_matrix:new a.c3(p),u_emissive_strength:new a.c1(p),u_world:new a.c2(p),u_image:new a.b$(p),u_texsize:new a.c2(p),u_pixel_coord_upper:new a.c2(p),u_pixel_coord_lower:new a.c2(p),u_tile_units_to_pixels:new a.c1(p),u_ground_shadow_factor:new a.c0(p),u_pattern_transition:new a.c1(p)}),lineBlendComposite:p=>({u_image:new a.b$(p),u_opacity:new a.c1(p),u_blend_mode:new a.b$(p),u_max_density:new a.c1(p)}),lineBlendReduce:p=>({u_image:new a.b$(p),u_texel_size:new a.c2(p),u_first_pass:new a.b$(p)}),elevatedStructuresDepth:p=>({u_matrix:new a.c3(p),u_depth_bias:new a.c1(p)}),elevatedStructures:p=>({u_matrix:new a.c3(p),u_ground_shadow_factor:new a.c0(p)}),elevatedStructuresDepthReconstruct:p=>({u_matrix:new a.c3(p),u_camera_pos:new a.c0(p),u_depth_bias:new a.c1(p),u_height_scale:new a.c1(p),u_reset_depth:new a.c1(p)}),circle:a.dR,collisionBox:p=>({u_matrix:new a.c3(p),u_inv_rot_matrix:new a.c3(p),u_camera_to_center_distance:new a.c1(p),u_extrude_scale:new a.c2(p),u_zoom_transition:new a.c1(p),u_merc_center:new a.c2(p),u_tile_id:new a.c0(p)}),collisionCircle:p=>({u_matrix:new a.c3(p),u_inv_matrix:new a.c3(p),u_camera_to_center_distance:new a.c1(p),u_viewport_size:new a.c2(p)}),debug:p=>({u_color:new a.dp(p),u_matrix:new a.c3(p),u_overlay:new a.b$(p),u_overlay_scale:new a.c1(p)}),clippingMask:p=>({u_matrix:new a.c3(p)}),heatmap:p=>({u_extrude_scale:new a.c1(p),u_intensity:new a.c1(p),u_matrix:new a.c3(p),u_inv_rot_matrix:new a.c3(p),u_merc_center:new a.c2(p),u_tile_id:new a.c0(p),u_zoom_transition:new a.c1(p),u_up_dir:new a.c0(p)}),heatmapTexture:p=>({u_image:new a.b$(p),u_color_ramp:new a.b$(p),u_opacity:new a.c1(p)}),hillshade:p=>({u_matrix:new a.c3(p),u_image:new a.b$(p),u_latrange:new a.c2(p),u_light:new a.c2(p),u_shadow:new a.dp(p),u_highlight:new a.dp(p),u_emissive_strength:new a.c1(p),u_accent:new a.dp(p)}),hillshadePrepare:p=>({u_matrix:new a.c3(p),u_image:new a.b$(p),u_dimension:new a.c2(p),u_zoom:new a.c1(p)}),line:a.dQ,linePattern:a.dP,raster:p=>({u_matrix:new a.c3(p),u_normalize_matrix:new a.c3(p),u_globe_matrix:new a.c3(p),u_merc_matrix:new a.c3(p),u_grid_matrix:new a.dq(p),u_tl_parent:new a.c2(p),u_scale_parent:new a.c1(p),u_fade_t:new a.c1(p),u_opacity:new a.c1(p),u_image0:new a.b$(p),u_image1:new a.b$(p),u_brightness_low:new a.c1(p),u_brightness_high:new a.c1(p),u_saturation_factor:new a.c1(p),u_contrast_factor:new a.c1(p),u_spin_weights:new a.c0(p),u_perspective_transform:new a.c2(p),u_raster_elevation:new a.c1(p),u_zoom_transition:new a.c1(p),u_merc_center:new a.c2(p),u_cutoff_params:new a.cS(p),u_colorization_mix:new a.cS(p),u_colorization_offset:new a.c1(p),u_color_ramp:new a.b$(p),u_texture_offset:new a.c2(p),u_texture_res:new a.c2(p),u_emissive_strength:new a.c1(p),u_zbias_factor:new a.c1(p)}),symbol:p=>({u_is_size_zoom_constant:new a.b$(p),u_is_size_feature_constant:new a.b$(p),u_size_t:new a.c1(p),u_size:new a.c1(p),u_camera_to_center_distance:new a.c1(p),u_rotate_symbol:new a.b$(p),u_aspect_ratio:new a.c1(p),u_fade_change:new a.c1(p),u_matrix:new a.c3(p),u_label_plane_matrix:new a.c3(p),u_coord_matrix:new a.c3(p),u_is_text:new a.b$(p),u_elevation_from_sea:new a.b$(p),u_pitch_with_map:new a.b$(p),u_texsize:new a.c2(p),u_texsize_icon:new a.c2(p),u_texture:new a.b$(p),u_texture_icon:new a.b$(p),u_gamma_scale:new a.c1(p),u_device_pixel_ratio:new a.c1(p),u_tile_id:new a.c0(p),u_zoom_transition:new a.c1(p),u_inv_rot_matrix:new a.c3(p),u_merc_center:new a.c2(p),u_camera_forward:new a.c0(p),u_tile_matrix:new a.c3(p),u_up_vector:new a.c0(p),u_ecef_origin:new a.c0(p),u_is_halo:new a.b$(p),u_icon_transition:new a.c1(p),u_color_adj_mat:new a.c3(p),u_scale_factor:new a.c1(p),u_ground_shadow_factor:new a.c0(p),u_inv_matrix:new a.c3(p),u_normal_scale:new a.c1(p),u_lutTexture:new a.b$(p),u_zoom:new a.c1(p),u_spp_fill_np_color:new a.cS(p),u_spp_halo_np_color:new a.cS(p),u_spp_opacity:new a.c1(p),u_spp_halo_width:new a.c1(p),u_spp_halo_blur:new a.c1(p),u_spp_emissive_strength:new a.c1(p),u_spp_occlusion_opacity:new a.c1(p),u_spp_z_offset:new a.c1(p),u_spp_translate_rotation:new a.c2(p)}),background:p=>({u_matrix:new a.c3(p),u_emissive_strength:new a.c1(p),u_opacity:new a.c1(p),u_color:new a.dp(p)}),backgroundPattern:p=>({u_matrix:new a.c3(p),u_emissive_strength:new a.c1(p),u_opacity:new a.c1(p),u_image:new a.b$(p),u_pattern_tl:new a.c2(p),u_pattern_br:new a.c2(p),u_texsize:new a.c2(p),u_pattern_size:new a.c2(p),u_pixel_coord_upper:new a.c2(p),u_pixel_coord_lower:new a.c2(p),u_pattern_units_to_pixels:new a.c2(p)}),terrainRaster:p=>({u_matrix:new a.c3(p),u_image0:new a.b$(p),u_image1:new a.b$(p),u_skirt_height:new a.c1(p),u_ground_shadow_factor:new a.c0(p),u_emissive_texture_available:new a.c1(p)}),skybox:p=>({u_matrix:new a.c3(p),u_sun_direction:new a.c0(p),u_cubemap:new a.b$(p),u_opacity:new a.c1(p),u_temporal_offset:new a.c1(p)}),skyboxGradient:p=>({u_matrix:new a.c3(p),u_color_ramp:new a.b$(p),u_center_direction:new a.c0(p),u_radius:new a.c1(p),u_opacity:new a.c1(p),u_temporal_offset:new a.c1(p)}),skyboxCapture:p=>({u_matrix_3f:new a.dq(p),u_sun_direction:new a.c0(p),u_sun_intensity:new a.c1(p),u_color_tint_r:new a.cS(p),u_color_tint_m:new a.cS(p),u_luminance:new a.c1(p)}),globeRaster:p=>({u_proj_matrix:new a.c3(p),u_globe_matrix:new a.c3(p),u_normalize_matrix:new a.c3(p),u_merc_matrix:new a.c3(p),u_zoom_transition:new a.c1(p),u_merc_center:new a.c2(p),u_image0:new a.b$(p),u_image1:new a.b$(p),u_grid_matrix:new a.dq(p),u_skirt_height:new a.c1(p),u_far_z_cutoff:new a.c1(p),u_frustum_tl:new a.c0(p),u_frustum_tr:new a.c0(p),u_frustum_br:new a.c0(p),u_frustum_bl:new a.c0(p),u_globe_pos:new a.c0(p),u_globe_radius:new a.c1(p),u_viewport:new a.c2(p),u_emissive_texture_available:new a.c1(p)}),globeAtmosphere:p=>({u_frustum_tl:new a.c0(p),u_frustum_tr:new a.c0(p),u_frustum_br:new a.c0(p),u_frustum_bl:new a.c0(p),u_horizon:new a.c1(p),u_transition:new a.c1(p),u_fadeout_range:new a.c1(p),u_atmosphere_fog_color:new a.cS(p),u_high_color:new a.cS(p),u_space_color:new a.cS(p),u_temporal_offset:new a.c1(p),u_horizon_angle:new a.c1(p)}),model:p=>({u_matrix:new a.c3(p),u_lighting_matrix:new a.c3(p),u_normal_matrix:new a.c3(p),u_node_matrix:new a.c3(p),u_lightpos:new a.c0(p),u_lightintensity:new a.c1(p),u_lightcolor:new a.c0(p),u_camera_pos:new a.c0(p),u_opacity:new a.c1(p),u_baseColorFactor:new a.cS(p),u_emissiveFactor:new a.cS(p),u_metallicFactor:new a.c1(p),u_roughnessFactor:new a.c1(p),u_baseTextureIsAlpha:new a.b$(p),u_alph
3080aMask:new a.b$(p),u_alphaCutoff:new a.c1(p),u_baseColorTexture:new a.b$(p),u_metallicRoughnessTexture:new a.b$(p),u_normalTexture:new a.b$(p),u_occlusionTexture:new a.b$(p),u_emissionTexture:new a.b$(p),u_lutTexture:new a.b$(p),u_color_mix:new a.cS(p),u_aoIntensity:new a.c1(p),u_emissive_strength:new a.c1(p),u_occlusionTextureTransform:new a.cS(p),u_dithered_discard_threshold:new a.c1(p)}),modelDepth:p=>({u_matrix:new a.c3(p),u_instance:new a.c3(p),u_node_matrix:new a.c3(p)}),groundShadow:p=>({u_matrix:new a.c3(p),u_ground_shadow_factor:new a.c0(p)}),stars:p=>({u_matrix:new a.c3(p),u_up:new a.c0(p),u_right:new a.c0(p),u_intensity_multiplier:new a.c1(p)}),occlusion:p=>({u_matrix:new a.c3(p),u_anchorPos:new a.c0(p),u_screenSizePx:new a.c2(p),u_occluderSizePx:new a.c2(p),u_color:new a.cS(p)})};class Eu{constructor(o,d,_,b){this.id=Eu.uniqueIdxCounter,Eu.uniqueIdxCounter++,this.context=o;const S=o.gl;this.buffer=S.createBuffer(),this.dynamicDraw=!!_,this.context.unbindVAO(),o.bindElementBuffer.set(this.buffer),S.bufferData(S.ELEMENT_ARRAY_BUFFER,d.arrayBuffer,this.dynamicDraw?S.DYNAMIC_DRAW:S.STATIC_DRAW),this.dynamicDraw||b||d.destroy()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(o){this.id=Eu.uniqueIdxCounter,Eu.uniqueIdxCounter++;const d=this.context.gl;this.context.unbindVAO(),this.bind(),d.bufferSubData(d.ELEMENT_ARRAY_BUFFER,0,o.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}Eu.uniqueIdxCounter=0;const A2={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class ra{constructor(o,d,_,b,S,T){this.length=d.length,this.attributes=_,this.itemSize=d.bytesPerElement,this.dynamicDraw=b,this.instanceCount=T,this.context=o;const I=o.gl;this.buffer=I.createBuffer(),o.bindVertexBuffer.set(this.buffer),I.bufferData(I.ARRAY_BUFFER,d.arrayBuffer,this.dynamicDraw?I.DYNAMIC_DRAW:I.STATIC_DRAW),this.dynamicDraw||S||d.destroy()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(o){const d=this.context.gl;this.bind(),d.bufferSubData(d.ARRAY_BUFFER,0,o.arrayBuffer)}enableAttributes(o,d){for(const _ of this.attributes){const b=d.getAttributeLocation(o,_.name);b!==-1&&o.enableVertexAttribArray(b)}}setVertexAttribPointers(o,d,_){for(const b of this.attributes){const S=d.getAttributeLocation(o,b.name);if(S!==-1){const T=b.offset+this.itemSize*(_||0);b.type==="Float32"?o.vertexAttribPointer(S,b.components,o.FLOAT,!1,this.itemSize,T):o.vertexAttribIPointer(S,b.components,o[A2[b.type]],this.itemSize,T)}}}setVertexAttribDivisor(o,d,_){for(let b=0;b<this.attributes.length;b++){const S=d.getAttributeLocation(o,this.attributes[b].name);S!==-1&&this.instanceCount&&this.instanceCount>0&&o.vertexAttribDivisor(S,_)}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class Cu{constructor(o,d,_,b,S){this.context=o,this.width=d,this.height=_;const T=this.framebuffer=o.gl.createFramebuffer();b>0&&(this.colorAttachment0=new Cg(o,T,0)),b>1&&(this.colorAttachment1=new Cg(o,T,1)),S&&(this.depthAttachmentType=S,this.depthAttachment=S==="renderbuffer"?new _0(o,T):new C2(o,T))}static createWithTexture(o,d,_,b,S){const T=o.gl;if(o.activeTexture.set(T.TEXTURE1),o.viewport.set([0,0,_,b]),d&&d.width===_&&d.height===b)return T.bindTexture(T.TEXTURE_2D,d.colorAttachment0.get()),o.bindFramebuffer.set(d.framebuffer),d;d&&d.destroy();const I=o.extRenderToTextureHalfFloat||o.extColorBufferFloat?o.gl.RGBA16F:o.gl.RGBA8,k=new a.T(o,{width:_,height:b,data:null},I);k.bind(T.LINEAR,T.CLAMP_TO_EDGE);const F=o.createFramebuffer(_,b,1,null);if(F.format=I,F.colorAttachment0.set(k.texture),S){const z=o.createRenderbuffer(T.DEPTH24_STENCIL8,_,b);o.bindFramebuffer.set(F.framebuffer),T.framebufferRenderbuffer(T.FRAMEBUFFER,T.DEPTH_STENCIL_ATTACHMENT,T.RENDERBUFFER,z),F._stencilRbo=z}return F}createColorAttachment(o,d){d===0?this.colorAttachment0=new Cg(o,this.framebuffer,0):d===1&&(this.colorAttachment1=new Cg(o,this.framebuffer,1))}removeColorAttachment(o,d){const _=this.context.gl;let b;d===0?(b=this.colorAttachment0.get(),this.colorAttachment0=void 0):d===1&&(b=this.colorAttachment1.get(),this.colorAttachment1=void 0),b&&_.deleteTexture(b)}destroy(){const o=this.context.gl;if(this.colorAttachment0){const d=this.colorAttachment0.get();d&&o.deleteTexture(d)}if(this.colorAttachment1){const d=this.colorAttachment1.get();d&&o.deleteTexture(d)}if(this.depthAttachment&&this.depthAttachmentType)if(this.depthAttachmentType==="renderbuffer"){const d=this.depthAttachment.get();d&&o.deleteRenderbuffer(d)}else{const d=this.depthAttachment.get();d&&o.deleteTexture(d)}this._stencilRbo&&(o.deleteRenderbuffer(this._stencilRbo),this._stencilRbo=null),o.deleteFramebuffer(this.framebuffer)}}class As{constructor(o,d){this.gl=o,this._pendingPrograms=new Set,this._compileStats={precompiled:0,onDemand:0,totalStallMs:0,maxStallMs:0,framesMissed:0,stalls:[]},this.clearColor=new B1(this),this.clearDepth=new z1(this),this.clearStencil=new Xh(this),this.colorMask=new v2(this),this.depthMask=new b2(this),this.stencilMask=new x2(this),this.stencilFunc=new w2(this),this.stencilOp=new S2(this),this.stencilTest=new T2(this),this.depthRange=new c0(this),this.depthTest=new u0(this),this.depthFunc=new d0(this),this.blend=new Zh(this),this.blendFunc=new N1(this),this.blendColor=new V1(this),this.blendEquation=new U1(this),this.cullFace=new h0(this),this.cullFaceSide=new wu(this),this.frontFace=new Sg(this),this.program=new Tg(this),this.activeTexture=new $1(this),this.viewport=new Su(this),this.bindFramebuffer=new f0(this),this.bindRenderbuffer=new Eg(this),this.bindTexture=new j1(this),this.bindVertexBuffer=new G1(this),this.bindElementBuffer=new p0(this),this.bindVertexArrayOES=new m0(this),this.pixelStoreUnpack=new E2(this),this.pixelStoreUnpackPremultiplyAlpha=new H1(this),this.pixelStoreUnpackFlipY=new Op(this),this.options=d?Object.assign({},d):{},this.options.extTextureFilterAnisotropicForceOff||(this.extTextureFilterAnisotropic=o.getExtension("EXT_texture_filter_anisotropic")||o.getExtension("MOZ_EXT_texture_filter_anisotropic")||o.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=o.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT))),this.extDebugRendererInfo=o.getExtension("WEBGL_debug_renderer_info"),this.extDebugRendererInfo&&(this.renderer=o.getParameter(this.extDebugRendererInfo.UNMASKED_RENDERER_WEBGL),this.vendor=o.getParameter(this.extDebugRendererInfo.UNMASKED_VENDOR_WEBGL)),this.forceManualRenderingForInstanceIDShaders=d&&!!d.forceManualRenderingForInstanceIDShaders||this.renderer&&this.renderer.includes("PowerVR"),this.disableSymbolUBO=d&&!!d.forceDisableSymbolUBO,this.options.extTextureFloatLinearForceOff||(this.extTextureFloatLinear=o.getExtension("OES_texture_float_linear")),this.extRenderToTextureHalfFloat=o.getExtension("EXT_color_buffer_half_float"),this.extColorBufferFloat=o.getExtension("EXT_color_buffer_float"),this.extTimerQuery=o.getExtension("EXT_disjoint_timer_query_webgl2"),this.maxTextureSize=o.getParameter(o.MAX_TEXTURE_SIZE),this.maxUniformBlockSize=Math.min(o.getParameter(o.MAX_UNIFORM_BLOCK_SIZE),32768),this.maxUniformBufferBindings=o.getParameter(o.MAX_UNIFORM_BUFFER_BINDINGS),this.extBlendFuncExtended=o.getExtension("WEBGL_blend_func_extended"),this.extParallelShaderCompile=o.getExtension("KHR_parallel_shader_compile")}
3080sweepPendingPrograms(){if(this._pendingPrograms.size!==0)for(const o of this._pendingPrograms)o.maybeFinalize()}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.bindVertexArrayOES.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(o,d,_){return new Eu(this,o,d,_)}createVertexBuffer(o,d,_,b,S){return new ra(this,o,d,_,b,S)}createRenderbuffer(o,d,_){const b=this.gl,S=b.createRenderbuffer();return this.bindRenderbuffer.set(S),b.renderbufferStorage(b.RENDERBUFFER,o,d,_),this.bindRenderbuffer.set(null),S}createFramebuffer(o,d,_,b){return new Cu(this,o,d,_,b)}clear({color:o,depth:d,stencil:_,colorMask:b}){const S=this.gl;let T=0;o&&(T|=S.COLOR_BUFFER_BIT,this.clearColor.set(o.toNonPremultipliedRenderColor(null)),this.colorMask.set(b||[!0,!0,!0,!0])),d!==void 0&&(T|=S.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(d),this.depthMask.set(!0)),_!==void 0&&(T|=S.STENCIL_BUFFER_BIT,this.clearStencil.set(_),this.stencilMask.set(255)),S.clear(T)}setCullFace(o){o.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(o.mode),this.frontFace.set(o.frontFace))}setDepthMode(o){o.func!==this.gl.ALWAYS||o.mask?(this.depthTest.set(!0),this.depthFunc.set(o.func),this.depthMask.set(o.mask),this.depthRange.set(o.range)):this.depthTest.set(!1)}setStencilMode(o){o.test.func!==this.gl.ALWAYS||o.mask?(this.stencilTest.set(!0),this.stencilMask.set(o.mask),this.stencilOp.set([o.fail,o.depthFail,o.pass]),this.stencilFunc.set({func:o.test.func,ref:o.ref,mask:o.test.mask})):this.stencilTest.set(!1)}setColorMode(o){a.b9(o.blendFunction,In.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(o.blendFunction),this.blendColor.set(o.blendColor),o.blendEquation?this.blendEquation.set(o.blendEquation):this.blendEquation.setDefault()),this.colorMask.set(o.mask)}unbindVAO(){this.bindVertexArrayOES.set(null)}}let _l;function R0(p,o,d,_,b,S,T){const I=p.context,k=I.gl,F=p.transform,z=[a.aG(F.center.lng),a.aJ(F.center.lat)],q=d.layout.get("symbol-placement"),j=d.layout.get("text-variable-anchor"),Z=d.layout.get("icon-rotation-alignment")==="map",te=d.layout.get("text-rotation-alignment")==="map",ee=q!=="point",oe=[];let se=0,de=0;for(let ve=0;ve<_.length;ve++){const be=_[ve],Ae=o.getTile(be),Ne=Ae.getBucket(d);if(!Ne)continue;const De=Ne.getProjection().createInversionMatrix(F,be.canonical),Ye=[],Ke=$a(be,Ne,F),Tt=!T&&Z&&ee,Ue=T&&te&&ee,rt=j&&Ne.hasTextData(),$e=Ne.hasIconTextFit()&&rt&&Ne.hasIconData(),ct=Tt||Ue||T&&rt||$e,at=Ne.projection.name==="globe",dt=at?a.ai(F.zoom):0;at&&(Ye.push("PROJECTION_GLOBE_VIEW"),ct&&Ye.push("PROJECTED_POS_ON_VIEWPORT"));const Gt=p.getOrCreateProgram("collisionBox",{defines:Ye});let Mt=Ke;b[0]===0&&b[1]===0||(Mt=p.translatePosMatrix(Ke,Ae,b,S));const Ct=T?Ne.textCollisionBox:Ne.iconCollisionBox,xt=Ne.collisionCircleArray;
3080if(xt.length>0){const an=a.bd(),Jt=Mt;a.cB(an,Ne.placementInvProjMatrix,F.glCoordMatrix),a.cB(an,an,Ne.placementViewportMatrix),oe.push({circleArray:xt,circleOffset:de,transform:Jt,invTransform:an,projection:Ne.getProjection()}),se+=xt.length/4,de=se}if(!Ct)continue;p.terrain&&p.terrain.setupElevationDraw(Ae,Gt);const dn=at?[be.canonical.x,be.canonical.y,1<<be.canonical.z]:[0,0,0];Gt.draw(p,k.LINES,rn.disabled,Tn.disabled,p.colorModeForRenderPass(),pn.disabled,tw(Mt,De,F,dt,z,Ae,dn,Ne.getProjection()),d.id,Ct.layoutVertexBuffer,Ct.indexBuffer,Ct.segments,null,F.zoom,null,[Ct.collisionVertexBuffer,Ct.collisionVertexBufferExt])}if(!T||!oe.length)return;const pe=p.getOrCreateProgram("collisionCircle"),ce=new a.dS;ce.resize(4*se),ce._trim();let Ce=0;for(const ve of oe)for(let be=0;be<ve.circleArray.length/4;be++){const Ae=4*be,Ne=ve.circleArray[Ae+0],De=ve.circleArray[Ae+1],Ye=ve.circleArray[Ae+2],Ke=ve.circleArray[Ae+3];ce.emplace(Ce++,Ne,De,Ye,Ke,0),ce.emplace(Ce++,Ne,De,Ye,Ke,1),ce.emplace(Ce++,Ne,De,Ye,Ke,2),ce.emplace(Ce++,Ne,De,Ye,Ke,3)}(!_l||_l.length<2*se)&&(_l=(function(ve){const be=2*ve,Ae=new a.dF;Ae.resize(be),Ae._trim();for(let Ne=0;Ne<be;Ne++){const De=6*Ne;Ae.uint16[De+0]=4*Ne+0,Ae.uint16[De+1]=4*Ne+1,Ae.uint16[De+2]=4*Ne+2,Ae.uint16[De+3]=4*Ne+2,Ae.uint16[De+4]=4*Ne+3,Ae.uint16[De+5]=4*Ne+0}return Ae})(se));const Se=I.createIndexBuffer(_l,!0),Re=I.createVertexBuffer(ce,a.dT.members,!0);for(const ve of oe){const be=nw(ve.transform,ve.invTransform,F,ve.projection);pe.draw(p,k.TRIANGLES,rn.disabled,Tn.disabled,p.colorModeForRenderPass(),pn.disabled,be,d.id,Re,Se,a.dB.simpleSegment(0,2*ve.circleOffset,ve.circleArray.length,ve.circleArray.length/2),null,F.zoom)}Re.destroy(),Se.destroy()}const Qh=a.bd();function Bg(p){const o=p._camera.getWorldToCamera(p.worldSize,1),d=a.aC([],o,p.globeMatrix);a.ba(d,d);const _=[0,0,0],b=[0,1,0,0];return a.aD(b,b,d),_[0]=b[0],_[1]=b[1],_[2]=b[2],a.ax(_,_),_}function k0({width:p,height:o,anchor:d,textOffset:_,textScale:b},S){const{horizontalAlign:T,verticalAlign:I}=a.bJ(d),k=-(T-.5)*p,F=-(I-.5)*o,z=a.bK(d,_);return new a.P((k/b+z[0])*S,(F/b+z[1])*S)}function cw(p,o,d,_,b,S,T,I,k,F){const z=p.text.placedSymbolArray,q=p.text.dynamicLayoutVertexArray,j=p.icon.dynamicLayoutVertexArray,Z={},te=p.getProjection(),ee=_s(T,te,b),oe=b.elevation,se=te.upVectorScale(T.canonical,b.center.lat,b.worldSize).metersToTile;q.clear();for(let de=0;de<z.length;de++){const pe=z.get(de),{tileAnchorX:ce,tileAnchorY:Ce,numGlyphs:Se}=pe,Re=pe.hidden||!pe.crossTileID||p.allowVerticalPlacement&&!pe.placedOrientation?null:_[pe.crossTileID];if(Re){let ve=0,be=0,Ae=0;const Ne=p.elevationType==="road";if(oe||Ne){const at=Ne?p.getElevationFeatureForText(de):null,dt=a.bx.getAtTileOffset(T,new a.P(ce,Ce),oe,at),[Gt,Mt,Ct]=te.upVector(T.canonical,ce,Ce);ve=dt*Gt*se,be=dt*Mt*se,Ae=dt*Ct*se}let[De,Ye,Ke,Tt]=hi(pe.projectedAnchorX+ve,pe.projectedAnchorY+be,pe.projectedAnchorZ+Ae,d?ee:S);const Ue=sg(b.getCameraToCenterDistance(te),Tt);let rt=a.bn(p.textSizeData,k,pe)*Ue/a.bC;d&&(rt*=p.tilePixelRatio/I);const $e=k0(Re,rt);d?({x:De,y:Ye,z:Ke}=te.projectTilePoint(ce+$e.x,Ce+$e.y,T.canonical),[De,Ye,Ke]=hi(De+ve,Ye+be,Ke+Ae,S)):(o&&$e._rotate(-b.angle),De+=$e.x,Ye+=$e.y,Ke=0);const ct=p.allowVerticalPlacement&&pe.placedOrientation===a.bm.vertical?Math.PI/2:0;for(let at=0;at<Se;at++)a.bp(q,De,Ye,Ke,ct);F&&pe.associatedIconIndex>=0&&(Z[pe.associatedIconIndex]={x:De,y:Ye,z:Ke,angle:ct})}else Vh(Se,q)}if(F){j.clear();const de=p.icon.placedSymbolArray;for(let pe=0;pe<de.length;pe++){const ce=de.get(pe),{numGlyphs:Ce}=ce,Se=Z[pe];if(ce.hidden||!Se)Vh(Ce,j);else{const{x:Re,y:ve,z:be,angle:Ae}=Se;for(let Ne=0;Ne<Ce;Ne++)a.bp(j,Re,ve,be,Ae)}}p.icon.dynamicLayoutVertexBuffer.updateData(j)}p.text.dynamicLayoutVertexBuffer.updateData(q)}function yl(p,o,d,_,b,S,T={}){const I=d.paint.get("icon-translate"),k=d.paint.get("text-translate"),F=d.paint.get("icon-translate-anchor"),z=d.paint.get("text-translate-anchor"),q=d.layout.get("icon-rotation-alignment"),j=d.layout.get("text-rotation-alignment"),Z=d.layout.get("icon-pitch-alignment"),te=d.layout.get("text-pitch-alignment"),ee=d.layout.get("icon-keep-upright"),oe=d.layout.get("text-keep-upright"),se=d.paint.get("icon-color-saturation"),de=
3080d.paint.get("icon-color-contrast"),pe=d.paint.get("icon-color-brightness-min"),ce=d.paint.get("icon-color-brightness-max"),Ce=d.layout.get("symbol-elevation-reference")==="sea",Se=d.layout.get("icon-image-use-theme")==="none",Re=p.context,ve=Re.gl,be=p.transform,Ae=q==="map",Ne=j==="map",De=Z==="map",Ye=te==="map",Ke=d.layout.get("symbol-sort-key").constantOr(1)!==void 0;let Tt=!1;const Ue=p.depthModeForSublayer(0,rn.ReadOnly),rt=new rn(p.context.gl.LEQUAL,rn.ReadOnly,p.depthRangeFor3D),$e=[a.aG(be.center.lng),a.aJ(be.center.lat)],ct=d.layout.get("text-variable-anchor"),at=be.projection.name==="globe",dt=[],Gt=[0,-1,0];for(const Mt of _){const Ct=o.getTile(Mt),xt=Ct.getBucket(d);if(!xt||xt.projection.name==="mercator"&&at||xt.fullyClipped)continue;const dn=xt.projection.name==="globe",an=dn?a.ai(be.zoom):0,Jt=_s(Mt,xt.getProjection(),be),tn=be.calculatePixelsToTileUnitsMatrix(Ct),bn=ct&&xt.hasTextData(),kn=xt.hasIconTextFit()&&bn&&xt.hasIconData(),Pn=xt.getProjection().createInversionMatrix(be,Mt.canonical),jn=(1<<Ct.tileID.canonical.z)*a.ak/p.transform.worldSize,An=kr=>{let Dn=[0,0,0];if(kr){const ri=p.style.directionalLight,$r=p.style.ambientLight;ri&&$r&&(Dn=xd(p.style,ri,$r))}return Dn},or=kr=>{if(p.context.disableSymbolUBO)return;kr.push("USE_PAINT_PROPERTIES_UBO");const Dn=Math.floor(p.context.maxUniformBlockSize/4),ri=Math.floor(Dn/4);kr.push(`MAX_UBO_SIZE_VEC4 ${ri}u`)},Fn=kr=>{be.depthOcclusionForSymbolsAndCircles&&(d.hasOcclusionOpacityProperties||p.terrain)&&(kr.push("DEPTH_D24"),kr.push("DEPTH_OCCLUSION"))},fr=kr=>{d.lut&&!Se&&(d.lut.texture||(d.lut.texture=new a.dU(p.context,d.lut.image,[d.lut.image.height,d.lut.image.height,d.lut.image.height],Re.gl.RGBA8)),Re.activeTexture.set(Re.gl.TEXTURE0+10),d.lut.texture&&d.lut.texture.bind(Re.gl.LINEAR,Re.gl.CLAMP_TO_EDGE),kr.push("APPLY_LUT_ON_GPU"))},Or=()=>{const kr=Ae&&d.layout.get("symbol-placement")!=="point",Dn=[];Fn(Dn),fr(Dn);const ri=kr||kn,$r=xt.elevationType==="road",Ii=p.shadowRenderer,lr=$r&&De&&!!Ii&&Ii.enabled,$i=An(lr),Yo=$r&&De&&!p.terrain?rt:Ue,fo=d.paint.get("icon-image-cross-fade");p.terrainRenderModeElevated()&&De&&Dn.push("PITCH_WITH_MAP_TERRAIN"),dn&&(Dn.push("PROJECTION_GLOBE_VIEW"),ri&&Dn.push("PROJECTED_POS_ON_VIEWPORT")),fo>0&&xt.hasAnySecondaryIcon&&Dn.push("ICON_TRANSITION"),!xt.icon.zOffsetVertexBuffer||$r&&p.terrain||Dn.push("Z_OFFSET"),se===0&&de===0&&pe===0&&ce===1||Dn.push("COLOR_ADJUSTMENT"),xt.sdfIcons&&Dn.push("RENDER_SDF"),lr&&Dn.push("RENDER_SHADOWS","NORMAL_OFFSET"),$r&&De&&!p.terrain&&xt.icon.orientationVertexBuffer&&Dn.push("ELEVATED_ROADS"),or(Dn);const Lo=Re.disableSymbolUBO?xt.icon.programConfigurations.get(d.id):null,io=p.getOrCreateProgram("symbol",{config:Lo,defines:Dn}),Rs=Ct.imageAtlasTexture?Ct.imageAtlasTexture.size:[0,0],ks=xt.iconSizeData,Yi=a.bl(ks,be.zoom),cs=De||!be.isOrthographic,vr=Zi(Jt,Ct.tileID.canonical,De,Ae,be,xt.getProjection(),tn),Dr=ml(Jt,Ct.tileID.canonical,De,Ae,be,xt.getProjection(),tn),Er=xt.icon.uboBinder&&xt.icon.uboBinder.cachedHeader&&256&xt.icon.uboBinder.cachedHeader.dataDrivenMask?[0,0]:I,ji=p.translatePosMatrix(Dr,Ct,Er,F,!0),To=p.translatePosMatrix(Jt,Ct,Er,F),Ti=ri?Qh:vr,ys=Ae&&!De&&!kr;let vs=Gt;!at&&!be.mercatorFromTransition||Ae||(vs=Bg(be));const xl=dn?vs:Gt,aa=d.getColorAdjustmentMatrix(se,de,pe,ce),Ia=ow(ks.kind,Yi,ys,De,p,To,Ti,ji,Ce,!1,Rs,[0,0],0,Mt,an,$e,Pn,xl,xt.getProjection(),$i,jn,aa,fo,null),zc=Ct.imageAtlasTexture?Ct.imageAtlasTexture:null,wl=d.layout.get("icon-size").constantOr(0)!==1||xt.iconsNeedLinear,Kp=xt.sdfIcons||p.options.rotating||p.options.zooming||wl||cs?ve.LINEAR:ve.NEAREST,Du=xt.sdfIcons&&d.paint.get("icon-halo-width").constantOr(1)!==0,zd=p.terrain&&De&&kr?a.ba(a.bd(),vr):Qh;if(kr&&xt.icon){const uv=a.bx.getAtTileOffsetFunc(Mt,be.center.lat,be.worldSize,xt.getProjection()),dv=ja(Jt,Ct.tileID.canonical,De,Ae,be,xt.getProjection(),tn),t_=d.layout.get("icon-size-scale-range"),X2=a.aB(p.scaleFactor,t_[0],t_[1]);Nh(xt,Jt,p,!1,dv,Dr,De,ee,uv,Mt,X2)}return{program:io,buffers:xt.icon,uniformValues:Ia,atlasTexture:zc,atlasTextureIcon:null,atlasInterpolation:Kp,atlasInterpolationIcon:null,isSDF:xt.sdfIcons,hasH
3080alo:Du,depthMode:Yo,tile:Ct,renderWithShadows:lr,labelPlaneMatrixInv:zd}},Fr=()=>{const kr=Ne&&d.layout.get("symbol-placement")!=="point",Dn=[],ri=kr||ct||kn,$r=xt.elevationType==="road",Ii=p.shadowRenderer,lr=$r&&Ye&&!!Ii&&Ii.enabled,$i=An(lr),Yo=$r&&Ye&&!p.terrain?rt:Ue;p.terrainRenderModeElevated()&&Ye&&Dn.push("PITCH_WITH_MAP_TERRAIN"),dn&&(Dn.push("PROJECTION_GLOBE_VIEW"),ri&&Dn.push("PROJECTED_POS_ON_VIEWPORT")),!xt.text.zOffsetVertexBuffer||$r&&p.terrain||Dn.push("Z_OFFSET"),xt.iconsInText&&Dn.push("RENDER_TEXT_AND_SYMBOL"),Dn.push("RENDER_SDF"),lr&&Dn.push("RENDER_SHADOWS","NORMAL_OFFSET"),$r&&Ye&&!p.terrain&&xt.text.orientationVertexBuffer&&Dn.push("ELEVATED_ROADS"),Fn(Dn),or(Dn);const fo=Re.disableSymbolUBO?xt.text.programConfigurations.get(d.id):null,Lo=p.getOrCreateProgram("symbol",{config:fo,defines:Dn});let io,Rs=[0,0],ks=null;const Yi=xt.textSizeData;xt.iconsInText&&(Rs=Ct.imageAtlasTexture?Ct.imageAtlasTexture.size:[0,0],ks=Ct.imageAtlasTexture?Ct.imageAtlasTexture:null,io=Ye||!be.isOrthographic||p.options.rotating||p.options.zooming||Yi.kind==="composite"||Yi.kind==="camera"?ve.LINEAR:ve.NEAREST);const cs=Ct.glyphAtlasTexture?Ct.glyphAtlasTexture.size:[0,0],vr=d.layout.get("text-size-scale-range"),Dr=a.aB(p.scaleFactor,vr[0],vr[1]),Er=a.bl(Yi,be.zoom,Dr),ji=Zi(Jt,Ct.tileID.canonical,Ye,Ne,be,xt.getProjection(),tn),To=ml(Jt,Ct.tileID.canonical,Ye,Ne,be,xt.getProjection(),tn),Ti=xt.text.uboBinder&&xt.text.uboBinder.cachedHeader&&256&xt.text.uboBinder.cachedHeader.dataDrivenMask?[0,0]:k,ys=p.translatePosMatrix(To,Ct,Ti,z,!0),vs=p.translatePosMatrix(Jt,Ct,Ti,z),xl=ri?Qh:ji,aa=Ne&&!Ye&&!kr;let Ia=Gt;!at&&!be.mercatorFromTransition||Ne||(Ia=Bg(be));const zc=ow(Yi.kind,Er,aa,Ye,p,vs,xl,ys,Ce,!0,cs,Rs,0,Mt,an,$e,Pn,dn?Ia:Gt,xt.getProjection(),$i,jn,null,null,Dr),wl=Ct.glyphAtlasTexture?Ct.glyphAtlasTexture:null,Kp=ve.LINEAR,Du=d.paint.get("text-halo-width").constantOr(1)!==0,zd=p.terrain&&Ye&&kr?a.ba(a.bd(),ji):Qh;if(kr&&xt.text){const uv=a.bx.getAtTileOffsetFunc(Mt,be.center.lat,be.worldSize,xt.getProjection()),dv=ja(Jt,Ct.tileID.canonical,Ye,Ne,be,xt.getProjection(),tn);Nh(xt,Jt,p,!0,dv,To,Ye,oe,uv,Mt,Dr)}return{program:Lo,buffers:xt.text,uniformValues:zc,atlasTexture:wl,atlasTextureIcon:ks,atlasInterpolation:Kp,atlasInterpolationIcon:io,isSDF:!0,hasHalo:Du,depthMode:Yo,tile:Ct,renderWithShadows:lr,labelPlaneMatrixInv:zd}},zr=xt.icon.segments.get().length,yr=xt.text.segments.get().length,Gn=zr&&!T.onlyText?Or():null,Xn=yr&&!T.onlyIcons?Fr():null,Nr=d.paint.get("icon-opacity").constantOr(1),Si=d.paint.get("text-opacity").constantOr(1);if(Ke&&xt.canOverlap){Tt=!0;const kr=Nr&&!T.onlyText?xt.icon.segments.get():[],Dn=Si&&!T.onlyIcons?xt.text.segments.get():[];for(const ri of kr)dt.push({segments:new a.dB([ri]),sortKey:ri.sortKey,state:Gn});for(const ri of Dn)dt.push({segments:new a.dB([ri]),sortKey:ri.sortKey,state:Xn})}else T.onlyText||dt.push({segments:Nr?xt.icon.segments:new a.dB([]),sortKey:0,state:Gn}),T.onlyIcons||dt.push({segments:Si?xt.text.segments:new a.dB([]),sortKey:0,state:Xn})}Tt&&dt.sort((Mt,Ct)=>Mt.sortKey-Ct.sortKey);for(const Mt of dt){const Ct=Mt.state;if(Ct)if(p.terrain?p.terrain.setupElevationDraw(Ct.tile,Ct.program,{useDepthForOcclusion:be.depthOcclusionForSymbolsAndCircles,labelPlaneMatrixInv:Ct.labelPlaneMatrixInv}):p.setupDepthForOcclusion(be.depthOcclusionForSymbolsAndCircles,Ct.program),Re.activeTexture.set(ve.TEXTURE0),Ct.atlasTexture&&Ct.atlasTexture.bind(Ct.atlasInterpolation,ve.CLAMP_TO_EDGE,!0),Ct.atlasTextureIcon&&(Re.activeTexture.set(ve.TEXTURE1),Ct.atlasTextureIcon&&Ct.atlasTextureIcon.bind(Ct.atlasInterpolationIcon,ve.CLAMP_TO_EDGE,!0)),Ct.renderWithShadows&&p.shadowRenderer.setupShadows(Ct.tile.tileID.toUnwrapped(),Ct.program,"vector-tile"),p.uploadCommonLightUniforms(p.context,Ct.program),Ct.hasHalo){const xt=Ct.uniformValues;xt.u_is_halo=1,M0(Ct.buffers,Mt.segments,d,p,Ct.program,Ct.depthMode,b,S,xt,2),xt.u_is_halo=0}else{if(Ct.isSDF){const xt=Ct.uniformValues;Ct.hasHalo&&(xt.u_is_halo=1,M0(Ct.buffers,Mt.segments,d,p,Ct.program,Ct.depthMode,b,S,xt,1)),xt.u_is_halo=0}M0(Ct.buffers,Mt.segments,d,p,Ct.program,Ct.depthMode,b,S,Ct.uniformValues,1)}}}function M0(p,o,d,_,b,S,T,I,k,F){const z=_.context,q=z.gl,j=[p.dynamicLayoutVertexBuffer,p.opacityVertexBuffer,p.iconTransitioningVertexBuffer,p.globeExtVertexBuffer,p.zOffsetVertexBuffer,p.orientationVertexBuffer];p.featureIdBuffer&&j.push(p.featureIdBuffer);const Z=p.uboBinder?null:p.programConfigurations.get(d.id);if(p.uboBinder){p.uboBinder.layer=d;const oe=_.transform.zoom,se=_.style.getBrightness?_.style.getBrightness():null,de=p.uboBinder.getConstantUniformValues(oe,se);k.u_spp_fill_np_color=de.fill_np_color,k.u_spp_halo_np_color=de.halo_np_color,k.u_spp_opacity=de.opacity,k.u_spp_halo_width=de.halo_width,k.u_spp_halo_blur=de.halo_blur,k.u_spp_emissive_strength=de.emissive_strength,k.u_spp_occlusion_opacity=de.occlusion_opacity,k.u_spp_z_offset=de.z_offset;const pe=d.paint.get(p.uboBinder.isText?"text-translate-anchor":"icon-translate-anchor"),ce=p.uboBinder.cachedHeader&&256&p.uboBinder.cachedHeader.dataDrivenMask&&pe==="map"?_.transform.angle:0;k.u_spp_translate_rotation=[Math.cos(ce),Math.sin(ce)]}const{batchIndices:te,batchSegments:ee}=p.getBatchGrouping(o);for(const oe of te){const se=ee.get(oe);p.uboBinder&&p.uboBinder.bind(z,b.program,oe),b.draw(_,q.TRIANGLES,S,T,I,pn.disabled,k,d.id,p.layoutVertexBuffer,p.indexBuffer,se,d.paint,_.transform.zoom,Z,j,F)}}function Tr(p,o,d,_,b,S){const T=d.paint.get("line-width"),I=d.paint.get("line-emissive-strength").isConstant(),k=d.paint.get("line-emissive-strength").constantOr(0),F=d.paint.get("line-occlusion-opacity"),z=d.layout.get("line-elevation-reference"),q=d.layout.get("line-width-unit")==="meters",j=z==="sea",Z=!(!p.terrain||!p.terrain.enabled),te=p.context,ee=te.gl;if(d.hasElevatedBuckets&&p.transform.projection.name==="globe")return;const oe=d.layout.get("line-cross-slope"),se=oe!==void 0,de=oe<1,pe=b||p.colorModeForDrapableLayerRenderPass(I?k:null),ce=p.terrain&&p.terrain.renderingToTexture||S,Ce=ce?1:a.o.devicePixelRatio,Se=d.paint.get("line-dasharray"),Re=Se.constantOr(1),ve=d.layout.get("line-cap"),be=Se.constantOr(null),Ae=ve.constantOr(null),Ne=d.paint.get("line-pattern"),De=Ne.constantOr(1),Ye=d.paint.get("line-pattern-cross-fade"),Ke=Ne.constantOr(null),Tt=d.paint.get("line-opacity").constantOr(1);let Ue=!De&&Tt!==1||p.depthOcclusion&&F>0&&F<1;const rt=d.paint.get("line-gradient"),$e=De?"linePattern":"line",ct=a.dX(d);let at;if(ce&&p.terrain&&p.terrain.clipOrMaskOverlapStencilType()&&(Ue=!1),F!==0&&p.depthOcclusion){const xt=d.paint._values["line-opacity"];xt&&xt.value&&xt.value.kind==="constant"?at=xt.value:a.w(`Occlusion opacity for layer ${d.id} is supported only when line-opacity isn't data-driven.`)}T.value.kind!=="constant"&&T.value.isLineProgressConstant===!1&&ct.push("VARIABLE_LINE_WIDTH"),p._debugParams.showElevationIdDebug&&ct.push("DEBUG_ELEVATION_ID"),ce&&(p.emissiveMode!=="dual-source-blending"||I?p.emissiveMode==="mrt-fallback"&&ct.push("USE_MRT1"):ct.push("DUAL_SOURCE_BLENDING"));const dt={},Gt=(xt,dn,an,Jt,tn,bn)=>{for(const kn of xt){const Pn=o.getTile(kn);if(De&&!Pn.patternsLoaded())continue;const jn=Pn.getBucket(d);if(!jn||jn.elevationType!=="none"&&!tn||jn.elevationType==="none"&&tn)continue;p.prepareDrawTile();const An=[...dn],or=p.shadowRenderer,Fn=jn.elevationType==="road"&&!!or&&or.enabled;let fr=[0,0,0];if(Fn){const lr=p.style.directionalLight,$i=p.style.ambientLight;lr&&$i&&(fr=xd(p.style,lr,$i)),An.push("RENDER_SHADOWS","NORMAL_OFFSET")}const Or=jn.programConfigurations.get(d.id);let Fr=!1;if(Ke&&Pn.imageAtlas){const lr=a.dY.from(Ke),$i=lr.getPrimary().scaleSelf(Ce).toString(),Yo=Pn.imageAtlas.patternPositions.get($i),fo=lr.getSecondary(),Lo=fo?Pn.imageAtlas.patternPositions.get(fo.scaleSelf(Ce).toString()):null;Fr=!!Yo&&!!Lo,Yo&&Or.setConstantPatternPositions(Yo,Lo)}Ye>0&&(Fr||Or.getPatternTransitionVertexBuffer("line-pattern"))&&An.push("LINE_PATTERN_TRANSITION"),jn.elevationGroundScaleVertexBuffer&&An.push("ELEVATION_GROUND_SCALE");const zr=p.isTileAffectedByFog(kn),yr=p.getOrCreateProgram($e,{config:Or,defines:An,overrideFog:zr});if(!De&&be&&Ae&&Pn.lineAtlas){const lr=Pn.lineAtlas.getDash(be,Ae);lr&&Or.setConstantPatternPositions(lr)}Fn&&or.setupShadows(Pn.tileID.toUnwrapped(),yr,"vector-tile");let[Gn,Xn]=d.paint.get("line-trim-offset");(Ae==="round"||Ae==="square")&&Gn!==Xn&&(Gn===0&&(Gn-=1),Xn===1&&(Xn+=1));const Nr=ce?kn.projMatrix:null,Si=q?1/jn.tileToMeter/a.az(Pn,1,p.transform.zoom):1,kr=q?1/jn.tileToMeter/a.az(Pn,1,Math.floor(p.transform.zoom)):1,Dn=Re?d.paint._values["line-floorwidth"]:null;let ri;if(Dn&&Dn.value.kind==="constant"){const lr=jn.zoom;lr in dt||(dt[lr]=Math.max(.01,d.widthExpression().evaluate({zoom:lr}))),ri=Dn.value.value;const $i=Math.floor(p.transform.zoom);
3080Dn.value.value=dt[lr]*Math.pow(2,$i-Pn.tileID.overscaledZ)}const $r=De?a.dZ(p,Pn,d,Nr,Ce,Si,kr,[Gn,Xn],fr,Ye):a.d_(p,Pn,d,Nr,jn.lineClipsArray.length,Ce,Si,kr,[Gn,Xn],fr);if(rt){const lr=jn.gradients[d.id];let $i=lr.texture;if(d.gradientVersion!==lr.version){let Yo=256;if(d.stepInterpolant){const fo=o.getSource().maxzoom,Lo=kn.canonical.z===fo?Math.ceil(1<<p.transform.maxZoom-kn.canonical.z):1;Yo=a.aB(a.d$(jn.maxLineLength/a.ak*1024*Lo),256,te.maxTextureSize)}lr.gradient=a.e0({expression:d.gradientExpression(),evaluationKey:"lineProgress",resolution:Yo,image:lr.gradient||void 0,clips:jn.lineClipsArray}),lr.texture?lr.texture.update(lr.gradient):lr.texture=new a.T(te,lr.gradient,ee.RGBA8),lr.version=d.gradientVersion,$i=lr.texture}te.activeTexture.set(ee.TEXTURE1),$i.bind(d.stepInterpolant?ee.NEAREST:ee.LINEAR,ee.CLAMP_TO_EDGE)}Re&&(te.activeTexture.set(ee.TEXTURE0),Pn.lineAtlasTexture&&Pn.lineAtlasTexture.bind(ee.LINEAR,ee.REPEAT),Or.updatePaintBuffers()),De&&(te.activeTexture.set(ee.TEXTURE0),Pn.imageAtlasTexture&&Pn.imageAtlasTexture.bind(ee.LINEAR,ee.CLAMP_TO_EDGE),Or.updatePaintBuffers()),tn&&p.terrain.setupElevationDraw(Pn,yr),p.uploadCommonUniforms(te,yr,kn.toUnwrapped());const Ii=lr=>{at!=null&&(at.value=Tt*F),yr.draw(p,ee.TRIANGLES,an,lr,pe,pn.disabled,$r,d.id,jn.layoutVertexBuffer,jn.indexBuffer,jn.segments,d.paint,p.transform.zoom,Or,[jn.layoutVertexBuffer2,jn.patternVertexBuffer,jn.zOffsetVertexBuffer,jn.elevationIdColVertexBuffer,jn.elevationGroundScaleVertexBuffer]),at!=null&&(at.value=Tt)};if(Ue&&!tn){const lr=p.stencilModeForClipping(kn).ref;lr===0&&ce&&te.clear({stencil:0});const $i={func:ee.EQUAL,mask:255};$r.u_alpha_discard_threshold=.8,Ii(new Tn($i,lr,255,ee.KEEP,ee.KEEP,ee.INVERT)),$r.u_alpha_discard_threshold=0,Ii(new Tn($i,lr,255,ee.KEEP,ee.KEEP,ee.KEEP))}else $r.u_alpha_discard_threshold=Ue&&tn&&bn?.8:0,Ii(tn?Jt:p.stencilModeForClipping(kn));ri!==void 0&&(Dn.value.value=ri)}};let Mt=p.depthModeForSublayer(0,rn.ReadOnly);const Ct=new rn(p.depthOcclusion?ee.GREATER:ee.LEQUAL,rn.ReadOnly,p.depthRangeFor3D);if(d.hasNonElevatedBuckets){const xt=!ce&&p.terrain;F!==0&&xt?a.w(`Occlusion opacity for layer ${d.id} is supported on terrain only if the layer has line-z-offset enabled.`):xt?a.w(`Cannot render non-elevated lines in immediate mode when terrain is enabled. Layer: ${d.id}.`):Gt(_,ct,Mt,Tn.disabled,!1,!0)}if(d.hasElevatedBuckets){z==="hd-road-markup"?Z||(Mt=Ct,ct.push("ELEVATED_ROADS")):(ct.push("ELEVATED"),Mt=Ct,se&&ct.push(de?"CROSS_SLOPE_HORIZONTAL":"CROSS_SLOPE_VERTICAL"),j&&ct.push("ELEVATION_REFERENCE_SEA"));const xt=Ue?p.stencilModeFor3D():Tn.disabled;p.forceTerrainMode=!0,Gt(_,ct,Mt,xt,!0,!0),Ue&&Gt(_,ct,Mt,xt,!0,!1),p.forceTerrainMode=!1}Ue&&(p.resetStencilClippingMasks(),ce&&te.clear({stencil:0})),F===0||p.depthOcclusion||ce||p.layersWithOcclusionOpacity.push(p.currentLayer)}class Bp{destroy(){this.fbo&&(this.fbo.destroy(),this.fbo=null),this.drapeFbo&&(this.drapeFbo.destroy(),this.drapeFbo=null)}}class L0{constructor(o){this.pbo=o.createBuffer(),this.sync=null,this.fboA=null,this.fboB=null,this.maxDensity=0}destroy(o){this.sync&&(o.deleteSync(this.sync),this.sync=null),o.deleteBuffer(this.pbo),this.fboA&&(this.fboA.destroy(),this.fboA=null),this.fboB&&(this.fboB.destroy(),this.fboB=null)}}const zp={additive:{clearColor:new a.C(0,0,0,0),colorMode:In.additiveAlphaWeighted,compositeUniformValue:1},multiply:{clearColor:new a.C(1,1,1,1),colorMode:In.multiply,compositeUniformValue:0}};function Np(p){return!(!p.extRenderToTextureHalfFloat&&!p.extColorBufferFloat)}function zg(p,o){return p==="additive"&&Np(o)?In.additiveAlphaWeightedUnboundedAlpha:zp[p].colorMode}function Ng(p,o,d){const _=p.context,b=_.gl;let S=d.width,T=d.height,I=d.colorAttachment0.get();o.lineBlendDensityReadback||(o.lineBlendDensityReadback=new L0(b));const k=o.lineBlendDensityReadback;let F=0,z=!0;for(;S>1||T>1;){const Z=Math.max(1,Math.floor(S/2)),te=Math.max(1,Math.floor(T/2)),ee=F===0?"fboA":"fboB";k[ee]=Cu.createWithTexture(_,k[ee],Z,te,!1);const oe=k[ee];_.bindFramebuffer.set(oe.framebuffer),_.viewport.set([0,0,Z,te]),_.activeTexture.set(b.TEXTURE0),b.bindTexture(b.TEXTURE_2D,I),p.getOrCreateProgram("lineBlendReduce").draw(p,b.TRIANGLES,rn.disabled,Tn.disabled,In.unblended,pn.disabled,ew(0,[1/S,1/T],z),o.id,p.viewportBuffer,p.quadTriangleIndexBuffer,p.viewportSegments,o.paint,p.transform.zoom),S=Z,T=te,I=oe.colorAttachment0.get(),F=1-F,z=!1}const q=Np(_),j=q?16:4;k.sync&&(b.deleteSync(k.sync),k.sync=null),b.bindBuffer(b.PIXEL_PACK_BUFFER,k.pbo),b.bufferData(b.PIXEL_PACK_BUFFER,j,b.STREAM_READ),b.readPixels(0,0,1,1,b.RGBA,q?b.FLOAT:b.UNSIGNED_BYTE,0),b.bindBuffer(b.PIXEL_PACK_BUFFER,null),k.sync=b.fenceSync(b.SYNC_GPU_COMMANDS_COMPLETE,0),_.viewport.set([0,0,p.width,p.height])}function Au(p,o,d){if(!Np(p.context))return;const _=o.lineBlendDensityReadback;_&&_.sync?((function(b,S,T){if(b.sync&&S.getSyncParameter(b.sync,S.SYNC_STATUS)===S.SIGNALED){if(S.deleteSync(b.sync),b.sync=null,S.bindBuffer(S.PIXEL_PACK_BUFFER,b.pbo),Np(T)){const I=new Float32Array(4);S.getBufferSubData(S.PIXEL_PACK_BUFFER,0,I);const k=I[1];b.maxDensity=Math.max(2*(k>
30800?I[0]/k:0),1)}else b.maxDensity=1;S.bindBuffer(S.PIXEL_PACK_BUFFER,null)}})(_,p.context.gl,p.context),_.sync||(Ng(p,o,d),p.style.map.triggerRepaint())):(Ng(p,o,d),p.style.map.triggerRepaint())}function Mc(p,o,d,_,b,S){const T=p.context,I=T.gl,k=d==="additive"?1:o.paint.get("line-opacity").constantOr(1),F=d==="additive"?(function(q,j){const Z=j.paint.get("line-blend-additive-clamp");if(Z>0)return Z;const te=j.lineBlendDensityReadback;return te&&te.maxDensity!==0?te.maxDensity:null})(0,o):1;if(F===null)return;T.bindFramebuffer.set(b),S&&T.viewport.set([0,0,S[0],S[1]]),T.activeTexture.set(I.TEXTURE0),I.bindTexture(I.TEXTURE_2D,_.colorAttachment0.get());const z=zg(d,p.context);p.getOrCreateProgram("lineBlendComposite").draw(p,I.TRIANGLES,rn.disabled,Tn.disabled,z,pn.disabled,((q,j,Z,te)=>({u_image:0,u_opacity:j,u_blend_mode:Z,u_max_density:te}))(0,k,zp[d].compositeUniformValue,F),o.id,p.viewportBuffer,p.quadTriangleIndexBuffer,p.viewportSegments,o.paint,p.transform.zoom)}function Pt(p,o){const d=1<<p.canonical.z,_=(o.x*d-p.canonical.x-p.wrap*d)*a.ak,b=(o.y*d-p.canonical.y)*a.ak,S=a.e1(o.z,o.y);return a.cU(_,b,S)}function Dt(p,o,d,_,b){if(!d.layout||d.layout.get("fill-elevation-reference")==="none"||d.paint.get("fill-opacity").constantOr(1)===0)return;const S=p.context.gl,T=new rn(p.context.gl.LEQUAL,rn.ReadWrite,p.depthRangeFor3D),I=new rn(p.context.gl.GREATER,rn.ReadWrite,p.depthRangeFor3D),k=(function(Z){let te=.01;return Z.isOrthographic&&(te=a.aj(1e-4,te,a.cP(Z.pitch>=wa?1:Z.pitch/wa))),2*te})(p.transform),F=p.transform.getFreeCameraOptions().position,z="elevatedStructuresDepthReconstruct",q=p.getOrCreateProgram(z,{defines:["DEPTH_RECONSTRUCTION"]}),j=p.getOrCreateProgram(z);for(const Z of _){const te=o.getTile(Z),ee=te.getBucket(d);if(!ee)continue;const oe=ee.elevatedStructures;if(!oe||!oe.depthSegments)continue;const se=ee.elevationBufferData.heightRange,de=Pt(Z.toUnwrapped(),F),pe=p.translatePosMatrix(Z.projMatrix,te,d.paint.get("fill-translate"),d.paint.get("fill-translate-anchor"));let ce,Ce,Se,Re;if(b==="initialize"){if(!se||se.min>=1||oe.depthSegments.segments[0].primitiveLength===0)continue;ce=Jh(pe,de,k,1,0),Ce=T,Se=oe.depthSegments,Re=q}else if(b==="reset"){if(!se||se.min>=0||oe.maskSegments.segments[0].primitiveLength===0)continue;ce=Jh(pe,de,0,0,1),Ce=I,Se=oe.maskSegments,Re=q}else if(b==="geometry"){if(oe.depthSegments.segments[0].primitiveLength===0)continue;ce=Jh(pe,de,k,1,0),Ce=T,Se=oe.depthSegments,Re=j}Re.draw(p,S.TRIANGLES,Ce,Tn.disabled,In.disabled,pn.disabled,ce,d.id,oe.vertexBuffer,oe.indexBuffer,Se,d.paint,p.transform.zoom)}}function Iu(p,o,d,_){const{painter:b,sourceCache:S,layer:T,coords:I,colorMode:k,elevationType:F,terrainEnabled:z,pass:q}=p,j=b.context.gl,Z=T.paint.get("fill-pattern"),te=T.paint.get("fill-pattern-cross-fade"),ee=Z.constantOr(null);let oe=F;F!=="road"||o&&!z||(oe="none");const se=oe==="road",de=p.painter.shadowRenderer,pe=se&&!!de&&de.enabled,ce=new rn(b.context.gl.LEQUAL,rn.ReadOnly,b.depthRangeFor3D);let Ce=[0,0,0];if(pe){const be=b.style.directionalLight,Ae=b.style.ambientLight;be&&Ae&&(Ce=xd(b.style,be,Ae))}const Se=Z&&Z.constantOr(1),Re=b.terrain&&b.terrain.renderingToTexture,ve=(be,Ae)=>{let Ne,De,Ye,Ke,Tt;Ae?(Ne=Se&&!T.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",Ye=j.LINES):(Ne=Se?"fillPattern":"fill",Ye=j.TRIANGLES);for(const Ue of I){const rt=S.getTile(Ue);if(Se&&!rt.patternsLoaded())continue;const $e=rt.getBucket(T);if(!$e)continue;const ct=o?$e.elevationBufferData:$e.bufferData;if(ct.isEmpty())continue;b.prepareDrawTile();const at=ct.programConfigurations.get(T.id),dt=b.isTileAffectedByFog(Ue),Gt=[],Mt=[];se&&(Gt.push("ELEVATED_ROADS"),Mt.push(ct.elevatedLayoutVertexBuffer)),pe&&Gt.push("RENDER_SHADOWS","NORMAL_OFFSET"),Re&&d&&Gt.push("USE_MRT1"),Se&&(b.context.activeTexture.set(j.TEXTURE0),rt.imageAtlasTexture&&rt.imageAtlasTexture.bind(j.LINEAR,j.CLAMP_TO_EDGE),at.updatePaintBuffers());let Ct=!1;if(ee&&rt.imageAtlas){const tn=rt.imageAtlas,bn=a.dY.from(ee),kn=bn.getPrimary().scaleSelf(a.o.devicePixelRatio).toString(),Pn=bn.getSecondary(),jn=tn.patternPositions.get(kn),An=Pn?tn.patternPositions.get(Pn.scaleSelf(a.o.devicePixelRatio).toString()):null;Ct=!!jn&&!!An,jn&&at.setConstantPatternPositions(jn,An)}te>0&&(Ct||at.getPatternTransitionVertexBuffer("fill-pattern"))&&Gt.push("FILL_PATTERN_TRANSITION");const xt=b.getOrCreateProgram(Ne,{config:at,overrideFog:dt,defines:Gt}),dn=b.translatePosMatrix(Ue.projMatrix,rt,T.paint.get("fill-translate"),T.paint.get("fill-translate-anchor"));pe&&de.setupShadows(rt.tileID.toUnwrapped(),xt,"vector-tile");const an=T.paint.get("fill-emissive-strength");if(Ae){Ke=ct.lineIndexBuffer,Tt=ct.lineSegments;const tn=b.terrain&&b.terrain.renderingToTexture?b.terrain.drapeBufferSize:[j.drawingBufferWidth,j.drawingBufferHeight];De=Ne==="fillOutlinePattern"&&Se?J1(dn,an,b,rt,tn,Ce,te):K1(dn,an,tn,Ce)}else Ke=ct.indexBuffer,Tt=ct.triangleSegments,De=Se?S0(dn,an,b,rt,Ce,te):w0(dn,an,Ce);b.uploadCommonUniforms(b.context,xt,Ue.toUnwrapped());let Jt=be;(F==="road"&&!z||F==="offset")&&(Jt=ce),xt.draw(b,Ye,Jt,_||b.stencilModeForClipping(Ue),k,pn.disabled,De,T.id,ct.layoutVertexBuffer,Ke,Tt,T.paint,b.transform.zoom,at,Mt)}};b.renderPass===q&&ve(b.depthModeForSublayer(1,b.renderPass==="opaque"?rn.ReadWrite:rn.ReadOnly),!1),oe==="none"&&b.renderPass==="translucent"&&T.paint.get("fill-antialias")&&ve(b.depthModeForSublayer(T.getPaintProperty("fill-outline-color")?2:0,rn.ReadOnly),!0)}const fi=new Float32Array(16);function ze(p,o,d,_,b,S,T,I){d.resetLayerRenderingStats(p);const k=p.context,F=k.gl,z=p.transform,q=d.paint.get("fill-extrusion-pattern"),j=d.paint.get("fill-extrusion-pattern-cross-fade"),Z=q.constantOr(null),te=q.constantOr(1),ee=d.paint.get("fill-extrusion-opacity"),oe=p.style.enable3dLights(),se=d.paint.get(oe&&!te?"fill-extrusion-ambient-occlusion-wall-radius":"fill-extrusion-ambient-occlusion-radius"),de=[d.paint.get("fill-extrusion-ambient-occlusion-intensity"),se],pe=d.layout.get("fill-extrusion-edge-radius"),ce=pe>0&&!d.paint.get("fill-extrusion-rounded-roof"),Ce=ce?0:pe,Se=z.projection.name==="globe"?a.e4():0,Re=z.projection.name==="globe",ve=Re?a.ai(z.zoom):0,be=[a.aG(z.center.lng),a.aJ(z.center.lat)],Ae=d.paint.get("fill-extrusion-flood-light-color-use-theme").
3080constantOr("default")==="none",Ne=d.paint.get("fill-extrusion-flood-light-color").toNonPremultipliedRenderColor(Ae?null:d.lut).toArray01().slice(0,3),De=d.paint.get("fill-extrusion-flood-light-intensity"),Ye=d.paint.get("fill-extrusion-vertical-scale"),Ke=d.paint.get("fill-extrusion-line-width").constantOr(1)!==0,Tt=d.paint.get("fill-extrusion-height-alignment"),Ue=d.paint.get("fill-extrusion-base-alignment"),rt=Sa(p,d.paint.get("fill-extrusion-cutoff-fade-range")),$e=d.paint.get("fill-extrusion-front-cutoff"),ct=ef(z.pitch,$e,!!p.terrain),at=ct[2]<1;at&&(p.maxFrontCutoffRawStart=Math.max(p.maxFrontCutoffRawStart,$e[0]));const dt=[];let Gt;Re&&dt.push("PROJECTION_GLOBE_VIEW"),de[0]>0&&dt.push("FAUX_AO"),ce&&dt.push("ZERO_ROOF_RADIUS"),I&&dt.push("HAS_CENTROID"),De>0&&dt.push("FLOOD_LIGHT"),rt.shouldRenderCutoff&&dt.push("RENDER_CUTOFF"),at&&dt.push("RENDER_FRONT_CUTOFF"),Ke&&dt.push("RENDER_WALL_MODE");const Mt=p.renderPass==="shadow",Ct=p.shadowRenderer,xt=Mt&&!!Ct,dn=Mt?pn.disabled:pn.backCCW;p.shadowRenderer&&(p.shadowRenderer.useNormalOffset=!0);let an=[0,0,0];if(Ct){const bn=p.style.directionalLight,kn=p.style.ambientLight;bn&&kn&&(an=xd(p.style,bn,kn)),Mt||(dt.push("RENDER_SHADOWS"),Ct.useNormalOffset&&dt.push("NORMAL_OFFSET")),Gt=dt.concat(["SHADOWS_SINGLE_CASCADE"])}const Jt=xt?"fillExtrusionDepth":te?"fillExtrusionPattern":"fillExtrusion",tn=d.getLayerRenderingStats();for(const bn of _){const kn=o.getTile(bn),Pn=kn.getBucket(d);if(!Pn||Pn.projection.name!==z.projection.name)continue;let jn=!1;Ct&&(jn=Ct.getMaxCascadeForTile(bn.toUnwrapped())===0);const An=p.isTileAffectedByFog(bn),or=Pn.programConfigurations.get(d.id);let Fn=!1;if(Z&&kn.imageAtlas){const Xn=kn.imageAtlas,Nr=a.dY.from(Z),Si=Nr.getPrimary().scaleSelf(a.o.devicePixelRatio).toString(),kr=Nr.getSecondary(),Dn=Xn.patternPositions.get(Si),ri=kr?Xn.patternPositions.get(kr.scaleSelf(a.o.devicePixelRatio).toString()):null;Fn=!!Dn&&!!ri,Dn&&or.setConstantPatternPositions(Dn,ri)}j>0&&(Fn||or.getPatternTransitionVertexBuffer("fill-extrusion-pattern"))&&dt.push("FILL_EXTRUSION_PATTERN_TRANSITION");const fr=p.getOrCreateProgram(Jt,{config:or,defines:jn?Gt:dt,overrideFog:An});if(p.terrain&&p.terrain.setupElevationDraw(kn,fr,{useMeterToDem:!0}),!Pn.centroidVertexBuffer){const Xn=fr.getAttributeLocation(F,"a_centroid_pos");Xn!==-1&&F.vertexAttribI4ui(Xn,0,0,0,0)}!Mt&&Ct&&Ct.setupShadows(kn.tileID.toUnwrapped(),fr,"vector-tile"),te&&(p.context.activeTexture.set(F.TEXTURE0),kn.imageAtlasTexture&&kn.imageAtlasTexture.bind(F.LINEAR,F.CLAMP_TO_EDGE),or.updatePaintBuffers());const Or=d.paint.get("fill-extrusion-vertical-gradient"),Fr=1/Pn.tileToMeter;let zr;if(Mt&&Ct){if(hw(kn.tileID,Pn.maxHeight,p))continue;const Xn=Ct.calculateShadowPassMatrixFromTile(kn.tileID.toUnwrapped());zr=kg(Xn,Ce,Fr,Ye,Tt,Ue)}else{const Xn=p.translatePosMatrix(bn.expandedProjMatrix,kn,d.paint.get("fill-extrusion-translate"),d.paint.get("fill-extrusion-translate-anchor")),Nr=z.projection.createInversionMatrix(z,bn.canonical);zr=te?Y1(Xn,p,Or,ee,de,Ce,Fr,bn,kn,Se,Tt,Ue,ve,be,Nr,Ne,Ye,j):Rg(Xn,p,Or,ee,de,Ce,Fr,bn,Se,Tt,Ue,ve,be,Nr,Ne,Ye,De,an,ct)}p.uploadCommonUniforms(k,fr,bn.toUnwrapped(),null,rt);let yr=Pn.segments;if(z.projection.name==="mercator"&&!Mt&&(yr=Pn.getVisibleSegments(kn.tileID,p.terrain,p.transform.getFrustum(0)),!yr.get().length))continue;if(tn)if(Mt)for(const Xn of yr.get())tn.numRenderedVerticesInShadowPass+=Xn.primitiveLength;else for(const Xn of yr.get())tn.numRenderedVerticesInTransparentPass+=Xn.primitiveLength;const Gn=[];(p.terrain||I)&&Gn.push(Pn.centroidVertexBuffer),Re&&Gn.push(Pn.layoutVertexExtBuffer),Ke&&Gn.push(Pn.wallVertexBuffer),fr.draw(p,k.gl.TRIANGLES,b,S,T,dn,zr,d.id,Pn.layoutVertexBuffer,Pn.indexBuffer,yr,d.paint,p.transform.zoom,or,Gn)}p.shadowRenderer&&(p.shadowRenderer.useNormalOffset=!1)}class O0{constructor(){this.translate=[0,0],this.translateAnchor="map",this.edgeRadius=0,this.cutoffFadeRange=0}}function ef(p,o,d){if(!(o[2]<1)||d)return[0,0,1];const _=180*p/Math.PI;if(_<15)return[-.5,o[1],o[2]];const b=Math.min(1,Math.max(0,(_-15)/5)),S=b*b*(3-2*b);return[-.5*(1-S)+o[0]*S,o[1],o[2]]}function vl(p,o,d,_,b,S,T,I,k,F,z,q,j,Z,te,ee,oe,se,de,pe,ce){const Ce=o.context,Se=Ce.gl,Re=o.transform,ve=o.transform.zoom,be=[],Ae=p.translate,Ne=p.translateAnchor,De=p.edgeRadius,Ye=Sa(o,p.cutoffFadeRange);z==="clear"?(be.push("CLEAR_SUBPASS"),pe&&(be.push("CLEAR_FROM_TEXTURE"),Ce.activeTexture.set(Se.TEXTURE0),pe.bind(Se.LINEAR,Se.CLAMP_TO_EDGE))):z==="sdf"?be.push("SDF_SUBPASS"):z==="emissive"&&(be.push("USE_MRT1"),Ce.activeTexture.set(Se.TEXTURE0),pe.bind(Se.LINEAR,Se.CLAMP_TO_EDGE)),se&&be.push("HAS_CENTROID"),Ye.shouldRenderCutoff&&be.push("RENDER_CUTOFF");const Ke=(Tt,Ue,rt,$e,ct)=>{let at=be;Ue.groundRadiusBuffer!=null&&(at=be.concat("HAS_ATTRIBUTE_a_flood_light_ground_radiu
3080s"));const dt=Ue.programConfigurations.get(_.id),Gt=o.isTileAffectedByFog(Tt),Mt=o.getOrCreateProgram("fillExtrusionGroundEffect",{config:dt,defines:at,overrideFog:Gt}),Ct=((dn,an,Jt,tn,bn,kn,Pn,jn,An,or,Fn)=>({u_matrix:an,u_opacity:Jt,u_ao_pass:tn?1:0,u_meter_to_tile:bn,u_ao:kn,u_flood_light_intensity:Pn,u_flood_light_color:jn,u_attenuation:An,u_edge_radius:or,u_fb:0,u_fb_size:Fn,u_dynamic_offset:1}))(0,$e,q,F,ct,[j,Z*ct],te,ee,oe,ve>=17?0:De*ct,pe?pe.size[0]:0),xt=[];se&&xt.push(Ue.hiddenByLandmarkVertexBuffer),Ue.groundRadiusBuffer!=null&&xt.push(Ue.groundRadiusBuffer),o.uploadCommonUniforms(Ce,Mt,Tt.toUnwrapped(),null,Ye),Mt.draw(o,Ce.gl.TRIANGLES,S,T,I,k,Ct,_.id,Ue.vertexBuffer,Ue.indexBuffer,rt,_.paint,ve,dt,xt)};for(const Tt of b){const Ue=d.getTile(Tt),rt=Ue.getBucket(_);if(!rt||rt.projection.name!==Re.projection.name||!rt.groundEffect||rt.groundEffect&&!rt.groundEffect.hasData())continue;const $e=rt.groundEffect,ct=1/rt.tileToMeter;{const at=o.translatePosMatrix(Tt.projMatrix,Ue,Ae,Ne),dt=$e.getDefaultSegment();Ke(Tt,$e,dt,at,ct)}if(de)for(let at=0;at<4;at++){const dt=a.e2[at](Tt),Gt=d.getTile(dt);if(!Gt)continue;const Mt=Gt.getBucket(_);if(!Mt||Mt.projection.name!==Re.projection.name||!Mt.groundEffect||Mt.groundEffect&&!Mt.groundEffect.hasData())continue;const Ct=Mt.groundEffect;let xt,dn;at===0?(xt=[-a.ak,0,0],dn=1):at===1?(xt=[a.ak,0,0],dn=0):at===2?(xt=[0,-a.ak,0],dn=3):(xt=[0,a.ak,0],dn=2);const an=Ct.regionSegments[dn];an&&(a.bB(fi,Tt.projMatrix,xt),Ke(Tt,Ct,an,o.translatePosMatrix(fi,Ue,Ae,Ne),ct))}}}function Vg(p,o,d,_,b,S,T){_.centroidVertexArray.length===0&&_.createCentroidsBuffer();const I=S?S.findDEMTileFor(d):null;if(!(I&&I.dem||T))return;S&&I&&I.dem&&_.selfDEMTileTimestamp!==I.dem._timestamp&&(_.borderDoneWithNeighborZ=[-1,-1,-1,-1],_.selfDEMTileTimestamp=I.dem._timestamp);const k=(se,de)=>{(se.flags|de.flags)&a.e5?(se.flags|=a.e5,de.flags|=a.e5):(se.flags&=~a.e5,de.flags&=~a.e5)},F=se=>new a.P(Math.ceil((se+a.e6)*a.e7),0),z=(se,de,pe)=>{const ce=Math.ceil((se+a.e6)*a.e7),Ce=Math.floor(Math.max(0,Math.min(a.ak-1,pe))/4);return new a.P(ce,Ce<<5|(3&de)<<3|7)},q=se=>{const de=o.getSource().minzoom,pe=Ce=>{const Se=o.getTileByID(Ce);if(Se&&Se.hasData())return Se.getBucket(b)},ce=[0,-1,1];for(const Ce of ce){if(se.overscaledZ+Ce<de)continue;const Se=pe(se.calculateScaledKey(se.overscaledZ+Ce));if(Se)return Se}},j=[0,0,0],Z=(se,de)=>(j[0]=Math.min(se.min.y,de.min.y),j[1]=Math.max(se.max.y,de.max.y),j[2]=a.ak-de.min.x>se.max.x?de.min.x-a.ak:se.max.x,j),te=(se,de)=>(j[0]=Math.min(se.min.x,de.min.x),j[1]=Math.max(se.max.x,de.max.x),j[2]=a.ak-de.min.y>se.max.y?de.min.y-a.ak:se.max.y,j),ee=[(se,de)=>Z(se,de),(se,de)=>Z(de,se),(se,de)=>te(se,de),(se,de)=>te(de,se)],oe=(se,de,pe,ce,Ce,Se,Re)=>{if(!S)return 0;const ve=[[Se?pe:se,Se?se:pe,0],[Se?pe:de,Se?de:pe,0]],be=Re<0?a.ak+Re:Re,Ae=[Se?be:(se+de)/2,Se?(se+de)/2:be,0];return pe===0&&Re<0||pe!==0&&Re>0?S.getForTilePoints(Ce,[Ae],!0,ce):ve.push(Ae),S.getForTilePoints(d,ve,!0,I),Math.max(ve[0][2],ve[1][2],Ae[2])/S.exaggeration()};for(let se=0;se<4;se++){const de=_.borderFeatureIndices[se];if(de.length===0)continue;const pe=a.e2[se](d),ce=q(pe);if(!(ce&&ce instanceof a.e3))continue;const Ce=S?S.findDEMTileFor(pe):null;if(!(Ce&&Ce.dem||T)||(S&&Ce&&Ce.dem&&_.borderDEMTileTimestamp[se]!==Ce.dem._timestamp&&(_.borderDoneWithNeighborZ[se]=-1,_.borderDEMTileTimestamp[se]=Ce.dem._timestamp),_.borderDoneWithNeighborZ[se]===ce.canonical.z))continue;ce.centroidVertexArray.length===0&&ce.createCentroidsBuffer();const Se=(se<2?1:5)-se,Re=ce.borderDoneWithNeighborZ[Se]!==_.canonical.z,ve=ce.borderFeatureIndices[Se];let be=0;if(_.canonical.z!==ce.canonical.z){for(const Ye of de)_.showCentroid(_.featuresOnBorder[Ye]);if(Re)for(const Ye of ve)ce.showCentroid(ce.featuresOnBorder[Ye]);_.borderDoneWithNeighborZ[se]=ce.canonical.z,ce.borderDoneWithNeighborZ[Se]=_.canonical.z;continue}const Ae=new Map,Ne=new Set,De=new Set;for(let Ye=0;Ye<ve.length;Ye++){const Ke=ce.featuresOnBorder[ve[Ye]];Ke.buildingId!==void 0&&Ae.set(Ke.buildingId,Ye)}for(const Ye of de){const Ke=_.featuresOnBorder[Ye],Tt=_.centroidData.get(Ke.centroidDataIndex);if(Ke.buildingId===void 0)continue;const Ue=Ae.get(Ke.buildingId);if(Ue===void 0)continue;const rt=ce.featuresOnBorder[ve[Ue]],$e=ce.centroidData.get(rt.centroidDataIndex);Ne.add(Ye),De.add(Ue),T&&k(Tt,$e);const ct=Tt.groupCentroidPos.x!==0||Tt.groupCentroidPos.y!==0?Tt.groupCentroidPos:Ke.centroid(),at=$e.groupCentroidPos.x!==0||$e.groupCentroidPos.y!==0?$e.groupCentroidPos:rt.centroid(),dt=se<2?Math.round((ct.y+at.y)/2):Math.round((ct.x+at.x)/2),Gt
3080=Ke.intersectsCount()>1||rt.intersectsCount()>1;{let Mt=0;if(Ce&&Ce.dem&&!Gt){const Ct=ee[se](Tt,$e),xt=se%2?a.ak-1:0;Mt=oe(Ct[0],Math.min(a.ak-1,Ct[1]),xt,Ce,pe,se<2,Ct[2])}Tt.centroidXY=z(Mt,se,dt),$e.centroidXY=z(Mt,Se,dt)}if(_.writeCentroidToBuffer(Tt),ce.writeCentroidToBuffer($e),Ke.buildingId!==void 0){for(const Mt of _.centroidData)Mt.buildingId===Ke.buildingId&&Mt!==Tt&&(Mt.centroidXY=Tt.centroidXY,_.writeCentroidToBuffer(Mt));for(const Mt of ce.centroidData)Mt.buildingId===Ke.buildingId&&Mt!==$e&&(Mt.centroidXY=$e.centroidXY,ce.writeCentroidToBuffer(Mt))}}for(const Ye of de){if(Ne.has(Ye))continue;const Ke=_.featuresOnBorder[Ye],Tt=_.centroidData.get(Ke.centroidDataIndex),Ue=Ke.borders[se];let rt;for(;be<ve.length;){if(De.has(be)){be++;continue}rt=ce.featuresOnBorder[ve[be]];const $e=rt.borders[Se];if($e[1]>Ue[0]+3||$e[0]>Ue[0]-3)break;ce.showCentroid(rt),be++}if(rt&&be<ve.length){let $e=be,ct=0;for(;;)if(De.has(be)){if(++be===ve.length)break;rt=ce.featuresOnBorder[ve[be]]}else{if(rt.borders[Se][0]>Ue[1]-3||(ct++,++be===ve.length))break;rt=ce.featuresOnBorder[ve[be]]}for(;$e<ve.length&&De.has($e);)$e++;if($e>=ve.length){_.showCentroid(Ke);continue}rt=ce.featuresOnBorder[ve[$e]];let at=!1;if(ct>=1){const Mt=rt.borders[Se];Math.abs(Ue[0]-Mt[0])<3&&Math.abs(Ue[1]-Mt[1])<3&&(ct=1,at=!0,be=$e+1)}else if(ct===0){_.showCentroid(Ke);continue}const dt=ce.centroidData.get(rt.centroidDataIndex);T&&at&&k(Tt,dt);const Gt=Ke.intersectsCount()>1||rt.intersectsCount()>1;if(ct>1)be=$e,Tt.centroidXY=dt.centroidXY=new a.P(0,0);else if(Ce&&Ce.dem&&!Gt){const Mt=ee[se](Tt,dt),Ct=se%2?a.ak-1:0,xt=oe(Mt[0],Math.min(a.ak-1,Mt[1]),Ct,Ce,pe,se<2,Mt[2]);Tt.centroidXY=dt.centroidXY=F(xt)}else Gt?Tt.centroidXY=dt.centroidXY=new a.P(0,0):(Tt.centroidXY=_.encodeBorderCentroid(Ke),dt.centroidXY=ce.encodeBorderCentroid(rt));_.writeCentroidToBuffer(Tt),ce.writeCentroidToBuffer(dt)}else _.showCentroid(Ke)}_.borderDoneWithNeighborZ[se]=ce.canonical.z,ce.borderDoneWithNeighborZ[Se]=_.canonical.z}(_.needsCentroidUpdate||!_.centroidVertexBuffer&&_.centroidVertexArray.length!==0)&&_.uploadCentroid(p)}const uw=[1,0,0],dw=[0,1,0],tf=[0,0,1];function hw(p,o,d){const _=d.transform,b=d.shadowRenderer;if(!b)return!0;const S=d.frameCounter,T=d.currentShadowCascade;let I=d._shadowCullCache;if(!I||I.frame!==S||I.cascade!==T){const se=_.tileSize*b._cascades[T].scale,de=_.scaleZoom(se),pe=b.shadowDirection,ce=[pe[0],pe[1],-pe[2]],Ce=[uw,dw,tf,ce,[ce[0],0,ce[2]],[0,ce[1],ce[2]]];I={frame:S,cascade:T,cameraFrustum:a.cn.fromInvProjectionMatrix(_.invProjMatrix,_.worldSize,de,_.projection.name!=="globe"),edges:Ce,shadowDir:ce,ws:se,zoom:de},d._shadowCullCache=I}const{cameraFrustum:k,edges:F,shadowDir:z,ws:q,zoom:j}=I;let Z=o;if(_.elevation){const se=_.elevation.getMinMaxForTile(p);se&&(Z+=se.max)}Z/=a.e8(_.center.lat,j);const te=b.computeSimplifiedTileShadowVolume(p.toUnwrapped(),Z,q,z);if(!te)return!1;const{vertices:ee,planes:oe}=te;return k.intersectsPrecise(ee,oe,F)===0||b.getCurrentCascadeFrustum().intersectsPrecise(ee,oe,F)===0}const I2=(p,o,d,_,b,S,T,I,k,F=[0,0,1])=>({u_matrix:p,u_normal_matrix:o,u_opacity:d,u_faux_facade_ao_intensity:_,u_camera_pos:b,u_tile_to_meter:S,u_facade_emissive_chance:T,u_flood_light_color:I,u_flood_light_intensity:k,u_front_cutoff_params:F}),fw=p=>({u_matrix:p}),Ug=p=>({u_matrix:p}),$g=new Float32Array(16),Ad=new Float32Array(16);function Vp(p){const{painter:o,source:d,layer:_,coords:b}=p;let S=p.defines;const T=o.context,I=o.renderPass==="shadow",k=o.renderPass==="light-beam",F=o.shadowRenderer,z=a.e8(o.transform.center.lat,o.transform.zoom),q=Sa(o,_.paint.get("building-cutoff-fade-range"));q.shouldRenderCutoff&&(S=S.concat("RENDER_CUTOFF"));const j=_.paint.get("building-front-cutoff"),Z=j[2]<1&&!o.terrain,te=ef(o.transform.pitch,j,!!o.terrain);Z&&(S=S.concat("RENDER_FRONT_CUTOFF"),o.maxFrontCutoffRawStart=Math.max(o.maxFrontCutoffRawStart,j[0])),p.floodLightIntensity>0&&(S=S.concat("FLOOD_LIGHT"));for(const ee of b){const oe=d.getTile(ee),se=oe.getBucket(_);if(!se)continue;F&&F.getMaxCascadeForTile(ee.toUnwrapped())===0&&(S=S.concat("SHADOWS_SINGLE_CASCADE"));const de=se.programConfigurations.get(_.id);let pe,ce;const Ce=o.translatePosMatrix(ee.expandedProjMatrix,oe,[0,0],"map");a.cE($g,Ce,[1,1,p.verticalScale]);const Se=$g;let Re;
3080if(I&&F){if(hw(oe.tileID,se.maxHeight*z,o))continue;const be=F.calculateShadowPassMatrixFromTile(oe.tileID.toUnwrapped());a.cE(be,be,[1,1,p.verticalScale]),Re=Ug(be),pe=ce=o.getOrCreateProgram("buildingDepth",{config:de,defines:S,overrideFog:!1})}else if(k)pe=ce=o.getOrCreateProgram("buildingBloom",{config:de,defines:S,overrideFog:!1}),Re=fw(Se);else{const be=o.transform.calculatePosMatrix(ee.toUnwrapped(),o.transform.worldSize);a.cE(be,be,[1,1,p.verticalScale]),a.cE(Ad,be,[1,-1,1/z]),a.ba(Ad,Ad),a.e9(Ad,Ad);const Ae=Ad,Ne=o.transform.getFreeCameraOptions().position,De=1<<ee.canonical.z;if(Re=I2(Se,Ae,p.opacity,p.facadeAOIntensity,[((Ne.x-ee.wrap)*De-ee.canonical.x)*a.ak,(Ne.y*De-ee.canonical.y)*a.ak,Ne.z*De*a.ak],se.tileToMeter,p.facadeEmissiveChance,p.floodLightColor,p.floodLightIntensity,te),ce=o.getOrCreateProgram("building",{config:de,defines:S,overrideFog:!1}),p.depthOnly===!0)pe=ce;else{const Ye=S.concat(["BUILDING_FAUX_FACADE","HAS_ATTRIBUTE_a_faux_facade_color_emissive"]);pe=o.getOrCreateProgram("building",{config:de,defines:Ye,overrideFog:!1})}F&&(F.setupShadowsFromMatrix(be,ce,!0),pe!==ce&&F.setupShadowsFromMatrix(be,pe,!0))}const ve=(be,Ae)=>{if(k){const Ne=be.entranceBloom;Ae.draw(o,T.gl.TRIANGLES,p.depthMode,Tn.disabled,p.blendMode,pn.disabled,Re,_.id,Ne.layoutVertexBuffer,Ne.indexBuffer,Ne.segmentsBucket,_.paint,o.transform.zoom,de,[Ne.layoutAttenuationBuffer,Ne.layoutColorBuffer])}else{const Ne=be.segmentsBucket;let De=[be.layoutNormalBuffer,be.layoutCentroidBuffer,be.layoutColorBuffer,be.layoutFloodLightDataBuffer];be.layoutFacadePaintBuffer&&(De=De.concat([be.layoutFacadeDataBuffer,be.layoutFacadeVerticalRangeBuffer,be.layoutFacadePaintBuffer])),Ae.draw(o,T.gl.TRIANGLES,p.depthMode,Tn.disabled,p.blendMode,I?pn.disabled:pn.backCW,Re,_.id,be.layoutVertexBuffer,be.indexBuffer,Ne,_.paint,o.transform.zoom,de,De)}};o.uploadCommonUniforms(T,ce,ee.toUnwrapped(),null,q),se.buildingWithoutFacade&&ve(se.buildingWithoutFacade,ce),se.buildingWithFacade&&(pe!==ce&&o.uploadCommonUniforms(T,pe,ee.toUnwrapped(),null,q),ve(se.buildingWithFacade,pe))}}function Up(p,o,d,_,b,S,T,I,k,F,z,q,j,Z){const te=p.context.gl,ee=p.depthModeForSublayer(1,rn.ReadOnly,te.LEQUAL,!0),oe=.1*(1-(se=z))+3*se;var se;const de=p._showOverdrawInspector,pe=q,ce=new O0;de||vl(ce,p,o,d,_,ee,new Tn({func:te.ALWAYS,mask:255},255,255,te.KEEP,te.KEEP,te.REPLACE),new In([te.ONE,te.ONE,te.ONE,te.ONE],a.C.transparent,[!1,!1,!1,!0],te.MIN),pn.disabled,b,"sdf",S,T,I,k,F,oe,pe,!1,void 0);{const Ce=de?Tn.disabled:new Tn({func:te.EQUAL,mask:255},255,255,te.KEEP,te.DECR,te.DECR),Se=de?p.colorModeForRenderPass():new In([te.ONE_MINUS_DST_ALPHA,te.DST_ALPHA,te.ONE,te.ONE],a.C.transparent,[!0,!0,!0,!0]);vl(ce,p,o,d,_,ee,Ce,Se,pn.disabled,b,"color",S,T,I,k,F,oe,pe,!1,void 0)}}const Yl=.05,D0=(p,o,d,_,b,S,T,I,k,F,z,q)=>({u_matrix:p,u_normalize_matrix:o,u_globe_matrix:d,u_merc_matrix:_,u_grid_matrix:b,u_tl_parent:S,u_scale_parent:F,u_fade_t:z.mix,u_opacity:z.opacity,u_image0:0,u_image1:1,u_raster_elevation:q,u_zoom_transition:T,u_merc_center:I,u_cutoff_params:k}),pw=(p,o,d,_,b,S,T,I,k,F)=>({u_particle_texture:p,u_particle_texture_side_len:o,u_tile_offset:d,u_velocity:_,u_color_ramp:S,u_velocity_res:b,u_max_speed:T,u_uv_offset:I,u_data_scale:[255*k[0],255*k[1]],u_data_offset:F,u_particle_pos_scale:1.1,u_particle_pos_offset:[Yl,Yl]}),mw=(p,o,d,_,b,S,T,I,k,F)=>({u_particle_texture:p,u_particle_texture_side_len:o,u_velocity:d,u_velocity_res:_,u_max_speed:b,u_speed_factor:S,u_reset_rate:T,u_rand_seed:Math.random(),u_uv_offset:I,u_data_scale:[255*k[0],255*k[1]],u_data_offset:F,u_particle_pos_scale:1.1,u_particle_pos_offset:[Yl,Yl]});var gw=a.ea([{name:"a_index",type:"Int16",components:1}]);class _w{constructor(o,d,_,b){const S={width:_[0],height:_[1],data:null},T=o.gl;this.targetColorTexture=new a.T(o,S,T.RGBA8,{useMipmap:!1}),this.backgroundColorTexture=new a.T(o,S,T.RGBA8,{useMipmap:!1}),this.context=o,this.updateParticleTexture(d,b),this.lastInvalidatedAt=0}updateParticleTexture(o,d){if(this.particleTextureDimension===d.width)return;(this.particleTexture0||this.particleTexture1||this.particleIndexBuffer||this.particleSegment)&&(this.particleTexture0.destroy(),this.particleTexture1.destroy(),this.particleIndexBuffer.destroy(),this.particleSegment.destroy());const _=this.context.gl,b=d.width*d.height;this.particleTexture0=new a.T(this.context,d,_.RGBA8,{premultiply:!1,useMipmap:!1}),this.particleTexture1=new a.T(this.context,d,_.RGBA8,{premultiply:!1,useMipmap:!1});const S=new a.eb;S.reserve(b);for(let T=0;T<b;T++)S.emplaceBack(T);this.particleIndexBuffer=this.context.createVertexBuffer(S,gw.members,!0),this.particleSegment=a.dB.simpleSegment(0,0,this.particleIndexBuffer.length,0),this.particleTextureDimension=d.width}update(o){return!(this.lastInvalidatedAt<o&&(this.lastInvalidatedAt=a.o.now(),1))}destroy(){this.targetColorTexture.destroy(),this.backgroundColorTexture.destroy(),this.particleIndexBuffer.destroy(),this.particleTexture0.destroy(),this.particleTexture1.destroy(),this.particleSegment.destroy()}}function yw(p,o,d){if(!p)return null;const _=o.getTextureDescriptor(p,d,!0);if(!_)return null;let{texture:b,mix:S,offset:T,tileSize:I,buffer:k,format:F}=_;if(!b||!F)return null;let z=!1;return F==="uint32"&&(z=!0,S[3]=0,S=Lg(a.ec,S,[0,d.paint.get("raster-particle-max-speed")]),T=C0(a.ec,T,[0,d.paint.get("raster-particle-max-speed")])),{texture:b,textureOffset:[k/(I+2*k),I/(I+2*k)],tileSize:I,scalarData:z,scale:S,offset:T,defines:["RASTER_ARRAY",{uint8:"DATA_FORMAT_UINT8",uint16:"DATA_FORMAT_UINT16",uint32:"DATA_FORMAT_UINT32"}[F]]}}function P2(p){const o=p._nearZ,d=p.projection.farthestPixelDistance(p),_=d-o,b=.2*p.height,S=o+b;return[o,d,(S-b-o)/_,(S-o)/_]}var F0=`#ifdef RASTER_ARRAY 3081uniform sampler2D u_velocity;uniform mediump vec2 u_velocity_res;uniform mediump float u_max_speed;const vec4 NO_DATA=vec4(1);const vec2 INVALID_VELOCITY=vec2(-1);uniform highp vec2 u_uv_offset;uniform highp float u_data_offset;uniform highp vec2 u_data_scale;
3081ivec4 rasterArrayLinearCoord(highp vec2 texCoord,highp vec2 texResolution,out highp vec2 fxy) {texCoord=texCoord*texResolution-0.5;fxy=fract(texCoord);texCoord-=fxy;return ivec4(texCoord.xxyy+vec2(1.5,0.5).xyxy);}highp vec2 lookup_velocity(highp vec2 uv) {uv=u_uv_offset.x+u_uv_offset.y*uv;highp vec2 fxy;ivec4 c=rasterArrayLinearCoord(uv,u_velocity_res,fxy);highp vec4 tl=texelFetch(u_velocity,c.yz,0);highp vec4 tr=texelFetch(u_velocity,c.xz,0);highp vec4 bl=texelFetch(u_velocity,c.yw,0);highp vec4 br=texelFetch(u_velocity,c.xw,0);if (tl==NO_DATA) {return INVALID_VELOCITY;}if (tr==NO_DATA) {return INVALID_VELOCITY;}if (bl==NO_DATA) {return INVALID_VELOCITY;}if (br==NO_DATA) {return INVALID_VELOCITY;}highp vec4 t=mix(mix(bl,br,fxy.x),mix(tl,tr,fxy.x),fxy.y);highp vec2 velocity=u_data_offset+vec2(dot(t.rg,u_data_scale),dot(t.ba,u_data_scale));velocity.y=-velocity.y;velocity/=max(u_max_speed,length(velocity));return velocity;} 3082#endif 3083uniform highp float u_particle_pos_scale;uniform highp vec2 u_particle_pos_offset;highp vec4 pack_pos_to_rgba(highp vec2 p) {highp vec2 v=(p+u_particle_pos_offset)/u_particle_pos_scale;highp vec4 r=vec4(v.x,fract(v.x*255.0),v.y,fract(v.y*255.0));return vec4(r.x-r.y/255.0,r.y,r.z-r.w/255.0,r.w);}highp vec2 unpack_pos_from_rgba(highp vec4 v) {v=floor(v*255.0+0.5)/255.0;highp vec2 p=vec2(v.x+(v.y/255.0),v.z+(v.w/255.0));return u_particle_pos_scale*p-u_particle_pos_offset;}`;Hh["_prelude_raster_particle.glsl"]||(Hh["_prelude_raster_particle.glsl"]=F0);var R2={building:tr(`#include "_prelude_fog.fragment.glsl" 3084#include "_prelude_shadow.fragment.glsl" 3085#include "_prelude_lighting.glsl" 3086const float window_depth=0.5;const float ao_radius=0.2;in vec4 v_color;in highp vec3 v_normal;in highp vec3 v_pos; 3087#ifdef RENDER_FRONT_CUTOFF 3088in float v_front_cutoff_opacity; 3089#endif 3090#ifdef INDICATOR_CUTOUT 3091#ifdef FEATURE_CUTOUT 3092in vec4 v_ground_roof; 3093#endif 3094#endif 3095#ifdef BUILDING_FAUX_FACADE 3096in lowp float v_faux_facade;in highp float v_faux_facade_ed;in highp vec2 v_faux_facade_window;in highp vec2 v_faux_facade_floor;in highp vec2 v_faux_facade_range;in highp float v_aspect;in highp vec3 v_tbn_0;in highp vec3 v_tbn_1;in highp vec3 v_tbn_2;in highp vec4 v_faux_color_emissive;uniform float u_faux_facade_ao_intensity; 3097#endif 3098#ifdef RENDER_SHADOWS 3099in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1; 3100#endif 3101#ifdef FLOOD_LIGHT 3102in highp float v_flood_radius;in float v_has_flood_light; 3103#endif 3104uniform lowp float u_opacity;uniform vec3 u_camera_pos;uniform highp float u_tile_to_meter;uniform float u_facade_emissive_chance;uniform vec3 u_flood_light_color;uniform float u_flood_light_intensity;vec3 linearTosRGB(in vec3 color) {return pow(color,vec3(1./2.2));} 3105#ifdef BUILDING_FAUX_FACADE 3106highp float hash12(in highp vec2 p) {highp vec3 p3 =fract(vec3(p.xyx)*0.1031);p3+=dot(p3,p3.yzx+33.33);return fract((p3.x+p3.y)*p3.z);}float min3(in vec3 v) {return min(min(v.x,v.y),v.z);}highp vec2 get_uv_mask_id(in highp vec2 q,out highp float mask,out highp vec2 id) {highp vec2 p=q;mask=step(v_faux_facade_range.x,p.y)*step(p.y,v_faux_facade_range.y);p.y=p.y-v_faux_facade_range.x;highp vec2 uv=modf(p/v_faux_facade_floor,id);highp vec4 d=(v_faux_facade_floor.xyxy+vec4(-v_faux_facade_window,v_faux_facade_window))*0.5;highp vec4 edge=d/v_faux_facade_floor.xyxy;highp vec2 m=step(edge.xy,uv)*step(uv,edge.zw);mask*=m.x*m.y;uv-=vec2(0.5);uv*=vec2(0.5)/(vec2(0.5)-edge.xy);uv+=vec2(0.5);return uv;}highp float ray_unit_box(in highp vec3 ray_o,in highp vec3 ray_d,in highp vec3 bmin,in highp vec3 bmax) {highp vec3 planes=mix(bmin,bmax,step(0.0,ray_d));highp vec3 t=(planes-ray_o)/ray_d;return min3(t);}float get_emissive(in vec2 id) {if (u_facade_emissive_chance > 0.0) {return (step(hash12(id),u_facade_emissive_chance)+0.05)*v_faux_color_emissive.a;}return 0.0;}vec3 get_shade_info(in highp vec3 v,in highp vec3 v_normalized,in vec3 color,in vec2 id,in mat3 tbn,inout vec3 out_normal,inout float out_emissive) {vec3 out_color=color;highp vec3 abs_v=abs(v_normalized);bool x_major=abs_v.x >=abs_v.y && abs_v.x >=abs_v.z;bool y_major=abs_v.y >=abs_v.x && abs_v.y >=abs_v.z;bool z_major=abs_v.z >=abs_v.x && abs_v.z >=abs_v.y; 3107#if 0 3108if (x_major) {out_color=v.x > 0.0 ? vec3(1.0,0.0,0.0) : vec3(0.0,1.0,1.0);} else if (y_major) {out_color=v.y > 0.0 ? vec3(0.0,1.0,0.0) : vec3(1.0,0.0,1.0);} else if (z_major) {out_color=v.z > 0.0 ? vec3(0.0,0.0,1.0) : vec3(1.0,1.0,0.0);}out_emissive=1.0; 3109#else 3110if (x_major) {out_normal=-sign(v.x)*tbn[0];} else if (y_major) {out_normal=vec3(0.0,0.0,-sign(v.y));} else if (z_major) {out_color=v_faux_color_emissive.rgb;
3110out_emissive=v.z <=0.0 ? get_emissive(id) : out_emissive;}float ao=1.0;if (u_faux_facade_ao_intensity > 0.0) {vec4 ao_range=v_faux_facade_window.xxyy*0.5-vec4(0,ao_radius,0,ao_radius);vec2 ao_range_z=vec2(window_depth*0.5)-vec2(0.0,ao_radius);if (x_major || y_major) {ao*=smoothstep(-ao_range_z.x,-ao_range_z.y,v.z);} else if (z_major) {ao*=smoothstep(-ao_range.x,-ao_range.y,v.x)*(1.0-smoothstep(ao_range.y,ao_range.x,v.x));ao*=smoothstep(-ao_range.z,-ao_range.w,v.y)*(1.0-smoothstep(ao_range.w,ao_range.z,v.y));}ao=mix(1.0,min(1.0,ao+0.25),u_faux_facade_ao_intensity);}out_color*=ao; 3111#endif 3112return out_color;} 3113#endif 3114vec3 apply_lighting_linear(in vec3 color,in vec3 normal,in float dir_factor) {float ambient_directional_factor=calculate_ambient_directional_factor(normal);vec3 ambient_contrib=ambient_directional_factor*u_lighting_ambient_color;vec3 directional_contrib=u_lighting_directional_color*dir_factor;return color*(ambient_contrib+directional_contrib);}void main() {vec3 normal=normalize(v_normal);vec3 base_color=v_color.rgb;float emissive=v_color.a; 3115#ifdef BUILDING_FAUX_FACADE 3116if (v_faux_facade > 0.0) {highp mat3 tbn=mat3(v_tbn_0,v_tbn_1,v_tbn_2);highp vec3 v=vec3(v_pos.xy,v_pos.z/u_tile_to_meter)-u_camera_pos;highp vec3 view_tangent=transpose(tbn)*v;highp vec2 q=vec2(v_faux_facade_ed,v_pos.z);float mask=0.0;vec2 id=vec2(0.0);highp vec2 uv=get_uv_mask_id(q,mask,id);uv*=v_faux_facade_window;highp vec3 bmin=vec3(0.0,0.0,-window_depth);highp vec3 bmax=bmin+vec3(v_faux_facade_window,window_depth);highp vec3 ray_o=vec3(uv,0.0);highp vec3 ray_d=normalize(view_tangent);highp float t_min=ray_unit_box(ray_o,ray_d,bmin,bmax);highp vec3 hit=ray_o+t_min*ray_d;highp vec3 r=vec3(v_faux_facade_window,-window_depth);hit-=r*0.5;highp vec3 normalized=hit/r;vec3 out_normal=normal;float out_emissive=emissive;vec3 room_color=get_shade_info(hit,normalized,base_color,id,tbn,out_normal,out_emissive);base_color=mix(base_color,room_color,mask);normal=mix(normal,out_normal,mask);emissive=mix(emissive,out_emissive,mask);} 3117#endif 3118vec4 color=vec4(base_color,1.0);vec3 xy_flipped_normal=vec3(-normal.xy,normal.z);float shadowed_lighting_factor=0.0; 3119#ifdef RENDER_SHADOWS 3120#ifdef RENDER_CUTOFF 3121shadowed_lighting_factor=shadowed_light_factor_normal_opacity(xy_flipped_normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,v_cutoff_opacity);if (v_cutoff_opacity==0.0) {discard;} 3122#else 3123shadowed_lighting_factor=shadowed_light_factor_normal(xy_flipped_normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w); 3124#endif 3125#else 3126shadowed_lighting_factor=max(0.0,dot(xy_flipped_normal,u_lighting_directional_dir)); 3127#endif 3128color.rgb=apply_lighting_linear(color.rgb,xy_flipped_normal,shadowed_lighting_factor);color.rgb=linearTosRGB(color.rgb); 3129#ifdef FLOOD_LIGHT 3130float flood_radiance=(1.0-min(v_pos.z/v_flood_radius,1.0))*u_flood_light_intensity*v_has_flood_light;color.rgb=mix(color.rgb,u_flood_light_color,flood_radiance); 3131#endif 3132color.rgb=mix(color.rgb,linearTosRGB(base_color.rgb),emissive); 3133#ifdef FOG 3134color=fog_dither(fog_apply_premultiplied(color,v_fog_pos,v_pos.z)); 3135#endif 3136color*=u_opacity; 3137#ifdef INDICATOR_CUTOUT 3138#ifdef FEATURE_CUTOUT 3139{float ditherOpacity=cutoutGroundRoofOpacity(v_ground_roof);if (ditherOpacity < 1.0) {int index=(int(gl_FragCoord.x) % 4)*4+(int(gl_FragCoord.y) % 4);if (ditherOpacity < DITHER_THRESHOLDS[index]) {discard;}}} 3140#else 3141color=applyCutout(color,v_pos.z); 3142#endif 3143#endif 3144#ifdef RENDER_FRONT_CUTOFF 3145if (v_front_cutoff_opacity < 1.0) {int index=(int(gl_FragCoord.x) % 4)*4+(int(gl_FragCoord.y) % 4);if (v_front_cutoff_opacity < DITHER_THRESHOLDS[index]) {discard;}} 3146#endif 3147#ifdef FEATURE_CUTOUT 3148color=apply_feature_cutout(color,gl_FragCoord,get_cutout_factors(gl_FragCoord).x); 3149#endif 3150glFragColor=color; 3151#ifdef DEBUG_SHOW_NORMALS 3152color.rgb=xy_flipped_normal*0.5+vec3(0.5,0.5,0.5);color.a=1.0;glFragColor=color; 3153#endif 3154#ifdef OVERDRAW_INSPECTOR 3155glFragColor=vec4(1.0); 3156#endif 3157HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 3158#include "_prelude_shadow.vertex.glsl" 3159in vec3 a_pos_3f;in ivec4 a_normal_3;in ivec4 a_centroid_3; 3160#ifdef FLOOD_LIGHT 3161in int a_flood_light_wall_radius_1i16; 3162#endif 3163#ifdef BUILDING_FAUX_FACADE 3164in uvec4 a_faux_facade_data;in uvec2 a_faux_facade_vertical_range; 3165#endif 3166uniform mat4 u_matrix;uniform mat4 u_normal_matrix;uniform highp float u_tile_to_meter; 3167#ifdef RENDER_FRONT_CUTOFF 3168uniform vec3 u_front_cutoff_params;out float v_front_cutoff_opacity; 3169#endif 3170#ifdef INDICATOR_CUTOUT 3171#ifdef FEATURE_CUTOUT 3172out vec4 v_ground_roof; 3173#endif 3174#endif 3175out vec4 v_color;out vec3 v_normal;out highp vec3 v_pos; 3176#ifdef BUILDING_FAUX_FACADE 3177out lowp float v_faux_facade;out highp float v_faux_facade_ed;out highp vec2 v_faux_facade_window;out highp vec2 v_faux_facade_floor;out highp vec2 v_faux_facade_range;out highp float v_aspect;out highp vec3 v_tbn_0;out highp vec3 v_tbn_1;out highp vec3 v_tbn_2;out highp vec4 v_faux_color_emissive; 3178#endif 3179#ifdef RENDER_SHADOWS 3180uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1; 3181#endif 3182#ifdef FLOOD_LIGHT
3183out highp float v_flood_radius;out float v_has_flood_light; 3184#endif 3185const float MAX_UINT_16=65535.0;const float MAX_INT_16=32767.0;const float MAX_UINT_8=255.0;const float TWO_POW_8=256.0;const float FLOOD_LIGHT_MAX_RADIUS_METER=2048.0;vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));} 3186#ifdef BUILDING_FAUX_FACADE 3187mat3 get_tbn(in vec3 normal) {const vec3 bitangent=vec3(0.0,0.0,1.0);vec3 tangent=normalize(vec3(normal.y,-normal.x,0.0));return mat3(tangent,bitangent,normal);} 3188#endif 3189#pragma mapbox: define-attribute-vertex-shader-only highp uvec2 part_color_emissive 3190#pragma mapbox: define-attribute-vertex-shader-only highp uvec2 faux_facade_color_emissive 3191void main() { 3192#pragma mapbox: initialize-attribute-custom highp uvec2 part_color_emissive 3193#pragma mapbox: initialize-attribute-custom highp uvec2 faux_facade_color_emissive 3194#ifdef FLOOD_LIGHT 3195v_flood_radius=(float(a_flood_light_wall_radius_1i16)/MAX_INT_16*FLOOD_LIGHT_MAX_RADIUS_METER);v_has_flood_light=step(0.0,v_flood_radius); 3196#endif 3197vec4 color_emissive=decode_color(vec2(part_color_emissive));v_color=vec4(sRGBToLinear(color_emissive.rgb),color_emissive.a);vec3 a_normal_3f=vec3(a_normal_3)/MAX_INT_16;v_normal=vec3(u_normal_matrix*vec4(a_normal_3f,0.0));float hidden=0.0;float depth_offset=0.0;vec2 centroid_xy=vec2(a_centroid_3.xy >> 2);vec2 spanBits=vec2(a_centroid_3.xy & 3); 3198#ifdef BUILDING_FAUX_FACADE 3199vec4 faux_facade_data=vec4(a_faux_facade_data);v_faux_facade=faux_facade_data.x;if (v_faux_facade > 0.0) {v_faux_facade_ed=faux_facade_data.x *u_tile_to_meter;float window_x_perc=floor(faux_facade_data.y/TWO_POW_8);float window_y_perc=faux_facade_data.y-TWO_POW_8*window_x_perc;vec2 window_perc=vec2(window_x_perc,window_y_perc)/MAX_UINT_8;v_faux_facade_floor=(faux_facade_data.zw/MAX_UINT_16*EXTENT)*u_tile_to_meter;v_faux_facade_window=window_perc*v_faux_facade_floor;v_faux_facade_range=(vec2(a_faux_facade_vertical_range)/MAX_UINT_16*EXTENT)*u_tile_to_meter;v_aspect=v_faux_facade_window.x/v_faux_facade_window.y;mat3 tbn=get_tbn(normalize(v_normal));v_tbn_0=tbn[0];v_tbn_1=tbn[1];v_tbn_2=tbn[2];v_faux_color_emissive=decode_color(vec2(faux_facade_color_emissive));v_faux_color_emissive.rgb=sRGBToLinear(v_faux_color_emissive.rgb);depth_offset=min(1000.0,float(a_centroid_3.z))*0.0000002;} 3200#endif 3201v_pos=a_pos_3f; 3202#if defined(RENDER_CUTOFF) || defined(RENDER_FRONT_CUTOFF) 3203float halfSpanX=spanBits.x*10.0/u_tile_to_meter;float halfSpanY=spanBits.y*10.0/u_tile_to_meter;vec2 screenUpInTile=vec2(u_matrix[0][1],u_matrix[1][1]);vec2 spanOffset=vec2(halfSpanX,halfSpanY)*sign(screenUpInTile);vec2 cutoff_highestCorner=centroid_xy+spanOffset;vec2 cutoff_lowestCorner=centroid_xy-spanOffset; 3204#endif 3205#if defined(RENDER_CUTOFF) || defined(RENDER_FRONT_CUTOFF) 3206vec4 ground=u_matrix*vec4(centroid_xy,0.0,1.0); 3207#endif 3208#ifdef RENDER_CUTOFF 3209v_cutoff_opacity=cutoff_opacity(u_cutoff_params,ground.z);hidden=float(v_cutoff_opacity==0.0);v_pos.z*=v_cutoff_opacity; 3210#endif 3211#ifdef RENDER_SHADOWS 3212vec3 shadow_pos=v_pos; 3213#ifdef NORMAL_OFFSET 3214vec3 offset=shadow_normal_offset_model(v_normal);shadow_pos+=offset*shadow_normal_offset_multiplier0(); 3215#endif 3216v_pos_light_view_0=u_light_matrix_0*vec4(shadow_pos,1.0);v_pos_light_view_1=u_light_matrix_1*vec4(shadow_pos,1.0); 3217#endif 3218#ifdef FOG 3219v_fog_pos=fog_position(v_pos); 3220#endif 3221#ifdef RENDER_FRONT_CUTOFF 3222v_front_cutoff_opacity=1.0;{hidden=max(hidden,float(ground.w <=0.0));
3222float ndc_y=ground.y/max(ground.w,0.001);float threshold=u_front_cutoff_params.x*2.0-1.0;float range_ndc=u_front_cutoff_params.y*2.0;hidden=max(hidden,float(ndc_y < threshold-range_ndc));float t=clamp((ndc_y-(threshold-range_ndc))/max(range_ndc,0.001),0.0,1.0);v_front_cutoff_opacity=mix(u_front_cutoff_params.z,1.0,t);} 3223#endif 3224gl_Position=mix(u_matrix*vec4(v_pos,1),AWAY,hidden);gl_Position.z-=depth_offset*gl_Position.w; 3225#ifdef INDICATOR_CUTOUT 3226#ifdef FEATURE_CUTOUT 3227vec4 ic_ground=u_matrix*vec4(v_pos.xy,0.0,1.0);vec4 ic_roof=u_matrix*vec4(v_pos.xy,v_pos.z,1.0);v_ground_roof=vec4(ic_ground.xy/ic_ground.w,ic_roof.xy/ic_roof.w); 3228#endif 3229#endif 3230}`),buildingBloom:tr(`in vec4 v_color_emissive; 3231#pragma mapbox: define-attribute highp vec4 bloom_attenuation 3232#pragma mapbox: initialize-attribute highp vec4 bloom_attenuation 3233float saturate(float val) {return clamp(val,0.0,1.0);}void main() {float emission=v_color_emissive.a;float opacity=1.0; 3234#ifdef HAS_ATTRIBUTE_a_bloom_attenuation 3235float distance=length(vec2(1.3*max(0.0,abs(bloom_attenuation.x)-bloom_attenuation.z),bloom_attenuation.y));distance+= mix(0.5,0.0,clamp(emission-1.0,0.0,1.0));opacity*=saturate(1.0-distance*distance); 3236#endif 3237#ifdef RENDER_CUTOFF 3238opacity*=v_cutoff_opacity; 3239#endif 3240glFragColor=vec4(v_color_emissive.rgb,1.0)*opacity;}`,`in vec3 a_pos_3f; 3241#pragma mapbox: define-attribute-vertex-shader-only highp uvec2 part_color_emissive 3242#pragma mapbox: define-attribute highp vec4 bloom_attenuation 3243out vec4 v_color_emissive;uniform mat4 u_matrix;vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}void main() { 3244#pragma mapbox: initialize-attribute-custom highp uvec2 part_color_emissive 3245#pragma mapbox: initialize-attribute highp vec4 bloom_attenuation 3246#ifdef HAS_ATTRIBUTE_a_part_color_emissive 3247vec4 color_emissive=decode_color(vec2(part_color_emissive));float part_emissive=color_emissive.a*5.0;v_color_emissive=vec4(sRGBToLinear(color_emissive.rgb),part_emissive); 3248#else 3249v_color_emissive=vec4(1.0); 3250#endif 3251gl_Position=u_matrix*vec4(a_pos_3f,1.0); 3252#ifdef RENDER_CUTOFF 3253v_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z); 3254#endif 3255}`),buildingDepth:tr("void main() {}","in vec3 a_pos_3f;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos_3f,1.0);}"),rasterParticle:tr(`#include "_prelude_fog.fragment.glsl" 3256#include "_prelude_lighting.glsl" 3257uniform float u_fade_t;uniform float u_opacity;uniform highp float u_raster_elevation;in vec2 v_pos0;in vec2 v_pos1;uniform sampler2D u_image0;uniform sampler2D u_image1;void main() {vec4 color0,color1,color;color0=texture(u_image0,v_pos0);color1=texture(u_image1,v_pos1);if (color0.a > 0.0) color0.rgb/=color0.a;if (color1.a > 0.0) color1.rgb/=color1.a;color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 out_color=color.rgb; 3258#ifdef LIGHTING_3D_MODE 3259out_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),1.0).rgb; 3260#endif 3261#ifdef FOG 3262highp float fog_limit_high_meters=1000000.0;highp float fog_limit_low_meters=600000.0;float fog_limit=1.0-smoothstep(fog_limit_low_meters,fog_limit_high_meters,u_raster_elevation);out_color=fog_dither(fog_apply(out_color,v_fog_pos,fog_limit)); 3263#endif 3264glFragColor=vec4(out_color*color.a,color.a); 3265#ifdef OVERDRAW_INSPECTOR 3266glFragColor=vec4(1.0); 3267#endif 3268HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 3269uniform mat4 u_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform mat3 u_grid_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_raster_elevation;uniform float u_zoom_transition;uniform vec2 u_merc_center; 3270#define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8 3271in ivec2 a_pos;in uvec2 a_texture_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {float w=1.0;vec2 uv; 3272#ifdef PROJECTION_GLOBE_VIEW 3273vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float mercatorX=mercatorXfromLng(latLng[1]);float tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];float uvX=mercatorX*tiles-idx;float uvY=mercatorY*tiles-idy;uv=vec2(uvX,uvY);vec3 globe_pos=latLngToECEF(latLng.xy);globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {vec2 merc_pos=vec2(mercatorX,mercatorY);merc_world_pos=vec4(merc_pos,u_raster_elevation,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition)*w,w);gl_Position=u_matrix*interpolated_pos; 3274#ifdef FOG 3275v_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz); 3276#endif 3277#else 3278uv=vec2(a_texture_pos)/8192.0;
3278gl_Position=u_matrix*vec4(vec2(a_pos)*w,u_raster_elevation*w,w); 3279#ifdef FOG 3280v_fog_pos=fog_position(vec2(a_pos)); 3281#endif 3282#endif 3283v_pos0=uv;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}`),rasterParticleDraw:tr("uniform sampler2D u_color_ramp;in float v_particle_speed;void main() {glFragColor=texture(u_color_ramp,vec2(v_particle_speed,0.5));}",`#include "_prelude_raster_particle.glsl" 3284in int a_index;uniform sampler2D u_particle_texture;uniform float u_particle_texture_side_len;uniform vec2 u_tile_offset;out float v_particle_speed;void main() {ivec2 pixel_coord=ivec2( 3285mod(float(a_index),u_particle_texture_side_len),float(a_index)/u_particle_texture_side_len);vec4 pixel=texelFetch(u_particle_texture,pixel_coord,0);vec2 pos=unpack_pos_from_rgba(pixel)+u_tile_offset;vec2 tex_coord=fract(pos);vec2 velocity=lookup_velocity(tex_coord);if (velocity==INVALID_VELOCITY) {gl_Position=AWAY;v_particle_speed=0.0;} else {gl_Position=vec4(2.0*pos-1.0,0,1);v_particle_speed=length(velocity);}gl_PointSize=1.0;}`),rasterParticleTexture:tr("uniform sampler2D u_texture;uniform float u_opacity;in vec2 v_tex_pos;void main() {vec4 color=texture(u_texture,v_tex_pos);glFragColor=vec4(floor(255.0*color*u_opacity)/255.0);}","in ivec2 a_pos;out vec2 v_tex_pos;void main() {vec2 uv=0.5*vec2(a_pos)+vec2(0.5);v_tex_pos=uv;gl_Position=vec4(a_pos,0.0,1.0);}"),rasterParticleUpdate:tr(`#include "_prelude_raster_particle.glsl" 3286uniform sampler2D u_particle_texture;uniform mediump float u_particle_texture_side_len;uniform mediump float u_speed_factor;uniform highp float u_reset_rate;uniform highp float u_rand_seed;in highp vec2 v_tex_coord;vec2 linearstep(vec2 edge0,vec2 edge1,vec2 x) {return clamp((x-edge0)/(edge1-edge0),vec2(0),vec2(1));}const highp vec3 rand_constants=vec3(12.9898,78.233,4375.85453);highp float rand(const highp vec2 co) {highp float t=dot(rand_constants.xy,co);return fract(sin(t)*(rand_constants.z+t));}void main() {ivec2 pixel_coord=ivec2(v_tex_coord*u_particle_texture_side_len);highp vec4 pixel=texelFetch(u_particle_texture,pixel_coord,0);highp vec2 pos=unpack_pos_from_rgba(pixel);highp vec2 velocity=lookup_velocity(clamp(pos,0.0,1.0));highp vec2 dp=velocity==INVALID_VELOCITY ? vec2(0) : velocity*u_speed_factor;pos=pos+dp;highp vec2 seed=(pos+v_tex_coord)*u_rand_seed;highp vec2 random_pos=vec2(rand(seed+1.3),rand(seed+2.1));highp vec2 persist_rate=pow( 3287linearstep(vec2(-u_particle_pos_offset),vec2(0),pos)*linearstep(vec2(1.0+u_particle_pos_offset),vec2(1),pos),vec2(4) 3288);highp vec2 per_frame_persist=pow(persist_rate,abs(dp)/u_particle_pos_offset);highp float drop_rate=1.0-per_frame_persist.x*per_frame_persist.y;drop_rate=any(greaterThanEqual(abs(pos-0.5),vec2(0.5+u_particle_pos_offset))) ? 1.0 : drop_rate;highp float drop=step(1.0-drop_rate-u_reset_rate,rand(seed));highp vec2 next_pos=mix(pos,random_pos,drop);glFragColor=pack_pos_to_rgba(next_pos);}`,"in ivec2 a_pos;out vec2 v_tex_coord;void main() {v_tex_coord=0.5*vec2(a_pos+ivec2(1));gl_Position=vec4(a_pos,0.0,1.0);}"),snowParticle:tr("in highp vec2 uv;in highp float alphaMultiplier;uniform vec4 u_particleColor;uniform vec2 u_simpleShapeParameters;void main() {float t=clamp((length(uv)-u_simpleShapeParameters.x)/(1.0-u_simpleShapeParameters.x),0.0,1.0);float alpha=1.0-pow(t,pow(10.0,u_simpleShapeParameters.y));alpha*=alphaMultiplier;alpha*=u_particleColor.a;vec3 color=u_particleColor.rgb*alpha;glFragColor=vec4(color,alpha) ;HANDLE_WIREFRAME_DEBUG;}",` 3289in highp vec3 a_pos_3f;in highp vec2 a_uv;in highp vec4 a_snowParticleData;in highp vec4 a_snowParticleDataHorizontalOscillation;uniform mat4 u_modelview;uniform mat4 u_projection;uniform vec3 u_cam_pos;uniform vec2 u_screenSize;uniform float u_time;uniform float u_boxSize;uniform float u_velocityConeAperture; 3290uniform float u_velocity;uniform vec3 u_direction;uniform float u_horizontalOscillationRadius; 3291uniform float u_horizontalOscillationRate; 3292uniform float u_billboardSize;uniform vec2 u_thinningCenterPos;uniform vec3 u_thinningShape;uniform float u_thinningAffectedRatio;uniform float u_thinningParticleOffset;out highp vec2 uv;out highp float alphaMultiplier;void main() {vec3 pos=a_pos_3f;float halfBoxSize=0.5*u_boxSize;pos.xyz*=halfBoxSize;pos+=u_cam_pos;float velocityConeApertureRad=radians(u_velocityConeAperture*0.5);float coneAnglePichRad=velocityConeApertureRad*a_snowParticleData.z;float coneAngleHeadingRad=a_snowParticleData.w*radians(360.0);vec3 localZ=normalize(u_direction);vec3 localX=normalize(cross(localZ,vec3(1,0,0)));vec3 localY=normalize(cross(localZ,localX));vec3 direction;direction.x=cos(coneAngleHeadingRad)*sin(coneAnglePichRad);direction.y=sin(coneAngleHeadingRad)*sin(coneAnglePichRad);direction.z=cos(coneAnglePichRad);direction=normalize(direction);vec3 simPosLocal=vec3(0,0,0);float velocityScale=(1.0+3.0*a_snowParticleData.y)*u_velocity;simPosLocal+=direction*velocityScale*u_time;float horizontalOscillationRadius=u_horizontalOscillationRadius*a_snowParticleDataHorizontalOscillation.x;float horizontalOscillationAngle=u_horizontalOscillationRate*u_time*(-1.0+2.0*a_snowParticleDataHorizontalOscillation.y);
3292simPosLocal.xy+=horizontalOscillationRadius*vec2(cos(horizontalOscillationAngle),sin(horizontalOscillationAngle));vec3 simPos=localX*simPosLocal.x+ 3293localY*simPosLocal.y+localZ*simPosLocal.z;pos+=simPos;pos=fract((pos+vec3(halfBoxSize))/vec3(u_boxSize))*u_boxSize-vec3(halfBoxSize);float clipZ=-u_cam_pos.z+pos.z;vec4 posView=u_modelview*vec4(pos,1.0);float size=u_billboardSize;alphaMultiplier=1.0;vec4 posScreen=u_projection*posView;posScreen/=posScreen.w;posScreen.xy=vec2(0.5)+posScreen.xy*0.5;posScreen.xy*=u_screenSize;vec2 thinningCenterPos=u_thinningCenterPos.xy;thinningCenterPos.y=u_screenSize.y-thinningCenterPos.y;float screenDist=length((thinningCenterPos-posScreen.xy)/(0.5*u_screenSize));screenDist+=a_snowParticleData.x*u_thinningParticleOffset;float scaleFactorMode=0.0;float thinningShapeDist=u_thinningShape.x+u_thinningShape.y;if (screenDist < thinningShapeDist) {float thinningFadeRatio=clamp((screenDist-u_thinningShape.x)/u_thinningShape.y,0.0,1.0);thinningFadeRatio=pow(thinningFadeRatio,u_thinningShape.z);if (a_snowParticleData.x < u_thinningAffectedRatio) {scaleFactorMode=1.0-thinningFadeRatio;alphaMultiplier=thinningFadeRatio;}}vec4 posScreen1=u_projection*vec4(posView.x-size,posView.yzw);posScreen1/=posScreen1.w;vec4 posScreen2=u_projection*vec4(posView.x+size,posView.yzw);posScreen2/=posScreen2.w;posScreen1.xy=vec2(0.5)+posScreen1.xy*0.5;posScreen1.xy*=u_screenSize;posScreen2.xy=vec2(0.5)+posScreen2.xy*0.5;posScreen2.xy*=u_screenSize;float screenLength=length(posScreen1.xy-posScreen2.xy);float screenEpsilon=3.0;float scaleFactor=1.0;if (screenLength < screenEpsilon) {scaleFactor=screenEpsilon/max(screenLength,0.01);scaleFactor=mix(scaleFactor,1.0,scaleFactorMode);}float screenEpsilon2=15.0;if (screenLength > screenEpsilon2) {scaleFactor=screenEpsilon2/max(screenLength,0.01);}size*=scaleFactor;vec2 right=size*vec2(1,0);vec2 up=size*vec2(0,1);posView.xy+=right*a_uv.x;posView.xy+=up*a_uv.y;uv=a_uv;gl_Position=u_projection*posView;}`),rainParticle:tr("in highp vec2 uv;in highp float particleRandomValue;uniform sampler2D u_texScreen;uniform float u_distortionStrength;uniform vec4 u_color;uniform vec2 u_thinningCenterPos;uniform vec3 u_thinningShape;uniform float u_thinningAffectedRatio;uniform float u_thinningParticleOffset;uniform float u_shapeDirectionalPower;uniform float u_mode;void main() {vec2 st=uv*0.5+vec2(0.5);vec2 uvm=uv;uvm.y=-1.0+2.0*pow(st.y,u_shapeDirectionalPower);float shape=clamp(1.0-length(uvm),0.0,1.0);float alpha=abs(shape)*u_color.a;vec2 screenSize=vec2(textureSize(u_texScreen,0));vec2 thinningCenterPos=u_thinningCenterPos.xy;thinningCenterPos.y=screenSize.y-thinningCenterPos.y;float screenDist=length((thinningCenterPos-gl_FragCoord.xy)/(0.5*screenSize));screenDist+=(0.5+0.5*particleRandomValue)*u_thinningParticleOffset;float thinningShapeDist=u_thinningShape.x+u_thinningShape.y;float thinningAlpha=1.0;if (screenDist < thinningShapeDist) {float thinningFadeRatio=clamp((screenDist-u_thinningShape.x)/u_thinningShape.y,0.0,1.0);thinningFadeRatio=pow(thinningFadeRatio,u_thinningShape.z);thinningAlpha*=thinningFadeRatio;}vec2 offsetXY=normalize(uvm)*abs(shape);vec2 stScreen=(gl_FragCoord.xy+offsetXY*u_distortionStrength*thinningAlpha)/screenSize;vec3 colorScreen=texture(u_texScreen,stScreen).rgb;alpha*=thinningAlpha;glFragColor=mix(vec4(colorScreen,1.0),vec4(u_color.rgb*alpha,alpha),u_mode);HANDLE_WIREFRAME_DEBUG;}",` 3294in highp vec3 a_pos_3f;in highp vec2 a_uv;in highp vec4 a_rainParticleData;uniform mat4 u_modelview;uniform mat4 u_projection;uniform vec3 u_cam_pos;uniform float u_time;uniform float u_boxSize;uniform float u_velocityConeAperture; 3295uniform float u_velocity; 3296uniform vec2 u_rainDropletSize;uniform vec3 u_rainDirection;out highp vec2 uv;out highp float particleRandomValue;void main() {vec3 pos=a_pos_3f;float halfBoxSize=0.5*u_boxSize;pos*=halfBoxSize; 3297pos+=u_cam_pos;float velocityConeApertureRad=radians(u_velocityConeAperture*0.5);float coneAnglePichRad=velocityConeApertureRad*a_rainParticleData.z;float coneAngleHeadingRad=a_rainParticleData.w*radians(360.0);vec3 localZ=normalize(u_rainDirection);vec3 localX=normalize(cross(localZ,vec3(1,0,0)));vec3 localY=normalize(cross(localZ,localX));vec3 directionLocal;directionLocal.x=cos(coneAngleHeadingRad)*sin(coneAnglePichRad);directionLocal.y=sin(coneAngleHeadingRad)*sin(coneAnglePichRad);directionLocal.z=cos(coneAnglePichRad);directionLocal=normalize(directionLocal);vec3 directionWorld=localX*directionLocal.x+localY*directionLocal.y+localZ*directionLocal.z;float velocityScale=(1.0+3.0*a_rainParticleData.y)*u_velocity;vec3 simPosLocal=vec3(0,0,0);simPosLocal+=directionLocal*velocityScale*u_time;vec3 simPos=localX*simPosLocal.x+ 3298localY*simPosLocal.y+localZ*simPosLocal.z;pos+=simPos;pos=fract((pos+vec3(halfBoxSize))/vec3(u_boxSize))*u_boxSize-vec3(halfBoxSize);vec4 posView=u_modelview*vec4(pos,1.0);vec3 directionView=normalize((u_modelview*vec4(directionWorld,0.0)).xyz);vec3 side=cross(directionView,normalize(posView.xyz));posView.xyz+=side*a_uv.x*u_rainDropletSize.x;posView.xyz+=directionView*a_uv.y*u_rainDropletSize.y;uv=a_uv;particleRandomValue=a_rainParticleData.x;gl_Position=u_projection*posView;}`),vignette:tr("uniform vec3 u_vignetteShape;uniform vec4 u_vignetteColor;in vec2 st;void main() {float screenDist=length(st);float alpha=clamp((screenDist-u_vignetteShape.x)/u_vignetteShape.y,0.0,1.0);alpha=pow(alpha,u_vignetteShape.z)*u_vignetteColor.a;vec3 color=u_vignetteColor.rgb;glFragColor=vec4(color*alpha,alpha) ;}","in vec2 a_pos_2f;out vec2 st;void main() {st=a_pos_2f;gl_Position=vec4(a_pos_2f,0,1);}")};tr(F0,"");const Is=a.ea([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_rainParticleData",components:4}]),k2=a.ea([{type:"Float32",name:"a_pos_2f",components:2}]);class $p{destroy(){this.vignetteVx&&this.vignetteVx.destroy(),this.vignetteIdx&&this.vignetteIdx.destroy()}draw(o,d){const _=o.getOrCreateProgram("vignette");
3298if(!this.vignetteVx||!this.vignetteIdx){const T=new a.ee,I=new a.dF;T.emplaceBack(-1,-1),T.emplaceBack(1,-1),T.emplaceBack(1,1),T.emplaceBack(-1,1),I.emplaceBack(0,1,2),I.emplaceBack(0,2,3),this.vignetteVx=o.context.createVertexBuffer(T,k2.members),this.vignetteIdx=o.context.createIndexBuffer(I)}const b=a.dB.simpleSegment(0,0,4,6);if(this.vignetteVx&&this.vignetteIdx){o.uploadCommonUniforms(o.context,_);const T={u_vignetteShape:(S={vignetteShape:[d.start,d.range,Math.pow(10,d.fadePower)],vignetteColor:[d.color.r,d.color.g,d.color.b,d.color.a*d.strength]}).vignetteShape,u_vignetteColor:S.vignetteColor};_.draw(o,o.context.gl.TRIANGLES,rn.disabled,Tn.disabled,In.alphaBlended,pn.disabled,T,"vignette",this.vignetteVx,this.vignetteIdx,b)}var S}}class M2{constructor(){this._accumulatedOffsetX=0,this._accumulatedOffsetY=0,this._accumulatedElevation=0}update(o,d){const _=o.getFreeCameraOptions().position,b=_.toAltitude(),S=_.toLngLat(),T=a.am(S.lng),I=a.am(S.lat),k=o.pixelsPerMeter/d,F=T*a.eg,z=a.eg*Math.log(Math.tan(Math.PI/4+I/2));if(this._offsetXPrev===void 0)this._offsetXPrev=0,this._offsetYPrev=0,this._elevationPrev=0,this._accumulatedOffsetX=0,this._accumulatedOffsetY=0,this._accumulatedElevation=0;else{const q=-this._offsetYPrev+z,j=-this._elevationPrev+b;this._accumulatedOffsetX+=(-this._offsetXPrev+F)*k,this._accumulatedOffsetY+=q*k,this._accumulatedElevation+=j*k,this._offsetXPrev=F,this._offsetYPrev=z,this._elevationPrev=b}}getPosition(){return[this._accumulatedOffsetX,this._accumulatedOffsetY,this._accumulatedElevation]}}function Zr(p,o){return[-(p[0]-Math.floor(p[0]/o)*o),-(p[1]-Math.floor(p[1]/o)*o),-(p[2]-Math.floor(p[2]/o)*o)]}function Jn(p){const o=a.ef(1323123451230),d=[];for(let _=0;_<p;++_){const b=2*o()-1,S=2*o()-1,T=2*o()-1;d.push(a.cU(b,S,T))}return d}function Lc(p,o,d,_,b){const S=a.aB((b-d)/(_-d),0,1);return(1-S)*p+S*o}class Ha{constructor(o){this._movement=new M2,this._accumulatedTimeFromStart=0,this._prevTime=Date.now()/1e3,this._vignette=new $p,this._ppmScaleFactor=o}destroy(){this.particlesVx&&this.particlesVx.destroy(),this.particlesIdx&&this.particlesIdx.destroy(),this._vignette&&this._vignette.destroy()}updateOnRender(o,d){const _=o.transform;this._movement.update(_,this._ppmScaleFactor);const b=_.starsProjMatrix,S=a.bP([]);a.bR(S,S,a.am(90)-_._pitch),a.bQ(S,S,-_.angle);const T=a.bV(new Float32Array(16),S),I=new Float32Array([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),k=a.e9([],I),F=a.aC([],k,T),z=Date.now()/1e3;return this._accumulatedTimeFromStart+=(z-this._prevTime)*d,this._prevTime=z,{projectionMatrix:b,modelviewMatrix:F}}}const Id=a.ea([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_snowParticleData",components:4},{type:"Float32",name:"a_snowParticleDataHorizontalOscillation",components:2}]),Pd={building:p=>({u_matrix:new a.c3(p),u_normal_matrix:new a.c3(p),u_opacity:new a.c1(p),u_faux_facade_ao_intensity:new a.c1(p),u_camera_pos:new a.c0(p),u_tile_to_meter:new a.c1(p),u_facade_emissive_chance:new a.c1(p),u_flood_light_color:new a.c0(p),u_flood_light_intensity:new a.c1(p),u_front_cutoff_params:new a.c0(p)}),buildingBloom:p=>({u_matrix:new a.c3(p)}),buildingDepth:p=>({u_matrix:new a.c3(p)}),rasterParticle:p=>({u_matrix:new a.c3(p),u_normalize_matrix:new a.c3(p),u_globe_matrix:new a.c3(p),u_merc_matrix:new a.c3(p),u_grid_matrix:new a.dq(p),u_tl_parent:new a.c2(p),u_scale_parent:new a.c1(p),u_fade_t:new a.c1(p),u_opacity:new a.c1(p),u_image0:new a.b$(p),u_image1:new a.b$(p),u_raster_elevation:new a.c1(p),u_zoom_transition:new a.c1(p),u_merc_center:new a.c2(p),u_cutoff_params:new a.cS(p)}),rasterParticleTexture:p=>({u_texture:new a.b$(p),u_opacity:new a.c1(p)}),rasterParticleDraw:p=>({u_particle_texture:new a.b$(p),u_particle_texture_side_len:new a.c1(p),u_tile_offset:new a.c2(p),u_velocity:new a.b$(p),u_color_ramp:new a.b$(p),u_velocity_res:new a.c2(p),u_max_speed:new a.c1(p),u_uv_offset:new a.c2(p),u_data_scale:new a.c2(p),u_data_offset:new a.c1(p),u_particle_pos_scale:new a.c1(p),u_particle_pos_offset:new a.c2(p)}),rasterParticleUpdate:p=>({u_particle_texture:new a.b$(p),u_particle_texture_side_len:new a.c1(p),u_velocity:new a.b$(p),u_velocity_res:new a.c2(p),u_max_speed:new a.c1(p),u_speed_factor:new a.c1(p),u_reset_rate:new a.c1(p),u_rand_seed:new a.c1(p),u_uv_offset:new a.c2(p),u_data_scale:new a.c2(p),u_data_offset:new a.c1(p),u_particle_pos_scale:new a.c1(p),u_particle_pos_offset:new a.c2(p)}),snowParticle:p=>({u_modelview:new a.c3(p),u_projection:new a.c3(p),u_time:new a.c1(p),u_cam_pos:new a.c0(p),u_velocityConeAperture:new a.c1(p),u_velocity:new a.c1(p),u_horizontalOscillationRadius:new a.c1(p),u_horizontalOscillationRate:new a.c1(p),u_boxSize:new a.c1(p),u_billboardSize:new a.c1(p),u_simpleShapeParameters:new a.c2(p),u_screenSize:new a.c2(p),u_thinningCenterPos:new a.c2(p),u_thinningShape:new a.c0(p),u_thinningAffectedRatio:new a.c1(p),u_thinningParticleOffset:new a.c1(p),u_particleColor:new a.cS(p),u_direction:new a.c0(p)}),rainParticle:p=>({u_modelview:new a.c3(p),u_projection:new a.c3(p),u_time:new a.c1(p),u_cam_pos:new a.c0(p),u_texScreen:new a.b$(p),u_velocityConeAperture:new a.c1(p),u_velocity:new a.c1(p),u_boxSize:new a.c1(p),u_rainDropletSize:new a.c2(p),u_distortionStrength:new a.c1(p),u_rainDirection:new a.c0(p),u_color:new a.cS(p),u_screenSize:new a.c2(p),u_thinningCenterPos:new a.c2(p),u_thinningShape:new a.c0(p),u_thinningAffectedRatio:new a.c1(p),u_thinningParticleOffset:new a.c1(p),u_shapeDirectionalPower:new a.c1(p),u_shapeNormalPower:new a.c1(p),u_mode:new a.c1(p)}),vignette:p=>({u_vignetteShape:new a.c0(p),u_vignetteColor:new a.cS(p)})},Zo={drawBuilding:function(p,o,d,_){p.currentLayer<p.firstLightBeamLayer&&(p.firstLightBeamLayer=p.currentLayer);const b=d.paint.get("building-ambient-occlusion-ground-intensity"),S=d.paint.get("building-ambient-occlusion-ground-radius"),T=d.paint.get("building-ambient-occlusion-ground-attenuation"),I=d.paint.get("building-opacity");if(I<=0)return;let k=b>0&&S>0,F=!0;const z=d.paint.get("building-vertical-scale");if(z<=0)return;p.shadowRenderer||(F=!1);const q=p.conflationActive&&p.style.isLayerClipped(d,o.getSource()),j=p.style.order.indexOf(d.fqid);if((function(Z,te,ee,oe,se,de){for(const pe of de){const ce=te.getTile(pe).getBucket(ee);ce&&(se&&ce.updateReplacement(pe,Z.replacementSource,oe),ce.uploadUpdatedIndexBuffer(Z.context))}})(p,o,d,j,q,_),(function(Z,te,ee,oe){for(const se of oe){const de=te.getTile(se).getBucket(ee);de&&de.needsEvaluation()&&de.uploadUpdatedColorBuffer(Z.context)}})(p,o,d,_),d.resetLayerRenderingStats(p),p.shadowRenderer&&(p.shadowRenderer.useNormalOffset=!0),p.renderPass==="shadow"&&p.shadowRenderer){const Z=[],te=p.shadowRenderer.getShadowPassDepthMode();Vp({painter:p,source:o,layer:d,coords:_,defines:Z,blendMode:In.disabled,depthMode:te,opacity:I,verticalScale:z,facadeEmissiveChance:0,facadeAOIntensity:0,floodLightIntensity:0,floodLightColor:[0,0,0]})}else if(p.renderPass==="translucent"){let Z=["HAS_ATTRIBUTE_a_part_color_emissive","LIGHTING_3D_MODE"];F&&(Z=Z.concat("RENDER_SHADOWS")),p.shadowRenderer&&p.shadowRenderer.useNormalOffset&&(Z=Z.concat("NORMAL_OFFSET"));const te=d.paint.get("building-facade-emissive-chance"),ee=d.paint.get("building-ambient-occlusion-intensity"),oe=d.paint.get("building-flood-light-intensity"),se=d.paint.get("building-flood-light-color-use-theme").
3298constantOr("default")==="none",de=d.paint.get("building-flood-light-color").toNonPremultipliedRenderColor(se?null:d.lut).toArray01().slice(0,3),pe=d.paint.get("building-flood-light-ground-attenuation"),ce=oe>0,Ce=new rn(p.context.gl.LEQUAL,rn.ReadWrite,p.depthRangeFor3D);I<1&&Vp({painter:p,source:o,layer:d,coords:_,defines:Z,blendMode:In.disabled,depthMode:Ce,opacity:I,verticalScale:z,facadeEmissiveChance:te,facadeAOIntensity:ee,floodLightIntensity:oe,floodLightColor:de,depthOnly:!0});const Se=p.colorModeForRenderPass();Vp({painter:p,source:o,layer:d,coords:_,defines:Z,blendMode:Se,depthMode:Ce,opacity:I,verticalScale:z,facadeEmissiveChance:te,facadeAOIntensity:ee,floodLightIntensity:oe,floodLightColor:de});const Re=d.paint.get("building-front-cutoff");ef(p.transform.pitch,Re,!!p.terrain),k&&Up(p,o,d,_,!0,I,b,S,oe,de,T,q),ce&&Up(p,o,d,_,!1,I,b,S,oe,de,pe,q)}else if(p.renderPass==="light-beam"){const Z=["HAS_ATTRIBUTE_a_part_color_emissive","HAS_ATTRIBUTE_a_bloom_attenuation"],te=new rn(p.context.gl.LEQUAL,rn.ReadOnly,p.depthRangeFor3D);Vp({painter:p,source:o,layer:d,coords:_,defines:Z,blendMode:In.alphaBlended,depthMode:te,opacity:I,verticalScale:z,facadeEmissiveChance:0,facadeAOIntensity:0,floodLightIntensity:0,floodLightColor:[0,0,0]})}p.shadowRenderer&&(p.shadowRenderer.useNormalOffset=!1),p.resetStencilClippingMasks()},drawRasterParticle:function(p,o,d,_,b,S){p.renderPass==="offscreen"&&(function(T,I,k,F){if(!F.length)return;const z=T.context,q=z.gl,j=I.getSource();if(!(j instanceof Sn))return;const Z=Math.ceil(Math.sqrt(k.paint.get("raster-particle-count")));let te=k.particlePositionRGBAImage;if(!te||te.width!==Z){const pe=(function(ce){const Ce=ce*ce,Se=new Uint8Array(4*Ce),Re=.9090909090909091;for(let ve=0;ve<Ce;ve++){const be=Re*(a.ed(2*ve+0)+Yl),Ae=Re*(a.ed(2*ve+1)+Yl),Ne=255*be%1,De=255*Ae%1,Ye=Ne,Ke=Ae-De/255,Tt=De;Se[4*ve+0]=255*(be-Ne/255),Se[4*ve+1]=255*Ye,Se[4*ve+2]=255*Ke,Se[4*ve+3]=255*Tt}return Se})(Z);te=k.particlePositionRGBAImage=new a.q({width:Z,height:Z},pe)}let ee=k.particleFramebuffer;ee?ee.width!==Z&&(ee.destroy(),ee=k.particleFramebuffer=z.createFramebuffer(Z,Z,1,null)):ee=k.particleFramebuffer=z.createFramebuffer(Z,Z,1,null);const oe=[];for(const pe of F){const ce=I.getTile(pe);if(!(ce instanceof vu))continue;const Ce=yw(ce,j,k);if(!Ce)continue;const Se=[ce.tileSize,ce.tileSize];let Re=k.tileFramebuffer;Re||(Re=k.tileFramebuffer=z.createFramebuffer(Se[0],Se[1],1,null));let ve=ce.rasterParticleState;ve||(ve=ce.rasterParticleState=new _w(z,pe,Se,te));const be=ve.update(k.lastInvalidatedAt);ve.particleTextureDimension!==Z&&ve.updateParticleTexture(pe,te);const Ae=ve.targetColorTexture;ve.targetColorTexture=ve.backgroundColorTexture,ve.backgroundColorTexture=Ae;const Ne=ve.particleTexture0;ve.particleTexture0=ve.particleTexture1,ve.particleTexture1=Ne,oe.push([pe,Ce,ve,be])}if(oe.length===0)return;const se=a.o.now(),de=k.previousDrawTimestamp?.001*(se-k.previousDrawTimestamp):.0167;if(k.previousDrawTimestamp=se,k.hasColorMap()){z.activeTexture.set(q.TEXTURE0+2);let pe=k.colorRampTexture;pe||(pe=k.colorRampTexture=new a.T(z,k.colorRamp,q.RGBA8)),pe.bind(q.LINEAR,q.CLAMP_TO_EDGE)}z.bindFramebuffer.set(k.tileFramebuffer.framebuffer),(function(pe,ce,Ce){const Se=pe.context,Re=Se.gl,ve=ce.tileFramebuffer;Se.activeTexture.set(Re.TEXTURE0);const be={u_texture:0,u_opacity:1.05*(Ne=ce.paint.get("raster-particle-fade-opacity-factor"))/(Ne+.05)},Ae=pe.getOrCreateProgram("rasterParticleTexture",{defines:[],overrideFog:!1});var Ne;for(const De of Ce){const[,,Ye,Ke]=De;ve.colorAttachment0.set(Ye.targetColorTexture.texture),Se.viewport.set([0,0,ve.width,ve.height]),Se.clear({color:a.C.transparent}),Ke&&(Ye.backgroundColorTexture.bind(Re.NEAREST,Re.CLAMP_TO_EDGE),Ae.draw(pe,Re.TRIANGLES,rn.disabled,Tn.disabled,In.alphaBlended,pn.disabled,be,ce.id,pe.viewportBuffer,pe.quadTriangleIndexBuffer,pe.viewportSegments))}})(T,k,oe),(function(pe,ce,Ce,Se){const Re=pe.context,ve=Re.gl,be=Ce.tileFramebuffer,Ae=pe.transform.projection.name==="globe",Ne=Ce.paint.get("raster-particle-max-speed");for(const De of Se){const[Ye,Ke,Tt]=De;Re.activeTexture.set(ve.TEXTURE0+0),Ke.texture.bind(ve.LINEAR,ve.CLAMP_TO_EDGE),be.colorAttachment0.set(Tt.targetColorTexture.texture);const Ue=pe.getOrCreateProgram("rasterParticleDraw",{defines:Ke.defines,overrideFog:!1});Re.activeTexture.set(ve.TEXTURE0+1);const rt=Ke.scalarData?[]:[0,1,2,3].map(at=>a.e2[at](Ye));rt.push(Ye);const $e=Ye.canonical.x,ct=Ye.canonical.y;for(const at of rt){const dt=ce.getTile(Ae?at.wrapped():at);if(!dt)continue;const Gt=dt.rasterParticleState;if(!Gt)continue;const Mt=at.canonical.x+(1<<at.canonical.z)*(at.wrap-Ye.wrap),Ct=at.canonical.y;Gt.particleTexture0.bind(ve.NEAREST,ve.CLAMP_TO_EDGE);const xt=pw(1,Gt.particleTexture0.size[0],[Mt-$e,Ct-ct],0,Ke.texture.size,2,Ne,Ke.textureOffset,Ke.scale,Ke.offset);Ue.draw(pe,ve.POINTS,rn.disabled,Tn.disabled,In.alphaBlended,pn.disabled,xt,Ce.id,Gt.particleIndexBuffer,void 0,Gt.particleSegment)}}})(T,I,k,oe),z.bindFramebuffer.set(k.particleFramebuffer.framebuffer),(function(pe,ce,Ce,Se){const Re=pe.context,ve=Re.gl,be=ce.paint.get("raster-particle-max-speed"),Ae=Se*ce.paint.get("raster-particle-speed-factor")*.15,Ne=(function(Ye){return Math.pow(Ye,6)})(.01+1*ce.paint.get("raster-particle-reset-rate-factor")),De=ce.particleFramebuffer;Re.viewport.set([0,0,De.width,De.height]);for(const Ye of Ce){const[,Ke,Tt]=Ye;Re.activeTexture.set(ve.TEXTURE0+0),Ke.texture.bind(ve.LINEAR,ve.CLAMP_TO_EDGE),Re.activeTexture.set(ve.TEXTURE0+1);const Ue=Tt.particleTexture0;Ue.bind(ve.NEAREST,ve.CLAMP_TO_EDGE);const rt=mw(1,Ue.size[0],0,Ke.texture.size,be,Ae,Ne,Ke.textureOffset,Ke.scale,Ke.offset);De.colorAttachment0.set(Tt.particleTexture1.texture),Re.clear({color:a.C.transparent}),pe.getOrCreateProgram("rasterParticleUpdate",{defines:Ke.defines}).draw(pe,ve.TRIANGLES,rn.disabled,Tn.disabled,In.unblended,pn.disabled,rt,ce.id,pe.viewportBuffer,pe.quadTriangleIndexBuffer,pe.viewportSegments)}})(T,k,oe,de)})(p,o,d,_),p.renderPass==="translucent"&&((function(T,I,k,F){const z=T.context,q=z.gl,j=I.getSource().tileSize,Z=5*(1-a.ag(a.cx,a.cx+1,T.transform.zoom))*j+k.paint.get("raster-particle-elevation"),te=!T.options.moving,ee=T.transform.projection.name==="globe";if(!F.length)return;const[oe,se]=T.stencilConfigForOverlap(F),de=[];ee&&de.push("PROJECTION_GLOBE_VIEW");const pe=T.stencilModeFor3D();for(const ce of se){const Ce=ce.toUnwrapped(),Se=I.getTile(ce);if(!Se.rasterParticleState)continue;const Re=Se.rasterParticleState,ve=100;Se.registerFadeDuration(ve);const be=I.findLoadedParent(ce,0),Ae=Kh(Se,be,I,T.transform,ve);let Ne,De;T.terrain&&T.terrain.prepareDrawTile(),z.activeTexture.set(q.TEXTURE0),Re.targetColorTexture.bind(q.LINEAR,q.CLAMP_TO_EDGE),z.activeTexture.set(q.TEXTURE1),be&&be.rasterParticleState?(be.rasterParticleState.targetColorTexture.bind(q.LINEAR,q.CLAMP_TO_EDGE),Ne=Math.pow(2,be.tileID.overscaledZ-Se.tileID.overscaledZ
vendor: 4,412 bytes, line 3298
3298),De=[Se.tileID.canonical.x*Ne%1,Se.tileID.canonical.y*Ne%1]):Re.targetColorTexture.bind(q.LINEAR,q.CLAMP_TO_EDGE);const Ye=ee?T.transform.expandedFarZProjMatrix:T.transform.calculateProjMatrix(Ce,te),Ke=T.transform,Tt=P2(Ke),Ue=a.du(ce.canonical),rt=a.dv(Ue.getCenter().lat);let $e,ct,at,dt,Gt;ee?($e=Float32Array.from(a.dx(a.dy(ce.canonical))),ct=Float32Array.from(Ke.globeMatrix),at=Float32Array.from(a.dt(Ke)),dt=[a.aG(Ke.center.lng),a.aJ(Ke.center.lat)],Gt=Float32Array.from(a.dw(ce.canonical,Ue,rt,Ke.worldSize/Ke._pixelsPerMercatorPixel))):($e=new Float32Array(16),ct=new Float32Array(9),at=new Float32Array(16),dt=[0,0],Gt=new Float32Array(9));const Mt=D0(Ye,$e,ct,at,Gt,De||[0,0],a.ai(T.transform.zoom),dt,Tt,Ne||1,Ae,Z),Ct=T.isTileAffectedByFog(ce),xt=T.getOrCreateProgram("rasterParticle",{defines:de,overrideFog:Ct});if(T.uploadCommonUniforms(z,xt,Ce),ee){const dn=new rn(q.LEQUAL,rn.ReadOnly,T.depthRangeFor3D),an=0,Jt=T.globeSharedBuffers;if(Jt){const[tn,bn,kn]=Jt.getGridBuffers(rt,an!==0);xt.draw(T,q.TRIANGLES,dn,pe,In.alphaBlended,T.renderElevatedRasterBackface?pn.frontCCW:pn.backCCW,Mt,k.id,tn,bn,kn)}}else{const dn=T.depthModeForSublayer(0,rn.ReadOnly),an=oe[ce.overscaledZ],{tileBoundsBuffer:Jt,tileBoundsIndexBuffer:tn,tileBoundsSegments:bn}=T.getTileBoundsBuffers(Se);xt.draw(T,q.TRIANGLES,dn,an,In.alphaBlended,pn.disabled,Mt,k.id,Jt,tn,bn)}}T.resetStencilClippingMasks()})(p,o,d,_),p.style.map.triggerRepaint())},prepareRasterParticle:function(p,o,d){const _=o.getSource();if(!(_ instanceof Sn&&_.loaded()))return;const b=p.sourceLayer||_.rasterLayerIds&&_.rasterLayerIds[0];if(!b)return;const S=p.paint.get("raster-particle-array-band")||_.getInitialBand(b);if(S==null)return;const T=o.getIds().map(I=>o.getTileByID(I));for(const I of T)I.updateNeeded(p.id,S)&&_.prepareTile(I,b,p.id,S)},Rain:class extends Ha{constructor(){super(4.25),this._params={intensity:.5,timeFactor:1,velocityConeAperture:0,velocity:300,boxSize:2500,dropletSizeX:1,dropletSizeYScale:10,distortionStrength:70,screenThinning:{intensity:.57,start:.46,range:1.17,fadePower:.17,affectedRatio:1,particleOffset:-.2},color:{r:.66,g:.68,b:.74,a:.7},direction:{x:-50,y:-35},shapeDirPower:2,shapeNormalPower:1},this._vignetteParams={strength:1,start:.7,range:1,fadePower:.4,color:{r:.27,g:.27,b:.27,a:1}},this.particlesCount=16e3,this._devtoolsFolder=null,this._painter=null}destroy(){super.destroy()}update(p){const o=p.context;if(!this.particlesVx){const d=Jn(this.particlesCount),_=new a.eh,b=new a.dF;let S=0;const T=a.ef(1323123451230);for(let I=0;I<d.length;++I){const k=d[I],F=[2*T()-1,T(),T(),T()];_.emplaceBack(k[0],k[1],k[2],-1,-1,...F),_.emplaceBack(k[0],k[1],k[2],1,-1,...F),_.emplaceBack(k[0],k[1],k[2],1,1,...F),_.emplaceBack(k[0],k[1],k[2],-1,1,...F),b.emplaceBack(S+0,S+1,S+2),b.emplaceBack(S+0,S+2,S+3),S+=4}this.particlesVx=o.createVertexBuffer(_,Is.members),this.particlesIdx=o.createIndexBuffer(b)}}getDrawParams(p){if(!p.style.rain)return null;const o=p.style.rain.state,d=structuredClone(this._params);d.intensity=o.density,d.timeFactor=o.intensity,d.color=structuredClone(o.color),d.screenThinning.intensity=o.centerThinning,d.dropletSizeX=o.dropletSize[0],d.dropletSizeYScale=o.dropletSize[1]/o.dropletSize[0],d.distortionStrength=100*o.distortionStrength;const _=structuredClone(this._vignetteParams);return _.strength=1,_.color=structuredClone(o.vignetteColor),{params:d,vignetteParams:_,revealParams:{revealStart:0,revealRange:.01},direction:structuredClone(o.direction)}}draw(p){const o=this.getDrawParams(p);if(!o)return;const{params:d,revealParams:_,direction:b,vignetteParams:S}=o,T=p.transform.zoom;if(_.revealStart>T)return;const I=Lc(0,1,_.revealStart,_.revealStart+_.revealRange,T);if(!this.particlesVx||!this.particlesIdx)return;S.strength*=I;const k=this.updateOnRender(p,d.timeFactor),F=p.context,z=F.gl,q=p.transform;this.screenTexture&&this.screenTexture.size[0]===p.width&&this.screenTexture.size[1]===p.height||(this.screenTexture=new a.T(F,{width:p.width,height:p.height,data:null},z.RGBA8)),d.distortionStrength>0&&(F.activeTexture.set(z.TEXTURE0),this.screenTexture.bind(z.LINEAR,z.CLAMP_TO_EDGE),z.copyTexSubImage2D(z.TEXTURE_2D,0,0,0,0,0,p.width,p.height));const j=p.getOrCreateProgram("rainParticle");p.uploadCommonUniforms(F,j),F.activeTexture.set(z.TEXTURE0),this.screenTexture.bind(z.LINEAR,z.CLAMP_TO_EDGE);const Z=[d.color.r,d.color.g,d.color.b,d.color.a],te=(ee,oe)=>
vendor: 6,244 bytes, line 3298
3298{const se=Zr(this._movement.getPosition(),ee),de=d.dropletSizeX,pe=d.dropletSizeX*d.dropletSizeYScale,ce=p.width/2,Ce=p.height/2,Se=Lc(0,d.screenThinning.start,0,1,d.screenThinning.intensity),Re=Lc(.001,d.screenThinning.range,0,1,d.screenThinning.intensity),ve=Lc(0,d.screenThinning.particleOffset,0,1,d.screenThinning.intensity),be=(Ae={modelview:k.modelviewMatrix,projection:k.projectionMatrix,time:this._accumulatedTimeFromStart,camPos:se,velocityConeAperture:d.velocityConeAperture,velocity:d.velocity,boxSize:ee,rainDropletSize:[de,pe],distortionStrength:d.distortionStrength,rainDirection:b,color:Z,screenSize:[q.width,q.height],thinningCenterPos:[ce,Ce],thinningShape:[Se,Re,Math.pow(10,d.screenThinning.fadePower)],thinningAffectedRatio:d.screenThinning.affectedRatio,thinningParticleOffset:ve,shapeDirectionalPower:d.shapeDirPower,shapeNormalPower:d.shapeNormalPower,mode:oe?0:1},{u_modelview:Float32Array.from(Ae.modelview),u_projection:Float32Array.from(Ae.projection),u_time:Ae.time,u_cam_pos:Ae.camPos,u_texScreen:0,u_velocityConeAperture:Ae.velocityConeAperture,u_velocity:Ae.velocity,u_boxSize:Ae.boxSize,u_rainDropletSize:Ae.rainDropletSize,u_distortionStrength:Ae.distortionStrength,u_rainDirection:Ae.rainDirection,u_color:Ae.color,u_screenSize:Ae.screenSize,u_thinningCenterPos:Ae.thinningCenterPos,u_thinningShape:Ae.thinningShape,u_thinningAffectedRatio:Ae.thinningAffectedRatio,u_thinningParticleOffset:Ae.thinningParticleOffset,u_shapeDirectionalPower:Ae.shapeDirectionalPower,u_shapeNormalPower:Ae.shapeNormalPower,u_mode:Ae.mode});var Ae;const Ne=Math.round(d.intensity*this.particlesCount),De=a.dB.simpleSegment(0,0,4*Ne,2*Ne);j.draw(p,z.TRIANGLES,rn.disabled,Tn.disabled,In.alphaBlended,pn.disabled,be,"rain_particles",this.particlesVx,this.particlesIdx,De)};d.distortionStrength>0&&te(d.boxSize,!0),te(d.boxSize,!1),this._vignette.draw(p,S)}},Snow:class extends Ha{constructor(){super(2.25),this._params={intensity:.85,timeFactor:.75,velocityConeAperture:70,velocity:40,horizontalOscillationRadius:4,horizontalOscillationRate:1.5,boxSize:2e3,billboardSize:2,shapeFadeStart:.27,shapeFadePower:.21,screenThinning:{intensity:.4,start:.15,range:1.4,fadePower:.24,affectedRatio:1,particleOffset:-.2},color:{r:1,g:1,b:1,a:1},direction:{x:-50,y:-35}},this._vignetteParams={strength:.3,start:.78,range:.46,fadePower:.2,color:{r:1,g:1,b:1,a:1}},this.particlesCount=16e3,this._devtoolsFolder=null,this._painter=null}destroy(){super.destroy()}update(p){const o=p.context;if(!this.particlesVx){const d=Jn(this.particlesCount),_=new a.ei,b=new a.dF;let S=0;const T=a.ef(1323123451230);for(let I=0;I<d.length;++I){const k=d[I],F=T(),z=T(),q=T(),j=[I/d.length,F,z,q],Z=[T(),T()];_.emplaceBack(k[0],k[1],k[2],-1,-1,...j,...Z),_.emplaceBack(k[0],k[1],k[2],1,-1,...j,...Z),_.emplaceBack(k[0],k[1],k[2],1,1,...j,...Z),_.emplaceBack(k[0],k[1],k[2],-1,1,...j,...Z),b.emplaceBack(S+0,S+1,S+2),b.emplaceBack(S+0,S+2,S+3),S+=4}this.particlesVx=o.createVertexBuffer(_,Id.members),this.particlesIdx=o.createIndexBuffer(b)}}getDrawParams(p){if(!p.style.snow)return null;const o=p.style.snow.state,d=structuredClone(this._params);d.intensity=o.density,d.timeFactor=o.intensity,d.color=structuredClone(o.color),d.screenThinning.intensity=o.centerThinning,d.billboardSize=2.79*o.flakeSize;const _=structuredClone(this._vignetteParams);return _.strength=1,_.color=structuredClone(o.vignetteColor),{params:d,vignetteParams:_,revealParams:{revealStart:0,revealRange:.01},direction:structuredClone(o.direction)}}draw(p){const o=this.getDrawParams(p);if(!o)return;const{params:d,revealParams:_,direction:b,vignetteParams:S}=o,T=p.transform.zoom;if(_.revealStart>T)return;const I=Lc(0,1,_.revealStart,_.revealStart+_.revealRange,T);S.strength*=I;const k=this.updateOnRender(p,d.timeFactor);if(!this.particlesVx||!this.particlesIdx)return;const F=p.context,z=F.gl,q=p.transform,j=p.getOrCreateProgram("snowParticle");p.uploadCommonUniforms(F,j),((Z,te,ee)=>{const oe=Zr(this._movement.getPosition(),Z),se=q.width/2,de=q.height/2,pe=Lc(0,ee.screenThinning.start,0,1,ee.screenThinning.intensity),ce=Lc(.001,ee.screenThinning.range,0,1,ee.screenThinning.intensity),Ce=Lc(0,ee.screenThinning.particleOffset,0,1,ee.screenThinning.intensity),Se=(Re={modelview:k.modelviewMatrix,projection:k.projectionMatrix,time:this._accumulatedTimeFromStart,camPos:oe,velocityConeAperture:ee.velocityConeAperture,velocity:ee.velocity,horizontalOscillationRadius:ee.horizontalOscillationRadius,horizontalOscillationRate:ee.horizontalOscillationRate,boxSize:Z,billboardSize:1*ee.billboardSize,simpleShapeParameters:[ee.shapeFadeStart,ee.shapeFadePower],screenSize:[q.width,q.height],thinningCenterPos:[se,de],thinningShape:[pe,ce,Math.pow(10,ee.screenThinning.fadePower)],thinningAffectedRatio:ee.screenThinning.affectedRatio,thinningParticleOffset:Ce,color:[ee.color.r,ee.color.g,ee.color.b,ee.color.a],direction:b},{u_modelview:Float32Array.from(Re.modelview),u_projection:Float32Array.from(Re.projection),u_time:Re.time,u_cam_pos:Re.camPos,u_velocityConeAperture:Re.velocityConeAperture,u_velocity:Re.velocity,u_horizontalOscillationRadius:Re.horizontalOscillationRadius,u_horizontalOscillationRate:Re.horizontalOscillationRate,u_boxSize:Re.boxSize,u_billboardSize:Re.billboardSize,u_simpleShapeParameters:Re.simpleShapeParameters,u_screenSize:Re.screenSize,u_thinningCenterPos:Re.thinningCenterPos,u_thinningShape:Re.thinningShape,u_thinningAffectedRatio:Re.thinningAffectedRatio,u_thinningParticleOffset:Re.thinningParticleOffset,u_particleColor:Re.color,u_direction:Re.direction});var Re;const ve=Math.round(ee.intensity*this.particlesCount),be=a.dB.simpleSegment(0,0,4*ve,2*ve);this.particlesVx&&this.particlesIdx&&j.draw(p,z.TRIANGLES,rn.disabled,Tn.disabled,In.alphaBlended,pn.disabled,Se,"snow_particles",this.particlesVx,this.particlesIdx,be)})(d.boxSize,0,d),this._vignette.draw(p,S)}},shaders:R2,programUniforms:Pd};function jg(p){return[p[0]*a.ej,p[1]*a.ej,p[2]*a.ej,0]}function jp(p,o,d,_,b,S,T,I,k){const F=_.getSource(),z=d.globeSharedBuffers;if(!z)return;let q,j,Z;if(o&&(q=_.getTile(o)),F instanceof a.aY?(j=F.texture,Z=a.dz(0,0,d.transform)):q&&o&&(j=q.texture,Z=a.dz(o.canonical.z,o.canonical.x,d.transform)),!j||!Z)return;p||(Z=a.cE(a.bd(),Z,[1,-1,1]));
3298const te=d.context,ee=te.gl,oe=b.paint.get("raster-resampling")==="nearest"?ee.NEAREST:ee.LINEAR,se=d.colorModeForDrapableLayerRenderPass(S),de=T.defines;de.push("GLOBE_POLES");const pe=new rn(ee.LEQUAL,rn.ReadWrite,d.depthRangeFor3D),ce=d.transform.expandedFarZProjMatrix,Ce=Float32Array.from(a.dx(a.dy(new a.cp(0,0,0))));d.terrain&&d.terrain.prepareDrawTile(),te.activeTexture.set(ee.TEXTURE0),j.bind(oe,ee.CLAMP_TO_EDGE),te.activeTexture.set(ee.TEXTURE1),j.bind(oe,ee.CLAMP_TO_EDGE),"useMipmap"in j&&te.extTextureFilterAnisotropic&&d.transform.pitch>20&&ee.texParameterf(ee.TEXTURE_2D,te.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,te.extTextureFilterAnisotropicMax);const[Se,Re,ve,be]=o?z.getPoleBuffers(o.canonical.z,!1):z.getPoleBuffers(0,!0),Ae=b.paint.get("raster-elevation");let Ne;p?(Ne=Se,d.renderDefaultNorthPole=Ae!==0):(Ne=Re,d.renderDefaultSouthPole=Ae!==0);const De=jg(T.mix),Ye=((Tt,Ue,rt,$e,ct,at,dt,Gt,Mt,Ct,xt,dn,an,Jt)=>Og(Tt,Ue,rt,$e,new Float32Array(16),new Float32Array(9),[0,0],ct,[0,0],[0,0,0,0],1,{opacity:1,mix:0},dt,[0,0],Mt,2,xt,dn,an,1,0,Jt))(d,ce,Ce,Z,a.ai(d.transform.zoom),0,b,0,Ae,0,De,T.offset,T.range,S),Ke=d.getOrCreateProgram("raster",{defines:de});d.uploadCommonUniforms(te,Ke,null),Ke.draw(d,ee.TRIANGLES,pe,k,se,I,Ye,b.id,Ne,ve,be)}function B0(p){if(p.isOrthographic)return[0,0,0,0];const o=p._nearZ,d=p.projection.farthestPixelDistance(p),_=d-o,b=.2*p.height,S=o+b;return[o,d,(S-b-o)/_,(S-o)/_]}function z0(p,o,d,_){if(p)return o instanceof Sn&&p instanceof vu?o.getTextureDescriptor(p,d,!0):{texture:p.texture,mix:jg(_.mix),offset:_.offset,buffer:0,tileSize:1}}const N0=a.bA(new Float32Array(16)),Ta=new a.C(1,0,0,1),Pu=new a.C(0,1,0,1),nf=new a.C(0,0,1,1),Gg=new a.C(1,0,1,1),V0=new a.C(0,1,1,1);function U0(p,o,d,_,b,S,T){const I=p.context,k=p.transform,F=I.gl,z=k.projection.name==="globe",q=z?["PROJECTION_GLOBE_VIEW"]:[];let j=a.bb(d.projMatrix);if(z&&a.ai(k.zoom)>0){const De=a.ek(d.canonical,k),Ye=a.el(De);j=a.aC(new Float32Array(16),k.globeMatrix,Ye),a.aC(j,k.projMatrix,j)}const Z=a.bd();Z[12]+=2*b/(a.o.devicePixelRatio*k.width),Z[13]+=2*S/(a.o.devicePixelRatio*k.height),a.aC(j,Z,j);const te=p.getOrCreateProgram("debug",{defines:q}),ee=o.getTileByID(d.key);p.terrain&&p.terrain.setupElevationDraw(ee,te);const oe=rn.disabled,se=Tn.disabled,de=p.colorModeForRenderPass(),pe="$debug";I.activeTexture.set(F.TEXTURE0),p.emptyTexture.bind(F.LINEAR,F.CLAMP_TO_EDGE),z?ee._makeGlobeTileDebugBuffers(p.context,k):ee._makeDebugTileBoundsBuffers(p.context,k.projection);const ce=ee._tileDebugBuffer||p.debugBuffer,Ce=ee._tileDebugIndexBuffer||p.debugIndexBuffer,Se=ee._tileDebugSegments||p.debugSegments;if(te.draw(p,F.LINE_STRIP,oe,se,de,pn.disabled,Mg(j,_.toPremultipliedRenderColor(null)),pe,ce,Ce,Se,null,null,null,[ee._globeTileDebugBorderBuffer]),T){const De=ee.latestRawTileData,Ye=Math.floor((De&&De.byteLength||0)/1024);let Ke=d.canonical.toString();d.overscaledZ!==d.canonical.z&&(Ke+=` => ${d.overscaledZ}`),Ke+=` ${ee.state}`,Ke+=` ${Ye}kb`,(function(Tt,Ue){Tt.initDebugOverlayCanvas();const rt=Tt.debugOverlayCanvas,$e=Tt.context.gl,ct=Tt.debugOverlayCanvas.getContext("2d");ct.clearRect(0,0,rt.width,rt.height),ct.shadowColor="white",ct.shadowBlur=2,ct.lineWidth=1.5,ct.strokeStyle="white",ct.textBaseline="top",ct.font="bold 36px Open Sans, sans-serif",ct.fillText(Ue,5,5),ct.strokeText(Ue,5,5),Tt.debugOverlayTexture.update(rt),Tt.debugOverlayTexture.bind($e.LINEAR,$e.CLAMP_TO_EDGE)})(p,Ke)}const Re=o.getTile(d).tileSize,ve=512/Math.min(Re,512)*(d.overscaledZ/k.zoom)*.5,be=ee._tileDebugTextBuffer||p.debugBuffer,Ae=ee._tileDebugTextIndexBuffer||p.quadTriangleIndexBuffer,Ne=ee._tileDebugTextSegments||p.debugSegments;te.draw(p,F.TRIANGLES,oe,se,In.alphaBlended,pn.disabled,Mg(j,a.C.transparent.toPremultipliedRenderColor(null),ve),pe,be,Ae,Ne,null,null,null,[ee._globeTileDebugTextBuffer])}function Oc(p,o,d,_){Bs(p,0,o+d/2,p.transform.width,d,_)}function Hg(p,o,d,_){Bs(p,o-d/2,0,d,p.transform.height,_)}function Bs(p,o,d,_,b,S){const T=p.context,I=T.gl;I.enable(I.SCISSOR_TEST),I.scissor(o*a.o.devicePixelRatio,d*a.o.devicePixelRatio,_*a.o.devicePixelRatio,b*a.o.devicePixelRatio),T.clear({color:S}),I.disable(I.SCISSOR_TEST)}const $0=a.ea([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:Wg}=$0;function Kl(p,o,d,_){p.emplaceBack(o,d,_)}class qg{constructor(o){this.vertexArray=new a.em,this.indices=new a.dF,Kl(this.vertexArray,-1,-1,1),Kl(this.vertexArray,1,-1,1),Kl(this.vertexArray,-1,1,1),Kl(this.vertexArray,1,1,1),Kl(this.vertexArray,-1,-1,-1),Kl(this.vertexArray,1,-1,-1),Kl(this.vertexArray,-1,1,-1),Kl(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=o.createVertexBuffer(this.vertexArray,Wg),this.indexBuffer=o.createIndexBuffer(this.indices),this.segment=a.dB.simpleSegment(0,0,36,12)}}function _i(p,o,d,_,b,S){const T=p.context.gl,I=o.paint.get("sky-atmosphere-color"),k=o.paint.get("sky-atmosphere-halo-color"),F=o.paint.get("sky-atmosphere-sun-intensity"),z=((q,j,Z,te,ee)=>({u_matrix_3f:q,u_sun_direction:j,u_sun_intensity:Z,u_color_tint_r:[te.r,te.g,te.b,te.a],u_color_tint_m:[ee.r,ee.g,ee.b,ee.a],u_luminance:5e-5}))(a.ep(a.dH(),_),b,F,I.toPremultipliedRenderColor(null),k.toPremultipliedRenderColor(null));T.framebufferTexture2D(T.FRAMEBUFFER,T.COLOR_ATTACHMENT0,T.TEXTURE_CUBE_MAP_POSITIVE_X+S,o.skyboxTexture,0),d.draw(p,T.TRIANGLES,rn.disabled,Tn.disabled,In.unblended,pn.frontCW,z,"skyboxCapture",o.skyboxGeometry.vertexBuffer,o.skyboxGeometry.indexBuffer,o.skyboxGeometry.segment)}const j0=a.ea([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class G0{constructor(o){const d=new a.eq;d.emplaceBack(-1,1,1,0,0),d.emplaceBack(1,1,1,1,0),d.emplaceBack(1,-1,1,1,1),d.emplaceBack(-1,-1,1,0,1);const _=new a.dF;_.emplaceBack(0,1,2),_.emplaceBack(2,3,0),this.vertexBuffer=o.createVertexBuffer(d,j0.members),this.indexBuffer=o.createIndexBuffer(_),this.segments=a.dB.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}const H0=a.ea([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_size_scale",components:1},{type:"Float32",name:"a_opacity",components:1}]);class Rd{constructor(){this.colorModeAlphaBlendedWriteRGB=new In([1,ql,1,ql],a.C.transparent,[!0,!0,!0,!1]),this.colorModeWriteAlpha=new In([1,0,1,0],a.C.transparent,[!1,!1,!1,!0]),this.params={starsCount:16e3,sizeMultiplier:.15,sizeRange:100,intensityRange:200},this.updateNeeded=!0,this._painter=null,this._devtoolsFolder=null}update(o){this._painter=o;const d=o.context;if(!this.atmosphereBuffer||this.updateNeeded){this.updateNeeded=!1,this.atmosphereBuffer=new G0(d);let _=this.params;const b=_.sizeRange,S=_.intensityRange,T=(function(q){const j=a.ef(30),Z=[];for(let te=0;te<q;++te){const ee=2*Math.PI*j(),oe=Math.acos(1-2*j())-.5*Math.PI;Z.push(a.cU(Math.cos(oe)*Math.cos(ee),Math.cos(oe)*Math.sin(ee),Math.sin(oe)))}return Z})(_.starsCount),I=a.ef(300),k=new a.er,F=new a.dF;let z=0;for(let q=0;q<T.length;++q){const j=a.bN([],T[q],200),Z=Math.max(0,1+.01*b*(1*I()-.5)),te=Math.max(0,1+.01*S*(1*I()-.5));k.emplaceBack(j[0],j[1],j[2],-1,-1,Z,te),k.emplaceBack(j[0],j[1],j[2],
32981,-1,Z,te),k.emplaceBack(j[0],j[1],j[2],1,1,Z,te),k.emplaceBack(j[0],j[1],j[2],-1,1,Z,te),F.emplaceBack(z+0,z+1,z+2),F.emplaceBack(z+0,z+2,z+3),z+=4}this.starsVx=d.createVertexBuffer(k,H0.members),this.starsIdx=d.createIndexBuffer(F),this.starsSegments=a.dB.simpleSegment(0,0,k.length,F.length)}}destroy(){this.atmosphereBuffer&&this.atmosphereBuffer.destroy(),this.starsVx&&this.starsVx.destroy(),this.starsIdx&&this.starsIdx.destroy(),this._painter=null}drawAtmosphereGlow(o,d){const _=o.context,b=_.gl,S=o.transform,T=new rn(b.LEQUAL,rn.ReadOnly,[0,1]),I=a.ai(S.zoom),k=o.style.getLut(d.scope),F=d.properties.get("color-use-theme")==="none",z=d.properties.get("color").toNonPremultipliedRenderColor(F?null:k),q=d.properties.get("high-color-use-theme")==="none",j=d.properties.get("high-color").toNonPremultipliedRenderColor(q?null:k),Z=d.properties.get("space-color-use-theme")==="none",te=d.properties.get("space-color").toNonPremultipliedRenderColor(Z?null:k),ee=5e-4,oe=a.es(d.properties.get("horizon-blend"),0,1,ee,.25),se=a.ds(o,_,S)&&oe===ee?S.worldSize/(2*Math.PI*1.025)-1:S.globeRadius,de=o.frameCounter/1e3%1,pe=a.af(S.globeCenterInViewSpace),ce=Math.sqrt(Math.pow(pe,2)-Math.pow(se,2)),Ce=Math.acos(ce/pe),Se=Re=>{const ve=S.projection.name==="globe"?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"];Re&&ve.push("ALPHA_PASS");const be=o.getOrCreateProgram("globeAtmosphere",{defines:ve}),Ae=((De,Ye,Ke,Tt,Ue,rt,$e,ct,at,dt,Gt,Mt)=>({u_frustum_tl:De,u_frustum_tr:Ye,u_frustum_br:Ke,u_frustum_bl:Tt,u_horizon:Ue,u_transition:rt,u_fadeout_range:$e,u_atmosphere_fog_color:ct.toArray01(),u_high_color:at.toArray01(),u_space_color:dt.toArray01(),u_temporal_offset:Gt,u_horizon_angle:Mt}))(S.frustumCorners.TL,S.frustumCorners.TR,S.frustumCorners.BR,S.frustumCorners.BL,S.frustumCorners.horizon,I,oe,z,j,te,de,Ce);o.uploadCommonUniforms(_,be);const Ne=this.atmosphereBuffer;Ne&&be.draw(o,b.TRIANGLES,T,Tn.disabled,Re?this.colorModeWriteAlpha:this.colorModeAlphaBlendedWriteRGB,pn.backCW,Ae,Re?"atmosphere_glow_alpha":"atmosphere_glow",Ne.vertexBuffer,Ne.indexBuffer,Ne.segments)};Se(!1),Se(!0)}drawStars(o,d){const _=a.aB(d.properties.get("star-intensity"),0,1);if(_===0)return;const b=o.context,S=b.gl,T=o.transform,I=o.getOrCreateProgram("stars"),k=a.bP([]);a.bR(k,k,-T._pitch),a.bQ(k,k,-T.angle),a.bR(k,k,a.am(T._center.lat)),a.et(k,k,-a.am(T._center.lng));const F=a.bV(new Float32Array(16),k),z=a.aC([],T.starsProjMatrix,F),q=a.ep([],F),j=a.eu([],q);let Z=this.params.sizeMultiplier;const te=[0,1,0];a.dJ(te,te,j),a.bN(te,te,Z);const ee=[1,0,0];a.dJ(ee,ee,j),a.bN(ee,ee,Z);const oe=(se=te,de=ee,pe=_,{u_matrix:Float32Array.from(z),u_up:se,u_right:de,u_intensity_multiplier:pe});var se,de,pe;o.uploadCommonUniforms(b,I),this.starsVx&&this.starsIdx&&I.draw(o,S.TRIANGLES,rn.disabled,Tn.disabled,this.colorModeAlphaBlendedWriteRGB,pn.disabled,oe,"atmosphere_stars",this.starsVx,this.starsIdx,this.starsSegments)}}class W0{constructor(){this.visibleTiles=[]}updateBorders(o,d){const _=[],b=[],S=o._getRenderableCoordinates(!1,!0);for(const k of S){const F=o.getTile(k);if(!F.hasData())continue;const z=F.getBucket(d);z&&(z.isEmpty()||(_.push(k.key),b.push({bucket:z,tileID:k.canonical})))}let T=_.length!==this.visibleTiles.length;if(!T){_.sort();for(let k=0;k<_.length;k++)if(_[k]!==this.visibleTiles[k]){T=!0;break}}if(!T)return;const I=new Set;this.visibleTiles=_,b.sort((k,F)=>k.tileID.z-F.tileID.z||k.tileID.x-F.tileID.x||k.tileID.y-F.tileID.y);for(const k of b){const F=new Array,z=new Array,q=k.bucket;for(const j of q.featuresOnBorder)I.has(j.featureId)?z.push(j.footprintIndex):(I.add(j.featureId),F.push(j.footprintIndex));q.updateFootprintHiddenFlags(F,a.ev,!1),q.updateFootprintHiddenFlags(z,a.ev,!0)}}}const zs=new Float64Array(16),Wa=new Float64Array(16),Ru=new Float64Array(16),q0=new Float32Array(16),Dc=[0,0,0];function Xg(p,o,d){const _=d.cameraWorldSizeForFog/d.worldSize;return a.cE(p,d.worldToFogMatrix,[_,_,1]),a.aC(p,p,o),p}function kd(p,o,d,_,b){const S=d.material,T=_.context,{baseColorTexture:I,metallicRoughnessTexture:k}=S.pbrMetallicRoughness,{normalTexture:F,occlusionTexture:z,emissionTexture:q}=S;function j(te,ee,oe){if(te&&(p.push(ee),T.activeTexture.set(T.gl.TEXTURE0+oe),te.gfxTexture)){const{minFilter:se,magFilter:de,wrapS:pe,wrapT:ce}=te.sampler;te.gfxTexture.bindExtraParam(se,de,pe,ce)}}j(I,"HAS_TEXTURE_u_baseColorTexture",5),j(k,"HAS_TEXTURE_u_metallicRoughnessTexture",6),j(F,"HAS_TEXTURE_u_normalTexture",7),j(z,"HAS_TEXTURE_u_occlusionTexture",8),j(q,"HAS_TEXTURE_u_emissionTexture",9),b&&(b.texture||(b.texture=new a.dU(_.context,b.image,[b.image.height,b.image.height,b.image.height],T.gl.RGBA8)),T.activeTexture.set(T.gl.TEXTURE0+10),b.texture&&b.texture.bind(T.gl.LINEAR,T.gl.CLAMP_TO_EDGE),p.push("APPLY_LUT_ON_GPU")),d.texcoordBuffer&&(p.push("HAS_ATTRIBUTE_a_uv_2f"),o.push(d.texcoordBuffer)),d.colorBuffer&&(p.push(d.colorBuffer.itemSize===12?"HAS_ATTRIBUTE_a_color_3f":"HAS_ATTRIBUTE_a_color_4f"),o.push(d.colorBuffer)),d.normalBuffer&&(p.push("HAS_ATTRIBUTE_a_normal_3f"),o.push(d.normalBuffer)),d.pbrBuffer&&(p.push("HAS_ATTRIBUTE_a_pbr"),p.push("HAS_ATTRIBUTE_a_heightBasedEmissiveStrength"),o.push(d.pbrBuffer)),S.alphaMode!=="OPAQUE"&&S.alphaMode!=="MASK"||p.push("UNPREMULT_TEXTURE_IN_SHADER"),S.defined||p.push("DIFFUSE_SHADED");const Z=_.shadowRenderer;Z&&(p.push("RENDER_SHADOWS"),Z.useNormalOffset&&p.push("NORMAL_OFFSET"))}function rf(p,o,d,_,b,S){const T=p.modelOpacity,I=o.context,k=new rn(o.context.gl.LEQUAL,p.isLightMesh?rn.ReadOnly:rn.ReadWrite,o.depthRangeFor3D),F=o.transform,z=p.mesh,q=z.material,j=q.pbrMetallicRoughness,Z=o.style.fog;o.transform.projection.zAxisUnit==="pixels"?zs.set(p.nodeModelMatrix):a.aC(zs,_.zScaleMatrix,p.nodeModelMatrix),a.aC(zs,_.negCameraPosMatrix,zs),a.ba(Wa,zs),a.e9(Wa,Wa);
3298const te=d.paint.get("model-color-use-theme").constantOr("default")==="none",ee=d.paint.get("model-emissive-strength").constantOr(0),oe=Fg(p.worldViewProjection,zs,Wa,null,o,T,j.baseColorFactor,q.emissiveFactor,j.metallicFactor,j.roughnessFactor,q,ee,d,void 0,void 0,p.materialOverride,p.modelColor),se={defines:[]},de=[],pe=o.shadowRenderer;pe&&(pe.useNormalOffset=!1),kd(se.defines,de,z,o,te?null:d.lut);let ce=null;if(Z&&(ce=Xg(Ru,p.nodeModelMatrix,o.transform),F.projection.name!=="globe")){const Re=z.aabb.min,ve=z.aabb.max,[be,Ae]=Z.getOpacityForBounds(ce,Re[0],Re[1],ve[0],ve[1]);se.overrideFog=be>=Cc||Ae>=Cc}const Ce=Sa(o,d.paint.get("model-cutoff-fade-range"));Ce.shouldRenderCutoff&&se.defines.push("RENDER_CUTOFF");const Se=o.getOrCreateProgram("model",se);o.uploadCommonUniforms(I,Se,null,ce,Ce),o.renderPass!=="shadow"&&pe&&pe.setupShadowsFromMatrix(p.nodeModelMatrix,Se),Se.draw(o,I.gl.TRIANGLES,k,b,S,z.material.doubleSided?pn.disabled:pn.backCCW,oe,d.id,z.vertexBuffer,z.indexBuffer,z.segments,d.paint,o.transform.zoom,void 0,de)}function Gp(p,o){return p.style._importedAsBasemap?"basemap":o.scope}function Zg(p,o,d,_,b,S,T,I,k,F){const z=p.transform,q=!!o.isGeometryBloom&&o.isGeometryBloom;if(q&&p.renderPass==="shadow")return;const j=z.projection.name==="globe"?a.eD(d,z):[...d];a.aC(j,j,o.globalMatrix);const Z=a.aC([],_,j);if(o.meshes)for(const te of o.meshes){const ee=I.get(te.material.name);if(ee&&ee.opacity<=0)continue;if(te.material.alphaMode!=="BLEND"){T.push({mesh:te,depth:0,modelIndex:b,worldViewProjection:Z,nodeModelMatrix:j,isLightMesh:q,materialOverride:ee,modelOpacity:k,modelColor:F,node:o,modelMatrix:d});continue}const oe=a.ae([],te.centroid,Z);!z.isOrthographic&&oe[2]<=0||S.push({mesh:te,depth:oe[2],modelIndex:b,worldViewProjection:Z,nodeModelMatrix:j,isLightMesh:q,materialOverride:ee,modelOpacity:k,modelColor:F,node:o,modelMatrix:d})}if(o.children)for(const te of o.children)Zg(p,te,d,_,b,S,T,I,k,F)}function Md(p,o,d,_){const b=d.shadowRenderer;if(!b)return;const S=b.getShadowPassDepthMode(),T=b.calculateShadowPassMatrixFromMatrix(o),I=aw(T);d.getOrCreateProgram("modelDepth").draw(d,d.context.gl.TRIANGLES,S,Tn.disabled,In.disabled,pn.disabled,I,_.id,p.vertexBuffer,p.indexBuffer,p.segments,_.paint,d.transform.zoom,void 0,void 0)}function X0(p,o,d,_){const b=(function(z,q){if(q.footprintDebugMesh)return q.footprintDebugMesh;if(!q.footprint)return null;const j=z.context,Z=q.footprint.vertices,te=q.footprint.indices,ee=new a.dE;ee.reserve(Z.length);for(const Ae of Z)ee.emplaceBack(Ae.x,Ae.y);const oe=new a.dF;oe.reserve(te.length);for(let Ae=0;Ae<te.length;Ae+=3)oe.emplaceBack(te[Ae],te[Ae+1],te[Ae+2]);const se=j.createVertexBuffer(ee,a.dA.members),de=j.createIndexBuffer(oe),pe=a.dB.simpleSegment(0,0,Z.length,te.length),ce=q.id||q.name||"footprint";let Ce;const Se=parseInt(ce,10);Ce=isNaN(Se)?(function(Ae){let Ne=0;for(let De=0;De<Ae.length;De++)Ne=(Ne<<5)-Ne+Ae.charCodeAt(De)|0;return Ne})(ce):Se;const Re=a.ed(Ce),ve=a.ed(Ce+1),be=a.ed(Ce+2);return q.footprintDebugMesh={vertexBuffer:se,indexBuffer:de,segments:pe,color:new a.C(Re,ve,be,.5)},q.footprintDebugMesh})(p,d);if(!b)return;const S=p.context,T=S.gl,I=p.getOrCreateProgram("debug"),k=b.color,F=rn.disabled;S.activeTexture.set(T.TEXTURE0),p.emptyTexture.bind(T.LINEAR,T.CLAMP_TO_EDGE),I.draw(p,T.TRIANGLES,F,Tn.disabled,In.alphaBlended,pn.disabled,Mg(_,k.toPremultipliedRenderColor(null)),"$debug",b.vertexBuffer,b.indexBuffer,b.segments)}function vw(p,o,d,_,b,S){for(const T of b){const I=Object.assign({},_);I.part=T;const k={type:"Unknown",id:o,properties:I},F={orientation:p.paint.get("model-rotation").evaluate(k,d)};S.set(T,F)}}function bw(p,o,d,_,b,S){for(const T of b){const I=Object.assign({},_);I.part=T;const k={type:"Unknown",id:o,properties:I},F={color:p.paint.get("model-color").evaluate(k,d),colorMix:p.paint.get("model-color-mix-intensity").evaluate(k,d),opacity:p.paint.get("model-opacity").evaluate(k,d),emissionStrength:p.paint.get("model-emissive-strength").evaluate(k,d)};S.set(T,F)}}function Z0(p,o,d,_,b){let S=!1;for(const I of _)I.modelOpacity!==1&&(rf(I,p,o,b[I.modelIndex],Tn.disabled,In.disabled),S=!0);for(const I of _)rf(I,p,o,b[I.modelIndex],I.modelOpacity!==1?p.stencilModeFor3D():Tn.disabled,p.colorModeForRenderPass());S&&p.resetStencilClippingMasks();const T=In.additive;for(const I of d)rf(I,p,o,b[I.modelIndex],Tn.disabled,I.isLightMesh?T:p.colorModeForRenderPass())}function xw(p,o,d){const _=o.updateZoomBasedPaintProperties(),b=(function(S,T,I){let k,F,z,q=S.terrain?S.terrain.exaggeration():0;if(S.terrain&&q>0){const j=S.terrain,Z=j.findDEMTileFor(I);Z&&Z.dem?k=a.eF.create(j,I,Z):q=0}if(q===0&&(T.terrainElevationMin=0,T.terrainElevationMax=0),q===T.validForExaggeration&&(q===0||k&&k._demTile&&k._demTile.tileID===T.validForDEMTile.id&&k._dem._timestamp===T.validForDEMTile.timestamp))return!1;for(const j in T.instancesPerModel){const Z=T.instancesPerModel[j];for(let te=0;te<Z.instancedDataArray.length;++te){const ee=(k?q*k.getElevationAt(0|Z.instancedDataArray.float32[16*te],0|Z.instancedDataArray.float32[16*te+1],!0,!0):0)+Z.instancesEvaluatedElevation[te];Z.instancedDataArray.float32[16*te+6]=ee,F=F?Math.min(T.terrainElevationMin,ee):ee,z=z?Math.max(T.terrainElevationMax,ee):ee}}return T.terrainElevationMin=F||0,T.terrainElevationMax=z||0,T.validForExaggeration=q,T.validForDEMTile=k&&k._demTile?{id:k._demTile.tileID,timestamp:k._dem._timestamp}:{id:void 0,timestamp:0},!0})(p,o,d);(_||b)&&(o.uploaded=!1,o.upload(p.context))}const bl={shadowUniformsInitialized:!1,useSingleShadowCascade:!1,tileMatrix:new Float64Array(16),shadowTileMatrix:new Float32Array(16),aabb:new a.cY([0,0,0],[a.ak,a.ak,0])};function ww(p,o){const d=1<<p.canonical.z,_=o.getFreeCameraOptions().position,b=o.elevation,S=p.canonical.x/d,T=(p.canonical.x+1)/d,I=p.canonical.y/d,k=(p.canonical.y+1)/d;let F=o._centerAltitude;if(b){const Z=b.getMinMaxForTile(p);Z&&Z.max>F&&(F=Z.max)}const z=a.aB(_.x,S,T)-_.x,q=a.aB(_.y,I,k)-_.y,j=a.bY(F,o.center.lat)-_.z;return o._zoomFromMercatorZ(Math.sqrt(z*z+q*q+j*j))}function Y0(p,o,d,_,b,S,T){const I=p.context,k=p.renderPass==="shadow",F=p.shadowRenderer,z=k&&F?F.getShadowPassDepthMode():new rn(I.gl.LEQUAL,rn.ReadWrite,p.depthRangeFor3D),q=p.isTileAffectedByFog(S),j=p.transform.projection.name==="globe";if(d.meshes)for(const Z of d.meshes){const te=j?[]:["MODEL_POSITION_ON_GPU"],ee=[];let oe,se,de;const pe=!j&&_.instancedDataArray.length>20;pe&&te.push("INSTANCED_ARRAYS");const ce=Sa(p,o.paint.get("model-cutoff-fade-range"));if(ce.shouldRenderCutoff&&te.push("RENDER_CUTOFF"),k&&F)oe=p.getOrCreateProgram("modelDepth",{defines:te}),se=aw(T.shadowTileMatrix,T.shadowTileMatrix,d.globalMatrix),de=In.disabled;
3298else{kd(te,ee,Z,p,o.paint.get("model-color-use-theme").constantOr("default")==="none"?null:o.lut),oe=p.getOrCreateProgram("model",{defines:te,overrideFog:q});const Se=Z.material,Re=Se.pbrMetallicRoughness,ve=o.paint.get("model-opacity").constantOr(1),be=o.paint.get("model-emissive-strength").constantOr(0);se=Fg(S.expandedProjMatrix,d.globalMatrix,q0,null,p,ve,Re.baseColorFactor,Se.emissiveFactor,Re.metallicFactor,Re.roughnessFactor,Se,be,o,b),F&&(T.shadowUniformsInitialized?oe.setShadowUniformValues(I,F.getShadowUniformValues()):(F.setupShadows(S.toUnwrapped(),oe,"model-tile"),T.shadowUniformsInitialized=!0)),de=ce.shouldRenderCutoff||ve<1||Se.alphaMode!=="OPAQUE"?In.alphaBlended:In.unblended}p.uploadCommonUniforms(I,oe,S.toUnwrapped(),null,ce);const Ce=Z.material.doubleSided?pn.disabled:pn.backCCW;if(pe)ee.push(_.instancedDataBuffer),oe.draw(p,I.gl.TRIANGLES,z,Tn.disabled,de,Ce,se,o.id,Z.vertexBuffer,Z.indexBuffer,Z.segments,o.paint,p.transform.zoom,void 0,ee,_.instancedDataArray.length);else{const Se=k?"u_instance":"u_normal_matrix";for(let Re=0;Re<_.instancedDataArray.length;++Re)se[Se]=new Float32Array(_.instancedDataArray.arrayBuffer,64*Re,16),oe.draw(p,I.gl.TRIANGLES,z,Tn.disabled,de,Ce,se,o.id,Z.vertexBuffer,Z.indexBuffer,Z.segments,o.paint,p.transform.zoom,void 0,ee)}}if(d.children)for(const Z of d.children)Y0(p,o,Z,_,b,S,T)}const Sw=[1,-1,1];function Tw(p,o,d,_){const b=p.node;if(b.lodMeshes&&b.lodMeshes.length>0)if(p.targetLod<0)p.targetLod=o>_?1:0;else{const S=d/1e3;p.targetLod=o>_?Math.min(p.targetLod+S,1):Math.max(p.targetLod-S,0)}
3298else p.targetLod=0}function Ew(p,o,d,_){if(!d.modelManager)return!0;const b=d.modelManager;if(!d.shadowRenderer)return!0;const S=d.shadowRenderer,T=o.aabb;let I=!0,k=p.maxHeight;if(k===0){let z=0;for(const q in p.instancesPerModel){const j=b.getModel(q,_);j?z=Math.max(z,Math.max(Math.max(j.aabb.max[0],j.aabb.max[1]),j.aabb.max[2])):I=!1}k=p.maxScale*z*1.41+p.maxVerticalOffset,I&&(p.maxHeight=k)}T.max[2]=k,T.min[2]+=p.terrainElevationMin,T.max[2]+=p.terrainElevationMax,a.ae(T.min,T.min,o.tileMatrix),a.ae(T.max,T.max,o.tileMatrix);const F=T.intersects(S.getCurrentCascadeFrustum());return d.currentShadowCascade===0&&(p.isInsideFirstShadowMapFrustum=F===2),F===0}function L2(p,o){const d=p.uniformValues.u_cutoff_params[0],_=p.uniformValues.u_cutoff_params[1],b=p.uniformValues.u_cutoff_params[2],S=p.uniformValues.u_cutoff_params[3];return _===d||S===b?1:a.aB(((o-d)/(_-d)-b)/(S-b),0,1)}function O2(p,o,d,_){if(o.pitch<20)return 1;const b=o.getWorldToCameraMatrix();a.aC(b,b,p);const S=a.bw(d.min[0],d.min[1],d.min[2],1);let T=a.aD(a.bI(),S,b),I=T,k=T;S[1]=d.max[1],T=a.aD(a.bI(),S,b),I=T[1]<I[1]?T:I,k=T[1]>k[1]?T:k,S[0]=d.max[0],T=a.aD(a.bI(),S,b),I=T[1]<I[1]?T:I,k=T[1]>k[1]?T:k,S[1]=d.min[1],T=a.aD(a.bI(),S,b),I=T[1]<I[1]?T:I,k=T[1]>k[1]?T:k;const F=a.aB(_[0],0,1),z=100*o.pixelsPerMeter*a.aB(_[1],0,1),q=a.aB(_[2],0,1),j=a.eG(a.bI(),I,k,F),Z=Math.tan(.5*o.fovX),te=-j[2]*Z;if(z===0)return j[1]<-Math.abs(te)?q:1;const ee=(-Math.abs(te)-j[1])/z,oe=(de,pe,ce)=>(1-ce)*de+ce*pe,se=a.aB(oe(1,q,ee),q,1);return oe(1,se,a.aB((o.pitch-20)/20,0,1))}class D2{}class Wr{constructor(){this._storage=new Map}getLinesFromTrianglesBuffer(o,d,_){{const q=this._storage.get(d.id);if(q)return q.lastUsedFrameIdx=o,q.buf}const b=_.gl,S=b.getBufferParameter(b.ELEMENT_ARRAY_BUFFER,b.BUFFER_SIZE),T=new ArrayBuffer(S),I=new Int16Array(T);b.getBufferSubData(b.ELEMENT_ARRAY_BUFFER,0,new Int16Array(T));const k=new a.eI;for(let q=0;q<S/2;q+=3){const j=I[q],Z=I[q+1],te=I[q+2];k.emplaceBack(j,Z),k.emplaceBack(Z,te),k.emplaceBack(te,j)}const F=_.bindVertexArrayOES.current,z=new D2;return z.buf=new Eu(_,k),z.lastUsedFrameIdx=o,this._storage.set(d.id,z),_.bindVertexArrayOES.set(F),z.buf}update(o){for(const[d,_]of this._storage)o-_.lastUsedFrameIdx>30&&(_.buf.destroy(),this._storage.delete(d))}destroy(){for(const[o,d]of this._storage)d.buf.destroy(),this._storage.delete(o)}}class of{constructor(){this.occluderSize=30,this.depthOffset=-1e-4}}const Yg={symbol:function(p,o,d,_,b){if(p.renderPass!=="translucent")return;const S=Tn.disabled,T=p.colorModeForRenderPass(),I=d.layout.get("text-variable-anchor"),k=d.layout.get("text-size-scale-range"),F=a.aB(p.scaleFactor,k[0],k[1]);I&&(function(j,Z,te,ee,oe,se,de,pe){const ce=Z.transform,Ce=oe==="map",Se=se==="map";for(const Re of j){const ve=ee.getTile(Re),be=ve.getBucket(te);if(!be||!be.text||!be.text.segments.get().length)continue;const Ae=a.bl(be.textSizeData,ce.zoom,pe),Ne=_s(Re,be.getProjection(),ce),De=ce.calculatePixelsToTileUnitsMatrix(ve),Ye=Zi(Ne,ve.tileID.canonical,Se,Ce,ce,be.getProjection(),De),Ke=be.hasIconTextFit()&&be.hasIconData();Ae&&cw(be,Ce,Se,de,ce,Ye,Re,Math.pow(2,ce.zoom-ve.tileID.overscaledZ),Ae,Ke)}})(_,p,d,o,d.layout.get("text-rotation-alignment"),d.layout.get("text-pitch-alignment"),b,F);const z=d.paint.get("icon-opacity").constantOr(1)!==0,q=d.paint.get("text-opacity").constantOr(1)!==0;d.layout.get("symbol-sort-key").constantOr(1)!==void 0&&(z||q)?yl(p,o,d,_,S,T):(z&&yl(p,o,d,_,S,T,{onlyIcons:!0}),q&&yl(p,o,d,_,S,T,{onlyText:!0})),o.map.showCollisionBoxes&&(R0(p,o,d,_,d.paint.get("text-translate"),d.paint.get("text-translate-anchor"),!0),R0(p,o,d,_,d.paint.get("icon-translate"),d.paint.get("icon-translate-anchor"),!1))},circle:function(p,o,d,_){if(p.renderPass!=="translucent")return;const b=d.paint.get("circle-opacity"),S=d.paint.get("circle-stroke-width"),T=d.paint.get("circle-stroke-opacity"),I=d.layout.get("circle-sort-key").constantOr(1)!==void 0,k=d.paint.get("circle-emissive-strength");if(b.constantOr(1)===0&&(S.constantOr(1)===0||T.constantOr(1)===0))return;const F=p.context,z=F.gl,q=p.transform,j=!(!p.terrain||!p.terrain.enabled),Z=d.layout.get("
3298circle-elevation-reference"),te=p.depthModeForSublayer(0,rn.ReadOnly),ee=new rn(p.context.gl.LEQUAL,rn.ReadOnly,p.depthRangeFor3D),oe=Z==="none"||j?te:ee,se=Tn.disabled,de=p.colorModeForDrapableLayerRenderPass(k),pe=q.projection.name==="globe",ce=[a.aG(q.center.lng),a.aJ(q.center.lat)],Ce=[];for(let Re=0;Re<_.length;Re++){const ve=_[Re],be=o.getTile(ve),Ae=be.getBucket(d);if(!Ae||Ae.projection.name!==q.projection.name)continue;const Ne=Ae.programConfigurations.get(d.id),De=Ae.layoutVertexBuffer,Ye=Ae.globeExtVertexBuffer,Ke=Ae.indexBuffer,Tt=a.dV(d),Ue=[Ye],rt=p.isTileAffectedByFog(ve);pe&&Tt.push("PROJECTION_GLOBE_VIEW"),Tt.push("DEPTH_D24"),p.terrain&&q.depthOcclusionForSymbolsAndCircles&&Tt.push("DEPTH_OCCLUSION"),Ae.hasElevation&&!p.terrain&&(Tt.push("ELEVATED_ROADS"),Ue.push(Ae.elevatedLayoutVertexBuffer));const $e=p.getOrCreateProgram("circle",{config:Ne,defines:Tt,overrideFog:rt}),ct=q.projection.createInversionMatrix(q,ve.canonical),at={programConfiguration:Ne,program:$e,layoutVertexBuffer:De,dynamicBuffers:Ue,indexBuffer:Ke,uniformValues:a.dW(p,ve,be,ct,ce,d),tile:be};if(I){const dt=Ae.segments.get();for(const Gt of dt)Ce.push({segments:new a.dB([Gt]),sortKey:Gt.sortKey,state:at})}else Ce.push({segments:Ae.segments,sortKey:0,state:at})}I&&Ce.sort((Re,ve)=>Re.sortKey-ve.sortKey);const Se={useDepthForOcclusion:q.depthOcclusionForSymbolsAndCircles};for(const Re of Ce){const{programConfiguration:ve,program:be,layoutVertexBuffer:Ae,dynamicBuffers:Ne,indexBuffer:De,uniformValues:Ye,tile:Ke}=Re.state,Tt=Re.segments;p.terrain&&p.terrain.setupElevationDraw(Ke,be,Se),p.uploadCommonUniforms(F,be,Ke.tileID.toUnwrapped()),be.draw(p,z.TRIANGLES,oe,se,de,pn.disabled,Ye,d.id,Ae,De,Tt,d.paint,q.zoom,ve,Ne)}},heatmap:function(p,o,d,_){if(d.paint.get("heatmap-opacity")!==0)if(p.renderPass==="offscreen"){const b=p.context,S=b.gl,T=Tn.disabled,I=new In([S.ONE,S.ONE,S.ONE,S.ONE],a.C.transparent,[!0,!0,!0,!0]),k=p.transform.projection.name==="globe"?.5:.25;d.heatmapFbo=Cu.createWithTexture(b,d.heatmapFbo,p.width*k,p.height*k),b.clear({color:a.C.transparent});const F=p.transform,z=F.projection.name==="globe",q=z?["PROJECTION_GLOBE_VIEW"]:[],j=z?pn.frontCCW:pn.disabled,Z=[a.aG(F.center.lng),a.aJ(F.center.lat)];for(let te=0;te<_.length;te++){const ee=_[te];if(o.hasRenderableParent(ee))continue;const oe=o.getTile(ee),se=oe.getBucket(d);if(!se||se.projection.name!==F.projection.name)continue;const de=p.isTileAffectedByFog(ee),pe=se.programConfigurations.get(d.id),ce=p.getOrCreateProgram("heatmap",{config:pe,defines:q,overrideFog:de}),{zoom:Ce}=p.transform;p.terrain&&p.terrain.setupElevationDraw(oe,ce),p.uploadCommonUniforms(b,ce,ee.toUnwrapped());const Se=F.projection.createInversionMatrix(F,ee.canonical);ce.draw(p,S.TRIANGLES,rn.disabled,T,I,j,rw(p,ee,oe,Se,Z,Ce,d.paint.get("heatmap-intensity")),d.id,se.layoutVertexBuffer,se.indexBuffer,se.segments,d.paint,p.transform.zoom,pe,z?[se.globeExtVertexBuffer]:null)}b.viewport.set([0,0,p.width,p.height])}else p.renderPass==="translucent"&&(p.context.setColorMode(p.colorModeForRenderPass()),(function(b,S){const T=b.context,I=T.gl,k=S.heatmapFbo;if(!k)return;T.activeTexture.set(I.TEXTURE0),I.bindTexture(I.TEXTURE_2D,k.colorAttachment0.get()),T.activeTexture.set(I.TEXTURE1);let F=S.colorRampTexture;F||(F=S.colorRampTexture=new a.T(T,S.colorRamp,I.RGBA8)),F.bind(I.LINEAR,I.CLAMP_TO_EDGE),b.getOrCreateProgram("heatmapTexture").draw(b,I.TRIANGLES,rn.disabled,Tn.disabled,b.colorModeForRenderPass(),pn.disabled,((z,q)=>({u_image:0,u_color_ramp:1,u_opacity:q.paint.get("heatmap-opacity")}))(0,S),S.id,b.viewportBuffer,b.quadTriangleIndexBuffer,b.viewportSegments,S.paint,b.transform.zoom)})(p,d))},line:function(p,o,d,_){const b=d.paint.get("line-opacity"),S=d.paint.get("line-width");if(b.constantOr(1)===0||S.constantOr(1)===0)return;const T=d.paint.get("line-blend-mode"),I=p.terrain&&p.terrain.renderingToTexture;if(T==="default"||p.transform.projection.name==="globe")p.renderPass==="translucent"&&Tr(p,o,d,_);else{if(I)return void(function(k,F,z,q,j){if(k.renderPass!=="translucent")return;const Z=k.context,te=Z.gl,ee=k.terrain;if(!ee)return;const oe=Z.bindFramebuffer.current,se=k.emissiveMode==="mrt-fallback",de=ee.drapeBufferSize[0],pe=ee.drapeBufferSize[1];z.lineBlendFbos||(z.lineBlendFbos=new Bp),z.lineBlendFbos.drapeFbo=Cu.createWithTexture(Z,z.lineBlendFbos.drapeFbo,de,pe,!0),se&&te.drawBuffers([te.COLOR_ATTACHMENT0]),Z.clear({color:zp[j].clearColor,depth:1,stencil:0});const ce=k.currentStencilSource,Ce=k._tileClippingMaskIDs,Se=k.nextStencilID;k.currentStencilSource=void 0,k._tileClippingMaskIDs={},k.nextStencilID=1;const Re=k._terrain;k._terrain=null,k._renderTileClippingMasks(z,F,q),Tr(k,F,z,q,zg(j,k.context),!0),k._terrain=Re,k.currentStencilSource=ce,k._tileClippingMaskIDs=Ce,k.nextStencilID=Se,se&&te.drawBuffers([te.COLOR_ATTACHMENT0,te.COLOR_ATTACHMENT1]);const ve=ee.drapeBufferSize,be=z.lineBlendFbos&&z.lineBlendFbos.drapeFbo;be&&(j==="additive"&&Au(k,z,be),Mc(k,z,j,be,oe,ve))})(p,o,d,_,T);if(p.renderPass==="offscreen")return void(function(k,F,z,q,j){const Z=k.context,te=Math.ceil(k.width),ee=Math.ceil(k.height);z.lineBlendFbos||(z.lineBlendFbos=new Bp),z.lineBlendFbos.fbo=Cu.createWithTexture(Z,z.lineBlendFbos.fbo,te,ee,!0),Z.clear({color:zp[j].clearColor,depth:1,stencil:0});const oe=k.currentStencilSource,se=k._tileClippingMaskIDs,de=k.nextStencilID;k.currentStencilSource=void 0,k._tileClippingMaskIDs={},k.nextStencilID=1,k._renderTileClippingMasks(z,F,q);const pe=k.renderPass;k.renderPass="translucent",Tr(k,F,z,q,zg(j,k.context)),k.renderPass=pe,k.currentStencilSource=oe,k._tileClippingMaskIDs=se,k.nextStencilID=de,Z.viewport.set([0,0,k.width,k.height]),j==="additive"&&Au(k,z,z.lineBlendFbos.fbo)})(p,o,d,_,T);if(p.renderPass==="translucent"){const k=d.lineBlendFbos&&d.lineBlendFbos.fbo;return void(k&&Mc(p,d,T,k,null))}}},fill:function(p,o,d,_){const b=d.paint.get("fill-color"),S=d.paint.get("fill-opacity");if(S.constantOr(1)===0)return;const T=d.paint.get("fill-emissive-strength"),I=p.colorModeForDrapableLayerRenderPass(T),k=d.paint.get("fill-pattern"),F=p.opaquePassEnabledForLayer()&&!k.constantOr(1)&&b.constantOr(a.C.transparent).a===1&&S.constantOr(0)===1?"opaque":"translucent";let z="none";d.layout.get("fill-elevation-reference")!=="none"?z="road":d.paint.get("fill-z-offset").constantOr(1)!==0&&(z="offset");const q=!(!p.terrain||!p.terrain.enabled),j={painter:p,sourceCache:o,layer:d,coords:_,colorMode:I,elevationType:z,terrainEnabled:q,pass:F};if(p.renderPass==="shadow")return void(p.shadowRenderer&&z==="road"&&!q&&(function(te){const{painter:ee,sourceCache:oe,layer:se,coords:de}=te,pe=ee.context.gl,ce=te.painter.shadowRenderer;for(const Ce of de){const Se=oe.getTile(Ce),Re=Se.getBucket(se);if(!Re)continue;const ve=Re.elevatedStructures;if(!ve||!ve.shadowCasterSegments||ve.shadowCasterSegments.segments[0].primitiveLength===0)continue;ee.prepareDrawTile();const be=Re.bufferData.programConfigurations.get(se.id),Ae=ee.isTileAffectedByFog(Ce),Ne=ee.getOrCreateProgram("elevatedStructuresDepth",{config:be,overrideFog:Ae}),De=ce.calculateShadowPassMatrixFromTile(Se.tileID.toUnwrapped());ee.uploadCommonUniforms(ee.context,Ne,Ce.toUnwrapped());const Ye=Q1(De,0);Ne.draw(ee,pe.TRIANGLES,ce.getShadowPassDepthMode(),Tn.disabled,In.disabled,pn.disabled,Ye,se.id,ve.vertexBuffer,ve.indexBuffer,ve.shadowCasterSegments,se.paint,ee.transform.zoom,be)}})(j));const Z=p.emissiveMode==="mrt-fallback";if(z!=="offset"){if(Iu(j,!1,Z),z==="road"){const te=!q&&p.renderPass==="translucent";te&&Dt(p,o,d,_,"geometry"),Iu(j,!0,Z,Tn.disabled),te&&(function(ee){const{painter:oe,sourceCache:se,layer:de,coords:pe,colorMode:ce}=ee,Ce=oe.context.gl,Se=ee.painter.shadowRenderer,Re=!!Se&&Se.enabled,ve=new rn(oe.context.gl.LEQUAL,rn.ReadOnly,oe.depthRangeFor3D);let be=[0,0,0];if(Re){const Ne=oe.style.directionalLight,De=oe.style.ambientLight;Ne&&De&&(be=xd(oe.style,Ne,De))}const Ae=Ne=>{for(const De of pe){const Ye=se.getTile(De),Ke=Ye.getBucket(de);if(!Ke)continue;const Tt=Ke.elevatedStructures;if(!Tt)continue;let Ue,rt;if(Ne?(Ue=Tt.renderableBridgeSegments,rt=Tt.bridgeProgramConfigurations.get(de.id)):(Ue=Tt.renderableTunnelSegments,rt=Tt.tunnelProgramConfigurations.get(de.id)),!Ue||Ue.segments[0].primitiveLength===0)continue;rt.updatePaintBuffers(),oe.prepareDrawTile();const $e=oe.isTileAffectedByFog(De),ct=[];Re&&ct.push("RENDER_SHADOWS","NORMAL_OFFSET");const at=oe.getOrCreateProgram("elevatedStructures",{config:rt,overrideFog:$e,defines:ct}),dt=oe.translatePosMatrix(De.projMatrix,Ye,de.paint.get("fill-translate"),de.paint.get("fill-translate-anchor"));Re&&Se.setupShadows(Ye.tileID.toUnwrapped(),at,"vector-tile");const Gt=T0(dt,be);oe.uploadCommonUniforms(oe.context,at,De.toUnwrapped()),at.draw(oe,Ce.TRIANGLES,ve,Tn.disabled,ce,pn.backCCW,Gt,de.id,Tt.vertexBuffer,Tt.indexBuffer,
3298Ue,de.paint,oe.transform.zoom,rt,[Tt.vertexBufferNormal])}};Ae(!0),Ae(!1)})(j)}}else Iu(j,!1,Z,p.stencilModeFor3D())},"fill-extrusion":function(p,o,d,_){const b=d.paint.get("fill-extrusion-opacity"),S=p.context,T=S.gl,I=p.terrain,k=I&&I.renderingToTexture;if(b===0)return;const F=p.emissiveMode==="mrt-fallback",z=p.conflationActive&&p.style.isLayerClipped(d,o.getSource()),q=p.style.order.indexOf(d.fqid);if(z&&(function(j,Z,te,ee,oe){for(const se of ee){const de=Z.getTile(se).getBucket(te);de&&(de.updateReplacement(se,j.replacementSource,oe),de.uploadCentroid(j.context))}})(p,o,d,_,q),I||z)for(const j of _){const Z=o.getTile(j).getBucket(d);Z&&Vg(p.context,o,j,Z,d,I,z)}if(p.renderPass==="shadow"&&p.shadowRenderer){if(I&&b<.65&&d._transitionablePaint._values["fill-extrusion-opacity"].value.expression instanceof a.ac)return;const j=p.shadowRenderer.getShadowPassDepthMode();ze(p,o,d,_,j,Tn.disabled,In.disabled,z)}else if(p.renderPass==="translucent"){const j=!d.paint.get("fill-extrusion-pattern").constantOr(1),Z=d.paint.get("fill-extrusion-color").constantOr(a.C.white);if(!k&&Z.a!==0){const te=new rn(p.context.gl.LEQUAL,rn.ReadWrite,p.depthRangeFor3D);b===1&&j?ze(p,o,d,_,te,Tn.disabled,In.unblended,z):(ze(p,o,d,_,te,Tn.disabled,In.disabled,z),ze(p,o,d,_,te,p.stencilModeFor3D(),p.colorModeForRenderPass(),z),p.resetStencilClippingMasks())}if(p.style.enable3dLights()&&j&&(!I&&p.transform.projection.name!=="globe"||k)){const te=d.paint.get("fill-extrusion-opacity"),ee=d.paint.get("fill-extrusion-ambient-occlusion-intensity"),oe=d.paint.get("fill-extrusion-ambient-occlusion-ground-radius"),se=d.paint.get("fill-extrusion-flood-light-intensity"),de=d.paint.get("fill-extrusion-flood-light-color-use-theme").constantOr("default")==="none",pe=d.paint.get("fill-extrusion-flood-light-color").toNonPremultipliedRenderColor(de?null:d.lut).toArray01().slice(0,3),ce=ee>0&&oe>0,Ce=se>0,Se=(be,Ae,Ne)=>(1-Ne)*be+Ne*Ae,Re=new O0;Re.translate=d.paint.get("fill-extrusion-translate"),Re.translateAnchor=d.paint.get("fill-extrusion-translate-anchor"),Re.edgeRadius=d.layout.get("fill-extrusion-edge-radius"),Re.cutoffFadeRange=d.paint.get("fill-extrusion-cutoff-fade-range");const ve=be=>{const Ae=p.depthModeForSublayer(1,rn.ReadOnly,T.LEQUAL,!0),Ne=d.paint.get(be?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),De=Se(.1,3,Ne),Ye=p._showOverdrawInspector;if(!Ye){const Ke=new Tn({func:T.ALWAYS,mask:255},255,255,T.KEEP,T.KEEP,T.REPLACE),Tt=new In([T.ONE,T.ONE,T.ONE,T.ONE],a.C.transparent,[!1,!1,!1,!0],T.MIN);vl(Re,p,o,d,_,Ae,Ke,Tt,pn.disabled,be,"sdf",te,ee,oe,se,pe,De,z,!1)}{const Ke=Ye?Tn.disabled:new Tn({func:T.EQUAL,mask:255},255,255,T.KEEP,T.DECR,T.DECR),Tt=Ye?p.colorModeForRenderPass():new In([T.ONE_MINUS_DST_ALPHA,T.DST_ALPHA,T.ONE,T.ONE],a.C.transparent,[!0,!0,!0,!0]);vl(Re,p,o,d,_,Ae,Ke,Tt,pn.disabled,be,"color",te,ee,oe,se,pe,De,z,!1)}};if(k){const be=()=>{const Ne=I.drapeBufferSize[0],De=I.drapeBufferSize[1];let Ye=I.framebufferCopyTexture;return Ye&&(!Ye||Ye.size[0]===Ne&&Ye.size[1]===De)||(Ye&&Ye.destroy(),Ye=I.framebufferCopyTexture=new a.T(S,new a.q({width:Ne,height:De}),T.RGBA8)),Ye.bind(T.LINEAR,T.CLAMP_TO_EDGE),T.copyTexSubImage2D(T.TEXTURE_2D,0,0,0,0,0,Ne,De),Ye},Ae=(Ne,De,Ye)=>{const Ke=p.depthModeForSublayer(1,rn.ReadOnly,T.LEQUAL,!1),Tt=d.paint.get(Ne?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),Ue=Se(.1,3,Tt);{const rt=new In([T.ONE,T.ONE,T.ONE,T.ONE],a.C.transparent,[!1,!1,!1,!0]);vl(Re,p,o,d,_,Ke,Tn.disabled,rt,pn.disabled,Ne,"clear",te,ee,oe,se,pe,Ue,z,De)}{const rt=new Tn({func:T.ALWAYS,mask:255},255,255,T.KEEP,T.KEEP,T.REPLACE),$e=new In([T.ONE,T.ONE,T.ONE,T.ONE],a.C.transparent,[!1,!1,!1,!0],T.MIN);vl(Re,p,o,d,_,Ke,rt,$e,pn.disabled,Ne,"sdf",te,ee,oe,se,pe,Ue,z,De)}F&&!Ne&&(Ye=be());{const rt=Ne?T.ZERO:T.ONE_MINUS_DST_ALPHA,$e=new Tn({func:T.EQUAL,mask:255},255,255,T.KEEP,T.DECR,T.DECR),ct=new In([rt,T.DST_ALPHA,T.ONE_MINUS_DST_ALPHA,T.ZERO],a.C.transparent,[!0,!0,!0,!0]);
3298vl(Re,p,o,d,_,Ke,$e,ct,pn.disabled,Ne,"color",te,ee,oe,se,pe,Ue,z,De)}if(!F||Ne){const rt=new In([T.ONE,T.ONE,T.ONE,Ne?T.ZERO:T.ONE],a.C.transparent,[!1,!1,!1,!0],Ne?T.FUNC_ADD:T.MAX);vl(Re,p,o,d,_,Ke,Tn.disabled,rt,pn.disabled,Ne,"clear",te,ee,oe,se,pe,Ue,z,De,Ye)}else{T.drawBuffers([T.NONE,T.COLOR_ATTACHMENT1]);const rt=new Tn({func:T.EQUAL,mask:255},254,255,T.KEEP,T.DECR,T.DECR),$e=new In([T.ONE,T.ONE,T.ONE,T.ONE],a.C.transparent,[!0,!1,!1,!1],T.MAX);vl(Re,p,o,d,_,Ke,rt,$e,pn.disabled,Ne,"emissive",te,ee,oe,se,pe,Ue,z,De,Ye),T.drawBuffers([T.COLOR_ATTACHMENT0])}};if(ce||Ce){let Ne;p.prepareDrawTile(),F&&!ce||(Ne=be()),ce&&Ae(!0,!1,Ne),Ce&&Ae(!1,!0,Ne)}}else ce&&ve(!0),Ce&&ve(!1),(ce||Ce)&&p.resetStencilClippingMasks()}}},hillshade:function(p,o,d,_){if(p.renderPass!=="offscreen"&&p.renderPass!=="translucent"||p.style.disableElevatedTerrain)return;const b=p.context,S=p.terrain&&p.terrain.renderingToTexture,[T,I]=p.renderPass!=="translucent"||S?[{},_]:p.stencilConfigForOverlap(_);for(const k of I){const F=o.getTile(k);if(F.needsHillshadePrepare&&p.renderPass==="offscreen")wg(p,F,d);else if(p.renderPass==="translucent"){const z=p.depthModeForSublayer(0,rn.ReadOnly),q=d.paint.get("hillshade-emissive-strength"),j=p.colorModeForDrapableLayerRenderPass(q),Z=S&&p.terrain?p.terrain.stencilModeForRTTOverlap(k):T[k.overscaledZ];l0(p,k,F,d,z,Z,j)}}b.viewport.set([0,0,p.width,p.height]),p.resetStencilClippingMasks()},raster:function(p,o,d,_,b,S){if(p.renderPass!=="translucent")return;const T=d.paint.get("raster-opacity");if(T===0)return;const I=p.transform.projection.name==="globe",k=d.paint.get("raster-elevation")!==0,F=k&&I,z=p.terrain&&p.terrain.exaggeration()>0&&k&&d.paint.get("raster-elevation-reference")==="ground",q=!I&&z;if(p.renderElevatedRasterBackface&&!F)return;const j=p.context,Z=j.gl,te=o.getSource(),ee=(function(be,Ae,Ne,De,Ye){const Ke=Ae.paint.get("raster-color"),Tt=be.type==="raster-array",Ue=[],rt=Ae.paint.get("raster-resampling"),$e=Ae.paint.get("raster-color-mix");let ct=Ae.paint.get("raster-color-range");const at=[$e[0],$e[1],$e[2],0],dt=$e[3];let Gt=rt==="nearest"?De.NEAREST:De.LINEAR;if(Tt&&(Ue.push("RASTER_ARRAY"),Ke||Ue.push("RASTER_COLOR"),rt==="linear"&&Ue.push("RASTER_ARRAY_LINEAR"),Gt=De.NEAREST,!ct&&be.rasterLayers)){const Mt=be.rasterLayers.find(({id:Ct})=>Ct===Ae.sourceLayer);Mt&&Mt.fields&&Mt.fields.range&&(ct=Mt.fields.range)}if(ct=ct||[0,1],Ke){Ue.push("RASTER_COLOR"),Ne.activeTexture.set(De.TEXTURE2),Ae.updateColorRamp(ct);let Mt=Ae.colorRampTexture;Mt||(Mt=Ae.colorRampTexture=new a.T(Ne,Ae.colorRamp,De.RGBA8)),Mt.bind(Gt,De.CLAMP_TO_EDGE)}return Ye&&Ue.push("USE_MRT1"),{mix:at,range:ct,offset:dt,defines:Ue,resampling:Gt}})(te,d,j,Z,p.terrain&&p.terrain.renderingToTexture&&p.emissiveMode==="mrt-fallback");if(te instanceof a.aY&&!_.length&&!I)return;const oe=d.paint.get("raster-emissive-strength"),se=p.colorModeForDrapableLayerRenderPass(oe),de=p.terrain&&p.terrain.renderingToTexture,pe=!p.options.moving,ce=d.paint.get("raster-resampling")==="nearest"?Z.NEAREST:Z.LINEAR;if(te instanceof a.aY&&!_.length&&(te.onNorthPole||te.onSouthPole)){const be=k?p.stencilModeFor3D():Tn.disabled;return void jp(!!te.onNorthPole,null,p,o,d,oe,ee,pn.disabled,be)}if(!_.length)return;const[Ce,Se]=te instanceof a.aY||de?[{},_]:p.stencilConfigForOverlap(_),Re=Se.at(-1).overscaledZ;F&&ee.defines.push("PROJECTION_GLOBE_VIEW"),k&&ee.defines.push("RENDER_CUTOFF","ELEVATED"),z&&ee.defines.push("ELEVATION_REFERENCE_GROUND");const ve=(be,Ae,Ne)=>{for(const De of be){const Ye=De.toUnwrapped(),Ke=o.getTile(De);if(de&&(!Ke||!Ke.hasData()))continue;j.activeTexture.set(Z.TEXTURE0);const Tt=z0(Ke,te,d,ee);if(!Tt||!Tt.texture)continue;const{texture:Ue,mix:rt,offset:$e,tileSize:ct,buffer:at}=Tt;let dt,Gt;de?(dt=rn.disabled,Gt=De.projMatrix):k?(dt=new rn(Z.LEQUAL,rn.ReadWrite,p.depthRangeFor3D),Gt=I?p.transform.expandedFarZProjMatrix:p.transform.calculateProjMatrix(Ye,pe)):(dt=p.depthModeForSublayer(De.overscaledZ-Re,T===1?rn.ReadWrite:rn.ReadOnly,Z.LESS),Gt=p.transform.calculateProjMatrix(Ye,pe));const Mt=p.terrain&&de?p.terrain.stencilModeForRTTOverlap(De):Ce[De.overscaledZ],Ct=S?0:d.paint.get("raster-fade-duration");Ke.registerFadeDuration(Ct);const xt=o.findLoadedParent(De,0),dn=Kh(Ke,xt,o,p.transform,Ct);let an,Jt;!dn.isFading&&Ke.refreshedUponExpiration&&(Ke.refreshedUponExpiration=!1),p.terrain&&p.terrain.prepareDrawTile(),j.activeTexture.set(Z.TEXTURE0),Ue.bind(ce,Z.CLAMP_TO_EDGE),j.activeTexture.set(Z.TEXTURE1),xt?(xt.texture&&xt.texture.bind(ce,Z.CLAMP_TO_EDGE),an=Math.pow(2,xt.tileID.overscaledZ-Ke.tileID.overscaledZ
3298),Jt=[Ke.tileID.canonical.x*an%1,Ke.tileID.canonical.y*an%1]):Ue.bind(ce,Z.CLAMP_TO_EDGE),"useMipmap"in Ue&&j.extTextureFilterAnisotropic&&p.transform.pitch>20&&Z.texParameterf(Z.TEXTURE_2D,j.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,j.extTextureFilterAnisotropicMax);const tn=p.transform;let bn;const kn=k?B0(tn):[0,0,0,0];let Pn,jn,An,or,Fn,fr=0;if(F&&te instanceof a.aY&&te.coordinates.length>3)Pn=Float32Array.from(a.dx(a.dy(new a.cp(0,0,0)))),jn=Float32Array.from(tn.globeMatrix),An=Float32Array.from(a.dt(tn)),or=[a.aG(tn.center.lng),a.aJ(tn.center.lat)],bn=te.elevatedGlobePerspectiveTransform,Fn=te.elevatedGlobeGridMatrix||new Float32Array(9);else if(F){const yr=a.du(De.canonical);fr=a.dv(yr.getCenter().lat),Pn=Float32Array.from(a.dx(a.dy(De.canonical))),jn=Float32Array.from(tn.globeMatrix),An=Float32Array.from(a.dt(tn)),or=[a.aG(tn.center.lng),a.aJ(tn.center.lat)],bn=[0,0],Fn=Float32Array.from(a.dw(De.canonical,yr,fr,tn.worldSize/tn._pixelsPerMercatorPixel))}else bn=te instanceof a.aY?te.perspectiveTransform:[0,0],Pn=new Float32Array(16),jn=new Float32Array(9),An=new Float32Array(16),or=[0,0],Fn=new Float32Array(9);const Or=Og(p,Gt,Pn,jn,An,Fn,Jt||[0,0],a.ai(p.transform.zoom),or,kn,an||1,dn,d,bn,k?d.paint.get("raster-elevation"):0,2,rt,$e,ee.range,ct,at,oe),Fr=p.isTileAffectedByFog(De),zr=p.getOrCreateProgram("raster",{defines:ee.defines,overrideFog:Fr});if(p.uploadCommonUniforms(j,zr,Ye),te instanceof a.aY){const yr=te.elevatedGlobeVertexBuffer,Gn=te.elevatedGlobeIndexBuffer;if(de||!I)te.boundsBuffer&&te.boundsSegments&&zr.draw(p,Z.TRIANGLES,dt,Tn.disabled,se,pn.disabled,Or,d.id,te.boundsBuffer,p.quadTriangleIndexBuffer,te.boundsSegments);else if(yr&&Gn){const Xn=tn.zoom<=a.cN?te.elevatedGlobeSegments:te.getSegmentsForLongitude(tn.center.lng);Xn&&zr.draw(p,Z.TRIANGLES,dt,Tn.disabled,se,Ae,Or,d.id,yr,Gn,Xn)}}else if(F){dt=new rn(Z.LEQUAL,rn.ReadOnly,p.depthRangeFor3D);const yr=p.globeSharedBuffers;if(yr){z&&(p.terrain.setupElevationDraw(Ke,zr),p.uploadCommonUniforms(j,zr,Ke.tileID.toUnwrapped()));const[Gn,Xn,Nr]=yr.getGridBuffers(fr,!1),Si=zr.getAttributeLocation(Z,"a_texture_pos");Si!==-1&&Z.vertexAttribI4ui(Si,0,0,0,0),zr.draw(p,Z.TRIANGLES,dt,Ne||Mt,p.colorModeForRenderPass(),Ae,Or,d.id,Gn,Xn,Nr)}}else if(q)dt=new rn(Z.LEQUAL,rn.ReadWrite,p.depthRangeFor3D),p.terrain.setupElevationDraw(Ke,zr),p.uploadCommonUniforms(j,zr,Ke.tileID.toUnwrapped()),tn.pitch>20&&zr.draw(p,Z.TRIANGLES,dt,Tn.disabled,In.disabled,pn.frontCCW,Or,d.id,p.terrain.gridBuffer,p.terrain.gridIndexBuffer,p.terrain.gridSegments),zr.draw(p,Z.TRIANGLES,dt,Mt,se,pn.backCCW,Or,d.id,p.terrain.gridBuffer,p.terrain.gridIndexBuffer,p.terrain.gridSegments);else{const{tileBoundsBuffer:yr,tileBoundsIndexBuffer:Gn,tileBoundsSegments:Xn}=p.getTileBoundsBuffers(Ke);zr.draw(p,Z.TRIANGLES,dt,Mt,se,pn.disabled,Or,d.id,yr,Gn,Xn)}}if(!(te instanceof a.aY)&&F)for(const De of be){const Ye=De.canonical.y===(1<<De.canonical.z)-1;De.canonical.y===0&&jp(!0,De,p,o,d,oe,ee,Ae,Ne||Tn.disabled),Ye&&jp(!1,De,p,o,d,oe,ee,Ae===pn.frontCW?pn.backCW:pn.frontCW,Ne||Tn.disabled)}};F?ve(Se,p.renderElevatedRasterBackface?pn.backCW:pn.frontCW,p.stencilModeFor3D()):ve(Se,pn.disabled,void 0),p.resetStencilClippingMasks()},background:function(p,o,d,_){const b=d.paint.get("background-color"),S=d.paint.get("background-color-use-theme").constantOr("default")==="none",T=d.paint.get("background-opacity"),I=d.paint.get("background-emissive-strength"),k=d.paint.get("background-pitch-alignment")==="viewport";if(T===0)return;const F=p.context,z=F.gl,q=p.transform,j=q.tileSize,Z=d.paint.get("background-pattern");let te;if(Z!==void 0&&(Z===null||(te=p.imageManager.getPattern(a.I.from(Z.toString()),d.scope,p.style.getLut(d.scope)),!te)))return;const ee=!Z&&b.a===1&&T===1&&p.opaquePassEnabledForLayer()?"opaque":"translucent";if(p.renderPass!==ee)return;const oe=Tn.disabled,se=p.depthModeForSublayer(0,ee==="opaque"?rn.ReadWrite:rn.ReadOnly),de=p.colorModeForDrapableLayerRenderPass(I),pe=Z?"backgroundPattern":"background";let ce,Ce=_;Ce||(ce=p.getBackgroundTiles(),Ce=Object.values(ce).map(Re=>Re.tileID)),Z&&(F.activeTexture.set(z.TEXTURE0),p.imageManager.bind(p.context,d.scope));const Se=[];if(p.terrain&&p.terrain.renderingToTexture&&p.emissiveMode==="mrt-fallback"&&Se.push("USE_MRT1"),k){const Re=p.getOrCreateProgram(pe,{overrideFog:!1,overrideRtt:!0,defines:Se}),ve=N0,be=new a.aU(0,0,0,0,0),Ae=Z?Dg(ve,I,T,p,0,d.scope,te,k,{tileID:be,tileSize:j}):sw(ve,I,T,b.toPremultipliedRenderColor(S?null:d.lut));return void Re.draw(p,z.TRIANGLES,se,oe,de,pn.disabled,Ae,d.id,p.viewportBuffer,p.quadTriangleIndexBuffer,p.viewportSegments)}for(const Re of Ce){const ve=p.isTileAffectedByFog(Re),be=p.getOrCreateProgram(pe,{overrideFog:ve,defines:Se}),Ae=Re.toUnwrapped(),Ne=_?Re.projMatrix:p.transform.calculateProjMatrix(Ae);p.prepareDrawTile();
3298const De=o?o.getTile(Re):ce?ce[Re.key]:new a.b3(Re,j,q.zoom,p),Ye=Z?Dg(Ne,I,T,p,0,d.scope,te,k,{tileID:Re,tileSize:j}):sw(Ne,I,T,b.toPremultipliedRenderColor(S?null:d.lut));p.uploadCommonUniforms(F,be,Ae);const{tileBoundsBuffer:Ke,tileBoundsIndexBuffer:Tt,tileBoundsSegments:Ue}=p.getTileBoundsBuffers(De);be.draw(p,z.TRIANGLES,se,oe,de,pn.disabled,Ye,d.id,Ke,Tt,Ue)}},sky:function(p,o,d){const _=p._atmosphere?a.ai(p.transform.zoom):1,b=d.paint.get("sky-opacity")*_;if(b===0)return;const S=p.context,T=d.paint.get("sky-type"),I=new rn(S.gl.LEQUAL,rn.ReadOnly,[0,1]),k=p.frameCounter/1e3%1;T==="atmosphere"?p.renderPass==="offscreen"?d.needsSkyboxCapture(p)&&((function(F,z){const q=F.context,j=q.gl;let Z=z.skyboxFbo;if(!Z){Z=z.skyboxFbo=q.createFramebuffer(32,32,1,null),z.skyboxGeometry=new qg(q),z.skyboxTexture=q.gl.createTexture(),j.bindTexture(j.TEXTURE_CUBE_MAP,z.skyboxTexture),j.texParameteri(j.TEXTURE_CUBE_MAP,j.TEXTURE_WRAP_S,j.CLAMP_TO_EDGE),j.texParameteri(j.TEXTURE_CUBE_MAP,j.TEXTURE_WRAP_T,j.CLAMP_TO_EDGE),j.texParameteri(j.TEXTURE_CUBE_MAP,j.TEXTURE_MIN_FILTER,j.L
3298INEAR),j.texParameteri(j.TEXTURE_CUBE_MAP,j.TEXTURE_MAG_FILTER,j.LINEAR);for(let se=0;se<6;++se)j.texImage2D(j.TEXTURE_CUBE_MAP_POSITIVE_X+se,0,j.RGBA,32,32,0,j.RGBA,j.UNSIGNED_BYTE,null)}q.bindFramebuffer.set(Z.framebuffer),q.viewport.set([0,0,32,32]);const te=z.getCenter(F,!0),ee=F.getOrCreateProgram("skyboxCapture"),oe=new Float64Array(16);a.en(oe,.5*-Math.PI),_i(F,z,ee,oe,te,0),a.en(oe,.5*Math.PI),_i(F,z,ee,oe,te,1),a.eo(oe,.5*-Math.PI),_i(F,z,ee,oe,te,2),a.eo(oe,.5*Math.PI),_i(F,z,ee,oe,te,3),a.bA(oe),_i(F,z,ee,oe,te,4),a.en(oe,Math.PI),_i(F,z,ee,oe,te,5),q.viewport.set([0,0,F.width,F.height])})(p,d),d.markSkyboxValid(p)):p.renderPass==="sky"&&(function(F,z,q,j,Z){const te=F.context,ee=te.gl,oe=F.transform,se=F.getOrCreateProgram("skybox");te.activeTexture.set(ee.TEXTURE0),ee.bindTexture(ee.TEXTURE_CUBE_MAP,z.skyboxTexture);const de=((pe,ce,Ce,Se,Re)=>({u_matrix:pe,u_sun_direction:ce,u_cubemap:0,u_opacity:Se,u_temporal_offset:Re}))(oe.skyboxMatrix,z.getCenter(F,!1),0,j,Z);F.uploadCommonUniforms(te,se),se.draw(F,ee.TRIANGLES,q,Tn.disabled,F.colorModeForRenderPass(),pn.backCW,de,"skybox",z.skyboxGeometry.vertexBuffer,z.skyboxGeometry.indexBuffer,z.skyboxGeometry.segment)})(p,d,I,b,k):T==="gradient"&&p.renderPass==="sky"&&(function(F,z,q,j,Z){const te=F.context,ee=te.gl,oe=F.transform,se=F.getOrCreateProgram("skyboxGradient");z.skyboxGeometry||(z.skyboxGeometry=new qg(te)),te.activeTexture.set(ee.TEXTURE0);let de=z.colorRampTexture;de||(de=z.colorRampTexture=new a.T(te,z.colorRamp,ee.RGBA8)),de.bind(ee.LINEAR,ee.CLAMP_TO_EDGE);const pe=((ce,Ce,Se,Re,ve)=>({u_matrix:ce,u_color_ramp:0,u_center_direction:Ce,u_radius:a.am(Se),u_opacity:Re,u_temporal_offset:ve}))(oe.skyboxMatrix,z.getCenter(F,!1),z.paint.get("sky-gradient-radius"),j,Z);F.uploadCommonUniforms(te,se),se.draw(F,ee.TRIANGLES,q,Tn.disabled,F.colorModeForRenderPass(),pn.backCW,pe,"skyboxGradient",z.skyboxGeometry.vertexBuffer,z.skyboxGeometry.indexBuffer,z.skyboxGeometry.segment)})(p,d,I,b,k)},custom:function(p,o,d,_){const b=p.context,S=d.implementation;if(!p.transform.projection.unsupportedLayers||!p.transform.projection.unsupportedLayers.includes("custom")||p.terrain&&(p.terrain.renderingToTexture||p.renderPass==="offscreen")&&d.isDraped(o)){if(p.renderPass==="offscreen"){const T=S.prerender;if(T){if(p.setCustomLayerDefaults(),b.setColorMode(p.colorModeForRenderPass()),p.transform.projection.name==="globe"){const I=p.transform.pointMerc;T.call(S,b.gl,p.transform.customLayerMatrix(),p.transform.getProjection(),p.transform.globeToMercatorMatrix(),a.ai(p.transform.zoom),[I.x,I.y],p.transform.pixelsPerMeterRatio)}else T.call(S,b.gl,p.transform.customLayerMatrix());b.setDirty(),p.setBaseState()}}else if(p.renderPass==="translucent"){if(p.terrain&&p.terrain.renderingToTexture){const I=S.renderToTile;if(I){const k=_[0].canonical,F={x:k.x+_[0].wrap*(S.wrapTileId?0:1<<k.z),y:k.y,z:k.z};b.setDepthMode(rn.disabled),b.setStencilMode(Tn.disabled),b.setColorMode(p.colorModeForRenderPass()),p.setCustomLayerDefaults();const z=b.gl;p.emissiveMode==="mrt-fallback"&&z.drawBuffers([z.COLOR_ATTACHMENT0]),I.call(S,b.gl,F),p.emissiveMode==="mrt-fallback"&&z.drawBuffers([z.COLOR_ATTACHMENT0,z.COLOR_ATTACHMENT1]),b.setDirty(),p.setBaseState()}return}p.setCustomLayerDefaults(),b.setColorMode(p.colorModeForRenderPass()),b.setStencilMode(Tn.disabled);const T=S.renderingMode==="3d"?new rn(p.context.gl.LEQUAL,rn.ReadWrite,p.depthRangeFor3D):p.depthModeForSublayer(0,rn.ReadOnly);if(b.setDepthMode(T),p.transform.projection.name==="globe"){const I=p.transform.pointMerc;S.render(b.gl,p.transform.customLayerMatrix(),p.transform.getProjection(),p.transform.globeToMercatorMatrix(),a.ai(p.transform.zoom),[I.x,I.y],p.transform.pixelsPerMeterRatio)}else S.render(b.gl,p.transform.customLayerMatrix());b.setDirty(),p.setBaseState(),b.bindFramebuffer.set(null)}}else a.w("Custom layers are not yet supported with this projection. Use mercator or globe to enable usage of custom layers.")},model:function(p,o,d,_){if(p.renderPass==="opaque")return;const b=d.paint.get("model-opacity").constantOr(1),S=d.paint.get("model-elevation-reference"),T=S==="ground",I=S==="ground";if(b===0)return;const k=d.paint.get("model-cast-shadows");
3298if(p.renderPass==="shadow"&&(!k||p.terrain&&b<.65&&d._transitionablePaint._values["model-opacity"].value.expression instanceof a.ac))return;const F=p.shadowRenderer,z=d.paint.get("model-receive-shadows");F&&(F.useNormalOffset=!0,z||(F.enabled=!1));const q=()=>{F&&(F.useNormalOffset=!0,z||(F.enabled=!0))},j=o.getSource();if(p.renderPass==="light-beam"&&j.type!=="batched-model")return;if(j.type==="vector"||j.type==="geojson")return(function(ce,Ce,Se,Re,ve){const be=ce.transform,Ae=be.projection.name==="globe",Ne=be.getFreeCameraOptions().position;if(!ce.modelManager)return;const De=ce.modelManager;Se.modelManager=De;const Ye=ce.shadowRenderer;if(!Object.hasOwn(Se._unevaluatedLayout._values,"model-id"))return;const Ke=Se._unevaluatedLayout._values["model-id"],Tt=Object.assign({},Se.layout.get("model-id").parameters),Ue=ce.style.order.indexOf(Se.fqid),rt=Se.paint.get("model-opacity").constantOr(1);for(const $e of Re){const ct=Ce.getTile($e).getBucket(Se);if(!ct||ct.projection.name!==be.projection.name)continue;const at=ct.getModelUris();if(at&&!ct.modelsRequested&&(De.addModelsFromBucket(at,ve),ct.modelsRequested=!0),Ae)Tt.zoom=$e.overscaledZ;else{const Jt=ww($e,be);Tt.zoom=Jt}const dt=Ke.possiblyEvaluate(Tt);if(xw(ce,ct,$e),bl.shadowUniformsInitialized=!1,bl.useSingleShadowCascade=!!Ye&&Ye.getMaxCascadeForTile($e.toUnwrapped())===0,ce.renderPass==="shadow"&&Ye){if(ce.currentShadowCascade===1&&ct.isInsideFirstShadowMapFrustum)continue;const Jt=be.calculatePosMatrix($e.toUnwrapped(),be.worldSize);if(bl.tileMatrix.set(Jt),bl.shadowTileMatrix.set(Ye.calculateShadowPassMatrixFromMatrix(Jt)),bl.aabb.min=[0,0,0],bl.aabb.max[0]=bl.aabb.max[1]=a.ak,bl.aabb.max[2]=0,Ew(ct,bl,ce,Se.scope))continue}const Gt=1<<$e.canonical.z,Mt=[((Ne.x-$e.wrap)*Gt-$e.canonical.x)*a.ak,(Ne.y*Gt-$e.canonical.y)*a.ak,Ne.z*Gt*a.ak];ce.conflationActive&&Object.keys(ct.instancesPerModel).length>0&&ce.style.isLayerClipped(Se,Ce.getSource())&&ct.updateReplacement($e,ce.replacementSource,Ue,Se.scope)&&(ct.uploaded=!1,ct.upload(ce.context));let Ct=0;const xt=new Array,dn=new Array,an=new Array;for(let Jt in ct.instancesPerModel){const tn=ct.instancesPerModel[Jt];tn.features.length>0&&!Ae&&(Jt=dt.evaluate(tn.features[0].feature,{}));const bn=De.getModel(Jt,ve);if(bn||De.hasURLBeenRequested(Jt)||ct.modelUris.includes(Jt)||(ct.modelUris.push(Jt),ct.modelsRequested=!1),bn&&bn.uploaded)if(Ae){const kn=a.bN([],[Ne.x,Ne.y,Ne.z],ce.transform.worldSize);a.ew(kn,kn);for(let Pn=0;Pn<tn.instancedDataArray.length;++Pn){const jn=[0,0,0],An=[1,1,1],or=a.ex(),Fn=tn.tileCoordinatesForInstance(Pn),fr=tn.transformForInstance(Pn);a.ey(An,fr),a.ez(or,fr),a.eA(jn,or);const Or=tn.translationForInstance(Pn),Fr=new a.aX(0,0);a.eB(ct.canonical,Fr,Fn.x,Fn.y);const zr=a.bd();a.eC(zr,bn,ce.transform,Fr,jn,An,Or,!0,!1,!1);const yr=tn.colorForInstance(Pn),Gn=a.cK([],kn),Xn=a.e8(Fr.lat,ce.transform.zoom),Nr=a.bT([],[1,1,1/Xn]);an.push({zScaleMatrix:Nr,negCameraPosMatrix:Gn});for(const Si of bn.nodes)Zg(ce,Si,zr,ce.transform.expandedFarZProjMatrix,Ct,xt,dn,bn.materialOverrides,rt,yr);++Ct}}else for(const kn of bn.nodes)Y0(ce,Se,kn,tn,Mt,$e,bl)}if(Ae)if(ce.renderPass==="shadow"){for(const Jt of dn)Md(Jt.mesh,Jt.nodeModelMatrix,ce,Se);for(const Jt of xt)Md(Jt.mesh,Jt.nodeModelMatrix,ce,Se)}else Z0(ce,Se,xt,dn,an)}})(p,o,d,_,Gp(p,d)),void q();if(!j.loaded())return;if(j.type==="batched-model")return(function(ce,Ce,Se,Re){Se.resetLayerRenderingStats(ce);const ve=ce.context,be=ce.transform,Ae=ce.style.fog,Ne=ce.shadowRenderer;if(be.projection.name!=="mercator")return void a.w(`Drawing 3D landmark models for ${be.projection.name} projection is not yet implemented`);const De=ce.transform.getFreeCameraOptions().position,Ye=a.bN([],[De.x,De.y,De.z],ce.transform.worldSize),Ke=a.ew([],Ye),Tt=a.cK([],Ke),Ue=a.e8(be.center.lat,be.zoom),rt=a.bT([],[1,1,1/Ue]),$e=Se.paint.get("model-opacity").constantOr(1),ct=new rn(ve.gl.LEQUAL,rn.ReadWrite,ce.depthRangeFor3D),at=new rn(ve.gl.LEQUAL,rn.ReadOnly,ce.depthRangeFor3D),dt=new a.cY([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),Gt=ce.renderPass==="shadow",Mt=Gt&&Ne?Ne.getCurrentCascadeFrustum():be.getFrustum(be.scaleZoom(be.worldSize)),Ct=Se.paint.get("model-front-cutoff"),xt=Ct[2]<1,dn=Sa(ce,Se.paint.get("model-cutoff-fade-range")),an=Se.getLayerRenderingStats();(function(Jt,tn,bn,kn){const Pn=Jt.terrain?Jt.terrain.exaggeration():0,jn=Jt.transform.zoom;for(const An of kn){const or=tn.getTile(An).getBucket(bn);or&&(or.setFilter(bn.filter),Jt.conflationActive&&or.updateReplacement(An,Jt.replacementSource),or.evaluateTransform(Jt,bn),Jt.terrain&&Pn>0&&or.elevationUpdate(Jt.terrain,Pn,An,bn.source),or.needsReEvaluation(Jt,jn,bn)&&or.evaluate(bn))}})(ce,Ce,Se,Re),(function(){const Jt=new Map;let tn,bn,kn;xt?(tn=Re.length-1,bn=-1,kn=-1):(tn=0,bn=Re.length,kn=1);const Pn=new Float64Array(16),jn=a.cg(),An=new a.P(0,0);for(let or=tn;or!==bn;or+=kn){const Fn=Re[or],fr=Ce.getTile(Fn).getBucket(Se);if(!fr||!fr.uploaded)continue;let Or=!1;Ne&&(Or=Ne.getMaxCascadeForTile(Fn.toUnwrapped())===0);const Fr=be.calculatePosMatrix(Fn.toUnwrapped(),be.worldSize),zr=fr.modelTraits;!Gt&&xt&&(a.ba(Pn,Fr),a.ae(jn,Ye,Pn),An.x=jn[0],An.y=jn[1]);const yr=[];fr.setFilter(Se.filter);
3298for(const Gn of fr.getNodesInfo()){if(Gn.hiddenByReplacement||!Gn.node.meshes)continue;const Xn=Gn.node;let Nr=0;ce.terrain&&Xn.elevation&&(Nr=Xn.elevation*ce.terrain.exaggeration());const Si=(()=>{const io=Gn.aabb;return dt.min=[...io.min],dt.max=[...io.max],dt.min[2]+=Nr,dt.max[2]+=Nr,a.ae(dt.min,dt.min,Fr),a.ae(dt.max,dt.max,Fr),dt})(),kr=Gn.evaluatedScale;if(kr[0]<=1&&kr[1]<=1&&kr[2]<=1&&Si.intersects(Mt)===0)continue;if(!Gt){const io=Si.min,Rs=Si.max;Dc[0]=.5*(io[0]+Rs[0]),Dc[1]=.5*(io[1]+Rs[1]),Dc[2]=.5*(io[2]+Rs[2]);const ks=a.bh(Ye,Dc)*Ue;Tw(Gn,ks,Math.min(ce._debugParams.dt,1e3/30),ce._debugParams.lodSwitchDistance)}if(!Gt&&xt){const io=.16666666666666666;Gn.cameraCollisionOpacity=Ye[0]>Si.min[0]&&Ye[0]<Si.max[0]&&Ye[1]>Si.min[1]&&Ye[1]<Si.max[1]&&Ye[2]*Ue<Si.max[2]&&Xn.footprint&&a.bG(An,Xn.footprint)?Math.max(Gn.cameraCollisionOpacity-io,0):Math.min(1,Gn.cameraCollisionOpacity+io)}const Dn=[...Fr],ri=1/a.cW(Fn.canonical),$r=Xn.anchor?Xn.anchor[0]:0,Ii=Xn.anchor?Xn.anchor[1]:0;a.bB(Dn,Dn,[$r*(kr[0]-1)+Gn.evaluatedTranslation[0]*ri,Ii*(kr[1]-1)+Gn.evaluatedTranslation[1]*ri,Nr+Gn.evaluatedTranslation[2]]),a.c6(kr,a.eE)||a.cE(Dn,Dn,kr);const lr=a.aC([],Dn,Xn.globalMatrix),$i=a.aC([],be.expandedFarZProjMatrix,lr),Yo=a.aC([],be.expandedFarZProjMatrix,Dn),fo=a.aD([],[$r,Ii,Nr,1],$i)[2];Xn.hidden=!1;let Lo=$e;Gt||(xt&&(Lo*=Gn.cameraCollisionOpacity,Lo*=O2(Dn,be,Gn.aabb,Ct)),Lo*=L2(dn,fo)),Lo!==0?yr.push({nodeInfo:Gn,depth:fo,opacity:Lo,wvpForNode:$i,wvpForTile:Yo,nodeModelMatrix:lr,tileModelMatrix:Dn}):Xn.hidden=!0}Gt||yr.sort((Gn,Xn)=>!xt||Gn.opacity===1&&Xn.opacity===1?Gn.depth<Xn.depth?-1:1:Gn.opacity===1?-1:Xn.opacity===1?1:Gn.depth>Xn.depth?-1:1);for(const Gn of yr){const Xn=Gn.nodeInfo,Nr=Xn.node;if(ce._debugParams.show3DModelFootprints&&Nr.footprint){const fo=Nr.id||Nr.name||"footprint";Jt.has(fo)||Jt.set(fo,{node:Nr,mvp:Gn.wvpForTile})}a.aC(zs,rt,Gn.tileModelMatrix),a.aC(zs,Tt,zs),a.ba(Wa,zs),a.e9(Wa,Wa),a.cE(Wa,Wa,Sw),a.aC(zs,zs,Nr.globalMatrix);const Si=ce.renderPass==="light-beam",kr=Se.paint.get("model-color-use-theme").constantOr("default")==="none",Dn=zr&a.eH.HasMapboxMeshFeatures,ri=Dn?0:Xn.evaluatedRMEA[0][2],$r=Xn.targetLod,Ii=Nr.lodMeshes&&Nr.lodMeshes.length>0,lr=Ii&&$r>0&&$r<1;if(Gt&&Ii&&Math.round($r)===1)continue;const $i=lr?2:1,Yo=Ii&&Math.round($r)===1;for(let fo=0;fo<$i;++fo){const Lo=lr?fo===1:Yo,io=Lo?Nr.lodMeshes:Nr.meshes,Rs=lr?Lo?-$r:1-$r:1;for(let ks=0;ks<io.length;++ks){const Yi=io[ks],cs=!Lo&&ks===Nr.lightMeshIndex;let vr=Gn.wvpForNode;if(cs){if(!Si&&!ce.terrain&&ce.shadowRenderer){ce.currentLayer<ce.firstLightBeamLayer&&(ce.firstLightBeamLayer=ce.currentLayer);continue}vr=Gn.wvpForTile}else if(Si)continue;const Dr={defines:[]},Er=[];if(!Gt&&Ne&&(Ne.useNormalOffset=!!Yi.normalBuffer),kd(Dr.defines,Er,Yi,ce,kr?null:Se.lut),Dn||Dr.defines.push("DIFFUSE_SHADED"),Or&&Dr.defines.push("SHADOWS_SINGLE_CASCADE"),an&&(Gt?an.numRenderedVerticesInShadowPass+=Yi.vertexArray.length:an.numRenderedVerticesInTransparentPass+=Yi.vertexArray.length),Gt){Md(Yi,Gn.nodeModelMatrix,ce,Se);continue}let ji=null;if(Ae&&(ji=Xg(Ru,Gn.nodeModelMatrix,ce.transform),be.projection.name!=="globe")){const aa=Yi.aabb.min,Ia=Yi.aabb.max,[zc,wl]=Ae.getOpacityForBounds(ji,aa[0],aa[1],Ia[0],Ia[1]);Dr.overrideFog=zc>=Cc||wl>=Cc}const To=Yi.material;let Ti;To.occlusionTexture&&To.occlusionTexture.offsetScale&&(Ti=To.occlusionTexture.offsetScale,Dr.defines.push("OCCLUSION_TEXTURE_TRANSFORM")),lr&&Dr.defines.push("DITHERED_DISCARD");const ys=ce.getOrCreateProgram("model",Dr);!Gt&&Ne&&Ne.setupShadowsFromMatrix(Gn.tileModelMatrix,ys,Ne.useNormalOffset),ce.uploadCommonUniforms(ve,ys,null,ji);const vs=To.pbrMetallicRoughness;vs.metallicFactor=.9,vs.roughnessFactor=.5;const xl=Fg(vr,zs,Wa,Nr.globalMatrix,ce,Gn.opacity,vs.baseColorFactor,To.emissiveFactor,vs.metallicFactor,vs.roughnessFactor,To,ri,Se,[0,0,0],Ti,void 0,void 0,Rs);!cs&&(Xn.hasTranslucentParts||Gn.opacity<1)&&ys.draw(ce,ve.gl.TRIANGLES,ct,Tn.disabled,In.disabled,pn.backCCW,xl,Se.id,Yi.vertexBuffer,Yi.indexBuffer,Yi.segments,Se.paint,ce.transform.zoom,void 0,Er),ys.draw(ce,ve.gl.TRIANGLES,cs?at:ct,Tn.disabled,cs||Gn.opacity<1||Xn.hasTranslucentParts?In.alphaBlended:In.unblended,pn.backCCW,xl,Se.id,Yi.vertexBuffer,Yi.indexBuffer,Yi.segments,Se.paint,ce.transform.zoom,void 0,Er)}}}}if(ce._debugParams.show3DModelFootprints&&Jt.size>0){const or=Array.from(Jt.keys()).sort();for(const Fn of or){const{node:fr,mvp:Or}=Jt.get(Fn);X0(ce,0,fr,Or)}}})()})(p,o,d,_),void q();if(j.type!=="model")return;const Z=j.getModels(),te=[],ee=p.transform.getFreeCameraOptions().position,oe=a.bN([],[ee.x,ee.y,ee.z],p.transform.worldSize);a.ew(oe,oe);const se=[],de=[];let pe=0;for(const ce of Z){const Ce=o.getFeatureState("",ce.id),Se={type:"Unknown",id:ce.id,properties:ce.featureProperties},Re=d.paint.get("model-rotation").evaluate(Se,Ce),ve=d.paint.get("model-scale").evaluate(Se,Ce),be=d.paint.get("model-translation").evaluate(Se,Ce),Ae=d.paint.get("model-opacity").evaluate(Se,Ce);vw(d,ce.id,Ce,ce.featureProperties,ce.nodeOverrideNames,ce.nodeOverrides),bw(d,ce.id,Ce,ce.featureProperties,ce.materialOverrideNames,ce.materialOverrides),ce.nodeOverrides.size>
32980&&ce.computeBoundsAndApplyParent(),ce.computeModelMatrix(p,Re,ve,be,I,T,!1);const Ne=a.cK([],oe),De=a.e8(ce.position.lat,p.transform.zoom),Ye=a.bT([],[1,1,1/De]);te.push({zScaleMatrix:Ye,negCameraPosMatrix:Ne});for(const Ke of ce.nodes)Zg(p,Ke,ce.matrix,p.transform.expandedFarZProjMatrix,pe,se,de,ce.materialOverrides,Ae);pe++}if(se.sort((ce,Ce)=>Ce.depth-ce.depth),p.renderPass!=="shadow"){if(p._debugParams.show3DModelFootprints){const ce=p.transform.projMatrix,Ce=new Map,Se=(ve,be)=>{if(ve.footprint){const Ae=ve.id||ve.name||"footprint";if(!Ce.has(Ae)){const Ne=a.aC([],ce,be);Ce.set(Ae,{node:ve,mvp:Ne})}}};for(const ve of de)Se(ve.node,ve.modelMatrix);for(const ve of se)Se(ve.node,ve.modelMatrix);const Re=Array.from(Ce.keys()).sort();for(const ve of Re){const{node:be,mvp:Ae}=Ce.get(ve);X0(p,0,be,Ae)}}Z0(p,d,se,de,te),q()}else{for(const ce of de)Md(ce.mesh,ce.nodeModelMatrix,p,d);for(const ce of se)Md(ce.mesh,ce.nodeModelMatrix,p,d);q()}}},K0={line:function(p,o,d){if(p.hasElevatedBuckets=!1,p.hasNonElevatedBuckets=!1,p._unevaluatedLayout.getValue("line-elevation-reference")!==void 0||p._unevaluatedLayout.getValue("line-z-offset")!==void 0){if(o){const _=o.getVisibleCoordinates();for(const b of _){const S=o.getTile(b).getBucket(p);if(S&&(S.elevationType!=="none"?p.hasElevatedBuckets=!0:p.hasNonElevatedBuckets=!0,p.hasElevatedBuckets&&p.hasNonElevatedBuckets))break}}}else p.hasNonElevatedBuckets=!0},model:function(p,o,d){const _=o.getSource();if(!_.loaded())return;if(_.type==="vector"||_.type==="geojson")return void(d.modelManager&&d.modelManager.upload(d,Gp(d,p)));if(_.type==="batched-model"||_.type!=="model")return;const b=_.getModels();for(const S of b)S.upload(d.context)},raster:function(p,o,d){const _=o.getSource();if(!(_ instanceof Sn&&_.loaded()))return;const b=p.sourceLayer||_.rasterLayerIds&&_.rasterLayerIds[0];if(!b)return;const S=p.paint.get("raster-array-band")||_.getInitialBand(b);if(S==null)return;const T=o.getIds().map(I=>o.getTileByID(I));for(const I of T)I.updateNeeded(p.id,S)&&_.prepareTile(I,b,p.id,S)}},Cw={fill:Dt},sf={fill:function(p,o,d,_){if(!d.layout||d.layout.get("fill-elevation-reference")==="none"||d.paint.get("fill-opacity").constantOr(1)===0)return;const b=p.context.gl,S=new rn(b.LEQUAL,rn.ReadOnly,p.depthRangeFor3D),T=new Tn({func:b.ALWAYS,mask:255},255,255,b.KEEP,b.KEEP,b.REPLACE),I=p.transform.getFreeCameraOptions().position,k=p.getOrCreateProgram("elevatedStructuresDepthReconstruct");for(const F of _){const z=o.getTile(F),q=z.getBucket(d);if(!q)continue;const j=q.elevatedStructures;if(!j||!j.depthSegments||j.depthSegments.segments[0].primitiveLength===0)continue;const Z=Pt(F.toUnwrapped(),I),te=p.translatePosMatrix(F.projMatrix,z,d.paint.get("fill-translate"),d.paint.get("fill-translate-anchor")),ee=Jh(te,Z,0,1,0);k.draw(p,b.TRIANGLES,S,T,In.disabled,pn.disabled,ee,d.id,j.vertexBuffer,j.indexBuffer,j.depthSegments,d.paint,p.transform.zoom)}}};class Aw{constructor(o,d,_,b,S){this.context=new As(o,d),this.transform=_,this._tileTextures={},this.frameCopies=[],this.loadTimeStamps=[],this._debugParams={averageFPS:0,fpsHistory:[],fpsWindow:30,dt:0,timeStamp:a.o.now(),continousRedraw:!1,enabledLayers:{},buildingsShowNormals:!1,buildingsDrawGroundAO:!0,buildingsDrawShadowPass:!0,buildingsDrawTranslucentPass:!0,showTerrainProxyTiles:!1,terrainSortTilesHiZFirst:!0,terrainDisableRenderCache:!1,forceEnablePrecipitation:!1,overrideSnowParams:!1,snowParamsOverride:null,snowRevealParamsOverride:null,snowVignetteParamsOverride:null,overrideRainParams:!1,rainParamsOverride:null,rainRevealParamsOverride:null,rainVignetteParamsOverride:null,overrideStarsParams:!1,starsParamsOverride:null,show3DModelFootprints:!1,showElevationIdDebug:!1,lodSwitchDistance:3e3},this.occlusionParams=new of,this.setup(),this.numSublayers=ur.maxUnderzooming+ur.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.deferredRenderGpuTimeQueries=[],this.gpuTimers={},this.frameCounter=0,this._shadowCullCache=null,this._backgroundTiles={},this.conflationActive=!1,this.replacementSource=new a.eJ,this.longestCutoffRange=0,this.minCutoffZoom=0,this._fogVisible=!1,this._cachedTileFogOpacities={},this._shadowRenderer=new P1(this),this._wireframeDebugCache=new Wr,this.renderDefaultNorthPole=!0,this.renderDefaultSouthPole=!0,this.layersWithOcclusionOpacity=[];const T=new a.q({width:1,height:1},Uint8Array.of(0,0,0,0));
3298this.emptyDepthTexture=new a.T(this.context,T,o.RGBA8),this._clippingActiveLastFrame=!1,this.scaleFactor=b,this.maxFrontCutoffRawStart=0,this.worldview=S,this._forceEmissiveMode=!1,this.emissiveMode="constant"}updateTerrain(o,d){const _=!!o&&!!o.terrain&&this.transform.projection.supportsTerrain;if(!(_||this._terrain&&this._terrain.enabled))return;this._terrain||(this._terrain=new kc(this,o));const b=this._terrain;this.transform.elevation=_?b:null,b.update(o,this.transform,d),this.transform.elevation&&!b.enabled&&(this.transform.elevation=null)}_updateFog(o){const d=o.fog;if(!d||this.transform.projection.name==="globe"||d.getOpacity(this.transform.pitch)<1||d.properties.get("horizon-blend")<.03)return void(this.transform.fogCullDistSq=null);const[_,b]=d.getRangeForProjection();if(_>b)return void(this.transform.fogCullDistSq=null);const S=_+.78*(b-_);this.transform.fogCullDistSq=S*S}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled||this._forceTerrainMode?this._terrain:null}get forceTerrainMode(){return this._forceTerrainMode}set forceTerrainMode(o){o&&!this._terrain&&(this._terrain=new kc(this,this.style)),this._forceTerrainMode=o}get shadowRenderer(){return this._shadowRenderer&&this._shadowRenderer.enabled?this._shadowRenderer:null}get wireframeDebugCache(){return this._wireframeDebugCache}resize(o,d){if(this.width=o*a.o.devicePixelRatio,this.height=d*a.o.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const _ of this.style.order)this.style._mergedLayers[_].resize()}setup(){const o=this.context,d=new a.dE;d.emplaceBack(0,0),d.emplaceBack(a.ak,0),d.emplaceBack(0,a.ak),d.emplaceBack(a.ak,a.ak),this.tileExtentBuffer=o.createVertexBuffer(d,a.dA.members),this.tileExtentSegments=a.dB.simpleSegment(0,0,4,2);const _=new a.dE;_.emplaceBack(0,0),_.emplaceBack(a.ak,0),_.emplaceBack(0,a.ak),_.emplaceBack(a.ak,a.ak),this.debugBuffer=o.createVertexBuffer(_,a.dA.members),this.debugSegments=a.dB.simpleSegment(0,0,4,5);const b=new a.dE;b.emplaceBack(-1,-1),b.emplaceBack(1,-1),b.emplaceBack(-1,1),b.emplaceBack(1,1),this.viewportBuffer=o.createVertexBuffer(b,a.dA.members),this.viewportSegments=a.dB.simpleSegment(0,0,4,2);const S=new a.eK;S.emplaceBack(0,0,0,0),S.emplaceBack(a.ak,0,a.ak,0),S.emplaceBack(0,a.ak,0,a.ak),S.emplaceBack(a.ak,a.ak,a.ak,a.ak),this.mercatorBoundsBuffer=o.createVertexBuffer(S,a.eL.members),this.mercatorBoundsSegments=a.dB.simpleSegment(0,0,4,2);const T=new a.dF;T.emplaceBack(0,1,2),T.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=o.createIndexBuffer(T);const I=new a.eM;for(const F of[0,1,3,2,0])I.emplaceBack(F);this.debugIndexBuffer=o.createIndexBuffer(I),this.emptyTexture=new a.T(o,new a.q({width:1,height:1},Uint8Array.of(0,0,0,0)),o.gl.RGBA8),this.identityMat=a.bd();const k=this.context.gl;this.stencilClearMode=new Tn({func:k.ALWAYS,mask:0},0,255,k.ZERO,k.ZERO,k.ZERO),this.loadTimeStamps.push(performance.now())}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(o){return o._makeTileBoundsBuffers(this.context,this.transform.projection),o._tileBoundsBuffer?{tileBoundsBuffer:o._tileBoundsBuffer,tileBoundsIndexBuffer:o._tileBoundsIndexBuffer,tileBoundsSegments:o._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const o=this.context.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.getOrCreateProgram("clippingMask").draw(this,o.TRIANGLES,rn.disabled,this.stencilClearMode,In.disabled,pn.disabled,Cd(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(o,d,_){if(!d||this.currentStencilSource===d.id||!o.isTileClipped()||!_||_.length===0)return;if(this._tileClippingMaskIDs&&!this.terrain){let I=!1;for(const k of _)if(this._tileClippingMaskIDs[k.key]===void 0){I=!0;break}if(!I)return}this.currentStencilSource=d.id;const b=this.context,S=b.gl;this.nextStencilID+_.length>256&&this.clearStencil(),b.setColorMode(In.disabled),b.setDepthMode(rn.disabled);const T=this.getOrCreateProgram("clippingMask");this._tileClippingMaskIDs={};for(const I of _){const k=d.getTile(I),F=this._tileClippingMaskIDs[I.key]=this.nextStencilID++,{tileBoundsBuffer:z,tileBoundsIndexBuffer:q,tileBoundsSegments:j}=this.getTileBoundsBuffers(k);T.draw(this,S.TRIANGLES,rn.disabled,new Tn({func:S.ALWAYS,mask:0},F,255,S.KEEP,S.KEEP,S.REPLACE),In.disabled,pn.disabled,Cd(I.projMatrix),"$clipping",z,q,j)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const o=this.nextStencilID++,d=this.context.gl;return new Tn({func:d.NOTEQUAL,mask:255},o,255,d.KEEP,d.KEEP,d.REPLACE)}stencilModeForClipping(o){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(o);const d=this.context.gl;return new Tn({func:d.EQUAL,mask:255},this._tileClippingMaskIDs[o.key],0,d.KEEP,d.KEEP,d.REPLACE)}stencilConfigForOverlap(o){const d=this.context.gl,_=o.sort((T,I)=>
3298I.overscaledZ-T.overscaledZ),b=_.at(-1).overscaledZ,S=_[0].overscaledZ-b+1;if(S>1){this.currentStencilSource=void 0,this.nextStencilID+S>256&&this.clearStencil();const T={};for(let I=0;I<S;I++)T[I+b]=new Tn({func:d.GEQUAL,mask:255},I+this.nextStencilID,255,d.KEEP,d.KEEP,d.REPLACE);return this.nextStencilID+=S,[T,_]}return[{[b]:Tn.disabled},_]}colorModeForRenderPass(){const o=this.context.gl;return this._showOverdrawInspector?new In([o.CONSTANT_COLOR,o.ONE,o.CONSTANT_COLOR,o.ONE],new a.C(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?In.unblended:In.alphaBlended}colorModeForDrapableLayerRenderPass(o){const d=this.context.gl;return this.style&&this.style.enable3dLights()&&this.terrain&&this.terrain.renderingToTexture&&this.renderPass==="translucent"?o!=null&&this.emissiveMode!=="mrt-fallback"||this.emissiveMode==="constant"?new In([d.ONE,d.ONE_MINUS_SRC_ALPHA,d.CONSTANT_ALPHA,d.ONE_MINUS_SRC_ALPHA],new a.C(0,0,0,o??0),[!0,!0,!0,!0]):this.emissiveMode==="dual-source-blending"?new In([d.ONE,d.ONE_MINUS_SRC_ALPHA,this.context.extBlendFuncExtended.SRC1_ALPHA_WEBGL,d.ONE_MINUS_SRC_ALPHA],a.C.transparent,[!0,!0,!0,!0]):this.colorModeForRenderPass():this.colorModeForRenderPass()}depthModeForSublayer(o,d,_,b=!1){if(this.depthOcclusion)return new rn(this.context.gl.GREATER,rn.ReadOnly,this.depthRangeFor3D);if(!this.opaquePassEnabledForLayer()&&!b)return rn.disabled;const S=1-((1+this.currentLayer)*this.numSublayers+o)*this.depthEpsilon;return new rn(_||this.context.gl.LEQUAL,d,[S,S])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}blitDepth(){const o=this.context.gl,d=Math.ceil(this.width),_=Math.ceil(this.height),b=this.context.bindFramebuffer.get(),S=o.getParameter(o.TEXTURE_BINDING_2D);this.depthFBO&&this.depthFBO.width===d&&this.depthFBO.height===_||(this.depthFBO&&(this.depthFBO.destroy(),this.depthFBO=void 0,this.depthTexture=void 0),d!==0&&_!==0&&(this.depthFBO=new Cu(this.context,d,_,0,"texture"),this.depthTexture=new a.T(this.context,{width:d,height:_,data:null},o.DEPTH24_STENCIL8),this.depthFBO.depthAttachment.set(this.depthTexture.texture))),this.context.bindFramebuffer.set(b),o.bindTexture(o.TEXTURE_2D,S),this.depthFBO&&(o.bindFramebuffer(o.READ_FRAMEBUFFER,null),o.bindFramebuffer(o.DRAW_FRAMEBUFFER,this.depthFBO.framebuffer),o.blitFramebuffer(0,0,d,_,0,0,d,_,o.DEPTH_BUFFER_BIT,o.NEAREST),o.bindFramebuffer(o.FRAMEBUFFER,this.context.bindFramebuffer.current))}render(o,d){this.context.sweepPendingPrograms(),this._wireframeDebugCache.update(this.frameCounter),this.style=o,this.options=d;const _=this.style._mergedLayers,b=!(!this.terrain||!this.terrain.enabled),S=()=>this.style._getOrder(b);let T=S(),I=!1,k=!1,F=null,z=0,q=!1;for(const Ue of T){const rt=_[Ue];rt.visibility!=="none"&&(rt.type==="circle"?I=!0:rt.type==="building"?(F=rt,++z):rt.type==="symbol"&&(rt.hasOcclusionOpacityProperties?k=!0:I=!0))}this.updateEmissiveMode();let j=T.map(Ue=>_[Ue]);const Z=this.style._mergedSourceCaches;this.imageManager=o.imageManager,this.modelManager=o.modelManager,this.symbolFadeChange=o.placement.symbolFadeChange(a.o.now()),this.imageManager.beginFrame();for(const Ue in Z){const rt=Z[Ue];rt.used&&(rt.prepare(this.context),rt.getSource().usedInConflation&&++z)}let te=!1;for(const Ue of j)Ue.isHidden(this.transform.zoom)||(Ue.type==="clip"&&(te=!0),this.prepareLayer(Ue));const ee={},oe={},se={},de={},pe={};for(const Ue in Z){const rt=Z[Ue];ee[Ue]=rt.getVisibleCoordinates(),oe[Ue]=ee[Ue].slice().reverse(),se[Ue]=rt.getVisibleCoordinates(!0).reverse(),de[Ue]=rt.getShadowCasterCoordinates(),pe[Ue]=rt.sortCoordinatesByDistance(ee[Ue])}const ce=Ue=>{const rt=this.style.getLayerSourceCache(Ue);return rt&&rt.used?rt.getSource():null};if(z||te||this._clippingActiveLastFrame){const Ue=[],rt=[];let $e=0;for(const ct of j)this.isSourceForClippingOrConflation(ct,ce(ct))&&(Ue.push(ct),rt.push($e)),$e++;if(Ue&&(te||Ue.length>1)||this._clippingActiveLastFrame){te=!1;const ct=[];for(let at=0;at<Ue.length;at++){const dt=Ue[at],Gt=rt[at],Mt=this.style.getLayerSourceCache(dt);if(!Mt||!Mt.used||!Mt.getSource().usedInConflation&&dt.type!=="clip"&&dt.type!=="building")continue;let Ct=a.eN,xt=a.bE.None;const dn=[];let an=!0;if(dt.type==="building")Ct=a.eP;else if(dt.type==="clip")if(Ct=Gt,dt.isHidden(this.transform.zoom))an=!1;else{if(!dt.layout){an=!1;continue}
3298for(const Jt of dt.layout.get("clip-layer-types"))xt|=Jt==="model"?a.bE.Model:Jt==="symbol"?a.bE.Symbol:a.bE.FillExtrusion;for(const Jt of dt.layout.get("clip-layer-scope"))dn.push(a.t(Jt,dt.scope));te=!0}an&&ct.push({layer:dt.fqid,cache:Mt,order:Ct,clipMask:xt,clipScope:dn})}this.replacementSource.setSources(ct),q=!0}}this._clippingActiveLastFrame=te,q||this.replacementSource.clear(),this.conflationActive=q,this.minCutoffZoom=0,this.longestCutoffRange=0,this.maxFrontCutoffRawStart=0,this.opaquePassCutoff=1/0,this._lastOcclusionLayer=-1,this.layersWithOcclusionOpacity=[];for(let Ue=0;Ue<j.length;Ue++){const rt=j[Ue];if(rt.visibility==="none")continue;const $e=rt.cutoffRange();if(this.longestCutoffRange=Math.max($e,this.longestCutoffRange),$e>0){const ct=ce(rt);ct&&(this.minCutoffZoom=Math.max(ct.minzoom,this.minCutoffZoom)),rt.minzoom&&(this.minCutoffZoom=Math.max(rt.minzoom,this.minCutoffZoom))}rt.is3D(b)&&(this.opaquePassCutoff===1/0&&(this.opaquePassCutoff=Ue),this._lastOcclusionLayer=Ue)}const Ce=this.style&&this.style.fog;Ce?(this._fogVisible=Ce.getOpacity(this.transform.pitch)!==0,this._fogVisible&&this.transform.projection.name!=="globe"&&(this._fogVisible=Ce.isVisibleOnFrustum(this.transform.cameraFrustum))):this._fogVisible=!1,this._cachedTileFogOpacities={},this.terrain&&(this.terrain.updateTileBinding(se),this.opaquePassCutoff=0,T=S(),j=T.map(Ue=>_[Ue]));const Se=this._shadowRenderer;if(Se){Se.updateShadowParameters(this.transform,this.style.directionalLight);for(const Ue in Z)for(const rt of ee[Ue]){let $e={min:0,max:0};this.terrain&&($e=this.terrain.getMinMaxForTile(rt)||$e),Se.addShadowReceiver(rt.toUnwrapped(),$e.min,$e.max)}}this.transform.projection.name!=="globe"||this.globeSharedBuffers||(this.globeSharedBuffers=new a.eO(this.context)),this.style.fog&&this.transform.projection.supportsFog?(this._atmosphere||(this._atmosphere=new Rd),this._atmosphere.update(this)):this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=void 0);let Re=!(!this.style||!this.style.snow),ve=!(!this.style||!this.style.rain);if(Re&&!this._snow&&Zo.Snow&&(this._snow=new Zo.Snow),!Re&&this._snow&&(this._snow.destroy(),delete this._snow),ve&&!this._rain&&Zo.Rain&&(this._rain=new Zo.Rain),!ve&&this._rain&&(this._rain.destroy(),delete this._rain),this._snow&&this._snow.update(this),this._rain&&this._rain.update(this),F){this.buildingTileBorderManager||(this.buildingTileBorderManager=new W0);const Ue=this.style.getLayerSourceCache(F);this.buildingTileBorderManager.updateBorders(Ue,F)}if(!st.has(this.context.gl))return;this.renderPass="offscreen";for(const Ue of j){const rt=o.getLayerSourceCache(Ue);if(!Ue.hasOffscreenPass()||Ue.isHidden(this.transform.zoom))continue;const $e=rt?oe[rt.id]:void 0;(Ue.type==="custom"||Ue.type==="raster"||Ue.type==="raster-particle"||Ue.isSky()||$e&&$e.length)&&this.renderLayer(this,rt,Ue,$e)}this.depthRangeFor3D=[0,1-(j.length+2)*this.numSublayers*this.depthEpsilon],this._shadowRenderer&&(this.renderPass="shadow",this._shadowRenderer.drawShadowPass(this.style,de)),this.context.bindFramebuffer.set(null),this.context.viewport.set([0,0,this.width,this.height]);const be=this.transform.projection.name==="globe"||this.transform.isHorizonVisible(),Ae=(()=>{if(d.showOverdrawInspector)return a.C.black;const Ue=this.style.fog;if(Ue&&this.transform.projection.supportsFog){const rt=this.style.getLut(Ue.scope);if(!be){const $e=Ue.properties.get("color-use-theme")==="none",ct=Ue.properties.get("color").toNonPremultipliedRenderColor($e?null:rt).toArray01();return new a.C(...ct)}if(be){const $e=Ue.properties.get("space-color-use-theme")==="none",ct=Ue.properties.get("space-color").toNonPremultipliedRenderColor($e?null:rt).toArray01();return new a.C(...ct)}}return a.C.transparent})();if(this.context.clear({color:Ae,depth:1}),this.clearStencil(),this._showOverdrawInspector=d.showOverdrawInspector,this.renderPass="opaque",this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&be&&this._atmosphere.drawStars(this,this.style.fog),!this.terrain)for(this.currentLayer=T.length-1;this.currentLayer>=0;this.currentLayer--){const Ue=j[this.currentLayer],rt=o.getLayerSourceCache(Ue);if(Ue.isSky())continue;const $e=rt?(Ue.is3D(b)?pe:oe)[rt.id]:void 0;this._renderTileClippingMasks(Ue,rt,$e),this.renderLayer(this,rt,Ue,$e)}if(this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&be&&this._atmosphere.drawAtmosphereGlow(this,this.style.fog),this.renderPass="sky",(!this._atmosphere||a.ai(this.transform.zoom)>0)&&(this.transform.projection.name==="globe"||this.transform.isH
3298orizonVisible()))for(this.currentLayer=0;this.currentLayer<T.length;this.currentLayer++){const Ue=j[this.currentLayer],rt=o.getLayerSourceCache(Ue);Ue.isSky()&&this.renderLayer(this,rt,Ue,rt?oe[rt.id]:void 0)}function Ne(Ue,rt){let $e;return rt&&($e=(Ue.type==="symbol"?se:Ue.is3D(b)?pe:oe)[rt.id]),$e}if(this.renderPass="translucent",this.transform.projection.name==="globe"){for(this.renderElevatedRasterBackface=!0,this.currentLayer=0;this.currentLayer<T.length;){const Ue=j[this.currentLayer];if(Ue.type==="raster"||Ue.type==="raster-particle"){const rt=o.getLayerSourceCache(Ue);this.renderLayer(this,rt,Ue,Ne(Ue,rt))}++this.currentLayer}this.renderElevatedRasterBackface=!1}this.currentLayer=0,this.firstLightBeamLayer=Number.MAX_SAFE_INTEGER;const De=Se?Se.getGroundShadowLayerIndex():-1;let Ye=!1,Ke=-1;for(let Ue=0;Ue<T.length;++Ue){const rt=j[Ue];rt.isHidden(this.transform.zoom)||rt.is3D(b)&&(Ke=Ue)}k&&Ke===-1&&(I=!0);let Tt=!1;for(;this.currentLayer<T.length;){const Ue=j[this.currentLayer],rt=o.getLayerSourceCache(Ue);if(Ue.isSky())++this.currentLayer;else if(this.terrain&&this.style.isLayerDraped(Ue)){if(Ue.isHidden(this.transform.zoom)){++this.currentLayer;continue}this.currentLayer=this.terrain.renderBatch(this.currentLayer),this._lastOcclusionLayer=Math.max(this.currentLayer,this._lastOcclusionLayer)}else{if(!Tt&&Ue.is3D(b)&&!b){const $e=this.currentLayer,ct=at=>{for(this.currentLayer=0;this.currentLayer<j.length;this.currentLayer++){const dt=j[this.currentLayer];if(Cw[dt.type]){const Gt=this.style.getLayerSourceCache(dt);Cw[dt.type](this,Gt,dt,Ne(dt,Gt),at)}}};ct("initialize"),ct("reset"),this.currentLayer=$e,Tt=!0}if(I&&!Ye&&this.terrain&&!this.transform.isOrthographic&&(Ye=!0,this.blitDepth()),k&&Ke!==-1&&this.currentLayer===Ke+1&&!this.transform.isOrthographic&&this.blitDepth(),this.terrain||this._renderTileClippingMasks(Ue,rt,rt?ee[rt.id]:void 0),this.renderLayer(this,rt,Ue,Ne(Ue,rt)),!this.terrain&&Se&&this.currentLayer===De){{this.clearStencil(),this.resetStencilClippingMasks();const $e=this.currentLayer;for(this.currentLayer=0;this.currentLayer<j.length;this.currentLayer++){const ct=j[this.currentLayer];if(sf[ct.type]){const at=this.style.getLayerSourceCache(ct);sf[ct.type](this,at,ct,Ne(ct,at))}}this.currentLayer=$e}if(Se.drawGroundShadows(),this.firstLightBeamLayer<=this.currentLayer){const $e=this.currentLayer;for(this.renderPass="light-beam",this.currentLayer=this.firstLightBeamLayer;this.currentLayer<=$e;this.currentLayer++){const ct=j[this.currentLayer];if(!ct.hasLightBeamPass())continue;const at=o.getLayerSourceCache(ct);this.renderLayer(this,at,ct,at?oe[at.id]:void 0)}this.currentLayer=$e,this.renderPass="translucent"}}if(this.currentLayer>=this._lastOcclusionLayer&&this.layersWithOcclusionOpacity.length>0){const $e=this.currentLayer;this.depthOcclusion=!0;for(const ct of this.layersWithOcclusionOpacity){this.currentLayer=ct;const at=j[this.currentLayer],dt=o.getLayerSourceCache(at),Gt=dt?oe[dt.id]:void 0;this.terrain||this._renderTileClippingMasks(at,dt,dt?ee[dt.id]:void 0),this.renderLayer(this,dt,at,Gt)}this.depthOcclusion=!1,this.currentLayer=$e,this.renderPass="translucent",this.layersWithOcclusionOpacity=[]}++this.currentLayer}}if(this.terrain&&this.terrain.postRender(),this._snow&&this._snow.draw(this),this._rain&&this._rain.draw(this),this.options.showTileBoundaries||this.options.showQueryGeometry||this.options.showTileAABBs){let Ue=null;
3298j.forEach(rt=>{const $e=o.getLayerSourceCache(rt);$e&&!rt.isHidden(this.transform.zoom)&&$e.getVisibleCoordinates().length&&(!Ue||Ue.getSource().maxzoom<$e.getSource().maxzoom)&&(Ue=$e)}),Ue&&this.options.showTileBoundaries&&(function(rt,$e,ct,at,dt,Gt){for(let Mt=0;Mt<ct.length;Mt++)U0(rt,$e,ct[Mt],at,0,0,Gt)})(this,Ue,Ue.getVisibleCoordinates(),a.C.red,0,this.options.showParseStatus)}this.options.showPadding&&(function(Ue){const rt=Ue.transform.padding;Oc(Ue,Ue.transform.height-(rt.top||0),3,Ta),Oc(Ue,rt.bottom||0,3,Pu),Hg(Ue,rt.left||0,3,nf),Hg(Ue,Ue.transform.width-(rt.right||0),3,Gg);const $e=Ue.transform.centerPoint;(function(ct,at,dt,Gt){Bs(ct,at-1,dt-10,2,20,Gt),Bs(ct,at-10,dt-1,20,2,Gt)})(Ue,$e.x,Ue.transform.height-$e.y,V0)})(this),this.context.setDefault(),this.frameCounter=(this.frameCounter+1)%Number.MAX_SAFE_INTEGER,this.tileLoaded&&this.options.speedIndexTiming&&(this.loadTimeStamps.push(performance.now()),this.saveCanvasCopy()),q||(this.conflationActive=!1)}prepareLayer(o){this.gpuTimingStart(o);const{unsupportedLayers:d}=this.transform.projection,_=!d||!d.includes(o.type);if(K0[o.type]&&(_||this.terrain&&o.type==="custom")){const b=this.style.getLayerSourceCache(o);K0[o.type](o,b,this)}this.gpuTimingEnd()}renderLayer(o,d,_,b){_.isHidden(this.transform.zoom)||(_.type==="background"||_.type==="sky"||_.type==="custom"||_.type==="model"||_.type==="raster"||_.type==="raster-particle"||b&&b.length)&&(this.id=_.id,this.gpuTimingStart(_),(!o.transform.projection.unsupportedLayers||!o.transform.projection.unsupportedLayers.includes(_.type)||o.terrain&&_.type==="custom")&&_.type!=="clip"&&_.type!=="slot"&&Yg[_.type]&&Yg[_.type](o,d,_,b,this.style.placement.variableOffsets,this.options.isInitialLoad),Yg[_.type]||(async function(){await(async function(){return Promise.resolve()})(),Object.assign(Yg,{building:Zo.drawBuilding,"raster-particle":Zo.drawRasterParticle}),Object.assign(K0,{"raster-particle":Zo.prepareRasterParticle})})(),this.gpuTimingEnd())}gpuTimingStart(o){if(!this.options.gpuTiming)return;const d=this.context.extTimerQuery,_=this.context.gl;let b=this.gpuTimers[o.id];b||(b=this.gpuTimers[o.id]={calls:0,cpuTime:0,query:_.createQuery()}),b.calls++,_.beginQuery(d.TIME_ELAPSED_EXT,b.query)}gpuTimingDeferredRenderStart(){if(this.options.gpuTimingDeferredRender){const o=this.context.extTimerQuery,d=this.context.gl,_=d.createQuery();this.deferredRenderGpuTimeQueries.push(_),d.beginQuery(o.TIME_ELAPSED_EXT,_)}}gpuTimingDeferredRenderEnd(){this.options.gpuTimingDeferredRender&&this.context.gl.endQuery(this.context.extTimerQuery.TIME_ELAPSED_EXT)}gpuTimingEnd(){this.options.gpuTiming&&this.context.gl.endQuery(this.context.extTimerQuery.TIME_ELAPSED_EXT)}collectGpuTimers(){const o=this.gpuTimers;return this.gpuTimers={},o}collectDeferredRenderGpuQueries(){const o=this.deferredRenderGpuTimeQueries;return this.deferredRenderGpuTimeQueries=[],o}queryGpuTimers(o){const d={};for(const _ in o){const b=o[_],S=this.context.extTimerQuery,T=S.getQueryParameter(b.query,this.context.gl.QUERY_RESULT)/1e6;S.deleteQueryEXT(b.query),d[_]=T}return d}queryGpuTimeDeferredRender(o){if(!this.options.gpuTimingDeferredRender)return 0;const d=this.context.gl;let _=0;for(const b of o)_+=d.getQueryParameter(b,d.QUERY_RESULT)/1e6,d.deleteQuery(b);return _}translatePosMatrix(o,d,_,b,S){if(!_[0]&&!_[1])return o;const T=S?b==="map"?this.transform.angle:0:b==="viewport"?-this.transform.angle:0;if(T){const F=Math.sin(T),z=Math.cos(T);_=[_[0]*z-_[1]*F,_[0]*F+_[1]*z]}const I=[S?_[0]:a.az(d,_[0],this.transform.zoom),S?_[1]:a.az(d,_[1],this.transform.zoom),0],k=new Float32Array(16);return a.bB(k,o,I),k}saveTileTexture(o){if(o.context!==this.context)return;const d=o.size[0],_=this._tileTextures[d];_?_.push(o):this._tileTextures[d]=[o]}getTileTexture(o){const d=this._tileTextures[o];return d&&d.length>0?d.pop():null}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture||this.forceTerrainMode}linearFloatFilteringSupported(){return this.context.extTextureFloatLinear!=null}currentGlobalDefines(o,d,_,b,S){const T=_===void 0?this.terrain&&this.terrain.renderingToTexture:_,I=b===void 0?this.terrainRenderModeElevated():b,k=S===void 0?this.transform.projection.name==="globe":S,F=[];return this.style&&this.style.enable3dLights()&&(o==="globeRaster"||o==="terrainRaster"?(F.push("LIGHTING_3D_MODE"),F.push("LIGHTING_3D_ALPHA_EMISSIVENESS")):T||F.push("LIGHTING_3D_MODE")),I&&(F.push("TERRAIN"),this.linearFloatFilteringSupported()&&F.push("TERRAIN_DEM_FLOAT_FORMAT")),k&&F.push("GLOBE"),!this._fogVisible||T||d!==void 0&&!d||F.push("FOG"),T&&F.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&F.push("OVERDRAW_INSPECTOR"),F}getOrCreateProgram(o,d){this.cache=this.cache||{};const{defines:_,config:b,overrideFog:S,overrideRtt:T,overrideTerrain:I,overrideGlobe:k,precompiled:F}=d||{}
3298,z=this.currentGlobalDefines(o,S,T,I,k).concat(_||[]),q=this.getShaderSource(o),j=lw[o]||Zo.programUniforms[o],Z=b0.cacheKey(q,o,z,b);return this.cache[Z]||(this.cache[Z]=new b0(this.context,o,q,b,j,z,F)),this.cache[Z]}getShaderSource(o){return y2[o]||Zo.shaders&&Zo.shaders[o]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const o=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(o.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new a.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA8))}destroy(){this._terrain&&this._terrain.destroy(),this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=void 0),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this._wireframeDebugCache.destroy(),this.depthFBO&&(this.depthFBO.destroy(),this.depthFBO=void 0,this.depthTexture=void 0),this.emptyDepthTexture&&this.emptyDepthTexture.destroy()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}uploadCommonLightUniforms(o,d){if(this.style.enable3dLights()){const _=this.style.directionalLight,b=this.style.ambientLight;if(_&&b){const S=((T,I,k)=>{const F=T.properties.get("direction"),z=T.properties.get("color-use-theme")==="none",q=T.properties.get("color").toNonPremultipliedRenderColor(z?null:k.getLut(T.scope)).toArray01(),j=T.properties.get("intensity"),Z=I.properties.get("color-use-theme")==="none",te=I.properties.get("color").toNonPremultipliedRenderColor(Z?null:k.getLut(I.scope)).toArray01(),ee=I.properties.get("intensity"),oe=[F.x,F.y,F.z],se=a.dG(te,ee),de=a.dG(q,j);return{u_lighting_ambient_color:se,u_lighting_directional_dir:oe,u_lighting_directional_color:de,u_ground_radiance:q1(oe,de,se)}})(_,b,this.style);d.setLightsUniformValues(o,S)}}}uploadCommonUniforms(o,d,_,b,S){if(this.uploadCommonLightUniforms(o,d),this.terrain&&this.terrain.renderingToTexture)return;const T=this.style.fog;if(T){const I=T.getOpacity(this.transform.pitch),k=((F,z,q,j,Z,te,ee,oe,se,de,pe,ce)=>{const Ce=F.transform,Se=z.properties.get("color-use-theme")==="none",Re=z.properties.get("color").toNonPremultipliedRenderColor(Se?null:F.style.getLut(z.scope)).toArray01();Re[3]=j;const ve=F.frameCounter/1e3%1,[be,Ae]=z.properties.get("vertical-range");return{u_fog_matrix:q?Ce.calculateFogTileMatrix(q):ce||F.identityMat,u_fog_range:z.getRangeForProjection(),u_fog_color:Re,u_fog_horizon_blend:z.properties.get("horizon-blend"),u_fog_vertical_limit:[Math.min(be,Ae),Ae],u_fog_temporal_offset:ve,u_frustum_tl:Z,u_frustum_tr:te,u_frustum_br:ee,u_frustum_bl:oe,u_globe_pos:se,u_globe_radius:de,u_viewport:pe,u_globe_transition:a.ai(Ce.zoom),u_is_globe:+(Ce.projection.name==="globe")}})(this,T,_,I,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*a.o.devicePixelRatio,this.transform.height*a.o.devicePixelRatio],b);d.setFogUniformValues(o,k)}S&&d.setCutoffUniformValues(o,S.uniformValues)}setTileLoadedFlag(o){this.tileLoaded=o}saveCanvasCopy(){const o=this.canvasCopy();o&&(this.frameCopies.push(o),this.tileLoaded=!1)}canvasCopy(){const o=this.context.gl,d=o.createTexture();return o.bindTexture(o.TEXTURE_2D,d),o.copyTexImage2D(o.TEXTURE_2D,0,o.RGBA,0,0,o.drawingBufferWidth,o.drawingBufferHeight,0),d}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const o=this.style&&this.style.fog;return!!o&&o.getOpacity(this.transform.pitch)!==0}
3298getBackgroundTiles(){const o=this._backgroundTiles,d=this._backgroundTiles={},_=this.transform.coveringTiles({tileSize:512});for(const b of _)d[b.key]=o[b.key]||new a.b3(b,512,this.transform.tileZoom,this,void 0,this.worldview);return d}clearBackgroundTiles(){this._backgroundTiles={}}isSourceForClippingOrConflation(o,d){return!(!o.is3D(!(!this.terrain||!this.terrain.enabled))||o.type!=="clip"&&o.type!=="building"&&(o.minzoom&&o.minzoom>this.transform.zoom||(this.style._clipLayerPresent||o.sourceLayer!=="building"&&o.sourceLayer!=="procedural_buildings")&&(!d||d.type!=="batched-model")))}isTileAffectedByFog(o){if(!this.style||!this.style.fog)return!1;if(this.transform.projection.name==="globe")return!0;let d=this._cachedTileFogOpacities[o.key];return d||(this._cachedTileFogOpacities[o.key]=d=this.style.fog.getOpacityForTile(o)),d[0]>=Cc||d[1]>=Cc}setupDepthForOcclusion(o,d,_){const b=this.context,S=b.gl,T=!!_;var I;_||(_={u_dem:2,u_dem_prev:4,u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_depth_range_unpack:[0,1],u_occluder_half_size:16,u_occlusion_depth_offset:-1e-4,u_exaggeration:0}),b.activeTexture.set(S.TEXTURE3),o&&this.depthFBO&&this.depthTexture?(this.depthTexture.bind(S.NEAREST,S.CLAMP_TO_EDGE),_.u_depth_size_inv=[1/this.depthFBO.width,1/this.depthFBO.height],_.u_depth_range_unpack=[2/((I=this.depthRangeFor3D)[1]-I[0]),-1-2*I[0]/(I[1]-I[0])],_.u_occluder_half_size=.5*this.occlusionParams.occluderSize,_.u_occlusion_depth_offset=this.occlusionParams.depthOffset):this.emptyDepthTexture.bind(S.NEAREST,S.CLAMP_TO_EDGE),b.activeTexture.set(S.TEXTURE0),T||d.setTerrainUniformValues(b,_)}updateEmissiveMode(){if(this._forceEmissiveMode)return;const o=this.style.hasDataDrivenEmissiveStrength();this.emissiveMode=o?this.context.extBlendFuncExtended?"dual-source-blending":"mrt-fallback":"constant"}}function Kg(p,o){let d=!1,_=null;const b=()=>{_=null,d&&(p(),_=setTimeout(b,o),d=!1)};return()=>(d=!0,_||b(),_)}const Jg=/(#.+)?$/;class Jl{constructor(o){this._hashName=o&&encodeURIComponent(o),a.b0(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=Kg(this._updateHashUnthrottled.bind(this),300)}addTo(o){return this._map=o,window.addEventListener("hashchange",this._onHashChange,!1),o.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const o=this._map;if(!o)return"";const d=Hp(o);if(this._hashName){const _=this._hashName;let b=!1;const S=location.hash.slice(1).split("&").map(T=>{const I=T.split("=")[0];return I===_?(b=!0,`${I}=${d}`):T}).filter(T=>T);return b||S.push(`${_}=${d}`),`#${S.join("&")}`}return`#${d}`}_getCurrentHash(){const o=location.hash.replace("#","");if(this._hashName){let d;return o.split("&").map(_=>_.split("=")).forEach(_=>{_[0]===this._hashName&&(d=_)}),(d&&d[1]||"").split("/")}return o.split("/")}_onHashChange(){const o=this._map;if(!o)return!1;const d=this._getCurrentHash();if(d.length>=3&&!d.some(_=>isNaN(Number(_)))){const _=o.dragRotate.isEnabled()&&o.touchZoomRotate.isEnabled()?+(d[3]||0):o.getBearing();return o.jumpTo({center:[+d[2],+d[1]],zoom:+d[0],bearing:_,pitch:+(d[4]||0)}),!0}return!1}_updateHashUnthrottled(){history.replaceState(history.state,"",location.href.replace(Jg,this.getHashString()))}}function Hp(p,o){const d=p.getCenter(),_=Math.round(100*p.getZoom())/100,b=Math.ceil((_*Math.LN2+Math.log(512/360/.5))/Math.LN10),S=Math.pow(10,b),T=Math.round(d.lng*S)/S,I=Math.round(d.lat*S)/S,k=p.getBearing(),F=p.getPitch();let z=o?`/${T}/${I}/${_}`:`${_}/${I}/${T}`;return(k||F)&&(z+="/"+Math.round(10*k)/10),F&&(z+=`/${Math.round(F)}`),z}const Ui={linearity:.3,easing:a.eQ(0,0,.3,1)},qa=Object.assign({deceleration:2500,maxSpeed:1400},Ui),Wp=Object.assign({deceleration:20,maxSpeed:1400},Ui),F2=Object.assign({deceleration:1e3,maxSpeed:360},Ui),J0=Object.assign({deceleration:1e3,maxSpeed:90},Ui);class Iw{constructor(o){this._map=o,this.clear()}clear(){this._inertiaBuffer=[]}record(o){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:a.o.now(),settings:o})}_drainInertiaBuffer(){const o=this._inertiaBuffer,d=a.o.now();for(;o.length>0&&d-o[0].time>160;)o.shift()}_onMoveEnd(o){if(this._map._prefersReducedMotion()||(this._drainInertiaBuffer(),this._inertiaBuffer.length<2))return;const d={zoom:0,bearing:0,pitch:0,pan:new a.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:S}of this._inertiaBuffer)d.zoom+=S.zoomDelta||0,d.bearing+=S.bearingDelta||0,d.pitch+=S.pitchDelta||0,S.panDelta&&d.pan._add(S.panDelta),S.around&&(d.around=S.around),S.pinchAround&&(d.pinchAround=S.pinchAround);const _=this._inertiaBuffer.at(-1).time-this._inertiaBuffer[0].time,b={};if(d.pan.mag()){const S=af(d.pan.mag(),_,Object.assign({},qa,o||{}));b.offset=d.pan.mult(S.amount/d.pan.mag()),b.center=this._map.transform.center,ku(b,S)}if(d.zoom){const S=af(d.zoom,_,Wp);b.zoom=this._map.transform.zoom+S.amount,ku(b,S)}if(d.bearing){const S=af(d.bearing,_,F2);
3298b.bearing=this._map.transform.bearing+a.aB(S.amount,-179,179),ku(b,S)}if(d.pitch){const S=af(d.pitch,_,J0);b.pitch=this._map.transform.pitch+S.amount,ku(b,S)}if(b.zoom||b.bearing){const S=d.pinchAround===void 0?d.around:d.pinchAround;b.around=S?this._map.unproject(S):this._map.getCenter()}return this.clear(),b.noMoveStart=!0,b}}function ku(p,o){(!p.duration||p.duration<o.duration)&&(p.duration=o.duration,p.easing=o.easing)}function af(p,o,d){const{maxSpeed:_,linearity:b,deceleration:S}=d,T=a.aB(p*b/(o/1e3),-_,_),I=Math.abs(T)/(S*b);return{easing:d.easing,duration:1e3*I,amount:T*(I/2)}}class Ns extends a.z{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(o,d,_,b={}){const S=qe(d.getCanvasContainer(),_),T=d.unproject(S);super(o,Object.assign({point:S,lngLat:T,originalEvent:_},b)),this._defaultPrevented=!1,this.target=d}}class Ld extends a.z{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(o,d,_){const b=o==="touchend"?_.changedTouches:_.touches,S=lt(d.getCanvasContainer(),b),T=S.map(k=>d.unproject(k)),I=S.reduce((k,F,z,q)=>k.add(F.div(q.length)),new a.P(0,0));super(o,{points:S,point:I,lngLats:T,lngLat:d.unproject(I),originalEvent:_}),this._defaultPrevented=!1}}class Qg extends a.z{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(o,d){super("wheel",{originalEvent:d}),this._defaultPrevented=!1}}class qp{constructor(o,d){this._map=o,this._clickTolerance=d.clickTolerance}reset(){this._mousedownPos=void 0}wheel(o){return this._firePreventable(new Qg(this._map,o))}mousedown(o,d){return this._mousedownPos=d,this._firePreventable(new Ns(o.type,this._map,o))}mouseup(o){this._map.fire(new Ns(o.type,this._map,o))}preclick(o){const d=new MouseEvent("preclick",o);this._map.fire(new Ns(d.type,this._map,d))}click(o,d){this._mousedownPos&&this._mousedownPos.dist(d)>=this._clickTolerance||(this.preclick(o),this._map.fire(new Ns(o.type,this._map,o)))}dblclick(o){return this._firePreventable(new Ns(o.type,this._map,o))}mouseover(o){this._map.fire(new Ns(o.type,this._map,o))}mouseout(o){this._map.fire(new Ns(o.type,this._map,o))}touchstart(o){return this._firePreventable(new Ld(o.type,this._map,o))}touchmove(o){this._map.fire(new Ld(o.type,this._map,o))}touchend(o){this._map.fire(new Ld(o.type,this._map,o))}touchcancel(o){this._map.fire(new Ld(o.type,this._map,o))}_firePreventable(o){if(this._map.fire(o),o.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Fc{constructor(o){this._map=o}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(o){this._map.fire(new Ns(o.type,this._map,o))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ns("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(o){this._delayContextMenu?this._contextMenuEvent=o:this._map.fire(new Ns(o.type,this._map,o)),this._map.listens("contextmenu")&&o.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ql{constructor(o,d){this._map=o,this._el=o.getCanvasContainer(),this._container=o.getContainer(),this._clickTolerance=d.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(o,d){this.isEnabled()&&o.shiftKey&&o.button===0&&(fe(),this._startPos=this._lastPos=d,this._active=!0)}mousemoveWindow(o,d){if(!this._active)return;const _=d,b=this._startPos,S=this._lastPos;if(!b||!S||S.equals(_)||!this._box&&_.dist(b)<this._clickTolerance)return;this._lastPos=_,this._box||(this._box=$("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",o));const T=Math.min(b.x,_.x),I=Math.max(b.x,_.x),k=Math.min(b.y,_.y),F=Math.max(b.y,_.y);this._map._requestDomTask(()=>{this._box&&(this._box.style.transform=`translate(${T}px,${k}px)`,this._box.style.width=I-T+"px",this._box.style.height=F-k+"px")})}mouseupWindow(o,d){if(!this._active)return;const _=this._startPos,b=d;if(_&&o.button===0){if(this.reset(),Fe(),_.x!==b.x||_.y!==b.y)return this._map.fire(new a.z("boxzoomend",{originalEvent:o})),{cameraAnimation:S=>S.fitScreenCoordinates(_,b,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",o)}}keydown(o){this._active&&o.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",o))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),ye(),delete this._startPos,delete this._lastPos}_fireEvent(o,d){return this._map.fire(new a.z(o,{originalEvent:d}))}}function Xa(p,o){const d={};for(let _=0;_<p.length;_++)d[p[_].identifier]=o[_];return d}class Od{constructor(o){this.reset(),this.numTouches=o.numTouches}reset(){this.centroid=void 0,this.startTime=0,this.touches={},this.aborted=!1}touchstart(o,d,_){(this.centroid||_.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===0&&(this.startTime=o.timeStamp),_.length===this.numTouches&&(this.centroid=(function(b){const S=new a.P(0,0);for(const T of b)S._add(T);return S.div(b.length)})(d),this.touches=Xa(_,d)))}touchmove(o,d,_){if(this.aborted||!this.centroid)return;const b=Xa(_,d);for(const S in this.touches){const T=b[S];(!T||T.dist(this.touches[S])>30)&&(this.aborted=!0)}}touchend(o,d,_){if((!this.centroid||o.timeStamp-this.startTime>500)&&(this.aborted=!0),_.length===0){const b=!this.aborted&&this.centroid;if(this.reset(),b)return b}}}class Ea{constructor(o){this.singleTap=new Od(o),this.numTaps=o.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(o,d,_){this.singleTap.touchstart(o,d,_)}touchmove(o,d,_){this.singleTap.touchmove(o,d,_)}touchend(o,d,_){const b=this.singleTap.touchend(o,d,_);if(b){const S=o.timeStamp-this.lastTime<500,T=!this.lastTap||this.lastTap.dist(b)<30;if(S&&T||this.reset(),this.count++,this.lastTime=o.timeStamp,this.lastTap=b,this.count===this.numTaps)return this.reset(),b}}}
3298class B2{constructor(){this._zoomIn=new Ea({numTouches:1,numTaps:2}),this._zoomOut=new Ea({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(o,d,_){this._zoomIn.touchstart(o,d,_),this._zoomOut.touchstart(o,d,_)}touchmove(o,d,_){this._zoomIn.touchmove(o,d,_),this._zoomOut.touchmove(o,d,_)}touchend(o,d,_){const b=this._zoomIn.touchend(o,d,_),S=this._zoomOut.touchend(o,d,_);return b?(this._active=!0,o.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:T=>T.easeTo({duration:300,zoom:T.getZoom()+1,around:T.unproject(b)},{originalEvent:o})}):S?(this._active=!0,o.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:T=>T.easeTo({duration:300,zoom:T.getZoom()-1,around:T.unproject(S)},{originalEvent:o})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const z2=0,N2=2,V2={[z2]:1,[N2]:2},Q0={Control:"ctrlKey",Alt:"altKey",Shift:"shiftKey",Meta:"metaKey"};class as{constructor(o){this.reset(),this._clickTolerance=o.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(o,d){return!1}_move(o,d){return{}}mousedown(o,d){if(this._lastPoint)return;const _=pt(o);this._correctButton(o,_)&&(this._lastPoint=d,this._eventButton=_)}mousemoveWindow(o,d){const _=this._lastPoint;if(_){if(o.preventDefault(),this._eventButton!=null&&(function(b,S){const T=V2[S];return b.buttons===void 0||(b.buttons&T)!==T})(o,this._eventButton))this.reset();else if(this._moved||!(d.dist(_)<this._clickTolerance))return this._moved=!0,this._lastPoint=d,this._move(_,d)}}mouseupWindow(o){this._lastPoint&&pt(o)===this._eventButton&&(this._moved&&Fe(),this.reset())}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class lf extends as{mousedown(o,d){super.mousedown(o,d),this._lastPoint&&(this._active=!0)}_correctButton(o,d){return d===0&&!o.ctrlKey}_move(o,d){return{around:d,panDelta:d.sub(o)}}}class e_ extends as{constructor(o){super(o),this._pitchRotateKey=o.pitchRotateKey?Q0[o.pitchRotateKey]:void 0}_correctButton(o,d){return this._pitchRotateKey?d===0&&o[this._pitchRotateKey]:d===0&&o.ctrlKey||d===2}_move(o,d){const _=.8*(d.x-o.x);if(_)return this._active=!0,{bearingDelta:_}}contextmenu(o){this._pitchRotateKey||o.preventDefault()}}class Ca extends as{constructor(o){super(o),this._pitchRotateKey=o.pitchRotateKey?Q0[o.pitchRotateKey]:void 0}_correctButton(o,d){return this._pitchRotateKey?d===0&&o[this._pitchRotateKey]:d===0&&o.ctrlKey||d===2}_move(o,d){const _=-.5*(d.y-o.y);if(_)return this._active=!0,{pitchDelta:_}}contextmenu(o){this._pitchRotateKey||o.preventDefault()}}class Za{constructor(o,d){this._map=o,this._el=o.getCanvasContainer(),this._minTouches=1,this._clickTolerance=d.clickTolerance||1,this.reset(),a.b0(["_addTouchPanBlocker","_showTouchPanBlockerAlert"],this)}reset(){this._active=!1,this._touches={},this._sum=new a.P(0,0)}touchstart(o,d,_){return this._calculateTransform(o,d,_)}touchmove(o,d,_){if(this._active&&!(_.length<this._minTouches)){if(this._map._cooperativeGestures&&!this._map.isMoving()){if(_.length===1&&!a.eR())return void this._showTouchPanBlockerAlert();this._alertContainer.style.visibility!=="hidden"&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}return o.cancelable&&o.preventDefault(),this._calculateTransform(o,d,_)}}touchend(o,d,_){this._calculateTransform(o,d,_),this._active&&_.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(o,d,_){_.length>0&&(this._active=!0);const b=Xa(_,d),S=new a.P(0,0),T=new a.P(0,0);let I=0;for(const F in b){const z=b[F],q=this._touches[F];q&&(S._add(z),T._add(z.sub(q)),I++,b[F]=z)}if(this._touches=b,I<this._minTouches||!T.mag())return;const k=T.div(I);return this._sum._add(k),this._sum.mag()<this._clickTolerance?void 0:{around:S.div(I),panDelta:k}}enable(){this._enabled=!0,this._map._cooperativeGestures&&(this._addTouchPanBlocker(),this._el.classList.add("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page"))}disable(){this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove(),this._el.classList.remove("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page")),this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}_addTouchPanBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=$("div","mapboxgl-touch-pan-blocker",this._map._container),this._alertContainer.textContent=this._map._getUIString("TouchPanBlocker.Message"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showTouchPanBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=window.setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.removeAttribute("role")},500)}}class Mu{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(o){}_move(o,d,_){return{}}touchstart(o,d,_){this._firstTwoTouches||_.length<2||(this._firstTwoTouches=[_[0].identifier,_[1].identifier],this._start([d[0],d[1]])
3298)}touchmove(o,d,_){const b=this._firstTwoTouches;if(!b)return;o.preventDefault();const[S,T]=b,I=ec(_,d,S),k=ec(_,d,T);if(!I||!k)return;const F=this._aroundCenter?null:I.add(k).div(2);return this._move([I,k],F,o)}touchend(o,d,_){if(!this._firstTwoTouches)return;const[b,S]=this._firstTwoTouches,T=ec(_,d,b),I=ec(_,d,S);T&&I||(this._active&&Fe(),this.reset())}touchcancel(){this.reset()}enable(o){this._enabled=!0,this._aroundCenter=!!o&&o.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function ec(p,o,d){for(let _=0;_<p.length;_++)if(p[_].identifier===d)return o[_]}function Dd(p,o){return Math.log2(p/o)}class ev extends Mu{reset(){super.reset(),this._distance=0,this._startDistance=0}_start(o){this._startDistance=this._distance=o[0].dist(o[1])}_move(o,d){const _=this._distance;if(this._distance=o[0].dist(o[1]),this._active||!(Math.abs(Dd(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Dd(this._distance,_),pinchAround:d}}}function wr(p,o){return 180*p.angleWith(o)/Math.PI}class Lu extends Mu{reset(){super.reset(),this._minDiameter=0,this._startVector=void 0,this._vector=void 0}_start(o){this._startVector=this._vector=o[0].sub(o[1]),this._minDiameter=o[0].dist(o[1])}_move(o,d){const _=this._vector;if(this._vector=o[0].sub(o[1]),_&&(this._active||!this._isBelowThreshold(this._vector)))return this._active=!0,{bearingDelta:wr(this._vector,_),pinchAround:d}}_isBelowThreshold(o){this._minDiameter=Math.min(this._minDiameter,o.mag());const d=25/(Math.PI*this._minDiameter)*360,_=this._startVector;if(!_)return!1;const b=wr(o,_);return Math.abs(b)<d}}function Xp(p){return Math.abs(p.y)>Math.abs(p.x)}class Bc extends Mu{constructor(o){super(),this._map=o}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(o){this._lastPoints=o,Xp(o[0].sub(o[1]))&&(this._valid=!1)}_move(o,d,_){const b=this._lastPoints;if(!b)return;const S=o[0].sub(b[0]),T=o[1].sub(b[1]);return this._map._cooperativeGestures&&!a.eR()&&_.touches.length<3||(this._valid=this.gestureBeginsVertically(S,T,_.timeStamp),!this._valid)?void 0:(this._lastPoints=o,this._active=!0,{pitchDelta:(S.y+T.y)/2*-.5})}gestureBeginsVertically(o,d,_){if(this._valid!==void 0)return this._valid;const b=o.mag()>=2,S=d.mag()>=2;if(!b&&!S)return;if(!b||!S)return this._firstMove==null&&(this._firstMove=_),_-this._firstMove<100&&void 0;const T=o.y>0==d.y>0;return Xp(o)&&Xp(d)&&T}}const tc={panStep:100,bearingStep:15,pitchStep:10};class Ps{constructor(){const o=tc;this._panStep=o.panStep,this._bearingStep=o.bearingStep,this._pitchStep=o.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(o){if(o.altKey||o.ctrlKey||o.metaKey)return;let d=0,_=0,b=0,S=0,T=0;switch(o.keyCode){case 61:case 107:case 171:case 187:d=1;break;case 189:case 109:case 173:d=-1;break;case 37:o.shiftKey?_=-1:(o.preventDefault(),S=-1);break;case 39:o.shiftKey?_=1:(o.preventDefault(),S=1);break;case 38:o.shiftKey?b=1:(o.preventDefault(),T=-1);break;case 40:o.shiftKey?b=-1:(o.preventDefault(),T=1);break;default:return}return this._rotationDisabled&&(_=0,b=0),{cameraAnimation:I=>{const k=I.getZoom();I.easeTo({duration:300,easeId:"keyboardHandler",easing:ia,zoom:d?Math.round(k)+d*(o.shiftKey?2:1):k,bearing:I.getBearing()+_*this._bearingStep,pitch:I.getPitch()+b*this._pitchStep,offset:[-S*this._panStep,-T*this._panStep],center:I.getCenter()},{originalEvent:o})}}}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 ia(p){return p*(2-p)}const Mo=4.000244140625,tv=1/450,oa=/(Mac|iPad)/i;class Pw{constructor(o,d){this._map=o,this._el=o.getCanvasContainer(),this._handler=d,this._delta=0,this._lastDelta=0,this._defaultZoomRate=.01,this._wheelZoomRate=tv,a.b0(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(o){this._defaultZoomRate=o}setWheelZoomRate(o){this._wheelZoomRate=o}isEnabled(){return!!this._enabled}isActive(){return this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(o){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!o&&o.around==="center",this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(o){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(o.ctrlKey||o.metaKey||this.isZooming()||a.eR()))return void this._showBlockerAlert();this._alertContainer.style.visibility!=="hidden"&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let d=o.deltaMode===WheelEvent.DOM_DELTA_LINE?40*o.deltaY:o.deltaY;const _=a.o.now(),b=_-(this._lastWheelEventTime||0);this._lastWheelEventTime=_,d!==0&&d%Mo===0?this._type="wheel":d!==0&&Math.abs(d)<4?this._type="trackpad":b>
vendor: 10,919 bytes, line 3298
3298400?(this._type=null,this._lastValue=d,this._timeout=window.setTimeout(this._onTimeout,40,o)):this._type||(this._type=Math.abs(b*d)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,d+=this._lastValue)),o.shiftKey&&d&&(d/=4),this._type&&(this._lastWheelEvent=o,this._delta-=d,this._active||this._start(o)),o.preventDefault()}_onTimeout(o){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(o)}_start(o){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 d=qe(this._el,o);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:d,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const o=this._map.transform;this._type==="wheel"&&o.projection.wrap&&(o._center.lng>=180||o._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const d=()=>o._terrainEnabled()&&this._aroundCoord?o.computeZoomRelativeTo(this._aroundCoord):o.zoom;if(this._delta!==0){const F=this._type==="wheel"&&Math.abs(this._delta)>Mo?this._wheelZoomRate:this._defaultZoomRate;let z=2/(1+Math.exp(-Math.abs(this._delta*F)));this._delta<0&&z!==0&&(z=1/z);const q=d(),j=Math.pow(2,q),Z=typeof this._targetZoom=="number"?o.zoomScale(this._targetZoom):j;this._targetZoom=Math.min(o.maxZoom,Math.max(o.minZoom,o.scaleZoom(Z*z))),this._type==="wheel"&&(this._startZoom=q,this._easing=this._smoothOutEasing(200)),this._lastDelta=this._delta,this._delta=0}const _=typeof this._targetZoom=="number"?this._targetZoom:d(),b=this._startZoom,S=this._easing;let T,I=!1;if(this._type==="wheel"&&b&&S){const F=Math.min((a.o.now()-this._lastWheelEventTime)/200,1),z=S(F);T=a.aj(b,_,z),F<1?this._frameId||(this._frameId=!0):I=!0}else T=_,I=!0;this._active=!0,I&&(this._active=!1,this._finishTimeout=window.setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200));let k=T-d();return k*this._lastDelta<0&&(k=0),{noInertia:!0,needsRenderFrame:!I,zoomDelta:k,around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(o){let d=a.eS;if(this._prevEase){const _=this._prevEase,b=(a.o.now()-_.start)/_.duration,S=_.easing(b+.01)-_.easing(b),T=.27/Math.sqrt(S*S+1e-4)*.01,I=Math.sqrt(.0729-T*T);d=a.eQ(T,I,.25,1)}return this._prevEase={start:a.o.now(),duration:o,easing:d},d}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=$("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=oa.test(navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=window.setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.removeAttribute("role")},200)}}class Fd{constructor(o,d){this._clickZoom=o,this._tapZoom=d}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 Rw{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(o,d){return o.preventDefault(),{cameraAnimation:_=>{_.easeTo({duration:300,zoom:_.getZoom()+(o.shiftKey?-1:1),around:_.unproject(d)},{originalEvent:o})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Aa{constructor(){this._tap=new Ea({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(o,d,_){this._swipePoint||(this._tapTime&&o.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?_.length>0&&(this._swipePoint=d[0],this._swipeTouch=_[0].identifier):this._tap.touchstart(o,d,_))}touchmove(o,d,_){if(this._tapTime){if(this._swipePoint){if(_[0].identifier!==this._swipeTouch)return;const b=d[0],S=b.y-this._swipePoint.y;return this._swipePoint=b,o.preventDefault(),this._active=!0,{zoomDelta:S/128}}}else this._tap.touchmove(o,d,_)}touchend(o,d,_){this._tapTime?this._swipePoint&&_.length===0&&this.reset():this._tap.touchend(o,d,_)&&(this._tapTime=o.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ls{constructor(o,d,_){this._el=o,this._mousePan=d,this._touchPan=_}enable(o){this._inertiaOptions=o||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class nv{constructor(o,d,_){this._pitchWithRotate=o.pitchWithRotate,this._mouseRotate=d,this._mousePitch=_}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class kw{constructor(o,d,_,b){this._el=o,this._touchZoom=d,this._touchRotate=_,this._tapDragZoom=b,this._rotationDisabled=!1,this._enabled=!0}enable(o){this._touchZoom.enable(o),this._rotationDisabled||this._touchRotate.enable(o),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-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()}}const cf=p=>p.zoom||p.drag||p.pitch||p.rotate;class U2 extends a.z{}class rv{constructor(){this.constants=[1,1,.01],this.radius=0}setup(o,d){const _=a.aw([],d,o);this.radius=a.af(_[2]<0?a.eU([],_,this.constants):[_[0],_[1],0])}projectRay(o){a.eU(o,o,this.constants),a.ax(o,o),a.eV(o,o,this.constants);const d=a.bN([],o,this.radius);if(d[2]>0){const _=a.bN([],[0,0,1],a.bk(d,[0,0,1])),b=a.bN([],a.ax([],[d[0],d[1],0]),this.radius),S=a.cX([],d,a.bN([],a.aw([],a.cX([],b,_),d),2));d[0]=S[0],d[1]=S[1]}return d}}function Zp(p){return p.panDelta&&p.panDelta.mag()||p.zoomDelta||p.bearingDelta||p.pitchDelta}class $2{constructor(o,d){this._map=o,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Iw(o),this._bearingSnap=d.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new rv,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(d),a.b0(["handleEvent","handleWindowEvent"],this);const _=this._el;this._listeners=[[_,"touchstart",{passive:!0}],[_,"touchmove",{passive:!1}],[_,"touchend",void 0],[_,"touchcancel",void 0],[_,"mousedown",void 0],[_,"mousemove",void 0],[_,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[_,"mouseover",void 0],[_,"mouseout",void 0],[_,"dblclick",void 0],[_,"click",void 0],[_,"keydown",{capture:!1}],[_,"keyup",void 0],[_,"wheel",{passive:!1}],[_,"contextmenu",void 0],[window,"blur",void 0]];for(const[b,S,T]of this._listeners){const I=b===document?this.handleWindowEvent:this.handleEvent;b.addEventListener(S,I,T)}}destroy(){for(const[o,d,_]of this._listeners){const b=o===document?this.handleWindowEvent:this.handleEvent;o.removeEventListener(d,b,_)}}_addDefaultHandlers(o){const d=this._map,_=d.getCanvasContainer();this._add("mapEvent",new qp(d,o));const b=d.boxZoom=new Ql(d,o);this._add("boxZoom",b);const S=new B2,T=new Rw;d.doubleClickZoom=new Fd(T,S),this._add("tapZoom",S),this._add("clickZoom",T);const I=new Aa;this._add("tapDragZoom",I);const k=d.touchPitch=new Bc(d);this._add("touchPitch",k);const F=new e_(o),z=new Ca(o);d.dragRotate=new nv(o,F,z),this._add("mouseRotate",F,["mousePitch"]),this._add("mousePitch",z,["mouseRotate"]);const q=new lf(o),j=new Za(d,o);d.dragPan=new ls(_,q,j),this._add("mousePan",q),this._add("touchPan",j,["touchZoom","touchRotate"]);const Z=new Lu,te=new ev;d.touchZoomRotate=new kw(_,te,Z,I),this._add("touchRotate",Z,["touchPan","touchZoom"]),this._add("touchZoom",te,["touchPan","touchRotate"]),this._add("blockableMapEvent",new Fc(d));const ee=d.scrollZoom=new Pw(d,this);this._add("scrollZoom",ee,["mousePan"]);const oe=d.keyboard=new Ps;this._add("keyboard",oe);for(const se of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])o.interactive&&o[se]&&d[se].enable(o[se])}_add(o,d,_){this._handlers.push({handlerName:o,handler:d,allowed:_}),this._handlersById[o]=d}stop(o){if(!this._updatingCamera){for(const{handler:d}of this._handlers)d.reset();this._inertia.clear(),this._fireEvents({},{},o),this._changes=[],this._originalZoom=void 0}}isActive(){for(const{handler:o}of this._handlers)if(o.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!cf(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(o,d,_){for(const b in o)if(!(b===_||d&&d.includes(b)))return!0;return!1}handleWindowEvent(o){this.handleEvent(o,`${o.type}Window`)}_getMapTouches(o){const d=[];for(const _ of o)this._el.contains(_.target)&&d.push(_);return d}handleEvent(o,d){this._updatingCamera=!0;const _=o.type==="renderFrame",b=_?void 0:o,S={needsRenderFrame:!1},T={},I={},k=o.touches?this._getMapTouches(o.touches):void 0,F=k?lt(this._el,k):_?void 0:qe(this._el,o);for(const{handlerName:j,handler:Z,allowed:te}
3298of this._handlers){if(!Z.isEnabled())continue;let ee;this._blockedByActive(I,te,j)?Z.reset():Z[d||o.type]&&(ee=Z[d||o.type](o,F,k),this.mergeHandlerResult(S,T,ee,j,b),ee&&ee.needsRenderFrame&&this._triggerRenderFrame()),(ee||Z.isActive())&&(I[j]=Z)}const z={};for(const j in this._previousActiveHandlers)I[j]||(z[j]=b);this._previousActiveHandlers=I,(Object.keys(z).length||Zp(S))&&(this._changes.push([S,T,z]),this._triggerRenderFrame()),(Object.keys(I).length||Zp(S))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:q}=S;q&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],q(this._map))}mergeHandlerResult(o,d,_,b,S){if(!_)return;Object.assign(o,_);const T={handlerName:b,originalEvent:_.originalEvent||S};_.zoomDelta!==void 0&&(d.zoom=T),_.panDelta!==void 0&&(d.drag=T),_.pitchDelta!==void 0&&(d.pitch=T),_.bearingDelta!==void 0&&(d.rotate=T)}_applyChanges(){const o={},d={},_={};for(const[b,S,T]of this._changes)b.panDelta&&(o.panDelta=(o.panDelta||new a.P(0,0))._add(b.panDelta)),b.zoomDelta&&(o.zoomDelta=(o.zoomDelta||0)+b.zoomDelta),b.bearingDelta&&(o.bearingDelta=(o.bearingDelta||0)+b.bearingDelta),b.pitchDelta&&(o.pitchDelta=(o.pitchDelta||0)+b.pitchDelta),b.around!==void 0&&(o.around=b.around),b.aroundCoord!==void 0&&(o.aroundCoord=b.aroundCoord),b.pinchAround!==void 0&&(o.pinchAround=b.pinchAround),b.noInertia&&(o.noInertia=b.noInertia),Object.assign(d,S),Object.assign(_,T);this._updateMapTransform(o,d,_),this._changes=[]}_updateMapTransform(o,d,_){const b=this._map,S=b.transform,T=de=>[de.x,de.y,de.z];if((()=>{const de=this._eventsInProgress.drag;return de&&!this._handlersById[de.handlerName].isActive()})()&&!Zp(o)){const de=S.zoom;S.cameraElevationReference="sea",this._originalZoom!=null&&S._orthographicProjectionAtLowPitch&&S.projection.name!=="globe"&&S.pitch===0?(S.cameraElevationReference="ground",S.zoom=this._originalZoom):(S.recenterOnTerrain(),S.cameraElevationReference="ground"),de!==S.zoom&&this._map._update(!0)}if(S._isCameraConstrained&&b._stop(!0),!Zp(o))return void this._fireEvents(d,_,!0);let{panDelta:I,zoomDelta:k,bearingDelta:F,pitchDelta:z,around:q,aroundCoord:j,pinchAround:Z}=o;S._isCameraConstrained&&(k>0&&(k=0),S._isCameraConstrained=!1),Z!==void 0&&(q=Z),(k||(de=>d[de]&&!this._eventsInProgress[de])("drag"))&&q&&(this._dragOrigin=T(S.pointCoordinate3D(q)),this._originalZoom=S.zoom,this._trackingEllipsoid.setup(S._camera.position,this._dragOrigin)),S.cameraElevationReference="sea",b._stop(!0),q=q||b.transform.centerPoint,F&&(S.bearing+=F),z&&(S.pitch+=z),S._updateCameraState();const te=[0,0,0];if(I)if(S.projection.name==="mercator"){const de=this._trackingEllipsoid.projectRay(S.screenPointToMercatorRay(q).dir),pe=this._trackingEllipsoid.projectRay(S.screenPointToMercatorRay(q.sub(I)).dir);te[0]=pe[0]-de[0],te[1]=pe[1]-de[1]}else{const de=S.pointCoordinate(q);if(S.projection.name==="globe"){I=I.rotate(-S.angle);const pe=S._pixelsPerMercatorPixel/S.worldSize;te[0]=-I.x*a.eT(a.bZ(de.y))*pe,te[1]=-I.y*a.eT(S.center.lat)*pe}else{const pe=S.pointCoordinate(q.sub(I));de&&pe&&(te[0]=pe.x-de.x,te[1]=pe.y-de.y)}}const ee=S.zoom,oe=[0,0,0];if(k){const de=T(j||S.pointCoordinate3D(q)),pe={dir:a.ax([],a.aw([],de,S._camera.position))};if(pe.dir[2]<0){const ce=S.zoomDeltaToMovement(de,k);a.bN(oe,pe.dir,ce)}}const se=a.cX(te,te,oe);S._translateCameraConstrained(se),k&&Math.abs(S.zoom-ee)>1e-4&&S.recenterOnTerrain(),S.cameraElevationReference="ground",this._map._update(),o.noInertia||this._inertia.record(o),this._fireEvents(d,_,!0)}_fireEvents(o,d,_){const b=cf(this._eventsInProgress),S=cf(o),T={};for(const z in o){const{originalEvent:q}=o[z];this._eventsInProgress[z]||(T[`${z}start`]=q),this._eventsInProgress[z]=o[z]}!b&&S&&this._fireEvent("movestart",S.originalEvent);for(const z in T)this._fireEvent(z,T[z]);S&&this._fireEvent("move",S.originalEvent);for(const z in o){const{originalEvent:q}=o[z];this._fireEvent(z,q)}const I={};let k;for(const z in this._eventsInProgress){const{handlerName:q,originalEvent:j}=this._eventsInProgress[z];this._handlersById[q].isActive()||(delete this._eventsInProgress[z],k=d[q]||j,I[`${z}end`]=k)}for(const z in I)this._fireEvent(z,I[z]);const F=cf(this._eventsInProgress);if(_&&(b||S)&&!F){this._updatingCamera=!0;const z=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),q=j=>j!==0&&-this._bearingSnap<j&&j<this._bearingSnap;
3298z?(q(z.bearing||this._map.getBearing())&&(z.bearing=0),this._map.easeTo(z,{originalEvent:k})):(this._map.fire(new a.z("moveend",{originalEvent:k})),q(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(o,d){this._map.fire(new a.z(o,d?{originalEvent:d}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(o=>{this._frameId=void 0,this.handleEvent(new U2("renderFrame",{timeStamp:o})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}const sa="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class Ya extends a.E{constructor(o,d){super(),this._moving=!1,this._zooming=!1,this.transform=o,this._bearingSnap=d.bearingSnap,this._respectPrefersReducedMotion=d.respectPrefersReducedMotion!==!1,a.b0(["_renderFrameCallback"],this)}getCenter(){return new a.aX(this.transform.center.lng,this.transform.center.lat)}setCenter(o,d){return this.jumpTo({center:o},d)}panBy(o,d,_){return o=a.P.convert(o).mult(-1),this.panTo(this.transform.center,Object.assign({offset:o},d),_)}panTo(o,d,_){return this.easeTo(Object.assign({center:o},d),_)}getZoom(){return this.transform.zoom}setZoom(o,d){return this.jumpTo({zoom:o},d),this}zoomTo(o,d,_){return this.easeTo(Object.assign({zoom:o},d),_)}zoomIn(o,d){return this.zoomTo(this.getZoom()+1,o,d),this}zoomOut(o,d){return this.zoomTo(this.getZoom()-1,o,d),this}getBearing(){return this.transform.bearing}setBearing(o,d){return this.jumpTo({bearing:o},d),this}getPadding(){return this.transform.padding}setPadding(o,d){return this.jumpTo({padding:o},d),this}rotateTo(o,d,_){return this.easeTo(Object.assign({bearing:o},d),_)}resetNorth(o,d){return this.rotateTo(0,Object.assign({duration:1e3},o),d),this}resetNorthPitch(o,d){return this.easeTo(Object.assign({bearing:0,pitch:0,duration:1e3},o),d),this}snapToNorth(o,d){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(o,d):this}getPitch(){return this.transform.pitch}setPitch(o,d){return this.jumpTo({pitch:o},d),this}cameraForBounds(o,d){o=a.aI.convert(o);const _=d&&d.bearing||0,b=d&&d.pitch||0,S=o.getNorthWest(),T=o.getSouthEast();return this._cameraForBounds(this.transform,S,T,_,b,d)}_extendPadding(o){const d={top:0,right:0,bottom:0,left:0};return o==null?Object.assign({},d,this.transform.padding):typeof o=="number"?{top:o,bottom:o,right:o,left:o}:Object.assign({},d,o)}_extendCameraOptions(o){return(o=Object.assign({offset:[0,0],maxZoom:this.transform.maxZoom},o)).padding=this._extendPadding(o.padding),o}_minimumAABBFrustumDistance(o,d){const _=d.max[0]-d.min[0],b=d.max[1]-d.min[1];return _/b>o.aspect?_/(2*Math.tan(.5*o.fovX)*o.aspect):b/(2*Math.tan(.5*o.fovY)*o.aspect)}_cameraForBoundsOnGlobe(o,d,_,b,S,T){const I=o.clone(),k=this._extendCameraOptions(T);I.bearing=b,I.pitch=S;const F=a.aX.convert(d),z=a.aX.convert(_),q=.5*(F.lat+z.lat),j=.5*(F.lng+z.lng),Z=a.eW(q,j),te=a.ax([],Z),ee=a.ax([],a.bj([],te,[0,1,0])),oe=a.bj([],ee,te),se=[ee[0],ee[1],ee[2],0,oe[0],oe[1],oe[2],0,te[0],te[1],te[2],0,0,0,0,1],de=[Z,a.eW(F.lat,F.lng),a.eW(z.lat,F.lng),a.eW(z.lat,z.lng),a.eW(F.lat,z.lng),a.eW(q,F.lng),a.eW(q,z.lng),a.eW(F.lat,j),a.eW(z.lat,j)];let pe=a.cY.fromPoints(de.map(at=>[a.bk(ee,at),a.bk(oe,at),a.bk(te,at)]));const ce=a.ae([],pe.center,se);
3298a.eX(ce)===0&&a.eY(ce,0,0,1),a.ax(ce,ce),a.bN(ce,ce,a.aE),I.center=a.eZ(ce);const Ce=I.getWorldToCameraMatrix(),Se=a.ba(new Float64Array(16),Ce);pe=a.cY.applyTransform(pe,a.aC([],Ce,se));const Re=this._extendAABB(pe,I,k,b);if(!Re)return void a.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");pe=Re,a.ae(ce,ce,Ce);const ve=.5*(pe.max[2]-pe.min[2]),be=this._minimumAABBFrustumDistance(I,pe),Ae=a.bN([],[0,0,1],ve),Ne=a.cX(Ae,ce,Ae),De=be+(I.pitch===0?0:a.bh(ce,Ne)),Ye=I.globeCenterInViewSpace,Ke=a.aw([],ce,[Ye[0],Ye[1],Ye[2]]);a.ax(Ke,Ke),a.bN(Ke,Ke,De);const Tt=a.cX([],ce,Ke);a.ae(Tt,Tt,Se);const Ue=a.eg/a.aE,rt=a.af(Tt),$e=a.bY(Math.max(rt*Ue-a.eg,Number.EPSILON),0),ct=Math.min(I.zoomFromMercatorZAdjusted($e),k.maxZoom);return ct>.5*(a.cN+a.cx)?(I.setProjection({name:"mercator"}),I.zoom=ct,this._cameraForBounds(I,d,_,b,S,T)):{center:I.center,zoom:ct,bearing:b,pitch:S}}_extendAABB(o,d,_,b){const S=.5*((_.padding.left||0)+(_.padding.right||0)),T=.5*((_.padding.top||0)+(_.padding.bottom||0)),I=T,k=S,F=S,z=T,q=d.width-(k+F),j=d.height-(I+z),Z=a.aw([],o.max,o.min),te=Math.min(q/Z[0],j/Z[1]),ee=Math.min(d.scaleZoom(d.scale*te),_.maxZoom);if(isNaN(ee))return null;const oe=d.scale/d.zoomScale(ee),se=new a.cY([o.min[0]-k*oe,o.min[1]-z*oe,o.min[2]],[o.max[0]+F*oe,o.max[1]+I*oe,o.max[2]]),de=(typeof _.offset.x=="number"&&typeof _.offset.y=="number"?new a.P(_.offset.x,_.offset.y):a.P.convert(_.offset)).rotate(-a.am(b));return se.center[0]-=de.x*oe,se.center[1]+=de.y*oe,se}queryTerrainElevation(o,d){const _=this.transform.elevation;return _?(d=Object.assign({},{exaggerated:!0},d),_.getAtPoint(a.ad.fromLngLat(o),null,d.exaggerated)):null}_cameraForBounds(o,d,_,b,S,T){if(o.projection.name==="globe")return this._cameraForBoundsOnGlobe(o,d,_,b,S,T);const I=o.clone(),k=this._extendCameraOptions(T);I.bearing=b,I.pitch=S;const F=a.aX.convert(d),z=a.aX.convert(_),q=new a.aX(F.lng,z.lat),j=new a.aX(z.lng,F.lat),Z=I.project(F),te=I.project(z),ee=this.queryTerrainElevation(F),oe=this.queryTerrainElevation(z),se=this.queryTerrainElevation(q),de=this.queryTerrainElevation(j),pe=[[Z.x,Z.y,Math.min(ee||0,oe||0,se||0,de||0)],[te.x,te.y,Math.max(ee||0,oe||0,se||0,de||0)]];let ce=a.cY.fromPoints(pe);const Ce=I.getWorldToCameraMatrix(),Se=a.ba(new Float64Array(16),Ce);ce=a.cY.applyTransform(ce,Ce);const Re=this._extendAABB(ce,I,k,b);if(!Re)return void a.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");ce=Re;const ve=.5*a.aw([],ce.max,ce.min)[2],be=this._minimumAABBFrustumDistance(I,ce),Ae=[0,0,1,0];a.aD(Ae,Ae,Ce),a.e_(Ae,Ae);const Ne=a.bN([],Ae,be+ve),De=a.cX([],ce.center,Ne);a.ae(ce.center,ce.center,Se),a.ae(De,De,Se);const Ye=I.unproject(new a.P(ce.center[0],ce.center[1])),Ke=a.e$(I.projection,Ye),Tt=Math.pow(2,Ke),Ue=Math.min(I._zoomFromMercatorZ(De[2]*I.pixelsPerMeter*Tt/I.worldSize),k.maxZoom);return I.mercatorFromTransition&&Ue<.5*(a.cN+a.cx)?(I.setProjection({name:"globe"}),I.zoom=Ue,this._cameraForBounds(I,d,_,b,S,T)):{center:Ye,zoom:Ue,bearing:b,pitch:S}}fitBounds(o,d,_){const b=this.cameraForBounds(o,d);return this._fitInternal(b,d,_)}fitScreenCoordinates(o,d,_,b,S){const T=a.P.convert(o),I=a.P.convert(d),k=new a.P(Math.min(T.x,I.x),Math.min(T.y,I.y)),F=new a.P(Math.max(T.x,I.x),Math.max(T.y,I.y));if(this.transform.projection.name==="mercator"&&this.transform.anyCornerOffEdge(T,I))return this;const z=this.transform.pointLocation3D(k),q=this.transform.pointLocation3D(F),j=this.transform.pointLocation3D(new a.P(k.x,F.y)),Z=this.transform.pointLocation3D(new a.P(F.x,k.y)),te=[Math.min(z.lng,q.lng,j.lng,Z.lng),Math.min(z.lat,q.lat,j.lat,Z.lat)],ee=[Math.max(z.lng,q.lng,j.lng,Z.lng),Math.max(z.lat,q.lat,j.lat,Z.lat)],oe=b&&b.pitch?b.pitch:this.getPitch(),se=this._cameraForBounds(this.transform,te,ee,_,oe,b);return this._fitInternal(se,b,S)}_fitInternal(o,d,_){return o?(d=Object.assign(o,d)).linear?this.easeTo(d,_):this.flyTo(d,_):this}jumpTo(o,d){this.stop();const _=o.preloadOnly?this.transform.clone():this.transform;let b=!1,S=!1,T=!1;"zoom"in o&&_.zoom!==+o.zoom&&(b=!0,_.zoom=+o.zoom),o.center!==void 0&&(_.center=a.aX.convert(o.center)),"bearing"in o&&_.bearing!==+o.bearing&&(S=!0,_.bearing=+o.bearing),"pitch"in o&&_.pitch!==+o.pitch&&(T=!0,_.pitch=+o.pitch);const I=typeof o.padding=="number"?this._extendPadding(o.padding):o.padding;if(o.padding!=null&&!_.isPaddingEqual(I))if(o.retainPadding===!1){const k=_.clone();k.padding=I,_.setLocationAtPoint(_.center,k.centerPoint)}else _.padding=I;return o.preloadOnly?(this._preloadTiles(_),this):(this.fire(new a.z("movestart",d)).fire(new a.z("move",d)),b&&this.fire(new a.z("zoomstart",d)).fire(new a.z("zoom",d)).fire(new a.z("zoomend",d)),S&&this.fire(new a.z("rotatestart",d)).fire(new a.z("rotate",d)).fire(new a.z("rotateend",d)),T&&this.fire(new a.z("pitchstart",d)).fire(new a.z("pitch",d)).fire(new a.z("pitchend",d)),this.fire(new a.z("moveend",d)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||a.w(sa),this.transform.getFreeCameraOptions()}setFreeCameraOptions(o,d){const _=this.transform;if(!_.projection.supportsFreeCamera)return a.w(sa),this;this.stop();const b=_.zoom,S=_.pitch,T=_.bearing;_.setFreeCameraOptions(o);const I=b!==_.zoom,k=S!==_.pitch,F=T!==_.bearing;return this.fire(new a.z("movestart",d)).fire(new a.z("move",d)),I&&this.fire(new a.z("zoomstart",d)).fire(new a.z("zoom",d)).fire(new a.z("zoomend",d)),F&&this.fire(new a.z("rotatestart",d)).fire(new a.z("rotate",d)).fire(new a.z("rotateend",d)),k&&this.fire(new a.z("pitchstart",d)).fire(new a.z("pitch",d)).fire(new a.z("pitchend",d)),this.fire(new a.z("moveend",d)),this}easeTo(o,d){this._stop(!1,o.easeId),((o=Object.assign({offset:[0,0],duration:500,easing:a.eS},o)).animate===!1||this._prefersReducedMotion(o))&&(o.duration=0);const _=this.transform,b=this.getZoom(),S=this.getBearing(),T=this.getPitch(),I=this.getPadding(),k="zoom"in o?+o.zoom:b,F="bearing"in o?this._normalizeBearing(o.bearing,S):S,z="pitch"in o?+o.pitch:T,q=this._extendPadding(o.padding),j=a.P.convert(o.offset);let Z,te,ee;if(_.projection.name==="globe"){const Ae=a.ad.fromLngLat(_.center),Ne=j.rotate(-_.angle);Ae.x+=Ne.x/_.worldSize,Ae.y+=Ne.y/_.worldSize;const De=Ae.toLngLat(),Ye=a.aX.convert(o.center||De);this._normalizeCenter(Ye),Z=_.centerPoint.add(Ne),te=new a.P(Ae.x,Ae.y).mult(_.worldSize),ee=new a.P(a.aG(Ye.lng),a.aJ(Ye.lat)).mult(_.worldSize).sub(te)}else{Z=_.centerPoint.add(j);const Ae=_.pointLocation(Z),Ne=a.aX.convert(o.center||Ae);this._normalizeCenter(Ne),te=_.project(Ae),ee=_.project(Ne).sub(te)}const oe=_.zoomScale(k-b);let se,de;o.around&&(se=a.aX.convert(o.around),de=_.locationPoint(se));const pe=this._zooming||k!==b,ce=this._rotating||S!==F,Ce=this._pitching||z!==T,Se=!_.isPaddingEqual(q),Re=o.retainPadding===!1?_.clone():_,ve=Ae=>Ne=>{if(pe&&(Ae.zoom=a.aj(b,k,Ne)),ce&&(Ae.bearing=a.aj(S,F,Ne)),Ce&&(Ae.pitch=a.aj(T,z,Ne)),Se&&(Re.interpolatePadding(I,q,Ne),Z=Re.centerPoint.add(j)),se)Ae.setLocationAtPoint(se,de);else{const De=Ae.zoomScale(Ae.zoom-b),Ye=k>b?Math.min(2,oe):Math.max(.5,oe),Ke=Math.pow(Ye,1-Ne),Tt=Ae.unproject(te.add(ee.mult(Ne*Ke)).mult(De));Ae.setLocationAtPoint(Ae.renderWorldCopies?Tt.wrap():Tt,Z)}return o.preloadOnly||this._fireMoveEvents(d),Ae};if(o.preloadOnly){const Ae=this._emulate(ve,o.duration,_);return this._preloadTiles(Ae),this}const be={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=pe,this._rotating=ce,this._pitching=Ce,this._padding=Se,this._easeId=o.easeId,this._prepareEase(d,o.noMoveStart,be),this._ease(ve(_),Ae=>{_.cameraElevationReference==="sea"&&_.recenterOnTerrain(),this._afterEase(d,Ae)},o),this}_prepareEase(o,d,_={}){this._moving=!0,this.transform.cameraElevationReference="sea",this.transform._orthographicProjectionAtLowPitch&&this.transform.pitch===0&&this.transform.projection.name!=="globe"&&(this.transform.cameraElevationReference="ground"),d||_.moving||this.fire(new a.z("movestart",o)),this._zooming&&!_.zooming&&this.fire(new a.z("zoomstart",o)),this._rotating&&!_.rotating&&this.fire(new a.z("rotatestart",o)),this._pitching&&!_.pitching&&this.fire(new a.z("pitchstart",o))}_fireMoveEvents(o){this.fire(new a.z("move",o)),this._zooming&&this.fire(new a.z("zoom",o)),this._rotating&&this.fire(new a.z("rotate",o)),this._pitching&&this.fire(new a.z("pitch",o))}_afterEase(o,d){if(this._easeId&&d&&this._easeId===d)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const _=this._zooming,b=this._rotating,S=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,_&&this.fire(new a.z("zoomend",o)),b&&this.fire(new a.z("rotateend",o)),S&&this.fire(new a.z("pitchend",o)),this.fire(new a.z("moveend",o))}flyTo(o,d){if(this._prefersReducedMotion(o)){const at=a.aK(o,["center","zoom","bearing","pitch","around","padding","retainPadding"]);return this.jumpTo(at,d)}this.stop(),o=Object.assign({offset:[0,0],speed:1.2,curve:1.42,easing:a.eS},o);const _=this.transform,b=this.getZoom(),S=this.getBearing(),T=this.getPitch(),I=this.getPadding(),k="zoom"in o?a.aB(+o.zoom,_.minZoom,_.maxZoom):b,F="bearing"in o?this._normalizeBearing(o.bearing,S):S,z="pitch"in o?+o.pitch:T,q=this._extendPadding(o.padding),j=_.zoomScale(k-b),Z=a.P.convert(o.offset);let te=_.centerPoint.add(Z);const ee=_.pointLocation(te),oe=a.aX.convert(o.center||ee);this._normalizeCenter(oe);const se=_.project(ee),de=_.project(oe).sub(se);let pe=o.curve;const ce=Math.max(_.width,_.height),Ce=ce/j,Se=de.mag();
3298if("minZoom"in o){const at=a.aB(Math.min(o.minZoom,b,k),_.minZoom,_.maxZoom),dt=ce/_.zoomScale(at-b);pe=Math.sqrt(dt/Se*2)}const Re=pe*pe;function ve(at){const dt=(Ce*Ce-ce*ce+(at?-1:1)*Re*Re*Se*Se)/(2*(at?Ce:ce)*Re*Se);return Math.log(Math.sqrt(dt*dt+1)-dt)}function be(at){return(Math.exp(at)-Math.exp(-at))/2}function Ae(at){return(Math.exp(at)+Math.exp(-at))/2}const Ne=ve(0);let De=function(at){return Ae(Ne)/Ae(Ne+pe*at)},Ye=function(at){return ce*((Ae(Ne)*(be(dt=Ne+pe*at)/Ae(dt))-be(Ne))/Re)/Se;var dt},Ke=(ve(1)-Ne)/pe;if(Math.abs(Se)<1e-6||!isFinite(Ke)){if(Math.abs(ce-Ce)<1e-6)return this.easeTo(o,d);const at=Ce<ce?-1:1;Ke=Math.abs(Math.log(Ce/ce))/pe,Ye=function(){return 0},De=function(dt){return Math.exp(at*pe*dt)}}o.duration="duration"in o?+o.duration:1e3*Ke/("screenSpeed"in o?+o.screenSpeed/pe:+o.speed),o.maxDuration&&o.duration>o.maxDuration&&(o.duration=0);const Tt=S!==F,Ue=z!==T,rt=!_.isPaddingEqual(q),$e=o.retainPadding===!1?_.clone():_,ct=at=>dt=>{const Gt=dt*Ke,Mt=1/De(Gt);at.zoom=dt===1?k:b+at.scaleZoom(Mt),Tt&&(at.bearing=a.aj(S,F,dt)),Ue&&(at.pitch=a.aj(T,z,dt)),rt&&($e.interpolatePadding(I,q,dt),te=$e.centerPoint.add(Z));const Ct=dt===1?oe:at.unproject(se.add(de.mult(Ye(Gt))).mult(Mt));return at.setLocationAtPoint(at.renderWorldCopies?Ct.wrap():Ct,te),at._updateCameraOnTerrain(),o.preloadOnly||this._fireMoveEvents(d),at};if(o.preloadOnly){const at=this._emulate(ct,o.duration,_);return this._preloadTiles(at),this}return this._zooming=!0,this._rotating=Tt,this._pitching=Ue,this._padding=rt,this._prepareEase(d,!1),this._ease(ct(_),()=>this._afterEase(d),o),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_requestRenderFrame(o){}_cancelRenderFrame(o){}_stop(o,d){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const _=this._onEaseEnd;this._onEaseEnd=void 0,_.call(this,d)}if(!o){const _=this.handlers;_&&_.stop(!1)}return this}_ease(o,d,_){_.animate===!1||_.duration===0?(o(1),d()):(this._easeStart=a.o.now(),this._easeOptions=_,this._onEaseFrame=o,this._onEaseEnd=d,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const o=Math.min((a.o.now()-this._easeStart)/this._easeOptions.duration,1),d=this._onEaseFrame;d&&d(this._easeOptions.easing(o)),o<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(o,d){o=a.bv(o,-180,180);const _=Math.abs(o-d);return Math.abs(o-360-d)<_&&(o-=360),Math.abs(o+360-d)<_&&(o+=360),o}_normalizeCenter(o){const d=this.transform;if(d.maxBounds||d.projection.name!=="globe"&&!d.renderWorldCopies)return;const _=o.lng-d.center.lng;o.lng+=_>180?-360:_<-180?360:0}_prefersReducedMotion(o){return this._respectPrefersReducedMotion&&a.o.prefersReducedMotion&&!(o&&o.essential)}_emulate(o,d,_){const b=Math.ceil(15*d/1e3),S=[],T=o(_.clone());for(let I=0;I<=b;I++){const k=T(I/b);S.push(k.clone())}return S}_preloadTiles(o,d){}}const Ou=/^(https?:|mailto:)/i;class Mw{constructor(o={}){this.options=o,a.b0(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(o){const d=this.options&&this.options.compact,_=o._getUIString("AttributionControl.ToggleAttribution");this._map=o,this._container=$("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=$("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._compactButton.setAttribute("aria-label",_);const b=$("span","mapboxgl-ctrl-icon",this._compactButton);return b.setAttribute("aria-hidden","true"),b.setAttribute("title",_),this._innerContainer=$("div","mapboxgl-ctrl-attrib-inner",this._container),d&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),d===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","fal
3298se")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let o=this._editLink;o||(o=this._editLink=this._container.querySelector(".mapbox-improve-map"));const d=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||a.g.ACCESS_TOKEN}];if(o){const _=d.reduce((b,S,T)=>(S.value&&(b+=`${S.key}=${S.value}${T<d.length-1?"&":""}`),b),"?");o.href=`${a.g.FEEDBACK_URL}/${_}#${Hp(this._map,!0)}`,o.rel="noopener nofollow"}}_updateData(o){!o||(o.dataType!=="source"||o.sourceDataType!=="metadata"&&o.sourceDataType!=="visibility")&&o.dataType!=="style"||(this._updateAttributions(),this._updateEditLink())}_updateAttributions(){if(!this._map.style)return;let o=[];if(this._map.style.stylesheet){const b=this._map.style.stylesheet;this.styleOwner=b.owner,this.styleId=b.id}const d=this._map.style._mergedSourceCaches;for(const b in d){const S=d[b];if(S.used){const T=S.getSource();T.attribution&&!o.includes(T.attribution)&&o.push(T.attribution)}}o.sort((b,S)=>b.length-S.length),o=o.filter((b,S)=>{for(let T=S+1;T<o.length;T++)if(o[T].includes(b))return!1;return!0}),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?o=[...this.options.customAttribution,...o]:o.unshift(this.options.customAttribution));const _=o.map(b=>(function(S){const T=new DOMParser().parseFromString(S,"text/html");return Array.from(T.body.querySelectorAll("*")).reverse().forEach(I=>{const k=I.textContent||"";if(I.tagName!=="A")return void I.replaceWith(...I.childNodes);const F=I.getAttribute("href");if(!F||!Ou.test(F))return void I.replaceWith(T.createTextNode(k));const z=T.createElement("a");z.href=F,z.textContent=k,z.rel="noopener nofollow";const q=I.getAttribute("class");q&&(z.className=q),I.replaceWith(z)}),T.body.innerHTML})(b)).join(" | ");_!==this._attribHTML&&(this._attribHTML=_,o.length?(this._innerContainer.innerHTML=_,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class Lw{constructor(){a.b0(["_updateLogo","_updateCompact"],this)}onAdd(o){this._map=o,this._container=$("div","mapboxgl-ctrl");const d=$("a","mapboxgl-ctrl-logo");return d.target="_blank",d.rel="noopener nofollow",d.href="https://www.mapbox.com/",d.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),d.setAttribute("rel","noopener nofollow"),this._container.appendChild(d),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(o){o&&o.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const o=this._map.style._sourceCaches;if(Object.entries(o).length===0)return!0;for(const d in o){const _=o[d].getSource();if(Object.hasOwn(_,"mapbox_logo")&&!_.mapbox_logo)return!1}return!0}_updateCompact(){const o=this._container.children;if(o.length){const d=o[0];this._map.getCanvasContainer().offsetWidth<250?d.classList.add("mapboxgl-compact"):d.classList.remove("mapboxgl-compact")}}}class Ow{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(o){const d=++this._id;return this._queue.push({callback:o,id:d,cancelled:!1}),d}remove(o){const d=this._currentlyRunning,_=d?this._queue.concat(d):this._queue;for(const b of _)if(b.id===o)return void(b.cancelled=!0)}run(o=0){const d=this._currentlyRunning=this._queue;this._queue=[];for(const _ of d)if(!_.cancelled&&(_.callback(o),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}class j2{constructor(o){this.jumpTo(o)}getValue(o){if(o<=this._startTime)return this._start;if(o>=this._endTime)return this._end;const d=a.dr((o-this._startTime)/(this._endTime-this._startTime));return this._start*(1-d)+this._end*d}isEasing(o){return o>=this._startTime&&o<=this._endTime}jumpTo(o){this._startTime=-1/0,this._endTime=-1/0,this._start=o,this._end=o}easeTo(o,d,_){this._start=this.getValue(d),this._end=o,this._startTime=d,this._endTime=d+_}}const iv={"AttributionControl.ToggleAttribution":"Toggle attribution","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox homepage","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use â + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"};class Dw extends a.z{constructor(o,d,_,b){const{point:S,lngLat:T,originalEvent:I,target:k}=o;super(o.type,{point:S,lngLat:T,originalEvent:I,target:k}),this.preventDefault=()=>{o.preventDefault()},this.id=d,this.interaction=_,this.feature=b}}class Bd{constructor(o){this.map=o,this.interactionsByType=new Map,this.delegatedInteractions=new Map,this.typeById=new Map,this.filters=new Map,this.handleType=this.handleType.bind(this),this.handleMove=this.handleMove.bind(this),this.handleOut=this.handleOut.bind(this),this.hoveredFeatures=new Map,this.prevHoveredFeatures=new Map}
3298add(o,d){if(this.typeById.has(o))throw new Error(`Interaction id "${o}" already exists.`);const _=d.filter;let b=d.type;_&&this.filters.set(o,a.dj(_)),b==="mouseover"&&(b="mouseenter"),b==="mouseout"&&(b="mouseleave");const S=this.interactionsByType.get(b)||new Map;b==="mouseenter"||b==="mouseleave"?(this.delegatedInteractions.size===0&&(this.map.on("mousemove",this.handleMove),this.map.on("mouseout",this.handleOut)),this.delegatedInteractions.set(o,d)):S.size===0&&this.map.on(b,this.handleType),S.size===0&&this.interactionsByType.set(b,S),S.set(o,d),this.typeById.set(o,b)}get(o){const d=this.typeById.get(o);if(!d)return;const _=this.interactionsByType.get(d);return _?_.get(o):void 0}remove(o){const d=this.typeById.get(o);if(!d)return;this.typeById.delete(o),this.filters.delete(o);const _=this.interactionsByType.get(d);_&&(_.delete(o),d==="mouseenter"||d==="mouseleave"?(this.delegatedInteractions.delete(o),this.delegatedInteractions.size===0&&(this.map.off("mousemove",this.handleMove),this.map.off("mouseout",this.handleOut))):_.size===0&&this.map.off(d,this.handleType))}queryTargets(o,d){const _=[];for(const[b,S]of d)S.target&&_.push({targetId:b,target:S.target,filter:this.filters.get(b)});return this.map.style.queryRenderedTargets(o,_,this.map.transform)}handleMove(o){this.prevHoveredFeatures=this.hoveredFeatures,this.hoveredFeatures=new Map;const d=this.queryTargets(o.point,Array.from(this.delegatedInteractions).reverse());d.length&&(o.type="mouseenter",this.handleType(o,d));const _=new Map;for(const[b,{feature:S}]of this.prevHoveredFeatures)this.hoveredFeatures.has(b)||_.set(S.id,S);_.size&&(o.type="mouseleave",this.handleType(o,Array.from(_.values())))}handleOut(o){const d=Array.from(this.hoveredFeatures.values()).map(({feature:_})=>_);d.length&&(o.type="mouseleave",this.handleType(o,d)),this.hoveredFeatures.clear()}handleType(o,d){const _=o.type==="mouseenter";if(_&&!this.interactionsByType.has(o.type))return void a.w("mouseenter interaction required for mouseleave to work.");const b=Array.from(this.interactionsByType.get(o.type)).reverse(),S=!!d;d=d||this.queryTargets(o.point,b);let T=!1;const I=new Set;for(const k of d){for(const[F,z]of b){if(!z.target)continue;const q=k.variants?k.variants[F]:null;if(q){for(const j of q){if(f1(j,k,I,F))continue;const Z=new a.dl(k,j),te=h1(j,k,F);S&&Z.id!==void 0&&(Z.state=this.map.getFeatureState(Z));const ee=_?this.prevHoveredFeatures.get(te):null,oe=new Dw(o,F,z,Z),se=ee?ee.stop:z.handler(oe);if(_&&this.hoveredFeatures.set(te,{feature:k,stop:se}),se!==!1){T=!0;break}}if(T)break}}if(T)break}if(!T)for(const[k,F]of b){const{handler:z,target:q}=F;if(!q&&z(new Dw(o,k,F,null))!==!1)break}}}function Fw(p,o){if(Array.isArray(p)&&Array.isArray(o)){const d=new Set(p),_=new Set(o);return d.size===_.size&&p.every(b=>_.has(b))}return a.b9(p,o)}const G2=/matrix.*\((.+)\)/,Bw={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,antialias:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,fontstackCompositing:"client",transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0,collectResourceTiming:!1,testMode:!1,precompilePrograms:!0,scaleFactor:1},H2={showCompass:!0,showZoom:!0,visualizePitch:!1};class W2{constructor(o,d,_=!1){this._clickTolerance=10,this.element=d,this.mouseRotate=new e_({clickTolerance:o.dragRotate._mouseRotate._clickTolerance}),this.map=o,_&&(this.mousePitch=new Ca({clickTolerance:o.dragRotate._mousePitch._clickTolerance})),a.b0(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),d.addEventListener("mousedown",this.mousedown),d.addEventListener("touchstart",this.touchstart,{passive:!1}),d.addEventListener("touchmove",this.touchmove),d.addEventListener("touchend",this.touchend),d.addEventListener("touchcancel",this.reset)}down(o,d){this.mouseRotate.mousedown(o,d),this.mousePitch&&this.mousePitch.mousedown(o,d),fe()}move(o,d){const _=this.map,b=this.mouseRotate.mousemoveWindow(o,d),S=b&&b.bearingDelta;if(S&&_.setBearing(_.getBearing()+S),this.mousePitch){const T=this.mousePitch.mousemoveWindow(o,d),I=T&&T.pitchDelta;I&&_.setPitch(_.getPitch()+I)}}off(){const o=this.element;o.removeEventListener("mousedown",this.mousedown),o.removeEventListener("touchstart",this.touchstart),o.removeEventListener("touchmove",this.touchmove),o.removeEventListener("touchend",this.touchend),o.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){ye(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup)}mousedown(o){this.down(Object.assign({},o,{button:o.button,type:o.type,ctrlKey:!0,preventDefault:()=>o.preventDefault()}),qe(this.element,o)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)}mousemove(o){this.move(o,qe(this.element,o))}mouseup(o){this.mouseRotate.mouseupWindow(o),this.mousePitch&&this.mousePitch.mouseupWindow(o),this.offTemp()}touchstart(o){o.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=lt(this.element,o.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>o.preventDefault()},this._startPos))}touchmove(o){o.targetTouches.length!==1?this.reset():(this._lastPos=lt(this.element,o.targetTouches)[0],this.move({buttons:1,preventDefault:()=>o.preventDefault()},this._lastPos))}touchend(o){o.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()}reset(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()}}function nc(p,o,d){if(p=new a.aX(p.lng,p.lat),o){const _=new a.aX(p.lng-360,p.lat),b=new a.aX(p.lng+360,p.lat),S=360*Math.ceil(Math.abs(p.lng-d.center.lng)/360),T=d.locationPoint3D(p).distSqr(o),I=o.x<0||o.y<0||o.x>d.width||o.y>d.height;d.locationPoint3D(_).distSqr(o)<T&&(I||Math.abs(_.lng-d.center.lng)<S)?p=_:d.locationPoint3D(b).distSqr(o)<T&&(I||Math.abs(b.lng-d.center.lng)<S)&&(p=b)}for(;Math.abs(p.lng-d.center.lng)>180;){const _=d.locationPoint3D(p);if(_.x>=0&&_.y>=0&&_.x<=d.width&&_.y<=d.height)break;p.lng>d.center.lng?p.lng-=360:p.lng+=360}return p}
3298const ov={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%)"},sv=/\s+/,Ka={rotation:0,rotationAlignment:"auto",pitchAlignment:"auto",occludedOpacity:.2,altitude:0};class Yp extends a.E{constructor(o,d){super(),(o instanceof HTMLElement||d)&&(o=Object.assign({element:o},d)),a.b0(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this);const{anchor:_="center",color:b="#3FB1CE",scale:S=1,draggable:T=!1,clickTolerance:I=0,rotation:k=Ka.rotation,rotationAlignment:F=Ka.rotationAlignment,pitchAlignment:z=Ka.pitchAlignment,occludedOpacity:q=Ka.occludedOpacity,altitude:j=Ka.altitude}=o||{};this._anchor=_,this._color=b,this._scale=S,this._draggable=T,this._clickTolerance=I,this._rotation=k,this._rotationAlignment=F,this._pitchAlignment=z,this._occludedOpacity=q,this._altitude=j,this._state="inactive",this._isDragging=!1,this._updateMoving=()=>this._update(!0),o&&o.element?(this._element=o.element,this._offset=a.P.convert(o&&o.offset||[0,0])):(this._defaultMarker=!0,this._element=this._createDefaultMarker(),this._offset=a.P.convert(o&&o.offset||[0,-14])),this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.hasAttribute("role")||this._element.setAttribute("role","img"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",ee=>{ee.preventDefault()}),this._element.addEventListener("mousedown",ee=>{ee.preventDefault()});const Z=this._element.classList;for(const ee in ov)Z.remove(`mapboxgl-marker-anchor-${ee}`);Z.add(`mapboxgl-marker-anchor-${this._anchor}`);const te=o&&o.className?o.className.trim().split(sv):[];Z.add(...te),this._popup=null}_createDefaultMarker(){const o=$("div"),d=Y("svg",{display:"block",height:41*this._scale+"px",width:27*this._scale+"px",viewBox:"0 0 27 41"},o);if(this._altitude===0){const _=Y("radialGradient",{id:"shadowGradient"},Y("defs",{},d));Y("stop",{offset:"10%","stop-opacity":.4},_),Y("stop",{offset:"100%","stop-opacity":.05},_),Y("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},d)}return Y("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},d),Y("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},d),Y("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},d),o}addTo(o){return o===this._map||(this.remove(),this._map=o,o.getCanvasContainer().appendChild(this._element),o.on("move",this._updateMoving),o.on("moveend",this._update),o.on("remove",this._clearFadeTimer),o._addMarker(this),this.setDraggable(this._draggable),this._update(),o.on("click",this._onMapClick)),this}remove(){const o=this._map;return o&&(o.off("click",this._onMapClick),o.off("move",this._updateMoving),o.off("moveend",this._update),o.off("mousedown",this._addDragHandler),o.off("touchstart",this._addDragHandler),o.off("mouseup",this._onUp),o.off("touchend",this._onUp),o.off("mousemove",this._onMove),o.off("touchmove",this._onMove),o.off("remove",this._clearFadeTimer),o._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(o){return this._lngLat=a.aX.convert(o),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}setAltitude(o){return o===this._altitude||(this._defaultMarker&&(this._altitude===0&&o!==0||this._altitude!==0&&o===0)&&(this._element=this._createDefaultMarker()),this._altitude=o||Ka.altitude,this._update()),this}getAltitude(){return this._altitude}getElement(){return this._element}
3298setPopup(o){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),o){if(!("offset"in o.options)){const b=Math.sqrt(Math.pow(13.5,2)/2);o.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[b,-1*(38.1-13.5+b)],"bottom-right":[-b,-1*(38.1-13.5+b)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=o,o._marker=this,o._altitude=this._altitude,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}_onKeyPress(o){const d=o.code,_=o.charCode||o.keyCode;d!=="Space"&&d!=="Enter"&&_!==32&&_!==13||this.togglePopup()}_onMapClick(o){const d=o.originalEvent.target,_=this._element;this._popup&&(d===_||_.contains(d))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const o=this._popup;return o?(o.isOpen()?(o.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(o.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const o=this._map,d=this._pos;if(!o||!d)return!1;const _=o.unproject(d,this._altitude),b=o.getFreeCameraOptions();if(!b.position)return!1;const S=b.position.toLngLat();return S.distanceTo(_)<.9*S.distanceTo(this._lngLat)}_evaluateOpacity(){const o=this._map;if(!o)return;const d=this._pos;if(!d||d.x<0||d.x>o.transform.width||d.y<0||d.y>o.transform.height)return void this._clearFadeTimer();const _=o.unproject(d,this._altitude);let b;o._showingGlobe()&&a.f2(o.transform,this._lngLat)?b=0:(b=1-o._queryFogOpacity(_),o.transform._terrainEnabled()&&o.getTerrain()&&this._behindTerrain()&&(b*=this._occludedOpacity)),this._element.style.opacity=`${b}`,this._element.style.pointerEvents=b>0?"auto":"none",this._popup&&this._popup._setOpacity(b),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const o=this._pos;if(!o||!this._map)return;const d=this._offset.mult(this._scale);this._element.style.transform=` 3299 translate(${o.x}px,${o.y}px) 3300 ${ov[this._anchor]} 3301 ${this._calculateXYTransform()} ${this._calculateZTransform()} 3302 translate(${d.x}px,${d.y}px) 3303 `}_calculateXYTransform(){const o=this._pos,d=this._map,_=this.getPitchAlignment();if(!d||!o||_!=="map")return"";if(!d._showingGlobe()){const k=d.getPitch();return k?`rotateX(${k}deg)`:""}const b=a.cL(a.f3(d.transform,this._lngLat)),S=o.sub(a.f4(d.transform)),T=
3303Math.abs(S.x)+Math.abs(S.y);if(T===0)return"";const I=b/T;return`rotateX(${-S.y*I}deg) rotateY(${S.x*I}deg)`}_calculateZTransform(){const o=this._pos,d=this._map;if(!d||!o)return"";let _=0;const b=this.getRotationAlignment();if(b==="map")if(d._showingGlobe()){const S=d.project(new a.aX(this._lngLat.lng,this._lngLat.lat+.001),this._altitude),T=d.project(new a.aX(this._lngLat.lng,this._lngLat.lat-.001),this._altitude).sub(S);_=a.cL(Math.atan2(T.y,T.x))-90}else _=-d.getBearing();else if(b==="horizon"){const S=a.ag(4,6,d.getZoom()),T=a.f4(d.transform);T.y+=S*d.transform.height;const I=o.sub(T),k=a.cL(Math.atan2(I.y,I.x));_=(k>90?k-270:k+90)*(1-S)}return _+=this._rotation,_?`rotateZ(${_}deg)`:""}_update(o){cancelAnimationFrame(this._updateFrameId);const d=this._map;d&&(d.transform.renderWorldCopies&&(this._lngLat=nc(this._lngLat,this._pos,d.transform)),this._pos=d.project(this._lngLat,this._altitude),o===!0?this._updateFrameId=requestAnimationFrame(()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),d._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(d._showingGlobe()||d.getTerrain()||d.getFog())&&!this._fadeTimer&&(this._fadeTimer=window.setTimeout(this._evaluateOpacity.bind(this),60)))}))}getOffset(){return this._offset}setOffset(o){return this._offset=a.P.convert(o),this._update(),this}addClassName(o){return this._element.classList.add(o),this}removeClassName(o){return this._element.classList.remove(o),this}toggleClassName(o){return this._element.classList.toggle(o)}_onMove(o){const d=this._map;if(!d)return;const _=this._pointerdownPos,b=this._positionDelta;if(_&&b){if(!this._isDragging){const S=this._clickTolerance||d._clickTolerance;if(o.point.dist(_)<S)return;this._isDragging=!0}this._pos=o.point.sub(b),this._lngLat=d.unproject(this._pos,this._altitude),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new a.z("dragstart"))),this.fire(new a.z("drag"))}}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1;const o=this._map;o&&(o.off("mousemove",this._onMove),o.off("touchmove",this._onMove)),this._state==="active"&&this.fire(new a.z("dragend")),this._state="inactive"}_addDragHandler(o){const d=this._map,_=this._pos;d&&_&&this._element.contains(o.originalEvent.target)&&(o.preventDefault(),this._positionDelta=o.point.sub(_),this._pointerdownPos=o.point,this._state="pending",d.on("mousemove",this._onMove),d.on("touchmove",this._onMove),d.once("mouseup",this._onUp),d.once("touchend",this._onUp))}setDraggable(o){this._draggable=!!o;const d=this._map;return d&&(o?(d.on("mousedown",this._addDragHandler),d.on("touchstart",this._addDragHandler)):(d.off("mousedown",this._addDragHandler),d.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(o){return this._rotation=o||Ka.rotation,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(o){return this._rotationAlignment=o||Ka.rotationAlignment,this._update(),this}getRotationAlignment(){return this._rotationAlignment==="auto"||this._rotationAlignment==="horizon"&&this._map&&!this._map._showingGlobe()?"viewport":this._rotationAlignment}setPitchAlignment(o){return this._pitchAlignment=o||Ka.pitchAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment==="auto"?this.getRotationAlignment():this._pitchAlignment}setOccludedOpacity(o){return this._occludedOpacity=o||Ka.occludedOpacity,this._update(),this}getOccludedOpacity(){return this._occludedOpacity}}const av={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0,showUserHeading:!1,showButton:!0,followUserLocation:!0},q2={maxWidth:100,unit:"metric"},zw={kilometer:"km",meter:"m",mile:"mi",foot:"ft","nautical-mile":"nm"},Nw=/\s+/,lv={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",altitude:0}
3303,pi=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function cv(p=new a.P(0,0),o="bottom"){if(typeof p=="number"){const d=Math.round(Math.sqrt(.5*Math.pow(p,2)));switch(o){case"top":return new a.P(0,p);case"top-left":return new a.P(d,d);case"top-right":return new a.P(-d,d);case"bottom":return new a.P(0,-p);case"bottom-left":return new a.P(d,-d);case"bottom-right":return new a.P(-d,-d);case"left":return new a.P(p,0);case"right":return new a.P(-p,0)}return new a.P(0,0)}return p instanceof a.P||Array.isArray(p)?a.P.convert(p):a.P.convert(p[o]||[0,0])}return{version:y,supported:V.supported,setRTLTextPlugin:a.f7,getRTLTextPluginStatus:a.f6,addTileProvider:a.f5,Map:class extends Ya{constructor(p){C.mark(E.create);const o=p;if((p=Object.assign({},Bw,p)).minZoom!=null&&p.maxZoom!=null&&p.minZoom>p.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(p.minPitch!=null&&p.maxPitch!=null&&p.minPitch>p.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(p.minPitch!=null&&p.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(p.maxPitch!=null&&p.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");p.antialias&&a.f0(window)&&(p.antialias=!1,a.w("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new jh(p.minZoom,p.maxZoom,p.minPitch,p.maxPitch,p.renderWorldCopies,null,null),p),this._repaint=!!p.repaint,this._interactive=p.interactive,this._minTileCacheSize=p.minTileCacheSize,this._maxTileCacheSize=p.maxTileCacheSize,this._failIfMajorPerformanceCaveat=p.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=p.preserveDrawingBuffer,this._antialias=p.antialias,this._trackResize=p.trackResize,this._bearingSnap=p.bearingSnap,this._refreshExpiredTiles=p.refreshExpiredTiles,this._fadeDuration=p.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=p.crossSourceCollisions,this._collectResourceTiming=p.collectResourceTiming,this._language=this._parseLanguage(p.language),this._worldview=p.worldview,this._renderTaskQueue=new Ow,this._domRenderTaskQueue=new Ow,this._controls=[],this._markers=[],this._popups=[],this._mapId=a.an(),this._locale=Object.assign({},iv,p.locale),this._clickTolerance=p.clickTolerance,this._cooperativeGestures=p.cooperativeGestures,this._performanceMetricsCollection=p.performanceMetricsCollection,this._tessellationStep=p.tessellationStep,this._containerWidth=0,this._containerHeight=0,this._showParseStatus=!0,this._precompilePrograms=p.precompilePrograms,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new j2(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._frameId=0,this._scaleFactor=p.scaleFactor,this._requestManager=new Mn(p.transformRequest,p.accessToken,p.testMode);const d=Rn(p.accessToken||a.g.ACCESS_TOKEN);if(d&&"atlas"in d&&typeof d.atlas=="number"&&(this._tokenExpiration=d.atlas),this._silenceAuthErrors=!!p.testMode,this._contextCreateOptions=p.contextCreateOptions?Object.assign({},p.contextCreateOptions):{},typeof p.container=="string"){const _=document.getElementById(p.container);if(!_)throw new Error(`Container '${p.container.toString()}' not found.`);this._container=_}else{if(!(p.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=p.container}if(this._container.childNodes.length>0&&a.w("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),p.maxBounds&&this.setMaxBounds(p.maxBounds),this._spriteFormat="auto",a.b0(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");if(this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this._fullscreenchangeEvent="onfullscreenchange"in document?"fullscreenchange":"webkitfullscreenchange",window.addEventListener("online",this._onWindowOnline,!1),window.addEventListener("resize",this._onWindowResize,!1),window.addEventListener("orientationchange",this._onWindowResize,!1),window.addEventListener(this._fullscreenchangeEvent,this._onWindowResize,!1),window.addEventListener("visibilitychange",this._onVisibilityChange,!1),this.handlers=new $2(this,p),this._localFontFamily=p.localFontFamily,this._localIdeographFontFamily=p.localIdeographFontFamily,this._fontstackCompositing=p.fontstackCompositing,(p.style||!p.testMode)&&this.setStyle(p.style||a.g.DEFAULT_STYLE,{config:p.config,localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily,fontstackCompositing:this._fontstackCompositing}),p.projection&&this.setProjection(p.projection),p.hash&&(this._hash=new Jl(typeof p.hash=="string"&&p.hash||void 0).addTo(this)),!this._hash||!this._hash._onHashChange()){o.center==null&&o.zoom==null||(this.transform._unmodified=!1),this.jumpTo({center:p.center,zoom:p.zoom,bearing:p.bearing,pitch:p.pitch});const _=p.bounds;_&&(this.resize(),this.fitBounds(_,Object.assign({},p.fitBoundsOptions,{duration:0})))}this.resize(),p.attributionControl&&this.addControl(new Mw({customAttribution:p.customAttribution}
3303)),this._logoControl=new Lw,this.addControl(this._logoControl,p.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this._postStyleLoadEvent(),this._postStyleWithAppearanceEvent()}),this.on("data",_=>{this._update(_.dataType==="style"),this.fire(new a.z(`${_.dataType}data`,_))}),this.on("dataloading",_=>{this.fire(new a.z(`${_.dataType}dataloading`,_))}),this._interactions=new Bd(this)}_getMapId(){return this._mapId}addControl(p,o){if(o===void 0&&(o=p.getDefaultPosition?p.getDefaultPosition():"top-right"),!p||!p.onAdd)return this.fire(new a.y(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const d=p.onAdd(this);this._controls.push(p);const _=this._controlPositions[o];return o.includes("bottom")?_.insertBefore(d,_.firstChild):_.appendChild(d),this}removeControl(p){if(!p||!p.onRemove)return this.fire(new a.y(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const o=this._controls.indexOf(p);return o>-1&&this._controls.splice(o,1),p.onRemove(this),this}hasControl(p){return this._controls.includes(p)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(p){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const o=!this._moving;return o&&this.fire(new a.z("movestart",p)).fire(new a.z("move",p)),this.fire(new a.z("resize",p)),o&&this.fire(new a.z("moveend",p)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(p){return this.transform.setMaxBounds(a.aI.convert(p)),this._update()}setMinZoom(p){if((p=p??-2)>=-2&&p<=this.transform.maxZoom)return this.transform.minZoom=p,this._update(),this.getZoom()<p?this.setZoom(p):this.fire(new a.z("zoomstart")).fire(new a.z("zoom")).fire(new a.z("zoomend")),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(p){if((p=p??22)>=this.transform.minZoom)return this.transform.maxZoom=p,this._update(),this.getZoom()>p?this.setZoom(p):this.fire(new a.z("zoomstart")).fire(new a.z("zoom")).fire(new a.z("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(p){if((p=p??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(p>=0&&p<=this.transform.maxPitch)return this.transform.minPitch=p,this._update(),this.getPitch()<p?this.setPitch(p):this.fire(new a.z("pitchstart")).fire(new a.z("pitch")).fire(new a.z("pitchend")),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(p){if((p=p??85)>85)throw new Error("maxPitch must be less than or equal to 85");if(p>=this.transform.minPitch)return this.transform.maxPitch=p,this._update(),this.getPitch()>p?this.setPitch(p):this.fire(new a.z("pitchstart")).fire(new a.z("pitch")).fire(new a.z("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getScaleFactor(){return this._scaleFactor}setScaleFactor(p){return this._scaleFactor=p,this.painter.scaleFactor=p,this.style&&this.style._setLabelPlacementStale(),this.style._updateFilteredLayers(o=>o.type==="symbol"),this._update(!0),this}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(p){return this.transform.renderWorldCopies=p,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(p){return p==="auto"?navigator.language:Array.isArray(p)?p.length===0?void 0:p.map(o=>o==="auto"?navigator.language:o):p}setLanguage(p){const o=this._parseLanguage(p);if(!this.style||o===this._language)return this;this._language=o,this.style.reloadSources();for(const d of this._controls)d._setLanguage&&d._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(p){return this.style&&p!==this._worldview?(this._worldview=p,this._styleDirty=!0,this.style.setWorldview(p),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return this.transform.projection.name==="globe"}setProjection(p){return this._lazyInitEmptyStyle(),p?typeof p=="string"&&(p={name:p}):p=null,this._useExplicitProjection=!!p,this._prioritizeAndUpdateProjection(p,this.style.projection)}_updateProjectionTransition(){if(this.getProjection().name!=="globe")return;const p=this.transform,o=p.projection.name;let d;o==="globe"&&p.zoom>=a.cx?(p.setMercatorFromTransition(),d=!0):o==="mercator"&&p.zoom<a.cx&&(p.setProjection({name:"globe"}),d=!0),d&&(this.style.applyProjectionUpdate(),this.style._forceSymbolLayer
3303Update(),this._update(!0))}_prioritizeAndUpdateProjection(p,o){return this._updateProjection(p||o||{name:"mercator"})}_updateProjection(p){let o;const d=this.transform.mercatorFromTransition;o=p.name==="globe"&&this.transform.zoom>=a.cx?this.transform.setMercatorFromTransition():this.transform.setProjection(p),this.style.applyProjectionUpdate();const _=this.transform.getProjection().name==="mercator"&&d!==this.transform.mercatorFromTransition;return(o||_)&&(this.painter.clearBackgroundTiles(),this.style.clearSources(),this._update(!0),this._forceMarkerAndPopupUpdate(!0)),this}project(p,o){return this.transform.locationPoint3D(a.aX.convert(p),o)}unproject(p,o){return this.transform.pointLocation3D(a.P.convert(p),o)}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(p,o,d){const _=b=>{let S=[];if(Array.isArray(o)){const T=o.filter(I=>this.getLayer(I));S=T.length?this.queryRenderedFeatures(b,{layers:T}):[]}else S=this.queryRenderedFeatures(b,{target:o});return S};if(p==="mouseenter"||p==="mouseover"){let b=!1;return{listener:d,targets:o,delegates:{mousemove:T=>{const I=_(T.point);I.length?b||(b=!0,d.call(this,new Ns(p,this,T.originalEvent,{features:I}))):b=!1},mouseout:()=>{b=!1}}}}if(p==="mouseleave"||p==="mouseout"){let b=!1;return{listener:d,targets:o,delegates:{mousemove:I=>{_(I.point).length?b=!0:b&&(b=!1,d.call(this,new Ns(p,this,I.originalEvent)))},mouseout:I=>{b&&(b=!1,d.call(this,new Ns(p,this,I.originalEvent)))}}}}{const b=S=>{const T=_(S.point);T.length&&(S.features=T,d.call(this,S),delete S.features)};return{listener:d,targets:o,delegates:{[p]:b}}}}on(p,o,d){if(typeof o=="function"||d===void 0)return super.on(p,o);if(typeof o=="string"&&(o=[o]),!this._areTargetsValid(o))return this;const _=this._createDelegatedListener(p,o,d);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[p]=this._delegatedListeners[p]||[],this._delegatedListeners[p].push(_);for(const b in _.delegates)this.on(b,_.delegates[b]);return this}once(p,o,d){if(typeof o=="function"||d===void 0)return super.once(p,o);if(typeof o=="string"&&(o=[o]),!this._areTargetsValid(o))return this;const _=this._createDelegatedListener(p,o,d);for(const b in _.delegates)this.once(b,_.delegates[b]);return this}off(p,o,d){if(typeof o=="function"||d===void 0)return super.off(p,o);if(typeof o=="string"&&(o=[o]),!this._areTargetsValid(o))return this;const _=this._delegatedListeners?this._delegatedListeners[p]:void 0;return _&&(b=>{for(let S=0;S<b.length;S++){const T=b[S];if(T.listener===d&&Fw(T.targets,o)){for(const I in T.delegates)this.off(I,T.delegates[I]);return b.splice(S,1),this}}})(_),this}queryRenderedFeatures(p,o){if(!this.style)return[];if(p===void 0||p instanceof a.P||Array.isArray(p)||o!==void 0||(o=p,p=void 0),p=p||[[0,0],[this.transform.width,this.transform.height]],!o){const S=this.style.queryRenderedFeatures(p,void 0,this.transform),T=this.style.queryRenderedFeatureset(p,void 0,this.transform);return S.concat(T)}let d=!0;if(o.target&&(d=this._isTargetValid(o.target),d&&!o.layers))return this.style.queryRenderedFeatureset(p,o,this.transform);let _=!0;if(o.layers&&Array.isArray(o.layers)){for(const S of o.layers)if(!this._isValidId(S)){_=!1;break}if(_&&!o.target)return this.style.queryRenderedFeatures(p,o,this.transform)}let b=[];return _&&(b=b.concat(this.style.queryRenderedFeatures(p,o,this.transform))),d&&(b=b.concat(this.style.queryRenderedFeatureset(p,o,this.transform))),b}querySourceFeatures(p,o){return!p||typeof p=="string"&&!this._isValidId(p)?[]:this.style.querySourceFeatures(p,o)}queryRasterValue(p,o,d){return this._isValidId(p)?this.style.queryRasterValue(p,o,d):Promise.resolve(null)}isPointOnSurface(p){const{name:o}=this.transform.projection;return o!=="globe"&&o!=="mercator"&&a.w(`${o} projection does not support isPointOnSurface, this API may behave unex
3303pectedly.`),this.transform.isPointOnSurface(a.P.convert(p))}addInteraction(p,o){return this._interactions.add(p,o),this}removeInteraction(p){return this._interactions.remove(p),this}getCooperativeGestures(){return this._cooperativeGestures}setCooperativeGestures(p){return this._cooperativeGestures=p,this}setStyle(p,o){return o=Object.assign({},{localIdeographFontFamily:this._localIdeographFontFamily,localFontFamily:this._localFontFamily,fontstackCompositing:this._fontstackCompositing},o),this.style&&p&&o.diff!==!1&&o.localFontFamily===this._localFontFamily&&o.localIdeographFontFamily===this._localIdeographFontFamily&&o.fontstackCompositing===this._fontstackCompositing&&!o.config?(this.style._diffStyle(p,(d,_)=>{if(d){const b=typeof d=="string"?d:d instanceof Error?d.message:d.error;a.w(`Unable to perform style diff: ${b}. Rebuilding the style from scratch.`),this._updateStyle(p,o)}else _&&this._update(!0)},()=>this._postStyleLoadEvent()),this):(this._localIdeographFontFamily=o.localIdeographFontFamily,this._localFontFamily=o.localFontFamily,this._fontstackCompositing=o.fontstackCompositing,this._updateStyle(p,o))}_getUIString(p){const o=this._locale[p];if(o==null)throw new Error(`Missing UI string '${p}'`);return o}_updateStyle(p,o){if(this.style&&(this.style.setEventedParent(null),this.style._remove(),this.style=void 0),p){const d=Object.assign({},o);o&&o.config&&(d.initialConfig=o.config,delete d.config),this.style=new ta(this,d).load(p),this.style.setEventedParent(this,{style:this.style})}return this._updateTerrain(),this}_lazyInitEmptyStyle(){this.style||(this.style=new ta(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(a.w("There is no style added to the map."),!1)}_isValidId(p){return p==null?(this.fire(new a.y(new Error("IDs can't be empty."))),!1):!a.de(p)||(this.fire(new a.y(new Error(`IDs can't contain special symbols: "${p}".`))),!1)}_isTargetValid(p){return"featuresetId"in p?this._isValidId("importId"in p?p.importId:p.featuresetId):"layerId"in p&&this._isValidId(p.layerId)}_areTargetsValid(p){if(Array.isArray(p)){for(const o of p)if(!this._isValidId(o))return!1;return!0}return this._isTargetValid(p)}addSource(p,o){return this._isValidId(p)?(this._lazyInitEmptyStyle(),this.style.addSource(p,o),this._update(!0)):this}isSourceLoaded(p){return!!this._isValidId(p)&&!!this.style&&this.style._isSourceCacheLoaded(p)}areTilesLoaded(){return this.style.areTilesLoaded()}addSourceType(p,o,d){this._lazyInitEmptyStyle(),this.style.addSourceType(p,o,d)}removeSource(p){return this._isValidId(p)?(this.style.removeSource(p),this._updateTerrain(),this._update(!0)):this}getSource(p){return this._isValidId(p)?this.style.getOwnSource(p):null}addImage(p,o,{pixelRatio:d=1,sdf:_=!1,stretchX:b,stretchY:S,content:T}={}){this._lazyInitEmptyStyle();const I=a.I.from(p);if(o instanceof HTMLImageElement||ImageBitmap&&o instanceof ImageBitmap){const{width:k,height:F,data:z}=a.o.getImageData(o);this.style.addImage(I,{data:new a.q({width:k,height:F},z),pixelRatio:d,stretchX:b,stretchY:S,content:T,sdf:_,version:0,usvg:!1})}else if(o.width===void 0||o.height===void 0)this.fire(new a.y(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`")));else{const{width:k,height:F}=o,z=o;this.style.addImage(I,{data:new a.q({width:k,height:F},new Uint8Array(z.data)),pixelRatio:d,stretchX:b,stretchY:S,content:T,sdf:_,usvg:!1,version:0,userImage:z}),z.onAdd&&z.onAdd(this,p)}}updateImage(p,o){this._lazyInitEmptyStyle();const d=a.I.from(p),_=this.style.getImage(d);if(!_)return void this.fire(new a.y(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const b=o instanceof HTMLImageElement||ImageBitmap&&o instanceof ImageBitmap?a.o.getImageData(o):o,{width:S,height:T,data:I}=b;if(S===void 0||T===void 0)return void this.fire(new a.y(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(S!==(_.usvg?_.icon.usvg_tree.width:_.data.width)||T!==(_.usvg?_.icon.usvg_tree.height:_.data.height))return void this.fire(new a.y(new Error(`The width and height of the updated image (${S}, ${T}) 3304 must be that same as the previous version of the image 3305 (${_.data.width}, ${_.data.height})`)));const k=!(o instanceof HTMLImageElement||ImageBitmap&&o instanceof ImageBitmap);let F=!1;_.usvg?(_.data=new a.q({width:S,height:T},new Uint8Array(I)),_.usvg=!1,_.icon=void 0,F=!0):_.data.replace(I,k),this.style.updateImage(d,_,F)}hasImage(p){return p?!!this.style&&!!this.style.getImage(a.I.from(p)):(this.fire(new a.y(new Error("Missing required image id"))),!1)}removeImage(p){this.style.removeImage(a.I.from(p))}loadImage(p,o){a.n(this._requestManager.transformRequest(p,a.R.Image),(d,_)=>{o(d,_)})}listImages(){return this.style.listImages().map(p=>p.name)}addModel(p,o){this._lazyInitEmptyStyle(),this.style.addModel(p,o)}hasModel(p){return p?this.style.hasModel(p):(this.fire(new a.y(new Error("Missing required model id"))),!1)}removeModel(p){this.style.removeModel(p)}listModels(){return this.style.listModels()}addLayer(p,o){return this._isValidId(p.id)?(this._lazyInitEmptyStyle(),this.style.addLayer(p,o),this._update(!0)):this}getSlot(p){const o=this.getLayer(p);return o&&o.slot||null}setSlot(p,o){return this.style.setSlot(p,o),this.style.mergeLayers(),this._update(!0)}
3305addImport(p,o){return this.style.addImport(p,o).catch(d=>this.fire(new a.y(new Error("Failed to add import",d)))),this}updateImport(p,o){return typeof o!="string"&&o.id!==p?(this.removeImport(p),this.addImport(o)):(this.style.updateImport(p,o),this._update(!0))}removeImport(p){return this.style.removeImport(p),this}moveImport(p,o){return this.style.moveImport(p,o),this._update(!0)}moveLayer(p,o){return this._isValidId(p)?(this.style.moveLayer(p,o),this._update(!0)):this}removeLayer(p){return this._isValidId(p)?(this.style.removeLayer(p),this._update(!0)):this}getLayer(p){if(!this._isValidId(p))return null;const o=this.style.getOwnLayer(p);return o?o.type==="custom"?o.implementation:o.serialize():void 0}getSlots(){return this.style.getSlots()}setLayerZoomRange(p,o,d){return this._isValidId(p)?(this.style.setLayerZoomRange(p,o,d),this._update(!0)):this}setFilter(p,o,d={}){return this._isValidId(p)?(this.style.setFilter(p,o,d),this._update(!0)):this}getFilter(p){return this._isValidId(p)?this.style.getFilter(p):null}setPaintProperty(p,o,d,_={}){return this._isValidId(p)?(this.style.setPaintProperty(p,o,d,_),this._update(!0)):this}getPaintProperty(p,o){return this._isValidId(p)?this.style.getPaintProperty(p,o):null}setLayoutProperty(p,o,d,_={}){return this._isValidId(p)?(this.style.setLayoutProperty(p,o,d,_),this._update(!0)):this}getLayoutProperty(p,o){return this._isValidId(p)?this.style.getLayoutProperty(p,o):null}setLayerProperty(p,o,d,_={}){return this._isValidId(p)?(o==="appearances"&&this._postAddingAppearancesToStyleEvent(),this.style.setLayerProperty(p,o,d,_),this._update(!0)):this}getGlyphsUrl(){return this.style.getGlyphsUrl()}setGlyphsUrl(p){return this.style.setGlyphsUrl(p),this._update(!0)}getSchema(p){return this.style.getSchema(p)}setSchema(p,o){return this.style.setSchema(p,o),this._update(!0)}getConfig(p){return this.style.getConfig(p)}setConfig(p,o){return this.style.setConfig(p,o),this._update(!0)}getConfigProperty(p,o){return this.style.getConfigProperty(p,o)}setConfigProperty(p,o,d){return this.style.setConfigProperty(p,o,d),this._update(!0)}getFeaturesetDescriptors(p){return this.style.getFeaturesetDescriptors(p)}setLights(p){if(this._lazyInitEmptyStyle(),p&&p.length===1&&p[0].type==="flat"){const o=p[0];o.properties?this.style.setFlatLight(o.properties,o.id,{}):this.style.setFlatLight({},"flat")}else this.style.setLights(p),this.painter.terrain&&(this.painter.terrain.invalidateRenderCache=!0);return this._update(!0)}getLights(){const p=this.style.getLights()||[];return p.length===0&&p.push({id:this.style.light.id,type:"flat",properties:this.style.getFlatLight()}),p}setLight(p,o={}){return console.log("The `map.setLight` function is deprecated, prefer using `map.setLights` with `flat` light type instead."),this.setLights([{id:"flat",type:"flat",properties:p}])}getLight(){return console.log("The `map.getLight` function is deprecated, prefer using `map.getLights` instead."),this.style.getFlatLight()}setTerrain(p){return this._lazyInitEmptyStyle(),!p&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(p),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(p){return this._lazyInitEmptyStyle(),this.style.setFog(p),this._update(!0)}getFog(){return this.style?this.style.getFog():null}setSnow(p){return this._lazyInitEmptyStyle(),this.style.setSnow(p),this._update(!0)}getSnow(){return this.style?this.style.getSnow():null}setRain(p){return this._lazyInitEmptyStyle(),this.style.setRain(p),this._update(!0)}getRain(){return this.style?this.style.getRain():null}setColorTheme(p){return this._lazyInitEmptyStyle(),this.style.setColorTheme(p),this._update(!0)}setImportColorTheme(p,o){return this._lazyInitEmptyStyle(),this.style.setImportColorTheme(p,o),this._update(!0)}setCamera(p){return this.style.setCamera(p),this._triggerCameraUpdate(p)}getNearClipOffset(){return this.transform.nearClipOffset}setNearClipOffset(p){const o=this.transform.nearClipOffset!==p;return this.transform.nearClipOffset=p,this._update(o)}_triggerCameraUpdate(p){return this._update(this.transform.setOrthogra
3305phicProjectionAtLowPitch(p["camera-projection"]==="orthographic"))}getCamera(){return this.style.camera}_queryFogOpacity(p){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(a.aX.convert(p),this.transform):0}setFeatureState(p,o){return p.source&&!this._isValidId(p.source)?this:(this.style.setFeatureState(p,o),this._update())}removeFeatureState(p,o){return p.source&&!this._isValidId(p.source)?this:(this.style.removeFeatureState(p,o),this._update())}getFeatureState(p){return p.source&&!this._isValidId(p.source)?null:this.style.getFeatureState(p)}_selectIndoorFloor(p){this.style.indoorManager.selectFloor(p)}_setIndoorActiveFloorsVisibility(p){this.style.indoorManager.setActiveFloorsVisibility(p)}getIndoorTileOptions(p,o){return this.style&&this.style.isIndoorEnabled()?this.style.indoorManager.getIndoorTileOptions(p,o):null}_updateContainerDimensions(){if(!this._container)return;const p=this._container.getBoundingClientRect().width||400,o=this._container.getBoundingClientRect().height||300;let d,_,b,S=this._container;for(;S&&(!_||!b);){const T=window.getComputedStyle(S).transform;T&&T!=="none"&&(d=T.match(G2)[1].split(", "),d[0]&&d[0]!=="0"&&d[0]!=="1"&&(_=d[0]),d[3]&&d[3]!=="0"&&d[3]!=="1"&&(b=d[3])),S=S.parentElement}this._containerWidth=_?Math.abs(p/_):p,this._containerHeight=b?Math.abs(o/b):o}_detectMissingCSS(){window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&a.w("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const p=this._container;p.classList.add("mapboxgl-map"),(this._missingCSSCanary=$("div","mapboxgl-canary",p)).style.visibility="hidden",this._detectMissingCSS();const o=this._canvasContainer=$("div","mapboxgl-canvas-container",p);this._canvas=$("canvas","mapboxgl-canvas",o),this._interactive&&(o.classList.add("mapboxgl-interactive"),this._canvas.setAttribute("tabindex","0")),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const d=this._controlContainer=$("div","mapboxgl-control-container",p),_=this._controlPositions={};["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"].forEach(b=>{_[b]=$("div",`mapboxgl-ctrl-${b}`,d)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(p,o){const d=a.o.devicePixelRatio||1;this._canvas.width=d*Math.ceil(p),this._canvas.height=d*Math.ceil(o),this._canvas.style.width=`${p}px`,this._canvas.style.height=`${o}px`}_addMarker(p){this._markers.push(p)}_removeMarker(p){const o=this._markers.indexOf(p);o!==-1&&this._markers.splice(o,1)}_addPopup(p){this._popups.push(p)}_removePopup(p){const o=this._popups.indexOf(p);o!==-1&&this._popups.splice(o,1)}_setupPainter(){const p=Object.assign({},V.supported.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),o=this._canvas.getContext("webgl2",p);o?(Lt(o,!0),this.painter=new Aw(o,this._contextCreateOptions,this.transform,this._scaleFactor,this._worldview),this.on("data",d=>{if(d.dataType==="source"){const _=this.transform.elevation?this.transform.elevation._source():null;_&&d.sourceCacheId===_.id&&this.style&&this.style._setLabelPlacementStale(),this.painter.setTileLoadedFlag(!0)}}),a.k.testSupport(o)):this.fire(new a.y(new Error("Failed to initialize WebGL")))}_contextLost(p){p.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.style&&this.style.handleContextLost(),this.fire(new a.z("webglcontextlost",{originalEvent:p}))}_contextRestored(p){this._setupPainter(),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight)),this._updateTerrain(),this.style&&(this.style.clearLayers(),this.style.imageManager.destroyAtlasTextures(),this.style.imageManager.imageAtlasCache.destroyTextures(),this.style.reloadModels(),this.style.clearSources()),this._update(),this.fire(new a.z("webglcontextrestored",{originalEvent:p}))}_onMapScroll(p){if(p.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}idle(){return!this.isMoving()&&this.loaded()}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}frameReady(){return this.loaded()&&!this._placementDirty}_update(p){return this.style?(this._styleDirty=this._styleDirty||p,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(p){return this._update(),this._renderTaskQueue.add(p)}_cancelRenderFrame(p){this._renderTaskQueue.remove(p)}_requestDomTask(p){!this.loaded()||this.loaded()&&!this.isMoving()?p():this._domRenderTaskQueue.add(p)}_render(p){let o;this.fire(new a.z("renderstart")),++this._frameId;const d=this.painter.context.extTimerQuery,_=a.o.now(),b=this.painter.context.gl;if(this.listens("gpu-timing-frame")&&(o=b.createQuery(),b.beginQuery(d.TIME_ELAPSED_EXT,o)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&
vendor: 2,699 bytes, line 3305
3305(this._interactionRange[0]=Math.min(this._interactionRange[0],performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],performance.now())),this._renderTaskQueue.run(p),this._domRenderTaskQueue.run(p),this._removed)return;this._updateProjectionTransition();const S=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const k=this.transform.zoom,F=this.transform.pitch,z=a.o.now(),q=new a.ab(k,{now:z,fadeDuration:S,pitch:F,transition:this.style.transition,worldview:this._worldview});this.style.update(q)}this.style&&this.style.hasFogTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let T=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),T=this._updateAverageElevation(_),this.style.updateSources(this.transform),this.style.updateImageProviders(),this.isMoving()||this._forceMarkerAndPopupUpdate()):T=this._updateAverageElevation(_),this.style&&(this._placementDirty=this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,S,this._crossSourceCollisions,this.painter.replacementSource)),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showParseStatus:this.showParseStatus,wireframe:{terrain:this.showTerrainWireframe,layers2D:this.showLayers2DWireframe,layers3D:this.showLayers3DWireframe},showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:S,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new a.z("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,C.mark(E.load),this.fire(new a.z("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&(this.style.snow||this.style.rain)&&(this._styleDirty=!0),this.style&&this.style.imageManager.hasPatternsInFlight()&&(this._styleDirty=!0),this.style&&!this.style.modelManager.isLoaded()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),o){const k=a.o.now()-_;b.endQuery(d.TIME_ELAPSED_EXT),setTimeout(()=>{const F=b.getQueryParameter(o,b.QUERY_RESULT)/1e6;b.deleteQuery(o),this.fire(new a.z("gpu-timing-frame",{cpuTime:k,gpuTime:F}))},50)}if(this.listens("gpu-timing-layer")){const k=this.painter.collectGpuTimers();setTimeout(()=>{const F=this.painter.queryGpuTimers(k);this.fire(new a.z("gpu-timing-layer",{layerTimes:F}
vendor: 7,489 bytes, line 3305
3305))},50)}if(this.listens("gpu-timing-deferred-render")){const k=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{const F=this.painter.queryGpuTimeDeferredRender(k);this.fire(new a.z("gpu-timing-deferred-render",{gpuTime:F}))},50)}const I=this._sourcesDirty||this._styleDirty||this._placementDirty||T;if(I||this._repaint)this.triggerRepaint();else{const k=this.idle();if(k&&(T=this._updateAverageElevation(_,!0)),T)this.triggerRepaint();else{if(this._triggerFrame(!1),k&&(this.fire(new a.z("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const F=this._calculateSpeedIndex();this.fire(new a.z("speedindexcompleted",{speedIndex:F})),this.speedIndexTiming=!1}k&&this.style&&this.style.handleIdle()}}!this._loaded||this._fullyLoaded||I||(this._fullyLoaded=!0,C.mark(E.fullLoad),this._performanceMetricsCollection&&Rt(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(p){for(const o of this._markers)p&&!this.getRenderWorldCopies()&&(o._lngLat=o._lngLat.wrap()),o._update();for(const o of this._popups)!p||this.getRenderWorldCopies()||o._trackPointer||(o._lngLat=o._lngLat.wrap()),o._update()}_updateAverageElevation(p,o=!1){const d=b=>(this.transform.averageElevation=b,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return this.transform.averageElevation!==0&&d(0);const _=this.transform.elevation&&this.transform.elevation.exaggeration()!==this._averageElevationExaggeration;if(_||(o||p-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(p)){const b=this.transform.averageElevation;let S=this.transform.sampleAverageElevation();this.transform.elevation!=null&&(this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(S)?S=0:this._averageElevationLastSampledAt=p;const T=Math.abs(b-S);if(T>1){if(this._isInitialLoad||_)return this._averageElevation.jumpTo(S),d(S);this._averageElevation.easeTo(S,p,300)}else if(T>1e-4)return this._averageElevation.jumpTo(S),d(S)}return!!this._averageElevation.isEasing(p)&&d(this._averageElevation.getValue(p))}_isTokenExpired(){return this._tokenExpiration!=null&&Date.now()>this._tokenExpiration}_revokeAuth(){const p=this.painter.context.gl;Lt(p,!1),this._logoControl instanceof Lw&&this._logoControl._updateLogo(),p&&p.clear(p.DEPTH_BUFFER_BIT|p.COLOR_BUFFER_BIT|p.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new a.y(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}_authenticate(){nn(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,p=>{p&&(p.message!==sn&&p.status!==401||this._revokeAuth())}),this._isTokenExpired()&&this._revokeAuth(),Be(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_postStyleLoadEvent(){this.style.globalId&&mt(this._requestManager._customAccessToken,{map:this,style:this.style.globalId,importedStyles:this.style.getImportGlobalIds()})}_postStyleWithAppearanceEvent(){this.style.globalId&&this.style.hasAppearances()&&Vt(this._requestManager._customAccessToken)}_postAddingAppearancesToStyleEvent(){Ve(this._requestManager._customAccessToken)}_updateTerrain(){const p=this._isDragging();this.painter.updateTerrain(this.style,p)}_calculateSpeedIndex(){const p=this.painter.canvasCopy(),o=this.painter.getCanvasCopiesAndTimestamps();o.timeStamps.push(performance.now());const d=this.painter.context.gl,_=d.createFramebuffer();function b(S){d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_2D,S,0);const T=new Uint8Array(d.drawingBufferWidth*d.drawingBufferHeight*4);return d.readPixels(0,0,d.drawingBufferWidth,d.drawingBufferHeight,d.RGBA,d.UNSIGNED_BYTE,T),T}return d.bindFramebuffer(d.FRAMEBUFFER,_),this._canvasPixelComparison(b(p),o.canvasCopies.map(b),o.timeStamps)}_canvasPixelComparison(p,o,d){let _=d[1]-d[0];const b=p.length/4;for(let S=0;S<o.length;S++){const T=o[S];let I=0;for(let k=0;k<T.length;k+=4)T[k]===p[k]&&T[k+1]===p[k+1]&&T[k+2]===p[k+2]&&T[k+3]===p[k+3]&&(I+=1);_+=(d[S+2]-d[S+1])*(1-I/b)}return _}remove(){if(this._removed)return;this._hash&&this._hash.remove();for(const o of this._controls)o.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this._domRenderTaskQueue.clear(),this.style&&this.style.destroy(),this.painter.destroy(),this.handlers&&this.handlers.destroy(),this.handlers=void 0,this.setStyle(null),window.removeEventListener("resize",this._onWindowResize,!1),window.removeEventListener("orientationchange",this._onWindowResize,!1),window.removeEventListener(this._fullscreenchangeEvent,this._onWindowResize,!1),window.removeEventListener("online",this._onWindowOnline,!1),window.removeEventListener("visibilitychange",this._onVisibilityChange,!1);const p=this.painter.context.gl.getExtension("WEBGL_lose_context");p&&p.loseContext(),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._missingCSSCanary.remove(),this._canvas=void 0,this._canvasContainer=void 0,this._controlContainer=void 0,this._missingCSSCanary=void 0,this._container.classList.remove("mapboxgl-map"),this._container.removeEventListener("scroll",this._onMapScroll,!1),st.delete(this.painter.context.gl),Ut.remove(),Bn.remove(),this._removed=!0,this.fire(new a.z("remove"))}triggerRepaint(){this._triggerFrame(!0)}_triggerFrame(p){this._renderNextFrame=this._renderNextFrame||p,this.style&&!this._frame&&(this._frame=a.o.frame(o=>{const d=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,d&&this._render(o)}))}_preloadTiles(p){const o=this.style?this.style.getSourceCaches():[];return a.ao(o,(d,_)=>d._preloadTiles(p,_),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(p){this._trackResize&&this.resize({originalEvent:p})._update()}_onVisibilityChange(){document.visibilityState==="hidden"&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(p){this._showTileBoundaries!==p&&(this._showTileBoundaries=p,this._update())}get showParseStatus(){return!!this._showParseStatus}set showParseStatus(p){this._showParseStatus!==p&&(this._showParseStatus=p,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(p){this._showTerrainWireframe!==p&&(this._showTerrainWireframe=p,this._update())}get showLayers2DWireframe(){return!!this._showLayers2DWireframe}set showLayers2DWireframe(p){this._showLayers2DWireframe!==p&&(this._showLayers2DWireframe=p,this._update())}get showLayers3DWireframe(){return!!this._showLayers3DWireframe}set showLayers3DWireframe(p){this._showLayers3DWireframe!==p&&(this._showLayers3DWireframe=p,this._update())}get showElevationIdDebug(){return!!this.painter&&this.painter._debugParams.showElevationIdDebug}set showElevationIdDebug(p){this.painter&&this.painter._debugParams.showElevationIdDebug!==p&&
3305(this.painter._debugParams.showElevationIdDebug=p,this.style&&p?this.style._reloadSources():this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(p){this._speedIndexTiming!==p&&(this._speedIndexTiming=p,this._update())}get showPadding(){return!!this._showPadding}set showPadding(p){this._showPadding!==p&&(this._showPadding=p,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(p){this._showCollisionBoxes!==p&&(this._showCollisionBoxes=p,this.style&&p?this.style._reloadSources():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(p){this._showOverdrawInspector!==p&&(this._showOverdrawInspector=p,this._update())}get repaint(){return!!this._repaint}set repaint(p){this._repaint!==p&&(this._repaint=p,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(p){this._vertices=p,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(p){this._showTileAABBs!==p&&(this._showTileAABBs=p,p&&this._update())}_setCacheLimits(p,o){a.f1(p,o)}get version(){return y}},NavigationControl:class{constructor(p={}){this.options=Object.assign({},H2,p),this._container=$("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",o=>o.preventDefault()),this.options.showZoom&&(a.b0(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",o=>{this._map&&this._map.zoomIn({},{originalEvent:o})}),$("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",o=>{this._map&&this._map.zoomOut({},{originalEvent:o})}),$("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(a.b0(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",o=>{const d=this._map;d&&(this.options.visualizePitch?d.resetNorthPitch({},{originalEvent:o}):d.resetNorth({},{originalEvent:o}))}),this._compassIcon=$("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const p=this._map;if(!p)return;const o=p.getZoom(),d=o===p.getMaxZoom(),_=o===p.getMinZoom();this._zoomInButton.disabled=d,this._zoomOutButton.disabled=_,this._zoomInButton.setAttribute("aria-disabled",d.toString()),this._zoomOutButton.setAttribute("aria-disabled",_.toString())}_rotateCompassArrow(){const p=this._map;if(!p)return;const o=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(p.transform.pitch*(Math.PI/180)),.5)}) rotateX(${p.transform.pitch}deg) rotateZ(${p.transform.angle*(180/Math.PI)}deg)`:`rotate(${p.transform.angle*(180/Math.PI)}deg)`;p._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=o)})}onAdd(p){return this._map=p,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),p.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&p.on("pitch",this._rotateCompassArrow),p.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new W2(p,this._compass,this.options.visualizePitch)),this._container}onRemove(){const p=this._map;p&&(this._container.remove(),this.options.showZoom&&p.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&p.off("pitch",this._rotateCompassArrow),p.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(p,o){const d=$("button",p,this._container);return d.type="button",d.addEventListener("click",o),d}_setButtonTitle(p,o){if(!this._map)return;const d=this._map._getUIString(`NavigationControl.${o}`);p.setAttribute("aria-label",d),p.firstElementChild&&p.firstElementChild.setAttribute("title",d)}},GeolocateControl:class extends a.E{constructor(p={}){super();const o=navigator.geolocation;this.options=Object.assign({geolocation:o},av,p),a.b0(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=Kg(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(p){return this._map=p,this._container=$("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){this._clearRequestTimeout(),this._geolocationWatchID!==void 0&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(p){const o=(d=!!this.options.geolocation)=>{this._supportsGeolocation=d,p(d)};this._supportsGeolocation!==void 0?p(this._supportsGeolocation):navigator.permissions!==void 0?navigator.permissions.query({name:"geolocation"}).then(d=>o(d.state!=="denied")).catch(()=>o()):o()}_isOutOfMapMaxBounds(p){const o=this._map.getMaxBounds(),d=p.coords;return!!o&&(d.longitude<o.getWest()||d.longitude>o.getEast()||d.latitude<o.getSouth()||d.latitude>o.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_E
3305RROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(p){if(this._map){if(this._clearRequestTimeout(),this._isOutOfMapMaxBounds(p))return this._setErrorState(),this.fire(new a.z("outofmaxbounds",p)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=p,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this.options.followUserLocation?(this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active")):(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"));break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(p),this.options.followUserLocation&&(!this.options.trackUserLocation||this._watchState==="ACTIVE_LOCK")&&this._updateCamera(p),this.options.showUserLocation&&this._userLocationDotMarker.removeClassName("mapboxgl-user-location-dot-stale"),this.fire(new a.z("geolocate",Object.assign({coords:p.coords,timestamp:p.timestamp},p.toJSON?{toJSON:p.toJSON.bind(p)}:{}))),this._finish()}}_updateCamera(p){const o=new a.aX(p.coords.longitude,p.coords.latitude),d=p.coords.accuracy,_=this._map.getBearing(),b=Object.assign({bearing:_},this.options.fitBoundsOptions);this._map.fitBounds(o.toBounds(d),b,{geolocateSource:!0})}_updateMarker(p){if(p){const o=new a.aX(p.coords.longitude,p.coords.latitude);this._accuracyCircleMarker.setLngLat(o).addTo(this._map),this._userLocationDotMarker.setLngLat(o).addTo(this._map),this._accuracy=p.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const p=this._map.transform,o=a.bY(1,p._center.lat)*p.worldSize,d=Math.ceil(2*this._accuracy*o);this._circleElement.style.width=`${d}px`,this._circleElement.style.height=`${d}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&typeof this._heading=="number"?(this._userLocationDotMarker.setRotation(this._heading),this._userLocationDotMarker.addClassName("mapboxgl-user-location-show-heading")):(this._userLocationDotMarker.removeClassName("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(p){if(this._map){if(this._clearRequestTimeout(),this.options.trackUserLocation)if(p.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const o=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(p.code===3&&this._noTimeout)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._userLocationDotMarker.addClassName("mapboxgl-user-location-dot-stale"),this.fire(new a.z("error",{code:p.code,message:p.message,PERMISSION_DENIED:p.PERMISSION_DENIED,POSITION_UNAVAILABLE:p.POSITION_UNAVAILABLE,TIMEOUT:p.TIMEOUT})),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_startRequestTimeout(){this._clearRequestTimeout();const p=this.options.positionOptions.timeout;p&&(this._requestTimeoutId=window.setTimeout(()=>{this._onError({code:3,message:"Geolocation request timed out"})},p))}_clearRequestTimeout(){this._requestTimeoutId!==void 0&&(clearTimeout(this._requestTimeoutId),this._requestTimeoutId=void 0)}_setupUI(p){if(this._map!==void 0){if(this._container.addEventListener("contextmenu",o=>o.preventDefault()),this._geolocateButton=$("button","mapboxgl-ctrl-geolocate",this._container),$("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",p===!1){a.w("Geolocation support is not available so the GeolocateControl will be disabled.");const o=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o)}else{const o=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","fal
3305se"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=$("div","mapboxgl-user-location"),this._dotElement.appendChild($("div","mapboxgl-user-location-dot")),this._dotElement.appendChild($("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new Yp({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=$("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Yp({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.showButton||(this._container.style.display="none"),this.options.trackUserLocation&&this._map.on("movestart",o=>{o.geolocateSource||this._watchState!=="ACTIVE_LOCK"||o.originalEvent&&o.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new a.z("trackuserlocationend")))})}}_onDeviceOrientation(p){this._userLocationDotMarker&&(p.webkitCompassHeading?this._heading=p.webkitCompassHeading:p.absolute===!0&&(this._heading=-1*p.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return a.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 a.z("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new a.z("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new a.z("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let p;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(p={maximumAge:6e5,timeout:0},this._noTimeout=!0):(p=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,p),this._startRequestTimeout(),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._startRequestTimeout(),this._timeoutId=window.setTimeout(this._finish,1e4);return!0}setFollowUserLocation(p){return this.options.followUserLocation=p??av.followUserLocation,this.options.trackUserLocation&&this._watchState!=="OFF"&&(this.options.followUserLocation?this._watchState!=="BACKGROUND"&&this._watchState!=="BACKGROUND_ERROR"||(this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new a.z("trackuserlocationstart"))):this._watchState!=="ACTIVE_LOCK"&&this._watchState!=="ACTIVE_E
3305RROR"||(this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this.fire(new a.z("trackuserlocationend")))),this}_addDeviceOrientationListener(){const p=()=>{const o="ondeviceorientationabsolute"in window?"deviceorientationabsolute":"deviceorientation";window.addEventListener(o,this._onDeviceOrientation)};typeof DeviceOrientationEvent.requestPermission=="function"?DeviceOrientationEvent.requestPermission().then(o=>{o==="granted"&&p()}).catch(console.error):p()}_clearWatch(){this._clearRequestTimeout(),this.options.geolocation.clearWatch(this._geolocationWatchID),window.removeEventListener("deviceorientation",this._onDeviceOrientation),window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:Mw,ScaleControl:class{constructor(p={}){this.options=Object.assign({},q2,p),a.b0(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const p=this.options.maxWidth||100,o=this._map,d=o._containerHeight/2,_=o._containerWidth/2-p/2,b=o.unproject([_,d]),S=o.unproject([_+p,d]),T=b.distanceTo(S);if(this.options.unit==="imperial"){const I=3.2808*T;I>5280?this._setScale(p,I/5280,"mile"):this._setScale(p,I,"foot")}else this.options.unit==="nautical"?this._setScale(p,T/1852,"nautical-mile"):T>=1e3?this._setScale(p,T/1e3,"kilometer"):this._setScale(p,T,"meter")}_setScale(p,o,d){this._map._requestDomTask(()=>{const _=(function(S){const T=Math.pow(10,`${Math.floor(S)}`.length-1);let I=S/T;return I=I>=10?10:I>=5?5:I>=3?3:I>=2?2:I>=1?1:(function(k){const F=Math.pow(10,Math.ceil(-Math.log(k)/Math.LN10));return Math.round(k*F)/F})(I),T*I})(o),b=_/o;this._container.innerHTML=d!=="nautical-mile"?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:d}).format(_):`${_} ${zw[d]}`,this._container.style.width=p*b+"px"})}onAdd(p){return this._map=p,this._language=p.getLanguage(),this._container=$("div","mapboxgl-ctrl mapboxgl-ctrl-scale",p.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(p){this._language=p,this._update()}setUnit(p){this.options.unit=p,this._update()}},FullscreenControl:class{constructor(p={}){this._fullscreen=!1,p&&p.container&&(p.container instanceof HTMLElement?this._container=p.container:a.w("Full screen control 'container' must be a DOM element.")),a.b0(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(p){return this._map=p,this._container||(this._container=this._map.getContainer()),this._controlContainer=$("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",a.w("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!document.fullscreenEnabled&&!document.webkitFullscreenEnabled)}_setupUI(){const p=this._fullscreenButton=$("button","mapboxgl-ctrl-fullscreen",this._controlContainer);$("span","mapboxgl-ctrl-icon",p).setAttribute("aria-hidden","true"),p.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const p=this._getTitle();this._fullscreenButton.setAttribute("aria-label",p),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",p)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(document.fullscreenElement||document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?document.exitFullscreen?document.exitFullscreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},IndoorControl:class{constructor(){a.b0(["_onIndoorUpdate","_onStyleData","_scrollUp","_scrollDown","_toggleIndoor"],this),this._visibleFloorStart=0,this._lastSelectedFloorId=null}onAdd(p){return this._map=p,this._container=$("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.style.display="none",this._map.on("styledata",this._onStyleData),this._updateConnection(),this._container}_onStyleData(){this._updateConnection()}_updateConnection(){if(this._map&&this._map.style&&this._map.style.indoorManager){const p=this._map.style.indoorManager;p.off("selector-update",this._onIndoorUpdate),p.on("selector-update",this._onIndoorUpdate),this._onIndoorUpdate(p.getControlState())}}_createButton(p,o){const d=$("button",p,this._container);return d.type="button",d.addEventListener("click",o),d}_setButtonTitle(p,o){p.setAttribute("aria-label",o),p.textContent=o}onRemove(){this._container&&this._container.remove(),this._map&&(this._map.off("styledata",this._onStyleData),this._map.style&&this._map.style.indoorManager.off("selector-update",this._onIndoorUpdate),this._map=null)}getDefaultPosition(){return"top-right"}
vendor: 6,649 bytes, line 3305
3305_onIndoorUpdate(p){if(!p||!p.floors||p.floors.length===0)return this._model=p,void(this._container.style.display="none");const o=this._model;this._model=p,this._container.style.display="inline-block";const d=!o||o.floors.length!==p.floors.length||o.floors.some((_,b)=>_.id!==p.floors[b].id);if(d&&(this._visibleFloorStart=0,this._lastSelectedFloorId=null),p.selectedFloorId){if(p.selectedFloorId!==this._lastSelectedFloorId||d){const _=p.floors.findIndex(b=>b.id===p.selectedFloorId);if(_!==-1){const b=p.floors.length;let S,T;b<=5?(S=0,T=b-1):this._visibleFloorStart===0?(S=0,T=3):this._visibleFloorStart>=b-3?(S=b-3-1,T=b-1):(S=this._visibleFloorStart,T=this._visibleFloorStart+3-1),_<S?this._visibleFloorStart=_:_>T&&(this._visibleFloorStart=_-2)}}this._lastSelectedFloorId=p.selectedFloorId}this._render()}_render(){if(!this._container||!this._model||!this._model.floors)return;this._container.innerHTML="";const p=this._createButton("mapboxgl-ctrl-indoor-toggle",this._toggleIndoor);$("span","mapboxgl-ctrl-icon",p).setAttribute("aria-hidden","true"),this._model.activeFloorsVisible||p.classList.add("mapboxgl-ctrl-level-button-selected"),this._container.appendChild(p);const o=this._model.floors,d=o.length;if(d<=5)return void o.forEach(T=>this._createFloorButton(T));const _=this._visibleFloorStart===0,b=this._visibleFloorStart>=d-3;if(_)this._createFloorButton(o[0]);else{const T=this._createButton("mapboxgl-ctrl-arrow-up",this._scrollUp);$("span","mapboxgl-ctrl-icon",T).setAttribute("aria-hidden","true"),this._container.appendChild(T)}let S=[];if(S=_?o.slice(1,4):b?o.slice(this._visibleFloorStart-1,this._visibleFloorStart+3-1):o.slice(this._visibleFloorStart,this._visibleFloorStart+3),S.forEach(T=>this._createFloorButton(T)),b)this._createFloorButton(o[d-1]);else{const T=this._createButton("mapboxgl-ctrl-arrow-down",this._scrollDown);$("span","mapboxgl-ctrl-icon",T).setAttribute("aria-hidden","true"),this._container.appendChild(T)}}_createFloorButton(p){const o=this._createButton("mapboxgl-ctrl-level-button",()=>{const S=p.id;this._model&&this._model.selectedFloorId===S&&this._model.activeFloorsVisible||this._map&&(this._model&&!this._model.activeFloorsVisible&&this._map.style&&this._map.style.indoorManager&&this._map.style.indoorManager.setActiveFloorsVisibility(!0),this._map._selectIndoorFloor(S))}),d=(p.name||"").trim(),_=p.zIndex.toString(),b=d?Array.from(d).slice(0,3).join(""):_;this._setButtonTitle(o,b),this._model&&this._model.activeFloorsVisible&&p.id===this._model.selectedFloorId&&o.classList.add("mapboxgl-ctrl-level-button-selected"),this._container&&this._container.appendChild(o)}_toggleIndoor(){this._map&&this._map.style&&this._map.style.indoorManager&&this._model&&this._model.activeFloorsVisible&&this._map.style.indoorManager.setActiveFloorsVisibility(!1)}_scrollUp(){if(this._visibleFloorStart>0){this._visibleFloorStart--,this._visibleFloorStart===1&&(this._visibleFloorStart=0);const p=this._model&&this._model.floors||[];if(p.length>3){const o=p.length-3;this._visibleFloorStart===o-1&&(this._visibleFloorStart=o-2)}this._render()}}_scrollDown(){if(this._model&&this._model.floors){const p=this._model.floors.length-3;this._visibleFloorStart<p&&(this._visibleFloorStart++,this._visibleFloorStart===1&&(this._visibleFloorStart=2),this._visibleFloorStart===p-1&&(this._visibleFloorStart=p),this._visibleFloorStart>p&&(this._visibleFloorStart=p),this._render())}}},Popup:class extends a.E{constructor(p){super(),this.options=Object.assign(Object.create(lv),p),this._altitude=this.options.altitude,a.b0(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(p&&p.className?p.className.trim().split(Nw):[])}addTo(p){return this._map&&this.remove(),this._map=p,this.options.closeOnClick&&p.on("preclick",this._onClose),this.options.closeOnMove&&p.on("move",this._onClose),p.on("remove",this.remove),this._update(),p._addPopup(this),this._focusFirstElement(),this._trackPointer?(p.on("mousemove",this._onMouseEvent),p.on("mouseup",this._onMouseEvent),p._canvasContainer.classList.add("mapboxgl-track-pointer")):p.on("move",this._update),this.fire(new a.z("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const p=this._map;return p&&(p.off("move",this._update),p.off("move",this._onClose),p.off("preclick",this._onClose),p.off("click",this._onClose),p.off("remove",this.remove),p.off("mousemove",this._onMouseEvent),p.off("mouseup",this._onMouseEvent),p.off("drag",this._onMouseEvent),p._canvasContainer&&p._canvasContainer.classList.remove("mapboxgl-track-pointer"),p._removePopup(this),this._map=void 0),this.fire(new a.z("close")),this}getLngLat(){return this._lngLat}setLngLat(p){this._lngLat=a.aX.convert(p),this._pos=null,this._trackPointer=!1,this._update();const o=this._map;return o&&(o.on("move",this._update),o.off("mousemove",this._onMouseEvent),o._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}getAltitude(){return this._altitude}setAltitude(p){return this._altitude=p,this._update(),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const p=this._map;return p&&(p.off("move",this._update),p.on("mousemove",this._onMouseEvent),p.on("drag",this._onMouseEvent),p._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(p){return this.setDOMContent(document.createTextNode(p))}setHTML(p){const o=document.createDocumentFragment(),d=document.createElement("body");let _;for(d.innerHTML=p;_=d.firstChild,_;)o.appendChild(_);return this.setDOMContent(o)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(p){return this.options.maxWidth=p,this._update(),this}setDOMContent(p){let o=this._content;if(o)for(;o.hasChildNodes();)o.firstChild&&o.removeChild(o.firstChild);else o=this._content=$("div","mapboxgl-popup-content",this._container||void 0);if(o.appendChild(p),this.options.closeButton){const d=this._closeButton=$("button","mapboxgl-popup-close-button",o);d.type="button",d.setAttribute("aria-label","Close popup"),d.innerHTML='<span aria-hidden="true">×</span>',d.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(p){return this._classList.add(p),this._updateClassList(),this}removeClassName(p){return this._classList.delete(p),this._updateClassList(),this}setOffset(p){return this.options.offset=p,this._update(),this}toggleClassName(p){let o;return this._classList.delete(p)?o=!1:(this._classList.add(p),o=!0),this._updateClassList(),o}_onMouseEvent(p){this._update(p.point)}
3305_getAnchor(p){if(this.options.anchor)return this.options.anchor;const o=this._map,d=this._container,_=this._pos;if(!o||!d||!_)return"bottom";const b=d.offsetWidth,S=d.offsetHeight,T=_.x<b/2,I=_.x>o.transform.width-b/2;if(_.y+p<S)return T?"top-left":I?"top-right":"top";if(_.y>o.transform.height-S){if(T)return"bottom-left";if(I)return"bottom-right"}return T?"left":I?"right":"bottom"}_updateClassList(){const p=this._container;if(!p)return;const o=[...this._classList];o.push("mapboxgl-popup"),this._anchor&&o.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&o.push("mapboxgl-popup-track-pointer"),p.className=o.join(" ")}_update(p){const o=this._map,d=this._content;if(!o||!this._lngLat&&!this._trackPointer||!d)return;let _=this._container;if(_||(_=this._container=$("div","mapboxgl-popup",o.getContainer()),this._tip=$("div","mapboxgl-popup-tip",_),_.appendChild(d)),this.options.maxWidth&&_.style.maxWidth!==this.options.maxWidth&&(_.style.maxWidth=this.options.maxWidth),o.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=nc(this._lngLat,this._pos,o.transform)),!this._trackPointer||p){const b=this._pos=this._trackPointer&&p instanceof a.P?p:o.project(this._lngLat,this._altitude),S=cv(this.options.offset),T=this._anchor=this._getAnchor(S.y),I=cv(this.options.offset,T),k=b.add(I).round();o._requestDomTask(()=>{this._container&&T&&(this._container.style.transform=`${ov[T]} translate(${k.x}px,${k.y}px)`)})}if(!this._marker&&o._showingGlobe()){const b=a.f2(o.transform,this._lngLat)?0:1;this._setOpacity(b)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const p=this._container.querySelector(pi);p&&p.focus()}_onClose(){this.remove()}_setOpacity(p){this._container&&(this._container.style.opacity=`${p}`),this._content&&(this._content.style.pointerEvents=p?"auto":"none")}},Marker:Yp,Style:ta,LngLat:a.aX,LngLatBounds:a.aI,Point:a.P,MercatorCoordinate:a.ad,FreeCameraOptions:Zy,Evented:a.E,config:a.g,prewarm:function(){Dh().acquire(eg)},clearPrewarmedResources:function(){const p=bu;p&&(p.isPreloaded()&&p.numActive()===1?(p.release(eg),bu=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()"))},get accessToken(){return a.g.ACCESS_TOKEN},set accessToken(p){a.g.ACCESS_TOKEN=p},get baseApiUrl(){return a.g.API_URL},set baseApiUrl(p){a.g.API_URL=p},get workerCount(){return yu.workerCount},set workerCount(p){yu.workerCount=p},get maxParallelImageRequests(){return a.g.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(p){a.g.MAX_PARALLEL_IMAGE_REQUESTS=p},clearStorage(p){a.fb(p)},get workerUrl(){return ea.workerUrl},set workerUrl(p){ea.workerUrl=p},get workerClass(){return ea.workerClass},set workerClass(p){ea.workerClass=p},get workerParams(){return ea.workerParams},set workerParams(p){ea.workerParams=p},get dracoUrl(){return a.fa()},set dracoUrl(p){a.g.DRACO_URL=a.o.resolveURL(p)},get meshoptUrl(){return a.f9()},set meshoptUrl(p){const o=a.o.resolveURL(p);a.g.MESHOPT_URL=o,a.g.MESHOPT_SIMD_URL=o},get buildingGenUrl(){return a.f8()},set buildingGenUrl(p){a.g.BUILDING_GEN_URL=a.o.resolveURL(p)},setNow:a.o.setNow,restoreNow:a.o.restoreNow}});var m=c;return m}))})(GT)),GT.exports}var Eie=Tie();const XI=Iy(Eie),il={CANVAS:"mapboxgl-canvas",CONTROL_BASE:"mapboxgl-ctrl",CONTROL_PREFIX:"mapboxgl-ctrl-",CONTROL_BUTTON:"mapbox-gl-draw_ctrl-draw-btn",CONTROL_BUTTON_LINE:"mapbox-gl-draw_line",CONTROL_BUTTON_POLYGON:"mapbox-gl-draw_polygon",CONTROL_BUTTON_POINT:"mapbox-gl-draw_point",CONTROL_BUTTON_TRASH:"mapbox-gl-draw_trash",CONTROL_BUTTON_COMBINE_FEATURES:"mapbox-gl-draw_combine",CONTROL_BUTTON_UNCOMBINE_FEATURES:"mapbox-gl-draw_uncombine",CONTROL_GROUP:"mapboxgl-ctrl-group",ATTRIBUTION:"mapboxgl-ctrl-attrib",ACTIVE_BUTTON:"active",BOX_SELECT:"mapbox-gl-draw_boxselect"},pc={HOT:"mapbox-gl-draw-hot",COLD:"mapbox-gl-draw-cold"},Po={ADD:"add",MOVE:"move",DRAG:"drag",POINTER:"pointer",NONE:"none"},sl={POLYGON:"polygon",LINE:"line_string",POINT:"point"},pr={FEATURE:"Feature",POLYGON:"Polygon",LINE_STRING:"LineString",POINT:"Point",FEATURE_COLLECTION:"FeatureCollection",MULTI_PREFIX:"Multi",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon"},ui={DRAW_LINE_STRING:"draw_line_string",DRAW_POLYGON:"draw_polygon",DRAW_POINT:"draw_point",SIMPLE_SELECT:"simple_select",DIRECT_SELECT:"direct_select"}
3305,Va={CREATE:"draw.create",DELETE:"draw.delete",UPDATE:"draw.update",SELECTION_CHANGE:"draw.selectionchange",MODE_CHANGE:"draw.modechange",ACTIONABLE:"draw.actionable",RENDER:"draw.render",COMBINE_FEATURES:"draw.combine",UNCOMBINE_FEATURES:"draw.uncombine"},Nx={MOVE:"move",CHANGE_PROPERTIES:"change_properties",CHANGE_COORDINATES:"change_coordinates"},ya={FEATURE:"feature",MIDPOINT:"midpoint",VERTEX:"vertex"},Os={ACTIVE:"true",INACTIVE:"false"},pj=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate"],Cie=-90,AR=-85,Aie=90,IR=85,Iie=-270,Pie=270,mj=Object.freeze(Object.defineProperty({__proto__:null,LAT_MAX:Aie,LAT_MIN:Cie,LAT_RENDERED_MAX:IR,LAT_RENDERED_MIN:AR,LNG_MAX:Pie,LNG_MIN:Iie,activeStates:Os,classes:il,cursors:Po,events:Va,geojsonTypes:pr,interactions:pj,meta:ya,modes:ui,sources:pc,types:sl,updateActions:Nx},Symbol.toStringTag,{value:"Module"}));function kC(e){return function(t){const n=t.featureTarget;return!n||!n.properties?!1:n.properties.meta===e}}function gj(e){return!e.originalEvent||!e.originalEvent.shiftKey?!1:e.originalEvent.button===0}function qm(e){return!e.featureTarget||!e.featureTarget.properties?!1:e.featureTarget.properties.active===Os.ACTIVE&&e.featureTarget.properties.meta===ya.FEATURE}function kM(e){return!e.featureTarget||!e.featureTarget.properties?!1:e.featureTarget.properties.active===Os.INACTIVE&&e.featureTarget.properties.meta===ya.FEATURE}function MC(e){return e.featureTarget===void 0}function MM(e){return!e.featureTarget||!e.featureTarget.properties?!1:e.featureTarget.properties.meta===ya.FEATURE}function Vx(e){const t=e.featureTarget;return!t||!t.properties?!1:t.properties.meta===ya.VERTEX}function RE(e){return e.originalEvent?e.originalEvent.shiftKey===!0:!1}function LC(e){return e.key==="Escape"||e.keyCode===27}function OC(e){return e.key==="Enter"||e.keyCode===13}function PR(e){return e.key==="Backspace"||e.keyCode===8}function RR(e){return e.key==="Delete"||e.keyCode===46}function _j(e){return e.key==="1"||e.keyCode===49}function yj(e){return e.key==="2"||e.keyCode===50}function vj(e){return e.key==="3"||e.keyCode===51}function bj(e){const t=e.key||String.fromCharCode(e.keyCode);return t>="0"&&t<="9"}function Rie(){return!0}const kie=Object.freeze(Object.defineProperty({__proto__:null,isActiveFeature:qm,isBackspaceKey:PR,isDeleteKey:RR,isDigit1Key:_j,isDigit2Key:yj,isDigit3Key:vj,isDigitKey:bj,isEnterKey:OC,isEscapeKey:LC,isFeature:MM,isInactiveFeature:kM,isOfMetaType:kC,isShiftDown:RE,isShiftMousedown:gj,isTrue:Rie,isVertex:Vx,noTarget:MC},Symbol.toStringTag,{value:"Module"}));var lT={},nb={},Oz;function Mie(){return Oz||(Oz=1,nb.RADIUS=6378137,nb.FLATTENING=1/298.257223563,nb.POLAR_RADIUS=63567523142e-4),nb}var Dz;function Lie(){if(Dz)return lT;Dz=1;var e=Mie();lT.geometry=t,lT.ring=i;function t(h){var m=0,a;switch(h.type){case"Polygon":return n(h.coordinates);case"MultiPolygon":for(a=0;a<h.coordinates.length;a++)m+=n(h.coordinates[a]);return m;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(a=0;a<h.geometries.length;a++)m+=t(h.geometries[a]);return m}}function n(h){var m=0;if(h&&h.length>0){m+=Math.abs(i(h[0]));for(var a=1;a<h.length;a++)m-=Math.abs(i(h[a]))}return m}function i(h){var m,a,y,E,C,P,L,D=0,V=h.length;if(V>2){for(L=0;L<V;L++)L===V-2?(E=V-2,C=V-1,P=0):L===V-1?(E=V-1,C=0,P=1):(E=L,C=L+1,P=L+2),m=h[E],a=h[C],y=h[P],D+=(c(y[0])-c(m[0]))*Math.sin(c(a[1]));D=D*e.RADIUS*e.RADIUS/2}return D}function c(h){return h*Math.PI/180}return lT}var Oie=Lie();const Die=Iy(Oie),Fz={Point:0,LineString:1,MultiLineString:1,Polygon:2};function Fie(e,t){const n=Fz[e.geometry.type]-Fz[t.geometry.type];return n===0&&e.geometry.type===pr.POLYGON?e.area-t.area:n}function xj(e){return e.map(t=>(t.geometry.type===pr.POLYGON&&(t.area=Die.geometry({type:pr.FEATURE,property:{},geometry:t.geometry})),t)).sort(Fie).map(t=>(delete t.area,t))}function wj(e,t=0){return[[e.point.x-t,e.point.y-t],[e.point.x+t,e.point.y+t]]}function gc(e){if(this._items={},this._nums={},this._length=e?e.length:0,!!e)for(let t=0,n=e.length;t<n;
3305t++)this.add(e[t]),e[t]!==void 0&&(typeof e[t]=="string"?this._items[e[t]]=t:this._nums[e[t]]=t)}gc.prototype.add=function(e){return this.has(e)?this:(this._length++,typeof e=="string"?this._items[e]=this._length:this._nums[e]=this._length,this)};gc.prototype.delete=function(e){return this.has(e)===!1?this:(this._length--,delete this._items[e],delete this._nums[e],this)};gc.prototype.has=function(e){return typeof e!="string"&&typeof e!="number"?!1:this._items[e]!==void 0||this._nums[e]!==void 0};gc.prototype.values=function(){const e=[];return Object.keys(this._items).forEach(t=>{e.push({k:t,v:this._items[t]})}),Object.keys(this._nums).forEach(t=>{e.push({k:JSON.parse(t),v:this._nums[t]})}),e.sort((t,n)=>t.v-n.v).map(t=>t.k)};gc.prototype.clear=function(){return this._length=0,this._items={},this._nums={},this};const Bie=[ya.FEATURE,ya.MIDPOINT,ya.VERTEX],hy={click:zie,touch:Nie};function zie(e,t,n){return Sj(e,t,n,n.options.clickBuffer)}function Nie(e,t,n){return Sj(e,t,n,n.options.touchBuffer)}function Sj(e,t,n,i){if(n.map===null)return[];const c=e?wj(e,i):t,h={};n.options.styles&&(h.layers=n.options.styles.map(E=>E.id).filter(E=>n.map.getLayer(E)!=null));const m=n.map.queryRenderedFeatures(c,h).filter(E=>Bie.indexOf(E.properties.meta)!==-1),a=new gc,y=[];return m.forEach(E=>{const C=E.properties.id;a.has(C)||(a.add(C),y.push(E))}),xj(y)}function HT(e,t){const n=hy.click(e,null,t),i={mouse:Po.NONE};return n[0]&&(i.mouse=n[0].properties.active===Os.ACTIVE?Po.MOVE:Po.POINTER,i.feature=n[0].properties.meta),t.events.currentModeName().indexOf("draw")!==-1&&(i.mouse=Po.ADD),t.ui.queueMapClasses(i),t.ui.updateMapClasses(),n[0]}function LM(e,t){const n=e.x-t.x,i=e.y-t.y;return Math.sqrt(n*n+i*i)}const Vie=4,Uie=12,$ie=500;function kR(e,t,n={}){const i=n.fineTolerance!=null?n.fineTolerance:Vie,c=n.grossTolerance!=null?n.grossTolerance:Uie,h=n.interval!=null?n.interval:$ie;e.point=e.point||t.point,e.time=e.time||t.time;const m=LM(e.point,t.point);return m<i||m<c&&t.time-e.time<h}const jie=25,Gie=250;function MR(e,t,n={}){const i=n.tolerance!=null?n.tolerance:jie,c=n.interval!=null?n.interval:Gie;return e.point=e.point||t.point,e.time=e.time||t.time,LM(e.point,t.point)<i&&t.time-e.time<c}const LR=function(e,t){const n={drag:[],click:[],mousemove:[],mousedown:[],mouseup:[],mouseout:[],keydown:[],keyup:[],touchstart:[],touchmove:[],touchend:[],tap:[]},i={on(h,m,a){if(n[h]===void 0)throw new Error(`Invalid event type: ${h}`);n[h].push({selector:m,fn:a})},render(h){t.store.featureChanged(h)}},c=function(h,m){const a=n[h];let y=a.length;for(;y--;){const E=a[y];if(E.selector(m)){E.fn.call(i,m)||t.store.render(),t.ui.updateMapClasses();break}}};return e.start.call(i),{render:e.render,stop(){e.stop&&e.stop()},trash(){e.trash&&(e.trash(),t.store.render())},combineFeatures(){e.combineFeatures&&e.combineFeatures()},uncombineFeatures(){e.uncombineFeatures&&e.uncombineFeatures()},drag(h){c("drag",h)},click(h){c("click",h)},mousemove(h){c("mousemove",h)},mousedown(h){c("mousedown",h)},mouseup(h){c("mouseup",h)},mouseout(h){c("mouseout",h)},keydown(h){c("keydown",h)},keyup(h){c("keyup",h)},touchstart(h){c("touchstart",h)},touchmove(h){c("touchmove",h)},touchend(h){c("touchend",h)},tap(h){c("tap",h)}}};let Hie=(e,t=21)=>(n=t)=>{let i="",c=n|0;for(;c--;)i+=e[Math.random()*e.length|0];return i};const Wie=Hie("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",32);function OM(){return Wie()}const Ua=function(e,t){this.ctx=e,this.properties=t.properties||{},this.coordinates=t.geometry.coordinates,this.id=t.id||OM(),this.type=t.geometry.type};Ua.prototype.changed=function(){this.ctx.store.featureChanged(this.id)};Ua.prototype.incomingCoords=function(e){this.setCoordinates(e)};Ua.prototype.setCoordinates=function(e){this.coordinates=e,this.changed()};Ua.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.coordinates))};Ua.prototype.setProperty=function(e,t){this.properties[e]=t};Ua.prototype.toGeoJSON=function(){return JSON.parse(JSON.stringify({id:this.id,type:pr.FEATURE,properties:this.properties,geometry:{coordinates:this.getCoordinates(),type:this.t
3305ype}}))};Ua.prototype.internal=function(e){const t={id:this.id,meta:ya.FEATURE,"meta:type":this.type,active:Os.INACTIVE,mode:e};if(this.ctx.options.userProperties)for(const n in this.properties)t[`user_${n}`]=this.properties[n];return{type:pr.FEATURE,properties:t,geometry:{coordinates:this.getCoordinates(),type:this.type}}};const np=function(e,t){Ua.call(this,e,t)};np.prototype=Object.create(Ua.prototype);np.prototype.isValid=function(){return typeof this.coordinates[0]=="number"&&typeof this.coordinates[1]=="number"};np.prototype.updateCoordinate=function(e,t,n){arguments.length===3?this.coordinates=[t,n]:this.coordinates=[e,t],this.changed()};np.prototype.getCoordinate=function(){return this.getCoordinates()};const cd=function(e,t){Ua.call(this,e,t)};cd.prototype=Object.create(Ua.prototype);cd.prototype.isValid=function(){return this.coordinates.length>1};cd.prototype.addCoordinate=function(e,t,n){this.changed();const i=parseInt(e,10);this.coordinates.splice(i,0,[t,n])};cd.prototype.getCoordinate=function(e){const t=parseInt(e,10);return JSON.parse(JSON.stringify(this.coordinates[t]))};cd.prototype.removeCoordinate=function(e){this.changed(),this.coordinates.splice(parseInt(e,10),1)};cd.prototype.updateCoordinate=function(e,t,n){const i=parseInt(e,10);this.coordinates[i]=[t,n],this.changed()};const Bl=function(e,t){Ua.call(this,e,t),this.coordinates=this.coordinates.map(n=>n.slice(0,-1))};Bl.prototype=Object.create(Ua.prototype);Bl.prototype.isValid=function(){return this.coordinates.length===0?!1:this.coordinates.every(e=>e.length>2)};Bl.prototype.incomingCoords=function(e){this.coordinates=e.map(t=>t.slice(0,-1)),this.changed()};Bl.prototype.setCoordinates=function(e){this.coordinates=e,this.changed()};Bl.prototype.addCoordinate=function(e,t,n){this.changed();const i=e.split(".").map(h=>parseInt(h,10));this.coordinates[i[0]].splice(i[1],0,[t,n])};Bl.prototype.removeCoordinate=function(e){this.changed();const t=e.split(".").map(i=>parseInt(i,10)),n=this.coordinates[t[0]];n&&(n.splice(t[1],1),n.length<3&&this.coordinates.splice(t[0],1))};Bl.prototype.getCoordinate=function(e){const t=e.split(".").map(i=>parseInt(i,10)),n=this.coordinates[t[0]];return JSON.parse(JSON.stringify(n[t[1]]))};Bl.prototype.getCoordinates=function(){return this.coordinates.map(e=>e.concat([e[0]]))};Bl.prototype.updateCoordinate=function(e,t,n){this.changed();const i=e.split("."),c=parseInt(i[0],10),h=parseInt(i[1],10);this.coordinates[c]===void 0&&(this.coordinates[c]=[]),this.coordinates[c][h]=[t,n]};const qie={MultiPoint:np,MultiLineString:cd,MultiPolygon:Bl},DC=(e,t,n,i,c)=>{const h=n.split("."),m=parseInt(h[0],10),a=h[1]?h.slice(1).join("."):null;return e[m][t](a,i,c)},Na=function(e,t){if(Ua.call(this,e,t),delete this.coordinates,this.model=qie[t.geometry.type],this.model===void 0)throw new TypeError(`${t.geometry.type} is not a valid type`);this.features=this._coordinatesToFeatures(t.geometry.coordinates)};Na.prototype=Object.create(Ua.prototype);Na.prototype._coordinatesToFeatures=function(e){const t=this.model.bind(this);return e.map(n=>new t(this.ctx,{id:OM(),type:pr.FEATURE,properties:{}
3305,geometry:{coordinates:n,type:this.type.replace("Multi","")}}))};Na.prototype.isValid=function(){return this.features.every(e=>e.isValid())};Na.prototype.setCoordinates=function(e){this.features=this._coordinatesToFeatures(e),this.changed()};Na.prototype.getCoordinate=function(e){return DC(this.features,"getCoordinate",e)};Na.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.features.map(e=>e.type===pr.POLYGON?e.getCoordinates():e.coordinates)))};Na.prototype.updateCoordinate=function(e,t,n){DC(this.features,"updateCoordinate",e,t,n),this.changed()};Na.prototype.addCoordinate=function(e,t,n){DC(this.features,"addCoordinate",e,t,n),this.changed()};Na.prototype.removeCoordinate=function(e){DC(this.features,"removeCoordinate",e),this.changed()};Na.prototype.getFeatures=function(){return this.features};function Jr(e){this.map=e.map,this.drawConfig=JSON.parse(JSON.stringify(e.options||{})),this._ctx=e}Jr.prototype.setSelected=function(e){return this._ctx.store.setSelected(e)};Jr.prototype.setSelectedCoordinates=function(e){this._ctx.store.setSelectedCoordinates(e),e.reduce((t,n)=>(t[n.feature_id]===void 0&&(t[n.feature_id]=!0,this._ctx.store.get(n.feature_id).changed()),t),{})};Jr.prototype.getSelected=function(){return this._ctx.store.getSelected()};Jr.prototype.getSelectedIds=function(){return this._ctx.store.getSelectedIds()};Jr.prototype.isSelected=function(e){return this._ctx.store.isSelected(e)};Jr.prototype.getFeature=function(e){return this._ctx.store.get(e)};Jr.prototype.select=function(e){return this._ctx.store.select(e)};Jr.prototype.deselect=function(e){return this._ctx.store.deselect(e)};Jr.prototype.deleteFeature=function(e,t={}){return this._ctx.store.delete(e,t)};Jr.prototype.addFeature=function(e,t={}){return this._ctx.store.add(e,t)};Jr.prototype.clearSelectedFeatures=function(){return this._ctx.store.clearSelected()};Jr.prototype.clearSelectedCoordinates=function(){return this._ctx.store.clearSelectedCoordinates()};Jr.prototype.setActionableState=function(e={}){const t={trash:e.trash||!1,combineFeatures:e.combineFeatures||!1,uncombineFeatures:e.uncombineFeatures||!1};return this._ctx.events.actionable(t)};Jr.prototype.changeMode=function(e,t={},n={}){return this._ctx.events.changeMode(e,t,n)};Jr.prototype.fire=function(e,t){return this._ctx.events.fire(e,t)};Jr.prototype.updateUIClasses=function(e){return this._ctx.ui.queueMapClasses(e)};Jr.prototype.activateUIButton=function(e){return this._ctx.ui.setActiveButton(e)};Jr.prototype.featuresAt=function(e,t,n="click"){if(n!=="click"&&n!=="touch")throw new Error("invalid buffer type");return hy[n](e,t,this._ctx)};Jr.prototype.newFeature=function(e){const t=e.geometry.type;return t===pr.POINT?new np(this._ctx,e):t===pr.LINE_STRING?new cd(this._ctx,e):t===pr.POLYGON?new Bl(this._ctx,e):new Na(this._ctx,e)};Jr.prototype.isInstanceOf=function(e,t){if(e===pr.POINT)return t instanceof np;if(e===pr.LINE_STRING)return t instanceof cd;if(e===pr.POLYGON)return t instanceof Bl;if(e==="MultiFeature")return t instanceof Na;throw new Error(`Unknown feature class: ${e}`)};Jr.prototype.doRender=function(e){return this._ctx.store.featureChanged(e)};Jr.prototype.onSetup=function(){};Jr.prototype.onDrag=function(){};Jr.prototype.onClick=function(){};Jr.prototype.onMouseMove=function(){};Jr.prototype.onMouseDown=function(){};Jr.prototype.onMouseUp=function(){};Jr.prototype.onMouseOut=function(){};Jr.prototype.onKeyUp=function(){};Jr.prototype.onKeyDown=function(){};Jr.prototype.onTouchStart=function(){};Jr.prototype.onTouchMove=function(){};Jr.prototype.onTouchEnd=function(){};Jr.prototype.onTap=function(){};Jr.prototype.onStop=function(){};Jr.prototype.onTrash=function(){};Jr.prototype.onCombineFeature=function(){};Jr.prototype.onUncombineFeature=function(){};Jr.prototype.toDisplayFeatures=function(){throw new Error("You must overwrite toDisplayFeatures")};const Tj={drag:"onDrag",click:"onClick",mousemove:"onMouseMove",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseout:"onMouseOut",keyup:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",tap:"onTap"},Xie=Object.keys(Tj);function Zie(e){const t=Object.keys(e);return function(n,i={}){let c={};const h=t.reduce((a,y)=>(a[y]=e[y],a),new Jr(n));function m(a){return y=>h[a](c,y)}return{start(){c=h.onSetup(i),Xie.forEach(a=>{const y=Tj[a];let E=()=>!1;e[y]&&(E=()=>!0),this.on(a,E,m(y))})},stop(){h.onStop(c)},trash(){h.onTrash(c)},combineFeatures(){h.onCombineFeatures(c)},uncombineFeatures(){h.onUncombineFeatures(c)},render(a,y){h.toDisplayFeatures(c,a,y)}}}}function Yie(e){const t=Object.keys(e.options.modes).reduce((L,D)=>(L[D]=Zie(e.options.modes[D]),L),{});let n={},i={};const c={};let h=null,m=null;c.drag=function(L,D){D({point:L.point,time:new Date().getTime()})?(e.ui.queueMapClasses({mouse:Po.DRAG}),m.drag(L)):L.originalEvent.stopPropagation()},c.mousedrag=function(L){c.drag(L,D=>!kR(n,D))},c.touchdrag=function(L){c.drag(L,D=>!MR(i,D))},c.mousemove=function(L){if((L.originalEvent.buttons!==void 0?L.originalEvent.buttons:L.originalEvent.which)===1)return c.mousedrag(L);const V=HT(L,e);L.featureTarget=V,m.mousemove(L)},c.mousedown=function(L){n={time:new Date().getTime(),point:L.point};const D=HT(L,e);L.featureTarget=D,m.mousedown(L)},c.mouseup=function(L){const D=HT(L,e);L.featureTarget=D,kR(n,{point:L.point,time:new Date().getTime()})?m.click(L):m.mouseup(L)},c.mouseout=function(L){m.mouseout(L)},c.touchstart=function(L){if(!e.options.touchEnabled)return;i={time:new Date().getTime(),point:L.point};const D=hy.touch(L,null,e)[0];L.featureTarget=D,m.touchstart(L)},c.touchmove=function(L){if(e.options.touchEnabled)return m.touchmove(L),c.touchdrag(L)},c.touchend=function(L){if(L.originalEvent.preventDefault(),!e.options.touchEnabled)return;const D=hy.touch(L,null,e)[0];L.featureTarget=D,MR(i,{time:new Date().getTime(),point:L.point}
3305)?m.tap(L):m.touchend(L)};const a=L=>{const D=PR(L),V=RR(L),U=bj(L);return!(D||V||U)};c.keydown=function(L){(L.srcElement||L.target).classList.contains(il.CANVAS)&&((PR(L)||RR(L))&&e.options.controls.trash?(L.preventDefault(),m.trash()):a(L)?m.keydown(L):_j(L)&&e.options.controls.point?y(ui.DRAW_POINT):yj(L)&&e.options.controls.line_string?y(ui.DRAW_LINE_STRING):vj(L)&&e.options.controls.polygon&&y(ui.DRAW_POLYGON))},c.keyup=function(L){a(L)&&m.keyup(L)},c.zoomend=function(){e.store.changeZoom()},c.data=function(L){if(L.dataType==="style"){const{setup:D,map:V,options:U,store:W}=e;U.styles.some(Y=>V.getLayer(Y.id))||(D.addLayers(),W.setDirty(),W.render())}};function y(L,D,V={}){m.stop();const U=t[L];if(U===void 0)throw new Error(`${L} is not valid`);h=L;const W=U(e,D);m=LR(W,e),V.silent||e.map.fire(Va.MODE_CHANGE,{mode:L}),e.store.setDirty(),e.store.render()}const E={trash:!1,combineFeatures:!1,uncombineFeatures:!1};function C(L){let D=!1;Object.keys(L).forEach(V=>{if(E[V]===void 0)throw new Error("Invalid action type");E[V]!==L[V]&&(D=!0),E[V]=L[V]}),D&&e.map.fire(Va.ACTIONABLE,{actions:E})}return{start(){h=e.options.defaultMode,m=LR(t[h](e),e)},changeMode:y,actionable:C,currentModeName(){return h},currentModeRender(L,D){return m.render(L,D)},fire(L,D){e.map&&e.map.fire(L,D)},addEventListeners(){e.map.on("mousemove",c.mousemove),e.map.on("mousedown",c.mousedown),e.map.on("mouseup",c.mouseup),e.map.on("data",c.data),e.map.on("touchmove",c.touchmove),e.map.on("touchstart",c.touchstart),e.map.on("touchend",c.touchend),e.container.addEventListener("mouseout",c.mouseout),e.options.keybindings&&(e.container.addEventListener("keydown",c.key
3305down),e.container.addEventListener("keyup",c.keyup))},removeEventListeners(){e.map.off("mousemove",c.mousemove),e.map.off("mousedown",c.mousedown),e.map.off("mouseup",c.mouseup),e.map.off("data",c.data),e.map.off("touchmove",c.touchmove),e.map.off("touchstart",c.touchstart),e.map.off("touchend",c.touchend),e.container.removeEventListener("mouseout",c.mouseout),e.options.keybindings&&(e.container.removeEventListener("keydown",c.keydown),e.container.removeEventListener("keyup",c.keyup))},trash(L){m.trash(L)},combineFeatures(){m.combineFeatures()},uncombineFeatures(){m.uncombineFeatures()},getMode(){return h}}}function Ux(e){return[].concat(e).filter(t=>t!==void 0)}function Kie(){const e=this;if(!(e.ctx.map&&e.ctx.map.getSource(pc.HOT)!==void 0))return y();const n=e.ctx.events.currentModeName();e.ctx.ui.queueMapClasses({mode:n});let i=[],c=[];e.isDirty?c=e.getAllIds():(i=e.getChangedIds().filter(E=>e.get(E)!==void 0),c=e.sources.hot.filter(E=>E.properties.id&&i.indexOf(E.properties.id)===-1&&e.get(E.properties.id)!==void 0).map(E=>E.properties.id)),e.sources.hot=[];const h=e.sources.cold.length;e.sources.cold=e.isDirty?[]:e.sources.cold.filter(E=>{const C=E.properties.id||E.properties.parent;return i.indexOf(C)===-1});const m=h!==e.sources.cold.length||c.length>0;i.forEach(E=>a(E,"hot")),c.forEach(E=>a(E,"cold"));function a(E,C){const L=e.get(E).internal(n);e.ctx.events.currentModeRender(L,D=>{D.properties.mode=n,e.sources[C].push(D)})}m&&e.ctx.map.getSource(pc.COLD).setData({type:pr.FEATURE_COLLECTION,features:e.sources.cold}),e.ctx.map.getSource(pc.HOT).setData({type:pr.FEATURE_COLLECTION,features:e.sources.hot}),y();function y(){e.isDirty=!1,e.clearChangedIds()}}function uo(e){this._features={},this._featureIds=new gc,this._selectedFeatureIds=new gc,this._selectedCoordinates=[],this._changedFeatureIds=new gc,this._emitSelectionChange=!1,this._mapInitialConfig={},this.ctx=e,this.sources={hot:[],cold:[]};let t;this.render=()=>{t||(t=requestAnimationFrame(()=>{t=null,Kie.call(this),this._emitSelectionChange&&(this.ctx.events.fire(Va.SELECTION_CHANGE,{features:this.getSelected().map(n=>n.toGeoJSON()),points:this.getSelectedCoordinates().map(n=>({type:pr.FEATURE,properties:{},geometry:{type:pr.POINT,coordinates:n.coordinates}}))}),this._emitSelectionChange=!1),this.ctx.events.fire(Va.RENDER,{})}))},this.isDirty=!1}uo.prototype.createRenderBatch=function(){const e=this.render;let t=0;return this.render=function(){t++},()=>{this.render=e,t>0&&this.render()}};uo.prototype.setDirty=function(){return this.isDirty=!0,this};uo.prototype.featureCreated=function(e,t={}){if(this._changedFeatureIds.add(e),(t.silent!=null?t.silent:this.ctx.options.suppressAPIEvents)!==!0){const i=this.get(e);this.ctx.events.fire(Va.CREATE,{features:[i.toGeoJSON()]})}return this};uo.prototype.featureChanged=function(e,t={}){return this._changedFeatureIds.add(e),(t.silent!=null?t.silent:this.ctx.options.suppressAPIEvents)!==!0&&this.ctx.events.fire(Va.UPDATE,{action:t.action?t.action:Nx.CHANGE_COORDINATES,features:[this.get(e).toGeoJSON()]}),this};uo.prototype.getChangedIds=function(){return this._changedFeatureIds.values()};uo.prototype.clearChangedIds=function(){return this._changedFeatureIds.clear(),this};uo.prototype.getAllIds=function(){return this._featureIds.values()};uo.prototype.add=function(e,t={}){return this._features[e.id]=e,this._featureIds.add(e.id),this.featureCreated(e.id,{silent:t.silent}),this};uo.prototype.delete=function(e,t={}){const n=[];return Ux(e).forEach(i=>{this._featureIds.has(i)&&(this._featureIds.delete(i),this._selectedFeatureIds.delete(i),t.silent||n.indexOf(this._features[i])===-1&&n.push(this._features[i].toGeoJSON()),delete this._features[i],this.isDirty=!0)}),n.length&&this.ctx.events.fire(Va.DELETE,{features:n}),Ej(this,t),this};uo.prototype.get=function(e){return this._features[e]};uo.prototype.getAll=function(){return Object.keys(this._features).map(e=>this._features[e])};uo.prototype.select=function(e,t={}){return Ux(e).forEach(n=>{this._selectedFeatureIds.has(n)||(this._selectedFeatureIds.add(n),this._changedFeatureIds.add(n),t.silent||(this._emitSelectionChange=!0))}),this};uo.prototype.deselect=function(e,t={}){return Ux(e).forEach(n=>{this._selectedFeatureIds.has(n)&&(this._selectedFeatureIds.delete(n),this._changedFeatureIds.add(n),t.silent||(this._emitSelectionChange=!0))}),Ej(this,t),this};uo.prototype.clearSelected=function(e={}){return this.deselect(this._selectedFeatureIds.values(),{silent:e.silent}),this};uo.prototype.setSelected=function(e,t={}){return e=Ux(e),this.deselect(this._selectedFeatureIds.values().filter(n=>e.indexOf(n)===-1),{silent:t.silent}),this.select(e.filter(n=>!this._selectedFeatureIds.has(n)),{silent:t.silent}),this};uo.prototype.setSelectedCoordinates=function(e){return this._selectedCoordinates=e,this._emitSelectionChange=!0,this};uo.prototype.clearSelectedCoordinates=function(){return this._selectedCoordinates=[],this._emitSelectionChange=!0,this};uo.prototype.getSelectedIds=function(){return this._selectedFeatureIds.values()};
3305uo.prototype.getSelected=function(){return this.getSelectedIds().map(e=>this.get(e))};uo.prototype.getSelectedCoordinates=function(){return this._selectedCoordinates.map(t=>({coordinates:this.get(t.feature_id).getCoordinate(t.coord_path)}))};uo.prototype.isSelected=function(e){return this._selectedFeatureIds.has(e)};uo.prototype.setFeatureProperty=function(e,t,n,i={}){this.get(e).setProperty(t,n),this.featureChanged(e,{silent:i.silent,action:Nx.CHANGE_PROPERTIES})};function Ej(e,t={}){const n=e._selectedCoordinates.filter(i=>e._selectedFeatureIds.has(i.feature_id));e._selectedCoordinates.length!==n.length&&!t.silent&&(e._emitSelectionChange=!0),e._selectedCoordinates=n}uo.prototype.storeMapConfig=function(){pj.forEach(e=>{this.ctx.map[e]&&(this._mapInitialConfig[e]=this.ctx.map[e].isEnabled())})};uo.prototype.restoreMapConfig=function(){Object.keys(this._mapInitialConfig).forEach(e=>{this._mapInitialConfig[e]?this.ctx.map[e].enable():this.ctx.map[e].disable()})};uo.prototype.getInitialConfigValue=function(e){return this._mapInitialConfig[e]!==void 0?this._mapInitialConfig[e]:!0};const Jie=["mode","feature","mouse"];function Qie(e){const t={};let n=null,i={mode:null,feature:null,mouse:null},c={mode:null,feature:null,mouse:null};function h(){m({mode:null,feature:null,mouse:null}),a()}function m(D){c=Object.assign(c,D)}function a(){if(!e.container)return;const D=[],V=[];Jie.forEach(U=>{c[U]!==i[U]&&(D.push(`${U}-${i[U]}`),c[U]!==null&&V.push(`${U}-${c[U]}`))}),D.length>0&&e.container.classList.remove(...D),V.length>0&&e.container.classList.add(...V),i=Object.assign(i,c)}function y(D,V={}){const U=document.createElement("button");return U.className=`${il.CONTROL_BUTTON} ${V.className}`,U.setAttribute("title",V.title),V.container.appendChild(U),U.addEventListener("click",W=>{if(W.preventDefault(),W.stopPropagation(),W.target===n){E(),V.onDeactivate();return}C(D),V.onActivate()},!0),U}function E(){n&&(n.classList.remove(il.ACTIVE_BUTTON),n=null)}function C(D){E();const V=t[D];V&&V&&D!=="trash"&&(V.classList.add(il.ACTIVE_BUTTON),n=V)}function P(){const D=e.options.controls,V=document.createElement("div");return V.className=`${il.CONTROL_GROUP} ${il.CONTROL_BASE}`,D&&(D[sl.POINT]&&(t[sl.POINT]=y(sl.POINT,{container:V,className:il.CONTROL_BUTTON_POINT,title:`Marker tool ${e.options.keybindings?"(1)":""}`,onActivate:()=>e.events.changeMode(ui.DRAW_POINT),onDeactivate:()=>e.events.trash()})),D[sl.LINE]&&(t[sl.LINE]=y(sl.LINE,{container:V,className:il.CONTROL_BUTTON_LINE,title:`LineString tool ${e.options.keybindings?"(2)":""}`,onActivate:()=>e.events.changeMode(ui.DRAW_LINE_STRING),onDeactivate:()=>e.events.trash()})),D[sl.POLYGON]&&(t[sl.POLYGON]=y(sl.POLYGON,{container:V,className:il.CONTROL_BUTTON_POLYGON,title:`Polygon tool ${e.options.keybindings?"(3)":""}`,onActivate:()=>e.events.changeMode(ui.DRAW_POLYGON),onDeactivate:()=>e.events.trash()})),D.trash&&(t.trash=y("trash",{container:V,className:il.CONTROL_BUTTON_TRASH,title:"Delete",onActivate:()=>{e.events.trash()}})),D.combine_features&&(t.combine_features=y("combineFeatures",{container:V,className:il.CONTROL_BUTTON_COMBINE_FEATURES,title:"Combine",onActivate:()=>{e.events.combineFeatures()}})),D.uncombine_features&&(t.uncombine_features=y("uncombineFeatures",{container:V,className:il.CONTROL_BUTTON_UNCOMBINE_FEATURES,title:"Uncombine",onActivate:()=>{e.events.uncombineFeatures()}}))),V}function L(){Object.keys(t).forEach(D=>{const V=t[D];V.parentNode&&V.parentNode.removeChild(V),delete t[D]})}return{setActiveButton:C,queueMapClasses:m,updateMapClasses:a,clearMapClasses:h,addButtons:P,removeButtons:L}}function eoe(e){let t=null,n=null;const i={onRemove(){return e.map.off("load",i.connect),clearInterval(n),i.removeLayers(),e.store.restoreMapConfig(),e.ui.removeButtons(),e.events.removeEventListeners(),e.ui.clearMapClasses(),e.boxZoomInitial&&e.map.boxZoom.enable(),e.map=null,e.container=null,e.store=null,t&&t.parentNode&&t.parentNode.removeChild(t),t=null,this},connect(){e.map.off("load",i.connect),clearInterval(n),i.addLayers(),e.store.storeMapConfig(),e.events.addEventListeners()},onAdd(c){if(e.map=c,e.events=Yie(e),e.ui=Qie(e),e.container=c.getContainer(),e.store=new uo(e),t=e.ui.addButtons(),e.o
3305ptions.boxSelect){e.boxZoomInitial=c.boxZoom.isEnabled(),c.boxZoom.disable();const h=c.dragPan.isEnabled();c.dragPan.disable(),c.dragPan.enable(),h||c.dragPan.disable()}return c.loaded()?i.connect():(c.on("load",i.connect),n=setInterval(()=>{c.loaded()&&i.connect()},16)),e.events.start(),t},addLayers(){e.map.addSource(pc.COLD,{data:{type:pr.FEATURE_COLLECTION,features:[]},type:"geojson"}),e.map.addSource(pc.HOT,{data:{type:pr.FEATURE_COLLECTION,features:[]},type:"geojson"}),e.options.styles.forEach(c=>{e.map.addLayer(c)}),e.store.setDirty(!0),e.store.render()},removeLayers(){e.options.styles.forEach(c=>{e.map.getLayer(c.id)&&e.map.removeLayer(c.id)}),e.map.getSource(pc.COLD)&&e.map.removeSource(pc.COLD),e.map.getSource(pc.HOT)&&e.map.removeSource(pc.HOT)}};return e.setup=i,i}const ZI="#3bb2d0",rb="#fbb03b",Bz="#fff",Cj=[{id:"gl-draw-polygon-fill",type:"fill",filter:["all",["==","$type","Polygon"]],paint:{"fill-color":["case",["==",["get","active"],"true"],rb,ZI],"fill-opacity":.1}},{id:"gl-draw-lines",type:"line",filter:["any",["==","$type","LineString"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["case",["==",["get","active"],"true"],rb,ZI],"line-dasharray":["case",["==",["get","active"],"true"],[.2,2],[2,0]],"line-width":2}},{id:"gl-draw-point-outer",type:"circle",filter:["all",["==","$type","Point"],["==","meta","feature"]],paint:{"circle-radius":["case",["==",["get","active"],"true"],7,5],"circle-color":Bz}},{id:"gl-draw-point-inner",type:"circle",filter:["all",["==","$type","Point"],["==","meta","feature"]],paint:{"circle-radius":["case",["==",["get","active"],"true"],5,3],"circle-color":["case",["==",["get","active"],"true"],rb,ZI]}},{id:"gl-draw-vertex-outer",type:"circle",filter:["all",["==","$type","Point"],["==","meta","vertex"],["!=","mode","simple_select"]],paint:{"circle-radius":["case",["==",["get","active"],"true"],7,5],"circle-color":Bz}},{id:"gl-draw-vertex-inner",type:"circle",filter:["all",["==","$type","Point"],["==","meta","vertex"],["!=","mode","simple_select"]],paint:{"circle-radius":["case",["==",["get","active"],"true"],5,3],"circle-color":rb}},{id:"gl-draw-midpoint",type:"circle",filter:["all",["==","meta","midpoint"]],paint:{"circle-radius":3,"circle-color":rb}}];function Lf(e,t){this.x=e,this.y=t}Lf.prototype={clone(){return new Lf(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,t){return this.clone()._rotateAround(e,t)},matMult(e){return this.clone()._matMult(e)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){const t=e.x-this.x,n=e.y-this.y;return t*t+n*n},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult(e){const t=e[0]*this.x+e[1]*this.y,n=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=n,this},_add(e){return this.x+=e.x,this.y+=e.y,this},_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){const e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){const t=Math.cos(e),n=Math.sin(e),i=t*this.x-n*this.y,c=n*this.x+t*this.y;return this.x=i,this.y=c,this},_rotateAround(e,t){const n=Math.cos(e),i=Math.sin(e),c=t.x+n*(this.x-t.x)-i*(this.y-t.y),h=t.y+i*(this.x-t.x)+n*(this.y-t.y);return this.x=c,this.y=h,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:Lf};Lf.convert=function(e){if(e instanceof Lf)return e;if(Array.isArray(e))return new Lf(+e[0],+e[1]);if(e.x!==void 0&&e.y!==void 0)return new Lf(+e.x,+e.y);throw new Error("Expected [x, y] or {x, y} point format")};function DM(e,t){const n=t.getBoundingClientRect();return new Lf(e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0))}function fy(e,t,n,i){return{type:pr.FEATURE,properties:{meta:ya.VERTEX,parent:e,coord_path:n,active:i?Os.ACTIVE:Os.INACTIVE},geometry:{type:pr.POINT,coordinates:t}}}function Qb(e,t,n={}){const i={type:"Feature"};return(n.id===0||n.id)&&(i.id=n.id),n.bbox&&(i.bbox=n.bbox),i.properties=t||{},i.geometry=e,i}function uOe(e,t,n={}){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!OR(e[0])||!OR(e[1]))throw new Error("coordinates must contain numbers");return Qb({type:"Point",coordinates:e},t,n)}function dOe(e,t,n={}){if(e.length<2)throw new Error("coordinates must be an array of two or more positions");return Qb({type:"LineString",coordinates:e},t,n)}function hOe(e,t={}){const n={type:"FeatureCollection"};return t.id&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.features=e,n}function fOe(e,t,n={}){return Qb({type:"MultiLineString",coordinates:e},t,n)}function OR(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}
3305function Aj(e,t,n){if(e!==null)for(var i,c,h,m,a,y,E,C=0,P=0,L,D=e.type,V=D==="FeatureCollection",U=D==="Feature",W=V?e.features.length:1,$=0;$<W;$++){E=V?e.features[$].geometry:U?e.geometry:e,L=E?E.type==="GeometryCollection":!1,a=L?E.geometries.length:1;for(var Y=0;Y<a;Y++){var X=0,K=0;if(m=L?E.geometries[Y]:E,m!==null){y=m.coordinates;var ne=m.type;switch(C=0,ne){case null:break;case"Point":if(t(y,P,$,X,K)===!1)return!1;P++,X++;break;case"LineString":case"MultiPoint":for(i=0;i<y.length;i++){if(t(y[i],P,$,X,K)===!1)return!1;P++,ne==="MultiPoint"&&X++}ne==="LineString"&&X++;break;case"Polygon":case"MultiLineString":for(i=0;i<y.length;i++){for(c=0;c<y[i].length-C;c++){if(t(y[i][c],P,$,X,K)===!1)return!1;P++}ne==="MultiLineString"&&X++,ne==="Polygon"&&K++}ne==="Polygon"&&X++;break;case"MultiPolygon":for(i=0;i<y.length;i++){for(K=0,c=0;c<y[i].length;c++){for(h=0;h<y[i][c].length-C;h++){if(t(y[i][c][h],P,$,X,K)===!1)return!1;P++}K++}X++}break;case"GeometryCollection":for(i=0;i<m.geometries.length;i++)if(Aj(m.geometries[i],t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function toe(e,t){var n,i,c,h,m,a,y,E,C,P,L=0,D=e.type==="FeatureCollection",V=e.type==="Feature",U=D?e.features.length:1;for(n=0;n<U;n++){for(a=D?e.features[n].geometry:V?e.geometry:e,E=D?e.features[n].properties:V?e.properties:{},C=D?e.features[n].bbox:V?e.bbox:void 0,P=D?e.features[n].id:V?e.id:void 0,y=a?a.type==="GeometryCollection":!1,m=y?a.geometries.length:1,c=0;c<m;c++){if(h=y?a.geometries[c]:a,h===null){if(t(null,L,E,C,P)===!1)return!1;continue}switch(h.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(h,L,E,C,P)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<h.geometries.length;i++)if(t(h.geometries[i],L,E,C,P)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}L++}}function pOe(e,t){toe(e,function(n,i,c,h,m){var a=n===null?null:n.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return t(Qb(n,c,{bbox:h,id:m}),i,0)===!1?!1:void 0}var y;switch(a){case"MultiPoint":y="Point";break;case"MultiLineString":y="LineString";break;case"MultiPolygon":y="Polygon";break}for(var E=0;E<n.coordinates.length;E++){var C=n.coordinates[E],P={type:y,coordinates:C};if(t(Qb(P,c),i,E)===!1)return!1}})}function noe(e){if(!e)throw new Error("geojson is required");switch(e.type){case"Feature":return Ij(e);case"FeatureCollection":return roe(e);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return FM(e);default:throw new Error("unknown GeoJSON type")}}function Ij(e){const t={type:"Feature"};return Object.keys(e).forEach(n=>{switch(n){case"type":case"properties":case"geometry":return;default:t[n]=e[n]}}),t.properties=Pj(e.properties),e.geometry==null?t.geometry=null:t.geometry=FM(e.geometry),t}function Pj(e){const t={};return e&&Object.keys(e).forEach(n=>{const i=e[n];typeof i=="object"?i===null?t[n]=null:Array.isArray(i)?t[n]=i.map(c=>c):t[n]=Pj(i):t[n]=i}),t}function roe(e){const t={type:"FeatureCollection"};return Object.keys(e).forEach(n=>{switch(n){case"type":case"features":return;default:t[n]=e[n]}}),t.features=e.features.map(n=>Ij(n)),t}function FM(e){const t={type:e.type};return e.bbox&&(t.bbox=e.bbox),e.type==="GeometryCollection"?(t.geometries=e.geometries.map(n=>FM(n)),t):(t.coordinates=Rj(e.coordinates),t)}function Rj(e){const t=e;return typeof t[0]!="object"?t.slice():t.map(n=>Rj(n))}function zz(e,t={}){return kj(e,"mercator",t)}function ioe(e,t={}){return kj(e,"wgs84",t)}function kj(e,t,n={}){n=n||{};var i=n.mutate;if(!e)throw new Error("geojson is required");return Array.isArray(e)&&OR(e[0])?e=t==="mercator"?Nz(e):Vz(e):(i!==!0&&(e=noe(e)),Aj(e,function(c){var h=t==="mercator"?Nz(c):Vz(c);c[0]=h[0],c[1]=h[1]})),e}function Nz(e){var t=Math.PI/180,n=6378137,i=20037508342789244e-9,c=Math.abs(e[0])<=180?e[0]:e[0]-ooe(e[0])*360,h=[n*c*t,n*Math.log(Math.tan(Math.PI*.25+.5*e[1]*t))];return h[0]>i&&(h[0]=i),h[0]<-i&&(h[0]=-i),h[1]>i&&(h[1]=i),h[1]<-i&&(h[1]=-i),h}function Vz(e){var t=180/Math.PI,n=6378137;
3305return[e[0]*t/n,(Math.PI*.5-2*Math.atan(Math.exp(-e[1]/n)))*t]}function ooe(e){return e<0?-1:e>0?1:0}function Mj(e,t,n){const i=t.geometry.coordinates,c=n.geometry.coordinates;if(i[1]>IR||i[1]<AR||c[1]>IR||c[1]<AR)return null;const h=zz(i),m=zz(c),a=P=>Number(P.toFixed(8)),y=(P,L)=>(P+L)/2,E=ioe([y(h[0],m[0]),y(h[1],m[1])]),C=[a(E[0]),a(E[1])];return{type:pr.FEATURE,properties:{meta:ya.MIDPOINT,parent:e,lng:C[0],lat:C[1],coord_path:n.properties.coord_path},geometry:{type:pr.POINT,coordinates:C}}}function FC(e,t={},n=null){const{type:i,coordinates:c}=e.geometry,h=e.properties&&e.properties.id;let m=[];i===pr.POINT?m.push(fy(h,c,n,y(n))):i===pr.POLYGON?c.forEach((C,P)=>{a(C,n!==null?`${n}.${P}`:String(P))}):i===pr.LINE_STRING?a(c,n):i.indexOf(pr.MULTI_PREFIX)===0&&E();function a(C,P){let L="",D=null;C.forEach((V,U)=>{const W=P!=null?`${P}.${U}`:String(U),$=fy(h,V,W,y(W));if(t.midpoints&&D){const X=Mj(h,D,$);X&&m.push(X)}D=$;const Y=JSON.stringify(V);L!==Y&&m.push($),U===0&&(L=Y)})}function y(C){return t.selectedPaths?t.selectedPaths.indexOf(C)!==-1:!1}function E(){const C=i.replace(pr.MULTI_PREFIX,"");c.forEach((P,L)=>{const D={type:pr.FEATURE,properties:e.properties,geometry:{type:C,coordinates:P}};m=m.concat(FC(D,t,L))})}return m}const ou={enable(e){setTimeout(()=>{!e.map||!e.map.doubleClickZoom||!e._ctx||!e._ctx.store||!e._ctx.store.getInitialConfigValue||e._ctx.store.getInitialConfigValue("doubleClickZoom")&&e.map.doubleClickZoom.enable()},0)},disable(e){setTimeout(()=>{!e.map||!e.map.doubleClickZoom||e.map.doubleClickZoom.disable()},0)}},{LAT_MIN:cT,LAT_MAX:uT,LAT_RENDERED_MIN:Uz,LAT_RENDERED_MAX:$z,LNG_MIN:jz,LNG_MAX:Gz}=mj;function soe(e){const t={Point:0,LineString:1,Polygon:2,MultiPoint:1,MultiLineString:2,MultiPolygon:3}[e.geometry.type],n=[e.geometry.coordinates].flat(t),i=n.map(a=>a[0]),c=n.map(a=>a[1]),h=a=>Math.min.apply(null,a),m=a=>Math.max.apply(null,a);return[h(i),h(c),m(i),m(c)]}function BM(e,t){let n=cT,i=uT,c=cT,h=uT,m=Gz,a=jz;e.forEach(E=>{const C=soe(E),P=C[1],L=C[3],D=C[0],V=C[2];P>n&&(n=P),L<i&&(i=L),L>c&&(c=L),P<h&&(h=P),D<m&&(m=D),V>a&&(a=V)});const y=t;return n+y.lat>$z&&(y.lat=$z-n),c+y.lat>uT&&(y.lat=uT-c),i+y.lat<Uz&&(y.lat=Uz-i),h+y.lat<cT&&(y.lat=cT-h),m+y.lng<=jz&&(y.lng+=Math.ceil(Math.abs(y.lng)/360)*360),a+y.lng>=Gz&&(y.lng-=Math.ceil(Math.abs(y.lng)/360)*360),y}function zM(e,t){const n=BM(e.map(i=>i.toGeoJSON()),t);e.forEach(i=>{const c=i.getCoordinates(),h=E=>{const C={lng:E[0]+n.lng,lat:E[1]+n.lat};return[C.lng,C.lat]},m=E=>E.map(C=>h(C)),a=E=>E.map(C=>m(C));let y;i.type===pr.POINT?y=h(c):i.type===pr.LINE_STRING||i.type===pr.MULTI_POINT?y=c.map(h):i.type===pr.POLYGON||i.type===pr.MULTI_LINE_STRING?y=c.map(m):i.type===pr.MULTI_POLYGON&&(y=c.map(a)),i.incomingCoords(y)})}const to={};to.onSetup=function(e){const t={dragMoveLocation:null,boxSelectStartLocation:null,boxSelectElement:void 0,boxSelecting:!1,canBoxSelect:!1,dragMoving:!1,canDragMove:!1,initialDragPanState:this.map.dragPan.isEnabled(),initiallySelectedFeatureIds:e.featureIds||[]};return this.setSelected(t.initiallySelectedFeatureIds.filter(n=>this.getFeature(n)!==void 0)),this.fireActionable(),this.setActionableState({combineFeatures:!0,uncombineFeatures:!0,trash:!0}),t};to.fireUpdate=function(){this.fire(Va.UPDATE,{action:Nx.MOVE,features:this.getSelected().map(e=>e.toGeoJSON())})};to.fireActionable=function(){const e=this.getSelected(),t=e.filter(h=>this.isInstanceOf("MultiFeature",h));let n=!1;if(e.length>1){n=!0;const h=e[0].type.replace("Multi","");e.forEach(m=>{m.type.replace("Multi","")!==h&&(n=!1)})}const i=t.length>0,c=e.length>0;this.setActionableState({combineFeatures:n,uncombineFeatures:i,trash:c})};to.getUniqueIds=function(e){return e.length?e.map(n=>n.properties.id).filter(n=>n!==void 0).reduce((n,i)=>(n.add(i),n),new gc).values():[]};to.stopExtendedInteractions=function(e){e.boxSelectElement&&(e.boxSelectElement.parentNode&&e.boxSelectElement.parentNode.removeChild(e.boxSelectElement),e.boxSelectElement=null),(e.canDragMove||e.canBoxSelect)&&e.initialDragPanState===!0&&this.map.dragPan.enable(),e.boxSelecting=!1,e.canBoxSelect=!1,e.dragMoving=!1,e.canDragMove=!1};to.onStop=function(){ou.enable(this)};to.onMouseMove=function(e,t){return MM(t)&&e.dragMoving&&this.fireUpdate(),this.stopExtendedInteractions(e),!0};to.onMouseOut=function(e){return e.dragMoving?this.fireUpdate():!0};to.onTap=to.onClick=function(e,t){if(MC(t))return this.clickAnywhere(e,t);if(kC(ya.VERTEX)(t))return this.clickOnVertex(e,t);if(MM(t))return this.clickOnFeature(e,t)};to.clickAnywhere=function(e){const t=this.getSelectedIds();t.length&&(this.clearSelectedFeatures(),t.forEach(n=>this.doRender(n))),ou.enable(this),this.stopExtendedInteractions(e)};to.clickOnVertex=function(e,t){this.changeMode(ui.DIRECT_SELECT,{featureId:t.featureTarget.properties.parent,coordPath:t.featureTarget.properties.coord_path,startPos:t.lngLat}),this.updateUIClasses({mouse:Po.MOVE})};to.startOnActiveFeature=function(e,t){this.stopExtendedInteractions(e),this.map.dragPan.disable(),this.doRender(t.featureTarget.properties.id),e.canDragMove=!0,e.dragMoveLocation=t.lngLat};to.clickOnFeature=function(e,t){ou.disable(this),this.stopExtendedInteractions(e);const n=RE(t),i=this.getSelectedIds(),c=t.featureTarget.properties.id,h=this.isSelected(c);if(!n&&h&&this.getFeature(c).type!==pr.POINT)return this.changeMode(ui.DIRECT_SELECT,{featureId:c});h&&n?(this.deselect(c),this.updateUIClasses({mouse:Po.POINTER}),i.length===1&&ou.enable(this)):!h&&n?(this.select(c),this.updateUIClasses({mouse:Po.MOVE})):!h&&!n&&(i.forEach(m=>this.doRender(m)),this.setSelected(c),this.updateUIClasses({mouse:Po.MOVE})),this.doRender(c)};to.onMouseDown=function(e,t){if(e.initialDragPanState=this.map.dragPan.isEnabled(),qm(t))return this.startOnActiveFeature
3305(e,t);if(this.drawConfig.boxSelect&&gj(t))return this.startBoxSelect(e,t)};to.startBoxSelect=function(e,t){this.stopExtendedInteractions(e),this.map.dragPan.disable(),e.boxSelectStartLocation=DM(t.originalEvent,this.map.getContainer()),e.canBoxSelect=!0};to.onTouchStart=function(e,t){if(qm(t))return this.startOnActiveFeature(e,t)};to.onDrag=function(e,t){if(e.canDragMove)return this.dragMove(e,t);if(this.drawConfig.boxSelect&&e.canBoxSelect)return this.whileBoxSelect(e,t)};to.whileBoxSelect=function(e,t){e.boxSelecting=!0,this.updateUIClasses({mouse:Po.ADD}),e.boxSelectElement||(e.boxSelectElement=document.createElement("div"),e.boxSelectElement.classList.add(il.BOX_SELECT),this.map.getContainer().appendChild(e.boxSelectElement));const n=DM(t.originalEvent,this.map.getContainer()),i=Math.min(e.boxSelectStartLocation.x,n.x),c=Math.max(e.boxSelectStartLocation.x,n.x),h=Math.min(e.boxSelectStartLocation.y,n.y),m=Math.max(e.boxSelectStartLocation.y,n.y),a=`translate(${i}px, ${h}px)`;e.boxSelectElement.style.transform=a,e.boxSelectElement.style.WebkitTransform=a,e.boxSelectElement.style.width=`${c-i}px`,e.boxSelectElement.style.height=`${m-h}px`};to.dragMove=function(e,t){e.dragMoving=!0,t.originalEvent.stopPropagation();const n={lng:t.lngLat.lng-e.dragMoveLocation.lng,lat:t.lngLat.lat-e.dragMoveLocation.lat};zM(this.getSelected(),n),e.dragMoveLocation=t.lngLat};to.onTouchEnd=to.onMouseUp=function(e,t){if(e.dragMoving)this.fireUpdate();else if(e.boxSelecting){const n=[e.boxSelectStartLocation,DM(t.originalEvent,this.map.getContainer())],i=this.featuresAt(null,n,"click"),c=this.getUniqueIds(i).filter(h=>!this.isSelected(h));c.length&&(this.select(c),c.forEach(h=>this.doRender(h)),this.updateUIClasses({mouse:Po.MOVE}))}this.stopExtendedInteractions(e)};to.toDisplayFeatures=function(e,t,n){t.properties.active=this.isSelected(t.properties.id)?Os.ACTIVE:Os.INACTIVE,n(t),this.fireActionable(),!(t.properties.active!==Os.ACTIVE||t.geometry.type===pr.POINT)&&FC(t).forEach(n)};to.onTrash=function(){this.deleteFeature(this.getSelectedIds()),this.fireActionable()};to.onCombineFeatures=function(){const e=this.getSelected();if(e.length===0||e.length<2)return;const t=[],n=[],i=e[0].type.replace("Multi","");for(let c=0;c<e.length;c++){const h=e[c];if(h.type.replace("Multi","")!==i)return;
3305h.type.includes("Multi")?h.getCoordinates().forEach(m=>{t.push(m)}):t.push(h.getCoordinates()),n.push(h.toGeoJSON())}if(n.length>1){const c=this.newFeature({type:pr.FEATURE,properties:n[0].properties,geometry:{type:`Multi${i}`,coordinates:t}});this.addFeature(c),this.deleteFeature(this.getSelectedIds(),{silent:!0}),this.setSelected([c.id]),this.fire(Va.COMBINE_FEATURES,{createdFeatures:[c.toGeoJSON()],deletedFeatures:n})}this.fireActionable()};to.onUncombineFeatures=function(){const e=this.getSelected();if(e.length===0)return;const t=[],n=[];for(let i=0;i<e.length;i++){const c=e[i];this.isInstanceOf("MultiFeature",c)&&(c.getFeatures().forEach(h=>{this.addFeature(h),h.properties=c.properties,t.push(h.toGeoJSON()),this.select([h.id])}),this.deleteFeature(c.id,{silent:!0}),n.push(c.toGeoJSON()))}t.length>1&&this.fire(Va.UNCOMBINE_FEATURES,{createdFeatures:t,deletedFeatures:n}),this.fireActionable()};const Lj=kC(ya.VERTEX),Oj=kC(ya.MIDPOINT),no={};no.fireUpdate=function(){this.fire(Va.UPDATE,{action:Nx.CHANGE_COORDINATES,features:this.getSelected().map(e=>e.toGeoJSON())})};no.fireActionable=function(e){this.setActionableState({combineFeatures:!1,uncombineFeatures:!1,trash:e.selectedCoordPaths.length>0})};no.startDragging=function(e,t){e.initialDragPanState==null&&(e.initialDragPanState=this.map.dragPan.isEnabled()),this.map.dragPan.disable(),e.canDragMove=!0,e.dragMoveLocation=t.lngLat};no.stopDragging=function(e){e.canDragMove&&e.initialDragPanState===!0&&this.map.dragPan.enable(),e.initialDragPanState=null,e.dragMoving=!1,e.canDragMove=!1,e.dragMoveLocation=null};no.onVertex=function(e,t){this.startDragging(e,t);const n=t.featureTarget.properties,i=e.selectedCoordPaths.indexOf(n.coord_path);!RE(t)&&i===-1?e.selectedCoordPaths=[n.coord_path]:RE(t)&&i===-1&&e.selectedCoordPaths.push(n.coord_path);const c=this.pathsToCoordinates(e.featureId,e.selectedCoordPaths);this.setSelectedCoordinates(c)};no.onMidpoint=function(e,t){this.startDragging(e,t);const n=t.featureTarget.properties;e.feature.addCoordinate(n.coord_path,n.lng,n.lat),this.fireUpdate(),e.selectedCoordPaths=[n.coord_path]};no.pathsToCoordinates=function(e,t){return t.map(n=>({feature_id:e,coord_path:n}))};no.onFeature=function(e,t){e.selectedCoordPaths.length===0?this.startDragging(e,t):this.stopDragging(e)};no.dragFeature=function(e,t,n){zM(this.getSelected(),n),e.dragMoveLocation=t.lngLat};no.dragVertex=function(e,t,n){const i=e.selectedCoordPaths.map(m=>e.feature.getCoordinate(m)),c=i.map(m=>({type:pr.FEATURE,properties:{},geometry:{type:pr.POINT,coordinates:m}})),h=BM(c,n);for(let m=0;m<i.length;m++){const a=i[m];e.feature.updateCoordinate(e.selectedCoordPaths[m],a[0]+h.lng,a[1]+h.lat)}};no.clickNoTarget=function(){this.changeMode(ui.SIMPLE_SELECT)};no.clickInactive=function(){this.changeMode(ui.SIMPLE_SELECT)};no.clickActiveFeature=function(e){e.selectedCoordPaths=[],this.clearSelectedCoordinates(),e.feature.changed()};no.onSetup=function(e){const t=e.featureId,n=this.getFeature(t);if(!n)throw new Error("You must provide a featureId to enter direct_select mode");if(n.type===pr.POINT)throw new TypeError("direct_select mode doesn't handle point features");const i={featureId:t,feature:n,dragMoveLocation:e.startPos||null,dragMoving:!1,canDragMove:!1,selectedCoordPaths:e.coordPath?[e.coordPath]:[]};return this.setSelectedCoordinates(this.pathsToCoordinates(t,i.selectedCoordPaths)),this.setSelected(t),ou.disable(this),this.setActionableState({trash:!0}),i};no.onStop=function(){ou.enable(this),this.clearSelectedCoordinates()};no.toDisplayFeatures=function(e,t,n){e.featureId===t.properties.id?(t.properties.active=Os.ACTIVE,n(t),FC(t,{map:this.map,midpoints:!0,selectedPaths:e.selectedCoordPaths}).forEach(n)):(t.properties.active=Os.INACTIVE,n(t)),this.fireActionable(e)};no.onTrash=function(e){e.selectedCoordPaths.sort((t,n)=>n.localeCompare(t,"en",{numeric:!0})).forEach(t=>e.feature.removeCoordinate(t)),this.fireUpdate(),e.selectedCoordPaths=[],this.clearSelectedCoordinates(),this.fireActionable(e),e.feature.isValid()===!1&&(this.deleteFeature([e.featureId]),this.changeMode(ui.SIMPLE_SELECT,{}))};no.onMouseMove=function(e,t){const n=qm(t),i=Lj(t),c=Oj(t),h=e.selectedCoordPaths.length===0;return n&&h?this.updateUIClasses({mouse:Po.MOVE}):i&&!h?this.updateUIClasses({mouse:Po.MOVE}):this.updateUIClasses({mouse:Po.NONE}),(i||n||c)&&e.dragMoving&&this.fireUpdate(),this.stopDragging(e),!0};no.onMouseOut=function(e){return e.dragMoving&&this.fireUpdate(),!0};no.onTouchStart=no.onMouseDown=function(e,t){if(Lj(t))return this.onVertex(e,t);if(qm(t))return this.onFeature(e,t);if(Oj(t))return this.onMidpoint(e,t)};no.onDrag=function(e,t){if(e.canDragMove!==!0)return;e.dragMoving=!0,t.originalEvent.stopPropagation();const n={lng:t.lngLat.lng-e.dragMoveLocation.lng,lat:t.lngLat.lat-e.dragMoveLocation.lat};e.selectedCoordPaths.length>
33050?this.dragVertex(e,t,n):this.dragFeature(e,t,n),e.dragMoveLocation=t.lngLat};no.onClick=function(e,t){if(MC(t))return this.clickNoTarget(e,t);if(qm(t))return this.clickActiveFeature(e,t);if(kM(t))return this.clickInactive(e,t);this.stopDragging(e)};no.onTap=function(e,t){if(MC(t))return this.clickNoTarget(e,t);if(qm(t))return this.clickActiveFeature(e,t);if(kM(t))return this.clickInactive(e,t)};no.onTouchEnd=no.onMouseUp=function(e){e.dragMoving&&this.fireUpdate(),this.stopDragging(e)};const sd={};sd.onSetup=function(){const e=this.newFeature({type:pr.FEATURE,properties:{},geometry:{type:pr.POINT,coordinates:[]}});return this.addFeature(e),this.clearSelectedFeatures(),this.updateUIClasses({mouse:Po.ADD}),this.activateUIButton(sl.POINT),this.setActionableState({trash:!0}),{point:e}};sd.stopDrawingAndRemove=function(e){this.deleteFeature([e.point.id],{silent:!0}),this.changeMode(ui.SIMPLE_SELECT)};sd.onTap=sd.onClick=function(e,t){this.updateUIClasses({mouse:Po.MOVE}),e.point.updateCoordinate("",t.lngLat.lng,t.lngLat.lat),this.fire(Va.CREATE,{features:[e.point.toGeoJSON()]}),this.changeMode(ui.SIMPLE_SELECT,{featureIds:[e.point.id]})};sd.onStop=function(e){this.activateUIButton(),e.point.getCoordinate().length||this.deleteFeature([e.point.id],{silent:!0})};sd.toDisplayFeatures=function(e,t,n){const i=t.properties.id===e.point.id;if(t.properties.active=i?Os.ACTIVE:Os.INACTIVE,!i)return n(t)};sd.onTrash=sd.stopDrawingAndRemove;sd.onKeyUp=function(e,t){if(LC(t)||OC(t))return this.stopDrawingAndRemove(e,t)};function kE(e,t){return e.lngLat?e.lngLat.lng===t[0]&&e.lngLat.lat===t[1]:!1}const su={};su.onSetup=function(){const e=this.newFeature({type:pr.FEATURE,properties:{},geometry:{type:pr.POLYGON,coordinates:[[]]}});return this.addFeature(e),this.clearSelectedFeatures(),ou.disable(this),this.updateUIClasses({mouse:Po.ADD}),this.activateUIButton(sl.POLYGON),this.setActionableState({trash:!0}),{polygon:e,currentVertexPosition:0}};su.clickAnywhere=function(e,t){if(e.currentVertexPosition>0&&kE(t,e.polygon.coordinates[0][e.currentVertexPosition-1]))return this.changeMode(ui.SIMPLE_SELECT,{featureIds:[e.polygon.id]});this.updateUIClasses({mouse:Po.ADD}),e.polygon.updateCoordinate(`0.${e.currentVertexPosition}`,t.lngLat.lng,t.lngLat.lat),e.currentVertexPosition++,e.polygon.updateCoordinate(`0.${e.currentVertexPosition}`,t.lngLat.lng,t.lngLat.lat)};su.clickOnVertex=function(e){return this.changeMode(ui.SIMPLE_SELECT,{featureIds:[e.polygon.id]})};su.onMouseMove=function(e,t){e.polygon.updateCoordinate(`0.${e.currentVertexPosition}`,t.lngLat.lng,t.lngLat.lat),Vx(t)&&this.updateUIClasses({mouse:Po.POINTER})};su.onTap=su.onClick=function(e,t){return Vx(t)?this.clickOnVertex(e,t):this.clickAnywhere(e,t)};su.onKeyUp=function(e,t){LC(t)?(this.deleteFeature([e.polygon.id],{silent:!0}),this.changeMode(ui.SIMPLE_SELECT)):OC(t)&&this.changeMode(ui.SIMPLE_SELECT,{featureIds:[e.polygon.id]})};su.onStop=function(e){this.updateUIClasses({mouse:Po.NONE}),ou.enable(this),this.activateUIButton(),this.getFeature(e.polygon.id)!==void 0&&(e.polygon.removeCoordinate(`0.${e.currentVertexPosition}`),e.polygon.isValid()?this.fire(Va.CREATE,{features:[e.polygon.toGeoJSON()]}):(this.deleteFeature([e.polygon.id],{silent:!0}),this.changeMode(ui.SIMPLE_SELECT,{},{silent:!0})))};su.toDisplayFeatures=function(e,t,n){const i=t.properties.id===e.polygon.id;if(t.properties.active=i?Os.ACTIVE:Os.INACTIVE,!i)return n(t);if(t.geometry.coordinates.length===0)return;const c=t.geometry.coordinates[0].length;if(!(c<3)){if(t.properties.meta=ya.FEATURE,n(fy(e.polygon.id,t.geometry.coordinates[0][0],"0.0",!1)),c>3){const h=t.geometry.coordinates[0].length-3;n(fy(e.polygon.id,t.geometry.coordinates[0][h],`0.${h}`,!1))}if(c<=4){const h=[[t.geometry.coordinates[0][0][0],t.geometry.coordinates[0][0][1]],[t.geometry.coordinates[0][1][0],t.geometry.coordinates[0][1][1]]];if(n({type:pr.FEATURE,properties:t.properties,geometry:{coordinates:h,type:pr.LINE_STRING}}),c===3)return}return n(t)}};su.onTrash=function(e){this.deleteFeature([e.polygon.id],{silent:!0}),this.changeMode(ui.SIMPLE_SELECT)};const au={};au.onSetup=function(e){e=e||{};const t=e.featureId;let n,i,c="forward";if(t){if(n=this.getFeature(t),!n)throw new Error("Could not find a feature with the provided featureId");let h=e.from;if(h&&h.type==="Feature"&&h.geometry&&h.geometry.type==="Point"&&(h=h.geometry),h&&h.type==="Point"&&h.coordinates&&h.coordinates.length===2&&(h=h.coordinates),!h||!Array.isArray(h))throw new Error("Please use the `from` property to indicate which point to continue the line from");const m=n.coordinates.length-1;if(n.coordinates[m][0]===h[0]&&n.coordinates[m][1]===h[1])i=m+1,n.addCoordinate(i,...n.coordinates[m]);else if(n.coordinates[0][0]===h[0]&&n.coordinates[0][1]===h[1])c="backwards",i=0,n.addCoordinate(i,...n.coordinates[0]);else throw new Error("`from` should match the point at either the start or the end of the provided LineString")}else n=this.newFeature({type:pr.FEATURE,properties:{},geometry:{type:pr.LINE_STRING,coordinates:[]}}),i=0,this.addFeature(n);return this.clearSelectedFeatures(),ou.disable(this),this.updateUIClasses({mouse:Po.ADD}),this.activateUIButton(sl.LINE),this.setActionableState({trash:!0}),{line:n,currentVertexPosition:i,direction:c}};au.clickAnywhere=function(e,t){if(e.currentVertexPosition>0&&kE(t,e.line.coordinates[e.currentVertexPosition-1])||e.direction==="backwards"&&kE(t,e.line.coordinates[e.currentVertexPosition+1]))return this.changeMode(ui.SIMPLE_SELECT,{featureIds:[e.line.id]});this.updateUIClasses({mouse:Po.ADD}),e.line.updateCoordinate(e.currentVertexPosition,t.lngLat.lng,t.lngLat.lat),e.direction==="forward"?(e.currentVertexPosition++,e.line.updateCoordinate(e.currentVertexPosition,t.lngLat.lng,t.lngLat.lat)):e.line.addCoordinate(0,t.lngLat.lng,t.lngLat.lat)};au.clickOnVertex=function(e){return this.changeMode(ui.SIMPLE_SELECT,{featureIds:[e.line.id]})};au.onMouseMove=function(e,t){e.line.updateCoordinate(e.currentVertexPosition,t.lngLat.lng,t.lngLat.lat),Vx(t)&&this.updateUIClasses({mouse:Po.POINTER})};au.onTap=au.onClick=function(e,t){if(Vx(t))return this.clickOnVertex(e,t);this.clickAnywhere(e,t)};au.onKeyUp=function(e,t){OC(t)?this.changeMode(ui.SIMPLE_SELECT,{featureIds:[e.line.id]}
3305):LC(t)&&(this.deleteFeature([e.line.id],{silent:!0}),this.changeMode(ui.SIMPLE_SELECT))};au.onStop=function(e){ou.enable(this),this.activateUIButton(),this.getFeature(e.line.id)!==void 0&&(e.line.removeCoordinate(`${e.currentVertexPosition}`),e.line.isValid()?this.fire(Va.CREATE,{features:[e.line.toGeoJSON()]}):(this.deleteFeature([e.line.id],{silent:!0}),this.changeMode(ui.SIMPLE_SELECT,{},{silent:!0})))};au.onTrash=function(e){this.deleteFeature([e.line.id],{silent:!0}),this.changeMode(ui.SIMPLE_SELECT)};au.toDisplayFeatures=function(e,t,n){const i=t.properties.id===e.line.id;if(t.properties.active=i?Os.ACTIVE:Os.INACTIVE,!i)return n(t);t.geometry.coordinates.length<2||(t.properties.meta=ya.FEATURE,n(fy(e.line.id,t.geometry.coordinates[e.direction==="forward"?t.geometry.coordinates.length-2:1],`${e.direction==="forward"?t.geometry.coordinates.length-2:1}`,!1)),n(t))};const Dj={simple_select:to,direct_select:no,draw_point:sd,draw_polygon:su,draw_line_string:au},aoe={defaultMode:ui.SIMPLE_SELECT,keybindings:!0,touchEnabled:!0,clickBuffer:2,touchBuffer:25,boxSelect:!0,displayControlsDefault:!0,styles:Cj,modes:Dj,controls:{},userProperties:!1,suppressAPIEvents:!0},loe={point:!0,line_string:!0,polygon:!0,trash:!0,combine_features:!0,uncombine_features:!0},coe={point:!1,line_string:!1,polygon:!1,trash:!1,combine_features:!1,uncombine_features:!1};function Hz(e,t){return e.map(n=>n.source?n:Object.assign({},n,{id:`${n.id}.${t}`,source:t==="hot"?pc.HOT:pc.COLD}))}function uoe(e={}){let t=Object.assign({},e);return e.controls||(t.controls={}),e.displayControlsDefault===!1?t.controls=Object.assign({},coe,e.controls):t.controls=Object.assign({},loe,e.controls),t=Object.assign({},aoe,t),t.styles=Hz(t.styles,"cold").concat(Hz(t.styles,"hot")),t}var YI,Wz;function doe(){return Wz||(Wz=1,YI=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var i,c,h;if(Array.isArray(t)){if(i=t.length,i!=n.length)return!1;for(c=i;c--!==0;)if(!e(t[c],n[c]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(h=Object.keys(t),i=h.length,i!==Object.keys(n).length)return!1;for(c=i;c--!==0;)if(!Object.prototype.hasOwnProperty.call(n,h[c]))return!1;for(c=i;c--!==0;){var m=h[c];if(!e(t[m],n[m]))return!1}return!0}return t!==t&&n!==n}),YI}var hoe=doe();const qz=Iy(hoe);var KI,Xz;function foe(){if(Xz)return KI;Xz=1,KI=t;var e={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"};function t(n){if(!n||!n.type)return null;var i=e[n.type];if(!i)return null;if(i==="geometry")return{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:n}]};if(i==="feature")return{type:"FeatureCollection",features:[n]};if(i==="featurecollection")return n}return KI}var poe=foe();const moe=Iy(poe);function Fj(e,t){return e.length!==t.length?!1:JSON.stringify(e.map(n=>n).sort())===JSON.stringify(t.map(n=>n).sort())}const goe={Polygon:Bl,LineString:cd,Point:np,MultiPolygon:Na,MultiLineString:Na,MultiPoint:Na};function _oe(e,t){t.modes=ui;const n=e.options.suppressAPIEvents!==void 0?!!e.options.suppressAPIEvents:!0;return t.getFeatureIdsAt=function(i){return hy.click({point:i},null,e).map(h=>h.properties.id)},t.getSelectedIds=function(){return e.store.getSelectedIds()},t.getSelected=function(){return{type:pr.FEATURE_COLLECTION,features:e.store.getSelectedIds().map(i=>e.store.get(i)).map(i=>i.toGeoJSON())}},t.getSelectedPoints=function(){return{type:pr.FEATURE_COLLECTION,features:e.store.getSelectedCoordinates().map(i=>({type:pr.FEATURE,properties:{},geometry:{type:pr.POINT,coordinates:i.coordinates}}))}},t.set=function(i){if(i.type===void 0||i.type!==pr.FEATURE_COLLECTION||!Array.isArray(i.features))throw new Error("Invalid FeatureCollection");const c=e.store.createRenderBatch();let h=e.store.getAllIds().slice();const m=t.add(i),a=new gc(m);return h=h.filter(y=>!a.has(y)),h.length&&t.delete(h),c(),m},t.add=function(i){const h=JSON.parse(JSON.stringify(moe(i))).features.map(m=>{if(m.id=m.id||OM(),m.geometry===null)throw new Error("Invalid geometry: null");if(e.store.get(m.id)===void 0||e.store.get(m.id).type!==m.geometry.type){const a=goe[m.geometry.type];if(a===void 0)throw new Error(`Invalid geometry type: ${m.geometry.type}.`);const y=new a(e,m);e.store.add(y,{silent:n})}else{const a=e.store.get(m.id),y=a.properties;a.properties=m.properties,qz(y,m.properties)||e.store.featureChanged(a.id,{silent:n}),qz(a.getCoordinates(),m.geometry.coordinates)||a.incomingCoords(m.geometry.coordinates)}return m.id});return e.store.render(),h},t.get=function(i){const c=e.store.get(i);if(c)return c.toGeoJSON()},t.getAll=function(){return{type:pr.FEATURE_COLLECTION,features:e.store.getAll().map(i=>i.toGeoJSON())}},t.delete=function(i){return e.store.delete(i,{silent:n}),t.getMode()===ui.DIRECT_SELECT&&!e.store.getSelectedIds().length?e.events.changeMode(ui.SIMPLE_SELECT,void 0,{silent:n}):e.store.render(),t},t.deleteAll=function(){return e.store.delete(e.store.getAllIds(),{silent:n}),t.getMode()===ui.DIRECT_SELECT?e.events.changeMode(ui.SIMPLE_SELECT,void 0,{silent:n}):e.store.render(),t},t.changeMode=function(i,c={}){return i===ui.SIMPLE_SELECT&&t.getMode()===ui.SIMPLE_SELECT?(Fj(c.featureIds||[],e.store.getSelectedIds())||
3305(e.store.setSelected(c.featureIds,{silent:n}),e.store.render()),t):(i===ui.DIRECT_SELECT&&t.getMode()===ui.DIRECT_SELECT&&c.featureId===e.store.getSelectedIds()[0]||e.events.changeMode(i,c,{silent:n}),t)},t.getMode=function(){return e.events.getMode()},t.trash=function(){return e.events.trash({silent:n}),t},t.combineFeatures=function(){return e.events.combineFeatures({silent:n}),t},t.uncombineFeatures=function(){return e.events.uncombineFeatures({silent:n}),t},t.setFeatureProperty=function(i,c,h){return e.store.setFeatureProperty(i,c,h,{silent:n}),t},t}const yoe=Object.freeze(Object.defineProperty({__proto__:null,CommonSelectors:kie,ModeHandler:LR,StringSet:gc,constrainFeatureMovement:BM,createMidPoint:Mj,createSupplementaryPoints:FC,createVertex:fy,doubleClickZoom:ou,euclideanDistance:LM,featuresAt:hy,getFeatureAtAndSetCursors:HT,isClick:kR,isEventAtCoordinates:kE,isTap:MR,mapEventToBoundingBox:wj,moveFeatures:zM,sortFeatures:xj,stringSetsAreEqual:Fj,theme:Cj,toDenseArray:Ux},Symbol.toStringTag,{value:"Module"})),voe=function(e,t){e=uoe(e);const n={options:e};t=_oe(n,t),n.api=t;const i=eoe(n);return t.onAdd=i.onAdd,t.onRemove=i.onRemove,t.types=sl,t.options=e,t};function Py(e){voe(e,this)}Py.modes=Dj;Py.constants=mj;Py.lib=yoe;function boe(e){const t=e.getStyle(),n=(h,m,a)=>{if(h){const y=h.layout["text-field"],E=P=>y.some(L=>Array.isArray(L)&&L.includes(P));let C;E(m)?C=["match",["get",m],...a,y]:C=y,h.layout["text-field"]=C}},i=t.layers.find(h=>h.id==="country-label");n(i,"name_ar",["إسرائÙÙ","ÙÙØ³Ø·ÙÙ"]),n(i,"name_en",["Israel","Palestine"]);const c=t.layers.find(h=>h.id==="water-line-label");n(c,"name_en",["Persian Gulf","Arabian Gulf"]),e.setStyle(t)}const Gf={UNDO:"draw.undo",REDO:"draw.redo",STATE:"draw.vertexhistory"};function xoe(e,t){if(t<=0)return{ring:e.slice(),currentVertexPosition:t,removed:null};const n=e.slice(),i=n[t-1];return n.splice(t-1,1),{ring:n,currentVertexPosition:t-1,removed:i}}function woe(e,t,n){if(!n)return{ring:e.slice(),currentVertexPosition:t,applied:!1};const i=e.slice();return i.splice(t,0,n.slice()),{ring:i,currentVertexPosition:t+1,applied:!0}}const BC=Py.modes.draw_polygon,Xm={...BC};Xm.onSetup=function(){const e=BC.onSetup.call(this);return e.redoStack=[],e.onUndo=()=>this.undoVertex(e),e.onRedo=()=>this.redoVertex(e),this.map.on(Gf.UNDO,e.onUndo),this.map.on(Gf.REDO,e.onRedo),this.emitHistoryState(e),e};Xm.clickAnywhere=function(e,t){BC.clickAnywhere.call(this,e,t),e.redoStack=[],this.emitHistoryState(e)};Xm.undoVertex=function(e){const t=e.polygon;if(!this.getFeature(t.id))return;const n=t.coordinates[0]||[],{ring:i,currentVertexPosition:c,removed:h}=xoe(n,e.currentVertexPosition);h&&(t.coordinates[0]=i,t.changed(),e.currentVertexPosition=c,e.redoStack.push(h),this._ctx.store.render(),this.emitHistoryState(e))};Xm.redoVertex=function(e){const t=e.redoStack[e.redoStack.length-1],n=e.polygon;if(!t||!this.getFeature(n.id))return;const i=n.coordinates[0]||[],{ring:c,currentVertexPosition:h,applied:m}=woe(i,e.currentVertexPosition,t);m&&(n.coordinates[0]=c,n.changed(),e.currentVertexPosition=h,e.redoStack.pop(),this._ctx.store.render(),this.emitHistoryState(e))};Xm.emitHistoryState=function(e){this.fire(Gf.STATE,{canUndo:e.currentVertexPosition>0,canRedo:e.redoStack.length>0})};Xm.onStop=function(e){e.onUndo&&this.map.off(Gf.UNDO,e.onUndo),e.onRedo&&this.map.off(Gf.REDO,e.onRedo),BC.onStop.call(this,e)};const Soe={polygon:!1,trash:!1,line_string:!1,point:!1},Toe="simple_select",WT="draw_polygon_undoable",Eoe="#00c8f5",Coe="#FFF";function Zz(e,t){return typeof window>"u"?t:getComputedStyle(document.documentElement).getPropertyValue(e).trim()||t}function DR(){return Zz("--color-brand",Zz("--p-brand-primary",Eoe))}const Aoe=[{id:"gl-draw-polygon-fill.cold",property:"fill-color"},{id:"gl-draw-polygon-stroke.cold",property:"line-color"},{id:"gl-draw-line-active.cold",property:"line-color"},{id:"gl-draw-vertex.cold",property:"circle-color"},{id:"gl-draw-midpoint.cold",property:"circle-color"},{id:"gl-draw-polygon-fill.hot",property:"fill-color"},{id:"gl-draw-polygon-stroke.hot",property:"line-color"},{id:"gl-draw-line-active.hot",property:"line-color"},{id:"gl-draw-vertex.hot",property:"circle-color"},{id:"gl-draw-midpoint.hot",property:"circle-color"}];function Ioe(){const e=DR();return[{id:"gl-draw-polygon-fill",type:"fill",filter:["all",["==","$type","Polygon"],["!=","mode","static"]],paint:{"fill-color":e,"fill-opacity":.2}},{id:"gl-draw-polygon-stroke",type:"line",filter:["all",["==","$type","Polygon"],["!=","mode","static"]],paint:{"line-color":e,"line-width":2}},{id:"gl-draw-line-active",type:"line",filter:["all",["==","$type","LineString"],["!=","mode","static"]],paint:{"line-color":e,"line-width":2,"line-dasharray":[2,2]}},{id:"gl-draw-vertex-halo",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":7,"circle-color":Coe}},{id:"gl-draw-vertex",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":5,"circle-color":e}},{id:"gl-draw-midpoint",type:"circle",filter:["all",["==","meta","midpoint"],["==","$type","Point"]],paint:{"circle-radius":4,"circle-color":e}}]}function Poe(){return{displayControlsDefault:!1,controls:Soe,defaultMode:Toe,styles:Ioe(),modes:{...Py.modes,[WT]:Xm}}}const Yz={search:{className:"search-result-popup",maxWidth:"15rem"},tableRow:{className:"row-data-popup",maxWidth:"18rem"}};class Roe{map;sources;layers;markers;popups=new Map;isReady;currentLocation;logger;transitioning=!1;transitionEndCallbacks=[];draw=null;drawingCallback=null;drawingProgressCallback=null;drawHistoryCallback=null;isDrawControlAdded=!1;drawHistoryState={canUndo:!1,canRedo:!1};constructor(t){this.map=t,this.sources=new Map,this.layers=new Map,this.markers=new Map,this.isReady=!1,this.logger=rr().$logger,this.currentLocation=new XI.GeolocateControl({positionOptions:{enableHighAccuracy:!0},trackUserLocation:!0}
3305),this.map.addControl(this.currentLocation),this.initDrawControl(),this.map.on("load",()=>{this.isReady=!0}),this.map.on("style.load",async()=>{boe(this.map),await this.reinitializeLayersAndSources()})}async waitForReady(){this.isReady||this.map.isStyleLoaded()||await new Promise(t=>this.map.once("load",()=>t()))}triggerCurrentLocation(){this.currentLocation.trigger()}zoomIn(){this.map.zoomIn()}zoomOut(){this.map.zoomOut()}async addSource(t,n){await this.waitForReady();try{return this.map.getSource(t)?!1:(this.map.addSource(t,n),this.sources.set(t,n),!0)}catch(i){throw this.logger.debug(`Error adding source ${t}:`,i),i}}removeSource(t){try{const n=new Set;this.layers.forEach((c,h)=>{c?.source===t&&n.add(h)}),(this.map.getStyle()?.layers??[]).forEach(c=>{c?.source===t&&n.add(c.id)}),n.forEach(c=>{this.map.getLayer(c)&&this.map.removeLayer(c),this.layers.delete(c)}),this.map.getSource(t)&&this.map.removeSource(t),this.sources.delete(t)}catch(n){this.logger.debug(`Error removing source ${t}:`,n)}}async addLayer(t){await this.waitForReady();try{const{id:n}=t;if(this.map.getLayer(n))return this.logger.debug(`Layer ${n} already exists, skipping`),!1;if(t.source&&!this.map.getSource(t.source))throw new Error(`Source ${t.source} not found for layer ${n}`);return this.map.addLayer(t),this.layers.set(n,t),!0}catch(n){throw this.logger.debug(`Error adding layer ${t.id}:`,n),n}}removeLayer(t){try{this.map.getLayer(t)&&(this.map.removeLayer(t),this.layers.delete(t))}catch(n){throw this.logger.debug(`Error removing layer ${t}:`,n),n}}updateLayerVisibility(t,n){try{this.map.getLayer(t)&&this.map.setLayoutProperty(t,"visibility",n?"visible":"none")}catch(i){throw this.logger.debug(`Error updating layer visibility ${t}:`,i),i}}hasSource(t){return!!this.map.getSource(t)}updateSourceData(t,n){try{const i=this.map.getSource(t);i?.setData&&i.setData(n)}catch(i){this.logger.debug(`Error updating source data ${t}:`,i)}}hasLayer(t){return!!this.map.getLayer(t)}setLayerPaintProperty(t,n,i){try{this.map.getLayer(t)&&this.map.setPaintProperty(t,n,i);const c=this.layers.get(t);c&&((!c.paint||typeof c.paint!="object")&&(c.paint={}),c.paint[n]=i)}catch(c){this.logger.debug(`Error setting paint property ${n} on ${t}:`,c)}}addLayerEventListener(t,n,i){this.map.on(t,n,i)}removeLayerEventListener(t,n,i){try{this.map.off(t,n,i)}catch{}}setFeatureState(t,n,i,c){try{const h={source:t,id:n};c&&(h.sourceLayer=c),this.map.setFeatureState(h,i)}catch{}}setCursor(t){this.map.getCanvas().style.cursor=t}trackedLayerIds(t){return[...this.layers.keys()].filter(n=>(!t||t(n))&&!!this.map.getLayer(n))}querySourceFeatures(t,n){try{return this.map.querySourceFeatures(t,n)??[]}catch{return[]}}addMarker(t,n){try{if(this.markers.has(t))return this.markers.get(t);const{latitude:i,longitude:c,element:h,anchor:m}=n,a=h?{element:h,anchor:m}:{color:DR(),className:"marker"},y=new XI.Marker(a).setLngLat([c,i]).addTo(this.map);return this.markers.set(t,y),y}catch(i){throw this.logger.debug(`Error adding marker ${t}:`,i),i}}removeMarker(t){try{const n=this.markers.get(t);n&&(n.remove(),this.markers.delete(t))}catch(n){throw this.logger.debug(`Error removing marker ${t}:`,n),n}}addPopup(t,n,i){this.removePopup(t);try{const c=new XI.Popup({closeButton:!1,closeOnClick:!1,focusAfterOpen:!1,offset:12,className:Yz[t].className,maxWidth:Yz[t].maxWidth}).setLngLat([n.lng,n.lat]).setDOMContent(i).addTo(this.map);return this.popups.set(t,c),c}catch(c){return this.logger.debug(`Error adding popup ${t}:`,c),null}}removePopup(t){try{this.popups.get(t)?.remove()}catch(n){this.logger.debug(`Error removing popup ${t}:`,n)}finally{this.popups.delete(t)}}clearPopups(){this.popups.forEach((t,n)=>this.removePopup(n))}async addSourceWithLayers(t,n,i=[]){try{await this.addSource(t,n)}catch(c){throw this.logger.debug(`Error adding source ${t}:`,c),this.removeSource(t),c}for(const c of i)if(c.init&&c.id){this.layers.set(c.id,{...c,source:t});try{await c.init(this.map)}catch(h){this.logger.debug(`Error initializing layer ${c.id}:`,h)}}}async reinitializeLayersAndSources(){try{this.logger.debug("Reinitializing layers and sources after style change"),this.sources.forEac
3305h((t,n)=>{this.map.getSource(n)||this.map.addSource(n,t)});for(const[t,n]of this.layers)this.map.getLayer(t)&&this.map.removeLayer(t),n.init&&typeof n.init=="function"?await n.init(this.map):this.map.addLayer(n);this.markers.forEach(t=>{t.addTo(this.map)}),this.updateDrawColors()}catch(t){this.logger.error("Error reinitializing layers and sources:",{error:t})}}runWhenMapReady(t){if(this.transitioning){this.transitionEndCallbacks.push(()=>this.runWhenMapReady(t));return}if(this.map.isStyleLoaded()){t();return}let n=!1;const i=()=>{n||(n=!0,t())};this.map.once("idle",i),this.map.once("style.load",i)}beginTransition(){this.transitioning=!0}endTransition(){if(!this.transitioning)return;this.transitioning=!1,this.transitionEndCallbacks.splice(0).forEach(n=>n())}flyTo(t){this.runWhenMapReady(()=>this.map.flyTo(t))}fitBounds(t,n={}){this.runWhenMapReady(()=>{this.map.resize(),this.map.fitBounds(t,{padding:50,...n})})}setStyle(t){this.map.setStyle(t)}clearMarkers(){this.markers.forEach(t=>t.remove()),this.markers.clear()}clearLayers(){this.layers.forEach((t,n)=>this.removeLayer(n)),this.layers.clear()}clearSources(){this.sources.forEach((t,n)=>this.removeSource(n)),this.sources.clear()}clearMapData(){this.clearMarkers(),this.clearPopups(),this.clearLayers(),this.clearSources()}initDrawControl(){this.draw=new Py(Poe()),this.map.on("draw.create",this.handleDrawCreate.bind(this)),this.map.on("draw.update",this.handleDrawUpdate.bind(this)),this.map.on("draw.delete",this.handleDrawDelete.bind(this)),this.map.on("draw.render",this.handleDrawRender.bind(this)),this.map.on(Gf.STATE,this.handleVertexHistoryState.bind(this))}handleDrawCreate(){const t=this.draw?.getAll();if(t&&t.features.length>1){const n=t.features[t.features.length-1];this.draw?.deleteAll(),n.id&&this.draw?.add(n)}this.emitCurrentDrawing(),this.resetHistory()}handleDrawUpdate(){this.emitCurrentDrawing()}handleDrawDelete(){this.drawingCallback?.(null),this.drawingProgressCallback?.(!1),this.resetHistory()}handleVertexHistoryState(t){this.drawHistoryState={canUndo:!!t.canUndo,canRedo:!!t.canRedo},this.emitHistoryState()}handleDrawRender(){const t=this.draw?.getAll(),n=t&&t.features.length>0;this.drawingProgressCallback?.(!!n)}emitCurrentDrawing(){const t=this.draw?.getAll();if(t&&t.features.length>0){const n=t.features[0],i={id:String(n.id),type:"Feature",properties:n.properties||{},geometry:n.geometry};this.drawingCallback?.(i)}else this.drawingCallback?.(null)}setDrawingCallback(t){this.drawingCallback=t}setDrawingProgressCallback(t){this.drawingProgressCallback=t}setDrawHistoryCallback(t){this.drawHistoryCallback=t}resetHistory(){this.drawHistoryState={canUndo:!1,canRedo:!1},this.emitHistoryState()}emitHistoryState(){this.drawHistoryCallback?.({...this.drawHistoryState})}undoDraw(){this.drawHistoryState.canUndo&&this.map.fire(Gf.UNDO,{})}redoDraw(){this.drawHistoryState.canRedo&&this.map.fire(Gf.REDO,{})}async startDraw(t="polygon"){if(!this.draw||(await this.waitForReady(),!this.draw))return;this.isDrawControlAdded||(this.map.addControl(this.draw),this.isDrawControlAdded=!0);const n={polygon:WT,line:WT,point:WT};this.resetHistory(),this.draw.changeMode(n[t])}async editDrawing(t){if(this.draw&&(await this.waitForReady(),!!this.draw)){this.isDrawControlAdded||(this.map.addControl(this.draw),this.isDrawControlAdded=!0);try{this.draw.deleteAll();const[n]=this.draw.add(t);this.resetHistory(),n&&this.draw.changeMode("direct_select",{featureId:n})}catch(n){this.logger.debug("Error loading drawing for edit:",n)}}}stopDraw(){if(!(!this.draw||!this.isDrawControlAdded))try{this.draw.changeMode("simple_select"),this.resetHistory()}catch(t){this.logger.debug("Error stopping draw mode:",t)}}clearDraw(){if(!(!this.draw||!this.isDrawControlAdded))try{this.draw.deleteAll(),this.drawingCallback?.(null),this.drawingProgressCallback?.(!1),this.resetHistory()}catch(t){this.logger.debug("Error clearing draw:",t)}}updateDrawColors(){const t=DR();for(const n of Aoe)this.map.getLayer(n.id)&&this.map.setPaintProperty(n.id,n.property,t)}getCurrentDrawing(){const t=this.draw?.getAll();if(t&&t.features.length>0){const n=t.features[0];return{id:String(n.id),type:"Feature",properties:n.properties||{},geometry:n.geometry}}return null}destroy(){this.transitioning=!1,this.transitionEndCallbacks=[],this.draw&&this.isDrawControlAdded&&(this.map.removeControl(this.draw),this.isDrawControlAdded=!1),this.clearMapData(),this.map&&this.map.remove()}}const koe=xa("map",()=>{const{tableLocationsToggleBus:e}=dj(),t=Bj(),n=hj(),i=vn(()=>n.activePane==="map"),c=vn(()=>n.expanded&&n.activePane==="map"),h=hn(null),m=hn(null),a=Vi(null),y=[],E=hn(!1),C=hn(null),P=hn("polygon"),L=hn(!1),D=hn(!1),V=hn(!1),U=()=>Bo.ENABLE_LOCATION?(n.open("map"),!0):!1,W=()=>{a.value?.stopDraw(),a.value?.clearMapData(),E.value=!1,n.activePane==="map"&&n.close(),e.emit({sourceTableId:null}),t.clearVisualization()},$=()=>{i.value?(a.value?.clearMapData(),n.activePane==="map"&&n.close()):n.open("map")},Y=()=>{n.toggleExpanded()},X=()=>a.value?.zoomIn(),K=()=>a.value?.zoomOut(),ne=()=>a.value?.undoDraw(),fe=()=>a.value?.redoDraw(),ye=Wt=>h.value=Wt,ke=Wt=>m.value=Wt,Fe=Wt=>{const en=new Roe(Wt);a.value=Ax(en),en.setDrawingCallback(sn=>{C.value=sn}),en.setDrawingProgressCallback(sn=>{L.value=sn}),en.setDrawHistoryCallback(sn=>{D.value=sn.canUndo,V.value=sn.canRedo}
3305),y.length&&y.splice(0).forEach(Mn=>Mn(en))},qe=()=>{a.value?.destroy(),a.value=null,y.length=0},lt=Wt=>{if(a.value){Wt(a.value);return}y.push(Wt)};return{showMap:U,hideMap:W,toggleMap:$,toggleExpanded:Y,zoomIn:X,zoomOut:K,undoDraw:ne,redoDraw:fe,setCurrentZoom:ye,setCenter:ke,setManager:Fe,clearManager:qe,withManager:lt,ensureManager:()=>new Promise(Wt=>lt(Wt)),startDrawing:(Wt="polygon")=>{P.value=Wt,E.value=!0,lt(en=>en.startDraw(Wt))},editDrawing:()=>{const Wt=C.value;Wt&&(U(),E.value=!0,lt(en=>en.editDrawing(Wt)))},stopDrawing:()=>{E.value=!1,a.value?.stopDraw()},setCurrentDrawing:Wt=>{C.value=Wt},clearDrawing:()=>{C.value=null,L.value=!1,a.value?.clearDraw()},currentZoom:h,center:m,isMapVisible:i,isExpanded:c,manager:a,isDrawingMode:E,currentDrawing:C,drawMode:P,hasDrawingProgress:L,canUndo:D,canRedo:V}},{persist:{storage:Ob.localStorage(),key:"paseet-map-state",pick:["currentZoom","center"]}}),Bj=xa("visualization",()=>{const{$logger:e,$axios:t,$i18n:n}=rr(),i=koe(),c=Nm(),h=Ox(),m=n.t,a=hn(null),y=hn(null),E=hn(null),C=hn(!1),P=hn(!0),L=vn(()=>!y.value||!a.value?null:y.value.getLegendData()),D=async ne=>{const fe=await t.get(`/visualization/${ne}`);if(fe.status===200)return fe.data.data},V=async ne=>{if(!C.value&&a.value?.uuid!==ne){C.value=!0;try{const fe=await D(ne);if(!fe){Gr.showError(h,m("visualization.fetch_error")),e.debug("Error fetching visualization",{uuid:ne});return}await U(fe)}catch(fe){Gr.showError(h,m("visualization.fetch_error")),e.debug("Error fetching visualization",{uuid:ne,error:fe})}finally{C.value=!1}}},U=async ne=>{try{if(W(),a.value=ne,c.shrinkSideBar(),!i.showMap()){e.warn("Map could not be opened");return}const ye=await i.ensureManager();await ye.waitForReady();const{createRenderer:ke}=await gt(async()=>{const{createRenderer:lt}=await import("./BSZ77t73.js");return{createRenderer:lt}},__vite__mapDeps([138,139,57]),import.meta.url),Fe=ke(ne.visType,ye);y.value=Fe,Fe.setupInteractions({onHover:lt=>{E.value=lt},onClick:()=>{}}),await Fe.render(ne),await ts();const qe={duration:1e3};ne.config.pitch!==void 0&&(qe.pitch=ne.config.pitch),ne.config.bearing!==void 0&&(qe.bearing=ne.config.bearing),ne.config.bounds?ye.fitBounds(ne.config.bounds,{padding:50,...qe}):(qe.pitch!==void 0||qe.bearing!==void 0)&&ye.flyTo(qe)}catch(fe){Gr.showError(h,m("visualization.unknown_error")),e.error("Error showing visualization",{error:fe,visualization:ne})}},W=()=>{try{y.value&&y.value.cleanup()}catch(ne){e.debug("Error clearing visualization",{error:ne})}finally{a.value=null,y.value=null,E.value=null}};return{activeVisualization:a,hoverData:E,isLoading:C,legendData:L,isLegendVisible:P,showVisualization:V,showVisualizationData:U,clearVisualization:W,setHoverData:ne=>{E.value=ne},updateTheme:ne=>{if(y.value)try{y.value.updateTheme(ne)}catch(fe){e.debug("Error updating visualization theme",{error:fe})}},toggleLegend:()=>{P.value=!P.value},updateDisplayConfig:async(ne,fe)=>{if(!a.value||!y.value)return;const ye=a.value.config;ye.display&&(ye.display[ne]=fe),await y.value.render(a.value),await ts()}}}),FR={kind:"streaming-only"},Moe=1e4,Loe=200,Ooe=e=>{switch(FR.kind){case"streaming-only":return e.streamed;case"all":return!0;case"threshold":return e.durationMs>=FR.minMs}},Doe=()=>{switch(FR.kind){case"streaming-only":case"all":case"threshold":return!0}},Kz="paseet:desktop-notifications:dismissed",_b=()=>typeof window>
3305"u"?!1:"Notification"in window,NM=()=>_b()?window.Notification.permission:"unsupported",Il=hn(NM());let Jz=!1;const Foe=()=>{if(Jz||typeof window>"u")return;Jz=!0;const e=()=>{document.visibilityState==="visible"&&(Il.value=NM())};document.addEventListener("visibilitychange",e);const t=i=>i==="granted"||i==="denied"?i:"default",n=navigator?.permissions;n&&typeof n.query=="function"&&n.query({name:"notifications"}).then(i=>{Il.value=t(i.state),i.onchange=()=>{Il.value=t(i.state)}}).catch(()=>{})};function Boe(){Foe();const e=()=>{Il.value=NM()},t=()=>{if(typeof window>"u")return!1;try{return window.localStorage.getItem(Kz)==="1"}catch{return!1}},n=()=>{if(!(typeof window>"u"))try{window.localStorage.setItem(Kz,"1")}catch{}};return{permission:ny(Il),isSupported:_b,canRequest:()=>_b()&&Il.value==="default"&&!t(),hasBeenDismissed:t,markDismissed:n,request:async()=>{if(!_b())return Il.value="unsupported","unsupported";if(Il.value!=="default")return Il.value;try{const m=await window.Notification.requestPermission();return Il.value=m,m==="denied"&&n(),Il.value}catch{return Il.value="unsupported","unsupported"}},refresh:e,notify:(m,a={})=>{if(!_b()||Il.value!=="granted")return null;try{const y=new window.Notification(m,{body:a.body,tag:a.tag,icon:a.icon,badge:a.badge,lang:a.lang,dir:a.dir,requireInteraction:a.requireInteraction,renotify:a.renotify,silent:a.silent,data:a.data}),E=a.requireInteraction?0:a.autoCloseMs===void 0?Moe:a.autoCloseMs,C=E&&E>0?window.setTimeout(()=>y.close(),E):null;return y.onclick=()=>{try{C!==null&&window.clearTimeout(C),window.focus(),a.onClick?.(y.data)}finally{y.close()}},y}catch{return null}}}}const zoe=e=>e.replace(/<[^>]*>/g," ").replace(/!\[[^\]]*\]\([^)]*\)/g," ").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/[#*_`>~|]+/g," ").replace(/\s+/g," ").trim(),Noe=(e,t)=>e.length<=t?e:e.slice(0,Math.max(0,t-1)).trimEnd()+"â¦";function Voe(){const{$i18n:e}=rr(),t=e.t,n=vn(()=>e.locale.value),i=ps(),c=Boe(),h=Yte(),m=Jte("paseet:completion-notifications-enabled",!0),a=(C,P,L)=>{const D=!!P&&P!==Bo.DEFAULT_CHAT_TITLE;if(C)return{title:t("Platform.PaseetNotifications.errorTitle"),body:D?t("Platform.PaseetNotifications.errorBodyWithTitle",{title:P}):t("Platform.PaseetNotifications.errorBodyGeneric")};const V=L?zoe(L):"",U=V?Noe(V,Loe):D?t("Platform.PaseetNotifications.completionBodyWithTitle",{title:P}):t("Platform.PaseetNotifications.completionBodyGeneric");return{title:t("Platform.PaseetNotifications.completionTitle"),body:U}},y=()=>{m.value&&Doe()&&c.canRequest()&&c.request()},E=({sessionId:C,chatTitle:P})=>{const L=Date.now();let D=!1,V=!1,U=C??null,W=U?P:"",$="";return{markStreamed:()=>{D=!0},observeSessionId:fe=>{fe&&!U&&(U=fe)},observeChatTitle:fe=>{fe&&(W=fe)},observeResponseMessage:fe=>{typeof fe=="string"&&fe.trim()&&($=fe)},complete:({isError:fe})=>{if(V||!m.value||c.permission.value!=="granted"||h.value==="visible")return;const ye=Date.now()-L;if(!Ooe({streamed:D,durationMs:ye}))return;V=!0;const ke=a(fe,W,$),Fe=n.value,qe=U,lt=qe?`paseet-completion-${qe}`:`paseet-completion-${L}`;c.notify(ke.title,{body:ke.body,tag:lt,icon:"/images/SEO/maskable-icons/maskable_icon_x192.png",lang:Fe,dir:Fe==="ar"?"rtl":"ltr",requireInteraction:!0,renotify:fe,data:{sessionId:qe,locale:Fe},onClick:pt=>{const Qt=pt,Ht=Qt?.sessionId??qe,zt=Qt?.locale??Fe;Ht&&i.push(`/${zt}/chat/${Ht}`)}})}}};return{enabled:m,permission:c.permission,isSupported:c.isSupported,requestPermission:c.request,maybeRequestPermission:y,startRequest:E}}const _o={CONFIRMATION:"CONFIRMATION",SHARE_CHAT:"SHARE_CHAT",ADD_CHAT_TO_COLLECTION:"ADD_CHAT_TO_COLLECTION",ADD_COLLECTION:"ADD_COLLECTION",EDIT_COLLECTION:"EDIT_COLLECTION",PHONE_VERIFICATION:"PHONE_VERIFICATION",EMAIL_VERIFICATION:"EMAIL_VERIFICATION",REGISTRATION_SUCCESS:"REGISTRATION_SUCCESS",SWAP_COLLECTION:"SWAP_COLLECTION",RESPONSE_FEEDBACK:"RESPONSE_FEEDBACK",UPGRADE_PLAN:"UPGRADE_PLAN",TERMS_AND_CONDITIONS:"TERMS_AND_CONDITIONS",SUPPORT_REQUEST:"SUPPORT_REQUEST",CONTACT_REQUEST:"CONTACT_REQUEST",EDIT_PROPERTY_EXPLORER:"EDIT_PROPERTY_EXPLORER",FREEMIUM_CHAT_LIMIT_WARNING:"FREEMIUM_CHAT_LIMIT_WARNING",ATTACHMENT_PREVIEW:"ATTA
3305CHMENT_PREVIEW",PHOTO_GALLERY:"PHOTO_GALLERY",SEARCH:"SEARCH",GENERATE_CHART:"GENERATE_CHART",DELETE_ACCOUNT:"DELETE_ACCOUNT"},zC=xa("modal",()=>{const e=hn({isOpen:!1,config:null,isTransitioning:!1}),t=hn([]),n=vn(()=>e.value.isOpen),i=vn(()=>e.value.config?.type||null),c=vn(()=>e.value.config?.data||null),h=vn(()=>e.value.config?.closable!==!1),m=vn(()=>e.value.isTransitioning),a=U=>Object.values(_o).includes(U),y=async(U,W=null,$=null,Y=null,X={})=>{if(!a(U))return console.error(`Invalid modal type: ${U}. Valid types are: ${Object.values(_o).join(", ")}`),!1;if(e.value.isTransitioning)return console.warn("Modal is transitioning, queuing modal request"),t.value.push({type:U,data:W,onOpen:$||void 0,onClose:Y||void 0,...X}),!1;try{e.value.isTransitioning=!0,e.value.isOpen&&e.value.config&&await C(),await ts();const K={type:U,data:W,onOpen:$||void 0,onClose:Y||void 0,preventAutoClose:X.preventAutoClose||!1,closable:X.closable!==!1};if(e.value.config=K,e.value.isOpen=!0,K.onOpen)try{K.onOpen()}catch(ne){console.error("Error in modal onOpen callback:",ne)}return!0}catch(K){return console.error("Error opening modal:",K),!1}finally{e.value.isTransitioning=!1,P()}},E=async()=>{if(!e.value.isOpen||e.value.isTransitioning)return!1;try{e.value.isTransitioning=!0;const U=e.value.config;if(U?.onClose)try{U.onClose()}catch(W){console.error("Error in modal onClose callback:",W)}return await ts(),e.value.isOpen=!1,e.value.config=null,!0}catch(U){return console.error("Error closing modal:",U),!1}finally{e.value.isTransitioning=!1,P()}},C=async()=>{e.value.isOpen=!1,e.value.config=null,await ts()},P=async()=>{if(t.value.length>0&&!e.value.isOpen&&!e.value.isTransitioning){const U=t.value.shift();U&&await y(U.type,U.data,U.onOpen,U.onClose,{preventAutoClose:U.preventAutoClose,closable:U.closable})}};return{isOpen:n,currentModal:i,modalData:c,isClosable:h,isTransitioning:m,open:y,close:E,replace:async(U,W=null,$=null,Y=null,X={})=>(t.value=[],await y(U,W,$,Y,X)),clearAll:()=>{t.value=[],e.value.isOpen=!1,e.value.config=null,e.value.isTransitioning=!1},getCurrentModal:()=>({isOpen:e.value.isOpen,type:e.value.config?.type||null,data:e.value.config?.data||null,isClosable:e.value.config?.closable!==!1,isTransitioning:e.value.isTransitioning}),getQueue:()=>t.value,getState:()=>e.value}});var yb=(e=>(e.SIGN_UP_COMPLETE="sign_up_complete",e.SUBSCRIPTION_COMPLETE="subscription_complete",e.START_CHECKOUT="start_checkout",e.VISIT_PRICING="visit_pricing",e))(yb||{}),Fb=(e=>(e.VISITOR="visitor",e.USER="user",e.SUBSCRIBER="subscriber",e))(Fb||{}),zj=(e=>(e.SAR="SAR",e))(zj||{});class Uoe{isDataLayerAvailable(){if(typeof window>"u")return!1;try{return window.dataLayer||(window.dataLayer=[]),Array.isArray(window.dataLayer)}catch{return!1}}pushToDataLayer(t){if(!this.isDataLayerAvailable())return!1;try{return window.dataLayer.push(t),!0}catch{return!1}}trackSignup(t){return this.pushToDataLayer({event:yb.SIGN_UP_COMPLETE,userStatus:Fb.USER,...t})}trackSubscription(t){return this.pushToDataLayer({event:yb.SUBSCRIPTION_COMPLETE,...t})}trackStartCheckout(t){return this.pushToDataLayer({event:yb.START_CHECKOUT,currency:zj.SAR,...t})}trackVisitPricing(t){return this.pushToDataLayer({event:yb.VISIT_PRICING,...t})}}const Tf=new Uoe;var vb={exports:{}},$oe=vb.exports,Qz;function joe(){return Qz||(Qz=1,(function(e,t){(function(n,i){var c="1.0.41",h="",m="?",a="function",y="undefined",E="object",C="string",P="major",L="model",D="name",V="type",U="vendor",W="version",$="architecture",Y="console",X="mobile",K="tablet",ne="smarttv",fe="wearable",ye="embedded",ke=500,Fe="Amazon",qe="Apple",lt="ASUS",pt="BlackBerry",Qt="Browser",Ht="Chrome",zt="Edge",jt="Firefox",Zt="Google",Wt="Honor",en="Huawei",sn="Lenovo",Mn="LG",xn="Microsoft",Vn="Motorola",Ln="Nvidia",Yn="OnePlus",Rn="Opera",$t="OPPO",fn="Samsung",yn="Sharp",Cn="Sony",_n="Xiaomi",Bn="Zebra",Be="Facebook",Xe="Chromium OS",mt="Mac OS",kt=" Browser",Vt=function(zn,cr){var Un={};for(var Ur in zn)cr[Ur]&&cr[Ur].length%2===0?Un[Ur]=cr[Ur].concat(zn[Ur]):Un[Ur]=zn[Ur];return Un},Ie=function(zn){for(var cr={},Un=0;Un<zn.length;Un++)cr[zn[Un].toUpperCase()]=zn[Un];return cr},Ve=function(zn,cr){return typeof zn===C?tt(cr).indexOf(tt(zn))!==-1:!1},tt=function(zn){return zn.toLowerCase()},Rt=function(zn){return typeof zn===C?zn.replace(/[^\d\.]/g,h).split(".")[0]:i},Ut=function(zn,cr){if(typeof zn===C)return zn=zn.replace(/^\s\s*/,h),typeof cr===y?zn:zn.substring(0,ke)},nn=function(zn,cr){for(var Un=0,Ur,ko,Lr,ar,nr,ro;Un<cr.length&&!nr;){var ms=cr[Un],Ks=cr[Un+1];for(Ur=ko=0;Ur<ms.length&&!nr&&ms[Ur];)if(nr=ms[Ur++].exec(zn),nr)for(Lr=0;Lr<Ks.length;Lr++)ro=nr[++ko],ar=Ks[Lr],typeof ar===E&&ar.length>0?ar.length===2?typeof ar[1]==a?this[ar[0]]=ar[1].call(this,ro):this[ar[0]]=ar[1]:ar.length===3?typeof ar[1]===a&&!(ar[1].exec&&ar[1].test)?this[ar[0]]=ro?ar[1].call(this,ro,ar[2]):i:this[ar[0]]=ro?ro.replace(ar[1],ar[2]):i:ar.length===4&&(this[ar[0]]=ro?ar[3].
vendor: 18,480 bytes, line 3305
3305call(this,ro.replace(ar[1],ar[2])):i):this[ar]=ro||i;Un+=2}},st=function(zn,cr){for(var Un in cr)if(typeof cr[Un]===E&&cr[Un].length>0){for(var Ur=0;Ur<cr[Un].length;Ur++)if(Ve(cr[Un][Ur],zn))return Un===m?i:Un}else if(Ve(cr[Un],zn))return Un===m?i:Un;return cr.hasOwnProperty("*")?cr["*"]:zn},Lt={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},mn={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Hn={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[W,[D,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[W,[D,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[D,W],[/opios[\/ ]+([\w\.]+)/i],[W,[D,Rn+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[W,[D,Rn+" GX"]],[/\bopr\/([\w\.]+)/i],[W,[D,Rn]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[W,[D,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[W,[D,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[D,W],[/quark(?:pc)?\/([-\w\.]+)/i],[W,[D,"Quark"]],[/\bddg\/([\w\.]+)/i],[W,[D,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[W,[D,"UC"+Qt]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[W,[D,"WeChat"]],[/konqueror\/([\w\.]+)/i],[W,[D,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[W,[D,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[W,[D,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[W,[D,"Smart Lenovo "+Qt]],[/(avast|avg)\/([\w\.]+)/i],[[D,/(.+)/,"$1 Secure "+Qt],W],[/\bfocus\/([\w\.]+)/i],[W,[D,jt+" Focus"]],[/\bopt\/([\w\.]+)/i],[W,[D,Rn+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[W,[D,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[W,[D,"Dolphin"]],[/coast\/([\w\.]+)/i],[W,[D,Rn+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[W,[D,"MIUI"+kt]],[/fxios\/([\w\.-]+)/i],[W,[D,jt]],[/\bqihoobrowser\/?([\w\.]*)/i],[W,[D,"360"]],[/\b(qq)\/([\w\.]+)/i],[[D,/(.+)/,"$1Browser"],W],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[D,/(.+)/,"$1"+kt],W],[/samsungbrowser\/([\w\.]+)/i],[W,[D,fn+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[W,[D,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[D,"Sogou Mobile"],W],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[D,W],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[D],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[W,D],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[D,Be],W],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[D,W],[/\bgsa\/([\w\.]+) .*safari\//i],[W,[D,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[W,[D,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[W,[D,Ht+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[D,Ht+" WebView"],W],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[W,[D,"Android "+Qt]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[D,W],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[W,[D,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[W,D],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[D,[W,st,Lt]],[/(webkit|khtml)\/([\w\.]+)/i],[D,W],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[D,"Netscape"],W],[/(wolvic|librewolf)\/([\w\.]+)/i],[D,W],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[W,[D,jt+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[D,[W,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[D,[W,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[$,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[$,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[$,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[$,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[$,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[$,/ower/,h,tt]],[/ sun4\w[;\)]/i],[[$,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[$,tt]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[L,[U,fn],[V,K]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[L,[U,fn],[V,X]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[L,[U,qe],[V,X]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[L,[U,qe],[V,K]],[/(macintosh);/i],[L,[U,qe]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[L,[U,yn],[V,X]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[L,[U,Wt],[V,K]],[/honor([-\w ]+)[;\)]/i],[L,[U,Wt],[V,X]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[L,[U,en],[V,K]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[L,[U,en],[V,X]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[L,/_/g," "],[U,_n],[V,K]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[L,/_/g," "],[U,_n],[V,X]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[L,[U,$t],[V,X]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[L,[U,st,{OnePlus:["304","403","203"],"*":$t}],[V,K]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[L,[U,"Vivo"],[V,X]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[L,[U,"Realme"],[V,X]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[L,[U,Vn],[V,X]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[L,[U,Vn],[V,K]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[L,[U,Mn],[V,K]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[L,[U,Mn],[V,X]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[L,[U,sn],[V,K]],[/(nokia) (t[12][01])/i],[U,L,[V,K]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[L,/_/g," "],[V,X],[U,"Nokia"]],[/(pixel (c|tablet))\b/i],[L,[U,Zt],[V,K]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[L,[U,Zt],[V,X]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[L,[U,Cn],[V,X]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[L,"Xperia Tablet"],[U,Cn],[V,K]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[L,[U,Yn],[V,X]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[L,[U,Fe],[V,K]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[L,/(.+)/g,"Fire Phone $1"],[U,Fe],[V,X]],[/(playbook);[-\w\),; ]+(rim)/i],[L,U,[V,K]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[L,[U,pt],[V,X]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[L,[U,lt],[V,K]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[L,[U,lt],[V,X]],[/(nexus 9)/i],[L,[U,"HTC"],[V,K]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[U,[L,/_/g," "],[V,X]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[L,[U,"TCL"],[V,K]],[/(itel) ((\w+))/i],[[U,tt],L,[V,st,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[L,[U,"Acer"],[V,K]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[L,[U,"Meizu"],[V,X]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[L,[U,"Ulefone"],[V,X]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[L,[U,"Energizer"],[V,X]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[L,[U,"Cat"],[V,X]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[L,[U,"Smartfren"],[V,X]],[/droid.+; (a(?:015|06[35]|142p?))/i],[L,[U,"Nothing"],[V,X]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[L,[U,"Archos"],[V,K]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[L,[U,"Archos"],[V,X]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[U,L,[V,K]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[U,L,[V,X]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[U,L,[V,K]],[/(surface duo)/i],[L,[U,xn],[V,K]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[L,[U,"Fairphone"],[V,X]],[/(u304aa)/i],[L,[U,"AT&T"],[V,X]],[/\bsie-(\w*)/i],[L,[U,"Siemens"],[V,X]],[/\b(rct\w+) b/i],[L,[U,"RCA"],[V,K]],[/\b(venue[\d ]{2,7}) b/i],[L,[U,"Dell"],[V,K]],[/\b(q(?:mv|ta)\w+) b/i],[L,[U,"Verizon"],[V,K]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[L,[U,"Barnes & Noble"],[V,K]],[/\b(tm\d{3}\w+) b/i],[L,[U,"NuVision"],[V,K]],[/\b(k88) b/i],[L,[U,"ZTE"],[V,K]],[/\b(nx\d{3}j) b/i],[L,[U,"ZTE"],[V,X]],[/\b(gen\d{3}) b.+49h/i],[L,[U,"Swiss"],[V,X]],[/\b(zur\d{3}) b/i],[L,[U,"Swiss"],[V,K]],[/\b((zeki)?tb.*\b) b/i],[L,[U,"Zeki"],[V,K]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[U,"Dragon Touch"],L,[V,K]],[/\b(ns-?\w{0,9}) b/i],[L,[U,"Insignia"],[V,K]],[/\b((nxa|next)-?\w{0,9}) b/i],[L,[U,"NextBook"],[V,K]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[U,"Voice"],L,[V,X]],[/\b(lvtel\-)?(v1[12]) b/i],[[U,"LvTel"],L,[V,X]],[/\b(ph-1) /i],[L,[U,"Essential"],[V,X]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[L,[U,"Envizen"],[V,K]],[/\b(trio[-\w\. ]+) b/i],[L,[U,"MachSpeed"],[V,K]],[/\btu_(1491) b/i],[L,[U,"Rotor"],[V,K]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[L,[U,Ln],[V,K]],[/(sprint) (\w+)/i],[U,L,[V,X]],[/(kin\.[onetw]{3})/i],[[L,/\./g," "],[U,xn],[V,X]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[L,[U,Bn],[V,K]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[L,[U,Bn],[V,X]],[/smart-tv.+(samsung)/i],[U,[V,ne]],[/hbbtv.+maple;(\d+)/i],[[L,/^/,"SmartTV"],[U,fn],[V,ne]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[U,Mn],[V,ne]],[/(apple) ?tv/i],[U,[L,qe+" TV"],[V,ne]],[/crkey/i],[[L,Ht+"cast"],[U,Zt],[V,ne]],[/droid.+aft(\w+)( bui|\))/i],[L,[U,Fe],[V,ne]],[/(shield \w+ tv)/i],[L,[U,Ln],[V,ne]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[L,[U,yn],[V,ne]],[/(bravia[\w ]+)( bui|\))/i],[L,[U,Cn],[V,ne]],[/(mi(tv|box)-?\w+) bui/i],[L,[U,_n],[V,ne]],[/Hbbtv.*(technisat) (.*);/i],[U,L,[V,ne]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[U,Ut],[L,Ut],[V,ne]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[L,[V,ne]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[V,ne]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[U,L,[V,Y]],[/droid.+; (shield)( bui|\))/i],[L,[U,Ln],[V,Y]],[/(playstation \w+)/i],[L,[U,Cn],[V,Y]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[L,[U,xn],[V,Y]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[L,[U,fn],[V,fe]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[U,L,[V,fe]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[L,[U,$t],[V,fe]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[L,[U,qe],[V,fe]],[/(opwwe\d{3})/i],[L,[U,Yn],[V,fe]],[/(moto 360)/i],[L,[U,Vn],[V,fe]],[/(smartwatch 3)/i],[L,[U,Cn],[V,fe]],[/(g watch r)/i],[L,[U,Mn],[V,fe]],[/droid.+; (wt63?0{2,3})\)/i],[L,[U,Bn],[V,fe]],[/droid.+; (glass) \d/i],[L,[U,Zt],[V,fe]],[/(pico) (4|neo3(?: link|pro)?)/i],[U,L,[V,fe]],[/; (quest( \d| pro)?)/i],[L,[U,Be],[V,fe]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[U,[V,ye]],[/(aeobc)\b/i],[L,[U,Fe],[V,ye]],[/(homepod).+mac os/i],[L,[U,qe],[V,ye]],[/windows iot/i],[[V,ye]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[L,[V,X]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[L,[V,K]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[V,K]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[V,X]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[L,[U,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[W,[D,zt+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[D,W],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[W,[D,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[D,W],[/ladybird\//i],[[D,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[W,D]],os:[[/microsoft (windows) (vista|xp)/i],[D,W],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[D,[W,st,mn]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[W,st,mn],[D,"Windows"]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[W,/_/g,"."],[D,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[D,mt],[W,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[W,D],[/(ubuntu) ([\w\.]+) like android/i],[[D,/(.+)/,"$1 Touch"],W],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[D,W],[/\(bb(10);/i],[W,[D,pt]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[W,[D,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[W,[D,jt+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[W,[D,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[W,[D,"watchOS"]],[/crkey\/([\d\.]+)/i],[W,[D,Ht+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[D,Xe],W],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[D,W],[/(sunos) ?([\w\.\d]*)/i],[[D,"Solaris"],W],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[D,W]]},ir=function(zn,cr){if(typeof zn===E&&(cr=zn,zn=i),!(this instanceof ir))return new ir(zn,cr).getResult();var Un=typeof n!==y&&n.navigator?n.navigator:i,Ur=zn||(Un&&Un.userAgent?Un.userAgent:h),ko=Un&&Un.userAgentData?Un.userAgentData:i,Lr=cr?Vt(Hn,cr):Hn,ar=Un&&Un.userAgent==Ur;return this.getBrowser=function(){var nr={};return nr[D]=i,nr[W]=i,nn.call(nr,Ur,Lr.browser),nr[P]=Rt(nr[W]),ar&&Un&&Un.brave&&typeof Un.brave.isBrave==a&&(nr[D]="Brave"),nr},this.getCPU=function(){var nr={};return nr[$]=i,nn.call(nr,Ur,Lr.cpu),nr},this.getDevice=function(){var nr={};return nr[U]=i,nr[L]=i,nr[V]=i,nn.call(nr,Ur,Lr.device),ar&&!nr[V]&&ko&&ko.mobile&&(nr[V]=X),ar&&nr[L]=="Macintosh"&&Un&&typeof Un.standalone!==y&&Un.maxTouchPoints&&Un.maxTouchPoints>2&&(nr[L]="iPad",nr[V]=K),nr},this.getEngine=function(){var nr={};return nr[D]=i,nr[W]=i,nn.call(nr,Ur,Lr.engine),nr},this.getOS=function(){var nr={};return nr[D]=i,nr[W]=i,nn.call(nr,Ur,Lr.os),ar&&!nr[D]&&ko&&ko.platform&&ko.platform!="Unknown"&&(nr[D]=ko.platform.replace(/chrome os/i,Xe).replace(/macos/i,mt)),nr},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Ur},this.setUA=function(nr){return Ur=typeof nr===C&&nr.length>ke?Ut(nr,ke):nr,this},this.setUA(Ur),this};ir.VERSION=c,ir.BROWSER=Ie([D,W,P]),ir.CPU=Ie([$]),ir.DEVICE=Ie([L,U,V,Y,X,ne,K,fe,ye]),ir.ENGINE=ir.OS=Ie([D,W]),e.exports&&(t=e.exports=ir),t.UAParser=ir;var hr=typeof n!==y&&(n.jQuery||n.Zepto);if(hr&&!hr.ua){var Sr=new ir;hr.ua=Sr.getResult(),hr.ua.get=function(){return Sr.getUA()},hr.ua.set=function(zn){Sr.setUA(zn);var cr=Sr.getResult();for(var Un in cr)hr.ua[Un]=cr[Un]}}})(typeof window=="object"?window:$oe)}
3305)(vb,vb.exports)),vb.exports}var Goe=joe();const Hoe=Iy(Goe),Woe=()=>{const e=Yf(),t=new Hoe,n=()=>t.getDevice().model||"unknown",i=()=>e?.isAuthenticated?e?.user?.plan?.isFree?Fb.USER:Fb.SUBSCRIBER:Fb.VISITOR;return{trackSignup:Tf.trackSignup.bind(Tf),trackSubscription:Tf.trackSubscription.bind(Tf),trackStartCheckout:Tf.trackStartCheckout.bind(Tf),trackVisitPricing:Tf.trackVisitPricing.bind(Tf),getUserStatus:i,getDeviceModel:n}},qoe=()=>{const e=zC(),{trackVisitPricing:t,getUserStatus:n,getDeviceModel:i}=Woe(),c=Yf();return{openUpgradePlanModal:async()=>{await e.open(_o.UPGRADE_PLAN,null,()=>{t({userId:c?.user?.id,userStatus:n(),deviceModel:i()})})}}};function Xoe(){const{$axios:e,$logger:t}=rr(),n=new Map;return{fetchEnrichments:(h,m,a,y)=>{if(!h||!m?.length||n.has(h))return;const E=new Set(m.map(L=>L.type)),C=new AbortController;n.set(h,C);let P=0;e.get(`/enrichments/${h}`,{signal:C.signal,onDownloadProgress:L=>{const D=L.event?.target?.response;if(!D)return;const V=D.split(` 3306 3307`);for(;P<V.length-1;){const U=V[P++].split(` 3308`).find(W=>W.startsWith("data:"));if(U)try{const W=JSON.parse(U.substring(5).trim());if(W.type==="complete")continue;W.data!==void 0&&W.data!==null&&(E.delete(W.type),a(W.type,W.data))}catch{}}}}).catch(L=>{L?.code!=="ERR_CANCELED"&&t?.warn?.(`[enrichments] stream failed for ${h}: ${L?.message}`)}).finally(()=>{n.delete(h),y?.([...E])})},cancelEnrichments:()=>{n.forEach(h=>h.abort()),n.clear()}}}const Zoe=xa("chats",()=>{const{$axios:e,$logger:t,$i18n:n}=rr(),i=ps(),c=vn(()=>n.locale.value),h=n.t,m=Ox(),a=Y6(),y=Yf(),E=zC(),{fetchEnrichments:C,cancelEnrichments:P}=Xoe(),{openUpgradePlanModal:L}=qoe(),D=hj(),V=xie(),U=Bj(),W=hn(!1),$=hn(!1),Y=hn([]),X=hn(null),K=hn(null),ne=hn(null),fe=hn(0),ye=hn(!0),ke=hn(!1),Fe=hn("ok"),qe=hn(null),lt=hn([]),pt=()=>{Fe.value="insufficient"},Qt=(Le,yt,Ot,qt,cn)=>{qe.value={originalRequest:Le,fingerprint:yt,kind:Ot,title:qt,message:cn},Fe.value="warning_pending"},Ht=()=>{Fe.value="ok",qe.value=null,lt.value=[]},zt=()=>{Fe.value="ok",qe.value=null},jt=Le=>{lt.value.includes(Le)||(lt.value=[...lt.value,Le])},Zt=()=>{lt.value=[]},Wt=Le=>{const yt=Array.from(new Set([...lt.value,...Le??[]]));return yt.length>0?yt:void 0},en=()=>{sn.value[sn.value.length-1]?.role===Db.USER&&sn.value.pop()};qr(X,Ht);const sn=hn([]),Mn=hn(!1),xn=hn(!1),Vn=hn(!1),Ln=hn(""),Yn=hn(""),Rn=20,{chatRenamedBus:$t}=dj(),fn=Voe(),yn=()=>localStorage.getItem(vz)==="true",Cn=()=>{localStorage.setItem(vz,"true")},_n=async(Le=!0)=>{Le&&(W.value=!0,fe.value=0,ye.value=!0);try{const yt=Le?0:fe.value,Ot=await e.get(`/chat/latest?limit=${Rn}&offset=${yt}`);if(Ot.status!==200)return;const qt=Ot.data.data;Le?(Y.value=qt,fe.value=Rn):(Y.value.push(...qt),fe.value+=qt.length)}catch(yt){console.error("Error fetching recent chats:",yt)}finally{Le&&(W.value=!1)}},Bn=async()=>{if(!($.value||!ye.value)){$.value=!0;try{const Le=await e.get(`/chat/latest?limit=${Rn}&offset=${fe.value}`);if(Le.status===404){ye.value=!1;return}if(Le.status!==200)return;const yt=Le.data.data;Y.value.push(...yt),fe.value+=yt.length}catch(Le){console.error("Error fetching more chats:",Le)}finally{$.value=!1}}},Be=()=>!y.hasPermission(wh.PASEET_FULL_HISTORY),Xe=Le=>{Y.value.unshift(Le),Be()&&Y.value.length>UI&&Y.value.splice(UI)},mt=Le=>{const yt=Y.value.findIndex(qt=>qt.chat_id===Le);if(yt<=0)return;const Ot=Y.value.splice(yt,1)[0];Ot.updated_at=new Date().toISOString(),Y.value.unshift(Ot)},kt=()=>X.value===null&&Y.value.length>=UI&&Be()&&!yn(),Vt=Le=>{const yt=Y.value[Y.value.length-1]?.title??h("Platform.modals.freemiumChatLimitWarning.oldestFallback");E.open(_o.FREEMIUM_CHAT_LIMIT_WARNING,{oldestTitle:yt,onConfirm:async()=>{Cn(),await Le()},onUpgrade:async()=>{await L()}})},Ie=Le=>Le.trim()?Le.length>50?(Gr.showError(m,h("Platform.toasts.rename.too_long")),!1):!0:(Gr.showError(m,h("Platform.toasts.rename.empty")),!1),Ve=async(Le,yt)=>{if(!Ie(yt))return{success:!1,message:"Invalid title"};try{if((await e.post(`/chat/rename/${Le}`,{new_title:yt})).status===200){const qt=Y.value.findIndex(cn=>cn.chat_id===Le);if(qt!==-1){Y.value[qt].title=yt,Y.value[qt].updated_at=new Date().toISOString();const cn=Y.value.splice(qt,1)[0];Y.value.unshift(cn)}return $t.emit({chatId:Le,newTitle:yt}),Gr.showSuccess(m,h("Platform.toasts.rename.success")),{success:!0}}else return Gr.showError(m,h("Platform.toasts.rename.error")),{success:!1,message:"Failed to rename chat"}}catch(Ot){return console.error("Error renaming chat:",Ot),Gr.showError(m,h("Platform.toasts.rename.error")),{success:!1,message:"Failed to rename chat"}}},tt=async Le=>{try{if((await e.delete(`/chat/${Le}`)).status===200){Gr.showSuccess(m,h("Platform.toasts.delete.success"));const Ot=Y.value.findIndex(cn=>cn.chat_id===Le);Y.value.splice(Ot,1);const qt=a.findChatInCollections(Le)?.id;return qt&&await a.removeChatFromCollection(qt,Le,!1),!0}else return Gr.showError(m,h("Platform.toasts.delete.error")),!1}catch(yt){return console.error("Error deleting chat:",yt),Gr.showError(m,h("Platform.toasts.delete.error")),!1}},Rt=async Le=>{if(Le)try{const yt=await e.get(`/collections/${Le}`),Ot=yt.data.data;return yt.status!==200?void 0:Ot.title}catch(yt){console.error("Error fetching collection title:",yt);return}},Ut=async Le=>{if(!Le){Ln.value="",Yn.value="";return}xn.value=!0;try{const yt=await e.get(`/chat/get/${Le}`);if(yt.status!==200){xn.value=!1,i.push(`/${c.value}/chat`);return}const Ot=yt.data.data;sn.value=Ot.conversation_turns,Ln.value=Ot.chat_title??Bo.DEFAULT_CHAT_TITLE,Yn.value=Ot.collection_id&&await Rt(Ot.collection_id)||"",X.value=Le}catch(yt){console.error("Error fetching messages:",yt),i.push(`/${c.value}/chat`)}finally{xn.value=!1}},nn=()=>{P(),sn.value=[],Ln.value="",Yn.value="",Ht()},st=async Le=>{Yn.value=await Rt(Le)||""},Lt=async Le=>{if(!Le?.trim())throw new Error(h(Wc.SOMETHING_WRONG));if(Mn.value)throw new Error(h(Wc.SOMETHING_WRONG));return await yie()},mn=(Le,yt,Ot,qt,cn,ht,ln)=>({prompt:Le,lang:c.value,session_id:yt,withLocation:Bo.ENABLE_LOCATION,allowTablesInMsg:
3308Bo.ENABLE_TABLES_IN_MSG,allowResultTablesInMsg:Bo.ENABLE_RESULT_TABLES_IN_MSG,allowChartUrlInMsg:Bo.ENABLE_CHART_URL_IN_MSG,allowMapVisualization:Bo.ENABLE_MAP_VISUALIZATION,allowWidgetsInMsg:Bo.ENABLE_WIDGETS_IN_MSG,isConsultant:Ot?.isConsultant,disableAutoConsultant:Ot?.disableAutoConsultant,reasoningEffort:Ot?.reasoningEffort,acknowledgedWarnings:Ot?.acknowledgedWarnings,attachments:qt,polygon:cn,highlightedContext:ht,mentions:ln?.mentions,tappedChip:ln?.tappedChip,command:ln?.command}),Hn=Le=>{const yt=sn.value.length===0||Ln.value===Bo.DEFAULT_CHAT_TITLE,Ot={prompt:Le.prompt,lang:Le.lang,withTitle:yt,session_id:Le.session_id?Le.session_id:null,withLocation:Bo.ENABLE_LOCATION,allowTablesInMsg:Bo.ENABLE_TABLES_IN_MSG,allowResultTablesInMsg:Bo.ENABLE_RESULT_TABLES_IN_MSG,allowChartUrlInMsg:Bo.ENABLE_CHART_URL_IN_MSG,allowMapVisualization:Bo.ENABLE_MAP_VISUALIZATION,allowWidgetsInMsg:Bo.ENABLE_WIDGETS_IN_MSG,reasoningEffort:Le.reasoningEffort,isConsultant:Le.isConsultant,disableAutoConsultant:Le.disableAutoConsultant,acknowledgedWarnings:Wt(Le.acknowledgedWarnings),attachments:Le.attachments,polygon:Le.polygon,highlightedContext:Le.highlightedContext,mentions:Le.mentions,tappedChip:Le.tappedChip,command:Le.command,supportWarnings:!0};return Le.session_id&&(Ot.session_id=Le.session_id),{userRequest:Ot}},ir=Le=>({role:Db.USER,prompt:Le.prompt,uuid:void 0,created_at:new Date().toISOString(),assistant_responses:[],events:[],attachments:Le.attachments,polygon:Le.polygon??void 0,highlightedContext:Le.highlightedContext,status:$T.LOADING}),hr=(Le,yt,Ot)=>{if(sn.value.length===0)return;const qt=sn.value[sn.value.length-1],cn={original_uuid:Le.uuid||"",multi_model_index:Ot||0,versions:[{version:0,assistant_message:Le,created_at:Le.created_at}],allow_regenerate:Le.allow_regenerate};qt.assistant_responses.push(cn),Le.charts&&Le.charts.length>0&&ts(()=>{V.setContext({messageUuid:Le.uuid,existingCharts:Le.charts||[],onChartGenerated:ht=>{ud(Le.uuid,ht)},onChartFeedbackUpdated:(ht,ln)=>{Sc(Le.uuid,ht,ln)}}),D.open("chart")}),!qt.uuid&&yt&&(qt.uuid=yt)},Sr=Le=>{Le.timestamp=new Date().toISOString(),sn.value[sn.value.length-1].events?.push(Le)},zn=Le=>{Le.timestamp=new Date().toISOString(),sn.value[sn.value.length-1].events?.push(Le)},cr=()=>{const Le=sn.value[sn.value.length-1];Le&&(Le.status=$T.COMPLETED)},Un=Le=>{if(!Le||typeof Le!="string")return;const yt={chat_id:Le,title:Ln.value,request_source:xR.PASEET_PLATFORM};Xe(yt),St(Le)},Ur=()=>{const Le=X.value;if(Le){const yt={chatId:Le,newTitle:Ln.value};$t.emit(yt)}},ko=Le=>{switch(Le){case F_.PROMPTS:return ke.value=!0,{type:gb.ACCOUNT_CREDIT_EXCEEDED,creditTypeKey:Le};case F_.CHARTS:case F_.CONSULTANT_QUICK:case F_.CONSULTANT_BALANCED:case F_.CONSULTANT_DEEP:return{type:gb.FEATURE_CREDIT_EXCEEDED,creditTypeKey:Le};default:return{type:gb.PROMPTS_CREDIT_EXCEEDED,creditTypeKey:Le}}},Lr=Le=>{ts(()=>{Le&&U.showVisualizationData(Le[0])})},ar=(Le,yt,Ot)=>{if(Le.responses){Le.responses.forEach(ht=>{ar(ht,yt,Ot)});return}const qt={...Le},cn=HI(qt);hr(cn,yt,Ot),qt.visualizations&&qt.visualizations.length>0&&Lr(qt.visualizations),cn.uuid&&Ks(cn.uuid,Le.enrichments),(Ln.value===Bo.DEFAULT_CHAT_TITLE||!Ln.value)&&Le.chat_title&&(Ln.value=Le.chat_title||Bo.DEFAULT_CHAT_TITLE,Ur())},nr=Le=>{const yt=sn.value[sn.value.length-1];yt?.events&&(yt.events=yt.events.filter(Ot=>!(Ot.type===kf.PROGRESS&&Ot.response_id===Le)))},ro=async(Le,yt)=>{const Ot=sn.value.length===1,qt=fn.startRequest({sessionId:Le.session_id,chatTitle:Ln.value});let cn=!1;const{sendMessage:ht}=wie({axiosInstance:e,endpoint:"/ask"},{onProgress:ln=>{qt.markStreamed(),Sr(ln)},onReasoning:ln=>{qt.markStreamed(),zn(ln)},onChunk:(ln,Kn,Hr)=>{qt.markStreamed(),qt.observeSessionId(Kn),qt.observeChatTitle(ln?.chat_title),qt.observeResponseMessage(ln?.msg),ar(ln,Kn,Hr),Hr!==void 0&&nr(Hr)},onSuggestions:ln=>{ms(ln.log_uuid,ln.suggestions)},onResponse:(ln,Kn,Hr)=>{qt.observeSessionId(Kn),qt.observeChatTitle(ln?.chat_title),qt.observeResponseMessage(ln?.msg),ar(ln,Kn,Hr)},onError:(ln,Kn,Hr)=>{let ti;cn=!0;const On=Hr??{},br=On.data??On,si=On.errorKind??On.data?.errorKind,bi=On.creditTypeKey??On.data?.creditTypeKey;if(ln===409&&si===wR.TOKEN_CONSUMPTION_WARNING){const ni=On.title??On.data?.title,xi=On.message??On.data?.message;Qt(Le,yt,wR.TOKEN_CONSUMPTION_WARNING,ni,xi),cr(),qt.complete({isError:!1});return}ln===402&&si==="insufficient_tokens"?(pt(),ti={type:gb.ACCOUNT_CREDIT_EXCEEDED}):ln===402&&bi&&(ti=ko(bi));const Pr=HI({results:[],has_more:!1,msg:Kn,uuid:br?.uuid||"",allow_regenerate:!1,session_id:br?.session_id||X.value||null,detected_lang:br?.detected_lang},ti);if(hr(Pr),Ot&&br?.session_id&&typeof br.session_id=="string"){Ln.value=Bo.DEFAULT_CHAT_TITLE;const ni={chat_id:br.session_id,title:Ln.value,request_source:xR.PASEET_PLATFORM};Xe(ni),St(br.session_id)}cr(),qt.complete({isError:!0})},onFirstMessage:(ln,Kn)=>{qt.observeSessionId(ln),Ln.value=Kn||Bo.DEFAULT_CHAT_TITLE,Kn&&qt.observeChatTitle(Kn),Un(ln)},onTitleUpdate:ln=>{qt.observeChatTitle(ln),(Ln.value===Bo.DEFAULT_CHAT_TITLE||!Ln.value)&&(Ln.value=ln||Bo.DEFAULT_CHAT_TITLE,Ur())},onComplete:()=>{cr(),qt.complete({isError:!1}),cn||zt()}});try{await ht(Le,{enableStreaming:Bo.ENABLE_STREAM,fingerprint:yt},Ot)}catch(ln){fu(ln),qt.complete({isError:!0})}},ms=(Le,yt)=>{hu(Le,"suggestions",yt)},Ks=(Le,yt,Ot="loading")=>{yt?.length&&(Js(Le,Object.fromEntries(yt.map(qt=>[qt.type,Ot]))),C(Le,yt,(qt,cn)=>{hu(Le,qt,cn),Js(Le,{[qt]:void 0})},qt=>Js(Le,Object.fromEntries(qt.map(cn=>[cn,"failed"])))))},xc=Le=>{const yt=wc(Le);if(!yt)return;const Ot=(yt.enrichments??[]).filter(qt=>yt.enrichmentStatus?.[qt.type]==="failed");Ks(Le,Ot,"retrying")},wc=Le=>{for(const yt of sn.value)for(const Ot of yt.assistant_responses)for(const qt of Ot.versions)if(qt.assistant_message.uuid===Le)return qt.assistant_message;return null},Js=(Le,yt)=>{const Ot=wc(Le);Ot&&(Ot.enrichmentStatus={...Ot.enrichmentStatus??{},...yt})},hu=(Le,yt,Ot)=>
3308{const qt=wc(Le);qt&&(qt[yt]=Ot)},ud=(Le,yt)=>{for(const Ot of sn.value)for(const qt of Ot.assistant_responses)for(const cn of qt.versions)if(cn.assistant_message.uuid===Le){const ht={chart_uuid:yt.chart_uuid,page_number:1,custom_request:yt.custom_request||"",explanation:yt.explanation,chart_url:yt.chartUrl,chart_config:yt.chartConfig,is_helpful:null,created_at:new Date().toISOString()};return cn.assistant_message.charts||(cn.assistant_message.charts=[]),cn.assistant_message.charts.push(ht),ht}return null},Sc=(Le,yt,Ot)=>{for(const qt of sn.value)for(const cn of qt.assistant_responses)for(const ht of cn.versions)if(ht.assistant_message.uuid===Le&&ht.assistant_message.charts){const ln=ht.assistant_message.charts.findIndex(Kn=>Kn.chart_uuid===yt);if(ln!==-1)return ht.assistant_message.charts[ln]={...ht.assistant_message.charts[ln],is_helpful:Ot},!0}return!1},fu=Le=>{console.error("Error sending message",Le);const yt=HI({results:[],has_more:!1,msg:h(Wc.SOMETHING_WRONG),uuid:"",allow_regenerate:!1,session_id:X.value||null});hr(yt),cr()},Eh=async(Le,yt=null,Ot,qt,cn,ht,ln,Kn)=>{if(kt()){Vt(()=>Eh(Le,yt,Ot,qt,cn,ht,ln,Kn));return}ln?.();try{const Hr=await Lt(Le);Mn.value=!0,X.value&&mt(X.value);const ti=mn(Le,X.value,Ot,qt,cn,ht,Kn),{userRequest:On}=Hn(ti);fn.maybeRequestPermission();const br=ir(ti);sn.value.push(br),await ro(On,Hr),yt&&X.value&&await a.addChatToCollection(yt,X.value)}catch(Hr){fu(Hr)}finally{Mn.value=!1}},pu=async(Le,yt)=>{try{Mn.value=!0;const Ot=sn.value[sn.value.length-1];Ot?.role===Db.USER&&(Ot.events&&(Ot.events=[]),Ot.assistant_responses&&(Ot.assistant_responses=[]),Ot.status=$T.LOADING);const qt={...Le,supportWarnings:!0,acknowledgedWarnings:Wt(Le.acknowledgedWarnings)};await ro(qt,yt)}catch(Ot){fu(Ot)}finally{Mn.value=!1}},St=Le=>{X.value=Le;const yt=`/${c.value}/chat/${Le}`;window.history.pushState({},"",yt)},dl=async(Le,yt=!0)=>{X.value!==Le&&(yt?(X.value=Le,i.push(`/${c.value}/chat/${Le}`),await Ut(Le)):St(Le))},Nl=()=>{nn(),X.value=null;const Le=`/${c.value}/chat`;window.history.replaceState({},"",Le),i.replace(Le)},Tc=()=>{X.value=null},mu=(Le,yt=!1)=>{K.value===Le||yt?K.value=null:K.value=Le},Ge=(Le,yt=!1)=>{ne.value===Le||yt?ne.value=null:ne.value=Le},ie=()=>{K.value=null},ae=()=>{ne.value=null},ge=Le=>{if(!Le||W.value||$.value)return;Le.scrollHeight-Le.scrollTop<=Le.clientHeight+20&&Bn()},Pe=(Le,yt)=>{const Ot=Y.value.findIndex(qt=>qt.chat_id===Le);if(Ot!==-1){Y.value[Ot].title=yt,Y.value[Ot].updated_at=new Date().toISOString();const qt=Y.value.splice(Ot,1)[0];Y.value.unshift(qt)}},Me=()=>{$t.on(Le=>{Pe(Le.chatId,Le.newTitle)})},Oe=()=>{$t.off(Le=>{Pe(Le.chatId,Le.newTitle)})},Je=Le=>Y.value.find(yt=>yt.chat_id===Le),Ee=Le=>K.value===Le,We=Le=>ne.value===Le,Et=Le=>X.value===Le,vt=()=>{Oe(),W.value=!1,$.value=!1,Y.value=[],X.value=null,K.value=null,ne.value=null,fe.value=0,ye.value=!0,ke.value=!1,Ht(),sn.value=[],Mn.value=!1,xn.value=!1,Vn.value=!1,Ln.value="",Yn.value=""};return{requestEnrichments:Ks,retryEnrichments:xc,isLoading:W,isLoadingMore:$,recentChats:Y,selectedChatId:X,openedDropdownChatId:K,collectionsDropdownChatId:ne,moreChats:ye,isCreditExceeded:ke,tokenState:Fe,pendingWarning:qe,sessionAcknowledgedWarnings:lt,setTokenInsufficient:pt,setTokenWarningPending:Qt,clearTokenState:zt,acknowledgeSessionWarning:jt,clearSessionAcknowledgedWarnings:Zt,popLastUserTurn:en,executeWithSessionAcks:pu,handleCreditExceededError:ko,messages:sn,isChatLoading:Mn,isFetching:xn,isLimitExceeded:Vn,chatTitle:Ln,collectionTitle:Yn,fetchRecentChats:_n,fetchMoreChats:Bn,addNewChat:Xe,renameChat:Ve,selectChatAndRedirect:dl,toggleDropdown:mu,toggleCollectionsDropdown:Ge,closeDropdown:ie,closeCollectionsDropdown:ae,handleScroll:ge,setupEventListeners:Me,cleanupEventListeners:Oe,handleNewChat:Nl,deleteChat:tt,clearSelectedChat:Tc,fetchMessages:Ut,clearChat:nn,updateCollectionTitle:st,sendMessage:Eh,getChatById:Je,isDropdownOpen:Ee,isCollectionsDropdownOpen:We,isChatSelected:Et,validateTitle:Ie,handleChartGenerated:ud,handleChartFeedbackUpdated:Sc,completionNotificationsEnabled:fn.enabled,desktopNotificationPermission:vn(()=>fn.permission.value),requestDesktopNotificationPermission:fn.requestPermission,desktopNotificationsSupported:fn.isSupported,resetStore:vt}}),Yoe=xa("propertyExplorer",()=>{const{$axios:e,$i18n:t}=rr(),n=t.t,i=Ox(),c=hn([]),h=hn(!1),m=hn(0),a=hn(1),y=12,E=hn(""),C=hn("recent"),P=async(Y=1)=>{h.value=!0;try{const X=await e.get("/property-explorer",{params:{page:Y,per_page:y,search:E.value||void 0,sort:C.value}});if(X.status===200){const K=X.data.data;c.value=K.jobs,m.value=K.total,a.value=K.page}}catch(X){console.error(X)}finally{h.value=!1}},L=async(Y,X)=>{try{const K=await e.patch(`/property-explorer/${Y}`,X);if(K.status===200){const ne=K.data.data;return c.value=c.value.map(fe=>fe.id===Y?{...fe,...ne,total_matches:fe.total_matches}:fe),{ok:!0}}return K.data?.data?.errorKind==="active_job_limit"?(Gr.showError(i,n("Platform.propertyExplorer.toasts.activeLimit",{limit:K.data.data.limit??5})),{ok:!1,limitReached:!0}):(Gr.showError(i),{ok:!1})}catch(K){return console.error(K),Gr.showError(i),{ok:!1}}};return{jobs:c,isLoading:h,total:m,page:a,perPage:y,search:E,sort:C,fetchJobs:P,updateJob:L,deleteJob:async Y=>{try{return(await e.delete(`/property-explorer/${Y}`)).status===200?(c.value=c.value.filter(K=>K.id!==Y),m.value=Math.max(0,m.value-1),Gr.showSuccess(i,n("Platform.propertyExplorer.deleteModal.success")),!0):(Gr.showError(i,n("Platform.propertyExplorer.deleteModal.error")),!1)}catch(X){return console.error(X),Gr.showError(i,n("Platform.propertyExplorer.deleteModal.error")),!1}},toggleJobStatus:async Y=>{const X=c.value.find(fe=>fe.id===Y);if(!X)return!1;const K=X.status==="active"?"paused":"active",ne=await L(Y,{status:K});if(ne.ok){const fe=K==="paused"?"Platform.propertyExplorer.toasts.pauseSuccess":"Platform.propertyExplorer.toasts.resumeSuccess";Gr.showSuccess(i,n(fe))}return ne.ok},setSearch:Y=>{E.value=Y,P(1)},setSort:Y=>{C.value=Y,P(1)},resetStore:()=>{c.value=[],h.value=!1,m.value=0,a.value=1,E.value="",C.value="recent"}}}),Nj=xa("platformNotifications",()=>{const{$axios:e}=rr(),t=hn(null);let n=null,i=!1;const c=()=>
3308{if(typeof window>"u"||i)return;i=!0,n=new AbortController;let a=0,y="";e.get("/notifications/stream",{signal:n.signal,onDownloadProgress:E=>{const C=E.event?.target?.response;if(!C)return;const P=C.substring(a);if(!P)return;y+=P,a=C.length;const L=y.split(` 3309 3310`);y=L.pop()||"";for(const D of L){const V=D.split(` 3311`).find(U=>U.startsWith("data:"));if(V)try{const U=JSON.parse(V.substring(5).trim());if(!U.type)continue;t.value={type:U.type,payload:U}}catch{}}}}).catch(E=>{E?.code!=="ERR_CANCELED"&&(i=!1)})},h=()=>{n&&(n.abort(),n=null),i=!1};return{lastEvent:t,connectSSE:c,disconnectSSE:h,resetStore:()=>{t.value=null,h()}}}),Koe="property_explorer_notification",Joe=xa("propertyExplorerNotifications",()=>{const{$axios:e}=rr(),t=Nj(),n=hn([]),i=hn(0),c=hn(!1),h=hn(0),m=hn(1),a=hn(!1);qr(()=>t.lastEvent,D=>{!D||D.type!==Koe||D.payload.unreadCount!==void 0&&(i.value=D.payload.unreadCount)});const y=async()=>{try{const D=await e.get("/property-explorer/notifications/unread-count");D.status===200&&(i.value=D.data.data.count)}catch{}},E=async(D=1)=>{c.value=!0;try{const V=await e.get("/property-explorer/notifications",{params:{page:D,per_page:20,unread_only:a.value?"true":void 0}});if(V.status===200){const U=V.data.data;D===1?n.value=U.notifications:n.value=[...n.value,...U.notifications],h.value=U.total,m.value=U.page}}catch(V){console.error(V)}finally{c.value=!1}};return{notifications:n,unreadCount:i,isLoadingList:c,total:h,page:m,unreadOnly:a,fetchUnreadCount:y,fetchNotifications:E,setUnreadOnly:D=>{a.value=D,E(1)},markNotificationRead:D=>{const V=n.value.find(U=>U.id===D);!V||V.is_read||(V.is_read=!0,i.value=Math.max(0,i.value-1),e.patch(`/property-explorer/notifications/${D}/read`).catch(()=>{}))},resetStore:()=>{n.value=[],i.value=0,h.value=0,m.value=1,a.value=!1}}}),Vj=xa("announcements",()=>{const{$axios:e,$logger:t}=rr(),n=hn([]),i=hn(0),c=hn(!1),h=hn(!1),m=vn(()=>n.value[i.value]??null),a=vn(()=>!!m.value);return{announcements:n,currentIndex:i,isFetched:c,suppressedUntilReload:h,currentAnnouncement:m,hasActive:a,fetchAnnouncements:async()=>{if(!c.value)try{const D=await e.get("/announcements");D.status===200&&(n.value=D.data.data??[],c.value=!0)}catch(D){t.error("Failed to fetch announcements:",D)}},logInteraction:async(D,V)=>{await e.post(`/announcements/${D}/log`,{action:V})},advance:()=>{i.value++},suppressUntilReload:()=>{h.value=!0},resetStore:()=>{n.value=[],i.value=0,c.value=!1,h.value=!1}}}),dT="/property-explorer/saved-offers",Qoe=xa("savedOffers",()=>{const{$axios:e,$logger:t}=rr(),n=()=>Yf().hasPermission(wh.PASEET_PROPERTY_EXPLORER)??!1,i=hn(new Set);let c=null,h=0;const m=hn([]),a=hn(0),y=hn(1),E=hn(!1),C=hn("recent"),P=hn(""),L=20,D=()=>{if(!n())return Promise.resolve(!1);if(!c){const ne=h;c=e.get(`${dT}/ids`).then(fe=>ne!==h||fe.status!==200?!1:(i.value=new Set(fe.data.data??[]),!0)).catch(fe=>(ne===h&&(c=null),t.error(fe),!1))}return c},V=ne=>!ne||ne.id==null?!1:i.value.has(ne.id),U=async ne=>{const fe=ne.id;if(fe==null||!n()||!await D())return;const ye=!i.value.has(fe),ke=i.value,Fe=m.value,qe=a.value,lt=new Set(ke);ye?lt.add(fe):lt.delete(fe),i.value=lt,ye?Fe.some(pt=>pt.id===fe)||(m.value=[ne,...Fe],a.value=a.value+1):(m.value=Fe.filter(pt=>pt.id!==fe),a.value=Math.max(0,a.value-1));try{ye?await e.post(`${dT}/${fe}`):await e.delete(`${dT}/${fe}`)}catch(pt){i.value=ke,m.value=Fe,a.value=qe,t.error(pt)}},W=async(ne=1)=>{if(!n())return;const fe=h;E.value=!0;try{const ye=await e.get(dT,{params:{page:ne,per_page:L,sort:C.value,...P.value?{search:P.value}:{}}});if(fe!==h)return;if(ye.status===200){const ke=ye.data.data;m.value=ne===1?ke.offers:[...m.value,...ke.offers],a.value=ke.total,y.value=ke.page}}catch(ye){if(fe!==h)return;t.error(ye),ne===1&&(m.value=[],a.value=0,y.value=1)}finally{fe===h&&(E.value=!1)}},$=ne=>{C.value=ne,W(1)},Y=ne=>{P.value=ne,W(1)},X=()=>{m.value=[],a.value=0,y.value=1};return{savedOfferIds:i,savedOffers:m,total:a,page:y,isLoading:E,sort:C,search:P,perPage:L,isSaved:V,ensureSavedIds:D,toggleSave:U,fetchSavedOffers:W,setSort:$,setSearch:Y,reset:X,resetStore:()=>{h+=1,X(),i.value=new Set,c=null,C.value="recent",P.value="",E.value=!1}}}),Yf=xa("user",()=>{const e=rr(),t=hn(null),n=hn(null),i=vn(()=>!!t.value),c=hn(!!localStorage.getItem(V_)),h=vn(()=>!!t.value||c.value),m=vn(()=>t.value?.is_email_verified??!1),a=vn(()=>t.value?.is_phone_verified??!1),y=vn(()=>t.value?.isAdmin??!1),E=vn(()=>
3311t.value?.isSuperAdmin??!1),C=vn(()=>t.value?.name??""),P=vn(()=>t.value?.email??""),L=vn(()=>t.value?.plan??null),D=vn(()=>t.value?.plan?.isFree??!1),V=vn(()=>t.value?.isAgreedToTermsAndConditions??!1);let U=null,W=null,$=null,Y=!1;const X=()=>{t.value=null,c.value=!1,localStorage.removeItem(V_)},K=()=>{Y=!0,X(),fe()},ne=()=>{Y=!1},fe=()=>{Zoe().resetStore(),Y6().resetStore(),Yoe().resetStore(),Joe().resetStore(),Nj().resetStore(),Vj().resetStore(),Qoe().resetStore()},ye=async()=>U||(Y?!1:(U=(async()=>{try{const{$axios:xn}=rr(),Vn=await xn.get("/user");return Vn?.status===200&&Vn.data?.data?(t.value=Vn.data.data,ne(),!0):Vn?.status===401?(K(),!1):(X(),!1)}catch(xn){return console.error(xn),X(),!1}finally{U=null}})(),U)),ke=async()=>W||(Y?!1:(W=(async()=>{try{const{$axios:xn}=rr(),Vn=await xn.post("/auth/refresh-token");return Vn?.status===200&&Vn.data?.data?.access_token?(localStorage.setItem(V_,Vn.data.data.access_token),c.value=!0,ne(),!0):(Vn?.status===401,K(),!1)}catch(xn){return console.error(xn),K(),!1}finally{W=null}})(),W)),Fe=async()=>!!(i.value||await ye()||await ke()&&await ye()),qe=async(xn={})=>{if($)return $;const Vn=xn.redirect??!0;return $=(async()=>{try{const{$axios:Ln}=rr();await Ln.post("/auth/logout")}catch(Ln){console.error("Logout error:",Ln)}finally{if(K(),Vn){const Ln=e.$localePath("login");ly(Ln)}$=null}})(),$},lt=xn=>{t.value=xn,ne()},pt=xn=>{n.value=xn,c.value=!0,localStorage.setItem(V_,xn),ne()},Qt=xn=>t.value?.isAdmin||t.value?.permissions.includes(xn),Ht=xn=>{if(t.value?.isAdmin)return!0;const Vn=t.value?.creditSummary?.find(Ln=>Ln.key===xn);return Vn?Vn.hasCredits:!0},zt=vn(()=>t.value?.hasTokens??!0),jt=vn(()=>!!U),Zt=vn(()=>!!W),Wt=vn(()=>Y),en=async()=>{try{return(await e.$axios.patch("/user/agree-to-terms-and-conditions")).status===200?(t.value.isAgreedToTermsAndConditions=!0,!0):!1}catch(xn){return e.$logger.error(xn),!1}},sn=async()=>{try{const xn=await e.$axios.get("/subscriptions/status");return xn.status===200?xn.data.data:null}catch(xn){return e.$logger.debug(xn),null}};return{user:t,fetchUser:ye,refreshAccessToken:ke,ensureAuthenticated:Fe,logout:qe,setUser:lt,setToken:pt,clearUserState:X,hasPermission:Qt,hasCredit:Ht,hasTokens:zt,agreeToTermsAndConditions:en,getUserSubscriptionStatus:sn,getExternalProvider:async()=>{if(!i.value)return null;const xn=await sn();return xn?.canManageOnPlatform===!1?xn.provider:null},isFetchingUser:jt,isRefreshingToken:Zt,areTokensInvalid:Wt,isAuthenticated:i,isLoggedInHint:h,isEmailVerified:m,isPhoneVerified:a,isAdmin:y,isSuperAdmin:E,userPlan:L,isFreePlan:D,userName:C,userEmail:P,isAgreedToTermsAndConditions:V}}),ese=()=>{const e=Yf();ts(()=>{e.ensureAuthenticated().then(()=>{}).catch(t=>{console.error(t)})})},tse=async(e,t)=>{const n=Nm(),{width:i}=X6();n.isMobile=i.value<767},nse=e=>{const t=u6({path:e.path});if(t.redirect){const n=t.redirect.includes("#")?t.redirect:t.redirect+e.hash;return bc(n,{acceptRelative:!0})?(window.location.href=n,!1):n}},rse=[Cte,Ate,ese,tse,nse],BR={auth:()=>gt(()=>import("./Bt1nAyWo.js"),[],import.meta.url),"plan-id":()=>gt(()=>import("./BTWiJzBa.js"),[],import.meta.url)};function ise(e,t,n){const{pathname:i,search:c,hash:h}=t,m=e.indexOf("#");if(m>-1){const E=h.includes(e.slice(m))?e.slice(m).length:1;let C=h.slice(E);return C[0]!=="/"&&(C="/"+C),l3(C,"")}const a=l3(i,e),y=!n||k$(a,n)?a:n;return y+(y.includes("?")?"":c)+h}const ose=Ji({name:"nuxt:router",enforce:"pre",async setup(e){let t,n,i=Dl().app.baseURL;const c=wf.history?.(i)??eee(i),h=wf.routes?([t,n]=$f(()=>wf.routes(BI)),t=await t,n(),t??BI):BI;let m;const a=bee({...wf,scrollBehavior:($,Y,X)=>{if(Y===dc){m=X;return}if(wf.scrollBehavior){if(a.options.scrollBehavior=wf.scrollBehavior,"scrollRestoration"in window.history){const K=a.beforeEach(()=>{K(),window.history.scrollRestoration="manual"})}return wf.scrollBehavior($,dc,m||X)}},history:c,routes:h});"scrollRestoration"in window.history&&(window.history.scrollRestoration="auto"),e.vueApp.use(a);const y=Vi(a.currentRoute.value);a.afterEach(($,Y)=>{y.value=Y}),Object.defineProperty(e.vueApp.config.globalProperties,"previousRoute",{get:()=>y.value});const E=ise(i,window.location,e.payload.path),C=Vi(a.currentRoute.value),P=()=>{C.value=a.currentRoute.value};
3311a.afterEach(($,Y)=>{const X=$.matched.at(-1)?.components?.default,K=Y.matched.at(-1)?.components?.default;if(X===K){P();return}$.matched.length<Y.matched.length&&$.matched.every((ne,fe)=>ne.components?.default===Y.matched[fe]?.components?.default)&&P()});const L={sync:P};for(const $ in C.value)Object.defineProperty(L,$,{get:()=>C.value[$],enumerable:!0});e._route=Zc(L),e._middleware||={global:[],named:{}};const D=Mx();a.afterEach(async($,Y,X)=>{delete e._processingMiddleware,!e.isHydrating&&D.value&&await e.runWithContext(cJ),X&&await e.callHook("page:loading:end")});try{[t,n]=$f(()=>a.isReady()),await t,n()}catch($){[t,n]=$f(()=>e.runWithContext(()=>_m($))),await t,n()}const V=E!==a.currentRoute.value.fullPath?a.resolve(E):a.currentRoute.value,U=e.isHydrating&&e.payload.prerenderedAt&&e.payload.path&&E!==e.payload.path&&k$(a.currentRoute.value.path,e.payload.path);P();const W=e.payload.state._layout;return a.beforeEach(async($,Y)=>{await e.callHook("page:loading:start"),$.meta=Fl($.meta),e.isHydrating&&W&&!id($.meta.layout)&&($.meta.layout=W),e._processingMiddleware=!0;{const X=new Set([...rse,...e._middleware.global]);for(const ne of $.matched){const fe=ne.meta.middleware;if(fe)for(const ye of A6(fe))X.add(ye)}const K=u6({path:$.path});if(K.appMiddleware)for(const ne in K.appMiddleware)K.appMiddleware[ne]?X.add(ne):X.delete(ne);for(const ne of X){const fe=typeof ne=="string"?e._middleware.named[ne]||await BR[ne]?.().then(ye=>ye.default||ye):ne;if(!fe)throw new Error(`Unknown route middleware: '${ne}'.`);try{const ye=await e.runWithContext(()=>fe($,Y));if(!e.payload.serverRendered&&e.isHydrating&&(ye===!1||ye instanceof Error)){const ke=ye||jf({status:404,statusText:`Page Not Found: ${E}`});return await e.runWithContext(()=>_m(ke)),!1}if(ye===!0)continue;if(ye===!1)return ye;if(ye)return W$(ye)&&ye.fatal&&await e.runWithContext(()=>_m(ye)),ye}catch(ye){const ke=jf(ye);return ke.fatal&&await e.runWithContext(()=>_m(ke)),ke}}}}),a.onError(async()=>{delete e._processingMiddleware,await e.callHook("page:loading:end")}),a.afterEach($=>{if($.matched.length===0&&!D.value)return e.runWithContext(()=>_m(jf({status:404,fatal:!1,statusText:`Page not found: ${$.fullPath}`,data:{path:$.fullPath}})))}),e.hooks.hookOnce("app:created",async()=>{try{if("name"in V&&(V.name=void 0),U){const $=a.resolve(e.payload.path);"name"in $&&($.name=void 0),await a.replace({...$,force:!0}),e.hooks.hookOnce("app:suspense:resolve",async()=>{await a.replace({...V,force:!0})})}else await a.replace({...V,force:!0});a.options.scrollBehavior=wf.scrollBehavior}catch($){await e.runWithContext(()=>_m($))}}),{provide:{router:a}}}}),sse=Ji({name:"nuxt:payload",setup(e){const t=new Set;ps().beforeResolve(async(n,i)=>{if(n.path===i.path)return;const c=await T3(n.path);if(c){for(const h of t)delete e.static.data[h];for(const h in c.data)h in e.static.data||t.add(h),e.static.data[h]=c.data[h]}}),Lx(()=>{e.hooks.hook("link:prefetch",async n=>{const{hostname:i}=new URL(n,window.location.href);i===window.location.hostname&&await T3().catch(()=>{console.warn("[nuxt] Error preloading payload for",n)})}),navigator.connection?.effectiveType!=="slow-2g"&&setTimeout(c6,1e3)})}}),ase=Ji(()=>{const e=ps();Lx(()=>{e.beforeResolve(async()=>{await new Promise(t=>{setTimeout(t,100),requestAnimationFrame(()=>{setTimeout(t,0)})})})})}),lse=Ji(e=>{let t;async function n(){let i;try{i=await c6()}catch(c){const h=c;if(!("status"in h&&(h.status===404||h.status===403)))throw h}t&&clearTimeout(t),t=setTimeout(n,m3);try{const c=await $fetch(xM("builds/latest.json")+`?${Date.now()}`);c.id!==i?.id&&(e.hooks.callHook("app:manifest:update",c),t&&clearTimeout(t))}catch{}}Lx(()=>{t=setTimeout(n,m3)})}),cse=Ji({name:"nuxt:chunk-reload",setup(e){const t=ps(),n=Dl(),i=new Set;t.beforeEach(()=>{i.clear()}),e.hook("app:chunkError",({error:h})=>{i.add(h)});function c(h){const m=Uf(n.app.baseURL,h.fullPath);pte({path:m,persistState:!0})}e.hook("app:manifest:update",()=>{t.beforeResolve(c)}),t.onError((h,m)=>{i.has(h)&&c(m)})}}),use=Ji({name:"pinia",setup(e){const t=uJ();return e.vueApp.use(t),cy(t),e.payload&&e.payload.pinia&&(t.state.value=e.payload.pinia),{provide:{pinia:t}}},hooks:{"app:rendered"(){const e=rr();e.payload.pinia=ci(e.$pinia).state.value,cy(void 0)}}}),dse=Nt(()=>gt(()=>import("./F9ZkwYw2.js"),__vite__mapDeps([140,6,15,10,141,19,20,21,22,23]),import.meta.url).then(e=>
3311e.default||e.default||e)),hse=Nt(()=>gt(()=>import("./DM98Vxap.js"),__vite__mapDeps([142,143,6,15,144,28,145,30,10,31,19,20,21,22]),import.meta.url).then(e=>e.default||e.default||e)),fse=Nt(()=>gt(()=>import("./CNME05W0.js"),__vite__mapDeps([146,6,27,15,10,22,20,21]),import.meta.url).then(e=>e.default||e.default||e)),pse=Nt(()=>gt(()=>import("./CEX6oNBJ.js"),__vite__mapDeps([32,33,20,21]),import.meta.url).then(e=>e.default||e.default||e)),mse=Nt(()=>gt(()=>import("./C2IiP7p5.js"),__vite__mapDeps([147,21]),import.meta.url).then(e=>e.default||e.default||e)),gse=Nt(()=>gt(()=>import("./DRM45I4j.js"),__vite__mapDeps([148,149,141]),import.meta.url).then(e=>e.default||e.default||e)),_se=Nt(()=>gt(()=>import("./DK_u7NC2.js"),__vite__mapDeps([150,6,22,21]),import.meta.url).then(e=>e.default||e.default||e)),yse=Nt(()=>gt(()=>import("./B7D1kfxr.js"),__vite__mapDeps([143,6,15,144,28,145,30,10,31,19,20,21,22]),import.meta.url).then(e=>e.default||e.default||e)),vse=Nt(()=>gt(()=>import("./DLCFtQwu.js"),__vite__mapDeps([151,13,6,14,15,16,10,17,18,19,20,21,22,23]),import.meta.url).then(e=>e.default||e.default||e)),bse=Nt(()=>gt(()=>import("./D_7alHX3.js"),[],import.meta.url).then(e=>e.default||e.default||e)),xse=Nt(()=>gt(()=>import("./Si3ZFwXe.js"),[],import.meta.url).then(e=>e.default||e.default||e)),wse=Nt(()=>gt(()=>import("./CvyjjAz9.js"),[],import.meta.url).then(e=>e.default||e.default||e)),Sse=Nt(()=>gt(()=>import("./Cv3yQisT.js"),[],import.meta.url).then(e=>e.default||e.default||e)),Tse=Nt(()=>gt(()=>import("./_LLO9ykd.js"),__vite__mapDeps([149,141]),import.meta.url).then(e=>e.default||e.default||e)),Ese=Nt(()=>gt(()=>import("./Ms3O6AvY.js"),[],import.meta.url).then(e=>e.default||e.default||e)),Cse=Nt(()=>gt(()=>import("./Fx1E7Xnd.js"),[],import.meta.url).then(e=>e.default||e.default||e)),Ase=Nt(()=>gt(()=>import("./C5bddYYQ.js"),[],import.meta.url).then(e=>e.default||e.default||e)),Ise=Nt(()=>gt(()=>import("./C8HwWdCO.js"),__vite__mapDeps([152,19,20,21]),import.meta.url).then(e=>e.default||e.default||e)),Pse=Nt(()=>gt(()=>import("./Dci8hfk2.js"),__vite__mapDeps([24,25,26,19,20,21]),import.meta.url).then(e=>e.default||e.default||e)),Rse=Nt(()=>gt(()=>import("./CjTALc5n.js"),__vite__mapDeps([108,19,20,21]),import.meta.url).then(e=>e.default||e.default||e)),kse=Nt(()=>gt(()=>import("./C7aO-96C.js"),__vite__mapDeps([153,68,21]),import.meta.url).then(e=>e.default||e.default||e)),Mse=Nt(()=>gt(()=>import("./CtxYlh3C.js"),__vite__mapDeps([19,20,21]),import.meta.url).then(e=>e.default||e.default||e)),Lse=Nt(()=>gt(()=>import("./CPbWazU9.js"),__vite__mapDeps([154,21]),import.meta.url).then(e=>e.default||e.default||e)),Ose=Nt(()=>gt(()=>import("./DLnl5idV.js"),__vite__mapDeps([58,14,16,17,18,19,20,21,23,10]),import.meta.url).then(e=>e.default||e.default||e)),Dse=Nt(()=>gt(()=>import("./DDcTMoOv.js"),__vite__mapDeps([155,6,15,16,10,32,33,20,21,141,17,18,19,22,23]),import.meta.url).then(e=>e.default||e.default||e)),Fse=Nt(()=>gt(()=>import("./BbKRhhz0.js"),__vite__mapDeps([156,6,50,19,20,21,22]),import.meta.url).then(e=>e.default||e.default||e)),Bse=Nt(()=>gt(()=>import("./BUPkQ2Oj.js"),__vite__mapDeps([34,20,21]),import.meta.url).then(e=>e.default||e.default||e)),zse=Nt(()=>gt(()=>import("./B-_D0PSa.js"),__vite__mapDeps([157,21]),import.meta.url).then(e=>e.default||e.default||e)),Nse=Nt(()=>gt(()=>import("./Hml0cgKS.js"),__vite__mapDeps([158,21]),import.meta.url).then(e=>e.default||e.default||e)),Vse=Nt(()=>gt(()=>import("./BGEszIoe.js"),__vite__mapDeps([13,6,14,15,16,10,17,18,19,20,21,22,23]),import.meta.url).then(e=>e.default||e.default||e)),Use=Nt(()=>gt(()=>import("./BkeUFNHV.js"),__vite__mapDeps([114,115,21]),import.meta.url).then(e=>e.default||e.default||e)),$se=Nt(()=>gt(()=>import("./Cl3S4sQb.js"),__vite__mapDeps([159,21]),import.meta.url).then(e=>e.default||e.default||e)),jse=Nt(()=>gt(()=>import("./BQSKM90r.js"),__vite__mapDeps([160,20,21]),import.meta.url).then(e=>e.default||e.default||e)),Gse=Nt(()=>gt(()=>import("./CDACh_GJ.js"),__vite__mapDeps([115,21]),import.meta.url).then(e=>e.default||e.default||e)),Hse=Nt(()=>gt(()=>import("./C6WKTvoy.js"),__vite__mapDeps([68,21]),import.meta.url).then(e=>e.default||e.default||e)),Wse=Nt(()=>gt(()=>import("./DTe-oDPu.js"),__vite__mapDeps([161,6,15,141,22,162,16,10,17,18,19,20,21,28,33,32]),import.meta.url).then(e=>e.default||e.default||e)),qse=Nt(()=>gt(()=>import("./BWpBW5Ac.js"),__vite__mapDeps([30,10,31]),import.meta.url).then(e=>e.default||e.default||e)),Xse=Nt(()=>gt(()=>import("./CtC1sRV-.js"),[],import.meta.url).then(e=>
3311e.default||e.default||e)),Zse=Nt(()=>gt(()=>import("./BJ0jU2Ei.js"),__vite__mapDeps([163,35,30,10,31,5,6]),import.meta.url).then(e=>e.default||e.default||e)),Yse=Nt(()=>gt(()=>import("./CZ1fxRv6.js"),__vite__mapDeps([164,15,30,10,31,165,6,22,27]),import.meta.url).then(e=>e.default||e.default||e)),Kse=Nt(()=>gt(()=>import("./DWZrwo6J.js"),[],import.meta.url).then(e=>e.default||e.default||e)),Jse=Nt(()=>gt(()=>import("./Ctar0-c_.js"),[],import.meta.url).then(e=>e.default||e.default||e)),Qse=Nt(()=>gt(()=>import("./BSE6rDiN.js"),[],import.meta.url).then(e=>e.default||e.default||e)),eae=Nt(()=>gt(()=>import("./Bg3W5StB.js"),__vite__mapDeps([9,6,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]),import.meta.url).then(e=>e.default||e.default||e)),tae=Nt(()=>gt(()=>import("./CVNsX2-5.js"),__vite__mapDeps([166,11,12,13,6,14,15,16,10,17,18,19,20,21,22,23,24,25,26,27]),import.meta.url).then(e=>e.default||e.default||e)),nae=Nt(()=>gt(()=>import("./DqJZlPLI.js"),__vite__mapDeps([167,168,25,26,30,10,31,58,14,16,17,18,19,20,21,23]),import.meta.url).then(e=>e.default||e.default||e)),rae=Nt(()=>gt(()=>import("./0KFwI30R.js"),__vite__mapDeps([169,15,145]),import.meta.url).then(e=>e.default||e.default||e)),iae=Nt(()=>gt(()=>import("./3PGTFW48.js"),__vite__mapDeps([11,12,13,6,14,15,16,10,17,18,19,20,21,22,23,24,25,26,27]),import.meta.url).then(e=>e.default||e.default||e)),oae=Nt(()=>gt(()=>import("./BMBl4cDL.js"),__vite__mapDeps([170,168,12,25,27,26,30,10,31,58,14,16,17,18,19,20,21,23]),import.meta.url).then(e=>e.default||e.default||e)),sae=Nt(()=>gt(()=>import("./DLpflMJJ.js"),__vite__mapDeps([162,16,10,17,18,19,20,21,15,28,33,32]),import.meta.url).then(e=>e.default||e.default||e)),aae=Nt(()=>gt(()=>import("./B1evQvZv.js"),__vite__mapDeps([171,6,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,37,31,28,33,32]),import.meta.url).then(e=>e.default||e.default||e)),lae=Nt(()=>gt(()=>import("./BqhawAS1.js"),[],import.meta.url).then(e=>e.default||e.default||e)),cae=Nt(()=>gt(()=>import("./Dph8-iTG.js"),__vite__mapDeps([23,10]),import.meta.url).then(e=>e.default||e.default||e)),uae=Nt(()=>gt(()=>import("./BDYWcOt4.js"),__vite__mapDeps([172,28,145,173,174,15,175]),import.meta.url).then(e=>e.default||e.default||e)),dae=Nt(()=>gt(()=>import("./D-g9_5-7.js"),[],import.meta.url).then(e=>e.default||e.default||e)),hae=Nt(()=>gt(()=>import("./CPZuu7aL.js"),__vite__mapDeps([174,15,145]),import.meta.url).then(e=>e.default||e.default||e)),fae=Nt(()=>gt(()=>import("./Z4x0ARm4.js"),[],import.meta.url).then(e=>e.default||e.default||e)),pae=Nt(()=>gt(()=>import("./DKIxAvF3.js"),[],import.meta.url).then(e=>e.default||e.default||e)),mae=Nt(()=>gt(()=>import("./JSbZDONY.js"),[],import.meta.url).then(e=>e.default||e.default||e)),gae=Nt(()=>gt(()=>import("./Cs2a3FXe.js"),[],import.meta.url).then(e=>e.default||e.default||e)),_ae=Nt(()=>gt(()=>import("./CF4ldVnu.js"),[],import.meta.url).then(e=>e.default||e.default||e)),yae=Nt(()=>gt(()=>import("./CU5oS2F6.js"),__vite__mapDeps([176,33,35]),import.meta.url).then(e=>e.default||e.default||e)),vae=Nt(()=>gt(()=>import("./DzcKlpLn.js"),__vite__mapDeps([177,33,35,30,10,31]),import.meta.url).then(e=>e.default||e.default||e)),bae=Nt(()=>gt(()=>import("./t5csjEAa.js"),[],import.meta.url).then(e=>e.default||e.default||e)),xae=Nt(()=>gt(()=>import("./DPgKtKtF.js"),__vite__mapDeps([178,6]),import.meta.url).then(e=>e.default||e.default||e)),wae=Nt(()=>gt(()=>import("./ehz6_Raf.js"),[],import.meta.url).then(e=>e.default||e.default||e)),Sae=Nt(()=>gt(()=>import("./B7pwQut6.js"),[],import.meta.url).then(e=>e.default||e.default||e)),Tae=Nt(()=>gt(()=>import("./BauLCUSX.js"),[],import.meta.url).then(e=>e.default||e.default||e)),Eae=Nt(()=>gt(()=>import("./BKLcZOo_.js"),[],import.meta.url).then(e=>e.default||e.default||e)),Cae=Nt(()=>gt(()=>import("./1tTpnW3s.js"),[],import.meta.url).then(e=>e.default||e.default||e)),Aae=Nt(()=>gt(()=>import("./BYFCkMrf.js"),[],import.meta.url).then(e=>e.default||e.default||e)),Iae=Nt(()=>gt(()=>import("./GuuhlJO9.js"),[],import.meta.url).then(e=>e.default||e.default||e)),Pae=Nt(()=>gt(()=>import("./De-71koh.js"),__vite__mapDeps([179,144,28]),import.meta.url).then(e=>e.default||e.default||e)),Rae=Nt(()=>gt(()=>import("./BWTalxvL.js"),[],import.meta.url).then(e=>e.default||e.default||e)),kae=Nt(()=>gt(()=>import("./CKnfoym9.js"),__vite__mapDeps([180,144,28]),import.meta.url).then(e=>e.default||e.default||e)),Mae=Nt(()=>gt(()=>import("./BKzyOEdr.js"),[],import.meta.url).then(e=>e.default||e.default||e)),Lae=Nt(()=>gt(()=>import("./DQA-VSVw.js"),[],import.meta.url).then(e=>e.default||e.default||e)),Oae=Nt(()=>gt(()=>import("./C7_snG_s.js"),[],import.meta.url).then(e=>e.default||e.default||e)),Dae=Nt(()=>gt(()=>import("./LvJNkDEh.js"),[],import.meta.url).then(e=>e.default||e.default||e)),Fae=Nt(()=>gt(()=>import("./Czxw5mTR.js"),__vite__mapDeps([181,30,10,31,182,36,51]),import.meta.url).then(e=>e.default||e.default||e)),Bae=Nt(()=>gt(()=>import("./DnOS1f95.js"),__vite__mapDeps([183,6,30,10,31,36,22]),import.meta.url).then(e=>e.default||e.default||e)),zae=Nt(()=>gt(()=>import("./D5KT_mT1.js"),__vite__mapDeps([182,30,10,31,36,51]),import.meta.url).then(e=>e.default||e.default||e)),Nae=Nt(()=>gt(()=>import("./BVtnc0wg.js"),__vite__mapDeps([184,30,10,31,36,51]),import.meta.url).then(e=>e.default||e.default||e)),Vae=Nt(()=>gt(()=>import("./DGbS_1JX.js"),__vite__mapDeps([185,182,30,10,31,36,51]),import.meta.url).then(e=>e.default||e.default||e)),Uae=Nt(()=>gt(()=>import("./DuhClZgK.js"),__vite__mapDeps([186,187,6,36,22]),import.meta.url).then(e=>e.default||e.default||e)),$ae=Nt(()=>gt(()=>import("./CpdxZG3I.js"),__vite__mapDeps([187,6,36,22]),import.meta.url).then(e=>e.default||e.default||e)),jae=Nt(()=>gt(()=>import("./B9Mk1-Rl.js"),__vite__mapDeps([188,184,30,10,31,36,51]),import.meta.url).then(e=>e.default||e.default||e)),Gae=Nt(()=>gt(()=>import("./B2N7hi9E.js"),__vite__mapDeps([189,35,30,10,31,190,191]),import.meta.url).then(e=>e.default||e.default||e)),Hae=Nt(()=>gt(()=>import("./BO4Wcxyg.js"),__vite__mapDeps([192,28]),import.meta.url).then(e=>e.default||e.default||e)),Wae=Nt(()=>gt(()=>import("./Q4B1v1KE.js"),__vite__mapDeps([193,27]),import.meta.url).then(e=>e.default||e.default||e)),qae=Nt(()=>gt(()=>import("./4P3orR7D.js"),__vite__mapDeps([194,5,6]),import.meta.url).then(e=>e.default||e.default||e)),Xae=Nt(()=>gt(()=>import("./Bd3kfP7w.js"),__vite__mapDeps([195,6,22]),import.meta.url).then(e=>e.default||e.default||e)),Zae=Nt(()=>gt(()=>import("./BJvV4PKO.js"),__vite__mapDeps([196,29,25,27]),import.meta.url).then(e=>e.default||e.default||e)),Yae=Nt(()=>gt(()=>import("./DBgKaxUh.js"),__vite__mapDeps([197,29,25,27]),import.meta.url).then(e=>e.default||e.default||e)),Kae=Nt(()=>gt(()=>import("./-duoZHVq.js"),__vite__mapDeps([198,15,28]),import.meta.url).then(e=>e.default||e.default||e)),Jae=Nt(()=>gt(()=>import("./DsSKLU_L.js"),[],import.meta.url).then(e=>e.default||e.default||e)),Qae=Nt(()=>gt(()=>import("./DjAx_mGR.js"),[],import.meta.url).then(e=>e.default||e.default||e)),ele=Nt(()=>gt(()=>import("./Ds8mJGV-.js"),__vite__mapDeps([165,6,22,27]),import.meta.url).then(e=>e.default||e.default||e)),tle=Nt(()=>gt(()=>import("./WD0Ai5mL.js"),[],import.meta.url).then(e=>e.default||e.default||e)),nle=Nt(()=>gt(()=>import("./MjOdJTmn.js"),[],import.meta.url).then(e=>e.default||e.default||e)),rle=Nt(()=>gt(()=>Promise.resolve().then(()=>yMe),void 0,import.meta.url).then(e=>e.default||e.default||e)),ile=Nt(()=>gt(()=>import("./CyFyPqq1.js"),__vite__mapDeps([199,15,144,28,145,30,10,31]),import.meta.url).then(e=>e.default||e.default||e)),ole=Nt(()=>gt(()=>import("./6oONUG0n.js"),__vite__mapDeps([200,36,51,144,28,15,145]),import.meta.url).then(e=>e.default||e.default||e)),sle=Nt(()=>gt(()=>import("./B_Q5b61M.js"),__vite__mapDeps([49,50,36,51]),import.meta.url).then(e=>e.default||e.default||e)),ale=Nt(()=>gt(()=>import("./DLjBzGUw.js"),[],import.meta.url).then(e=>e.default||e.default||e)),lle=Nt(()=>gt(()=>import("./CyCuj7Ia.js"),[],import.meta.url).then(e=>e.default||e.default||e)),cle=Nt(()=>gt(()=>import("./61Vz64Zr.js"),[],import.meta.url).then(e=>e.default||e.default||e)),ule=Nt(()=>gt(()=>import("./DCkm7dUL.js"),[],import.meta.url).then(e=>e.default||e.default||e)),dle=Nt(()=>gt(()=>import("./DULykO2F.js"),__vite__mapDeps([201,51]),import.meta.url).then(e=>e.default||e.default||e)),hle=Nt(()=>gt(()=>import("./CQgbuffU.js"),[],import.meta.url).then(e=>e.default||e.default||e)),fle=Nt(()=>gt(()=>import("./D7qYsJQE.js"),[],import.meta.url).then(e=>e.default||e.default||e)),ple=Nt(()=>gt(()=>import("./Bd7bsB1W.js"),[],import.meta.url).then(e=>e.default||e.default||e)),mle=Nt(()=>gt(()=>import("./D2uAua94.js"),__vite__mapDeps([202,31]),import.meta.url).then(e=>e.default||e.default||e)),gle=Nt(()=>gt(()=>import("./D7Dt9tFg.js"),__vite__mapDeps([203,145,30,10,31]),import.meta.url).then(e=>e.default||e.default||e)),_le=Nt(()=>gt(()=>import("./B1a79knM.js"),[],import.meta.url).then(e=>e.default||e.default||e)),yle=Nt(()=>gt(()=>import("./BQvHJkx7.js"),[],import.meta.url).then(e=>e.default||e.default||e)),vle=Nt(()=>gt(()=>import("./BEwYYCqP.js"),[],import.meta.url).then(e=>e.default||e.default||e)),ble=Nt(()=>gt(()=>import("./CozImtfl.js"),[],import.meta.url).then(e=>e.default||e.default||e)),xle=Nt(()=>gt(()=>import("./BJ_3wt_P.js"),[],import.meta.url).then(e=>e.default||e.default||e)),wle=Nt(()=>gt(()=>import("./33xx-KrR.js"),[],import.meta.url).then(e=>e.default||e.default||e)),Sle=Nt(()=>gt(()=>import("./Bl3de7L-.js"),[],import.meta.url).then(e=>e.default||e.default||e)),Tle=[["PrimeAutoComplete",dse],["PrimeCalendar",hse],["PrimeCascadeSelect",fse],["PrimeCheckbox",pse],["PrimeCheckboxGroup",mse],["PrimeChips",gse],["PrimeColorPicker",_se],["PrimeDatePicker",yse],["PrimeDropdown",vse],["PrimeFloatLabel",bse],["PrimeFluid",xse],["PrimeIconField",wse],["PrimeIftaLabel",Sse],["PrimeInputChips",Tse],["PrimeInputGroup",Ese],["PrimeInputGroupAddon",Cse],["PrimeInputIcon",Ase],["PrimeInputMask",Ise],["PrimeInputNumber",Pse],["PrimeInputOtp",Rse],["PrimeInputSwitch",kse],["PrimeInputText",Mse],["PrimeKnob",Lse],["PrimeListbox",Ose],["PrimeMultiSelect",Dse],["PrimePassword",Fse],["PrimeRadioButton",Bse],["PrimeRadioButtonGroup",zse],["PrimeRating",Nse],["PrimeSelect",Vse],["PrimeSelectButton",Use],["PrimeSlider",$se],["PrimeTextarea",
3311jse],["PrimeToggleButton",Gse],["PrimeToggleSwitch",Hse],["PrimeTreeSelect",Wse],["PrimeButton",qse],["PrimeButtonGroup",Xse],["PrimeSpeedDial",Zse],["PrimeSplitButton",Yse],["PrimeColumn",Kse],["PrimeRow",Jse],["PrimeColumnGroup",Qse],["PrimeDataTable",eae],["PrimeDataView",tae],["PrimeOrderList",nae],["PrimeOrganizationChart",rae],["PrimePaginator",iae],["PrimePickList",oae],["PrimeTree",sae],["PrimeTreeTable",aae],["PrimeTimeline",lae],["PrimeVirtualScroller",cae],["PrimeAccordion",uae],["PrimeAccordionPanel",dae],["PrimeAccordionHeader",hae],["PrimeAccordionContent",fae],["PrimeAccordionTab",pae],["PrimeCard",mae],["PrimeDeferredContent",gae],["PrimeDivider",_ae],["PrimeFieldset",yae],["PrimePanel",vae],["PrimeScrollPanel",bae],["PrimeSplitter",xae],["PrimeSplitterPanel",wae],["PrimeStepper",Sae],["PrimeStepList",Tae],["PrimeStep",Eae],["PrimeStepItem",Cae],["PrimeStepPanels",Aae],["PrimeStepPanel",Iae],["PrimeTabView",Pae],["PrimeTabs",Rae],["PrimeTabList",kae],["PrimeTab",Mae],["PrimeTabPanels",Lae],["PrimeTabPanel",Oae],["PrimeToolbar",Dae],["PrimeConfirmDialog",Fae],["PrimeConfirmPopup",Bae],["PrimeDialog",zae],["PrimeDrawer",Nae],["PrimeDynamicDialog",Vae],["PrimeOverlayPanel",Uae],["PrimePopover",$ae],["PrimeSidebar",jae],["PrimeFileUpload",Gae],["PrimeBreadcrumb",Hae],["PrimeContextMenu",Wae],["PrimeDock",qae],["PrimeMenu",Xae],["PrimeMenubar",Zae],["PrimeMegaMenu",Yae],["PrimePanelMenu",Kae],["PrimeSteps",Jae],["PrimeTabMenu",Qae],["PrimeTieredMenu",ele],["PrimeMessage",tle],["PrimeInlineMessage",nle],["PrimeToast",rle],["PrimeCarousel",ile],["PrimeGalleria",ole],["PrimeImage",sle],["PrimeImageCompare",ale],["PrimeAvatar",lle],["PrimeAvatarGroup",cle],["PrimeBadge",ule],["PrimeBlockUI",dle],["PrimeChip",hle],["PrimeInplace",fle],["PrimeMeterGroup",ple],["PrimeOverlayBadge",mle],["PrimeScrollTop",gle],["PrimeSkeleton",_le],["PrimeProgressBar",yle],["PrimeProgressSpinner",vle],["PrimeTag",ble],["PrimeTerminal",xle],["PrimeForm",wle],["PrimeFormField",Sle]],Ele=Ji({name:"nuxt:global-components",setup(e){for(const[t,n]of Tle)e.vueApp.component(t,n),e.vueApp.component("Lazy"+t,n)}}),Of={"app-wrapper":Nt(()=>gt(()=>import("./DsT_vzJe.js").then(e=>e.a),__vite__mapDeps([204,100,101,102,103,59,60,90,91,205,104,75,87,41,206,80,53,5,6,40,139,74,57,48,54,207,49,50,36,51,208,71,86,209,56,210]),import.meta.url).then(e=>e.default||e)),auth:Nt(()=>gt(()=>import("./nIolDVh8.js"),[],import.meta.url).then(e=>e.default||e)),default:Nt(()=>gt(()=>import("./Dx4YBjnz.js"),__vite__mapDeps([211,212]),import.meta.url).then(e=>e.default||e)),home:Nt(()=>gt(()=>import("./DE1AxGPn.js"),__vite__mapDeps([213,75,1,214]),import.meta.url).then(e=>e.default||e)),share:Nt(()=>gt(()=>import("./BS7bbOLq.js"),__vite__mapDeps([215,206,80,53,5,6,100,101,40,139,74,75,57,48,54,207,49,50,36,51,208]),import.meta.url).then(e=>e.default||e))},Cle=Ji({name:"nuxt:prefetch",setup(e){const t=ps();e.hooks.hook("app:mounted",()=>{t.beforeEach(async n=>{const i=n?.meta?.layout;i&&typeof Of[i]=="function"&&await Of[i]()})}),e.hooks.hook("link:prefetch",n=>{if(bc(n))return;const i=t.resolve(n);if(!i)return;const c=i.meta.layout;let h=A6(i.meta.middleware);h=h.filter(m=>typeof m=="string");for(const m of h)typeof BR[m]=="function"&&BR[m]();typeof c=="string"&&c in Of&&fte(Of[c])})}}),Ale="__NUXT_COLOR_MODE__",Ile="theme",Ple="paseet-theme";let Wd=window[Ale];const Rle=Ji(e=>{const t=CC("color-mode",()=>Fl({preference:Wd.preference,value:Wd.value,unknown:!1,forced:!1})).value;Cy({htmlAttrs:{[`data-${Ile}`]:vn(()=>t.value)}}),ps().afterEach(c=>{const h=c.meta.colorMode;if(h&&h!=="system")A_(t,h),t.forced=!0;else{h==="system"&&console.warn("You cannot force the colorMode to system at the page level."),t.forced=!1;const m=t.preference==="system"?Wd.getColorScheme():t.preference;A_(t,m)}});let n;function i(){n||!window.matchMedia||(n=window.matchMedia("(prefers-color-scheme: dark)"),n.addEventListener("change",()=>{!t.forced&&t.preference==="system"&&A_(t,Wd.getColorScheme())}))}qr(()=>t.preference,c=>{t.forced||(c==="system"?(A_(t,Wd.getColorScheme()),i()):A_(t,c),kle(c))},{immediate:!0}),qr(()=>t.value,(c,h)=>{Wd.removeColorScheme(h),Wd.addColorScheme(c)}),t.preference==="system"&&i(),e.hook("app:mounted",()=>{t.unknown&&(t.preference=Wd.preference,A_(t,Wd.value),t.unknown=!1)}),e.provide("colorMode",t)});function A_(e,t){e.value=t}function kle(e){try{window.localStorage?.setItem(Ple,e)}catch{}}function Mle(e,t){if(e==null)return;let n=e;for(let i=0;i<t.length;i++){if(n===void 0||n[t[i]]===void 0)return;if(n===null||n[t[i]]===null)return null;n=n[t[i]]}return n}
3311function VM(e,t,n){if(n.length===0)return t;const i=n[0];return n.length>1&&(t=VM(typeof e!="object"||e===null||!Object.prototype.hasOwnProperty.call(e,i)?Number.isInteger(Number(n[1]))?[]:{}:e[i],t,Array.prototype.slice.call(n,1))),Number.isInteger(Number(i))&&Array.isArray(e)?e.slice()[i]:Object.assign({},e,{[i]:t})}function Uj(e,t){if(e==null||t.length===0)return e;if(t.length===1){if(e==null)return e;if(Number.isInteger(t[0])&&Array.isArray(e))return Array.prototype.slice.call(e,0).splice(t[0],1);const n={};for(const i in e)n[i]=e[i];return delete n[t[0]],n}if(e[t[0]]==null){if(Number.isInteger(t[0])&&Array.isArray(e))return Array.prototype.concat.call([],e);const n={};for(const i in e)n[i]=e[i];return n}return VM(e,Uj(e[t[0]],Array.prototype.slice.call(t,1)),[t[0]])}function $j(e,t){return t.map(n=>n.split(".")).map(n=>[n,Mle(e,n)]).filter(n=>n[1]!==void 0).reduce((n,i)=>VM(n,i[1],i[0]),{})}function jj(e,t){return t.map(n=>n.split(".")).reduce((n,i)=>Uj(n,i),e)}function e5(e,{storage:t,serializer:n,key:i,debug:c,pick:h,omit:m,beforeHydrate:a,afterHydrate:y},E,C=!0){try{C&&a?.(E);const P=t.getItem(i);if(P){const L=n.deserialize(P),D=h?$j(L,h):L,V=m?jj(D,m):D;e.$patch(V)}C&&y?.(E)}catch(P){c&&console.error("[pinia-plugin-persistedstate]",P)}}function t5(e,{storage:t,serializer:n,key:i,debug:c,pick:h,omit:m}){try{const a=h?$j(e,h):e,y=m?jj(a,m):a,E=n.serialize(y);t.setItem(i,E)}catch(a){c&&console.error("[pinia-plugin-persistedstate]",a)}}function Lle(e,t){return typeof e=="function"?e(t):typeof e=="string"?e:t}function Ole(e,t,n){const{pinia:i,store:c,options:{persist:h=n}}=e;if(!h)return;if(!(c.$id in i.state.value)){const y=i._s.get(c.$id.replace("__hot:",""));y&&Promise.resolve().then(()=>y.$persist());return}const a=(Array.isArray(h)?h:h===!0?[{}]:[h]).map(t);c.$hydrate=({runHooks:y=!0}={})=>{a.forEach(E=>{e5(c,E,e,y)})},c.$persist=()=>{a.forEach(y=>{t5(c.$state,y)})},a.forEach(y=>{e5(c,y,e),c.$subscribe((E,C)=>t5(C,y),{detached:!0})})}function Dle(e){const n=Dl().public.piniaPluginPersistedstate;Ole(e,i=>{const c=Lle(i.key,e.store.$id);return{key:n.key?n.key.replace(/%id/g,c):c,debug:i.debug??n.debug??!1,serializer:i.serializer??{serialize:h=>JSON.stringify(h),deserialize:h=>JSON.parse(h)},storage:i.storage??(n.storage?n.storage==="cookies"?Ob.cookies(n.cookieOptions):Ob[n.storage]():Ob.cookies()),beforeHydrate:i.beforeHydrate,afterHydrate:i.afterHydrate,pick:i.pick,omit:i.omit}},n.auto??!1)}const Fle=Ji({name:"pinia-plugin-persistedstate",setup({$pinia:e}){e.use(Dle)}});function zR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function Ble(e){if(Array.isArray(e))return e}function zle(e){if(Array.isArray(e))return zR(e)}function Nle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vle(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Gj(i.key),i)}}function Ule(e,t,n){return t&&Vle(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function qT(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=UM(e))||t){n&&(e=n);var i=0,c=function(){};return{s:c,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(y){throw y},f:c}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 3312In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var h,m=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var y=n.next();return m=y.done,y},e:function(y){a=!0,h=y},f:function(){try{m||n.return==null||n.return()}finally{if(a)throw h}}}}function Vr(e,t,n){return(t=Gj(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $le(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function jle(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var i,c,h,m,a=[],y=!0,E=!1;try{if(h=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;y=!1}else for(;!(y=(i=h.call(n)).done)&&(a.push(i.value),a.length!==t);y=!0);}catch(C){E=!0,c=C}
3312finally{try{if(!y&&n.return!=null&&(m=n.return(),Object(m)!==m))return}finally{if(E)throw c}}return a}}function Gle(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 3313In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hle(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 3314In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function n5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(c){return Object.getOwnPropertyDescriptor(e,c).enumerable})),n.push.apply(n,i)}return n}function wn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?n5(Object(n),!0).forEach(function(i){Vr(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):n5(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function NC(e,t){return Ble(e)||jle(e,t)||UM(e,t)||Gle()}function lu(e){return zle(e)||$le(e)||UM(e)||Hle()}function Wle(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gj(e){var t=Wle(e,"string");return typeof t=="symbol"?t:t+""}function ME(e){"@babel/helpers - typeof";return ME=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ME(e)}function UM(e,t){if(e){if(typeof e=="string")return zR(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zR(e,t):void 0}}var r5=function(){},$M={},Hj={},Wj=null,qj={mark:r5,measure:r5};try{typeof window<"u"&&($M=window),typeof document<"u"&&(Hj=document),typeof MutationObserver<"u"&&(Wj=MutationObserver),typeof performance<"u"&&(qj=performance)}catch{}var qle=$M.navigator||{},i5=qle.userAgent,o5=i5===void 0?"":i5,Kf=$M,bo=Hj,s5=Wj,hT=qj;Kf.document;var Sh=!!bo.documentElement&&!!bo.head&&typeof bo.addEventListener=="function"&&typeof bo.createElement=="function",Xj=~o5.indexOf("MSIE")||~o5.indexOf("Trident/"),JI,Xle=/fa(k|kd|s|r|l|t|d|dr|dl|dt|b|slr|slpr|wsb|tl|ns|nds|es|gt|jr|jfr|jdr|usb|ufsb|udsb|cr|ss|sr|sl|st|sds|sdr|sdl|sdt)?[\-\ ]/,Zle=/Font ?Awesome ?([567 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit|Notdog Duo|Notdog|Chisel|Etch|Graphite|Thumbprint|Jelly Fill|Jelly Duo|Jelly|Utility|Utility Fill|Utility Duo|Slab Press|Slab|Whiteboard)?.*/i,Zj={classic:{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fab:"brands","fa-brands":"brands"},duotone:{fa:"solid",fad:"solid","fa-solid":"solid","fa-duotone":"solid",fadr:"regular","fa-regular":"regular",fadl:"light","fa-light":"light",fadt:"thin","fa-thin":"thin"},sharp:{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"},"sharp-duotone":{fa:"solid",fasds:"solid","fa-solid":"solid",fasdr:"regular","fa-regular":"regular",fasdl:"light","fa-light":"light",fasdt:"thin","fa-thin":"thin"},slab:{"fa-regular":"regular",faslr:"regular"},"slab-press":{"fa-regular":"regular",faslpr:"regular"},thumbprint:{"fa-light":"light",fatl:"light"},whiteboard:{"fa-semibold":"semibold",fawsb:"semibold"},notdog:{"fa-solid":"solid",fans:"solid"},"notdog-duo":{"fa-solid":"solid",fands:"solid"},etch:{"fa-solid":"solid",faes:"solid"},graphite:{"fa-thin":"thin",fagt:"thin"},jelly:{"fa-regular":"regular",fajr:"regular"},"jelly-fill":{"fa-regular":"regular",fajfr:"regular"},"jelly-duo":{"fa-regular":"regular",fajdr:"regular"},chisel:{"fa-regular":"regular",facr:"regular"},utility:{"fa-semibold":"semibold",fausb:"semibold"},"utility-duo":{"fa-semibold":"semibold",faudsb:"semibold"},"utility-fill":{"fa-semibold":"semibold",faufsb:"semibold"}},Yle={GROUP:"duotone-group",PRIMARY:"primary",SECONDARY:"secondary"},Yj=["fa-classic","fa-duotone","fa-sharp","fa-sharp-duotone","fa-thumbprint","fa-whiteboard","fa-notdog","fa-notdog-duo","fa-chisel","fa-etch","fa-graphite","fa-jelly","fa-jelly-fill","fa-jelly-duo","fa-slab","fa-slab-press","fa-utility","fa-utility-duo","fa-utility-fill"],Zs="classic",$x="duotone",Kj="sharp",Jj="sharp-duotone",Qj="chisel",e8="etch",t8="graphite",n8="jelly",r8="jelly-duo",i8="jelly-fill",o8="notdog",s8="notdog-duo",a8="slab",l8="slab-press",c8="thumbprint",u8="utility",d8="utility-duo",h8="utility-fill",f8="whiteboard",Kle="Classic",Jle="Duotone",Qle="Sharp",ece="Sharp Duotone",tce="Chisel",nce="Etch",rce="Graphite",ice
3314="Jelly",oce="Jelly Duo",sce="Jelly Fill",ace="Notdog",lce="Notdog Duo",cce="Slab",uce="Slab Press",dce="Thumbprint",hce="Utility",fce="Utility Duo",pce="Utility Fill",mce="Whiteboard",p8=[Zs,$x,Kj,Jj,Qj,e8,t8,n8,r8,i8,o8,s8,a8,l8,c8,u8,d8,h8,f8];JI={},Vr(Vr(Vr(Vr(Vr(Vr(Vr(Vr(Vr(Vr(JI,Zs,Kle),$x,Jle),Kj,Qle),Jj,ece),Qj,tce),e8,nce),t8,rce),n8,ice),r8,oce),i8,sce),Vr(Vr(Vr(Vr(Vr(Vr(Vr(Vr(Vr(JI,o8,ace),s8,lce),a8,cce),l8,uce),c8,dce),u8,hce),d8,fce),h8,pce),f8,mce);var gce={classic:{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},duotone:{900:"fad",400:"fadr",300:"fadl",100:"fadt"},sharp:{900:"fass",400:"fasr",300:"fasl",100:"fast"},"sharp-duotone":{900:"fasds",400:"fasdr",300:"fasdl",100:"fasdt"},slab:{400:"faslr"},"slab-press":{400:"faslpr"},whiteboard:{600:"fawsb"},thumbprint:{300:"fatl"},notdog:{900:"fans"},"notdog-duo":{900:"fands"},etch:{900:"faes"},graphite:{100:"fagt"},chisel:{400:"facr"},jelly:{400:"fajr"},"jelly-fill":{400:"fajfr"},"jelly-duo":{400:"fajdr"},utility:{600:"fausb"},"utility-duo":{600:"faudsb"},"utility-fill":{600:"faufsb"}},_ce={"Font Awesome 7 Free":{900:"fas",400:"far"},"Font Awesome 7 Pro":{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},"Font Awesome 7 Brands":{400:"fab",normal:"fab"},"Font Awesome 7 Duotone":{900:"fad",400:"fadr",normal:"fadr",300:"fadl",100:"fadt"},"Font Awesome 7 Sharp":{900:"fass",400:"fasr",normal:"fasr",300:"fasl",100:"fast"},"Font Awesome 7 Sharp Duotone":{900:"fasds",400:"fasdr",normal:"fasdr",300:"fasdl",100:"fasdt"},"Font Awesome 7 Jelly":{400:"fajr",normal:"fajr"},"Font Awesome 7 Jelly Fill":{400:"fajfr",normal:"fajfr"},"Font Awesome 7 Jelly Duo":{400:"fajdr",normal:"fajdr"},"Font Awesome 7 Slab":{400:"faslr",normal:"faslr"},"Font Awesome 7 Slab Press":{400:"faslpr",normal:"faslpr"},"Font Awesome 7 Thumbprint":{300:"fatl",normal:"fatl"},"Font Awesome 7 Notdog":{900:"fans",normal:"fans"},"Font Awesome 7 Notdog Duo":{900:"fands",normal:"fands"},"Font Awesome 7 Etch":{900:"faes",normal:"faes"},"Font Awesome 7 Graphite":{100:"fagt",normal:"fagt"},"Font Awesome 7 Chisel":{400:"facr",normal:"facr"},"Font Awesome 7 Whiteboard":{600:"fawsb",normal:"fawsb"},"Font Awesome 7 Utility":{600:"fausb",normal:"fausb"},"Font Awesome 7 Utility Duo":{600:"faudsb",normal:"faudsb"},"Font Awesome 7 Utility Fill":{600:"faufsb",normal:"faufsb"}},yce=new Map([["classic",{defaultShortPrefixId:"fas",defaultStyleId:"solid",styleIds:["solid","regular","light","thin","brands"],futureStyleIds:[],defaultFontWeight:900}],["duotone",{defaultShortPrefixId:"fad",defaultStyleId:"solid",styleIds:["solid","regular","light","thin"],futureStyleIds:[],defaultFontWeight:900}],["sharp",{defaultShortPrefixId:"fass",defaultStyleId:"solid",styleIds:["solid","regular","light","thin"],futureStyleIds:[],defaultFontWeight:900}],["sharp-duotone",{defaultShortPrefixId:"fasds",defaultStyleId:"solid",styleIds:["solid","regular","light","thin"],futureStyleIds:[],defaultFontWeight:900}],["chisel",{defaultShortPrefixId:"facr",defaultStyleId:"regular",styleIds:["regular"],futureStyleIds:[],defaultFontWeight:400}],["etch",{defaultShortPrefixId:"faes",defaultStyleId:"solid",styleIds:["solid"],futureStyleIds:[],defaultFontWeight:900}],["graphite",{defaultShortPrefixId:"fagt",defaultStyleId:"thin",styleIds:["thin"],futureStyleIds:[],defaultFontWeight:100}],["jelly",{defaultShortPrefixId:"fajr",defaultStyleId:"regular",styleIds:["regular"],futureStyleIds:[],defaultFontWeight:400}],["jelly-duo",{defaultShortPrefixId:"fajdr",defaultStyleId:"regular",styleIds:["regular"],futureStyleIds:[],defaultFontWeight:400}],["jelly-fill",{defaultShortPrefixId:"fajfr",defaultStyleId:"regular",styleIds:["regular"],futureStyleIds:[],defaultFontWeight:400}],["notdog",{defaultShortPrefixId:"fans",defaultStyleId:"solid",styleIds:["solid"],futureStyleIds:[],defaultFontWeight:900}],["notdog-duo",{defaultShortPrefixId:"fands",defaultStyleId:"solid",styleIds:["solid"],futureStyleIds:[],defaultFontWeight:900}],["slab",{defaultShortPrefixId:"faslr",defaultStyleId:"regular",styleIds:["regular"],futureStyleIds:[],defaultFontWeight:400}],["slab-press",{defaultShortPrefixId:"faslpr",defaultStyleId:"regular",styleIds:["regular"],futureStyleIds:[],defaultFontWeight:400}],["thumbprint",{defaultShortPrefixId:"fatl",defaultStyleId:"light",styleIds:["light"],futureStyleIds:[],defaultFontWeight:300}],["utility",{defaultShortPrefixId:"fausb",defaultStyleId:"semibold",styleIds:["semibold"],futureStyleIds:[],defaultFontWeight:600}],["utility-duo",{defaultShortPrefixId:"faudsb",defaultStyleId:"semibold",styleIds:["semibold"],futureStyleIds:[],defaultFontWeight:600}],["utility-fill",{defaultShortPrefixId:"faufsb",defaultStyleId:"semibold",styleIds:["semibold"],futureStyleIds:[],defaultFontWeight:600}],["whiteboard",{defaultShortPrefixId:"fawsb",defaultStyleId:"semibold",styleIds:["semibold"],futureStyleIds:[],defaultFontWeight:600}]]),vce={chisel:{regular:"facr"},classic:{brands:"fab",light:"fal",regular:"far",solid:"fas",thin:"fat"},duotone:{light:"fadl",regular:"fadr",solid:"fad",thin:"fadt"},etch:{solid:"faes"},graphite:{thin:"fagt"},jelly:{regular:"fajr"},"jelly-duo":{regular:"fajdr"},"jelly-fill":{regular:"fajfr"},notdog:{solid:"fans"},"notdog-duo":{solid:"fands"},sharp:{light:"fasl",regular:"fasr",solid:"fass",thin:"fast"},"sharp-duotone":{light:"fasdl",regular:"fasdr",solid:"fasds",thin:"fasdt"},slab:{regular:"faslr"},"slab-press":{regular:"faslpr"},thumbprint:{light:"fatl"},utility:{semibold:"fausb"},"utility-duo":{semibold:"faudsb"},"utility-fill":{semibold:"faufsb"},whiteboard:{semibold:"fawsb"}},m8=["fak","fa-kit","fakd","fa-kit-duotone"],a5={kit:{fak:"kit","fa-kit":"kit"},"kit-duotone":{fakd:"kit-duotone","fa-kit-duotone":"kit-duotone"}},bce=["kit"],xce="kit",wce="kit-duotone",Sce="Kit",Tce="Kit Duotone";Vr(Vr({},xce,Sce),wce,Tce);var Ece={kit:{"fa-kit":"fak"}},Cce={"Font Awesome Kit":{400:"fak",normal:"fak"},"Font Awesome Kit Duotone":{400:"fakd",normal:"fakd"}},Ace={kit:{fak:"fa-kit"}},l5={kit:{kit:"fak"},"kit-duotone":{"kit-duotone":"fakd"}},QI,fT={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},Ice=["fa-classic","fa-duotone","fa-sharp","fa-sharp-duotone","fa-thumbprint","fa-whiteboard","fa-notdog","fa-notdog-duo","fa-chisel","fa-etch","fa-graphite","fa-jelly","fa-jelly-fill","fa-jelly-duo","fa-slab","fa-slab-press","fa-utility","fa-utility-duo","fa-utility-fill"],Pce="classic",Rce="duotone",kce="sharp",Mce="sharp-duotone",Lce
3314="chisel",Oce="etch",Dce="graphite",Fce="jelly",Bce="jelly-duo",zce="jelly-fill",Nce="notdog",Vce="notdog-duo",Uce="slab",$ce="slab-press",jce="thumbprint",Gce="utility",Hce="utility-duo",Wce="utility-fill",qce="whiteboard",Xce="Classic",Zce="Duotone",Yce="Sharp",Kce="Sharp Duotone",Jce="Chisel",Qce="Etch",eue="Graphite",tue="Jelly",nue="Jelly Duo",rue="Jelly Fill",iue="Notdog",oue="Notdog Duo",sue="Slab",aue="Slab Press",lue="Thumbprint",cue="Utility",uue="Utility Duo",due="Utility Fill",hue="Whiteboard";QI={},Vr(Vr(Vr(Vr(Vr(Vr(Vr(Vr(Vr(Vr(QI,Pce,Xce),Rce,Zce),kce,Yce),Mce,Kce),Lce,Jce),Oce,Qce),Dce,eue),Fce,tue),Bce,nue),zce,rue),Vr(Vr(Vr(Vr(Vr(Vr(Vr(Vr(Vr(QI,Nce,iue),Vce,oue),Uce,sue),$ce,aue),jce,lue),Gce,cue),Hce,uue),Wce,due),qce,hue);var fue="kit",pue="kit-duotone",mue="Kit",gue="Kit Duotone";Vr(Vr({},fue,mue),pue,gue);var _ue={classic:{"fa-brands":"fab","fa-duotone":"fad","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"},duotone:{"fa-regular":"fadr","fa-light":"fadl","fa-thin":"fadt"},sharp:{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"},"sharp-duotone":{"fa-solid":"fasds","fa-regular":"fasdr","fa-light":"fasdl","fa-thin":"fasdt"},slab:{"fa-regular":"faslr"},"slab-press":{"fa-regular":"faslpr"},whiteboard:{"fa-semibold":"fawsb"},thumbprint:{"fa-light":"fatl"},notdog:{"fa-solid":"fans"},"notdog-duo":{"fa-solid":"fands"},etch:{"fa-solid":"faes"},graphite:{"fa-thin":"fagt"},jelly:{"fa-regular":"fajr"},"jelly-fill":{"fa-regular":"fajfr"},"jelly-duo":{"fa-regular":"fajdr"},chisel:{"fa-regular":"facr"},utility:{"fa-semibold":"fausb"},"utility-duo":{"fa-semibold":"faudsb"},"utility-fill":{"fa-semibold":"faufsb"}},yue={classic:["fas","far","fal","fat","fad"],duotone:["fadr","fadl","fadt"],sharp:["fass","fasr","fasl","fast"],"sharp-duotone":["fasds","fasdr","fasdl","fasdt"],slab:["faslr"],"slab-press":["faslpr"],whiteboard:["fawsb"],thumbprint:["fatl"],notdog:["fans"],"notdog-duo":["fands"],etch:["faes"],graphite:["fagt"],jelly:["fajr"],"jelly-fill":["fajfr"],"jelly-duo":["fajdr"],chisel:["facr"],utility:["fausb"],"utility-duo":["faudsb"],"utility-fill":["faufsb"]},NR={classic:{fab:"fa-brands",fad:"fa-duotone",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"},duotone:{fadr:"fa-regular",fadl:"fa-light",fadt:"fa-thin"},sharp:{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"},"sharp-duotone":{fasds:"fa-solid",fasdr:"fa-regular",fasdl:"fa-light",fasdt:"fa-thin"},slab:{faslr:"fa-regular"},"slab-press":{faslpr:"fa-regular"},whiteboard:{fawsb:"fa-semibold"},thumbprint:{fatl:"fa-light"},notdog:{fans:"fa-solid"},"notdog-duo":{fands:"fa-solid"},etch:{faes:"fa-solid"},graphite:{fagt:"fa-thin"},jelly:{fajr:"fa-regular"},"jelly-fill":{fajfr:"fa-regular"},"jelly-duo":{fajdr:"fa-regular"},chisel:{facr:"fa-regular"},utility:{fausb:"fa-semibold"},"utility-duo":{faudsb:"fa-semibold"},"utility-fill":{faufsb:"fa-semibold"}},vue=["fa-solid","fa-regular","fa-light","fa-thin","fa-duotone","fa-brands","fa-semibold"],g8=["fa","fas","far","fal","fat","fad","fadr","fadl","fadt","fab","fass","fasr","fasl","fast","fasds","fasdr","fasdl","fasdt","faslr","faslpr","fawsb","fatl","fans","fands","faes","fagt","fajr","fajfr","fajdr","facr","fausb","faudsb","faufsb"].concat(Ice,vue),bue=["solid","regular","light","thin","duotone","brands","semibold"],_8=[1,2,3,4,5,6,7,8,9,10],xue=_8.concat([11,12,13,14,15,16,17,18,19,20]),wue=["aw","fw","pull-left","pull-right"],Sue=[].concat(lu(Object.keys(yue)),bue,wue,["2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","inverse","layers","layers-bottom-left","layers-bottom-right","layers-counter","layers-text","layers-top-left","layers-top-right","li","pull-end","pull-start","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul","width-auto","width-fixed",fT.GROUP,fT.SWAP_OPACITY,fT.PRIMARY,fT.SECONDARY]).concat(_8.map(function(e){return"".concat(e,"x")})).concat(xue.map(function(e){return"w-".concat(e)})),Tue={"Font Awesome 5 Free":{900:"fas",400:"far"}
3314,"Font Awesome 5 Pro":{900:"fas",400:"far",normal:"far",300:"fal"},"Font Awesome 5 Brands":{400:"fab",normal:"fab"},"Font Awesome 5 Duotone":{900:"fad"}},yh="___FONT_AWESOME___",VR=16,y8="fa",v8="svg-inline--fa",Vm="data-fa-i2svg",UR="data-fa-pseudo-element",Eue="data-fa-pseudo-element-pending",jM="data-prefix",GM="data-icon",c5="fontawesome-i2svg",Cue="async",Aue=["HTML","HEAD","STYLE","SCRIPT"],b8=["::before","::after",":before",":after"],x8=(function(){try{return!0}catch{return!1}})();function jx(e){return new Proxy(e,{get:function(n,i){return i in n?n[i]:n[Zs]}})}var w8=wn({},Zj);w8[Zs]=wn(wn(wn(wn({},{"fa-duotone":"duotone"}),Zj[Zs]),a5.kit),a5["kit-duotone"]);var Iue=jx(w8),$R=wn({},vce);$R[Zs]=wn(wn(wn(wn({},{duotone:"fad"}),$R[Zs]),l5.kit),l5["kit-duotone"]);var u5=jx($R),jR=wn({},NR);jR[Zs]=wn(wn({},jR[Zs]),Ace.kit);var HM=jx(jR),GR=wn({},_ue);GR[Zs]=wn(wn({},GR[Zs]),Ece.kit);jx(GR);var Pue=Xle,S8="fa-layers-text",Rue=Zle,kue=wn({},gce);jx(kue);var Mue=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],eP=Yle,Lue=[].concat(lu(bce),lu(Sue)),Bb=Kf.FontAwesomeConfig||{};function Oue(e){var t=bo.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}function Due(e){return e===""?!0:e==="false"?!1:e==="true"?!0:e}if(bo&&typeof bo.querySelector=="function"){var Fue=[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-search-pseudo-elements","searchPseudoElements"],["data-search-pseudo-elements-warnings","searchPseudoElementsWarnings"],["data-search-pseudo-elements-full-scan","searchPseudoElementsFullScan"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]];Fue.forEach(function(e){var t=NC(e,2),n=t[0],i=t[1],c=Due(Oue(n));c!=null&&(Bb[i]=c)})}var T8={styleDefault:"solid",familyDefault:Zs,cssPrefix:y8,replacementClass:v8,autoReplaceSvg:!0,autoAddCss:!0,searchPseudoElements:!1,searchPseudoElementsWarnings:!0,searchPseudoElementsFullScan:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};Bb.familyPrefix&&(Bb.cssPrefix=Bb.familyPrefix);var py=wn(wn({},T8),Bb);py.autoReplaceSvg||(py.observeMutations=!1);var mr={};Object.keys(T8).forEach(function(e){Object.defineProperty(mr,e,{enumerable:!0,set:function(n){py[e]=n,zb.forEach(function(i){return i(mr)})},get:function(){return py[e]}})});Object.defineProperty(mr,"familyPrefix",{enumerable:!0,set:function(t){py.cssPrefix=t,zb.forEach(function(n){return n(mr)})},get:function(){return py.cssPrefix}});Kf.FontAwesomeConfig=mr;var zb=[];function Bue(e){return zb.push(e),function(){zb.splice(zb.indexOf(e),1)}}var I_=VR,ed={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function zue(e){if(!(!e||!Sh)){var t=bo.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e;for(var n=bo.head.childNodes,i=null,c=n.length-1;c>-1;c--){var h=n[c],m=(h.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(m)>-1&&(i=h)}return bo.head.insertBefore(t,i),e}}var Nue="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function d5(){for(var e=12,t="";e-- >0;)t+=Nue[Math.random()*62|0];return t}function Ry(e){for(var t=[],n=(e||[]).length>>>0;n--;)t[n]=e[n];return t}function WM(e){return e.classList?Ry(e.classList):(e.getAttribute("class")||"").split(" ").filter(function(t){return t})}function E8(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function Vue(e){return Object.keys(e||{}).reduce(function(t,n){return t+"".concat(n,'="').concat(E8(e[n]),'" ')},"").trim()}function VC(e){return Object.keys(e||{}).reduce(function(t,n){return t+"".concat(n,": ").concat(e[n].trim(),";")},"")}function qM(e){return e.size!==ed.size||e.x!==ed.x||e.y!==ed.y||e.rotate!==ed.rotate||e.flipX||e.flipY}function Uue(e){var t=e.transform,n=e.containerWidth,i=e.iconWidth,c={transform:"translate(".concat(n/2," 256)")},h="translate(".concat(t.x*32,", ").concat(t.y*32,") "),m="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),a="rotate(".concat(t.rotate," 0 0)"),y={transform:"".concat(h," ").concat(m," ").concat(a)},E={transform:"translate(".concat(i/2*-1," -256)")};return{outer:c,inner:y,path:E}}function $ue(e){var t=e.transform,n=e.width,i=n===void 0?VR:n,c=e.height,h=c===void 0?VR:c,m="";return Xj?m+="translate(".concat(t.x/I_-i/2,"em, ").concat(t.y/I_-h/2,"em) "):m+="translate(calc(-50% + ".concat(t.x/I_,"em), calc(-50% + ").concat(t.y/I_,"em)) "),m+="scale(".concat(t.size/I_*(t.flipX?-1:1),", ").concat(t.size/I_*(t.flipY?-1:1),") "),m+="rotate(".concat(t.rotate,"deg) "),m}var jue=`:root, :host { 3315 --fa-font-solid: normal 900 1em/1 'Font Awesome 7 Free'; 3316 --fa-font-regular: normal 400 1em/1 'Font Awesome 7 Free'; 3317 --fa-font-light: normal 300 1em/1 'Font Awesome 7 Pro'; 3318 --fa-font-thin: normal 100 1em/1 'Font Awesome 7 Pro'; 3319 --fa-font-duotone: normal 900 1em/1 'Font Awesome 7 Duotone'; 3320 --fa-font-duotone-regular: normal 400 1em/1 'Font Awesome 7 Duotone'; 3321 --fa-font-duotone-light: normal 300 1em/1 'Font Awesome 7 Duotone'; 3322 --fa-font-duotone-thin: normal 100 1em/1 'Font Awesome 7 Duotone'; 3323 --fa-font-brands: normal 400 1em/1 'Font Awesome 7 Brands'; 3324 --fa-font-sharp-solid: normal 900 1em/1 'Font Awesome 7 Sharp'; 3325 --fa-font-sharp-regular: normal 400 1em/1 'Font Awesome 7 Sharp'; 3326 --fa-font-sharp-light: normal 300 1em/1 'Font Awesome 7 Sharp'; 3327 --fa-font-sharp-thin: normal 100 1em/1 'Font Awesome 7 Sharp'; 3328 --fa-font-sharp-duotone-solid: normal 900 1em/1 'Font Awesome 7 Sharp Duotone'; 3329 --fa-font-sharp-duotone-regular: normal 400 1em/1 'Font Awesome 7 Sharp Duotone'; 3330 --fa-font-sharp-duotone-light: normal 300 1em/1 'Font Awesome 7 Sharp Duotone'; 3331 --fa-font-sharp-duotone-thin: normal 100 1em/1 'Font Awesome 7 Sharp Duotone'; 3332 --fa-font-slab-regular: normal 400 1em/1 'Font Awesome 7 Slab'; 3333 --fa-font-slab-press-regular: normal 400 1em/1 'Font Awesome 7 Slab Press'; 3334 --fa-font-whiteboard-semibold: normal 600 1em/1 'Font Awesome 7 Whiteboard'; 3335 --fa-font-thumbprint-light: normal 300 1em/1 'Font Awesome 7 Thumbprint'; 3336 --fa-font-notdog-solid: normal 900 1em/1 'Font Awesome 7 Notdog'; 3337 --fa-font-notdog-duo-solid: normal 900 1em/1 'Font Awesome 7 Notdog Duo'; 3338 --fa-font-etch-solid: normal 900 1em/1 'Font Awesome 7 Etch'; 3339 --fa-font-graphite-thin: normal 100 1em/1 'Font Awesome 7 Graphite'; 3340 --fa-font-jelly-regular: normal 400 1em/1 'Font Awesome 7 Jelly'; 3341 --fa-font-jelly-fill-regular: normal 400 1em/1 'Font Awesome 7 Jelly Fill'; 3342 --fa-font-jelly-duo-regular: normal 400 1em/1 'Font Awesome 7 Jelly Duo'; 3343 --fa-font-chisel-regular: normal 400 1em/1 'Font Awesome 7 Chisel'; 3344 --fa-font-utility-semibold: normal 600 1em/1 'Font Awesome 7 Utility'; 3345 --fa-font-utility-duo-semibold: normal 600 1em/1 'Font Awesome 7 Utility Duo'; 3346 --fa-font-utility-fill-semibold: normal 600 1em/1 'Font Awesome 7 Utility Fill'; 3347} 3348 3349.svg-inline--fa { 3350 box-sizing: content-box; 3351 display: var(--fa-display, inline-block); 3352 height: 1em; 3353 overflow: visible; 3354 vertical-align: -0.125em; 3355 width: var(--fa-width, 1.25em); 3356} 3357.svg-inline--fa.fa-2xs { 3358 vertical-align: 0.1em; 3359} 3360.svg-inline--fa.fa-xs { 3361 vertical-align: 0em; 3362} 3363.svg-inline--fa.fa-sm { 3364 vertical-align: -0.0714285714em; 3365} 3366.svg-inline--fa.fa-lg { 3367 vertical-align: -0.2em; 3368} 3369.svg-inline--fa.fa-xl { 3370 vertical-align: -0.25em; 3371} 3372.svg-inline--fa.fa-2xl { 3373 vertical-align: -0.3125em; 3374} 3375.svg-inline--fa.fa-pull-left, 3376.svg-inline--fa .fa-pull-start { 3377 float: inline-start; 3378 margin-inline-end: var(--fa-pull-margin, 0.3em); 3379} 3380.svg-inline--fa.fa-pull-right, 3381.svg-inline--fa .fa-pull-end { 3382 float: inline-end; 3383 margin-inline-start: var(--fa-pull-margin, 0.3em); 3384} 3385.svg-inline--fa.fa-li { 3386 width: var(--fa-li-width, 2em); 3387 inset-inline-start: calc(-1 * var(--fa-li-width, 2em)); 3388 inset-block-start: 0.25em; /* syncing vertical alignment with Web Font rendering */ 3389} 3390 3391.fa-layers-counter, .fa-layers-text { 3392 display: inline-block; 3393 position: absolute; 3394 text-align: center; 3395} 3396 3397.fa-layers { 3398 display: inline-block; 3399 height: 1em; 3400 position: relative; 3401 text-align: center; 3402 vertical-align: -0.125em; 3403 width: var(--fa-width, 1.25em); 3404} 3405.fa-layers .svg-inline--fa { 3406 inset: 0; 3407 margin: auto; 3408 position: absolute; 3409 transform-origin: center center; 3410} 3411 3412.fa-layers-text { 3413 left: 50%; 3414 top: 50%; 3415 transform: translate(-50%, -50%); 3416 transform-origin: center center; 3417} 3418 3419.fa-layers-counter { 3420 background-color: var(--fa-counter-background-color, #ff253a); 3421 border-radius: var(--fa-counter-border-radius, 1em); 3422 box-sizing: border-box; 3423 color: var(--fa-inverse, #fff); 3424 line-height: var(--fa-counter-line-height, 1); 3425 max-width: var(--fa-counter-max-width, 5em); 3426 min-width: var(--fa-counter-min-width, 1.5em); 3427 overflow: hidden; 3428 padding: var(--fa-counter-padding, 0.25em 0.5em); 3429 right: var(--fa-right, 0); 3430 text-overflow: ellipsis; 3431 top: var(--fa-top, 0); 3432 transform: scale(var(--fa-counter-scale, 0.25)); 3433 transform-origin: top right; 3434} 3435 3436.fa-layers-bottom-right { 3437 bottom: var(--fa-bottom, 0); 3438 right: var(--fa-right, 0); 3439 top: auto; 3440 transform: scale(var(--fa-layers-scale, 0.25)); 3441 transform-origin: bottom right; 3442} 3443 3444.fa-layers-bottom-left { 3445 bottom: var(--fa-bottom, 0); 3446 left: var(--fa-left, 0); 3447 right: auto; 3448 top: auto; 3449 transform: scale(var(--fa-layers-scale, 0.25)); 3450 transform-origin: bottom left; 3451} 3452 3453.fa-layers-top-right { 3454 top: var(--fa-top, 0); 3455 right: var(--fa-right, 0); 3456 transform: scale(var(--fa-layers-scale, 0.25)); 3457 transform-origin: top right; 3458} 3459 3460.fa-layers-top-left { 3461 left: var(--fa-left, 0); 3462 right: auto; 3463 top: var(--fa-top, 0); 3464 transform: scale(var(--fa-layers-scale, 0.25)); 3465 transform-origin: top left; 3466} 3467 3468.fa-1x { 3469 font-size: 1em; 3470} 3471 3472.fa-2x { 3473 font-size: 2em; 3474} 3475 3476.fa-3x { 3477 font-size: 3em; 3478} 3479 3480.fa-4x { 3481 font-size: 4em; 3482} 3483 3484.fa-5x { 3485 font-size: 5em; 3486} 3487 3488.fa-6x { 3489 font-size: 6em; 3490} 3491 3492.fa-7x { 3493 font-size: 7em; 3494} 3495 3496.fa-8x { 3497 font-size: 8em; 3498} 3499 3500.fa-9x { 3501 font-size: 9em; 3502} 3503 3504.fa-10x { 3505 font-size: 10em; 3506} 3507 3508.fa-2xs { 3509 font-size: calc(10 / 16 * 1em); /* converts a 10px size into an em-based value that's relative to the scale's 16px base */ 3510 line-height: calc(1 / 10 * 1em); /* sets the line-height of the icon back to that of it's parent */ 3511 vertical-align: calc((6 / 10 - 0.375) * 1em); /* vertically centers the icon taking into account the surrounding text's descender */ 3512} 3513 3514.fa-xs { 3515 font-size: calc(12 / 16 * 1em); /* converts a 12px size into an em-based value that's relative to the scale's 16px base */ 3516 line-height: calc(1 / 12 * 1em); /* sets the line-height of the icon back to that of it's parent */ 3517 vertical-align: calc((6 / 12 - 0.375) * 1em); /* vertically centers the icon taking into account the surrounding text's descender */ 3518} 3519 3520.fa-sm { 3521 font-size: calc(14 / 16 * 1em); /* converts a 14px size into an em-based value that's relative to the scale's 16px base */ 3522 line-height: calc(1 / 14 * 1em); /* sets the line-height of the icon back to that of it's parent */ 3523 vertical-align: calc((6 / 14 - 0.375) * 1em); /* vertically centers the icon taking into account the surrounding text's descender */ 3524} 3525 3526.fa-lg { 3527 font-size: calc(20 / 16 * 1em); /* converts a 20px size into an em-based value that's relative to the scale's 16px base */ 3528 line-height: calc(1 / 20 * 1em); /* sets the line-height of the icon back to that of it's parent */ 3529 vertical-align: calc((6 / 20 - 0.375) * 1em); /* vertically centers the icon taking into account the surrounding text's descender */ 3530} 3531 3532.fa-xl { 3533 font-size: calc(24 / 16 * 1em); /* converts a 24px size into an em-based value that's relative to the scale's 16px base */ 3534 line-height: calc(1 / 24 * 1em); /* sets the line-height of the icon back to that of it's parent */ 3535 vertical-align: calc((6 / 24 - 0.375) * 1em); /* vertically centers the icon taking into account the surrounding text's descender */ 3536} 3537 3538.fa-2xl { 3539 font-size: calc(32 / 16 * 1em); /* converts a 32px size into an em-based value that's relative to the scale's 16px base */ 3540 line-height: calc(1 / 32 * 1em); /* sets the line-height of the icon back to that of it's parent */ 3541 vertical-align: calc((6 / 32 - 0.375) * 1em); /* vertically centers the icon taking into account the surrounding text's descender */ 3542} 3543 3544.fa-width-auto { 3545 --fa-width: auto; 3546} 3547 3548.fa-fw, 3549.fa-width-fixed { 3550 --fa-width: 1.25em; 3551} 3552 3553.fa-ul { 3554 list-style-type: none; 3555 margin-inline-start: var(--fa-li-margin, 2.5em); 3556 padding-inline-start: 0; 3557} 3558.fa-ul > li { 3559 position: relative; 3560} 3561 3562.fa-li { 3563 inset-inline-start: calc(-1 * var(--fa-li-width, 2em)); 3564 position: absolute; 3565 text-align: center; 3566 width: var(--fa-li-width, 2em); 3567 line-height: inherit; 3568} 3569
3570/* Heads Up: Bordered Icons will not be supported in the future! 3571 - This feature will be deprecated in the next major release of Font Awesome (v8)! 3572 - You may continue to use it in this version *v7), but it will not be supported in Font Awesome v8. 3573*/ 3574/* Notes: 3575* --@{v.$css-prefix}-border-width = 1/16 by default (to render as ~1px based on a 16px default font-size) 3576* --@{v.$css-prefix}-border-padding = 3577 ** 3/16 for vertical padding (to give ~2px of vertical whitespace around an icon considering it's vertical alignment) 3578 ** 4/16 for horizontal padding (to give ~4px of horizontal whitespace around an icon) 3579*/ 3580.fa-border { 3581 border-color: var(--fa-border-color, #eee); 3582 border-radius: var(--fa-border-radius, 0.1em); 3583 border-style: var(--fa-border-style, solid); 3584 border-width: var(--fa-border-width, 0.0625em); 3585 box-sizing: var(--fa-border-box-sizing, content-box); 3586 padding: var(--fa-border-padding, 0.1875em 0.25em); 3587} 3588 3589.fa-pull-left, 3590.fa-pull-start { 3591 float: inline-start; 3592 margin-inline-end: var(--fa-pull-margin, 0.3em); 3593} 3594 3595.fa-pull-right, 3596.fa-pull-end { 3597 float: inline-end; 3598 margin-inline-start: var(--fa-pull-margin, 0.3em); 3599} 3600 3601.fa-beat { 3602 animation-name: fa-beat; 3603 animation-delay: var(--fa-animation-delay, 0s); 3604 animation-direction: var(--fa-animation-direction, normal); 3605 animation-duration: var(--fa-animation-duration, 1s); 3606 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 3607 animation-timing-function: var(--fa-animation-timing, ease-in-out); 3608} 3609 3610.fa-bounce { 3611 animation-name: fa-bounce; 3612 animation-delay: var(--fa-animation-delay, 0s); 3613 animation-direction: var(--fa-animation-direction, normal); 3614 animation-duration: var(--fa-animation-duration, 1s); 3615 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 3616 animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1)); 3617} 3618 3619.fa-fade { 3620 animation-name: fa-fade; 3621 animation-delay: var(--fa-animation-delay, 0s); 3622 animation-direction: var(--fa-animation-direction, normal); 3623 animation-duration: var(--fa-animation-duration, 1s); 3624 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 3625 animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); 3626} 3627 3628.fa-beat-fade { 3629 animation-name: fa-beat-fade; 3630 animation-delay: var(--fa-animation-delay, 0s); 3631 animation-direction: var(--fa-animation-direction, normal); 3632 animation-duration: var(--fa-animation-duration, 1s); 3633 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 3634 animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); 3635} 3636 3637.fa-flip { 3638 animation-name: fa-flip; 3639 animation-delay: var(--fa-animation-delay, 0s); 3640 animation-direction: var(--fa-animation-direction, normal); 3641 animation-duration: var(--fa-animation-duration, 1s); 3642 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 3643 animation-timing-function: var(--fa-animation-timing, ease-in-out); 3644} 3645 3646.fa-shake { 3647 animation-name: fa-shake; 3648 animation-delay: var(--fa-animation-delay, 0s); 3649 animation-direction: var(--fa-animation-direction, normal); 3650 animation-duration: var(--fa-animation-duration, 1s); 3651 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 3652 animation-timing-function: var(--fa-animation-timing, linear); 3653} 3654 3655.fa-spin { 3656 animation-name: fa-spin; 3657 animation-delay: var(--fa-animation-delay, 0s); 3658 animation-direction: var(--fa-animation-direction, normal); 3659 animation-duration: var(--fa-animation-duration, 2s); 3660 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 3661 animation-timing-function: var(--fa-animation-timing, linear); 3662} 3663 3664.fa-spin-reverse { 3665 --fa-animation-direction: reverse; 3666} 3667 3668.fa-pulse, 3669.fa-spin-pulse { 3670 animation-name: fa-spin; 3671 animation-direction: var(--fa-animation-direction, normal); 3672 animation-duration: var(--fa-animation-duration, 1s); 3673 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 3674 animation-timing-function: var(--fa-animation-timing, steps(8)); 3675} 3676 3677@media (prefers-reduced-motion: reduce) { 3678 .fa-beat, 3679 .fa-bounce, 3680 .fa-fade, 3681 .fa-beat-fade, 3682 .fa-flip, 3683 .fa-pulse, 3684 .fa-shake, 3685 .fa-spin, 3686 .fa-spin-pulse { 3687 animation: none !important; 3688 transition: none !important; 3689 } 3690} 3691@keyframes fa-beat { 3692 0%, 90% { 3693 transform: scale(1); 3694 } 3695 45% { 3696 transform: scale(var(--fa-beat-scale, 1.25)); 3697 } 3698} 3699@keyframes fa-bounce { 3700 0% { 3701 transform: scale(1, 1) translateY(0); 3702 } 3703 10% { 3704 transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); 3705 } 3706 30% { 3707 transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); 3708 } 3709 50% { 3710 transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); 3711 } 3712 57% { 3713 transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); 3714 } 3715 64% { 3716 transform: scale(1, 1) translateY(0); 3717 } 3718 100% { 3719 transform: scale(1, 1) translateY(0); 3720 } 3721} 3722@keyframes fa-fade { 3723 50% { 3724 opacity: var(--fa-fade-opacity, 0.4); 3725 } 3726} 3727@keyframes fa-beat-fade { 3728 0%, 100% { 3729 opacity: var(--fa-beat-fade-opacity, 0.4); 3730 transform: scale(1); 3731 } 3732 50% { 3733 opacity: 1; 3734 transform: scale(var(--fa-beat-fade-scale, 1.125)); 3735 } 3736} 3737@keyframes fa-flip { 3738 50% { 3739 transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); 3740 } 3741} 3742@keyframes fa-shake { 3743 0% { 3744 transform: rotate(-15deg); 3745 } 3746 4% { 3747 transform: rotate(15deg); 3748 } 3749 8%, 24% { 3750 transform: rotate(-18deg); 3751 } 3752 12%, 28% { 3753 transform: rotate(18deg); 3754 } 3755 16% { 3756 transform: rotate(-22deg); 3757 } 3758 20% { 3759 transform: rotate(22deg); 3760 } 3761 32% { 3762 transform: rotate(-12deg); 3763 } 3764 36% { 3765 transform: rotate(12deg); 3766 } 3767 40%, 100% { 3768 transform: rotate(0deg); 3769 } 3770} 3771@keyframes fa-spin { 3772 0% { 3773 transform: rotate(0deg); 3774 } 3775 100% { 3776 transform: rotate(360deg); 3777 } 3778} 3779.fa-rotate-90 { 3780 transform: rotate(90deg); 3781} 3782 3783.fa-rotate-180 { 3784 transform: rotate(180deg); 3785} 3786 3787.fa-rotate-270 { 3788 transform: rotate(270deg); 3789} 3790 3791.fa-flip-horizontal { 3792 transform: scale(-1, 1); 3793} 3794
3795.fa-flip-vertical { 3796 transform: scale(1, -1); 3797} 3798 3799.fa-flip-both, 3800.fa-flip-horizontal.fa-flip-vertical { 3801 transform: scale(-1, -1); 3802} 3803 3804.fa-rotate-by { 3805 transform: rotate(var(--fa-rotate-angle, 0)); 3806} 3807 3808.svg-inline--fa .fa-primary { 3809 fill: var(--fa-primary-color, currentColor); 3810 opacity: var(--fa-primary-opacity, 1); 3811} 3812 3813.svg-inline--fa .fa-secondary { 3814 fill: var(--fa-secondary-color, currentColor); 3815 opacity: var(--fa-secondary-opacity, 0.4); 3816} 3817 3818.svg-inline--fa.fa-swap-opacity .fa-primary { 3819 opacity: var(--fa-secondary-opacity, 0.4); 3820} 3821 3822.svg-inline--fa.fa-swap-opacity .fa-secondary { 3823 opacity: var(--fa-primary-opacity, 1); 3824} 3825 3826.svg-inline--fa mask .fa-primary, 3827.svg-inline--fa mask .fa-secondary { 3828 fill: black; 3829} 3830 3831.svg-inline--fa.fa-inverse { 3832 fill: var(--fa-inverse, #fff); 3833} 3834 3835.fa-stack { 3836 display: inline-block; 3837 height: 2em; 3838 line-height: 2em; 3839 position: relative; 3840 vertical-align: middle; 3841 width: 2.5em; 3842} 3843 3844.fa-inverse { 3845 color: var(--fa-inverse, #fff); 3846} 3847 3848.svg-inline--fa.fa-stack-1x { 3849 --fa-width: 1.25em; 3850 height: 1em; 3851 width: var(--fa-width); 3852} 3853.svg-inline--fa.fa-stack-2x { 3854 --fa-width: 2.5em; 3855 height: 2em; 3856 width: var(--fa-width); 3857} 3858 3859.fa-stack-1x, 3860.fa-stack-2x { 3861 inset: 0; 3862 margin: auto; 3863 position: absolute; 3864 z-index: var(--fa-stack-z-index, auto); 3865}`;function C8(){var e=y8,t=v8,n=mr.cssPrefix,i=mr.replacementClass,c=jue;if(n!==e||i!==t){var h=new RegExp("\\.".concat(e,"\\-"),"g"),m=new RegExp("\\--".concat(e,"\\-"),"g"),a=new RegExp("\\.".concat(t),"g");c=c.replace(h,".".concat(n,"-")).replace(m,"--".concat(n,"-")).replace(a,".".concat(i))}return c}var h5=!1;function tP(){mr.autoAddCss&&!h5&&(zue(C8()),h5=!0)}var Gue={mixout:function(){return{dom:{css:C8,insertCss:tP}}},hooks:function(){return{beforeDOMElementCreation:function(){tP()},beforeI2svg:function(){tP()}}}},vh=Kf||{};vh[yh]||(vh[yh]={});vh[yh].styles||(vh[yh].styles={});vh[yh].hooks||(vh[yh].hooks={});vh[yh].shims||(vh[yh].shims=[]);var Kc=vh[yh],A8=[],I8=function(){bo.removeEventListener("DOMContentLoaded",I8),LE=1,A8.map(function(t){return t()})},LE=!1;Sh&&(LE=(bo.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(bo.readyState),LE||bo.addEventListener("DOMContentLoaded",I8));function Hue(e){Sh&&(LE?setTimeout(e,0):A8.push(e))}function Gx(e){var t=e.tag,n=e.attributes,i=n===void 0?{}:n,c=e.children,h=c===void 0?[]:c;return typeof e=="string"?E8(e):"<".concat(t," ").concat(Vue(i),">").concat(h.map(Gx).join(""),"</").concat(t,">")}function f5(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}var nP=function(t,n,i,c){var h=Object.keys(t),m=h.length,a=n,y,E,C;for(i===void 0?(y=1,C=t[h[0]]):(y=0,C=i);y<m;y++)E=h[y],C=a(C,t[E],E,t);return C};function P8(e){return lu(e).length!==1?null:e.codePointAt(0).toString(16)}function p5(e){return Object.keys(e).reduce(function(t,n){var i=e[n],c=!!i.icon;return c?t[i.iconName]=i.icon:t[n]=i,t},{})}function HR(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.skipHooks,c=i===void 0?!1:i,h=p5(t);typeof Kc.hooks.addPack=="function"&&!c?Kc.hooks.addPack(e,p5(t)):Kc.styles[e]=wn(wn({},Kc.styles[e]||{}),h),e==="fas"&&HR("fa",t)}var ex=Kc.styles,Wue=Kc.shims,R8=Object.keys(HM),que=R8.reduce(function(e,t){return e[t]=Object.keys(HM[t]),e},{}),XM=null,k8={},M8={},L8={},O8={},D8={};function Xue(e){return~Lue.indexOf(e)}function Zue(e,t){var n=t.split("-"),i=n[0],c=n.slice(1).join("-");return i===e&&c!==""&&!Xue(c)?c:null}var F8=function(){var t=function(h){return nP(ex,function(m,a,y){return m[y]=nP(a,h,{}),m},{})};k8=t(function(c,h,m){if(h[3]&&(c[h[3]]=m),h[2]){var a=h[2].filter(function(y){return typeof y=="number"});a.forEach(function(y){c[y.toString(16)]=m})}return c}),M8=t(function(c,h,m){if(c[m]=m,h[2]){var a=h[2].filter(function(y){return typeof y=="string"});a.forEach(function(y){c[y]=m})}return c}),D8=t(function(c,h,m){var a=h[2];return c[m]=m,a.forEach(function(y){c[y]=m}),c});var n="far"in ex||mr.autoFetchSvg,i=nP(Wue,function(c,h){var m=h[0],a=h[1],y=h[2];return a==="far"&&!n&&(a="fas"),typeof m=="string"&&(c.names[m]={prefix:a,iconName:y}),typeof m=="number"&&(c.unicodes[m.toString(16)]={prefix:a,iconName:y}),c},{names:{},unicodes:{}});L8=i.names,O8=i.unicodes,XM=UC(mr.styleDefault,{family:mr.familyDefault})};Bue(function(e){XM=UC(e.styleDefault,{family:mr.familyDefault})});F8();function ZM(e,t){return(k8[e]||{})[t]}function Yue(e,t){return(M8[e]||{})[t]}function Sm(e,t){return(D8[e]||{})[t]}function B8(e){return L8[e]||{prefix:null,iconName:null}}function Kue(e){var t=O8[e],n=ZM("fas",e);return t||(n?{prefix:"fas",iconName:n}:null)||{prefix:null,iconName:null}}function Jf(){return XM}var z8=function(){return{prefix:null,iconName:null,rest:[]}};function Jue(e){var t=Zs,n=R8.reduce(function(i,c){return i[c]="".concat(mr.cssPrefix,"-").concat(c),i},{});return p8.forEach(function(i){(e.includes(n[i])||e.some(function(c){return que[i].includes(c)}))&&(t=i)}),t}function UC(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.family,i=n===void 0?Zs:n,c=Iue[i][e];if(i===$x&&!e)return"fad";var h=u5[i][e]||u5[i][c],m=e in Kc.styles?e:null,a=h||m||null;return a}function Que(e){var t=[],n=null;return e.forEach(function(i){var c=Zue(mr.cssPrefix,i);c?n=c:i&&t.push(i)}),{iconName:n,rest:t}}function m5(e){return e.sort().filter(function(t,n,i){return i.indexOf(t)===n})}var g5=g8.concat(m8);function $C(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.skipLookups,i=n===void 0?!1:n,c=null,h=m5(e.filter(function(D){return g5.includes(D)})),m=m5(e.filter(function(D){return!g5.includes(D)})),a=h.filter(function(D){return c=D,!Yj.includes(D)}),y=NC(a,1),E=y[0],C=E===void 0?null:E,P=Jue(h),L=wn(wn({},Que(m)),{},{prefix:UC(C,{family:P})});return wn(wn(wn({},L),rde({values:e,family:P,styles:ex,config:mr,canonical:L,givenPrefix:c})),ede(i,c,L))}function ede(e,t,n){var i=n.prefix,c=n.iconName;if(e||!i||!c)return{prefix:i,iconName:c};var h=t==="fa"?B8(c):{},m=Sm(i,c);return c=h.iconName||m||c,i=h.prefix||i,i==="far"&&!ex.far&&ex.fas&&!mr.autoFetchSvg&&(i="fas"),{prefix:i,iconName:c}}var tde=p8.filter(function(e){return e!==Zs||e!==$x}),nde=Object.keys(NR).filter(function(e){return e!==Zs}).map(function(e){return Object.keys(NR[e])}).flat();function rde(e){var t=e.values,n=e.family,i=e.canonical,c=e.givenPrefix,h=c===void 0?"":c,m=e.styles,a=m===void 0?{}:m,y=e.config,E=y===void 0?{}:y,C=n===$x,P=t.includes("fa-duotone")||t.includes("fad"),L=E.familyDefault==="duotone",D=i.prefix==="fad"||i.prefix==="fa-duotone";if(!C&&(P||L||D)&&(i.prefix="fad"),(t.includes("fa-brands")||t.includes("fab"))&&(i.prefix="fab"),!i.prefix&&tde.includes(n)){var V=Object.keys(a).find(function(W){return nde.includes(W)});if(V||E.autoFetchSvg){var U=yce.get(n).defaultShortPrefixId;i.prefix=U,i.iconName=Sm(i.prefix,i.iconName)||i.iconName}}return(i.prefix==="fa"||h==="fa")&&(i.prefix=Jf()||"fas"),i}var ide=(function(){function e(){Nle(this,e),this.definitions={}}return Ule(e,[{key:"add",value:function(){for(var n=this,i=arguments.length,c=new Array(i),h=0;h<i;h++)c[h]=arguments[h];var m=c.reduce(this._pullDefinitions,{});Object.keys(m).forEach(function(a){n.definitions[a]=wn(wn({},n.definitions[a]||{}),m[a]),HR(a,m[a]);var y=HM[Zs][a];y&&HR(y,m[a]),F8()})}},{key:"reset",value:function(){this.definitions={}}},{key:"_pullDefinitions",value:function(n,i){var c=i.prefix&&i.iconName&&i.icon?{0:i}:i;return Object.keys(c).map(function(h){var m=c[h],a=m.prefix,y=m.iconName,E=m.icon,C=E[2];n[a]||(n[a]={}),C.length>
38650&&C.forEach(function(P){typeof P=="string"&&(n[a][P]=E)}),n[a][y]=E}),n}}])})(),_5=[],U_={},Q_={},ode=Object.keys(Q_);function sde(e,t){var n=t.mixoutsTo;return _5=e,U_={},Object.keys(Q_).forEach(function(i){ode.indexOf(i)===-1&&delete Q_[i]}),_5.forEach(function(i){var c=i.mixout?i.mixout():{};if(Object.keys(c).forEach(function(m){typeof c[m]=="function"&&(n[m]=c[m]),ME(c[m])==="object"&&Object.keys(c[m]).forEach(function(a){n[m]||(n[m]={}),n[m][a]=c[m][a]})}),i.hooks){var h=i.hooks();Object.keys(h).forEach(function(m){U_[m]||(U_[m]=[]),U_[m].push(h[m])})}i.provides&&i.provides(Q_)}),n}function WR(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),c=2;c<n;c++)i[c-2]=arguments[c];var h=U_[e]||[];return h.forEach(function(m){t=m.apply(null,[t].concat(i))}),t}function Um(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var c=U_[e]||[];c.forEach(function(h){h.apply(null,n)})}function Qf(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);return Q_[e]?Q_[e].apply(null,t):void 0}function qR(e){e.prefix==="fa"&&(e.prefix="fas");var t=e.iconName,n=e.prefix||Jf();if(t)return t=Sm(n,t)||t,f5(N8.definitions,n,t)||f5(Kc.styles,n,t)}var N8=new ide,ade=function(){mr.autoReplaceSvg=!1,mr.observeMutations=!1,Um("noAuto")},lde={i2svg:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Sh?(Um("beforeI2svg",t),Qf("pseudoElements2svg",t),Qf("i2svg",t)):Promise.reject(new Error("Operation requires a DOM of some kind."))},watch:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.autoReplaceSvgRoot;mr.autoReplaceSvg===!1&&(mr.autoReplaceSvg=!0),mr.observeMutations=!0,Hue(function(){ude({autoReplaceSvgRoot:n}),Um("watch",t)})}},cde={icon:function(t){if(t===null)return null;if(ME(t)==="object"&&t.prefix&&t.iconName)return{prefix:t.prefix,iconName:Sm(t.prefix,t.iconName)||t.iconName};if(Array.isArray(t)&&t.length===2){var n=t[1].indexOf("fa-")===0?t[1].slice(3):t[1],i=UC(t[0]);return{prefix:i,iconName:Sm(i,n)||n}}if(typeof t=="string"&&(t.indexOf("".concat(mr.cssPrefix,"-"))>-1||t.match(Pue))){var c=$C(t.split(" "),{skipLookups:!0});return{prefix:c.prefix||Jf(),iconName:Sm(c.prefix,c.iconName)||c.iconName}}if(typeof t=="string"){var h=Jf();return{prefix:h,iconName:Sm(h,t)||t}}}},zl={noAuto:ade,config:mr,dom:lde,parse:cde,library:N8,findIconDefinition:qR,toHtml:Gx},ude=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.autoReplaceSvgRoot,i=n===void 0?bo:n;(Object.keys(Kc.styles).length>0||mr.autoFetchSvg)&&Sh&&mr.autoReplaceSvg&&zl.dom.i2svg({node:i})};function jC(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map(function(i){return Gx(i)})}}),Object.defineProperty(e,"node",{get:function(){if(Sh){var i=bo.createElement("div");return i.innerHTML=e.html,i.children}}}),e}function dde(e){var t=e.children,n=e.main,i=e.mask,c=e.attributes,h=e.styles,m=e.transform;if(qM(m)&&n.found&&!i.found){var a=n.width,y=n.height,E={x:a/y/2,y:.5};c.style=VC(wn(wn({},h),{},{"transform-origin":"".concat(E.x+m.x/16,"em ").concat(E.y+m.y/16,"em")}))}return[{tag:"svg",attributes:c,children:t}]}function hde(e){var t=e.prefix,n=e.iconName,i=e.children,c=e.attributes,h=e.symbol,m=h===!0?"".concat(t,"-").concat(mr.cssPrefix,"-").concat(n):h;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:wn(wn({},c),{},{id:m}),children:i}]}]}function fde(e){var t=["aria-label","aria-labelledby","title","role"];return t.some(function(n){return n in e})}function YM(e){var t=e.icons,n=t.main,i=t.mask,c=e.prefix,h=e.iconName,m=e.transform,a=e.symbol,y=e.maskId,E=e.extra,C=e.watchable,P=C===void 0?!1:C,L=i.found?i:n,D=L.width,V=L.height,U=[mr.replacementClass,h?"".concat(mr.cssPrefix,"-").concat(h):""].filter(function(ne){return E.classes.indexOf(ne)===-1}).filter(function(ne){return ne!==""||!!ne}).concat(E.classes).join(" "),W={children:[],attributes:wn(wn({},E.attributes),{},{"data-prefix":c,"data-icon":h,class:U,role:E.attributes.role||"img",viewBox:"0 0 ".concat(D," ").concat(V)})};!fde(E.attributes)&&!E.attributes["aria-hidden"]&&(W.attributes["aria-hidden"]="true"),P&&(W.attributes[Vm]="");var $=wn(wn({},W),{}
3865,{prefix:c,iconName:h,main:n,mask:i,maskId:y,transform:m,symbol:a,styles:wn({},E.styles)}),Y=i.found&&n.found?Qf("generateAbstractMask",$)||{children:[],attributes:{}}:Qf("generateAbstractIcon",$)||{children:[],attributes:{}},X=Y.children,K=Y.attributes;return $.children=X,$.attributes=K,a?hde($):dde($)}function y5(e){var t=e.content,n=e.width,i=e.height,c=e.transform,h=e.extra,m=e.watchable,a=m===void 0?!1:m,y=wn(wn({},h.attributes),{},{class:h.classes.join(" ")});a&&(y[Vm]="");var E=wn({},h.styles);qM(c)&&(E.transform=$ue({transform:c,width:n,height:i}),E["-webkit-transform"]=E.transform);var C=VC(E);C.length>0&&(y.style=C);var P=[];return P.push({tag:"span",attributes:y,children:[t]}),P}function pde(e){var t=e.content,n=e.extra,i=wn(wn({},n.attributes),{},{class:n.classes.join(" ")}),c=VC(n.styles);c.length>0&&(i.style=c);var h=[];return h.push({tag:"span",attributes:i,children:[t]}),h}var rP=Kc.styles;function XR(e){var t=e[0],n=e[1],i=e.slice(4),c=NC(i,1),h=c[0],m=null;return Array.isArray(h)?m={tag:"g",attributes:{class:"".concat(mr.cssPrefix,"-").concat(eP.GROUP)},children:[{tag:"path",attributes:{class:"".concat(mr.cssPrefix,"-").concat(eP.SECONDARY),fill:"currentColor",d:h[0]}},{tag:"path",attributes:{class:"".concat(mr.cssPrefix,"-").concat(eP.PRIMARY),fill:"currentColor",d:h[1]}}]}:m={tag:"path",attributes:{fill:"currentColor",d:h}},{found:!0,width:t,height:n,icon:m}}var mde={found:!1,width:512,height:512};function gde(e,t){!x8&&!mr.showMissingIcons&&e&&console.error('Icon with name "'.concat(e,'" and prefix "').concat(t,'" is missing.'))}function ZR(e,t){var n=t;return t==="fa"&&mr.styleDefault!==null&&(t=Jf()),new Promise(function(i,c){if(n==="fa"){var h=B8(e)||{};e=h.iconName||e,t=h.prefix||t}if(e&&t&&rP[t]&&rP[t][e]){var m=rP[t][e];return i(XR(m))}gde(e,t),i(wn(wn({},mde),{},{icon:mr.showMissingIcons&&e?Qf("missingIconAbstract")||{}:{}}))})}var v5=function(){},YR=mr.measurePerformance&&hT&&hT.mark&&hT.measure?hT:{mark:v5,measure:v5},bb='FA "7.2.0"',_de=function(t){return YR.mark("".concat(bb," ").concat(t," begins")),function(){return V8(t)}},V8=function(t){YR.mark("".concat(bb," ").concat(t," ends")),YR.measure("".concat(bb," ").concat(t),"".concat(bb," ").concat(t," begins"),"".concat(bb," ").concat(t," ends"))},KM={begin:_de,end:V8},XT=function(){};function b5(e){var t=e.getAttribute?e.getAttribute(Vm):null;return typeof t=="string"}function yde(e){var t=e.getAttribute?e.getAttribute(jM):null,n=e.getAttribute?e.getAttribute(GM):null;return t&&n}function vde(e){return e&&e.classList&&e.classList.contains&&e.classList.contains(mr.replacementClass)}function bde(){if(mr.autoReplaceSvg===!0)return ZT.replace;var e=ZT[mr.autoReplaceSvg];return e||ZT.replace}function xde(e){return bo.createElementNS("http://www.w3.org/2000/svg",e)}function wde(e){return bo.createElement(e)}function U8(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.ceFn,i=n===void 0?e.tag==="svg"?xde:wde:n;if(typeof e=="string")return bo.createTextNode(e);var c=i(e.tag);Object.keys(e.attributes||[]).forEach(function(m){c.setAttribute(m,e.attributes[m])});var h=e.children||[];return h.forEach(function(m){c.appendChild(U8(m,{ceFn:i}))}),c}function Sde(e){var t=" ".concat(e.outerHTML," ");return t="".concat(t,"Font Awesome fontawesome.com "),t}var ZT={replace:function(t){var n=t[0];
3865if(n.parentNode)if(t[1].forEach(function(c){n.parentNode.insertBefore(U8(c),n)}),n.getAttribute(Vm)===null&&mr.keepOriginalSource){var i=bo.createComment(Sde(n));n.parentNode.replaceChild(i,n)}else n.remove()},nest:function(t){var n=t[0],i=t[1];if(~WM(n).indexOf(mr.replacementClass))return ZT.replace(t);var c=new RegExp("".concat(mr.cssPrefix,"-.*"));if(delete i[0].attributes.id,i[0].attributes.class){var h=i[0].attributes.class.split(" ").reduce(function(a,y){return y===mr.replacementClass||y.match(c)?a.toSvg.push(y):a.toNode.push(y),a},{toNode:[],toSvg:[]});i[0].attributes.class=h.toSvg.join(" "),h.toNode.length===0?n.removeAttribute("class"):n.setAttribute("class",h.toNode.join(" "))}var m=i.map(function(a){return Gx(a)}).join(` 3866`);n.setAttribute(Vm,""),n.innerHTML=m}};function x5(e){e()}function $8(e,t){var n=typeof t=="function"?t:XT;if(e.length===0)n();else{var i=x5;mr.mutateApproach===Cue&&(i=Kf.requestAnimationFrame||x5),i(function(){var c=bde(),h=KM.begin("mutate");e.map(c),h(),n()})}}var JM=!1;function j8(){JM=!0}function KR(){JM=!1}var OE=null;function w5(e){if(s5&&mr.observeMutations){var t=e.treeCallback,n=t===void 0?XT:t,i=e.nodeCallback,c=i===void 0?XT:i,h=e.pseudoElementsCallback,m=h===void 0?XT:h,a=e.observeMutationsRoot,y=a===void 0?bo:a;OE=new s5(function(E){if(!JM){var C=Jf();Ry(E).forEach(function(P){if(P.type==="childList"&&P.addedNodes.length>0&&!b5(P.addedNodes[0])&&(mr.searchPseudoElements&&m(P.target),n(P.target)),P.type==="attributes"&&P.target.parentNode&&mr.searchPseudoElements&&m([P.target],!0),P.type==="attributes"&&b5(P.target)&&~Mue.indexOf(P.attributeName))if(P.attributeName==="class"&&yde(P.target)){var L=$C(WM(P.target)),D=L.prefix,V=L.iconName;P.target.setAttribute(jM,D||C),V&&P.target.setAttribute(GM,V)}else vde(P.target)&&c(P.target)})}}),Sh&&OE.observe(y,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}}function Tde(){OE&&OE.disconnect()}function Ede(e){var t=e.getAttribute("style"),n=[];return t&&(n=t.split(";").reduce(function(i,c){var h=c.split(":"),m=h[0],a=h.slice(1);return m&&a.length>0&&(i[m]=a.join(":").trim()),i},{})),n}function Cde(e){var t=e.getAttribute("data-prefix"),n=e.getAttribute("data-icon"),i=e.innerText!==void 0?e.innerText.trim():"",c=$C(WM(e));return c.prefix||(c.prefix=Jf()),t&&n&&(c.prefix=t,c.iconName=n),c.iconName&&c.prefix||(c.prefix&&i.length>0&&(c.iconName=Yue(c.prefix,e.innerText)||ZM(c.prefix,P8(e.innerText))),!c.iconName&&mr.autoFetchSvg&&e.firstChild&&e.firstChild.nodeType===Node.TEXT_NODE&&(c.iconName=e.firstChild.data)),c}function Ade(e){var t=Ry(e.attributes).reduce(function(n,i){return n.name!=="class"&&n.name!=="style"&&(n[i.name]=i.value),n},{});return t}function Ide(){return{iconName:null,prefix:null,transform:ed,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function S5(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0},n=Cde(e),i=n.iconName,c=n.prefix,h=n.rest,m=Ade(e),a=WR("parseNodeAttributes",{},e),y=t.styleParser?Ede(e):[];return wn({iconName:i,prefix:c,transform:ed,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:h,styles:y,attributes:m}},a)}var Pde=Kc.styles;function G8(e){var t=mr.autoReplaceSvg==="nest"?S5(e,{styleParser:!1}):S5(e);return~t.extra.classes.indexOf(S8)?Qf("generateLayersText",e,t):Qf("generateSvgReplacementMutation",e,t)}function Rde(){return[].concat(lu(m8),lu(g8))}function T5(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!Sh)return Promise.resolve();var n=bo.documentElement.classList,i=function(P){return n.add("".concat(c5,"-").concat(P))},c=function(P){return n.remove("".concat(c5,"-").concat(P))},h=mr.autoFetchSvg?Rde():Yj.concat(Object.keys(Pde));h.includes("fa")||h.push("fa");var m=[".".concat(S8,":not([").concat(Vm,"])")].concat(h.map(function(C){return".".concat(C,":not([").concat(Vm,"])")})).join(", ");if(m.length===0)return Promise.resolve();var a=[];try{a=Ry(e.querySelectorAll(m))}catch{}if(a.length>0)i("pending"),c("complete");else return Promise.resolve();var y=KM.begin("onTree"),E=a.reduce(function(C,P){try{var L=G8(P);L&&C.push(L)}catch(D){x8||D.name==="MissingIcon"&&console.error(D)}return C},[]);return new Promise(function(C,P){Promise.all(E).then(function(L){$8(L,function(){i("active"),i("complete"),c("pending"),typeof t=="function"&&t(),y(),C()})}).catch(function(L){y(),P(L)})})}function kde(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;G8(e).then(function(n){n&&$8([n],t)})}function Mde(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=(t||{}).icon?t:qR(t||{}),c=n.mask;return c&&(c=(c||{}).icon?c:qR(c||{})),e(i,wn(wn({},n),{},{mask:c}))}}var Lde=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.transform,c=i===void 0?ed:i,h=n.symbol,m=h===void 0?!1:h,a=n.mask,y=a===void 0?null:a,E=n.maskId,C=E===void 0?null:E,P=n.classes,L=P===void 0?[]:P,D=n.attributes,V=D===void 0?{}:D,U=n.styles,W=U===void 0?{}:U;if(t){var $=t.prefix,Y=t.iconName,X=t.icon;return jC(wn({type:"icon"},t),function(){return Um("beforeDOMElementCreation",{iconDefinition:t,params:n}),YM({icons:{main:XR(X),mask:y?XR(y.icon):{found:!1,width:null,height:null,icon:{}}},prefix:$,iconName:Y,transform:wn(wn({},ed),c),symbol:m,maskId:C,extra:{attributes:V,styles:W,classes:L}})})}},Ode={mixout:function(){return{icon:Mde(Lde)}},hooks:function(){return{mutationObserverCallbacks:function(n){return n.treeCallback=T5,n.nodeCallback=kde,n}}},provides:function(t){t.i2svg=function(n){var i=n.node,c=i===void 0?bo:i,h=n.callback,m=h===void 0?function(){}:h;return T5(c,m)},t.generateSvgReplacementMutation=function(n,i){var c=i.iconName,h=i.prefix,m=i.transform,a=i.symbol,y=i.mask,E=i.maskId,C=i.extra;return new Promise(function(P,L){Promise.all([ZR(c,h),y.iconName?ZR(y.iconName,y.prefix):Promise.resolve({foun
3866d:!1,width:512,height:512,icon:{}})]).then(function(D){var V=NC(D,2),U=V[0],W=V[1];P([n,YM({icons:{main:U,mask:W},prefix:h,iconName:c,transform:m,symbol:a,maskId:E,extra:C,watchable:!0})])}).catch(L)})},t.generateAbstractIcon=function(n){var i=n.children,c=n.attributes,h=n.main,m=n.transform,a=n.styles,y=VC(a);y.length>0&&(c.style=y);var E;return qM(m)&&(E=Qf("generateAbstractTransformGrouping",{main:h,transform:m,containerWidth:h.width,iconWidth:h.width})),i.push(E||h.icon),{children:i,attributes:c}}}},Dde={mixout:function(){return{layer:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=i.classes,h=c===void 0?[]:c;return jC({type:"layer"},function(){Um("beforeDOMElementCreation",{assembler:n,params:i});var m=[];return n(function(a){Array.isArray(a)?a.map(function(y){m=m.concat(y.abstract)}):m=m.concat(a.abstract)}),[{tag:"span",attributes:{class:["".concat(mr.cssPrefix,"-layers")].concat(lu(h)).join(" ")},children:m}]})}}}},Fde={mixout:function(){return{counter:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};i.title;var c=i.classes,h=c===void 0?[]:c,m=i.attributes,a=m===void 0?{}:m,y=i.styles,E=y===void 0?{}:y;return jC({type:"counter",content:n},function(){return Um("beforeDOMElementCreation",{content:n,params:i}),pde({content:n.toString(),extra:{attributes:a,styles:E,classes:["".concat(mr.cssPrefix,"-layers-counter")].concat(lu(h))}})})}}}},Bde={mixout:function(){return{text:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=i.transform,h=c===void 0?ed:c,m=i.classes,a=m===void 0?[]:m,y=i.attributes,E=y===void 0?{}:y,C=i.styles,P=C===void 0?{}:C;return jC({type:"text",content:n},function(){return Um("beforeDOMElementCreation",{content:n,params:i}),y5({content:n,transform:wn(wn({},ed),h),extra:{attributes:E,styles:P,classes:["".concat(mr.cssPrefix,"-layers-text")].concat(lu(a))}})})}}},provides:function(t){t.generateLayersText=function(n,i){var c=i.transform,h=i.extra,m=null,a=null;if(Xj){var y=parseInt(getComputedStyle(n).fontSize,10),E=n.getBoundingClientRect();m=E.width/y,a=E.height/y}return Promise.resolve([n,y5({content:n.innerHTML,width:m,height:a,transform:c,extra:h,watchable:!0})])}}},H8=new RegExp('"',"ug"),E5=[1105920,1112319],C5=wn(wn(wn(wn({},{FontAwesome:{normal:"fas",400:"fas"}}),_ce),Tue),Cce),JR=Object.keys(C5).reduce(function(e,t){return e[t.toLowerCase()]=C5[t],e},{}),zde=Object.keys(JR).reduce(function(e,t){var n=JR[t];return e[t]=n[900]||lu(Object.entries(n))[0][1],e},{});function Nde(e){var t=e.replace(H8,"");return P8(lu(t)[0]||"")}function Vde(e){var t=e.getPropertyValue("font-feature-settings").includes("ss01"),n=e.getPropertyValue("content"),i=n.replace(H8,""),c=i.codePointAt(0),h=c>=E5[0]&&c<=E5[1],m=i.length===2?i[0]===i[1]:!1;return h||m||t}function Ude(e,t){var n=e.replace(/^['"]|['"]$/g,"").toLowerCase(),i=parseInt(t),c=isNaN(i)?"normal":i;return(JR[n]||{})[c]||zde[n]}function A5(e,t){var n="".concat(Eue).concat(t.replace(":","-"));return new Promise(function(i,c){if(e.getAttribute(n)!==null)return i();var h=Ry(e.children),m=h.filter(function(fe){return fe.getAttribute(UR)===t})[0],a=Kf.getComputedStyle(e,t),y=a.getPropertyValue("font-family"),E=y.match(Rue),C=a.getPropertyValue("font-weight"),P=a.getPropertyValue("content");if(m&&!E)return e.removeChild(m),i();if(E&&P!=="none"&&P!==""){var L=a.getPropertyValue("content"),D=Ude(y,C),V=Nde(L),U=E[0].startsWith("FontAwesome"),W=Vde(a),$=ZM(D,V),Y=$;if(U){var X=Kue(V);X.iconName&&X.prefix&&($=X.iconName,D=X.prefix)}if($&&!W&&(!m||m.getAttribute(jM)!==D||m.getAttribute(GM)!==Y)){e.setAttribute(n,Y),m&&e.removeChild(m);var K=Ide(),ne=K.extra;ne.attributes[UR]=t,ZR($,D).then(function(fe){var ye=YM(wn(wn({},K),{},{icons:{main:fe,mask:z8()},prefix:D,iconName:Y,extra:ne,watchable:!0})),ke=bo.createElementNS("http://www.w3.org/2000/svg","svg");t==="::before"?e.insertBefore(ke,e.firstChild):e.appendChild(ke),ke.outerHTML=ye.map(function(Fe){return Gx(Fe)}).join(` 3867`),e.removeAttribute(n),i()}).catch(c)}else i()}else i()})}function $de(e){return Promise.all([A5(e,"::before"),A5(e,"::after")])}
3867function jde(e){return e.parentNode!==document.head&&!~Aue.indexOf(e.tagName.toUpperCase())&&!e.getAttribute(UR)&&(!e.parentNode||e.parentNode.tagName!=="svg")}var Gde=function(t){return!!t&&b8.some(function(n){return t.includes(n)})},Hde=function(t){if(!t)return[];var n=new Set,i=t.split(/,(?![^()]*\))/).map(function(y){return y.trim()});i=i.flatMap(function(y){return y.includes("(")?y:y.split(",").map(function(E){return E.trim()})});var c=qT(i),h;try{for(c.s();!(h=c.n()).done;){var m=h.value;if(Gde(m)){var a=b8.reduce(function(y,E){return y.replace(E,"")},m);a!==""&&a!=="*"&&n.add(a)}}}catch(y){c.e(y)}finally{c.f()}return n};function I5(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Sh){var n;if(t)n=e;else if(mr.searchPseudoElementsFullScan)n=e.querySelectorAll("*");else{var i=new Set,c=qT(document.styleSheets),h;try{for(c.s();!(h=c.n()).done;){var m=h.value;try{var a=qT(m.cssRules),y;try{for(a.s();!(y=a.n()).done;){var E=y.value,C=Hde(E.selectorText),P=qT(C),L;try{for(P.s();!(L=P.n()).done;){var D=L.value;i.add(D)}}catch(U){P.e(U)}finally{P.f()}}}catch(U){a.e(U)}finally{a.f()}}catch(U){mr.searchPseudoElementsWarnings&&console.warn("Font Awesome: cannot parse stylesheet: ".concat(m.href," (").concat(U.message,`) 3868If it declares any Font Awesome CSS pseudo-elements, they will not be rendered as SVG icons. Add crossorigin="anonymous" to the <link>, enable searchPseudoElementsFullScan for slower but more thorough DOM parsing, or suppress this warning by setting searchPseudoElementsWarnings to false.`))}}}catch(U){c.e(U)}finally{c.f()}if(!i.size)return;var V=Array.from(i).join(", ");try{n=e.querySelectorAll(V)}catch{}}return new Promise(function(U,W){var $=Ry(n).filter(jde).map($de),Y=KM.begin("searchPseudoElements");j8(),Promise.all($).then(function(){Y(),KR(),U()}).catch(function(){Y(),KR(),W()})})}}var Wde={hooks:function(){return{mutationObserverCallbacks:function(n){return n.pseudoElementsCallback=I5,n}}},provides:function(t){t.pseudoElements2svg=function(n){var i=n.node,c=i===void 0?bo:i;mr.searchPseudoElements&&I5(c)}}},P5=!1,qde={mixout:function(){return{dom:{unwatch:function(){j8(),P5=!0}}}},hooks:function(){return{bootstrap:function(){w5(WR("mutationObserverCallbacks",{}))},noAuto:function(){Tde()},watch:function(n){var i=n.observeMutationsRoot;P5?KR():w5(WR("mutationObserverCallbacks",{observeMutationsRoot:i}))}}}},R5=function(t){var n={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return t.toLowerCase().split(" ").reduce(function(i,c){var h=c.toLowerCase().split("-"),m=h[0],a=h.slice(1).join("-");if(m&&a==="h")return i.flipX=!0,i;if(m&&a==="v")return i.flipY=!0,i;if(a=parseFloat(a),isNaN(a))return i;switch(m){case"grow":i.size=i.size+a;break;case"shrink":i.size=i.size-a;break;case"left":i.x=i.x-a;break;case"right":i.x=i.x+a;break;case"up":i.y=i.y-a;break;case"down":i.y=i.y+a;break;case"rotate":i.rotate=i.rotate+a;break}return i},n)},Xde={mixout:function(){return{parse:{transform:function(n){return R5(n)}}}},hooks:function(){return{parseNodeAttributes:function(n,i){var c=i.getAttribute("data-fa-transform");return c&&(n.transform=R5(c)),n}}},provides:function(t){t.generateAbstractTransformGrouping=function(n){var i=n.main,c=n.transform,h=n.containerWidth,m=n.iconWidth,a={transform:"translate(".concat(h/2," 256)")},y="translate(".concat(c.x*32,", ").concat(c.y*32,") "),E="scale(".concat(c.size/16*(c.flipX?-1:1),", ").concat(c.size/16*(c.flipY?-1:1),") "),C="rotate(".concat(c.rotate," 0 0)"),P={transform:"".concat(y," ").concat(E," ").concat(C)},L={transform:"translate(".concat(m/2*-1," -256)")},D={outer:a,inner:P,path:L};return{tag:"g",attributes:wn({},D.outer),children:[{tag:"g",attributes:wn({},D.inner),children:[{tag:i.icon.tag,children:i.icon.children,attributes:wn(wn({},i.icon.attributes),D.path)}]}]}}}},iP={x:0,y:0,width:"100%",height:"100%"};function k5(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e.attributes&&(e.attributes.fill||t)&&(e.attributes.fill="black"),e}function Zde(e){return e.tag==="g"?e.children:[e]}var Yde={hooks:function(){return{parseNodeAttributes:function(n,i){var c=i.getAttribute("data-fa-mask"),h=c?$C(c.split(" ").map(function(m){return m.trim()})):z8();return h.prefix||(h.prefix=Jf()),n.mask=h,n.maskId=i.getAttribute("data-fa-mask-id"),n}}},provides:function(t){t.generateAbstractMask=function(n){var i=n.children,c=n.attributes,h=n.main,m=n.mask,a=n.maskId,y=n.transform,E=h.width,C=h.icon,P=m.width,L=m.icon,D=Uue({transform:y,containerWidth:P,iconWidth:E}),V={tag:"rect",attributes:wn(wn({},iP),{},{fill:"white"})},U=C.children?{children:C.children.map(k5)}:{},W={tag:"g",attributes:wn({},D.inner),children:[k5(wn({tag:C.tag,attributes:wn(wn({},C.attributes),D.path)},U))]},$={tag:"g",attributes:wn({},D.outer),children:[W]},Y="mask-".concat(a||d5()),X="clip-".concat(a||d5()),K={tag:"mask",attributes:wn(wn({},iP),{},{id:Y,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[V,$]},ne={tag:"defs",children:[{tag:"clipPath",attributes:{id:X},children:Zde(L)},K]};
3868return i.push(ne,{tag:"rect",attributes:wn({fill:"currentColor","clip-path":"url(#".concat(X,")"),mask:"url(#".concat(Y,")")},iP)}),{children:i,attributes:c}}}},Kde={provides:function(t){var n=!1;Kf.matchMedia&&(n=Kf.matchMedia("(prefers-reduced-motion: reduce)").matches),t.missingIconAbstract=function(){var i=[],c={fill:"currentColor"},h={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};i.push({tag:"path",attributes:wn(wn({},c),{},{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})});var m=wn(wn({},h),{},{attributeName:"opacity"}),a={tag:"circle",attributes:wn(wn({},c),{},{cx:"256",cy:"364",r:"28"}),children:[]};return n||a.children.push({tag:"animate",attributes:wn(wn({},h),{},{attributeName:"r",values:"28;14;28;28;14;28;"})},{tag:"animate",attributes:wn(wn({},m),{},{values:"1;0;1;1;0;1;"})}),i.push(a),i.push({tag:"path",attributes:wn(wn({},c),{},{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),children:n?[]:[{tag:"animate",attributes:wn(wn({},m),{},{values:"1;0;0;0;0;1;"})}]}),n||i.push({tag:"path",attributes:wn(wn({},c),{},{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),children:[{tag:"animate",attributes:wn(wn({},m),{},{values:"0;0;1;1;0;0;"})}]}),{tag:"g",attributes:{class:"missing"},children:i}}}},Jde={hooks:function(){return{parseNodeAttributes:function(n,i){var c=i.getAttribute("data-fa-symbol"),h=c===null?!1:c===""?!0:c;return n.symbol=h,n}}}},Qde=[Gue,Ode,Dde,Fde,Bde,Wde,qde,Xde,Yde,Kde,Jde];sde(Qde,{mixoutsTo:zl});zl.noAuto;var ehe=zl.config,the=zl.library;zl.dom;zl.parse;zl.findIconDefinition;zl.toHtml;zl.icon;zl.layer;zl.text;zl.counter;const nhe={};ehe.autoAddCss=!1;const rhe=Ji(()=>{the.add(nhe)});function ihe(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const DE=typeof window<"u",rp=(e,t=!1)=>t?Symbol.for(e):Symbol(e),ohe=(e,t,n)=>she({l:e,k:t,s:n}),she=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),fs=e=>typeof e=="number"&&isFinite(e),W8=e=>HC(e)==="[object Date]",FE=e=>HC(e)==="[object RegExp]",GC=e=>Mi(e)&&Object.keys(e).length===0,Uo=Object.assign,ahe=Object.create,Ni=(e=null)=>ahe(e);function M5(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function lhe(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}const che=/^\s*javascript\s*(?::|�*58;?|�*3a;
3868?|:?)/i,uhe=/^(?:href|src|action|formaction)$/i;function QM(e){return che.test(e)}function dhe(e){const t=/url\s*\(/gi;let n="",i=0,c;for(;(c=t.exec(e))!==null;){const h=c.index,m=t.lastIndex-1;let a=m+1,y=1,E=null;for(;a<e.length;a++){const L=e[a];if(E){L===E&&(E=null);continue}if(L==='"'||L==="'")E=L;else if(L==="(")y++;else if(L===")"&&(y--,y===0))break}if(y!==0)break;const C=e.slice(m+1,a).trim(),P=C.startsWith('"')&&C.endsWith('"')||C.startsWith("'")&&C.endsWith("'")?C.slice(1,-1).trim():C;n+=e.slice(i,h),n+=QM(P)?"url(about:blank)":e.slice(h,a+1),i=a+1}return n+e.slice(i)}function L5(e,t){if(uhe.test(e)&&QM(t))return"about:blank";const n=e.toLowerCase()==="style"?dhe(t):t;return lhe(n)}function hhe(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,i,c)=>`${i}="${L5(i,c)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,i,c)=>`${i}='${L5(i,c)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(e)&&(e=e.replace(/(\s+)(on)(\w+\s*=)/gi,"$1on$3")),e=e.replace(/(\s+(?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi,(n,i,c)=>QM(c)?`${i}about:blank`:n),e}const fhe=Object.prototype.hasOwnProperty;function mc(e,t){return fhe.call(e,t)}const Ho=Array.isArray,yo=e=>typeof e=="function",Wn=e=>typeof e=="string",No=e=>typeof e=="boolean",gi=e=>e!==null&&typeof e=="object",phe=e=>gi(e)&&yo(e.then)&&yo(e.catch),q8=Object.prototype.toString,HC=e=>q8.call(e),Mi=e=>HC(e)==="[object Object]",mhe=e=>e==null?"":Ho(e)||Mi(e)&&e.toString===q8?JSON.stringify(e,null,2):String(e);function eL(e,t=""){return e.reduce((n,i,c)=>c===0?n+i:n+t+i,"")}const pT=e=>!gi(e)||Ho(e);function ey(e,t){if(pT(e)||pT(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:i,des:c}=n.pop();
3868Object.keys(i).forEach(h=>{h!=="__proto__"&&(gi(i[h])&&!gi(c[h])&&(c[h]=Array.isArray(i[h])?[]:Ni()),pT(c[h])||pT(i[h])?c[h]=i[h]:n.push({src:i[h],des:c[h]}))})}}function ghe(e,t=e.getCurrentLanguage(),n=e.getCurrentDirection()){const i={htmlAttrs:{},link:[],meta:[]};if(e.dir&&(i.htmlAttrs.dir=n),e.lang&&t&&(i.htmlAttrs.lang=t),e.seo){const c=yhe(e);i.link=i.link.concat(c,bhe(e)),i.meta=i.meta.concat(xhe(e),whe(e),She(e,e.locales.map(h=>h.language||h.code)))}return i}function _he(e){const t=new Map;for(const n of e){if(!n.language){console.warn("Locale `language` ISO code is required to generate alternate link");continue}const[i,c]=n.language.split("-");i&&c&&(n.isCatchallLocale||!t.has(i))&&t.set(i,n),t.set(n.language,n)}return t}function yhe(e){if(!e.hreflangLinks)return[];const t=[],n=_he(e.locales);for(const[i,c]of n.entries()){const h=vhe(i,c,e);h&&(t.push(h),e.defaultLocale&&e.defaultLocale===c.code&&t[0].hreflang!=="x-default"&&t.unshift({[e.key]:"i18n-xd",rel:"alternate",href:h.href,hreflang:"x-default"}))}return t}function vhe(e,t,n,i=n.strictCanonicals?n.getRouteWithoutQuery():void 0){const c=n.getLocalizedRoute(t.code,i);if(!c)return;const h=SC(bc(c)?c:Uf(n.baseUrl,c),n.strictCanonicals?Z8(n):{});return{[n.key]:`i18n-alt-${e}`,rel:"alternate",href:h,hreflang:e}}function X8(e,t=e.getCurrentRoute()){const n=e.getLocaleRoute(Object.assign({},t,{path:void 0,name:e.getRouteBaseName(t)}));return n?SC(Uf(e.baseUrl,n.path),Z8(e)):""}function bhe(e,t=X8(e)){return t?[{[e.key]:"i18n-can",rel:"canonical",href:t}]:[]}function Z8(e,t=e.getCurrentRoute()){const i=e.getLocaleRoute(Object.assign({},t,{path:void 0,name:e.getRouteBaseName(t)}))?.query??{},c={};for(const h of e.canonicalQueries.filter(m=>m in i)){c[h]??=[];for(const m of The(i[h]))c[h].push(m||"")}return c}function xhe(e,t=X8(e)){return t?[{[e.key]:"i18n-og-url",property:"og:url",content:t}]:[]}function whe(e,t=e.getCurrentLanguage()){return t?[{[e.key]:"i18n-og",property:"og:locale",content:Y8(t)}]:[]}function She(e,t,n=e.getCurrentLanguage()){return t.filter(c=>c&&c!==n).map(c=>({[e.key]:`i18n-og-alt-${c}`,property:"og:locale:alternate",content:Y8(c)}))}function Y8(e=""){return e.replace(/-/g,"_")}function The(e){return Array.isArray(e)?e:[e]}function BE(e,t,n=e.getLocale()){if(Wn(t)&&bc(t,{acceptRelative:!0}))return t;try{return J8(e,t,n).fullPath}catch{return""}}function K8(e,t,n=e.getLocale()){try{return J8(e,t,n)}catch{return}}function Ehe(e){if(!Wn(e))return Uo({},e);if(e[0]==="/"){const{pathname:t,search:n,hash:i}=nR(e);return{path:t,query:wC(n),hash:i}}return{name:e}}function J8(e,t,n){const i=Ehe(t),c=e.router.resolve(e.resolveLocalizedRouteObject(i,n));return c.name?c:e.router.resolve(t)}function tL(e,t,n=e.router.currentRoute.value){const i=e.getRouteBaseName(n);if(!i)return"";const c={name:i,params:Uo({},n.params,e.getLocalizedDynamicParams(t)),fullPath:n.fullPath,query:n.query,hash:n.hash,path:n.path,meta:n.meta},h=BE(e,c,t);return e.afterSwitchLocalePath(h,t)}function Che(e,t,n=e.getLocale(),i=e.getLocales(),c=e.getBaseUrl()){const h=i.find(a=>a.code===n)||{},m=typeof t.seo=="object"&&t.seo?.canonicalQueries||[];return c||console.warn("I18n `baseUrl` is required to generate valid SEO tag links."),{...t,key:"id",locales:i,baseUrl:c,canonicalQueries:m,hreflangLinks:e.routingOptions.hreflangLinks,defaultLocale:e.routingOptions.defaultLocale,strictCanonicals:e.routingOptions.strictCanonicals,getRouteBaseName:e.getRouteBaseName,getCurrentRoute:()=>e.router.currentRoute.value,getCurrentLanguage:()=>h.language,getCurrentDirection:()=>h.dir||"ltr",getLocaleRoute:a=>K8(e,a),getLocalizedRoute:(a,y)=>tL(e,a,y),getRouteWithoutQuery:()=>{try{return Uo({},e.router.resolve({query:{}}),{meta:e.router.currentRoute.value.meta})}catch{return}}}}function Ahe(e,{dir:t=!0,lang:n=!0,seo:i=!0}){return ghe(Che(e,{dir:t,lang:n,seo:i}))}function Ihe(e=0){return t=>{const c=(typeof t=="string"?t:t.pathname).split("?")[0].split("/");return c[0]===""&&c.shift(),c.length>e&&c[e]||""}}const WC="___",Phe="default",mOe=WC+Phe;function Q8(e){return typeof e=="string"?e:e!=null?e.toString():""}function oP(e){return Q8(typeof e=="object"?e?.name:e).split(WC)[0]}function Rhe(e,t,n){return e+WC+t}const khe=Ihe(0),QR=e=>khe(e),Mhe=e=>e.split(WC).at(1)??"";function Lhe(e){return String(typeof e!="object"?e:e?.name||e?.path||"")}function Ohe(e){const t=Lhe(e);if(t[0]==="/")return QR(t);const n=Mhe(t);return n||(typeof e=="object"&&e?.path?QR(String(e.path)):"")}function Dhe(e){return(t,n)=>Rhe(Q8(t),n)}function Fhe(e){return(t,n)=>{const i="/"+n+(t.path==="/"?"":t.path),c=e.options.routes.find(h=>h.path===i);return c!=null?e.resolve(Uo({},t,c,{path:i})):t}}const tx=["ar","en"],zE={ar:[{key:"locale_ar_46json_74968d73",load:()=>gt(()=>import("./AVdcK_p6.js"),[],import.meta.url),cache:!0}],en:[{key:"locale_en_46json_de1f7595",load:()=>gt(()=>import("./e8dmDESf.js"),[],import.meta.url),cache:!0}]},Bhe=[()=>gt(()=>
3868import("./C17z7VQ0.js"),[],import.meta.url)],Hx=[{code:"ar",dir:"rtl",language:void 0},{code:"en",dir:"ltr",language:void 0}],e9=new Map,zhe=V$((e,t,n)=>{if(t==="messages"||t==="datetimeFormats"||t==="numberFormats")return e[t]??=Ni(null),ey(n,e[t]),!0});async function Nhe(e){const t=rr();let n={messages:Ni(null)};for(const i of e){const c=await i().then(m=>t9(m)?m.default:m),h=yo(c)?await t.runWithContext(()=>c()):c;n=zhe(Ni(null),h,n)}return n.fallbackLocale??=!1,n}const t9=e=>HC(e)==="[object Module]";async function Vhe(e,t){const n=rr();try{const i=await n.runWithContext(t.load).then(c=>t9(c)?c.default:c);return yo(i)?await n.runWithContext(()=>i(e)):i}catch(i){throw new Error(`Failed loading locale (${e}): `+i.message)}}async function Uhe(e,t=[]){const n=rr(),i=await Promise.all(t.map(async h=>{const m=$he(h),a=m||await n.runWithContext(()=>Vhe(e,h));return!m&&h.cache!==!1&&e9.set(h.key,{ttl:Date.now()+86400*1e3,value:a}),a})),c={};for(const h of i)ey(h,c);return c}function $he(e){if(e.cache===!1)return;const t=e9.get(e.key);if(t!=null)return t.ttl>Date.now()?t.value:void 0}function nL(e){return e!=null&&"global"in e&&"mode"in e?e.global:e}function mT(e){const t=nL(e);return"__composer"in t?t.__composer:t}function qC(e,t){return e?e.$config.public.i18n:Dl().public.i18n}function Wx(e){const t=qC(e).detectBrowserLanguage,n=t||{};return{...n,enabled:!!t,cookieKey:n.cookieKey||"i18n_redirected"}}function jhe(e){if(e)return{path:"/"+(Wn(e)?e:e.path).replace(/^\//,""),code:!Wn(e)&&e.statusCode||302}}function Ghe(e){return Array.isArray(e)?e:[e]}function Hhe(e,t,n){const i=(h="")=>h.replace(/https?:\/\//,""),c=e.filter(h=>i(h.domain)===t||Ghe(h.domains).includes(t));return c.length<=1?c[0]?.code:c.find(h=>h.code===n)?.code||c.find(h=>h.defaultForDomains?.includes(t)??h.domainDefault)?.code}function Whe(e,t,n){const i=Hx.find(h=>h.code===n),c=e?.[n]?.domain||i?.domain||i?.domains?.find(h=>h===t.host);if(c)return bc(c,{strict:!0})?c:t.protocol+"//"+c}function qhe(e){const t={};for(const n of tx){const i=Xhe(e,[n]),c=Zhe(n,i);t[n]={fallbacks:i,cacheable:c}}return t}function Xhe(e,t){if(e===!1)return[];if(Ho(e))return e;let n=[];if(Wn(e))return t.every(c=>c!==e)&&n.push(e),n;const i=[...t,"default"];for(const c of i)c in e&&(n=[...n,...e[c].filter(Boolean)]);return n}function O5(e){return zE[e]!=null&&zE[e].every(t=>t.cache!==!1)}function Zhe(e,t){return O5(e)&&t.every(n=>O5(n))}function Yhe(e){return Hx.find(t=>!!t.defaultForDomains?.includes(e))?.code}const Pm=e=>tx.includes(e||""),D5=e=>Pm(e)?e:void 0;var Khe={ar:"310e43c4",en:"310e43c4"};const n9=()=>CC("i18n:cached-locale-configs",()=>{}),r9=()=>CC("i18n:resolved-locale",()=>"");function Jhe({cookieCrossOrigin:e,cookieDomain:t,cookieSecure:n,cookieKey:i}){const c=new Date;return AE(i||"i18n_redirected",{path:"/",readonly:!1,expires:new Date(c.setDate(c.getDate()+365)),sameSite:e?"none":"lax",domain:t||void 0,secure:e||n})}function Qhe(e,t,n){const i=nL(t),c=qC(e),h=Wx(e),m=n9(),a=Jhe(h),y=new Set,E=W=>m.value[W],C=W=>Whe(c.domainLocales,IE(),W),P=hfe(e,c.baseUrl),L=r9(),D=async W=>{const $=E(W)?.fallbacks??[];$.includes(W)||$.push(W);for(const Y of $){const X=await e.runWithContext(()=>Uhe(Y,zE[Y]));i.mergeLocaleMessage(Y,X)}},V=async W=>{if(!(W in zE))return;const $=E(W)?.cacheable?{}:{"Cache-Control":"no-cache"},X=Uf("","/_i18n",Khe[W],W,"messages.json"),K=await $fetch(X,{headers:$});for(const ne of Object.keys(K))i.mergeLocaleMessage(ne,K[ne])},U={vueI18n:t,initial:!0,preloaded:!1,config:c,rootRedirect:jhe(c.rootRedirect),redirectStatusCode:c.redirectStatusCode??302,dynamicResourcesSSG:!1,getDefaultLocale:()=>n,getLocale:()=>Ar(i.locale),setLocale:async W=>{const $=U.getLocale();W===$||!Pm(W)||(qi(i.locale)?i.locale.value=W:i.locale=W,await e.callHook("i18n:localeSwitched",{newLocale:W,oldLocale:$}),L.value=W)},setLocaleSuspend:async W=>{Pm(W)&&(U.vueI18n.__pendingLocale=W,U.vueI18n.__pendingLocalePromise=new Promise($=>{U.vueI18n.__resolvePendingLocalePromise=async()=>{U.setCookieLocale(W),await U.setLocale(W),U.vueI18n.__pendingLocale=void 0,$()}}),(e.isHydrating||!U.config.skipSettingLocaleOnNavigate)&&await U.vueI18n.__resolvePendingLocalePromise?.())},getLocales:()=>Ar(i.locales).map(W=>Wn(W)?{code:W}:W),setCookieLocale:W=>{h.useCookie&&Pm(W)&&(a.value=W)},getBaseUrl:W=>Uf(W&&C(W)||P(),e.$config.app.baseURL),loadMessages:async W=>{if(!(e.isHydrating&&y.has(W)))try{return U.dynamicResourcesSSG?await D(W):await V(W)}catch($){console.warn(`Failed to load messages for locale "${W}"`,$)}finally{y.add(W)}},composableCtx:void 0};return U.composableCtx=cfe(U,e),U}
3868function XC(e){if(e._nuxtI18n==null)throw new Error("Nuxt I18n context has not been set up yet.");return e._nuxtI18n}function efe(e,t){const n=[];for(const[i,c]of t.entries()){const h=e.find(m=>m.language?.toLowerCase()===c.toLowerCase());if(h){n.push({code:h.code,score:1-i/t.length});break}}for(const[i,c]of t.entries()){const h=c.split("-")[0].toLowerCase(),m=e.find(a=>a.language?.split("-")[0].toLowerCase()===h);if(m){n.push({code:m.code,score:.999-i/t.length});break}}return n}function tfe(e,t){return e.score===t.score?t.code.length-e.code.length:t.score-e.score}function nfe(e,t){return efe(e.map(i=>({code:i.code,language:i.language||i.code})),t).sort(tfe).at(0)?.code??""}const rfe=(e,t)=>AE(t).value||void 0,ife=(e,t)=>Ohe(t),ofe=e=>nfe(Hx,navigator.languages),sfe=(e,t,n)=>{const i=new URL(window.location.href).host,c=Hx.map(h=>({...h,domain:n[h.code]?.domain??h.domain}));return Hhe(c,i,QR(t))},ZC=(e,t,n)=>{const i=qC(n);return{cookie:()=>rfe(e,t.cookieKey),header:()=>{},navigator:()=>ofe(),host:c=>sfe(e,c,i.domainLocales),route:c=>ife(e,c)}},afe=e=>!!e.path&&!e.name;function qx(e){const t=e?._nuxtI18n?.composableCtx;if(!t)throw new Error("i18n context is not initialized. Ensure the i18n plugin is installed and the composable is used within a Vue component or setup function.");return t}const lfe=ay;function cfe(e,t=rr()){const n=ps();ZC(void 0,Wx(t),t);const i=e.getDefaultLocale(),c=Dhe();function h(E,C){E.name=oP(E.name||n.currentRoute.value);const P=c(E.name,C);return n.hasRoute(P)&&(E.name=P),E.name=P,E}const m=Fhe(n);function a(E,C){const P=m(E,C),L=oP(P);if(L){const D=c(L,C);return n.hasRoute(D),P.name=D,P}return P.path="/"+C+P.path,P.path=lfe(P.path,!0),P}const y={router:n,_head:void 0,get head(){return this._head??=Cy({}),this._head},metaState:{htmlAttrs:{},meta:[],link:[]},seoSettings:{dir:!1,lang:!1,seo:!1},localePathPayload:ufe(),routingOptions:{defaultLocale:i,strictCanonicals:e.config.experimental.alternateLinkCanonicalQueries??!0,hreflangLinks:!0},getLocale:e.getLocale,getLocales:e.getLocales,getBaseUrl:e.getBaseUrl,getRouteBaseName:oP,getRouteLocalizedParams:()=>n.currentRoute.value.meta.nuxtI18nInternal??{},getLocalizedDynamicParams:E=>y.getRouteLocalizedParams()?.[E],afterSwitchLocalePath:(E,C)=>(y.getRouteLocalizedParams(),E),resolveLocalizedRouteObject:(E,C)=>afe(E)?a(E,C):h(E,C)};return y}function ufe(e=rr()){const t=document.querySelector(`[data-nuxt-i18n-slp="${e._id}"]`)?.textContent;return JSON.parse(t||"{}")}async function ek(e,t){const n=XC(e),i=n.getLocale();if(t===i&&!n.initial&&(!n.vueI18n.__pendingLocale||n.vueI18n.__pendingLocale===t))return t;const c={oldLocale:i,newLocale:t,initialSetup:n.initial,context:e};let h=await e.callHook("i18n:beforeLocaleSwitch",c);return h!=null,h??=c.newLocale,Pm(h)&&(t=h),await n.loadMessages(t),await n.setLocaleSuspend(t),t}function dfe(e,t,n){return!!(e.redirectOn==="root"&&t!=="/"||e.redirectOn==="no prefix"&&!e.alwaysRedirect&&Pm(n))}function F5(e,t){const n=Wx(e),i=ZC(void 0,n,e),c=XC(e),h=Wn(t)?t:t.path;function*m(){c.initial&&n.enabled&&!dfe(n,h,i.route(h))&&(yield i.cookie(),yield i.header(),yield i.navigator(),yield n.fallbackLocale),yield i.route(t)}for(const a of m())if(a&&Pm(a))return a;return c.getLocale()||c.getDefaultLocale()||""}function i9(e,t,n){const i=XC(e),c=qx(e);if(t.path==="/"&&i.rootRedirect)return ly(BE(c,i.rootRedirect.path,n),{redirectCode:i.rootRedirect.code});if(i.vueI18n.__pendingLocale&&rr()._processingMiddleware||ZC(void 0,Wx(e),e).route(t)===n)return;const m=tL(c,n,t)||BE(c,t.fullPath,n);if(!gK(m,t.fullPath))return ly(m,{redirectCode:i.redirectStatusCode})}function hfe(e,t,n,i){return yo(t)?()=>t(e):()=>t??""}function ffe(e,t,n){return{line:e,column:t,offset:n}}function tk(e,t,n){return{start:e,end:t}}const Bi={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},pfe=17;function YC(e,t,n={}){const{domain:i,messages:c,args:h}=n,m=e,a=new SyntaxError(String(m));return a.code=e,t&&(a.location=t),a.domain=i,a}function mfe(e){throw e}const ju=" ",gfe="\r",ha=` 3869`,_fe="\u2028",yfe="\u2029";function vfe(e){const t=e;let n=0,i=1,c=1,h=0;const m=ye=>t[ye]===gfe&&t[ye+1]===ha,a=ye=>t[ye]===ha,y=ye=>t[ye]===yfe,E=ye=>t[ye]===_fe,C=ye=>m(ye)||a(ye)||y(ye)||E(ye),P=()=>n,L=()=>i,D=()=>c,V=()=>h,U=ye=>m(ye)||y(ye)||E(ye)?ha:t[ye],W=()=>U(n),$=()=>U(n+h);function Y(){return h=0,C(n)&&(i++,c=0),m(n)&&n++,n++,c++,t[n]}function X(){return m(n+h)&&h++,h++,t[n+h]}function K(){n=0,i=1,c=1,h=0}function ne(ye=0){h=ye}function fe(){const ye=n+h;for(;ye!==n;)Y();h=0}return{index:P,line:L,column:D,peekOffset:V,charAt:U,currentChar:W,currentPeek:$,next:Y,peek:X,reset:K,resetPeek:ne,skipToPeek:fe}}const qd=void 0,bfe=".",B5="'",xfe="tokenizer";function wfe(e,t={}){const n=t.location!==!1,i=vfe(e),c=()=>i.index(),h=()=>ffe(i.line(),i.column(),i.index()),m=h(),a=c(),y={currentType:13,offset:a,startLoc:m,endLoc:m,lastType:13,lastOffset:a,lastStartLoc:m,lastEndLoc:m,braceNest:0,inLinked:!1,text:""},E=()=>y,{onError:C}=t;function P(Ie,Ve,tt,...Rt){const Ut=E();if(Ve.column+=tt,Ve.offset+=tt,C){const nn=n?tk(Ut.startLoc,Ve):null,st=YC(Ie,nn,{domain:xfe,args:Rt});C(st)}}function L(Ie,Ve,tt){Ie.endLoc=h(),Ie.currentType=Ve;const Rt={type:Ve};return n&&(Rt.loc=tk(Ie.startLoc,Ie.endLoc)),tt!=null&&(Rt.value=tt),Rt}const D=Ie=>L(Ie,13);function V(Ie,Ve){return Ie.currentChar()===Ve?(Ie.next(),Ve):(P(Bi.EXPECTED_TOKEN,h(),0,Ve),"")}function U(Ie){let Ve="";for(;Ie.currentPeek()===ju||Ie.currentPeek()===ha;)Ve+=Ie.currentPeek(),Ie.peek();return Ve}function W(Ie){const Ve=U(Ie);return Ie.skipToPeek(),Ve}function $(Ie){if(Ie===qd)return!1;const Ve=Ie.charCodeAt(0);return Ve>=97&&Ve<=122||Ve>=65&&Ve<=90||Ve===95}function Y(Ie){if(Ie===qd)return!1;const Ve=Ie.charCodeAt(0);return Ve>=48&&Ve<=57}function X(Ie,Ve){const{currentType:tt}=Ve;if(tt!==2)return!1;U(Ie);const Rt=$(Ie.currentPeek());return Ie.resetPeek(),Rt}function K(Ie,Ve){const{currentType:tt}=Ve;if(tt!==2)return!1;U(Ie);const Rt=Ie.currentPeek()==="-"?Ie.peek():Ie.currentPeek(),Ut=Y(Rt);return Ie.resetPeek(),Ut}function ne(Ie,Ve){const{currentType:tt}=Ve;if(tt!==2)return!1;U(Ie);const Rt=Ie.currentPeek()===B5;return Ie.resetPeek(),Rt}function fe(Ie,Ve){const{currentType:tt}=Ve;if(tt!==7)return!1;U(Ie);const Rt=Ie.currentPeek()===".";return Ie.resetPeek(),Rt}function ye(Ie,Ve){const{currentType:tt}=Ve;if(tt!==8)return!1;U(Ie);const Rt=$(Ie.currentPeek());return Ie.resetPeek(),Rt}function ke(Ie,Ve){const{currentType:tt}=Ve;if(!(tt===7||tt===11))return!1;U(Ie);const Rt=Ie.currentPeek()===":";return Ie.resetPeek(),Rt}function Fe(Ie,Ve){const{currentType:tt}=Ve;if(tt!==9)return!1;const Rt=()=>{const nn=Ie.currentPeek();return nn==="{"?$(Ie.peek()):nn==="@"||nn==="|"||nn===":"||nn==="."||nn===ju||!nn?!1:nn===ha?(Ie.peek(),Rt()):lt(Ie,!1)},Ut=Rt();return Ie.resetPeek(),Ut}function qe(Ie){U(Ie);const Ve=Ie.currentPeek()==="|";return Ie.resetPeek(),Ve}function lt(Ie,Ve=!0){const tt=(Ut=!1,nn="")=>{const st=Ie.currentPeek();
3869return st==="{"||st==="@"||!st?Ut:st==="|"?!(nn===ju||nn===ha):st===ju?(Ie.peek(),tt(!0,ju)):st===ha?(Ie.peek(),tt(!0,ha)):!0},Rt=tt();return Ve&&Ie.resetPeek(),Rt}function pt(Ie,Ve){const tt=Ie.currentChar();return tt===qd?qd:Ve(tt)?(Ie.next(),tt):null}function Qt(Ie){const Ve=Ie.charCodeAt(0);return Ve>=97&&Ve<=122||Ve>=65&&Ve<=90||Ve>=48&&Ve<=57||Ve===95||Ve===36}function Ht(Ie){return pt(Ie,Qt)}function zt(Ie){const Ve=Ie.charCodeAt(0);return Ve>=97&&Ve<=122||Ve>=65&&Ve<=90||Ve>=48&&Ve<=57||Ve===95||Ve===36||Ve===45}function jt(Ie){return pt(Ie,zt)}function Zt(Ie){const Ve=Ie.charCodeAt(0);return Ve>=48&&Ve<=57}function Wt(Ie){return pt(Ie,Zt)}function en(Ie){const Ve=Ie.charCodeAt(0);return Ve>=48&&Ve<=57||Ve>=65&&Ve<=70||Ve>=97&&Ve<=102}function sn(Ie){return pt(Ie,en)}function Mn(Ie){let Ve="",tt="";for(;Ve=Wt(Ie);)tt+=Ve;return tt}function xn(Ie){let Ve="";for(;;){const tt=Ie.currentChar();if(tt==="\\"){const Rt=Ie.peek();Rt==="{"||Rt==="}"||Rt==="@"||Rt==="|"||Rt==="\\"?(Ve+=tt+Rt,Ie.next(),Ie.next()):(Ie.resetPeek(),Ve+=tt,Ie.next())}else{if(tt==="{"||tt==="}"||tt==="@"||tt==="|"||!tt)break;if(tt===ju||tt===ha)if(lt(Ie))Ve+=tt,Ie.next();else{if(qe(Ie))break;Ve+=tt,Ie.next()}else Ve+=tt,Ie.next()}}return Ve}function Vn(Ie){W(Ie);let Ve="",tt="";for(;Ve=jt(Ie);)tt+=Ve;const Rt=Ie.currentChar();if(Rt&&Rt!=="}"&&Rt!==qd&&Rt!==ju&&Rt!==ha&&Rt!=="ã"){const Ut=Cn(Ie);return P(Bi.INVALID_TOKEN_IN_PLACEHOLDER,h(),0,tt+Ut),tt+Ut}return Ie.currentChar()===qd&&P(Bi.UNTERMINATED_CLOSING_BRACE,h(),0),tt}function Ln(Ie){W(Ie);let Ve="";return Ie.currentChar()==="-"?(Ie.next(),Ve+=`-${Mn(Ie)}`):Ve+=Mn(Ie),Ie.currentChar()===qd&&P(Bi.UNTERMINATED_CLOSING_BRACE,h(),0),Ve}function Yn(Ie){return Ie!==B5&&Ie!==ha}function Rn(Ie){W(Ie),V(Ie,"'");let Ve="",tt="";for(;Ve=pt(Ie,Yn);)Ve==="\\"?tt+=$t(Ie):tt+=Ve;const Rt=Ie.currentChar();return Rt===ha||Rt===qd?(P(Bi.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,h(),0),Rt===ha&&(Ie.next(),V(Ie,"'")),tt):(V(Ie,"'"),tt)}function $t(Ie){const Ve=Ie.currentChar();switch(Ve){case"\\":case"'":return Ie.next(),`\\${Ve}`;case"u":return fn(Ie,Ve,4);case"U":return fn(Ie,Ve,6);default:return P(Bi.UNKNOWN_ESCAPE_SEQUENCE,h(),0,Ve),""}}function fn(Ie,Ve,tt){V(Ie,Ve);let Rt="";for(let Ut=0;Ut<tt;Ut++){const nn=sn(Ie);if(!nn){P(Bi.INVALID_UNICODE_ESCAPE_SEQUENCE,h(),0,`\\${Ve}${Rt}${Ie.currentChar()}`);break}Rt+=nn}return`\\${Ve}${Rt}`}function yn(Ie){return Ie!=="{"&&Ie!=="}"&&Ie!==ju&&Ie!==ha}function Cn(Ie){W(Ie);let Ve="",tt="";for(;Ve=pt(Ie,yn);)tt+=Ve;return tt}function _n(Ie){let Ve="",tt="";for(;Ve=Ht(Ie);)tt+=Ve;return tt}function Bn(Ie){const Ve=tt=>{const Rt=Ie.currentChar();return Rt==="{"||Rt==="@"||Rt==="|"||Rt==="("||Rt===")"||!Rt||Rt===ju?tt:(tt+=Rt,Ie.next(),Ve(tt))};return Ve("")}function Be(Ie){W(Ie);const Ve=V(Ie,"|");return W(Ie),Ve}function Xe(Ie,Ve){let tt=null;switch(Ie.currentChar()){case"{":return Ve.braceNest>=1&&P(Bi.NOT_ALLOW_NEST_PLACEHOLDER,h(),0),Ie.next(),tt=L(Ve,2,"{"),W(Ie),Ve.braceNest++,tt;case"}":return Ve.braceNest>0&&Ve.currentType===2&&P(Bi.EMPTY_PLACEHOLDER,h(),0),Ie.next(),tt=L(Ve,3,"}"),Ve.braceNest--,Ve.braceNest>0&&W(Ie),Ve.inLinked&&Ve.braceNest===0&&(Ve.inLinked=!1),tt;case"@":return Ve.braceNest>0&&P(Bi.UNTERMINATED_CLOSING_BRACE,h(),0),tt=mt(Ie,Ve)||D(Ve),Ve.braceNest=0,tt;default:{let Ut=!0,nn=!0,st=!0;if(qe(Ie))return Ve.braceNest>0&&P(Bi.UNTERMINATED_CLOSING_BRACE,h(),0),tt=L(Ve,1,Be(Ie)),Ve.braceNest=0,Ve.inLinked=!1,tt;if(Ve.braceNest>0&&(Ve.currentType===4||Ve.currentType===5||Ve.currentType===6))return P(Bi.UNTERMINATED_CLOSING_BRACE,h(),0),Ve.braceNest=0,kt(Ie,Ve);if(Ut=X(Ie,Ve))return tt=L(Ve,4,Vn(Ie)),W(Ie),tt;if(nn=K(Ie,Ve))return tt=L(Ve,5,Ln(Ie)),W(Ie),tt;if(st=ne(Ie,Ve))return tt=L(Ve,6,Rn(Ie)),W(Ie),tt;if(!Ut&&!nn&&!st)return tt=L(Ve,12,Cn(Ie)),P(Bi.INVALID_TOKEN_IN_PLACEHOLDER,h(),0,tt.value),W(Ie),tt;break}}return tt}function mt(Ie,Ve){const{currentType:tt}=Ve;let Rt=null;const Ut=Ie.currentChar();switch((tt===7||tt===8||tt===11||tt===9)&&(Ut===ha||Ut===ju)&&P(Bi.INVALID_LINKED_FORMAT,h(),0),Ut){case"@":return Ie.next(),Rt=L(Ve,7,"@"),Ve.inLinked=!0,Rt;case".":return W(Ie),Ie.next(),L(Ve,8,".");case":":return W(Ie),Ie.next(),L(Ve,9,":");default:return qe(Ie)?(Rt=L(Ve,1,Be(Ie)),Ve.braceNest=0,Ve.inLinked=!1,Rt):fe(Ie,Ve)||ke(Ie,Ve)?(W(Ie),mt(Ie,Ve)):ye(Ie,Ve)?(W(Ie),L(Ve,11,_n(Ie))):Fe(Ie,Ve)?(W(Ie),Ut==="{"?Xe(Ie,Ve)||Rt:L(Ve,10,Bn(Ie))):(tt===7&&P(Bi.INVALID_LINKED_FORMAT,h(),0),Ve.braceNest=0,Ve.inLinked=!1,kt(Ie,Ve))}}function kt(Ie,Ve){let tt={type:13};if(Ve.braceNest>0)return Xe(Ie,Ve)||D(Ve);if(Ve.inLinked)return mt(Ie,Ve)||D(Ve);switch(Ie.currentChar()){case"{":return Xe(Ie,Ve)||D(Ve);case"}":return P(Bi.UNBALANCED_CLOSING_BRACE,h(),0),Ie.next(),L(Ve,3,"}");case"@":return mt(Ie,Ve)||D(Ve);
3869default:{if(qe(Ie))return tt=L(Ve,1,Be(Ie)),Ve.braceNest=0,Ve.inLinked=!1,tt;if(lt(Ie))return L(Ve,0,xn(Ie));break}}return tt}function Vt(){const{currentType:Ie,offset:Ve,startLoc:tt,endLoc:Rt}=y;return y.lastType=Ie,y.lastOffset=Ve,y.lastStartLoc=tt,y.lastEndLoc=Rt,y.offset=c(),y.startLoc=h(),i.currentChar()===qd?L(y,13):kt(i,y)}return{nextToken:Vt,currentOffset:c,currentPosition:h,context:E}}const Sfe="parser",Tfe=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,Efe=/\\([\\@{}|])/g;function Cfe(e,t){return t}function Afe(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const i=parseInt(t||n,16);return i<=55295||i>=57344?String.fromCodePoint(i):"�"}}}function Ife(e={}){const t=e.location!==!1,{onError:n}=e;function i($,Y,X,K,...ne){const fe=$.currentPosition();if(fe.offset+=K,fe.column+=K,n){const ye=t?tk(X,fe):null,ke=YC(Y,ye,{domain:Sfe,args:ne});n(ke)}}function c($,Y,X){const K={type:$};return t&&(K.start=Y,K.end=Y,K.loc={start:X,end:X}),K}function h($,Y,X,K){t&&($.end=Y,$.loc&&($.loc.end=X))}function m($,Y){const X=$.context(),K=c(3,X.offset,X.startLoc);return K.value=Y.replace(Efe,Cfe),h(K,$.currentOffset(),$.currentPosition()),K}function a($,Y){const X=$.context(),{lastOffset:K,lastStartLoc:ne}=X,fe=c(5,K,ne);return fe.index=parseInt(Y,10),$.nextToken(),h(fe,$.currentOffset(),$.currentPosition()),fe}function y($,Y){const X=$.context(),{lastOffset:K,lastStartLoc:ne}=X,fe=c(4,K,ne);return fe.key=Y,$.nextToken(),h(fe,$.currentOffset(),$.currentPosition()),fe}function E($,Y){const X=$.context(),{lastOffset:K,lastStartLoc:ne}=X,fe=c(9,K,ne);return fe.value=Y.replace(Tfe,Afe),$.nextToken(),h(fe,$.currentOffset(),$.currentPosition()),fe}function C($){const Y=$.nextToken(),X=$.context(),{lastOffset:K,lastStartLoc:ne}=X,fe=c(8,K,ne);return Y.type!==11?(i($,Bi.UNEXPECTED_EMPTY_LINKED_MODIFIER,X.lastStartLoc,0),fe.value="",h(fe,K,ne),{nextConsumeToken:Y,node:fe}):(Y.value==null&&i($,Bi.UNEXPECTED_LEXICAL_ANALYSIS,X.lastStartLoc,0,Gu(Y)),fe.value=Y.value||"",h(fe,$.currentOffset(),$.currentPosition()),{node:fe})}function P($,Y){const X=$.context(),K=c(7,X.offset,X.startLoc);return K.value=Y,h(K,$.currentOffset(),$.currentPosition()),K}function L($){const Y=$.context(),X=c(6,Y.offset,Y.startLoc);let K=$.nextToken();if(K.type===8){const ne=C($);X.modifier=ne.node,K=ne.nextConsumeToken||$.nextToken()}switch(K.type!==9&&i($,Bi.UNEXPECTED_LEXICAL_ANALYSIS,Y.lastStartLoc,0,Gu(K)),K=$.nextToken(),K.type===2&&(K=$.nextToken()),K.type){case 10:K.value==null&&i($,Bi.UNEXPECTED_LEXICAL_ANALYSIS,Y.lastStartLoc,0,Gu(K)),X.key=P($,K.value||"");break;case 4:K.value==null&&i($,Bi.UNEXPECTED_LEXICAL_ANALYSIS,Y.lastStartLoc,0,Gu(K)),X.key=y($,K.value||"");break;case 5:K.value==null&&i($,Bi.UNEXPECTED_LEXICAL_ANALYSIS,Y.lastStartLoc,0,Gu(K)),X.key=a($,K.value||"");break;case 6:K.value==null&&i($,Bi.UNEXPECTED_LEXICAL_ANALYSIS,Y.lastStartLoc,0,Gu(K)),X.key=E($,K.value||"");break;default:{i($,Bi.UNEXPECTED_EMPTY_LINKED_KEY,Y.lastStartLoc,0);const ne=$.context(),fe=c(7,ne.offset,ne.startLoc);return fe.value="",h(fe,ne.offset,ne.startLoc),X.key=fe,h(X,ne.offset,ne.startLoc),{nextConsumeToken:K,node:X}}}return h(X,$.currentOffset(),$.currentPosition()),{node:X}}function D($){const Y=$.context(),X=Y.currentType===1?$.currentOffset():Y.offset,K=Y.currentType===1?Y.endLoc:Y.startLoc,ne=c(2,X,K);ne.items=[];let fe=null;do{const Fe=fe||$.nextToken();switch(fe=null,Fe.type){case 0:Fe.value==null&&i($,Bi.UNEXPECTED_LEXICAL_ANALYSIS,Y.lastStartLoc,0,Gu(Fe)),ne.items.push(m($,Fe.value||""));break;case 5:Fe.value==null&&i($,Bi.UNEXPECTED_LEXICAL_ANALYSIS,Y.lastStartLoc,0,Gu(Fe)),ne.items.push(a($,Fe.value||""));break;case 4:Fe.value==null&&i($,Bi.UNEXPECTED_LEXICAL_ANALYSIS,Y.lastStartLoc,0,Gu(Fe)),ne.items.push(y($,Fe.value||""));break;case 6:Fe.value==null&&i($,Bi.UNEXPECTED_LEXICAL_ANALYSIS,Y.lastStartLoc,0,Gu(Fe)),ne.items.push(E($,Fe.value||""));break;case 7:{const qe=L($);ne.items.push(qe.node),fe=qe.nextConsumeToken||null;break}}}while(Y.currentType!==13&&Y.currentType!==1);const ye=Y.currentType===1?Y.lastOffset:$.currentOffset(),ke=Y.currentType===1?Y.lastEndLoc:$.currentPosition();return h(ne,ye,ke),ne}function V($,Y,X,K){const ne=$.context();let fe=K.items.length===0;const ye=c(1,Y,X);ye.cases=[],ye.cases.push(K);do{const ke=D($);fe||(fe=ke.items.length===0),ye.cases.push(ke)}while(ne.currentType!==13);return fe&&i($,Bi.MUST_HAVE_MESSAGES_IN_PLURAL,X,0),h(ye,$.currentOffset(),$.currentPosition()),ye}function U($){const Y=$.context(),{offset:X,startLoc:K}=Y,ne=D($);return Y.currentType===13?ne:V($,X,K,ne)}function W($){const Y=wfe($,Uo({}
3869,e)),X=Y.context(),K=c(0,X.offset,X.startLoc);return t&&K.loc&&(K.loc.source=$),K.body=U(Y),e.onCacheKey&&(K.cacheKey=e.onCacheKey($)),X.currentType!==13&&i(Y,Bi.UNEXPECTED_LEXICAL_ANALYSIS,X.lastStartLoc,0,$[X.offset]||""),h(K,Y.currentOffset(),Y.currentPosition()),K}return{parse:W}}function Gu(e){if(e.type===13)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"â¦":t}function Pfe(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:h=>(n.helpers.add(h),h)}}function z5(e,t){for(let n=0;n<e.length;n++)rL(e[n],t)}function rL(e,t){switch(e.type){case 1:z5(e.cases,t),t.helper("plural");break;case 2:z5(e.items,t);break;case 6:{rL(e.key,t),t.helper("linked"),t.helper("type");break}case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named");break}}function Rfe(e,t={}){const n=Pfe(e);n.helper("normalize"),e.body&&rL(e.body,n);const i=n.context();e.helpers=Array.from(i.helpers)}function kfe(e){const t=e.body;return t.type===2?N5(t):t.cases.forEach(n=>N5(n)),e}function N5(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;n<e.items.length;n++){const i=e.items[n];if(!(i.type===3||i.type===9)||i.value==null)break;t.push(i.value)}if(t.length===e.items.length){e.static=eL(t);for(let n=0;n<e.items.length;n++){const i=e.items[n];(i.type===3||i.type===9)&&delete i.value}}}}function B_(e){switch(e.t=e.type,e.type){case 0:{const t=e;B_(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,n=t.cases;for(let i=0;i<n.length;i++)B_(n[i]);t.c=n,delete t.cases;break}case 2:{const t=e,n=t.items;for(let i=0;i<n.length;i++)B_(n[i]);t.i=n,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{const t=e;t.value&&(t.v=t.value,delete t.value);break}case 6:{const t=e;B_(t.key),t.k=t.key,delete t.key,t.modifier&&(B_(t.modifier),t.m=t.modifier,delete t.modifier);break}case 5:{const t=e;t.i=t.index,delete t.index;break}case 4:{const t=e;t.k=t.key,delete t.key;break}}delete e.type}function Mfe(e,t){const{filename:n,breakLineCode:i,needIndent:c}=t,h=t.location!==!1,m={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:i,needIndent:c,indentLevel:0};h&&e.loc&&(m.source=e.loc.source);const a=()=>m;function y(U,W){m.code+=U}function E(U,W=!0){const $=W?i:"";y(c?$+" ".repeat(U):$)}function C(U=!0){const W=++m.indentLevel;U&&E(W)}function P(U=!0){const W=--m.indentLevel;U&&E(W)}function L(){E(m.indentLevel)}return{context:a,push:y,indent:C,deindent:P,newline:L,helper:U=>`_${U}`,needIndent:()=>m.needIndent}}function Lfe(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),my(e,t.key),t.modifier?(e.push(", "),my(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function Ofe(e,t){const{helper:n,needIndent:i}=e;e.push(`${n("normalize")}([`),e.indent(i());const c=t.items.length;for(let h=0;h<c&&(my(e,t.items[h]),h!==c-1);h++)e.push(", ");e.deindent(i()),e.push("])")}function Dfe(e,t){const{helper:n,needIndent:i}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(i());const c=t.cases.length;for(let h=0;h<c&&(my(e,t.cases[h]),h!==c-1);h++)e.push(", ");e.deindent(i()),e.push("])")}}function Ffe(e,t){t.body?my(e,t.body):e.push("null")}function my(e,t){const{helper:n}=e;switch(t.type){case 0:Ffe(e,t);break;case 1:Dfe(e,t);break;case 2:Ofe(e,t);break;case 6:Lfe(e,t);break;case 8:e.push(JSON.stringify(t.value),t);break;case 7:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${n("interpolate")}(${n("list")}(${t.index}))`,t);break;case 4:e.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(t.key)}))`,t);break;case 9:e.push(JSON.stringify(t.value),t);break;case 3:e.push(JSON.stringify(t.value),t);break}}const Bfe=(e,t={})=>{const n=Wn(t.mode)?t.mode:"normal",i=Wn(t.filename)?t.filename:"message.intl";t.sourceMap;const c=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":` 3870`,h=t.needIndent?t.needIndent:n!=="arrow",m=e.helpers||[],a=Mfe(e,{filename:i,breakLineCode:c,needIndent:h});a.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),a.indent(h),m.length>0&&(a.push(`const { ${eL(m.map(C=>`${C}: _${C}`),", ")} } = ctx`),a.newline()),a.push("return "),my(a,e),a.deindent(h),a.push("}"),delete e.helpers;const{code:y,map:E}
3870=a.context();return{ast:e,code:y,map:E?E.toJSON():void 0}};function zfe(e,t={}){const n=Uo({},t),i=!!n.jit,c=!!n.minify,h=n.optimize==null?!0:n.optimize,a=Ife(n).parse(e);return i?(h&&kfe(a),c&&B_(a),{ast:a,code:""}):(Rfe(a,n),Bfe(a,n))}function nd(e){return gi(e)&&iL(e)===0&&(mc(e,"b")||mc(e,"body"))}const o9=["b","body"];function Nfe(e){return ip(e,o9)}const s9=["c","cases"];function Vfe(e){return ip(e,s9,[])}const a9=["s","static"];function Ufe(e){return ip(e,a9)}const l9=["i","items"];function $fe(e){return ip(e,l9,[])}const c9=["t","type"];function iL(e){return ip(e,c9)}const u9=["v","value"];function gT(e,t){const n=ip(e,u9);if(n!=null)return n;throw nx(t)}const d9=["m","modifier"];function jfe(e){return ip(e,d9)}const h9=["k","key"];function Gfe(e){const t=ip(e,h9);if(t)return t;throw nx(6)}function ip(e,t,n){for(let i=0;i<t.length;i++){const c=t[i];if(mc(e,c)&&e[c]!=null)return e[c]}return n}const f9=[...o9,...s9,...a9,...l9,...h9,...d9,...u9,...c9];function nx(e){return new Error(`unhandled node type: ${e}`)}function sP(e){return n=>Hfe(n,e)}function Hfe(e,t){const n=Nfe(t);if(n==null)throw nx(0);if(iL(n)===1){const h=Vfe(n);return e.plural(h.reduce((m,a)=>[...m,V5(e,a)],[]))}else return V5(e,n)}function V5(e,t){const n=Ufe(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const i=$fe(t).reduce((c,h)=>[...c,nk(e,h)],[]);return e.normalize(i)}}function nk(e,t){const n=iL(t);switch(n){case 3:return gT(t,n);case 9:return gT(t,n);case 4:{const i=t;if(mc(i,"k")&&i.k)return e.interpolate(e.named(i.k));if(mc(i,"key")&&i.key)return e.interpolate(e.named(i.key));throw nx(n)}case 5:{const i=t;if(mc(i,"i")&&fs(i.i))return e.interpolate(e.list(i.i));if(mc(i,"index")&&fs(i.index))return e.interpolate(e.list(i.index));throw nx(n)}case 6:{const i=t,c=jfe(i),h=Gfe(i);return e.linked(nk(e,h),c?nk(e,c):void 0,e.type)}case 7:return gT(t,n);case 8:return gT(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const Wfe=e=>e;let _T=Ni();function qfe(e,t={}){let n=!1;const i=t.onError||mfe;return t.onError=c=>{n=!0,i(c)},{...zfe(e,t),detectError:n}}function Xfe(e,t){if(Wn(e)){No(t.warnHtmlMessage)&&t.warnHtmlMessage;const i=(t.onCacheKey||Wfe)(e),c=_T[i];if(c)return c;const{ast:h,detectError:m}=qfe(e,{...t,location:!1,jit:!0}),a=sP(h);return m?a:_T[i]=a}else{const n=e.cacheKey;if(n){const i=_T[n];return i||(_T[n]=sP(e))}else return sP(e)}}const sh={INVALID_ARGUMENT:pfe,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},Zfe=24;function ah(e){return YC(e,null,void 0)}function oL(e,t){return t.locale!=null?U5(t.locale):U5(e.locale)}let aP;function U5(e){if(Wn(e))return e;if(yo(e)){if(e.resolvedOnce&&aP!=null)return aP;if(e.constructor.name==="Function"){const t=e();if(phe(t))throw ah(sh.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return aP=t}else throw ah(sh.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw ah(sh.NOT_SUPPORT_LOCALE_TYPE)}function Yfe(e,t,n){return[...new Set([n,...Ho(t)?t:gi(t)?Object.keys(t):Wn(t)?[t]:[n]])]}function rk(e,t,n){const i=Wn(n)?n:NE,c=e;c.__localeChainCache||(c.__localeChainCache=new Map);let h=c.__localeChainCache.get(i);if(!h){h=[];let m=[n];for(;Ho(m);)m=$5(h,m,t);const a=Ho(t)||!Mi(t)?t:t.default?t.default:null;m=Wn(a)?[a]:a,Ho(m)&&$5(h,m,!1),c.__localeChainCache.set(i,h)}return h}function $5(e,t,n){let i=!0;for(let c=0;c<t.length&&No(i);c++){const h=t[c];Wn(h)&&(i=Kfe(e,t[c],n))}return i}function Kfe(e,t,n){let i;const c=t.split("-");do{const h=c.join("-");i=Jfe(e,h,n),c.splice(-1,1)}while(c.length&&i===!0);return i}function Jfe(e,t,n){let i=!1;if(!e.includes(t)&&(i=!0,t)){i=t[t.length-1]!=="!";const c=t.replace(/!/g,"");e.push(c),(Ho(n)||Mi(n))&&n[c]&&(i=n[c])}return i}const op=[];op[0]={w:[0],i:[3,0],"[":[4],o:[7]};op[1]={w:[1],".":[2],"[":[4],o:[7]};op[2]={w:[2],i:[3,0],0:[3,0]};op[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};op[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};op[5]={"'":[4,0],o:8,l:[5,0]};op[6]={'"':[4,0],o:8,l:[6,0]};const Qfe=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function epe(e){return Qfe.test(e)}function tpe(e){const t=e.charCodeAt(0),n=e.charCodeAt(e.length-1);return t===n&&(t===34||t===39)?e.slice(1,-1):e}function npe(e){if(e==null)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function rpe(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:epe(t)?tpe(t):"*"+t}function ipe(e){const t=[];let n=-1,i=0,c=0,h,m,a,y,E,C,P;const L=[];L[0]=()=>{m===void 0?m=a:m+=a},L[1]=()=>{m!==void 0&&(t.push(m),m=void 0)},L[2]=()=>{L[0](),c++},L[3]=()=>
3870{if(c>0)c--,i=4,L[0]();else{if(c=0,m===void 0||(m=rpe(m),m===!1))return!1;L[1]()}};function D(){const V=e[n+1];if(i===5&&V==="'"||i===6&&V==='"')return n++,a="\\"+V,L[0](),!0}for(;i!==null;)if(n++,h=e[n],!(h==="\\"&&D())){if(y=npe(h),P=op[i],E=P[y]||P.l||8,E===8||(i=E[0],E[1]!==void 0&&(C=L[E[1]],C&&(a=h,C()===!1))))return;if(i===7)return t}}const j5=new Map;function ope(e,t){return gi(e)?e[t]:null}function spe(e,t){if(!gi(e))return null;let n=j5.get(t);if(n||(n=ipe(t),n&&j5.set(t,n)),!n)return null;const i=n.length;let c=e,h=0;for(;h<i;){const m=n[h];if(f9.includes(m)&&nd(c)||!gi(c)||!mc(c,m))return null;const a=c[m];if(a===void 0||yo(c))return null;c=a,h++}return c}const ape="11.4.5",KC=-1,NE="en-US",VE="",G5=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function lpe(){return{upper:(e,t)=>t==="text"&&Wn(e)?e.toUpperCase():t==="vnode"&&gi(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&Wn(e)?e.toLowerCase():t==="vnode"&&gi(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&Wn(e)?G5(e):t==="vnode"&&gi(e)&&"__v_isVNode"in e?G5(e.children):e}}let p9;function cpe(e){p9=e}let m9;function upe(e){m9=e}let g9;function dpe(e){g9=e}let _9=null;const H5=e=>{_9=e},hpe=()=>_9;let W5=0;function fpe(e={}){const t=yo(e.onWarn)?e.onWarn:ihe,n=Wn(e.version)?e.version:ape,i=Wn(e.locale)||yo(e.locale)?e.locale:NE,c=yo(i)?NE:i,h=Ho(e.fallbackLocale)||Mi(e.fallbackLocale)||Wn(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:c,m=Mi(e.messages)?e.messages:lP(c),a=Mi(e.datetimeFormats)?e.datetimeFormats:lP(c),y=Mi(e.numberFormats)?e.numberFormats:lP(c),E=Uo(Ni(),e.modifiers,lpe()),C=e.pluralRules||Ni(),P=yo(e.missing)?e.missing:null,L=No(e.missingWarn)||FE(e.missingWarn)?e.missingWarn:!0,D=No(e.fallbackWarn)||FE(e.fallbackWarn)?e.fallbackWarn:!0,V=!!e.fallbackFormat,U=!!e.unresolving,W=yo(e.postTranslation)?e.postTranslation:null,$=Mi(e.processor)?e.processor:null,Y=No(e.warnHtmlMessage)?e.warnHtmlMessage:!0,X=!!e.escapeParameter,K=yo(e.messageCompiler)?e.messageCompiler:p9,ne=yo(e.messageResolver)?e.messageResolver:m9||ope,fe=yo(e.localeFallbacker)?e.localeFallbacker:g9||Yfe,ye=gi(e.fallbackContext)?e.fallbackContext:void 0,ke=e,Fe=gi(ke.__datetimeFormatters)?ke.__datetimeFormatters:new Map,qe=gi(ke.__numberFormatters)?ke.__numberFormatters:new Map,lt=gi(ke.__meta)?ke.__meta:{};W5++;const pt={version:n,cid:W5,locale:i,fallbackLocale:h,messages:m,modifiers:E,pluralRules:C,missing:P,missingWarn:L,fallbackWarn:D,fallbackFormat:V,unresolving:U,postTranslation:W,processor:$,warnHtmlMessage:Y,escapeParameter:X,messageCompiler:K,messageResolver:ne,localeFallbacker:fe,fallbackContext:ye,onWarn:t,__meta:lt};return pt.datetimeFormats=a,pt.numberFormats=y,pt.__datetimeFormatters=Fe,pt.__numberFormatters=qe,pt}const lP=e=>({[e]:Ni()});function sL(e,t,n,i,c){const{missing:h,onWarn:m}=e;if(h!==null){const a=h(e,n,t,c);return Wn(a)?a:t}else return t}function ib(e,t,n){const i=e;i.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function ppe(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function mpe(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let i=n+1;i<t.length;i++)if(ppe(e,t[i]))return!0;return!1}function q5(e,...t){const{datetimeFormats:n,unresolving:i,fallbackLocale:c,onWarn:h,localeFallbacker:m}=e,{__datetimeFormatters:a}=e;if(!Wn(t[0])&&!W8(t[0])&&!fs(t[0]))return VE;const[y,E,C,P]=ik(...t),L=No(C.missingWarn)?C.missingWarn:e.missingWarn;No(C.fallbackWarn)?C.fallbackWarn:e.fallbackWarn;const D=!!C.part,V=oL(e,C),U=m(e,c,V);if(!Wn(y)||y===""){const fe=new Intl.DateTimeFormat(V.replace(/!/g,""),P);return D?fe.formatToParts(E):fe.format(E)}let W={},$,Y=null;const X="datetime format";for(let fe=0;fe<U.length&&($=U[fe],W=n[$]||{},Y=W[y],!Mi(Y));fe++)sL(e,y,$,L,X);if(!Mi(Y)||!Wn($))return i?KC:y;let K=`${$}__${y}`;GC(P)||(K=`${K}__${JSON.stringify(P)}`);let ne=a.get(K);return ne||(ne=new Intl.DateTimeFormat($,Uo({},Y,P)),a.set(K,ne)),D?ne.formatToParts(E):ne.format(E)}const y9=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function ik(...e){const[t,n,i,c]=e,h=Ni();let m=Ni(),a;if(Wn(t)){const y=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!y)throw ah(sh.INVALID_ISO_DATE_ARGUMENT);const E=y[3]?y[3].trim().startsWith("T")?`${y[1].trim()}${y[3].trim()}`:`${y[1].trim()}T${y[3].trim()}`:y[1].trim();a=new Date(E);try{a.toISOString()}catch{throw ah(sh.INVALID_ISO_DATE_ARGUMENT)}}else if(W8(t)){if(isNaN(t.getTime()))throw ah(sh.INVALID_DATE_ARGUMENT);a=t}else if(fs(t))a=t;else throw ah(sh.INVALID_ARGUMENT);
3870return Wn(n)?h.key=n:Mi(n)&&Object.keys(n).forEach(y=>{y9.includes(y)?m[y]=n[y]:h[y]=n[y]}),Wn(i)?h.locale=i:Mi(i)&&(m=i),Mi(c)&&(m=c),[h.key||"",a,h,m]}function X5(e,t,n){const i=e;for(const c in n){const h=`${t}__${c}`;i.__datetimeFormatters.has(h)&&i.__datetimeFormatters.delete(h)}}function Z5(e,...t){const{numberFormats:n,unresolving:i,fallbackLocale:c,onWarn:h,localeFallbacker:m}=e,{__numberFormatters:a}=e;if(!fs(t[0]))return VE;const[y,E,C,P]=ok(...t),L=No(C.missingWarn)?C.missingWarn:e.missingWarn;No(C.fallbackWarn)?C.fallbackWarn:e.fallbackWarn;const D=!!C.part,V=oL(e,C),U=m(e,c,V);if(!Wn(y)||y===""){const fe=new Intl.NumberFormat(V.replace(/!/g,""),P);return D?fe.formatToParts(E):fe.format(E)}let W={},$,Y=null;const X="number format";for(let fe=0;fe<U.length&&($=U[fe],W=n[$]||{},Y=W[y],!Mi(Y));fe++)sL(e,y,$,L,X);if(!Mi(Y)||!Wn($))return i?KC:y;let K=`${$}__${y}`;GC(P)||(K=`${K}__${JSON.stringify(P)}`);let ne=a.get(K);return ne||(ne=new Intl.NumberFormat($,Uo({},Y,P)),a.set(K,ne)),D?ne.formatToParts(E):ne.format(E)}const v9=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function ok(...e){const[t,n,i,c]=e,h=Ni();let m=Ni();if(!fs(t))throw ah(sh.INVALID_ARGUMENT);const a=t;return Wn(n)?h.key=n:Mi(n)&&Object.keys(n).forEach(y=>{v9.includes(y)?m[y]=n[y]:h[y]=n[y]}),Wn(i)?h.locale=i:Mi(i)&&(m=i),Mi(c)&&(m=c),[h.key||"",a,h,m]}function Y5(e,t,n){const i=e;for(const c in n){const h=`${t}__${c}`;i.__numberFormatters.has(h)&&i.__numberFormatters.delete(h)}}const gpe=e=>e,_pe=e=>"",ype="text",vpe=e=>e.length===0?"":eL(e),bpe=mhe;function cP(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function xpe(e){const t=fs(e.pluralIndex)?e.pluralIndex:-1;return fs(e.named?.count)?e.named.count:fs(e.named?.n)?e.named.n:t}function wpe(e={}){const t=e.locale,n=xpe(e),i=Wn(t)&&yo(e.pluralRules?.[t])?e.pluralRules[t]:cP,c=i===cP?void 0:cP,h=$=>$[i(n,$.length,c)],m=e.list||[],a=$=>m[$],y=e.named||Ni();fs(e.pluralIndex)&&(y.count||=e.pluralIndex,y.n||=e.pluralIndex);const E=$=>y[$];function C($,Y){const X=yo(e.messages)?e.messages($,!!Y):gi(e.messages)?e.messages[$]:!1;return X||(e.parent?e.parent.message($):_pe)}const P=$=>e.modifiers?e.modifiers[$]:gpe,L=yo(e.processor?.normalize)?e.processor.normalize:vpe,D=yo(e.processor?.interpolate)?e.processor.interpolate:bpe,V=Wn(e.processor?.type)?e.processor.type:ype,W={list:a,named:E,plural:h,linked:($,...Y)=>{const[X,K]=Y;let ne="text",fe="";Y.length===1?gi(X)?(fe=X.modifier||fe,ne=X.type||ne):Wn(X)&&(fe=X||fe):Y.length===2&&(Wn(X)&&(fe=X||fe),Wn(K)&&(ne=K||ne));const ye=C($,!0)(W),ke=ye===""||ye===void 0?$:ye,Fe=ne==="vnode"&&Ho(ke)&&fe?ke[0]:ke;return fe?P(fe)(Fe,ne):Fe},message:C,type:V,interpolate:D,normalize:L,values:Uo(Ni(),m,y)};return W}const K5=()=>"",mh=e=>yo(e);function J5(e,...t){const{fallbackFormat:n,postTranslation:i,unresolving:c,messageCompiler:h,fallbackLocale:m,messages:a}=e,[y,E]=sk(...t),C=No(E.missingWarn)?E.missingWarn:e.missingWarn,P=No(E.fallbackWarn)?E.fallbackWarn:e.fallbackWarn,L=No(E.escapeParameter)?E.escapeParameter:e.escapeParameter,D=!!E.resolvedMessage,V=Wn(E.default)||No(E.default)?No(E.default)?h?y:()=>y:E.default:n?h?y:()=>y:null,U=n||V!=null&&(Wn(V)||yo(V)),W=oL(e,E);L&&Spe(E);let[$,Y,X]=D?[y,W,a[W]||Ni()]:b9(e,y,W,m,P,C),K=$,ne=y;if(!D&&!(Wn(K)||nd(K)||mh(K))&&U&&(K=V,ne=K),!D&&(!(Wn(K)||nd(K)||mh(K))||!Wn(Y)))return c?KC:y;let fe=!1;const ye=()=>{fe=!0},ke=mh(K)?K:x9(e,y,Y,K,ne,ye);if(fe)return K;const Fe=Cpe(e,Y,X,E),qe=wpe(Fe),lt=Tpe(e,ke,qe);let pt=i?i(lt,y):lt;return L&&Wn(pt)&&(pt=hhe(pt)),pt}function Spe(e){Ho(e.list)?e.list=e.list.map(t=>Wn(t)?M5(t):t):gi(e.named)&&Object.keys(e.named).forEach(t=>{Wn(e.named[t])&&(e.named[t]=M5(e.named[t]))})}function b9(e,t,n,i,c,h){const{messages:m,onWarn:a,messageResolver:y,localeFallbacker:E}=e,C=E(e,i,n);let P=Ni(),L,D=null;const V="translate";for(let U=0;U<C.length&&(L=C[U],P=m[L]||Ni(),(D=y(P,t))===null&&(D=P[t]),!(Wn(D)||nd(D)||mh(D)));U++)if(!mpe(L,C)){const W=sL(e,t,L,h,V);W!==t&&(D=W)}return[D,L,P]}function x9(e,t,n,i,c,h){const{messageCompiler:m,warnHtmlMessage:a}=e;if(mh(i)){const E=i;return E.locale=E.locale||n,E.key=E.key||t,E}if(m==null){const E=(()=>i);return E.locale=n,E.key=t,E}const y=m(i,Epe(e,n,c,i,a,h));return y.locale=n,y.key=t,y.source=i,y}function Tpe(e,t,n){return t(n)}function sk(...e){const[t,n,i]=e,c=Ni();if(!Wn(t)&&!fs(t)&&!mh(t)&&!nd(t))throw ah(sh.INVALID_ARGUMENT);const h=fs(t)?String(t):(mh(t),t);return fs(n)?c.plural=n:Wn(n)?c.default=n:Mi(n)&&!GC(n)?c.named=n:Ho(n)&&(c.list=n),fs(i)?c.plural=i:Wn(i)?c.default=i:Mi(i)&&Uo(c,i),[h,c]}function Epe(e,t,n,i,c,h){return{locale:t,key:n,warnHtmlMessage:c,onError:m=>{throw h&&h(m),m},onCacheKey:m=>ohe(t,n,m)}}function Cpe(e,t,n,i){const{modifiers:c,pluralRules:h,messageResolver:m,fallbackLocale:a,fallbackWarn:y,missingWarn:E,fallbackContext:C}=e,L={locale:t,modifiers:c,pluralRules:h,messages:(D,V)=>{let U=m(n,D);if(U==null&&(C||V)){const[W,,$]=b9(C||e,D,t,a,y,E);U=W??m($,D)}if(Wn(U)||nd(U)){let W=!1;const Y=x9(e,D,t,U,D,()=>{W=!0});return W?K5:Y}else return mh(U)?U:K5}};return e.processor&&(L.processor=e.processor),i.list&&(L.list=i.list),i.named&&(L.named=i.named),fs(i.plural)&&(L.pluralIndex=i.plural),L}
3870const Ape="11.4.5",Ll={UNEXPECTED_RETURN_TYPE:Zfe,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function _c(e,...t){return YC(e,null,void 0)}const ak=rp("__translateVNode"),lk=rp("__datetimeParts"),ck=rp("__numberParts"),Ipe=rp("__setPluralRules"),Ppe=rp("__injectWithOption"),$_=rp("__dispose");function rx(e){if(!gi(e)||nd(e))return e;for(const t in e)if(mc(e,t))if(!t.includes("."))gi(e[t])&&rx(e[t]);else{const n=t.split("."),i=n.length-1;let c=e,h=!1;for(let m=0;m<i;m++){if(n[m]==="__proto__")throw new Error(`unsafe key: ${n[m]}`);if(n[m]in c||(c[n[m]]=Ni()),!gi(c[n[m]])){h=!0;break}c=c[n[m]]}if(h||(nd(c)?f9.includes(n[i])||delete e[t]:(c[n[i]]=e[t],delete e[t])),!nd(c)){const m=c[n[i]];gi(m)&&rx(m)}}return e}function w9(e,t){const{messages:n,__i18n:i,messageResolver:c,flatJson:h}=t,m=Mi(n)?n:Ho(i)?Ni():{[e]:Ni()};if(Ho(i)&&i.forEach(a=>{if("locale"in a&&"resource"in a){const{locale:y,resource:E}=a;y?(m[y]=m[y]||Ni(),ey(E,m[y])):ey(E,m)}else Wn(a)&&ey(JSON.parse(a),m)}),c==null&&h)for(const a in m)mc(m,a)&&rx(m[a]);return m}function Rpe(e){return e.type}function kpe(e,t,n){let i=gi(t.messages)?t.messages:Ni();"__i18nGlobal"in n&&(i=w9(e.locale.value,{messages:i,__i18n:n.__i18nGlobal}));const c=Object.keys(i);c.length&&c.forEach(h=>{e.mergeLocaleMessage(h,i[h])});{if(gi(t.datetimeFormats)){const h=Object.keys(t.datetimeFormats);h.length&&h.forEach(m=>{e.mergeDateTimeFormat(m,t.datetimeFormats[m])})}if(gi(t.numberFormats)){const h=Object.keys(t.numberFormats);h.length&&h.forEach(m=>{e.mergeNumberFormat(m,t.numberFormats[m])})}}}function Q5(e){return Ai(Vf,null,e,0)}function S9(){return Ds()}const eN=()=>[],Mpe=()=>!1;let tN=0;function nN(e){return((t,n,i,c)=>e(n,i,S9()||void 0,c))}function uk(e={}){const{__root:t,__injectWithOption:n}=e,i=t===void 0,c=e.flatJson,h=DE?hn:Vi;let m=No(e.inheritLocale)?e.inheritLocale:!0;const a=h(t&&m?t.locale.value:Wn(e.locale)?e.locale:NE),y=h(t&&m?t.fallbackLocale.value:Wn(e.fallbackLocale)||Ho(e.fallbackLocale)||Mi(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:a.value),E=h(w9(a.value,e)),C=h(Mi(e.datetimeFormats)?e.datetimeFormats:{[a.value]:{}}),P=h(Mi(e.numberFormats)?e.numberFormats:{[a.value]:{}});let L=t?t.missingWarn:No(e.missingWarn)||FE(e.missingWarn)?e.missingWarn:!0,D=t?t.fallbackWarn:No(e.fallbackWarn)||FE(e.fallbackWarn)?e.fallbackWarn:!0,V=t?t.fallbackRoot:No(e.fallbackRoot)?e.fallbackRoot:!0,U=!!e.fallbackFormat,W=yo(e.missing)?e.missing:null,$=yo(e.missing)?nN(e.missing):null,Y=yo(e.postTranslation)?e.postTranslation:null,X=t?t.warnHtmlMessage:No(e.warnHtmlMessage)?e.warnHtmlMessage:!0,K=!!e.escapeParameter;const ne=t?t.modifiers:Mi(e.modifiers)?e.modifiers:{};let fe=e.pluralRules||t&&t.pluralRules,ye;ye=(()=>{i&&H5(null);const st={version:Ape,locale:a.value,fallbackLocale:y.value,messages:E.value,modifiers:ne,pluralRules:fe,missing:$===null?void 0:$,missingWarn:L,fallbackWarn:D,fallbackFormat:U,unresolving:!0,postTranslation:Y===null?void 0:Y,warnHtmlMessage:X,escapeParameter:K,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};st.datetimeFormats=C.value,st.numberFormats=P.value,st.__datetimeFormatters=Mi(ye)?ye.__datetimeFormatters:void 0,st.__numberFormatters=Mi(ye)?ye.__numberFormatters:void 0;const Lt=fpe(st);return i&&H5(Lt),Lt})(),ib(ye,a.value,y.value);function Fe(){return[a.value,y.value,E.value,C.value,P.value]}const qe=vn({get:()=>a.value,set:st=>{ye.locale=st,a.value=st}}),lt=vn({get:()=>y.value,set:st=>{ye.fallbackLocale=st,y.value=st,ib(ye,a.value,st)}}),pt=vn(()=>E.value),Qt=vn(()=>C.value),Ht=vn(()=>P.value);function zt(){return yo(Y)?Y:null}function jt(st){Y=st,ye.postTranslation=st}function Zt(){return W}function Wt(st){st!==null&&($=nN(st)),W=st,ye.missing=$}const en=(st,Lt,mn,Hn,ir,hr)=>{Fe();let Sr;try{i||(ye.fallbackContext=t?hpe():void 0),Sr=st(ye)}finally{i||(ye.fallbackContext=void 0)}if(mn!=="translate exists"&&fs(Sr)&&Sr===KC||mn==="translate exists"&&!Sr){const[zn,cr]=Lt();return t&&V?Hn(t):ir(zn)}else{if(hr(Sr))return Sr;throw _c(Ll.UNEXPECTED_RETURN_TYPE)}};function sn(...st){return en(Lt=>Reflect.apply(J5,null,[Lt,...st]),()=>sk(...st),"translate",Lt=>Reflect.apply(Lt.t,Lt,[...st]),Lt=>Lt,Lt=>Wn(Lt))}function Mn(...st){const[Lt,mn,Hn]=st;
3870if(Hn&&!gi(Hn))throw _c(Ll.INVALID_ARGUMENT);return sn(Lt,mn,Uo({resolvedMessage:!0},Hn||{}))}function xn(...st){return en(Lt=>Reflect.apply(q5,null,[Lt,...st]),()=>ik(...st),"datetime format",Lt=>Reflect.apply(Lt.d,Lt,[...st]),()=>VE,Lt=>Wn(Lt)||Ho(Lt))}function Vn(...st){return en(Lt=>Reflect.apply(Z5,null,[Lt,...st]),()=>ok(...st),"number format",Lt=>Reflect.apply(Lt.n,Lt,[...st]),()=>VE,Lt=>Wn(Lt)||Ho(Lt))}function Ln(st){return st.map(Lt=>Wn(Lt)||fs(Lt)||No(Lt)?Q5(String(Lt)):Lt)}const Rn={normalize:Ln,interpolate:st=>st,type:"vnode"};function $t(...st){return en(Lt=>{let mn;const Hn=Lt;try{Hn.processor=Rn,mn=Reflect.apply(J5,null,[Hn,...st])}finally{Hn.processor=null}return mn},()=>sk(...st),"translate",Lt=>Lt[ak](...st),Lt=>[Q5(Lt)],Lt=>Ho(Lt))}function fn(...st){return en(Lt=>Reflect.apply(Z5,null,[Lt,...st]),()=>ok(...st),"number format",Lt=>Lt[ck](...st),eN,Lt=>Wn(Lt)||Ho(Lt))}function yn(...st){return en(Lt=>Reflect.apply(q5,null,[Lt,...st]),()=>ik(...st),"datetime format",Lt=>Lt[lk](...st),eN,Lt=>Wn(Lt)||Ho(Lt))}function Cn(st){fe=st,ye.pluralRules=fe}function _n(st,Lt){return en(()=>{if(!st)return!1;const mn=Wn(Lt)?Lt:a.value,Hn=Wn(Lt)?[mn]:rk(ye,y.value,mn);for(let ir=0;ir<Hn.length;ir++){const hr=Xe(Hn[ir]);let Sr=ye.messageResolver(hr,st);if(Sr===null&&(Sr=hr[st]),nd(Sr)||mh(Sr)||Wn(Sr))return!0}return!1},()=>[st],"translate exists",mn=>Reflect.apply(mn.te,mn,[st,Lt]),Mpe,mn=>No(mn))}function Bn(st){let Lt=null;const mn=rk(ye,y.value,a.value);for(let Hn=0;Hn<mn.length;Hn++){const ir=E.value[mn[Hn]]||{},hr=ye.messageResolver(ir,st);if(hr!=null){Lt=hr;break}}return Lt}function Be(st){const Lt=Bn(st);return Lt??(t?t.tm(st)||{}:{})}function Xe(st){return E.value[st]||{}}function mt(st,Lt){if(c){const mn={[st]:Lt};for(const Hn in mn)mc(mn,Hn)&&rx(mn[Hn]);Lt=mn[st]}E.value[st]=Lt,ye.messages=E.value}function kt(st,Lt){E.value[st]=E.value[st]||{};const mn={[st]:Lt};if(c)for(const Hn in mn)mc(mn,Hn)&&rx(mn[Hn]);Lt=mn[st],ey(Lt,E.value[st]),ye.messages=E.value}function Vt(st){return C.value[st]||{}}function Ie(st,Lt){C.value[st]=Lt,ye.datetimeFormats=C.value,X5(ye,st,Lt)}function Ve(st,Lt){C.value[st]=Uo(C.value[st]||{},Lt),ye.datetimeFormats=C.value,X5(ye,st,Lt)}function tt(st){return P.value[st]||{}}function Rt(st,Lt){P.value[st]=Lt,ye.numberFormats=P.value,Y5(ye,st,Lt)}function Ut(st,Lt){P.value[st]=Uo(P.value[st]||{},Lt),ye.numberFormats=P.value,Y5(ye,st,Lt)}tN++,t&&DE&&(qr(t.locale,st=>{m&&(a.value=st,ye.locale=st,ib(ye,a.value,y.value))}),qr(t.fallbackLocale,st=>{m&&(y.value=st,ye.fallbackLocale=st,ib(ye,a.value,y.value))}));const nn={id:tN,locale:qe,fallbackLocale:lt,get inheritLocale(){return m},set inheritLocale(st){m=st,st&&t&&(a.value=t.locale.value,y.value=t.fallbackLocale.value,ib(ye,a.value,y.value))},get availableLocales(){return Object.keys(E.value).sort()},messages:pt,get modifiers(){return ne},get pluralRules(){return fe||{}},get isGlobal(){return i},get missingWarn(){return L},set missingWarn(st){L=st,ye.missingWarn=L},get fallbackWarn(){return D},set fallbackWarn(st){D=st,ye.fallbackWarn=D},get fallbackRoot(){return V},set fallbackRoot(st){V=st},get fallbackFormat(){return U},set fallbackFormat(st){U=st,ye.fallbackFormat=U},get warnHtmlMessage(){return X},set warnHtmlMessage(st){X=st,ye.warnHtmlMessage=st},get escapeParameter(){return K},set escapeParameter(st){K=st,ye.escapeParameter=st},t:sn,getLocaleMessage:Xe,setLocaleMessage:mt,mergeLocaleMessage:kt,getPostTranslationHandler:zt,setPostTranslationHandler:jt,getMissingHandler:Zt,setMissingHandler:Wt,[Ipe]:Cn};return nn.datetimeFormats=Qt,nn.numberFormats=Ht,nn.rt=Mn,nn.te=_n,nn.tm=Be,nn.d=xn,nn.n=Vn,nn.getDateTimeFormat=Vt,nn.setDateTimeFormat=Ie,nn.mergeDateTimeFormat=Ve,nn.getNumberFormat=tt,nn.setNumberFormat=Rt,nn.mergeNumberFormat=Ut,nn[Ppe]=n,nn[ak]=$t,nn[lk]=yn,nn[ck]=fn,nn}const aL={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function Lpe({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((i,c)=>[...i,...c.type===jo?c.children:[c]],[]):t.reduce((n,i)=>{const c=e[i];return c&&(n[i]=c()),n},Ni())}function T9(){return jo}const Ope=Ys({name:"i18n-t",props:Uo({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>fs(e)||!isNaN(e)}},aL),setup(e,t){const{slots:n,attrs:i}=t,c=e.i18n||Xx({useScope:e.scope,__useComponent:!0});return()=>{const h=()=>{const y=Object.keys(n).filter(P=>P[0]!=="_"),E=Ni();e.locale&&(E.locale=e.locale),e.plural!==void 0&&(E.plural=Wn(e.plural)?+e.plural:e.plural);const C=Lpe(t,y);return c[ak](e.keypath,C,E)},m=Uo(Ni(),i),a=Wn(e.tag)||gi(e.tag)?e.tag:T9();return gi(a)?Io(a,m,{default:h}):Io(a,m,h())}}}),rN=Ope;function Dpe(e){return Ho(e)&&!Wn(e[0])}function E9(e,t,n,i){const{slots:c,attrs:h}=t;return()=>{const m=()=>{const E={part:!0};let C=Ni();e.locale&&(E.locale=e.locale),Wn(e.format)?E.key=e.format:gi(e.format)&&(Wn(e.format.key)&&(E.key=e.format.key),C=Object.keys(e.format).reduce((D,V)=>n.includes(V)?Uo(Ni(),D,{[V]:e.format[V]}):D,Ni()));const P=i(e.value,E,C);let L=[E.key];return Ho(P)?L=P.map((D,V)=>{const U=c[D.type],W=U?U({[D.type]:D.value,index:V,parts:P}):[D.value];return Dpe(W)&&(W[0].key=`${D.type}-${V}`),W}):Wn(P)&&(L=[P]),L},a=Uo(Ni(),h),y=Wn(e.tag)||gi(e.tag)?e.tag:T9();return gi(y)?Io(y,a,{default:m}):Io(y,a,m())}}const Fpe=Ys({name:"i18n-n",props:Uo({value:{type:Number,required:!0},format:{type:[String,Object]}},aL),setup(e,t){const n=e.i18n||Xx({useScope:e.scope,__useComponent:!0});
3870return E9(e,t,v9,(...i)=>n[ck](...i))}}),iN=Fpe;function Bpe(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const i=n.__getInstance(t);return i!=null?i.__composer:e.global.__composer}}function zpe(e){const t=m=>{const{instance:a,value:y}=m;if(!a||!a.$)throw _c(Ll.UNEXPECTED_ERROR);const E=Bpe(e,a.$),C=oN(y);return[Reflect.apply(E.t,E,[...sN(C)]),E]};return{created:(m,a)=>{const[y,E]=t(a);DE&&(m.__i18nWatcher=qr(E.locale,()=>{a.instance&&a.instance.$forceUpdate()})),m.__composer=E,m.textContent=y},unmounted:m=>{DE&&m.__i18nWatcher&&(m.__i18nWatcher(),m.__i18nWatcher=void 0,delete m.__i18nWatcher),m.__composer&&(m.__composer=void 0,delete m.__composer)},beforeUpdate:(m,{value:a})=>{if(m.__composer){const y=m.__composer,E=oN(a);m.textContent=Reflect.apply(y.t,y,[...sN(E)])}},getSSRProps:m=>{const[a]=t(m);return{textContent:a}}}}function oN(e){if(Wn(e))return{path:e};if(Mi(e)){if(!("path"in e))throw _c(Ll.REQUIRED_VALUE,"path");return e}else throw _c(Ll.INVALID_VALUE)}function sN(e){const{path:t,locale:n,args:i,choice:c,plural:h}=e,m={},a=i||{};return Wn(n)&&(m.locale=n),fs(c)&&(m.plural=c),fs(h)&&(m.plural=h),[t,a,m]}function Npe(e,t,...n){const i=Mi(n[0])?n[0]:{};(!No(i.globalInstall)||i.globalInstall)&&([rN.name,"I18nT"].forEach(h=>e.component(h,rN)),[iN.name,"I18nN"].forEach(h=>e.component(h,iN)),[cN.name,"I18nD"].forEach(h=>e.component(h,cN))),e.directive("t",zpe(t))}const Vpe=rp("global-vue-i18n");function Upe(e={}){const t=No(e.globalInjection)?e.globalInjection:!0,n=new Map,[i,c]=$pe(e),h=rp("");function m(C){return n.get(C)||null}function a(C,P){n.set(C,P)}function y(C){n.delete(C)}const E={get mode(){return"composition"},async install(C,...P){if(C.__VUE_I18N_SYMBOL__=h,C.provide(C.__VUE_I18N_SYMBOL__,E),Mi(P[0])){const V=P[0];E.__composerExtend=V.__composerExtend,E.__vueI18nExtend=V.__vueI18nExtend}let L=null;t&&(L=Zpe(C,E.global)),Npe(C,E,...P);const D=C.unmount;C.unmount=()=>{L&&L(),E.dispose(),D()}},get global(){return c},dispose(){i.stop()},__instances:n,__getInstance:m,__setInstance:a,__deleteInstance:y};return E}function Xx(e={}){const t=S9();if(t==null)throw _c(Ll.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw _c(Ll.NOT_INSTALLED);const n=jpe(t),i=Hpe(n),c=Rpe(t),h=Gpe(e,c);if(h==="global")return kpe(i,e,c),i;if(h==="parent"){let y=aN(n,t,e.__useComponent);return y==null&&(y=i),y}if(h==="isolated"){if(n.mode!=="composition")throw _c(Ll.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const y=n,E=Uo({},e),C=aN(n,t);E.__root=C||i;const P=uk(E);return y.__composerExtend&&(P[$_]=y.__composerExtend(P)),ld()&&Dm(()=>{const D=P[$_];D&&(D(),delete P[$_])}),P}const m=n;let a=m.__getInstance(t);if(a==null){const y=Uo({},e);"__i18n"in c&&(y.__i18n=c.__i18n),i&&(y.__root=i),a=uk(y),m.__composerExtend&&(a[$_]=m.__composerExtend(a)),qpe(m,t,a),m.__setInstance(t,a)}return a}function $pe(e,t){const n=Cx(),i=n.run(()=>uk(e));if(i==null)throw _c(Ll.UNEXPECTED_ERROR);return[n,i]}function jpe(e){const t=wo(e.isCE?Vpe:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw _c(e.isCE?Ll.NOT_INSTALLED_WITH_PROVIDE:Ll.UNEXPECTED_ERROR);return t}function Gpe(e,t){return GC(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function Hpe(e){return e.mode==="composition"?e.global:e.global.__composer}function aN(e,t,n=!1){let i=null;const c=t.root;let h=Wpe(t,n);for(;h!=null;){const m=e;if(e.mode==="composition"&&(i=m.__getInstance(h)),i!=null||c===h)break;h=h.parent}return i}function Wpe(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function qpe(e,t,n){cu(()=>{},t),Ey(()=>{const i=n;e.__deleteInstance(t);const c=i[$_];c&&(c(),delete i[$_])},t)}const Xpe=["locale","fallbackLocale","availableLocales"],lN=["t","rt","d","n","tm","te"];function Zpe(e,t){const n=Object.create(null);return Xpe.forEach(c=>{const h=Object.getOwnPropertyDescriptor(t,c);if(!h)throw _c(Ll.UNEXPECTED_ERROR);const m=qi(h.value)?{get(){return h.value.value},set(a){h.value.value=a}}:{get(){return h.get&&h.get()}};Object.defineProperty(n,c,m)}
3870),e.config.globalProperties.$i18n=n,lN.forEach(c=>{const h=Object.getOwnPropertyDescriptor(t,c);if(!h||!h.value)throw _c(Ll.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${c}`,h)}),()=>{delete e.config.globalProperties.$i18n,lN.forEach(c=>{delete e.config.globalProperties[`$${c}`]})}}const Ype=Ys({name:"i18n-d",props:Uo({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},aL),setup(e,t){const n=e.i18n||Xx({useScope:e.scope,__useComponent:!0});return E9(e,t,y9,(...i)=>n[lk](...i))}}),cN=Ype;cpe(Xfe);upe(spe);dpe(rk);function uN(e=rr()){const t=qx(e);return n=>{if(n!=null)return t.getRouteBaseName(n)||void 0}}function Kpe(e=rr()){const t=qx(e);return(n,i)=>BE(t,n,i)}function C9(e=rr()){const t=qx(e);return(n,i)=>K8(t,n,i)}function A9(e=rr()){const t=qx(e);return n=>tL(t,n)}const dN="nuxt-i18n-slp",Jpe=new RegExp([`<!--${dN}-\\[(\\w+)\\]-->`,".+?",`<!--/${dN}-->`].join(""),"g"),Qpe=Ji({name:"i18n:plugin:switch-locale-path-ssr",dependsOn:["i18n:plugin"],setup(e){const t=rr(e._id),n=A9(t);t.hook("app:rendered",i=>{i.renderResult?.html!=null&&(i.renderResult.html=i.renderResult.html.replaceAll(Jpe,(c,h)=>{const m=encodeURI(n(h??""));return c.replace(/href="([^"]+)"/,`href="${m||"#"}" `)}))})}}),eme=Ji({name:"i18n:plugin:route-locale-detect",dependsOn:["i18n:plugin"],async setup(e){let t,n;const i=rr(e._id),c=XC(i),h=r9();[t,n]=$f(()=>i.runWithContext(()=>ek(i,c.initial&&h.value||F5(i,i.$router.currentRoute.value)))),await t,n(),aJ("locale-changing",async m=>{let a,y;const E=([a,y]=$f(()=>i.runWithContext(()=>ek(i,F5(i,m)))),a=await a,y(),a);return c.initial=!1,i.runWithContext(()=>i9(i,m,E))},{global:!0})}}),tme=Ji({name:"i18n:plugin:preload",dependsOn:["i18n:plugin"],async setup(e){}});function nme(e,{extendComposer:t,extendComposerInstance:n}){const i=Cx(),c=e.install.bind(e);e.install=(h,...m)=>{const a=Uo({},m[0]);a.__composerExtend=E=>(n(E,mT(e)),()=>{}),e.mode==="legacy"&&(a.__vueI18nExtend=E=>(n(E,mT(E)),()=>{})),Reflect.apply(c,e,[h,a]);const y=mT(e);if(i.run(()=>{t(y),e.mode==="legacy"&&"__composer"in e.global&&n(e.global,mT(e.global))}),e.mode==="composition"&&h.config.globalProperties.$i18n!=null&&n(h.config.globalProperties.$i18n,y),h.unmount){const E=h.unmount.bind(h);h.unmount=()=>{i.stop(),E()}}}}const rme=async e=>{const t=await Nhe(Bhe);t.locale=e||t.locale||"en-US",t.defaultLocale=e,t.fallbackLocale??=!1,t.messages??={};for(const n of tx)t.messages[n]??={};return t};var ime={ar:"310e43c4",en:"310e43c4"};const ome=Ji({name:"i18n:plugin",parallel:!1,async setup(e){let t,n;Object.defineProperty(e.versions,"nuxtI18n",{get:()=>"10.4.0"});const i=rr(e._id),c=qC(i),h=i.ssrContext?.event?.context?.nuxtI18n?.vueI18nOptions,m=Yhe(IE().host)||c.defaultLocale||"",a=h||([t,n]=$f(()=>rme(m)),t=await t,n(),t),y=n9();y.value??=qhe(a.fallbackLocale),tx.map(L=>`/_i18n/${ime[L]}/${L}/messages.json`);const E=Upe(a),C=ZC(void 0,Wx(i),i),P=Qhe(i,E,a.defaultLocale);i._nuxtI18n=P,nme(E,{extendComposer(L){L.locales=vn(()=>c.locales),L.localeCodes=vn(()=>tx);const D=hn(P.getBaseUrl());L.baseUrl=vn(()=>D.value),qr(L.locale,()=>D.value=P.getBaseUrl()),L.strategy="prefix",L.localeProperties=vn(()=>Hx.find(V=>V.code===L.locale.value)||{code:L.locale.value}),L.setLocale=async V=>{await ek(i,V),await i.runWithContext(()=>i9(i,i.$router.currentRoute.value,V))},L.loadLocaleMessages=P.loadMessages,L.differentDomains=!1,L.defaultLocale=a.defaultLocale,L.getBrowserLocale=()=>D5(C.navigator()),L.getLocaleCookie=()=>D5(C.cookie()),L.setLocaleCookie=P.setCookieLocale,L.finalizePendingLocaleChange=async()=>{E.__pendingLocale&&await E.__resolvePendingLocalePromise?.()},L.waitForPendingLocaleChange=async()=>{await E?.__pendingLocalePromise}},extendComposerInstance(L,D){const V=[["locales",()=>D.locales],["localeCodes",()=>D.localeCodes],["baseUrl",()=>D.baseUrl],["strategy",()=>"prefix"],["localeProperties",()=>D.localeProperties],["setLocale",()=>U=>Reflect.apply(D.setLocale,D,[U])],["loadLocaleMessages",()=>U=>Reflect.apply(D.loadLocaleMessages,D,[U])],["differentDomains",()=>!1],["defaultLocale",()=>D.defaultLocale],["getBrowserLocale",()=>()=>Reflect.apply(D.getBrowserLocale,D,[])],["getLocaleCookie",()=>()=>Reflect.apply(D.getLocaleCookie,D,[])],["setLocaleCookie",()=>U=>Reflect.apply(D.setLocaleCookie,D,[U])],["finalizePendingLocaleChange",()=>()=>Reflect.apply(D.finalizePendingLocaleChange,D,[])],["waitForPendingLocaleChange",()=>()=>Reflect.apply(D.waitForPendingLocaleChange,D,[])]];for(const[U,W]of V)Object.defineProperty(L,U,{get:W})}}),i.vueApp.use(E),Object.defineProperty(i,"$i18n",{get:()=>nL(E)}),i.provide("localeHead",L=>Ahe(i._nuxtI18n.composableCtx,L)),i.provide("localePath",Kpe(i)),i.provide("localeRoute",C9(i)),i.provide("routeBaseName",uN(i)),i.provide("getRouteBaseName",uN(i)),i.provide("switchLocalePath",A9(i))}});var sme=Object.defineProperty,hN=Object.getOwnPropertySymbols,ame=Object.prototype.hasOwnProperty,lme=Object.prototype.propertyIsEnumerable,fN=(e,t,n)=>t in e?sme(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,I9=(e,t)=>{for(var n in t||(t={}
3870))ame.call(t,n)&&fN(e,n,t[n]);if(hN)for(var n of hN(t))lme.call(t,n)&&fN(e,n,t[n]);return e};function ad(e){return e==null||e===""||Array.isArray(e)&&e.length===0||!(e instanceof Date)&&typeof e=="object"&&Object.keys(e).length===0}function cme(e,t,n,i=1){let c=-1,h=ad(e),m=ad(t);return h&&m?c=0:h?c=i:m?c=-i:typeof e=="string"&&typeof t=="string"?c=n(e,t):c=e<t?-1:e>t?1:0,c}function dk(e,t,n=new WeakSet){if(e===t)return!0;if(!e||!t||typeof e!="object"||typeof t!="object"||n.has(e)||n.has(t))return!1;n.add(e).add(t);let i=Array.isArray(e),c=Array.isArray(t),h,m,a;if(i&&c){if(m=e.length,m!=t.length)return!1;for(h=m;h--!==0;)if(!dk(e[h],t[h],n))return!1;return!0}if(i!=c)return!1;let y=e instanceof Date,E=t instanceof Date;if(y!=E)return!1;if(y&&E)return e.getTime()==t.getTime();let C=e instanceof RegExp,P=t instanceof RegExp;if(C!=P)return!1;if(C&&P)return e.toString()==t.toString();let L=Object.keys(e);if(m=L.length,m!==Object.keys(t).length)return!1;for(h=m;h--!==0;)if(!Object.prototype.hasOwnProperty.call(t,L[h]))return!1;for(h=m;h--!==0;)if(a=L[h],!dk(e[a],t[a],n))return!1;return!0}function ume(e,t){return dk(e,t)}function JC(e){return typeof e=="function"&&"call"in e&&"apply"in e}function Qi(e){return!ad(e)}function hk(e,t){if(!e||!t)return null;try{let n=e[t];if(Qi(n))return n}catch{}if(Object.keys(e).length){if(JC(t))return t(e);if(t.indexOf(".")===-1)return e[t];{let n=t.split("."),i=e;for(let c=0,h=n.length;c<h;++c){if(i==null)return null;i=i[n[c]]}return i}}return null}function P9(e,t,n){return n?hk(e,n)===hk(t,n):ume(e,t)}function gOe(e,t){if(e!=null&&t&&t.length){for(let n of t)if(P9(e,n))return!0}return!1}function nu(e,t=!0){return e instanceof Object&&e.constructor===Object&&(t||Object.keys(e).length!==0)}function R9(e={},t={}){let n=I9({},e);return Object.keys(t).forEach(i=>{let c=i;nu(t[c])&&c in e&&nu(e[c])?n[c]=R9(e[c],t[c]):n[c]=t[c]}),n}function k9(...e){return e.reduce((t,n,i)=>i===0?n:R9(t,n),{})}function _Oe(e,t){let n=-1;if(t){for(let i=0;i<t.length;i++)if(t[i]===e){n=i;break}}return n}function yOe(e,t){let n;if(Qi(e))try{n=e.findLast(t)}catch{n=[...e].reverse().find(t)}return n}function vOe(e,t){let n=-1;if(Qi(e))try{n=e.findLastIndex(t)}catch{n=e.lastIndexOf([...e].reverse().find(t))}return n}function kl(e,...t){return JC(e)?e(...t):e}function cl(e,t=!0){return typeof e=="string"&&(t||e!=="")}function Ju(e){return cl(e)?e.replace(/(-|_)/g,"").toLowerCase():e}function lL(e,t="",n={}){let i=Ju(t).split("."),c=i.shift();if(c){if(nu(e)){let h=Object.keys(e).find(m=>Ju(m)===c)||"";return lL(kl(e[h],n),i.join("."),n)}return}return kl(e,n)}function M9(e,t=!0){return Array.isArray(e)&&(t||e.length!==0)}function bOe(e){return e instanceof Date}function dme(e){return Qi(e)&&!isNaN(e)}function xOe(e=""){return Qi(e)&&e.length===1&&!!e.match(/\S| /)}function wOe(){return new Intl.Collator(void 0,{numeric:!0}).compare}function Hf(e,t){if(t){let n=t.test(e);return t.lastIndex=0,n}return!1}function hme(...e){return k9(...e)}function Nb(e){return e&&e.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,"").replace(/ {2,}/g," ").replace(/ ([{:}]) /g,"$1").replace(/([;,]) /g,"$1").replace(/ !/g,"!").replace(/: /g,":").trim()}function SOe(e,...t){if(!nu(e))return e;let n=I9({},e);return t?.flat().forEach(i=>delete n[i]),n}function lc(e){if(e&&/[\xC0-\xFF\u0100-\u017E]/.test(e)){let t={A:/[\xC0-\xC5\u0100\u0102\u0104]/g,AE:/[\xC6]/g,C:/[\xC7\u0106\u0108\u010A\u010C]/g,D:/[\xD0\u010E\u0110]/g,E:/[\xC8-\xCB\u0112\u0114\u0116\u0118\u011A]/g,G:/[\u011C\u011E\u0120\u0122]/g,H:/[\u0124\u0126]/g,I:/[\xCC-\xCF\u0128\u012A\u012C\u012E\u0130]/g,IJ:/[\u0132]/g,J:/[\u0134]/g,K:/[\u0136]/g,L:/[\u0139\u013B\u013D\u013F\u0141]/g,N:/[\xD1\u0143\u0145\u0147\u014A]/g,O:/[\xD2-\xD6\xD8\u014C\u014E\u0150]/g,OE:/[\u0152]/g,R:/[\u0154\u0156\u0158]/g,S:/[\u015A\u015C\u015E\u0160]/g,T:/[\u0162\u0164\u0166]/g,U:/[\xD9-\xDC\u0168\u016A\u016C\u016E\u0170\u0172]/g,W:/[\u0174]/g,Y:/[\xDD\u0176\u0178]/g,Z:/[\u0179\u017B\u017D]/g,a:/[\xE0-\xE5\u0101\u0103\u0105]/g,ae:/[\xE6]/g,c:/[\xE7\u0107\u0109\u010B\u010D]/g,d:/[\u010F\u0111]/g,e:/[\xE8-\xEB\u0113\u0115\u0117\u0119\u011B]/g,g:/[\u011D\u011F\u0121\u0123]/g,i:/[\xEC-\xEF\u0129\u012B\u012D\u012F\u0131]/g,ij:/[\u0133]/g,j:/[\u0135]/g,k:/[\u0137,\u0138]/g,l:/[\u013A\u013C\u013E\u0140\u0142]/g,n:/[\xF1\u0144\u0146\u0148\u014B]/g,p:/[\xFE]/g,o:/[\xF2-\x
3870F6\xF8\u014D\u014F\u0151]/g,oe:/[\u0153]/g,r:/[\u0155\u0157\u0159]/g,s:/[\u015B\u015D\u015F\u0161]/g,t:/[\u0163\u0165\u0167]/g,u:/[\xF9-\xFC\u0169\u016B\u016D\u016F\u0171\u0173]/g,w:/[\u0175]/g,y:/[\xFD\xFF\u0177]/g,z:/[\u017A\u017C\u017E]/g};for(let n in t)e=e.replace(t[n],n)}return e}function TOe(e,t,n){e&&t!==n&&(n>=e.length&&(n%=e.length,t%=e.length),e.splice(n,0,e.splice(t,1)[0]))}function EOe(e,t,n=1,i,c=1){let h=cme(e,t,i,n),m=n;return(ad(e)||ad(t))&&(m=c===1?n:c),m*h}function fme(e){return cl(e,!1)?e[0].toUpperCase()+e.slice(1):e}function L9(e){return cl(e)?e.replace(/(_)/g,"-").replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase():e}function Zx(){let e=new Map;return{on(t,n){let i=e.get(t);return i?i.push(n):i=[n],e.set(t,i),this},off(t,n){let i=e.get(t);return i&&i.splice(i.indexOf(n)>>>0,1),this},emit(t,n){let i=e.get(t);i&&i.forEach(c=>{c(n)})},clear(){e.clear()}}}function cL(...e){if(e){let t=[];for(let n=0;n<e.length;n++){let i=e[n];if(!i)continue;let c=typeof i;if(c==="string"||c==="number")t.push(i);else if(c==="object"){let h=Array.isArray(i)?[cL(...i)]:Object.entries(i).map(([m,a])=>a?m:void 0);t=h.length?t.concat(h.filter(m=>!!m)):t}}return t.join(" ").trim()}}function pme(e,t){return e?e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className):!1}function fk(e,t){if(e&&t){let n=i=>{pme(e,i)||(e.classList?e.classList.add(i):e.className+=" "+i)};[t].flat().filter(Boolean).forEach(i=>i.split(" ").forEach(n))}}function mme(){return window.innerWidth-document.documentElement.offsetWidth}function COe(e){typeof e=="string"?fk(document.body,e||"p-overflow-hidden"):(e!=null&&e.variableName&&document.body.style.setProperty(e.variableName,mme()+"px"),fk(document.body,e?.className||"p-overflow-hidden"))}function gme(e){if(e){let t=document.createElement("a");if(t.download!==void 0){let{name:n,src:i}=e;return t.setAttribute("href",i),t.setAttribute("download",n),t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t),!0}}return!1}function AOe(e,t){let n=new Blob([e],{type:"application/csv;charset=utf-8;"});window.navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(n,t+".csv"):gme({name:t+".csv",src:URL.createObjectURL(n)})||(e="data:text/csv;charset=utf-8,"+e,window.open(encodeURI(e)))}function Vb(e,t){if(e&&t){let n=i=>{e.classList?e.classList.remove(i):e.className=e.className.replace(new RegExp("(^|\\b)"+i.split(" ").join("|")+"(\\b|$)","gi")," ")};[t].flat().filter(Boolean).forEach(i=>i.split(" ").forEach(n))}}function IOe(e){typeof e=="string"?Vb(document.body,e||"p-overflow-hidden"):(e!=null&&e.variableName&&document.body.style.removeProperty(e.variableName),Vb(document.body,e?.className||"p-overflow-hidden"))}function pk(e){for(let t of document?.styleSheets)try{for(let n of t?.cssRules)for(let i of n?.style)if(e.test(i))return{name:i,value:n.style.getPropertyValue(i).trim()}}catch{}return null}function O9(e){let t={width:0,height:0};if(e){let[n,i]=[e.style.visibility,e.style.display],c=e.getBoundingClientRect();e.style.visibility="hidden",e.style.display="block",t.width=c.width||e.offsetWidth,t.height=c.height||e.offsetHeight,e.style.display=i,e.style.visibility=n}return t}function uL(){let e=window,t=document,n=t.documentElement,i=t.getElementsByTagName("body")[0],c=e.innerWidth||n.clientWidth||i.clientWidth,h=e.innerHeight||n.clientHeight||i.clientHeight;return{width:c,height:h}}function mk(e){return e?Math.abs(e.scrollLeft):0}function _me(){let e=document.documentElement;return(window.pageXOffset||mk(e))-(e.clientLeft||0)}function yme(){let e=document.documentElement;return(window.pageYOffset||e.scrollTop)-(e.clientTop||0)}function vme(e){return e?getComputedStyle(e).direction==="rtl":!1}function POe(e,t,n=!0){var i,c,h,m;if(e){let a=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:O9(e),y=a.height,E=a.width,C=t.offsetHeight,P=t.offsetWidth,L=t.getBoundingClientRect(),D=yme(),V=_me(),U=uL(),W,$,Y="top";L.top+C+y>U.height?(W=L.top+D-y,Y="bottom",W<0&&(W=D)):W=C+L.top+D,L.left+E>U.width?$=Math.max(0,L.left+V+P-E):$=L.left+V,vme(e)?e.style.insetInlineEnd=$+"px":e.style.insetInlineStart=$+"px",e.style.top=W+"px",e.style.transformOrigin=Y,n&&(e.style.marginTop=Y==="bottom"?`calc(${(c=(i=pk(/-anchor-gutter$/))==null?void 0:i.value)!=null?c:"2px"} * -1)`:(m=(h=pk(/-anchor-gutter$/))==null?void 0:h.value)!=null?m:"")}}function bme(e,t){e&&(typeof t=="string"?e.style.cssText=t:Object.entries(t||{}
3870).forEach(([n,i])=>e.style[n]=i))}function D9(e,t){if(e instanceof HTMLElement){let n=e.offsetWidth;if(t){let i=getComputedStyle(e);n+=parseFloat(i.marginLeft)+parseFloat(i.marginRight)}return n}return 0}function ROe(e,t,n=!0,i=void 0){var c;if(e){let h=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:O9(e),m=t.offsetHeight,a=t.getBoundingClientRect(),y=uL(),E,C,P=i??"top";if(!i&&a.top+m+h.height>y.height?(E=-1*h.height,P="bottom",a.top+E<0&&(E=-1*a.top)):E=m,h.width>y.width?C=a.left*-1:a.left+h.width>y.width?C=(a.left+h.width-y.width)*-1:C=0,e.style.top=E+"px",e.style.insetInlineStart=C+"px",e.style.transformOrigin=P,n){let L=(c=pk(/-anchor-gutter$/))==null?void 0:c.value;e.style.marginTop=P==="bottom"?`calc(${L??"2px"} * -1)`:L??""}}}function dL(e){if(e){let t=e.parentNode;return t&&t instanceof ShadowRoot&&t.host&&(t=t.host),t}return null}function xme(e){return!!(e!==null&&typeof e<"u"&&e.nodeName&&dL(e))}function sp(e){return typeof Element<"u"?e instanceof Element:e!==null&&typeof e=="object"&&e.nodeType===1&&typeof e.nodeName=="string"}var uP;function pN(e){{if(uP!=null)return uP;let t=document.createElement("div");bme(t,{width:"100px",height:"100px",overflow:"scroll",position:"absolute",top:"-9999px"}),document.body.appendChild(t);let n=t.offsetWidth-t.clientWidth;return document.body.removeChild(t),uP=n,n}}function kOe(){if(window.getSelection){let e=window.getSelection()||{};e.empty?e.empty():e.removeAllRanges&&e.rangeCount>0&&e.getRangeAt(0).getClientRects().length>0&&e.removeAllRanges()}}function UE(e,t={}){if(sp(e)){let n=(i,c)=>{var h,m;let a=(h=e?.$attrs)!=null&&h[i]?[(m=e?.$attrs)==null?void 0:m[i]]:[];return[c].flat().reduce((y,E)=>{if(E!=null){let C=typeof E;if(C==="string"||C==="number")y.push(E);else if(C==="object"){let P=Array.isArray(E)?n(i,E):Object.entries(E).map(([L,D])=>i==="style"&&(D||D===0)?`${L.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${D}`:D?L:void 0);y=P.length?y.concat(P.filter(L=>!!L)):y}}return y},a)};Object.entries(t).forEach(([i,c])=>{if(c!=null){let h=i.match(/^on(.+)/);h?e.addEventListener(h[1].toLowerCase(),c):i==="p-bind"||i==="pBind"?UE(e,c):(c=i==="class"?[...new Set(n("class",c))].join(" ").trim():i==="style"?n("style",c).join(";").trim():c,(e.$attrs=e.$attrs||{})&&(e.$attrs[i]=c),e.setAttribute(i,c))}})}}function wme(e,t={},...n){if(e){let i=document.createElement(e);return UE(i,t),i.append(...n),i}}function MOe(e,t){if(e){e.style.opacity="0";let n=+new Date,i="0",c=function(){i=`${+e.style.opacity+(new Date().getTime()-n)/t}`,e.style.opacity=i,n=+new Date,+i<1&&("requestAnimationFrame"in window?requestAnimationFrame(c):setTimeout(c,16))};c()}}function Sme(e,t){return sp(e)?Array.from(e.querySelectorAll(t)):[]}function F9(e,t){return sp(e)?e.matches(t)?e:e.querySelector(t):null}function LOe(e,t){e&&document.activeElement!==e&&e.focus(t)}function B9(e,t){if(sp(e)){let n=e.getAttribute(t);return isNaN(n)?n==="true"||n==="false"?n==="true":n:+n}}function z9(e,t=""){let n=Sme(e,`button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t}, 3871 [href]:not([tabindex = "-1"]):not([style*="display:none"]):not([hidden])${t}, 3872 input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t}, 3873 select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t}, 3874 textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t}, 3875 [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t}, 3876 [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t}`),i=[];for(let c of n)getComputedStyle(c).display!="none"&&getComputedStyle(c).visibility!="hidden"&&i.push(c);return i}function OOe(e,t){let n=z9(e,t);return n.length>0?n[0]:null}function mN(e){if(e){let t=e.offsetHeight,n=getComputedStyle(e);return t-=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)+parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),t}return 0}function Tme(e){if(e){let[t,n]=[e.style.visibility,e.style.display];e.style.visibility="hidden",e.style.display="block";let i=e.offsetHeight;return e.style.display=n,e.style.visibility=t,i}return 0}function Eme(e){if(e){let[t,n]=[e.style.visibility,e.style.display];e.style.visibility="hidden",e.style.display="block";let i=e.offsetWidth;return e.style.display=n,e.style.visibility=t,i}return 0}function DOe(e){var t;if(e){let n=(t=dL(e))==null?void 0:t.childNodes,i=0;if(n)for(let c=0;c<n.length;c++){if(n[c]===e)return i;n[c].nodeType===1&&i++}}return-1}function FOe(e,t){let n=z9(e,t);return n.length>0?n[n.length-1]:null}function BOe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}return null}function N9(e){if(e){let t=e.getBoundingClientRect();return{top:t.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),left
3876:t.left+(window.pageXOffset||mk(document.documentElement)||mk(document.body)||0)}}return{top:"auto",left:"auto"}}function hL(e,t){if(e){let n=e.offsetHeight;if(t){let i=getComputedStyle(e);n+=parseFloat(i.marginTop)+parseFloat(i.marginBottom)}return n}return 0}function V9(e,t=[]){let n=dL(e);return n===null?t:V9(n,t.concat([n]))}function zOe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}return null}function NOe(e){let t=[];if(e){let n=V9(e),i=/(auto|scroll)/,c=h=>{try{let m=window.getComputedStyle(h,null);return i.test(m.getPropertyValue("overflow"))||i.test(m.getPropertyValue("overflowX"))||i.test(m.getPropertyValue("overflowY"))}catch{return!1}};for(let h of n){let m=h.nodeType===1&&h.dataset.scrollselectors;if(m){let a=m.split(",");for(let y of a){let E=F9(h,y);E&&c(E)&&t.push(E)}}h.nodeType!==9&&c(h)&&t.push(h)}}return t}function VOe(){if(window.getSelection)return window.getSelection().toString();if(document.getSelection)return document.getSelection().toString()}function UOe(){return navigator.userAgent}function gN(e){if(e){let t=e.offsetWidth,n=getComputedStyle(e);return t-=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)+parseFloat(n.borderLeftWidth)+parseFloat(n.borderRightWidth),t}return 0}function $Oe(e){if(e){let t=getComputedStyle(e);return parseFloat(t.getPropertyValue("animation-duration")||"0")>0}return!1}function jOe(e,t,n){let i=e[t];typeof i=="function"&&i.apply(e,[])}function GOe(){return/(android)/i.test(navigator.userAgent)}function HOe(e,t,n){return sp(e)?B9(e,t)===n:!1}function WOe(e){if(e){let t=e.nodeName,n=e.parentElement&&e.parentElement.nodeName;return t==="INPUT"||t==="TEXTAREA"||t==="BUTTON"||t==="A"||n==="INPUT"||n==="TEXTAREA"||n==="BUTTON"||n==="A"||!!e.closest(".p-button, .p-checkbox, .p-radiobutton")}return!1}function U9(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function qOe(e,t=""){return sp(e)?e.matches(`button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t}, 3877 [href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t}, 3878 input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t}, 3879 select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t}, 3880 textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t}, 3881 [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t}, 3882 [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t}`):!1}function XOe(e){return!!(e&&e.offsetParent!=null)}function ZOe(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}function YOe(e,t){var n,i;if(e){let c=e.parentElement,h=N9(c),m=uL(),a=e.offsetParent?e.offsetWidth:Eme(e),y=e.offsetParent?e.offsetHeight:Tme(e),E=D9((n=c?.children)==null?void 0:n[0]),C=hL((i=c?.children)==null?void 0:i[0]),P="",L="";h.left+E+a>m.width-pN()?h.left<a?t%2===1?P=h.left?"-"+h.left+"px":"100%":t%2===0&&(P=m.width-a-pN()+"px"):P="-100%":P="100%",e.getBoundingClientRect().top+C+y>m.height?L=`-${y-C}px`:L="0px",e.style.top=L,e.style.insetInlineStart=P}}function KOe(e,t){let n=getComputedStyle(e).getPropertyValue("borderTopWidth"),i=n?parseFloat(n):0,c=getComputedStyle(e).getPropertyValue("paddingTop"),h=c?parseFloat(c):0,m=e.getBoundingClientRect(),a=t.getBoundingClientRect().top+document.body.scrollTop-(m.top+document.body.scrollTop)-i-h,y=e.scrollTop,E=e.clientHeight,C=hL(t);a<0?e.scrollTop=y+a:a+C>E&&(e.scrollTop=y+a-E+C)}function $9(e,t="",n){sp(e)&&n!==null&&n!==void 0&&e.setAttribute(t,n)}function JOe(e,t,n=null,i){var c;t&&((c=e?.style)==null||c.setProperty(t,n,i))}var yT={};function Cme(e="pui_id_"){return Object.hasOwn(yT,e)||(yT[e]=0),yT[e]++,`${e}${yT[e]}`}function Ame(){let e=[],t=(m,a,y=999)=>{let E=c(m,a,y),C=E.value+(E.key===m?0:y)+1;return e.push({key:m,value:C}),C},n=m=>{e=e.filter(a=>a.value!==m)},i=(m,a)=>c(m).value,c=(m,a,y=0)=>[...e].reverse().find(E=>!0)||{key:m,value:y},h=m=>m&&parseInt(m.style.zIndex,10)||0;return{get:h,set:(m,a,y)=>{a&&(a.style.zIndex=String(t(m,!0,y)))},clear:m=>{m&&(n(h(m)),m.style.zIndex="")},getCurrent:m=>i(m)}}var dP=Ame(),Ime=Object.defineProperty,Pme=Object.defineProperties,Rme=Object.getOwnPropertyDescriptors,$E=Object.getOwnPropertySymbols,j9=Object.prototype.hasOwnProperty,G9=Object.prototype.propertyIsEnumerable,_N=(e,t,n)=>t in e?Ime(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xc=(e,t)=>{for(var n in t||(t={}
3882))j9.call(t,n)&&_N(e,n,t[n]);if($E)for(var n of $E(t))G9.call(t,n)&&_N(e,n,t[n]);return e},hP=(e,t)=>Pme(e,Rme(t)),Xd=(e,t)=>{var n={};for(var i in e)j9.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&$E)for(var i of $E(e))t.indexOf(i)<0&&G9.call(e,i)&&(n[i]=e[i]);return n};function kme(...e){return k9(...e)}var Mme=Zx(),js=Mme,gy=/{([^}]*)}/g,H9=/(\d+\s+[\+\-\*\/]\s+\d+)/g,W9=/var\([^)]+\)/g;function yN(e){return cl(e)?e.replace(/[A-Z]/g,(t,n)=>n===0?t:"."+t.toLowerCase()).toLowerCase():e}function Lme(e){return nu(e)&&e.hasOwnProperty("$value")&&e.hasOwnProperty("$type")?e.$value:e}function Ome(e){return e.replaceAll(/ /g,"").replace(/[^\w]/g,"-")}function gk(e="",t=""){return Ome(`${cl(e,!1)&&cl(t,!1)?`${e}-`:e}${t}`)}function q9(e="",t=""){return`--${gk(e,t)}`}function Dme(e=""){let t=(e.match(/{/g)||[]).length,n=(e.match(/}/g)||[]).length;return(t+n)%2!==0}function X9(e,t="",n="",i=[],c){if(cl(e)){let h=e.trim();if(Dme(h))return;if(Hf(h,gy)){let m=h.replaceAll(gy,a=>{let y=a.replace(/{|}/g,"").split(".").filter(E=>!i.some(C=>Hf(E,C)));return`var(${q9(n,L9(y.join("-")))}${Qi(c)?`, ${c}`:""})`});return Hf(m.replace(W9,"0"),H9)?`calc(${m})`:m}return h}else if(dme(e))return e}function Fme(e,t,n){cl(t,!1)&&e.push(`${t}:${n};`)}function z_(e,t){return e?`${e}{${t}}`:""}function Z9(e,t){if(e.indexOf("dt(")===-1)return e;function n(m,a){let y=[],E=0,C="",P=null,L=0;for(;E<=m.length;){let D=m[E];if((D==='"'||D==="'"||D==="`")&&m[E-1]!=="\\"&&(P=P===D?null:D),!P&&(D==="("&&L++,D===")"&&L--,(D===","||E===m.length)&&L===0)){let V=C.trim();V.startsWith("dt(")?y.push(Z9(V,a)):y.push(i(V)),C="",E++;continue}D!==void 0&&(C+=D),E++}return y}function i(m){let a=m[0];if((a==='"'||a==="'"||a==="`")&&m[m.length-1]===a)return m.slice(1,-1);let y=Number(m);return isNaN(y)?m:y}let c=[],h=[];for(let m=0;m<e.length;m++)if(e[m]==="d"&&e.slice(m,m+3)==="dt(")h.push(m),m+=2;else if(e[m]===")"&&h.length>0){let a=h.pop();h.length===0&&c.push([a,m])}if(!c.length)return e;for(let m=c.length-1;m>=0;m--){let[a,y]=c[m],E=e.slice(a+3,y),C=n(E,t),P=t(...C);e=e.slice(0,a)+P+e.slice(y+1)}return e}function vN(e){return e.length===4?`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`:e}function bN(e){let t=parseInt(e.substring(1),16),n=t>>16&255,i=t>>8&255,c=t&255;return{r:n,g:i,b:c}}function Bme(e,t,n){return`#${e.toString(16).padStart(2,"0")}${t.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`}var Y9=(e,t,n)=>{e=vN(e),t=vN(t);let i=(n/100*2-1+1)/2,c=1-i,h=bN(e),m=bN(t),a=Math.round(h.r*i+m.r*c),y=Math.round(h.g*i+m.g*c),E=Math.round(h.b*i+m.b*c);return Bme(a,y,E)},zme=(e,t)=>Y9("#000000",e,t),Nme=(e,t)=>Y9("#ffffff",e,t),xN=[50,100,200,300,400,500,600,700,800,900,950],Vme=e=>{if(Hf(e,gy)){let t=e.replace(/{|}/g,"");return xN.reduce((n,i)=>(n[i]=`{${t}.${i}}`,n),{})}return typeof e=="string"?xN.reduce((t,n,i)=>(t[n]=i<=5?Nme(e,(5-i)*19):zme(e,(i-5)*15),t),{}):e},QOe=e=>{var t;let n=Wi.getTheme(),i=_k(n,e,void 0,"variable"),c=(t=i?.match(/--[\w-]+/g))==null?void 0:t[0],h=_k(n,e,void 0,"value");return{name:c,variable:i,value:h}},Rm=(...e)=>_k(Wi.getTheme(),...e),_k=(e={},t,n,i)=>{if(t){let{variable:c,options:h}=Wi.defaults||{},{prefix:m,transform:a}=e?.options||h||{},y=Hf(t,gy)?t:`{${t}}`;return i==="value"||ad(i)&&a==="strict"?Wi.getTokenValue(t):X9(y,void 0,m,[c.excludedKeyRegex],n)}return""};function vT(e,...t){if(e instanceof Array){let n=e.reduce((i,c,h)=>{var m;return i+c+((m=kl(t[h],{dt:Rm}))!=null?m:"")},"");return Z9(n,Rm)}return kl(e,{dt:Rm})}function Ume(e,t={}){let n=Wi.defaults.variable,{prefix:i=n.prefix,selector:c=n.selector,excludedKeyRegex:h=n.excludedKeyRegex}=t,m=[],a=[],y=[{node:e,path:i}];for(;y.length;){let{node:C,path:P}=y.pop();for(let L in C){let D=C[L],V=Lme(D),U=Hf(L,h)?gk(P):gk(P,L9(L));if(nu(V))y.push({node:V,path:U});else{let W=q9(U),$=X9(V,U,i,[h]);Fme(a,W,$);let Y=U;i&&Y.startsWith(i+"-")&&(Y=Y.slice(i.length+1)),m.push(Y.replace(/-/g,"."))}}}let E=a.join("");return{value:a,tokens:m,declarations:E,css:z_(c,E)}}var Gc={regex:{rules:{class:{pattern:/^\.([a-zA-Z][\w-]*)$/,resolve(e){return{type:"class",selector:e,matched:this.pattern.test(e.trim())}}},attr:{pattern:/^\[(.*)\]$/,resolve(e){return{type:"attr",selector:`:root${e},:host${e}`,matched:this.pattern.test(e.trim())}}},media:{pattern:/^@media (.*)$/,resolve(e){return{type:"media",selector:e,matched:this.pattern.test(e.trim())}}},system:{pattern:/^system$/,resolve(e){return{type:"system",selector:"@media (prefers-color-scheme: dark)",matched:this.pattern.test(e.trim())}}},custom:{resolve(e){return{type:"custom",selector:e,matched:!0}}}},resolve(e){let t=Object.keys(this.rules).filter(n=>n!=="custom").map(n=>this.rules[n]);return[e].flat().map(n=>{var i;return(i=t.map(c=>c.resolve(n)).find(c=>c.matched))!=null?i:this.rules.custom.resolve(n)})}},_toVariables(e,t){return Ume(e,{prefix:t?.prefix})}
3882,getCommon({name:e="",theme:t={},params:n,set:i,defaults:c}){var h,m,a,y,E,C,P;let{preset:L,options:D}=t,V,U,W,$,Y,X,K;if(Qi(L)&&D.transform!=="strict"){let{primitive:ne,semantic:fe,extend:ye}=L,ke=fe||{},{colorScheme:Fe}=ke,qe=Xd(ke,["colorScheme"]),lt=ye||{},{colorScheme:pt}=lt,Qt=Xd(lt,["colorScheme"]),Ht=Fe||{},{dark:zt}=Ht,jt=Xd(Ht,["dark"]),Zt=pt||{},{dark:Wt}=Zt,en=Xd(Zt,["dark"]),sn=Qi(ne)?this._toVariables({primitive:ne},D):{},Mn=Qi(qe)?this._toVariables({semantic:qe},D):{},xn=Qi(jt)?this._toVariables({light:jt},D):{},Vn=Qi(zt)?this._toVariables({dark:zt},D):{},Ln=Qi(Qt)?this._toVariables({semantic:Qt},D):{},Yn=Qi(en)?this._toVariables({light:en},D):{},Rn=Qi(Wt)?this._toVariables({dark:Wt},D):{},[$t,fn]=[(h=sn.declarations)!=null?h:"",sn.tokens],[yn,Cn]=[(m=Mn.declarations)!=null?m:"",Mn.tokens||[]],[_n,Bn]=[(a=xn.declarations)!=null?a:"",xn.tokens||[]],[Be,Xe]=[(y=Vn.declarations)!=null?y:"",Vn.tokens||[]],[mt,kt]=[(E=Ln.declarations)!=null?E:"",Ln.tokens||[]],[Vt,Ie]=[(C=Yn.declarations)!=null?C:"",Yn.tokens||[]],[Ve,tt]=[(P=Rn.declarations)!=null?P:"",Rn.tokens||[]];V=this.transformCSS(e,$t,"light","variable",D,i,c),U=fn;let Rt=this.transformCSS(e,`${yn}${_n}`,"light","variable",D,i,c),Ut=this.transformCSS(e,`${Be}`,"dark","variable",D,i,c);W=`${Rt}${Ut}`,$=[...new Set([...Cn,...Bn,...Xe])];let nn=this.transformCSS(e,`${mt}${Vt}color-scheme:light`,"light","variable",D,i,c),st=this.transformCSS(e,`${Ve}color-scheme:dark`,"dark","variable",D,i,c);Y=`${nn}${st}`,X=[...new Set([...kt,...Ie,...tt])],K=kl(L.css,{dt:Rm})}return{primitive:{css:V,tokens:U},semantic:{css:W,tokens:$},global:{css:Y,tokens:X},style:K}},getPreset({name:e="",preset:t={},options:n,params:i,set:c,defaults:h,selector:m}){var a,y,E;let C,P,L;if(Qi(t)&&n.transform!=="strict"){let D=e.replace("-directive",""),V=t,{colorScheme:U,extend:W,css:$}=V,Y=Xd(V,["colorScheme","extend","css"]),X=W||{},{colorScheme:K}=X,ne=Xd(X,["colorScheme"]),fe=U||{},{dark:ye}=fe,ke=Xd(fe,["dark"]),Fe=K||{},{dark:qe}=Fe,lt=Xd(Fe,["dark"]),pt=Qi(Y)?this._toVariables({[D]:Xc(Xc({},Y),ne)},n):{},Qt=Qi(ke)?this._toVariables({[D]:Xc(Xc({},ke),lt)},n):{},Ht=Qi(ye)?this._toVariables({[D]:Xc(Xc({},ye),qe)},n):{},[zt,jt]=[(a=pt.declarations)!=null?a:"",pt.tokens||[]],[Zt,Wt]=[(y=Qt.declarations)!=null?y:"",Qt.tokens||[]],[en,sn]=[(E=Ht.declarations)!=null?E:"",Ht.tokens||[]],Mn=this.transformCSS(D,`${zt}${Zt}`,"light","variable",n,c,h,m),xn=this.transformCSS(D,en,"dark","variable",n,c,h,m);C=`${Mn}${xn}`,P=[...new Set([...jt,...Wt,...sn])],L=kl($,{dt:Rm})}return{css:C,tokens:P,style:L}},getPresetC({name:e="",theme:t={},params:n,set:i,defaults:c}){var h;let{preset:m,options:a}=t,y=(h=m?.components)==null?void 0:h[e];return this.getPreset({name:e,preset:y,options:a,params:n,set:i,defaults:c})},getPresetD({name:e="",theme:t={},params:n,set:i,defaults:c}){var h,m;let a=e.replace("-directive",""),{preset:y,options:E}=t,C=((h=y?.components)==null?void 0:h[a])||((m=y?.directives)==null?void 0:m[a]);return this.getPreset({name:a,preset:C,options:E,params:n,set:i,defaults:c})},applyDarkColorScheme(e){return!(e.darkModeSelector==="none"||e.darkModeSelector===!1)},getColorSchemeOption(e,t){var n;return this.applyDarkColorScheme(e)?this.regex.resolve(e.darkModeSelector===!0?t.options.darkModeSelector:(n=e.darkModeSelector)!=null?n:t.options.darkModeSelector):[]},getLayerOrder(e,t={},n,i){let{cssLayer:c}=t;return c?`@layer ${kl(c.order||c.name||"primeui",n)}`:""},getCommonStyleSheet({name:e="",theme:t={},params:n,props:i={},set:c,defaults:h}){let m=this.getCommon({name:e,theme:t,params:n,set:c,defaults:h}),a=Object.entries(i).reduce((y,[E,C])=>y.push(`${E}="${C}"`)&&y,[]).join(" ");return Object.entries(m||{}).reduce((y,[E,C])=>{if(nu(C)&&Object.hasOwn(C,"css")){let P=Nb(C.css),L=`${E}-variables`;y.push(`<style type="text/css" data-primevue-style-id="${L}" ${a}>${P}</style>`)}return y},[]).join("")},getStyleSheet({name:e="",theme:t={},params:n,props:i={},set:c,defaults:h}){var m;let a={name:e,theme:t,params:n,set:c,defaults:h},y=(m=e.includes("-directive")?this.getPresetD(a):this.getPresetC(a))==null?void 0:m.css,E=Object.entries(i).reduce((C,[P,L])=>C.push(`${P}="${L}"`)&&C,[]).join(" ");return y?`<style type="text/css" data-primevue-style-id="${e}-variables" ${E}>${Nb(y)}</style>`:""},createTokens(e={},t,n="",i="",c={}){let h=function(a,y={},E=[]){if(E.includes(this.path))return console.warn(`Circular reference detected at ${this.path}`),{colorScheme:a,path:this.path,paths:y,value:void 0};E.push(this.path),y.name=this.path,y.binding||(y.binding={});let C=this.value;if(typeof this.value=="string"&&gy.test(this.value)){let P=this.value.trim().replace(gy,L=>{var D;let V=L.slice(1,-1),U=this.tokens[V];if(!U)return console.warn(`Token not found for path: ${V}`),"__UNRESOLVED__";let W=U.computed(a,y,E);return Array.isArray(W)&&W.length===2?`light-dark(${W[0].value},${W[1].value})`:(D=W?.value)!=null?D:"__UNRESOLVED__"});C=H9.test(P.replace(W9,"0"))?`calc(${P})`:P}return ad(y.binding)&&delete y.binding,E.pop(),{colorScheme:a,path:this.path,paths:y,value:C.includes("__UNRESOLVED__")?void 0:C}},m=(a,y,E)=>
3882{Object.entries(a).forEach(([C,P])=>{let L=Hf(C,t.variable.excludedKeyRegex)?y:y?`${y}.${yN(C)}`:yN(C),D=E?`${E}.${C}`:C;nu(P)?m(P,L,D):(c[L]||(c[L]={paths:[],computed:(V,U={},W=[])=>{if(c[L].paths.length===1)return c[L].paths[0].computed(c[L].paths[0].scheme,U.binding,W);if(V&&V!=="none")for(let $=0;$<c[L].paths.length;$++){let Y=c[L].paths[$];if(Y.scheme===V)return Y.computed(V,U.binding,W)}return c[L].paths.map($=>$.computed($.scheme,U[$.scheme],W))}}),c[L].paths.push({path:D,value:P,scheme:D.includes("colorScheme.light")?"light":D.includes("colorScheme.dark")?"dark":"none",computed:h,tokens:c}))})};return m(e,n,i),c},getTokenValue(e,t,n){var i;let c=(a=>a.split(".").filter(y=>!Hf(y.toLowerCase(),n.variable.excludedKeyRegex)).join("."))(t),h=t.includes("colorScheme.light")?"light":t.includes("colorScheme.dark")?"dark":void 0,m=[(i=e[c])==null?void 0:i.computed(h)].flat().filter(a=>a);return m.length===1?m[0].value:m.reduce((a={},y)=>{let E=y,{colorScheme:C}=E,P=Xd(E,["colorScheme"]);return a[C]=P,a},void 0)},getSelectorRule(e,t,n,i){return n==="class"||n==="attr"?z_(Qi(t)?`${e}${t},${e} ${t}`:e,i):z_(e,z_(t??":root,:host",i))},transformCSS(e,t,n,i,c={},h,m,a){if(Qi(t)){let{cssLayer:y}=c;if(i!=="style"){let E=this.getColorSchemeOption(c,m);t=n==="dark"?E.reduce((C,{type:P,selector:L})=>(Qi(L)&&(C+=L.includes("[CSS]")?L.replace("[CSS]",t):this.getSelectorRule(L,a,P,t)),C),""):z_(a??":root,:host",t)}if(y){let E={name:"primeui"};nu(y)&&(E.name=kl(y.name,{name:e,type:i})),Qi(E.name)&&(t=z_(`@layer ${E.name}`,t),h?.layerNames(E.name))}return t}return""}},Wi={defaults:{variable:{prefix:"p",selector:":root,:host",excludedKeyRegex:/^(primitive|semantic|components|directives|variables|colorscheme|light|dark|common|root|states|extend|css)$/gi},options:{prefix:"p",darkModeSelector:"system",cssLayer:!1}},_theme:void 0,_layerNames:new Set,_loadedStyleNames:new Set,_loadingStyles:new Set,_tokens:{},update(e={}){let{theme:t}=e;t&&(this._theme=hP(Xc({},t),{options:Xc(Xc({},this.defaults.options),t.options)}),this._tokens=Gc.createTokens(this.preset,this.defaults),this.clearLoadedStyleNames())},get theme(){return this._theme},get preset(){var e;return((e=this.theme)==null?void 0:e.preset)||{}},get options(){var e;return((e=this.theme)==null?void 0:e.options)||{}},get tokens(){return this._tokens},getTheme(){return this.theme},setTheme(e){this.update({theme:e}),js.emit("theme:change",e)},getPreset(){return this.preset},setPreset(e){this._theme=hP(Xc({},this.theme),{preset:e}),this._tokens=Gc.createTokens(e,this.defaults),this.clearLoadedStyleNames(),js.emit("preset:change",e),js.emit("theme:change",this.theme)},getOptions(){return this.options},setOptions(e){this._theme=hP(Xc({},this.theme),{options:e}),this.clearLoadedStyleNames(),js.emit("options:change",e),js.emit("theme:change",this.theme)},getLayerNames(){return[...this._layerNames]},setLayerNames(e){this._layerNames.add(e)},getLoadedStyleNames(){return this._loadedStyleNames},isStyleNameLoaded(e){return this._loadedStyleNames.has(e)},setLoadedStyleName(e){this._loadedStyleNames.add(e)},deleteLoadedStyleName(e){this._loadedStyleNames.delete(e)},clearLoadedStyleNames(){this._loadedStyleNames.clear()},getTokenValue(e){return Gc.getTokenValue(this.tokens,e,this.defaults)},getCommon(e="",t){return Gc.getCommon({name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getComponent(e="",t){let n={name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return Gc.getPresetC(n)},getDirective(e="",t){let n={name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return Gc.getPresetD(n)},getCustomPreset(e="",t,n,i){let c={name:e,preset:t,options:this.options,selector:n,params:i,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return Gc.getPreset(c)},getLayerOrderCSS(e=""){return Gc.getLayerOrder(e,this.options,{names:this.getLayerNames()},this.defaults)},transformCSS(e="",t,n="style",i){return Gc.transformCSS(e,t,i,n,this.options,{layerNames:this.setLayerNames.bind(this)},this.defaults)},getCommonStyleSheet(e="",t,n={}){return Gc.getCommonStyleSheet({name:e,theme:this.theme,params:t,props:n,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getStyleSheet(e,t,n={}){return Gc.getStyleSheet({name:e,theme:this.theme,params:t,props:n,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},onStyleMounted(e){this._loadingStyles.add(e)},onStyleUpdated(e){this._loadingStyles.add(e)},onStyleLoaded(e,{name:t}){this._loadingStyles.size&&(this._loadingStyles.delete(t),js.emit(`theme:${t}:load`,e),!this._loadingStyles.size&&js.emit("theme:load"))}},ua={STARTS_WITH:"startsWith",CONTAINS:"contains",NOT_CONTAINS:"notContains",ENDS_WITH:"endsWith",EQUALS:"equals",NOT_EQUALS:"notEquals",IN:"in",LESS_THAN:"lt",LESS_THAN_OR_EQUAL_TO:"lte",GREATER_THAN:"gt",GREATER_THAN_OR_EQUAL_TO:"gte",DATE_IS:"dateIs",DATE_IS_NOT:"dateIsNot",DATE_BEFORE:"dateBefore",DATE_AFTER:"dateAfter"},eDe={AND:"and",OR:"or"};function wN(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];
3882if(!n){if(Array.isArray(e)||(n=$me(e))||t){n&&(e=n);var i=0,c=function(){};return{s:c,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(E){throw E},f:c}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 3883In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var h,m=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var E=n.next();return m=E.done,E},e:function(E){a=!0,h=E},f:function(){try{m||n.return==null||n.return()}finally{if(a)throw h}}}}function $me(e,t){if(e){if(typeof e=="string")return SN(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?SN(e,t):void 0}}function SN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}var tDe={filter:function(t,n,i,c,h){var m=[];if(!t)return m;var a=wN(t),y;try{for(a.s();!(y=a.n()).done;){var E=y.value;if(typeof E=="string"){if(this.filters[c](E,i,h)){m.push(E);continue}}else{var C=wN(n),P;try{for(C.s();!(P=C.n()).done;){var L=P.value,D=hk(E,L);if(this.filters[c](D,i,h)){m.push(E);break}}}catch(V){C.e(V)}finally{C.f()}}}}catch(V){a.e(V)}finally{a.f()}return m},filters:{startsWith:function(t,n,i){if(n==null||n==="")return!0;if(t==null)return!1;var c=lc(n.toString()).toLocaleLowerCase(i),h=lc(t.toString()).toLocaleLowerCase(i);return h.slice(0,c.length)===c},contains:function(t,n,i){if(n==null||n==="")return!0;if(t==null)return!1;var c=lc(n.toString()).toLocaleLowerCase(i),h=lc(t.toString()).toLocaleLowerCase(i);return h.indexOf(c)!==-1},notContains:function(t,n,i){if(n==null||n==="")return!0;if(t==null)return!1;var c=lc(n.toString()).toLocaleLowerCase(i),h=lc(t.toString()).toLocaleLowerCase(i);return h.indexOf(c)===-1},endsWith:function(t,n,i){if(n==null||n==="")return!0;if(t==null)return!1;var c=lc(n.toString()).toLocaleLowerCase(i),h=lc(t.toString()).toLocaleLowerCase(i);return h.indexOf(c,h.length-c.length)!==-1},equals:function(t,n,i){return n==null||n===""?!0:t==null?!1:t.getTime&&n.getTime?t.getTime()===n.getTime():lc(t.toString()).toLocaleLowerCase(i)==lc(n.toString()).toLocaleLowerCase(i)},notEquals:function(t,n,i){return n==null||n===""?!1:t==null?!0:t.getTime&&n.getTime?t.getTime()!==n.getTime():lc(t.toString()).toLocaleLowerCase(i)!=lc(n.toString()).toLocaleLowerCase(i)},in:function(t,n){if(n==null||n.length===0)return!0;for(var i=0;i<n.length;i++)if(P9(t,n[i]))return!0;return!1},between:function(t,n){return n==null||n[0]==null||n[1]==null?!0:t==null?!1:t.getTime?n[0].getTime()<=t.getTime()&&t.getTime()<=n[1].getTime():n[0]<=t&&t<=n[1]},lt:function(t,n){return n==null?!0:t==null?!1:t.getTime&&n.getTime?t.getTime()<n.getTime():t<n},lte:function(t,n){return n==null?!0:t==null?!1:t.getTime&&n.getTime?t.getTime()<=n.getTime():t<=n},gt:function(t,n){return n==null?!0:t==null?!1:t.getTime&&n.getTime?t.getTime()>n.getTime():t>n},gte:function(t,n){return n==null?!0:t==null?!1:t.getTime&&n.getTime?t.getTime()>=n.getTime():t>=n},dateIs:function(t,n){return n==null?!0:t==null?!1:(typeof t=="string"&&(t=new Date(t)),typeof n=="string"&&(n=new Date(n)),t.toDateString()===n.toDateString())},dateIsNot:function(t,n){return n==null?!0:t==null?!1:(typeof t=="string"&&(t=new Date(t)),typeof n=="string"&&(n=new Date(n)),t.toDateString()!==n.toDateString())},dateBefore:function(t,n){return n==null?!0:t==null?!1:(typeof t=="string"&&(t=new Date(t)),typeof n=="string"&&(n=new Date(n)),t.getTime()<n.getTime())},dateAfter:function(t,n){return n==null?!0:t==null?!1:(typeof t=="string"&&(t=new Date(t)),typeof n=="string"&&(n=new Date(n)),t.getTime()>n.getTime())}},register:function(t,n){this.filters[t]=n}},jme=` 3884 *, 3885 ::before, 3886 ::after { 3887 box-sizing: border-box; 3888 } 3889 3890 .p-collapsible-enter-active { 3891 animation: p-animate-collapsible-expand 0.2s ease-out; 3892 overflow: hidden; 3893 } 3894 3895 .p-collapsible-leave-active { 3896 animation: p-animate-collapsible-collapse 0.2s ease-out; 3897 overflow: hidden; 3898 } 3899
3900 @keyframes p-animate-collapsible-expand { 3901 from { 3902 grid-template-rows: 0fr; 3903 } 3904 to { 3905 grid-template-rows: 1fr; 3906 } 3907 } 3908 3909 @keyframes p-animate-collapsible-collapse { 3910 from { 3911 grid-template-rows: 1fr; 3912 } 3913 to { 3914 grid-template-rows: 0fr; 3915 } 3916 } 3917 3918 .p-disabled, 3919 .p-disabled * { 3920 cursor: default; 3921 pointer-events: none; 3922 user-select: none; 3923 } 3924 3925 .p-disabled, 3926 .p-component:disabled { 3927 opacity: dt('disabled.opacity'); 3928 } 3929 3930 .pi { 3931 font-size: dt('icon.size'); 3932 } 3933 3934 .p-icon { 3935 width: dt('icon.size'); 3936 height: dt('icon.size'); 3937 } 3938 3939 .p-overlay-mask { 3940 background: var(--px-mask-background, dt('mask.background')); 3941 color: dt('mask.color'); 3942 position: fixed; 3943 top: 0; 3944 left: 0; 3945 width: 100%; 3946 height: 100%; 3947 } 3948 3949 .p-overlay-mask-enter-active { 3950 animation: p-animate-overlay-mask-enter dt('mask.transition.duration') forwards; 3951 } 3952 3953 .p-overlay-mask-leave-active { 3954 animation: p-animate-overlay-mask-leave dt('mask.transition.duration') forwards; 3955 } 3956 3957 @keyframes p-animate-overlay-mask-enter { 3958 from { 3959 background: transparent; 3960 } 3961 to { 3962 background: var(--px-mask-background, dt('mask.background')); 3963 } 3964 } 3965 @keyframes p-animate-overlay-mask-leave { 3966 from { 3967 background: var(--px-mask-background, dt('mask.background')); 3968 } 3969 to { 3970 background: transparent; 3971 } 3972 } 3973 3974 .p-anchored-overlay-enter-active { 3975 animation: p-animate-anchored-overlay-enter 300ms cubic-bezier(.19,1,.22,1); 3976 } 3977 3978 .p-anchored-overlay-leave-active { 3979 animation: p-animate-anchored-overlay-leave 300ms cubic-bezier(.19,1,.22,1); 3980 } 3981 3982 @keyframes p-animate-anchored-overlay-enter { 3983 from { 3984 opacity: 0; 3985 transform: scale(0.93); 3986 } 3987 } 3988 3989 @keyframes p-animate-anchored-overlay-leave { 3990 to { 3991 opacity: 0; 3992 transform: scale(0.93); 3993 } 3994 } 3995`;function ix(e){"@babel/helpers - typeof";return ix=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ix(e)}function TN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(c){return Object.getOwnPropertyDescriptor(e,c).enumerable})),n.push.apply(n,i)}return n}function EN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TN(Object(n),!0).forEach(function(i){Gme(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TN(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Gme(e,t,n){return(t=Hme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hme(e){var t=Wme(e,"string");return ix(t)=="symbol"?t:t+""}function Wme(e,t){if(ix(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t);if(ix(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qme(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;Ds()&&Ds().components?cu(e):t?e():ts(e)}var Xme=0;function Zme(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=hn(!1),i=hn(e),c=hn(null),h=U9()?window.document:void 0,m=t.document,a=m===void 0?h:m,y=t.immediate,E=y===void 0?!0:y,C=t.manual,P=C===void 0?!1:C,L=t.name,D=L===void 0?"style_".concat(++Xme):L,V=t.id,U=V===void 0?void 0:V,W=t.media,$=W===void 0?void 0:W,Y=t.nonce,X=Y===void 0?void 0:Y,K=t.first,ne=K===void 0?!1:K,fe=t.onMounted,ye=fe===void 0?void 0:fe,ke=t.onUpdated,Fe=ke===void 0?void 0:ke,qe=t.onLoad,lt=qe===void 0?void 0:qe,pt=t.props,Qt=pt===void 0?{}:pt,Ht=function(){},zt=function(Wt){var en=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(a){var sn=EN(EN({},Qt),en),Mn=sn.name||D,xn=sn.id||U,Vn=sn.nonce||X;c.value=a.querySelector('style[data-primevue-style-id="'.concat(Mn,'"]'))||a.getElementById(xn)||a.createElement("style"),c.value.isConnected||(i.value=Wt||e,UE(c.value,{type:"text/css",id:xn,media:$,nonce:Vn}),ne?a.head.prepend(c.value):a.head.appendChild(c.value),$9(c.value,"data-
3995primevue-style-id",Mn),UE(c.value,sn),c.value.onload=function(Ln){return lt?.(Ln,{name:Mn})},ye?.(Mn)),!n.value&&(Ht=qr(i,function(Ln){c.value.textContent=Ln,Fe?.(Mn)},{immediate:!0}),n.value=!0)}},jt=function(){!a||!n.value||(Ht(),xme(c.value)&&a.head.removeChild(c.value),n.value=!1,c.value=null)};return E&&!P&&qme(zt),{id:U,name:D,el:c,css:i,unload:jt,load:zt,isLoaded:ny(n)}}function ox(e){"@babel/helpers - typeof";return ox=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ox(e)}var CN,AN,IN,PN;function RN(e,t){return Qme(e)||Jme(e,t)||Kme(e,t)||Yme()}function Yme(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 3996In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kme(e,t){if(e){if(typeof e=="string")return kN(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kN(e,t):void 0}}function kN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function Jme(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var i,c,h,m,a=[],y=!0,E=!1;try{if(h=(n=n.call(e)).next,t!==0)for(;!(y=(i=h.call(n)).done)&&(a.push(i.value),a.length!==t);y=!0);}catch(C){E=!0,c=C}finally{try{if(!y&&n.return!=null&&(m=n.return(),Object(m)!==m))return}finally{if(E)throw c}}return a}}function Qme(e){if(Array.isArray(e))return e}function MN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(c){return Object.getOwnPropertyDescriptor(e,c).enumerable})),n.push.apply(n,i)}return n}function fP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MN(Object(n),!0).forEach(function(i){ege(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MN(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function ege(e,t,n){return(t=tge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tge(e){var t=nge(e,"string");return ox(t)=="symbol"?t:t+""}function nge(e,t){if(ox(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t);if(ox(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bT(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var rge=function(t){var n=t.dt;return` 3997.p-hidden-accessible { 3998 border: 0; 3999 clip: rect(0 0 0 0); 4000 height: 1px; 4001 margin: -1px; 4002 opacity: 0; 4003 overflow: hidden; 4004 padding: 0; 4005 pointer-events: none; 4006 position: absolute; 4007 white-space: nowrap; 4008 width: 1px; 4009} 4010 4011.p-overflow-hidden { 4012 overflow: hidden; 4013 padding-right: `.concat(n("scrollbar.width"),`; 4014} 4015`)},ige={},oge={},Vo={name:"base",css:rge,style:jme,classes:ige,inlineStyles:oge,load:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(h){return h},c=i(vT(CN||(CN=bT(["",""])),t));return Qi(c)?Zme(Nb(c),fP({name:this.name},n)):{}},loadCSS:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.load(this.css,t)},loadStyle:function(){var t=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return this.load(this.style,n,function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return Wi.transformCSS(n.name||t.name,"".concat(c).concat(vT(AN||(AN=bT(["",""])),i)))})},getCommonTheme:function(t){return Wi.getCommon(this.name,t)},getComponentTheme:function(t){return Wi.getComponent(this.name,t)},getDirectiveTheme:function(t){return Wi.getDirective(this.name,t)},getPresetTheme:function(t,n,i){return Wi.getCustomPreset(this.name,t,n,i)},getLayerOrderThemeCSS:function(){return Wi.getLayerOrderCSS(this.name)},getStyleSheet:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.css){var i=kl(this.css,{dt:Rm})||"",c=Nb(vT(IN||(IN=bT(["","",""])),i,t)),h=Object.entries(n).reduce(function(m,a){var y=RN(a,2),E=y[0],C=y[1];return m.push("".concat(E,'="').concat(C,'"'))&&m},[]).join(" ");return Qi(c)?'<style type="text/css" data-primevue-style-id="'.concat(this.name,'" ').concat(h,">").concat(c,"</style>"):""}return""},getCommonThemeStyleSheet:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Wi.getCommonStyleSheet(this.name,t,n)},getThemeStyleSheet:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=[Wi.getStyleSheet(this.name,t,n)];if(this.style){var c=this.name==="base"?"global-style":"".concat(this.name,"-style"),h=vT(PN||(PN=bT(["",""])),kl(this.style,{dt:Rm})),m=Nb(Wi.transformCSS(c,h)),a=Object.entries(n).reduce(function(y,E){var C=RN(E,2),P=C[0],L=C[1];return y.push("".concat(P,'="').concat(L,'"'))&&y},[]).join(" ");Qi(m)&&i.push('<style type="text/css" data-primevue-style-id="'.concat(c,'" ').concat(a,">").concat(m,"</style>"))}return i.join("")},extend:function(t){return fP(fP({},this),{},{css:void 0,style:void 0},t)}},Df=Zx();function sx(e){"@babel/helpers - typeof";return sx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sx(e)}function LN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(c){return Object.getOwnPropertyDescriptor(e,c).enumerable})),n.push.apply(n,i)}return n}function xT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};
4015t%2?LN(Object(n),!0).forEach(function(i){sge(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LN(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function sge(e,t,n){return(t=age(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function age(e){var t=lge(e,"string");return sx(t)=="symbol"?t:t+""}function lge(e,t){if(sx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t);if(sx(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var cge={ripple:!1,inputStyle:null,inputVariant:null,locale:{startsWith:"Starts with",contains:"Contains",notContains:"Not contains",endsWith:"Ends with",equals:"Equals",notEquals:"Not equals",noFilter:"No Filter",lt:"Less than",lte:"Less than or equal to",gt:"Greater than",gte:"Greater than or equal to",dateIs:"Date is",dateIsNot:"Date is not",dateBefore:"Date is before",dateAfter:"Date is after",clear:"Clear",apply:"Apply",matchAll:"Match All",matchAny:"Match Any",addRule:"Add Rule",removeRule:"Remove Rule",accept:"Yes",reject:"No",choose:"Choose",upload:"Upload",cancel:"Cancel",completed:"Completed",pending:"Pending",fileSizeTypes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],chooseYear:"Choose Year",chooseMonth:"Choose Month",chooseDate:"Choose Date",prevDecade:"Previous Decade",nextDecade:"Next Decade",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",prevHour:"Previous Hour",nextHour:"Next Hour",prevMinute:"Previous Minute",nextMinute:"Next Minute",prevSecond:"Previous Second",nextSecond:"Next Second",am:"am",pm:"pm",today:"Today",weekHeader:"Wk",firstDayOfWeek:0,showMonthAfterYear:!1,dateFormat:"mm/dd/yy",weak:"Weak",medium:"Medium",strong:"Strong",passwordPrompt:"Enter a password",emptyFilterMessage:"No results found",searchMessage:"{0} results are available",selectionMessage:"{0} items selected",emptySelectionMessage:"No selected item",emptySearchMessage:"No results found",fileChosenMessage:"{0} files",noFileChosenMessage:"No file chosen",emptyMessage:"No available options",aria:{trueLabel:"True",falseLabel:"False",nullLabel:"Not Selected",star:"1 star",stars:"{star} stars",selectAll:"All items selected",unselectAll:"All items unselected",close:"Close",previous:"Previous",next:"Next",navigation:"Navigation",scrollTop:"Scroll Top",moveTop:"Move Top",moveUp:"Move Up",moveDown:"Move Down",moveBottom:"Move Bottom",moveToTarget:"Move to Target",moveToSource:"Move to Source",moveAllToTarget:"Move All to Target",moveAllToSource:"Move All to Source",pageLabel:"Page {page}",firstPageLabel:"First Page",lastPageLabel:"Last Page",nextPageLabel:"Next Page",prevPageLabel:"Previous Page",rowsPerPageLabel:"Rows per page",jumpToPageDropdownLabel:"Jump to Page Dropdown",jumpToPageInputLabel:"Jump to Page Input",selectRow:"Row Selected",unselectRow:"Row Unselected",expandRow:"Row Expanded",collapseRow:"Row Collapsed",showFilterMenu:"Show Filter Menu",hideFilterMenu:"Hide Filter Menu",filterOperator:"Filter Operator",filterConstraint:"Filter Constraint",editRow:"Row Edit",saveEdit:"Save Edit",cancelEdit:"Cancel Edit",listView:"List View",gridView:"Grid View",slide:"Slide",slideNumber:"{slideNumber}",zoomImage:"Zoom Image",zoomIn:"Zoom In",zoomOut:"Zoom Out",rotateRight:"Rotate Right",rotateLeft:"Rotate Left",listLabel:"Option List"}},filterMatchModeOptions:{text:[ua.STARTS_WITH,ua.CONTAINS,ua.NOT_CONTAINS,ua.ENDS_WITH,ua.EQUALS,ua.NOT_EQUALS],numeric:[ua.EQUALS,ua.NOT_EQUALS,ua.LESS_THAN,ua.LESS_THAN_OR_EQUAL_TO,ua.GREATER_THAN,ua.GREATER_THAN_OR_EQUAL_TO],date:[ua.DATE_IS,ua.DATE_IS_NOT,ua.DATE_BEFORE,ua.DATE_AFTER]},zIndex:{modal:1100,overlay:1e3,menu:1e3,tooltip:1100},theme:void 0,unstyled:!1,pt:void 0,ptOptions:{mergeSections:!0,mergeProps:!1},csp:{nonce:void 0}},uge=Symbol();function dge(e,t){var n={config:Fl(t)};return e.config.globalProperties.$primevue=n,e.provide(uge,n),hge(),fge(e,n),n}var j_=[];function hge(){js.clear(),j_.forEach(function(e){return e?.()}),j_=[]}
4015function fge(e,t){var n=hn(!1),i=function(){var E;if(((E=t.config)===null||E===void 0?void 0:E.theme)!=="none"&&!Wi.isStyleNameLoaded("common")){var C,P,L=((C=Vo.getCommonTheme)===null||C===void 0?void 0:C.call(Vo))||{},D=L.primitive,V=L.semantic,U=L.global,W=L.style,$={nonce:(P=t.config)===null||P===void 0||(P=P.csp)===null||P===void 0?void 0:P.nonce};Vo.load(D?.css,xT({name:"primitive-variables"},$)),Vo.load(V?.css,xT({name:"semantic-variables"},$)),Vo.load(U?.css,xT({name:"global-variables"},$)),Vo.loadStyle(xT({name:"global-style"},$),W),Wi.setLoadedStyleName("common")}};js.on("theme:change",function(y){n.value||(e.config.globalProperties.$primevue.config.theme=y,n.value=!0)});var c=qr(t.config,function(y,E){Df.emit("config:change",{newValue:y,oldValue:E})},{immediate:!0,deep:!0}),h=qr(function(){return t.config.ripple},function(y,E){Df.emit("config:ripple:change",{newValue:y,oldValue:E})},{immediate:!0,deep:!0}),m=qr(function(){return t.config.theme},function(y,E){n.value||Wi.setTheme(y),t.config.unstyled||i(),n.value=!1,Df.emit("config:theme:change",{newValue:y,oldValue:E})},{immediate:!0,deep:!1}),a=qr(function(){return t.config.unstyled},function(y,E){!y&&t.config.theme&&i(),Df.emit("config:unstyled:change",{newValue:y,oldValue:E})},{immediate:!0,deep:!0});j_.push(c),j_.push(h),j_.push(m),j_.push(a)}var pge={install:function(t,n){var i=hme(cge,n);dge(t,i)}},ON=Zx(),mge=Symbol(),gge={install:function(t){var n={require:function(c){ON.emit("confirm",c)},close:function(){ON.emit("close")}};t.config.globalProperties.$confirm=n,t.provide(mge,n)}},DN=Zx(),_ge=Symbol(),yge={install:function(t){var n={open:function(c,h){var m={content:c&&Ax(c),options:h||{},data:h&&h.data,close:function(y){DN.emit("close",{instance:m,params:y})}};return DN.emit("open",{instance:m}),m}};t.config.globalProperties.$dialog=n,t.provide(_ge,n)}},hc=Zx(),vge={install:function(t){var n={add:function(c){hc.emit("add",c)},remove:function(c){hc.emit("remove",c)},removeGroup:function(c){hc.emit("remove-group",c)},removeAllGroups:function(){hc.emit("remove-all-groups")}};t.config.globalProperties.$toast=n,t.provide(N6,n)}},bge=(...e)=>kme(...e),xge={transitionDuration:"{transition.duration}"},wge={borderWidth:"0 0 1px 0",borderColor:"{content.border.color}"},Sge={color:"{text.muted.color}",hoverColor:"{text.color}",activeColor:"{text.color}",activeHoverColor:"{text.color}",padding:"1.125rem",fontWeight:"600",borderRadius:"0",borderWidth:"0",borderColor:"{content.border.color}",background:"{content.background}",hoverBackground:"{content.background}",activeBackground:"{content.background}",activeHoverBackground:"{content.background}",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"-1px",shadow:"{focus.ring.shadow}"},toggleIcon:{color:"{text.muted.color}",hoverColor:"{text.color}",activeColor:"{text.color}",activeHoverColor:"{text.color}"},first:{topBorderRadius:"{content.border.radius}",borderWidth:"0"},last:{bottomBorderRadius:"{content.border.radius}",activeBottomBorderRadius:"0"}},Tge={borderWidth:"0",borderColor:"{content.border.color}",background:"{content.background}",color:"{text.color}",padding:"0 1.125rem 1.125rem 1.125rem"},Ege={root:xge,panel:wge,header:Sge,content:Tge},Cge={background:"{form.field.background}",disabledBackground:"{form.field.disabled.background}",filledBackground:"{form.field.filled.background}",filledHoverBackground:"{form.field.filled.hover.background}",filledFocusBackground:"{form.field.filled.focus.background}",borderColor:"{form.field.border.color}",hoverBorderColor:"{form.field.hover.border.color}",focusBorderColor:"{form.field.focus.border.color}",invalidBorderColor:"{form.field.invalid.border.color}",color:"{form.field.color}",disabledColor:"{form.field.disabled.color}",placeholderColor:"{form.field.placeholder.color}",invalidPlaceholderColor:"{form.field.invalid.placeholder.color}",shadow:"{form.field.shadow}",paddingX:"{form.field.padding.x}",paddingY:"{form.field.padding.y}",borderRadius:"{form.field.border.radius}",focusRing:{width:"{form.field.focus.ring.width}",style:"{form.field.focus.ring.style}",color:"{form.field.focus.ring.color}",offset:"{form.field.focus.ring.offset}",shadow:"{form.field.focus.ring.shadow}"},transitionDuration:"{form.field.transition.duration}"},Age={background:"{overlay.select.background}",borderColor:"{overlay.select.border.color}
4015",borderRadius:"{overlay.select.border.radius}",color:"{overlay.select.color}",shadow:"{overlay.select.shadow}"},Ige={padding:"{list.padding}",gap:"{list.gap}"},Pge={focusBackground:"{list.option.focus.background}",selectedBackground:"{list.option.selected.background}",selectedFocusBackground:"{list.option.selected.focus.background}",color:"{list.option.color}",focusColor:"{list.option.focus.color}",selectedColor:"{list.option.selected.color}",selectedFocusColor:"{list.option.selected.focus.color}",padding:"{list.option.padding}",borderRadius:"{list.option.border.radius}"},Rge={background:"{list.option.group.background}",color:"{list.option.group.color}",fontWeight:"{list.option.group.font.weight}",padding:"{list.option.group.padding}"},kge={width:"2.5rem",sm:{width:"2rem"},lg:{width:"3rem"},borderColor:"{form.field.border.color}",hoverBorderColor:"{form.field.border.color}",activeBorderColor:"{form.field.border.color}",borderRadius:"{form.field.border.radius}",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"}},Mge={borderRadius:"{border.radius.sm}"},Lge={padding:"{list.option.padding}"},Oge={light:{chip:{focusBackground:"{surface.200}",focusColor:"{surface.800}"},dropdown:{background:"{surface.100}",hoverBackground:"{surface.200}",activeBackground:"{surface.300}",color:"{surface.600}",hoverColor:"{surface.700}",activeColor:"{surface.800}"}},dark:{chip:{focusBackground:"{surface.700}",focusColor:"{surface.0}"},dropdown:{background:"{surface.800}",hoverBackground:"{surface.700}",activeBackground:"{surface.600}",color:"{surface.300}",hoverColor:"{surface.200}",activeColor:"{surface.100}"}}},Dge={root:Cge,overlay:Age,list:Ige,option:Pge,optionGroup:Rge,dropdown:kge,chip:Mge,emptyMessage:Lge,colorScheme:Oge},Fge={width:"2rem",height:"2rem",fontSize:"1rem",background:"{content.border.color}",color:"{content.color}",borderRadius:"{content.border.radius}"},Bge={size:"1rem"},zge={borderColor:"{content.background}",offset:"-0.75rem"},Nge={width:"3rem",height:"3rem",fontSize:"1.5rem",icon:{size:"1.5rem"},group:{offset:"-1rem"}},Vge={width:"4rem",height:"4rem",fontSize:"2rem",icon:{size:"2rem"},group:{offset:"-1.5rem"}},Uge={root:Fge,icon:Bge,group:zge,lg:Nge,xl:Vge},$ge={borderRadius:"{border.radius.md}",padding:"0 0.5rem",fontSize:"0.75rem",fontWeight:"700",minWidth:"1.5rem",height:"1.5rem"},jge={size:"0.5rem"},Gge={fontSize:"0.625rem",minWidth:"1.25rem",height:"1.25rem"},Hge={fontSize:"0.875rem",minWidth:"1.75rem",height:"1.75rem"},Wge={fontSize:"1rem",minWidth:"2rem",height:"2rem"},qge={light:{primary:{background:"{primary.color}",color:"{primary.contrast.color}"},secondary:{background:"{surface.100}",color:"{surface.600}"},success:{background:"{green.500}",color:"{surface.0}"},info:{background:"{sky.500}",color:"{surface.0}"},warn:{background:"{orange.500}",color:"{surface.0}"},danger:{background:"{red.500}",color:"{surface.0}"},contrast:{background:"{surface.950}",color:"{surface.0}"}},dark:{primary:{background:"{primary.color}",color:"{primary.contrast.color}"},secondary:{background:"{surface.800}",color:"{surface.300}"},success:{background:"{green.400}",color:"{green.950}"},info:{background:"{sky.400}",color:"{sky.950}"},warn:{background:"{orange.400}",color:"{orange.950}"},danger:{background:"{red.400}",color:"{red.950}"},contrast:{background:"{surface.0}",color:"{surface.950}"}}},Xge={root:$ge,dot:jge,sm:Gge,lg:Hge,xl:Wge,colorScheme:qge},Zge={borderRadius:{none:"0",xs:"2px",sm:"4px",md:"6px",lg:"8px",xl:"12px"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"}},Yge={transitionDuration:"0.2s",focusRing:{width:"1px",style:"solid",color:"{primary.color}",offset:"2px",shadow:"none"},disabledOpacity:"0.6",iconSize:"1rem",anchorGutter:"2px",primary:{50:"{emerald.50}",100:"{emerald.100}",200:"{emerald.200}",300:"{emerald.300}",400:"{emerald.400}",500:"{emerald.500}",600:"{emerald.600}",700:"{emerald.700}",800:"{emerald.800}",900:"{emerald.900}",950:"{emerald.950}"},formField:{paddingX:"0.75rem",paddingY:"0.5rem",sm:{fontSize:"0.875rem",paddingX:"0.625rem",paddingY:"0.375rem"},lg:{fontSize:"1.125rem",paddingX:"0.875rem",paddingY:"0.625rem"}
4015,borderRadius:"{border.radius.md}",focusRing:{width:"0",style:"none",color:"transparent",offset:"0",shadow:"none"},transitionDuration:"{transition.duration}"},list:{padding:"0.25rem 0.25rem",gap:"2px",header:{padding:"0.5rem 1rem 0.25rem 1rem"},option:{padding:"0.5rem 0.75rem",borderRadius:"{border.radius.sm}"},optionGroup:{padding:"0.5rem 0.75rem",fontWeight:"600"}},content:{borderRadius:"{border.radius.md}"},mask:{transitionDuration:"0.3s"},navigation:{list:{padding:"0.25rem 0.25rem",gap:"2px"},item:{padding:"0.5rem 0.75rem",borderRadius:"{border.radius.sm}",gap:"0.5rem"},submenuLabel:{padding:"0.5rem 0.75rem",fontWeight:"600"},submenuIcon:{size:"0.875rem"}},overlay:{select:{borderRadius:"{border.radius.md}",shadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)"},popover:{borderRadius:"{border.radius.md}",padding:"0.75rem",shadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)"},modal:{borderRadius:"{border.radius.xl}",padding:"1.25rem",shadow:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)"},navigation:{shadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)"}},colorScheme:{light:{surface:{0:"#ffffff",50:"{slate.50}",100:"{slate.100}",200:"{slate.200}",300:"{slate.300}",400:"{slate.400}",500:"{slate.500}",600:"{slate.600}",700:"{slate.700}",800:"{slate.800}",900:"{slate.900}",950:"{slate.950}"},primary:{color:"{primary.500}",contrastColor:"#ffffff",hoverColor:"{primary.600}",activeColor:"{primary.700}
4015"},highlight:{background:"{primary.50}",focusBackground:"{primary.100}",color:"{primary.700}",focusColor:"{primary.800}"},mask:{background:"rgba(0,0,0,0.4)",color:"{surface.200}"},formField:{background:"{surface.0}",disabledBackground:"{surface.200}",filledBackground:"{surface.50}",filledHoverBackground:"{surface.50}",filledFocusBackground:"{surface.50}",borderColor:"{surface.300}",hoverBorderColor:"{surface.400}",focusBorderColor:"{primary.color}",invalidBorderColor:"{red.400}",color:"{surface.700}",disabledColor:"{surface.500}",placeholderColor:"{surface.500}",invalidPlaceholderColor:"{red.600}",floatLabelColor:"{surface.500}",floatLabelFocusColor:"{primary.600}",floatLabelActiveColor:"{surface.500}",floatLabelInvalidColor:"{form.field.invalid.placeholder.color}",iconColor:"{surface.400}",shadow:"0 0 #0000, 0 0 #0000, 0 1px 2px 0 rgba(18, 18, 23, 0.05)"},text:{color:"{surface.700}",hoverColor:"{surface.800}",mutedColor:"{surface.500}",hoverMutedColor:"{surface.600}"},content:{background:"{surface.0}",hoverBackground:"{surface.100}",borderColor:"{surface.200}",color:"{text.color}",hoverColor:"{text.hover.color}"},overlay:{select:{background:"{surface.0}",borderColor:"{surface.200}",color:"{text.color}"},popover:{background:"{surface.0}",borderColor:"{surface.200}",color:"{text.color}"},modal:{background:"{surface.0}",borderColor:"{surface.200}",color:"{text.color}"}},list:{option:{focusBackground:"{surface.100}",selectedBackground:"{highlight.background}",selectedFocusBackground:"{highlight.focus.background}",color:"{text.color}",focusColor:"{text.hover.color}",selectedColor:"{highlight.color}",selectedFocusColor:"{highlight.focus.color}",icon:{color:"{surface.400}",focusColor:"{surface.500}"}},optionGroup:{background:"transparent",color:"{text.muted.color}"}},navigation:{item:{focusBackground:"{surface.100}",activeBackground:"{surface.100}",color:"{text.color}",focusColor:"{text.hover.color}",activeColor:"{text.hover.color}",icon:{color:"{surface.400}",focusColor:"{surface.500}",activeColor:"{surface.500}"}},submenuLabel:{background:"transparent",color:"{text.muted.color}"},submenuIcon:{color:"{surface.400}",focusColor:"{surface.500}",activeColor:"{surface.500}"}}},dark:{surface:{0:"#ffffff",50:"{zinc.50}",100:"{zinc.100}",200:"{zinc.200}",300:"{zinc.300}",400:"{zinc.400}",500:"{zinc.500}",600:"{zinc.600}",700:"{zinc.700}",800:"{zinc.800}",900:"{zinc.900}",950:"{zinc.950}"},primary:{color:"{primary.400}",contrastColor:"{surface.900}",hoverColor:"{primary.300}",activeColor:"{primary.200}"},highlight:{background:"color-mix(in srgb, {primary.400}, transparent 84%)",focusBackground:"color-mix(in srgb, {primary.400}, transparent 76%)",color:"rgba(255,255,255,.87)",focusColor:"rgba(255,255,255,.87)"},mask:{background:"rgba(0,0,0,0.6)",color:"{surface.200}"},formField:{background:"{surface.950}",disabledBackground:"{surface.700}",filledBackground:"{surface.800}",filledHoverBackground:"{surface.800}",filledFocusBackground:"{surface.800}",borderColor:"{surface.600}",hoverBorderColor:"{surface.500}",focusBorderColor:"{primary.color}",invalidBorderColor:"{red.300}",color:"{surface.0}",disabledColor:"{surface.400}",placeholderColor:"{surface.400}",invalidPlaceholderColor:"{red.400}",floatLabelColor:"{surface.400}",floatLabelFocusColor:"{primary.color}",floatLabelActiveColor:"{surface.400}",floatLabelInvalidColor:"{form.field.invalid.placeholder.color}",iconColor:"{surface.400}",shadow:"0 0 #0000, 0 0 #0000, 0 1px 2px 0 rgba(18, 18, 23, 0.05)"},text:{color:"{surface.0}",hoverColor:"{surface.0}",mutedColor:"{surface.400}",hoverMutedColor:"{surface.300}"},content:{background:"{surface.900}",hoverBackground:"{surface.800}",borderColor:"{surface.700}",color:"{text.color}",hoverColor:"{text.hover.color}"},overlay:{select:{background:"{surface.900}",borderColor:"{surface.700}",color:"{text.color}"},popover:{background:"{surface.900}",borderColor:"{surface.700}",color:"{text.color}"},modal:{background:"{surface.900}",borderColor:"{surface.700}",color:"{text.color}"}},list:{option:{focusBackground:"{surface.800}",selectedBackground:"{highlight.background}
4015",selectedFocusBackground:"{highlight.focus.background}",color:"{text.color}",focusColor:"{text.hover.color}",selectedColor:"{highlight.color}",selectedFocusColor:"{highlight.focus.color}",icon:{color:"{surface.500}",focusColor:"{surface.400}"}},optionGroup:{background:"transparent",color:"{text.muted.color}"}},navigation:{item:{focusBackground:"{surface.800}",activeBackground:"{surface.800}",color:"{text.color}",focusColor:"{text.hover.color}",activeColor:"{text.hover.color}",icon:{color:"{surface.500}",focusColor:"{surface.400}",activeColor:"{surface.400}"}},submenuLabel:{background:"transparent",color:"{text.muted.color}"},submenuIcon:{color:"{surface.500}",focusColor:"{surface.400}",activeColor:"{surface.400}"}}}}},Kge={primitive:Zge,semantic:Yge},Jge={borderRadius:"{content.border.radius}"},Qge={root:Jge},e_e={padding:"1rem",background:"{content.background}",gap:"0.5rem",transitionDuration:"{transition.duration}"},t_e={color:"{text.muted.color}",hoverColor:"{text.color}",borderRadius:"{content.border.radius}",gap:"{navigation.item.gap}",icon:{color:"{navigation.item.icon.color}",hoverColor:"{navigation.item.icon.focus.color}"},focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"}},n_e={color:"{navigation.item.icon.color}"},r_e={root:e_e,item:t_e,separator:n_e},i_e={borderRadius:"{form.field.border.radius}",roundedBorderRadius:"2rem",gap:"0.5rem",paddingX:"{form.field.padding.x}",paddingY:"{form.field.padding.y}",iconOnlyWidth:"2.5rem",sm:{fontSize:"{form.field.sm.font.size}",paddingX:"{form.field.sm.padding.x}",paddingY:"{form.field.sm.padding.y}",iconOnlyWidth:"2rem"},lg:{fontSize:"{form.field.lg.font.size}",paddingX:"{form.field.lg.padding.x}",paddingY:"{form.field.lg.padding.y}",iconOnlyWidth:"3rem"},label:{fontWeight:"500"},raisedShadow:"0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",offset:"{focus.ring.offset}"},badgeSize:"1rem",transitionDuration:"{form.field.transition.duration}"},o_e={light:{root:{primary:{background:"{primary.color}",hoverBackground:"{primary.hover.color}",activeBackground:"{primary.active.color}",borderColor:"{primary.color}",hoverBorderColor:"{primary.hover.color}",activeBorderColor:"{primary.active.color}",color:"{primary.contrast.color}",hoverColor:"{primary.contrast.color}",activeColor:"{primary.contrast.color}",focusRing:{color:"{primary.color}",shadow:"none"}},secondary:{background:"{surface.100}",hoverBackground:"{surface.200}",activeBackground:"{surface.300}",borderColor:"{surface.100}",hoverBorderColor:"{surface.200}",activeBorderColor:"{surface.300}",color:"{surface.600}",hoverColor:"{surface.700}",activeColor:"{surface.800}",focusRing:{color:"{surface.600}",shadow:"none"}},info:{background:"{sky.500}",hoverBackground:"{sky.600}",activeBackground:"{sky.700}",borderColor:"{sky.500}",hoverBorderColor:"{sky.600}",activeBorderColor:"{sky.700}",color:"#ffffff",hoverColor:"#ffffff",activeColor:"#ffffff",focusRing:{color:"{sky.500}",shadow:"none"}},success:{background:"{green.500}",hoverBackground:"{green.600}",activeBackground:"{green.700}",borderColor:"{green.500}",hoverBorderColor:"{green.600}",activeBorderColor:"{green.700}",color:"#ffffff",hoverColor:"#ffffff",activeColor:"#ffffff",focusRing:{color:"{green.500}",shadow:"none"}},warn:{background:"{orange.500}",hoverBackground:"{orange.600}",activeBackground:"{orange.700}",borderColor:"{orange.500}",hoverBorderColor:"{orange.600}",activeBorderColor:"{orange.700}",color:"#ffffff",hoverColor:"#ffffff",activeColor:"#ffffff",focusRing:{color:"{orange.500}",shadow:"none"}},help:{background:"{purple.500}",hoverBackground:"{purple.600}",activeBackground:"{purple.700}",borderColor:"{purple.500}",hoverBorderColor:"{purple.600}",activeBorderColor:"{purple.700}",color:"#ffffff",hoverColor:"#ffffff",activeColor:"#ffffff",focusRing:{color:"{purple.500}",shadow:"none"}},danger:{background:"{red.500}",hoverBackground:"{red.600}
4015",activeBackground:"{red.700}",borderColor:"{red.500}",hoverBorderColor:"{red.600}",activeBorderColor:"{red.700}",color:"#ffffff",hoverColor:"#ffffff",activeColor:"#ffffff",focusRing:{color:"{red.500}",shadow:"none"}},contrast:{background:"{surface.950}",hoverBackground:"{surface.900}",activeBackground:"{surface.800}",borderColor:"{surface.950}",hoverBorderColor:"{surface.900}",activeBorderColor:"{surface.800}",color:"{surface.0}",hoverColor:"{surface.0}",activeColor:"{surface.0}",focusRing:{color:"{surface.950}",shadow:"none"}}},outlined:{primary:{hoverBackground:"{primary.50}",activeBackground:"{primary.100}",borderColor:"{primary.200}",color:"{primary.color}"},secondary:{hoverBackground:"{surface.50}",activeBackground:"{surface.100}",borderColor:"{surface.200}",color:"{surface.500}"},success:{hoverBackground:"{green.50}",activeBackground:"{green.100}",borderColor:"{green.200}",color:"{green.500}"},info:{hoverBackground:"{sky.50}",activeBackground:"{sky.100}",borderColor:"{sky.200}",color:"{sky.500}"},warn:{hoverBackground:"{orange.50}",activeBackground:"{orange.100}",borderColor:"{orange.200}",color:"{orange.500}"},help:{hoverBackground:"{purple.50}",activeBackground:"{purple.100}",borderColor:"{purple.200}",color:"{purple.500}"},danger:{hoverBackground:"{red.50}",activeBackground:"{red.100}",borderColor:"{red.200}",color:"{red.500}"},contrast:{hoverBackground:"{surface.50}",activeBackground:"{surface.100}",borderColor:"{surface.700}",color:"{surface.950}"},plain:{hoverBackground:"{surface.50}",activeBackground:"{surface.100}",borderColor:"{surface.200}",color:"{surface.700}"}},text:{primary:{hoverBackground:"{primary.50}",activeBackground:"{primary.100}",color:"{primary.color}"},secondary:{hoverBackground:"{surface.50}",activeBackground:"{surface.100}",color:"{surface.500}"},success:{hoverBackground:"{green.50}",activeBackground:"{green.100}",color:"{green.500}"},info:{hoverBackground:"{sky.50}",activeBackground:"{sky.100}",color:"{sky.500}"},warn:{hoverBackground:"{orange.50}",activeBackground:"{orange.100}",color:"{orange.500}"},help:{hoverBackground:"{purple.50}",activeBackground:"{purple.100}",color:"{purple.500}"},danger:{hoverBackground:"{red.50}",activeBackground:"{red.100}",color:"{red.500}"},contrast:{hoverBackground:"{surface.50}",activeBackground:"{surface.100}",color:"{surface.950}"},plain:{hoverBackground:"{surface.50}",activeBackground:"{surface.100}",color:"{surface.700}"}},link:{color:"{primary.color}",hoverColor:"{primary.color}",activeColor:"{primary.color}"}},dark:{root:{primary:{background:"{primary.color}",hoverBackground:"{primary.hover.color}",activeBackground:"{primary.active.color}",borderColor:"{primary.color}",hoverBorderColor:"{primary.hover.color}",activeBorderColor:"{primary.active.color}",color:"{primary.contrast.color}",hoverColor:"{primary.contrast.color}",activeColor:"{primary.contrast.color}",focusRing:{color:"{primary.color}",shadow:"none"}},secondary:{background:"{surface.800}",hoverBackground:"{surface.700}",activeBackground:"{surface.600}",borderColor:"{surface.800}",hoverBorderColor:"{surface.700}",activeBorderColor:"{surface.600}",color:"{surface.300}",hoverColor:"{surface.200}",activeColor:"{surface.100}",focusRing:{color:"{surface.300}",shadow:"none"}},info:{background:"{sky.400}",hoverBackground:"{sky.300}",activeBackground:"{sky.200}",borderColor:"{sky.400}",hoverBorderColor:"{sky.300}",activeBorderColor:"{sky.200}",color:"{sky.950}",hoverColor:"{sky.950}",activeColor:"{sky.950}",focusRing:{color:"{sky.400}",shadow:"none"}},success:{background:"{green.400}",hoverBackground:"{green.300}",activeBackground:"{green.200}",borderColor:"{green.400}",hoverBorderColor:"{green.300}",activeBorderColor:"{green.200}",color:"{green.950}",hoverColor:"{green.950}",activeColor:"{green.950}",focusRing:{color:"{green.400}",shadow:"none"}},warn:{background:"{orange.400}",hoverBackground:"{orange.300}",activeBackground:"{orange.200}",borderColor:"{orange.400}",hoverBorderColor:"{orange.300}",activeBorderColor:"{orange.200}",color:"{orange.950}",hoverColor:"{orange.950}",activeColor:"{orange.950}",focusRing:{color:"{orange.400}",shadow:"none"}},help:{background:"{purple.400}
4015",hoverBackground:"{purple.300}",activeBackground:"{purple.200}",borderColor:"{purple.400}",hoverBorderColor:"{purple.300}",activeBorderColor:"{purple.200}",color:"{purple.950}",hoverColor:"{purple.950}",activeColor:"{purple.950}",focusRing:{color:"{purple.400}",shadow:"none"}},danger:{background:"{red.400}",hoverBackground:"{red.300}",activeBackground:"{red.200}",borderColor:"{red.400}",hoverBorderColor:"{red.300}",activeBorderColor:"{red.200}",color:"{red.950}",hoverColor:"{red.950}",activeColor:"{red.950}",focusRing:{color:"{red.400}",shadow:"none"}},contrast:{background:"{surface.0}",hoverBackground:"{surface.100}",activeBackground:"{surface.200}",borderColor:"{surface.0}",hoverBorderColor:"{surface.100}",activeBorderColor:"{surface.200}",color:"{surface.950}",hoverColor:"{surface.950}",activeColor:"{surface.950}",focusRing:{color:"{surface.0}",shadow:"none"}}},outlined:{primary:{hoverBackground:"color-mix(in srgb, {primary.color}, transparent 96%)",activeBackground:"color-mix(in srgb, {primary.color}, transparent 84%)",borderColor:"{primary.700}
4015",color:"{primary.color}"},secondary:{hoverBackground:"rgba(255,255,255,0.04)",activeBackground:"rgba(255,255,255,0.16)",borderColor:"{surface.700}",color:"{surface.400}"},success:{hoverBackground:"color-mix(in srgb, {green.400}, transparent 96%)",activeBackground:"color-mix(in srgb, {green.400}, transparent 84%)",borderColor:"{green.700}",color:"{green.400}"},info:{hoverBackground:"color-mix(in srgb, {sky.400}, transparent 96%)",activeBackground:"color-mix(in srgb, {sky.400}, transparent 84%)",borderColor:"{sky.700}",color:"{sky.400}"},warn:{hoverBackground:"color-mix(in srgb, {orange.400}, transparent 96%)",activeBackground:"color-mix(in srgb, {orange.400}, transparent 84%)",borderColor:"{orange.700}",color:"{orange.400}"},help:{hoverBackground:"color-mix(in srgb, {purple.400}, transparent 96%)",activeBackground:"color-mix(in srgb, {purple.400}, transparent 84%)",borderColor:"{purple.700}",color:"{purple.400}"},danger:{hoverBackground:"color-mix(in srgb, {red.400}, transparent 96%)",activeBackground:"color-mix(in srgb, {red.400}, transparent 84%)",borderColor:"{red.700}",color:"{red.400}"},contrast:{hoverBackground:"{surface.800}",activeBackground:"{surface.700}",borderColor:"{surface.500}",color:"{surface.0}"},plain:{hoverBackground:"{surface.800}",activeBackground:"{surface.700}",borderColor:"{surface.600}",color:"{surface.0}"}},text:{primary:{hoverBackground:"color-mix(in srgb, {primary.color}, transparent 96%)",activeBackground:"color-mix(in srgb, {primary.color}, transparent 84%)",color:"{primary.color}"},secondary:{hoverBackground:"{surface.800}",activeBackground:"{surface.700}",color:"{surface.400}"},success:{hoverBackground:"color-mix(in srgb, {green.400}, transparent 96%)",activeBackground:"color-mix(in srgb, {green.400}, transparent 84%)",color:"{green.400}"},info:{hoverBackground:"color-mix(in srgb, {sky.400}, transparent 96%)",activeBackground:"color-mix(in srgb, {sky.400}, transparent 84%)",color:"{sky.400}"},warn:{hoverBackground:"color-mix(in srgb, {orange.400}, transparent 96%)",activeBackground:"color-mix(in srgb, {orange.400}, transparent 84%)",color:"{orange.400}"},help:{hoverBackground:"color-mix(in srgb, {purple.400}, transparent 96%)",activeBackground:"color-mix(in srgb, {purple.400}, transparent 84%)",color:"{purple.400}"},danger:{hoverBackground:"color-mix(in srgb, {red.400}, transparent 96%)",activeBackground:"color-mix(in srgb, {red.400}, transparent 84%)",color:"{red.400}"},contrast:{hoverBackground:"{surface.800}",activeBackground:"{surface.700}",color:"{surface.0}"},plain:{hoverBackground:"{surface.800}",activeBackground:"{surface.700}",color:"{surface.0}"}},link:{color:"{primary.color}",hoverColor:"{primary.color}",activeColor:"{primary.color}"}}},s_e={root:i_e,colorScheme:o_e},a_e={background:"{content.background}",borderRadius:"{border.radius.xl}",color:"{content.color}",shadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)"},l_e={padding:"1.25rem",gap:"0.5rem"},c_e={gap:"0.5rem"},u_e={fontSize:"1.25rem",fontWeight:"500"},d_e={color:"{text.muted.color}"},h_e={root:a_e,body:l_e,caption:c_e,title:u_e,subtitle:d_e},f_e={transitionDuration:"{transition.duration}"},p_e={gap:"0.25rem"},m_e={padding:"1rem",gap:"0.5rem"},g_e={width:"2rem",height:"0.5rem",borderRadius:"{content.border.radius}",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"}},__e={light:{indicator:{background:"{surface.200}",hoverBackground:"{surface.300}",activeBackground:"{primary.color}"}},dark:{indicator:{background:"{surface.700}",hoverBackground:"{surface.600}",activeBackground:"{primary.color}"}}},y_e={root:f_e,content:p_e,indicatorList:m_e,indicator:g_e,colorScheme:__e},v_e={background:"{form.field.background}",disabledBackground:"{form.field.disabled.background}",filledBackground:"{form.field.filled.background}",filledHoverBackground:"{form.field.filled.hover.background}",filledFocusBackground:"{form.field.filled.focus.background}",borderColor:"{form.field.border.color}",hoverBorderColor:"{form.field.hover.border.color}",focusBorderColor:"{form.field.focus.border.color}
4015",invalidBorderColor:"{form.field.invalid.border.color}",color:"{form.field.color}",disabledColor:"{form.field.disabled.color}",placeholderColor:"{form.field.placeholder.color}",invalidPlaceholderColor:"{form.field.invalid.placeholder.color}",shadow:"{form.field.shadow}",paddingX:"{form.field.padding.x}",paddingY:"{form.field.padding.y}",borderRadius:"{form.field.border.radius}",focusRing:{width:"{form.field.focus.ring.width}",style:"{form.field.focus.ring.style}",color:"{form.field.focus.ring.color}",offset:"{form.field.focus.ring.offset}",shadow:"{form.field.focus.ring.shadow}"},transitionDuration:"{form.field.transition.duration}",sm:{fontSize:"{form.field.sm.font.size}",paddingX:"{form.field.sm.padding.x}",paddingY:"{form.field.sm.padding.y}"},lg:{fontSize:"{form.field.lg.font.size}",paddingX:"{form.field.lg.padding.x}",paddingY:"{form.field.lg.padding.y}"}},b_e={width:"2.5rem",color:"{form.field.icon.color}"},x_e={background:"{overlay.select.background}",borderColor:"{overlay.select.border.color}",borderRadius:"{overlay.select.border.radius}",color:"{overlay.select.color}",shadow:"{overlay.select.shadow}"},w_e={padding:"{list.padding}",gap:"{list.gap}",mobileIndent:"1rem"},S_e={focusBackground:"{list.option.focus.background}",selectedBackground:"{list.option.selected.background}",selectedFocusBackground:"{list.option.selected.focus.background}",color:"{list.option.color}",focusColor:"{list.option.focus.color}",selectedColor:"{list.option.selected.color}",selectedFocusColor:"{list.option.selected.focus.color}",padding:"{list.option.padding}",borderRadius:"{list.option.border.radius}",icon:{color:"{list.option.icon.color}",focusColor:"{list.option.icon.focus.color}",size:"0.875rem"}},T_e={color:"{form.field.icon.color}"},E_e={root:v_e,dropdown:b_e,overlay:x_e,list:w_e,option:S_e,clearIcon:T_e},C_e={borderRadius:"{border.radius.sm}",width:"1.25rem",height:"1.25rem",background:"{form.field.background}",checkedBackground:"{primary.color}",checkedHoverBackground:"{primary.hover.color}",disabledBackground:"{form.field.disabled.background}",filledBackground:"{form.field.filled.background}",borderColor:"{form.field.border.color}",hoverBorderColor:"{form.field.hover.border.color}",focusBorderColor:"{form.field.border.color}",checkedBorderColor:"{primary.color}",checkedHoverBorderColor:"{primary.hover.color}",checkedFocusBorderColor:"{primary.color}",checkedDisabledBorderColor:"{form.field.border.color}",invalidBorderColor:"{form.field.invalid.border.color}",shadow:"{form.field.shadow}",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"},transitionDuration:"{form.field.transition.duration}
4015",sm:{width:"1rem",height:"1rem"},lg:{width:"1.5rem",height:"1.5rem"}},A_e={size:"0.875rem",color:"{form.field.color}",checkedColor:"{primary.contrast.color}",checkedHoverColor:"{primary.contrast.color}",disabledColor:"{form.field.disabled.color}",sm:{size:"0.75rem"},lg:{size:"1rem"}},I_e={root:C_e,icon:A_e},P_e={borderRadius:"16px",paddingX:"0.75rem",paddingY:"0.5rem",gap:"0.5rem",transitionDuration:"{transition.duration}"},R_e={width:"2rem",height:"2rem"},k_e={size:"1rem"},M_e={size:"1rem",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{form.field.focus.ring.shadow}"}},L_e={light:{root:{background:"{surface.100}",color:"{surface.800}"},icon:{color:"{surface.800}"},removeIcon:{color:"{surface.800}"}},dark:{root:{background:"{surface.800}",color:"{surface.0}"},icon:{color:"{surface.0}"},removeIcon:{color:"{surface.0}"}}},O_e={root:P_e,image:R_e,icon:k_e,removeIcon:M_e,colorScheme:L_e},D_e={transitionDuration:"{transition.duration}"},F_e={width:"1.5rem",height:"1.5rem",borderRadius:"{form.field.border.radius}",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"}},B_e={shadow:"{overlay.popover.shadow}",borderRadius:"{overlay.popover.borderRadius}"},z_e={light:{panel:{background:"{surface.800}",borderColor:"{surface.900}"},handle:{color:"{surface.0}"}},dark:{panel:{background:"{surface.900}",borderColor:"{surface.700}"},handle:{color:"{surface.0}"}}},N_e={root:D_e,preview:F_e,panel:B_e,colorScheme:z_e},V_e={size:"2rem",color:"{overlay.modal.color}"},U_e={gap:"1rem"},$_e={icon:V_e,content:U_e},j_e={background:"{overlay.popover.background}",borderColor:"{overlay.popover.border.color}",color:"{overlay.popover.color}",borderRadius:"{overlay.popover.border.radius}",shadow:"{overlay.popover.shadow}",gutter:"10px",arrowOffset:"1.25rem"},G_e={padding:"{overlay.popover.padding}",gap:"1rem"},H_e={size:"1.5rem",color:"{overlay.popover.color}"},W_e={gap:"0.5rem",padding:"0 {overlay.popover.padding} {overlay.popover.padding} {overlay.popover.padding}"},q_e={root:j_e,content:G_e,icon:H_e,footer:W_e},X_e={background:"{content.background}",borderColor:"{content.border.color}",color:"{content.color}",borderRadius:"{content.border.radius}",shadow:"{overlay.navigation.shadow}",transitionDuration:"{transition.duration}"},Z_e={padding:"{navigation.list.padding}",gap:"{navigation.list.gap}"}
4015,Y_e={focusBackground:"{navigation.item.focus.background}",activeBackground:"{navigation.item.active.background}",color:"{navigation.item.color}",focusColor:"{navigation.item.focus.color}",activeColor:"{navigation.item.active.color}",padding:"{navigation.item.padding}",borderRadius:"{navigation.item.border.radius}",gap:"{navigation.item.gap}",icon:{color:"{navigation.item.icon.color}",focusColor:"{navigation.item.icon.focus.color}",activeColor:"{navigation.item.icon.active.color}"}},K_e={mobileIndent:"1rem"},J_e={size:"{navigation.submenu.icon.size}",color:"{navigation.submenu.icon.color}",focusColor:"{navigation.submenu.icon.focus.color}",activeColor:"{navigation.submenu.icon.active.color}"},Q_e={borderColor:"{content.border.color}"},eye={root:X_e,list:Z_e,item:Y_e,submenu:K_e,submenuIcon:J_e,separator:Q_e},tye=` 4016 li.p-autocomplete-option, 4017 div.p-cascadeselect-option-content, 4018 li.p-listbox-option, 4019 li.p-multiselect-option, 4020 li.p-select-option, 4021 li.p-listbox-option, 4022 div.p-tree-node-content, 4023 li.p-datatable-filter-constraint, 4024 .p-datatable .p-datatable-tbody > tr, 4025 .p-treetable .p-treetable-tbody > tr, 4026 div.p-menu-item-content, 4027 div.p-tieredmenu-item-content, 4028 div.p-contextmenu-item-content, 4029 div.p-menubar-item-content, 4030 div.p-megamenu-item-content, 4031 div.p-panelmenu-header-content, 4032 div.p-panelmenu-item-content, 4033 th.p-datatable-header-cell, 4034 th.p-treetable-header-cell, 4035 thead.p-datatable-thead > tr > th, 4036 .p-treetable thead.p-treetable-thead>tr>th { 4037 transition: none; 4038 } 4039`,nye={transitionDuration:"{transition.duration}"},rye={background:"{content.background}",borderColor:"{datatable.border.color}",color:"{content.color}",borderWidth:"0 0 1px 0",padding:"0.75rem 1rem",sm:{padding:"0.375rem 0.5rem"},lg:{padding:"1rem 1.25rem"}},iye={background:"{content.background}",hoverBackground:"{content.hover.background}",selectedBackground:"{highlight.background}",borderColor:"{datatable.border.color}",color:"{content.color}",hoverColor:"{content.hover.color}",selectedColor:"{highlight.color}",gap:"0.5rem",padding:"0.75rem 1rem",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"-1px",shadow:"{focus.ring.shadow}"},sm:{padding:"0.375rem 0.5rem"},lg:{padding:"1rem 1.25rem"}},oye={fontWeight:"600"},sye={background:"{content.background}",hoverBackground:"{content.hover.background}",selectedBackground:"{highlight.background}",color:"{content.color}",hoverColor:"{content.hover.color}",selectedColor:"{highlight.color}",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"-1px",shadow:"{focus.ring.shadow}"}},aye={borderColor:"{datatable.border.color}",padding:"0.75rem 1rem",sm:{padding:"0.375rem 0.5rem"},lg:{padding:"1rem 1.25rem"}},lye={background:"{content.background}",borderColor:"{datatable.border.color}",color:"{content.color}",padding:"0.75rem 1rem",sm:{padding:"0.375rem 0.5rem"},lg:{padding:"1rem 1.25rem"}},cye={fontWeight:"600"},uye={background:"{content.background}",borderColor:"{datatable.border.color}",color:"{content.color}",borderWidth:"0 0 1px 0",padding:"0.75rem 1rem",sm:{padding:"0.375rem 0.5rem"},lg:{padding:"1rem 1.25rem"}},dye={color:"{primary.color}"},hye={width:"0.5rem"},fye={width:"1px",color:"{primary.color}"},pye={color:"{text.muted.color}",hoverColor:"{text.hover.muted.color}",size:"0.875rem"},mye={size:"2rem"},gye={hoverBackground:"{content.hover.background}",selectedHoverBackground:"{content.background}",color:"{text.muted.color}",hoverColor:"{text.color}",selectedHoverColor:"{primary.color}",size:"1.75rem",borderRadius:"50%",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"}},_ye={inlineGap:"0.5rem",overlaySelect:{background:"{overlay.select.background}",borderColor:"{overlay.select.border.color}",borderRadius:"{overlay.select.border.radius}",color:"{overlay.select.color}",shadow:"{overlay.select.shadow}"},overlayPopover:{background:"{overlay.popover.background}",borderColor:"{overlay.popover.border.color}
4039",borderRadius:"{overlay.popover.border.radius}",color:"{overlay.popover.color}",shadow:"{overlay.popover.shadow}",padding:"{overlay.popover.padding}",gap:"0.5rem"},rule:{borderColor:"{content.border.color}"},constraintList:{padding:"{list.padding}",gap:"{list.gap}"},constraint:{focusBackground:"{list.option.focus.background}",selectedBackground:"{list.option.selected.background}",selectedFocusBackground:"{list.option.selected.focus.background}",color:"{list.option.color}",focusColor:"{list.option.focus.color}",selectedColor:"{list.option.selected.color}",selectedFocusColor:"{list.option.selected.focus.color}",separator:{borderColor:"{content.border.color}"},padding:"{list.option.padding}",borderRadius:"{list.option.border.radius}"}},yye={borderColor:"{datatable.border.color}",borderWidth:"0 0 1px 0"},vye={borderColor:"{datatable.border.color}",borderWidth:"0 0 1px 0"},bye={light:{root:{borderColor:"{content.border.color}"},row:{stripedBackground:"{surface.50}"},bodyCell:{selectedBorderColor:"{primary.100}"}},dark:{root:{borderColor:"{surface.800}"},row:{stripedBackground:"{surface.950}"},bodyCell:{selectedBorderColor:"{primary.900}"}}},xye=` 4040 .p-datatable-mask.p-overlay-mask { 4041 --px-mask-background: light-dark(rgba(255,255,255,0.5),rgba(0,0,0,0.3)); 4042 } 4043`,wye={root:nye,header:rye,headerCell:iye,columnTitle:oye,row:sye,bodyCell:aye,footerCell:lye,columnFooter:cye,footer:uye,dropPoint:dye,columnResizer:hye,resizeIndicator:fye,sortIcon:pye,loadingIcon:mye,rowToggleButton:gye,filter:_ye,paginatorTop:yye,paginatorBottom:vye,colorScheme:bye,css:xye},Sye={borderColor:"transparent",borderWidth:"0",borderRadius:"0",padding:"0"},Tye={background:"{content.background}",color:"{content.color}",borderColor:"{content.border.color}",borderWidth:"0 0 1px 0",padding:"0.75rem 1rem",borderRadius:"0"},Eye={background:"{content.background}",color:"{content.color}",borderColor:"transparent",borderWidth:"0",padding:"0",borderRadius:"0"},Cye={background:"{content.background}",color:"{content.color}",borderColor:"{content.border.color}",borderWidth:"1px 0 0 0",padding:"0.75rem 1rem",borderRadius:"0"},Aye={borderColor:"{content.border.color}",borderWidth:"0 0 1px 0"},Iye={borderColor:"{content.border.color}",borderWidth:"1px 0 0 0"},Pye={root:Sye,header:Tye,content:Eye,footer:Cye,paginatorTop:Aye,paginatorBottom:Iye},Rye={transitionDuration:"{transition.duration}"},kye={background:"{content.background}",borderColor:"{content.border.color}",color:"{content.color}",borderRadius:"{content.border.radius}",shadow:"{overlay.popover.shadow}",padding:"{overlay.popover.padding}"},Mye={background:"{content.background}",borderColor:"{content.border.color}",color:"{content.color}",padding:"0 0 0.5rem 0"},Lye={gap:"0.5rem",fontWeight:"500"},Oye={width:"2.5rem",sm:{width:"2rem"},lg:{width:"3rem"},borderColor:"{form.field.border.color}",hoverBorderColor:"{form.field.border.color}",activeBorderColor:"{form.field.border.color}",borderRadius:"{form.field.border.radius}",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"}},Dye={color:"{form.field.icon.color}"},Fye={hoverBackground:"{content.hover.background}",color:"{content.color}",hoverColor:"{content.hover.color}",padding:"0.25rem 0.5rem",borderRadius:"{content.border.radius}"},Bye={hoverBackground:"{content.hover.background}",color:"{content.color}",hoverColor:"{content.hover.color}",padding:"0.25rem 0.5rem",borderRadius:"{content.border.radius}"},zye={borderColor:"{content.border.color}",gap:"{overlay.popover.padding}"},Nye={margin:"0.5rem 0 0 0"},Vye={padding:"0.25rem",fontWeight:"500",color:"{content.color}"},Uye={hoverBackground:"{content.hover.background}",selectedBackground:"{primary.color}",rangeSelectedBackground:"{highlight.background}",color:"{content.color}",hoverColor:"{content.hover.color}",selectedColor:"{primary.contrast.color}",rangeSelectedColor:"{highlight.color}",width:"2rem",height:"2rem",borderRadius:"50%",padding:"0.25rem",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"}},$ye={margin:"0.5rem 0 0 0"}
4043,jye={padding:"0.375rem",borderRadius:"{content.border.radius}"},Gye={margin:"0.5rem 0 0 0"},Hye={padding:"0.375rem",borderRadius:"{content.border.radius}"},Wye={padding:"0.5rem 0 0 0",borderColor:"{content.border.color}"},qye={padding:"0.5rem 0 0 0",borderColor:"{content.border.color}",gap:"0.5rem",buttonGap:"0.25rem"},Xye={light:{dropdown:{background:"{surface.100}",hoverBackground:"{surface.200}",activeBackground:"{surface.300}",color:"{surface.600}",hoverColor:"{surface.700}",activeColor:"{surface.800}"},today:{background:"{surface.200}",color:"{surface.900}"}},dark:{dropdown:{background:"{surface.800}",hoverBackground:"{surface.700}",activeBackground:"{surface.600}",color:"{surface.300}",hoverColor:"{surface.200}",activeColor:"{surface.100}"},today:{background:"{surface.700}",color:"{surface.0}"}}},Zye={root:Rye,panel:kye,header:Mye,title:Lye,dropdown:Oye,inputIcon:Dye,selectMonth:Fye,selectYear:Bye,group:zye,dayView:Nye,weekDay:Vye,date:Uye,monthView:$ye,month:jye,yearView:Gye,year:Hye,buttonbar:Wye,timePicker:qye,colorScheme:Xye},Yye={background:"{overlay.modal.background}",borderColor:"{overlay.modal.border.color}",color:"{overlay.modal.color}",borderRadius:"{overlay.modal.border.radius}",shadow:"{overlay.modal.shadow}"},Kye={padding:"{overlay.modal.padding}",gap:"0.5rem"},Jye={fontSize:"1.25rem",fontWeight:"600"},Qye={padding:"0 {overlay.modal.padding} {overlay.modal.padding} {overlay.modal.padding}"},e0e={padding:"0 {overlay.modal.padding} {overlay.modal.padding} {overlay.modal.padding}",gap:"0.5rem"},t0e={root:Yye,header:Kye,title:Jye,content:Qye,footer:e0e},n0e={borderColor:"{content.border.color}"},r0e={background:"{content.background}",color:"{text.color}"},i0e={margin:"1rem 0",padding:"0 1rem",content:{padding:"0 0.5rem"}},o0e={margin:"0 1rem",padding:"0.5rem 0",content:{padding:"0.5rem 0"}},s0e={root:n0e,content:r0e,horizontal:i0e,vertical:o0e},a0e={background:"rgba(255, 255, 255, 0.1)",borderColor:"rgba(255, 255, 255, 0.2)",padding:"0.5rem",borderRadius:"{border.radius.xl}"},l0e={borderRadius:"{content.border.radius}",padding:"0.5rem",size:"3rem",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"}},c0e={root:a0e,item:l0e},u0e={background:"{overlay.modal.background}",borderColor:"{overlay.modal.border.color}",color:"{overlay.modal.color}",shadow:"{overlay.modal.shadow}"},d0e={padding:"{overlay.modal.padding}"},h0e={fontSize:"1.5rem",fontWeight:"600"},f0e={padding:"0 {overlay.modal.padding} {overlay.modal.padding} {overlay.modal.padding}"},p0e={padding:"{overlay.modal.padding}"},m0e={root:u0e,header:d0e,title:h0e,content:f0e,footer:p0e},g0e={background:"{content.background}",borderColor:"{content.border.color}",borderRadius:"{content.border.radius}"},_0e={color:"{text.muted.color}",hoverColor:"{text.color}",activeColor:"{primary.color}"},y0e={background:"{overlay.select.background}",borderColor:"{overlay.select.border.color}",borderRadius:"{overlay.select.border.radius}",color:"{overlay.select.color}",shadow:"{overlay.select.shadow}",padding:"{list.padding}"},v0e={focusBackground:"{list.option.focus.background}",color:"{list.option.color}",focusColor:"{list.option.focus.color}",padding:"{list.option.padding}",borderRadius:"{list.option.border.radius}"},b0e={background:"{content.background}",borderColor:"{content.border.color}",color:"{content.color}",borderRadius:"{content.border.radius}"},x0e={toolbar:g0e,toolbarItem:_0e,overlay:y0e,overlayOption:v0e,content:b0e},w0e={background:"{content.background}",borderColor:"{content.border.color}",borderRadius:"{content.border.radius}",color:"{content.color}",padding:"0 1.125rem 1.125rem 1.125rem",transitionDuration:"{transition.duration}"},S0e={background:"{content.background}",hoverBackground:"{content.hover.background}",color:"{content.color}",hoverColor:"{content.hover.color}",borderRadius:"{content.border.radius}",borderWidth:"1px",borderColor:"transparent",padding:"0.5rem 0.75rem",gap:"0.5rem",fontWeight:"600",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"}},T0e={color:"{text.muted.color}",hoverColor:"{text.hover.muted.color}"},E0e={padding:"0"},C0e={root:w0e,legend:S0e,toggleIcon:T0e,content:E0e},A0e={background:"{content.background}",borderColor:"{content.border.color}",color:"{content.color}
4043",borderRadius:"{content.border.radius}",transitionDuration:"{transition.duration}"},I0e={background:"transparent",color:"{text.color}",padding:"1.125rem",borderColor:"unset",borderWidth:"0",borderRadius:"0",gap:"0.5rem"},P0e={highlightBorderColor:"{primary.color}",padding:"0 1.125rem 1.125rem 1.125rem",gap:"1rem"},R0e={padding:"1rem",gap:"1rem",borderColor:"{content.border.color}",info:{gap:"0.5rem"}},k0e={gap:"0.5rem"},M0e={height:"0.25rem"},L0e={gap:"0.5rem"},O0e={root:A0e,header:I0e,content:P0e,file:R0e,fileList:k0e,progressbar:M0e,basic:L0e},D0e={color:"{form.field.float.label.color}",focusColor:"{form.field.float.label.focus.color}",activeColor:"{form.field.float.label.active.color}",invalidColor:"{form.field.float.label.invalid.color}",transitionDuration:"0.2s",positionX:"{form.field.padding.x}",positionY:"{form.field.padding.y}",fontWeight:"500",active:{fontSize:"0.75rem",fontWeight:"400"}},F0e={active:{top:"-1.25rem"}},B0e={input:{paddingTop:"1.5rem",paddingBottom:"{form.field.padding.y}"},active:{top:"{form.field.padding.y}"}},z0e={borderRadius:"{border.radius.xs}",active:{background:"{form.field.background}",padding:"0 0.125rem"}},N0e={root:D0e,over:F0e,in:B0e,on:z0e},V0e={borderWidth:"1px",borderColor:"{content.border.color}",borderRadius:"{content.border.radius}",transitionDuration:"{transition.duration}"},U0e={background:"rgba(255, 255, 255, 0.1)",hoverBackground:"rgba(255, 255, 255, 0.2)",color:"{surface.100}",hoverColor:"{surface.0}",size:"3rem",gutter:"0.5rem",prev:{borderRadius:"50%"},next:{borderRadius:"50%"},focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"}},$0e={size:"1.5rem"},j0e={background:"{content.background}",padding:"1rem 0.25rem"},G0e={size:"2rem",borderRadius:"{content.border.radius}",gutter:"0.5rem",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"}},H0e={size:"1rem"},W0e={background:"rgba(0, 0, 0, 0.5)",color:"{surface.100}",padding:"1rem"},q0e={gap:"0.5rem",padding:"1rem"}
4043,X0e={width:"1rem",height:"1rem",activeBackground:"{primary.color}",borderRadius:"50%",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"}},Z0e={background:"rgba(0, 0, 0, 0.5)"},Y0e={background:"rgba(255, 255, 255, 0.4)",hoverBackground:"rgba(255, 255, 255, 0.6)",activeBackground:"rgba(255, 255, 255, 0.9)"},K0e={size:"3rem",gutter:"0.5rem",background:"rgba(255, 255, 255, 0.1)",hoverBackground:"rgba(255, 255, 255, 0.2)",color:"{surface.50}",hoverColor:"{surface.0}",borderRadius:"50%",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"}},J0e={size:"1.5rem"},Q0e={light:{thumbnailNavButton:{hoverBackground:"{surface.100}",color:"{surface.600}",hoverColor:"{surface.700}"},indicatorButton:{background:"{surface.200}",hoverBackground:"{surface.300}"}},dark:{thumbnailNavButton:{hoverBackground:"{surface.700}",color:"{surface.400}",hoverColor:"{surface.0}"},indicatorButton:{background:"{surface.700}",hoverBackground:"{surface.600}"}}},eve={root:V0e,navButton:U0e,navIcon:$0e,thumbnailsContent:j0e,thumbnailNavButton:G0e,thumbnailNavButtonIcon:H0e,caption:W0e,indicatorList:q0e,indicatorButton:X0e,insetIndicatorList:Z0e,insetIndicatorButton:Y0e,closeButton:K0e,closeButtonIcon:J0e,colorScheme:Q0e},tve={color:"{form.field.icon.color}"},nve={icon:tve},rve={color:"{form.field.float.label.color}",focusColor:"{form.field.float.label.focus.color}",invalidColor:"{form.field.float.label.invalid.color}",transitionDuration:"0.2s",positionX:"{form.field.padding.x}",top:"{form.field.padding.y}",fontSize:"0.75rem",fontWeight:"400"},ive={paddingTop:"1.5rem",paddingBottom:"{form.field.padding.y}"},ove={root:rve,input:ive},sve={transitionDuration:"{transition.duration}"},ave={icon:{size:"1.5rem"},mask:{background:"{mask.background}",color:"{mask.color}"}},lve={position:{left:"auto",right:"1rem",top:"1rem",bottom:"auto"},blur:"8px",background:"rgba(255,255,255,0.1)",borderColor:"rgba(255,255,255,0.2)",borderWidth:"1px",borderRadius:"30px",padding:".5rem",gap:"0.5rem"},cve={hoverBackground:"rgba(255,255,255,0.1)",color:"{surface.50}",hoverColor:"{surface.0}",size:"3rem",iconSize:"1.5rem",borderRadius:"50%",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"}},uve={root:sve,preview:ave,toolbar:lve,action:cve},dve={size:"15px",hoverSize:"30px",background:"rgba(255,255,255,0.3)",hoverBackground:"rgba(255,255,255,0.3)",borderColor:"unset",hoverBorderColor:"unset",borderWidth:"0",borderRadius:"50%",transitionDuration:"{transition.duration}",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"rgba(255,255,255,0.3)",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"}},hve={handle:dve},fve={padding:"{form.field.padding.y} {form.field.padding.x}",borderRadius:"{content.border.radius}",gap:"0.5rem"},pve={fontWeight:"500"},mve={size:"1rem"},gve={light:{info:{background:"color-mix(in srgb, {blue.50}, transparent 5%)",borderColor:"{blue.200}",color:"{blue.600}",shadow:"0px 4px 8px 0px color-mix(in srgb, {blue.500}, transparent 96%)"},success:{background:"color-mix(in srgb, {green.50}, transparent 5%)",borderColor:"{green.200}",color:"{green.600}",shadow:"0px 4px 8px 0px color-mix(in srgb, {green.500}, transparent 96%)"},warn:{background:"color-mix(in srgb,{yellow.50}, transparent 5%)",borderColor:"{yellow.200}",color:"{yellow.600}",shadow:"0px 4px 8px 0px color-mix(in srgb, {yellow.500}, transparent 96%)"},error:{background:"color-mix(in srgb, {red.50}, transparent 5%)",borderColor:"{red.200}",color:"{red.600}",shadow:"0px 4px 8px 0px color-mix(in srgb, {red.500}, transparent 96%)"},secondary:{background:"{surface.100}",borderColor:"{surface.200}",color:"{surface.600}",shadow:"0px 4px 8px 0px color-mix(in srgb, {surface.500}, transparent 96%)"},contrast:{background:"{surface.900}",borderColor:"{surface.950}",color:"{surface.50}",shadow:"0px 4px 8px 0px color-mix(in srgb, {surface.950}, transparent 96%)"}},dark:{info:{background:"color-mix(in srgb, {blue.500}, transparent 84%)",borderColor:"color-mix(in srgb, {blue.700}, transparent 64%)",color:"{blue.500}",shadow:"0px 4px 8px 0px color-mix(in srgb, {blue.500}, transparent 96%)"},success:{background:"color-mix(in srgb, {green.500}, transparent 84%)",borderColor:"color-mix(in srgb, {green.700}
4043, transparent 64%)",color:"{green.500}",shadow:"0px 4px 8px 0px color-mix(in srgb, {green.500}, transparent 96%)"},warn:{background:"color-mix(in srgb, {yellow.500}, transparent 84%)",borderColor:"color-mix(in srgb, {yellow.700}, transparent 64%)",color:"{yellow.500}",shadow:"0px 4px 8px 0px color-mix(in srgb, {yellow.500}, transparent 96%)"},error:{background:"color-mix(in srgb, {red.500}, transparent 84%)",borderColor:"color-mix(in srgb, {red.700}, transparent 64%)",color:"{red.500}",shadow:"0px 4px 8px 0px color-mix(in srgb, {red.500}, transparent 96%)"},secondary:{background:"{surface.800}",borderColor:"{surface.700}",color:"{surface.300}",shadow:"0px 4px 8px 0px color-mix(in srgb, {surface.500}, transparent 96%)"},contrast:{background:"{surface.0}",borderColor:"{surface.100}",color:"{surface.950}",shadow:"0px 4px 8px 0px color-mix(in srgb, {surface.950}, transparent 96%)"}}},_ve={root:fve,text:pve,icon:mve,colorScheme:gve},yve={padding:"{form.field.padding.y} {form.field.padding.x}",borderRadius:"{content.border.radius}",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"},transitionDuration:"{transition.duration}"},vve={hoverBackground:"{content.hover.background}",hoverColor:"{content.hover.color}"},bve={root:yve,display:vve},xve={background:"{form.field.background}",disabledBackground:"{form.field.disabled.background}",filledBackground:"{form.field.filled.background}",filledFocusBackground:"{form.field.filled.focus.background}",borderColor:"{form.field.border.color}",hoverBorderColor:"{form.field.hover.border.color}",focusBorderColor:"{form.field.focus.border.color}",invalidBorderColor:"{form.field.invalid.border.color}",color:"{form.field.color}",disabledColor:"{form.field.disabled.color}",placeholderColor:"{form.field.placeholder.color}",shadow:"{form.field.shadow}",paddingX:"{form.field.padding.x}",paddingY:"{form.field.padding.y}",borderRadius:"{form.field.border.radius}",focusRing:{width:"{form.field.focus.ring.width}",style:"{form.field.focus.ring.style}",color:"{form.field.focus.ring.color}",offset:"{form.field.focus.ring.offset}",shadow:"{form.field.focus.ring.shadow}"},transitionDuration:"{form.field.transition.duration}"},wve={borderRadius:"{border.radius.sm}"},Sve={light:{chip:{focusBackground:"{surface.200}",color:"{surface.800}"}},dark:{chip:{focusBackground:"{surface.700}",color:"{surface.0}"}}},Tve={root:xve,chip:wve,colorScheme:Sve},Eve={background:"{form.field.background}",borderColor:"{form.field.border.color}",color:"{form.field.icon.color}",borderRadius:"{form.field.border.radius}",padding:"0.5rem",minWidth:"2.5rem"},Cve={addon:Eve},Ave={transitionDuration:"{transition.duration}"},Ive={width:"2.5rem",borderRadius:"{form.field.border.radius}",verticalPadding:"{form.field.padding.y}"},Pve={light:{button:{background:"transparent",hoverBackground:"{surface.100}",activeBackground:"{surface.200}",borderColor:"{form.field.border.color}",hoverBorderColor:"{form.field.border.color}",activeBorderColor:"{form.field.border.color}",color:"{surface.400}",hoverColor:"{surface.500}",activeColor:"{surface.600}"}},dark:{button:{background:"transparent",hoverBackground:"{surface.800}",activeBackground:"{surface.700}",borderColor:"{form.field.border.color}",hoverBorderColor:"{form.field.border.color}",activeBorderColor:"{form.field.border.color}",color:"{surface.400}",hoverColor:"{surface.300}",activeColor:"{surface.200}"}}},Rve={root:Ave,button:Ive,colorScheme:Pve},kve={gap:"0.5rem"},Mve={width:"2.5rem",sm:{width:"2rem"},lg:{width:"3rem"}},Lve={root:kve,input:Mve},Ove={background:"{form.field.background}",disabledBackground:"{form.field.disabled.background}",filledBackground:"{form.field.filled.background}",filledHoverBackground:"{form.field.filled.hover.background}",filledFocusBackground:"{form.field.filled.focus.background}",borderColor:"{form.field.border.color}",hoverBorderColor:"{form.field.hover.border.color}",focusBorderColor:"{form.field.focus.border.color}",invalidBorderColor:"{form.field.invalid.border.color}",color:"{form.field.color}",disabledColor:"{form.field.disabled.color}",placeholderColor:"{form.field.placeholder.color}
4043",invalidPlaceholderColor:"{form.field.invalid.placeholder.color}",shadow:"{form.field.shadow}",paddingX:"{form.field.padding.x}",paddingY:"{form.field.padding.y}",borderRadius:"{form.field.border.radius}",focusRing:{width:"{form.field.focus.ring.width}",style:"{form.field.focus.ring.style}",color:"{form.field.focus.ring.color}",offset:"{form.field.focus.ring.offset}",shadow:"{form.field.focus.ring.shadow}"},transitionDuration:"{form.field.transition.duration}",sm:{fontSize:"{form.field.sm.font.size}",paddingX:"{form.field.sm.padding.x}",paddingY:"{form.field.sm.padding.y}"},lg:{fontSize:"{form.field.lg.font.size}",paddingX:"{form.field.lg.padding.x}",paddingY:"{form.field.lg.padding.y}"}},Dve={root:Ove},Fve={transitionDuration:"{transition.duration}",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"}},Bve={background:"{primary.color}"},zve={background:"{content.border.color}"},Nve={color:"{text.muted.color}"},Vve={root:Fve,value:Bve,range:zve,text:Nve},Uve={background:"{form.field.background}",disabledBackground:"{form.field.disabled.background}",borderColor:"{form.field.border.color}",invalidBorderColor:"{form.field.invalid.border.color}",color:"{form.field.color}",disabledColor:"{form.field.disabled.color}",shadow:"{form.field.shadow}",borderRadius:"{form.field.border.radius}",transitionDuration:"{form.field.transition.duration}"},$ve={padding:"{list.padding}",gap:"{list.gap}",header:{padding:"{list.header.padding}"}},jve={focusBackground:"{list.option.focus.background}",selectedBackground:"{list.option.selected.background}",selectedFocusBackground:"{list.option.selected.focus.background}",color:"{list.option.color}",focusColor:"{list.option.focus.color}",selectedColor:"{list.option.selected.color}",selectedFocusColor:"{list.option.selected.focus.color}",padding:"{list.option.padding}",borderRadius:"{list.option.border.radius}"},Gve={background:"{list.option.group.background}",color:"{list.option.group.color}",fontWeight:"{list.option.group.font.weight}",padding:"{list.option.group.padding}"},Hve={color:"{list.option.color}",gutterStart:"-0.375rem",gutterEnd:"0.375rem"},Wve={padding:"{list.option.padding}"},qve={light:{option:{stripedBackground:"{surface.50}"}},dark:{option:{stripedBackground:"{surface.900}"}}},Xve={root:Uve,list:$ve,option:jve,optionGroup:Gve,checkmark:Hve,emptyMessage:Wve,colorScheme:qve},Zve={background:"{content.background}",borderColor:"{content.border.color}",borderRadius:"{content.border.radius}",color:"{content.color}",gap:"0.5rem",verticalOrientation:{padding:"{navigation.list.padding}",gap:"{navigation.list.gap}"},horizontalOrientation:{padding:"0.5rem 0.75rem",gap:"0.5rem"},transitionDuration:"{transition.duration}"},Yve={borderRadius:"{content.border.radius}",padding:"{navigation.item.padding}"},Kve={focusBackground:"{navigation.item.focus.background}",activeBackground:"{navigation.item.active.background}",color:"{navigation.item.color}",focusColor:"{navigation.item.focus.color}",activeColor:"{navigation.item.active.color}",padding:"{navigation.item.padding}",borderRadius:"{navigation.item.border.radius}",gap:"{navigation.item.gap}",icon:{color:"{navigation.item.icon.color}",focusColor:"{navigation.item.icon.focus.color}",activeColor:"{navigation.item.icon.active.color}"}},Jve={padding:"0",background:"{content.background}",borderColor:"{content.border.color}",borderRadius:"{content.border.radius}",color:"{content.color}",shadow:"{overlay.navigation.shadow}",gap:"0.5rem"},Qve={padding:"{navigation.list.padding}",gap:"{navigation.list.gap}"},ebe={padding:"{navigation.submenu.label.padding}",fontWeight:"{navigation.submenu.label.font.weight}",background:"{navigation.submenu.label.background}",color:"{navigation.submenu.label.color}"},tbe={size:"{navigation.submenu.icon.size}",color:"{navigation.submenu.icon.color}",focusColor:"{navigation.submenu.icon.focus.color}",activeColor:"{navigation.submenu.icon.active.color}"},nbe={borderColor:"{content.border.color}"},rbe={borderRadius:"50%",size:"1.75rem",color:"{text.muted.color}",hoverColor:"{text.hover.muted.color}
4043",hoverBackground:"{content.hover.background}",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"}},ibe={root:Zve,baseItem:Yve,item:Kve,overlay:Jve,submenu:Qve,submenuLabel:ebe,submenuIcon:tbe,separator:nbe,mobileButton:rbe},obe={background:"{content.background}",borderColor:"{content.border.color}",color:"{content.color}",borderRadius:"{content.border.radius}",shadow:"{overlay.navigation.shadow}",transitionDuration:"{transition.duration}"},sbe={padding:"{navigation.list.padding}",gap:"{navigation.list.gap}"},abe={focusBackground:"{navigation.item.focus.background}",color:"{navigation.item.color}",focusColor:"{navigation.item.focus.color}",padding:"{navigation.item.padding}",borderRadius:"{navigation.item.border.radius}",gap:"{navigation.item.gap}",icon:{color:"{navigation.item.icon.color}",focusColor:"{navigation.item.icon.focus.color}"}},lbe={padding:"{navigation.submenu.label.padding}",fontWeight:"{navigation.submenu.label.font.weight}",background:"{navigation.submenu.label.background}",color:"{navigation.submenu.label.color}"},cbe={borderColor:"{content.border.color}"},ube={root:obe,list:sbe,item:abe,submenuLabel:lbe,separator:cbe},dbe={background:"{content.background}",borderColor:"{content.border.color}",borderRadius:"{content.border.radius}",color:"{content.color}",gap:"0.5rem",padding:"0.5rem 0.75rem",transitionDuration:"{transition.duration}"},hbe={borderRadius:"{content.border.radius}",padding:"{navigation.item.padding}"},fbe={focusBackground:"{navigation.item.focus.background}",activeBackground:"{navigation.item.active.background}",color:"{navigation.item.color}",focusColor:"{navigation.item.focus.color}",activeColor:"{navigation.item.active.color}",padding:"{navigation.item.padding}",borderRadius:"{navigation.item.border.radius}",gap:"{navigation.item.gap}",icon:{color:"{navigation.item.icon.color}",focusColor:"{navigation.item.icon.focus.color}",activeColor:"{navigation.item.icon.active.color}"}},pbe={padding:"{navigation.list.padding}",gap:"{navigation.list.gap}",background:"{content.background}",borderColor:"{content.border.color}",borderRadius:"{content.border.radius}",shadow:"{overlay.navigation.shadow}",mobileIndent:"1rem",icon:{size:"{navigation.submenu.icon.size}",color:"{navigation.submenu.icon.color}",focusColor:"{navigation.submenu.icon.focus.color}",activeColor:"{navigation.submenu.icon.active.color}"}},mbe={borderColor:"{content.border.color}"},gbe={borderRadius:"50%",size:"1.75rem",color:"{text.muted.color}",hoverColor:"{text.hover.muted.color}",hoverBackground:"{content.hover.background}",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"}},_be={root:dbe,baseItem:hbe,item:fbe,submenu:pbe,separator:mbe,mobileButton:gbe},ybe={borderRadius:"{content.border.radius}",borderWidth:"1px",transitionDuration:"{transition.duration}"},vbe={padding:"0.5rem 0.75rem",gap:"0.5rem",sm:{padding:"0.375rem 0.625rem"},lg:{padding:"0.625rem 0.875rem"}},bbe={fontSize:"1rem",fontWeight:"500",sm:{fontSize:"0.875rem"},lg:{fontSize:"1.125rem"}},xbe={size:"1.125rem",sm:{size:"1rem"},lg:{size:"1.25rem"}},wbe={width:"1.75rem",height:"1.75rem",borderRadius:"50%",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",offset:"{focus.ring.offset}"}},Sbe={size:"1rem",sm:{size:"0.875rem"},lg:{size:"1.125rem"}},Tbe={root:{borderWidth:"1px"}},Ebe={content:{padding:"0"}},Cbe={light:{info:{background:"color-mix(in srgb, {blue.50}, transparent 5%)",borderColor:"{blue.200}",color:"{blue.600}",shadow:"0px 4px 8px 0px color-mix(in srgb, {blue.500}, transparent 96%)",closeButton:{hoverBackground:"{blue.100}",focusRing:{color:"{blue.600}",shadow:"none"}},outlined:{color:"{blue.600}",borderColor:"{blue.600}"},simple:{color:"{blue.600}"}},success:{background:"color-mix(in srgb, {green.50}, transparent 5%)",borderColor:"{green.200}",color:"{green.600}",shadow:"0px 4px 8px 0px color-mix(in srgb, {green.500}
4043, transparent 96%)",closeButton:{hoverBackground:"{green.100}",focusRing:{color:"{green.600}",shadow:"none"}},outlined:{color:"{green.600}",borderColor:"{green.600}"},simple:{color:"{green.600}"}},warn:{background:"color-mix(in srgb,{yellow.50}, transparent 5%)",borderColor:"{yellow.200}",color:"{yellow.600}",shadow:"0px 4px 8px 0px color-mix(in srgb, {yellow.500}, transparent 96%)",closeButton:{hoverBackground:"{yellow.100}",focusRing:{color:"{yellow.600}",shadow:"none"}},outlined:{color:"{yellow.600}",borderColor:"{yellow.600}"},simple:{color:"{yellow.600}"}},error:{background:"color-mix(in srgb, {red.50}, transparent 5%)",borderColor:"{red.200}",color:"{red.600}",shadow:"0px 4px 8px 0px color-mix(in srgb, {red.500}, transparent 96%)",closeButton:{hoverBackground:"{red.100}",focusRing:{color:"{red.600}",shadow:"none"}},outlined:{color:"{red.600}",borderColor:"{red.600}"},simple:{color:"{red.600}"}},secondary:{background:"{surface.100}",borderColor:"{surface.200}",color:"{surface.600}",shadow:"0px 4px 8px 0px color-mix(in srgb, {surface.500}, transparent 96%)",closeButton:{hoverBackground:"{surface.200}",focusRing:{color:"{surface.600}",shadow:"none"}},outlined:{color:"{surface.500}",borderColor:"{surface.500}"},simple:{color:"{surface.500}"}},contrast:{background:"{surface.900}",borderColor:"{surface.950}",color:"{surface.50}",shadow:"0px 4px 8px 0px color-mix(in srgb, {surface.950}, transparent 96%)",closeButton:{hoverBackground:"{surface.800}",focusRing:{color:"{surface.50}",shadow:"none"}},outlined:{color:"{surface.950}",borderColor:"{surface.950}"},simple:{color:"{surface.950}"}}},dark:{info:{background:"color-mix(in srgb, {blue.500}, transparent 84%)",borderColor:"color-mix(in srgb, {blue.700}, transparent 64%)",color:"{blue.500}",shadow:"0px 4px 8px 0px color-mix(in srgb, {blue.500}, transparent 96%)",closeButton:{hoverBackground:"rgba(255, 255, 255, 0.05)",focusRing:{color:"{blue.500}",shadow:"none"}},outlined:{color:"{blue.500}",borderColor:"{blue.500}"},simple:{color:"{blue.500}"}},success:{background:"color-mix(in srgb, {green.500}, transparent 84%)",borderColor:"color-mix(in srgb, {green.700}, transparent 64%)",color:"{green.500}",shadow:"0px 4px 8px 0px color-mix(in srgb, {green.500}, transparent 96%)",closeButton:{hoverBackground:"rgba(255, 255, 255, 0.05)",focusRing:{color:"{green.500}",shadow:"none"}},outlined:{color:"{green.500}",borderColor:"{green.500}"},simple:{color:"{green.500}"}},warn:{background:"color-mix(in srgb, {yellow.500}, transparent 84%)",borderColor:"color-mix(in srgb, {yellow.700}, transparent 64%)",color:"{yellow.500}",shadow:"0px 4px 8px 0px color-mix(in srgb, {yellow.500}, transparent 96%)",closeButton:{hoverBackground:"rgba(255, 255, 255, 0.05)",focusRing:{color:"{yellow.500}",shadow:"none"}},outlined:{color:"{yellow.500}",borderColor:"{yellow.500}"},simple:{color:"{yellow.500}"}},error:{background:"color-mix(in srgb, {red.500}, transparent 84%)",borderColor:"color-mix(in srgb, {red.700}, transparent 64%)",color:"{red.500}",shadow:"0px 4px 8px 0px color-mix(in srgb, {red.500}, transparent 96%)",closeButton:{hoverBackground:"rgba(255, 255, 255, 0.05)",focusRing:{color:"{red.500}",shadow:"none"}},outlined:{color:"{red.500}",borderColor:"{red.500}"},simple:{color:"{red.500}"}},secondary:{background:"{surface.800}",borderColor:"{surface.700}",color:"{surface.300}",shadow:"0px 4px 8px 0px color-mix(in srgb, {surface.500}, transparent 96%)",closeButton:{hoverBackground:"{surface.700}",focusRing:{color:"{surface.300}",shadow:"none"}},outlined:{color:"{surface.400}",borderColor:"{surface.400}"},simple:{color:"{surface.400}"}},contrast:{background:"{surface.0}",borderColor:"{surface.100}",color:"{surface.950}",shadow:"0px 4px 8px 0px color-mix(in srgb, {surface.950}, transparent 96%)",closeButton:{hoverBackground:"{surface.100}",focusRing:{color:"{surface.950}",shadow:"none"}},outlined:{color:"{surface.0}",borderColor:"{surface.0}"},simple:{color:"{surface.0}"}}}},Abe={root:ybe,content:vbe,text:bbe,icon:xbe,closeButton:wbe,closeIcon:Sbe,outlined:Tbe,simple:Ebe,colorScheme:Cbe}
4043,Ibe={borderRadius:"{content.border.radius}",gap:"1rem"},Pbe={background:"{content.border.color}",size:"0.5rem"},Rbe={gap:"0.5rem"},kbe={size:"0.5rem"},Mbe={size:"1rem"},Lbe={verticalGap:"0.5rem",horizontalGap:"1rem"},Obe={root:Ibe,meters:Pbe,label:Rbe,labelMarker:kbe,labelIcon:Mbe,labelList:Lbe},Dbe={background:"{form.field.background}",disabledBackground:"{form.field.disabled.background}",filledBackground:"{form.field.filled.background}",filledHoverBackground:"{form.field.filled.hover.background}",filledFocusBackground:"{form.field.filled.focus.background}",borderColor:"{form.field.border.color}",hoverBorderColor:"{form.field.hover.border.color}",focusBorderColor:"{form.field.focus.border.color}",invalidBorderColor:"{form.field.invalid.border.color}",color:"{form.field.color}",disabledColor:"{form.field.disabled.color}",placeholderColor:"{form.field.placeholder.color}",invalidPlaceholderColor:"{form.field.invalid.placeholder.color}",shadow:"{form.field.shadow}",paddingX:"{form.field.padding.x}",paddingY:"{form.field.padding.y}",borderRadius:"{form.field.border.radius}",focusRing:{width:"{form.field.focus.ring.width}",style:"{form.field.focus.ring.style}",color:"{form.field.focus.ring.color}",offset:"{form.field.focus.ring.offset}",shadow:"{form.field.focus.ring.shadow}"},transitionDuration:"{form.field.transition.duration}",sm:{fontSize:"{form.field.sm.font.size}",paddingX:"{form.field.sm.padding.x}",paddingY:"{form.field.sm.padding.y}"},lg:{fontSize:"{form.field.lg.font.size}",paddingX:"{form.field.lg.padding.x}",paddingY:"{form.field.lg.padding.y}"}},Fbe={width:"2.5rem",color:"{form.field.icon.color}"},Bbe={background:"{overlay.select.background}",borderColor:"{overlay.select.border.color}",borderRadius:"{overlay.select.border.radius}",color:"{overlay.select.color}",shadow:"{overlay.select.shadow}"},zbe={padding:"{list.padding}",gap:"{list.gap}",header:{padding:"{list.header.padding}"}},Nbe={focusBackground:"{list.option.focus.background}",selectedBackground:"{list.option.selected.background}",selectedFocusBackground:"{list.option.selected.focus.background}",color:"{list.option.color}",focusColor:"{list.option.focus.color}",selectedColor:"{list.option.selected.color}",selectedFocusColor:"{list.option.selected.focus.color}",padding:"{list.option.padding}",borderRadius:"{list.option.border.radius}",gap:"0.5rem"},Vbe={background:"{list.option.group.background}",color:"{list.option.group.color}",fontWeight:"{list.option.group.font.weight}",padding:"{list.option.group.padding}"},Ube={color:"{form.field.icon.color}"},$be={borderRadius:"{border.radius.sm}"},jbe={padding:"{list.option.padding}"},Gbe={root:Dbe,dropdown:Fbe,overlay:Bbe,list:zbe,option:Nbe,optionGroup:Vbe,chip:$be,clearIcon:Ube,emptyMessage:jbe},Hbe={gap:"1.125rem"},Wbe={gap:"0.5rem"},qbe={root:Hbe,controls:Wbe},Xbe={gutter:"0.75rem",transitionDuration:"{transition.duration}"},Zbe={background:"{content.background}",hoverBackground:"{content.hover.background}",selectedBackground:"{highlight.background}",borderColor:"{content.border.color}",color:"{content.color}",selectedColor:"{highlight.color}",hoverColor:"{content.hover.color}",padding:"0.75rem 1rem",toggleablePadding:"0.75rem 1rem 1.25rem 1rem",borderRadius:"{content.border.radius}"},Ybe={background:"{content.background}",hoverBackground:"{content.hover.background}",borderColor:"{content.border.color}",color:"{text.muted.color}",hoverColor:"{text.color}",size:"1.5rem",borderRadius:"50%",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"}},Kbe={color:"{content.border.color}",borderRadius:"{content.border.radius}",height:"24px"},Jbe={root:Xbe,node:Zbe,nodeToggleButton:Ybe,connector:Kbe},Qbe={outline:{width:"2px",color:"{content.background}"}},exe={root:Qbe},txe={padding:"0.5rem 1rem",gap:"0.25rem",borderRadius:"{content.border.radius}",background:"{content.background}",color:"{content.color}",transitionDuration:"{transition.duration}"},nxe={background:"transparent",hoverBackground:"{content.hover.background}
4043",selectedBackground:"{highlight.background}",color:"{text.muted.color}",hoverColor:"{text.hover.muted.color}",selectedColor:"{highlight.color}",width:"2.5rem",height:"2.5rem",borderRadius:"50%",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"}},rxe={color:"{text.muted.color}"},ixe={maxWidth:"2.5rem"},oxe={root:txe,navButton:nxe,currentPageReport:rxe,jumpToPageInput:ixe},sxe={background:"{content.background}",borderColor:"{content.border.color}",color:"{content.color}",borderRadius:"{content.border.radius}"},axe={background:"transparent",color:"{text.color}",padding:"1.125rem",borderColor:"{content.border.color}",borderWidth:"0",borderRadius:"0"},lxe={padding:"0.375rem 1.125rem"},cxe={fontWeight:"600"},uxe={padding:"0 1.125rem 1.125rem 1.125rem"},dxe={padding:"0 1.125rem 1.125rem 1.125rem"},hxe={root:sxe,header:axe,toggleableHeader:lxe,title:cxe,content:uxe,footer:dxe},fxe={gap:"0.5rem",transitionDuration:"{transition.duration}"},pxe={background:"{content.background}",borderColor:"{content.border.color}",borderWidth:"1px",color:"{content.color}",padding:"0.25rem 0.25rem",borderRadius:"{content.border.radius}",first:{borderWidth:"1px",topBorderRadius:"{content.border.radius}"},last:{borderWidth:"1px",bottomBorderRadius:"{content.border.radius}"}},mxe={focusBackground:"{navigation.item.focus.background}",color:"{navigation.item.color}",focusColor:"{navigation.item.focus.color}",gap:"0.5rem",padding:"{navigation.item.padding}",borderRadius:"{content.border.radius}",icon:{color:"{navigation.item.icon.color}",focusColor:"{navigation.item.icon.focus.color}"}},gxe={indent:"1rem"},_xe={color:"{navigation.submenu.icon.color}",focusColor:"{navigation.submenu.icon.focus.color}"},yxe={root:fxe,panel:pxe,item:mxe,submenu:gxe,submenuIcon:_xe},vxe={background:"{content.border.color}",borderRadius:"{content.border.radius}",height:".75rem"},bxe={color:"{form.field.icon.color}"},xxe={background:"{overlay.popover.background}",borderColor:"{overlay.popover.border.color}",borderRadius:"{overlay.popover.border.radius}",color:"{overlay.popover.color}",padding:"{overlay.popover.padding}",shadow:"{overlay.popover.shadow}"},wxe={gap:"0.5rem"},Sxe={light:{strength:{weakBackground:"{red.500}",mediumBackground:"{amber.500}",strongBackground:"{green.500}"}},dark:{strength:{weakBackground:"{red.400}",mediumBackground:"{amber.400}",strongBackground:"{green.400}"}}},Txe={meter:vxe,icon:bxe,overlay:xxe,content:wxe,colorScheme:Sxe},Exe={gap:"1.125rem"},Cxe={gap:"0.5rem"},Axe={root:Exe,controls:Cxe},Ixe={background:"{overlay.popover.background}",borderColor:"{overlay.popover.border.color}",color:"{overlay.popover.color}",borderRadius:"{overlay.popover.border.radius}",shadow:"{overlay.popover.shadow}",gutter:"10px",arrowOffset:"1.25rem"},Pxe={padding:"{overlay.popover.padding}"},Rxe={root:Ixe,content:Pxe},kxe={background:"{content.border.color}",borderRadius:"{content.border.radius}",height:"1.25rem"},Mxe={background:"{primary.color}"},Lxe={color:"{primary.contrast.color}",fontSize:"0.75rem",fontWeight:"600"},Oxe={root:kxe,value:Mxe,label:Lxe},Dxe={light:{root:{colorOne:"{red.500}",colorTwo:"{blue.500}",colorThree:"{green.500}",colorFour:"{yellow.500}"}},dark:{root:{colorOne:"{red.400}",colorTwo:"{blue.400}",colorThree:"{green.400}",colorFour:"{yellow.400}"}}},Fxe={colorScheme:Dxe},Bxe={width:"1.25rem",height:"1.25rem",background:"{form.field.background}",checkedBackground:"{primary.color}",checkedHoverBackground:"{primary.hover.color}",disabledBackground:"{form.field.disabled.background}",filledBackground:"{form.field.filled.background}",borderColor:"{form.field.border.color}",hoverBorderColor:"{form.field.hover.border.color}",focusBorderColor:"{form.field.border.color}",checkedBorderColor:"{primary.color}",checkedHoverBorderColor:"{primary.hover.color}",checkedFocusBorderColor:"{primary.color}",checkedDisabledBorderColor:"{form.field.border.color}",invalidBorderColor:"{form.field.invalid.border.color}",shadow:"{form.field.shadow}",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"},transitionDuration:"{form.field.transition.duration}
4043",sm:{width:"1rem",height:"1rem"},lg:{width:"1.5rem",height:"1.5rem"}},zxe={size:"0.75rem",checkedColor:"{primary.contrast.color}",checkedHoverColor:"{primary.contrast.color}",disabledColor:"{form.field.disabled.color}",sm:{size:"0.5rem"},lg:{size:"1rem"}},Nxe={root:Bxe,icon:zxe},Vxe={gap:"0.25rem",transitionDuration:"{transition.duration}",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"}},Uxe={size:"1rem",color:"{text.muted.color}",hoverColor:"{primary.color}",activeColor:"{primary.color}"},$xe={root:Vxe,icon:Uxe},jxe={light:{root:{background:"rgba(0,0,0,0.1)"}},dark:{root:{background:"rgba(255,255,255,0.3)"}}},Gxe={colorScheme:jxe},Hxe={transitionDuration:"{transition.duration}"},Wxe={size:"9px",borderRadius:"{border.radius.sm}",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"}},qxe={light:{bar:{background:"{surface.100}"}},dark:{bar:{background:"{surface.800}"}}},Xxe={root:Hxe,bar:Wxe,colorScheme:qxe},Zxe={background:"{form.field.background}",disabledBackground:"{form.field.disabled.background}",filledBackground:"{form.field.filled.background}",filledHoverBackground:"{form.field.filled.hover.background}",filledFocusBackground:"{form.field.filled.focus.background}",borderColor:"{form.field.border.color}",hoverBorderColor:"{form.field.hover.border.color}",focusBorderColor:"{form.field.focus.border.color}",invalidBorderColor:"{form.field.invalid.border.color}",color:"{form.field.color}",disabledColor:"{form.field.disabled.color}",placeholderColor:"{form.field.placeholder.color}",invalidPlaceholderColor:"{form.field.invalid.placeholder.color}",shadow:"{form.field.shadow}",paddingX:"{form.field.padding.x}",paddingY:"{form.field.padding.y}",borderRadius:"{form.field.border.radius}",focusRing:{width:"{form.field.focus.ring.width}",style:"{form.field.focus.ring.style}",color:"{form.field.focus.ring.color}",offset:"{form.field.focus.ring.offset}",shadow:"{form.field.focus.ring.shadow}"},transitionDuration:"{form.field.transition.duration}",sm:{fontSize:"{form.field.sm.font.size}",paddingX:"{form.field.sm.padding.x}",paddingY:"{form.field.sm.padding.y}"},lg:{fontSize:"{form.field.lg.font.size}",paddingX:"{form.field.lg.padding.x}",paddingY:"{form.field.lg.padding.y}"}},Yxe={width:"2.5rem",color:"{form.field.icon.color}"},Kxe={background:"{overlay.select.background}",borderColor:"{overlay.select.border.color}",borderRadius:"{overlay.select.border.radius}",color:"{overlay.select.color}",shadow:"{overlay.select.shadow}"},Jxe={padding:"{list.padding}",gap:"{list.gap}",header:{padding:"{list.header.padding}"}},Qxe={focusBackground:"{list.option.focus.background}",selectedBackground:"{list.option.selected.background}",selectedFocusBackground:"{list.option.selected.focus.background}",color:"{list.option.color}",focusColor:"{list.option.focus.color}",selectedColor:"{list.option.selected.color}",selectedFocusColor:"{list.option.selected.focus.color}",padding:"{list.option.padding}",borderRadius:"{list.option.border.radius}"},e1e={background:"{list.option.group.background}",color:"{list.option.group.color}",fontWeight:"{list.option.group.font.weight}",padding:"{list.option.group.padding}"},t1e={color:"{form.field.icon.color}"},n1e={color:"{list.option.color}",gutterStart:"-0.375rem",gutterEnd:"0.375rem"},r1e={padding:"{list.option.padding}"},i1e={root:Zxe,dropdown:Yxe,overlay:Kxe,list:Jxe,option:Qxe,optionGroup:e1e,clearIcon:t1e,checkmark:n1e,emptyMessage:r1e},o1e={borderRadius:"{form.field.border.radius}"},s1e={light:{root:{invalidBorderColor:"{form.field.invalid.border.color}"}},dark:{root:{invalidBorderColor:"{form.field.invalid.border.color}"}}},a1e={root:o1e,colorScheme:s1e},l1e={borderRadius:"{content.border.radius}"},c1e={light:{root:{background:"{surface.200}",animationBackground:"rgba(255,255,255,0.4)"}},dark:{root:{background:"rgba(255, 255, 255, 0.06)",animationBackground:"rgba(255, 255, 255, 0.04)"}}},u1e={root:l1e,colorScheme:c1e},d1e={transitionDuration:"{transition.duration}"},h1e={background:"{content.border.color}
4043",borderRadius:"{content.border.radius}",size:"3px"},f1e={background:"{primary.color}"},p1e={width:"20px",height:"20px",borderRadius:"50%",background:"{content.border.color}",hoverBackground:"{content.border.color}",content:{borderRadius:"50%",hoverBackground:"{content.background}",width:"16px",height:"16px",shadow:"0px 0.5px 0px 0px rgba(0, 0, 0, 0.08), 0px 1px 1px 0px rgba(0, 0, 0, 0.14)"},focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"}},m1e={light:{handle:{content:{background:"{surface.0}"}}},dark:{handle:{content:{background:"{surface.950}"}}}},g1e={root:d1e,track:h1e,range:f1e,handle:p1e,colorScheme:m1e},_1e={gap:"0.5rem",transitionDuration:"{transition.duration}"},y1e={root:_1e},v1e={borderRadius:"{form.field.border.radius}",roundedBorderRadius:"2rem",raisedShadow:"0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)"},b1e={root:v1e},x1e={background:"{content.background}",borderColor:"{content.border.color}",color:"{content.color}",transitionDuration:"{transition.duration}"},w1e={background:"{content.border.color}"},S1e={size:"24px",background:"transparent",borderRadius:"{content.border.radius}",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"}},T1e={root:x1e,gutter:w1e,handle:S1e},E1e={transitionDuration:"{transition.duration}"},C1e={background:"{content.border.color}",activeBackground:"{primary.color}",margin:"0 0 0 1.625rem",size:"2px"},A1e={padding:"0.5rem",gap:"1rem"},I1e={padding:"0",borderRadius:"{content.border.radius}",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"},gap:"0.5rem"},P1e={color:"{text.muted.color}",activeColor:"{primary.color}",fontWeight:"500"},R1e={background:"{content.background}",activeBackground:"{content.background}",borderColor:"{content.border.color}",activeBorderColor:"{content.border.color}",color:"{text.muted.color}",activeColor:"{primary.color}",size:"2rem",fontSize:"1.143rem",fontWeight:"500",borderRadius:"50%",shadow:"0px 0.5px 0px 0px rgba(0, 0, 0, 0.06), 0px 1px 1px 0px rgba(0, 0, 0, 0.12)"},k1e={padding:"0.875rem 0.5rem 1.125rem 0.5rem"},M1e={background:"{content.background}",color:"{content.color}",padding:"0",indent:"1rem"},L1e={root:E1e,separator:C1e,step:A1e,stepHeader:I1e,stepTitle:P1e,stepNumber:R1e,steppanels:k1e,steppanel:M1e},O1e={transitionDuration:"{transition.duration}"},D1e={background:"{content.border.color}"},F1e={borderRadius:"{content.border.radius}",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"},gap:"0.5rem"},B1e={color:"{text.muted.color}",activeColor:"{primary.color}",fontWeight:"500"},z1e={background:"{content.background}",activeBackground:"{content.background}",borderColor:"{content.border.color}",activeBorderColor:"{content.border.color}",color:"{text.muted.color}",activeColor:"{primary.color}",size:"2rem",fontSize:"1.143rem",fontWeight:"500",borderRadius:"50%",shadow:"0px 0.5px 0px 0px rgba(0, 0, 0, 0.06), 0px 1px 1px 0px rgba(0, 0, 0, 0.12)"},N1e={root:O1e,separator:D1e,itemLink:F1e,itemLabel:B1e,itemNumber:z1e},V1e={transitionDuration:"{transition.duration}"},U1e={borderWidth:"0 0 1px 0",background:"{content.background}",borderColor:"{content.border.color}"},$1e={background:"transparent",hoverBackground:"transparent",activeBackground:"transparent",borderWidth:"0 0 1px 0",borderColor:"{content.border.color}",hoverBorderColor:"{content.border.color}",activeBorderColor:"{primary.color}",color:"{text.muted.color}",hoverColor:"{text.color}",activeColor:"{primary.color}",padding:"1rem 1.125rem",fontWeight:"600",margin:"0 0 -1px 0",gap:"0.5rem",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"}},j1e={color:"{text.muted.color}",hoverColor:"{text.color}",activeColor:"{primary.color}"},G1e={height:"1px",bottom:"-1px",background:"{primary.color}"},H1e={root:V1e,tablist:U1e,item:$1e,itemIcon:j1e,activeBar:G1e},W1e={transitionDuration:"{transition.duration}"},q1e={borderWidth:"0 0 1px 0",background:"{content.background}",borderColor:"{content.border.color}"}
4043,X1e={background:"transparent",hoverBackground:"transparent",activeBackground:"transparent",borderWidth:"0 0 1px 0",borderColor:"{content.border.color}",hoverBorderColor:"{content.border.color}",activeBorderColor:"{primary.color}",color:"{text.muted.color}",hoverColor:"{text.color}",activeColor:"{primary.color}",padding:"1rem 1.125rem",fontWeight:"600",margin:"0 0 -1px 0",gap:"0.5rem",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"-1px",shadow:"{focus.ring.shadow}"}},Z1e={background:"{content.background}",color:"{content.color}",padding:"0.875rem 1.125rem 1.125rem 1.125rem",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"inset {focus.ring.shadow}"}},Y1e={background:"{content.background}",color:"{text.muted.color}",hoverColor:"{text.color}",width:"2.5rem",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"-1px",shadow:"{focus.ring.shadow}"}},K1e={height:"1px",bottom:"-1px",background:"{primary.color}"},J1e={light:{navButton:{shadow:"0px 0px 10px 50px rgba(255, 255, 255, 0.6)"}},dark:{navButton:{shadow:"0px 0px 10px 50px color-mix(in srgb, {content.background}, transparent 50%)"}}},Q1e={root:W1e,tablist:q1e,tab:X1e,tabpanel:Z1e,navButton:Y1e,activeBar:K1e,colorScheme:J1e},ewe={transitionDuration:"{transition.duration}"},twe={background:"{content.background}",borderColor:"{content.border.color}"},nwe={borderColor:"{content.border.color}",activeBorderColor:"{primary.color}",color:"{text.muted.color}",hoverColor:"{text.color}",activeColor:"{primary.color}"},rwe={background:"{content.background}",color:"{content.color}"},iwe={background:"{content.background}",color:"{text.muted.color}",hoverColor:"{text.color}"},owe={light:{navButton:{shadow:"0px 0px 10px 50px rgba(255, 255, 255, 0.6)"}},dark:{navButton:{shadow:"0px 0px 10px 50px color-mix(in srgb, {content.background}, transparent 50%)"}}},swe={root:ewe,tabList:twe,tab:nwe,tabPanel:rwe,navButton:iwe,colorScheme:owe},awe={fontSize:"0.875rem",fontWeight:"700",padding:"0.25rem 0.5rem",gap:"0.25rem",borderRadius:"{content.border.radius}",roundedBorderRadius:"{border.radius.xl}"},lwe={size:"0.75rem"},cwe={light:{primary:{background:"{primary.100}",color:"{primary.700}
4043"},secondary:{background:"{surface.100}",color:"{surface.600}"},success:{background:"{green.100}",color:"{green.700}"},info:{background:"{sky.100}",color:"{sky.700}"},warn:{background:"{orange.100}",color:"{orange.700}"},danger:{background:"{red.100}",color:"{red.700}"},contrast:{background:"{surface.950}",color:"{surface.0}"}},dark:{primary:{background:"color-mix(in srgb, {primary.500}, transparent 84%)",color:"{primary.300}"},secondary:{background:"{surface.800}",color:"{surface.300}"},success:{background:"color-mix(in srgb, {green.500}, transparent 84%)",color:"{green.300}"},info:{background:"color-mix(in srgb, {sky.500}, transparent 84%)",color:"{sky.300}"},warn:{background:"color-mix(in srgb, {orange.500}, transparent 84%)",color:"{orange.300}"},danger:{background:"color-mix(in srgb, {red.500}, transparent 84%)",color:"{red.300}"},contrast:{background:"{surface.0}",color:"{surface.950}"}}},uwe={root:awe,icon:lwe,colorScheme:cwe},dwe={background:"{form.field.background}",borderColor:"{form.field.border.color}",color:"{form.field.color}",height:"18rem",padding:"{form.field.padding.y} {form.field.padding.x}",borderRadius:"{form.field.border.radius}"},hwe={gap:"0.25rem"},fwe={margin:"2px 0"},pwe={root:dwe,prompt:hwe,commandResponse:fwe},mwe={background:"{form.field.background}",disabledBackground:"{form.field.disabled.background}",filledBackground:"{form.field.filled.background}",filledHoverBackground:"{form.field.filled.hover.background}",filledFocusBackground:"{form.field.filled.focus.background}",borderColor:"{form.field.border.color}",hoverBorderColor:"{form.field.hover.border.color}",focusBorderColor:"{form.field.focus.border.color}",invalidBorderColor:"{form.field.invalid.border.color}",color:"{form.field.color}",disabledColor:"{form.field.disabled.color}",placeholderColor:"{form.field.placeholder.color}",invalidPlaceholderColor:"{form.field.invalid.placeholder.color}",shadow:"{form.field.shadow}",paddingX:"{form.field.padding.x}",paddingY:"{form.field.padding.y}",borderRadius:"{form.field.border.radius}",focusRing:{width:"{form.field.focus.ring.width}",style:"{form.field.focus.ring.style}",color:"{form.field.focus.ring.color}",offset:"{form.field.focus.ring.offset}",shadow:"{form.field.focus.ring.shadow}"},transitionDuration:"{form.field.transition.duration}",sm:{fontSize:"{form.field.sm.font.size}",paddingX:"{form.field.sm.padding.x}",paddingY:"{form.field.sm.padding.y}"},lg:{fontSize:"{form.field.lg.font.size}",paddingX:"{form.field.lg.padding.x}",paddingY:"{form.field.lg.padding.y}"}},gwe={root:mwe},_we={background:"{content.background}",borderColor:"{content.border.color}",color:"{content.color}",borderRadius:"{content.border.radius}",shadow:"{overlay.navigation.shadow}",transitionDuration:"{transition.duration}"},ywe={padding:"{navigation.list.padding}",gap:"{navigation.list.gap}"},vwe={focusBackground:"{navigation.item.focus.background}",activeBackground:"{navigation.item.active.background}",color:"{navigation.item.color}",focusColor:"{navigation.item.focus.color}",activeColor:"{navigation.item.active.color}",padding:"{navigation.item.padding}",borderRadius:"{navigation.item.border.radius}",gap:"{navigation.item.gap}",icon:{color:"{navigation.item.icon.color}",focusColor:"{navigation.item.icon.focus.color}",activeColor:"{navigation.item.icon.active.color}"}},bwe={mobileIndent:"1rem"},xwe={size:"{navigation.submenu.icon.size}",color:"{navigation.submenu.icon.color}",focusColor:"{navigation.submenu.icon.focus.color}",activeColor:"{navigation.submenu.icon.active.color}"},wwe={borderColor:"{content.border.color}"},Swe={root:_we,list:ywe,item:vwe,submenu:bwe,submenuIcon:xwe,separator:wwe},Twe={minHeight:"5rem"},Ewe={eventContent:{padding:"1rem 0"}},Cwe={eventContent:{padding:"0 1rem"}},Awe={size:"1.125rem",borderRadius:"50%",borderWidth:"2px",background:"{content.background}",borderColor:"{content.border.color}",content:{borderRadius:"50%",size:"0.375rem",background:"{primary.color}",insetShadow:"0px 0.5px 0px 0px rgba(0, 0, 0, 0.06), 0px 1px 1px 0px rgba(0, 0, 0, 0.12)"}},Iwe={color:"{content.border.color}",size:"2px"},Pwe={event:Twe,horizontal:Ewe,vertical:Cwe,eventMarker:Awe,eventConnector:Iwe}
4043,Rwe={width:"25rem",borderRadius:"{content.border.radius}",borderWidth:"1px",transitionDuration:"{transition.duration}"},kwe={size:"1.125rem"},Mwe={padding:"{overlay.popover.padding}",gap:"0.5rem"},Lwe={gap:"0.5rem"},Owe={fontWeight:"500",fontSize:"1rem"},Dwe={fontWeight:"500",fontSize:"0.875rem"},Fwe={width:"1.75rem",height:"1.75rem",borderRadius:"50%",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",offset:"{focus.ring.offset}"}},Bwe={size:"1rem"},zwe={light:{root:{blur:"1.5px"},info:{background:"color-mix(in srgb, {blue.50}, transparent 5%)",borderColor:"{blue.200}",color:"{blue.600}",detailColor:"{surface.700}",shadow:"0px 4px 8px 0px color-mix(in srgb, {blue.500}, transparent 96%)",closeButton:{hoverBackground:"{blue.100}",focusRing:{color:"{blue.600}",shadow:"none"}}},success:{background:"color-mix(in srgb, {green.50}, transparent 5%)",borderColor:"{green.200}",color:"{green.600}",detailColor:"{surface.700}",shadow:"0px 4px 8px 0px color-mix(in srgb, {green.500}, transparent 96%)",closeButton:{hoverBackground:"{green.100}",focusRing:{color:"{green.600}",shadow:"none"}}},warn:{background:"color-mix(in srgb,{yellow.50}, transparent 5%)",borderColor:"{yellow.200}",color:"{yellow.600}",detailColor:"{surface.700}",shadow:"0px 4px 8px 0px color-mix(in srgb, {yellow.500}, transparent 96%)",closeButton:{hoverBackground:"{yellow.100}",focusRing:{color:"{yellow.600}",shadow:"none"}}},error:{background:"color-mix(in srgb, {red.50}, transparent 5%)",borderColor:"{red.200}",color:"{red.600}",detailColor:"{surface.700}",shadow:"0px 4px 8px 0px color-mix(in srgb, {red.500}, transparent 96%)",closeButton:{hoverBackground:"{red.100}",focusRing:{color:"{red.600}",shadow:"none"}}},secondary:{background:"{surface.100}",borderColor:"{surface.200}",color:"{surface.600}",detailColor:"{surface.700}",shadow:"0px 4px 8px 0px color-mix(in srgb, {surface.500}, transparent 96%)",closeButton:{hoverBackground:"{surface.200}",focusRing:{color:"{surface.600}",shadow:"none"}}},contrast:{background:"{surface.900}",borderColor:"{surface.950}",color:"{surface.50}",detailColor:"{surface.0}",shadow:"0px 4px 8px 0px color-mix(in srgb, {surface.950}, transparent 96%)",closeButton:{hoverBackground:"{surface.800}",focusRing:{color:"{surface.50}",shadow:"none"}}}},dark:{root:{blur:"10px"},info:{background:"color-mix(in srgb, {blue.500}, transparent 84%)",borderColor:"color-mix(in srgb, {blue.700}, transparent 64%)",color:"{blue.500}",detailColor:"{surface.0}",shadow:"0px 4px 8px 0px color-mix(in srgb, {blue.500}, transparent 96%)",closeButton:{hoverBackground:"rgba(255, 255, 255, 0.05)",focusRing:{color:"{blue.500}",shadow:"none"}}},success:{background:"color-mix(in srgb, {green.500}, transparent 84%)",borderColor:"color-mix(in srgb, {green.700}, transparent 64%)",color:"{green.500}",detailColor:"{surface.0}",shadow:"0px 4px 8px 0px color-mix(in srgb, {green.500}, transparent 96%)",closeButton:{hoverBackground:"rgba(255, 255, 255, 0.05)",focusRing:{color:"{green.500}",shadow:"none"}}},warn:{background:"color-mix(in srgb, {yellow.500}, transparent 84%)",borderColor:"color-mix(in srgb, {yellow.700}, transparent 64%)",color:"{yellow.500}",detailColor:"{surface.0}",shadow:"0px 4px 8px 0px color-mix(in srgb, {yellow.500}, transparent 96%)",closeButton:{hoverBackground:"rgba(255, 255, 255, 0.05)",focusRing:{color:"{yellow.500}",shadow:"none"}}},error:{background:"color-mix(in srgb, {red.500}, transparent 84%)",borderColor:"color-mix(in srgb, {red.700}, transparent 64%)",color:"{red.500}",detailColor:"{surface.0}",shadow:"0px 4px 8px 0px color-mix(in srgb, {red.500}, transparent 96%)",closeButton:{hoverBackground:"rgba(255, 255, 255, 0.05)",focusRing:{color:"{red.500}",shadow:"none"}}},secondary:{background:"{surface.800}",borderColor:"{surface.700}",color:"{surface.300}",detailColor:"{surface.0}",shadow:"0px 4px 8px 0px color-mix(in srgb, {surface.500}, transparent 96%)",closeButton:{hoverBackground:"{surface.700}",focusRing:{color:"{surface.300}",shadow:"none"}}},contrast:{background:"{surface.0}",borderColor:"{surface.100}",color:"{surface.950}",detailColor:"{surface.950}",shadow:"0px 4px 8px 0px color-mix(in srgb, {surface.950}
4043, transparent 96%)",closeButton:{hoverBackground:"{surface.100}",focusRing:{color:"{surface.950}",shadow:"none"}}}}},Nwe={root:Rwe,icon:kwe,content:Mwe,text:Lwe,summary:Owe,detail:Dwe,closeButton:Fwe,closeIcon:Bwe,colorScheme:zwe},Vwe={padding:"0.25rem",borderRadius:"{content.border.radius}",gap:"0.5rem",fontWeight:"500",disabledBackground:"{form.field.disabled.background}",disabledBorderColor:"{form.field.disabled.background}",disabledColor:"{form.field.disabled.color}",invalidBorderColor:"{form.field.invalid.border.color}",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"},transitionDuration:"{form.field.transition.duration}",sm:{fontSize:"{form.field.sm.font.size}",padding:"0.25rem"},lg:{fontSize:"{form.field.lg.font.size}",padding:"0.25rem"}},Uwe={disabledColor:"{form.field.disabled.color}"},$we={padding:"0.25rem 0.75rem",borderRadius:"{content.border.radius}",checkedShadow:"0px 1px 2px 0px rgba(0, 0, 0, 0.02), 0px 1px 2px 0px rgba(0, 0, 0, 0.04)",sm:{padding:"0.25rem 0.75rem"},lg:{padding:"0.25rem 0.75rem"}},jwe={light:{root:{background:"{surface.100}",checkedBackground:"{surface.100}",hoverBackground:"{surface.100}",borderColor:"{surface.100}",color:"{surface.500}",hoverColor:"{surface.700}",checkedColor:"{surface.900}",checkedBorderColor:"{surface.100}"},content:{checkedBackground:"{surface.0}"},icon:{color:"{surface.500}",hoverColor:"{surface.700}",checkedColor:"{surface.900}"}},dark:{root:{background:"{surface.950}",checkedBackground:"{surface.950}",hoverBackground:"{surface.950}",borderColor:"{surface.950}",color:"{surface.400}",hoverColor:"{surface.300}",checkedColor:"{surface.0}",checkedBorderColor:"{surface.950}"},content:{checkedBackground:"{surface.800}"},icon:{color:"{surface.400}",hoverColor:"{surface.300}",checkedColor:"{surface.0}"}}},Gwe={root:Vwe,icon:Uwe,content:$we,colorScheme:jwe},Hwe={width:"2.5rem",height:"1.5rem",borderRadius:"30px",gap:"0.25rem",shadow:"{form.field.shadow}",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"},borderWidth:"1px",borderColor:"transparent",hoverBorderColor:"transparent",checkedBorderColor:"transparent",checkedHoverBorderColor:"transparent",invalidBorderColor:"{form.field.invalid.border.color}",transitionDuration:"{form.field.transition.duration}",slideDuration:"0.2s"},Wwe={borderRadius:"50%",size:"1rem"},qwe={light:{root:{background:"{surface.300}",disabledBackground:"{form.field.disabled.background}",hoverBackground:"{surface.400}",checkedBackground:"{primary.color}",checkedHoverBackground:"{primary.hover.color}"},handle:{background:"{surface.0}",disabledBackground:"{form.field.disabled.color}",hoverBackground:"{surface.0}",checkedBackground:"{surface.0}",checkedHoverBackground:"{surface.0}",color:"{text.muted.color}",hoverColor:"{text.color}",checkedColor:"{primary.color}",checkedHoverColor:"{primary.hover.color}"}},dark:{root:{background:"{surface.700}",disabledBackground:"{surface.600}",hoverBackground:"{surface.600}",checkedBackground:"{primary.color}",checkedHoverBackground:"{primary.hover.color}"},handle:{background:"{surface.400}",disabledBackground:"{surface.900}",hoverBackground:"{surface.300}",checkedBackground:"{surface.900}",checkedHoverBackground:"{surface.900}",color:"{surface.900}",hoverColor:"{surface.800}",checkedColor:"{primary.color}",checkedHoverColor:"{primary.hover.color}"}}},Xwe={root:Hwe,handle:Wwe,colorScheme:qwe},Zwe={background:"{content.background}",borderColor:"{content.border.color}",borderRadius:"{content.border.radius}",color:"{content.color}",gap:"0.5rem",padding:"0.75rem"},Ywe={root:Zwe},Kwe={maxWidth:"12.5rem",gutter:"0.25rem",shadow:"{overlay.popover.shadow}",padding:"0.5rem 0.75rem",borderRadius:"{overlay.popover.border.radius}"},Jwe={light:{root:{background:"{surface.700}",color:"{surface.0}"}},dark:{root:{background:"{surface.700}",color:"{surface.0}"}}},Qwe={root:Kwe,colorScheme:Jwe},eSe={background:"{content.background}",color:"{content.color}",padding:"1rem",gap:"2px",indent:"1rem",transitionDuration:"{transition.duration}"},tSe={padding:"0.25rem 0.5rem",borderRadius:"{content.border.radiu
4043s}",hoverBackground:"{content.hover.background}",selectedBackground:"{highlight.background}",color:"{text.color}",hoverColor:"{text.hover.color}",selectedColor:"{highlight.color}",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"-1px",shadow:"{focus.ring.shadow}"},gap:"0.25rem"},nSe={color:"{text.muted.color}",hoverColor:"{text.hover.muted.color}",selectedColor:"{highlight.color}"},rSe={borderRadius:"50%",size:"1.75rem",hoverBackground:"{content.hover.background}",selectedHoverBackground:"{content.background}",color:"{text.muted.color}",hoverColor:"{text.hover.muted.color}",selectedHoverColor:"{primary.color}",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"}},iSe={size:"2rem"},oSe={margin:"0 0 0.5rem 0"},sSe=` 4044 .p-tree-mask.p-overlay-mask { 4045 --px-mask-background: light-dark(rgba(255,255,255,0.5),rgba(0,0,0,0.3)); 4046 } 4047`,aSe={root:eSe,node:tSe,nodeIcon:nSe,nodeToggleButton:rSe,loadingIcon:iSe,filter:oSe,css:sSe},lSe={background:"{form.field.background}",disabledBackground:"{form.field.disabled.background}",filledBackground:"{form.field.filled.background}",filledHoverBackground:"{form.field.filled.hover.background}",filledFocusBackground:"{form.field.filled.focus.background}",borderColor:"{form.field.border.color}",hoverBorderColor:"{form.field.hover.border.color}",focusBorderColor:"{form.field.focus.border.color}",invalidBorderColor:"{form.field.invalid.border.color}",color:"{form.field.color}",disabledColor:"{form.field.disabled.color}",placeholderColor:"{form.field.placeholder.color}",invalidPlaceholderColor:"{form.field.invalid.placeholder.color}",shadow:"{form.field.shadow}",paddingX:"{form.field.padding.x}",paddingY:"{form.field.padding.y}",borderRadius:"{form.field.border.radius}",focusRing:{width:"{form.field.focus.ring.width}",style:"{form.field.focus.ring.style}",color:"{form.field.focus.ring.color}",offset:"{form.field.focus.ring.offset}",shadow:"{form.field.focus.ring.shadow}"},transitionDuration:"{form.field.transition.duration}",sm:{fontSize:"{form.field.sm.font.size}",paddingX:"{form.field.sm.padding.x}",paddingY:"{form.field.sm.padding.y}"},lg:{fontSize:"{form.field.lg.font.size}",paddingX:"{form.field.lg.padding.x}",paddingY:"{form.field.lg.padding.y}"}},cSe={width:"2.5rem",color:"{form.field.icon.color}"},uSe={background:"{overlay.select.background}",borderColor:"{overlay.select.border.color}",borderRadius:"{overlay.select.border.radius}",color:"{overlay.select.color}",shadow:"{overlay.select.shadow}"},dSe={padding:"{list.padding}"},hSe={padding:"{list.option.padding}"},fSe={borderRadius:"{border.radius.sm}"},pSe={color:"{form.field.icon.color}"},mSe={root:lSe,dropdown:cSe,overlay:uSe,tree:dSe,emptyMessage:hSe,chip:fSe,clearIcon:pSe},gSe={transitionDuration:"{transition.duration}"},_Se={background:"{content.background}",borderColor:"{treetable.border.color}",color:"{content.color}",borderWidth:"0 0 1px 0",padding:"0.75rem 1rem"},ySe={background:"{content.background}",hoverBackground:"{content.hover.background}",selectedBackground:"{highlight.background}",borderColor:"{treetable.border.color}",color:"{content.color}",hoverColor:"{content.hover.color}",selectedColor:"{highlight.color}",gap:"0.5rem",padding:"0.75rem 1rem",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"-1px",shadow:"{focus.ring.shadow}"}},vSe={fontWeight:"600"},bSe={background:"{content.background}",hoverBackground:"{content.hover.background}",selectedBackground:"{highlight.background}",color:"{content.color}",hoverColor:"{content.hover.color}",selectedColor:"{highlight.color}",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"-1px",shadow:"{focus.ring.shadow}"}},xSe={borderColor:"{treetable.border.color}",padding:"0.75rem 1rem",gap:"0.5rem"},wSe={background:"{content.background}",borderColor:"{treetable.border.color}",color:"{content.color}",padding:"0.75rem 1rem"},SSe={fontWeight:"600"},TSe={background:"{content.background}",borderColor:"{treetable.border.color}",color:"{content.color}",borderWidth:"0 0 1px 0",padding:"0.75rem 1rem"},ESe={width:"0.5rem"},CSe={width:"1px",color:"{primary.color}"},ASe={color:"{text.muted.color}",hoverColor:"{text.hover.muted.color}",size:"0.875rem"},ISe={size:"2rem"}
4047,PSe={hoverBackground:"{content.hover.background}",selectedHoverBackground:"{content.background}",color:"{text.muted.color}",hoverColor:"{text.color}",selectedHoverColor:"{primary.color}",size:"1.75rem",borderRadius:"50%",focusRing:{width:"{focus.ring.width}",style:"{focus.ring.style}",color:"{focus.ring.color}",offset:"{focus.ring.offset}",shadow:"{focus.ring.shadow}"}},RSe={borderColor:"{content.border.color}",borderWidth:"0 0 1px 0"},kSe={borderColor:"{content.border.color}",borderWidth:"0 0 1px 0"},MSe={light:{root:{borderColor:"{content.border.color}"},bodyCell:{selectedBorderColor:"{primary.100}"}},dark:{root:{borderColor:"{surface.800}"},bodyCell:{selectedBorderColor:"{primary.900}"}}},LSe=` 4048 .p-treetable-mask.p-overlay-mask { 4049 --px-mask-background: light-dark(rgba(255,255,255,0.5),rgba(0,0,0,0.3)); 4050 } 4051`,OSe={root:gSe,header:_Se,headerCell:ySe,columnTitle:vSe,row:bSe,bodyCell:xSe,footerCell:wSe,columnFooter:SSe,footer:TSe,columnResizer:ESe,resizeIndicator:CSe,sortIcon:ASe,loadingIcon:ISe,nodeToggleButton:PSe,paginatorTop:RSe,paginatorBottom:kSe,colorScheme:MSe,css:LSe},DSe={mask:{background:"{content.background}",color:"{text.muted.color}"},icon:{size:"2rem"}},FSe={loader:DSe},BSe=Object.defineProperty,zSe=Object.defineProperties,NSe=Object.getOwnPropertyDescriptors,FN=Object.getOwnPropertySymbols,VSe=Object.prototype.hasOwnProperty,USe=Object.prototype.propertyIsEnumerable,BN=(e,t,n)=>t in e?BSe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zN,$Se=(zN=((e,t)=>{for(var n in t||(t={}))VSe.call(t,n)&&BN(e,n,t[n]);if(FN)for(var n of FN(t))USe.call(t,n)&&BN(e,n,t[n]);return e})({},Kge),zSe(zN,NSe({components:{accordion:Ege,autocomplete:Dge,avatar:Uge,badge:Xge,blockui:Qge,breadcrumb:r_e,button:s_e,card:h_e,carousel:y_e,cascadeselect:E_e,checkbox:I_e,chip:O_e,colorpicker:N_e,confirmdialog:$_e,confirmpopup:q_e,contextmenu:eye,datatable:wye,dataview:Pye,datepicker:Zye,dialog:t0e,divider:s0e,dock:c0e,drawer:m0e,editor:x0e,fieldset:C0e,fileupload:O0e,floatlabel:N0e,galleria:eve,iconfield:nve,iftalabel:ove,image:uve,imagecompare:hve,inlinemessage:_ve,inplace:bve,inputchips:Tve,inputgroup:Cve,inputnumber:Rve,inputotp:Lve,inputtext:Dve,knob:Vve,listbox:Xve,megamenu:ibe,menu:ube,menubar:_be,message:Abe,metergroup:Obe,multiselect:Gbe,orderlist:qbe,organizationchart:Jbe,overlaybadge:exe,paginator:oxe,panel:hxe,panelmenu:yxe,password:Txe,picklist:Axe,popover:Rxe,progressbar:Oxe,progressspinner:Fxe,radiobutton:Nxe,rating:$xe,ripple:Gxe,scrollpanel:Xxe,select:i1e,selectbutton:a1e,skeleton:u1e,slider:g1e,speeddial:y1e,splitbutton:b1e,splitter:T1e,stepper:L1e,steps:N1e,tabmenu:H1e,tabs:Q1e,tabview:swe,tag:uwe,terminal:pwe,textarea:gwe,tieredmenu:Swe,timeline:Pwe,toast:Nwe,togglebutton:Gwe,toggleswitch:Xwe,toolbar:Ywe,tooltip:Qwe,tree:aSe,treeselect:mSe,treetable:OSe,virtualscroller:FSe},css:tye})));const jSe=bge($Se,{semantic:{primary:Vme("#00c8f5"),focusRing:{width:"2px",style:"solid",color:"var(--color-focus-ring)",offset:"2px"},colorScheme:{light:{surface:{0:"#ffffff",50:"#f8f9fa",100:"#f0f2f5",200:"#e4e7eb",300:"#cdd2d9",400:"#9ba3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#0d0f0f"},primary:{color:"var(--color-primary)",contrastColor:"var(--color-text-on-primary)",hoverColor:"{primary.600}",activeColor:"{primary.700}
4051"}},dark:{surface:{0:"#ffffff",50:"#f0f2f5",100:"#e8eaed",200:"#9ba1a6",300:"#6b7280",400:"#4b5563",500:"#374151",600:"#252829",700:"#1f2223",800:"#1a1d1e",900:"#14161a",950:"#0d0f0f"},primary:{color:"var(--color-primary)",contrastColor:"var(--color-text-on-primary)",hoverColor:"{primary.400}",activeColor:"{primary.300}"}}}},components:{tooltip:{root:{borderRadius:"var(--radius-md)",padding:"0.25rem 0.625rem"},colorScheme:{light:{root:{background:"var(--color-tooltip-bg)",color:"var(--color-tooltip-fg)"}},dark:{root:{background:"var(--color-tooltip-bg)",color:"var(--color-tooltip-fg)"}}}},datatable:{sortIcon:{color:"var(--color-muted)",hoverColor:"var(--color-muted)"},filter:{overlay:{popover:{background:"var(--color-surface)",borderColor:"var(--color-border)",borderRadius:"var(--radius-lg)",color:"var(--color-fg)"}},constraint:{selectedBackground:"var(--color-brand)",selectedColor:"var(--color-on-brand)"},ruleBorderColor:"var(--color-border)"}}}}),GSe={preset:jSe,options:{darkModeSelector:'[data-theme="dark"], [data-theme="landing_page"]'}},HSe=Ji(({vueApp:e})=>{const n=Dl()?.public?.primevue??{},{usePrimeVue:i=!0,options:c={}}=n,h={},m={theme:GSe||c?.theme};i&&e.use(pge,{...c,...h,...m}),e.use(gge),e.use(yge),e.use(vge)}),WSe=Ji(({vueApp:e})=>{}),qSe=Ji(e=>{const t=Dl().public.GTM_ID;Cy({script:[{innerHTML:`(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 4052new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 4053j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
4054'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); 4055})(window,document,'script','dataLayer','${t}');`,type:"text/javascript",tagPriority:1}],noscript:[{innerHTML:`<iframe src="https://www.googletagmanager.com/ns.html?id=${t}" 4056height="0" width="0" style="display:none;visibility:hidden"></iframe>`,tagPosition:"bodyOpen"}]})}),XSe=Ji({name:"SEO",setup(){const e=rr(),{$logger:t}=e,n=ps(),i=Mx();c(n.currentRoute.value),n.afterEach(m=>c(m));function c(m,a){const{$i18n:y}=e;if(i.value){t?.debug("SEO.skip_due_to_error");return}oR(e,()=>{const C=h(m,y,a);Cy({title:C.title,htmlAttrs:{lang:y.locale.value,dir:y.locale.value==="ar"?"rtl":"ltr"}}),nQ({title:C.title,description:C.description,keywords:C.keywords,ogTitle:C.title,ogDescription:C.description,ogImage:C.ogImage,ogImageAlt:y.t("SEO.ogImageAlt"),ogType:C.ogType,ogUrl:C.ogUrl,ogSiteName:y.t("SEO.title"),twitterCard:"summary_large_image",twitterTitle:C.title,twitterDescription:C.description,twitterImage:C.ogImage,twitterImageAlt:y.t("SEO.ogImageAlt")},{tagPriority:0})})}function h(m,a,y){const E=a.t("SEO.title");let C=null;y?C=y:m.meta.seoTitle&&(C=a.t(m.meta.seoTitle));const P=C?`${E} | ${C}`:E;let L="/images/SEO/OG.png",D="";return typeof window<"u"?(L=`${window.location.origin}/images/SEO/OG.png`,D=window.location.href):(L=IE().origin+"/images/SEO/OG.png",D=IE().toString()),{title:P,description:m.meta.seoDescription||a.t("SEO.description"),keywords:a.t("SEO.keywords"),ogImage:L,ogUrl:D,ogType:m.meta.seoOgType||"website"}}return{provide:{updateSEO:m=>c(n.currentRoute.value,m)}}}});function K9(e,t){return function(){return e.apply(t,arguments)}}const{toString:ZSe}=Object.prototype,{getPrototypeOf:_y}=Object,{iterator:Yx,toStringTag:J9}=Symbol,jE=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),ax=(e,t)=>{let n=e;const i=[];for(;n!=null&&n!==Object.prototype;){if(i.indexOf(n)!==-1)return!1;if(i.push(n),jE(n,t))return!0;n=_y(n)}return!1},YSe=(e,t)=>e!=null&&ax(e,t)?e[t]:void 0,fL=(e=>t=>{const n=ZSe.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),du=e=>(e=e.toLowerCase(),t=>fL(t)===e),QC=e=>t=>typeof t===e,{isArray:$m}=Array,yy=QC("undefined");function ky(e){return e!==null&&!yy(e)&&e.constructor!==null&&!yy(e.constructor)&&ul(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Q9=du("ArrayBuffer");function KSe(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Q9(e.buffer),t}const JSe=QC("string"),ul=QC("function"),e7=QC("number"),My=e=>e!==null&&typeof e=="object",QSe=e=>e===!0||e===!1,YT=e=>{if(!My(e))return!1;const t=_y(e);return(t===null||t===Object.prototype||_y(t)===null)&&!ax(e,J9)&&!ax(e,Yx)},eTe=e=>{if(!My(e)||ky(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},tTe=du("Date"),nTe=du("File"),rTe=e=>!!(e&&typeof e.uri<"u"),iTe=e=>e&&typeof e.getParts<"u",oTe=du("Blob"),sTe=du("FileList"),aTe=e=>My(e)&&ul(e.pipe);function lTe(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const NN=lTe(),VN=typeof NN.FormData<"u"?NN.FormData:void 0,cTe=e=>{if(!e)return!1;if(VN&&e instanceof VN)return!0;const t=_y(e);if(!t||t===Object.prototype||!ul(e.append))return!1;const n=fL(e);return n==="formdata"||n==="object"&&ul(e.toString)&&e.toString()==="[object FormData]"},uTe=du("URLSearchParams"),[dTe,hTe,fTe,pTe]=["ReadableStream","Request","Response","Headers"].map(du),mTe=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Kx(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let i,c;if(typeof e!="object"&&(e=[e]),$m(e))for(i=0,c=e.length;i<c;i++)t.call(null,e[i],i,e);else{if(ky(e))return;const h=n?Object.getOwnPropertyNames(e):Object.keys(e),m=h.length;let a;for(i=0;i<m;i++)a=h[i],t.call(null,e[a],a,e)}}function t7(e,t){if(ky(e))return null;t=t.toLowerCase();const n=Object.keys(e);let i=n.length,c;for(;i-- >0;)if(c=n[i],t===c.toLowerCase())return c;return null}const Tm=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,n7=e=>!yy(e)&&e!==Tm;function yk(...e){const{caseless:t,skipUndefined:n}=n7(this)&&this||{},i={},c=(h,m)=>{if(m==="__proto__"||m==="constructor"||m==="prototype")return;const a=t&&typeof m=="string"&&t7(i,m)||m,y=jE(i,a)?i[a]:void 0;YT(y)&&YT(h)?i[a]=yk(y,h):YT(h)?i[a]=yk({}
vendor: 43,256 bytes, lines 4056-4064
4056,h):$m(h)?i[a]=h.slice():(!n||!yy(h))&&(i[a]=h)};for(let h=0,m=e.length;h<m;h++){const a=e[h];if(!a||ky(a)||(Kx(a,c),typeof a!="object"||$m(a)))continue;const y=Object.getOwnPropertySymbols(a);for(let E=0;E<y.length;E++){const C=y[E];ATe.call(a,C)&&c(a[C],C)}}return i}const gTe=(e,t,n,{allOwnKeys:i}={})=>(Kx(t,(c,h)=>{n&&ul(c)?Object.defineProperty(e,h,{__proto__:null,value:K9(c,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,h,{__proto__:null,value:c,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:i}),e),_Te=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),yTe=(e,t,n,i)=>{e.prototype=Object.create(t.prototype,i),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},vTe=(e,t,n,i)=>{let c,h,m;const a={};if(t=t||{},e==null)return t;do{for(c=Object.getOwnPropertyNames(e),h=c.length;h-- >0;)m=c[h],(!i||i(m,e,t))&&!a[m]&&(t[m]=e[m],a[m]=!0);e=n!==!1&&_y(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},bTe=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const i=e.indexOf(t,n);return i!==-1&&i===n},xTe=e=>{if(!e)return null;if($m(e))return e;let t=e.length;if(!e7(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},wTe=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&_y(Uint8Array)),STe=(e,t)=>{const i=(e&&e[Yx]).call(e);let c;for(;(c=i.next())&&!c.done;){const h=c.value;t.call(e,h[0],h[1])}},TTe=(e,t)=>{let n;const i=[];for(;(n=e.exec(t))!==null;)i.push(n);return i},ETe=du("HTMLFormElement"),CTe=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,c){return i.toUpperCase()+c}),{propertyIsEnumerable:ATe}=Object.prototype,ITe=du("RegExp"),r7=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),i={};Kx(n,(c,h)=>{let m;(m=t(c,h,e))!==!1&&(i[h]=m||c)}),Object.defineProperties(e,i)},PTe=e=>{r7(e,(t,n)=>{if(ul(e)&&["arguments","caller","callee"].includes(n))return!1;const i=e[n];if(ul(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},RTe=(e,t)=>{const n={},i=c=>{c.forEach(h=>{n[h]=!0})};return $m(e)?i(e):i(String(e).split(t)),n},kTe=()=>{},MTe=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function LTe(e){return!!(e&&ul(e.append)&&e[J9]==="FormData"&&e[Yx])}const OTe=e=>{const t=new WeakSet,n=i=>{if(My(i)){if(t.has(i))return;if(ky(i))return i;if(!("toJSON"in i)){t.add(i);const c=$m(i)?[]:{};return Kx(i,(h,m)=>{const a=n(h);!yy(a)&&(c[m]=a)}),t.delete(i),c}}return i};return n(e)},DTe=du("AsyncFunction"),FTe=e=>e&&(My(e)||ul(e))&&ul(e.then)&&ul(e.catch),i7=((e,t)=>e?setImmediate:t?((n,i)=>(Tm.addEventListener("message",({source:c,data:h})=>{c===Tm&&h===n&&i.length&&i.shift()()},!1),c=>{i.push(c),Tm.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",ul(Tm.postMessage)),BTe=typeof queueMicrotask<"u"?queueMicrotask.bind(Tm):typeof process<"u"&&process.nextTick||i7,o7=e=>e!=null&&ul(e[Yx]),zTe=e=>e!=null&&ax(e,Yx)&&o7(e),wt={isArray:$m,isArrayBuffer:Q9,isBuffer:ky,isFormData:cTe,isArrayBufferView:KSe,isString:JSe,isNumber:e7,isBoolean:QSe,isObject:My,isPlainObject:YT,isEmptyObject:eTe,isReadableStream:dTe,isRequest:hTe,isResponse:fTe,isHeaders:pTe,isUndefined:yy,isDate:tTe,isFile:nTe,isReactNativeBlob:rTe,isReactNative:iTe,isBlob:oTe,isRegExp:ITe,isFunction:ul,isStream:aTe,isURLSearchParams:uTe,isTypedArray:wTe,isFileList:sTe,forEach:Kx,merge:yk,extend:gTe,trim:mTe,stripBOM:_Te,inherits:yTe,toFlatObject:vTe,kindOf:fL,kindOfTest:du,endsWith:bTe,toArray:xTe,forEachEntry:STe,matchAll:TTe,isHTMLForm:ETe,hasOwnProperty:jE,hasOwnProp:jE,hasOwnInPrototypeChain:ax,getSafeProp:YSe,reduceDescriptors:r7,freezeMethods:PTe,toObjectSet:RTe,toCamelCase:CTe,noop:kTe,toFiniteNumber:MTe,findKey:t7,global:Tm,isContextDefined:n7,isSpecCompliantForm:LTe,toJSONObject:OTe,isAsyncFn:DTe,isThenable:FTe,setImmediate:i7,asap:BTe,isIterable:o7,isSafeIterable:zTe},NTe=wt.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"]),VTe=e=>{const t={};let n,i,c;return e&&e.split(` 4057`).forEach(function(m){c=m.indexOf(":"),n=m.substring(0,c).trim().toLowerCase(),i=m.substring(c+1).trim(),!(!n||t[n]&&NTe[n])&&(n==="set-cookie"?t[n]?t[n].push(i):t[n]=[i]:t[n]=t[n]?t[n]+", "+i:i)}),t};function UTe(e){let t=0,n=e.length;for(;t<n;){const i=e.charCodeAt(t);if(i!==9&&i!==32)break;t+=1}for(;n>t;){const i=e.charCodeAt(n-1);if(i!==9&&i!==32)break;n-=1}return t===0&&n===e.length?e:e.slice(t,n)}const $Te=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),jTe=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function pL(e,t){return wt.isArray(e)?e.map(n=>pL(n,t)):UTe(String(e).replace(t,""))}const GTe=e=>pL(e,$Te),HTe=e=>pL(e,jTe);function s7(e){const t=Object.create(null);return wt.forEach(e.toJSON(),(n,i)=>{t[i]=HTe(n)}),t}const UN=Symbol("internals");function ob(e){return e&&String(e).trim().toLowerCase()}function KT(e){return e===!1||e==null?e:wt.isArray(e)?e.map(KT):GTe(String(e))}function WTe(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(e);)t[i[1]]=i[2];return t}const qTe=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function pP(e,t,n,i,c){if(wt.isFunction(i))return i.call(this,t,n);if(c&&(t=n),!!wt.isString(t)){if(wt.isString(i))return t.indexOf(i)!==-1;if(wt.isRegExp(i))return i.test(t)}}function XTe(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,i)=>n.toUpperCase()+i)}function ZTe(e,t){const n=wt.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+n,{__proto__:null,value:function(c,h,m){return this[i].call(this,t,c,h,m)},configurable:!0})})}let va=class{constructor(t){t&&this.set(t)}set(t,n,i){const c=this;function h(a,y,E){const C=ob(y);if(!C)return;const P=wt.findKey(c,C);(!P||c[P]===void 0||E===!0||E===void 0&&c[P]!==!1)&&(c[P||y]=KT(a))}const m=(a,y)=>wt.forEach(a,(E,C)=>h(E,C,y));if(wt.isPlainObject(t)||t instanceof this.constructor)m(t,n);else if(wt.isString(t)&&(t=t.trim())&&!qTe(t))m(VTe(t),n);else if(wt.isObject(t)&&wt.isSafeIterable(t)){let a=Object.create(null),y,E;for(const C of t){if(!wt.isArray(C))throw new TypeError("Object iterator must return a key-value pair");E=C[0],wt.hasOwnProp(a,E)?(y=a[E],a[E]=wt.isArray(y)?[...y,C[1]]:[y,C[1]]):a[E]=C[1]}m(a,n)}else t!=null&&h(n,t,i);return this}get(t,n){if(t=ob(t),t){const i=wt.findKey(this,t);if(i){const c=this[i];if(!n)return c;if(n===!0)return WTe(c);if(wt.isFunction(n))return n.call(this,c,i);if(wt.isRegExp(n))return n.exec(c);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=ob(t),t){const i=wt.findKey(this,t);return!!(i&&this[i]!==void 0&&(!n||pP(this,this[i],i,n)))}return!1}delete(t,n){const i=this;let c=!1;function h(m){if(m=ob(m),m){const a=wt.findKey(i,m);a&&(!n||pP(i,i[a],a,n))&&(delete i[a],c=!0)}}return wt.isArray(t)?t.forEach(h):h(t),c}clear(t){const n=Object.keys(this);let i=n.length,c=!1;for(;i--;){const h=n[i];(!t||pP(this,this[h],h,t,!0))&&(delete this[h],c=!0)}return c}normalize(t){const n=this,i={};return wt.forEach(this,(c,h)=>{const m=wt.findKey(i,h);if(m){n[m]=KT(c),delete n[h];return}const a=t?XTe(h):String(h).trim();a!==h&&delete n[h],n[a]=KT(c),i[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return wt.forEach(this,(i,c)=>{i!=null&&i!==!1&&(n[c]=t&&wt.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` 4058`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const i=new this(t);return n.forEach(c=>i.set(c)),i}static accessor(t){const i=(this[UN]=this[UN]={accessors:{}}).accessors,c=this.prototype;function h(m){const a=ob(m);i[a]||(ZTe(c,m),i[a]=!0)}return wt.isArray(t)?t.forEach(h):h(t),this}};va.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);wt.reduceDescriptors(va.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(i){this[n]=i}}});wt.freezeMethods(va);const YTe="[REDACTED ****]";function KTe(e){if(wt.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(wt.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function JTe(e,t){const n=new Set(t.map(h=>String(h).toLowerCase())),i=[],c=h=>{if(h===null||typeof h!="object"||wt.isBuffer(h))return h;if(i.indexOf(h)!==-1)return;h instanceof va&&(h=h.toJSON()),i.push(h);let m;if(wt.isArray(h))m=[],h.forEach((a,y)=>{const E=c(a);wt.isUndefined(E)||(m[y]=E)});else{if(!wt.isPlainObject(h)&&KTe(h))return i.pop(),h;m=Object.create(null);for(const[a,y]of Object.entries(h)){const E=n.has(a.toLowerCase())?YTe:c(y);wt.isUndefined(E)||(m[a]=E)}}return i.pop(),m};return c(e)}let qn=class a7 extends Error{static from(t,n,i,c,h,m){const a=new a7(t.message,n||t.code,i,c,h);return a.cause=t,a.name=t.name,t.status!=null&&a.status==null&&(a.status=t.status),m&&Object.assign(a,m),a}constructor(t,n,i,c,h){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),i&&(this.config=i),c&&(this.request=c),h&&(this.response=h,this.status=h.status)}toJSON(){const t=this.config,n=t&&wt.hasOwnProp(t,"redact")?t.redact:void 0,i=wt.isArray(n)&&n.length>0?JTe(t,n):wt.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:i,code:this.code,status:this.status}}};qn.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";qn.ERR_BAD_OPTION="ERR_BAD_OPTION";qn.ECONNABORTED="ECONNABORTED";qn.ETIMEDOUT="ETIMEDOUT";qn.ECONNREFUSED="ECONNREFUSED";qn.ERR_NETWORK="ERR_NETWORK";qn.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";qn.ERR_DEPRECATED="ERR_DEPRECATED";qn.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";qn.ERR_BAD_REQUEST="ERR_BAD_REQUEST";qn.ERR_CANCELED="ERR_CANCELED";qn.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";qn.ERR_INVALID_URL="ERR_INVALID_URL";qn.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const QTe=null,l7=100;function vk(e){return wt.isPlainObject(e)||wt.isArray(e)}function c7(e){return wt.endsWith(e,"[]")?e.slice(0,-2):e}function mP(e,t,n){return e?e.concat(t).map(function(c,h){return c=c7(c),!n&&h?"["+c+"]":c}).join(n?".":""):t}function eEe(e){return wt.isArray(e)&&!e.some(vk)}const tEe=wt.toFlatObject(wt,{},null,function(t){return/^is[A-Z]/.test(t)});function e2(e,t,n){if(!wt.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=wt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(Y,X){return!wt.isUndefined(X[Y])});const i=n.metaTokens,c=n.visitor||V,h=n.dots,m=n.indexes,a=n.Blob||typeof Blob<"u"&&Blob,y=n.maxDepth===void 0?l7:n.maxDepth,E=a&&wt.isSpecCompliantForm(t),C=[];if(!wt.isFunction(c))throw new TypeError("visitor must be a function");function P($){if($===null)return"";if(wt.isDate($))return $.toISOString();if(wt.isBoolean($))return $.toString();if(!E&&wt.isBlob($))throw new qn("Blob is not supported. Use a Buffer instead.");return wt.isArrayBuffer($)||wt.isTypedArray($)?E&&typeof Blob=="function"?new Blob([$]):Buffer.from($):$}function L($){if($>y)throw new qn("Object is too deeply nested ("+$+" levels). Max depth: "+y,qn.ERR_FORM_DATA_DEPTH_EXCEEDED)}function D($,Y){if(y===1/0)return JSON.stringify($);const X=[];return JSON.stringify($,function(ne,fe){if(!wt.isObject(fe))return fe;for(;X.length&&X[X.length-1]!==this;)X.pop();return X.push(fe),L(Y+X.length-1),fe})}function V($,Y,X){let K=$;if(wt.isReactNative(t)&&wt.isReactNativeBlob($))return t.append(mP(X,Y,h),P($)),!1;if($&&!X&&typeof $=="object"){if(wt.endsWith(Y,"{}"))Y=i?Y:Y.slice(0,-2),$=D($,1);else if(wt.isArray($)&&eEe($)||(wt.isFileList($)||wt.endsWith(Y,"[]"))&&(K=wt.toArray($)))return Y=c7(Y),K.forEach(function(fe,ye){!(wt.isUndefined(fe)||fe===null)&&t.append(m===!0?mP([Y],ye,h):m===null?Y:Y+"[]",P(fe))}),!1}return vk($)?!0:(t.append(mP(X,Y,h),P($)),!1)}const U=Object.assign(tEe,{defaultVisitor:V,convertValue:P,isVisitable:vk});function W($,Y,X=0){if(!wt.isUndefined($)){if(L(X),C.indexOf($)!==-1)throw new Error("Circular reference detected in "+Y.join("."));C.push($),wt.forEach($,function(ne,fe){(!(wt.isUndefined(ne)||ne===null)&&c.call(t,ne,wt.isString(fe)?fe.trim():fe,Y,U))===!0&&W(ne,Y?Y.concat(fe):[fe],X+1)}),C.pop()}}if(!wt.isObject(e))throw new TypeError("data must be an object");return W(e),t}function $N(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(i){return t[i]})}function mL(e,t){this._pairs=[],e&&e2(e,this,t)}const u7=mL.prototype;u7.append=function(t,n){this._pairs.push([t,n])};u7.toString=function(t){const n=t?function(i){return t.call(this,i,$N)}:$N;return this._pairs.map(function(c){return n(c[0])+"="+n(c[1])},"").join("&")};function nEe(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function d7(e,t,n){if(!t)return e;const i=wt.isFunction(n)?{serialize:n}:n,c=wt.getSafeProp(i,"encode")||nEe,h=wt.getSafeProp(i,"serialize");let m;if(h?m=h(t,i):m=wt.isURLSearchParams(t)?t.toString():new mL(t,i).toString(c),m){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+m}return e}class jN{constructor(){this.handlers=[]}use(t,n,i){return this.handlers.push({fulfilled:t,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){wt.forEach(this.handlers,function(i){i!==null&&t(i)})}}const gL={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},rEe=typeof URLSearchParams<"u"?URLSearchParams:mL,iEe=typeof FormData<"u"?FormData:null,oEe=typeof Blob<"u"?Blob:null,sEe={isBrowser:!0,classes:{URLSearchParams:rEe,FormData:iEe,Blob:oEe},protocols:["http","https","file","blob","url","data"]},_L=typeof window<"u"&&typeof document<"u",bk=typeof navigator=="object"&&navigator||void 0,aEe=_L&&(!bk||["ReactNative","NativeScript","NS"].indexOf(bk.product)<0),lEe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",cEe=_L&&window.location.href||"http://localhost",uEe=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:_L,hasStandardBrowserEnv:aEe,hasStandardBrowserWebWorkerEnv:lEe,navigator:bk,origin:cEe},Symbol.toStringTag,{value:"Module"})),Hs={...uEe,...sEe};function dEe(e,t){return e2(e,new Hs.classes.URLSearchParams,{visitor:function(n,i,c,h){return Hs.isNode&&wt.isBuffer(n)?(this.append(i,n.toString("base64")),!1):h.defaultVisitor.apply(this,arguments)},...t})}const GN=l7;function h7(e){if(e>GN)throw new qn("FormData field is too deeply nested ("+e+" levels). Max depth: "+GN,qn.ERR_FORM_DATA_DEPTH_EXCEEDED)}function hEe(e){const t=[],n=/\w+|\[(\w*)]/g;let i;for(;(i=n.exec(e))!==null;)h7(t.length),t.push(i[0]==="[]"?"":i[1]||i[0]);return t}function fEe(e){const t={},n=Object.keys(e);let i;const c=n.length;let h;for(i=0;i<c;i++)h=n[i],t[h]=e[h];return t}function f7(e){function t(n,i,c,h){h7(h);let m=n[h++];if(m==="__proto__")return!0;const a=Number.isFinite(+m),y=h>=n.length;return m=!m&&wt.isArray(c)?c.length:m,y?(wt.hasOwnProp(c,m)?c[m]=wt.isArray(c[m])?c[m].concat(i):[c[m],i]:c[m]=i,!a):((!wt.hasOwnProp(c,m)||!wt.isObject(c[m]))&&(c[m]=[]),t(n,i,c[m],h)&&wt.isArray(c[m])&&(c[m]=fEe(c[m])),!a)}if(wt.isFormData(e)&&wt.isFunction(e.entries)){const n={};return wt.forEachEntry(e,(i,c)=>{t(hEe(i),c,n,0)}),n}return null}const P_=(e,t)=>e!=null&&wt.hasOwnProp(e,t)?e[t]:void 0;function pEe(e,t,n){if(wt.isString(e))try{return(t||JSON.parse)(e),wt.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(e)}const Jx={transitional:gL,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const i=n.getContentType()||"",c=i.indexOf("application/json")>-1,h=wt.isObject(t);if(h&&wt.isHTMLForm(t)&&(t=new FormData(t)),wt.isFormData(t))return c?JSON.stringify(f7(t)):t;if(wt.isArrayBuffer(t)||wt.isBuffer(t)||wt.isStream(t)||wt.isFile(t)||wt.isBlob(t)||wt.isReadableStream(t))return t;if(wt.isArrayBufferView(t))return t.buffer;if(wt.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(h){const y=P_(this,"formSerializer");if(i.indexOf("application/x-www-form-urlencoded")>-1)return dEe(t,y).toString();if((a=wt.isFileList(t))||i.indexOf("multipart/form-data")>-1){const E=P_(this,"env"),C=E&&E.FormData;return e2(a?{"files[]":t}:t,C&&new C,y)}}return h||c?(n.setContentType("application/json",!1),pEe(t)):t}],transformResponse:[function(t){const n=P_(this,"transitional")||Jx.transitional,i=n&&n.forcedJSONParsing,c=P_(this,"responseType"),h=c==="json";if(wt.isResponse(t)||wt.isReadableStream(t))return t;if(t&&wt.isString(t)&&(i&&!c||h)){const a=!(n&&n.silentJSONParsing)&&h;try{return JSON.parse(t,P_(this,"parseReviver"))}catch(y){if(a)throw y.name==="SyntaxError"?qn.from(y,qn.ERR_BAD_RESPONSE,this,null,P_(this,"response")):y}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Hs.classes.FormData,Blob:Hs.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};wt.forEach(["delete","get","head","post","put","patch","query"],e=>{Jx.headers[e]={}});function gP(e,t){const n=this||Jx,i=t||n,c=va.from(i.headers);let h=i.data;return wt.forEach(e,function(a){h=a.call(n,h,c.normalize(),t?t.status:void 0)}),c.normalize(),h}function p7(e){return!!(e&&e.__CANCEL__)}let Qx=class extends qn{constructor(t,n,i){super(t??"canceled",qn.ERR_CANCELED,n,i),this.name="CanceledError",this.__CANCEL__=!0}};function m7(e,t,n){const i=n.config.validateStatus;!n.status||!i||i(n.status)?e(n):t(new qn("Request failed with status code "+n.status,n.status>=400&&n.status<500?qn.ERR_BAD_REQUEST:qn.ERR_BAD_RESPONSE,n.config,n.request,n))}function mEe(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function gEe(e,t){e=e||10;const n=new Array(e),i=new Array(e);let c=0,h=0,m;return t=t!==void 0?t:1e3,function(y){const E=Date.now(),C=i[h];m||(m=E),n[c]=y,i[c]=E;let P=h,L=0;for(;P!==c;)L+=n[P++],P=P%e;if(c=(c+1)%e,c===h&&(h=(h+1)%e),E-m<t)return;const D=C&&E-C;return D?Math.round(L*1e3/D):void 0}}function _Ee(e,t){let n=0,i=1e3/t,c,h;const m=(E,C=Date.now())=>{n=C,c=null,h&&(clearTimeout(h),h=null),e(...E)};return[(...E)=>{const C=Date.now(),P=C-n;P>=i?m(E,C):(c=E,h||(h=setTimeout(()=>{h=null,m(c)},i-P)))},()=>c&&m(c)]}const GE=(e,t,n=3)=>{let i=0;const c=gEe(50,250);return _Ee(h=>{if(!h||typeof h.loaded!="number")return;const m=h.loaded,a=h.lengthComputable?h.total:void 0,y=a!=null?Math.min(m,a):m,E=Math.max(0,y-i),C=c(E);i=Math.max(i,y);const P={loaded:y,total:a,progress:a?y/a:void 0,bytes:E,rate:C||void 0,estimated:C&&a?(a-y)/C:void 0,event:h,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(P)},n)},HN=(e,t)=>{const n=e!=null;return[i=>t[0]({lengthComputable:n,total:e,loaded:i}),t[1]]},WN=e=>(...t)=>wt.asap(()=>e(...t)),yEe=Hs.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Hs.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Hs.origin),Hs.navigator&&/(msie|trident)/i.test(Hs.navigator.userAgent)):()=>!0,vEe=Hs.hasStandardBrowserEnv?{write(e,t,n,i,c,h,m){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];wt.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),wt.isString(i)&&a.push(`path=${i}`),wt.isString(c)&&a.push(`domain=${c}`),h===!0&&a.push("secure"),wt.isString(m)&&a.push(`SameSite=${m}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const i=t[n].replace(/^\s+/,""),c=i.indexOf("=");if(c!==-1&&i.slice(0,c)===e)return decodeURIComponent(i.slice(c+1))}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function bEe(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function xEe(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}const wEe=/^https?:(?!\/\/)/i,SEe=/[\t\n\r]/g;function TEe(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function EEe(e){return TEe(e).replace(SEe,"")}function qN(e,t){if(typeof e=="string"&&wEe.test(EEe(e)))throw new qn('Invalid URL: missing "//" after protocol',qn.ERR_INVALID_URL,t)}function g7(e,t,n,i){qN(t,i);let c=!bEe(t);return e&&(c||n===!1)?(qN(e,i),xEe(e,t)):t}const XN=e=>e instanceof va?{...e}:e;function jm(e,t){t=t||{};const n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function i(C,P,L,D){return wt.isPlainObject(C)&&wt.isPlainObject(P)?wt.merge.call({caseless:D},C,P):wt.isPlainObject(P)?wt.merge({},P):wt.isArray(P)?P.slice():P}function c(C,P,L,D){if(wt.isUndefined(P)){if(!wt.isUndefined(C))return i(void 0,C,L,D)}else return i(C,P,L,D)}function h(C,P){if(!wt.isUndefined(P))return i(void 0,P)}function m(C,P){if(wt.isUndefined(P)){if(!wt.isUndefined(C))return i(void 0,C)}else return i(void 0,P)}function a(C){const P=wt.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!wt.isUndefined(P))if(wt.isPlainObject(P)){if(wt.hasOwnProp(P,C))return P[C]}else return;const L=wt.hasOwnProp(e,"transitional")?e.transitional:void 0;if(wt.isPlainObject(L)&&wt.hasOwnProp(L,C))return L[C]}function y(C,P,L){if(wt.hasOwnProp(t,L))return i(C,P);if(wt.hasOwnProp(e,L))return i(void 0,C)}const E={url:h,method:h,data:h,baseURL:m,transformRequest:m,transformResponse:m,paramsSerializer:m,timeout:m,timeoutMessage:m,withCredentials:m,withXSRFToken:m,adapter:m,responseType:m,xsrfCookieName:m,xsrfHeaderName:m,onUploadProgress:m,onDownloadProgress:m,decompress:m,maxContentLength:m,maxBodyLength:m,beforeRedirect:m,transport:m,httpAgent:m,httpsAgent:m,cancelToken:m,socketPath:m,allowedSocketPaths:m,responseEncoding:m,validateStatus:y,headers:(C,P,L)=>c(XN(C),XN(P),L,!0)};return wt.forEach(Object.keys({...e,...t}),function(P){if(P==="__proto__"||P==="constructor"||P==="prototype")return;const L=wt.hasOwnProp(E,P)?E[P]:c,D=wt.hasOwnProp(e,P)?e[P]:void 0,V=wt.hasOwnProp(t,P)?t[P]:void 0,U=L(D,V,P);wt.isUndefined(U)&&L!==y||(n[P]=U)}),wt.hasOwnProp(t,"validateStatus")&&wt.isUndefined(t.validateStatus)&&a("validateStatusUndefinedResolves")===!1&&(wt.hasOwnProp(e,"validateStatus")?n.validateStatus=i(void 0,e.validateStatus):delete n.validateStatus),n}const CEe=["content-type","content-length"];function AEe(e,t,n){if(n!=="content-only"){e.set(t);return}Object.entries(t).forEach(([i,c])=>{CEe.includes(i.toLowerCase())&&e.set(i,c)})}const IEe=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16)));function _7(e){const t=jm({},e),n=L=>wt.hasOwnProp(t,L)?t[L]:void 0,i=n("data");let c=n("withXSRFToken");const h=n("xsrfHeaderName"),m=n("xsrfCookieName");let a=n("headers");const y=n("auth"),E=n("baseURL"),C=n("allowAbsoluteUrls"),P=n("url");if(t.headers=a=va.from(a),t.url=d7(g7(E,P,C,t),n("params"),n("paramsSerializer")),y){const L=wt.getSafeProp(y,"username")||"",D=wt.getSafeProp(y,"password")||"";a.set("Authorization","Basic "+btoa(L+":"+(D?IEe(D):"")))}if(wt.isFormData(i)&&(Hs.hasStandardBrowserEnv||Hs.hasStandardBrowserWebWorkerEnv||wt.isReactNative(i)?a.setContentType(void 0):wt.isFunction(i.getHeaders)&&AEe(a,i.getHeaders(),n("formDataHeaderPolicy"))),Hs.hasStandardBrowserEnv&&(wt.isFunction(c)&&(c=c(t)),c===!0||c==null&&yEe(t.url))){const D=h&&m&&vEe.read(m);D&&a.set(h,D)}return t}const PEe=typeof XMLHttpRequest<"u",REe=PEe&&function(e){return new Promise(function(n,i){const c=_7(e);let h=c.data;const m=va.from(c.headers).normalize();let{responseType:a,onUploadProgress:y,onDownloadProgress:E}=c,C,P,L,D,V;function U(){D&&D(),V&&V(),c.cancelToken&&c.cancelToken.unsubscribe(C),c.signal&&c.signal.removeEventListener("abort",C)}let W=new XMLHttpRequest;W.open(c.method.toUpperCase(),c.url,!0),W.timeout=c.timeout;function $(){if(!W)return;const X=va.from("getAllResponseHeaders"in W&&W.getAllResponseHeaders()),ne={data:!a||a==="text"||a==="json"?W.responseText:W.response,status:W.status,statusText:W.statusText,headers:X,config:e,request:W};m7(function(ye){n(ye),U()},function(ye){i(ye),U()},ne),W=null}"onloadend"in W?W.onloadend=$:W.onreadystatechange=function(){!W||W.readyState!==4||W.status===0&&!(W.responseURL&&W.responseURL.startsWith("file:"))||setTimeout($)},W.onabort=function(){W&&(i(new qn("Request aborted",qn.ECONNABORTED,e,W)),U(),W=null)},W.onerror=function(K){const ne=K&&K.message?K.message:"Network Error",fe=new qn(ne,qn.ERR_NETWORK,e,W);fe.event=K||null,i(fe),U(),W=null},W.ontimeout=function(){let K=c.timeout?"timeout of "+c.timeout+"ms exceeded":"timeout exceeded";const ne=c.transitional||gL;c.timeoutErrorMessage&&(K=c.timeoutErrorMessage),i(new qn(K,ne.clarifyTimeoutError?qn.ETIMEDOUT:qn.ECONNABORTED,e,W)),U(),W=null},h===void 0&&m.setContentType(null),"setRequestHeader"in W&&wt.forEach(s7(m),function(K,ne){W.setRequestHeader(ne,K)}),wt.isUndefined(c.withCredentials)||(W.withCredentials=!!c.withCredentials),a&&a!=="json"&&(W.responseType=c.responseType),E&&([L,V]=GE(E,!0),W.addEventListener("progress",L)),y&&W.upload&&([P,D]=GE(y),W.upload.addEventListener("progress",P),W.upload.addEventListener("loadend",D)),(c.cancelToken||c.signal)&&(C=X=>{W&&(i(!X||X.type?new Qx(null,e,W):X),W.abort(),U(),W=null)},c.cancelToken&&c.cancelToken.subscribe(C),c.signal&&(c.signal.aborted?C():c.signal.addEventListener("abort",C)));const Y=mEe(c.url);if(Y&&!Hs.protocols.includes(Y)){i(new qn("Unsupported protocol "+Y+":",qn.ERR_BAD_REQUEST,e));return}W.send(h||null)})},kEe=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let i=!1;const c=function(y){if(!i){i=!0,m();const E=y instanceof Error?y:this.reason;n.abort(E instanceof qn?E:new Qx(E instanceof Error?E.message:E))}};let h=t&&setTimeout(()=>{h=null,c(new qn(`timeout of ${t}ms exceeded`,qn.ETIMEDOUT))},t);const m=()=>{e&&(h&&clearTimeout(h),h=null,e.forEach(y=>{y.unsubscribe?y.unsubscribe(c):y.removeEventListener("abort",c)}),e=null)};e.forEach(y=>y.addEventListener("abort",c));const{signal:a}=n;return a.unsubscribe=()=>wt.asap(m),a},MEe=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let i=0,c;for(;i<n;)c=i+t,yield e.slice(i,c),i=c},LEe=async function*(e,t){for await(const n of OEe(e))yield*MEe(n,t)},OEe=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:i}=await t.read();if(n)break;yield i}}finally{await t.cancel()}},ZN=(e,t,n,i)=>{const c=LEe(e,t);let h=0,m,a=y=>{m||(m=!0,i&&i(y))};return new ReadableStream({async pull(y){try{const{done:E,value:C}=await c.next();if(E){a(),y.close();return}let P=C.byteLength;if(n){let L=h+=P;n(L)}y.enqueue(new Uint8Array(C))}catch(E){throw a(E),E}},cancel(y){return a(y),c.return()}},{highWaterMark:2})},HE=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,DEe=(e,t,n)=>t+2<n&&HE(e.charCodeAt(t+1))&&HE(e.charCodeAt(t+2));function FEe(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const n=e.slice(5,t),i=e.slice(t+1);if(/;base64/i.test(n)){let m=i.length;const a=i.length;for(let D=0;D<a;D++)if(i.charCodeAt(D)===37&&D+2<a){const V=i.charCodeAt(D+1),U=i.charCodeAt(D+2);HE(V)&&HE(U)&&(m-=2,D+=2)}let y=0,E=a-1;const C=D=>D>=2&&i.charCodeAt(D-2)===37&&i.charCodeAt(D-1)===51&&(i.charCodeAt(D)===68||i.charCodeAt(D)===100);E>=0&&(i.charCodeAt(E)===61?(y++,E--):C(E)&&(y++,E-=3)),y===1&&E>=0&&(i.charCodeAt(E)===61||C(E))&&y++;const L=Math.floor(m/4)*3-(y||0);return L>0?L:0}let h=0;for(let m=0,a=i.length;m<a;m++){const y=i.charCodeAt(m);if(y===37&&DEe(i,m,a))h+=1,m+=2;else if(y<128)h+=1;else if(y<2048)h+=2;else if(y>=55296&&y<=56319&&m+1<a){const E=i.charCodeAt(m+1);E>=56320&&E<=57343?(h+=4,m++):h+=3}else h+=3}return h}const yL="1.18.0",YN=64*1024,{isFunction:wT}=wt,BEe=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16))),KN=e=>{if(!wt.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},JN=(e,...t)=>{try{return!!e(...t)}catch{return!1}},zEe=e=>{const t=e.indexOf("://");let n=e;return t!==-1&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")},NEe=e=>{const t=wt.global!==void 0&&wt.global!==null?wt.global:globalThis,{ReadableStream:n,TextEncoder:i}=t;e=wt.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:c,Request:h,Response:m}=e,a=c?wT(c):typeof fetch=="function",y=wT(h),E=wT(m);if(!a)return!1;const C=a&&wT(n),P=a&&(typeof i=="function"?($=>Y=>$.encode(Y))(new i):async $=>new Uint8Array(await new h($).arrayBuffer())),L=y&&C&&JN(()=>{let $=!1;const Y=new h(Hs.origin,{body:new n,method:"POST",get duplex(){return $=!0,"half"}}),X=Y.headers.has("Content-Type");return Y.body!=null&&Y.body.cancel(),$&&!X}),D=E&&C&&JN(()=>wt.isReadableStream(new m("").body)),V={stream:D&&($=>$.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach($=>{!V[$]&&(V[$]=(Y,X)=>{let K=Y&&Y[$];if(K)return K.call(Y);throw new qn(`Response type '${$}' is not supported`,qn.ERR_NOT_SUPPORT,X)})});const U=async $=>{if($==null)return 0;if(wt.isBlob($))return $.size;if(wt.isSpecCompliantForm($))return(await new h(Hs.origin,{method:"POST",body:$}).arrayBuffer()).byteLength;if(wt.isArrayBufferView($)||wt.isArrayBuffer($))return $.byteLength;if(wt.isURLSearchParams($)&&($=$+""),wt.isString($))return(await P($)).byteLength},W=async($,Y)=>{const X=wt.toFiniteNumber($.getContentLength());return X??U(Y)};return async $=>{let{url:Y,method:X,data:K,signal:ne,cancelToken:fe,timeout:ye,onDownloadProgress:ke,onUploadProgress:Fe,responseType:qe,headers:lt,withCredentials:pt="same-origin",fetchOptions:Qt,maxContentLength:Ht,maxBodyLength:zt}=_7($);const jt=wt.isNumber(Ht)&&Ht>-1,Zt=wt.isNumber(zt)&&zt>-1,Wt=Rn=>wt.hasOwnProp($,Rn)?$[Rn]:void 0;let en=c||fetch;qe=qe?(qe+"").toLowerCase():"text";let sn=kEe([ne,fe&&fe.toAbortSignal()],ye),Mn=null;const xn=sn&&sn.unsubscribe&&(()=>{sn.unsubscribe()});let Vn,Ln=null;const Yn=()=>new qn("Request body larger than maxBodyLength limit",qn.ERR_BAD_REQUEST,$,Mn);try{let Rn;const $t=Wt("auth");if($t){const kt=wt.getSafeProp($t,"username")||"",Vt=wt.getSafeProp($t,"password")||"";Rn={username:kt,password:Vt}}if(zEe(Y)){const kt=new URL(Y,Hs.origin);if(!Rn&&(kt.username||kt.password)){const Vt=KN(kt.username),Ie=KN(kt.password);Rn={username:Vt,password:Ie}}(kt.username||kt.password)&&(kt.username="",kt.password="",Y=kt.href)}if(Rn&&(lt.delete("authorization"),lt.set("Authorization","Basic "+btoa(BEe((Rn.username||"")+":"+(Rn.password||""))))),jt&&typeof Y=="string"&&Y.startsWith("data:")&&FEe(Y)>Ht)throw new qn("maxContentLength size of "+Ht+" exceeded",qn.ERR_BAD_RESPONSE,$,Mn);if(Zt&&X!=="get"&&X!=="head"){const kt=await U(K);if(typeof kt=="number"&&isFinite(kt)&&(Vn=kt,kt>zt))throw Yn()}const fn=Zt&&(wt.isReadableStream(K)||wt.isStream(K)),yn=(kt,Vt,Ie)=>ZN(kt,YN,Ve=>{if(Zt&&Ve>zt)throw Ln=Yn();Vt&&Vt(Ve)},Ie);if(L&&X!=="get"&&X!=="head"&&(Fe||fn)){if(Vn=Vn??await W(lt,K),Vn!==0||fn){let kt=new h(Y,{method:"POST",body:K,duplex:"half"}),Vt;if(wt.isFormData(K)&&(Vt=kt.headers.get("content-type"))&<.setContentType(Vt),kt.body){const[Ie,Ve]=Fe&&HN(Vn,GE(WN(Fe)))||[];K=yn(kt.body,Ie,Ve)}}}else if(fn&&!y&&C&&X!=="get"&&X!=="head")K=yn(K);else if(fn&&y&&!L&&X!=="get"&&X!=="head")throw new qn("Stream request bodies are not supported by the current fetch implementation",qn.ERR_NOT_SUPPORT,$,Mn);wt.isString(pt)||(pt=pt?"include":"omit");const Cn=y&&"credentials"in h.prototype;if(wt.isFormData(K)){const kt=lt.getContentType();kt&&/^multipart\/form-data/i.test(kt)&&!/boundary=/i.test(kt)&<.delete("content-type")}lt.set("User-Agent","axios/"+yL,!1);const _n={...Qt,signal:sn,method:X.toUpperCase(),headers:s7(lt.normalize()),body:K,duplex:"half",credentials:Cn?pt:void 0};Mn=y&&new h(Y,_n);let Bn=await(y?en(Mn,Qt):en(Y,_n));const Be=va.from(Bn.headers);if(jt){const kt=wt.toFiniteNumber(Be.getContentLength());if(kt!=null&&kt>Ht)throw new qn("maxContentLength size of "+Ht+" exceeded",qn.ERR_BAD_RESPONSE,$,Mn)}const Xe=D&&(qe==="stream"||qe==="response");if(D&&Bn.body&&(ke||jt||Xe&&xn)){const kt={};["status","statusText","headers"].forEach(Ut=>{kt[Ut]=Bn[Ut]});const Vt=wt.toFiniteNumber(Be.getContentLength()),[Ie,Ve]=ke&&HN(Vt,GE(WN(ke),!0))||[];let tt=0;const Rt=Ut=>{if(jt&&(tt=Ut,tt>Ht))throw new qn("maxContentLength size of "+Ht+" exceeded",qn.ERR_BAD_RESPONSE,$,Mn);Ie&&Ie(Ut)};Bn=new m(ZN(Bn.body,YN,Rt,()=>{Ve&&Ve(),xn&&xn()}),kt)}qe=qe||"text";let mt=await V[wt.findKey(V,qe)||"text"](Bn,$);if(jt&&!D&&!Xe){let kt;if(mt!=null&&(typeof mt.byteLength=="number"?kt=mt.byteLength:typeof mt.size=="number"?kt=mt.size:typeof mt=="string"&&(kt=typeof i=="function"?new i().encode(mt).byteLength:mt.length)),typeof kt=="number"&&kt>Ht)throw new qn("maxContentLength size of "+Ht+" exceeded",qn.ERR_BAD_RESPONSE,$,Mn)}return!Xe&&xn&&xn(),await new Promise((kt,Vt)=>{m7(kt,Vt,{data:mt,headers:va.from(Bn.headers),status:Bn.status,statusText:Bn.statusText,config:$,request:Mn})})}catch(Rn){if(xn&&xn(),sn&&sn.aborted&&sn.reason instanceof qn){const $t=sn.reason;throw $t.config=$,Mn&&($t.request=Mn),Rn!==$t&&($t.cause=Rn),$t}throw Ln?(Mn&&!Ln.request&&(Ln.request=Mn),Ln):Rn instanceof qn?(Mn&&!Rn.request&&(Rn.request=Mn),Rn):Rn&&Rn.name==="TypeError"&&/Load failed|fetch/i.test(Rn.message)?Object.assign(new qn("Network Error",qn.ERR_NETWORK,$,Mn,Rn&&Rn.response),{cause:Rn.cause||Rn}):qn.from(Rn,Rn&&Rn.code,$,Mn,Rn&&Rn.response)}}},VEe=new Map,y7=e=>{let t=e&&e.env||{};const{fetch:n,Request:i,Response:c}=t,h=[i,c,n];let m=h.length,a=m,y,E,C=VEe;for(;a--;)y=h[a],E=C.get(y),E===void 0&&C.set(y,E=a?new Map:NEe(t)),C=E;return E};y7();const vL={http:QTe,xhr:REe,fetch:{get:y7}};wt.forEach(vL,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const QN=e=>`- ${e}`,UEe=e=>wt.isFunction(e)||e===null||e===!1;function $Ee(e,t){e=wt.isArray(e)?e:[e];const{length:n}=e;let i,c;const h={};for(let m=0;m<n;m++){i=e[m];let a;if(c=i,!UEe(i)&&(c=vL[(a=String(i)).toLowerCase()],c===void 0))throw new qn(`Unknown adapter '${a}'`);if(c&&(wt.isFunction(c)||(c=c.get(t))))break;h[a||"#"+m]=c}if(!c){const m=Object.entries(h).map(([y,E])=>`adapter ${y} `+(E===!1?"is not supported by the environment":"is not available in the build"));let a=n?m.length>1?`since : 4059`+m.map(QN).join(` 4060`):" "+QN(m[0]):"as no adapter specified";throw new qn("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return c}const v7={getAdapter:$Ee,adapters:vL};function _P(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Qx(null,e)}function e4(e){return _P(e),e.headers=va.from(e.headers),e.data=gP.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),v7.getAdapter(e.adapter||Jx.adapter,e)(e).then(function(i){_P(e),e.response=i;try{i.data=gP.call(e,e.transformResponse,i)}finally{delete e.response}return i.headers=va.from(i.headers),i},function(i){if(!p7(i)&&(_P(e),i&&i.response)){e.response=i.response;try{i.response.data=gP.call(e,e.transformResponse,i.response)}finally{delete e.response}i.response.headers=va.from(i.response.headers)}return Promise.reject(i)})}const t2={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{t2[e]=function(i){return typeof i===e||"a"+(t<1?"n ":" ")+e}});const t4={};t2.transitional=function(t,n,i){function c(h,m){return"[Axios v"+yL+"] Transitional option '"+h+"'"+m+(i?". "+i:"")}return(h,m,a)=>{if(t===!1)throw new qn(c(m," has been removed"+(n?" in "+n:"")),qn.ERR_DEPRECATED);return n&&!t4[m]&&(t4[m]=!0,console.warn(c(m," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(h,m,a):!0}};t2.spelling=function(t){return(n,i)=>(console.warn(`${i} is likely a misspelling of ${t}`),!0)};function jEe(e,t,n){if(typeof e!="object")throw new qn("options must be an object",qn.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let c=i.length;for(;c-- >0;){const h=i[c],m=Object.prototype.hasOwnProperty.call(t,h)?t[h]:void 0;if(m){const a=e[h],y=a===void 0||m(a,h,e);if(y!==!0)throw new qn("option "+h+" must be "+y,qn.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new qn("Unknown option "+h,qn.ERR_BAD_OPTION)}}const JT={assertOptions:jEe,validators:t2},da=JT.validators;let km=class{constructor(t){this.defaults=t||{},this.interceptors={request:new jN,response:new jN}}async request(t,n){try{return await this._request(t,n)}catch(i){if(i instanceof Error){let c={};Error.captureStackTrace?Error.captureStackTrace(c):c=new Error;const h=(()=>{if(!c.stack)return"";const m=c.stack.indexOf(` 4061`);return m===-1?"":c.stack.slice(m+1)})();try{if(!i.stack)i.stack=h;else if(h){const m=h.indexOf(` 4062`),a=m===-1?-1:h.indexOf(` 4063`,m+1),y=a===-1?"":h.slice(a+1);String(i.stack).endsWith(y)||(i.stack+=` 4064`+h)}}catch{}}throw i}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=jm(this.defaults,n);const{transitional:i,paramsSerializer:c,headers:h}=n;i!==void 0&&JT.assertOptions(i,{silentJSONParsing:da.transitional(da.boolean),forcedJSONParsing:da.transitional(da.boolean),clarifyTimeoutError:da.transitional(da.boolean),legacyInterceptorReqResOrdering:da.transitional(da.boolean),advertiseZstdAcceptEncoding:da.transitional(da.boolean),validateStatusUndefinedResolves:da.transitional(da.boolean)},!1),c!=null&&(wt.isFunction(c)?n.paramsSerializer={serialize:c}:JT.assertOptions(c,{encode:da.function,serialize:da.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),JT.assertOptions(n,{baseUrl:da.spelling("baseURL"),withXsrfToken:da.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let m=h&&wt.merge(h.common,h[n.method]);h&&wt.forEach(["delete","get","head","post","put","patch","query","common"],V=>{delete h[V]}),n.headers=va.concat(m,h);const a=[];let y=!0;this.interceptors.request.forEach(function(U){if(typeof U.runWhen=="function"&&U.runWhen(n)===!1)return;y=y&&U.synchronous;const W=n.transitional||gL;W&&W.legacyInterceptorReqResOrdering?a.unshift(U.fulfilled,U.rejected):a.push(U.fulfilled,U.rejected)});const E=[];this.interceptors.response.forEach(function(U){E.push(U.fulfilled,U.rejected)});let C,P=0,L;if(!y){const V=[e4.bind(this),void 0];for(V.unshift(...a),V.push(...E),L=V.length,C=Promise.resolve(n);P<L;)C=C.then(V[P++],V[P++]);return C}L=a.length;let D=n;for(;P<L;){const V=a[P++],U=a[P++];try{D=V(D)}catch(W){U.call(this,W);break}}try{C=e4.call(this,D)}catch(V){return Promise.reject(V)}for(P=0,L=E.length;P<L;)C=C.then(E[P++],E[P++]);return C}getUri(t){t=jm(this.defaults,t);const n=g7(t.baseURL,t.url,t.allowAbsoluteUrls,t);return d7(n,t.params,t.paramsSerializer)}};wt.forEach(["delete","get","head","options"],function(t){km.prototype[t]=function(n,i){return this.request(jm(i||{},{method:t,url:n,data:i&&wt.hasOwnProp(i,"data")?i.data:void 0}))}});wt.forEach(["post","put","patch","query"],function(t){function n(i){return function(h,m,a){return this.request(jm(a||{},{method:t,headers:i?{"Content-Type":"multipart/form-data"}:{},url:h,data:m}))}}km.prototype[t]=n(),t!=="query"&&(km.prototype[t+"Form"]=n(!0))});let GEe=class b7{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(h){n=h});const i=this;this.promise.then(c=>{if(!i._listeners)return;let h=i._listeners.length;for(;h-- >0;)i._listeners[h](c);i._listeners=null}),this.promise.then=c=>{let h;const m=new Promise(a=>{i.subscribe(a),h=a}).then(c);return m.cancel=function(){i.unsubscribe(h)},m},t(function(h,m,a){i.reason||(i.reason=new Qx(h,m,a),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=i=>{t.abort(i)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new b7(function(c){t=c}),cancel:t}}};function HEe(e){return function(n){return e.apply(null,n)}}function WEe(e){return wt.isObject(e)&&e.isAxiosError===!0}const xk={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(xk).forEach(([e,t])=>{xk[t]=e});function x7(e){const t=new km(e),n=K9(km.prototype.request,t);return wt.extend(n,km.prototype,t,{allOwnKeys:!0}),wt.extend(n,t,null,{allOwnKeys:!0}),n.create=function(c){return x7(jm(e,c))},n}const qo=x7(Jx);qo.Axios=km;qo.CanceledError=Qx;qo.CancelToken=GEe;qo.isCancel=p7;qo.VERSION=yL;qo.toFormData=e2;qo.AxiosError=qn;qo.Cancel=qo.CanceledError;qo.all=function(t){return Promise.all(t)};qo.spread=HEe;qo.isAxiosError=WEe;qo.mergeConfig=jm;qo.AxiosHeaders=va;qo.formToJSON=e=>
4064f7(wt.isHTMLForm(e)?new FormData(e):e);qo.getAdapter=v7.getAdapter;qo.HttpStatusCode=xk;qo.default=qo;const{Axios:oDe,AxiosError:sDe,CanceledError:aDe,isCancel:lDe,CancelToken:cDe,VERSION:uDe,all:dDe,Cancel:hDe,isAxiosError:fDe,spread:pDe,toFormData:mDe,AxiosHeaders:gDe,HttpStatusCode:_De,formToJSON:yDe,getAdapter:vDe,mergeConfig:bDe,create:xDe}=qo,qEe=Ji(e=>{const t=Yf(),n=rr(),i=qo.create({baseURL:"/api/platform",withCredentials:!0,headers:{"Accept-Language":n.$i18n.locale.value,"X-Request-Source":"paseet-platform"}});i.interceptors.request.use(h=>{const m=localStorage.getItem(V_);return m&&(h.headers.Authorization=`Bearer ${m}`),h}),i.interceptors.response.use(h=>h,async h=>{const m=h.config;if(h.response?.status===401&&m&&!m.url?.includes("/auth/refresh-token")&&!m._retry){m._retry=!0;try{if(await t.refreshAccessToken()){const y=localStorage.getItem(V_);if(y)return m.headers=m.headers||{},m.headers.Authorization=`Bearer ${y}`,i.request(m)}}catch(a){console.error(a)}}return Promise.resolve(h.response)});const c=qo.create({baseURL:"/api/platform",withCredentials:!0,headers:{"Accept-Language":n.$i18n.locale.value,"X-Request-Source":"paseet-platform"}});e.provide("axios",i),e.provide("axiosPublic",c)});function e1(e){return e+.5|0}const Ff=(e,t,n)=>Math.max(Math.min(e,n),t);function xb(e){return Ff(e1(e*2.55),0,255)}function Wf(e){return Ff(e1(e*255),0,255)}function nh(e){return Ff(e1(e/2.55)/100,0,1)}function n4(e){return Ff(e1(e*100),0,100)}const cc={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},wk=[..."0123456789ABCDEF"],XEe=e=>wk[e&15],ZEe=e=>wk[(e&240)>>4]+wk[e&15],ST=e=>(e&240)>>4===(e&15),YEe=e=>ST(e.r)&&ST(e.g)&&ST(e.b)&&ST(e.a);function KEe(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&cc[e[1]]*17,g:255&cc[e[2]]*17,b:255&cc[e[3]]*17,a:t===5?cc[e[4]]*17:255}:(t===7||t===9)&&(n={r:cc[e[1]]<<4|cc[e[2]],g:cc[e[3]]<<4|cc[e[4]],b:cc[e[5]]<<4|cc[e[6]],a:t===9?cc[e[7]]<<4|cc[e[8]]:255})),n}const JEe=(e,t)=>e<255?t(e):"";function QEe(e){var t=YEe(e)?XEe:ZEe;return e?"#"+t(e.r)+t(e.g)+t(e.b)+JEe(e.a,t):void 0}const eCe=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function w7(e,t,n){const i=t*Math.min(n,1-n),c=(h,m=(h+e/30)%12)=>n-i*Math.max(Math.min(m-3,9-m,1),-1);return[c(0),c(8),c(4)]}function tCe(e,t,n){const i=(c,h=(c+e/60)%6)=>n-n*t*Math.max(Math.min(h,4-h,1),0);return[i(5),i(3),i(1)]}function nCe(e,t,n){const i=w7(e,1,.5);let c;for(t+n>1&&(c=1/(t+n),t*=c,n*=c),c=0;c<3;c++)i[c]*=1-t-n,i[c]+=t;return i}function rCe(e,t,n,i,c){return e===c?(t-n)/i+(t<n?6:0):t===c?(n-e)/i+2:(e-t)/i+4}function bL(e){const n=e.r/255,i=e.g/255,c=e.b/255,h=Math.max(n,i,c),m=Math.min(n,i,c),a=(h+m)/2;let y,E,C;return h!==m&&(C=h-m,E=a>.5?C/(2-h-m):C/(h+m),y=rCe(n,i,c,C,h),y=y*60+.5),[y|0,E||0,a]}function xL(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(Wf)}function wL(e,t,n){return xL(w7,e,t,n)}function iCe(e,t,n){return xL(nCe,e,t,n)}function oCe(e,t,n){return xL(tCe,e,t,n)}function S7(e){return(e%360+360)%360}function sCe(e){const t=eCe.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?xb(+t[5]):Wf(+t[5]));const c=S7(+t[2]),h=+t[3]/100,m=+t[4]/100;return t[1]==="hwb"?i=iCe(c,h,m):t[1]==="hsv"?i=oCe(c,h,m):i=wL(c,h,m),{r:i[0],g:i[1],b:i[2],a:n}}function aCe(e,t){var n=bL(e);n[0]=S7(n[0]+t),n=wL(n),e.r=n[0],e.g=n[1],e.b=n[2]}function lCe(e){if(!e)return;const t=bL(e),n=t[0],i=n4(t[1]),c=n4(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${c}%, ${nh(e.a)})`:`hsl(${n}, ${i}%, ${c}%)`}const r4={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},i4={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function cCe(){const e={},t=Object.keys(i4),n=Object.keys(r4);let i,c,h,m,a;for(i=0;i<t.length;i++){for(m=a=t[i],c=0;c<n.length;c++)h=n[c],a=a.replace(h,r4[h]);h=parseInt(i4[m],16),e[a]=[h>>16&255,h>>8&255,h&255]}return e}let TT;function uCe(e){TT||(TT=cCe(),TT.transparent=[0,0,0,0]);const t=TT[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const dCe=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function hCe(e){const t=dCe.exec(e);let n=255,i,c,h;if(t){if(t[7]!==i){const m=+t[7];n=t[8]?xb(m):Ff(m*255,0,255)}return i=+t[1],c=+t[3],h=+t[5],i=255&(t[2]?xb(i):Ff(i,0,255)),c=255&(t[4]?xb(c):Ff(c,0,255)),h=255&(t[6]?xb(h):Ff(h,0,255)),{r:i,g:c,b:h,a:n}}}function fCe(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${nh(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const yP=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,R_=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function pCe(e,t,n){const i=R_(nh(e.r)),c=R_(nh(e.g)),h=R_(nh(e.b));return{r:Wf(yP(i+n*(R_(nh(t.r))-i))),g:Wf(yP(c+n*(R_(nh(t.g))-c))),b:Wf(yP(h+n*(R_(nh(t.b))-h))),a:e.a+n*(t.a-e.a)}}function ET(e,t,n){if(e){let i=bL(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=wL(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function T7(e,t){return e&&Object.assign(t||{},e)}function o4(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>
40643&&(t.a=Wf(e[3]))):(t=T7(e,{r:0,g:0,b:0,a:1}),t.a=Wf(t.a)),t}function mCe(e){return e.charAt(0)==="r"?hCe(e):sCe(e)}class lx{constructor(t){if(t instanceof lx)return t;const n=typeof t;let i;n==="object"?i=o4(t):n==="string"&&(i=KEe(t)||uCe(t)||mCe(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=T7(this._rgb);return t&&(t.a=nh(t.a)),t}set rgb(t){this._rgb=o4(t)}rgbString(){return this._valid?fCe(this._rgb):void 0}hexString(){return this._valid?QEe(this._rgb):void 0}hslString(){return this._valid?lCe(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,c=t.rgb;let h;const m=n===h?.5:n,a=2*m-1,y=i.a-c.a,E=((a*y===-1?a:(a+y)/(1+a*y))+1)/2;h=1-E,i.r=255&E*i.r+h*c.r+.5,i.g=255&E*i.g+h*c.g+.5,i.b=255&E*i.b+h*c.b+.5,i.a=m*i.a+(1-m)*c.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=pCe(this._rgb,t._rgb,n)),this}clone(){return new lx(this.rgb)}alpha(t){return this._rgb.a=Wf(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=e1(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ET(this._rgb,2,t),this}darken(t){return ET(this._rgb,2,-t),this}saturate(t){return ET(this._rgb,1,t),this}desaturate(t){return ET(this._rgb,1,-t),this}rotate(t){return aCe(this._rgb,t),this}}function Zd(){}const gCe=(()=>{let e=0;return()=>e++})();function oi(e){return e==null}function vo(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function di(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function Wo(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Pl(e,t){return Wo(e)?e:t}function Br(e,t){return typeof e>"u"?t:e}const _Ce=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,E7=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function co(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Hi(e,t,n,i){let c,h,m;if(vo(e))for(h=e.length,c=0;c<h;c++)t.call(n,e[c],c);else if(di(e))for(m=Object.keys(e),h=m.length,c=0;c<h;c++)t.call(n,e[m[c]],m[c])}function WE(e,t){let n,i,c,h;if(!e||!t||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;++n)if(c=e[n],h=t[n],c.datasetIndex!==h.datasetIndex||c.index!==h.index)return!1;return!0}function qE(e){if(vo(e))return e.map(qE);if(di(e)){const t=Object.create(null),n=Object.keys(e),i=n.length;let c=0;for(;c<i;++c)t[n[c]]=qE(e[n[c]]);return t}return e}function C7(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function yCe(e,t,n,i){if(!C7(e))return;const c=t[e],h=n[e];di(c)&&di(h)?cx(c,h,i):t[e]=qE(h)}function cx(e,t,n){const i=vo(t)?t:[t],c=i.length;if(!di(e))return e;n=n||{};const h=n.merger||yCe;let m;for(let a=0;a<c;++a){if(m=i[a],!di(m))continue;const y=Object.keys(m);for(let E=0,C=y.length;E<C;++E)h(y[E],e,m,n)}return e}function Ub(e,t){return cx(e,t,{merger:vCe})}function vCe(e,t,n){if(!C7(e))return;const i=t[e],c=n[e];di(i)&&di(c)?Ub(i,c):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=qE(c))}const s4={"":e=>e,x:e=>e.x,y:e=>e.y};function bCe(e){const t=e.split("."),n=[];let i="";for(const c of t)i+=c,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function xCe(e){const t=bCe(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function ep(e,t){return(s4[t]||(s4[t]=xCe(t)))(e)}function SL(e){return e.charAt(0).toUpperCase()+e.slice(1)}const ux=e=>typeof e<"u",tp=e=>typeof e=="function",a4=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function wCe(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Ci=Math.PI,xo=2*Ci,SCe=xo+Ci,XE=Number.POSITIVE_INFINITY,TCe=Ci/180,es=Ci/2,hm=Ci/4,l4=Ci*2/3,Bf=Math.log10,rd=Math.sign;function $b(e,t,n){return Math.abs(e-t)<n}function c4(e){const t=Math.round(e);e=$b(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Bf(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function ECe(e){const t=[],n=Math.sqrt(e);let i;for(i=1;i<n;i++)e%i===0&&(t.push(i),t.push(e/i));
4064return n===(n|0)&&t.push(n),t.sort((c,h)=>c-h).pop(),t}function CCe(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function vy(e){return!CCe(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function ACe(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function A7(e,t,n){let i,c,h;for(i=0,c=e.length;i<c;i++)h=e[i][n],isNaN(h)||(t.min=Math.min(t.min,h),t.max=Math.max(t.max,h))}function Jc(e){return e*(Ci/180)}function TL(e){return e*(180/Ci)}function u4(e){if(!Wo(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function I7(e,t){const n=t.x-e.x,i=t.y-e.y,c=Math.sqrt(n*n+i*i);let h=Math.atan2(i,n);return h<-.5*Ci&&(h+=xo),{angle:h,distance:c}}function Sk(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function ICe(e,t){return(e-t+SCe)%xo-Ci}function pa(e){return(e%xo+xo)%xo}function dx(e,t,n,i){const c=pa(e),h=pa(t),m=pa(n),a=pa(h-c),y=pa(m-c),E=pa(c-h),C=pa(c-m);return c===h||c===m||i&&h===m||a>y&&E<C}function Ls(e,t,n){return Math.max(t,Math.min(n,e))}function PCe(e){return Ls(e,-32768,32767)}function lh(e,t,n,i=1e-6){return e>=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function EL(e,t,n){n=n||(m=>e[m]<t);let i=e.length-1,c=0,h;for(;i-c>1;)h=c+i>>1,n(h)?c=h:i=h;return{lo:c,hi:i}}const ch=(e,t,n,i)=>EL(e,n,i?c=>{const h=e[c][t];return h<n||h===n&&e[c+1][t]===n}:c=>e[c][t]<n),RCe=(e,t,n)=>EL(e,n,i=>e[i][t]>=n);function kCe(e,t,n){let i=0,c=e.length;for(;i<c&&e[i]<t;)i++;for(;c>i&&e[c-1]>n;)c--;return i>0||c<e.length?e.slice(i,c):e}const P7=["push","pop","shift","splice","unshift"];function MCe(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),P7.forEach(n=>{const i="_onData"+SL(n),c=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...h){const m=c.apply(this,h);return e._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...h)}),m}})})}function d4(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,c=i.indexOf(t);c!==-1&&i.splice(c,1),!(i.length>0)&&(P7.forEach(h=>{delete e[h]}),delete e._chartjs)}function R7(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const k7=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function M7(e,t){let n=[],i=!1;return function(...c){n=c,i||(i=!0,k7.call(window,()=>{i=!1,e.apply(t,n)}))}}function LCe(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const CL=e=>e==="start"?"left":e==="end"?"right":"center",fa=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,OCe=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;
4064function L7(e,t,n){const i=t.length;let c=0,h=i;if(e._sorted){const{iScale:m,vScale:a,_parsed:y}=e,E=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,C=m.axis,{min:P,max:L,minDefined:D,maxDefined:V}=m.getUserBounds();if(D){if(c=Math.min(ch(y,C,P).lo,n?i:ch(t,C,m.getPixelForValue(P)).lo),E){const U=y.slice(0,c+1).reverse().findIndex(W=>!oi(W[a.axis]));c-=Math.max(0,U)}c=Ls(c,0,i-1)}if(V){let U=Math.max(ch(y,m.axis,L,!0).hi+1,n?0:ch(t,C,m.getPixelForValue(L),!0).hi+1);if(E){const W=y.slice(U-1).findIndex($=>!oi($[a.axis]));U+=Math.max(0,W)}h=Ls(U,c,i)-c}else h=i-c}return{start:c,count:h}}function O7(e){const{xScale:t,yScale:n,_scaleRanges:i}=e,c={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=c,!0;const h=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,c),h}const CT=e=>e===0||e===1,h4=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*xo/n)),f4=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*xo/n)+1,jb={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*es)+1,easeOutSine:e=>Math.sin(e*es),easeInOutSine:e=>-.5*(Math.cos(Ci*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>CT(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>CT(e)?e:h4(e,.075,.3),easeOutElastic:e=>CT(e)?e:f4(e,.075,.3),easeInOutElastic(e){return CT(e)?e:e<.5?.5*h4(e*2,.1125,.45):.5+.5*f4(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-jb.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?jb.easeInBounce(e*2)*.5:jb.easeOutBounce(e*2-1)*.5+.5};function AL(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function p4(e){return AL(e)?e:new lx(e)}function vP(e){return AL(e)?e:new lx(e).saturate(.5).darken(.1).hexString()}const DCe=["x","y","borderWidth","radius","tension"],FCe=["color","borderColor","backgroundColor"];function BCe(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:FCe},numbers:{type:"number",properties:DCe}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function zCe(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const m4=new Map;function NCe(e,t){t=t||{};const n=e+JSON.stringify(t);let i=m4.get(n);return i||(i=new Intl.NumberFormat(e,t),m4.set(n,i)),i}function t1(e,t,n){return NCe(t,n).format(e)}const D7={values(e){return vo(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let c,h=e;if(n.length>1){const E=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(E<1e-4||E>1e15)&&(c="scientific"),h=VCe(e,n)}const m=Bf(Math.abs(h)),a=isNaN(m)?1:Math.max(Math.min(-1*Math.floor(m),20),0),y={notation:c,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(y,this.options.ticks.format),t1(e,i,y)},logarithmic(e,t,n){if(e===0)return"0";const i=n[t].significand||e/Math.pow(10,Math.floor(Bf(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?D7.numeric.call(this,e,t,n):""}};function VCe(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var n2={formatters:D7};function UCe(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:n2.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Gm=Object.create(null),Tk=Object.create(null);function Gb(e,t){if(!t)return e;const n=t.split(".");for(let i=0,c=n.length;i<c;++i){const h=n[i];e=e[h]||(e[h]=Object.create(null))}return e}function bP(e,t,n){return typeof t=="string"?cx(Gb(e,t),n):cx(Gb(e,""),t)}class $Ce{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={}
4064,this.hoverBackgroundColor=(i,c)=>vP(c.backgroundColor),this.hoverBorderColor=(i,c)=>vP(c.borderColor),this.hoverColor=(i,c)=>vP(c.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return bP(this,t,n)}get(t){return Gb(this,t)}describe(t,n){return bP(Tk,t,n)}override(t,n){return bP(Gm,t,n)}route(t,n,i,c){const h=Gb(this,t),m=Gb(this,i),a="_"+n;Object.defineProperties(h,{[a]:{value:h[n],writable:!0},[n]:{enumerable:!0,get(){const y=this[a],E=m[c];return di(y)?Object.assign({},E,y):Br(y,E)},set(y){this[a]=y}}})}apply(t){t.forEach(n=>n(this))}}var Ro=new $Ce({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[BCe,zCe,UCe]);function jCe(e){return!e||oi(e.size)||oi(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function ZE(e,t,n,i,c){let h=t[c];return h||(h=t[c]=e.measureText(c).width,n.push(c)),h>i&&(i=h),i}function GCe(e,t,n,i){i=i||{};let c=i.data=i.data||{},h=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(c=i.data={},h=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let m=0;const a=n.length;let y,E,C,P,L;for(y=0;y<a;y++)if(P=n[y],P!=null&&!vo(P))m=ZE(e,c,h,m,P);else if(vo(P))for(E=0,C=P.length;E<C;E++)L=P[E],L!=null&&!vo(L)&&(m=ZE(e,c,h,m,L));e.restore();const D=h.length/2;if(D>n.length){for(y=0;y<D;y++)delete c[h[y]];h.splice(0,D)}return m}function fm(e,t,n){const i=e.currentDevicePixelRatio,c=n!==0?Math.max(n/2,.5):0;return Math.round((t-c)*i)/i+c}function g4(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Ek(e,t,n,i){F7(e,t,n,i,null)}function F7(e,t,n,i,c){let h,m,a,y,E,C,P,L;const D=t.pointStyle,V=t.rotation,U=t.radius;let W=(V||0)*TCe;if(D&&typeof D=="object"&&(h=D.toString(),h==="[object HTMLImageElement]"||h==="[object HTMLCanvasElement]")){e.save(),e.translate(n,i),e.rotate(W),e.drawImage(D,-D.width/2,-D.height/2,D.width,D.height),e.restore();return}if(!(isNaN(U)||U<=0)){switch(e.beginPath(),D){default:c?e.ellipse(n,i,c/2,U,0,0,xo):e.arc(n,i,U,0,xo),e.closePath();break;case"triangle":C=c?c/2:U,e.moveTo(n+Math.sin(W)*C,i-Math.cos(W)*U),W+=l4,e.lineTo(n+Math.sin(W)*C,i-Math.cos(W)*U),W+=l4,e.lineTo(n+Math.sin(W)*C,i-Math.cos(W)*U),e.closePath();break;case"rectRounded":E=U*.516,y=U-E,m=Math.cos(W+hm)*y,P=Math.cos(W+hm)*(c?c/2-E:y),a=Math.sin(W+hm)*y,L=Math.sin(W+hm)*(c?c/2-E:y),e.arc(n-P,i-a,E,W-Ci,W-es),e.arc(n+L,i-m,E,W-es,W),e.arc(n+P,i+a,E,W,W+es),e.arc(n-L,i+m,E,W+es,W+Ci),e.closePath();break;case"rect":if(!V){y=Math.SQRT1_2*U,C=c?c/2:y,e.rect(n-C,i-y,2*C,2*y);break}W+=hm;case"rectRot":P=Math.cos(W)*(c?c/2:U),m=Math.cos(W)*U,a=Math.sin(W)*U,L=Math.sin(W)*(c?c/2:U),e.moveTo(n-P,i-a),e.lineTo(n+L,i-m),e.lineTo(n+P,i+a),e.lineTo(n-L,i+m),e.closePath();break;case"crossRot":W+=hm;case"cross":P=Math.cos(W)*(c?c/2:U),m=Math.cos(W)*U,a=Math.sin(W)*U,L=Math.sin(W)*(c?c/2:U),e.moveTo(n-P,i-a),e.lineTo(n+P,i+a),e.moveTo(n+L,i-m),e.lineTo(n-L,i+m);break;case"star":P=Math.cos(W)*(c?c/2:U),m=Math.cos(W)*U,a=Math.sin(W)*U,L=Math.sin(W)*(c?c/2:U),e.moveTo(n-P,i-a),e.lineTo(n+P,i+a),e.moveTo(n+L,i-m),e.lineTo(n-L,i+m),W+=hm,P=Math.cos(W)*(c?c/2:U),m=Math.cos(W)*U,a=Math.sin(W)*U,L=Math.sin(W)*(c?c/2:U),e.moveTo(n-P,i-a),e.lineTo(n+P,i+a),e.moveTo(n+L,i-m),e.lineTo(n-L,i+m);break;case"line":m=c?c/2:Math.cos(W)*U,a=Math.sin(W)*U,e.moveTo(n-m,i-a),e.lineTo(n+m,i+a);break;case"dash":e.moveTo(n,i),e.lineTo(n+Math.cos(W)*(c?c/2:U),i+Math.sin(W)*U);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function uh(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function r2(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function i2(e){e.restore()}function HCe(e,t,n,i,c){if(!t)return e.lineTo(n.x,n.y);if(c==="middle"){const h=(t.x+n.x)/2;e.lineTo(h,t.y),e.lineTo(h,n.y)}else c==="after"!=!!i?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function WCe(e,t,n,i){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function qCe(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),oi(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function XCe(e,t,n,i,c){if(c.strikethrough||c.underline){const h=e.measureText(i),m=t-h.actualBoundingBoxLeft,a=t+h.actualBoundingBoxRight,y=n-h.actualBoundingBoxAscent,E=n+h.actualBoundingBoxDescent,C=c.strikethrough?(y+E)/2:E;
4064e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=c.decorationWidth||2,e.moveTo(m,C),e.lineTo(a,C),e.stroke()}}function ZCe(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Hm(e,t,n,i,c,h={}){const m=vo(t)?t:[t],a=h.strokeWidth>0&&h.strokeColor!=="";let y,E;for(e.save(),e.font=c.string,qCe(e,h),y=0;y<m.length;++y)E=m[y],h.backdrop&&ZCe(e,h.backdrop),a&&(h.strokeColor&&(e.strokeStyle=h.strokeColor),oi(h.strokeWidth)||(e.lineWidth=h.strokeWidth),e.strokeText(E,n,i,h.maxWidth)),e.fillText(E,n,i,h.maxWidth),XCe(e,n,i,E,h),i+=Number(c.lineHeight);e.restore()}function hx(e,t){const{x:n,y:i,w:c,h,radius:m}=t;e.arc(n+m.topLeft,i+m.topLeft,m.topLeft,1.5*Ci,Ci,!0),e.lineTo(n,i+h-m.bottomLeft),e.arc(n+m.bottomLeft,i+h-m.bottomLeft,m.bottomLeft,Ci,es,!0),e.lineTo(n+c-m.bottomRight,i+h),e.arc(n+c-m.bottomRight,i+h-m.bottomRight,m.bottomRight,es,0,!0),e.lineTo(n+c,i+m.topRight),e.arc(n+c-m.topRight,i+m.topRight,m.topRight,0,-es,!0),e.lineTo(n+m.topLeft,i)}const YCe=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,KCe=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function JCe(e,t){const n=(""+e).match(YCe);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const QCe=e=>+e||0;function IL(e,t){const n={},i=di(t),c=i?Object.keys(t):t,h=di(e)?i?m=>Br(e[m],e[t[m]]):m=>e[m]:()=>e;for(const m of c)n[m]=QCe(h(m));return n}function B7(e){return IL(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Mm(e){return IL(e,["topLeft","topRight","bottomLeft","bottomRight"])}function ba(e){const t=B7(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Ts(e,t){e=e||{},t=t||Ro.font;let n=Br(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=Br(e.style,t.style);i&&!(""+i).match(KCe)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const c={family:Br(e.family,t.family),lineHeight:JCe(Br(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:Br(e.weight,t.weight),string:""};return c.string=jCe(c),c}function wb(e,t,n,i){let c,h,m;for(c=0,h=e.length;c<h;++c)if(m=e[c],m!==void 0&&(t!==void 0&&typeof m=="function"&&(m=m(t)),n!==void 0&&vo(m)&&(m=m[n%m.length]),m!==void 0))return m}function e2e(e,t,n){const{min:i,max:c}=e,h=E7(t,(c-i)/2),m=(a,y)=>n&&a===0?0:a+y;return{min:m(i,-Math.abs(h)),max:m(c,h)}}function ap(e,t){return Object.assign(Object.create(e),t)}function PL(e,t=[""],n,i,c=()=>e[0]){const h=n||e;typeof i>"u"&&(i=U7("_fallback",e));const m={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:h,_fallback:i,_getTarget:c,override:a=>PL([a,...e],t,h,i)};return new Proxy(m,{deleteProperty(a,y){return delete a[y],delete a._keys,delete e[0][y],!0},get(a,y){return N7(a,y,()=>l2e(y,t,e,a))},getOwnPropertyDescriptor(a,y){return Reflect.getOwnPropertyDescriptor(a._scopes[0],y)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,y){return y4(a).includes(y)},ownKeys(a){return y4(a)},set(a,y,E){const C=a._storage||(a._storage=c());return a[y]=C[y]=E,delete a._keys,!0}})}function by(e,t,n,i){const c={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:z7(e,i),setContext:h=>by(e,h,n,i),override:h=>by(e.override(h),t,n,i)};return new Proxy(c,{deleteProperty(h,m){return delete h[m],delete e[m],!0},get(h,m,a){return N7(h,m,()=>n2e(h,m,a))},getOwnPropertyDescriptor(h,m){return h._descriptors.allKeys?Reflect.has(e,m)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,m)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(h,m){return Reflect.has(e,m)},ownKeys(){return Reflect.ownKeys(e)},set(h,m,a){return e[m]=a,delete h[m],!0}})}function z7(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:c=t.allKeys}=e;return{allKeys:c,scriptable:n,indexable:i,isScriptable:tp(n)?n:()=>n,isIndexable:tp(i)?i:()=>i}}const t2e=(e,t)=>e?e+SL(t):t,RL=(e,t)=>di(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function N7(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const i=n();return e[t]=i,i}function n2e(e,t,n){const{_proxy:i,_context:c,_subProxy:h,_descriptors:m}=e;let a=i[t];return tp(a)&&m.isScriptable(t)&&(a=r2e(t,a,e,n)),vo(a)&&a.length&&(a=i2e(t,a,e,m.isIndexable)),RL(t,a)&&(a=by(a,c,h&&h[t],m)),a}function r2e(e,t,n,i){const{_proxy:c,_context:h,_subProxy:m,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let y=t(h,m||i);return a.delete(e),RL(e,y)&&(y=kL(c._scopes,c,e,y)),y}function i2e(e,t,n,i){const{_proxy:c,_context:h,_subProxy:m,_descriptors:a}=n;if(typeof h.index<"u"&&i(e))return t[h.index%t.length];if(di(t[0])){const y=t,E=c._scopes.filter(C=>C!==y);t=[];for(const C of y){const P=kL(E,c,e,C);t.push(by(P,h,m&&m[e],a))}}return t}
4064function V7(e,t,n){return tp(e)?e(t,n):e}const o2e=(e,t)=>e===!0?t:typeof e=="string"?ep(t,e):void 0;function s2e(e,t,n,i,c){for(const h of t){const m=o2e(n,h);if(m){e.add(m);const a=V7(m._fallback,n,c);if(typeof a<"u"&&a!==n&&a!==i)return a}else if(m===!1&&typeof i<"u"&&n!==i)return null}return!1}function kL(e,t,n,i){const c=t._rootScopes,h=V7(t._fallback,n,i),m=[...e,...c],a=new Set;a.add(i);let y=_4(a,m,n,h||n,i);return y===null||typeof h<"u"&&h!==n&&(y=_4(a,m,h,y,i),y===null)?!1:PL(Array.from(a),[""],c,h,()=>a2e(t,n,i))}function _4(e,t,n,i,c){for(;n;)n=s2e(e,t,n,i,c);return n}function a2e(e,t,n){const i=e._getTarget();t in i||(i[t]={});const c=i[t];return vo(c)&&di(n)?n:c||{}}function l2e(e,t,n,i){let c;for(const h of t)if(c=U7(t2e(h,e),n),typeof c<"u")return RL(e,c)?kL(n,i,e,c):c}function U7(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function y4(e){let t=e._keys;return t||(t=e._keys=c2e(e._scopes)),t}function c2e(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(c=>!c.startsWith("_")))t.add(i);return Array.from(t)}function $7(e,t,n,i){const{iScale:c}=e,{key:h="r"}=this._parsing,m=new Array(i);let a,y,E,C;for(a=0,y=i;a<y;++a)E=a+n,C=t[E],m[a]={r:c.parse(ep(C,h),E)};return m}const u2e=Number.EPSILON||1e-14,xy=(e,t)=>t<e.length&&!e[t].skip&&e[t],j7=e=>e==="x"?"y":"x";function d2e(e,t,n,i){const c=e.skip?t:e,h=t,m=n.skip?t:n,a=Sk(h,c),y=Sk(m,h);let E=a/(a+y),C=y/(a+y);E=isNaN(E)?0:E,C=isNaN(C)?0:C;const P=i*E,L=i*C;return{previous:{x:h.x-P*(m.x-c.x),y:h.y-P*(m.y-c.y)},next:{x:h.x+L*(m.x-c.x),y:h.y+L*(m.y-c.y)}}}function h2e(e,t,n){const i=e.length;let c,h,m,a,y,E=xy(e,0);for(let C=0;C<i-1;++C)if(y=E,E=xy(e,C+1),!(!y||!E)){if($b(t[C],0,u2e)){n[C]=n[C+1]=0;continue}c=n[C]/t[C],h=n[C+1]/t[C],a=Math.pow(c,2)+Math.pow(h,2),!(a<=9)&&(m=3/Math.sqrt(a),n[C]=c*m*t[C],n[C+1]=h*m*t[C])}}function f2e(e,t,n="x"){const i=j7(n),c=e.length;let h,m,a,y=xy(e,0);for(let E=0;E<c;++E){if(m=a,a=y,y=xy(e,E+1),!a)continue;const C=a[n],P=a[i];m&&(h=(C-m[n])/3,a[`cp1${n}`]=C-h,a[`cp1${i}`]=P-h*t[E]),y&&(h=(y[n]-C)/3,a[`cp2${n}`]=C+h,a[`cp2${i}`]=P+h*t[E])}}function p2e(e,t="x"){const n=j7(t),i=e.length,c=Array(i).fill(0),h=Array(i);let m,a,y,E=xy(e,0);for(m=0;m<i;++m)if(a=y,y=E,E=xy(e,m+1),!!y){if(E){const C=E[t]-y[t];c[m]=C!==0?(E[n]-y[n])/C:0}h[m]=a?E?rd(c[m-1])!==rd(c[m])?0:(c[m-1]+c[m])/2:c[m-1]:c[m]}h2e(e,c,h),f2e(e,h,t)}function AT(e,t,n){return Math.max(Math.min(e,n),t)}function m2e(e,t){let n,i,c,h,m,a=uh(e[0],t);for(n=0,i=e.length;n<i;++n)m=h,h=a,a=n<i-1&&uh(e[n+1],t),h&&(c=e[n],m&&(c.cp1x=AT(c.cp1x,t.left,t.right),c.cp1y=AT(c.cp1y,t.top,t.bottom)),a&&(c.cp2x=AT(c.cp2x,t.left,t.right),c.cp2y=AT(c.cp2y,t.top,t.bottom)))}function g2e(e,t,n,i,c){let h,m,a,y;if(t.spanGaps&&(e=e.filter(E=>!E.skip)),t.cubicInterpolationMode==="monotone")p2e(e,c);else{let E=i?e[e.length-1]:e[0];for(h=0,m=e.length;h<m;++h)a=e[h],y=d2e(E,a,e[Math.min(h+1,m-(i?0:1))%m],t.tension),a.cp1x=y.previous.x,a.cp1y=y.previous.y,a.cp2x=y.next.x,a.cp2y=y.next.y,E=a}t.capBezierPoints&&m2e(e,n)}function ML(){return typeof window<"u"&&typeof document<"u"}function LL(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function YE(e,t,n){let i;return typeof e=="string"?(i=parseInt(e,10),e.indexOf("%")!==-1&&(i=i/100*t.parentNode[n])):i=e,i}const o2=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function _2e(e,t){return o2(e).getPropertyValue(t)}const y2e=["top","right","bottom","left"];function Lm(e,t,n){const i={};n=n?"-"+n:"";for(let c=0;c<4;c++){const h=y2e[c];i[h]=parseFloat(e[t+"-"+h+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const v2e=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function b2e(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:c,offsetY:h}=i;let m=!1,a,y;if(v2e(c,h,e.target))a=c,y=h;else{const E=t.getBoundingClientRect();a=i.clientX-E.left,y=i.clientY-E.top,m=!0}return{x:a,y,box:m}}function ym(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,c=o2(n),h=c.boxSizing==="border-box",m=Lm(c,"padding"),a=Lm(c,"border","width"),{x:y,y:E,box:C}=b2e(e,n),P=m.left+(C&&a.left),L=m.top+(C&&a.top);let{width:D,height:V}=t;return h&&(D-=m.width+a.width,V-=m.height+a.height),{x:Math.round((y-P)/D*n.width/i),y:Math.round((E-L)/V*n.height/i)}}function x2e(e,t,n){let i,c;if(t===void 0||n===void 0){const h=e&&LL(e);if(!h)t=e.clientWidth,n=e.clientHeight;else{const m=h.getBoundingClientRect(),a=o2(h),y=Lm(a,"border","width"),E=Lm(a,"padding");t=m.width-E.width-y.width,n=m.height-E.height-y.height,i=YE(a.maxWidth,h,"clientWidth"),c=YE(a.maxHeight,h,"clientHeight")}}return{width:t,height:n,maxWidth:i||XE,maxHeight:c||XE}}const zf=e=>Math.round(e*10)/10;function w2e(e,t,n,i){const c=o2(e),h=Lm(c,"margin"),m=YE(c.maxWidth,e,"clientWidth")||XE,a=YE(c.maxHeight,e,"clientHeight")||XE,y=x2e(e,t,n);let{width:E,height:C}=y;if(c.boxSizing==="content-box"){const L=Lm(c,"border","width"),D=Lm(c,"padding");E-=D.width+L.width,C-=D.height+L.height}return E=Math.max(0,E-h.width),C=Math.max(0,i?E/i:C-h.height),E=zf(Math.min(E,m,y.maxWidth)),C=zf(Math.min(C,a,y.maxHeight)),E&&!C&&(C=zf(E/2)),(t!==void 0||n!==void 0)&&i&&y.height&&C>y.height&&(C=y.height,E=zf(Math.floor(C*i))),{width:E,height:C}}function v4(e,t,n){const i=t||1,c=zf(e.height*i),h=zf(e.width*i);e.height=zf(e.height),e.width=zf(e.width);const m=e.canvas;return m.style&&(n||!m.style.height&&!m.style.width)&&(m.style.height=`${e.height}px`,m.style.width=`${e.width}px`),e.currentDevicePixelRatio!==i||m.height!==c||m.width!==h?(e.currentDevicePixelRatio=i,m.height=c,m.width=h,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const S2e=(function(){let e=!1;
4064try{const t={get passive(){return e=!0,!1}};ML()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function b4(e,t){const n=_2e(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function vm(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function T2e(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:i==="middle"?n<.5?e.y:t.y:i==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function E2e(e,t,n,i){const c={x:e.cp2x,y:e.cp2y},h={x:t.cp1x,y:t.cp1y},m=vm(e,c,n),a=vm(c,h,n),y=vm(h,t,n),E=vm(m,a,n),C=vm(a,y,n);return vm(E,C,n)}const C2e=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,i){return n-i},leftForLtr(n,i){return n-i}}},A2e=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function ty(e,t,n){return e?C2e(t,n):A2e()}function G7(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function H7(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function W7(e){return e==="angle"?{between:dx,compare:ICe,normalize:pa}:{between:lh,compare:(t,n)=>t-n,normalize:t=>t}}function x4({start:e,end:t,count:n,loop:i,style:c}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:c}}function I2e(e,t,n){const{property:i,start:c,end:h}=n,{between:m,normalize:a}=W7(i),y=t.length;let{start:E,end:C,loop:P}=e,L,D;if(P){for(E+=y,C+=y,L=0,D=y;L<D&&m(a(t[E%y][i]),c,h);++L)E--,C--;E%=y,C%=y}return C<E&&(C+=y),{start:E,end:C,loop:P,style:e.style}}function q7(e,t,n){if(!n)return[e];const{property:i,start:c,end:h}=n,m=t.length,{compare:a,between:y,normalize:E}=W7(i),{start:C,end:P,loop:L,style:D}=I2e(e,t,n),V=[];let U=!1,W=null,$,Y,X;const K=()=>y(c,X,$)&&a(c,X)!==0,ne=()=>a(h,$)===0||y(h,X,$),fe=()=>U||K(),ye=()=>!U||ne();for(let ke=C,Fe=C;ke<=P;++ke)Y=t[ke%m],!Y.skip&&($=E(Y[i]),$!==X&&(U=y($,c,h),W===null&&fe()&&(W=a($,c)===0?ke:Fe),W!==null&&ye()&&(V.push(x4({start:W,end:ke,loop:L,count:m,style:D})),W=null),Fe=ke,X=$));return W!==null&&V.push(x4({start:W,end:P,loop:L,count:m,style:D})),V}function X7(e,t){const n=[],i=e.segments;for(let c=0;c<i.length;c++){const h=q7(i[c],e.points,t);h.length&&n.push(...h)}return n}function P2e(e,t,n,i){let c=0,h=t-1;if(n&&!i)for(;c<t&&!e[c].skip;)c++;for(;c<t&&e[c].skip;)c++;for(c%=t,n&&(h+=c);h>c&&e[h%t].skip;)h--;return h%=t,{start:c,end:h}}function R2e(e,t,n,i){const c=e.length,h=[];let m=t,a=e[t],y;for(y=t+1;y<=n;++y){const E=e[y%c];E.skip||E.stop?a.skip||(i=!1,h.push({start:t%c,end:(y-1)%c,loop:i}),t=m=E.stop?y:null):(m=y,a.skip&&(t=y)),a=E}return m!==null&&h.push({start:t%c,end:m%c,loop:i}),h}function k2e(e,t){const n=e.points,i=e.options.spanGaps,c=n.length;if(!c)return[];const h=!!e._loop,{start:m,end:a}=P2e(n,c,h,i);if(i===!0)return w4(e,[{start:m,end:a,loop:h}],n,t);const y=a<m?a+c:a,E=!!e._fullLoop&&m===0&&a===c-1;return w4(e,R2e(n,m,y,E),n,t)}function w4(e,t,n,i){return!i||!i.setContext||!n?t:M2e(e,t,n,i)}function M2e(e,t,n,i){const c=e._chart.getContext(),h=S4(e.options),{_datasetIndex:m,options:{spanGaps:a}}=e,y=n.length,E=[];let C=h,P=t[0].start,L=P;function D(V,U,W,$){const Y=a?-1:1;if(V!==U){for(V+=y;n[V%y].skip;)V-=Y;for(;n[U%y].skip;)U+=Y;V%y!==U%y&&(E.push({start:V%y,end:U%y,loop:W,style:$}),C=$,P=U%y)}}for(const V of t){P=a?P:V.start;let U=n[P%y],W;for(L=P+1;L<=V.end;L++){const $=n[L%y];W=S4(i.setContext(ap(c,{type:"segment",p0:U,p1:$,p0DataIndex:(L-1)%y,p1DataIndex:L%y,datasetIndex:m}))),L2e(W,C)&&D(P,L-1,V.loop,C),U=$,C=W}P<L-1&&D(P,L-1,V.loop,C)}return E}function S4(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function L2e(e,t){if(!t)return!1;const n=[],i=function(c,h){return AL(h)?(n.includes(h)||n.push(h),n.indexOf(h)):h};return JSON.stringify(e,i)!==JSON.stringify(t,i)}function IT(e,t,n){return e.options.clip?e[n]:t[n]}function O2e(e,t){const{xScale:n,yScale:i}=e;
4064return n&&i?{left:IT(n,t,"left"),right:IT(n,t,"right"),top:IT(i,t,"top"),bottom:IT(i,t,"bottom")}:t}function Z7(e,t){const n=t._clip;if(n.disabled)return!1;const i=O2e(t,e.chartArea);return{left:n.left===!1?0:i.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:i.right+(n.right===!0?0:n.right),top:n.top===!1?0:i.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:i.bottom+(n.bottom===!0?0:n.bottom)}}class D2e{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,c){const h=n.listeners[c],m=n.duration;h.forEach(a=>a({chart:t,initial:n.initial,numSteps:m,currentStep:Math.min(i-n.start,m)}))}_refresh(){this._request||(this._running=!0,this._request=k7.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,c)=>{if(!i.running||!i.items.length)return;const h=i.items;let m=h.length-1,a=!1,y;for(;m>=0;--m)y=h[m],y._active?(y._total>i.duration&&(i.duration=y._total),y.tick(t),a=!0):(h[m]=h[h.length-1],h.pop());a&&(c.draw(),this._notify(c,i,t,"progress")),h.length||(i.running=!1,this._notify(c,i,t,"complete"),i.initial=!1),n+=h.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,c)=>Math.max(i,c._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const i=n.items;let c=i.length-1;for(;c>=0;--c)i[c].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Kd=new D2e;const T4="transparent",F2e={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=p4(e||T4),c=i.valid&&p4(t||T4);return c&&c.valid?c.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class B2e{constructor(t,n,i,c){const h=n[i];c=wb([t.to,c,h,t.from]);const m=wb([t.from,h,c]);this._active=!0,this._fn=t.fn||F2e[t.type||typeof m],this._easing=jb[t.easing]||jb.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=i,this._from=m,this._to=c,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const c=this._target[this._prop],h=i-this._start,m=this._duration-h;this._start=i,this._duration=Math.floor(Math.max(m,t.duration)),this._total+=h,this._loop=!!t.loop,this._to=wb([t.to,n,c,t.from]),this._from=wb([t.from,c,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,c=this._prop,h=this._from,m=this._loop,a=this._to;let y;if(this._active=h!==a&&(m||n<i),!this._active){this._target[c]=a,this._notify(!0);return}if(n<0){this._target[c]=h;return}y=n/i%2,y=m&&y>1?2-y:y,y=this._easing(Math.min(1,Math.max(0,y))),this._target[c]=this._fn(h,a,y)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let c=0;c<i.length;c++)i[c][n]()}}class Y7{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!di(t))return;const n=Object.keys(Ro.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(c=>{const h=t[c];if(!di(h))return;const m={};for(const a of n)m[a]=h[a];(vo(h.properties)&&h.properties||[c]).forEach(a=>{(a===c||!i.has(a))&&i.set(a,m)})})}_animateOptions(t,n){const i=n.options,c=N2e(t,i);if(!c)return[];const h=this._createAnimations(c,i);return i.$shared&&z2e(t.options.$animations,i).then(()=>{t.options=i},()=>{}),h}_createAnimations(t,n){const i=this._properties,c=[],h=t.$animations||(t.$animations={}),m=Object.keys(n),a=Date.now();let y;for(y=m.length-1;y>=0;--y){const E=m[y];if(E.charAt(0)==="$")continue;if(E==="options"){c.push(...this._animateOptions(t,n));continue}const C=n[E];let P=h[E];const L=i.get(E);if(P)if(L&&P.active()){P.update(L,C,a);continue}else P.cancel();if(!L||!L.duration){t[E]=C;continue}h[E]=P=new B2e(L,t,E,C),c.push(P)}return c}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return Kd.add(this._chart,i),!0}}function z2e(e,t){const n=[],i=Object.keys(t);for(let c=0;c<i.length;c++){const h=e[i[c]];h&&h.active()&&n.push(h.wait())}return Promise.all(n)}function N2e(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function E4(e,t){const n=e&&e.options||{},i=n.reverse,c=n.min===void 0?t:0,h=n.max===void 0?t:0;return{start:i?h:c,end:i?c:h}}function V2e(e,t,n){if(n===!1)return!1;const i=E4(e,n),c=E4(t,n);return{top:c.end,right:i.end,bottom:c.start,left:i.start}}function U2e(e){let t,n,i,c;return di(e)?(t=e.top,n=e.right,i=e.bottom,c=e.left):t=n=i=c=e,{top:t,right:n,bottom:i,left:c,disabled:e===!1}}function K7(e,t){const n=[],i=e._getSortedDatasetMetas(t);let c,h;for(c=0,h=i.length;c<h;++c)n.push(i[c].index);return n}function C4(e,t,n,i={}){const c=e.keys,h=i.mode==="single";let m,a,y,E;if(t===null)return;let C=!1;for(m=0,a=c.length;m<a;++m){if(y=+c[m],y===n){if(C=!0,i.all)continue;break}E=e.values[y],Wo(E)&&(h||t===0||rd(t)===rd(E))&&(t+=E)}return!C&&!i.all?0:t}function $2e(e,t){const{iScale:n,vScale:i}=t,c=n.axis==="x"?"x":"y",h=i.axis==="x"?"x":"y",m=Object.keys(e),a=new Array(m.length);let y,E,C;for(y=0,E=m.length;y<E;++y)C=m[y],a[y]={[c]:C,[h]:e[C]};return a}function xP(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function j2e(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function G2e(e){const{min:t,max:n,minDefined:i,maxDefined:c}=e.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:c?n:Number.POSITIVE_INFINITY}}function H2e(e,t,n){const i=e[t]||(e[t]={});return i[n]||(i[n]={})}function A4(e,t,n,i){for(const c of t.getMatchingVisibleMetas(i).reverse()){const h=e[c.index];if(n&&h>0||!n&&h<0)return c.index}return null}function I4(e,t){const{chart:n,_cachedMeta:i}=e,c=n._stacks||(n._stacks={}),{iScale:h,vScale:m,index:a}=i,y=h.axis,E=m.axis,C=j2e(h,m,i),P=t.length;let L;for(let D=0;D<P;++D){const V=t[D],{[y]:U,[E]:W}=V,$=V._stacks||(V._stacks={});
4064L=$[E]=H2e(c,C,U),L[a]=W,L._top=A4(L,m,!0,i.type),L._bottom=A4(L,m,!1,i.type);const Y=L._visualValues||(L._visualValues={});Y[a]=W}}function wP(e,t){const n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function W2e(e,t){return ap(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function q2e(e,t,n){return ap(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function sb(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const c of t){const h=c._stacks;if(!h||h[i]===void 0||h[i][n]===void 0)return;delete h[i][n],h[i]._visualValues!==void 0&&h[i]._visualValues[n]!==void 0&&delete h[i]._visualValues[n]}}}const SP=e=>e==="reset"||e==="none",P4=(e,t)=>t?e:Object.assign({},e),X2e=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:K7(n,!0),values:null};class lp{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=xP(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&sb(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),c=(P,L,D,V)=>P==="x"?L:P==="r"?V:D,h=n.xAxisID=Br(i.xAxisID,wP(t,"x")),m=n.yAxisID=Br(i.yAxisID,wP(t,"y")),a=n.rAxisID=Br(i.rAxisID,wP(t,"r")),y=n.indexAxis,E=n.iAxisID=c(y,h,m,a),C=n.vAxisID=c(y,m,h,a);n.xScale=this.getScaleForId(h),n.yScale=this.getScaleForId(m),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(E),n.vScale=this.getScaleForId(C)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&d4(this._data,this),t._stacked&&sb(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(di(n)){const c=this._cachedMeta;this._data=$2e(n,c)}else if(i!==n){if(i){d4(i,this);const c=this._cachedMeta;sb(c),c._parsed=[]}n&&Object.isExtensible(n)&&MCe(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,i=this.getDataset();let c=!1;this._dataCheck();const h=n._stacked;n._stacked=xP(n.vScale,n),n.stack!==i.stack&&(c=!0,sb(n),n.stack=i.stack),this._resyncElements(t),(c||h!==n._stacked)&&(I4(this,n._parsed),n._stacked=xP(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:c}=this,{iScale:h,_stacked:m}=i,a=h.axis;let y=t===0&&n===c.length?!0:i._sorted,E=t>0&&i._parsed[t-1],C,P,L;if(this._parsing===!1)i._parsed=c,i._sorted=!0,L=c;else{vo(c[t])?L=this.parseArrayData(i,c,t,n):di(c[t])?L=this.parseObjectData(i,c,t,n):L=this.parsePrimitiveData(i,c,t,n);const D=()=>P[a]===null||E&&P[a]<E[a];for(C=0;C<n;++C)i._parsed[C+t]=P=L[C],y&&(D()&&(y=!1),E=P);i._sorted=y}m&&I4(this,L)}parsePrimitiveData(t,n,i,c){const{iScale:h,vScale:m}=t,a=h.axis,y=m.axis,E=h.getLabels(),C=h===m,P=new Array(c);let L,D,V;for(L=0,D=c;L<D;++L)V=L+i,P[L]={[a]:C||h.parse(E[V],V),[y]:m.parse(n[V],V)};return P}parseArrayData(t,n,i,c){const{xScale:h,yScale:m}=t,a=new Array(c);let y,E,C,P;for(y=0,E=c;y<E;++y)C=y+i,P=n[C],a[y]={x:h.parse(P[0],C),y:m.parse(P[1],C)};return a}parseObjectData(t,n,i,c){const{xScale:h,yScale:m}=t,{xAxisKey:a="x",yAxisKey:y="y"}=this._parsing,E=new Array(c);let C,P,L,D;for(C=0,P=c;C<P;++C)L=C+i,D=n[L],E[C]={x:h.parse(ep(D,a),L),y:m.parse(ep(D,y),L)};return E}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,i){const c=this.chart,h=this._cachedMeta,m=n[t.axis],a={keys:K7(c,!0),values:n._stacks[t.axis]._visualValues};return C4(a,m,h.index,{mode:i})}updateRangeFromParsed(t,n,i,c){const h=i[n.axis];let m=h===null?NaN:h;const a=c&&i._stacks[n.axis];c&&a&&(c.values=a,m=C4(c,h,this._cachedMeta.index)),t.min=Math.min(t.min,m),t.max=Math.max(t.max,m)}getMinMax(t,n){const i=this._cachedMeta,c=i._parsed,h=i._sorted&&t===i.iScale,m=c.length,a=this._getOtherScale(t),y=X2e(n,i,this.chart),E={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:C,max:P}=G2e(a);let L,D;function V(){D=c[L];const U=D[a.axis];return!Wo(D[t.axis])||C>U||P<U}for(L=0;L<m&&!(!V()&&(this.updateRangeFromParsed(E,t,D,y),h));++L);if(h){for(L=m-1;L>=0;--L)if(!V()){this.updateRangeFromParsed(E,t,D,y);break}}return E}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let c,h,m;for(c=0,h=n.length;c<h;++c)m=n[c][t.axis],Wo(m)&&i.push(m);return i}getMaxOverflow(){return!1}
4064getLabelAndValue(t){const n=this._cachedMeta,i=n.iScale,c=n.vScale,h=this.getParsed(t);return{label:i?""+i.getLabelForValue(h[i.axis]):"",value:c?""+c.getLabelForValue(h[c.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=U2e(Br(this.options.clip,V2e(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,i=this._cachedMeta,c=i.data||[],h=n.chartArea,m=[],a=this._drawStart||0,y=this._drawCount||c.length-a,E=this.options.drawActiveElementsOnTop;let C;for(i.dataset&&i.dataset.draw(t,h,a,y),C=a;C<a+y;++C){const P=c[C];P.hidden||(P.active&&E?m.push(P):P.draw(t,h))}for(C=0;C<m.length;++C)m[C].draw(t,h)}getStyle(t,n){const i=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,n,i){const c=this.getDataset();let h;if(t>=0&&t<this._cachedMeta.data.length){const m=this._cachedMeta.data[t];h=m.$context||(m.$context=q2e(this.getContext(),t,m)),h.parsed=this.getParsed(t),h.raw=c.data[t],h.index=h.dataIndex=t}else h=this.$context||(this.$context=W2e(this.chart.getContext(),this.index)),h.dataset=c,h.index=h.datasetIndex=this.index;return h.active=!!n,h.mode=i,h}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",i){const c=n==="active",h=this._cachedDataOpts,m=t+"-"+n,a=h[m],y=this.enableOptionSharing&&ux(i);if(a)return P4(a,y);const E=this.chart.config,C=E.datasetElementScopeKeys(this._type,t),P=c?[`${t}Hover`,"hover",t,""]:[t,""],L=E.getOptionScopes(this.getDataset(),C),D=Object.keys(Ro.elements[t]),V=()=>this.getContext(i,c,n),U=E.resolveNamedOptions(L,D,V,P);return U.$shared&&(U.$shared=y,h[m]=Object.freeze(P4(U,y))),U}_resolveAnimations(t,n,i){const c=this.chart,h=this._cachedDataOpts,m=`animation-${n}`,a=h[m];if(a)return a;let y;if(c.options.animation!==!1){const C=this.chart.config,P=C.datasetAnimationScopeKeys(this._type,n),L=C.getOptionScopes(this.getDataset(),P);y=C.createResolver(L,this.getContext(t,i,n))}const E=new Y7(c,y&&y.animations);return y&&y._cacheable&&(h[m]=Object.freeze(E)),E}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||SP(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),c=this._sharedOptions,h=this.getSharedOptions(i),m=this.includeOptions(n,h)||h!==c;return this.updateSharedOptions(h,n,i),{sharedOptions:h,includeOptions:m}}updateElement(t,n,i,c){SP(c)?Object.assign(t,i):this._resolveAnimations(n,c).update(t,i)}updateSharedOptions(t,n,i){t&&!SP(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,c){t.active=c;const h=this.getStyle(n,c);this._resolveAnimations(n,i,c).update(t,{options:!c&&this.getSharedOptions(h)||h})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,i=this._cachedMeta.data;for(const[a,y,E]of this._syncList)this[a](y,E);this._syncList=[];const c=i.length,h=n.length,m=Math.min(h,c);m&&this.parse(0,m),h>c?this._insertElements(c,h-c,t):h<c&&this._removeElements(h,c-h)}_insertElements(t,n,i=!0){const c=this._cachedMeta,h=c.data,m=t+n;let a;const y=E=>{for(E.length+=n,a=E.length-1;a>=m;a--)E[a]=E[a-n]};for(y(h),a=t;a<m;++a)h[a]=new this.dataElementType;this._parsing&&y(c._parsed),this.parse(t,n),i&&this.updateElements(h,t,n,"reset")}updateElements(t,n,i,c){}_removeElements(t,n){const i=this._cachedMeta;if(this._parsing){const c=i._parsed.splice(t,n);i._stacked&&sb(i,c)}i.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,i,c]=t;this[n](i,c)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function Z2e(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let i=[];for(let c=0,h=n.length;c<h;c++)i=i.concat(n[c].controller.getAllParsedValues(e));e._cache.$bar=R7(i.sort((c,h)=>c-h))}return e._cache.$bar}function Y2e(e){const t=e.iScale,n=Z2e(t,e.type);let i=t._length,c,h,m,a;const y=()=>{m===32767||m===-32768||(ux(a)&&(i=Math.min(i,Math.abs(m-a)||i)),a=m)};for(c=0,h=n.length;c<h;++c)m=t.getPixelForValue(n[c]),y();for(a=void 0,c=0,h=t.ticks.length;c<h;++c)m=t.getPixelForTick(c),y();return i}function K2e(e,t,n,i){const c=n.barThickness;let h,m;return oi(c)?(h=t.min*n.categoryPercentage,m=n.barPercentage):(h=c*i,m=1),{chunk:h/i,ratio:m,start:t.pixels[e]-h/2}}function J2e(e,t,n,i){const c=t.pixels,h=c[e];let m=e>0?c[e-1]:null,a=e<c.length-1?c[e+1]:null;const y=n.categoryPercentage;m===null&&(m=h-(a===null?t.end-t.start:a-h)),a===null&&(a=h+h-m);const E=h-(h-Math.min(m,a))/2*y;return{chunk:Math.abs(a-m)/2*y/i,ratio:n.barPercentage,start:E}}function Q2e(e,t,n,i){const c=n.parse(e[0],i),h=n.parse(e[1],i),m=
4064Math.min(c,h),a=Math.max(c,h);let y=m,E=a;Math.abs(m)>Math.abs(a)&&(y=a,E=m),t[n.axis]=E,t._custom={barStart:y,barEnd:E,start:c,end:h,min:m,max:a}}function J7(e,t,n,i){return vo(e)?Q2e(e,t,n,i):t[n.axis]=n.parse(e,i),t}function R4(e,t,n,i){const c=e.iScale,h=e.vScale,m=c.getLabels(),a=c===h,y=[];let E,C,P,L;for(E=n,C=n+i;E<C;++E)L=t[E],P={},P[c.axis]=a||c.parse(m[E],E),y.push(J7(L,P,h,E));return y}function TP(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function eAe(e,t,n){return e!==0?rd(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function tAe(e){let t,n,i,c,h;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.base<e.y,n="bottom",i="top"),t?(c="end",h="start"):(c="start",h="end"),{start:n,end:i,reverse:t,top:c,bottom:h}}function nAe(e,t,n,i){let c=t.borderSkipped;const h={};if(!c){e.borderSkipped=h;return}if(c===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:m,end:a,reverse:y,top:E,bottom:C}=tAe(e);c==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===i?c=E:(n._bottom||0)===i?c=C:(h[k4(C,m,a,y)]=!0,c=E)),h[k4(c,m,a,y)]=!0,e.borderSkipped=h}function k4(e,t,n,i){return i?(e=rAe(e,t,n),e=M4(e,n,t)):e=M4(e,t,n),e}function rAe(e,t,n){return e===t?n:e===n?t:e}function M4(e,t,n){return e==="start"?t:e==="end"?n:e}function iAe(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class oAe extends lp{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,n,i,c){return R4(t,n,i,c)}parseArrayData(t,n,i,c){return R4(t,n,i,c)}parseObjectData(t,n,i,c){const{iScale:h,vScale:m}=t,{xAxisKey:a="x",yAxisKey:y="y"}=this._parsing,E=h.axis==="x"?a:y,C=m.axis==="x"?a:y,P=[];let L,D,V,U;for(L=i,D=i+c;L<D;++L)U=n[L],V={},V[h.axis]=h.parse(ep(U,E),L),P.push(J7(ep(U,C),V,m,L));return P}updateRangeFromParsed(t,n,i,c){super.updateRangeFromParsed(t,n,i,c);const h=i._custom;h&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,h.min),t.max=Math.max(t.max,h.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:i,vScale:c}=n,h=this.getParsed(t),m=h._custom,a=TP(m)?"["+m.start+", "+m.end+"]":""+c.getLabelForValue(h[c.axis]);return{label:""+i.getLabelForValue(h[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,i,c){const h=c==="reset",{index:m,_cachedMeta:{vScale:a}}=this,y=a.getBasePixel(),E=a.isHorizontal(),C=this._getRuler(),{sharedOptions:P,includeOptions:L}=this._getSharedOptions(n,c);for(let D=n;D<n+i;D++){const V=this.getParsed(D),U=h||oi(V[a.axis])?{base:y,head:y}:this._calculateBarValuePixels(D),W=this._calculateBarIndexPixels(D,C),$=(V._stacks||{})[a.axis],Y={horizontal:E,base:U.base,enableBorderRadius:!$||TP(V._custom)||m===$._top||m===$._bottom,x:E?U.head:W.center,y:E?W.center:U.head,height:E?W.size:Math.abs(U.size),width:E?Math.abs(U.size):W.size};L&&(Y.options=P||this.resolveDataElementOptions(D,t[D].active?"active":c));const X=Y.options||t[D].options;nAe(Y,X,$,m),iAe(Y,X,C.ratio),this.updateElement(t[D],D,Y,c)}}_getStacks(t,n){const{iScale:i}=this._cachedMeta,c=i.getMatchingVisibleMetas(this._type).filter(C=>C.controller.options.grouped),h=i.options.stacked,m=[],a=this._cachedMeta.controller.getParsed(n),y=a&&a[i.axis],E=C=>{const P=C._parsed.find(D=>D[i.axis]===y),L=P&&P[C.vScale.axis];if(oi(L)||isNaN(L))return!0};for(const C of c)if(!(n!==void 0&&E(C))&&((h===!1||m.indexOf(C.stack)===-1||h===void 0&&C.stack===void 0)&&m.push(C.stack),C.index===t))break;return m.length||m.push(void 0),m}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[Br(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,i){const c=this._getStacks(t,i),h=n!==void 0?c.indexOf(n):-1;return h===-1?c.length-1:h}_getRuler(){const t=this.options,n=this._cachedMeta,i=n.iScale,c=[];let h,m;for(h=0,m=n.data.length;h<m;++h)c.push(i.getPixelForValue(this.getParsed(h)[i.axis],h));const a=t.barThickness;return{min:a||Y2e(n),pixels:c,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:i,index:c},options:{base:h,minBarLength:m}}=this,a=h||0,y=this.getParsed(t),E=y._custom,C=TP(E);let P=y[n.axis],L=0,D=i?this.applyStack(n,y,i):P,V,U;D!==P&&(L=D-P,D=P),C&&(P=E.barStart,D=E.barEnd-E.barStart,P!==0&&rd(P)!==rd(E.barEnd)&&(L=0),L+=P);const W=!oi(h)&&!C?h:L;let $=n.getPixelForValue(W);if(this.chart.getDataVisibility(t)?V=n.getPixelForValue(L+D):V=$,U=V-$,Math.abs(U)<m){U=eAe(U,n,a)*m,P===a&&($-=U/2);const Y=n.getPixelForDecimal(0),X=n.getPixelForDecimal(1),K=Math.min(Y,X),ne=Math.max(Y,X);
4064$=Math.max(Math.min($,ne),K),V=$+U,i&&!C&&(y._stacks[n.axis]._visualValues[c]=n.getValueForPixel(V)-n.getValueForPixel($))}if($===n.getPixelForValue(a)){const Y=rd(U)*n.getLineWidthForValue(a)/2;$+=Y,U-=Y}return{size:U,base:$,head:V,center:V+U/2}}_calculateBarIndexPixels(t,n){const i=n.scale,c=this.options,h=c.skipNull,m=Br(c.maxBarThickness,1/0);let a,y;const E=this._getAxisCount();if(n.grouped){const C=h?this._getStackCount(t):n.stackCount,P=c.barThickness==="flex"?J2e(t,n,c,C*E):K2e(t,n,c,C*E),L=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,D=this._getAxis().indexOf(Br(L,this.getFirstScaleIdForIndexAxis())),V=this._getStackIndex(this.index,this._cachedMeta.stack,h?t:void 0)+D;a=P.start+P.chunk*V+P.chunk/2,y=Math.min(m,P.chunk*P.ratio)}else a=i.getPixelForValue(this.getParsed(t)[i.axis],t),y=Math.min(m,n.min*n.ratio);return{base:a-y/2,head:a+y/2,center:a,size:y}}draw(){const t=this._cachedMeta,n=t.vScale,i=t.data,c=i.length;let h=0;for(;h<c;++h)this.getParsed(h)[n.axis]!==null&&!i[h].hidden&&i[h].draw(this._ctx)}}class sAe extends lp{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,i,c){const h=super.parsePrimitiveData(t,n,i,c);for(let m=0;m<h.length;m++)h[m]._custom=this.resolveDataElementOptions(m+i).radius;return h}parseArrayData(t,n,i,c){const h=super.parseArrayData(t,n,i,c);for(let m=0;m<h.length;m++){const a=n[i+m];h[m]._custom=Br(a[2],this.resolveDataElementOptions(m+i).radius)}return h}parseObjectData(t,n,i,c){const h=super.parseObjectData(t,n,i,c);for(let m=0;m<h.length;m++){const a=n[i+m];h[m]._custom=Br(a&&a.r&&+a.r,this.resolveDataElementOptions(m+i).radius)}return h}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let i=t.length-1;i>=0;--i)n=Math.max(n,t[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:c,yScale:h}=n,m=this.getParsed(t),a=c.getLabelForValue(m.x),y=h.getLabelForValue(m.y),E=m._custom;return{label:i[t]||"",value:"("+a+", "+y+(E?", "+E:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,i,c){const h=c==="reset",{iScale:m,vScale:a}=this._cachedMeta,{sharedOptions:y,includeOptions:E}=this._getSharedOptions(n,c),C=m.axis,P=a.axis;for(let L=n;L<n+i;L++){const D=t[L],V=!h&&this.getParsed(L),U={},W=U[C]=h?m.getPixelForDecimal(.5):m.getPixelForValue(V[C]),$=U[P]=h?a.getBasePixel():a.getPixelForValue(V[P]);U.skip=isNaN(W)||isNaN($),E&&(U.options=y||this.resolveDataElementOptions(L,D.active?"active":c),h&&(U.options.radius=0)),this.updateElement(D,L,U,c)}}resolveDataElementOptions(t,n){const i=this.getParsed(t);let c=super.resolveDataElementOptions(t,n);c.$shared&&(c=Object.assign({},c,{$shared:!1}));const h=c.radius;return n!=="active"&&(c.radius=0),c.radius+=Br(i&&i._custom,h),c}}function aAe(e,t,n){let i=1,c=1,h=0,m=0;if(t<xo){const a=e,y=a+t,E=Math.cos(a),C=Math.sin(a),P=Math.cos(y),L=Math.sin(y),D=(X,K,ne)=>dx(X,a,y,!0)?1:Math.max(K,K*n,ne,ne*n),V=(X,K,ne)=>dx(X,a,y,!0)?-1:Math.min(K,K*n,ne,ne*n),U=D(0,E,P),W=D(es,C,L),$=V(Ci,E,P),Y=V(Ci+es,C,L);i=(U-$)/2,c=(W-Y)/2,h=-(U+$)/2,m=-(W+Y)/2}return{ratioX:i,ratioY:c,offsetX:h,offsetY:m}}class OL extends lp{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data,{labels:{pointStyle:i,textAlign:c,color:h,useBorderRadius:m,borderRadius:a}}=t.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((y,E)=>{const P=t.getDatasetMeta(0).controller.getStyle(E);return{text:y,fillStyle:P.backgroundColor,fontColor:h,hidden:!t.getDataVisibility(E),lineDash:P.borderDash,lineDashOffset:P.borderDashOffset,lineJoin:P.borderJoinStyle,lineWidth:P.borderWidth,strokeStyle:P.borderColor,textAlign:c,pointStyle:i,borderRadius:m&&(a||P.borderRadius),index:E}}):[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update(
4064)}}}};constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const i=this.getDataset().data,c=this._cachedMeta;if(this._parsing===!1)c._parsed=i;else{let h=y=>+i[y];if(di(i[t])){const{key:y="value"}=this._parsing;h=E=>+ep(i[E],y)}let m,a;for(m=t,a=t+n;m<a;++m)c._parsed[m]=h(m)}}_getRotation(){return Jc(this.options.rotation-90)}_getCircumference(){return Jc(this.options.circumference)}_getRotationExtents(){let t=xo,n=-xo;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const c=this.chart.getDatasetMeta(i).controller,h=c._getRotation(),m=c._getCircumference();t=Math.min(t,h),n=Math.max(n,h+m)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:i}=n,c=this._cachedMeta,h=c.data,m=this.getMaxBorderWidth()+this.getMaxOffset(h)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-m)/2,0),y=Math.min(_Ce(this.options.cutout,a),1),E=this._getRingWeight(this.index),{circumference:C,rotation:P}=this._getRotationExtents(),{ratioX:L,ratioY:D,offsetX:V,offsetY:U}=aAe(P,C,y),W=(i.width-m)/L,$=(i.height-m)/D,Y=Math.max(Math.min(W,$)/2,0),X=E7(this.options.radius,Y),K=Math.max(X*y,0),ne=(X-K)/this._getVisibleDatasetWeightTotal();this.offsetX=V*X,this.offsetY=U*X,c.total=this.calculateTotal(),this.outerRadius=X-ne*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-ne*E,0),this.updateElements(h,0,h.length,t)}_circumference(t,n){const i=this.options,c=this._cachedMeta,h=this._getCircumference();return n&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||c._parsed[t]===null||c.data[t].hidden?0:this.calculateCircumference(c._parsed[t]*h/xo)}updateElements(t,n,i,c){const h=c==="reset",m=this.chart,a=m.chartArea,E=m.options.animation,C=(a.left+a.right)/2,P=(a.top+a.bottom)/2,L=h&&E.animateScale,D=L?0:this.innerRadius,V=L?0:this.outerRadius,{sharedOptions:U,includeOptions:W}=this._getSharedOptions(n,c);let $=this._getRotation(),Y;for(Y=0;Y<n;++Y)$+=this._circumference(Y,h);for(Y=n;Y<n+i;++Y){const X=this._circumference(Y,h),K=t[Y],ne={x:C+this.offsetX,y:P+this.offsetY,startAngle:$,endAngle:$+X,circumference:X,outerRadius:V,innerRadius:D};W&&(ne.options=U||this.resolveDataElementOptions(Y,K.active?"active":c)),$+=X,this.updateElement(K,Y,ne,c)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let i=0,c;for(c=0;c<n.length;c++){const h=t._parsed[c];h!==null&&!isNaN(h)&&this.chart.getDataVisibility(c)&&!n[c].hidden&&(i+=Math.abs(h))}return i}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?xo*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,c=i.data.labels||[],h=t1(n._parsed[t],i.options.locale);return{label:c[t]||"",value:h}}getMaxBorderWidth(t){let n=0;const i=this.chart;let c,h,m,a,y;if(!t){for(c=0,h=i.data.datasets.length;c<h;++c)if(i.isDatasetVisible(c)){m=i.getDatasetMeta(c),t=m.data,a=m.controller;break}}if(!t)return 0;for(c=0,h=t.length;c<h;++c)y=a.resolveDataElementOptions(c),y.borderAlign!=="inner"&&(n=Math.max(n,y.borderWidth||0,y.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let i=0,c=t.length;i<c;++i){const h=this.resolveDataElementOptions(i);n=Math.max(n,h.offset||0,h.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(n+=this._getRingWeight(i));return n}_getRingWeight(t){return Math.max(Br(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class lAe extends lp{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:i,data:c=[],_dataset:h}=n,m=this.chart._animationsDisabled;let{start:a,count:y}=L7(n,c,m);this._drawStart=a,this._drawCount=y,O7(n)&&(a=0,y=c.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!h._decimated,i.points=c;const E=this.resolveDatasetElementOptions(t);this.options.showLine||(E.borderWidth=0),E.segment=this.options.segment,this.updateElement(i,void 0,{animated:!m,options:E},t),this.updateElements(c,a,y,t)}updateElements(t,n,i,c){const h=c==="reset",{iScale:m,vScale:a,_stacked:y,_dataset:E}=this._cachedMeta,{sharedOptions:C,includeOptions:P}=this._getSharedOptions(n,c),L=m.axis,D=a.axis,{spanGaps:V,segment:U}=this.options,W=vy(V)?V:Number.POSITIVE_INFINITY,$=this.chart._animationsDisabled||h||c==="none",Y=n+i,X=t.length;let K=n>0&&this.getParsed(n-1);for(let ne=0;ne<X;++ne){const fe=t[ne],ye=$?fe:{};if(ne<n||ne>=Y){ye.skip=!0;continue}const ke=this.getParsed(ne),Fe=oi(ke[D]),qe=ye[L]=m.getPixelForValue(ke[L],ne),lt=ye[D]=h||Fe?a.getBasePixel():a.getPixelForValue(y?this.applyStack(a,ke,y):ke[D],ne);ye.skip=isNaN(qe)||isNaN(lt)||Fe,ye.stop=ne>0&&Math.abs(ke[L]-K[L])>W,U&&(ye.parsed=ke,ye.raw=E.data[ne]),P&&(ye.options=C||this.resolveDataElementOptions(ne,fe.active?"active":c)),$||this.updateElement(fe,ne,ye,c),K=ke}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,c=t.data||[];if(!c.length)return i;const h=c[0].size(this.resolveDataElementOptions(0)),m=c[c.length-1].size(this.resolveDataElementOptions(c.length-1));return Math.max(i,h,m)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class Q7 extends lp{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:c}}=t.legend.options;return n.labels.map((h,m)=>{const y=t.getDatasetMeta(0).controller.getStyle(m);return{text:h,fillStyle:y.backgroundColor,strokeStyle:y.borderColor,fontColor:c,lineWidth:y.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(m),index:m}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update(
4064)}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,c=i.data.labels||[],h=t1(n._parsed[t].r,i.options.locale);return{label:c[t]||"",value:h}}parseObjectData(t,n,i,c){return $7.bind(this)(t,n,i,c)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,c)=>{const h=this.getParsed(c).r;!isNaN(h)&&this.chart.getDataVisibility(c)&&(h<n.min&&(n.min=h),h>n.max&&(n.max=h))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,c=Math.min(n.right-n.left,n.bottom-n.top),h=Math.max(c/2,0),m=Math.max(i.cutoutPercentage?h/100*i.cutoutPercentage:1,0),a=(h-m)/t.getVisibleDatasetCount();this.outerRadius=h-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,i,c){const h=c==="reset",m=this.chart,y=m.options.animation,E=this._cachedMeta.rScale,C=E.xCenter,P=E.yCenter,L=E.getIndexAngle(0)-.5*Ci;let D=L,V;const U=360/this.countVisibleElements();for(V=0;V<n;++V)D+=this._computeAngle(V,c,U);for(V=n;V<n+i;V++){const W=t[V];let $=D,Y=D+this._computeAngle(V,c,U),X=m.getDataVisibility(V)?E.getDistanceFromCenterForValue(this.getParsed(V).r):0;D=Y,h&&(y.animateScale&&(X=0),y.animateRotate&&($=Y=L));const K={x:C,y:P,innerRadius:0,outerRadius:X,startAngle:$,endAngle:Y,options:this.resolveDataElementOptions(V,W.active?"active":c)};this.updateElement(W,V,K,c)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((i,c)=>{!isNaN(this.getParsed(c).r)&&this.chart.getDataVisibility(c)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?Jc(this.resolveDataElementOptions(t,n).angle||i):0}}class cAe extends OL{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class uAe extends lp{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const n=this._cachedMeta.vScale,i=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(t,n,i,c){return $7.bind(this)(t,n,i,c)}update(t){const n=this._cachedMeta,i=n.dataset,c=n.data||[],h=n.iScale.getLabels();if(i.points=c,t!=="resize"){const m=this.resolveDatasetElementOptions(t);this.options.showLine||(m.borderWidth=0);const a={_loop:!0,_fullLoop:h.length===c.length,options:m};this.updateElement(i,void 0,a,t)}this.updateElements(c,0,c.length,t)}updateElements(t,n,i,c){const h=this._cachedMeta.rScale,m=c==="reset";for(let a=n;a<n+i;a++){const y=t[a],E=this.resolveDataElementOptions(a,y.active?"active":c),C=h.getPointPositionForValue(a,this.getParsed(a).r),P=m?h.xCenter:C.x,L=m?h.yCenter:C.y,D={x:P,y:L,angle:C.angle,skip:isNaN(P)||isNaN(L),options:E};this.updateElement(y,a,D,c)}}}class dAe extends lp{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:c,yScale:h}=n,m=this.getParsed(t),a=c.getLabelForValue(m.x),y=h.getLabelForValue(m.y);return{label:i[t]||"",value:"("+a+", "+y+")"}}update(t){const n=this._cachedMeta,{data:i=[]}=n,c=this.chart._animationsDisabled;let{start:h,count:m}=L7(n,i,c);if(this._drawStart=h,this._drawCount=m,O7(n)&&(h=0,m=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:y}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!y._decimated,a.points=i;const E=this.resolveDatasetElementOptions(t);E.segment=this.options.segment,this.updateElement(a,void 0,{animated:!c,options:E},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(i,h,m,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,i,c){const h=c==="reset",{iScale:m,vScale:a,_stacked:y,_dataset:E}=this._cachedMeta,C=this.resolveDataElementOptions(n,c),P=this.getSharedOptions(C),L=this.includeOptions(c,P),D=m.axis,V=a.axis,{spanGaps:U,segment:W}=this.options,$=vy(U)?U:Number.POSITIVE_INFINITY,Y=this.chart._animationsDisabled||h||c==="none";let X=n>0&&this.getParsed(n-1);for(let K=n;K<n+i;++K){const ne=t[K],fe=this.getParsed(K),ye=Y?ne:{},ke=oi(fe[V]),Fe=ye[D]=m.getPixelForValue(fe[D],K),qe=ye[V]=h||ke?a.getBasePixel():a.getPixelForValue(y?this.applyStack(a,fe,y):fe[V],K);
4064ye.skip=isNaN(Fe)||isNaN(qe)||ke,ye.stop=K>0&&Math.abs(fe[D]-X[D])>$,W&&(ye.parsed=fe,ye.raw=E.data[K]),L&&(ye.options=P||this.resolveDataElementOptions(K,ne.active?"active":c)),Y||this.updateElement(ne,K,ye,c),X=fe}this.updateSharedOptions(P,c,C)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let y=n.length-1;y>=0;--y)a=Math.max(a,n[y].size(this.resolveDataElementOptions(y))/2);return a>0&&a}const i=t.dataset,c=i.options&&i.options.borderWidth||0;if(!n.length)return c;const h=n[0].size(this.resolveDataElementOptions(0)),m=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(c,h,m)/2}}var hAe=Object.freeze({__proto__:null,BarController:oAe,BubbleController:sAe,DoughnutController:OL,LineController:lAe,PieController:cAe,PolarAreaController:Q7,RadarController:uAe,ScatterController:dAe});function pm(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class DL{static override(t){Object.assign(DL.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return pm()}parse(){return pm()}format(){return pm()}add(){return pm()}diff(){return pm()}startOf(){return pm()}endOf(){return pm()}}var fAe={_date:DL};function pAe(e,t,n,i){const{controller:c,data:h,_sorted:m}=e,a=c._cachedMeta.iScale,y=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&m&&h.length){const E=a._reversePixels?RCe:ch;if(i){if(c._sharedOptions){const C=h[0],P=typeof C.getRange=="function"&&C.getRange(t);if(P){const L=E(h,t,n-P),D=E(h,t,n+P);return{lo:L.lo,hi:D.hi}}}}else{const C=E(h,t,n);if(y){const{vScale:P}=c._cachedMeta,{_parsed:L}=e,D=L.slice(0,C.lo+1).reverse().findIndex(U=>!oi(U[P.axis]));C.lo-=Math.max(0,D);const V=L.slice(C.hi).findIndex(U=>!oi(U[P.axis]));C.hi+=Math.max(0,V)}return C}}return{lo:0,hi:h.length-1}}function s2(e,t,n,i,c){const h=e.getSortedVisibleDatasetMetas(),m=n[t];for(let a=0,y=h.length;a<y;++a){const{index:E,data:C}=h[a],{lo:P,hi:L}=pAe(h[a],t,m,c);for(let D=P;D<=L;++D){const V=C[D];V.skip||i(V,E,D)}}}function mAe(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(i,c){const h=t?Math.abs(i.x-c.x):0,m=n?Math.abs(i.y-c.y):0;return Math.sqrt(Math.pow(h,2)+Math.pow(m,2))}}function EP(e,t,n,i,c){const h=[];return!c&&!e.isPointInArea(t)||s2(e,n,t,function(a,y,E){!c&&!uh(a,e.chartArea,0)||a.inRange(t.x,t.y,i)&&h.push({element:a,datasetIndex:y,index:E})},!0),h}function gAe(e,t,n,i){let c=[];function h(m,a,y){const{startAngle:E,endAngle:C}=m.getProps(["startAngle","endAngle"],i),{angle:P}=I7(m,{x:t.x,y:t.y});dx(P,E,C)&&c.push({element:m,datasetIndex:a,index:y})}return s2(e,n,t,h),c}function _Ae(e,t,n,i,c,h){let m=[];const a=mAe(n);let y=Number.POSITIVE_INFINITY;function E(C,P,L){const D=C.inRange(t.x,t.y,c);if(i&&!D)return;const V=C.getCenterPoint(c);if(!(!!h||e.isPointInArea(V))&&!D)return;const W=a(t,V);W<y?(m=[{element:C,datasetIndex:P,index:L}],y=W):W===y&&m.push({element:C,datasetIndex:P,index:L})}return s2(e,n,t,E),m}function CP(e,t,n,i,c,h){return!h&&!e.isPointInArea(t)?[]:n==="r"&&!i?gAe(e,t,n,c):_Ae(e,t,n,i,c,h)}function L4(e,t,n,i,c){const h=[],m=n==="x"?"inXRange":"inYRange";let a=!1;return s2(e,n,t,(y,E,C)=>{y[m]&&y[m](t[n],c)&&(h.push({element:y,datasetIndex:E,index:C}),a=a||y.inRange(t.x,t.y,c))}),i&&!a?[]:h}var yAe={modes:{index(e,t,n,i){const c=ym(t,e),h=n.axis||"x",m=n.includeInvisible||!1,a=n.intersect?EP(e,c,h,i,m):CP(e,c,h,!1,i,m),y=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(E=>{const C=a[0].index,P=E.data[C];P&&!P.skip&&y.push({element:P,datasetIndex:E.index,index:C})}),y):[]},dataset(e,t,n,i){const c=ym(t,e),h=n.axis||"xy",m=n.includeInvisible||!1;let a=n.intersect?EP(e,c,h,i,m):CP(e,c,h,!1,i,m);if(a.length>0){const y=a[0].datasetIndex,E=e.getDatasetMeta(y).data;a=[];for(let C=0;C<E.length;++C)a.push({element:E[C],datasetIndex:y,index:C})}return a},point(e,t,n,i){const c=ym(t,e),h=n.axis||"xy",m=n.includeInvisible||!1;return EP(e,c,h,i,m)},nearest(e,t,n,i){const c=ym(t,e),h=n.axis||"xy",m=n.includeInvisible||!1;return CP(e,c,h,n.intersect,i,m)},x(e,t,n,i){const c=ym(t,e);return L4(e,c,"x",n.intersect,i)},y(e,t,n,i){const c=ym(t,e);return L4(e,c,"y",n.intersect,i)}}};const eG=["left","top","right","bottom"];function ab(e,t){return e.filter(n=>n.pos===t)}function O4(e,t){return e.filter(n=>eG.indexOf(n.pos)===-1&&n.box.axis===t)}function lb(e,t){return e.sort((n,i)=>{const c=t?i:n,h=t?n:i;return c.weight===h.weight?c.index-h.index:c.weight-h.weight})}function vAe(e){const t=[];let n,i,c,h,m,a;for(n=0,i=(e||[]).length;n<i;++n)c=e[n],{position:h,options:{stack:m,stackWeight:a=1}}=c,t.push({index:n,box:c,pos:h,horizontal:c.isHorizontal(),weight:c.weight,stack:m&&h+m,stackWeight:a});return t}function bAe(e){const t={};for(const n of e){const{stack:i,pos:c,stackWeight:h}=n;if(!i||!eG.includes(c))continue;const m=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});m.count++,m.weight+=h}return t}function xAe(e,t){const n=bAe(e),{vBoxMaxWidth:i,hBoxMaxHeight:c}=t;let h,m,a;for(h=0,m=e.length;h<m;++h){a=e[h];const{fullSize:y}=a.box,E=n[a.stack],C=E&&a.stackWeight/E.weight;a.horizontal?(a.width=C?C*i:y&&t.availableWidth,a.height=c):(a.width=i,a.height=C?C*c:y&&t.availableHeight)}return n}function wAe(e){const t=vAe(e),n=lb(t.filter(E=>E.box.fullSize),!0),i=lb(ab(t,"left"),!0),c=lb(ab(t,"right")),h=lb(ab(t,"top"),!0),m=lb(ab(t,"bottom")),a=O4(t,"x"),y=O4(t,"y");return{fullSize:n,leftAndTop:i.concat(h),rightAndBottom:c.concat(y).concat(m).concat(a),chartArea:ab(t,"chartArea"),vertical:i.concat(c).concat(y),horizontal:h.concat(m).concat(a)}}function D4(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function tG(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function SAe(e,t,n,i){const{pos:c,box:h}=n,m=e.maxPadding;if(!di(c)){n.size&&(e[c]-=n.size);const P=i[n.stack]||{size:0,count:1};P.size=Math.max(P.size,n.horizontal?h.height:h.width),n.size=P.size/P.count,e[c]+=n.size}h.getPadding&&tG(m,h.getPadding());const a=Math.max(0,t.outerWidth-D4(m,e,"left","right")),y=Math.max(0,t.outerHeight-D4(m,e,"top","bottom")),E=a!==e.w,C=y!==e.h;return e.w=a,e.h=y,n.horizontal?{same:E,other:C}:{same:C,other:E}}function TAe(e){const t=e.maxPadding;function n(i){const c=Math.max(t[i]-e[i],0);return e[i]+=c,c}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function EAe(e,t){const n=t.maxPadding;function i(c){const h={left:0,top:0,right:0,bottom:0};
4064return c.forEach(m=>{h[m]=Math.max(t[m],n[m])}),h}return i(e?["left","right"]:["top","bottom"])}function Sb(e,t,n,i){const c=[];let h,m,a,y,E,C;for(h=0,m=e.length,E=0;h<m;++h){a=e[h],y=a.box,y.update(a.width||t.w,a.height||t.h,EAe(a.horizontal,t));const{same:P,other:L}=SAe(t,n,a,i);E|=P&&c.length,C=C||L,y.fullSize||c.push(a)}return E&&Sb(c,t,n,i)||C}function PT(e,t,n,i,c){e.top=n,e.left=t,e.right=t+i,e.bottom=n+c,e.width=i,e.height=c}function F4(e,t,n,i){const c=n.padding;let{x:h,y:m}=t;for(const a of e){const y=a.box,E=i[a.stack]||{placed:0,weight:1},C=a.stackWeight/E.weight||1;if(a.horizontal){const P=t.w*C,L=E.size||y.height;ux(E.start)&&(m=E.start),y.fullSize?PT(y,c.left,m,n.outerWidth-c.right-c.left,L):PT(y,t.left+E.placed,m,P,L),E.start=m,E.placed+=P,m=y.bottom}else{const P=t.h*C,L=E.size||y.width;ux(E.start)&&(h=E.start),y.fullSize?PT(y,h,c.top,L,n.outerHeight-c.bottom-c.top):PT(y,h,t.top+E.placed,L,P),E.start=h,E.placed+=P,h=y.right}}t.x=h,t.y=m}var ga={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,i){if(!e)return;const c=ba(e.options.layout.padding),h=Math.max(t-c.width,0),m=Math.max(n-c.height,0),a=wAe(e.boxes),y=a.vertical,E=a.horizontal;Hi(e.boxes,U=>{typeof U.beforeLayout=="function"&&U.beforeLayout()});const C=y.reduce((U,W)=>W.box.options&&W.box.options.display===!1?U:U+1,0)||1,P=Object.freeze({outerWidth:t,outerHeight:n,padding:c,availableWidth:h,availableHeight:m,vBoxMaxWidth:h/2/C,hBoxMaxHeight:m/2}),L=Object.assign({},c);tG(L,ba(i));const D=Object.assign({maxPadding:L,w:h,h:m,x:c.left,y:c.top},c),V=xAe(y.concat(E),P);Sb(a.fullSize,D,P,V),Sb(y,D,P,V),Sb(E,D,P,V)&&Sb(y,D,P,V),TAe(D),F4(a.leftAndTop,D,P,V),D.x+=D.w,D.y+=D.h,F4(a.rightAndBottom,D,P,V),e.chartArea={left:D.left,top:D.top,right:D.left+D.w,bottom:D.top+D.h,height:D.h,width:D.w},Hi(a.chartArea,U=>{const W=U.box;Object.assign(W,e.chartArea),W.update(D.w,D.h,{left:0,top:0,right:0,bottom:0})})}};class nG{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,c){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,c?Math.floor(n/c):i)}}isAttached(t){return!0}updateConfig(t){}}class CAe extends nG{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const QT="$chartjs",AAe={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},B4=e=>e===null||e==="";function IAe(e,t){const n=e.style,i=e.getAttribute("height"),c=e.getAttribute("width");if(e[QT]={initial:{height:i,width:c,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",B4(c)){const h=b4(e,"width");h!==void 0&&(e.width=h)}if(B4(i))if(e.style.height==="")e.height=e.width/(t||2);else{const h=b4(e,"height");h!==void 0&&(e.height=h)}return e}const rG=S2e?{passive:!0}:!1;function PAe(e,t,n){e&&e.addEventListener(t,n,rG)}function RAe(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,rG)}function kAe(e,t){const n=AAe[e.type]||e.type,{x:i,y:c}=ym(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:c!==void 0?c:null}}function KE(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function MAe(e,t,n){const i=e.canvas,c=new MutationObserver(h=>{let m=!1;for(const a of h)m=m||KE(a.addedNodes,i),m=m&&!KE(a.removedNodes,i);m&&n()});return c.observe(document,{childList:!0,subtree:!0}),c}function LAe(e,t,n){const i=e.canvas,c=new MutationObserver(h=>{let m=!1;for(const a of h)m=m||KE(a.removedNodes,i),m=m&&!KE(a.addedNodes,i);m&&n()});return c.observe(document,{childList:!0,subtree:!0}),c}const fx=new Map;let z4=0;function iG(){const e=window.devicePixelRatio;e!==z4&&(z4=e,fx.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function OAe(e,t){fx.size||window.addEventListener("resize",iG),fx.set(e,t)}function DAe(e){fx.delete(e),fx.size||window.removeEventListener("resize",iG)}function FAe(e,t,n){const i=e.canvas,c=i&&LL(i);if(!c)return;const h=M7((a,y)=>{const E=c.clientWidth;n(a,y),E<c.clientWidth&&n()},window),m=new ResizeObserver(a=>{const y=a[0],E=y.contentRect.width,C=y.contentRect.height;E===0&&C===0||h(E,C)});return m.observe(c),OAe(e,h),m}function AP(e,t,n){n&&n.disconnect(),t==="resize"&&DAe(e)}function BAe(e,t,n){const i=e.canvas,c=M7(h=>{e.ctx!==null&&n(kAe(h,e))},e);return PAe(i,t,c),c}class zAe extends nG{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(IAe(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[QT])return!1;const i=n[QT].initial;["height","width"].forEach(h=>{const m=i[h];
4064oi(m)?n.removeAttribute(h):n.setAttribute(h,m)});const c=i.style||{};return Object.keys(c).forEach(h=>{n.style[h]=c[h]}),n.width=n.width,delete n[QT],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const c=t.$proxies||(t.$proxies={}),m={attach:MAe,detach:LAe,resize:FAe}[n]||BAe;c[n]=m(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),c=i[n];if(!c)return;({attach:AP,detach:AP,resize:AP}[n]||RAe)(t,n,c),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,c){return w2e(t,n,i,c)}isAttached(t){const n=t&&LL(t);return!!(n&&n.isConnected)}}function NAe(e){return!ML()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?CAe:zAe}let Th=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return vy(this.x)&&vy(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const c={};return t.forEach(h=>{c[h]=i[h]&&i[h].active()?i[h]._to:this[h]}),c}};function VAe(e,t){const n=e.options.ticks,i=UAe(e),c=Math.min(n.maxTicksLimit||i,i),h=n.major.enabled?jAe(t):[],m=h.length,a=h[0],y=h[m-1],E=[];if(m>c)return GAe(t,E,h,m/c),E;const C=$Ae(h,t,c);if(m>0){let P,L;const D=m>1?Math.round((y-a)/(m-1)):null;for(RT(t,E,C,oi(D)?0:a-D,a),P=0,L=m-1;P<L;P++)RT(t,E,C,h[P],h[P+1]);return RT(t,E,C,y,oi(D)?t.length:y+D),E}return RT(t,E,C),E}function UAe(e){const t=e.options.offset,n=e._tickSize(),i=e._length/n+(t?0:1),c=e._maxLength/n;return Math.floor(Math.min(i,c))}function $Ae(e,t,n){const i=HAe(e),c=t.length/n;if(!i)return Math.max(c,1);const h=ECe(i);for(let m=0,a=h.length-1;m<a;m++){const y=h[m];if(y>c)return y}return Math.max(c,1)}function jAe(e){const t=[];let n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function GAe(e,t,n,i){let c=0,h=n[0],m;for(i=Math.ceil(i),m=0;m<e.length;m++)m===h&&(t.push(e[m]),c++,h=n[c*i])}function RT(e,t,n,i,c){const h=Br(i,0),m=Math.min(Br(c,e.length),e.length);let a=0,y,E,C;for(n=Math.ceil(n),c&&(y=c-i,n=y/Math.floor(y/n)),C=h;C<0;)a++,C=Math.round(h+a*n);for(E=Math.max(h,0);E<m;E++)E===C&&(t.push(e[E]),a++,C=Math.round(h+a*n))}function HAe(e){const t=e.length;let n,i;if(t<2)return!1;for(i=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==i)return!1;return i}const WAe=e=>e==="left"?"right":e==="right"?"left":e,N4=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,V4=(e,t)=>Math.min(t||e,e);function U4(e,t){const n=[],i=e.length/t,c=e.length;let h=0;for(;h<c;h+=i)n.push(e[Math.floor(h)]);return n}function qAe(e,t,n){const i=e.ticks.length,c=Math.min(t,i-1),h=e._startPixel,m=e._endPixel,a=1e-6;let y=e.getPixelForTick(c),E;if(!(n&&(i===1?E=Math.max(y-h,m-y):t===0?E=(e.getPixelForTick(1)-y)/2:E=(y-e.getPixelForTick(c-1))/2,y+=c<t?E:-E,y<h-a||y>m+a)))return y}function XAe(e,t){Hi(e,n=>{const i=n.gc,c=i.length/2;let h;if(c>t){for(h=0;h<c;++h)delete n.data[i[h]];i.splice(0,c)}})}function cb(e){return e.drawTicks?e.tickLength:0}function $4(e,t){if(!e.display)return 0;const n=Ts(e.font,t),i=ba(e.padding);return(vo(e.text)?e.text.length:1)*n.lineHeight+i.height}function ZAe(e,t){return ap(e,{scale:t,type:"scale"})}function YAe(e,t,n){return ap(e,{tick:n,index:t,type:"tick"})}function KAe(e,t,n){let i=CL(e);return(n&&t!=="right"||!n&&t==="right")&&(i=WAe(i)),i}function JAe(e,t,n,i){const{top:c,left:h,bottom:m,right:a,chart:y}=e,{chartArea:E,scales:C}=y;let P=0,L,D,V;const U=m-c,W=a-h;if(e.isHorizontal()){if(D=fa(i,h,a),di(n)){const $=Object.keys(n)[0],Y=n[$];V=C[$].getPixelForValue(Y)+U-t}else n==="center"?V=(E.bottom+E.top)/2+U-t:V=N4(e,n,t);L=a-h}else{if(di(n)){const $=Object.keys(n)[0],Y=n[$];D=C[$].getPixelForValue(Y)-W+t}else n==="center"?D=(E.left+E.right)/2-W+t:D=N4(e,n,t);V=fa(i,m,c),P=n==="left"?-es:es}return{titleX:D,titleY:V,maxWidth:L,rotation:P}}class Zm extends Th{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:i,_suggestedMax:c}=this;return t=Pl(t,Number.POSITIVE_INFINITY),n=Pl(n,Number.NEGATIVE_INFINITY),i=Pl(i,Number.POSITIVE_INFINITY),c=Pl(c,Number.NEGATIVE_INFINITY),{min:Pl(t,i),max:Pl(n,c),minDefined:Wo(t),maxDefined:Wo(n)}}getMinMax(t){let{min:n,max:i,minDefined:c,maxDefined:h}=this.getUserBounds(),m;if(c&&h)return{min:n,max:i};const a=this.getMatchingVisibleMetas();for(let y=0,E=a.length;y<E;++y)m=a[y].controller.getMinMax(this,t),c||(n=Math.min(n,m.min)),h||(i=Math.max(i,m.max));return n=h&&n>i?i:n,i=c&&n>i?n:i,{min:Pl(n,Pl(i,n)),max:Pl(i,Pl(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}
vendor: 4,573 bytes, line 4064
4064getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){co(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:c,grace:h,ticks:m}=this.options,a=m.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=e2e(this,h,c),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const y=a<this.ticks.length;this._convertTicksToLabels(y?U4(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),m.display&&(m.autoSkip||m.source==="auto")&&(this.ticks=VAe(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),y&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,i;this.isHorizontal()?(n=this.left,i=this.right):(n=this.top,i=this.bottom,t=!t),this._startPixel=n,this._endPixel=i,this._reversePixels=t,this._length=i-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){co(this.options.afterUpdate,[this])}beforeSetDimensions(){co(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){co(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),co(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){co(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let i,c,h;for(i=0,c=t.length;i<c;i++)h=t[i],h.label=co(n.callback,[h.value,i,t],this)}afterTickToLabelConversion(){co(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){co(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,i=V4(this.ticks.length,t.ticks.maxTicksLimit),c=n.minRotation||0,h=n.maxRotation;let m=c,a,y,E;if(!this._isVisible()||!n.display||c>=h||i<=1||!this.isHorizontal()){this.labelRotation=c;return}const C=this._getLabelSizes(),P=C.widest.width,L=C.highest.height,D=Ls(this.chart.width-P,0,this.maxWidth);a=t.offset?this.maxWidth/i:D/(i-1),P+6>a&&(a=D/(i-(t.offset?.5:1)),y=this.maxHeight-cb(t.grid)-n.padding-$4(t.title,this.chart.options.font),E=Math.sqrt(P*P+L*L),m=TL(Math.min(Math.asin(Ls((C.highest.height+6)/a,-1,1)),Math.asin(Ls(y/E,-1,1))-Math.asin(Ls(L/E,-1,1)))),m=Math.max(c,Math.min(h,m))),this.labelRotation=m}afterCalculateLabelRotation(){co(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){co(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:c,grid:h}}=this,m=this._isVisible(),a=this.isHorizontal();if(m){const y=$4(c,n.options.font);if(a?(t.width=this.maxWidth,t.height=cb(h)+y):(t.height=this.maxHeight,t.width=cb(h)+y),i.display&&this.ticks.length){const{first:E,last:C,widest:P,highest:L}=this._getLabelSizes(),D=i.padding*2,V=Jc(this.labelRotation),U=Math.cos(V),W=Math.sin(V);if(a){const $=i.mirror?0:W*P.width+U*L.height;t.height=Math.min(this.maxHeight,t.height+$+D)}else{const $=i.mirror?0:U*P.width+W*L.height;t.width=Math.min(this.maxWidth,t.width+$+D)}this._calculatePadding(E,C,W,U)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,c){const{ticks:{align:h,padding:m},position:a}=this.options,y=this.labelRotation!==0,E=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const C=this.getPixelForTick(0)-this.left,P
4064=this.right-this.getPixelForTick(this.ticks.length-1);let L=0,D=0;y?E?(L=c*t.width,D=i*n.height):(L=i*t.height,D=c*n.width):h==="start"?D=n.width:h==="end"?L=t.width:h!=="inner"&&(L=t.width/2,D=n.width/2),this.paddingLeft=Math.max((L-C+m)*this.width/(this.width-C),0),this.paddingRight=Math.max((D-P+m)*this.width/(this.width-P),0)}else{let C=n.height/2,P=t.height/2;h==="start"?(C=0,P=t.height):h==="end"&&(C=n.height,P=0),this.paddingTop=C+m,this.paddingBottom=P+m}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){co(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,i;for(n=0,i=t.length;n<i;n++)oi(t[n].label)&&(t.splice(n,1),i--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let i=this.ticks;n<i.length&&(i=U4(i,n)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,i){const{ctx:c,_longestTextCache:h}=this,m=[],a=[],y=Math.floor(n/V4(n,i));let E=0,C=0,P,L,D,V,U,W,$,Y,X,K,ne;for(P=0;P<n;P+=y){if(V=t[P].label,U=this._resolveTickFontOptions(P),c.font=W=U.string,$=h[W]=h[W]||{data:{},gc:[]},Y=U.lineHeight,X=K=0,!oi(V)&&!vo(V))X=ZE(c,$.data,$.gc,X,V),K=Y;else if(vo(V))for(L=0,D=V.length;L<D;++L)ne=V[L],!oi(ne)&&!vo(ne)&&(X=ZE(c,$.data,$.gc,X,ne),K+=Y);m.push(X),a.push(K),E=Math.max(X,E),C=Math.max(K,C)}XAe(h,n);const fe=m.indexOf(E),ye=a.indexOf(C),ke=Fe=>({width:m[Fe]||0,height:a[Fe]||0});return{first:ke(0),last:ke(n-1),widest:ke(fe),highest:ke(ye),widths:m,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return PCe(this._alignToPixels?fm(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const i=n[t];return i.$context||(i.$context=YAe(this.getContext(),t,i))}return this.$context||(this.$context=ZAe(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Jc(this.labelRotation),i=Math.abs(Math.cos(n)),c=Math.abs(Math.sin(n)),h=this._getLabelSizes(),m=t.autoSkipPadding||0,a=h?h.widest.width+m:0,y=h?h.highest.height+m:0;return this.isHorizontal()?y*i>a*c?a/i:y/c:y*c<a*i?y/i:a/c}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,i=this.chart,c=this.options,{grid:h,position:m,border:a}=c,y=h.offset,E=this.isHorizontal(),P=this.ticks.length+(y?1:0),L=cb(h),D=[],V=a.setContext(this.getContext()),U=V.display?V.width:0,W=U/2,$=function(jt){return fm(i,jt,U)};let Y,X,K,ne,fe,ye,ke,Fe,qe,lt,pt,Qt;if(m==="top")Y=$(this.bottom),ye=this.bottom-L,Fe=Y-W,lt=$(t.top)+W,Qt=t.bottom;else if(m==="bottom")Y=$(this.top),lt=t.top,Qt=$(t.bottom)-W,ye=Y+W,Fe=this.top+L;else if(m==="left")Y=$(this.right),fe=this.right-L,ke=Y-W,qe=$(t.left)+W,pt=t.right;else if(m==="right")Y=$(this.left),qe=t.left,pt=$(t.right)-W,fe=Y+W,ke=this.left+L;else if(n==="x"){if(m==="center")Y=$((t.top+t.bottom)/2+.5);else if(di(m)){const jt=Object.keys(m)[0],Zt=m[jt];Y=$(this.chart.scales[jt].getPixelForValue(Zt))}lt=t.top,Qt=t.bottom,ye=Y+W,Fe=ye+L}else if(n==="y"){if(m==="center")Y=$((t.left+t.right)/2);else if(di(m)){const jt=Object.keys(m)[0],Zt=m[jt];Y=$(this.chart.scales[jt].getPixelForValue(Zt))}fe=Y-W,ke=fe-L,qe=t.left,pt=t.right}const Ht=Br(c.ticks.maxTicksLimit,P),zt=Math.max(1,Math.ceil(P/Ht));for(X=0;X<P;X+=zt){const jt=this.getContext(X),Zt=h.setContext(jt),Wt=a.setContext(jt),en=Zt.lineWidth,sn=Zt.color,Mn=Wt.dash||[],xn=Wt.dashOffset,Vn=Zt.tickWidth,Ln=Zt.tickColor,Yn=Zt.tickBorderDash||[],Rn=Zt.tickBorderDashOffset;K=qAe(this,X,y),K!==void 0&&(ne=fm(i,K,en),E?fe=ke=qe=pt=ne:ye=Fe=lt=Qt=ne,D.push({tx1:fe,ty1:ye,tx2:ke,ty2:Fe,x1:qe,y1:lt,x2:pt,y2:Qt,width:en,color:sn,borderDash:Mn,borderDashOffset:xn,tickWidth:Vn,tickColor:Ln,tickBorderDash:Yn,tickBorderDashOffset:Rn}))}return this._ticksLength=P,this._borderValue=Y,D}_computeLabelItems(t){const n=this.axis,i=this.options,{position:c,ticks:h}=i,m=this.isHorizontal(),a=this.ticks,{align:y,crossAlign:E,padding:C,mirror:P}=h,L=cb(i.grid),D=L+C,V=P?-C:D,U=-Jc(this.labelRotation),W=[];let $,Y,X,K,ne,fe,ye,ke,Fe,qe,lt,pt,Qt="middle";if(c==="top")fe=this.bottom-V,ye=this._getXAxisLabelAlignment();else if(c==="bottom")fe=this.top+V,ye=this._getXAxisLabelAlignment();
4064else if(c==="left"){const zt=this._getYAxisLabelAlignment(L);ye=zt.textAlign,ne=zt.x}else if(c==="right"){const zt=this._getYAxisLabelAlignment(L);ye=zt.textAlign,ne=zt.x}else if(n==="x"){if(c==="center")fe=(t.top+t.bottom)/2+D;else if(di(c)){const zt=Object.keys(c)[0],jt=c[zt];fe=this.chart.scales[zt].getPixelForValue(jt)+D}ye=this._getXAxisLabelAlignment()}else if(n==="y"){if(c==="center")ne=(t.left+t.right)/2-D;else if(di(c)){const zt=Object.keys(c)[0],jt=c[zt];ne=this.chart.scales[zt].getPixelForValue(jt)}ye=this._getYAxisLabelAlignment(L).textAlign}n==="y"&&(y==="start"?Qt="top":y==="end"&&(Qt="bottom"));const Ht=this._getLabelSizes();for($=0,Y=a.length;$<Y;++$){X=a[$],K=X.label;const zt=h.setContext(this.getContext($));ke=this.getPixelForTick($)+h.labelOffset,Fe=this._resolveTickFontOptions($),qe=Fe.lineHeight,lt=vo(K)?K.length:1;const jt=lt/2,Zt=zt.color,Wt=zt.textStrokeColor,en=zt.textStrokeWidth;let sn=ye;m?(ne=ke,ye==="inner"&&($===Y-1?sn=this.options.reverse?"left":"right":$===0?sn=this.options.reverse?"right":"left":sn="center"),c==="top"?E==="near"||U!==0?pt=-lt*qe+qe/2:E==="center"?pt=-Ht.highest.height/2-jt*qe+qe:pt=-Ht.highest.height+qe/2:E==="near"||U!==0?pt=qe/2:E==="center"?pt=Ht.highest.height/2-jt*qe:pt=Ht.highest.height-lt*qe,P&&(pt*=-1),U!==0&&!zt.showLabelBackdrop&&(ne+=qe/2*Math.sin(U))):(fe=ke,pt=(1-lt)*qe/2);let Mn;if(zt.showLabelBackdrop){const xn=ba(zt.backdropPadding),Vn=Ht.heights[$],Ln=Ht.widths[$];let Yn=pt-xn.top,Rn=0-xn.left;switch(Qt){case"middle":Yn-=Vn/2;break;case"bottom":Yn-=Vn;break}switch(ye){case"center":Rn-=Ln/2;break;case"right":Rn-=Ln;break;case"inner":$===Y-1?Rn-=Ln:$>0&&(Rn-=Ln/2);break}Mn={left:Rn,top:Yn,width:Ln+xn.width,height:Vn+xn.height,color:zt.backdropColor}}
4064W.push({label:K,font:Fe,textOffset:pt,options:{rotation:U,color:Zt,strokeColor:Wt,strokeWidth:en,textAlign:sn,textBaseline:Qt,translation:[ne,fe],backdrop:Mn}})}return W}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Jc(this.labelRotation))return t==="top"?"left":"right";let c="center";return n.align==="start"?c="left":n.align==="end"?c="right":n.align==="inner"&&(c="inner"),c}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:i,mirror:c,padding:h}}=this.options,m=this._getLabelSizes(),a=t+h,y=m.widest.width;let E,C;return n==="left"?c?(C=this.right+h,i==="near"?E="left":i==="center"?(E="center",C+=y/2):(E="right",C+=y)):(C=this.right-a,i==="near"?E="right":i==="center"?(E="center",C-=y/2):(E="left",C=this.left)):n==="right"?c?(C=this.left+h,i==="near"?E="right":i==="center"?(E="center",C-=y/2):(E="left",C-=y)):(C=this.left+a,i==="near"?E="left":i==="center"?(E="center",C+=y/2):(E="right",C=this.right)):E="right",{textAlign:E,x:C}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};
4064if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:i,top:c,width:h,height:m}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,c,h,m),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const c=this.ticks.findIndex(h=>h.value===t);return c>=0?n.setContext(this.getContext(c)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,c=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let h,m;const a=(y,E,C)=>{!C.width||!C.color||(i.save(),i.lineWidth=C.width,i.strokeStyle=C.color,i.setLineDash(C.borderDash||[]),i.lineDashOffset=C.borderDashOffset,i.beginPath(),i.moveTo(y.x,y.y),i.lineTo(E.x,E.y),i.stroke(),i.restore())};if(n.display)for(h=0,m=c.length;h<m;++h){const y=c[h];n.drawOnChartArea&&a({x:y.x1,y:y.y1},{x:y.x2,y:y.y2},y),n.drawTicks&&a({x:y.tx1,y:y.ty1},{x:y.tx2,y:y.ty2},{color:y.tickColor,width:y.tickWidth,borderDash:y.tickBorderDash,borderDashOffset:y.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:i,grid:c}}=this,h=i.setContext(this.getContext()),m=i.display?h.width:0;if(!m)return;const a=c.setContext(this.getContext(0)).lineWidth,y=this._borderValue;let E,C,P,L;this.isHorizontal()?(E=fm(t,this.left,m)-m/2,C=fm(t,this.right,a)+a/2,P=L=y):(P=fm(t,this.top,m)-m/2,L=fm(t,this.bottom,a)+a/2,E=C=y),n.save(),n.lineWidth=h.width,n.strokeStyle=h.color,n.beginPath(),n.moveTo(E,P),n.lineTo(C,L),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;
4064const i=this.ctx,c=this._computeLabelArea();c&&r2(i,c);const h=this.getLabelItems(t);for(const m of h){const a=m.options,y=m.font,E=m.label,C=m.textOffset;Hm(i,E,0,C,y,a)}c&&i2(i)}drawTitle(){const{ctx:t,options:{position:n,title:i,reverse:c}}=this;if(!i.display)return;const h=Ts(i.font),m=ba(i.padding),a=i.align;let y=h.lineHeight/2;n==="bottom"||n==="center"||di(n)?(y+=m.bottom,vo(i.text)&&(y+=h.lineHeight*(i.text.length-1))):y+=m.top;const{titleX:E,titleY:C,maxWidth:P,rotation:L}=JAe(this,y,n,a);Hm(t,i.text,0,0,h,{color:i.color,maxWidth:P,rotation:L,textAlign:KAe(a,n,c),textBaseline:"middle",translation:[E,C]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,i=Br(t.grid&&t.grid.z,-1),c=Br(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Zm.prototype.draw?[{z:n,draw:h=>{this.draw(h)}}]:[{z:i,draw:h=>{this.drawBackground(),this.drawGrid(h),this.drawTitle()}},{z:c,draw:()=>{this.drawBorder()}},{z:n,draw:h=>{this.drawLabels(h)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",c=[];let h,m;for(h=0,m=n.length;h<m;++h){const a=n[h];a[i]===this.id&&(!t||a.type===t)&&c.push(a)}return c}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return Ts(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class kT{constructor(t,n,i){this.type=t,this.scope=n,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let i;tIe(n)&&(i=this.register(n));const c=this.items,h=t.id,m=this.scope+"."+h;if(!h)throw new Error("class does not have id: "+t);return h in c||(c[h]=t,QAe(t,m,i),this.override&&Ro.override(t.id,t.overrides)),m}get(t){return this.items[t]}unregister(t){const n=this.items,i=t.id,c=this.scope;i in n&&delete n[i],c&&i in Ro[c]&&(delete Ro[c][i],this.override&&delete Gm[i])}}function QAe(e,t,n){const i=cx(Object.create(null),[n?Ro.get(n):{},Ro.get(t),e.defaults]);Ro.set(t,i),e.defaultRoutes&&eIe(t,e.defaultRoutes),e.descriptors&&Ro.describe(t,e.descriptors)}function eIe(e,t){Object.keys(t).forEach(n=>{const i=n.split("."),c=i.pop(),h=[e].concat(i).join("."),m=t[n].split("."),a=m.pop(),y=m.join(".");Ro.route(h,c,y,a)})}function tIe(e){return"id"in e&&"defaults"in e}class nIe{constructor(){this.controllers=new kT(lp,"datasets",!0),this.elements=new kT(Th,"elements"),this.plugins=new kT(Object,"plugins"),this.scales=new kT(Zm,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,i){[...n].forEach(c=>{const h=i||this._getRegistryForType(c);i||h.isForType(c)||h===this.plugins&&c.id?this._exec(t,h,c):Hi(c,m=>{const a=i||this._getRegistryForType(m);this._exec(t,a,m)})})}_exec(t,n,i){const c=SL(t);co(i["before"+c],[],i),n[t](i),co(i["after"+c],[],i)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const i=this._typedRegistries[n];if(i.isForType(t))return i}return this.plugins}_get(t,n,i){const c=n.get(t);if(c===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return c}}var Xu=new nIe;class rIe{constructor(){this._init=void 0}notify(t,n,i,c){if(n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const h=c?this._descriptors(t).filter(c):this._descriptors(t),m=this._notify(h,t,n,i);return n==="afterDestroy"&&(this._notify(h,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),m}_notify(t,n,i,c){c=c||{};for(const h of t){const m=h.plugin,a=m[i],y=[n,c,h.options];if(co(a,y,m)===!1&&c.cancelable)return!1}return!0}invalidate(){oi(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;
4064const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const i=t&&t.config,c=Br(i.options&&i.options.plugins,{}),h=iIe(i);return c===!1&&!n?[]:sIe(t,h,c,n)}_notifyStateChanges(t){const n=this._oldCache||[],i=this._cache,c=(h,m)=>h.filter(a=>!m.some(y=>a.plugin.id===y.plugin.id));this._notify(c(n,i),t,"stop"),this._notify(c(i,n),t,"start")}}function iIe(e){const t={},n=[],i=Object.keys(Xu.plugins.items);for(let h=0;h<i.length;h++)n.push(Xu.getPlugin(i[h]));const c=e.plugins||[];for(let h=0;h<c.length;h++){const m=c[h];n.indexOf(m)===-1&&(n.push(m),t[m.id]=!0)}return{plugins:n,localIds:t}}function oIe(e,t){return!t&&e===!1?null:e===!0?{}:e}function sIe(e,{plugins:t,localIds:n},i,c){const h=[],m=e.getContext();for(const a of t){const y=a.id,E=oIe(i[y],c);E!==null&&h.push({plugin:a,options:aIe(e.config,{plugin:a,local:n[y]},E,m)})}return h}function aIe(e,{plugin:t,local:n},i,c){const h=e.pluginScopeKeys(t),m=e.getOptionScopes(i,h);return n&&t.defaults&&m.push(t.defaults),e.createResolver(m,c,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ck(e,t){const n=Ro.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function lIe(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function cIe(e,t){return e===t?"_index_":"_value_"}function j4(e){if(e==="x"||e==="y"||e==="r")return e}function uIe(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Ak(e,...t){if(j4(e))return e;for(const n of t){const i=n.axis||uIe(n.position)||e.length>1&&j4(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function G4(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function dIe(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return G4(e,"x",n[0])||G4(e,"y",n[0])}return{}}function hIe(e,t){const n=Gm[e.type]||{scales:{}},i=t.scales||{},c=Ck(e.type,t),h=Object.create(null);
4064return Object.keys(i).forEach(m=>{const a=i[m];if(!di(a))return console.error(`Invalid scale configuration for scale: ${m}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${m}`);const y=Ak(m,a,dIe(m,e),Ro.scales[a.type]),E=cIe(y,c),C=n.scales||{};h[m]=Ub(Object.create(null),[{axis:y},a,C[y],C[E]])}),e.data.datasets.forEach(m=>{const a=m.type||e.type,y=m.indexAxis||Ck(a,t),C=(Gm[a]||{}).scales||{};Object.keys(C).forEach(P=>{const L=lIe(P,y),D=m[L+"AxisID"]||L;h[D]=h[D]||Object.create(null),Ub(h[D],[{axis:L},i[D],C[P]])})}),Object.keys(h).forEach(m=>{const a=h[m];Ub(a,[Ro.scales[a.type],Ro.scale])}),h}function oG(e){const t=e.options||(e.options={});t.plugins=Br(t.plugins,{}),t.scales=hIe(e,t)}function sG(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function fIe(e){return e=e||{},e.data=sG(e.data),oG(e),e}const H4=new Map,aG=new Set;function MT(e,t){let n=H4.get(e);return n||(n=t(),H4.set(e,n),aG.add(n)),n}const ub=(e,t,n)=>{const i=ep(t,n);i!==void 0&&e.add(i)};class pIe{constructor(t){this._config=fIe(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=sG(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),oG(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return MT(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return MT(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return MT(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return MT(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let c=i.get(t);return(!c||n)&&(c=new Map,i.set(t,c)),c}getOptionScopes(t,n,i){const{options:c,type:h}=this,m=this._cachedScopes(t,i),a=m.get(n);if(a)return a;const y=new Set;n.forEach(C=>{t&&(y.add(t),C.forEach(P=>ub(y,t,P))),C.forEach(P=>ub(y,c,P)),C.forEach(P=>ub(y,Gm[h]||{},P)),C.forEach(P=>ub(y,Ro,P)),C.forEach(P=>ub(y,Tk,P))});const E=Array.from(y);return E.length===0&&E.push(Object.create(null)),aG.has(n)&&m.set(n,E),E}chartOptionScopes(){const{options:t,type:n}=this;return[t,Gm[n]||{},Ro.datasets[n]||{},{type:n},Ro,Tk]}resolveNamedOptions(t,n,i,c=[""]){const h={$shared:!0},{resolver:m,subPrefixes:a}=W4(this._resolverCache,t,c);let y=m;if(gIe(m,n)){h.$shared=!1,i=tp(i)?i():i;const E=this.createResolver(t,i,a);y=by(m,i,E)}for(const E of n)h[E]=y[E];return h}createResolver(t,n,i=[""],c){const{resolver:h}=W4(this._resolverCache,t,i);return di(n)?by(h,n,void 0,c):h}}function W4(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const c=n.join();let h=i.get(c);return h||(h={resolver:PL(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(c,h)),h}const mIe=e=>di(e)&&Object.getOwnPropertyNames(e).some(t=>tp(e[t]));function gIe(e,t){const{isScriptable:n,isIndexable:i}=z7(e);for(const c of t){const h=n(c),m=i(c),a=(m||h)&&e[c];if(h&&(tp(a)||mIe(a))||m&&vo(a))return!0}return!1}var _Ie="4.5.1";const yIe=["top","bottom","left","right","chartArea"];function q4(e,t){return e==="top"||e==="bottom"||yIe.indexOf(e)===-1&&t==="x"}function X4(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function Z4(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),co(n&&n.onComplete,[e],t)}function vIe(e){const t=e.chart,n=t.options.animation;co(n&&n.onProgress,[e],t)}function lG(e){return ML()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const eE={},Y4=e=>{const t=lG(e);return Object.values(eE).filter(n=>n.canvas===t).pop()};function bIe(e,t,n){const i=Object.keys(e);for(const c of i){const h=+c;if(h>=t){const m=e[c];delete e[c],(n>0||h>t)&&(e[h+n]=m)}}}function xIe(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}class Ik{static defaults=Ro;static instances=eE;static overrides=Gm;static registry=Xu;static version=_Ie;static getChart=Y4;static register(...t){Xu.add(...t),K4()}static unregister(...t){Xu.remove(...t),K4()}constructor(t,n){const i=this.config=new pIe(n),c=lG(t),h=Y4(c);if(h)throw new Error("Canvas is already in use. Chart with ID '"+h.id+"' must be destroyed before the canvas with ID '"+h.canvas.id+"' can be reused.");const m=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||NAe(c)),this.platform.updateConfig(i);const a=this.platform.acquireContext(c,m.aspectRatio),y=a&&a.canvas,E=y&&y.height,C=y&&y.width;if(this.id=gCe(),this.ctx=a,this.canvas=y,this.width=C,this.height=E,this._options=m,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new rIe,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=LCe(P=>this.update(P),m.resizeDelay||0),this._dataChanges=[],eE[this.id]=this,!a||!y){console.error("Failed to create chart: can't acquire context from the given item");return}Kd.listen(this,"complete",Z4),Kd.listen(this,"progress",vIe),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:c,_aspectRatio:h}=this;return oi(t)?n&&h?h:c?i/c:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Xu}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():v4(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return g4(this.canvas,this.ctx),this}stop(){return Kd.stop(this),this}resize(t,n){Kd.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,c=this.canvas,h=i.maintainAspectRatio&&this.aspectRatio,m=this.platform.getMaximumSize(c,t,n,h),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),y=this.width?"resize":"attach";this.width=m.width,this.height=m.height,this._aspectRatio=this.aspectRatio,v4(this,a,!0)&&(this.notifyPlugins("resize",{size:m}),co(i.onResize,[this,m],this),this.attached&&this._doResize(y)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Hi(n,(i,c)=>{i.id=c})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,c=Object.keys(i).reduce((m,a)=>(m[a]=!1,m),{});let h=[];n&&(h=h.concat(Object.keys(n).map(m=>{const a=n[m],y=Ak(m,a),E=y==="r",C=y==="x";return{options:a,dposition:E?"chartArea":C?"bottom":"left",dtype:E?"radialLinear":C?"category":"linear"}}))),Hi(h,m=>{const a=m.options,y=a.id,E=Ak(y,a),C=Br(a.type,m.dtype);(a.position===void 0||q4(a.position,E)!==q4(m.dposition))&&(a.position=m.dposition),c[y]=!0;let P=null;if(y in i&&i[y].type===C)P=i[y];else{const L=Xu.getScale(C);
4064P=new L({id:y,type:C,ctx:this.ctx,chart:this}),i[P.id]=P}P.init(a,t)}),Hi(c,(m,a)=>{m||delete i[a]}),Hi(i,m=>{ga.configure(this,m,m.options),ga.addBox(this,m)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((c,h)=>c.index-h.index),i>n){for(let c=n;c<i;++c)this._destroyDatasetMeta(c);t.splice(n,i-n)}this._sortedMetasets=t.slice(0).sort(X4("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((i,c)=>{n.filter(h=>h===i._dataset).length===0&&this._destroyDatasetMeta(c)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,c;for(this._removeUnreferencedMetasets(),i=0,c=n.length;i<c;i++){const h=n[i];let m=this.getDatasetMeta(i);const a=h.type||this.config.type;if(m.type&&m.type!==a&&(this._destroyDatasetMeta(i),m=this.getDatasetMeta(i)),m.type=a,m.indexAxis=h.indexAxis||Ck(a,this.options),m.order=h.order||0,m.index=i,m.label=""+h.label,m.visible=this.isDatasetVisible(i),m.controller)m.controller.updateIndex(i),m.controller.linkScales();else{const y=Xu.getController(a),{datasetElementType:E,dataElementType:C}=Ro.datasets[a];Object.assign(y,{dataElementType:Xu.getElement(C),datasetElementType:E&&Xu.getElement(E)}),m.controller=new y(this,i),t.push(m.controller)}}return this._updateMetasets(),t}_resetElements(){Hi(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),c=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const h=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let m=0;for(let E=0,C=this.data.datasets.length;E<C;E++){const{controller:P}=this.getDatasetMeta(E),L=!c&&h.indexOf(P)===-1;P.buildOrUpdateElements(L),m=Math.max(+P.getMaxOverflow(),m)}m=this._minPadding=i.layout.autoPadding?m:0,this._updateLayout(m),c||Hi(h,E=>{E.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(X4("z","_idx"));const{_active:a,_lastEvent:y}=this;y?this._eventHandler(y,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Hi(this.scales,t=>{ga.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!a4(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:c,count:h}of n){const m=i==="_removeElements"?-h:h;bIe(t,c,m)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=h=>new Set(t.filter(m=>m[0]===h).map((m,a)=>a+","+m.splice(1).join(","))),c=i(0);for(let h=1;h<n;h++)if(!a4(c,i(h)))return;return Array.from(c).map(h=>h.split(",")).map(h=>({method:h[1],start:+h[2],count:+h[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;ga.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],Hi(this.boxes,c=>{i&&c.position==="chartArea"||(c.configure&&c.configure(),this._layers.push(...c._layers()))},this),this._layers.forEach((c,h)=>{c._idx=h}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n<i;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,i=this.data.datasets.length;n<i;++n)this._updateDataset(n,tp(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const i=this.getDatasetMeta(t),c={meta:i,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",c)!==!1&&(i.controller._update(n),c.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",c))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Kd.has(this)?this.attached&&!Kd.running(this)&&Kd.start(this):(this.draw(),Z4({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:c}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,c)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,i=[];let c,h;for(c=0,h=n.length;c<h;++c){const m=n[c];(!t||m.visible)&&i.push(m)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i={meta:t,index:t.index,cancelable:!0},c=Z7(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(c&&r2(n,c),t.controller.draw(),c&&i2(n),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return uh(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,c){const h=yAe.modes[n];return typeof h=="function"?h(this,t,i,c):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let c=i.filter(h=>h&&h._dataset===n).pop();return c||(c={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},i.push(c)),c}getContext(){return this.$context||(this.$context=ap(null,{chart:this,type:"chart"}))}
4064getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const c=i?"show":"hide",h=this.getDatasetMeta(t),m=h.controller._resolveAnimations(void 0,c);ux(n)?(h.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),m.update(h,{visible:i}),this.update(a=>a.datasetIndex===t?c:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),Kd.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),g4(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete eE[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,i=(h,m)=>{n.addEventListener(this,h,m),t[h]=m},c=(h,m,a)=>{h.offsetX=m,h.offsetY=a,this._eventHandler(h)};Hi(this.options.events,h=>i(h,c))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(y,E)=>{n.addEventListener(this,y,E),t[y]=E},c=(y,E)=>{t[y]&&(n.removeEventListener(this,y,E),delete t[y])},h=(y,E)=>{this.canvas&&this.resize(y,E)};let m;const a=()=>{c("attach",a),this.attached=!0,this.resize(),i("resize",h),i("detach",m)};m=()=>{this.attached=!1,c("resize",h),this._stop(),this._resize(0,0),i("attach",a)},n.isAttached(this.canvas)?a():m()}unbindEvents(){Hi(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Hi(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const c=i?"set":"remove";let h,m,a,y;for(n==="dataset"&&(h=this.getDatasetMeta(t[0].datasetIndex),h.controller["_"+c+"DatasetHoverStyle"]()),a=0,y=t.length;a<y;++a){m=t[a];const E=m&&this.getDatasetMeta(m.datasetIndex).controller;E&&E[c+"HoverStyle"](m.element,m.datasetIndex,m.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],i=t.map(({datasetIndex:h,index:m})=>{const a=this.getDatasetMeta(h);if(!a)throw new Error("No dataset found at index "+h);return{datasetIndex:h,element:a.data[m],index:m}});!WE(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){const c=this.options.hover,h=(y,E)=>y.filter(C=>!E.some(P=>C.datasetIndex===P.datasetIndex&&C.index===P.index)),m=h(n,t),a=i?t:h(t,n);m.length&&this.updateHoverStyle(m,c.mode,!1),a.length&&c.mode&&this.updateHoverStyle(a,c.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},c=m=>(m.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,c)===!1)return;const h=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,c),(h||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:c=[],options:h}=this,m=n,a=this._getActiveElements(t,c,i,m),y=wCe(t),E=xIe(t,this._lastEvent,i,y);i&&(this._lastEvent=null,co(h.onHover,[t,a,this],this),y&&co(h.onClick,[t,a,this],this));const C=!WE(a,c);return(C||n)&&(this._active=a,this._updateHoverStyles(a,c,n)),this._lastEvent=E,C}_getActiveElements(t,n,i,c){if(t.type==="mouseout")return[];if(!i)return n;const h=this.options.hover;return this.getElementsAtEventForMode(t,h.mode,h,c)}}function K4(){return Hi(Ik.instances,e=>e._plugins.invalidate())}function wIe(e,t,n){const{startAngle:i,x:c,y:h,outerRadius:m,innerRadius:a,options:y}=t,{borderWidth:E,borderJoinStyle:C}=y,P=Math.min(E/m,pa(i-n));if(e.beginPath(),e.arc(c,h,m-E/2,i+P/2,n-P/2),a>0){const L=Math.min(E/a,pa(i-n));e.arc(c,h,a+E/2,n-L/2,i+L/2,!0)}else{const L=Math.min(E/2,m*pa(i-n));if(C==="round")e.arc(c,h,L,n-Ci/2,i+Ci/2,!0);else if(C==="bevel"){const D=2*L*L,V=-D*Math.cos(n+Ci/2)+c,U=-D*Math.sin(n+Ci/2)+h,W=D*Math.cos(i+Ci/2)+c,$=D*Math.sin(i+Ci/2)+h;e.lineTo(V,U),e.lineTo(W,$)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function SIe(e,t,n){const{startAngle:i,pixelMargin:c,x:h,y:m,outerRadius:a,innerRadius:y}=t;let E=c/a;e.beginPath(),e.arc(h,m,a,i-E,n+E),y>
4064c?(E=c/y,e.arc(h,m,y,n+E,i-E,!0)):e.arc(h,m,c,n+es,i-es),e.closePath(),e.clip()}function TIe(e){return IL(e,["outerStart","outerEnd","innerStart","innerEnd"])}function EIe(e,t,n,i){const c=TIe(e.options.borderRadius),h=(n-t)/2,m=Math.min(h,i*t/2),a=y=>{const E=(n-Math.min(h,y))*i/2;return Ls(y,0,Math.min(h,E))};return{outerStart:a(c.outerStart),outerEnd:a(c.outerEnd),innerStart:Ls(c.innerStart,0,m),innerEnd:Ls(c.innerEnd,0,m)}}function k_(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function JE(e,t,n,i,c,h){const{x:m,y:a,startAngle:y,pixelMargin:E,innerRadius:C}=t,P=Math.max(t.outerRadius+i+n-E,0),L=C>0?C+i+n+E:0;let D=0;const V=c-y;if(i){const zt=C>0?C-i:0,jt=P>0?P-i:0,Zt=(zt+jt)/2,Wt=Zt!==0?V*Zt/(Zt+i):V;D=(V-Wt)/2}const U=Math.max(.001,V*P-n/Ci)/P,W=(V-U)/2,$=y+W+D,Y=c-W-D,{outerStart:X,outerEnd:K,innerStart:ne,innerEnd:fe}=EIe(t,L,P,Y-$),ye=P-X,ke=P-K,Fe=$+X/ye,qe=Y-K/ke,lt=L+ne,pt=L+fe,Qt=$+ne/lt,Ht=Y-fe/pt;if(e.beginPath(),h){const zt=(Fe+qe)/2;if(e.arc(m,a,P,Fe,zt),e.arc(m,a,P,zt,qe),K>0){const en=k_(ke,qe,m,a);e.arc(en.x,en.y,K,qe,Y+es)}const jt=k_(pt,Y,m,a);if(e.lineTo(jt.x,jt.y),fe>0){const en=k_(pt,Ht,m,a);e.arc(en.x,en.y,fe,Y+es,Ht+Math.PI)}const Zt=(Y-fe/L+($+ne/L))/2;if(e.arc(m,a,L,Y-fe/L,Zt,!0),e.arc(m,a,L,Zt,$+ne/L,!0),ne>0){const en=k_(lt,Qt,m,a);e.arc(en.x,en.y,ne,Qt+Math.PI,$-es)}const Wt=k_(ye,$,m,a);if(e.lineTo(Wt.x,Wt.y),X>0){const en=k_(ye,Fe,m,a);e.arc(en.x,en.y,X,$-es,Fe)}}else{e.moveTo(m,a);const zt=Math.cos(Fe)*P+m,jt=Math.sin(Fe)*P+a;e.lineTo(zt,jt);const Zt=Math.cos(qe)*P+m,Wt=Math.sin(qe)*P+a;e.lineTo(Zt,Wt)}e.closePath()}function CIe(e,t,n,i,c){const{fullCircles:h,startAngle:m,circumference:a}=t;let y=t.endAngle;if(h){JE(e,t,n,i,y,c);for(let E=0;E<h;++E)e.fill();isNaN(a)||(y=m+(a%xo||xo))}return JE(e,t,n,i,y,c),e.fill(),y}function AIe(e,t,n,i,c){const{fullCircles:h,startAngle:m,circumference:a,options:y}=t,{borderWidth:E,borderJoinStyle:C,borderDash:P,borderDashOffset:L,borderRadius:D}=y,V=y.borderAlign==="inner";if(!E)return;e.setLineDash(P||[]),e.lineDashOffset=L,V?(e.lineWidth=E*2,e.lineJoin=C||"round"):(e.lineWidth=E,e.lineJoin=C||"bevel");let U=t.endAngle;if(h){JE(e,t,n,i,U,c);for(let W=0;W<h;++W)e.stroke();isNaN(a)||(U=m+(a%xo||xo))}V&&SIe(e,t,U),y.selfJoin&&U-m>=Ci&&D===0&&C!=="miter"&&wIe(e,t,U),h||(JE(e,t,n,i,U,c),e.stroke())}class IIe extends Th{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,n,i){const c=this.getProps(["x","y"],i),{angle:h,distance:m}=I7(c,{x:t,y:n}),{startAngle:a,endAngle:y,innerRadius:E,outerRadius:C,circumference:P}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),L=(this.options.spacing+this.options.borderWidth)/2,D=Br(P,y-a),V=dx(h,a,y)&&a!==y,U=D>=xo||V,W=lh(m,E+L,C+L);return U&&W}getCenterPoint(t){const{x:n,y:i,startAngle:c,endAngle:h,innerRadius:m,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:y,spacing:E}=this.options,C=(c+h)/2,P=(m+a+E+y)/2;return{x:n+Math.cos(C)*P,y:i+Math.sin(C)*P}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:n,circumference:i}=this,c=(n.offset||0)/4,h=(n.spacing||0)/2,m=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=i>xo?Math.floor(i/xo):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*c,Math.sin(a)*c);const y=1-Math.sin(Math.min(Ci,i||0)),E=c*y;t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,CIe(t,this,E,h,m),AIe(t,this,E,h,m),t.restore(
4064)}}function cG(e,t,n=t){e.lineCap=Br(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Br(n.borderDash,t.borderDash)),e.lineDashOffset=Br(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Br(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Br(n.borderWidth,t.borderWidth),e.strokeStyle=Br(n.borderColor,t.borderColor)}function PIe(e,t,n){e.lineTo(n.x,n.y)}function RIe(e){return e.stepped?HCe:e.tension||e.cubicInterpolationMode==="monotone"?WCe:PIe}function uG(e,t,n={}){const i=e.length,{start:c=0,end:h=i-1}=n,{start:m,end:a}=t,y=Math.max(c,m),E=Math.min(h,a),C=c<m&&h<m||c>a&&h>a;return{count:i,start:y,loop:t.loop,ilen:E<y&&!C?i+E-y:E-y}}function kIe(e,t,n,i){const{points:c,options:h}=t,{count:m,start:a,loop:y,ilen:E}=uG(c,n,i),C=RIe(h);let{move:P=!0,reverse:L}=i||{},D,V,U;for(D=0;D<=E;++D)V=c[(a+(L?E-D:D))%m],!V.skip&&(P?(e.moveTo(V.x,V.y),P=!1):C(e,U,V,L,h.stepped),U=V);return y&&(V=c[(a+(L?E:0))%m],C(e,U,V,L,h.stepped)),!!y}function MIe(e,t,n,i){const c=t.points,{count:h,start:m,ilen:a}=uG(c,n,i),{move:y=!0,reverse:E}=i||{};let C=0,P=0,L,D,V,U,W,$;const Y=K=>(m+(E?a-K:K))%h,X=()=>{U!==W&&(e.lineTo(C,W),e.lineTo(C,U),e.lineTo(C,$))};for(y&&(D=c[Y(0)],e.moveTo(D.x,D.y)),L=0;L<=a;
4064++L){if(D=c[Y(L)],D.skip)continue;const K=D.x,ne=D.y,fe=K|0;fe===V?(ne<U?U=ne:ne>W&&(W=ne),C=(P*C+K)/++P):(X(),e.lineTo(K,ne),V=fe,P=0,U=W=ne),$=ne}X()}function Pk(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?MIe:kIe}function LIe(e){return e.stepped?T2e:e.tension||e.cubicInterpolationMode==="monotone"?E2e:vm}function OIe(e,t,n,i){let c=t._path;c||(c=t._path=new Path2D,t.path(c,n,i)&&c.closePath()),cG(e,t.options),e.stroke(c)}function DIe(e,t,n,i){const{segments:c,options:h}=t,m=Pk(t);for(const a of c)cG(e,h,a.style),e.beginPath(),m(e,t,a,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const FIe=typeof Path2D=="function";function BIe(e,t,n,i){FIe&&!t.options.segment?OIe(e,t,n,i):DIe(e,t,n,i)}class a2 extends Th{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const c=i.spanGaps?this._loop:this._fullLoop;g2e(this._points,i,t,c,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=k2e(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,c=t[n],h=this.points,m=X7(this,{property:n,start:c,end:c});if(!m.length)return;const a=[],y=LIe(i);let E,C;for(E=0,C=m.length;E<C;++E){const{start:P,end:L}=m[E],D=h[P],V=h[L];if(D===V){a.push(D);continue}const U=Math.abs((c-D[n])/(V[n]-D[n])),W=y(D,V,U,i.stepped);W[n]=t[n],a.push(W)}return a.length===1?a[0]:a}pathSegment(t,n,i){return Pk(this)(t,this,n,i)}path(t,n,i){const c=this.segments,h=Pk(this);let m=this._loop;n=n||0,i=i||this.points.length-n;for(const a of c)m&=h(t,this,a,{start:n,end:n+i-1});return!!m}draw(t,n,i,c){const h=this.options||{};(this.points||[]).length&&h.borderWidth&&(t.save(),BIe(t,this,i,c),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function J4(e,t,n,i){const c=e.options,{[n]:h}=e.getProps([n],i);return Math.abs(t-h)<c.radius+c.hitRadius}class zIe extends Th{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,n,i){const c=this.options,{x:h,y:m}=this.getProps(["x","y"],i);return Math.pow(t-h,2)+Math.pow(n-m,2)<Math.pow(c.hitRadius+c.radius,2)}inXRange(t,n){return J4(this,t,"x",n)}inYRange(t,n){return J4(this,t,"y",n)}getCenterPoint(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}size(t){t=t||this.options||{};let n=t.radius||0;n=Math.max(n,n&&t.hoverRadius||0);const i=n&&t.borderWidth||0;return(n+i)*2}draw(t,n){const i=this.options;this.skip||i.radius<.1||!uh(this,n,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Ek(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function dG(e,t){const{x:n,y:i,base:c,width:h,height:m}=e.getProps(["x","y","base","width","height"],t);let a,y,E,C,P;return e.horizontal?(P=m/2,a=Math.min(n,c),y=Math.max(n,c),E=i-P,C=i+P):(P=h/2,a=n-P,y=n+P,E=Math.min(i,c),
4064C=Math.max(i,c)),{left:a,top:E,right:y,bottom:C}}function Nf(e,t,n,i){return e?0:Ls(t,n,i)}function NIe(e,t,n){const i=e.options.borderWidth,c=e.borderSkipped,h=B7(i);return{t:Nf(c.top,h.top,0,n),r:Nf(c.right,h.right,0,t),b:Nf(c.bottom,h.bottom,0,n),l:Nf(c.left,h.left,0,t)}}function VIe(e,t,n){const{enableBorderRadius:i}=e.getProps(["enableBorderRadius"]),c=e.options.borderRadius,h=Mm(c),m=Math.min(t,n),a=e.borderSkipped,y=i||di(c);return{topLeft:Nf(!y||a.top||a.left,h.topLeft,0,m),topRight:Nf(!y||a.top||a.right,h.topRight,0,m),bottomLeft:Nf(!y||a.bottom||a.left,h.bottomLeft,0,m),bottomRight:Nf(!y||a.bottom||a.right,h.bottomRight,0,m)}}function UIe(e){const t=dG(e),n=t.right-t.left,i=t.bottom-t.top,c=NIe(e,n/2,i/2),h=VIe(e,n/2,i/2);return{outer:{x:t.left,y:t.top,w:n,h:i,radius:h},inner:{x:t.left+c.l,y:t.top+c.t,w:n-c.l-c.r,h:i-c.t-c.b,radius:{topLeft:Math.max(0,h.topLeft-Math.max(c.t,c.l)),topRight:Math.max(0,h.topRight-Math.max(c.t,c.r)),bottomLeft:Math.max(0,h.bottomLeft-Math.max(c.b,c.l)),bottomRight:Math.max(0,h.bottomRight-Math.max(c.b,c.r))}}}}function IP(e,t,n,i){const c=t===null,h=n===null,a=e&&!(c&&h)&&dG(e,i);return a&&(c||lh(t,a.left,a.right))&&(h||lh(n,a.top,a.bottom))}function $Ie(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function jIe(e,t){e.rect(t.x,t.y,t.w,t.h)}function PP(e,t,n={}){const i=e.x!==n.x?-t:0,c=e.y!==n.y?-t:0,h=(e.x+e.w!==n.x+n.w?t:0)-i,m=(e.y+e.h!==n.y+n.h?t:0)-c;return{x:e.x+i,y:e.y+c,w:e.w+h,h:e.h+m,radius:e.radius}}class GIe extends Th{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:i,backgroundColor:c}}=this,{inner:h,outer:m}=UIe(this),a=$Ie(m.radius)?hx:jIe;t.save(),(m.w!==h.w||m.h!==h.h)&&(t.beginPath(),a(t,PP(m,n,h)),t.clip(),a(t,PP(h,-n,m)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,PP(h,n)),t.fillStyle=c,t.fill(),t.restore()}inRange(t,n,i){return IP(this,t,n,i)}inXRange(t,n){return IP(this,t,null,n)}inYRange(t,n){return IP(this,null,t,n)}getCenterPoint(t){const{x:n,y:i,base:c,horizontal:h}=this.getProps(["x","y","base","horizontal"],t);return{x:h?(n+c)/2:n,y:h?i:(i+c)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}var HIe=Object.freeze({__proto__:null,ArcElement:IIe,BarElement:GIe,LineElement:a2,PointElement:zIe});const Rk=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],Q4=Rk.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function hG(e){return Rk[e%Rk.length]}function fG(e){return Q4[e%Q4.length]}function WIe(e,t){return e.borderColor=hG(t),e.backgroundColor=fG(t),++t}function qIe(e,t){return e.backgroundColor=e.data.map(()=>hG(t++)),t}function XIe(e,t){return e.backgroundColor=e.data.map(()=>fG(t++)),t}function ZIe(e){let t=0;return(n,i)=>{const c=e.getDatasetMeta(i).controller;c instanceof OL?t=qIe(n,t):c instanceof Q7?t=XIe(n,t):c&&(t=WIe(n,t))}}function eV(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function YIe(e){return e&&(e.borderColor||e.backgroundColor)}function KIe(){return Ro.borderColor!=="rgba(0,0,0,0.1)"||Ro.backgroundColor!=="rgba(0,0,0,0.1)"}var JIe={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:i},options:c}=e.config,{elements:h}=c,m=eV(i)||YIe(c)||h&&eV(h)||KIe();if(!n.forceOverride&&m)return;const a=ZIe(e);i.forEach(a)}};function QIe(e,t,n,i,c){const h=c.samples||i;if(h>=n)return e.slice(t,t+n);const m=[],a=(n-2)/(h-2);let y=0;const E=t+n-1;let C=t,P,L,D,V,U;for(m[y++]=e[C],P=0;P<h-2;P++){let W=0,$=0,Y;const X=Math.floor((P+1)*a)+1+t,K=Math.min(Math.floor((P+2)*a)+1,n)+t,ne=K-X;for(Y=X;Y<K;Y++)W+=e[Y].x,$+=e[Y].y;W/=ne,$/=ne;const fe=Math.floor(P*a)+1+t,ye=Math.min(Math.floor((P+1)*a)+1,n)+t,{x:ke,y:
4064Fe}=e[C];for(D=V=-1,Y=fe;Y<ye;Y++)V=.5*Math.abs((ke-W)*(e[Y].y-Fe)-(ke-e[Y].x)*($-Fe)),V>D&&(D=V,L=e[Y],U=Y);m[y++]=L,C=U}return m[y++]=e[E],m}function ePe(e,t,n,i){let c=0,h=0,m,a,y,E,C,P,L,D,V,U;const W=[],$=t+n-1,Y=e[t].x,K=e[$].x-Y;for(m=t;m<t+n;++m){a=e[m],y=(a.x-Y)/K*i,E=a.y;const ne=y|0;if(ne===C)E<V?(V=E,P=m):E>U&&(U=E,L=m),c=(h*c+a.x)/++h;else{const fe=m-1;if(!oi(P)&&!oi(L)){const ye=Math.min(P,L),ke=Math.max(P,L);ye!==D&&ye!==fe&&W.push({...e[ye],x:c}),ke!==D&&ke!==fe&&W.push({...e[ke],x:c})}m>0&&fe!==D&&W.push(e[fe]),W.push(a),C=ne,h=0,V=U=E,P=L=D=m}}return W}function pG(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function tV(e){e.data.datasets.forEach(t=>{pG(t)})}function tPe(e,t){const n=t.length;let i=0,c;const{iScale:h}=e,{min:m,max:a,minDefined:y,maxDefined:E}=h.getUserBounds();return y&&(i=Ls(ch(t,h.axis,m).lo,0,n-1)),E?c=Ls(ch(t,h.axis,a).hi+1,i,n)-i:c=n-i,{start:i,count:c}}var nPe={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){tV(e);return}const i=e.width;e.data.datasets.forEach((c,h)=>{const{_data:m,indexAxis:a}=c,y=e.getDatasetMeta(h),E=m||c.data;if(wb([a,e.options.indexAxis])==="y"||!y.controller.supportsDecimation)return;const C=e.scales[y.xAxisID];if(C.type!=="linear"&&C.type!=="time"||e.options.parsing)return;let{start:P,count:L}=tPe(y,E);const D=n.threshold||4*i;if(L<=D){pG(c);return}oi(m)&&(c._data=E,delete c.data,Object.defineProperty(c,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(U){this._data=U}}));let V;switch(n.algorithm){case"lttb":V=QIe(E,P,L,i,n);break;case"min-max":V=ePe(E,P,L,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}c._decimated=V})},destroy(e){tV(e)}};function rPe(e,t,n){const i=e.segments,c=e.points,h=t.points,m=[];for(const a of i){let{start:y,end:E}=a;E=l2(y,E,c);const C=kk(n,c[y],c[E],a.loop);if(!t.segments){m.push({source:a,target:C,start:c[y],end:c[E]});continue}const P=X7(t,C);for(const L of P){const D=kk(n,h[L.start],h[L.end],L.loop),V=q7(a,c,D);for(const U of V)m.push({source:U,target:L,start:{[n]:nV(C,D,"start",Math.max)},end:{[n]:nV(C,D,"end",Math.min)}})}}return m}function kk(e,t,n,i){if(i)return;let c=t[e],h=n[e];return e==="angle"&&(c=pa(c),h=pa(h)),{property:e,start:c,end:h}}function iPe(e,t){const{x:n=null,y:i=null}=e||{},c=t.points,h=[];return t.segments.forEach(({start:m,end:a})=>{a=l2(m,a,c);const y=c[m],E=c[a];i!==null?(h.push({x:y.x,y:i}),h.push({x:E.x,y:i})):n!==null&&(h.push({x:n,y:y.y}),h.push({x:n,y:E.y}))}),h}function l2(e,t,n){for(;t>e;t--){const i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function nV(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function mG(e,t){let n=[],i=!1;return vo(e)?(i=!0,n=e):n=iPe(e,t),n.length?new a2({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function rV(e){return e&&e.fill!==!1}function oPe(e,t,n){let c=e[t].fill;const h=[t];let m;if(!n)return c;for(;c!==!1&&h.indexOf(c)===-1;){if(!Wo(c))return c;if(m=e[c],!m)return!1;if(m.visible)return c;h.push(c),c=m.fill}return!1}function sPe(e,t,n){const i=uPe(e);if(di(i))return isNaN(i.value)?!1:i;let c=parseFloat(i);return Wo(c)&&Math.floor(c)===c?aPe(i[0],t,c,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function aPe(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function lPe(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:di(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function cPe(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:di(e)?i=e.value:i=t.getBaseValue(),i}function uPe(e){const t=e.options,n=t.fill;let i=Br(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function dPe(e){const{scale:t,index:n,line:i}=e,c=[],h=i.segments,m=i.points,a=hPe(t,n);a.push(mG({x:null,y:t.bottom},i));for(let y=0;y<h.length;y++){const E=h[y];for(let C=E.start;C<=E.end;C++)fPe(c,m[C],a)}return new a2({points:c,options:{}})}function hPe(e,t){const n=[],i=e.getMatchingVisibleMetas("line");for(let c=0;c<i.length;c++){const h=i[c];if(h.index===t)break;h.hidden||n.unshift(h.dataset)}return n}function fPe(e,t,n){const i=[];for(let c=0;c<n.length;c++){const h=n[c],{first:m,last:a,point:y}=pPe(h,t,"x");if(!(!y||m&&a)){if(m)i.unshift(y);else if(e.push(y),!a)break}}e.push(...i)}function pPe(e,t,n){const i=e.interpolate(t,n);if(!i)return{};const c=i[n],h=e.segments,m=e.points;let a=!1,y=!1;for(let E=0;E<h.length;E++){const C=h[E],P=m[C.start][n],L=m[C.end][n];if(lh(c,P,L)){a=c===P,y=c===L;break}}return{first:a,last:y,point:i}}class gG{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,i){const{x:c,y:h,radius:m}=this;return n=n||{start:0,end:xo},t.arc(c,h,m,n.end,n.start,!0),!i.bounds}interpolate(t){const{x:n,y:i,radius:c}=this,h=t.angle;return{x:n+Math.cos(h)*c,y:i+Math.sin(h)*c,angle:h}}}function mPe(e){const{chart:t,fill:n,line:i}=e;if(Wo(n))return gPe(t,n);if(n==="stack")return dPe(e);if(n==="shape")return!0;const c=_Pe(e);return c instanceof gG?c:mG(c,i)}function gPe(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function _Pe(e){return(e.scale||{}).getPointPositionForValue?vPe(e):yPe(e)}function yPe(e){const{scale:t={},fill:n}=e,i=lPe(n,t);
4064if(Wo(i)){const c=t.isHorizontal();return{x:c?i:null,y:c?null:i}}return null}function vPe(e){const{scale:t,fill:n}=e,i=t.options,c=t.getLabels().length,h=i.reverse?t.max:t.min,m=cPe(n,t,h),a=[];if(i.grid.circular){const y=t.getPointPositionForValue(0,h);return new gG({x:y.x,y:y.y,radius:t.getDistanceFromCenterForValue(m)})}for(let y=0;y<c;++y)a.push(t.getPointPositionForValue(y,m));return a}function RP(e,t,n){const i=mPe(t),{chart:c,index:h,line:m,scale:a,axis:y}=t,E=m.options,C=E.fill,P=E.backgroundColor,{above:L=P,below:D=P}=C||{},V=c.getDatasetMeta(h),U=Z7(c,V);i&&m.points.length&&(r2(e,n),bPe(e,{line:m,target:i,above:L,below:D,area:n,scale:a,axis:y,clip:U}),i2(e))}function bPe(e,t){const{line:n,target:i,above:c,below:h,area:m,scale:a,clip:y}=t,E=n._loop?"angle":t.axis;e.save();let C=h;h!==c&&(E==="x"?(iV(e,i,m.top),kP(e,{line:n,target:i,color:c,scale:a,property:E,clip:y}),e.restore(),e.save(),iV(e,i,m.bottom)):E==="y"&&(oV(e,i,m.left),kP(e,{line:n,target:i,color:h,scale:a,property:E,clip:y}),e.restore(),e.save(),oV(e,i,m.right),C=c)),kP(e,{line:n,target:i,color:C,scale:a,property:E,clip:y}),e.restore()}function iV(e,t,n){const{segments:i,points:c}=t;let h=!0,m=!1;e.beginPath();for(const a of i){const{start:y,end:E}=a,C=c[y],P=c[l2(y,E,c)];h?(e.moveTo(C.x,C.y),h=!1):(e.lineTo(C.x,n),e.lineTo(C.x,C.y)),m=!!t.pathSegment(e,a,{move:m}),m?e.closePath():e.lineTo(P.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function oV(e,t,n){const{segments:i,points:c}=t;let h=!0,m=!1;e.beginPath();for(const a of i){const{start:y,end:E}=a,C=c[y],P=c[l2(y,E,c)];h?(e.moveTo(C.x,C.y),h=!1):(e.lineTo(n,C.y),e.lineTo(C.x,C.y)),m=!!t.pathSegment(e,a,{move:m}),m?e.closePath():e.lineTo(n,P.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function kP(e,t){const{line:n,target:i,property:c,color:h,scale:m,clip:a}=t,y=rPe(n,i,c);for(const{source:E,target:C,start:P,end:L}of y){const{style:{backgroundColor:D=h}={}}=E,V=i!==!0;e.save(),e.fillStyle=D,xPe(e,m,a,V&&kk(c,P,L)),e.beginPath();const U=!!n.pathSegment(e,E);let W;if(V){U?e.closePath():sV(e,i,L,c);const $=!!i.pathSegment(e,C,{move:U,reverse:!0});W=U&&$,W||sV(e,i,P,c)}e.closePath(),e.fill(W?"evenodd":"nonzero"),e.restore()}}function xPe(e,t,n,i){const c=t.chart.chartArea,{property:h,start:m,end:a}=i||{};if(h==="x"||h==="y"){let y,E,C,P;h==="x"?(y=m,E=c.top,C=a,P=c.bottom):(y=c.left,E=m,C=c.right,P=a),e.beginPath(),n&&(y=Math.max(y,n.left),C=Math.min(C,n.right),E=Math.max(E,n.top),P=Math.min(P,n.bottom)),e.rect(y,E,C-y,P-E),e.clip()}}function sV(e,t,n,i){const c=t.interpolate(n,i);c&&e.lineTo(c.x,c.y)}var wPe={id:"filler",afterDatasetsUpdate(e,t,n){const i=(e.data.datasets||[]).length,c=[];let h,m,a,y;for(m=0;m<i;++m)h=e.getDatasetMeta(m),a=h.dataset,y=null,a&&a.options&&a instanceof a2&&(y={visible:e.isDatasetVisible(m),index:m,fill:sPe(a,m,i),chart:e,axis:h.controller.options.indexAxis,scale:h.vScale,line:a}),h.$filler=y,c.push(y);for(m=0;m<i;++m)y=c[m],!(!y||y.fill===!1)&&(y.fill=oPe(c,m,n.propagate))},beforeDraw(e,t,n){const i=n.drawTime==="beforeDraw",c=e.getSortedVisibleDatasetMetas(),h=e.chartArea;for(let m=c.length-1;m>=0;--m){const a=c[m].$filler;a&&(a.line.updateControlPoints(h,a.axis),i&&a.fill&&RP(e.ctx,a,h))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=e.getSortedVisibleDatasetMetas();for(let c=i.length-1;c>=0;--c){const h=i[c].$filler;rV(h)&&RP(e.ctx,h,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!rV(i)||n.drawTime!=="beforeDatasetDraw"||RP(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const aV=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},SPe=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class lV extends Th{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,i){this.maxWidth=t,this.maxHeight=n,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=co(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,c)=>t.sort(i,c,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,c=Ts(i.font),h=c.size,m=this._computeTitleHeight(),{boxWidth:a,itemHeight:y}=aV(i,h);let E,C;n.font=c.string,this.isHorizontal()?(E=this.maxWidth,C=this._fitRows(m,h,a,y)+10):(C=this.maxHeight,E=this._fitCols(m,c,a,y)+10),this.width=Math.min(E,t.maxWidth||this.maxWidth),this.height=Math.min(C,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,c){const{ctx:h,maxWidth:m,options:{labels:{padding:a}}}=this,y=this.legendHitBoxes=[],E=this.lineWidths=[0],C=c+a;let P=t;h.textAlign="left",h.textBaseline="middle";let L=-1,D=-C;
4064return this.legendItems.forEach((V,U)=>{const W=i+n/2+h.measureText(V.text).width;(U===0||E[E.length-1]+W+2*a>m)&&(P+=C,E[E.length-(U>0?0:1)]=0,D+=C,L++),y[U]={left:0,top:D,row:L,width:W,height:c},E[E.length-1]+=W+a}),P}_fitCols(t,n,i,c){const{ctx:h,maxHeight:m,options:{labels:{padding:a}}}=this,y=this.legendHitBoxes=[],E=this.columnSizes=[],C=m-t;let P=a,L=0,D=0,V=0,U=0;return this.legendItems.forEach((W,$)=>{const{itemWidth:Y,itemHeight:X}=TPe(i,n,h,W,c);$>0&&D+X+2*a>C&&(P+=L+a,E.push({width:L,height:D}),V+=L+a,U++,L=D=0),y[$]={left:V,top:D,col:U,width:Y,height:X},L=Math.max(L,Y),D+=X+a}),P+=L,E.push({width:L,height:D}),P}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:c},rtl:h}}=this,m=ty(h,this.left,this.width);if(this.isHorizontal()){let a=0,y=fa(i,this.left+c,this.right-this.lineWidths[a]);for(const E of n)a!==E.row&&(a=E.row,y=fa(i,this.left+c,this.right-this.lineWidths[a])),E.top+=this.top+t+c,E.left=m.leftForLtr(m.x(y),E.width),y+=E.width+c}else{let a=0,y=fa(i,this.top+t+c,this.bottom-this.columnSizes[a].height);for(const E of n)E.col!==a&&(a=E.col,y=fa(i,this.top+t+c,this.bottom-this.columnSizes[a].height)),E.top=y,E.left+=this.left+c,E.left=m.leftForLtr(m.x(E.left),E.width),y+=E.height+c}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;r2(t,this),this._draw(),i2(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:c}=this,{align:h,labels:m}=t,a=Ro.color,y=ty(t.rtl,this.left,this.width),E=Ts(m.font),{padding:C}=m,P=E.size,L=P/2;let D;this.drawTitle(),c.textAlign=y.textAlign("left"),c.textBaseline="middle",c.lineWidth=.5,c.font=E.string;const{boxWidth:V,boxHeight:U,itemHeight:W}=aV(m,P),$=function(fe,ye,ke){if(isNaN(V)||V<=0||isNaN(U)||U<0)return;c.save();const Fe=Br(ke.lineWidth,1);if(c.fillStyle=Br(ke.fillStyle,a),c.lineCap=Br(ke.lineCap,"butt"),c.lineDashOffset=Br(ke.lineDashOffset,0),c.lineJoin=Br(ke.lineJoin,"miter"),c.lineWidth=Fe,c.strokeStyle=Br(ke.strokeStyle,a),c.setLineDash(Br(ke.lineDash,[])),m.usePointStyle){const qe={radius:U*Math.SQRT2/2,pointStyle:ke.pointStyle,rotation:ke.rotation,borderWidth:Fe},lt=y.xPlus(fe,V/2),pt=ye+L;F7(c,qe,lt,pt,m.pointStyleWidth&&V)}else{const qe=ye+Math.max((P-U)/2,0),lt=y.leftForLtr(fe,V),pt=Mm(ke.borderRadius);c.beginPath(),Object.values(pt).some(Qt=>Qt!==0)?hx(c,{x:lt,y:qe,w:V,h:U,radius:pt}):c.rect(lt,qe,V,U),c.fill(),Fe!==0&&c.stroke()}
4064c.restore()},Y=function(fe,ye,ke){Hm(c,ke.text,fe,ye+W/2,E,{strikethrough:ke.hidden,textAlign:y.textAlign(ke.textAlign)})},X=this.isHorizontal(),K=this._computeTitleHeight();X?D={x:fa(h,this.left+C,this.right-i[0]),y:this.top+C+K,line:0}:D={x:this.left+C,y:fa(h,this.top+K+C,this.bottom-n[0].height),line:0},G7(this.ctx,t.textDirection);const ne=W+C;this.legendItems.forEach((fe,ye)=>{c.strokeStyle=fe.fontColor,c.fillStyle=fe.fontColor;const ke=c.measureText(fe.text).width,Fe=y.textAlign(fe.textAlign||(fe.textAlign=m.textAlign)),qe=V+L+ke;let lt=D.x,pt=D.y;y.setWidth(this.width),X?ye>0&<+qe+C>this.right&&(pt=D.y+=ne,D.line++,lt=D.x=fa(h,this.left+C,this.right-i[D.line])):ye>0&&pt+ne>this.bottom&&(lt=D.x=lt+n[D.line].width+C,D.line++,pt=D.y=fa(h,this.top+K+C,this.bottom-n[D.line].height));const Qt=y.x(lt);if($(Qt,pt,fe),lt=OCe(Fe,lt+V+L,X?lt+qe:this.right,t.rtl),Y(y.x(lt),pt,fe),X)D.x+=qe+C;else if(typeof fe.text!="string"){const Ht=E.lineHeight;D.y+=_G(fe,Ht)+C}else D.y+=ne}),H7(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=Ts(n.font),c=ba(n.padding);if(!n.display)return;const h=ty(t.rtl,this.left,this.width),m=this.ctx,a=n.position,y=i.size/2,E=c.top+y;let C,P=this.left,L=this.width;if(this.isHorizontal())L=Math.max(...this.lineWidths),C=this.top+E,P=fa(t.align,P,this.right-L);else{const V=this.columnSizes.reduce((U,W)=>Math.max(U,W.height),0);C=E+fa(t.align,this.top,this.bottom-V-t.labels.padding-this._computeTitleHeight())}const D=fa(a,P,P+L);m.textAlign=h.textAlign(CL(a)),m.textBaseline="middle",m.strokeStyle=n.color,m.fillStyle=n.color,m.font=i.string,Hm(m,n.text,D,C,i)}_computeTitleHeight(){const t=this.options.title,n=Ts(t.font),i=ba(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,c,h;if(lh(t,this.left,this.right)&&lh(n,this.top,this.bottom)){for(h=this.legendHitBoxes,i=0;i<h.length;++i)if(c=h[i],lh(t,c.left,c.left+c.width)&&lh(n,c.top,c.top+c.height))return this.legendItems[i]}return null}handleEvent(t){const n=this.options;if(!APe(t.type,n))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const c=this._hoveredItem,h=SPe(c,i);c&&!h&&co(n.onLeave,[t,c,this],this),this._hoveredItem=i,i&&!h&&co(n.onHover,[t,i,this],this)}else i&&co(n.onClick,[t,i,this],this)}}function TPe(e,t,n,i,c){const h=EPe(i,e,t,n),m=CPe(c,i,t.lineHeight);return{itemWidth:h,itemHeight:m}}function EPe(e,t,n,i){let c=e.text;return c&&typeof c!="string"&&(c=c.reduce((h,m)=>h.length>m.length?h:m)),t+n.size/2+i.measureText(c).width}function CPe(e,t,n){let i=e;return typeof t.text!="string"&&(i=_G(t,n)),i}function _G(e,t){const n=e.text?e.text.length:0;return t*n}function APe(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var IPe={id:"legend",_element:lV,start(e,t,n){const i=e.legend=new lV({ctx:e.ctx,options:n,chart:e});ga.configure(e,i,n),ga.addBox(e,i)},stop(e){ga.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;ga.configure(e,i,n),i.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const i=t.datasetIndex,c=n.chart;c.isDatasetVisible(i)?(c.hide(i),t.hidden=!0):(c.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:c,color:h,useBorderRadius:m,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(y=>{const E=y.controller.getStyle(n?0:void 0),C=ba(E.borderWidth);return{text:t[y.index].label,fillStyle:E.backgroundColor,fontColor:h,hidden:!y.visible,lineCap:E.borderCapStyle,lineDash:E.borderDash,lineDashOffset:E.borderDashOffset,lineJoin:E.borderJoinStyle,lineWidth:(C.width+C.height)/4,strokeStyle:E.borderColor,pointStyle:i||E.pointStyle,rotation:E.rotation,textAlign:c||E.textAlign,borderRadius:m&&(a||E.borderRadius),datasetIndex:y.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}}
4064,descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class FL extends Th{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const c=vo(i.text)?i.text.length:1;this._padding=ba(i.padding);const h=c*Ts(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=h:this.width=h}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:c,right:h,options:m}=this,a=m.align;let y=0,E,C,P;return this.isHorizontal()?(C=fa(a,i,h),P=n+t,E=h-i):(m.position==="left"?(C=i+t,P=fa(a,c,n),y=Ci*-.5):(C=h-t,P=fa(a,n,c),y=Ci*.5),E=c-n),{titleX:C,titleY:P,maxWidth:E,rotation:y}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=Ts(n.font),h=i.lineHeight/2+this._padding.top,{titleX:m,titleY:a,maxWidth:y,rotation:E}=this._drawArgs(h);Hm(t,n.text,0,0,i,{color:n.color,maxWidth:y,rotation:E,textAlign:CL(n.align),textBaseline:"middle",translation:[m,a]})}}function PPe(e,t){const n=new FL({ctx:e.ctx,options:t,chart:e});ga.configure(e,n,t),ga.addBox(e,n),e.titleBlock=n}var RPe={id:"title",_element:FL,start(e,t,n){PPe(e,n)},stop(e){const t=e.titleBlock;ga.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;ga.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const LT=new WeakMap;var kPe={id:"subtitle",start(e,t,n){const i=new FL({ctx:e.ctx,options:n,chart:e});ga.configure(e,i,n),ga.addBox(e,i),LT.set(e,i)},stop(e){ga.removeBox(e,LT.get(e)),LT.delete(e)},beforeUpdate(e,t,n){const i=LT.get(e);ga.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Tb={average(e){if(!e.length)return!1;let t,n,i=new Set,c=0,h=0;for(t=0,n=e.length;t<n;++t){const a=e[t].element;if(a&&a.hasValue()){const y=a.tooltipPosition();i.add(y.x),c+=y.y,++h}}return h===0||i.size===0?!1:{x:[...i].reduce((a,y)=>a+y)/i.size,y:c/h}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,c=Number.POSITIVE_INFINITY,h,m,a;for(h=0,m=e.length;h<m;++h){const y=e[h].element;if(y&&y.hasValue()){const E=y.getCenterPoint(),C=Sk(t,E);C<c&&(c=C,a=y)}}if(a){const y=a.tooltipPosition();n=y.x,i=y.y}return{x:n,y:i}}};function Wu(e,t){return t&&(vo(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Jd(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(` 4065`)>-1?e.split(` 4066`):e}function MPe(e,t){const{element:n,datasetIndex:i,index:c}=t,h=e.getDatasetMeta(i).controller,{label:m,value:a}=h.getLabelAndValue(c);return{chart:e,label:m,parsed:h.getParsed(c),raw:e.data.datasets[i].data[c],formattedValue:a,dataset:h.getDataset(),dataIndex:c,datasetIndex:i,element:n}}function cV(e,t){const n=e.chart.ctx,{body:i,footer:c,title:h}=e,{boxWidth:m,boxHeight:a}=t,y=Ts(t.bodyFont),E=Ts(t.titleFont),C=Ts(t.footerFont),P=h.length,L=c.length,D=i.length,V=ba(t.padding);let U=V.height,W=0,$=i.reduce((K,ne)=>K+ne.before.length+ne.lines.length+ne.after.length,0);if($+=e.beforeBody.length+e.afterBody.length,P&&(U+=P*E.lineHeight+(P-1)*t.titleSpacing+t.titleMarginBottom),$){const K=t.displayColors?Math.max(a,y.lineHeight):y.lineHeight;U+=D*K+($-D)*y.lineHeight+($-1)*t.bodySpacing}L&&(U+=t.footerMarginTop+L*C.lineHeight+(L-1)*t.footerSpacing);let Y=0;const X=function(K){W=Math.max(W,n.measureText(K).width+Y)};return n.save(),n.font=E.string,Hi(e.title,X),n.font=y.string,Hi(e.beforeBody.concat(e.afterBody),X),Y=t.displayColors?m+2+t.boxPadding:0,Hi(i,K=>{Hi(K.before,X),Hi(K.lines,X),Hi(K.after,X)}
4066),Y=0,n.font=C.string,Hi(e.footer,X),n.restore(),W+=V.width,{width:W,height:U}}function LPe(e,t){const{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function OPe(e,t,n,i){const{x:c,width:h}=i,m=n.caretSize+n.caretPadding;if(e==="left"&&c+h+m>t.width||e==="right"&&c-h-m<0)return!0}function DPe(e,t,n,i){const{x:c,width:h}=n,{width:m,chartArea:{left:a,right:y}}=e;let E="center";return i==="center"?E=c<=(a+y)/2?"left":"right":c<=h/2?E="left":c>=m-h/2&&(E="right"),OPe(E,e,t,n)&&(E="center"),E}function uV(e,t,n){const i=n.yAlign||t.yAlign||LPe(e,n);return{xAlign:n.xAlign||t.xAlign||DPe(e,t,n,i),yAlign:i}}function FPe(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function BPe(e,t,n){let{y:i,height:c}=e;return t==="top"?i+=n:t==="bottom"?i-=c+n:i-=c/2,i}function dV(e,t,n,i){const{caretSize:c,caretPadding:h,cornerRadius:m}=e,{xAlign:a,yAlign:y}=n,E=c+h,{topLeft:C,topRight:P,bottomLeft:L,bottomRight:D}=Mm(m);let V=FPe(t,a);const U=BPe(t,y,E);return y==="center"?a==="left"?V+=E:a==="right"&&(V-=E):a==="left"?V-=Math.max(C,L)+c:a==="right"&&(V+=Math.max(P,D)+c),{x:Ls(V,0,i.width-t.width),y:Ls(U,0,i.height-t.height)}}function OT(e,t,n){const i=ba(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function hV(e){return Wu([],Jd(e))}function zPe(e,t,n){return ap(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function fV(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const yG={beforeTitle:Zd,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return n[t.dataIndex]}return""},afterTitle:Zd,beforeBody:Zd,beforeLabel:Zd,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return oi(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Zd,afterBody:Zd,beforeFooter:Zd,footer:Zd,afterFooter:Zd};function nl(e,t,n,i){const c=e[t].call(n,i);return typeof c>"u"?yG[t].call(n,i):c}class pV extends Th{static positioners=Tb;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,i=this.options.setContext(this.getContext()),c=i.enabled&&n.options.animation&&i.animations,h=new Y7(this.chart,c);return c._cacheable&&(this._cachedAnimations=Object.freeze(h)),h}getContext(){return this.$context||(this.$context=zPe(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,c=nl(i,"beforeTitle",this,t),h=nl(i,"title",this,t),m=nl(i,"afterTitle",this,t);let a=[];return a=Wu(a,Jd(c)),a=Wu(a,Jd(h)),a=Wu(a,Jd(m)),a}getBeforeBody(t,n){return hV(nl(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,c=[];return Hi(t,h=>{const m={before:[],lines:[],after:[]},a=fV(i,h);Wu(m.before,Jd(nl(a,"beforeLabel",this,h))),Wu(m.lines,nl(a,"label",this,h)),Wu(m.after,Jd(nl(a,"afterLabel",this,h))),c.push(m)}),c}getAfterBody(t,n){return hV(nl(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,c=nl(i,"beforeFooter",this,t),h=nl(i,"footer",this,t),m=nl(i,"afterFooter",this,t);let a=[];return a=Wu(a,Jd(c)),a=Wu(a,Jd(h)),a=Wu(a,Jd(m)),a}_createItems(t){const n=this._active,i=this.chart.data,c=[],h=[],m=[];let a=[],y,E;for(y=0,E=n.length;y<E;++y)a.push(MPe(this.chart,n[y]));return t.filter&&(a=a.filter((C,P,L)=>
4066t.filter(C,P,L,i))),t.itemSort&&(a=a.sort((C,P)=>t.itemSort(C,P,i))),Hi(a,C=>{const P=fV(t.callbacks,C);c.push(nl(P,"labelColor",this,C)),h.push(nl(P,"labelPointStyle",this,C)),m.push(nl(P,"labelTextColor",this,C))}),this.labelColors=c,this.labelPointStyles=h,this.labelTextColors=m,this.dataPoints=a,a}update(t,n){const i=this.options.setContext(this.getContext()),c=this._active;let h,m=[];if(!c.length)this.opacity!==0&&(h={opacity:0});else{const a=Tb[i.position].call(this,c,this._eventPosition);m=this._createItems(i),this.title=this.getTitle(m,i),this.beforeBody=this.getBeforeBody(m,i),this.body=this.getBody(m,i),this.afterBody=this.getAfterBody(m,i),this.footer=this.getFooter(m,i);const y=this._size=cV(this,i),E=Object.assign({},a,y),C=uV(this.chart,i,E),P=dV(i,E,C,this.chart);this.xAlign=C.xAlign,this.yAlign=C.yAlign,h={opacity:1,x:P.x,y:P.y,width:y.width,height:y.height,caretX:a.x,caretY:a.y}}this._tooltipItems=m,this.$context=void 0,h&&this._resolveAnimations().update(this,h),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,c){const h=this.getCaretPosition(t,i,c);n.lineTo(h.x1,h.y1),n.lineTo(h.x2,h.y2),n.lineTo(h.x3,h.y3)}getCaretPosition(t,n,i){const{xAlign:c,yAlign:h}=this,{caretSize:m,cornerRadius:a}=i,{topLeft:y,topRight:E,bottomLeft:C,bottomRight:P}=Mm(a),{x:L,y:D}=t,{width:V,height:U}=n;let W,$,Y,X,K,ne;return h==="center"?(K=D+U/2,c==="left"?(W=L,$=W-m,X=K+m,ne=K-m):(W=L+V,$=W+m,X=K-m,ne=K+m),Y=W):(c==="left"?$=L+Math.max(y,C)+m:c==="right"?$=L+V-Math.max(E,P)-m:$=this.caretX,h==="top"?(X=D,K=X-m,W=$-m,Y=$+m):(X=D+U,K=X+m,W=$+m,Y=$-m),ne=X),{x1:W,x2:$,x3:Y,y1:X,y2:K,y3:ne}}drawTitle(t,n,i){const c=this.title,h=c.length;let m,a,y;if(h){const E=ty(i.rtl,this.x,this.width);for(t.x=OT(this,i.titleAlign,i),n.textAlign=E.textAlign(i.titleAlign),n.textBaseline="middle",m=Ts(i.titleFont),a=i.titleSpacing,n.fillStyle=i.titleColor,n.font=m.string,y=0;y<h;++y)n.fillText(c[y],E.x(t.x),t.y+m.lineHeight/2),t.y+=m.lineHeight+a,y+1===h&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,n,i,c,h){const m=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:y,boxWidth:E}=h,C=Ts(h.bodyFont),P=OT(this,"left",h),L=c.x(P),D=y<C.lineHeight?(C.lineHeight-y)/2:0,V=n.y+D;if(h.usePointStyle){const U={radius:Math.min(E,y)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},W=c.leftForLtr(L,E)+E/2,$=V+y/2;t.strokeStyle=h.multiKeyBackground,t.fillStyle=h.multiKeyBackground,Ek(t,U,W,$),t.strokeStyle=m.borderColor,t.fillStyle=m.backgroundColor,Ek(t,U,W,$)}else{t.lineWidth=di(m.borderWidth)?Math.max(...Object.values(m.borderWidth)):m.borderWidth||1,t.strokeStyle=m.borderColor,t.setLineDash(m.borderDash||[]),t.lineDashOffset=m.borderDashOffset||0;const U=c.leftForLtr(L,E),W=c.leftForLtr(c.xPlus(L,1),E-2),$=Mm(m.borderRadius);Object.values($).some(Y=>Y!==0)?(t.beginPath(),t.fillStyle=h.multiKeyBackground,hx(t,{x:U,y:V,w:E,h:y,radius:$}),t.fill(),t.stroke(),t.fillStyle=m.backgroundColor,t.beginPath(),hx(t,{x:W,y:V+1,w:E-2,h:y-2,radius:$}),t.fill()):(t.fillStyle=h.multiKeyBackground,t.fillRect(U,V,E,y),t.strokeRect(U,V,E,y),t.fillStyle=m.backgroundColor,t.fillRect(W,V+1,E-2,y-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:c}=this,{bodySpacing:h,bodyAlign:m,displayColors:a,boxHeight:y,boxWidth:E,boxPadding:C}=i,P=Ts(i.bodyFont);let L=P.lineHeight,D=0;const V=ty(i.rtl,this.x,this.width),U=function(ke){n.fillText(ke,V.x(t.x+D),t.y+L/2),t.y+=L+h},W=V.textAlign(m);let $,Y,X,K,ne,fe,ye;
4066for(n.textAlign=m,n.textBaseline="middle",n.font=P.string,t.x=OT(this,W,i),n.fillStyle=i.bodyColor,Hi(this.beforeBody,U),D=a&&W!=="right"?m==="center"?E/2+C:E+2+C:0,K=0,fe=c.length;K<fe;++K){for($=c[K],Y=this.labelTextColors[K],n.fillStyle=Y,Hi($.before,U),X=$.lines,a&&X.length&&(this._drawColorBox(n,t,K,V,i),L=Math.max(P.lineHeight,y)),ne=0,ye=X.length;ne<ye;++ne)U(X[ne]),L=P.lineHeight;Hi($.after,U)}D=0,L=P.lineHeight,Hi(this.afterBody,U),t.y-=h}drawFooter(t,n,i){const c=this.footer,h=c.length;let m,a;if(h){const y=ty(i.rtl,this.x,this.width);for(t.x=OT(this,i.footerAlign,i),t.y+=i.footerMarginTop,n.textAlign=y.textAlign(i.footerAlign),n.textBaseline="middle",m=Ts(i.footerFont),n.fillStyle=i.footerColor,n.font=m.string,a=0;a<h;++a)n.fillText(c[a],y.x(t.x),t.y+m.lineHeight/2),t.y+=m.lineHeight+i.footerSpacing}}drawBackground(t,n,i,c){const{xAlign:h,yAlign:m}=this,{x:a,y}=t,{width:E,height:C}=i,{topLeft:P,topRight:L,bottomLeft:D,bottomRight:V}=Mm(c.cornerRadius);n.fillStyle=c.backgroundColor,n.strokeStyle=c.borderColor,n.lineWidth=c.borderWidth,n.beginPath(),n.moveTo(a+P,y),m==="top"&&this.drawCaret(t,n,i,c),n.lineTo(a+E-L,y),n.quadraticCurveTo(a+E,y,a+E,y+L),m==="center"&&h==="right"&&this.drawCaret(t,n,i,c),n.lineTo(a+E,y+C-V),n.quadraticCurveTo(a+E,y+C,a+E-V,y+C),m==="bottom"&&this.drawCaret(t,n,i,c),n.lineTo(a+D,y+C),n.quadraticCurveTo(a,y+C,a,y+C-D),m==="center"&&h==="left"&&this.drawCaret(t,n,i,c),n.lineTo(a,y+P),n.quadraticCurveTo(a,y,a+P,y),n.closePath(),n.fill(),c.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,c=i&&i.x,h=i&&i.y;if(c||h){const m=Tb[t.position].call(this,this._active,this._eventPosition);if(!m)return;const a=this._size=cV(this,t),y=Object.assign({},m,this._size),E=uV(n,t,y),C=dV(t,y,E,n);(c._to!==C.x||h._to!==C.y)&&(this.xAlign=E.xAlign,this.yAlign=E.yAlign,this.width=a.width,this.height=a.height,this.caretX=m.x,this.caretY=m.y,this._resolveAnimations().update(this,C))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const c={width:this.width,height:this.height},h={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const m=ba(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(h,t,c,n),G7(t,n.textDirection),h.y+=m.top,this.drawTitle(h,t,n),this.drawBody(h,t,n),this.drawFooter(h,t,n),H7(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,c=t.map(({datasetIndex:a,index:y})=>{const E=this.chart.getDatasetMeta(a);if(!E)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:E.data[y],index:y}}),h=!WE(i,c),m=this._positionChanged(c,n);(h||m)&&(this._active=c,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const c=this.options,h=this._active||[],m=this._getActiveElements(t,h,n,i),a=this._positionChanged(m,t),y=n||!WE(m,h)||a;return y&&(this._active=m,(c.enabled||c.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),y}_getActiveElements(t,n,i,c){const h=this.options;if(t.type==="mouseout")return[];if(!c)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const m=this.chart.getElementsAtEventForMode(t,h.mode,h,i);return h.reverse&&m.reverse(),m}_positionChanged(t,n){const{caretX:i,caretY:c,options:h}=this,m=Tb[h.position].call(this,t,n);return m!==!1&&(i!==m.x||c!==m.y)}}var NPe={id:"tooltip",_element:pV,positioners:Tb,afterInit(e,t,n){n&&(e.tooltip=new pV({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>
4066t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:yG},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},VPe=Object.freeze({__proto__:null,Colors:JIe,Decimation:nPe,Filler:wPe,Legend:IPe,SubTitle:kPe,Title:RPe,Tooltip:NPe});const UPe=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function $Pe(e,t,n,i){const c=e.indexOf(t);if(c===-1)return UPe(e,t,n,i);const h=e.lastIndexOf(t);return c!==h?n:c}const jPe=(e,t)=>e===null?null:Ls(Math.round(e),0,t);function mV(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class GPe extends Zm{static id="category";static defaults={ticks:{callback:mV}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const i=this.getLabels();for(const{index:c,label:h}of n)i[c]===h&&i.splice(c,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(oi(t))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:$Pe(i,t,Br(n,t),this._addedLabels),jPe(n,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:i,max:c}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),n||(c=this.getLabels().length-1)),this.min=i,this.max=c}buildTicks(){const t=this.min,n=this.max,i=this.options.offset,c=[];let h=this.getLabels();h=t===0&&n===h.length-1?h:h.slice(t,n+1),this._valueRange=Math.max(h.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let m=t;m<=n;m++)c.push({value:m});return c}getLabelForValue(t){return mV.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function HPe(e,t){const n=[],{bounds:c,step:h,min:m,max:a,precision:y,count:E,maxTicks:C,maxDigits:P,includeBounds:L}=e,D=h||1,V=C-1,{min:U,max:W}=t,$=!oi(m),Y=!oi(a),X=!oi(E),K=(W-U)/(P+1);let ne=c4((W-U)/V/D)*D,fe,ye,ke,Fe;if(ne<1e-14&&!$&&!Y)return[{value:U},{value:W}];Fe=Math.ceil(W/ne)-Math.floor(U/ne),Fe>V&&(ne=c4(Fe*ne/V/D)*D),oi(y)||(fe=Math.pow(10,y),ne=Math.ceil(ne*fe)/fe),c==="ticks"?(ye=Math.floor(U/ne)*ne,ke=Math.ceil(W/ne)*ne):(ye=U,ke=W),$&&Y&&h&&ACe((a-m)/h,ne/1e3)?(Fe=Math.round(Math.min((a-m)/ne,C)),ne=(a-m)/Fe,ye=m,ke=a):X?(ye=$?m:ye,ke=Y?a:ke,Fe=E-1,ne=(ke-ye)/Fe):(Fe=(ke-ye)/ne,$b(Fe,Math.round(Fe),ne/1e3)?Fe=Math.round(Fe):Fe=Math.ceil(Fe));const qe=Math.max(u4(ne),u4(ye));fe=Math.pow(10,oi(y)?qe:y),ye=Math.round(ye*fe)/fe,ke=Math.round(ke*fe)/fe;let lt=0;for($&&(L&&ye!==m?(n.push({value:m}),ye<m&<++,$b(Math.round((ye+lt*ne)*fe)/fe,m,gV(m,K,e))&<++):ye<m&<++);lt<Fe;++lt){const pt=Math.round((ye+lt*ne)*fe)/fe;if(Y&&pt>a)break;n.push({value:pt})}return Y&&L&&ke!==a?n.length&&$b(n[n.length-1].value,a,gV(a,K,e))?n[n.length-1].value=a:n.push({value:a}):(!Y||ke===a)&&n.push({value:ke}),n}function gV(e,t,{horizontal:n,minRotation:i}){const c=Jc(i),h=(n?Math.sin(c):Math.cos(c))||.001,m=.75*t*(""+e).length;return Math.min(t/h,m)}class QE extends Zm{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return oi(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:c,max:h}=this;const m=y=>c=n?c:y,a=y=>h=i?h:y;if(t){const y=rd(c),E=rd(h);y<0&&E<0?a(0):y>0&&E>0&&m(0)}if(c===h){let y=h===0?1:Math.abs(h*.05);a(h+y),t||m(c-y)}this.min=c,this.max=h}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=t,c;return i?(c=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,c>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${c}
4066 ticks. Limiting to 1000.`),c=1e3)):(c=this.computeTickLimit(),n=n||11),n&&(c=Math.min(n,c)),c}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const c={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},h=this._range||this,m=HPe(c,h);return t.bounds==="ticks"&&A7(m,this,"value"),t.reverse?(m.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),m}configure(){const t=this.ticks;let n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const c=(i-n)/Math.max(t.length-1,1)/2;n-=c,i+=c}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return t1(t,this.chart.options.locale,this.options.ticks.format)}}class WPe extends QE{static id="linear";static defaults={ticks:{callback:n2.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Wo(t)?t:0,this.max=Wo(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=Jc(this.options.ticks.minRotation),c=(t?Math.sin(i):Math.cos(i))||.001,h=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,h.lineHeight/c))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const px=e=>Math.floor(Bf(e)),mm=(e,t)=>Math.pow(10,px(e)+t);function _V(e){return e/Math.pow(10,px(e))===1}function yV(e,t,n){const i=Math.pow(10,n),c=Math.floor(e/i);return Math.ceil(t/i)-c}function qPe(e,t){const n=t-e;let i=px(n);for(;yV(e,t,i)>10;)i++;for(;yV(e,t,i)<10;)i--;return Math.min(i,px(e))}function XPe(e,{min:t,max:n}){t=Pl(e.min,t);const i=[],c=px(t);let h=qPe(t,n),m=h<0?Math.pow(10,Math.abs(h)):1;const a=Math.pow(10,h),y=c>h?Math.pow(10,c):0,E=Math.round((t-y)*m)/m,C=Math.floor((t-y)/a/10)*a*10;let P=Math.floor((E-C)/Math.pow(10,h)),L=Pl(e.min,Math.round((y+C+P*Math.pow(10,h))*m)/m);for(;L<n;)i.push({value:L,major:_V(L),significand:P}),P>=10?P=P<15?15:20:P++,P>=20&&(h++,P=2,m=h>=0?1:m),L=Math.round((y+C+P*Math.pow(10,h))*m)/m;const D=Pl(e.max,L);return i.push({value:D,major:_V(D),significand:P}),i}class ZPe extends Zm{static id="logarithmic";static defaults={ticks:{callback:n2.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const i=QE.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return Wo(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Wo(t)?Math.max(0,t):null,this.max=Wo(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Wo(this._userMin)&&(this.min=t===mm(this.min,0)?mm(this.min,-1):mm(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,c=this.max;const h=a=>i=t?i:a,m=a=>c=n?c:a;i===c&&(i<=0?(h(1),m(10)):(h(mm(i,-1)),m(mm(c,1)))),i<=0&&h(mm(c,-1)),c<=0&&m(mm(i,1)),this.min=i,this.max=c}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=XPe(n,this);return t.bounds==="ticks"&&A7(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":t1(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Bf(t),this._valueRange=Bf(this.max)-Bf(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Bf(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}function Mk(e){const t=e.ticks;if(t.display&&e.display){const n=ba(t.backdropPadding);return Br(t.font&&t.font.size,Ro.font.size)+n.height}return 0}function YPe(e,t,n){return n=vo(n)?n:[n],{w:GCe(e,t.string,n),h:n.length*t.lineHeight}}function vV(e,t,n,i,c){return e===i||e===c?{start:t-n/2,end:t+n/2}:e<i||e>c?{start:t-n,end:t}:{start:t,end:t+n}}function KPe(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),i=[],c=[],h=e._pointLabels.length,m=e.options.pointLabels,a=m.centerPointLabels?Ci/h:0;for(let y=0;y<h;y++){const E=m.setContext(e.getPointLabelContext(y));c[y]=E.padding;const C=e.getPointPosition(y,e.drawingArea+c[y],a),P=Ts(E.font),L=YPe(e.ctx,P,e._pointLabels[y]);i[y]=L;const D=pa(e.getIndexAngle(y)+a),V=Math.round(TL(D)),U=vV(V,C.x,L.w,0,180),W=vV(V,C.y,L.h,90,270);JPe(n,t,D,U,W)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=tRe(e,i,c)}function JPe(e,t,n,i,c){const h=Math.abs(Math.sin(n)),m=Math.abs(Math.cos(n));let a=0,y=0;i.start<t.l?(a=(t.l-i.start)/h,e.l=Math.min(e.l,t.l-a)):i.end>
4066t.r&&(a=(i.end-t.r)/h,e.r=Math.max(e.r,t.r+a)),c.start<t.t?(y=(t.t-c.start)/m,e.t=Math.min(e.t,t.t-y)):c.end>t.b&&(y=(c.end-t.b)/m,e.b=Math.max(e.b,t.b+y))}function QPe(e,t,n){const i=e.drawingArea,{extra:c,additionalAngle:h,padding:m,size:a}=n,y=e.getPointPosition(t,i+c+m,h),E=Math.round(TL(pa(y.angle+es))),C=iRe(y.y,a.h,E),P=nRe(E),L=rRe(y.x,a.w,P);return{visible:!0,x:y.x,y:C,textAlign:P,left:L,top:C,right:L+a.w,bottom:C+a.h}}function eRe(e,t){if(!t)return!0;const{left:n,top:i,right:c,bottom:h}=e;return!(uh({x:n,y:i},t)||uh({x:n,y:h},t)||uh({x:c,y:i},t)||uh({x:c,y:h},t))}function tRe(e,t,n){const i=[],c=e._pointLabels.length,h=e.options,{centerPointLabels:m,display:a}=h.pointLabels,y={extra:Mk(h)/2,additionalAngle:m?Ci/c:0};let E;for(let C=0;C<c;C++){y.padding=n[C],y.size=t[C];const P=QPe(e,C,y);i.push(P),a==="auto"&&(P.visible=eRe(P,E),P.visible&&(E=P))}return i}function nRe(e){return e===0||e===180?"center":e<180?"left":"right"}function rRe(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function iRe(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function oRe(e,t,n){const{left:i,top:c,right:h,bottom:m}=n,{backdropColor:a}=t;if(!oi(a)){const y=Mm(t.borderRadius),E=ba(t.backdropPadding);e.fillStyle=a;const C=i-E.left,P=c-E.top,L=h-i+E.width,D=m-c+E.height;Object.values(y).some(V=>V!==0)?(e.beginPath(),hx(e,{x:C,y:P,w:L,h:D,radius:y}),e.fill()):e.fillRect(C,P,L,D)}}function sRe(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let c=t-1;c>=0;c--){const h=e._pointLabelItems[c];if(!h.visible)continue;const m=i.setContext(e.getPointLabelContext(c));oRe(n,m,h);const a=Ts(m.font),{x:y,y:E,textAlign:C}=h;Hm(n,e._pointLabels[c],y,E+a.lineHeight/2,a,{color:m.color,textAlign:C,textBaseline:"middle"})}}function vG(e,t,n,i){const{ctx:c}=e;if(n)c.arc(e.xCenter,e.yCenter,t,0,xo);else{let h=e.getPointPosition(0,t);c.moveTo(h.x,h.y);for(let m=1;m<i;m++)h=e.getPointPosition(m,t),c.lineTo(h.x,h.y)}}function aRe(e,t,n,i,c){const h=e.ctx,m=t.circular,{color:a,lineWidth:y}=t;!m&&!i||!a||!y||n<0||(h.save(),h.strokeStyle=a,h.lineWidth=y,h.setLineDash(c.dash||[]),h.lineDashOffset=c.dashOffset,h.beginPath(),vG(e,n,m,i),h.closePath(),h.stroke(),h.restore())}function lRe(e,t,n){return ap(e,{label:n,index:t,type:"pointLabel"})}class cRe extends QE{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:n2.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=ba(Mk(this.options)/2),n=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(n,i)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=Wo(t)&&!isNaN(t)?t:0,this.max=Wo(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Mk(this.options))}generateTickLabels(t){QE.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,i)=>{const c=co(this.options.pointLabels.callback,[n,i],this);return c||c===0?c:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?KPe(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,c){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-c)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,c))}getIndexAngle(t){const n=xo/(this._pointLabels.length||1),i=this.options.startAngle||0;return pa(t*n+Jc(i))}getDistanceFromCenterForValue(t){if(oi(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(oi(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const i=n[t];return lRe(this.getContext(),t,i)}}getPointPosition(t,n,i=0){const c=this.getIndexAngle(t)-es+i;return{x:Math.cos(c)*n+this.xCenter,y:Math.sin(c)*n+this.yCenter,angle:c}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:i,right:c,bottom:h}=this._pointLabelItems[t];return{left:n,top:i,right:c,bottom:h}}
4066drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),vG(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:i,grid:c,border:h}=n,m=this._pointLabels.length;let a,y,E;if(n.pointLabels.display&&sRe(this,m),c.display&&this.ticks.forEach((C,P)=>{if(P!==0||P===0&&this.min<0){y=this.getDistanceFromCenterForValue(C.value);const L=this.getContext(P),D=c.setContext(L),V=h.setContext(L);aRe(this,D,y,m,V)}}),i.display){for(t.save(),a=m-1;a>=0;a--){const C=i.setContext(this.getPointLabelContext(a)),{color:P,lineWidth:L}=C;!L||!P||(t.lineWidth=L,t.strokeStyle=P,t.setLineDash(C.borderDash),t.lineDashOffset=C.borderDashOffset,y=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),E=this.getPointPosition(a,y),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(E.x,E.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const c=this.getIndexAngle(0);let h,m;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(c),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,y)=>{if(y===0&&this.min>=0&&!n.reverse)return;const E=i.setContext(this.getContext(y)),C=Ts(E.font);if(h=this.getDistanceFromCenterForValue(this.ticks[y].value),E.showLabelBackdrop){t.font=C.string,m=t.measureText(a.label).width,t.fillStyle=E.backdropColor;const P=ba(E.backdropPadding);t.fillRect(-m/2-P.left,-h-C.size/2-P.top,m+P.width,C.size+P.height)}Hm(t,a.label,0,-h,C,{color:E.color,strokeColor:E.textStrokeColor,strokeWidth:E.textStrokeWidth})}),t.restore()}drawTitle(){}}const c2={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},al=Object.keys(c2);function bV(e,t){return e-t}function xV(e,t){if(oi(t))return null;const n=e._adapter,{parser:i,round:c,isoWeekday:h}=e._parseOpts;let m=t;return typeof i=="function"&&(m=i(m)),Wo(m)||(m=typeof i=="string"?n.parse(m,i):n.parse(m)),m===null?null:(c&&(m=c==="week"&&(vy(h)||h===!0)?n.startOf(m,"isoWeek",h):n.startOf(m,c)),+m)}function wV(e,t,n,i){const c=al.length;for(let h=al.indexOf(e);h<c-1;++h){const m=c2[al[h]],a=m.steps?m.steps:Number.MAX_SAFE_INTEGER;if(m.common&&Math.ceil((n-t)/(a*m.size))<=i)return al[h]}return al[c-1]}function uRe(e,t,n,i,c){for(let h=al.length-1;h>=al.indexOf(n);h--){const m=al[h];if(c2[m].common&&e._adapter.diff(c,i,m)>=t-1)return m}return al[n?al.indexOf(n):0]}function dRe(e){for(let t=al.indexOf(e)+1,n=al.length;t<n;++t)if(c2[al[t]].common)return al[t]}function SV(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:i,hi:c}=EL(n,t),h=n[i]>=t?n[i]:n[c];e[h]=!0}}function hRe(e,t,n,i){const c=e._adapter,h=+c.startOf(t[0].value,i),m=t[t.length-1].value;let a,y;for(a=h;a<=m;a=+c.add(a,1,i))y=n[a],y>=0&&(t[y].major=!0);return t}function TV(e,t,n){const i=[],c={},h=t.length;let m,a;for(m=0;m<h;++m)a=t[m],c[a]=m,i.push({value:a,major:!1});return h===0||!n?i:hRe(e,i,c,n)}class Lk extends Zm{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const i=t.time||(t.time={}),c=this._adapter=new fAe._date(t.adapters.date);c.init(n),Ub(i.displayFormats,c.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:xV(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,i=t.time.unit||"day";let{min:c,max:h,minDefined:m,maxDefined:a}=this.getUserBounds();
4066function y(E){!m&&!isNaN(E.min)&&(c=Math.min(c,E.min)),!a&&!isNaN(E.max)&&(h=Math.max(h,E.max))}(!m||!a)&&(y(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&y(this.getMinMax(!1))),c=Wo(c)&&!isNaN(c)?c:+n.startOf(Date.now(),i),h=Wo(h)&&!isNaN(h)?h:+n.endOf(Date.now(),i)+1,this.min=Math.min(c,h-1),this.max=Math.max(c+1,h)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],i=t[t.length-1]),{min:n,max:i}}buildTicks(){const t=this.options,n=t.time,i=t.ticks,c=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&c.length&&(this.min=this._userMin||c[0],this.max=this._userMax||c[c.length-1]);const h=this.min,m=this.max,a=kCe(c,h,m);return this._unit=n.unit||(i.autoSkip?wV(n.minUnit,this.min,this.max,this._getLabelCapacity(h)):uRe(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:dRe(this._unit),this.initOffsets(c),t.reverse&&a.reverse(),TV(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,i=0,c,h;this.options.offset&&t.length&&(c=this.getDecimalForValue(t[0]),t.length===1?n=1-c:n=(this.getDecimalForValue(t[1])-c)/2,h=this.getDecimalForValue(t[t.length-1]),t.length===1?i=h:i=(h-this.getDecimalForValue(t[t.length-2]))/2);const m=t.length<3?.5:.25;n=Ls(n,0,m),i=Ls(i,0,m),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,c=this.options,h=c.time,m=h.unit||wV(h.minUnit,n,i,this._getLabelCapacity(n)),a=Br(c.ticks.stepSize,1),y=m==="week"?h.isoWeekday:!1,E=vy(y)||y===!0,C={};let P=n,L,D;if(E&&(P=+t.startOf(P,"isoWeek",y)),P=+t.startOf(P,E?"day":m),t.diff(i,n,m)>1e5*a)throw new Error(n+" and "+i+" are too far apart with stepSize of "+a+" "+m);const V=c.ticks.source==="data"&&this.getDataTimestamps();for(L=P,D=0;L<i;L=+t.add(L,a,m),D++)SV(C,L,V);return(L===i||c.bounds==="ticks"||D===1)&&SV(C,L,V),Object.keys(C).sort(bV).map(U=>+U)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const c=this.options.time.displayFormats,h=this._unit,m=n||c[h];return this._adapter.format(t,m)}_tickFormatFunction(t,n,i,c){const h=this.options,m=h.ticks.callback;if(m)return co(m,[t,n,i],this);const a=h.time.displayFormats,y=this._unit,E=this._majorUnit,C=y&&a[y],P=E&&a[E],L=i[n],D=E&&P&&L&&L.major;return this._adapter.format(t,c||(D?P:C))}generateTickLabels(t){let n,i,c;for(n=0,i=t.length;n<i;++n)c=t[n],c.label=this._tickFormatFunction(c.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,i=this.ctx.measureText(t).width,c=Jc(this.isHorizontal()?n.maxRotation:n.minRotation),h=Math.cos(c),m=Math.sin(c),a=this._resolveTickFontOptions(0).size;return{w:i*h+a*m,h:i*m+a*h}}_getLabelCapacity(t){const n=this.options.time,i=n.displayFormats,c=i[n.unit]||i.millisecond,h=this._tickFormatFunction(t,0,TV(this,[t],this._majorUnit),c),m=this._getLabelSize(h),a=Math.floor(this.isHorizontal()?this.width/m.w:this.height/m.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;const c=this.getMatchingVisibleMetas();if(this._normalized&&c.length)return this._cache.data=c[0].controller.getAllParsedValues(this);for(n=0,i=c.length;n<i;++n)t=t.concat(c[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,i;if(t.length)return t;const c=this.getLabels();for(n=0,i=c.length;n<i;++n)t.push(xV(this,c[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return R7(t.sort(bV))}}function DT(e,t,n){let i=0,c=e.length-1,h,m,a,y;n?(t>=e[i].pos&&t<=e[c].pos&&({lo:i,hi:c}=ch(e,"pos",t)),{pos:h,time:a}=e[i],{pos:m,time:y}=e[c]):(t>=e[i].time&&t<=e[c].time&&({lo:i,hi:c}=ch(e,"time",t)),{time:h,pos:a}=e[i],{time:m,pos:y}=e[c]);const E=m-h;return E?a+(y-a)*(t-h)/E:a}class fRe extends Lk{static id="timeseries";static defaults=Lk.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=DT(n,this.min),this._tableRange=DT(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,c=[],h=[];let m,a,y,E,C;for(m=0,a=t.length;m<a;++m)E=t[m],E>=n&&E<=i&&c.push(E);if(c.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(m=0,a=c.length;m<a;++m)C=c[m+1],y=c[m-1],E=c[m],Math.round((C+y)/2)!==E&&h.push({time:E,pos:m/(a-1)});return h}_generate(){const t=this.min,n=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(n)||i.length===1)&&i.push(n),i.sort((c,h)=>c-h)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return(DT(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return DT(this._table,i*this._tableRange+this._minPos,!0)}}var pRe=Object.freeze({__proto__:null,CategoryScale:GPe,LinearScale:WPe,LogarithmicScale:ZPe,RadialLinearScale:cRe,TimeScale:Lk,TimeSeriesScale:fRe});const mRe=[hAe,HIe,VPe,pRe],gRe=Ji(()=>{Ik.register(...mRe);try{const e=getComputedStyle(document.documentElement).getPropertyValue("--font-sans").trim()||getComputedStyle(document.body).fontFamily;e&&(Ik.defaults.font.family=e)}catch{}});class _Re{levels;levelIndex;constructor(t="info"){this.levels=["debug","info","warn","error"],this.levelIndex=this.levels.indexOf(t.toLowerCase())}log(t,...n){const i=this.levels.indexOf(t.toLowerCase());i>=this.levelIndex&&(i>=2?console[t](...n):console.log(...n))}debug(...t){this.log("debug",...t)}info(...t){this.log("info",...t)}warn(...t){this.log("warn",...t)}error(...t){this.log("error",...t)}}const yRe=Ji(()=>{const t=Dl().public.LOG_LEVEL||"info";return{provide:{logger:new _Re(t)}}}),vRe=Ji({name:"no-index",setup(){if(Dl().public.ENVIRONMENT!=="production"){Cy({meta:[{name:"robots",content:"noindex, nofollow",tagPriority:1}]});return}}}),bRe=Ji(e=>{const t=e.vueApp.config.globalProperties.$primevue?.config?.locale;if(!t)return;const n=e.$i18n;qr(()=>n.locale.value,()=>Object.assign(t,{apply:n.t("primevue.apply"),clear:n.t("primevue.clear")}),{immediate:!0})}),xRe=Ji({name:"i18n:plugin:ssg-detect",dependsOn:["i18n:plugin","i18n:plugin:route-locale-detect"],enforce:"post",setup(e){}}),wRe=[cQ,dQ,gQ,ose,sse,ase,lse,cse,use,Ele,Cle,Rle,Fle,rhe,Qpe,eme,tme,ome,HSe,WSe,qSe,XSe,qEe,gRe,yRe,vRe,bRe,xRe],bG=(e="RouteProvider")=>Ys({name:e,props:{route:{type:Object,required:!0},vnode:Object,vnodeRef:Object,renderKey:String,trackRootNodes:Boolean},setup(t){const n=t.renderKey,i=t.route,c={};for(const h in t.route)Object.defineProperty(c,h,{get:()=>n===t.renderKey?t.route[h]:i[h],enumerable:!0});return fh(zm,Zc(c)),()=>t.vnode?Io(t.vnode,{ref:t.vnodeRef}):t.vnode}}),SRe=bG(),EV=new WeakMap,TRe=Ys({name:"NuxtPage",inheritAttrs:!1,props:{name:{type:String},transition:{type:[Boolean,Object],default:void 0},keepalive:{type:[Boolean,Object],default:void 0},route:{type:Object},pageKey:{type:[Function,String],default:null}},setup(e,{attrs:t,slots:n,expose:i}){const c=rr(),h=hn(),m=wo(zm,null);let a;i({pageRef:h});const y=wo(j$,null);let E;const C=c.deferHydration();let P=!1,L=!1,D=0;if(c.isHydrating){const U=c.hooks.hookOnce("app:error",C),W=ps().beforeEach(()=>{U(),W()})}e.pageKey&&qr(()=>e.pageKey,(U,W)=>{U!==W&&c.callHook("page:loading:start")});let V=!1;{const U=ps().beforeResolve(()=>{V=!1});Ty(()=>{U(),C()})}return()=>Io(C6,{name:e.name,route:e.route,...t},{default:U=>{const W=ERe(m,U.route,U.Component),$=m&&m.matched.length===U.route.matched.length;if(!U.Component){if(E&&!$&&!MP(E))return E;C();return}if(E&&y&&!MP(E)&&!y.isCurrent(U.route))return E;if(W&&m&&(!y||y?.isCurrent(m)))return($||E)&&!MP(E)?E:null;const Y=yR(U,e.pageKey),X=CRe(m,U.route,U.Component);!c.isHydrating&&a===Y&&!X&&ts(()=>{V||(V=!0,c.callHook("page:loading:end"))}),P&&a!==Y&&L&&D++,a=Y;const K=!!(e.transition??U.route.meta.pageTransition??f3),ne=K&&R6([e.transition,U.route.meta.pageTransition,f3,{onAfterLeave(){c["~transitionFinish"]?.(),delete c["~transitionFinish"],delete c["~transitionPromise"],c.callHook("page:transition:finish",U.Component)}}]),fe=e.keepalive??U.route.meta.keepalive??GK;return E=P6(K&&ne,Eee(fe,Io(gM,{key:D,suspensible:!0,onPending:()=>{P=!0,K&&!c["~transitionPromise"]&&(c["~transitionPromise"]=new Promise(ye=>{c["~transitionFinish"]=ye})),c.callHook("page:start",U.Component)}
4066,onResolve:async()=>{P=!1,L=!0;try{await ts(),c._route.sync?.(),await c.callHook("page:finish",U.Component),!V&&!X&&(V=!0,await c.callHook("page:loading:end"))}finally{C()}}},{default:()=>{const ye={key:Y||void 0,vnode:n.default?ARe(n.default,U):U.Component,route:U.route,renderKey:Y||void 0,trackRootNodes:K,vnodeRef:h};if(!fe)return Io(SRe,ye);const ke=U.Component.type,Fe=ke;let qe=EV.get(Fe);return qe||(qe=bG(ke.name||ke.__name),EV.set(Fe,qe)),Io(qe,ye)}}))).default(),E}})}});function ERe(e,t,n){if(!e)return!1;const i=t.matched.findIndex(m=>m.components?.default===n?.type);if(i===-1)return!1;const c=t.matched.slice(0,i).filter(m=>m.components?.default);if(!c.length)return!1;const h=e.matched.filter(m=>m.components?.default);return c.some((m,a)=>m.components?.default!==h[a]?.components?.default)||n&&yR({route:t,Component:n})!==yR({route:e,Component:n})}function CRe(e,t,n){return e?t.matched.findIndex(c=>c.components?.default===n?.type)<t.matched.length-1:!1}function ARe(e,t){const n=e(t);return n.length===1?Io(n[0]):Io(jo,void 0,n)}function MP(e){return!!e&&(!!e.suspense?.isUnmounted||!!e.component?.isUnmounted)}const xG=l6,IRe=Ys({name:"LayoutLoader",inheritAttrs:!1,props:{name:String,layoutProps:Object},setup(e,t){return()=>Io(Of[e.name],e.layoutProps,t.slots)}}),PRe={name:{type:[String,Boolean,Object],default:null},fallback:{type:[String,Object],default:null}},RRe=Ys({name:"NuxtLayout",inheritAttrs:!1,props:PRe,setup(e,t){const n=rr(),i=wo(zm),h=!i||i===wM()?p6():i,m=vn(()=>{let C=Ar(e.name)??h?.meta.layout??xG(h?.path).appLayout??"default";return C&&!(C in Of)&&e.fallback&&(C=Ar(e.fallback)),C}),a=Vi();t.expose({layoutRef:a});const y=n.deferHydration();if(n.isHydrating){const C=n.hooks.hookOnce("app:error",y),P=ps().beforeEach(()=>{C(),P()})}let E;return()=>{const P=!!m.value&&m.value in Of&&!!(h?.meta.layoutTransition??h3),L=P&&R6([h?.meta.layoutTransition,h3,{onBeforeLeave(){n["~transitionPromise"]=new Promise(V=>{n["~transitionFinish"]=V})},onAfterLeave(){n["~transitionFinish"]?.(),delete n["~transitionFinish"],delete n["~transitionPromise"]}}]),D=E;return E=m.value,P6(L,{default:()=>Io(gM,{suspensible:!0,onResolve:async()=>{await ts(y)}},{default:()=>Io(kRe,{layoutProps:zo(t.attrs,h.meta.layoutProps??{},{ref:a}),key:m.value||void 0,name:m.value,shouldProvide:!e.name,isRenderingNewLayout:V=>V!==D&&V===m.value,hasTransition:P},t.slots)})}).default()}}}),kRe=Ys({name:"NuxtLayoutProvider",inheritAttrs:!1,props:{name:{type:[String,Boolean]},layoutProps:{type:Object},hasTransition:{type:Boolean},shouldProvide:{type:Boolean},isRenderingNewLayout:{type:Function,required:!0}},setup(e,t){const n=e.name;e.shouldProvide&&fh(j$,{isCurrent:h=>n===!1||n===(h.meta.layout??xG(h.path).appLayout??"default")});const i=wo(zm);if(i&&i===wM()){const h=p6(),m={};for(const a in h){const y=a;Object.defineProperty(m,y,{enumerable:!0,get:()=>e.isRenderingNewLayout(e.name)?h[y]:i[y]})}fh(zm,Zc(m))}return()=>!n||typeof n=="string"&&!(n in Of)?t.slots.default?.():Io(IRe,{key:n,layoutProps:e.layoutProps,name:n},t.slots)}});var wG={name:"Portal",props:{appendTo:{type:[String,Object],default:"body"},disabled:{type:Boolean,default:!1}},data:function(){return{mounted:!1}},mounted:function(){this.mounted=U9()},computed:{inline:function(){return this.disabled||this.appendTo==="self"}}};function MRe(e,t,n,i,c,h){return h.inline?OB(e.$slots,"default",{key:0}):c.mounted?(ei(),Ss(kU,{key:1,to:n.appendTo},[OB(e.$slots,"default")],8,["to"])):Zf("",!0)}wG.render=MRe;var Mf={_loadedStyleNames:new Set,getLoadedStyleNames:function(){return this._loadedStyleNames},isStyleNameLoaded:function(t){return this._loadedStyleNames.has(t)},setLoadedStyleName:function(t){this._loadedStyleNames.add(t)},deleteLoadedStyleName:function(t){this._loadedStyleNames.delete(t)},clearLoadedStyleNames:function(){this._loadedStyleNames.clear()}};function LRe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"pc",t=nZ();return"".concat(e).concat(t.replace("v-","").replaceAll("-","_"))}var CV=Vo.extend({name:"common"});function mx(e){"@babel/helpers - typeof";return mx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mx(e)}function ORe(e){return EG(e)||DRe(e)||TG(e)||SG()}function DRe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function db(e,t){return EG(e)||FRe(e,t)||TG(e,t)||SG()}
4066function SG(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 4067In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TG(e,t){if(e){if(typeof e=="string")return Ok(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ok(e,t):void 0}}function Ok(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function FRe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var i,c,h,m,a=[],y=!0,E=!1;try{if(h=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;y=!1}else for(;!(y=(i=h.call(n)).done)&&(a.push(i.value),a.length!==t);y=!0);}catch(C){E=!0,c=C}finally{try{if(!y&&n.return!=null&&(m=n.return(),Object(m)!==m))return}finally{if(E)throw c}}return a}}function EG(e){if(Array.isArray(e))return e}function AV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(c){return Object.getOwnPropertyDescriptor(e,c).enumerable})),n.push.apply(n,i)}return n}function li(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AV(Object(n),!0).forEach(function(i){Eb(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AV(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Eb(e,t,n){return(t=BRe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BRe(e){var t=zRe(e,"string");return mx(t)=="symbol"?t:t+""}function zRe(e,t){if(mx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t);if(mx(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var BL={name:"BaseComponent",props:{pt:{type:Object,default:void 0},ptOptions:{type:Object,default:void 0},unstyled:{type:Boolean,default:void 0},dt:{type:Object,default:void 0}},inject:{$parentInstance:{default:void 0}},watch:{isUnstyled:{immediate:!0,handler:function(t){js.off("theme:change",this._loadCoreStyles),t||(this._loadCoreStyles(),this._themeChangeListener(this._loadCoreStyles))}},dt:{immediate:!0,handler:function(t,n){var i=this;js.off("theme:change",this._themeScopedListener),t?(this._loadScopedThemeStyles(t),this._themeScopedListener=function(){return i._loadScopedThemeStyles(t)},this._themeChangeListener(this._themeScopedListener)):this._unloadScopedThemeStyles()}}},scopedStyleEl:void 0,rootEl:void 0,uid:void 0,$attrSelector:void 0,beforeCreate:function(){var t,n,i,c,h,m,a,y,E,C,P,L=(t=this.pt)===null||t===void 0?void 0:t._usept,D=L?(n=this.pt)===null||n===void 0||(n=n.originalValue)===null||n===void 0?void 0:n[this.$.type.name]:void 0,V=L?(i=this.pt)===null||i===void 0||(i=i.value)===null||i===void 0?void 0:i[this.$.type.name]:this.pt;(c=V||D)===null||c===void 0||(c=c.hooks)===null||c===void 0||(h=c.onBeforeCreate)===null||h===void 0||h.call(c);var U=(m=this.$primevueConfig)===null||m===void 0||(m=m.pt)===null||m===void 0?void 0:m._usept,W=U?(a=this.$primevue)===null||a===void 0||(a=a.config)===null||a===void 0||(a=a.pt)===null||a===void 0?void 0:a.originalValue:void 0,$=U?(y=this.$primevue)===null||y===void 0||(y=y.config)===null||y===void 0||(y=y.pt)===null||y===void 0?void 0:y.value:(E=this.$primevue)===null||E===void 0||(E=E.config)===null||E===void 0?void 0:E.pt;(C=$||W)===null||C===void 0||(C=C[this.$.type.name])===null||C===void 0||(C=C.hooks)===null||C===void 0||(P=C.onBeforeCreate)===null||P===void 0||P.call(C),this.$attrSelector=LRe(),this.uid=this.$attrs.id||this.$attrSelector.replace("pc","pv_id_")},created:function(){this._hook("onCreated")},beforeMount:function(){var t;this.rootEl=F9(sp(this.$el)?this.$el:(t=this.$el)===null||t===void 0?void 0:t.parentElement,"[".concat(this.$attrSelector,"]")),this.rootEl&&(this.rootEl.$pc=li({name:this.$.type.n
4067ame,attrSelector:this.$attrSelector},this.$params)),this._loadStyles(),this._hook("onBeforeMount")},mounted:function(){this._hook("onMounted")},beforeUpdate:function(){this._hook("onBeforeUpdate")},updated:function(){this._hook("onUpdated")},beforeUnmount:function(){this._hook("onBeforeUnmount")},unmounted:function(){this._removeThemeListeners(),this._unloadScopedThemeStyles(),this._hook("onUnmounted")},methods:{_hook:function(t){if(!this.$options.hostName){var n=this._usePT(this._getPT(this.pt,this.$.type.name),this._getOptionValue,"hooks.".concat(t)),i=this._useDefaultPT(this._getOptionValue,"hooks.".concat(t));n?.(),i?.()}},_mergeProps:function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),c=1;c<n;c++)i[c-1]=arguments[c];return JC(t)?t.apply(void 0,i):zo.apply(void 0,i)},_load:function(){Mf.isStyleNameLoaded("base")||(Vo.loadCSS(this.$styleOptions),this._loadGlobalStyles(),Mf.setLoadedStyleName("base")),this._loadThemeStyles()},_loadStyles:function(){this._load(),this._themeChangeListener(this._load)},_loadCoreStyles:function(){var t,n;!Mf.isStyleNameLoaded((t=this.$style)===null||t===void 0?void 0:t.name)&&(n=this.$style)!==null&&n!==void 0&&n.name&&(CV.loadCSS(this.$styleOptions),this.$options.style&&this.$style.loadCSS(this.$styleOptions),Mf.setLoadedStyleName(this.$style.name))},_loadGlobalStyles:function(){var t=this._useGlobalPT(this._getOptionValue,"global.css",this.$params);Qi(t)&&Vo.load(t,li({name:"global"},this.$styleOptions))},_loadThemeStyles:function(){var t,n;if(!(this.isUnstyled||this.$theme==="none")){if(!Wi.isStyleNameLoaded("common")){var i,c,h=((i=this.$style)===null||i===void 0||(c=i.getCommonTheme)===null||c===void 0?void 0:c.call(i))||{},m=h.primitive,a=h.semantic,y=h.global,E=h.style;Vo.load(m?.css,li({name:"primitive-variables"},this.$styleOptions)),Vo.load(a?.css,li({name:"semantic-variables"},this.$styleOptions)),Vo.load(y?.css,li({name:"global-variables"},this.$styleOptions)),Vo.loadStyle(li({name:"global-style"},this.$styleOptions),E),Wi.setLoadedStyleName("common")}if(!Wi.isStyleNameLoaded((t=this.$style)===null||t===void 0?void 0:t.name)&&(n=this.$style)!==null&&n!==void 0&&n.name){var C,P,L,D,V=((C=this.$style)===null||C===void 0||(P=C.getComponentTheme)===null||P===void 0?void 0:P.call(C))||{},U=V.css,W=V.style;(L=this.$style)===null||L===void 0||L.load(U,li({name:"".concat(this.$style.name,"-variables")},this.$styleOptions)),(D=this.$style)===null||D===void 0||D.loadStyle(li({name:"".concat(this.$style.name,"-style")},this.$styleOptions),W),Wi.setLoadedStyleName(this.$style.name)}if(!Wi.isStyleNameLoaded("layer-order")){var $,Y,X=($=this.$style)===null||$===void 0||(Y=$.getLayerOrderThemeCSS)===null||Y===void 0?void 0:Y.call($);Vo.load(X,li({name:"layer-order",first:!0},this.$styleOptions)),Wi.setLoadedStyleName("layer-order")}}},_loadScopedThemeStyles:function(t){var n,i,c,h=((n=this.$style)===null||n===void 0||(i=n.getPresetTheme)===null||i===void 0?void 0:i.call(n,t,"[".concat(this.$attrSelector,"]")))||{},m=h.css,a=(c=this.$style)===null||c===void 0?void 0:c.load(m,li({name:"".concat(this.$attrSelector,"-").concat(this.$style.name)},this.$styleOptions));this.scopedStyleEl=a.el},_unloadScopedThemeStyles:function(){var t;(t=this.scopedStyleEl)===null||t===void 0||(t=t.value)===null||t===void 0||t.remove()},_themeChangeListener:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){};Mf.clearLoadedStyleNames(),js.on("theme:change",t)},_removeThemeListeners:function(){js.off("theme:change",this._loadCoreStyles),js.off("theme:change",this._load),js.off("theme:change",this._themeScopedListener)},_getHostInstance:function(t){return t?this.$options.hostName?t.$.type.name===this.$options.hostName?t:this._getHostInstance(t.$parentInstance):t.$parentInstance:void 0},_getPropValue:function(t){var n;return this[t]||((n=this._getHostInstance(this))===null||n===void 0?void 0:n[t])},_getOptionValue:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return lL(t,n,i)},_getPTValue:function(){var t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,m=/./g.test(i)&&!!c[i.split(".")[0]],a=this._getPropValue("ptOptions")||((t=this.$primevueConfig)===null||t===void 0?void 0:t.ptOptions)||{},y=a.mergeSections,E=y===void 0?!0:y,C=a.mergeProps,P=C===void 0?!1:C,L=h?m?this._useGlobalPT(this._getPTClassValue,i,c):this._useDefaultPT(this._getPTClassValue,i,c):void 0,D=m?void 0:this._getPTSelf(n,this._getPTClassValue,i,li(li({},c),{},{global:L||{}})),V=this._getPTDatasets(i);return E||!E&&D?P?this._mergeProps(P,L,D,V):li(li(li({},L),D),V):li(li({},D),V)},_getPTSelf:function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length,i=new Array(n>1?n-1:0),c=1;c<n;c++)i[c-1]=arguments[c];return zo(this._usePT.apply(this,[this._getPT(t,this.$name)].concat(i)),this._usePT.apply(this,[this.$_attrsPT].concat(i)))},_getPTDatasets:function(){var t,n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",c="data-pc-",h=i==="root"&&Qi((t=this.pt)===null||t===void 0?void 0:t["data-pc-section"]);return i!=="transition"&&li(li({},i==="root"&&li(li(Eb({},"".concat(c,"name"),Ju(h?(n=this.pt)===null||n===void 0?void 0:n["data-pc-section"]:this.$.type.n
4067ame)),h&&Eb({},"".concat(c,"extend"),Ju(this.$.type.name))),{},Eb({},"".concat(this.$attrSelector),""))),{},Eb({},"".concat(c,"section"),Ju(i)))},_getPTClassValue:function(){var t=this._getOptionValue.apply(this,arguments);return cl(t)||M9(t)?{class:t}:t},_getPT:function(t){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",c=arguments.length>2?arguments[2]:void 0,h=function(a){var y,E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,C=c?c(a):a,P=Ju(i),L=Ju(n.$name);return(y=E?P!==L?C?.[P]:void 0:C?.[P])!==null&&y!==void 0?y:C};return t!=null&&t.hasOwnProperty("_usept")?{_usept:t._usept,originalValue:h(t.originalValue),value:h(t.value)}:h(t,!0)},_usePT:function(t,n,i,c){var h=function(U){return n(U,i,c)};if(t!=null&&t.hasOwnProperty("_usept")){var m,a=t._usept||((m=this.$primevueConfig)===null||m===void 0?void 0:m.ptOptions)||{},y=a.mergeSections,E=y===void 0?!0:y,C=a.mergeProps,P=C===void 0?!1:C,L=h(t.originalValue),D=h(t.value);return L===void 0&&D===void 0?void 0:cl(D)?D:cl(L)?L:E||!E&&D?P?this._mergeProps(P,L,D):li(li({},L),D):D}return h(t)},_useGlobalPT:function(t,n,i){return this._usePT(this.globalPT,t,n,i)},_useDefaultPT:function(t,n,i){return this._usePT(this.defaultPT,t,n,i)},ptm:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this._getPTValue(this.pt,t,li(li({},this.$params),n))},ptmi:function(){var t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=zo(this.$_attrsWithoutPT,this.ptm(n,i));return c?.hasOwnProperty("id")&&((t=c.id)!==null&&t!==void 0||(c.id=this.$id)),c},ptmo:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._getPTValue(t,n,li({instance:this},i),!1)},cx:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.isUnstyled?void 0:this._getOptionValue(this.$style.classes,t,li(li({},this.$params),n))},sx:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(n){var c=this._getOptionValue(this.$style.inlineStyles,t,li(li({},this.$params),i)),h=this._getOptionValue(CV.inlineStyles,t,li(li({},this.$params),i));return[h,c]}}},computed:{globalPT:function(){var t,n=this;return this._getPT((t=this.$primevueConfig)===null||t===void 0?void 0:t.pt,void 0,function(i){return kl(i,{instance:n})})},defaultPT:function(){var t,n=this;return this._getPT((t=this.$primevueConfig)===null||t===void 0?void 0:t.pt,void 0,function(i){return n._getOptionValue(i,n.$name,li({},n.$params))||kl(i,li({},n.$params))})},isUnstyled:function(){var t;return this.unstyled!==void 0?this.unstyled:(t=this.$primevueConfig)===null||t===void 0?void 0:t.unstyled},$id:function(){return this.$attrs.id||this.uid},$inProps:function(){var t,n=Object.keys(((t=this.$.vnode)===null||t===void 0?void 0:t.props)||{});return Object.fromEntries(Object.entries(this.$props).filter(function(i){var c=db(i,1),h=c[0];return n?.includes(h)}))},$theme:function(){var t;return(t=this.$primevueConfig)===null||t===void 0?void 0:t.theme},$style:function(){return li(li({classes:void 0,inlineStyles:void 0,load:function(){},loadCSS:function(){},loadStyle:function(){}},(this._getHostInstance(this)||{}).$style),this.$options.style)},$styleOptions:function(){var t;return{nonce:(t=this.$primevueConfig)===null||t===void 0||(t=t.csp)===null||t===void 0?void 0:t.nonce}},$primevueConfig:function(){var t;return(t=this.$primevue)===null||t===void 0?void 0:t.config},$name:function(){return this.$options.hostName||this.$.type.name},$params:function(){var t=this._getHostInstance(this)||this.$parent;return{instance:this,props:this.$props,state:this.$data,attrs:this.$attrs,parent:{instance:t,props:t?.$props,state:t?.$data,attrs:t?.$attrs}}},$_attrsPT:function(){return Object.entries(this.$attrs||{}).filter(function(t){var n=db(t,1),i=n[0];return i?.startsWith("pt:")}).reduce(function(t,n){var i=db(n,2),c=i[0],h=i[1],m=c.split(":"),a=ORe(m),y=Ok(a).slice(1);return y?.reduce(function(E,C,P,L){return!E[C]&&(E[C]=P===L.length-1?h:{}),E[C]},t),t},{})},$_attrsWithoutPT:function(){return Object.entries(this.$attrs||{}).filter(function(t){var n=db(t,1),i=n[0];return!(i!=null&&i.startsWith("pt:"))}).reduce(function(t,n){var i=db(n,2),c=i[0],h=i[1];return t[c]=h,t},{})}}},NRe=` 4068 .p-toast { 4069 width: dt('toast.width'); 4070 white-space: pre-line; 4071 word-break: break-word; 4072 } 4073 4074 .p-toast-message { 4075 margin: 0 0 1rem 0; 4076 display: grid; 4077 grid-template-rows: 1fr; 4078 } 4079 4080 .p-toast-message-icon { 4081 flex-shrink: 0; 4082 font-size: dt('toast.icon.size'); 4083 width: dt('toast.icon.size'); 4084 height: dt('toast.icon.size'); 4085 } 4086 4087 .p-toast-message-content { 4088 display: flex; 4089 align-items: flex-start; 4090 padding: dt('toast.content.padding'); 4091 gap: dt('toast.content.gap'); 4092 min-height: 0; 4093 overflow: hidden;
4094 transition: padding 250ms ease-in; 4095 } 4096 4097 .p-toast-message-text { 4098 flex: 1 1 auto; 4099 display: flex; 4100 flex-direction: column; 4101 gap: dt('toast.text.gap'); 4102 } 4103 4104 .p-toast-summary { 4105 font-weight: dt('toast.summary.font.weight'); 4106 font-size: dt('toast.summary.font.size'); 4107 } 4108 4109 .p-toast-detail { 4110 font-weight: dt('toast.detail.font.weight'); 4111 font-size: dt('toast.detail.font.size'); 4112 } 4113 4114 .p-toast-close-button { 4115 display: flex; 4116 align-items: center; 4117 justify-content: center; 4118 overflow: hidden; 4119 position: relative; 4120 cursor: pointer; 4121 background: transparent; 4122 transition: 4123 background dt('toast.transition.duration'), 4124 color dt('toast.transition.duration'), 4125 outline-color dt('toast.transition.duration'), 4126 box-shadow dt('toast.transition.duration'); 4127 outline-color: transparent; 4128 color: inherit; 4129 width: dt('toast.close.button.width'); 4130 height: dt('toast.close.button.height'); 4131 border-radius: dt('toast.close.button.border.radius'); 4132 margin: -25% 0 0 0; 4133 right: -25%; 4134 padding: 0; 4135 border: none; 4136 user-select: none; 4137 } 4138 4139 .p-toast-close-button:dir(rtl) { 4140 margin: -25% 0 0 auto; 4141 left: -25%; 4142 right: auto; 4143 } 4144 4145 .p-toast-message-info, 4146 .p-toast-message-success, 4147 .p-toast-message-warn, 4148 .p-toast-message-error, 4149 .p-toast-message-secondary, 4150 .p-toast-message-contrast { 4151 border-width: dt('toast.border.width'); 4152 border-style: solid; 4153 backdrop-filter: blur(dt('toast.blur')); 4154 border-radius: dt('toast.border.radius'); 4155 } 4156 4157 .p-toast-close-icon { 4158 font-size: dt('toast.close.icon.size'); 4159 width: dt('toast.close.icon.size'); 4160 height: dt('toast.close.icon.size'); 4161 } 4162 4163 .p-toast-close-button:focus-visible { 4164 outline-width: dt('focus.ring.width'); 4165 outline-style: dt('focus.ring.style'); 4166 outline-offset: dt('focus.ring.offset'); 4167 } 4168 4169 .p-toast-message-info { 4170 background: dt('toast.info.background'); 4171 border-color: dt('toast.info.border.color'); 4172 color: dt('toast.info.color'); 4173 box-shadow: dt('toast.info.shadow'); 4174 } 4175 4176 .p-toast-message-info .p-toast-detail { 4177 color: dt('toast.info.detail.color'); 4178 } 4179 4180 .p-toast-message-info .p-toast-close-button:focus-visible { 4181 outline-color: dt('toast.info.close.button.focus.ring.color'); 4182 box-shadow: dt('toast.info.close.button.focus.ring.shadow'); 4183 } 4184 4185 .p-toast-message-info .p-toast-close-button:hover { 4186 background: dt('toast.info.close.button.hover.background'); 4187 } 4188 4189 .p-toast-message-success { 4190 background: dt('toast.success.background'); 4191 border-color: dt('toast.success.border.color'); 4192 color: dt('toast.success.color'); 4193 box-shadow: dt('toast.success.shadow'); 4194 } 4195 4196 .p-toast-message-success .p-toast-detail { 4197 color: dt('toast.success.detail.color'); 4198 } 4199 4200 .p-toast-message-success .p-toast-close-button:focus-visible { 4201 outline-color: dt('toast.success.close.button.focus.ring.color'); 4202 box-shadow: dt('toast.success.close.button.focus.ring.shadow'); 4203 } 4204 4205 .p-toast-message-success .p-toast-close-button:hover { 4206 background: dt('toast.success.close.button.hover.background'); 4207 } 4208 4209 .p-toast-message-warn { 4210 background: dt('toast.warn.background'); 4211 border-color: dt('toast.warn.border.color'); 4212 color: dt('toast.warn.color'); 4213 box-shadow: dt('toast.warn.shadow'); 4214 } 4215 4216 .p-toast-message-warn .p-toast-detail { 4217 color: dt('toast.warn.detail.color'); 4218 } 4219 4220 .p-toast-message-warn .p-toast-close-button:focus-visible { 4221 outline-color: dt('toast.warn.close.button.focus.ring.color'); 4222 box-shadow: dt('toast.warn.close.button.focus.ring.shadow'); 4223 } 4224 4225 .p-toast-message-warn .p-toast-close-button:hover { 4226 background: dt('toast.warn.close.button.hover.background'); 4227 } 4228 4229 .p-toast-message-error { 4230 background: dt('toast.error.background'); 4231 border-color: dt('toast.error.border.color'); 4232 color: dt('toast.error.color'); 4233 box-shadow: dt('toast.error.shadow'); 4234 } 4235 4236 .p-toast-message-error .p-toast-detail { 4237 color: dt('toast.error.detail.color'); 4238 } 4239 4240 .p-toast-message-error .p-toast-close-button:focus-visible { 4241 outline-color: dt('toast.error.close.button.focus.ring.color'); 4242 box-shadow: dt('toast.error.close.button.focus.ring.shadow'); 4243 } 4244 4245 .p-toast-message-error .p-toast-close-button:hover { 4246 background: dt('toast.error.close.button.hover.background'); 4247 } 4248 4249 .p-toast-message-secondary { 4250 background: dt('toast.secondary.background'); 4251 border-color: dt('toast.secondary.border.color');
4252 color: dt('toast.secondary.color'); 4253 box-shadow: dt('toast.secondary.shadow'); 4254 } 4255 4256 .p-toast-message-secondary .p-toast-detail { 4257 color: dt('toast.secondary.detail.color'); 4258 } 4259 4260 .p-toast-message-secondary .p-toast-close-button:focus-visible { 4261 outline-color: dt('toast.secondary.close.button.focus.ring.color'); 4262 box-shadow: dt('toast.secondary.close.button.focus.ring.shadow'); 4263 } 4264 4265 .p-toast-message-secondary .p-toast-close-button:hover { 4266 background: dt('toast.secondary.close.button.hover.background'); 4267 } 4268 4269 .p-toast-message-contrast { 4270 background: dt('toast.contrast.background'); 4271 border-color: dt('toast.contrast.border.color'); 4272 color: dt('toast.contrast.color'); 4273 box-shadow: dt('toast.contrast.shadow'); 4274 } 4275 4276 .p-toast-message-contrast .p-toast-detail { 4277 color: dt('toast.contrast.detail.color'); 4278 } 4279 4280 .p-toast-message-contrast .p-toast-close-button:focus-visible { 4281 outline-color: dt('toast.contrast.close.button.focus.ring.color'); 4282 box-shadow: dt('toast.contrast.close.button.focus.ring.shadow'); 4283 } 4284 4285 .p-toast-message-contrast .p-toast-close-button:hover { 4286 background: dt('toast.contrast.close.button.hover.background'); 4287 } 4288 4289 .p-toast-top-center { 4290 transform: translateX(-50%); 4291 } 4292 4293 .p-toast-bottom-center { 4294 transform: translateX(-50%); 4295 } 4296 4297 .p-toast-center { 4298 min-width: 20vw; 4299 transform: translate(-50%, -50%); 4300 } 4301 4302 .p-toast-message-enter-active { 4303 animation: p-animate-toast-enter 300ms ease-out; 4304 } 4305 4306 .p-toast-message-leave-active { 4307 animation: p-animate-toast-leave 250ms ease-in; 4308 } 4309 4310 .p-toast-message-leave-to .p-toast-message-content { 4311 padding-top: 0; 4312 padding-bottom: 0; 4313 } 4314 4315 @keyframes p-animate-toast-enter { 4316 from { 4317 opacity: 0; 4318 transform: scale(0.6); 4319 } 4320 to { 4321 opacity: 1; 4322 grid-template-rows: 1fr; 4323 } 4324 } 4325 4326 @keyframes p-animate-toast-leave { 4327 from { 4328 opacity: 1; 4329 } 4330 to { 4331 opacity: 0; 4332 margin-bottom: 0; 4333 grid-template-rows: 0fr; 4334 transform: translateY(-100%) scale(0.6); 4335 } 4336 } 4337`;function gx(e){"@babel/helpers - typeof";return gx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gx(e)}function FT(e,t,n){return(t=VRe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VRe(e){var t=URe(e,"string");return gx(t)=="symbol"?t:t+""}function URe(e,t){if(gx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t);if(gx(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $Re={root:function(t){var n=t.position;return{position:"fixed",top:n==="top-right"||n==="top-left"||n==="top-center"?"20px":n==="center"?"50%":null,right:(n==="top-right"||n==="bottom-right")&&"20px",bottom:(n==="bottom-left"||n==="bottom-right"||n==="bottom-center")&&"20px",left:n==="top-left"||n==="bottom-left"?"20px":n==="center"||n==="top-center"||n==="bottom-center"?"50%":null}}},jRe={root:function(t){var n=t.props;return["p-toast p-component p-toast-"+n.position]},message:function(t){var n=t.props;return["p-toast-message",{"p-toast-message-info":n.message.severity==="info"||n.message.severity===void 0,"p-toast-message-warn":n.message.severity==="warn","p-toast-message-error":n.message.severity==="error","p-toast-message-success":n.message.severity==="success","p-toast-message-secondary":n.message.severity==="secondary","p-toast-message-contrast":n.message.severity==="contrast"}]},messageContent:"p-toast-message-content",messageIcon:function(t){var n=t.props;return["p-toast-message-icon",FT(FT(FT(FT({},n.infoIcon,n.message.severity==="info"),n.warnIcon,n.message.severity==="warn"),n.errorIcon,n.message.severity==="error"),n.successIcon,n.message.severity==="success")]},messageText:"p-toast-message-text",summary:"p-toast-summary",detail
4337:"p-toast-detail",closeButton:"p-toast-close-button",closeIcon:"p-toast-close-icon"},GRe=Vo.extend({name:"toast",style:NRe,classes:jRe,inlineStyles:$Re}),HRe=` 4338.p-icon { 4339 display: inline-block; 4340 vertical-align: baseline; 4341 flex-shrink: 0; 4342} 4343 4344.p-icon-spin { 4345 -webkit-animation: p-icon-spin 2s infinite linear; 4346 animation: p-icon-spin 2s infinite linear; 4347} 4348 4349@-webkit-keyframes p-icon-spin { 4350 0% { 4351 -webkit-transform: rotate(0deg); 4352 transform: rotate(0deg); 4353 } 4354 100% { 4355 -webkit-transform: rotate(359deg); 4356 transform: rotate(359deg); 4357 } 4358} 4359 4360@keyframes p-icon-spin { 4361 0% { 4362 -webkit-transform: rotate(0deg); 4363 transform: rotate(0deg); 4364 } 4365 100% { 4366 -webkit-transform: rotate(359deg); 4367 transform: rotate(359deg); 4368 } 4369} 4370`,WRe=Vo.extend({name:"baseicon",css:HRe});function _x(e){"@babel/helpers - typeof";return _x=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_x(e)}function IV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(c){return Object.getOwnPropertyDescriptor(e,c).enumerable})),n.push.apply(n,i)}return n}function PV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IV(Object(n),!0).forEach(function(i){qRe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IV(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function qRe(e,t,n){return(t=XRe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XRe(e){var t=ZRe(e,"string");return _x(t)=="symbol"?t:t+""}function ZRe(e,t){if(_x(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t);if(_x(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var n1={name:"BaseIcon",extends:BL,props:{label:{type:String,default:void 0},spin:{type:Boolean,default:!1}},style:WRe,provide:function(){return{$pcIcon:this,$parentInstance:this}},methods:{pti:function(){var t=ad(this.label);return PV(PV({},!this.isUnstyled&&{class:["p-icon",{"p-icon-spin":this.spin}]}),{},{role:t?void 0:"img","aria-label":t?void 0:this.label,"aria-hidden":t})}}},Dk={name:"CheckIcon",extends:n1};function YRe(e){return eke(e)||QRe(e)||JRe(e)||KRe()}function KRe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 4371In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JRe(e,t){if(e){if(typeof e=="string")return Fk(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fk(e,t):void 0}}function QRe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function eke(e){if(Array.isArray(e))return Fk(e)}function Fk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function tke(e,t,n,i,c,h){return ei(),ds("svg",zo({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.pti()),YRe(t[0]||(t[0]=[Go("path",{d:"M4.86199 11.5948C4.78717 11.5923 4.71366 11.5745 4.64596 11.5426C4.57826 11.5107 4.51779 11.4652 4.46827 11.4091L0.753985 7.69483C0.683167 7.64891 0.623706 7.58751 0.580092 7.51525C0.536478 7.44299 0.509851 7.361
437177 0.502221 7.27771C0.49459 7.19366 0.506156 7.10897 0.536046 7.03004C0.565935 6.95111 0.613367 6.88 0.674759 6.82208C0.736151 6.76416 0.8099 6.72095 0.890436 6.69571C0.970973 6.67046 1.05619 6.66385 1.13966 6.67635C1.22313 6.68886 1.30266 6.72017 1.37226 6.76792C1.44186 6.81567 1.4997 6.8786 1.54141 6.95197L4.86199 10.2503L12.6397 2.49483C12.7444 2.42694 12.8689 2.39617 12.9932 2.40745C13.1174 2.41873 13.2343 2.47141 13.3251 2.55705C13.4159 2.64268 13.4753 2.75632 13.4938 2.87973C13.5123 3.00315 13.4888 3.1292 13.4271 3.23768L5.2557 11.4091C5.20618 11.4652 5.14571 11.5107 5.07801 11.5426C5.01031 11.5745 4.9368 11.5923 4.86199 11.5948Z",fill:"currentColor"},null,-1)])),16)}Dk.render=tke;var Bk={name:"ExclamationTriangleIcon",extends:n1};function nke(e){return ske(e)||oke(e)||ike(e)||rke()}function rke(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 4372In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ike(e,t){if(e){if(typeof e=="string")return zk(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zk(e,t):void 0}}function oke(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ske(e){if(Array.isArray(e))return zk(e)}function zk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function ake(e,t,n,i,c,h){return ei(),ds("svg",zo({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.pti()),nke(t[0]||(t[0]=[Go("path",{d:"M13.4018 13.1893H0.598161C0.49329 13.189 0.390283 13.1615 0.299143 13.1097C0.208003 13.0578 0.131826 12.9832 0.0780112 12.8932C0.0268539 12.8015 0 12.6982 0 12.5931C0 12.4881 0.0268539 12.3848 0.0780112 12.293L6.47985 1.08982C6.53679 1.00399 6.61408 0.933574 6.70484 0.884867C6.7956 0.836159 6.897 0.810669 7 0.810669C7.103 0.810669 7.2044 0.836159 7.29516 0.884867C7.38592 0.933574 7.46321 1.00399 7.52015 1.08982L13.922 12.293C13.9731 12.3848 14 12.4881 14 12.5931C14 12.6982 13.9731 12.8015 13.922 12.8932C13.8682 12.9832 13.792 13.0578 13.7009 13.1097C13.6097 13.1615 13.5067 13.189 13.4018 13.1893ZM1.63046 11.989H12.3695L7 2.59425L1.63046 11.989Z",fill:"currentColor"},null,-1),Go("path",{d:"M6.99996 8.78801C6.84143 8.78594 6.68997 8.72204 6.57787 8.60993C6.46576 8.49782 6.40186 8.34637 6.39979 8.18784V5.38703C6.39979 5.22786 6.46302 5.0752 6.57557 4.96265C6.68813 4.85009 6.84078 4.78686 6.99996 4.78686C7.15914 4.78686 7.31179 4.85009 7.42435 4.96265C7.5369 5.0752 7.60013 5.22786 7.60013 5.38703V8.18784C7.59806 8.34637 7.53416 8.49782 7.42205 8.60993C7.30995 8.72204 7.15849 8.78594 6.99996 8.78801Z",fill:"currentColor"},null,-1),Go("path",{d:"M6.99996 11.1887C6.84143 11.1866 6.68997 11.1227 6.57787 11.0106C6.46576 10.8985 6.40186 10.7471 6.39979 10.5885V10.1884C6.39979 10.0292 6.46302 9.87658 6.57557 9.76403C6.68813 9.65147 6.84078 9.58824 6.99996 9.58824C7.15914 9.58824 7.31179 9.65147 7.42435 9.76403C7.5369 9.87658 7.60013 10.0292 7.60013 10.1884V10.5885C7.59806 10.7471 7.53416 10.8985 7.42205 11.0106C7.30995 11.1227 7.15849 11.1866 6.99996 11.1887Z",fill:"currentColor"},null,-1)])),16)}Bk.render=ake;var Nk={name:"InfoCircleIcon",extends:n1};function lke(e){return hke(e)||dke(e)||uke(e)||cke()}function cke(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 4373In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uke(e,t){if(e){if(typeof e=="string")return Vk(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Vk(e,t):void 0}}function dke(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function hke(e){if(Array.isArray(e))return Vk(e)}function Vk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function fke(e,t,n,i,c,h){return ei(),ds("svg",zo({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.pti()),lke(t[0]||(t[0]=[Go("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.11101 12.8203C4.26215 13.5895 5.61553 14 7 14C8.85652 14 10.637 13.2625 11.9497 11.9497C13.2625 10.637 14 8.85652 14 7C14 5.61553 13.5895 4.26215 12.8203 3.11101C12.0511 1.95987 10.9579 1.06266 9.67879
43730.532846C8.3997 0.00303296 6.99224 -0.13559 5.63437 0.134506C4.2765 0.404603 3.02922 1.07129 2.05026 2.05026C1.07129 3.02922 0.404603 4.2765 0.134506 5.63437C-0.13559 6.99224 0.00303296 8.3997 0.532846 9.67879C1.06266 10.9579 1.95987 12.0511 3.11101 12.8203ZM3.75918 2.14976C4.71846 1.50879 5.84628 1.16667 7 1.16667C8.5471 1.16667 10.0308 1.78125 11.1248 2.87521C12.2188 3.96918 12.8333 5.45291 12.8333 7C12.8333 8.15373 12.4912 9.28154 11.8502 10.2408C11.2093 11.2001 10.2982 11.9478 9.23232 12.3893C8.16642 12.8308 6.99353 12.9463 5.86198 12.7212C4.73042 12.4962 3.69102 11.9406 2.87521 11.1248C2.05941 10.309 1.50384 9.26958 1.27876 8.13803C1.05367 7.00647 1.16919 5.83358 1.61071 4.76768C2.05222 3.70178 2.79989 2.79074 3.75918 2.14976ZM7.00002 4.8611C6.84594 4.85908 6.69873 4.79698 6.58977 4.68801C6.48081 4.57905 6.4187 4.43185 6.41669 4.27776V3.88888C6.41669 3.73417 6.47815 3.58579 6.58754 3.4764C6.69694 3.367 6.84531 3.30554 7.00002 3.30554C7.15473 3.30554 7.3031 3.367 7.4125 3.4764C7.52189 3.58579 7.58335 3.73417 7.58335 3.88888V4.27776C7.58134 4.43185 7.51923 4.57905 7.41027 4.68801C7.30131 4.79698 7.1541 4.85908 7.00002 4.8611ZM7.00002 10.6945C6.84594 10.6925 6.69873 10.6304 6.58977 10.5214C6.48081 10.4124 6.4187 10.2652 6.41669 10.1111V6.22225C6.41669 6.06754 6.47815 5.91917 6.58754 5.80977C6.69694 5.70037 6.84531 5.63892 7.00002 5.63892C7.15473 5.63892 7.3031 5.70037 7.4125 5.80977C7.52189 5.91917 7.58335 6.06754 7.58335 6.22225V10.1111C7.58134 10.2652 7.51923 10.4124 7.41027 10.5214C7.30131 10.6304 7.1541 10.6925 7.00002 10.6945Z",fill:"currentColor"},null,-1)])),16)}Nk.render=fke;var CG={name:"TimesIcon",extends:n1};function pke(e){return yke(e)||_ke(e)||gke(e)||mke()}function mke(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 4374In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gke(e,t){if(e){if(typeof e=="string")return Uk(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Uk(e,t):void 0}}function _ke(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function yke(e){if(Array.isArray(e))return Uk(e)}function Uk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function vke(e,t,n,i,c,h){return ei(),ds("svg",zo({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.pti()),pke(t[0]||(t[0]=[Go("path",{d:"M8.01186 7.00933L12.27 2.75116C12.341 2.68501 12.398 2.60524 12.4375 2.51661C12.4769 2.42798 12.4982 2.3323 12.4999 2.23529C12.5016 2.13827 12.4838 2.0419 12.4474 1.95194C12.4111 1.86197 12.357 1.78024 12.2884 1.71163C12.2198 1.64302 12.138 1.58893 12.0481 1.55259C11.9581 1.51625 11.8617 1.4984 11.7647 1.50011C11.6677 1.50182 11.572 1.52306 11.4834 1.56255C11.3948 1.60204 11.315 1.65898 11.2488 1.72997L6.99067 5.98814L2.7325 1.72997C2.59553 1.60234 2.41437 1.53286 2.22718 1.53616C2.03999 1.53946 1.8614 1.61529 1.72901 1.74767C1.59663 1.88006 1.5208 2.05865 1.5175 2.24584C1.5142 2.43303 1.58368 2.61419 1.71131 2.75116L5.96948 7.00933L1.71131 11.2675C1.576 11.403 1.5 11.5866 1.5 11.7781C1.5 11.9696 1.576 12.1532 1.71131 12.2887C1.84679 12.424 2.03043 12.5 2.2219 12.5C2.41338 12.5 2.59702 12.424 2.7325 12.2887L6.99067 8.03052L11.2488 12.2887C11.3843 12.424 11.568 12.5 11.7594 12.5C11.9509 12.5 12.1346 12.424 12.27 12.2887C12.4053 12.1532 12.4813 11.9696 12.4813 11.7781C12.4813 11.5866 12.4053 11.403 12.27 11.2675L8.01186 7.00933Z",fill:"currentColor"},null,-1)])),16)}CG.render=vke;var $k={name:"TimesCircleIcon",extends:n1};function bke(e){return Tke(e)||Ske(e)||wke(e)||xke()}function xke(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 4375In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wke(e,t){if(e){if(typeof e=="string")return jk(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jk(e,t):void 0}}function Ske(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Tke(e){if(Array.isArray(e))return jk(e)}function jk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function Eke(e,t,n,i,c,h){return ei(),ds("svg",zo({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.pti()),bke(t[0]||(t[0]=[Go("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7 14C5.61553 14 4.26215 13.5895 3.11101 12.8203C1.95987 12.0511 1.06266 10.9579 0.532846 9.67879C0.00303296 8.3997 -0.13559 6.99224 0.134506 5.63437C0.404603 4.2765 1.07129 3.02922 2.05026 2.05026C3.02922 1.07129 4.2765 0.404603 5.63437 0.134506C6.99224 -0.13559 8.3997 0.00303296 9.67879
43750.532846C10.9579 1.06266 12.0511 1.95987 12.8203 3.11101C13.5895 4.26215 14 5.61553 14 7C14 8.85652 13.2625 10.637 11.9497 11.9497C10.637 13.2625 8.85652 14 7 14ZM7 1.16667C5.84628 1.16667 4.71846 1.50879 3.75918 2.14976C2.79989 2.79074 2.05222 3.70178 1.61071 4.76768C1.16919 5.83358 1.05367 7.00647 1.27876 8.13803C1.50384 9.26958 2.05941 10.309 2.87521 11.1248C3.69102 11.9406 4.73042 12.4962 5.86198 12.7212C6.99353 12.9463 8.16642 12.8308 9.23232 12.3893C10.2982 11.9478 11.2093 11.2001 11.8502 10.2408C12.4912 9.28154 12.8333 8.15373 12.8333 7C12.8333 5.45291 12.2188 3.96918 11.1248 2.87521C10.0308 1.78125 8.5471 1.16667 7 1.16667ZM4.66662 9.91668C4.58998 9.91704 4.51404 9.90209 4.44325 9.87271C4.37246 9.84333 4.30826 9.8001 4.2544 9.74557C4.14516 9.6362 4.0838 9.48793 4.0838 9.33335C4.0838 9.17876 4.14516 9.0305 4.2544 8.92113L6.17553 7L4.25443 5.07891C4.15139 4.96832 4.09529 4.82207 4.09796 4.67094C4.10063 4.51982 4.16185 4.37563 4.26872 4.26876C4.3756 4.16188 4.51979 4.10066 4.67091 4.09799C4.82204 4.09532 4.96829 4.15142 5.07887 4.25446L6.99997 6.17556L8.92106 4.25446C9.03164 4.15142 9.1779 4.09532 9.32903 4.09799C9.48015 4.10066 9.62434 4.16188 9.73121 4.26876C9.83809 4.37563 9.89931 4.51982 9.90198 4.67094C9.90464 4.82207 9.84855 4.96832 9.74551 5.07891L7.82441 7L9.74554 8.92113C9.85478 9.0305 9.91614 9.17876 9.91614 9.33335C9.91614 9.48793 9.85478 9.6362 9.74554 9.74557C9.69168 9.8001 9.62748 9.84333 9.55669 9.87271C9.4859 9.90209 9.40996 9.91704 9.33332 9.91668C9.25668 9.91704 9.18073 9.90209 9.10995 9.87271C9.03916 9.84333 8.97495 9.8001 8.9211 9.74557L6.99997 7.82444L5.07884 9.74557C5.02499 9.8001 4.96078 9.84333 4.88999 9.87271C4.81921 9.90209 4.74326 9.91704 4.66662 9.91668Z",fill:"currentColor"},null,-1)])),16)}$k.render=Eke;function yx(e){"@babel/helpers - typeof";return yx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yx(e)}function RV(e,t){return Pke(e)||Ike(e,t)||Ake(e,t)||Cke()}function Cke(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 4376In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ake(e,t){if(e){if(typeof e=="string")return kV(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kV(e,t):void 0}}function kV(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function Ike(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var i,c,h,m,a=[],y=!0,E=!1;try{if(h=(n=n.call(e)).next,t!==0)for(;!(y=(i=h.call(n)).done)&&(a.push(i.value),a.length!==t);y=!0);}catch(C){E=!0,c=C}finally{try{if(!y&&n.return!=null&&(m=n.return(),Object(m)!==m))return}finally{if(E)throw c}}return a}}function Pke(e){if(Array.isArray(e))return e}function MV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(c){return Object.getOwnPropertyDescriptor(e,c).enumerable})),n.push.apply(n,i)}return n}function vi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MV(Object(n),!0).forEach(function(i){Gk(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MV(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Gk(e,t,n){return(t=Rke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rke(e){var t=kke(e,"string");return yx(t)=="symbol"?t:t+""}function kke(e,t){if(yx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t);if(yx(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Kr={_getMeta:function(){return[nu(arguments.length<=0?void 0:arguments[0])||arguments.length<=0?void 0:arguments[0],kl(nu(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:arguments.length<=1?void 0:arguments[1])]},_getConfig:function(t,n){var i,c,h;return(i=(t==null||(c=t.instance)===null||c===void 0?void 0:c.$primevue)||(n==null||(h=n.ctx)===null||h===void 0||(h=h.appContext)===null||h===void 0||(h=h.config)===null||h===void 0||(h=h.globalProperties)===null||h===void 0?void 0:h.$primevue))===null||i===void 0?void 0:i.config},_getOptionValue:lL,_getPTValue:function(){var t,n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,y=function(){var Y=Kr._getOptionValue.apply(Kr,arguments);return cl(Y)||M9(Y)?{class:Y}:Y},E=((t=i.binding)===null||t===void 0||(t=t.value)===null||t===void 0?void 0:t.ptOptions)||((n=i.$primevueConfig)===null||n===void 0?void 0:n.ptOptions)||{},C=E.mergeSections,P=C===void 0?!0:C,L=E.mergeProps,D=L===void 0?!1:L,V=a?Kr._useDefaultPT(i,i.defaultPT(),y,h,m):void 0,U=Kr._usePT(i,Kr._getPT(c,i.$name),y,h,vi(vi({},m),{},{global:V||{}})),W=Kr._getPTDatasets(i,h);return P||!P&&U?D?Kr._mergeProps(i,D,V,U,W):vi(vi(vi({},V),U),W):vi(vi({},U),W)},_getPTDatasets:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i="data-pc-";return vi(vi({},n==="root"&&Gk({},"".concat(i,"name"),Ju(t.$name))),{},Gk({},"".concat(i,"section"),Ju(n)))},_getPT:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0,c=function(m){var a,y=i?i(m):m,E=Ju(n);return(a=y?.[E])!==null&&a!==void 0?a:y};return t&&Object.hasOwn(t,"_usept")?{_usept:t._usept,originalValue:c(t.originalValue),value:c(t.value)}:c(t)},_usePT:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,c=arguments.length>3?arguments[3]:void 0,h=arguments.length>4?arguments[4]:void 0,m=function(W){return i(W,c,h)};if(n&&Object.hasOwn(n,"_usept")){var a,y=n._usept||((a=t.$primevueConfig)===null||a===void 0?void 0:a.ptOptions)||{},E=y.mergeSections,C=E===void 0?!0:E,P=y.mergeProps,L=P===void 0?!1:P,D=m(n.originalValue),V=m(n.value);return D===void 0&&V===void 0?void 0:cl(V)?V:cl(D)?D:C||!C&&V?L?Kr._mergeProps(t,L,D,V):vi(vi({},D),V):V}return m(n)},_useDefaultPT:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,c=arguments.length>3?arguments[3]:void 0,h=arguments.length>4?arguments[4]:void 0;return Kr._usePT(t,n,i,c,h)},_loadStyles:function(){var t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,c=arguments.length>2?arguments[2]:void 0,h=Kr._getConfig(i,c),m={nonce:h==null||(t=h.csp)===null||t===void 0?void 0:t.nonce};Kr._loadCoreStyles(n,m),Kr._loadThemeStyles(n,m),Kr._loadScopedThemeStyles(n,m),Kr._removeThemeListeners(n),n.$loadStyles=function(){return Kr._loadThemeStyles(n,m)},Kr._themeChangeListener(n.$loadStyles)},_loadCoreStyles:function(){var t,n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=arguments.length>1?arguments[1]:void 0;if(!Mf.isStyleNameLoaded((t=i.$style)===null||t===void 0?void 0:t.name)&&(n=i.$style)!==null&&n!==void 0&&n.name){var h;Vo.loadCSS(c),(h=i.$style)===null||h===void 0||h.loadCSS(c),Mf.setLoadedStyleName(i.$style.name)}},_loadThemeStyles:function(){var t,n,i,c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h=arguments.length>1?arguments[1]:void 0;if(!(c!=null&&c.isUnstyled()||(c==null||(t=c.theme)===null||t===void 0?void 0:t.call(c))==="none")){if(!Wi.isStyleNameLoaded("common")){var m,a,y=((m=c.$style)===null||m===void 0||(a=m.getCommonTheme)===null||a===void 0?void 0:a.call(m))||{},E=y.primitive,C=y.semantic,P=y.global,L=y.style;Vo.load(E?.css,vi({name:"primitive-variables"},h)),Vo.load(C?.css,vi({name:"semantic-variables"},h)),Vo.load(P?.css,vi({name:"global-variables"},h)),Vo.loadStyle(vi({name:"global-style"}
4376,h),L),Wi.setLoadedStyleName("common")}if(!Wi.isStyleNameLoaded((n=c.$style)===null||n===void 0?void 0:n.name)&&(i=c.$style)!==null&&i!==void 0&&i.name){var D,V,U,W,$=((D=c.$style)===null||D===void 0||(V=D.getDirectiveTheme)===null||V===void 0?void 0:V.call(D))||{},Y=$.css,X=$.style;(U=c.$style)===null||U===void 0||U.load(Y,vi({name:"".concat(c.$style.name,"-variables")},h)),(W=c.$style)===null||W===void 0||W.loadStyle(vi({name:"".concat(c.$style.name,"-style")},h),X),Wi.setLoadedStyleName(c.$style.name)}if(!Wi.isStyleNameLoaded("layer-order")){var K,ne,fe=(K=c.$style)===null||K===void 0||(ne=K.getLayerOrderThemeCSS)===null||ne===void 0?void 0:ne.call(K);Vo.load(fe,vi({name:"layer-order",first:!0},h)),Wi.setLoadedStyleName("layer-order")}}},_loadScopedThemeStyles:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,i=t.preset();if(i&&t.$attrSelector){var c,h,m,a=((c=t.$style)===null||c===void 0||(h=c.getPresetTheme)===null||h===void 0?void 0:h.call(c,i,"[".concat(t.$attrSelector,"]")))||{},y=a.css,E=(m=t.$style)===null||m===void 0?void 0:m.load(y,vi({name:"".concat(t.$attrSelector,"-").concat(t.$style.name)},n));t.scopedStyleEl=E.el}},_themeChangeListener:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){};Mf.clearLoadedStyleNames(),js.on("theme:change",t)},_removeThemeListeners:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};js.off("theme:change",t.$loadStyles),t.$loadStyles=void 0},_hook:function(t,n,i,c,h,m){var a,y,E="on".concat(fme(n)),C=Kr._getConfig(c,h),P=i?.$instance,L=Kr._usePT(P,Kr._getPT(c==null||(a=c.value)===null||a===void 0?void 0:a.pt,t),Kr._getOptionValue,"hooks.".concat(E)),D=Kr._useDefaultPT(P,C==null||(y=C.pt)===null||y===void 0||(y=y.directives)===null||y===void 0?void 0:y[t],Kr._getOptionValue,"hooks.".concat(E)),V={el:i,binding:c,vnode:h,prevVnode:m};L?.(P,V),D?.(P,V)},_mergeProps:function(){for(var t=arguments.length>1?arguments[1]:void 0,n=arguments.length,i=new Array(n>2?n-2:0),c=2;c<n;c++)i[c-2]=arguments[c];return JC(t)?t.apply(void 0,i):zo.apply(void 0,i)},_extend:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=function(a,y,E,C,P){var L,D,V,U;y._$instances=y._$instances||{};var W=Kr._getConfig(E,C),$=y._$instances[t]||{},Y=ad($)?vi(vi({},n),n?.methods):{};y._$instances[t]=vi(vi({},$),{},{$name:t,$host:y,$binding:E,$modifiers:E?.modifiers,$value:E?.value,$el:$.$el||y||void 0,$style:vi({classes:void 0,inlineStyles:void 0,load:function(){},loadCSS:function(){},loadStyle:function(){}},n?.style),$primevueConfig:W,$attrSelector:(L=y.$pd)===null||L===void 0||(L=L[t])===null||L===void 0?void 0:L.attrSelector,defaultPT:function(){return Kr._getPT(W?.pt,void 0,function(K){var ne;return K==null||(ne=K.directives)===null||ne===void 0?void 0:ne[t]})},isUnstyled:function(){var K,ne;return((K=y._$instances[t])===null||K===void 0||(K=K.$binding)===null||K===void 0||(K=K.value)===null||K===void 0?void 0:K.unstyled)!==void 0?(ne=y._$instances[t])===null||ne===void 0||(ne=ne.$binding)===null||ne===void 0||(ne=ne.value)===null||ne===void 0?void 0:ne.unstyled:W?.unstyled},theme:function(){var K;return(K=y._$instances[t])===null||K===void 0||(K=K.$primevueConfig)===null||K===void 0?void 0:K.theme},preset:function(){var K;return(K=y._$instances[t])===null||K===void 0||(K=K.$binding)===null||K===void 0||(K=K.value)===null||K===void 0?void 0:K.dt},ptm:function(){var K,ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Kr._getPTValue(y._$instances[t],(K=y._$instances[t])===null||K===void 0||(K=K.$binding)===null||K===void 0||(K=K.value)===null||K===void 0?void 0:K.pt,ne,vi({},fe))},ptmo:function(){var K=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",fe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Kr._getPTValue(y._$instances[t],K,ne,fe,!1)},cx:function(){var K,ne,fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(K=y._$instances[t])!==null&&K!==void 0&&K.isUnstyled()?void 0:Kr._getOptionValue((ne=y._$instances[t])===null||ne===void 0||(ne=ne.$style)===null||ne===void 0?void 0:ne.classes,fe,vi({},ye))},sx:function(){var K,ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,ye=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return fe?Kr._getOptionValue((K=y._$instances[t])===null||K===void 0||(K=K.$style)===null||K===void 0?void 0:K.inlineStyles,ne,vi({},ye)):void 0}},Y),y.$instance=y._$instances[t],(D=(V=y.$instance)[a])===null||D===void 0||D.call(V,y,E,C,P),y["$".concat(t)]=y.$instance,Kr._hook(t,a,y,E,C,P),y.$pd||(y.$pd={}),y.$pd[t]=vi(vi({},(U=y.$pd)===null||U===void 0?void 0:U[t]),{},{name:t,instance:y._$instances[t]})},c=function(a){var y,E,C,P=a._$instances[t],L=P?.watch,D=function(W){var $,Y=W.newValue,X=W.oldValue;return L==null||($=L.config)===null||$===void 0?void 0:$.call(P,Y,X)},V=function(W){var $,Y=W.newValue,X=W.oldValue;return L==null||($=L["config.ripple"])===null||$===void 0?void 0:$.call(P,Y,X)};
4376P.$watchersCallback={config:D,"config.ripple":V},L==null||(y=L.config)===null||y===void 0||y.call(P,P?.$primevueConfig),Df.on("config:change",D),L==null||(E=L["config.ripple"])===null||E===void 0||E.call(P,P==null||(C=P.$primevueConfig)===null||C===void 0?void 0:C.ripple),Df.on("config:ripple:change",V)},h=function(a){var y=a._$instances[t].$watchersCallback;y&&(Df.off("config:change",y.config),Df.off("config:ripple:change",y["config.ripple"]),a._$instances[t].$watchersCallback=void 0)};return{created:function(a,y,E,C){a.$pd||(a.$pd={}),a.$pd[t]={name:t,attrSelector:Cme("pd")},i("created",a,y,E,C)},beforeMount:function(a,y,E,C){var P;Kr._loadStyles((P=a.$pd[t])===null||P===void 0?void 0:P.instance,y,E),i("beforeMount",a,y,E,C),c(a)},mounted:function(a,y,E,C){var P;Kr._loadStyles((P=a.$pd[t])===null||P===void 0?void 0:P.instance,y,E),i("mounted",a,y,E,C)},beforeUpdate:function(a,y,E,C){i("beforeUpdate",a,y,E,C)},updated:function(a,y,E,C){var P;Kr._loadStyles((P=a.$pd[t])===null||P===void 0?void 0:P.instance,y,E),i("updated",a,y,E,C)},beforeUnmount:function(a,y,E,C){var P;h(a),Kr._removeThemeListeners((P=a.$pd[t])===null||P===void 0?void 0:P.instance),i("beforeUnmount",a,y,E,C)},unmounted:function(a,y,E,C){var P;(P=a.$pd[t])===null||P===void 0||(P=P.instance)===null||P===void 0||(P=P.scopedStyleEl)===null||P===void 0||(P=P.value)===null||P===void 0||P.remove(),i("unmounted",a,y,E,C)}}},extend:function(){var t=Kr._getMeta.apply(Kr,arguments),n=RV(t,2),i=n[0],c=n[1];return vi({extend:function(){var m=Kr._getMeta.apply(Kr,arguments),a=RV(m,2),y=a[0],E=a[1];return Kr.extend(y,vi(vi(vi({},c),c?.methods),E))}},Kr._extend(i,c))}},Mke=` 4377 .p-ink { 4378 display: block; 4379 position: absolute; 4380 background: dt('ripple.background'); 4381 border-radius: 100%; 4382 transform: scale(0); 4383 pointer-events: none; 4384 } 4385 4386 .p-ink-active { 4387 animation: ripple 0.4s linear; 4388 } 4389 4390 @keyframes ripple { 4391 100% { 4392 opacity: 0; 4393 transform: scale(2.5); 4394 } 4395 } 4396`,Lke={root:"p-ink"},Oke=Vo.extend({name:"ripple-directive",style:Mke,classes:Lke}),Dke=Kr.extend({style:Oke});function vx(e){"@babel/helpers - typeof";return vx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vx(e)}function Fke(e){return Vke(e)||Nke(e)||zke(e)||Bke()}function Bke(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 4397In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zke(e,t){if(e){if(typeof e=="string")return Hk(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Hk(e,t):void 0}}function Nke(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Vke(e){if(Array.isArray(e))return Hk(e)}function Hk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function LV(e,t,n){return(t=Uke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uke(e){var t=$ke(e,"string");return vx(t)=="symbol"?t:t+""}function $ke(e,t){if(vx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t);if(vx(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}
4397var jke=Dke.extend("ripple",{watch:{"config.ripple":function(t){t?(this.createRipple(this.$host),this.bindEvents(this.$host),this.$host.setAttribute("data-pd-ripple",!0),this.$host.style.overflow="hidden",this.$host.style.position="relative"):(this.remove(this.$host),this.$host.removeAttribute("data-pd-ripple"))}},unmounted:function(t){this.remove(t)},timeout:void 0,methods:{bindEvents:function(t){t.addEventListener("mousedown",this.onMouseDown.bind(this))},unbindEvents:function(t){t.removeEventListener("mousedown",this.onMouseDown.bind(this))},createRipple:function(t){var n=this.getInk(t);n||(n=wme("span",LV(LV({role:"presentation","aria-hidden":!0,"data-p-ink":!0,"data-p-ink-active":!1,class:!this.isUnstyled()&&this.cx("root"),onAnimationEnd:this.onAnimationEnd.bind(this)},this.$attrSelector,""),"p-bind",this.ptm("root"))),t.appendChild(n),this.$el=n)},remove:function(t){var n=this.getInk(t);n&&(this.$host.style.overflow="",this.$host.style.position="",this.unbindEvents(t),n.removeEventListener("animationend",this.onAnimationEnd),n.remove())},onMouseDown:function(t){var n=this,i=t.currentTarget,c=this.getInk(i);if(!(!c||getComputedStyle(c,null).display==="none")){if(!this.isUnstyled()&&Vb(c,"p-ink-active"),c.setAttribute("data-p-ink-active","false"),!mN(c)&&!gN(c)){var h=Math.max(D9(i),hL(i));c.style.height=h+"px",c.style.width=h+"px"}var m=N9(i),a=t.pageX-m.left+document.body.scrollTop-gN(c)/2,y=t.pageY-m.top+document.body.scrollLeft-mN(c)/2;c.style.top=y+"px",c.style.left=a+"px",!this.isUnstyled()&&fk(c,"p-ink-active"),c.setAttribute("data-p-ink-active","true"),this.timeout=setTimeout(function(){c&&(!n.isUnstyled()&&Vb(c,"p-ink-active"),c.setAttribute("data-p-ink-active","false"))},401)}},onAnimationEnd:function(t){this.timeout&&clearTimeout(this.timeout),!this.isUnstyled()&&Vb(t.currentTarget,"p-ink-active"),t.currentTarget.setAttribute("data-p-ink-active","false")},getInk:function(t){return t&&t.children?Fke(t.children).find(function(n){return B9(n,"data-pc-name")==="ripple"}):void 0}}}),Gke={name:"BaseToast",extends:BL,props:{group:{type:String,default:null},position:{type:String,default:"top-right"},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},breakpoints:{type:Object,default:null},closeIcon:{type:String,default:void 0},infoIcon:{type:String,default:void 0},warnIcon:{type:String,default:void 0},errorIcon:{type:String,default:void 0},successIcon:{type:String,default:void 0},closeButtonProps:{type:null,default:null},onMouseEnter:{type:Function,default:void 0},onMouseLeave:{type:Function,default:void 0},onClick:{type:Function,default:void 0}},style:GRe,provide:function(){return{$pcToast:this,$parentInstance:this}}};function bx(e){"@babel/helpers - typeof";return bx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bx(e)}function Hke(e,t,n){return(t=Wke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wke(e){var t=qke(e,"string");return bx(t)=="symbol"?t:t+""}function qke(e,t){if(bx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t);if(bx(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var AG={name:"ToastMessage",hostName:"Toast",extends:BL,emits:["close"],closeTimeout:null,createdAt:null,lifeRemaining:null,props:{message:{type:null,default:null},templates:{type:Object,default:null},closeIcon:{type:String,default:null},infoIcon:{type:String,default:null},warnIcon:{type:String,default:null},errorIcon:{type:String,default:null},successIcon:{type:String,default:null},closeButtonProps:{type:null,default:null},onMouseEnter:{type:Function,default:void 0},onMouseLeave:{type:Function,default:void 0},onClick:{type:Function,default:void 0}},mounted:function(){this.message.life&&(this.lifeRemaining=this.message.life,this.startTimeout())},beforeUnmount:function(){this.clearCloseTimeout()},methods:{startTimeout:function(){var t=this;this.createdAt=new Date().valueOf(),this.closeTimeout=setTimeout(function(){t.close({message:t.message,type:"life-end"})},this.lifeRemaining)},close:function(t){this.$emit("close",t)},onCloseClick:function(){this.clearCloseTimeout(),this.close({message:this.message,type:"close"})},clearCloseTimeout:function(){this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null)},onMessageClick:function(t){var n;(n=this.onClick)===null||n===void 0||n.call(this,{originalEvent:t,message:this.message})},handleMouseEnter:function(t){if(this.onMouseEnter){if(this.onMouseEnter({originalEvent:t,message:this.message}),t.defaultPrevented)return;this.message.life&&(this.lifeRemaining=this.createdAt+this.lifeRemaining-new Date().valueOf(),this.createdAt=null,this.clearCloseTimeout())}},handleMouseLeave:function(t){if(this.onMouseLeave){if(this.onMouseLeave({originalEvent:t,message:this.message}),t.defaultPrevented)return;this.message.life&&this.startTimeout()}}},computed:{iconComponent:function(){return{info:!this.infoIcon&&Nk,success:!this.successIcon&&Dk,warn:!this.warnIcon&&Bk,error:!this.errorIcon&&$k}[this.message.severity]},closeAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0},dataP:function(){return cL(Hke({}
4397,this.message.severity,this.message.severity))}},components:{TimesIcon:CG,InfoCircleIcon:Nk,CheckIcon:Dk,ExclamationTriangleIcon:Bk,TimesCircleIcon:$k},directives:{ripple:jke}};function xx(e){"@babel/helpers - typeof";return xx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xx(e)}function OV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(c){return Object.getOwnPropertyDescriptor(e,c).enumerable})),n.push.apply(n,i)}return n}function DV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OV(Object(n),!0).forEach(function(i){Xke(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OV(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Xke(e,t,n){return(t=Zke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zke(e){var t=Yke(e,"string");return xx(t)=="symbol"?t:t+""}function Yke(e,t){if(xx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t);if(xx(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Kke=["data-p"],Jke=["data-p"],Qke=["data-p"],eMe=["data-p"],tMe=["aria-label","data-p"];function nMe(e,t,n,i,c,h){var m=gZ("ripple");return ei(),ds("div",zo({class:[e.cx("message"),n.message.styleClass],role:"alert","aria-live":"assertive","aria-atomic":"true","data-p":h.dataP},e.ptm("message"),{onClick:t[1]||(t[1]=function(){return h.onMessageClick&&h.onMessageClick.apply(h,arguments)}),onMouseenter:t[2]||(t[2]=function(){return h.handleMouseEnter&&h.handleMouseEnter.apply(h,arguments)}),onMouseleave:t[3]||(t[3]=function(){return h.handleMouseLeave&&h.handleMouseLeave.apply(h,arguments)})}),[n.templates.container?(ei(),Ss(wm(n.templates.container),{key:0,message:n.message,closeCallback:h.onCloseClick},null,8,["message","closeCallback"])):(ei(),ds("div",zo({key:1,class:[e.cx("messageContent"),n.message.contentStyleClass]},e.ptm("messageContent")),[n.templates.message?(ei(),Ss(wm(n.templates.message),{key:1,message:n.message},null,8,["message"])):(ei(),ds(jo,{key:0},[(ei(),Ss(wm(n.templates.messageicon?n.templates.messageicon:n.templates.icon?n.templates.icon:h.iconComponent&&h.iconComponent.name?h.iconComponent:"span"),zo({class:e.cx("messageIcon")},e.ptm("messageIcon")),null,16,["class"])),Go("div",zo({class:e.cx("messageText"),"data-p":h.dataP},e.ptm("messageText")),[Go("span",zo({class:e.cx("summary"),"data-p":h.dataP},e.ptm("summary")),Cm(n.message.summary),17,Qke),n.message.detail?(ei(),ds("div",zo({key:0,class:e.cx("detail"),"data-p":h.dataP},e.ptm("detail")),Cm(n.message.detail),17,eMe)):Zf("",!0)],16,Jke)],64)),n.message.closable!==!1?(ei(),ds("div",dX(zo({key:2},e.ptm("buttonContainer"))),[WX((ei(),ds("button",zo({class:e.cx("closeButton"),type:"button","aria-label":h.closeAriaLabel,onClick:t[0]||(t[0]=function(){return h.onCloseClick&&h.onCloseClick.apply(h,arguments)}),autofocus:"","data-p":h.dataP},DV(DV({},n.closeButtonProps),e.ptm("closeButton"))),[(ei(),Ss(wm(n.templates.closeicon||"TimesIcon"),zo({class:[e.cx("closeIcon"),n.closeIcon]},e.ptm("closeIcon")),null,16,["class"]))],16,tMe)),[[m]])],16)):Zf("",!0)],16))],16,Kke)}AG.render=nMe;function wx(e){"@babel/helpers - typeof";return wx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wx(e)}function rMe(e,t,n){return(t=iMe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iMe(e){var t=oMe(e,"string");return wx(t)=="symbol"?t:t+""}function oMe(e,t){if(wx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t);if(wx(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sMe(e){return uMe(e)||cMe(e)||lMe(e)||aMe()}function aMe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 4398In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lMe(e,t){if(e){if(typeof e=="string")return Wk(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wk(e,t):void 0}}function cMe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function uMe(e){if(Array.isArray(e))return Wk(e)}function Wk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}var dMe=0,zL={name:"Toast",extends:Gke,inheritAttrs:!1,emits:["close","life-end"],data:function(){return{messages:[]}},styleElement:null,mounted:function(){hc.on("add",this.onAdd),hc.on("remove",this.onRemove),hc.on("remove-group",this.onRemoveGroup),hc.on("remove-all-groups",this.onRemoveAllGroups),this.breakpoints&&this.createStyle()},beforeUnmount:function(){this.destroyStyle(),this.$refs.container&&this.autoZIndex&&dP.clear(this.$refs.container),hc.off("add",this.onAdd),hc.off("remove",this.onRemove),hc.off("remove-group",this.onRemoveGroup),hc.off("remove-all-groups",this.onRemoveAllGroups)},methods:{add:function(t){t.id==null&&(t.id=dMe++),this.messages=[].concat(sMe(this.messages),[t])},remove:function(t){var n=this.messages.findIndex(function(i){return i.id===t.message.id});n!==-1&&(this.messages.splice(n,1),this.$emit(t.type,{message:t.message}))},onAdd:function(t){this.group==t.group&&this.add(t)},onRemove:function(t){this.remove({message:t,type:"close"})},onRemoveGroup:function(t){this.group===t&&(this.messages=[])},onRemoveAllGroups:function(){var t=this;
4398this.messages.forEach(function(n){return t.$emit("close",{message:n})}),this.messages=[]},onEnter:function(){this.autoZIndex&&dP.set("modal",this.$refs.container,this.baseZIndex||this.$primevue.config.zIndex.modal)},onLeave:function(){var t=this;this.$refs.container&&this.autoZIndex&&ad(this.messages)&&setTimeout(function(){dP.clear(t.$refs.container)},200)},createStyle:function(){if(!this.styleElement&&!this.isUnstyled){var t;this.styleElement=document.createElement("style"),this.styleElement.type="text/css",$9(this.styleElement,"nonce",(t=this.$primevue)===null||t===void 0||(t=t.config)===null||t===void 0||(t=t.csp)===null||t===void 0?void 0:t.nonce),document.head.appendChild(this.styleElement);var n="";for(var i in this.breakpoints){var c="";for(var h in this.breakpoints[i])c+=h+":"+this.breakpoints[i][h]+"!important;";n+=` 4399 @media screen and (max-width: `.concat(i,`) { 4400 .p-toast[`).concat(this.$attrSelector,`] { 4401 `).concat(c,` 4402 } 4403 } 4404 `)}this.styleElement.innerHTML=n}},destroyStyle:function(){this.styleElement&&(document.head.removeChild(this.styleElement),this.styleElement=null)}},computed:{dataP:function(){return cL(rMe({},this.position,this.position))}},components:{ToastMessage:AG,Portal:wG}};function Sx(e){"@babel/helpers - typeof";return Sx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sx(e)}function FV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(c){return Object.getOwnPropertyDescriptor(e,c).enumerable})),n.push.apply(n,i)}return n}function hMe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FV(Object(n),!0).forEach(function(i){fMe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FV(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function fMe(e,t,n){return(t=pMe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pMe(e){var t=mMe(e,"string");return Sx(t)=="symbol"?t:t+""}function mMe(e,t){if(Sx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t);if(Sx(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}
4404var gMe=["data-p"];function _Me(e,t,n,i,c,h){var m=cE("ToastMessage"),a=cE("Portal");return ei(),Ss(a,null,{default:hh(function(){return[Go("div",zo({ref:"container",class:e.cx("root"),style:e.sx("root",!0,{position:e.position}),"data-p":h.dataP},e.ptmi("root")),[Ai(AY,zo({name:"p-toast-message",tag:"div",onEnter:h.onEnter,onLeave:h.onLeave},hMe({},e.ptm("transition"))),{default:hh(function(){return[(ei(!0),ds(jo,null,_Z(c.messages,function(y){return ei(),Ss(m,{key:y.id,message:y,templates:e.$slots,closeIcon:e.closeIcon,infoIcon:e.infoIcon,warnIcon:e.warnIcon,errorIcon:e.errorIcon,successIcon:e.successIcon,closeButtonProps:e.closeButtonProps,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onClick:e.onClick,unstyled:e.unstyled,onClose:t[0]||(t[0]=function(E){return h.remove(E)}),pt:e.pt},null,8,["message","templates","closeIcon","infoIcon","warnIcon","errorIcon","successIcon","closeButtonProps","onMouseEnter","onMouseLeave","onClick","unstyled","pt"])}),128))]}),_:1},16,["onEnter","onLeave"])],16,gMe)]}),_:1})}zL.render=_Me;const yMe=Object.freeze(Object.defineProperty({__proto__:null,default:zL},Symbol.toStringTag,{value:"Module"})),vMe={class:"pointer-events-auto m-4 flex w-[min(25rem,calc(100vw-4rem))] items-center gap-3 rounded-lg border border-border bg-surface px-4 py-3 shadow-popover"},bMe={key:0,class:"pi pi-check-circle shrink-0 text-success",style:{"font-size":"var(--p-text-md)"},"aria-hidden":"true"},xMe={key:1,class:"pi pi-times-circle shrink-0 text-error",style:{"font-size":"var(--p-text-md)"},"aria-hidden":"true"},wMe={class:"m-0 min-w-0 flex-1 whitespace-pre-wrap break-words text-base leading-relaxed text-fg"},SMe=["aria-label","onClick"],TMe={__name:"SharedToast",setup(e){const t=Nm(),n=Z6(),i=Ox(),{t:c}=Xx(),h=vn(()=>t.lang==="ar"?"top-left":"top-right");return cu(()=>{n.setToastInstance(i)}),(m,a)=>(ei(),Ss(Ar(zL),{key:h.value,unstyled:!0,position:h.value,group:"headless"},{container:hh(({message:y,closeCallback:E})=>[Go("div",vMe,[y.severity==="success"?(ei(),ds("i",bMe)):y.severity==="error"?(ei(),ds("i",xMe)):Zf("",!0),Go("p",wMe,Cm(y.detail),1),Go("button",{type:"button",class:"grid size-6 shrink-0 place-items-center rounded-sm text-muted opacity-70 transition-opacity hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--color-focus-ring) motion-reduce:transition-none","aria-label":Ar(c)("Platform.Close"),onClick:E},[...a[0]||(a[0]=[Go("i",{class:"pi pi-times",style:{"font-size":"var(--p-text-sm)"},"aria-hidden":"true"},null,-1)])],8,SMe)])]),_:1},8,["position"]))}};var LP,BV;function EMe(){if(BV)return LP;BV=1;function e($){this._maxSize=$,this.clear()}e.prototype.clear=function(){this._size=0,this._values=Object.create(null)},e.prototype.get=function($){return this._values[$]},e.prototype.set=function($,Y){return this._size>=this._maxSize&&this.clear(),$ in this._values||this._size++,this._values[$]=Y};var t=/[^.^\]^[]+|(?=\[\]|\.\.)/g,n=/^\d+$/,i=/^\d/,c=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,h=/^\s*(['"]?)(.*?)(\1)\s*$/,m=512,a=new e(m),y=new e(m),E=new e(m);LP={Cache:e,split:P,normalizePath:C,setter:function($){var Y=C($);return y.get($)||y.set($,function(K,ne){for(var fe=0,ye=Y.length,ke=K;fe<ye-1;){var Fe=Y[fe];if(Fe==="__proto__"||Fe==="constructor"||Fe==="prototype")return K;ke=ke[Y[fe++]]}ke[Y[fe]]=ne})},getter:function($,Y){var X=C($);return E.get($)||E.set($,function(ne){for(var fe=0,ye=X.length;fe<ye;)if(ne!=null||!Y)ne=ne[X[fe++]];else return;return ne})},join:function($){return $.reduce(function(Y,X){return Y+(D(X)||n.test(X)?"["+X+"]":(Y?".":"")+X)},"")},forEach:function($,Y,X){L(Array.isArray($)?$:P($),Y,X)}};function C($){return a.get($)||a.set($,P($).map(function(Y){return Y.replace(h,"$2")}))}function P($){return $.match(t)||[""]}function L($,Y,X){var K=$.length,ne,fe,ye,ke;for(fe=0;fe<K;fe++)ne=$[fe],ne&&(W(ne)&&(ne='"'+ne+'"'),ke=D(ne),ye=!ke&&/^\d+$/.test(ne),Y.call(X,ne,ke,ye,fe,$))}function D($){return typeof $=="string"&&$&&["'",'"'].indexOf($.charAt(0))!==-1}function V($){return $.match(i)&&!$.match(n)}function U($){return c.test($)}function W($){return!D($)&&(V($)||U($))}return LP}var Om=EMe(),OP,zV;function CMe(){if(zV)return OP;zV=1;const e=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['â](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['â](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['â](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['â](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,t=C=>C.match(e)||[],n=C=>C[0].toUpperCase()+C.slice(1),i=(C,P)=>t(C).join(P).toLowerCase(),c=C=>t(C).reduce((P,L)=>`${P}${P?L[0].toUpperCase()+L.slice(1).toLowerCase():L.toLowerCase()}`,"");return OP={words:t,upperFirst:n,camelCase:c,pascalCase:C=>n(c(C)),snakeCase:C=>i(C,"_"),kebabCase:C=>i(C,"-"),sentenceCase:C=>n(i(C," ")),titleCase:C=>t(C).map(n).join(" ")},OP}var DP=CMe(),BT={exports:{}},NV;function AMe(){if(NV)return BT.exports;NV=1,BT.exports=function(c){return e(t(c),c)},BT.exports.array=e;function e(c,h){var m=c.length,a=new Array(m),y={},E=m,C=n(h),P=i(c);
4404for(h.forEach(function(D){if(!P.has(D[0])||!P.has(D[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});E--;)y[E]||L(c[E],E,new Set);return a;function L(D,V,U){if(U.has(D)){var W;try{W=", node was:"+JSON.stringify(D)}catch{W=""}throw new Error("Cyclic dependency"+W)}if(!P.has(D))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(D));if(!y[V]){y[V]=!0;var $=C.get(D)||new Set;if($=Array.from($),V=$.length){U.add(D);do{var Y=$[--V];L(Y,P.get(Y),U)}while(V);U.delete(D)}a[--m]=D}}}function t(c){for(var h=new Set,m=0,a=c.length;m<a;m++){var y=c[m];h.add(y[0]),h.add(y[1])}return Array.from(h)}function n(c){for(var h=new Map,m=0,a=c.length;m<a;m++){var y=c[m];h.has(y[0])||h.set(y[0],new Set),h.has(y[1])||h.set(y[1],new Set),h.get(y[0]).add(y[1])}return h}function i(c){for(var h=new Map,m=0,a=c.length;m<a;m++)h.set(c[m],m);return h}return BT.exports}var IMe=AMe();const PMe=Iy(IMe),RMe=Object.prototype.toString,kMe=Error.prototype.toString,MMe=RegExp.prototype.toString,LMe=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",OMe=/^Symbol\((.*)\)(.*)$/;function DMe(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function VV(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return DMe(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return LMe.call(e).replace(OMe,"Symbol($1)");const i=RMe.call(e).slice(8,-1);return i==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):i==="Error"||e instanceof Error?"["+kMe.call(e)+"]":i==="RegExp"?MMe.call(e):null}function qf(e,t){let n=VV(e,t);return n!==null?n:JSON.stringify(e,function(i,c){let h=VV(this[i],t);return h!==null?h:c},2)}function IG(e){return e==null?[]:[].concat(e)}let PG,RG,kG,FMe=/\$\{\s*(\w+)\s*\}/g;PG=Symbol.toStringTag;class UV{constructor(t,n,i,c){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[PG]="Error",this.name="ValidationError",this.value=n,this.path=i,this.type=c,this.errors=[],this.inner=[],IG(t).forEach(h=>{if(Fa.isError(h)){this.errors.push(...h.errors);const m=h.inner.length?h.inner:[h];this.inner.push(...m)}else this.errors.push(h)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}RG=Symbol.hasInstance;kG=Symbol.toStringTag;class Fa extends Error{static formatError(t,n){const i=n.label||n.path||"this";return n=Object.assign({},n,{path:i,originalPath:n.path}),typeof t=="string"?t.replace(FMe,(c,h)=>qf(n[h])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,i,c,h){const m=new UV(t,n,i,c);if(h)return m;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[kG]="Error",this.name=m.name,this.message=m.message,this.type=m.type,this.value=m.value,this.path=m.path,this.errors=m.errors,this.inner=m.inner,Error.captureStackTrace&&Error.captureStackTrace(this,Fa)}static[RG](t){return UV[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let Yu={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:i})=>{const c=i!=null&&i!==n?` (cast from the value \`${qf(i,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${qf(n,!0)}\``+c:`${e} must match the configured type. The validated value was: \`${qf(n,!0)}\``+c}},rl={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},BMe={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},qk={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Xk={isValue:"${path} field must be ${value}"},tE={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path}
4404 object contains unknown properties: ${properties}"},zMe={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},NMe={notType:e=>{const{path:t,value:n,spec:i}=e,c=i.types.length;if(Array.isArray(n)){if(n.length<c)return`${t} tuple value has too few items, expected a length of ${c} but got ${n.length} for value: \`${qf(n,!0)}\``;if(n.length>c)return`${t} tuple value has too many items, expected a length of ${c} but got ${n.length} for value: \`${qf(n,!0)}\``}return Fa.formatError(Yu.notType,e)}};var VMe=Object.assign(Object.create(null),{mixed:Yu,string:rl,number:BMe,date:qk,object:tE,array:zMe,boolean:Xk,tuple:NMe});const NL=e=>e&&e.__isYupSchema__;class eC{static fromOptions(t,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:i,then:c,otherwise:h}=n,m=typeof i=="function"?i:(...a)=>a.every(y=>y===i);return new eC(t,(a,y)=>{var E;let C=m(...a)?c:h;return(E=C?.(y))!=null?E:y})}constructor(t,n){this.fn=void 0,this.refs=t,this.refs=t,this.fn=n}resolve(t,n){let i=this.refs.map(h=>h.getValue(n?.value,n?.parent,n?.context)),c=this.fn(i,t,n);if(c===void 0||c===t)return t;if(!NL(c))throw new TypeError("conditions must return a schema object");return c.resolve(n)}}const zT={context:"$",value:"."};function SDe(e,t){return new cp(e,t)}class cp{constructor(t,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===zT.context,this.isValue=this.key[0]===zT.value,this.isSibling=!this.isContext&&!this.isValue;let i=this.isContext?zT.context:this.isValue?zT.value:"";this.path=this.key.slice(i.length),this.getter=this.path&&Om.getter(this.path,!0),this.map=n.map}getValue(t,n,i){let c=this.isContext?i:this.isValue?t:n;return this.getter&&(c=this.getter(c||{})),this.map&&(c=this.map(c)),c}cast(t,n){return this.getValue(t,n?.parent,n?.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}cp.prototype.__isYupRef=!0;const dh=e=>e==null;function M_(e){function t({value:n,path:i="",options:c,originalValue:h,schema:m},a,y){const{name:E,test:C,params:P,message:L,skipAbsent:D}=e;let{parent:V,context:U,abortEarly:W=m.spec.abortEarly,disableStackTrace:$=m.spec.disableStackTrace}=c;const Y={value:n,parent:V,context:U};function X(lt={}){const pt=MG(Object.assign({value:n,originalValue:h,label:m.spec.label,path:lt.path||i,spec:m.spec,disableStackTrace:lt.disableStackTrace||$},P,lt.params),Y),Qt=new Fa(Fa.formatError(lt.message||L,pt),n,pt.path,lt.type||E,pt.disableStackTrace);return Qt.params=pt,Qt}const K=W?a:y;let ne={path:i,parent:V,type:E,from:c.from,createError:X,resolve(lt){return LG(lt,Y)},options:c,originalValue:h,schema:m};const fe=lt=>{Fa.isError(lt)?K(lt):lt?y(null):K(X())},ye=lt=>{Fa.isError(lt)?K(lt):a(lt)};if(D&&dh(n))return fe(!0);let Fe;try{var qe;if(Fe=C.call(ne,n,ne),typeof((qe=Fe)==null?void 0:qe.then)=="function"){if(c.sync)throw new Error(`Validation test of type: "${ne.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(Fe).then(fe,ye)}}catch(lt){ye(lt);return}fe(Fe)}return t.OPTIONS=e,t}function MG(e,t){if(!e)return e;for(const n of Object.keys(e))e[n]=LG(e[n],t);return e}function LG(e,t){return cp.isRef(e)?e.getValue(t.value,t.parent,t.context):e}function UMe(e,t,n,i=n){let c,h,m;return t?(Om.forEach(t,(a,y,E)=>{let C=y?a.slice(1,a.length-1):a;e=e.resolve({context:i,parent:c,value:n});let P=e.type==="tuple",L=E?parseInt(C,10):0;if(e.innerType||P){if(P&&!E)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${m}" must contain an index to the tuple element, e.g. "${m}[0]"`);if(n&&L>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${a}, in the path: ${t}. because there is no value at that index. `);c=n,n=n&&n[L],e=P?e.spec.types[L]:e.innerType}if(!E){if(!e.fields||!e.fields[C])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${m} which is a type: "${e.type}")`);c=n,n=n&&n[C],e=e.fields[C]}h=C,m=y?"["+a+"]":"."+a}),{schema:e,parent:c,parentPath:h}):{parent:c,parentPath:t,schema:e}}class tC extends Set{describe(){const t=[];for(const n of this.values())t.push(cp.isRef(n)?n.describe():n);return t}resolveAll(t){let n=[];for(const i of this.values())n.push(t(i));return n}clone(){return new tC(this.values())}merge(t,n){const i=this.clone();return t.forEach(c=>
4404i.add(c)),n.forEach(c=>i.delete(c)),i}}function G_(e,t=new Map){if(NL(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let i=0;i<e.length;i++)n[i]=G_(e[i],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(const[i,c]of e.entries())n.set(i,G_(c,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const i of e)n.add(G_(i,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[i,c]of Object.entries(e))n[i]=G_(c,t)}else throw Error(`Unable to clone ${e}`);return n}function $Me(e){if(!(e!=null&&e.length))return;const t=[];let n="",i=!1,c=!1;for(let h=0;h<e.length;h++){const m=e[h];if(m==="["&&!c){n&&(t.push(...n.split(".").filter(Boolean)),n=""),i=!0;continue}if(m==="]"&&!c){n&&(/^\d+$/.test(n)?t.push(n):t.push(n.replace(/^"|"$/g,"")),n=""),i=!1;continue}if(m==='"'){c=!c;continue}if(m==="."&&!i&&!c){n&&(t.push(n),n="");continue}n+=m}return n&&t.push(...n.split(".").filter(Boolean)),t}function jMe(e,t){const n=t?`${t}.${e.path}`:e.path;return e.errors.map(i=>({message:i,path:$Me(n)}))}function OG(e,t){var n;if(!((n=e.inner)!=null&&n.length)&&e.errors.length)return jMe(e,t);const i=t?`${t}.${e.path}`:e.path;return e.inner.flatMap(c=>OG(c,i))}class vc{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new tC,this._blacklist=new tC,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Yu.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t?.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));
4404return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=G_(Object.assign({},this.spec,t)),n}label(t){let n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let i=t(this);return this._mutate=n,i}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,i=t.clone();const c=Object.assign({},n.spec,i.spec);return i.spec=c,i.internalTests=Object.assign({},n.internalTests,i.internalTests),i._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),i._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),i.tests=n.tests,i.exclusiveTests=n.exclusiveTests,i.withMutation(h=>{t.tests.forEach(m=>{h.test(m.OPTIONS)})}),i.transforms=[...n.transforms,...i.transforms],i}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let i=n.conditions;n=n.clone(),n.conditions=[],n=i.reduce((c,h)=>h.resolve(c,t),n),n=n.resolve(t)}return n}resolveOptions(t){var n,i,c,h;return Object.assign({},t,{from:t.from||[],strict:(n=t.strict)!=null?n:this.spec.strict,abortEarly:(i=t.abortEarly)!=null?i:this.spec.abortEarly,recursive:(c=t.recursive)!=null?c:this.spec.recursive,disableStackTrace:(h=t.disableStackTrace)!=null?h:this.spec.disableStackTrace})}cast(t,n={}){let i=this.resolve(Object.assign({},n,{value:t})),c=n.assert==="ignore-optionality",h=i._cast(t,n);if(n.assert!==!1&&!i.isType(h)){if(c&&dh(h))return h;let m=qf(t),a=qf(h);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${i.type}". 4405 4406attempted value: ${m} 4407`+(a!==m?`result of cast: ${a}`:""))}return h}_cast(t,n){let i=t===void 0?t:this.transforms.reduce((c,h)=>h.call(this,c,t,this,n),t);return i===void 0&&(i=this.getDefault(n)),i}_validate(t,n={},i,c){let{path:h,originalValue:m=t,strict:a=this.spec.strict}=n,y=t;a||(y=this._cast(y,Object.assign({assert:!1},n)));let E=[];for(let C of Object.values(this.internalTests))C&&E.push(C);this.runTests({path:h,value:y,originalValue:m,options:n,tests:E},i,C=>{if(C.length)return c(C,y);this.runTests({path:h,value:y,originalValue:m,options:n,tests:this.tests},i,c)})}runTests(t,n,i){let c=!1,{tests:h,value:m,originalValue:a,path:y,options:E}=t,C=U=>{c||(c=!0,n(U,m))},P=U=>{c||(c=!0,i(U,m))},L=h.length,D=[];if(!L)return P([]);let V={value:m,originalValue:a,path:y,options:E,schema:this};for(let U=0;U<h.length;U++){const W=h[U];W(V,C,function(Y){Y&&(Array.isArray(Y)?D.push(...Y):D.push(Y)),--L<=0&&P(D)})}}asNestedTest({key:t,index:n,parent:i,parentPath:c,originalParent:h,options:m}){const a=t??n;if(a==null)throw TypeError("Must include `key` or `index` for nested validations");const y=typeof a=="number";let E=i[a];const C=Object.assign({},m,{strict:!0,parent:i,value:E,originalValue:h[a],key:void 0,[y?"index":"key"]:a,path:y||a.includes(".")?`${c||""}[${y?a:`"${a}"`}]`:(c?`${c}.`:"")+t});return(P,L,D)=>this.resolve(C)._validate(E,C,L,D)}validate(t,n){var i;let c=this.resolve(Object.assign({},n,{value:t})),h=(i=n?.disableStackTrace)!=null?i:c.spec.disableStackTrace;return new Promise((m,a)=>c._validate(t,n,(y,E)=>{Fa.isError(y)&&(y.value=E),a(y)},(y,E)=>{y.length?a(new Fa(y,E,void 0,void 0,h)):m(E)}))}validateSync(t,n){var i;let c=this.resolve(Object.assign({},n,{value:t})),h,m=(i=n?.disableStackTrace)!=null?i:c.spec.disableStackTrace;return c._validate(t,Object.assign({},n,{sync:!0}),(a,y)=>{throw Fa.isError(a)&&(a.value=y),a},(a,y)=>{if(a.length)throw new Fa(a,t,void 0,void 0,m);h=y}),h}isValid(t,n){return this.validate(t,n).then(()=>!0,i=>
4407{if(Fa.isError(i))return!1;throw i})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(i){if(Fa.isError(i))return!1;throw i}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):G_(n)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const i=this.clone({nullable:t});return i.internalTests.nullable=M_({message:n,name:"nullable",test(c){return c===null?this.schema.spec.nullable:!0}}),i}optionality(t,n){const i=this.clone({optional:t});return i.internalTests.optionality=M_({message:n,name:"optionality",test(c){return c===void 0?this.schema.spec.optional:!0}}),i}optional(){return this.optionality(!0)}defined(t=Yu.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=Yu.notNull){return this.nullability(!1,t)}required(t=Yu.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=Yu.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let i=this.clone(),c=M_(n),h=n.exclusive||n.name&&i.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(i.exclusiveTests[n.name]=!!n.exclusive),i.tests=i.tests.filter(m=>!(m.OPTIONS.name===n.name&&(h||m.OPTIONS.test===c.OPTIONS.test))),i.tests.push(c),i}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let i=this.clone(),c=IG(t).map(h=>new cp(h));return c.forEach(h=>{h.isSibling&&i.deps.push(h.key)}),i.conditions.push(typeof n=="function"?new eC(c,n):eC.fromOptions(c,n)),i}typeError(t){let n=this.clone();return n.internalTests.typeError=M_({message:t,name:"typeError",skipAbsent:!0,test(i){return this.schema._typeCheck(i)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(t,n=Yu.oneOf){let i=this.clone();return t.forEach(c=>{i._whitelist.add(c),i._blacklist.delete(c)}),i.internalTests.whiteList=M_({message:n,name:"oneOf",skipAbsent:!0,test(c){let h=this.schema._whitelist,m=h.resolveAll(this.resolve);return m.includes(c)?!0:this.createError({params:{values:Array.from(h).join(", "),resolved:m}})}}),i}notOneOf(t,n=Yu.notOneOf){let i=this.clone();return t.forEach(c=>{i._blacklist.add(c),i._whitelist.delete(c)}),i.internalTests.blacklist=M_({message:n,name:"notOneOf",test(c){let h=this.schema._blacklist,m=h.resolveAll(this.resolve);return m.includes(c)?this.createError({params:{values:Array.from(h).join(", "),resolved:m}}):!0}}),i}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:i,meta:c,optional:h,nullable:m}=n.spec;return{meta:c,label:i,optional:h,nullable:m,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.filter((y,E,C)=>C.findIndex(P=>P.OPTIONS.name===y.OPTIONS.name)===E).map(y=>{const E=y.OPTIONS.params&&t?MG(Object.assign({},y.OPTIONS.params),t):y.OPTIONS.params;return{name:y.OPTIONS.name,params:E}})}}get"~standard"(){const t=this;return{version:1,vendor:"yup",async validate(i){try{return{value:await t.validate(i,{abortEarly:!1})}}catch(c){if(c instanceof Fa)return{issues:OG(c)};throw c}}}}}vc.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])vc.prototype[`${e}At`]=function(t,n,i={}){const{parent:c,parentPath:h,schema:m}=UMe(this,t,n,i.context);return m[e](c&&c[h],Object.assign({},i,{parent:c,path:t}))};for(const e of["equals","is"])vc.prototype[e]=vc.prototype.oneOf;for(const e of["not","nope"])vc.prototype[e]=vc.prototype.notOneOf;const GMe=()=>!0;function HMe(e){return new DG(e)}class DG extends vc{constructor(t){super(typeof t=="function"?{type:"mixed",check:t}:Object.assign({type:"mixed",check:GMe},t))}}HMe.prototype=DG.prototype;function WMe(){return new FG}class FG extends vc{constructor(){super({type:"boolean",check(t){return t instanceof Boolean&&(t=t.valueOf()),typeof t=="boolean"}}),this.withMutation(()=>{this.transform((t,n)=>{if(this.spec.coerce&&!this.isType(t)){if(/^(true|1)$/i.test(String(t)))return!0;
4407if(/^(false|0)$/i.test(String(t)))return!1}return t})})}isTrue(t=Xk.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test(n){return dh(n)||n===!0}})}isFalse(t=Xk.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test(n){return dh(n)||n===!1}})}default(t){return super.default(t)}defined(t){return super.defined(t)}optional(){return super.optional()}required(t){return super.required(t)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(t){return super.nonNullable(t)}strip(t){return super.strip(t)}}WMe.prototype=FG.prototype;const qMe=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function XMe(e){const t=Zk(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let n=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(n=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(n=0-n)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+n,t.second,t.millisecond)}function Zk(e){var t,n;const i=qMe.exec(e);return i?{year:Yd(i[1]),month:Yd(i[2],1)-1,day:Yd(i[3],1),hour:Yd(i[4]),minute:Yd(i[5]),second:Yd(i[6]),millisecond:i[7]?Yd(i[7].substring(0,3)):0,precision:(t=(n=i[7])==null?void 0:n.length)!=null?t:void 0,z:i[8]||void 0,plusMinus:i[9]||void 0,hourOffset:Yd(i[10]),minuteOffset:Yd(i[11])}:null}function Yd(e,t=0){return Number(e)||t}let ZMe=/^[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])?)*$/,YMe=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,KMe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,JMe="^\\d{4}-\\d{2}-\\d{2}",QMe="\\d{2}:\\d{2}:\\d{2}",eLe="(([+-]\\d{2}(:?\\d{2})?)|Z)",tLe=new RegExp(`${JMe}T${QMe}(\\.\\d+)?${eLe}$`),nLe=e=>dh(e)||e===e.trim(),rLe={}.toString();function iLe(){return new BG}class BG extends vc{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n)=>{if(!this.spec.coerce||this.isType(t)||Array.isArray(t))return t;const i=t!=null&&t.toString?t.toString():t;return i===rLe?t:i})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||Yu.required,name:"required",skipAbsent:!0,test:i=>!!i.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=rl.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(i){return i.length===this.resolve(t)}})}min(t,n=rl.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(i){return i.length>=this.resolve(t)}})}max(t,n=rl.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(i){return i.length<=this.resolve(t)}})}matches(t,n){let i=!1,c,h;return n&&(typeof n=="object"?{excludeEmptyString:i=!1,message:c,name:h}=n:c=n),this.test({name:h||"matches",message:c||rl.matches,params:{regex:t},skipAbsent:!0,test:m=>m===""&&i||m.search(t)!==-1})}email(t=rl.email){return this.matches(ZMe,{name:"email",message:t,excludeEmptyString:!0})}url(t=rl.url){return this.matches(YMe,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=rl.uuid){return this.matches(KMe,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let n="",i,c;return t&&(typeof t=="object"?{message:n="",allowOffset:i=!1,precision:c=void 0}=t:n=t),this.matches(tLe,{name:"datetime",message:n||rl.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||rl.datetime_offset,params:{allowOffset:i},skipAbsent:!0,test:h=>{if(!h||i)return!0;const m=Zk(h);return m?!!m.z:!1}}).test({name:"datetime_precision",message:n||rl.datetime_precision,params:{precision:c},skipAbsent:!0,test:h=>{if(!h||c==null)return!0;const m=Zk(h);return m?m.precision===c:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=rl.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:nLe})}lowercase(t=rl.lowercase){return this.transform(n=>dh(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>dh(n)||n===n.toLowerCase()})}uppercase(t=rl.uppercase){return this.transform(n=>dh(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>dh(n)||n===n.toUpperCase()})}}iLe.prototype=BG.prototype;let oLe=new Date(""),sLe=e=>Object.prototype.toString.call(e)==="[object Date]";class VL extends vc{constructor(){super({type:"date",check(t){return sLe(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n)=>!this.spec.coerce||this.isType(t)||t===null?t:(t=XMe(t),isNaN(t)?VL.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let i;if(cp.isRef(t))i=t;else{let c=this.cast(t);if(!this._typeCheck(c))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);i=c}return i}min(t,n=qk.min){let i=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(c){return c>=this.resolve(i)}})}max(t,n=qk.max){let i=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(c){return c<=this.resolve(i)}})}}VL.INVALID_DATE=oLe;function aLe(e,t=[]){let n=[],i=new Set,c=new Set(t.map(([m,a])=>`${m}-${a}`));function h(m,a){let y=Om.split(m)[0];i.add(y),c.has(`${a}-${y}`)||n.push([a,y])}for(const m of Object.keys(e)){let a=e[m];i.add(m),cp.isRef(a)&&a.isSibling?h(a.path,m):NL(a)&&"deps"in a&&a.deps.forEach(y=>h(y,m))}return PMe.array(Array.from(i),n).reverse()}function $V(e,t){let n=1/0;return e.some((i,c)=>{var h;if((h=t.path)!=null&&h.includes(i))return n=c,!0}),n}function zG(e){return(t,n)=>$V(e,t)-$V(e,n)}const lLe=(e,t,n)=>{if(typeof e!="string")return e;let i=e;try{i=JSON.parse(e)}catch{}return n.isType(i)?i:e};function nE(e){if("fields"in e){const t={};for(const[n,i]of Object.entries(e.fields))t[n]=nE(i);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=nE(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(nE)}):"optional"in e?e.optional():e}const cLe=(e,t)=>{const n=[...Om.normalizePath(t)];if(n.length===1)return n[0]in e;let i=n.pop(),c=Om.getter(Om.join(n),!0)(e);return!!(c&&i in c)};let jV=e=>Object.prototype.toString.call(e)==="[object Object]";function GV(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(i=>n.indexOf(i)===-1)}const uLe=zG([]);function dLe(e){return new NG(e)}class NG extends vc{constructor(t){super({type:"object",check(n){return jV(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=uLe,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var i;let c=super._cast(t,n);if(c===void 0)return this.getDefault(n);if(!this._typeCheck(c))return c;let h=this.fields,m=(i=n.stripUnknown)!=null?i:this.spec.noUnknown,a=[].concat(this._nodes,Object.keys(c).filter(P=>!this._nodes.includes(P))),y={},E=Object.assign({},n,{parent:y,__validating:n.__validating||!1}),C=!1;for(const P of a){let L=h[P],D=P in c,V=c[P];if(L){let U;E.path=(n.path?`${n.path}.`:"")+P,L=L.resolve({value:V,context:n.context,parent:y});let W=L instanceof vc?L.spec:void 0,$=W?.strict;if(W!=null&&W.strip){C=C||P in c;continue}U=!n.__validating||!$?L.cast(V,E):V,U!==void 0&&(y[P]=U)}else D&&!m&&(y[P]=V);
4407(D!==P in y||y[P]!==V)&&(C=!0)}return C?y:c}_validate(t,n={},i,c){let{from:h=[],originalValue:m=t,recursive:a=this.spec.recursive}=n;n.from=[{schema:this,value:m},...h],n.__validating=!0,n.originalValue=m,super._validate(t,n,i,(y,E)=>{if(!a||!jV(E)){c(y,E);return}m=m||E;let C=[];for(let P of this._nodes){let L=this.fields[P];!L||cp.isRef(L)||C.push(L.asNestedTest({options:n,key:P,parent:E,parentPath:n.path,originalParent:m}))}this.runTests({tests:C,value:E,originalValue:m,options:n},i,P=>{c(P.sort(this._sortErrors).concat(y),E)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),i=n.fields;for(let[c,h]of Object.entries(this.fields)){const m=i[c];i[c]=m===void 0?h:m}return n.withMutation(c=>c.setFields(i,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let n={};return this._nodes.forEach(i=>{var c;const h=this.fields[i];let m=t;(c=m)!=null&&c.value&&(m=Object.assign({},m,{parent:m.value,value:m.value[i]})),n[i]=h&&"getDefault"in h?h.getDefault(m):void 0}),n}setFields(t,n){let i=this.clone();return i.fields=t,i._nodes=aLe(t,n),i._sortErrors=zG(Object.keys(t)),n&&(i._excludedEdges=n),i}shape(t,n=[]){return this.clone().withMutation(i=>{let c=i._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),c=[...i._excludedEdges,...n]),i.setFields(Object.assign(i.fields,t),c)})}partial(){const t={};for(const[n,i]of Object.entries(this.fields))t[n]="optional"in i&&i.optional instanceof Function?i.optional():i;return this.setFields(t)}deepPartial(){return nE(this)}pick(t){const n={};for(const i of t)this.fields[i]&&(n[i]=this.fields[i]);return this.setFields(n,this._excludedEdges.filter(([i,c])=>t.includes(i)&&t.includes(c)))}omit(t){const n=[];for(const i of Object.keys(this.fields))t.includes(i)||n.push(i);return this.pick(n)}from(t,n,i){let c=Om.getter(t,!0);return this.transform(h=>{if(!h)return h;let m=h;return cLe(h,t)&&(m=Object.assign({},h),i||delete m[t],m[n]=c(h)),m})}json(){return this.transform(lLe)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||tE.exact,test(n){if(n==null)return!0;const i=GV(this.schema,n);return i.length===0||this.createError({params:{properties:i.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,n=tE.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let i=this.test({name:"noUnknown",exclusive:!0,message:n,test(c){if(c==null)return!0;const h=GV(this.schema,c);return!t||h.length===0||this.createError({params:{unknown:h.join(", ")}})}});return i.spec.noUnknown=t,i}unknown(t=!0,n=tE.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const i={};for(const c of Object.keys(n))i[t(c)]=n[c];return i})}camelCase(){return this.transformKeys(DP.camelCase)}snakeCase(){return this.transformKeys(DP.snakeCase)}constantCase(){return this.transformKeys(t=>DP.snakeCase(t).toUpperCase())}describe(t){const n=(t?this.resolve(t):this).clone(),i=super.describe(t);i.fields={};for(const[h,m]of Object.entries(n.fields)){var c;let a=t;(c=a)!=null&&c.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[h]})),i.fields[h]=m.describe(a)}return i}}dLe.prototype=NG.prototype;function hLe(e){Object.keys(e).forEach(t=>{Object.keys(e[t]).forEach(n=>{VMe[t][n]=e[t][n]})})}const fLe={mixed:{required:"ÙØ°Ø§ Ø§ÙØÙÙ Ù
Ø·ÙÙØ¨",oneOf:({values:e})=>`ÙØ¬Ø¨ Ø£Ù ÙÙÙÙ ÙØ§ØØ¯Ùا Ù
٠اÙÙÙÙ
Ø§ÙØªØ§ÙÙØ©: ${e.join(", ")}`,notOneOf:({values:e})=>`ÙØ§ ÙØ¬Ø¨ Ø£Ù ÙÙÙÙ ÙØ§ØØ¯Ùا Ù
٠اÙÙÙÙ
Ø§ÙØªØ§ÙÙØ©: ${e.join(", ")}`},string:{min:({min:e})=>`ÙØ¬Ø¨ Ø£Ù ÙÙÙ٠عÙÙ Ø§ÙØ£ÙÙ ${e} Ø£ØØ±Ù`,max:({max:e})=>`ÙØ¬Ø¨ Ø£ÙØ§ ÙØ²Ùد ع٠${e} Ø£ØØ±Ù`,email:"ÙØ¬Ø¨ Ø£Ù ÙÙÙÙ Ø¨Ø±ÙØ¯ Ø¥ÙÙØªØ±ÙÙ٠صØÙØ",url:"ÙØ¬Ø¨ Ø£Ù ÙÙÙ٠رابط ÙÙØ¨ صØÙØ",uuid:"ÙØ¬Ø¨ Ø£Ù ÙÙÙÙ UUID صØÙØ",trim:"ÙØ¬Ø¨ Ø£ÙØ§ ÙØØªÙ٠عÙÙ Ù
Ø³Ø§ÙØ§Øª بادئة أ٠ختاÙ
ÙØ©",lowercase:"ÙØ¬Ø¨ Ø£Ù ÙÙÙÙ Ø¨Ø§ÙØ£ØØ±Ù Ø§ÙØµØºÙرة",uppercase:"ÙØ¬Ø¨ Ø£Ù ÙÙÙÙ Ø¨Ø§ÙØ£ØØ±Ù اÙÙØ¨Ùرة"},number:{min:({min:e})=>`ÙØ¬Ø¨ Ø£Ù ÙÙÙÙ Ø§ÙØ±ÙÙ
عÙÙ Ø§ÙØ£ÙÙ ${e}`,max:({max:e})=>`ÙØ¬Ø¨ Ø£ÙØ§ ÙØ²Ùد Ø§ÙØ±ÙÙ
ع٠${e}`,positive:"ÙØ¬Ø¨ Ø£Ù ÙÙÙ٠رÙÙ
ÙØ§ Ù
ÙØ¬Ø¨Ùا",negative:"ÙØ¬Ø¨ Ø£Ù ÙÙÙ٠رÙÙ
ÙØ§ Ø³Ø§ÙØ¨Ùا",integer:"ÙØ¬Ø¨ Ø£Ù ÙÙÙÙ Ø¹Ø¯Ø¯ÙØ§ صØÙØÙا"},date:{min:({min:e})=>`ÙØ¬Ø¨ Ø£Ù ÙÙÙÙ Ø§ÙØªØ§Ø±ÙØ® بعد ${e}`,max:({max:e})=>`ÙØ¬Ø¨ Ø£Ù ÙÙÙÙ Ø§ÙØªØ§Ø±ÙØ® ÙØ¨Ù ${e}`},array:{min:({min:e})=>`ÙØ¬Ø¨ Ø£Ù ÙØØªÙ٠عÙÙ Ø§ÙØ£Ù٠عÙÙ ${e} Ø¹ÙØ§ØµØ±`,max:({max:e})=>`ÙØ¬Ø¨ Ø£ÙØ§ ÙØØªÙ٠عÙÙ Ø£ÙØ«Ø± Ù
Ù ${e} Ø¹ÙØ§ØµØ±`}},pLe={mixed:{required:"This field is required",oneOf:({values:e})=>`Must be one of the following values: ${e.join(", ")}`,notOneOf:({values:e})=>`Must not be one of the following values: ${e.join(", ")}`},string:{min:({min:e})=>`Must be at least ${e} characters`,max:({max:e})=>`Must not exceed ${e}
4407 characters`,email:"Must be a valid email",url:"Must be a valid URL",uuid:"Must be a valid UUID",trim:"Must not contain leading or trailing spaces",lowercase:"Must be lowercase",uppercase:"Must be uppercase"},number:{min:({min:e})=>`Must be at least ${e}`,max:({max:e})=>`Must not exceed ${e}`,positive:"Must be a positive number",negative:"Must be a negative number",integer:"Must be an integer"},date:{min:({min:e})=>`Must be after ${e}`,max:({max:e})=>`Must be before ${e}`},array:{min:({min:e})=>`Must contain at least ${e} items`,max:({max:e})=>`Must not contain more than ${e} items`}};function HV(e="ar"){hLe(e==="en"?pLe:fLe)}const mLe={__name:"SharedModalsModalManager",setup(e){const t=zC(),n={[_o.CONFIRMATION]:Nt(()=>gt(()=>import("./Dc9uM4pG.js"),__vite__mapDeps([216,54,217,182,30,10,31,36,51]),import.meta.url)),[_o.SHARE_CHAT]:Nt(()=>gt(()=>import("./BQrMc-Im.js"),__vite__mapDeps([218,46,47,5,6,48,49,50,36,51,52,53,7,8,54,55,56,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,37,38,57,40,58,59,60,61,62,63,64,217,182]),import.meta.url)),[_o.ADD_CHAT_TO_COLLECTION]:Nt(()=>gt(()=>import("./RUL44rm0.js"),__vite__mapDeps([219,220,102,103,105,221,217,182,30,10,31,36,51,56]),import.meta.url)),[_o.ADD_COLLECTION]:Nt(()=>gt(()=>import("./BOR_9qKf.js"),__vite__mapDeps([222,223,19,20,21,160,54,217,182,30,10,31,36,51]),import.meta.url)),[_o.EDIT_COLLECTION]:Nt(()=>gt(()=>import("./DpZVG-tC.js"),__vite__mapDeps([224,19,20,21,160,54,217,182,30,10,31,36,51,223]),import.meta.url)),[_o.PHONE_VERIFICATION]:Nt(()=>gt(()=>import("./B23p-bMC.js"),__vite__mapDeps([225,226,108,19,20,21,190,54,113,217,182,30,10,31,36,51,109,4,227]),import.meta.url)),[_o.EMAIL_VERIFICATION]:Nt(()=>gt(()=>import("./Cpuy-AEC.js"),__vite__mapDeps([228,226,108,19,20,21,190,54,113,119,217,182,30,10,31,36,51,4,229]),import.meta.url)),[_o.REGISTRATION_SUCCESS]:Nt(()=>gt(()=>import("./DAbtZ9wj.js"),__vite__mapDeps([230,217,182,30,10,31,36,51]),import.meta.url)),[_o.SWAP_COLLECTION]:Nt(()=>gt(()=>import("./t2b6Us2U.js"),__vite__mapDeps([231,220,102,103,105,217,182,30,10,31,36,51,56]),import.meta.url)),[_o.RESPONSE_FEEDBACK]:Nt(()=>gt(()=>import("./B8bsCO9G.js"),__vite__mapDeps([232,217,182,30,10,31,36,51,160,20,21,74,75,54]),import.meta.url)),[_o.UPGRADE_PLAN]:Nt(()=>gt(()=>import("./BVaHL8xf.js"),__vite__mapDeps([233,217,182,30,10,31,36,51,62,55,126,41,127]),import.meta.url)),[_o.TERMS_AND_CONDITIONS]:Nt(()=>gt(()=>import("./BitmIHV5.js"),__vite__mapDeps([234,217,182,30,10,31,36,51,54]),import.meta.url)),[_o.SUPPORT_REQUEST]:Nt(()=>gt(()=>import("./DB77rXod.js"),__vite__mapDeps([235,217,182,30,10,31,36,51,113,134,116,19,20,21,236,237,160,190,54,238]),import.meta.url)),[_o.CONTACT_REQUEST]:Nt(()=>gt(()=>import("./Cs5TymdA.js"),__vite__mapDeps([239,217,182,30,10,31,36,51,113,134,116,19,20,21,236,237,160,190,13,6,14,15,16,17,18,22,23,124,240]),import.meta.url)),[_o.EDIT_PROPERTY_EXPLORER]:Nt(()=>gt(()=>import("./tX2sXAb_.js"),__vite__mapDeps([241,5,6,19,20,21,24,25,26,54,217,182,30,10,31,36,51]),import.meta.url)),[_o.FREEMIUM_CHAT_LIMIT_WARNING]:Nt(()=>gt(()=>import("./BA-GXItJ.js"),__vite__mapDeps([242,54,217,182,30,10,31,36,51]),import.meta.url)),[_o.ATTACHMENT_PREVIEW]:Nt(()=>gt(()=>import("./zAD4UtDj.js"),__vite__mapDeps([243,217,182,30,10,31,36,51,52]),import.meta.url)),[_o.PHOTO_GALLERY]:Nt(()=>gt(()=>import("./D1dcB4mo.js"),__vite__mapDeps([244,217,182,30,10,31,36,51,56]),import.meta.url)),[_o.SEARCH]:Nt(()=>gt(()=>import("./TvD2-JdQ.js"),__vite__mapDeps([245,217,182,30,10,31,36,51,73,205,104,75,87]),import.meta.url)),[_o.GENERATE_CHART]:Nt(()=>gt(()=>import("./BcSTZK1W.js"),__vite__mapDeps([246,63,122,207,217,182,30,10,31,36,51,247]),import.meta.url)),[_o.DELETE_ACCOUNT]:Nt(()=>gt(()=>import("./DWpd53PR.js"),__vite__mapDeps([248,217,182,30,10,31,36,51,54,73]),import.meta.url))},i=vn(()=>{if(!t.currentModal)return null;const h=n[t.currentModal];return h||(console.error(`Modal component not found for type: ${t.currentModal}`),null)}),c=async()=>{await t.close()};return uM((h,m,a)=>(console.error("Error in modal component:",h,a),t.close(),!1)),(h,m)=>Ar(t).isOpen&&Ar(t).currentModal?(ei(),ds("div",{key:Ar(t).currentModal},[Ar(i)?(ei(),Ss(wm(Ar(i)),{key:0,data:Ar(t).modalData,onClose:c},null,40,["data"])):Zf("",!0)])):Zf("",!0)}},WV={map_modeling:{kind:"component",component:Nt(()=>gt(()=>import("./JYVGTfOD.js"),__vite__mapDeps([249,250,182,30,10,31,36,51,251,209,83]),import.meta.url))},paseet_mobile_app:{kind:"component",component:Nt(()=>gt(()=>import("./Cw4AevCT.js"),__vite__mapDeps([252,42,250,182,30,10,31,36,51]),import.meta.url))},property_explorer:{kind:"component",component:Nt(()=>gt(()=>import("./CJKWFg2R.js"),__vite__mapDeps([253,250,182,30,10,31,36,51,251,209,83]),import.meta.url))},paseet_x:{kind:"component",component:Nt(()=>gt(()=>import("./BNuFq9wz.js"),__vite__mapDeps([254,250,182,30,10,31,36,51]),import.meta.url))}},gLe=Ys({__name:"AnnouncementManager",setup(e){const t=Vj(),n=zC(),i=vn(()=>n.isOpen||t.suppressedUntilReload||!t.hasActive?null:WV[t.currentAnnouncement.announcement_tag]?.component??null);return qr(()=>t.currentAnnouncement,c=>{c&&(WV[c.announcement_tag]||t.advance())},{immediate:!0}),(c,h)=>i.value?(ei(),Ss(wm(i.value),{key:0})):Zf("",!0)}}),_Le=Object.assign(gLe,{__name:"AnnouncementsAnnouncementManager"}),yLe={__name:"app",setup(e){const t=Nm();return HV(t.lang),qr(()=>t.lang,n=>{HV(n)}),(n,i)=>{const c=TRe,h=RRe,m=TMe;return ei(),ds(jo,null,[Ai(h,null,{default:hh(()=>[Ai(c)]),_:1}),(ei(),Ss(kU,{to:"body"}
4407,[Ai(m),Ai(mLe),Ai(_Le)]))],64)}}},vLe=Ys({name:"NuxtLinkLocale",props:{...fz.props,locale:{type:String,default:void 0,required:!1}},setup(e,{slots:t}){const n=C9(),i=vn(()=>{const a=e.to||e.href||"";return typeof a=="string"&&bc(a,{acceptRelative:!0})}),c=vn(()=>{const a=e.to??e.href,y=a!=null?n(a,e.locale):a;return y&&gi(e.to)&&(y.state=e.to?.state),a!=null?y:a}),h=vn(()=>{if(e.external)return!0;const a=e.to||e.href||"";return gi(a)?!1:a===""||i.value}),m=()=>{const a={...e};return h.value||(a.to=c.value),delete a.href,delete a.locale,a};return()=>Io(fz,m(),t.default)}}),FP=""+new URL("paseet-logo-dark.D-jgwjfK.svg",import.meta.url).href,BP=""+new URL("paseet-logo-light.DinwQqP3.svg",import.meta.url).href,bLe="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Layer_1'%20data-name='Layer%201'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20401.17%20267.08'%3e%3cdefs%3e%3clinearGradient%20id='linear-gradient'%20x1='35.95'%20y1='1374.68'%20x2='401.17'%20y2='1374.68'%20gradientTransform='translate(0%201545.9)%20scale(1%20-1)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%2300c8f5'/%3e%3cstop%20offset='1'%20stop-color='%2300e1c4'/%3e%3c/linearGradient%3e%3c/defs%3e%3cpath%20d='M401.15,75.36c0,105.89-46.75,191.72-152.64,191.72h-116.71c-26.48,0-50.44-10.74-67.78-28.07-17.34-17.35-28.07-41.31-28.07-67.78,0-18.45,5.21-35.69,14.25-50.31l8.3,21.58c2.43,10.07,16.74,10.07,19.16,0l8.45-22.11c4.14-14.56,11.39-22.41,15.77-26.26,10.8-9.51,23.5-11.76,45.15-15.6,10.76-1.91,19.81-2.75,26.13-3.17h228.01-.02Z'%20fill='url(%23linear-gradient)'/%3e%3cpath%20d='M161.54,178.32c0,10.25-8.27,18.52-18.52,18.52s-18.52-8.27-18.52-18.52,8.27-18.52,18.52-18.52,18.52,8.35,18.52,18.52Z'%20fill='%23fff'/%3e%3cpath%20d='M226.24,178.32c0,10.25-8.35,18.52-18.52,18.52s-18.52-8.27-18.52-18.52,8.27-18.52,18.52-18.52,18.52,8.35,18.52,18.52Z'%20fill='%23fff'/%3e%3cpath%20d='M290.95,178.32c0,10.25-8.35,18.52-18.52,18.52s-18.52-8.27-18.52-18.52,8.27-18.52,18.52-18.52,18.52,8.35,18.52,18.52Z'%20fill='%23fff'/%3e%3cpath%20d='M61.29,19.4l4.35-17.55c.61-2.47,4.12-2.47,4.73,0l4.35,17.55c5.12,20.65,21.24,36.77,41.89,41.89l17.55,4.35c2.47.61,2.47,4.12,0,4.73l-17.55,4.35c-20.65,5.12-36.77,21.24-41.89,41.89l-4.35,17.55c-.61,2.47-4.12,2.47-4.73,0l-4.35-17.55c-5.12-20.65-21.24-36.77-41.89-41.89l-17.55-4.35c-2.47-.61-2.47-4.12,0-4.73l17.55-4.35c20.65-5.12,36.77-21.24,41.89-41.89Z'%20fill='%23efbf04'/%3e%3c/svg%3e",xLe
4407=["src","alt"],wLe=Ys({inheritAttrs:!1,__name:"PaseetLogo",props:{alt:{default:"Paseet Logo"},additionalClasses:{default:""},simple:{type:Boolean,default:!1},variant:{}},setup(e){const t=e,n=vn(()=>{if(t.simple)return bLe;if(t.variant){if(t.variant==="dark")return FP;if(t.variant==="light")return BP}switch(Nm().appliedTheme){case tu.theme.DARK:return FP;case tu.theme.LANDING_PAGE:return FP;case tu.theme.LIGHT:return BP;default:return BP}});return(i,c)=>(ei(),ds("img",zo({src:n.value,alt:e.alt,class:["paseet-logo",e.additionalClasses]},i.$attrs),null,16,xLe))}}),SLe=(e,t)=>{const n=e.__vccOpts||e;for(const[i,c]of t)n[i]=c;return n},TLe=Object.assign(SLe(wLe,[["__scopeId","data-v-1d8a8890"]]),{__name:"SharedPaseetLogo"}),ELe={class:"flex min-h-dvh flex-col items-center justify-center gap-8 bg-canvas px-4 py-16 text-center"},CLe={class:"flex w-full max-w-md flex-col gap-3"},ALe={class:"text-balance text-2xl font-semibold text-fg"},ILe={class:"text-pretty break-words text-base leading-relaxed text-muted"},PLe=Ys({__name:"error",props:{error:{}},setup(e){const t=e,{t:n,locale:i}=Xx(),{$logger:c}=rr(),h={404:{title:"error.not_found.title",message:"error.not_found.message"},403:{title:"error.forbidden.title",message:"error.forbidden.message"},401:{title:"error.unauthorized.title",message:"error.unauthorized.message"},500:{title:"error.server_error.title",message:"error.server_error.message"}},m=vn(()=>n(h[t.error.statusCode]?.title??"error.general.title")),a=vn(()=>{const E=h[t.error.statusCode];return E?n(E.message):t.error.message||n("error.general.message")}),y=vn(()=>`${n("SEO.title")} | ${m.value}`);return Cy({title:y,htmlAttrs:{lang:i.value,dir:i.value==="ar"?"rtl":"ltr"},bodyAttrs:{style:"background-color: var(--color-bg)"}}),cu(()=>{c.debug("error",t.error)}),(E,C)=>{const P=Nee,L=vLe;return ei(),ds("div",ELe,[Ai(P,null,{fallback:hh(()=>[...C[0]||(C[0]=[Go("div",{class:"h-10","aria-hidden":"true"},null,-1)])]),default:hh(()=>[Ai(TLe,{alt:"Paseet","additional-classes":"h-10 w-auto"})]),_:1}),Go("div",CLe,[Go("h1",ALe,Cm(m.value),1),Go("p",ILe,Cm(a.value),1)]),Ai(L,{to:"/",external:"",class:"inline-flex items-center gap-2 rounded-lg bg-brand px-5 py-2.5 text-sm font-semibold text-on-brand no-underline transition-[filter] duration-150 hover:brightness-95 active:brightness-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-fg)] focus-visible:ring-offset-2 focus-visible:ring-offset-canvas motion-reduce:transition-none pointer-coarse:min-h-11"},{default:hh(()=>[C[1]||(C[1]=Go("i",{class:"pi pi-home",style:{fontSize:"var(--p-text-sm)"},"aria-hidden":"true"},null,-1)),Go("span",null,Cm(Ar(n)("common.go_home")),1)]),_:1})])}}}),RLe={key:0},qV={__name:"nuxt-root",setup(e){const t=()=>null,n=rr(),i=n.deferHydration();if(n.isHydrating){const C=n.hooks.hookOnce("app:error",i),P=ps().beforeEach(()=>{C(),P()})}const c=!1;fh(zm,wM()),n.hooks.callHookWith(C=>C.map(P=>P()),"vue:setup",[]);const h=Mx(),m=!1,a=/bot\b|chrome-lighthouse|facebookexternalhit|google\b/i;function y(C,P,L){const D=n.vueApp.config.errorHandler;if(D&&!D.__nuxt_default)try{D(C,P,L)}catch(V){console.error("[nuxt] Error in `app.config.errorHandler`",V)}}uM((C,P,L)=>{if(n.hooks.callHook("vue:error",C,P,L)?.catch(D=>console.error("[nuxt] Error in `vue:error` hook",D)),a.test(navigator.userAgent))return n.hooks.callHook("app:error",C),console.error(`[nuxt] Not rendering error page for bot with user agent \`${navigator.userAgent}\`:`,C),!1;if(W$(C)&&(C.fatal||C.unhandled))return n.runWithContext(()=>_m(C)),y(C,P,L),!1});const E=!1;return(C,P)=>(ei(),Ss(gM,{onResolve:Ar(i)},{default:hh(()=>[Ar(m)?(ei(),ds("div",RLe)):Ar(h)?(ei(),Ss(Ar(PLe),{key:1,error:Ar(h)},null,8,["error"])):Ar(E)?(ei(),Ss(Ar(t),{key:2,context:Ar(E)},null,8,["context"])):Ar(c)?(ei(),Ss(wm(Ar(c)),{key:3})):(ei(),Ss(Ar(yLe),{key:4}))]),_:1},8,["onResolve"]))}};let XV;{let e;XV=async function(){if(e)return e;const n=!!(window.__NUXT__?.serverRendered??document.getElementById("__NUXT_DATA__")?.dataset.ssr==="true"),i=n?NY(qV):zY(qV),c=KK({vueApp:i});async function h(m){await c.callHook("app:error",m),c.payload.error||=jf(m)}h.__nuxt_default=!0,i.config.errorHandler=h,c.hook("app:suspense:resolve",()=>{i.config.errorHandler===h&&(i.config.errorHandler=void 0)}),!n&&p3.id&&c.hook("app:suspense:resolve",()=>{document.getElementById(p3.id)?.remove()});try{await eJ(c,wRe)}catch(m){h(m)}try{await c.hooks.callHook("app:created",i),await c.hooks.callHook("app:beforeMount",i),i.mount(XK),await c.hooks.callHook("app:mounted",i),await ts()}catch(m){h(m)}return i},e=XV().catch(t=>{throw console.error("Error while mounting app:",t),t})}export{$T as $,cC as A,uC as B,OLe as C,Ey as D,zZ as E,Io as F,jo as G,Ty as H,Go as I,Xx as J,rr as K,Nm as L,HLe as M,Yf as N,Cy as O,Ai as P,d$ as Q,Cm as R,ly as S,dX as T,XZ as U,V_ as V,SLe as W,_Z as X,WX as Y,zY as Z,Nee as _,Ds as a,AY as a$,Db as a0,kU as a1,tu as a2,YLe as a3,qo as a4,wie as a5,yie as a6,zC as a7,_o as a8,Hoe as a9,dj as aA,qoe as aB,sOe as aC,jte as aD,F_ as aE,Ax as aF,VLe as aG,oOe as aH,zLe as aI,wm as aJ,Kte as aK,cOe as aL,Zte as aM,Xs as aN,NLe as aO,O$ as aP,BLe as aQ,FLe as aR,dLe as aS,iLe as aT,Fa as aU,Woe as aV,sDe as aW,HMe as aX,Ete as aY,zj as aZ,iOe as a_,vLe as aa,TLe as ab,CC as ac,p6 as ad,ps as ae,Kpe as af,Joe as ag,wh as ah,Qoe as ai,eOe as aj,xa as ak,wM as al,Zoe as am,koe as an,XLe as ao,qLe as ap,zm as aq,Dl as ar,Y6 as as,MLe as at,jLe as au,$Le as av,Ox as aw,Gr as ax,aY as ay,Bo as az,cu as b,vme as b$,Yoe as b0,WMe as b1,fz as b2,GLe as b3,$f as b4,jf as b5,W$ as b6,Vo as b7,Qi as b8,jke as b9,z9 as bA,Sme as bB,DOe as bC,B9 as bD,bOe as bE,KLe as bF,DLe as bG,dZ as bH,cM as bI,hs as bJ,od as bK,Iy as bL,kf as bM,pme as bN,hL as bO,uL as bP,_me as bQ,yme as bR,wme as bS,xme as bT,MOe as bU,Kr as bV,Dk as bW,TOe as bX,N9 as bY,Eme as bZ,Tme as b_,CG as ba,wG as bb,cL as bc,vOe as bd,F9 as be,LOe as bf,P9 as bg,ZOe as bh,ROe as bi,D9 as bj,POe as bk,dP as bl,bme as bm,ad as bn,hk as bo,cE as bp,gZ as bq,BL as br,xOe as bs,cl as bt,Cme as bu,fk as bv,Vb as bw,n1 as bx,$9 as by,wOe as bz,vn as c,gt as c$,AOe as c0,_Oe as c1,kOe as c2,WOe as c3,ua as c4,eDe as c5,tDe as c6,EOe as c7,BOe as c8,zOe as c9,IOe as cA,QOe as cB,COe as cC,sp as cD,tOe as cE,nZ as cF,WLe as cG,SDe as cH,$k as cI,UOe as cJ,JC as cK,kl as cL,YOe as cM,KOe as cN,M9 as cO,ON as cP,DN as cQ,U9 as cR,yOe as cS,Bk as cT,Nk as cU,JOe as cV,$Oe as cW,hme as cX,SOe as cY,xR as cZ,Nt as c_,OOe as ca,jOe as cb,NOe as cc,XOe as cd,gN as ce,mN as cf,Zx as cg,gOe as ch,FOe as ci,qOe as cj,GOe as ck,VOe as cl,LLe as cm,aOe as cn,Fl as co,lOe as cp,Ix as cq,ULe as cr,Bj as cs,hj as ct,xie as cu,HI as cv,DR as cw,Aj as cx,gb as cy,HOe as cz,Vi as d,nOe as d0,Nj as d1,Vj as d2,Ob as d3,rOe as d4,XI as d5,boe as d6,aM as d7,cx as d8,oi as d9,di as da,Hi as db,co as dc,wb as dd,Br as de,Ts as df,Ro as dg,ba as dh,IIe as di,zIe as dj,GIe as dk,Ik as dl,TRe as dm,JLe as dn,QLe as dp,Qb as dq,hOe as dr,uOe as ds,fOe as dt,dOe as du,pOe as dv,qi as e,AU as f,ld as g,Wm as h,wo as i,ny as j,Ys as k,ei as l,ds as m,ts as n,Dm as o,fh as p,Ss as q,hn as r,nM as
4407s,ii as t,Ar as u,hh as v,qr as w,OB as x,zo as y,Zf as z};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.