PageSourceSearch

https://www.fahrradwien.at/projektkarte/assets/index-DC9f3_ij.js

js fahrradwien.at collected 2026-10-02 07:46:31 UTC 1,130,557 bytes, 748 lines download raw bytes

vendor: 3,620 bytes, lines 1-8
1(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const b of document.querySelectorAll('link[rel="modulepreload"]'))_(b);new MutationObserver(b=>{for(const M of b)if(M.type==="childList")for(const x of M.addedNodes)x.tagName==="LINK"&&x.rel==="modulepreload"&&_(x)}).observe(document,{childList:!0,subtree:!0});function p(b){const M={};return b.integrity&&(M.integrity=b.integrity),b.referrerPolicy&&(M.referrerPolicy=b.referrerPolicy),b.crossOrigin==="use-credentials"?M.credentials="include":b.crossOrigin==="anonymous"?M.credentials="omit":M.credentials="same-origin",M}function _(b){if(b.ep)return;b.ep=!0;const M=p(b);fetch(b.href,M)}})();/**
2* @vue/shared v3.5.13
3* (c) 2018-present Yuxi (Evan) You and Vue contributors
4* @license MIT
5**//*! #__NO_SIDE_EFFECTS__ */function Df(l){const n=Object.create(null);for(const p of l.split(","))n[p]=1;return p=>p in n}const br={},Sl=[],nn=()=>{},w0=()=>!1,yp=l=>l.charCodeAt(0)===111&&l.charCodeAt(1)===110&&(l.charCodeAt(2)>122||l.charCodeAt(2)<97),Lf=l=>l.startsWith("onUpdate:"),Di=Object.assign,Ff=(l,n)=>{const p=l.indexOf(n);p>-1&&l.splice(p,1)},T0=Object.prototype.hasOwnProperty,nr=(l,n)=>T0.call(l,n),Rt=Array.isArray,Ml=l=>vp(l)==="[object Map]",ny=l=>vp(l)==="[object Set]",Lt=l=>typeof l=="function",ui=l=>typeof l=="string",Bn=l=>typeof l=="symbol",$r=l=>l!==null&&typeof l=="object",ay=l=>($r(l)||Lt(l))&&Lt(l.then)&&Lt(l.catch),oy=Object.prototype.toString,vp=l=>oy.call(l),S0=l=>vp(l).slice(8,-1),ly=l=>vp(l)==="[object Object]",Bf=l=>ui(l)&&l!=="NaN"&&l[0]!=="-"&&""+parseInt(l,10)===l,lu=Df(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),xp=l=>{const n=Object.create(null);return p=>n[p]||(n[p]=l(p))},M0=/-(\w)/g,Is=xp(l=>l.replace(M0,(n,p)=>p?p.toUpperCase():"")),P0=/\B([A-Z])/g,vo=xp(l=>l.replace(P0,"-$1").toLowerCase()),bp=xp(l=>l.charAt(0).toUpperCase()+l.slice(1)),qd=xp(l=>l?`on${bp(l)}`:""),ga=(l,n)=>!Object.is(l,n),Gd=(l,...n)=>{for(let p=0;p<l.length;p++)l[p](...n)},cy=(l,n,p,_=!1)=>{Object.defineProperty(l,n,{configurable:!0,enumerable:!1,writable:_,value:p})},I0=l=>{const n=parseFloat(l);return isNaN(n)?l:n};let n_;const wp=()=>n_||(n_=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Of(l){if(Rt(l)){const n={};for(let p=0;p<l.length;p++){const _=l[p],b=ui(_)?k0(_):Of(_);if(b)for(const M in b)n[M]=b[M]}return n}else if(ui(l)||$r(l))return l}const C0=/;(?![^(]*\))/g,E0=/:([^]+)/,A0=/\/\*[^]*?\*\//g;function k0(l){const n={};return l.replace(A0,"").split(C0).forEach(p=>{if(p){const _=p.split(E0);_.length>1&&(n[_[0].trim()]=_[1].trim())}}),n}function co(l){let n="";if(ui(l))n=l;else if(Rt(l))for(let p=0;p<l.length;p++){const _=co(l[p]);_&&(n+=_+" ")}else if($r(l))for(const p in l)l[p]&&(n+=p+" ");return n.trim()}const z0="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",R0=Df(z0);function uy(l){return!!l||l===""}const hy=l=>!!(l&&l.__v_isRef===!0),Qs=l=>ui(l)?l:l==null?"":Rt(l)||$r(l)&&(l.toString===oy||!Lt(l.toString))?hy(l)?Qs(l.value):JSON.stringify(l,py,2):String(l),py=(l,n)=>hy(n)?py(l,n.value):Ml(n)?{[`Map(${n.size})`]:[...n.entries()].reduce((p,[_,b],M)=>(p[Hd(_,M)+" =>"]=b,p),{})}:ny(n)?{[`Set(${n.size})`]:[...n.values()].map(p=>Hd(p))}:Bn(n)?Hd(n):$r(n)&&!Rt(n)&&!ly(n)?String(n):n,Hd=(l,n="")=>{var p;return Bn(l)?`Symbol(${(p=l.description)!=null?p:n})`:l};/**
6* @vue/reactivity v3.5.13
7* (c) 2018-present Yuxi (Evan) You and Vue contributors
8* @license MIT
vendor: 5,366 bytes, line 9
9**/let qi;class dy{constructor(n=!1){this.detached=n,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=qi,!n&&qi&&(this.index=(qi.scopes||(qi.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let n,p;if(this.scopes)for(n=0,p=this.scopes.length;n<p;n++)this.scopes[n].pause();for(n=0,p=this.effects.length;n<p;n++)this.effects[n].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let n,p;if(this.scopes)for(n=0,p=this.scopes.length;n<p;n++)this.scopes[n].resume();for(n=0,p=this.effects.length;n<p;n++)this.effects[n].resume()}}run(n){if(this._active){const p=qi;try{return qi=this,n()}finally{qi=p}}}on(){qi=this}off(){qi=this.parent}stop(n){if(this._active){this._active=!1;let p,_;for(p=0,_=this.effects.length;p<_;p++)this.effects[p].stop();for(this.effects.length=0,p=0,_=this.cleanups.length;p<_;p++)this.cleanups[p]();if(this.cleanups.length=0,this.scopes){for(p=0,_=this.scopes.length;p<_;p++)this.scopes[p].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!n){const b=this.parent.scopes.pop();b&&b!==this&&(this.parent.scopes[this.index]=b,b.index=this.index)}this.parent=void 0}}}function fy(l){return new dy(l)}function my(){return qi}function D0(l,n=!1){qi&&qi.cleanups.push(l)}let xr;const Wd=new WeakSet;class gy{constructor(n){this.fn=n,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,qi&&qi.active&&qi.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Wd.has(this)&&(Wd.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||yy(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,a_(this),vy(this);const n=xr,p=js;xr=this,js=!0;try{return this.fn()}finally{xy(this),xr=n,js=p,this.flags&=-3}}stop(){if(this.flags&1){for(let n=this.deps;n;n=n.nextDep)Vf(n);this.deps=this.depsTail=void 0,a_(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Wd.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){df(this)&&this.run()}get dirty(){return df(this)}}let _y=0,cu,uu;function yy(l,n=!1){if(l.flags|=8,n){l.next=uu,uu=l;return}l.next=cu,cu=l}function Nf(){_y++}function jf(){if(--_y>0)return;if(uu){let n=uu;for(uu=void 0;n;){const p=n.next;n.next=void 0,n.flags&=-9,n=p}}let l;for(;cu;){let n=cu;for(cu=void 0;n;){const p=n.next;if(n.next=void 0,n.flags&=-9,n.flags&1)try{n.trigger()}catch(_){l||(l=_)}n=p}}if(l)throw l}function vy(l){for(let n=l.deps;n;n=n.nextDep)n.version=-1,n.prevActiveLink=n.dep.activeLink,n.dep.activeLink=n}function xy(l){let n,p=l.depsTail,_=p;for(;_;){const b=_.prevDep;_.version===-1?(_===p&&(p=b),Vf(_),L0(_)):n=_,_.dep.activeLink=_.prevActiveLink,_.prevActiveLink=void 0,_=b}l.deps=n,l.depsTail=p}function df(l){for(let n=l.deps;n;n=n.nextDep)if(n.dep.version!==n.version||n.dep.computed&&(by(n.dep.computed)||n.dep.version!==n.version))return!0;return!!l._dirty}function by(l){if(l.flags&4&&!(l.flags&16)||(l.flags&=-17,l.globalVersion===gu))return;l.globalVersion=gu;const n=l.dep;if(l.flags|=2,n.version>0&&!l.isSSR&&l.deps&&!df(l)){l.flags&=-3;return}const p=xr,_=js;xr=l,js=!0;try{vy(l);const b=l.fn(l._value);(n.version===0||ga(b,l._value))&&(l._value=b,n.version++)}catch(b){throw n.version++,b}finally{xr=p,js=_,xy(l),l.flags&=-3}}function Vf(l,n=!1){const{dep:p,prevSub:_,nextSub:b}=l;if(_&&(_.nextSub=b,l.prevSub=void 0),b&&(b.prevSub=_,l.nextSub=void 0),p.subs===l&&(p.subs=_,!_&&p.computed)){p.computed.flags&=-5;for(let M=p.computed.deps;M;M=M.nextDep)Vf(M,!0)}!n&&!--p.sc&&p.map&&p.map.delete(p.key)}function L0(l){const{prevDep:n,nextDep:p}=l;n&&(n.nextDep=p,l.prevDep=void 0),p&&(p.prevDep=n,l.nextDep=void 0)}let js=!0;const wy=[];function ya(){wy.push(js),js=!1}function va(){const l=wy.pop();js=l===void 0?!0:l}function a_(l){const{cleanup:n}=l;if(l.cleanup=void 0,n){const p=xr;xr=void 0;try{n()}finally{xr=p}}}let gu=0;class F0{constructor(n,p){this.sub=n,this.dep=p,this.version=p.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class $f{constructor(n){this.computed=n,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(n){if(!xr||!js||xr===this.computed)return;let p=this.activeLink;if(p===void 0||p.sub!==xr)p=this.activeLink=new F0(xr,this),xr.deps?(p.prevDep=xr.depsTail,xr.depsTail.nextDep=p,xr.depsTail=p):xr.deps=xr.depsTail=p,Ty(p);else if(p.version===-1&&(p.version=this.version,p.nextDep)){const _=p.nextDep;_.prevDep=p.prevDep,p.prevDep&&(p.prevDep.nextDep=_),p.prevDep=xr.depsTail,p.nextDep=void 0,xr.depsTail.nextDep=p,xr.depsTail=p,xr.deps===p&&(xr.deps=_)}return p}trigger(n){this.version++,gu++,this.notify(n)}notify(n){Nf();try{for(let p=this.subs;p;p=p.prevSub)p.sub.notify()&&p.sub.dep.notify()}finally{jf()}}}function Ty(l){if(l.dep.sc++,l.sub.flags&4){const n=l.dep.computed;if(n&&!l.dep.subs){n.flags|=20;for(let _=n.deps;_;_=_.nextDep)Ty(_)}const p=l.dep.subs;p!==l&&(l.prevSub=p,p&&(p.nextSub=l)),l.dep.subs=l}}const ip=new WeakMap,uo=Symbol(""),ff=Symbol(""),_u=Symbol("");function ki(l,n,p){if(js&&xr){let _=ip.get(l);_||ip.set(l,_=new Map);let b=_.get(p);b||(_.set(p,b=new $f),b.map=_,b.key=p),b.track()}}function kn(l,n,p,_,b,M){const x=ip.get(l);if(!x){gu++;return}const c=B=>{B&&B.trigger()};
vendor: 5,361 bytes, line 9
9if(Nf(),n==="clear")x.forEach(c);else{const B=Rt(l),q=B&&Bf(p);if(B&&p==="length"){const Y=Number(_);x.forEach((ne,ge)=>{(ge==="length"||ge===_u||!Bn(ge)&&ge>=Y)&&c(ne)})}else switch((p!==void 0||x.has(void 0))&&c(x.get(p)),q&&c(x.get(_u)),n){case"add":B?q&&c(x.get("length")):(c(x.get(uo)),Ml(l)&&c(x.get(ff)));break;case"delete":B||(c(x.get(uo)),Ml(l)&&c(x.get(ff)));break;case"set":Ml(l)&&c(x.get(uo));break}}jf()}function B0(l,n){const p=ip.get(l);return p&&p.get(n)}function yl(l){const n=Jt(l);return n===l?n:(ki(n,"iterate",_u),Vs(l)?n:n.map(Gi))}function Uf(l){return ki(l=Jt(l),"iterate",_u),l}const O0={__proto__:null,[Symbol.iterator](){return Xd(this,Symbol.iterator,Gi)},concat(...l){return yl(this).concat(...l.map(n=>Rt(n)?yl(n):n))},entries(){return Xd(this,"entries",l=>(l[1]=Gi(l[1]),l))},every(l,n){return En(this,"every",l,n,void 0,arguments)},filter(l,n){return En(this,"filter",l,n,p=>p.map(Gi),arguments)},find(l,n){return En(this,"find",l,n,Gi,arguments)},findIndex(l,n){return En(this,"findIndex",l,n,void 0,arguments)},findLast(l,n){return En(this,"findLast",l,n,Gi,arguments)},findLastIndex(l,n){return En(this,"findLastIndex",l,n,void 0,arguments)},forEach(l,n){return En(this,"forEach",l,n,void 0,arguments)},includes(...l){return Yd(this,"includes",l)},indexOf(...l){return Yd(this,"indexOf",l)},join(l){return yl(this).join(l)},lastIndexOf(...l){return Yd(this,"lastIndexOf",l)},map(l,n){return En(this,"map",l,n,void 0,arguments)},pop(){return su(this,"pop")},push(...l){return su(this,"push",l)},reduce(l,...n){return o_(this,"reduce",l,n)},reduceRight(l,...n){return o_(this,"reduceRight",l,n)},shift(){return su(this,"shift")},some(l,n){return En(this,"some",l,n,void 0,arguments)},splice(...l){return su(this,"splice",l)},toReversed(){return yl(this).toReversed()},toSorted(l){return yl(this).toSorted(l)},toSpliced(...l){return yl(this).toSpliced(...l)},unshift(...l){return su(this,"unshift",l)},values(){return Xd(this,"values",Gi)}};function Xd(l,n,p){const _=Uf(l),b=_[n]();return _!==l&&!Vs(l)&&(b._next=b.next,b.next=()=>{const M=b._next();return M.value&&(M.value=p(M.value)),M}),b}const N0=Array.prototype;function En(l,n,p,_,b,M){const x=Uf(l),c=x!==l&&!Vs(l),B=x[n];if(B!==N0[n]){const ne=B.apply(l,M);return c?Gi(ne):ne}let q=p;x!==l&&(c?q=function(ne,ge){return p.call(this,Gi(ne),ge,l)}:p.length>2&&(q=function(ne,ge){return p.call(this,ne,ge,l)}));const Y=B.call(x,q,_);return c&&b?b(Y):Y}function o_(l,n,p,_){const b=Uf(l);let M=p;return b!==l&&(Vs(l)?p.length>3&&(M=function(x,c,B){return p.call(this,x,c,B,l)}):M=function(x,c,B){return p.call(this,x,Gi(c),B,l)}),b[n](M,..._)}function Yd(l,n,p){const _=Jt(l);ki(_,"iterate",_u);const b=_[n](...p);return(b===-1||b===!1)&&Gf(p[0])?(p[0]=Jt(p[0]),_[n](...p)):b}function su(l,n,p=[]){ya(),Nf();const _=Jt(l)[n].apply(l,p);return jf(),va(),_}const j0=Df("__proto__,__v_isRef,__isVue"),Sy=new Set(Object.getOwnPropertyNames(Symbol).filter(l=>l!=="arguments"&&l!=="caller").map(l=>Symbol[l]).filter(Bn));function V0(l){Bn(l)||(l=String(l));const n=Jt(this);return ki(n,"has",l),n.hasOwnProperty(l)}class My{constructor(n=!1,p=!1){this._isReadonly=n,this._isShallow=p}get(n,p,_){if(p==="__v_skip")return n.__v_skip;const b=this._isReadonly,M=this._isShallow;if(p==="__v_isReactive")return!b;if(p==="__v_isReadonly")return b;if(p==="__v_isShallow")return M;if(p==="__v_raw")return _===(b?M?K0:Ey:M?Cy:Iy).get(n)||Object.getPrototypeOf(n)===Object.getPrototypeOf(_)?n:void 0;const x=Rt(n);if(!b){let B;if(x&&(B=O0[p]))return B;if(p==="hasOwnProperty")return V0}const c=Reflect.get(n,p,Yr(n)?n:_);return(Bn(p)?Sy.has(p):j0(p))||(b||ki(n,"get",p),M)?c:Yr(c)?x&&Bf(p)?c:c.value:$r(c)?b?Ay(c):Tp(c):c}}class Py extends My{constructor(n=!1){super(!1,n)}set(n,p,_,b){let M=n[p];if(!this._isShallow){const B=yo(M);if(!Vs(_)&&!yo(_)&&(M=Jt(M),_=Jt(_)),!Rt(n)&&Yr(M)&&!Yr(_))return B?!1:(M.value=_,!0)}const x=Rt(n)&&Bf(p)?Number(p)<n.length:nr(n,p),c=Reflect.set(n,p,_,Yr(n)?n:b);return n===Jt(b)&&(x?ga(_,M)&&kn(n,"set",p,_):kn(n,"add",p,_)),c}deleteProperty(n,p){const _=nr(n,p);n[p];const b=Reflect.deleteProperty(n,p);return b&&_&&kn(n,"delete",p,void 0),b}has(n,p){const _=Reflect.has(n,p);return(!Bn(p)||!Sy.has(p))&&ki(n,"has",p),_}ownKeys(n){return ki(n,"iterate",Rt(n)?"length":uo),Reflect.ownKeys(n)}}class $0 extends My{constructor(n=!1){super(!0,n)}set(n,p){return!0}deleteProperty(n,p){return!0}}const U0=new Py,Z0=new $0,q0=new Py(!0);const mf=l=>l,Hh=l=>Reflect.getPrototypeOf(l);function G0(l,n,p){return function(..._){const b=this.__v_raw,M=Jt(b),x=Ml(M),c=l==="entries"||l===Symbol.iterator&&x,B=l==="keys"&&x,q=b[l](..._),Y=p?mf:n?gf:Gi;return!n&&ki(M,"iterate",B?ff:uo),{next(){const{value:ne,done:ge}=q.next();return ge?{value:ne,done:ge}:{value:c?[Y(ne[0]),Y(ne[1])]:Y(ne),done:ge}},[Symbol.iterator](){return this}}}}function Wh(l){return function(...n){return l==="delete"?!1:l==="clear"?void 0:this}}function H0(l,n){const p={get(b){const M=this.__v_raw,x=Jt(M),c=Jt(b);l||(ga(b,c)&&ki(x,"get",b),ki(x,"get",c));const{has:B}=Hh(x),q=n?mf:l?gf:Gi;if(B.call(x,b))return q(M.get(b));if(B.call(x,c))return q(M.get(c));M!==x&&M.get(b)},get size(){const b=this.__v_raw;return!l&&ki(Jt(b),"iterate",uo),Reflect.get(b,"size",b)},has(b){const M=this.__v_raw,x=Jt(M),c=Jt(b);return l||(ga(b,c)&&ki(x,"has",b),ki(x,"has",c)),b===c?M.has(b):M.has(b)||M.has(c)}
vendor: 4,847 bytes, line 9
9,forEach(b,M){const x=this,c=x.__v_raw,B=Jt(c),q=n?mf:l?gf:Gi;return!l&&ki(B,"iterate",uo),c.forEach((Y,ne)=>b.call(M,q(Y),q(ne),x))}};return Di(p,l?{add:Wh("add"),set:Wh("set"),delete:Wh("delete"),clear:Wh("clear")}:{add(b){!n&&!Vs(b)&&!yo(b)&&(b=Jt(b));const M=Jt(this);return Hh(M).has.call(M,b)||(M.add(b),kn(M,"add",b,b)),this},set(b,M){!n&&!Vs(M)&&!yo(M)&&(M=Jt(M));const x=Jt(this),{has:c,get:B}=Hh(x);let q=c.call(x,b);q||(b=Jt(b),q=c.call(x,b));const Y=B.call(x,b);return x.set(b,M),q?ga(M,Y)&&kn(x,"set",b,M):kn(x,"add",b,M),this},delete(b){const M=Jt(this),{has:x,get:c}=Hh(M);let B=x.call(M,b);B||(b=Jt(b),B=x.call(M,b)),c&&c.call(M,b);const q=M.delete(b);return B&&kn(M,"delete",b,void 0),q},clear(){const b=Jt(this),M=b.size!==0,x=b.clear();return M&&kn(b,"clear",void 0,void 0),x}}),["keys","values","entries",Symbol.iterator].forEach(b=>{p[b]=G0(b,l,n)}),p}function Zf(l,n){const p=H0(l,n);return(_,b,M)=>b==="__v_isReactive"?!l:b==="__v_isReadonly"?l:b==="__v_raw"?_:Reflect.get(nr(p,b)&&b in _?p:_,b,M)}const W0={get:Zf(!1,!1)},X0={get:Zf(!1,!0)},Y0={get:Zf(!0,!1)};const Iy=new WeakMap,Cy=new WeakMap,Ey=new WeakMap,K0=new WeakMap;function J0(l){switch(l){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Q0(l){return l.__v_skip||!Object.isExtensible(l)?0:J0(S0(l))}function Tp(l){return yo(l)?l:qf(l,!1,U0,W0,Iy)}function eb(l){return qf(l,!1,q0,X0,Cy)}function Ay(l){return qf(l,!0,Z0,Y0,Ey)}function qf(l,n,p,_,b){if(!$r(l)||l.__v_raw&&!(n&&l.__v_isReactive))return l;const M=b.get(l);if(M)return M;const x=Q0(l);if(x===0)return l;const c=new Proxy(l,x===2?_:p);return b.set(l,c),c}function ho(l){return yo(l)?ho(l.__v_raw):!!(l&&l.__v_isReactive)}function yo(l){return!!(l&&l.__v_isReadonly)}function Vs(l){return!!(l&&l.__v_isShallow)}function Gf(l){return l?!!l.__v_raw:!1}function Jt(l){const n=l&&l.__v_raw;return n?Jt(n):l}function Hf(l){return!nr(l,"__v_skip")&&Object.isExtensible(l)&&cy(l,"__v_skip",!0),l}const Gi=l=>$r(l)?Tp(l):l,gf=l=>$r(l)?Ay(l):l;function Yr(l){return l?l.__v_isRef===!0:!1}function wi(l){return tb(l,!1)}function tb(l,n){return Yr(l)?l:new rb(l,n)}class rb{constructor(n,p){this.dep=new $f,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=p?n:Jt(n),this._value=p?n:Gi(n),this.__v_isShallow=p}get value(){return this.dep.track(),this._value}set value(n){const p=this._rawValue,_=this.__v_isShallow||Vs(n)||yo(n);n=_?n:Jt(n),ga(n,p)&&(this._rawValue=n,this._value=_?n:Gi(n),this.dep.trigger())}}function Cr(l){return Yr(l)?l.value:l}const ib={get:(l,n,p)=>n==="__v_raw"?l:Cr(Reflect.get(l,n,p)),set:(l,n,p,_)=>{const b=l[n];return Yr(b)&&!Yr(p)?(b.value=p,!0):Reflect.set(l,n,p,_)}};function ky(l){return ho(l)?l:new Proxy(l,ib)}function sb(l){const n=Rt(l)?new Array(l.length):{};for(const p in l)n[p]=ab(l,p);return n}class nb{constructor(n,p,_){this._object=n,this._key=p,this._defaultValue=_,this.__v_isRef=!0,this._value=void 0}get value(){const n=this._object[this._key];return this._value=n===void 0?this._defaultValue:n}set value(n){this._object[this._key]=n}get dep(){return B0(Jt(this._object),this._key)}}function ab(l,n,p){const _=l[n];return Yr(_)?_:new nb(l,n,p)}class ob{constructor(n,p,_){this.fn=n,this.setter=p,this._value=void 0,this.dep=new $f(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=gu-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!p,this.isSSR=_}notify(){if(this.flags|=16,!(this.flags&8)&&xr!==this)return yy(this,!0),!0}get value(){const n=this.dep.track();return by(this),n&&(n.version=this.dep.version),this._value}set value(n){this.setter&&this.setter(n)}}function lb(l,n,p=!1){let _,b;return Lt(l)?_=l:(_=l.get,b=l.set),new ob(_,b,p)}const Xh={},sp=new WeakMap;let no;function cb(l,n=!1,p=no){if(p){let _=sp.get(p);_||sp.set(p,_=[]),_.push(l)}}function ub(l,n,p=br){const{immediate:_,deep:b,once:M,scheduler:x,augmentJob:c,call:B}=p,q=nt=>b?nt:Vs(nt)||b===!1||b===0?fa(nt,1):fa(nt);let Y,ne,ge,Q,Se=!1,rt=!1;if(Yr(l)?(ne=()=>l.value,Se=Vs(l)):ho(l)?(ne=()=>q(l),Se=!0):Rt(l)?(rt=!0,Se=l.some(nt=>ho(nt)||Vs(nt)),ne=()=>l.map(nt=>{if(Yr(nt))return nt.value;if(ho(nt))return q(nt);if(Lt(nt))return B?B(nt,2):nt()})):Lt(l)?n?ne=B?()=>B(l,2):l:ne=()=>{if(ge){ya();try{ge()}finally{va()}}const nt=no;no=Y;try{return B?B(l,3,[Q]):l(Q)}finally{no=nt}}:ne=nn,n&&b){const nt=ne,Ct=b===!0?1/0:b;ne=()=>fa(nt(),Ct)}const St=my(),vt=()=>{Y.stop(),St&&St.active&&Ff(St.effects,Y)};if(M&&n){const nt=n;n=(...Ct)=>{nt(...Ct),vt()}}let bt=rt?new Array(l.length).fill(Xh):Xh;const Pt=nt=>{if(!(!(Y.flags&1)||!Y.dirty&&!nt))if(n){const Ct=Y.run();if(b||Se||(rt?Ct.some((Xt,Et)=>ga(Xt,bt[Et])):ga(Ct,bt))){ge&&ge();const Xt=no;no=Y;try{const Et=[Ct,bt===Xh?void 0:rt&&bt[0]===Xh?[]:bt,Q];B?B(n,3,Et):n(...Et),bt=Ct}finally{no=Xt}}}else Y.run()};
vendor: 4,362 bytes, lines 9-13
9return c&&c(Pt),Y=new gy(ne),Y.scheduler=x?()=>x(Pt,!1):Pt,Q=nt=>cb(nt,!1,Y),ge=Y.onStop=()=>{const nt=sp.get(Y);if(nt){if(B)B(nt,4);else for(const Ct of nt)Ct();sp.delete(Y)}},n?_?Pt(!0):bt=Y.run():x?x(Pt.bind(null,!0),!0):Y.run(),vt.pause=Y.pause.bind(Y),vt.resume=Y.resume.bind(Y),vt.stop=vt,vt}function fa(l,n=1/0,p){if(n<=0||!$r(l)||l.__v_skip||(p=p||new Set,p.has(l)))return l;if(p.add(l),n--,Yr(l))fa(l.value,n,p);else if(Rt(l))for(let _=0;_<l.length;_++)fa(l[_],n,p);else if(ny(l)||Ml(l))l.forEach(_=>{fa(_,n,p)});else if(ly(l)){for(const _ in l)fa(l[_],n,p);for(const _ of Object.getOwnPropertySymbols(l))Object.prototype.propertyIsEnumerable.call(l,_)&&fa(l[_],n,p)}return l}/**
10* @vue/runtime-core v3.5.13
11* (c) 2018-present Yuxi (Evan) You and Vue contributors
12* @license MIT
13**/function Su(l,n,p,_){try{return _?l(..._):l()}catch(b){Sp(b,n,p)}}function on(l,n,p,_){if(Lt(l)){const b=Su(l,n,p,_);return b&&ay(b)&&b.catch(M=>{Sp(M,n,p)}),b}if(Rt(l)){const b=[];for(let M=0;M<l.length;M++)b.push(on(l[M],n,p,_));return b}}function Sp(l,n,p,_=!0){const b=n?n.vnode:null,{errorHandler:M,throwUnhandledErrorInProduction:x}=n&&n.appContext.config||br;if(n){let c=n.parent;const B=n.proxy,q=`https://vuejs.org/error-reference/#runtime-${p}`;for(;c;){const Y=c.ec;if(Y){for(let ne=0;ne<Y.length;ne++)if(Y[ne](l,B,q)===!1)return}c=c.parent}if(M){ya(),Su(M,null,10,[l,B,q]),va();return}}hb(l,p,b,_,x)}function hb(l,n,p,_=!0,b=!1){if(b)throw l;console.error(l)}const Hi=[];let en=-1;const Pl=[];let pa=null,bl=0;const zy=Promise.resolve();let np=null;function Ry(l){const n=np||zy;return l?n.then(this?l.bind(this):l):n}function pb(l){let n=en+1,p=Hi.length;for(;n<p;){const _=n+p>>>1,b=Hi[_],M=yu(b);M<l||M===l&&b.flags&2?n=_+1:p=_}return n}function Wf(l){if(!(l.flags&1)){const n=yu(l),p=Hi[Hi.length-1];!p||!(l.flags&2)&&n>=yu(p)?Hi.push(l):Hi.splice(pb(n),0,l),l.flags|=1,Dy()}}function Dy(){np||(np=zy.then(Fy))}function db(l){Rt(l)?Pl.push(...l):pa&&l.id===-1?pa.splice(bl+1,0,l):l.flags&1||(Pl.push(l),l.flags|=1),Dy()}function l_(l,n,p=en+1){for(;p<Hi.length;p++){const _=Hi[p];if(_&&_.flags&2){if(l&&_.id!==l.uid)continue;Hi.splice(p,1),p--,_.flags&4&&(_.flags&=-2),_(),_.flags&4||(_.flags&=-2)}}}function Ly(l){if(Pl.length){const n=[...new Set(Pl)].sort((p,_)=>yu(p)-yu(_));if(Pl.length=0,pa){pa.push(...n);return}for(pa=n,bl=0;bl<pa.length;bl++){const p=pa[bl];p.flags&4&&(p.flags&=-2),p.flags&8||p(),p.flags&=-2}pa=null,bl=0}}const yu=l=>l.id==null?l.flags&2?-1:1/0:l.id;function Fy(l){try{for(en=0;en<Hi.length;en++){const n=Hi[en];n&&!(n.flags&8)&&(n.flags&4&&(n.flags&=-2),Su(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2))}}finally{for(;en<Hi.length;en++){const n=Hi[en];n&&(n.flags&=-2)}en=-1,Hi.length=0,Ly(),np=null,(Hi.length||Pl.length)&&Fy()}}let Ri=null,By=null;function ap(l){const n=Ri;return Ri=l,By=l&&l.type.__scopeId||null,n}function Qh(l,n=Ri,p){if(!n||l._n)return l;const _=(...b)=>{_._d&&y_(-1);const M=ap(n);let x;try{x=l(...b)}finally{ap(M),_._d&&y_(1)}return x};return _._n=!0,_._c=!0,_._d=!0,_}function ro(l,n,p,_){const b=l.dirs,M=n&&n.dirs;for(let x=0;x<b.length;x++){const c=b[x];M&&(c.oldValue=M[x].value);let B=c.dir[_];B&&(ya(),on(B,p,8,[l.el,c,l,n]),va())}}const fb=Symbol("_vte"),mb=l=>l.__isTeleport;function Xf(l,n){l.shapeFlag&6&&l.component?(l.transition=n,Xf(l.component.subTree,n)):l.shapeFlag&128?(l.ssContent.transition=n.clone(l.ssContent),l.ssFallback.transition=n.clone(l.ssFallback)):l.transition=n}/*! #__NO_SIDE_EFFECTS__ */function Rl(l,n){return Lt(l)?Di({name:l.name},n,{setup:l}):l}function Oy(l){l.ids=[l.ids[0]+l.ids[2]+++"-",0,0]}function op(l,n,p,_,b=!1){if(Rt(l)){l.forEach((Se,rt)=>op(Se,n&&(Rt(n)?n[rt]:n),p,_,b));return}if(Il(_)&&!b){_.shapeFlag&512&&_.type.__asyncResolved&&_.component.subTree.component&&op(l,n,p,_.component.subTree);return}const M=_.shapeFlag&4?em(_.component):_.el,x=b?null:M,{i:c,r:B}=l,q=n&&n.r,Y=c.refs===br?c.refs={}:c.refs,ne=c.setupState,ge=Jt(ne),Q=ne===br?()=>!1:Se=>nr(ge,Se);if(q!=null&&q!==B&&(ui(q)?(Y[q]=null,Q(q)&&(ne[q]=null)):Yr(q)&&(q.value=null)),Lt(B))Su(B,c,12,[x,Y]);else{const Se=ui(B),rt=Yr(B);if(Se||rt){const St=()=>{if(l.f){const vt=Se?Q(B)?ne[B]:Y[B]:B.value;b?Rt(vt)&&Ff(vt,M):Rt(vt)?vt.includes(M)||vt.push(M):Se?(Y[B]=[M],Q(B)&&(ne[B]=Y[B])):(B.value=[M],l.k&&(Y[l.k]=B.value))}else Se?(Y[B]=x,Q(B)&&(ne[B]=x)):rt&&(B.value=x,l.k&&(Y[l.k]=x))};
13x?(St.id=-1,ms(St,p)):St()}}}wp().requestIdleCallback;wp().cancelIdleCallback;const Il=l=>!!l.type.__asyncLoader,Ny=l=>l.type.__isKeepAlive;function gb(l,n){jy(l,"a",n)}function _b(l,n){jy(l,"da",n)}function jy(l,n,p=Si){const _=l.__wdc||(l.__wdc=()=>{let b=p;for(;b;){if(b.isDeactivated)return;b=b.parent}return l()});if(Mp(n,_,p),p){let b=p.parent;for(;b&&b.parent;)Ny(b.parent.vnode)&&yb(_,n,p,b),b=b.parent}}function yb(l,n,p,_){const b=Mp(n,l,_,!0);Yf(()=>{Ff(_[n],b)},p)}function Mp(l,n,p=Si,_=!1){if(p){const b=p[l]||(p[l]=[]),M=n.__weh||(n.__weh=(...x)=>{ya();const c=Pu(p),B=on(n,p,l,x);return c(),va(),B});return _?b.unshift(M):b.push(M),M}}const On=l=>(n,p=Si)=>{(!xu||l==="sp")&&Mp(l,(..._)=>n(..._),p)},vb=On("bm"),Mu=On("m"),xb=On("bu"),bb=On("u"),Vy=On("bum"),Yf=On("um"),wb=On("sp"),Tb=On("rtg"),Sb=On("rtc");function Mb(l,n=Si){Mp("ec",l,n)}const Pb="components";function Ib(l,n){return Eb(Pb,l,!0,n)||l}const Cb=Symbol.for("v-ndc");function Eb(l,n,p=!0,_=!1){const b=Ri||Si;if(b){const M=b.type;{const c=_1(M,!1);if(c&&(c===n||c===Is(n)||c===bp(Is(n))))return M}const x=c_(b[l]||M[l],n)||c_(b.appContext[l],n);return!x&&_?M:x}}function c_(l,n){return l&&(l[n]||l[Is(n)]||l[bp(Is(n))])}function nu(l,n,p={},_,b){if(Ri.ce||Ri.parent&&Il(Ri.parent)&&Ri.parent.ce)return n!=="default"&&(p.name=n),zi(),cp(is,null,[Ti("slot",p,_)],64);let M=l[n];M&&M._c&&(M._d=!1),zi();const x=M&&$y(M(p)),c=p.key||x&&x.key,B=cp(is,{key:(c&&!Bn(c)?c:`_${n}`)+""},x||[],x&&l._===1?64:-2);return B.scopeId&&(B.slotScopeIds=[B.scopeId+"-s"]),M&&M._c&&(M._d=!0),B}function $y(l){return l.some(n=>Jf(n)?!(n.type===_a||n.type===is&&!$y(n.children)):!0)?l:null}const _f=l=>l?uv(l)?em(l):_f(l.parent):null,hu=Di(Object.create(null),{$:l=>l,$el:l=>l.vnode.el,$data:l=>l.data,$props:l=>l.props,$attrs:l=>l.attrs,$slots:l=>l.slots,$refs:l=>l.refs,$parent:l=>_f(l.parent),$root:l=>_f(l.root),$host:l=>l.ce,$emit:l=>l.emit,$options:l=>Zy(l),$forceUpdate:l=>l.f||(l.f=()=>{Wf(l.update)}),$nextTick:l=>l.n||(l.n=Ry.bind(l.proxy)),$watch:l=>Kb.bind(l)}),Kd=(l,n)=>l!==br&&!l.__isScriptSetup&&nr(l,n),Ab={get({_:l},n){if(n==="__v_skip")return!0;const{ctx:p,setupState:_,data:b,props:M,accessCache:x,type:c,appContext:B}=l;let q;if(n[0]!=="$"){const Q=x[n];if(Q!==void 0)switch(Q){case 1:return _[n];case 2:return b[n];case 4:return p[n];case 3:return M[n]}else{if(Kd(_,n))return x[n]=1,_[n];if(b!==br&&nr(b,n))return x[n]=2,b[n];if((q=l.propsOptions[0])&&nr(q,n))return x[n]=3,M[n];if(p!==br&&nr(p,n))return x[n]=4,p[n];yf&&(x[n]=0)}}const Y=hu[n];let ne,ge;if(Y)return n==="$attrs"&&ki(l.attrs,"get",""),Y(l);if((ne=c.__cssModules)&&(ne=ne[n]))return ne;if(p!==br&&nr(p,n))return x[n]=4,p[n];if(ge=B.config.globalProperties,nr(ge,n))return ge[n]},set({_:l},n,p){const{data:_,setupState:b,ctx:M}=l;return Kd(b,n)?(b[n]=p,!0):_!==br&&nr(_,n)?(_[n]=p,!0):nr(l.props,n)||n[0]==="$"&&n.slice(1)in l?!1:(M[n]=p,!0)},has({_:{data:l,setupState:n,accessCache:p,ctx:_,appContext:b,propsOptions:M}},x){let c;return!!p[x]||l!==br&&nr(l,x)||Kd(n,x)||(c=M[0])&&nr(c,x)||nr(_,x)||nr(hu,x)||nr(b.config.globalProperties,x)},defineProperty(l,n,p){return p.get!=null?l._.accessCache[n]=0:nr(p,"value")&&this.set(l,n,p.value,null),Reflect.defineProperty(l,n,p)}};function u_(l){return Rt(l)?l.reduce((n,p)=>(n[p]=null,n),{}):l}let yf=!0;function kb(l){const n=Zy(l),p=l.proxy,_=l.ctx;yf=!1,n.beforeCreate&&h_(n.beforeCreate,l,"bc");const{data:b,computed:M,methods:x,watch:c,provide:B,inject:q,created:Y,beforeMount:ne,mounted:ge,beforeUpdate:Q,updated:Se,activated:rt,deactivated:St,beforeDestroy:vt,beforeUnmount:bt,destroyed:Pt,unmounted:nt,render:Ct,renderTracked:Xt,renderTriggered:Et,errorCaptured:pt,serverPrefetch:jt,expose:cr,inheritAttrs:kr,components:Or,directives:zr,filters:Mr}=n;if(q&&zb(q,_,null),x)for(const It in x){const Gt=x[It];Lt(Gt)&&(_[It]=Gt.bind(p))}if(b){const It=b.call(p,p);$r(It)&&(l.data=Tp(It))}if(yf=!0,M)for(const It in M){const Gt=M[It],vi=Lt(Gt)?Gt.bind(p,p):Lt(Gt.get)?Gt.get.bind(p,p):nn,Wi=!Lt(Gt)&&Lt(Gt.set)?Gt.set.bind(p):nn,Mi=pv({get:vi,set:Wi});Object.defineProperty(_,It,{enumerable:!0,configurable:!0,get:()=>Mi.value,set:Rr=>Mi.value=Rr})}if(c)for(const It in c)Uy(c[It],_,p,It);if(B){const It=Lt(B)?B.call(p):B;Reflect.ownKeys(It).forEach(Gt=>{Gy(Gt,It[Gt])})}Y&&h_(Y,l,"c");function _t(It,Gt){Rt(Gt)?Gt.forEach(vi=>It(vi.bind(p))):Gt&&It(Gt.bind(p))}if(_t(vb,ne),_t(Mu,ge),_t(xb,Q),_t(bb,Se),_t(gb,rt),_t(_b,St),_t(Mb,pt),_t(Sb,Xt),_t(Tb,Et),_t(Vy,bt),_t(Yf,nt),_t(wb,jt),Rt(cr))if(cr.length){const It=l.exp
vendor: 4,898 bytes, line 13
13osed||(l.exposed={});cr.forEach(Gt=>{Object.defineProperty(It,Gt,{get:()=>p[Gt],set:vi=>p[Gt]=vi})})}else l.exposed||(l.exposed={});Ct&&l.render===nn&&(l.render=Ct),kr!=null&&(l.inheritAttrs=kr),Or&&(l.components=Or),zr&&(l.directives=zr),jt&&Oy(l)}function zb(l,n,p=nn){Rt(l)&&(l=vf(l));for(const _ in l){const b=l[_];let M;$r(b)?"default"in b?M=pu(b.from||_,b.default,!0):M=pu(b.from||_):M=pu(b),Yr(M)?Object.defineProperty(n,_,{enumerable:!0,configurable:!0,get:()=>M.value,set:x=>M.value=x}):n[_]=M}}function h_(l,n,p){on(Rt(l)?l.map(_=>_.bind(n.proxy)):l.bind(n.proxy),n,p)}function Uy(l,n,p,_){let b=_.includes(".")?nv(p,_):()=>p[_];if(ui(l)){const M=n[l];Lt(M)&&$s(b,M)}else if(Lt(l))$s(b,l.bind(p));else if($r(l))if(Rt(l))l.forEach(M=>Uy(M,n,p,_));else{const M=Lt(l.handler)?l.handler.bind(p):n[l.handler];Lt(M)&&$s(b,M,l)}}function Zy(l){const n=l.type,{mixins:p,extends:_}=n,{mixins:b,optionsCache:M,config:{optionMergeStrategies:x}}=l.appContext,c=M.get(n);let B;return c?B=c:!b.length&&!p&&!_?B=n:(B={},b.length&&b.forEach(q=>lp(B,q,x,!0)),lp(B,n,x)),$r(n)&&M.set(n,B),B}function lp(l,n,p,_=!1){const{mixins:b,extends:M}=n;M&&lp(l,M,p,!0),b&&b.forEach(x=>lp(l,x,p,!0));for(const x in n)if(!(_&&x==="expose")){const c=Rb[x]||p&&p[x];l[x]=c?c(l[x],n[x]):n[x]}return l}const Rb={data:p_,props:d_,emits:d_,methods:ou,computed:ou,beforeCreate:Zi,created:Zi,beforeMount:Zi,mounted:Zi,beforeUpdate:Zi,updated:Zi,beforeDestroy:Zi,beforeUnmount:Zi,destroyed:Zi,unmounted:Zi,activated:Zi,deactivated:Zi,errorCaptured:Zi,serverPrefetch:Zi,components:ou,directives:ou,watch:Lb,provide:p_,inject:Db};function p_(l,n){return n?l?function(){return Di(Lt(l)?l.call(this,this):l,Lt(n)?n.call(this,this):n)}:n:l}function Db(l,n){return ou(vf(l),vf(n))}function vf(l){if(Rt(l)){const n={};for(let p=0;p<l.length;p++)n[l[p]]=l[p];return n}return l}function Zi(l,n){return l?[...new Set([].concat(l,n))]:n}function ou(l,n){return l?Di(Object.create(null),l,n):n}function d_(l,n){return l?Rt(l)&&Rt(n)?[...new Set([...l,...n])]:Di(Object.create(null),u_(l),u_(n??{})):n}function Lb(l,n){if(!l)return n;if(!n)return l;const p=Di(Object.create(null),l);for(const _ in n)p[_]=Zi(l[_],n[_]);return p}function qy(){return{app:null,config:{isNativeTag:w0,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 Fb=0;function Bb(l,n){return function(_,b=null){Lt(_)||(_=Di({},_)),b!=null&&!$r(b)&&(b=null);const M=qy(),x=new WeakSet,c=[];let B=!1;const q=M.app={_uid:Fb++,_component:_,_props:b,_container:null,_context:M,_instance:null,version:v1,get config(){return M.config},set config(Y){},use(Y,...ne){return x.has(Y)||(Y&&Lt(Y.install)?(x.add(Y),Y.install(q,...ne)):Lt(Y)&&(x.add(Y),Y(q,...ne))),q},mixin(Y){return M.mixins.includes(Y)||M.mixins.push(Y),q},component(Y,ne){return ne?(M.components[Y]=ne,q):M.components[Y]},directive(Y,ne){return ne?(M.directives[Y]=ne,q):M.directives[Y]},mount(Y,ne,ge){if(!B){const Q=q._ceVNode||Ti(_,b);return Q.appContext=M,ge===!0?ge="svg":ge===!1&&(ge=void 0),l(Q,Y,ge),B=!0,q._container=Y,Y.__vue_app__=q,em(Q.component)}},onUnmount(Y){c.push(Y)},unmount(){B&&(on(c,q._instance,16),l(null,q._container),delete q._container.__vue_app__)},provide(Y,ne){return M.provides[Y]=ne,q},runWithContext(Y){const ne=po;po=q;try{return Y()}finally{po=ne}}};return q}}let po=null;function Gy(l,n){if(Si){let p=Si.provides;const _=Si.parent&&Si.parent.provides;_===p&&(p=Si.provides=Object.create(_)),p[l]=n}}function pu(l,n,p=!1){const _=Si||Ri;if(_||po){const b=po?po._context.provides:_?_.parent==null?_.vnode.appContext&&_.vnode.appContext.provides:_.parent.provides:void 0;if(b&&l in b)return b[l];if(arguments.length>1)return p&&Lt(n)?n.call(_&&_.proxy):n}}function Ob(){return!!(Si||Ri||po)}const Hy={},Wy=()=>Object.create(Hy),Xy=l=>Object.getPrototypeOf(l)===Hy;function Nb(l,n,p,_=!1){const b={},M=Wy();l.propsDefaults=Object.create(null),Yy(l,n,b,M);for(const x in l.propsOptions[0])x in b||(b[x]=void 0);p?l.props=_?b:eb(b):l.type.props?l.props=b:l.props=M,l.attrs=M}function jb(l,n,p,_){const{props:b,attrs:M,vnode:{patchFlag:x}}=l,c=Jt(b),[B]=l.propsOptions;let q=!1;if((_||x>0)&&!(x&16)){if(x&8){const Y=l.vnode.dynamicProps;for(let ne=0;ne<Y.length;ne++){let ge=Y[ne];if(Pp(l.emitsOptions,ge))continue;const Q=n[ge];if(B)if(nr(M,ge))Q!==M[ge]&&(M[ge]=Q,q=!0);else{const Se=Is(ge);b[Se]=xf(B,c,Se,Q,l,!1)}else Q!==M[ge]&&(M[ge]=Q,q=!0)}}}else{Yy(l,n,b,M)&&(q=!0);let Y;for(const ne in c)(!n||!nr(n,ne)&&((Y=vo(ne))===ne||!nr(n,Y)))&&(B?p&&(p[ne]!==void 0||p[Y]!==void 0)&&(b[ne]=xf(B,c,ne,void 0,l,!0)):delete b[ne]);if(M!==c)for(const ne in M)(!n||!nr(n,ne))&&(delete M[ne],q=!0)}q&&kn(l.attrs,"set","")}function Yy(l,n,p,_){const[b,M]=l.propsOptions;let x=!1,c;
vendor: 23,563 bytes, line 13
13if(n)for(let B in n){if(lu(B))continue;const q=n[B];let Y;b&&nr(b,Y=Is(B))?!M||!M.includes(Y)?p[Y]=q:(c||(c={}))[Y]=q:Pp(l.emitsOptions,B)||(!(B in _)||q!==_[B])&&(_[B]=q,x=!0)}if(M){const B=Jt(p),q=c||br;for(let Y=0;Y<M.length;Y++){const ne=M[Y];p[ne]=xf(b,B,ne,q[ne],l,!nr(q,ne))}}return x}function xf(l,n,p,_,b,M){const x=l[p];if(x!=null){const c=nr(x,"default");if(c&&_===void 0){const B=x.default;if(x.type!==Function&&!x.skipFactory&&Lt(B)){const{propsDefaults:q}=b;if(p in q)_=q[p];else{const Y=Pu(b);_=q[p]=B.call(null,n),Y()}}else _=B;b.ce&&b.ce._setProp(p,_)}x[0]&&(M&&!c?_=!1:x[1]&&(_===""||_===vo(p))&&(_=!0))}return _}const Vb=new WeakMap;function Ky(l,n,p=!1){const _=p?Vb:n.propsCache,b=_.get(l);if(b)return b;const M=l.props,x={},c=[];let B=!1;if(!Lt(l)){const Y=ne=>{B=!0;const[ge,Q]=Ky(ne,n,!0);Di(x,ge),Q&&c.push(...Q)};!p&&n.mixins.length&&n.mixins.forEach(Y),l.extends&&Y(l.extends),l.mixins&&l.mixins.forEach(Y)}if(!M&&!B)return $r(l)&&_.set(l,Sl),Sl;if(Rt(M))for(let Y=0;Y<M.length;Y++){const ne=Is(M[Y]);f_(ne)&&(x[ne]=br)}else if(M)for(const Y in M){const ne=Is(Y);if(f_(ne)){const ge=M[Y],Q=x[ne]=Rt(ge)||Lt(ge)?{type:ge}:Di({},ge),Se=Q.type;let rt=!1,St=!0;if(Rt(Se))for(let vt=0;vt<Se.length;++vt){const bt=Se[vt],Pt=Lt(bt)&&bt.name;if(Pt==="Boolean"){rt=!0;break}else Pt==="String"&&(St=!1)}else rt=Lt(Se)&&Se.name==="Boolean";Q[0]=rt,Q[1]=St,(rt||nr(Q,"default"))&&c.push(ne)}}const q=[x,c];return $r(l)&&_.set(l,q),q}function f_(l){return l[0]!=="$"&&!lu(l)}const Jy=l=>l[0]==="_"||l==="$stable",Kf=l=>Rt(l)?l.map(tn):[tn(l)],$b=(l,n,p)=>{if(n._n)return n;const _=Qh((...b)=>Kf(n(...b)),p);return _._c=!1,_},Qy=(l,n,p)=>{const _=l._ctx;for(const b in l){if(Jy(b))continue;const M=l[b];if(Lt(M))n[b]=$b(b,M,_);else if(M!=null){const x=Kf(M);n[b]=()=>x}}},ev=(l,n)=>{const p=Kf(n);l.slots.default=()=>p},tv=(l,n,p)=>{for(const _ in n)(p||_!=="_")&&(l[_]=n[_])},Ub=(l,n,p)=>{const _=l.slots=Wy();if(l.vnode.shapeFlag&32){const b=n._;b?(tv(_,n,p),p&&cy(_,"_",b,!0)):Qy(n,_)}else n&&ev(l,n)},Zb=(l,n,p)=>{const{vnode:_,slots:b}=l;let M=!0,x=br;if(_.shapeFlag&32){const c=n._;c?p&&c===1?M=!1:tv(b,n,p):(M=!n.$stable,Qy(n,b)),x=n}else n&&(ev(l,n),x={default:1});if(M)for(const c in b)!Jy(c)&&x[c]==null&&delete b[c]},ms=s1;function qb(l){return Gb(l)}function Gb(l,n){const p=wp();p.__VUE__=!0;const{insert:_,remove:b,patchProp:M,createElement:x,createText:c,createComment:B,setText:q,setElementText:Y,parentNode:ne,nextSibling:ge,setScopeId:Q=nn,insertStaticContent:Se}=l,rt=(ae,fe,Me,Ve=null,Be=null,Oe=null,Ke=void 0,Ye=null,Ze=!!fe.dynamicChildren)=>{if(ae===fe)return;ae&&!au(ae,fe)&&(Ve=Xi(ae),Rr(ae,Be,Oe,!0),ae=null),fe.patchFlag===-2&&(Ze=!1,fe.dynamicChildren=null);const{type:$e,ref:dt,shapeFlag:et}=fe;switch($e){case Ip:St(ae,fe,Me,Ve);break;case _a:vt(ae,fe,Me,Ve);break;case ep:ae==null&&bt(fe,Me,Ve,Ke);break;case is:Or(ae,fe,Me,Ve,Be,Oe,Ke,Ye,Ze);break;default:et&1?Ct(ae,fe,Me,Ve,Be,Oe,Ke,Ye,Ze):et&6?zr(ae,fe,Me,Ve,Be,Oe,Ke,Ye,Ze):(et&64||et&128)&&$e.process(ae,fe,Me,Ve,Be,Oe,Ke,Ye,Ze,ns)}dt!=null&&Be&&op(dt,ae&&ae.ref,Oe,fe||ae,!fe)},St=(ae,fe,Me,Ve)=>{if(ae==null)_(fe.el=c(fe.children),Me,Ve);else{const Be=fe.el=ae.el;fe.children!==ae.children&&q(Be,fe.children)}},vt=(ae,fe,Me,Ve)=>{ae==null?_(fe.el=B(fe.children||""),Me,Ve):fe.el=ae.el},bt=(ae,fe,Me,Ve)=>{[ae.el,ae.anchor]=Se(ae.children,fe,Me,Ve,ae.el,ae.anchor)},Pt=({el:ae,anchor:fe},Me,Ve)=>{let Be;for(;ae&&ae!==fe;)Be=ge(ae),_(ae,Me,Ve),ae=Be;_(fe,Me,Ve)},nt=({el:ae,anchor:fe})=>{let Me;for(;ae&&ae!==fe;)Me=ge(ae),b(ae),ae=Me;b(fe)},Ct=(ae,fe,Me,Ve,Be,Oe,Ke,Ye,Ze)=>{fe.type==="svg"?Ke="svg":fe.type==="math"&&(Ke="mathml"),ae==null?Xt(fe,Me,Ve,Be,Oe,Ke,Ye,Ze):jt(ae,fe,Be,Oe,Ke,Ye,Ze)},Xt=(ae,fe,Me,Ve,Be,Oe,Ke,Ye)=>{let Ze,$e;const{props:dt,shapeFlag:et,transition:ut,dirs:gt}=ae;if(Ze=ae.el=x(ae.type,Oe,dt&&dt.is,dt),et&8?Y(Ze,ae.children):et&16&&pt(ae.children,Ze,null,Ve,Be,Jd(ae,Oe),Ke,Ye),gt&&ro(ae,null,Ve,"created"),Et(Ze,ae,ae.scopeId,Ke,Ve),dt){for(const Wt in dt)Wt!=="value"&&!lu(Wt)&&M(Ze,Wt,null,dt[Wt],Oe,Ve);"value"in dt&&M(Ze,"value",null,dt.value,Oe),($e=dt.onVnodeBeforeMount)&&Js($e,Ve,ae)}gt&&ro(ae,null,Ve,"beforeMount");const Mt=Hb(Be,ut);Mt&&ut.beforeEnter(Ze),_(Ze,fe,Me),(($e=dt&&dt.onVnodeMounted)||Mt||gt)&&ms(()=>{$e&&Js($e,Ve,ae),Mt&&ut.enter(Ze),gt&&ro(ae,null,Ve,"mounted")},Be)},Et=(ae,fe,Me,Ve,Be)=>{if(Me&&Q(ae,Me),Ve)for(let Oe=0;Oe<Ve.length;Oe++)Q(ae,Ve[Oe]);if(Be){let Oe=Be.subTree;if(fe===Oe||ov(Oe.type)&&(Oe.ssContent===fe||Oe.ssFallback===fe)){const Ke=Be.vnode;Et(ae,Ke,Ke.scopeId,Ke.slotScopeIds,Be.parent)}}},pt=(ae,fe,Me,Ve,Be,Oe,Ke,Ye,Ze=0)=>{for(let $e=Ze;$e<ae.length;$e++){const dt=ae[$e]=Ye?da(ae[$e]):tn(ae[$e]);rt(null,dt,fe,Me,Ve,Be,Oe,Ke,Ye)}},jt=(ae,fe,Me,Ve,Be,Oe,Ke)=>{const Ye=fe.el=ae.el;let{patchFlag:Ze,dynamicChildren:$e,dirs:dt}=fe;Ze|=ae.patchFlag&16;const et=ae.props||br,ut=fe.props||br;let gt;if(Me&&io(Me,!1),(gt=ut.onVnodeBeforeUpdate)&&Js(gt,Me,fe,ae),dt&&ro(fe,ae,Me,"beforeUpdate"),Me&&io(Me,!0),(et.innerHTML&&ut.innerHTML==null||et.textContent&&ut.textContent==null)&&Y(Ye,""),$e?cr(ae.dynamicChildren,$e,Ye,Me,Ve,Jd(fe,Be),Oe):Ke||Gt(ae,fe,Ye,null,Me,Ve,Jd(fe,Be),Oe,!1),Ze>0){if(Ze&16)kr(Ye,et,ut,Me,Be);else if(Ze&2&&et.class!==ut.class&&M(Ye,"class",null,ut.class,Be),Ze&4&&M(Ye,"style",et.style,ut.style,Be),Ze&8){const Mt=fe.dynamicProps;for(let Wt=0;Wt<Mt.length;Wt++){const Ft=Mt[Wt],Dr=et[Ft],wr=ut[Ft];(wr!==Dr||Ft==="value")&&M(Ye,Ft,Dr,wr,Be,Me)}}Ze&1&&ae.children!==fe.children&&Y(Ye,fe.children)}else!Ke&&$e==null&&kr(Ye,et,ut,Me,Be);((gt=ut.onVnodeUpdated)||dt)&&ms(()=>{gt&&Js(gt,Me,fe,ae),dt&&ro(fe,ae,Me,"updated")},Ve)},cr=(ae,fe,Me,Ve,Be,Oe,Ke)=>{for(let Ye=0;Ye<fe.length;Ye++){const Ze=ae[Ye],$e=fe[Ye],dt=Ze.el&&(Ze.type===is||!au(Ze,$e)||Ze.shapeFlag&70)?ne(Ze.el):Me;rt(Ze,$e,dt,null,Ve,Be,Oe,Ke,!0)}},kr=(ae,fe,Me,Ve,Be)=>{if(fe!==Me){if(fe!==br)for(const Oe in fe)!lu(Oe)&&!(Oe in Me)&&M(ae,Oe,fe[Oe],null,Be,Ve);for(const Oe in Me){if(lu(Oe))continue;const Ke=Me[Oe],Ye=fe[Oe];Ke!==Ye&&Oe!=="value"&&M(ae,Oe,Ye,Ke,Be,Ve)}"value"in Me&&M(ae,"value",fe.value,Me.value,Be)}},Or=(ae,fe,Me,Ve,Be,Oe,Ke,Ye,Ze)=>{const $e=fe.el=ae?ae.el:c(""),dt=fe.anchor=ae?ae.anchor:c("");let{patchFlag:et,dynamicChildren:ut,slotScopeIds:gt}=fe;gt&&(Ye=Ye?Ye.concat(gt):gt),ae==null?(_($e,Me,Ve),_(dt,Me,Ve),pt(fe.children||[],Me,dt,Be,Oe,Ke,Ye,Ze)):et>0&&et&64&&ut&&ae.dynamicChildren?(cr(ae.dynamicChildren,ut,Me,Be,Oe,Ke,Ye),(fe.key!=null||Be&&fe===Be.subTree)&&rv(ae,fe,!0)):Gt(ae,fe,Me,dt,Be,Oe,Ke,Ye,Ze)},zr=(ae,fe,Me,Ve,Be,Oe,Ke,Ye,Ze)=>{fe.slotScopeIds=Ye,ae==null?fe.shapeFlag&512?Be.ctx.activate(fe,Me,Ve,Ke,Ze):Mr(fe,Me,Ve,Be,Oe,Ke,Ze):_s(ae,fe,Ze)},Mr=(ae,fe,Me,Ve,Be,Oe,Ke)=>{const Ye=ae.component=p1(ae,Ve,Be);if(Ny(ae)&&(Ye.ctx.renderer=ns),d1(Ye,!1,Ke),Ye.asyncDep){if(Be&&Be.registerDep(Ye,_t,Ke),!ae.el){const Ze=Ye.subTree=Ti(_a);vt(null,Ze,fe,Me)}}else _t(Ye,ae,fe,Me,Be,Oe,Ke)},_s=(ae,fe,Me)=>{const Ve=fe.component=ae.component;if(r1(ae,fe,Me))if(Ve.asyncDep&&!Ve.asyncResolved){It(Ve,fe,Me);return}else Ve.next=fe,Ve.update();else fe.el=ae.el,Ve.vnode=fe},_t=(ae,fe,Me,Ve,Be,Oe,Ke)=>{const Ye=()=>{if(ae.isMounted){let{next:et,bu:ut,u:gt,parent:Mt,vnode:Wt}=ae;{const si=iv(ae);if(si){et&&(et.el=Wt.el,It(ae,et,Ke)),si.asyncDep.then(()=>{ae.isUnmounted||Ye()});return}}let Ft=et,Dr;io(ae,!1),et?(et.el=Wt.el,It(ae,et,Ke)):et=Wt,ut&&Gd(ut),(Dr=et.props&&et.props.onVnodeBeforeUpdate)&&Js(Dr,Mt,et,Wt),io(ae,!0);const wr=g_(ae),ii=ae.subTree;ae.subTree=wr,rt(ii,wr,ne(ii.el),Xi(ii),ae,Be,Oe),et.el=wr.el,Ft===null&&i1(ae,wr.el),gt&&ms(gt,Be),(Dr=et.props&&et.props.onVnodeUpdated)&&ms(()=>Js(Dr,Mt,et,Wt),Be)}else{let et;const{el:ut,props:gt}=fe,{bm:Mt,m:Wt,parent:Ft,root:Dr,type:wr}=ae,ii=Il(fe);io(ae,!1),Mt&&Gd(Mt),!ii&&(et=gt&&gt.onVnodeBeforeMount)&&Js(et,Ft,fe),io(ae,!0);{Dr.ce&&Dr.ce._injectChildStyle(wr);const si=ae.subTree=g_(ae);rt(null,si,Me,Ve,ae,Be,Oe),fe.el=si.el}if(Wt&&ms(Wt,Be),!ii&&(et=gt&&gt.onVnodeMounted)){const si=fe;ms(()=>Js(et,Ft,si),Be)}(fe.shapeFlag&256||Ft&&Il(Ft.vnode)&&Ft.vnode.shapeFlag&256)&&ae.a&&ms(ae.a,Be),ae.isMounted=!0,fe=Me=Ve=null}};ae.scope.on();const Ze=ae.effect=new gy(Ye);ae.scope.off();const $e=ae.update=Ze.run.bind(Ze),dt=ae.job=Ze.runIfDirty.bind(Ze);dt.i=ae,dt.id=ae.uid,Ze.scheduler=()=>Wf(dt),io(ae,!0),$e()},It=(ae,fe,Me)=>{fe.component=ae;const Ve=ae.vnode.props;ae.vnode=fe,ae.next=null,jb(ae,fe.props,Ve,Me),Zb(ae,fe.children,Me),ya(),l_(ae),va()},Gt=(ae,fe,Me,Ve,Be,Oe,Ke,Ye,Ze=!1)=>{const $e=ae&&ae.children,dt=ae?ae.shapeFlag:0,et=fe.children,{patchFlag:ut,shapeFlag:gt}=fe;if(ut>0){if(ut&128){Wi($e,et,Me,Ve,Be,Oe,Ke,Ye,Ze);return}else if(ut&256){vi($e,et,Me,Ve,Be,Oe,Ke,Ye,Ze);return}}gt&8?(dt&16&&Li($e,Be,Oe),et!==$e&&Y(Me,et)):dt&16?gt&16?Wi($e,et,Me,Ve,Be,Oe,Ke,Ye,Ze):Li($e,Be,Oe,!0):(dt&8&&Y(Me,""),gt&16&&pt(et,Me,Ve,Be,Oe,Ke,Ye,Ze))},vi=(ae,fe,Me,Ve,Be,Oe,Ke,Ye,Ze)=>{ae=ae||Sl,fe=fe||Sl;const $e=ae.length,dt=fe.length,et=Math.min($e,dt);let ut;for(ut=0;ut<et;ut++){const gt=fe[ut]=Ze?da(fe[ut]):tn(fe[ut]);rt(ae[ut],gt,Me,null,Be,Oe,Ke,Ye,Ze)}$e>dt?Li(ae,Be,Oe,!0,!1,et):pt(fe,Me,Ve,Be,Oe,Ke,Ye,Ze,et)},Wi=(ae,fe,Me,Ve,Be,Oe,Ke,Ye,Ze)=>{let $e=0;const dt=fe.length;let et=ae.length-1,ut=dt-1;for(;$e<=et&&$e<=ut;){const gt=ae[$e],Mt=fe[$e]=Ze?da(fe[$e]):tn(fe[$e]);if(au(gt,Mt))rt(gt,Mt,Me,null,Be,Oe,Ke,Ye,Ze);else break;$e++}for(;$e<=et&&$e<=ut;){const gt=ae[et],Mt=fe[ut]=Ze?da(fe[ut]):tn(fe[ut]);if(au(gt,Mt))rt(gt,Mt,Me,null,Be,Oe,Ke,Ye,Ze);else break;et--,ut--}if($e>et){if($e<=ut){const gt=ut+1,Mt=gt<dt?fe[gt].el:Ve;for(;$e<=ut;)rt(null,fe[$e]=Ze?da(fe[$e]):tn(fe[$e]),Me,Mt,Be,Oe,Ke,Ye,Ze),$e++}}else if($e>ut)for(;$e<=et;)Rr(ae[$e],Be,Oe,!0),$e++;else{const gt=$e,Mt=$e,Wt=new Map;for($e=Mt;$e<=ut;$e++){const H=fe[$e]=Ze?da(fe[$e]):tn(fe[$e]);H.key!=null&&Wt.set(H.key,$e)}let Ft,Dr=0;const wr=ut-Mt+1;let ii=!1,si=0;const as=new Array(wr);for($e=0;$e<wr;$e++)as[$e]=0;for($e=gt;$e<=et;$e++){const H=ae[$e];if(Dr>=wr){Rr(H,Be,Oe,!0);continue}let N;if(H.key!=null)N=Wt.get(H.key);else for(Ft=Mt;Ft<=ut;Ft++)if(as[Ft-Mt]===0&&au(H,fe[Ft])){N=Ft;break}N===void 0?Rr(H,Be,Oe,!0):(as[N-Mt]=$e+1,N>=si?si=N:ii=!0,rt(H,fe[N],Me,null,Be,Oe,Ke,Ye,Ze),Dr++)}const os=ii?Wb(as):Sl;for(Ft=os.length-1,$e=wr-1;$e>=0;$e--){const H=Mt+$e,N=fe[H],$=H+1<dt?fe[H+1].el:Ve;as[$e]===0?rt(null,N,Me,$,Be,Oe,Ke,Ye,Ze):ii&&(Ft<0||$e!==os[Ft]?Mi(N,Me,$,2):Ft--)}}},Mi=(ae,fe,Me,Ve,Be=null)=>{const{el:Oe,type:Ke,transition:Ye,children:Ze,shapeFlag:$e}=ae;if($e&6){Mi(ae.component.subTree,fe,Me,Ve);return}if($e&128){ae.suspense.move(fe,Me,Ve);return}if($e&64){Ke.move(ae,fe,Me,ns);return}if(Ke===is){_(Oe,fe,Me);for(let et=0;et<Ze.length;et++)Mi(Ze[et],fe,Me,Ve);_(ae.anchor,fe,Me);return}if(Ke===ep){Pt(ae,fe,Me);return}if(Ve!==2&&$e&1&&Ye)if(Ve===0)Ye.beforeEnter(Oe),_(Oe,fe,Me),ms(()=>Ye.enter(Oe),Be);else{const{leave:et,delayLeave:ut,afterLeave:gt}=Ye,Mt=()=>_(Oe,fe,Me),Wt=()=>{et(Oe,()=>{Mt(),gt&&gt()})};ut?ut(Oe,Mt,Wt):Wt()}else _(Oe,fe,Me)},Rr=(ae,fe,Me,Ve=!1,Be=!1)=>{const{type:Oe,props:Ke,ref:Ye,children:Ze,dynamicChildren:$e,shapeFlag:dt,patchFlag:et,dirs:ut,cacheIndex:gt}=ae;if(et===-2&&(Be=!1),Ye!=null&&op(Ye,null,Me,ae,!0),gt!=null&&(fe.renderCache[gt]=void 0),dt&256){fe.ctx.deactivate(ae);return}const Mt=dt&1&&ut,Wt=!Il(ae);let Ft;if(Wt&&(Ft=Ke&&Ke.onVnodeBeforeUnmount)&&Js(Ft,fe,ae),dt&6)Ur(ae.component,Me,Ve);else{if(dt&128){ae.suspense.unmount(Me,Ve);return}Mt&&ro(ae,null,fe,"beforeUnmount"),dt&64?ae.type.remove(ae,fe,Me,ns,Ve):$e&&!$e.hasOnce&&(Oe!==is||et>0&&et&64)?Li($e,fe,Me,!1,!0):(Oe===is&&et&384||!Be&&dt&16)&&Li(Ze,fe,Me),Ve&&Pi(ae)}(Wt&&(Ft=Ke&&Ke.onVnodeUnmounted)||Mt)&&ms(()=>{Ft&&Js(Ft,fe,ae),Mt&&ro(ae,null,fe,"unmounted")},Me)},Pi=ae=>{const{type:fe,el:Me,anchor:Ve,transition:Be}=ae;if(fe===is){Ii(Me,Ve);return}if(fe===ep){nt(ae);return}const Oe=()=>{b(Me),Be&&!Be.persisted&&Be.afterLeave&&Be.afterLeave()};if(ae.shapeFlag&1&&Be&&!Be.persisted){const{leave:Ke,delayLeave:Ye}=Be,Ze=()=>Ke(Me,Oe);Ye?Ye(ae.el,Oe,Ze):Ze()}else Oe()},Ii=(ae,fe)=>{let Me;for(;ae!==fe;)Me=ge(ae),b(ae),ae=Me;b(fe)},Ur=(ae,fe,Me)=>{const{bum:Ve,scope:Be,job:Oe,subTree:Ke,um:Ye,m:Ze,a:$e}=ae;m_(Ze),m_($e),Ve&&Gd(Ve),Be.stop(),Oe&&(Oe.flags|=8,Rr(Ke,ae,fe,Me)),Ye&&ms(Ye,fe),ms(()=>{ae.isUnmounted=!0},fe),fe&&fe.pendingBranch&&!fe.isUnmounted&&ae.asyncDep&&!ae.asyncResolved&&ae.suspenseId===fe.pendingId&&(fe.deps--,fe.deps===0&&fe.resolve())},Li=(ae,fe,Me,Ve=!1,Be=!1,Oe=0)=>{for(let Ke=Oe;Ke<ae.length;Ke++)Rr(ae[Ke],fe,Me,Ve,Be)},Xi=ae=>{if(ae.shapeFlag&6)return Xi(ae.component.subTree);if(ae.shapeFlag&128)return ae.suspense.next();const fe=ge(ae.anchor||ae.el),Me=fe&&fe[fb];return Me?ge(Me):fe};let ss=!1;const hi=(ae,fe,Me)=>{ae==null?fe._vnode&&Rr(fe._vnode,null,null,!0):rt(fe._vnode||null,ae,fe,null,null,null,Me),fe._vnode=ae,ss||(ss=!0,l_(),Ly(),ss=!1)},ns={p:rt,um:Rr,m:Mi,r:Pi,mt:Mr,mc:pt,pc:Gt,pbc:cr,n:Xi,o:l};return{render:hi,hydrate:void 0,createApp:Bb(hi)}}function Jd({type:l,props:n},p){return p==="svg"&&l==="foreignObject"||p==="mathml"&&l==="annotation-xml"&&n&&n.encoding&&n.encoding.includes("html")?void 0:p}function io({effect:l,job:n},p){p?(l.flags|=32,n.flags|=4):(l.flags&=-33,n.flags&=-5)}function Hb(l,n){return(!l||l&&!l.pendingBranch)&&n&&!n.persisted}function rv(l,n,p=!1){const _=l.children,b=n.children;if(Rt(_)&&Rt(b))for(let M=0;M<_.length;M++){const x=_[M];let c=b[M];c.shapeFlag&1&&!c.dynamicChildren&&((c.patchFlag<=0||c.patchFlag===32)&&(c=b[M]=da(b[M]),c.el=x.el),!p&&c.patchFlag!==-2&&rv(x,c)),c.type===Ip&&(c.el=x.el)}}function Wb(l){const n=l.slice(),p=[0];let _,b,M,x,c;const B=l.length;for(_=0;_<B;_++){const q=l[_];if(q!==0){if(b=p[p.length-1],l[b]<q){n[_]=b,p.push(_);continue}for(M=0,x=p.length-1;M<x;)c=M+x>>1,l[p[c]]<q?M=c+1:x=c;q<l[p[M]]&&(M>0&&(n[_]=p[M-1]),p[M]=_)}}for(M=p.length,x=p[M-1];M-- >0;)p[M]=x,x=n[x];return p}function iv(l){const n=l.subTree.component;if(n)return n.asyncDep&&!n.asyncResolved?n:iv(n)}function m_(l){if(l)for(let n=0;n<l.length;n++)l[n].flags|=8}const Xb=Symbol.for("v-scx"),Yb=()=>pu(Xb);function $s(l,n,p){return sv(l,n,p)}function sv(l,n,p=br){const{immediate:_,deep:b,flush:M,once:x}=p,c=Di({},p),B=n&&_||!n&&M!=="post";let q;if(xu){if(M==="sync"){const Q=Yb();q=Q.__watcherHandles||(Q.__watcherHandles=[])}else if(!B){const Q=()=>{};return Q.stop=nn,Q.resume=nn,Q.pause=nn,Q}}const Y=Si;c.call=(Q,Se,rt)=>on(Q,Y,Se,rt);let ne=!1;M==="post"?c.scheduler=Q=>{ms(Q,Y&&Y.suspense)}:M!=="sync"&&(ne=!0,c.scheduler=(Q,Se)=>{Se?Q():Wf(Q)}),c.augmentJob=Q=>{n&&(Q.flags|=4),ne&&(Q.flags|=2,Y&&(Q.id=Y.uid,Q.i=Y))};const ge=ub(l,n,c);return xu&&(q?q.push(ge):B&&ge()),ge}function Kb(l,n,p){const _=this.proxy,b=ui(l)?l.includes(".")?nv(_,l):()=>_[l]:l.bind(_,_);let M;Lt(n)?M=n:(M=n.handler,p=n);const x=Pu(this),c=sv(b,M.bind(_),p);return x(),c}function nv(l,n){const p=n.split(".");return()=>{let _=l;for(let b=0;b<p.length&&_;b++)_=_[p[b]];return _}}const Jb=(l,n)=>n==="modelValue"||n==="model-value"?l.modelModifiers:l[`${n}Modifiers`]||l[`${Is(n)}Modifiers`]||l[`${vo(n)}Modifiers`];function Qb(l,n,...p){if(l.isUnmounted)return;const _=l.vnode.props||br;let b=p;const M=n.startsWith("update:"),x=M&&Jb(_,n.slice(7));x&&(x.trim&&(b=p.map(Y=>ui(Y)?Y.trim():Y)),x.number&&(b=p.map(I0)));let c,B=_[c=qd(n)]||_[c=qd(Is(n))];!B&&M&&(B=_[c=qd(vo(n))]),B&&on(B,l,6,b);const q=_[c+"Once"];if(q){if(!l.emitted)l.emitted={};else if(l.emitted[c])return;l.emitted[c]=!0,on(q,l,6,b)}}function av(l,n,p=!1){const _=n.emitsCache,b=_.get(l);if(b!==void 0)return b;const M=l.emits;let x={},c=!1;if(!Lt(l)){const B=q=>{const Y=av(q,n,!0);Y&&(c=!0,Di(x,Y))};!p&&n.mixins.length&&n.mixins.forEach(B),l.extends&&B(l.extends),l.mixins&&l.mixins.forEach(B)}return!M&&!c?($r(l)&&_.set(l,null),null):(Rt(M)?M.forEach(B=>x[B]=null):Di(x,M),$r(l)&&_.set(l,x),x)}function Pp(l,n){return!l||!yp(n)?!1:(n=n.slice(2).replace(/Once$/,""),nr(l,n[0].toLowerCase()+n.slice(1))||nr(l,vo(n))||nr(l,n))}function g_(l){const{type:n,vnode:p,proxy:_,withProxy:b,propsOptions:[M],slots:x,attrs:c,emit:B,render:q,renderCache:Y,props:ne,data:ge,setupState:Q,ctx:Se,inheritAttrs:rt}=l,St=ap(l);let vt,bt;try{if(p.shapeFlag&4){const nt=b||_,Ct=nt;vt=tn(q.call(Ct,nt,Y,ne,Q,ge,Se)),bt=c}else{const nt=n;vt=tn(nt.length>1?nt(ne,{attrs:c,slots:x,emit:B}):nt(ne,null)),bt=n.props?c:e1(c)}}catch(nt){du.length=0,Sp(nt,l,1),vt=Ti(_a)}let Pt=vt;if(bt&&rt!==!1){const nt=Object.keys(bt),{shapeFlag:Ct}=Pt;nt.length&&Ct&7&&(M&&nt.some(Lf)&&(bt=t1(bt,M)),Pt=kl(Pt,bt,!1,!0))}return p.dirs&&(Pt=kl(Pt,null,!1,!0),Pt.dirs=Pt.dirs?Pt.dirs.concat(p.dirs):p.dirs),p.transition&&Xf(Pt,p.transition),vt=Pt,ap(St),vt}const e1=l=>{let n;for(const p in l)(p==="class"||p==="style"||yp(p))&&((n||(n={}))[p]=l[p]);return n},t1=(l,n)=>{const p={};for(const _ in l)(!Lf(_)||!(_.slice(9)in n))&&(p[_]=l[_]);return p};function r1(l,n,p){const{props:_,children:b,component:M}=l,{props:x,children:c,patchFlag:B}=n,q=M.emitsOptions;if(n.dirs||n.transition)return!0;if(p&&B>=0){if(B&1024)return!0;if(B&16)return _?__(_,x,q):!!x;if(B&8){const Y=n.dynamicProps;for(let ne=0;ne<Y.length;ne++){const ge=Y[ne];if(x[ge]!==_[ge]&&!Pp(q,ge))return!0}}}else return(b||c)&&(!c||!c.$stable)?!0:_===x?!1:_?x?__(_,x,q):!0:!!x;return!1}function __(l,n,p){const _=Object.keys(n);if(_.length!==Object.keys(l).length)return!0;for(let b=0;b<_.length;b++){const M=_[b];if(n[M]!==l[M]&&!Pp(p,M))return!0}return!1}function i1({vnode:l,parent:n},p){for(;n;){const _=n.subTree;if(_.suspense&&_.suspense.activeBranch===l&&(_.el=l.el),_===l)(l=n.vnode).el=p,n=n.parent;else break}}const ov=l=>l.__isSuspense;function s1(l,n){n&&n.pendingBranch?Rt(l)?n.effects.push(...l):n.effects.push(l):db(l)}const is=Symbol.for("v-fgt"),Ip=Symbol.for("v-txt"),_a=Symbol.for("v-cmt"),ep=Symbol.for("v-stc"),du=[];let gs=null;function zi(l=!1){du.push(gs=l?null:[])}function n1(){du.pop(),gs=du[du.length-1]||null}let vu=1;function y_(l,n=!1){vu+=l,l<0&&gs&&n&&(gs.hasOnce=!0)}function lv(l){return l.dynamicChildren=vu>0?gs||Sl:null,n1(),vu>0&&gs&&gs.push(l),l}function Ms(l,n,p,_,b,M){return lv(xt(l,n,p,_,b,M,!0))}function cp(l,n,p,_,b){return lv(Ti(l,n,p,_,b,!0))}function Jf(l){return l?l.__v_isVNode===!0:!1}function au(l,n){return l.type===n.type&&l.key===n.key}const cv=({key:l})=>l??null,tp=({ref:l,ref_key:n,ref_for:p})=>(typeof l=="number"&&(l=""+l),l!=null?ui(l)||Yr(l)||Lt(l)?{i:Ri,r:l,k:n,f:!!p}:l:null);function xt(l,n=null,p=null,_=0,b=null,M=l===is?0:1,x=!1,c=!1){const B={__v_isVNode:!0,__v_skip:!0,type:l,props:n,key:n&&cv(n),ref:n&&tp(n),scopeId:By,slotScopeIds:null,children:p,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:M,patchFlag:_,dynamicProps:b,dynamicChildren:null,appContext:null,ctx:Ri};return c?(Qf(B,p),M&128&&l.normalize(B)):p&&(B.shapeFlag|=ui(p)?8:16),vu>0&&!x&&gs&&(B.patchFlag>0||M&6)&&B.patchFlag!==32&&gs.push(B),B}const Ti=a1;function a1(l,n=null,p=null,_=0,b=null,M=!1){if((!l||l===Cb)&&(l=_a),Jf(l)){const c=kl(l,n,!0);return p&&Qf(c,p),vu>0&&!M&&gs&&(c.shapeFlag&6?gs[gs.indexOf(l)]=c:gs.push(c)),c.patchFlag=-2,c}if(y1(l)&&(l=l.__vccOpts),n){n=o1(n);let{class:c,style:B}=n;c&&!ui(c)&&(n.class=co(c)),$r(B)&&(Gf(B)&&!Rt(B)&&(B=Di({},B)),n.style=Of(B))}const x=ui(l)?1:ov(l)?128:mb(l)?64:$r(l)?4:Lt(l)?2:0;return xt(l,n,p,_,b,x,M,!0)}function o1(l){return l?Gf(l)||Xy(l)?Di({},l):l:null}function kl(l,n,p=!1,_=!1){const{props:b,ref:M,patchFlag:x,children:c,transition:B}=l,q=n?c1(b||{},n):b,Y={__v_isVNode:!0,__v_skip:!0,type:l.type,props:q,key:q&&cv(q),ref:n&&n.ref?p&&M?Rt(M)?M.concat(tp(n)):[M,tp(n)]:tp(n):M,scopeId:l.scopeId,slotScopeIds:l.slotScopeIds,children:c,target:l.target,targetStart:l.targetStart,targetAnchor:l.targetAnchor,staticCount:l.staticCount,shapeFlag:l.shapeFlag,patchFlag:n&&l.type!==is?x===-1?16:x|16:x,dynamicProps:l.dynamicProps,dynamicChildren:l.dynamicChildren,appContext:l.appContext,dirs:l.dirs,transition:B,component:l.component,suspense:l.suspense,ssContent:l.ssContent&&kl(l.ssContent),ssFallback:l.ssFallback&&kl(l.ssFallback),el:l.el,anchor:l.anchor,ctx:l.ctx,ce:l.ce};return B&&_&&Xf(Y,B.clone(Y)),Y}function oo(l=" ",n=0){return Ti(Ip,null,l,n)}function l1(l,n){const p=Ti(ep,null,l);return p.staticCount=n,p}function wl(l="",n=!1){return n?(zi(),cp(_a,null,l)):Ti(_a,null,l)}function tn(l){return l==null||typeof l=="boolean"?Ti(_a):Rt(l)?Ti(is,null,l.slice()):Jf(l)?da(l):Ti(Ip,null,String(l))}function da(l){return l.el===null&&l.patchFlag!==-1||l.memo?l:kl(l)}function Qf(l,n){let p=0;const{shapeFlag:_}=l;if(n==null)n=null;else if(Rt(n))p=16;else if(typeof n=="object")if(_&65){const b=n.default;b&&(b._c&&(b._d=!1),Qf(l,b()),b._c&&(b._d=!0));return}else{p=32;const b=n._;!b&&!Xy(n)?n._ctx=Ri:b===3&&Ri&&(Ri.slots._===1?n._=1:(n._=2,l.patchFlag|=1024))}else Lt(n)?(n={default:n,_ctx:Ri},p=32):(n=String(n),_&64?(p=16,n=[oo(n)]):p=8);l.children=n,l.shapeFlag|=p}function c1(...l){const n={};for(let p=0;p<l.length;p++){const _=l[p];for(const b in _)if(b==="class")n.class!==_.class&&(n.class=co([n.class,_.class]));else if(b==="style")n.style=Of([n.style,_.style]);else if(yp(b)){const M=n[b],x=_[b];x&&M!==x&&!(Rt(M)&&M.includes(x))&&(n[b]=M?[].concat(M,x):x)}else b!==""&&(n[b]=_[b])}return n}function Js(l,n,p,_=null){on(l,n,7,[p,_])}const u1=qy();let h1=0;function p1(l,n,p){const _=l.type,b=(n?n.appContext:l.appContext)||u1,M={uid:h1++,vnode:l,type:_,parent:n,appContext:b,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new dy(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:n?n.provides:Object.create(b.provides),ids:n?n.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Ky(_,b),emitsOptions:av(_,b),emit:null,emitted:null,propsDefaults:br,inheritAttrs:_.inheritAttrs,ctx:br,data:br,props:br,attrs:br,slots:br,refs:br,setupState:br,setupContext:null,suspense:p,suspenseId:p?p.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 M.ctx={_:M},M.root=n?n.root:M,M.emit=Qb.bind(null,M),l.ce&&l.ce(M),M}let Si=null,up,bf;{const l=wp(),n=(p,_)=>{let b;return(b=l[p])||(b=l[p]=[]),b.push(_),M=>{b.length>1?b.forEach(x=>x(M)):b[0](M)}};up=n("__VUE_INSTANCE_SETTERS__",p=>Si=p),bf=n("__VUE_SSR_SETTERS__",p=>xu=p)}const Pu=l=>{const n=Si;return up(l),l.scope.on(),()=>{l.scope.off(),up(n)}},v_=()=>{Si&&Si.scope.off(),up(null)};function uv(l){return l.vnode.shapeFlag&4}let xu=!1;function d1(l,n=!1,p=!1){n&&bf(n);const{props:_,children:b}=l.vnode,M=uv(l);Nb(l,_,M,n),Ub(l,b,p);const x=M?f1(l,n):void 0;return n&&bf(!1),x}function f1(l,n){const p=l.type;l.accessCache=Object.create(null),l.proxy=new Proxy(l.ctx,Ab);const{setup:_}=p;if(_){ya();const b=l.setupContext=_.length>1?g1(l):null,M=Pu(l),x=Su(_,l,0,[l.props,b]),c=ay(x);if(va(),M(),(c||l.sp)&&!Il(l)&&Oy(l),c){if(x.then(v_,v_),n)return x.then(B=>{x_(l,B)}).catch(B=>{Sp(B,l,0)});l.asyncDep=x}else x_(l,x)}else hv(l)}function x_(l,n,p){Lt(n)?l.type.__ssrInlineRender?l.ssrRender=n:l.render=n:$r(n)&&(l.setupState=ky(n)),hv(l)}function hv(l,n,p){const _=l.type;l.render||(l.render=_.render||nn);{const b=Pu(l);ya();try{kb(l)}finally{va(),b()}}}const m1={get(l,n){return ki(l,"get",""),l[n]}};function g1(l){const n=p=>{l.exposed=p||{}};return{attrs:new Proxy(l.attrs,m1),slots:l.slots,emit:l.emit,expose:n}}function em(l){return l.exposed?l.exposeProxy||(l.exposeProxy=new Proxy(ky(Hf(l.exposed)),{get(n,p){if(p in n)return n[p];if(p in hu)return hu[p](l)}
vendor: 8,358 bytes, lines 13-21
13,has(n,p){return p in n||p in hu}})):l.proxy}function _1(l,n=!0){return Lt(l)?l.displayName||l.name:l.name||n&&l.__name}function y1(l){return Lt(l)&&"__vccOpts"in l}const pv=(l,n)=>lb(l,n,xu),v1="3.5.13";/**
14* @vue/runtime-dom v3.5.13
15* (c) 2018-present Yuxi (Evan) You and Vue contributors
16* @license MIT
17**/let wf;const b_=typeof window<"u"&&window.trustedTypes;if(b_)try{wf=b_.createPolicy("vue",{createHTML:l=>l})}catch{}const dv=wf?l=>wf.createHTML(l):l=>l,x1="http://www.w3.org/2000/svg",b1="http://www.w3.org/1998/Math/MathML",An=typeof document<"u"?document:null,w_=An&&An.createElement("template"),w1={insert:(l,n,p)=>{n.insertBefore(l,p||null)},remove:l=>{const n=l.parentNode;n&&n.removeChild(l)},createElement:(l,n,p,_)=>{const b=n==="svg"?An.createElementNS(x1,l):n==="mathml"?An.createElementNS(b1,l):p?An.createElement(l,{is:p}):An.createElement(l);return l==="select"&&_&&_.multiple!=null&&b.setAttribute("multiple",_.multiple),b},createText:l=>An.createTextNode(l),createComment:l=>An.createComment(l),setText:(l,n)=>{l.nodeValue=n},setElementText:(l,n)=>{l.textContent=n},parentNode:l=>l.parentNode,nextSibling:l=>l.nextSibling,querySelector:l=>An.querySelector(l),setScopeId(l,n){l.setAttribute(n,"")},insertStaticContent(l,n,p,_,b,M){const x=p?p.previousSibling:n.lastChild;if(b&&(b===M||b.nextSibling))for(;n.insertBefore(b.cloneNode(!0),p),!(b===M||!(b=b.nextSibling)););else{w_.innerHTML=dv(_==="svg"?`<svg>${l}</svg>`:_==="mathml"?`<math>${l}</math>`:l);const c=w_.content;if(_==="svg"||_==="mathml"){const B=c.firstChild;for(;B.firstChild;)c.appendChild(B.firstChild);c.removeChild(B)}n.insertBefore(c,p)}return[x?x.nextSibling:n.firstChild,p?p.previousSibling:n.lastChild]}},T1=Symbol("_vtc");function S1(l,n,p){const _=l[T1];_&&(n=(n?[n,..._]:[..._]).join(" ")),n==null?l.removeAttribute("class"):p?l.setAttribute("class",n):l.className=n}const T_=Symbol("_vod"),M1=Symbol("_vsh"),P1=Symbol(""),I1=/(^|;)\s*display\s*:/;function C1(l,n,p){const _=l.style,b=ui(p);let M=!1;if(p&&!b){if(n)if(ui(n))for(const x of n.split(";")){const c=x.slice(0,x.indexOf(":")).trim();p[c]==null&&rp(_,c,"")}else for(const x in n)p[x]==null&&rp(_,x,"");for(const x in p)x==="display"&&(M=!0),rp(_,x,p[x])}else if(b){if(n!==p){const x=_[P1];x&&(p+=";"+x),_.cssText=p,M=I1.test(p)}}else n&&l.removeAttribute("style");T_ in l&&(l[T_]=M?_.display:"",l[M1]&&(_.display="none"))}const S_=/\s*!important$/;function rp(l,n,p){if(Rt(p))p.forEach(_=>rp(l,n,_));else if(p==null&&(p=""),n.startsWith("--"))l.setProperty(n,p);else{const _=E1(l,n);S_.test(p)?l.setProperty(vo(_),p.replace(S_,""),"important"):l[_]=p}}const M_=["Webkit","Moz","ms"],Qd={};function E1(l,n){const p=Qd[n];if(p)return p;let _=Is(n);if(_!=="filter"&&_ in l)return Qd[n]=_;_=bp(_);for(let b=0;b<M_.length;b++){const M=M_[b]+_;if(M in l)return Qd[n]=M}return n}const P_="http://www.w3.org/1999/xlink";function I_(l,n,p,_,b,M=R0(n)){_&&n.startsWith("xlink:")?p==null?l.removeAttributeNS(P_,n.slice(6,n.length)):l.setAttributeNS(P_,n,p):p==null||M&&!uy(p)?l.removeAttribute(n):l.setAttribute(n,M?"":Bn(p)?String(p):p)}function C_(l,n,p,_,b){if(n==="innerHTML"||n==="textContent"){p!=null&&(l[n]=n==="innerHTML"?dv(p):p);return}const M=l.tagName;if(n==="value"&&M!=="PROGRESS"&&!M.includes("-")){const c=M==="OPTION"?l.getAttribute("value")||"":l.value,B=p==null?l.type==="checkbox"?"on":"":String(p);(c!==B||!("_value"in l))&&(l.value=B),p==null&&l.removeAttribute(n),l._value=p;return}let x=!1;if(p===""||p==null){const c=typeof l[n];c==="boolean"?p=uy(p):p==null&&c==="string"?(p="",x=!0):c==="number"&&(p=0,x=!0)}try{l[n]=p}catch{}x&&l.removeAttribute(b||n)}function A1(l,n,p,_){l.addEventListener(n,p,_)}function k1(l,n,p,_){l.removeEventListener(n,p,_)}const E_=Symbol("_vei");function z1(l,n,p,_,b=null){const M=l[E_]||(l[E_]={}),x=M[n];if(_&&x)x.value=_;else{const[c,B]=R1(n);if(_){const q=M[n]=F1(_,b);A1(l,c,q,B)}else x&&(k1(l,c,x,B),M[n]=void 0)}}const A_=/(?:Once|Passive|Capture)$/;function R1(l){let n;if(A_.test(l)){n={};let _;for(;_=l.match(A_);)l=l.slice(0,l.length-_[0].length),n[_[0].toLowerCase()]=!0}return[l[2]===":"?l.slice(3):vo(l.slice(2)),n]}let ef=0;const D1=Promise.resolve(),L1=()=>ef||(D1.then(()=>ef=0),ef=Date.now());function F1(l,n){const p=_=>{if(!_._vts)_._vts=Date.now();else if(_._vts<=p.attached)return;on(B1(_,p.value),n,5,[_])};return p.value=l,p.attached=L1(),p}function B1(l,n){if(Rt(n)){const p=l.stopImmediatePropagation;return l.stopImmediatePropagation=()=>{p.call(l),l._stopped=!0},n.map(_=>b=>!b._stopped&&_&&_(b))}else return n}const k_=l=>l.charCodeAt(0)===111&&l.charCodeAt(1)===110&&l.charCodeAt(2)>96&&l.charCodeAt(2)<123,O1=(l,n,p,_,b,M)=>{const x=b==="svg";n==="class"?S1(l,_,x):n==="style"?C1(l,p,_):yp(n)?Lf(n)||z1(l,n,p,_,M):(n[0]==="."?(n=n.slice(1),!0):n[0]==="^"?(n=n.slice(1),!1):N1(l,n,_,x))?(C_(l,n,_),!l.tagName.includes("-")&&(n==="value"||n==="checked"||n==="selected")&&I_(l,n,_,x,M,n!=="value")):l._isVueCE&&(/[A-Z]/.test(n)||!ui(_))?C_(l,Is(n),_,M,n):(n==="true-value"?l._trueValue=_:n==="false-value"&&(l._falseValue=_),I_(l,n,_,x))};function N1(l,n,p,_){if(_)return!!(n==="innerHTML"||n==="textContent"||n in l&&k_(n)&&Lt(p));if(n==="spellcheck"||n==="draggable"||n==="translate"||n==="form"||n==="list"&&l.tagName==="INPUT"||n==="type"&&l.tagName==="TEXTAREA")return!1;if(n==="width"||n==="height"){const b=l.tagName;if(b==="IMG"||b==="VIDEO"||b==="CANVAS"||b==="SOURCE")return!1}return k_(n)&&ui(p)?!1:n in l}const j1=Di({patchProp:O1},w1);let z_;function V1(){return z_||(z_=qb(j1))}const $1=(...l)=>{const n=V1().createApp(...l),{mount:p}=n;return n.mount=_=>{const b=Z1(_);if(!b)return;const M=n._component;!Lt(M)&&!M.render&&!M.template&&(M.template=b.innerHTML),b.nodeType===1&&(b.textContent="");const x=p(b,!1,U1(b));return b instanceof Element&&(b.removeAttribute("v-cloak"),b.setAttribute("data-v-app","")),x},n};function U1(l){if(l instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&l instanceof MathMLElement)return"mathml"}function Z1(l){return ui(l)?document.querySelector(l):l}/*!
18 * pinia v2.3.1
19 * (c) 2025 Eduardo San Martin Morote
20 * @license MIT
21 */let fv;const Cp=l=>fv=l,mv=Symbol();function Tf(l){return l&&typeof l=="object"&&Object.prototype.toString.call(l)==="[object Object]"&&typeof l.toJSON!="function"}var fu;(function(l){l.direct="direct",l.patchObject="patch object",l.patchFunction="patch function"})(fu||(fu={}));function q1(){const l=fy(!0),n=l.run(()=>wi({}));let p=[],_=[];const b=Hf({install(M){Cp(b),b._a=M,M.provide(mv,b),M.config.globalProperties.$pinia=b,_.forEach(x=>p.push(x)),_=[]},use(M){return this._a?p.push(M):_.push(M),this},_p:p,_a:null,_e:l,_s:new Map,state:n});return b}const gv=()=>{};function R_(l,n,p,_=gv){l.push(n);const b=()=>{const M=l.indexOf(n);M>-1&&(l.splice(M,1),_())};return!p&&my()&&D0(b),b}function vl(l,...n){l.slice().forEach(p=>{p(...n)})}const G1=l=>l(),D_=Symbol(),tf=Symbol();function Sf(l,n){l instanceof Map&&n instanceof Map?n.forEach((p,_)=>l.set(_,p)):l instanceof Set&&n instanceof Set&&n.forEach(l.add,l);for(const p in n){if(!n.hasOwnProperty(p))continue;const _=n[p],b=l[p];Tf(b)&&Tf(_)&&l.hasOwnProperty(p)&&!Yr(_)&&!ho(_)?l[p]=Sf(b,_):l[p]=_}return l}const H1=Symbol();function W1(l){return!Tf(l)||!l.hasOwnProperty(H1)}const{assign:ha}=Object;function X1(l){return!!(Yr(l)&&l.effect)}function Y1(l,n,p,_){const{state:b,actions:M,getters:x}=n,c=p.state.value[l];let B;function q(){c||(p.state.value[l]=b?b():{});const Y=sb(p.state.value[l]);return ha(Y,M,Object.keys(x||{}).reduce((ne,ge)=>(ne[ge]=Hf(pv(()=>{Cp(p);const Q=p._s.get(l);return x[ge].call(Q,Q)})),ne),{}))}return B=_v(l,q,n,p,_,!0),B}function _v(l,n,p={},_,b,M){let x;const c=ha({actions:{}},p),B={deep:!0};let q,Y,ne=[],ge=[],Q;const Se=_.state.value[l];!M&&!Se&&(_.state.value[l]={}),wi({});let rt;function St(pt){let jt;q=Y=!1,typeof pt=="function"?(pt(_.state.value[l]),jt={type:fu.patchFunction,storeId:l,events:Q}):(Sf(_.state.value[l],pt),jt={type:fu.patchObject,payload:pt,storeId:l,events:Q});const cr=rt=Symbol();Ry().then(()=>{rt===cr&&(q=!0)}),Y=!0,vl(ne,jt,_.state.value[l])}const vt=M?function(){const{state:jt}=p,cr=jt?jt():{};this.$patch(kr=>{ha(kr,cr)})}:gv;function bt(){x.stop(),ne=[],ge=[],_._s.delete(l)}const Pt=(pt,jt="")=>{if(D_ in pt)return pt[tf]=jt,pt;const cr=function(){Cp(_);const kr=Array.from(arguments),Or=[],zr=[];
21function Mr(It){Or.push(It)}function _s(It){zr.push(It)}vl(ge,{args:kr,name:cr[tf],store:Ct,after:Mr,onError:_s});let _t;try{_t=pt.apply(this&&this.$id===l?this:Ct,kr)}catch(It){throw vl(zr,It),It}return _t instanceof Promise?_t.then(It=>(vl(Or,It),It)).catch(It=>(vl(zr,It),Promise.reject(It))):(vl(Or,_t),_t)};return cr[D_]=!0,cr[tf]=jt,cr},nt={_p:_,$id:l,$onAction:R_.bind(null,ge),$patch:St,$reset:vt,$subscribe(pt,jt={}){const cr=R_(ne,pt,jt.detached,()=>kr()),kr=x.run(()=>$s(()=>_.state.value[l],Or=>{(jt.flush==="sync"?Y:q)&&pt({storeId:l,type:fu.direct,events:Q},Or)},ha({},B,jt)));return cr},$dispose:bt},Ct=Tp(nt);_._s.set(l,Ct);const Et=(_._a&&_._a.runWithContext||G1)(()=>_._e.run(()=>(x=fy()).run(()=>n({action:Pt}))));for(const pt in Et){const jt=Et[pt];if(Yr(jt)&&!X1(jt)||ho(jt))M||(Se&&W1(jt)&&(Yr(jt)?jt.value=Se[pt]:Sf(jt,Se[pt])),_.state.value[l][pt]=jt);else if(typeof jt=="function"){const cr=Pt(jt,pt);Et[pt]=cr,c.actions[pt]=jt}}return ha(Ct,Et),ha(Jt(Ct),Et),Object.defineProperty(Ct,"$state",{get:()=>_.state.value[l],set:pt=>{St(jt=>{ha(jt,pt)})}}),_._p.forEach(pt=>{ha(Ct,x.run(()=>pt({store:Ct,app:_._a,pinia:_,options:c})))}),Se&&M&&p.hydrate&&p.hydrate(Ct.$state,Se),q=!0,Y=!0,Ct}/*! #__NO_SIDE_EFFECTS__ */function K1(l,n,p){let _,b;const M=typeof n=="function";_=l,b=M?p:n;function x(c,B){const q=Ob();return c=c||(q?pu(mv,null):null),c&&Cp(c),c=fv,c._s.has(_)||(M?_v(_,n,b,c):Y1(_,b,c)),c._s.get(_)}return x.$id=_,x}function J1(l,n){return n.forEach(function(p){p&&typeof p!="string"&&!Array.isArray(p)&&Object.keys(p).forEach(function(_){if(_!=="default"&&!(_ in l)){var b=Object.getOwnPropertyDescriptor(p,_);Object.defineProperty(l,_,b.get?b:{enumerable:!0,get:function(){return p[_]}})}})}),Object.freeze(l)}function Q1(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var Mf={exports:{}};/**
22* MapLibre GL JS
23* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v5.1.0/LICENSE.txt
24*/var ew=Mf.exports,L_;function tw(){return L_||(L_=1,function(l,n){(function(p,_){l.exports=_()})(ew,function(){var p={},_={};function b(x,c,B){if(_[x]=B,x==="index"){var q="var sharedModule = {}; ("+_.shared+")(sharedModule); ("+_.worker+")(sharedModule);",Y={};return _.shared(Y),_.index(p,Y),typeof window<"u"&&p.setWorkerUrl(window.URL.createObjectURL(new Blob([q],{type:"text/javascript"}))),p}}b("shared",["exports"],function(x){function c(s,t,i,a){return new(i||(i=Promise))(function(h,m){function g(P){try{T(a.next(P))}catch(C){m(C)}}function v(P){try{T(a.throw(P))}catch(C){m(C)}}function T(P){var C;P.done?h(P.value):(C=P.value,C instanceof i?C:new i(function(E){E(C)})).then(g,v)}T((a=a.apply(s,t||[])).next())})}function B(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var q,Y;function ne(){if(Y)return q;function s(t,i){this.x=t,this.y=i}return Y=1,q=s,s.prototype={clone:function(){return new s(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,i){return this.clone()._rotateAround(t,i)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var i=t.x-this.x,a=t.y-this.y;return i*i+a*a},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,i){return Math.atan2(this.x*i-this.y*t,this.x*t+this.y*i)},_matMult:function(t){var i=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=i,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var i=Math.cos(t),a=Math.sin(t),h=a*this.x+i*this.y;return this.x=i*this.x-a*this.y,this.y=h,this}
24,_rotateAround:function(t,i){var a=Math.cos(t),h=Math.sin(t),m=i.y+h*(this.x-i.x)+a*(this.y-i.y);return this.x=i.x+a*(this.x-i.x)-h*(this.y-i.y),this.y=m,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},s.convert=function(t){return t instanceof s?t:Array.isArray(t)?new s(t[0],t[1]):t},q}typeof SuppressedError=="function"&&SuppressedError;var ge,Q,Se=B(ne()),rt=function(){if(Q)return ge;function s(t,i,a,h){this.cx=3*t,this.bx=3*(a-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*i,this.by=3*(h-i)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=i,this.p2x=a,this.p2y=h}return Q=1,ge=s,s.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,i){if(i===void 0&&(i=1e-6),t<0)return 0;if(t>1)return 1;for(var a=t,h=0;h<8;h++){var m=this.sampleCurveX(a)-t;if(Math.abs(m)<i)return a;var g=this.sampleCurveDerivativeX(a);if(Math.abs(g)<1e-6)break;a-=m/g}var v=0,T=1;for(a=t,h=0;h<20&&(m=this.sampleCurveX(a),!(Math.abs(m-t)<i));h++)t>m?v=a:T=a,a=.5*(T-v)+v;return a},solve:function(t,i){return this.sampleCurveY(this.solveCurveX(t,i))}},ge}(),St=B(rt);let vt,bt;function Pt(){return vt==null&&(vt=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),vt}function nt(){if(bt==null&&(bt=!1,Pt())){const s=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(s){for(let i=0;i<5*5;i++){const a=4*i;s.fillStyle=`rgb(${a},${a+1},${a+2})`,s.fillRect(i%5,Math.floor(i/5),1,1)}const t=s.getImageData(0,0,5,5).data;for(let i=0;i<5*5*4;i++)if(i%4!=3&&t[i]!==i){bt=!0;break}}}return bt||!1}var Ct,Xt=1e-6,Et=typeof Float32Array<"u"?Float32Array:Array;function pt(){var s=new Et(9);return Et!=Float32Array&&(s[1]=0,s[2]=0,s[3]=0,s[5]=0,s[6]=0,s[7]=0),s[0]=1,s[4]=1,s[8]=1,s}function jt(s){return s[0]=1,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=1,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=1,s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=1,s}function cr(){var s=new Et(3);return Et!=Float32Array&&(s[0]=0,s[1]=0,s[2]=0),s}function kr(s,t,i){var a=new Et(3);return a[0]=s,a[1]=t,a[2]=i,a}function Or(s,t,i){var a=t[0],h=t[1],m=t[2],g=t[3];return s[0]=i[0]*a+i[4]*h+i[8]*m+i[12]*g,s[1]=i[1]*a+i[5]*h+i[9]*m+i[13]*g,s[2]=i[2]*a+i[6]*h+i[10]*m+i[14]*g,s[3]=i[3]*a+i[7]*h+i[11]*m+i[15]*g,s}function zr(){var s=new Et(4);return Et!=Float32Array&&(s[0]=0,s[1]=0,s[2]=0),s[3]=1,s}function Mr(){var s=new Et(2);return Et!=Float32Array&&(s[0]=0,s[1]=0),s}function _s(s,t){var i=new Et(2);return i[0]=s,i[1]=t,i}Math.hypot||(Math.hypot=function(){for(var s=0,t=arguments.length;t--;)s+=arguments[t]*arguments[t];return Math.sqrt(s)}),cr(),Ct=new Et(4),Et!=Float32Array&&(Ct[0]=0,Ct[1]=0,Ct[2]=0,Ct[3]=0),cr(),kr(1,0,0),kr(0,1,0),zr(),zr(),pt(),Mr();const _t=8192;function It(s,t,i){return t*(_t/(s.tileSize*Math.pow(2,i-s.tileID.overscaledZ)))}function Gt(s,t){return(s%t+t)%t}function vi(s,t,i){return s*(1-i)+t*i}function Wi(s){if(s<=0)return 0;if(s>=1)return 1;const t=s*s,i=t*s;return 4*(s<.5?i:3*(s-t)+i-.75)}function Mi(s,t,i,a){const h=new St(s,t,i,a);return m=>h.solve(m)}const Rr=Mi(.25,.1,.25,1);function Pi(s,t,i){return Math.min(i,Math.max(t,s))}function Ii(s,t,i){const a=i-t,h=((s-t)%a+a)%a+t;return h===t?i:h}function Ur(s,...t){for(const i of t)for(const a in i)s[a]=i[a];return s}let Li=1;function Xi(s,t,i){const a={};for(const h in s)a[h]=t.call(this,s[h],h,s);return a}function ss(s,t,i){const a={};for(const h in s)t.call(this,s[h],h,s)&&(a[h]=s[h]);return a}function hi(s){return Array.isArray(s)?s.map(hi):typeof s=="object"&&s?Xi(s,hi):s}const ns={};function ri(s){ns[s]||(typeof console<"u"&&console.warn(s),ns[s]=!0)}function ae(s,t,i){return(i.y-s.y)*(t.x-s.x)>(t.y-s.y)*(i.x-s.x)}function fe(s){return typeof WorkerGlobalScope<"u"&&s!==void 0&&s instanceof WorkerGlobalScope}let Me=null;function Ve(s){return typeof ImageBitmap<"u"&&s instanceof ImageBitmap}const Be="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Oe(s,t,i,a,h){return c(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const m=new VideoFrame(s,{timestamp:0});try{const g=m==null?void 0:m.format;if(!g||!g.startsWith("BGR")&&!g.startsWith("RGB"))throw new Error(`Unrecognized format ${g}`);const v=g.startsWith("BGR"),T=new Uint8ClampedArray(a*h*4);if(yield m.copyTo(T,function(P,C,E,z,L){const F=4*Math.max(1,0),j=(Math.max(0,E)-E)*z*4+F,G=4*z,J=Math.max(0,C),pe=Math.max(0,E);return{rect:{x:J,y:pe,width:Math.min(P.width,C+z)-J,height:Math.min(P.height,E+L)-pe},layout:[{offset:j,stride:G}]}}(s,t,i,a,h)),v)for(let P=0;P<T.length;P+=4){const C=T[P];T[P]=T[P+2],T[P+2]=C}return T}finally{m.close()}})}let Ke,Ye;function Ze(s){return s/Math.PI*180}const $e="AbortError";function dt(){return new Error($e)}const et={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function ut(s){return et.REGISTERED_PROTOCOLS[s.substring(0,s.indexOf("://"))]}
vendor: 4,360 bytes, line 24
24const gt="global-dispatcher";class Mt extends Error{constructor(t,i,a,h){super(`AJAXError: ${i} (${t}): ${a}`),this.status=t,this.statusText=i,this.url=a,this.body=h}}const Wt=()=>fe(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,Ft=function(s,t){if(/:\/\//.test(s.url)&&!/^https?:|^file:/.test(s.url)){const a=ut(s.url);if(a)return a(s,t);if(fe(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:s,targetMapId:gt},t)}if(!(/^file:/.test(i=s.url)||/^file:/.test(Wt())&&!/^\w+:/.test(i))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(a,h){return c(this,void 0,void 0,function*(){const m=new Request(a.url,{method:a.method||"GET",body:a.body,credentials:a.credentials,headers:a.headers,cache:a.cache,referrer:Wt(),signal:h.signal});let g,v;a.type!=="json"||m.headers.has("Accept")||m.headers.set("Accept","application/json");try{g=yield fetch(m)}catch(P){throw new Mt(0,P.message,a.url,new Blob)}if(!g.ok){const P=yield g.blob();throw new Mt(g.status,g.statusText,a.url,P)}v=a.type==="arrayBuffer"||a.type==="image"?g.arrayBuffer():a.type==="json"?g.json():g.text();const T=yield v;if(h.signal.aborted)throw dt();return{data:T,cacheControl:g.headers.get("Cache-Control"),expires:g.headers.get("Expires")}})}(s,t);if(fe(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:s,mustQueue:!0,targetMapId:gt},t)}var i;return function(a,h){return new Promise((m,g)=>{var v;const T=new XMLHttpRequest;T.open(a.method||"GET",a.url,!0),a.type!=="arrayBuffer"&&a.type!=="image"||(T.responseType="arraybuffer");for(const P in a.headers)T.setRequestHeader(P,a.headers[P]);a.type==="json"&&(T.responseType="text",!((v=a.headers)===null||v===void 0)&&v.Accept||T.setRequestHeader("Accept","application/json")),T.withCredentials=a.credentials==="include",T.onerror=()=>{g(new Error(T.statusText))},T.onload=()=>{if(!h.signal.aborted)if((T.status>=200&&T.status<300||T.status===0)&&T.response!==null){let P=T.response;if(a.type==="json")try{P=JSON.parse(T.response)}catch(C){return void g(C)}m({data:P,cacheControl:T.getResponseHeader("Cache-Control"),expires:T.getResponseHeader("Expires")})}else{const P=new Blob([T.response],{type:T.getResponseHeader("Content-Type")});g(new Mt(T.status,T.statusText,a.url,P))}},h.signal.addEventListener("abort",()=>{T.abort(),g(dt())}),T.send(a.body)})}(s,t)};function Dr(s){if(!s||s.indexOf("://")<=0||s.indexOf("data:image/")===0||s.indexOf("blob:")===0)return!0;const t=new URL(s),i=window.location;return t.protocol===i.protocol&&t.host===i.host}function wr(s,t,i){i[s]&&i[s].indexOf(t)!==-1||(i[s]=i[s]||[],i[s].push(t))}function ii(s,t,i){if(i&&i[s]){const a=i[s].indexOf(t);a!==-1&&i[s].splice(a,1)}}class si{constructor(t,i={}){Ur(this,i),this.type=t}}class as extends si{constructor(t,i={}){super("error",Ur({error:t},i))}}class os{on(t,i){return this._listeners=this._listeners||{},wr(t,i,this._listeners),{unsubscribe:()=>{this.off(t,i)}}}off(t,i){return ii(t,i,this._listeners),ii(t,i,this._oneTimeListeners),this}once(t,i){return i?(this._oneTimeListeners=this._oneTimeListeners||{},wr(t,i,this._oneTimeListeners),this):new Promise(a=>this.once(t,a))}fire(t,i){typeof t=="string"&&(t=new si(t,i||{}));const a=t.type;if(this.listens(a)){t.target=this;const h=this._listeners&&this._listeners[a]?this._listeners[a].slice():[];for(const v of h)v.call(this,t);const m=this._oneTimeListeners&&this._oneTimeListeners[a]?this._oneTimeListeners[a].slice():[];for(const v of m)ii(a,v,this._oneTimeListeners),v.call(this,t);const g=this._eventedParent;g&&(Ur(t,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),g.fire(t))}else t instanceof as&&console.error(t.error);return this}listens(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)}setEventedParent(t,i){return this._eventedParent=t,this._eventedParentData=i,this}}var H={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},centerAltitude:{type:"number"},zoom:{type:"number"}
vendor: 3,621 bytes, line 24
24,bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade
vendor: 8,509 bytes, line 24
24","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}
vendor: 8,954 bytes, line 24
24,"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}
vendor: 9,830 bytes, line 24
24,"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};const 
vendor: 35,767 bytes, line 24
24N=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function $(s,t){const i={};for(const a in s)a!=="ref"&&(i[a]=s[a]);return N.forEach(a=>{a in t&&(i[a]=t[a])}),i}function U(s,t){if(Array.isArray(s)){if(!Array.isArray(t)||s.length!==t.length)return!1;for(let i=0;i<s.length;i++)if(!U(s[i],t[i]))return!1;return!0}if(typeof s=="object"&&s!==null&&t!==null){if(typeof t!="object"||Object.keys(s).length!==Object.keys(t).length)return!1;for(const i in s)if(!U(s[i],t[i]))return!1;return!0}return s===t}function te(s,t){s.push(t)}function ce(s,t,i){te(i,{command:"addSource",args:[s,t[s]]})}function _e(s,t,i){te(t,{command:"removeSource",args:[s]}),i[s]=!0}function we(s,t,i,a){_e(s,i,a),ce(s,t,i)}function me(s,t,i){let a;for(a in s[i])if(Object.prototype.hasOwnProperty.call(s[i],a)&&a!=="data"&&!U(s[i][a],t[i][a]))return!1;for(a in t[i])if(Object.prototype.hasOwnProperty.call(t[i],a)&&a!=="data"&&!U(s[i][a],t[i][a]))return!1;return!0}function Ee(s,t,i,a,h,m){s=s||{},t=t||{};for(const g in s)Object.prototype.hasOwnProperty.call(s,g)&&(U(s[g],t[g])||i.push({command:m,args:[a,g,t[g],h]}));for(const g in t)Object.prototype.hasOwnProperty.call(t,g)&&!Object.prototype.hasOwnProperty.call(s,g)&&(U(s[g],t[g])||i.push({command:m,args:[a,g,t[g],h]}))}function Pe(s){return s.id}function ye(s,t){return s[t.id]=t,s}class de{constructor(t,i,a,h){this.message=(t?`${t}: `:"")+a,h&&(this.identifier=h),i!=null&&i.__line__&&(this.line=i.__line__)}}function He(s,...t){for(const i of t)for(const a in i)s[a]=i[a];return s}class qe extends Error{constructor(t,i){super(i),this.message=i,this.key=t}}class ht{constructor(t,i=[]){this.parent=t,this.bindings={};for(const[a,h]of i)this.bindings[a]=h}concat(t){return new ht(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const yt={kind:"null"},ze={kind:"number"},We={kind:"string"},st={kind:"boolean"},At={kind:"color"},$t={kind:"projectionDefinition"},ft={kind:"object"},tt={kind:"value"},Tr={kind:"collator"},Us={kind:"formatted"},Zr={kind:"padding"},Nr={kind:"resolvedImage"},ur={kind:"variableAnchorOffsetCollection"};function Fi(s,t){return{kind:"array",itemType:s,N:t}}function hr(s){if(s.kind==="array"){const t=hr(s.itemType);return typeof s.N=="number"?`array<${t}, ${s.N}>`:s.itemType.kind==="value"?"array":`array<${t}>`}return s.kind}const wa=[yt,ze,We,st,At,$t,Us,ft,Fi(tt),Zr,Nr,ur];function Nn(s,t){if(t.kind==="error")return null;if(s.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!Nn(s.itemType,t.itemType))&&(typeof s.N!="number"||s.N===t.N))return null}else{if(s.kind===t.kind)return null;if(s.kind==="value"){for(const i of wa)if(!Nn(i,t))return null}}return`Expected ${hr(s)} but found ${hr(t)} instead.`}function Bl(s,t){return t.some(i=>i.kind===s.kind)}function cn(s,t){return t.some(i=>i==="null"?s===null:i==="array"?Array.isArray(s):i==="object"?s&&!Array.isArray(s)&&typeof s=="object":i===typeof s)}function un(s,t){return s.kind==="array"&&t.kind==="array"?s.itemType.kind===t.itemType.kind&&typeof s.N=="number":s.kind===t.kind}const Cu=.96422,Ol=.82521,Eu=4/29,jn=6/29,Au=3*jn*jn,Fp=jn*jn*jn,Bp=Math.PI/180,Op=180/Math.PI;function ku(s){return(s%=360)<0&&(s+=360),s}function Nl([s,t,i,a]){let h,m;const g=jl((.2225045*(s=hn(s))+.7168786*(t=hn(t))+.0606169*(i=hn(i)))/1);s===t&&t===i?h=m=g:(h=jl((.4360747*s+.3850649*t+.1430804*i)/Cu),m=jl((.0139322*s+.0971045*t+.7141733*i)/Ol));const v=116*g-16;return[v<0?0:v,500*(h-g),200*(g-m),a]}function hn(s){return s<=.04045?s/12.92:Math.pow((s+.055)/1.055,2.4)}function jl(s){return s>Fp?Math.pow(s,1/3):s/Au+Eu}function zu([s,t,i,a]){let h=(s+16)/116,m=isNaN(t)?h:h+t/500,g=isNaN(i)?h:h-i/200;return h=1*Vl(h),m=Cu*Vl(m),g=Ol*Vl(g),[pn(3.1338561*m-1.6168667*h-.4906146*g),pn(-.9787684*m+1.9161415*h+.033454*g),pn(.0719453*m-.2289914*h+1.4052427*g),a]}function pn(s){return(s=s<=.00304?12.92*s:1.055*Math.pow(s,1/2.4)-.055)<0?0:s>1?1:s}function Vl(s){return s>jn?s*s*s:Au*(s-Eu)}function xo(s){return parseInt(s.padEnd(2,s),16)/255}function Ru(s,t){return dn(t?s/100:s,0,1)}function dn(s,t,i){return Math.min(Math.max(t,s),i)}function $l(s){return!s.some(Number.isNaN)}const ys={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function kt(s,t,i){return s+i*(t-s)}function vs(s,t,i){return s.map((a,h)=>kt(a,t[h],i))}class zt{constructor(t,i,a,h=1,m=!0){this.r=t,this.g=i,this.b=a,this.a=h,m||(this.r*=h,this.g*=h,this.b*=h,h||this.overwriteGetter("rgb",[t,i,a,h]))}static parse(t){if(t instanceof zt)return t;if(typeof t!="string")return;const i=function(a){if((a=a.toLowerCase().trim())==="transparent")return[0,0,0,0];const h=ys[a];if(h){const[g,v,T]=h;return[g/255,v/255,T/255,1]}if(a.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(a)){const g=a.length<6?1:2;let v=1;return[xo(a.slice(v,v+=g)),xo(a.slice(v,v+=g)),xo(a.slice(v,v+=g)),xo(a.slice(v,v+g)||"ff")]}if(a.startsWith("rgb")){const g=a.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(g){const[v,T,P,C,E,z,L,F,j,G,J,pe]=g,re=[C||" ",L||" ",G].join("");if(re==="  "||re==="  /"||re===",,"||re===",,,"){const D=[P,z,j].join(""),Z=D==="%%%"?100:D===""?255:0;if(Z){const ie=[dn(+T/Z,0,1),dn(+E/Z,0,1),dn(+F/Z,0,1),J?Ru(+J,pe):1];if($l(ie))return ie}}return}}const m=a.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(m){const[g,v,T,P,C,E,z,L,F]=m,j=[T||" ",C||" ",z].join("");if(j==="  "||j==="  /"||j===",,"||j===",,,"){const G=[+v,dn(+P,0,100),dn(+E,0,100),L?Ru(+L,F):1];if($l(G))return function([J,pe,re,D]){function Z(ie){const xe=(ie+J/30)%12,Fe=pe*Math.min(re,1-re);return re-Fe*Math.max(-1,Math.min(xe-3,9-xe,1))}return J=ku(J),pe/=100,re/=100,[Z(0),Z(8),Z(4),D]}(G)}}}(t);return i?new zt(...i,!1):void 0}get rgb(){const{r:t,g:i,b:a,a:h}=this,m=h||1/0;return this.overwriteGetter("rgb",[t/m,i/m,a/m,h])}get hcl(){return this.overwriteGetter("hcl",function(t){const[i,a,h,m]=Nl(t),g=Math.sqrt(a*a+h*h);return[Math.round(1e4*g)?ku(Math.atan2(h,a)*Op):NaN,g,i,m]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Nl(this.rgb))}overwriteGetter(t,i){return Object.defineProperty(this,t,{value:i}),i}toString(){const[t,i,a,h]=this.rgb;return`rgba(${[t,i,a].map(m=>Math.round(255*m)).join(",")},${h})`}static interpolate(t,i,a,h="rgb"){switch(h){case"rgb":{const[m,g,v,T]=vs(t.rgb,i.rgb,a);return new zt(m,g,v,T,!1)}case"hcl":{const[m,g,v,T]=t.hcl,[P,C,E,z]=i.hcl;let L,F;if(isNaN(m)||isNaN(P))isNaN(m)?isNaN(P)?L=NaN:(L=P,v!==1&&v!==0||(F=C)):(L=m,E!==1&&E!==0||(F=g));else{let re=P-m;P>m&&re>180?re-=360:P<m&&m-P>180&&(re+=360),L=m+a*re}const[j,G,J,pe]=function([re,D,Z,ie]){return re=isNaN(re)?0:re*Bp,zu([Z,Math.cos(re)*D,Math.sin(re)*D,ie])}([L,F??kt(g,C,a),kt(v,E,a),kt(T,z,a)]);return new zt(j,G,J,pe,!1)}case"lab":{const[m,g,v,T]=zu(vs(t.lab,i.lab,a));return new zt(m,g,v,T,!1)}}}}zt.black=new zt(0,0,0,1),zt.white=new zt(1,1,1,1),zt.transparent=new zt(0,0,0,0),zt.red=new zt(1,0,0,1);class bo{constructor(t,i,a){this.sensitivity=t?i?"variant":"case":i?"accent":"base",this.locale=a,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,i){return this.collator.compare(t,i)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}const Du=["bottom","center","top"];class Ta{constructor(t,i,a,h,m,g){this.text=t,this.image=i,this.scale=a,this.fontStack=h,this.textColor=m,this.verticalAlign=g}}class Pr{constructor(t){this.sections=t}static fromString(t){return new Pr([new Ta(t,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(t=>t.text.length!==0||t.image&&t.image.name.length!==0)}static factory(t){return t instanceof Pr?t:Pr.fromString(t)}toString(){return this.sections.length===0?"":this.sections.map(t=>t.text).join("")}}class qr{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof qr)return t;if(typeof t=="number")return new qr([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(const i of t)if(typeof i!="number")return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new qr(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,i,a){return new qr(vs(t.values,i.values,a))}}class _r{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const Ul=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class pi{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof pi)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let i=0;i<t.length;i+=2){const a=t[i],h=t[i+1];if(typeof a!="string"||!Ul.has(a)||!Array.isArray(h)||h.length!==2||typeof h[0]!="number"||typeof h[1]!="number")return}return new pi(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,i,a){const h=t.values,m=i.values;if(h.length!==m.length)throw new _r(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${i.toString()}`);const g=[];for(let v=0;v<h.length;v+=2){if(h[v]!==m[v])throw new _r(`Cannot interpolate values containing mismatched anchors. from[${v}]: ${h[v]}, to[${v}]: ${m[v]}`);g.push(h[v]);const[T,P]=h[v+1],[C,E]=m[v+1];g.push([kt(T,C,a),kt(P,E,a)])}return new pi(g)}}class di{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new di({name:t,available:!1}):null}}class fi{constructor(t,i,a){this.from=t,this.to=i,this.transition=a}static interpolate(t,i,a){return new fi(t,i,a)}static parse(t){return t instanceof fi?t:Array.isArray(t)&&t.length===3&&typeof t[0]=="string"&&typeof t[1]=="string"&&typeof t[2]=="number"?new fi(t[0],t[1],t[2]):typeof t=="object"&&typeof t.from=="string"&&typeof t.to=="string"&&typeof t.transition=="number"?new fi(t.from,t.to,t.transition):typeof t=="string"?new fi(t,t,1):void 0}}function Zl(s,t,i,a){return typeof s=="number"&&s>=0&&s<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof i=="number"&&i>=0&&i<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:`Invalid rgba value [${[s,t,i,a].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof a=="number"?[s,t,i,a]:[s,t,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function fn(s){if(s===null||typeof s=="string"||typeof s=="boolean"||typeof s=="number"||s instanceof fi||s instanceof zt||s instanceof bo||s instanceof Pr||s instanceof qr||s instanceof pi||s instanceof di)return!0;if(Array.isArray(s)){for(const t of s)if(!fn(t))return!1;return!0}if(typeof s=="object"){for(const t in s)if(!fn(s[t]))return!1;return!0}return!1}function ar(s){if(s===null)return yt;if(typeof s=="string")return We;if(typeof s=="boolean")return st;if(typeof s=="number")return ze;if(s instanceof zt)return At;if(s instanceof fi)return $t;if(s instanceof bo)return Tr;if(s instanceof Pr)return Us;if(s instanceof qr)return Zr;if(s instanceof pi)return ur;if(s instanceof di)return Nr;if(Array.isArray(s)){const t=s.length;let i;for(const a of s){const h=ar(a);if(i){if(i===h)continue;i=tt;break}i=h}return Fi(i||tt,t)}return ft}function Sa(s){const t=typeof s;return s===null?"":t==="string"||t==="number"||t==="boolean"?String(s):s instanceof zt||s instanceof fi||s instanceof Pr||s instanceof qr||s instanceof pi||s instanceof di?s.toString():JSON.stringify(s)}class xs{constructor(t,i){this.type=t,this.value=i}static parse(t,i){if(t.length!==2)return i.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!fn(t[1]))return i.error("invalid value");const a=t[1];let h=ar(a);const m=i.expectedType;return h.kind!=="array"||h.N!==0||!m||m.kind!=="array"||typeof m.N=="number"&&m.N!==0||(h=m),new xs(h,a)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const Cs={string:We,number:ze,boolean:st,object:ft};class Yi{constructor(t,i){this.type=t,this.args=i}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");let a,h=1;const m=t[0];if(m==="array"){let v,T;if(t.length>2){const P=t[1];if(typeof P!="string"||!(P in Cs)||P==="object")return i.error('The item type argument of "array" must be one of string, number, boolean',1);v=Cs[P],h++}else v=tt;if(t.length>3){if(t[2]!==null&&(typeof t[2]!="number"||t[2]<0||t[2]!==Math.floor(t[2])))return i.error('The length argument to "array" must be a positive integer literal',2);T=t[2],h++}a=Fi(v,T)}else{if(!Cs[m])throw new Error(`Types doesn't contain name = ${m}`);a=Cs[m]}const g=[];for(;h<t.length;h++){const v=i.parse(t[h],h,tt);if(!v)return null;g.push(v)}return new Yi(a,g)}evaluate(t){for(let i=0;i<this.args.length;i++){const a=this.args[i].evaluate(t);if(!Nn(this.type,ar(a)))return a;if(i===this.args.length-1)throw new _r(`Expected value to be of type ${hr(this.type)}, but found ${hr(ar(a))} instead.`)}throw new Error}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}const ql={"to-boolean":st,"to-color":At,"to-number":ze,"to-string":We};class Es{constructor(t,i){this.type=t,this.args=i}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");const a=t[0];if(!ql[a])throw new Error(`Can't parse ${a} as it is not part of the known types`);if((a==="to-boolean"||a==="to-string")&&t.length!==2)return i.error("Expected one argument.");const h=ql[a],m=[];for(let g=1;g<t.length;g++){const v=i.parse(t[g],g,tt);if(!v)return null;m.push(v)}return new Es(h,m)}evaluate(t){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(t);case"color":{let i,a;for(const h of this.args){if(i=h.evaluate(t),a=null,i instanceof zt)return i;if(typeof i=="string"){const m=t.parseColor(i);if(m)return m}else if(Array.isArray(i)&&(a=i.length<3||i.length>4?`Invalid rgba value ${JSON.stringify(i)}: expected an array containing either three or four numeric values.`:Zl(i[0],i[1],i[2],i[3]),!a))return new zt(i[0]/255,i[1]/255,i[2]/255,i[3])}throw new _r(a||`Could not parse color from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"padding":{let i;for(const a of this.args){i=a.evaluate(t);const h=qr.parse(i);if(h)return h}throw new _r(`Could not parse padding from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"variableAnchorOffsetCollection":{let i;for(const a of this.args){i=a.evaluate(t);const h=pi.parse(i);if(h)return h}throw new _r(`Could not parse variableAnchorOffsetCollection from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"number":{let i=null;for(const a of this.args){if(i=a.evaluate(t),i===null)return 0;const h=Number(i);if(!isNaN(h))return h}throw new _r(`Could not convert ${JSON.stringify(i)} to number.`)}case"formatted":return Pr.fromString(Sa(this.args[0].evaluate(t)));case"resolvedImage":return di.fromString(Sa(this.args[0].evaluate(t)));case"projectionDefinition":return this.args[0].evaluate(t);default:return Sa(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}const wo=["Unknown","Point","LineString","Polygon"];class or{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?wo[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let i=this._parseColorCache[t];return i||(i=this._parseColorCache[t]=zt.parse(t)),i}}class Vn{constructor(t,i,a=[],h,m=new ht,g=[]){this.registry=t,this.path=a,this.key=a.map(v=>`[${v}]`).join(""),this.scope=m,this.errors=g,this.expectedType=h,this._isConstant=i}parse(t,i,a,h,m={}){return i?this.concat(i,a,h)._parse(t,m):this._parse(t,m)}_parse(t,i){function a(h,m,g){return g==="assert"?new Yi(m,[h]):g==="coerce"?new Es(m,[h]):h}if(t!==null&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"||(t=["literal",t]),Array.isArray(t)){if(t.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const h=t[0];if(typeof h!="string")return this.error(`Expression name must be a string, but found ${typeof h} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const m=this.registry[h];if(m){let g=m.parse(t,this);if(!g)return null;if(this.expectedType){const v=this.expectedType,T=g.type;if(v.kind!=="string"&&v.kind!=="number"&&v.kind!=="boolean"&&v.kind!=="object"&&v.kind!=="array"||T.kind!=="value")if(v.kind!=="projectionDefinition"||T.kind!=="string"&&T.kind!=="array")if(v.kind!=="color"&&v.kind!=="formatted"&&v.kind!=="resolvedImage"||T.kind!=="value"&&T.kind!=="string")if(v.kind!=="padding"||T.kind!=="value"&&T.kind!=="number"&&T.kind!=="array")if(v.kind!=="variableAnchorOffsetCollection"||T.kind!=="value"&&T.kind!=="array"){if(this.checkSubtype(v,T))return null}else g=a(g,v,i.typeAnnotation||"coerce");else g=a(g,v,i.typeAnnotation||"coerce");else g=a(g,v,i.typeAnnotation||"coerce");else g=a(g,v,i.typeAnnotation||"coerce");else g=a(g,v,i.typeAnnotation||"assert")}if(!(g instanceof xs)&&g.type.kind!=="resolvedImage"&&this._isConstant(g)){const v=new or;try{g=new xs(g.type,g.evaluate(v))}catch(T){return this.error(T.message),null}}return g}return this.error(`Unknown expression "${h}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(t===void 0?"'undefined' value invalid. Use null instead.":typeof t=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,i,a){const h=typeof t=="number"?this.path.concat(t):this.path,m=a?this.scope.concat(a):this.scope;return new Vn(this.registry,this._isConstant,h,i||null,m,this.errors)}error(t,...i){const a=`${this.key}${i.map(h=>`[${h}]`).join("")}`;this.errors.push(new qe(a,t))}checkSubtype(t,i){const a=Nn(t,i);return a&&this.error(a),a}}class Vt{constructor(t,i){this.type=i.type,this.bindings=[].concat(t),this.result=i}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const i of this.bindings)t(i[1]);t(this.result)}static parse(t,i){if(t.length<4)return i.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const a=[];for(let m=1;m<t.length-1;m+=2){const g=t[m];if(typeof g!="string")return i.error(`Expected string, but found ${typeof g} instead.`,m);if(/[^a-zA-Z0-9_]/.test(g))return i.error("Variable names must contain only alphanumeric characters or '_'.",m);const v=i.parse(t[m+1],m+1);if(!v)return null;a.push([g,v])}const h=i.parse(t[t.length-1],t.length-1,i.expectedType,a);return h?new Vt(a,h):null}outputDefined(){return this.result.outputDefined()}}class wt{constructor(t,i){this.type=i.type,this.name=t,this.boundExpression=i}static parse(t,i){if(t.length!==2||typeof t[1]!="string")return i.error("'var' expression requires exactly one string literal argument.");const a=t[1];return i.scope.has(a)?new wt(a,i.scope.get(a)):i.error(`Unknown variable "${a}". Make sure "${a}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}}class Ma{constructor(t,i,a){this.type=t,this.index=i,this.input=a}static parse(t,i){if(t.length!==3)return i.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const a=i.parse(t[1],1,ze),h=i.parse(t[2],2,Fi(i.expectedType||tt));return a&&h?new Ma(h.type.itemType,a,h):null}evaluate(t){const i=this.index.evaluate(t),a=this.input.evaluate(t);if(i<0)throw new _r(`Array index out of bounds: ${i} < 0.`);if(i>=a.length)throw new _r(`Array index out of bounds: ${i} > ${a.length-1}.`);if(i!==Math.floor(i))throw new _r(`Array index must be an integer, but found ${i} instead.`);return a[i]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}}class Ut{constructor(t,i){this.type=st,this.needle=t,this.haystack=i}static parse(t,i){if(t.length!==3)return i.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const a=i.parse(t[1],1,tt),h=i.parse(t[2],2,tt);return a&&h?Bl(a.type,[st,We,ze,yt,tt])?new Ut(a,h):i.error(`Expected first argument to be of type boolean, string, number or null, but found ${hr(a.type)} instead`):null}evaluate(t){const i=this.needle.evaluate(t),a=this.haystack.evaluate(t);if(!a)return!1;if(!cn(i,["boolean","string","number","null"]))throw new _r(`Expected first argument to be of type boolean, string, number or null, but found ${hr(ar(i))} instead.`);if(!cn(a,["string","array"]))throw new _r(`Expected second argument to be of type array or string, but found ${hr(ar(a))} instead.`);return a.indexOf(i)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class $n{constructor(t,i,a){this.type=ze,this.needle=t,this.haystack=i,this.fromIndex=a}static parse(t,i){if(t.length<=2||t.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const a=i.parse(t[1],1,tt),h=i.parse(t[2],2,tt);if(!a||!h)return null;if(!Bl(a.type,[st,We,ze,yt,tt]))return i.error(`Expected first argument to be of type boolean, string, number or null, but found ${hr(a.type)} instead`);if(t.length===4){const m=i.parse(t[3],3,ze);return m?new $n(a,h,m):null}return new $n(a,h)}evaluate(t){const i=this.needle.evaluate(t),a=this.haystack.evaluate(t);if(!cn(i,["boolean","string","number","null"]))throw new _r(`Expected first argument to be of type boolean, string, number or null, but found ${hr(ar(i))} instead.`);let h;if(this.fromIndex&&(h=this.fromIndex.evaluate(t)),cn(a,["string"])){const m=a.indexOf(i,h);return m===-1?-1:[...a.slice(0,m)].length}if(cn(a,["array"]))return a.indexOf(i,h);throw new _r(`Expected second argument to be of type array or string, but found ${hr(ar(a))} instead.`)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class ls{constructor(t,i,a,h,m,g){this.inputType=t,this.type=i,this.input=a,this.cases=h,this.outputs=m,this.otherwise=g}static parse(t,i){if(t.length<5)return i.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return i.error("Expected an even number of arguments.");let a,h;i.expectedType&&i.expectedType.kind!=="value"&&(h=i.expectedType);const m={},g=[];for(let P=2;P<t.length-1;P+=2){let C=t[P];const E=t[P+1];Array.isArray(C)||(C=[C]);const z=i.concat(P);if(C.length===0)return z.error("Expected at least one branch label.");for(const F of C){if(typeof F!="number"&&typeof F!="string")return z.error("Branch labels must be numbers or strings.");if(typeof F=="number"&&Math.abs(F)>Number.MAX_SAFE_INTEGER)return z.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof F=="number"&&Math.floor(F)!==F)return z.error("Numeric branch labels must be integer values.");if(a){if(z.checkSubtype(a,ar(F)))return null}else a=ar(F);if(m[String(F)]!==void 0)return z.error("Branch labels must be unique.");m[String(F)]=g.length}const L=i.parse(E,P,h);if(!L)return null;h=h||L.type,g.push(L)}const v=i.parse(t[1],1,tt);if(!v)return null;const T=i.parse(t[t.length-1],t.length-1,h);return T?v.type.kind!=="value"&&i.concat(1).checkSubtype(a,v.type)?null:new ls(a,h,v,m,g,T):null}evaluate(t){const i=this.input.evaluate(t);return(ar(i)===this.inputType&&this.outputs[this.cases[i]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}}class Pa{constructor(t,i,a){this.type=t,this.branches=i,this.otherwise=a}static parse(t,i){if(t.length<4)return i.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return i.error("Expected an odd number of arguments.");let a;i.expectedType&&i.expectedType.kind!=="value"&&(a=i.expectedType);const h=[];for(let g=1;g<t.length-1;g+=2){const v=i.parse(t[g],g,st);if(!v)return null;const T=i.parse(t[g+1],g+1,a);if(!T)return null;h.push([v,T]),a=a||T.type}const m=i.parse(t[t.length-1],t.length-1,a);if(!m)return null;if(!a)throw new Error("Can't infer output type");return new Pa(a,h,m)}evaluate(t){for(const[i,a]of this.branches)if(i.evaluate(t))return a.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[i,a]of this.branches)t(i),t(a);t(this.otherwise)}outputDefined(){return this.branches.every(([t,i])=>i.outputDefined())&&this.otherwise.outputDefined()}}class Ia{constructor(t,i,a,h){this.type=t,this.input=i,this.beginIndex=a,this.endIndex=h}static parse(t,i){if(t.length<=2||t.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const a=i.parse(t[1],1,tt),h=i.parse(t[2],2,ze);if(!a||!h)return null;if(!Bl(a.type,[Fi(tt),We,tt]))return i.error(`Expected first argument to be of type array or string, but found ${hr(a.type)} instead`);if(t.length===4){const m=i.parse(t[3],3,ze);return m?new Ia(a.type,a,h,m):null}return new Ia(a.type,a,h)}evaluate(t){const i=this.input.evaluate(t),a=this.beginIndex.evaluate(t);let h;if(this.endIndex&&(h=this.endIndex.evaluate(t)),cn(i,["string"]))return[...i].slice(a,h).join("");if(cn(i,["array"]))return i.slice(a,h);throw new _r(`Expected first argument to be of type array or string, but found ${hr(ar(i))} instead.`)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function Ca(s,t){const i=s.length-1;let a,h,m=0,g=i,v=0;for(;m<=g;)if(v=Math.floor((m+g)/2),a=s[v],h=s[v+1],a<=t){if(v===i||t<h)return v;m=v+1}else{if(!(a>t))throw new _r("Input is not a number.");g=v-1}return 0}class mn{constructor(t,i,a){this.type=t,this.input=i,this.labels=[],this.outputs=[];for(const[h,m]of a)this.labels.push(h),this.outputs.push(m)}static parse(t,i){if(t.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return i.error("Expected an even number of arguments.");const a=i.parse(t[1],1,ze);if(!a)return null;const h=[];let m=null;i.expectedType&&i.expectedType.kind!=="value"&&(m=i.expectedType);for(let g=1;g<t.length;g+=2){const v=g===1?-1/0:t[g],T=t[g+1],P=g,C=g+1;if(typeof v!="number")return i.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',P);if(h.length&&h[h.length-1][0]>=v)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',P);const E=i.parse(T,C,m);if(!E)return null;m=m||E.type,h.push([v,E])}return new mn(m,a,h)}evaluate(t){const i=this.labels,a=this.outputs;if(i.length===1)return a[0].evaluate(t);const h=this.input.evaluate(t);if(h<=i[0])return a[0].evaluate(t);const m=i.length;return h>=i[m-1]?a[m-1].evaluate(t):a[Ca(i,h)].evaluate(t)}eachChild(t){t(this.input);for(const i of this.outputs)t(i)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function Lu(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Gl,Hl,Fu=function(){if(Hl)return Gl;function s(t,i,a,h){this.cx=3*t,this.bx=3*(a-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*i,this.by=3*(h-i)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=i,this.p2x=a,this.p2y=h}return Hl=1,Gl=s,s.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,i){if(i===void 0&&(i=1e-6),t<0)return 0;if(t>1)return 1;for(var a=t,h=0;h<8;h++){var m=this.sampleCurveX(a)-t;if(Math.abs(m)<i)return a;var g=this.sampleCurveDerivativeX(a);if(Math.abs(g)<1e-6)break;a-=m/g}var v=0,T=1;for(a=t,h=0;h<20&&(m=this.sampleCurveX(a),!(Math.abs(m-t)<i));h++)t>m?v=a:T=a,a=.5*(T-v)+v;return a},solve:function(t,i){return this.sampleCurveY(this.solveCurveX(t,i))}},Gl}(),Ea=Lu(Fu);class ir{constructor(t,i,a,h,m){this.type=t,this.operator=i,this.interpolation=a,this.input=h,this.labels=[],this.outputs=[];for(const[g,v]of m)this.labels.push(g),this.outputs.push(v)}static interpolationFactor(t,i,a,h){let m=0;if(t.name==="exponential")m=Un(i,t.base,a,h);else if(t.name==="linear")m=Un(i,1,a,h);else if(t.name==="cubic-bezier"){const g=t.controlPoints;m=new Ea(g[0],g[1],g[2],g[3]).solve(Un(i,1,a,h))}return m}static parse(t,i){let[a,h,m,...g]=t;if(!Array.isArray(h)||h.length===0)return i.error("Expected an interpolation type expression.",1);if(h[0]==="linear")h={name:"linear"};else if(h[0]==="exponential"){const P=h[1];if(typeof P!="number")return i.error("Exponential interpolation requires a numeric base.",1,1);h={name:"exponential",base:P}}else{if(h[0]!=="cubic-bezier")return i.error(`Unknown interpolation type ${String(h[0])}`,1,0);{const P=h.slice(1);if(P.length!==4||P.some(C=>typeof C!="number"||C<0||C>1))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);h={name:"cubic-bezier",controlPoints:P}}}if(t.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return i.error("Expected an even number of arguments.");if(m=i.parse(m,2,ze),!m)return null;const v=[];let T=null;a==="interpolate-hcl"||a==="interpolate-lab"?T=At:i.expectedType&&i.expectedType.kind!=="value"&&(T=i.expectedType);for(let P=0;P<g.length;P+=2){const C=g[P],E=g[P+1],z=P+3,L=P+4;if(typeof C!="number")return i.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',z);if(v.length&&v[v.length-1][0]>=C)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',z);const F=i.parse(E,L,T);if(!F)return null;T=T||F.type,v.push([C,F])}return un(T,ze)||un(T,$t)||un(T,At)||un(T,Zr)||un(T,ur)||un(T,Fi(ze))?new ir(T,a,h,m,v):i.error(`Type ${hr(T)} is not interpolatable.`)}evaluate(t){const i=this.labels,a=this.outputs;if(i.length===1)return a[0].evaluate(t);const h=this.input.evaluate(t);if(h<=i[0])return a[0].evaluate(t);const m=i.length;if(h>=i[m-1])return a[m-1].evaluate(t);const g=Ca(i,h),v=ir.interpolationFactor(this.interpolation,h,i[g],i[g+1]),T=a[g].evaluate(t),P=a[g+1].evaluate(t);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return kt(T,P,v);case"color":return zt.interpolate(T,P,v);case"padding":return qr.interpolate(T,P,v);case"variableAnchorOffsetCollection":return pi.interpolate(T,P,v);case"array":return vs(T,P,v);case"projectionDefinition":return fi.interpolate(T,P,v)}case"interpolate-hcl":return zt.interpolate(T,P,v,"hcl");case"interpolate-lab":return zt.interpolate(T,P,v,"lab")}}eachChild(t){t(this.input);for(const i of this.outputs)t(i)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function Un(s,t,i,a){const h=a-i,m=s-i;return h===0?0:t===1?m/h:(Math.pow(t,m)-1)/(Math.pow(t,h)-1)}const cs={color:zt.interpolate,number:kt,padding:qr.interpolate,variableAnchorOffsetCollection:pi.interpolate,array:vs};class gn{constructor(t,i){this.type=t,this.args=i}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");let a=null;const h=i.expectedType;h&&h.kind!=="value"&&(a=h);const m=[];for(const v of t.slice(1)){const T=i.parse(v,1+m.length,a,void 0,{typeAnnotation:"omit"});if(!T)return null;a=a||T.type,m.push(T)}if(!a)throw new Error("No output type");const g=h&&m.some(v=>Nn(h,v.type));return new gn(g?tt:a,m)}evaluate(t){let i,a=null,h=0;for(const m of this.args)if(h++,a=m.evaluate(t),a&&a instanceof di&&!a.available&&(i||(i=a.name),a=null,h===this.args.length&&(a=i)),a!==null)break;return a}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}function Gr(s,t){return s==="=="||s==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="str
24ing"||t.kind==="number"||t.kind==="value"}function Wl(s,t,i,a){return a.compare(t,i)===0}function Zs(s,t,i){const a=s!=="=="&&s!=="!=";return class yv{constructor(m,g,v){this.type=st,this.lhs=m,this.rhs=g,this.collator=v,this.hasUntypedArgument=m.type.kind==="value"||g.type.kind==="value"}static parse(m,g){if(m.length!==3&&m.length!==4)return g.error("Expected two or three arguments.");const v=m[0];let T=g.parse(m[1],1,tt);if(!T)return null;if(!Gr(v,T.type))return g.concat(1).error(`"${v}" comparisons are not supported for type '${hr(T.type)}'.`);let P=g.parse(m[2],2,tt);if(!P)return null;if(!Gr(v,P.type))return g.concat(2).error(`"${v}" comparisons are not supported for type '${hr(P.type)}'.`);if(T.type.kind!==P.type.kind&&T.type.kind!=="value"&&P.type.kind!=="value")return g.error(`Cannot compare types '${hr(T.type)}' and '${hr(P.type)}'.`);a&&(T.type.kind==="value"&&P.type.kind!=="value"?T=new Yi(P.type,[T]):T.type.kind!=="value"&&P.type.kind==="value"&&(P=new Yi(T.type,[P])));let C=null;if(m.length===4){if(T.type.kind!=="string"&&P.type.kind!=="string"&&T.type.kind!=="value"&&P.type.kind!=="value")return g.error("Cannot use collator to compare non-string types.");if(C=g.parse(m[3],3,Tr),!C)return null}return new yv(T,P,C)}evaluate(m){const g=this.lhs.evaluate(m),v=this.rhs.evaluate(m);if(a&&this.hasUntypedArgument){const T=ar(g),P=ar(v);if(T.kind!==P.kind||T.kind!=="string"&&T.kind!=="number")throw new _r(`Expected arguments for "${s}" to be (string, string) or (number, number), but found (${T.kind}, ${P.kind}) instead.`)}if(this.collator&&!a&&this.hasUntypedArgument){const T=ar(g),P=ar(v);if(T.kind!=="string"||P.kind!=="string")return t(m,g,v)}return this.collator?i(m,g,v,this.collator.evaluate(m)):t(m,g,v)}eachChild(m){m(this.lhs),m(this.rhs),this.collator&&m(this.collator)}outputDefined(){return!0}}}const Bu=Zs("==",function(s,t,i){return t===i},Wl),Np=Zs("!=",function(s,t,i){return t!==i},function(s,t,i,a){return!Wl(0,t,i,a)}),To=Zs("<",function(s,t,i){return t<i},function(s,t,i,a){return a.compare(t,i)<0}),Xl=Zs(">",function(s,t,i){return t>i},function(s,t,i,a){return a.compare(t,i)>0}),jp=Zs("<=",function(s,t,i){return t<=i},function(s,t,i,a){return a.compare(t,i)<=0}),So=Zs(">=",function(s,t,i){return t>=i},function(s,t,i,a){return a.compare(t,i)>=0});class _n{constructor(t,i,a){this.type=Tr,this.locale=a,this.caseSensitive=t,this.diacriticSensitive=i}static parse(t,i){if(t.length!==2)return i.error("Expected one argument.");const a=t[1];if(typeof a!="object"||Array.isArray(a))return i.error("Collator options argument must be an object.");const h=i.parse(a["case-sensitive"]!==void 0&&a["case-sensitive"],1,st);if(!h)return null;const m=i.parse(a["diacritic-sensitive"]!==void 0&&a["diacritic-sensitive"],1,st);if(!m)return null;let g=null;return a.locale&&(g=i.parse(a.locale,1,We),!g)?null:new _n(h,m,g)}evaluate(t){return new bo(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}}class Bi{constructor(t,i,a,h,m){this.type=We,this.number=t,this.locale=i,this.currency=a,this.minFractionDigits=h,this.maxFractionDigits=m}static parse(t,i){if(t.length!==3)return i.error("Expected two arguments.");const a=i.parse(t[1],1,ze);if(!a)return null;const h=t[2];if(typeof h!="object"||Array.isArray(h))return i.error("NumberFormat options argument must be an object.");let m=null;if(h.locale&&(m=i.parse(h.locale,1,We),!m))return null;let g=null;if(h.currency&&(g=i.parse(h.currency,1,We),!g))return null;let v=null;if(h["min-fraction-digits"]&&(v=i.parse(h["min-fraction-digits"],1,ze),!v))return null;let T=null;return h["max-fraction-digits"]&&(T=i.parse(h["max-fraction-digits"],1,ze),!T)?null:new Bi(a,m,g,v,T)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}}class Aa{constructor(t){this.type=Us,this.sections=t}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");const a=t[1];if(!Array.isArray(a)&&typeof a=="object")return i.error("First argument must be an image or text section.");const h=[];let m=!1;for(let g=1;g<=t.length-1;++g){const v=t[g];if(m&&typeof v=="object"&&!Array.isArray(v)){m=!1;let T=null;if(v["font-scale"]&&(T=i.parse(v["font-scale"],1,ze),!T))return null;let P=null;if(v["text-font"]&&(P=i.parse(v["text-font"],1,Fi(We)),!P))return null;let C=null;if(v["text-color"]&&(C=i.parse(v["text-color"],1,At),!C))return null;let E=null;if(v["vertical-align"]){if(typeof v["vertical-align"]=="string"&&!Du.includes(v["vertical-align"]))return i.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${v["vertical-align"]}' instead.`);if(E=i.parse(v["vertical-align"],1,We),!E)return null}const z=h[h.length-1];z.scale=T,z.font=P,z.textColor=C,z.verticalAlign=E}else{const T=i.parse(t[g],1,tt);if(!T)return null;const P=T.type.kind;if(P!=="string"&&P!=="value"&&P!=="null"&&P!=="resolvedImage")return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");m=!0,h.push({content:T,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Aa(h)}evaluate(t){return new Pr(this.sections.map(i=>{const a=i.content.evaluate(t);return ar(a)===Nr?new Ta("",a,null,null,null,i.verticalAlign?i.verticalAlign.evaluate(t):null):new Ta(Sa(a),null,i.scale?i.scale.evaluate(t):null,i.font?i.font.evaluate(t).join(","):null,i.textColor?i.textColor.evaluate(t):null,i.verticalAlign?i.verticalAlign.evaluate(t):null)}))}eachChild(t){for(const i of this.sections)t(i.content),i.scale&&t(i.scale),i.font&&t(i.font),i.textColor&&t(i.textColor),i.verticalAlign&&t(i.verticalAlign)}outputDefined(){return!1}}class Zn{constructor(t){this.type=Nr,this.input=t}static parse(t,i){if(t.length!==2)return i.error("Expected two arguments.");const a=i.parse(t[1],1,We);return a?new Zn(a):i.error("No image name provided.")}evaluate(t){const i=this.input.evaluate(t),a=di.fromString(i);return a&&t.availableImages&&(a.available=t.availableImages.indexOf(i)>-1),a}eachChild(t){t(this.input)}outputDefined(){return!1}}class Yl{constructor(t){this.type=ze,this.input=t}static parse(t,i){if(t.length!==2)return i.error(`Expected 1 argument, but found ${t.length-1} instead.`);const a=i.parse(t[1],1);return a?a.type.kind!=="array"&&a.type.kind!=="string"&&a.type.kind!=="value"?i.error(`Expected argument of type string or array, but found ${hr(a.type)} instead.`):new Yl(a):null}evaluate(t){const i=this.input.evaluate(t);if(typeof i=="string")return[...i].length;if(Array.isArray(i))return i.length;throw new _r(`Expected value to be of type string or array, but found ${hr(ar(i))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}}const Ki=8192;function Vp(s,t){const i=(180+s[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+s[1]*Math.PI/360)))/360,h=Math.pow(2,t.z);return[Math.round(i*h*Ki),Math.round(a*h*Ki)]}function Kl(s,t){const i=Math.pow(2,t.z);return[(h=(s[0]/Ki+t.x)/i,360*h-180),(a=(s[1]/Ki+t.y)/i,360/Math.PI*Math.atan(Math.exp((180-360*a)*Math.PI/180)
vendor: 20,967 bytes, line 24
24)-90)];var a,h}function ka(s,t){s[0]=Math.min(s[0],t[0]),s[1]=Math.min(s[1],t[1]),s[2]=Math.max(s[2],t[0]),s[3]=Math.max(s[3],t[1])}function za(s,t){return!(s[0]<=t[0]||s[2]>=t[2]||s[1]<=t[1]||s[3]>=t[3])}function Mo(s,t,i){const a=s[0]-t[0],h=s[1]-t[1],m=s[0]-i[0],g=s[1]-i[1];return a*g-m*h==0&&a*m<=0&&h*g<=0}function Po(s,t,i,a){return(h=[a[0]-i[0],a[1]-i[1]])[0]*(m=[t[0]-s[0],t[1]-s[1]])[1]-h[1]*m[0]!=0&&!(!Nu(s,t,i,a)||!Nu(i,a,s,t));var h,m}function Ou(s,t,i){for(const a of i)for(let h=0;h<a.length-1;++h)if(Po(s,t,a[h],a[h+1]))return!0;return!1}function yn(s,t,i=!1){let a=!1;for(const v of t)for(let T=0;T<v.length-1;T++){if(Mo(s,v[T],v[T+1]))return i;(m=v[T])[1]>(h=s)[1]!=(g=v[T+1])[1]>h[1]&&h[0]<(g[0]-m[0])*(h[1]-m[1])/(g[1]-m[1])+m[0]&&(a=!a)}var h,m,g;return a}function $p(s,t){for(const i of t)if(yn(s,i))return!0;return!1}function Jl(s,t){for(const i of s)if(!yn(i,t))return!1;for(let i=0;i<s.length-1;++i)if(Ou(s[i],s[i+1],t))return!1;return!0}function Up(s,t){for(const i of t)if(Jl(s,i))return!0;return!1}function Nu(s,t,i,a){const h=a[0]-i[0],m=a[1]-i[1],g=(s[0]-i[0])*m-h*(s[1]-i[1]),v=(t[0]-i[0])*m-h*(t[1]-i[1]);return g>0&&v<0||g<0&&v>0}function Ql(s,t,i){const a=[];for(let h=0;h<s.length;h++){const m=[];for(let g=0;g<s[h].length;g++){const v=Vp(s[h][g],i);ka(t,v),m.push(v)}a.push(m)}return a}function ju(s,t,i){const a=[];for(let h=0;h<s.length;h++){const m=Ql(s[h],t,i);a.push(m)}return a}function Vu(s,t,i,a){if(s[0]<i[0]||s[0]>i[2]){const h=.5*a;let m=s[0]-i[0]>h?-a:i[0]-s[0]>h?a:0;m===0&&(m=s[0]-i[2]>h?-a:i[2]-s[0]>h?a:0),s[0]+=m}ka(t,s)}function ec(s,t,i,a){const h=Math.pow(2,a.z)*Ki,m=[a.x*Ki,a.y*Ki],g=[];for(const v of s)for(const T of v){const P=[T.x+m[0],T.y+m[1]];Vu(P,t,i,h),g.push(P)}return g}function tc(s,t,i,a){const h=Math.pow(2,a.z)*Ki,m=[a.x*Ki,a.y*Ki],g=[];for(const T of s){const P=[];for(const C of T){const E=[C.x+m[0],C.y+m[1]];ka(t,E),P.push(E)}g.push(P)}if(t[2]-t[0]<=h/2){(v=t)[0]=v[1]=1/0,v[2]=v[3]=-1/0;for(const T of g)for(const P of T)Vu(P,t,i,h)}var v;return g}class qs{constructor(t,i){this.type=st,this.geojson=t,this.geometries=i}static parse(t,i){if(t.length!==2)return i.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(fn(t[1])){const a=t[1];if(a.type==="FeatureCollection"){const h=[];for(const m of a.features){const{type:g,coordinates:v}=m.geometry;g==="Polygon"&&h.push(v),g==="MultiPolygon"&&h.push(...v)}if(h.length)return new qs(a,{type:"MultiPolygon",coordinates:h})}else if(a.type==="Feature"){const h=a.geometry.type;if(h==="Polygon"||h==="MultiPolygon")return new qs(a,a.geometry)}else if(a.type==="Polygon"||a.type==="MultiPolygon")return new qs(a,a)}return i.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return function(i,a){const h=[1/0,1/0,-1/0,-1/0],m=[1/0,1/0,-1/0,-1/0],g=i.canonicalID();if(a.type==="Polygon"){const v=Ql(a.coordinates,m,g),T=ec(i.geometry(),h,m,g);if(!za(h,m))return!1;for(const P of T)if(!yn(P,v))return!1}if(a.type==="MultiPolygon"){const v=ju(a.coordinates,m,g),T=ec(i.geometry(),h,m,g);if(!za(h,m))return!1;for(const P of T)if(!$p(P,v))return!1}return!0}(t,this.geometries);if(t.geometryType()==="LineString")return function(i,a){const h=[1/0,1/0,-1/0,-1/0],m=[1/0,1/0,-1/0,-1/0],g=i.canonicalID();if(a.type==="Polygon"){const v=Ql(a.coordinates,m,g),T=tc(i.geometry(),h,m,g);if(!za(h,m))return!1;for(const P of T)if(!Jl(P,v))return!1}if(a.type==="MultiPolygon"){const v=ju(a.coordinates,m,g),T=tc(i.geometry(),h,m,g);if(!za(h,m))return!1;for(const P of T)if(!Up(P,v))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let $u=class{constructor(s=[],t=(i,a)=>i<a?-1:i>a?1:0){if(this.data=s,this.length=this.data.length,this.compare=t,this.length>0)for(let i=(this.length>>1)-1;i>=0;i--)this._down(i)}push(s){this.data.push(s),this._up(this.length++)}pop(){if(this.length===0)return;const s=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),s}peek(){return this.data[0]}_up(s){const{data:t,compare:i}=this,a=t[s];for(;s>0;){const h=s-1>>1,m=t[h];if(i(a,m)>=0)break;t[s]=m,s=h}t[s]=a}_down(s){const{data:t,compare:i}=this,a=this.length>>1,h=t[s];for(;s<a;){let m=1+(s<<1);const g=m+1;if(g<this.length&&i(t[g],t[m])<0&&(m=g),i(t[m],h)>=0)break;t[s]=t[m],s=m}t[s]=h}};function Uu(s,t,i=0,a=s.length-1,h=rc){for(;a>i;){if(a-i>600){const T=a-i+1,P=t-i+1,C=Math.log(T),E=.5*Math.exp(2*C/3),z=.5*Math.sqrt(C*E*(T-E)/T)*(P-T/2<0?-1:1);Uu(s,t,Math.max(i,Math.floor(t-P*E/T+z)),Math.min(a,Math.floor(t+(T-P)*E/T+z)),h)}const m=s[t];let g=i,v=a;for(Ra(s,i,t),h(s[a],m)>0&&Ra(s,i,a);g<v;){for(Ra(s,g,v),g++,v--;h(s[g],m)<0;)g++;for(;h(s[v],m)>0;)v--}h(s[i],m)===0?Ra(s,i,v):(v++,Ra(s,v,a)),v<=t&&(i=v+1),t<=v&&(a=v-1)}}function Ra(s,t,i){const a=s[t];s[t]=s[i],s[i]=a}function rc(s,t){return s<t?-1:s>t?1:0}function Io(s,t){if(s.length<=1)return[s];const i=[];let a,h;for(const m of s){const g=qp(m);g!==0&&(m.area=Math.abs(g),h===void 0&&(h=g<0),h===g<0?(a&&i.push(a),a=[m]):a.push(m))}if(a&&i.push(a),t>1)for(let m=0;m<i.length;m++)i[m].length<=t||(Uu(i[m],t,1,i[m].length-1,Zp),i[m]=i[m].slice(0,t));return i}function Zp(s,t){return t.area-s.area}function qp(s){let t=0;for(let i,a,h=0,m=s.length,g=m-1;h<m;g=h++)i=s[h],a=s[g],t+=(a.x-i.x)*(i.y+a.y);return t}const ic=1/298.257223563,sc=ic*(2-ic),Zu=Math.PI/180;class nc{constructor(t){const i=6378.137*Zu*1e3,a=Math.cos(t*Zu),h=1/(1-sc*(1-a*a)),m=Math.sqrt(h);this.kx=i*m*a,this.ky=i*m*h*(1-sc)}distance(t,i){const a=this.wrap(t[0]-i[0])*this.kx,h=(t[1]-i[1])*this.ky;return Math.sqrt(a*a+h*h)}pointOnLine(t,i){let a,h,m,g,v=1/0;for(let T=0;T<t.length-1;T++){let P=t[T][0],C=t[T][1],E=this.wrap(t[T+1][0]-P)*this.kx,z=(t[T+1][1]-C)*this.ky,L=0;E===0&&z===0||(L=(this.wrap(i[0]-P)*this.kx*E+(i[1]-C)*this.ky*z)/(E*E+z*z),L>1?(P=t[T+1][0],C=t[T+1][1]):L>0&&(P+=E/this.kx*L,C+=z/this.ky*L)),E=this.wrap(i[0]-P)*this.kx,z=(i[1]-C)*this.ky;const F=E*E+z*z;F<v&&(v=F,a=P,h=C,m=T,g=L)}return{point:[a,h],index:m,t:Math.max(0,Math.min(1,g))}}wrap(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}}function ac(s,t){return t[0]-s[0]}function Da(s){return s[1]-s[0]+1}function As(s,t){return s[1]>=s[0]&&s[1]<t}function oc(s,t){if(s[0]>s[1])return[null,null];const i=Da(s);if(t){if(i===2)return[s,null];const h=Math.floor(i/2);return[[s[0],s[0]+h],[s[0]+h,s[1]]]}if(i===1)return[s,null];const a=Math.floor(i/2)-1;return[[s[0],s[0]+a],[s[0]+a+1,s[1]]]}function lc(s,t){if(!As(t,s.length))return[1/0,1/0,-1/0,-1/0];const i=[1/0,1/0,-1/0,-1/0];for(let a=t[0];a<=t[1];++a)ka(i,s[a]);return i}function Co(s){const t=[1/0,1/0,-1/0,-1/0];for(const i of s)for(const a of i)ka(t,a);return t}function qu(s){return s[0]!==-1/0&&s[1]!==-1/0&&s[2]!==1/0&&s[3]!==1/0}function cc(s,t,i){if(!qu(s)||!qu(t))return NaN;let a=0,h=0;return s[2]<t[0]&&(a=t[0]-s[2]),s[0]>t[2]&&(a=s[0]-t[2]),s[1]>t[3]&&(h=s[1]-t[3]),s[3]<t[1]&&(h=t[1]-s[3]),i.distance([0,0],[a,h])}function vn(s,t,i){const a=i.pointOnLine(t,s);return i.distance(s,a.point)}function uc(s,t,i,a,h){const m=Math.min(vn(s,[i,a],h),vn(t,[i,a],h)),g=Math.min(vn(i,[s,t],h),vn(a,[s,t],h));return Math.min(m,g)}function Yt(s,t,i,a,h){if(!As(t,s.length)||!As(a,i.length))return 1/0;let m=1/0;for(let g=t[0];g<t[1];++g){const v=s[g],T=s[g+1];for(let P=a[0];P<a[1];++P){const C=i[P],E=i[P+1];if(Po(v,T,C,E))return 0;m=Math.min(m,uc(v,T,C,E,h))}}return m}function Gp(s,t,i,a,h){if(!As(t,s.length)||!As(a,i.length))return NaN;let m=1/0;for(let g=t[0];g<=t[1];++g)for(let v=a[0];v<=a[1];++v)if(m=Math.min(m,h.distance(s[g],i[v])),m===0)return m;return m}function Hp(s,t,i){if(yn(s,t,!0))return 0;let a=1/0;for(const h of t){const m=h[0],g=h[h.length-1];if(m!==g&&(a=Math.min(a,vn(s,[g,m],i)),a===0))return a;const v=i.pointOnLine(h,s);if(a=Math.min(a,i.distance(s,v.point)),a===0)return a}return a}function Wp(s,t,i,a){if(!As(t,s.length))return NaN;for(let m=t[0];m<=t[1];++m)if(yn(s[m],i,!0))return 0;let h=1/0;for(let m=t[0];m<t[1];++m){const g=s[m],v=s[m+1];for(const T of i)for(let P=0,C=T.length,E=C-1;P<C;E=P++){const z=T[E],L=T[P];if(Po(g,v,z,L))return 0;h=Math.min(h,uc(g,v,z,L,a))}}return h}function Gu(s,t){for(const i of s)for(const a of i)if(yn(a,t,!0))return!0;return!1}function Xp(s,t,i,a=1/0){const h=Co(s),m=Co(t);if(a!==1/0&&cc(h,m,i)>=a)return a;if(za(h,m)){if(Gu(s,t))return 0}else if(Gu(t,s))return 0;let g=1/0;for(const v of s)for(let T=0,P=v.length,C=P-1;T<P;C=T++){const E=v[C],z=v[T];for(const L of t)for(let F=0,j=L.length,G=j-1;F<j;G=F++){const J=L[G],pe=L[F];if(Po(E,z,J,pe))return 0;g=Math.min(g,uc(E,z,J,pe,i))}}return g}function Hu(s,t,i,a,h,m){if(!m)return;const g=cc(lc(a,m),h,i);g<t&&s.push([g,m,[0,0]])}function Eo(s,t,i,a,h,m,g){if(!m||!g)return;const v=cc(lc(a,m),lc(h,g),i);v<t&&s.push([v,m,g])}function Ao(s,t,i,a,h=1/0){let m=Math.min(a.distance(s[0],i[0][0]),h);if(m===0)return m;const g=new $u([[0,[0,s.length-1],[0,0]]],ac),v=Co(i);for(;g.length>0;){const T=g.pop();if(T[0]>=m)continue;const P=T[1],C=t?50:100;if(Da(P)<=C){if(!As(P,s.length))return NaN;if(t){const E=Wp(s,P,i,a);if(isNaN(E)||E===0)return E;m=Math.min(m,E)}else for(let E=P[0];E<=P[1];++E){const z=Hp(s[E],i,a);if(m=Math.min(m,z),m===0)return 0}}else{const E=oc(P,t);Hu(g,m,a,s,v,E[0]),Hu(g,m,a,s,v,E[1])}}return m}function ko(s,t,i,a,h,m=1/0){let g=Math.min(m,h.distance(s[0],i[0]));if(g===0)return g;const v=new $u([[0,[0,s.length-1],[0,i.length-1]]],ac);for(;v.length>0;){const T=v.pop();if(T[0]>=g)continue;const P=T[1],C=T[2],E=t?50:100,z=a?50:100;if(Da(P)<=E&&Da(C)<=z){if(!As(P,s.length)&&As(C,i.length))return NaN;let L;if(t&&a)L=Yt(s,P,i,C,h),g=Math.min(g,L);else if(t&&!a){const F=s.slice(P[0],P[1]+1);for(let j=C[0];j<=C[1];++j)if(L=vn(i[j],F,h),g=Math.min(g,L),g===0)return g}else if(!t&&a){const F=i.slice(C[0],C[1]+1);for(let j=P[0];j<=P[1];++j)if(L=vn(s[j],F,h),g=Math.min(g,L),g===0)return g}else L=Gp(s,P,i,C,h),g=Math.min(g,L)}else{const L=oc(P,t),F=oc(C,a);Eo(v,g,h,s,i,L[0],F[0]),Eo(v,g,h,s,i,L[0],F[1]),Eo(v,g,h,s,i,L[1],F[0]),Eo(v,g,h,s,i,L[1],F[1])}}return g}function hc(s){return s.type==="MultiPolygon"?s.coordinates.map(t=>({type:"Polygon",coordinates:t})):s.type==="MultiLineString"?s.coordinates.map(t=>({type:"LineString",coordinates:t})):s.type==="MultiPoint"?s.coordinates.map(t=>({type:"Point",coordinates:t})):[s]}class xn{constructor(t,i){this.type=ze,this.geojson=t,this.geometries=i}static parse(t,i){if(t.length!==2)return i.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(fn(t[1])){const a=t[1];if(a.type==="FeatureCollection")return new xn(a,a.features.map(h=>hc(h.geometry)).flat());if(a.type==="Feature")return new xn(a,hc(a.geometry));if("type"in a&&"coordinates"in a)return new xn(a,hc(a))}return i.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return function(i,a){const h=i.geometry(),m=h.flat().map(T=>Kl([T.x,T.y],i.canonical));if(h.length===0)return NaN;const g=new nc(m[0][1]);let v=1/0;for(const T of a){switch(T.type){case"Point":v=Math.min(v,ko(m,!1,[T.coordinates],!1,g,v));break;case"LineString":v=Math.min(v,ko(m,!1,T.coordinates,!0,g,v));break;case"Polygon":v=Math.min(v,Ao(m,!1,T.coordinates,g,v))}if(v===0)return v}return v}(t,this.geometries);if(t.geometryType()==="LineString")return function(i,a){const h=i.geometry(),m=h.flat().map(T=>Kl([T.x,T.y],i.canonical));if(h.length===0)return NaN;const g=new nc(m[0][1]);let v=1/0;for(const T of a){switch(T.type){case"Point":v=Math.min(v,ko(m,!0,[T.coordinates],!1,g,v));break;case"LineString":v=Math.min(v,ko(m,!0,T.coordinates,!0,g,v));break;case"Polygon":v=Math.min(v,Ao(m,!0,T.coordinates,g,v))}if(v===0)return v}return v}(t,this.geometries);if(t.geometryType()==="Polygon")return function(i,a){const h=i.geometry();if(h.length===0||h[0].length===0)return NaN;const m=Io(h,0).map(T=>T.map(P=>P.map(C=>Kl([C.x,C.y],i.canonical)))),g=new nc(m[0][0][0][1]);let v=1/0;for(const T of a)for(const P of m){switch(T.type){case"Point":v=Math.min(v,Ao([T.coordinates],!1,P,g,v));break;case"LineString":v=Math.min(v,Ao(T.coordinates,!0,P,g,v));break;case"Polygon":v=Math.min(v,Xp(P,T.coordinates,g,v))}if(v===0)return v}return v}(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const qn={"==":Bu,"!=":Np,">":Xl,"<":To,">=":So,"<=":jp,array:Yi,at:Ma,boolean:Yi,case:Pa,coalesce:gn,collator:_n,format:Aa,image:Zn,in:Ut,"index-of":$n,interpolate:ir,"interpolate-hcl":ir,"interpolate-lab":ir,length:Yl,let:Vt,literal:xs,match:ls,number:Yi,"number-format":Bi,object:Yi,slice:Ia,step:mn,string:Yi,"to-boolean":Es,"to-color":Es,"to-number":Es,"to-string":Es,var:wt,within:qs,distance:xn};class Ji{constructor(t,i,a,h){this.name=t,this.type=i,this._evaluate=a,this.args=h}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,i){const a=t[0],h=Ji.definitions[a];if(!h)return i.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0);const m=Array.isArray(h)?h[0]:h.type,g=Array.isArray(h)?[[h[1],h[2]]]:h.overloads,v=g.filter(([P])=>!Array.isArray(P)||P.length===t.length-1);let T=null;for(const[P,C]of v){T=new Vn(i.registry,zo,i.path,null,i.scope);const E=[];let z=!1;for(let L=1;L<t.length;L++){const F=t[L],j=Array.isArray(P)?P[L-1]:P.type,G=T.parse(F,1+E.length,j);if(!G){z=!0;break}E.push(G)}if(!z)if(Array.isArray(P)&&P.length!==E.length)T.error(`Expected ${P.length} arguments, but found ${E.length} instead.`);else{for(let L=0;L<E.length;L++){const F=Array.isArray(P)?P[L]:P.type,j=E[L];T.concat(L+1).checkSubtype(F,j.type)}if(T.errors.length===0)return new Ji(a,m,C,E)}}if(v.length===1)i.errors.push(...T.errors);else{const P=(v.length?v:g).map(([E])=>{return z=E,Array.isArray(z)?`(${z.map(hr).join(", ")})`:`(${hr(z.type)}...)`;var z}).join(" | "),C=[];for(let E=1;E<t.length;E++){const z=i.parse(t[E],1+C.length);if(!z)return null;C.push(hr(z.type))}i.error(`Expected arguments of type ${P}, but found (${C.join(", ")}) instead.`)}return null}static register(t,i){Ji.definitions=i;for(const a in i)t[a]=Ji}}function Wu(s,[t,i,a,h]){t=t.evaluate(s),i=i.evaluate(s),a=a.evaluate(s);const m=h?h.evaluate(s):1,g=Zl(t,i,a,m);if(g)throw new _r(g);return new zt(t/255,i/255,a/255,m,!1)}function Xu(s,t){return s in t}function pc(s,t){const i=t[s];return i===void 0?null:i}function bn(s){return{type:s}}function zo(s){if(s instanceof wt)return zo(s.boundExpression);if(s instanceof Ji&&s.name==="error"||s instanceof _n||s instanceof qs||s instanceof xn)return!1;const t=s instanceof Es||s instanceof Yi;let i=!0;return s.eachChild(a=>{i=t?i&&zo(a):i&&a instanceof xs}),!!i&&Ro(s)&&Do(s,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Ro(s){if(s instanceof Ji&&(s.name==="get"&&s.args.length===1||s.name==="feature-state"||s.name==="has"&&s.args.length===1||s.name==="properties"||s.name==="geometry-type"||s.name==="id"||/^filter-/.test(s.name))||s instanceof qs||s instanceof xn)return!1;let t=!0;return s.eachChild(i=>{t&&!Ro(i)&&(t=!1)}),t}function La(s){if(s instanceof Ji&&s.name==="feature-state")return!1;let t=!0;return s.eachChild(i=>{t&&!La(i)&&(t=!1)}),t}function Do(s,t){if(s instanceof Ji&&t.indexOf(s.name)>=0)return!1;let i=!0;return s.eachChild(a=>{i&&!Do(a,t)&&(i=!1)}),i}function Yu(s){return{result:"success",value:s}}function Gn(s){return{result:"error",value:s}}function Hn(s){return s["property-type"]==="data-driven"||s["property-type"]==="cross-faded-data-driven"}function Ku(s){return!!s.expression&&s.expression.parameters.indexOf("zoom")>-1}function dc(s){return!!s.expression&&s.expression.interpolated}function Ht(s){return s instanceof Number?"number":s instanceof String?"string":s instanceof Boolean?"boolean":Array.isArray(s)?"array":s===null?"null":typeof s}function Lo(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)}function Yp(s){return s}function Ju(s,t){const i=t.type==="color",a=s.stops&&typeof s.stops[0][0]=="object",h=a||!(a||s.property!==void 0),m=s.type||(dc(t)?"exponential":"interval");if(i||t.type==="padding"){const C=i?zt.parse:qr.parse;(s=He({},s)).stops&&(s.stops=s.stops.map(E=>[E[0],C(E[1])])),s.default=C(s.default?s.default:t.default)}if(s.colorSpace&&(g=s.colorSpace)!=="rgb"&&g!=="hcl"&&g!=="lab")throw new Error(`Unknown color space: "${s.colorSpace}"`);var g;let v,T,P;if(m==="exponential")v=Qu;else if(m==="interval")v=Kp;else if(m==="categorical"){v=fc,T=Object.create(null);for(const C of s.stops)T[C[0]]=C[1];P=typeof s.stops[0][0]}else{if(m!=="identity")throw new Error(`Unknown function type "${m}"`);v=Jp}if(a){const C={},E=[];for(let F=0;F<s.stops.length;F++){const j=s.stops[F],G=j[0].zoom;C[G]===void 0&&(C[G]={zoom:G,type:s.type,property:s.property,default:s.default,stops:[]},E.push(G)),C[G].stops.push([j[0].value,j[1]])}const z=[];for(const F of E)z.push([C[F].zoom,Ju(C[F],t)]);const L={name:"linear"};return{kind:"composite",interpolationType:L,interpolationFactor:ir.interpolationFactor.bind(void 0,L),zoomStops:z.map(F=>F[0]),evaluate:({zoom:F},j)=>Qu({stops:z,base:s.base},t,F).evaluate(F,j)}}if(h){const C=m==="exponential"?{name:"exponential",base:s.base!==void 0?s.base:1}:null;return{kind:"camera",interpolationType:C,interpolationFactor:ir.interpolationFactor.bind(void 0,C),zoomStops:s.stops.map(E=>E[0]),evaluate:({zoom:E})=>v(s,t,E,T,P)}}return{kind:"source",evaluate(C,E){const z=E&&E.properties?E.properties[s.property]:void 0;return z===void 0?Fa(s.default,t.default):v(s,t,z,T,P)}}}function Fa(s,t,i){return s!==void 0?s:t!==void 0?t:i!==void 0?i:void 0}function fc(s,t,i,a,h){return Fa(typeof i===h?a[i]:void 0,s.default,t.default)}function Kp(s,t,i){if(Ht(i)!=="number")return Fa(s.default,t.default);const a=s.stops.length;if(a===1||i<=s.stops[0][0])return s.stops[0][1];if(i>=s.stops[a-1][0])return s.stops[a-1][1];const h=Ca(s.stops.map(m=>m[0]),i);return s.stops[h][1]}function Qu(s,t,i){const a=s.base!==void 0?s.base:1;if(Ht(i)!=="number")return Fa(s.default,t.default);const h=s.stops.length;if(h===1||i<=s.stops[0][0])return s.stops[0][1];if(i>=s.stops[h-1][0])return s.stops[h-1][1];const m=Ca(s.stops.map(C=>C[0]),i),g=function(C,E,z,L){const F=L-z,j=C-z;return F===0?0:E===1?j/F:(Math.pow(E,j)-1)/(Math.pow(E,F)-1)}(i,a,s.stops[m][0],s.stops[m+1][0]),v=s.stops[m][1],T=s.stops[m+1][1],P=cs[t.type]||Yp;return typeof v.evaluate=="function"?{evaluate(...C){const E=v.evaluate.apply(void 0,C),z=T.evaluate.apply(void 0,C);if(E!==void 0&&z!==void 0)return P(E,z,g,s.colorSpace)}}:P(v,T,g,s.colorSpace)}function Jp(s,t,i){switch(t.type){case"color":i=zt.parse(i);break;case"formatted":i=Pr.fromString(i.toString());break;case"resolvedImage":i=di.fromString(i.toString());break;case"padding":i=qr.parse(i);break;default:Ht(i)===t.type||t.type==="enum"&&t.values[i]||(i=void 0)}return Fa(i,s.default,t.default)}Ji.register(qn,{error:[{kind:"error"},[We],(s,[t])=>{throw new _r(t.evaluate(s))}],typeof:[We,[tt],(s,[t])=>hr(ar(t.evaluate(s)))],"to-rgba":[Fi(ze,4),[At],(s,[t])=>{const[i,a,h,m]=t.evaluate(s).rgb;return[255*i,255*a,255*h,m]}],rgb:[At,[ze,ze,ze],Wu],rgba:[At,[ze,ze,ze,ze],Wu],has:{type:st,overloads:[[[We],(s,[t])=>Xu(t.evaluate(s),s.properties())],[[We,ft],(s,[t,i])=>Xu(t.evaluate(s),i.evaluate(s))]]},get:{type:tt,overloads:[[[We],(s,[t])=>pc(t.evaluate(s),s.properties())],[[We,ft],(s,[t,i])=>pc(t.evaluate(s),i.evaluate(s))]]},"feature-state":[tt,[We],(s,[t])=>pc(t.evaluate(s),s.featureState||{})],properties:[ft,[],s=>s.properties()],"geometry-type":[We,[],s=>s.geometryType()],id:[tt,[],s=>s.id()],zoom:[ze,[],s=>s.globals.zoom],"heatmap-density":[ze,[],s=>s.globals.heatmapDensity||0],"line-progress":[ze,[],s=>s.globals.lineProgress||0],accumulated:[tt,[],s=>s.globals.accumulated===void 0?null:s.globals.accumulated],"+":[ze,bn(ze),(s,t)=>{let i=0;for(const a of t)i+=a.evaluate(s);return i}],"*":[ze,bn(ze),(s,t)=>{let i=1;for(const a of t)i*=a.evaluate(s);return i}],"-":{type:ze,overloads:[[[ze,ze],(s,[t,i])=>t.evaluate(s)-i.evaluate(s)],[[ze],(s,[t])=>-t.evaluate(s)]]},"/":[ze,[ze,ze],(s,[t,i])=>t.evaluate(s)/i.evaluate(s)],"%":[ze,[ze,ze],(s,[t,i])=>t.evaluate(s)%i.evaluate(s)],ln2:[ze,[],()=>Math.LN2],pi:[ze,[],()=>Math.PI],e:[ze,[],()=>Math.E],"^":[ze,[ze,ze],(s,[t,i])=>Math.pow(t.evaluate(s),i.evaluate(s))],sqrt:[ze,[ze],(s,[t])=>Math.sqrt(t.evaluate(s))],log10:[ze,[ze],(s,[t])=>Math.log(t.evaluate(s))/Math.LN10],ln:[ze,[ze],(s,[t])=>Math.log(t.evaluate(s))],log2:[ze,[ze],(s,[t])=>Math.log(t.evaluate(s))/Math.LN2],sin:[ze,[ze],(s,[t])=>Math.sin(t.evaluate(s))],cos:[ze,[ze],(s,[t])=>Math.cos(t.evaluate(s))],tan:[ze,[ze],(s,[t])=>Math.tan(t.evaluate(s))],asin:[ze,[ze],(s,[t])=>Math.asin(t.evaluate(s))],acos:[ze,[ze],(s,[t])=>Math.acos(t.evaluate(s))],atan:[ze,[ze],(s,[t])=>Math.atan(t.evaluate(s))],min:[ze,bn(ze),(s,t)=>
24Math.min(...t.map(i=>i.evaluate(s)))],max:[ze,bn(ze),(s,t)=>Math.max(...t.map(i=>i.evaluate(s)))],abs:[ze,[ze],(s,[t])=>Math.abs(t.evaluate(s))],round:[ze,[ze],(s,[t])=>{const i=t.evaluate(s);return i<0?-Math.round(-i):Math.round(i)}],floor:[ze,[ze],(s,[t])=>Math.floor(t.evaluate(s))],ceil:[ze,[ze],(s,[t])=>Math.ceil(t.evaluate(s))],"filter-==":[st,[We,tt],(s,[t,i])=>s.properties()[t.value]===i.value],"filter-id-==":[st,[tt],(s,[t])=>s.id()===t.value],"filter-type-==":[st,[We],(s,[t])=>s.geometryType()===t.value],"filter-<":[st,[We,tt],(s,[t,i])=>{const a=s.properties()[t.value],h=i.value;return typeof a==typeof h&&a<h}],"filter-id-<":[st,[tt],(s,[t])=>{const i=s.id(),a=t.value;return typeof i==typeof a&&i<a}],"filter->":[st,[We,tt],(s,[t,i])=>{const a=s.properties()[t.value],h=i.value;return typeof a==typeof h&&a>h}],"filter-id->":[st,[tt],(s,[t])=>{const i=s.id(),a=t.value;return typeof i==typeof a&&i>a}],"filter-<=":[st,[We,tt],(s,[t,i])=>{const a=s.properties()[t.value],h=i.value;return typeof a==typeof h&&a<=h}],"filter-id-<=":[st,[tt],(s,[t])=>{const i=s.id(),a=t.value;return typeof i==typeof a&&i<=a}],"filter->=":[st,[We,tt],(s,[t,i])=>{const a=s.properties()[t.value],h=i.value;return typeof a==typeof h&&a>=h}],"filter-id->=":[st,[tt],(s,[t])=>{const i=s.id(),a=t.value;return typeof i==typeof a&&i>=a}],"filter-has":[st,[tt],(s,[t])=>t.value in s.properties()],"filter-has-id":[st,[],s=>s.id()!==null&&s.id()!==void 0],"filter-type-in":[st,[Fi(We)],(s,[t])=>t.value.indexOf(s.geometryType())>=0],"filter-id-in":[st,[Fi(tt)],(s,[t])=>t.value.indexOf(s.id())>=0],"filter-in-small":[st,[We,Fi(tt)],(s,[t,i])=>i.value.indexOf(s.properties()[t.value])>=0],"filter-in-large":[st,[We,Fi(tt)],(s,[t,i])=>function(a,h,m,g){for(;m<=g;){const v=m+g>>1;if(h[v]===a)return!0;h[v]>a?g=v-1:m=v+1}return!1}(s.properties()[t.value],i.value,0,i.value.length-1)],all:{type:st,overloads:[[[st,st],(s,[t,i])=>t.evaluate(s)&&i.evaluate(s)],[bn(st),(s,t)=>{for(const i of t)if(!i.evaluate(s))return!1;return!0}]]},any:{type:st,overloads:[[[st,st],(s,[t,i])=>t.evaluate(s)||i.evaluate(s)],[bn(st),(s,t)=>{for(const i of t)if(i.evaluate(s))return!0;return!1}]]},"!":[st,[st],(s,[t])=>!t.evaluate(s)],"is-supported-script":[st,[We],(s,[t])=>{const i=s.globals&&s.globals.isSupportedScript;return!i||i(t.evaluate(s))}],upcase:[We,[We],(s,[t])=>t.evaluate(s).toUpperCase()],downcase:[We,[We],(s,[t])=>t.evaluate(s).toLowerCase()],concat:[We,bn(tt),(s,t)=>t.map(i=>Sa(i.evaluate(s))).join("")],"resolved-locale":[We,[Tr],(s,[t])=>t.evaluate(s).resolvedLocale()]});class Fo{constructor(t,i){var a;this.expression=t,this._warningHistory={},this._evaluator=new or,this._defaultValue=i?(a=i).type==="color"&&Lo(a.default)?new zt(0,0,0,0):a.type==="color"?zt.parse(a.default)||null:a.type==="padding"?qr.parse(a.default)||null:a.type==="variableAnchorOffsetCollection"?pi.parse(a.default)||null:a.type==="projectionDefinition"?fi.parse(a.default)||null:a.default===void 0?null:a.default:null,this._enumValues=i&&i.type==="enum"?i.values:null}evaluateWithoutErrorHandling(t,i,a,h,m,g){return this._evaluator.globals=t,this._evaluator.feature=i,this._evaluator.featureState=a,this._evaluator.canonical=h,this._evaluator.availableImages=m||null,this._evaluator.formattedSection=g,this.expression.evaluate(this._evaluator)}evaluate(t,i,a,h,m,g){this._evaluator.globals=t,this._evaluator.feature=i||null,this._evaluator.featureState=a||null,this._evaluator.canonical=h,this._evaluator.availableImages=m||null,this._evaluator.formattedSection=g||null;try{const v=this.expression.evaluate(this._evaluator);if(v==null||typeof v=="number"&&v!=v)return this._defaultValue;if(this._enumValues&&!(v in this._enumValues))throw new _r(`Expected value to be one of ${Object.keys(this._enumValues).map(T=>JSON.stringify(T)).join(", ")}, but found ${JSON.stringify(v)} instead.`);return v}catch(v){return this._warningHistory[v.message]||(this._warningHistory[v.message]=!0,typeof console<"u"&&console.warn(v.message)),this._defaultValue}}}function Bo(s){return Array.isArray(s)&&s.length>0&&typeof s[0]=="string"&&s[0]in qn}function Oo(s,t){const i=new Vn(qn,zo,[],t?function(h){const m={color:At,string:We,number:ze,enum:We,boolean:st,formatted:Us,padding:Zr,projectionDefinition:$t,resolvedImage:Nr,variableAnchorOffsetCollection:ur};return h.type==="array"?Fi(m[h.value]||tt,h.length):m[h.type]}(t):void 0),a=i.parse(s,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?Yu(new Fo(a,t)):Gn(i.errors)}
vendor: 10,148 bytes, line 24
24class Wn{constructor(t,i){this.kind=t,this._styleExpression=i,this.isStateDependent=t!=="constant"&&!La(i.expression)}evaluateWithoutErrorHandling(t,i,a,h,m,g){return this._styleExpression.evaluateWithoutErrorHandling(t,i,a,h,m,g)}evaluate(t,i,a,h,m,g){return this._styleExpression.evaluate(t,i,a,h,m,g)}}class No{constructor(t,i,a,h){this.kind=t,this.zoomStops=a,this._styleExpression=i,this.isStateDependent=t!=="camera"&&!La(i.expression),this.interpolationType=h}evaluateWithoutErrorHandling(t,i,a,h,m,g){return this._styleExpression.evaluateWithoutErrorHandling(t,i,a,h,m,g)}evaluate(t,i,a,h,m,g){return this._styleExpression.evaluate(t,i,a,h,m,g)}interpolationFactor(t,i,a){return this.interpolationType?ir.interpolationFactor(this.interpolationType,t,i,a):0}}function eh(s,t){const i=Oo(s,t);if(i.result==="error")return i;const a=i.value.expression,h=Ro(a);if(!h&&!Hn(t))return Gn([new qe("","data expressions not supported")]);const m=Do(a,["zoom"]);if(!m&&!Ku(t))return Gn([new qe("","zoom expressions not supported")]);const g=Vo(a);return g||m?g instanceof qe?Gn([g]):g instanceof ir&&!dc(t)?Gn([new qe("",'"interpolate" expressions cannot be used with this property')]):Yu(g?new No(h?"camera":"composite",i.value,g.labels,g instanceof ir?g.interpolation:void 0):new Wn(h?"constant":"source",i.value)):Gn([new qe("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class jo{constructor(t,i){this._parameters=t,this._specification=i,He(this,Ju(this._parameters,this._specification))}static deserialize(t){return new jo(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function Vo(s){let t=null;if(s instanceof Vt)t=Vo(s.result);else if(s instanceof gn){for(const i of s.args)if(t=Vo(i),t)break}else(s instanceof mn||s instanceof ir)&&s.input instanceof Ji&&s.input.name==="zoom"&&(t=s);return t instanceof qe||s.eachChild(i=>{const a=Vo(i);a instanceof qe?t=a:!t&&a?t=new qe("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&a&&t!==a&&(t=new qe("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}function mc(s){if(s===!0||s===!1)return!0;if(!Array.isArray(s)||s.length===0)return!1;switch(s[0]){case"has":return s.length>=2&&s[1]!=="$id"&&s[1]!=="$type";case"in":return s.length>=3&&(typeof s[1]!="string"||Array.isArray(s[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return s.length!==3||Array.isArray(s[1])||Array.isArray(s[2]);case"any":case"all":for(const t of s.slice(1))if(!mc(t)&&typeof t!="boolean")return!1;return!0;default:return!0}}const Qp={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function $o(s){if(s==null)return{filter:()=>!0,needGeometry:!1};mc(s)||(s=Uo(s));const t=Oo(s,Qp);if(t.result==="error")throw new Error(t.value.map(i=>`${i.key}: ${i.message}`).join(", "));return{filter:(i,a,h)=>t.value.evaluate(i,a,{},h),needGeometry:rh(s)}}function th(s,t){return s<t?-1:s>t?1:0}function rh(s){if(!Array.isArray(s))return!1;if(s[0]==="within"||s[0]==="distance")return!0;for(let t=1;t<s.length;t++)if(rh(s[t]))return!0;return!1}function Uo(s){if(!s)return!0;const t=s[0];return s.length<=1?t!=="any":t==="=="?Zo(s[1],s[2],"=="):t==="!="?Ba(Zo(s[1],s[2],"==")):t==="<"||t===">"||t==="<="||t===">="?Zo(s[1],s[2],t):t==="any"?(i=s.slice(1),["any"].concat(i.map(Uo))):t==="all"?["all"].concat(s.slice(1).map(Uo)):t==="none"?["all"].concat(s.slice(1).map(Uo).map(Ba)):t==="in"?gc(s[1],s.slice(2)):t==="!in"?Ba(gc(s[1],s.slice(2))):t==="has"?_c(s[1]):t!=="!has"||Ba(_c(s[1]));var i}function Zo(s,t,i){switch(s){case"$type":return[`filter-type-${i}`,t];case"$id":return[`filter-id-${i}`,t];default:return[`filter-${i}`,s,t]}}function gc(s,t){if(t.length===0)return!1;switch(s){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(i=>typeof i!=typeof t[0])?["filter-in-large",s,["literal",t.sort(th)]]:["filter-in-small",s,["literal",t]]}}function _c(s){switch(s){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",s]}}function Ba(s){return["!",s]}function Oa(s){const t=typeof s;if(t==="number"||t==="boolean"||t==="string"||s==null)return JSON.stringify(s);if(Array.isArray(s)){let h="[";for(const m of s)h+=`${Oa(m)},`;return`${h}]`}const i=Object.keys(s).sort();let a="{";for(let h=0;h<i.length;h++)a+=`${JSON.stringify(i[h])}:${Oa(s[i[h]])},`;return`${a}}`}function yc(s){let t="";for(const i of N)t+=`/${Oa(s[i])}`;return t}function qo(s){const t=s.value;return t?[new de(s.key,t,"constants have been deprecated as of v8")]:[]}function pr(s){return s instanceof Number||s instanceof String||s instanceof Boolean?s.valueOf():s}function wn(s){if(Array.isArray(s))return s.map(wn);if(s instanceof Object&&!(s instanceof Number||s instanceof String||s instanceof Boolean)){const t={};for(const i in s)t[i]=wn(s[i]);return t}return pr(s)}function Qi(s){const t=s.key,i=s.value,a=s.valueSpec||{},h=s.objectElementValidators||{},m=s.style,g=s.styleSpec,v=s.validateSpec;let T=[];const P=Ht(i);if(P!=="object")return[new de(t,i,`object expected, ${P} found`)];for(const C in i){const E=C.split(".")[0],z=a[E]||a["*"];let L;if(h[E])L=h[E];else if(a[E])L=v;else if(h["*"])L=h["*"];else{if(!a["*"]){T.push(new de(t,i[C],`unknown property "${C}"`));continue}L=v}T=T.concat(L({key:(t&&`${t}.`)+C,value:i[C],valueSpec:z,style:m,styleSpec:g,object:i,objectKey:C,validateSpec:v},i))}for(const C in a)h[C]||a[C].required&&a[C].default===void 0&&i[C]===void 0&&T.push(new de(t,i,`missing required property "${C}"`));return T}function vc(s){const t=s.value,i=s.valueSpec,a=s.style,h=s.styleSpec,m=s.key,g=s.arrayElementValidator||s.validateSpec;if(Ht(t)!=="array")return[new de(m,t,`array expected, ${Ht(t)} found`)];if(i.length&&t.length!==i.length)return[new de(m,t,`array length ${i.length} expected, length ${t.length} found`)];if(i["min-length"]&&t.length<i["min-length"])return[new de(m,t,`array length at least ${i["min-length"]} expected, length ${t.length} found`)];let v={type:i.value,values:i.values};h.$version<7&&(v.function=i.function),Ht(i.value)==="object"&&(v=i.value);let T=[];for(let P=0;P<t.length;P++)T=T.concat(g({array:t,arrayIndex:P,value:t[P],valueSpec:v,validateSpec:s.validateSpec,style:a,styleSpec:h,key:`${m}[${P}]`}));return T}function xc(s){const t=s.key,i=s.value,a=s.valueSpec;let h=Ht(i);return h==="number"&&i!=i&&(h="NaN"),h!=="number"?[new de(t,i,`number expected, ${h} found`)]:"minimum"in a&&i<a.minimum?[new de(t,i,`${i} is less than the minimum value ${a.minimum}`)]:"maximum"in a&&i>a.maximum?[new de(t,i,`${i} is greater than the maximum value ${a.maximum}`)]:[]}function ih(s){const t=s.valueSpec,i=pr(s.value.type);let a,h,m,g={};const v=i!=="categorical"&&s.value.property===void 0,T=!v,P=Ht(s.value.stops)==="array"&&Ht(s.value.stops[0])==="array"&&Ht(s.value.stops[0][0])==="object",C=Qi({key:s.key,value:s.value,valueSpec:s.styleSpec.function,validateSpec:s.validateSpec,style:s.style,styleSpec:s.styleSpec,objectElementValidators:{stops:function(L){if(i==="identity")return[new de(L.key,L.value,'identity function may not have a "stops" property')];let F=[];const j=L.value;return F=F.concat(vc({key:L.key,value:j,valueSpec:L.valueSpec,validateSpec:L.validateSpec,style:L.style,styleSpec:L.styleSpec,arrayElementValidator:E})),Ht(j)==="array"&&j.length===0&&F.push(new de(L.key,j,"array must have at least one stop")),F},default:function(L){return L.validateSpec({key:L.key,value:L.value,valueSpec:t,validateSpec:L.validateSpec,style:L.style,styleSpec:L.styleSpec})}}});return i==="identity"&&v&&C.push(new de(s.key,s.value,'missing required property "property"')),i==="identity"||s.value.stops||C.push(new de(s.key,s.value,'missing required property "stops"')),i==="exponential"&&s.valueSpec.expression&&!dc(s.valueSpec)&&C.push(new de(s.key,s.value,"exponential functions not supported")),s.styleSpec.$version>=8&&(T&&!Hn(s.valueSpec)?C.push(new de(s.key,s.value,"property functions not supported")):v&&!Ku(s.valueSpec)&&C.push(new de(s.key,s.value,"zoom functions not supported"))),i!=="categorical"&&!P||s.value.property!==void 0||C.push(new de(s.key,s.value,'"property" property is required')),C;function E(L){let F=[];const j=L.value,G=L.key;if(Ht(j)!=="array")return[new de(G,j,`array expected, ${Ht(j)} found`)];if(j.length!==2)return[new de(G,j,`array length 2 expected, length ${j.length} found`)];if(P){if(Ht(j[0])!=="object")return[new de(G,j,`object expected, ${Ht(j[0])} found`)];if(j[0].zoom===void 0)return[new de(G,j,"object stop key must have zoom")];if(j[0].value===void 0)return[new de(G,j,"object stop key must have value")];if(m&&m>pr(j[0].zoom))return[new de(G,j[0].zoom,"stop zoom values must appear in ascending order")];pr(j[0].zoom)!==m&&(m=pr(j[0].zoom),h=void 0,g={}),F=F.concat(Qi({key:`${G}[0]`,value:j[0],valueSpec:{zoom:{}},validateSpec:L.validateSpec,style:L.style,styleSpec:L.styleSpec,objectElementValidators:{zoom:xc,value:z}}))}else F=F.concat(z({key:`${G}[0]`,value:j[0],validateSpec:L.validateSpec,style:L.style,styleSpec:L.styleSpec},j));return Bo(wn(j[1]))?F.concat([new de(`${G}[1]`,j[1],"expressions are not allowed in function stops.")]):F.concat(L.validateSpec({key:`${G}[1]`,value:j[1],valueSpec:t,validateSpec:L.validateSpec,style:L.style,styleSpec:L.styleSpec}))}function z(L,F){const j=Ht(L.value),G=pr(L.value),J=L.value!==null?L.value:F;if(a){if(j!==a)return[new de(L.key,J,`${j} stop domain type must match previous stop domain type ${a}`)]}else a=j;if(j!=="number"&&j!=="string"&&j!=="boolean")return[new de(L.key,J,"stop domain value must be a number, string, or boolean")];if(j!=="number"&&i!=="categorical"){let pe=`number expected, ${j} found`;return Hn(t)&&i===void 0&&(pe+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new de(L.key,J,pe)]}return i!=="categorical"||j!=="number"||isFinite(G)&&Math.floor(G)===G?i!=="c
24ategorical"&&j==="number"&&h!==void 0&&G<h?[new de(L.key,J,"stop domain values must appear in ascending order")]:(h=G,i==="categorical"&&G in g?[new de(L.key,J,"stop domain values must be unique")]:(g[G]=!0,[])):[new de(L.key,J,`integer expected, found ${G}`)]}}function Xn(s){const t=(s.expressionContext==="property"?eh:Oo)(wn(s.value),s.valueSpec);if(t.result==="error")return t.value.map(a=>new de(`${s.key}${a.key}`,s.value,a.message));const i=t.value.expression||t.value._styleExpression.expression;if(s.expressionContext==="property"&&s.propertyKey==="text-font"&&!i.outputDefined())return[new de(s.key,s.value,`Invalid data expression for "${s.propertyKey}". Output values must be contained as literals within the expression.`)];if(s.expressionContext==="property"&&s.propertyType==="layout"&&!La(i))return[new de(s.key,s.value,'"feature-state" data expressions are not supported with layout properties.')];if(s.expressionContext==="filter"&&!La(i))return[new de(s.key,s.value,'"feature-state" data expressions are not supported with filters.')];if(s.expressionContext&&s.expressionContext.indexOf("cluster")===0){if(!Do(i,["zoom","feature-state"]))return[new de(s.key,s.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(s.expressionContext==="cluster-initial"&&!Ro(i))return[new de(s.key,s.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Yn(s){const t=s.key,i=s.value,a=s.valueSpec,h=[];return Array.isArray(a.values)?a.values.indexOf(pr(i))===-1&&h.push(new de(t,i,`expected one of [${a.values.join(", ")}], ${JSON.stringify(i)} found`)):Object.keys(a.values).indexOf(pr(i))===-1&&h.push(new de(t,i,`expected one of [${Object.keys(a.values).join(", ")}], ${JSON.stringify(i)} found`)),h}function Go(s){return mc(wn(s.value))?Xn(He({},s,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Na(s)}function Na(s){const t=s.value,i=s.key;if(Ht(t)!=="array")return[new de(i,t,`array expected, ${Ht(t)} found`)];const a=s.styleSpec;let h,m=[];if(t.length<1)return[new de(i,t,"filter array must have at least 1 element")];switch(m=m.concat(Yn({key:`${i}[0]`,value:t[0],valueSpec:a.filter_operator,style:s.style,styleSpec:s.styleSpec})),pr(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&pr(t[1])==="$type"&&m.push(new de(i,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":t.length!==3&&m.push(new de(i,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(h=Ht(t[1]),h!=="string"&&m.push(new de(`${i}[1]`,t[1],`string expected, ${h} found`)));for(let g=2;g<t.length;g++)h=Ht(t[g]),pr(t[1])==="$type"?m=m.concat(Yn({key:`${i}[${g}]`,value:t[g],valueSpec:a.geometry_type,style:s.style,styleSpec:s.styleSpec})):h!=="string"&&h!=="number"&&h!=="boolean"&&m.push(new de(`${i}[${g}]`,t[g],`string, number, or boolean expected, ${h} found`));break;case"any":case"all":case"none":for(let g=1;g<t.length;g++)m=m.concat(Na({key:`${i}[${g}]`,value:t[g],style:s.style,styleSpec:s.styleSpec}));break;case"has":case"!has":h=Ht(t[1]),t.length!==2?m.push(new de(i,t,`filter array for "${t[0]}" operator must have 2 elements`)):h!=="string"&&m.push(new de(`${i}[1]`,t[1],`string expected, ${h} found`))}return m}function sh(s,t){const i=s.key,a=s.validateSpec,h=s.style,m=s.styleSpec,g=s.value,v=s.objectKey,T=m[`${t}_${s.layerType}`];if(!T)return[];const P=v.match(/^(.*)-transition$/);if(t==="paint"&&P&&T[P[1]]&&T[P[1]].transition)return a({key:i,value:g,valueSpec:m.transition,style:h,styleSpec:m});const C=s.valueSpec||T[v];if(!C)return[new de(i,g,`unknown property "${v}"`)];let E;if(Ht(g)==="string"&&Hn(C)&&!C.tokens&&(E=/^{([^}]+)}$/.exec(g)))return[new de(i,g,`"${v}" does not support interpolation syntax
25Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(E[1])} }\`.`)];const z=[];return s.layerType==="symbol"&&(v==="text-field"&&h&&!h.glyphs&&z.push(new de(i,g,'use of "text-field" requires a style "glyphs" property')),v==="text-font"&&Lo(wn(g))&&pr(g.type)==="identity"&&z.push(new de(i,g,'"text-font" does not support identity functions'))),z.concat(a({ke
vendor: 4,687 bytes, line 25
25y:s.key,value:g,valueSpec:C,style:h,styleSpec:m,expressionContext:"property",propertyType:t,propertyKey:v}))}function bc(s){return sh(s,"paint")}function wc(s){return sh(s,"layout")}function nh(s){let t=[];const i=s.value,a=s.key,h=s.style,m=s.styleSpec;i.type||i.ref||t.push(new de(a,i,'either "type" or "ref" is required'));let g=pr(i.type);const v=pr(i.ref);if(i.id){const T=pr(i.id);for(let P=0;P<s.arrayIndex;P++){const C=h.layers[P];pr(C.id)===T&&t.push(new de(a,i.id,`duplicate layer id "${i.id}", previously used at line ${C.id.__line__}`))}}if("ref"in i){let T;["type","source","source-layer","filter","layout"].forEach(P=>{P in i&&t.push(new de(a,i[P],`"${P}" is prohibited for ref layers`))}),h.layers.forEach(P=>{pr(P.id)===v&&(T=P)}),T?T.ref?t.push(new de(a,i.ref,"ref cannot reference another ref layer")):g=pr(T.type):t.push(new de(a,i.ref,`ref layer "${v}" not found`))}else if(g!=="background")if(i.source){const T=h.sources&&h.sources[i.source],P=T&&pr(T.type);T?P==="vector"&&g==="raster"?t.push(new de(a,i.source,`layer "${i.id}" requires a raster source`)):P!=="raster-dem"&&g==="hillshade"?t.push(new de(a,i.source,`layer "${i.id}" requires a raster-dem source`)):P==="raster"&&g!=="raster"?t.push(new de(a,i.source,`layer "${i.id}" requires a vector source`)):P!=="vector"||i["source-layer"]?P==="raster-dem"&&g!=="hillshade"?t.push(new de(a,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):g!=="line"||!i.paint||!i.paint["line-gradient"]||P==="geojson"&&T.lineMetrics||t.push(new de(a,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new de(a,i,`layer "${i.id}" must specify a "source-layer"`)):t.push(new de(a,i.source,`source "${i.source}" not found`))}else t.push(new de(a,i,'missing required property "source"'));return t=t.concat(Qi({key:a,value:i,valueSpec:m.layer,style:s.style,styleSpec:s.styleSpec,validateSpec:s.validateSpec,objectElementValidators:{"*":()=>[],type:()=>s.validateSpec({key:`${a}.type`,value:i.type,valueSpec:m.layer.type,style:s.style,styleSpec:s.styleSpec,validateSpec:s.validateSpec,object:i,objectKey:"type"}),filter:Go,layout:T=>Qi({layer:i,key:T.key,value:T.value,style:T.style,styleSpec:T.styleSpec,validateSpec:T.validateSpec,objectElementValidators:{"*":P=>wc(He({layerType:g},P))}}),paint:T=>Qi({layer:i,key:T.key,value:T.value,style:T.style,styleSpec:T.styleSpec,validateSpec:T.validateSpec,objectElementValidators:{"*":P=>bc(He({layerType:g},P))}})}})),t}function Gs(s){const t=s.value,i=s.key,a=Ht(t);return a!=="string"?[new de(i,t,`string expected, ${a} found`)]:[]}const Tc={promoteId:function({key:s,value:t}){if(Ht(t)==="string")return Gs({key:s,value:t});{const i=[];for(const a in t)i.push(...Gs({key:`${s}.${a}`,value:t[a]}));return i}}};function Kn(s){const t=s.value,i=s.key,a=s.styleSpec,h=s.style,m=s.validateSpec;if(!t.type)return[new de(i,t,'"type" is required')];const g=pr(t.type);let v;switch(g){case"vector":case"raster":return v=Qi({key:i,value:t,valueSpec:a[`source_${g.replace("-","_")}`],style:s.style,styleSpec:a,objectElementValidators:Tc,validateSpec:m}),v;case"raster-dem":return v=function(T){var P;const C=(P=T.sourceName)!==null&&P!==void 0?P:"",E=T.value,z=T.styleSpec,L=z.source_raster_dem,F=T.style;let j=[];const G=Ht(E);if(E===void 0)return j;if(G!=="object")return j.push(new de("source_raster_dem",E,`object expected, ${G} found`)),j;const J=pr(E.encoding)==="custom",pe=["redFactor","greenFactor","blueFactor","baseShift"],re=T.value.encoding?`"${T.value.encoding}"`:"Default";for(const D in E)!J&&pe.includes(D)?j.push(new de(D,E[D],`In "${C}": "${D}" is only valid when "encoding" is set to "custom". ${re} encoding found`)):L[D]?j=j.concat(T.validateSpec({key:D,value:E[D],valueSpec:L[D],validateSpec:T.validateSpec,style:F,styleSpec:z})):j.push(new de(D,E[D],`unknown property "${D}"`));return j}({sourceName:i,value:t,style:s.style,styleSpec:a,validateSpec:m}),v;case"geojson":if(v=Qi({key:i,value:t,valueSpec:a.source_geojson,style:h,styleSpec:a,validateSpec:m,objectElementValidators:Tc}),t.cluster)for(const T in t.clusterProperties){const[P,C]=t.clusterProperties[T],E=typeof P=="string"?[P,["accumulated"],["get",T]]:P;v.push(...Xn({key:`${i}.${T}.map`,value:C,expressionContext:"cluster-map"})),v.push(...Xn({key:`${i}.${T}.reduce`,value:E,expressionContext:"cluster-reduce"}))}return v;case"video":return Qi({key:i,value:t,valueSpec:a.source_video,style:h,validateSpec:m,styleSpec:a});case"image":return Qi({key:i,value:t,valueSpec:a.source_image,style:h,validateSpec:m,styleSpec:a});case"canvas":return[new de(i,null,"Please use runtime APIs to add canvas sources, rather than 
25including them in stylesheets.","source.canvas")];default:return Yn({key:`${i}.type`,value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function ah(s){const t=s.value,i=s.styleSpec,a=i.light,h=s.style;let m=[];const g=Ht(t);if(t===void 0)return m;if(g!=="object")return m=m.concat([new de("light",t,`object expected, ${g} found`)]),m;for(const v in t){const T=v.match(/^(.*)-transition$/);m=m.concat(T&&a[T[1]]&&a[T[1]].transition?s.validateSpec({key:v,value:t[v],valueSpec:i.transition,validateSpec:s.validateSpec,style:h,styleSpec:i}):a[v]?s.validateSpec({key:v,value:t[v],valueSpec:a[v],validateSpec:s.validateSpec,style:h,styleSpec:i}):[new de(v,t[v],`unknown property "${v}"`)])}return m}function oh(s){const t=s.value,i=s.styleSpec,a=i.sky,h=s.style,m=Ht(t);if(t===void 0)return[];if(m!=="object")return[new de("sky",t,`object expected, ${m} found`)];let g=[];for(const v in t)g=g.concat(a[v]?s.validateSpec({key:v,value:t[v],valueSpec:a[v],style:h,styleSpec:i}):[new de(v,t[v],`unknown property "${v}"`)]);return g}function lh(s){const t=s.value,i=s.styleSpec,a=i.terrain,h=s.style;let m=[];const g=Ht(t);if(t===void 0)return m;if(g!=="object")return m=m.concat([new de("terrain",t,`object expected, ${g} found`)]),m;for(const v in t)m=m.concat(a[v]?s.validateSpec({key:v,value:t[v],valueSpec:a[v],validateSpec:s.validateSpec,style:h,styleSpec:i}):[new de(v,t[v],`unknown property "${v}"`)]);return m}function ch(s){let t=[];const i=s.value,a=s.key;if(Array.isArray(i)){const h=[],m=[];for(const g in i)i[g].id&&h.includes(i[g].id)&&t.push(new de(a,i,`all the sprites' ids must be unique, but ${i[g].id} is duplicated`)),h.push(i[g].id),i[g].url&&m.includes(i[g].url)&&t.push(new de(a,i,`all the sprites' URLs must be unique, but ${i[g].url} is duplicated`)),m.push(i[g].url),t=t.concat(Qi({key:`${a}[${g}]`,value:i[g],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:s.validateSpec}));return t}return Gs({key:a,value:i})}const uh={"*":()=>[],array:vc,boolean:function(s){const t=s.value,i=s.key,a=Ht(t);return a!=="boolean"?[new de(i,t,`boolean expected, ${a} found`)]:[]},number:xc,color:function(s){const t=s.key,i=s.value,a=Ht(i);return a!=="string"?[new de(t,i,`color expected, ${a} found`)]:zt.parse(String(i))?[]:[new de(t,i,`color expected, "${i}" found`)]},constants:qo,enum:Yn,filter:Go,function:ih,layer:nh,object:Qi,source:Kn,light:ah,sky:oh,terrain:lh,projection:function(s){const t=s.value,i=s.styleSpec,a=i.projection,h=s.style,m=Ht(t);if(t===void 0)return[];if(m!=="object")return[new de("projection",t,`object expected, ${m} found`)];let g=[];for(const v in t)g=g.concat(a[v]?s.validateSpec({key:v,value:t[v],valueSpec:a[v],style:h,styleSpec:i}):[new de(v,t[v],`unknown property "${v}"`)]);return g},projectionDefinition:function(s){const t=s.key;let i=s.value;i=i instanceof String?i.valueOf():i;const a=Ht(i);return a!=="array"||function(h){return Array.isArray(h)&&h.length===3&&typeof h[0]=="string"&&typeof h[1]=="string"&&typeof h[2]=="number"}(i)||function(h){return!!["interpolate","step","literal"].includes(h[0])}(i)?["array","string"].includes(a)?[]:[new de(t,i,`projection expected, invalid type "${a}" found`)]:[new de(t,i,`projection expected, invalid array ${JSON.stringify(i)} found`)]},string:Gs,formatted:function(s){return Gs(s).length===0?[]:Xn(s)},resolvedImage:function(s){return Gs(s).length===0?[]:Xn(s)},padding:function(s){const t=s.key,i=s.value;if(Ht(i)==="array"){if(i.length<1||i.length>4)return[new de(t,i,`padding requires 1 to 4 values; ${i.length} values found`)];const a={type:"number"};let h=[];for(let m=0;m<i.length;m++)h=h.concat(s.validateSpec({key:`${t}[${m}]`,value:i[m],validateSpec:s.validateSpec,valueSpec:a}));return h}return xc({key:t,value:i,valueSpec:{}})},variableAnchorOffsetCollection:function(s){const t=s.key,i=s.value,a=Ht(i),h=s.styleSpec;if(a!=="array"||i.length<1||i.length%2!=0)return[new de(t,i,"variableAnchorOffsetCollection requires a non-empty array of even length")];let m=[];for(let g=0;g<i.length;g+=2)m=m.concat(Yn({key:`${t}[${g}]`,value:i[g],valueSpec:h.layout_symbol["text-anchor"]})),m=m.concat(vc({key:`${t}[${g+1}]`,value:i[g+1],valueSpec:{length:2,value:"number"},validateSpec:s.validateSpec,style:s.style,styleSpec:h}));return m},sprite:ch};function Ho(s){const t=s.value,i=s.valueSpec,a=s.styleSpec;return s.validateSpec=Ho,i.expression&&Lo(pr(t))?ih(s):i.expression&&Bo(wn(t))?Xn(s):i.type&&uh[i.type]?uh[i.type](s):Qi(He({},s,{valueSpec:i.type?a[i.type]:i}))}function Jn(s){const t=s.value,i=s.key,a=Gs(s);return a.length||(t.indexOf("{fontstack}")===-1&&a.push(new de(i,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&a.push(new de(i,t,'"glyphs" url must include a "{range}" token'))),a}function xi(s,t=H){let i=[];return i=i.concat(Ho({key:"",value:s,valueSpec:t.$root,styleSpec:t,style:s,validateSpec:Ho,objectElementValidators:{glyphs:Jn,"*":()=>[]}})),s.constants&&(i=i.concat(qo({key:"constants",value:s.constants}))),Qn(i)}function Ir(s){return function(t){return s({...t,validateSpec:Ho})}}function Qn(s){return[].concat(s).sort((t,i)=>t.line-i.line)}function us(s){return function(...t){return Qn(s.apply(this,t))}}xi.source=us(Ir(Kn)),xi.sprite=us(Ir(ch)),xi.glyphs=us(Ir(Jn)),xi.light=us(Ir(ah)),xi.sky=us(Ir(oh)),xi.terrain=us(Ir(lh)),xi.layer=us(Ir(nh)),xi.filter=us(Ir(Go)),xi.paintProperty=us(Ir(bc)),xi.layoutProperty=us(Ir(wc));const ea=xi,ed=ea.light,ja=ea.sky,hh=ea.paintProperty,Sc=ea.layoutProperty;function ph(s,t){let i=!1;if(t&&t.length)for(const a of t)s.fire(new as(new Error(a.message))),i=!0;return i}class Tn{constructor(t,i,a){const h=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;const g=new Int32Array(this.arrayBuffer);t=g[0],this.d=(i=g[1])+2*(a=g[2]);for(let T=0;T<this.d*this.d;T++){const P=g[3+T],C=g[3+T+1];h.push(P===C?null:g.subarray(P,C))}const v=g[3+h.length+1];this.keys=g.subarray(g[3+h.length],v),this.bboxes=g.subarray(v),this.insert=this._insertReadonly}else{this.d=i+2*a;for(let g=0;g<this.d*this.d;g++)h.push([]);this.keys=[],this.bboxes=[]}this.n=i,this.extent=t,this.padding=a,this.scale=i/t,this.uid=0;const m=a/i*t;this.min=-m,this.max=t+m}
vendor: 6,817 bytes, line 25
25insert(t,i,a,h,m){this._forEachCell(i,a,h,m,this._insertCell,this.uid++,void 0,void 0),this.keys.push(t),this.bboxes.push(i),this.bboxes.push(a),this.bboxes.push(h),this.bboxes.push(m)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(t,i,a,h,m,g){this.cells[m].push(g)}query(t,i,a,h,m){const g=this.min,v=this.max;if(t<=g&&i<=g&&v<=a&&v<=h&&!m)return Array.prototype.slice.call(this.keys);{const T=[];return this._forEachCell(t,i,a,h,this._queryCell,T,{},m),T}}_queryCell(t,i,a,h,m,g,v,T){const P=this.cells[m];if(P!==null){const C=this.keys,E=this.bboxes;for(let z=0;z<P.length;z++){const L=P[z];if(v[L]===void 0){const F=4*L;(T?T(E[F+0],E[F+1],E[F+2],E[F+3]):t<=E[F+2]&&i<=E[F+3]&&a>=E[F+0]&&h>=E[F+1])?(v[L]=!0,g.push(C[L])):v[L]=!1}}}}_forEachCell(t,i,a,h,m,g,v,T){const P=this._convertToCellCoord(t),C=this._convertToCellCoord(i),E=this._convertToCellCoord(a),z=this._convertToCellCoord(h);for(let L=P;L<=E;L++)for(let F=C;F<=z;F++){const j=this.d*F+L;if((!T||T(this._convertFromCellCoord(L),this._convertFromCellCoord(F),this._convertFromCellCoord(L+1),this._convertFromCellCoord(F+1)))&&m.call(this,t,i,a,h,j,g,v,T))return}}_convertFromCellCoord(t){return(t-this.padding)/this.scale}_convertToCellCoord(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const t=this.cells,i=3+this.cells.length+1+1;let a=0;for(let g=0;g<this.cells.length;g++)a+=this.cells[g].length;const h=new Int32Array(i+a+this.keys.length+this.bboxes.length);h[0]=this.extent,h[1]=this.n,h[2]=this.padding;let m=i;for(let g=0;g<t.length;g++){const v=t[g];h[3+g]=m,h.set(v,m),m+=v.length}return h[3+t.length]=m,h.set(this.keys,m),m+=this.keys.length,h[3+t.length+1]=m,h.set(this.bboxes,m),m+=this.bboxes.length,h.buffer}static serialize(t,i){const a=t.toArrayBuffer();return i&&i.push(a),{buffer:a}}static deserialize(t){return new Tn(t.buffer)}}const ks={};function Qe(s,t,i={}){if(ks[s])throw new Error(`${s} is already registered.`);Object.defineProperty(t,"_classRegistryKey",{value:s,writeable:!1}),ks[s]={klass:t,omit:i.omit||[],shallow:i.shallow||[]}}Qe("Object",Object),Qe("TransferableGridIndex",Tn),Qe("Color",zt),Qe("Error",Error),Qe("AJAXError",Mt),Qe("ResolvedImage",di),Qe("StylePropertyFunction",jo),Qe("StyleExpression",Fo,{omit:["_evaluator"]}),Qe("ZoomDependentExpression",No),Qe("ZoomConstantExpression",Wn),Qe("CompoundExpression",Ji,{omit:["_evaluate"]});for(const s in qn)qn[s]._classRegistryKey||Qe(`Expression_${s}`,qn[s]);function dh(s){return s&&typeof ArrayBuffer<"u"&&(s instanceof ArrayBuffer||s.constructor&&s.constructor.name==="ArrayBuffer")}function Sn(s){return s.$name||s.constructor._classRegistryKey}function fh(s){return!function(t){if(t===null||typeof t!="object")return!1;const i=Sn(t);return!(!i||i==="Object")}(s)&&(s==null||typeof s=="boolean"||typeof s=="number"||typeof s=="string"||s instanceof Boolean||s instanceof Number||s instanceof String||s instanceof Date||s instanceof RegExp||s instanceof Blob||s instanceof Error||dh(s)||Ve(s)||ArrayBuffer.isView(s)||s instanceof ImageData)}function Va(s,t){if(fh(s))return(dh(s)||Ve(s))&&t&&t.push(s),ArrayBuffer.isView(s)&&t&&t.push(s.buffer),s instanceof ImageData&&t&&t.push(s.data.buffer),s;if(Array.isArray(s)){const m=[];for(const g of s)m.push(Va(g,t));return m}if(typeof s!="object")throw new Error("can't serialize object of type "+typeof s);const i=Sn(s);if(!i)throw new Error(`can't serialize object of unregistered class ${s.constructor.name}`);if(!ks[i])throw new Error(`${i} is not registered.`);const{klass:a}=ks[i],h=a.serialize?a.serialize(s,t):{};if(a.serialize){if(t&&h===t[t.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const m in s){if(!s.hasOwnProperty(m)||ks[i].omit.indexOf(m)>=0)continue;const g=s[m];h[m]=ks[i].shallow.indexOf(m)>=0?g:Va(g,t)}s instanceof Error&&(h.message=s.message)}if(h.$name)throw new Error("$name property is reserved for worker serialization logic.");return i!=="Object"&&(h.$name=i),h}function Hs(s){if(fh(s))return s;if(Array.isArray(s))return s.map(Hs);if(typeof s!="object")throw new Error("can't deserialize object of type "+typeof s);const t=Sn(s)||"Object";if(!ks[t])throw new Error(`can't deserialize unregistered class ${t}`);const{klass:i}=ks[t];if(!i)throw new Error(`can't deserialize unregistered class ${t}`);if(i.deserialize)return i.deserialize(s);const a=Object.create(i.prototype);for(const h of Object.keys(s)){if(h==="$name")continue;const m=s[h];a[h]=ks[t].shallow.indexOf(h)>=0?m:Hs(m)}return a}class mh{constructor(){this.first=!0}update(t,i){const a=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=a,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=a,!0):(this.lastFloorZoom>a?(this.lastIntegerZoom=a+1,this.lastIntegerZoomTime=i):this.lastFloorZoom<a&&(this.lastIntegerZoom=a,this.lastIntegerZoomTime=i),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=a,!0))}}const Dt={"Latin-1 Supplement":s=>s>=128&&s<=255,"Hangul Jamo":s=>s>=4352&&s<=4607,Khmer:s=>s>=6016&&s<=6143,"General Punctuation":s=>s>=8192&&s<=8303,"Letterlike Symbols":s=>s>=8448&&s<=8527,"Number Forms":s=>s>=8528&&s<=8591,"Miscellaneous Technical":s=>s>=8960&&s<=9215,"Control Pictures":s=>s>=9216&&s<=9279,"Optical Character Recognition":s=>s>=9280&&s<=9311,"Enclosed Alphanumerics":s=>s>=9312&&s<=9471,"Geometric Shapes":s=>s>=9632&&s<=9727,"Miscellaneous Symbols":s=>s>=9728&&s<=9983,"Miscellaneous Symbols and Arrows":s=>s>=11008&&s<=11263,"Ideographic Description Characters":s=>s>=12272&&s<=12287,"CJK Symbols and Punctuation":s=>s>=12288&&s<=12351,Katakana:s=>s>=12448&&s<=12543,Kanbun:s=>s>=12688&&s<=12703,"CJK Strokes":s=>s>=12736&&s<=12783,"Enclosed CJK Letters and Months":s=>s>=12800&&s<=13055,"CJK Compatibility":s=>s>=13056&&s<=13311,"Yijing Hexagram Symbols":s=>s>=19904&&s<=19967,"Private Use Area":s=>s>=57344&&s<=63743,"Vertical Forms":s=>s>=65040&&s<=65055,"CJK Compatibility Forms":s=>s>=65072&&s<=65103,"Small Form Variants":s=>s>=65104&&s<=65135,"Halfwidth and Fullwidth Forms":s=>s>=65280&&s<=65519};function ta(s){for(const t of s)if(Yo(t.charCodeAt(0)))return!0;return!1}function gh(s){for(const t of s)if(!yh(t.charCodeAt(0)))return!1;return!0}function Wo(s){const t=s.map(i=>{try{return new RegExp(`\\p{sc=${i}}`,"u").source}catch{return null}}).filter(i=>i);return new RegExp(t.join("|"),"u")}const _h=Wo(["Arab","Dupl","Mong","Ougr","Syrc"]);function yh(s){return!_h.test(String.fromCodePoint(s))}const Xo=Wo(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function Yo(s){return!(s!==746&&s!==747&&(s<4352||!(Dt["CJK Compatibility Forms"](s)&&!(s>=65097&&s<=65103)||Dt["CJK Compatibility"](s)||Dt["CJK Strokes"](s)||
25!(!Dt["CJK Symbols and Punctuation"](s)||s>=12296&&s<=12305||s>=12308&&s<=12319||s===12336)||Dt["Enclosed CJK Letters and Months"](s)||Dt["Ideographic Description Characters"](s)||Dt.Kanbun(s)||Dt.Katakana(s)&&s!==12540||!(!Dt["Halfwidth and Fullwidth Forms"](s)||s===65288||s===65289||s===65293||s>=65306&&s<=65310||s===65339||s===65341||s===65343||s>=65371&&s<=65503||s===65507||s>=65512&&s<=65519)||!(!Dt["Small Form Variants"](s)||s>=65112&&s<=65118||s>=65123&&s<=65126)||Dt["Vertical Forms"](s)||Dt["Yijing Hexagram Symbols"](s)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(s))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(s))||Xo.test(String.fromCodePoint(s)))))}function vh(s){return!(Yo(s)||function(t){return!!(Dt["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||Dt["General Punctuation"](t)&&(t===8214||t===8224||t===8225||t===8240||t===8241||t===8251||t===8252||t===8258||t===8263||t===8264||t===8265||t===8273)||Dt["Letterlike Symbols"](t)||Dt["Number Forms"](t)||Dt["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||t===9003||t>=9085&&t<=9114||t>=9150&&t<=9165||t===9167||t>=9169&&t<=9179||t>=9186&&t<=9215)||Dt["Control Pictures"](t)&&t!==9251||Dt["Optical Character Recognition"](t)||Dt["Enclosed Alphanumerics"](t)||Dt["Geometric Shapes"](t)||Dt["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Dt["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Dt["CJK Symbols and Punctuation"](t)||Dt.Katakana(t)||Dt["Private Use Area"](t)||Dt["CJK Compatibility Forms"](t)||Dt["Small Form Variants"](t)||Dt["Halfwidth and Fullwidth Forms"](t)||t===8734||t===8756||t===8757||t>=9984&&t<=10087||t>=10102&&t<=10131||t===65532||t===65533)}(s))}const xh=Wo(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function bh(s){return xh.test(String.fromCodePoint(s))}function wh(s,t){return!(!t&&bh(s)||s>=2304&&s<=3583||s>=3840&&s<=4255||Dt.Khmer(s))}function Th(s){for(const t of s)if(bh(t.charCodeAt(0)))return!0;return!1}const zs=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(s){this.pluginStatus=s.pluginStatus,this.pluginURL=s.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(s){if(zs.isParsed())throw new Error("RTL text plugin already registered.");this.applyArabicShaping=s.applyArabicShaping,this.processBidirectionalText=s.processBidirectionalText,this.processStyledBidirectionalText=s.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}syncState(s,t){return c(this,void 0,void 0,function*(){if(this.isParsed())return this.getState();if(s.pluginStatus!=="loading")return this.setState(s),s;const i=s.pluginURL,a=new Promise(m=>{this.loadScriptResolve=m});t(i);const h=new Promise(m=>setTimeout(()=>m(),this.TIMEOUT));if(yield Promise.race([a,h]),this.isParsed()){const m={pluginStatus:"loaded",pluginURL:i};return this.setState(m),m}throw this.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${i}`)})}};class dr{constructor(t,i){this.zoom=t,i?(this.now=i.now,this.fadeDuration=i.fadeDuration,this.zoomHistory=i.zoomHistory,this.transition=i.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new mh,this.transition={})}isSupportedScript(t){return function(i,a){for(const h of i)if(!wh(h.charCodeAt(0),a))return!1;return!0}(t,zs.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const t=this.zoom,i=t-Math.floor(t),a=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:i+(1-i)*a}:{fromScale:.5,toScale:1,t:1-(1-a)*i}}}class Ko{constructor(t,i){this.property=t,this.value=i,this.expression=function(a,h){
vendor: 5,831 bytes, line 25
25if(Lo(a))return new jo(a,h);if(Bo(a)){const m=eh(a,h);if(m.result==="error")throw new Error(m.value.map(g=>`${g.key}: ${g.message}`).join(", "));return m.value}{let m=a;return h.type==="color"&&typeof a=="string"?m=zt.parse(a):h.type!=="padding"||typeof a!="number"&&!Array.isArray(a)?h.type==="variableAnchorOffsetCollection"&&Array.isArray(a)?m=pi.parse(a):h.type==="projectionDefinition"&&typeof a=="string"&&(m=fi.parse(a)):m=qr.parse(a),{kind:"constant",evaluate:()=>m}}}(i===void 0?t.specification.default:i,t.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(t,i,a){return this.property.possiblyEvaluate(this,t,i,a)}}class Jo{constructor(t){this.property=t,this.value=new Ko(t,void 0)}transitioned(t,i){return new Pc(this.property,this.value,i,Ur({},t.transition,this.transition),t.now)}untransitioned(){return new Pc(this.property,this.value,null,{},0)}}class Mc{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}getValue(t){return hi(this._values[t].value.value)}setValue(t,i){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new Jo(this._values[t].property)),this._values[t].value=new Ko(this._values[t].property,i===null?void 0:hi(i))}getTransition(t){return hi(this._values[t].transition)}setTransition(t,i){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new Jo(this._values[t].property)),this._values[t].transition=hi(i)||void 0}serialize(){const t={};for(const i of Object.keys(this._values)){const a=this.getValue(i);a!==void 0&&(t[i]=a);const h=this.getTransition(i);h!==void 0&&(t[`${i}-transition`]=h)}return t}transitioned(t,i){const a=new Ic(this._properties);for(const h of Object.keys(this._values))a._values[h]=this._values[h].transitioned(t,i._values[h]);return a}untransitioned(){const t=new Ic(this._properties);for(const i of Object.keys(this._values))t._values[i]=this._values[i].untransitioned();return t}}class Pc{constructor(t,i,a,h,m){this.property=t,this.value=i,this.begin=m+h.delay||0,this.end=this.begin+h.duration||0,t.specification.transition&&(h.delay||h.duration)&&(this.prior=a)}possiblyEvaluate(t,i,a){const h=t.now||0,m=this.value.possiblyEvaluate(t,i,a),g=this.prior;if(g){if(h>this.end)return this.prior=null,m;if(this.value.isDataDriven())return this.prior=null,m;if(h<this.begin)return g.possiblyEvaluate(t,i,a);{const v=(h-this.begin)/(this.end-this.begin);return this.property.interpolate(g.possiblyEvaluate(t,i,a),m,Wi(v))}}return m}}class Ic{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,i,a){const h=new ra(this._properties);for(const m of Object.keys(this._values))h._values[m]=this._values[m].possiblyEvaluate(t,i,a);return h}hasTransition(){for(const t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}}class Qo{constructor(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)}hasValue(t){return this._values[t].value!==void 0}getValue(t){return hi(this._values[t].value)}setValue(t,i){this._values[t]=new Ko(this._values[t].property,i===null?void 0:hi(i))}serialize(){const t={};for(const i of Object.keys(this._values)){const a=this.getValue(i);a!==void 0&&(t[i]=a)}return t}possiblyEvaluate(t,i,a){const h=new ra(this._properties);for(const m of Object.keys(this._values))h._values[m]=this._values[m].possiblyEvaluate(t,i,a);return h}}class bs{constructor(t,i,a){this.property=t,this.value=i,this.parameters=a}isConstant(){return this.value.kind==="constant"}constantOr(t){return this.value.kind==="constant"?this.value.value:t}evaluate(t,i,a,h){return this.property.evaluate(this.value,this.parameters,t,i,a,h)}}class ra{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}}class ot{constructor(t){this.specification=t}possiblyEvaluate(t,i){if(t.isDataDriven())throw new Error("Value should not be data driven");return t.expression.evaluate(i)}interpolate(t,i,a){const h=cs[this.specification.type];return h?h(t,i,a):t}}class mt{constructor(t,i){this.specification=t,this.overrides=i}possiblyEvaluate(t,i,a,h){return new bs(this,t.expression.kind==="constant"||t.expression.kind==="camera"?{kind:"constant",value:t.expression.evaluate(i,null,{},a,h)}:t.expression,i)}interpolate(t,i,a){if(t.value.kind!=="constant"||i.value.kind!=="constant")return t;if(t.value.value===void 0||i.value.value===void 0)return new bs(this,{kind:"constant",value:void 0},t.parameters);const h=cs[this.specification.type];if(h){const m=h(t.value.value,i.value.value,a);return new bs(this,{kind:"constant",value:m},t.parameters)}return t}evaluate(t,i,a,h,m,g){return t.kind==="constant"?t.value:t.evaluate(i,a,h,m,g)}}class $a extends mt{possiblyEvaluate(t,i,a,h){if(t.value===void 0)return new bs(this,{kind:"constant",value:void 0},i);if(t.expression.kind==="constant"){const m=t.expression.evaluate(i,null,{},a,h),g=t.property.specification.type==="resolvedImage"&&typeof m!="string"?m.name:m,v=this._calculate(g,g,g,i);return new bs(this,{kind:"constant",value:v},i)}if(t.expression.kind==="camera"){const m=this._calculate(t.expression.evaluate({zoom:i.zoom-1}),t.expression.evaluate({zoom:i.zoom}),t.expression.evaluate({zoom:i.zoom+1}),i);return new bs(this,{kind:"constant",value:m},i)}return new bs(this,t.expression,i)}evaluate(t,i,a,h,m,g){if(t.kind==="source"){const v=t.evaluate(i,a,h,m,g);return this._calculate(v,v,v,i)}return t.kind==="composite"?this._calculate(t.evaluate({zoom:Math.floor(i.zoom)-1},a,h),t.evaluate({zoom:Math.floor(i.zoom)},a,h),t.evaluate({zoom:Math.floor(i.zoom)+1},a,h),i):t.value}_calculate(t,i,a,h){return h.zoom>h.zoomHistory.lastIntegerZoom?{from:t,to:i}:{from:a,to:i}}interpolate(t){return t}}
25class el{constructor(t){this.specification=t}possiblyEvaluate(t,i,a,h){if(t.value!==void 0){if(t.expression.kind==="constant"){const m=t.expression.evaluate(i,null,{},a,h);return this._calculate(m,m,m,i)}return this._calculate(t.expression.evaluate(new dr(Math.floor(i.zoom-1),i)),t.expression.evaluate(new dr(Math.floor(i.zoom),i)),t.expression.evaluate(new dr(Math.floor(i.zoom+1),i)),i)}}_calculate(t,i,a,h){return h.zoom>h.zoomHistory.lastIntegerZoom?{from:t,to:i}:{from:a,to:i}}interpolate(t){return t}}class tl{constructor(t){this.specification=t}possiblyEvaluate(t,i,a,h){return!!t.expression.evaluate(i,null,{},a,h)}interpolate(){return!1}}class Ci{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const i in t){const a=t[i];a.specification.overridable&&this.overridableProperties.push(i);const h=this.defaultPropertyValues[i]=new Ko(a,void 0),m=this.defaultTransitionablePropertyValues[i]=new Jo(a);this.defaultTransitioningPropertyValues[i]=m.untransitioned(),this.defaultPossiblyEvaluatedValues[i]=h.possiblyEvaluate({})}}}Qe("DataDrivenProperty",mt),Qe("DataConstantProperty",ot),Qe("CrossFadedDataDrivenProperty",$a),Qe("CrossFadedProperty",el),Qe("ColorRampProperty",tl);const Sh="-transition";class ws extends os{constructor(t,i){if(super(),this.id=t.id,this.type=t.type,this._featureFilter={filter:()=>!0,needGeometry:!1},t.type!=="custom"&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!=="background"&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),i.layout&&(this._unevaluatedLayout=new Qo(i.layout)),i.paint)){this._transitionablePaint=new Mc(i.paint);for(const a in t.paint)this.setPaintProperty(a,t.paint[a],{validate:!1});for(const a in t.layout)this.setLayoutProperty(a,t.layout[a],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ra(i.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){return t==="visibility"?this.visibility:this._unevaluatedLayout.getValue(t)}setLayoutProperty(t,i,a={}){i!=null&&this._validate(Sc,`layers.${this.id}.layout.${t}`,t,i,a)||(t!=="visibility"?this._unevaluatedLayout.setValue(t,i):this.visibility=i)}getPaintProperty(t){return t.endsWith(Sh)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,i,a={}){if(i!=null&&this._validate(hh,`layers.${this.id}.paint.${t}`,t,i,a))return!1;if(t.endsWith(Sh))return this._transitionablePaint.setTransition(t.slice(0,-11),i||void 0),!1;{const h=this._transitionablePaint._values[t],m=h.property.specification["property-type"]==="cross-faded-data-driven",g=h.value.isDataDriven(),v=h.value;this._transitionablePaint.setValue(t,i),this._handleSpecialPaintPropertyUpdate(t);const T=this._transitionablePaint._values[t].value;return T.isDataDriven()||g||m||this._handleOverridablePaintPropertyUpdate(t,v,T)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,i,a){return!1}isHidden(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||this.visibility==="none"}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,i){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,i)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,i)}
vendor: 14,000 bytes, line 25
25serialize(){const t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),ss(t,(i,a)=>!(i===void 0||a==="layout"&&!Object.keys(i).length||a==="paint"&&!Object.keys(i).length))}_validate(t,i,a,h,m={}){return(!m||m.validate!==!1)&&ph(this,t.call(ea,{key:i,layerType:this.type,objectKey:a,value:h,styleSpec:H,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const t in this.paint._values){const i=this.paint.get(t);if(i instanceof bs&&Hn(i.property.specification)&&(i.value.kind==="source"||i.value.kind==="composite")&&i.value.isStateDependent)return!0}return!1}}const td={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Ua{constructor(t,i){this._structArray=t,this._pos1=i*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class sr{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,i){return t._trim(),i&&(t.isTransferred=!0,i.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){const i=Object.create(this.prototype);return i.arrayBuffer=t.arrayBuffer,i.length=t.length,i.capacity=t.arrayBuffer.byteLength/i.bytesPerElement,i._refreshViews(),i}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const i=this.uint8;this._refreshViews(),i&&this.uint8.set(i)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Lr(s,t=1){let i=0,a=0;return{members:s.map(h=>{const m=td[h.type].BYTES_PER_ELEMENT,g=i=Mh(i,Math.max(t,m)),v=h.components||1;return a=Math.max(a,m),i+=m*v,{name:h.name,type:h.type,components:v,offset:g}}),size:Mh(i,Math.max(a,t)),alignment:t}}function Mh(s,t){return Math.ceil(s/t)*t}class Za extends sr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i){const a=this.length;return this.resize(a+1),this.emplace(a,t,i)}emplace(t,i,a){const h=2*t;return this.int16[h+0]=i,this.int16[h+1]=a,t}}Za.prototype.bytesPerElement=4,Qe("StructArrayLayout2i4",Za);class qa extends sr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a){const h=this.length;return this.resize(h+1),this.emplace(h,t,i,a)}emplace(t,i,a,h){const m=3*t;return this.int16[m+0]=i,this.int16[m+1]=a,this.int16[m+2]=h,t}}qa.prototype.bytesPerElement=6,Qe("StructArrayLayout3i6",qa);class Cc extends sr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,h){const m=this.length;return this.resize(m+1),this.emplace(m,t,i,a,h)}emplace(t,i,a,h,m){const g=4*t;return this.int16[g+0]=i,this.int16[g+1]=a,this.int16[g+2]=h,this.int16[g+3]=m,t}}Cc.prototype.bytesPerElement=8,Qe("StructArrayLayout4i8",Cc);class Ec extends sr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,h,m,g){const v=this.length;return this.resize(v+1),this.emplace(v,t,i,a,h,m,g)}emplace(t,i,a,h,m,g,v){const T=6*t;return this.int16[T+0]=i,this.int16[T+1]=a,this.int16[T+2]=h,this.int16[T+3]=m,this.int16[T+4]=g,this.int16[T+5]=v,t}}Ec.prototype.bytesPerElement=12,Qe("StructArrayLayout2i4i12",Ec);class Rs extends sr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,h,m,g){const v=this.length;return this.resize(v+1),this.emplace(v,t,i,a,h,m,g)}emplace(t,i,a,h,m,g,v){const T=4*t,P=8*t;return this.int16[T+0]=i,this.int16[T+1]=a,this.uint8[P+4]=h,this.uint8[P+5]=m,this.uint8[P+6]=g,this.uint8[P+7]=v,t}}Rs.prototype.bytesPerElement=8,Qe("StructArrayLayout2i4ub8",Rs);class ia extends sr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i){const a=this.length;return this.resize(a+1),this.emplace(a,t,i)}emplace(t,i,a){const h=2*t;return this.float32[h+0]=i,this.float32[h+1]=a,t}}ia.prototype.bytesPerElement=8,Qe("StructArrayLayout2f8",ia);class Ga extends sr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a,h,m,g,v,T,P,C){const E=this.length;return this.resize(E+1),this.emplace(E,t,i,a,h,m,g,v,T,P,C)}emplace(t,i,a,h,m,g,v,T,P,C,E){const z=10*t;return this.uint16[z+0]=i,this.uint16[z+1]=a,this.uint16[z+2]=h,this.uint16[z+3]=m,this.uint16[z+4]=g,this.uint16[z+5]=v,this.uint16[z+6]=T,this.uint16[z+7]=P,this.uint16[z+8]=C,this.uint16[z+9]=E,t}}Ga.prototype.bytesPerElement=20,Qe("StructArrayLayout10ui20",Ga);class rl extends sr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a,h,m,g,v,T,P,C,E,z){const L=this.length;return this.resize(L+1),this.emplace(L,t,i,a,h,m,g,v,T,P,C,E,z)}emplace(t,i,a,h,m,g,v,T,P,C,E,z,L){const F=12*t;return this.int16[F+0]=i,this.int16[F+1]=a,this.int16[F+2]=h,this.int16[F+3]=m,this.uint16[F+4]=g,this.uint16[F+5]=v,this.uint16[F+6]=T,this.uint16[F+7]=P,this.int16[F+8]=C,this.int16[F+9]=E,this.int16[F+10]=z,this.int16[F+11]=L,t}}rl.prototype.bytesPerElement=24,Qe("StructArrayLayout4i4ui4i24",rl);class Ha extends sr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a){const h=this.length;return this.resize(h+1),this.emplace(h,t,i,a)}emplace(t,i,a,h){const m=3*t;return this.float32[m+0]=i,this.float32[m+1]=a,this.float32[m+2]=h,t}}Ha.prototype.bytesPerElement=12,Qe("StructArrayLayout3f12",Ha);class Ac extends sr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){const i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){return this.uint32[1*t+0]=i,t}}Ac.prototype.bytesPerElement=4,Qe("StructArrayLayout1ul4",Ac);class sa extends sr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a,h,m,g,v,T,P){const C=this.length;return this.resize(C+1),this.emplace(C,t,i,a,h,m,g,v,T,P)}emplace(t,i,a,h,m,g,v,T,P,C){const E=10*t,z=5*t;return this.int16[E+0]=i,this.int16[E+1]=a,this.int16[E+2]=h,this.int16[E+3]=m,this.int16[E+4]=g,this.int16[E+5]=v,this.uint32[z+3]=T,this.uint16[E+8]=P,this.uint16[E+9]=C,t}}sa.prototype.bytesPerElement=20,Qe("StructArrayLayout6i1ul2ui20",sa);class Mn extends sr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,h,m,g){const v=this.length;return this.resize(v+1),this.emplace(v,t,i,a,h,m,g)}emplace(t,i,a,h,m,g,v){const T=6*t;return this.int16[T+0]=i,this.int16[T+1]=a,this.int16[T+2]=h,this.int16[T+3]=m,this.int16[T+4]=g,this.int16[T+5]=v,t}}Mn.prototype.bytesPerElement=12,Qe("StructArrayLayout2i2i2i12",Mn);class kc extends sr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,h,m){const g=this.length;return this.resize(g+1),this.emplace(g,t,i,a,h,m)}emplace(t,i,a,h,m,g){const v=4*t,T=8*t;return this.float32[v+0]=i,this.float32[v+1]=a,this.float32[v+2]=h,this.int16[T+6]=m,this.int16[T+7]=g,t}}kc.prototype.bytesPerElement=16,Qe("StructArrayLayout2f1f2i16",kc);class il extends sr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,h,m,g){const v=this.length;return this.resize(v+1),this.emplace(v,t,i,a,h,m,g)}emplace(t,i,a,h,m,g,v){const T=16*t,P=4*t,C=8*t;return this.uint8[T+0]=i,this.uint8[T+1]=a,this.float32[P+1]=h,this.float32[P+2]=m,this.int16[C+6]=g,this.int16[C+7]=v,t}}il.prototype.bytesPerElement=16,Qe("StructArrayLayout2ub2f2i16",il);class Ws extends sr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a){const h=this.length;return this.resize(h+1),this.emplace(h,t,i,a)}emplace(t,i,a,h){const m=3*t;return this.uint16[m+0]=i,this.uint16[m+1]=a,this.uint16[m+2]=h,t}}Ws.prototype.bytesPerElement=6,Qe("StructArrayLayout3ui6",Ws);class zc extends sr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,h,m,g,v,T,P,C,E,z,L,F,j,G,J){const pe=this.length;return this.resize(pe+1),this.emplace(pe,t,i,a,h,m,g,v,T,P,C,E,z,L,F,j,G,J)}emplace(t,i,a,h,m,g,v,T,P,C,E,z,L,F,j,G,J,pe){const re=24*t,D=12*t,Z=48*t;return this.int16[re+0]=i,this.int16[re+1]=a,this.uint16[re+2]=h,this.uint16[re+3]=m,this.uint32[D+2]=g,this.uint32[D+3]=v,this.uint32[D+4]=T,this.uint16[re+10]=P,this.uint16[re+11]=C,this.uint16[re+12]=E,this.float32[D+7]=z,this.float32[D+8]=L,this.uint8[Z+36]=F,this.uint8[Z+37]=j,this.uint8[Z+38]=G,this.uint32[D+10]=J,this.int16[re+22]=pe,t}}zc.prototype.bytesPerElement=48,Qe("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",zc);class Rc extends sr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,h,m,g,v,T,P,C,E,z,L,F,j,G,J,pe,re,D,Z,ie,xe,Fe,Te,Ce,je,Le){const Ne=this.length;return this.resize(Ne+1),this.emplace(Ne,t,i,a,h,m,g,v,T,P,C,E,z,L,F,j,G,J,pe,re,D,Z,ie,xe,Fe,Te,Ce,je,Le)}emplace(t,i,a,h,m,g,v,T,P,C,E,z,L,F,j,G,J,pe,re,D,Z,ie,xe,Fe,Te,Ce,je,Le,Ne){const ke=32*t,it=16*t;return this.int16[ke+0]=i,this.int16[ke+1]=a,this.int16[ke+2]=h,this.int16[ke+3]=m,this.int16[ke+4]=g,this.int16[ke+5]=v,this.int16[ke+6]=T,this.int16[ke+7]=P,this.uint16[ke+8]=C,this.uint16[ke+9]=E,this.uint16[ke+10]=z,this.uint16[ke+11]=L,this.uint16[ke+12]=F,this.uint16[ke+13]=j,this.uint16[ke+14]=G,this.uint16[ke+15]=J,this.uint16[ke+16]=pe,this.uint16[ke+17]=re,this.uint16[ke+18]=D,this.uint16[ke+19]=Z,this.uint16[ke+20]=ie,this.uint16[ke+21]=xe,this.uint16[ke+22]=Fe,this.uint32[it+12]=Te,this.float32[it+13]=Ce,this.float32[it+14]=je,this.uint16[ke+30]=Le,this.uint16[ke+31]=Ne,t}}Rc.prototype.bytesPerElement=64,Qe("StructArrayLayout8i15ui1ul2f2ui64",Rc);class Wa extends sr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){const i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){return this.float32[1*t+0]=i,t}}Wa.prototype.bytesPerElement=4,Qe("StructArrayLayout1f4",Wa);class Dc extends sr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a){const h=this.length;return this.resize(h+1),this.emplace(h,t,i,a)}emplace(t,i,a,h){const m=3*t;return this.uint16[6*t+0]=i,this.float32[m+1]=a,this.float32[m+2]=h,t}}Dc.prototype.bytesPerElement=12,Qe("StructArrayLayout1ui2f12",Dc);class d extends sr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a){const h=this.length;return this.resize(h+1),this.emplace(h,t,i,a)}emplace(t,i,a,h){const m=4*t;return this.uint32[2*t+0]=i,this.uint16[m+2]=a,this.uint16[m+3]=h,t}}d.prototype.bytesPerElement=8,Qe("StructArrayLayout1ul2ui8",d);class e extends sr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i){const a=this.length;return this.resize(a+1),this.emplace(a,t,i)}emplace(t,i,a){const h=2*t;return this.uint16[h+0]=i,this.uint16[h+1]=a,t}}e.prototype.bytesPerElement=4,Qe("StructArrayLayout2ui4",e);class r extends sr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){const i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){return this.uint16[1*t+0]=i,t}}r.prototype.bytesPerElement=2,Qe("StructArrayLayout1ui2",r);class o extends sr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,h){const m=this.length;return this.resize(m+1),this.emplace(m,t,i,a,h)}emplace(t,i,a,h,m){const g=4*t;return this.float32[g+0]=i,this.float32[g+1]=a,this.float32[g+2]=h,this.float32[g+3]=m,t}}o.prototype.bytesPerElement=16,Qe("StructArrayLayout4f16",o);class u extends Ua{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}
vendor: 4,734 bytes, line 25
25get anchorPoint(){return new Se(this.anchorPointX,this.anchorPointY)}}u.prototype.size=20;class f extends sa{get(t){return new u(this,t)}}Qe("CollisionBoxArray",f);class y extends Ua{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}y.prototype.size=48;class w extends zc{get(t){return new y(this,t)}}Qe("PlacedSymbolArray",w);class S extends Ua{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(t){this._structArray.uint32[this._pos4+12]=t}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}S.prototype.size=64;class I extends Rc{get(t){return new S(this,t)}}Qe("SymbolInstanceArray",I);class A extends Wa{getoffsetX(t){return this.float32[1*t+0]}}Qe("GlyphOffsetArray",A);class k extends qa{getx(t){return this.int16[3*t+0]}gety(t){return this.int16[3*t+1]}gettileUnitDistanceFromAnchor(t){return this.int16[3*t+2]}}Qe("SymbolLineVertexArray",k);class R extends Ua{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}R.prototype.size=12;class O extends Dc{get(t){return new R(this,t)}}Qe("TextAnchorOffsetArray",O);class V extends Ua{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]}}V.prototype.size=8;class X extends d{get(t){return new V(this,t)}}Qe("FeatureIndexArray",X);class W extends Za{}class K extends Za{}class ee extends Za{}
vendor: 4,557 bytes, line 25
25class se extends Ec{}class oe extends Rs{}class le extends ia{}class he extends Ga{}class ue extends rl{}class ve extends Ha{}class be extends Ac{}class Ae extends Mn{}class Re extends il{}class Ie extends Ws{}class Ge extends e{}const Ue=Lr([{name:"a_pos",components:2,type:"Int16"}],4),{members:De}=Ue;class Xe{constructor(t=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=t}prepareSegment(t,i,a,h){const m=this.segments[this.segments.length-1];return t>Xe.MAX_VERTEX_ARRAY_LENGTH&&ri(`Max vertices per segment is ${Xe.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${Xe.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!m||m.vertexLength+t>Xe.MAX_VERTEX_ARRAY_LENGTH||m.sortKey!==h?this.createNewSegment(i,a,h):m}createNewSegment(t,i,a){const h={vertexOffset:t.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0,vaos:{}};return a!==void 0&&(h.sortKey=a),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(h),h}getOrCreateLatestSegment(t,i,a){return this.prepareSegment(0,t,i,a)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(const t of this.segments)for(const i in t.vaos)t.vaos[i].destroy()}static simpleSegment(t,i,a,h){return new Xe([{vertexOffset:t,primitiveOffset:i,vertexLength:a,primitiveLength:h,vaos:{},sortKey:0}])}}function Tt(s,t){return 256*(s=Pi(Math.floor(s),0,255))+Pi(Math.floor(t),0,255)}Xe.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Qe("SegmentVector",Xe);const Zt=Lr([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var fr,Qt,mr,er={exports:{}},Kt={exports:{}},tr={exports:{}},ni=function(){if(mr)return er.exports;mr=1;var s=(fr||(fr=1,Kt.exports=function(i,a){var h,m,g,v,T,P,C,E;for(m=i.length-(h=3&i.length),g=a,T=3432918353,P=461845907,E=0;E<m;)C=255&i.charCodeAt(E)|(255&i.charCodeAt(++E))<<8|(255&i.charCodeAt(++E))<<16|(255&i.charCodeAt(++E))<<24,++E,g=27492+(65535&(v=5*(65535&(g=(g^=C=(65535&(C=(C=(65535&C)*T+(((C>>>16)*T&65535)<<16)&4294967295)<<15|C>>>17))*P+(((C>>>16)*P&65535)<<16)&4294967295)<<13|g>>>19))+((5*(g>>>16)&65535)<<16)&4294967295))+((58964+(v>>>16)&65535)<<16);switch(C=0,h){case 3:C^=(255&i.charCodeAt(E+2))<<16;case 2:C^=(255&i.charCodeAt(E+1))<<8;case 1:g^=C=(65535&(C=(C=(65535&(C^=255&i.charCodeAt(E)))*T+(((C>>>16)*T&65535)<<16)&4294967295)<<15|C>>>17))*P+(((C>>>16)*P&65535)<<16)&4294967295}return g^=i.length,g=2246822507*(65535&(g^=g>>>16))+((2246822507*(g>>>16)&65535)<<16)&4294967295,g=3266489909*(65535&(g^=g>>>13))+((3266489909*(g>>>16)&65535)<<16)&4294967295,(g^=g>>>16)>>>0}),Kt.exports),t=(Qt||(Qt=1,tr.exports=function(i,a){for(var h,m=i.length,g=a^m,v=0;m>=4;)h=1540483477*(65535&(h=255&i.charCodeAt(v)|(255&i.charCodeAt(++v))<<8|(255&i.charCodeAt(++v))<<16|(255&i.charCodeAt(++v))<<24))+((1540483477*(h>>>16)&65535)<<16),g=1540483477*(65535&g)+((1540483477*(g>>>16)&65535)<<16)^(h=1540483477*(65535&(h^=h>>>24))+((1540483477*(h>>>16)&65535)<<16)),m-=4,++v;switch(m){case 3:g^=(255&i.charCodeAt(v+2))<<16;case 2:g^=(255&i.charCodeAt(v+1))<<8;case 1:g=1540483477*(65535&(g^=255&i.charCodeAt(v)))+((1540483477*(g>>>16)&65535)<<16)}return g=1540483477*(65535&(g^=g>>>13))+((1540483477*(g>>>16)&65535)<<16),(g^=g>>>15)>>>0}),tr.exports);return er.exports=s,er.exports.murmur3=s,er.exports.murmur2=t,er.exports}(),Fr=B(ni);class jr{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,i,a,h){this.ids.push(mi(t)),this.positions.push(i,a,h)}getPositions(t){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const i=mi(t);let a=0,h=this.ids.length-1;for(;a<h;){const g=a+h>>1;this.ids[g]>=i?h=g:a=g+1}const m=[];for(;this.ids[a]===i;)m.push({index:this.positions[3*a],start:this.positions[3*a+1],end:this.positions[3*a+2]}),a++;return m}static serialize(t,i){const a=new Float64Array(t.ids),h=new Uint32Array(t.positions);return Ds(a,h,0,a.length-1),i&&i.push(a.buffer,h.buffer),{ids:a,positions:h}}static deserialize(t){const i=new jr;return i.ids=t.ids,i.positions=t.positions,i.indexed=!0,i}}function mi(s){const t=+s;return!isNaN(t)&&t<=Number.MAX_SAFE_INTEGER?t:Fr(String(s))}function Ds(s,t,i,a){for(;i<a;){const h=s[i+a>>1];let m=i-1,g=a+1;for(;;){do m++;while(s[m]<h);do g--;while(s[g]>h);if(m>=g)break;Ts(s,m,g),Ts(t,3*m,3*g),Ts(t,3*m+1,3*g+1),Ts(t,3*m+2,3*g+2)}
25g-i<a-g?(Ds(s,t,i,g),i=g+1):(Ds(s,t,g+1,a),a=g)}}function Ts(s,t,i){const a=s[t];s[t]=s[i],s[i]=a}Qe("FeaturePositionMap",jr);class Oi{constructor(t,i){this.gl=t.gl,this.location=i}}class Ls extends Oi{constructor(t,i){super(t,i),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))}}class Xa extends Oi{constructor(t,i){super(t,i),this.current=[0,0,0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))}}class Ya extends Oi{constructor(t,i){super(t,i),this.current=zt.transparent}set(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))}}const na=new Float32Array(16);function Ei(s){return[Tt(255*s.r,255*s.g),Tt(255*s.b,255*s.a)]}class es{constructor(t,i,a){this.value=t,this.uniformNames=i.map(h=>`u_${h}`),this.type=a}setUniform(t,i,a){t.set(a.constantOr(this.value))}getBinding(t,i,a){return this.type==="color"?new Ya(t,i):new Ls(t,i)}}class ts{constructor(t,i){this.uniformNames=i.map(a=>`u_${a}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,i){this.pixelRatioFrom=i.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=i.tlbr,this.patternTo=t.tlbr}setUniform(t,i,a,h){const m=h==="u_pattern_to"?this.patternTo:h==="u_pattern_from"?this.patternFrom:h==="u_pixel_ratio_to"?this.pixelRatioTo:h==="u_pixel_ratio_from"?this.pixelRatioFrom:null;m&&t.set(m)}getBinding(t,i,a){return a.substr(0,9)==="u_pattern"?new Xa(t,i):new Ls(t,i)}}class Ni{constructor(t,i,a,h){this.expression=t,this.type=a,this.maxValue=0,this.paintVertexAttributes=i.map(m=>({name:`a_${m}`,type:"Float32",components:a==="color"?2:1,offset:0})),this.paintVertexArray=new h}populatePaintArray(t,i,a,h,m){const g=this.paintVertexArray.length,v=this.expression.evaluate(new dr(0),i,{},h,[],m);this.paintVertexArray.resize(t),this._setPaintValue(g,t,v)}updatePaintArray(t,i,a,h){const m=this.expression.evaluate({zoom:0},a,h);this._setPaintValue(t,i,m)}_setPaintValue(t,i,a){if(this.type==="color"){const h=Ei(a);for(let m=t;m<i;m++)this.paintVertexArray.emplace(m,h[0],h[1])}else{for(let h=t;h<i;h++)this.paintVertexArray.emplace(h,a);this.maxValue=Math.max(this.maxValue,Math.abs(a))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class rr{constructor(t,i,a,h,m,g){this.expression=t,this.uniformNames=i.map(v=>`u_${v}_t`),this.type=a,this.useIntegerZoom=h,this.zoom=m,this.maxValue=0,this.paintVertexAttributes=i.map(v=>({name:`a_${v}`,type:"Float32",components:a==="color"?4:2,offset:0})),this.paintVertexArray=new g}populatePaintArray(t,i,a,h,m){const g=this.expression.evaluate(new dr(this.zoom),i,{},h,[],m),v=this.expression.evaluate(new dr(this.zoom+1),i,{},h,[],m),T=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(T,t,g,v)}updatePaintArray(t,i,a,h){const m=this.expression.evaluate({zoom:this.zoom},a,h),g=this.expression.evaluate({zoom:this.zoom+1},a,h);this._setPaintValue(t,i,m,g)}_setPaintValue(t,i,a,h){if(this.type==="color"){const m=Ei(a),g=Ei(h);for(let v=t;v<i;v++)this.paintVertexArray.emplace(v,m[0],m[1],g[0],g[1])}else{for(let m=t;m<i;m++)this.paintVertexArray.emplace(m,a,h);this.maxValue=Math.max(this.maxValue,Math.abs(a),Math.abs(h))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(t,i){const a=this.useIntegerZoom?Math.floor(i.zoom):i.zoom,h=Pi(this.expression.interpolationFactor(a,this.zoom,this.zoom+1),0,1);t.set(h)}getBinding(t,i,a){return new Ls(t,i)}}class gr{constructor(t,i,a,h,m,g){this.expression=t,this.type=i,this.useIntegerZoom=a,this.zoom=h,this.layerId=g,this.zoomInPaintVertexArray=new m,this.zoomOutPaintVertexArray=new m}populatePaintArray(t,i,a){const h=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(h,t,i.patterns&&i.patterns[this.layerId],a)}updatePaintArray(t,i,a,h,m){this._setPaintValues(t,i,a.patterns&&a.patterns[this.layerId],m)}
vendor: 5,343 bytes, line 25
25_setPaintValues(t,i,a,h){if(!h||!a)return;const{min:m,mid:g,max:v}=a,T=h[m],P=h[g],C=h[v];if(T&&P&&C)for(let E=t;E<i;E++)this.zoomInPaintVertexArray.emplace(E,P.tl[0],P.tl[1],P.br[0],P.br[1],T.tl[0],T.tl[1],T.br[0],T.br[1],P.pixelRatio,T.pixelRatio),this.zoomOutPaintVertexArray.emplace(E,P.tl[0],P.tl[1],P.br[0],P.br[1],C.tl[0],C.tl[1],C.br[0],C.br[1],P.pixelRatio,C.pixelRatio)}upload(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,Zt.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,Zt.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class ji{constructor(t,i,a){this.binders={},this._buffers=[];const h=[];for(const m in t.paint._values){if(!a(m))continue;const g=t.paint.get(m);if(!(g instanceof bs&&Hn(g.property.specification)))continue;const v=rd(m,t.type),T=g.value,P=g.property.specification.type,C=g.property.useIntegerZoom,E=g.property.specification["property-type"],z=E==="cross-faded"||E==="cross-faded-data-driven";if(T.kind==="constant")this.binders[m]=z?new ts(T.value,v):new es(T.value,v,P),h.push(`/u_${m}`);else if(T.kind==="source"||z){const L=Ph(m,P,"source");this.binders[m]=z?new gr(T,P,C,i,L,t.id):new Ni(T,v,P,L),h.push(`/a_${m}`)}else{const L=Ph(m,P,"composite");this.binders[m]=new rr(T,v,P,C,i,L),h.push(`/z_${m}`)}}this.cacheKey=h.sort().join("")}getMaxValue(t){const i=this.binders[t];return i instanceof Ni||i instanceof rr?i.maxValue:0}populatePaintArrays(t,i,a,h,m){for(const g in this.binders){const v=this.binders[g];(v instanceof Ni||v instanceof rr||v instanceof gr)&&v.populatePaintArray(t,i,a,h,m)}}setConstantPatternPositions(t,i){for(const a in this.binders){const h=this.binders[a];h instanceof ts&&h.setConstantPatternPositions(t,i)}}updatePaintArrays(t,i,a,h,m){let g=!1;for(const v in t){const T=i.getPositions(v);for(const P of T){const C=a.feature(P.index);for(const E in this.binders){const z=this.binders[E];if((z instanceof Ni||z instanceof rr||z instanceof gr)&&z.expression.isStateDependent===!0){const L=h.paint.get(E);z.expression=L.value,z.updatePaintArray(P.start,P.end,C,t[v],m),g=!0}}}}return g}defines(){const t=[];for(const i in this.binders){const a=this.binders[i];(a instanceof es||a instanceof ts)&&t.push(...a.uniformNames.map(h=>`#define HAS_UNIFORM_${h}`))}return t}getBinderAttributes(){const t=[];for(const i in this.binders){const a=this.binders[i];if(a instanceof Ni||a instanceof rr)for(let h=0;h<a.paintVertexAttributes.length;h++)t.push(a.paintVertexAttributes[h].name);else if(a instanceof gr)for(let h=0;h<Zt.members.length;h++)t.push(Zt.members[h].name)}return t}getBinderUniforms(){const t=[];for(const i in this.binders){const a=this.binders[i];if(a instanceof es||a instanceof ts||a instanceof rr)for(const h of a.uniformNames)t.push(h)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,i){const a=[];for(const h in this.binders){const m=this.binders[h];if(m instanceof es||m instanceof ts||m instanceof rr){for(const g of m.uniformNames)if(i[g]){const v=m.getBinding(t,i[g],g);a.push({name:g,property:h,binding:v})}}}return a}setUniforms(t,i,a,h){for(const{name:m,property:g,binding:v}of i)this.binders[g].setUniform(v,h,a.get(g),m)}updatePaintBuffers(t){this._buffers=[];for(const i in this.binders){const a=this.binders[i];if(t&&a instanceof gr){const h=t.fromScale===2?a.zoomInPaintVertexBuffer:a.zoomOutPaintVertexBuffer;h&&this._buffers.push(h)}else(a instanceof Ni||a instanceof rr)&&a.paintVertexBuffer&&this._buffers.push(a.paintVertexBuffer)}}upload(t){for(const i in this.binders){const a=this.binders[i];(a instanceof Ni||a instanceof rr||a instanceof gr)&&a.upload(t)}this.updatePaintBuffers()}destroy(){for(const t in this.binders){const i=this.binders[t];(i instanceof Ni||i instanceof rr||i instanceof gr)&&i.destroy()}}}class yr{constructor(t,i,a=()=>!0){this.programConfigurations={};for(const h of t)this.programConfigurations[h.id]=new ji(h,i,a);this.needsUpload=!1,this._featureMap=new jr,this._bufferOffset=0}populatePaintArrays(t,i,a,h,m,g){for(const v in this.programConfigurations)this.programConfigurations[v].populatePaintArrays(t,i,h,m,g);i.id!==void 0&&this._featureMap.add(i.id,a,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,i,a,h){for(const m of a)this.needsUpload=this.programConfigurations[m.id].updatePaintArrays(t,this._featureMap,i,m,h)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const i in this.programConfigurations)this.programConfigurations[i].upload(t);this.needsUpload=!1}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy()}}function rd(s,t){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["ga
25pwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[s]||[s.replace(`${t}-`,"").replace(/-/g,"_")]}function Ph(s,t,i){const a={color:{source:ia,composite:o},number:{source:Wa,composite:ia}},h=function(m){return{"line-pattern":{source:he,composite:he},"fill-pattern":{source:he,composite:he},"fill-extrusion-pattern":{source:he,composite:he}}[m]}(s);return h&&h[i]||a[t][i]}Qe("ConstantBinder",es),Qe("CrossFadedConstantBinder",ts),Qe("SourceExpressionBinder",Ni),Qe("CrossFadedCompositeBinder",gr),Qe("CompositeExpressionBinder",rr),Qe("ProgramConfiguration",ji,{omit:["_buffers"]}),Qe("ProgramConfigurationSet",yr);const Lc=Math.pow(2,14)-1,Ih=-Lc-1;function Pn(s){const t=_t/s.extent,i=s.loadGeometry();for(let a=0;a<i.length;a++){const h=i[a];for(let m=0;m<h.length;m++){const g=h[m],v=Math.round(g.x*t),T=Math.round(g.y*t);g.x=Pi(v,Ih,Lc),g.y=Pi(T,Ih,Lc),(v<g.x||v>g.x+1||T<g.y||T>g.y+1)&&ri("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return i}function In(s,t){return{type:s.type,id:s.id,properties:s.properties,geometry:t?Pn(s):[]}}const Xs=-32768;function Ch(s,t,i,a,h){s.emplaceBack(Xs+8*t+a,Xs+8*i+h)}class sl{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(i=>i.id),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new K,this.indexArray=new Ie,this.segments=new Xe,this.programConfigurations=new yr(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(t,i,a){const h=this.layers[0],m=[];let g=null,v=!1,T=h.type==="heatmap";if(h.type==="circle"){const C=h;g=C.layout.get("circle-sort-key"),v=!g.isConstant(),T=T||C.paint.get("circle-pitch-alignment")==="map"}const P=T?i.subdivisionGranularity.circle:1;for(const{feature:C,id:E,index:z,sourceLayerIndex:L}of t){const F=this.layers[0]._featureFilter.needGeometry,j=In(C,F);if(!this.layers[0]._featureFilter.filter(new dr(this.zoom),j,a))continue;const G=v?g.evaluate(j,{},a):void 0,J={id:E,properties:C.properties,type:C.type,sourceLayerIndex:L,index:z,geometry:F?j.geometry:Pn(C),patterns:{},sortKey:G};m.push(J)}v&&m.sort((C,E)=>C.sortKey-E.sortKey);for(const C of m){const{geometry:E,index:z,sourceLayerIndex:L}=C,F=t[z].feature;this.addFeature(C,E,z,a,P),i.featureIndex.insert(F,E,z,L,this.index)}}update(t,i,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,i,this.stateDependentLayers,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,De),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,i,a,h,m=1){let g;switch(m){case 1:g=[0,7];break;case 3:g=[0,2,5,7];break;case 5:g=[0,1,3,4,6,7];break;case 7:g=[0,1,2,3,4,5,6,7];break;default:throw new Error(`Invalid circle bucket granularity: ${m}; valid values are 1, 3, 5, 7.`)}const v=g.length;for(const T of i)for(const P of T){const C=P.x,E=P.y;if(C<0||C>=_t||E<0||E>=_t)continue;const z=this.segments.prepareSegment(v*v,this.layoutVertexArray,this.indexArray,t.sortKey),L=z.vertexLength;for(let F=0;F<v;F++)for(let j=0;j<v;j++)Ch(this.layoutVertexArray,C,E,g[j],g[F]);for(let F=0;F<v-1;F++)for(let j=0;j<v-1;j++){const G=L+F*v+j,J=L+(F+1)*v+j;this.indexArray.emplaceBack(G,J+1,G+1),this.indexArray.emplaceBack(G,J,J+1)}z.vertexLength+=v*v,z.primitiveLength+=(v-1)*(v-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,{},h)}}function Fc(s,t){for(let i=0;i<s.length;i++)if(nl(t,s[i]))return!0;for(let i=0;i<t.length;i++)if(nl(s,t[i]))return!0;return!!id(s,t)}function Bc(s,t,i){return!!nl(s,t)||!!sd(t,s,i)}function Oc(s,t){if(s.length===1)return Mm(t,s[0]);for(let i=0;i<t.length;i++){const a=t[i];for(let h=0;h<a.length;h++)if(nl(s,a[h]))return!0}for(let i=0;i<s.length;i++)if(Mm(t,s[i]))return!0;for(let i=0;i<t.length;i++)if(id(s,t[i]))return!0;return!1}function Nc(s,t,i){if(s.length>1){if(id(s,t))return!0;for(let a=0;a<t.length;a++)if(sd(t[a],s,i))return!0}for(let a=0;a<s.length;a++)if(sd(s[a],t,i))return!0;return!1}function id(s,t){if(s.length===0||t.length===0)return!1;for(let i=0;i<s.length-1;i++){const a=s[i],h=s[i+1];for(let m=0;m<t.length-1;
25m++)if($v(a,h,t[m],t[m+1]))return!0}return!1}function $v(s,t,i,a){return ae(s,i,a)!==ae(t,i,a)&&ae(s,t,i)!==ae(s,t,a)}function sd(s,t,i){const a=i*i;if(t.length===1)return s.distSqr(t[0])<a;for(let h=1;h<t.length;h++)if(Sm(s,t[h-1],t[h])<a)return!0;return!1}function Sm(s,t,i){const a=t.distSqr(i);if(a===0)return s.distSqr(t);const h=((s.x-t.x)*(i.x-t.x)+(s.y-t.y)*(i.y-t.y))/a;return s.distSqr(h<0?t:h>1?i:i.sub(t)._mult(h)._add(t))}function Mm(s,t){let i,a,h,m=!1;for(let g=0;g<s.length;g++){i=s[g];for(let v=0,T=i.length-1;v<i.length;T=v++)a=i[v],h=i[T],a.y>t.y!=h.y>t.y&&t.x<(h.x-a.x)*(t.y-a.y)/(h.y-a.y)+a.x&&(m=!m)}return m}function nl(s,t){let i=!1;for(let a=0,h=s.length-1;a<s.length;h=a++){const m=s[a],g=s[h];m.y>t.y!=g.y>t.y&&t.x<(g.x-m.x)*(t.y-m.y)/(g.y-m.y)+m.x&&(i=!i)}return i}function Uv(s,t,i){const a=i[0],h=i[2];if(s.x<a.x&&t.x<a.x||s.x>h.x&&t.x>h.x||s.y<a.y&&t.y<a.y||s.y>h.y&&t.y>h.y)return!1;const m=ae(s,t,i[0]);return m!==ae(s,t,i[1])||m!==ae(s,t,i[2])||m!==ae(s,t,i[3])}function jc(s,t,i){const a=t.paint.get(s).value;return a.kind==="constant"?a.value:i.programConfigurations.get(t.id).getMaxValue(s)}function Eh(s){return Math.sqrt(s[0]*s[0]+s[1]*s[1])}function Ah(s,t,i,a,h){if(!t[0]&&!t[1])return s;const m=Se.convert(t)._mult(h);i==="viewport"&&m._rotate(-a);const g=[];for(let v=0;v<s.length;v++)g.push(s[v].sub(m));return g}let Pm,Im;Qe("CircleBucket",sl,{omit:["layers"]});var Zv={get paint(){return Im=Im||new Ci({"circle-radius":new mt(H.paint_circle["circle-radius"]),"circle-color":new mt(H.paint_circle["circle-color"]),"circle-blur":new mt(H.paint_circle["circle-blur"]),"circle-opacity":new mt(H.paint_circle["circle-opacity"]),"circle-translate":new ot(H.paint_circle["circle-translate"]),"circle-translate-anchor":new ot(H.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new ot(H.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new ot(H.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new mt(H.paint_circle["circle-stroke-width"]),"circle-stroke-color":new mt(H.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new mt(H.paint_circle["circle-stroke-opacity"])})},get layout(){return Pm=Pm||new Ci({"circle-sort-key":new mt(H.layout_circle["circle-sort-key"])})}};class qv extends ws{constructor(t){super(t,Zv)}createBucket(t){return new sl(t)}queryRadius(t){const i=t;return jc("circle-radius",this,i)+jc("circle-stroke-width",this,i)+Eh(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:t,feature:i,featureState:a,geometry:h,transform:m,pixelsToTileUnits:g,pixelPosMatrix:v}){const T=Ah(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-m.bearingInRadians,g),P=this.paint.get("circle-radius").evaluate(i,a)+this.paint.get("circle-stroke-width").evaluate(i,a),C=this.paint.get("circle-pitch-alignment")==="map",E=C?T:function(L,F){return L.map(j=>Cm(j,F))}(T,v),z=C?P*g:P;for(const L of h)for(const F of L){const j=C?F:Cm(F,v);let G=z;const J=Or([],[F.x,F.y,0,1],v);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?G*=J[3]/m.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(G*=m.cameraToCenterDistance/J[3]),Bc(E,j,G))return!0}return!1}}function Cm(s,t){const i=Or([],[s.x,s.y,0,1],t);return new Se(i[0]/i[3],i[1]/i[3])}class Em extends sl{}let Am;Qe("HeatmapBucket",Em,{omit:["layers"]});var Gv={get paint(){return Am=Am||new Ci({"heatmap-radius":new mt(H.paint_heatmap["heatmap-radius"]),"heatmap-weight":new mt(H.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new ot(H.paint_heatmap["heatmap-intensity"]),"heatmap-color":new tl(H.paint_heatmap["heatmap-color"]),"heatmap-opacity":new ot(H.paint_heatmap["heatmap-opacity"])})}};function nd(s,{width:t,height:i},a,h){if(h){if(h instanceof Uint8ClampedArray)h=new Uint8Array(h.buffer);else if(h.length!==t*i*a)throw new RangeError(`mismatched image size. expected: ${h.length} but got: ${t*i*a}`)}else h=new Uint8Array(t*i*a);return s.width=t,s.height=i,s.data=h,s}function km(s,{width:t,height:i},a){if(t===s.width&&i===s.height)return;const h=nd({},{width:t,height:i},a);ad(s,h,{x:0,y:0},{x:0,y:0},{width:Math.min(s.width,t),height:Math.min(s.height,i)},a),s.width=t,s.height=i,s.data=h.data}function ad(s,t,i,a,h,m){if(h.width===0||h.height===0)return t;if(h.width>s.width||h.height>s.height||i.x>s.width-h.width||i.y>s.height-h.height)throw new RangeError("out of range source coordinates for image copy");if(h.width>t.width||h.height>t.height||a.x>t.width-h.width||a.y>t.height-h.height)throw new RangeError("out of range destination coordinates for image copy");const g=s.data,v=t.data;if(g===v)throw new Error("srcData equals dstData, so image is already copied");for(let T=0;T<h.height;T++){const P=((i.y+T)*s.width+i.x)*m,C=((a.y+T)*t.width+a.x)*m;for(let E=0;E<h.width*m;E++)v[C+E]=g[P+E]}return t}class Vc{constructor(t,i){nd(this,t,1,i)}resize(t){km(this,t,1)}clone(){return new Vc({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,i,a,h,m){ad(t,i,a,h,m,1)}}class hs{constructor(t,i){nd(this,t,4,i)}resize(t){km(this,t,4)}replace(t,i){i?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t}clone(){return new hs({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,i,a,h,m){ad(t,i,a,h,m,4)}}function zm(s){const t={},i=s.resolution||256,a=s.clips?s.clips.length:1,h=s.image||new hs({width:i,height:a});if(Math.log(i)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${i}`);const m=(g,v,T)=>{t[s.evaluationKey]=T;const P=s.expression.evaluate(t);h.data[g+v+0]=Math.floor(255*P.r/P.a),h.data[g+v+1]=Math.floor(255*P.g/P.a),h.data[g+v+2]=Math.floor(255*P.b/P.a),h.data[g+v+3]=Math.floor(255*P.a)};if(s.clips)for(let g=0,v=0;g<a;++g,v+=4*i)for(let T=0,P=0;T<i;T++,P+=4){const C=T/(i-1),{start:E,end:z}=s.clips[g];m(v,P,E*(1-C)+z*C)}else for(let g=0,v=0;g<i;g++,v+=4)m(0,v,g/(i-1));return h}Qe("AlphaImage",Vc),Qe("RGBAImage",hs);const od="big-fb";class Hv extends ws{createBucket(t){return new Em(t)}constructor(t){super(t,Gv),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){t==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=zm({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(od)&&this.heatmapFbos.delete(od)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}}let Rm;var Wv={get paint(){return Rm=Rm||new Ci({"hillshade-illumination-direction":new ot(H.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new ot(H.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new ot(H.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new ot(H.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new ot(H.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new ot(H.paint_hillshade["hillshade-accent-color"])})}};class Xv extends ws{constructor(t){super(t,Wv)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}}const Yv=Lr([{name:"a_pos",components:2,type:"Int16"}],4),{members:Kv}=Yv;function ld(s,t,i){const a=i.patternDependencies;let h=!1;for(const m of t){const g=m.paint.get(`${s}-pattern`);g.isConstant()||(h=!0);const v=g.constantOr(null);v&&(h=!0,a[v.to]=!0,a[v.from]=!0)}return h}function cd(s,t,i,a,h){const m=h.patternDependencies;for(const g of t){const v=g.paint.get(`${s}-pattern`).value;if(v.kind!=="constant"){let T=v.evaluate({zoom:a-1}
vendor: 11,979 bytes, line 25
25,i,{},h.availableImages),P=v.evaluate({zoom:a},i,{},h.availableImages),C=v.evaluate({zoom:a+1},i,{},h.availableImages);T=T&&T.name?T.name:T,P=P&&P.name?P.name:P,C=C&&C.name?C.name:C,m[T]=!0,m[P]=!0,m[C]=!0,i.patterns[g.id]={min:T,mid:P,max:C}}}return i}function Dm(s,t,i,a,h){let m;if(h===function(g,v,T,P){let C=0;for(let E=v,z=T-P;E<T;E+=P)C+=(g[z]-g[E])*(g[E+1]+g[z+1]),z=E;return C}(s,t,i,a)>0)for(let g=t;g<i;g+=a)m=Om(g/a|0,s[g],s[g+1],m);else for(let g=i-a;g>=t;g-=a)m=Om(g/a|0,s[g],s[g+1],m);return m&&al(m,m.next)&&(qc(m),m=m.next),m}function Ka(s,t){if(!s)return s;t||(t=s);let i,a=s;do if(i=!1,a.steiner||!al(a,a.next)&&Br(a.prev,a,a.next)!==0)a=a.next;else{if(qc(a),a=t=a.prev,a===a.next)break;i=!0}while(i||a!==t);return t}function $c(s,t,i,a,h,m,g){if(!s)return;!g&&m&&function(T,P,C,E){let z=T;do z.z===0&&(z.z=ud(z.x,z.y,P,C,E)),z.prevZ=z.prev,z.nextZ=z.next,z=z.next;while(z!==T);z.prevZ.nextZ=null,z.prevZ=null,function(L){let F,j=1;do{let G,J=L;L=null;let pe=null;for(F=0;J;){F++;let re=J,D=0;for(let ie=0;ie<j&&(D++,re=re.nextZ,re);ie++);let Z=j;for(;D>0||Z>0&&re;)D!==0&&(Z===0||!re||J.z<=re.z)?(G=J,J=J.nextZ,D--):(G=re,re=re.nextZ,Z--),pe?pe.nextZ=G:L=G,G.prevZ=pe,pe=G;J=re}pe.nextZ=null,j*=2}while(F>1)}(z)}(s,a,h,m);let v=s;for(;s.prev!==s.next;){const T=s.prev,P=s.next;if(m?Qv(s,a,h,m):Jv(s))t.push(T.i,s.i,P.i),qc(s),s=P.next,v=P.next;else if((s=P)===v){g?g===1?$c(s=ex(Ka(s),t),t,i,a,h,m,2):g===2&&tx(s,t,i,a,h,m):$c(Ka(s),t,i,a,h,m,1);break}}}function Jv(s){const t=s.prev,i=s,a=s.next;if(Br(t,i,a)>=0)return!1;const h=t.x,m=i.x,g=a.x,v=t.y,T=i.y,P=a.y,C=Math.min(h,m,g),E=Math.min(v,T,P),z=Math.max(h,m,g),L=Math.max(v,T,P);let F=a.next;for(;F!==t;){if(F.x>=C&&F.x<=z&&F.y>=E&&F.y<=L&&Uc(h,v,m,T,g,P,F.x,F.y)&&Br(F.prev,F,F.next)>=0)return!1;F=F.next}return!0}function Qv(s,t,i,a){const h=s.prev,m=s,g=s.next;if(Br(h,m,g)>=0)return!1;const v=h.x,T=m.x,P=g.x,C=h.y,E=m.y,z=g.y,L=Math.min(v,T,P),F=Math.min(C,E,z),j=Math.max(v,T,P),G=Math.max(C,E,z),J=ud(L,F,t,i,a),pe=ud(j,G,t,i,a);let re=s.prevZ,D=s.nextZ;for(;re&&re.z>=J&&D&&D.z<=pe;){if(re.x>=L&&re.x<=j&&re.y>=F&&re.y<=G&&re!==h&&re!==g&&Uc(v,C,T,E,P,z,re.x,re.y)&&Br(re.prev,re,re.next)>=0||(re=re.prevZ,D.x>=L&&D.x<=j&&D.y>=F&&D.y<=G&&D!==h&&D!==g&&Uc(v,C,T,E,P,z,D.x,D.y)&&Br(D.prev,D,D.next)>=0))return!1;D=D.nextZ}for(;re&&re.z>=J;){if(re.x>=L&&re.x<=j&&re.y>=F&&re.y<=G&&re!==h&&re!==g&&Uc(v,C,T,E,P,z,re.x,re.y)&&Br(re.prev,re,re.next)>=0)return!1;re=re.prevZ}for(;D&&D.z<=pe;){if(D.x>=L&&D.x<=j&&D.y>=F&&D.y<=G&&D!==h&&D!==g&&Uc(v,C,T,E,P,z,D.x,D.y)&&Br(D.prev,D,D.next)>=0)return!1;D=D.nextZ}return!0}function ex(s,t){let i=s;do{const a=i.prev,h=i.next.next;!al(a,h)&&Fm(a,i,i.next,h)&&Zc(a,h)&&Zc(h,a)&&(t.push(a.i,i.i,h.i),qc(i),qc(i.next),i=s=h),i=i.next}while(i!==s);return Ka(i)}function tx(s,t,i,a,h,m){let g=s;do{let v=g.next.next;for(;v!==g.prev;){if(g.i!==v.i&&ax(g,v)){let T=Bm(g,v);return g=Ka(g,g.next),T=Ka(T,T.next),$c(g,t,i,a,h,m,0),void $c(T,t,i,a,h,m,0)}v=v.next}g=g.next}while(g!==s)}function rx(s,t){let i=s.x-t.x;return i===0&&(i=s.y-t.y,i===0)&&(i=(s.next.y-s.y)/(s.next.x-s.x)-(t.next.y-t.y)/(t.next.x-t.x)),i}function ix(s,t){const i=function(h,m){let g=m;const v=h.x,T=h.y;let P,C=-1/0;if(al(h,g))return g;do{if(al(h,g.next))return g.next;if(T<=g.y&&T>=g.next.y&&g.next.y!==g.y){const j=g.x+(T-g.y)*(g.next.x-g.x)/(g.next.y-g.y);if(j<=v&&j>C&&(C=j,P=g.x<g.next.x?g:g.next,j===v))return P}g=g.next}while(g!==m);if(!P)return null;const E=P,z=P.x,L=P.y;let F=1/0;g=P;do{if(v>=g.x&&g.x>=z&&v!==g.x&&Lm(T<L?v:C,T,z,L,T<L?C:v,T,g.x,g.y)){const j=Math.abs(T-g.y)/(v-g.x);Zc(g,h)&&(j<F||j===F&&(g.x>P.x||g.x===P.x&&sx(P,g)))&&(P=g,F=j)}g=g.next}while(g!==E);return P}(s,t);if(!i)return t;const a=Bm(i,s);return Ka(a,a.next),Ka(i,i.next)}function sx(s,t){return Br(s.prev,s,t.prev)<0&&Br(t.next,s,s.next)<0}function ud(s,t,i,a,h){return(s=1431655765&((s=858993459&((s=252645135&((s=16711935&((s=(s-i)*h|0)|s<<8))|s<<4))|s<<2))|s<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-a)*h|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function nx(s){let t=s,i=s;do(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next;while(t!==s);return i}function Lm(s,t,i,a,h,m,g,v){return(h-g)*(t-v)>=(s-g)*(m-v)&&(s-g)*(a-v)>=(i-g)*(t-v)&&(i-g)*(m-v)>=(h-g)*(a-v)}function Uc(s,t,i,a,h,m,g,v){return!(s===g&&t===v)&&Lm(s,t,i,a,h,m,g,v)}function ax(s,t){return s.next.i!==t.i&&s.prev.i!==t.i&&!function(i,a){let h=i;do{if(h.i!==i.i&&h.next.i!==i.i&&h.i!==a.i&&h.next.i!==a.i&&Fm(h,h.next,i,a))return!0;h=h.next}while(h!==i);return!1}(s,t)&&(Zc(s,t)&&Zc(t,s)&&function(i,a){let h=i,m=!1;const g=(i.x+a.x)/2,v=(i.y+a.y)/2;do h.y>v!=h.next.y>v&&h.next.y!==h.y&&g<(h.next.x-h.x)*(v-h.y)/(h.next.y-h.y)+h.x&&(m=!m),h=h.next;while(h!==i);return m}(s,t)&&(Br(s.prev,s,t.prev)||Br(s,t.prev,t))||al(s,t)&&Br(s.prev,s,s.next)>0&&Br(t.prev,t,t.next)>0)}function Br(s,t,i){return(t.y-s.y)*(i.x-t.x)-(t.x-s.x)*(i.y-t.y)}function al(s,t){return s.x===t.x&&s.y===t.y}function Fm(s,t,i,a){const h=zh(Br(s,t,i)),m=zh(Br(s,t,a)),g=zh(Br(i,a,s)),v=zh(Br(i,a,t));return h!==m&&g!==v||!(h!==0||!kh(s,i,t))||!(m!==0||!kh(s,a,t))||!(g!==0||!kh(i,s,a))||!(v!==0||!kh(i,t,a))}function kh(s,t,i){return t.x<=Math.max(s.x,i.x)&&t.x>=Math.min(s.x,i.x)&&t.y<=Math.max(s.y,i.y)&&t.y>=Math.min(s.y,i.y)}function zh(s){return s>0?1:s<0?-1:0}function Zc(s,t){return Br(s.prev,s,s.next)<0?Br(s,t,s.next)>=0&&Br(s,s.prev,t)>=0:Br(s,t,s.prev)<0||Br(s,s.next,t)<0}function Bm(s,t){const i=hd(s.i,s.x,s.y),a=hd(t.i,t.x,t.y),h=s.next,m=t.prev;return s.next=t,t.prev=s,i.next=h,h.prev=i,a.next=i,i.prev=a,m.next=a,a.prev=m,a}function Om(s,t,i,a){const h=hd(s,t,i);return a?(h.next=a.next,h.prev=a,a.next.prev=h,a.next=h):(h.prev=h,h.next=h),h}function qc(s){s.next.prev=s.prev,s.prev.next=s.next,s.prevZ&&(s.prevZ.nextZ=s.nextZ),s.nextZ&&(s.nextZ.prevZ=s.prevZ)}function hd(s,t,i){return{i:s,x:t,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class ol{constructor(t,i){if(i>t)throw new Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=t,this._minGranularity=i}getGranularityForZoomLevel(t){return Math.max(Math.floor(this._baseZoomGranularity/(1<<t)),this._minGranularity,1)}}class Rh{constructor(t){this.fill=t.fill,this.line=t.line,this.tile=t.tile,this.stencil=t.stencil,this.circle=t.circle}}Rh.noSubdivision=new Rh({fill:new ol(0,0),line:new ol(0,0),tile:new ol(0,0),stencil:new ol(0,0),circle:1}),Qe("SubdivisionGranularityExpression",ol),Qe("SubdivisionGranularitySetting",Rh);const ll=-32768,Gc=32767;class ox{constructor(t,i){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=t,this._granularityCellSize=_t/t,this._canonical=i}_getKey(t,i){return(t+=32768)<<16|(i+=32768)<<0}_vertexToIndex(t,i){if(t<-32768||i<-32768||t>32767||i>32767)throw new Error("Vertex coordinates are out of signed 16 bit integer range.");const a=0|Math.round(t),h=0|Math.round(i),m=this._getKey(a,h);if(this._vertexDictionary.has(m))return this._vertexDictionary.get(m);const g=this._vertexBuffer.length/2;return this._vertexDictionary.set(m,g),this._vertexBuffer.push(a,h),g}_subdivideTrianglesScanline(t){if(this._granularity<2)return function(h,m){const g=[];for(let v=0;v<m.length;v+=3){const T=m[v],P=m[v+1],C=m[v+2],E=h[2*T],z=h[2*T+1];(h[2*P]-E)*(h[2*C+1]-z)-(h[2*P+1]-z)*(h[2*C]-E)>0?(g.push(T),g.push(C),g.push(P)):(g.push(T),g.push(P),g.push(C))}return g}(this._vertexBuffer,t);const i=[],a=t.length;for(let h=0;h<a;h+=3){const m=[t[h+0],t[h+1],t[h+2]],g=[this._vertexBuffer[2*t[h+0]+0],this._vertexBuffer[2*t[h+0]+1],this._vertexBuffer[2*t[h+1]+0],this._vertexBuffer[2*t[h+1]+1],this._vertexBuffer[2*t[h+2]+0],this._vertexBuffer[2*t[h+2]+1]];let v=1/0,T=1/0,P=-1/0,C=-1/0;for(let j=0;j<3;j++){const G=g[2*j],J=g[2*j+1];v=Math.min(v,G),P=Math.max(P,G),T=Math.min(T,J),C=Math.max(C,J)}if(v===P||T===C)continue;const E=Math.floor(v/this._granularityCellSize),z=Math.ceil(P/this._granularityCellSize),L=Math.floor(T/this._granularityCellSize),F=Math.ceil(C/this._granularityCellSize);if(E!==z||L!==F)for(let j=L;j<F;j++){const G=this._scanlineGenerateVertexRingForCellRow(j,g,m);lx(this._vertexBuffer,G,i)}else i.push(...m)}return i}_scanlineGenerateVertexRingForCellRow(t,i,a){const h=t*this._granularityCellSize,m=h+this._granularityCellSize,g=[];for(let v=0;v<3;v++){const T=i[2*v],P=i[2*v+1],C=i[2*(v+1)%6],E=i[(2*(v+1)+1)%6],z=i[2*(v+2)%6],L=i[(2*(v+2)+1)%6],F=C-T,j=E-P,G=F===0,J=j===0,pe=(h-P)/j,re=(m-P)/j,D=Math.min(pe,re),Z=Math.max(pe,re);if(!J&&(D>=1||Z<=0)||J&&(P<h||P>m)){E>=h&&E<=m&&g.push(a[(v+1)%3]);continue}!J&&D>0&&g.push(this._vertexToIndex(T+F*D,P+j*D));const ie=T+F*Math.max(D,0),xe=T+F*Math.min(Z,1);G||this._generateIntraEdgeVertices(g,T,P,C,E,ie,xe),!J&&Z<1&&g.push(this._vertexToIndex(T+F*Z,P+j*Z)),(J||E>=h&&E<=m)&&g.push(a[(v+1)%3]),!J&&(E<=h||E>=m)&&this._generateInterEdgeVertices(g,T,P,C,E,z,L,xe,h,m)}return g}_generateIntraEdgeVertices(t,i,a,h,m,g,v){const T=h-i,P=m-a,C=P===0,E=C?Math.min(i,h):Math.min(g,v),z=C?Math.max(i,h):Math.max(g,v),L=Math.floor(E/this._granularityCellSize)+1,F=Math.ceil(z/this._granularityCellSize)-1;if(C?i<h:g<v)for(let j=L;j<=F;j++){const G=j*this._granularityCellSize;t.push(this._vertexToIndex(G,a+P*(G-i)/T))}else for(let j=F;j>=L;j--){const G=j*this._granularityCellSize;t.push(this._vertexToIndex(G,a+P*(G-i)/T))}}_generateInterEdgeVertices(t,i,a,h,m,g,v,T,P,C){const E=m-a,z=g-h,L=v-m,F=(P-m)/L,j=(C-m)/L,G=Math.min(F,j),J=Math.max(F,j),pe=h+z*G;let re=Math.floor(Math.min(pe,T)/this._granularityCellSize)+1,D=Math.ceil(Math.max(pe,T)/this._granularityCellSize)-1,Z=T<pe;const ie=L===0;if(ie&&(v===P||v===C))return;if(ie||G>=1||J<=0){const Fe=a-v,Te=g+(i-g)*Math.min((P-v)/Fe,(C-v)/Fe);re=Math.floor(Math.min(Te,T)/this._granularityCellSize)+1,D=Math.ceil(Math.max(Te,T)/this._granularityCellSize)-1,Z=T<Te}const xe=E>0?C:P;if(Z)for(let Fe=re;Fe<=D;Fe++)t.push(this._vertexToIndex(Fe*this._granularityCellSize,xe));else for(let Fe=D;Fe>=re;Fe--)t.push(this._vertexToIndex(Fe*this._granularityCellSize,xe))}_generateOutline(t){const i=[];for(const a of t){const h=Ja(a,this._granularity,!0),m=this._pointArrayToIndices(h),g=[];for(let v=1;v<m.length;v++)g.push(m[v-1]),g.push(m[v]);i.push(g)}return i}_handlePoles(t){let i=!1,a=!1;this._canonical&&(this._canonical.y===0&&(i=!0),this._canonical.y===(1<<this._canonical.z)-1&&(a=!0)),(i||a)&&this._fillPoles(t,i,a)}_ensureNoPoleVertices(){const t=this._vertexBuffer;for(let i=0;i<t.length;i+=2){const a=t[i+1];a===ll&&(t[i+1]=-32767),a===Gc&&(t[i+1]=32766)}}_generatePoleQuad(t,i,a,h,m,g){h>m!=(g===ll)?(t.push(i),t.push(a),t.push(this._vertexToIndex(h,g)),t.push(a),t.push(this._vertexToIndex(m,g)),t.push(this._vertexToIndex(h,g))):(t.push(a),t.push(i),t.push(this._vertexToIndex(h,g)),t.push(this._vertexToIndex(m,g)),t.push(a),t.push(this._vertexToIndex(h,g)))}_fillPoles(t,i,a){const h=this._vertexBuffer,m=_t,g=t.length;for(let v=2;v<g;v+=3){const T=t[v-2],P=t[v-1],C=t[v],E=h[2*T],z=h[2*T+1],L=h[2*P],F=h[2*P+1],j=h[2*C],G=h[2*C+1];i&&(z===0&&F===0&&this._generatePoleQuad(t,T,P,E,L,ll),F===0&&G===0&&this._generatePoleQuad(t,P,C,L,j,ll),G===0&&z===0&&this._generatePoleQuad(t,C,T,j,E,ll)),a&&(z===m&&F===m&&this._generatePoleQuad(t,T,P,E,L,Gc),F===m&&G===m&&this._generatePoleQuad(t,P,C,L,j,Gc),G===m&&z===m&&this._generatePoleQuad(t,C,T,j,E,Gc))}}_initializeVertices(t){for(let i=0;i<t.length;i+=2)this._vertexToIndex(t[i],t[i+1])}subdividePolygonInternal(t,i){if(this._used)throw new Error("Subdivision: multiple use not allowed.");this._used=!0;const{flattened:a,holeIndices:h}=function(v){const T=[],P=[];for(const C of v)if(C.length!==0){C!==v[0]&&T.push(P.length/2);for(let E=0;E<C.length;E++)P.push(C[E].x),P.push(C[E].y)}return{flattened:P,holeIndices:T}}(t);let m;this._initializeVertices(a);try{const v=function(P,C,E=2){const z=C&&C.length,L=z?C[0]*E:P.length;let F=Dm(P,0,L,E,!0);const j=[];if(!F||F.next===F.prev)return j;let G,J,pe;if(z&&(F=function(re,D,Z,ie){const xe=[];for(let Fe=0,Te=D.length;Fe<Te;
25Fe++){const Ce=Dm(re,D[Fe]*ie,Fe<Te-1?D[Fe+1]*ie:re.length,ie,!1);Ce===Ce.next&&(Ce.steiner=!0),xe.push(nx(Ce))}xe.sort(rx);for(let Fe=0;Fe<xe.length;Fe++)Z=ix(xe[Fe],Z);return Z}(P,C,F,E)),P.length>80*E){G=1/0,J=1/0;let re=-1/0,D=-1/0;for(let Z=E;Z<L;Z+=E){const ie=P[Z],xe=P[Z+1];ie<G&&(G=ie),xe<J&&(J=xe),ie>re&&(re=ie),xe>D&&(D=xe)}pe=Math.max(re-G,D-J),pe=pe!==0?32767/pe:0}return $c(F,j,E,G,J,pe,0),j}(a,h),T=this._convertIndices(a,v);m=this._subdivideTrianglesScanline(T)}catch(v){console.error(v)}let g=[];return i&&(g=this._generateOutline(t)),this._ensureNoPoleVertices(),this._handlePoles(m),{verticesFlattened:this._vertexBuffer,indicesTriangles:m,indicesLineList:g}}_convertIndices(t,i){const a=[];for(let h=0;h<i.length;h++)a.push(this._vertexToIndex(t[2*i[h]],t[2*i[h]+1]));return a}_pointArrayToIndices(t){const i=[];for(let a=0;a<t.length;a++){const h=t[a];i.push(this._vertexToIndex(h.x,h.y))}return i}}function Nm(s,t,i,a=!0){return new ox(i,t).subdividePolygonInternal(s,a)}function Ja(s,t,i=!1){if(!s||s.length<1)return[];if(s.length<2)return[];
vendor: 1,811 bytes, line 25
25const a=s[0],h=s[s.length-1],m=i&&(a.x!==h.x||a.y!==h.y);if(t<2)return m?[...s,s[0]]:[...s];const g=Math.floor(_t/t),v=[];v.push(new Se(s[0].x,s[0].y));const T=s.length,P=m?T:T-1;for(let C=0;C<P;C++){const E=s[C],z=C<T-1?s[C+1]:s[0],L=E.x,F=E.y,j=z.x,G=z.y,J=L!==j,pe=F!==G;if(!J&&!pe)continue;const re=j-L,D=G-F,Z=Math.abs(re),ie=Math.abs(D);let xe=L,Fe=F;for(;;){const Ce=re>0?(Math.floor(xe/g)+1)*g:(Math.ceil(xe/g)-1)*g,je=D>0?(Math.floor(Fe/g)+1)*g:(Math.ceil(Fe/g)-1)*g,Le=Math.abs(xe-Ce),Ne=Math.abs(Fe-je),ke=Math.abs(xe-j),it=Math.abs(Fe-G),ct=J?Le/Z:Number.POSITIVE_INFINITY,lt=pe?Ne/ie:Number.POSITIVE_INFINITY;if((ke<=Le||!J)&&(it<=Ne||!pe))break;if(ct<lt&&J||!pe){xe=Ce,Fe+=D*ct;const at=new Se(xe,Math.round(Fe));v[v.length-1].x===at.x&&v[v.length-1].y===at.y||v.push(at)}else{xe+=re*lt,Fe=je;const at=new Se(Math.round(xe),Fe);v[v.length-1].x===at.x&&v[v.length-1].y===at.y||v.push(at)}}const Te=new Se(j,G);v[v.length-1].x===Te.x&&v[v.length-1].y===Te.y||v.push(Te)}return v}function lx(s,t,i){if(t.length===0)throw new Error("Subdivision vertex ring is empty.");let a=0,h=s[2*t[0]];for(let T=1;T<t.length;T++){const P=s[2*t[T]];P<h&&(h=P,a=T)}const m=t.length;let g=a,v=(g+1)%m;for(;;){const T=g-1>=0?g-1:m-1,P=(v+1)%m,C=s[2*t[T]],E=s[2*t[P]],z=s[2*t[g]],L=s[2*t[g]+1],F=s[2*t[v]+1];let j=!1;if(C<E)j=!0;else if(C>E)j=!1;else{const G=F-L,J=-(s[2*t[v]]-z),pe=L<F?1:-1;((C-z)*G+(s[2*t[T]+1]-L)*J)*pe>((E-z)*G+(s[2*t[P]+1]-L)*J)*pe&&(j=!0)}if(j){const G=t[T],J=t[g],pe=t[v];G!==J&&G!==pe&&J!==pe&&i.push(pe,J,G),g--,g<0&&(g=m-1)}else{const G=t[P],J=t[g],pe=t[v];G!==J&&G!==pe&&J!==pe&&i.push(pe,J,G),v++,v>=m&&(v=0)}if(T===P)break}}function jm(s,t,i,a,h,m,g,v,T){const P=h.length/2,C=g&&v&&T;if(P<Xe.MAX_VERTEX_ARRAY_LENGTH){const E=t.prepareSegment(P,i,a),z=E.vertexLength;for(let j=0;j<m.length;
25j+=3)a.emplaceBack(z+m[j],z+m[j+1],z+m[j+2]);let L,F;E.vertexLength+=P,E.primitiveLength+=m.length/3,C&&(F=g.prepareSegment(P,i,v),L=F.vertexLength,F.vertexLength+=P);for(let j=0;j<h.length;j+=2)s(h[j],h[j+1]);if(C)for(let j=0;j<T.length;j++){const G=T[j];for(let J=1;J<G.length;J+=2)v.emplaceBack(L+G[J-1],L+G[J]);F.primitiveLength+=G.length/2}}else(function(E,z,L,F,j,G){const J=[];for(let ie=0;ie<F.length/2;ie++)J.push(-1);const pe={count:0};let re=0,D=E.getOrCreateLatestSegment(z,L),Z=D.vertexLength;for(let ie=2;ie<j.length;ie+=3){const xe=j[ie-2],Fe=j[ie-1],Te=j[ie];let Ce=J[xe]<re,je=J[Fe]<re,Le=J[Te]<re;D.vertexLength+((Ce?1:0)+(je?1:0)+(Le?1:0))>Xe.MAX_VERTEX_ARRAY_LENGTH&&(D=E.createNewSegment(z,L),re=pe.count,Ce=!0,je=!0,Le=!0,Z=0);const Ne=Hc(J,F,G,pe,xe,Ce,D),ke=Hc(J,F,G,pe,Fe,je,D),it=Hc(J,F,G,pe,Te,Le,D);L.emplaceBack(Z+Ne-re,Z+ke-re,Z+it-re),D.primitiveLength++}})(t,i,a,h,m,s),C&&function(E,z,L,F,j,G){const J=[];for(let ie=0;ie<F.length/2;ie++)J.push(-1);const pe={count:0};let re=0,D=E.getOrCreateLatestSegment(z,L),Z=D.vertexLength;for(let ie=0;ie<j.length;ie++){const xe=j[ie];for(let Fe=1;Fe<j[ie].length;Fe+=2){const Te=xe[Fe-1],Ce=xe[Fe];let je=J[Te]<re,Le=J[Ce]<re;D.vertexLength+((je?1:0)+(Le?1:0))>Xe.MAX_VERTEX_ARRAY_LENGTH&&(D=E.createNewSegment(z,L),re=pe.count,je=!0,Le=!0,Z=0);const Ne=Hc(J,F,G,pe,Te,je,D),ke=Hc(J,F,G,pe,Ce,Le,D);L.emplaceBack(Z+Ne-re,Z+ke-re),D.primitiveLength++}}}(g,i,v,h,T,s),t.forceNewSegmentOnNextPrepare(),g==null||g.forceNewSegmentOnNextPrepare()}function Hc(s,t,i,a,h,m,g){if(m){const v=a.count;return i(t[2*h],t[2*h+1]),s[h]=a.count,a.count++,g.vertexLength++,v}return s[h]}class pd{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(i=>i.id),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new ee,this.indexArray=new Ie,this.indexArray2=new Ge,this.programConfigurations=new yr(t.layers,t.zoom),this.segments=new Xe,this.segments2=new Xe,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(t,i,a){this.hasPattern=ld("fill",this.layers,i);const h=this.layers[0].layout.get("fill-sort-key"),m=!h.isConstant(),g=[];for(const{feature:v,id:T,index:P,sourceLayerIndex:C}of t){const E=this.layers[0]._featureFilter.needGeometry,z=In(v,E);if(!this.layers[0]._featureFilter.filter(new dr(this.zoom),z,a))continue;const L=m?h.evaluate(z,{},a,i.availableImages):void 0,F={id:T,properties:v.properties,type:v.type,sourceLayerIndex:C,index:P,geometry:E?z.geometry:Pn(v),patterns:{},sortKey:L};g.push(F)}m&&g.sort((v,T)=>v.sortKey-T.sortKey);for(const v of g){const{geometry:T,index:P,sourceLayerIndex:C}=v;if(this.hasPattern){const E=cd("fill",this.layers,v,this.zoom,i);this.patternFeatures.push(E)}else this.addFeature(v,T,P,a,{},i.subdivisionGranularity);i.featureIndex.insert(t[P].feature,T,P,C,this.index)}}update(t,i,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,i,this.stateDependentLayers,a)}addFeatures(t,i,a){for(const h of this.patternFeatures)this.addFeature(h,h.geometry,h.index,i,a,t.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Kv),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,i,a,h,m,g){for(const v of Io(i,500)){const T=Nm(v,h,g.fill.getGranularityForZoomLevel(h.z)),P=this.layoutVertexArray;jm((C,E)=>{P.emplaceBack(C,E)},this.segments,this.layoutVertexArray,this.indexArray,T.verticesFlattened,T.indicesTriangles,this.segments2,this.indexArray2,T.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,m,h)}}let Vm,$m;Qe("FillBucket",pd,{omit:["layers","patternFeatures"]});var cx={get paint(){return $m=$m||new Ci({"fill-antialias":new ot(H.paint_fill["fill-antialias"]),"fill-opacity":new mt(H.paint_fill["fill-opacity"]),"fill-color":new mt(H.paint_fill["fill-color"]),"fill-outline-color":new mt(H.paint_fill["fill-outline-color"]),"fill-translate":new ot(H.paint_fill["fill-translate"]),"fill-translate-anchor":new ot(H.paint_fill["fill-translate-anchor"]),"fill-pattern":new $a(H.paint_fill["fill-pattern"])})},get layout(){return Vm=Vm||new Ci({"fill-sort-key":new mt(H.layout_fill["fill-sort-key"])})}};class ux extends ws{constructor(t){super(t,cx)}recalculate(t,i){super.recalculate(t,i);const a=this.paint._values["fill-outline-color"];a.value.kind==="constant"&&a.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new pd(t)}queryRadius(){return Eh(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:t,geometry:i,transform:a,pixelsToTileUnits:h}){return Oc(Ah(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-a.bearingInRadians,h),i)}isTileClipped(){return!0}}const hx=Lr([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),px=Lr([{name:"a_centroid",components:2,type:"Int16"}],4),{members:dx}=hx;var dd,Um,fd,Zm,md,qm,Gm,Dh={};function Hm(){if(Um)return dd;Um=1;var s=ne();function t(h,m,g,v,T){this.properties={},this.extent=g,this.type=0,this._pbf=h,this._geometry=-1,this._keys=v,this._values=T,h.readFields(i,this,m)}function i(h,m,g){h==1?m.id=g.readVarint():h==2?function(v,T){for(var P=v.readVarint()+v.pos;v.pos<P;){var C=T._keys[v.readVarint()],E=T._values[v.readVarint()];T.properties[C]=E}}(g,m):h==3?m.type=g.readVarint():h==4&&(m._geometry=g.pos)}function a(h){for(var m,g,v=0,T=0,P=h.length,C=P-1;T<P;C=T++)v+=((g=h[C]).x-(m=h[T]).x)*(m.y+g.y);return v}return dd=t,t.types=["Unknown","Point","LineString","Polygon"],t.prototype.loadGeometry=function(){var h=this._pbf;h.pos=this._geometry;for(var m,g=h.readVarint()+h.pos,v=1,T=0,P=0,C=0,E=[];h.pos<g;){if(T<=0){var z=h.readVarint();v=7&z,T=z>>3}if(T--,v===1||v===2)P+=h.readSVarint(),C+=h.readSVarint(),v===1&&(m&&E.push(m),m=[]),m.push(new s(P,C));else{if(v!==7)throw new Error("unknown command "+v);m&&m.push(m[0].clone())}}return m&&E.push(m),E},t.prototype.bbox=function(){var h=this._pbf;h.pos=this._geometry;for(var m=h.readVarint()+h.pos,g=1,v=0,T=0,P=0,C=1/0,E=-1/0,z=1/0,L=-1/0;h.pos<m;){if(v<=0){var F=h.readVarint();g=7&F,v=F>>3}if(v--,g===1||g===2)(T+=h.readSVarint())<C&&(C=T),T>E&&(E=T),(P+=h.readSVarint())<z&&(z=P),P>L&&(L=P);else if(g!==7)throw new Error("unknown command "+g)}return[C,z,E,L]},t.prototype.toGeoJSON=function(h,m,g){var v,T,P=this.extent*Math.pow(2,g),C=this.extent*h,E=this.extent*m,z=this.loadGeometry(),L=t.types[this.type];function F(J){for(var pe=0;pe<J.length;pe++){var re=J[pe];J[pe]=[360*(re.x+C)/P-180,360/Math.PI*Math.atan(Math.exp((180-360*(re.y+E)/P)*Math.PI/180)
25)-90]}}switch(this.type){case 1:var j=[];for(v=0;v<z.length;v++)j[v]=z[v][0];F(z=j);break;case 2:for(v=0;v<z.length;v++)F(z[v]);break;case 3:for(z=function(J){var pe=J.length;if(pe<=1)return[J];for(var re,D,Z=[],ie=0;ie<pe;ie++){var xe=a(J[ie]);xe!==0&&(D===void 0&&(D=xe<0),D===xe<0?(re&&Z.push(re),re=[J[ie]]):re.push(J[ie]))}return re&&Z.push(re),Z}(z),v=0;v<z.length;v++)for(T=0;T<z[v].length;T++)F(z[v][T])}z.length===1?z=z[0]:L="Multi"+L;var G={type:"Feature",geometry:{type:L,coordinates:z},properties:this.properties};return"id"in this&&(G.id=this.id),G},dd}function Wm(){if(Zm)return fd;Zm=1;var s=Hm();function t(a,h){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=a,this._keys=[],this._values=[],this._features=[],a.readFields(i,this,h),this.length=this._features.length}function i(a,h,m){a===15?h.version=m.readVarint():a===1?h.name=m.readString():a===5?h.extent=m.readVarint():a===2?h._features.push(m.pos):a===3?h._keys.push(m.readString()):a===4&&h._values.push(function(g){for(var v=null,T=g.readVarint()+g.pos;g.pos<T;){var P=g.readVarint()>>3;v=P===1?g.readString():P===2?g.readFloat():P===3?g.readDouble():P===4?g.readVarint64():P===5?g.readVarint():P===6?g.readSVarint():P===7?g.readBoolean():null}return v}(m))}return fd=t,t.prototype.feature=function(a){if(a<0||a>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[a];var h=this._pbf.readVarint()+this._pbf.pos;return new s(this._pbf,h,this.extent,this._keys,this._values)},fd}function Xm(){return Gm||(Gm=1,Dh.VectorTile=function(){if(qm)return md;qm=1;var s=Wm();function t(i,a,h){if(i===3){var m=new s(h,h.readVarint()+h.pos);m.length&&(a[m.name]=m)}}return md=function(i,a){this.layers=i.readFields(t,{},a)},md}(),Dh.VectorTileFeature=Hm(),Dh.VectorTileLayer=Wm()),Dh}var Wc=B(Xm());const fx=Wc.VectorTileFeature.types,gd=Math.pow(2,13);function Xc(s,t,i,a,h,m,g,v){s.emplaceBack(t,i,2*Math.floor(a*gd)+g,h*gd*2,m*gd*2,Math.round(v))}class _d{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(i=>i.id),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new se,this.centroidVertexArray=new W,this.indexArray=new Ie,this.programConfigurations=new yr(t.layers,t.zoom),this.segments=new Xe,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(t,i,a){this.features=[],this.hasPattern=ld("fill-extrusion",this.layers,i);for(const{feature:h,id:m,index:g,sourceLayerIndex:v}of t){const T=this.layers[0]._featureFilter.needGeometry,P=In(h,T);if(!this.layers[0]._featureFilter.filter(new dr(this.zoom),P,a))continue;const C={id:m,sourceLayerIndex:v,index:g,geometry:T?P.geometry:Pn(h),properties:h.properties,type:h.type,patterns:{}};this.hasPattern?this.features.push(cd("fill-extrusion",this.layers,C,this.zoom,i)):this.addFeature(C,C.geometry,g,a,{},i.subdivisionGranularity),i.featureIndex.insert(h,C.geometry,g,v,this.index,!0)}}addFeatures(t,i,a){for(const h of this.features){const{geometry:m}=h;this.addFeature(h,m,h.index,i,a,t.subdivisionGranularity)}}update(t,i,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,i,this.stateDependentLayers,a)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,dx),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,px.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,i,a,h,m,g){for(const v of Io(i,500)){const T={x:0,y:0,sampleCount:0},P=this.layoutVertexArray.length;this.processPolygon(T,h,t,v,g);const C=this.layoutVertexArray.length-P,E=Math.floor(T.x/T.sampleC
25ount),z=Math.floor(T.y/T.sampleCount);for(let L=0;L<C;L++)this.centroidVertexArray.emplaceBack(E,z)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,m,h)}processPolygon(t,i,a,h,m){if(h.length<1||Ym(h[0]))return;for(const E of h)E.length!==0&&mx(t,E);const g={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},v=m.fill.getGranularityForZoomLevel(i.z),T=fx[a.type]==="Polygon";for(const E of h){if(E.length===0||Ym(E))continue;const z=Ja(E,v,T);this._generateSideFaces(z,g)}if(!T)return;const P=Nm(h,i,v,!1),C=this.layoutVertexArray;jm((E,z)=>{Xc(C,E,z,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,P.verticesFlattened,P.indicesTriangles)}_generateSideFaces(t,i){let a=0;for(let h=1;h<t.length;h++){const m=t[h],g=t[h-1];if(gx(m,g))continue;i.segment.vertexLength+4>Xe.MAX_VERTEX_ARRAY_LENGTH&&(i.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const v=m.sub(g)._perp()._unit(),T=g.dist(m);a+T>32768&&(a=0),Xc(this.layoutVertexArray,m.x,m.y,v.x,v.y,0,0,a),Xc(this.layoutVertexArray,m.x,m.y,v.x,v.y,0,1,a),a+=T,Xc(this.layoutVertexArray,g.x,g.y,v.x,v.y,0,0,a),Xc(this.layoutVertexArray,g.x,g.y,v.x,v.y,0,1,a);const P=i.segment.vertexLength;this.indexArray.emplaceBack(P,P+2,P+1),this.indexArray.emplaceBack(P+1,P+2,P+3),i.segment.vertexLength+=4,i.segment.primitiveLength+=2}}}function mx(s,t){for(let i=0;i<t.length;i++){const a=t[i];i===t.length-1&&t[0].x===a.x&&t[0].y===a.y||(s.x+=a.x,s.y+=a.y,s.sampleCount++)}}function gx(s,t){return s.x===t.x&&(s.x<0||s.x>_t)||s.y===t.y&&(s.y<0||s.y>_t)}function Ym(s){return s.every(t=>t.x<0)||s.every(t=>t.x>_t)||s.every(t=>t.y<0)||s.every(t=>t.y>_t)}let Km;Qe("FillExtrusionBucket",_d,{omit:["layers","features"]});var _x={get paint(){return Km=Km||new Ci({"fill-extrusion-opacity":new ot(H["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new mt(H["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new ot(H["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new ot(H["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new $a(H["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new mt(H["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new mt(H["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new ot(H["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class yx extends ws{constructor(t){super(t,_x)}createBucket(t){return new _d(t)}queryRadius(){return Eh(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:t,feature:i,featureState:a,geometry:h,transform:m,pixelsToTileUnits:g,pixelPosMatrix:v}){const T=Ah(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-m.bearingInRadians,g),P=this.paint.get("fill-extrusion-height").evaluate(i,a),C=this.paint.get("fill-extrusion-base").evaluate(i,a),E=function(L,F,j){const G=[];for(const J of L){const pe=[J.x,J.y,0,1];Or(pe,pe,F),G.push(new Se(pe[0]/pe[3],pe[1]/pe[3]))}return G}(T,v),z=function(L,F,j,G){const J=[],pe=[],re=G[8]*F,D=G[9]*F,Z=G[10]*F,ie=G[11]*F,xe=G[8]*j,Fe=G[9]*j,Te=G[10]*j,Ce=G[11]*j;for(const je of L){const Le=[],Ne=[];for(const ke of je){const it=ke.x,ct=ke.y,lt=G[0]*it+G[4]*ct+G[12],at=G[1]*it+G[5]*ct+G[13],Bt=G[2]*it+G[6]*ct+G[14],Sr=G[3]*it+G[7]*ct+G[15],Wr=Bt+Z,_i=Sr+ie,ds=lt+xe,$i=at+Fe,ai=Bt+Te,vr=Sr+Ce,Kr=new Se((lt+re)/_i,(at+D)/_i);Kr.z=Wr/_i,Le.push(Kr);const oi=new Se(ds/vr,$i/vr);oi.z=ai/vr,Ne.push(oi)}J.push(Le),pe.push(Ne)}return[J,pe]}(h,C,P,v);return function(L,F,j){let G=1/0;Oc(j,F)&&(G=Jm(j,F[0]));for(let J=0;J<F.length;J++){const pe=F[J],re=L[J];for(let D=0;D<pe.length-1;D++){const Z=pe[D],ie=[Z,pe[D+1],re[D+1],re[D],Z];Fc(j,ie)&&(G=Math.min(G,Jm(j,ie)))}}return G!==1/0&&G}(z[0],z[1],E)}}function Yc(s,t){return s.x*t.x+s.y*t.y}function Jm(s,t){if(s.length===1){let i=0;const a=t[i++];let h;for(;!h||a.equals(h);)if(h=t[i++],!h)return 1/0;for(;i<t.length;i++){const m=t[i],g=s[0],v=h.sub(a),T=m.sub(a),P=g.sub(a),C=Yc(v,v),E=Yc(v,T),z=Yc(T,T),L=Yc(P,v),F=Yc(P,T),j=C*z-E*E,G=(z*L-E*F)/j,J=(C*F-E*L)/j,pe=a.z*(1-G-J)+h.z*G+m.z*J;if(isFinite(pe))return pe}return 1/0}{let i=1/0;for(const a of t)i=Math.min(i,a.z);return i}}const vx=Lr([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:xx}=vx,bx=Lr([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:wx}=bx,Tx=Wc.VectorTileFeature.types,Sx=Math.cos(Math.PI/180*37.5),Qm=Math.pow(2,14)/.5;class yd{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(i=>i.id),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={}
vendor: 3,075 bytes, line 25
25,this.layers.forEach(i=>{this.gradients[i.id]={}}),this.layoutVertexArray=new oe,this.layoutVertexArray2=new le,this.indexArray=new Ie,this.programConfigurations=new yr(t.layers,t.zoom),this.segments=new Xe,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(t,i,a){this.hasPattern=ld("line",this.layers,i);const h=this.layers[0].layout.get("line-sort-key"),m=!h.isConstant(),g=[];for(const{feature:v,id:T,index:P,sourceLayerIndex:C}of t){const E=this.layers[0]._featureFilter.needGeometry,z=In(v,E);if(!this.layers[0]._featureFilter.filter(new dr(this.zoom),z,a))continue;const L=m?h.evaluate(z,{},a):void 0,F={id:T,properties:v.properties,type:v.type,sourceLayerIndex:C,index:P,geometry:E?z.geometry:Pn(v),patterns:{},sortKey:L};g.push(F)}m&&g.sort((v,T)=>v.sortKey-T.sortKey);for(const v of g){const{geometry:T,index:P,sourceLayerIndex:C}=v;if(this.hasPattern){const E=cd("line",this.layers,v,this.zoom,i);this.patternFeatures.push(E)}else this.addFeature(v,T,P,a,{},i.subdivisionGranularity);i.featureIndex.insert(t[P].feature,T,P,C,this.index)}}update(t,i,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,i,this.stateDependentLayers,a)}addFeatures(t,i,a){for(const h of this.patternFeatures)this.addFeature(h,h.geometry,h.index,i,a,t.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,wx)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,xx),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}addFeature(t,i,a,h,m,g){const v=this.layers[0].layout,T=v.get("line-join").evaluate(t,{}),P=v.get("line-cap"),C=v.get("line-miter-limit"),E=v.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(const z of i)this.addLine(z,t,T,P,C,E,h,g);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,m,h)}addLine(t,i,a,h,m,g,v,T){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,t=Ja(t,v?T.line.getGranularityForZoomLevel(v.z):1),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let re=0;re<t.length-1;re++)this.totalDistance+=t[re].dist(t[re+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const P=Tx[i.type]==="Polygon";let C=t.length;for(;C>=2&&t[C-1].equals(t[C-2]);)C--;let E=0;for(;E<C-1&&t[E].equals(t[E+1]);)E++;if(C<(P?3:2))return;
vendor: 11,274 bytes, line 25
25a==="bevel"&&(m=1.05);const z=this.overscaling<=16?15*_t/(512*this.overscaling):0,L=this.segments.prepareSegment(10*C,this.layoutVertexArray,this.indexArray);let F,j,G,J,pe;this.e1=this.e2=-1,P&&(F=t[C-2],pe=t[E].sub(F)._unit()._perp());for(let re=E;re<C;re++){if(G=re===C-1?P?t[E+1]:void 0:t[re+1],G&&t[re].equals(G))continue;pe&&(J=pe),F&&(j=F),F=t[re],pe=G?G.sub(F)._unit()._perp():J,J=J||pe;let D=J.add(pe);D.x===0&&D.y===0||D._unit();const Z=J.x*pe.x+J.y*pe.y,ie=D.x*pe.x+D.y*pe.y,xe=ie!==0?1/ie:1/0,Fe=2*Math.sqrt(2-2*ie),Te=ie<Sx&&j&&G,Ce=J.x*pe.y-J.y*pe.x>0;if(Te&&re>E){const Ne=F.dist(j);if(Ne>2*z){const ke=F.sub(F.sub(j)._mult(z/Ne)._round());this.updateDistance(j,ke),this.addCurrentVertex(ke,J,0,0,L),j=ke}}const je=j&&G;let Le=je?a:P?"butt":h;if(je&&Le==="round"&&(xe<g?Le="miter":xe<=2&&(Le="fakeround")),Le==="miter"&&xe>m&&(Le="bevel"),Le==="bevel"&&(xe>2&&(Le="flipbevel"),xe<m&&(Le="miter")),j&&this.updateDistance(j,F),Le==="miter")D._mult(xe),this.addCurrentVertex(F,D,0,0,L);else if(Le==="flipbevel"){if(xe>100)D=pe.mult(-1);else{const Ne=xe*J.add(pe).mag()/J.sub(pe).mag();D._perp()._mult(Ne*(Ce?-1:1))}this.addCurrentVertex(F,D,0,0,L),this.addCurrentVertex(F,D.mult(-1),0,0,L)}else if(Le==="bevel"||Le==="fakeround"){const Ne=-Math.sqrt(xe*xe-1),ke=Ce?Ne:0,it=Ce?0:Ne;if(j&&this.addCurrentVertex(F,J,ke,it,L),Le==="fakeround"){const ct=Math.round(180*Fe/Math.PI/20);for(let lt=1;lt<ct;lt++){let at=lt/ct;if(at!==.5){const Sr=at-.5;at+=at*Sr*(at-1)*((1.0904+Z*(Z*(3.55645-1.43519*Z)-3.2452))*Sr*Sr+(.848013+Z*(.215638*Z-1.06021)))}const Bt=pe.sub(J)._mult(at)._add(J)._unit()._mult(Ce?-1:1);this.addHalfVertex(F,Bt.x,Bt.y,!1,Ce,0,L)}}G&&this.addCurrentVertex(F,pe,-ke,-it,L)}else if(Le==="butt")this.addCurrentVertex(F,D,0,0,L);else if(Le==="square"){const Ne=j?1:-1;this.addCurrentVertex(F,D,Ne,Ne,L)}else Le==="round"&&(j&&(this.addCurrentVertex(F,J,0,0,L),this.addCurrentVertex(F,J,1,1,L,!0)),G&&(this.addCurrentVertex(F,pe,-1,-1,L,!0),this.addCurrentVertex(F,pe,0,0,L)));if(Te&&re<C-1){const Ne=F.dist(G);if(Ne>2*z){const ke=F.add(G.sub(F)._mult(z/Ne)._round());this.updateDistance(F,ke),this.addCurrentVertex(ke,pe,0,0,L),F=ke}}}}addCurrentVertex(t,i,a,h,m,g=!1){const v=i.y*h-i.x,T=-i.y-i.x*h;this.addHalfVertex(t,i.x+i.y*a,i.y-i.x*a,g,!1,a,m),this.addHalfVertex(t,v,T,g,!0,-h,m),this.distance>Qm/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,i,a,h,m,g))}addHalfVertex({x:t,y:i},a,h,m,g,v,T){const P=.5*(this.lineClips?this.scaledDistance*(Qm-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t<<1)+(m?1:0),(i<<1)+(g?1:0),Math.round(63*a)+128,Math.round(63*h)+128,1+(v===0?0:v<0?-1:1)|(63&P)<<2,P>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const C=T.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,C,this.e2),T.primitiveLength++),g?this.e2=C:this.e1=C}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,i){this.distance+=t.dist(i),this.updateScaledDistance()}}let eg,tg;Qe("LineBucket",yd,{omit:["layers","patternFeatures"]});var rg={get paint(){return tg=tg||new Ci({"line-opacity":new mt(H.paint_line["line-opacity"]),"line-color":new mt(H.paint_line["line-color"]),"line-translate":new ot(H.paint_line["line-translate"]),"line-translate-anchor":new ot(H.paint_line["line-translate-anchor"]),"line-width":new mt(H.paint_line["line-width"]),"line-gap-width":new mt(H.paint_line["line-gap-width"]),"line-offset":new mt(H.paint_line["line-offset"]),"line-blur":new mt(H.paint_line["line-blur"]),"line-dasharray":new el(H.paint_line["line-dasharray"]),"line-pattern":new $a(H.paint_line["line-pattern"]),"line-gradient":new tl(H.paint_line["line-gradient"])})},get layout(){return eg=eg||new Ci({"line-cap":new ot(H.layout_line["line-cap"]),"line-join":new mt(H.layout_line["line-join"]),"line-miter-limit":new ot(H.layout_line["line-miter-limit"]),"line-round-limit":new ot(H.layout_line["line-round-limit"]),"line-sort-key":new mt(H.layout_line["line-sort-key"])})}};class Mx extends mt{possiblyEvaluate(t,i){return i=new dr(Math.floor(i.zoom),{now:i.now,fadeDuration:i.fadeDuration,zoomHistory:i.zoomHistory,transition:i.transition}),super.possiblyEvaluate(t,i)}evaluate(t,i,a,h){return i=Ur({},i,{zoom:Math.floor(i.zoom)}),super.evaluate(t,i,a,h)}}let Lh;class Px extends ws{constructor(t){super(t,rg),this.gradientVersion=0,Lh||(Lh=new Mx(rg.paint.properties["line-width"].specification),Lh.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if(t==="line-gradient"){const i=this.gradientExpression();this.stepInterpolant=!!function(a){return a._styleExpression!==void 0}(i)&&i._styleExpression.expression instanceof mn,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,i){super.recalculate(t,i),this.paint._values["line-floorwidth"]=Lh.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new yd(t)}queryRadius(t){const i=t,a=ig(jc("line-width",this,i),jc("line-gap-width",this,i)),h=jc("line-offset",this,i);return a/2+Math.abs(h)+Eh(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:t,feature:i,featureState:a,geometry:h,transform:m,pixelsToTileUnits:g}){const v=Ah(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-m.bearingInRadians,g),T=g/2*ig(this.paint.get("line-width").evaluate(i,a),this.paint.get("line-gap-width").evaluate(i,a)),P=this.paint.get("line-offset").evaluate(i,a);return P&&(h=function(C,E){const z=[];for(let L=0;L<C.length;L++){const F=C[L],j=[];for(let G=0;G<F.length;G++){const J=F[G-1],pe=F[G],re=F[G+1],D=G===0?new Se(0,0):pe.sub(J)._unit()._perp(),Z=G===F.length-1?new Se(0,0):re.sub(pe)._unit()._perp(),ie=D._add(Z)._unit(),xe=ie.x*Z.x+ie.y*Z.y;xe!==0&&ie._mult(1/xe),j.push(ie._mult(E)._add(pe))}z.push(j)}return z}(h,P*g)),function(C,E,z){for(let L=0;L<E.length;L++){const F=E[L];if(C.length>=3){for(let j=0;j<F.length;j++)if(nl(C,F[j]))return!0}if(Nc(C,F,z))return!0}return!1}(v,h,T)}isTileClipped(){return!0}}function ig(s,t){return t>0?t+2*s:s}const Ix=Lr([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Cx=Lr([{name:"a_projected_pos",components:3,type:"Float32"}],4);Lr([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Ex=Lr([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);Lr([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const sg=Lr([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Ax=Lr([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function kx(s,t,i){return s.sections.forEach(a=>{a.text=function(h,m,g){const v=m.layout.get("text-transform").evaluate(g,{});return v==="uppercase"?h=h.toLocaleUpperCase():v==="lowercase"&&(h=h.toLocaleLowerCase()),zs.applyArabicShaping&&(h=zs.applyArabicShaping(h)),h}(a.text,t,i)}),s}Lr([{name:"triangle",components:3,type:"Uint16"}]),Lr([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Lr([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),Lr([{type:"Float32",name:"offsetX"}]),Lr([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Lr([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const Kc={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var ng,vd,ag,Hr=24,xd={};function zx(){return ng||(ng=1,xd.read=function(s,t,i,a,h){var m,g,v=8*h-a-1,T=(1<<v)-1,P=T>>1,C=-7,E=i?h-1:0,z=i?-1:1,L=s[t+E];for(E+=z,m=L&(1<<-C)-1,L>>=-C,C+=v;C>0;m=256*m+s[t+E],E+=z,C-=8);for(g=m&(1<<-C)-1,m>>=-C,C+=a;C>0;g=256*g+s[t+E],E+=z,C-=8);if(m===0)m=1-P;else{if(m===T)return g?NaN:1/0*(L?-1:1);g+=Math.pow(2,a),m-=P}return(L?-1:1)*g*Math.pow(2,m-a)},xd.write=function(s,t,i,a,h,m){var g,v,T,P=8*m-h-1,C=(1<<P)-1,E=C>>1,z=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,L=a?0:m-1,F=a?1:-1,j=t<0||t===0&&1
25/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(v=isNaN(t)?1:0,g=C):(g=Math.floor(Math.log(t)/Math.LN2),t*(T=Math.pow(2,-g))<1&&(g--,T*=2),(t+=g+E>=1?z/T:z*Math.pow(2,1-E))*T>=2&&(g++,T/=2),g+E>=C?(v=0,g=C):g+E>=1?(v=(t*T-1)*Math.pow(2,h),g+=E):(v=t*Math.pow(2,E-1)*Math.pow(2,h),g=0));h>=8;s[i+L]=255&v,L+=F,v/=256,h-=8);for(g=g<<h|v,P+=h;P>0;s[i+L]=255&g,L+=F,g/=256,P-=8);s[i+L-F]|=128*j}),xd}function og(){if(ag)return vd;ag=1,vd=t;var s=zx();function t(D){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(D)?D:new Uint8Array(D||0),this.pos=0,this.type=0,this.length=this.buf.length}t.Varint=0,t.Fixed64=1,t.Bytes=2,t.Fixed32=5;var i=4294967296,a=1/i,h=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function m(D){return D.type===t.Bytes?D.readVarint()+D.pos:D.pos+1}function g(D,Z,ie){return ie?4294967296*Z+(D>>>0):4294967296*(Z>>>0)+(D>>>0)}function v(D,Z,ie){var xe=Z<=16383?1:Z<=2097151?2:Z<=268435455?3:Math.floor(Math.log(Z)/(7*Math.LN2));ie.realloc(xe);for(var Fe=ie.pos-1;Fe>=D;Fe--)ie.buf[Fe+xe]=ie.buf[Fe]}function T(D,Z){for(var ie=0;ie<D.length;ie++)Z.writeVarint(D[ie])}function P(D,Z){for(var ie=0;ie<D.length;ie++)Z.writeSVarint(D[ie])}function C(D,Z){for(var ie=0;ie<D.length;ie++)Z.writeFloat(D[ie])}function E(D,Z){for(var ie=0;ie<D.length;ie++)Z.writeDouble(D[ie])}function z(D,Z){for(var ie=0;ie<D.length;ie++)Z.writeBoolean(D[ie])}function L(D,Z){for(var ie=0;ie<D.length;ie++)Z.writeFixed32(D[ie])}function F(D,Z){for(var ie=0;ie<D.length;ie++)Z.writeSFixed32(D[ie])}function j(D,Z){for(var ie=0;ie<D.length;ie++)Z.writeFixed64(D[ie])}function G(D,Z){for(var ie=0;ie<D.length;ie++)Z.writeSFixed64(D[ie])}function J(D,Z){return(D[Z]|D[Z+1]<<8|D[Z+2]<<16)+16777216*D[Z+3]}function pe(D,Z,ie){D[ie]=Z,D[ie+1]=Z>>>8,D[ie+2]=Z>>>16,D[ie+3]=Z>>>24}function re(D,Z){return(D[Z]|D[Z+1]<<8|D[Z+2]<<16)+(D[Z+3]<<24)}return t.prototype={destroy:function(){this.buf=null},readFields:function(D,Z,ie){for(ie=ie||this.length;this.pos<ie;){var xe=this.readVarint(),Fe=xe>>3,Te=this.pos;this.type=7&xe,D(Fe,Z,this),this.pos===Te&&this.skip(xe)}return Z},readMessage:function(D,Z){return this.readFields(D,Z,this.readVarint()+this.pos)},readFixed32:function(){var D=J(this.buf,this.pos);return this.pos+=4,D},readSFixed32:function(){var D=re(this.buf,this.pos);return this.pos+=4,D},readFixed64:function(){var D=J(this.buf,this.pos)+J(this.buf,this.pos+4)*i;return this.pos+=8,D},readSFixed64:function(){var D=J(this.buf,this.pos)+re(this.buf,this.pos+4)*i;return this.pos+=8,D},readFloat:function(){var D=s.read(this.buf,this.pos,!0,23,4);return this.pos+=4,D},readDouble:function(){var D=s.read(this.buf,this.pos,!0,52,8);return this.pos+=8,D},readVarint:function(D){var Z,ie,xe=this.buf;return Z=127&(ie=xe[this.pos++]),ie<128?Z:(Z|=(127&(ie=xe[this.pos++]))<<7,ie<128?Z:(Z|=(127&(ie=xe[this.pos++]))<<14,ie<128?Z:(Z|=(127&(ie=xe[this.pos++]))<<21,ie<128?Z:function(Fe,Te,Ce){var je,Le,Ne=Ce.buf;if(je=(112&(Le=Ne[Ce.pos++]))>>4,Le<128||(je|=(127&(Le=Ne[Ce.pos++]))<<3,Le<128)||(je|=(127&(Le=Ne[Ce.pos++]))<<10,Le<128)||(je|=(127&(Le=Ne[Ce.pos++]))<<17,Le<128)||(je|=(127&(Le=Ne[Ce.pos++]))<<24,Le<128)||(je|=(1&(Le=Ne[Ce.pos++]))<<31,Le<128))return g(Fe,je,Te);throw new Error("Expected varint not more than 10 bytes")}(Z|=(15&(ie=xe[this.pos]))<<28,D,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var D=this.readVarint();return D%2==1?(D+1)/-2:D/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var D=this.readVarint()+this.pos,Z=this.pos;return this.pos=D,D-Z>=12&&h?function(ie,xe,Fe){return h.decode(ie.subarray(xe,Fe))}(this.buf,Z,D):function(ie,xe,Fe){for(var Te="",Ce=xe;Ce<Fe;){var je,Le,Ne,ke=ie[Ce],it=null,ct=ke>239?4:ke>223?3:ke>191?2:1;if(Ce+ct>Fe)break;ct===1?ke<128&&(it=ke):ct===2?(192&(je=ie[Ce+1]))==128&&(it=(31&ke)<<6|63&je)<=127&&(it=null):ct===3?(Le=ie[Ce+2],(192&(je=ie[Ce+1]))==128&&(192&Le)==128&&((it=(15&ke)<<12|(63&je)<<6|63&Le)<=2047||it>=55296&&it<=57343)&&(it=null)):ct===4&&(Le=ie[Ce+2],Ne=ie[Ce+3],(192&(je=ie[Ce+1]))==128&&(192&Le)==128&&(192&Ne)==128&&((it=(15&ke)<<18|(63&je)<<12|(63&Le)<<6|63&Ne)<=65535||it>=1114112)&&(it=null)),it===null?(it=65533,ct=1):it>65535&&(it-=65536,Te+=String.fromCharCode(it>>>10&1023|55296),it=56320|1023&it),Te+=String.fromCharCode(it),Ce+=ct}return Te}(this.buf,Z,D)},readBytes:function(){var D=this.readVarint()+this.pos,Z=this.buf.subarray(this.pos,D);return this.pos=D,Z}
vendor: 5,763 bytes, line 25
25,readPackedVarint:function(D,Z){if(this.type!==t.Bytes)return D.push(this.readVarint(Z));var ie=m(this);for(D=D||[];this.pos<ie;)D.push(this.readVarint(Z));return D},readPackedSVarint:function(D){if(this.type!==t.Bytes)return D.push(this.readSVarint());var Z=m(this);for(D=D||[];this.pos<Z;)D.push(this.readSVarint());return D},readPackedBoolean:function(D){if(this.type!==t.Bytes)return D.push(this.readBoolean());var Z=m(this);for(D=D||[];this.pos<Z;)D.push(this.readBoolean());return D},readPackedFloat:function(D){if(this.type!==t.Bytes)return D.push(this.readFloat());var Z=m(this);for(D=D||[];this.pos<Z;)D.push(this.readFloat());return D},readPackedDouble:function(D){if(this.type!==t.Bytes)return D.push(this.readDouble());var Z=m(this);for(D=D||[];this.pos<Z;)D.push(this.readDouble());return D},readPackedFixed32:function(D){if(this.type!==t.Bytes)return D.push(this.readFixed32());var Z=m(this);for(D=D||[];this.pos<Z;)D.push(this.readFixed32());return D},readPackedSFixed32:function(D){if(this.type!==t.Bytes)return D.push(this.readSFixed32());var Z=m(this);for(D=D||[];this.pos<Z;)D.push(this.readSFixed32());return D},readPackedFixed64:function(D){if(this.type!==t.Bytes)return D.push(this.readFixed64());var Z=m(this);for(D=D||[];this.pos<Z;)D.push(this.readFixed64());return D},readPackedSFixed64:function(D){if(this.type!==t.Bytes)return D.push(this.readSFixed64());var Z=m(this);for(D=D||[];this.pos<Z;)D.push(this.readSFixed64());return D},skip:function(D){var Z=7&D;if(Z===t.Varint)for(;this.buf[this.pos++]>127;);else if(Z===t.Bytes)this.pos=this.readVarint()+this.pos;else if(Z===t.Fixed32)this.pos+=4;else{if(Z!==t.Fixed64)throw new Error("Unimplemented type: "+Z);this.pos+=8}},writeTag:function(D,Z){this.writeVarint(D<<3|Z)},realloc:function(D){for(var Z=this.length||16;Z<this.pos+D;)Z*=2;if(Z!==this.length){var ie=new Uint8Array(Z);ie.set(this.buf),this.buf=ie,this.length=Z}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(D){this.realloc(4),pe(this.buf,D,this.pos),this.pos+=4},writeSFixed32:function(D){this.realloc(4),pe(this.buf,D,this.pos),this.pos+=4},writeFixed64:function(D){this.realloc(8),pe(this.buf,-1&D,this.pos),pe(this.buf,Math.floor(D*a),this.pos+4),this.pos+=8},writeSFixed64:function(D){this.realloc(8),pe(this.buf,-1&D,this.pos),pe(this.buf,Math.floor(D*a),this.pos+4),this.pos+=8},writeVarint:function(D){(D=+D||0)>268435455||D<0?function(Z,ie){var xe,Fe;if(Z>=0?(xe=Z%4294967296|0,Fe=Z/4294967296|0):(Fe=~(-Z/4294967296),4294967295^(xe=~(-Z%4294967296))?xe=xe+1|0:(xe=0,Fe=Fe+1|0)),Z>=18446744073709552e3||Z<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");ie.realloc(10),function(Te,Ce,je){je.buf[je.pos++]=127&Te|128,Te>>>=7,je.buf[je.pos++]=127&Te|128,Te>>>=7,je.buf[je.pos++]=127&Te|128,Te>>>=7,je.buf[je.pos++]=127&Te|128,je.buf[je.pos]=127&(Te>>>=7)}(xe,0,ie),function(Te,Ce){var je=(7&Te)<<4;Ce.buf[Ce.pos++]|=je|((Te>>>=3)?128:0),Te&&(Ce.buf[Ce.pos++]=127&Te|((Te>>>=7)?128:0),Te&&(Ce.buf[Ce.pos++]=127&Te|((Te>>>=7)?128:0),Te&&(Ce.buf[Ce.pos++]=127&Te|((Te>>>=7)?128:0),Te&&(Ce.buf[Ce.pos++]=127&Te|((Te>>>=7)?128:0),Te&&(Ce.buf[Ce.pos++]=127&Te)))))}(Fe,ie)}(D,this):(this.realloc(4),this.buf[this.pos++]=127&D|(D>127?128:0),D<=127||(this.buf[this.pos++]=127&(D>>>=7)|(D>127?128:0),D<=127||(this.buf[this.pos++]=127&(D>>>=7)|(D>127?128:0),D<=127||(this.buf[this.pos++]=D>>>7&127))))},writeSVarint:function(D){this.writeVarint(D<0?2*-D-1:2*D)},writeBoolean:function(D){this.writeVarint(!!D)},writeString:function(D){D=String(D),this.realloc(4*D.length),this.pos++;var Z=this.pos;this.pos=function(xe,Fe,Te){for(var Ce,je,Le=0;Le<Fe.length;Le++){if((Ce=Fe.charCodeAt(Le))>55295&&Ce<57344){if(!je){Ce>56319||Le+1===Fe.length?(xe[Te++]=239,xe[Te++]=191,xe[Te++]=189):je=Ce;continue}if(Ce<56320){xe[Te++]=239,xe[Te++]=191,xe[Te++]=189,je=Ce;continue}Ce=je-55296<<10|Ce-56320|65536,je=null}else je&&(xe[Te++]=239,xe[Te++]=191,xe[Te++]=189,je=null);Ce<128?xe[Te++]=Ce:(Ce<2048?xe[Te++]=Ce>>6|192:(Ce<65536?xe[Te++]=Ce>>12|224:(xe[Te++]=Ce>>18|240,xe[Te++]=Ce>>12&63|128),xe[Te++]=Ce>>6&63|128),xe[Te++]=63&Ce|128)}return Te}(this.buf,D,this.pos);var ie=this.pos-Z;ie>=128&&v(Z,ie,this),this.pos=Z-1,this.writeVarint(ie),this.pos+=ie},writeFloat:function(D){this.realloc(4),s.write(this.buf,D,this.pos,!0,23,4),this.pos+=4},writeDouble:function(D){this.realloc(8),s.write(this.buf,D,this.pos,!0,52,8),this.pos+=8},writeBytes:function(D){var Z=D.length;this.writeVarint(Z),this.realloc(Z);for(var ie=0;ie<Z;ie++)this.buf[this.pos++]=D[ie]},writeRawMessage:function(D,Z){this.pos++;var ie=this.pos;D(Z,this);var xe=this.pos-ie;xe>=128&&v(ie,xe,this),this.pos=ie-1,this.writeVarint(xe),this.pos+=xe},writeMessage:function(D,Z,ie){this.writeTag(D,t.Bytes),this.writeRawMessage(Z,ie)},writePackedVarint:function(D,Z){Z.length&&this.writeMessage(D,T,Z)},writePackedSVarint:function(D,Z){Z.length&&this.writeMessage(D,P,Z)},writePackedBoolean:function(D,Z){Z.length&&this.writeMessage(D,z,Z)},writePackedFloat:function(D,Z){Z.length&&this.writeMessage(D,C,Z)},writePackedDouble:function(D,Z){Z.length&&this.writeMessage(D,E,Z)},writePackedFixed32:function(D,Z){Z.length&&this.writeMessage(D,L,Z)},writePackedSFixed32:function(D,Z){Z.length&&this.writeMessage(D,F,Z)},writePackedFixed64:function(D,Z){Z.length&&this.writeMessage(D,j,Z)},writePackedSFixed64:function(D,Z){Z.length&&this.writeMessage(D,G,Z)},writeBytesField:function(D,Z){this.writeTag(D,t.Bytes),this.writeBytes(Z)},writeFixed32Field:function(D,Z){this.writeTag(D,t.Fixed32),this.writeFixed32(Z)},writeSFixed32Field:function(D,Z){this.writeTag(D,t.Fixed32),this.writeSFixed32(Z)},writeFixed64Field:function(D,Z){this.writeTag(D,t.Fixed64),this.writeFixed64
vendor: 11,166 bytes, line 25
25(Z)},writeSFixed64Field:function(D,Z){this.writeTag(D,t.Fixed64),this.writeSFixed64(Z)},writeVarintField:function(D,Z){this.writeTag(D,t.Varint),this.writeVarint(Z)},writeSVarintField:function(D,Z){this.writeTag(D,t.Varint),this.writeSVarint(Z)},writeStringField:function(D,Z){this.writeTag(D,t.Bytes),this.writeString(Z)},writeFloatField:function(D,Z){this.writeTag(D,t.Fixed32),this.writeFloat(Z)},writeDoubleField:function(D,Z){this.writeTag(D,t.Fixed64),this.writeDouble(Z)},writeBooleanField:function(D,Z){this.writeVarintField(D,!!Z)}},vd}var bd=B(og());const wd=3;function Rx(s,t,i){s===1&&i.readMessage(Dx,t)}function Dx(s,t,i){if(s===3){const{id:a,bitmap:h,width:m,height:g,left:v,top:T,advance:P}=i.readMessage(Lx,{});t.push({id:a,bitmap:new Vc({width:m+2*wd,height:g+2*wd},h),metrics:{width:m,height:g,left:v,top:T,advance:P}})}}function Lx(s,t,i){s===1?t.id=i.readVarint():s===2?t.bitmap=i.readBytes():s===3?t.width=i.readVarint():s===4?t.height=i.readVarint():s===5?t.left=i.readSVarint():s===6?t.top=i.readSVarint():s===7&&(t.advance=i.readVarint())}const Fx=wd;function lg(s){let t=0,i=0;for(const g of s)t+=g.w*g.h,i=Math.max(i,g.w);s.sort((g,v)=>v.h-g.h);const a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),i),h:1/0}];let h=0,m=0;for(const g of s)for(let v=a.length-1;v>=0;v--){const T=a[v];if(!(g.w>T.w||g.h>T.h)){if(g.x=T.x,g.y=T.y,m=Math.max(m,g.y+g.h),h=Math.max(h,g.x+g.w),g.w===T.w&&g.h===T.h){const P=a.pop();v<a.length&&(a[v]=P)}else g.h===T.h?(T.x+=g.w,T.w-=g.w):g.w===T.w?(T.y+=g.h,T.h-=g.h):(a.push({x:T.x+g.w,y:T.y,w:T.w-g.w,h:g.h}),T.y+=g.h,T.h-=g.h);break}}return{w:h,h:m,fill:t/(h*m)||0}}const Vi=1;class Td{constructor(t,{pixelRatio:i,version:a,stretchX:h,stretchY:m,content:g,textFitWidth:v,textFitHeight:T}){this.paddedRect=t,this.pixelRatio=i,this.stretchX=h,this.stretchY=m,this.content=g,this.version=a,this.textFitWidth=v,this.textFitHeight=T}get tl(){return[this.paddedRect.x+Vi,this.paddedRect.y+Vi]}get br(){return[this.paddedRect.x+this.paddedRect.w-Vi,this.paddedRect.y+this.paddedRect.h-Vi]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2*Vi)/this.pixelRatio,(this.paddedRect.h-2*Vi)/this.pixelRatio]}}class cg{constructor(t,i){const a={},h={};this.haveRenderCallbacks=[];const m=[];this.addImages(t,a,m),this.addImages(i,h,m);const{w:g,h:v}=lg(m),T=new hs({width:g||1,height:v||1});for(const P in t){const C=t[P],E=a[P].paddedRect;hs.copy(C.data,T,{x:0,y:0},{x:E.x+Vi,y:E.y+Vi},C.data)}for(const P in i){const C=i[P],E=h[P].paddedRect,z=E.x+Vi,L=E.y+Vi,F=C.data.width,j=C.data.height;hs.copy(C.data,T,{x:0,y:0},{x:z,y:L},C.data),hs.copy(C.data,T,{x:0,y:j-1},{x:z,y:L-1},{width:F,height:1}),hs.copy(C.data,T,{x:0,y:0},{x:z,y:L+j},{width:F,height:1}),hs.copy(C.data,T,{x:F-1,y:0},{x:z-1,y:L},{width:1,height:j}),hs.copy(C.data,T,{x:0,y:0},{x:z+F,y:L},{width:1,height:j})}this.image=T,this.iconPositions=a,this.patternPositions=h}addImages(t,i,a){for(const h in t){const m=t[h],g={x:0,y:0,w:m.data.width+2*Vi,h:m.data.height+2*Vi};a.push(g),i[h]=new Td(g,m),m.hasRenderCallback&&this.haveRenderCallbacks.push(h)}}patchUpdatedImages(t,i){t.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const a in t.updatedImages)this.patchUpdatedImage(this.iconPositions[a],t.getImage(a),i),this.patchUpdatedImage(this.patternPositions[a],t.getImage(a),i)}patchUpdatedImage(t,i,a){if(!t||!i||t.version===i.version)return;t.version=i.version;const[h,m]=t.tl;a.update(i.data,void 0,{x:h,y:m})}}var aa;Qe("ImagePosition",Td),Qe("ImageAtlas",cg),x.ai=void 0,(aa=x.ai||(x.ai={}))[aa.none=0]="none",aa[aa.horizontal=1]="horizontal",aa[aa.vertical=2]="vertical",aa[aa.horizontalOnly=3]="horizontalOnly";const Fh=-17;class Jc{constructor(){this.scale=1,this.fontStack="",this.imageName=null,this.verticalAlign="bottom"}static forText(t,i,a){const h=new Jc;return h.scale=t||1,h.fontStack=i,h.verticalAlign=a||"bottom",h}static forImage(t,i){const a=new Jc;return a.imageName=t,a.verticalAlign=i||"bottom",a}}class cl{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(t,i){const a=new cl;for(let h=0;h<t.sections.length;h++){const m=t.sections[h];m.image?a.addImageSection(m):a.addTextSection(m,i)}return a}length(){return this.text.length}getSection(t){return this.sections[this.sectionIndex[t]]}getSectionIndex(t){return this.sectionIndex[t]}getCharCode(t){return this.text.charCodeAt(t)}verticalizePunctuation(){this.text=function(t){let i="";for(let a=0;a<t.length;a++){const h=t.charCodeAt(a+1)||null,m=t.charCodeAt(a-1)||null;i+=h&&vh(h)&&!Kc[t[a+1]]||m&&vh(m)&&!Kc[t[a-1]]||!Kc[t[a]]?t[a]:Kc[t[a]]}return i}(this.text)}trim(){let t=0;for(let a=0;a<this.text.length&&Oh[this.text.charCodeAt(a)];a++)t++;let i=this.text.length;for(let a=this.text.length-1;a>=0&&a>=t&&Oh[this.text.charCodeAt(a)];a--)i--;this.text=this.text.substring(t,i),this.sectionIndex=this.sectionIndex.slice(t,i)}substring(t,i){const a=new cl;return a.text=this.text.substring(t,i),a.sectionIndex=this.sectionIndex.slice(t,i),a.sections=this.sections,a}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((t,i)=>Math.max(t,this.sections[i].scale),0)}getMaxImageSize(t){let i=0,a=0;for(let h=0;h<this.length();h++){const m=this.getSection(h);if(m.imageName){const g=t[m.imageName];if(!g)continue;const v=g.displaySize;i=Math.max(i,v[0]),a=Math.max(a,v[1])}}return{maxImageWidth:i,maxImageHeight:a}}addTextSection(t,i){this.text+=t.text,this.sections.push(Jc.forText(t.scale,t.fontStack||i,t.verticalAlign));const a=this.sections.length-1;for(let h=0;h<t.text.length;++h)this.sectionIndex.push(a)}addImageSection(t){const i=t.image?t.image.name:"";if(i.length===0)return void ri("Can't add FormattedSection with an empty image.");const a=this.getNextImageSectionCharCode();a?(this.text+=String.fromCharCode(a),this.sections.push(Jc.forImage(i,t.verticalAlign)),this.sectionIndex.push(this.sections.length-1)):ri("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Bh(s,t,i,a,h,m,g,v,T,P,C,E,z,L,F){const j=cl.fromFeature(s,h);let G;E===x.ai.vertical&&j.verticalizePunctuation();const{processBidirectionalText:J,processStyledBidirectionalText:pe}=zs;if(J&&j.sections.length===1){G=[];const Z=J(j.toString(),Sd(j,P,m,t,a,L));for(const ie of Z){const xe=new cl;xe.text=ie,xe.sections=j.sections;for(let Fe=0;Fe<ie.length;Fe++)xe.sectionIndex.push(0);G.push(xe)}}else if(pe){G=[];const Z=pe(j.text,j.sectionIndex,Sd(j,P,m,t,a,L));for(const ie of Z){const xe=new cl;xe.text=ie[0],xe.sectionIndex=ie[1],xe.sections=j.sections,G.push(xe)}}else G=function(Z,ie){const xe=[],Fe=Z.text;let Te=0;for(const Ce of ie)xe.push(Z.substring(Te,Ce)),Te=Ce;return Te<Fe.length&&xe.push(Z.substring(Te,Fe.length)),xe}(j,Sd(j,P,m,t,a,L));const re=[],D={positionedLines:re,text:j.toString(),top:C[1],bottom:C[1],left:C[0],right:C[0],writingMode:E,iconsInText:!1,verticalizable:!1};return function(Z,ie,xe,Fe,Te,Ce,je,Le,Ne,ke,it,ct){let lt=0,at=0,Bt=0,Sr=0;const Wr=Le==="right"?1:Le==="left"?0:.5,_i=Hr/ct;let ds=0;for(const vr of Te){vr.trim();const Kr=vr.getMaxScale(),oi={positionedGlyphs:[],lineOffset:0};Z.positionedLines[ds]=oi;const li=oi.positionedGlyphs;let Ai=0;if(!vr.length()){at+=Ce,++ds;continue}const fs=jx(Fe,vr,_i);for(let Ui=0;Ui<vr.length();Ui++){const Xr=vr.getSection(Ui),Qr=vr.getSectionIndex(Ui),ei=vr.getCharCode(Ui),Vr=Vx(Ne,it,ei);let lr;if(Xr.imageName){if(Z.iconsInText=!0,Xr.scale=Xr.scale*_i,lr=Ux(Xr,Vr,Kr,fs,Fe),!lr)continue;Ai=Math.max(Ai,lr.imageOffset)}else if(lr=$x(Xr,ei,Vr,fs,ie,xe),!lr)continue;const{rect:Fs,metrics:dl,baselineOffset:Bs}=lr;li.push({glyph:ei,imageName:Xr.imageName,x:lt,y:at+Bs+Fh,vertical:Vr,scale:Xr.scale,fontStack:Xr.fontStack,sectionIndex:Qr,metrics:dl,rect:Fs}),Vr?(Z.verticalizable=!0,lt+=(Xr.imageName?dl.advance:Hr)*Xr.scale+ke):lt+=dl.advance*Xr.scale+ke}li.length!==0&&(Bt=Math.max(lt-ke,Bt),Zx(li,0,li.length-1,Wr)),lt=0,oi.lineOffset=Math.max(Ai,(Kr-1)*Hr);const Jr=Ce*Kr+Ai;at+=Jr,Sr=Math.max(Jr,Sr),++ds}const{horizontalAlign:$i,verticalAlign:ai}=Md(je);(function(vr,Kr,oi,li,Ai,fs,Jr,Ui,Xr){const Qr=(Kr-oi)*Ai;let ei=0;ei=fs!==Jr?-Ui*li-Fh:-li*Xr*Jr+.5*Jr;for(const Vr of vr)for(const lr of Vr.positionedGlyphs)lr.x+=Qr,lr.y+=ei})(Z.positionedLines,Wr,$i,ai,Bt,Sr,Ce,at,Te.length),Z.top+=-ai*at,Z.bottom=Z.top+at,Z.left+=-$i*Bt,Z.right=Z.left+Bt}(D,t,i,a,G,g,v,T,E,P,z,F),!function(Z){for(const ie of Z)if(ie.positionedGlyphs.length!==0)return!1;return!0}(re)&&D}const Oh={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Bx={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},Ox={40:!0};function ug(s,t,i,a,h,m){if(t.imageName){const g=a[t.imageName];return g?g.displaySize[0]*t.scale*Hr/m+h:0}{const g=i[t.fontStack],v=g&&g[s];return v?v.metrics.advance*t.scale+h:0}}function hg(s,t,i,a){const h=Math.pow(s-t,2);return a?s<t?h/2:2*h:h+Math.abs(i)*i}function Nx(s,t,i){let a=0;return s===10&&(a-=1e4),i&&(a+=150),s!==40&&s!==65288||(a+=50),t!==41&&t!==65289||(a+=50),a}function pg(s,t,i,a,h,m){let g=null,v=hg(t,i,h,m);for(const T of a){const P=hg(t-T.x,i,h,m)+T.badness;P<=v&&(g=T,v=P)}return{index:s,x:t,priorBreak:g,badness:v}}function dg(s){return s?dg(s.priorBreak).concat(s.index):[]}function Sd(s,t,i,a,h,m){if(!s)return[];const g=[],v=function(E,z,L,F,j,G){let J=0;for(let pe=0;pe<E.length();pe++){const re=E.getSection(pe);J+=ug(E.getCharCode(pe),re,F,j,z,G)}return J/Math.max(1,Math.ceil(J/L))}(s,t,i,a,h,m),T=s.text.indexOf("​")>=0;let P=0;for(let E=0;E<s.length();E++){const z=s.getSection(E),L=s.getCharCode(E);if(Oh[L]||(P+=ug(L,z,a,h,t,m)),E<s.length()-1){const F=!((C=L)<11904)&&(!!Dt["CJK Compatibility Forms"](C)||!!Dt["CJK Compatibility"](C)||!!Dt["CJK Strokes"](C)||!!Dt["CJK Symbols and Punctuation"](C)||!!Dt["Enclosed CJK Letters and Months"](C)||!!Dt["Halfwidth and Fullwidth Forms"](C)||!!Dt["Ideographic Description Characters"](C)||!!Dt["Vertical Forms"](C)||Xo.test(String.fromCodePoint(C)));(Bx[L]||F||z.imageName||E!==s.length()-2&&Ox[s.getCharCode(E+1)])&&g.push(pg(E+1,P,v,g,Nx(L,s.getCharCode(E+1),F&&T),!1))}}var C;return dg(pg(s.length(),P,v,g,0,!0))}function Md(s){let t=.5,i=.5;switch(s){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(s){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:t,verticalAlign:i}}function jx(s,t,i){const a=t.getMaxScale()*Hr,{maxImageWidth:h,maxImageHeight:m}=t.getMaxImageSize(s),g=Math.max(a,m*i);return{verticalLineContentWidth:Math.max(a,h*i),horizontalLineContentHeight:g}}function fg(s){switch(s){case"top":return 0;case"center":return .5;default:return 1}}function Vx(s,t,i){return!(s===x.ai.horizontal||!t&&!Yo(i)||t&&(Oh[i]||(a=i,new RegExp("\\p{sc=Arab}","u").test(String.fromCodePoint(a)))));var a}function $x(s,t,i,a,h,m){const g=m[s.fontStack],v=function(P,C,E,z){if(P&&P.rect)return P;const L=C[E.fontStack],F=L&&L[z];return F?{rect:null,metrics:F.metrics}:null}(g&&g[t],h,s,t);
vendor: 11,475 bytes, line 25
25if(v===null)return null;let T;if(i)T=a.verticalLineContentWidth-s.scale*Hr;else{const P=fg(s.verticalAlign);T=(a.horizontalLineContentHeight-s.scale*Hr)*P}return{rect:v.rect,metrics:v.metrics,baselineOffset:T}}function Ux(s,t,i,a,h){const m=h[s.imageName];if(!m)return null;const g=m.paddedRect,v=m.displaySize,T={width:v[0],height:v[1],left:Vi,top:-3,advance:t?v[1]:v[0]};let P;if(t)P=a.verticalLineContentWidth-v[1]*s.scale;else{const C=fg(s.verticalAlign);P=(a.horizontalLineContentHeight-v[1]*s.scale)*C}return{rect:g,metrics:T,baselineOffset:P,imageOffset:(t?v[0]:v[1])*s.scale-Hr*i}}function Zx(s,t,i,a){if(a===0)return;const h=s[i],m=(s[i].x+h.metrics.advance*h.scale)*a;for(let g=t;g<=i;g++)s[g].x-=m}function qx(s,t,i){const{horizontalAlign:a,verticalAlign:h}=Md(i),m=t[0]-s.displaySize[0]*a,g=t[1]-s.displaySize[1]*h;return{image:s,top:g,bottom:g+s.displaySize[1],left:m,right:m+s.displaySize[0]}}function mg(s){var t,i;let a=s.left,h=s.top,m=s.right-a,g=s.bottom-h;const v=(t=s.image.textFitWidth)!==null&&t!==void 0?t:"stretchOrShrink",T=(i=s.image.textFitHeight)!==null&&i!==void 0?i:"stretchOrShrink",P=(s.image.content[2]-s.image.content[0])/(s.image.content[3]-s.image.content[1]);if(T==="proportional"){if(v==="stretchOnly"&&m/g<P||v==="proportional"){const C=Math.ceil(g*P);a*=C/m,m=C}}else if(v==="proportional"&&T==="stretchOnly"&&P!==0&&m/g>P){const C=Math.ceil(m/P);h*=C/g,g=C}return{x1:a,y1:h,x2:a+m,y2:h+g}}function gg(s,t,i,a,h,m){const g=s.image;let v;if(g.content){const G=g.content,J=g.pixelRatio||1;v=[G[0]/J,G[1]/J,g.displaySize[0]-G[2]/J,g.displaySize[1]-G[3]/J]}const T=t.left*m,P=t.right*m;let C,E,z,L;i==="width"||i==="both"?(L=h[0]+T-a[3],E=h[0]+P+a[1]):(L=h[0]+(T+P-g.displaySize[0])/2,E=L+g.displaySize[0]);const F=t.top*m,j=t.bottom*m;return i==="height"||i==="both"?(C=h[1]+F-a[0],z=h[1]+j+a[2]):(C=h[1]+(F+j-g.displaySize[1])/2,z=C+g.displaySize[1]),{image:g,top:C,right:E,bottom:z,left:L,collisionPadding:v}}const Qc=255,Ys=128,oa=Qc*Ys;function _g(s,t){const{expression:i}=t;if(i.kind==="constant")return{kind:"constant",layoutSize:i.evaluate(new dr(s+1))};if(i.kind==="source")return{kind:"source"};{const{zoomStops:a,interpolationType:h}=i;let m=0;for(;m<a.length&&a[m]<=s;)m++;m=Math.max(0,m-1);let g=m;for(;g<a.length&&a[g]<s+1;)g++;g=Math.min(a.length-1,g);const v=a[m],T=a[g];return i.kind==="composite"?{kind:"composite",minZoom:v,maxZoom:T,interpolationType:h}:{kind:"camera",minZoom:v,maxZoom:T,minSize:i.evaluate(new dr(v)),maxSize:i.evaluate(new dr(T)),interpolationType:h}}}function Pd(s,t,i){let a="never";const h=s.get(t);return h?a=h:s.get(i)&&(a="always"),a}const Gx=Wc.VectorTileFeature.types,Hx=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Nh(s,t,i,a,h,m,g,v,T,P,C,E,z){const L=v?Math.min(oa,Math.round(v[0])):0,F=v?Math.min(oa,Math.round(v[1])):0;s.emplaceBack(t,i,Math.round(32*a),Math.round(32*h),m,g,(L<<1)+(T?1:0),F,16*P,16*C,256*E,256*z)}function Id(s,t,i){s.emplaceBack(t.x,t.y,i),s.emplaceBack(t.x,t.y,i),s.emplaceBack(t.x,t.y,i),s.emplaceBack(t.x,t.y,i)}function Wx(s){for(const t of s.sections)if(Th(t.text))return!0;return!1}class Cd{constructor(t){this.layoutVertexArray=new ue,this.indexArray=new Ie,this.programConfigurations=t,this.segments=new Xe,this.dynamicLayoutVertexArray=new ve,this.opacityVertexArray=new be,this.hasVisibleVertices=!1,this.placedSymbolArray=new w}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(t,i,a,h){this.isEmpty()||(a&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ix.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,i),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Cx.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,Hx,!0),this.opacityVertexBuffer.itemSize=1),(a||h)&&this.programConfigurations.upload(t))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}Qe("SymbolBuffers",Cd);class Ed{constructor(t,i,a){this.layoutVertexArray=new t,this.layoutAttributes=i,this.indexArray=new a,this.segments=new Xe,this.collisionVertexArray=new Re}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,Ex.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}Qe("CollisionBuffers",Ed);class ul{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(g=>g.id),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[];const i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=_g(this.zoom,i["text-size"]),this.iconSizeData=_g(this.zoom,i["icon-size"]);const a=this.layers[0].layout,h=a.get("symbol-sort-key"),m=a.get("symbol-z-order");this.canOverlap=Pd(a,"text-overlap","text-allow-overlap")!=="never"||Pd(a,"icon-overlap","icon-allow-overlap")!=="never"||a.get("text-ignore-placement")||a.get("icon-ignore-placement"),this.sortFeaturesByKey=m!=="viewport-y"&&!h.isConstant(),this.sortFeaturesByY=(m==="viewport-y"||m==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,a.get("symbol-placement")==="point"&&(this.writingModes=a.get("text-writing-mode").map(g=>x.ai[g])),this.stateDependentLayerIds=this.layers.filter(g=>g.isStateDependent()).map(g=>g.id),this.sourceID=t.sourceID}createArrays(){this.text=new Cd(new yr(this.layers,this.zoom,t=>/^text/.test(t))),this.icon=new Cd(new yr(this.layers,this.zoom,t=>/^icon/.test(t))),this.glyphOffsetArray=new A,this.lineVertexArray=new k,this.symbolInstances=new I,this.textAnchorOffsets=new O}calculateGlyphDependencies(t,i,a,h,m){for(let g=0;g<t.length;g++)if(i[t.charCodeAt(g)]=!0,(a||h)&&m){const v=Kc[t.charAt(g)];v&&(i[v.charCodeAt(0)]=!0)}}populate(t,i,a){const h=this.layers[0],m=h.layout,g=m.get("text-font"),v=m.get("text-field"),T=m.get("icon-image"),P=(v.value.kind!=="constant"||v.value.value instanceof Pr&&!v.value.value.isEmpty()||v.value.value.toString().length>0)&&(g.value.kind!=="constant"||g.value.value.length>0),C=T.value.kind!=="constant"||!!T.value.value||Object.keys(T.parameters).length>0,E=m.get("symbol-sort-key");if(this.features=[],!P&&!C)return;const z=i.iconDependencies,L=i.glyphDependencies,F=i.availableImages,j=new dr(this.zoom);for(const{feature:G,id:J,index:pe,sourceLayerIndex:re}of t){const D=h._featureFilter.needGeometry,Z=In(G,D);if(!h._featureFilter.filter(j,Z,a))continue;let ie,xe;if(D||(Z.geometry=Pn(G)),P){const Te=h.getValueAndResolveTokens("text-field",Z,a,F),Ce=Pr.factory(Te),je=this.hasRTLText=this.hasRTLText||Wx(Ce);(!je||zs.getRTLTextPluginStatus()==="unavailable"||je&&zs.isParsed())&&(ie=kx(Ce,h,Z))}if(C){const Te=h.getValueAndResolveTokens("icon-image",Z,a,F);xe=Te instanceof di?Te:di.fromString(Te)}if(!ie&&!xe)continue;const Fe=this.sortFeaturesByKey?E.evaluate(Z,{},a):void 0;if(this.features.push({id:J,text:ie,icon:xe,index:pe,sourceLayerIndex:re,geometry:Z.geometry,properties:G.properties,type:Gx[G.type],sortKey:Fe}),xe&&(z[xe.name]=!0),ie){const Te=g.evaluate(Z,{},a).join(","),Ce=m.get("text-rotation-alignment")!=="viewport"&&m.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(x.ai.vertical)>=0;for(const je of ie.sections)if(je.image)z[je.image.name]=!0;else{const Le=ta(ie.toString()),Ne=je.fontStack||Te,ke=L[Ne]=L[Ne]||{};this.calculateGlyphDependencies(je.text,ke,Ce,this.allowVerticalPlacement,Le)}}}m.get("symbol-placement")==="line"&&(this.features=function(G){const J={},pe={},re=[];let D=0;function Z(Te){re.push(G[Te]),D++}function ie(Te,Ce,je){const Le=pe[Te];return delete pe[Te],pe[Ce]=Le,re[Le].geometry[0].pop(),re[Le].geometry[0]=re[Le].geometry[0].concat(je[0]),Le}function xe(Te,Ce,je){const Le=J[Ce];return delete J[Ce],J[Te]=Le,re[Le].geometry[0].shift(),re[Le].geometry[0]=je[0].concat(re[Le].geometry[0]),Le}function Fe(Te,Ce,je){const Le=je?Ce[0][Ce[0].length-1]:Ce[0][0];return`${Te}:${Le.x}:${Le.y}`}for(let Te=0;Te<G.length;Te++){const Ce=G[Te],je=Ce.geometry,Le=Ce.text?Ce.text.toString():null;if(!Le){Z(Te);continue}const Ne=Fe(Le,je),ke=Fe(Le,je,!0);if(Ne in pe&&ke in J&&pe[Ne]!==J[ke]){const it=xe(Ne,ke,je),ct=ie(Ne,ke,re[it].geometry);delete J[Ne],delete pe[ke],pe[Fe(Le,re[ct].geometry,!0)]=ct,re[it].geometry=null}else Ne in pe?ie(Ne,ke,je):ke in J?xe(Ne,ke,je):(Z(Te),J[Ne]=D-1,pe[ke]=D-1)}return re.filter(Te=>Te.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((G,J)=>G.sortKey-J.sortKey)}update(t,i,a){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,i,this.layers,a),this.icon.programConfigurations.updatePaintArrays(t,i,this.layers,a))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,i){const a=this.lineVertexArray.length;if(t.segment!==void 0){let h=t.dist(i[t.segment+1]),m=t.dist(i[t.segment]);const g={};for(let v=t.segment+1;v<i.length;v++)g[v]={x:i[v].x,y:i[v].y,tileUnitDistanceFromAnchor:h},v<i.length-1&&(h+=i[v+1].dist(i[v]));for(let v=t.segment||0;v>=0;v--)g[v]={x:i[v].x,y:i[v].y,tileUnitDistanceFromAnchor:m},v>0&&(m+=i[v-1].dist(i[v]));for(let v=0;v<i.length;v++){const T=g[v];this.lineVertexArray.emplaceBack(T.x,T.y,T.tileUnitDistanceFromAnchor)}}return{lineStartIndex:a,lineLength:this.lineVertexArray.length-a}}addSymbols(t,i,a,h,m,g,v,T,P,C,E,z){const L=t.indexArray,F=t.layoutVertexArray,j=t.segments.prepareSegment(4*i.length,F,L,this.canOverlap?g.sortKey:void 0),G=this.glyphOffsetArray.length,J=j.vertexLength,pe=this.allowVerticalPlacement&&v===x.ai.vertical?Math.PI/2:0,re=g.text&&g.text.sections;for(let D=0;D<i.length;D++){const{tl:Z,tr:ie,bl:xe,br:Fe,tex:Te,pixelOffsetTL:Ce,pixelOffsetBR:je,minFontScaleX:Le,minFontScaleY:Ne,glyphOffset:ke,isSDF:it,sectionIndex:ct}=i[D],lt=j.vertexLength,at=ke[1];Nh(F,T.x,T.y,Z.x,at+Z.y,Te.x,Te.y,a,it,Ce.x,Ce.y,Le,Ne),Nh(F,T.x,T.y,ie.x,at+ie.y,Te.x+Te.w,Te.y,a,it,je.x,Ce.y,Le,Ne),Nh(F,T.x,T.y,xe.x,at+xe.y,Te.x,Te.y+Te.h,a,it,Ce.x,je.y,Le,Ne),Nh(F,T.x,T.y,Fe.x,at+Fe.y,Te.x+Te.w,Te.y+Te.h,a,it,je.x,je.y,Le,Ne),Id(t.dynamicLayoutVertexArray,T,pe),L.emplaceBack(lt,lt+2,lt+1),L.emplaceBack(lt+1,lt+2,lt+3),j.vertexLength+=4,j.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(ke[0]),D!==i.length-1&&
vendor: 4,210 bytes, line 25
25ct===i[D+1].sectionIndex||t.programConfigurations.populatePaintArrays(F.length,g,g.index,{},z,re&&re[ct])}t.placedSymbolArray.emplaceBack(T.x,T.y,G,this.glyphOffsetArray.length-G,J,P,C,T.segment,a?a[0]:0,a?a[1]:0,h[0],h[1],v,0,!1,0,E)}_addCollisionDebugVertex(t,i,a,h,m,g){return i.emplaceBack(0,0),t.emplaceBack(a.x,a.y,h,m,Math.round(g.x),Math.round(g.y))}addCollisionDebugVertices(t,i,a,h,m,g,v){const T=m.segments.prepareSegment(4,m.layoutVertexArray,m.indexArray),P=T.vertexLength,C=m.layoutVertexArray,E=m.collisionVertexArray,z=v.anchorX,L=v.anchorY;this._addCollisionDebugVertex(C,E,g,z,L,new Se(t,i)),this._addCollisionDebugVertex(C,E,g,z,L,new Se(a,i)),this._addCollisionDebugVertex(C,E,g,z,L,new Se(a,h)),this._addCollisionDebugVertex(C,E,g,z,L,new Se(t,h)),T.vertexLength+=4;const F=m.indexArray;F.emplaceBack(P,P+1),F.emplaceBack(P+1,P+2),F.emplaceBack(P+2,P+3),F.emplaceBack(P+3,P),T.primitiveLength+=4}addDebugCollisionBoxes(t,i,a,h){for(let m=t;m<i;m++){const g=this.collisionBoxArray.get(m);this.addCollisionDebugVertices(g.x1,g.y1,g.x2,g.y2,h?this.textCollisionBox:this.iconCollisionBox,g.anchorPoint,a)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Ed(Ae,sg.members,Ge),this.iconCollisionBox=new Ed(Ae,sg.members,Ge);for(let t=0;t<this.symbolInstances.length;t++){const i=this.symbolInstances.get(t);this.addDebugCollisionBoxes(i.textBoxStartIndex,i.textBoxEndIndex,i,!0),this.addDebugCollisionBoxes(i.verticalTextBoxStartIndex,i.verticalTextBoxEndIndex,i,!0),this.addDebugCollisionBoxes(i.iconBoxStartIndex,i.iconBoxEndIndex,i,!1),this.addDebugCollisionBoxes(i.verticalIconBoxStartIndex,i.verticalIconBoxEndIndex,i,!1)}}_deserializeCollisionBoxesForSymbol(t,i,a,h,m,g,v,T,P){const C={};for(let E=i;E<a;E++){const z=t.get(E);C.textBox={x1:z.x1,y1:z.y1,x2:z.x2,y2:z.y2,anchorPointX:z.anchorPointX,anchorPointY:z.anchorPointY},C.textFeatureIndex=z.featureIndex;break}for(let E=h;E<m;E++){const z=t.get(E);C.verticalTextBox={x1:z.x1,y1:z.y1,x2:z.x2,y2:z.y2,anchorPointX:z.anchorPointX,anchorPointY:z.anchorPointY},C.verticalTextFeatureIndex=z.featureIndex;break}for(let E=g;E<v;E++){const z=t.get(E);C.iconBox={x1:z.x1,y1:z.y1,x2:z.x2,y2:z.y2,anchorPointX:z.anchorPointX,anchorPointY:z.anchorPointY},C.iconFeatureIndex=z.featureIndex;break}for(let E=T;E<P;E++){const z=t.get(E);C.verticalIconBox={x1:z.x1,y1:z.y1,x2:z.x2,y2:z.y2,anchorPointX:z.anchorPointX,anchorPointY:z.anchorPointY},C.verticalIconFeatureIndex=z.featureIndex;break}return C}deserializeCollisionBoxes(t){this.collisionArrays=[];for(let i=0;i<this.symbolInstances.length;i++){const a=this.symbolInstances.get(i);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,a.textBoxStartIndex,a.textBoxEndIndex,a.verticalTextBoxStartIndex,a.verticalTextBoxEndIndex,a.iconBoxStartIndex,a.iconBoxEndIndex,a.verticalIconBoxStartIndex,a.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(t,i){const a=t.placedSymbolArray.get(i),h=a.vertexStartIndex+4*a.numGlyphs;for(let m=a.vertexStartIndex;m<h;m+=4)t.indexArray.emplaceBack(m,m+2,m+1),t.indexArray.emplaceBack(m+1,m+2,m+3)}getSortedSymbolIndexes(t){if(this.sortedAngle===t&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;const i=Math.sin(t),a=Math.cos(t),h=[],m=[],g=[];for(let v=0;v<this.symbolInstances.length;++v){g.push(v);const T=this.symbolInstances.get(v);h.push(0|Math.round(i*T.anchorX+a*T.anchorY)),m.push(T.featureIndex)}return g.sort((v,T)=>h[v]-h[T]||m[T]-m[v]),g}addToSortKeyRanges(t,i){const a=this.sortKeyRanges[this.sortKeyRanges.length-1];a&&a.sortKey===i?a.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:i,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>
vendor: 5,499 bytes, line 25
251)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const i of this.symbolInstanceIndexes){const a=this.symbolInstances.get(i);this.featureSortOrder.push(a.featureIndex),[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((h,m,g)=>{h>=0&&g.indexOf(h)===m&&this.addIndicesForPlacedSymbol(this.text,h)}),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,a.verticalPlacedTextSymbolIndex),a.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.placedIconSymbolIndex),a.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let yg,vg;Qe("SymbolBucket",ul,{omit:["layers","collisionBoxArray","features","compareText"]}),ul.MAX_GLYPHS=65535,ul.addDynamicAttributes=Id;var Ad={get paint(){return vg=vg||new Ci({"icon-opacity":new mt(H.paint_symbol["icon-opacity"]),"icon-color":new mt(H.paint_symbol["icon-color"]),"icon-halo-color":new mt(H.paint_symbol["icon-halo-color"]),"icon-halo-width":new mt(H.paint_symbol["icon-halo-width"]),"icon-halo-blur":new mt(H.paint_symbol["icon-halo-blur"]),"icon-translate":new ot(H.paint_symbol["icon-translate"]),"icon-translate-anchor":new ot(H.paint_symbol["icon-translate-anchor"]),"text-opacity":new mt(H.paint_symbol["text-opacity"]),"text-color":new mt(H.paint_symbol["text-color"],{runtimeType:At,getOverride:s=>s.textColor,hasOverride:s=>!!s.textColor}),"text-halo-color":new mt(H.paint_symbol["text-halo-color"]),"text-halo-width":new mt(H.paint_symbol["text-halo-width"]),"text-halo-blur":new mt(H.paint_symbol["text-halo-blur"]),"text-translate":new ot(H.paint_symbol["text-translate"]),"text-translate-anchor":new ot(H.paint_symbol["text-translate-anchor"])})},get layout(){return yg=yg||new Ci({"symbol-placement":new ot(H.layout_symbol["symbol-placement"]),"symbol-spacing":new ot(H.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new ot(H.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new mt(H.layout_symbol["symbol-sort-key"]),"symbol-z-order":new ot(H.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new ot(H.layout_symbol["icon-allow-overlap"]),"icon-overlap":new ot(H.layout_symbol["icon-overlap"]),"icon-ignore-placement":new ot(H.layout_symbol["icon-ignore-placement"]),"icon-optional":new ot(H.layout_symbol["icon-optional"]),"icon-rotation-alignment":new ot(H.layout_symbol["icon-rotation-alignment"]),"icon-size":new mt(H.layout_symbol["icon-size"]),"icon-text-fit":new ot(H.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new ot(H.layout_symbol["icon-text-fit-padding"]),"icon-image":new mt(H.layout_symbol["icon-image"]),"icon-rotate":new mt(H.layout_symbol["icon-rotate"]),"icon-padding":new mt(H.layout_symbol["icon-padding"]),"icon-keep-upright":new ot(H.layout_symbol["icon-keep-upright"]),"icon-offset":new mt(H.layout_symbol["icon-offset"]),"icon-anchor":new mt(H.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new ot(H.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new ot(H.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new ot(H.layout_symbol["text-rotation-alignment"]),"text-field":new mt(H.layout_symbol["text-field"]),"text-font":new mt(H.layout_symbol["text-font"]),"text-size":new mt(H.layout_symbol["text-size"]),"text-max-width":new mt(H.layout_symbol["text-max-width"]),"text-line-height":new ot(H.layout_symbol["text-line-height"]),"text-letter-spacing":new mt(H.layout_symbol["text-letter-spacing"]),"text-justify":new mt(H.layout_symbol["text-justify"]),"text-radial-offset":new mt(H.layout_symbol["text-radial-offset"]),"text-variable-anchor":new ot(H.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new mt(H.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new mt(H.layout_symbol["text-anchor"]),"text-max-angle":new ot(H.layout_symbol["text-max-angle"]),"text-writing-mode":new ot(H.layout_symbol["text-writing-mode"]),"text-rotate":new mt(H.layout_symbol["text-rotate"]),"text-padding":new ot(H.layout_symbol["text-padding"]),"text-keep-upright":new ot(H.layout_symbol["text-keep-upright"]),"text-transform":new mt(H.layout_symbol["text-transform"]),"text-offset":new mt(H.layout_symbol["text-offset"]),"text-allow-overlap":new ot(H.layout_symbol["text-allow-overlap"]),"text-overlap":new ot(H.layout_symbol["text-overlap"]),"text-ignore-placement":new ot(H.layout_symbol["text-ignore-placement"]),"text-optional":new ot(H.layout_symbol["text-optional"])})}};class xg{constructor(t){if(t.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:yt,this.defaultValue=t}evaluate(t){if(t.formattedSection){const i=this.defaultValue.property.overrides;if(i&&i.hasOverride(t.formattedSection))return i.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Qe("FormatSectionOverride",xg,{omit:["defaultValue"]});
25class jh extends ws{constructor(t){super(t,Ad)}recalculate(t,i){if(super.recalculate(t,i),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const a=this.layout.get("text-writing-mode");if(a){const h=[];for(const m of a)h.indexOf(m)<0&&h.push(m);this.layout._values["text-writing-mode"]=h}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(t,i,a,h){const m=this.layout.get(t).evaluate(i,{},a,h),g=this._unevaluatedLayout._values[t];return g.isDataDriven()||Bo(g.value)||!m?m:function(v,T){return T.replace(/{([^{}]+)}/g,(P,C)=>v&&C in v?String(v[C]):"")}(i.properties,m)}createBucket(t){return new ul(t)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const t of Ad.paint.overridableProperties){if(!jh.hasPaintOverride(this.layout,t))continue;const i=this.paint.get(t),a=new xg(i),h=new Fo(a,i.property.specification);let m=null;m=i.value.kind==="constant"||i.value.kind==="source"?new Wn("source",h):new No("composite",h,i.value.zoomStops),this.paint._values[t]=new bs(i.property,m,i.parameters)}}_handleOverridablePaintPropertyUpdate(t,i,a){return!(!this.layout||i.isDataDriven()||a.isDataDriven())&&jh.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,i){const a=t.get("text-field"),h=Ad.paint.properties[i];let m=!1;const g=v=>{for(const T of v)if(h.overrides&&h.overrides.hasOverride(T))return void(m=!0)};if(a.value.kind==="constant"&&a.value.value instanceof Pr)g(a.value.value.sections);else if(a.value.kind==="source"){const v=P=>{m||(P instanceof xs&&ar(P.value)===Us?g(P.value.sections):P instanceof Aa?g(P.sections):P.eachChild(v))},T=a.value;T._styleExpression&&v(T._styleExpression.expression)}return m}}let bg;var Xx={get paint(){return bg=bg||new Ci({"background-color":new ot(H.paint_background["background-color"]),"background-pattern":new el(H.paint_background["background-pattern"]),"background-opacity":new ot(H.paint_background["background-opacity"])})}};class Yx extends ws{constructor(t){super(t,Xx)}}let wg;var Kx={get paint(){return wg=wg||new Ci({"raster-opacity":new ot(H.paint_raster["raster-opacity"]),"raster-hue-rotate":new ot(H.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new ot(H.paint_raster["raster-brightness-min"]),"raster-brightness-max":new ot(H.paint_raster["raster-brightness-max"]),"raster-saturation":new ot(H.paint_raster["raster-saturation"]),"raster-contrast":new ot(H.paint_raster["raster-contrast"]),"raster-resampling":new ot(H.paint_raster["raster-resampling"]),"raster-fade-duration":new ot(H.paint_raster["raster-fade-duration"])})}};class Jx extends ws{constructor(t){super(t,Kx)}}class Qx extends ws{constructor(t){super(t,{}),this.onAdd=i=>{this.implementation.onAdd&&this.implementation.onAdd(i,i.painter.context.gl)},this.onRemove=i=>{this.implementation.onRemove&&this.implementation.onRemove(i,i.painter.context.gl)},this.implementation=t}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class e0{constructor(t){this._methodToThrottle=t,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const kd=63710088e-1;class la{constructor(t,i){if(isNaN(t)||isNaN(i))throw new Error(`Invalid LngLat object: (${t}, ${i})`);
vendor: 10,208 bytes, line 25
25if(this.lng=+t,this.lat=+i,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new la(Ii(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){const i=Math.PI/180,a=this.lat*i,h=t.lat*i,m=Math.sin(a)*Math.sin(h)+Math.cos(a)*Math.cos(h)*Math.cos((t.lng-this.lng)*i);return kd*Math.acos(Math.min(m,1))}static convert(t){if(t instanceof la)return t;if(Array.isArray(t)&&(t.length===2||t.length===3))return new la(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&typeof t=="object"&&t!==null)return new la(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}const Tg=2*Math.PI*kd;function Sg(s){return Tg*Math.cos(s*Math.PI/180)}function Mg(s){return(180+s)/360}function Pg(s){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+s*Math.PI/360)))/360}function Ig(s,t){return s/Sg(t)}function zd(s){return 360/Math.PI*Math.atan(Math.exp((180-360*s)*Math.PI/180))-90}function Cg(s,t){return s*Sg(zd(t))}class eu{constructor(t,i,a=0){this.x=+t,this.y=+i,this.z=+a}static fromLngLat(t,i=0){const a=la.convert(t);return new eu(Mg(a.lng),Pg(a.lat),Ig(i,a.lat))}toLngLat(){return new la(360*this.x-180,zd(this.y))}toAltitude(){return Cg(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Tg*(t=zd(this.y),1/Math.cos(t*Math.PI/180));var t}}function Eg(s,t,i){var a=2*Math.PI*6378137/256/Math.pow(2,i);return[s*a-2*Math.PI*6378137/2,t*a-2*Math.PI*6378137/2]}class Rd{constructor(t,i,a){if(!function(h,m,g){return!(h<0||h>25||g<0||g>=Math.pow(2,h)||m<0||m>=Math.pow(2,h))}(t,i,a))throw new Error(`x=${i}, y=${a}, z=${t} outside of bounds. 0<=x<${Math.pow(2,t)}, 0<=y<${Math.pow(2,t)} 0<=z<=25 `);this.z=t,this.x=i,this.y=a,this.key=hl(0,t,t,i,a)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,i,a){const h=(g=this.y,v=this.z,T=Eg(256*(m=this.x),256*(g=Math.pow(2,v)-g-1),v),P=Eg(256*(m+1),256*(g+1),v),T[0]+","+T[1]+","+P[0]+","+P[1]);var m,g,v,T,P;const C=function(E,z,L){let F,j="";for(let G=E;G>0;G--)F=1<<G-1,j+=(z&F?1:0)+(L&F?2:0);return j}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(a==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,i>1?"@2x":"").replace(/{quadkey}/g,C).replace(/{bbox-epsg-3857}/g,h)}isChildOf(t){const i=this.z-t.z;return i>0&&t.x===this.x>>i&&t.y===this.y>>i}getTilePoint(t){const i=Math.pow(2,this.z);return new Se((t.x*i-this.x)*_t,(t.y*i-this.y)*_t)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Ag{constructor(t,i){this.wrap=t,this.canonical=i,this.key=hl(t,i.z,i.z,i.x,i.y)}}class ps{constructor(t,i,a,h,m){if(this.terrainRttPosMatrix32f=null,t<a)throw new Error(`overscaledZ should be >= z; overscaledZ = ${t}; z = ${a}`);this.overscaledZ=t,this.wrap=i,this.canonical=new Rd(a,+h,+m),this.key=hl(i,t,a,h,m)}clone(){return new ps(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const i=this.canonical.z-t;return t>this.canonical.z?new ps(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new ps(t,this.wrap,t,this.canonical.x>>i,this.canonical.y>>i)}calculateScaledKey(t,i){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const a=this.canonical.z-t;return t>this.canonical.z?hl(this.wrap*+i,t,this.canonical.z,this.canonical.x,this.canonical.y):hl(this.wrap*+i,t,t,this.canonical.x>>a,this.canonical.y>>a)}isChildOf(t){if(t.wrap!==this.wrap)return!1;const i=this.canonical.z-t.canonical.z;return t.overscaledZ===0||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>i&&t.canonical.y===this.canonical.y>>i}children(t){if(this.overscaledZ>=t)return[new ps(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const i=this.canonical.z+1,a=2*this.canonical.x,h=2*this.canonical.y;return[new ps(i,this.wrap,i,a,h),new ps(i,this.wrap,i,a+1,h),new ps(i,this.wrap,i,a,h+1),new ps(i,this.wrap,i,a+1,h+1)]}isLessThan(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))}wrapped(){return new ps(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new ps(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Ag(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(t){return this.canonical.getTilePoint(new eu(t.x-this.wrap,t.y))}}function hl(s,t,i,a,h){(s*=2)<0&&(s=-1*s-1);const m=1<<i;return(m*m*s+m*h+a).toString(36)+i.toString(36)+t.toString(36)}Qe("CanonicalTileID",Rd),Qe("OverscaledTileID",ps,{omit:["terrainRttPosMatrix32f"]});class kg{constructor(t,i,a,h=1,m=1,g=1,v=0){if(this.uid=t,i.height!==i.width)throw new RangeError("DEM tiles must be square");if(a&&!["mapbox","terrarium","custom"].includes(a))return void ri(`"${a}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=i.height;const T=this.dim=i.height-2;switch(this.data=new Uint32Array(i.data.buffer),a){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=h,this.greenFactor=m,this.blueFactor=g,this.baseShift=v;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let P=0;P<T;P++)this.data[this._idx(-1,P)]=this.data[this._idx(0,P)],this.data[this._idx(T,P)]=this.data[this._idx(T-1,P)],this.data[this._idx(P,-1)]=this.data[this._idx(P,0)],this.data[this._idx(P,T)]=this.data[this._idx(P,T-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(T,-1)]=this.data[this._idx(T-1,0)],this.data[this._idx(-1,T)]=this.data[this._idx(0,T-1)],this.data[this._idx(T,T)]=this.data[this._idx(T-1,T-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let P=0;P<T;P++)for(let C=0;C<T;C++){const E=this.get(P,C);E>this.max&&(this.max=E),E<this.min&&(this.min=E)}}get(t,i){const a=new Uint8Array(this.data.buffer),h=4*this._idx(t,i);return this.unpack(a[h],a[h+1],a[h+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(t,i){if(t<-1||t>=this.dim+1||i<-1||i>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(i+1)*this.stride+(t+1)}unpack(t,i,a){return t*this.redFactor+i*this.greenFactor+a*this.blueFactor-this.baseShift}getPixels(){return new hs({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(t,i,a){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let h=i*this.dim,m=i*this.dim+this.dim,g=a*this.dim,v=a*this.dim+this.dim;switch(i){case-1:h=m-1;break;case 1:m=h+1}switch(a){case-1:g=v-1;break;case 1:v=g+1}const T=-i*this.dim,P=-a*this.dim;for(let C=g;C<v;C++)for(let E=h;E<m;E++)this.data[this._idx(E,C)]=t.data[this._idx(E+T,C+P)]}}Qe("DEMData",kg);class zg{constructor(t){this._stringToNumber={},this._numberToString=[];for(let i=0;i<t.length;i++){const a=t[i];this._stringToNumber[a]=i,this._numberToString[i]=a}}encode(t){return this._stringToNumber[t]}decode(t){if(t>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${t} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}}class Rg{constructor(t,i,a,h,m){this.type="Feature",this._vectorTileFeature=t,t._z=i,t._x=a,t._y=h,this.properties=t.properties,this.id=m}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(t){this._geometry=t}toJSON(){const t={geometry:this.geometry};for(const i in this)i!=="_geometry"&&i!=="_vectorTileFeature"&&(t[i]=this[i]);return t}}class Dg{constructor(t,i){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Tn(_t,16,0),this.grid3D=new Tn(_t,16,0),this.featureIndexArray=new X,this.promoteId=i}insert(t,i,a,h,m,g){const v=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(a,h,m);const T=g?this.grid3D:this.grid;for(let P=0;P<i.length;P++){const C=i[P],E=[1/0,1/0,-1/0,-1/0];for(let z=0;z<C.length;z++){const L=C[z];E[0]=Math.min(E[0],L.x),E[1]=Math.min(E[1],L.y),E[2]=Math.max(E[2],L.x),E[3]=Math.max(E[3],L.y)}E[0]<_t&&E[1]<_t&&E[2]>=0&&E[3]>=0&&T.insert(v,E[0],E[1],E[2],E[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Wc.VectorTile(new bd(this.rawTileData)).layers,this.sourceLayerCoder=new zg(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(t,i,a,h){this.loadVTLayers();const m=t.params,g=_t/t.tileSize/t.scale,v=$o(m.filter),T=t.queryGeometry,P=t.queryPadding*g,C=Fg(T),E=this.grid.query(C.minX-P,C.minY-P,C.maxX+P,C.maxY+P),z=Fg(t.cameraQueryGeometry),L=this.grid3D.query(z.minX-P,z.minY-P,z.maxX+P,z.maxY+P,(G,J,pe,re)=>function(D,Z,ie,xe,Fe){for(const Ce of D)if(Z<=Ce.x&&ie<=Ce.y&&xe>=Ce.x&&Fe>=Ce.y)return!0;const Te=[new Se(Z,ie),new Se(Z,Fe),new Se(xe,Fe),new Se(xe,ie)];if(D.length>2){for(const Ce of Te)if(nl(D,Ce))return!0}for(let Ce=0;Ce<D.length-1;Ce++)if(Uv(D[Ce],D[Ce+1],Te))return!0;return!1}(t.cameraQueryGeometry,G-P,J-P,pe+P,re+P));for(const G of L)E.push(G);E.sort(t0);const F={};let j;for(let G=0;G<E.length;G++){const J=E[G];if(J===j)continue;j=J;const pe=this.featureIndexArray.get(J);let re=null;
vendor: 4,989 bytes, line 25
25this.loadMatchingFeature(F,pe.bucketIndex,pe.sourceLayerIndex,pe.featureIndex,v,m.layers,m.availableImages,i,a,h,(D,Z,ie)=>(re||(re=Pn(D)),Z.queryIntersectsFeature({queryGeometry:T,feature:D,featureState:ie,geometry:re,zoom:this.z,transform:t.transform,pixelsToTileUnits:g,pixelPosMatrix:t.pixelPosMatrix})))}return F}loadMatchingFeature(t,i,a,h,m,g,v,T,P,C,E){const z=this.bucketLayerIDs[i];if(g&&!z.some(G=>g.has(G)))return;const L=this.sourceLayerCoder.decode(a),F=this.vtLayers[L].feature(h);if(m.needGeometry){const G=In(F,!0);if(!m.filter(new dr(this.tileID.overscaledZ),G,this.tileID.canonical))return}else if(!m.filter(new dr(this.tileID.overscaledZ),F))return;const j=this.getId(F,L);for(let G=0;G<z.length;G++){const J=z[G];if(g&&!g.has(J))continue;const pe=T[J];if(!pe)continue;let re={};j&&C&&(re=C.getState(pe.sourceLayer||"_geojsonTileLayer",j));const D=Ur({},P[J]);D.paint=Lg(D.paint,pe.paint,F,re,v),D.layout=Lg(D.layout,pe.layout,F,re,v);const Z=!E||E(F,pe,re);if(!Z)continue;const ie=new Rg(F,this.z,this.x,this.y,j);ie.layer=D;let xe=t[J];xe===void 0&&(xe=t[J]=[]),xe.push({featureIndex:h,feature:ie,intersectionZ:Z})}}lookupSymbolFeatures(t,i,a,h,m,g,v,T){const P={};this.loadVTLayers();const C=$o(m);for(const E of t)this.loadMatchingFeature(P,a,h,E,C,g,v,T,i);return P}hasLayer(t){for(const i of this.bucketLayerIDs)for(const a of i)if(t===a)return!0;return!1}getId(t,i){var a;let h=t.id;return this.promoteId&&(h=t.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[i]],typeof h=="boolean"&&(h=Number(h)),h===void 0&&!((a=t.properties)===null||a===void 0)&&a.cluster&&this.promoteId&&(h=Number(t.properties.cluster_id))),h}}function Lg(s,t,i,a,h){return Xi(s,(m,g)=>{const v=t instanceof ra?t.get(g):null;return v&&v.evaluate?v.evaluate(i,a,h):v})}function Fg(s){let t=1/0,i=1/0,a=-1/0,h=-1/0;for(const m of s)t=Math.min(t,m.x),i=Math.min(i,m.y),a=Math.max(a,m.x),h=Math.max(h,m.y);return{minX:t,minY:i,maxX:a,maxY:h}}function t0(s,t){return t-s}function Bg(s,t,i,a,h){const m=[];for(let g=0;g<s.length;g++){const v=s[g];let T;for(let P=0;P<v.length-1;P++){let C=v[P],E=v[P+1];C.x<t&&E.x<t||(C.x<t?C=new Se(t,C.y+(t-C.x)/(E.x-C.x)*(E.y-C.y))._round():E.x<t&&(E=new Se(t,C.y+(t-C.x)/(E.x-C.x)*(E.y-C.y))._round()),C.y<i&&E.y<i||(C.y<i?C=new Se(C.x+(i-C.y)/(E.y-C.y)*(E.x-C.x),i)._round():E.y<i&&(E=new Se(C.x+(i-C.y)/(E.y-C.y)*(E.x-C.x),i)._round()),C.x>=a&&E.x>=a||(C.x>=a?C=new Se(a,C.y+(a-C.x)/(E.x-C.x)*(E.y-C.y))._round():E.x>=a&&(E=new Se(a,C.y+(a-C.x)/(E.x-C.x)*(E.y-C.y))._round()),C.y>=h&&E.y>=h||(C.y>=h?C=new Se(C.x+(h-C.y)/(E.y-C.y)*(E.x-C.x),h)._round():E.y>=h&&(E=new Se(C.x+(h-C.y)/(E.y-C.y)*(E.x-C.x),h)._round()),T&&C.equals(T[T.length-1])||(T=[C],m.push(T)),T.push(E)))))}}return m}Qe("FeatureIndex",Dg,{omit:["rawTileData","sourceLayerCoder"]});class ca extends Se{constructor(t,i,a,h){super(t,i),this.angle=a,h!==void 0&&(this.segment=h)}clone(){return new ca(this.x,this.y,this.angle,this.segment)}}function Og(s,t,i,a,h){if(t.segment===void 0||i===0)return!0;let m=t,g=t.segment+1,v=0;for(;v>-i/2;){if(g--,g<0)return!1;v-=s[g].dist(m),m=s[g]}v+=s[g].dist(s[g+1]),g++;const T=[];let P=0;for(;v<i/2;){const C=s[g],E=s[g+1];if(!E)return!1;let z=s[g-1].angleTo(C)-C.angleTo(E);for(z=Math.abs((z+3*Math.PI)%(2*Math.PI)-Math.PI),T.push({distance:v,angleDelta:z}),P+=z;v-T[0].distance>a;)P-=T.shift().angleDelta;if(P>h)return!1;g++,v+=C.dist(E)}return!0}function Ng(s){let t=0;for(let i=0;i<s.length-1;i++)t+=s[i].dist(s[i+1]);return t}function jg(s,t,i){return s?.6*t*i:0}function Vg(s,t){return Math.max(s?s.right-s.left:0,t?t.right-t.left:0)}function r0(s,t,i,a,h,m){const g=jg(i,h,m),v=Vg(i,a)*m;let T=0;const P=Ng(s)/2;for(let C=0;C<s.length-1;C++){const E=s[C],z=s[C+1],L=E.dist(z);if(T+L>P){const F=(P-T)/L,j=cs.number(E.x,z.x,F),G=cs.number(E.y,z.y,F),J=new ca(j,G,z.angleTo(E),C);return J._round(),!g||Og(s,J,v,g,t)?J:void 0}T+=L}}function i0(s,t,i,a,h,m,g,v,T){const P=jg(a,m,g),C=Vg(a,h),E=C*g,z=s[0].x===0||s[0].x===T||s[0].y===0||s[0].y===T;return t-E<t/4&&(t=E+t/4),$g(s,z?t/2*v%t:(C/2+2*m)*g*v%t,t,P,i,E,z,!1,T)}function $g(s,t,i,a,h,m,g,v,T){const P=m/2,C=Ng(s);let E=0,z=t-i,L=[];for(let F=0;F<s.length-1;F++){const j=s[F],G=s[F+1],J=j.dist(G),pe=G.angleTo(j);for(;z+i<E+J;){z+=i;const re=(z-E)/J,D=cs.number(j.x,G.x,re),Z=cs.number(j.y,G.y,re);if(D>=0&&D<T&&Z>=0&&Z<T&&z-P>=0&&z+P<=C){const ie=new ca(D,Z,pe,F);ie._round(),a&&!Og(s,ie,m,a,h)||L.push(ie)}}E+=J}return v||L.length||g||(L=$g(s,E/2,i,a,h,m,g,!0,T)),L}Qe("Anchor",ca);const tu=Vi;function Ug(s,t,i,a){const h=[],m=s.image,g=m.pixelRatio,v=m.paddedRect.w-2*tu,T=m.paddedRect.h-2*tu;let P={x1:s.left,y1:s.top,x2:s.right,y2:s.bottom};const C=m.stretchX||[[0,v]],E=m.stretchY||[[0,T]],z=(ke,it)=>ke+it[1]-it[0],L=C.reduce(z,0),F=E.reduce(z,0),j=v-L,G=T-F;let J=0,pe=L,re=0,D=F,Z=0,ie=j,xe=0,Fe=G;if(m.content&&a){const ke=m.content,it=ke[2]-ke[0],ct=ke[3]-ke[1];(m.textFitWidth||m.textFitHeight)&&(P=mg(s)),J=Vh(C,0,ke[0]),re=Vh(E,0,ke[1]),pe=Vh(C,ke[0],
vendor: 7,646 bytes, line 25
25ke[2]),D=Vh(E,ke[1],ke[3]),Z=ke[0]-J,xe=ke[1]-re,ie=it-pe,Fe=ct-D}const Te=P.x1,Ce=P.y1,je=P.x2-Te,Le=P.y2-Ce,Ne=(ke,it,ct,lt)=>{const at=$h(ke.stretch-J,pe,je,Te),Bt=Uh(ke.fixed-Z,ie,ke.stretch,L),Sr=$h(it.stretch-re,D,Le,Ce),Wr=Uh(it.fixed-xe,Fe,it.stretch,F),_i=$h(ct.stretch-J,pe,je,Te),ds=Uh(ct.fixed-Z,ie,ct.stretch,L),$i=$h(lt.stretch-re,D,Le,Ce),ai=Uh(lt.fixed-xe,Fe,lt.stretch,F),vr=new Se(at,Sr),Kr=new Se(_i,Sr),oi=new Se(_i,$i),li=new Se(at,$i),Ai=new Se(Bt/g,Wr/g),fs=new Se(ds/g,ai/g),Jr=t*Math.PI/180;if(Jr){const Qr=Math.sin(Jr),ei=Math.cos(Jr),Vr=[ei,-Qr,Qr,ei];vr._matMult(Vr),Kr._matMult(Vr),li._matMult(Vr),oi._matMult(Vr)}const Ui=ke.stretch+ke.fixed,Xr=it.stretch+it.fixed;return{tl:vr,tr:Kr,bl:li,br:oi,tex:{x:m.paddedRect.x+tu+Ui,y:m.paddedRect.y+tu+Xr,w:ct.stretch+ct.fixed-Ui,h:lt.stretch+lt.fixed-Xr},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Ai,pixelOffsetBR:fs,minFontScaleX:ie/g/je,minFontScaleY:Fe/g/Le,isSDF:i}};if(a&&(m.stretchX||m.stretchY)){const ke=Zg(C,j,L),it=Zg(E,G,F);for(let ct=0;ct<ke.length-1;ct++){const lt=ke[ct],at=ke[ct+1];for(let Bt=0;Bt<it.length-1;Bt++)h.push(Ne(lt,it[Bt],at,it[Bt+1]))}}else h.push(Ne({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:v+1},{fixed:0,stretch:T+1}));return h}function Vh(s,t,i){let a=0;for(const h of s)a+=Math.max(t,Math.min(i,h[1]))-Math.max(t,Math.min(i,h[0]));return a}function Zg(s,t,i){const a=[{fixed:-1,stretch:0}];for(const[h,m]of s){const g=a[a.length-1];a.push({fixed:h-g.stretch,stretch:g.stretch}),a.push({fixed:h-g.stretch,stretch:g.stretch+(m-h)})}return a.push({fixed:t+tu,stretch:i}),a}function $h(s,t,i,a){return s/t*i+a}function Uh(s,t,i,a){return s-t*i/a}class Zh{constructor(t,i,a,h,m,g,v,T,P,C){var E;if(this.boxStartIndex=t.length,P){let z=g.top,L=g.bottom;const F=g.collisionPadding;F&&(z-=F[1],L+=F[3]);let j=L-z;j>0&&(j=Math.max(10,j),this.circleDiameter=j)}else{const z=!((E=g.image)===null||E===void 0)&&E.content&&(g.image.textFitWidth||g.image.textFitHeight)?mg(g):{x1:g.left,y1:g.top,x2:g.right,y2:g.bottom};z.y1=z.y1*v-T[0],z.y2=z.y2*v+T[2],z.x1=z.x1*v-T[3],z.x2=z.x2*v+T[1];const L=g.collisionPadding;if(L&&(z.x1-=L[0]*v,z.y1-=L[1]*v,z.x2+=L[2]*v,z.y2+=L[3]*v),C){const F=new Se(z.x1,z.y1),j=new Se(z.x2,z.y1),G=new Se(z.x1,z.y2),J=new Se(z.x2,z.y2),pe=C*Math.PI/180;F._rotate(pe),j._rotate(pe),G._rotate(pe),J._rotate(pe),z.x1=Math.min(F.x,j.x,G.x,J.x),z.x2=Math.max(F.x,j.x,G.x,J.x),z.y1=Math.min(F.y,j.y,G.y,J.y),z.y2=Math.max(F.y,j.y,G.y,J.y)}t.emplaceBack(i.x,i.y,z.x1,z.y1,z.x2,z.y2,a,h,m)}this.boxEndIndex=t.length}}class s0{constructor(t=[],i=(a,h)=>a<h?-1:a>h?1:0){if(this.data=t,this.length=this.data.length,this.compare=i,this.length>0)for(let a=(this.length>>1)-1;a>=0;a--)this._down(a)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;const t=this.data[0],i=this.data.pop();return--this.length>0&&(this.data[0]=i,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:i,compare:a}=this,h=i[t];for(;t>0;){const m=t-1>>1,g=i[m];if(a(h,g)>=0)break;i[t]=g,t=m}i[t]=h}_down(t){const{data:i,compare:a}=this,h=this.length>>1,m=i[t];for(;t<h;){let g=1+(t<<1);const v=g+1;if(v<this.length&&a(i[v],i[g])<0&&(g=v),a(i[g],m)>=0)break;i[t]=i[g],t=g}i[t]=m}}function n0(s,t=1,i=!1){let a=1/0,h=1/0,m=-1/0,g=-1/0;const v=s[0];for(let L=0;L<v.length;L++){const F=v[L];(!L||F.x<a)&&(a=F.x),(!L||F.y<h)&&(h=F.y),(!L||F.x>m)&&(m=F.x),(!L||F.y>g)&&(g=F.y)}const T=Math.min(m-a,g-h);let P=T/2;const C=new s0([],a0);if(T===0)return new Se(a,h);for(let L=a;L<m;L+=T)for(let F=h;F<g;F+=T)C.push(new pl(L+P,F+P,P,s));let E=function(L){let F=0,j=0,G=0;const J=L[0];for(let pe=0,re=J.length,D=re-1;pe<re;D=pe++){const Z=J[pe],ie=J[D],xe=Z.x*ie.y-ie.x*Z.y;j+=(Z.x+ie.x)*xe,G+=(Z.y+ie.y)*xe,F+=3*xe}return new pl(j/F,G/F,0,L)}(s),z=C.length;for(;C.length;){const L=C.pop();(L.d>E.d||!E.d)&&(E=L,i&&console.log("found best %d after %d probes",Math.round(1e4*L.d)/1e4,z)),L.max-E.d<=t||(P=L.h/2,C.push(new pl(L.p.x-P,L.p.y-P,P,s)),C.push(new pl(L.p.x+P,L.p.y-P,P,s)),C.push(new pl(L.p.x-P,L.p.y+P,P,s)),C.push(new pl(L.p.x+P,L.p.y+P,P,s)),z+=4)}return i&&(console.log(`num probes: ${z}`),console.log(`best distance: ${E.d}`)),E.p}function a0(s,t){return t.max-s.max}function pl(s,t,i,a){this.p=new Se(s,t),this.h=i,this.d=function(h,m){let g=!1,v=1/0;for(let T=0;T<m.length;T++){const P=m[T];for(let C=0,E=P.length,z=E-1;C<E;z=C++){const L=P[C],F=P[z];L.y>h.y!=F.y>h.y&&h.x<(F.x-L.x)*(h.y-L.y)/(F.y-L.y)+L.x&&(g=!g),v=Math.min(v,Sm(h,L,F))}}return(g?1:-1)*Math.sqrt(v)}(this.p,a),this.max=this.d+this.h*Math.SQRT2}var gi;x.av=void 0,(gi=x.av||(x.av={}))[gi.center=1]="center",gi[gi.left=2]="left",gi[gi.right=3]="right",gi[gi.top=4]="top",gi[gi.bottom=5]="bottom",gi[gi["top-left"]=6]="top-left",gi[gi["top-right"]=7]="top-right",gi[gi["bottom-left"]=8]="bottom-left",gi[gi["bottom-right"]=9]="bottom-right";const ua=7,Dd=Number.POSITIVE_INFINITY;function qg(s,t){return t[1]!==Dd?function(i,a,h){let m=0,g=0;switch(a=Math.abs(a),h=Math.abs(h),i){case"top-right":case"top-left":case"top":g=h-ua;break;case"bottom-right":case"bottom-left":case"bottom":g=-h+ua}switch(i){case"top-right":case"bottom-right":case"right":m=-a;break;case"top-left":case"bottom-left":case"left":m=a}return[m,g]}(s,t[0],t[1]):function(i,a){let h=0,m=0;a<0&&(a=0);const g=a/Math.SQRT2;switch(i){case"top-right":case"top-left":m=g-ua;break;case"bottom-right":case"bottom-left":m=-g+ua;break;case"bottom":m=-a+ua;break;case"top":m=a-ua}switch(i){case"top-right":case"bottom-right":h=-g;break;case"top-left":case"bottom-left":h=g;break;case"left":h=a;break;case"right":h=-a}return[h,m]}(s,t[0])}function Gg(s,t,i){var a;const h=s.layout,m=(a=h.get("text-variable-anchor-offset"))===null||a===void 0?void 0:a.evaluate(t,{},i);if(m){const v=m.values,T=[];for(let P=0;P<v.length;P+=2){const C=T[P]=v[P],E=v[P+1].map(z=>z*Hr);C.startsWith("top")?E[1]-=ua:C.startsWith("bottom")&&(E[1]+=ua),T[P+1]=E}return new pi(T)}const g=h.get("text-variable-anchor");if(g){let v;v=s._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[h.get("text-radial-offset").evaluate(t,{},i)*Hr,Dd]:h.get("text-offset").evaluate(t,{},i).map(P=>P*Hr);const T=[];for(const P of g)T.push(P,qg(P,v));return new pi(T)}return null}function Ld(s){switch(s){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function o0(s,t,i,a,h,m,g,v,T,P,C,E){let z=m.textMaxSize.evaluate(t,{});z===void 0&&(z=g);const L=s.layers[0].layout,F=L.get("icon-offset").evaluate(t,{},C),j=Wg(i.horizontal),G=g/24,J=s.tilePixelRatio*G,pe=s.tilePixelRatio*z/24,re=s.tilePixelRatio*v,D=s.tilePixelRatio*L.get("symbol-spacing"),Z=L.get("text-padding")*s.tilePixelRatio,ie=function(ct,lt,at,Bt=1){const Sr=ct.get("icon-padding").evaluate(lt,{},at),Wr=Sr&&Sr.values;return[Wr[0]*Bt,Wr[1]*Bt,Wr[2]*Bt,Wr[3]*Bt]}(L,t,C,s.tilePixelRatio),xe=L.get("text-max-angle")/180*Math.PI,Fe=L.get("text-rotation-alignment")!=="viewport"&&L.get("symbol-placement")!=="point",Te=L.get("icon-rotation-alignment")==="map"&&L.get("symbol-placement")!=="point",Ce=L.get("symbol-placement"),je=D/2,Le=L.get("icon-text-fit");let Ne;a&&Le!=="none"&&(s.allowVerticalPlacement&&i.vertical&&(Ne=gg(a,i.vertical,Le,L.get("icon-text-fit-padding"),F,G)),j&&(a=gg(a,j,Le,L.get("icon-text-fit-padding"),F,G)));const ke=C?E.line.getGranularityForZoomLevel(C.z):1,it=(ct,lt)=>{lt.x<0||lt.x>=_t||lt.y<0||lt.y>=_t||function(at,Bt,Sr,Wr,_i,ds,$i,ai,vr,Kr,oi,li,Ai,fs,Jr,Ui,Xr,Qr,ei,Vr,lr,Fs,dl,Bs,u0){const fl=at.addToLineVertexArray(Bt,Sr);let Qa,ml,gl,_l,Jg=0,Qg=0,e_=0,t_=0,Ud=-1,Zd=-1;const Cn={};let r_=Fr("");
vendor: 16,377 bytes, line 25
25if(at.allowVerticalPlacement&&Wr.vertical){const bi=ai.layout.get("text-rotate").evaluate(lr,{},Bs)+90;gl=new Zh(vr,Bt,Kr,oi,li,Wr.vertical,Ai,fs,Jr,bi),$i&&(_l=new Zh(vr,Bt,Kr,oi,li,$i,Xr,Qr,Jr,bi))}if(_i){const bi=ai.layout.get("icon-rotate").evaluate(lr,{}),rs=ai.layout.get("icon-text-fit")!=="none",eo=Ug(_i,bi,dl,rs),Ss=$i?Ug($i,bi,dl,rs):void 0;ml=new Zh(vr,Bt,Kr,oi,li,_i,Xr,Qr,!1,bi),Jg=4*eo.length;const to=at.iconSizeData;let Ks=null;to.kind==="source"?(Ks=[Ys*ai.layout.get("icon-size").evaluate(lr,{})],Ks[0]>oa&&ri(`${at.layerIds[0]}: Value for "icon-size" is >= ${Qc}. Reduce your "icon-size".`)):to.kind==="composite"&&(Ks=[Ys*Fs.compositeIconSizes[0].evaluate(lr,{},Bs),Ys*Fs.compositeIconSizes[1].evaluate(lr,{},Bs)],(Ks[0]>oa||Ks[1]>oa)&&ri(`${at.layerIds[0]}: Value for "icon-size" is >= ${Qc}. Reduce your "icon-size".`)),at.addSymbols(at.icon,eo,Ks,Vr,ei,lr,x.ai.none,Bt,fl.lineStartIndex,fl.lineLength,-1,Bs),Ud=at.icon.placedSymbolArray.length-1,Ss&&(Qg=4*Ss.length,at.addSymbols(at.icon,Ss,Ks,Vr,ei,lr,x.ai.vertical,Bt,fl.lineStartIndex,fl.lineLength,-1,Bs),Zd=at.icon.placedSymbolArray.length-1)}const i_=Object.keys(Wr.horizontal);for(const bi of i_){const rs=Wr.horizontal[bi];if(!Qa){r_=Fr(rs.text);const Ss=ai.layout.get("text-rotate").evaluate(lr,{},Bs);Qa=new Zh(vr,Bt,Kr,oi,li,rs,Ai,fs,Jr,Ss)}const eo=rs.positionedLines.length===1;if(e_+=Hg(at,Bt,rs,ds,ai,Jr,lr,Ui,fl,Wr.vertical?x.ai.horizontal:x.ai.horizontalOnly,eo?i_:[bi],Cn,Ud,Fs,Bs),eo)break}Wr.vertical&&(t_+=Hg(at,Bt,Wr.vertical,ds,ai,Jr,lr,Ui,fl,x.ai.vertical,["vertical"],Cn,Zd,Fs,Bs));const h0=Qa?Qa.boxStartIndex:at.collisionBoxArray.length,p0=Qa?Qa.boxEndIndex:at.collisionBoxArray.length,d0=gl?gl.boxStartIndex:at.collisionBoxArray.length,f0=gl?gl.boxEndIndex:at.collisionBoxArray.length,m0=ml?ml.boxStartIndex:at.collisionBoxArray.length,g0=ml?ml.boxEndIndex:at.collisionBoxArray.length,_0=_l?_l.boxStartIndex:at.collisionBoxArray.length,y0=_l?_l.boxEndIndex:at.collisionBoxArray.length;let Os=-1;const Gh=(bi,rs)=>bi&&bi.circleDiameter?Math.max(bi.circleDiameter,rs):rs;Os=Gh(Qa,Os),Os=Gh(gl,Os),Os=Gh(ml,Os),Os=Gh(_l,Os);const s_=Os>-1?1:0;s_&&(Os*=u0/Hr),at.glyphOffsetArray.length>=ul.MAX_GLYPHS&&ri("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),lr.sortKey!==void 0&&at.addToSortKeyRanges(at.symbolInstances.length,lr.sortKey);const v0=Gg(ai,lr,Bs),[x0,b0]=function(bi,rs){const eo=bi.length,Ss=rs==null?void 0:rs.values;if((Ss==null?void 0:Ss.length)>0)for(let to=0;to<Ss.length;to+=2){const Ks=Ss[to+1];bi.emplaceBack(x.av[Ss[to]],Ks[0],Ks[1])}return[eo,bi.length]}(at.textAnchorOffsets,v0);at.symbolInstances.emplaceBack(Bt.x,Bt.y,Cn.right>=0?Cn.right:-1,Cn.center>=0?Cn.center:-1,Cn.left>=0?Cn.left:-1,Cn.vertical||-1,Ud,Zd,r_,h0,p0,d0,f0,m0,g0,_0,y0,Kr,e_,t_,Jg,Qg,s_,0,Ai,Os,x0,b0)}(s,lt,ct,i,a,h,Ne,s.layers[0],s.collisionBoxArray,t.index,t.sourceLayerIndex,s.index,J,[Z,Z,Z,Z],Fe,T,re,ie,Te,F,t,m,P,C,g)};if(Ce==="line")for(const ct of Bg(t.geometry,0,0,_t,_t)){const lt=Ja(ct,ke),at=i0(lt,D,xe,i.vertical||j,a,24,pe,s.overscaling,_t);for(const Bt of at)j&&l0(s,j.text,je,Bt)||it(lt,Bt)}else if(Ce==="line-center"){for(const ct of t.geometry)if(ct.length>1){const lt=Ja(ct,ke),at=r0(lt,xe,i.vertical||j,a,24,pe);at&&it(lt,at)}}else if(t.type==="Polygon")for(const ct of Io(t.geometry,0)){const lt=n0(ct,16);it(Ja(ct[0],ke,!0),new ca(lt.x,lt.y,0))}else if(t.type==="LineString")for(const ct of t.geometry){const lt=Ja(ct,ke);it(lt,new ca(lt[0].x,lt[0].y,0))}else if(t.type==="Point")for(const ct of t.geometry)for(const lt of ct)it([lt],new ca(lt.x,lt.y,0))}function Hg(s,t,i,a,h,m,g,v,T,P,C,E,z,L,F){const j=function(pe,re,D,Z,ie,xe,Fe,Te){const Ce=Z.layout.get("text-rotate").evaluate(xe,{})*Math.PI/180,je=[];for(const Le of re.positionedLines)for(const Ne of Le.positionedGlyphs){if(!Ne.rect)continue;const ke=Ne.rect||{};let it=Fx+1,ct=!0,lt=1,at=0;const Bt=(ie||Te)&&Ne.vertical,Sr=Ne.metrics.advance*Ne.scale/2;if(Te&&re.verticalizable&&(at=Le.lineOffset/2-(Ne.imageName?-(Hr-Ne.metrics.width*Ne.scale)/2:(Ne.scale-1)*Hr)),Ne.imageName){const Qr=Fe[Ne.imageName];ct=Qr.sdf,lt=Qr.pixelRatio,it=Vi/lt}const Wr=ie?[Ne.x+Sr,Ne.y]:[0,0];let _i=ie?[0,0]:[Ne.x+Sr+D[0],Ne.y+D[1]-at],ds=[0,0];Bt&&(ds=_i,_i=[0,0]);const $i=Ne.metrics.isDoubleResolution?2:1,ai=(Ne.metrics.left-it)*Ne.scale-Sr+_i[0],vr=(-Ne.metrics.top-it)*Ne.scale+_i[1],Kr=ai+ke.w/$i*Ne.scale/lt,oi=vr+ke.h/$i*Ne.scale/lt,li=new Se(ai,vr),Ai=new Se(Kr,vr),fs=new Se(ai,oi),Jr=new Se(Kr,oi);if(Bt){const Qr=new Se(-Sr,Sr-Fh),ei=-Math.PI/2,Vr=Hr/2-Sr,lr=new Se(5-Fh-Vr,-(Ne.imageName?Vr:0)),Fs=new Se(...ds);li._rotateAround(ei,Qr)._add(lr)._add(Fs),Ai._rotateAround(ei,Qr)._add(lr)._add(Fs),fs._rotateAround(ei,Qr)._add(lr)._add(Fs),Jr._rotateAround(ei,Qr)._add(lr)._add(Fs)}if(Ce){const Qr=Math.sin(Ce),ei=Math.cos(Ce),Vr=[ei,-Qr,Qr,ei];li._matMult(Vr),Ai._matMult(Vr),fs._matMult(Vr),Jr._matMult(Vr)}const Ui=new Se(0,0),Xr=new Se(0,0);je.push({tl:li,tr:Ai,bl:fs,br:Jr,tex:ke,writingMode:re.writingMode,glyphOffset:Wr,sectionIndex:Ne.sectionIndex,isSDF:ct,pixelOffsetTL:Ui,pixelOffsetBR:Xr,minFontScaleX:0,minFontScaleY:0})}return je}(0,i,v,h,m,g,a,s.allowVerticalPlacement),G=s.textSizeData;let J=null;G.kind==="source"?(J=[Ys*h.layout.get("text-size").evaluate(g,{})],J[0]>oa&&ri(`${s.layerIds[0]}: Value for "text-size" is >= ${Qc}. Reduce your "text-size".`)):G.kind==="composite"&&(J=[Ys*L.compositeTextSizes[0].evaluate(g,{},F),Ys*L.compositeTextSizes[1].evaluate(g,{},F)],(J[0]>oa||J[1]>oa)&&ri(`${s.layerIds[0]}: Value for "text-size" is >= ${Qc}. Reduce your "text-size".`)),s.addSymbols(s.text,j,J,v,m,g,P,t,T.lineStartIndex,T.lineLength,z,F);for(const pe of C)E[pe]=s.text.placedSymbolArray.length-1;return 4*j.length}function Wg(s){for(const t in s)return s[t];return null}function l0(s,t,i,a){const h=s.compareText;if(t in h){const m=h[t];for(let g=m.length-1;g>=0;g--)if(a.dist(m[g])<i)return!0}else h[t]=[];return h[t].push(a),!1}const Xg=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class Fd{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[i,a]=new Uint8Array(t,0,2);if(i!==219)throw new Error("Data does not appear to be in a KDBush format.");const h=a>>4;if(h!==1)throw new Error(`Got v${h} data when expected v1.`);const m=Xg[15&a];if(!m)throw new Error("Unrecognized array type.");const[g]=new Uint16Array(t,2,1),[v]=new Uint32Array(t,4,1);return new Fd(v,g,m,t)}constructor(t,i=64,a=Float64Array,h){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+i,2),65535),this.ArrayType=a,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const m=Xg.indexOf(this.ArrayType),g=2*t*this.ArrayType.BYTES_PER_ELEMENT,v=t*this.IndexArrayType.BYTES_PER_ELEMENT,T=(8-v%8)%8;if(m<0)throw new Error(`Unexpected typed array class: ${a}.`);h&&h instanceof ArrayBuffer?(this.data=h,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+v+T,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+g+v+T),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+v+T,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+m]),new Uint16Array(this.data,2,1)[0]=i,new Uint32Array(this.data,4,1)[0]=t)}add(t,i){const a=this._pos>>1;return this.ids[a]=a,this.coords[this._pos++]=t,this.coords[this._pos++]=i,a}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return Bd(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,i,a,h){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:m,coords:g,nodeSize:v}=this,T=[0,m.length-1,0],P=[];for(;T.length;){const C=T.pop()||0,E=T.pop()||0,z=T.pop()||0;if(E-z<=v){for(let G=z;G<=E;G++){const J=g[2*G],pe=g[2*G+1];J>=t&&J<=a&&pe>=i&&pe<=h&&P.push(m[G])}continue}const L=z+E>>1,F=g[2*L],j=g[2*L+1];F>=t&&F<=a&&j>=i&&j<=h&&P.push(m[L]),(C===0?t<=F:i<=j)&&(T.push(z),T.push(L-1),T.push(1-C)),(C===0?a>=F:h>=j)&&(T.push(L+1),T.push(E),T.push(1-C))}return P}within(t,i,a){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:h,coords:m,nodeSize:g}=this,v=[0,h.length-1,0],T=[],P=a*a;for(;v.length;){const C=v.pop()||0,E=v.pop()||0,z=v.pop()||0;if(E-z<=g){for(let G=z;G<=E;G++)Kg(m[2*G],m[2*G+1],t,i)<=P&&T.push(h[G]);continue}const L=z+E>>1,F=m[2*L],j=m[2*L+1];Kg(F,j,t,i)<=P&&T.push(h[L]),(C===0?t-a<=F:i-a<=j)&&(v.push(z),v.push(L-1),v.push(1-C)),(C===0?t+a>=F:i+a>=j)&&(v.push(L+1),v.push(E),v.push(1-C))}return T}}function Bd(s,t,i,a,h,m){if(h-a<=i)return;const g=a+h>>1;Yg(s,t,g,a,h,m),Bd(s,t,i,a,g-1,1-m),Bd(s,t,i,g+1,h,1-m)}function Yg(s,t,i,a,h,m){for(;h>a;){if(h-a>600){const P=h-a+1,C=i-a+1,E=Math.log(P),z=.5*Math.exp(2*E/3),L=.5*Math.sqrt(E*z*(P-z)/P)*(C-P/2<0?-1:1);Yg(s,t,i,Math.max(a,Math.floor(i-C*z/P+L)),Math.min(h,Math.floor(i+(P-C)*z/P+L)),m)}const g=t[2*i+m];let v=a,T=h;for(ru(s,t,a,i),t[2*h+m]>g&&ru(s,t,a,h);v<T;){for(ru(s,t,v,T),v++,T--;t[2*v+m]<g;)v++;for(;t[2*T+m]>g;)T--}t[2*a+m]===g?ru(s,t,a,T):(T++,ru(s,t,T,h)),T<=i&&(a=T+1),i<=T&&(h=T-1)}}function ru(s,t,i,a){Od(s,i,a),Od(t,2*i,2*a),Od(t,2*i+1,2*a+1)}function Od(s,t,i){const a=s[t];s[t]=s[i],s[i]=a}function Kg(s,t,i,a){const h=s-i,m=t-a;return h*h+m*m}var Nd;x.ce=void 0,(Nd=x.ce||(x.ce={})).create="create",Nd.load="load",Nd.fullLoad="fullLoad";let qh=null,iu=[];const jd=1e3/60,Vd="loadTime",$d="fullLoadTime",c0={mark(s){performance.mark(s)},frame(s){const t=s;qh!=null&&iu.push(t-qh),qh=t},clearMetrics(){qh=null,iu=[],performance.clearMeasures(Vd),performance.clearMeasures($d);for(const s in x.ce)performance.clearMarks(x.ce[s])},getPerformanceMetrics(){performance.measure(Vd,x.ce.create,x.ce.load),performance.measure($d,x.ce.create,x.ce.fullLoad);const s=performance.getEntriesByName(Vd)[0].duration,t=performance.getEntriesByName($d)[0].duration,i=iu.length,a=1/(iu.reduce((m,g)=>m+g,0)/i/1e3),h=iu.filter(m=>m>jd).reduce((m,g)=>m+(g-jd)/jd,0);return{loadTime:s,fullLoadTime:t,fps:a,percentDroppedFrames:h/(i+h)*100,totalFrames:i}}};x.$=de,x.A=Et,x.B=ja,x.C=function(s){if(Me==null){const t=s.navigator?s.navigator.userAgent:null;Me=!!s.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return Me},x.D=ot,x.E=os,x.F=class{constructor(s,t){this.target=s,this.mapId=t,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new e0(()=>this.process()),this.subscription=function(i,a,h,m){return i.addEventListener(a,h,!1),{unsubscribe:()=>{i.removeEventListener(a,h,!1)}}}(this.target,"message",i=>this.receive(i)),this.globalScope=fe(self)?s:window}registerMessageHandler(s,t){this.messageHandlers[s]=t}sendAsync(s,t){return new Promise((i,a)=>{const h=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[h]={resolve:i,reject:a},t&&t.signal.addEventListener("abort",()=>{delete this.resolveRejects[h];const v={id:h,type:"<cancel>",origin:location.origin,targetMapId:s.targetMapId,sourceMapId:this.mapId};this.target.postMessage(v)},{once:!0});const m=[],g=Object.assign(Object.assign({},s),{id:h,sourceMapId:this.mapId,origin:location.origin,data:Va(s.data,m)});this.target.postMessage(g,{transfer:m})})}receive(s){const t=s.data,i=t.id;if(!(t.origin!=="file://"&&location.origin!=="file://"&&t.origin!=="resource://android"&&location.origin!=="resource://android"&&t.origin!==location.origin||t.targetMapId&&this.mapId!==t.targetMapId)){if(t.type==="<cancel>"){delete this.tasks[i];const a=this.abortControllers[i];return delete this.abortControllers[i],void(a&&a.abort())}if(fe(self)||t.mustQueue)return this.tasks[i]=t,this.taskQueue.push(i),void this.invoker.trigger();this.processTask(i,t)}}process(){if(this.taskQueue.length===0)return;const s=this.taskQueue.shift(),t=this.tasks[s];delete this.tasks[s],this.taskQueue.length>0&&this.invoker.trigger(),t&&this.processTask(s,t)}processTask(s,t){return c(this,void 0,void 0,function*(){if(t.type==="<response>"){const h=this.resolveRejects[s];return delete this.resolveRejects[s],h?void(t.error?h.reject(Hs(t.error)):h.resolve(Hs(t.data))):void 0}if(!this.messageHandlers[t.type])return void this.completeTask(s,new Error(`Could not find a registered handler for ${t.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const i=Hs(t.data),a=new AbortController;this.abortControllers[s]=a;try{const h=yield this.messageHandlers[t.type](t.sourceMapId,i,a);this.completeTask(s,null,h)}catch(h){this.completeTask(s,h)}})}completeTask(s,t,i){const a=[];delete this.abortControllers[s];const h={id:s,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:t?Va(t):null,data:Va(i,a)};this.target.postMessage(h,{transfer:a})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},x.G=gt,x.H=function(){var s=new Et(16);return Et!=Float32Array&&(s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[11]=0,s[12]=0,s[13]=0,s[14]=0),s[0]=1,s[5]=1,s[10]=1,s[15]=1,s},x.I=Td,x.J=function(s,t,i){var a,h,m,g,v,T,P,C,E,z,L,F,j=i[0],G=i[1],J=i[2];return t===s?(s[12]=t[0]*j+t[4]*G+t[8]*J+t[12],s[13]=t[1]*j+t[5]*G+t[9]*J+t[13],s[14]=t[2]*j+t[6]*G+t[10]*J+t[14],s[15]=t[3]*j+t[7]*G+t[11]*J+t[15]):(h=t[1],m=t[2],g=t[3],v=t[4],T=t[5],P=t[6],C=t[7],E=t[8],z=t[9],L=t[10],F=t[11],s[0]=a=t[0],s[1]=h,s[2]=m,s[3]=g,s[4]=v,s[5]=T,s[6]=P,s[7]=C,s[8]=E,s[9]=z,s[10]=L,s[11]=F,s[12]=a*j+v*G+E*J+t[12],s[13]=h*j+T*G+z*J+t[13],s[14]=m*j+P*G+L*J+t[14],s[15]=g*j+C*G+F*J+t[15]),s},x.K=function(s,t,i){var a=i[0],h=i[1],m=i[2];return s[0]=t[0]*a,s[1]=t[1]*a,s[2]=t[2]*a,s[3]=t[3]*a,s[4]=t[4]*h,s[5]=t[5]*h,s[6]=t[6]*h,s[7]=t[7]*h,s[8]=t[8]*m,s[9]=t[9]*m,s[10]=t[10]*m,s[11]=t[11]*m,s[12]=t[12],s[13]=t[13],s[14]=t[14],s[15]=t[15],s},x.L=function(s,t,i){var a=t[0],h=t[1],m=t[2],g=t[3],v=t[4],T=t[5],P=t[6],C=t[7],E=t[8],z=t[9],L=t[10],F=t[11],j=t[12],G=t[13],J=t[14],pe=t[15],re=i[0],D=i[1],Z=i[2],ie=i[3];return s[0]=re*a+D*v+Z*E+ie*j,s[1]=re*h+D*T+Z*z+ie*G,s[2]=re*m+D*P+Z*L+ie*J,s[3]=re*g+D*C+Z*F+ie*pe,s[4]=(re=i[4])*a+(D=i[5])*v+(Z=i[6])*E+(ie=i[7])*j,s[5]=re*h+D*T+Z*z+ie*G,s[6]=re*m+D*P+Z*L+ie*J,s[7]=re*g+D*C+Z*F+ie*pe,s[8]=(re=i[8])*a+(D=i[9])*v+(Z=i[10])*E+(ie=i[11])*j,s[9]=re*h+D*T+Z*z+ie*G,s[10]=re*m+D*P+Z*L+ie*J,s[11]=re*g+D*C+Z*F+ie*pe,s[12]=(re=i[12])*a+(D=i[13])*v+(Z=i[14])*E+(ie=i[15])*j,s[13]=re*h+D*T+Z*z+ie*G,s[14]=re*m+D*P+Z*L+ie*J,s[15]=re*g+D*C+Z*F+ie*pe,s},x.M=function(s,t){const i={};for(let a=0;a<t.length;a++){const h=t[a];h in s&&(i[h]=s[h])}return i},x.N=la,x.O=Mg,x.P=Se,x.Q=Pg,x.R=hs,x.S=ps,x.T=Mc,x.U=Pt,x.V=nt,x.W=Oe,x.X=_t,x.Y=eu,x.Z=Rd,x._=c,x.a=et,x.a$=function(){return new Float64Array(16)},x.a0=s=>{const t=window.document.createElement("video");return t.muted=!0,new Promise(i=>{t.onloadstart=()=>{i(t)};for(const a of s){const h=window.document.createElement("source");Dr(a)||(t.crossOrigin="Anonymous"),h.src=a,t.appendChild(h)}})},x.a1=function(){return Li++},x.a2=f,x.a3=ul,x.a4=$o,x.a5=In,x.a6=Rg,x.a7=function(s){const t={};if(s.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(i,a,h,m)=>{const g=h||m;return t[a]=!g||g.toLowerCase(),""}),t["max-age"]){const i=parseInt(t["max-age"],10);isNaN(i)?delete t["max-age"]:t["max-age"]=i}return t},x.a8=function(s){return Math.log(s)/Math.LN2},x.a9=function(s){var t=s[0],i=s[1];return t*t+i*i},x.aA=Lr,x.aB=Rh,x.aC=W,x.aD=Xe,x.aE=Ie,x.aF=85.051129,x.aG=function(s){return Math.pow(2,s)},x.aH=Ig,x.aI=Ii,x.aJ=Ze,x.aK=Cg,x.aL=function(s,t,i){return s[0]=t[0]*i,s[1]=t[1]*i,s[2]=t[2]*i,s},x.aM=function(s,t,i){return s[0]=t[0]+i[0],s[1]=t[1]+i[1],s[2]=t[2]+i[2],s},x.aN=function(s){var t=new Et(3);return t[0]=s[0],t[1]=s[1],t[2]=s[2],t},x.aO=function(s,t,i){return s[0]=t[0]*i[0],s[1]=t[1]*i[1],s[2]=t[2]*i[2],s[3]=t[3]*i[3],s},x.aP=function(s,t,i){return s[0]=t[0]-i[0],s[1]=t[1]-i[1],s[2]=t[2]-i[2],s},x.aQ=function(s,t){var i=t[0],a=t[1],h=t[2],m=i*i+a*a+h*h;return m>0&&(m=1/Math.sqrt(m)),s[0]=t[0]*m,s[1]=t[1]*m,s[2]=t[2]*m,s},x.aR=function(s,t,i){var a=t[0],h=t[1],m=t[2],g=i[0],v=i[1],T=i[2];
25return s[0]=h*T-m*v,s[1]=m*g-a*T,s[2]=a*v-h*g,s},x.aS=function(s,t){return s[0]*t[0]+s[1]*t[1]+s[2]*t[2]},x.aT=Ag,x.aU=hl,x.aV=function(s,t,i,a,h){var m,g=1/Math.tan(t/2);return s[0]=g/i,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=g,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[11]=-1,s[12]=0,s[13]=0,s[15]=0,h!=null&&h!==1/0?(s[10]=(h+a)*(m=1/(a-h)),s[14]=2*h*a*m):(s[10]=-1,s[14]=-2*a),s},x.aW=function(s){var t=new Et(16);return t[0]=s[0],t[1]=s[1],t[2]=s[2],t[3]=s[3],t[4]=s[4],t[5]=s[5],t[6]=s[6],t[7]=s[7],t[8]=s[8],t[9]=s[9],t[10]=s[10],t[11]=s[11],t[12]=s[12],t[13]=s[13],t[14]=s[14],t[15]=s[15],t},x.aX=function(s,t,i){var a=Math.sin(i),h=Math.cos(i),m=t[0],g=t[1],v=t[2],T=t[3],P=t[4],C=t[5],E=t[6],z=t[7];return t!==s&&(s[8]=t[8],s[9]=t[9],s[10]=t[10],s[11]=t[11],s[12]=t[12],s[13]=t[13],s[14]=t[14],s[15]=t[15]),s[0]=m*h+P*a,s[1]=g*h+C*a,s[2]=v*h+E*a,s[3]=T*h+z*a,s[4]=P*h-m*a,s[5]=C*h-g*a,s[6]=E*h-v*a,s[7]=z*h-T*a,s},x.aY=function(s,t,i){var a=Math.sin(i),h=Math.cos(i),m=t[4],g=t[5],v=t[6],T=t[7],P=t[8],C=t[9],E=t[10],z=t[11];return t!==s&&(s[0]=t[0],s[1]=t[1],s[2]=t[2],s[3]=t[3],s[12]=t[12],s[13]=t[13],s[14]=t[14],s[15]=t[15]),s[4]=m*h+P*a,s[5]=g*h+C*a,s[6]=v*h+E*a,s[7]=T*h+z*a,s[8]=P*h-m*a,s[9]=C*h-g*a,s[10]=E*h-v*a,s[11]=z*h-T*a,s},x.aZ=function(){const s=new Float32Array(16);return jt(s),s},x.a_=function(){const s=new Float64Array(16);return jt(s),s},x.aa=function(s){return s*Math.PI/180},x.ab=Pi,x.ac=function(s,t){const i=[];for(const a in s)a in t||i.push(a);return i},x.ad=Mr,x.ae=function(s){return Math.hypot(s[0],s[1])},x.af=function(s){return s[0]=0,s[1]=0,s},x.ag=function(s,t,i){return s[0]=t[0]*i,s[1]=t[1]*i,s},x.ah=function(s,t){let i=0,a=0;if(s.kind==="constant")a=s.layoutSize;else if(s.kind!=="source"){const{interpolationType:h,minZoom:m,maxZoom:g}=s,v=h?Pi(ir.interpolationFactor(h,t,m,g),0,1):0;s.kind==="camera"?a=cs.number(s.minSize,s.maxSize,v):i=v}return{uSizeT:i,uSize:a}},x.aj=function(s,{uSize:t,uSizeT:i},{lowerSize:a,upperSize:h}){return s.kind==="source"?a/Ys:s.kind==="composite"?cs.number(a/Ys,h/Ys,i):t},x.ak=Id,x.al=Or,x.am=function(s,t,i,a){const h=t.y-s.y,m=t.x-s.x,g=a.y-i.y,v=a.x-i.x,T=g*m-v*h;if(T===0)return null;const P=(v*(s.y-i.y)-g*(s.x-i.x))/T;return new Se(s.x+P*m,s.y+P*h)},x.an=function(s,t){var i=t[0],a=t[1],h=t[2],m=t[3],g=t[4],v=t[5],T=t[6],P=t[7],C=t[8],E=t[9],z=t[10],L=t[11],F=t[12],j=t[13],G=t[14],J=t[15],pe=i*v-a*g,re=i*T-h*g,D=i*P-m*g,Z=a*T-h*v,ie=a*P-m*v,xe=h*P-m*T,Fe=C*j-E*F,Te=C*G-z*F,Ce=C*J-L*F,je=E*G-z*j,Le=E*J-L*j,Ne=z*J-L*G,ke=pe*Ne-re*Le+D*je+Z*Ce-ie*Te+xe*Fe;return ke?(s[0]=(v*Ne-T*Le+P*je)*(ke=1/ke),s[1]=(h*Le-a*Ne-m*je)*ke,s[2]=(j*xe-G*ie+J*Z)*ke,s[3]=(z*ie-E*xe-L*Z)*ke,s[4]=(T*Ce-g*Ne-P*Te)*ke,s[5]=(i*Ne-h*Ce+m*Te)*ke,s[6]=(G*D-F*xe-J*re)*ke,s[7]=(C*xe-z*D+L*re)*ke,s[8]=(g*Le-v*Ce+P*Fe)*ke,s[9]=(a*Ce-i*Le-m*Fe)*ke,s[10]=(F*ie-j*D+J*pe)*ke,s[11]=(E*D-C*ie-L*pe)*ke,s[12]=(v*Te-g*je-T*Fe)*ke,s[13]=(i*je-a*Te+h*Fe)*ke,s[14]=(j*re-F*Z-G*pe)*ke,s[15]=(C*Z-E*re+z*pe)*ke,s):null},x.ao=Bg,x.ap=Fc,x.aq=jt,x.ar=function(s){let t=1/0,i=1/0,a=-1/0,h=-1/0;for(const m of s)t=Math.min(t,m.x),i=Math.min(i,m.y),a=Math.max(a,m.x),h=Math.max(h,m.y);return[t,i,a,h]},x.as=Hr,x.at=It,x.au=function(s,t,i,a,h=!1){if(!i[0]&&!i[1])return[0,0];const m=h?a==="map"?-s.bearingInRadians:0:a==="viewport"?s.bearingInRadians:0;if(m){const g=Math.sin(m),v=Math.cos(m);i=[i[0]*v-i[1]*g,i[0]*g+i[1]*v]}return[h?i[0]:It(t,i[0],s.zoom),h?i[1]:It(t,i[1],s.zoom)]},x.aw=Pd,x.ax=Ld,x.ay=Md,x.az=Fd,x.b=Ve,x.b$=s=>s.type==="line",x.b0=function(s,t,i){const a=new Float64Array(4);return function(h,m,g,v){var T=.5*Math.PI/180;m*=T,g*=T,v*=T;var P=Math.sin(m),C=Math.cos(m),E=Math.sin(g),z=Math.cos(g),L=Math.sin(v),F=Math.cos(v);
vendor: 14,029 bytes, line 25
25h[0]=P*z*F-C*E*L,h[1]=C*E*F+P*z*L,h[2]=C*z*L-P*E*F,h[3]=C*z*F+P*E*L}(a,s,t-90,i),a},x.b1=function(s,t,i,a){var h,m,g,v,T,P=t[0],C=t[1],E=t[2],z=t[3],L=i[0],F=i[1],j=i[2],G=i[3];return(m=P*L+C*F+E*j+z*G)<0&&(m=-m,L=-L,F=-F,j=-j,G=-G),1-m>Xt?(h=Math.acos(m),g=Math.sin(h),v=Math.sin((1-a)*h)/g,T=Math.sin(a*h)/g):(v=1-a,T=a),s[0]=v*P+T*L,s[1]=v*C+T*F,s[2]=v*E+T*j,s[3]=v*z+T*G,s},x.b2=function(s){const t=new Float64Array(9);var i,a,h,m,g,v,T,P,C,E,z,L,F,j,G,J,pe,re;E=(h=(a=s)[0])*(T=h+h),z=(m=a[1])*T,F=(g=a[2])*T,j=g*(P=m+m),J=(v=a[3])*T,pe=v*P,re=v*(C=g+g),(i=t)[0]=1-(L=m*P)-(G=g*C),i[3]=z-re,i[6]=F+pe,i[1]=z+re,i[4]=1-E-G,i[7]=j-J,i[2]=F-pe,i[5]=j+J,i[8]=1-E-L;const D=Ze(-Math.asin(Pi(t[2],-1,1)));let Z,ie;return Math.hypot(t[5],t[8])<.001?(Z=0,ie=-Ze(Math.atan2(t[3],t[4]))):(Z=Ze(t[5]===0&&t[8]===0?0:Math.atan2(t[5],t[8])),ie=Ze(t[1]===0&&t[0]===0?0:Math.atan2(t[1],t[0]))),{roll:Z,pitch:D+90,bearing:ie}},x.b3=function(s,t){return s.roll==t.roll&&s.pitch==t.pitch&&s.bearing==t.bearing},x.b4=zt,x.b5=Ls,x.b6=ll,x.b7=Gc,x.b8=ol,x.b9=vi,x.bA=Xi,x.bB=ss,x.bC=class extends Oi{constructor(s,t){super(s,t),this.current=0}set(s){this.current!==s&&(this.current=s,this.gl.uniform1i(this.location,s))}},x.bD=class extends Oi{constructor(s,t){super(s,t),this.current=na}set(s){if(s[12]!==this.current[12]||s[0]!==this.current[0])return this.current=s,void this.gl.uniformMatrix4fv(this.location,!1,s);for(let t=1;t<16;t++)if(s[t]!==this.current[t]){this.current=s,this.gl.uniformMatrix4fv(this.location,!1,s);break}}},x.bE=Xa,x.bF=Ya,x.bG=class extends Oi{constructor(s,t){super(s,t),this.current=[0,0,0]}set(s){s[0]===this.current[0]&&s[1]===this.current[1]&&s[2]===this.current[2]||(this.current=s,this.gl.uniform3f(this.location,s[0],s[1],s[2]))}},x.bH=class extends Oi{constructor(s,t){super(s,t),this.current=[0,0]}set(s){s[0]===this.current[0]&&s[1]===this.current[1]||(this.current=s,this.gl.uniform2f(this.location,s[0],s[1]))}},x.bI=pt,x.bJ=function(s,t){var i=Math.sin(t),a=Math.cos(t);return s[0]=a,s[1]=i,s[2]=0,s[3]=-i,s[4]=a,s[5]=0,s[6]=0,s[7]=0,s[8]=1,s},x.bK=function(s,t,i){var a=t[0],h=t[1],m=t[2];return s[0]=a*i[0]+h*i[3]+m*i[6],s[1]=a*i[1]+h*i[4]+m*i[7],s[2]=a*i[2]+h*i[5]+m*i[8],s},x.bL=function(s,t,i,a,h,m,g){var v=1/(t-i),T=1/(a-h),P=1/(m-g);return s[0]=-2*v,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=-2*T,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=2*P,s[11]=0,s[12]=(t+i)*v,s[13]=(h+a)*T,s[14]=(g+m)*P,s[15]=1,s},x.bM=class extends kc{},x.bN=Ax,x.bO=class extends Ws{},x.bP=od,x.bQ=function(s){return s<=1?1:Math.pow(2,Math.ceil(Math.log(s)/Math.LN2))},x.bR=zm,x.bS=function(s,t,i){var a=t[0],h=t[1],m=t[2],g=i[3]*a+i[7]*h+i[11]*m+i[15];return s[0]=(i[0]*a+i[4]*h+i[8]*m+i[12])/(g=g||1),s[1]=(i[1]*a+i[5]*h+i[9]*m+i[13])/g,s[2]=(i[2]*a+i[6]*h+i[10]*m+i[14])/g,s},x.bT=class extends Cc{},x.bU=class extends r{},x.bV=function(s,t){return s[0]===t[0]&&s[1]===t[1]&&s[2]===t[2]&&s[3]===t[3]&&s[4]===t[4]&&s[5]===t[5]&&s[6]===t[6]&&s[7]===t[7]&&s[8]===t[8]&&s[9]===t[9]&&s[10]===t[10]&&s[11]===t[11]&&s[12]===t[12]&&s[13]===t[13]&&s[14]===t[14]&&s[15]===t[15]},x.bW=function(s,t){var i=s[0],a=s[1],h=s[2],m=s[3],g=s[4],v=s[5],T=s[6],P=s[7],C=s[8],E=s[9],z=s[10],L=s[11],F=s[12],j=s[13],G=s[14],J=s[15],pe=t[0],re=t[1],D=t[2],Z=t[3],ie=t[4],xe=t[5],Fe=t[6],Te=t[7],Ce=t[8],je=t[9],Le=t[10],Ne=t[11],ke=t[12],it=t[13],ct=t[14],lt=t[15];return Math.abs(i-pe)<=Xt*Math.max(1,Math.abs(i),Math.abs(pe))&&Math.abs(a-re)<=Xt*Math.max(1,Math.abs(a),Math.abs(re))&&Math.abs(h-D)<=Xt*Math.max(1,Math.abs(h),Math.abs(D))&&Math.abs(m-Z)<=Xt*Math.max(1,Math.abs(m),Math.abs(Z))&&Math.abs(g-ie)<=Xt*Math.max(1,Math.abs(g),Math.abs(ie))&&Math.abs(v-xe)<=Xt*Math.max(1,Math.abs(v),Math.abs(xe))&&Math.abs(T-Fe)<=Xt*Math.max(1,Math.abs(T),Math.abs(Fe))&&Math.abs(P-Te)<=Xt*Math.max(1,Math.abs(P),Math.abs(Te))&&Math.abs(C-Ce)<=Xt*Math.max(1,Math.abs(C),Math.abs(Ce))&&Math.abs(E-je)<=Xt*Math.max(1,Math.abs(E),Math.abs(je))&&Math.abs(z-Le)<=Xt*Math.max(1,Math.abs(z),Math.abs(Le))&&Math.abs(L-Ne)<=Xt*Math.max(1,Math.abs(L),Math.abs(Ne))&&Math.abs(F-ke)<=Xt*Math.max(1,Math.abs(F),Math.abs(ke))&&Math.abs(j-it)<=Xt*Math.max(1,Math.abs(j),Math.abs(it))&&Math.abs(G-ct)<=Xt*Math.max(1,Math.abs(G),Math.abs(ct))&&Math.abs(J-lt)<=Xt*Math.max(1,Math.abs(J),Math.abs(lt))},x.bX=function(s,t){return s[0]=t[0],s[1]=t[1],s[2]=t[2],s[3]=t[3],s[4]=t[4],s[5]=t[5],s[6]=t[6],s[7]=t[7],s[8]=t[8],s[9]=t[9],s[10]=t[10],s[11]=t[11],s[12]=t[12],s[13]=t[13],s[14]=t[14],s[15]=t[15],s},x.bY=s=>s.type==="symbol",x.bZ=s=>s.type==="circle",x.b_=s=>s.type==="heatmap",x.ba=Wi,x.bb=fi,x.bc=function(s,t,i,a,h){return vi(a,h,Pi((s-t)/(i-t),0,1))},x.bd=Gt,x.be=function(){return new Float64Array(4)},x.bf=function(){return new Float64Array(3)},x.bg=function(s,t,i,a){var h=[],m=[];return h[0]=t[0]-i[0],h[1]=t[1]-i[1],h[2]=t[2]-i[2],m[0]=h[0]*Math.cos(a)-h[1]*Math.sin(a),m[1]=h[0]*Math.sin(a)+h[1]*Math.cos(a),m[2]=h[2],s[0]=m[0]+i[0],s[1]=m[1]+i[1],s[2]=m[2]+i[2],s},x.bh=function(s,t,i,a){var h=[],m=[];return h[0]=t[0]-i[0],h[1]=t[1]-i[1],h[2]=t[2]-i[2],m[0]=h[0],m[1]=h[1]*Math.cos(a)-h[2]*Math.sin(a),m[2]=h[1]*Math.sin(a)+h[2]*Math.cos(a),s[0]=m[0]+i[0],s[1]=m[1]+i[1],s[2]=m[2]+i[2],s},x.bi=function(s,t,i,a){var h=[],m=[];return h[0]=t[0]-i[0],h[1]=t[1]-i[1],h[2]=t[2]-i[2],m[0]=h[2]*Math.sin(a)+h[0]*Math.cos(a),m[1]=h[1],m[2]=h[2]*Math.cos(a)-h[0]*Math.sin(a),s[0]=m[0]+i[0],s[1]=m[1]+i[1],s[2]=m[2]+i[2],s},x.bj=function(s,t,i){var a=Math.sin(i),h=Math.cos(i),m=t[0],g=t[1],v=t[2],T=t[3],P=t[8],C=t[9],E=t[10],z=t[11];return t!==s&&(s[4]=t[4],s[5]=t[5],s[6]=t[6],s[7]=t[7],s[12]=t[12],s[13]=t[13],s[14]=t[14],s[15]=t[15]),s[0]=m*h-P*a,s[1]=g*h-C*a,s[2]=v*h-E*a,s[3]=T*h-z*a,s[8]=m*a+P*h,s[9]=g*a+C*h,s[10]=v*a+E*h,s[11]=T*a+z*h,s},x.bk=function(s,t){const i=Gt(s,360),a=Gt(t,360),h=a-i,m=a>i?h-360:h+360;return Math.abs(h)<Math.abs(m)?h:m},x.bl=function(s){return s[0]=0,s[1]=0,s[2]=0,s},x.bm=function(s,t,i,a){const h=Math.sqrt(s*s+t*t),m=Math.sqrt(i*i+a*a);s/=h,t/=h,i/=m,a/=m;const g=Math.acos(s*i+t*a);return-t*i+s*a>0?g:-g},x.bn=function(s,t){return s[0]*t[0]+s[1]*t[1]+s[2]*t[2]+s[3]},x.bo=kd,x.bp=function(s,t){const i=Gt(s,2*Math.PI),a=Gt(t,2*Math.PI);return Math.min(Math.abs(i-a),Math.abs(i-a+2*Math.PI),Math.abs(i-a-2*Math.PI))},x.bq=function(s){return Math.hypot(s[0],s[1],s[2])},x.br=function(){const s={},t=H.$version;for(const i in H.$root){const a=H.$root[i];if(a.required){let h=null;h=i==="version"?t:a.type==="array"?[]:{},h!=null&&(s[i]=h)}}return s},x.bs=mh,x.bt=Wt,x.bu=function(s){s=s.slice();const t=Object.create(null);for(let i=0;i<s.length;i++)t[s[i].id]=s[i];for(let i=0;i<s.length;i++)"ref"in s[i]&&(s[i]=$(s[i],t[s[i].ref]));return s},x.bv=function(s){if(s.type==="custom")return new Qx(s);switch(s.type){case"background":return new Yx(s);case"circle":return new qv(s);case"fill":return new ux(s);case"fill-extrusion":return new yx(s);case"heatmap":return new Hv(s);case"hillshade":return new Xv(s);case"line":return new Px(s);case"raster":return new Jx(s);case"symbol":return new jh(s)}},x.bw=hi,x.bx=function(s,t){if(!s)return[{command:"setStyle",args:[t]}];let i=[];try{if(!U(s.version,t.version))return[{command:"setStyle",args:[t]}];U(s.center,t.center)||i.push({command:"setCenter",args:[t.center]}),U(s.centerAltitude,t.centerAltitude)||i.push({command:"setCenterAltitude",args:[t.centerAltitude]}),U(s.zoom,t.zoom)||i.push({command:"setZoom",args:[t.zoom]}),U(s.bearing,t.bearing)||i.push({command:"setBearing",args:[t.bearing]}),U(s.pitch,t.pitch)||i.push({command:"setPitch",args:[t.pitch]}),U(s.roll,t.roll)||i.push({command:"setRoll",args:[t.roll]}),U(s.sprite,t.sprite)||i.push({command:"setSprite",args:[t.sprite]}),U(s.glyphs,t.glyphs)||i.push({command:"setGlyphs",args:[t.glyphs]}),U(s.transition,t.transition)||i.push({command:"setTransition",args:[t.transition]}),U(s.light,t.light)||i.push({command:"setLight",args:[t.light]}),U(s.terrain,t.terrain)||i.push({command:"setTerrain",args:[t.terrain]}),U(s.sky,t.sky)||i.push({command:"setSky",args:[t.sky]}),U(s.projection,t.projection)||i.push({command:"setProjection",args:[t.projection]});const a={},h=[];(function(g,v,T,P){let C;for(C in v=v||{},g=g||{})Object.prototype.hasOwnProperty.call(g,C)&&(Object.prototype.hasOwnProperty.call(v,C)||_e(C,T,P));for(C in v)Object.prototype.hasOwnProperty.call(v,C)&&(Object.prototype.hasOwnProperty.call(g,C)?U(g[C],v[C])||(g[C].type==="geojson"&&v[C].type==="geojson"&&me(g,v,C)?te(T,{command:"setGeoJSONSourceData",args:[C,v[C].data]}):we(C,v,T,P)):ce(C,v,T))})(s.sources,t.sources,h,a);const m=[];s.layers&&s.layers.forEach(g=>{"source"in g&&a[g.source]?i.push({command:"removeLayer",args:[g.id]}):m.push(g)}),i=i.concat(h),function(g,v,T){v=v||[];const P=(g=g||[]).map(Pe),C=v.map(Pe),E=g.reduce(ye,{}),z=v.reduce(ye,{}),L=P.slice(),F=Object.create(null);let j,G,J,pe,re;for(let D=0,Z=0;D<P.length;D++)j=P[D],Object.prototype.hasOwnProperty.call(z,j)?Z++:(te(T,{command:"removeLayer",args:[j]}),L.splice(L.indexOf(j,Z),1));for(let D=0,Z=0;D<C.length;D++)j=C[C.length-1-D],L[L.length-1-D]!==j&&(Object.prototype.hasOwnProperty.call(E,j)?(te(T,{command:"removeLayer",args:[j]}),L.splice(L.lastIndexOf(j,L.length-Z),1)):Z++,pe=L[L.length-D],te(T,{command:"addLayer",args:[z[j],pe]}),L.splice(L.length-D,0,j),F[j]=!0);for(let D=0;D<C.length;D++)if(j=C[D],G=E[j],J=z[j],!F[j]&&!U(G,J))if(U(G.source,J.source)&&U(G["source-layer"],J["source-layer"])&&U(G.type,J.type)){for(re in Ee(G.layout,J.layout,T,j,null,"setLayoutProperty"),Ee(G.paint,J.paint,T,j,null,"setPaintProperty"),U(G.filter,J.filter)||te(T,{command:"setFilter",args:[j,J.filter]}),U(G.minzoom,J.minzoom)&&U(G.maxzoom,J.maxzoom)||te(T,{command:"setLayerZoomRange",args:[j,J.minzoom,J.maxzoom]}),G)Object.prototype.hasOwnProperty.call(G,re)&&re!=="layout"&&re!=="paint"&&re!=="filter"&&re!=="metadata"&&re!=="minzoom"&&re!=="maxzoom"&&(re.indexOf("paint.")===0?Ee(G[re],J[re],T,j,re.slice(6),"setPaintProperty"):U(G[re],J[re])||te(T,{command:"setLayerProperty",args:[j,re,J[re]]}));for(re in J)Object.prototype.hasOwnProperty.call(J,re)&&!Object.prototype.hasOwnProperty.call(G,re)&&re!=="layout"&&re!=="paint"&&re!=="filter"&&re!=="metadata"&&re!=="minzoom"&&re!=="maxzoom"&&(re.indexOf("paint.")===0?Ee(G[re],J[re],T,j,re.slice(6),"setPaintProperty"):U(G[re],J[re])||te(T,{command:"setLayerProperty",args:[j,re,J[re]]}))}else te(T,{command:"removeLayer",args:[j]}),pe=L[L.lastIndexOf(j)+1],te(T,{command:"addLayer",args:[J,pe]})}(m,t.layers,i)}catch(a){console.warn("Unable to compute style diff:",a),i=[{command:"setStyle",args:[t]}]}return i},x.by=function(s){const t=[],i=s.id;return i===void 0&&t.push({message:`layers.${i}: missing required property "id"`}),s.render===void 0&&t.push({message:`layers.${i}: missing required method "render"`}),s.renderingMode&&s.renderingMode!=="2d"&&s.renderingMode!=="3d"&&t.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),t},x.bz=function s(t,i){if(Array.isArray(t)){if(!Array.isArray(i)||t.length!==i.length)return!1;for(let a=0;a<t.length;a++)if(!s(t[a],i[a]))return!1;return!0}if(typeof t=="object"&&t!==null&&i!==null){if(typeof i!="object"||Object.keys(t).length!==Object.keys(i).length)return!1;for(const a in t)if(!s(t[a],i[a]))return!1;return!0}return t===i},x.c=dt,x.c0=s=>s.type==="fill",x.c1=s=>s.type==="fill-extrusion",x.c2=s=>s.type==="hillshade",x.c3=s=>s.type==="raster",x.c4=s=>s.type==="background",x.c5=s=>s.type==="custom",x.c6=Mi,x.c7=function(s,t,i){const a=_s(t.x-i.x,t.y-i.y),h=_s(s.x-i.x,s.y-i.y);var m,g;return Ze(Math.atan2(a[0]*h[1]-a[1]*h[0],(m=a)[0]*(g=h)[0]+m[1]*g[1]))},x.c8=Rr,x.c9=function(s,t,i){var a=t[0],h=t[1];return s[0]=i[0]*a+i[4]*h+i[12],s[1]=i[1]*a+i[5]*h+i[13],s},x.cA=og,x.cB=Oo,x.cC=zs,x.ca=function(s,t){const{x:i,y:a}=eu.fromLngLat(t);return!(s<0||s>25||a<0||a>=1||i<0||i>=1)},x.cb=function(s,t){return s[0]=t[0],s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=t[1],s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=t[2],s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=1,s},x.cc=class extends qa{},x.cd=c0,x.cf=function(s){return s.message===$e},x.cg=Mt,x.ch=function(s,t){et.REGISTERED_PROTOCOLS[s]=t},x.ci=function(s){delete et.REGISTERED_PROTOCOLS[s]},x.cj=function(s,t){const i={};for(let h=0;h<s.length;h++){const m=t&&t[s[h].id]||yc(s[h]);t&&(t[s[h].id]=m);let g=i[m];g||(g=i[m]=[]),g.push(s[h])}const a=[];for(const h in i)a.push(i[h]);return a},x.ck=Qe,x.cl=zg,x.cm=Dg,x.cn=cg,x.co=function(s){s.bucket.createArrays(),s.bucket.tilePixelRatio=_t/(512*s.bucket.overscaling),s.bucket.compareText={},s.bucket.iconsNeedLinear=!1;const t=s.bucket.layers[0],i=t.layout,a=t._unevaluatedLayout._values,h={layoutIconSize:a["icon-size"].possiblyEvaluate(new dr(s.bucket.zoom+1),s.canonical),layoutTextSize:a["text-size"].possiblyEvaluate(new dr(s.bucket.zoom+1),s.canonical),textMaxSize:a["text-size"].possiblyEvaluate(new dr(18))};if(s.bucket.textSizeData.kind==="composite"){const{minZoom:P,maxZoom:C}=s.bucket.textSizeData;h.compositeTextSizes=[a["text-size"].possiblyEvaluate(new dr(P),s.canonical),a["text-size"].possiblyEvaluate(new dr(C),s.canonical)]}if(s.bucket.iconSizeData.kind==="composite"){const{minZoom:P,maxZoom:C}=s.bucket.iconSizeData;h.compositeIconSizes=[a["icon-size"].possiblyEvaluate(new dr(P),s.canonical),a["icon-size"].possiblyEvaluate(new dr(C),s.canonical)]}const m=i.get("text-line-height")*Hr,g=i.get("text-rotation-alignment")!=="viewport"&&i.get("symbol-placement")!=="point",v=i.get("text-keep-upright"),T=i.get("text-size");for(const P of s.bucket.features){const C=i.get("text-font").evaluate(P,{},s.canonical).join(","),E=T.evaluate(P,{},s.canonical),z=h.layoutTextSize.evaluate(P,{},s.canonical),L=h.layoutIconSize.evaluate(P,{},s.canonical),F={horizontal:{},vertical:void 0},j=P.text;let G,J=[0,0];if(j){const D=j.toString(),Z=i.get("text-letter-spacing").evaluate(P,{},s.canonical)*Hr,ie=gh(D)?Z:0,xe=i.get("text-anchor").evaluate(P,{},s.canonical),Fe=Gg(t,P,s.canonical);if(!Fe){const Le=i.get("text-radial-offset").evaluate(P,{},s.canonical);J=Le?qg(xe,[Le*Hr,Dd]):i.get("text-offset").evaluate(P,{},s.canonical).map(Ne=>Ne*Hr)}
25let Te=g?"center":i.get("text-justify").evaluate(P,{},s.canonical);const Ce=i.get("symbol-placement")==="point"?i.get("text-max-width").evaluate(P,{},s.canonical)*Hr:1/0,je=()=>{s.bucket.allowVerticalPlacement&&ta(D)&&(F.vertical=Bh(j,s.glyphMap,s.glyphPositions,s.imagePositions,C,Ce,m,xe,"left",ie,J,x.ai.vertical,!0,z,E))};if(!g&&Fe){const Le=new Set;if(Te==="auto")for(let ke=0;ke<Fe.values.length;ke+=2)Le.add(Ld(Fe.values[ke]));else Le.add(Te);let Ne=!1;for(const ke of Le)if(!F.horizontal[ke])if(Ne)F.horizontal[ke]=F.horizontal[0];else{const it=Bh(j,s.glyphMap,s.glyphPositions,s.imagePositions,C,Ce,m,"center",ke,ie,J,x.ai.horizontal,!1,z,E);it&&(F.horizontal[ke]=it,Ne=it.positionedLines.length===1)}je()}else{Te==="auto"&&(Te=Ld(xe));const Le=Bh(j,s.glyphMap,s.glyphPositions,s.imagePositions,C,Ce,m,xe,Te,ie,J,x.ai.horizontal,!1,z,E);Le&&(F.horizontal[Te]=Le),je(),ta(D)&&g&&v&&(F.vertical=Bh(j,s.glyphMap,s.glyphPositions,s.imagePositions,C,Ce,m,xe,Te,ie,J,x.ai.vertical,!1,z,E))}}let pe=!1;if(P.icon&&P.icon.name){const D=s.imageMap[P.icon.name];D&&(G=qx(s.imagePositions[P.icon.name],i.get("icon-offset").evaluate(P,{},s.canonical),i.get("icon-anchor").evaluate(P,{},s.canonical)),pe=!!D.sdf,s.bucket.sdfIcons===void 0?s.bucket.sdfIcons=pe:s.bucket.sdfIcons!==pe&&ri("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(D.pixelRatio!==s.bucket.pixelRatio||i.get("icon-rotate").constantOr(1)!==0)&&(s.bucket.iconsNeedLinear=!0))}const re=Wg(F.horizontal)||F.vertical;s.bucket.iconsInText=!!re&&re.iconsInText,(re||G)&&o0(s.bucket,P,F,G,s.imageMap,h,z,L,J,pe,s.canonical,s.subdivisionGranularity)}s.showCollisionBoxes&&s.bucket.generateCollisionDebugBuffers()},x.cp=yd,x.cq=pd,x.cr=_d,x.cs=Wc,x.ct=bd,x.cu=class{constructor(s){this._marks={start:[s.url,"start"].join("#"),end:[s.url,"end"].join("#"),measure:s.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let s=performance.getEntriesByName(this._marks.measure);return s.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),s=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),s}},x.cv=function(s,t,i,a,h){return c(this,void 0,void 0,function*(){if(nt())try{return yield Oe(s,t,i,a,h)}catch{}return function(m,g,v,T,P){const C=m.width,E=m.height;Ke&&Ye||(Ke=new OffscreenCanvas(C,E),Ye=Ke.getContext("2d",{willReadFrequently:!0})),Ke.width=C,Ke.height=E,Ye.drawImage(m,0,0,C,E);const z=Ye.getImageData(g,v,T,P);return Ye.clearRect(0,0,C,E),z.data}(s,t,i,a,h)})},x.cw=kg,x.cx=B,x.cy=ne,x.cz=Xm,x.d=s=>c(void 0,void 0,void 0,function*(){if(s.byteLength===0)return createImageBitmap(new ImageData(1,1));const t=new Blob([new Uint8Array(s)],{type:"image/png"});try{return createImageBitmap(t)}catch(i){throw new Error(`Could not load image because of ${i.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),x.e=Ur,x.f=s=>new Promise((t,i)=>{const a=new Image;a.onload=()=>{t(a),URL.revokeObjectURL(a.src),a.onload=null,window.requestAnimationFrame(()=>{a.src=Be})},a.onerror=()=>i(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const h=new Blob([new Uint8Array(s)],{type:"image/png"});a.src=s.byteLength?URL.createObjectURL(h):Be}),x.g=ut,x.h=(s,t)=>Ft(Ur(s,{type:"json"}),t),x.i=fe,x.j=as,x.k=si,x.l=(s,t)=>Ft(Ur(s,{type:"arrayBuffer"}),t),x.m=Ft,x.n=function(s){return new bd(s).readFields(Rx,[])},x.o=Vc,x.p=lg,x.q=Ci,x.r=ed,x.s=Dr,x.t=ph,x.u=ea,x.v=H,x.w=ri,x.x=function([s,t,i]){return t+=90,t*=Math.PI/180,i*=Math.PI/180,{x:s*Math.cos(t)*Math.sin(i),y:s*Math.sin(t)*Math.sin(i),z:s*Math.cos(i)}},x.y=cs,x.z=dr}),b("worker",["./shared"],function(x){class c{constructor(N){this.keyCache={},N&&this.replace(N)}replace(N){this._layerConfigs={},this._layers={},this.update(N,[])}update(N,$){for(const te of N){this._layerConfigs[te.id]=te;const ce=this._layers[te.id]=x.bv(te);ce._featureFilter=x.a4(ce.filter),this.keyCache[te.id]&&delete this.keyCache[te.id]}for(const te of $)delete this.keyCache[te],delete this._layerConfigs[te],delete this._layers[te];this.familiesBySource={};const U=x.cj(Object.values(this._layerConfigs),this.keyCache);for(const te of U){const ce=te.map(ye=>this._layers[ye.id]),_e=ce[0];if(_e.visibility==="none")continue;const we=_e.source||"";let me=this.familiesBySource[we];me||(me=this.familiesBySource[we]={});const Ee=_e.sourceLayer||"_geojsonTileLayer";let Pe=me[Ee];Pe||(Pe=me[Ee]=[]),Pe.push(ce)}}}class B{constructor(N){const $={},U=[];for(const we in N){const me=N[we],Ee=$[we]={};for(const Pe in me){const ye=me[+Pe];if(!ye||ye.bitmap.width===0||ye.bitmap.height===0)continue;const de={x:0,y:0,w:ye.bitmap.width+2,h:ye.bitmap.height+2};U.push(de),Ee[Pe]={rect:de,metrics:ye.metrics}}}const{w:te,h:ce}=x.p(U),_e=new x.o({width:te||1,height:ce||1});for(const we in N){const me=N[we];for(const Ee in me){const Pe=me[+Ee];if(!Pe||Pe.bitmap.width===0||Pe.bitmap.height===0)continue;const ye=$[we][Ee].rect;x.o.copy(Pe.bitmap,_e,{x:0,y:0},{x:ye.x+1,y:ye.y+1},Pe.bitmap)}}this.image=_e,this.positions=$}}x.ck("GlyphAtlas",B);class q{constructor(N){this.tileID=new x.S(N.tileID.overscaledZ,N.tileID.wrap,N.tileID.canonical.z,N.tileID.canonical.x,N.tileID.canonical.y),this.uid=N.uid,this.zoom=N.zoom,this.pixelRatio=N.pixelRatio,this.tileSize=N.tileSize,this.source=N.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=N.showCollisionBoxes,this.collectResourceTiming=!!N.collectResourceTiming,this.returnDependencies=!!N.returnDependencies,this.promoteId=N.promoteId,this.inFlightDependencies=[]}parse(N,$,U,te,ce){return x._(this,void 0,void 0,function*(){this.status="parsing",this.data=N,this.collisionBoxArray=new x.a2;const _e=new x.cl(Object.keys(N.layers).sort()),we=new x.cm(this.tileID,this.promoteId);we.bucketLayerIDs=[];const me={},Ee={featureIndex:we,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:U,subdivisionGranularity:ce},Pe=$.familiesBySource[this.source];for(const ft in Pe){const tt=N.layers[ft];if(!tt)continue;tt.version===1&&x.w(`Vector tile source "${this.source}" layer "${ft}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Tr=_e.encode(ft),Us=[];for(let Zr=0;Zr<tt.length;Zr++){const Nr=tt.feature(Zr),ur=we.getId(Nr,ft);Us.push({feature:Nr,id:ur,index:Zr,sourceLayerIndex:Tr})}for(const Zr of Pe[ft]){const Nr=Zr[0];Nr.source!==this.source&&x.w(`layer.source = ${Nr.source} does not equal this.source = ${this.source}`),Nr.minzoom&&this.zoom<Math.floor(Nr.minzoom)||Nr.maxzoom&&this.zoom>=Nr.maxzoom||Nr.visibility!=="none"&&(Y(Zr,this.zoom,U),(me[Nr.id]=Nr.createBucket({index:we.bucketLayerIDs.length,layers:Zr,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Tr,sourceID:this.source})).populate(Us,Ee,this.tileID.canonical),we.bucketLayerIDs.push(Zr.map(ur=>ur.id)))}}const ye=x.bA(Ee.glyphDependencies,ft=>Object.keys(ft).map(Number));
25this.inFlightDependencies.forEach(ft=>ft==null?void 0:ft.abort()),this.inFlightDependencies=[];let de=Promise.resolve({});if(Object.keys(ye).length){const ft=new AbortController;this.inFlightDependencies.push(ft),de=te.sendAsync({type:"GG",data:{stacks:ye,source:this.source,tileID:this.tileID,type:"glyphs"}},ft)}const He=Object.keys(Ee.iconDependencies);let qe=Promise.resolve({});if(He.length){const ft=new AbortController;this.inFlightDependencies.push(ft),qe=te.sendAsync({type:"GI",data:{icons:He,source:this.source,tileID:this.tileID,type:"icons"}},ft)}const ht=Object.keys(Ee.patternDependencies);let yt=Promise.resolve({});if(ht.length){const ft=new AbortController;this.inFlightDependencies.push(ft),yt=te.sendAsync({type:"GI",data:{icons:ht,source:this.source,tileID:this.tileID,type:"patterns"}},ft)}const[ze,We,st]=yield Promise.all([de,qe,yt]),At=new B(ze),$t=new x.cn(We,st);for(const ft in me){const tt=me[ft];tt instanceof x.a3?(Y(tt.layers,this.zoom,U),x.co({bucket:tt,glyphMap:ze,glyphPositions:At.positions,imageMap:We,imagePositions:$t.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical,subdivisionGranularity:Ee.subdivisionGranularity})):tt.hasPattern&&(tt instanceof x.cp||tt instanceof x.cq||tt instanceof x.cr)&&(Y(tt.layers,this.zoom,U),tt.addFeatures(Ee,this.tileID.canonical,$t.patternPositions))}return this.status="done",{buckets:Object.values(me).filter(ft=>!ft.isEmpty()),featureIndex:we,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:At.image,imageAtlas:$t,glyphMap:this.returnDependencies?ze:null,iconMap:this.returnDependencies?We:null,glyphPositions:this.returnDependencies?At.positions:null}})}}function Y(H,N,$){const U=new x.z(N);for(const te of H)te.recalculate(U,$)}class ne{constructor(N,$,U){this.actor=N,this.layerIndex=$,this.availableImages=U,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(N,$){return x._(this,void 0,void 0,function*(){const U=yield x.l(N.request,$);try{return{vectorTile:new x.cs.VectorTile(new x.ct(U.data)),rawData:U.data,cacheControl:U.cacheControl,expires:U.expires}}catch(te){const ce=new Uint8Array(U.data);let _e=`Unable to parse the tile at ${N.request.url}, `;throw _e+=ce[0]===31&&ce[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${te.message}`,new Error(_e)}})}loadTile(N){return x._(this,void 0,void 0,function*(){const $=N.uid,U=!!(N&&N.request&&N.request.collectResourceTiming)&&new x.cu(N.request),te=new q(N);this.loading[$]=te;const ce=new AbortController;te.abort=ce;try{const _e=yield this.loadVectorTile(N,ce);if(delete this.loading[$],!_e)return null;const we=_e.rawData,me={};_e.expires&&(me.expires=_e.expires),_e.cacheControl&&(me.cacheControl=_e.cacheControl);const Ee={};if(U){const ye=U.finish();ye&&(Ee.resourceTiming=JSON.parse(JSON.stringify(ye)))}te.vectorTile=_e.vectorTile;const Pe=te.parse(_e.vectorTile,this.layerIndex,this.availableImages,this.actor,N.subdivisionGranularity);this.loaded[$]=te,this.fetching[$]={rawTileData:we,cacheControl:me,resourceTiming:Ee};try{const ye=yield Pe;return x.e({rawTileData:we.slice(0)},ye,me,Ee)}finally{delete this.fetching[$]}}catch(_e){throw delete this.loading[$],te.status="done",this.loaded[$]=te,_e}})}reloadTile(N){return x._(this,void 0,void 0,function*(){const $=N.uid;if(!this.loaded||!this.loaded[$])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const U=this.loaded[$];if(U.showCollisionBoxes=N.showCollisionBoxes,U.status==="parsing"){const te=yield U.parse(U.vectorTile,this.layerIndex,this.availableImages,this.actor,N.subdivisionGranularity);let ce;if(this.fetching[$]){const{rawTileData:_e,cacheControl:we,resourceTiming:me}=this.fetching[$];delete this.fetching[$],ce=x.e({rawTileData:_e.slice(0)},te,we,me)}else ce=te;return ce}if(U.status==="done"&&U.vectorTile)return U.parse(U.vectorTile,this.layerIndex,this.availableImages,this.actor,N.subdivisionGranularity)})}abortTile(N){return x._(this,void 0,void 0,function*(){const $=this.loading,U=N.uid;$&&$[U]&&$[U].abort&&($[U].abort.abort(),delete $[U])})}removeTile(N){return x._(this,void 0,void 0,function*(){this.loaded&&this.loaded[N.uid]&&delete this.loaded[N.uid]})}}class ge{constructor(){this.loaded={}}loadTile(N){return x._(this,void 0,void 0,function*(){const{uid:$,encoding:U,rawImageData:te,redFactor:ce,greenFactor:_e,blueFactor:we,baseShift:me}=N,Ee=te.width+2,Pe=te.height+2,ye=x.b(te)?new x.R({width:Ee,height:Pe},yield x.cv(te,-1,-1,Ee,Pe)):te,de=new x.cw($,ye,U,ce,_e,we,me);return this.loaded=this.loaded||{},this.loaded[$]=de,de})}removeTile(N){const $=this.loaded,U=N.uid;$&&$[U]&&delete $[U]}}var Q,Se,rt=function(){if(Se)return Q;function H($,U){if($.length!==0){N($[0],U);for(var te=1;te<$.length;te++)N($[te],!U)}}function N($,U){for(var te=0,ce=0,_e=0,we=$.length,me=we-1;_e<we;me=_e++){var Ee=($[_e][0]-$[me][0])*($[me][1]+$[_e][1]),Pe=te+Ee;ce+=Math.abs(te)>=Math.abs(Ee)?te-Pe+Ee:Ee-Pe+te,te=Pe}te+ce>=0!=!!U&&$.reverse()}return Se=1,Q=function $(U,te){var ce,_e=U&&U.type;if(_e==="FeatureCollection")for(ce=0;ce<U.features.length;ce++)$(U.features[ce],te);else if(_e==="GeometryCollection")for(ce=0;ce<U.geometries.length;ce++)$(U.geometries[ce],te);else if(_e==="Feature")$(U.geometry,te);else if(_e==="Polygon")H(U.coordinates,te);else if(_e==="MultiPolygon")for(ce=0;ce<U.coordinates.length;ce++)H(U.coordinates[ce],te);return U}}(),St=x.cx(rt);const vt=x.cs.VectorTileFeature.prototype.toGeoJSON;class bt{constructor(N){this._feature=N,this.extent=x.X,this.type=N.type,this.properties=N.tags,"id"in N&&!isNaN(N.id)&&(this.id=p
25arseInt(N.id,10))}loadGeometry(){if(this._feature.type===1){const N=[];for(const $ of this._feature.geometry)N.push([new x.P($[0],$[1])]);return N}{const N=[];for(const $ of this._feature.geometry){const U=[];for(const te of $)U.push(new x.P(te[0],te[1]));N.push(U)}return N}}toGeoJSON(N,$,U){return vt.call(this,N,$,U)}}class Pt{constructor(N){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=x.X,this.length=N.length,this._features=N}feature(N){return new bt(this._features[N])}}var nt,Ct,Xt,Et={exports:{}},pt=function(){if(Xt)return Et.exports;Xt=1;var H=x.cA(),N=function(){if(Ct)return nt;Ct=1;var Pe=x.cy(),ye=x.cz().VectorTileFeature;function de(qe,ht){this.options=ht||{},this.features=qe,this.length=qe.length}function He(qe,ht){this.id=typeof qe.id=="number"?qe.id:void 0,this.type=qe.type,this.rawGeometry=qe.type===1?[qe.geometry]:qe.geometry,this.properties=qe.tags,this.extent=ht||4096}return nt=de,de.prototype.feature=function(qe){return new He(this.features[qe],this.options.extent)},He.prototype.loadGeometry=function(){var qe=this.rawGeometry;this.geometry=[];for(var ht=0;ht<qe.length;ht++){for(var yt=qe[ht],ze=[],We=0;We<yt.length;We++)ze.push(new Pe(yt[We][0],yt[We][1]));this.geometry.push(ze)}return this.geometry},He.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var qe=this.geometry,ht=1/0,yt=-1/0,ze=1/0,We=-1/0,st=0;st<qe.length;st++)for(var At=qe[st],$t=0;$t<At.length;$t++){var ft=At[$t];ht=Math.min(ht,ft.x),yt=Math.max(yt,ft.x),ze=Math.min(ze,ft.y),We=Math.max(We,ft.y)}return[ht,ze,yt,We]},He.prototype.toGeoJSON=ye.prototype.toGeoJSON,nt}();function $(Pe){var ye=new H;return function(de,He){for(var qe in de.layers)He.writeMessage(3,U,de.layers[qe])}(Pe,ye),ye.finish()}function U(Pe,ye){var de;ye.writeVarintField(15,Pe.version||1),ye.writeStringField(1,Pe.name||""),ye.writeVarintField(5,Pe.extent||4096);var He={keys:[],values:[],keycache:{},valuecache:{}};for(de=0;de<Pe.length;de++)He.feature=Pe.feature(de),ye.writeMessage(2,te,He);var qe=He.keys;for(de=0;de<qe.length;de++)ye.writeStringField(3,qe[de]);var ht=He.values;for(de=0;de<ht.length;de++)ye.writeMessage(4,Ee,ht[de])}function te(Pe,ye){var de=Pe.feature;de.id!==void 0&&ye.writeVarintField(1,de.id),ye.writeMessage(2,ce,Pe),ye.writeVarintField(3,de.type),ye.writeMessage(4,me,de)}function ce(Pe,ye){var de=Pe.feature,He=Pe.keys,qe=Pe.values,ht=Pe.keycache,yt=Pe.valuecache;for(var ze in de.properties){var We=de.properties[ze],st=ht[ze];if(We!==null){st===void 0&&(He.push(ze),ht[ze]=st=He.length-1),ye.writeVarint(st);var At=typeof We;At!=="string"&&At!=="boolean"&&At!=="number"&&(We=JSON.stringify(We));var $t=At+":"+We,ft=yt[$t];ft===void 0&&(qe.push(We),yt[$t]=ft=qe.length-1),ye.writeVarint(ft)}}}function _e(Pe,ye){return(ye<<3)+(7&Pe)}function we(Pe){return Pe<<1^Pe>>31}function me(Pe,ye){for(var de=Pe.loadGeometry(),He=Pe.type,qe=0,ht=0,yt=de.length,ze=0;ze<yt;ze++){var We=de[ze],st=1;He===1&&(st=We.length),ye.writeVarint(_e(1,st));for(var At=He===3?We.length-1:We.length,$t=0;$t<At;$t++){$t===1&&He!==1&&ye.writeVarint(_e(2,At-1));var ft=We[$t].x-qe,tt=We[$t].y-ht;ye.writeVarint(we(ft)),ye.writeVarint(we(tt)),qe+=ft,ht+=tt}He===3&&ye.writeVarint(_e(7,1))}}function Ee(Pe,ye){var de=typeof Pe;de==="string"?ye.writeStringField(1,Pe):de==="boolean"?ye.writeBooleanField(7,Pe):de==="number"&&(Pe%1!=0?ye.writeDoubleField(3,Pe):Pe<0?ye.writeSVarintField(6,Pe):ye.writeVarintField(5,Pe))}return Et.exports=$,Et.exports.fromVectorTileJs=$,Et.exports.fromGeojsonVt=function(Pe,ye){ye=ye||{};var de={};for(var He in Pe)de[He]=new N(Pe[He].features,ye),de[He].name=He,de[He].version=ye.version,de[He].extent=ye.extent;return $({layers:de})},Et.exports.GeoJSONWrapper=N,Et.exports}(),jt=x.cx(pt);const cr={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:H=>H},kr=Math.fround||(Or=new Float32Array(1),H=>(Or[0]=+H,Or[0]));var Or;const zr=3,Mr=5,_s=6;class _t{constructor(N){this.options=Object.assign(Object.create(cr),N),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(N){const{log:$,minZoom:U,maxZoom:te}=this.options;$&&console.time("total time");const ce=`prepare ${N.length} points`;$&&console.time(ce),this.points=N;const _e=[];for(let me=0;me<N.length;me++){const Ee=N[me];if(!Ee.geometry)continue;
vendor: 4,667 bytes, line 25
25const[Pe,ye]=Ee.geometry.coordinates,de=kr(vi(Pe)),He=kr(Wi(ye));_e.push(de,He,1/0,me,-1,1),this.options.reduce&&_e.push(0)}let we=this.trees[te+1]=this._createTree(_e);$&&console.timeEnd(ce);for(let me=te;me>=U;me--){const Ee=+Date.now();we=this.trees[me]=this._createTree(this._cluster(we,me)),$&&console.log("z%d: %d clusters in %dms",me,we.numItems,+Date.now()-Ee)}return $&&console.timeEnd("total time"),this}getClusters(N,$){let U=((N[0]+180)%360+360)%360-180;const te=Math.max(-90,Math.min(90,N[1]));let ce=N[2]===180?180:((N[2]+180)%360+360)%360-180;const _e=Math.max(-90,Math.min(90,N[3]));if(N[2]-N[0]>=360)U=-180,ce=180;else if(U>ce){const ye=this.getClusters([U,te,180,_e],$),de=this.getClusters([-180,te,ce,_e],$);return ye.concat(de)}const we=this.trees[this._limitZoom($)],me=we.range(vi(U),Wi(_e),vi(ce),Wi(te)),Ee=we.data,Pe=[];for(const ye of me){const de=this.stride*ye;Pe.push(Ee[de+Mr]>1?It(Ee,de,this.clusterProps):this.points[Ee[de+zr]])}return Pe}getChildren(N){const $=this._getOriginId(N),U=this._getOriginZoom(N),te="No cluster with the specified id.",ce=this.trees[U];if(!ce)throw new Error(te);const _e=ce.data;if($*this.stride>=_e.length)throw new Error(te);const we=this.options.radius/(this.options.extent*Math.pow(2,U-1)),me=ce.within(_e[$*this.stride],_e[$*this.stride+1],we),Ee=[];for(const Pe of me){const ye=Pe*this.stride;_e[ye+4]===N&&Ee.push(_e[ye+Mr]>1?It(_e,ye,this.clusterProps):this.points[_e[ye+zr]])}if(Ee.length===0)throw new Error(te);return Ee}getLeaves(N,$,U){const te=[];return this._appendLeaves(te,N,$=$||10,U=U||0,0),te}getTile(N,$,U){const te=this.trees[this._limitZoom(N)],ce=Math.pow(2,N),{extent:_e,radius:we}=this.options,me=we/_e,Ee=(U-me)/ce,Pe=(U+1+me)/ce,ye={features:[]};return this._addTileFeatures(te.range(($-me)/ce,Ee,($+1+me)/ce,Pe),te.data,$,U,ce,ye),$===0&&this._addTileFeatures(te.range(1-me/ce,Ee,1,Pe),te.data,ce,U,ce,ye),$===ce-1&&this._addTileFeatures(te.range(0,Ee,me/ce,Pe),te.data,-1,U,ce,ye),ye.features.length?ye:null}getClusterExpansionZoom(N){let $=this._getOriginZoom(N)-1;for(;$<=this.options.maxZoom;){const U=this.getChildren(N);if($++,U.length!==1)break;N=U[0].properties.cluster_id}return $}_appendLeaves(N,$,U,te,ce){const _e=this.getChildren($);for(const we of _e){const me=we.properties;if(me&&me.cluster?ce+me.point_count<=te?ce+=me.point_count:ce=this._appendLeaves(N,me.cluster_id,U,te,ce):ce<te?ce++:N.push(we),N.length===U)break}return ce}_createTree(N){const $=new x.az(N.length/this.stride|0,this.options.nodeSize,Float32Array);for(let U=0;U<N.length;U+=this.stride)$.add(N[U],N[U+1]);return $.finish(),$.data=N,$}_addTileFeatures(N,$,U,te,ce,_e){for(const we of N){const me=we*this.stride,Ee=$[me+Mr]>1;let Pe,ye,de;if(Ee)Pe=Gt($,me,this.clusterProps),ye=$[me],de=$[me+1];else{const ht=this.points[$[me+zr]];Pe=ht.properties;const[yt,ze]=ht.geometry.coordinates;ye=vi(yt),de=Wi(ze)}const He={type:1,geometry:[[Math.round(this.options.extent*(ye*ce-U)),Math.round(this.options.extent*(de*ce-te))]],tags:Pe};let qe;qe=Ee||this.options.generateId?$[me+zr]:this.points[$[me+zr]].id,qe!==void 0&&(He.id=qe),_e.features.push(He)}}_limitZoom(N){return Math.max(this.options.minZoom,Math.min(Math.floor(+N),this.options.maxZoom+1))}_cluster(N,$){const{radius:U,extent:te,reduce:ce,minPoints:_e}=this.options,we=U/(te*Math.pow(2,$)),me=N.data,Ee=[],Pe=this.stride;for(let ye=0;ye<me.length;ye+=Pe){if(me[ye+2]<=$)continue;me[ye+2]=$;const de=me[ye],He=me[ye+1],qe=N.within(me[ye],me[ye+1],we),ht=me[ye+Mr];let yt=ht;for(const ze of qe){const We=ze*Pe;me[We+2]>$&&(yt+=me[We+Mr])}if(yt>ht&&yt>=_e){let ze,We=de*ht,st=He*ht,At=-1;const $t=((ye/Pe|0)<<5)+($+1)+this.points.length;for(const ft of qe){const tt=ft*Pe;if(me[tt+2]<=$)continue;me[tt+2]=$;const Tr=me[tt+Mr];We+=me[tt]*Tr,st+=me[tt+1]*Tr,me[tt+4]=$t,ce&&(ze||(ze=this._map(me,ye,!0),At=this.clusterProps.length,this.clusterProps.push(ze)),ce(ze,this._map(me,tt)))}me[ye+4]=$t,Ee.push(We/yt,st/yt,1/0,$t,-1,yt),ce&&Ee.push(At)}else{for(let ze=0;ze<Pe;ze++)Ee.push(me[ye+ze]);if(yt>1)for(const ze of qe){const We=ze*Pe;if(!(me[We+2]<=$)){me[We+2]=$;for(let st=0;st<Pe;st++)Ee.push(me[We+st])}}}}return Ee}_getOriginId(N){return N-this.points.length>>5}_getOriginZoom(N){return(N-this.points.length)%32}_map(N,$,U){if(N[$+Mr]>1){const _e=this.clusterProps[N[$+_s]];return U?Object.assign({},_e):_e}const te=this.points[N[$+zr]].properties,ce=this.options.map(te);return U&&ce===te?Object.assign({},ce):ce}}function It(H,N,$){return{type:"Feature",id:H[N+zr],properties:Gt(H,N,$),geometry:{type:"Point",coordinates:[(U=H[N],360*(U-.5)),Mi(H[N+1])]}};var U}function Gt(H,N,$){const U=H[N+Mr],te=U>=1e4?`${Math.round(U/1e3)}
25k`:U>=1e3?Math.round(U/100)/10+"k":U,ce=H[N+_s],_e=ce===-1?{}:Object.assign({},$[ce]);return Object.assign(_e,{cluster:!0,cluster_id:H[N+zr],point_count:U,point_count_abbreviated:te})}function vi(H){return H/360+.5}function Wi(H){const N=Math.sin(H*Math.PI/180),$=.5-.25*Math.log((1+N)/(1-N))/Math.PI;return $<0?0:$>1?1:$}function Mi(H){const N=(180-360*H)*Math.PI/180;return 360*Math.atan(Math.exp(N))/Math.PI-90}function Rr(H,N,$,U){let te=U;const ce=N+($-N>>1);let _e,we=$-N;const me=H[N],Ee=H[N+1],Pe=H[$],ye=H[$+1];for(let de=N+3;de<$;de+=3){const He=Pi(H[de],H[de+1],me,Ee,Pe,ye);if(He>te)_e=de,te=He;else if(He===te){const qe=Math.abs(de-ce);qe<we&&(_e=de,we=qe)}}te>U&&(_e-N>3&&Rr(H,N,_e,U),H[_e+2]=te,$-_e>3&&Rr(H,_e,$,U))}function Pi(H,N,$,U,te,ce){let _e=te-$,we=ce-U;if(_e!==0||we!==0){const me=((H-$)*_e+(N-U)*we)/(_e*_e+we*we);me>1?($=te,U=ce):me>0&&($+=_e*me,U+=we*me)}return _e=H-$,we=N-U,_e*_e+we*we}function Ii(H,N,$,U){const te={id:H??null,type:N,geometry:$,tags:U,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(N==="Point"||N==="MultiPoint"||N==="LineString")Ur(te,$);else if(N==="Polygon")Ur(te,$[0]);else if(N==="MultiLineString")for(const ce of $)Ur(te,ce);else if(N==="MultiPolygon")for(const ce of $)Ur(te,ce[0]);return te}function Ur(H,N){for(let $=0;$<N.length;$+=3)H.minX=Math.min(H.minX,N[$]),H.minY=Math.min(H.minY,N[$+1]),H.maxX=Math.max(H.maxX,N[$]),H.maxY=Math.max(H.maxY,N[$+1])}function Li(H,N,$,U){if(!N.geometry)return;const te=N.geometry.coordinates;if(te&&te.length===0)return;const ce=N.geometry.type,_e=Math.pow($.tolerance/((1<<$.maxZoom)*$.extent),2);let we=[],me=N.id;if($.promoteId?me=N.properties[$.promoteId]:$.generateId&&(me=U||0),ce==="Point")Xi(te,we);else if(ce==="MultiPoint")for(const Ee of te)Xi(Ee,we);else if(ce==="LineString")ss(te,we,_e,!1);else if(ce==="MultiLineString"){if($.lineMetrics){for(const Ee of te)we=[],ss(Ee,we,_e,!1),H.push(Ii(me,"LineString",we,N.properties));return}hi(te,we,_e,!1)}else if(ce==="Polygon")hi(te,we,_e,!0);else{if(ce!=="MultiPolygon"){if(ce==="GeometryCollection"){for(const Ee of N.geometry.geometries)Li(H,{id:me,geometry:Ee,properties:N.properties},$,U);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const Ee of te){const Pe=[];hi(Ee,Pe,_e,!0),we.push(Pe)}}H.push(Ii(me,ce,we,N.properties))}function Xi(H,N){N.push(ns(H[0]),ri(H[1]),0)}function ss(H,N,$,U){let te,ce,_e=0;for(let me=0;me<H.length;me++){const Ee=ns(H[me][0]),Pe=ri(H[me][1]);N.push(Ee,Pe,0),me>0&&(_e+=U?(te*Pe-Ee*ce)/2:Math.sqrt(Math.pow(Ee-te,2)+Math.pow(Pe-ce,2))),te=Ee,ce=Pe}const we=N.length-3;N[2]=1,Rr(N,0,we,$),N[we+2]=1,N.size=Math.abs(_e),N.start=0,N.end=N.size}function hi(H,N,$,U){for(let te=0;te<H.length;te++){const ce=[];ss(H[te],ce,$,U),N.push(ce)}}function ns(H){return H/360+.5}function ri(H){const N=Math.sin(H*Math.PI/180),$=.5-.25*Math.log((1+N)/(1-N))/Math.PI;return $<0?0:$>1?1:$}function ae(H,N,$,U,te,ce,_e,we){if(U/=N,ce>=($/=N)&&_e<U)return H;if(_e<$||ce>=U)return null;const me=[];for(const Ee of H){const Pe=Ee.geometry;let ye=Ee.type;const de=te===0?Ee.minX:Ee.minY,He=te===0?Ee.maxX:Ee.maxY;if(de>=$&&He<U){me.push(Ee);continue}if(He<$||de>=U)continue;let qe=[];if(ye==="Point"||ye==="MultiPoint")fe(Pe,qe,$,U,te);else if(ye==="LineString")Me(Pe,qe,$,U,te,!1,we.lineMetrics);else if(ye==="MultiLineString")Be(Pe,qe,$,U,te,!1);else if(ye==="Polygon")Be(Pe,qe,$,U,te,!0);else if(ye==="MultiPolygon")for(const ht of Pe){const yt=[];Be(ht,yt,$,U,te,!0),yt.length&&qe.push(yt)}if(qe.length){if(we.lineMetrics&&ye==="LineString"){for(const ht of qe)me.push(Ii(Ee.id,ye,ht,Ee.tags));continue}ye!=="LineString"&&ye!=="MultiLineString"||(qe.length===1?(ye="LineString",qe=qe[0]):ye="MultiLineString"),ye!=="Point"&&ye!=="MultiPoint"||(ye=qe.length===3?"Point":"MultiPoint"),me.push(Ii(Ee.id,ye,qe,Ee.tags))}}return me.length?me:null}function fe(H,N,$,U,te){for(let ce=0;ce<H.length;ce+=3){const _e=H[ce+te];_e>=$&&_e<=U&&Oe(N,H[ce],H[ce+1],H[ce+2])}}function Me(H,N,$,U,te,ce,_e){let we=Ve(H);const me=te===0?Ke:Ye;let Ee,Pe,ye=H.start;for(let yt=0;yt<H.length-3;yt+=3){const ze=H[yt],We=H[yt+1],st=H[yt+2],At=H[yt+3],$t=H[yt+4],ft=te===0?ze:We,tt=te===0?At:$t;let Tr=!1;_e&&(Ee=Math.sqrt(Math.pow(ze-At,2)+Math.pow(We-$t,2))),ft<$?tt>$&&(Pe=me(we,ze,We,At,$t,$),_e&&(we.start=ye+Ee*Pe)):ft>U?tt<U&&(Pe=me(we,ze,We,At,$t,U),_e&&(we.start=ye+Ee*Pe)):Oe(we,ze,We,st),tt<$&&ft>=$&&(Pe=me(we,ze,We,At,$t,$),Tr=!0),tt>U&&ft<=U&&(Pe=me(we,ze,We,At,$t,U),Tr=!0),!ce&&Tr&&(_e&&(we.end=ye+Ee*Pe),N.push(we),we=Ve(H)),_e&&(ye+=Ee)}let de=H.length-3;const He=H[de],qe=H[de+1],ht=te===0?He:qe;ht>=$&&ht<=U&&Oe(we,He,qe,H[de+2]),de=we.length-3,ce&&de>=3&&(we[de]!==we[0]||we[de+1]!==we[1])&&Oe(we,we[0],we[1],we[2]),we.length&&N.push(we)}function Ve(H){const N=[];return N.size=H.size,N.start=H.start,N.end=H.end,N}function Be(H,N,$,U,te,ce){for(const _e of H)Me(_e,N,$,U,te,ce,!1)}function Oe(H,N,$,U){H.push(N,$,U)}function Ke(H,N,$,U,te,ce){const _e=(ce-N)/(U-N);return Oe(H,ce,$+(te-$)*_e,1),_e}function Ye(H,N,$,U,te,ce){const _e=(ce-$)/(te-$);return Oe(H,N+(U-N)*_e,ce,1),_e}function Ze(H,N){const $=[];for(let U=0;U<H.length;U++){const te=H[U],ce=te.type;let _e;if(ce==="Point"||ce==="MultiPoint"||ce==="LineString")_e=$e(te.geometry,N);else if(ce==="MultiLineString"||ce==="Polygon"){_e=[];for(const we of te.geometry)_e.push($e(we,N))}else if(ce==="MultiPolygon"){_e=[];for(const we of te.geometry){const me=[];for(const Ee of we)me.push($e(Ee,N));_e.push(me)}}$.push(Ii(te.id,ce,_e,te.tags))}return $}function $e(H,N){const $=[];$.size=H.size,H.start!==void 0&&($.start=H.start,$.end=H.end);for(let U=0;U<H.length;U+=3)$.push(H[U]+N,H[U+1],H[U+2]);return $}
vendor: 5,185 bytes, line 25
25function dt(H,N){if(H.transformed)return H;const $=1<<H.z,U=H.x,te=H.y;for(const ce of H.features){const _e=ce.geometry,we=ce.type;if(ce.geometry=[],we===1)for(let me=0;me<_e.length;me+=2)ce.geometry.push(et(_e[me],_e[me+1],N,$,U,te));else for(let me=0;me<_e.length;me++){const Ee=[];for(let Pe=0;Pe<_e[me].length;Pe+=2)Ee.push(et(_e[me][Pe],_e[me][Pe+1],N,$,U,te));ce.geometry.push(Ee)}}return H.transformed=!0,H}function et(H,N,$,U,te,ce){return[Math.round($*(H*U-te)),Math.round($*(N*U-ce))]}function ut(H,N,$,U,te){const ce=N===te.maxZoom?0:te.tolerance/((1<<N)*te.extent),_e={features:[],numPoints:0,numSimplified:0,numFeatures:H.length,source:null,x:$,y:U,z:N,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const we of H)gt(_e,we,ce,te);return _e}function gt(H,N,$,U){const te=N.geometry,ce=N.type,_e=[];if(H.minX=Math.min(H.minX,N.minX),H.minY=Math.min(H.minY,N.minY),H.maxX=Math.max(H.maxX,N.maxX),H.maxY=Math.max(H.maxY,N.maxY),ce==="Point"||ce==="MultiPoint")for(let we=0;we<te.length;we+=3)_e.push(te[we],te[we+1]),H.numPoints++,H.numSimplified++;else if(ce==="LineString")Mt(_e,te,H,$,!1,!1);else if(ce==="MultiLineString"||ce==="Polygon")for(let we=0;we<te.length;we++)Mt(_e,te[we],H,$,ce==="Polygon",we===0);else if(ce==="MultiPolygon")for(let we=0;we<te.length;we++){const me=te[we];for(let Ee=0;Ee<me.length;Ee++)Mt(_e,me[Ee],H,$,!0,Ee===0)}if(_e.length){let we=N.tags||null;if(ce==="LineString"&&U.lineMetrics){we={};for(const Ee in N.tags)we[Ee]=N.tags[Ee];we.mapbox_clip_start=te.start/te.size,we.mapbox_clip_end=te.end/te.size}const me={geometry:_e,type:ce==="Polygon"||ce==="MultiPolygon"?3:ce==="LineString"||ce==="MultiLineString"?2:1,tags:we};N.id!==null&&(me.id=N.id),H.features.push(me)}}function Mt(H,N,$,U,te,ce){const _e=U*U;if(U>0&&N.size<(te?_e:U))return void($.numPoints+=N.length/3);const we=[];for(let me=0;me<N.length;me+=3)(U===0||N[me+2]>_e)&&($.numSimplified++,we.push(N[me],N[me+1])),$.numPoints++;te&&function(me,Ee){let Pe=0;for(let ye=0,de=me.length,He=de-2;ye<de;He=ye,ye+=2)Pe+=(me[ye]-me[He])*(me[ye+1]+me[He+1]);if(Pe>0===Ee)for(let ye=0,de=me.length;ye<de/2;ye+=2){const He=me[ye],qe=me[ye+1];me[ye]=me[de-2-ye],me[ye+1]=me[de-1-ye],me[de-2-ye]=He,me[de-1-ye]=qe}}(we,ce),H.push(we)}const Wt={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class Ft{constructor(N,$){const U=($=this.options=function(ce,_e){for(const we in _e)ce[we]=_e[we];return ce}(Object.create(Wt),$)).debug;if(U&&console.time("preprocess data"),$.maxZoom<0||$.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if($.promoteId&&$.generateId)throw new Error("promoteId and generateId cannot be used together.");let te=function(ce,_e){const we=[];if(ce.type==="FeatureCollection")for(let me=0;me<ce.features.length;me++)Li(we,ce.features[me],_e,me);else Li(we,ce.type==="Feature"?ce:{geometry:ce},_e);return we}(N,$);this.tiles={},this.tileCoords=[],U&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",$.indexMaxZoom,$.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),te=function(ce,_e){const we=_e.buffer/_e.extent;let me=ce;const Ee=ae(ce,1,-1-we,we,0,-1,2,_e),Pe=ae(ce,1,1-we,2+we,0,-1,2,_e);return(Ee||Pe)&&(me=ae(ce,1,-we,1+we,0,-1,2,_e)||[],Ee&&(me=Ze(Ee,1).concat(me)),Pe&&(me=me.concat(Ze(Pe,-1)))),me}(te,$),te.length&&this.splitTile(te,0,0,0),U&&(te.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(N,$,U,te,ce,_e,we){const me=[N,$,U,te],Ee=this.options,Pe=Ee.debug;for(;me.length;){te=me.pop(),U=me.pop(),$=me.pop(),N=me.pop();const ye=1<<$,de=Dr($,U,te);let He=this.tiles[de];if(!He&&(Pe>1&&console.time("creation"),He=this.tiles[de]=ut(N,$,U,te,Ee),this.tileCoords.push({z:$,x:U,y:te}),Pe)){Pe>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",$,U,te,He.numFeatures,He.numPoints,He.numSimplified),console.timeEnd("creation"));const Tr=`z${$}`;this.stats[Tr]=(this.stats[Tr]||0)+1,this.total++}if(He.source=N,ce==null){if($===Ee.indexMaxZoom||He.numPoints<=Ee.indexMaxPoints)continue}else{if($===Ee.maxZoom||$===ce)continue;if(ce!=null){const Tr=ce-$;if(U!==_e>>Tr||te!==we>>Tr)continue}}if(He.source=null,N.length===0)continue;Pe>1&&console.time("clipping");const qe=.5*Ee.buffer/Ee.extent,ht=.5-qe,yt=.5+qe,ze=1+qe;let We=null,st=null,At=null,$t=null,ft=ae(N,ye,U-qe,U+yt,0,He.minX,He.maxX,Ee),tt=ae(N,ye,U+ht,U+ze,0,He.minX,He.maxX,Ee);N=null,ft&&(We=ae(ft,ye,te-qe,te+yt,1,He.minY,He.maxY,Ee),st=ae(ft,ye,te+ht,te+ze,1,He.minY,He.maxY,Ee),ft=null),tt&&(At=ae(tt,ye,te-qe,te+yt,1,He.minY,He.maxY,Ee),$t=ae(tt,ye,te+ht,te+ze,1,He.minY,He.maxY,Ee),tt=null),Pe>1&&console.timeEnd("clipping"),me.push(We||[],$+1,2*U,2*te),me.push(st||[],$+1,2*U,2*te+1),me.push(At||[],$+1,2*U+1,2*te),me.push($t||[],$+1,2*U+1,2*te+1)}}getTile(N,$,U){N=+N,$=+$,U=+U;const te=this.options,{extent:ce,debug:_e}=te;if(N<0||N>24)return null;const we=1<<N,me=Dr(N,$=$+we&we-1,U);if(this.tiles[me])return dt(this.tiles[me],ce);_e>
251&&console.log("drilling down to z%d-%d-%d",N,$,U);let Ee,Pe=N,ye=$,de=U;for(;!Ee&&Pe>0;)Pe--,ye>>=1,de>>=1,Ee=this.tiles[Dr(Pe,ye,de)];return Ee&&Ee.source?(_e>1&&(console.log("found parent tile z%d-%d-%d",Pe,ye,de),console.time("drilling down")),this.splitTile(Ee.source,Pe,ye,de,N,$,U),_e>1&&console.timeEnd("drilling down"),this.tiles[me]?dt(this.tiles[me],ce):null):null}}function Dr(H,N,$){return 32*((1<<H)*$+N)+H}function wr(H,N){return N?H.properties[N]:H.id}function ii(H,N){if(H==null)return!0;if(H.type==="Feature")return wr(H,N)!=null;if(H.type==="FeatureCollection"){const $=new Set;for(const U of H.features){const te=wr(U,N);if(te==null||$.has(te))return!1;$.add(te)}return!0}return!1}function si(H,N){const $=new Map;if(H!=null)if(H.type==="Feature")$.set(wr(H,N),H);else for(const U of H.features)$.set(wr(U,N),U);return $}class as extends ne{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile(N,$){return x._(this,void 0,void 0,function*(){const U=N.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");const te=this._geoJSONIndex.getTile(U.z,U.x,U.y);if(!te)return null;const ce=new Pt(te.features);let _e=jt(ce);return _e.byteOffset===0&&_e.byteLength===_e.buffer.byteLength||(_e=new Uint8Array(_e)),{vectorTile:ce,rawData:_e.buffer}})}loadData(N){return x._(this,void 0,void 0,function*(){var $;($=this._pendingRequest)===null||$===void 0||$.abort();const U=!!(N&&N.request&&N.request.collectResourceTiming)&&new x.cu(N.request);this._pendingRequest=new AbortController;try{this._pendingData=this.loadAndProcessGeoJSON(N,this._pendingRequest),this._geoJSONIndex=N.cluster?new _t(function({superclusterOptions:_e,clusterProperties:we}){if(!we||!_e)return _e;const me={},Ee={},Pe={accumulated:null,zoom:0},ye={properties:null},de=Object.keys(we);for(const He of de){const[qe,ht]=we[He],yt=x.cB(ht),ze=x.cB(typeof qe=="string"?[qe,["accumulated"],["get",He]]:qe);me[He]=yt.value,Ee[He]=ze.value}return _e.map=He=>{ye.properties=He;const qe={};for(const ht of de)qe[ht]=me[ht].evaluate(Pe,ye);return qe},_e.reduce=(He,qe)=>{ye.properties=qe;for(const ht of de)Pe.accumulated=He[ht],He[ht]=Ee[ht].evaluate(Pe,ye)},_e}(N)).load((yield this._pendingData).features):(te=yield this._pendingData,new Ft(te,N.geojsonVtOptions)),this.loaded={};const ce={};if(U){const _e=U.finish();_e&&(ce.resourceTiming={},ce.resourceTiming[N.source]=JSON.parse(JSON.stringify(_e)))}return ce}catch(ce){if(delete this._pendingRequest,x.cf(ce))return{abandoned:!0};throw ce}var te})}getData(){return x._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(N){const $=this.loaded;return $&&$[N.uid]?super.reloadTile(N):this.loadTile(N)}loadAndProcessGeoJSON(N,$){return x._(this,void 0,void 0,function*(){let U=yield this.loadGeoJSON(N,$);if(delete this._pendingRequest,typeof U!="object")throw new Error(`Input data given to '${N.source}' is not a valid GeoJSON object.`);if(St(U,!0),N.filter){const te=x.cB(N.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(te.result==="error")throw new Error(te.value.map(ce=>`${ce.key}: ${ce.message}`).join(", "));U={type:"FeatureCollection",features:U.features.filter(ce=>te.value.evaluate({zoom:0},ce))}}return U})}loadGeoJSON(N,$){return x._(this,void 0,void 0,function*(){const{promoteId:U}=N;if(N.request){const te=yield x.h(N.request,$);return this._dataUpdateable=ii(te.data,U)?si(te.data,U):void 0,te.data}
25if(typeof N.data=="string")try{const te=JSON.parse(N.data);return this._dataUpdateable=ii(te,U)?si(te,U):void 0,te}catch{throw new Error(`Input data given to '${N.source}' is not a valid GeoJSON object.`)}if(!N.dataDiff)throw new Error(`Input data given to '${N.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${N.source}`);return function(te,ce,_e){var we,me,Ee,Pe;if(ce.removeAll&&te.clear(),ce.remove)for(const ye of ce.remove)te.delete(ye);if(ce.add)for(const ye of ce.add){const de=wr(ye,_e);de!=null&&te.set(de,ye)}if(ce.update)for(const ye of ce.update){let de=te.get(ye.id);if(de==null)continue;const He=!ye.removeAllProperties&&(((we=ye.removeProperties)===null||we===void 0?void 0:we.length)>0||((me=ye.addOrUpdateProperties)===null||me===void 0?void 0:me.length)>0);if((ye.newGeometry||ye.removeAllProperties||He)&&(de=Object.assign({},de),te.set(ye.id,de),He&&(de.properties=Object.assign({},de.properties))),ye.newGeometry&&(de.geometry=ye.newGeometry),ye.removeAllProperties)de.properties={};else if(((Ee=ye.removeProperties)===null||Ee===void 0?void 0:Ee.length)>0)for(const qe of ye.removeProperties)Object.prototype.hasOwnProperty.call(de.properties,qe)&&delete de.properties[qe];if(((Pe=ye.addOrUpdateProperties)===null||Pe===void 0?void 0:Pe.length)>0)for(const{key:qe,value:ht}of ye.addOrUpdateProperties)de.properties[qe]=ht}}(this._dataUpdateable,N.dataDiff,U),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(N){return x._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(N){return this._geoJSONIndex.getClusterExpansionZoom(N.clusterId)}
25getClusterChildren(N){return this._geoJSONIndex.getChildren(N.clusterId)}getClusterLeaves(N){return this._geoJSONIndex.getLeaves(N.clusterId,N.limit,N.offset)}}class os{constructor(N){this.self=N,this.actor=new x.F(N),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=($,U)=>{if(this.externalWorkerSourceTypes[$])throw new Error(`Worker source with name "${$}" already registered.`);this.externalWorkerSourceTypes[$]=U},this.self.addProtocol=x.ch,this.self.removeProtocol=x.ci,this.self.registerRTLTextPlugin=$=>{x.cC.setMethods($)},this.actor.registerMessageHandler("LDT",($,U)=>this._getDEMWorkerSource($,U.source).loadTile(U)),this.actor.registerMessageHandler("RDT",($,U)=>x._(this,void 0,void 0,function*(){this._getDEMWorkerSource($,U.source).removeTile(U)})),this.actor.registerMessageHandler("GCEZ",($,U)=>x._(this,void 0,void 0,function*(){return this._getWorkerSource($,U.type,U.source).getClusterExpansionZoom(U)})),this.actor.registerMessageHandler("GCC",($,U)=>x._(this,void 0,void 0,function*(){return this._getWorkerSource($,U.type,U.source).getClusterChildren(U)})),this.actor.registerMessageHandler("GCL",($,U)=>x._(this,void 0,void 0,function*(){return this._getWorkerSource($,U.type,U.source).getClusterLeaves(U)})),this.actor.registerMessageHandler("LD",($,U)=>this._getWorkerSource($,U.type,U.source).loadData(U)),this.actor.registerMessageHandler("GD",($,U)=>this._getWorkerSource($,U.type,U.source).getData()),this.actor.registerMessageHandler("LT",($,U)=>this._getWorkerSource($,U.type,U.source).loadTile(U)),this.actor.registerMessageHandler("RT",($,U)=>this._getWorkerSource($,U.type,U.source).reloadTile(U)),this.actor.registerMessageHandler("AT",($,U)=>this._getWorkerSource($,U.type,U.source).abortTile(U)),this.actor.registerMessageHandler("RMT",($,U)=>this._getWorkerSource($,U.type,U.source).removeTile(U)),this.actor.registerMessageHandler("RS",($,U)=>x._(this,void 0,void 0,function*(){if(!this.workerSources[$]||!this.workerSources[$][U.type]||!this.workerSources[$][U.type][U.source])return;const te=this.workerSources[$][U.type][U.source];delete this.workerSources[$][U.type][U.source],te.removeSource!==void 0&&te.removeSource(U)})),this.actor.registerMessageHandler("RM",$=>x._(this,void 0,void 0,function*(){delete this.layerIndexes[$],delete this.availableImages[$],delete this.workerSources[$],delete this.demWorkerSources[$]})),this.actor.registerMessageHandler("SR",($,U)=>x._(this,void 0,void 0,function*(){this.referrer=U})),this.actor.registerMessageHandler("SRPS",($,U)=>this._syncRTLPluginState($,U)),this.actor.registerMessageHandler("IS",($,U)=>x._(this,void 0,void 0,function*(){this.self.importScripts(U)})),this.actor.registerMessageHandler("SI",($,U)=>this._setImages($,U)),this.actor.registerMessageHandler("UL",($,U)=>x._(this,void 0,void 0,function*(){this._getLayerIndex($).update(U.layers,U.removedIds)})),this.actor.registerMessageHandler("SL",($,U)=>x._(this,void 0,void 0,function*(){this._getLayerIndex($).replace(U)}))}_setImages(N,$){return x._(this,void 0,void 0,function*(){this.availableImages[N]=$;for(const U in this.workerSources[N]){const te=this.workerSources[N][U];for(const ce in te)te[ce].availableImages=$}})}_syncRTLPluginState(N,$){return x._(this,void 0,void 0,function*(){return yield x.cC.syncState($,this.self.importScripts)})}_getAvailableImages(N){let $=this.availableImages[N];return $||($=[]),$}_getLayerIndex(N){let $=this.layerIndexes[N];return $||($=this.layerIndexes[N]=new c),$}_getWorkerSource(N,$,U){if(this.workerSources[N]||(this.workerSources[N]={}),this.workerSources[N][$]||(this.workerSources[N][$]={}),!this.workerSources[N][$][U]){const te={sendAsync:(ce,_e)=>(ce.targetMapId=N,this.actor.sendAsync(ce,_e))};switch($){case"vector":this.workerSources[N][$][U]=new ne(te,this._getLayerIndex(N),this._getAvailableImages(N));break;case"geojson":this.workerSources[N][$][U]=new as(te,this._getLayerIndex(N),this._getAvailableImages(N));break;default:this.workerSources[N][$][U]=new this.externalWorkerSourceTypes[$](te,this._getLayerIndex(N),this._getAvailableImages(N))}}return this.workerSources[N][$][U]}_getDEMWorkerSource(N,$){return this.demWorkerSources[N]||(this.demWorkerSources[N]={}),this.demWorkerSources[N][$]||(this.demWorkerSources[N][$]=new ge),this.demWorkerSources[N][$]}}return x.i(self)&&(self.worker=new os(self)),os}),b("index",["exports","./shared"],function(x,c){var B="5.1.0";function q(){var d=new c.A(4);return c.A!=Float32Array&&(d[1]=0,d[2]=0),d[0]=1,d[3]=1,d}let Y,ne;const ge={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(d,e,r){const o=requestAnimationFrame(e);d.signal.addEventListener("abort",()=>{cancelAnimationFrame(o),r(c.c())})},frameAsync(d){return new Promise((e,r)=>{this.frame(d,e,r)})},getImageData(d,e=0){return this.getImageCanvasContext(d).getImageData(-e,-e,d.width+2*e,d.height+2*e)},getImageCanvasContext(d){const e=window.document.createElement("canvas"),r=e.getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("failed to create canvas 2d context");return e.width=d.width,e.height=d.height,r.drawImage(d,0,0,d.width,d.height),r},resolveURL:d=>
vendor: 11,715 bytes, line 25
25(Y||(Y=document.createElement("a")),Y.href=d,Y.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(ne==null&&(ne=matchMedia("(prefers-reduced-motion: reduce)")),ne.matches)}};class Q{static testProp(e){if(!Q.docStyle)return e[0];for(let r=0;r<e.length;r++)if(e[r]in Q.docStyle)return e[r];return e[0]}static create(e,r,o){const u=window.document.createElement(e);return r!==void 0&&(u.className=r),o&&o.appendChild(u),u}static createNS(e,r){return window.document.createElementNS(e,r)}static disableDrag(){Q.docStyle&&Q.selectProp&&(Q.userSelect=Q.docStyle[Q.selectProp],Q.docStyle[Q.selectProp]="none")}static enableDrag(){Q.docStyle&&Q.selectProp&&(Q.docStyle[Q.selectProp]=Q.userSelect)}static setTransform(e,r){e.style[Q.transformProp]=r}static addEventListener(e,r,o,u={}){e.addEventListener(r,o,"passive"in u?u:u.capture)}static removeEventListener(e,r,o,u={}){e.removeEventListener(r,o,"passive"in u?u:u.capture)}static suppressClickInternal(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",Q.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",Q.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",Q.suppressClickInternal,!0)},0)}static getScale(e){const r=e.getBoundingClientRect();return{x:r.width/e.offsetWidth||1,y:r.height/e.offsetHeight||1,boundingClientRect:r}}static getPoint(e,r,o){const u=r.boundingClientRect;return new c.P((o.clientX-u.left)/r.x-e.clientLeft,(o.clientY-u.top)/r.y-e.clientTop)}static mousePos(e,r){const o=Q.getScale(e);return Q.getPoint(e,o,r)}static touchPos(e,r){const o=[],u=Q.getScale(e);for(let f=0;f<r.length;f++)o.push(Q.getPoint(e,u,r[f]));return o}static mouseButton(e){return e.button}static remove(e){e.parentNode&&e.parentNode.removeChild(e)}static sanitize(e){const r=new DOMParser().parseFromString(e,"text/html").body||document.createElement("body"),o=r.querySelectorAll("script");for(const u of o)u.remove();return Q.clean(r),r.innerHTML}static isPossiblyDangerous(e,r){const o=r.replace(/\s+/g,"").toLowerCase();return!(!["src","href","xlink:href"].includes(e)||!o.includes("javascript:")&&!o.includes("data:"))||!!e.startsWith("on")||void 0}static clean(e){const r=e.children;for(const o of r)Q.removeAttributes(o),Q.clean(o)}static removeAttributes(e){for(const{name:r,value:o}of e.attributes)Q.isPossiblyDangerous(r,o)&&e.removeAttribute(r)}}Q.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,Q.selectProp=Q.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),Q.transformProp=Q.testProp(["transform","WebkitTransform"]);const Se={supported:!1,testSupport:function(d){!vt&&St&&(bt?Pt(d):rt=d)}};let rt,St,vt=!1,bt=!1;function Pt(d){const e=d.createTexture();d.bindTexture(d.TEXTURE_2D,e);try{if(d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,St),d.isContextLost())return;Se.supported=!0}catch{}d.deleteTexture(e),vt=!0}var nt;typeof document<"u"&&(St=document.createElement("img"),St.onload=()=>{rt&&Pt(rt),rt=null,bt=!0},St.onerror=()=>{vt=!0,rt=null},St.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(d){let e,r,o,u;d.resetRequestQueue=()=>{e=[],r=0,o=0,u={}},d.addThrottleControl=S=>{const I=o++;return u[I]=S,I},d.removeThrottleControl=S=>{delete u[S],y()},d.getImage=(S,I,A=!0)=>new Promise((k,R)=>{Se.supported&&(S.headers||(S.headers={}),S.headers.accept="image/webp,*/*"),c.e(S,{type:"image"}),e.push({abortController:I,requestParameters:S,supportImageRefresh:A,state:"queued",onError:O=>{R(O)},onSuccess:O=>{k(O)}}),y()});const f=S=>c._(this,void 0,void 0,function*(){S.state="running";const{requestParameters:I,supportImageRefresh:A,onError:k,onSuccess:R,abortController:O}=S,V=A===!1&&!c.i(self)&&!c.g(I.url)&&(!I.headers||Object.keys(I.headers).reduce((K,ee)=>K&&ee==="accept",!0));r++;const X=V?w(I,O):c.m(I,O);try{const K=yield X;delete S.abortController,S.state="completed",K.data instanceof HTMLImageElement||c.b(K.data)?R(K):K.data&&R({data:yield(W=K.data,typeof createImageBitmap=="function"?c.d(W):c.f(W)),cacheControl:K.cacheControl,expires:K.expires})}catch(K){delete S.abortController,k(K)}finally{r--,y()}var W}),y=()=>{const S=(()=>{for(const I of Object.keys(u))if(u[I]())return!0;return!1})()?c.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:c.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let I=r;I<S&&e.length>0;I++){const A=e.shift();A.abortController.signal.aborted?I--:f(A)}},w=(S,I)=>new Promise((A,k)=>{const R=new Image,O=S.url,V=S.credentials;V&&V==="include"?R.crossOrigin="use-credentials":(V&&V==="same-origin"||!c.s(O))&&(R.crossOrigin="anonymous"),I.signal.addEventListener("abort",()=>{R.src="",k(c.c())}),R.fetchPriority="high",R.onload=()=>{R.onerror=R.onload=null,A({data:R})},R.onerror=()=>{R.onerror=R.onload=null,I.signal.aborted||k(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},R.src=O})}(nt||(nt={})),nt.resetRequestQueue();class Ct{constructor(e){this._transformRequestFn=e}transformRequest(e,r){return this._transformRequestFn&&this._transformRequestFn(e,r)||{url:e}}setTransformRequest(e){this._transformRequestFn=e}}function Xt(d){const e=[];if(typeof d=="string")e.push({id:"default",url:d});else if(d&&d.length>0){const r=[];for(const{id:o,url:u}of d){const f=`${o}${u}`;r.indexOf(f)===-1&&(r.push(f),e.push({id:o,url:u}))}}return e}function Et(d,e,r){try{const o=new URL(d);return o.pathname+=`${e}${r}`,o.toString()}catch{throw new Error(`Invalid sprite URL "${d}", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically`)}}class pt{constructor(e,r,o,u){this.context=e,this.format=o,this.texture=e.gl.createTexture(),this.update(r,u)}update(e,r,o){const{width:u,height:f}=e,y=!(this.size&&this.size[0]===u&&this.size[1]===f||o),{context:w}=this,{gl:S}=w;if(this.useMipmap=!!(r&&r.useMipmap),S.bindTexture(S.TEXTURE_2D,this.texture),w.pixelStoreUnpackFlipY.set(!1),w.pixelStoreUnpack.set(1),w.pixelStoreUnpackPremultiplyAlpha.set(this.format===S.RGBA&&(!r||r.premultiply!==!1)),y)this.size=[u,f],e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||c.b(e)?S.texImage2D(S.TEXTURE_2D,0,this.format,this.format,S.UNSIGNED_BYTE,e):S.texImage2D(S.TEXTURE_2D,0,this.format,u,f,0,this.format,S.UNSIGNED_BYTE,e.data);else{const{x:I,y:A}=o||{x:0,y:0};e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||c.b(e)?S.texSubImage2D(S.TEXTURE_2D,0,I,A,S.RGBA,S.UNSIGNED_BYTE,e):S.texSubImage2D(S.TEXTURE_2D,0,I,A,u,f,S.RGBA,S.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&S.generateMipmap(S.TEXTURE_2D)}bind(e,r,o){const{context:u}=this,{gl:f}=u;f.bindTexture(f.TEXTURE_2D,this.texture),o!==f.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(o=f.LINEAR),e!==this.filter&&(f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,e),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,o||e),this.filter=e),r!==this.wrap&&(f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,r),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,r),this.wrap=r)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}function jt(d){const{userImage:e}=d;return!!(e&&e.render&&e.render())&&(d.data.replace(new Uint8Array(e.data.buffer)),!0)}class cr extends c.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new c.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(e){if(this.loaded!==e&&(this.loaded=e,e)){for(const{ids:r,promiseResolve:o}of this.requestors)o(this._getImagesForIds(r));this.requestors=[]}}getImage(e){const r=this.images[e];if(r&&!r.data&&r.spriteData){const o=r.spriteData;r.data=new c.R({width:o.width,height:o.height},o.context.getImageData(o.x,o.y,o.width,o.height).data),r.spriteData=null}return r}addImage(e,r){if(this.images[e])throw new Error(`Image id ${e} already exist, use updateImage instead`);this._validate(e,r)&&(this.images[e]=r)}_validate(e,r){let o=!0;const u=r.data||r.spriteData;return this._validateStretch(r.stretchX,u&&u.width)||(this.fire(new c.j(new Error(`Image "${e}" has invalid "stretchX" value`))),o=!1),this._validateStretch(r.stretchY,u&&u.height)||(this.fire(new c.j(new Error(`Image "${e}" has invalid "stretchY" value`))),o=!1),this._validateContent(r.content,r)||(this.fire(new c.j(new Error(`Image "${e}" has invalid "content" value`))),o=!1),o}_validateStretch(e,r){if(!e)return!0;let o=0;for(const u of e){if(u[0]<o||u[1]<u[0]||r<u[1])return!1;o=u[1]}return!0}_validateContent(e,r){if(!e)return!0;if(e.length!==4)return!1;const o=r.spriteData,u=o&&o.width||r.data.width,f=o&&o.height||r.data.height;return!(e[0]<0||u<e[0]||e[1]<0||f<e[1]||e[2]<0||u<e[2]||e[3]<0||f<e[3]||e[2]<e[0]||e[3]<e[1])}updateImage(e,r,o=!0){const u=this.getImage(e);if(o&&(u.data.width!==r.data.width||u.data.height!==r.data.height))throw new Error(`size mismatch between old image (${u.data.width}x${u.data.height}) and new image (${r.data.width}x${r.data.height}).`);r.version=u.version+1,this.images[e]=r,this.updatedImages[e]=!0}removeImage(e){const r=this.images[e];delete this.images[e],delete this.patterns[e],r.userImage&&r.userImage.onRemove&&r.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(e){return new Promise((r,o)=>{let u=!0;if(!this.isLoaded())for(const f of e)this.images[f]||(u=!1);this.isLoaded()||u?r(this._getImagesForIds(e)):this.requestors.push({ids:e,promiseResolve:r})})}_getImagesForIds(e){const r={};for(const o of e){let u=this.getImage(o);u||(this.fire(new c.k("styleimagemissing",{id:o})),u=this.getImage(o)),u?r[o]={data:u.data.clone(),pixelRatio:u.pixelRatio,sdf:u.sdf,version:u.version,stretchX:u.stretchX,stretchY:u.stretchY,content:u.content,textFitWidth:u.textFitWidth,textFitHeight:u.textFitHeight,hasRenderCallback:!!(u.userImage&&u.userImage.render)}:c.w(`Image "${o}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return r}getPixelSize(){const{width:e,height:r}=this.atlasImage;return{width:e,height:r}}getPattern(e){const r=this.patterns[e],o=this.getImage(e);if(!o)return null;if(r&&r.position.version===o.version)return r.position;if(r)r.position.version=o.version;else{const u={w:o.data.width+2,h:o.data.height+2,x:0,y:0},f=new c.I(u,o);this.patterns[e]={bin:u,position:f}}return this._updatePatternAtlas(),this.patterns[e].position}bind(e){const r=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new pt(e,this.atlasImage,r.RGBA),this.atlasTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}_updatePatternAtlas(){const e=[];for(const f in this.patterns)e.push(this.patterns[f].bin);const{w:r,h:o}=c.p(e),u=this.atlasImage;u.resize({width:r||1,height:o||1});for(const f in this.patterns){const{bin:y}=this.patterns[f],w=y.x+1,S=y.y+1,I=this.getImage(f).data,A=I.width,k=I.height;c.R.copy(I,u,{x:0,y:0},{x:w,y:S},{width:A,height:k}),c.R.copy(I,u,{x:0,y:k-1},{x:w,y:S-1},{width:A,height:1}),c.R.copy(I,u,{x:0,y:0},{x:w,y:S+k},{width:A,height:1}),c.R.copy(I,u,{x:A-1,y:0},{x:w-1,y:S},{width:1,height:k}),c.R.copy(I,u,{x:0,y:0},{x:w+A,y:S},{width:1,height:k})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}
vendor: 5,205 bytes, line 25
25dispatchRenderCallbacks(e){for(const r of e){if(this.callbackDispatchedThisFrame[r])continue;this.callbackDispatchedThisFrame[r]=!0;const o=this.getImage(r);o||c.w(`Image with ID: "${r}" was not found`),jt(o)&&this.updateImage(r,o)}}}const kr=1e20;function Or(d,e,r,o,u,f,y,w,S){for(let I=e;I<e+o;I++)zr(d,r*f+I,f,u,y,w,S);for(let I=r;I<r+u;I++)zr(d,I*f+e,1,o,y,w,S)}function zr(d,e,r,o,u,f,y){f[0]=0,y[0]=-1e20,y[1]=kr,u[0]=d[e];for(let w=1,S=0,I=0;w<o;w++){u[w]=d[e+w*r];const A=w*w;do{const k=f[S];I=(u[w]-u[k]+A-k*k)/(w-k)/2}while(I<=y[S]&&--S>-1);S++,f[S]=w,y[S]=I,y[S+1]=kr}for(let w=0,S=0;w<o;w++){for(;y[S+1]<w;)S++;const I=f[S],A=w-I;d[e+w*r]=u[I]+A*A}}class Mr{constructor(e,r){this.requestManager=e,this.localIdeographFontFamily=r,this.entries={}}setURL(e){this.url=e}getGlyphs(e){return c._(this,void 0,void 0,function*(){const r=[];for(const f in e)for(const y of e[f])r.push(this._getAndCacheGlyphsPromise(f,y));const o=yield Promise.all(r),u={};for(const{stack:f,id:y,glyph:w}of o)u[f]||(u[f]={}),u[f][y]=w&&{id:w.id,bitmap:w.bitmap.clone(),metrics:w.metrics};return u})}_getAndCacheGlyphsPromise(e,r){return c._(this,void 0,void 0,function*(){let o=this.entries[e];o||(o=this.entries[e]={glyphs:{},requests:{},ranges:{}});let u=o.glyphs[r];if(u!==void 0)return{stack:e,id:r,glyph:u};if(u=this._tinySDF(o,e,r),u)return o.glyphs[r]=u,{stack:e,id:r,glyph:u};const f=Math.floor(r/256);if(256*f>65535)throw new Error("glyphs > 65535 not supported");if(o.ranges[f])return{stack:e,id:r,glyph:u};if(!this.url)throw new Error("glyphsUrl is not set");if(!o.requests[f]){const w=Mr.loadGlyphRange(e,f,this.url,this.requestManager);o.requests[f]=w}const y=yield o.requests[f];for(const w in y)this._doesCharSupportLocalGlyph(+w)||(o.glyphs[+w]=y[+w]);return o.ranges[f]=!0,{stack:e,id:r,glyph:y[r]||null}})}_doesCharSupportLocalGlyph(e){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(e))}_tinySDF(e,r,o){const u=this.localIdeographFontFamily;if(!u||!this._doesCharSupportLocalGlyph(o))return;let f=e.tinySDF;if(!f){let w="400";/bold/i.test(r)?w="900":/medium/i.test(r)?w="500":/light/i.test(r)&&(w="200"),f=e.tinySDF=new Mr.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:u,fontWeight:w})}const y=f.draw(String.fromCharCode(o));return{id:o,bitmap:new c.o({width:y.width||60,height:y.height||60},y.data),metrics:{width:y.glyphWidth/2||24,height:y.glyphHeight/2||24,left:y.glyphLeft/2+.5||0,top:y.glyphTop/2-27.5||-8,advance:y.glyphAdvance/2||24,isDoubleResolution:!0}}}}Mr.loadGlyphRange=function(d,e,r,o){return c._(this,void 0,void 0,function*(){const u=256*e,f=u+255,y=o.transformRequest(r.replace("{fontstack}",d).replace("{range}",`${u}-${f}`),"Glyphs"),w=yield c.l(y,new AbortController);if(!w||!w.data)throw new Error(`Could not load glyph range. range: ${e}, ${u}-${f}`);const S={};for(const I of c.n(w.data))S[I.id]=I;return S})},Mr.TinySDF=class{constructor({fontSize:d=24,buffer:e=3,radius:r=8,cutoff:o=.25,fontFamily:u="sans-serif",fontWeight:f="normal",fontStyle:y="normal"}={}){this.buffer=e,this.cutoff=o,this.radius=r;const w=this.size=d+4*e,S=this._createCanvas(w),I=this.ctx=S.getContext("2d",{willReadFrequently:!0});I.font=`${y} ${f} ${d}px ${u}`,I.textBaseline="alphabetic",I.textAlign="left",I.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(d){const e=document.createElement("canvas");return e.width=e.height=d,e}draw(d){const{width:e,actualBoundingBoxAscent:r,actualBoundingBoxDescent:o,actualBoundingBoxLeft:u,actualBoundingBoxRight:f}=this.ctx.measureText(d),y=Math.ceil(r),w=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(f-u))),S=Math.min(this.size-this.buffer,y+Math.ceil(o)),I=w+2*this.buffer,A=S+2*this.buffer,k=Math.max(I*A,0),R=new Uint8ClampedArray(k),O={data:R,width:I,height:A,glyphWidth:w,glyphHeight:S,glyphTop:y,glyphLeft:0,glyphAdvance:e};if(w===0||S===0)return O;const{ctx:V,buffer:X,gridInner:W,gridOuter:K}=this;V.clearRect(X,X,w,S),V.fillText(d,X,X+y);const ee=V.getImageData(X,X,w,S);K.fill(kr,0,k),W.fill(0,0,k);for(let se=0;se<S;se++)for(let oe=0;oe<w;oe++){const le=ee.data[4*(se*w+oe)+3]/255;if(le===0)continue;const he=(se+X)*I+oe+X;if(le===1)K[he]=0,W[he]=kr;else{const ue=.5-le;K[he]=ue>0?ue*ue:0,W[he]=ue<0?ue*ue:0}}Or(K,0,0,I,A,I,this.f,this.v,this.z),Or(W,X,X,w,S,I,this.f,this.v,this.z);for(let se=0;se<k;se++){const oe=Math.sqrt(K[se])-Math.sqrt(W[se]);R[se]=Math.round(255-255*(oe/this.radius+this.cutoff))}return O}};class _s{constructor(){this.specification=c.v.light.position}possiblyEvaluate(e,r){return c.x(e.expression.evaluate(r))}interpolate(e,r,o){return{x:c.y.number(e.x,r.x,o),y:c.y.number(e.y,r.y,o),z:c.y.number(e.z,r.z,o)}}}let _t;class It extends c.E{constructor(e){super(),_t=_t||new c.q({anchor:new c.D(c.v.light.anchor),position:new _s,color:new c.D(c.v.light.color),intensity:new c.D(c.v.light.intensity)}),this._transitionable=new c.T(_t),this.setLight(e),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(e,r={}
vendor: 4,601 bytes, line 25
25){if(!this._validate(c.r,e,r))for(const o in e){const u=e[o];o.endsWith("-transition")?this._transitionable.setTransition(o.slice(0,-11),u):this._transitionable.setValue(o,u)}}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,r,o){return(!o||o.validate!==!1)&&c.t(this,e.call(c.u,{value:r,style:{glyphs:!0,sprite:!0},styleSpec:c.v}))}}const Gt=new c.q({"sky-color":new c.D(c.v.sky["sky-color"]),"horizon-color":new c.D(c.v.sky["horizon-color"]),"fog-color":new c.D(c.v.sky["fog-color"]),"fog-ground-blend":new c.D(c.v.sky["fog-ground-blend"]),"horizon-fog-blend":new c.D(c.v.sky["horizon-fog-blend"]),"sky-horizon-blend":new c.D(c.v.sky["sky-horizon-blend"]),"atmosphere-blend":new c.D(c.v.sky["atmosphere-blend"])});class vi extends c.E{constructor(e){super(),this._transitionable=new c.T(Gt),this.setSky(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new c.z(0))}setSky(e,r={}){if(!this._validate(c.B,e,r)){e||(e={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(const o in e){const u=e[o];o.endsWith("-transition")?this._transitionable.setTransition(o.slice(0,-11),u):this._transitionable.setValue(o,u)}}}getSky(){return this._transitionable.serialize()}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,r,o={}){return(o==null?void 0:o.validate)!==!1&&c.t(this,e.call(c.u,c.e({value:r,style:{glyphs:!0,sprite:!0},styleSpec:c.v})))}calculateFogBlendOpacity(e){return e<60?0:e<70?(e-60)/10:1}}class Wi{constructor(e,r){this.width=e,this.height=r,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(e,r){const o=e.join(",")+String(r);return this.dashEntry[o]||(this.dashEntry[o]=this.addDash(e,r)),this.dashEntry[o]}getDashRanges(e,r,o){const u=[];let f=e.length%2==1?-e[e.length-1]*o:0,y=e[0]*o,w=!0;u.push({left:f,right:y,isDash:w,zeroLength:e[0]===0});let S=e[0];for(let I=1;I<e.length;I++){w=!w;const A=e[I];f=S*o,S+=A,y=S*o,u.push({left:f,right:y,isDash:w,zeroLength:A===0})}return u}addRoundDash(e,r,o){const u=r/2;for(let f=-o;f<=o;f++){const y=this.width*(this.nextRow+o+f);let w=0,S=e[w];for(let I=0;I<this.width;I++){I/S.right>1&&(S=e[++w]);const A=Math.abs(I-S.left),k=Math.abs(I-S.right),R=Math.min(A,k);let O;const V=f/o*(u+1);if(S.isDash){const X=u-Math.abs(V);O=Math.sqrt(R*R+X*X)}else O=u-Math.sqrt(R*R+V*V);this.data[y+I]=Math.max(0,Math.min(255,O+128))}}}addRegularDash(e){for(let w=e.length-1;w>=0;--w){const S=e[w],I=e[w+1];S.zeroLength?e.splice(w,1):I&&I.isDash===S.isDash&&(I.left=S.left,e.splice(w,1))}const r=e[0],o=e[e.length-1];r.isDash===o.isDash&&(r.left=o.left-this.width,o.right=r.right+this.width);const u=this.width*this.nextRow;let f=0,y=e[f];for(let w=0;w<this.width;w++){w/y.right>1&&(y=e[++f]);const S=Math.abs(w-y.left),I=Math.abs(w-y.right),A=Math.min(S,I);this.data[u+w]=Math.max(0,Math.min(255,(y.isDash?A:-A)+128))}}addDash(e,r){const o=r?7:0,u=2*o+1;if(this.nextRow+u>this.height)return c.w("LineAtlas out of space"),null;let f=0;for(let w=0;w<e.length;w++)f+=e[w];if(f!==0){const w=this.width/f,S=this.getDashRanges(e,this.width,w);r?this.addRoundDash(S,w,o):this.addRegularDash(S)}const y={y:(this.nextRow+o+.5)/this.height,height:2*o/this.height,width:f};return this.nextRow+=u,this.dirty=!0,y}bind(e){const r=e.gl;this.texture?(r.bindTexture(r.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,r.texSubImage2D(r.TEXTURE_2D,0,0,0,this.width,this.height,r.ALPHA,r.UNSIGNED_BYTE,this.data))):(this.texture=r.createTexture(),r.bindTexture(r.TEXTURE_2D,this.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.REPEAT),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.REPEAT),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texImage2D(r.TEXTURE_2D,0,r.ALPHA,this.width,this.height,0,r.ALPHA,r.UNSIGNED_BYTE,this.data))}}const Mi="maplibre_preloaded_worker_pool";class Rr{constructor(){this.active={}}acquire(e){if(!this.workers)for(this.workers=[];this.workers.length<Rr.workerCount;)this.workers.push(new Worker(c.a.WORKER_URL));return this.active[e]=!0,this.workers.slice()}release(e){delete this.active[e],this.numActive()===0&&(this.workers.forEac
25h(r=>{r.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Mi]}numActive(){return Object.keys(this.active).length}}const Pi=Math.floor(ge.hardwareConcurrency/2);let Ii,Ur;function Li(){return Ii||(Ii=new Rr),Ii}Rr.workerCount=c.C(globalThis)?Math.max(Math.min(Pi,3),1):1;class Xi{constructor(e,r){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=r;const o=this.workerPool.acquire(r);for(let u=0;u<o.length;u++){const f=new c.F(o[u],r);f.name=`Worker ${u}`,this.actors.push(f)}if(!this.actors.length)throw new Error("No actors found")}broadcast(e,r){const o=[];for(const u of this.actors)o.push(u.sendAsync({type:e,data:r}));return Promise.all(o)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(e=!0){this.actors.forEach(r=>{r.remove()}),this.actors=[],e&&this.workerPool.release(this.id)}registerMessageHandler(e,r){for(const o of this.actors)o.registerMessageHandler(e,r)}}function ss(){return Ur||(Ur=new Xi(Li(),c.G),Ur.registerMessageHandler("GR",(d,e,r)=>c.m(e,r))),Ur}function hi(d,e){const r=c.H();return c.J(r,r,[1,1,0]),c.K(r,r,[.5*d.width,.5*d.height,1]),d.calculatePosMatrix?c.L(r,r,d.calculatePosMatrix(e.toUnwrapped())):r}function ns(d,e,r,o,u,f){var y;const w=function(k,R,O){if(k)for(const V of k){const X=R[V];if(X&&X.source===O&&X.type==="fill-extrusion")return!0}else for(const V in R){const X=R[V];if(X.source===O&&X.type==="fill-extrusion")return!0}return!1}((y=u==null?void 0:u.layers)!==null&&y!==void 0?y:null,e,d.id),S=f.maxPitchScaleFactor(),I=d.tilesIn(o,S,w);I.sort(ri);const A=[];for(const k of I)A.push({wrappedTileID:k.tileID.wrapped().key,queryResults:k.tile.queryRenderedFeatures(e,r,d._state,k.queryGeometry,k.cameraQueryGeometry,k.scale,u,f,S,hi(d.transform,k.tileID))});return function(k,R){for(const O in k)for(const V of k[O])ae(V,R);return k}(function(k){const R={},O={};for(const V of k){const X=V.queryResults,W=V.wrappedTileID,K=O[W]=O[W]||{};for(const ee in X){const se=X[ee],oe=K[ee]=K[ee]||{},le=R[ee]=R[ee]||[];for(const he of se)oe[he.featureIndex]||(oe[he.featureIndex]=!0,le.push(he))}}return R}(A),d)}function ri(d,e){const r=d.tileID,o=e.tileID;return r.overscaledZ-o.overscaledZ||r.canonical.y-o.canonical.y||r.wrap-o.wrap||r.canonical.x-o.canonical.x}function ae(d,e){const r=d.feature,o=e.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=o}function fe(d,e,r){return c._(this,void 0,void 0,function*(){let o=d;if(d.url?o=(yield c.h(e.transformRequest(d.url,"Source"),r)).data:yield ge.frameAsync(r),!o)return null;const u=c.M(c.e(o,d),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in o&&o.vector_layers&&(u.vectorLayerIds=o.vector_layers.map(f=>f.id)),u})}class Me{constructor(e,r){e&&(r?this.setSouthWest(e).setNorthEast(r):Array.isArray(e)&&(e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}setNorthEast(e){return this._ne=e instanceof c.N?new c.N(e.lng,e.lat):c.N.convert(e),this}setSouthWest(e){return this._sw=e instanceof c.N?new c.N(e.lng,e.lat):c.N.convert(e),this}extend(e){const r=this._sw,o=this._ne;let u,f;if(e instanceof c.N)u=e,f=e;else{if(!(e instanceof Me))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(Me.convert(e)):this.extend(c.N.convert(e)):e&&("lng"in e||"lon"in e)&&"lat"in e?this.extend(c.N.convert(e)):this;if(u=e._sw,f=e._ne,!u||!f)return this}return r||o?(r.lng=Math.min(u.lng,r.lng),r.lat=Math.min(u.lat,r.lat),o.lng=Math.max(f.lng,o.lng),o.lat=Math.max(f.lat,o.lat)):(this._sw=new c.N(u.lng,u.lat),this._ne=new c.N(f.lng,f.lat)),this}getCenter(){return new c.N((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 c.N(this.getWest(),this.getNorth())}getSouthEast(){return new c.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:r,lat:o}=c.N.convert(e);let u=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(u=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=o&&o<=this._ne.lat&&u}static convert(e){return e instanceof Me?e:e&&new Me(e)}static fromLngLat(e,r=0){const o=360*r/40075017,u=o/Math.cos(Math.PI/180*e.lat);return new Me(new c.N(e.lng-u,e.lat-o),new c.N(e.lng+u,e.lat+o))}adjustAntiMeridian(){const e=new c.N(this._sw.lng,this._sw.lat),r=new c.N(this._ne.lng,this._ne.lat);return new Me(e,e.lng>r.lng?new c.N(r.lng+360,r.lat):r)}}class Ve{constructor(e,r,o){this.bounds=Me.convert(this.validateBounds(e)),this.minzoom=r||0,this.maxzoom=o||24}
25validateBounds(e){return Array.isArray(e)&&e.length===4?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}contains(e){const r=Math.pow(2,e.z),o=Math.floor(c.O(this.bounds.getWest())*r),u=Math.floor(c.Q(this.bounds.getNorth())*r),f=Math.ceil(c.O(this.bounds.getEast())*r),y=Math.ceil(c.Q(this.bounds.getSouth())*r);return e.x>=o&&e.x<f&&e.y>=u&&e.y<y}}class Be extends c.E{constructor(e,r,o,u){if(super(),this.id=e,this.dispatcher=o,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,c.e(this,c.M(r,["url","scheme","tileSize","promoteId"])),this._options=c.e({type:"vector"},r),this._collectResourceTiming=r.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(u)}load(){return c._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new c.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const e=yield fe(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),e&&(c.e(this,e),e.bounds&&(this.tileBounds=new Ve(e.bounds,this.minzoom,this.maxzoom)),this.fire(new c.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new c.k("data",{dataType:"source",sourceDataType:"content"})))}catch(e){this._tileJSONRequest=null,this.fire(new c.j(e))}})}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}setSourceProperty(e){this._tileJSONRequest&&this._tileJSONRequest.abort(),e(),this.load()}setTiles(e){return this.setSourceProperty(()=>{this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return c.e({},this._options)}loadTile(e){return c._(this,void 0,void 0,function*(){const r=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),o={request:this.map._requestManager.transformRequest(r,"Tile"),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.t
25ype,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity};o.request.collectResourceTiming=this._collectResourceTiming;let u="RT";if(e.actor&&e.state!=="expired"){if(e.state==="loading")return new Promise((f,y)=>{e.reloadPromise={resolve:f,reject:y}})}else e.actor=this.dispatcher.getActor(),u="LT";e.abortController=new AbortController;try{const f=yield e.actor.sendAsync({type:u,data:o},e.abortController);if(delete e.abortController,e.aborted)return;this._afterTileLoadWorkerResponse(e,f)}catch(f){if(delete e.abortController,e.aborted)return;if(f&&f.status!==404)throw f;this._afterTileLoadWorkerResponse(e,null)}})}_afterTileLoadWorkerResponse(e,r){if(r&&r.resourceTiming&&(e.resourceTiming=r.resourceTiming),r&&this.map._refreshExpiredTiles&&e.setExpiryData(r),e.loadVectorData(r,this.map.painter),e.reloadPromise){const o=e.reloadPromise;e.reloadPromise=null,this.loadTile(e).then(o.resolve).catch(o.reject)}}abortTile(e){return c._(this,void 0,void 0,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.actor&&(yield e.actor.sendAsync({type:"AT",data:{uid:e.uid,type:this.t
25ype,source:this.id}}))})}unloadTile(e){return c._(this,void 0,void 0,function*(){e.unloadVectorData(),e.actor&&(yield e.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class Oe extends c.E{constructor(e,r,o,u){super(),this.id=e,this.dispatcher=o,this.setEventedParent(u),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=c.e({type:"raster"},r),c.e(this,c.M(r,["url","scheme","tileSize"]))}load(){return c._(this,arguments,void 0,function*(e=!1){this._loaded=!1,this.fire(new c.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const r=yield fe(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,r&&(c.e(this,r),r.bounds&&(this.tileBounds=new Ve(r.bounds,this.minzoom,this.maxzoom)),this.fire(new c.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new c.k("data",{dataType:"source",sourceDataType:"content",sourceDataChanged:e})))}catch(r){this._tileJSONRequest=null,this.fire(new c.j(r))}})}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(e){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),e(),this.load(!0)}setTiles(e){return this.setSourceProperty(()=>{this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}serialize(){return c.e({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(e){return c._(this,void 0,void 0,function*(){const r=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);e.abortController=new AbortController;try{const o=yield nt.getImage(this.map._requestManager.transformRequest(r,"Tile"),e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(o&&o.data){this.map._refreshExpiredTiles&&o.cacheControl&&o.expires&&e.setExpiryData({cacheControl:o.cacheControl,expires:o.expires});const u=this.map.painter.context,f=u.gl,y=o.data;e.texture=this.map.painter.getTileTexture(y.width),e.texture?e.texture.update(y,{useMipmap:!0}):(e.texture=new pt(u,y,f.RGBA,{useMipmap:!0}),e.texture.bind(f.LINEAR,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST)),e.state="loaded"}}catch(o){if(delete e.abortController,e.aborted)e.state="unloaded";else if(o)throw e.state="errored",o}})}abortTile(e){return c._(this,void 0,void 0,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController)})}unloadTile(e){return c._(this,void 0,void 0,function*(){e.texture&&this.map.painter.saveTileTexture(e.texture)})}hasTransition(){return!1}}class Ke extends Oe{constructor(e,r,o,u){super(e,r,o,u),this.type="raster-dem",this.maxzoom=22,this._options=c.e({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox",this.redFactor=r.redFactor,this.greenFactor=r.greenFactor,this.blueFactor=r.blueFactor,this.baseShift=r.baseShift}loadTile(e){return c._(this,void 0,void 0,function*(){const r=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),o=this.map._requestManager.transformRequest(r,"Tile");e.neighboringTiles=this._getNeighboringTiles(e.tileID),e.abortController=new AbortController;try{const u=yield nt.getImage(o,e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(u&&u.data){const f=u.data;this.map._refreshExpiredTiles&&u.cacheControl&&u.expires&&e.setExpiryData({cacheControl:u.cacheControl,expires:u.expires});const y=c.b(f)&&c.U()?f:yield this.readImageNow(f),w={type:this.type,uid:e.uid,source:this.id,rawImageData:y,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!e.actor||e.state==="expired"){e.actor=this.dispatcher.getActor();const S=yield e.actor.sendAsync({type:"LDT",data:w});e.dem=S,e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.state="loaded"}}}catch(u){if(delete e.abortController,e.aborted)e.state="unloaded";else if(u)throw e.state="errored",u}})}readImageNow(e){return c._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&c.V()){const r=e.width+2,o=e.height+2;try{return new c.R({width:r,height:o},yield c.W(e,-1,-1,r,o))}catch{}}return ge.getImageData(e,1)})}_getNeighboringTiles(e){const r=e.canonical,o=Math.pow(2,r.z),u=(r.x-1+o)%o,f=r.x===0?e.wrap-1:e.wrap,y=(r.x+1+o)%o,w=r.x+1===o?e.wrap+1:e.wrap,S={};return S[new c.S(e.overscaledZ,f,r.z,u,r.y).key]={backfilled:!1},S[new c.S(e.overscaledZ,w,r.z,y,r.y).key]={backfilled:!1},r.y>0&&(S[new c.S(e.overscaledZ,f,r.z,u,r.y-1).key]={backfilled:!1},S[new c.S(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},S[new c.S(e.overscaledZ,w,r.z,y,r.y-1).key]={backfilled:!1}),r.y+1<o&&(S[new c.S(e.overscaledZ,f,r.z,u,r.y+1).key]={backfilled:!1},S[new c.S(e.overscaledZ,e.wrap,r.z,r.x,r.y+1).key]={backfilled:!1},S[new c.S(e.overscaledZ,w,r.z,y,r.y+1).key]={backfilled:!1}),S}unloadTile(e){return c._(this,void 0,void 0,function*(){e.demTexture&&this.map.painter.saveTileTexture(e.demTexture),e.fbo&&(e.fbo.destroy(),delete e.fbo),e.dem&&delete e.dem,delete e.neighboringTiles,e.state="unloaded",e.actor&&(yield e.actor.sendAsync({type:"RDT",data:{type:this.t
25ype,uid:e.uid,source:this.id}}))})}}class Ye extends c.E{constructor(e,r,o,u){super(),this.id=e,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=o.getActor(),this.setEventedParent(u),this._data=r.data,this._options=c.e({},r),this._collectResourceTiming=r.collectResourceTiming,r.maxzoom!==void 0&&(this.maxzoom=r.maxzoom),r.type&&(this.type=r.type),r.attribution&&(this.attribution=r.attribution),this.promoteId=r.promoteId,r.clusterMaxZoom!==void 0&&this.maxzoom<=r.clusterMaxZoom&&c.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${r.clusterMaxZoom}".`),this.workerOptions=c.e({source:this.id,cluster:r.cluster||!1,geojsonVtOptions:{buffer:this._pixelsToTileUnits(r.buffer!==void 0?r.buffer:128),tolerance:this._pixelsToTileUnits(r.tolerance!==void 0?r.tolerance:.375),extent:c.X,maxZoom:this.maxzoom,lineMetrics:r.lineMetrics||!1,generateId:r.generateId||!1},superclusterOptions:{maxZoom:r.clusterMaxZoom!==void 0?r.clusterMa
25xZoom:this.maxzoom-1,minPoints:Math.max(2,r.clusterMinPoints||2),extent:c.X,radius:this._pixelsToTileUnits(r.clusterRadius||50),log:!1,generateId:r.generateId||!1},clusterProperties:r.clusterProperties,filter:r.filter},r.workerOptions),typeof this.promoteId=="string"&&(this.workerOptions.promoteId=this.promoteId)}_pixelsToTileUnits(e){return e*(c.X/this.tileSize)}load(){return c._(this,void 0,void 0,function*(){yield this._updateWorkerData()})}onAdd(e){this.map=e,this.load()}setData(e){return this._data=e,this._updateWorkerData(),this}updateData(e){return this._updateWorkerData(e),this}getData(){return c._(this,void 0,void 0,function*(){const e=c.e({type:this.type},this.workerOptions);return this.actor.sendAsync({type:"GD",data:e})})}setClusterOptions(e){return this.workerOptions.cluster=e.cluster,e&&(e.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=this._pixelsToTileUnits(e.clusterRadius)),e.clusterMaxZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=e.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(e){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:e,source:this.id}})}getClusterChildren(e){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:e,source:this.id}})}getClusterLeaves(e,r,o){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:e,limit:r,offset:o}})}_updateWorkerData(e){return c._(this,void 0,void 0,function*(){const r=c.e({type:this.type},this.workerOptions);
25e?r.dataDiff=e:typeof this._data=="string"?(r.request=this.map._requestManager.transformRequest(ge.resolveURL(this._data),"Source"),r.request.collectResourceTiming=this._collectResourceTiming):r.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new c.k("dataloading",{dataType:"source"}));try{const o=yield this.actor.sendAsync({type:"LD",data:r});if(this._pendingLoads--,this._removed||o.abandoned)return void this.fire(new c.k("dataabort",{dataType:"source"}));let u=null;o.resourceTiming&&o.resourceTiming[this.id]&&(u=o.resourceTiming[this.id].slice(0));const f={dataType:"source"};this._collectResourceTiming&&u&&u.length>0&&c.e(f,{resourceTiming:u}),this.fire(new c.k("data",Object.assign(Object.assign({},f),{sourceDataType:"metadata"}))),this.fire(new c.k("data",Object.assign(Object.assign({},f),{sourceDataType:"content"})))}catch(o){if(this._pendingLoads--,this._removed)return void this.fire(new c.k("dataabort",{dataType:"source"}));this.fire(new c.j(o))}})}loaded(){return this._pendingLoads===0}loadTile(e){return c._(this,void 0,void 0,function*(){const r=e.actor?"RT":"LT";e.actor=this.actor;const o={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity};e.abortController=new AbortController;const u=yield this.actor.sendAsync({type:r,data:o},e.abortController);delete e.abortController,e.unloadVectorData(),e.aborted||e.loadVectorData(u,this.map.painter,r==="RT")})}abortTile(e){return c._(this,void 0,void 0,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.aborted=!0})}unloadTile(e){return c._(this,void 0,void 0,function*(){e.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.t
25ype,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return c.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}class Ze extends c.E{constructor(e,r,o,u){super(),this.flippedWindingOrder=!1,this.id=e,this.dispatcher=o,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(u),this.options=r}load(e){return c._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new c.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const r=yield nt.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,r&&r.data&&(this.image=r.data,e&&(this.coordinates=e),this._finishLoading())}catch(r){this._request=null,this._loaded=!0,this.fire(new c.j(r))}})}loaded(){return this._loaded}updateImage(e){return e.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=e.url,this.load(e.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new c.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(e){this.coordinates=e;const r=e.map(c.Y.fromLngLat);var o;return this.tileID=function(u){let f=1/0,y=1/0,w=-1/0,S=-1/0;for(const R of u)f=Math.min(f,R.x),y=Math.min(y,R.y),w=Math.max(w,R.x),S=Math.max(S,R.y);const I=Math.max(w-f,S-y),A=Math.max(0,Math.floor(-Math.log(I)/Math.LN2)),k=Math.pow(2,A);return new c.Z(A,Math.floor((f+w)/2*k),Math.floor((y+S)/2*k))}(r),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=r.map(u=>this.tileID.getTilePoint(u)._round()),this.flippedWindingOrder=((o=this.tileCoords)[1].x-o[0].x)*(o[2].y-o[0].y)-(o[1].y-o[0].y)*(o[2].x-o[0].x)<0,this.fire(new c.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const e=this.map.painter.context,r=e.gl;this.texture||(this.texture=new pt(e,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let o=!1;for(const u in this.tiles){const f=this.tiles[u];f.state!=="loaded"&&(f.state="loaded",f.texture=this.texture,o=!0)}o&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(e){return c._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={}):e.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class $e extends Ze{constructor(e,r,o,u){super(e,r,o,u),this.roundZoom=!0,this.type="video",this.options=r}load(){return c._(this,void 0,void 0,function*(){this._loaded=!1;const e=this.options;this.urls=[];for(const r of e.urls)this.urls.push(this.map._requestManager.transformRequest(r,"Source").url);try{const r=yield c.a0(this.urls);if(this._loaded=!0,!r)return;this.video=r,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(r){this.fire(new c.j(r))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(e){if(this.video){const r=this.video.seekable;e<r.start(0)||e>r.end(0)?this.fire(new c.j(new c.$(`sources.${this.id}`,null,`Playback for this video can be set only between the ${r.start(0)} and ${r.end(0)}-second mark.`))):this.video.currentTime=e}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const e=this.map.painter.context,r=e.gl;this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new pt(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let o=!1;for(const u in this.tiles){const f=this.tiles[u];
25f.state!=="loaded"&&(f.state="loaded",f.texture=this.texture,o=!0)}o&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class dt extends Ze{constructor(e,r,o,u){super(e,r,o,u),r.coordinates?Array.isArray(r.coordinates)&&r.coordinates.length===4&&!r.coordinates.some(f=>!Array.isArray(f)||f.length!==2||f.some(y=>typeof y!="number"))||this.fire(new c.j(new c.$(`sources.${e}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new c.j(new c.$(`sources.${e}`,null,'missing required property "coordinates"'))),r.animate&&typeof r.animate!="boolean"&&this.fire(new c.j(new c.$(`sources.${e}`,null,'optional "animate" property must be a boolean value'))),r.canvas?typeof r.canvas=="string"||r.canvas instanceof HTMLCanvasElement||this.fire(new c.j(new c.$(`sources.${e}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new c.j(new c.$(`sources.${e}`,null,'missing required property "canvas"'))),this.options=r,this.animate=r.animate===void 0||r.animate}load(){return c._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new c.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())})}getCanvas(){return this.canvas}onAdd(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const r=this.map.painter.context,o=r.gl;this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new pt(r,this.canvas,o.RGBA,{premultiply:!0});let u=!1;for(const f in this.tiles){const y=this.tiles[f];y.state!=="loaded"&&(y.state="loaded",y.texture=this.texture,u=!0)}u&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}}const et={},ut=d=>{switch(d){case"geojson":return Ye;case"image":return Ze;case"raster":return Oe;case"raster-dem":return Ke;case"vector":return Be;case"video":return $e;case"canvas":return dt}return et[d]},gt="RTLPluginLoaded";class Mt extends c.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=ss()}_syncState(e){return this.status=e,this.dispatcher.broadcast("SRPS",{pluginStatus:e,pluginURL:this.url}).catch(r=>{throw this.status="error",r})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(e){return c._(this,arguments,void 0,function*(r,o=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=ge.resolveURL(r),!this.url)throw new Error(`requested url ${r} is invalid`);if(this.status==="unavailable"){if(!o)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return c._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new c.k(gt))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let Wt=null;function Ft(){return Wt||(Wt=new Mt),Wt}class Dr{constructor(e,r){this.timeAdded=0,this.fadeEndTime=0,this.tileID=e,this.uid=c.a1(),this.uses=0,this.tileSize=r,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(e){const r=e+this.timeAdded;r<this.fadeEndTime||(this.fadeEndTime=r)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(e){this.demTexture&&e.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(e,r,o){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",e){e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=function(u,f){const y={};if(!f)return y;for(const w of u){const S=w.layerIds.map(I=>
25f.getLayer(I)).filter(Boolean);if(S.length!==0){w.layers=S,w.stateDependentLayerIds&&(w.stateDependentLayers=w.stateDependentLayerIds.map(I=>S.filter(A=>A.id===I)[0]));for(const I of S)y[I.id]=w}}return y}(e.buckets,r==null?void 0:r.style),this.hasSymbolBuckets=!1;for(const u in this.buckets){const f=this.buckets[u];if(f instanceof c.a3){if(this.hasSymbolBuckets=!0,!o)break;f.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const u in this.buckets){const f=this.buckets[u];if(f instanceof c.a3&&f.hasRTLText){this.hasRTLText=!0,Ft().lazyLoad();break}}this.queryPadding=0;for(const u in this.buckets){const f=this.buckets[u];this.queryPadding=Math.max(this.queryPadding,r.style.getLayer(u).queryRadius(f))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)}else this.collisionBoxArray=new c.a2}unloadVectorData(){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(e){return this.buckets[e.id]}upload(e){for(const o in this.buckets){const u=this.buckets[o];u.uploadPending()&&u.upload(e)}const r=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new pt(e,this.imageAtlas.image,r.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new pt(e,this.glyphAtlasImage,r.ALPHA),this.glyphAtlasImage=null)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,r,o,u,f,y,w,S,I,A){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:u,cameraQueryGeometry:f,scale:y,tileSize:this.tileSize,pixelPosMatrix:A,transform:S,params:w,queryPadding:this.queryPadding*I},e,r,o):{}}querySourceFeatures(e,r){const o=this.latestFeatureIndex;if(!o||!o.rawTileData)return;const u=o.loadVTLayers(),f=r&&r.sourceLayer?r.sourceLayer:"",y=u._geojsonTileLayer||u[f];if(!y)return;const w=c.a4(r&&r.filter),{z:S,x:I,y:A}=this.tileID.canonical,k={z:S,x:I,y:A};for(let R=0;R<y.length;R++){const O=y.feature(R);if(w.needGeometry){const W=c.a5(O,!0);if(!w.filter(new c.z(this.tileID.overscaledZ),W,this.tileID.canonical))continue}else if(!w.filter(new c.z(this.tileID.overscaledZ),O))continue;const V=o.getId(O,f),X=new c.a6(O,S,I,A,V);X.tile=k,e.push(X)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){const r=this.expirationTime;if(e.cacheControl){const o=c.a7(e.cacheControl);o["max-age"]&&(this.expirationTime=Date.now()+1e3*o["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){const o=Date.now();let u=!1;if(this.expirationTime>o)u=!1;else if(r)if(this.expirationTime<r)u=!0;else{const f=this.expirationTime-r;f?this.expirationTime=o+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-new Date().getTime(),Math.pow(2,31)-1)}setFeatureState(e,r){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(e).length===0)return;const o=this.latestFeatureIndex.loadVTLayers();for(const u in this.buckets){if(!r.style.hasLayer(u))continue;const f=this.buckets[u],y=f.layers[0].sourceLayer||"_geojsonTileLayer",w=o[y],S=e[y];if(!w||!S||Object.keys(S).length===0)continue;f.update(S,w,this.imageAtlas&&this.imageAtlas.patternPositions||{});const I=r&&r.style&&r.style.getLayer(u);I&&(this.queryPadding=Math.max(this.queryPadding,I.queryRadius(f)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<ge.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(e){this.symbolFadeHoldUntil=ge.now()+e}
vendor: 6,590 bytes, line 25
25setDependencies(e,r){const o={};for(const u of r)o[u]=!0;this.dependencies[e]=o}hasDependency(e,r){for(const o of e){const u=this.dependencies[o];if(u){for(const f of r)if(u[f])return!0}}return!1}}class wr{constructor(e,r){this.max=e,this.onRemove=r,this.reset()}reset(){for(const e in this.data)for(const r of this.data[e])r.timeout&&clearTimeout(r.timeout),this.onRemove(r.value);return this.data={},this.order=[],this}add(e,r,o){const u=e.wrapped().key;this.data[u]===void 0&&(this.data[u]=[]);const f={value:r,timeout:void 0};if(o!==void 0&&(f.timeout=setTimeout(()=>{this.remove(e,f)},o)),this.data[u].push(f),this.order.push(u),this.order.length>this.max){const y=this._getAndRemoveByKey(this.order[0]);y&&this.onRemove(y)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){const r=this.data[e].shift();return r.timeout&&clearTimeout(r.timeout),this.data[e].length===0&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),r.value}getByKey(e){const r=this.data[e];return r?r[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,r){if(!this.has(e))return this;const o=e.wrapped().key,u=r===void 0?0:this.data[o].indexOf(r),f=this.data[o][u];return this.data[o].splice(u,1),f.timeout&&clearTimeout(f.timeout),this.data[o].length===0&&delete this.data[o],this.onRemove(f.value),this.order.splice(this.order.indexOf(o),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const r=this._getAndRemoveByKey(this.order[0]);r&&this.onRemove(r)}return this}filter(e){const r=[];for(const o in this.data)for(const u of this.data[o])e(u.value)||r.push(u);for(const o of r)this.remove(o.value.tileID,o)}}class ii{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,r,o){const u=String(r);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][u]=this.stateChanges[e][u]||{},c.e(this.stateChanges[e][u],o),this.deletedStates[e]===null){this.deletedStates[e]={};for(const f in this.state[e])f!==u&&(this.deletedStates[e][f]=null)}else if(this.deletedStates[e]&&this.deletedStates[e][u]===null){this.deletedStates[e][u]={};for(const f in this.state[e][u])o[f]||(this.deletedStates[e][u][f]=null)}else for(const f in o)this.deletedStates[e]&&this.deletedStates[e][u]&&this.deletedStates[e][u][f]===null&&delete this.deletedStates[e][u][f]}removeFeatureState(e,r,o){if(this.deletedStates[e]===null)return;const u=String(r);if(this.deletedStates[e]=this.deletedStates[e]||{},o&&r!==void 0)this.deletedStates[e][u]!==null&&(this.deletedStates[e][u]=this.deletedStates[e][u]||{},this.deletedStates[e][u][o]=null);else if(r!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][u])for(o in this.deletedStates[e][u]={},this.stateChanges[e][u])this.deletedStates[e][u][o]=null;else this.deletedStates[e][u]=null;else this.deletedStates[e]=null}getState(e,r){const o=String(r),u=c.e({},(this.state[e]||{})[o],(this.stateChanges[e]||{})[o]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){const f=this.deletedStates[e][r];if(f===null)return{};for(const y in f)delete u[y]}return u}initializeTileState(e,r){e.setFeatureState(this.state,r)}coalesceChanges(e,r){const o={};for(const u in this.stateChanges){this.state[u]=this.state[u]||{};const f={};for(const y in this.stateChanges[u])this.state[u][y]||(this.state[u][y]={}),c.e(this.state[u][y],this.stateChanges[u][y]),f[y]=this.state[u][y];o[u]=f}for(const u in this.deletedStates){this.state[u]=this.state[u]||{};const f={};if(this.deletedStates[u]===null)for(const y in this.state[u])f[y]={},this.state[u][y]={};else for(const y in this.deletedStates[u]){if(this.deletedStates[u][y]===null)this.state[u][y]={};else for(const w of Object.keys(this.deletedStates[u][y]))delete this.state[u][y][w];f[y]=this.state[u][y]}o[u]=o[u]||{},c.e(o[u],f)}if(this.stateChanges={},this.deletedStates={},Object.keys(o).length!==0)for(const u in e)e[u].setFeatureState(o,r)}}function si(d,e,r){const o=e.intersectsFrustum(d);if(!r)return o;const u=e.intersectsPlane(r);return o===0||u===0?0:o===2&&u===2?2:1}function as(d,e,r,o,u){let f=d;const y=Math.atan(e/r),w=Math.hypot(e,r);return f=d+c.a8(o/w/Math.max(.5,Math.cos(c.aa(u/2)))),f+=1*c.a8(Math.cos(y))/2,f+=c.ab(d-f,-0,0),f}function os(d,e){const r=(e.roundZoom?Math.round:Math.floor)(d.zoom+c.a8(d.tileSize/e.tileSize));return Math.max(0,r)}function H(d,e){const r=d.getCameraFrustum(),o=d.getClippingPlane(),u=d.screenPointToMercatorCoordinate(d.getCameraPoint()),f=c.Y.fromLngLat(d.center,d.elevation);u.z=f.z+Math.cos(d.pitchInRadians)*d.cameraToCenterDistance/d.worldSize;const y=d.getCoveringTilesDetailsProvider(),w=y.allowVariableZoom(d,e),S=os(d,e),I=e.minzoom||0,A=e.maxzoom!==void 0?e.maxzoom:d.maxZoom,k=Math.min(Math.max(0,S),A),R=Math.pow(2,k),O=[R*u.x,R*u.y,0],V=[R*f.x,R*f.y,0],X=Math.hypot(f.x-u.x,f.y-u.y),W=Math.abs(f.z-u.z),K=Math.hypot(X,W),ee=le=>({zoom:0,x:0,y:0,wrap:le,fullyVisible:!1}),se=[],oe=[];if(d.renderWorldCopies&&y.allowWorldCopies())for(let le=1;le<=3;le++)se.push(ee(-le)),se.push(ee(le));for(se.push(ee(0));se.length>0;){const le=se.pop(),he=le.x,ue=le.y;let ve=le.fullyVisible;const be={x:he,y:ue,z:le.zoom},Ae=y.getTileAABB(be,le.wrap,d.elevation,e);if(!ve){const Ue=si(r,Ae,o);if(Ue===0)continue;ve=Ue===2}const Re=y.distanceToTile2d(u.x,u.y,be,Ae);let Ie=S;w&&(Ie=(e.calculateTileZoom||as)(d.zoom+c.a8(d.tileSize/e.tileSize),Re,W,K,d.fov)),Ie=(e.roundZoom?Math.round:Math.floor)(Ie),Ie=Math.max(0,Ie);const Ge=Math.min(Ie,A);if(le.wrap=y.getWrap(f,be,le.wrap),le.zoom>=Ge){if(le.zoom<I)continue;const Ue=k-le.zoom,De=O[0]-.5-(he<<Ue),Xe=O[1]-.5-(ue<<Ue),Tt=e.reparseOverscaled?Math.max(le.zoom,Ie):le.zoom;oe.push({tileID:new c.S(le.zoom===A?Tt:le.zoom,le.wrap,le.zoom,he,ue),distanceSq:c.a9([V[0]-.5-he,V[1]-.5-ue]),tileDistanceToCamera:Math.sqrt(De*De+Xe*Xe)})}else for(let Ue=0;Ue<4;Ue++)se.push({zoom:le.zoom+1,x:(he<<1)+Ue%2,y:(ue<<1)+(Ue>>1),wrap:le.wrap,fullyVisible:ve})}return oe.sort((le,he)=>le.distanceSq-he.distanceSq).map(le=>le.tileID)}class N extends c.E{constructor(e,r,o){super(),this.id=e,this.dispatcher=o,this.on("data",u=>this._dataHandler(u)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((u,f,y,w)=>{const S=new(ut(f.type))(u,f,y,w);if(S.id!==u)throw new Error(`Expected Source id to be ${u} instead of ${S.id}`);return S})(e,r,o,this),this._tiles={},this._cache=new wr(0,u=>this._unloadTile(u)),this._timers={},this._cacheTimers={}
25,this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new ii,this._didEmitContent=!1,this._updated=!1}onAdd(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._maxTileCacheZoomLevels=e?e._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(e)}onRemove(e){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(e)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const e in this._tiles){const r=this._tiles[e];if(r.state!=="loaded"&&r.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(e,r,o){return c._(this,void 0,void 0,function*(){try{yield this._source.loadTile(e),this._tileLoaded(e,r,o)}catch(u){e.state="errored",u.status!==404?this._source.fire(new c.j(u,{tile:e})):this.update(this.transform,this.terrain)}})}_unloadTile(e){this._source.unloadTile&&this._source.unloadTile(e)}_abortTile(e){this._source.abortTile&&this._source.abortTile(e),this._source.fire(new c.k("dataabort",{tile:e,coord:e.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const r in this._tiles){const o=this._tiles[r];o.upload(e),o.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(e=>e.tileID).sort($).map(e=>e.key)}getRenderableIds(e){const r=[];for(const o in this._tiles)this._isIdRenderable(o,e)&&r.push(this._tiles[o]);return e?r.sort((o,u)=>{const f=o.tileID,y=u.tileID,w=new c.P(f.canonical.x,f.canonical.y)._rotate(-this.transform.bearingInRadians),S=new c.P(y.canonical.x,y.canonical.y)._rotate(-this.transform.bearingInRadians);return f.overscaledZ-y.overscaledZ||S.y-w.y||S.x-w.x}).map(o=>o.tileID.key):r.map(o=>o.tileID).sort($).map(o=>o.key)}hasRenderableParent(e){const r=this.findLoadedParent(e,0);return!!r&&this._isIdRenderable(r.tileID.key)}_isIdRenderable(e,r){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(r||!this._tiles[e].holdingForFade())}reload(e){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const r in this._tiles)(e||this._tiles[r].state!=="errored")&&this._reloadTile(r,"reloading")}}_reloadTile(e,r){return c._(this,void 0,void 0,function*(){const o=this._tiles[e];o&&(o.state!=="loading"&&(o.state=r),yield this._loadTile(o,e,r))})}_tileLoaded(e,r,o){e.timeAdded=ge.now(),o==="expired"&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(r,e),this.getSource().type==="raster-dem"&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),e.aborted||this._source.fire(new c.k("data",{dataType:"source",tile:e,coord:e.tileID}))}_backfillDEM(e){const r=this.getRenderableIds();for(let u=0;u<r.length;u++){const f=r[u];if(e.neighboringTiles&&e.neighboringTiles[f]){const y=this.getTileByID(f);o(e,y),o(y,e)}}function o(u,f){u.needsHillshadePrepare=!0,u.needsTerrainPrepare=!0;let y=f.tileID.canonical.x-u.tileID.canonical.x;const w=f.tileID.canonical.y-u.tileID.canonical.y,S=Math.pow(2,u.tileID.canonical.z),I=f.tileID.key;y===0&&w===0||Math.abs(w)>1||(Math.abs(y)>1&&(Math.abs(y+S)===1?y+=S:Math.abs(y-S)===1&&(y-=S)),f.dem&&u.dem&&(u.dem.backfillBorder(f.dem,y,w),u.neighboringTiles&&u.neighboringTiles[I]&&(u.neighboringTiles[I].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,r,o,u){for(const f in this._tiles){let y=this._tiles[f];if(u[f]||!y.hasData()||y.tileID.overscaledZ<=r||y.tileID.overscaledZ>o)continue;let w=y.tileID;for(;y&&y.tileID.overscaledZ>r+1;){const I=y.tileID.scaledTo(y.tileID.overscaledZ-1);y=this._tiles[I.key],y&&y.hasData()&&(w=I)}let S=w;for(;S.overscaledZ>r;)if(S=S.scaledTo(S.overscaledZ-1),e[S.key]||e[S.canonical.key]){u[w.key]=w;break}}}findLoadedParent(e,r){if(e.key in this._loadedParentTiles){const o=this._loadedParentTiles[e.key];return o&&o.tileID.overscaledZ>=r?o:null}for(let o=e.overscaledZ-1;o>=r;o--){const u=e.scaledTo(o),f=this._getLoadedTile(u);if(f)return f}}findLoadedSibling(e){return this._getLoadedTile(e)}_getLoadedTile(e){const r=this._tiles[e.key];return r&&r.hasData()?r:this._cache.getByKey(e.wrapped().key)}updateCacheSize(e){const r=Math.ceil(e.width/this._source.tileSize)+1,o=Math.ceil(e.height/this._source.tileSize)+1,u=Math.floor(r*o*(this._maxTileC
vendor: 6,920 bytes, line 25
25acheZoomLevels===null?c.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),f=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,u):u;this._cache.setMaxSize(f)}handleWrapJump(e){const r=Math.round((e-(this._prevLng===void 0?e:this._prevLng))/360);if(this._prevLng=e,r){const o={};for(const u in this._tiles){const f=this._tiles[u];f.tileID=f.tileID.unwrapTo(f.tileID.wrap+r),o[f.tileID.key]=f}this._tiles=o;for(const u in this._timers)clearTimeout(this._timers[u]),delete this._timers[u];for(const u in this._tiles)this._setTileReloadTimer(u,this._tiles[u])}}_updateCoveredAndRetainedTiles(e,r,o,u,f,y){const w={},S={},I=Object.keys(e),A=ge.now();for(const k of I){const R=e[k],O=this._tiles[k];if(!O||O.fadeEndTime!==0&&O.fadeEndTime<=A)continue;const V=this.findLoadedParent(R,r),X=this.findLoadedSibling(R),W=V||X||null;W&&(this._addTile(W.tileID),w[W.tileID.key]=W.tileID),S[k]=R}this._retainLoadedChildren(S,u,o,e);for(const k in w)e[k]||(this._coveredTiles[k]=!0,e[k]=w[k]);if(y){const k={},R={};for(const O of f)this._tiles[O.key].hasData()?k[O.key]=O:R[O.key]=O;for(const O in R){const V=R[O].children(this._source.maxzoom);this._tiles[V[0].key]&&this._tiles[V[1].key]&&this._tiles[V[2].key]&&this._tiles[V[3].key]&&(k[V[0].key]=e[V[0].key]=V[0],k[V[1].key]=e[V[1].key]=V[1],k[V[2].key]=e[V[2].key]=V[2],k[V[3].key]=e[V[3].key]=V[3],delete R[O])}for(const O in R){const V=R[O],X=this.findLoadedParent(V,this._source.minzoom),W=this.findLoadedSibling(V),K=X||W||null;if(K){k[K.tileID.key]=e[K.tileID.key]=K.tileID;for(const ee in k)k[ee].isChildOf(K.tileID)&&delete k[ee]}}for(const O in this._tiles)k[O]||(this._coveredTiles[O]=!0)}}update(e,r){if(!this._sourceLoaded||this._paused)return;let o;this.transform=e,this.terrain=r,this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?o=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(A=>new c.S(A.canonical.z,A.wrap,A.canonical.z,A.canonical.x,A.canonical.y)):(o=H(e,{tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:r,calculateTileZoom:this._source.calculateTileZoom}),this._source.hasTile&&(o=o.filter(A=>this._source.hasTile(A)))):o=[];const u=os(e,this._source),f=Math.max(u-N.maxOverzooming,this._source.minzoom),y=Math.max(u+N.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const A={};for(const k of o)if(k.canonical.z>this._source.minzoom){const R=k.scaledTo(k.canonical.z-1);A[R.key]=R;const O=k.scaledTo(Math.max(this._source.minzoom,Math.min(k.canonical.z,5)));A[O.key]=O}o=o.concat(Object.values(A))}const w=o.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,w&&this.fire(new c.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const S=this._updateRetainedTiles(o,u);U(this._source.type)&&this._updateCoveredAndRetainedTiles(S,f,y,u,o,r);for(const A in S)this._tiles[A].clearFadeHold();const I=c.ac(this._tiles,S);for(const A of I){const k=this._tiles[A];k.hasSymbolBuckets&&!k.holdingForFade()?k.setHoldDuration(this.map._fadeDuration):k.hasSymbolBuckets&&!k.symbolFadeFinished()||this._removeTile(A)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(e)}_updateRetainedTiles(e,r){var o;const u={},f={},y=Math.max(r-N.maxOverzooming,this._source.minzoom),w=Math.max(r+N.maxUnderzooming,this._source.minzoom),S={};for(const I of e){const A=this._addTile(I);u[I.key]=I,A.hasData()||r<this._source.maxzoom&&(S[I.key]=I)}this._retainLoadedChildren(S,r,w,u);for(const I of e){let A=this._tiles[I.key];if(A.hasData())continue;if(r+1>this._source.maxzoom){const R=I.children(this._source.maxzoom)[0],O=this.getTile(R);if(O&&O.hasData()){u[R.key]=R;continue}}else{const R=I.children(this._source.maxzoom);if(u[R[0].key]&&u[R[1].key]&&u[R[2].key]&&u[R[3].key])continue}let k=A.wasRequested();for(let R=I.overscaledZ-1;R>=y;--R){const O=I.scaledTo(R);if(f[O.key])break;if(f[O.key]=!0,A=this.getTile(O),!A&&k&&(A=this._addTile(O)),A){const V=A.hasData();if((V||!(!((o=this.map)===null||o===void 0)&&o.cancelPendingTileRequestsWhileZooming)||k)&&(u[O.key]=O),k=A.wasRequested(),V)break}}}return u}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const r=[];let o,u=this._tiles[e].tileID;for(;u.overscaledZ>0;){if(u.key in this._loadedParentTiles){o=this._loadedParentTiles[u.key];break}r.push(u.key);const f=u.scaledTo(u.overscaledZ-1);if(o=this._getLoadedTile(f),o)break;u=f}for(const f of r)this._loadedParentTiles[f]=o}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const e in this._tiles){const r=this._tiles[e].tileID,o=this._getLoadedTile(r);this._loadedSiblingTiles[r.key]=o}}_addTile(e){let r=this._tiles[e.key];if(r)return r;r=this._cache.getAndRemove(e),r&&(this._setTileReloadTimer(e.key,r),r.tileID=e,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,r)));const o=r;return r||(r=new Dr(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(r,e.key,r.state)),r.uses++,this._tiles[e.key]=r,o||this._source.fire(new c.k("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r}_setTileReloadTimer(e,r){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const o=r.getExpiryTimeout();o&&(this._timers[e]=setTimeout(()=>{this._reloadTile(e,"expired"),delete this._timers[e]},o))}_removeTile(e){const r=this._tiles[e];r&&(r.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),r.uses>0||(r.hasData()&&r.state!=="reloading"?this._cache.add(r.tileID,r,r.getExpiryTimeout()):(r.aborted=!0,this._abortTile(r),this._unloadTile(r))))}_dataHandler(e){const r=e.sourceDataType;e.dataType==="source"&&r==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&e.dataType==="source"&&r==="content"&&(this.reload(e.sourceDataChanged),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(e);this._cache.reset()}tilesIn(e,r,o){const u=[],f=this.transform;if(!f)return u;const y=o?f.getCameraQueryGeometry(e):e,w=e.map(V=>f.screenPointToMercatorCoordinate(V,this.terrain)),S=y.map(V=>f.screenPointToMercatorCoordinate(V,this.terrain)),I=this.getIds();let A=1/0,k=1/0,R=-1/0,O=-1/0;for(const V of S)A=Math.min(A,V.x),k=Math.min(k,V.y),R=Math.max(R,V.x),O=Math.max(O,V.y);for(let V=0;V<I.length;V++){const X=this._tiles[I[V]];if(X.holdingForFade())continue;
25const W=X.tileID,K=Math.pow(2,f.zoom-X.tileID.overscaledZ),ee=r*X.queryPadding*c.X/X.tileSize/K,se=[W.getTilePoint(new c.Y(A,k)),W.getTilePoint(new c.Y(R,O))];if(se[0].x-ee<c.X&&se[0].y-ee<c.X&&se[1].x+ee>=0&&se[1].y+ee>=0){const oe=w.map(he=>W.getTilePoint(he)),le=S.map(he=>W.getTilePoint(he));u.push({tile:X,tileID:W,queryGeometry:oe,cameraQueryGeometry:le,scale:K})}}return u}getVisibleCoordinates(e){const r=this.getRenderableIds(e).map(o=>this._tiles[o].tileID);return this.transform&&this.transform.populateCache(r),r}hasTransition(){if(this._source.hasTransition())return!0;if(U(this._source.type)){const e=ge.now();for(const r in this._tiles)if(this._tiles[r].fadeEndTime>=e)return!0}return!1}setFeatureState(e,r,o){this._state.updateState(e=e||"_geojsonTileLayer",r,o)}removeFeatureState(e,r,o){this._state.removeFeatureState(e=e||"_geojsonTileLayer",r,o)}getFeatureState(e,r){return this._state.getState(e=e||"_geojsonTileLayer",r)}setDependencies(e,r,o){const u=this._tiles[e];u&&u.setDependencies(r,o)}reloadTilesForDependencies(e,r){for(const o in this._tiles)this._tiles[o].hasDependency(e,r)&&this._reloadTile(o,"reloading");this._cache.filter(o=>!o.hasDependency(e,r))}}function $(d,e){const r=Math.abs(2*d.wrap)-+(d.wrap<0),o=Math.abs(2*e.wrap)-+(e.wrap<0);return d.overscaledZ-e.overscaledZ||o-r||e.canonical.y-d.canonical.y||e.canonical.x-d.canonical.x}function U(d){return d==="raster"||d==="image"||d==="video"}N.maxOverzooming=10,N.maxUnderzooming=3;class te{constructor(e,r){this.reset(e,r)}reset(e,r){this.points=e||[],this._distances=[0];for(let o=1;o<this.points.length;o++)this._distances[o]=this._distances[o-1]+this.points[o].dist(this.points[o-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(r||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(e){if(this.points.length===1)return this.points[0];e=c.ab(e,0,1);let r=1,o=this._distances[r];const u=e*this.paddedLength+this.padding;for(;o<u&&r<this._distances.length;)o=this._distances[++r];const f=r-1,y=this._distances[f],w=o-y,S=w>0?(u-y)/w:0;return this.points[f].mult(1-S).add(this.points[r].mult(S))}}function ce(d,e){let r=!0;return d==="always"||d!=="never"&&e!=="never"||(r=!1),r}class _e{constructor(e,r,o){const u=this.boxCells=[],f=this.circleCells=[];this.xCellCount=Math.ceil(e/o),this.yCellCount=Math.ceil(r/o);for(let y=0;y<this.xCellCount*this.yCellCount;y++)u.push([]),f.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=e,this.height=r,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/r,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(e,r,o,u,f){this._forEachCell(r,o,u,f,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(r),this.bboxes.push(o),this.bboxes.push(u),this.bboxes.push(f)}
vendor: 5,035 bytes, line 25
25insertCircle(e,r,o,u){this._forEachCell(r-u,o-u,r+u,o+u,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(r),this.circles.push(o),this.circles.push(u)}_insertBoxCell(e,r,o,u,f,y){this.boxCells[f].push(y)}_insertCircleCell(e,r,o,u,f,y){this.circleCells[f].push(y)}_query(e,r,o,u,f,y,w){if(o<0||e>this.width||u<0||r>this.height)return[];const S=[];if(e<=0&&r<=0&&this.width<=o&&this.height<=u){if(f)return[{key:null,x1:e,y1:r,x2:o,y2:u}];for(let I=0;I<this.boxKeys.length;I++)S.push({key:this.boxKeys[I],x1:this.bboxes[4*I],y1:this.bboxes[4*I+1],x2:this.bboxes[4*I+2],y2:this.bboxes[4*I+3]});for(let I=0;I<this.circleKeys.length;I++){const A=this.circles[3*I],k=this.circles[3*I+1],R=this.circles[3*I+2];S.push({key:this.circleKeys[I],x1:A-R,y1:k-R,x2:A+R,y2:k+R})}}else this._forEachCell(e,r,o,u,this._queryCell,S,{hitTest:f,overlapMode:y,seenUids:{box:{},circle:{}}},w);return S}query(e,r,o,u){return this._query(e,r,o,u,!1,null)}hitTest(e,r,o,u,f,y){return this._query(e,r,o,u,!0,f,y).length>0}hitTestCircle(e,r,o,u,f){const y=e-o,w=e+o,S=r-o,I=r+o;if(w<0||y>this.width||I<0||S>this.height)return!1;const A=[];return this._forEachCell(y,S,w,I,this._queryCellCircle,A,{hitTest:!0,overlapMode:u,circle:{x:e,y:r,radius:o},seenUids:{box:{},circle:{}}},f),A.length>0}_queryCell(e,r,o,u,f,y,w,S){const{seenUids:I,hitTest:A,overlapMode:k}=w,R=this.boxCells[f];if(R!==null){const V=this.bboxes;for(const X of R)if(!I.box[X]){I.box[X]=!0;const W=4*X,K=this.boxKeys[X];if(e<=V[W+2]&&r<=V[W+3]&&o>=V[W+0]&&u>=V[W+1]&&(!S||S(K))&&(!A||!ce(k,K.overlapMode))&&(y.push({key:K,x1:V[W],y1:V[W+1],x2:V[W+2],y2:V[W+3]}),A))return!0}}const O=this.circleCells[f];if(O!==null){const V=this.circles;for(const X of O)if(!I.circle[X]){I.circle[X]=!0;const W=3*X,K=this.circleKeys[X];if(this._circleAndRectCollide(V[W],V[W+1],V[W+2],e,r,o,u)&&(!S||S(K))&&(!A||!ce(k,K.overlapMode))){const ee=V[W],se=V[W+1],oe=V[W+2];if(y.push({key:K,x1:ee-oe,y1:se-oe,x2:ee+oe,y2:se+oe}),A)return!0}}}return!1}_queryCellCircle(e,r,o,u,f,y,w,S){const{circle:I,seenUids:A,overlapMode:k}=w,R=this.boxCells[f];if(R!==null){const V=this.bboxes;for(const X of R)if(!A.box[X]){A.box[X]=!0;const W=4*X,K=this.boxKeys[X];if(this._circleAndRectCollide(I.x,I.y,I.radius,V[W+0],V[W+1],V[W+2],V[W+3])&&(!S||S(K))&&!ce(k,K.overlapMode))return y.push(!0),!0}}const O=this.circleCells[f];if(O!==null){const V=this.circles;for(const X of O)if(!A.circle[X]){A.circle[X]=!0;const W=3*X,K=this.circleKeys[X];if(this._circlesCollide(V[W],V[W+1],V[W+2],I.x,I.y,I.radius)&&(!S||S(K))&&!ce(k,K.overlapMode))return y.push(!0),!0}}}_forEachCell(e,r,o,u,f,y,w,S){const I=this._convertToXCellCoord(e),A=this._convertToYCellCoord(r),k=this._convertToXCellCoord(o),R=this._convertToYCellCoord(u);for(let O=I;O<=k;O++)for(let V=A;V<=R;V++)if(f.call(this,e,r,o,u,this.xCellCount*V+O,y,w,S))return}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,r,o,u,f,y){const w=u-e,S=f-r,I=o+y;return I*I>w*w+S*S}_circleAndRectCollide(e,r,o,u,f,y,w){const S=(y-u)/2,I=Math.abs(e-(u+S));if(I>S+o)return!1;const A=(w-f)/2,k=Math.abs(r-(f+A));if(k>A+o)return!1;if(I<=S||k<=A)return!0;const R=I-S,O=k-A;return R*R+O*O<=o*o}}function we(d,e,r){const o=c.H();if(!d){const{vecSouth:k,vecEast:R}=Ee(e),O=q();O[0]=R[0],O[1]=R[1],O[2]=k[0],O[3]=k[1],u=O,(A=(y=(f=O)[0])*(I=f[3])-(S=f[2])*(w=f[1]))&&(u[0]=I*(A=1/A),u[1]=-w*A,u[2]=-S*A,u[3]=y*A),o[0]=O[0],o[1]=O[1],o[4]=O[2],o[5]=O[3]}var u,f,y,w,S,I,A;return c.K(o,o,[1/r,1/r,1]),o}function me(d,e,r,o){if(d){const u=c.H();if(!e){const{vecSouth:f,vecEast:y}=Ee(r);u[0]=y[0],u[1]=y[1],u[4]=f[0],u[5]=f[1]}return c.K(u,u,[o,o,1]),u}return r.pixelsToClipSpaceMatrix}function Ee(d){const e=Math.cos(d.rollInRadians),r=Math.sin(d.rollInRadians),o=Math.cos(d.pitchInRadians),u=Math.cos(d.bearingInRadians),f=Math.sin(d.bearingInRadians),y=c.ad();y[0]=-u*o*r-f*e,y[1]=-f*o*r+u*e;const w=c.ae(y);w<1e-9?c.af(y):c.ag(y,y,1/w);const S=c.ad();S[0]=u*o*e-f*r,S[1]=f*o*e+u*r;const I=c.ae(S);return I<1e-9?c.af(S):c.ag(S,S,1/I),{vecEast:S,vecSouth:y}}function Pe(d,e,r,o){let u;o?(u=[d,e,o(d,e),1],c.al(u,u,r)):(u=[d,e,0,1],Nr(u,u,r));const f=u[3];return{point:new c.P(u[0]/f,u[1]/f),signedDistanceFromCamera:f,isOccluded:!1}}function ye(d,e){return .5+d/e*.5}function de(d,e){return d.x>=-e[0]&&d.x<=e[0]&&d.y>=-e[1]&&d.y<=e[1]}function He(d,e,r,o,u,f,y,w,S,I,A,k,R){const O=r?d.textSizeData:d.iconSizeData,V=c.ah(O,e.transform.zoom),X=[256/e.width*2+1,256/e.height*2+1],W=r?d.text.dynamicLayoutVertexArray:d.icon.dynamicLayoutVertexArray;W.clear();const K=d.lineVertexArray,ee=r?d.text.placedSymbolArray:d.icon.placedSymbolArray,se=e.transform.width/e.transform.height;let oe=!1;for(let le=0;le<ee.length;le++){const he=ee.get(le);if(he.hidden||he.writingMode===c.ai.vertical&&!oe){Zr(he.numGlyphs,W);continue}oe=!1;const ue=new c.P(he.anchorX,he.anchorY),ve={getElevation:R,pitchedLabelPlaneMatr
vendor: 4,631 bytes, line 25
25ix:o,lineVertexArray:K,pitchWithMap:f,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:e.transform,tileAnchorPoint:ue,unwrappedTileID:S,width:I,height:A,translation:k},be=$t(he.anchorX,he.anchorY,ve);if(!de(be.point,X)){Zr(he.numGlyphs,W);continue}const Ae=ye(e.transform.cameraToCenterDistance,be.signedDistanceFromCamera),Re=c.aj(O,V,he),Ie=f?Re*e.transform.getPitchedTextCorrection(he.anchorX,he.anchorY,S)/Ae:Re*Ae,Ge=yt({projectionContext:ve,pitchedLabelPlaneMatrixInverse:u,symbol:he,fontSize:Ie,flip:!1,keepUpright:y,glyphOffsetArray:d.glyphOffsetArray,dynamicLayoutVertexArray:W,aspectRatio:se,rotateToLine:w});oe=Ge.useVertical,(Ge.notEnoughRoom||oe||Ge.needsFlipping&&yt({projectionContext:ve,pitchedLabelPlaneMatrixInverse:u,symbol:he,fontSize:Ie,flip:!0,keepUpright:y,glyphOffsetArray:d.glyphOffsetArray,dynamicLayoutVertexArray:W,aspectRatio:se,rotateToLine:w}).notEnoughRoom)&&Zr(he.numGlyphs,W)}r?d.text.dynamicLayoutVertexBuffer.updateData(W):d.icon.dynamicLayoutVertexBuffer.updateData(W)}function qe(d,e,r,o,u,f,y,w){const S=f.glyphStartIndex+f.numGlyphs,I=f.lineStartIndex,A=f.lineStartIndex+f.lineLength,k=e.getoffsetX(f.glyphStartIndex),R=e.getoffsetX(S-1),O=Tr(d*k,r,o,u,f.segment,I,A,w,y);if(!O)return null;const V=Tr(d*R,r,o,u,f.segment,I,A,w,y);return V?w.projectionCache.anyProjectionOccluded?null:{first:O,last:V}:null}function ht(d,e,r,o){return d===c.ai.horizontal&&Math.abs(r.y-e.y)>Math.abs(r.x-e.x)*o?{useVertical:!0}:(d===c.ai.vertical?e.y<r.y:e.x>r.x)?{needsFlipping:!0}:null}function yt(d){const{projectionContext:e,pitchedLabelPlaneMatrixInverse:r,symbol:o,fontSize:u,flip:f,keepUpright:y,glyphOffsetArray:w,dynamicLayoutVertexArray:S,aspectRatio:I,rotateToLine:A}=d,k=u/24,R=o.lineOffsetX*k,O=o.lineOffsetY*k;let V;if(o.numGlyphs>1){const X=o.glyphStartIndex+o.numGlyphs,W=o.lineStartIndex,K=o.lineStartIndex+o.lineLength,ee=qe(k,w,R,O,f,o,A,e);if(!ee)return{notEnoughRoom:!0};const se=At(ee.first.point.x,ee.first.point.y,e,r),oe=At(ee.last.point.x,ee.last.point.y,e,r);if(y&&!f){const le=ht(o.writingMode,se,oe,I);if(le)return le}V=[ee.first];for(let le=o.glyphStartIndex+1;le<X-1;le++)V.push(Tr(k*w.getoffsetX(le),R,O,f,o.segment,W,K,e,A));V.push(ee.last)}else{if(y&&!f){const W=st(e.tileAnchorPoint.x,e.tileAnchorPoint.y,e).point,K=o.lineStartIndex+o.segment+1,ee=new c.P(e.lineVertexArray.getx(K),e.lineVertexArray.gety(K)),se=st(ee.x,ee.y,e),oe=se.signedDistanceFromCamera>0?se.point:ze(e.tileAnchorPoint,ee,W,1,e),le=At(W.x,W.y,e,r),he=At(oe.x,oe.y,e,r),ue=ht(o.writingMode,le,he,I);if(ue)return ue}const X=Tr(k*w.getoffsetX(o.glyphStartIndex),R,O,f,o.segment,o.lineStartIndex,o.lineStartIndex+o.lineLength,e,A);if(!X||e.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};V=[X]}for(const X of V)c.ak(S,X.point,X.angle);return{}}function ze(d,e,r,o,u){const f=d.add(d.sub(e)._unit()),y=st(f.x,f.y,u).point,w=r.sub(y);return r.add(w._mult(o/w.mag()))}function We(d,e,r){const o=e.projectionCache;if(o.projections[d])return o.projections[d];const u=new c.P(e.lineVertexArray.getx(d),e.lineVertexArray.gety(d)),f=st(u.x,u.y,e);if(f.signedDistanceFromCamera>0)return o.projections[d]=f.point,o.anyProjectionOccluded=o.anyProjectionOccluded||f.isOccluded,f.point;const y=d-r.direction;return ze(r.distanceFromAnchor===0?e.tileAnchorPoint:new c.P(e.lineVertexArray.getx(y),e.lineVertexArray.gety(y)),u,r.previousVertex,r.absOffsetX-r.distanceFromAnchor+1,e)}function st(d,e,r){const o=d+r.translation[0],u=e+r.translation[1];let f;return r.pitchWithMap?(f=Pe(o,u,r.pitchedLabelPlaneMatrix,r.getElevation),f.isOccluded=!1):(f=r.transform.projectTileCoordinates(o,u,r.unwrappedTileID,r.getElevation),f.point.x=(.5*f.point.x+.5)*r.width,f.point.y=(.5*-f.point.y+.5)*r.height),f}function At(d,e,r,o){if(r.pitchWithMap){const u=[d,e,0,1];return c.al(u,u,o),r.transform.projectTileCoordinates(u[0]/u[3],u[1]/u[3],r.unwrappedTileID,r.getElevation).point}return{x:d/r.width*2-1,y:e/r.height*2-1}}function $t(d,e,r){return r.transform.projectTileCoordinates(d,e,r.unwrappedTileID,r.getElevation)}function ft(d,e,r){return d._unit()._perp()._mult(e*r)}function tt(d,e,r,o,u,f,y,w,S){if(w.projectionCache.offsets[d])return w.projectionCache.offsets[d];const I=r.add(e);if(d+S.direction<o||d+S.direction>=u)return w.projectionCache.offsets[d]=I,I;const A=We(d+S.direction,w,S),k=ft(A.sub(r),y,S.direction),R=r.add(k),O=A.add(k);return w.projectionCache.offsets[d]=c.am(f,I,R,O)||I,w.projectionCache.offsets[d]}function Tr(d,e,r,o,u,f,y,w,S){const I=o?d-e:d+e;let A=I>0?1:-1,k=0;o&&(A*=-1,k=Math.PI),A<0&&(k+=Math.PI);let R,O=A>0?f+u:f+u+1;
vendor: 32,619 bytes, lines 25-52
25w.projectionCache.cachedAnchorPoint?R=w.projectionCache.cachedAnchorPoint:(R=st(w.tileAnchorPoint.x,w.tileAnchorPoint.y,w).point,w.projectionCache.cachedAnchorPoint=R);let V,X,W=R,K=R,ee=0,se=0;const oe=Math.abs(I),le=[];let he;for(;ee+se<=oe;){if(O+=A,O<f||O>=y)return null;ee+=se,K=W,X=V;const be={absOffsetX:oe,direction:A,distanceFromAnchor:ee,previousVertex:K};if(W=We(O,w,be),r===0)le.push(K),he=W.sub(K);else{let Ae;const Re=W.sub(K);Ae=Re.mag()===0?ft(We(O+A,w,be).sub(W),r,A):ft(Re,r,A),X||(X=K.add(Ae)),V=tt(O,Ae,W,f,y,X,r,w,be),le.push(X),he=V.sub(X)}se=he.mag()}const ue=he._mult((oe-ee)/se)._add(X||K),ve=k+Math.atan2(W.y-K.y,W.x-K.x);return le.push(ue),{point:ue,angle:S?ve:0,path:le}}const Us=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Zr(d,e){for(let r=0;r<d;r++){const o=e.length;e.resize(o+4),e.float32.set(Us,3*o)}}function Nr(d,e,r){const o=e[0],u=e[1];return d[0]=r[0]*o+r[4]*u+r[12],d[1]=r[1]*o+r[5]*u+r[13],d[3]=r[3]*o+r[7]*u+r[15],d}const ur=100;class Fi{constructor(e,r=new _e(e.width+200,e.height+200,25),o=new _e(e.width+200,e.height+200,25)){this.transform=e,this.grid=r,this.ignoredGrid=o,this.pitchFactor=Math.cos(e.pitch*Math.PI/180)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+ur,this.screenBottomBoundary=e.height+ur,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(e,r,o,u,f,y,w,S,I,A,k,R){const O=this.projectAndGetPerspectiveRatio(e.anchorPointX+S[0],e.anchorPointY+S[1],f,A,R),V=o*O.perspectiveRatio;let X;if(y||w)X=this._projectCollisionBox(e,V,u,f,y,w,S,O,A,k,R);else{const he=O.x+(k?k.x*V:0),ue=O.y+(k?k.y*V:0);X={allPointsOccluded:!1,box:[he+e.x1*V,ue+e.y1*V,he+e.x2*V,ue+e.y2*V]}}const[W,K,ee,se]=X.box,oe=y?X.allPointsOccluded:O.isOccluded;let le=oe;return le||(le=O.perspectiveRatio<this.perspectiveRatioCutoff),le||(le=!this.isInsideGrid(W,K,ee,se)),le||r!=="always"&&this.grid.hitTest(W,K,ee,se,r,I)?{box:[W,K,ee,se],placeable:!1,offscreen:!1,occluded:oe}:{box:[W,K,ee,se],placeable:!0,offscreen:this.isOffscreen(W,K,ee,se),occluded:oe}}placeCollisionCircles(e,r,o,u,f,y,w,S,I,A,k,R,O,V){const X=[],W=new c.P(r.anchorX,r.anchorY),K=this.getPerspectiveRatio(W.x,W.y,y,V),ee=(I?f*this.transform.getPitchedTextCorrection(r.anchorX,r.anchorY,y)/K:f*K)/c.as,se={getElevation:V,pitchedLabelPlaneMatrix:w,lineVertexArray:o,pitchWithMap:I,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:this.transform,tileAnchorPoint:W,unwrappedTileID:y,width:this.transform.width,height:this.transform.height,translation:O},oe=qe(ee,u,r.lineOffsetX*ee,r.lineOffsetY*ee,!1,r,!1,se);let le=!1,he=!1,ue=!0;if(oe){const ve=.5*k*K+R,be=new c.P(-100,-100),Ae=new c.P(this.screenRightBoundary,this.screenBottomBoundary),Re=new te,Ie=oe.first,Ge=oe.last;let Ue=[];for(let Tt=Ie.path.length-1;Tt>=1;Tt--)Ue.push(Ie.path[Tt]);for(let Tt=1;Tt<Ge.path.length;Tt++)Ue.push(Ge.path[Tt]);const De=2.5*ve;if(I){const Tt=this.projectPathToScreenSpace(Ue,se);Ue=Tt.some(Zt=>Zt.signedDistanceFromCamera<=0)?[]:Tt.map(Zt=>Zt.point)}let Xe=[];if(Ue.length>0){const Tt=Ue[0].clone(),Zt=Ue[0].clone();for(let fr=1;fr<Ue.length;fr++)Tt.x=Math.min(Tt.x,Ue[fr].x),Tt.y=Math.min(Tt.y,Ue[fr].y),Zt.x=Math.max(Zt.x,Ue[fr].x),Zt.y=Math.max(Zt.y,Ue[fr].y);Xe=Tt.x>=be.x&&Zt.x<=Ae.x&&Tt.y>=be.y&&Zt.y<=Ae.y?[Ue]:Zt.x<be.x||Tt.x>Ae.x||Zt.y<be.y||Tt.y>Ae.y?[]:c.ao([Ue],be.x,be.y,Ae.x,Ae.y)}for(const Tt of Xe){Re.reset(Tt,.25*ve);let Zt=0;Zt=Re.length<=.5*ve?1:Math.ceil(Re.paddedLength/De)+1;for(let fr=0;fr<Zt;fr++){const Qt=fr/Math.max(Zt-1,1),mr=Re.lerp(Qt),er=mr.x+ur,Kt=mr.y+ur;X.push(er,Kt,ve,0);const tr=er-ve,ni=Kt-ve,Fr=er+ve,jr=Kt+ve;if(ue=ue&&this.isOffscreen(tr,ni,Fr,jr),he=he||this.isInsideGrid(tr,ni,Fr,jr),e!=="always"&&this.grid.hitTestCircle(er,Kt,ve,e,A)&&(le=!0,!S))return{circles:[],offscreen:!1,collisionDetected:le}}}}return{circles:!S&&le||!he||K<this.perspectiveRatioCutoff?[]:X,offscreen:ue,collisionDetected:le}}projectPathToScreenSpace(e,r){const o=function(u,f){const y=c.H();return c.an(y,f.pitchedLabelPlaneMatrix),u.map(w=>{const S=Pe(w.x,w.y,y,f.getElevation),I=f.transform.projectTileCoordinates(S.point.x,S.point.y,f.unwrappedTileID,f.getElevation);return I.point.x=(.5*I.point.x+.5)*f.width,I.point.y=(.5*-I.point.y+.5)*f.height,I})}(e,r);return function(u){let f=0,y=0,w=0,S=0;for(let I=0;I<u.length;I++)u[I].isOccluded?(w=I+1,S=0):(S++,S>y&&(y=S,f=w));return u.slice(f,f+y)}(o)}queryRenderedSymbols(e){if(e.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const r=[];let o=1/0,u=1/0,f=-1/0,y=-1/0;for(const A of e){const k=new c.P(A.x+ur,A.y+ur);o=Math.min(o,k.x),u=Math.min(u,k.y),f=Math.max(f,k.x),y=Math.max(y,k.y),r.push(k)}const w=this.grid.query(o,u,f,y).concat(this.ignoredGrid.query(o,u,f,y)),S={},I={};for(const A of w){const k=A.key;if(S[k.bucketInstanceId]===void 0&&(S[k.bucketInstanceId]={}),S[k.bucketInstanceId][k.featureIndex])continue;const R=[new c.P(A.x1,A.y1),new c.P(A.x2,A.y1),new c.P(A.x2,A.y2),new c.P(A.x1,A.y2)];c.ap(r,R)&&(S[k.bucketInstanceId][k.featureIndex]=!0,I[k.bucketInstanceId]===void 0&&(I[k.bucketInstanceId]=[]),I[k.bucketInstanceId].push(k.featureIndex))}return I}insertCollisionBox(e,r,o,u,f,y){(o?this.ignoredGrid:this.grid).insert({bucketInstanceId:u,featureIndex:f,collisionGroupID:y,overlapMode:r},e[0],e[1],e[2],e[3])}insertCollisionCircles(e,r,o,u,f,y){const w=o?this.ignoredGrid:this.grid,S={bucketInstanceId:u,featureIndex:f,collisionGroupID:y,overlapMode:r};for(let I=0;I<e.length;I+=4)w.insertCircle(S,e[I],e[I+1],e[I+2])}projectAndGetPerspectiveRatio(e,r,o,u,f){if(f){let y;u?(y=[e,r,u(e,r),1],c.al(y,y,f)):(y=[e,r,0,1],Nr(y,y,f));const w=y[3];return{x:(y[0]/w+1)/2*this.transform.width+ur,y:(-y[1]/w+1)/2*this.transform.height+ur,perspectiveRatio:.5+this.transform.cameraToCenterDistance/w*.5,isOccluded:!1,signedDistanceFromCamera:w}}{const y=this.transform.projectTileCoordinates(e,r,o,u);return{x:(y.point.x+1)/2*this.transform.width+ur,y:(1-y.point.y)/2*this.transform.height+ur,perspectiveRatio:.5+this.transform.cameraToCenterDistance/y.signedDistanceFromCamera*.5,isOccluded:y.isOccluded,signedDistanceFromCamera:y.signedDistanceFromCamera}}}getPerspectiveRatio(e,r,o,u){const f=this.transform.projectTileCoordinates(e,r,o,u);return .5+this.transform.cameraToCenterDistance/f.signedDistanceFromCamera*.5}isOffscreen(e,r,o,u){return o<ur||e>=this.screenRightBoundary||u<ur||r>this.screenBottomBoundary}isInsideGrid(e,r,o,u){return o>=0&&e<this.gridRightBoundary&&u>=0&&r<this.gridBottomBoundary}getViewportMatrix(){const e=c.aq([]);return c.J(e,e,[-100,-100,0]),e}_projectCollisionBox(e,r,o,u,f,y,w,S,I,A,k){let R=1,O=0,V=0,X=1;const W=e.anchorPointX+w[0],K=e.anchorPointY+w[1];if(y&&!f){const Ue=this.projectAndGetPerspectiveRatio(W+1,K,u,I,k),De=Ue.x-S.x,Xe=Math.atan((Ue.y-S.y)/De)+(De<0?Math.PI:0),Tt=Math.sin(Xe),Zt=Math.cos(Xe);R=Zt,O=Tt,V=-Tt,X=Zt}else if(!y&&f){const Ue=Ee(this.transform);R=Ue.vecEast[0],O=Ue.vecEast[1],V=Ue.vecSouth[0],X=Ue.vecSouth[1]}let ee=S.x,se=S.y,oe=r;f&&(ee=W,se=K,oe=Math.pow(2,-(this.transform.zoom-o.overscaledZ)),oe*=this.transform.getPitchedTextCorrection(W,K,u),A||(oe*=c.ab(.5+S.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))),A&&(ee+=R*A.x*oe+V*A.y*oe,se+=O*A.x*oe+X*A.y*oe);const le=e.x1*oe,he=e.x2*oe,ue=(le+he)/2,ve=e.y1*oe,be=e.y2*oe,Ae=(ve+be)/2,Re=[{offsetX:le,offsetY:ve},{offsetX:ue,offsetY:ve},{offsetX:he,offsetY:ve},{offsetX:he,offsetY:Ae},{offsetX:he,offsetY:be},{offsetX:ue,offsetY:be},{offsetX:le,offsetY:be},{offsetX:le,offsetY:Ae}];let Ie=[];for(const{offsetX:Ue,offsetY:De}of Re)Ie.push(new c.P(ee+R*Ue+V*De,se+O*Ue+X*De));let Ge=!1;if(f){const Ue=Ie.map(De=>this.projectAndGetPerspectiveRatio(De.x,De.y,u,I,k));Ge=Ue.some(De=>!De.isOccluded),Ie=Ue.map(De=>new c.P(De.x,De.y))}else Ge=!0;return{box:c.ar(Ie),allPointsOccluded:!Ge}}}class hr{constructor(e,r,o,u){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?r:-r))):u&&o?1:0,this.placed=o}isHidden(){return this.opacity===0&&!this.placed}}class wa{constructor(e,r,o,u,f){this.text=new hr(e?e.text:null,r,o,f),this.icon=new hr(e?e.icon:null,r,u,f)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Nn{constructor(e,r,o){this.text=e,this.icon=r,this.skipFade=o}}class Bl{constructor(e,r,o,u,f){this.bucketInstanceId=e,this.featureIndex=r,this.sourceLayerIndex=o,this.bucketIndex=u,this.tileID=f}}class cn{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){const r=++this.maxGroupID;this.collisionGroups[e]={ID:r,predicate:o=>o.collisionGroupID===r}}return this.collisionGroups[e]}}function un(d,e,r,o,u){const{horizontalAlign:f,verticalAlign:y}=c.ay(d);return new c.P(-(f-.5)*e+o[0]*u,-(y-.5)*r+o[1]*u)}class Cu{constructor(e,r,o,u,f){this.transform=e.clone(),this.terrain=r,this.collisionIndex=new Fi(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=o,this.retainedQueryData={},this.collisionGroups=new cn(u),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=f,f&&(f.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(e){const r=this.terrain;return r?(o,u)=>r.getElevation(e,o,u):null}getBucketParts(e,r,o,u){const f=o.getBucket(r),y=o.latestFeatureIndex;if(!f||!y||r.id!==f.layerIds[0])return;const w=o.collisionBoxArray,S=f.layers[0].layout,I=f.layers[0].paint,A=Math.pow(2,this.transform.zoom-o.tileID.overscaledZ),k=o.tileSize/c.X,R=o.tileID.toUnwrapped(),O=S.get("text-rotation-alignment")==="map",V=c.at(o,1,this.transform.zoom),X=c.au(this.collisionIndex.transform,o,I.get("text-translate"),I.get("text-translate-anchor")),W=c.au(this.collisionIndex.transform,o,I.get("icon-translate"),I.get("icon-translate-anchor")),K=we(O,this.transform,V);this.retainedQueryData[f.bucketInstanceId]=new Bl(f.bucketInstanceId,y,f.sourceLayerIndex,f.index,o.tileID);const ee={bucket:f,layout:S,translationText:X,translationIcon:W,unwrappedTileID:R,pitchedLabelPlaneMatrix:K,scale:A,textPixelRatio:k,holdingForFade:o.holdingForFade(),collisionBoxArray:w,partiallyEvaluatedTextSize:c.ah(f.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(f.sourceID)};if(u)for(const se of f.sortKeyRanges){const{sortKey:oe,symbolInstanceStart:le,symbolInstanceEnd:he}=se;e.push({sortKey:oe,symbolInstanceStart:le,symbolInstanceEnd:he,parameters:ee})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:f.symbolInstances.length,parameters:ee})}attemptAnchorPlacement(e,r,o,u,f,y,w,S,I,A,k,R,O,V,X,W,K,ee,se,oe){const le=c.av[e.textAnchor],he=[e.textOffset0,e.textOffset1],ue=un(le,o,u,he,f),ve=this.collisionIndex.placeCollisionBox(r,R,S,I,A,w,y,W,k.predicate,se,ue,oe);if((!ee||this.collisionIndex.placeCollisionBox(ee,R,S,I,A,w,y,K,k.predicate,se,ue,oe).placeable)&&ve.placeable){let be;if(this.prevPlacement&&this.prevPlacement.variableOffsets[O.crossTileID]&&this.prevPlacement.placements[O.crossTileID]&&this.prevPlacement.placements[O.crossTileID].text&&(be=this.prevPlacement.variableOffsets[O.crossTileID].anchor),O.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[O.crossTileID]={textOffset:he,width:o,height:u,anchor:le,textBoxScale:f,prevAnchor:be},this.markUsedJustification(V,le,O,X),V.allowVerticalPlacement&&(this.markUsedOrientation(V,X,O),this.placedOrientations[O.crossTileID]=X),{shift:ue,placedGlyphBoxes:ve}}}placeLayerBucketPart(e,r,o){const{bucket:u,layout:f,translationText:y,translationIcon:w,unwrappedTileID:S,pitchedLabelPlaneMatrix:I,textPixelRatio:A,holdingForFade:k,collisionBoxArray:R,partiallyEvaluatedTextSize:O,collisionGroup:V}=e.parameters,X=f.get("text-optional"),W=f.get("icon-optional"),K=c.aw(f,"text-overlap","text-allow-overlap"),ee=K==="always",se=c.aw(f,"icon-overlap","icon-allow-overlap"),oe=se==="always",le=f.get("text-rotation-alignment")==="map",he=f.get("text-pitch-alignment")==="map",ue=f.get("icon-text-fit")!=="none",ve=f.get("symbol-z-order")==="viewport-y",be=ee&&(oe||!u.hasIconData()||W),Ae=oe&&(ee||!u.hasTextData()||X);!u.collisionArrays&&R&&u.deserializeCollisionBoxes(R);const Re=this.retainedQueryData[u.bucketInstanceId].tileID,Ie=this._getTerrainElevationFunc(Re),Ge=this.transform.getFastPathSimpleProjectionMatrix(Re),Ue=(De,Xe,Tt)=>{var Zt,fr;if(r[De.crossTileID])return;if(k)return void(this.placements[De.crossTileID]=new Nn(!1,!1,!1));let Qt=!1,mr=!1,er=!0,Kt=null,tr={box:null,placeable:!1,offscreen:null,occluded:!1},ni={placeable:!1},Fr=null,jr=null,mi=null,Ds=0,Ts=0,Oi=0;Xe.textFeatureIndex?Ds=Xe.textFeatureIndex:De.useRuntimeCollisionCircles&&(Ds=De.featureIndex),Xe.verticalTextFeatureIndex&&(Ts=Xe.verticalTextFeatureIndex);const Ls=Xe.textBox;if(Ls){const Ei=rr=>{let gr=c.ai.horizontal;if(u.allowVerticalPlacement&&!rr&&this.prevPlacement){const ji=this.prevPlacement.placedOrientations[De.crossTileID];ji&&(this.placedOrientations[De.crossTileID]=ji,gr=ji,this.markUsedOrientation(u,gr,De))}return gr},es=(rr,gr)=>{if(u.allowVerticalPlacement&&De.numVerticalGlyphVertices>0&&Xe.verticalTextBox){for(const ji of u.writingModes)if(ji===c.ai.vertical?(tr=gr(),ni=tr):tr=rr(),tr&&tr.placeable)break}else tr=rr()},ts=De.textAnchorOffsetStartIndex,Ni=De.textAnchorOffsetEndIndex;if(Ni===ts){const rr=(gr,ji)=>{const yr=this.collisionIndex.placeCollisionBox(gr,K,A,Re,S,he,le,y,V.predicate,Ie,void 0,Ge);return yr&&yr.placeable&&(this.markUsedOrientation(u,ji,De),this.placedOrientations[De.crossTileID]=ji),yr};es(()=>rr(Ls,c.ai.horizontal),()=>{const gr=Xe.verticalTextBox;return u.allowVerticalPlacement&&De.numVerticalGlyphVertices>0&&gr?rr(gr,c.ai.vertical):{box:null,offscreen:null}}),Ei(tr&&tr.placeable)}else{let rr=c.av[(fr=(Zt=this.prevPlacement)===null||Zt===void 0?void 0:Zt.variableOffsets[De.crossTileID])===null||fr===void 0?void 0:fr.anchor];const gr=(yr,rd,Ph)=>{const Lc=yr.x2-yr.x1,Ih=yr.y2-yr.y1,Pn=De.textBoxScale,In=ue&&se==="never"?rd:null;let Xs=null,Ch=K==="never"?1:2,sl="never";rr&&Ch++;for(let Fc=0;Fc<Ch;Fc++){for(let Bc=ts;Bc<Ni;Bc++){const Oc=u.textAnchorOffsets.get(Bc);if(rr&&Oc.textAnchor!==rr)continue;const Nc=this.attemptAnchorPlacement(Oc,yr,Lc,Ih,Pn,le,he,A,Re,S,V,sl,De,u,Ph,y,w,In,Ie);if(Nc&&(Xs=Nc.placedGlyphBoxes,Xs&&Xs.placeable))return Qt=!0,Kt=Nc.shift,Xs}rr?rr=null:sl=K}return o&&!Xs&&(Xs={box:this.collisionIndex.placeCollisionBox(Ls,"always",A,Re,S,he,le,y,V.predicate,Ie,void 0,Ge).box,offscreen:!1,placeable:!1,occluded:!1}),Xs};es(()=>gr(Ls,Xe.iconBox,c.ai.horizontal),()=>{const yr=Xe.verticalTextBox;return u.allowVerticalPlacement&&(!tr||!tr.placeable)&&De.numVerticalGlyphVertices>0&&yr?gr(yr,Xe.verticalIconBox,c.ai.vertical):{box:null,occluded:!0,offscreen:null}}),tr&&(Qt=tr.placeable,er=tr.offscreen);const ji=Ei(tr&&tr.placeable);if(!Qt&&this.prevPlacement){const yr=this.prevPlacement.variableOffsets[De.crossTileID];yr&&(this.variableOffsets[De.crossTileID]=yr,this.markUsedJustification(u,yr.anchor,De,ji))}}}if(Fr=tr,Qt=Fr&&Fr.placeable,er=Fr&&Fr.offscreen,De.useRuntimeCollisionCircles){const Ei=u.text.placedSymbolArray.get(De.centerJustifiedTextSymbolIndex),es=c.aj(u.textSizeData,O,Ei),ts=f.get("text-padding");jr=this.collisionIndex.placeCollisionCircles(K,Ei,u.lineVertexArray,u.glyphOffsetArray,es,S,I,o,he,V.predicate,De.collisionCircleDiameter,ts,y,Ie),jr.circles.length&&jr.collisionDetected&&!o&&c.w("Collisions detected, but collision boxes are not shown"),Qt=ee||jr.circles.length>0&&!jr.collisionDetected,er=er&&jr.offscreen}if(Xe.iconFeatureIndex&&(Oi=Xe.iconFeatureIndex),Xe.iconBox){const Ei=es=>this.collisionIndex.placeCollisionBox(es,se,A,Re,S,he,le,w,V.predicate,Ie,ue&&Kt?Kt:void 0,Ge);ni&&ni.placeable&&Xe.verticalIconBox?(mi=Ei(Xe.verticalIconBox),mr=mi.placeable):(mi=Ei(Xe.iconBox),mr=mi.placeable),er=er&&mi.offscreen}const Xa=X||De.numHorizontalGlyphVertices===0&&De.numVerticalGlyphVertices===0,Ya=W||De.numIconVertices===0;Xa||Ya?Ya?Xa||(mr=mr&&Qt):Qt=mr&&Qt:mr=Qt=mr&&Qt;const na=mr&&mi.placeable;if(Qt&&Fr.placeable&&this.collisionIndex.insertCollisionBox(Fr.box,K,f.get("text-ignore-placement"),u.bucketInstanceId,ni&&ni.placeable&&Ts?Ts:Ds,V.ID),na&&this.collisionIndex.insertCollisionBox(mi.box,se,f.get("icon-ignore-placement"),u.bucketInstanceId,Oi,V.ID),jr&&Qt&&this.collisionIndex.insertCollisionCircles(jr.circles,K,f.get("text-ignore-placement"),u.bucketInstanceId,Ds,V.ID),o&&this.storeCollisionData(u.bucketInstanceId,Tt,Xe,Fr,mi,jr),De.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(u.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[De.crossTileID]=new Nn((Qt||be)&&!(Fr!=null&&Fr.occluded),(mr||Ae)&&!(mi!=null&&mi.occluded),er||u.justReloaded),r[De.crossTileID]=!0};if(ve){if(e.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const De=u.getSortedSymbolIndexes(-this.transform.bearingInRadians);for(let Xe=De.length-1;Xe>=0;--Xe){const Tt=De[Xe];Ue(u.symbolInstances.get(Tt),u.collisionArrays[Tt],Tt)}}else for(let De=e.symbolInstanceStart;De<e.symbolInstanceEnd;De++)Ue(u.symbolInstances.get(De),u.collisionArrays[De],De);u.justReloaded=!1}storeCollisionData(e,r,o,u,f,y){if(o.textBox||o.iconBox){let w,S;this.collisionBoxArrays.has(e)?w=this.collisionBoxArrays.get(e):(w=new Map,this.collisionBoxArrays.set(e,w)),w.has(r)?S=w.get(r):(S={text:null,icon:null},w.set(r,S)),o.textBox&&(S.text=u.box),o.iconBox&&(S.icon=f.box)}if(y){let w=this.collisionCircleArrays[e];w===void 0&&(w=this.collisionCircleArrays[e]=[]);for(let S=0;S<y.circles.length;S+=4)w.push(y.circles[S+0]-ur),w.push(y.circles[S+1]-ur),w.push(y.circles[S+2]),w.push(y.collisionDetected?1:0)}}markUsedJustification(e,r,o,u){let f;f=u===c.ai.vertical?o.verticalPlacedTextSymbolIndex:{left:o.leftJustifiedTextSymbolIndex,center:o.centerJustifiedTextSymbolIndex,right:o.rightJustifiedTextSymbolIndex}[c.ax(r)];const y=[o.leftJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.rightJustifiedTextSymbolIndex,o.verticalPlacedTextSymbolIndex];for(const w of y)w>=0&&(e.text.placedSymbolArray.get(w).crossTileID=f>=0&&w!==f?0:o.crossTileID)}markUsedOrientation(e,r,o){const u=r===c.ai.horizontal||r===c.ai.horizontalOnly?r:0,f=r===c.ai.vertical?r:0,y=[o.leftJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.rightJustifiedTextSymbolIndex];for(const w of y)e.text.placedSymbolArray.get(w).placedOrientation=u;o.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).placedOrientation=f)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;const r=this.prevPlacement;let o=!1;this.prevZoomAdjustment=r?r.zoomAdjustment(this.transform.zoom):0;const u=r?r.symbolFadeChange(e):1,f=r?r.opacities:{},y=r?r.variableOffsets:{},w=r?r.placedOrientations:{};for(const S in this.placements){const I=this.placements[S],A=f[S];A?(this.opacities[S]=new wa(A,u,I.text,I.icon),o=o||I.text!==A.text.placed||I.icon!==A.icon.placed):(this.opacities[S]=new wa(null,u,I.text,I.icon,I.skipFade),o=o||I.text||I.icon)}for(const S in f){const I=f[S];if(!this.opacities[S]){const A=new wa(I,u,!1,!1);A.isHidden()||(this.opacities[S]=A,o=o||I.text.placed||I.icon.placed)}}for(const S in y)this.variableOffsets[S]||!this.opacities[S]||this.opacities[S].isHidden()||(this.variableOffsets[S]=y[S]);for(const S in w)this.placedOrientations[S]||!this.opacities[S]||this.opacities[S].isHidden()||(this.placedOrientations[S]=w[S]);if(r&&r.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");o?this.lastPlacementChangeTime=e:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=r?r.lastPlacementChangeTime:e)}updateLayerOpacities(e,r){const o={};for(const u of r){const f=u.getBucket(e);f&&u.latestFeatureIndex&&e.id===f.layerIds[0]&&this.updateBucketOpacities(f,u.tileID,o,u.collisionBoxArray)}}updateBucketOpacities(e,r,o,u){e.hasTextData()&&(e.text.opacityVertexArray.clear(),e.text.hasVisibleVertices=!1),e.hasIconData()&&(e.icon.opacityVertexArray.clear(),e.icon.hasVisibleVertices=!1),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();const f=e.layers[0],y=f.layout,w=new wa(null,0,!1,!1,!0),S=y.get("text-allow-overlap"),I=y.get("icon-allow-overlap"),A=f._unevaluatedLayout.hasValue("text-variable-anchor")||f._unevaluatedLayout.hasValue("text-variable-anchor-offset"),k=y.get("text-rotation-alignment")==="map",R=y.get("text-pitch-alignment")==="map",O=y.get("icon-text-fit")!=="none",V=new wa(null,0,S&&(I||!e.hasIconData()||y.get("icon-optional")),I&&(S||!e.hasTextData()||y.get("text-optional")),!0);!e.collisionArrays&&u&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(u);const X=(K,ee,se)=>{for(let oe=0;oe<ee/4;oe++)K.opacityVertexArray.emplaceBack(se);K.hasVisibleVertices=K.hasVisibleVertices||se!==hn},W=this.collisionBoxArrays.get(e.bucketInstanceId);for(let K=0;K<e.symbolInstances.length;K++){const ee=e.symbolInstances.get(K),{numHorizontalGlyphVertices:se,numVerticalGlyphVertices:oe,crossTileID:le}=ee;let he=this.opacities[le];o[le]?he=w:he||(he=V,this.opacities[le]=he),o[le]=!0;const ue=ee.numIconVertices>0,ve=this.placedOrientations[ee.crossTileID],be=ve===c.ai.vertical,Ae=ve===c.ai.horizontal||ve===c.ai.horizontalOnly;if(se>0||oe>0){const Ie=Nl(he.text);X(e.text,se,be?hn:Ie),X(e.text,oe,Ae?hn:Ie);const Ge=he.text.isHidden();[ee.rightJustifiedTextSymbolIndex,ee.centerJustifiedTextSymbolIndex,ee.leftJustifiedTextSymbolIndex].forEach(Xe=>{Xe>=0&&(e.text.placedSymbolArray.get(Xe).hidden=Ge||be?1:0)}),ee.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(ee.verticalPlacedTextSymbolIndex).hidden=Ge||Ae?1:0);const Ue=this.variableOffsets[ee.crossTileID];Ue&&this.markUsedJustification(e,Ue.anchor,ee,ve);const De=this.placedOrientations[ee.crossTileID];De&&(this.markUsedJustification(e,"left",ee,De),this.markUsedOrientation(e,De,ee))}if(ue){const Ie=Nl(he.icon),Ge=!(O&&ee.verticalPlacedIconSymbolIndex&&be);ee.placedIconSymbolIndex>=0&&(X(e.icon,ee.numIconVertices,Ge?Ie:hn),e.icon.placedSymbolArray.get(ee.placedIconSymbolIndex).hidden=he.icon.isHidden()),ee.verticalPlacedIconSymbolIndex>=0&&(X(e.icon,ee.numVerticalIconVertices,Ge?hn:Ie),e.icon.placedSymbolArray.get(ee.verticalPlacedIconSymbolIndex).hidden=he.icon.isHidden())}const Re=W&&W.has(K)?W.get(K):{text:null,icon:null};if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){const Ie=e.collisionArrays[K];if(Ie){let Ge=new c.P(0,0);if(Ie.textBox||Ie.verticalTextBox){let Ue=!0;if(A){const De=this.variableOffsets[le];De?(Ge=un(De.anchor,De.width,De.height,De.textOffset,De.textBoxScale),k&&Ge._rotate(R?-this.transform.bearingInRadians:this.transform.bearingInRadians)):Ue=!1}if(Ie.textBox||Ie.verticalTextBox){let De;Ie.textBox&&(De=be),Ie.verticalTextBox&&(De=Ae),Ol(e.textCollisionBox.collisionVertexArray,he.text.placed,!Ue||De,Re.text,Ge.x,Ge.y)}}if(Ie.iconBox||Ie.verticalIconBox){const Ue=!!(!Ae&&Ie.verticalIconBox);let De;Ie.iconBox&&(De=Ue),Ie.verticalIconBox&&(De=!Ue),Ol(e.iconCollisionBox.collisionVertexArray,he.icon.placed,De,Re.icon,O?Ge.x:0,O?Ge.y:0)}}}}if(e.sortFeatures(-this.transform.bearingInRadians),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.text.opacityVertexArray.length!==e.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${e.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${e.text.layoutVertexArray.length}) / 4`);if(e.icon.opacityVertexArray.length!==e.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${e.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${e.icon.layoutVertexArray.length}) / 4`);e.bucketInstanceId in this.collisionCircleArrays&&(e.collisionCircleArray=this.collisionCircleArrays[e.bucketInstanceId],delete this.collisionCircleArrays[e.bucketInstanceId])}symbolFadeChange(e){return this.fadeDuration===0?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(e,r){const o=this.zoomAtLastRecencyCheck===r?1-this.zoomAdjustment(r):1;return this.zoomAtLastRecencyCheck=r,this.commitTime+this.fadeDuration*o>e}setStale(){this.stale=!0}}function Ol(d,e,r,o,u,f){o&&o.length!==0||(o=[0,0,0,0]);const y=o[0]-ur,w=o[1]-ur,S=o[2]-ur,I=o[3]-ur;d.emplaceBack(e?1:0,r?1:0,u||0,f||0,y,w),d.emplaceBack(e?1:0,r?1:0,u||0,f||0,S,w),d.emplaceBack(e?1:0,r?1:0,u||0,f||0,S,I),d.emplaceBack(e?1:0,r?1:0,u||0,f||0,y,I)}const Eu=Math.pow(2,25),jn=Math.pow(2,24),Au=Math.pow(2,17),Fp=Math.pow(2,16),Bp=Math.pow(2,9),Op=Math.pow(2,8),ku=Math.pow(2,1);function Nl(d){if(d.opacity===0&&!d.placed)return 0;if(d.opacity===1&&d.placed)return 4294967295;const e=d.placed?1:0,r=Math.floor(127*d.opacity);return r*Eu+e*jn+r*Au+e*Fp+r*Bp+e*Op+r*ku+e}const hn=0;class jl{constructor(e){this._sortAcrossTiles=e.layout.get("symbol-z-order")!=="viewport-y"&&!e.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,r,o,u,f){const y=this._bucketParts;for(;this._currentTileIndex<e.length;)if(r.getBucketParts(y,u,e[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,f())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,y.sort((w,S)=>w.sortKey-S.sortKey));this._currentPartIndex<y.length;)if(r.placeLayerBucketPart(y[this._currentPartIndex],this._seenCrossTileIDs,o),this._currentPartIndex++,f())return!0;return!1}}class zu{constructor(e,r,o,u,f,y,w,S){this.placement=new Cu(e,r,y,w,S),this._currentPlacementIndex=o.length-1,this._forceFullPlacement=u,this._showCollisionBoxes=f,this._done=!1}isDone(){return this._done}continuePlacement(e,r,o){const u=ge.now(),f=()=>!this._forceFullPlacement&&ge.now()-u>2;for(;this._currentPlacementIndex>=0;){const y=r[e[this._currentPlacementIndex]],w=this.placement.collisionIndex.transform.zoom;if(y.type==="symbol"&&(!y.minzoom||y.minzoom<=w)&&(!y.maxzoom||y.maxzoom>w)){if(this._inProgressLayer||(this._inProgressLayer=new jl(y)),this._inProgressLayer.continuePlacement(o[y.source],this.placement,this._showCollisionBoxes,y,f))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}const pn=512/c.X/2;class Vl{constructor(e,r,o){this.tileID=e,this.bucketInstanceId=o,this._symbolsByKey={};const u=new Map;for(let f=0;f<r.length;f++){const y=r.get(f),w=y.key,S=u.get(w);S?S.push(y):u.set(w,[y])}for(const[f,y]of u){const w={positions:y.map(S=>({x:Math.floor(S.anchorX*pn),y:Math.floor(S.anchorY*pn)})),crossTileIDs:y.map(S=>S.crossTileID)};if(w.positions.length>128){const S=new c.az(w.positions.length,16,Uint16Array);for(const{x:I,y:A}of w.positions)S.add(I,A);S.finish(),delete w.positions,w.index=S}this._symbolsByKey[f]=w}}getScaledCoordinates(e,r){const{x:o,y:u,z:f}=this.tileID.canonical,{x:y,y:w,z:S}=r.canonical,I=pn/Math.pow(2,S-f),A=(w*c.X+e.anchorY)*I,k=u*c.X*pn;return{x:Math.floor((y*c.X+e.anchorX)*I-o*c.X*pn),y:Math.floor(A-k)}}findMatches(e,r,o){const u=this.tileID.canonical.z<r.canonical.z?1:Math.pow(2,this.tileID.canonical.z-r.canonical.z);for(let f=0;f<e.length;f++){const y=e.get(f);if(y.crossTileID)continue;const w=this._symbolsByKey[y.key];if(!w)continue;const S=this.getScaledCoordinates(y,r);if(w.index){const I=w.index.range(S.x-u,S.y-u,S.x+u,S.y+u).sort();for(const A of I){const k=w.crossTileIDs[A];if(!o[k]){o[k]=!0,y.crossTileID=k;break}}}else if(w.positions)for(let I=0;I<w.positions.length;I++){const A=w.positions[I],k=w.crossTileIDs[I];if(Math.abs(A.x-S.x)<=u&&Math.abs(A.y-S.y)<=u&&!o[k]){o[k]=!0,y.crossTileID=k;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:e})=>e)}}class xo{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Ru{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){const r=Math.round((e-this.lng)/360);if(r!==0)for(const o in this.indexes){const u=this.indexes[o],f={};for(const y in u){const w=u[y];w.tileID=w.tileID.unwrapTo(w.tileID.wrap+r),f[w.tileID.key]=w}this.indexes[o]=f}this.lng=e}addBucket(e,r,o){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===r.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let f=0;f<r.symbolInstances.length;f++)r.symbolInstances.get(f).crossTileID=0;this.usedCrossTileIDs[e.overscaledZ]||(this.usedCrossTileIDs[e.overscaledZ]={});const u=this.usedCrossTileIDs[e.overscaledZ];for(const f in this.indexes){const y=this.indexes[f];if(Number(f)>e.overscaledZ)for(const w in y){const S=y[w];S.tileID.isChildOf(e)&&S.findMatches(r.symbolInstances,e,u)}else{const w=y[e.scaledTo(Number(f)).key];w&&w.findMatches(r.symbolInstances,e,u)}}for(let f=0;f<r.symbolInstances.length;f++){const y=r.symbolInstances.get(f);y.crossTileID||(y.crossTileID=o.generate(),u[y.crossTileID]=!0)}return this.indexes[e.overscaledZ]===void 0&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new Vl(e,r.symbolInstances,r.bucketInstanceId),!0}removeBucketCrossTileIDs(e,r){for(const o of r.getCrossTileIDsLists())for(const u of o)delete this.usedCrossTileIDs[e][u]}removeStaleBuckets(e){let r=!1;for(const o in this.indexes){const u=this.indexes[o];for(const f in u)e[u[f].bucketInstanceId]||(this.removeBucketCrossTileIDs(o,u[f]),delete u[f],r=!0)}return r}}class dn{constructor(){this.layerIndexes={},this.crossTileIDs=new xo,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(e,r,o){let u=this.layerIndexes[e.id];u===void 0&&(u=this.layerIndexes[e.id]=new Ru);let f=!1;const y={};u.handleWrapJump(o);for(const w of r){const S=w.getBucket(e);S&&e.id===S.layerIds[0]&&(S.bucketInstanceId||(S.bucketInstanceId=++this.maxBucketInstanceId),u.addBucket(w.tileID,S,this.crossTileIDs)&&(f=!0),y[S.bucketInstanceId]=!0)}return u.removeStaleBuckets(y)&&(f=!0),f}pruneUnusedLayers(e){const r={};e.forEach(o=>{r[o]=!0});for(const o in this.layerIndexes)r[o]||delete this.layerIndexes[o]}}var $l="void main() {fragColor=vec4(1.0);}";const ys={prelude:kt(`#ifdef GL_ES
26precision mediump float;
27#else
28#if !defined(lowp)
29#define lowp
30#endif
31#if !defined(mediump)
32#define mediump
33#endif
34#if !defined(highp)
35#define highp
36#endif
37#endif
38out highp vec4 fragColor;`,`#ifdef GL_ES
39precision highp float;
40#else
41#if !defined(lowp)
42#define lowp
43#endif
44#if !defined(mediump)
45#define mediump
46#endif
47#if !defined(highp)
48#define highp
49#endif
50#endif
51vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
52);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);
52return (tile_units_to_pixels*pos+offset)/pattern_size;}mat3 rotationMatrixFromAxisAngle(vec3 u,float angle) {float c=cos(angle);float s=sin(angle);float c2=1.0-c;return mat3(u.x*u.x*c2+      c,u.x*u.y*c2-u.z*s,u.x*u.z*c2+u.y*s,u.y*u.x*c2+u.z*s,u.y*u.y*c2+    c,u.y*u.z*c2-u.x*s,u.z*u.x*c2-u.y*s,u.z*u.y*c2+u.x*s,u.z*u.z*c2+    c
53);}
54#ifdef TERRAIN3D
55uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;
56#endif
57const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {
58#ifdef TERRAIN3D
59highp float d=unpack(texture(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));
60#else
61return 1.0;
62#endif
63}float calculate_visibility(vec4 pos) {
64#ifdef TERRAIN3D
65vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;
66#else
67return 1.0;
68#endif
69}float ele(vec2 pos) {
70#ifdef TERRAIN3D
71vec4 rgb=(texture(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;
72#else
73return 0.0;
74#endif
75}float get_elevation(vec2 pos) {
76#ifdef TERRAIN3D
77#ifdef GLOBE
78if ((pos.y <-32767.5) || (pos.y > 32766.5)) {return 0.0;}
79#endif
80vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;
81#else
82return 0.0;
83#endif
84}const float PI=3.141592653589793;uniform mat4 u_projection_matrix;`),projectionMercator:kt("","float projectLineThickness(float tileY) {return 1.0;}float projectCircleRadius(float tileY) {return 1.0;}vec4 projectTile(vec2 p) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);return result;}vec4 projectTile(vec2 p,vec2 rawPos) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);if (rawPos.y <-32767.5 || rawPos.y > 32766.5) {result.z=-10000000.0;}return result;}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_projection_matrix*vec4(posInTile,elevation,1.0);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {return projectTileWithElevation(posInTile,elevation);}"),projectionGlobe:kt("",`#define GLOBE_RADIUS 6371008.8
85uniform highp vec4 u_projection_tile_mercator_coords;uniform highp vec4 u_projection_clipping_plane;uniform highp float u_projection_transition;uniform mat4 u_projection_fallback_matrix;vec3 globeRotateVector(vec3 vec,vec2 angles) {vec3 axisRight=vec3(vec.z,0.0,-vec.x);vec3 axisUp=cross(axisRight,vec);axisRight=normalize(axisRight);axisUp=normalize(axisUp);vec2 t=tan(angles);return normalize(vec+axisRight*t.x+axisUp*t.y);}mat3 globeGetRotationMatrix(vec3 spherePos) {vec3 axisRight=vec3(spherePos.z,0.0,-spherePos.x);vec3 axisDown=cross(axisRight,spherePos);axisRight=normalize(axisRight);axisDown=normalize(axisDown);return mat3(axisRight,axisDown,spherePos
86);}float circumferenceRatioAtTileY(float tileY) {float mercator_pos_y=u_projection_tile_mercator_coords.y+u_projection_tile_mercator_coords.w*tileY;float spherical_y=2.0*atan(exp(PI-(mercator_pos_y*PI*2.0)))-PI*0.5;return cos(spherical_y);}float projectLineThickness(float tileY) {float thickness=1.0/circumferenceRatioAtTileY(tileY); 
87if (u_projection_transition < 0.999) {return mix(1.0,thickness,u_projection_transition);} else {return thickness;}}vec3 projectToSphere(vec2 translatedPos,vec2 rawPos) {vec2 mercator_pos=u_projection_tile_mercator_coords.xy+u_projection_tile_mercator_coords.zw*translatedPos;vec2 spherical;spherical.x=mercator_pos.x*PI*2.0+PI;spherical.y=2.0*atan(exp(PI-(mercator_pos.y*PI*2.0)))-PI*0.5;float len=cos(spherical.y);vec3 pos=vec3(sin(spherical.x)*len,sin(spherical.y),cos(spherical.x)*len
88);if (rawPos.y <-32767.5) {pos=vec3(0.0,1.0,0.0);}if (rawPos.y > 32766.5) {pos=vec3(0.0,-1.0,0.0);}return pos;}vec3 projectToSphere(vec2 posInTile) {return projectToSphere(posInTile,vec2(0.0,0.0));}float globeComputeClippingZ(vec3 spherePos) {return (1.0-(dot(spherePos,u_projection_clipping_plane.xyz)+u_projection_clipping_plane.w));}vec4 interpolateProjection(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);globePosition.z=globeComputeClippingZ(elevatedPos)*globePosition.w;if (u_projection_transition > 0.999) {return globePosition;}vec4 flatPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);const float z_globeness_threshold=0.2;vec4 result=globePosition;result.z=mix(0.0,globePosition.z,clamp((u_projection_transition-z_globeness_threshold)/(1.0-z_globeness_threshold),0.0,1.0));result.xyw=mix(flatPosition.xyw,globePosition.xyw,u_projection_transition);if ((posInTile.y <-32767.5) || (posInTile.y > 32766.5)) {result=globePosition;const float poles_hidden_anim_percentage=0.02;result.z=mix(globePosition.z,100.0,pow(max((1.0-u_projection_transition)/poles_hidden_anim_percentage,0.0),8.0));}return result;}vec4 interpolateProjectionFor3D(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);if (u_projection_transition > 0.999) {return globePosition;}vec4 fallbackPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);return mix(fallbackPosition,globePosition,u_projection_transition);}vec4 projectTile(vec2 posInTile) {return interpolateProjection(posInTile,projectToSphere(posInTile),0.0);}vec4 projectTile(vec2 posInTile,vec2 rawPos) {return interpolateProjection(posInTile,projectToSphere(posInTile,rawPos),0.0);}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return interpolateProjection(posInTile,projectToSphere(posInTile),elevation);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {vec3 spherePos=projectToSphere(posInTile,posInTile);return interpolateProjectionFor3D(posInTile,spherePos,elevation);}`),background:kt(`uniform vec4 u_color;uniform float u_opacity;void main() {fragColor=u_color*u_opacity;
89#ifdef OVERDRAW_INSPECTOR
90fragColor=vec4(1.0);
91#endif
92}`,"in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),backgroundPattern:kt(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;
92uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);fragColor=mix(color1,color2,u_mix)*u_opacity;
93#ifdef OVERDRAW_INSPECTOR
94fragColor=vec4(1.0);
95#endif
96}`,"uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;void main() {gl_Position=projectTile(a_pos);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:kt(`in vec3 v_data;in float v_visibility;
97#pragma mapbox: define highp vec4 color
98#pragma mapbox: define mediump float radius
99#pragma mapbox: define lowp float blur
100#pragma mapbox: define lowp float opacity
101#pragma mapbox: define highp vec4 stroke_color
102#pragma mapbox: define mediump float stroke_width
103#pragma mapbox: define lowp float stroke_opacity
104void main() {
105#pragma mapbox: initialize highp vec4 color
106#pragma mapbox: initialize mediump float radius
107#pragma mapbox: initialize lowp float blur
108#pragma mapbox: initialize lowp float opacity
109#pragma mapbox: initialize highp vec4 stroke_color
110#pragma mapbox: initialize mediump float stroke_width
111#pragma mapbox: initialize lowp float stroke_opacity
112vec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));fragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);const float epsilon=0.5/255.0;if (fragColor.r < epsilon && fragColor.g < epsilon && fragColor.b < epsilon && fragColor.a < epsilon) {discard;}
113#ifdef OVERDRAW_INSPECTOR
114fragColor=vec4(1.0);
115#endif
116}`,`uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform highp float u_globe_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;uniform vec2 u_translate;in vec2 a_pos;out vec3 v_data;out float v_visibility;
117#pragma mapbox: define highp vec4 color
118#pragma mapbox: define mediump float radius
119#pragma mapbox: define lowp float blur
120#pragma mapbox: define lowp float opacity
121#pragma mapbox: define highp vec4 stroke_color
122#pragma mapbox: define mediump float stroke_width
123#pragma mapbox: define lowp float stroke_opacity
124void main(void) {
125#pragma mapbox: initialize highp vec4 color
126#pragma mapbox: initialize mediump float radius
127#pragma mapbox: initialize lowp float blur
128#pragma mapbox: initialize lowp float opacity
129#pragma mapbox: initialize highp vec4 stroke_color
130#pragma mapbox: initialize mediump float stroke_width
131#pragma mapbox: initialize lowp float stroke_opacity
132vec2 pos_raw=a_pos+32768.0;vec2 extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);vec2 circle_center=floor(pos_raw/8.0)+u_translate;float ele=get_elevation(circle_center);v_visibility=calculate_visibility(projectTileWithElevation(circle_center,ele));if (u_pitch_with_map) {
133#ifdef GLOBE
134vec3 center_vector=projectToSphere(circle_center);
135#endif
136float angle_scale=u_globe_extrude_scale;vec2 corner_position=circle_center;if (u_scale_with_map) {angle_scale*=(radius+stroke_width);corner_position+=extrude*u_extrude_scale*(radius+stroke_width);} else {
137#ifdef GLOBE
138vec4 projected_center=interpolateProjection(circle_center,center_vector,ele);
139#else
140vec4 projected_center=projectTileWithElevation(circle_center,ele);
141#endif
142corner_position+=extrude*u_extrude_scale*(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);angle_scale*=(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);}
143#ifdef GLOBE
144vec2 angles=extrude*angle_scale;vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(corner_position,corner_vector,ele);
145#else
146gl_Position=projectTileWithElevation(corner_position,ele);
147#endif
148} else {gl_Position=projectTileWithElevation(circle_center,ele);if (gl_Position.z/gl_Position.w > 1.0) {gl_Position.xy=vec2(10000.0);}if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:kt($l,"in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),heatmap:kt(`uniform highp float u_intensity;in vec2 v_extrude;
149#pragma mapbox: define highp float weight
150#define GAUSS_COEF 0.3989422804014327
151void main() {
152#pragma mapbox: initialize highp float weight
153float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);fragColor=vec4(val,1.0,1.0,1.0);
154#ifdef OVERDRAW_INSPECTOR
155fragColor=vec4(1.0);
156#endif
157}`,`uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;uniform highp float u_globe_extrude_scale;in vec2 a_pos;out vec2 v_extrude;
158#pragma mapbox: define highp float weight
159#pragma mapbox: define mediump float radius
160const highp float ZERO=1.0/255.0/16.0;
161#define GAUSS_COEF 0.3989422804014327
162void main(void) {
163#pragma mapbox: initialize highp float weight
164#pragma mapbox: initialize mediump float radius
165vec2 pos_raw=a_pos+32768.0;vec2 unscaled_extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 circle_center=floor(pos_raw/8.0);
166#ifdef GLOBE
167vec2 angles=v_extrude*radius*u_globe_extrude_scale;vec3 center_vector=projectToSphere(circle_center);vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(circle_center+extrude,corner_vector,0.0);
168#else
169gl_Position=projectTileFor3D(circle_center+extrude,get_elevation(circle_center));
170#endif
171}`),heatmapTexture:kt(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));fragColor=color*u_opacity;
172#ifdef OVERDRAW_INSPECTOR
173fragColor=vec4(0.0);
174#endif
175}`,"uniform mat4 u_matrix;uniform vec2 u_world;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:kt("in float v_placed;in float v_notUsed;void main() {float alpha=0.5;fragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {fragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {fragColor*=.1;}}","in vec2 a_anchor_pos;in vec2 a_placed;in vec2 a_box_real;uniform vec2 u_pixel_extrude_scale;out float v_placed;out float v_notUsed;void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:kt("in float v_radius;in vec2 v_extrude;in float v_collision;void main() {float alpha=0.5;float stroke_radius=0.9;float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);fragColor=color*alpha*opacity_t;}","in vec2 a_pos;in float a_radius;in vec2 a_flags;uniform vec2 u_viewport_size;out float v_radius;out vec2 v_extrude;out float v_collision;void main() {float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_collision=collision;gl_Position=vec4((a_pos/u_viewport_size*2.0-1.0)*vec2(1.0,-1.0),0.0,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:kt("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);fragColor=mix(u_color,overlay_color,overlay_color.a);}","in vec2 a_pos;out vec2 v_uv;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=projectTileWithElevation(a_pos*u_overlay_scale,get_elevation(a_pos));}"),depth:kt($l,`in vec2 a_pos;void main() {
176#ifdef GLOBE
177gl_Position=projectTileFor3D(a_pos,0.0);
178#else
179gl_Position=u_projection_matrix*vec4(a_pos,0.0,1.0);
180#endif
181}`),fill:kt(`#pragma mapbox: define highp vec4 color
182#pragma mapbox: define lowp float opacity
183void main() {
184#pragma mapbox: initialize highp vec4 color
185#pragma mapbox: initialize lowp float opacity
186fragColor=color*opacity;
187#ifdef OVERDRAW_INSPECTOR
188fragColor=vec4(1.0);
189#endif
190}`,`uniform vec2 u_fill_translate;in vec2 a_pos;
191#pragma mapbox: define highp vec4 color
192#pragma mapbox: define lowp float opacity
193void main() {
194#pragma mapbox: initialize highp vec4 color
195#pragma mapbox: initialize lowp float opacity
196gl_Position=projectTile(a_pos+u_fill_translate,a_pos);}`),fillOutline:kt(`in vec2 v_pos;
197#ifdef GLOBE
198in float v_depth;
199#endif
200#pragma mapbox: define highp vec4 outline_color
201#pragma mapbox: define lowp float opacity
202void main() {
203#pragma mapbox: initialize highp vec4 outline_color
204#pragma mapbox: initialize lowp float opacity
205float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=outline_color*(alpha*opacity);
206#ifdef GLOBE
207if (v_depth > 1.0) {discard;}
208#endif
209#ifdef OVERDRAW_INSPECTOR
210fragColor=vec4(1.0);
211#endif
212}`,`uniform vec2 u_world;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos;
213#ifdef GLOBE
214out float v_depth;
215#endif
216#pragma mapbox: define highp vec4 outline_color
217#pragma mapbox: define lowp float opacity
218void main() {
219#pragma mapbox: initialize highp vec4 outline_color
220#pragma mapbox: initialize lowp float opacity
221gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;
222#ifdef GLOBE
223v_depth=gl_Position.z/gl_Position.w;
224#endif
225}`),fillOutlinePattern:kt(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;in vec2 v_pos_a;in vec2 v_pos_b;in vec2 v_pos;
226#ifdef GLOBE
227in float v_depth;
228#endif
229#pragma mapbox: define lowp float opacity
230#pragma mapbox: define lowp vec4 pattern_from
231#pragma mapbox: define lowp vec4 pattern_to
232void main() {
233#pragma mapbox: initialize lowp float opacity
234#pragma mapbox: initialize mediump vec4 pattern_from
235#pragma mapbox: initialize mediump vec4 pattern_to
236vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=mix(color1,color2,u_fade)*alpha*opacity;
237#ifdef GLOBE
238if (v_depth > 1.0) {discard;}
239#endif
240#ifdef OVERDRAW_INSPECTOR
241fragColor=vec4(1.0);
242#endif
243}`,`uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;out vec2 v_pos;
244#ifdef GLOBE
245out float v_depth;
246#endif
247#pragma mapbox: define lowp float opacity
248#pragma mapbox: define lowp vec4 pattern_from
249#pragma mapbox: define lowp vec4 pattern_to
250#pragma mapbox: define lowp float pixel_ratio_from
251#pragma mapbox: define lowp float pixel_ratio_to
252void main() {
253#pragma mapbox: initialize lowp float opacity
254#pragma mapbox: initialize mediump vec4 pattern_from
255#pragma mapbox: initialize mediump vec4 pattern_to
256#pragma mapbox: initialize lowp float pixel_ratio_from
257#pragma mapbox: initialize lowp float pixel_ratio_to
258vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;
259#ifdef GLOBE
260v_depth=gl_Position.z/gl_Position.w;
261#endif
262}`),fillPattern:kt(`#ifdef GL_ES
263precision highp float;
264#endif
265uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;
266#pragma mapbox: define lowp float opacity
267#pragma mapbox: define lowp vec4 pattern_from
268#pragma mapbox: define lowp vec4 pattern_to
269void main() {
270#pragma mapbox: initialize lowp float opacity
271#pragma mapbox: initialize mediump vec4 pattern_from
272#pragma mapbox: initialize mediump vec4 pattern_to
273vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);fragColor=mix(color1,color2,u_fade)*opacity;
274#ifdef OVERDRAW_INSPECTOR
275fragColor=vec4(1.0);
276#endif
277}`,`uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;
278#pragma mapbox: define lowp float opacity
279#pragma mapbox: define lowp vec4 pattern_from
280#pragma mapbox: define lowp vec4 pattern_to
281#pragma mapbox: define lowp float pixel_ratio_from
282#pragma mapbox: define lowp float pixel_ratio_to
283void main() {
284#pragma mapbox: initialize lowp float opacity
285#pragma mapbox: initialize mediump vec4 pattern_from
286#pragma mapbox: initialize mediump vec4 pattern_to
287#pragma mapbox: initialize lowp float pixel_ratio_from
288#pragma mapbox: initialize lowp float pixel_ratio_to
289vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:kt(`in vec4 v_color;void main() {fragColor=v_color;
290#ifdef OVERDRAW_INSPECTOR
291fragColor=vec4(1.0);
292#endif
293}`,`uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;in vec2 a_pos;in vec4 a_normal_ed;
294#ifdef TERRAIN3D
295in vec2 a_centroid;
296#endif
297out vec4 v_color;
298#pragma mapbox: define highp float base
299#pragma mapbox: define highp float height
300#pragma mapbox: define highp vec4 color
301void main() {
302#pragma mapbox: initialize highp float base
303#pragma mapbox: initialize highp float height
304#pragma mapbox: initialize highp vec4 color
305vec3 normal=a_normal_ed.xyz;
306#ifdef TERRAIN3D
307float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0
307.0 ? 0.0 : 10.0);
308#else
309float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
310#endif
311base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;
312#ifdef GLOBE
313vec3 spherePos=projectToSphere(posInTile,a_pos);gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);
314#else
315gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);
316#endif
317float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;vec3 normalForLighting=normal/16384.0;float directional=clamp(dot(normalForLighting,u_lightpos),0.0,1.0);
318#ifdef GLOBE
319mat3 rotMatrix=globeGetRotationMatrix(spherePos);normalForLighting=rotMatrix*normalForLighting;directional=mix(directional,clamp(dot(normalForLighting,u_lightpos_globe),0.0,1.0),u_projection_transition);
320#endif
321directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:kt(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;in vec4 v_lighting;
322#pragma mapbox: define lowp float base
323#pragma mapbox: define lowp float height
324#pragma mapbox: define lowp vec4 pattern_from
325#pragma mapbox: define lowp vec4 pattern_to
326#pragma mapbox: define lowp float pixel_ratio_from
327#pragma mapbox: define lowp float pixel_ratio_to
328void main() {
329#pragma mapbox: initialize lowp float base
330#pragma mapbox: initialize lowp float height
331#pragma mapbox: initialize mediump vec4 pattern_from
332#pragma mapbox: initialize mediump vec4 pattern_to
333#pragma mapbox: initialize lowp float pixel_ratio_from
334#pragma mapbox: initialize lowp float pixel_ratio_to
335vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);fragColor=mixedColor*v_lighting;
336#ifdef OVERDRAW_INSPECTOR
337fragColor=vec4(1.0);
338#endif
339}`,`uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;in vec2 a_pos;in vec4 a_normal_ed;
340#ifdef TERRAIN3D
341in vec2 a_centroid;
342#endif
343#ifdef GLOBE
344out vec3 v_sphere_pos;
345#endif
346out vec2 v_pos_a;out vec2 v_pos_b;out vec4 v_lighting;
347#pragma mapbox: define lowp float base
348#pragma mapbox: define lowp float height
349#pragma mapbox: define lowp vec4 pattern_from
350#pragma mapbox: define lowp vec4 pattern_to
351#pragma mapbox: define lowp float pixel_ratio_from
352#pragma mapbox: define lowp float pixel_ratio_to
353void main() {
354#pragma mapbox: initialize lowp float base
355#pragma mapbox: initialize lowp float height
356#pragma mapbox: initialize mediump vec4 pattern_from
357#pragma mapbox: initialize mediump vec4 pattern_to
358#pragma mapbox: initialize lowp float pixel_ratio_from
359#pragma mapbox: initialize lowp float pixel_ratio_to
360vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;
361#ifdef TERRAIN3D
362float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
363#else
364float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
365#endif
366base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;
367#ifdef GLOBE
368vec3 spherePos=projectToSphere(posInTile,a_pos);vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);v_sphere_pos=elevatedPos;gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);
369#else
370gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);
371#endif
372vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0
373? a_pos
374: vec2(edgedistance,elevation*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:kt(`#ifdef GL_ES
375precision highp float;
376#endif
377uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));fragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);
378#ifdef OVERDRAW_INSPECTOR
379fragColor=vec4(1.0);
380#endif
381}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:kt(`uniform 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;
382#define PI 3.141592653589793
383void 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;
383float 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);fragColor=accent_color*(1.0-shade_color.a)+shade_color;
384#ifdef OVERDRAW_INSPECTOR
385fragColor=vec4(1.0);
386#endif
387}`,"uniform mat4 u_matrix;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);v_pos=a_pos/8192.0;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),line:kt(`uniform lowp float u_device_pixel_ratio;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;
388#ifdef GLOBE
389in float v_depth;
390#endif
391#pragma mapbox: define highp vec4 color
392#pragma mapbox: define lowp float blur
393#pragma mapbox: define lowp float opacity
394void main() {
395#pragma mapbox: initialize highp vec4 color
396#pragma mapbox: initialize lowp float blur
397#pragma mapbox: initialize lowp float opacity
398float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);fragColor=color*(alpha*opacity);
399#ifdef GLOBE
400if (v_depth > 1.0) {discard;}
401#endif
402#ifdef OVERDRAW_INSPECTOR
403fragColor=vec4(1.0);
404#endif
405}`,`
406#define scale 0.015873016
407in vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp float v_linesofar;
408#ifdef GLOBE
409out float v_depth;
410#endif
411#pragma mapbox: define highp vec4 color
412#pragma mapbox: define lowp float blur
413#pragma mapbox: define lowp float opacity
414#pragma mapbox: define mediump float gapwidth
415#pragma mapbox: define lowp float offset
416#pragma mapbox: define mediump float width
417void main() {
418#pragma mapbox: initialize highp vec4 color
419#pragma mapbox: initialize lowp float blur
420#pragma mapbox: initialize lowp float opacity
421#pragma mapbox: initialize mediump float gapwidth
422#pragma mapbox: initialize lowp float offset
423#pragma mapbox: initialize mediump float width
424float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;
425#ifdef GLOBE
426v_depth=gl_Position.z/gl_Position.w;
427#endif
428#ifdef TERRAIN3D
429v_gamma_scale=1.0;
430#else
431float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
432#endif
433v_width2=vec2(outset,inset);}`),lineGradient:kt(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec2 v_uv;
434#ifdef GLOBE
435in float v_depth;
436#endif
437#pragma mapbox: define lowp float blur
438#pragma mapbox: define lowp float opacity
439void main() {
440#pragma mapbox: initialize lowp float blur
441#pragma mapbox: initialize lowp float opacity
442float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);fragColor=color*(alpha*opacity);
443#ifdef GLOBE
444if (v_depth > 1.0) {discard;}
445#endif
446#ifdef OVERDRAW_INSPECTOR
447fragColor=vec4(1.0);
448#endif
449}`,`
450#define scale 0.015873016
451in vec2 a_pos_normal;in vec4 a_data;in float a_uv_x;in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;
452#ifdef GLOBE
453out float v_depth;
454#endif
455#pragma mapbox: define lowp float blur
456#pragma mapbox: define lowp float opacity
457#pragma mapbox: define mediump float gapwidth
458#pragma mapbox: define lowp float offset
459#pragma mapbox: define mediump float width
460void main() {
461#pragma mapbox: initialize lowp float blur
462#pragma mapbox: initialize lowp float opacity
463#pragma mapbox: initialize mediump float gapwidth
464#pragma mapbox: initialize lowp float offset
465#pragma mapbox: initialize mediump float width
466float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);
466float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;
467#ifdef GLOBE
468v_depth=gl_Position.z/gl_Position.w;
469#endif
470#ifdef TERRAIN3D
471v_gamma_scale=1.0;
472#else
473float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
474#endif
475v_width2=vec2(outset,inset);}`),linePattern:kt(`#ifdef GL_ES
476precision highp float;
477#endif
478uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;in vec2 v_normal;in vec2 v_width2;in float v_linesofar;in float v_gamma_scale;in float v_width;
479#ifdef GLOBE
480in float v_depth;
481#endif
482#pragma mapbox: define lowp vec4 pattern_from
483#pragma mapbox: define lowp vec4 pattern_to
484#pragma mapbox: define lowp float pixel_ratio_from
485#pragma mapbox: define lowp float pixel_ratio_to
486#pragma mapbox: define lowp float blur
487#pragma mapbox: define lowp float opacity
488void main() {
489#pragma mapbox: initialize mediump vec4 pattern_from
490#pragma mapbox: initialize mediump vec4 pattern_to
491#pragma mapbox: initialize lowp float pixel_ratio_from
492#pragma mapbox: initialize lowp float pixel_ratio_to
493#pragma mapbox: initialize lowp float blur
494#pragma mapbox: initialize lowp float opacity
495vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture(u_image,pos_a),texture(u_image,pos_b),u_fade);fragColor=color*alpha*opacity;
496#ifdef GLOBE
497if (v_depth > 1.0) {discard;}
498#endif
499#ifdef OVERDRAW_INSPECTOR
500fragColor=vec4(1.0);
501#endif
502}`,`
503#define scale 0.015873016
504#define LINE_DISTANCE_SCALE 2.0
505in vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_linesofar;out float v_gamma_scale;out float v_width;
506#ifdef GLOBE
507out float v_depth;
508#endif
509#pragma mapbox: define lowp float blur
510#pragma mapbox: define lowp float opacity
511#pragma mapbox: define lowp float offset
512#pragma mapbox: define mediump float gapwidth
513#pragma mapbox: define mediump float width
514#pragma mapbox: define lowp float floorwidth
515#pragma mapbox: define lowp vec4 pattern_from
516#pragma mapbox: define lowp vec4 pattern_to
517#pragma mapbox: define lowp float pixel_ratio_from
518#pragma mapbox: define lowp float pixel_ratio_to
519void main() {
520#pragma mapbox: initialize lowp float blur
521#pragma mapbox: initialize lowp float opacity
522#pragma mapbox: initialize lowp float offset
523#pragma mapbox: initialize mediump float gapwidth
524#pragma mapbox: initialize mediump float width
525#pragma mapbox: initialize lowp float floorwidth
526#pragma mapbox: initialize mediump vec4 pattern_from
527#pragma mapbox: initialize mediump vec4 pattern_to
528#pragma mapbox: initialize lowp float pixel_ratio_from
529#pragma mapbox: initialize lowp float pixel_ratio_to
530float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);
530float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;
531#ifdef GLOBE
532v_depth=gl_Position.z/gl_Position.w;
533#endif
534#ifdef TERRAIN3D
535v_gamma_scale=1.0;
536#else
537float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
538#endif
539v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:kt(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;
540#ifdef GLOBE
541in float v_depth;
542#endif
543#pragma mapbox: define highp vec4 color
544#pragma mapbox: define lowp float blur
545#pragma mapbox: define lowp float opacity
546#pragma mapbox: define mediump float width
547#pragma mapbox: define lowp float floorwidth
548void main() {
549#pragma mapbox: initialize highp vec4 color
550#pragma mapbox: initialize lowp float blur
551#pragma mapbox: initialize lowp float opacity
552#pragma mapbox: initialize mediump float width
553#pragma mapbox: initialize lowp float floorwidth
554float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture(u_image,v_tex_a).a;float sdfdist_b=texture(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*opacity);
555#ifdef GLOBE
556if (v_depth > 1.0) {discard;}
557#endif
558#ifdef OVERDRAW_INSPECTOR
559fragColor=vec4(1.0);
560#endif
561}`,`
562#define scale 0.015873016
563#define LINE_DISTANCE_SCALE 2.0
564in vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;out vec2 v_normal;out vec2 v_width2;out vec2 v_tex_a;out vec2 v_tex_b;out float v_gamma_scale;
565#ifdef GLOBE
566out float v_depth;
567#endif
568#pragma mapbox: define highp vec4 color
569#pragma mapbox: define lowp float blur
570#pragma mapbox: define lowp float opacity
571#pragma mapbox: define mediump float gapwidth
572#pragma mapbox: define lowp float offset
573#pragma mapbox: define mediump float width
574#pragma mapbox: define lowp float floorwidth
575void main() {
576#pragma mapbox: initialize highp vec4 color
577#pragma mapbox: initialize lowp float blur
578#pragma mapbox: initialize lowp float opacity
579#pragma mapbox: initialize mediump float gapwidth
580#pragma mapbox: initialize lowp float offset
581#pragma mapbox: initialize mediump float width
582#pragma mapbox: initialize lowp float floorwidth
583float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;
584#ifdef GLOBE
585v_depth=gl_Position.z/gl_Position.w;
586#endif
587#ifdef TERRAIN3D
588v_gamma_scale=1.0;
589#else
590float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
591#endif
592v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:kt(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;in vec2 v_pos0;in vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture(u_image0,v_pos0);vec4 color1=texture(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);fragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);
593#ifdef OVERDRAW_INSPECTOR
594fragColor=vec4(1.0);
595#endif
596}`,`uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;uniform vec4 u_coords_top;uniform vec4 u_coords_bottom;in vec2 a_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {vec2 fractionalPos=a_pos/8192.0;vec2 position=mix(mix(u_coords_top.xy,u_coords_top.zw,fractionalPos.x),mix(u_coords_bottom.xy,u_coords_bottom.zw,fractionalPos.x),fractionalPos.y);gl_Position=projectTile(position,position);v_pos0=((fractionalPos-0.5)/u_buffer_scale)+0.5;
597#ifdef GLOBE
598if (a_pos.y <-32767.5) {v_pos0.y=0.0;}if (a_pos.y > 32766.5) {v_pos0.y=1.0;}
599#endif
600v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}`),symbolIcon:kt(`uniform sampler2D u_texture;in vec2 v_tex;in float v_fade_opacity;
601#pragma mapbox: define lowp float opacity
602void main() {
603#pragma mapbox: initialize lowp float opacity
604lowp float alpha=opacity*v_fade_opacity;fragColor=texture(u_texture,v_tex)*alpha;
605#ifdef OVERDRAW_INSPECTOR
606fragColor=vec4(1.0);
607#endif
608}`,`in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;out vec2 v_tex;out float v_fade_opacity;
609#pragma mapbox: define lowp float opacity
610void main() {
611#pragma mapbox: initialize lowp float opacity
612vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
613camera_to_anchor_distance/u_camera_to_center_distance :
614u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;
615#ifdef GLOBE
616if(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}
617#endif
618vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:kt(`#define SDF_PX 8.0
619uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;in vec2 v_data0;in vec3 v_data1;
620#pragma mapbox: define highp vec4 fill_color
621#pragma mapbox: define highp vec4 halo_color
622#pragma mapbox: define lowp float opacity
623#pragma mapbox: define lowp float halo_width
624#pragma mapbox: define lowp float halo_blur
625void main() {
626#pragma mapbox: initialize highp vec4 fill_color
627#pragma mapbox: initialize highp vec4 halo_color
628#pragma mapbox: initialize lowp float opacity
629#pragma mapbox: initialize lowp float halo_width
630#pragma mapbox: initialize lowp float halo_blur
631float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}fragColor=color*(alpha*opacity*fade_opacity);
632#ifdef OVERDRAW_INSPECTOR
633fragColor=vec4(1.0);
634#endif
635}`,`in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_translation;uniform float u_pitched_scale;out vec2 v_data0;out vec3 v_data1;
636#pragma mapbox: define highp vec4 fill_color
637#pragma mapbox: define highp vec4 halo_color
638#pragma mapbox: define lowp float opacity
639#pragma mapbox: define lowp float halo_width
640#pragma mapbox: define lowp float halo_blur
641void main() {
642#pragma mapbox: initialize highp vec4 fill_color
643#pragma mapbox: initialize highp vec4 halo_color
644#pragma mapbox: initialize lowp float opacity
645#pragma mapbox: initialize lowp float halo_width
646#pragma mapbox: initialize lowp float halo_blur
647vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
648camera_to_anchor_distance/u_camera_to_center_distance :
649u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;
650#ifdef GLOBE
651if(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}
652#endif
653vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:kt(`#define SDF_PX 8.0
654#define SDF 1.0
655#define ICON 0.0
656uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;in vec4 v_data0;in vec4 v_data1;
657#pragma mapbox: define highp vec4 fill_color
658#pragma mapbox: define highp vec4 halo_color
659#pragma mapbox: define lowp float opacity
660#pragma mapbox: define lowp float halo_width
661#pragma mapbox: define lowp float halo_blur
662void main() {
663#pragma mapbox: initialize highp vec4 fill_color
664#pragma mapbox: initialize highp vec4 halo_color
665#pragma mapbox: initialize lowp float opacity
666#pragma mapbox: initialize lowp float halo_width
667#pragma mapbox: initialize lowp float halo_blur
668float fad
668e_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;fragColor=texture(u_texture_icon,tex_icon)*alpha;
669#ifdef OVERDRAW_INSPECTOR
670fragColor=vec4(1.0);
671#endif
672return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);fragColor=color*(alpha*opacity*fade_opacity);
673#ifdef OVERDRAW_INSPECTOR
674fragColor=vec4(1.0);
675#endif
676}`,`in vec4 a_pos_offset;in vec4 a_data;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;out vec4 v_data0;out vec4 v_data1;
677#pragma mapbox: define highp vec4 fill_color
678#pragma mapbox: define highp vec4 halo_color
679#pragma mapbox: define lowp float opacity
680#pragma mapbox: define lowp float halo_width
681#pragma mapbox: define lowp float halo_blur
682void main() {
683#pragma mapbox: initialize highp vec4 fill_color
684#pragma mapbox: initialize highp vec4 halo_color
685#pragma mapbox: initialize lowp float opacity
686#pragma mapbox: initialize lowp float halo_width
687#pragma mapbox: initialize lowp float halo_blur
688vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
689camera_to_anchor_distance/u_camera_to_center_distance :
690u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;
691#ifdef GLOBE
692if(u_pitch_with_map && !u_is_along_line) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}
693#endif
694vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:kt("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;uniform bool u_is_globe_mode;in vec2 v_texture_pos;in float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture(u_texture,vec2(v_texture_pos.x,1.0-v_texture_pos.y));if (!u_is_globe_mode && v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);
694float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);fragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {fragColor=surface_color;}}","in vec3 a_pos3d;uniform mat4 u_fog_matrix;uniform float u_ele_delta;out vec2 v_texture_pos;out float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:kt("in float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {fragColor=pack(v_depth);}","in vec3 a_pos3d;uniform float u_ele_delta;out float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:kt("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;in vec2 v_texture_pos;void main() {vec4 rgba=texture(u_texture,v_texture_pos);fragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","in vec3 a_pos3d;uniform float u_ele_delta;out vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);}"),projectionErrorMeasurement:kt("in vec4 v_output_error_encoded;void main() {fragColor=v_output_error_encoded;}","in vec2 a_pos;uniform highp float u_input;uniform highp float u_output_expected;out vec4 v_output_error_encoded;void main() {float real_output=2.0*atan(exp(PI-(u_input*PI*2.0)))-PI*0.5;float error=real_output-u_output_expected;float abs_error=abs(error)*128.0;v_output_error_encoded.x=min(floor(abs_error*256.0),255.0)/255.0;abs_error-=v_output_error_encoded.x;v_output_error_encoded.y=min(floor(abs_error*65536.0),255.0)/255.0;abs_error-=v_output_error_encoded.x/255.0;v_output_error_encoded.z=min(floor(abs_error*16777216.0),255.0)/255.0;v_output_error_encoded.w=error >=0.0 ? 1.0 : 0.0;gl_Position=vec4(a_pos,0.0,1.0);}"),atmosphere:kt(`in vec3 view_direction;uniform vec3 u_sun_pos;uniform vec3 u_globe_position;uniform float u_globe_radius;uniform float u_atmosphere_blend;/**Shader use from https:*Made some change to adapt to MapLibre Globe geometry*/const float PI=3.141592653589793;const int iSteps=5;const int jSteps=3;/*radius of the planet*/const float EARTH_RADIUS=6371e3;/*radius of the atmosphere*/const float ATMOS_RADIUS=6471e3;vec2 rsi(vec3 r0,vec3 rd,float sr) {float a=dot(rd,rd);float b=2.0*dot(rd,r0);float c=dot(r0,r0)-(sr*sr);float d=(b*b)-4.0*a*c;if (d < 0.0) return vec2(1e5,-1e5);return vec2((-b-sqrt(d))/(2.0*a),(-b+sqrt(d))/(2.0*a));}vec4 atmosphere(vec3 r,vec3 r0,vec3 pSun,float iSun,float rPlanet,float rAtmos,vec3 kRlh,float kMie,float shRlh,float shMie,float g) {pSun=normalize(pSun);r=normalize(r);vec2 p=rsi(r0,r,rAtmos);if (p.x > p.y) {return vec4(0.0,0.0,0.0,1.0);}if (p.x < 0.0) {p.x=0.0;}vec3 pos=r0+r*p.x;vec2 p2=rsi(r0,r,rPlanet);if (p2.x <=p2.y && p2.x > 0.0) {p.y=min(p.y,p2.x);}float iStepSize=(p.y-p.x)/float(iSteps);float iTime=p.x+iStepSize*0.5;vec3 totalRlh=vec3(0,0,0);vec3 totalMie=vec3(0,0,0);float iOdRlh=0.0;float iOdMie=0.0;float mu=dot(r,pSun);float mumu=mu*mu;float gg=g*g;float pRlh=3.0/(16.0*PI)*(1.0+mumu);float pMie=3.0/(8.0*PI)*((1.0-gg)*(mumu+1.0))/(pow(1.0+gg-2.0*mu*g,1.5)*(2.0+gg));for (int i=0; i < iSteps; i++) {vec3 iPos=r0+r*iTime;float iHeight=length(iPos)-rPlanet;float odStepRlh=exp(-iHeight/shRlh)*iStepSize;float odStepMie=exp(-iHeight/shMie)*iStepSize;iOdRlh+=odStepRlh;iOdMie+=odStepMie;float jStepSize=rsi(iPos,pSun,rAtmos).y/float(jSteps);float jTime=jStepSize*0.5;float jOdRlh=0.0;float jOdMie=0.0;for (int j=0; j < jSteps; j++) {vec3 jPos=iPos+pSun*jTime;float jHeight=length(jPos)-rPlanet;jOdRlh+=exp(-jHeight/shRlh)*jStepSize;jOdMie+=exp(-jHeight/shMie)*jStepSize;jTime+=jStepSize;}vec3 attn=exp(-(kMie*(iOdMie+jOdMie)+kRlh*(iOdRlh+jOdRlh)));totalRlh+=odStepRlh*attn;totalMie+=odStepMie*attn;iTime+=iStepSize;}float opacity=exp(-(length(kRlh)*length(totalRlh)+kMie*length(totalMie)));vec3 color=iSun*(pRlh*kRlh*totalRlh+pMie*kMie*totalMie);return vec4(color,opacity);}void main() {vec3 scale_camera_pos=-u_globe_position*EARTH_RADIUS/u_globe_radius;vec4 color=atmosphere(normalize(view_direction),scale_camera_pos,u_sun_pos,22.0,EARTH_RADIUS,ATMOS_RADIUS,vec3(5.5e-6,13.0e-6,22.4e-6),21e-6,8e3,1.2e3,0.758
695);color.rgb=1.0-exp(-1.0*color.rgb);color=pow(color,vec4(1.0/2.2));fragColor=vec4(color.rgb,1.0-color.a)*u_atmosphere_blend;}`,"in vec2 a_pos;uniform mat4 u_inv_proj_matrix;out vec3 view_direction;void main() {view_direction=(u_inv_proj_matrix*vec4(a_pos,0.0,1.0)).xyz;gl_Position=vec4(a_pos,0.0,1.0);}"),sky:kt("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform vec2 u_horizon;uniform vec2 u_horizon_normal;uniform float u_sky_horizon_blend;uniform float u_sky_blend;void main() {float x=gl_FragCoord.x;float y=gl_FragCoord.y;float blend=(y-u_horizon.y)*u_horizon_normal.y+(x-u_horizon.x)*u_horizon_normal.x;if (blend > 0.0) {if (blend < u_sky_horizon_blend) {fragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {fragColor=u_sky_color;}}fragColor=mix(fragColor,vec4(vec3(0.0),0.0),u_sky_blend);}","in vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};
vendor: 43,493 bytes, lines 695-744
695function kt(d,e){const r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,o=e.match(/in ([\w]+) ([\w]+)/g),u=d.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),f=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),y=f?f.concat(u):u,w={};return{fragmentSource:d=d.replace(r,(S,I,A,k,R)=>(w[R]=!0,I==="define"?`
696#ifndef HAS_UNIFORM_u_${R}
697in ${A} ${k} ${R};
698#else
699uniform ${A} ${k} u_${R};
700#endif
701`:`
702#ifdef HAS_UNIFORM_u_${R}
703    ${A} ${k} ${R} = u_${R};
704#endif
705`)),vertexSource:e=e.replace(r,(S,I,A,k,R)=>{const O=k==="float"?"vec2":"vec4",V=R.match(/color/)?"color":O;return w[R]?I==="define"?`
706#ifndef HAS_UNIFORM_u_${R}
707uniform lowp float u_${R}_t;
708in ${A} ${O} a_${R};
709out ${A} ${k} ${R};
710#else
711uniform ${A} ${k} u_${R};
712#endif
713`:V==="vec4"?`
714#ifndef HAS_UNIFORM_u_${R}
715    ${R} = a_${R};
716#else
717    ${A} ${k} ${R} = u_${R};
718#endif
719`:`
720#ifndef HAS_UNIFORM_u_${R}
721    ${R} = unpack_mix_${V}(a_${R}, u_${R}_t);
722#else
723    ${A} ${k} ${R} = u_${R};
724#endif
725`:I==="define"?`
726#ifndef HAS_UNIFORM_u_${R}
727uniform lowp float u_${R}_t;
728in ${A} ${O} a_${R};
729#else
730uniform ${A} ${k} u_${R};
731#endif
732`:V==="vec4"?`
733#ifndef HAS_UNIFORM_u_${R}
734    ${A} ${k} ${R} = a_${R};
735#else
736    ${A} ${k} ${R} = u_${R};
737#endif
738`:`
739#ifndef HAS_UNIFORM_u_${R}
740    ${A} ${k} ${R} = unpack_mix_${V}(a_${R}, u_${R}_t);
741#else
742    ${A} ${k} ${R} = u_${R};
743#endif
744`}),staticAttributes:o,staticUniforms:y}}class vs{constructor(e,r,o){this.vertexBuffer=e,this.indexBuffer=r,this.segments=o}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}var zt=c.aA([{name:"a_pos",type:"Int16",components:2}]);const bo="#define PROJECTION_MERCATOR",Du="mercator";class Ta{constructor(){this._cachedMesh=null}get name(){return"mercator"}get useSubdivision(){return!1}get shaderVariantName(){return Du}get shaderDefine(){return bo}get shaderPreludeCode(){return ys.projectionMercator}get vertexShaderPreludeCode(){return ys.projectionMercator.vertexSource}get subdivisionGranularity(){return c.aB.noSubdivision}get useGlobeControls(){return!1}get transitionState(){return 0}get latitudeErrorCorrectionRadians(){return 0}destroy(){}updateGPUdependent(e){}getMeshFromTileID(e,r,o,u,f){if(this._cachedMesh)return this._cachedMesh;const y=new c.aC;y.emplaceBack(0,0),y.emplaceBack(c.X,0),y.emplaceBack(0,c.X),y.emplaceBack(c.X,c.X);const w=e.createVertexBuffer(y,zt.members),S=c.aD.simpleSegment(0,0,4,2),I=new c.aE;I.emplaceBack(1,0,2),I.emplaceBack(1,2,3);const A=e.createIndexBuffer(I);return this._cachedMesh=new vs(w,A,S),this._cachedMesh}recalculate(){}hasTransition(){return!1}setErrorQueryLatitudeDegrees(e){}}function Pr(d,e){const r=c.ab(e.lat,-85.051129,c.aF);return new c.P(c.O(e.lng)*d,c.Q(r)*d)}function qr(d,e){return new c.Y(e.x/d,e.y/d).toLngLat()}function _r(d){return d.cameraToCenterDistance*Math.min(.85*Math.tan(c.aa(90-d.pitch)),Math.tan(c.aa(89.25-d.pitch)))}function Ul(d,e){const r=d.canonical,o=e/c.aG(r.z),u=r.x+Math.pow(2,r.z)*d.wrap,f=c.aq(new Float64Array(16));return c.J(f,f,[u*o,r.y*o,0]),c.K(f,f,[o/c.X,o/c.X,1]),f}function pi(d,e,r,o,u){const f=c.Y.fromLngLat(d,e),y=u*c.aH(1,d.lat),w=y*Math.cos(c.aa(r)),S=Math.sqrt(y*y-w*w),I=S*Math.sin(c.aa(-o)),A=S*Math.cos(c.aa(-o));return new c.Y(f.x+I,f.y+A,f.z+w)}class di{constructor(e=0,r=0,o=0,u=0){if(isNaN(e)||e<0||isNaN(r)||r<0||isNaN(o)||o<0||isNaN(u)||u<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=r,this.left=o,this.right=u}interpolate(e,r,o){return r.top!=null&&e.top!=null&&(this.top=c.y.number(e.top,r.top,o)),r.bottom!=null&&e.bottom!=null&&(this.bottom=c.y.number(e.bottom,r.bottom,o)),r.left!=null&&e.left!=null&&(this.left=c.y.number(e.left,r.left,o)),r.right!=null&&e.right!=null&&(this.right=c.y.number(e.right,r.right,o)),this}getCenter(e,r){const o=c.ab((this.left+e-this.right)/2,0,e),u=c.ab((this.top+r-this.bottom)/2,0,r);return new c.P(o,u)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new di(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function fi(d,e){if(!d.renderWorldCopies||d.lngRange)return;const r=e.lng-d.center.lng;e.lng+=r>180?-360:r<-180?360:0}function Zl(d){return Math.max(0,Math.floor(d))}class fn{constructor(e,r,o,u,f,y){this._callbacks=e,this._tileSize=512,this._renderWorldCopies=y===void 0||!!y,this._minZoom=r||0,this._maxZoom=o||22,this._minPitch=u??0,this._maxPitch=f??60,this.setMaxBounds(),this._width=0,this._height=0,this._center=new c.N(0,0),this._elevation=0,this._zoom=0,this._tileZoom=Zl(this._zoom),this._scale=c.aG(this._zoom),this._bearingInRadians=0,this._fovInRadians=.6435011087932844,this._pitchInRadians=0,this._rollInRadians=0,this._unmodified=!0,this._edgeInsets=new di,this._minElevationForCurrentTile=0,this._autoCalculateNearFarZ=!0}apply(e,r,o){this._latRange=e.latRange,this._lngRange=e.lngRange,this._width=e.width,this._height=e.height,this._center=e.center,this._elevation=e.elevation,this._minElevationForCurrentTile=e.minElevationForCurrentTile,this._zoom=e.zoom,this._tileZoom=Zl(this._zoom),this._scale=c.aG(this._zoom),this._bearingInRadians=e.bearingInRadians,this._fovInRadians=e.fovInRadians,this._pitchInRadians=e.pitchInRadians,this._rollInRadians=e.rollInRadians,this._unmodified=e.unmodified,this._edgeInsets=new di(e.padding.top,e.padding.bottom,e.padding.left,e.padding.right),this._minZoom=e.minZoom,this._maxZoom=e.maxZoom,this._minPitch=e.minPitch,this._maxPitch=e.maxPitch,this._renderWorldCopies=e.renderWorldCopies,this._cameraToCenterDistance=e.cameraToCenterDistance,this._nearZ=e.nearZ,this._farZ=e.farZ,this._autoCalculateNearFarZ=!o&&e.autoCalculateNearFarZ,r&&this._constrain(),this._calcMatrices()}get pixelsToClipSpaceMatrix(){return this._pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._clipSpaceToPixelsMatrix}get minElevationForCurrentTile(){return this._minElevationForCurrentTile}setMinElevationForCurrentTile(e){this._minElevationForCurrentTile=e}get tileSize(){return this._tileSize}get tileZoom(){return this._tileZoom}get scale(){return this._scale}get width(){return this._width}get height(){return this._height}get bearingInRadians(){return this._bearingInRadians}get lngRange(){return this._lngRange}get latRange(){return this._latRange}get pixelsToGLUnits(){return this._pixelsToGLUnits}get minZoom(){return this._minZoom}setMinZoom(e){this._minZoom!==e&&(this._minZoom=e,this.setZoom(this.getConstrained(this._center,this.zoom).zoom))}get maxZoom(){return this._maxZoom}setMaxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.setZoom(this.getConstrained(this._center,this.zoom).zoom))}get minPitch(){return this._minPitch}setMinPitch(e){this._minPitch!==e&&(this._minPitch=e,this.setPitch(Math.max(this.pitch,e)))}get maxPitch(){return this._maxPitch}setMaxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.setPitch(Math.min(this.pitch,e)))}get renderWorldCopies(){return this._renderWorldCopies}setRenderWorldCopies(e){e===void 0?e=!0:e===null&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this._tileSize*this._scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new c.P(this._width,this._height)}get bearing(){return this._bearingInRadians/Math.PI*180}setBearing(e){const r=c.aI(e,-180,180)*Math.PI/180;var o,u,f,y,w,S,I,A,k;this._bearingInRadians!==r&&(this._unmodified=!1,this._bearingInRadians=r,this._calcMatrices(),this._rotationMatrix=q(),o=this._rotationMatrix,f=-this._bearingInRadians,y=(u=this._rotationMatrix)[0],w=u[1],S=u[2],I=u[3],A=Math.sin(f),k=Math.cos(f),o[0]=y*k+S*A,o[1]=w*k+I*A,o[2]=y*-A+S*k,o[3]=w*-A+I*k)}get rotationMatrix(){return this._rotationMatrix}get pitchInRadians(){return this._pitchInRadians}get pitch(){return this._pitchInRadians/Math.PI*180}setPitch(e){const r=c.ab(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitchInRadians!==r&&(this._unmodified=!1,this._pitchInRadians=r,this._calcMatrices())}get rollInRadians(){return this._rollInRadians}get roll(){return this._rollInRadians/Math.PI*180}setRoll(e){const r=e/180*Math.PI;this._rollInRadians!==r&&(this._unmodified=!1,this._rollInRadians=r,this._calcMatrices())}get fovInRadians(){return this._fovInRadians}get fov(){return c.aJ(this._fovInRadians)}setFov(e){e=c.ab(e,.1,150),this.fov!==e&&(this._unmodified=!1,this._fovInRadians=c.aa(e),this._calcMatrices())}get zoom(){return this._zoom}setZoom(e){const r=this.getConstrained(this._center,e).zoom;this._zoom!==r&&(this._unmodified=!1,this._zoom=r,this._tileZoom=Math.max(0,Math.floor(r)),this._scale=c.aG(r),this._constrain(),this._calcMatrices())}get center(){return this._center}setCenter(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}setElevation(e){e!==this._elevation&&(this._elevation=e,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}setPadding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this._width,this._height)}get pixelsPerMeter(){return this._pixelPerMeter}get unmodified(){return this._unmodified}get cameraToCenterDistance(){return this._cameraToCenterDistance}get nearZ(){return this._nearZ}get farZ(){return this._farZ}get autoCalculateNearFarZ(){return this._autoCalculateNearFarZ}overrideNearFarZ(e,r){this._autoCalculateNearFarZ=!1,this._nearZ=e,this._farZ=r,this._calcMatrices()}clearNearFarZOverride(){this._autoCalculateNearFarZ=!0,this._calcMatrices()}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,r,o){this._unmodified=!1,this._edgeInsets.interpolate(e,r,o),this._constrain(),this._calcMatrices()}resize(e,r,o=!0){this._width=e,this._height=r,o&&this._constrain(),this._calcMatrices()}getMaxBounds(){return this._latRange&&this._latRange.length===2&&this._lngRange&&this._lngRange.length===2?new Me([this._lngRange[0],this._latRange[0]],[this._lngRange[1],this._latRange[1]]):null}setMaxBounds(e){e?(this._lngRange=[e.getWest(),e.getEast()],this._latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this._lngRange=null,this._latRange=[-85.051129,c.aF])}getConstrained(e,r){return this._callbacks.getConstrained(e,r)}getCameraQueryGeometry(e,r){if(r.length===1)return[r[0],e];{let o=e.x,u=e.y,f=e.x,y=e.y;for(const w of r)o=Math.min(o,w.x),u=Math.min(u,w.y),f=Math.max(f,w.x),y=Math.max(y,w.y);return[new c.P(o,u),new c.P(f,u),new c.P(f,y),new c.P(o,y),new c.P(o,u)]}}_constrain(){if(!this.center||!this._width||!this._height||this._constraining)return;this._constraining=!0;const e=this._unmodified,{center:r,zoom:o}=this.getConstrained(this.center,this.zoom);this.setCenter(r),this.setZoom(o),this._unmodified=e,this._constraining=!1}_calcMatrices(){if(this._width&&this._height){this._pixelsToGLUnits=[2/this._width,-2/this._height];let e=c.aq(new Float64Array(16));c.K(e,e,[this._width/2,-this._height/2,1]),c.J(e,e,[1,-1,0]),this._clipSpaceToPixelsMatrix=e,e=c.aq(new Float64Array(16)),c.K(e,e,[1,-1,1]),c.J(e,e,[-1,-1,0]),c.K(e,e,[2/this._width,2/this._height,1]),this._pixelsToClipSpaceMatrix=e,this._cameraToCenterDistance=.5/Math.tan(this.fovInRadians/2)*this._height}this._callbacks.calcMatrices()}calculateCenterFromCameraLngLatAlt(e,r,o,u){const f=o!==void 0?o:this.bearing,y=u=u!==void 0?u:this.pitch,w=c.Y.fromLngLat(e,r),S=-Math.cos(c.aa(y)),I=Math.sin(c.aa(y)),A=I*Math.sin(c.aa(f)),k=-I*Math.cos(c.aa(f));let R=this.elevation;const O=r-R;let V;S*O>=0||Math.abs(S)<.1?(V=1e4,R=r+V*S):V=-O/S;let X,W,K=c.aK(1,w.y),ee=0;do{if(ee+=1,ee>10)break;W=V/K,X=new c.Y(w.x+A*W,w.y+k*W),K=1/X.meterInMercatorCoordinateUnits()}while(Math.abs(V-W*K)>1e-12);return{center:X.toLngLat(),elevation:R,zoom:c.a8(this.height/2/Math.tan(this.fovInRadians/2)/W/this.tileSize)}}recalculateZoomAndCenter(e){if(this.elevation-e==0)return;const r=c.aH(1,this.center.lat)*this.worldSize,o=this.cameraToCenterDistance/r,u=c.Y.fromLngLat(this.center,this.elevation),f=pi(this.center,this.elevation,this.pitch,this.bearing,o);this._elevation=e;const y=this.calculateCenterFromCameraLngLatAlt(f.toLngLat(),c.aK(f.z,u.y),this.bearing,this.pitch);this._elevation=y.elevation,this._center=y.center,this.setZoom(y.zoom)}getCameraPoint(){const e=Math.tan(this.pitchInRadians)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new c.P(e*Math.sin(this.rollInRadians),e*Math.cos(this.rollInRadians)))}getCameraAltitude(){return Math.cos(this.pitchInRadians)*this._cameraToCenterDistance/this._pixelPerMeter+this.elevation}getCameraLngLat(){const e=c.aH(1,this.center.lat)*this.worldSize;return pi(this.center,this.elevation,this.pitch,this.bearing,this.cameraToCenterDistance/e).toLngLat()}getMercatorTileCoordinates(e){if(!e)return[0,0,1,1];const r=e.canonical.z>=0?1<<e.canonical.z:Math.pow(2,e.canonical.z);return[e.canonical.x/r,e.canonical.y/r,1/r/c.X,1/r/c.X]}}class ar{constructor(e,r){this.min=e,this.max=r,this.center=c.aL([],c.aM([],this.min,this.max),.5)}quadrant(e){const r=[e%2==0,e<2],o=c.aN(this.min),u=c.aN(this.max);for(let f=0;f<r.length;f++)o[f]=r[f]?this.min[f]:this.center[f],u[f]=r[f]?this.center[f]:this.max[f];return u[2]=this.max[2],new ar(o,u)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}intersectsFrustum(e){let r=!0;for(let o=0;o<e.planes.length;o++){const u=this.intersectsPlane(e.planes[o]);if(u===0)return 0;u===1&&(r=!1)}return r?2:e.aabb.min[0]>this.max[0]||e.aabb.min[1]>this.max[1]||e.aabb.min[2]>this.max[2]||e.aabb.max[0]<this.min[0]||e.aabb.max[1]<this.min[1]||e.aabb.max[2]<this.min[2]?0:1}intersectsPlane(e){let r=e[3],o=e[3];for(let u=0;u<3;u++)e[u]>0?(r+=e[u]*this.min[u],o+=e[u]*this.max[u]):(o+=e[u]*this.min[u],r+=e[u]*this.max[u]);return r>=0?2:o<0?0:1}}class Sa{distanceToTile2d(e,r,o,u){const f=u.distanceX([e,r]),y=u.distanceY([e,r]);return Math.hypot(f,y)}getWrap(e,r,o){return o}getTileAABB(e,r,o,u){var f,y;let w=o,S=o;if(u.terrain){const A=new c.S(e.z,r,e.z,e.x,e.y),k=u.terrain.getMinMaxElevation(A);w=(f=k.minElevation)!==null&&f!==void 0?f:o,S=(y=k.maxElevation)!==null&&y!==void 0?y:o}const I=1<<e.z;return new ar([r+e.x/I,e.y/I,w],[r+(e.x+1)/I,(e.y+1)/I,S])}allowVariableZoom(e,r){const o=e.fov*(Math.abs(Math.cos(e.rollInRadians))*e.height+Math.abs(Math.sin(e.rollInRadians))*e.width)/e.height,u=c.ab(78.5-o/2,0,60);return!!r.terrain||e.pitch>u||e.padding.top>=.1}allowWorldCopies(){return!0}recalculateCache(){}}class xs{constructor(e,r,o){this.points=e,this.planes=r,this.aabb=o}static fromInvProjectionMatrix(e,r=1,o=0){const u=Math.pow(2,o),f=[[-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(I=>{const A=1/(I=c.al([],I,e))[3]/r*u;return c.aO(I,I,[A,A,1/I[3],A])}),y=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(I=>{const A=c.aP([],f[I[0]],f[I[1]]),k=c.aP([],f[I[2]],f[I[1]]),R=c.aQ([],c.aR([],A,k)),O=-c.aS(R,f[I[1]]);return R.concat(O)}),w=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],S=[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];for(const I of f)for(let A=0;A<3;A++)w[A]=Math.min(w[A],I[A]),S[A]=Math.max(S[A],I[A]);return new xs(f,y,new ar(w,S))}}class Cs{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(e){this._helper.setMinZoom(e)}setMaxZoom(e){this._helper.setMaxZoom(e)}setMinPitch(e){this._helper.setMinPitch(e)}setMaxPitch(e){this._helper.setMaxPitch(e)}setRenderWorldCopies(e){this._helper.setRenderWorldCopies(e)}setBearing(e){this._helper.setBearing(e)}setPitch(e){this._helper.setPitch(e)}setRoll(e){this._helper.setRoll(e)}setFov(e){this._helper.setFov(e)}setZoom(e){this._helper.setZoom(e)}setCenter(e){this._helper.setCenter(e)}setElevation(e){this._helper.setElevation(e)}setMinElevationForCurrentTile(e){this._helper.setMinElevationForCurrentTile(e)}setPadding(e){this._helper.setPadding(e)}interpolatePadding(e,r,o){return this._helper.interpolatePadding(e,r,o)}isPaddingEqual(e){return this._helper.isPaddingEqual(e)}resize(e,r,o=!0){this._helper.resize(e,r,o)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(e){this._helper.setMaxBounds(e)}overrideNearFarZ(e,r){this._helper.overrideNearFarZ(e,r)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(e){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),e)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(e,r){}constructor(e,r,o,u,f){this._posMatrixCache=new Map,this._alignedPosMatrixCache=new Map,this._fogMatrixCacheF32=new Map,this._helper=new fn({calcMatrices:()=>{this._calcMatrices()},getConstrained:(y,w)=>this.getConstrained(y,w)},e,r,o,u,f),this._coveringTilesDetailsProvider=new Sa}clone(){const e=new Cs;return e.apply(this),e}apply(e,r,o){this._helper.apply(e,r,o)}get cameraPosition(){return this._cameraPosition}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._viewProjMatrix}get inverseProjectionMatrix(){return this._invProjMatrix}get mercatorMatrix(){return this._mercatorMatrix}getVisibleUnwrappedCoordinates(e){const r=[new c.aT(0,e)];if(this._helper._renderWorldCopies){const o=this.screenPointToMercatorCoordinate(new c.P(0,0)),u=this.screenPointToMercatorCoordinate(new c.P(this._helper._width,0)),f=this.screenPointToMercatorCoordinate(new c.P(this._helper._width,this._helper._height)),y=this.screenPointToMercatorCoordinate(new c.P(0,this._helper._height)),w=Math.floor(Math.min(o.x,u.x,f.x,y.x)),S=Math.floor(Math.max(o.x,u.x,f.x,y.x)),I=1;for(let A=w-I;A<=S+I;A++)A!==0&&r.push(new c.aT(A,e))}return r}getCameraFrustum(){return xs.fromInvProjectionMatrix(this._invViewProjMatrix,this.worldSize)}getClippingPlane(){return null}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(e){const r=this.screenPointToLocation(this.centerPoint,e),o=e?e.getElevationForLngLatZoom(r,this._helper._tileZoom):0;this._helper.recalculateZoomAndCenter(o)}setLocationAtPoint(e,r){const o=c.aH(this.elevation,this.center.lat),u=this.screenPointToMercatorCoordinateAtZ(r,o),f=this.screenPointToMercatorCoordinateAtZ(this.centerPoint,o),y=c.Y.fromLngLat(e),w=new c.Y(y.x-(u.x-f.x),y.y-(u.y-f.y));this.setCenter(w==null?void 0:w.toLngLat()),this._helper._renderWorldCopies&&this.setCenter(this.center.wrap())}locationToScreenPoint(e,r){return r?this.coordinatePoint(c.Y.fromLngLat(e),r.getElevationForLngLatZoom(e,this._helper._tileZoom),this._pixelMatrix3D):this.coordinatePoint(c.Y.fromLngLat(e))}screenPointToLocation(e,r){var o;return(o=this.screenPointToMercatorCoordinate(e,r))===null||o===void 0?void 0:o.toLngLat()}screenPointToMercatorCoordinate(e,r){if(r){const o=r.pointCoordinate(e);if(o!=null)return o}return this.screenPointToMercatorCoordinateAtZ(e)}screenPointToMercatorCoordinateAtZ(e,r){const o=r||0,u=[e.x,e.y,0,1],f=[e.x,e.y,1,1];c.al(u,u,this._pixelMatrixInverse),c.al(f,f,this._pixelMatrixInverse);const y=u[3],w=f[3],S=u[1]/y,I=f[1]/w,A=u[2]/y,k=f[2]/w,R=A===k?0:(o-A)/(k-A);return new c.Y(c.y.number(u[0]/y,f[0]/w,R)/this.worldSize,c.y.number(S,I,R)/this.worldSize,o)}coordinatePoint(e,r=0,o=this._pixelMatrix){const u=[e.x*this.worldSize,e.y*this.worldSize,r,1];return c.al(u,u,o),new c.P(u[0]/u[3],u[1]/u[3])}getBounds(){const e=Math.max(0,this._helper._height/2-_r(this));return new Me().extend(this.screenPointToLocation(new c.P(0,e))).extend(this.screenPointToLocation(new c.P(this._helper._width,e))).extend(this.screenPointToLocation(new c.P(this._helper._width,this._helper._height))).extend(this.screenPointToLocation(new c.P(0,this._helper._height)))}isPointOnMapSurface(e,r){return r?r.pointCoordinate(e)!=null:e.y>this.height/2-_r(this)}calculatePosMatrix(e,r=!1,o){var u;const f=(u=e.key)!==null&&u!==void 0?u:c.aU(e.wrap,e.canonical.z,e.canonical.z,e.canonical.x,e.canonical.y),y=r?this._alignedPosMatrixCache:this._posMatrixCache;if(y.has(f)){const I=y.get(f);return o?I.f32:I.f64}const w=Ul(e,this.worldSize);c.L(w,r?this._alignedProjMatrix:this._viewProjMatrix,w);const S={f64:w,f32:new Float32Array(w)};return y.set(f,S),o?S.f32:S.f64}calculateFogMatrix(e){const r=e.key,o=this._fogMatrixCacheF32;if(o.has(r))return o.get(r);const u=Ul(e,this.worldSize);return c.L(u,this._fogMatrix,u),o.set(r,new Float32Array(u)),o.get(r)}getConstrained(e,r){r=c.ab(+r,this.minZoom,this.maxZoom);const o={center:new c.N(e.lng,e.lat),zoom:r};let u=this._helper._lngRange;this._helper._renderWorldCopies||u!==null||(u=[-179.9999999999,180-1e-10]);const f=this.tileSize*c.aG(o.zoom);let y=0,w=f,S=0,I=f,A=0,k=0;const{x:R,y:O}=this.size;if(this._helper._latRange){const se=this._helper._latRange;y=c.Q(se[1])*f,w=c.Q(se[0])*f,w-y<O&&(A=O/(w-y))}u&&(S=c.aI(c.O(u[0])*f,0,f),I=c.aI(c.O(u[1])*f,0,f),I<S&&(I+=f),I-S<R&&(k=R/(I-S)));const{x:V,y:X}=Pr(f,e);let W,K;const ee=Math.max(k||0,A||0);if(ee){const se=new c.P(k?(I+S)/2:V,A?(w+y)/2:X);return o.center=qr(f,se).wrap(),o.zoom+=c.a8(ee),o}if(this._helper._latRange){const se=O/2;X-se<y&&(K=y+se),X+se>w&&(K=w-se)}if(u){const se=(S+I)/2;let oe=V;this._helper._renderWorldCopies&&(oe=c.aI(V,se-f/2,se+f/2));const le=R/2;oe-le<S&&(W=S+le),oe+le>I&&(W=I-le)}if(W!==void 0||K!==void 0){const se=new c.P(W??V,K??X);o.center=qr(f,se).wrap()}return o}calculateCenterFromCameraLngLatAlt(e,r,o,u){return this._helper.calculateCenterFromCameraLngLatAlt(e,r,o,u)}_calculateNearFarZIfNeeded(e,r,o){if(!this._helper.autoCalculateNearFarZ)return;const u=Math.min(this.elevation,this.minElevationForCurrentTile,this.getCameraAltitude()-100),f=e-u*this._helper._pixelPerMeter/Math.cos(r),y=u<0?f:e,w=Math.PI/2+this.pitchInRadians,S=c.aa(this.fov)*(Math.abs(Math.cos(c.aa(this.roll)))*this.height+Math.abs(Math.sin(c.aa(this.roll)))*this.width)/this.height*(.5+o.y/this.height),I=Math.sin(S)*y/Math.sin(c.ab(Math.PI-w-S,.01,Math.PI-.01)),A=_r(this),k=Math.atan(A/this._helper.cameraToCenterDistance),R=c.aa(.75),O=k>R?2*k*(.5+o.y/(2*A)):R,V=Math.sin(O)*y/Math.sin(c.ab(Math.PI-w-O,.01,Math.PI-.01)),X=Math.min(I,V);this._helper._farZ=1.01*(Math.cos(Math.PI/2-r)*X+y),this._helper._nearZ=this._helper._height/50}_calcMatrices(){if(!this._helper._height)return;const e=this.centerOffset,r=Pr(this.worldSize,this.center),o=r.x,u=r.y;this._helper._pixelPerMeter=c.aH(1,this.center.lat)*this.worldSize;const f=c.aa(Math.min(this.pitch,89.25)),y=Math.max(this._helper.cameraToCenterDistance/2,this._helper.cameraToCenterDistance+this._helper._elevation*this._helper._pixelPerMeter/Math.cos(f));let w;this._calculateNearFarZIfNeeded(y,f,e),w=new Float64Array(16),c.aV(w,this.fovInRadians,this._helper._width/this._helper._height,this._helper._nearZ,this._helper._farZ),this._invProjMatrix=new Float64Array(16),c.an(this._invProjMatrix,w),w[8]=2*-e.x/this._helper._width,w[9]=2*e.y/this._helper._height,this._projectionMatrix=c.aW(w),c.K(w,w,[1,-1,1]),c.J(w,w,[0,0,-this._helper.cameraToCenterDistance]),c.aX(w,w,-this.rollInRadians),c.aY(w,w,this.pitchInRadians),c.aX(w,w,-this.bearingInRadians),c.J(w,w,[-o,-u,0]),this._mercatorMatrix=c.K([],w,[this.worldSize,this.worldSize,this.worldSize]),c.K(w,w,[1,1,this._helper._pixelPerMeter]),this._pixelMatrix=c.L(new Float64Array(16),this.clipSpaceToPixelsMatrix,w),c.J(w,w,[0,0,-this.elevation]),this._viewProjMatrix=w,this._invViewProjMatrix=c.an([],w);const S=[0,0,-1,1];c.al(S,S,this._invViewProjMatrix),this._cameraPosition=[S[0]/S[3],S[1]/S[3],S[2]/S[3]],this._fogMatrix=new Float64Array(16),c.aV(this._fogMatrix,this.fovInRadians,this.width/this.height,y,this._helper._farZ),this._fogMatrix[8]=2*-e.x/this.width,this._fogMatrix[9]=2*e.y/this.height,c.K(this._fogMatrix,this._fogMatrix,[1,-1,1]),c.J(this._fogMatrix,this._fogMatrix,[0,0,-this.cameraToCenterDistance]),c.aX(this._fogMatrix,this._fogMatrix,-this.rollInRadians),c.aY(this._fogMatrix,this._fogMatrix,this.pitchInRadians),c.aX(this._fogMatrix,this._fogMatrix,-this.bearingInRadians),c.J(this._fogMatrix,this._fogMatrix,[-o,-u,0]),c.K(this._fogMatrix,this._fogMatrix,[1,1,this._helper._pixelPerMeter]),c.J(this._fogMatrix,this._fogMatrix,[0,0,-this.elevation]),this._pixelMatrix3D=c.L(new Float64Array(16),this.clipSpaceToPixelsMatrix,w);const I=this._helper._width%2/2,A=this._helper._height%2/2,k=Math.cos(this.bearingInRadians),R=Math.sin(-this.bearingInRadians),O=o-Math.round(o)+k*I+R*A,V=u-Math.round(u)+k*A+R*I,X=new Float64Array(w);if(c.J(X,X,[O>.5?O-1:O,V>.5?V-1:V,0]),this._alignedProjMatrix=X,w=c.an(new Float64Array(16),this._pixelMatrix),!w)throw new Error("failed to invert matrix");this._pixelMatrixInverse=w,this._clearMatrixCaches()}_clearMatrixCaches(){this._posMatrixCache.clear(),this._alignedPosMatrixCache.clear(),this._fogMatrixCacheF32.clear()}maxPitchScaleFactor(){if(!this._pixelMatrixInverse)return 1;const e=this.screenPointToMercatorCoordinate(new c.P(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return c.al(r,r,this._pixelMatrix)[3]/this._helper.cameraToCenterDistance}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){const e=c.aH(1,this.center.lat)*this.worldSize;return pi(this.center,this.elevation,this.pitch,this.bearing,this._helper.cameraToCenterDistance/e).toLngLat()}lngLatToCameraDepth(e,r){const o=c.Y.fromLngLat(e),u=[o.x*this.worldSize,o.y*this.worldSize,r,1];return c.al(u,u,this._viewProjMatrix),u[2]/u[3]}getProjectionData(e){const{overscaledTileID:r,aligned:o,applyTerrainMatrix:u}=e,f=this._helper.getMercatorTileCoordinates(r),y=r?this.calculatePosMatrix(r,o,!0):null;let w;return w=r&&r.terrainRttPosMatrix32f&&u?r.terrainRttPosMatrix32f:y||c.aZ(),{mainMatrix:w,tileMercatorCoords:f,clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:w}}isLocationOccluded(e){return!1}getPixelScale(){return 1}getCircleRadiusCorrection(){return 1}getPitchedTextCorrection(e,r,o){return 1}transformLightDirection(e){return c.aN(e)}getRayDirectionFromPixel(e){throw new Error("Not implemented.")}projectTileCoordinates(e,r,o,u){const f=this.calculatePosMatrix(o);let y;u?(y=[e,r,u(e,r),1],c.al(y,y,f)):(y=[e,r,0,1],Nr(y,y,f));const w=y[3];return{point:new c.P(y[0]/w,y[1]/w),signedDistanceFromCamera:w,isOccluded:!1}}populateCache(e){for(const r of e)this.calculatePosMatrix(r)}getMatrixForModel(e,r){const o=c.Y.fromLngLat(e,r),u=o.meterInMercatorCoordinateUnits(),f=c.a_();return c.J(f,f,[o.x,o.y,o.z]),c.aX(f,f,Math.PI),c.aY(f,f,Math.PI/2),c.K(f,f,[-u,u,u]),f}getProjectionDataForCustomLayer(e=!0){const r=new c.S(0,0,0,0,0),o=this.getProjectionData({overscaledTileID:r,applyGlobeMatrix:e}),u=Ul(r,this.worldSize);c.L(u,this._viewProjMatrix,u),o.tileMercatorCoords=[0,0,1,1];const f=[c.X,c.X,this.worldSize/this._helper.pixelsPerMeter],y=c.a$();return c.K(y,u,f),o.fallbackMatrix=y,o.mainMatrix=y,o}getFastPathSimpleProjectionMatrix(e){return this.calculatePosMatrix(e)}}function Yi(){c.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}function ql(d){if(d.useSlerp)if(d.k<1){const e=c.b0(d.startEulerAngles.roll,d.startEulerAngles.pitch,d.startEulerAngles.bearing),r=c.b0(d.endEulerAngles.roll,d.endEulerAngles.pitch,d.endEulerAngles.bearing),o=new Float64Array(4);c.b1(o,e,r,d.k);const u=c.b2(o);d.tr.setRoll(u.roll),d.tr.setPitch(u.pitch),d.tr.setBearing(u.bearing)}else d.tr.setRoll(d.endEulerAngles.roll),d.tr.setPitch(d.endEulerAngles.pitch),d.tr.setBearing(d.endEulerAngles.bearing);else d.tr.setRoll(c.y.number(d.startEulerAngles.roll,d.endEulerAngles.roll,d.k)),d.tr.setPitch(c.y.number(d.startEulerAngles.pitch,d.endEulerAngles.pitch,d.k)),d.tr.setBearing(c.y.number(d.startEulerAngles.bearing,d.endEulerAngles.bearing,d.k))}function Es(d,e,r,o,u){const f=u.padding,y=Pr(u.worldSize,r.getNorthWest()),w=Pr(u.worldSize,r.getNorthEast()),S=Pr(u.worldSize,r.getSouthEast()),I=Pr(u.worldSize,r.getSouthWest()),A=c.aa(-o),k=y.rotate(A),R=w.rotate(A),O=S.rotate(A),V=I.rotate(A),X=new c.P(Math.max(k.x,R.x,V.x,O.x),Math.max(k.y,R.y,V.y,O.y)),W=new c.P(Math.min(k.x,R.x,V.x,O.x),Math.min(k.y,R.y,V.y,O.y)),K=X.sub(W),ee=(u.width-(f.left+f.right+e.left+e.right))/K.x,se=(u.height-(f.top+f.bottom+e.top+e.bottom))/K.y;if(se<0||ee<0)return void Yi();const oe=Math.min(c.a8(u.scale*Math.min(ee,se)),d.maxZoom),le=c.P.convert(d.offset),he=new c.P((e.left-e.right)/2,(e.top-e.bottom)/2).rotate(c.aa(o)),ue=le.add(he).mult(u.scale/c.aG(oe));return{center:qr(u.worldSize,y.add(S).div(2).sub(ue)),zoom:oe,bearing:o}}class wo{get useGlobeControls(){return!1}handlePanInertia(e,r){return{easingOffset:e,easingCenter:r.center}}handleMapControlsRollPitchBearingZoom(e,r){e.bearingDelta&&r.setBearing(r.bearing+e.bearingDelta),e.pitchDelta&&r.setPitch(r.pitch+e.pitchDelta),e.rollDelta&&r.setRoll(r.roll+e.rollDelta),e.zoomDelta&&r.setZoom(r.zoom+e.zoomDelta)}handleMapControlsPan(e,r,o){e.around.distSqr(r.centerPoint)<.01||r.setLocationAtPoint(o,e.around)}cameraForBoxAndBearing(e,r,o,u,f){return Es(e,r,o,u,f)}handleJumpToCenterZoom(e,r){e.zoom!==(r.zoom!==void 0?+r.zoom:e.zoom)&&e.setZoom(+r.zoom),r.center!==void 0&&e.setCenter(c.N.convert(r.center))}handleEaseTo(e,r){const o=e.zoom,u=e.padding,f={roll:e.roll,pitch:e.pitch,bearing:e.bearing},y={roll:r.roll===void 0?e.roll:r.roll,pitch:r.pitch===void 0?e.pitch:r.pitch,bearing:r.bearing===void 0?e.bearing:r.bearing},w=r.zoom!==void 0,S=!e.isPaddingEqual(r.padding);let I=!1;const A=w?+r.zoom:e.zoom;let k=e.centerPoint.add(r.offsetAsPoint);const R=e.screenPointToLocation(k),{center:O,zoom:V}=e.getConstrained(c.N.convert(r.center||R),A??o);fi(e,O);const X=Pr(e.worldSize,R),W=Pr(e.worldSize,O).sub(X),K=c.aG(V-o);return I=V!==o,{easeFunc:ee=>{if(I&&e.setZoom(c.y.number(o,V,ee)),c.b3(f,y)||ql({startEulerAngles:f,endEulerAngles:y,tr:e,k:ee,useSlerp:f.roll!=y.roll}),S&&(e.interpolatePadding(u,r.padding,ee),k=e.centerPoint.add(r.offsetAsPoint)),r.around)e.setLocationAtPoint(r.around,r.aroundPoint);else{const se=c.aG(e.zoom-o),oe=V>o?Math.min(2,K):Math.max(.5,K),le=Math.pow(oe,1-ee),he=qr(e.worldSize,X.add(W.mult(ee*le)).mult(se));e.setLocationAtPoint(e.renderWorldCopies?he.wrap():he,k)}},isZooming:I,elevationCenter:O}}handleFlyTo(e,r){const o=r.zoom!==void 0,u=e.zoom,f=e.getConstrained(c.N.convert(r.center||r.locationAtOffset),o?+r.zoom:u),y=f.center,w=f.zoom;fi(e,y);const S=Pr(e.worldSize,r.locationAtOffset),I=Pr(e.worldSize,y).sub(S),A=I.mag(),k=c.aG(w-u);let R;if(r.minZoom!==void 0){const O=Math.min(+r.minZoom,u,w),V=e.getConstrained(y,O).zoom;R=c.aG(V-u)}return{easeFunc:(O,V,X,W)=>{e.setZoom(O===1?w:u+c.a8(V));const K=O===1?y:qr(e.worldSize,S.add(I.mult(X)).mult(V));e.setLocationAtPoint(e.renderWorldCopies?K.wrap():K,W)},scaleOfZoom:k,targetCenter:y,scaleOfMinZoom:R,pixelPathLength:A}}}class or{constructor(e,r,o){this.blendFunction=e,this.blendColor=r,this.mask=o}}or.Replace=[1,0],or.disabled=new or(or.Replace,c.b4.transparent,[!1,!1,!1,!1]),or.unblended=new or(or.Replace,c.b4.transparent,[!0,!0,!0,!0]),or.alphaBlended=new or([1,771],c.b4.transparent,[!0,!0,!0,!0]);const Vn=2305;class Vt{constructor(e,r,o){this.enable=e,this.mode=r,this.frontFace=o}}Vt.disabled=new Vt(!1,1029,Vn),Vt.backCCW=new Vt(!0,1029,Vn),Vt.frontCCW=new Vt(!0,1028,Vn);class wt{constructor(e,r,o){this.func=e,this.mask=r,this.range=o}}wt.ReadOnly=!1,wt.ReadWrite=!0,wt.disabled=new wt(519,wt.ReadOnly,[0,1]);const Ma=7680;class Ut{constructor(e,r,o,u,f,y){this.test=e,this.ref=r,this.mask=o,this.fail=u,this.depthFail=f,this.pass=y}}Ut.disabled=new Ut({func:519,mask:0},0,0,Ma,Ma,Ma);const $n=new WeakMap;function ls(d){var e;if($n.has(d))return $n.get(d);{const r=(e=d.getParameter(d.VERSION))===null||e===void 0?void 0:e.startsWith("WebGL 2.0");return $n.set(d,r),r}}class Pa{get awaitingQuery(){return!!this._readbackQueue}constructor(e){this._readbackWaitFrames=4,this._measureWaitFrames=6,this._texWidth=1,this._texHeight=1,this._measuredError=0,this._updateCount=0,this._lastReadbackFrame=-1e3,this._readbackQueue=null,this._cachedRenderContext=e;const r=e.context,o=r.gl;this._texFormat=o.RGBA,this._texType=o.UNSIGNED_BYTE;const u=new c.aC;u.emplaceBack(-1,-1),u.emplaceBack(2,-1),u.emplaceBack(-1,2);const f=new c.aE;f.emplaceBack(0,1,2),this._fullscreenTriangle=new vs(r.createVertexBuffer(u,zt.members),r.createIndexBuffer(f),c.aD.simpleSegment(0,0,u.length,f.length)),this._resultBuffer=new Uint8Array(4),r.activeTexture.set(o.TEXTURE1);const y=o.createTexture();o.bindTexture(o.TEXTURE_2D,y),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.NEAREST),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.NEAREST),o.texImage2D(o.TEXTURE_2D,0,this._texFormat,this._texWidth,this._texHeight,0,this._texFormat,this._texType,null),this._fbo=r.createFramebuffer(this._texWidth,this._texHeight,!1,!1),this._fbo.colorAttachment.set(y),ls(o)&&(this._pbo=o.createBuffer(),o.bindBuffer(o.PIXEL_PACK_BUFFER,this._pbo),o.bufferData(o.PIXEL_PACK_BUFFER,4,o.STREAM_READ),o.bindBuffer(o.PIXEL_PACK_BUFFER,null))}destroy(){const e=this._cachedRenderContext.context.gl;this._fullscreenTriangle.destroy(),this._fbo.destroy(),e.deleteBuffer(this._pbo),this._fullscreenTriangle=null,this._fbo=null,this._pbo=null,this._resultBuffer=null}updateErrorLoop(e,r){const o=this._updateCount;return this._readbackQueue?o>=this._readbackQueue.frameNumberIssued+this._readbackWaitFrames&&this._tryReadback():o>=this._lastReadbackFrame+this._measureWaitFrames&&this._renderErrorTexture(e,r),this._updateCount++,this._measuredError}_bindFramebuffer(){const e=this._cachedRenderContext.context,r=e.gl;e.activeTexture.set(r.TEXTURE1),r.bindTexture(r.TEXTURE_2D,this._fbo.colorAttachment.get()),e.bindFramebuffer.set(this._fbo.framebuffer)}_renderErrorTexture(e,r){const o=this._cachedRenderContext.context,u=o.gl;if(this._bindFramebuffer(),o.viewport.set([0,0,this._texWidth,this._texHeight]),o.clear({color:c.b4.transparent}),this._cachedRenderContext.useProgram("projectionErrorMeasurement").draw(o,u.TRIANGLES,wt.disabled,Ut.disabled,or.unblended,Vt.disabled,((f,y)=>({u_input:f,u_output_expected:y}))(e,r),null,null,"$clipping",this._fullscreenTriangle.vertexBuffer,this._fullscreenTriangle.indexBuffer,this._fullscreenTriangle.segments),this._pbo&&ls(u)){u.bindBuffer(u.PIXEL_PACK_BUFFER,this._pbo),u.readBuffer(u.COLOR_ATTACHMENT0),u.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,0),u.bindBuffer(u.PIXEL_PACK_BUFFER,null);const f=u.fenceSync(u.SYNC_GPU_COMMANDS_COMPLETE,0);u.flush(),this._readbackQueue={frameNumberIssued:this._updateCount,sync:f}}else this._readbackQueue={frameNumberIssued:this._updateCount,sync:null}}_tryReadback(){const e=this._cachedRenderContext.context.gl;if(this._pbo&&this._readbackQueue&&ls(e)){const r=e.clientWaitSync(this._readbackQueue.sync,0,0);if(r===e.WAIT_FAILED)return c.w("WebGL2 clientWaitSync failed."),this._readbackQueue=null,void(this._lastReadbackFrame=this._updateCount);if(r===e.TIMEOUT_EXPIRED)return;e.bindBuffer(e.PIXEL_PACK_BUFFER,this._pbo),e.getBufferSubData(e.PIXEL_PACK_BUFFER,0,this._resultBuffer,0,4),e.bindBuffer(e.PIXEL_PACK_BUFFER,null)}else this._bindFramebuffer(),e.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,this._resultBuffer);this._readbackQueue=null,this._measuredError=Pa._parseRGBA8float(this._resultBuffer),this._lastReadbackFrame=this._updateCount}static _parseRGBA8float(e){let r=0;return r+=e[0]/256,r+=e[1]/65536,r+=e[2]/16777216,e[3]<127&&(r=-r),r/128}}const Ia=c.X/128;function Ca(d,e){const r=d.granularity!==void 0?Math.max(d.granularity,1):1,o=r+(d.generateBorders?2:0),u=r+(d.extendToNorthPole||d.generateBorders?1:0)+(d.extendToSouthPole||d.generateBorders?1:0),f=o+1,y=u+1,w=d.generateBorders?-1:0,S=d.generateBorders||d.extendToNorthPole?-1:0,I=r+(d.generateBorders?1:0),A=r+(d.generateBorders||d.extendToSouthPole?1:0),k=f*y,R=o*u*6,O=f*y>65536;if(O&&e==="16bit")throw new Error("Granularity is too large and meshes would not fit inside 16 bit vertex indices.");const V=O||e==="32bit",X=new Int16Array(2*k);let W=0;for(let se=S;se<=A;se++)for(let oe=w;oe<=I;oe++){let le=oe/r*c.X;oe===-1&&(le=-64),oe===r+1&&(le=c.X+Ia);let he=se/r*c.X;se===-1&&(he=d.extendToNorthPole?c.b6:-64),se===r+1&&(he=d.extendToSouthPole?c.b7:c.X+Ia),X[W++]=le,X[W++]=he}const K=V?new Uint32Array(R):new Uint16Array(R);let ee=0;for(let se=0;se<u;se++)for(let oe=0;oe<o;oe++){const le=oe+1+se*f,he=oe+(se+1)*f,ue=oe+1+(se+1)*f;K[ee++]=oe+se*f,K[ee++]=he,K[ee++]=le,K[ee++]=le,K[ee++]=he,K[ee++]=ue}return{vertices:X.buffer.slice(0),indices:K.buffer.slice(0),uses32bitIndices:V}}const mn=new c.aB({fill:new c.b8(128,2),line:new c.b8(512,0),tile:new c.b8(128,32),stencil:new c.b8(128,1),circle:3});class Lu{constructor(){this._tileMeshCache={},this._errorCorrectionUsable=0,this._errorMeasurementLastValue=0,this._errorCorrectionPreviousValue=0,this._errorMeasurementLastChangeTime=-1e3}get name(){return"vertical-perspective"}get transitionState(){return 1}get useSubdivision(){return!0}get shaderVariantName(){return"globe"}get shaderDefine(){return"#define GLOBE"}get shaderPreludeCode(){return ys.projectionGlobe}get vertexShaderPreludeCode(){return ys.projectionMercator.vertexSource}get subdivisionGranularity(){return mn}get useGlobeControls(){return!0}get latitudeErrorCorrectionRadians(){return this._errorCorrectionUsable}destroy(){this._errorMeasurement&&this._errorMeasurement.destroy()}updateGPUdependent(e){this._errorMeasurement||(this._errorMeasurement=new Pa(e));const r=c.Q(this._errorQueryLatitudeDegrees),o=2*Math.atan(Math.exp(Math.PI-r*Math.PI*2))-.5*Math.PI,u=this._errorMeasurement.updateErrorLoop(r,o),f=ge.now();u!==this._errorMeasurementLastValue&&(this._errorCorrectionPreviousValue=this._errorCorrectionUsable,this._errorMeasurementLastValue=u,this._errorMeasurementLastChangeTime=f);const y=Math.min(Math.max((f-this._errorMeasurementLastChangeTime)/1e3/.5,0),1);this._errorCorrectionUsable=c.b9(this._errorCorrectionPreviousValue,-this._errorMeasurementLastValue,c.ba(y))}_getMeshKey(e){return`${e.granularity.toString(36)}_${e.generateBorders?"b":""}${e.extendToNorthPole?"n":""}${e.extendToSouthPole?"s":""}`}getMeshFromTileID(e,r,o,u,f){const y=(f==="stencil"?mn.stencil:mn.tile).getGranularityForZoomLevel(r.z);return this._getMesh(e,{granularity:y,generateBorders:o,extendToNorthPole:r.y===0&&u,extendToSouthPole:r.y===(1<<r.z)-1&&u})}_getMesh(e,r){const o=this._getMeshKey(r);if(o in this._tileMeshCache)return this._tileMeshCache[o];const u=function(f,y){const w=Ca(y,"16bit"),S=c.aC.deserialize({arrayBuffer:w.vertices,length:w.vertices.byteLength/2/2}),I=c.aE.deserialize({arrayBuffer:w.indices,length:w.indices.byteLength/2/3});return new vs(f.createVertexBuffer(S,zt.members),f.createIndexBuffer(I),c.aD.simpleSegment(0,0,S.length,I.length))}(e,r);return this._tileMeshCache[o]=u,u}recalculate(e){}hasTransition(){const e=ge.now();let r=!1;return r=r||(e-this._errorMeasurementLastChangeTime)/1e3<.7,r=r||this._errorMeasurement&&this._errorMeasurement.awaitingQuery,r}setErrorQueryLatitudeDegrees(e){this._errorQueryLatitudeDegrees=e}}const Gl=new c.q({type:new c.D(c.v.projection.type)});class Hl extends c.E{constructor(e){super(),this._transitionable=new c.T(Gl),this.setProjection(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new c.z(0)),this._mercatorProjection=new Ta,this._verticalPerspectiveProjection=new Lu}get transitionState(){const e=this.properties.get("type");if(typeof e=="string"&&e==="mercator")return 0;if(typeof e=="string"&&e==="vertical-perspective")return 1;if(e instanceof c.bb){if(e.from==="vertical-perspective"&&e.to==="mercator")return 1-e.transition;if(e.from==="mercator"&&e.to==="vertical-perspective")return e.transition}return 1}get useGlobeRendering(){return this.transitionState>0}get latitudeErrorCorrectionRadians(){return this._verticalPerspectiveProjection.latitudeErrorCorrectionRadians}get currentProjection(){return this.useGlobeRendering?this._verticalPerspectiveProjection:this._mercatorProjection}get name(){return"globe"}get useSubdivision(){return this.currentProjection.useSubdivision}get shaderVariantName(){return this.currentProjection.shaderVariantName}get shaderDefine(){return this.currentProjection.shaderDefine}get shaderPreludeCode(){return this.currentProjection.shaderPreludeCode}get vertexShaderPreludeCode(){return this.currentProjection.vertexShaderPreludeCode}get subdivisionGranularity(){return this.currentProjection.subdivisionGranularity}get useGlobeControls(){return this.transitionState>0}destroy(){this._mercatorProjection.destroy(),this._verticalPerspectiveProjection.destroy()}updateGPUdependent(e){this._mercatorProjection.updateGPUdependent(e),this._verticalPerspectiveProjection.updateGPUdependent(e)}getMeshFromTileID(e,r,o,u,f){return this.currentProjection.getMeshFromTileID(e,r,o,u,f)}setProjection(e){this._transitionable.setValue("type",(e==null?void 0:e.type)||"mercator")}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()||this.currentProjection.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}setErrorQueryLatitudeDegrees(e){this._verticalPerspectiveProjection.setErrorQueryLatitudeDegrees(e),this._mercatorProjection.setErrorQueryLatitudeDegrees(e)}}function Fu(d){const e=Un(d.worldSize,d.center.lat);return 2*Math.PI*e}function Ea(d,e,r,o,u){const f=1/(1<<u),y=e/c.X*f+o*f,w=c.bd((d/c.
vendor: 26,449 bytes, line 744
744X*f+r*f)*Math.PI*2+Math.PI,2*Math.PI),S=2*Math.atan(Math.exp(Math.PI-y*Math.PI*2))-.5*Math.PI,I=Math.cos(S),A=new Float64Array(3);return A[0]=Math.sin(w)*I,A[1]=Math.sin(S),A[2]=Math.cos(w)*I,A}function ir(d){return function(e,r){const o=Math.cos(r),u=new Float64Array(3);return u[0]=Math.sin(e)*o,u[1]=Math.sin(r),u[2]=Math.cos(e)*o,u}(d.lng*Math.PI/180,d.lat*Math.PI/180)}function Un(d,e){return d/(2*Math.PI)/Math.cos(e*Math.PI/180)}function cs(d){const e=Math.asin(d[1])/Math.PI*180,r=Math.sqrt(d[0]*d[0]+d[2]*d[2]);if(r>1e-6){const o=d[0]/r,u=Math.acos(d[2]/r),f=(o>0?u:-u)/Math.PI*180;return new c.N(c.aI(f,-180,180),e)}return new c.N(0,e)}function gn(d){return Math.cos(d*Math.PI/180)}function Gr(d,e){const r=gn(d),o=gn(e);return c.a8(o/r)}function Wl(d,e){const r=d.rotate(e.bearingInRadians),o=e.zoom+Gr(e.center.lat,0),u=c.b9(1/gn(e.center.lat),1/gn(Math.min(Math.abs(e.center.lat),60)),c.bc(o,7,3,0,1)),f=360/Fu({worldSize:e.worldSize,center:{lat:e.center.lat}});return new c.N(e.center.lng-r.x*f*u,c.ab(e.center.lat+r.y*f,-85.051129,c.aF))}function Zs(d){const e=.5*d,r=Math.sin(e),o=Math.cos(e);return Math.log(r+o)-Math.log(o-r)}function Bu(d,e,r,o){const u=d.lat+r*o;if(Math.abs(r)>1){const f=(Math.sign(d.lat+r)!==Math.sign(d.lat)?-Math.abs(d.lat):Math.abs(d.lat))*Math.PI/180,y=Math.abs(d.lat+r)*Math.PI/180,w=Zs(f+o*(y-f)),S=Zs(f),I=Zs(y);return new c.N(d.lng+e*((w-S)/(I-S)),u)}return new c.N(d.lng+e*o,u)}class Np{constructor(e){this._cachePrevious=new Map,this._cache=new Map,this._hadAnyChanges=!1,this._aabbFactory=e}recalculateCache(){if(!this._hadAnyChanges)return;const e=this._cachePrevious;this._cachePrevious=this._cache,this._cache=e,this._cache.clear(),this._hadAnyChanges=!1}getTileAABB(e,r,o,u){const f=`${e.z}_${e.x}_${e.y}`,y=this._cache.get(f);if(y)return y;const w=this._cachePrevious.get(f);if(w)return this._cache.set(f,w),w;const S=this._aabbFactory(e,r,o,u);return this._cache.set(f,S),this._hadAnyChanges=!0,S}}function To(d,e,r){const o=d-e;return o<0?-o:Math.max(0,o-r)}function Xl(d,e,r,o,u){const f=d-r;let y;return y=f<0?Math.min(-f,1+f-u):f>1?Math.min(Math.max(f-u,0),1-f):0,Math.max(y,To(e,o,u))}class jp{constructor(){this._aabbCache=new Np(this._computeTileAABB)}recalculateCache(){this._aabbCache.recalculateCache()}distanceToTile2d(e,r,o,u){const f=1<<o.z,y=1/f,w=o.x/f,S=o.y/f;let I=2;return I=Math.min(I,Xl(e,r,w,S,y)),I=Math.min(I,Xl(e,r,w+.5,-S-y,y)),I=Math.min(I,Xl(e,r,w+.5,2-S-y,y)),I}getWrap(e,r,o){const u=1<<r.z,f=1/u,y=r.x/u,w=To(e.x,y,f),S=To(e.x,y-1,f),I=To(e.x,y+1,f),A=Math.min(w,S,I);return A===I?1:A===S?-1:0}allowVariableZoom(e,r){return os(e,r)>4}allowWorldCopies(){return!1}getTileAABB(e,r,o,u){return this._aabbCache.getTileAABB(e,r,o,u)}_computeTileAABB(e,r,o,u){if(e.z<=0)return new ar([-1,-1,-1],[1,1,1]);if(e.z===1)return new ar([e.x===0?-1:0,e.y===0?0:-1,-1],[e.x===0?0:1,e.y===0?1:0,1]);{const f=[Ea(0,0,e.x,e.y,e.z),Ea(c.X,0,e.x,e.y,e.z),Ea(c.X,c.X,e.x,e.y,e.z),Ea(0,c.X,e.x,e.y,e.z)],y=[1,1,1],w=[-1,-1,-1];for(const S of f)for(let I=0;I<3;I++)y[I]=Math.min(y[I],S[I]),w[I]=Math.max(w[I],S[I]);if(e.y===0||e.y===(1<<e.z)-1){const S=[0,e.y===0?1:-1,0];for(let I=0;I<3;I++)y[I]=Math.min(y[I],S[I]),w[I]=Math.max(w[I],S[I])}return new ar(y,w)}}}class So{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(e){this._helper.setMinZoom(e)}setMaxZoom(e){this._helper.setMaxZoom(e)}setMinPitch(e){this._helper.setMinPitch(e)}setMaxPitch(e){this._helper.setMaxPitch(e)}setRenderWorldCopies(e){this._helper.setRenderWorldCopies(e)}setBearing(e){this._helper.setBearing(e)}setPitch(e){this._helper.setPitch(e)}setRoll(e){this._helper.setRoll(e)}setFov(e){this._helper.setFov(e)}setZoom(e){this._helper.setZoom(e)}setCenter(e){this._helper.setCenter(e)}setElevation(e){this._helper.setElevation(e)}setMinElevationForCurrentTile(e){this._helper.setMinElevationForCurrentTile(e)}setPadding(e){this._helper.setPadding(e)}interpolatePadding(e,r,o){return this._helper.interpolatePadding(e,r,o)}isPaddingEqual(e){return this._helper.isPaddingEqual(e)}resize(e,r){this._helper.resize(e,r)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(e){this._helper.setMaxBounds(e)}overrideNearFarZ(e,r){this._helper.overrideNearFarZ(e,r)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(e){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),e)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(e){}constructor(){this._cachedClippingPlane=c.be(),this._projectionMatrix=c.a_(),this._globeViewProjMatrix32f=c.aZ(),this._globeViewProjMatrixNoCorrection=c.a_(),this._globeViewProjMatrixNoCorrectionInverted=c.a_(),this._globeProjMatrixInverted=c.a_(),this._cameraPosition=c.bf(),this._globeLatitudeErrorCorrectionRadians=0,this._helper=new fn({calcMatrices:()=>{this._calcMatrices()},getConstrained:(e,r)=>this.getConstrained(e,r)}),this._coveringTilesDetailsProvider=new jp}clone(){const e=new So;return e.apply(this),e}apply(e,r){this._globeLatitudeErrorCorrectionRadians=r||0,this._helper.apply(e)}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._globeViewProjMatrixNoCorrection}get inverseProjectionMatrix(){return this._globeProjMatrixInverted}get cameraPosition(){const e=c.bf();return e[0]=this._cameraPosition[0],e[1]=this._cameraPosition[1],e[2]=this._cameraPosition[2],e}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}getProjectionData(e){const{overscaledTileID:r,applyGlobeMatrix:o}=e,u=this._helper.getMercatorTileCoordinates(r);return{mainMatrix:this._globeViewProjMatrix32f,tileMercatorCoords:u,clippingPlane:this._cachedClippingPlane,projectionTransition:o?1:0,fallbackMatrix:this._globeViewProjMatrix32f}}_computeClippingPlane(e){const r=this.pitchInRadians,o=this.cameraToCenterDistance/e,u=Math.sin(r)*o,f=Math.cos(r)*o+1,y=1/Math.sqrt(u*u+f*f)*1;let w=-u,S=f;const I=Math.sqrt(w*w+S*S);w/=I,S/=I;const A=[0,w,S];return c.bg(A,A,[0,0,0],-this.bearingInRadians),c.bh(A,A,[0,0,0],-1*this.center.lat*Math.PI/180),c.bi(A,A,[0,0,0],this.center.lng*Math.PI/180),c.aL(A,A,.25),[...A,.25*-y]}isLocationOccluded(e){return!this.isSurfacePointVisible(ir(e))}transformLightDirection(e){const r=this._helper._center.lng*Math.PI/180,o=this._helper._center.lat*Math.PI/180,u=Math.cos(o),f=[Math.sin(r)*u,Math.sin(o),Math.cos(r)*u],y=[f[2],0,-f[0]],w=[0,0,0];c.aR(w,y,f),c.aQ(y,y),c.aQ(w,w);const S=[0,0,0];return c.aQ(S,[y[0]*e[0]+w[0]*e[1]+f[0]*e[2],y[1]*e[0]+w[1]*e[1]+f[1]*e[2],y[2]*e[0]+w[2]*e[1]+f[2]*e[2]]),S}getPixelScale(){return 1/Math.cos(this._helper._center.lat*Math.PI/180)}getCircleRadiusCorrection(){return Math.cos(this._helper._center.lat*Math.PI/180)}getPitchedTextCorrection(e,r,o){const u=function(w,S,I){const A=1/(1<<I.z);return new c.Y(w/c.X*A+I.x*A,S/c.X*A+I.y*A)}(e,r,o.canonical),f=(y=u.y,[c.bd(u.x*Math.PI*2+Math.PI,2*Math.PI),2*Math.atan(Math.exp(Math.PI-y*Math.PI*2))-.5*Math.PI]);var y;return this.getCircleRadiusCorrection()/Math.cos(f[1])}projectTileCoordinates(e,r,o,u){const f=o.canonical,y=Ea(e,r,f.x,f.y,f.z),w=1+(u?u(e,r):0)/c.bo,S=[y[0]*w,y[1]*w,y[2]*w,1];c.al(S,S,this._globeViewProjMatrixNoCorrection);const I=this._cachedClippingPlane,A=I[0]*y[0]+I[1]*y[1]+I[2]*y[2]+I[3]<0;return{point:new c.P(S[0]/S[3],S[1]/S[3]),signedDistanceFromCamera:S[3],isOccluded:A}}_calcMatrices(){if(!this._helper._width||!this._helper._height)return;const e=Un(this.worldSize,this.center.lat),r=c.a$(),o=c.a$();this._helper.autoCalculateNearFarZ&&(this._helper._nearZ=.5,this._helper._farZ=this.cameraToCenterDistance+2*e),c.aV(r,this.fovInRadians,this.width/this.height,this._helper._nearZ,this._helper._farZ);const u=this.centerOffset;r[8]=2*-u.x/this._helper._width,r[9]=2*u.y/this._helper._height,this._projectionMatrix=c.aW(r),this._globeProjMatrixInverted=c.a$(),c.an(this._globeProjMatrixInverted,r),c.J(r,r,[0,0,-this.cameraToCenterDistance]),c.aX(r,r,this.rollInRadians),c.aY(r,r,-this.pitchInRadians),c.aX(r,r,this.bearingInRadians),c.J(r,r,[0,0,-e]);const f=c.bf();f[0]=e,f[1]=e,f[2]=e,c.aY(o,r,this.center.lat*Math.PI/180),c.bj(o,o,-this.center.lng*Math.PI/180),c.K(o,o,f),this._globeViewProjMatrixNoCorrection=o,c.aY(r,r,this.center.lat*Math.PI/180-this._globeLatitudeErrorCorrectionRadians),c.bj(r,r,-this.center.lng*Math.PI/180),c.K(r,r,f),this._globeViewProjMatrix32f=new Float32Array(r),this._globeViewProjMatrixNoCorrectionInverted=c.a$(),c.an(this._globeViewProjMatrixNoCorrectionInverted,o);const y=c.bf();this._cameraPosition=c.bf(),this._cameraPosition[2]=this.cameraToCenterDistance/e,c.bg(this._cameraPosition,this._cameraPosition,y,-this.rollInRadians),c.bh(this._cameraPosition,this._cameraPosition,y,this.pitchInRadians),c.bg(this._cameraPosition,this._cameraPosition,y,-this.bearingInRadians),c.aM(this._cameraPosition,this._cameraPosition,[0,0,1]),c.bh(this._cameraPosition,this._cameraPosition,y,-this.center.lat*Math.PI/180),c.bi(this._cameraPosition,this._cameraPosition,y,this.center.lng*Math.PI/180),this._cachedClippingPlane=this._computeClippingPlane(e);const w=c.aW(this._globeViewProjMatrixNoCorrectionInverted);c.K(w,w,[1,1,-1]),this._cachedFrustum=xs.fromInvProjectionMatrix(w)}calculateFogMatrix(e){c.w("calculateFogMatrix is not supported on globe projection.");const r=c.a$();return c.aq(r),r}getVisibleUnwrappedCoordinates(e){return[new c.aT(0,e)]}getCameraFrustum(){return this._cachedFrustum}getClippingPlane(){return this._cachedClippingPlane}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(e){e&&c.w("terrain is not fully supported on vertical perspective projection."),this._helper.recalculateZoomAndCenter(0)}maxPitchScaleFactor(){return 1}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(e,r){if(!this._globeViewProjMatrixNoCorrection)return 1;const o=ir(e);c.aL(o,o,1+r/c.bo);const u=c.be();return c.al(u,[o[0],o[1],o[2],1],this._globeViewProjMatrixNoCorrection),u[2]/u[3]}populateCache(e){}getBounds(){const e=.5*this.width,r=.5*this.height,o=[new c.P(0,0),new c.P(e,0),new c.P(this.width,0),new c.P(this.width,r),new c.P(this.width,this.height),new c.P(e,this.height),new c.P(0,this.height),new c.P(0,r)],u=[];for(const k of o)u.push(this.unprojectScreenPoint(k));let f=0,y=0,w=0,S=0;const I=this.center;for(const k of u){const R=c.bk(I.lng,k.lng),O=c.bk(I.lat,k.lat);R<y&&(y=R),R>f&&(f=R),O<S&&(S=O),O>w&&(w=O)}const A=[I.lng+y,I.lat+S,I.lng+f,I.lat+w];return this.isSurfacePointOnScreen([0,1,0])&&(A[3]=90,A[0]=-180,A[2]=180),this.isSurfacePointOnScreen([0,-1,0])&&(A[1]=-90,A[0]=-180,A[2]=180),new Me(A)}getConstrained(e,r){const o=c.ab(e.lat,-85.051129,c.aF),u=c.ab(+r,this.minZoom+Gr(0,o),this.maxZoom);return{center:new c.N(e.lng,o),zoom:u}}calculateCenterFromCameraLngLatAlt(e,r,o,u){return this._helper.calculateCenterFromCameraLngLatAlt(e,r,o,u)}setLocationAtPoint(e,r){const o=ir(this.unprojectScreenPoint(r)),u=ir(e),f=c.bf();c.bl(f);const y=c.bf();c.bi(y,o,f,-this.center.lng*Math.PI/180),c.bh(y,y,f,this.center.lat*Math.PI/180);const w=u[0]*u[0]+u[2]*u[2],S=y[0]*y[0];if(w<S)return;const I=Math.sqrt(w-S),A=-I,k=c.bm(u[0],u[2],y[0],I),R=c.bm(u[0],u[2],y[0],A),O=c.bf();c.bi(O,u,f,-k);const V=c.bm(O[1],O[2],y[1],y[2]),X=c.bf();c.bi(X,u,f,-R);const W=c.bm(X[1],X[2],y[1],y[2]),K=.5*Math.PI,ee=V>=-K&&V<=K,se=W>=-K&&W<=K;let oe,le;if(ee&&se){const be=this.center.lng*Math.PI/180,Ae=this.center.lat*Math.PI/180;c.bp(k,be)+c.bp(V,Ae)<c.bp(R,be)+c.bp(W,Ae)?(oe=k,le=V):(oe=R,le=W)}else if(ee)oe=k,le=V;else{if(!se)return;oe=R,le=W}const he=oe/Math.PI*180,ue=le/Math.PI*180,ve=this.center.lat;this.setCenter(new c.N(he,c.ab(ue,-90,90))),this.setZoom(this.zoom+Gr(ve,this.center.lat))}locationToScreenPoint(e,r){const o=ir(e);if(r){const u=r.getElevationForLngLatZoom(e,this._helper._tileZoom);c.aL(o,o,1+u/c.bo)}return this._projectSurfacePointToScreen(o)}_projectSurfacePointToScreen(e){const r=c.be();return c.al(r,[...e,1],this._globeViewProjMatrixNoCorrection),r[0]/=r[3],r[1]/=r[3],new c.P((.5*r[0]+.5)*this.width,(.5*-r[1]+.5)*this.height)}screenPointToMercatorCoordinate(e,r){if(r){const o=r.pointCoordinate(e);if(o)return o}return c.Y.fromLngLat(this.unprojectScreenPoint(e))}screenPointToLocation(e,r){var o;return(o=this.screenPointToMercatorCoordinate(e,r))===null||o===void 0?void 0:o.toLngLat()}isPointOnMapSurface(e,r){const o=this._cameraPosition,u=this.getRayDirectionFromPixel(e);return!!this.rayPlanetIntersection(o,u)}getRayDirectionFromPixel(e){const r=c.be();r[0]=e.x/this.width*2-1,r[1]=-1*(e.y/this.height*2-1),r[2]=1,r[3]=1,c.al(r,r,this._globeViewProjMatrixNoCorrectionInverted),r[0]/=r[3],r[1]/=r[3],r[2]/=r[3];const o=c.bf();o[0]=r[0]-this._cameraPosition[0],o[1]=r[1]-this._cameraPosition[1],o[2]=r[2]-this._cameraPosition[2];const u=c.bf();return c.aQ(u,o),u}isSurfacePointVisible(e){const r=this._cachedClippingPlane;return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]+r[3]>=0}isSurfacePointOnScreen(e){if(!this.isSurfacePointVisible(e))return!1;const r=c.be();return c.al(r,[...e,1],this._globeViewProjMatrixNoCorrection),r[0]/=r[3],r[1]/=r[3],r[2]/=r[3],r[0]>-1&&r[0]<1&&r[1]>-1&&r[1]<1&&r[2]>-1&&r[2]<1}rayPlanetIntersection(e,r){const o=c.aS(e,r),u=c.bf(),f=c.bf();c.aL(f,r,o),c.aP(u,e,f);const y=1-c.aS(u,u);if(y<0)return null;const w=c.aS(e,e)-1,S=-o+(o<0?1:-1)*Math.sqrt(y),I=w/S,A=S;return{tMin:Math.min(I,A),tMax:Math.max(I,A)}}unprojectScreenPoint(e){const r=this._cameraPosition,o=this.getRayDirectionFromPixel(e),u=this.rayPlanetIntersection(r,o);if(u){const I=c.bf();c.aM(I,r,[o[0]*u.tMin,o[1]*u.tMin,o[2]*u.tMin]);const A=c.bf();return c.aQ(A,I),cs(A)}const f=this._cachedClippingPlane[0]*o[0]+this._cachedClippingPlane[1]*o[1]+this._cachedClippingPlane[2]*o[2],y=-c.bn(this._cachedClippingPlane,r)/f,w=c.bf();if(y>0)c.aM(w,r,[o[0]*y,o[1]*y,o[2]*y]);else{const I=c.bf();c.aM(I,r,[2*o[0],2*o[1],2*o[2]]);const A=c.bn(this._cachedClippingPlane,I);c.aP(w,I,[this._cachedClippingPlane[0]*A,this._cachedClippingPlane[1]*A,this._cachedClippingPlane[2]*A])}const S=c.bf();return c.aQ(S,w),cs(S)}getMatrixForModel(e,r){const o=c.N.convert(e),u=1/c.bo,f=c.a_();return c.bj(f,f,o.lng/180*Math.PI),c.aY(f,f,-o.lat/180*Math.PI),c.J(f,f,[0,0,1+r/c.bo]),c.aY(f,f,.5*Math.PI),c.K(f,f,[u,u,u]),f}getProjectionDataForCustomLayer(e=!0){const r=this.getProjectionData({overscaledTileID:new c.S(0,0,0,0,0),applyGlobeMatrix:e});return r.tileMercatorCoords=[0,0,1,1],r}getFastPathSimpleProjectionMatrix(e){}}class _n{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(e){this._helper.setMinZoom(e)}setMaxZoom(e){this._helper.setMaxZoom(e)}setMinPitch(e){this._helper.setMinPitch(e)}setMaxPitch(e){this._helper.setMaxPitch(e)}setRenderWorldCopies(e){this._helper.setRenderWorldCopies(e)}setBearing(e){this._helper.setBearing(e)}setPitch(e){this._helper.setPitch(e)}setRoll(e){this._helper.setRoll(e)}setFov(e){this._helper.setFov(e)}setZoom(e){this._helper.setZoom(e)}setCenter(e){this._helper.setCenter(e)}setElevation(e){this._helper.setElevation(e)}setMinElevationForCurrentTile(e){this._helper.setMinElevationForCurrentTile(e)}setPadding(e){this._helper.setPadding(e)}interpolatePadding(e,r,o){return this._helper.interpolatePadding(e,r,o)}isPaddingEqual(e){return this._helper.isPaddingEqual(e)}resize(e,r,o=!0){this._helper.resize(e,r,o)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(e){this._helper.setMaxBounds(e)}overrideNearFarZ(e,r){this._helper.overrideNearFarZ(e,r)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(e){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),e)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}get isGlobeRendering(){return this._globeness>0}setTransitionState(e,r){this._globeness=e,this._globeLatitudeErrorCorrectionRadians=r,this._calcMatrices(),this._verticalPerspectiveTransform.getCoveringTilesDetailsProvider().recalculateCache(),this._mercatorTransform.getCoveringTilesDetailsProvider().recalculateCache()}get currentTransform(){return this.isGlobeRendering?this._verticalPerspectiveTransform:this._mercatorTransform}constructor(){this._globeLatitudeErrorCorrectionRadians=0,this._globeness=1,this._helper=new fn({calcMatrices:()=>{this._calcMatrices()},getConstrained:(e,r)=>this.getConstrained(e,r)}),this._globeness=1,this._mercatorTransform=new Cs,this._verticalPerspectiveTransform=new So}clone(){const e=new _n;return e._globeness=this._globeness,e._globeLatitudeErrorCorrectionRadians=this._globeLatitudeErrorCorrectionRadians,e.apply(this),e}apply(e){this._helper.apply(e),this._mercatorTransform.apply(this),this._verticalPerspectiveTransform.apply(this,this._globeLatitudeErrorCorrectionRadians)}get projectionMatrix(){return this.currentTransform.projectionMatrix}get modelViewProjectionMatrix(){return this.currentTransform.modelViewProjectionMatrix}get inverseProjectionMatrix(){return this.currentTransform.inverseProjectionMatrix}get cameraPosition(){return this.currentTransform.cameraPosition}getProjectionData(e){const r=this._mercatorTransform.getProjectionData(e),o=this._verticalPerspectiveTransform.getProjectionData(e);return{mainMatrix:this.isGlobeRendering?o.mainMatrix:r.mainMatrix,clippingPlane:o.clippingPlane,tileMercatorCoords:o.tileMercatorCoords,projectionTransition:e.applyGlobeMatrix?this._globeness:0,fallbackMatrix:r.fallbackMatrix}}isLocationOccluded(e){return this.currentTransform.isLocationOccluded(e)}transformLightDirection(e){return this.currentTransform.transformLightDirection(e)}getPixelScale(){return c.b9(this._mercatorTransform.getPixelScale(),this._verticalPerspectiveTransform.getPixelScale(),this._globeness)}getCircleRadiusCorrection(){return c.b9(this._mercatorTransform.getCircleRadiusCorrection(),this._verticalPerspectiveTransform.getCircleRadiusCorrection(),this._globeness)}getPitchedTextCorrection(e,r,o){const u=this._mercatorTransform.getPitchedTextCorrection(e,r,o),f=this._verticalPerspectiveTransform.getPitchedTextCorrection(e,r,o);return c.b9(u,f,this._globeness)}projectTileCoordinates(e,r,o,u){return this.currentTransform.projectTileCoordinates(e,r,o,u)}_calcMatrices(){this._helper._width&&this._helper._height&&(this._verticalPerspectiveTransform.apply(this,this._globeLatitudeErrorCorrectionRadians),this._helper._nearZ=this._verticalPerspectiveTransform.nearZ,this._helper._farZ=this._verticalPerspectiveTransform.farZ,this._mercatorTransform.apply(this,!0,this.isGlobeRendering),this._helper._nearZ=this._mercatorTransform.nearZ,this._helper._farZ=this._mercatorTransform.farZ)}calculateFogMatrix(e){return this.currentTransform.calculateFogMatrix(e)}getVisibleUnwrappedCoordinates(e){return this.currentTransform.getVisibleUnwrappedCoordinates(e)}getCameraFrustum(){return this.currentTransform.getCameraFrustum()}getClippingPlane(){return this.currentTransform.getClippingPlane()}getCoveringTilesDetailsProvider(){return this.currentTransform.getCoveringTilesDetailsProvider()}recalculateZoomAndCenter(e){this._mercatorTransform.recalculateZoomAndCenter(e),this._verticalPerspectiveTransform.recalculateZoomAndCenter(e)}maxPitchScaleFactor(){return this._mercatorTransform.maxPitchScaleFactor()}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(e,r){return this.currentTransform.lngLatToCameraDepth(e,r)}populateCache(e){this._mercatorTransform.populateCache(e),this._verticalPerspectiveTransform.populateCache(e)}getBounds(){return this.currentTransform.getBounds()}getConstrained(e,r){return this.currentTransform.getConstrained(e,r)}calculateCenterFromCameraLngLatAlt(e,r,o,u){return this._helper.calculateCenterFromCameraLngLatAlt(e,r,o,u)}setLocationAtPoint(e,r){if(!this.isGlobeRendering)return this._mercatorTransform.setLocationAtPoint(e,r),void this.apply(this._mercatorTransform);this._verticalPerspectiveTransform.setLocationAtPoint(e,r),this.apply(this._verticalPerspectiveTransform)}locationToScreenPoint(e,r){return this.currentTransform.locationToScreenPoint(e,r)}screenPointToMercatorCoordinate(e,r){return this.currentTransform.screenPointToMercatorCoordinate(e,r)}screenPointToLocation(e,r){return this.currentTransform.screenPointToLocation(e,r)}isPointOnMapSurface(e,r){return this.currentTransform.isPointOnMapSurface(e,r)}getRayDirectionFromPixel(e){return this._verticalPerspectiveTransform.getRayDirectionFromPixel(e)}getMatrixForModel(e,r){return this.currentTransform.getMatrixForModel(e,r)}getProjectionDataForCustomLayer(e=!0){const r=this._mercatorTransform.getProjectionDataForCustomLayer(e);if(!this.isGlobeRendering)return r;const o=this._verticalPerspectiveTransform.getProjectionDataForCustomLayer(e);return o.fallbackMatrix=r.mainMatrix,o}getFastPathSimpleProjectionMatrix(e){return this.currentTransform.getFastPathSimpleProjectionMatrix(e)}}class Bi{get useGlobeControls(){return!0}handlePanInertia(e,r){const o=Wl(e,r);return Math.abs(o.lng-r.center.lng)>180&&(o.lng=r.center.lng+179.5*Math.sign(o.lng-r.center.lng)),{easingCenter:o,easingOffset:new c.P(0,0)}}handleMapControlsRollPitchBearingZoom(e,r){const o=e.around,u=r.screenPointToLocation(o);e.bearingDelta&&r.setBearing(r.bearing+e.bearingDelta),e.pitchDelta&&r.setPitch(r.pitch+e.pitchDelta),e.rollDelta&&r.setRoll(r.roll+e.rollDelta);const f=r.zoom;e.zoomDelta&&r.setZoom(r.zoom+e.zoomDelta);const y=r.zoom-f;if(y===0)return;const w=c.bk(r.center.lng,u.lng),S=w/(Math.abs(w/180)+1),I=c.bk(r.center.lat,u.lat),A=r.getRayDirectionFromPixel(o),k=r.cameraPosition,R=-1*c.aS(k,A),O=c.bf();c.aM(O,k,[A[0]*R,A[1]*R,A[2]*R]);const V=c.bq(O)-1,X=Math.exp(.5*-Math.max(V-.3,0)),W=Un(r.worldSize,r.center.lat)/Math.min(r.width,r.height),K=c.bc(W,.9,.5,1,.25),ee=(1-c.aG(-y))*Math.min(X,K),se=r.center.lat,oe=r.zoom,le=new c.N(r.center.lng+S*ee,c.ab(r.center.lat+I*ee,-85.051129,c.aF));r.setLocationAtPoint(u,o);const he=r.center,ue=c.bc(Math.abs(w),45,85,0,1),ve=c.bc(W,.75,.35,0,1),be=Math.pow(Math.max(ue,ve),.25),Ae=c.bk(he.lng,le.lng),Re=c.bk(he.lat,le.lat);r.setCenter(new c.N(he.lng+Ae*be,he.lat+Re*be).wrap()),r.setZoom(oe+Gr(se,r.center.lat))}handleMapControlsPan(e,r,o){if(!e.panDelta)return;const u=r.center.lat,f=r.zoom;r.setCenter(Wl(e.panDelta,r).wrap()),r.setZoom(f+Gr(u,r.center.lat))}cameraForBoxAndBearing(e,r,o,u,f){const y=Es(e,r,o,u,f),w=r.left/f.width*2-1,S=(f.width-r.right)/f.width*2-1,I=r.top/f.height*-2+1,A=(f.height-r.bottom)/f.height*-2+1,k=c.bk(o.getWest(),o.getEast())<0,R=k?o.getEast():o.getWest(),O=k?o.getWest():o.getEast(),V=Math.max(o.getNorth(),o.getSouth()),X=Math.min(o.getNorth(),o.getSouth()),W=R+.5*c.bk(R,O),K=V+.5*c.bk(V,X),ee=f.clone();ee.setCenter(y.center),ee.setBearing(y.bearing),ee.setPitch(0),ee.setRoll(0),ee.setZoom(y.zoom);const se=ee.modelViewProjectionMatrix,oe=[ir(o.getNorthWest()),ir(o.getNorthEast()),ir(o.getSouthWest
vendor: 5,533 bytes, line 744
744()),ir(o.getSouthEast()),ir(new c.N(O,K)),ir(new c.N(R,K)),ir(new c.N(W,V)),ir(new c.N(W,X))],le=ir(y.center);let he=Number.POSITIVE_INFINITY;for(const ue of oe)w<0&&(he=Bi.getLesserNonNegativeNonNull(he,Bi.solveVectorScale(ue,le,se,"x",w))),S>0&&(he=Bi.getLesserNonNegativeNonNull(he,Bi.solveVectorScale(ue,le,se,"x",S))),I>0&&(he=Bi.getLesserNonNegativeNonNull(he,Bi.solveVectorScale(ue,le,se,"y",I))),A<0&&(he=Bi.getLesserNonNegativeNonNull(he,Bi.solveVectorScale(ue,le,se,"y",A)));if(Number.isFinite(he)&&he!==0)return y.zoom=ee.zoom+c.a8(he),y;Yi()}handleJumpToCenterZoom(e,r){const o=e.center.lat,u=e.getConstrained(r.center?c.N.convert(r.center):e.center,e.zoom).center;e.setCenter(u.wrap());const f=r.zoom!==void 0?+r.zoom:e.zoom+Gr(o,u.lat);e.zoom!==f&&e.setZoom(f)}handleEaseTo(e,r){const o=e.zoom,u=e.center,f=e.padding,y={roll:e.roll,pitch:e.pitch,bearing:e.bearing},w={roll:r.roll===void 0?e.roll:r.roll,pitch:r.pitch===void 0?e.pitch:r.pitch,bearing:r.bearing===void 0?e.bearing:r.bearing},S=r.zoom!==void 0,I=!e.isPaddingEqual(r.padding);let A=!1;const k=r.center?c.N.convert(r.center):u,R=e.getConstrained(k,o).center;fi(e,R);const O=e.clone();O.setCenter(R),O.setZoom(S?+r.zoom:o+Gr(u.lat,k.lat)),O.setBearing(r.bearing);const V=new c.P(c.ab(e.centerPoint.x+r.offsetAsPoint.x,0,e.width),c.ab(e.centerPoint.y+r.offsetAsPoint.y,0,e.height));O.setLocationAtPoint(R,V);const X=(r.offset&&r.offsetAsPoint.mag())>0?O.center:R,W=S?+r.zoom:o+Gr(u.lat,X.lat),K=o+Gr(u.lat,0),ee=W+Gr(X.lat,0),se=c.bk(u.lng,X.lng),oe=c.bk(u.lat,X.lat),le=c.aG(ee-K);return A=W!==o,{easeFunc:he=>{if(c.b3(y,w)||ql({startEulerAngles:y,endEulerAngles:w,tr:e,k:he,useSlerp:y.roll!=w.roll}),I&&e.interpolatePadding(f,r.padding,he),r.around)c.w("Easing around a point is not supported under globe projection."),e.setLocationAtPoint(r.around,r.aroundPoint);else{const ue=ee>K?Math.min(2,le):Math.max(.5,le),ve=Math.pow(ue,1-he),be=Bu(u,se,oe,he*ve);e.setCenter(be.wrap())}if(A){const ue=c.y.number(K,ee,he)+Gr(0,e.center.lat);e.setZoom(ue)}},isZooming:A,elevationCenter:X}}handleFlyTo(e,r){const o=r.zoom!==void 0,u=e.center,f=e.zoom,y=!e.isPaddingEqual(r.padding),w=e.getConstrained(c.N.convert(r.center||r.locationAtOffset),f).center,S=o?+r.zoom:e.zoom+Gr(e.center.lat,w.lat),I=e.clone();I.setCenter(w),y&&I.setPadding(r.padding),I.setZoom(S),I.setBearing(r.bearing);const A=new c.P(c.ab(e.centerPoint.x+r.offsetAsPoint.x,0,e.width),c.ab(e.centerPoint.y+r.offsetAsPoint.y,0,e.height));I.setLocationAtPoint(w,A);const k=I.center;fi(e,k);const R=function(se,oe,le){const he=ir(oe),ue=ir(le),ve=c.aS(he,ue),be=Math.acos(ve),Ae=Fu(se);return be/(2*Math.PI)*Ae}(e,u,k),O=f+Gr(u.lat,0),V=S+Gr(k.lat,0),X=c.aG(V-O);let W;if(typeof r.minZoom=="number"){const se=+r.minZoom+Gr(k.lat,0),oe=Math.min(se,O,V)+Gr(0,k.lat),le=e.getConstrained(k,oe).zoom+Gr(k.lat,0);W=c.aG(le-O)}const K=c.bk(u.lng,k.lng),ee=c.bk(u.lat,k.lat);return{easeFunc:(se,oe,le,he)=>{const ue=Bu(u,K,ee,le),ve=se===1?k:ue;e.setCenter(ve.wrap());const be=O+c.a8(oe);e.setZoom(se===1?S:be+Gr(0,ve.lat))},scaleOfZoom:X,targetCenter:k,scaleOfMinZoom:W,pixelPathLength:R}}static solveVectorScale(e,r,o,u,f){const y=u==="x"?[o[0],o[4],o[8],o[12]]:[o[1],o[5],o[9],o[13]],w=[o[3],o[7],o[11],o[15]],S=e[0]*y[0]+e[1]*y[1]+e[2]*y[2],I=e[0]*w[0]+e[1]*w[1]+e[2]*w[2],A=r[0]*y[0]+r[1]*y[1]+r[2]*y[2],k=r[0]*w[0]+r[1]*w[1]+r[2]*w[2];return A+f*I===S+f*k||w[3]*(S-A)+y[3]*(k-I)+S*k==A*I?null:(A+y[3]-f*k-f*w[3])/(A-S-f*k+f*I)}static getLesserNonNegativeNonNull(e,r){return r!==null&&r>=0&&r<e?r:e}}class Aa{constructor(e){this._globe=e,this._mercatorCameraHelper=new wo,this._verticalPerspectiveCameraHelper=new Bi}get useGlobeControls(){return this._globe.useGlobeRendering}get currentHelper(){return this.useGlobeControls?this._verticalPerspectiveCameraHelper:this._mercatorCameraHelper}handlePanInertia(e,r){return this.currentHelper.handlePanInertia(e,r)}handleMapControlsRollPitchBearingZoom(e,r){return this.currentHelper.handleMapControlsRollPitchBearingZoom(e,r)}handleMapControlsPan(e,r,o){this.currentHelper.handleMapControlsPan(e,r,o)}cameraForBoxAndBearing(e,r,o,u,f){return this.currentHelper.cameraForBoxAndBearing(e,r,o,u,f)}handleJumpToCenterZoom(e,r){this.currentHelper.handleJumpToCenterZoom(e,r)}handleEaseTo(e,r){return this.currentHelper.handleEaseTo(e,r)}handleFlyTo(e,r){return this.currentHelper.handleFlyTo(e,r)}}const Zn=(d,e)=>c.t(d,e&&e.filter(r=>r.identifier!=="source.canvas")),Yl=c.br();class Ki extends c.E{constructor(e,r={}){super(),this._rtlPluginLoaded=()=>{for(const o in this.sourceCaches){const u=this.sourceCaches[o].getSource().type;u!=="vector"&&u!=="geojson"||this.sourceCaches[o].reload()}},this.map=e,this.dispatcher=new Xi(Li(),e._getMapId()),this.dispatcher.registerMessageHandler("GG",(o,u)=>this.getGlyphs(o,u)),this.dispatcher.registerMessageHandler("GI",(o,u)=>this.getImages(o,u)),this.imageManager=new cr,this.imageManager.setEventedParent(this),this.glyphManager=new Mr(e._requestManager,r.localIdeographFontFamily),this.lineAtlas=new Wi(256,512),this.crossTileSymbolIndex=new dn,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new c.bs,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",c.bt()),Ft().on(gt,this._rtlPluginLoaded),this.on("data",o=>{if(o.dataType!=="source"||o.sourceDataType!=="metadata")return;const u=this.sourceCaches[o.sourceId];if(!u)return;const f=u.getSource();if(f&&f.vectorLayerIds)for(const y in this._layers){const w=this._layers[y];
744w.source===f.id&&this._validateLayer(w)}})}loadURL(e,r={},o){this.fire(new c.k("dataloading",{dataType:"style"})),r.validate=typeof r.validate!="boolean"||r.validate;const u=this.map._requestManager.transformRequest(e,"Style");this._loadStyleRequest=new AbortController;const f=this._loadStyleRequest;c.h(u,this._loadStyleRequest).then(y=>{this._loadStyleRequest=null,this._load(y.data,r,o)}).catch(y=>{this._loadStyleRequest=null,y&&!f.signal.aborted&&this.fire(new c.j(y))})}loadJSON(e,r={},o){this.fire(new c.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,ge.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,r.validate=r.validate!==!1,this._load(e,r,o)}).catch(()=>{})}loadEmpty(){this.fire(new c.k("dataloading",{dataType:"style"})),this._load(Yl,{validate:!1})}_load(e,r,o){var u,f;const y=r.transformStyle?r.transformStyle(o,e):e;if(!r.validate||!Zn(this,c.u(y))){this._loaded=!0,this.stylesheet=y;for(const w in y.sources)this.addSource(w,y.sources[w],{validate:!1});y.sprite?this._loadSprite(y.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(y.glyphs),this._createLayers(),this.light=new It(this.stylesheet.light),this._setProjectionInternal(((u=this.stylesheet.projection)===null||u===void 0?void 0:u.type)||"mercator"),this.sky=new vi(this.stylesheet.sky),this.map.setTerrain((f=this.stylesheet.terrain)!==null&&f!==void 0?f:null),this.fire(new c.k("data",{dataType:"style"})),this.fire(new c.k("style.load"))}}_createLayers(){const e=c.bu(this.stylesheet.layers);this.dispatcher.broadcast("SL",e),this._order=e.map(r=>r.id),this._layers={},this._serializedLayers=null;for(const r of e){const o=c.bv(r);o.setEventedParent(this,{layer:{id:r.id}}),this._layers[r.id]=o}}_loadSprite(e,r=!1,o=void 0){let u;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(f,y,w,S){return c._(this,void 0,void 0,function*(){const I=Xt(f),A=w>1?"@2x":"",k={},R={};for(const{id:O,url:V}of I){const X=y.transformRequest(Et(V,A,".json"),"SpriteJSON");k[O]=c.h(X,S);const W=y.transformRequest(Et(V,A,".png"),"SpriteImage");R[O]=nt.getImage(W,S)}return yield Promise.all([...Object.values(k),...Object.values(R)]),function(O,V){return c._(this,void 0,void 0,function*(){const X={};for(const W in O){X[W]={};const K=ge.getImageCanvasContext((yield V[W]).data),ee=(yield O[W]).data;for(const se in ee){const{width:oe,height:le,x:he,y:ue,sdf:ve,pixelRatio:be,stretchX:Ae,stretchY:Re,content:Ie,textFitWidth:Ge,textFitHeight:Ue}=ee[se];X[W][se]={data:null,pixelRatio:be,sdf:ve,stretchX:Ae,stretchY:Re,content:Ie,textFitWidth:Ge,textFitHeight:Ue,spriteData:{width:oe,height:le,x:he,y:ue,context:K}}}}return X})}(k,R)})}(e,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(f=>{if(this._spriteRequest=null,f)for(const y in f){this._spritesImagesIds[y]=[];const w=this._spritesImagesIds[y]?this._spritesImagesIds[y].filter(S=>!(S in f)):[];for(const S of w)this.imageManager.removeImage(S),this._changedImages[S]=!0;for(const S in f[y]){const I=y==="default"?S:`${y}:${S}`;this._spritesImagesIds[y].push(I),I in this.imageManager.images?this.imageManager.updateImage(I,f[y][S],!1):this.imageManager.addImage(I,f[y][S]),r&&(this._changedImages[I]=!0)}}}).catch(f=>{this._spriteRequest=null,u=f,this.fire(new c.j(u))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),r&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.k("data",{dataType:"style"})),o&&o(u)})}_unloadSprite(){for(const e of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(e),this._changedImages[e]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}_validateLayer(e){const r=this.sourceCaches[e.source];if(!r)return;const o=e.sourceLayer;if(!o)return;const u=r.getSource();(u.type==="geojson"||u.vectorLayerIds&&u.vectorLayerIds.indexOf(o)===-1)&&this.fire(new c.j(new Error(`Source layer "${o}" does not exist on source "${u.id}" as specified by style layer "${e.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const e in this.sourceCaches)if(!this.sourceCaches[e].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(e,r=!1){const o=this._serializedAllLayers();if(!e||e.length===0)return Object.values(r?c.bw(o):o);const u=[];for(const f of e)if(o[f]){const y=r?c.bw(o[f]):o[f];u.push(y)}return u}_serializedAllLayers(){let e=this._serializedLayers;if(e)return e;e=this._serializedLayers={};const r=Object.keys(this._layers);for(const o of r){const u=this._layers[o];u.type!=="custom"&&(e[o]=u.serialize())}return e}hasTransitions(){var e,r,o;if(!((e=this.light)===null||e===void 0)&&e.hasTransition()||!((r=this.sky)===null||r===void 0)&&r.hasTransition()||!((o=this.projection)===null||o===void 0)&&o.hasTransition())return!0;for(const u in this.sourceCaches)if(this.sourceCaches[u].hasTransition())return!0;for(const u in this._layers)if(this._layers[u].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(e){if(!this._loaded)return;const r=this._changed;if(r){const u=Object.keys(this._updatedLayers),f=Object.keys(this._removedLayers);(u.length||f.length)&&this._updateWorkerLayers(u,f);for(const y in this._updatedSources){const w=this._updatedSources[y];if(w==="reload")this._reloadSource(y);else{if(w!=="clear")throw new Error(`Invalid action ${w}`);this._clearSource(y)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const y in this._updatedPaintProps)this._layers[y].updateTransitions(e);this.light.updateTransitions(e),this.sky.updateTransitions(e),this._resetUpdates()}const o={};for(const u in this.sourceCaches){const f=this.sourceCaches[u];o[u]=f.used,f.used=!1}for(const u of this._order){const f=this._layers[u];f.recalculate(e,this._availableImages),!f.isHidden(e.zoom)&&f.source&&(this.sourceCaches[f.source].used=!0)}for(const u in o){const f=this.sourceCaches[u];!!o[u]!=!!f.used&&f.fire(new c.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:u}))}this.light.recalculate(e),this.sky.recalculate(e),this.projection.recalculate(e),this.z=e.zoom,r&&this.fire(new c.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const e=Object.keys(this._changedImages);if(e.length){for(const r in this.sourceCaches)this.sourceCaches[r].reloadTilesForDependencies(["icons","patterns"],e);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(e,r){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(e,!1),removedIds:r})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(e,r={}){var o;this._checkLoaded();const u=this.serialize();if(e=r.transformStyle?r.transformStyle(u,e):e,((o=r.validate)===null||o===void 0||o)&&Zn(this,c.u(e)))return!1;
744(e=c.bw(e)).layers=c.bu(e.layers);const f=c.bx(u,e),y=this._getOperationsToPerform(f);if(y.unimplemented.length>0)throw new Error(`Unimplemented: ${y.unimplemented.join(", ")}.`);if(y.operations.length===0)return!1;for(const w of y.operations)w();return this.stylesheet=e,this._serializedLayers=null,!0}_getOperationsToPerform(e){const r=[],o=[];for(const u of e)switch(u.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":case"setRoll":continue;case"addLayer":r.push(()=>this.addLayer.apply(this,u.args));break;case"removeLayer":r.push(()=>this.removeLayer.apply(this,u.args));break;case"setPaintProperty":r.push(()=>this.setPaintProperty.apply(this,u.args));break;case"setLayoutProperty":r.push(()=>this.setLayoutProperty.apply(this,u.args));break;case"setFilter":r.push(()=>this.setFilter.apply(this,u.args));break;case"addSource":r.push(()=>this.addSource.apply(this,u.args));break;case"removeSource":r.push(()=>this.removeSource.apply(this,u.args));break;case"setLayerZoomRange":r.push(()=>this.setLayerZoomRange.apply(this,u.args));break;case"setLight":r.push(()=>this.setLight.apply(this,u.args));break;case"setGeoJSONSourceData":r.push(()=>this.setGeoJSONSourceData.apply(this,u.args));break;case"setGlyphs":r.push(()=>this.setGlyphs.apply(this,u.args));break;case"setSprite":r.push(()=>this.setSprite.apply(this,u.args));break;case"setTerrain":r.push(()=>this.map.setTerrain.apply(this,u.args));break;case"setSky":r.push(()=>this.setSky.apply(this,u.args));break;case"setProjection":this.setProjection.apply(this,u.args);break;case"setTransition":r.push(()=>{});break;default:o.push(u.command)}return{operations:r,unimplemented:o}}addImage(e,r){if(this.getImage(e))return this.fire(new c.j(new Error(`An image named "${e}" already exists.`)));this.imageManager.addImage(e,r),this._afterImageUpdated(e)}updateImage(e,r){this.imageManager.updateImage(e,r)}getImage(e){return this.imageManager.getImage(e)}removeImage(e){if(!this.getImage(e))return this.fire(new c.j(new Error(`An image named "${e}" does not exist.`)));this.imageManager.removeImage(e),this._afterImageUpdated(e)}_afterImageUpdated(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(e,r,o={}){if(this._checkLoaded(),this.sourceCaches[e]!==void 0)throw new Error(`Source "${e}" already exists.`);if(!r.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(r).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(c.u.source,`sources.${e}`,r,null,o))return;this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);const u=this.sourceCaches[e]=new N(e,r,this.dispatcher);u.style=this,u.setEventedParent(this,()=>({isSourceLoaded:u.loaded(),source:u.serialize(),sourceId:e})),u.onAdd(this.map),this._changed=!0}removeSource(e){if(this._checkLoaded(),this.sourceCaches[e]===void 0)throw new Error("There is no source with this ID");for(const o in this._layers)if(this._layers[o].source===e)return this.fire(new c.j(new Error(`Source "${e}" cannot be removed while layer "${o}" is using it.`)));const r=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],r.fire(new c.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),r.setEventedParent(null),r.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(e,r){if(this._checkLoaded(),this.sourceCaches[e]===void 0)throw new Error(`There is no source with this ID=${e}`);const o=this.sourceCaches[e].getSource();if(o.type!=="geojson")throw new Error(`geojsonSource.type is ${o.type}, which is !== 'geojson`);o.setData(r),this._changed=!0}getSource(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()}addLayer(e,r,o={}){this._checkLoaded();const u=e.id;if(this.getLayer(u))return void this.fire(new c.j(new Error(`Layer "${u}" already exists on this map.`)));let f;if(e.type==="custom"){if(Zn(this,c.by(e)))return;f=c.bv(e)}else{if("source"in e&&typeof e.source=="object"&&(this.addSource(u,e.source),e=c.bw(e),e=c.e(e,{source:u}
vendor: 4,533 bytes, line 744
744)),this._validate(c.u.layer,`layers.${u}`,e,{arrayIndex:-1},o))return;f=c.bv(e),this._validateLayer(f),f.setEventedParent(this,{layer:{id:u}})}const y=r?this._order.indexOf(r):this._order.length;if(r&&y===-1)this.fire(new c.j(new Error(`Cannot add layer "${u}" before non-existing layer "${r}".`)));else{if(this._order.splice(y,0,u),this._layerOrderChanged=!0,this._layers[u]=f,this._removedLayers[u]&&f.source&&f.type!=="custom"){const w=this._removedLayers[u];delete this._removedLayers[u],w.type!==f.type?this._updatedSources[f.source]="clear":(this._updatedSources[f.source]="reload",this.sourceCaches[f.source].pause())}this._updateLayer(f),f.onAdd&&f.onAdd(this.map)}}moveLayer(e,r){if(this._checkLoaded(),this._changed=!0,!this._layers[e])return void this.fire(new c.j(new Error(`The layer '${e}' does not exist in the map's style and cannot be moved.`)));if(e===r)return;const o=this._order.indexOf(e);this._order.splice(o,1);const u=r?this._order.indexOf(r):this._order.length;r&&u===-1?this.fire(new c.j(new Error(`Cannot move layer "${e}" before non-existing layer "${r}".`))):(this._order.splice(u,0,e),this._layerOrderChanged=!0)}removeLayer(e){this._checkLoaded();const r=this._layers[e];if(!r)return void this.fire(new c.j(new Error(`Cannot remove non-existing layer "${e}".`)));r.setEventedParent(null);const o=this._order.indexOf(e);this._order.splice(o,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],this._serializedLayers&&delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}getLayer(e){return this._layers[e]}getLayersOrder(){return[...this._order]}hasLayer(e){return e in this._layers}setLayerZoomRange(e,r,o){this._checkLoaded();const u=this.getLayer(e);u?u.minzoom===r&&u.maxzoom===o||(r!=null&&(u.minzoom=r),o!=null&&(u.maxzoom=o),this._updateLayer(u)):this.fire(new c.j(new Error(`Cannot set the zoom range of non-existing layer "${e}".`)))}setFilter(e,r,o={}){this._checkLoaded();const u=this.getLayer(e);if(u){if(!c.bz(u.filter,r))return r==null?(u.filter=void 0,void this._updateLayer(u)):void(this._validate(c.u.filter,`layers.${u.id}.filter`,r,null,o)||(u.filter=c.bw(r),this._updateLayer(u)))}else this.fire(new c.j(new Error(`Cannot filter non-existing layer "${e}".`)))}getFilter(e){return c.bw(this.getLayer(e).filter)}setLayoutProperty(e,r,o,u={}){this._checkLoaded();const f=this.getLayer(e);f?c.bz(f.getLayoutProperty(r),o)||(f.setLayoutProperty(r,o,u),this._updateLayer(f)):this.fire(new c.j(new Error(`Cannot style non-existing layer "${e}".`)))}getLayoutProperty(e,r){const o=this.getLayer(e);if(o)return o.getLayoutProperty(r);this.fire(new c.j(new Error(`Cannot get style of non-existing layer "${e}".`)))}setPaintProperty(e,r,o,u={}){this._checkLoaded();const f=this.getLayer(e);f?c.bz(f.getPaintProperty(r),o)||(f.setPaintProperty(r,o,u)&&this._updateLayer(f),this._changed=!0,this._updatedPaintProps[e]=!0,this._serializedLayers=null):this.fire(new c.j(new Error(`Cannot style non-existing layer "${e}".`)))}getPaintProperty(e,r){return this.getLayer(e).getPaintProperty(r)}setFeatureState(e,r){this._checkLoaded();const o=e.source,u=e.sourceLayer,f=this.sourceCaches[o];if(f===void 0)return void this.fire(new c.j(new Error(`The source '${o}' does not exist in the map's style.`)));const y=f.getSource().type;y==="geojson"&&u?this.fire(new c.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):y!=="vector"||u?(e.id===void 0&&this.fire(new c.j(new Error("The feature id parameter must be provided."))),f.setFeatureState(u,e.id,r)):this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(e,r){this._checkLoaded();const o=e.source,u=this.sourceCaches[o];if(u===void 0)return void this.fire(new c.j(new Error(`The source '${o}' does not exist in the map's style.`)));const f=u.getSource().type,y=f==="vector"?e.sourceLayer:void 0;f!=="vector"||y?r&&typeof e.id!="string"&&typeof e.id!="number"?this.fire(new c.j(new Error("A feature id is required to remove its specific state property."))):u.removeFeatureState(y,e.id,r):this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(e){this._checkLoaded();const r=e.source,o=e.sourceLayer,u=this.sourceCaches[r];if(u!==void 0)return u.getSource().type!=="vector"||o?(e.id===void 0&&this.fire(new c.j(new Error("The feature id parameter must be provided."))),u.getFeatureState(
744o,e.id)):void this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new c.j(new Error(`The source '${r}' does not exist in the map's style.`)))}getTransition(){return c.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const e=c.bA(this.sourceCaches,f=>f.serialize()),r=this._serializeByIds(this._order,!0),o=this.map.getTerrain()||void 0,u=this.stylesheet;return c.bB({version:u.version,name:u.name,metadata:u.metadata,light:u.light,sky:u.sky,center:u.center,zoom:u.zoom,bearing:u.bearing,pitch:u.pitch,sprite:u.sprite,glyphs:u.glyphs,transition:u.transition,projection:u.projection,sources:e,layers:r,terrain:o},f=>f!==void 0)}_updateLayer(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&this.sourceCaches[e.source].getSource().type!=="raster"&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(e){const r=y=>this._layers[y].type==="fill-extrusion",o={},u=[];for(let y=this._order.length-1;y>=0;y--){const w=this._order[y];if(r(w)){o[w]=y;for(const S of e){const I=S[w];if(I)for(const A of I)u.push(A)}}}u.sort((y,w)=>w.intersectionZ-y.intersectionZ);const f=[];for(let y=this._order.length-1;y>=0;y--){const w=this._order[y];if(r(w))for(let S=u.length-1;S>=0;S--){const I=u[S].feature;if(o[I.layer.id]<y)break;f.push(I),u.pop()}else for(const S of e){const I=S[w];if(I)for(const A of I)f.push(A.feature)}}return f}queryRenderedFeatures(e,r,o){r&&r.filter&&this._validate(c.u.filter,"queryRenderedFeatures.filter",r.filter,null,r);const u={};if(r&&r.layers){if(!(Array.isArray(r.layers)||r.layers instanceof Set))return this.fire(new c.j(new Error("parameters.layers must be an Array or a Set of strings"))),[];for(const I of r.layers){const A=this._layers[I];if(!A)return this.fire(new c.j(new Error(`The layer '${I}' does not exist in the map's style and cannot be queried for features.`))),[];u[A.source]=!0}}const f=[];r.availableImages=this._availableImages;const y=this._serializedAllLayers(),w=r.layers instanceof Set?r.layers:Array.isArray(r.layers)?new Set(r.layers):null,S=Object.assign(Object.assign({},r),{layers:w});for(const I in this.sourceCaches)r.layers&&!u[I]||f.push(ns(this.sourceCaches[I],this._layers,y,e,S,o));return this.placement&&f.push(function(I,A,k,R,O,V,X){const W={},K=V.queryRenderedSymbols(R),ee=[];for(const se of Object.keys(K).map(Number))ee.push(X[se]);ee.sort(ri);for(const se of ee){const oe=se.featureIndex.lookupSymbolFeatures(K[se.bucketInstanceId],A,se.bucketIndex,se.sourceLayerIndex,O.filter,O.layers,O.availableImages,I);for(const le in oe){const he=W[le]=W[le]||[],ue=oe[le];ue.sort((ve,be)=>{const Ae=se.featureSortOrder;if(Ae){const Re=Ae.indexOf(ve.featureIndex);return Ae.indexOf(be.featureIndex)-Re}return be.featureIndex-ve.featureIndex});for(const ve of ue)he.push(ve)}}return function(se,oe,le){for(const he in se)for(const ue of se[he])ae(ue,le[oe[he].source]);return se}(W,I,k)}(this._layers,y,this.sourceCaches,e,S,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(f)}querySourceFeatures(e,r){r&&r.filter&&this._validate(c.u.filter,"querySourceFeatures.filter",r.filter,null,r);const o=this.sourceCaches[e];return o?function(u,f){const y=u.getRenderableIds().map(I=>u.getTileByID(I)),w=[],S={};for(let I=0;I<y.length;I++){const A=y[I],k=A.tileID.canonical.key;S[k]||(S[k]=!0,A.querySourceFeatures(w,f))}return w}(o,r):[]}getLight(){return this.light.getLight()}setLight(e,r={}){this._checkLoaded();const o=this.light.getLight();let u=!1;for(const y in e)if(!c.bz(e[y],o[y])){u=!0;break}if(!u)return;const f={now:ge.now(),transition:c.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,r),this.light.updateTransitions(f)}getProjection(){var e;return(e=this.stylesheet)===null||e===void 0?void 0:e.projection}setProjection(e){if(this._checkLoaded(),this.projection){if(this.projection.name===e.type)return;this.projection.destroy(),delete this.projection}this.stylesheet.projection=e,this._setProjectionInternal(e.type)}getSky(){var e;return(e=this.stylesheet)===null||e===void 0?void 0:e.sky}setSky(e,r={}){this._checkLoaded();const o=this.getSky();let u=!1;if(!e&&!o)return;if(e&&!o)u=!0;else if(!e&&o)u=!0;
744else for(const y in e)if(!c.bz(e[y],o[y])){u=!0;break}if(!u)return;const f={now:ge.now(),transition:c.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=e,this.sky.setSky(e,r),this.sky.updateTransitions(f)}_setProjectionInternal(e){const r=function(o){if(Array.isArray(o)){const u=new Hl({type:o});return{projection:u,transform:new _n,cameraHelper:new Aa(u)}}switch(o){case"mercator":return{projection:new Ta,transform:new Cs,cameraHelper:new wo};case"globe":{const u=new Hl({type:["interpolate",["linear"],["zoom"],11,"vertical-perspective",12,"mercator"]});return{projection:u,transform:new _n,cameraHelper:new Aa(u)}}case"vertical-perspective":return{projection:new Lu,transform:new So,cameraHelper:new Bi};default:return c.w(`Unknown projection name: ${o}. Falling back to mercator projection.`),{projection:new Ta,transform:new Cs,cameraHelper:new wo}}}(e);this.projection=r.projection,this.map.migrateProjection(r.transform,r.cameraHelper);for(const o in this.sourceCaches)this.sourceCaches[o].reload()}_validate(e,r,o,u,f={}){return(!f||f.validate!==!1)&&Zn(this,e.call(c.u,c.e({key:r,style:this.serialize(),value:o,styleSpec:c.v},u)))}_remove(e=!0){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),Ft().off(gt,this._rtlPluginLoaded);for(const r in this._layers)this._layers[r].setEventedParent(null);for(const r in this.sourceCaches){const o=this.sourceCaches[r];o.setEventedParent(null),o.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),e&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(e)}_clearSource(e){this.sourceCaches[e].clearTiles()}_reloadSource(e){this.sourceCaches[e].resume(),this.sourceCaches[e].reload()}_updateSources(e){for(const r in this.sourceCaches)this.sourceCaches[r].update(e,this.map.terrain)}_generateCollisionBoxes(){for(const e in this.sourceCaches)this._reloadSource(e)}_updatePlacement(e,r,o,u,f=!1){let y=!1,w=!1;const S={};for(const I of this._order){const A=this._layers[I];if(A.type!=="symbol")continue;if(!S[A.source]){const R=this.sourceCaches[A.source];S[A.source]=R.getRenderableIds(!0).map(O=>R.getTileByID(O)).sort((O,V)=>V.tileID.overscaledZ-O.tileID.overscaledZ||(O.tileID.isLessThan(V.tileID)?-1:1))}const k=this.crossTileSymbolIndex.addLayer(A,S[A.source],e.center.lng);y=y||k}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((f=f||this._layerOrderChanged||o===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(ge.now(),e.zoom))&&(this.pauseablePlacement=new zu(e,this.map.terrain,this._order,f,r,o,u,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,S),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(ge.now()),w=!0),y&&this.pauseablePlacement.placement.setStale()),w||y)for(const I of this._order){const A=this._layers[I];A.type==="symbol"&&this.placement.updateLayerOpacities(A,S[A.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(ge.now())}_releaseSymbolFadeTiles(){for(const e in this.sourceCaches)this.sourceCaches[e].releaseSymbolFadeTiles()}getImages(e,r){return c._(this,void 0,void 0,function*(){const o=yield this.imageManager.getImages(r.icons);this._updateTilesForChangedImages();const u=this.sourceCaches[r.source];return u&&u.setDependencies(r.tileID.key,r.type,r.icons),o})}getGlyphs(e,r){return c._(this,void 0,void 0,function*(){const o=yield this.glyphManager.getGlyphs(r.stacks),u=this.sourceCaches[r.source];return u&&u.setDependencies(r.tileID.key,r.type,[""]),o})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(e,r={}){this._checkLoaded(),e&&this._validate(c.u.glyphs,"glyphs",e,null,r)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=e,this.glyphManager.entries={},this.glyphManager.setURL(e))}addSprite(e,r,o={},u){this._checkLoaded();const f=[{id:e,url:r}],y=[...Xt(this.stylesheet.sprite),...f];
vendor: 4,145 bytes, lines 744-746
744this._validate(c.u.sprite,"sprite",y,null,o)||(this.stylesheet.sprite=y,this._loadSprite(f,!0,u))}removeSprite(e){this._checkLoaded();const r=Xt(this.stylesheet.sprite);if(r.find(o=>o.id===e)){if(this._spritesImagesIds[e])for(const o of this._spritesImagesIds[e])this.imageManager.removeImage(o),this._changedImages[o]=!0;r.splice(r.findIndex(o=>o.id===e),1),this.stylesheet.sprite=r.length>0?r:void 0,delete this._spritesImagesIds[e],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}else this.fire(new c.j(new Error(`Sprite "${e}" doesn't exists on this map.`)))}getSprite(){return Xt(this.stylesheet.sprite)}setSprite(e,r={},o){this._checkLoaded(),e&&this._validate(c.u.sprite,"sprite",e,null,r)||(this.stylesheet.sprite=e,e?this._loadSprite(e,!0,o):(this._unloadSprite(),o&&o(null)))}}var Vp=c.aA([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Kl{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(e,r,o,u,f,y,w,S,I){this.context=e;let A=this.boundPaintVertexBuffers.length!==u.length;for(let k=0;!A&&k<u.length;k++)this.boundPaintVertexBuffers[k]!==u[k]&&(A=!0);!this.vao||this.boundProgram!==r||this.boundLayoutVertexBuffer!==o||A||this.boundIndexBuffer!==f||this.boundVertexOffset!==y||this.boundDynamicVertexBuffer!==w||this.boundDynamicVertexBuffer2!==S||this.boundDynamicVertexBuffer3!==I?this.freshBind(r,o,u,f,y,w,S,I):(e.bindVertexArray.set(this.vao),w&&w.bind(),f&&f.dynamicDraw&&f.bind(),S&&S.bind(),I&&I.bind())}freshBind(e,r,o,u,f,y,w,S){const I=e.numAttributes,A=this.context,k=A.gl;this.vao&&this.destroy(),this.vao=A.createVertexArray(),A.bindVertexArray.set(this.vao),this.boundProgram=e,this.boundLayoutVertexBuffer=r,this.boundPaintVertexBuffers=o,this.boundIndexBuffer=u,this.boundVertexOffset=f,this.boundDynamicVertexBuffer=y,this.boundDynamicVertexBuffer2=w,this.boundDynamicVertexBuffer3=S,r.enableAttributes(k,e);for(const R of o)R.enableAttributes(k,e);y&&y.enableAttributes(k,e),w&&w.enableAttributes(k,e),S&&S.enableAttributes(k,e),r.bind(),r.setVertexAttribPointers(k,e,f);for(const R of o)R.bind(),R.setVertexAttribPointers(k,e,f);y&&(y.bind(),y.setVertexAttribPointers(k,e,f)),u&&u.bind(),w&&(w.bind(),w.setVertexAttribPointers(k,e,f)),S&&(S.bind(),S.setVertexAttribPointers(k,e,f)),A.currentNumAttributes=I}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}const ka=(d,e,r,o,u)=>({u_texture:0,u_ele_delta:d,u_fog_matrix:e,u_fog_color:r?r.properties.get("fog-color"):c.b4.white,u_fog_ground_blend:r?r.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:u?0:r?r.calculateFogBlendOpacity(o):0,u_horizon_color:r?r.properties.get("horizon-color"):c.b4.white,u_horizon_fog_blend:r?r.properties.get("horizon-fog-blend"):1,u_is_globe_mode:u?1:0}),za={mainMatrix:"u_projection_matrix",tileMercatorCoords:"u_projection_tile_mercator_coords",clippingPlane:"u_projection_clipping_plane",projectionTransition:"u_projection_transition",fallbackMatrix:"u_projection_fallback_matrix"};function Mo(d){const e=[];for(let r=0;r<d.length;r++){if(d[r]===null)continue;const o=d[r].split(" ");e.push(o.pop())}return e}class Po{constructor(e,r,o,u,f,y,w,S){const I=e.gl;this.program=I.createProgram();const A=Mo(r.staticAttributes),k=o?o.getBinderAttributes():[],R=A.concat(k),O=ys.prelude.staticUniforms?Mo(ys.prelude.staticUniforms):[],V=w.staticUniforms?Mo(w.staticUniforms):[],X=r.staticUniforms?Mo(r.staticUniforms):[],W=o?o.getBinderUniforms():[],K=O.concat(V).concat(X).concat(W),ee=[];for(const be of K)ee.indexOf(be)<0&&ee.push(be);const se=o?o.defines():[];ls(I)&&se.unshift("#version 300 es"),f&&se.push("#define OVERDRAW_INSPECTOR;"),y&&se.push("#define TERRAIN3D;"),S&&se.push(S);let oe=se.concat(ys.prelude.fragmentSource,w.fragmentSource,r.fragmentSource).join(`
745`),le=se.concat(ys.prelude.vertexSource,w.vertexSource,r.vertexSource).join(`
746`);
vendor: 4,323 bytes, line 746
746ls(I)||(oe=function(be){return be.replace(/\bin\s/g,"varying ").replace("out highp vec4 fragColor;","").replace(/fragColor/g,"gl_FragColor").replace(/texture\(/g,"texture2D(")}(oe),le=function(be){return be.replace(/\bin\s/g,"attribute ").replace(/\bout\s/g,"varying ").replace(/texture\(/g,"texture2D(")}(le));const he=I.createShader(I.FRAGMENT_SHADER);if(I.isContextLost())return void(this.failedToCreate=!0);if(I.shaderSource(he,oe),I.compileShader(he),!I.getShaderParameter(he,I.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${I.getShaderInfoLog(he)}`);I.attachShader(this.program,he);const ue=I.createShader(I.VERTEX_SHADER);if(I.isContextLost())return void(this.failedToCreate=!0);if(I.shaderSource(ue,le),I.compileShader(ue),!I.getShaderParameter(ue,I.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${I.getShaderInfoLog(ue)}`);I.attachShader(this.program,ue),this.attributes={};const ve={};this.numAttributes=R.length;for(let be=0;be<this.numAttributes;be++)R[be]&&(I.bindAttribLocation(this.program,be,R[be]),this.attributes[R[be]]=be);if(I.linkProgram(this.program),!I.getProgramParameter(this.program,I.LINK_STATUS))throw new Error(`Program failed to link: ${I.getProgramInfoLog(this.program)}`);I.deleteShader(ue),I.deleteShader(he);for(let be=0;be<ee.length;be++){const Ae=ee[be];if(Ae&&!ve[Ae]){const Re=I.getUniformLocation(this.program,Ae);Re&&(ve[Ae]=Re)}}this.fixedUniforms=u(e,ve),this.terrainUniforms=((be,Ae)=>({u_depth:new c.bC(be,Ae.u_depth),u_terrain:new c.bC(be,Ae.u_terrain),u_terrain_dim:new c.b5(be,Ae.u_terrain_dim),u_terrain_matrix:new c.bD(be,Ae.u_terrain_matrix),u_terrain_unpack:new c.bE(be,Ae.u_terrain_unpack),u_terrain_exaggeration:new c.b5(be,Ae.u_terrain_exaggeration)}))(e,ve),this.projectionUniforms=((be,Ae)=>({u_projection_matrix:new c.bD(be,Ae.u_projection_matrix),u_projection_tile_mercator_coords:new c.bE(be,Ae.u_projection_tile_mercator_coords),u_projection_clipping_plane:new c.bE(be,Ae.u_projection_clipping_plane),u_projection_transition:new c.b5(be,Ae.u_projection_transition),u_projection_fallback_matrix:new c.bD(be,Ae.u_projection_fallback_matrix)}))(e,ve),this.binderUniforms=o?o.getUniforms(e,ve):[]}draw(e,r,o,u,f,y,w,S,I,A,k,R,O,V,X,W,K,ee,se){const oe=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.setDepthMode(o),e.setStencilMode(u),e.setColorMode(f),e.setCullFace(y),S){e.activeTexture.set(oe.TEXTURE2),oe.bindTexture(oe.TEXTURE_2D,S.depthTexture),e.activeTexture.set(oe.TEXTURE3),oe.bindTexture(oe.TEXTURE_2D,S.texture);for(const he in this.terrainUniforms)this.terrainUniforms[he].set(S[he])}if(I)for(const he in I)this.projectionUniforms[za[he]].set(I[he]);if(w)for(const he in this.fixedUniforms)this.fixedUniforms[he].set(w[he]);W&&W.setUniforms(e,this.binderUniforms,V,{zoom:X});let le=0;switch(r){case oe.LINES:le=2;break;case oe.TRIANGLES:le=3;break;case oe.LINE_STRIP:le=1}for(const he of O.get()){const ue=he.vaos||(he.vaos={});(ue[A]||(ue[A]=new Kl)).bind(e,this,k,W?W.getPaintVertexBuffers():[],R,he.vertexOffset,K,ee,se),oe.drawElements(r,he.primitiveLength*le,oe.UNSIGNED_SHORT,he.primitiveOffset*le*2)}}}function Ou(d,e,r){const o=1/c.at(r,1,e.transform.tileZoom),u=Math.pow(2,r.tileID.overscaledZ),f=r.tileSize*Math.pow(2,e.transform.tileZoom)/u,y=f*(r.tileID.canonical.x+r.tileID.wrap*u),w=f*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[o,d.fromScale,d.toScale],u_fade:d.t,u_pixel_coord_upper:[y>>16,w>>16],u_pixel_coord_lower:[65535&y,65535&w]}}const yn=(d,e,r,o)=>{const u=d.style.light,f=u.properties.get("position"),y=[f.x,f.y,f.z],w=c.bI();u.properties.get("anchor")==="viewport"&&c.bJ(w,d.transform.bearingInRadians),c.bK(y,y,w);const S=d.transform.transformLightDirection(y),I=u.properties.get("color");return{u_lightpos:y,u_lightpos_globe:S,u_lightintensity:u.properties.get("intensity"),u_lightcolor:[I.r,I.g,I.b],u_vertical_gradient:+e,u_opacity:r,u_fill_translate:o}},$p=(d,e,r,o,u,f,y)=>c.e(yn(d,e,r,o),Ou(f,d,y),{u_height_factor:-Math.pow(2,u.overscaledZ)/y.tileSize/8}),Jl=(d,e,r,o)=>c.e(Ou(e,d,r),{u_fill_translate:o}),Up=(d,e)=>({u_world:d,u_fill_translate:e}),Nu=(d,e,r,o,u)=>c.e(Jl(d,e,r,u),{u_world:o}),Ql=(d,e,r,o,u)=>{const f=d.transform;let y,w,S=0;if(r.paint.get("circle-pitch-alignment")==="map"){const I=c.at(e,1,f.zoom);
746y=!0,w=[I,I],S=I/(c.X*Math.pow(2,e.tileID.overscaledZ))*2*Math.PI*u}else y=!1,w=f.pixelsToGLUnits;return{u_camera_to_center_distance:f.cameraToCenterDistance,u_scale_with_map:+(r.paint.get("circle-pitch-scale")==="map"),u_pitch_with_map:+y,u_device_pixel_ratio:d.pixelRatio,u_extrude_scale:w,u_globe_extrude_scale:S,u_translate:o}},ju=d=>({u_pixel_extrude_scale:[1/d.width,1/d.height]}),Vu=d=>({u_viewport_size:[d.width,d.height]}),ec=(d,e=1)=>({u_color:d,u_overlay:0,u_overlay_scale:e}),tc=(d,e,r,o)=>{const u=c.at(d,1,e)/(c.X*Math.pow(2,d.tileID.overscaledZ))*2*Math.PI*o;return{u_extrude_scale:c.at(d,1,e),u_intensity:r,u_globe_extrude_scale:u}},qs=(d,e,r,o)=>{const u=c.H();c.bL(u,0,d.width,d.height,0,0,1);const f=d.context.gl;return{u_matrix:u,u_world:[f.drawingBufferWidth,f.drawingBufferHeight],u_image:r,u_color_ramp:o,u_opacity:e.paint.get("heatmap-opacity")}},$u=(d,e,r)=>{const o=r.paint.get("hillshade-shadow-color"),u=r.paint.get("hillshade-highlight-color"),f=r.paint.get("hillshade-accent-color");let y=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);return r.paint.get("hillshade-illumination-anchor")==="viewport"&&(y+=d.transform.bearingInRadians),{u_image:0,u_latrange:Ra(0,e.tileID),u_light:[r.paint.get("hillshade-exaggeration"),y],u_shadow:o,u_highlight:u,u_accent:f}},Uu=(d,e)=>{const r=e.stride,o=c.H();return c.bL(o,0,c.X,-8192,0,0,1),c.J(o,o,[0,-8192,0]),{u_matrix:o,u_image:1,u_dimension:[r,r],u_zoom:d.overscaledZ,u_unpack:e.getUnpackVector()}};function Ra(d,e){const r=Math.pow(2,e.canonical.z),o=e.canonical.y;
vendor: 9,105 bytes, line 746
746return[new c.Y(0,o/r).toLngLat().lat,new c.Y(0,(o+1)/r).toLngLat().lat]}const rc=(d,e,r,o)=>{const u=d.transform;return{u_translation:sc(d,e,r),u_ratio:o/c.at(e,1,u.zoom),u_device_pixel_ratio:d.pixelRatio,u_units_to_pixels:[1/u.pixelsToGLUnits[0],1/u.pixelsToGLUnits[1]]}},Io=(d,e,r,o,u)=>c.e(rc(d,e,r,o),{u_image:0,u_image_height:u}),Zp=(d,e,r,o,u)=>{const f=d.transform,y=ic(e,f);return{u_translation:sc(d,e,r),u_texsize:e.imageAtlasTexture.size,u_ratio:o/c.at(e,1,f.zoom),u_device_pixel_ratio:d.pixelRatio,u_image:0,u_scale:[y,u.fromScale,u.toScale],u_fade:u.t,u_units_to_pixels:[1/f.pixelsToGLUnits[0],1/f.pixelsToGLUnits[1]]}},qp=(d,e,r,o,u,f)=>{const y=d.lineAtlas,w=ic(e,d.transform),S=r.layout.get("line-cap")==="round",I=y.getDash(u.from,S),A=y.getDash(u.to,S),k=I.width*f.fromScale,R=A.width*f.toScale;return c.e(rc(d,e,r,o),{u_patternscale_a:[w/k,-I.height/2],u_patternscale_b:[w/R,-A.height/2],u_sdfgamma:y.width/(256*Math.min(k,R)*d.pixelRatio)/2,u_image:0,u_tex_y_a:I.y,u_tex_y_b:A.y,u_mix:f.t})};function ic(d,e){return 1/c.at(d,1,e.tileZoom)}function sc(d,e,r){return c.au(d.transform,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}const Zu=(d,e,r,o,u)=>{return{u_tl_parent:d,u_scale_parent:e,u_buffer_scale:1,u_fade_t:r.mix,u_opacity:r.opacity*o.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:o.paint.get("raster-brightness-min"),u_brightness_high:o.paint.get("raster-brightness-max"),u_saturation_factor:(y=o.paint.get("raster-saturation"),y>0?1-1/(1.001-y):-y),u_contrast_factor:(f=o.paint.get("raster-contrast"),f>0?1/(1-f):1+f),u_spin_weights:nc(o.paint.get("raster-hue-rotate")),u_coords_top:[u[0].x,u[0].y,u[1].x,u[1].y],u_coords_bottom:[u[3].x,u[3].y,u[2].x,u[2].y]};var f,y};function nc(d){d*=Math.PI/180;const e=Math.sin(d),r=Math.cos(d);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}const ac=(d,e,r,o,u,f,y,w,S,I,A,k,R)=>{const O=y.transform;return{u_is_size_zoom_constant:+(d==="constant"||d==="source"),u_is_size_feature_constant:+(d==="constant"||d==="camera"),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:O.cameraToCenterDistance,u_pitch:O.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:O.width/O.height,u_fade_change:y.options.fadeDuration?y.symbolFadeChange:1,u_label_plane_matrix:w,u_coord_matrix:S,u_is_text:+A,u_pitch_with_map:+o,u_is_along_line:u,u_is_variable_anchor:f,u_texsize:k,u_texture:0,u_translation:I,u_pitched_scale:R}},Da=(d,e,r,o,u,f,y,w,S,I,A,k,R,O)=>{const V=y.transform;return c.e(ac(d,e,r,o,u,f,y,w,S,I,A,k,O),{u_gamma_scale:o?Math.cos(V.pitch*Math.PI/180)*V.cameraToCenterDistance:1,u_device_pixel_ratio:y.pixelRatio,u_is_halo:1})},As=(d,e,r,o,u,f,y,w,S,I,A,k,R)=>c.e(Da(d,e,r,o,u,f,y,w,S,I,!0,A,0,R),{u_texsize_icon:k,u_texture_icon:1}),oc=(d,e)=>({u_opacity:d,u_color:e}),lc=(d,e,r,o,u)=>c.e(function(f,y,w,S){const I=w.imageManager.getPattern(f.from.toString()),A=w.imageManager.getPattern(f.to.toString()),{width:k,height:R}=w.imageManager.getPixelSize(),O=Math.pow(2,S.tileID.overscaledZ),V=S.tileSize*Math.pow(2,w.transform.tileZoom)/O,X=V*(S.tileID.canonical.x+S.tileID.wrap*O),W=V*S.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:I.tl,u_pattern_br_a:I.br,u_pattern_tl_b:A.tl,u_pattern_br_b:A.br,u_texsize:[k,R],u_mix:y.t,u_pattern_size_a:I.displaySize,u_pattern_size_b:A.displaySize,u_scale_a:y.fromScale,u_scale_b:y.toScale,u_tile_units_to_pixels:1/c.at(S,1,w.transform.tileZoom),u_pixel_coord_upper:[X>>16,W>>16],u_pixel_coord_lower:[65535&X,65535&W]}}(r,u,e,o),{u_opacity:d}),Co=(d,e)=>{},qu={fillExtrusion:(d,e)=>({u_lightpos:new c.bG(d,e.u_lightpos),u_lightpos_globe:new c.bG(d,e.u_lightpos_globe),u_lightintensity:new c.b5(d,e.u_lightintensity),u_lightcolor:new c.bG(d,e.u_lightcolor),u_vertical_gradient:new c.b5(d,e.u_vertical_gradient),u_opacity:new c.b5(d,e.u_opacity),u_fill_translate:new c.bH(d,e.u_fill_translate)}),fillExtrusionPattern:(d,e)=>({u_lightpos:new c.bG(d,e.u_lightpos),u_lightpos_globe:new c.bG(d,e.u_lightpos_globe),u_lightintensity:new c.b5(d,e.u_lightintensity),u_lightcolor:new c.bG(d,e.u_lightcolor),u_vertical_gradient:new c.b5(d,e.u_vertical_gradient),u_height_factor:new c.b5(d,e.u_height_factor),u_opacity:new c.b5(d,e.u_opacity),u_fill_translate:new c.bH(d,e.u_fill_translate),u_image:new c.bC(d,e.u_image),u_texsize:new c.bH(d,e.u_texsize),u_pixel_coord_upper:new c.bH(d,e.u_pixel_coord_upper),u_pixel_coord_lower:new c.bH(d,e.u_pixel_coord_lower),u_scale:new c.bG(d,e.u_scale),u_fade:new c.b5(d,e.u_fade)}),fill:(d,e)=>({u_fill_translate:new c.bH(d,e.u_fill_translate)}),fillPattern:(d,e)=>({u_image:new c.bC(d,e.u_image),u_texsize:new c.bH(d,e.u_texsize),u_pixel_coord_upper:new c.bH(d,e.u_pixel_coord_upper),u_pixel_coord_lower:new c.bH(d,e.u_pixel_coord_lower),u_scale:new c.bG(d,e.u_scale),u_fade:new c.b5(d,e.u_fade),u_fill_translate:new c.bH(d,e.u_fill_translate)}),fillOutline:(d,e)=>({u_world:new c.bH(d,e.u_world),u_fill_translate:new c.bH(d,e.u_fill_translate)}),fillOutlinePattern:(d,e)=>({u_world:new c.bH(d,e.u_world),u_image:new c.bC(d,e.u_image),u_texsize:new c.bH(d,e.u_texsize),u_pixel_coord_upper:new c.bH(d,e.u_pixel_coord_upper),u_pixel_coord_lower:new c.bH(d,e.u_pixel_coord_lower),u_scale:new c.bG(d,e.u_scale),u_fade:new c.b5(d,e.u_fade),u_fill_translate:new c.bH(d,e.u_fill_translate)}),circle:(d,e)=>({u_camera_to_center_distance:new c.b5(d,e.u_camera_to_center_distance),u_scale_with_map:new c.bC(d,e.u_scale_with_map),u_pitch_with_map:new c.bC(d,e.u_pitch_with_map),u_extrude_scale:new c.bH(d,e.u_extrude_scale),u_device_pixel_ratio:new c.b5(d,e.u_device_pixel_ratio),u_globe_extrude_scale:new c.b5(d,e.u_globe_extrude_scale),u_translate:new c.bH(d,e.u_translate)}),collisionBox:(d,e)=>({u_pixel_extrude_scale:new c.bH(d,e.u_pixel_extrude_scale)}),collisionCircle:(d,e)=>({u_viewport_size:new c.bH(d,e.u_viewport_size)}),debug:(d,e)=>({u_color:new c.bF(d,e.u_color),u_overlay:new c.bC(d,e.u_overlay),u_overlay_scale:new c.b5(d,e.u_overlay_scale)}),depth:Co,clippingMask:Co,heatmap:(d,e)=>({u_extrude_scale:new c.b5(d,e.u_extrude_scale),u_intensity:new c.b5(d,e.u_intensity),u_globe_extrude_scale:new c.b5(d,e.u_globe_extrude_scale)}),heatmapTexture:(d,e)=>({u_matrix:new c.bD(d,e.u_matrix),u_world:new c.bH(d,e.u_world),u_image:new c.bC(d,e.u_image),u_color_ramp:new c.bC(d,e.u_color_ramp),u_opacity:new c.b5(d,e.u_opacity)}),hillshade:(d,e)=>({u_image:new c.bC(d,e.u_image),u_latrange:new c.bH(d,e.u_latrange),u_light:new c.bH(d,e.u_light),u_shadow:new c.bF(d,e.u_shadow),u_highlight:new c.bF(d,e.u_highlight),u_accent:new c.bF(d,e.u_accent)}),hillshadePrepare:(d,e)=>({u_matrix:new c.bD(d,e.u_matrix),u_image:new c.bC(d,e.u_image),u_dimension:new c.bH(d,e.u_dimension),u_zoom:new c.b5(d,e.u_zoom),u_unpack:new c.bE(d,e.u_unpack)}),line:(d,e)=>({u_translation:new c.bH(d,e.u_translation),u_ratio:new c.b5(d,e.u_ratio),u_device_pixel_ratio:new c.b5(d,e.u_device_pixel_ratio),u_units_to_pixels:new c.bH(d,e.u_units_to_pixels)}),lineGradient:(d,e)=>({u_translation:new c.bH(d,e.u_translation),u_ratio:new c.b5(d,e.u_ratio),u_device_pixel_ratio:new c.b5(d,e.u_device_pixel_ratio),u_units_to_pixels:new c.bH(d,e.u_units_to_pixels),u_image:new c.bC(d,e.u_image),u_image_height:new c.b5(d,e.u_image_height)}),linePattern:(d,e)=>({u_translation:new c.bH(d,e.u_translation),u_texsize:new c.bH(d,e.u_texsize),u_ratio:new c.b5(d,e.u_ratio),u_device_pixel_ratio:new c.b5(d,e.u_device_pixel_ratio),u_image:new c.bC(d,e.u_image),u_units_to_pixels:new c.bH(d,e.u_units_to_pixels),u_scale:new c.bG(d,e.u_scale),u_fade:new c.b5(d,e.u_fade)}),lineSDF:(d,e)=>({u_translation:new c.bH(d,e.u_translation),u_ratio:new c.b5(d,e.u_ratio),u_device_pixel_ratio:new c.b5(d,e.u_device_pixel_ratio),u_units_to_pixels:new c.bH(d,e.u_units_to_pixels),u_patternscale_a:new c.bH(d,e.u_patternscale_a),u_patternscale_b:new c.bH(d,e.u_patternscale_b),u_sdfgamma:new c.b5(d,e.u_sdfgamma),u_image:new c.bC(d,e.u_image),u_tex_y_a:new c.b5(d,e.u_tex_y_a),u_tex_y_b:new c.b5(d,e.u_tex_y_b),u_mix:new c.b5(d,e.u_mix)}),raster:(d,e)=>({u_tl_parent:new c.bH(d,e.u_tl_parent),u_scale_parent:new c.b5(d,e.u_scale_parent),u_buffer_scale:new c.b5(d,e.u_buffer_scale),u_fade_t:new c.b5(d,e.u_fade_t),u_opacity:new c.b5(d,e.u_opacity),u_image0:new c.bC(d,e.u_image0),u_image1:new c.bC(d,e.u_image1),u_brightness_low:new c.b5(d,e.u_brightness_low),u_brightness_high:new c.b5(d,e.u_brightness_high),u_saturation_factor:new c.b5(d,e.u_saturation_factor),u_contrast_factor:new c.b5(d,e.u_contrast_factor),u_spin_weights:new c.bG(d,e.u_spin_weights),u_coords_top:new c.bE(d,e.u_coords_top),u_coords_bottom:new c.bE(d,e.u_coords_bottom)}),symbolIcon:(d,e)=>({u_is_size_zoom_constant:new c.bC(d,e.u_is_size_zoom_constant),u_is_size_feature_constant:new c.bC(d,e.u_is_size_feature_constant),u_size_t:new c.b5(d,e.u_size_t),u_size:new c.b5(d,e.u_size),u_camera_to_center_distance:new c.b5(d,e.u_camera_to_center_distance),u_pitch:new c.b5(d,e.u_pitch),u_rotate_symbol:new c.bC(d,e.u_rotate_symbol),u_aspect_ratio:new c.b5(d,e.u_aspect_ratio),u_fade_change:new c.b5(d,e.u_fade_change),u_label_plane_matrix:new c.bD(d,e.u_label_plane_matrix
vendor: 29,183 bytes, line 746
746),u_coord_matrix:new c.bD(d,e.u_coord_matrix),u_is_text:new c.bC(d,e.u_is_text),u_pitch_with_map:new c.bC(d,e.u_pitch_with_map),u_is_along_line:new c.bC(d,e.u_is_along_line),u_is_variable_anchor:new c.bC(d,e.u_is_variable_anchor),u_texsize:new c.bH(d,e.u_texsize),u_texture:new c.bC(d,e.u_texture),u_translation:new c.bH(d,e.u_translation),u_pitched_scale:new c.b5(d,e.u_pitched_scale)}),symbolSDF:(d,e)=>({u_is_size_zoom_constant:new c.bC(d,e.u_is_size_zoom_constant),u_is_size_feature_constant:new c.bC(d,e.u_is_size_feature_constant),u_size_t:new c.b5(d,e.u_size_t),u_size:new c.b5(d,e.u_size),u_camera_to_center_distance:new c.b5(d,e.u_camera_to_center_distance),u_pitch:new c.b5(d,e.u_pitch),u_rotate_symbol:new c.bC(d,e.u_rotate_symbol),u_aspect_ratio:new c.b5(d,e.u_aspect_ratio),u_fade_change:new c.b5(d,e.u_fade_change),u_label_plane_matrix:new c.bD(d,e.u_label_plane_matrix),u_coord_matrix:new c.bD(d,e.u_coord_matrix),u_is_text:new c.bC(d,e.u_is_text),u_pitch_with_map:new c.bC(d,e.u_pitch_with_map),u_is_along_line:new c.bC(d,e.u_is_along_line),u_is_variable_anchor:new c.bC(d,e.u_is_variable_anchor),u_texsize:new c.bH(d,e.u_texsize),u_texture:new c.bC(d,e.u_texture),u_gamma_scale:new c.b5(d,e.u_gamma_scale),u_device_pixel_ratio:new c.b5(d,e.u_device_pixel_ratio),u_is_halo:new c.bC(d,e.u_is_halo),u_translation:new c.bH(d,e.u_translation),u_pitched_scale:new c.b5(d,e.u_pitched_scale)}),symbolTextAndIcon:(d,e)=>({u_is_size_zoom_constant:new c.bC(d,e.u_is_size_zoom_constant),u_is_size_feature_constant:new c.bC(d,e.u_is_size_feature_constant),u_size_t:new c.b5(d,e.u_size_t),u_size:new c.b5(d,e.u_size),u_camera_to_center_distance:new c.b5(d,e.u_camera_to_center_distance),u_pitch:new c.b5(d,e.u_pitch),u_rotate_symbol:new c.bC(d,e.u_rotate_symbol),u_aspect_ratio:new c.b5(d,e.u_aspect_ratio),u_fade_change:new c.b5(d,e.u_fade_change),u_label_plane_matrix:new c.bD(d,e.u_label_plane_matrix),u_coord_matrix:new c.bD(d,e.u_coord_matrix),u_is_text:new c.bC(d,e.u_is_text),u_pitch_with_map:new c.bC(d,e.u_pitch_with_map),u_is_along_line:new c.bC(d,e.u_is_along_line),u_is_variable_anchor:new c.bC(d,e.u_is_variable_anchor),u_texsize:new c.bH(d,e.u_texsize),u_texsize_icon:new c.bH(d,e.u_texsize_icon),u_texture:new c.bC(d,e.u_texture),u_texture_icon:new c.bC(d,e.u_texture_icon),u_gamma_scale:new c.b5(d,e.u_gamma_scale),u_device_pixel_ratio:new c.b5(d,e.u_device_pixel_ratio),u_is_halo:new c.bC(d,e.u_is_halo),u_translation:new c.bH(d,e.u_translation),u_pitched_scale:new c.b5(d,e.u_pitched_scale)}),background:(d,e)=>({u_opacity:new c.b5(d,e.u_opacity),u_color:new c.bF(d,e.u_color)}),backgroundPattern:(d,e)=>({u_opacity:new c.b5(d,e.u_opacity),u_image:new c.bC(d,e.u_image),u_pattern_tl_a:new c.bH(d,e.u_pattern_tl_a),u_pattern_br_a:new c.bH(d,e.u_pattern_br_a),u_pattern_tl_b:new c.bH(d,e.u_pattern_tl_b),u_pattern_br_b:new c.bH(d,e.u_pattern_br_b),u_texsize:new c.bH(d,e.u_texsize),u_mix:new c.b5(d,e.u_mix),u_pattern_size_a:new c.bH(d,e.u_pattern_size_a),u_pattern_size_b:new c.bH(d,e.u_pattern_size_b),u_scale_a:new c.b5(d,e.u_scale_a),u_scale_b:new c.b5(d,e.u_scale_b),u_pixel_coord_upper:new c.bH(d,e.u_pixel_coord_upper),u_pixel_coord_lower:new c.bH(d,e.u_pixel_coord_lower),u_tile_units_to_pixels:new c.b5(d,e.u_tile_units_to_pixels)}),terrain:(d,e)=>({u_texture:new c.bC(d,e.u_texture),u_ele_delta:new c.b5(d,e.u_ele_delta),u_fog_matrix:new c.bD(d,e.u_fog_matrix),u_fog_color:new c.bF(d,e.u_fog_color),u_fog_ground_blend:new c.b5(d,e.u_fog_ground_blend),u_fog_ground_blend_opacity:new c.b5(d,e.u_fog_ground_blend_opacity),u_horizon_color:new c.bF(d,e.u_horizon_color),u_horizon_fog_blend:new c.b5(d,e.u_horizon_fog_blend),u_is_globe_mode:new c.b5(d,e.u_is_globe_mode)}),terrainDepth:(d,e)=>({u_ele_delta:new c.b5(d,e.u_ele_delta)}),terrainCoords:(d,e)=>({u_texture:new c.bC(d,e.u_texture),u_terrain_coords_id:new c.b5(d,e.u_terrain_coords_id),u_ele_delta:new c.b5(d,e.u_ele_delta)}),projectionErrorMeasurement:(d,e)=>({u_input:new c.b5(d,e.u_input),u_output_expected:new c.b5(d,e.u_output_expected)}),atmosphere:(d,e)=>({u_sun_pos:new c.bG(d,e.u_sun_pos),u_atmosphere_blend:new c.b5(d,e.u_atmosphere_blend),u_globe_position:new c.bG(d,e.u_globe_position),u_globe_radius:new c.b5(d,e.u_globe_radius),u_inv_proj_matrix:new c.bD(d,e.u_inv_proj_matrix)}),sky:(d,e)=>({u_sky_color:new c.bF(d,e.u_sky_color),u_horizon_color:new c.bF(d,e.u_horizon_color),u_horizon:new c.bH(d,e.u_horizon),u_horizon_normal:new c.bH(d,e.u_horizon_normal),u_sky_horizon_blend:new c.b5(d,e.u_sky_horizon_blend),u_sky_blend:new c.b5(d,e.u_sky_blend)})};class cc{constructor(e,r,o){this.context=e;const u=e.gl;this.buffer=u.createBuffer(),this.dynamicDraw=!!o,this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),u.bufferData(u.ELEMENT_ARRAY_BUFFER,r.arrayBuffer,this.dynamicDraw?u.DYNAMIC_DRAW:u.STATIC_DRAW),this.dynamicDraw||delete r.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){const r=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),r.bufferSubData(r.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const vn={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class uc{constructor(e,r,o,u){this.length=r.length,this.attributes=o,this.itemSize=r.bytesPerElement,this.dynamicDraw=u,this.context=e;const f=e.gl;this.buffer=f.createBuffer(),e.bindVertexBuffer.set(this.buffer),f.bufferData(f.ARRAY_BUFFER,r.arrayBuffer,this.dynamicDraw?f.DYNAMIC_DRAW:f.STATIC_DRAW),this.dynamicDraw||delete r.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){if(e.length!==this.length)throw new Error(`Length of new data is ${e.length}, which doesn't match current length of ${this.length}`);const r=this.context.gl;this.bind(),r.bufferSubData(r.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,r){for(let o=0;o<this.attributes.length;o++){const u=r.attributes[this.attributes[o].name];u!==void 0&&e.enableVertexAttribArray(u)}}setVertexAttribPointers(e,r,o){for(let u=0;u<this.attributes.length;u++){const f=this.attributes[u],y=r.attributes[f.name];y!==void 0&&e.vertexAttribPointer(y,f.components,e[vn[f.type]],!1,this.itemSize,f.offset+this.itemSize*(o||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class Yt{constructor(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(e){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class Gp extends Yt{getDefault(){return c.b4.transparent}set(e){const r=this.current;(e.r!==r.r||e.g!==r.g||e.b!==r.b||e.a!==r.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class Hp extends Yt{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}}class Wp extends Yt{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}class Gu extends Yt{getDefault(){return[!0,!0,!0,!0]}set(e){const r=this.current;(e[0]!==r[0]||e[1]!==r[1]||e[2]!==r[2]||e[3]!==r[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class Xp extends Yt{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}}class Hu extends Yt{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}}class Eo extends Yt{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){const r=this.current;(e.func!==r.func||e.ref!==r.ref||e.mask!==r.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}}class Ao extends Yt{getDefault(){const e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){const r=this.current;(e[0]!==r[0]||e[1]!==r[1]||e[2]!==r[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}}class ko extends Yt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;e?r.enable(r.STENCIL_TEST):r.disable(r.STENCIL_TEST),this.current=e,this.dirty=!1}}class hc extends Yt{getDefault(){return[0,1]}set(e){const r=this.current;(e[0]!==r[0]||e[1]!==r[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}}class xn extends Yt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;e?r.enable(r.DEPTH_TEST):r.disable(r.DEPTH_TEST),this.current=e,this.dirty=!1}}class qn extends Yt{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}}class Ji extends Yt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;e?r.enable(r.BLEND):r.disable(r.BLEND),this.current=e,this.dirty=!1}}class Wu extends Yt{getDefault(){const e=this.gl;return[e.ONE,e.ZERO]}set(e){const r=this.current;(e[0]!==r[0]||e[1]!==r[1]||this.dirty)&&(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)}}class Xu extends Yt{getDefault(){return c.b4.transparent}set(e){const r=this.current;(e.r!==r.r||e.g!==r.g||e.b!==r.b||e.a!==r.a||this.dirty)&&(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class pc extends Yt{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquation(e),this.current=e,this.dirty=!1)}}class bn extends Yt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;e?r.enable(r.CULL_FACE):r.disable(r.CULL_FACE),this.current=e,this.dirty=!1}}class zo extends Yt{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}}class Ro extends Yt{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}}class La extends Yt{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}}class Do extends Yt{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}}class Yu extends Yt{getDefault(){const e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){const r=this.current;(e[0]!==r[0]||e[1]!==r[1]||e[2]!==r[2]||e[3]!==r[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class Gn extends Yt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;r.bindFramebuffer(r.FRAMEBUFFER,e),this.current=e,this.dirty=!1}}class Hn extends Yt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;r.bindRenderbuffer(r.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class Ku extends Yt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;r.bindTexture(r.TEXTURE_2D,e),this.current=e,this.dirty=!1}}class dc extends Yt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;r.bindBuffer(r.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class Ht extends Yt{getDefault(){return null}set(e){const r=this.gl;r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class Lo extends Yt{getDefault(){return null}set(e){var r;if(e===this.current&&!this.dirty)return;const o=this.gl;ls(o)?o.bindVertexArray(e):(r=o.getExtension("OES_vertex_array_object"))===null||r===void 0||r.bindVertexArrayOES(e),this.current=e,this.dirty=!1}}class Yp extends Yt{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;r.pixelStorei(r.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}}class Ju extends Yt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}}class Fa extends Yt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}}class fc extends Yt{constructor(e,r){super(e),this.context=e,this.parent=r}getDefault(){return null}}class Kp extends fc{setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const r=this.gl;r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class Qu extends fc{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const r=this.gl;r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class Jp extends fc{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const r=this.gl;r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,e),this.current=e,this.dirty=!1}}const Fo="Framebuffer is not complete";class Bo{constructor(e,r,o,u,f){this.context=e,this.width=r,this.height=o;const y=e.gl,w=this.framebuffer=y.createFramebuffer();if(this.colorAttachment=new Kp(e,w),u)this.depthAttachment=f?new Jp(e,w):new Qu(e,w);else if(f)throw new Error("Stencil cannot be set without depth");if(y.checkFramebufferStatus(y.FRAMEBUFFER)!==y.FRAMEBUFFER_COMPLETE)throw new Error(Fo)}destroy(){const e=this.context.gl,r=this.colorAttachment.get();if(r&&e.deleteTexture(r),this.depthAttachment){const o=this.depthAttachment.get();o&&e.deleteRenderbuffer(o)}e.deleteFramebuffer(this.framebuffer)}}class Oo{constructor(e){var r,o;if(this.gl=e,this.clearColor=new Gp(this),this.clearDepth=new Hp(this),this.clearStencil=new Wp(this),this.colorMask=new Gu(this),this.depthMask=new Xp(this),this.stencilMask=new Hu(this),this.stencilFunc=new Eo(this),this.stencilOp=new Ao(this),this.stencilTest=new ko(this),this.depthRange=new hc(this),this.depthTest=new xn(this),this.depthFunc=new qn(this),this.blend=new Ji(this),this.blendFunc=new Wu(this),this.blendColor=new Xu(this),this.blendEquation=new pc(this),this.cullFace=new bn(this),this.cullFaceSide=new zo(this),this.frontFace=new Ro(this),this.program=new La(this),this.activeTexture=new Do(this),this.viewport=new Yu(this),this.bindFramebuffer=new Gn(this),this.bindRenderbuffer=new Hn(this),this.bindTexture=new Ku(this),this.bindVertexBuffer=new dc(this),this.bindElementBuffer=new Ht(this),this.bindVertexArray=new Lo(this),this.pixelStoreUnpack=new Yp(this),this.pixelStoreUnpackPremultiplyAlpha=new Ju(this),this.pixelStoreUnpackFlipY=new Fa(this),this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),ls(e)){this.HALF_FLOAT=e.HALF_FLOAT;const u=e.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(r=e.RGBA16F)!==null&&r!==void 0?r:u==null?void 0:u.RGBA16F_EXT,this.RGB16F=(o=e.RGB16F)!==null&&o!==void 0?o:u==null?void 0:u.RGB16F_EXT,e.getExtension("EXT_color_buffer_float")}else{e.getExtension("EXT_color_buffer_half_float"),e.getExtension("OES_texture_half_float_linear");const u=e.getExtension("OES_texture_half_float");this.HALF_FLOAT=u==null?void 0:u.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(e,r){return new cc(this,e,r)}createVertexBuffer(e,r,o){return new uc(this,e,r,o)}createRenderbuffer(e,r,o){const u=this.gl,f=u.createRenderbuffer();return this.bindRenderbuffer.set(f),u.renderbufferStorage(u.RENDERBUFFER,e,r,o),this.bindRenderbuffer.set(null),f}createFramebuffer(e,r,o,u){return new Bo(this,e,r,o,u)}clear({color:e,depth:r,stencil:o}){const u=this.gl;let f=0;e&&(f|=u.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),r!==void 0&&(f|=u.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),o!==void 0&&(f|=u.STENCIL_BUFFER_BIT,this.clearStencil.set(o),this.stencilMask.set(255)),u.clear(f)}setCullFace(e){e.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}setStencilMode(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)}setColorMode(e){c.bz(e.blendFunction,or.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)}createVertexArray(){var e;return ls(this.gl)?this.gl.createVertexArray():(e=this.gl.getExtension("OES_vertex_array_object"))===null||e===void 0?void 0:e.createVertexArrayOES()}deleteVertexArray(e){var r;return ls(this.gl)?this.gl.deleteVertexArray(e):(r=this.gl.getExtension("OES_vertex_array_object"))===null||r===void 0?void 0:r.deleteVertexArrayOES(e)}unbindVAO(){this.bindVertexArray.set(null)}}let Wn;function No(d,e,r,o,u){const f=d.context,y=d.transform,w=f.gl,S=d.useProgram("collisionBox"),I=[];let A=0,k=0;for(let K=0;K<o.length;K++){const ee=o[K],se=e.getTile(ee).getBucket(r);if(!se)continue;const oe=u?se.textCollisionBox:se.iconCollisionBox,le=se.collisionCircleArray;le.length>0&&(I.push({circleArray:le,circleOffset:k,coord:ee}),A+=le.length/4,k=A),oe&&S.draw(f,w.LINES,wt.disabled,Ut.disabled,d.colorModeForRenderPass(),Vt.disabled,ju(d.transform),d.style.map.terrain&&d.style.map.terrain.getTerrainData(ee),y.getProjectionData({overscaledTileID:ee,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),r.id,oe.layoutVertexBuffer,oe.indexBuffer,oe.segments,null,d.transform.zoom,null,null,oe.collisionVertexBuffer)}if(!u||!I.length)return;const R=d.useProgram("collisionCircle"),O=new c.bM;O.resize(4*A),O._trim();let V=0;for(const K of I)for(let ee=0;ee<K.circleArray.length/4;ee++){const se=4*ee,oe=K.circleArray[se+0],le=K.circleArray[se+1],he=K.circleArray[se+2],ue=K.circleArray[se+3];O.emplace(V++,oe,le,he,ue,0),O.emplace(V++,oe,le,he,ue,1),O.emplace(V++,oe,le,he,ue,2),O.emplace(V++,oe,le,he,ue,3)}(!Wn||Wn.length<2*A)&&(Wn=function(K){const ee=2*K,se=new c.bO;se.resize(ee),se._trim();for(let oe=0;oe<ee;oe++){const le=6*oe;se.uint16[le+0]=4*oe+0,se.uint16[le+1]=4*oe+1,se.uint16[le+2]=4*oe+2,se.uint16[le+3]=4*oe+2,se.uint16[le+4]=4*oe+3,se.uint16[le+5]=4*oe+0}return se}(A));const X=f.createIndexBuffer(Wn,!0),W=f.createVertexBuffer(O,c.bN.members,!0);for(const K of I){const ee=Vu(d.transform);R.draw(f,w.TRIANGLES,wt.disabled,Ut.disabled,d.colorModeForRenderPass(),Vt.disabled,ee,d.style.map.terrain&&d.style.map.terrain.getTerrainData(K.coord),null,r.id,W,X,c.aD.simpleSegment(0,2*K.circleOffset,K.circleArray.length,K.circleArray.length/2),null,d.transform.zoom,null,null,null)}W.destroy(),X.destroy()}const eh=c.aq(new Float32Array(16));function jo(d,e,r,o,u,f){const{horizontalAlign:y,verticalAlign:w}=c.ay(d);return new c.P((-(y-.5)*e/u+o[0])*f,(-(w-.5)*r/u+o[1])*f)}function Vo(d,e,r,o,u,f){const y=e.tileAnchorPoint.add(new c.P(e.translation[0],e.translation[1]));if(e.pitchWithMap){let w=o.mult(f);r||(w=w.rotate(-u));const S=y.add(w);return Pe(S.x,S.y,e.pitchedLabelPlaneMatrix,e.getElevation).point}if(r){const w=st(e.tileAnchorPoint.x+1,e.tileAnchorPoint.y,e).point.sub(d),S=Math.atan(w.y/w.x)+(w.x<0?Math.PI:0);return d.add(o.rotate(S))}return d.add(o)}function mc(d,e,r,o,u,f,y,w,S,I,A,k){const R=d.text.placedSymbolArray,O=d.text.dynamicLayoutVertexArray,V=d.icon.dynamicLayoutVertexArray,X={};O.clear();for(let W=0;W<R.length;W++){const K=R.get(W),ee=K.hidden||!K.crossTileID||d.allowVerticalPlacement&&!K.placedOrientation?null:o[K.crossTileID];if(ee){const se=new c.P(K.anchorX,K.anchorY),oe={getElevation:k,width:u.width,height:u.height,pitchedLabelPlaneMatrix:f,pitchWithMap:r,transform:u,tileAnchorPoint:se,translation:I,unwrappedTileID:A},le=r?$t(se.x,se.y,oe):st(se.x,se.y,oe),he=ye(u.cameraToCenterDistance,le.signedDistanceFromCamera);let ue=c.aj(d.textSizeData,w,K)*he/c.as;r&&(ue*=d.tilePixelRatio/y);const{width:ve,height:be,anchor:Ae,textOffset:Re,textBoxScale:Ie}=ee,Ge=jo(Ae,ve,be,Re,Ie,ue),Ue=u.getPitchedTextCorrection(se.x+I[0],se.y+I[1],A),De=Vo(le.point,oe,e,Ge,-u.bearingInRadians,Ue),Xe=d.allowVerticalPlacement&&K.placedOrientation===c.ai.vertical?Math.PI/2:0;for(let Tt=0;Tt<K.numGlyphs;Tt++)c.ak(O,De,Xe);S&&K.associatedIconIndex>=0&&(X[K.associatedIconIndex]={shiftedAnchor:De,angle:Xe})}else Zr(K.numGlyphs,O)}if(S){V.clear();const W=d.icon.placedSymbolArray;for(let K=0;K<W.length;K++){const ee=W.get(K);if(ee.hidden)Zr(ee.numGlyphs,V);else{const se=X[K];if(se)for(let oe=0;oe<ee.numGlyphs;oe++)c.ak(V,se.shiftedAnchor,se.angle);else Zr(ee.numGlyphs,V)}}d.icon.dynamicLayoutVertexBuffer.updateData(V)}d.text.dynamicLayoutVertexBuffer.updateData(O)}function Qp(d,e,r){return r.iconsInText&&e?"symbolTextAndIcon":d?"symbolSDF":"symbolIcon"}function $o(d,e,r,o,u,f,y,w,S,I,A,k,R){const O=d.context,V=O.gl,X=d.transform,W=w==="map",K=S==="map",ee=w!=="viewport"&&r.layout.get("symbol-placement")!=="point",se=W&&!K&&!ee,oe=!r.layout.get("symbol-sort-key").isConstant();let le=!1;const he=d.getDepthModeForSublayer(0,wt.ReadOnly),ue=r._unevaluatedLayout.hasValue("text-variable-anchor")||r._unevaluatedLayout.hasValue("text-variable-anchor-offset"),ve=[],be=X.getCircleRadiusCorrection();for(const Ae of o){const Re=e.getTile(Ae),Ie=Re.getBucket(r);if(!Ie)continue;const Ge=u?Ie.text:Ie.icon;if(!Ge||!Ge.segments.get().length||!Ge.hasVisibleVertices)continue;const Ue=Ge.programConfigurations.get(r.id),De=u||Ie.sdfIcons,Xe=u?Ie.textSizeData:Ie.iconSizeData,Tt=K||X.pitch!==0,Zt=d.useProgram(Qp(De,u,Ie),Ue),fr=c.ah(Xe,X.zoom),Qt=d.style.map.terrain&&d.style.map.terrain.getTerrainData(Ae);let mr,er,Kt,tr,ni=[0,0],Fr=null;if(u)er=Re.glyphAtlasTexture,Kt=V.LINEAR,mr=Re.glyphAtlasTexture.size,Ie.iconsInText&&(ni=Re.imageAtlasTexture.size,Fr=Re.imageAtlasTexture,tr=Tt||d.options.rotating||d.options.zooming||Xe.kind==="composite"||Xe.kind==="camera"?V.LINEAR:V.NEAREST);else{const rr=r.layout.get("icon-size").constantOr(0)!==1||Ie.iconsNeedLinear;er=Re.imageAtlasTexture,Kt=De||d.options.rotating||d.options.zooming||rr||Tt?V.LINEAR:V.NEAREST,mr=Re.imageAtlasTexture.size}const jr=c.at(Re,1,d.transform.zoom),mi=we(W,d.transform,jr),Ds=c.H();c.an(Ds,mi);const Ts=me(K,W,d.transform,jr),Oi=c.au(X,Re,f,y),Ls=X.getProjectionData({overscaledTileID:Ae,applyGlobeMatrix:!R,applyTerrainMatrix:!0}),Xa=ue&&Ie.hasTextData(),Ya=r.layout.get("icon-text-fit")!=="none"&&Xa&&Ie.hasIconData();if(ee){const rr=d.style.map.terrain?(ji,yr)=>d.style.map.terrain.getElevation(Ae,ji,yr):null,gr=r.layout.get("text-rotation-alignment")==="map";He(Ie,d,u,mi,Ds,K,I,gr,Ae.toUnwrapped(),X.width,X.height,Oi,rr)}const na=u&&ue||Ya,Ei=ee||na?eh:K?mi:d.transform.clipSpaceToPixelsMatrix,es=De&&r.paint.get(u?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let ts;ts=De?Ie.iconsInText?As(Xe.kind,fr,se,K,ee,na,d,Ei,Ts,Oi,mr,ni,be):Da(Xe.kind,fr,se,K,ee,na,d,Ei,Ts,Oi,u,mr,0,be):ac(Xe.kind,fr,se,K,ee,na,d,Ei,Ts,Oi,u,mr,be);const Ni={program:Zt,buffers:Ge,uniformValues:ts,projectionData:Ls,atlasTexture:er,atlasTextureIcon:Fr,atlasInterpolation:Kt,atlasInterpolationIcon:tr,isSDF:De,hasHalo:es};if(oe&&Ie.canOverlap){le=!0;const rr=Ge.segments.get();for(const gr of rr)ve.push({segments:new c.aD([gr]),sortKey:gr.sortKey,state:Ni,terrainData:Qt})}else ve.push({segments:Ge.segments,sortKey:0,state:Ni,terrainData:Qt})}le&&ve.sort((Ae,Re)=>Ae.sortKey-Re.sortKey);for(const Ae of ve){const Re=Ae.state;if(O.activeTexture.set(V.TEXTURE0),Re.atlasTexture.bind(Re.atlasInterpolation,V.CLAMP_TO_EDGE),Re.atlasTextureIcon&&(O.activeTexture.set(V.TEXTURE1),Re.atlasTextureIcon&&Re.atlasTextureIcon.bind(Re.atlasInterpolationIcon,V.CLAMP_TO_EDGE)),Re.isSDF){const Ie=Re.uniformValues;Re.hasHalo&&(Ie.u_is_halo=1,th(Re.buffers,Ae.segments,r,d,Re.program,he,A,k,Ie,Re.projectionData,Ae.terrainData)),Ie.u_is_halo=0}th(Re.buffers,Ae.segments,r,d,Re.program,he,A,k,Re.uniformValues,Re.projectionData,Ae.terrainData)}}function th(d,e,r,o,u,f,y,w,S,I,A){const k=o.context;u.draw(k,k.gl.TRIANGLES,f,y,w,Vt.backCCW,S,A,I,r.id,d.layoutVertexBuffer,d.indexBuffer,e,r.paint,o.transform.zoom,d.programConfigurations.get(r.id),d.dynamicLayoutVertexBuffer,d.opacityVertexBuffer)}function rh(d,e,r,o,u){const f=d.context,y=f.gl,w=Ut.disabled,S=new or([y.ONE,y.ONE],c.b4.transparent,[!0,!0,!0,!0]),I=e.getBucket(r);if(!I)return;const A=o.key;let k=r.heatmapFbos.get(A);k||(k=Zo(f,e.tileSize,e.tileSize),r.heatmapFbos.set(A,k)),f.bindFramebuffer.set(k.framebuffer),f.viewport.set([0,0,e.tileSize,e.tileSize]),f.clear({color:c.b4.transparent});const R=I.programConfigurations.get(r.id),O=d.useProgram("heatmap",R,!u),V=d.transform.getProjectionData({overscaledTileID:e.tileID,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),X=d.style.map.terrain.getTerrainData(o);O.draw(f,y.TRIANGLES,wt.disabled,w,S,Vt.disabled,tc(e,d.transform.zoom,r.paint.get("heatmap-intensity"),1),X,V,r.id,I.layoutVertexBuffer,I.indexBuffer,I.segments,r.paint,d.transform.zoom,R)}function Uo(d,e,r,o,u){const f=d.context,y=f.gl,w=d.transform;f.setColorMode(d.colorModeForRenderPass());const S=gc(f,e),I=r.key,A=e.heatmapFbos.get(I);if(!A)return;f.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,A.colorAttachment.get()),f.activeTexture.set(y.TEXTURE1),S.bind(y.LINEAR,y.CLAMP_TO_EDGE);const k=w.getProjectionData({overscaledTileID:r,applyTerrainMatrix:u,applyGlobeMatrix:!o});d.useProgram("heatmapTexture").draw(f,y.TRIANGLES,wt.disabled,Ut.disabled,d.colorModeForRenderPass(),Vt.disabled,qs(d,e,0,1),null,k,e.id,d.rasterBoundsBuffer,d.quadTriangleIndexBuffer,d.rasterBoundsSegments,e.paint,w.zoom),A.destroy(),e.heatmapFbos.delete(I)}function Zo(d,e,r){var o,u;const f=d.gl,y=f.createTexture();f.bindTexture(f.TEXTURE_2D,y),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.LINEAR),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.LINEAR);const w=(o=d.HALF_FLOAT)!==null&&o!==void 0?o:f.UNSIGNED_BYTE,S=(u=d.RGBA16F)!==null&&u!==void 0?u:f.RGBA;f.texImage2D(f.TEXTURE_2D,0,S,e,r,0,f.RGBA,w,null);const I=d.createFramebuffer(e,r,!1,!1);return I.colorAttachment.set(y),I}function gc(d,e){return e.colorRampTexture||(e.colorRampTexture=new pt(d,e.colorRamp,d.gl.RGBA)),e.colorRampTexture}function _c(d,e,r,o,u){if(!r||!o||!o.imageAtlas)return;const f=o.imageAtlas.patternPositions;let y=f[r.to.toString()],w=f[r.from.toString()];if(!y&&w&&(y=w),!w&&y&&(w=y),!y||!w){const S=u.getPaintProperty(e);y=f[S],w=f[S]}y&&w&&d.setConstantPatternPositions(y,w)}function Ba(d,e,r,o,u,f,y,w){const S=d.context.gl,I="fill-pattern",A=r.paint.get(I),k=A&&A.constantOr(1),R=r.getCrossfadeParameters();let O,V,X,W,K;const ee=d.transform,se=r.paint.get("fill-translate"),oe=r.paint.get("fill-translate-anchor");y?(V=k&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",O=S.LINES):(V=k?"fillPattern":"fill",O=S.TRIANGLES);const le=A.constantOr(null);for(const he of o){const ue=e.getTile(he);if(k&&!ue.patternsLoaded())continue;const ve=ue.getBucket(r);
746if(!ve)continue;const be=ve.programConfigurations.get(r.id),Ae=d.useProgram(V,be),Re=d.style.map.terrain&&d.style.map.terrain.getTerrainData(he);k&&(d.context.activeTexture.set(S.TEXTURE0),ue.imageAtlasTexture.bind(S.LINEAR,S.CLAMP_TO_EDGE),be.updatePaintBuffers(R)),_c(be,I,le,ue,r);const Ie=ee.getProjectionData({overscaledTileID:he,applyGlobeMatrix:!w,applyTerrainMatrix:!0}),Ge=c.au(ee,ue,se,oe);if(y){W=ve.indexBuffer2,K=ve.segments2;const De=[S.drawingBufferWidth,S.drawingBufferHeight];X=V==="fillOutlinePattern"&&k?Nu(d,R,ue,De,Ge):Up(De,Ge)}else W=ve.indexBuffer,K=ve.segments,X=k?Jl(d,R,ue,Ge):{u_fill_translate:Ge};let Ue;if(d.renderPass==="translucent"&&w){const[De]=d.getStencilConfigForOverlapAndUpdateStencilID(o);Ue=De[he.overscaledZ]}else Ue=d.stencilModeForClipping(he);Ae.draw(d.context,O,u,Ue,f,Vt.backCCW,X,Re,Ie,r.id,ve.layoutVertexBuffer,W,K,r.paint,d.transform.zoom,be)}}function Oa(d,e,r,o,u,f,y,w){const S=d.context,I=S.gl,A="fill-extrusion-pattern",k=r.paint.get(A),R=k.constantOr(1),O=r.getCrossfadeParameters(),V=r.paint.get("fill-extrusion-opacity"),X=k.constantOr(null),W=d.transform;for(const K of o){const ee=e.getTile(K),se=ee.getBucket(r);if(!se)continue;const oe=d.style.map.terrain&&d.style.map.terrain.getTerrainData(K),le=se.programConfigurations.get(r.id),he=d.useProgram(R?"fillExtrusionPattern":"fillExtrusion",le);R&&(d.context.activeTexture.set(I.TEXTURE0),ee.imageAtlasTexture.bind(I.LINEAR,I.CLAMP_TO_EDGE),le.updatePaintBuffers(O));const ue=W.getProjectionData({overscaledTileID:K,applyGlobeMatrix:!w,applyTerrainMatrix:!0});_c(le,A,X,ee,r);const ve=c.au(W,ee,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),be=r.paint.get("fill-extrusion-vertical-gradient"),Ae=R?$p(d,be,V,ve,K,O,ee):yn(d,be,V,ve);he.draw(S,S.gl.TRIANGLES,u,f,y,Vt.backCCW,Ae,oe,ue,r.id,se.layoutVertexBuffer,se.indexBuffer,se.segments,r.paint,d.transform.zoom,le,d.style.map.terrain&&se.centroidVertexBuffer)}}function yc(d,e,r,o,u,f,y,w,S){var I;const A=d.style.projection,k=d.context,R=d.transform,O=k.gl,V=d.useProgram("hillshade"),X=!d.options.moving;for(const W of o){const K=e.getTile(W),ee=K.fbo;if(!ee)continue;const se=A.getMeshFromTileID(k,W.canonical,w,!0,"raster"),oe=(I=d.style.map.terrain)===null||I===void 0?void 0:I.getTerrainData(W);k.activeTexture.set(O.TEXTURE0),O.bindTexture(O.TEXTURE_2D,ee.colorAttachment.get());const le=R.getProjectionData({overscaledTileID:W,aligned:X,applyGlobeMatrix:!S,applyTerrainMatrix:!0});V.draw(k,O.TRIANGLES,f,u[W.overscaledZ],y,Vt.backCCW,$u(d,K,r),oe,le,r.id,se.vertexBuffer,se.indexBuffer,se.segments)}}const qo=[new c.P(0,0),new c.P(c.X,0),new c.P(c.X,c.X),new c.P(0,c.X)];function pr(d,e,r,o,u,f,y,w,S=!1,I=!1){const A=o[o.length-1].overscaledZ,k=d.context,R=k.gl,O=d.useProgram("raster"),V=d.transform,X=d.style.projection,W=d.colorModeForRenderPass(),K=!d.options.moving;for(const ee of o){const se=d.getDepthModeForSublayer(ee.overscaledZ-A,r.paint.get("raster-opacity")===1?wt.ReadWrite:wt.ReadOnly,R.LESS),oe=e.getTile(ee);oe.registerFadeDuration(r.paint.get("raster-fade-duration"));const le=e.findLoadedParent(ee,0),he=e.findLoadedSibling(ee),ue=wn(oe,le||he||null,e,r,d.transform,d.style.map.terrain);let ve,be;const Ae=r.paint.get("raster-resampling")==="nearest"?R.NEAREST:R.LINEAR;k.activeTexture.set(R.TEXTURE0),oe.texture.bind(Ae,R.CLAMP_TO_EDGE,R.LINEAR_MIPMAP_NEAREST),k.activeTexture.set(R.TEXTURE1),le?(le.texture.bind(Ae,R.CLAMP_TO_EDGE,R.LINEAR_MIPMAP_NEAREST),ve=Math.pow(2,le.tileID.overscaledZ-oe.tileID.overscaledZ),be=[oe.tileID.canonical.x*ve%1,oe.tileID.canonical.y*ve%1]):oe.texture.bind(Ae,R.CLAMP_TO_EDGE,R.LINEAR_MIPMAP_NEAREST),oe.texture.useMipmap&&k.extTextureFilterAnisotropic&&d.transform.pitch>20&&R.texParameterf(R.TEXTURE_2D,k.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,k.extTextureFilterAnisotropicMax);const Re=d.style.map.terrain&&d.style.map.terrain.getTerrainData(ee),Ie=V.getProjectionData({overscaledTileID:ee,aligned:K,applyGlobeMatrix:!I,applyTerrainMatrix:!0}),Ge=Zu(be||[0,0],ve||1,ue,r,w),Ue=X.getMeshFromTileID(k,ee.canonical,f,y,"raster");O.draw(k,R.TRIANGLES,se,u?u[ee.overscaledZ]:Ut.disabled,W,S?Vt.frontCCW:Vt.backCCW,Ge,Re,Ie,r.id,Ue.vertexBuffer,
vendor: 4,343 bytes, line 746
746Ue.indexBuffer,Ue.segments)}}function wn(d,e,r,o,u,f){const y=o.paint.get("raster-fade-duration");if(!f&&y>0){const w=ge.now(),S=(w-d.timeAdded)/y,I=e?(w-e.timeAdded)/y:-1,A=r.getSource(),k=os(u,{tileSize:A.tileSize,roundZoom:A.roundZoom}),R=!e||Math.abs(e.tileID.overscaledZ-k)>Math.abs(d.tileID.overscaledZ-k),O=R&&d.refreshedUponExpiration?1:c.ab(R?S:1-I,0,1);return d.refreshedUponExpiration&&S>=1&&(d.refreshedUponExpiration=!1),e?{opacity:1,mix:1-O}:{opacity:O,mix:0}}return{opacity:1,mix:0}}const Qi=new c.b4(1,0,0,1),vc=new c.b4(0,1,0,1),xc=new c.b4(0,0,1,1),ih=new c.b4(1,0,1,1),Xn=new c.b4(0,1,1,1);function Yn(d,e,r,o){Na(d,0,e+r/2,d.transform.width,r,o)}function Go(d,e,r,o){Na(d,e-r/2,0,r,d.transform.height,o)}function Na(d,e,r,o,u,f){const y=d.context,w=y.gl;w.enable(w.SCISSOR_TEST),w.scissor(e*d.pixelRatio,r*d.pixelRatio,o*d.pixelRatio,u*d.pixelRatio),y.clear({color:f}),w.disable(w.SCISSOR_TEST)}function sh(d,e,r){const o=d.context,u=o.gl,f=d.useProgram("debug"),y=wt.disabled,w=Ut.disabled,S=d.colorModeForRenderPass(),I="$debug",A=d.style.map.terrain&&d.style.map.terrain.getTerrainData(r);o.activeTexture.set(u.TEXTURE0);const k=e.getTileByID(r.key).latestRawTileData,R=Math.floor((k&&k.byteLength||0)/1024),O=e.getTile(r).tileSize,V=512/Math.min(O,512)*(r.overscaledZ/d.transform.zoom)*.5;let X=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(X+=` => ${r.overscaledZ}`),function(K,ee){K.initDebugOverlayCanvas();const se=K.debugOverlayCanvas,oe=K.context.gl,le=K.debugOverlayCanvas.getContext("2d");le.clearRect(0,0,se.width,se.height),le.shadowColor="white",le.shadowBlur=2,le.lineWidth=1.5,le.strokeStyle="white",le.textBaseline="top",le.font="bold 36px Open Sans, sans-serif",le.fillText(ee,5,5),le.strokeText(ee,5,5),K.debugOverlayTexture.update(se),K.debugOverlayTexture.bind(oe.LINEAR,oe.CLAMP_TO_EDGE)}(d,`${X} ${R}kB`);const W=d.transform.getProjectionData({overscaledTileID:r,applyGlobeMatrix:!0,applyTerrainMatrix:!0});f.draw(o,u.TRIANGLES,y,w,or.alphaBlended,Vt.disabled,ec(c.b4.transparent,V),null,W,I,d.debugBuffer,d.quadTriangleIndexBuffer,d.debugSegments),f.draw(o,u.LINE_STRIP,y,w,S,Vt.disabled,ec(c.b4.red),A,W,I,d.debugBuffer,d.tileBorderIndexBuffer,d.debugSegments)}function bc(d,e,r,o){const{isRenderingGlobe:u}=o,f=d.context,y=f.gl,w=d.transform,S=d.colorModeForRenderPass(),I=d.getDepthModeFor3D(),A=d.useProgram("terrain");f.bindFramebuffer.set(null),f.viewport.set([0,0,d.width,d.height]);for(const k of r){const R=e.getTerrainMesh(k.tileID),O=d.renderToTexture.getTexture(k),V=e.getTerrainData(k.tileID);f.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,O.texture);const X=e.getMeshFrameDelta(w.zoom),W=w.calculateFogMatrix(k.tileID.toUnwrapped()),K=ka(X,W,d.style.sky,w.pitch,u),ee=w.getProjectionData({overscaledTileID:k.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});A.draw(f,y.TRIANGLES,I,Ut.disabled,S,Vt.backCCW,K,V,ee,"terrain",R.vertexBuffer,R.indexBuffer,R.segments)}}function wc(d,e){if(!e.mesh){const r=new c.aC;r.emplaceBack(-1,-1),r.emplaceBack(1,-1),r.emplaceBack(1,1),r.emplaceBack(-1,1);const o=new c.aE;o.emplaceBack(0,1,2),o.emplaceBack(0,2,3),e.mesh=new vs(d.createVertexBuffer(r,zt.members),d.createIndexBuffer(o),c.aD.simpleSegment(0,0,r.length,o.length))}return e.mesh}class nh{constructor(e,r){this.context=new Oo(e),this.transform=r,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:c.aq(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=N.maxUnderzooming+N.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new dn}resize(e,r,o){if(this.width=Math.floor(e*o),this.height=Math.floor(r*o),this.pixelRatio=o,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const u of this.style._order)this.style._layers[u].resize()}setup(){const e=this.context,r=new c.aC;r.emplaceBack(0,0),r.emplaceBack(c.X,0),r.emplaceBack(0,c.X),r.emplaceBack(c.X,c.X),this.tileExtentBuffer=e.createVertexBuffer(r,zt.members),this.tileExtentSegments=c.aD.simpleSegment(0,0,4,2);const o=new c.aC;o.emplaceBack(0,0),o.emplaceBack(c.X,0),o.emplaceBack(0,c.X),o.emplaceBack(c.X,c.X),this.debugBuffer=e.createVertexBuffer(o,zt.members),this.debugSegments=c.aD.simpleSegment(0,0,4,5);const u=new c.bT;u.emplaceBack(0,0,0,0),u.emplaceBack(c.X,0,c.X,0),u.emplaceBack(0,c.X,0,c.X),u.emplaceBack(c.X,c.X,c.X,c.X
vendor: 8,648 bytes, line 746
746),this.rasterBoundsBuffer=e.createVertexBuffer(u,Vp.members),this.rasterBoundsSegments=c.aD.simpleSegment(0,0,4,2);const f=new c.aC;f.emplaceBack(0,0),f.emplaceBack(c.X,0),f.emplaceBack(0,c.X),f.emplaceBack(c.X,c.X),this.rasterBoundsBufferPosOnly=e.createVertexBuffer(f,zt.members),this.rasterBoundsSegmentsPosOnly=c.aD.simpleSegment(0,0,4,5);const y=new c.aC;y.emplaceBack(0,0),y.emplaceBack(1,0),y.emplaceBack(0,1),y.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(y,zt.members),this.viewportSegments=c.aD.simpleSegment(0,0,4,2);const w=new c.bU;w.emplaceBack(0),w.emplaceBack(1),w.emplaceBack(3),w.emplaceBack(2),w.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(w);const S=new c.aE;S.emplaceBack(1,0,2),S.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(S);const I=this.context.gl;this.stencilClearMode=new Ut({func:I.ALWAYS,mask:0},0,255,I.ZERO,I.ZERO,I.ZERO),this.tileExtentMesh=new vs(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){const e=this.context,r=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const o=c.H();c.bL(o,0,this.width,this.height,0,0,1),c.K(o,o,[r.drawingBufferWidth,r.drawingBufferHeight,0]);const u={mainMatrix:o,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:o};this.useProgram("clippingMask",null,!0).draw(e,r.TRIANGLES,wt.disabled,this.stencilClearMode,or.disabled,Vt.disabled,null,null,u,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(e,r,o){if(this.currentStencilSource===e.source||!e.isTileClipped()||!r||!r.length)return;this.currentStencilSource=e.source,this.nextStencilID+r.length>256&&this.clearStencil();const u=this.context;u.setColorMode(or.disabled),u.setDepthMode(wt.disabled);const f={};for(const y of r)f[y.key]=this.nextStencilID++;this._renderTileMasks(f,r,o,!0),this._renderTileMasks(f,r,o,!1),this._tileClippingMaskIDs=f}_renderTileMasks(e,r,o,u){const f=this.context,y=f.gl,w=this.style.projection,S=this.transform,I=this.useProgram("clippingMask");for(const A of r){const k=e[A.key],R=this.style.map.terrain&&this.style.map.terrain.getTerrainData(A),O=w.getMeshFromTileID(this.context,A.canonical,u,!0,"stencil"),V=S.getProjectionData({overscaledTileID:A,applyGlobeMatrix:!0,applyTerrainMatrix:!0});I.draw(f,y.TRIANGLES,wt.disabled,new Ut({func:y.ALWAYS,mask:0},k,255,y.KEEP,y.KEEP,y.REPLACE),or.disabled,o?Vt.disabled:Vt.backCCW,null,R,V,"$clipping",O.vertexBuffer,O.indexBuffer,O.segments)}}_renderTilesDepthBuffer(){const e=this.context,r=e.gl,o=this.style.projection,u=this.transform,f=this.useProgram("depth"),y=this.getDepthModeFor3D(),w=H(u,{tileSize:u.tileSize});for(const S of w){const I=this.style.map.terrain&&this.style.map.terrain.getTerrainData(S),A=o.getMeshFromTileID(this.context,S.canonical,!0,!0,"raster"),k=u.getProjectionData({overscaledTileID:S,applyGlobeMatrix:!0,applyTerrainMatrix:!0});f.draw(e,r.TRIANGLES,y,Ut.disabled,or.disabled,Vt.backCCW,null,I,k,"$clipping",A.vertexBuffer,A.indexBuffer,A.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const e=this.nextStencilID++,r=this.context.gl;return new Ut({func:r.NOTEQUAL,mask:255},e,255,r.KEEP,r.KEEP,r.REPLACE)}stencilModeForClipping(e){const r=this.context.gl;return new Ut({func:r.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,r.KEEP,r.KEEP,r.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(e){const r=this.context.gl,o=e.sort((y,w)=>w.overscaledZ-y.overscaledZ),u=o[o.length-1].overscaledZ,f=o[0].overscaledZ-u+1;if(f>1){this.currentStencilSource=void 0,this.nextStencilID+f>256&&this.clearStencil();const y={};for(let w=0;w<f;w++)y[w+u]=new Ut({func:r.GEQUAL,mask:255},w+this.nextStencilID,255,r.KEEP,r.KEEP,r.REPLACE);return this.nextStencilID+=f,[y,o]}return[{[u]:Ut.disabled},o]}stencilConfigForOverlapTwoPass(e){const r=this.context.gl,o=e.sort((y,w)=>w.overscaledZ-y.overscaledZ),u=o[o.length-1].overscaledZ,f=o[0].overscaledZ-u+1;if(this.clearStencil(),f>1){const y={},w={};for(let S=0;S<f;S++)y[S+u]=new Ut({func:r.GREATER,mask:255},f+1+S,255,r.KEEP,r.KEEP,r.REPLACE),w[S+u]=new Ut({func:r.GREATER,mask:255},1+S,255,r.KEEP,r.KEEP,r.REPLACE);return this.nextStencilID=2*f+1,[y,w,o]}return this.nextStencilID=3,[{[u]:new Ut({func:r.GREATER,mask:255},2,255,r.KEEP,r.KEEP,r.REPLACE)},{[u]:new Ut({func:r.GREATER,mask:255},1,255,r.KEEP,r.KEEP,r.REPLACE)},o]}colorModeForRenderPass(){const e=this.context.gl;return this._showOverdrawInspector?new or([e.CONSTANT_COLOR,e.ONE],new c.b4(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?or.unblended:or.alphaBlended}getDepthModeForSublayer(e,r,o){if(!this.opaquePassEnabledForLayer())return wt.disabled;const u=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new wt(o||this.context.gl.LEQUAL,r,[u,u])}getDepthModeFor3D(){return new wt(this.context.gl.LEQUAL,wt.ReadWrite,this.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(e,r){var o,u;this.style=e,this.options=r,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(ge.now()),this.imageManager.beginFrame();const f=this.style._order,y=this.style.sourceCaches,w={},S={},I={},A={isRenderingToTexture:!1,isRenderingGlobe:((o=e.projection)===null||o===void 0?void 0:o.transitionState)>0};for(const R in y){const O=y[R];O.used&&O.prepare(this.context),w[R]=O.getVisibleCoordinates(!1),S[R]=w[R].slice().reverse(),I[R]=O.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let R=0;R<f.length;R++)if(this.style._layers[f[R]].is3D()){this.opaquePassCutoff=R;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(const R of f){const O=this.style._layers[R];if(!O.hasOffscreenPass()||O.isHidden(this.transform.zoom))continue;const V=S[O.source];(O.type==="custom"||V.length)&&this.renderLayer(this,y[O.source],O,V,A)}if((u=this.style.projection)===null||u===void 0||u.updateGPUdependent({context:this.context,useProgram:R=>this.useProgram(R)}),this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:r.showOverdrawInspector?c.b4.black:c.b4.transparent,depth:1}),this.clearStencil(),this.style.sky&&function(R,O){const V=R.context,X=V.gl,W=((he,ue,ve)=>{const be=Math.cos(ue.rollInRadians),Ae=Math.sin(ue.rollInRadians),Re=_r(ue),Ie=ue.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition;return{u_sky_color:he.properties.get("sky-color"),u_horizon_color:he.properties.get("horizon-color"),u_horizon:[(ue.width/2-Re*Ae)*ve,(ue.height/2+Re*be)*ve],u_horizon_normal:[-Ae,be],u_sky_horizon_blend:he.properties.get("sky-horizon-blend")*ue.height/2*ve,u_sky_blend:Ie}})(O,R.style.map.transform,R.pixelRatio),K=new wt(X.LEQUAL,wt.ReadWrite,[0,1]),ee=Ut.disabled,se=R.colorModeForRenderPass(),oe=R.useProgram("sky"),le=wc(V,O);oe.draw(V,X.TRIANGLES,K,ee,se,Vt.disabled,W,null,void 0,"sky",le.vertexBuffer,le.indexBuffer,le.segments)}(this,this.style.sky),this._showOverdrawInspector=r.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=f.length-1;this.currentLayer>=0;this.currentLayer--){const R=this.style._layers[f[this.currentLayer]],O=y[R.source],V=w[R.source];this._renderTileClippingMasks(R,V,!1),this.renderLayer(this,O,R,V,A)}this.renderPass="translucent";let k=!1;for(this.currentLayer=0;this.currentLayer<f.length;this.currentLayer++){const R=this.style._layers[f[this.currentLayer]],O=y[R.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(R,A))continue;this.opaquePassEnabledForLayer()||k||(k=!0,A.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());const V=(R.type==="symbol"?I:S)[R.source];this._renderTileClippingMasks(R,w[R.source],!1),this.renderLayer(this,O,R,V,A)}if(A.isRenderingGlobe&&function(R,O,V){const X=R.context,W=X.gl,K=R.useProgram("atmosphere"),ee=new wt(W.LEQUAL,wt.ReadOnly,[0,1]),se=R.transform,oe=function(Ie,Ge){const Ue=Ie.properties.get("position"),De=[-Ue.x,-Ue.y,-Ue.z],Xe=c.aq(new Float64Array(16));return Ie.properties.get("anchor")==="map"&&(c.aX(Xe,Xe,Ge.rollInRadians),c.aY(Xe,Xe,-Ge.pitchInRadians),c.aX(Xe,Xe,Ge.bearingInRadians),c.aY(Xe,Xe,Ge.center.lat*Math.PI/180),c.bj(Xe,Xe,-Ge.center.lng*Math.PI/180)
746),c.bS(De,De,Xe),De}(V,R.transform),le=se.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),he=O.properties.get("atmosphere-blend")*le.projectionTransition;if(he===0)return;const ue=Un(se.worldSize,se.center.lat),ve=se.inverseProjectionMatrix,be=new Float64Array(4);be[3]=1,c.al(be,be,se.modelViewProjectionMatrix),be[0]/=be[3],be[1]/=be[3],be[2]/=be[3],be[3]=1,c.al(be,be,ve),be[0]/=be[3],be[1]/=be[3],be[2]/=be[3],be[3]=1;const Ae=((Ie,Ge,Ue,De,Xe)=>({u_sun_pos:Ie,u_atmosphere_blend:Ge,u_globe_position:Ue,u_globe_radius:De,u_inv_proj_matrix:Xe}))(oe,he,[be[0],be[1],be[2]],ue,ve),Re=wc(X,O);K.draw(X,W.TRIANGLES,ee,Ut.disabled,or.alphaBlended,Vt.disabled,Ae,null,null,"atmosphere",Re.vertexBuffer,Re.indexBuffer,Re.segments)}(this,this.style.sky,this.style.light),this.options.showTileBoundaries){const R=function(O,V){let X=null;const W=Object.values(O._layers).flatMap(oe=>oe.source&&!oe.isHidden(V)?[O.sourceCaches[oe.source]]:[]),K=W.filter(oe=>oe.getSource().type==="vector"),ee=W.filter(oe=>oe.getSource().type!=="vector"),se=oe=>{(!X||X.getSource().maxzoom<oe.getSource().maxzoom)&&(X=oe)};return K.forEach(oe=>se(oe)),X||ee.forEach(oe=>se(oe)),X}(this.style,this.transform.zoom);R&&function(O,V,X){for(let W=0;W<X.length;W++)sh(O,V,X[W])}(this,R,R.getVisibleCoordinates())}this.options.showPadding&&function(R){const O=R.transform.padding;Yn(R,R.transform.height-(O.top||0),3,Qi),Yn(R,O.bottom||0,3,vc),Go(R,O.left||0,3,xc),Go(R,R.transform.width-(O.right||0),3,ih);const V=R.transform.centerPoint;(function(X,W,K,ee){Na(X,W-1,K-10,2,20,ee),Na(X,W-10,K-1,20,2,ee)})(R,V.x,R.transform.height-V.y,Xn)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(e){if(!this.style||!this.style.map||!this.style.map.terrain)return;const r=this.terrainFacilitator.matrix,o=this.transform.modelViewProjectionMatrix;let u=this.terrainFacilitator.dirty;u||(u=e?!c.bV(r,o):!c.bW(r,o)),u||(u=this.style.map.terrain.sourceCache.anyTilesAfterTime(this.terrainFacilitator.renderTime)),u&&(c.bX(r,o),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(f,y){const w=f.context,S=w.gl,I=f.transform,A=or.unblended,k=new wt(S.LEQUAL,wt.ReadWrite,[0,1]),R=y.sourceCache.getRenderableTiles(),O=f.useProgram("terrainDepth");w.bindFramebuffer.set(y.getFramebuffer("depth").framebuffer),w.viewport.set([0,0,f.width/devicePixelRatio,f.height/devicePixelRatio]),w.clear({color:c.b4.transparent,depth:1});for(const V of R){const X=y.getTerrainMesh(V.tileID),W=y.getTerrainData(V.tileID),K=I.getProjectionData({overscaledTileID:V.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),ee={u_ele_delta:y.getMeshFrameDelta(I.zoom)};O.draw(w,S.TRIANGLES,k,Ut.disabled,A,Vt.backCCW,ee,W,K,"terrain",X.vertexBuffer,X.indexBuffer,X.segments)}w.bindFramebuffer.set(null),w.viewport.set([0,0,f.width,f.height])}(this,this.style.map.terrain),function(f,y){const w=f.context,S=w.gl,I=f.transform,A=or.unblended,k=new wt(S.LEQUAL,wt.ReadWrite,[0,1]),R=y.getCoordsTexture(),O=y.sourceCache.getRenderableTiles(),V=f.useProgram("terrainCoords");w.bindFramebuffer.set(y.getFramebuffer("coords").framebuffer),w.viewport.set([0,0,f.width/devicePixelRatio,f.height/devicePixelRatio]),w.clear({color:c.b4.transparent,depth:1}),y.coordsIndex=[];for(const X of O){const W=y.getTerrainMesh(X.tileID),K=y.getTerrainData(X.tileID);w.activeTexture.set(S.TEXTURE0),S.bindTexture(S.TEXTURE_2D,R.texture);const ee={u_terrain_coords_id:(255-y.coordsIndex.length)/255,u_texture:0,u_ele_delta:y.getMeshFrameDelta(I.zoom)},se=I.getProjectionData({overscaledTileID:X.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});V.draw(w,S.TRIANGLES,k,Ut.disabled,A,Vt.backCCW,ee,K,se,"terrain",W.vertexBuffer,W.indexBuffer,W.segments),y.c
746oordsIndex.push(X.tileID.key)}w.bindFramebuffer.set(null),w.viewport.set([0,0,f.width,f.height])}(this,this.style.map.terrain))}renderLayer(e,r,o,u,f){o.isHidden(this.transform.zoom)||(o.type==="background"||o.type==="custom"||(u||[]).length)&&(this.id=o.id,c.bY(o)?function(y,w,S,I,A,k){if(y.renderPass!=="translucent")return;const{isRenderingToTexture:R}=k,O=Ut.disabled,V=y.colorModeForRenderPass();(S._unevaluatedLayout.hasValue("text-variable-anchor")||S._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(X,W,K,ee,se,oe,le,he,ue){const ve=W.transform,be=W.style.map.terrain,Ae=se==="map",Re=oe==="map";for(const Ie of X){const Ge=ee.getTile(Ie),Ue=Ge.getBucket(K);if(!Ue||!Ue.text||!Ue.text.segments.get().length)continue;const De=c.ah(Ue.textSizeData,ve.zoom),Xe=c.at(Ge,1,W.transform.zoom),Tt=we(Ae,W.transform,Xe),Zt=K.layout.get("icon-text-fit")!=="none"&&Ue.hasIconData();{const fr=Math.pow(2,ve.zoom-Ge.tileID.overscaledZ),Qt=be?(mr,er)=>be.getElevation(Ie,mr,er):null;mc(Ue,Ae,Re,ue,ve,Tt,fr,De,Zt,c.au(ve,Ge,le,he),Ie.toUnwrapped(),Qt)}}}(I,y,S,w,S.layout.get("text-rotation-alignment"),S.layout.get("text-pitch-alignment"),S.paint.get("text-translate"),S.paint.get("text-translate-anchor"),A),S.paint.get("icon-opacity").constantOr(1)!==0&&$o(y,w,S,I,!1,S.paint.get("icon-translate"),S.paint.get("icon-translate-anchor"),S.layout.get("icon-rotation-alignment"),S.layout.get("icon-pitch-alignment"),S.layout.get("icon-keep-upright"),O,V,R),S.paint.get("text-opacity").constantOr(1)!==0&&$o(y,w,S,I,!0,S.paint.get("text-translate"),S.paint.get("text-translate-anchor"),S.layout.get("text-rotation-alignment"),S.layout.get("text-pitch-alignment"),S.layout.get("text-keep-upright"),O,V,R),w.map.showCollisionBoxes&&(No(y,w,S,I,!0),No(y,w,S,I,!1))}(e,r,o,u,this.style.placement.variableOffsets,f):c.bZ(o)?function(y,w,S,I,A){if(y.renderPass!=="translucent")return;const{isRenderingToTexture:k}=A,R=S.paint.get("circle-opacity"),O=S.paint.get("circle-stroke-width"),V=S.paint.get("circle-stroke-opacity"),X=!S.layout.get("circle-sort-key").isConstant();if(R.constantOr(1)===0&&(O.constantOr(1)===0||V.constantOr(1)===0))return;const W=y.context,K=W.gl,ee=y.transform,se=y.getDepthModeForSublayer(0,wt.ReadOnly),oe=Ut.disabled,le=y.colorModeForRenderPass(),he=[],ue=ee.getCircleRadiusCorrection();for(let ve=0;ve<I.length;ve++){const be=I[ve],Ae=w.getTile(be),Re=Ae.getBucket(S);if(!Re)continue;const Ie=S.paint.get("circle-translate"),Ge=S.paint.get("circle-translate-anchor"),Ue=c.au(ee,Ae,Ie,Ge),De=Re.programConfigurations.get(S.id),Xe=y.useProgram("circle",De),Tt=Re.layoutVertexBuffer,Zt=Re.indexBuffer,fr=y.style.map.terrain&&y.style.map.terrain.getTerrainData(be),Qt={programConfiguration:De,program:Xe,layoutVertexBuffer:Tt,indexBuffer:Zt,uniformValues:Ql(y,Ae,S,Ue,ue),terrainData:fr,projectionData:ee.getProjectionData({overscaledTileID:be,applyGlobeMatrix:!k,applyTerrainMatrix:!0})};if(X){const mr=Re.segments.get();for(const er of mr)he.push({segments:new c.aD([er]),sortKey:er.sortKey,state:Qt})}else he.push({segments:Re.segments,sortKey:0,state:Qt})}X&&he.sort((ve,be)=>ve.sortKey-be.sortKey);for(const ve of he){const{programConfiguration:be,program:Ae,layoutVertexBuffer:Re,indexBuffer:Ie,uniformValues:Ge,terrainData:Ue,projectionData:De}=ve.state;Ae.draw(W,K.TRIANGLES,se,oe,le,Vt.backCCW,Ge,Ue,De,S.id,Re,Ie,ve.segments,S.paint,y.transform.zoom,be)}}(e,r,o,u,f):c.b_(o)?function(y,w,S,I,A){if(S.paint.get("heatmap-opacity")===0)return;const k=y.context,{isRenderingToTexture:R,isRenderingGlobe:O}=A;if(y.style.map.terrain){for(const V of I){const X=w.getTile(V);w.hasRenderableParent(V)||(y.renderPass==="offscreen"?rh(y,X,S,V,O):y.renderPass==="translucent"&&Uo(y,S,V,R,O))}k.viewport.set([0,0,y.width,y.height])}else y.renderPass==="offscreen"?function(V,X,W,K){const ee=V.context,se=ee.gl,oe=V.transform,le=Ut.disabled,he=new or([se.ONE,se.ONE],c.b4.transparent,[!0,!0,!0,!0]);(function(ue,ve,be){const Ae=ue.gl;ue.activeTexture.set(Ae.TEXTURE1),ue.viewport.set([0,0,ve.width/4,ve.height/4]);let Re=be.heatmapFbos.get(c.bP);Re?(Ae.bindTexture(Ae.TEXTURE_2D,Re.colorAttachment.get()),ue.bindFramebuffer.set(Re.framebuffer)):(Re=Zo(ue,ve.width/4,ve.height/4),be.heatmapFbos.set(c.bP,Re))})(ee,V,W),ee.clear({color:c.b4.transparent});for(let ue=0;ue<K.length;ue++){const ve=K[ue];if(X.hasRenderableParent(ve))continue;const be=X.getTile(ve),Ae=be.getBucket(W);if(!Ae)continue;const Re=Ae.programConfigurations.get(W.id),Ie=V.useProgram("heatmap",Re),Ge=oe.getProjectionData({overscaledTileID:ve,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),Ue=oe.getCircleRadiusCorrection();Ie.draw(ee,se.TRIANGLES,wt.disabled,le,he,Vt.backCCW,tc(be,oe.zoom,W.paint.get("heatmap-intensity"),Ue),null,Ge,W.id,Ae.layoutVertexBuffer,Ae.indexBuffer,Ae.segments,W.paint,oe.zoom,Re)}ee.viewport.set([0,0,V.width,V.height])}(y,w,S,I):y.renderPass==="translucent"&&function(V,X){const W=V.context,K=W.gl;
746W.setColorMode(V.colorModeForRenderPass());const ee=X.heatmapFbos.get(c.bP);ee&&(W.activeTexture.set(K.TEXTURE0),K.bindTexture(K.TEXTURE_2D,ee.colorAttachment.get()),W.activeTexture.set(K.TEXTURE1),gc(W,X).bind(K.LINEAR,K.CLAMP_TO_EDGE),V.useProgram("heatmapTexture").draw(W,K.TRIANGLES,wt.disabled,Ut.disabled,V.colorModeForRenderPass(),Vt.disabled,qs(V,X,0,1),null,null,X.id,V.viewportBuffer,V.quadTriangleIndexBuffer,V.viewportSegments,X.paint,V.transform.zoom))}(y,S)}(e,r,o,u,f):c.b$(o)?function(y,w,S,I,A){if(y.renderPass!=="translucent")return;const{isRenderingToTexture:k}=A,R=S.paint.get("line-opacity"),O=S.paint.get("line-width");if(R.constantOr(1)===0||O.constantOr(1)===0)return;const V=y.getDepthModeForSublayer(0,wt.ReadOnly),X=y.colorModeForRenderPass(),W=S.paint.get("line-dasharray"),K=S.paint.get("line-pattern"),ee=K.constantOr(1),se=S.paint.get("line-gradient"),oe=S.getCrossfadeParameters(),le=ee?"linePattern":W?"lineSDF":se?"lineGradient":"line",he=y.context,ue=he.gl,ve=y.transform;let be=!0;for(const Ae of I){const Re=w.getTile(Ae);if(ee&&!Re.patternsLoaded())continue;const Ie=Re.getBucket(S);if(!Ie)continue;const Ge=Ie.programConfigurations.get(S.id),Ue=y.context.program.get(),De=y.useProgram(le,Ge),Xe=be||De.program!==Ue,Tt=y.style.map.terrain&&y.style.map.terrain.getTerrainData(Ae),Zt=K.constantOr(null);if(Zt&&Re.imageAtlas){const Kt=Re.imageAtlas,tr=Kt.patternPositions[Zt.to.toString()],ni=Kt.patternPositions[Zt.from.toString()];tr&&ni&&Ge.setConstantPatternPositions(tr,ni)}const fr=ve.getProjectionData({overscaledTileID:Ae,applyGlobeMatrix:!k,applyTerrainMatrix:!0}),Qt=ve.getPixelScale(),mr=ee?Zp(y,Re,S,Qt,oe):W?qp(y,Re,S,Qt,W,oe):se?Io(y,Re,S,Qt,Ie.lineClipsArray.length):rc(y,Re,S,Qt);if(ee)he.activeTexture.set(ue.TEXTURE0),Re.imageAtlasTexture.bind(ue.LINEAR,ue.CLAMP_TO_EDGE),Ge.updatePaintBuffers(oe);else if(W&&(Xe||y.lineAtlas.dirty))he.activeTexture.set(ue.TEXTURE0),y.lineAtlas.bind(he);else if(se){const Kt=Ie.gradients[S.id];let tr=Kt.texture;if(S.gradientVersion!==Kt.version){let ni=256;if(S.stepInterpolant){const Fr=w.getSource().maxzoom,jr=Ae.canonical.z===Fr?Math.ceil(1<<y.transform.maxZoom-Ae.canonical.z):1;ni=c.ab(c.bQ(Ie.maxLineLength/c.X*1024*jr),256,he.maxTextureSize)}Kt.gradient=c.bR({expression:S.gradientExpression(),evaluationKey:"lineProgress",resolution:ni,image:Kt.gradient||void 0,clips:Ie.lineClipsArray}),Kt.texture?Kt.texture.update(Kt.gradient):Kt.texture=new pt(he,Kt.gradient,ue.RGBA),Kt.version=S.gradientVersion,tr=Kt.texture}he.activeTexture.set(ue.TEXTURE0),tr.bind(S.stepInterpolant?ue.NEAREST:ue.LINEAR,ue.CLAMP_TO_EDGE)}let er;if(k){const[Kt]=y.getStencilConfigForOverlapAndUpdateStencilID(I);er=Kt[Ae.overscaledZ]}else er=y.stencilModeForClipping(Ae);De.draw(he,ue.TRIANGLES,V,er,X,Vt.disabled,mr,Tt,fr,S.id,Ie.layoutVertexBuffer,Ie.indexBuffer,Ie.segments,S.paint,y.transform.zoom,Ge,Ie.layoutVertexBuffer2),be=!1}}(e,r,o,u,f):c.c0(o)?function(y,w,S,I,A){const k=S.paint.get("fill-color"),R=S.paint.get("fill-opacity");if(R.constantOr(1)===0)return;const{isRenderingToTexture:O}=A,V=y.colorModeForRenderPass(),X=S.paint.get("fill-pattern"),W=y.opaquePassEnabledForLayer()&&!X.constantOr(1)&&k.constantOr(c.b4.transparent).a===1&&R.constantOr(0)===1?"opaque":"translucent";if(y.renderPass===W){const K=y.getDepthModeForSublayer(1,y.renderPass==="opaque"?wt.ReadWrite:wt.ReadOnly);Ba(y,w,S,I,K,V,!1,O)}if(y.renderPass==="translucent"&&S.paint.get("fill-antialias")){const K=y.getDepthModeForSublayer(S.getPaintProperty("fill-outline-color")?2:0,wt.ReadOnly);Ba(y,w,S,I,K,V,!0,O)}}(e,r,o,u,f):c.c1(o)?function(y,w,S,I,A){const k=S.paint.get("fill-extrusion-opacity");if(k===0)return;const{isRenderingToTexture:R}=A;if(y.renderPass==="translucent"){const O=new wt(y.context.gl.LEQUAL,wt.ReadWrite,y.depthRangeFor3D);if(k!==1||S.paint.get("fill-extrusion-pattern").constantOr(1))Oa(y,w,S,I,O,Ut.disabled,or.disabled,R),Oa(y,w,S,I,O,y.stencilModeFor3D(),y.colorModeForRenderPass(),R);else{const V=y.colorModeForRenderPass();Oa(y,w,S,I,O,Ut.disabled,V,R)}}}(e,r,o,u,f):c.c2(o)?function(y,w,S,I,A){if(y.renderPass!=="offscreen"&&y.renderPass!=="translucent")return;const{isRenderingToTexture:k}=A,R=y.context,O=y.style.projection.useSubdivision,V=y.getDepthModeForSublayer(0,wt.ReadOnly),X=y.colorModeForRenderPass();if(y.renderPass==="offscreen")(function(W,K,ee,se,oe,le,he){const ue=W.context,ve=ue.gl;for(const be of ee){const Ae=K.getTile(be),Re=Ae.dem;if(!Re||!Re.data||!Ae.needsHillshadePrepare)continue;
vendor: 35,103 bytes, lines 746-748
746const Ie=Re.dim,Ge=Re.stride,Ue=Re.getPixels();if(ue.activeTexture.set(ve.TEXTURE1),ue.pixelStoreUnpackPremultiplyAlpha.set(!1),Ae.demTexture=Ae.demTexture||W.getTileTexture(Ge),Ae.demTexture){const Xe=Ae.demTexture;Xe.update(Ue,{premultiply:!1}),Xe.bind(ve.NEAREST,ve.CLAMP_TO_EDGE)}else Ae.demTexture=new pt(ue,Ue,ve.RGBA,{premultiply:!1}),Ae.demTexture.bind(ve.NEAREST,ve.CLAMP_TO_EDGE);ue.activeTexture.set(ve.TEXTURE0);let De=Ae.fbo;if(!De){const Xe=new pt(ue,{width:Ie,height:Ie,data:null},ve.RGBA);Xe.bind(ve.LINEAR,ve.CLAMP_TO_EDGE),De=Ae.fbo=ue.createFramebuffer(Ie,Ie,!0,!1),De.colorAttachment.set(Xe.texture)}ue.bindFramebuffer.set(De.framebuffer),ue.viewport.set([0,0,Ie,Ie]),W.useProgram("hillshadePrepare").draw(ue,ve.TRIANGLES,oe,le,he,Vt.disabled,Uu(Ae.tileID,Re),null,null,se.id,W.rasterBoundsBuffer,W.quadTriangleIndexBuffer,W.rasterBoundsSegments),Ae.needsHillshadePrepare=!1}})(y,w,I,S,V,Ut.disabled,X),R.viewport.set([0,0,y.width,y.height]);else if(y.renderPass==="translucent")if(O){const[W,K,ee]=y.stencilConfigForOverlapTwoPass(I);yc(y,w,S,ee,W,V,X,!1,k),yc(y,w,S,ee,K,V,X,!0,k)}else{const[W,K]=y.getStencilConfigForOverlapAndUpdateStencilID(I);yc(y,w,S,K,W,V,X,!1,k)}}(e,r,o,u,f):c.c3(o)?function(y,w,S,I,A){if(y.renderPass!=="translucent"||S.paint.get("raster-opacity")===0||!I.length)return;const{isRenderingToTexture:k}=A,R=w.getSource(),O=y.style.projection.useSubdivision;if(R instanceof Ze)pr(y,w,S,I,null,!1,!1,R.tileCoords,R.flippedWindingOrder,k);else if(O){const[V,X,W]=y.stencilConfigForOverlapTwoPass(I);pr(y,w,S,W,V,!1,!0,qo,!1,k),pr(y,w,S,W,X,!0,!0,qo,!1,k)}else{const[V,X]=y.getStencilConfigForOverlapAndUpdateStencilID(I);pr(y,w,S,X,V,!1,!0,qo,!1,k)}}(e,r,o,u,f):c.c4(o)?function(y,w,S,I,A){const k=S.paint.get("background-color"),R=S.paint.get("background-opacity");if(R===0)return;const{isRenderingToTexture:O}=A,V=y.context,X=V.gl,W=y.style.projection,K=y.transform,ee=K.tileSize,se=S.paint.get("background-pattern");if(y.isPatternMissing(se))return;const oe=!se&&k.a===1&&R===1&&y.opaquePassEnabledForLayer()?"opaque":"translucent";if(y.renderPass!==oe)return;const le=Ut.disabled,he=y.getDepthModeForSublayer(0,oe==="opaque"?wt.ReadWrite:wt.ReadOnly),ue=y.colorModeForRenderPass(),ve=y.useProgram(se?"backgroundPattern":"background"),be=I||H(K,{tileSize:ee,terrain:y.style.map.terrain});se&&(V.activeTexture.set(X.TEXTURE0),y.imageManager.bind(y.context));const Ae=S.getCrossfadeParameters();for(const Re of be){const Ie=K.getProjectionData({overscaledTileID:Re,applyGlobeMatrix:!O,applyTerrainMatrix:!0}),Ge=se?lc(R,y,se,{tileID:Re,tileSize:ee},Ae):oc(R,k),Ue=y.style.map.terrain&&y.style.map.terrain.getTerrainData(Re),De=W.getMeshFromTileID(V,Re.canonical,!1,!0,"raster");ve.draw(V,X.TRIANGLES,he,le,ue,Vt.backCCW,Ge,Ue,Ie,S.id,De.vertexBuffer,De.indexBuffer,De.segments)}}(e,0,o,u,f):c.c5(o)&&function(y,w,S,I){const{isRenderingGlobe:A}=I,k=y.context,R=S.implementation,O=y.style.projection,V=y.transform,X=V.getProjectionDataForCustomLayer(A),W={farZ:V.farZ,nearZ:V.nearZ,fov:V.fov*Math.PI/180,modelViewProjectionMatrix:V.modelViewProjectionMatrix,projectionMatrix:V.projectionMatrix,shaderData:{variantName:O.shaderVariantName,vertexShaderPrelude:`const float PI = 3.141592653589793;
747uniform mat4 u_projection_matrix;
748${O.shaderPreludeCode.vertexSource}`,define:O.shaderDefine},defaultProjectionData:X},K=R.renderingMode?R.renderingMode:"2d";if(y.renderPass==="offscreen"){const ee=R.prerender;ee&&(y.setCustomLayerDefaults(),k.setColorMode(y.colorModeForRenderPass()),ee.call(R,k.gl,W),k.setDirty(),y.setBaseState())}else if(y.renderPass==="translucent"){y.setCustomLayerDefaults(),k.setColorMode(y.colorModeForRenderPass()),k.setStencilMode(Ut.disabled);const ee=K==="3d"?y.getDepthModeFor3D():y.getDepthModeForSublayer(0,wt.ReadOnly);k.setDepthMode(ee),R.render(k.gl,W),k.setDirty(),y.setBaseState(),k.bindFramebuffer.set(null)}}(e,0,o,f))}saveTileTexture(e){const r=this._tileTextures[e.size[0]];r?r.push(e):this._tileTextures[e.size[0]]=[e]}getTileTexture(e){const r=this._tileTextures[e];return r&&r.length>0?r.pop():null}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;const r=this.imageManager.getPattern(e.from.toString()),o=this.imageManager.getPattern(e.to.toString());return!r||!o}useProgram(e,r,o=!1){this.cache=this.cache||{};const u=!!this.style.map.terrain,f=this.style.projection,y=e+(r?r.cacheKey:"")+`/${o?Du:f.shaderVariantName}`+(this._showOverdrawInspector?"/overdraw":"")+(u?"/terrain":"");return this.cache[y]||(this.cache[y]=new Po(this.context,ys[e],r,qu[e],this._showOverdrawInspector,u,o?ys.projectionMercator:f.shaderPreludeCode,o?bo:f.shaderDefine)),this.cache[y]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new pt(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:e,drawingBufferHeight:r}=this.context.gl;return this.width!==e||this.height!==r}}function Gs(d,e){let r,o=!1,u=null,f=null;const y=()=>{u=null,o&&(d.apply(f,r),u=setTimeout(y,e),o=!1)};return(...w)=>(o=!0,f=this,r=w,u||y(),u)}class Tc{constructor(e){this._getCurrentHash=()=>{const r=window.location.hash.replace("#","");if(this._hashName){let o;return r.split("&").map(u=>u.split("=")).forEach(u=>{u[0]===this._hashName&&(o=u)}),(o&&o[1]||"").split("/")}return r.split("/")},this._onHashChange=()=>{const r=this._getCurrentHash();if(!this._isValidHash(r))return!1;const o=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(r[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+r[2],+r[1]],zoom:+r[0],bearing:o,pitch:+(r[4]||0)}),!0},this._updateHashUnthrottled=()=>{const r=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,r)},this._removeHash=()=>{const r=this._getCurrentHash();if(r.length===0)return;const o=r.join("/");let u=o;u.split("&").length>0&&(u=u.split("&")[0]),this._hashName&&(u=`${this._hashName}=${o}`);let f=window.location.hash.replace(u,"");f.startsWith("#&")?f=f.slice(0,1)+f.slice(2):f==="#"&&(f="");let y=window.location.href.replace(/(#.+)?$/,f);y=y.replace("&&","&"),window.history.replaceState(window.history.state,null,y)},this._updateHash=Gs(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(e){const r=this._map.getCenter(),o=Math.round(100*this._map.getZoom())/100,u=Math.ceil((o*Math.LN2+Math.log(512/360/.5))/Math.LN10),f=Math.pow(10,u),y=Math.round(r.lng*f)/f,w=Math.round(r.lat*f)/f,S=this._map.getBearing(),I=this._map.getPitch();let A="";if(A+=e?`/${y}/${w}/${o}`:`${o}/${w}/${y}`,(S||I)&&(A+="/"+Math.round(10*S)/10),I&&(A+=`/${Math.round(I)}`),this._hashName){const k=this._hashName;let R=!1;const O=window.location.hash.slice(1).split("&").map(V=>{const X=V.split("=")[0];return X===k?(R=!0,`${X}=${A}`):V}).filter(V=>V);return R||O.push(`${k}=${A}`),`#${O.join("&")}`}return`#${A}`}_isValidHash(e){if(e.length<3||e.some(isNaN))return!1;try{new c.N(+e[2],+e[1])}catch{return!1}const r=+e[0],o=+(e[3]||0),u=+(e[4]||0);return r>=this._map.getMinZoom()&&r<=this._map.getMaxZoom()&&o>=0&&o<=180&&u>=this._map.getMinPitch()&&u<=this._map.getMaxPitch()}}const Kn={linearity:.3,easing:c.c6(0,0,.3,1)},ah=c.e({deceleration:2500,maxSpeed:1400},Kn),oh=c.e({deceleration:20,maxSpeed:1400},Kn),lh=c.e({deceleration:1e3,maxSpeed:360},Kn),ch=c.e({deceleration:1e3,maxSpeed:90},Kn),uh=c.e({deceleration:1e3,maxSpeed:360},Kn);class Ho{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:ge.now(),settings:e})}_drainInertiaBuffer(){const e=this._inertiaBuffer,r=ge.now();for(;e.length>0&&r-e[0].time>160;)e.shift()}_onMoveEnd(e){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const r={zoom:0,bearing:0,pitch:0,roll:0,pan:new c.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:f}of this._inertiaBuffer)r.zoom+=f.zoomDelta||0,r.bearing+=f.bearingDelta||0,r.pitch+=f.pitchDelta||0,r.roll+=f.rollDelta||0,f.panDelta&&r.pan._add(f.panDelta),f.around&&(r.around=f.around),f.pinchAround&&(r.pinchAround=f.pinchAround);const o=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,u={};if(r.pan.mag()){const f=xi(r.pan.mag(),o,c.e({},ah,e||{})),y=r.pan.mult(f.amount/r.pan.mag()),w=this._map.cameraHelper.handlePanInertia(y,this._map.transform);u.center=w.easingCenter,u.offset=w.easingOffset,Jn(u,f)}if(r.zoom){const f=xi(r.zoom,o,oh);u.zoom=this._map.transform.zoom+f.amount,Jn(u,f)}if(r.bearing){const f=xi(r.bearing,o,lh);u.bearing=this._map.transform.bearing+c.ab(f.amount,-179,179),Jn(u,f)}if(r.pitch){const f=xi(r.pitch,o,ch);u.pitch=this._map.transform.pitch+f.amount,Jn(u,f)}if(r.roll){const f=xi(r.roll,o,uh);u.roll=this._map.transform.roll+c.ab(f.amount,-179,179),Jn(u,f)}if(u.zoom||u.bearing){const f=r.pinchAround===void 0?r.around:r.pinchAround;u.around=f?this._map.unproject(f):this._map.getCenter()}return this.clear(),c.e(u,{noMoveStart:!0})}}function Jn(d,e){(!d.duration||d.duration<e.duration)&&(d.duration=e.duration,d.easing=e.easing)}function xi(d,e,r){const{maxSpeed:o,linearity:u,deceleration:f}=r,y=c.ab(d*u/(e/1e3),-o,o),w=Math.abs(y)/(f*u);return{easing:r.easing,duration:1e3*w,amount:y*(w/2)}}class Ir extends c.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,r,o,u={}){const f=Q.mousePos(r.getCanvas(),o),y=r.unproject(f);super(e,c.e({point:f,lngLat:y,originalEvent:o},u)),this._defaultPrevented=!1,this.target=r}}class Qn extends c.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,r,o){const u=e==="touchend"?o.changedTouches:o.touches,f=Q.touchPos(r.getCanvasContainer(),u),y=f.map(S=>r.unproject(S)),w=f.reduce((S,I,A,k)=>S.add(I.div(k.length)),new c.P(0,0));super(e,{points:f,point:w,lngLats:y,lngLat:r.unproject(w),originalEvent:o}),this._defaultPrevented=!1}}class us extends c.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,r,o){super(e,{originalEvent:o}),this._defaultPrevented=!1}}class ea{constructor(e,r){this._map=e,this._clickTolerance=r.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new us(e.type,this._map,e))}mousedown(e,r){return this._mousedownPos=r,this._firePreventable(new Ir(e.type,this._map,e))}mouseup(e){this._map.fire(new Ir(e.type,this._map,e))}click(e,r){this._mousedownPos&&this._mousedownPos.dist(r)>=this._clickTolerance||this._map.fire(new Ir(e.type,this._map,e))}dblclick(e){return this._firePreventable(new Ir(e.type,this._map,e))}mouseover(e){this._map.fire(new Ir(e.type,this._map,e))}mouseout(e){this._map.fire(new Ir(e.type,this._map,e))}touchstart(e){return this._firePreventable(new Qn(e.type,this._map,e))}touchmove(e){this._map.fire(new Qn(e.type,this._map,e))}touchend(e){this._map.fire(new Qn(e.type,this._map,e))}touchcancel(e){this._map.fire(new Qn(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class ed{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new Ir(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ir("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new Ir(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class ja{constructor(e){this._map=e}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(e){return this.transform.screenPointToLocation(c.P.convert(e),this._map.terrain)}}class hh{constructor(e,r){this._map=e,this._tr=new ja(e),this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=r.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,r){this.isEnabled()&&e.shiftKey&&e.button===0&&(Q.disableDrag(),this._startPos=this._lastPos=r,this._active=!0)}mousemoveWindow(e,r){if(!this._active)return;const o=r;if(this._lastPos.equals(o)||!this._box&&o.dist(this._startPos)<this._clickTolerance)return;const u=this._startPos;this._lastPos=o,this._box||(this._box=Q.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",e));const f=Math.min(u.x,o.x),y=Math.max(u.x,o.x),w=Math.min(u.y,o.y),S=Math.max(u.y,o.y);Q.setTransform(this._box,`translate(${f}px,${w}px)`),this._box.style.width=y-f+"px",this._box.style.height=S-w+"px"}mouseupWindow(e,r){if(!this._active||e.button!==0)return;const o=this._startPos,u=r;if(this.reset(),Q.suppressClick(),o.x!==u.x||o.y!==u.y)return this._map.fire(new c.k("boxzoomend",{originalEvent:e})),{cameraAnimation:f=>f.fitScreenCoordinates(o,u,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",e)}keydown(e){this._active&&e.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(Q.remove(this._box),this._box=null),Q.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,r){return this._map.fire(new c.k(e,{originalEvent:r}))}}function Sc(d,e){if(d.length!==e.length)throw new Error(`The number of touches and points are not equal - touches ${d.length}, points ${e.length}`);const r={};for(let o=0;o<d.length;o++)r[d[o].identifier]=e[o];return r}class ph{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,r,o){(this.centroid||o.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=e.timeStamp),o.length===this.numTouches&&(this.centroid=function(u){const f=new c.P(0,0);for(const y of u)f._add(y);return f.div(u.length)}(r),this.touches=Sc(o,r)))}touchmove(e,r,o){if(this.aborted||!this.centroid)return;const u=Sc(o,r);for(const f in this.touches){const y=u[f];(!y||y.dist(this.touches[f])>30)&&(this.aborted=!0)}}touchend(e,r,o){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),o.length===0){const u=!this.aborted&&this.centroid;if(this.reset(),u)return u}}}class Tn{constructor(e){this.singleTap=new ph(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,r,o){this.singleTap.touchstart(e,r,o)}touchmove(e,r,o){this.singleTap.touchmove(e,r,o)}touchend(e,r,o){const u=this.singleTap.touchend(e,r,o);if(u){const f=e.timeStamp-this.lastTime<500,y=!this.lastTap||this.lastTap.dist(u)<30;if(f&&y||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=u,this.count===this.numTaps)return this.reset(),u}}}class ks{constructor(e){this._tr=new ja(e),this._zoomIn=new Tn({numTouches:1,numTaps:2}),this._zoomOut=new Tn({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,r,o){this._zoomIn.touchstart(e,r,o),this._zoomOut.touchstart(e,r,o)}touchmove(e,r,o){this._zoomIn.touchmove(e,r,o),this._zoomOut.touchmove(e,r,o)}touchend(e,r,o){const u=this._zoomIn.touchend(e,r,o),f=this._zoomOut.touchend(e,r,o),y=this._tr;return u?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:w=>w.easeTo({duration:300,zoom:y.zoom+1,around:y.unproject(u)},{originalEvent:e})}):f?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:w=>w.easeTo({duration:300,zoom:y.zoom-1,around:y.unproject(f)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Qe{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(...e){const r=this._moveFunction(...e);if(r.bearingDelta||r.pitchDelta||r.rollDelta||r.around||r.panDelta)return this._active=!0,r}dragStart(e,r){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=Array.isArray(r)?r[0]:r,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,r){if(!this.isEnabled())return;const o=this._lastPoint;if(!o)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e))return void this.reset(e);const u=Array.isArray(r)?r[0]:r;return!this._moved&&u.dist(o)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=u,this._move(o,u))}dragEnd(e){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(e)&&(this._moved&&Q.suppressClick(),this.reset(e))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const dh={0:1,2:2};class Sn{constructor(e){this._correctEvent=e.checkCorrectEvent}startMove(e){const r=Q.mouseButton(e);this._eventButton=r}endMove(e){delete this._eventButton}isValidStartEvent(e){return this._correctEvent(e)}isValidMoveEvent(e){return!function(r,o){const u=dh[o];return r.buttons===void 0||(r.buttons&u)!==u}(e,this._eventButton)}isValidEndEvent(e){return Q.mouseButton(e)===this._eventButton}}class fh{constructor(){this._firstTouch=void 0}_isOneFingerTouch(e){return e.targetTouches.length===1}_isSameTouchEvent(e){return e.targetTouches[0].identifier===this._firstTouch}startMove(e){this._firstTouch=e.targetTouches[0].identifier}endMove(e){delete this._firstTouch}isValidStartEvent(e){return this._isOneFingerTouch(e)}isValidMoveEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}isValidEndEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}}class Va{constructor(e=new Sn({checkCorrectEvent:()=>!0}),r=new fh){this.mouseMoveStateManager=e,this.oneFingerTouchMoveStateManager=r}_executeRelevantHandler(e,r,o){return e instanceof MouseEvent?r(e):typeof TouchEvent<"u"&&e instanceof TouchEvent?o(e):void 0}startMove(e){this._executeRelevantHandler(e,r=>this.mouseMoveStateManager.startMove(r),r=>this.oneFingerTouchMoveStateManager.startMove(r))}endMove(e){this._executeRelevantHandler(e,r=>this.mouseMoveStateManager.endMove(r),r=>this.oneFingerTouchMoveStateManager.endMove(r))}isValidStartEvent(e){return this._executeRelevantHandler(e,r=>this.mouseMoveStateManager.isValidStartEvent(r),r=>this.oneFingerTouchMoveStateManager.isValidStartEvent(r))}isValidMoveEvent(e){return this._executeRelevantHandler(e,r=>this.mouseMoveStateManager.isValidMoveEvent(r),r=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(r))}isValidEndEvent(e){return this._executeRelevantHandler(e,r=>this.mouseMoveStateManager.isValidEndEvent(r),r=>this.oneFingerTouchMoveStateManager.isValidEndEvent(r))}}const Hs=d=>{d.mousedown=d.dragStart,d.mousemoveWindow=d.dragMove,d.mouseup=d.dragEnd,d.contextmenu=e=>{e.preventDefault()}};class mh{constructor(e,r){this._clickTolerance=e.clickTolerance||1,this._map=r,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new c.P(0,0)}_shouldBePrevented(e){return e<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(e,r,o){return this._calculateTransform(e,r,o)}touchmove(e,r,o){if(this._active){if(!this._shouldBePrevented(o.length))return e.preventDefault(),this._calculateTransform(e,r,o);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",e)}}touchend(e,r,o){this._calculateTransform(e,r,o),this._active&&this._shouldBePrevented(o.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,r,o){o.length>0&&(this._active=!0);const u=Sc(o,r),f=new c.P(0,0),y=new c.P(0,0);let w=0;for(const I in u){const A=u[I],k=this._touches[I];k&&(f._add(A),y._add(A.sub(k)),w++,u[I]=A)}if(this._touches=u,this._shouldBePrevented(w)||!y.mag())return;const S=y.div(w);return this._sum._add(S),this._sum.mag()<this._clickTolerance?void 0:{around:f.div(w),panDelta:S}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Dt{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(e,r,o){this._firstTwoTouches||o.length<2||(this._firstTwoTouches=[o[0].identifier,o[1].identifier],this._start([r[0],r[1]]))}touchmove(e,r,o){if(!this._firstTwoTouches)return;e.preventDefault();const[u,f]=this._firstTwoTouches,y=ta(o,r,u),w=ta(o,r,f);if(!y||!w)return;const S=this._aroundCenter?null:y.add(w).div(2);return this._move([y,w],S,e)}touchend(e,r,o){if(!this._firstTwoTouches)return;const[u,f]=this._firstTwoTouches,y=ta(o,r,u),w=ta(o,r,f);y&&w||(this._active&&Q.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&e.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function ta(d,e,r){for(let o=0;o<d.length;o++)if(d[o].identifier===r)return e[o]}function gh(d,e){return Math.log(d/e)/Math.LN2}class Wo extends Dt{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,r){const o=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(gh(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:gh(this._distance,o),pinchAround:r}}}function _h(d,e){return 180*d.angleWith(e)/Math.PI}class yh extends Dt{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,r,o){const u=this._vector;if(this._vector=e[0].sub(e[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:_h(this._vector,u),pinchAround:r}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());const r=25/(Math.PI*this._minDiameter)*360,o=_h(e,this._startVector);return Math.abs(o)<r}}function Xo(d){return Math.abs(d.y)>Math.abs(d.x)}class Yo extends Dt{constructor(e){super(),this._currentTouchCount=0,this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,r,o){super.touchstart(e,r,o),this._currentTouchCount=o.length}_start(e){this._lastPoints=e,Xo(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,r,o){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const u=e[0].sub(this._lastPoints[0]),f=e[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(u,f,o.timeStamp),this._valid?(this._lastPoints=e,this._active=!0,{pitchDelta:(u.y+f.y)/2*-.5}):void 0}gestureBeginsVertically(e,r,o){if(this._valid!==void 0)return this._valid;const u=e.mag()>=2,f=r.mag()>=2;if(!u&&!f)return;if(!u||!f)return this._firstMove===void 0&&(this._firstMove=o),o-this._firstMove<100&&void 0;const y=e.y>0==r.y>0;return Xo(e)&&Xo(r)&&y}}const vh={panStep:100,bearingStep:15,pitchStep:10};class xh{constructor(e){this._tr=new ja(e);const r=vh;this._panStep=r.panStep,this._bearingStep=r.bearingStep,this._pitchStep=r.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let r=0,o=0,u=0,f=0,y=0;switch(e.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:e.shiftKey?o=-1:(e.preventDefault(),f=-1);break;case 39:e.shiftKey?o=1:(e.preventDefault(),f=1);break;case 38:e.shiftKey?u=1:(e.preventDefault(),y=-1);break;case 40:e.shiftKey?u=-1:(e.preventDefault(),y=1);break;default:return}return this._rotationDisabled&&(o=0,u=0),{cameraAnimation:w=>{const S=this._tr;w.easeTo({duration:300,easeId:"keyboardHandler",easing:bh,zoom:r?Math.round(S.zoom)+r*(e.shiftKey?2:1):S.zoom,bearing:S.bearing+o*this._bearingStep,pitch:S.pitch+u*this._pitchStep,offset:[-f*this._panStep,-y*this._panStep],center:S.center},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function bh(d){return d*(2-d)}const wh=4.000244140625;class Th{constructor(e,r){this._onTimeout=o=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(o)},this._map=e,this._tr=new ja(e),this._triggerRenderFrame=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&e.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return!!this._map.cooperativeGestures.isEnabled()&&!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e))}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",e);let r=e.deltaMode===WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY;const o=ge.now(),u=o-(this._lastWheelEventTime||0);this._lastWheelEventTime=o,r!==0&&r%wh==0?this._type="wheel":r!==0&&Math.abs(r)<4?this._type="trackpad":u>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(u*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const r=Q.mousePos(this._map.getCanvas(),e),o=this._tr;this._aroundPoint=this._aroundCenter?o.transform.locationToScreenPoint(c.N.convert(o.center)):r,this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const e=this._tr.transform;if(typeof this._lastExpectedZoom=="number"){const w=e.zoom-this._lastExpectedZoom;typeof this._startZoom=="number"&&(this._startZoom+=w),typeof this._targetZoom=="number"&&(this._targetZoom+=w)}if(this._delta!==0){const w=this._type==="wheel"&&Math.abs(this._delta)>wh?this._wheelZoomRate:this._defaultZoomRate;let S=2/(1+Math.exp(-Math.abs(this._delta*w)));this._delta<0&&S!==0&&(S=1/S);const I=typeof this._targetZoom!="number"?e.scale:c.aG(this._targetZoom);this._targetZoom=Math.min(e.maxZoom,Math.max(e.minZoom,c.a8(I*S))),this._type==="wheel"&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const r=typeof this._targetZoom!="number"?e.zoom:this._targetZoom,o=this._startZoom,u=this._easing;let f,y=!1;if(this._type==="wheel"&&o&&u){const w=ge.now()-this._lastWheelEventTime,S=Math.min((w+5)/200,1),I=u(S);f=c.y.number(o,r,I),S<1?this._frameId||(this._frameId=!0):y=!0}else f=r,y=!0;return this._active=!0,y&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout},200)),this._lastExpectedZoom=f,{noInertia:!0,needsRenderFrame:!y,zoomDelta:f-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let r=c.c8;if(this._prevEase){const o=this._prevEase,u=(ge.now()-o.start)/o.duration,f=o.easing(u+.01)-o.easing(u),y=.27/Math.sqrt(f*f+1e-4)*.01,w=Math.sqrt(.0729-y*y);r=c.c6(y,w,.25,1)}return this._prevEase={start:ge.now(),duration:e,easing:r},r}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class zs{constructor(e,r){this._clickZoom=e,this._tapZoom=r}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class dr{constructor(e){this._tr=new ja(e),this.reset()}reset(){this._active=!1}dblclick(e,r){return e.preventDefault(),{cameraAnimation:o=>{o.easeTo({duration:300,zoom:this._tr.zoom+(e.shiftKey?-1:1),around:this._tr.unproject(r)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ko{constructor(){this._tap=new Tn({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,r,o){if(!this._swipePoint)if(this._tapTime){const u=r[0],f=e.timeStamp-this._tapTime<500,y=this._tapPoint.dist(u)<30;f&&y?o.length>0&&(this._swipePoint=u,this._swipeTouch=o[0].identifier):this.reset()}else this._tap.touchstart(e,r,o)}touchmove(e,r,o){if(this._tapTime){if(this._swipePoint){if(o[0].identifier!==this._swipeTouch)return;const u=r[0],f=u.y-this._swipePoint.y;return this._swipePoint=u,e.preventDefault(),this._active=!0,{zoomDelta:f/128}}}else this._tap.touchmove(e,r,o)}touchend(e,r,o){if(this._tapTime)this._swipePoint&&o.length===0&&this.reset();else{const u=this._tap.touchend(e,r,o);u&&(this._tapTime=e.timeStamp,this._tapPoint=u)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Jo{constructor(e,r,o){this._el=e,this._mousePan=r,this._touchPan=o}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Mc{constructor(e,r,o,u){this._pitchWithRotate=e.pitchWithRotate,this._rollEnabled=e.rollEnabled,this._mouseRotate=r,this._mousePitch=o,this._mouseRoll=u}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}}class Pc{constructor(e,r,o,u){this._el=e,this._touchZoom=r,this._touchRotate=o,this._tapDragZoom=u,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class Ic{constructor(e,r){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=e,this._options=r,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const e=this._map.getCanvasContainer();e.classList.add("maplibregl-cooperative-gestures"),this._container=Q.create("div","maplibregl-cooperative-gesture-screen",e);let r=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(r=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const o=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),u=document.createElement("div");u.className="maplibregl-desktop-message",u.textContent=r,this._container.appendChild(u);const f=document.createElement("div");f.className="maplibregl-mobile-message",f.textContent=o,this._container.appendChild(f),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(Q.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(e){return e[this._bypassKey]}notifyGestureBlocked(e,r){this._enabled&&(this._map.fire(new c.k("cooperativegestureprevented",{gestureType:e,originalEvent:r})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const Qo=d=>d.zoom||d.drag||d.roll||d.pitch||d.rotate;class bs extends c.k{}function ra(d){return d.panDelta&&d.panDelta.mag()||d.zoomDelta||d.bearingDelta||d.pitchDelta||d.rollDelta}
748class ot{constructor(e,r){this.handleWindowEvent=u=>{this.handleEvent(u,`${u.type}Window`)},this.handleEvent=(u,f)=>{if(u.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const y=u.type==="renderFrame"?void 0:u,w={needsRenderFrame:!1},S={},I={},A=u.touches,k=A?this._getMapTouches(A):void 0,R=k?Q.touchPos(this._map.getCanvas(),k):Q.mousePos(this._map.getCanvas(),u);for(const{handlerName:X,handler:W,allowed:K}of this._handlers){if(!W.isEnabled())continue;let ee;this._blockedByActive(I,K,X)?W.reset():W[f||u.type]&&(ee=W[f||u.type](u,R,k),this.mergeHandlerResult(w,S,ee,X,y),ee&&ee.needsRenderFrame&&this._triggerRenderFrame()),(ee||W.isActive())&&(I[X]=W)}const O={};for(const X in this._previousActiveHandlers)I[X]||(O[X]=y);this._previousActiveHandlers=I,(Object.keys(O).length||ra(w))&&(this._changes.push([w,S,O]),this._triggerRenderFrame()),(Object.keys(I).length||ra(w))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:V}=w;V&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],V(this._map))},this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ho(e),this._bearingSnap=r.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(r);const o=this._el;this._listeners=[[o,"touchstart",{passive:!0}],[o,"touchmove",{passive:!1}],[o,"touchend",void 0],[o,"touchcancel",void 0],[o,"mousedown",void 0],[o,"mousemove",void 0],[o,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[o,"mouseover",void 0],[o,"mouseout",void 0],[o,"dblclick",void 0],[o,"click",void 0],[o,"keydown",{capture:!1}],[o,"keyup",void 0],[o,"wheel",{passive:!1}],[o,"contextmenu",void 0],[window,"blur",void 0]];for(const[u,f,y]of this._listeners)Q.addEventListener(u,f,u===document?this.handleWindowEvent:this.handleEvent,y)}destroy(){for(const[e,r,o]of this._listeners)Q.removeEventListener(e,r,e===document?this.handleWindowEvent:this.handleEvent,o)}_addDefaultHandlers(e){const r=this._map,o=r.getCanvasContainer();this._add("mapEvent",new ea(r,e));const u=r.boxZoom=new hh(r,e);this._add("boxZoom",u),e.interactive&&e.boxZoom&&u.enable();const f=r.cooperativeGestures=new Ic(r,e.cooperativeGestures);this._add("cooperativeGestures",f),e.cooperativeGestures&&f.enable();const y=new ks(r),w=new dr(r);r.doubleClickZoom=new zs(w,y),this._add("tapZoom",y),this._add("clickZoom",w),e.interactive&&e.doubleClickZoom&&r.doubleClickZoom.enable();const S=new Ko;this._add("tapDragZoom",S);const I=r.touchPitch=new Yo(r);this._add("touchPitch",I),e.interactive&&e.touchPitch&&r.touchPitch.enable(e.touchPitch);const A=()=>r.project(r.getCenter()),k=function({enable:oe,clickTolerance:le,aroundCenter:he=!0,minPixelCenterThreshold:ue=100,rotateDegreesPerPixelMoved:ve=.8},be){const Ae=new Sn({checkCorrectEvent:Re=>Q.mouseButton(Re)===0&&Re.ctrlKey||Q.mouseButton(Re)===2&&!Re.ctrlKey});return new Qe({clickTolerance:le,move:(Re,Ie)=>{const Ge=be();if(he&&Math.abs(Ge.y-Re.y)>ue)return{bearingDelta:c.c7(new c.P(Re.x,Ie.y),Ie,Ge)};let Ue=(Ie.x-Re.x)*ve;return he&&Ie.y<Ge.y&&(Ue=-Ue),{bearingDelta:Ue}},moveStateManager:Ae,enable:oe,assignEvents:Hs})}(e,A),R=function({enable:oe,clickTolerance:le,pitchDegreesPerPixelMoved:he=-.5}){const ue=new Sn({checkCorrectEvent:ve=>Q.mouseButton(ve)===0&&ve.ctrlKey||Q.mouseButton(ve)===2});return new Qe({clickTolerance:le,move:(ve,be)=>({pitchDelta:(be.y-ve.y)*he}),moveStateManager:ue,enable:oe,assignEvents:Hs})}(e),O=function({enable:oe,clickTolerance:le,rollDegreesPerPixelMoved:he=.3},ue){const ve=new Sn({checkCorrectEvent:be=>Q.mouseButton(be)===2&&be.ctrlKey});return new Qe({clickTolerance:le,move:(be,Ae)=>{const Re=ue();let Ie=(Ae.x-be.x)*he;return Ae.y<Re.y&&(Ie=-Ie),{rollDelta:Ie}},moveStateManager:ve,enable:oe,assignEvents:Hs})}(e,A);r.dragRotate=new Mc(e,k,R,O),this._add("mouseRotate",k,["mousePitch"]),this._add("mousePitch",R,["mouseRotate","mouseRoll"]),this._add("mouseRoll",O,["mousePitch"]),e.interactive&&e.dragRotate&&r.dragRotate.enable();const V=function({enable:oe,clickTolerance:le}){const he=new Sn({checkCorrectEvent:ue=>Q.mouseButton(ue)===0&&!ue.ctrlKey});return new Qe({clickTolerance:le,move:(ue,ve)=>({around:ve,panDelta:ve.sub(ue)}),activateOnStart:!0,moveStateManager:he,enable:oe,assignEvents:Hs})}(e),X=new mh(e,r);r.dragPan=new Jo(o,V,X),this._add("mousePan",V),this._add("touchPan",X,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&r.dragPan.enable(e.dragPan);const W=new yh,K=new Wo;r.touchZoomRotate=new Pc(o,K,W,S),this._add("touchRotate",W,["touchPan","touchZoom"]),this._add("touchZoom",K,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&r.touchZoomRotate.enable(e.touchZoomRotate);const ee=r.scrollZoom=new Th(r,()=>
vendor: 4,315 bytes, line 748
748this._triggerRenderFrame());this._add("scrollZoom",ee,["mousePan"]),e.interactive&&e.scrollZoom&&r.scrollZoom.enable(e.scrollZoom);const se=r.keyboard=new xh(r);this._add("keyboard",se),e.interactive&&e.keyboard&&r.keyboard.enable(),this._add("blockableMapEvent",new ed(r))}_add(e,r,o){this._handlers.push({handlerName:e,handler:r,allowed:o}),this._handlersById[e]=r}stop(e){if(!this._updatingCamera){for(const{handler:r}of this._handlers)r.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(const{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Qo(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,r,o){for(const u in e)if(u!==o&&(!r||r.indexOf(u)<0))return!0;return!1}_getMapTouches(e){const r=[];for(const o of e)this._el.contains(o.target)&&r.push(o);return r}mergeHandlerResult(e,r,o,u,f){if(!o)return;c.e(e,o);const y={handlerName:u,originalEvent:o.originalEvent||f};o.zoomDelta!==void 0&&(r.zoom=y),o.panDelta!==void 0&&(r.drag=y),o.rollDelta!==void 0&&(r.roll=y),o.pitchDelta!==void 0&&(r.pitch=y),o.bearingDelta!==void 0&&(r.rotate=y)}_applyChanges(){const e={},r={},o={};for(const[u,f,y]of this._changes)u.panDelta&&(e.panDelta=(e.panDelta||new c.P(0,0))._add(u.panDelta)),u.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+u.zoomDelta),u.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+u.bearingDelta),u.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+u.pitchDelta),u.rollDelta&&(e.rollDelta=(e.rollDelta||0)+u.rollDelta),u.around!==void 0&&(e.around=u.around),u.pinchAround!==void 0&&(e.pinchAround=u.pinchAround),u.noInertia&&(e.noInertia=u.noInertia),c.e(r,f),c.e(o,y);this._updateMapTransform(e,r,o),this._changes=[]}_updateMapTransform(e,r,o){const u=this._map,f=u._getTransformForUpdate(),y=u.terrain;if(!(ra(e)||y&&this._terrainMovement))return this._fireEvents(r,o,!0);u._stop(!0);let{panDelta:w,zoomDelta:S,bearingDelta:I,pitchDelta:A,rollDelta:k,around:R,pinchAround:O}=e;O!==void 0&&(R=O),R=R||u.transform.centerPoint,y&&!f.isPointOnMapSurface(R)&&(R=f.centerPoint);const V={panDelta:w,zoomDelta:S,rollDelta:k,pitchDelta:A,bearingDelta:I,around:R};this._map.cameraHelper.useGlobeControls&&!f.isPointOnMapSurface(R)&&(R=f.centerPoint);const X=R.distSqr(f.centerPoint)<.01?f.center:f.screenPointToLocation(w?R.sub(w):R);y?(this._map.cameraHelper.handleMapControlsRollPitchBearingZoom(V,f),this._terrainMovement||!r.drag&&!r.zoom?r.drag&&this._terrainMovement?f.setCenter(f.screenPointToLocation(f.centerPoint.sub(w))):this._map.cameraHelper.handleMapControlsPan(V,f,X):(this._terrainMovement=!0,this._map._elevationFreeze=!0,this._map.cameraHelper.handleMapControlsPan(V,f,X))):(this._map.cameraHelper.handleMapControlsRollPitchBearingZoom(V,f),this._map.cameraHelper.handleMapControlsPan(V,f,X)),u._applyUpdatedTransform(f),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(r,o,!0)}_fireEvents(e,r,o){const u=Qo(this._eventsInProgress),f=Qo(e),y={};for(const k in e){const{originalEvent:R}=e[k];this._eventsInProgress[k]||(y[`${k}start`]=R),this._eventsInProgress[k]=e[k]}!u&&f&&this._fireEvent("movestart",f.originalEvent);for(const k in y)this._fireEvent(k,y[k]);f&&this._fireEvent("move",f.originalEvent);for(const k in e){const{originalEvent:R}=e[k];this._fireEvent(k,R)}const w={};let S;for(const k in this._eventsInProgress){const{handlerName:R,originalEvent:O}=this._eventsInProgress[k];this._handlersById[R].isActive()||(delete this._eventsInProgress[k],S=r[R]||O,w[`${k}end`]=S)}for(const k in w)this._fireEvent(k,w[k]);const I=Qo(this._eventsInProgress),A=(u||f)&&!I;if(A&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const k=this._map._getTransformForUpdate();this._map.getCenterClampedToGround()&&k.recalculateZoomAndCenter(this._map.terrain),this._map._applyUpdatedTransform(k)}if(o&&A){this._updatingCamera=!0;const k=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),R=O=>O!==0&&-this._bearingSnap<O&&O<this._bearingSnap;!k||!k.essential&&ge.prefersReducedMotion?(this._map.fire(new c.k("moveend",{originalEvent:S})),R(this._map.getBearing())&&this._map.resetNorth()):(R(k.bearing||this._map.getBearing())&&
vendor: 15,199 bytes, line 748
748(k.bearing=0),k.freezeElevation=!0,this._map.easeTo(k,{originalEvent:S})),this._updatingCamera=!1}}_fireEvent(e,r){this._map.fire(new c.k(e,r?{originalEvent:r}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(e=>{delete this._frameId,this.handleEvent(new bs("renderFrame",{timeStamp:e})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class mt extends c.E{constructor(e,r,o){super(),this._renderFrameCallback=()=>{const u=Math.min((ge.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(u)),u<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=o.bearingSnap,this.cameraHelper=r,this.on("moveend",()=>{delete this._requestedCameraState})}migrateProjection(e,r){e.apply(this.transform),this.transform=e,this.cameraHelper=r}getCenter(){return new c.N(this.transform.center.lng,this.transform.center.lat)}setCenter(e,r){return this.jumpTo({center:e},r)}getCenterElevation(){return this.transform.elevation}setCenterElevation(e,r){return this.jumpTo({elevation:e},r),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(e){this._centerClampedToGround=e}panBy(e,r,o){return e=c.P.convert(e).mult(-1),this.panTo(this.transform.center,c.e({offset:e},r),o)}panTo(e,r,o){return this.easeTo(c.e({center:e},r),o)}getZoom(){return this.transform.zoom}setZoom(e,r){return this.jumpTo({zoom:e},r),this}zoomTo(e,r,o){return this.easeTo(c.e({zoom:e},r),o)}zoomIn(e,r){return this.zoomTo(this.getZoom()+1,e,r),this}zoomOut(e,r){return this.zoomTo(this.getZoom()-1,e,r),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(e,r){return e!=this.transform.fov&&(this.transform.setFov(e),this.fire(new c.k("movestart",r)).fire(new c.k("move",r)).fire(new c.k("moveend",r))),this}getBearing(){return this.transform.bearing}setBearing(e,r){return this.jumpTo({bearing:e},r),this}getPadding(){return this.transform.padding}setPadding(e,r){return this.jumpTo({padding:e},r),this}rotateTo(e,r,o){return this.easeTo(c.e({bearing:e},r),o)}resetNorth(e,r){return this.rotateTo(0,c.e({duration:1e3},e),r),this}resetNorthPitch(e,r){return this.easeTo(c.e({bearing:0,pitch:0,roll:0,duration:1e3},e),r),this}snapToNorth(e,r){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,r):this}getPitch(){return this.transform.pitch}setPitch(e,r){return this.jumpTo({pitch:e},r),this}getRoll(){return this.transform.roll}setRoll(e,r){return this.jumpTo({roll:e},r),this}cameraForBounds(e,r){e=Me.convert(e).adjustAntiMeridian();const o=r&&r.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),o,r)}_cameraForBoxAndBearing(e,r,o,u){const f={top:0,bottom:0,right:0,left:0};if(typeof(u=c.e({padding:f,offset:[0,0],maxZoom:this.transform.maxZoom},u)).padding=="number"){const I=u.padding;u.padding={top:I,bottom:I,right:I,left:I}}const y=c.e(f,u.padding);u.padding=y;const w=this.transform,S=new Me(e,r);return this.cameraHelper.cameraForBoxAndBearing(u,y,S,o,w)}fitBounds(e,r,o){return this._fitInternal(this.cameraForBounds(e,r),r,o)}fitScreenCoordinates(e,r,o,u,f){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(c.P.convert(e)),this.transform.screenPointToLocation(c.P.convert(r)),o,u),u,f)}_fitInternal(e,r,o){return e?(delete(r=c.e(e,r)).padding,r.linear?this.easeTo(r,o):this.flyTo(r,o)):this}jumpTo(e,r){this.stop();const o=this._getTransformForUpdate();let u=!1,f=!1,y=!1;const w=o.zoom;this.cameraHelper.handleJumpToCenterZoom(o,e);const S=o.zoom!==w;return"elevation"in e&&o.elevation!==+e.elevation&&o.setElevation(+e.elevation),"bearing"in e&&o.bearing!==+e.bearing&&(u=!0,o.setBearing(+e.bearing)),"pitch"in e&&o.pitch!==+e.pitch&&(f=!0,o.setPitch(+e.pitch)),"roll"in e&&o.roll!==+e.roll&&(y=!0,o.setRoll(+e.roll)),e.padding==null||o.isPaddingEqual(e.padding)||o.setPadding(e.padding),this._applyUpdatedTransform(o),this.fire(new c.k("movestart",r)).fire(new c.k("move",r)),S&&this.fire(new c.k("zoomstart",r)).fire(new c.k("zoom",r)).fire(new c.k("zoomend",r)),u&&this.fire(new c.k("rotatestart",r)).fire(new c.k("rotate",r)).fire(new c.k("rotateend",r)),f&&this.fire(new c.k("pitchstart",r)).fire(new c.k("pitch",r)).fire(new c.k("pitchend",r)),y&&this.fire(new c.k("rollstart",r)).fire(new c.k("roll",r)).fire(new c.k("rollend",r)),this.fire(new c.k("moveend",r))}calculateCameraOptionsFromTo(e,r,o,u=0){const f=c.Y.fromLngLat(e,r),y=c.Y.fromLngLat(o,u),w=y.x-f.x,S=y.y-f.y,I=y.z-f.z,A=Math.hypot(w,S,I);if(A===0)throw new Error("Can't calculate camera options with same From and To");const k=Math.hypot(w,S),R=c.a8(this.transform.cameraToCenterDistance/A/this.transform.tileSize),O=180*Math.atan2(w,-S)/Math.PI;let V=180*Math.acos(k/A)/Math.PI;return V=I<0?90-V:90+V,{center:y.toLngLat(),elevation:u,zoom:R,pitch:V,bearing:O}}calculateCameraOptionsFromCameraLngLatAltRotation(e,r,o,u,f){const y=this.transform.calculateCenterFromCameraLngLatAlt(e,r,o,u);return{center:y.center,elevation:y.elevation,zoom:y.zoom,bearing:o,pitch:u,roll:f}}easeTo(e,r){this._stop(!1,e.easeId),((e=c.e({offset:[0,0],duration:500,easing:c.c8},e)).animate===!1||!e.essential&&ge.prefersReducedMotion)&&(e.duration=0);const o=this._getTransformForUpdate(),u=this.getBearing(),f=o.pitch,y=o.roll,w="bearing"in e?this._normalizeBearing(e.bearing,u):u,S="pitch"in e?+e.pitch:f,I="roll"in e?this._normalizeBearing(e.roll,y):y,A="padding"in e?e.padding:o.padding,k=c.P.convert(e.offset);let R,O;e.around&&(R=c.N.convert(e.around),O=o.locationToScreenPoint(R));const V={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},X=this.cameraHelper.handleEaseTo(o,{bearing:w,pitch:S,roll:I,padding:A,around:R,aroundPoint:O,offsetAsPoint:k,offset:e.offset,zoom:e.zoom,center:e.center});return this._rotating=this._rotating||u!==w,this._pitching=this._pitching||S!==f,this._rolling=this._rolling||I!==y,this._padding=!o.isPaddingEqual(A),this._zooming=this._zooming||X.isZooming,this._easeId=e.easeId,this._prepareEase(r,e.noMoveStart,V),this.terrain&&this._prepareElevation(X.elevationCenter),this._ease(W=>{X.easeFunc(W),this.terrain&&!e.freezeElevation&&this._updateElevation(W),this._applyUpdatedTransform(o),this._fireMoveEvents(r)},W=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(r,W)},e),this}_prepareEase(e,r,o={}){this._moving=!0,r||o.moving||this.fire(new c.k("movestart",e)),this._zooming&&!o.zooming&&this.fire(new c.k("zoomstart",e)),this._rotating&&!o.rotating&&this.fire(new c.k("rotatestart",e)),this._pitching&&!o.pitching&&this.fire(new c.k("pitchstart",e)),this._rolling&&!o.rolling&&this.fire(new c.k("rollstart",e))}_prepareElevation(e){this._elevationCenter=e,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(e,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(e){this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));const r=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(e<1&&r!==this._elevationTarget){const o=this._elevationTarget-this._elevationStart;this._elevationStart+=e*(o-(r-(o*e+this._elevationStart))/(1-e)),this._elevationTarget=r}this.transform.setElevation(c.y.number(this._elevationStart,this._elevationTarget,e))}_finalizeElevation(){this._elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(e){if(!this.terrain&&e.elevation>=0&&e.pitch<=90)return{};const r=e.getCameraLngLat(),o=e.getCameraAltitude(),u=this.terrain?this.terrain.getElevationForLngLatZoom(r,e.zoom):0;if(o<u){const f=this.calculateCameraOptionsFromTo(r,u,e.center,e.elevation);return{pitch:f.pitch,zoom:f.zoom}}return{}}_applyUpdatedTransform(e){const r=[];if(r.push(u=>this._elevateCameraIfInsideTerrain(u)),this.transformCameraUpdate&&r.push(u=>this.transformCameraUpdate(u)),!r.length)return;const o=e.clone();for(const u of r){const f=o.clone(),{center:y,zoom:w,roll:S,pitch:I,bearing:A,elevation:k}=u(f);y&&f.setCenter(y),k!==void 0&&f.setElevation(k),w!==void 0&&f.setZoom(w),S!==void 0&&f.setRoll(S),I!==void 0&&f.setPitch(I),A!==void 0&&f.setBearing(A),o.apply(f)}this.transform.apply(o)}_fireMoveEvents(e){this.fire(new c.k("move",e)),this._zooming&&this.fire(new c.k("zoom",e)),this._rotating&&this.fire(new c.k("rotate",e)),this._pitching&&this.fire(new c.k("pitch",e)),this._rolling&&this.fire(new c.k("roll",e))}_afterEase(e,r){if(this._easeId&&r&&this._easeId===r)return;delete this._easeId;const o=this._zooming,u=this._rotating,f=this._pitching,y=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,o&&this.fire(new c.k("zoomend",e)),u&&this.fire(new c.k("rotateend",e)),f&&this.fire(new c.k("pitchend",e)),y&&this.fire(new c.k("rollend",e)),this.fire(new c.k("moveend",e))}flyTo(e,r){if(!e.essential&&ge.prefersReducedMotion){const Ie=c.M(e,["center","zoom","bearing","pitch","roll","elevation"]);return this.jumpTo(Ie,r)}this.stop(),e=c.e({offset:[0,0],speed:1.2,curve:1.42,easing:c.c8},e);const o=this._getTransformForUpdate(),u=o.bearing,f=o.pitch,y=o.roll,w=o.padding,S="bearing"in e?this._normalizeBearing(e.bearing,u):u,I="pitch"in e?+e.pitch:f,A="roll"in e?this._normalizeBearing(e.roll,y):y,k="padding"in e?e.padding:o.padding,R=c.P.convert(e.offset);let O=o.centerPoint.add(R);const V=o.screenPointToLocation(O),X=this.cameraHelper.handleFlyTo(o,{bearing:S,pitch:I,roll:A,padding:k,locationAtOffset:V,offsetAsPoint:R,center:e.center,minZoom:e.minZoom,zoom:e.zoom});let W=e.curve;const K=Math.max(o.width,o.height),ee=K/X.scaleOfZoom,se=X.pixelPathLength;typeof X.scaleOfMinZoom=="number"&&(W=Math.sqrt(K/X.scaleOfMinZoom/se*2));const oe=W*W;function le(Ie){const Ge=(ee*ee-K*K+(Ie?-1:1)*oe*oe*se*se)/(2*(Ie?ee:K)*oe*se);return Math.log(Math.sqrt(Ge*Ge+1)-Ge)}function he(Ie){return(Math.exp(Ie)-Math.exp(-Ie))/2}function ue(Ie){return(Math.exp(Ie)+Math.exp(-Ie))/2}const ve=le(!1);let be=function(Ie){return ue(ve)/ue(ve+W*Ie)},Ae=function(Ie){return K*((ue(ve)*(he(Ge=ve+W*Ie)/ue(Ge))-he(ve))/oe)/se;var Ge},Re=(le(!0)-ve)/W;if(Math.abs(se)<2e-6||!isFinite(Re)){if(Math.abs(K-ee)<1e-6)return this.easeTo(e,r);const Ie=ee<K?-1:1;Re=Math.abs(Math.log(ee/K))/W,Ae=()=>0,be=Ge=>Math.exp(Ie*W*Ge)}return e.duration="duration"in e?+e.duration:1e3*Re/("screenSpeed"in e?+e.screenSpeed/W:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=u!==S,this._pitching=I!==f,this._rolling=A!==y,this._padding=!o.isPaddingEqual(k),this._prepareEase(r,!1),this.terrain&&this._prepareElevation(X.targetCenter),this._ease(Ie=>{const Ge=Ie*Re,Ue=1/be(Ge),De=Ae(Ge);this._rotating&&o.setBearing(c.y.number(u,S,Ie)),this._pitching&&o.setPitch(c.y.number(f,I,Ie)),this._rolling&&o.setRoll(c.y.number(y,A,Ie)),this._padding&&(o.interpolatePadding(w,k,Ie),O=o.centerPoint.add(R)),X.easeFunc(Ie,Ue,De,O),this.terrain&&!e.freezeElevation&&this._updateElevation(Ie),this._applyUpdatedTransform(o),this._fireMoveEvents(r)},()=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(r)},e),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,r){var o;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const u=this._onEaseEnd;delete this._onEaseEnd,u.call(this,r)}return e||(o=this.handlers)===null||o===void 0||o.stop(!1),this}_ease(e,r,o){o.animate===!1||o.duration===0?(e(1),r()):(this._easeStart=ge.now(),this._easeOptions=o,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,r){e=c.aI(e,-180,180);const o=Math.abs(e-r);return Math.abs(e-360-r)<o&&(e-=360),Math.abs(e+360-r)<o&&(e+=360),e}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLatZoom(c.N.convert(e),this.transform.tileZoom):null}}const $a={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class el{constructor(e=$a){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=r=>{!r||r.sourceDataType!=="metadata"&&r.sourceDataType!=="visibility"&&r.dataType!=="style"&&r.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=Q.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=Q.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=Q.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){Q.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._sanitizedAttributionHTML=void 0}_setElementTitle(e,r){const o=this._map._getUIString(`AttributionControl.${r}`);e.title=o,e.setAttribute("aria-label",o)}_updateAttributions(){if(!this._map.style)return;let e=[];
748if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map(u=>typeof u!="string"?"":u)):typeof this.options.customAttribution=="string"&&e.push(this.options.customAttribution)),this._map.style.stylesheet){const u=this._map.style.stylesheet;this.styleOwner=u.owner,this.styleId=u.id}const r=this._map.style.sourceCaches;for(const u in r){const f=r[u];if(f.used||f.usedForTerrain){const y=f.getSource();y.attribution&&e.indexOf(y.attribution)<0&&e.push(y.attribution)}}e=e.filter(u=>String(u).trim()),e.sort((u,f)=>u.length-f.length),e=e.filter((u,f)=>{for(let y=f+1;y<e.length;y++)if(e[y].indexOf(u)>=0)return!1;return!0});const o=e.join(" | ");o!==this._sanitizedAttributionHTML&&(this._sanitizedAttributionHTML=Q.sanitize(o),e.length?(this._innerContainer.innerHTML=this._sanitizedAttributionHTML,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class tl{constructor(e={}){this._updateCompact=()=>{const r=this._container.children;if(r.length){const o=r[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&o.classList.add("maplibregl-compact"):o.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){this._map=e,this._compact=this.options&&this.options.compact,this._container=Q.create("div","maplibregl-ctrl");const r=Q.create("a","maplibregl-ctrl-logo");return r.target="_blank",r.rel="noopener nofollow",r.href="https://maplibre.org/",r.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),r.setAttribute("rel","noopener nofollow"),this._container.appendChild(r),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){Q.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Ci{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){const r=++this._id;return this._queue.push({callback:e,id:r,cancelled:!1}),r}remove(e){const r=this._currentlyRunning,o=r?this._queue.concat(r):this._queue;for(const u of o)if(u.id===e)return void(u.cancelled=!0)}run(e=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const r=this._currentlyRunning=this._queue;this._queue=[];for(const o of r)if(!o.cancelled&&(o.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Sh=c.aA([{name:"a_pos3d",type:"Int16",components:3}]);class ws extends c.E{constructor(e){super(),this._lastTilesetChange=ge.now(),this.sourceCache=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=e._source.tileSize*2**this.deltaZoom,e.usedForTerrain=!0,e.tileSize=this.tileSize}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(e,r){this.sourceCache.update(e,r),this._renderableTilesKeys=[];const o={};for(const u of H(e,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:r,calculateTileZoom:this.sourceCache._source.calculateTileZoom}))o[u.key]=!0,this._renderableTilesKeys.push(u.key),this._tiles[u.key]||(u.terrainRttPosMatrix32f=new Float64Array(16),c.bL(u.terrainRttPosMatrix32f,0,c.X,c.X,0,0,1),this._tiles[u.key]=new Dr(u,this.tileSize),this._lastTilesetChange=ge.now());for(const u in this._tiles)o[u]||delete this._tiles[u]}freeRtt(e){for(const r in this._tiles){const o=this._tiles[r];(!e||o.tileID.equals(e)||o.tileID.isChildOf(e)||e.isChildOf(o.tileID))&&(o.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(e=>this.getTileByID(e))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e){const r={};for(const o of this._renderableTilesKeys){const u=this._tiles[o].tileID,f=e.clone(),y=c.a$();if(u.canonical.equals(e.canonical))c.bL(y,0,c.X,c.X,0,0,1);else if(u.canonical.isChildOf(e.canonical)){const w=u.canonical.z-e.canonical.z,S=u.canonical.x-(u.canonical.x>>w<<w),I=u.canonical.y-(u.canonical.y>>w<<w),A=c.X>>w;
vendor: 4,545 bytes, line 748
748c.bL(y,0,A,A,0,0,1),c.J(y,y,[-S*A,-I*A,0])}else{if(!e.canonical.isChildOf(u.canonical))continue;{const w=e.canonical.z-u.canonical.z,S=e.canonical.x-(e.canonical.x>>w<<w),I=e.canonical.y-(e.canonical.y>>w<<w),A=c.X>>w;c.bL(y,0,c.X,c.X,0,0,1),c.J(y,y,[S*A,I*A,0]),c.K(y,y,[1/2**w,1/2**w,0])}}f.terrainRttPosMatrix32f=new Float32Array(y),r[o]=f}return r}getSourceTile(e,r){const o=this.sourceCache._source;let u=e.overscaledZ-this.deltaZoom;if(u>o.maxzoom&&(u=o.maxzoom),u<o.minzoom)return null;this._sourceTileCache[e.key]||(this._sourceTileCache[e.key]=e.scaledTo(u).key);let f=this.sourceCache.getTileByID(this._sourceTileCache[e.key]);if((!f||!f.dem)&&r)for(;u>=o.minzoom&&(!f||!f.dem);)f=this.sourceCache.getTileByID(e.scaledTo(u--).key);return f}anyTilesAfterTime(e=Date.now()){return this._lastTilesetChange>=e}}class td{constructor(e,r,o){this._meshCache={},this.painter=e,this.sourceCache=new ws(r),this.options=o,this.exaggeration=typeof o.exaggeration=="number"?o.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(e,r,o,u=c.X){var f;if(!(r>=0&&r<u&&o>=0&&o<u))return 0;const y=this.getTerrainData(e),w=(f=y.tile)===null||f===void 0?void 0:f.dem;if(!w)return 0;const S=c.c9([],[r/u*c.X,o/u*c.X],y.u_terrain_matrix),I=[S[0]*w.dim,S[1]*w.dim],A=Math.floor(I[0]),k=Math.floor(I[1]),R=I[0]-A,O=I[1]-k;return w.get(A,k)*(1-R)*(1-O)+w.get(A+1,k)*R*(1-O)+w.get(A,k+1)*(1-R)*O+w.get(A+1,k+1)*R*O}getElevationForLngLatZoom(e,r){if(!c.ca(r,e.wrap()))return 0;const{tileID:o,mercatorX:u,mercatorY:f}=this._getOverscaledTileIDFromLngLatZoom(e,r);return this.getElevation(o,u%c.X,f%c.X,c.X)}getElevation(e,r,o,u=c.X){return this.getDEMElevation(e,r,o,u)*this.exaggeration}getTerrainData(e){if(!this._emptyDemTexture){const u=this.painter.context,f=new c.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new pt(u,f,u.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new pt(u,new c.R({width:1,height:1}),u.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(u.gl.NEAREST,u.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=c.aq([])}const r=this.sourceCache.getSourceTile(e,!0);if(r&&r.dem&&(!r.demTexture||r.needsTerrainPrepare)){const u=this.painter.context;r.demTexture=this.painter.getTileTexture(r.dem.stride),r.demTexture?r.demTexture.update(r.dem.getPixels(),{premultiply:!1}):r.demTexture=new pt(u,r.dem.getPixels(),u.gl.RGBA,{premultiply:!1}),r.demTexture.bind(u.gl.NEAREST,u.gl.CLAMP_TO_EDGE),r.needsTerrainPrepare=!1}const o=r&&r+r.tileID.key+e.key;if(o&&!this._demMatrixCache[o]){const u=this.sourceCache.sourceCache._source.maxzoom;let f=e.canonical.z-r.tileID.canonical.z;e.overscaledZ>e.canonical.z&&(e.canonical.z>=u?f=e.canonical.z-u:c.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const y=e.canonical.x-(e.canonical.x>>f<<f),w=e.canonical.y-(e.canonical.y>>f<<f),S=c.cb(new Float64Array(16),[1/(c.X<<f),1/(c.X<<f),0]);c.J(S,S,[y*c.X,w*c.X,0]),this._demMatrixCache[e.key]={matrix:S,coord:e}}return{u_depth:2,u_terrain:3,u_terrain_dim:r&&r.dem&&r.dem.dim||1,u_terrain_matrix:o?this._demMatrixCache[e.key].matrix:this._emptyDemMatrix,u_terrain_unpack:r&&r.dem&&r.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(r&&r.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:r}}getFramebuffer(e){const r=this.painter,o=r.width/devicePixelRatio,u=r.height/devicePixelRatio;return!this._fbo||this._fbo.width===o&&this._fbo.height===u||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new pt(r.context,{width:o,height:u,data:null},r.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(r.context.gl.NEAREST,r.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new pt(r.context,{width:o,height:u,data:null},r.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(r.context.gl.NEAREST,r.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=r.context.createFramebuffer(o,u,!0,!1),this._fbo.depthAttachment.set(r.context.createRenderbuffer(r.context.gl.DEPTH_COMPONENT16,o,u))),this._fbo.colorAttachment.set(e==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const e=this.painter.context;if(this._coordsTexture)return this._coordsTexture;
vendor: 16,855 bytes, line 748
748const r=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let f=0,y=0;f<this._coordsTextureSize;f++)for(let w=0;w<this._coordsTextureSize;w++,y+=4)r[y+0]=255&w,r[y+1]=255&f,r[y+2]=w>>8<<4|f>>8,r[y+3]=0;const o=new c.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(r.buffer)),u=new pt(e,o,e.gl.RGBA,{premultiply:!1});return u.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._coordsTexture=u,u}pointCoordinate(e){this.painter.maybeDrawDepthAndCoords(!0);const r=new Uint8Array(4),o=this.painter.context,u=o.gl,f=Math.round(e.x*this.painter.pixelRatio/devicePixelRatio),y=Math.round(e.y*this.painter.pixelRatio/devicePixelRatio),w=Math.round(this.painter.height/devicePixelRatio);o.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),u.readPixels(f,w-y-1,1,1,u.RGBA,u.UNSIGNED_BYTE,r),o.bindFramebuffer.set(null);const S=r[0]+(r[2]>>4<<8),I=r[1]+((15&r[2])<<8),A=this.coordsIndex[255-r[3]],k=A&&this.sourceCache.getTileByID(A);if(!k)return null;const R=this._coordsTextureSize,O=(1<<k.tileID.canonical.z)*R;return new c.Y((k.tileID.canonical.x*R+S)/O+k.tileID.wrap,(k.tileID.canonical.y*R+I)/O,this.getElevation(k.tileID,S,I,R))}depthAtPoint(e){const r=new Uint8Array(4),o=this.painter.context,u=o.gl;return o.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),u.readPixels(e.x,this.painter.height/devicePixelRatio-e.y-1,1,1,u.RGBA,u.UNSIGNED_BYTE,r),o.bindFramebuffer.set(null),(r[0]/16777216+r[1]/65536+r[2]/256+r[3])/256}getTerrainMesh(e){var r;const o=((r=this.painter.style.projection)===null||r===void 0?void 0:r.transitionState)>0,u=o&&e.canonical.y===0,f=o&&e.canonical.y===(1<<e.canonical.z)-1,y=`m_${u?"n":""}_${f?"s":""}`;if(this._meshCache[y])return this._meshCache[y];const w=this.painter.context,S=new c.cc,I=new c.aE,A=this.meshSize,k=c.X/A,R=A*A;for(let ue=0;ue<=A;ue++)for(let ve=0;ve<=A;ve++)S.emplaceBack(ve*k,ue*k,0);for(let ue=0;ue<R;ue+=A+1)for(let ve=0;ve<A;ve++)I.emplaceBack(ve+ue,A+ve+ue+1,A+ve+ue+2),I.emplaceBack(ve+ue,A+ve+ue+2,ve+ue+1);const O=S.length,V=O+(A+1),X=(A+1)*A,W=u?c.b6:0,K=u?0:1,ee=f?c.b7:c.X,se=f?0:1;for(let ue=0;ue<=A;ue++)S.emplaceBack(ue*k,W,K);for(let ue=0;ue<=A;ue++)S.emplaceBack(ue*k,ee,se);for(let ue=0;ue<A;ue++)I.emplaceBack(X+ue,V+ue,V+ue+1),I.emplaceBack(X+ue,V+ue+1,X+ue+1),I.emplaceBack(0+ue,O+ue+1,O+ue),I.emplaceBack(0+ue,0+ue+1,O+ue+1);const oe=S.length,le=oe+2*(A+1);for(const ue of[0,1])for(let ve=0;ve<=A;ve++)for(const be of[0,1])S.emplaceBack(ue*c.X,ve*k,be);for(let ue=0;ue<2*A;ue+=2)I.emplaceBack(oe+ue,oe+ue+1,oe+ue+3),I.emplaceBack(oe+ue,oe+ue+3,oe+ue+2),I.emplaceBack(le+ue,le+ue+3,le+ue+1),I.emplaceBack(le+ue,le+ue+2,le+ue+3);const he=new vs(w.createVertexBuffer(S,Sh.members),w.createIndexBuffer(I),c.aD.simpleSegment(0,0,S.length,I.length));return this._meshCache[y]=he,he}getMeshFrameDelta(e){return 2*Math.PI*c.bo/Math.pow(2,Math.max(e,0))/5}getMinTileElevationForLngLatZoom(e,r){var o;const{tileID:u}=this._getOverscaledTileIDFromLngLatZoom(e,r);return(o=this.getMinMaxElevation(u).minElevation)!==null&&o!==void 0?o:0}getMinMaxElevation(e){const r=this.getTerrainData(e).tile,o={minElevation:null,maxElevation:null};return r&&r.dem&&(o.minElevation=r.dem.min*this.exaggeration,o.maxElevation=r.dem.max*this.exaggeration),o}_getOverscaledTileIDFromLngLatZoom(e,r){const o=c.Y.fromLngLat(e.wrap()),u=(1<<r)*c.X,f=o.x*u,y=o.y*u,w=Math.floor(f/c.X),S=Math.floor(y/c.X);return{tileID:new c.S(r,0,r,w,S),mercatorX:f,mercatorY:y}}}class Ua{constructor(e,r,o){this._context=e,this._size=r,this._tileSize=o,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const e of this._objects)e.texture.destroy(),e.fbo.destroy()}_createObject(e){const r=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),o=new pt(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return o.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),this._context.extTextureFilterAnisotropic&&this._context.gl.texParameterf(this._context.gl.TEXTURE_2D,this._context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this._context.extTextureFilterAnisotropicMax),r.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),r.colorAttachment.set(o.texture),{id:e,fbo:r,texture:o,stamp:-1,inUse:!1}}getObjectForId(e){return this._objects[e]}useObject(e){e.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(r=>e.id!==r),this._recentlyUsed.push(e.id)}stampObject(e){e.stamp=++this._stamp}getOrCreateFreeObject(){for(const r of this._recentlyUsed)if(!this._objects[r].inUse)return this._objects[r];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const e=this._createObject(this._objects.length);return this._objects.push(e),e}freeObject(e){e.inUse=!1}freeAllObjects(){for(const e of this._objects)this.freeObject(e)}isFull(){return!(this._objects.length<this._size)&&this._objects.some(e=>!e.inUse)===!1}}const sr={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Lr{constructor(e,r){this.painter=e,this.terrain=r,this.pool=new Ua(e.context,30,r.sourceCache.tileSize*r.qualityFactor)}destruct(){this.pool.destruct()}getTexture(e){return this.pool.getObjectForId(e.rtt[this._stacks.length-1].id).texture}prepareForRender(e,r){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=e._order.filter(o=>!e._layers[o].isHidden(r)),this._coordsAscending={};for(const o in e.sourceCaches){this._coordsAscending[o]={};const u=e.sourceCaches[o].getVisibleCoordinates();for(const f of u){const y=this.terrain.sourceCache.getTerrainCoords(f);for(const w in y)this._coordsAscending[o][w]||(this._coordsAscending[o][w]=[]),this._coordsAscending[o][w].push(y[w])}}this._coordsAscendingStr={};for(const o of e._order){const u=e._layers[o],f=u.source;if(sr[u.type]&&!this._coordsAscendingStr[f]){this._coordsAscendingStr[f]={};for(const y in this._coordsAscending[f])this._coordsAscendingStr[f][y]=this._coordsAscending[f][y].map(w=>w.key).sort().join()}}for(const o of this._renderableTiles)for(const u in this._coordsAscendingStr){const f=this._coordsAscendingStr[u][o.tileID.key];f&&f!==o.rttCoords[u]&&(o.rtt=[])}}renderLayer(e,r){if(e.isHidden(this.painter.transform.zoom))return!1;const o=Object.assign(Object.assign({},r),{isRenderingToTexture:!0}),u=e.type,f=this.painter,y=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(sr[u]&&(this._prevType&&sr[this._prevType]||this._stacks.push([]),this._prevType=u,this._stacks[this._stacks.length-1].push(e.id),!y))return!0;if(sr[this._prevType]||sr[u]&&y){this._prevType=u;const w=this._stacks.length-1,S=this._stacks[w]||[];for(const I of this._renderableTiles){if(this.pool.isFull()&&(bc(this.painter,this.terrain,this._rttTiles,o),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(I),I.rtt[w]){const k=this.pool.getObjectForId(I.rtt[w].id);if(k.stamp===I.rtt[w].stamp){this.pool.useObject(k);continue}}const A=this.pool.getOrCreateFreeObject();this.pool.useObject(A),this.pool.stampObject(A),I.rtt[w]={id:A.id,stamp:A.stamp},f.context.bindFramebuffer.set(A.fbo.framebuffer),f.context.clear({color:c.b4.transparent,stencil:0}),f.currentStencilSource=void 0;for(let k=0;k<S.length;k++){const R=f.style._layers[S[k]],O=R.source?this._coordsAscending[R.source][I.tileID.key]:[I.tileID];f.context.viewport.set([0,0,A.fbo.width,A.fbo.height]),f._renderTileClippingMasks(R,O,!0),f.renderLayer(f,f.style.sourceCaches[R.source],R,O,o),R.source&&(I.rttCoords[R.source]=this._coordsAscendingStr[R.source][I.tileID.key])}}return bc(this.painter,this.terrain,this._rttTiles,o),this._rttTiles=[],this.pool.freeAllObjects(),sr[u]}return!1}}const Mh={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","GlobeControl.Enable":"Enable globe","GlobeControl.Disable":"Disable globe","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use ⌘ + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},Za=B,qa={hash:!1,interactive:!0,bearingSnap:7,attributionControl:$a,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 0},scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:c.a.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0},Cc={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};class Ec{constructor(e,r,o=!1){this.mousedown=f=>{this.startMove(f,Q.mousePos(this.element,f)),Q.addEventListener(window,"mousemove",this.mousemove),Q.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=f=>{this.move(f,Q.mousePos(this.element,f))},this.mouseup=f=>{this._rotatePitchHanlder.dragEnd(f),this.offTemp()},this.touchstart=f=>{f.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=Q.touchPos(this.element,f.targetTouches)[0],this.startMove(f,this._startPos),Q.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),Q.addEventListener(window,"touchend",this.touchend))},this.touchmove=f=>{f.targetTouches.length!==1?this.reset():(this._lastPos=Q.touchPos(this.element,f.targetTouches)[0],this.move(f,this._lastPos))},this.touchend=f=>{f.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this._rotatePitchHanlder.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=r;const u=new Va;this._rotatePitchHanlder=new Qe({clickTolerance:3,move:(f,y)=>{const w=r.getBoundingClientRect(),S=new c.P((w.bottom-w.top)/2,(w.right-w.left)/2);return{bearingDelta:c.c7(new c.P(f.x,y.y),y,S),pitchDelta:o?-.5*(y.y-f.y):void 0}},moveStateManager:u,enable:!0,assignEvents:()=>{}}),this.map=e,Q.addEventListener(r,"mousedown",this.mousedown),Q.addEventListener(r,"touchstart",this.touchstart,{passive:!1}),Q.addEventListener(r,"touchcancel",this.reset)}startMove(e,r){this._rotatePitchHanlder.dragStart(e,r),Q.disableDrag()}move(e,r){const o=this.map,{bearingDelta:u,pitchDelta:f}=this._rotatePitchHanlder.dragMove(e,r)||{};u&&o.setBearing(o.getBearing()+u),f&&o.setPitch(o.getPitch()+f)}off(){const e=this.element;Q.removeEventListener(e,"mousedown",this.mousedown),Q.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),Q.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),Q.removeEventListener(window,"touchend",this.touchend),Q.removeEventListener(e,"touchcancel",this.reset),this.offTemp()}offTemp(){Q.enableDrag(),Q.removeEventListener(window,"mousemove",this.mousemove),Q.removeEventListener(window,"mouseup",this.mouseup),Q.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),Q.removeEventListener(window,"touchend",this.touchend)}}let Rs;function ia(d,e,r){const o=new c.N(d.lng,d.lat);if(d=new c.N(d.lng,d.lat),e){const u=new c.N(d.lng-360,d.lat),f=new c.N(d.lng+360,d.lat),y=r.locationToScreenPoint(d).distSqr(e);r.locationToScreenPoint(u).distSqr(e)<y?d=u:r.locationToScreenPoint(f).distSqr(e)<y&&(d=f)}for(;Math.abs(d.lng-r.center.lng)>180;){const u=r.locationToScreenPoint(d);if(u.x>=0&&u.y>=0&&u.x<=r.width&&u.y<=r.height)break;d.lng>r.center.lng?d.lng-=360:d.lng+=360}return d.lng!==o.lng&&r.isPointOnMapSurface(r.locationToScreenPoint(d))?d:o}const Ga={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function rl(d,e,r){const o=d.classList;for(const u in Ga)o.remove(`maplibregl-${r}-anchor-${u}`);o.add(`maplibregl-${r}-anchor-${e}`)}class Ha extends c.E{constructor(e){if(super(),this._onKeyPress=r=>{const o=r.code,u=r.charCode||r.keyCode;o!=="Space"&&o!=="Enter"&&u!==32&&u!==13||this.togglePopup()},this._onMapClick=r=>{const o=r.originalEvent.target,u=this._element;this._popup&&(o===u||u.contains(o))&&this.togglePopup()},this._update=r=>{var o;if(!this._map)return;const u=this._map.loaded()&&!this._map.isMoving();((r==null?void 0:r.type)==="terrain"||(r==null?void 0:r.type)==="render"&&!u)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?ia(this._lngLat,this._flatPos,this._map.transform):(o=this._lngLat)===null||o===void 0?void 0:o.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let f="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?f=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(f=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let y="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?y="rotateX(0deg)":this._pitchAlignment==="map"&&(y=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||r&&r.type!=="moveend"||(this._pos=this._pos.round()),Q.setTransform(this._element,`${Ga[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${y} ${f}`),ge.frameAsync(new AbortController).then(()=>{this._updateOpacity(r&&r.type==="moveend")}).catch(()=>{})},this._onMove=r=>{if(!this._isDragging){const o=this._clickTolerance||this._map._clickTolerance;this._isDragging=r.point.dist(this._pointerdownPos)>=o}this._isDragging&&(this._pos=r.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new c.k("dragstart"))),this.fire(new c.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new c.k("dragend")),this._state="inactive"},this._addDragHandler=r=>{this._element.contains(r.originalEvent.target)&&(r.preventDefault(),this._positionDelta=r.point.sub(this._pos).add(this._offset),this._pointerdownPos=r.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",this._scale=e&&e.scale||1,this._draggable=e&&e.draggable||!1,this._clickTolerance=e&&e.clickTolerance||0,this._subpixelPositioning=e&&e.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=e&&e.rotation||0,this._rotationAlignment=e&&e.rotationAlignment||"auto",this._pitchAlignment=e&&e.pitchAlignment&&e.pitchAlignment!=="auto"?e.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(e==null?void 0:e.opacity,e==null?void 0:e.opacityWhenCovered),e&&e.element)this._element=e.element,this._offset=c.P.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=Q.create("div");const r=Q.createNS("http://www.w3.org/2000/svg","svg"),o=41,u=27;r.setAttributeNS(null,"display","block"),r.setAttributeNS(null,"height",`${o}px`),r.setAttributeNS(null,"width",`${u}px`),r.setAttributeNS(null,"viewBox",`0 0 ${u} ${o}`);const f=Q.createNS("http://www.w3.org/2000/svg","g");
vendor: 5,111 bytes, line 748
748f.setAttributeNS(null,"stroke","none"),f.setAttributeNS(null,"stroke-width","1"),f.setAttributeNS(null,"fill","none"),f.setAttributeNS(null,"fill-rule","evenodd");const y=Q.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"fill-rule","nonzero");const w=Q.createNS("http://www.w3.org/2000/svg","g");w.setAttributeNS(null,"transform","translate(3.0, 29.0)"),w.setAttributeNS(null,"fill","#000000");const S=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const K of S){const ee=Q.createNS("http://www.w3.org/2000/svg","ellipse");ee.setAttributeNS(null,"opacity","0.04"),ee.setAttributeNS(null,"cx","10.5"),ee.setAttributeNS(null,"cy","5.80029008"),ee.setAttributeNS(null,"rx",K.rx),ee.setAttributeNS(null,"ry",K.ry),w.appendChild(ee)}const I=Q.createNS("http://www.w3.org/2000/svg","g");I.setAttributeNS(null,"fill",this._color);const A=Q.createNS("http://www.w3.org/2000/svg","path");A.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),I.appendChild(A);const k=Q.createNS("http://www.w3.org/2000/svg","g");k.setAttributeNS(null,"opacity","0.25"),k.setAttributeNS(null,"fill","#000000");const R=Q.createNS("http://www.w3.org/2000/svg","path");R.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),k.appendChild(R);const O=Q.createNS("http://www.w3.org/2000/svg","g");O.setAttributeNS(null,"transform","translate(6.0, 7.0)"),O.setAttributeNS(null,"fill","#FFFFFF");const V=Q.createNS("http://www.w3.org/2000/svg","g");V.setAttributeNS(null,"transform","translate(8.0, 8.0)");const X=Q.createNS("http://www.w3.org/2000/svg","circle");X.setAttributeNS(null,"fill","#000000"),X.setAttributeNS(null,"opacity","0.25"),X.setAttributeNS(null,"cx","5.5"),X.setAttributeNS(null,"cy","5.5"),X.setAttributeNS(null,"r","5.4999962");const W=Q.createNS("http://www.w3.org/2000/svg","circle");W.setAttributeNS(null,"fill","#FFFFFF"),W.setAttributeNS(null,"cx","5.5"),W.setAttributeNS(null,"cy","5.5"),W.setAttributeNS(null,"r","5.4999962"),V.appendChild(X),V.appendChild(W),y.appendChild(w),y.appendChild(I),y.appendChild(k),y.appendChild(O),y.appendChild(V),r.appendChild(y),r.setAttributeNS(null,"height",o*this._scale+"px"),r.setAttributeNS(null,"width",u*this._scale+"px"),this._element.appendChild(r),this._offset=c.P.convert(e&&e.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",r=>{r.preventDefault()}),this._element.addEventListener("mousedown",r=>{r.preventDefault()}),rl(this._element,this._anchor,"marker"),e&&e.className)for(const r of e.className.split(" "))this._element.classList.add(r);this._popup=null}addTo(e){return this.remove(),this._map=e,this._element.setAttribute("aria-label",e._getUIString("Marker.Title")),e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.on("terrain",this._update),e.on("projectiontransition",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),Q.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=c.N.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){const r=Math.abs(13.5)/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[
7480,-38.1],"bottom-left":[r,-1*(38.1-13.5+r)],"bottom-right":[-r,-1*(38.1-13.5+r)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=e,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(e){return this._subpixelPositioning=e,this}getPopup(){return this._popup}togglePopup(){const e=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:e?(e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map)),this):this}_updateOpacity(e=!1){var r,o;if(!(!((r=this._map)===null||r===void 0)&&r.terrain)){const k=this._map.transform.isLocationOccluded(this._lngLat)?this._opacityWhenCovered:this._opacity;return void(this._element.style.opacity!==k&&(this._element.style.opacity=k))}if(e)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const u=this._map,f=u.terrain.depthAtPoint(this._pos),y=u.terrain.getElevationForLngLatZoom(this._lngLat,u.transform.tileZoom);if(u.transform.lngLatToCameraDepth(this._lngLat,y)-f<.006)return void(this._element.style.opacity=this._opacity);const w=-this._offset.y/u.transform.pixelsPerMeter,S=Math.sin(u.getPitch()*Math.PI/180)*w,I=u.terrain.depthAtPoint(new c.P(this._pos.x,this._pos.y-this._offset.y)),A=u.transform.lngLatToCameraDepth(this._lngLat,y+S)-I>.006;!((o=this._popup)===null||o===void 0)&&o.isOpen()&&A&&this._popup.remove(),this._element.style.opacity=A?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(e){return this._offset=c.P.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&e!=="auto"?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,r){return e===void 0&&r===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),e!==void 0&&(this._opacity=e),r!==void 0&&(this._opacityWhenCovered=r),this._map&&this._updateOpacity(!0),this}}const Ac={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let sa=0,Mn=!1;const kc={maxWidth:100,unit:"metric"};function il(d,e,r){const o=r&&r.maxWidth||100,u=d._container.clientHeight/2,f=d._container.clientWidth/2,y=d.unproject([f-o/2,u]),w=d.unproject([f+o/2,u]),S=Math.round(d.project(w).x-d.project(y).x),I=Math.min(o,S,d._container.clientWidth),A=y.distanceTo(w);if(r&&r.unit==="imperial"){const k=3.2808*A;k>5280?Ws(e,I,k/5280,d._getUIString("ScaleControl.Miles")):Ws(e,I,k,d._getUIString("ScaleControl.Feet"))}else r&&r.unit==="nautical"?Ws(e,I,A/1852,d._getUIString("ScaleControl.NauticalMiles")):A>=1e3?Ws(e,I,A/1e3,d._getUIString("ScaleControl.Kilometers")):Ws(e,I,A,d._getUIString("ScaleControl.Meters"))}function Ws(d,e,r,o){const u=function(f){const y=Math.pow(10,`${Math.floor(f)}`.length-1);let w=f/y;return w=w>=10?10:w>=5?5:w>=3?3:w>=2?2:w>=1?1:function(S){const I=Math.pow(10,Math.ceil(-Math.log(S)/Math.LN10));return Math.round(S*I)/I}(w),y*w}(r);d.style.width=e*(u/r)+"px",d.innerHTML=`${u}&nbsp;${o}`}const zc={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},Rc=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");
vendor: 4,969 bytes, line 748
748function Wa(d){if(d){if(typeof d=="number"){const e=Math.round(Math.abs(d)/Math.SQRT2);return{center:new c.P(0,0),top:new c.P(0,d),"top-left":new c.P(e,e),"top-right":new c.P(-e,e),bottom:new c.P(0,-d),"bottom-left":new c.P(e,-e),"bottom-right":new c.P(-e,-e),left:new c.P(d,0),right:new c.P(-d,0)}}if(d instanceof c.P||Array.isArray(d)){const e=c.P.convert(d);return{center:e,top:e,"top-left":e,"top-right":e,bottom:e,"bottom-left":e,"bottom-right":e,left:e,right:e}}return{center:c.P.convert(d.center||[0,0]),top:c.P.convert(d.top||[0,0]),"top-left":c.P.convert(d["top-left"]||[0,0]),"top-right":c.P.convert(d["top-right"]||[0,0]),bottom:c.P.convert(d.bottom||[0,0]),"bottom-left":c.P.convert(d["bottom-left"]||[0,0]),"bottom-right":c.P.convert(d["bottom-right"]||[0,0]),left:c.P.convert(d.left||[0,0]),right:c.P.convert(d.right||[0,0])}}return Wa(new c.P(0,0))}const Dc=B;x.AJAXError=c.cg,x.Event=c.k,x.Evented=c.E,x.LngLat=c.N,x.MercatorCoordinate=c.Y,x.Point=c.P,x.addProtocol=c.ch,x.config=c.a,x.removeProtocol=c.ci,x.AttributionControl=el,x.BoxZoomHandler=hh,x.CanvasSource=dt,x.CooperativeGesturesHandler=Ic,x.DoubleClickZoomHandler=zs,x.DragPanHandler=Jo,x.DragRotateHandler=Mc,x.EdgeInsets=di,x.FullscreenControl=class extends c.E{constructor(d={}){super(),this._onFullscreenChange=()=>{var e;let r=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((e=r==null?void 0:r.shadowRoot)===null||e===void 0)&&e.fullscreenElement;)r=r.shadowRoot.fullscreenElement;r===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,d&&d.container&&(d.container instanceof HTMLElement?this._container=d.container:c.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(d){return this._map=d,this._container||(this._container=this._map.getContainer()),this._controlContainer=Q.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){Q.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const d=this._fullscreenButton=Q.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);Q.create("span","maplibregl-ctrl-icon",d).setAttribute("aria-hidden","true"),d.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const d=this._getTitle();this._fullscreenButton.setAttribute("aria-label",d),this._fullscreenButton.title=d}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new c.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new c.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},x.GeoJSONSource=Ye,x.GeolocateControl=class extends c.E{constructor(d){super(),this._onSuccess=e=>{if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new c.k("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_E
748RROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(e),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new c.k("geolocate",e)),this._finish()}},this._updateCamera=e=>{const r=new c.N(e.coords.longitude,e.coords.latitude),o=e.coords.accuracy,u=this._map.getBearing(),f=c.e({bearing:u},this.options.fitBoundsOptions),y=Me.fromLngLat(r,o);this._map.fitBounds(y,f,{geolocateSource:!0})},this._updateMarker=e=>{if(e){const r=new c.N(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=e=>{if(this._map){if(this.options.trackUserLocation)if(e.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(e.code===3&&Mn)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new c.k("error",e)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",e=>e.preventDefault()),this._geolocateButton=Q.create("button","maplibregl-ctrl-geolocate",this._container),Q.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=e=>{if(this._map){if(e===!1){c.w("Geolocation support is not available so the GeolocateControl will be disabled.");const r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r)}else{const r=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=Q.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Ha({element:this._dotElement}),this._circleElement=Q.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ha({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",r=>{r.geolocateSource||this._watchState!=="ACTIVE_LOCK"||r.originalEvent&&r.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new c.k("trackuserlocationend")),this.fire(new c.k("userlocationlostfocus")))})}},this.options=c.e({},Ac,d)}onAdd(d){return this._map=d,this._container=Q.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return c._(this,arguments,void 0,function*(e=!1){if(Rs!==void 0&&!e)return Rs;if(window.navigator.permissions===void 0)return Rs=!!window.navigator.geolocation,Rs;try{Rs=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{Rs=!!window.navigator.geolocation}return Rs})}().then(e=>this._finishSetupUI(e)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),Q.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,sa=0,Mn=!1}_isOutOfMapMaxBounds(d){const e=this._map.getMaxBounds(),r=d.coords;return e&&(r.longitude<e.getWest()||r.longitude>e.getEast()||r.latitude<e.getSouth()||r.latitude>e.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_E
748RROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const d=this._map.getBounds(),e=d.getSouthEast(),r=d.getNorthEast(),o=e.distanceTo(r),u=Math.ceil(this._accuracy/(o/this._map._container.clientHeight)*2);this._circleElement.style.width=`${u}px`,this._circleElement.style.height=`${u}px`}trigger(){if(!this._setup)return c.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 c.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":sa--,Mn=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new c.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new c.k("trackuserlocationstart")),this.fire(new c.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let d;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),sa++,sa>1?(d={maximumAge:6e5,timeout:0},Mn=!0):(d=this.options.positionOptions,Mn=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,d)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},x.GlobeControl=class{constructor(){this._toggleProjection=()=>{var d;const e=(d=this._map.getProjection())===null||d===void 0?void 0:d.type;this._map.setProjection(e!=="mercator"&&e?{type:"mercator"}:{type:"globe"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{var d;this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),((d=this._map.getProjection())===null||d===void 0?void 0:d.type)==="globe"?(this._globeButton.classList.add("maplibregl-ctrl-globe-enabled"),this._globeButton.title=this._map._getUIString("GlobeControl.Disable")):(this._globeButton.classList.add("maplibregl-ctrl-globe"),this._globeButton.title=this._map._getUIString("GlobeControl.Enable"))}}onAdd(d){return this._map=d,this._container=Q.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=Q.create("button","maplibregl-ctrl-globe",this._container),Q.create("span","maplibregl-ctrl-icon",this._globeButton).setAttribute("aria-hidden","true"),this._globeButton.type="button",this._globeButton.addEventListener("click",this._toggleProjection),this._updateGlobeIcon(),this._map.on("styledata",this._updateGlobeIcon),this._container}onRemove(){Q.remove(this._container),this._map.off("styledata",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}},x.Hash=Tc,x.ImageSource=Ze,x.KeyboardHandler=xh,x.LngLatBounds=Me,x.LogoControl
748=tl,x.Map=class extends mt{constructor(d){var e,r;c.cd.mark(c.ce.create);const o=Object.assign(Object.assign(Object.assign({},qa),d),{canvasContextAttributes:Object.assign(Object.assign({},qa.canvasContextAttributes),d.canvasContextAttributes)});if(o.minZoom!=null&&o.maxZoom!=null&&o.minZoom>o.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(o.minPitch!=null&&o.maxPitch!=null&&o.minPitch>o.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(o.minPitch!=null&&o.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(o.maxPitch!=null&&o.maxPitch>180)throw new Error("maxPitch must be less than or equal to 180");const u=new Cs,f=new wo;if(o.minZoom!==void 0&&u.setMinZoom(o.minZoom),o.maxZoom!==void 0&&u.setMaxZoom(o.maxZoom),o.minPitch!==void 0&&u.setMinPitch(o.minPitch),o.maxPitch!==void 0&&u.setMaxPitch(o.maxPitch),o.renderWorldCopies!==void 0&&u.setRenderWorldCopies(o.renderWorldCopies),super(u,f,{bearingSnap:o.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Ci,this._controls=[],this._mapId=c.a1(),this._contextLost=w=>{w.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new c.k("webglcontextlost",{originalEvent:w}))},this._contextRestored=w=>{this._setupPainter(),this.resize(),this._update(),this.fire(new c.k("webglcontextrestored",{originalEvent:w}))},this._onMapScroll=w=>{if(w.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=o.interactive,this._maxTileCacheSize=o.maxTileCacheSize,this._maxTileCacheZoomLevels=o.maxTileCacheZoomLevels,this._canvasContextAttributes=Object.assign({},o.canvasContextAttributes),this._trackResize=o.trackResize===!0,this._bearingSnap=o.bearingSnap,this._centerClampedToGround=o.centerClampedToGround,this._refreshExpiredTiles=o.refreshExpiredTiles===!0,this._fadeDuration=o.fadeDuration,this._crossSourceCollisions=o.crossSourceCollisions===!0,this._collectResourceTiming=o.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},Mh),o.locale),this._clickTolerance=o.clickTolerance,this._overridePixelRatio=o.pixelRatio,this._maxCanvasSize=o.maxCanvasSize,this.transformCameraUpdate=o.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=o.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=nt.addThrottleControl(()=>this.isMoving()),this._requestManager=new Ct(o.transformRequest),typeof o.container=="string"){if(this._container=document.getElementById(o.container),!this._container)throw new Error(`Container '${o.container}' not found.`)}else{if(!(o.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=o.container}if(o.maxBounds&&this.setMaxBounds(o.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let w=!1;const S=Gs(I=>{this._trackResize&&!this._removed&&(this.resize(I),this.redraw())},50);this._resizeObserver=new ResizeObserver(I=>{w?S(I):w=!0}),this._resizeObserver.observe(this._container)}this.handlers=new ot(this,o),this._hash=o.hash&&new Tc(typeof o.hash=="string"&&o.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:o.center,elevation:o.elevation,zoom:o.zoom,bearing:o.bearing,pitch:o.pitch,roll:o.roll}),o.bounds&&(this.resize(),this.fitBounds(o.bounds,c.e({},o.fitBoundsOptions,{duration:0}))));const y=typeof o.style=="string"||((r=(e=o.style)===null||e===void 0?void 0:e.projection)===null||r===void 0?void 0:r.type)!=="globe";this.resize(null,y),this._localIdeographFontFamily=o.localIdeographFontFamily,this._validateStyle=o.validateStyle,o.style&&this.setStyle(o.style,{localIdeographFontFamily:o.localIdeographFontFamily}),o.attributionControl&&this.addControl(new el(typeof o.attributionControl
vendor: 32,969 bytes, line 748
748=="boolean"?void 0:o.attributionControl)),o.maplibreLogo&&this.addControl(new tl,o.logoPosition),this.on("style.load",()=>{if(y||this._resizeTransform(),this.transform.unmodified){const w=c.M(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(w)}}),this.on("data",w=>{this._update(w.dataType==="style"),this.fire(new c.k(`${w.dataType}data`,w))}),this.on("dataloading",w=>{this.fire(new c.k(`${w.dataType}dataloading`,w))}),this.on("dataabort",w=>{this.fire(new c.k("sourcedataabort",w))})}_getMapId(){return this._mapId}addControl(d,e){if(e===void 0&&(e=d.getDefaultPosition?d.getDefaultPosition():"top-right"),!d||!d.onAdd)return this.fire(new c.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const r=d.onAdd(this);this._controls.push(d);const o=this._controlPositions[e];return e.indexOf("bottom")!==-1?o.insertBefore(r,o.firstChild):o.appendChild(r),this}removeControl(d){if(!d||!d.onRemove)return this.fire(new c.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const e=this._controls.indexOf(d);return e>-1&&this._controls.splice(e,1),d.onRemove(this),this}hasControl(d){return this._controls.indexOf(d)>-1}calculateCameraOptionsFromTo(d,e,r,o){return o==null&&this.terrain&&(o=this.terrain.getElevationForLngLatZoom(r,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(d,e,r,o)}resize(d,e=!0){const[r,o]=this._containerDimensions(),u=this._getClampedPixelRatio(r,o);if(this._resizeCanvas(r,o,u),this.painter.resize(r,o,u),this.painter.overLimit()){const y=this.painter.context.gl;this._maxCanvasSize=[y.drawingBufferWidth,y.drawingBufferHeight];const w=this._getClampedPixelRatio(r,o);this._resizeCanvas(r,o,w),this.painter.resize(r,o,w)}this._resizeTransform(e);const f=!this._moving;return f&&(this.stop(),this.fire(new c.k("movestart",d)).fire(new c.k("move",d))),this.fire(new c.k("resize",d)),f&&this.fire(new c.k("moveend",d)),this}_resizeTransform(d=!0){var e;const[r,o]=this._containerDimensions();this.transform.resize(r,o,d),(e=this._requestedCameraState)===null||e===void 0||e.resize(r,o,d)}_getClampedPixelRatio(d,e){const{0:r,1:o}=this._maxCanvasSize,u=this.getPixelRatio(),f=d*u,y=e*u;return Math.min(f>r?r/f:1,y>o?o/y:1)*u}getPixelRatio(){var d;return(d=this._overridePixelRatio)!==null&&d!==void 0?d:devicePixelRatio}setPixelRatio(d){this._overridePixelRatio=d,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(d){return this.transform.setMaxBounds(Me.convert(d)),this._update()}setMinZoom(d){if((d=d??-2)>=-2&&d<=this.transform.maxZoom)return this.transform.setMinZoom(d),this._update(),this.getZoom()<d&&this.setZoom(d),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(d){if((d=d??22)>=this.transform.minZoom)return this.transform.setMaxZoom(d),this._update(),this.getZoom()>d&&this.setZoom(d),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(d){if((d=d??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(d>=0&&d<=this.transform.maxPitch)return this.transform.setMinPitch(d),this._update(),this.getPitch()<d&&this.setPitch(d),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(d){if((d=d??60)>180)throw new Error("maxPitch must be less than or equal to 180");if(d>=this.transform.minPitch)return this.transform.setMaxPitch(d),this._update(),this.getPitch()>d&&this.setPitch(d),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(d){return this.transform.setRenderWorldCopies(d),this._update()}project(d){return this.transform.locationToScreenPoint(c.N.convert(d),this.style&&this.terrain)}unproject(d){return this.transform.screenPointToLocation(c.P.convert(d),this.terrain)}isMoving(){var d;return this._moving||((d=this.handlers)===null||d===void 0?void 0:d.isMoving())}isZooming(){var d;return this._zooming||((d=this.handlers)===null||d===void 0?void 0:d.isZooming())}isRotating(){var d;return this._rotating||((d=this.handlers)===null||d===void 0?void 0:d.isRotating())}_createDelegatedListener(d,e,r){if(d==="mouseenter"||d==="mouseover"){let o=!1;return{layers:e,listener:r,delegates:{mousemove:u=>{const f=e.filter(w=>this.getLayer(w)),y=f.length!==0?this.queryRenderedFeatures(u.point,{layers:f}):[];y.length?o||(o=!0,r.call(this,new Ir(d,this,u.originalEvent,{features:y}))):o=!1},mouseout:()=>{o=!1}}}}if(d==="mouseleave"||d==="mouseout"){let o=!1;return{layers:e,listener:r,delegates:{mousemove:u=>{const f=e.filter(y=>this.getLayer(y));(f.length!==0?this.queryRenderedFeatures(u.point,{layers:f}):[]).length?o=!0:o&&(o=!1,r.call(this,new Ir(d,this,u.originalEvent)))},mouseout:u=>{o&&(o=!1,r.call(this,new Ir(d,this,u.originalEvent)))}}}}{const o=u=>{const f=e.filter(w=>this.getLayer(w)),y=f.length!==0?this.queryRenderedFeatures(u.point,{layers:f}):[];y.length&&(u.features=y,r.call(this,u),delete u.features)};return{layers:e,listener:r,delegates:{[d]:o}}}}_saveDelegatedListener(d,e){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[d]=this._delegatedListeners[d]||[],this._delegatedListeners[d].push(e)}_removeDelegatedListener(d,e,r){if(!this._delegatedListeners||!this._delegatedListeners[d])return;const o=this._delegatedListeners[d];for(let u=0;u<o.length;u++){const f=o[u];if(f.listener===r&&f.layers.length===e.length&&f.layers.every(y=>e.includes(y))){for(const y in f.delegates)this.off(y,f.delegates[y]);return void o.splice(u,1)}}}on(d,e,r){if(r===void 0)return super.on(d,e);const o=typeof e=="string"?[e]:e,u=this._createDelegatedListener(d,o,r);this._saveDelegatedListener(d,u);for(const f in u.delegates)this.on(f,u.delegates[f]);return{unsubscribe:()=>{this._removeDelegatedListener(d,o,r)}}}once(d,e,r){if(r===void 0)return super.once(d,e);const o=typeof e=="string"?[e]:e,u=this._createDelegatedListener(d,o,r);for(const f in u.delegates){const y=u.delegates[f];u.delegates[f]=(...w)=>{this._removeDelegatedListener(d,o,r),y(...w)}}this._saveDelegatedListener(d,u);for(const f in u.delegates)this.once(f,u.delegates[f]);return this}off(d,e,r){return r===void 0?super.off(d,e):(this._removeDelegatedListener(d,typeof e=="string"?[e]:e,r),this)}queryRenderedFeatures(d,e){if(!this.style)return[];let r;const o=d instanceof c.P||Array.isArray(d),u=o?d:[[0,0],[this.transform.width,this.transform.height]];if(e=e||(o?{}:d)||{},u instanceof c.P||typeof u[0]=="number")r=[c.P.convert(u)];else{const f=c.P.convert(u[0]),y=c.P.convert(u[1]);r=[f,new c.P(y.x,f.y),y,new c.P(f.x,y.y),f]}return this.style.queryRenderedFeatures(r,e,this.transform)}querySourceFeatures(d,e){return this.style.querySourceFeatures(d,e)}setStyle(d,e){return(e=c.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},e)).diff!==!1&&e.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&d?(this._diffStyle(d,e),this):(this._localIdeographFontFamily=e.localIdeographFontFamily,this._updateStyle(d,e))}setTransformRequest(d){return this._requestManager.setTransformRequest(d),this}_getUIString(d){const e=this._locale[d];if(e==null)throw new Error(`Missing UI string '${d}'`);return e}_updateStyle(d,e){var r,o;if(e.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(d,e));const u=this.style&&e.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!d)),d?(this.style=new Ki(this,e||{}),this.style.setEventedParent(this,{style:this.style}),typeof d=="string"?this.style.loadURL(d,e,u):this.style.loadJSON(d,e,u),this):((o=(r=this.style)===null||r===void 0?void 0:r.projection)===null||o===void 0||o.destroy(),delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Ki(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(d,e){if(typeof d=="string"){const r=this._requestManager.transformRequest(d,"Style");c.h(r,new AbortController).then(o=>{this._updateDiff(o.data,e)}).catch(o=>{o&&this.fire(new c.j(o))})}else typeof d=="object"&&this._updateDiff(d,e)}_updateDiff(d,e){try{this.style.setState(d,e)&&this._update(!0)}catch(r){c.w(`Unable to perform style diff: ${r.message||r.error||r}.  Rebuilding the style from scratch.`),this._updateStyle(d,e)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():c.w("There is no style added to the map.")}addSource(d,e){return this._lazyInitEmptyStyle(),this.style.addSource(d,e),this._update(!0)}isSourceLoaded(d){const e=this.style&&this.style.sourceCaches[d];if(e!==void 0)return e.loaded();this.fire(new c.j(new Error(`There is no source with ID '${d}'`)))}setTerrain(d){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),d){const e=this.style.sourceCaches[d.source];if(!e)throw new Error(`cannot load terrain, because there exists no source with ID: ${d.source}`);this.terrain===null&&e.reload();for(const r in this.style._layers){const o=this.style._layers[r];o.type==="hillshade"&&o.source===d.source&&c.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new td(this.painter,e,d),this.painter.renderToTexture=new Lr(this.painter,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._terrainDataCallback=r=>{r.dataType==="style"?this.terrain.sourceCache.freeRtt():r.dataType==="source"&&r.tile&&(r.sourceId!==d.source||this._elevationFreeze||(this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))),this.terrain.sourceCache.freeRtt(r.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0);return this.fire(new c.k("terrain",{terrain:d})),this}getTerrain(){var d,e;return(e=(d=this.terrain)===null||d===void 0?void 0:d.options)!==null&&e!==void 0?e:null}areTilesLoaded(){const d=this.style&&this.style.sourceCaches;for(const e in d){const r=d[e]._tiles;for(const o in r){const u=r[o];if(u.state!=="loaded"&&u.state!=="errored")return!1}}return!0}removeSource(d){return this.style.removeSource(d),this._update(!0)}getSource(d){return this.style.getSource(d)}addImage(d,e,r={}){const{pixelRatio:o=1,sdf:u=!1,stretchX:f,stretchY:y,content:w,textFitWidth:S,textFitHeight:I}=r;if(this._lazyInitEmptyStyle(),!(e instanceof HTMLImageElement||c.b(e))){if(e.width===void 0||e.height===void 0)return this.fire(new c.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:A,height:k,data:R}=e,O=e;return this.style.addImage(d,{data:new c.R({width:A,height:k},new Uint8Array(R)),pixelRatio:o,stretchX:f,stretchY:y,content:w,textFitWidth:S,textFitHeight:I,sdf:u,version:0,userImage:O}),O.onAdd&&O.onAdd(this,d),this}}{const{width:A,height:k,data:R}=ge.getImageData(e);this.style.addImage(d,{data:new c.R({width:A,height:k},R),pixelRatio:o,stretchX:f,stretchY:y,content:w,textFitWidth:S,textFitHeight:I,sdf:u,version:0})}}updateImage(d,e){const r=this.style.getImage(d);if(!r)return this.fire(new c.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const o=e instanceof HTMLImageElement||c.b(e)?ge.getImageData(e):e,{width:u,height:f,data:y}=o;if(u===void 0||f===void 0)return this.fire(new c.j(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(u!==r.data.width||f!==r.data.height)return this.fire(new c.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const w=!(e instanceof HTMLImageElement||c.b(e));return r.data.replace(y,w),this.style.updateImage(d,r),this}getImage(d){return this.style.getImage(d)}hasImage(d){return d?!!this.style.getImage(d):(this.fire(new c.j(new Error("Missing required image id"))),!1)}removeImage(d){this.style.removeImage(d)}loadImage(d){return nt.getImage(this._requestManager.transformRequest(d,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(d,e){return this._lazyInitEmptyStyle(),this.style.addLayer(d,e),this._update(!0)}moveLayer(d,e){return this.style.moveLayer(d,e),this._update(!0)}removeLayer(d){return this.style.removeLayer(d),this._update(!0)}getLayer(d){return this.style.getLayer(d)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(d,e,r){return this.style.setLayerZoomRange(d,e,r),this._update(!0)}setFilter(d,e,r={}){return this.style.setFilter(d,e,r),this._update(!0)}getFilter(d){return this.style.getFilter(d)}setPaintProperty(d,e,r,o={}){return this.style.setPaintProperty(d,e,r,o),this._update(!0)}getPaintProperty(d,e){return this.style.getPaintProperty(d,e)}setLayoutProperty(d,e,r,o={}){return this.style.setLayoutProperty(d,e,r,o),this._update(!0)}getLayoutProperty(d,e){return this.style.getLayoutProperty(d,e)}setGlyphs(d,e={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(d,e),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(d,e,r={}){return this._lazyInitEmptyStyle(),this.style.addSprite(d,e,r,o=>{o||this._update(!0)}),this}removeSprite(d){return this._lazyInitEmptyStyle(),this.style.removeSprite(d),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(d,e={}){return this._lazyInitEmptyStyle(),this.style.setSprite(d,e,r=>{r||this._update(!0)}),this}setLight(d,e={}){return this._lazyInitEmptyStyle(),this.style.setLight(d,e),this._update(!0)}getLight(){return this.style.getLight()}setSky(d,e={}){return this._lazyInitEmptyStyle(),this.style.setSky(d,e),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(d,e){return this.style.setFeatureState(d,e),this._update()}removeFeatureState(d,e){return this.style.removeFeatureState(d,e),this._update()}getFeatureState(d){return this.style.getFeatureState(d)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let d=0,e=0;return this._container&&(d=this._container.clientWidth||400,e=this._container.clientHeight||300),[d,e]}_setupContainer(){const d=this._container;d.classList.add("maplibregl-map");const e=this._canvasContainer=Q.create("div","maplibregl-canvas-container",d);this._interactive&&e.classList.add("maplibregl-interactive"),this._canvas=Q.create("canvas","maplibregl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const r=this._containerDimensions(),o=this._getClampedPixelRatio(r[0],r[1]);this._resizeCanvas(r[0],r[1],o);const u=this._controlContainer=Q.create("div","maplibregl-control-container",d),f=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(y=>{f[y]=Q.create("div",`maplibregl-ctrl-${y} `,u)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(d,e,r){this._canvas.width=Math.floor(r*d),this._canvas.height=Math.floor(r*e),this._canvas.style.width=`${d}px`,this._canvas.style.height=`${e}px`}_setupPainter(){const d=Object.assign(Object.assign({},this._canvasContextAttributes),{alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0});let e=null;this._canvas.addEventListener("webglcontextcreationerror",o=>{e={requestedAttributes:d},o&&(e.statusMessage=o.statusMessage,e.type=o.type)},{once:!0});let r=null;if(r=this._canvasContextAttributes.contextType?this._canvas.getContext(this._canvasContextAttributes.contextType,d):this._canvas.getContext("webgl2",d)||this._canvas.getContext("webgl",d),!r){const o="Failed to initialize WebGL";throw e?(e.message=o,new Error(JSON.stringify(e))):new Error(o)}this.painter=new nh(r,this.transform),Se.testSupport(r)}migrateProjection(d,e){super.migrateProjection(d,e),this.painter.transform=d,this.fire(new c.k("projectiontransition",{newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(d){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||d,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(d){return this._update(),this._renderTaskQueue.add(d)}_cancelRenderFrame(d){this._renderTaskQueue.remove(d)}_render(d){var e,r,o,u,f;const y=this._idleTriggered?this._fadeDuration:0,w=((e=this.style.projection)===null||e===void 0?void 0:e.transitionState)>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(d),this._removed)return;let S=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const k=this.transform.zoom,R=ge.now();this.style.zoomHistory.update(k,R);const O=new c.z(k,{now:R,fadeDuration:y,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),V=O.crossFadingFactor();V===1&&V===this._crossFadingFactor||(S=!0,this._crossFadingFactor=V),this.style.update(O)}const I=((r=this.style.projection)===null||r===void 0?void 0:r.transitionState)>0!==w;(o=this.style.projection)===null||o===void 0||o.setErrorQueryLatitudeDegrees(this.transform.center.lat),this.transform.setTransitionState((u=this.style.projection)===null||u===void 0?void 0:u.transitionState,(f=this.style.projection)===null||f===void 0?void 0:f.latitudeErrorCorrectionRadians),this.style&&(this._sourcesDirty||I)&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),!this._elevationFreeze&&this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0)),this._placementDirty=this.style&&this.style._updatePlacement(this.transform,this.showCollisionBoxes,y,this._crossSourceCollisions,I),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:y,showPadding:this.showPadding}),this.fire(new c.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,c.cd.mark(c.ce.load),this.fire(new c.k("load"))),this.style&&(this.style.hasTransitions()||S)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const A=this._sourcesDirty||this._styleDirty||this._placementDirty;return A||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new c.k("idle")),!this._loaded||this._fullyLoaded||A||(this._fullyLoaded=!0,c.cd.mark(c.ce.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var d;this._hash&&this._hash.remove();for(const r of this._controls)r.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),nt.removeThrottleControl(this._imageQueueHandle),(d=this._resizeObserver)===null||d===void 0||d.disconnect();const e=this.painter.context.gl.getExtension("WEBGL_lose_context");e!=null&&e.loseContext&&e.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),Q.remove(this._canvasContainer),Q.remove(this._controlContainer),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map"),c.cd.clearMetrics(),this._removed=!0,this.fire(new c.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,ge.frame(this._frameRequest,d=>{c.cd.frame(d),this._frameRequest=null;try{this._render(d)}catch(e){if(!c.cf(e)&&!function(r){return r.message===Fo}(e))throw e}},()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(d){this._showTileBoundaries!==d&&(this._showTileBoundaries=d,this._update())}get showPadding(){return!!this._showPadding}set showPadding(d){this._showPadding!==d&&(this._showPadding=d,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(d){this._showCollisionBoxes!==d&&(this._showCollisionBoxes=d,d?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(d){this._showOverdrawInspector!==d&&(this._showOverdrawInspector=d,this._update())}get repaint(){return!!this._repaint}set repaint(d){this._repaint!==d&&(this._repaint=d,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(d){this._vertices=d,this._update()}get version(){return Za}getCameraTargetElevation(){return this.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(d){return this._lazyInitEmptyStyle(),this.style.setProjection(d),this._update(!0)}},x.MapMouseEvent=Ir,x.MapTouchEvent=Qn,x.MapWheelEvent=us,x.Marker=Ha,x.NavigationControl=class{constructor(d){this._updateZoomButtons=()=>{const e=this._map.getZoom(),r=e===this._map.getMaxZoom(),o=e===this._map.getMinZoom();this._zoomInButton.disabled=r,this._zoomOutButton.disabled=o,this._zoomInButton.setAttribute("aria-disabled",r.toString()),this._zoomOutButton.setAttribute("aria-disabled",o.toString())},this._rotateCompassArrow=()=>{this._compassIcon.style.transform=this.options.visualizePitch&&this.options.visualizeRoll?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateZ(${-this._map.transform.roll}deg) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizeRoll?`rotate(${-this._map.transform.bearing-this._map.transform.roll}deg)`:`rotate(${-this._map.transform.bearing}deg)`},this._setButtonTitle=(e,r)=>{const o=this._map._getUIString(`NavigationControl.${r}`);e.title=o,e.setAttribute("aria-label",o)},this.options=c.e({},Cc,d),this._container=Q.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",e=>e.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",e=>this._map.zoomIn({},{originalEvent:e})),Q.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",e=>this._map.zoomOut({},{originalEvent:e})),Q.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",e=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})}),this._compassIcon=Q.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(d){return this._map=d,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.on("roll",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Ec(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){Q.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.off("roll",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(d,e){const r=Q.create("button",d,this._container);return r.type="button",r.addEventListener("click",e),r}},x.Popup=class extends c.E{constructor(d){super(),this.remove=()=>(this._content&&Q.remove(this._content),this._container&&(Q.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new c.k("close"))),this),this._onMouseUp=e=>{this._update(e.point)},this._onMouseMove=e=>{this._update(e.point)},this._onDrag=e=>{this._update(e.point)},this._update=e=>{var r;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=Q.create("div","maplibregl-popup",this._map.getContainer()),this._tip=Q.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const w of this.options.className.split(" "))this._container.classList.add(w);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?ia(this._lngLat,this._flatPos,this._map.transform):(r=this._lngLat)===null||r===void 0?void 0:r.wrap(),this._trackPointer&&!e)return;const o=this._flatPos=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&e?e:this._map.transform.locationToScreenPoint(this._lngLat));let u=this.options.anchor;const f=Wa(this.options.offset);if(!u){const w=this._container.offsetWidth,S=this._container.offsetHeight;let I;I=o.y+f.bottom.y<S?["top"]:o.y>this._map.transform.height-S?["bottom"]:[],o.x<w/2?I.push("left"):o.x>this._map.transform.width-w/2&&I.push("right"),u=I.length===0?"bottom":I.join("-")}let y=o.add(f[u]);this.options.subpixelPositioning||(y=y.round()),Q.setTransform(this._container,`${Ga[u]} translate(${y.x}px,${y.y}px)`),rl(this._container,u,"popup")},this._onClose=()=>{this.remove()},this.options=c.e(Object.create(zc),d)}addTo(d){return this._map&&this.remove(),this._map=d,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new c.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(d){return this._lngLat=c.N.convert(d),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(d){return this.setDOMContent(document.createTextNode(d))}setHTML(d){const e=document.createDocumentFragment(),r=document.createElement("body");let o;for(r.innerHTML=d;o=r.firstChild,o;)e.appendChild(o);return this.setDOMContent(e)}getMaxWidth(){var d;return(d=this._container)===null||d===void 0?void 0:d.style.maxWidth}setMaxWidth(d){return this.options.maxWidth=d,this._update(),this}setDOMContent(d){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=Q.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(d),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(d){return this._container&&this._container.classList.add(d),this}removeClassName(d){return this._container&&this._container.classList.remove(d),this}setOffset(d){return this.options.offset=d,this._update(),this}toggleClassName(d){if(this._container)return this._container.classList.toggle(d)}setSubpixelPositioning(d){this.options.subpixelPositioning=d}_createCloseButton(){this.options.closeButton&&(this._closeButton=Q.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const d=this._container.querySelector(Rc);d&&d.focus()}},x.RasterDEMTileSource=Ke,x.RasterTileSource=Oe,x.ScaleControl=class{constructor(d){this._onMove=()=>{il(this._map,this._container,this.options)},this.setUnit=e=>{this.options.unit=e,il(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},kc),d)}getDefaultPosition(){return"bottom-left"}onAdd(d){return this._map=d,this._container=Q.create("div","maplibregl-ctrl maplibregl-ctrl-scale",d.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){Q.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},x.ScrollZoomHandler=Th,x.Style=Ki,x.TerrainControl=class{constructor(d){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=d}onAdd(d){return this._map=d,this._container=Q.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=Q.create("button","maplibregl-ctrl-terrain",this._container),Q.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.t
748ype="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){Q.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},x.TwoFingersTouchPitchHandler=Yo,x.TwoFingersTouchRotateHandler=yh,x.TwoFingersTouchZoomHandler=Wo,x.TwoFingersTouchZoomRotateHandler=Pc,x.VectorTileSource=Be,x.VideoSource=$e,x.addSourceType=(d,e)=>c._(void 0,void 0,void 0,function*(){if(ut(d))throw new Error(`A source type called "${d}" already exists.`);((r,o)=>{et[r]=o})(d,e)}),x.clearPrewarmedResources=function(){const d=Ii;d&&(d.isPreloaded()&&d.numActive()===1?(d.release(Mi),Ii=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},x.createTileMesh=Ca,x.getMaxParallelImageRequests=function(){return c.a.MAX_PARALLEL_IMAGE_REQUESTS},x.getRTLTextPluginStatus=function(){return Ft().getRTLTextPluginStatus()},x.getVersion=function(){return Dc},x.getWorkerCount=function(){return Rr.workerCount},x.getWorkerUrl=function(){return c.a.WORKER_URL},x.importScriptInWorkers=function(d){return ss().broadcast("IS",d)},x.prewarm=function(){Li().acquire(Mi)},x.setMaxParallelImageRequests=function(d){c.a.MAX_PARALLEL_IMAGE_REQUESTS=d},x.setRTLTextPlugin=function(d,e){return Ft().setRTLTextPlugin(d,e)},x.setWorkerCount=function(d){Rr.workerCount=d},x.setWorkerUrl=function(d){c.a.WORKER_URL=d}});var M=p;return M})}(Mf)),Mf.exports}var ln=tw(),rw=Q1(ln);J1({__proto__:null,default:rw},[ln]);class iw extends ln.Evented{constructor(){super(...arguments),this._locale="en",this._apiKey="",this._pixelRatio=1,this._stylesHost="https://styles.maptoolkit.net",this._iconsHost="https://icons.maptoolkit.net",this._dataconnectorHost="https://dataconnector.maptoolkit.net",this._routingHost="https://routing.maptoolkit.net",this._staticmapHost="https://staticmap.maptoolkit.net"}set locale(n){this._locale=n,this.fire("config.locale.set")}get locale(){return this._locale}set apiKey(n){this._apiKey=n,this.fire("config.apiKey.set")}get apiKey(){return this._apiKey||console.warn("Maptoolkit API key is not set."),this._apiKey}set pixelRatio(n){this._pixelRatio=n,this.fire("config.pixelRatio.set")}get pixelRatio(){return this._pixelRatio}set stylesHost(n){this._stylesHost=n,this.fire("config.stylesHost.set")}get stylesHost(){return this._stylesHost}set iconsHost(n){this._iconsHost=n,this.fire("config.iconsHost.set")}get iconsHost(){return this._iconsHost}set dataconnectorHost(n){this._dataconnectorHost=n,this.fire("config.routingHost.set")}get dataconnectorHost(){return this._dataconnectorHost}set routingHost(n){this._routingHost=n,this.fire("config.routingHost.set")}get routingHost(){return this._routingHost}set staticmapHost(n){this._staticmapHost=n,this.fire("config.staticmapHost.set")}get staticmapHost(){return this._staticmapHost}}const yi=new iw;ln.addProtocol("maptoolkit",(l,n)=>new Promise(p=>{const[_,b,M]=l.url.slice(13).split("?")[0].split("/"),x=new URLSearchParams(l.url.split("#")[0].split("?")[1]);let c=null;if(_==="style"||_==="styles")c=new URL(`/${b}/${M}.json`,yi.stylesHost);else if(_==="sprite"||_==="icons"){const B=yi.pixelRatio>1?`@${yi.pixelRatio}x`:"",q=l.type==="json"?"json":"png";c=new URL(`/${b.replace(/(@\dx)?\.(json|png)$/,"")}${B}.${q}`,yi.iconsHost)}else _==="dataconnector"&&(c=new URL(`/${b}/${M}.json`,yi.dataconnectorHost));c&&(x.forEach((B,q)=>{c==null||c.searchParams.set(q,B)}),c.searchParams.set("api_key",yi.apiKey),fetch(c).then(B=>l.type==="json"?B.json():B.arrayBuffer()).then(B=>{B?p({data:B}):n.abort()}).catch(()=>{n.abort()}))}));const sw={de:{"AttributionControl.ToggleAttribution":"Attribution ein-/ausblenden","AttributionControl.MapFeedback":"Feedback zur Karte","FullscreenControl.Enter":"Vollbild einschalten","FullscreenControl.Exit":"Vollbild ausschalten","GeolocateControl.FindMyLocation":"Suche meinen Standort","GeolocateControl.LocationNotAvailable":"Standort nicht verfügbar","LogoControl.Title":"MapLibre Logo","Map.Title":"Karte","Marker.Title":"Kartenmarker","NavigationControl.ResetBearing":"Nach Norden ausrichten","NavigationControl.ZoomIn":"Einzoomen","NavigationControl.ZoomOut":"Auszoomen","Popup.Close":"Popup schließen","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.Enable":"Terrain einschalten","TerrainControl.Disable":"Terrain aussch
748alten","CooperativeGesturesHandler.WindowsHelpText":"Strg + Scroll um zu zoomen","CooperativeGesturesHandler.MacHelpText":"⌘ + Scroll um zu zoomen","CooperativeGesturesHandler.MobileHelpText":"Benutze zwei Finger um die Karte zu bewegen","TerrainControl.ToggleTilt":"Karte kippen und Terrain umschalten, versuche Strg + Ziehen","PitchControl.ChangePitch":"Ziehen um Karte zu kippen","CompassControl.ResetBearing":"Nach Norden ausrichten","CompassControl.RotateLeft":"-90° drehen, versuche Strg + Ziehen","CompassControl.RotateRight":"+90° drehen, versuche Strg + Ziehen","StyleControl.Group.Styles":"Styles","StyleControl.Group.Layers":"Ebenen","StyleControl.Style.Terrain":"Terrain","StyleControl.Style.Light":"Light","StyleControl.Style.Dark":"Dark","StyleControl.Style.City":"CityMaps","StyleControl.Style.Green":"Green","StyleControl.Style.Winter":"Winter","StyleControl.Style.Satellite":"Satellit","StyleControl.Style.Hiking":"Wandern","StyleControl.Style.Cycling":"Fahrrad","StyleControl.Style.Pistes":"Schi","StyleControl.Style.Protected":"Naturschutzgebiete","StyleControl.Style.Oepnv":"ÖPNV","IsochroneControl.Tooltip.foot":"Zieh' mich auf die Karte, um {range} Min-Fußweg anzuzeigen","IsochroneControl.Tooltip.bike":"Zieh' mich auf die Karte, um {range} Min-Radweg anzuzeigen","IsochroneControl.Tooltip.car":"Zieh' mich auf die Karte, um {range} Min-Autofahrt anzuzeigen"},en:{"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use ⌘ + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map","TerrainControl.ToggleTilt":"Tilt map and toggle terrain, try Ctrl + mouse drag","PitchControl.ChangePitch":"Drag to change map pitch","CompassControl.ResetBearing":"Reset bearing to north","CompassControl.RotateLeft":"Rotate -90°, try Ctrl + mouse drag","CompassControl.RotateRight":"Rotate +90°, try Ctrl + mouse drag","StyleControl.Group.Styles":"Styles","StyleControl.Group.Layers":"Overlays","StyleControl.Style.Terrain":"Terrain","StyleControl.Style.Light":"Light","StyleControl.Style.Dark":"Dark","StyleControl.Style.City":"CityMaps","StyleControl.Style.Green":"Green","StyleControl.Style.Winter":"Winter","StyleControl.Style.Satellite":"Satellite","StyleControl.Style.Hiking":"Hiking","StyleControl.Style.Cycling":"Cycling","StyleControl.Style.Pistes":"Skiing","StyleControl.Style.Protected":"Protected Areas","StyleControl.Style.Oepnv":"ÖPNV","IsochroneControl.Tooltip.foot":"Drag me onto the map to show a {range}-min walking area.","IsochroneControl.Tooltip.bike":"Drag me onto the map to show a {range}-min cycling area.","IsochroneControl.Tooltip.car":"Drag me onto the map to show a {range}-min driving area."}};function nw(){return sw[yi.locale||"en"]}const aw={scale:{maxWidth:80,unit:"metric"}};class ow{constructor(n){this.options=Object.assign(aw,n),this._attribCtrl=new ln.AttributionControl(this.options),this.options.scale!==!1&&(this._scaleCtrl=new ln.ScaleControl(this.options.scale))}getDefaultPosition(){return"bottom-right"}onAdd(n){this._map=n;const p=this._attribCtrl.onAdd(n);if(p.classList.add("maptoolkit-ctrl-attrib"),this._scaleCtrl){const _=this._scaleCtrl.onAdd(n);_.classList.remove("maplibregl-ctrl"),p.appendChild(_)}return this._container=p,this._container}onRemove(){var n;(n=this._container)!=null&&n.parentNode&&this._container.parentNode.removeChild(this._container),this._map=void 0}}const lw={};class cw{constructor(n){this.options=Object.assign(lw,n)}getDefaultPosition(){return"bottom-left"}onAdd(n){this._map=n,this._container=document.createElement("div"),this._container.classList.add("maplibregl-ctrl","maptoolkit-ctrl","maptoolkit-ctrl-logo");const p=document.createElement("a");p.classList.add("maptoolkit-ctrl-logo-anchor"),p.href="https://www.maptoolkit.com",p.target="_blank";const _=document.createElement("img");return _.classList.add("maptoolkit-ctrl-logo-image"),_.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJ0AAAAwCAYAAAALpHjmAAAAAXNSR0IArs4c6QAAFyJJREFUeF7tXAtUU1e63jxCoxfESqxFbRFHwQdOlasGkfLSCe2ACmKcK1axWh+oLdhlg/Qh1WoR7ChY310KlhEHUdAKCtyqYBWCL2AEheltSG3FF2mjsZYCMXd9mbOztocAIYhTHM5aXZaTvf+99/9/+9//ax8L0v10JgeEKpVqb01NTdLYsWMvEEIedeZgXYW2RVeZaBecp6VEIhmRnZ19YfPmzW9FR0cfJoTUd8F1PPEpd4PuibPUQFB4+PDhNdOnT5dt2LDhw5iYmK2EkHudN1zXodwNus6TlaNCoShydnYeFB0dHZ+QkBDXDbp/MbsbdJ0DOsv4+PhZMpnsbyC/YcOGnTExMau6Qdcy6Cyrq6ulhBB7V1fXZEJIoxlysbx48eI4oVDo6+bmlvQfaMvYy+XydLFYHMCA7iNCSJ0ZvGyzS0lJiQNtJBaLVcY6mNKmzYGeUANjms6xoaFBIRAIhEeOHAkJCQn5ygyvS/Tbb79V2djYOHSAxhNa4tMnI5FI3A4fPlxma2trhdG3bt164O23336nE0AnvH79+s6XXnopnK5SpVJliUSiuYSQB9y7Zm1++umnUw4ODtOYNqYySVBdXT0dCkmtVh9uCeBtEeODznLlypWvb9y4MRsda2pqCgcPHozJtccAFmRmZu4MCQmZDxpZWVl7p0+f/m47abQ179/z7wYHgk6yE0HnWFZWlv7KK6+8SseqqKioHjVqFDTs99w7R7lcnky1LidX5eDBg32ZNqbw01alUh3t06ePPxo3NDSo0tPTfefOnXu1vUqJDzphYmLi2sjIyPfoLDZu3DhFJpMdbwdhx/v371+2s7N7ETQKCgpK/Pz8QgghN01Z2TPQxuBA0LXs27cvZ968eQs7gQeuJ0+ezPL39x9Oxzp//vx1sVgcSAip4N4Nyc7OPhAYGDiWAebtUaNGvUYIKTOR35YJCQl/fu+9946x7UtLS790d3df1l6NyQedCJopODh4CiVeXl7+zejRo/G3KdpOcOzYsaigoKAE2r+mpga76k+EkP8zcYFdudljJ8UzBDpbmUw2Pz4+Hva54cnPz/86ICAAR3m7FAofdE5FRUXZEyZMcKOUm5qadDExMVM+++yzEyZoO9Hdu3flIpHoD7T/gwcPtHZ2dthlpu6qrgw6OBApYrE4mF3EkSNHjoWEhLzdzuPMFD48LU0nJIQEVFVVpbu6uj6HiUGuUql0e25uLkJBHQKda21trdzR0bE3u+KSkpI8Dw+Pv7Sh7SxTUlIWh4eHb
748+dza8aMGXMOHz6cZgJoTWF0Z7WxzMvLc3JwcHgBA6hUqjsBAQGwi9qTuhqiVqvL7O3t/+sZA50lIeSPIpEoYv78+aE9e/bUffXVV8WXL1/eAwuKh4s2+cjXdOMbGxvl1tbWj71vbGysnz179p8yMjLOtiJxkUKhuIBgKL9NUlLSxqioqNW/49CJpVwunyIWi4/QucNQfu6556CxTTEr9N2kUqlXcHDwFrVa/YcBAwYIvby8BA4ODhY5OTkXg4KCZnRhTYfl2RNCRhFCRhBCoO2qCSFXCCG3mY1pmZWVNTU4ODiLx8dhrOfOgksgk8ki+Oc27fzNN9+ke3t7v9WC0fhYMJQPOu54gTfbKXGqJ6D6bJOTk9fMmzcPXrb+McMsEBBC+hNC4BUOt7GxcbS2tnaUSqWO/fr1u5CQkLCmi4MObMExa8uxCHnkh7yTwDYuLi5y1apV61rjIwu6ZoxnhQkhhIaGjs7Pz6deEfuzvUKhOOrs7OxjDADFxcUVnp6eQZ3A9CeANz0JUVxc3CerVq1awmMWANSaduePD4HYEUJwvOL/cVRDQ8DmgVYwWWuauLCnZdOZOB1iL5PJYuLj46Nb4yMLOlFeXt4BiUQyuaURuJgbXGS2WkLvsSUkJGRbWDSPNet0OnLr1i11//79PTiVbOoCnma7JwU6/pyh/XpyL6EVzMnutMaHLg+6IVeuXMl2c3NzZVFKo+p4d+/evV969+49kqex7MvKyo6xAUpoRbYfPGCBQADQnTfCQUS53xSJRL6PHj0a36tXr94WFhZ6Q7y+vl7d0NBQrFQq41uoR9NH23v27NlLpVLlurq6fnnx4sVXnJ2dI21tbSWgo9Ppfnnw4EH5t99+u8XDwwNxJr5jYHv9+vWtTU1NPqw9ijlXVlaeHThwoN4k4OgbSwvqU34YUyAQ+AmFwt50zLq6Onh7pqQS9Tbl0KFD/2KExm5XV9fMFgD7pEBnGF+n0+EIJRYWFvUXL178ICAgoIaTmYHX9PecnJxPmeCw/vd79+55sBji8xHZElY1jVar1WdZzys6Olq1fv36PqxjkZmZmRAaGvohxwRLqVTqmZaWdoZtg37x8fGGfCAmGR0dHZmQkIDyHlbozQxPY9saE7906VKIEdA46XQ6JfrA8K+srMwZM2YM4kZGH6SIYmNjF27bto3mJ/U1b3l5eTj6WnygrZVKJbIzcAZYu1TP6IEDB4Yb0/IgWFdX992JEyeCW4rcL1u2zGHNmjVfODg4IIBu9Llz5055WVlZCAMA2u5JgE4POHd3978j9UkJQ8EsXLjwtYyMjCJOZk4NDQ1VbJvs7GzZlClTPod+QOqvLT5yYB1qAN24ceNeO3/+PGJxhmfSpElFERERw2bMmNGHvrx58yaOSngwsFNs5XJ5KhuXqq6u/s3d3f3MvXv3JrNATElJ2fTmm2/G8hwRoYuLy2vV1dUGb6clxms0mlu9evWC98QK3Uun033TGmD4v3GpPdiXyE1ajhs3TsJftzF6nF0KYNAgt61CochuyY5labSSMrK/fft24QsvvPBKW2vA+ouLiz15wOso6P4BbzMwMPAAC6abN29qZ8yYsa+oqAiA+gcHuvEajaaIPcG4qMR6QojGVD5aWFi8SkEniIuLk7FeB5gwYsSIhB49egy/dOmSIUOB9xzCEyUSiSub2MZvsbGx8rVr1x5TKpWxTk5ONpSZXPR6Fg80sHn8qqqqvhKJRDZVVVW/KhQKotFomhBymDp1qg2rQRISEt6Ijo4+wGhLX51Od9qYwFQqlQ7vEbLg/07nTwjRuri4TK2srMzkh4n4fXJycq4FBQUBdAgVCCoqKt4dOXLkBrYdZ79qn3/+eUuhUPjYuNBW/fr1g6NFnQmhXC5PFIvFi1ka0Oo3btxo7Nevn4ClwWhbumHQrSOgm5qVldXfGOCCgoKOX758OZUQAt7STe6l0WgKWNBxJVuonvkJfCwvL8/kr5vPRwsLCz/KGPvMzMxNNEmPhlCvDg4Oi7RareDs2bPbJ06cSA1iwjFwmlwuj2GZBkEPHz78g7t3714tKSnZMn78+JfpoEYS0fQnZD/eEAgEzrAjGhoaIJSH+HvPnj1Bc+bMMYxrRFs2Ax3syZkzZyoKCwv1x66Pj8+g1NTUISz4cOT17dsXNuZPhJCxIpFowdSpU6ft2bOnH50U6AwcOPAy/m5sbFQ/fPgQ9iAqbhAwdlSr1d+ypsi5c+cezp0797tbt27dEggEvVesWOG8evVqEbtp9u3bt3TevHm7sGlwHKGUndUwR48ebXj33XerKY1PP/3UdenSpb1YwfFy4WaDLjU19dN169bFs+NDfhKJJJsBHPhDzaFWQUf56Ofn53fw4MGhxvgoEAhK6+rqdlDQOZ4+fTrL19dXjMbYVeXl5Q/GjBnzOo6hRYsWrdu1axeSyIYHJdgRERExLOOTkpK+jYqKWk4IUe/fv39nWFjYGNqBc0IgaH7IBSEF59DQULewsLBRAwYMsLexsemhVCqb6uvr/WfNmmUINnPeM9xxuvuagS4qKqoyKSkJ2Y+L3NgjwsPDF6SkpBhSe3g/c+bMVzl7BaaD+6JFi95h18jF6VYSQlBF0UAI+ZEQcgsbgp95+f777xtcXFz+3tDQcIoDJdY0Ydu2bREsaLg8NkqDHiQnJ69n44JlZWUPxGJxplarzdNqtbVcqGVCRkbGQta84eKl0I7YnGaBDsennZ0dYbUWADdz5sziwsLCbVqtNp/bkKz93RroIA+secyiRYtWtsJHNU4KCjpXhUKRy3pv3HESxjF7elVV1Raad4PQ+B5qfX29zt3dfeO1a9eQBhMkJSXteOeddx4Lv4wfP/71Cxcu5LLgNcWQpu2NVGs0Ax1MgmvXrn1BCFFw/V4ihMzWaDRreUcD7i38lQv/tBQywfzPMPOFEJqdCtxmQ2UOUkIaQgjMimGenp5vnzt3Tl/ihYcpflDzw1OcWQKbt4SjAQ0/WiqVyg4ePGgwb3gnhlmg4x95UDKTJ08u4gCHI5XNMtDmbYEO7VqK07F8fERBN76hoaGQVbVbtmz5OjIyMoLbueLVq1dvXLNmDTSV0efQoUM/SaVSMPgkAqRvvfXWB1988QVieoaH82B3MO6/yYY0iJgCOh8fn+VnzpzZxzgseruxtrY2nc0pM0YwNEZ74nSOWVlZu9hKHIZXbCWNvZWVVWBTU9N+ygDOCfMjhPx8+vTpdHqy4Pfo6OhkI1kLew8Pj+XFxcX6CD/AUVlZibIk2IawLc0CHejwvW3GUcJmNZZv7gjoHguyA3SWoaGhYYcOHYLhyAIETPiA81Id+/btO6+8vPwTR0dHfTUs/5k4ceLeoqIilDSBGfbe3t5vFBYWIkRieHgFnc0KBKDiZTLZnYKCgjvotGnTJtdp06YZnBFTQMcVFxxiA9jwzM+cOXOcNXJ5l2XaBbrPP//8r8uXL4dTpH+4mkEURNDCSbxullasqKgAYKZCk6SkpGwLDw83mCxcqhDHJluxYZ+YmPgBW9946tSpa5MmTZrJmSlmgQ72Z11dnTXLW0z4hx9+2Pfyyy8jK2PsquQTBV2zwk1MYMKECR/K5XJ6bQ7xG4/ExMTdkZGRBiORMh2L8PHxWajVanM4W0OvXerq6nJZA55X0GmflZWVymoM7phKIYR8Swh5fsOGDUujo6MN4QQzQdcsrANTwNbW9g2tVgvHAKGT9oBO5OHhsZjVPk1NTfXvv//+DF75V7MCiLS0tNLZs2fjNLjNPwmYuJgh7QZnY//+/UfYUjFOq8JuNlvTQV6BgYGVBQUFw0ePHk1zqXpxcoWZAD8feGaBDrzu0aOHN5tOhKZrVrjJNUR4II8Z3Gn48OFLL1++/B7fLV68eHHO7t27ETCmMR3M36u0tPQEuyheQWezY4oTCnYajPdBRUVFB9jaPlNAhzEaGxvjNBpNeVNT04v9+/cPYe8QYGL5+fnqgIAAaCbYL0hNiWQy2Uo2Z4h20MwuLi7/fPHFF8UqlQrZBWQGUGExqbS09G/s2gCaH3/88ZP6+voCjOvs7LyGjb8hFDJlypStubm5sCNhUAcrlcrdbFgJsbibN2/GYu52dnaD+vTps54FHOTi5+f3kVwu38tpRLM0HadxN7i7u/tnZmYGsHPAuktKSnZ5eHhE8YBnFuhAD1p86NCh58BHmpFwunLlSh6bukCAd9iwYShnhhFNz3fsiElpaWmJrEfJtcWlEwiEDdyOzs7OTgsMDDSUUvMqNxxlMtn6+Pj4N6nGhGCuXLmSamNjc7Vv376z+EFTU0AHewVPSxkCCG7SpEnJjCmA5vZz5sxZ/uWXXxqqI/jmAxcmgkGMMMIfpVLp2rS0tKC24nuUzoEDB5RhYWEQJHU2PJcsWfLJjh07YO/on9bmjt+2bNlCowOQCzRRR0D3P1i3u7v7gvz8/CD2RMJYV69eXeXm5raJsb9NAZ2tt7d3ON+sYnlpYWGhz0i41dbWfsMa2VydPa4h8nOlQzw9PWPOnj07nwqV87rgudF0CR1jiDEPlinoRDVGs93OFzb7tymga60/mLlixQqEVGCrssWH+g1VW1t7uCWbFRsiLCzMm6spFFlZWUmWL1/+/ubNm0e2BHDW/PDy8kJ0H3lYmA7YyI6EkCmJiYkrjZks/HVwjhq0JBwTajt2BH
748RQKggD+fn7+0fl5ORM4Aejc3JykOZK5IBnCuj0FcZKpfIgX3vS9dCMxPhHjx6VsIzjjjnkMI3F1CR5eXm7JRJJbyYYDDuMX7LcTJNhYO4TC2CelhAidnd3l2VnZ//ZmLBxDKanp/9Gg7YdAR1iU5GRkYqMjAwIH7bcD2zxIYKbS5Ysid++fbuvMRDh+FywYMESrgIaSxlMCAmSSqVLN27c6GSMydCqe/fu1Sxbtgze9EGuZJ9eDYTdCxqh4eHhs+Li4oYb4wFoxMfHqz7++GNU6eI0gQlD7a2Ogg60EBCXhIeHr0xOTnZj146Ntnnz5qncxSzPVjIS9IRDhXGrfKQZidEI/lpbW/83OCkQCFQlJSUHGLuB3XQgOsLT03NFbGzs9OPHj99ISkqCUSs3YngiWCiJjIyMbWxs1Cf/Qfvo0aPrlEolrjjqDXjsNBsbm6CoqKhANze3Hr169bK+ceNGfXZ29u2TJ08WI0MRHh7u17t3b4vS0tIdZ86cSW8tOLxgwYLbQqFQ5+Hh0Qu07t+/31RQUKBJTU0tbGxsRDiHBnD5ZUZ6zePv7x+OQDXScOirUCgelpSU/HzixAnEF3Fjv5Tb+QCNEyHE38bGZuK0adMm+Pr69qP9Kioqft26devlhw8fQqPiODRWTwfNABo+AoFg0pw5c3x8fX3t6Lzlcvn9lJSUKxyNrzlbl4IWLNXb2RKJJBA8Bn+rq6tP5ebmbmFyxE4eHh5viMXiWbw22zhnBDJFLDMAax82bBg2gl5W9vb2mrVr10Zyax4Jk6Jv377jeLJEvp6tE4RMA/39/Rfx+VhZWVmckZGxDscrmD2eEIKUFcIhPxNCyrlJswuk4AOYkLkYa2VlpdRqtTDGjV3MoEJBVmIAOltZWd3RarWXuMAthI4FIyOAbMFoQgiuLSIoeoujjbgXsgFDraysBFqtFg5GFQPwZsHhiIiIgp07d/4vIQTpI9BCHRtiT+j7HQdYY3VttPIXvICHjrmg731mLvAYEfyldi6dP8qxUQQBgdExkb1AWVAld4y19MUmjAtBoaTMhUfjBgcMjIuALZ8GZIF+4B0dF+tkAU7bwLZ+nlvTPzkgUbDQtYMOxQFOIqwBJhZOBX3mhhvPyogsKT5YWiiDM/CR48V5gI4WGuJf/AeBAGwtMQmMhj2Gyzu/cChvqTiRTxtC/M0Ibex4MAR1dAA+xoaHBwHjb5p/5fdtBjouCY1dDBroC+aBFhjcVhEluzbMCX2xRsybBRvf5MI6IVzMn+2HPvyS7pbMTloKDr6y825LFuAN+lLZ8cvIsaa22mBOdO0UB3iHudPiU/7vLcmSpYW1UH6A93qZdvUP6LQEuk77bgiDGEPxZvdHD1tz35r/1g269vGLbS1MSUl5k165RM2cWq3+0draWtWOimHzR+/CPbtBZ77wkNwON3Z7jssxw2N90hdxzJ/t76hnN+jMF4bRgDIXLEe2A56yMUfM/BGfkZ7doDNfkEJvb+8F/Og7FyxHmAH1fO35OoD5M+liPbtBZ77AhKGhoTPY6hyk+QYPHvzR3bt3jQXLzR/pGevZDTrzBSocNGhQcE1NDe5s6B8uv4oKDZobNZ/6M9yzq4POq6SkZL+9vb3+bsOvv/7auGnTpg2pqalP40vmAhcXl0B6kw15XS8vL9QU4itG/wmfRTN7W3R10CEaHyoQCPQ1d42NjcgAIMWGz5J1thGPYOlknU6H8i+CGjUvL695qJzq9lpbx2NXBx2qQ5Bmwb+oMEaIAqmb1rIHZu9QIx3xVYLTSJK3UFP4JMd6Zmh1ddD9uwXhq9FovtZoNKR///5LjdQU/rvn97scvxt0HROLvsZsz549iqioKJSh4yZXW/ndjo34DPTuBl3HhOhVW1uLjwcl3L17F3dt2Ys5HaP8DPfuBl3HhAtHBtcyUTL1NJyXjs32d9K7G3QdEwTKmWgdW3ee1URe/j+RFHPchjfb3wAAAABJRU5ErkJggg==",_.alt="Maptoolkit Logo",p.appendChild(_),this._container.appendChild(p),this._container}onRemove(){var n;(n=this._container)!=null&&n.parentNode&&this._container.parentNode.removeChild(this._container),this._map=void 0}}function ao(l,n){const p=new URL(yi.staticmapHost);return p.searchParams.set("api_key",yi.apiKey),p.searchParams.set("maptype",`${l}-${n}`),p.searchParams.set("size","166x166"),p.searchParams.set("center","47.329,12.787"),p.searchParams.set("zoom","12"),p.toString()}class uw{constructor(){this._terrain={id:"Terrain",value:"maptoolkit://styles/toursprung/terrain"},this._light={id:"Light",value:"maptoolkit://styles/toursprung/light"},this._dark={id:"Dark",value:"maptoolkit://styles/toursprung/dark"},this._city={id:"City",value:"maptoolkit://styles/citymaps2go/Ulmon"},this._green={id:"Green",value:"maptoolkit://styles/toursprung/printmaps-green"},this._winter={id:"Winter",value:"maptoolkit://styles/toursprung/terrainwinter"}}get Terrain(){return{...this._terrain,image:ao("toursprung","terrain")}}get Light(){return{...this._light,image:ao("toursprung","light")}}get Dark(){return{...this._dark,image:ao("toursprung","dark")}}get City(){return{...this._city,image:ao("citymaps2go","Ulmon")}}get Green(){return{...this._green,image:ao("toursprung","printmaps-green")}}get Winter(){return{...this._winter,image:ao("toursprung","terrainwinter")}}toArray(){return[this.Terrain,this.Light,this.Dark,this.City,this.Green,this.Winter]}}const vv=new uw;function Pf(l){let n=0;for(let p=0;p<l.length;p++)n+=l.charCodeAt(p);return n.toString(16)}var hw=8,pw={version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},dw={"*":{type:"source"}},fw=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],mw={type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}}
vendor: 4,306 bytes, line 748
748,default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},gw={type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},_w={type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},yw={type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},vw={type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},xw={type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},bw={id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},ww=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],Tw={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Sw={"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Mw={"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Pw={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Iw={"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Cw=
vendor: 8,541 bytes, line 748
748{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},
vendor: 17,533 bytes, line 748
748Ew={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Aw={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},kw={type:"array",value:"*"},zw={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},Rw={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},Dw={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},Lw={type:"array",value:"*",minimum:1},Fw={anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},Bw={"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},Ow={source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},Nw={type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},jw=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],Vw={"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},$w={"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},Uw={"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},Zw={"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},qw={"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},Gw={"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},Hw={"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},Ww={"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},Xw={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},Yw={"*":{type:"string"}},Kw={$version:hw,$root:pw,sources:dw,source:fw,source_vector:mw,source_raster:gw,source_raster_dem:_w,source_geojson:yw,source_video:vw,source_image:xw,layer:bw,layout:ww,layout_background:Tw,layout_fill:Sw,layout_circle:Mw,layout_heatmap:Pw,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:Iw,layout_symbol:Cw,layout_raster:Ew,layout_hillshade:Aw,filter:kw,filter_operator:zw,geometry_type:Rw,function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:Dw,expression:Lw,light:Fw,sky:Bw,terrain:Ow,projection:Nw,paint:jw,paint_fill:Vw,"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:$w,paint_circle:Uw,paint_heatmap:Zw,paint_symbol:qw,paint_raster:Gw,paint_hillshade:Hw,paint_background:Ww,transition:Xw,"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:Yw};
748class Jw extends Error{constructor(n,p){super(p),this.message=p,this.key=n}}class tm{constructor(n,p=[]){this.parent=n,this.bindings={};for(const[_,b]of p)this.bindings[_]=b}concat(n){return new tm(this,n)}get(n){if(this.bindings[n])return this.bindings[n];if(this.parent)return this.parent.get(n);throw new Error(`${n} not found in scope.`)}has(n){return this.bindings[n]?!0:this.parent?this.parent.has(n):!1}}const Ep={kind:"null"},Je={kind:"number"},qt={kind:"string"},Ot={kind:"boolean"},Rn={kind:"color"},rm={kind:"projectionDefinition"},Cl={kind:"object"},Nt={kind:"value"},Qw={kind:"error"},Ap={kind:"collator"},im={kind:"formatted"},sm={kind:"padding"},kp={kind:"resolvedImage"},nm={kind:"variableAnchorOffsetCollection"};function Ps(l,n){return{kind:"array",itemType:l,N:n}}function Ar(l){if(l.kind==="array"){const n=Ar(l.itemType);return typeof l.N=="number"?`array<${n}, ${l.N}>`:l.itemType.kind==="value"?"array":`array<${n}>`}else return l.kind}const e2=[Ep,Je,qt,Ot,Rn,rm,im,Cl,Ps(Nt),sm,kp,nm];function bu(l,n){if(n.kind==="error")return null;if(l.kind==="array"){if(n.kind==="array"&&(n.N===0&&n.itemType.kind==="value"||!bu(l.itemType,n.itemType))&&(typeof l.N!="number"||l.N===n.N))return null}else{if(l.kind===n.kind)return null;if(l.kind==="value"){for(const p of e2)if(!bu(p,n))return null}}return`Expected ${Ar(l)} but found ${Ar(n)} instead.`}function am(l,n){return n.some(p=>p.kind===l.kind)}function fo(l,n){return n.some(p=>p==="null"?l===null:p==="array"?Array.isArray(l):p==="object"?l&&!Array.isArray(l)&&typeof l=="object":p===typeof l)}function xl(l,n){return l.kind==="array"&&n.kind==="array"?l.itemType.kind===n.itemType.kind&&typeof l.N=="number":l.kind===n.kind}const xv=.96422,bv=1,wv=.82521,Tv=4/29,El=6/29,Sv=3*El*El,t2=El*El*El,r2=Math.PI/180,i2=180/Math.PI;function Mv(l){return l=l%360,l<0&&(l+=360),l}function Pv([l,n,p,_]){l=rf(l),n=rf(n),p=rf(p);let b,M;const x=sf((.2225045*l+.7168786*n+.0606169*p)/bv);l===n&&n===p?b=M=x:(b=sf((.4360747*l+.3850649*n+.1430804*p)/xv),M=sf((.0139322*l+.0971045*n+.7141733*p)/wv));const c=116*x-16;return[c<0?0:c,500*(b-x),200*(x-M),_]}function rf(l){return l<=.04045?l/12.92:Math.pow((l+.055)/1.055,2.4)}function sf(l){return l>t2?Math.pow(l,1/3):l/Sv+Tv}function Iv([l,n,p,_]){let b=(l+16)/116,M=isNaN(n)?b:b+n/500,x=isNaN(p)?b:b-p/200;return b=bv*af(b),M=xv*af(M),x=wv*af(x),[nf(3.1338561*M-1.6168667*b-.4906146*x),nf(-.9787684*M+1.9161415*b+.033454*x),nf(.0719453*M-.2289914*b+1.4052427*x),_]}function nf(l){return l=l<=.00304?12.92*l:1.055*Math.pow(l,1/2.4)-.055,l<0?0:l>1?1:l}function af(l){return l>El?l*l*l:Sv*(l-Tv)}function s2(l){const[n,p,_,b]=Pv(l),M=Math.sqrt(p*p+_*_);return[Math.round(M*1e4)?Mv(Math.atan2(_,p)*i2):NaN,M,n,b]}function n2([l,n,p,_]){return l=isNaN(l)?0:l*r2,Iv([p,Math.cos(l)*n,Math.sin(l)*n,_])}function a2([l,n,p,_]){l=Mv(l),n/=100,p/=100;function b(M){const x=(M+l/30)%12,c=n*Math.min(p,1-p);return p-c*Math.max(-1,Math.min(x-3,9-x,1))}return[b(0),b(8),b(4),_]}function o2(l){if(l=l.toLowerCase().trim(),l==="transparent")return[0,0,0,0];const n=l2[l];if(n){const[b,M,x]=n;return[b/255,M/255,x/255,1]}if(l.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(l)){const b=l.length<6?1:2;let M=1;return[Yh(l.slice(M,M+=b)),Yh(l.slice(M,M+=b)),Yh(l.slice(M,M+=b)),Yh(l.slice(M,M+b)||"ff")]}if(l.startsWith("rgb")){const b=/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,M=l.match(b);if(M){const[x,c,B,q,Y,ne,ge,Q,Se,rt,St,vt]=M,bt=[q||" ",ge||" ",rt].join("");if(bt==="  "||bt==="  /"||bt===",,"||bt===",,,"){const Pt=[B,ne,Se].join(""),nt=Pt==="%%%"?100:Pt===""?255:0;if(nt){const Ct=[Tl(+c/nt,0,1),Tl(+Y/nt,0,1),Tl(+Q/nt,0,1),St?F_(+St,vt):1];if(B_(Ct))return Ct}}return}}const p=/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,_=l.match(p);if(_){const[b,M,x,c,B,q,Y,ne,ge]=_,Q=[x||" ",B||" ",Y].join("");if(Q==="  "||Q==="  /"||Q===",,"||Q===",,,"){const Se=[+M,Tl(+c,0,100),Tl(+q,0,100),ne?F_(+ne,ge):1];if(B_(Se))return a2(Se)}}}function Yh(l){return parseInt(l.padEnd(2,l),16)/255}function F_(l,n){return Tl(n?l/100:l,0,1)}function Tl(l,n,p){return Math.min(Math.max(n,l),p)}function B_(l){return!l.some(Number.isNaN)}const l2={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],ol
748ive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function mo(l,n,p){return l+p*(n-l)}function hp(l,n,p){return l.map((_,b)=>mo(_,n[b],p))}class Er{constructor(n,p,_,b=1,M=!0){this.r=n,this.g=p,this.b=_,this.a=b,M||(this.r*=b,this.g*=b,this.b*=b,b||this.overwriteGetter("rgb",[n,p,_,b]))}static parse(n){if(n instanceof Er)return n;if(typeof n!="string")return;const p=o2(n);if(p)return new Er(...p,!1)}get rgb(){const{r:n,g:p,b:_,a:b}=this,M=b||1/0;return this.overwriteGetter("rgb",[n/M,p/M,_/M,b])}get hcl(){return this.overwriteGetter("hcl",s2(this.rgb))}get lab(){return this.overwriteGetter("lab",Pv(this.rgb))}overwriteGetter(n,p){return Object.defineProperty(this,n,{value:p}),p}toString(){const[n,p,_,b]=this.rgb;return`rgba(${[n,p,_].map(M=>Math.round(M*255)).join(",")},${b})`}static interpolate(n,p,_,b="rgb"){switch(b){case"rgb":{const[M,x,c,B]=hp(n.rgb,p.rgb,_);return new Er(M,x,c,B,!1)}case"hcl":{const[M,x,c,B]=n.hcl,[q,Y,ne,ge]=p.hcl;let Q,Se;if(!isNaN(M)&&!isNaN(q)){let Pt=q-M;q>M&&Pt>180?Pt-=360:q<M&&M-q>180&&(Pt+=360),Q=M+_*Pt}else isNaN(M)?isNaN(q)?Q=NaN:(Q=q,(c===1||c===0)&&(Se=Y)):(Q=M,(ne===1||ne===0)&&(Se=x));const[rt,St,vt,bt]=n2([Q,Se??mo(x,Y,_),mo(c,ne,_),mo(B,ge,_)]);return new Er(rt,St,vt,bt,!1)}case"lab":{const[M,x,c,B]=Iv(hp(n.lab,p.lab,_));return new Er(M,x,c,B,!1)}}}}Er.black=new Er(0,0,0,1),Er.white=new Er(1,1,1,1),Er.transparent=new Er(0,0,0,0),Er.red=new Er(1,0,0,1);class om{constructor(n,p,_){n?this.sensitivity=p?"variant":"case":this.sensitivity=p?"accent":"base",this.locale=_,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(n,p){return this.collator.compare(n,p)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}const c2=["bottom","center","top"];class If{constructor(n,p,_,b,M,x){this.text=n,this.image=p,this.scale=_,this.fontStack=b,this.textColor=M,this.verticalAlign=x}}class Dn{constructor(n){this.sections=n}static fromString(n){return new Dn([new If(n,null,null,null,null,null)])}isEmpty(){return this.sections.length===0?!0:!this.sections.some(n=>n.text.length!==0||n.image&&n.image.name.length!==0)}static factory(n){return n instanceof Dn?n:Dn.fromString(n)}toString(){return this.sections.length===0?"":this.sections.map(n=>n.text).join("")}}class sn{constructor(n){this.values=n.slice()}static parse(n){if(n instanceof sn)return n;if(typeof n=="number")return new sn([n,n,n,n]);if(Array.isArray(n)&&!(n.length<1||n.length>4)){for(const p of n)if(typeof p!="number")return;switch(n.length){case 1:n=[n[0],n[0],n[0],n[0]];break;case 2:n=[n[0],n[1],n[0],n[1]];break;case 3:n=[n[0],n[1],n[2],n[1]];break}return new sn(n)}}toString(){return JSON.stringify(this.values)}static interpolate(n,p,_){return new sn(hp(n.values,p.values,_))}}class ti{constructor(n){this.name="ExpressionEvaluationError",this.message=n}toJSON(){return this.message}}const u2=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Ln{constructor(n){this.values=n.slice()}static parse(n){if(n instanceof Ln)return n;if(!(!Array.isArray(n)||n.length<1||n.length%2!==0)){for(let p=0;p<n.length;p+=2){const _=n[p],b=n[p+1];if(typeof _!="string"||!u2.has(_)||!Array.isArray(b)||b.length!==2||typeof b[0]!="number"||typeof b[1]!="number")return}return new Ln(n)}}toString(){return JSON.stringify(this.values)}static interpolate(n,p,_){const b=n.values,M=p.values;if(b.length!==M.length)throw new ti(`Cannot interpolate values of different length. from: ${n.toString()}, to: ${p.toString()}`);const x=[];for(let c=0;c<b.length;c+=2){if(b[c]!==M[c])throw new ti(`Cannot interpolate values containing mismatched anchors. from[${c}]: ${b[c]}, to[${c}]: ${M[c]}`);x.push(b[c]);const[B,q]=b[c+1],[Y,ne]=M[c+1];x.push([mo(B,Y,_),mo(q,ne,_)])}return new Ln(x)}}class xa{constructor(n){this.name=n.name,this.available=n.available}toString(){return this.name}static fromString(n){return n?new xa({name:n,available:!1}):null}}class rn{constructor(n,p,_){this.from=n,this.to=p,this.transition=_}static interpolate(n,p,_){return new rn(n,p,_)}static parse(n){if(n instanceof rn)return n;if(Array.isArray(n)&&n.length===3&&typeof n[0]=="string"&&typeof n[1]=="string"&&typeof n[2]=="number")return new rn(n[0],n[1],n[2]);if(typeof n=="object"&&typeof n.from=="string"&&typeof n.to=="string"&&typeof n.transition=="number")return new rn(n.from,n.to,n.transition);if(typeof n=="string")return new rn(n,n,1)}}function Cv(l,n,p,_){return typeof l=="number"&&l>=0&&l<=255&&typeof n=="number"&&n>=0&&n<=255&&typeof p=="number"&&p>=0&&p<=255?typeof _>"u"||typeof _=="number"&&_>=0&&_<=1?null:`Invalid rgba value [${[l,n,p,_].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof _=="number"?[l,n,p,_]:[l,n,p]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function wu(l){if(l===null||typeof l=="string"||typeof l=="boolean"||typeof l=="number"||l instanceof rn||l instanceof Er||l instanceof om||l instanceof Dn||l instanceof sn||l instanceof Ln||l instanceof xa)return!0;
748if(Array.isArray(l)){for(const n of l)if(!wu(n))return!1;return!0}else if(typeof l=="object"){for(const n in l)if(!wu(l[n]))return!1;return!0}else return!1}function ci(l){if(l===null)return Ep;if(typeof l=="string")return qt;if(typeof l=="boolean")return Ot;if(typeof l=="number")return Je;if(l instanceof Er)return Rn;if(l instanceof rn)return rm;if(l instanceof om)return Ap;if(l instanceof Dn)return im;if(l instanceof sn)return sm;if(l instanceof Ln)return nm;if(l instanceof xa)return kp;if(Array.isArray(l)){const n=l.length;let p;for(const _ of l){const b=ci(_);if(!p)p=b;else{if(p===b)continue;p=Nt;break}}return Ps(p||Nt,n)}else return Cl}function mu(l){const n=typeof l;return l===null?"":n==="string"||n==="number"||n==="boolean"?String(l):l instanceof Er||l instanceof rn||l instanceof Dn||l instanceof sn||l instanceof Ln||l instanceof xa?l.toString():JSON.stringify(l)}class zl{constructor(n,p){this.type=n,this.value=p}static parse(n,p){if(n.length!==2)return p.error(`'literal' expression requires exactly one argument, but found ${n.length-1} instead.`);if(!wu(n[1]))return p.error("invalid value");const _=n[1];let b=ci(_);const M=p.expectedType;return b.kind==="array"&&b.N===0&&M&&M.kind==="array"&&(typeof M.N!="number"||M.N===0)&&(b=M),new zl(b,_)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const Kh={string:qt,number:Je,boolean:Ot,object:Cl};class Ns{constructor(n,p){this.type=n,this.args=p}static parse(n,p){if(n.length<2)return p.error("Expected at least one argument.");let _=1,b;const M=n[0];if(M==="array"){let c;if(n.length>2){const q=n[1];if(typeof q!="string"||!(q in Kh)||q==="object")return p.error('The item type argument of "array" must be one of string, number, boolean',1);c=Kh[q],_++}else c=Nt;let B;if(n.length>3){if(n[2]!==null&&(typeof n[2]!="number"||n[2]<0||n[2]!==Math.floor(n[2])))return p.error('The length argument to "array" must be a positive integer literal',2);B=n[2],_++}b=Ps(c,B)}else{if(!Kh[M])throw new Error(`Types doesn't contain name = ${M}`);b=Kh[M]}const x=[];for(;_<n.length;_++){const c=p.parse(n[_],_,Nt);if(!c)return null;x.push(c)}return new Ns(b,x)}evaluate(n){for(let p=0;p<this.args.length;p++){const _=this.args[p].evaluate(n);if(bu(this.type,ci(_))){if(p===this.args.length-1)throw new ti(`Expected value to be of type ${Ar(this.type)}, but found ${Ar(ci(_))} instead.`)}else return _}throw new Error}eachChild(n){this.args.forEach(n)}outputDefined(){return this.args.every(n=>n.outputDefined())}}const O_={"to-boolean":Ot,"to-color":Rn,"to-number":Je,"to-string":qt};class ma{constructor(n,p){this.type=n,this.args=p}static parse(n,p){if(n.length<2)return p.error("Expected at least one argument.");const _=n[0];if(!O_[_])throw new Error(`Can't parse ${_} as it is not part of the known types`);if((_==="to-boolean"||_==="to-string")&&n.length!==2)return p.error("Expected one argument.");const b=O_[_],M=[];for(let x=1;x<n.length;x++){const c=p.parse(n[x],x,Nt);if(!c)return null;M.push(c)}return new ma(b,M)}evaluate(n){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(n);case"color":{let p,_;for(const b of this.args){if(p=b.evaluate(n),_=null,p instanceof Er)return p;if(typeof p=="string"){const M=n.parseColor(p);if(M)return M}else if(Array.isArray(p)&&(p.length<3||p.length>4?_=`Invalid rgba value ${JSON.stringify(p)}: expected an array containing either three or four numeric values.`:_=Cv(p[0],p[1],p[2],p[3]),!_))return new Er(p[0]/255,p[1]/255,p[2]/255,p[3])}throw new ti(_||`Could not parse color from value '${typeof p=="string"?p:JSON.stringify(p)}'`)}case"padding":{let p;for(const _ of this.args){p=_.evaluate(n);const b=sn.parse(p);if(b)return b}throw new ti(`Could not parse padding from value '${typeof p=="string"?p:JSON.stringify(p)}'`)}case"variableAnchorOffsetCollection":{let p;for(const _ of this.args){p=_.evaluate(n);const b=Ln.parse(p);if(b)return b}throw new ti(`Could not parse variableAnchorOffsetCollection from value '${typeof p=="string"?p:JSON.stringify(p)}'`)}case"number":{let p=null;for(const _ of this.args){if(p=_.evaluate(n),p===null)return 0;const b=Number(p);if(!isNaN(b))return b}throw new ti(`Could not convert ${JSON.stringify(p)} to number.`)}case"formatted":return Dn.fromString(mu(this.args[0].evaluate(n)));case"resolvedImage":return xa.fromString(mu(this.args[0].evaluate(n)));case"projectionDefinition":return this.args[0].evaluate(n);default:return mu(this.args[0].evaluate(n))}}
748eachChild(n){this.args.forEach(n)}outputDefined(){return this.args.every(n=>n.outputDefined())}}const h2=["Unknown","Point","LineString","Polygon"];class p2{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?h2[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(n){let p=this._parseColorCache[n];return p||(p=this._parseColorCache[n]=Er.parse(n)),p}}class lm{constructor(n,p,_=[],b,M=new tm,x=[]){this.registry=n,this.path=_,this.key=_.map(c=>`[${c}]`).join(""),this.scope=M,this.errors=x,this.expectedType=b,this._isConstant=p}parse(n,p,_,b,M={}){return p?this.concat(p,_,b)._parse(n,M):this._parse(n,M)}_parse(n,p){(n===null||typeof n=="string"||typeof n=="boolean"||typeof n=="number")&&(n=["literal",n]);function _(b,M,x){return x==="assert"?new Ns(M,[b]):x==="coerce"?new ma(M,[b]):b}if(Array.isArray(n)){if(n.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const b=n[0];if(typeof b!="string")return this.error(`Expression name must be a string, but found ${typeof b} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const M=this.registry[b];if(M){let x=M.parse(n,this);if(!x)return null;if(this.expectedType){const c=this.expectedType,B=x.type;if((c.kind==="string"||c.kind==="number"||c.kind==="boolean"||c.kind==="object"||c.kind==="array")&&B.kind==="value")x=_(x,c,p.typeAnnotation||"assert");else if(c.kind==="projectionDefinition"&&(B.kind==="string"||B.kind==="array"))x=_(x,c,p.typeAnnotation||"coerce");else if((c.kind==="color"||c.kind==="formatted"||c.kind==="resolvedImage")&&(B.kind==="value"||B.kind==="string"))x=_(x,c,p.typeAnnotation||"coerce");else if(c.kind==="padding"&&(B.kind==="value"||B.kind==="number"||B.kind==="array"))x=_(x,c,p.typeAnnotation||"coerce");else if(c.kind==="variableAnchorOffsetCollection"&&(B.kind==="value"||B.kind==="array"))x=_(x,c,p.typeAnnotation||"coerce");else if(this.checkSubtype(c,B))return null}if(!(x instanceof zl)&&x.type.kind!=="resolvedImage"&&this._isConstant(x)){const c=new p2;try{x=new zl(x.type,x.evaluate(c))}catch(B){return this.error(B.message),null}}return x}return this.error(`Unknown expression "${b}". If you wanted a literal array, use ["literal", [...]].`,0)}else return typeof n>"u"?this.error("'undefined' value invalid. Use null instead."):typeof n=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof n} instead.`)}concat(n,p,_){const b=typeof n=="number"?this.path.concat(n):this.path,M=_?this.scope.concat(_):this.scope;return new lm(this.registry,this._isConstant,b,p||null,M,this.errors)}error(n,...p){const _=`${this.key}${p.map(b=>`[${b}]`).join("")}`;this.errors.push(new Jw(_,n))}checkSubtype(n,p){const _=bu(n,p);return _&&this.error(_),_}}class cm{constructor(n,p){this.type=p.type,this.bindings=[].concat(n),this.result=p}evaluate(n){return this.result.evaluate(n)}eachChild(n){for(const p of this.bindings)n(p[1]);n(this.result)}static parse(n,p){if(n.length<4)return p.error(`Expected at least 3 arguments, but found ${n.length-1} instead.`);const _=[];for(let M=1;M<n.length-1;M+=2){const x=n[M];if(typeof x!="string")return p.error(`Expected string, but found ${typeof x} instead.`,M);if(/[^a-zA-Z0-9_]/.test(x))return p.error("Variable names must contain only alphanumeric characters or '_'.",M);const c=p.parse(n[M+1],M+1);if(!c)return null;_.push([x,c])}const b=p.parse(n[n.length-1],n.length-1,p.expectedType,_);return b?new cm(_,b):null}outputDefined(){return this.result.outputDefined()}}class zp{constructor(n,p){this.type=p.type,this.name=n,this.boundExpression=p}
748static parse(n,p){if(n.length!==2||typeof n[1]!="string")return p.error("'var' expression requires exactly one string literal argument.");const _=n[1];return p.scope.has(_)?new zp(_,p.scope.get(_)):p.error(`Unknown variable "${_}". Make sure "${_}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(n){return this.boundExpression.evaluate(n)}eachChild(){}outputDefined(){return!1}}class um{constructor(n,p,_){this.type=n,this.index=p,this.input=_}static parse(n,p){if(n.length!==3)return p.error(`Expected 2 arguments, but found ${n.length-1} instead.`);const _=p.parse(n[1],1,Je),b=p.parse(n[2],2,Ps(p.expectedType||Nt));if(!_||!b)return null;const M=b.type;return new um(M.itemType,_,b)}evaluate(n){const p=this.index.evaluate(n),_=this.input.evaluate(n);if(p<0)throw new ti(`Array index out of bounds: ${p} < 0.`);if(p>=_.length)throw new ti(`Array index out of bounds: ${p} > ${_.length-1}.`);if(p!==Math.floor(p))throw new ti(`Array index must be an integer, but found ${p} instead.`);return _[p]}eachChild(n){n(this.index),n(this.input)}outputDefined(){return!1}}class hm{constructor(n,p){this.type=Ot,this.needle=n,this.haystack=p}static parse(n,p){if(n.length!==3)return p.error(`Expected 2 arguments, but found ${n.length-1} instead.`);const _=p.parse(n[1],1,Nt),b=p.parse(n[2],2,Nt);return!_||!b?null:am(_.type,[Ot,qt,Je,Ep,Nt])?new hm(_,b):p.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ar(_.type)} instead`)}evaluate(n){const p=this.needle.evaluate(n),_=this.haystack.evaluate(n);if(!_)return!1;if(!fo(p,["boolean","string","number","null"]))throw new ti(`Expected first argument to be of type boolean, string, number or null, but found ${Ar(ci(p))} instead.`);if(!fo(_,["string","array"]))throw new ti(`Expected second argument to be of type array or string, but found ${Ar(ci(_))} instead.`);return _.indexOf(p)>=0}eachChild(n){n(this.needle),n(this.haystack)}outputDefined(){return!0}}class pp{constructor(n,p,_){this.type=Je,this.needle=n,this.haystack=p,this.fromIndex=_}static parse(n,p){if(n.length<=2||n.length>=5)return p.error(`Expected 3 or 4 arguments, but found ${n.length-1} instead.`);const _=p.parse(n[1],1,Nt),b=p.parse(n[2],2,Nt);if(!_||!b)return null;if(!am(_.type,[Ot,qt,Je,Ep,Nt]))return p.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ar(_.type)} instead`);if(n.length===4){const M=p.parse(n[3],3,Je);return M?new pp(_,b,M):null}else return new pp(_,b)}evaluate(n){const p=this.needle.evaluate(n),_=this.haystack.evaluate(n);if(!fo(p,["boolean","string","number","null"]))throw new ti(`Expected first argument to be of type boolean, string, number or null, but found ${Ar(ci(p))} instead.`);let b;
748if(this.fromIndex&&(b=this.fromIndex.evaluate(n)),fo(_,["string"])){const M=_.indexOf(p,b);return M===-1?-1:[..._.slice(0,M)].length}else{if(fo(_,["array"]))return _.indexOf(p,b);throw new ti(`Expected second argument to be of type array or string, but found ${Ar(ci(_))} instead.`)}}eachChild(n){n(this.needle),n(this.haystack),this.fromIndex&&n(this.fromIndex)}outputDefined(){return!1}}class pm{constructor(n,p,_,b,M,x){this.inputType=n,this.type=p,this.input=_,this.cases=b,this.outputs=M,this.otherwise=x}static parse(n,p){if(n.length<5)return p.error(`Expected at least 4 arguments, but found only ${n.length-1}.`);if(n.length%2!==1)return p.error("Expected an even number of arguments.");let _,b;p.expectedType&&p.expectedType.kind!=="value"&&(b=p.expectedType);const M={},x=[];for(let q=2;q<n.length-1;q+=2){let Y=n[q];const ne=n[q+1];Array.isArray(Y)||(Y=[Y]);const ge=p.concat(q);if(Y.length===0)return ge.error("Expected at least one branch label.");for(const Se of Y){if(typeof Se!="number"&&typeof Se!="string")return ge.error("Branch labels must be numbers or strings.");if(typeof Se=="number"&&Math.abs(Se)>Number.MAX_SAFE_INTEGER)return ge.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof Se=="number"&&Math.floor(Se)!==Se)return ge.error("Numeric branch labels must be integer values.");if(!_)_=ci(Se);else if(ge.checkSubtype(_,ci(Se)))return null;if(typeof M[String(Se)]<"u")return ge.error("Branch labels must be unique.");M[String(Se)]=x.length}const Q=p.parse(ne,q,b);if(!Q)return null;b=b||Q.type,x.push(Q)}const c=p.parse(n[1],1,Nt);if(!c)return null;const B=p.parse(n[n.length-1],n.length-1,b);return!B||c.type.kind!=="value"&&p.concat(1).checkSubtype(_,c.type)?null:new pm(_,b,c,M,x,B)}evaluate(n){const p=this.input.evaluate(n);return(ci(p)===this.inputType&&this.outputs[this.cases[p]]||this.otherwise).evaluate(n)}eachChild(n){n(this.input),this.outputs.forEach(n),n(this.otherwise)}outputDefined(){return this.outputs.every(n=>n.outputDefined())&&this.otherwise.outputDefined()}}class dm{constructor(n,p,_){this.type=n,this.branches=p,this.otherwise=_}static parse(n,p){if(n.length<4)return p.error(`Expected at least 3 arguments, but found only ${n.length-1}.`);if(n.length%2!==0)return p.error("Expected an odd number of arguments.");let _;p.expectedType&&p.expectedType.kind!=="value"&&(_=p.expectedType);const b=[];for(let x=1;x<n.length-1;x+=2){const c=p.parse(n[x],x,Ot);if(!c)return null;const B=p.parse(n[x+1],x+1,_);if(!B)return null;b.push([c,B]),_=_||B.type}const M=p.parse(n[n.length-1],n.length-1,_);if(!M)return null;if(!_)throw new Error("Can't infer output type");return new dm(_,b,M)}evaluate(n){for(const[p,_]of this.branches)if(p.evaluate(n))return _.evaluate(n);return this.otherwise.evaluate(n)}eachChild(n){for(const[p,_]of this.branches)n(p),n(_);n(this.otherwise)}outputDefined(){return this.branches.every(([n,p])=>p.outputDefined())&&this.otherwise.outputDefined()}}class dp{constructor(n,p,_,b){this.type=n,this.input=p,this.beginIndex=_,this.endIndex=b}static parse(n,p){if(n.length<=2||n.length>=5)return p.error(`Expected 3 or 4 arguments, but found ${n.length-1} instead.`);const _=p.parse(n[1],1,Nt),b=p.parse(n[2],2,Je);if(!_||!b)return null;if(!am(_.type,[Ps(Nt),qt,Nt]))return p.error(`Expected first argument to be of type array or string, but found ${Ar(_.type)} instead`);if(n.length===4){const M=p.parse(n[3],3,Je);return M?new dp(_.type,_,b,M):null}else return new dp(_.type,_,b)}evaluate(n){const p=this.input.evaluate(n),_=this.beginIndex.evaluate(n);let b;if(this.endIndex&&(b=this.endIndex.evaluate(n)),fo(p,["string"]))return[...p].slice(_,b).join("");if(fo(p,["array"]))return p.slice(_,b);throw new ti(`Expected first argument to be of type array or string, but found ${Ar(ci(p))} instead.`)}eachChild(n){n(this.input),n(this.beginIndex),this.endIndex&&n(this.endIndex)}outputDefined(){return!1}}function Ev(l,n){const p=l.length-1;let _=0,b=p,M=0,x,c;for(;_<=b;)if(M=Math.floor((_+b)/2),x=l[M],c=l[M+1],x<=n){if(M===p||n<c)return M;_=M+1}else if(x>n)b=M-1;else throw new ti("Input is not a number.");return 0}class fm{constructor(n,p,_){this.type=n,this.input=p,this.labels=[],this.outputs=[];for(const[b,M]of _)this.labels.push(b),this.outputs.push(M)}static parse(n,p){if(n.length-1<4)return p.error(`Expected at least 4 arguments, but found only ${n.length-1}.`);if((n.length-1)%2!==0)return p.error("Expected an even number of arguments.");const _=p.parse(n[1],1,Je);
748if(!_)return null;const b=[];let M=null;p.expectedType&&p.expectedType.kind!=="value"&&(M=p.expectedType);for(let x=1;x<n.length;x+=2){const c=x===1?-1/0:n[x],B=n[x+1],q=x,Y=x+1;if(typeof c!="number")return p.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',q);if(b.length&&b[b.length-1][0]>=c)return p.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',q);const ne=p.parse(B,Y,M);if(!ne)return null;M=M||ne.type,b.push([c,ne])}return new fm(M,_,b)}evaluate(n){const p=this.labels,_=this.outputs;if(p.length===1)return _[0].evaluate(n);const b=this.input.evaluate(n);if(b<=p[0])return _[0].evaluate(n);const M=p.length;if(b>=p[M-1])return _[M-1].evaluate(n);const x=Ev(p,b);return _[x].evaluate(n)}eachChild(n){n(this.input);for(const p of this.outputs)n(p)}outputDefined(){return this.outputs.every(n=>n.outputDefined())}}function d2(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var of,N_;function f2(){if(N_)return of;N_=1,of=l;function l(n,p,_,b){this.cx=3*n,this.bx=3*(_-n)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*p,this.by=3*(b-p)-this.cy,this.ay=1-this.cy-this.by,this.p1x=n,this.p1y=p,this.p2x=_,this.p2y=b}return l.prototype={sampleCurveX:function(n){return((this.ax*n+this.bx)*n+this.cx)*n},sampleCurveY:function(n){return((this.ay*n+this.by)*n+this.cy)*n},sampleCurveDerivativeX:function(n){return(3*this.ax*n+2*this.bx)*n+this.cx},solveCurveX:function(n,p){if(p===void 0&&(p=1e-6),n<0)return 0;if(n>1)return 1;for(var _=n,b=0;b<8;b++){var M=this.sampleCurveX(_)-n;if(Math.abs(M)<p)return _;var x=this.sampleCurveDerivativeX(_);if(Math.abs(x)<1e-6)break;_=_-M/x}var c=0,B=1;for(_=n,b=0;b<20&&(M=this.sampleCurveX(_),!(Math.abs(M-n)<p));b++)n>M?c=_:B=_,_=(B-c)*.5+c;return _},solve:function(n,p){return this.sampleCurveY(this.solveCurveX(n,p))}},of}var m2=f2(),g2=d2(m2);class Al{constructor(n,p,_,b,M){this.type=n,this.operator=p,this.interpolation=_,this.input=b,this.labels=[],this.outputs=[];for(const[x,c]of M)this.labels.push(x),this.outputs.push(c)}static interpolationFactor(n,p,_,b){let M=0;if(n.name==="exponential")M=lf(p,n.base,_,b);else if(n.name==="linear")M=lf(p,1,_,b);else if(n.name==="cubic-bezier"){const x=n.controlPoints;M=new g2(x[0],x[1],x[2],x[3]).solve(lf(p,1,_,b))}return M}static parse(n,p){let[_,b,M,...x]=n;if(!Array.isArray(b)||b.length===0)return p.error("Expected an interpolation type expression.",1);if(b[0]==="linear")b={name:"linear"};else if(b[0]==="exponential"){const q=b[1];if(typeof q!="number")return p.error("Exponential interpolation requires a numeric base.",1,1);b={name:"exponential",base:q}}else if(b[0]==="cubic-bezier"){const q=b.slice(1);if(q.length!==4||q.some(Y=>typeof Y!="number"||Y<0||Y>1))return p.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);b={name:"cubic-bezier",controlPoints:q}}else return p.error(`Unknown interpolation type ${String(b[0])}`,1,0);if(n.length-1<4)return p.error(`Expected at least 4 arguments, but found only ${n.length-1}.`);if((n.length-1)%2!==0)return p.error("Expected an even number of arguments.");if(M=p.parse(M,2,Je),!M)return null;const c=[];let B=null;_==="interpolate-hcl"||_==="interpolate-lab"?B=Rn:p.expectedType&&p.expectedType.kind!=="value"&&(B=p.expectedType);for(let q=0;q<x.length;q+=2){const Y=x[q],ne=x[q+1],ge=q+3,Q=q+4;if(typeof Y!="number")return p.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',ge);if(c.length&&c[c.length-1][0]>=Y)return p.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',ge);const Se=p.parse(ne,Q,B);if(!Se)return null;B=B||Se.type,c.push([Y,Se])}return!xl(B,Je)&&!xl(B,rm)&&!xl(B,Rn)&&!xl(B,sm)&&!xl(B,nm)&&!xl(B,Ps(Je))?p.error(`Type ${Ar(B)} is not interpolatable.`):new Al(B,_,b,M,c)}evaluate(n){const p=this.labels,_=this.outputs;if(p.length===1)return _[0].evaluate(n);const b=this.input.evaluate(n);if(b<=p[0])return _[0].evaluate(n);const M=p.length;if(b>=p[M-1])return _[M-1].evaluate(n);const x=Ev(p,b),c=p[x],B=p[x+1],q=Al.interpolationFactor(this.interpolation,b,c,B),Y=_[x].evaluate(n),ne=_[x+1].evaluate(n);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return mo(Y,ne,q);case"color":return Er.interpolate(Y,ne,q);case"padding":return sn.interpolate(Y,ne,q);case"variableAnchorOffsetCollection":return Ln.interpolate(Y,ne,q);case"array":return hp(Y,ne,q);case"projectionDefinition":return rn.interpolate(Y,ne,q)}case"interpolate-hcl":return Er.interpolate(Y,ne,q,"hcl");case"interpolate-lab":return Er.interpolate(Y,ne,q,"lab")}}eachChild(n){n(this.input);for(const p of this.outputs)n(p)}outputDefined(){return this.outputs.every(n=>n.outputDefined())}}function lf(l,n,p,_){const b=_-p,M=l-p;return b===0?0:n===1?M/b:(Math.pow(n,M)-1)/(Math.pow(n,b)-1)}class fp{constructor(n,p){this.type=n,this.args=p}static parse(n,p){if(n.length<2)return p.error("Expected at least one argument.");let _=null;const b=p.expectedType;b&&b.kind!=="value"&&(_=b);const M=[];for(const x of n.slice(1)){const c=p.parse(x,1+M.length,_,void 0,{typeAnnotation:"omit"});if(!c)return null;_=_||c.type,M.push(c)}if(!_)throw new Error("No output type");return b&&M.some(x=>bu(b,x.type))?new fp(Nt,M):new fp(_,M)}evaluate(n){let p=null,_=0,b;for(const M of this.args)if(_++,p=M.evaluate(n),p&&p instanceof xa&&!p.available&&(b||(b=p.name),p=null,_===this.args.length&&(p=b)),p!==null)break;return p}
748eachChild(n){this.args.forEach(n)}outputDefined(){return this.args.every(n=>n.outputDefined())}}function j_(l,n){return l==="=="||l==="!="?n.kind==="boolean"||n.kind==="string"||n.kind==="number"||n.kind==="null"||n.kind==="value":n.kind==="string"||n.kind==="number"||n.kind==="value"}function _2(l,n,p){return n===p}function y2(l,n,p){return n!==p}function v2(l,n,p){return n<p}function x2(l,n,p){return n>p}function b2(l,n,p){return n<=p}function w2(l,n,p){return n>=p}function Av(l,n,p,_){return _.compare(n,p)===0}function T2(l,n,p,_){return!Av(l,n,p,_)}function S2(l,n,p,_){return _.compare(n,p)<0}function M2(l,n,p,_){return _.compare(n,p)>0}function P2(l,n,p,_){return _.compare(n,p)<=0}function I2(l,n,p,_){return _.compare(n,p)>=0}function Dl(l,n,p){const _=l!=="=="&&l!=="!=";return class kv{constructor(M,x,c){this.type=Ot,this.lhs=M,this.rhs=x,this.collator=c,this.hasUntypedArgument=M.type.kind==="value"||x.type.kind==="value"}static parse(M,x){if(M.length!==3&&M.length!==4)return x.error("Expected two or three arguments.");const c=M[0];let B=x.parse(M[1],1,Nt);if(!B)return null;if(!j_(c,B.type))return x.concat(1).error(`"${c}" comparisons are not supported for type '${Ar(B.type)}'.`);let q=x.parse(M[2],2,Nt);if(!q)return null;if(!j_(c,q.type))return x.concat(2).error(`"${c}" comparisons are not supported for type '${Ar(q.type)}'.`);if(B.type.kind!==q.type.kind&&B.type.kind!=="value"&&q.type.kind!=="value")return x.error(`Cannot compare types '${Ar(B.type)}' and '${Ar(q.type)}'.`);_&&(B.type.kind==="value"&&q.type.kind!=="value"?B=new Ns(q.type,[B]):B.type.kind!=="value"&&q.type.kind==="value"&&(q=new Ns(B.type,[q])));let Y=null;if(M.length===4){if(B.type.kind!=="string"&&q.type.kind!=="string"&&B.type.kind!=="value"&&q.type.kind!=="value")return x.error("Cannot use collator to compare non-string types.");if(Y=x.parse(M[3],3,Ap),!Y)return null}return new kv(B,q,Y)}evaluate(M){const x=this.lhs.evaluate(M),c=this.rhs.evaluate(M);if(_&&this.hasUntypedArgument){const B=ci(x),q=ci(c);if(B.kind!==q.kind||!(B.kind==="string"||B.kind==="number"))throw new ti(`Expected arguments for "${l}" to be (string, string) or (number, number), but found (${B.kind}, ${q.kind}) instead.`)}if(this.collator&&!_&&this.hasUntypedArgument){const B=ci(x),q=ci(c);if(B.kind!=="string"||q.kind!=="string")return n(M,x,c)}return this.collator?p(M,x,c,this.collator.evaluate(M)):n(M,x,c)}eachChild(M){M(this.lhs),M(this.rhs),this.collator&&M(this.collator)}outputDefined(){return!0}}}const C2=Dl("==",_2,Av),E2=Dl("!=",y2,T2),A2=Dl("<",v2,S2),k2=Dl(">",x2,M2),z2=Dl("<=",b2,P2),R2=Dl(">=",w2,I2);class Rp{constructor(n,p,_){this.type=Ap,this.locale=_,this.caseSensitive=n,this.diacriticSensitive=p}static parse(n,p){if(n.length!==2)return p.error("Expected one argument.");const _=n[1];if(typeof _!="object"||Array.isArray(_))return p.error("Collator options argument must be an object.");const b=p.parse(_["case-sensitive"]===void 0?!1:_["case-sensitive"],1,Ot);if(!b)return null;const M=p.parse(_["diacritic-sensitive"]===void 0?!1:_["diacritic-sensitive"],1,Ot);if(!M)return null;let x=null;return _.locale&&(x=p.parse(_.locale,1,qt),!x)?null:new Rp(b,M,x)}evaluate(n){return new om(this.caseSensitive.evaluate(n),this.diacriticSensitive.evaluate(n),this.locale?this.locale.evaluate(n):null)}eachChild(n){n(this.caseSensitive),n(this.diacriticSensitive),this.locale&&n(this.locale)}outputDefined(){return!1}}class mm{constructor(n,p,_,b,M){this.type=qt,this.number=n,this.locale=p,this.currency=_,this.minFractionDigits=b,this.maxFractionDigits=M}static parse(n,p){if(n.length!==3)return p.error("Expected two arguments.");const _=p.parse(n[1],1,Je);if(!_)return null;const b=n[2];if(typeof b!="object"||Array.isArray(b))return p.error("NumberFormat options argument must be an object.");let M=null;if(b.locale&&(M=p.parse(b.locale,1,qt),!M))return null;let x=null;if(b.currency&&(x=p.parse(b.currency,1,qt),!x))return null;let c=null;if(b["min-fraction-digits"]&&(c=p.parse(b["min-fraction-digits"],1,Je),!c))return null;let B=null;return b["max-fraction-digits"]&&(B=p.parse(b["max-fraction-digits"],1,Je),!B)?null:new mm(_,M,x,c,B)}evaluate(n){return new Intl.NumberFormat(this.locale?this.locale.evaluate(n):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(n):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(n):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(n):void 0}).format(this.number.evaluate(n))}eachChild(n){n(this.number),this.locale&&n(this.locale),this.currency&&n(this.currency),this.minFractionDigits&&n(this.minFractionDigits),this.maxFractionDigits&&n(this.maxFractionDigits)}outputDefined(){return!1}}class gm{constructor(n){this.type=im,this.sections=n}static parse(n,p){if(n.length<2)return p.error("Expected at least one argument.");const _=n[1];if(!Array.isArray(_)&&typeof _=="object")return p.error("First argument must be an image or text section.");const b=[];let M=!1;for(let x=1;x<=n.length-1;++x){const c=n[x];if(M&&typeof c=="object"&&!Array.isArray(c)){M=!1;let B=null;if(c["font-scale"]&&(B=p.parse(c["font-scale"],1,Je),!B))return null;let q=null;if(c["text-font"]&&(q=p.parse(c["text-font"],1,Ps(qt)),!q))return null;let Y=null;if(c["text-color"]&&(Y=p.parse(c["text-color"],1,Rn),!Y))return null;let ne=null;if(c["vertical-align"]){if(typeof c["vertical-align"]=="string"&&!c2.includes(c["vertical-align"]))return p.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${c["vertical-align"]}' instead.`);if(ne=p.parse(c["vertical-align"],1,qt),!ne)return null}const ge=b[b.length-1];ge.scale=B,ge.font=q,ge.textColor=Y,ge.verticalAlign=ne}else{const B=p.parse(n[x],1,Nt);if(!B)return null;const q=B.type.kind;if(q!=="string"&&q!=="value"&&q!=="null"&&q!=="resolvedImage")return p.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");M=!0,b.push({content:B,scale:null,font:null,textColor:null,verticalAlign:null})}}return new gm(b)}evaluate(n){const p=_=>{const b=_.content.evaluate(n);return ci(b)===kp?new If("",b,null,null,null,_.verticalAlign?_.verticalAlign.evaluate(n):null):new If(mu
748(b),null,_.scale?_.scale.evaluate(n):null,_.font?_.font.evaluate(n).join(","):null,_.textColor?_.textColor.evaluate(n):null,_.verticalAlign?_.verticalAlign.evaluate(n):null)};return new Dn(this.sections.map(p))}eachChild(n){for(const p of this.sections)n(p.content),p.scale&&n(p.scale),p.font&&n(p.font),p.textColor&&n(p.textColor),p.verticalAlign&&n(p.verticalAlign)}outputDefined(){return!1}}class _m{constructor(n){this.type=kp,this.input=n}static parse(n,p){if(n.length!==2)return p.error("Expected two arguments.");const _=p.parse(n[1],1,qt);return _?new _m(_):p.error("No image name provided.")}evaluate(n){const p=this.input.evaluate(n),_=xa.fromString(p);return _&&n.availableImages&&(_.available=n.availableImages.indexOf(p)>-1),_}eachChild(n){n(this.input)}outputDefined(){return!1}}class ym{constructor(n){this.type=Je,this.input=n}static parse(n,p){if(n.length!==2)return p.error(`Expected 1 argument, but found ${n.length-1} instead.`);const _=p.parse(n[1],1);return _?_.type.kind!=="array"&&_.type.kind!=="string"&&_.type.kind!=="value"?p.error(`Expected argument of type string or array, but found ${Ar(_.type)} instead.`):new ym(_):null}evaluate(n){const p=this.input.evaluate(n);if(typeof p=="string")return[...p].length;if(Array.isArray(p))return p.length;throw new ti(`Expected value to be of type string or array, but found ${Ar(ci(p))} instead.`)}eachChild(n){n(this.input)}outputDefined(){return!1}}const an=8192;function D2(l,n){const p=L2(l[0]),_=B2(l[1]),b=Math.pow(2,n.z);return[Math.round(p*b*an),Math.round(_*b*an)]}function vm(l,n){const p=Math.pow(2,n.z),_=(l[0]/an+n.x)/p,b=(l[1]/an+n.y)/p;return[F2(_),O2(b)]}function L2(l){return(180+l)/360}function F2(l){return l*360-180}function B2(l){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+l*Math.PI/360)))/360}function O2(l){return 360/Math.PI*Math.atan(Math.exp((180-l*360)*Math.PI/180))-90}function Iu(l,n){l[0]=Math.min(l[0],n[0]),l[1]=Math.min(l[1],n[1]),l[2]=Math.max(l[2],n[0]),l[3]=Math.max(l[3],n[1])}function Tu(l,n){return!(l[0]<=n[0]||l[2]>=n[2]||l[1]<=n[1]||l[3]>=n[3])}function N2(l,n,p){return n[1]>l[1]!=p[1]>l[1]&&l[0]<(p[0]-n[0])*(l[1]-n[1])/(p[1]-n[1])+n[0]}function j2(l,n,p){const _=l[0]-n[0],b=l[1]-n[1],M=l[0]-p[0],x=l[1]-p[1];return _*x-M*b===0&&_*M<=0&&b*x<=0}function Dp(l,n,p,_){const b=[n[0]-l[0],n[1]-l[1]],M=[_[0]-p[0],_[1]-p[1]];return Z2(M,b)===0?!1:!!(V_(l,n,p,_)&&V_(p,_,l,n))}function V2(l,n,p){for(const _ of p)for(let b=0;b<_.length-1;++b)if(Dp(l,n,_[b],_[b+1]))return!0;return!1}function Ll(l,n,p=!1){let _=!1;for(const b of n)for(let M=0;M<b.length-1;M++){if(j2(l,b[M],b[M+1]))return p;N2(l,b[M],b[M+1])&&(_=!_)}return _}function $2(l,n){for(const p of n)if(Ll(l,p))return!0;return!1}function zv(l,n){for(const p of l)if(!Ll(p,n))return!1;for(let p=0;p<l.length-1;++p)if(V2(l[p],l[p+1],n))return!1;return!0}function U2(l,n){for(const p of n)if(zv(l,p))return!0;return!1}function Z2(l,n){return l[0]*n[1]-l[1]*n[0]}function V_(l,n,p,_){const b=l[0]-p[0],M=l[1]-p[1],x=n[0]-p[0],c=n[1]-p[1],B=_[0]-p[0],q=_[1]-p[1],Y=b*q-B*M,ne=x*q-B*c;return Y>0&&ne<0||Y<0&&ne>0}function xm(l,n,p){const _=[];for(let b=0;b<l.length;b++){const M=[];for(let x=0;x<l[b].length;x++){const c=D2(l[b][x],p);Iu(n,c),M.push(c)}_.push(M)}return _}function Rv(l,n,p){const _=[];for(let b=0;b<l.length;b++){const M=xm(l[b],n,p);_.push(M)}return _}function Dv(l,n,p,_){if(l[0]<p[0]||l[0]>p[2]){const b=_*.5;let M=l[0]-p[0]>b?-_:p[0]-l[0]>b?_:0;M===0&&(M=l[0]-p[2]>b?-_:p[2]-l[0]>b?_:0),l[0]+=M}Iu(n,l)}function q2(l){l[0]=l[1]=1/0,l[2]=l[3]=-1/0}function $_(l,n,p,_){const b=Math.pow(2,_.z)*an,M=[_.x*an,_.y*an],x=[];for(const c of l)for(const B of c){const q=[B.x+M[0],B.y+M[1]];Dv(q,n,p,b),x.push(q)}return x}function U_(l,n,p,_){const b=Math.pow(2,_.z)*an,M=[_.x*an,_.y*an],x=[];for(const c of l){const B=[];for(const q of c){const Y=[q.x+M[0],q.y+M[1]];Iu(n,Y),B.push(Y)}x.push(B)}if(n[2]-n[0]<=b/2){q2(n);for(const c of x)for(const B of c)Dv(B,n,p,b)}return x}function G2(l,n){const p=[1/0,1/0,-1/0,-1/0],_=[1/0,1/0,-1/0,-1/0],b=l.canonicalID();if(n.type==="Polygon"){const M=xm(n.coordinates,_,b),x=$_(l.geometry(),p,_,b);if(!Tu(p,_))return!1;for(const c of x)if(!Ll(c,M))return!1}if(n.type==="MultiPolygon"){const M=Rv(n.coordinates,_,b),x=$_(l.geometry(),p,_,b);if(!Tu(p,_))return!1;for(const c of x)if(!$2(c,M))return!1}return!0}function H2(l,n){const p=[1/0,1/0,-1/0,-1/0],_=[1/0,1/0,-1/0,-1/0],b=l.canonicalID();if(n.type==="Polygon"){const M=xm(n.coordinates,_,b),x=U_(l.geometry(),p,_,b);if(!Tu(p,_))return!1;for(const c of x)if(!zv(c,M))return!1}if(n.type==="MultiPolygon"){const M=Rv(n.coordinates,_,b),x=U_(l.geometry(),p,_,b);if(!Tu(p,_))return!1;for(const c of x)if(!U2(c,M))return!1}return!0}class go{constructor(n,p){this.type=Ot,this.geojson=n,this.geometries=p}static parse(n,p){if(n.length!==2)return p.error(`'within' expression requires exactly one argument, but found ${n.length-1} instead.`);if(wu(n[1])){const _=n[1];if(_.type==="FeatureCollection"){const b=[];for(const M of _.features){const{type:x,coordinates:c}=M.geometry;
vendor: 6,516 bytes, line 748
748x==="Polygon"&&b.push(c),x==="MultiPolygon"&&b.push(...c)}if(b.length){const M={type:"MultiPolygon",coordinates:b};return new go(_,M)}}else if(_.type==="Feature"){const b=_.geometry.type;if(b==="Polygon"||b==="MultiPolygon")return new go(_,_.geometry)}else if(_.type==="Polygon"||_.type==="MultiPolygon")return new go(_,_)}return p.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(n){if(n.geometry()!=null&&n.canonicalID()!=null){if(n.geometryType()==="Point")return G2(n,this.geometries);if(n.geometryType()==="LineString")return H2(n,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class Lv{constructor(n=[],p=(_,b)=>_<b?-1:_>b?1:0){if(this.data=n,this.length=this.data.length,this.compare=p,this.length>0)for(let _=(this.length>>1)-1;_>=0;_--)this._down(_)}push(n){this.data.push(n),this._up(this.length++)}pop(){if(this.length===0)return;const n=this.data[0],p=this.data.pop();return--this.length>0&&(this.data[0]=p,this._down(0)),n}peek(){return this.data[0]}_up(n){const{data:p,compare:_}=this,b=p[n];for(;n>0;){const M=n-1>>1,x=p[M];if(_(b,x)>=0)break;p[n]=x,n=M}p[n]=b}_down(n){const{data:p,compare:_}=this,b=this.length>>1,M=p[n];for(;n<b;){let x=(n<<1)+1;const c=x+1;if(c<this.length&&_(p[c],p[x])<0&&(x=c),_(p[x],M)>=0)break;p[n]=p[x],n=x}p[n]=M}}function W2(l,n){if(l.length<=1)return[l];const p=[];let _,b;for(const M of l){const x=X2(M);x!==0&&(M.area=Math.abs(x),b===void 0&&(b=x<0),b===x<0?(_&&p.push(_),_=[M]):_.push(M))}return _&&p.push(_),p}function X2(l){let n=0;for(let p=0,_=l.length,b=_-1,M,x;p<_;b=p++)M=l[p],x=l[b],n+=(x.x-M.x)*(M.y+x.y);return n}const Y2=6378.137,Z_=1/298.257223563,q_=Z_*(2-Z_),G_=Math.PI/180;class bm{constructor(n){const p=G_*Y2*1e3,_=Math.cos(n*G_),b=1/(1-q_*(1-_*_)),M=Math.sqrt(b);this.kx=p*M*_,this.ky=p*M*b*(1-q_)}distance(n,p){const _=this.wrap(n[0]-p[0])*this.kx,b=(n[1]-p[1])*this.ky;return Math.sqrt(_*_+b*b)}pointOnLine(n,p){let _=1/0,b,M,x,c;for(let B=0;B<n.length-1;B++){let q=n[B][0],Y=n[B][1],ne=this.wrap(n[B+1][0]-q)*this.kx,ge=(n[B+1][1]-Y)*this.ky,Q=0;(ne!==0||ge!==0)&&(Q=(this.wrap(p[0]-q)*this.kx*ne+(p[1]-Y)*this.ky*ge)/(ne*ne+ge*ge),Q>1?(q=n[B+1][0],Y=n[B+1][1]):Q>0&&(q+=ne/this.kx*Q,Y+=ge/this.ky*Q)),ne=this.wrap(p[0]-q)*this.kx,ge=(p[1]-Y)*this.ky;const Se=ne*ne+ge*ge;Se<_&&(_=Se,b=q,M=Y,x=B,c=Q)}return{point:[b,M],index:x,t:Math.max(0,Math.min(1,c))}}wrap(n){for(;n<-180;)n+=360;for(;n>180;)n-=360;return n}}const Cf=100,Ef=50;function Fv(l,n){return n[0]-l[0]}function mp(l){return l[1]-l[0]+1}function Fn(l,n){return l[1]>=l[0]&&l[1]<n}function Af(l,n){if(l[0]>l[1])return[null,null];const p=mp(l);if(n){if(p===2)return[l,null];const b=Math.floor(p/2);return[[l[0],l[0]+b],[l[0]+b,l[1]]]}if(p===1)return[l,null];const _=Math.floor(p/2)-1;return[[l[0],l[0]+_],[l[0]+_+1,l[1]]]}function kf(l,n){if(!Fn(n,l.length))return[1/0,1/0,-1/0,-1/0];const p=[1/0,1/0,-1/0,-1/0];for(let _=n[0];_<=n[1];++_)Iu(p,l[_]);return p}function zf(l){const n=[1/0,1/0,-1/0,-1/0];for(const p of l)for(const _ of p)Iu(n,_);return n}function H_(l){return l[0]!==-1/0&&l[1]!==-1/0&&l[2]!==1/0&&l[3]!==1/0}function wm(l,n,p){if(!H_(l)||!H_(n))return NaN;let _=0,b=0;return l[2]<n[0]&&(_=n[0]-l[2]),l[0]>n[2]&&(_=l[0]-n[2]),l[1]>n[3]&&(b=l[1]-n[3]),l[3]<n[1]&&(b=n[1]-l[3]),p.distance([0,0],[_,b])}function lo(l,n,p){const _=p.pointOnLine(n,l);return p.distance(l,_.point)}function Tm(l,n,p,_,b){const M=Math.min(lo(l,[p,_],b),lo(n,[p,_],b)),x=Math.min(lo(p,[l,n],b),lo(_,[l,n],b));return Math.min(M,x)}function K2(l,n,p,_,b){if(!(Fn(n,l.length)&&Fn(_,p.length)))return 1/0;let M=1/0;for(let x=n[0];x<n[1];++x){const c=l[x],B=l[x+1];for(let q=_[0];q<_[1];++q){const Y=p[q],ne=p[q+1];if(Dp(c,B,Y,ne))return 0;M=Math.min(M,Tm(c,B,Y,ne,b))}}return M}function J2(l,n,p,_,b){if(!(Fn(n,l.length)&&Fn(_,p.length)))return NaN;let M=1/0;for(let x=n[0];x<=n[1];++x)for(let c=_[0];c<=_[1];++c)if(M=Math.min(M,b.distance(l[x],p[c])),M===0)return M;return M}function Q2(l,n,p){if(Ll(l,n,!0))return 0;let _=1/0;for(const b of n){const M=b[0],x=b[b.length-1];if(M!==x&&(_=Math.min(_,lo(l,[x,M],p)),_===0))return _;const c=p.pointOnLine(b,l);if(_=Math.min(_,p.distance(l,c.point)),_===0)return _}return _}function eT(l,n,p,_){if(!Fn(n,l.length))return NaN;for(let M=n[0];M<=n[1];++M)if(Ll(l[M],p,!0))return 0;let b=1/0;for(let M=n[0];M<n[1];++M){const x=l[M],c=l[M+1];for(const B of p)for(let q=0,Y=B.length,ne=Y-1;q<Y;ne=q++){const ge=B[ne],Q=B[q];if(Dp(x,c,ge,Q))return 0;b=Math.min(b,Tm(x,c,ge,Q,_))}}return b}function W_(l,n){for(const p of l)for(const _ of p)if(Ll(_,n,!0))return!0;return!1}function tT(l,n,p,_=1/0){const b=zf(l),M=zf(n);if(_!==1/0&&wm(b,M,p)>=_)return _;if(Tu(b,M)){if(W_(l,n))return 0}else if(W_(n,l))return 0;let x=1/0;for(const c of l)for(let B=0,q=c.length,Y=q-1;B<q;Y=B++){const ne=c[Y],ge=c[B];for(const Q of n)for(let Se=0,rt=Q.length,St=rt-1;Se<rt;St=Se++){const vt=Q[St],bt=Q[Se];if(Dp(ne,ge,vt,bt))return 0;x=Math.min(x,Tm(ne,ge,vt,bt,p))}}return x}function X_(l,n,p,_,b,M){if(!M)return;const x=wm(kf(_,M),b,p);x<n&&l.push([x,M,[0,0]])}function Jh(l,n,p,_,b,M,x){if(!M||!x)return;const c=wm(kf(_,M),kf(b,x),p);c<n&&l.push([c,M,x])}function gp(l,n,p,_,b=1/0){let M=Math.min(_.distance(l[0],p[0][0]),b);if(M===0)return M;const x=new Lv([[0,[0,l.length-1],[0,0]]],Fv),c=zf(p);for(;x.length>0;){const B=x.pop();if(B[0]>=M)continue;const q=B[1],Y=n?Ef:Cf;if(mp(q)<=Y){if(!Fn(q,l.length))return NaN;if(n){const ne=eT(l,q,p,_);if(isNaN(ne)||ne===0)return ne;M=Math.min(M,ne)}else for(let ne=q[0];ne<=q[1];++ne){const ge=Q2(l[ne],p,_);if(M=Math.min(M,ge),M===0)return 0}}else{const ne=Af(q,n);X_(x,M,_,l,c,ne[0]),X_(x,M,_,l,c,ne[1])}}return M}function _p(l,n,p,_,b,M=1/0){let x=Math.min(M,b.distance(l[0],p[0]));if(x===0)return x;const c=new Lv([[0,[0,l.length-1],[0,p.length-1]]],Fv);for(;c.length>0;){const B=c.pop();if(B[0]>=x)continue;const q=B[1],Y=B[2],ne=n?Ef:Cf,ge=_?Ef:Cf;if(mp(q)<=ne&&mp(Y)<=ge){if(!Fn(q,l.length)&&Fn(Y,p.length))return NaN;let Q;if(n&&_)Q=K2(l,q,p,Y,b),x=Math.min(x,Q);else if(n&&!_){const Se=l.slice(q[0],q[1]+1);for(let rt=Y[0];rt<=Y[1];++rt)if(Q=lo(p[rt],Se,b),x=Math.min(x,Q),x===0)return x}else if(!n&&_){const Se=p.slice(Y[0],Y[1]+1);for(let rt=q[0];rt<=q[1];++rt)if(Q=lo(l[rt],Se,b),x=Math.min(x,Q),x===0)return x}else Q=J2(l,q,p,Y,b),x=Math.min(x,Q)}else{const Q=Af(q,n),Se=Af(Y,_);Jh(c,x,b,l,p,Q[0],Se[0]),Jh(c,x,b,l,p,Q[0],Se[1]),Jh(c,x,b,l,p,Q[1],Se[0]),Jh(c,x,b,l,p,Q[1],Se[1])}}return x}function rT(l,n){const p=l.geometry(),_=p.flat().map(x=>
748vm([x.x,x.y],l.canonical));if(p.length===0)return NaN;const b=new bm(_[0][1]);let M=1/0;for(const x of n){switch(x.type){case"Point":M=Math.min(M,_p(_,!1,[x.coordinates],!1,b,M));break;case"LineString":M=Math.min(M,_p(_,!1,x.coordinates,!0,b,M));break;case"Polygon":M=Math.min(M,gp(_,!1,x.coordinates,b,M));break}if(M===0)return M}return M}function iT(l,n){const p=l.geometry(),_=p.flat().map(x=>vm([x.x,x.y],l.canonical));if(p.length===0)return NaN;const b=new bm(_[0][1]);let M=1/0;for(const x of n){switch(x.type){case"Point":M=Math.min(M,_p(_,!0,[x.coordinates],!1,b,M));break;case"LineString":M=Math.min(M,_p(_,!0,x.coordinates,!0,b,M));break;case"Polygon":M=Math.min(M,gp(_,!0,x.coordinates,b,M));break}if(M===0)return M}return M}function sT(l,n){const p=l.geometry();if(p.length===0||p[0].length===0)return NaN;const _=W2(p).map(x=>x.map(c=>c.map(B=>vm([B.x,B.y],l.canonical)))),b=new bm(_[0][0][0][1]);let M=1/0;for(const x of n)for(const c of _){switch(x.type){case"Point":M=Math.min(M,gp([x.coordinates],!1,c,b,M));break;case"LineString":M=Math.min(M,gp(x.coordinates,!0,c,b,M));break;case"Polygon":M=Math.min(M,tT(c,x.coordinates,b,M));break}if(M===0)return M}return M}function cf(l){return l.type==="MultiPolygon"?l.coordinates.map(n=>({type:"Polygon",coordinates:n})):l.type==="MultiLineString"?l.coordinates.map(n=>({type:"LineString",coordinates:n})):l.type==="MultiPoint"?l.coordinates.map(n=>({type:"Point",coordinates:n})):[l]}class _o{constructor(n,p){this.type=Je,this.geojson=n,this.geometries=p}static parse(n,p){if(n.length!==2)return p.error(`'distance' expression requires exactly one argument, but found ${n.length-1} instead.`);if(wu(n[1])){const _=n[1];if(_.type==="FeatureCollection")return new _o(_,_.features.map(b=>cf(b.geometry)).flat());if(_.type==="Feature")return new _o(_,cf(_.geometry));if("type"in _&&"coordinates"in _)return new _o(_,cf(_))}return p.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(n){if(n.geometry()!=null&&n.canonicalID()!=null){if(n.geometryType()==="Point")return rT(n,this.geometries);if(n.geometryType()==="LineString")return iT(n,this.geometries);if(n.geometryType()==="Polygon")return sT(n,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const Bv={"==":C2,"!=":E2,">":k2,"<":A2,">=":R2,"<=":z2,array:Ns,at:um,boolean:Ns,case:dm,coalesce:fp,collator:Rp,format:gm,image:_m,in:hm,"index-of":pp,interpolate:Al,"interpolate-hcl":Al,"interpolate-lab":Al,length:ym,let:cm,literal:zl,match:pm,number:Ns,"number-format":mm,object:Ns,slice:dp,step:fm,string:Ns,"to-boolean":ma,"to-color":ma,"to-number":ma,"to-string":ma,var:zp,within:go,distance:_o};class zn{constructor(n,p,_,b){this.name=n,this.type=p,this._evaluate=_,this.args=b}evaluate(n){return this._evaluate(n,this.args)}eachChild(n){this.args.forEach(n)}outputDefined(){return!1}static parse(n,p){const _=n[0],b=zn.definitions[_];if(!b)return p.error(`Unknown expression "${_}". If you wanted a literal array, use ["literal", [...]].`,0);const M=Array.isArray(b)?b[0]:b.type,x=Array.isArray(b)?[[b[1],b[2]]]:b.overloads,c=x.filter(([q])=>!Array.isArray(q)||q.length===n.length-1);let B=null;for(const[q,Y]of c){B=new lm(p.registry,Rf,p.path,null,p.scope);const ne=[];let ge=!1;for(let Q=1;Q<n.length;Q++){const Se=n[Q],rt=Array.isArray(q)?q[Q-1]:q.type,St=B.parse(Se,1+ne.length,rt);if(!St){ge=!0;break}ne.push(St)}if(!ge){if(Array.isArray(q)&&q.length!==ne.length){B.error(`Expected ${q.length} arguments, but found ${ne.length} instead.`);continue}for(let Q=0;Q<ne.length;Q++){const Se=Array.isArray(q)?q[Q]:q.type,rt=ne[Q];B.concat(Q+1).checkSubtype(Se,rt.type)}if(B.errors.length===0)return new zn(_,M,Y,ne)}}if(c.length===1)p.errors.push(...B.errors);else{const q=(c.length?c:x).map(([ne])=>aT(ne)).join(" | "),Y=[];for(let ne=1;ne<n.length;ne++){const ge=p.parse(n[ne],1+Y.length);if(!ge)return null;Y.push(Ar(ge.type))}p.error(`Expected arguments of type ${q}, but found (${Y.join(", ")}) instead.`)}return null}static register(n,p){zn.definitions=p;for(const _ in p)n[_]=zn}}function Y_(l,[n,p,_,b]){n=n.evaluate(l),p=p.evaluate(l),_=_.evaluate(l);const M=b?b.evaluate(l):1,x=Cv(n,p,_,M);if(x)throw new ti(x);return new Er(n/255,p/255,_/255,M,!1)}function K_(l,n){return l in n}function uf(l,n){const p=n[l];return typeof p>"u"?null:p}function nT(l,n,p,_){for(;p<=_;){const b=p+_>>1;if(n[b]===l)return!0;n[b]>l?_=b-1:p=b+1}return!1}function so(l){return{type:l}}zn.register(Bv,{error:[Qw,[qt],(l,[n])=>{throw new ti(n.evaluate(l))}],typeof:[qt,[Nt],(l,[n])=>Ar(ci(n.evaluate(l)))],"to-rgba":[Ps(Je,4),[Rn],(l,[n])=>{const[p,_,b,M]=n.evaluate(l).rgb;return[p*255,_*255,b*255,M]}],rgb:[Rn,[Je,Je,Je],Y_],rgba:[Rn,[Je,Je,Je,Je],Y_],has:{type:Ot,overloads:[[[qt],(l,[n])=>K_(n.evaluate(l),l.properties())],[[qt,Cl],(l,[n,p])=>K_(n.evaluate(l),p.evaluate(l))]]},get:{type:Nt,overloads:[[[qt],(l,[n])=>uf(n.evaluate(l),l.properties())],[[qt,Cl],(l,[n,p])=>uf(n.evaluate(l),p.evaluate(l))]]},"feature-state":[Nt,[qt],(l,[n])=>uf(n.evaluate(l),l.featureState||{})],properties:[Cl,[],l=>l.properties()],"geometry-type":[qt,[],l=>l.geometryType()],id:[Nt,[],l=>l.id()],zoom:[Je,[],l=>l.globals.zoom],"heatmap-density":[Je,[],l=>l.globals.heatmapDensity||0],"line-progress":[Je,[],l=>l.globals.lineProgress||0],accumulated:[Nt,[],l=>l.globals.accumulated===void 0?null:l.globals.accumulated],"+":[Je,so(Je),(l,n)=>{let p=0;for(const _ of n)p+=_.evaluate(l);return p}],"*":[Je,so(Je),(l,n)=>{let p=1;for(const _ of n)p*=_.evaluate(l);return p}],"-":{type:Je,overloads:[[[Je,Je],(l,[n,p])=>n.evaluate(l)-p.evaluate(l)],[[Je],(l,[n])=>-n.evaluate(l)]]},"/":[Je,[Je,Je],(l,[n,p])=>n.evaluate(l)/p.evaluate(l)],"%":[Je,[Je,Je],(l,[n,p])=>n.evaluate(l)%p.evaluate(l)],ln2:[Je,[],()=>Math.LN2],pi:[Je,[],()=>Math.PI],e:[Je,[],()=>Math.E],"^":[Je,[Je,Je],(l,[n,p])=>Math.pow(n.evaluate(l),p.evaluate(l))],sqrt:[Je,[Je],(l,[n])=>Math.sqrt(n.evaluate(l))],log10:[Je,[Je],(l,[n])=>Math.log(n.evaluate(l))/Math.LN10],ln:[Je,[Je],(l,[n])=>Math.log(n.evaluate(l))],log2:[Je,[Je],(l,[n])=>Math.log(n.evaluate(l))/Math.LN2],sin:[Je,[Je],(l,[n])=>Math.sin(n.evaluate(l))],cos:[Je,[Je],(l,[n])=>Math.cos(n.evaluate(l))],tan:[Je,[Je],(l,[n])=>Math.tan(n.evaluate(l))],asin:[Je,[Je],(l,[n])=>Math.asin(n.evaluate(l))],acos:[Je,[Je],(l,[n])=>Math.acos(n.evaluate(l))],atan:[Je,[Je],(l,[n])=>Math.atan(n.evaluate(l))],min:[Je,so(Je),(l,n)=>Math.min(...n.map(p=>p.evaluate(l)))],max:[Je,so(Je),(l,n)=>Math.max(...n.map(p=>p.evaluate(l)))],abs:[Je,[Je],(l,[n])=>Math.abs(n.evaluate(l))],round:[Je,[Je],(l,[n])=>{const p=n.evaluate(l);return p<0?-Math.round(-p):Math.round(p)}],floor:[Je,[Je],(l,[n])=>Math.floor(n.evaluate(l))],ceil:[Je,[Je],(l,[n])=>
748Math.ceil(n.evaluate(l))],"filter-==":[Ot,[qt,Nt],(l,[n,p])=>l.properties()[n.value]===p.value],"filter-id-==":[Ot,[Nt],(l,[n])=>l.id()===n.value],"filter-type-==":[Ot,[qt],(l,[n])=>l.geometryType()===n.value],"filter-<":[Ot,[qt,Nt],(l,[n,p])=>{const _=l.properties()[n.value],b=p.value;return typeof _==typeof b&&_<b}],"filter-id-<":[Ot,[Nt],(l,[n])=>{const p=l.id(),_=n.value;return typeof p==typeof _&&p<_}],"filter->":[Ot,[qt,Nt],(l,[n,p])=>{const _=l.properties()[n.value],b=p.value;return typeof _==typeof b&&_>b}],"filter-id->":[Ot,[Nt],(l,[n])=>{const p=l.id(),_=n.value;return typeof p==typeof _&&p>_}],"filter-<=":[Ot,[qt,Nt],(l,[n,p])=>{const _=l.properties()[n.value],b=p.value;return typeof _==typeof b&&_<=b}],"filter-id-<=":[Ot,[Nt],(l,[n])=>{const p=l.id(),_=n.value;return typeof p==typeof _&&p<=_}],"filter->=":[Ot,[qt,Nt],(l,[n,p])=>{const _=l.properties()[n.value],b=p.value;return typeof _==typeof b&&_>=b}],"filter-id->=":[Ot,[Nt],(l,[n])=>{const p=l.id(),_=n.value;return typeof p==typeof _&&p>=_}],"filter-has":[Ot,[Nt],(l,[n])=>n.value in l.properties()],"filter-has-id":[Ot,[],l=>l.id()!==null&&l.id()!==void 0],"filter-type-in":[Ot,[Ps(qt)],(l,[n])=>n.value.indexOf(l.geometryType())>=0],"filter-id-in":[Ot,[Ps(Nt)],(l,[n])=>n.value.indexOf(l.id())>=0],"filter-in-small":[Ot,[qt,Ps(Nt)],(l,[n,p])=>p.value.indexOf(l.properties()[n.value])>=0],"filter-in-large":[Ot,[qt,Ps(Nt)],(l,[n,p])=>nT(l.properties()[n.value],p.value,0,p.value.length-1)],all:{type:Ot,overloads:[[[Ot,Ot],(l,[n,p])=>n.evaluate(l)&&p.evaluate(l)],[so(Ot),(l,n)=>{for(const p of n)if(!p.evaluate(l))return!1;return!0}]]},any:{type:Ot,overloads:[[[Ot,Ot],(l,[n,p])=>n.evaluate(l)||p.evaluate(l)],[so(Ot),(l,n)=>{for(const p of n)if(p.evaluate(l))return!0;return!1}]]},"!":[Ot,[Ot],(l,[n])=>!n.evaluate(l)],"is-supported-script":[Ot,[qt],(l,[n])=>{const p=l.globals&&l.globals.isSupportedScript;return p?p(n.evaluate(l)):!0}],upcase:[qt,[qt],(l,[n])=>n.evaluate(l).toUpperCase()],downcase:[qt,[qt],(l,[n])=>n.evaluate(l).toLowerCase()],concat:[qt,so(Nt),(l,n)=>n.map(p=>mu(p.evaluate(l))).join("")],"resolved-locale":[qt,[Ap],(l,[n])=>n.evaluate(l).resolvedLocale()]});function aT(l){return Array.isArray(l)?`(${l.map(Ar).join(", ")})`:`(${Ar(l.type)}...)`}function Rf(l){if(l instanceof zp)return Rf(l.boundExpression);if(l instanceof zn&&l.name==="error"||l instanceof Rp||l instanceof go||l instanceof _o)return!1;const n=l instanceof ma||l instanceof Ns;let p=!0;return l.eachChild(_=>{n?p=p&&Rf(_):p=p&&_ instanceof zl}),p?Ov(l)&&Nv(l,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function Ov(l){if(l instanceof zn&&(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"||/^filter-/.test(l.name))||l instanceof go||l instanceof _o)return!1;let n=!0;return l.eachChild(p=>{n&&!Ov(p)&&(n=!1)}),n}function Nv(l,n){if(l instanceof zn&&n.indexOf(l.name)>=0)return!1;let p=!0;return l.eachChild(_=>{p&&!Nv(_,n)&&(p=!1)}),p}function oT(l){return l["property-type"]==="data-driven"||l["property-type"]==="cross-faded-data-driven"}function J_(l){return Array.isArray(l)&&l.length>0&&typeof l[0]=="string"&&l[0]in Bv}const hf=Kw;function Q_(l){var n,p,_,b,M;if(l){if(l.type=="line")return((n=l.paint)==null?void 0:n["line-opacity"])<=.001;if(l.type=="fill")return!(((p=l.paint)==null?void 0:p["fill-opacity"])<=.001);if(l.type=="symbol")return(_=l.layout)!=null&&_["icon-image"]?((b=l.paint)==null?void 0:b["icon-opacity"])<=.001:((M=l.paint)==null?void 0:M["text-opacity"])<=.001}}function ey(l){if(l){let n=0;for(const p in l._vectorTileFeature)typeof l._vectorTileFeature[p]=="number"&&(n+=l._vectorTileFeature[p]);return n}}function lT(l,n){if(!l||!n)return!1;const p=l.id===void 0?ey(l):l.id,_=n.id===void 0?ey(n):n.id;return p===_}function cT(l,n,p){return["case",["boolean",["feature-state",l],!1],typeof n=="object"&&!J_(n)?["literal",n]:n,typeof p=="object"&&!J_(p)?["literal",p]:p]}const ty=["paint","layout"],uT=["select","hover"],hT={maxPitch:75,center:{lng:11.40037,lat:47.26816},zoom:12};let jv=class extends ln.Map{constructor(l){yi.apiKey=(l==null?void 0:l.apiKey)||"",l&&typeof l.locale=="string"&&(yi.locale=l==null?void 0:l.locale),l=Object.assign({style:vv.Terrain.value},hT,l);const n=document.createElement("div");n.classList.add("maptoolkit-map"),n.style.width=n.style.height="100%",super({...l,container:n,attributionControl:!1,maplibreLogo:!1}),yi.pixelRatio=this.getPixelRatio(),this._locale=Object.assign({},nw(),typeof l.locale!="string"?l.locale:null),this._style=void 0,this._states={global:{},feature:{}},this._statesActive={global:{},feature:{}},l.attributionControl!==!1&&this.addControl(new ow(l.attributionControl)),l.logoControl!==!1&&this.addControl(new cw(l.logoControl)),this.on("mousemove",p=>{const _=[[p.point.x-3,p.point.y-3],[p.point.x+3,p.point.y+3]];if("select"in this._states.feature){const b=this._getStateFeature
748("select",_);this._canvasContainer.style.cursor=b?"pointer":""}if("hover"in this._states.feature){const b=this._getStateFeature("hover",_);this._setStateFeature("hover",b,p)}}),this.on("click",p=>{const _=[[p.point.x-3,p.point.y-3],[p.point.x+3,p.point.y+3]],b=this._getStateFeature("select",_);this._setStateFeature("select",b,p)}),l.container&&this.setContainer(l.container)}set selectedFeature(l){this._setStateFeature("select",l||void 0)}get selectedFeature(){return this._statesActive.feature.select}set hoveredFeature(l){this._setStateFeature("hover",l||void 0)}get hoveredFeature(){return this._statesActive.feature.hover}_getStateFeature(l,n){if(l in this._states.global||l in this._states.feature){const p=Object.keys(this._states.global[l]||this._states.feature[l]);return this.queryRenderedFeatures(n,{layers:p}).filter(_=>!Q_(_.layer))[0]}}_setStateFeature(l,n,p){const _={hover:{enable:["mouseover"],disable:["mouseout"]},select:{enable:["select"],disable:["deselect"]}},b=lT(n,this._statesActive.feature[l]);if(this._statesActive.feature[l]&&!b){if(this._statesActive.feature[l].id!==void 0&&this.setFeatureState(this._statesActive.feature[l],{[l]:!1}),p){const M=p;if(M.feature=this._statesActive.feature[l],_[l]&&_[l].disable)for(const x of _[l].disable)this.fire(`feature.${x}`,M)}delete this._statesActive.feature[l]}if(n&&!Q_(n.layer)&&!b&&(n.id!==void 0?this.setFeatureState(n,{[l]:!0}):console.warn(`${n.layer?n.layer.id+": ":""}Feature state '${l}' couldn't be set, source feature must provide an id.`),this._statesActive.feature[l]=n,p)){const M=p;if(M.feature=n,_[l]&&_[l].enable)for(const x of _[l].enable)this.fire(`feature.${x}`,M)}this._applyStates()}_parseStates(){const l=this.style.serialize();if(l){this._truncateStates();for(const n of l.layers){const p=n.metadata;if(p){const _=p["maptoolkit:states"]||p["mtk:states"];if(_)for(const b in _){let M=uT.includes(b)?this._states.feature:this._states.global;M[b]||(M[b]={}),M[b][n.id]=_[b]}}}}}_truncateStates(){this._states={global:{},feature:{}}}_applyStates(){const l=JSON.parse(JSON.stringify(this._style));for(const n in this._states.global)if(this._statesActive.global[n]===!0){for(const p of l.layers)if(p.id in this._states.global[n]){for(const _ in this._states.global[n][p.id])if(_!=="metadata")if(!ty.includes(_))p[_]=this._states.global[n][p.id][_];else{_ in p||(p[_]={});for(const b in this._states.global[n][p.id][_])p[_][b]=this._states.global[n][p.id][_][b]}}}for(const n in this._states.feature)for(let p=0;p<l.layers.length;++p)if(l.layers[p].id in this._states.feature[n])for(const _ of ty)for(const b in this._states.feature[n][l.layers[p].id][_]){const M=oT(hf[`${_}_${l.layers[p].type}`][b]),x=hf[`${_}_${l.layers[p].type}`][b].expression.parameters.includes("feature-state");if(M){if(!x){console.error(`layers[${p}].${l.layers[p].type}.${_}.${b}: doesn't support "feature-state" data expressions.`),delete this._states.feature[n][l.layers[p].id][_][b];continue}}else{console.error(`layers[${p}].${l.layers[p].type}.${_}.${b} doesn't support data expressions and can't use feature states.`),delete this._states.feature[n][l.layers[p].id][_][b];continue}const c=hf[`${_}_${l.layers[p].type}`][b].default,B=l.layers[p][_][b],q=this._states.feature[n][l.layers[p].id][_][b];l.layers[p][_][b]=cT(n,q,B===void 0?c:B)}this.setStyle(l,{},!0),this.redraw()}setContainer(l){if(typeof l=="string"){let n=document.getElementById(l);n?this._parent=n:console.error(`Container with id "${l}" not found.`)}else l instanceof HTMLElement&&(this._parent=l);return this._parent?(this._parent.contains(this._container)||(this._parent.innerHTML=""),this._parent.appendChild(this._container)&&this.resize()):console.error("Invalid type: 'container' must be a String or HTMLElement."),this}remove(){return this._container.remove(),this._parent=void 0,this}getStates(){return this._statesActive.global?Object.keys(this._statesActive.global).filter(l=>this._statesActive.global[l]===!0):[]}setStates(l){if(this._statesActive.global={},Array.isArray(l))for(const n of l)this._statesActive.global[n]=!0;return this.style._loaded&&this._applyStates(),this}setStyle(l,n,p){return p!==!0&&this.fire("style.set",{style:l}),super.setStyle(l,n),p!==!0&&(this._truncateStates(),this._styleId=Pf(typeof l=="string"?l:JSON.stringify(l)),this.once("styledata",()=>{this._parseStates(),this._style=this.style?this.style.serialize():void 0,this._applyStates()})),this}addLayer(l,n){const p=Array.isArray(l)?l:[l];this._lazyInitEmptyStyle();for(const _ of p)this.style.addLayer(_,n);return this._update(!0),this._parseStates(),this._style=this.style?this.style.serialize():void 0,this._applyStates(),this}removeLayer(l){return this.style.removeLayer(l),this._update(!0),this._parseStates(),this._style=this.style?this.style.serialize():void 0,this._applyStates(),this}moveLayer(l,n){return this.style.moveLayer(l,n),this._update(!0),this._parseStates(),this._style=this.style?this.style.serialize():void 0,this._applyStates(),this}_getUIString(l,n){try{const p=super._getUIString(l);return n&&typeof n=="object"?p.replace(/{(.*?)}/g,(_,b)=>b in n?n[b]:_):p}catch(p){return console.warn(p),""}}
748addControl(l,n){return super.addControl(l,n),this}_setupContainer(){super._setupContainer();const l=document.createElement("div");l.classList.add("maplibregl-ctrl-top-center"),this._controlContainer.insertBefore(l,this._controlPositions["top-right"]),this._controlPositions["top-center"]=l;const n=document.createElement("div");n.classList.add("maplibregl-ctrl-bottom-center"),this._controlContainer.insertBefore(n,this._controlPositions["bottom-right"]),this._controlPositions["bottom-center"]=n}};const pT={type:"raster-dem",tiles:["https://vtc-cdn.maptoolkit.net/terrain/{z}/{x}/{y}.webp"],encoding:"mapbox",minzoom:5,maxzoom:12},pf={knobSize:16,sliderSize:52,autoHide:!1};class ry{constructor(n){this.options=Object.assign(pf,n),this._active=!1}getDefaultPosition(){return"bottom-left"}onAdd(n){this._map=n;const p=this.options.knobSize||pf.knobSize||16,_=this.options.sliderSize||pf.sliderSize||52;this._container=document.createElement("div"),this._container.classList.add("maplibregl-ctrl","maptoolkit-ctrl","maptoolkit-ctrl-pitch"),this._container.style.height=`${_}px`;const b=document.createElement("div");b.classList.add("maptoolkit-ctrl-pitch-slide");const M=document.createElement("div");M.classList.add("maptoolkit-ctrl-pitch-knob"),M.title=n._getUIString("PitchControl.ChangePitch"),M.style.width=M.style.height=`${p}px`,M.style.margin=`-${p/2}px calc(50% - ${p/2}px)`;let x=0,c=n.getPitch()/n.getMaxPitch()*(_-p),B=c;this._onMouseDown=Y=>{var ne;return this._active=!0,x=Y instanceof TouchEvent?(ne=Y.touches[0])==null?void 0:ne.pageY:Y.pageY,c=n.getPitch()/n.getMaxPitch()*(_-p),Y.stopPropagation(),Y.preventDefault(),!1},this._onMouseMove=Y=>{var ne;if(this._active){let ge=x-(Y instanceof TouchEvent?(ne=Y.touches[0])==null?void 0:ne.pageY:Y.pageY);B=Math.max(0,Math.min(_-p,c+ge)),n.setPitch(B/(_-p)*n.getMaxPitch())}},this._onMouseUp=()=>{this._active=!1,c=B},M.addEventListener("mousedown",this._onMouseDown),M.addEventListener("touchstart",this._onMouseDown),window.addEventListener("mousemove",this._onMouseMove),window.addEventListener("touchmove",this._onMouseMove),window.addEventListener("mouseup",this._onMouseUp),window.addEventListener("touchend",this._onMouseUp);let q;return this._onPitch=()=>{M.style.top=_-n.getPitch()/n.getMaxPitch()*_+"px",clearTimeout(q),this.options.autoHide&&(this.isHidden()&&n.transform.pitch>0?this.show():!this.isHidden()&&n.transform.pitch===0&&(q=setTimeout(()=>this.hide(),400)))},n.on("pitch",this._onPitch),this._onPitch({}),this._container.appendChild(b),this._container.appendChild(M),this._container}onRemove(){var n;this._onMouseUp&&(window.removeEventListener("mousedown",this._onMouseUp),window.removeEventListener("touchstart",this._onMouseUp)),this._onMouseMove&&(window.removeEventListener("mousemove",this._onMouseMove),window.removeEventListener("touchmove",this._onMouseMove)),this._onMouseUp&&(window.removeEventListener("mouseup",this._onMouseUp),window.removeEventListener("touchend",this._onMouseUp)),this._map&&this._onPitch&&this._map.off("pitch",this._onPitch),(n=this._container)!=null&&n.parentNode&&this._container.parentNode.removeChild(this._container),this._map=void 0}isActive(){return this._active}isHidden(){return this._container?this._container.classList.contains("maptoolkit-ctrl-pitch-hide"):!0}show(){return this._container&&(this._container.style.height=`${this.options.sliderSize}px`,this._container.classList.remove("maptoolkit-ctrl-pitch-hide")),this}hide(){return this._container&&(this._container.style.height="0px",this._container.classList.add("maptoolkit-ctrl-pitch-hide")),this}}const dT={};class iy{constructor(n){this.options=Object.assign(dT,n)}getDefaultPosition(){return"bottom-left"}onAdd(n){this._map=n,this._container=document.createElement("div"),this._container.classList.add("maplibregl-ctrl","maptoolkit-ctrl","maptoolkit-ctrl-compass");const p=document.createElement("div");p.classList.add("maptoolkit-ctrl-compass-img");const _=document.createElement("div");_.classList.add("maptoolkit-ctrl-compass-label"),_.title=n._getUIString("CompassControl.ResetBearing"),_.addEventListener("click",()=>n.resetNorth());let b=document.createElement("div");b.classList.add("maptoolkit-ctrl-compass-arrow-left"),b.title=n._getUIString("CompassControl.RotateLeft"),b.addEventListener("click",()=>n.easeTo({bearing:n.getBearing()+90}));let M=document.createElement("div");return M.classList.add("maptoolkit-ctrl-compass-arrow-right"),M.title=n._getUIString("CompassControl.RotateRight"),M.addEventListener("click",()=>n.easeTo({bearing:n.getBearing()-90})),this._onRotate=()=>{let x=(n.transform.bearing+360)%360;p.style.transform=`rotate(${x*-1}deg)`,x<0&&(x+=360),x>315||x<=45?_.innerText="N":x>45&&x<=135?_.innerText="E":x>135&&x<=225?_.innerText="S":x>225&&x<=315&&(_.innerText="W")},n.on("rotate",this._onRotate),this._onRotate({}),this._container.appendChild(p),this._container.appendChild(b),this._container.appendChild(_),this._container.appendChild(M),this._container}onRemove(){var n;this._map&&this._onRotate&&this._map.off("rotate",this._onRotate),(n=this._container)!=null&&n.parentNode&&this._container.parentNode.removeChild(this._container),this._map=void 0}}const fT={pitch:60};class sy{constructor(n){this.options=Object.assign(fT,n),this._active=!1,this._enabled=!1,this._loaded=!1}getDefaultPosition(){return"bottom-left"}onAdd(n){this._map=n,this._container=document.createElement("div"),this._container.classList.add("maplibregl-ctrl","maplibregl-ctrl-group","maptoolkit-ctrl","maptoolkit-ctrl-terrain");const p=document.createElement("button");p.title=n._getUIString("TerrainControl.ToggleTilt"),p.addEventListener("click",()=>{this._active||(this._enabled?this.disable():this.enable())}),this._container.appendChild(p);function _(){p.innerText=n.transform.pitch>0?"2D":"3D"}return _(),this._onPitch=b=>{this._active||(this._active=!0),n.transform.pitch>0&&!this._enabled?(_(),b.originalEvent instanceof MouseEvent?(this._terrain(!0),this._loaded=!0):this._loaded?this._terrain(!0):n.once("pitchend",()=>{this._terrain(!0),this._loaded=!0}),this._enabled=!0):n.transform.pitch==0&&this._enabled&&(_(),this._terrain(!1),this._enabled=!1)},this._onPitchEnd=()=>{this._active=!1},n.on("pitch",this._onPitch),n.on("pitchend",this._onPitchEnd),this._onPitch({}),this._onPitchEnd({}),this._container}onRemove(){var n;this.disable(),this._map&&(this._onPitch&&this._map.off("pitch",this._onPitch),this._onPitchEnd&&this._map.off("pitchend",this._onPitchEnd)),(n=this._container)!=null&&n.parentNode&&this._container.parentNode.removeChild(this._container),this._map=void 0}_terrain(n){this._map&&(this._map.style._loaded?n===!0?(this._map.getSource("maptoolkit-terrain")||this._map.addSource("maptoolkit-terrain",pT),this._map.setTerrain({source:"maptoolkit-terrain"})):this._map.setTerrain(null):this._map.once("styledata",()=>this._terrain(n)))}enable(){return this._map&&!this._enabled&&this._map.transform.pitch===0&&this._map.easeTo({pitch:this.options.pitch}),this}disable(){return this._map&&this._enabled&&this._map.transform.pitch>0&&this._map.easeTo({pitch:0}),this}isEnabled(){return this._enabled}isActive(){return this._active}isLoaded(){return this._loaded}}const mT={navigationControl:{showCompass:!1},pitchControl:{autoHide:!0}};class gT{constructor(n){this.options=Object.assign(mT,n),this._navigationControl
748=new ln.NavigationControl(this.options.navigationControl),this.options.terrainControl!==!1&&(this._terrainControl=new sy(this.options.terrainControl)),this.options.pitchControl!==!1&&(this._pitchControl=new ry(this.options.pitchControl)),this.options.compassControl!==!1&&(this._compassControl=new iy(this.options.compassControl))}getDefaultPosition(){return"bottom-right"}onAdd(n){return this._container=document.createElement("div"),this._container.appendChild(this._navigationControl.onAdd(n)),this._compassControl instanceof iy&&this._container.appendChild(this._compassControl.onAdd(n)),this._pitchControl instanceof ry&&this._container.appendChild(this._pitchControl.onAdd(n)),this._terrainControl instanceof sy&&this._container.appendChild(this._terrainControl.onAdd(n)),this._container}onRemove(){var n;(n=this._container)!=null&&n.parentNode&&this._container.parentNode.removeChild(this._container),this._map=void 0}}const _T={};class yT{constructor(n){if(this.options=Object.assign({},_T,{styles:vv.toArray()},n),this.options.styles){this.options.styles=this.options.styles.filter(p=>p.id&&p.value&&typeof p.value=="object"||typeof p.value=="string");for(const p of this.options.styles)if(!p.image&&typeof p.value=="string"&&/^maptoolkit:\/\/style\/[A-z0-9_-]+\/[A-z0-9_-]+$/.test(p.value)){const[_,b]=p.value.split("/").slice(-2);p.image=ao(_,b)}}}getDefaultPosition(){return"bottom-left"}onAdd(n){this._map=n,this._container=document.createElement("div"),this._container.classList.add("maplibregl-ctrl","maplibregl-ctrl-group","maptoolkit-ctrl","maptoolkit-ctrl-style","maptoolkit-ctrl-style-bottom-left"),this._groups=document.createElement("div"),this._groups.classList.add("maplibregl-ctrl-group","maptoolkit-ctrl-style-groups");const p=document.createElement("button");p.classList.add("maptoolkit-ctrl-style-close"),p.addEventListener("click",()=>this.close()),this._groups.appendChild(p);const _=document.createElement("button");_.classList.add("maptoolkit-ctrl-style-current");const b=document.createElement("div");b.classList.add("maptoolkit-ctrl-style-current-image"),_.appendChild(b);const M=document.createElement("label");M.classList.add("maptoolkit-ctrl-style-current-name"),_.appendChild(M);const x=(({id:B,styles:q,onClick:Y,isCollapsed:ne})=>{const ge=document.createElement("div");ge.classList.add("maptoolkit-ctrl-style-group"),ne&&ge.classList.add("maptoolkit-ctrl-style-group-collapsed");const Q=document.createElement("h2");Q.classList.add("maptoolkit-ctrl-style-group-name"),Q.textContent=n._getUIString(`StyleControl.Group.${B}`)||B,ge.appendChild(Q);const Se=document.createElement("ul");return Se.classList.add("maptoolkit-ctrl-style-group-list"),q.forEach(rt=>{const St=document.createElement("li");St.classList.add("maptoolkit-ctrl-style-group-list-item"),this._map&&this._map._styleId===Pf(typeof rt.value=="string"?rt.value:JSON.stringify(rt.value))&&(St.classList.add("maptoolkit-ctrl-style-group-list-item-active"),rt.image&&b.style.setProperty("background-image",`url(${rt.image})`),M.textContent=n._getUIString(`StyleControl.Style.${rt.id}`)||rt.id);const vt=document.createElement("button"),bt=document.createElement("div");bt.classList.add("maptoolkit-ctrl-style-group-list-item-image"),rt.image&&bt.style.setProperty("background-image",`url(${rt.image})`),vt.appendChild(bt);const Pt=document.createElement("label");Pt.classList.add("maptoolkit-ctrl-style-group-list-item-name"),Pt.textContent=n._getUIString(`StyleControl.Style.${rt.id}`)||rt.id,vt.appendChild(Pt),vt.addEventListener("click",nt=>{typeof Y=="function"&&Y({originalEvent:nt,style:rt})}),St.appendChild(vt),Se.appendChild(St)}),ge.appendChild(Se),ge})({id:"Styles",styles:this.options.styles,onClick:B=>{const q=B.originalEvent.target.closest("ul"),Y=B.originalEvent.target.parentElement;[...q.children].forEach(ne=>{ne===Y?ne.classList.add("maptoolkit-ctrl-style-group-list-item-active"):ne.classList.remove("maptoolkit-ctrl-style-group-list-item-active")}),B.style&&(this._map&&B.style.value&&this._map._styleId!==Pf(typeof B.style.value=="string"?B.style.value:JSON.stringify(B.style.value))&&this._map.setStyle(B.style.value),b.style.removeProperty("background-image"),B.style.image&&b.style.setProperty("background-image",`url(${B.style.image})`),M.textContent=n._getUIString(`StyleControl.Style.${B.style.id}`)||B.style.id)}});this._groups.appendChild(x);const c=document.createElement("button");return c.classList.add("maptoolkit-ctrl-style-expand"),c.textContent=n._getUIString("StyleControl.Group.Layers"),c.addEventListener("click",()=>{x.classList.remove("maptoolkit-ctrl-style-group-collapsed"),this._resize&&this._resize()}),this._groups.appendChild(c),_.addEventListener("click",()=>{var B;(B=this._groups)!=null&&B.classList.contains("maptoolkit-ctrl-style-groups-active")?this.close():this.open()}),this._resize(),this._map.on("resize",this._resize.bind(this)),this._container.appendChild(_),this._container.appendChild(this._groups),this._container}onRemove(){var n;(n=this._container)!=null&&n.parentNode&&this._container.parentNode.removeChild(this._container),this._map=void 0}open(){if(this._groups){const n=[...this._groups.querySelectorAll(".maptoolkit-ctrl-style-group")];for(const p of n)p.querySelectorAll(".maptoolkit-ctrl-style-group-list-item-active").length||p.classList.add("maptoolkit-ctrl-style-group-collapsed");this._groups.classList.add("maptoolkit-ctrl-style-groups-active"),this._container&&this._container.parentElement&&(this._container.parentElement.style.zIndex="99"),this._resize&&this._resize()}}close(){this._groups&&(this._groups.classList.remove("maptoolkit-ctrl-style-groups-active"),this._container&&this._container.parentElement&&(this._container.parentElement.style.zIndex=""))}_resize(){if(this._map&&this._container){const n=this._map.getContainer().getBoundingClientRect(),p=this._container.getBoundingClientRect(),_={top:p.top-n.top,bottom:n.bottom-p.bottom,left:p.left-n.left,right:n.right-p.right},b=window.getComputedStyle(this._container);let M=n.width,x=n.height;for(const c in this._map._controlPositions)if(this._map._controlPositions[c].contains(this._container)){/^top/.test(c)&&(x-=_.top+parseFloat(b.marginTop)),/^bottom/.test(c)&&(x-=_.bottom+parseFloat(b.marginBottom)),/left$/.test(c)&&(M-=_.left+parseFloat(b.marginLeft)),/right$/.test(c)&&(M-=_.right+parseFloat(b.marginRight));break}window.matchMedia("only screen and (max-width: 768px)").matches||(M-=p.width),this._groups&&(this._groups.style.setProperty("max-width",`${M}px`),this._groups.style.setProperty("max-height",`${x}px`))}}}const vT={range:10,type:"foot",fitBounds:!0};class xT{constructor(n){this.options=Object.assign({},vT,n),this._id=`maptoolkit-ctrl-isochrone-${Math.random().toString(36).substring(2,9)}`,this._dragging=!1,this._container=document.createElement("div"),this._container.classList.add("maplibregl-ctrl","maplibregl-ctrl-group","maptoolkit-ctrl","maptoolkit-ctrl-isochrone");const p=document.createElement("div");p.classList.add("maptoolkit-ctrl-isochrone-chronee",`maptoolkit-ctrl-isochrone-chronee-${this.options.type}`),p.setAttribute("draggable","true"),p.addEventListener("dragstart",M=>{const x=M;x.dataTransfer&&(x.dataTransfer.setData("dragged","true"),x.dataTransfer.setData("maptoolkit-ctrl-isochrone",this._id)),this._dragging=!0}),p.addEventListener("dragend",()=>{this._dragging=!1});const _=document.createElement("button");_.classList.add("maptoolkit-ctrl-isochrone-chronee-remove"),_.addEventListener("click",()=>{this.removeFromMap()});const b=this._tooltip=document.createElement("div");this._tooltip.classList.add("maplibregl-ctrl-group","maptoolkit-ctrl-isochrone-tooltip"),this._container.appendChild(_),this._container.appendChild(p),this._container.appendChild(b),this._onDrag=M=>{M.preventDefault()},this._onDrop=M=>{var x;if(M.preventDefault(),this._map&&this._container){const c=M;if(((x=c.dataTransfer)==null?void 0:x.getData("maptoolkit-ctrl-isochrone"))===this._id){const B=this._map.unproject({x:c.offsetX,y:c.offsetY});this.addToMap(B)}}},this._onStyleChange=()=>{this._map&&this._map.once("idle",()=>{this._marker&&this._marker._map===this._map&&this._addPolygon(this._marker.getLngLat())})}}getDefaultPosition(){return"bottom-right"}onAdd(n){this._map instanceof jv&&this._map!==n&&this.onRemove(),this._map=n;try{this.options.range&&(this._tooltip.innerText=n._getUIString(`IsochroneControl.Tooltip.${this.options.type}`,{range:this.options.range.toString()}))}catch(_){this._tooltip.remove(),console.warn(_)}const p=n.getCanvas();return p.addEventListener("dragover",this._onDrag),p.addEventListener("dragenter",this._onDrag),p.addEventListener("dragleave",this._onDrag),p.addEventListener("drop",this._onDrop),n.on("style.set",this._onStyleChange),this._container}addToMap(n){this._addMarker(n),this._addPolygon(n),this._container&&this._container.classList.add("maptoolkit-ctrl-isochrone-active")}removeFromMap(){this._removeMarker(),this._removePolygon(),this._container&&this._container.classList.remove("maptoolkit-ctrl-isochrone-active")}_addMarker(n){if(this._map&&(this._removeMarker(),n)){const p=document.createElement("div"),_=document.createElement("div");_.classList.add("maptoolkit-ctrl-isochrone-chronee",`maptoolkit-ctrl-isochrone-chronee-${this.options.type}`);const b=document.createElement("button");b.classList.add("maptoolkit-ctrl-isochrone-chronee-remove"),b.addEventListener("click",()=>{this.removeFromMap()}),p.appendChild(b),p.appendChild(_),this._marker=new ln.Marker({element:p,anchor:"center",draggable:!0}),this._marker.on("dragend",M=>this._addPolygon(M.target.getLngLat())),this._marker.on("click",M=>M.preventDefault()),this._marker.setLngLat(n).addTo(this._map)}}_removeMarker(){this._marker&&this._marker.remove()}_addPolygon(n){if(this._removePolygon(),yi.apiKey&&this._map&&n){const p=this._map,_=new URL("isochrone",yi.routingHost);_.pathname="isochrone",_.searchParams.set("api_key",yi.apiKey.toString()),this.options.type&&_.searchParams.set("routeType",this.options.type),this.options.range&&_.searchParams.set("time",this.options.range.toString());const b=Array.isArray(n)?[n[1],n[0]]:"lat"in n?[n.lat,"lon"in n?n.lon:n.lng]:void 0;b&&(_.searchParams.set("point",b.join(",")),this._abortController&&this._abortController.abort(),this._abortController=new AbortController,fetch(_.toString(),{signal:this._abortController.signal}).then(M=>M.json()).then(M=>{this._removePolygon();const x=[M.map(c=>[c[1],c[0]])];if(p.addSource(this._id,{type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:x}}]}}
748),p.addLayer({id:this._id+"-fill",type:"fill",source:this._id,paint:{"fill-color":"#aaaafa","fill-opacity":.2}}),p.addLayer({id:this._id+"-line",type:"line",source:this._id,paint:{"line-color":"#aaaafa","line-opacity":.8,"line-width":1.4}}),this.options.fitBounds){const c=new ln.LngLatBounds,B=Object.assign({padding:100},this.options.fitBounds);x.forEach(q=>q.forEach(Y=>c.extend(Y))),p.fitBounds(c,B)}}).catch(M=>{M.name!=="AbortError"&&console.error(M)}))}}_removePolygon(){this._map&&this._container&&(this._map.getLayer(this._id+"-fill")&&this._map.removeLayer(this._id+"-fill"),this._map.getLayer(this._id+"-line")&&this._map.removeLayer(this._id+"-line"),this._map.getSource(this._id)&&this._map.removeSource(this._id))}onRemove(){var n;if(this.removeFromMap(),this._map){const p=this._map.getCanvas();p.removeEventListener("dragover",this._onDrag),p.removeEventListener("dragenter",this._onDrag),p.removeEventListener("dragleave",this._onDrag),p.removeEventListener("drop",this._onDrop),this._map.off("style.set",this._onStyleChange)}(n=this._container)!=null&&n.parentNode&&this._container.parentNode.removeChild(this._container),this._map=void 0}}const Lp=K1("store",()=>{const l={},n="",p=wi(null),_=wi(null),b=wi(null),M=wi(null),x=wi(null),c=wi(null),B=wi(null),q=wi(null);return{mapOptions:l,mapSprite:n,administrativeSource:p,fahrradwienSource:_,administrativeLayer:b,fahrradwienLayers:M,statusFilter:x,yearFilter:c,hoveredFeature:B,selectedFeature:q}}),bT={class:"maptoolkit-v-map"},wT={class:"maptoolkit-v-map-overlay"},TT={class:"maptoolkit-v-map-header"},ST={class:"maptoolkit-v-map-controls"},MT={class:"maptoolkit-v-map-controls-top"},PT={class:"maptoolkit-v-map-controls-top-left"},IT={class:"maptoolkit-v-map-controls-top-right"},CT={class:"maptoolkit-v-map-controls-bottom"},ET={class:"maptoolkit-v-map-controls-bottom-left"},AT={class:"maptoolkit-v-map-controls-bottom-right"},kT=Rl({__name:"Map",props:{options:{},sprite:{}},emits:["ready","styleLoad","styleSet","featureSelect","featureDeselect","featureMouseover","featureMouseout"],setup(l,{expose:n,emit:p}){const _=Lp(),b=wi(null),M=new jv(Object.assign({},l.options)),x=p;Gy("map",M),n({map:M}),M.once("style.load",q=>{c(),B(),x("ready",q)}),M.on("style.set",q=>{M.once("styledata",()=>{c(),B()}),x("styleSet",q)}),M.on("style.load",q=>x("styleLoad",q)),M.on("feature.select",q=>x("featureSelect",q)),M.on("feature.deselect",q=>x("featureDeselect",q)),M.on("feature.mouseover",q=>x("featureMouseover",q)),M.on("feature.mouseout",q=>x("featureMouseout",q)),typeof l.sprite=="string"&&M.once("styledata",()=>M.setSprite(l.sprite)),$s(()=>l.sprite,q=>{typeof q=="string"&&M.setSprite(q)});function c(){_.administrativeSource&&_.administrativeLayer&&(M.addSource("wien__administrative",_.administrativeSource),M.addLayer(_.administrativeLayer))}function B(){if(_.fahrradwienSource&&_.fahrradwienLayers){for(const Y of _.fahrradwienLayers)M.getLayer(Y.id)&&M.removeLayer(Y.id);M.getSource("wien__fahrradwien")&&M.removeSource("wien__fahrradwien"),M.addSource("wien__fahrradwien",_.fahrradwienSource);const q=M.getStyle().layers.filter(Y=>Y.type==="symbol")[0].id;for(const Y of _.fahrradwienLayers)M.addLayer(Y,Y.type!=="symbol"?q:void 0)}}return $s(()=>_.fahrradwienSource,()=>{try{B()}catch{M.once("styledata",()=>B())}},{deep:!0}),Mu(()=>{b.value&&M.setContainer(b.value)}),(q,Y)=>(zi(),Ms("div",bT,[xt("div",{class:"maptoolkit-v-map-container",ref_key:"container",ref:b},null,512),xt("div",wT,[Y[0]||(Y[0]=xt("div",{class:"maptoolkit-v-map-sidebar"},null,-1)),xt("div",TT,[nu(q.$slots,"header")]),xt("div",ST,[xt("div",MT,[xt("div",PT,[nu(q.$slots,"controls-top-left")]),xt("div",IT,[nu(q.$slots,"controls-top-right")])]),xt("div",CT,[xt("div",ET,[nu(q.$slots,"controls-bottom-left")]),xt("div",AT,[nu(q.$slots,"controls-bottom-right")])])])])]))}}),zT={class:"maptoolkit-v-info"},RT={class:"maptoolkit-v-info-header"},DT=["src"],LT={class:"maptoolkit-v-info-image-buttons"},FT=["disabled"],BT=["disabled"],OT={key:0,class:"maptoolkit-v-info-image-caption"},NT={class:"maptoolkit-v-info-title"},jT={class:"maptoolkit-v-info-subtitle"},VT={class:"maptoolkit-v-info-stats"},$T={key:1,class:"maptoolkit-v-info-text"},UT=["href","title","target"],ZT=Rl({__name:"InfoSidebar",props:{feature:{}},emits:["close"],setup(l,{emit:n}){let p=[],_=null;const b=wi(0);$s(()=>l.feature,()=>{b.value=0;try{p=JSON.parse(l.feature.properties.images)}catch{p=[]}try{_=JSON.parse(l.feature.properties.link)}catch{}},{immediate:!0});const M={in_preparation:"in Vorbereitung",under_construction:"in Bau",completed:"Fertiggestellt"},x=n;return(c,B)=>(zi(),Ms("div",zT,[xt("div",RT,[xt("button",{class:"maptoolkit-v-info-close",onClick:B[0]||(B[0]=q=>x("close"))})]),Cr(p)[b.value]?(zi(),Ms(is,{key:0},[xt("img",{class:"maptoolkit-v-info-image",src:Cr(p)[b.value].src},null,8,DT),xt("div",LT,[Cr(p).length>1?(zi(),Ms(is,{key:0},[xt("button",{disabled:b.value<=0,class:"maptoolkit-v-info-image-button-previous",onClick:B[1]||(B[
7481]=q=>b.value--)},B[3]||(B[3]=[xt("span",{class:"sr-only"},"Zurück",-1)]),8,FT),xt("button",{disabled:b.value>=Cr(p).length-1,class:"maptoolkit-v-info-image-button-after",onClick:B[2]||(B[2]=q=>b.value++)},B[4]||(B[4]=[xt("span",{class:"sr-only"},"Nächster",-1)]),8,BT)],64)):wl("",!0)]),Cr(p)[b.value].caption?(zi(),Ms("figcaption",OT,Qs(Cr(p)[b.value].caption),1)):wl("",!0)],64)):wl("",!0),xt("h2",NT,Qs(c.feature.properties.title),1),xt("h3",jT,Qs(c.feature.properties.short_text),1),xt("div",{class:co(["maptoolkit-v-info-status",c.feature.properties.status])},Qs(M[c.feature.properties.status]||c.feature.properties.status),3),xt("div",VT,[xt("div",null,[B[5]||(B[5]=xt("b",null,"Bezirk(e):",-1)),oo(" "+Qs(c.feature.properties.districts),1)]),xt("div",null,[B[6]||(B[6]=xt("b",null,"Jahr:",-1)),oo(" "+Qs(c.feature.properties.year_of_construction),1)]),xt("div",null,[B[7]||(B[7]=xt("b",null,"Länge:",-1)),oo(" "+Qs(c.feature.properties.length)+" m",1)])]),c.feature.properties.long_text?(zi(),Ms("div",$T,[oo(Qs(c.feature.properties.long_text)+" ",1),Cr(_)?(zi(),Ms("a",{key:0,href:Cr(_).url,title:Cr(_).title,target:Cr(_).target},Qs(Cr(_).title),9,UT)):wl("",!0)])):wl("",!0)]))}}),Fl=(l,n)=>{const p=l.__vccOpts||l;for(const[_,b]of n)p[_]=b;return p},qT=Fl(ZT,[["__scopeId","data-v-34543bf7"]]),GT={class:"maptoolkit-v-filter-control"},HT={class:"maptoolkit-v-filter-control-status"},WT={class:"maptoolkit-v-filter-control-year"},XT=["value"],YT=Rl({__name:"FilterControl",emits:["change"],setup(l,{emit:n}){const p=n,_=Lp(),b=wi(null);function M(){b.value&&(p("change"),_.yearFilter=b.value.value)}function x(B){_.statusFilter&&(p("change"),_.statusFilter.includes(B)?_.statusFilter.splice(_.statusFilter.indexOf(B),1):_.statusFilter.push(B))}function c(){if(_.fahrradwienSource&&_.statusFilter){const B=["all"],q=["any"];if(_.statusFilter.includes("in_preparation")&&q.push(["==","status","in_preparation"]),_.statusFilter.includes("under_construction")&&q.push(["==","status","under_construction"]),_.statusFilter.includes("completed")&&q.push(["==","status","completed"]),q.length===1&&q.push(["==","status",""]),B.push(q),_.yearFilter&&B.push(["==","year_of_construction",_.yearFilter]),_.fahrradwienSource.url){const Y=new URL(_.fahrradwienSource.url);Y.searchParams.set("filter",JSON.stringify(B)),_.fahrradwienSource.url=Y.toString()}}}return $s(()=>_.yearFilter,()=>{c()}),$s(()=>_.statusFilter,()=>{c()},{deep:!0}),Mu(()=>{c()}),(B,q)=>{var Y,ne,ge;return zi(),Ms("div",GT,[xt("div",HT,[xt("button",{onClick:q[0]||(q[0]=Q=>x("completed")),class:co(["completed",{"mapoolkit-v-active":(Y=Cr(_).statusFilter)==null?void 0:Y.includes("completed")}])},"Fertiggestellt",2),xt("button",{onClick:q[1]||(q[1]=Q=>x("under_construction")),class:co(["under_construction",{"mapoolkit-v-active":(ne=Cr(_).statusFilter)==null?void 0:ne.includes("under_construction")}])},"In Bau",2),xt("button",{onClick:q[2]||(q[2]=Q=>x("in_preparation")),class:co(["in_preparation",{"mapoolkit-v-active":(ge=Cr(_).statusFilter)==null?void 0:ge.includes("in_preparation")}])},"In Vorbereitung",2)]),xt("div",WT,[xt("select",{ref_key:"yearSelect",ref:b,onChange:M,value:Cr(_).yearFilter},q[3]||(q[3]=[l1('<option value="2027" data-v-4193230a>2027</option><option value="2026" data-v-4193230a>2026</option><option value="2025" data-v-4193230a>2025</option><option value="2024" data-v-4193230a>2024</option><option value="2023" data-v-4193230a>2023</option><option value="2022" data-v-4193230a>2022</option><option value="2021" data-v-4193230a>2021</option><option value="" data-v-4193230a>Alle Jahre</option>',8)]),40,XT)])])}}}),KT=Fl(YT,[["__scopeId","data-v-4193230a"]]),JT=""+new URL("logo-MnQvbuyx.png",import.meta.url).href,QT={},eS={class:"maptoolkit-v-logo-control"};function tS(l,n){return zi(),Ms("div",eS,n[0]||(n[0]=[xt("a",{href:"https://www.mobilitaetsagentur.at/"},[xt("img",{src:JT,alt:"Fahrrad Wien"})],-1)]))}const rS=Fl(QT,[["render",tS],["__scopeId","data-v-e2ee56e5"]]),iS={class:"maptoolkit-v-header"},sS={class:"maptoolkit-v-header-left"},nS=Rl({__name:"Header",setup(l){const n=wi(window.innerWidth<720),p=()=>{n.value=window.innerWidth<720};return Mu(()=>{window.addEventListener("resize",p)}),Vy(()=>{window.removeEventListener("resize",p)}),(_,b)=>(zi(),Ms("div",iS,[b[0]||(b[0]=xt("div",{class:"maptoolkit-v-header-left"},[xt("h1",null,"Die große Wiener Radwegoffensive"),xt("a",{href:"https://www.fahrradwien.at",target:"_blank"},"zu Fahrrad Wien")],-1)),xt("div",sS,[Ti(rS)])]))}}),aS=Fl(nS,[["__scopeId","data-v-6430b136"]]),oS={class:"popover-container"},lS=Rl({__name:"InfoMap",setup(l){const n=wi(null),p=wi(null),_=()=>{var M,x;p.value&&(p.value.open?(p.value.close(),(M=n.value)==null||M.classList.remove("open")):((x=n.value)==null||x.classList.add("open"),window.innerWidth<550?p.value.showModal():p.value.show()))},b=()=>{p.value&&p.value.open&&(window.innerWidth<550?(p.value.close(),p.value.showModal()):(p.value.close(),p.value.show()))};return Mu(()=>{window.addEventListener("resize",b)}),Yf(()=>{window.removeEventListener("resize",b)}),(M,x)=>(zi(),Ms("div",oS,[xt("button",{ref_key:"buttonRef",ref:n,class:"info-button",onClick:_},x[0]||(x[0]=[xt("i",{class:"icon"},"i",-1)]),512),xt("dialog",{class:"popover",ref_key:"popoverRef",ref:p},[xt("div",{class:"inner"},[xt("button",{class:"close",onClick:_},x[1]||(x[1]=[xt("span",{class:"sr-only"},"Schließen",-1)])),x[2]||(x[2]=xt("p",null,[oo(" Hier finden Sie "),xt("a",{href:"https://www.fahrradwien.at/infos-zur-projektkarte",target:"_blank"},"Nutzungshinweise zur Karte"),oo(". ")],-1))])],512)]))}}),cS=Fl(lS,[["__scopeId","data-v-bb3fc9d2"]]),uS=""+new URL("fahrrad-CfNGxpbY.png",import.meta.url).href,hS={class:"maptoolkit-app"},pS=Rl({__name:"App",setup(l){const n=Lp(),p=wi(null),_=new xT({type:"bike",fitBounds:{padding:120}});$s(()=>n.selectedFeature,Y=>{var ne;(ne=p.value)!=null&&ne.map&&(p.value.map.setPadding({right:Y?420:0}),_.options.fitBounds={padding:Y?{top:120,left:120,bottom:120,right:-300}:120})},{deep:!0}),$s(()=>n.selectedFeature,()=>{x()},{deep:!0});function b(Y,ne){const ge=new URL(yi.staticmapHost);return ge.searchParams.set("api_key",yi.apiKey),ge.searchParams.set("maptype",`${Y}-${ne}`),ge.searchParams.set("size","166x166"),ge.searchParams.set("center","48.2075,16.3747"),ge.searchParams.set("zoom","13"),ge.toString()}function M(){return Object.fromEntries(window.location.hash.slice(1).split("&").map(Y=>Y.split("=")))}function x(){var ne;const Y=M();(ne=n.selectedFeature)!=null&&ne.id?Y.feature=n.selectedFeature.i
748d.toString():delete Y.feature,window.location.hash="#"+Object.entries(Y).map(ge=>ge.join("=")).join("&")}function c(){const Y=M();Y.feature?fetch(`https://dataconnector.maptoolkit.net/wien/fahrradwien/${Y.feature}.geojson?api_key=${yi.apiKey}`).then(ne=>ne.json()).then(ne=>{ne.source="wien__fahrradwien",ne.sourceLayer="fahrradwien",n.selectedFeature=ne,p.value.map.selectedFeature=ne}):q()}function B(Y){const ne=Y.target;Object.assign(ne._locale,{"StyleControl.Group.Styles":"Kartografie","StyleControl.Style.Wien":"Wien","StyleControl.Style.Fahrrad":"Fahrrad"});const ge={terrainControl:!1,pitchControl:!1,compassControl:!1,navigationControl:{showCompass:!0}};ne.addControl(new gT(ge),"bottom-right"),ne.addControl(_,"bottom-right"),ne.addControl(new yT({styles:[{id:"Wien",value:"maptoolkit://styles/wien/fahrradwien",image:b("wien","fahrradwien")},{id:"Fahrrad",value:"maptoolkit://styles/wien/fahrradwien?states=fahrrad",image:uS},{id:"Satellite",value:"maptoolkit://styles/wien/stare_satellite_v1",image:b("wien","stare_satellite_v1")}]}),"bottom-left"),c(),window.addEventListener("hashchange",()=>{c()})}function q(){n.selectedFeature=null,p.value.map.selectedFeature=null}return(Y,ne)=>{const ge=Ib("Popup");return zi(),Ms("main",hS,[Cr(n).selectedFeature?(zi(),cp(qT,{key:0,class:"maptoolkit-app-sidebar",feature:Cr(n).selectedFeature,onClose:q},null,8,["feature"])):wl("",!0),Ti(kT,{class:"maptoolkit-app-map",ref_key:"maptoolkitMap",ref:p,options:Cr(n).mapOptions,sprite:Cr(n).mapSprite,onReady:B,onFeatureSelect:ne[0]||(ne[0]=Q=>Cr(n).selectedFeature=Q.feature),onFeatureDeselect:ne[1]||(ne[1]=Q=>Cr(n).selectedFeature=null)},{header:Qh(()=>[Ti(aS)]),"controls-top-left":Qh(()=>[Ti(KT,{"active-status":Cr(n).statusFilter,"active-year":Cr(n).yearFilter,onChange:q},null,8,["active-status","active-year"])]),"controls-top-right":Qh(()=>[Ti(cS)]),_:1},8,["options","sprite"]),Ti(ge)])}}}),dS=Fl(pS,[["__scopeId","data-v-423719dc"]]),fS={type:"vector",url:"maptoolkit://dataconnector/toursprung/administrative?query=ids%3D109166%26inverted%3D1"},mS={type:"vector",url:"maptoolkit://dataconnector/wien/fahrradwien"},gS={id:"wien__administrative",source:"wien__administrative","source-layer":"administrative",type:"fill",layout:{},paint:{"fill-color":"#aaa","fill-opacity":.4}},_S=[{id:"wien__fahrradwien__line_0",source:"wien__fahrradwien","source-layer":"fahrradwien",type:"line",layout:{"line-cap":"round"},paint:{"line-color":["case",["==",["get","status"],"completed"],"#90C525",["==",["get","status"],"under_construction"],"#FFA901",["==",["get","status"],"in_preparation"],"#00AED8","#FFFFFF"],"line-width":["interpolate",["linear"],["zoom"],12,["case",["==",["feature-state","select"],!0],8,6],22,["case",["==",["feature-state","select"],!0],28,26]]},metadata:{"maptoolkit:states":{select:{},hover:{}}}},{id:"wien__fahrradwien__line_1",source:"wien__fahrradwien","source-layer":"fahrradwien",type:"line",layout:{"line-cap":"round"},paint:{"line-color":["case",["==",["get","status"],"completed"],"#A6DE36",["==",["get","status"],"under_construction"],"#FFBC36",["==",["get","status"],"in_preparation"],"#00C4F3","#FFFFFF"],"line-width":["interpolate",["linear"],["zoom"],12,4,22,18]},metadata:{"maptoolkit:states":{select:{}}}},{id:"wien__fahrradwien__symbol_0",source:"wien__fahrradwien","source-layer":"fahrradwien",type:"symbol",layout:{"symbol-placement":"line-center","icon-image":["concat","fahrradwien-status-",["get","status"]],"icon-size":["interpolate",["linear"],["zoom"],12,.9,22,1],"icon-ignore-placement":!0,"icon-rotation-alignment":"viewport"},paint:{"icon-opacity":["case",["all",["!=",["feature-state","hover"],!0],["!=",["feature-state","select"],!0]],1,0]},metadata:{"maptoolkit:states":{hover:{},select:{}}}},{id:"wien__fahrradwien__symbol_1",source:"wien__fahrradwien","source-layer":"fahrradwien",type:"symbol",layout:{"symbol-placement":"line-center","icon-image":["concat","fahrradwien-status-",["get","status"],"-hover"],"icon-size":["interpolate",["linear"],["zoom"],12,.9,22,1],"icon-ignore-placement":!0,"icon-rotation-alignment":"viewport"},paint:{"icon-opacity":["case",["all",["==",["feature-state","hover"],!0],["!=",["feature-state","select"],!0]],1,0]},metadata:{"maptoolkit:states":{hover:{},select:{}}}},{id:"wien__fahrradwien__symbol_2",source:"wien__fahrradwien","source-layer":"fahrradwien",type:"symbol",layout:{"symbol-placement":"line-center","icon-image":["concat","fahrradwien-status-",["get","status"],"-select"],"icon-size":["interpolate",["linear"],["zoom"],12,.9,22,1],"icon-ignore-placement":!0,"icon-rotation-alignment":"viewport"},paint:{"icon-opacity":["case",["==",["feature-state","select"],!0],1,0]},metadata:{"maptoolkit:states":{hover:{},select:{}}}}],yS={apiKey:"wien",locale:"de",style:"maptoolkit://styles/wien/fahrradwien",center:[16.37467,48.20746],zoom:11,hash:"map"},vS="maptoolkit://sprite/wien",xS=["in_preparation","under_construction","completed"],bS="",Vv=$1(dS);Vv.use(q1());const ba=Lp();ba.fahrradwienSource=mS;ba.fahrradwienLayers=_S;ba.administrativeSource=fS;ba.administrativeLayer=gS;ba.mapOptions=yS;ba.mapSprite=vS;ba.statusFilter=xS;ba.yearFilter=bS;Vv.mount("#app");

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.